@zumer/snapdom 2.0.0 → 2.0.2
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 +37 -7
- package/dist/modules/chunks/chunk-3PHM6WOF.js +7 -0
- package/dist/modules/chunks/chunk-3VYIPD3A.js +7 -0
- package/dist/modules/chunks/chunk-4E2QQYX5.js +7 -0
- package/dist/modules/chunks/chunk-4IERUYP4.js +7 -0
- package/dist/modules/chunks/chunk-4Z46XXMY.js +10 -0
- package/dist/modules/chunks/chunk-5ZWTRQ52.js +10 -0
- package/dist/modules/chunks/chunk-7427JF2H.js +10 -0
- package/dist/modules/chunks/chunk-ANSXOGKI.js +7 -0
- package/dist/modules/chunks/chunk-BUMT6T6O.js +10 -0
- package/dist/modules/chunks/chunk-CNTQFGEZ.js +10 -0
- package/dist/modules/chunks/chunk-CS7DTJ7I.js +7 -0
- package/dist/modules/chunks/chunk-DTQFIIVX.js +7 -0
- package/dist/modules/chunks/chunk-EVYDSB2B.js +7 -0
- package/dist/modules/chunks/chunk-EZMCZKDW.js +7 -0
- package/dist/modules/chunks/chunk-FQK3JDTN.js +10 -0
- package/dist/modules/chunks/chunk-GIYVHLCQ.js +8 -0
- package/dist/modules/chunks/chunk-GZX3IERM.js +8 -0
- package/dist/modules/chunks/chunk-LCE36WDF.js +10 -0
- package/dist/modules/chunks/chunk-MW6X4KTL.js +7 -0
- package/dist/modules/chunks/chunk-N2KKO64J.js +10 -0
- package/dist/modules/chunks/chunk-PZIG3IRP.js +10 -0
- package/dist/modules/chunks/chunk-Q2Z2CG2I.js +7 -0
- package/dist/modules/chunks/chunk-Q55H7S7M.js +7 -0
- package/dist/modules/chunks/chunk-QBJ6HQLA.js +10 -0
- package/dist/modules/chunks/chunk-RKOPBBFA.js +10 -0
- package/dist/modules/chunks/chunk-SMBRKOUP.js +7 -0
- package/dist/modules/chunks/chunk-T4JIPPZO.js +7 -0
- package/dist/modules/chunks/chunk-X6RBKLFD.js +10 -0
- package/dist/modules/chunks/chunk-Y7FY32AO.js +7 -0
- package/dist/modules/chunks/rasterize-34PCWURX.js +7 -0
- package/dist/modules/chunks/rasterize-JS5G2XHH.js +7 -0
- package/dist/modules/exporters/download.js +2 -2
- package/dist/modules/exporters/toBlob.js +2 -2
- package/dist/modules/exporters/toCanvas.js +2 -2
- package/dist/modules/exporters/toImg.js +2 -2
- package/dist/modules/exporters/toJpg.js +2 -2
- package/dist/modules/exporters/toPng.js +2 -2
- package/dist/modules/exporters/toSvg.js +2 -2
- package/dist/modules/exporters/toWebp.js +2 -2
- package/dist/modules/plugins.js +2 -2
- package/dist/modules/preCache.js +2 -2
- package/dist/modules/snapdom.js +2 -2
- package/dist/snapdom.js +4 -4
- package/dist/snapdom.mjs +9 -5252
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
|
|
32
32
|
<p align="center">English | <a href="README_CN.md">简体中文</a></p>
|
|
33
33
|
|
|
34
|
-
#
|
|
34
|
+
# SnapDOM
|
|
35
35
|
|
|
36
36
|
**SnapDOM** is a next-generation **DOM Capture Engine** — ultra-fast, modular, and extensible.
|
|
37
37
|
It converts any DOM subtree into a self-contained representation that can be exported to SVG, PNG, JPG, WebP, Canvas, Blob, or **any custom format** through plugins.
|
|
@@ -196,7 +196,7 @@ const result = await snapdom(el);
|
|
|
196
196
|
const img = await result.toPng();
|
|
197
197
|
document.body.appendChild(img);
|
|
198
198
|
|
|
199
|
-
await result.download({ format: 'jpg', filename: 'my-capture' });
|
|
199
|
+
await result.download({ format: 'jpg', filename: 'my-capture.jpg' });
|
|
200
200
|
```
|
|
201
201
|
|
|
202
202
|
### One-step shortcuts
|
|
@@ -242,9 +242,40 @@ Returns an object with reusable export methods:
|
|
|
242
242
|
| `snapdom.toWebp(el, options?)` | Returns a WebP image |
|
|
243
243
|
| `snapdom.download(el, options?)` | Triggers a download |
|
|
244
244
|
|
|
245
|
-
|
|
245
|
+
### Exporter-specific options
|
|
246
|
+
|
|
247
|
+
Some exporters accept a small set of **export-only options** in addition to the global capture options.
|
|
248
|
+
|
|
249
|
+
#### `download()`
|
|
250
|
+
|
|
251
|
+
| Option | Type | Default | Description |
|
|
252
|
+
| --- | --- | --- | --- |
|
|
253
|
+
| `filename` | `string` | `snapdom` | Download name. |
|
|
254
|
+
| `format` | `"png" \| "jpeg" \| "jpg" \| "webp" \| "svg"` | `"png"` | Output format for the downloaded file. |
|
|
255
|
+
|
|
256
|
+
**Example:**
|
|
257
|
+
|
|
258
|
+
```js
|
|
259
|
+
await result.download({
|
|
260
|
+
format: 'jpg',
|
|
261
|
+
quality: 0.92,
|
|
262
|
+
filename: 'my-capture'
|
|
263
|
+
});
|
|
264
|
+
```
|
|
246
265
|
|
|
247
|
-
|
|
266
|
+
#### `toBlob()`
|
|
267
|
+
|
|
268
|
+
| Option | Type | Default | Description |
|
|
269
|
+
| --- | --- | --- | --- |
|
|
270
|
+
| `type` | `"svg" \| "png" \| "jpeg" \| "jpg" \| "webp"` | `"svg"` | Blob type to generate. |
|
|
271
|
+
|
|
272
|
+
**Example:**
|
|
273
|
+
|
|
274
|
+
```js
|
|
275
|
+
const blob = await result.toBlob({ type: 'jpeg', quality: 0.92 });
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
## Options
|
|
248
279
|
|
|
249
280
|
All capture methods accept an `options` object:
|
|
250
281
|
|
|
@@ -263,7 +294,6 @@ All capture methods accept an `options` object:
|
|
|
263
294
|
| `backgroundColor` | string | `"#fff"` | Fallback color for JPG/WebP |
|
|
264
295
|
| `quality` | number | `1` | Quality for JPG/WebP (0 to 1) |
|
|
265
296
|
| `useProxy` | string | `''` | Proxy base for CORS fallbacks |
|
|
266
|
-
| `type` | string | `svg` | Default Blob type (`svg`\|`png`\|`jpg`\|`webp`) |
|
|
267
297
|
| `exclude` | string[] | - | CSS selectors to exclude |
|
|
268
298
|
| `excludeMode` | `"hide"`\|`"remove"` | `"hide"` | How `exclude` is applied |
|
|
269
299
|
| `filter` | function | - | Custom predicate `(el) => boolean` |
|
|
@@ -796,6 +826,7 @@ For detailed contribution guidelines, please see [CONTRIBUTING](https://github.c
|
|
|
796
826
|
<a href="https://github.com/tarwin" title="tarwin"><img src="https://avatars.githubusercontent.com/u/646149?v=4&s=100" style="border-radius:10px; width:60px; height:60px; object-fit:cover; margin:5px;" alt="tarwin"/></a>
|
|
797
827
|
<a href="https://github.com/jswhisperer" title="jswhisperer"><img src="https://avatars.githubusercontent.com/u/1177690?v=4&s=100" style="border-radius:10px; width:60px; height:60px; object-fit:cover; margin:5px;" alt="jswhisperer"/></a>
|
|
798
828
|
<a href="https://github.com/K1ender" title="K1ender"><img src="https://avatars.githubusercontent.com/u/146767945?v=4&s=100" style="border-radius:10px; width:60px; height:60px; object-fit:cover; margin:5px;" alt="K1ender"/></a>
|
|
829
|
+
<a href="https://github.com/Amyuan23" title="Amyuan23"><img src="https://avatars.githubusercontent.com/u/25892910?v=4&s=100" style="border-radius:10px; width:60px; height:60px; object-fit:cover; margin:5px;" alt="Amyuan23"/></a>
|
|
799
830
|
<a href="https://github.com/17biubiu" title="17biubiu"><img src="https://avatars.githubusercontent.com/u/13295895?v=4&s=100" style="border-radius:10px; width:60px; height:60px; object-fit:cover; margin:5px;" alt="17biubiu"/></a>
|
|
800
831
|
<a href="https://github.com/av01d" title="av01d"><img src="https://avatars.githubusercontent.com/u/6247646?v=4&s=100" style="border-radius:10px; width:60px; height:60px; object-fit:cover; margin:5px;" alt="av01d"/></a>
|
|
801
832
|
<a href="https://github.com/CHOYSEN" title="CHOYSEN"><img src="https://avatars.githubusercontent.com/u/25995358?v=4&s=100" style="border-radius:10px; width:60px; height:60px; object-fit:cover; margin:5px;" alt="CHOYSEN"/></a>
|
|
@@ -811,7 +842,6 @@ For detailed contribution guidelines, please see [CONTRIBUTING](https://github.c
|
|
|
811
842
|
<a href="https://github.com/xiaobai-web715" title="xiaobai-web715"><img src="https://avatars.githubusercontent.com/u/81091224?v=4&s=100" style="border-radius:10px; width:60px; height:60px; object-fit:cover; margin:5px;" alt="xiaobai-web715"/></a>
|
|
812
843
|
<a href="https://github.com/miusuncle" title="miusuncle"><img src="https://avatars.githubusercontent.com/u/7549857?v=4&s=100" style="border-radius:10px; width:60px; height:60px; object-fit:cover; margin:5px;" alt="miusuncle"/></a>
|
|
813
844
|
<a href="https://github.com/rbbydotdev" title="rbbydotdev"><img src="https://avatars.githubusercontent.com/u/101137670?v=4&s=100" style="border-radius:10px; width:60px; height:60px; object-fit:cover; margin:5px;" alt="rbbydotdev"/></a>
|
|
814
|
-
<a href="https://github.com/Amyuan23" title="Amyuan23"><img src="https://avatars.githubusercontent.com/u/25892910?v=4&s=100" style="border-radius:10px; width:60px; height:60px; object-fit:cover; margin:5px;" alt="Amyuan23"/></a>
|
|
815
845
|
<a href="https://github.com/zhanghaotian2018" title="zhanghaotian2018"><img src="https://avatars.githubusercontent.com/u/169218899?v=4&s=100" style="border-radius:10px; width:60px; height:60px; object-fit:cover; margin:5px;" alt="zhanghaotian2018"/></a>
|
|
816
846
|
<a href="https://github.com/kohaiy" title="kohaiy"><img src="https://avatars.githubusercontent.com/u/15622127?v=4&s=100" style="border-radius:10px; width:60px; height:60px; object-fit:cover; margin:5px;" alt="kohaiy"/></a>
|
|
817
847
|
<a href="https://github.com/fu050409" title="fu050409"><img src="https://avatars.githubusercontent.com/u/46275354?v=4&s=100" style="border-radius:10px; width:60px; height:60px; object-fit:cover; margin:5px;" alt="fu050409"/></a>
|
|
@@ -820,7 +850,7 @@ For detailed contribution guidelines, please see [CONTRIBUTING](https://github.c
|
|
|
820
850
|
|
|
821
851
|
## Sponsors
|
|
822
852
|
|
|
823
|
-
Special thanks to [@megaphonecolin](https://github.com/megaphonecolin), [@sdraper69](https://github.com/sdraper69), [@reynaldichernando](https://github.com/reynaldichernando)
|
|
853
|
+
Special thanks to [@megaphonecolin](https://github.com/megaphonecolin), [@sdraper69](https://github.com/sdraper69), [@reynaldichernando](https://github.com/reynaldichernando), [@gamma-app](https://github.com/gamma-app) and [@jrjohnson](https://github.com/jrjohnson),for supporting this project!
|
|
824
854
|
|
|
825
855
|
If you'd like to support this project too, you can [become a sponsor](https://github.com/sponsors/tinchox5).
|
|
826
856
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* SnapDOM
|
|
3
|
+
* v2.0.0
|
|
4
|
+
* Author: Juan Martin Muda
|
|
5
|
+
* License: MIT
|
|
6
|
+
*/
|
|
7
|
+
import{e as S,f as A,g as w,h as C,i as b}from"./chunk-CRBLWEX6.js";import{a as c,b as y,f as d,g as h,j as g,o as p}from"./chunk-BF74J4A5.js";import{b as o}from"./chunk-FTKOXG2W.js";async function I(e=document,t={}){let{embedFonts:k=!0,useProxy:i=""}=t,F=t.cache??t.cacheOpt??"full";y(F);try{await document.fonts?.ready}catch{}try{g()}catch{}c.session=c.session||{},c.session.styleCache||(c.session.styleCache=new WeakMap),c.image=c.image||new Map,c.background=c.background||new Map;try{await b(e,void 0,c.session.styleCache,{useProxy:i})}catch{}let n=[],m=[];try{if(e&&e.nodeType===1){let s=e.querySelectorAll?Array.from(e.querySelectorAll("*")):[];m=[e,...s],n=[],e.tagName==="IMG"&&e.getAttribute("src")&&n.push(e),n.push(...Array.from(e.querySelectorAll?.("img[src]")||[]))}else e?.querySelectorAll&&(n=Array.from(e.querySelectorAll("img[src]")),m=Array.from(e.querySelectorAll("*")))}catch{}let f=[];for(let s of n){let a=s?.currentSrc||s?.src;if(a&&!c.image.has(a)){let l=Promise.resolve().then(async()=>{let r=await d(a,{as:"dataURL",useProxy:i});r?.ok&&typeof r.data=="string"&&c.image.set(a,r.data)}).catch(()=>{});f.push(l)}}for(let s of m){let a="";try{a=s?.style?.backgroundImage||"",(!a||a==="none")&&(a=p(s).backgroundImage)}catch{}if(a&&a!=="none"){let l=a.match(/url\((?:[^()"']+|"(?:[^"]*)"|'(?:[^']*)')\)/gi)||[];for(let r of l){let u=Promise.resolve().then(()=>h(r,{...t,useProxy:i})).catch(()=>{});f.push(u)}}}if(k)try{let s=A(e),a=w(e);if(typeof o=="function"?o():!!o){let r=new Set(Array.from(s).map(u=>String(u).split("__")[0]).filter(Boolean));await C(r,3)}await S({required:s,usedCodepoints:a,exclude:t.excludeFonts,localFonts:t.localFonts,useProxy:t.useProxy??i})}catch{}await Promise.allSettled(f)}export{I as a};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* SnapDOM
|
|
3
|
+
* v2.0.1
|
|
4
|
+
* Author: Juan Martin Muda
|
|
5
|
+
* License: MIT
|
|
6
|
+
*/
|
|
7
|
+
import{b}from"./chunk-Q55H7S7M.js";function S(e){return typeof e=="string"&&/^data:image\/svg\+xml/i.test(e)}function C(e){let n=e.indexOf(",");return n>=0?decodeURIComponent(e.slice(n+1)):""}function v(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}function D(e){let n=[],t="",i=0;for(let a=0;a<e.length;a++){let o=e[a];o==="("&&i++,o===")"&&(i=Math.max(0,i-1)),o===";"&&i===0?(n.push(t),t=""):t+=o}return t.trim()&&n.push(t),n.map(a=>a.trim()).filter(Boolean)}function k(e){let n=[],t="",i=0;for(let o=0;o<e.length;o++){let c=e[o];c==="("&&i++,c===")"&&(i=Math.max(0,i-1)),c===","&&i===0?(n.push(t.trim()),t=""):t+=c}t.trim()&&n.push(t.trim());let a=[];for(let o of n){if(/\binset\b/i.test(o))continue;let c=o.match(/-?\d+(?:\.\d+)?px/gi)||[],[s="0px",r="0px",u="0px"]=c,l=o.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),p=!!l&&l!==",";a.push(`drop-shadow(${s} ${r} ${u}${p?` ${l}`:""})`)}return a.join(" ")}function y(e){let n=D(e),t=null,i=null,a=null,o=[];for(let s of n){let r=s.indexOf(":");if(r<0)continue;let u=s.slice(0,r).trim().toLowerCase(),l=s.slice(r+1).trim();u==="box-shadow"?a=l:u==="filter"?t=l:u==="-webkit-filter"?i=l:o.push([u,l])}if(a){let s=k(a);s&&(t=t?`${t} ${s}`:s,i=i?`${i} ${s}`:s)}let c=[...o];return t&&c.push(["filter",t]),i&&c.push(["-webkit-filter",i]),c.map(([s,r])=>`${s}:${r}`).join(";")}function F(e){return e.replace(/([^{}]+)\{([^}]*)\}/g,(n,t,i)=>`${t}{${y(i)}}`)}function H(e){return e=e.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(n,t)=>n.replace(t,F(t))),e=e.replace(/style=(['"])([\s\S]*?)\1/gi,(n,t,i)=>`style=${t}${y(i)}${t}`),e}function M(e){if(!b()||!S(e))return e;try{let n=C(e),t=H(n);return v(t)}catch{return e}}async function W(e,n){let{width:t,height:i,scale:a=1,dpr:o=1,meta:c={},backgroundColor:s}=n;e=M(e);let r=new Image;r.loading="eager",r.decoding="sync",r.crossOrigin="anonymous",r.src=e,await r.decode();let u=r.naturalWidth,l=r.naturalHeight,p=Number.isFinite(c.w0)?c.w0:u,x=Number.isFinite(c.h0)?c.h0:l,f,h,w=Number.isFinite(t),$=Number.isFinite(i);if(w&&$)f=Math.max(1,t),h=Math.max(1,i);else if(w){let g=t/Math.max(1,p);f=t,h=x*g}else if($){let g=i/Math.max(1,x);h=i,f=p*g}else f=u,h=l;f=f*a,h=h*a;let d=document.createElement("canvas");d.width=f*o,d.height=h*o,d.style.width=`${f}px`,d.style.height=`${h}px`;let m=d.getContext("2d");return o!==1&&m.scale(o,o),s&&(m.save(),m.fillStyle=s,m.fillRect(0,0,f,h),m.restore()),m.drawImage(r,0,0,f,h),d}export{W as a};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* SnapDOM
|
|
3
|
+
* v2.0.1
|
|
4
|
+
* Author: Juan Martin Muda
|
|
5
|
+
* License: MIT
|
|
6
|
+
*/
|
|
7
|
+
import{e as S,f as A,g as w,h as C,i as b}from"./chunk-5ZWTRQ52.js";import{a as c,b as y,f as d,g as h,j as g,o as p}from"./chunk-GZX3IERM.js";import{b as o}from"./chunk-Q55H7S7M.js";async function I(e=document,t={}){let{embedFonts:k=!0,useProxy:i=""}=t,F=t.cache??t.cacheOpt??"full";y(F);try{await document.fonts?.ready}catch{}try{g()}catch{}c.session=c.session||{},c.session.styleCache||(c.session.styleCache=new WeakMap),c.image=c.image||new Map,c.background=c.background||new Map;try{await b(e,void 0,c.session.styleCache,{useProxy:i})}catch{}let n=[],m=[];try{if(e&&e.nodeType===1){let s=e.querySelectorAll?Array.from(e.querySelectorAll("*")):[];m=[e,...s],n=[],e.tagName==="IMG"&&e.getAttribute("src")&&n.push(e),n.push(...Array.from(e.querySelectorAll?.("img[src]")||[]))}else e?.querySelectorAll&&(n=Array.from(e.querySelectorAll("img[src]")),m=Array.from(e.querySelectorAll("*")))}catch{}let f=[];for(let s of n){let a=s?.currentSrc||s?.src;if(a&&!c.image.has(a)){let l=Promise.resolve().then(async()=>{let r=await d(a,{as:"dataURL",useProxy:i});r?.ok&&typeof r.data=="string"&&c.image.set(a,r.data)}).catch(()=>{});f.push(l)}}for(let s of m){let a="";try{a=s?.style?.backgroundImage||"",(!a||a==="none")&&(a=p(s).backgroundImage)}catch{}if(a&&a!=="none"){let l=a.match(/url\((?:[^()"']+|"(?:[^"]*)"|'(?:[^']*)')\)/gi)||[];for(let r of l){let u=Promise.resolve().then(()=>h(r,{...t,useProxy:i})).catch(()=>{});f.push(u)}}}if(k)try{let s=A(e),a=w(e);if(typeof o=="function"?o():!!o){let r=new Set(Array.from(s).map(u=>String(u).split("__")[0]).filter(Boolean));await C(r,3)}await S({required:s,usedCodepoints:a,exclude:t.excludeFonts,localFonts:t.localFonts,useProxy:t.useProxy??i})}catch{}await Promise.allSettled(f)}export{I as a};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* SnapDOM
|
|
3
|
+
* v2.0.1
|
|
4
|
+
* Author: Juan Martin Muda
|
|
5
|
+
* License: MIT
|
|
6
|
+
*/
|
|
7
|
+
import{a as l}from"./chunk-ANSXOGKI.js";import{b as m}from"./chunk-Q55H7S7M.js";async function x(i,g){let{scale:n=1,width:h,height:o,meta:e={}}=g,c=Number.isFinite(h),d=Number.isFinite(o),p=Number.isFinite(n)&&n!==1||c||d;if(m()&&p)return await l(i,{...g,format:"png",quality:1,meta:e});let t=new Image;if(t.decoding="sync",t.loading="eager",t.src=i,await t.decode(),c&&d)t.style.width=`${h}px`,t.style.height=`${o}px`;else if(c){let s=Number.isFinite(e.w0)?e.w0:t.naturalWidth,a=Number.isFinite(e.h0)?e.h0:t.naturalHeight,r=h/Math.max(1,s);t.style.width=`${h}px`,t.style.height=`${Math.round(a*r)}px`}else if(d){let s=Number.isFinite(e.w0)?e.w0:t.naturalWidth,a=Number.isFinite(e.h0)?e.h0:t.naturalHeight,r=o/Math.max(1,a);t.style.height=`${o}px`,t.style.width=`${Math.round(s*r)}px`}else{let s=Math.round(t.naturalWidth*n),a=Math.round(t.naturalHeight*n);if(t.style.width=`${s}px`,t.style.height=`${a}px`,typeof i=="string"&&i.startsWith("data:image/svg+xml"))try{let f=decodeURIComponent(i.split(",")[1]).replace(/width="[^"]*"/,`width="${s}"`).replace(/height="[^"]*"/,`height="${a}"`);i=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(f)}`,t.src=i}catch{}}return t}export{x as a};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* SnapDOM
|
|
3
|
+
* v2.0.1
|
|
4
|
+
* Author: Juan Martin Muda
|
|
5
|
+
* License: MIT
|
|
6
|
+
*/
|
|
7
|
+
import{b as qt,c as Vt,d as Yt,e as Ut,f as jt,g as Kt,h as Gt,i as Zt}from"./chunk-5ZWTRQ52.js";import{c as Q}from"./chunk-DTQFIIVX.js";import{a as A,b as $t,c as It,d as Lt,e as Wt,f as U,g as _t,h as Ht,i as Bt,k as ot,l as Rt,m as Dt,n as Ot,o as zt,p as St,q as Xt}from"./chunk-GZX3IERM.js";import{a as O,b as st}from"./chunk-Q55H7S7M.js";var Jt=new WeakMap,Ct=new Map,vt=0;function it(){vt++}var Qt=!1;function en(t=document.documentElement){if(!Qt){Qt=!0;try{new MutationObserver(()=>it()).observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{new MutationObserver(()=>it()).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{let e=document.fonts;e&&(e.addEventListener?.("loadingdone",it),e.ready?.then(()=>it()).catch(()=>{}))}catch{}}}function nn(t,e={}){let n={},r=t.getPropertyValue("visibility");for(let o=0;o<t.length;o++){let s=t[o],u=t.getPropertyValue(s);(s==="background-image"||s==="content")&&u.includes("url(")&&!u.includes("data:")&&(u="none"),n[s]=u}let a=["text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-decoration-skip-ink"];for(let o of a)if(!n[o])try{let s=t.getPropertyValue(o);s&&(n[o]=s)}catch{}if(e.embedFonts){let o=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let s of o)if(!n[s])try{let u=t.getPropertyValue(s);u&&(n[s]=u)}catch{}}return r==="hidden"&&(n.opacity="0"),n}var te=new WeakMap;function rn(t){let e=te.get(t);return e||(e=Object.entries(t).sort((r,a)=>r[0]<a[0]?-1:r[0]>a[0]?1:0).map(([r,a])=>`${r}:${a}`).join(";"),te.set(t,e),e)}function on(t,e=null,n={}){let r=Jt.get(t);if(r&&r.epoch===vt)return r.snapshot;let a=e||getComputedStyle(t),o=nn(a,n);return fn(t,a,o),Jt.set(t,{epoch:vt,snapshot:o}),o}function sn(t,e){return t&&t.session&&t.persist?t:t&&(t.styleMap||t.styleCache||t.nodeMap)?{session:t,persist:{snapshotKeyCache:Ct,defaultStyle:A.defaultStyle,baseStyle:A.baseStyle,image:A.image,resource:A.resource,background:A.background,font:A.font},options:e||{}}:{session:A.session,persist:{snapshotKeyCache:Ct,defaultStyle:A.defaultStyle,baseStyle:A.baseStyle,image:A.image,resource:A.resource,background:A.background,font:A.font},options:t||e||{}}}async function z(t,e,n,r){if(t.tagName==="STYLE")return;let a=sn(n,r),o=a.options&&a.options.cache||"auto";if(o!=="disabled"&&en(document.documentElement),o==="disabled"&&!a.session.__bumpedForDisabled&&(it(),Ct.clear(),a.session.__bumpedForDisabled=!0),Bt.has(t.tagName?.toLowerCase())){let d=t.getAttribute?.("style");d&&e.setAttribute("style",d)}let{session:s,persist:u}=a;s.styleCache.has(t)||s.styleCache.set(t,getComputedStyle(t));let c=s.styleCache.get(t),i=on(t,c,a.options),l=rn(i),f=u.snapshotKeyCache.get(l);if(!f){let d=t.tagName?.toLowerCase()||"div";f=ot(i,d),u.snapshotKeyCache.set(l,f)}s.styleMap.set(e,f)}function an(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof HTMLIFrameElement||t instanceof SVGElement||t instanceof HTMLObjectElement||t instanceof HTMLEmbedElement}function ln(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 cn(t){let e=t.parentElement;if(!e)return!1;let n=getComputedStyle(e).display||"";return n.includes("flex")||n.includes("grid")}function un(t,e){if(t.textContent&&/\S/.test(t.textContent))return!0;let n=t.firstElementChild,r=t.lastElementChild;if(n&&n.tagName==="BR"||r&&r.tagName==="BR")return!0;let a=t.scrollHeight;if(a===0)return!1;let o=parseFloat(e.paddingTop)||0,s=parseFloat(e.paddingBottom)||0;return a>o+s}function fn(t,e,n){if(t instanceof HTMLElement&&t.style&&t.style.height)return;let r=t.tagName&&t.tagName.toLowerCase();if(!r||r!=="div"&&r!=="section"&&r!=="article"&&r!=="main"&&r!=="aside"&&r!=="header"&&r!=="footer"&&r!=="nav"&&r!=="ol"&&r!=="ul"&&r!=="li")return;let a=e.display||"";if(a.includes("flex")||a.includes("grid")||an(t))return;let o=e.position;if(o==="absolute"||o==="fixed"||o==="sticky"||e.transform!=="none"||ln(e)||cn(t))return;let s=e.overflowX||e.overflow||"visible",u=e.overflowY||e.overflow||"visible";if(s!=="visible"||u!=="visible")return;let c=e.clip;c&&c!=="auto"&&c!=="rect(auto, auto, auto, auto)"||e.visibility==="hidden"||e.opacity==="0"||un(t,e)&&(delete n.height,delete n["block-size"])}var ne=["fill","stroke","color","background-color","stop-color"],ee=new Map;function dn(t,e){let n=e+"::"+t.toLowerCase(),r=ee.get(n);if(r)return r;let a=document,o=e==="http://www.w3.org/2000/svg"?a.createElementNS(e,t):a.createElement(t),s=a.createElement("div");s.style.cssText="position:absolute;left:-99999px;top:-99999px;contain:strict;display:block;",s.appendChild(o),a.documentElement.appendChild(s);let u=getComputedStyle(o),c={};for(let i of ne)c[i]=u.getPropertyValue(i)||"";return s.remove(),ee.set(n,c),c}function re(t,e){if(!(t instanceof Element)||!(e instanceof Element))return;let n=t.getAttribute?.("style"),r=!!(n&&n.includes("var("));if(!r&&t.attributes?.length){let o=t.attributes;for(let s=0;s<o.length;s++){let u=o[s];if(u&&typeof u.value=="string"&&u.value.includes("var(")){r=!0;break}}}let a=null;if(r)try{a=getComputedStyle(t)}catch{}if(r){let o=t.style;if(o&&o.length)for(let s=0;s<o.length;s++){let u=o[s],c=o.getPropertyValue(u);if(!c||!c.includes("var("))continue;let i=a&&a.getPropertyValue(u);if(i)try{e.style.setProperty(u,i.trim(),o.getPropertyPriority(u))}catch{}}}if(r&&t.attributes?.length){let o=t.attributes;for(let s=0;s<o.length;s++){let u=o[s];if(!u||typeof u.value!="string"||!u.value.includes("var("))continue;let c=u.name,i=a&&a.getPropertyValue(c);if(i)try{e.style.setProperty(c,i.trim())}catch{}}}if(!r){if(!a)try{a=getComputedStyle(t)}catch{a=null}if(!a)return;let o=t.namespaceURI||"html",s=dn(t.tagName,o);for(let u of ne){let c=a.getPropertyValue(u)||"",i=s[u]||"";if(c&&c!==i)try{e.style.setProperty(u,c.trim())}catch{}}}}function mt(t,e,n){return Promise.all(t.map(r=>new Promise(a=>{function o(){O(s=>{(s&&typeof s.timeRemaining=="function"?s.timeRemaining()>0:!0)?e(r,a):o()},{fast:n})}o()})))}function hn(t){return t=t.trim(),!t||/:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(t)?t:`${t}:not([data-sd-slotted])`}function mn(t,e,n=!0){return t.split(",").map(r=>r.trim()).filter(Boolean).map(r=>{if(r.startsWith(":where(")||r.startsWith("@"))return r;let a=n?hn(r):r;return`:where(${e} ${a})`}).join(", ")}function se(t,e){return t?(t=t.replace(/:host\(([^)]+)\)/g,(n,r)=>`:where(${e}:is(${r.trim()}))`),t=t.replace(/:host\b/g,`:where(${e})`),t=t.replace(/:host-context\(([^)]+)\)/g,(n,r)=>`:where(:where(${r.trim()}) ${e})`),t=t.replace(/::slotted\(([^)]+)\)/g,(n,r)=>`:where(${e} ${r.trim()})`),t=t.replace(/(^|})(\s*)([^@}{]+){/g,(n,r,a,o)=>{let s=mn(o,e,!0);return`${r}${a}${s}{`}),t):""}function ie(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}function ae(t){let e="";try{t.querySelectorAll("style").forEach(r=>{e+=(r.textContent||"")+`
|
|
8
|
+
`});let n=t.adoptedStyleSheets||[];for(let r of n)try{if(r&&r.cssRules)for(let a of r.cssRules)e+=a.cssText+`
|
|
9
|
+
`}catch{}}catch{}return e}function le(t,e,n){if(!e)return;let r=document.createElement("style");r.setAttribute("data-sd",n),r.textContent=e,t.insertBefore(r,t.firstChild||null)}function ce(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{}}function ue(t){let e=new Set;if(!t)return e;let n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,r;for(;r=n.exec(t);)e.add(r[1]);return e}function pn(t,e){try{let r=getComputedStyle(t).getPropertyValue(e).trim();if(r)return r}catch{}try{let r=getComputedStyle(document.documentElement).getPropertyValue(e).trim();if(r)return r}catch{}return""}function fe(t,e,n){let r=[];for(let a of e){let o=pn(t,a);o&&r.push(`${a}: ${o};`)}return r.length?`${n}{${r.join("")}}
|
|
10
|
+
`:""}function de(t){t&&(t.nodeType===Node.ELEMENT_NODE&&t.setAttribute("data-sd-slotted",""),t.querySelectorAll&&t.querySelectorAll("*").forEach(e=>e.setAttribute("data-sd-slotted","")))}async function gn(t,e=3){let n=()=>{try{return t.contentDocument||t.contentWindow?.document||null}catch{return null}},r=n(),a=0;for(;a<e&&(!r||!r.body&&!r.documentElement);)await new Promise(o=>setTimeout(o,0)),r=n(),a++;return r&&(r.body||r.documentElement)?r:null}function yn(t){let e=t.getBoundingClientRect(),n=0,r=0,a=0,o=0;try{let c=getComputedStyle(t);n=parseFloat(c.borderLeftWidth)||0,r=parseFloat(c.borderRightWidth)||0,a=parseFloat(c.borderTopWidth)||0,o=parseFloat(c.borderBottomWidth)||0}catch{}let s=Math.max(0,Math.round(e.width-(n+r))),u=Math.max(0,Math.round(e.height-(a+o)));return{contentWidth:s,contentHeight:u,rect:e}}function bn(t,e,n){let r=t.createElement("style");return r.setAttribute("data-sd-iframe-pin",""),r.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(r),()=>{try{r.remove()}catch{}}}async function he(t,e,n){let r=await gn(t,3);if(!r)throw new Error("iframe document not accessible/ready");let{contentWidth:a,contentHeight:o,rect:s}=yn(t),u=n?.snap;if(!u||typeof u.toPng!="function")throw new Error("snapdom.toPng not available in iframe or window");let c={...n,scale:1},i=bn(r,a,o),l;try{l=await u.toPng(r.documentElement,c)}finally{i()}l.style.display="block",l.style.width=`${a}px`,l.style.height=`${o}px`;let f=document.createElement("div");return e.nodeMap.set(f,t),z(t,f,e,n),f.style.overflow="hidden",f.style.display="block",f.style.width||(f.style.width=`${Math.round(s.width)}px`),f.style.height||(f.style.height=`${Math.round(s.height)}px`),f.appendChild(l),f}var at=new Map;async function lt(t){if(A.resource?.has(t))return A.resource.get(t);if(at.has(t))return at.get(t);let e=(async()=>{let n=await U(t,{as:"dataURL",silent:!0});if(!n.ok||typeof n.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${t}`);return A.resource?.set(t,n.data),n.data})();at.set(t,e);try{let n=await e;return at.set(t,n),n}catch(n){throw at.delete(t),n}}var xn=/\bblob:[^)"'\s]+/g;async function oe(t){if(!t||t.indexOf("blob:")===-1)return t;let e=Array.from(new Set(t.match(xn)||[]));if(e.length===0)return t;let n=t;for(let r of e)try{let a=await lt(r);n=n.split(r).join(a)}catch{}return n}function ht(t){return typeof t=="string"&&t.startsWith("blob:")}function wn(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 Sn(t){return t.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}async function me(t){if(!t)return;let e=t.querySelectorAll?t.querySelectorAll("img"):[];for(let s of e)try{let c=s.getAttribute("src")||s.currentSrc||"";if(ht(c)){let l=await lt(c);s.setAttribute("src",l)}let i=s.getAttribute("srcset");if(i&&i.includes("blob:")){let l=wn(i),f=!1;for(let d of l)if(ht(d.url))try{d.url=await lt(d.url),f=!0}catch{}f&&s.setAttribute("srcset",Sn(l))}}catch{}let n=t.querySelectorAll?t.querySelectorAll("image"):[];for(let s of n)try{let u="http://www.w3.org/1999/xlink",c=s.getAttribute("href")||s.getAttributeNS?.(u,"href");if(ht(c)){let i=await lt(c);s.setAttribute("href",i),s.removeAttributeNS?.(u,"href")}}catch{}let r=t.querySelectorAll?t.querySelectorAll("[style*='blob:']"):[];for(let s of r)try{let u=s.getAttribute("style");if(u&&u.includes("blob:")){let c=await oe(u);s.setAttribute("style",c)}}catch{}let a=t.querySelectorAll?t.querySelectorAll("style"):[];for(let s of a)try{let u=s.textContent||"";u.includes("blob:")&&(s.textContent=await oe(u))}catch{}let o=["poster"];for(let s of o){let u=t.querySelectorAll?t.querySelectorAll(`[${s}^='blob:']`):[];for(let c of u)try{let i=c.getAttribute(s);ht(i)&&c.setAttribute(s,await lt(i))}catch{}}}async function ct(t,e,n){if(!t)throw new Error("Invalid node");let r=new Set,a=null,o=null;if(t.nodeType===Node.ELEMENT_NODE){let i=(t.localName||t.tagName||"").toLowerCase();if(t.id==="snapdom-sandbox"||t.hasAttribute("data-snapdom-sandbox")||Ht.has(i))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 i=document.createElement("div"),l=t.getBoundingClientRect();return i.style.cssText=`display:inline-block;width:${l.width}px;height:${l.height}px;visibility:hidden;`,i}else if(n.excludeMode==="remove")return null}if(n.exclude&&Array.isArray(n.exclude))for(let i of n.exclude)try{if(t.matches?.(i)){if(n.excludeMode==="hide"){let l=document.createElement("div"),f=t.getBoundingClientRect();return l.style.cssText=`display:inline-block;width:${f.width}px;height:${f.height}px;visibility:hidden;`,l}else if(n.excludeMode==="remove")return null}}catch(l){console.warn(`Invalid selector in exclude option: ${i}`,l)}if(typeof n.filter=="function")try{if(!n.filter(t)){if(n.filterMode==="hide"){let i=document.createElement("div"),l=t.getBoundingClientRect();return i.style.cssText=`display:inline-block;width:${l.width}px;height:${l.height}px;visibility:hidden;`,i}else if(n.filterMode==="remove")return null}}catch(i){console.warn("Error in filter function:",i)}if(t.tagName==="IFRAME"){let i=!1;try{i=!!(t.contentDocument||t.contentWindow?.document)}catch{i=!1}if(i)try{return await he(t,e,n)}catch(l){console.warn("[SnapDOM] iframe rasterization failed, fallback:",l)}if(n.placeholders){let l=document.createElement("div");return l.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;`,z(t,l,e,n),l}else{let l=t.getBoundingClientRect(),f=document.createElement("div");return f.style.cssText=`display:inline-block;width:${l.width}px;height:${l.height}px;visibility:hidden;`,z(t,f,e,n),f}}if(t.getAttribute("data-capture")==="placeholder"){let i=t.cloneNode(!1);e.nodeMap.set(i,t),z(t,i,e,n);let l=document.createElement("div");return l.textContent=t.getAttribute("data-placeholder-text")||"",l.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",i.appendChild(l),i}if(t.tagName==="CANVAS"){let i="";try{let f=t.getContext("2d",{willReadFrequently:!0});try{f&&f.getImageData(0,0,1,1)}catch{}if(await new Promise(d=>requestAnimationFrame(d)),i=t.toDataURL("image/png"),!i||i==="data:,"){try{f&&f.getImageData(0,0,1,1)}catch{}if(await new Promise(d=>requestAnimationFrame(d)),i=t.toDataURL("image/png"),!i||i==="data:,"){let d=document.createElement("canvas");d.width=t.width,d.height=t.height;let h=d.getContext("2d");h&&(h.drawImage(t,0,0),i=d.toDataURL("image/png"))}}}catch{}let l=document.createElement("img");try{l.decoding="sync",l.loading="eager"}catch{}i&&(l.src=i),l.width=t.width,l.height=t.height;try{let f=getComputedStyle(t);f.width&&(l.style.width=f.width),f.height&&(l.style.height=f.height)}catch{}return e.nodeMap.set(l,t),z(t,l,e,n),l}let s;try{if(s=t.cloneNode(!1),re(t,s),e.nodeMap.set(s,t),t.tagName==="IMG"){ce(t,s);try{let i=t.getBoundingClientRect(),l=Math.round(i.width||0),f=Math.round(i.height||0);if(!l||!f){let d=window.getComputedStyle(t),h=parseFloat(d.width)||0,m=parseFloat(d.height)||0,g=parseInt(t.getAttribute("width")||"",10)||0,w=parseInt(t.getAttribute("height")||"",10)||0,M=t.width||t.naturalWidth||0,b=t.height||t.naturalHeight||0;l=Math.round(l||h||g||M||0),f=Math.round(f||m||w||b||0)}l&&(s.dataset.snapdomWidth=String(l)),f&&(s.dataset.snapdomHeight=String(f))}catch{}try{let i=t.getAttribute("style")||"",l=window.getComputedStyle(t),f=w=>{let M=i.match(new RegExp(`${w}\\s*:\\s*([^;]+)`,"i")),b=M?M[1].trim():l.getPropertyValue(w);return/%|auto/i.test(String(b||""))},d=parseInt(s.dataset.snapdomWidth||"0",10),h=parseInt(s.dataset.snapdomHeight||"0",10),m=f("width")||!d,g=f("height")||!h;m&&d&&(s.style.width=`${d}px`),g&&h&&(s.style.height=`${h}px`),d&&(s.style.minWidth=`${d}px`),h&&(s.style.minHeight=`${h}px`)}catch{}}}catch(i){throw console.error("[Snapdom] Failed to clone node:",t,i),i}if(t instanceof HTMLTextAreaElement){let i=t.getBoundingClientRect();s.style.width=`${i.width}px`,s.style.height=`${i.height}px`}if(t instanceof HTMLInputElement&&(s.value=t.value,s.setAttribute("value",t.value),t.checked!==void 0&&(s.checked=t.checked,t.checked&&s.setAttribute("checked",""),t.indeterminate&&(s.indeterminate=t.indeterminate))),t instanceof HTMLSelectElement&&(a=t.value),t instanceof HTMLTextAreaElement&&(o=t.value),z(t,s,e,n),t.shadowRoot){let w=function(b,x){if(b.nodeType===Node.ELEMENT_NODE&&b.tagName==="STYLE")return x(null);ct(b,e,n).then(p=>{x(p||null)}).catch(()=>{x(null)})};try{let b=t.shadowRoot.querySelectorAll("slot");for(let x of b){let p=[];try{p=x.assignedNodes?.({flatten:!0})||x.assignedNodes?.()||[]}catch{p=x.assignedNodes?.()||[]}for(let C of p)r.add(C)}}catch{}let i=ie(e),l=`[data-sd="${i}"]`;try{s.setAttribute("data-sd",i)}catch{}let f=ae(t.shadowRoot),d=se(f,l),h=ue(f),m=fe(t,h,l);le(s,m+d,i);let g=document.createDocumentFragment(),M=await mt(Array.from(t.shadowRoot.childNodes),w,n.fast);g.append(...M.filter(b=>!!b)),s.appendChild(g)}if(t.tagName==="SLOT"){let d=function(m,g){ct(m,e,n).then(w=>{w&&de(w),g(w||null)}).catch(()=>{g(null)})},i=t.assignedNodes?.({flatten:!0})||[],l=i.length>0?i:Array.from(t.childNodes),f=document.createDocumentFragment(),h=await mt(Array.from(l),d,n.fast);return f.append(...h.filter(m=>!!m)),f}function u(i,l){if(r.has(i))return l(null);ct(i,e,n).then(f=>{l(f||null)}).catch(()=>{l(null)})}let c=await mt(Array.from(t.childNodes),u,n.fast);if(s.append(...c.filter(i=>!!i)),a!==null&&s instanceof HTMLSelectElement){s.value=a;for(let i of s.options)i.value===a?i.setAttribute("selected",""):i.removeAttribute("selected")}return o!==null&&s instanceof HTMLTextAreaElement&&(s.textContent=o),s}function be(t){return/\bcounter\s*\(|\bcounters\s*\(/.test(t||"")}function Cn(t){return(t||"").replace(/"([^"]*)"/g,"$1")}function pe(t,e=!1){let n="",r=Math.max(1,t);for(;r>0;)r--,n=String.fromCharCode(97+r%26)+n,r=Math.floor(r/26);return e?n.toUpperCase():n}function ge(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"]],r=Math.max(1,Math.min(3999,t)),a="";for(let[o,s]of n)for(;r>=o;)a+=s,r-=o;return e?a:a.toLowerCase()}function ye(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 pe(t,!1);case"upper-alpha":return pe(t,!0);case"lower-roman":return ge(t,!1);case"upper-roman":return ge(t,!0);default:return String(Math.max(0,t))}}function xe(t){let e=()=>A?.session?.__counterEpoch??0,n=e(),r=new WeakMap,a=t instanceof Document?t.documentElement:t,o=d=>d&&d.tagName==="LI",s=d=>{let h=0,m=d?.parentElement;if(!m)return 0;for(let g of m.children){if(g===d)break;g.tagName==="LI"&&h++}return h},u=d=>{let h=new Map;for(let[m,g]of d)h.set(m,g.slice());return h},c=(d,h,m)=>{let g=u(d),w;try{w=m.style?.counterReset||getComputedStyle(m).counterReset}catch{}if(w&&w!=="none")for(let b of w.split(",")){let x=b.trim().split(/\s+/),p=x[0],C=Number.isFinite(Number(x[1]))?Number(x[1]):0;if(!p)continue;let y=h.get(p);if(y&&y.length){let v=y.slice();v.push(C),g.set(p,v)}else g.set(p,[C])}let M;try{M=m.style?.counterIncrement||getComputedStyle(m).counterIncrement}catch{}if(M&&M!=="none")for(let b of M.split(",")){let x=b.trim().split(/\s+/),p=x[0],C=Number.isFinite(Number(x[1]))?Number(x[1]):1;if(!p)continue;let y=g.get(p)||[];y.length===0&&y.push(0),y[y.length-1]+=C,g.set(p,y)}try{if(getComputedStyle(m).display==="list-item"&&o(m)){let x=m.parentElement,p=1;if(x&&x.tagName==="OL"){let y=x.getAttribute("start"),v=Number.isFinite(Number(y))?Number(y):1,E=s(m),F=m.getAttribute("value");p=Number.isFinite(Number(F))?Number(F):v+E}else p=1+s(m);let C=g.get("list-item")||[];C.length===0&&C.push(0),C[C.length-1]=p,g.set("list-item",C)}}catch{}return g},i=(d,h,m)=>{let g=c(m,h,d);r.set(d,g);let w=g;for(let M of d.children)w=i(M,g,w);return g},l=new Map;i(a,l,l);function f(){let d=e();if(d!==n){n=d;let h=new Map;i(a,h,h)}}return{get(d,h){f();let m=r.get(d)?.get(h);return m&&m.length?m[m.length-1]:0},getStack(d,h){f();let m=r.get(d)?.get(h);return m?m.slice():[]}}}function we(t,e,n){if(!t||t==="none")return t;try{let r=/\b(counter|counters)\s*\(([^)]+)\)/g,a=t.replace(r,(o,s,u)=>{let c=String(u).split(",").map(i=>i.trim());if(s==="counter"){let i=c[0]?.replace(/^["']|["']$/g,""),l=(c[1]||"decimal").toLowerCase(),f=n.get(e,i);return ye(f,l)}else{let i=c[0]?.replace(/^["']|["']$/g,""),l=c[1]?.replace(/^["']|["']$/g,"")??"",f=(c[2]||"decimal").toLowerCase(),d=n.getStack(e,i);return d.length?d.map(m=>ye(m,f)).join(l):""}});return Cn(a)}catch{return"- "}}var tt=new WeakMap,Se=300;function vn(t,e){let n=ke(t);return e?(e.__pseudoPreflightFp!==n&&(e.__pseudoPreflight=ve(t),e.__pseudoPreflightFp=n),!!e.__pseudoPreflight):ve(t)}function Mt(t){try{return t&&t.cssRules?t.cssRules:null}catch{return null}}function ke(t){let e=t.querySelectorAll('style,link[rel~="stylesheet"]'),n=`n:${e.length}|`,r=0;for(let o=0;o<e.length;o++){let s=e[o];if(s.tagName==="STYLE"){let u=s.textContent?s.textContent.length:0;n+=`S${u}|`;let c=s.sheet,i=c?Mt(c):null;i&&(r+=i.length)}else{let u=s.getAttribute("href")||"",c=s.getAttribute("media")||"all";n+=`L${u}|m:${c}|`;let i=s.sheet,l=i?Mt(i):null;l&&(r+=l.length)}}let a=t.adoptedStyleSheets;return n+=`ass:${Array.isArray(a)?a.length:0}|tr:${r}`,n}function Ce(t,e,n){let r=Mt(t);if(!r)return!1;for(let a=0;a<r.length;a++){if(n.budget<=0)return!1;let o=r[a],s=o&&o.cssText?o.cssText:"";n.budget--;for(let u of e)if(s.includes(u))return!0;if(o&&o.cssRules&&o.cssRules.length)for(let u=0;u<o.cssRules.length&&n.budget>0;u++){let c=o.cssRules[u],i=c&&c.cssText?c.cssText:"";n.budget--;for(let l of e)if(i.includes(l))return!0}if(n.budget<=0)return!1}return!1}function ve(t=document){let e=ke(t),n=tt.get(t);if(n&&n.fingerprint===e)return n.result;let r=["::before","::after","::first-letter",":before",":after",":first-letter","counter(","counters(","counter-increment","counter-reset"],a=t.querySelectorAll("style");for(let s=0;s<a.length;s++){let u=a[s].textContent||"";for(let c of r)if(u.includes(c))return tt.set(t,{fingerprint:e,result:!0}),!0}let o=t.adoptedStyleSheets;if(Array.isArray(o)&&o.length){let s={budget:Se};try{for(let u of o)if(Ce(u,r,s))return tt.set(t,{fingerprint:e,result:!0}),!0}catch{}}{let s=t.querySelectorAll('style,link[rel~="stylesheet"]'),u={budget:Se};for(let c=0;c<s.length&&u.budget>0;c++){let i=s[c],l=null;if(i.tagName,l=i.sheet||null,l&&Ce(l,r,u))return tt.set(t,{fingerprint:e,result:!0}),!0}}return t.querySelector('[style*="counter("], [style*="counters("]')?(tt.set(t,{fingerprint:e,result:!0}),!0):(tt.set(t,{fingerprint:e,result:!1}),!1)}var et=new WeakMap,Me=-1;function Mn(t){return(t||"").replace(/"([^"]*)"/g,"$1")}function kn(t){if(!t)return"";let e=[],n=/"([^"]*)"/g,r;for(;r=n.exec(t);)e.push(r[1]);return e.length?e.join(""):Mn(t)}function kt(t,e){let n=t.parentElement,r=n?et.get(n):null;return r?{get(a,o){let s=e.get(a,o),u=r.get(o);return typeof u=="number"?Math.max(s,u):s},getStack(a,o){let s=e.getStack(a,o);if(!s.length)return s;let u=r.get(o);if(typeof u=="number"){let c=s.slice();return c[c.length-1]=Math.max(c[c.length-1],u),c}return s}}:e}function At(t,e,n){let r=new Map;function a(c){let i=[];if(!c||c==="none")return i;for(let l of String(c).split(",")){let f=l.trim().split(/\s+/),d=f[0],h=Number.isFinite(Number(f[1]))?Number(f[1]):void 0;d&&i.push({name:d,num:h})}return i}let o=a(e?.counterReset),s=a(e?.counterIncrement);function u(c){if(r.has(c))return r.get(c).slice();let i=n.getStack(t,c);i=i.length?i.slice():[];let l=o.find(d=>d.name===c);if(l){let d=Number.isFinite(l.num)?l.num:0;i=i.length?[...i,d]:[d]}let f=s.find(d=>d.name===c);if(f){let d=Number.isFinite(f.num)?f.num:1;i.length===0&&(i=[0]),i[i.length-1]+=d}return r.set(c,i.slice()),i}return{get(c,i){let l=u(i);return l.length?l[l.length-1]:0},getStack(c,i){return u(i)},__incs:s}}function An(t,e,n){let r;try{r=getComputedStyle(t,e)}catch{}let a=r?.content;if(!a||a==="none"||a==="normal")return{text:"",incs:[]};let o=kt(t,n),s=At(t,r,o),u=be(a)?we(a,t,s):a;return{text:kn(u),incs:s.__incs||[]}}async function Et(t,e,n,r){if(!(t instanceof Element)||!(e instanceof Element))return;let a=t.ownerDocument||document;if(!vn(a,n))return;let o=A?.session?.__counterEpoch??0;if(Me!==o&&(et=new WeakMap,n&&(n.__counterCtx=null),Me=o),!n.__counterCtx)try{n.__counterCtx=xe(t.ownerDocument||document)}catch{}let s=n.__counterCtx;for(let i of["::before","::after","::first-letter"])try{let l=zt(t,i);if(!l||l.content==="none"&&l.backgroundImage==="none"&&l.backgroundColor==="transparent"&&(l.borderStyle==="none"||parseFloat(l.borderWidth)===0)&&(!l.transform||l.transform==="none")&&l.display==="inline")continue;if(i==="::first-letter"){let N=getComputedStyle(t);if(!(l.color!==N.color||l.fontSize!==N.fontSize||l.fontWeight!==N.fontWeight))continue;let I=Array.from(e.childNodes).find(yt=>yt.nodeType===Node.TEXT_NODE&&yt.textContent?.trim().length>0);if(!I)continue;let L=I.textContent,K=L.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],pt=L.slice(K?.length||0);if(!K||/[\uD800-\uDFFF]/.test(K))continue;let G=document.createElement("span");G.textContent=K,G.dataset.snapdomPseudo="::first-letter";let gt=St(l),ut=ot(gt,"span");n.styleMap.set(G,ut);let ft=document.createTextNode(pt);e.replaceChild(ft,I),e.insertBefore(G,ft);continue}let d=l.content??"",h=d===""||d==="none"||d==="normal",{text:m,incs:g}=An(t,i,s),w=l.backgroundImage,M=l.backgroundColor,b=l.fontFamily,x=parseInt(l.fontSize)||32,p=parseInt(l.fontWeight)||!1,C=l.color||"#000",y=l.borderStyle,v=parseFloat(l.borderWidth),E=l.transform,F=qt(b),$=!h&&m!=="",P=w&&w!=="none",W=M&&M!=="transparent"&&M!=="rgba(0, 0, 0, 0)",B=y&&y!=="none"&&v>0,nt=E&&E!=="none";if(!($||P||W||B||nt)){if(g&&g.length&&t.parentElement){let N=et.get(t.parentElement)||new Map;for(let{name:T}of g){if(!T)continue;let I=kt(t,s),Y=At(t,getComputedStyle(t,i),I).get(t,T);N.set(T,Y)}et.set(t.parentElement,N)}continue}let k=document.createElement("span");k.dataset.snapdomPseudo=i,k.style.pointerEvents="none";let q=St(l),V=ot(q,"span");if(n.styleMap.set(k,V),F&&m&&m.length===1){let{dataUrl:N,width:T,height:I}=await Yt(m,b,p,x,C),L=document.createElement("img");L.src=N,L.style=`height:${x}px;width:${T/I*x}px;object-fit:contain;`,k.appendChild(L),e.dataset.snapdomHasIcon="true"}else if(m&&m.startsWith("url(")){let N=It(m);if(N?.trim())try{let T=document.createElement("img"),I=await U(Wt(N),{as:"dataURL",useProxy:r.useProxy});T.src=I.data,T.style=`width:${x}px;height:auto;object-fit:contain;`,k.appendChild(T)}catch(T){console.error(`[snapdom] Error in pseudo ${i} for`,t,T)}}else!F&&$&&(k.textContent=m);k.style.backgroundImage="none","maskImage"in k.style&&(k.style.maskImage="none"),"webkitMaskImage"in k.style&&(k.style.webkitMaskImage="none");try{k.style.backgroundRepeat=l.backgroundRepeat,k.style.backgroundSize=l.backgroundSize,l.backgroundPositionX&&l.backgroundPositionY?(k.style.backgroundPositionX=l.backgroundPositionX,k.style.backgroundPositionY=l.backgroundPositionY):k.style.backgroundPosition=l.backgroundPosition,k.style.backgroundOrigin=l.backgroundOrigin,k.style.backgroundClip=l.backgroundClip,k.style.backgroundAttachment=l.backgroundAttachment,k.style.backgroundBlendMode=l.backgroundBlendMode}catch{}if(P)try{let N=Xt(w),T=await Promise.all(N.map(_t));k.style.backgroundImage=T.join(", ")}catch(N){console.warn(`[snapdom] Failed to inline background-image for ${i}`,N)}W&&(k.style.backgroundColor=M);let j=k.childNodes.length>0||k.textContent?.trim()!==""||P||W||B||nt;if(g&&g.length&&t.parentElement){let N=et.get(t.parentElement)||new Map,T=kt(t,s),I=At(t,getComputedStyle(t,i),T);for(let{name:L}of g){if(!L)continue;let Y=I.get(t,L);N.set(L,Y)}et.set(t.parentElement,N)}if(!j)continue;i==="::before"?e.insertBefore(k,e.firstChild):e.appendChild(k)}catch(l){console.warn(`[snapdom] Failed to capture ${i} for`,t,l)}let u=Array.from(t.children),c=Array.from(e.children).filter(i=>!i.dataset.snapdomPseudo);for(let i=0;i<Math.min(u.length,c.length);i++)await Et(u[i],c[i],n,r)}function Ae(t,e){if(!t||!(t instanceof Element))return;let n=t.ownerDocument||document,r=e||n,a=t instanceof SVGSVGElement?[t]:Array.from(t.querySelectorAll("svg"));if(a.length===0)return;let o=/url\(\s*#([^)]+)\)/g,s=["fill","stroke","filter","clip-path","mask","marker","marker-start","marker-mid","marker-end"],u=p=>window.CSS&&CSS.escape?CSS.escape(p):p.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),c="http://www.w3.org/1999/xlink",i=p=>{if(!p||!p.getAttribute)return null;let C=p.getAttribute("href")||p.getAttribute("xlink:href")||(typeof p.getAttributeNS=="function"?p.getAttributeNS(c,"href"):null);if(C)return C;let y=p.attributes;if(!y)return null;for(let v=0;v<y.length;v++){let E=y[v];if(!E||!E.name)continue;if(E.name==="href")return E.value;let F=E.name.indexOf(":");if(F!==-1&&E.name.slice(F+1)==="href")return E.value}return null},l=new Set(Array.from(t.querySelectorAll("[id]")).map(p=>p.id)),f=new Set,d=!1,h=(p,C=null)=>{if(!p)return;o.lastIndex=0;let y;for(;y=o.exec(p);){d=!0;let v=(y[1]||"").trim();v&&(l.has(v)||(f.add(v),C&&!C.has(v)&&C.add(v)))}},m=p=>{let C=p.querySelectorAll("use");for(let E of C){let F=i(E);if(!F||!F.startsWith("#"))continue;d=!0;let $=F.slice(1).trim();$&&!l.has($)&&f.add($)}let v=p.querySelectorAll('*[style*="url("],*[fill^="url("], *[stroke^="url("],*[filter^="url("],*[clip-path^="url("],*[mask^="url("],*[marker^="url("],*[marker-start^="url("],*[marker-mid^="url("],*[marker-end^="url("]');for(let E of v){h(E.getAttribute("style")||"");for(let F of s)h(E.getAttribute(F))}};for(let p of a)m(p);if(!d)return;let g=t.querySelector("svg.inline-defs-container");g||(g=n.createElementNS("http://www.w3.org/2000/svg","svg"),g.classList.add("inline-defs-container"),g.setAttribute("aria-hidden","true"),g.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),t.insertBefore(g,t.firstChild||null));let w=g.querySelector("defs")||null,M=p=>{if(!p||l.has(p))return null;let C=u(p),y=v=>{let E=r.querySelector(v);return E&&!t.contains(E)?E:null};return y(`svg defs > *#${C}`)||y(`svg > symbol#${C}`)||y(`*#${C}`)};if(!f.size)return;let b=new Set(f),x=new Set;for(;b.size;){let p=b.values().next().value;if(b.delete(p),!p||l.has(p)||x.has(p))continue;let C=M(p);if(!C){x.add(p);continue}w||(w=n.createElementNS("http://www.w3.org/2000/svg","defs"),g.appendChild(w));let y=C.cloneNode(!0);y.id||y.setAttribute("id",p),w.appendChild(y),x.add(p),l.add(p);let v=[y,...y.querySelectorAll("*")];for(let E of v){let F=i(E);if(F&&F.startsWith("#")){let P=F.slice(1).trim();P&&!l.has(P)&&!x.has(P)&&b.add(P)}let $=E.getAttribute?.("style")||"";$&&h($,b);for(let P of s){let W=E.getAttribute?.(P);W&&h(W,b)}}}}function Ne(t,e){if(!t||!e)return;let n=t.scrollTop||0;if(!n)return;getComputedStyle(e).position==="static"&&(e.style.position="relative");let r=t.getBoundingClientRect(),a=t.clientHeight,o="data-snap-ph",s=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;s.nextNode();){let u=s.currentNode,c=getComputedStyle(u),i=c.position;if(i!=="sticky"&&i!=="-webkit-sticky")continue;let l=Ee(c.top),f=Ee(c.bottom);if(l==null&&f==null)continue;let d=En(u,t),h=Nn(e,d,o);if(!h)continue;let m=u.getBoundingClientRect(),g=m.width,w=m.height,M=m.left-r.left;if(!(g>0&&w>0)||!Number.isFinite(M))continue;let b=l!=null?l+n:n+(a-w-f);if(!Number.isFinite(b))continue;let x=Number.parseInt(c.zIndex,10),p=Number.isFinite(x),C=p?Math.max(x,1)+1:2,y=p?x-1:0,v=h.cloneNode(!1);v.setAttribute(o,"1"),v.style.position="sticky",v.style.left=`${M}px`,v.style.top=`${b}px`,v.style.width=`${g}px`,v.style.height=`${w}px`,v.style.visibility="hidden",v.style.zIndex=String(y),v.style.overflow="hidden",v.style.background="transparent",v.style.boxShadow="none",v.style.filter="none",h.parentElement?.insertBefore(v,h),h.style.position="absolute",h.style.left=`${M}px`,h.style.top=`${b}px`,h.style.bottom="auto",h.style.zIndex=String(C),h.style.pointerEvents="none"}}function Ee(t){if(!t||t==="auto")return null;let e=Number.parseFloat(t);return Number.isFinite(e)?e:null}function En(t,e){let n=[];for(let r=t;r&&r!==e;){let a=r.parentElement;if(!a)break;n.push(Array.prototype.indexOf.call(a.children,r)),r=a}return n.reverse()}function Nn(t,e,n){let r=t;for(let a=0;a<e.length;a++)if(r=Fn(r,n)[e[a]],!r)return null;return r instanceof HTMLElement?r:null}function Fn(t,e){let n=[],r=t.children;for(let a=0;a<r.length;a++){let o=r[a];o.hasAttribute(e)||n.push(o)}return n}function Fe(t){let e=getComputedStyle(t),n=e.outlineStyle,r=e.outlineWidth,a=e.borderStyle,o=e.borderWidth,s=n!=="none"&&parseFloat(r)>0,u=a==="none"||parseFloat(o)===0;s&&u&&(t.style.border=`${r} solid transparent`)}async function Te(t,e={}){let n={styleMap:A.session.styleMap,styleCache:A.session.styleCache,nodeMap:A.session.nodeMap},r,a="",o="";Fe(t);try{Ae(t)}catch(c){console.warn("inlineExternal defs or symbol failed:",c)}try{r=await ct(t,n,e,t)}catch(c){throw console.warn("deepClone failed:",c),c}try{await Et(t,r,n,e)}catch(c){console.warn("inlinePseudoElements failed:",c)}await me(r);try{let c=r.querySelectorAll("style[data-sd]");for(let i of c)o+=i.textContent||"",i.remove()}catch{}let s=Ot(n.styleMap);a=Array.from(s.entries()).map(([c,i])=>`.${i}{${c}}`).join(""),a=o+a;for(let[c,i]of n.styleMap.entries()){if(c.tagName==="STYLE")continue;if(c.getRootNode&&c.getRootNode()instanceof ShadowRoot){c.setAttribute("style",i.replace(/;/g,"; "));continue}let l=s.get(i);l&&c.classList.add(l);let f=c.style?.backgroundImage,d=c.dataset?.snapdomHasIcon;f&&f!=="none"&&(c.style.backgroundImage=f),d&&(c.style.verticalAlign="middle",c.style.display="inline")}for(let[c,i]of n.nodeMap.entries()){let l=i.scrollLeft,f=i.scrollTop;if((l||f)&&c instanceof HTMLElement){c.style.overflow="hidden",c.style.scrollbarWidth="none",c.style.msOverflowStyle="none";let h=document.createElement("div");for(h.style.transform=`translate(${-l}px, ${-f}px)`,h.style.willChange="transform",h.style.display="inline-block",h.style.width="100%";c.firstChild;)h.appendChild(c.firstChild);c.appendChild(h)}}let u=r instanceof HTMLElement&&r.firstElementChild instanceof HTMLElement?r.firstElementChild:r;if(Ne(t,u),t===n.nodeMap.get(r)){let c=n.styleCache.get(t)||window.getComputedStyle(t);n.styleCache.set(t,c);let i=Lt(c.transform);r.style.margin="0",r.style.top="auto",r.style.left="auto",r.style.right="auto",r.style.bottom="auto",r.style.animation="none",r.style.transition="none",r.style.willChange="auto",r.style.float="none",r.style.clear="none",r.style.transform=i||""}for(let[c,i]of n.nodeMap.entries())i.tagName==="PRE"&&(c.style.marginTop="0",c.style.marginBlockStart="0");return{clone:r,classCSS:a,styleCache:n.styleCache}}function Tn(t){let e=parseInt(t.dataset?.snapdomWidth||"",10)||0,n=parseInt(t.dataset?.snapdomHeight||"",10)||0,r=parseInt(t.getAttribute("width")||"",10)||0,a=parseInt(t.getAttribute("height")||"",10)||0,o=parseFloat(t.style?.width||"")||0,s=parseFloat(t.style?.height||"")||0,u=e||o||r||t.width||t.naturalWidth||100,c=n||s||a||t.height||t.naturalHeight||100;return{width:u,height:c}}async function Pe(t,e={}){let n=Array.from(t.querySelectorAll("img")),r=async a=>{if(!a.getAttribute("src")){let l=a.currentSrc||a.src||"";l&&a.setAttribute("src",l)}a.removeAttribute("srcset"),a.removeAttribute("sizes");let o=a.src||"";if(!o)return;let s=await U(o,{as:"dataURL",useProxy:e.useProxy});if(s.ok&&typeof s.data=="string"&&s.data.startsWith("data:")){a.src=s.data,a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let{width:u,height:c}=Tn(a),{fallbackURL:i}=e||{};if(i)try{let l=typeof i=="function"?await i({width:u,height:c,src:o,element:a}):i;if(l){let f=await U(l,{as:"dataURL",useProxy:e.useProxy});a.src=f.data,a.width||(a.width=u),a.height||(a.height=c);return}}catch{}if(e.placeholders!==!1){let l=document.createElement("div");l.style.cssText=[`width:${u}px`,`height:${c}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${c}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),l.textContent="img",a.replaceWith(l)}else{let l=document.createElement("div");l.style.cssText=`display:inline-block;width:${u}px;height:${c}px;visibility:hidden;`,a.replaceWith(l)}};for(let a=0;a<n.length;a+=4){let o=n.slice(a,a+4).map(r);await Promise.allSettled(o)}}function $e(t){if(!t)return()=>{};let e=Pn(t);if(e<=0)return()=>{};if(!Ln(t))return()=>{};let n=getComputedStyle(t),r=Math.round($n(n)*e+In(n)),a=t.textContent??"",o=a;if(t.scrollHeight<=r+.5)return()=>{};let s=0,u=a.length,c=-1;for(;s<=u;){let i=s+u>>1;t.textContent=a.slice(0,i)+"\u2026",t.scrollHeight<=r+.5?(c=i,s=i+1):u=i-1}return t.textContent=(c>=0?a.slice(0,c):"")+"\u2026",()=>{t.textContent=o}}function Pn(t){let e=getComputedStyle(t),n=e.getPropertyValue("-webkit-line-clamp")||e.getPropertyValue("line-clamp");n=(n||"").trim();let r=parseInt(n,10);return Number.isFinite(r)&&r>0?r:0}function $n(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 In(t){return(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0)}function Ln(t){return t.childElementCount>0?!1:Array.from(t.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}function Ie(t,e){if(!t||!e||!e.style)return;let n=getComputedStyle(t);try{e.style.boxShadow="none"}catch{}try{e.style.textShadow="none"}catch{}try{e.style.outline="none"}catch{}let a=(n.filter||"").replace(/\bblur\([^()]*\)\s*/gi,"").replace(/\bdrop-shadow\([^()]*\)\s*/gi,"").trim().replace(/\s+/g," ");try{e.style.filter=a.length?a:"none"}catch{}}function Wn(t){let e=document.createTreeWalker(t,NodeFilter.SHOW_COMMENT),n=[];for(;e.nextNode();)n.push(e.currentNode);for(let r of n)r.remove()}function _n(t,e={}){let{stripFrameworkDirectives:n=!0}=e,r=new Set(["xml","xlink"]),a=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;a.nextNode();){let o=a.currentNode;for(let s of Array.from(o.attributes)){let u=s.name;if(u.includes("@")){o.removeAttribute(u);continue}if(u.includes(":")){let c=u.split(":",1)[0];if(!r.has(c)){o.removeAttribute(u);continue}}if(n&&(u.startsWith("x-")||u.startsWith("v-")||u.startsWith(":")||u.startsWith("on:")||u.startsWith("bind:")||u.startsWith("let:")||u.startsWith("class:"))){o.removeAttribute(u);continue}}}}function Le(t,e={}){t&&(_n(t,e),Wn(t))}function Hn(t){try{let e=t.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(e)}catch{return!1}}function Bn(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof HTMLIFrameElement||t instanceof SVGElement||t instanceof HTMLObjectElement||t instanceof HTMLEmbedElement}function Rn(t,e){if(!(t instanceof Element)||Hn(t)||Bn(t))return!1;let n=e.position;if(n==="absolute"||n==="fixed"||n==="sticky")return!1;let r=e.display||"";return!(r.includes("flex")||r.includes("grid")||r.startsWith("table")||e.transform&&e.transform!=="none")}function We(t,e,n=new Map){function r(a,o){if(!(a instanceof Element)||!(o instanceof Element))return;let s=a.childElementCount>o.childElementCount,u=n.get(a)||getComputedStyle(a);if(n.has(a)||n.set(a,u),s&&Rn(a,u)){o.style.height||(o.style.height="auto"),o.style.width||(o.style.width="auto"),o.style.removeProperty("block-size"),o.style.removeProperty("inline-size"),o.style.minHeight||(o.style.minHeight="0"),o.style.minWidth||(o.style.minWidth="0"),o.style.maxHeight||(o.style.maxHeight="none"),o.style.maxWidth||(o.style.maxWidth="none");let l=u.overflowY||u.overflowBlock||"visible",f=u.overflowX||u.overflowInline||"visible";(l!=="visible"||f!=="visible")&&(o.style.overflow="visible")}let c=Array.from(a.children),i=Array.from(o.children);for(let l=0;l<Math.min(c.length,i.length);l++)r(c[l],i[l])}r(t,e)}function Dn(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 On(t,e){if(!(t instanceof Element))return!1;if(t.getAttribute("data-capture")==="exclude"&&e?.excludeMode==="remove")return!0;if(Array.isArray(e?.exclude))for(let n of e.exclude)try{if(t.matches(n))return e.excludeMode==="remove"}catch{}return!1}function _e(t,e){let n=getComputedStyle(t),r=t.getBoundingClientRect(),a=1/0,o=-1/0,s=!1,u=Array.from(t.children);for(let h of u){if(On(h,e)||!Dn(h))continue;let m=h.getBoundingClientRect(),g=m.top-r.top,w=m.bottom-r.top;w<=g||(g<a&&(a=g),w>o&&(o=w),s=!0)}let c=s?Math.max(0,o-a):0,i=parseFloat(n.borderTopWidth)||0,l=parseFloat(n.borderBottomWidth)||0,f=parseFloat(n.paddingTop)||0,d=parseFloat(n.paddingBottom)||0;return i+l+f+d+c}var S=(t,e=3)=>Number.isFinite(t)?Math.round(t*10**e)/10**e:t;function He(t){let e=t.boxShadow||"";if(!e||e==="none")return{top:0,right:0,bottom:0,left:0};let n=e.split(/\),(?=(?:[^()]*\([^()]*\))*[^()]*$)/).map(u=>u.trim()),r=0,a=0,o=0,s=0;for(let u of n){let c=u.match(/-?\d+(\.\d+)?px/g)?.map(g=>parseFloat(g))||[];if(c.length<2)continue;let[i,l,f=0,d=0]=c,h=Math.abs(i)+f+d,m=Math.abs(l)+f+d;a=Math.max(a,h+Math.max(i,0)),s=Math.max(s,h+Math.max(-i,0)),o=Math.max(o,m+Math.max(l,0)),r=Math.max(r,m+Math.max(-l,0))}return{top:Math.ceil(r),right:Math.ceil(a),bottom:Math.ceil(o),left:Math.ceil(s)}}function Be(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 Re(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 De(t){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)||[],r=0,a=0,o=0,s=0,u=!1;for(let c of n){u=!0;let i=c.match(/-?\d+(?:\.\d+)?px/gi)?.map(g=>parseFloat(g))||[],[l=0,f=0,d=0]=i,h=Math.abs(l)+d,m=Math.abs(f)+d;a=Math.max(a,h+Math.max(l,0)),s=Math.max(s,h+Math.max(-l,0)),o=Math.max(o,m+Math.max(f,0)),r=Math.max(r,m+Math.max(-f,0))}return{bleed:{top:S(r),right:S(a),bottom:S(o),left:S(s)},has:u}}function Oe(t,e){if(!t||!e||!e.style)return null;let n=getComputedStyle(t);try{e.style.transformOrigin="0 0"}catch{}try{"translate"in e.style&&(e.style.translate="none"),"rotate"in e.style&&(e.style.rotate="none")}catch{}let r=n.transform||"none";if(!r||r==="none")try{let o=Ye(t);if(o.a===1&&o.b===0&&o.c===0&&o.d===1)return e.style.transform="none",{a:1,b:0,c:0,d:1}}catch{}let a=r.match(/^matrix\(\s*([^)]+)\)$/i);if(a){let o=a[1].split(",").map(s=>parseFloat(s.trim()));if(o.length===6&&o.every(Number.isFinite)){let[s,u,c,i]=o,l=Math.sqrt(s*s+u*u)||0,f=0,d=0,h=0,m=0,g=0,w=0;l>0&&(f=s/l,d=u/l,h=f*c+d*i,m=c-f*h,g=i-d*h,w=Math.sqrt(m*m+g*g)||0,w>0?h=h/w:h=0);let M=l,b=0,x=h*w,p=w;try{e.style.transform=`matrix(${M}, ${b}, ${x}, ${p}, 0, 0)`}catch{}return{a:M,b,c:x,d:p}}}try{let o=String(r).trim();return e.style.transform=o+" translate(0px, 0px) rotate(0deg)",null}catch{return null}}function Ft(t,e,n,r,a){let o=n.a,s=n.b,u=n.c,c=n.d,i=n.e||0,l=n.f||0;function f(M,b){let x=M-r,p=b-a,C=o*x+u*p,y=s*x+c*p;return C+=r+i,y+=a+l,[C,y]}let d=[f(0,0),f(t,0),f(0,e),f(t,e)],h=1/0,m=1/0,g=-1/0,w=-1/0;for(let[M,b]of d)M<h&&(h=M),b<m&&(m=b),M>g&&(g=M),b>w&&(w=b);return{minX:h,minY:m,maxX:g,maxY:w,width:g-h,height:w-m}}function ze(t,e,n){let r=(t.transformOrigin||"0 0").trim().split(/\s+/),[a,o]=[r[0]||"0",r[1]||"0"],s=(u,c)=>{let i=u.toLowerCase();return i==="left"||i==="top"?0:i==="center"?c/2:i==="right"||i==="bottom"?c:i.endsWith("px")?parseFloat(i)||0:i.endsWith("%")?(parseFloat(i)||0)*c/100:/^-?\d+(\.\d+)?$/.test(i)&&parseFloat(i)||0};return{ox:s(a,e),oy:s(o,n)}}function Xe(t){let e={rotate:"0deg",scale:null,translate:null},n=typeof t.computedStyleMap=="function"?t.computedStyleMap():null;if(n){let a=c=>{try{return typeof n.has=="function"&&!n.has(c)||typeof n.get!="function"?null:n.get(c)}catch{return null}},o=a("rotate");if(o)if(o.angle){let c=o.angle;e.rotate=c.unit==="rad"?c.value*180/Math.PI+"deg":c.value+c.unit}else o.unit?e.rotate=o.unit==="rad"?o.value*180/Math.PI+"deg":o.value+o.unit:e.rotate=String(o);else{let c=getComputedStyle(t);e.rotate=c.rotate&&c.rotate!=="none"?c.rotate:"0deg"}let s=a("scale");if(s){let c="x"in s&&s.x?.value!=null?s.x.value:Array.isArray(s)?s[0]?.value:Number(s)||1,i="y"in s&&s.y?.value!=null?s.y.value:Array.isArray(s)?s[1]?.value:c;e.scale=`${c} ${i}`}else{let c=getComputedStyle(t);e.scale=c.scale&&c.scale!=="none"?c.scale:null}let u=a("translate");if(u){let c="x"in u&&"value"in u.x?u.x.value:Array.isArray(u)?u[0]?.value:0,i="y"in u&&"value"in u.y?u.y.value:Array.isArray(u)?u[1]?.value:0,l="x"in u&&u.x?.unit?u.x.unit:"px",f="y"in u&&u.y?.unit?u.y.unit:"px";e.translate=`${c}${l} ${i}${f}`}else{let c=getComputedStyle(t);e.translate=c.translate&&c.translate!=="none"?c.translate:null}return e}let r=getComputedStyle(t);return e.rotate=r.rotate&&r.rotate!=="none"?r.rotate:"0deg",e.scale=r.scale&&r.scale!=="none"?r.scale:null,e.translate=r.translate&&r.translate!=="none"?r.translate:null,e}var Nt=null;function zn(){if(Nt)return Nt;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),Nt=t,t}function qe(t){let e=zn(),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 r=Ye(n);return e.removeChild(n),r}function Ve(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 a=e.rotate&&e.rotate!=="none"&&e.rotate!=="0deg",o=e.scale&&e.scale!=="none"&&e.scale!=="1",s=e.translate&&e.translate!=="none"&&e.translate!=="0px 0px";return!!(a||o||s)}function Ye(t){let e=getComputedStyle(t).transform;if(!e||e==="none")return new DOMMatrix;try{return new DOMMatrix(e)}catch{return new WebKitCSSMatrix(e)}}async function Vr(t,e){if(!t)throw new Error("Element cannot be null or undefined");$t(e.cache);let n=e.fast,r=e.outerTransforms!==!1,a=!!e.outerShadows,o={element:t,options:e,plugins:e.plugins},s,u,c,i="",l="",f,d,h=null;await Q("beforeSnap",o),await Q("beforeClone",o);let m=$e(o.element);try{({clone:s,classCSS:u,styleCache:c}=await Te(o.element,o.options)),!r&&s&&(h=Oe(o.element,s)),!a&&s&&Ie(o.element,s)}finally{m()}if(o={clone:s,classCSS:u,styleCache:c,...o},await Q("afterClone",o),Le(o.clone),o.options?.excludeMode==="remove")try{We(o.element,o.clone,o.styleCache)}catch(b){console.warn("[snapdom] shrink pass failed:",b)}try{await Vt(o.clone,o.element)}catch{}await new Promise(b=>{O(async()=>{await Pe(o.clone,o.options),b()},{fast:n})}),await new Promise(b=>{O(async()=>{await Zt(o.element,o.clone,o.styleCache,o.options),b()},{fast:n})}),e.embedFonts&&await new Promise(b=>{O(async()=>{let x=jt(o.element),p=Kt(o.element);if(st()){let C=new Set(Array.from(x).map(y=>String(y).split("__")[0]).filter(Boolean));await Gt(C,1)}i=await Ut({required:x,usedCodepoints:p,preCached:!1,exclude:o.options.excludeFonts,useProxy:o.options.useProxy}),b()},{fast:n})});let g=Rt(o.clone).sort(),w=g.join(",");A.baseStyle.has(w)?l=A.baseStyle.get(w):await new Promise(b=>{O(()=>{l=Dt(g),A.baseStyle.set(w,l),b()},{fast:n})}),o={fontsCSS:i,baseCSS:l,...o},await Q("beforeRender",o),await new Promise(b=>{O(()=>{let x=getComputedStyle(o.element),p=o.element.getBoundingClientRect(),C=Math.max(1,S(o.element.offsetWidth||parseFloat(x.width)||p.width||1)),y=Math.max(1,S(o.element.offsetHeight||parseFloat(x.height)||p.height||1));if(o.options?.excludeMode==="remove"){let _=_e(o.element,o.options);Number.isFinite(_)&&_>0&&(y=Math.max(1,Math.min(y,S(_+1))))}let v=(_,H=NaN)=>{let J=typeof _=="string"?parseFloat(_):_;return Number.isFinite(J)?J:H},E=v(o.options.width),F=v(o.options.height),$=C,P=y,W=Number.isFinite(E),B=Number.isFinite(F),nt=y>0?C/y:1;W&&B?($=Math.max(1,S(E)),P=Math.max(1,S(F))):W?($=Math.max(1,S(E)),P=Math.max(1,S($/(nt||1)))):B?(P=Math.max(1,S(F)),$=Math.max(1,S(P*(nt||1)))):($=C,P=y);let X=0,k=0,q=C,V=y;if(!r&&h&&Number.isFinite(h.a)){let _={a:h.a,b:h.b||0,c:h.c||0,d:h.d||1,e:0,f:0},H=Ft(C,y,_,0,0);X=S(H.minX),k=S(H.minY),q=S(H.maxX),V=S(H.maxY)}else if(r&&Xn(o.element)){let H=x.transform&&x.transform!=="none"?x.transform:"",J=Xe(o.element),wt=qe({baseTransform:H,rotate:J.rotate||"0deg",scale:J.scale,translate:J.translate}),{ox:Je,oy:Qe}=ze(x,C,y),tn=wt.is2D?wt:new DOMMatrix(wt.toString()),dt=Ft(C,y,tn,Je,Qe);X=S(dt.minX),k=S(dt.minY),q=S(dt.maxX),V=S(dt.maxY)}let rt=He(x),j=Be(x),N=Re(x),T=De(x),I=a?{top:S(rt.top+j.top+N.top+T.bleed.top),right:S(rt.right+j.right+N.right+T.bleed.right),bottom:S(rt.bottom+j.bottom+N.bottom+T.bleed.bottom),left:S(rt.left+j.left+N.left+T.bleed.left)}:{top:0,right:0,bottom:0,left:0};X=S(X-I.left),k=S(k-I.top),q=S(q+I.right),V=S(V+I.bottom);let L=Math.max(1,S(q-X)),Y=Math.max(1,S(V-k)),K=W||B?S($/C):1,pt=B||W?S(P/y):1,G=Math.max(1,S(L*K)),gt=Math.max(1,S(Y*pt)),ut="http://www.w3.org/2000/svg",ft=st()?1:0,R=S(ft+(r?0:1)),D=document.createElementNS(ut,"foreignObject"),Ue=S(X),je=S(k);D.setAttribute("x",String(S(-(Ue-R)))),D.setAttribute("y",String(S(-(je-R)))),D.setAttribute("width",String(S(C+R*2))),D.setAttribute("height",String(S(y+R*2))),D.style.overflow="visible";let Tt=document.createElement("style");Tt.textContent=o.baseCSS+o.fontsCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+o.classCSS,D.appendChild(Tt);let Z=document.createElement("div");Z.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Z.style.width=`${S(C)}px`,Z.style.height=`${S(y)}px`,Z.style.overflow="visible",o.clone.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Z.appendChild(o.clone),D.appendChild(Z);let Ke=new XMLSerializer().serializeToString(D),bt=S(L+R*2),xt=S(Y+R*2),Pt=W||B;e.meta={w0:C,h0:y,vbW:bt,vbH:xt,targetW:$,targetH:P};let Ge=st()&&Pt?bt:S(G+R*2),Ze=st()&&Pt?xt:S(gt+R*2);d=`<svg xmlns="${ut}" width="${Ge}" height="${Ze}" viewBox="0 0 ${bt} ${xt}">`+Ke+"</svg>",f=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(d)}`,o={svgString:d,dataURL:f,...o},b()},{fast:n})}),await Q("afterRender",o);let M=document.getElementById("snapdom-sandbox");return M&&M.style.position==="absolute"&&M.remove(),o.dataURL}function Xn(t){return Ve(t)}export{Vr as a};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* SnapDOM
|
|
3
|
+
* v2.0.1
|
|
4
|
+
* Author: Juan Martin Muda
|
|
5
|
+
* License: MIT
|
|
6
|
+
*/
|
|
7
|
+
import{a as x,c as V,f as O,g as z,o as B,q as j}from"./chunk-GZX3IERM.js";var tt=[/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],E=Object.assign({materialIconsFilled:"https://fonts.gstatic.com/s/materialicons/v48/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2",materialIconsOutlined:"https://fonts.gstatic.com/s/materialiconsoutlined/v110/gok-H7zzDkdnRel8-DQ6KAXJ69wP1tGnf4ZGhUcel5euIg.woff2",materialIconsRound:"https://fonts.gstatic.com/s/materialiconsround/v109/LDItaoyNOAY6Uewc665JcIzCKsKc_M9flwmPq_HTTw.woff2",materialIconsSharp:"https://fonts.gstatic.com/s/materialiconssharp/v110/oPWQ_lt5nv4pWNJpghLP75WiFR4kLh3kvmvRImcycg.woff2"},typeof window<"u"&&window.__SNAPDOM_ICON_FONTS__||{}),W=[];function St(n){let t=Array.isArray(n)?n:[n];for(let o of t)o instanceof RegExp?W.push(o):typeof o=="string"?W.push(new RegExp(o,"i")):console.warn("[snapdom] Ignored invalid iconFont value:",o)}function R(n){let t=typeof n=="string"?n:"",o=[...tt,...W];for(let s of o)if(s instanceof RegExp&&s.test(t))return!0;return!!(/icon/i.test(t)||/glyph/i.test(t)||/symbols/i.test(t)||/feather/i.test(t)||/fontawesome/i.test(t))}function et(n=""){let t=String(n).toLowerCase();return/\bmaterial\s*icons\b/.test(t)||/\bmaterial\s*symbols\b/.test(t)}var H=new Map;function nt(n=""){let t=Object.create(null),o=String(n||""),s=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g,i;for(;i=s.exec(o);)t[i[1].toUpperCase()]=Number(i[2]);return t}async function ot(n,t,o){let s=String(n||""),i=s.toLowerCase(),c=String(t||"").toLowerCase();if(/\bmaterial\s*icons\b/.test(i)&&!/\bsymbols\b/.test(i))return{familyForMeasure:s,familyForCanvas:s};if(!/\bmaterial\s*symbols\b/.test(i))return{familyForMeasure:s,familyForCanvas:s};let f=o&&(o.FILL??o.fill),a="outlined";/\brounded\b/.test(c)||/\bround\b/.test(c)?a="rounded":/\bsharp\b/.test(c)?a="sharp":/\boutlined\b/.test(c)&&(a="outlined");let m=f===1,u=null;if(m&&(a==="outlined"&&E.materialIconsFilled?u={url:E.materialIconsFilled,alias:"snapdom-mi-filled"}:a==="rounded"&&E.materialIconsRound?u={url:E.materialIconsRound,alias:"snapdom-mi-round"}:a==="sharp"&&E.materialIconsSharp&&(u={url:E.materialIconsSharp,alias:"snapdom-mi-sharp"})),!u)return{familyForMeasure:s,familyForCanvas:s};if(!H.has(u.alias))try{let d=new FontFace(u.alias,`url(${u.url})`,{style:"normal",weight:"400"});document.fonts.add(d),await d.load(),H.set(u.alias,!0)}catch{return{familyForMeasure:s,familyForCanvas:s}}let h=`"${u.alias}"`;return{familyForMeasure:h,familyForCanvas:h}}async function st(n="Material Icons",t=24){try{await Promise.all([document.fonts.load(`400 ${t}px "${String(n).replace(/["']/g,"")}"`),document.fonts.ready])}catch{}}function rt(n){let t=n.getPropertyValue("-webkit-text-fill-color")?.trim()||"",o=/^transparent$/i.test(t)||/rgba?\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(t);if(t&&!o&&t.toLowerCase()!=="currentcolor")return t;let s=n.color?.trim();return s&&s!=="inherit"?s:"#000"}async function it(n,{family:t="Material Icons",weight:o="normal",fontSize:s=32,color:i="#000",variation:c="",className:e=""}={}){let f=String(t||"").replace(/^['"]+|['"]+$/g,""),a=window.devicePixelRatio||1,m=nt(c),{familyForMeasure:u,familyForCanvas:h}=await ot(f,e,m);await st(h.replace(/^["']+|["']+$/g,""),s);let d=document.createElement("span");d.textContent=n,d.style.position="absolute",d.style.visibility="hidden",d.style.left="-99999px",d.style.whiteSpace="nowrap",d.style.fontFamily=u,d.style.fontWeight=String(o||"normal"),d.style.fontSize=`${s}px`,d.style.lineHeight="1",d.style.margin="0",d.style.padding="0",d.style.fontFeatureSettings="'liga' 1",d.style.fontVariantLigatures="normal",d.style.color=i,document.body.appendChild(d);let b=d.getBoundingClientRect(),S=Math.max(1,Math.ceil(b.width)),r=Math.max(1,Math.ceil(b.height));document.body.removeChild(d);let l=document.createElement("canvas");l.width=S*a,l.height=r*a;let p=l.getContext("2d");p.scale(a,a),p.font=`${o?`${o} `:""}${s}px ${h}`,p.textAlign="left",p.textBaseline="top",p.fillStyle=i;try{p.fontKerning="normal"}catch{}return p.fillText(n,0,0),{dataUrl:l.toDataURL(),width:S,height:r}}async function bt(n,t){if(!(n instanceof Element))return 0;let o='.material-icons, [class*="material-symbols"]',s=Array.from(n.querySelectorAll(o)).filter(e=>e&&e.textContent&&e.textContent.trim());if(s.length===0)return 0;let i=t instanceof Element?Array.from(t.querySelectorAll(o)).filter(e=>e&&e.textContent&&e.textContent.trim()):[],c=0;for(let e=0;e<s.length;e++){let f=s[e],a=i[e]||null;try{let m=getComputedStyle(a||f),u=m.fontFamily||"Material Icons";if(!et(u))continue;let h=(a||f).textContent.trim();if(!h)continue;let d=parseInt(m.fontSize,10)||24,b=m.fontWeight&&m.fontWeight!=="normal"?m.fontWeight:"normal",S=rt(m),r=m.fontVariationSettings&&m.fontVariationSettings!=="normal"?m.fontVariationSettings:"",l=(a||f).className||"",{dataUrl:p,width:w,height:g}=await it(h,{family:u,weight:b,fontSize:d,color:S,variation:r,className:l});f.textContent="";let y=f.ownerDocument.createElement("img");y.src=p,y.alt=h,y.style.height=`${d}px`,y.style.width=`${Math.max(1,Math.round(w/g*d))}px`,y.style.objectFit="contain",y.style.verticalAlign=getComputedStyle(f).verticalAlign||"baseline",f.appendChild(y),c++}catch{}}return c}async function Rt(n,t,o,s=32,i="#000"){t=t.replace(/^['"]+|['"]+$/g,"");let c=window.devicePixelRatio||1;try{await document.fonts.ready}catch{}let e=document.createElement("span");e.textContent=n,e.style.position="absolute",e.style.visibility="hidden",e.style.fontFamily=`"${t}"`,e.style.fontWeight=o||"normal",e.style.fontSize=`${s}px`,e.style.lineHeight="1",e.style.whiteSpace="nowrap",e.style.padding="0",e.style.margin="0",document.body.appendChild(e);let f=e.getBoundingClientRect(),a=Math.ceil(f.width),m=Math.ceil(f.height);document.body.removeChild(e);let u=document.createElement("canvas");u.width=Math.max(1,a*c),u.height=Math.max(1,m*c);let h=u.getContext("2d");return h.scale(c,c),h.font=o?`${o} ${s}px "${t}"`:`${s}px "${t}"`,h.textAlign="left",h.textBaseline="top",h.fillStyle=i,h.fillText(n,0,0),{dataUrl:u.toDataURL(),width:a,height:m}}var at=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]);function T(n){if(!n)return"";for(let t of n.split(",")){let o=t.trim().replace(/^['"]+|['"]+$/g,"");if(o&&!at.has(o.toLowerCase()))return o}return""}function P(n){let t=String(n??"400").trim().toLowerCase();if(t==="normal")return 400;if(t==="bold")return 700;let o=parseInt(t,10);return Number.isFinite(o)?Math.min(900,Math.max(100,o)):400}function U(n){let t=String(n??"normal").trim().toLowerCase();return t.startsWith("italic")?"italic":t.startsWith("oblique")?"oblique":"normal"}function ct(n){let t=String(n??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return t?Math.max(50,Math.min(200,parseFloat(t[1]))):100}function lt(n){let t=String(n||"400").trim(),o=t.match(/^(\d{2,3})\s+(\d{2,3})$/);if(o){let i=P(o[1]),c=P(o[2]);return{min:Math.min(i,c),max:Math.max(i,c)}}let s=P(t);return{min:s,max:s}}function ft(n){let t=String(n||"normal").trim().toLowerCase();return t==="italic"?{kind:"italic"}:t.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function mt(n){let t=String(n||"100%").trim(),o=t.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(o){let c=parseFloat(o[1]),e=parseFloat(o[2]);return{min:Math.min(c,e),max:Math.max(c,e)}}let s=t.match(/(\d+(?:\.\d+)?)\s*%/),i=s?parseFloat(s[1]):100;return{min:i,max:i}}function ut(n,t){if(!n)return!1;try{let o=new URL(n,location.href);if(o.origin===location.origin)return!0;let i=o.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com"].some(f=>i.endsWith(f)))return!0;let e=(o.pathname+o.search).toLowerCase();if(/\bfont(s)?\b/.test(e)||/\.woff2?(\b|$)/.test(e))return!0;for(let f of t){let a=f.toLowerCase().replace(/\s+/g,"+"),m=f.toLowerCase().replace(/\s+/g,"-");if(e.includes(a)||e.includes(m))return!0}return!1}catch{return!1}}function dt(n){let t=new Set;for(let o of n||[]){let s=String(o).split("__")[0]?.trim();s&&t.add(s)}return t}function K(n,t){return n&&n.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(o,s,i)=>{let c=(i||"").trim();if(!c||/^data:|^blob:|^https?:|^file:|^about:/i.test(c))return o;let e=c;try{e=new URL(c,t||location.href).href}catch{}return`url("${e}")`})}var q=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,N=4;async function ht(n,t,o){if(!n)return n;let s=new Set;function i(f,a){try{return new URL(f,a||location.href).href}catch{return f}}async function c(f,a,m=0){if(m>N)return console.warn(`[snapDOM] @import depth exceeded (${N}) at ${a}`),f;let u="",h=0,d;for(;d=q.exec(f);){u+=f.slice(h,d.index),h=q.lastIndex;let b=(d[2]||d[4]||"").trim(),S=i(b,a);if(s.has(S)){console.warn(`[snapDOM] Skipping circular @import: ${S}`);continue}s.add(S);let r="";try{let l=await O(S,{as:"text",useProxy:o,silent:!0});l.ok&&typeof l.data=="string"&&(r=l.data)}catch{}r?(r=K(r,S),r=await c(r,S,m+1),u+=`
|
|
8
|
+
/* inlined: ${S} */
|
|
9
|
+
${r}
|
|
10
|
+
`):u+=d[0]}return u+=f.slice(h),u}let e=K(n,t||location.href);return e=await c(e,t||location.href,0),e}var X=/url\((["']?)([^"')]+)\1\)/g,pt=/@font-face[^{}]*\{[^}]*\}/g;function J(n){if(!n)return[];let t=[],o=n.split(",").map(s=>s.trim()).filter(Boolean);for(let s of o){let i=s.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!i)continue;let c=i[1],e=i[2],f=a=>{if(!a.includes("?"))return parseInt(a,16);let m=parseInt(a.replace(/\?/g,"0"),16),u=parseInt(a.replace(/\?/g,"F"),16);return[m,u]};if(e){let a=f(c),m=f(e),u=Array.isArray(a)?a[0]:a,h=Array.isArray(m)?m[1]:m;t.push([Math.min(u,h),Math.max(u,h)])}else{let a=f(c);Array.isArray(a)?t.push([a[0],a[1]]):t.push([a,a])}}return t}function Q(n,t){if(!t.length||!n||n.size===0)return!0;for(let o of n)for(let[s,i]of t)if(o>=s&&o<=i)return!0;return!1}function D(n,t){let o=[];if(!n)return o;for(let s of n.matchAll(X)){let i=(s[2]||"").trim();if(!(!i||i.startsWith("data:"))){if(!/^https?:/i.test(i))try{i=new URL(i,t||location.href).href}catch{}o.push(i)}}return o}async function Y(n,t,o=""){let s=n;for(let i of n.matchAll(X)){let c=V(i[0]);if(!c)continue;let e=c;if(!e.startsWith("http")&&!e.startsWith("data:"))try{e=new URL(e,t||location.href).href}catch{}if(!R(e)){if(x.resource?.has(e)){x.font?.add(e),s=s.replace(i[0],`url(${x.resource.get(e)})`);continue}if(!x.font?.has(e))try{let f=await O(e,{as:"dataURL",useProxy:o,silent:!0});if(f.ok&&typeof f.data=="string"){let a=f.data;x.resource?.set(e,a),x.font?.add(e),s=s.replace(i[0],`url(${a})`)}}catch{console.warn("[snapDOM] Failed to fetch font resource:",e)}}}return s}function yt(n){if(!n.length)return null;let t=(f,a)=>n.some(([m,u])=>!(u<f||m>a)),o=t(0,255)||t(305,305),s=t(256,591)||t(7680,7935),i=t(880,1023),c=t(1024,1279);return t(7840,7929)||t(258,259)||t(416,417)||t(431,432)?"vietnamese":c?"cyrillic":i?"greek":s?"latin-ext":o?"latin":null}function G(n={}){let t=new Set((n.families||[]).map(i=>String(i).toLowerCase())),o=new Set((n.domains||[]).map(i=>String(i).toLowerCase())),s=new Set((n.subsets||[]).map(i=>String(i).toLowerCase()));return(i,c)=>{if(t.size&&t.has(i.family.toLowerCase()))return!0;if(o.size)for(let e of i.srcUrls)try{if(o.has(new URL(e).host.toLowerCase()))return!0}catch{}if(s.size){let e=yt(c);if(e&&s.has(e))return!0}return!1}}function gt(n){if(!n)return n;let t=/@font-face[^{}]*\{[^}]*\}/gi,o=new Set,s=[];for(let c of n.match(t)||[]){let e=c.match(/font-family:\s*([^;]+);/i)?.[1]||"",f=T(e),a=(c.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),m=(c.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),u=(c.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),h=(c.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),d=(c.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),b=D(d,location.href),S=b.length?b.map(l=>String(l).toLowerCase()).sort().join("|"):d.toLowerCase(),r=[String(f||"").toLowerCase(),a,m,u,h.toLowerCase(),S].join("|");o.has(r)||(o.add(r),s.push(c))}if(s.length===0)return n;let i=0;return n.replace(t,()=>s[i++]||"")}function wt(n,t,o,s){let i=Array.from(n||[]).sort().join("|"),c=t?JSON.stringify({families:(t.families||[]).map(a=>String(a).toLowerCase()).sort(),domains:(t.domains||[]).map(a=>String(a).toLowerCase()).sort(),subsets:(t.subsets||[]).map(a=>String(a).toLowerCase()).sort()}):"",e=(o||[]).map(a=>`${(a.family||"").toLowerCase()}::${a.weight||"normal"}::${a.style||"normal"}::${a.src||""}`).sort().join("|");return`fonts-embed-css::req=${i}::ex=${c}::lf=${e}::px=${s||""}`}async function Z(n,t,o,s){let i;try{i=n.cssRules||[]}catch{return}let c=(e,f)=>{try{return new URL(e,f||location.href).href}catch{return e}};for(let e of i){if(e.type===CSSRule.IMPORT_RULE&&e.styleSheet){let f=e.href?c(e.href,t):t;if(s.depth>=N){console.warn(`[snapDOM] CSSOM import depth exceeded (${N}) at ${f}`);continue}if(f&&s.visitedSheets.has(f)){console.warn(`[snapDOM] Skipping circular CSSOM import: ${f}`);continue}f&&s.visitedSheets.add(f);let a={...s,depth:(s.depth||0)+1};await Z(e.styleSheet,f,o,a);continue}if(e.type===CSSRule.FONT_FACE_RULE){let f=(e.style.getPropertyValue("font-family")||"").trim(),a=T(f);if(!a||R(a))continue;let m=(e.style.getPropertyValue("font-weight")||"400").trim(),u=(e.style.getPropertyValue("font-style")||"normal").trim(),h=(e.style.getPropertyValue("font-stretch")||"100%").trim(),d=(e.style.getPropertyValue("src")||"").trim(),b=(e.style.getPropertyValue("unicode-range")||"").trim();if(!s.faceMatchesRequired(a,u,m,h))continue;let S=J(b);if(!Q(s.usedCodepoints,S))continue;let r={family:a,weightSpec:m,styleSpec:u,stretchSpec:h,unicodeRange:b,srcRaw:d,srcUrls:D(d,t||location.href),href:t||location.href};if(s.simpleExcluder&&s.simpleExcluder(r,S))continue;if(/url\(/i.test(d)){let l=await Y(d,t||location.href,s.useProxy);await o(`@font-face{font-family:${a};src:${l};font-style:${u};font-weight:${m};font-stretch:${h};${b?`unicode-range:${b};`:""}}`)}else await o(`@font-face{font-family:${a};src:${d};font-style:${u};font-weight:${m};font-stretch:${h};${b?`unicode-range:${b};`:""}}`)}}}async function Lt({required:n,usedCodepoints:t,exclude:o=void 0,localFonts:s=[],useProxy:i=""}={}){n instanceof Set||(n=new Set),t instanceof Set||(t=new Set);let c=new Map;for(let r of n){let[l,p,w,g]=String(r).split("__");if(!l)continue;let y=c.get(l)||[];y.push({w:parseInt(p,10),s:w,st:parseInt(g,10)}),c.set(l,y)}function e(r,l,p,w){if(!c.has(r))return!1;let g=c.get(r),y=lt(p),C=ft(l),F=mt(w),M=y.min!==y.max,A=y.min,v=k=>C.kind==="normal"&&k==="normal"||C.kind!=="normal"&&(k==="italic"||k==="oblique"),I=!1;for(let k of g){let $=M?k.w>=y.min&&k.w<=y.max:k.w===A,L=v(U(k.s)),_=k.st>=F.min&&k.st<=F.max;if($&&L&&_){I=!0;break}}if(I)return!0;if(!M)for(let k of g){let $=v(U(k.s)),L=k.st>=F.min&&k.st<=F.max;if(Math.abs(A-k.w)<=300&&$&&L)return!0}if(!M&&C.kind==="normal"&&g.some($=>U($.s)!=="normal"))for(let $ of g){let L=Math.abs(A-$.w)<=300,_=$.st>=F.min&&$.st<=F.max;if(L&&_)return!0}return!1}let f=G(o),a=wt(n,o,s,i);if(x.resource?.has(a))return x.resource.get(a);let m=dt(n),u=[],h=q;for(let r of document.querySelectorAll("style")){let l=r.textContent||"";for(let p of l.matchAll(h)){let w=(p[2]||p[4]||"").trim();if(!w||R(w))continue;!!document.querySelector(`link[rel="stylesheet"][href="${w}"]`)||u.push(w)}}u.length&&await Promise.all(u.map(r=>new Promise(l=>{if(document.querySelector(`link[rel="stylesheet"][href="${r}"]`))return l(null);let p=document.createElement("link");p.rel="stylesheet",p.href=r,p.setAttribute("data-snapdom","injected-import"),p.onload=()=>l(p),p.onerror=()=>l(null),document.head.appendChild(p)})));let d="",b=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).filter(r=>!!r.href);for(let r of b)try{if(R(r.href))continue;let l="",p=!1;try{p=new URL(r.href,location.href).origin===location.origin}catch{}if(!p&&!ut(r.href,m))continue;if(p){let g=Array.from(document.styleSheets).find(y=>y.href===r.href);if(g)try{let y=g.cssRules||[];l=Array.from(y).map(C=>C.cssText).join("")}catch{}}if(!l&&(l=(await O(r.href,{as:"text",useProxy:i})).data,R(r.href)))continue;l=await ht(l,r.href,i);let w="";for(let g of l.match(pt)||[]){let y=(g.match(/font-family:\s*([^;]+);/i)?.[1]||"").trim(),C=T(y);if(!C||R(C))continue;let F=(g.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),M=(g.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),A=(g.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),v=(g.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),I=(g.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),k=D(I,r.href);if(!e(C,M,F,A))continue;let $=J(v);if(!Q(t,$))continue;let L={family:C,weightSpec:F,styleSpec:M,stretchSpec:A,unicodeRange:v,srcRaw:I,srcUrls:k,href:r.href};if(o&&f(L,$))continue;let _=/url\(/i.test(I)?await Y(g,r.href,i):g;w+=_}w.trim()&&(d+=w)}catch{console.warn("[snapDOM] Failed to process stylesheet:",r.href)}let S={requiredIndex:c,usedCodepoints:t,faceMatchesRequired:e,simpleExcluder:o?G(o):null,useProxy:i,visitedSheets:new Set,depth:0};for(let r of document.styleSheets)if(!(r.href&&b.some(l=>l.href===r.href)))try{let l=r.href||location.href;l&&S.visitedSheets.add(l),await Z(r,l,async p=>{d+=p},S)}catch{}try{for(let r of document.fonts||[]){if(!r||!r.family||r.status!=="loaded"||!r._snapdomSrc)continue;let l=String(r.family).replace(/^['"]+|['"]+$/g,"");if(R(l)||!c.has(l)||o?.families&&o.families.some(w=>String(w).toLowerCase()===l.toLowerCase()))continue;let p=r._snapdomSrc;if(!String(p).startsWith("data:")){if(x.resource?.has(r._snapdomSrc))p=x.resource.get(r._snapdomSrc),x.font?.add(r._snapdomSrc);else if(!x.font?.has(r._snapdomSrc))try{let w=await O(r._snapdomSrc,{as:"dataURL",useProxy:i,silent:!0});if(w.ok&&typeof w.data=="string")p=w.data,x.resource?.set(r._snapdomSrc,p),x.font?.add(r._snapdomSrc);else continue}catch{console.warn("[snapDOM] Failed to fetch dynamic font src:",r._snapdomSrc);continue}}d+=`@font-face{font-family:'${l}';src:url(${p});font-style:${r.style||"normal"};font-weight:${r.weight||"normal"};}`}}catch{}for(let r of s){if(!r||typeof r!="object")continue;let l=String(r.family||"").replace(/^['"]+|['"]+$/g,"");if(!l||R(l)||!c.has(l)||o?.families&&o.families.some(F=>String(F).toLowerCase()===l.toLowerCase()))continue;let p=r.weight!=null?String(r.weight):"normal",w=r.style!=null?String(r.style):"normal",g=r.stretchPct!=null?`${r.stretchPct}%`:"100%",y=String(r.src||""),C=y;if(!C.startsWith("data:")){if(x.resource?.has(y))C=x.resource.get(y),x.font?.add(y);else if(!x.font?.has(y))try{let F=await O(y,{as:"dataURL",useProxy:i,silent:!0});if(F.ok&&typeof F.data=="string")C=F.data,x.resource?.set(y,C),x.font?.add(y);else continue}catch{console.warn("[snapDOM] Failed to fetch localFonts src:",y);continue}}d+=`@font-face{font-family:'${l}';src:url(${C});font-style:${w};font-weight:${p};font-stretch:${g};}`}return d&&(d=gt(d),x.resource?.set(a,d)),d}function Mt(n){let t=new Set;if(!n)return t;let o=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,null),s=e=>{let f=T(e.fontFamily);if(!f)return;let a=(m,u,h)=>`${f}__${P(m)}__${U(u)}__${ct(h)}`;t.add(a(e.fontWeight,e.fontStyle,e.fontStretch))};s(getComputedStyle(n));let i=getComputedStyle(n,"::before");i&&i.content&&i.content!=="none"&&s(i);let c=getComputedStyle(n,"::after");for(c&&c.content&&c.content!=="none"&&s(c);o.nextNode();){let e=o.currentNode,f=getComputedStyle(e);s(f);let a=getComputedStyle(e,"::before");a&&a.content&&a.content!=="none"&&s(a);let m=getComputedStyle(e,"::after");m&&m.content&&m.content!=="none"&&s(m)}return t}function At(n){let t=new Set,o=i=>{if(i)for(let c of i)t.add(c.codePointAt(0))},s=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;s.nextNode();){let i=s.currentNode;if(i.nodeType===Node.TEXT_NODE)o(i.nodeValue||"");else if(i.nodeType===Node.ELEMENT_NODE){let c=i;for(let e of["::before","::after"]){let a=getComputedStyle(c,e)?.getPropertyValue("content");if(!(!a||a==="none"))if(/^"/.test(a)||/^'/.test(a))o(a.slice(1,-1));else{let m=a.match(/\\[0-9A-Fa-f]{1,6}/g);if(m)for(let u of m)try{t.add(parseInt(u.slice(1),16))}catch{}}}}}return t}async function It(n,t=2){try{await document.fonts.ready}catch{}let o=Array.from(n||[]).filter(Boolean);if(o.length===0)return;let s=()=>{let i=document.createElement("div");i.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";for(let c of o){let e=document.createElement("span");e.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",e.style.fontFamily=`"${c}"`,e.style.fontWeight="700",e.style.fontStyle="italic",e.style.fontSize="32px",e.style.lineHeight="1",e.style.whiteSpace="nowrap",e.style.margin="0",e.style.padding="0",i.appendChild(e)}document.body.appendChild(i),i.offsetWidth,document.body.removeChild(i)};for(let i=0;i<Math.max(1,t);i++)s(),await new Promise(c=>requestAnimationFrame(()=>requestAnimationFrame(c)))}async function Et(n,t,o,s={}){let i=[[n,t]],c=["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"],e=["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"],f=["background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode"],a=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];for(;i.length;){let[m,u]=i.shift(),h=o.get(m)||B(m);o.has(m)||o.set(m,h);let d=(()=>{let r=h.getPropertyValue("border-image"),l=h.getPropertyValue("border-image-source");return r&&r!=="none"||l&&l!=="none"})();for(let r of f){let l=h.getPropertyValue(r);l&&u.style.setProperty(r,l)}for(let r of c){let l=h.getPropertyValue(r);if(!l||l==="none")continue;let p=j(l),w=await Promise.all(p.map(g=>z(g,s)));w.some(g=>g&&g!=="none"&&!/^url\(undefined/.test(g))&&u.style.setProperty(r,w.join(", "))}for(let r of e){let l=h.getPropertyValue(r);!l||l==="initial"||u.style.setProperty(r,l)}if(d)for(let r of a){let l=h.getPropertyValue(r);!l||l==="initial"||u.style.setProperty(r,l)}let b=Array.from(m.children),S=Array.from(u.children).filter(r=>!(r.dataset&&r.dataset.snapdomPseudo));for(let r=0;r<Math.min(b.length,S.length);r++)i.push([b[r],S[r]])}}export{St as a,R as b,bt as c,Rt as d,Lt as e,Mt as f,At as g,It as h,Et as i};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* SnapDOM
|
|
3
|
+
* v2.0.2
|
|
4
|
+
* Author: Juan Martin Muda
|
|
5
|
+
* License: MIT
|
|
6
|
+
*/
|
|
7
|
+
import{b as qt,c as Vt,d as Yt,e as Ut,f as jt,g as Kt,h as Gt,i as Zt}from"./chunk-LCE36WDF.js";import{c as Q}from"./chunk-EVYDSB2B.js";import{a as A,b as $t,c as It,d as Lt,e as Wt,f as U,g as _t,h as Ht,i as Bt,k as ot,l as Rt,m as Dt,n as Ot,o as zt,p as St,q as Xt}from"./chunk-GIYVHLCQ.js";import{a as O,b as st}from"./chunk-SMBRKOUP.js";var Jt=new WeakMap,Ct=new Map,vt=0;function it(){vt++}var Qt=!1;function en(t=document.documentElement){if(!Qt){Qt=!0;try{new MutationObserver(()=>it()).observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{new MutationObserver(()=>it()).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{let e=document.fonts;e&&(e.addEventListener?.("loadingdone",it),e.ready?.then(()=>it()).catch(()=>{}))}catch{}}}function nn(t,e={}){let n={},r=t.getPropertyValue("visibility");for(let o=0;o<t.length;o++){let s=t[o],u=t.getPropertyValue(s);(s==="background-image"||s==="content")&&u.includes("url(")&&!u.includes("data:")&&(u="none"),n[s]=u}let a=["text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-decoration-skip-ink"];for(let o of a)if(!n[o])try{let s=t.getPropertyValue(o);s&&(n[o]=s)}catch{}if(e.embedFonts){let o=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let s of o)if(!n[s])try{let u=t.getPropertyValue(s);u&&(n[s]=u)}catch{}}return r==="hidden"&&(n.opacity="0"),n}var te=new WeakMap;function rn(t){let e=te.get(t);return e||(e=Object.entries(t).sort((r,a)=>r[0]<a[0]?-1:r[0]>a[0]?1:0).map(([r,a])=>`${r}:${a}`).join(";"),te.set(t,e),e)}function on(t,e=null,n={}){let r=Jt.get(t);if(r&&r.epoch===vt)return r.snapshot;let a=e||getComputedStyle(t),o=nn(a,n);return fn(t,a,o),Jt.set(t,{epoch:vt,snapshot:o}),o}function sn(t,e){return t&&t.session&&t.persist?t:t&&(t.styleMap||t.styleCache||t.nodeMap)?{session:t,persist:{snapshotKeyCache:Ct,defaultStyle:A.defaultStyle,baseStyle:A.baseStyle,image:A.image,resource:A.resource,background:A.background,font:A.font},options:e||{}}:{session:A.session,persist:{snapshotKeyCache:Ct,defaultStyle:A.defaultStyle,baseStyle:A.baseStyle,image:A.image,resource:A.resource,background:A.background,font:A.font},options:t||e||{}}}async function z(t,e,n,r){if(t.tagName==="STYLE")return;let a=sn(n,r),o=a.options&&a.options.cache||"auto";if(o!=="disabled"&&en(document.documentElement),o==="disabled"&&!a.session.__bumpedForDisabled&&(it(),Ct.clear(),a.session.__bumpedForDisabled=!0),Bt.has(t.tagName?.toLowerCase())){let d=t.getAttribute?.("style");d&&e.setAttribute("style",d)}let{session:s,persist:u}=a;s.styleCache.has(t)||s.styleCache.set(t,getComputedStyle(t));let l=s.styleCache.get(t),i=on(t,l,a.options),c=rn(i),f=u.snapshotKeyCache.get(c);if(!f){let d=t.tagName?.toLowerCase()||"div";f=ot(i,d),u.snapshotKeyCache.set(c,f)}s.styleMap.set(e,f)}function an(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof HTMLIFrameElement||t instanceof SVGElement||t instanceof HTMLObjectElement||t instanceof HTMLEmbedElement}function cn(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 ln(t){let e=t.parentElement;if(!e)return!1;let n=getComputedStyle(e).display||"";return n.includes("flex")||n.includes("grid")}function un(t,e){if(t.textContent&&/\S/.test(t.textContent))return!0;let n=t.firstElementChild,r=t.lastElementChild;if(n&&n.tagName==="BR"||r&&r.tagName==="BR")return!0;let a=t.scrollHeight;if(a===0)return!1;let o=parseFloat(e.paddingTop)||0,s=parseFloat(e.paddingBottom)||0;return a>o+s}function fn(t,e,n){if(t instanceof HTMLElement&&t.style&&t.style.height)return;let r=t.tagName&&t.tagName.toLowerCase();if(!r||r!=="div"&&r!=="section"&&r!=="article"&&r!=="main"&&r!=="aside"&&r!=="header"&&r!=="footer"&&r!=="nav"&&r!=="ol"&&r!=="ul"&&r!=="li")return;let a=e.display||"";if(a.includes("flex")||a.includes("grid")||an(t))return;let o=e.position;if(o==="absolute"||o==="fixed"||o==="sticky"||e.transform!=="none"||cn(e)||ln(t))return;let s=e.overflowX||e.overflow||"visible",u=e.overflowY||e.overflow||"visible";if(s!=="visible"||u!=="visible")return;let l=e.clip;l&&l!=="auto"&&l!=="rect(auto, auto, auto, auto)"||e.visibility==="hidden"||e.opacity==="0"||un(t,e)&&(delete n.height,delete n["block-size"])}var ne=["fill","stroke","color","background-color","stop-color"],ee=new Map;function dn(t,e){let n=e+"::"+t.toLowerCase(),r=ee.get(n);if(r)return r;let a=document,o=e==="http://www.w3.org/2000/svg"?a.createElementNS(e,t):a.createElement(t),s=a.createElement("div");s.style.cssText="position:absolute;left:-99999px;top:-99999px;contain:strict;display:block;",s.appendChild(o),a.documentElement.appendChild(s);let u=getComputedStyle(o),l={};for(let i of ne)l[i]=u.getPropertyValue(i)||"";return s.remove(),ee.set(n,l),l}function re(t,e){if(!(t instanceof Element)||!(e instanceof Element))return;let n=t.getAttribute?.("style"),r=!!(n&&n.includes("var("));if(!r&&t.attributes?.length){let o=t.attributes;for(let s=0;s<o.length;s++){let u=o[s];if(u&&typeof u.value=="string"&&u.value.includes("var(")){r=!0;break}}}let a=null;if(r)try{a=getComputedStyle(t)}catch{}if(r){let o=t.style;if(o&&o.length)for(let s=0;s<o.length;s++){let u=o[s],l=o.getPropertyValue(u);if(!l||!l.includes("var("))continue;let i=a&&a.getPropertyValue(u);if(i)try{e.style.setProperty(u,i.trim(),o.getPropertyPriority(u))}catch{}}}if(r&&t.attributes?.length){let o=t.attributes;for(let s=0;s<o.length;s++){let u=o[s];if(!u||typeof u.value!="string"||!u.value.includes("var("))continue;let l=u.name,i=a&&a.getPropertyValue(l);if(i)try{e.style.setProperty(l,i.trim())}catch{}}}if(!r){if(!a)try{a=getComputedStyle(t)}catch{a=null}if(!a)return;let o=t.namespaceURI||"html",s=dn(t.tagName,o);for(let u of ne){let l=a.getPropertyValue(u)||"",i=s[u]||"";if(l&&l!==i)try{e.style.setProperty(u,l.trim())}catch{}}}}function mt(t,e,n){return Promise.all(t.map(r=>new Promise(a=>{function o(){O(s=>{(s&&typeof s.timeRemaining=="function"?s.timeRemaining()>0:!0)?e(r,a):o()},{fast:n})}o()})))}function hn(t){return t=t.trim(),!t||/:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(t)?t:`${t}:not([data-sd-slotted])`}function mn(t,e,n=!0){return t.split(",").map(r=>r.trim()).filter(Boolean).map(r=>{if(r.startsWith(":where(")||r.startsWith("@"))return r;let a=n?hn(r):r;return`:where(${e} ${a})`}).join(", ")}function se(t,e){return t?(t=t.replace(/:host\(([^)]+)\)/g,(n,r)=>`:where(${e}:is(${r.trim()}))`),t=t.replace(/:host\b/g,`:where(${e})`),t=t.replace(/:host-context\(([^)]+)\)/g,(n,r)=>`:where(:where(${r.trim()}) ${e})`),t=t.replace(/::slotted\(([^)]+)\)/g,(n,r)=>`:where(${e} ${r.trim()})`),t=t.replace(/(^|})(\s*)([^@}{]+){/g,(n,r,a,o)=>{let s=mn(o,e,!0);return`${r}${a}${s}{`}),t):""}function ie(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}function ae(t){let e="";try{t.querySelectorAll("style").forEach(r=>{e+=(r.textContent||"")+`
|
|
8
|
+
`});let n=t.adoptedStyleSheets||[];for(let r of n)try{if(r&&r.cssRules)for(let a of r.cssRules)e+=a.cssText+`
|
|
9
|
+
`}catch{}}catch{}return e}function ce(t,e,n){if(!e)return;let r=document.createElement("style");r.setAttribute("data-sd",n),r.textContent=e,t.insertBefore(r,t.firstChild||null)}function le(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{}}function ue(t){let e=new Set;if(!t)return e;let n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,r;for(;r=n.exec(t);)e.add(r[1]);return e}function pn(t,e){try{let r=getComputedStyle(t).getPropertyValue(e).trim();if(r)return r}catch{}try{let r=getComputedStyle(document.documentElement).getPropertyValue(e).trim();if(r)return r}catch{}return""}function fe(t,e,n){let r=[];for(let a of e){let o=pn(t,a);o&&r.push(`${a}: ${o};`)}return r.length?`${n}{${r.join("")}}
|
|
10
|
+
`:""}function de(t){t&&(t.nodeType===Node.ELEMENT_NODE&&t.setAttribute("data-sd-slotted",""),t.querySelectorAll&&t.querySelectorAll("*").forEach(e=>e.setAttribute("data-sd-slotted","")))}async function gn(t,e=3){let n=()=>{try{return t.contentDocument||t.contentWindow?.document||null}catch{return null}},r=n(),a=0;for(;a<e&&(!r||!r.body&&!r.documentElement);)await new Promise(o=>setTimeout(o,0)),r=n(),a++;return r&&(r.body||r.documentElement)?r:null}function yn(t){let e=t.getBoundingClientRect(),n=0,r=0,a=0,o=0;try{let l=getComputedStyle(t);n=parseFloat(l.borderLeftWidth)||0,r=parseFloat(l.borderRightWidth)||0,a=parseFloat(l.borderTopWidth)||0,o=parseFloat(l.borderBottomWidth)||0}catch{}let s=Math.max(0,Math.round(e.width-(n+r))),u=Math.max(0,Math.round(e.height-(a+o)));return{contentWidth:s,contentHeight:u,rect:e}}function bn(t,e,n){let r=t.createElement("style");return r.setAttribute("data-sd-iframe-pin",""),r.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(r),()=>{try{r.remove()}catch{}}}async function he(t,e,n){let r=await gn(t,3);if(!r)throw new Error("iframe document not accessible/ready");let{contentWidth:a,contentHeight:o,rect:s}=yn(t),u=n?.snap;if(!u||typeof u.toPng!="function")throw new Error("snapdom.toPng not available in iframe or window");let l={...n,scale:1},i=bn(r,a,o),c;try{c=await u.toPng(r.documentElement,l)}finally{i()}c.style.display="block",c.style.width=`${a}px`,c.style.height=`${o}px`;let f=document.createElement("div");return e.nodeMap.set(f,t),z(t,f,e,n),f.style.overflow="hidden",f.style.display="block",f.style.width||(f.style.width=`${Math.round(s.width)}px`),f.style.height||(f.style.height=`${Math.round(s.height)}px`),f.appendChild(c),f}var at=new Map;async function ct(t){if(A.resource?.has(t))return A.resource.get(t);if(at.has(t))return at.get(t);let e=(async()=>{let n=await U(t,{as:"dataURL",silent:!0});if(!n.ok||typeof n.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${t}`);return A.resource?.set(t,n.data),n.data})();at.set(t,e);try{let n=await e;return at.set(t,n),n}catch(n){throw at.delete(t),n}}var xn=/\bblob:[^)"'\s]+/g;async function oe(t){if(!t||t.indexOf("blob:")===-1)return t;let e=Array.from(new Set(t.match(xn)||[]));if(e.length===0)return t;let n=t;for(let r of e)try{let a=await ct(r);n=n.split(r).join(a)}catch{}return n}function ht(t){return typeof t=="string"&&t.startsWith("blob:")}function wn(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 Sn(t){return t.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}async function me(t){if(!t)return;let e=t.querySelectorAll?t.querySelectorAll("img"):[];for(let s of e)try{let l=s.getAttribute("src")||s.currentSrc||"";if(ht(l)){let c=await ct(l);s.setAttribute("src",c)}let i=s.getAttribute("srcset");if(i&&i.includes("blob:")){let c=wn(i),f=!1;for(let d of c)if(ht(d.url))try{d.url=await ct(d.url),f=!0}catch{}f&&s.setAttribute("srcset",Sn(c))}}catch{}let n=t.querySelectorAll?t.querySelectorAll("image"):[];for(let s of n)try{let u="http://www.w3.org/1999/xlink",l=s.getAttribute("href")||s.getAttributeNS?.(u,"href");if(ht(l)){let i=await ct(l);s.setAttribute("href",i),s.removeAttributeNS?.(u,"href")}}catch{}let r=t.querySelectorAll?t.querySelectorAll("[style*='blob:']"):[];for(let s of r)try{let u=s.getAttribute("style");if(u&&u.includes("blob:")){let l=await oe(u);s.setAttribute("style",l)}}catch{}let a=t.querySelectorAll?t.querySelectorAll("style"):[];for(let s of a)try{let u=s.textContent||"";u.includes("blob:")&&(s.textContent=await oe(u))}catch{}let o=["poster"];for(let s of o){let u=t.querySelectorAll?t.querySelectorAll(`[${s}^='blob:']`):[];for(let l of u)try{let i=l.getAttribute(s);ht(i)&&l.setAttribute(s,await ct(i))}catch{}}}async function lt(t,e,n){if(!t)throw new Error("Invalid node");let r=new Set,a=null,o=null;if(t.nodeType===Node.ELEMENT_NODE){let i=(t.localName||t.tagName||"").toLowerCase();if(t.id==="snapdom-sandbox"||t.hasAttribute("data-snapdom-sandbox")||Ht.has(i))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 i=document.createElement("div"),c=t.getBoundingClientRect();return i.style.cssText=`display:inline-block;width:${c.width}px;height:${c.height}px;visibility:hidden;`,i}else if(n.excludeMode==="remove")return null}if(n.exclude&&Array.isArray(n.exclude))for(let i of n.exclude)try{if(t.matches?.(i)){if(n.excludeMode==="hide"){let c=document.createElement("div"),f=t.getBoundingClientRect();return c.style.cssText=`display:inline-block;width:${f.width}px;height:${f.height}px;visibility:hidden;`,c}else if(n.excludeMode==="remove")return null}}catch(c){console.warn(`Invalid selector in exclude option: ${i}`,c)}if(typeof n.filter=="function")try{if(!n.filter(t)){if(n.filterMode==="hide"){let i=document.createElement("div"),c=t.getBoundingClientRect();return i.style.cssText=`display:inline-block;width:${c.width}px;height:${c.height}px;visibility:hidden;`,i}else if(n.filterMode==="remove")return null}}catch(i){console.warn("Error in filter function:",i)}if(t.tagName==="IFRAME"){let i=!1;try{i=!!(t.contentDocument||t.contentWindow?.document)}catch{i=!1}if(i)try{return await he(t,e,n)}catch(c){console.warn("[SnapDOM] iframe rasterization failed, fallback:",c)}if(n.placeholders){let c=document.createElement("div");return c.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;`,z(t,c,e,n),c}else{let c=t.getBoundingClientRect(),f=document.createElement("div");return f.style.cssText=`display:inline-block;width:${c.width}px;height:${c.height}px;visibility:hidden;`,z(t,f,e,n),f}}if(t.getAttribute("data-capture")==="placeholder"){let i=t.cloneNode(!1);e.nodeMap.set(i,t),z(t,i,e,n);let c=document.createElement("div");return c.textContent=t.getAttribute("data-placeholder-text")||"",c.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",i.appendChild(c),i}if(t.tagName==="CANVAS"){let i="";try{let f=t.getContext("2d",{willReadFrequently:!0});try{f&&f.getImageData(0,0,1,1)}catch{}if(await new Promise(d=>requestAnimationFrame(d)),i=t.toDataURL("image/png"),!i||i==="data:,"){try{f&&f.getImageData(0,0,1,1)}catch{}if(await new Promise(d=>requestAnimationFrame(d)),i=t.toDataURL("image/png"),!i||i==="data:,"){let d=document.createElement("canvas");d.width=t.width,d.height=t.height;let h=d.getContext("2d");h&&(h.drawImage(t,0,0),i=d.toDataURL("image/png"))}}}catch{}let c=document.createElement("img");try{c.decoding="sync",c.loading="eager"}catch{}i&&(c.src=i),c.width=t.width,c.height=t.height;try{let f=getComputedStyle(t);f.width&&(c.style.width=f.width),f.height&&(c.style.height=f.height)}catch{}return e.nodeMap.set(c,t),z(t,c,e,n),c}let s;try{if(s=t.cloneNode(!1),re(t,s),e.nodeMap.set(s,t),t.tagName==="IMG"){le(t,s);try{let i=t.getBoundingClientRect(),c=Math.round(i.width||0),f=Math.round(i.height||0);if(!c||!f){let d=window.getComputedStyle(t),h=parseFloat(d.width)||0,m=parseFloat(d.height)||0,g=parseInt(t.getAttribute("width")||"",10)||0,w=parseInt(t.getAttribute("height")||"",10)||0,M=t.width||t.naturalWidth||0,b=t.height||t.naturalHeight||0;c=Math.round(c||h||g||M||0),f=Math.round(f||m||w||b||0)}c&&(s.dataset.snapdomWidth=String(c)),f&&(s.dataset.snapdomHeight=String(f))}catch{}try{let i=t.getAttribute("style")||"",c=window.getComputedStyle(t),f=w=>{let M=i.match(new RegExp(`${w}\\s*:\\s*([^;]+)`,"i")),b=M?M[1].trim():c.getPropertyValue(w);return/%|auto/i.test(String(b||""))},d=parseInt(s.dataset.snapdomWidth||"0",10),h=parseInt(s.dataset.snapdomHeight||"0",10),m=f("width")||!d,g=f("height")||!h;m&&d&&(s.style.width=`${d}px`),g&&h&&(s.style.height=`${h}px`),d&&(s.style.minWidth=`${d}px`),h&&(s.style.minHeight=`${h}px`)}catch{}}}catch(i){throw console.error("[Snapdom] Failed to clone node:",t,i),i}if(t instanceof HTMLTextAreaElement){let i=t.getBoundingClientRect();s.style.width=`${i.width}px`,s.style.height=`${i.height}px`}if(t instanceof HTMLInputElement&&(s.value=t.value,s.setAttribute("value",t.value),t.checked!==void 0&&(s.checked=t.checked,t.checked&&s.setAttribute("checked",""),t.indeterminate&&(s.indeterminate=t.indeterminate))),t instanceof HTMLSelectElement&&(a=t.value),t instanceof HTMLTextAreaElement&&(o=t.value),z(t,s,e,n),t.shadowRoot){let w=function(b,x){if(b.nodeType===Node.ELEMENT_NODE&&b.tagName==="STYLE")return x(null);lt(b,e,n).then(p=>{x(p||null)}).catch(()=>{x(null)})};try{let b=t.shadowRoot.querySelectorAll("slot");for(let x of b){let p=[];try{p=x.assignedNodes?.({flatten:!0})||x.assignedNodes?.()||[]}catch{p=x.assignedNodes?.()||[]}for(let C of p)r.add(C)}}catch{}let i=ie(e),c=`[data-sd="${i}"]`;try{s.setAttribute("data-sd",i)}catch{}let f=ae(t.shadowRoot),d=se(f,c),h=ue(f),m=fe(t,h,c);ce(s,m+d,i);let g=document.createDocumentFragment(),M=await mt(Array.from(t.shadowRoot.childNodes),w,n.fast);g.append(...M.filter(b=>!!b)),s.appendChild(g)}if(t.tagName==="SLOT"){let d=function(m,g){lt(m,e,n).then(w=>{w&&de(w),g(w||null)}).catch(()=>{g(null)})},i=t.assignedNodes?.({flatten:!0})||[],c=i.length>0?i:Array.from(t.childNodes),f=document.createDocumentFragment(),h=await mt(Array.from(c),d,n.fast);return f.append(...h.filter(m=>!!m)),f}function u(i,c){if(r.has(i))return c(null);lt(i,e,n).then(f=>{c(f||null)}).catch(()=>{c(null)})}let l=await mt(Array.from(t.childNodes),u,n.fast);if(s.append(...l.filter(i=>!!i)),a!==null&&s instanceof HTMLSelectElement){s.value=a;for(let i of s.options)i.value===a?i.setAttribute("selected",""):i.removeAttribute("selected")}return o!==null&&s instanceof HTMLTextAreaElement&&(s.textContent=o),s}function be(t){return/\bcounter\s*\(|\bcounters\s*\(/.test(t||"")}function Cn(t){return(t||"").replace(/"([^"]*)"/g,"$1")}function pe(t,e=!1){let n="",r=Math.max(1,t);for(;r>0;)r--,n=String.fromCharCode(97+r%26)+n,r=Math.floor(r/26);return e?n.toUpperCase():n}function ge(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"]],r=Math.max(1,Math.min(3999,t)),a="";for(let[o,s]of n)for(;r>=o;)a+=s,r-=o;return e?a:a.toLowerCase()}function ye(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 pe(t,!1);case"upper-alpha":return pe(t,!0);case"lower-roman":return ge(t,!1);case"upper-roman":return ge(t,!0);default:return String(Math.max(0,t))}}function xe(t){let e=()=>A?.session?.__counterEpoch??0,n=e(),r=new WeakMap,a=t instanceof Document?t.documentElement:t,o=d=>d&&d.tagName==="LI",s=d=>{let h=0,m=d?.parentElement;if(!m)return 0;for(let g of m.children){if(g===d)break;g.tagName==="LI"&&h++}return h},u=d=>{let h=new Map;for(let[m,g]of d)h.set(m,g.slice());return h},l=(d,h,m)=>{let g=u(d),w;try{w=m.style?.counterReset||getComputedStyle(m).counterReset}catch{}if(w&&w!=="none")for(let b of w.split(",")){let x=b.trim().split(/\s+/),p=x[0],C=Number.isFinite(Number(x[1]))?Number(x[1]):0;if(!p)continue;let y=h.get(p);if(y&&y.length){let v=y.slice();v.push(C),g.set(p,v)}else g.set(p,[C])}let M;try{M=m.style?.counterIncrement||getComputedStyle(m).counterIncrement}catch{}if(M&&M!=="none")for(let b of M.split(",")){let x=b.trim().split(/\s+/),p=x[0],C=Number.isFinite(Number(x[1]))?Number(x[1]):1;if(!p)continue;let y=g.get(p)||[];y.length===0&&y.push(0),y[y.length-1]+=C,g.set(p,y)}try{if(getComputedStyle(m).display==="list-item"&&o(m)){let x=m.parentElement,p=1;if(x&&x.tagName==="OL"){let y=x.getAttribute("start"),v=Number.isFinite(Number(y))?Number(y):1,E=s(m),F=m.getAttribute("value");p=Number.isFinite(Number(F))?Number(F):v+E}else p=1+s(m);let C=g.get("list-item")||[];C.length===0&&C.push(0),C[C.length-1]=p,g.set("list-item",C)}}catch{}return g},i=(d,h,m)=>{let g=l(m,h,d);r.set(d,g);let w=g;for(let M of d.children)w=i(M,g,w);return g},c=new Map;i(a,c,c);function f(){let d=e();if(d!==n){n=d;let h=new Map;i(a,h,h)}}return{get(d,h){f();let m=r.get(d)?.get(h);return m&&m.length?m[m.length-1]:0},getStack(d,h){f();let m=r.get(d)?.get(h);return m?m.slice():[]}}}function we(t,e,n){if(!t||t==="none")return t;try{let r=/\b(counter|counters)\s*\(([^)]+)\)/g,a=t.replace(r,(o,s,u)=>{let l=String(u).split(",").map(i=>i.trim());if(s==="counter"){let i=l[0]?.replace(/^["']|["']$/g,""),c=(l[1]||"decimal").toLowerCase(),f=n.get(e,i);return ye(f,c)}else{let i=l[0]?.replace(/^["']|["']$/g,""),c=l[1]?.replace(/^["']|["']$/g,"")??"",f=(l[2]||"decimal").toLowerCase(),d=n.getStack(e,i);return d.length?d.map(m=>ye(m,f)).join(c):""}});return Cn(a)}catch{return"- "}}var tt=new WeakMap,Se=300;function vn(t,e){let n=ke(t);return e?(e.__pseudoPreflightFp!==n&&(e.__pseudoPreflight=ve(t),e.__pseudoPreflightFp=n),!!e.__pseudoPreflight):ve(t)}function Mt(t){try{return t&&t.cssRules?t.cssRules:null}catch{return null}}function ke(t){let e=t.querySelectorAll('style,link[rel~="stylesheet"]'),n=`n:${e.length}|`,r=0;for(let o=0;o<e.length;o++){let s=e[o];if(s.tagName==="STYLE"){let u=s.textContent?s.textContent.length:0;n+=`S${u}|`;let l=s.sheet,i=l?Mt(l):null;i&&(r+=i.length)}else{let u=s.getAttribute("href")||"",l=s.getAttribute("media")||"all";n+=`L${u}|m:${l}|`;let i=s.sheet,c=i?Mt(i):null;c&&(r+=c.length)}}let a=t.adoptedStyleSheets;return n+=`ass:${Array.isArray(a)?a.length:0}|tr:${r}`,n}function Ce(t,e,n){let r=Mt(t);if(!r)return!1;for(let a=0;a<r.length;a++){if(n.budget<=0)return!1;let o=r[a],s=o&&o.cssText?o.cssText:"";n.budget--;for(let u of e)if(s.includes(u))return!0;if(o&&o.cssRules&&o.cssRules.length)for(let u=0;u<o.cssRules.length&&n.budget>0;u++){let l=o.cssRules[u],i=l&&l.cssText?l.cssText:"";n.budget--;for(let c of e)if(i.includes(c))return!0}if(n.budget<=0)return!1}return!1}function ve(t=document){let e=ke(t),n=tt.get(t);if(n&&n.fingerprint===e)return n.result;let r=["::before","::after","::first-letter",":before",":after",":first-letter","counter(","counters(","counter-increment","counter-reset"],a=t.querySelectorAll("style");for(let s=0;s<a.length;s++){let u=a[s].textContent||"";for(let l of r)if(u.includes(l))return tt.set(t,{fingerprint:e,result:!0}),!0}let o=t.adoptedStyleSheets;if(Array.isArray(o)&&o.length){let s={budget:Se};try{for(let u of o)if(Ce(u,r,s))return tt.set(t,{fingerprint:e,result:!0}),!0}catch{}}{let s=t.querySelectorAll('style,link[rel~="stylesheet"]'),u={budget:Se};for(let l=0;l<s.length&&u.budget>0;l++){let i=s[l],c=null;if(i.tagName,c=i.sheet||null,c&&Ce(c,r,u))return tt.set(t,{fingerprint:e,result:!0}),!0}}return t.querySelector('[style*="counter("], [style*="counters("]')?(tt.set(t,{fingerprint:e,result:!0}),!0):(tt.set(t,{fingerprint:e,result:!1}),!1)}var et=new WeakMap,Me=-1;function Mn(t){return(t||"").replace(/"([^"]*)"/g,"$1")}function kn(t){if(!t)return"";let e=[],n=/"([^"]*)"/g,r;for(;r=n.exec(t);)e.push(r[1]);return e.length?e.join(""):Mn(t)}function kt(t,e){let n=t.parentElement,r=n?et.get(n):null;return r?{get(a,o){let s=e.get(a,o),u=r.get(o);return typeof u=="number"?Math.max(s,u):s},getStack(a,o){let s=e.getStack(a,o);if(!s.length)return s;let u=r.get(o);if(typeof u=="number"){let l=s.slice();return l[l.length-1]=Math.max(l[l.length-1],u),l}return s}}:e}function At(t,e,n){let r=new Map;function a(l){let i=[];if(!l||l==="none")return i;for(let c of String(l).split(",")){let f=c.trim().split(/\s+/),d=f[0],h=Number.isFinite(Number(f[1]))?Number(f[1]):void 0;d&&i.push({name:d,num:h})}return i}let o=a(e?.counterReset),s=a(e?.counterIncrement);function u(l){if(r.has(l))return r.get(l).slice();let i=n.getStack(t,l);i=i.length?i.slice():[];let c=o.find(d=>d.name===l);if(c){let d=Number.isFinite(c.num)?c.num:0;i=i.length?[...i,d]:[d]}let f=s.find(d=>d.name===l);if(f){let d=Number.isFinite(f.num)?f.num:1;i.length===0&&(i=[0]),i[i.length-1]+=d}return r.set(l,i.slice()),i}return{get(l,i){let c=u(i);return c.length?c[c.length-1]:0},getStack(l,i){return u(i)},__incs:s}}function An(t,e,n){let r;try{r=getComputedStyle(t,e)}catch{}let a=r?.content;if(!a||a==="none"||a==="normal")return{text:"",incs:[]};let o=kt(t,n),s=At(t,r,o),u=be(a)?we(a,t,s):a;return{text:kn(u),incs:s.__incs||[]}}async function Et(t,e,n,r){if(!(t instanceof Element)||!(e instanceof Element))return;let a=t.ownerDocument||document;if(!vn(a,n))return;let o=A?.session?.__counterEpoch??0;if(Me!==o&&(et=new WeakMap,n&&(n.__counterCtx=null),Me=o),!n.__counterCtx)try{n.__counterCtx=xe(t.ownerDocument||document)}catch{}let s=n.__counterCtx;for(let i of["::before","::after","::first-letter"])try{let c=zt(t,i);if(!c||c.content==="none"&&c.backgroundImage==="none"&&c.backgroundColor==="transparent"&&(c.borderStyle==="none"||parseFloat(c.borderWidth)===0)&&(!c.transform||c.transform==="none")&&c.display==="inline")continue;if(i==="::first-letter"){let N=getComputedStyle(t);if(!(c.color!==N.color||c.fontSize!==N.fontSize||c.fontWeight!==N.fontWeight))continue;let I=Array.from(e.childNodes).find(yt=>yt.nodeType===Node.TEXT_NODE&&yt.textContent?.trim().length>0);if(!I)continue;let L=I.textContent,K=L.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],pt=L.slice(K?.length||0);if(!K||/[\uD800-\uDFFF]/.test(K))continue;let G=document.createElement("span");G.textContent=K,G.dataset.snapdomPseudo="::first-letter";let gt=St(c),ut=ot(gt,"span");n.styleMap.set(G,ut);let ft=document.createTextNode(pt);e.replaceChild(ft,I),e.insertBefore(G,ft);continue}let d=c.content??"",h=d===""||d==="none"||d==="normal",{text:m,incs:g}=An(t,i,s),w=c.backgroundImage,M=c.backgroundColor,b=c.fontFamily,x=parseInt(c.fontSize)||32,p=parseInt(c.fontWeight)||!1,C=c.color||"#000",y=c.borderStyle,v=parseFloat(c.borderWidth),E=c.transform,F=qt(b),$=!h&&m!=="",P=w&&w!=="none",W=M&&M!=="transparent"&&M!=="rgba(0, 0, 0, 0)",B=y&&y!=="none"&&v>0,nt=E&&E!=="none";if(!($||P||W||B||nt)){if(g&&g.length&&t.parentElement){let N=et.get(t.parentElement)||new Map;for(let{name:T}of g){if(!T)continue;let I=kt(t,s),Y=At(t,getComputedStyle(t,i),I).get(t,T);N.set(T,Y)}et.set(t.parentElement,N)}continue}let k=document.createElement("span");k.dataset.snapdomPseudo=i,k.style.pointerEvents="none";let q=St(c),V=ot(q,"span");if(n.styleMap.set(k,V),F&&m&&m.length===1){let{dataUrl:N,width:T,height:I}=await Yt(m,b,p,x,C),L=document.createElement("img");L.src=N,L.style=`height:${x}px;width:${T/I*x}px;object-fit:contain;`,k.appendChild(L),e.dataset.snapdomHasIcon="true"}else if(m&&m.startsWith("url(")){let N=It(m);if(N?.trim())try{let T=document.createElement("img"),I=await U(Wt(N),{as:"dataURL",useProxy:r.useProxy});T.src=I.data,T.style=`width:${x}px;height:auto;object-fit:contain;`,k.appendChild(T)}catch(T){console.error(`[snapdom] Error in pseudo ${i} for`,t,T)}}else!F&&$&&(k.textContent=m);k.style.backgroundImage="none","maskImage"in k.style&&(k.style.maskImage="none"),"webkitMaskImage"in k.style&&(k.style.webkitMaskImage="none");try{k.style.backgroundRepeat=c.backgroundRepeat,k.style.backgroundSize=c.backgroundSize,c.backgroundPositionX&&c.backgroundPositionY?(k.style.backgroundPositionX=c.backgroundPositionX,k.style.backgroundPositionY=c.backgroundPositionY):k.style.backgroundPosition=c.backgroundPosition,k.style.backgroundOrigin=c.backgroundOrigin,k.style.backgroundClip=c.backgroundClip,k.style.backgroundAttachment=c.backgroundAttachment,k.style.backgroundBlendMode=c.backgroundBlendMode}catch{}if(P)try{let N=Xt(w),T=await Promise.all(N.map(_t));k.style.backgroundImage=T.join(", ")}catch(N){console.warn(`[snapdom] Failed to inline background-image for ${i}`,N)}W&&(k.style.backgroundColor=M);let j=k.childNodes.length>0||k.textContent?.trim()!==""||P||W||B||nt;if(g&&g.length&&t.parentElement){let N=et.get(t.parentElement)||new Map,T=kt(t,s),I=At(t,getComputedStyle(t,i),T);for(let{name:L}of g){if(!L)continue;let Y=I.get(t,L);N.set(L,Y)}et.set(t.parentElement,N)}if(!j)continue;i==="::before"?e.insertBefore(k,e.firstChild):e.appendChild(k)}catch(c){console.warn(`[snapdom] Failed to capture ${i} for`,t,c)}let u=Array.from(t.children),l=Array.from(e.children).filter(i=>!i.dataset.snapdomPseudo);for(let i=0;i<Math.min(u.length,l.length);i++)await Et(u[i],l[i],n,r)}function Ae(t,e){if(!t||!(t instanceof Element))return;let n=t.ownerDocument||document,r=e||n,a=t instanceof SVGSVGElement?[t]:Array.from(t.querySelectorAll("svg"));if(a.length===0)return;let o=/url\(\s*#([^)]+)\)/g,s=["fill","stroke","filter","clip-path","mask","marker","marker-start","marker-mid","marker-end"],u=p=>window.CSS&&CSS.escape?CSS.escape(p):p.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),l="http://www.w3.org/1999/xlink",i=p=>{if(!p||!p.getAttribute)return null;let C=p.getAttribute("href")||p.getAttribute("xlink:href")||(typeof p.getAttributeNS=="function"?p.getAttributeNS(l,"href"):null);if(C)return C;let y=p.attributes;if(!y)return null;for(let v=0;v<y.length;v++){let E=y[v];if(!E||!E.name)continue;if(E.name==="href")return E.value;let F=E.name.indexOf(":");if(F!==-1&&E.name.slice(F+1)==="href")return E.value}return null},c=new Set(Array.from(t.querySelectorAll("[id]")).map(p=>p.id)),f=new Set,d=!1,h=(p,C=null)=>{if(!p)return;o.lastIndex=0;let y;for(;y=o.exec(p);){d=!0;let v=(y[1]||"").trim();v&&(c.has(v)||(f.add(v),C&&!C.has(v)&&C.add(v)))}},m=p=>{let C=p.querySelectorAll("use");for(let E of C){let F=i(E);if(!F||!F.startsWith("#"))continue;d=!0;let $=F.slice(1).trim();$&&!c.has($)&&f.add($)}let v=p.querySelectorAll('*[style*="url("],*[fill^="url("], *[stroke^="url("],*[filter^="url("],*[clip-path^="url("],*[mask^="url("],*[marker^="url("],*[marker-start^="url("],*[marker-mid^="url("],*[marker-end^="url("]');for(let E of v){h(E.getAttribute("style")||"");for(let F of s)h(E.getAttribute(F))}};for(let p of a)m(p);if(!d)return;let g=t.querySelector("svg.inline-defs-container");g||(g=n.createElementNS("http://www.w3.org/2000/svg","svg"),g.classList.add("inline-defs-container"),g.setAttribute("aria-hidden","true"),g.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),t.insertBefore(g,t.firstChild||null));let w=g.querySelector("defs")||null,M=p=>{if(!p||c.has(p))return null;let C=u(p),y=v=>{let E=r.querySelector(v);return E&&!t.contains(E)?E:null};return y(`svg defs > *#${C}`)||y(`svg > symbol#${C}`)||y(`*#${C}`)};if(!f.size)return;let b=new Set(f),x=new Set;for(;b.size;){let p=b.values().next().value;if(b.delete(p),!p||c.has(p)||x.has(p))continue;let C=M(p);if(!C){x.add(p);continue}w||(w=n.createElementNS("http://www.w3.org/2000/svg","defs"),g.appendChild(w));let y=C.cloneNode(!0);y.id||y.setAttribute("id",p),w.appendChild(y),x.add(p),c.add(p);let v=[y,...y.querySelectorAll("*")];for(let E of v){let F=i(E);if(F&&F.startsWith("#")){let P=F.slice(1).trim();P&&!c.has(P)&&!x.has(P)&&b.add(P)}let $=E.getAttribute?.("style")||"";$&&h($,b);for(let P of s){let W=E.getAttribute?.(P);W&&h(W,b)}}}}function Ne(t,e){if(!t||!e)return;let n=t.scrollTop||0;if(!n)return;getComputedStyle(e).position==="static"&&(e.style.position="relative");let r=t.getBoundingClientRect(),a=t.clientHeight,o="data-snap-ph",s=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;s.nextNode();){let u=s.currentNode,l=getComputedStyle(u),i=l.position;if(i!=="sticky"&&i!=="-webkit-sticky")continue;let c=Ee(l.top),f=Ee(l.bottom);if(c==null&&f==null)continue;let d=En(u,t),h=Nn(e,d,o);if(!h)continue;let m=u.getBoundingClientRect(),g=m.width,w=m.height,M=m.left-r.left;if(!(g>0&&w>0)||!Number.isFinite(M))continue;let b=c!=null?c+n:n+(a-w-f);if(!Number.isFinite(b))continue;let x=Number.parseInt(l.zIndex,10),p=Number.isFinite(x),C=p?Math.max(x,1)+1:2,y=p?x-1:0,v=h.cloneNode(!1);v.setAttribute(o,"1"),v.style.position="sticky",v.style.left=`${M}px`,v.style.top=`${b}px`,v.style.width=`${g}px`,v.style.height=`${w}px`,v.style.visibility="hidden",v.style.zIndex=String(y),v.style.overflow="hidden",v.style.background="transparent",v.style.boxShadow="none",v.style.filter="none",h.parentElement?.insertBefore(v,h),h.style.position="absolute",h.style.left=`${M}px`,h.style.top=`${b}px`,h.style.bottom="auto",h.style.zIndex=String(C),h.style.pointerEvents="none"}}function Ee(t){if(!t||t==="auto")return null;let e=Number.parseFloat(t);return Number.isFinite(e)?e:null}function En(t,e){let n=[];for(let r=t;r&&r!==e;){let a=r.parentElement;if(!a)break;n.push(Array.prototype.indexOf.call(a.children,r)),r=a}return n.reverse()}function Nn(t,e,n){let r=t;for(let a=0;a<e.length;a++)if(r=Fn(r,n)[e[a]],!r)return null;return r instanceof HTMLElement?r:null}function Fn(t,e){let n=[],r=t.children;for(let a=0;a<r.length;a++){let o=r[a];o.hasAttribute(e)||n.push(o)}return n}function Fe(t){let e=getComputedStyle(t),n=e.outlineStyle,r=e.outlineWidth,a=e.borderStyle,o=e.borderWidth,s=n!=="none"&&parseFloat(r)>0,u=a==="none"||parseFloat(o)===0;s&&u&&(t.style.border=`${r} solid transparent`)}async function Te(t,e={}){let n={styleMap:A.session.styleMap,styleCache:A.session.styleCache,nodeMap:A.session.nodeMap},r,a="",o="";Fe(t);try{Ae(t)}catch(l){console.warn("inlineExternal defs or symbol failed:",l)}try{r=await lt(t,n,e,t)}catch(l){throw console.warn("deepClone failed:",l),l}try{await Et(t,r,n,e)}catch(l){console.warn("inlinePseudoElements failed:",l)}await me(r);try{let l=r.querySelectorAll("style[data-sd]");for(let i of l)o+=i.textContent||"",i.remove()}catch{}let s=Ot(n.styleMap);a=Array.from(s.entries()).map(([l,i])=>`.${i}{${l}}`).join(""),a=o+a;for(let[l,i]of n.styleMap.entries()){if(l.tagName==="STYLE")continue;if(l.getRootNode&&l.getRootNode()instanceof ShadowRoot){l.setAttribute("style",i.replace(/;/g,"; "));continue}let c=s.get(i);c&&l.classList.add(c);let f=l.style?.backgroundImage,d=l.dataset?.snapdomHasIcon;f&&f!=="none"&&(l.style.backgroundImage=f),d&&(l.style.verticalAlign="middle",l.style.display="inline")}for(let[l,i]of n.nodeMap.entries()){let c=i.scrollLeft,f=i.scrollTop;if((c||f)&&l instanceof HTMLElement){l.style.overflow="hidden",l.style.scrollbarWidth="none",l.style.msOverflowStyle="none";let h=document.createElement("div");for(h.style.transform=`translate(${-c}px, ${-f}px)`,h.style.willChange="transform",h.style.display="inline-block",h.style.width="100%";l.firstChild;)h.appendChild(l.firstChild);l.appendChild(h)}}let u=r instanceof HTMLElement&&r.firstElementChild instanceof HTMLElement?r.firstElementChild:r;if(Ne(t,u),t===n.nodeMap.get(r)){let l=n.styleCache.get(t)||window.getComputedStyle(t);n.styleCache.set(t,l);let i=Lt(l.transform);r.style.margin="0",r.style.top="auto",r.style.left="auto",r.style.right="auto",r.style.bottom="auto",r.style.animation="none",r.style.transition="none",r.style.willChange="auto",r.style.float="none",r.style.clear="none",r.style.transform=i||""}for(let[l,i]of n.nodeMap.entries())i.tagName==="PRE"&&(l.style.marginTop="0",l.style.marginBlockStart="0");return{clone:r,classCSS:a,styleCache:n.styleCache}}function Tn(t){let e=parseInt(t.dataset?.snapdomWidth||"",10)||0,n=parseInt(t.dataset?.snapdomHeight||"",10)||0,r=parseInt(t.getAttribute("width")||"",10)||0,a=parseInt(t.getAttribute("height")||"",10)||0,o=parseFloat(t.style?.width||"")||0,s=parseFloat(t.style?.height||"")||0,u=e||o||r||t.width||t.naturalWidth||100,l=n||s||a||t.height||t.naturalHeight||100;return{width:u,height:l}}async function Pe(t,e={}){let n=Array.from(t.querySelectorAll("img")),r=async a=>{if(!a.getAttribute("src")){let c=a.currentSrc||a.src||"";c&&a.setAttribute("src",c)}a.removeAttribute("srcset"),a.removeAttribute("sizes");let o=a.src||"";if(!o)return;let s=await U(o,{as:"dataURL",useProxy:e.useProxy});if(s.ok&&typeof s.data=="string"&&s.data.startsWith("data:")){a.src=s.data,a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let{width:u,height:l}=Tn(a),{fallbackURL:i}=e||{};if(i)try{let c=typeof i=="function"?await i({width:u,height:l,src:o,element:a}):i;if(c){let f=await U(c,{as:"dataURL",useProxy:e.useProxy});a.src=f.data,a.width||(a.width=u),a.height||(a.height=l);return}}catch{}if(e.placeholders!==!1){let c=document.createElement("div");c.style.cssText=[`width:${u}px`,`height:${l}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${l}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),c.textContent="img",a.replaceWith(c)}else{let c=document.createElement("div");c.style.cssText=`display:inline-block;width:${u}px;height:${l}px;visibility:hidden;`,a.replaceWith(c)}};for(let a=0;a<n.length;a+=4){let o=n.slice(a,a+4).map(r);await Promise.allSettled(o)}}function $e(t){if(!t)return()=>{};let e=Pn(t);if(e<=0)return()=>{};if(!Ln(t))return()=>{};let n=getComputedStyle(t),r=Math.round($n(n)*e+In(n)),a=t.textContent??"",o=a;if(t.scrollHeight<=r+.5)return()=>{};let s=0,u=a.length,l=-1;for(;s<=u;){let i=s+u>>1;t.textContent=a.slice(0,i)+"\u2026",t.scrollHeight<=r+.5?(l=i,s=i+1):u=i-1}return t.textContent=(l>=0?a.slice(0,l):"")+"\u2026",()=>{t.textContent=o}}function Pn(t){let e=getComputedStyle(t),n=e.getPropertyValue("-webkit-line-clamp")||e.getPropertyValue("line-clamp");n=(n||"").trim();let r=parseInt(n,10);return Number.isFinite(r)&&r>0?r:0}function $n(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 In(t){return(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0)}function Ln(t){return t.childElementCount>0?!1:Array.from(t.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}function Ie(t,e){if(!t||!e||!e.style)return;let n=getComputedStyle(t);try{e.style.boxShadow="none"}catch{}try{e.style.textShadow="none"}catch{}try{e.style.outline="none"}catch{}let a=(n.filter||"").replace(/\bblur\([^()]*\)\s*/gi,"").replace(/\bdrop-shadow\([^()]*\)\s*/gi,"").trim().replace(/\s+/g," ");try{e.style.filter=a.length?a:"none"}catch{}}function Wn(t){let e=document.createTreeWalker(t,NodeFilter.SHOW_COMMENT),n=[];for(;e.nextNode();)n.push(e.currentNode);for(let r of n)r.remove()}function _n(t,e={}){let{stripFrameworkDirectives:n=!0}=e,r=new Set(["xml","xlink"]),a=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;a.nextNode();){let o=a.currentNode;for(let s of Array.from(o.attributes)){let u=s.name;if(u.includes("@")){o.removeAttribute(u);continue}if(u.includes(":")){let l=u.split(":",1)[0];if(!r.has(l)){o.removeAttribute(u);continue}}if(n&&(u.startsWith("x-")||u.startsWith("v-")||u.startsWith(":")||u.startsWith("on:")||u.startsWith("bind:")||u.startsWith("let:")||u.startsWith("class:"))){o.removeAttribute(u);continue}}}}function Le(t,e={}){t&&(_n(t,e),Wn(t))}function Hn(t){try{let e=t.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(e)}catch{return!1}}function Bn(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof HTMLIFrameElement||t instanceof SVGElement||t instanceof HTMLObjectElement||t instanceof HTMLEmbedElement}function Rn(t,e){if(!(t instanceof Element)||Hn(t)||Bn(t))return!1;let n=e.position;if(n==="absolute"||n==="fixed"||n==="sticky")return!1;let r=e.display||"";return!(r.includes("flex")||r.includes("grid")||r.startsWith("table")||e.transform&&e.transform!=="none")}function We(t,e,n=new Map){function r(a,o){if(!(a instanceof Element)||!(o instanceof Element))return;let s=a.childElementCount>o.childElementCount,u=n.get(a)||getComputedStyle(a);if(n.has(a)||n.set(a,u),s&&Rn(a,u)){o.style.height||(o.style.height="auto"),o.style.width||(o.style.width="auto"),o.style.removeProperty("block-size"),o.style.removeProperty("inline-size"),o.style.minHeight||(o.style.minHeight="0"),o.style.minWidth||(o.style.minWidth="0"),o.style.maxHeight||(o.style.maxHeight="none"),o.style.maxWidth||(o.style.maxWidth="none");let c=u.overflowY||u.overflowBlock||"visible",f=u.overflowX||u.overflowInline||"visible";(c!=="visible"||f!=="visible")&&(o.style.overflow="visible")}let l=Array.from(a.children),i=Array.from(o.children);for(let c=0;c<Math.min(l.length,i.length);c++)r(l[c],i[c])}r(t,e)}function Dn(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 On(t,e){if(!(t instanceof Element))return!1;if(t.getAttribute("data-capture")==="exclude"&&e?.excludeMode==="remove")return!0;if(Array.isArray(e?.exclude))for(let n of e.exclude)try{if(t.matches(n))return e.excludeMode==="remove"}catch{}return!1}function _e(t,e){let n=getComputedStyle(t),r=t.getBoundingClientRect(),a=1/0,o=-1/0,s=!1,u=Array.from(t.children);for(let h of u){if(On(h,e)||!Dn(h))continue;let m=h.getBoundingClientRect(),g=m.top-r.top,w=m.bottom-r.top;w<=g||(g<a&&(a=g),w>o&&(o=w),s=!0)}let l=s?Math.max(0,o-a):0,i=parseFloat(n.borderTopWidth)||0,c=parseFloat(n.borderBottomWidth)||0,f=parseFloat(n.paddingTop)||0,d=parseFloat(n.paddingBottom)||0;return i+c+f+d+l}var S=(t,e=3)=>Number.isFinite(t)?Math.round(t*10**e)/10**e:t;function He(t){let e=t.boxShadow||"";if(!e||e==="none")return{top:0,right:0,bottom:0,left:0};let n=e.split(/\),(?=(?:[^()]*\([^()]*\))*[^()]*$)/).map(u=>u.trim()),r=0,a=0,o=0,s=0;for(let u of n){let l=u.match(/-?\d+(\.\d+)?px/g)?.map(g=>parseFloat(g))||[];if(l.length<2)continue;let[i,c,f=0,d=0]=l,h=Math.abs(i)+f+d,m=Math.abs(c)+f+d;a=Math.max(a,h+Math.max(i,0)),s=Math.max(s,h+Math.max(-i,0)),o=Math.max(o,m+Math.max(c,0)),r=Math.max(r,m+Math.max(-c,0))}return{top:Math.ceil(r),right:Math.ceil(a),bottom:Math.ceil(o),left:Math.ceil(s)}}function Be(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 Re(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 De(t){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)||[],r=0,a=0,o=0,s=0,u=!1;for(let l of n){u=!0;let i=l.match(/-?\d+(?:\.\d+)?px/gi)?.map(g=>parseFloat(g))||[],[c=0,f=0,d=0]=i,h=Math.abs(c)+d,m=Math.abs(f)+d;a=Math.max(a,h+Math.max(c,0)),s=Math.max(s,h+Math.max(-c,0)),o=Math.max(o,m+Math.max(f,0)),r=Math.max(r,m+Math.max(-f,0))}return{bleed:{top:S(r),right:S(a),bottom:S(o),left:S(s)},has:u}}function Oe(t,e){if(!t||!e||!e.style)return null;let n=getComputedStyle(t);try{e.style.transformOrigin="0 0"}catch{}try{"translate"in e.style&&(e.style.translate="none"),"rotate"in e.style&&(e.style.rotate="none")}catch{}let r=n.transform||"none";if(!r||r==="none")try{let o=Ye(t);if(o.a===1&&o.b===0&&o.c===0&&o.d===1)return e.style.transform="none",{a:1,b:0,c:0,d:1}}catch{}let a=r.match(/^matrix\(\s*([^)]+)\)$/i);if(a){let o=a[1].split(",").map(s=>parseFloat(s.trim()));if(o.length===6&&o.every(Number.isFinite)){let[s,u,l,i]=o,c=Math.sqrt(s*s+u*u)||0,f=0,d=0,h=0,m=0,g=0,w=0;c>0&&(f=s/c,d=u/c,h=f*l+d*i,m=l-f*h,g=i-d*h,w=Math.sqrt(m*m+g*g)||0,w>0?h=h/w:h=0);let M=c,b=0,x=h*w,p=w;try{e.style.transform=`matrix(${M}, ${b}, ${x}, ${p}, 0, 0)`}catch{}return{a:M,b,c:x,d:p}}}try{let o=String(r).trim();return e.style.transform=o+" translate(0px, 0px) rotate(0deg)",null}catch{return null}}function Ft(t,e,n,r,a){let o=n.a,s=n.b,u=n.c,l=n.d,i=n.e||0,c=n.f||0;function f(M,b){let x=M-r,p=b-a,C=o*x+u*p,y=s*x+l*p;return C+=r+i,y+=a+c,[C,y]}let d=[f(0,0),f(t,0),f(0,e),f(t,e)],h=1/0,m=1/0,g=-1/0,w=-1/0;for(let[M,b]of d)M<h&&(h=M),b<m&&(m=b),M>g&&(g=M),b>w&&(w=b);return{minX:h,minY:m,maxX:g,maxY:w,width:g-h,height:w-m}}function ze(t,e,n){let r=(t.transformOrigin||"0 0").trim().split(/\s+/),[a,o]=[r[0]||"0",r[1]||"0"],s=(u,l)=>{let i=u.toLowerCase();return i==="left"||i==="top"?0:i==="center"?l/2:i==="right"||i==="bottom"?l:i.endsWith("px")?parseFloat(i)||0:i.endsWith("%")?(parseFloat(i)||0)*l/100:/^-?\d+(\.\d+)?$/.test(i)&&parseFloat(i)||0};return{ox:s(a,e),oy:s(o,n)}}function Xe(t){let e={rotate:"0deg",scale:null,translate:null},n=typeof t.computedStyleMap=="function"?t.computedStyleMap():null;if(n){let a=l=>{try{return typeof n.has=="function"&&!n.has(l)||typeof n.get!="function"?null:n.get(l)}catch{return null}},o=a("rotate");if(o)if(o.angle){let l=o.angle;e.rotate=l.unit==="rad"?l.value*180/Math.PI+"deg":l.value+l.unit}else o.unit?e.rotate=o.unit==="rad"?o.value*180/Math.PI+"deg":o.value+o.unit:e.rotate=String(o);else{let l=getComputedStyle(t);e.rotate=l.rotate&&l.rotate!=="none"?l.rotate:"0deg"}let s=a("scale");if(s){let l="x"in s&&s.x?.value!=null?s.x.value:Array.isArray(s)?s[0]?.value:Number(s)||1,i="y"in s&&s.y?.value!=null?s.y.value:Array.isArray(s)?s[1]?.value:l;e.scale=`${l} ${i}`}else{let l=getComputedStyle(t);e.scale=l.scale&&l.scale!=="none"?l.scale:null}let u=a("translate");if(u){let l="x"in u&&"value"in u.x?u.x.value:Array.isArray(u)?u[0]?.value:0,i="y"in u&&"value"in u.y?u.y.value:Array.isArray(u)?u[1]?.value:0,c="x"in u&&u.x?.unit?u.x.unit:"px",f="y"in u&&u.y?.unit?u.y.unit:"px";e.translate=`${l}${c} ${i}${f}`}else{let l=getComputedStyle(t);e.translate=l.translate&&l.translate!=="none"?l.translate:null}return e}let r=getComputedStyle(t);return e.rotate=r.rotate&&r.rotate!=="none"?r.rotate:"0deg",e.scale=r.scale&&r.scale!=="none"?r.scale:null,e.translate=r.translate&&r.translate!=="none"?r.translate:null,e}var Nt=null;function zn(){if(Nt)return Nt;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),Nt=t,t}function qe(t){let e=zn(),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 r=Ye(n);return e.removeChild(n),r}function Ve(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 a=e.rotate&&e.rotate!=="none"&&e.rotate!=="0deg",o=e.scale&&e.scale!=="none"&&e.scale!=="1",s=e.translate&&e.translate!=="none"&&e.translate!=="0px 0px";return!!(a||o||s)}function Ye(t){let e=getComputedStyle(t).transform;if(!e||e==="none")return new DOMMatrix;try{return new DOMMatrix(e)}catch{return new WebKitCSSMatrix(e)}}async function Vr(t,e){if(!t)throw new Error("Element cannot be null or undefined");$t(e.cache);let n=e.fast,r=e.outerTransforms!==!1,a=!!e.outerShadows,o={element:t,options:e,plugins:e.plugins},s,u,l,i="",c="",f,d,h=null;await Q("beforeSnap",o),await Q("beforeClone",o);let m=$e(o.element);try{({clone:s,classCSS:u,styleCache:l}=await Te(o.element,o.options)),!r&&s&&(h=Oe(o.element,s)),!a&&s&&Ie(o.element,s)}finally{m()}if(o={clone:s,classCSS:u,styleCache:l,...o},await Q("afterClone",o),Le(o.clone),o.options?.excludeMode==="remove")try{We(o.element,o.clone,o.styleCache)}catch(b){console.warn("[snapdom] shrink pass failed:",b)}try{await Vt(o.clone,o.element)}catch{}await new Promise(b=>{O(async()=>{await Pe(o.clone,o.options),b()},{fast:n})}),await new Promise(b=>{O(async()=>{await Zt(o.element,o.clone,o.styleCache,o.options),b()},{fast:n})}),e.embedFonts&&await new Promise(b=>{O(async()=>{let x=jt(o.element),p=Kt(o.element);if(st()){let C=new Set(Array.from(x).map(y=>String(y).split("__")[0]).filter(Boolean));await Gt(C,1)}i=await Ut({required:x,usedCodepoints:p,preCached:!1,exclude:o.options.excludeFonts,useProxy:o.options.useProxy}),b()},{fast:n})});let g=Rt(o.clone).sort(),w=g.join(",");A.baseStyle.has(w)?c=A.baseStyle.get(w):await new Promise(b=>{O(()=>{c=Dt(g),A.baseStyle.set(w,c),b()},{fast:n})}),o={fontsCSS:i,baseCSS:c,...o},await Q("beforeRender",o),await new Promise(b=>{O(()=>{let x=getComputedStyle(o.element),p=o.element.getBoundingClientRect(),C=Math.max(1,S(o.element.offsetWidth||parseFloat(x.width)||p.width||1)),y=Math.max(1,S(o.element.offsetHeight||parseFloat(x.height)||p.height||1));if(o.options?.excludeMode==="remove"){let _=_e(o.element,o.options);Number.isFinite(_)&&_>0&&(y=Math.max(1,Math.min(y,S(_+1))))}let v=(_,H=NaN)=>{let J=typeof _=="string"?parseFloat(_):_;return Number.isFinite(J)?J:H},E=v(o.options.width),F=v(o.options.height),$=C,P=y,W=Number.isFinite(E),B=Number.isFinite(F),nt=y>0?C/y:1;W&&B?($=Math.max(1,S(E)),P=Math.max(1,S(F))):W?($=Math.max(1,S(E)),P=Math.max(1,S($/(nt||1)))):B?(P=Math.max(1,S(F)),$=Math.max(1,S(P*(nt||1)))):($=C,P=y);let X=0,k=0,q=C,V=y;if(!r&&h&&Number.isFinite(h.a)){let _={a:h.a,b:h.b||0,c:h.c||0,d:h.d||1,e:0,f:0},H=Ft(C,y,_,0,0);X=S(H.minX),k=S(H.minY),q=S(H.maxX),V=S(H.maxY)}else if(r&&Xn(o.element)){let H=x.transform&&x.transform!=="none"?x.transform:"",J=Xe(o.element),wt=qe({baseTransform:H,rotate:J.rotate||"0deg",scale:J.scale,translate:J.translate}),{ox:Je,oy:Qe}=ze(x,C,y),tn=wt.is2D?wt:new DOMMatrix(wt.toString()),dt=Ft(C,y,tn,Je,Qe);X=S(dt.minX),k=S(dt.minY),q=S(dt.maxX),V=S(dt.maxY)}let rt=He(x),j=Be(x),N=Re(x),T=De(x),I=a?{top:S(rt.top+j.top+N.top+T.bleed.top),right:S(rt.right+j.right+N.right+T.bleed.right),bottom:S(rt.bottom+j.bottom+N.bottom+T.bleed.bottom),left:S(rt.left+j.left+N.left+T.bleed.left)}:{top:0,right:0,bottom:0,left:0};X=S(X-I.left),k=S(k-I.top),q=S(q+I.right),V=S(V+I.bottom);let L=Math.max(1,S(q-X)),Y=Math.max(1,S(V-k)),K=W||B?S($/C):1,pt=B||W?S(P/y):1,G=Math.max(1,S(L*K)),gt=Math.max(1,S(Y*pt)),ut="http://www.w3.org/2000/svg",ft=st()?1:0,R=S(ft+(r?0:1)),D=document.createElementNS(ut,"foreignObject"),Ue=S(X),je=S(k);D.setAttribute("x",String(S(-(Ue-R)))),D.setAttribute("y",String(S(-(je-R)))),D.setAttribute("width",String(S(C+R*2))),D.setAttribute("height",String(S(y+R*2))),D.style.overflow="visible";let Tt=document.createElement("style");Tt.textContent=o.baseCSS+o.fontsCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+o.classCSS,D.appendChild(Tt);let Z=document.createElement("div");Z.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Z.style.width=`${S(C)}px`,Z.style.height=`${S(y)}px`,Z.style.overflow="visible",Z.appendChild(o.clone),D.appendChild(Z);let Ke=new XMLSerializer().serializeToString(D),bt=S(L+R*2),xt=S(Y+R*2),Pt=W||B;e.meta={w0:C,h0:y,vbW:bt,vbH:xt,targetW:$,targetH:P};let Ge=st()&&Pt?bt:S(G+R*2),Ze=st()&&Pt?xt:S(gt+R*2);d=`<svg xmlns="${ut}" width="${Ge}" height="${Ze}" viewBox="0 0 ${bt} ${xt}">`+Ke+"</svg>",f=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(d)}`,o={svgString:d,dataURL:f,...o},b()},{fast:n})}),await Q("afterRender",o);let M=document.getElementById("snapdom-sandbox");return M&&M.style.position==="absolute"&&M.remove(),o.dataURL}function Xn(t){return Ve(t)}export{Vr as a};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* SnapDOM
|
|
3
|
+
* v2.0.1
|
|
4
|
+
* Author: Juan Martin Muda
|
|
5
|
+
* License: MIT
|
|
6
|
+
*/
|
|
7
|
+
import{a as r}from"./chunk-3VYIPD3A.js";async function d(i,a){let e=await r(i,a),t=new Image;return t.src=e.toDataURL(`image/${a.format}`,a.quality),await t.decode(),t.style.width=`${e.width/a.dpr}px`,t.style.height=`${e.height/a.dpr}px`,t}export{d as a};
|