emf-converter 4.29.1 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/README.md +7 -1
  2. package/dist/browser-chunks/chunk-32ASPP2J.js +1 -0
  3. package/dist/browser-chunks/chunk-5OO5QZBQ.js +1 -0
  4. package/dist/browser-chunks/chunk-6M4YGIQZ.mjs +1 -0
  5. package/dist/browser-chunks/chunk-7JVB7NLG.js +2 -0
  6. package/dist/browser-chunks/chunk-AKFBI6HO.mjs +1 -0
  7. package/dist/browser-chunks/chunk-BZ5EU3GQ.mjs +1 -0
  8. package/dist/browser-chunks/chunk-C3KBKW2L.js +1 -0
  9. package/dist/browser-chunks/chunk-DO2CGP4P.js +1 -0
  10. package/dist/browser-chunks/chunk-DOQZZ5LA.mjs +1 -0
  11. package/dist/browser-chunks/chunk-GB3YMP7Z.mjs +1 -0
  12. package/dist/browser-chunks/chunk-H4QX7Q4T.mjs +2 -0
  13. package/dist/browser-chunks/chunk-J6UKX2SY.js +1 -0
  14. package/dist/browser-chunks/chunk-LKJUWXHV.js +1 -0
  15. package/dist/browser-chunks/chunk-OB5ODU4B.js +1 -0
  16. package/dist/browser-chunks/chunk-PO4H7QFT.mjs +1 -0
  17. package/dist/browser-chunks/chunk-QX63UNWK.js +1 -0
  18. package/dist/browser-chunks/chunk-VQRM3TC4.mjs +1 -0
  19. package/dist/browser-chunks/chunk-VSFHXEGM.mjs +1 -0
  20. package/dist/browser-chunks/emf-ansi-johab-BGUOAP6H.mjs +1 -0
  21. package/dist/browser-chunks/emf-ansi-johab-KHT3RJ3R.js +1 -0
  22. package/dist/browser-chunks/emf-gdi-chroma-tie-data-QPKNQFSO.mjs +1 -0
  23. package/dist/browser-chunks/emf-gdi-chroma-tie-data-YFCUXKFP.js +1 -0
  24. package/dist/browser-chunks/emf-gdi-illuminant-data-FESCLWQ7.mjs +2 -0
  25. package/dist/browser-chunks/emf-gdi-illuminant-data-YYCDAVZT.js +2 -0
  26. package/dist/browser-chunks/emf-plus-image-curves-OLOBXBF7.js +2 -0
  27. package/dist/browser-chunks/emf-plus-image-curves-U46ENPYQ.mjs +2 -0
  28. package/dist/browser-chunks/gdi-font-engine-JSQROG7F.mjs +1 -0
  29. package/dist/browser-chunks/gdi-font-engine-VF73ZSE3.js +1 -0
  30. package/dist/browser-chunks/gif-decoder-HCVZWAHL.mjs +1 -0
  31. package/dist/browser-chunks/gif-decoder-ZZ27IQG6.js +1 -0
  32. package/dist/browser-chunks/jpeg-cmyk-POM57I3O.mjs +2 -0
  33. package/dist/browser-chunks/jpeg-cmyk-QL44AOOZ.js +2 -0
  34. package/dist/browser-chunks/jpeg-decoder-CMP7ASL4.mjs +1 -0
  35. package/dist/browser-chunks/jpeg-decoder-GGVNSSPW.js +1 -0
  36. package/dist/browser-chunks/jpeg-decoder-legacy-4LSDXMCV.mjs +1 -0
  37. package/dist/browser-chunks/jpeg-decoder-legacy-V73WBA5Z.js +1 -0
  38. package/dist/browser-chunks/jpeg-encoder-5DE4U2SQ.js +1 -0
  39. package/dist/browser-chunks/jpeg-encoder-5DFCLIMU.mjs +1 -0
  40. package/dist/browser-chunks/png-encoder-BUYFBWDO.js +1 -0
  41. package/dist/browser-chunks/png-encoder-J4262WS7.mjs +1 -0
  42. package/dist/browser-chunks/svg-context-CVI7XPTM.js +2 -0
  43. package/dist/browser-chunks/svg-context-KC7L6NV3.mjs +2 -0
  44. package/dist/browser-chunks/tiff-decoder-6LKFU47D.mjs +1 -0
  45. package/dist/browser-chunks/tiff-decoder-Q6MTIHDV.js +1 -0
  46. package/dist/browser-chunks/tiff-jpeg-MBC3UGMN.js +1 -0
  47. package/dist/browser-chunks/tiff-jpeg-TOIEUWZF.mjs +1 -0
  48. package/dist/browser-chunks/webp-decoder-FY74YL2U.js +1 -0
  49. package/dist/browser-chunks/webp-decoder-WYHITGE2.mjs +1 -0
  50. package/dist/browser-chunks/webp-encoder-4JPXFFZZ.js +1 -0
  51. package/dist/browser-chunks/webp-encoder-JQ4I7ABR.mjs +1 -0
  52. package/dist/browser.js +37 -61363
  53. package/dist/browser.mjs +37 -61345
  54. package/dist/index.js +37 -61446
  55. package/dist/index.mjs +37 -61428
  56. package/dist/lite.js +5 -5
  57. package/dist/lite.mjs +5 -5
  58. package/dist/node-chunks/chunk-2WUBHBGZ.js +1 -0
  59. package/dist/node-chunks/chunk-3AWDT4IN.mjs +2 -0
  60. package/dist/node-chunks/chunk-6TAYDPWF.mjs +1 -0
  61. package/dist/node-chunks/chunk-75GGL2QB.mjs +1 -0
  62. package/dist/node-chunks/chunk-AAYRADLK.js +1 -0
  63. package/dist/node-chunks/chunk-CWULLVCX.js +2 -0
  64. package/dist/node-chunks/chunk-DKUII3EV.js +1 -0
  65. package/dist/node-chunks/chunk-EA6JK7TD.mjs +1 -0
  66. package/dist/node-chunks/chunk-EBIZSO4S.js +1 -0
  67. package/dist/node-chunks/chunk-GD73XQBZ.js +1 -0
  68. package/dist/node-chunks/chunk-GNJ2QHWI.mjs +1 -0
  69. package/dist/node-chunks/chunk-L2UW73US.mjs +1 -0
  70. package/dist/node-chunks/chunk-RCUX23RT.js +1 -0
  71. package/dist/node-chunks/chunk-SXBOBAYR.js +1 -0
  72. package/dist/node-chunks/chunk-T4UGEB7S.mjs +1 -0
  73. package/dist/node-chunks/chunk-T6E6K636.mjs +1 -0
  74. package/dist/node-chunks/chunk-YXNQU7W4.mjs +1 -0
  75. package/dist/node-chunks/chunk-ZF3VWEU6.js +1 -0
  76. package/dist/node-chunks/gdi-font-engine-WCHWF444.js +1 -0
  77. package/dist/node-chunks/gdi-font-engine-YGRNO7OF.mjs +1 -0
  78. package/dist/node-chunks/gif-decoder-I2CNJCRR.mjs +1 -0
  79. package/dist/node-chunks/gif-decoder-UOU3U2ZO.js +1 -0
  80. package/dist/node-chunks/jpeg-cmyk-AXLREJRN.js +2 -0
  81. package/dist/node-chunks/jpeg-cmyk-WFBY5BFQ.mjs +2 -0
  82. package/dist/node-chunks/jpeg-decoder-TQ6AAYSY.mjs +1 -0
  83. package/dist/node-chunks/jpeg-decoder-VQUHLPAJ.js +1 -0
  84. package/dist/node-chunks/jpeg-decoder-legacy-5AQKLBQX.mjs +1 -0
  85. package/dist/node-chunks/jpeg-decoder-legacy-KIJBM2X4.js +1 -0
  86. package/dist/node-chunks/jpeg-encoder-EYPZTDIT.js +1 -0
  87. package/dist/node-chunks/jpeg-encoder-JZWC5RLN.mjs +1 -0
  88. package/dist/node-chunks/png-encoder-Q6PONWA7.mjs +1 -0
  89. package/dist/node-chunks/png-encoder-R2HLCKBA.js +1 -0
  90. package/dist/node-chunks/svg-context-WDRM2YC3.mjs +2 -0
  91. package/dist/node-chunks/svg-context-X65E7QBQ.js +2 -0
  92. package/dist/node-chunks/tiff-decoder-PUQ7YZGC.js +1 -0
  93. package/dist/node-chunks/tiff-decoder-VCS2FIXG.mjs +1 -0
  94. package/dist/node-chunks/tiff-jpeg-7CMHUYH4.js +1 -0
  95. package/dist/node-chunks/tiff-jpeg-XTNEMUKO.mjs +1 -0
  96. package/dist/node-chunks/webp-decoder-DBVS75GU.mjs +1 -0
  97. package/dist/node-chunks/webp-decoder-MDSDJDEH.js +1 -0
  98. package/dist/node-chunks/webp-encoder-DSA7O3HC.mjs +1 -0
  99. package/dist/node-chunks/webp-encoder-SGJY4K6D.js +1 -0
  100. package/package.json +1 -1
package/README.md CHANGED
@@ -237,6 +237,12 @@ const quick = await convertMetafileToDataUrl(buffer, { timeoutMs: 5000 });
237
237
 
238
238
  When the signal aborts, the promise rejects with `signal.reason` (an `AbortError` when there is none). A `null` result still means the buffer is not a valid metafile. Conversion checks the signal at every record, so it stops within about one record's work. One very large record, such as a single giant blit, can overrun the limit. With a `signal`, conversion yields to the event loop about every 16 ms.
239
239
 
240
+ ### Browser bundle size
241
+
242
+ The full browser build loads embedded image decoders, the exact text engine, and Windows color data when a conversion needs them. A production Vite app that imports only `convertMetafileToDataUrl` loads about 179 kB gzip through its first ordinary PNG conversion. Files that need additional decoders or color tables load extra chunks.
243
+
244
+ If you serve the package files directly, deploy `dist/browser-chunks/` beside the browser entry file and preserve their relative paths. For a Node deployment that copies the compiled files, keep `dist/node-chunks/` beside the Node entry files. Package managers and bundlers resolve these files when you import `emf-converter` normally.
245
+
240
246
  ### Lite browser build
241
247
 
242
248
  For a browser app that only needs a PNG preview and cares about bundle size, import from `emf-converter/lite`:
@@ -247,7 +253,7 @@ import { convertMetafileToDataUrl } from 'emf-converter/lite';
247
253
  const png = await convertMetafileToDataUrl(buffer, { fontFamilyMap: { 'MS Mincho': 'Noto Serif JP' } });
248
254
  ```
249
255
 
250
- It is about 425 KB minified (157 KB gzipped), against about 2.4 MB unminified (850 KB gzipped) for the full browser build. It exports `convertMetafileToDataUrl`, `convertMetafileToImageData`, `getMetafileInfo` and `DEFAULT_DPI_SCALE`, takes the same options except `fonts` and `fontSmoothing`, and replays every record the full build does. It leaves out:
256
+ A production Vite app that imports only the lite PNG converter loads about 157 kB gzip. The lite build exports `convertMetafileToDataUrl`, `convertMetafileToImageData`, `getMetafileInfo` and `DEFAULT_DPI_SCALE`, takes the same options except `fonts` and `fontSmoothing`, and replays every record the full build does. It leaves out:
251
257
 
252
258
  - JPEG, WebP, SVG and PDF output.
253
259
  - The TrueType engine, so text is always drawn with the canvas's `fillText`. Use `fontFamilyMap` to choose installed or web fonts.
@@ -0,0 +1 @@
1
+ 'use strict';function t(d){if(d.length<4||d[0]!==255||d[1]!==216)return null;for(let r=2;r+4<=d.length;){if(d[r]!==255){r++;continue}let n=d[r+1];if(n===255){r++;continue}if(n===216||n===1||n>=208&&n<=215||n===0){r+=2;continue}if(n===217||n===218)break;let x=d[r+2]*256+d[r+3];if(n>=192&&n<=207&&n!==196&&n!==200&&n!==204){if(r+10>d.length)return "standard";if(d[r+4]!==8)return "unsupported";let f=d[r+9];return n===201||n===202||f===4?"bundled":"standard"}r+=2+x;}return "standard"}exports.a=t;
@@ -0,0 +1 @@
1
+ 'use strict';var X=[0,1,2,2,5,5,8,0,3,4,5,5,8,8,3,3,6,7,8,8,23,16,6,6,7,8,23,23,16,20,20,21,22,23,23,20,20,20,21,22,23,45,41,41,41,42,43,44,45,9,10,11,11,15,15,19,12,13,14,15,15,19,19,12,16,17,18,19,19,23,16,16,20,21,22,23,23,36,20,20,21,22,23,45,36,41,41,42,43,44,45,41,41,41,42,43,44,45,24,25,26,26,30,30,35,27,28,29,30,30,35,35,31,32,33,34,35,35,40,31,36,37,38,39,40,40,36,36,41,42,43,44,45,36,41,41,42,43,44,45,41,41,65,65,66,67,68,24,25,26,49,49,49,54,46,47,48,49,49,54,54,50,51,52,53,54,54,59,50,55,56,57,58,59,59,55,55,60,61,62,63,64,55,60,60,65,66,67,68,60,60,65,65,66,67,68,46,47,48,49,49,73,73,46,47,48,49,73,73,73,69,70,71,72,73,73,78,69,74,75,76,77,78,78,74,74,79,80,81,82,83,74,79,79,84,85,86,87,79,79,84,84,88,89,90,46,47,48,49,73,73,73,69,70,71,72,73,73,73,69,70,71,72,73,73,78,91,91,92,93,94,78,78,91,91,95,96,97,98,83,91,95,95,99,100,101,102,95,95,99,99,103,104,105,69,70,71,72,73,73,73,69,70,71,72,73,73,73,91,91,92,93,94,94,78,91,91,92,93,94,94,98,91,106,106,107,108,98,98,106,106,106,109,110,111,102,106,106,109,109,112,113,114],B=new Map;for(let t=0;t<243;t++){let n=Math.floor(t/81)%3,e=Math.floor(t/27)%3,u=Math.floor(t/9)%3,r=Math.floor(t/3)%3,a=t%3,s=[n+e+u,e+u+r,u+r+a];B.set(X[(s[0]*7+s[1])*7+s[2]],s);}function ft(t,n,e){return B.get(X[(t*7+n)*7+e])}var at=0,ct=1,lt=2,gt=3,it=4,mt=5,bt=6;function z(t,n){return String.fromCharCode(t.getUint8(n),t.getUint8(n+1),t.getUint8(n+2),t.getUint8(n+3))}function q(t,n){if(n+12>t.byteLength)return null;let e=t.getUint32(n);if(e!==65536&&e!==1953658213)return null;let u=t.getUint16(n+4),r=new Map;for(let a=0;a<u;a++){let s=n+12+a*16;if(s+16>t.byteLength)return null;let f=t.getUint32(s+8),c=t.getUint32(s+12);f+c<=t.byteLength&&r.set(z(t,s),{offset:f,length:c});}return r}function J(t,n,e){let u="";for(let r=0;r+1<e;r+=2)u+=String.fromCharCode(t.getUint16(n+r));return u}function K(t,n,e){let u="";for(let r=0;r<e;r++)u+=String.fromCharCode(t.getUint8(n+r));return u}function Z(t,n){let e=new Map;if(!n)return e;let u=t.getUint16(n.offset+2),r=n.offset+t.getUint16(n.offset+4),a=new Map;for(let s=0;s<u;s++){let f=n.offset+6+s*12,c=t.getUint16(f),p=t.getUint16(f+2),o=t.getUint16(f+4),h=t.getUint16(f+6),g=t.getUint16(f+8),y=t.getUint16(f+10);if(h!==1&&h!==2&&h!==4&&h!==16)continue;let U=null,b=0;c===3&&(p===1||p===0||p===10)?(U=J(t,r+y,g),b=o===1033?3:2):c===1&&p===0&&(U=K(t,r+y,g),b=1),U!==null&&b>(a.get(h)??0)&&(e.set(h,U),a.set(h,b));}return e}function $(t,n){let e=t.getUint16(n+6),u=n+14,r=u+e+2,a=r+e,s=a+e;return f=>{if(f>65535)return 0;let c=0,p=e/2-1;for(;c<=p;){let o=c+p>>1;if(t.getUint16(u+o*2)<f){c=o+1;continue}let g=t.getUint16(r+o*2);if(g>f){p=o-1;continue}let y=t.getInt16(a+o*2),U=t.getUint16(s+o*2);if(U===0)return f+y&65535;let b=s+o*2+U+(f-g)*2;if(b+2>t.byteLength)return 0;let A=t.getUint16(b);return A===0?0:A+y&65535}return 0}}function w(t,n){let e=t.getUint32(n+12);return u=>{let r=0,a=e-1;for(;r<=a;){let s=r+a>>1,f=n+16+s*12,c=t.getUint32(f),p=t.getUint32(f+4);if(u<c)a=s-1;else if(u>p)r=s+1;else return t.getUint32(f+8)+(u-c)}return 0}}function v(t,n){let e=t.getUint16(n+6),u=t.getUint16(n+8);return r=>r>=e&&r<e+u?t.getUint16(n+10+(r-e)*2):0}function tt(t,n){return e=>e<256?t.getUint8(n+6+e):0}function nt(t,n){let e={lookup:()=>0,symbol:false};if(!n)return e;let u=t.getUint16(n.offset+2),r=null;for(let f=0;f<u;f++){let c=n.offset+4+f*8,p=t.getUint16(c),o=t.getUint16(c+2),h=n.offset+t.getUint32(c+4);if(h+4>t.byteLength)continue;let g=0,y=false;p===3&&o===10?g=5:p===3&&o===1?g=4:p===3&&o===0?(g=3,y=true):p===0?g=2:p===1&&o===0&&(g=1),g>0&&(!r||g>r.rank)&&(r={off:h,rank:g,symbol:y});}if(!r)return e;let a=t.getUint16(r.off),s;switch(a){case 4:s=$(t,r.off);break;case 12:s=w(t,r.off);break;case 6:s=v(t,r.off);break;case 0:s=tt(t,r.off);break;default:return e}if(r.symbol){let f=s;s=c=>f(c)||(c<256?f(61440+c):0);}return {lookup:s,symbol:r.symbol}}function et(t,n,e){let u=new Map;if(!n||n.length<8)return u;let r=t.getInt16(n.offset+2),a=t.getInt32(n.offset+4);for(let s=0;s<r;s++){let f=n.offset+8+s*a;if(f+2+e>n.offset+n.length)break;u.set(t.getUint8(f),new Uint8Array(t.buffer,t.byteOffset+f+2,e));}return u}function rt(t,n){if(!n||n.length<6)return null;let e=t.getUint16(n.offset+4),u=-1;for(let f=0;f<e;f++){let c=n.offset+6+f*4,p=t.getUint8(c),o=t.getUint8(c+1),h=t.getUint8(c+2),g=t.getUint8(c+3);if(p===1&&(o===0&&h===0&&g===0||o===1&&h<=1&&g>=1)){u=f;break}}if(u<0)return null;let r=n.offset+t.getUint16(n.offset+6+e*4+u*2);if(r+4>t.byteLength)return null;let a=t.getUint16(r),s=[];for(let f=0;f<a;f++){let c=r+4+f*6;s.push({ppem:t.getUint16(c),yMax:t.getInt16(c+2),yMin:t.getInt16(c+4)});}return s}function ot(t,n,e,u){if(u<=e)return null;let r=n.offset+e,a=t.getInt16(r),s=t.getInt16(r+2),f=t.getInt16(r+4),c=t.getInt16(r+6),p=t.getInt16(r+8),o=r+10;if(a>=0){let U=[];for(let i=0;i<a;i++)U.push(t.getUint16(o)),o+=2;let b=a>0?U[a-1]+1:0,A=t.getUint16(o);o+=2;let E=new Uint8Array(t.buffer,t.byteOffset+o,A);o+=A;let l=new Uint8Array(b);for(let i=0;i<b;){let x=t.getUint8(o++);if(l[i++]=x,x&8){let _=t.getUint8(o++);for(;_-- >0&&i<b;)l[i++]=x;}}let I=new Array(b),T=new Array(b),L=0;for(let i=0;i<b;i++){let x=l[i];if(x&2){let _=t.getUint8(o++);L+=x&16?_:-_;}else x&16||(L+=t.getInt16(o),o+=2);I[i]=L;}L=0;for(let i=0;i<b;i++){let x=l[i];if(x&4){let _=t.getUint8(o++);L+=x&32?_:-_;}else x&32||(L+=t.getInt16(o),o+=2);T[i]=L;}let R=new Array(b);for(let i=0;i<b;i++)R[i]=(l[i]&1)!==0;return {xs:I,ys:T,onCurve:R,endPts:U,instructions:E,components:null,xMin:s,yMin:f,xMax:c,yMax:p}}let h=[],g=0;do{g=t.getUint16(o);let U=t.getUint16(o+2);o+=4;let b,A;g&1?(b=g&2?t.getInt16(o):t.getUint16(o),A=g&2?t.getInt16(o+2):t.getUint16(o+2),o+=4):(b=g&2?t.getInt8(o):t.getUint8(o),A=g&2?t.getInt8(o+1):t.getUint8(o+1),o+=2);let E=1,l=0,I=0,T=1;g&8?(E=T=t.getInt16(o)/16384,o+=2):g&64?(E=t.getInt16(o)/16384,T=t.getInt16(o+2)/16384,o+=4):g&128&&(E=t.getInt16(o)/16384,l=t.getInt16(o+2)/16384,I=t.getInt16(o+4)/16384,T=t.getInt16(o+6)/16384,o+=8),h.push({glyphIndex:U,flags:g,arg1:b,arg2:A,a:E,b:l,c:I,d:T});}while(g&32);let y=new Uint8Array(0);if(g&256){let U=t.getUint16(o);y=new Uint8Array(t.buffer,t.byteOffset+o+2,U);}return {xs:[],ys:[],onCurve:[],endPts:[],instructions:y,components:h,xMin:s,yMin:f,xMax:c,yMax:p}}function Q(t,n=0){let e=q(t,n);if(!e)return null;let u=e.get("head"),r=e.get("hhea"),a=e.get("maxp"),s=e.get("hmtx"),f=e.get("loca"),c=e.get("glyf");if(!u||!r||!a||!s||!f||!c)return null;let p=t.getUint16(u.offset+18),o=t.getUint16(u.offset+16),h=t.getUint16(u.offset+44),g=t.getInt16(u.offset+50)===1,y=t.getUint16(a.offset+4),U=a.length>=32,b=t.getUint16(r.offset+34),A=Z(t,e.get("name")),E=nt(t,e.get("cmap")),l=e.get("OS/2"),I=e.get("post"),T=e.get("cvt "),L=e.get("fpgm"),R=e.get("prep"),i=e.get("gasp"),x=e.get("LTSH"),_=new Int16Array(T?T.length>>1:0);for(let m=0;m<_.length;m++)_[m]=t.getInt16(T.offset+m*2);let D=m=>m?new Uint8Array(t.buffer,t.byteOffset+m.offset,m.length):new Uint8Array(0),P=[];if(i&&i.length>=4){let m=t.getUint16(i.offset+2);for(let d=0;d<m&&4+d*4+4<=i.length;d++)P.push({maxPpem:t.getUint16(i.offset+4+d*4),behavior:t.getUint16(i.offset+6+d*4)});}let Y=m=>g?t.getUint32(f.offset+m*4):t.getUint16(f.offset+m*2)*2,N=new Map,M=e.get("kern"),V=null;return {kerning:(m,d)=>{if(!M)return 0;if(!V){V=new Map;let C=M.offset+M.length;if(M.offset+4<=C&&t.getUint16(M.offset)===0){let O=t.getUint16(M.offset+2),S=M.offset+4;for(let G=0;G<O&&S+6<=C;G++){let W=t.getUint16(S+2),H=t.getUint16(S+4);if(H>>8===0&&(H&7)===1&&S+14<=C){let j=t.getUint16(S+6);for(let k=0;k<j&&S+14+k*6+6<=C;k++){let F=S+14+k*6;V.set(t.getUint16(F)*65536+t.getUint16(F+2),t.getInt16(F+4));}}if(W<6)break;S+=W;}}}return V.get(m*65536+d)??0},family:A.get(1)??"",subfamily:A.get(2)??"",fullName:A.get(4)??"",typoFamily:A.get(16)??null,unitsPerEm:p,headFlags:o,macStyle:h,headYMax:t.getInt16(u.offset+42),headYMin:t.getInt16(u.offset+38),numGlyphs:y,hheaAscender:t.getInt16(r.offset+4),hheaDescender:t.getInt16(r.offset+6),hheaLineGap:t.getInt16(r.offset+8),weightClass:l?t.getUint16(l.offset+4):h&1?700:400,widthClass:l?t.getUint16(l.offset+6):5,fsSelection:l?t.getUint16(l.offset+62):0,winAscent:l?t.getUint16(l.offset+74):t.getInt16(r.offset+4),winDescent:l?t.getUint16(l.offset+76):-t.getInt16(r.offset+6),typoAscender:l?t.getInt16(l.offset+68):0,typoDescender:l?t.getInt16(l.offset+70):0,typoLineGap:l?t.getInt16(l.offset+72):0,xAvgCharWidth:l?t.getInt16(l.offset+2):0,strikeoutSize:l?t.getInt16(l.offset+26):0,strikeoutPosition:l?t.getInt16(l.offset+28):0,panose:l?new Uint8Array(t.buffer,t.byteOffset+l.offset+32,10):null,underlinePosition:I?t.getInt16(I.offset+8):0,underlineThickness:I?t.getInt16(I.offset+10):0,isFixedPitch:I?t.getUint32(I.offset+12)!==0:false,isSymbol:E.symbol,maxStorage:U?t.getUint16(a.offset+18):0,maxFunctionDefs:U?t.getUint16(a.offset+20):0,maxInstructionDefs:U?t.getUint16(a.offset+22):0,maxStackElements:U?t.getUint16(a.offset+24):0,maxTwilightPoints:U?t.getUint16(a.offset+16):0,cvt:_,fpgm:D(L),prep:D(R),gasp:P,hdmx:et(t,e.get("hdmx"),y),vdmx:rt(t,e.get("VDMX")),ltsh:x&&x.length>=4+y?D(x).subarray(4,4+y):null,glyphIndex:m=>{let d=E.lookup(m);return d<y?d:0},hMetrics:m=>{let d=Math.min(m,b-1),C=t.getUint16(s.offset+d*4),O=m<b?t.getInt16(s.offset+m*4+2):t.getInt16(s.offset+b*4+(m-b)*2);return {advance:C,lsb:O}},loadGlyph:m=>{if(m<0||m>=y)return null;let d=N.get(m);if(d===void 0){try{d=ot(t,c,Y(m),Y(m+1));}catch{d=null;}N.set(m,d);}return d}}}function Ut(t){let n=t instanceof ArrayBuffer?new DataView(t):new DataView(t.buffer,t.byteOffset,t.byteLength);try{if(n.byteLength>=12&&z(n,0)==="ttcf"){let u=n.getUint32(8),r=[];for(let a=0;a<u&&12+a*4+4<=n.byteLength;a++){let s=Q(n,n.getUint32(12+a*4));s&&r.push(s);}return r}let e=Q(n,0);return e?[e]:[]}catch{return []}}exports.a=ft;exports.b=at;exports.c=ct;exports.d=lt;exports.e=gt;exports.f=it;exports.g=mt;exports.h=bt;exports.i=Q;exports.j=Ut;
@@ -0,0 +1 @@
1
+ var i=class{constructor(n){this.sliceStart=0;this.reason=null;this.signal=n.signal,this.timeoutMs=typeof n.timeoutMs=="number"&&n.timeoutMs>=0?n.timeoutMs:void 0,this.deadline=this.timeoutMs===void 0?1/0:performance.now()+this.timeoutMs,this.yields=!!this.signal;}check(){if(this.reason)throw this.reason.value;if(this.signal?.aborted)this.reason={value:this.signal.reason};else if(performance.now()>this.deadline)this.reason={value:s()};else return;throw this.reason.value}throwIfTripped(){if(this.reason)throw this.reason.value}get tripped(){return this.reason!==null}remaining(){return {signal:this.signal,timeoutMs:this.timeoutMs===void 0?void 0:Math.max(0,this.deadline-performance.now())}}};function s(){return new DOMException("The operation was aborted due to timeout","TimeoutError")}var o=Symbol("emf-converter.budget");function c(e){return e?e[o]?e[o]:e.signal===void 0&&e.timeoutMs===void 0?null:new i(e):null}var t=null;function f(){t&&t.check();}function h(){return t!==null&&t.yields&&performance.now()-t.sliceStart>16}function l(e,n){let r=t;t=e,e.sliceStart=performance.now();try{e.check();let u=n();return e.throwIfTripped(),u}finally{t=r;}}function a(e,n){return e?l(e,n):n()}function d(){return new Promise(e=>setTimeout(e,0))}async function m(e,n){for(;;){let r=a(e,()=>n.next());if(r.done)return r.value;await d(),e?.check();}}function p(e){for(;;){let n=e.next();if(n.done)return n.value}}export{o as a,c as b,f as c,h as d,a as e,m as f,p as g};
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkOB5ODU4B_js=require('./chunk-OB5ODU4B.js'),chunk32ASPP2J_js=require('./chunk-32ASPP2J.js'),chunkQX63UNWK_js=require('./chunk-QX63UNWK.js');async function Qt(){return null}async function ar(){return []}var _t=[1,0,0,1,0,0];function et(n,t){return [n[0]*t[0]+n[2]*t[1],n[1]*t[0]+n[3]*t[1],n[0]*t[2]+n[2]*t[3],n[1]*t[2]+n[3]*t[3],n[0]*t[4]+n[2]*t[5]+n[4],n[1]*t[4]+n[3]*t[5]+n[5]]}function Y(n){let t=n[0]*n[3]-n[1]*n[2];return !t||!Number.isFinite(t)?null:[n[3]/t,-n[1]/t,-n[2]/t,n[0]/t,(n[2]*n[5]-n[3]*n[4])/t,(n[1]*n[4]-n[0]*n[5])/t]}var nt=class n{constructor(){this.segs=[];this.cur=null;this.start=null;}reset(){this.segs=[],this.cur=null,this.start=null;}moveDevice(t){this.segs.push({t:"M",x:t.x,y:t.y}),this.cur=t,this.start=t;}lineDevice(t){if(!this.cur){this.moveDevice(t);return}this.segs.push({t:"L",x:t.x,y:t.y}),this.cur=t;}static map(t,e,r){return {x:t[0]*e+t[2]*r+t[4],y:t[1]*e+t[3]*r+t[5]}}moveTo(t,e,r){Number.isFinite(e)&&Number.isFinite(r)&&this.moveDevice(n.map(t,e,r));}lineTo(t,e,r){Number.isFinite(e)&&Number.isFinite(r)&&this.lineDevice(n.map(t,e,r));}curveUser(t,e,r,o,s,i,a){let c=n.map(t,e,r),u=n.map(t,o,s),l=n.map(t,i,a);this.cur||this.moveDevice(c),this.segs.push({t:"C",x1:c.x,y1:c.y,x2:u.x,y2:u.y,x:l.x,y:l.y}),this.cur=l;}bezierCurveTo(t,e,r,o,s,i,a){[e,r,o,s,i,a].every(Number.isFinite)&&this.curveUser(t,e,r,o,s,i,a);}quadraticCurveTo(t,e,r,o,s){if(![e,r,o,s].every(Number.isFinite))return;let i=Y(t),a=this.cur&&i?{x:i[0]*this.cur.x+i[2]*this.cur.y+i[4],y:i[1]*this.cur.x+i[3]*this.cur.y+i[5]}:{x:e,y:r};this.curveUser(t,a.x+2/3*(e-a.x),a.y+2/3*(r-a.y),o+2/3*(e-o),s+2/3*(r-s),o,s);}closePath(){this.cur&&(this.segs.push({t:"Z"}),this.cur=this.start);}rect(t,e,r,o,s){[e,r,o,s].every(Number.isFinite)&&(this.moveDevice(n.map(t,e,r)),this.lineDevice(n.map(t,e+o,r)),this.lineDevice(n.map(t,e+o,r+s)),this.lineDevice(n.map(t,e,r+s)),this.segs.push({t:"Z"}),this.moveDevice(n.map(t,e,r)));}ellipseUser(t,e,r,o,s,i,a,c,u){let l=Math.PI*2,m=c-a;u?m=-m>=l?-l:-((-m%l+l)%l):m=m>=l?l:(m%l+l)%l;let h=Math.cos(i),b=Math.sin(i),f=A=>{let R=o*Math.cos(A),g=s*Math.sin(A);return {x:e+R*h-g*b,y:r+R*b+g*h}},p=A=>{let R=-o*Math.sin(A),g=s*Math.cos(A);return {x:R*h-g*b,y:R*b+g*h}},M=f(a);if(this.lineDevice(n.map(t,M.x,M.y)),m===0)return;let x=Math.max(1,Math.ceil(Math.abs(m)/(Math.PI/2)-1e-9)),E=m/x,d=4/3*Math.tan(E/4);for(let A=0;A<x;A++){let R=a+A*E,g=R+E,S=f(R),y=f(g),P=p(R),T=p(g);this.curveUser(t,S.x+d*P.x,S.y+d*P.y,y.x-d*T.x,y.y-d*T.y,y.x,y.y);}}ellipse(t,e,r,o,s,i,a,c,u=false){if(o<0||s<0)throw new RangeError("The radii provided are negative");[e,r,o,s,i,a,c].every(Number.isFinite)&&this.ellipseUser(t,e,r,o,s,i,a,c,u);}arc(t,e,r,o,s,i,a=false){if(o<0)throw new RangeError("The radius provided is negative");[e,r,o,s,i].every(Number.isFinite)&&this.ellipseUser(t,e,r,o,o,0,s,i,a);}arcTo(t,e,r,o,s,i){if(![e,r,o,s,i].every(Number.isFinite)||i<0)return;if(!this.cur){this.moveDevice(n.map(t,e,r));return}let a=Y(t);if(!a)return;let c=a[0]*this.cur.x+a[2]*this.cur.y+a[4],u=a[1]*this.cur.x+a[3]*this.cur.y+a[5],l=c-e,m=u-r,h=o-e,b=s-r,f=Math.hypot(l,m),p=Math.hypot(h,b),M=l*b-m*h;if(i===0||f===0||p===0||Math.abs(M)<1e-12*f*p){this.lineDevice(n.map(t,e,r));return}let x=l/f,E=m/f,d=h/p,A=b/p,R=Math.acos(Math.max(-1,Math.min(1,x*d+E*A))),g=i/Math.tan(R/2),S={x:e+x*g,y:r+E*g},y={x:e+d*g,y:r+A*g},P=x+d,T=E+A,C=Math.hypot(P,T),L=i/Math.sin(R/2),_={x:e+P/C*L,y:r+T/C*L},w=Math.atan2(S.y-_.y,S.x-_.x),D=Math.atan2(y.y-_.y,y.x-_.x)-w;for(;D>Math.PI;)D-=2*Math.PI;for(;D<=-Math.PI;)D+=2*Math.PI;this.ellipseUser(t,_.x,_.y,i,i,0,w,w+D,D<0);}};function ft(n,t,e){let r=[],o=null,s=0,i=0,a=0,c=0,u=(l,m)=>{let h={pts:[l,m],smooth:[false],closed:false};return r.push(h),h};for(let l of n)switch(l.t){case "M":o=u(l.x,l.y),s=a=l.x,i=c=l.y;break;case "L":o||(o=u(s,i)),o.pts.push(l.x,l.y),o.smooth.push(false),a=l.x,c=l.y;break;case "C":{o||(o=u(s,i));let m=Math.max(Math.abs(a-2*l.x1+l.x2),Math.abs(l.x1-2*l.x2+l.x)),h=Math.max(Math.abs(c-2*l.y1+l.y2),Math.abs(l.y1-2*l.y2+l.y)),b=Math.hypot(m,h),f=e?e(a,c,l.x1,l.y1,l.x2,l.y2,l.x,l.y):Math.max(1,Math.min(1e3,Math.ceil(Math.sqrt(.75*b/t))));for(let p=1;p<=f;p++){let M=p/f,x=1-M,E=x*x*x,d=3*x*x*M,A=3*x*M*M,R=M*M*M;o.pts.push(E*a+d*l.x1+A*l.x2+R*l.x,E*c+d*l.y1+A*l.y2+R*l.y),o.smooth.push(p<f);}a=l.x,c=l.y;break}case "Z":o&&(o.closed=true,o=null,a=s,c=i);break}return r}function tn(n,t,e,r){let o=0,s=0;for(let i of n){let a=i.pts,c=a.length/2;if(!(c<2))for(let u=0;u<c;u++){let l=a[u*2],m=a[u*2+1],h=u+1<c?u+1:0,b=a[h*2],f=a[h*2+1];(m<=e?f>e:f<=e)&&l+(e-m)*(b-l)/(f-m)>t&&(s++,o+=f>m?1:-1);}}return r==="evenodd"?(s&1)===1:o!==0}function It(n){let t=/^\s*((?:(?:italic|oblique|normal|bold|bolder|lighter|small-caps|\d{3})\s+)*)([\d.]+)px\s+(.+)$/i.exec(n);if(!t)return {style:"",weight:"",size:10,family:"sans-serif"};let e=t[1].trim().split(/\s+/).filter(Boolean),r=e.find(s=>/^(italic|oblique)$/i.test(s))??"",o=e.find(s=>/^(bold|bolder|lighter|\d{3})$/i.test(s))??"";return {style:r,weight:o,size:parseFloat(t[2]),family:t[3].trim()}}function Ot(n,t){let e=0;for(let r of n)/[ilj.,;:'!|]/.test(r)?e+=.28:/[mwMW@]/.test(r)?e+=.83:/[A-Z0-9]/.test(r)?e+=.64:r===" "?e+=.28:r.charCodeAt(0)>11903?e+=1:e+=.52;return e*t}function nn(n,t,e,r,o,s,i){let a=It(r).size,c=Ot(n,a)*1.5+a;i!==void 0&&Number.isFinite(i)&&i>0&&(c=Math.min(c,i+a));let u=a*.3,l,m;o==="center"?(l=t-c/2,m=t+c/2):o==="right"||o==="end"?(l=t-c,m=t+u):(l=t-u,m=t+c);let h,b;switch(s){case "top":case "hanging":h=.3,b=1.5;break;case "middle":h=.9,b=.9;break;case "bottom":case "ideographic":h=1.5,b=.3;break;default:h=1.2,b=.5;}return {x0:l,y0:e-h*a,x1:m,y1:e+b*a}}var vt=new Float64Array(0),en=new Uint8Array(0),bt=[],G=new Float64Array(0);function re(n){if(G.length<n){let t=new Float64Array(Math.max(n,G.length*2,1024));t.set(G),G=t;}}function oe(n,t,e,r,o,s,i,a,c){if(i===c)return;let u=1;if(i>c){u=-1;let M=s;s=a,a=M,M=i,i=c,c=M;}let l=Math.max(0,i),m=Math.min(r,c);if(l>=m)return;let h=(M,x,E)=>{let d=M*e+x;n[d]+=E,t[d]||(t[d]=1,bt[M].push(x));},b=(a-s)/(c-i),f=Math.min(o,Math.max(0,s+(l-i)*b)),p=Math.ceil(m);for(let M=Math.floor(l);M<p;M++){let x=Math.min(M+1,m)-Math.max(M,l),E=f+b*x;E<0?E=0:E>o&&(E=o);let d=x*u,A=f<E?f:E,R=f<E?E:f,g=Math.floor(A),S=Math.ceil(R);if(S<=g+1){let y=.5*(f+E)-g;h(M,g,d-d*y),h(M,g+1,d*y);}else {let y=1/(R-A),P=A-g,T=.5*y*(1-P)*(1-P),C=R-S+1,L=.5*y*C*C;if(h(M,g,d*T),S===g+2)h(M,g+1,d*(1-T-L));else {let _=y*(1.5-P);h(M,g+1,d*(_-T));for(let I=g+2;I<S-1;I++)h(M,I,d*y);let w=_+(S-g-3)*y;h(M,S-1,d*(1-w-L));}h(M,S,d*L);}f=E;}}function se(n,t){let e;if(t){let r=Math.abs(n);r-=2*Math.floor(r/2),e=r>1?2-r:r;}else e=Math.abs(n),e>1&&(e=1);return Math.round(e*255)}var ie=(n,t)=>n-t;function rt(n,t,e,r){let o=1/0,s=1/0,i=-1/0,a=-1/0;for(let R of n)for(let g=0;g+1<R.length;g+=2){let S=R[g],y=R[g+1];S<o&&(o=S),S>i&&(i=S),y<s&&(s=y),y>a&&(a=y);}if(!(o<=i)||!(s<=a)||!Number.isFinite(o+i+s+a))return null;let c=Math.max(e.x0,Math.floor(o)),u=Math.max(e.y0,Math.floor(s)),l=Math.min(e.x1,Math.ceil(i)),m=Math.min(e.y1,Math.ceil(a));if(l<=c||m<=u)return null;let h=l-c,b=0,f=(R,g,S,y)=>{g!==y&&(re((b+1)*4),G[b*4]=R,G[b*4+1]=g,G[b*4+2]=S,G[b*4+3]=y,b++);},p=(R,g,S,y)=>{if(!(g===y||Math.max(g,y)<=u||Math.min(g,y)>=m)&&!(R>=h&&S>=h)){if(R>h||S>h){let P=(h-R)/(S-R),T=g+(y-g)*P;R>h?(R=h,g=T):(S=h,y=T);}if(R<=0&&S<=0){f(0,g,0,y);return}if(R<0||S<0){let P=(0-R)/(S-R),T=g+(y-g)*P;R<0?(f(0,g,0,T),f(0,T,S,y)):(f(R,g,0,T),f(0,T,0,y));return}f(R,g,S,y);}};for(let R of n){let g=R.length>>1;if(!(g<2))for(let S=0;S<g;S++){let y=S+1<g?S+1:0;p(R[S*2]-c,R[S*2+1],R[y*2]-c,R[y*2+1]);}}if(b===0)return null;let M=h+2,x=Math.max(1,Math.min(m-u,Math.floor(1048576/M)));for(vt.length<x*M&&(vt=new Float64Array(x*M),en=new Uint8Array(x*M));bt.length<x;)bt.push([]);let E=vt,d=en,A=t==="evenodd";for(let R=u;R<m;R+=x){let g=Math.min(x,m-R);for(let S=0;S<b;S++){let y=S*4,P=G[y+1]-R,T=G[y+3]-R;P<=0&&T<=0||P>=g&&T>=g||oe(E,d,M,g,h,G[y],P,G[y+2],T);}for(let S=0;S<g;S++){let y=bt[S];if(y.length===0)continue;y.sort(ie);let P=S*M,T=R+S,C=0;for(let L=0;L<y.length;L++){let _=y[L];if(C+=E[P+_],E[P+_]=0,d[P+_]=0,_>=h)continue;let w=L+1<y.length?Math.min(y[L+1],h):h,I=se(C,A);I&&r(T,c+_,c+w,I);}y.length=0;}}return {x0:c,y0:u,x1:l,y1:m}}var ae={black:0,white:16777215,red:16711680,lime:65280,green:32768,blue:255,yellow:16776960,cyan:65535,aqua:65535,magenta:16711935,fuchsia:16711935,gray:8421504,grey:8421504,silver:12632256,maroon:8388608,olive:8421376,teal:32896,navy:128,purple:8388736,orange:16753920,darkgray:11119017,darkgrey:11119017,lightgray:13882323,lightgrey:13882323,dimgray:6908265,dimgrey:6908265,whitesmoke:16119285,gainsboro:14474460},xt=new Map;function dt(n){let t=xt.get(n);if(t!==void 0)return t;let e=ce(n.trim().toLowerCase());return xt.size>4096&&xt.clear(),xt.set(n,e),e}function ce(n){if(n==="transparent")return [0,0,0,0];if(n[0]==="#"){let r=n.slice(1);if(!/^[0-9a-f]+$/.test(r))return null;if(r.length===3||r.length===4){let o=[...r].map(s=>parseInt(s+s,16));return [o[0],o[1],o[2],r.length===4?o[3]/255:1]}return r.length===6||r.length===8?[parseInt(r.slice(0,2),16),parseInt(r.slice(2,4),16),parseInt(r.slice(4,6),16),r.length===8?parseInt(r.slice(6,8),16)/255:1]:null}let t=/^rgba?\(([^)]*)\)$/.exec(n);if(t){let r=t[1].split(/[\s,/]+/).filter(Boolean);if(r.length<3)return null;let o=a=>{let c=a.endsWith("%")?parseFloat(a)*255/100:parseFloat(a);return Math.max(0,Math.min(255,Math.round(c)))},s=r.length>3?r[3].endsWith("%")?parseFloat(r[3])/100:parseFloat(r[3]):1,i=[o(r[0]),o(r[1]),o(r[2])];return i.some(a=>!Number.isFinite(a))||!Number.isFinite(s)?null:[i[0],i[1],i[2],Math.max(0,Math.min(1,s))]}let e=ae[n];return e===void 0?null:[e>>16&255,e>>8&255,e&255,1]}var H=class{constructor(t,e){this.kind=t;this.coords=e;this.stops=[];this.sorted=null;}addColorStop(t,e){if(!(t>=0&&t<=1))throw new RangeError("Gradient stop offset out of range");let r=dt(e);if(!r)throw new SyntaxError(`Invalid colour: ${e}`);this.stops.push({offset:t,color:r}),this.sorted=null;}sortedStops(){return this.sorted||(this.sorted=this.stops.map((t,e)=>({s:t,i:e})).sort((t,e)=>t.s.offset-e.s.offset||t.i-e.i).map(t=>t.s)),this.sorted}},V=class{constructor(t,e,r,o){this.data=t;this.width=e;this.height=r;this.repetition=o;this.matrix=[1,0,0,1,0,0];}setTransform(t){let e=[t?.a??1,t?.b??0,t?.c??0,t?.d??1,t?.e??0,t?.f??0];e.every(Number.isFinite)&&(this.matrix=e);}};function rn(n,t,e){let r,o=n.length;if(t<=n[0].offset)r=n[0].color;else if(t>=n[o-1].offset)r=n[o-1].color;else {let s=0,i=o-1;for(;i-s>1;){let h=s+i>>1;n[h].offset<=t?s=h:i=h;}let a=n[s],c=n[i],u=c.offset-a.offset,l=u>0?(t-a.offset)/u:1,m=a.color[3]+(c.color[3]-a.color[3])*l;e[0]=(a.color[0]+(c.color[0]-a.color[0])*l)*m,e[1]=(a.color[1]+(c.color[1]-a.color[1])*l)*m,e[2]=(a.color[2]+(c.color[2]-a.color[2])*l)*m,e[3]=m*255;return}e[0]=r[0]*r[3],e[1]=r[1]*r[3],e[2]=r[2]*r[3],e[3]=r[3]*255;}function ue(n,t){let e=n.sortedStops(),r=Y(t);if(e.length===0||!r)return null;let o=n.coords;if(n.kind==="linear"){let[p,M,x,E]=o,d=x-p,A=E-M,R=d*d+A*A;return R>0?{shade(g,S,y){let P=g+.5,T=S+.5,C=r[0]*P+r[2]*T+r[4],L=r[1]*P+r[3]*T+r[5];return rn(e,((C-p)*d+(L-M)*A)/R,y),true}}:null}let[s,i,a,c,u,l]=o;if(s===c&&i===u&&a===l)return null;let m=c-s,h=u-i,b=l-a,f=m*m+h*h-b*b;return {shade(p,M,x){let E=p+.5,d=M+.5,A=r[0]*E+r[2]*d+r[4]-s,R=r[1]*E+r[3]*d+r[5]-i,g=A*m+R*h+a*b,S=A*A+R*R-a*a,y;if(Math.abs(f)<1e-12){if(Math.abs(g)<1e-12||(y=S/(2*g),a+y*b<0))return false}else {let P=g*g-f*S;if(P<0)return false;let T=Math.sqrt(P),C=(g+T)/f,L=(g-T)/f,_=Math.max(C,L),w=Math.min(C,L);if(a+_*b>=0)y=_;else if(a+w*b>=0)y=w;else return false}return rn(e,y,x),true}}}function on(n,t){let e=n%t;return e<0?e+t:e}function le(n,t,e,r){if(n.transparentOutside&&(!n.wrapX&&(t<n.minX||t>=n.maxX)||!n.wrapY&&(e<n.minY||e>=n.maxY)))return false;let o=n.data,s=n.width,i=T=>n.wrapX?on(T,s):Math.min(n.maxX-1,Math.max(n.minX,T)),a=T=>n.wrapY?on(T,n.height):Math.min(n.maxY-1,Math.max(n.minY,T));if(!n.smooth){let T=(a(Math.floor(e))*s+i(Math.floor(t)))*4;return r[0]=o[T],r[1]=o[T+1],r[2]=o[T+2],r[3]=o[T+3],true}let c=t-.5,u=e-.5,l=Math.floor(c),m=Math.floor(u),h=c-l,b=u-m,f=i(l),p=i(l+1),M=a(m)*s,x=a(m+1)*s,E=(M+f)*4,d=(M+p)*4,A=(x+f)*4,R=(x+p)*4,g=(1-h)*(1-b),S=h*(1-b),y=(1-h)*b,P=h*b;for(let T=0;T<4;T++)r[T]=o[E+T]*g+o[d+T]*S+o[A+T]*y+o[R+T]*P;return true}function wt(n,t){let e=Y(t);return e?{shade(r,o,s){let i=r+.5,a=o+.5;return le(n,e[0]*i+e[2]*a+e[4],e[1]*i+e[3]*a+e[5],s)}}:null}function ot(n,t,e){if(typeof n=="string"){let r=dt(n);return r?{solid:[r[0]*r[3],r[1]*r[3],r[2]*r[3],r[3]*255]}:null}if(n instanceof H)return ue(n,t);if(n instanceof V){let r=n.repetition,o=r==="repeat"||r==="repeat-x",s=r==="repeat"||r==="repeat-y";return wt({data:n.data,width:n.width,height:n.height,wrapX:o,wrapY:s,minX:0,minY:0,maxX:n.width,maxY:n.height,transparentOutside:true,smooth:e},et(t,n.matrix))}return null}var un=new Set(["copy","source-in","source-out","destination-in","destination-atop"]),Nt={multiply:(n,t)=>n*t,screen:(n,t)=>n+t-n*t,overlay:(n,t)=>sn(t,n),darken:(n,t)=>Math.min(n,t),lighten:(n,t)=>Math.max(n,t),"color-dodge":(n,t)=>t===0?0:n>=1?1:Math.min(1,t/(1-n)),"color-burn":(n,t)=>t>=1?1:n<=0?0:1-Math.min(1,(1-t)/n),"hard-light":(n,t)=>sn(n,t),"soft-light":(n,t)=>{if(n<=.5)return t-(1-2*n)*t*(1-t);let e=t<=.25?((16*t-12)*t+4)*t:Math.sqrt(t);return t+(2*n-1)*(e-t)},difference:(n,t)=>Math.abs(n-t),exclusion:(n,t)=>n+t-2*n*t};function sn(n,t){return n<=.5?t*2*n:Nt.screen(2*n-1,t)}function Z(n,t,e){return .3*n+.59*t+.11*e}function me(n){let t=Z(n[0],n[1],n[2]),e=Math.min(n[0],n[1],n[2]),r=Math.max(n[0],n[1],n[2]),[o,s,i]=n;return e<0&&(o=t+(o-t)*t/(t-e),s=t+(s-t)*t/(t-e),i=t+(i-t)*t/(t-e)),r>1&&(o=t+(o-t)*(1-t)/(r-t),s=t+(s-t)*(1-t)/(r-t),i=t+(i-t)*(1-t)/(r-t)),[o,s,i]}function pt(n,t){let e=t-Z(n[0],n[1],n[2]);return me([n[0]+e,n[1]+e,n[2]+e])}function an(n){return Math.max(n[0],n[1],n[2])-Math.min(n[0],n[1],n[2])}function cn(n,t){let e=[0,1,2].sort((a,c)=>n[a]-n[c]),r=[0,0,0],[o,s,i]=e;return n[i]>n[o]&&(r[s]=(n[s]-n[o])*t/(n[i]-n[o]),r[i]=t),r}var ln={hue:(n,t)=>pt(cn(n,an(t)),Z(t[0],t[1],t[2])),saturation:(n,t)=>pt(cn(t,an(n)),Z(t[0],t[1],t[2])),color:(n,t)=>pt(n,Z(t[0],t[1],t[2])),luminosity:(n,t)=>pt(t,Z(n[0],n[1],n[2]))};function mn(n){return n in Nt||n in ln||["source-over","source-in","source-out","source-atop","destination-over","destination-in","destination-out","destination-atop","xor","copy","lighter"].includes(n)}function st(n,t,e,r,o,s,i,a){let c=n[t]/255,u=n[t+1]/255,l=n[t+2]/255,m=n[t+3]/255,h,b,f,p;switch(a){case "source-over":h=e+c*(1-s),b=r+u*(1-s),f=o+l*(1-s),p=s+m*(1-s);break;case "copy":h=e,b=r,f=o,p=s;break;case "destination-over":h=e*(1-m)+c,b=r*(1-m)+u,f=o*(1-m)+l,p=s*(1-m)+m;break;case "source-in":h=e*m,b=r*m,f=o*m,p=s*m;break;case "destination-in":h=c*s,b=u*s,f=l*s,p=m*s;break;case "source-out":h=e*(1-m),b=r*(1-m),f=o*(1-m),p=s*(1-m);break;case "destination-out":h=c*(1-s),b=u*(1-s),f=l*(1-s),p=m*(1-s);break;case "source-atop":h=e*m+c*(1-s),b=r*m+u*(1-s),f=o*m+l*(1-s),p=m;break;case "destination-atop":h=e*(1-m)+c*s,b=r*(1-m)+u*s,f=o*(1-m)+l*s,p=s;break;case "xor":h=e*(1-m)+c*(1-s),b=r*(1-m)+u*(1-s),f=o*(1-m)+l*(1-s),p=s*(1-m)+m*(1-s);break;case "lighter":h=Math.min(1,e+c),b=Math.min(1,r+u),f=Math.min(1,o+l),p=Math.min(1,s+m);break;default:{p=s+m-s*m;let M=s*m,x=[s>0?e/s:0,s>0?r/s:0,s>0?o/s:0],E=[m>0?c/m:0,m>0?u/m:0,m>0?l/m:0],d,A=Nt[a];if(A)d=[A(x[0],E[0]),A(x[1],E[1]),A(x[2],E[2])];else {let R=ln[a];if(!R){st(n,t,e,r,o,s,i,"source-over");return}d=R(x,E);}h=e*(1-m)+c*(1-s)+M*d[0],b=r*(1-m)+u*(1-s)+M*d[1],f=o*(1-m)+l*(1-s)+M*d[2];}}i<1&&(h=c+(h-c)*i,b=u+(b-u)*i,f=l+(f-l)*i,p=m+(p-m)*i),n[t]=h*255,n[t+1]=b*255,n[t+2]=f*255,n[t+3]=p*255;}function hn(n,t){let e=Math.abs(n),r=Math.abs(t);if(e<r){let o=e;e=r,r=o;}return e+r/2}function pn(n,t){let e=hn(n[0]*t,n[1]*t),r=hn(n[2]*t,n[3]*t);return e<=1&&r<=1?(e+r)/2:null}function dn(n,t,e,r,o,s,i,a){let c=i/3+2*n/3,u=a/3+2*t/3,l=n/3+2*i/3,m=t/3+2*a/3,h=Math.max(Math.abs(e-c),Math.abs(r-u),Math.abs(o-l),Math.abs(s-m)),b=1/8;for(let f=0;f<9;f++){if(h<b)return 1<<f;b*=4;}return 512}var Mt=32768;function fn(n,t){return Math.trunc(n*65536/t)}function bn(n,t){return n*t>>6}function Mn(n,t,e,r,o,s,i){let a=0,c=1,u=e-n,l=r-t,m=[[-u,n+1],[u,o+1-n],[-l,t+1],[l,s+1-t]];for(let[h,b]of m)if(h===0){if(b<0)return}else {let f=b/h;h<0?a=Math.max(a,f):c=Math.min(c,f);}a>c||Ft(Math.round((n+u*a)*64),Math.round((t+l*a)*64),Math.round((n+u*c)*64),Math.round((t+l*c)*64),i);}function Ft(n,t,e,r,o){if(Math.abs(e-n)>511*64||Math.abs(r-t)>511*64){let s=(n>>1)+(e>>1),i=(t>>1)+(r>>1);Ft(n,t,s,i,o),Ft(s,i,e,r,o);return}if(Math.abs(e-n)>Math.abs(r-t)){n>e&&([n,e]=[e,n],[t,r]=[r,t]);let s=n>>6,i=e+63>>6,a=t<<10,c=t===r?0:fn(r-t,e-n);a+=c*(32-(n&63))+32>>6,xn(s,i,a,c,e-n,n&63,e&63,(u,l,m,h)=>{m&&o(u,l-1,m),h&&o(u,l,h);});}else {if(n===e&&t===r)return;t>r&&([n,e]=[e,n],[t,r]=[r,t]);let s=t>>6,i=r+63>>6,a=n<<10,c=n===e?0:fn(e-n,r-t);a+=c*(32-(t&63))+32>>6,xn(s,i,a,c,r-t,t&63,r&63,(u,l,m,h)=>{m&&o(l-1,u,m),h&&o(l,u,h);});}}function xn(n,t,e,r,o,s,i,a){if(t<=n)return;let c,u;t-n===1?(c=o,u=0):(c=64-s,u=i);let l=(f,p,M)=>{p+=Mt;let x=p>>16,E=p>>8&255;return a(f,x,bn(255-E,M),bn(E,M)),p+r-Mt},m=l(n,e,c),h=n+1,b=t-h-(u>0?1:0);if(b>0){m+=Mt;for(let f=0;f<b;f++,h++){let p=m>>16,M=m>>8&255;a(h,p,255-M,M),m+=r;}m-=Mt;}u>0&&l(t-1,m,u);}var Q=1e-9;function En(n){let t=[],e=[],r=n.pts;for(let o=0;o<r.length;o+=2){let s=t.length;s>=2&&Math.abs(t[s-2]-r[o])<Q&&Math.abs(t[s-1]-r[o+1])<Q||(t.push(r[o],r[o+1]),e.push(n.smooth[o>>1]??false));}if(n.closed&&t.length>=4){let o=t.length;Math.abs(t[o-2]-t[0])<Q&&Math.abs(t[o-1]-t[1])<Q&&(t.length-=2,e.length-=1);}return e[0]=false,{pts:t,smooth:e,closed:n.closed}}function gn(n,t,e){let r=t.reduce((f,p)=>f+p,0);if(!(r>0))return [n];let o=n.pts,s=o.length>>1,i=n.closed?s:s-1;if(i<1)return [n];let a=e%r;a<0&&(a+=r);let c=0;for(;a>0&&a>=t[c];)a-=t[c],c=(c+1)%t.length;let u=t[c]-a,l=c%2===0,m=[],h=l?{pts:[o[0],o[1]],smooth:[false],closed:false}:null,b=l;for(let f=0;f<i;f++){let p=o[f*2],M=o[f*2+1],x=(f+1)%s,E=o[x*2],d=o[x*2+1],A=Math.hypot(E-p,d-M),R=0;for(;A-R>u;){R+=u;let g=R/A,S=p+(E-p)*g,y=M+(d-M)*g;l&&h?(h.pts.push(S,y),h.smooth.push(false),h.pts.length===4&&Math.abs(h.pts[0]-S)<Q&&Math.abs(h.pts[1]-y)<Q&&(h.pts.length=2,h.smooth.length=1,h.dir=[(E-p)/A,(d-M)/A]),m.push(h),h=null):h={pts:[S,y],smooth:[false],closed:false,dir:[(E-p)/A,(d-M)/A]},l=!l,c=(c+1)%t.length,u=t[c];}u-=A-R,l&&h&&(h.pts.push(E,d),h.smooth.push(x===0?false:n.smooth[x]));}if(l&&h){if(n.closed&&b&&m.length>0){let f=m.shift();h.pts.push(...f.pts.slice(2)),h.smooth.push(...f.smooth.slice(1));}m.push(h);}for(let f of m)f.pts.length>2&&delete f.dir;return m}function Ut(n,t,e,r,o,s,i){let a=Math.ceil(Math.abs(s)/i);for(let c=1;c<a;c++){let u=o+s*c/a;n.push(t+r*Math.cos(u),e+r*Math.sin(u));}}function he(n,t,e,r,o,s,i,a,c,u,l,m,h,b,f){let p=t+a*m,M=e+c*m,x=t+u*m,E=e+l*m,d=r*s+o*i,A=r*i-o*s;if(n.push(p,M),Math.abs(A)<1e-12&&d>0)return;if(!(a*s+c*i<0||Math.abs(A)<1e-12&&d<0)){n.push(t,e),n.push(x,E);return}if(h==="round"){let g=Math.atan2(c,a),S=Math.atan2(l,u)-g;for(;S<=-Math.PI;)S+=2*Math.PI;for(;S>Math.PI;)S-=2*Math.PI;Math.abs(A)<1e-12&&(S=Math.PI*Math.sign(a*o-c*r)),Ut(n,t,e,m,g,S,f);}else if(h==="miter"){let g=a*u+c*l,S=Math.sqrt(Math.max(0,(1+g)/2));if(S>1e-12&&1/S<=b){let y=a+u,P=c+l,T=Math.hypot(y,P);if(T>1e-12){let C=m/S;n.push(t+y/T*C,e+P/T*C);}}}n.push(x,E);}function fe(n,t,e,r){let o=t.lineWidth/2,s=n.pts,i=s.length>>1,a=t.lineCap;if(i===1){if(!r||n.closed||a==="butt")return [];let x=s[0],E=s[1],[d,A]=n.dir??[1,0];if(a==="round"){let S=[x+o,E];return Ut(S,x,E,o,0,2*Math.PI,e),[S]}let R=-A,g=d;return [[x+(d+R)*o,E+(A+g)*o,x+(-d+R)*o,E+(-A+g)*o,x+(-d-R)*o,E+(-A-g)*o,x+(d-R)*o,E+(A-g)*o]]}let c=n.closed?i:i-1,u=new Float64Array(c*2);for(let x=0;x<c;x++){let E=(x+1)%i,d=s[E*2]-s[x*2],A=s[E*2+1]-s[x*2+1],R=Math.hypot(d,A)||1;u[x*2]=d/R,u[x*2+1]=A/R;}let l=x=>{let E=[],d=n.closed?0:1,A=n.closed?i-1:i-2;n.closed||E.push(s[0]+x*u[1]*o,s[1]-x*u[0]*o);for(let R=d;R<=A;R++){let g=(R-1+c)%c,S=R%c,y=u[g*2],P=u[g*2+1],T=u[S*2],C=u[S*2+1],L=n.smooth[R]?"round":t.lineJoin;he(E,s[R*2],s[R*2+1],y,P,T,C,x*P,-x*y,x*C,-x*T,o,L,t.miterLimit,e);}if(!n.closed){let R=c-1;E.push(s[(i-1)*2]+x*u[R*2+1]*o,s[(i-1)*2+1]-x*u[R*2]*o);}return E},m=l(1),h=l(-1),b=x=>{let E=[];for(let d=x.length-2;d>=0;d-=2)E.push(x[d],x[d+1]);return E};if(n.closed)return [m,b(h)];let f=m.slice(),p=(x,E,d,A)=>{if(a==="square")f.push(x+(A+d)*o,E+(-d+A)*o),f.push(x+(-A+d)*o,E+(d+A)*o);else if(a==="round"){let R=Math.atan2(-d,A);Ut(f,x,E,o,R,Math.PI,e);}},M=i-1;return p(s[M*2],s[M*2+1],u[(c-1)*2],u[(c-1)*2+1]),f.push(...b(h)),p(s[0],s[1],-u[0],-u[1]),[f]}function Tn(n,t,e){let r=Y(t);if(!r)return [];let o=[];for(let s of n){let i={pts:new Array(s.pts.length),smooth:s.smooth,closed:s.closed};for(let u=0;u<s.pts.length;u+=2){let l=s.pts[u],m=s.pts[u+1];i.pts[u]=r[0]*l+r[2]*m+r[4],i.pts[u+1]=r[1]*l+r[3]*m+r[5];}let a=En(i),c=e.lineDash.length>0?gn(a,e.lineDash,e.lineDashOffset):[a];for(let u of c){let l=u.pts;for(let m=0;m<l.length;m+=2){let h=l[m],b=l[m+1];l[m]=t[0]*h+t[2]*b+t[4],l[m+1]=t[1]*h+t[3]*b+t[5];}o.push({pts:l,smooth:u.smooth,closed:u.closed});}}return o}function Dt(n,t,e,r){let o=Y(t);if(!o||!(e.lineWidth>0))return [];let s=Math.max(Math.hypot(t[0],t[1]),Math.hypot(t[2],t[3])),i=Math.max(1e-6,e.lineWidth/2*s),a=i<=r?Math.PI/2:Math.max(.05,2*Math.acos(1-r/i)),c=[];for(let u of n){let l={pts:new Array(u.pts.length),smooth:u.smooth,closed:u.closed};for(let f=0;f<u.pts.length;f+=2){let p=u.pts[f],M=u.pts[f+1];l.pts[f]=o[0]*p+o[2]*M+o[4],l.pts[f+1]=o[1]*p+o[3]*M+o[5];}let m=u.pts.length>=4,h=En(l),b=e.lineDash.length>0?gn(h,e.lineDash,e.lineDashOffset):[h];for(let f of b)for(let p of fe(f,e,a,m)){for(let M=0;M<p.length;M+=2){let x=p[M],E=p[M+1];p[M]=t[0]*x+t[2]*E+t[4],p[M+1]=t[1]*x+t[3]*E+t[5];}c.push(p);}}return c}var it=.05,kt=null;function be(){if(kt)return kt;let n=Math.fround,t=n(1/255),e=new Uint8Array(256*256);for(let r=1;r<256;r++){let o=n(1/n(r*t));for(let s=0;s<256;s++){let i=n(n(n(s*t)*o)*255),a=Math.min(Math.max(i,0),255),c=Math.floor(a),u=a-c;e[r<<8|s]=u>.5||u===.5&&c%2===1?c+1:c;}}return kt=e,e}var z=class{constructor(t,e){this.unknown=null;this.textDraws=0;this.width=Math.max(1,Math.floor(t)),this.height=Math.max(1,Math.floor(e)),this.data=new Uint8ClampedArray(this.width*this.height*4),this.words=new Uint32Array(this.data.buffer),this.ctx=new at(this);}getContext(t){return this.ctx}get pixels(){return this.readRgba(0,0,this.width,this.height)}readRgba(t,e,r,o){let s=new Uint8ClampedArray(Math.max(0,r*o*4)),{width:i,height:a,data:c}=this;for(let u=0;u<o;u++){let l=e+u;if(!(l<0||l>=a))for(let m=0;m<r;m++){let h=t+m;if(h<0||h>=i)continue;let b=(l*i+h)*4,f=(u*r+m)*4,p=c[b+3];if(p===255)s[f]=c[b],s[f+1]=c[b+1],s[f+2]=c[b+2],s[f+3]=255;else if(p!==0){let M=be(),x=p<<8;s[f]=M[x|c[b]],s[f+1]=M[x|c[b+1]],s[f+2]=M[x|c[b+2]],s[f+3]=p;}}}return s}unknownIn(t,e,r,o){let s=this.unknown;if(!s)return null;let i=null;for(let a=0;a<o;a++){let c=e+a;if(!(c<0||c>=this.height))for(let u=0;u<r;u++){let l=t+u;l>=0&&l<this.width&&s[c*this.width+l]&&(i??(i=new Uint8Array(r*o)),i[a*r+u]=1);}}return i}markUnknown(t,e=null){let r=e?e.box:{x0:0,y0:0,x1:this.width,y1:this.height};this.unknown??(this.unknown=new Uint8Array(this.width*this.height));let o=this.unknown;rt([t],"nonzero",r,(s,i,a)=>{for(let c=i;c<a;c++)(!e||j(e,c,s))&&(o[s*this.width+c]=1);});}};function Sr(n){return n instanceof z||n instanceof at}var xe=new Uint8Array(new Uint32Array([1]).buffer)[0]===1;function pe(n,t,e,r){let o=Math.round(n)&255,s=Math.round(t)&255,i=Math.round(e)&255,a=Math.round(r)&255;return (xe?a<<24|i<<16|s<<8|o:o<<24|s<<16|i<<8|a)>>>0}function j(n,t,e){let r=n.box;return t<r.x0||t>=r.x1||e<r.y0||e>=r.y1?0:n.mask?n.mask[(e-r.y0)*(r.x1-r.x0)+(t-r.x0)]:255}function Rn(n,t,e,r){let o=n[t*2]-n[e*2],s=n[t*2+1]-n[e*2+1],i=Math.hypot(o,s);i>0&&(n[t*2]+=o/i*r,n[t*2+1]+=s/i*r);}function de(n){let t=n.length>>1;if(t===5&&n[0]===n[8]&&n[1]===n[9]&&(t=4),t!==4)return null;let e=[n[0],n[2],n[4],n[6]],r=[n[1],n[3],n[5],n[7]];if(![...e,...r].every(Number.isInteger))return null;let o=r[0]===r[1]&&e[1]===e[2]&&r[2]===r[3]&&e[3]===e[0],s=e[0]===e[1]&&r[1]===r[2]&&e[2]===e[3]&&r[3]===r[0];return !o&&!s?null:{x0:Math.min(...e),y0:Math.min(...r),x1:Math.max(...e),y1:Math.max(...r)}}function Bt(n){if(n instanceof z)return {data:n.data,width:n.width,height:n.height};if(n instanceof at)return Bt(n.canvas);let t=n,e=null;if(t&&t.data instanceof Uint8ClampedArray&&typeof t.width=="number"&&typeof t.height=="number")e={data:t.data,width:t.width,height:t.height};else if(t&&typeof t.getContext=="function"&&typeof t.width=="number"&&typeof t.height=="number")try{let a=t.getContext("2d")?.getImageData?.(0,0,t.width,t.height);a&&(e={data:a.data,width:t.width,height:t.height});}catch{e=null;}if(!e||e.width<=0||e.height<=0)return null;let r=e.width*e.height*4;if(e.data.length<r)return null;let o=new Uint8ClampedArray(r),s=e.data;for(let i=0;i<r;i+=4){let a=s[i+3];if(a===255)o[i]=s[i],o[i+1]=s[i+1],o[i+2]=s[i+2],o[i+3]=255;else if(a!==0){let c=a/255;o[i]=s[i]*c,o[i+1]=s[i+1]*c,o[i+2]=s[i+2]*c,o[i+3]=a;}}return {data:o,width:e.width,height:e.height}}var at=class{constructor(t){this.state={transform:[..._t],fillStyle:"#000000",strokeStyle:"#000000",lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,lineDash:[],lineDashOffset:0,globalAlpha:1,gco:"source-over",font:"10px sans-serif",textAlign:"start",textBaseline:"alphabetic",imageSmoothingEnabled:true,imageSmoothingQuality:"low",clip:null};this.stack=[];this.path=new nt;this.flatCache=null;this.rowCache=null;this.px=new Float64Array(4);this.canvas=t;}get fillStyle(){return this.state.fillStyle}set fillStyle(t){this.acceptStyle(t)&&(this.state.fillStyle=t);}get strokeStyle(){return this.state.strokeStyle}set strokeStyle(t){this.acceptStyle(t)&&(this.state.strokeStyle=t);}acceptStyle(t){return typeof t=="string"&&dt(t)!==null||t instanceof H||t instanceof V}get lineWidth(){return this.state.lineWidth}set lineWidth(t){Number.isFinite(t)&&t>0&&(this.state.lineWidth=t);}get lineCap(){return this.state.lineCap}set lineCap(t){(t==="butt"||t==="round"||t==="square")&&(this.state.lineCap=t);}get lineJoin(){return this.state.lineJoin}set lineJoin(t){(t==="miter"||t==="round"||t==="bevel")&&(this.state.lineJoin=t);}get miterLimit(){return this.state.miterLimit}set miterLimit(t){Number.isFinite(t)&&t>0&&(this.state.miterLimit=t);}get lineDashOffset(){return this.state.lineDashOffset}set lineDashOffset(t){Number.isFinite(t)&&(this.state.lineDashOffset=t);}get globalAlpha(){return this.state.globalAlpha}set globalAlpha(t){Number.isFinite(t)&&t>=0&&t<=1&&(this.state.globalAlpha=t);}get globalCompositeOperation(){return this.state.gco}set globalCompositeOperation(t){mn(t)&&(this.state.gco=t);}get font(){return this.state.font}set font(t){this.state.font=t;}get textAlign(){return this.state.textAlign}set textAlign(t){this.state.textAlign=t;}get textBaseline(){return this.state.textBaseline}set textBaseline(t){this.state.textBaseline=t;}get imageSmoothingEnabled(){return this.state.imageSmoothingEnabled}set imageSmoothingEnabled(t){this.state.imageSmoothingEnabled=!!t;}get imageSmoothingQuality(){return this.state.imageSmoothingQuality}set imageSmoothingQuality(t){this.state.imageSmoothingQuality=t;}setLineDash(t){!Array.isArray(t)||t.some(e=>!Number.isFinite(e)||e<0)||(this.state.lineDash=t.length%2?[...t,...t]:[...t]);}getLineDash(){return [...this.state.lineDash]}save(){this.stack.push({...this.state,transform:[...this.state.transform],lineDash:[...this.state.lineDash]});}restore(){let t=this.stack.pop();t&&(this.state=t);}getTransform(){let[t,e,r,o,s,i]=this.state.transform;return {a:t,b:e,c:r,d:o,e:s,f:i}}setTransform(t,e,r,o,s,i){let a=typeof t=="object"?[t.a??1,t.b??0,t.c??0,t.d??1,t.e??0,t.f??0]:[t,e,r,o,s,i];a.every(Number.isFinite)&&(this.state.transform=a);}resetTransform(){this.state.transform=[..._t];}transform(t,e,r,o,s,i){[t,e,r,o,s,i].every(Number.isFinite)&&(this.state.transform=et(this.state.transform,[t,e,r,o,s,i]));}translate(t,e){this.transform(1,0,0,1,t,e);}scale(t,e){this.transform(t,0,0,e,0,0);}rotate(t){let e=Math.cos(t),r=Math.sin(t);this.transform(e,r,-r,e,0,0);}beginPath(){this.path.reset();}closePath(){this.path.closePath();}moveTo(t,e){this.path.moveTo(this.state.transform,t,e);}lineTo(t,e){this.path.lineTo(this.state.transform,t,e);}bezierCurveTo(t,e,r,o,s,i){this.path.bezierCurveTo(this.state.transform,t,e,r,o,s,i);}quadraticCurveTo(t,e,r,o){this.path.quadraticCurveTo(this.state.transform,t,e,r,o);}arc(t,e,r,o,s,i=false){this.path.arc(this.state.transform,t,e,r,o,s,i);}arcTo(t,e,r,o,s){this.path.arcTo(this.state.transform,t,e,r,o,s);}ellipse(t,e,r,o,s,i,a,c=false){this.path.ellipse(this.state.transform,t,e,r,o,s,i,a,c);}rect(t,e,r,o){this.path.rect(this.state.transform,t,e,r,o);}flattened(){let t=this.path.segs,e=this.flatCache;if(e&&e.segs===t&&e.length===t.length)return e.polys;let r=ft(t,it);return this.flatCache={segs:t,length:t.length,polys:r},this.rowCache=null,r}strokeParams(){let t=this.state;return {lineWidth:t.lineWidth,lineCap:t.lineCap,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset}}surfaceBounds(){let t=this.state.clip,e={x0:0,y0:0,x1:this.canvas.width,y1:this.canvas.height};return t&&(e.x0=Math.max(e.x0,t.box.x0),e.y0=Math.max(e.y0,t.box.y0),e.x1=Math.min(e.x1,t.box.x1),e.y1=Math.min(e.y1,t.box.y1)),e}paintRings(t,e,r){if(!r||t.length===0)return;let o=this.surfaceBounds();if(o.x1<=o.x0||o.y1<=o.y0)return;let s=this.state.gco;if(un.has(s)){this.paintUnbounded(t,e,r,o);return}let i=this.state.globalAlpha;if(i<=0)return;let{data:a,width:c}=this.canvas,u=this.state.clip?.mask?this.state.clip:null,l=this.canvas.unknown,m=this.px,h=r.solid,b=h?null:r.shade,f=h?h[0]*i/255:0,p=h?h[1]*i/255:0,M=h?h[2]*i/255:0,x=h?h[3]*i/255:0;if(h&&x<=0&&(s==="source-over"||s==="destination-out"||s==="source-atop"||s==="lighter"||s==="xor"))return;let E=h!==void 0&&x>=1&&s==="source-over",d=E?this.canvas.words:null,A=h?pe(h[0],h[1],h[2],255):0;rt(t,e,o,(R,g,S,y)=>{let P=R*c;if(d&&y===255&&!u){d.fill(A,P+g,P+S),l&&l.fill(0,P+g,P+S);return}let T=(P+g)*4,C=P+g;for(let L=g;L<S;L++,T+=4,C++){let _=y;if(u&&(_=_*j(u,L,R)/255),_<=0)continue;let w=_>=255?1:_/255,I=f,D=p,N=M,X=x;if(b){if(!b(L,R,m))continue;I=m[0]*i/255,D=m[1]*i/255,N=m[2]*i/255,X=m[3]*i/255;}E&&w===1?(a[T]=h[0],a[T+1]=h[1],a[T+2]=h[2],a[T+3]=255):st(a,T,I,D,N,X,w,s),l&&l[C]&&w===1&&X>=.9999&&(s==="source-over"||s==="destination-out")&&(l[C]=0);}});}paintUnbounded(t,e,r,o){let s=o.x1-o.x0,i=o.y1-o.y0,a=new Uint8Array(s*i);rt(t,e,o,(p,M,x,E)=>{let d=(p-o.y0)*s-o.x0;a.fill(E,d+M,d+x);});let{data:c,width:u}=this.canvas,l=this.state.clip,m=this.canvas.unknown,h=this.state.globalAlpha,b=this.state.gco,f=this.px;for(let p=o.y0;p<o.y1;p++)for(let M=o.x0;M<o.x1;M++){let x=l?j(l,M,p)/255:1;if(x<=0)continue;let E=a[(p-o.y0)*s+(M-o.x0)]/255,d=0,A=0,R=0,g=0;if(E>0){r.solid?[d,A,R,g]=r.solid:r.shade(M,p,f)&&([d,A,R,g]=f);let y=E*h/255;d*=y,A*=y,R*=y,g*=y;}let S=p*u+M;st(c,S*4,d,A,R,g,x,b),m&&x>=1&&b==="copy"&&(m[S]=0);}}fill(t="nonzero"){let e=this.flattened();this.paintRings(e.map(r=>r.pts),t==="evenodd"?"evenodd":"nonzero",ot(this.state.fillStyle,this.state.transform,this.state.imageSmoothingEnabled));}stroke(){this.strokeSegs(this.path.segs,this.flattened());}strokeSegs(t,e){let r=ot(this.state.strokeStyle,this.state.transform,this.state.imageSmoothingEnabled);if(!r)return;let o=pn(this.state.transform,this.state.lineWidth);if(o===null){let l=Dt(e,this.state.transform,this.strokeParams(),it);this.paintRings(l,"nonzero",r);return}let s=Tn(ft(t,it,dn),this.state.transform,this.strokeParams()),i=this.state.lineCap==="square"?.5:this.state.lineCap==="round"?Math.PI/8:0,{width:a,height:c}=this.canvas,u=this.hairlinePlotter(r,o);for(let l of s){let m=l.pts.slice(),h=m.length>>1;if(h<2)continue;i&&!l.closed&&(Rn(m,0,1,i),Rn(m,h-1,h-2,i));let b=l.closed?h:h-1;for(let f=0;f<b;f++){let p=(f+1)%h;Mn(m[f*2],m[f*2+1],m[p*2],m[p*2+1],a,c,u);}}}hairlinePlotter(t,e){let{data:r,width:o,height:s}=this.canvas,i=this.state.clip,a=this.state.gco,c=this.state.globalAlpha*Math.min(1,e),u=this.px;return (l,m,h)=>{if(l<0||m<0||l>=o||m>=s)return;let b=h/255;if(i&&(b*=j(i,l,m)/255),b<=0)return;let f,p,M,x;if(t.solid)[f,p,M,x]=t.solid;else {if(!t.shade(l,m,u))return;[f,p,M,x]=u;}let E=c/255;st(r,(m*o+l)*4,f*E,p*E,M*E,x*E,b,a);}}rectRing(t,e,r,o){let s=this.state.transform,i=[[t,e],[t+r,e],[t+r,e+o],[t,e+o]],a=[];for(let[c,u]of i)a.push(s[0]*c+s[2]*u+s[4],s[1]*c+s[3]*u+s[5]);return a}fillRect(t,e,r,o){![t,e,r,o].every(Number.isFinite)||r===0||o===0||this.paintRings([this.rectRing(t,e,r,o)],"nonzero",ot(this.state.fillStyle,this.state.transform,this.state.imageSmoothingEnabled));}strokeRect(t,e,r,o){if(![t,e,r,o].every(Number.isFinite))return;let s=new nt;s.rect(this.state.transform,t,e,r,o),this.strokeSegs(s.segs,ft(s.segs,it));}clearRect(t,e,r,o){if(![t,e,r,o].every(Number.isFinite)||r===0||o===0)return;let s={gco:this.state.gco,ga:this.state.globalAlpha};this.state.gco="destination-out",this.state.globalAlpha=1,this.paintRings([this.rectRing(t,e,r,o)],"nonzero",{solid:[0,0,0,255]}),this.state.gco=s.gco,this.state.globalAlpha=s.ga;}clip(t="nonzero"){let e=this.surfaceBounds(),r=this.state.clip,o=this.flattened().filter(u=>u.pts.length>=6).map(u=>u.pts),s={box:{x0:0,y0:0,x1:0,y1:0},mask:null},i=o.length===1?de(o[0]):null;if(i){let u={x0:Math.max(e.x0,i.x0),y0:Math.max(e.y0,i.y0),x1:Math.min(e.x1,i.x1),y1:Math.min(e.y1,i.y1)};if(u.x1<=u.x0||u.y1<=u.y0){this.state.clip=s;return}let l=null;if(r?.mask){let m=u.x1-u.x0;l=new Uint8Array(m*(u.y1-u.y0));for(let h=u.y0;h<u.y1;h++)for(let b=u.x0;b<u.x1;b++)l[(h-u.y0)*m+(b-u.x0)]=j(r,b,h);}this.state.clip={box:u,mask:l};return}let a=s,c=null;for(let u of o)for(let l=0;l+1<u.length;l+=2){let m=u[l],h=u[l+1];c??(c={x0:1/0,y0:1/0,x1:-1/0,y1:-1/0}),c.x0=Math.min(c.x0,m),c.y0=Math.min(c.y0,h),c.x1=Math.max(c.x1,m),c.y1=Math.max(c.y1,h);}if(c&&Number.isFinite(c.x0+c.x1+c.y0+c.y1)){let u={x0:Math.max(e.x0,Math.floor(c.x0)),y0:Math.max(e.y0,Math.floor(c.y0)),x1:Math.min(e.x1,Math.ceil(c.x1)),y1:Math.min(e.y1,Math.ceil(c.y1))};if(u.x1>u.x0&&u.y1>u.y0){let l=u.x1-u.x0,m=new Uint8Array(l*(u.y1-u.y0));rt(o,t==="evenodd"?"evenodd":"nonzero",u,(b,f,p,M)=>{let x=(b-u.y0)*l-u.x0;if(!r?.mask){m.fill(M,x+f,x+p);return}for(let E=f;E<p;E++)m[x+E]=Math.round(M*j(r,E,b)/255);})&&(a={box:u,mask:m});}}this.state.clip=a;}clipCoverage(t,e,r,o){let s=this.state.clip;if(!s)return null;let i=new Uint8Array(Math.max(0,r*o));for(let a=0;a<o;a++)for(let c=0;c<r;c++)i[a*r+c]=j(s,t+c,e+a);return i}isPointInPath(t,e,r="nonzero"){if(!Number.isFinite(t)||!Number.isFinite(e))return false;let o=this.flattened(),s=`${e}`,i=this.rowCache;if(!i||i.key!==s){let u=[],l=[];for(let f of o){let p=f.pts,M=p.length>>1;if(!(M<2))for(let x=0;x<M;x++){let E=x+1<M?x+1:0,d=p[x*2],A=p[x*2+1],R=p[E*2],g=p[E*2+1];(A<=e?g>e:g<=e)&&(u.push(d+(e-A)*(R-d)/(g-A)),l.push(g>A?1:-1));}}let m=u.map((f,p)=>p).sort((f,p)=>u[f]-u[p]),h=new Float64Array(m.length),b=new Int32Array(m.length+1);for(let f=0;f<m.length;f++)h[f]=u[m[f]];for(let f=m.length-1;f>=0;f--)b[f]=b[f+1]+l[m[f]];i={key:s,xs:h,suffixWinding:b,count:m.length},this.rowCache=i;}let a=0,c=i.count;for(;a<c;){let u=a+c>>1;i.xs[u]>t?c=u:a=u+1;}return r==="evenodd"?(i.count-a&1)===1:i.suffixWinding[a]!==0}isPointInStroke(t,e){let r=Dt(this.flattened(),this.state.transform,this.strokeParams(),it);return tn(r.map(o=>({pts:o,smooth:[],closed:true})),t,e,"nonzero")}createLinearGradient(t,e,r,o){return new H("linear",[t,e,r,o])}createRadialGradient(t,e,r,o,s,i){if(r<0||i<0)throw new RangeError("The radius provided is negative");return new H("radial",[t,e,r,o,s,i])}createPattern(t,e){let r=Bt(t);if(!r)return null;let o=e==="repeat-x"||e==="repeat-y"||e==="no-repeat"?e:"repeat";return new V(r.data.slice(),r.width,r.height,o)}measureText(t){let e=It(this.state.font).size,r=Ot(String(t),e);return {width:r,actualBoundingBoxLeft:0,actualBoundingBoxRight:r,actualBoundingBoxAscent:e*.8,actualBoundingBoxDescent:e*.2,fontBoundingBoxAscent:e*.9,fontBoundingBoxDescent:e*.25}}fillText(t,e,r,o){this.recordText(t,e,r,o,this.state.fillStyle);}strokeText(t,e,r,o){this.recordText(t,e,r,o,this.state.strokeStyle);}recordText(t,e,r,o,s){let i=String(t??"");if(!i.trim()||![e,r].every(Number.isFinite)||this.state.globalAlpha<=0)return;let a=ot(s,this.state.transform,true);if(!a||a.solid&&a.solid[3]<=0)return;this.canvas.textDraws++;let c=nn(i,e,r,this.state.font,this.state.textAlign,this.state.textBaseline,o),u=this.state.transform,l=[];for(let[m,h]of [[c.x0,c.y0],[c.x1,c.y0],[c.x1,c.y1],[c.x0,c.y1]])l.push(u[0]*m+u[2]*h+u[4],u[1]*m+u[3]*h+u[5]);this.canvas.markUnknown(l,this.state.clip);}drawImage(t,...e){let r=Bt(t);if(!r)return;(t===this.canvas||t===this)&&(r={...r,data:r.data.slice()});let o=0,s=0,i=r.width,a=r.height,c,u,l,m;if(e.length>=8?[o,s,i,a,c,u,l,m]=e:e.length>=4?[c,u,l,m]=e:([c,u]=e,l=i,m=a),![o,s,i,a,c,u,l,m].every(Number.isFinite)||!i||!a||!l||!m)return;i<0&&(o+=i,i=-i),a<0&&(s+=a,a=-a),l<0&&(c+=l,l=-l),m<0&&(u+=m,m=-m);let h=l/i,b=m/a,f=Math.max(0,o),p=Math.max(0,s),M=Math.min(r.width,o+i),x=Math.min(r.height,s+a);if(M<=f||x<=p)return;c+=(f-o)*h,u+=(p-s)*b,o=f,s=p,i=M-f,a=x-p;let E=[h,0,0,b,c-o*h,u-s*b],d=et(this.state.transform,E),A=wt({data:r.data,width:r.width,height:r.height,wrapX:false,wrapY:false,minX:Math.floor(o),minY:Math.floor(s),maxX:Math.ceil(o+i),maxY:Math.ceil(s+a),transparentOutside:false,smooth:this.state.imageSmoothingEnabled},d),R=d,g=[];for(let[S,y]of [[o,s],[o+i,s],[o+i,s+a],[o,s+a]])g.push(R[0]*S+R[2]*y+R[4],R[1]*S+R[3]*y+R[5]);this.paintRings([g],"nonzero",A);}createImageData(t,e){let r=Math.abs(Math.floor(t))||1,o=Math.abs(Math.floor(e))||1;return {data:new Uint8ClampedArray(r*o*4),width:r,height:o}}getImageData(t,e,r,o){let s=Math.floor(t),i=Math.floor(e),a=Math.floor(r),c=Math.floor(o);return a<0&&(s+=a,a=-a),c<0&&(i+=c,c=-c),{data:this.canvas.readRgba(s,i,a,c),width:a,height:c,colorSpace:"srgb"}}putImageData(t,e,r,o=0,s=0,i=t.width,a=t.height){let{width:c,height:u,data:l}=this.canvas,m=this.canvas.unknown,h=Math.round(e),b=Math.round(r);i<0&&(o+=i,i=-i),a<0&&(s+=a,a=-a);let f=Math.max(0,Math.floor(o)),p=Math.max(0,Math.floor(s)),M=Math.min(t.width,Math.floor(o+i)),x=Math.min(t.height,Math.floor(s+a)),E=t.data;for(let d=p;d<x;d++){let A=b+d;if(!(A<0||A>=u))for(let R=f;R<M;R++){let g=h+R;if(g<0||g>=c)continue;let S=(d*t.width+R)*4,y=(A*c+g)*4,P=E[S+3];if(P===255)l[y]=E[S],l[y+1]=E[S+1],l[y+2]=E[S+2];else {let T=P/255;l[y]=E[S]*T,l[y+1]=E[S+1]*T,l[y+2]=E[S+2]*T;}l[y+3]=P,m&&(m[A*c+g]=0);}}}};function Pr(n,t,e){let r=o=>o.toString(16).padStart(2,"0");return `#${r(n&255)}${r(t&255)}${r(e&255)}`}function Cr(n){let t=(n>>>24&255)/255,e=n>>>16&255,r=n>>>8&255,o=n&255;return `rgba(${e},${r},${o},${t.toFixed(3)})`}function Lr(n,t,e){let r=Math.min(1,Math.max(0,e)),o=(m,h)=>Math.round(m+(h-m)*r),s=n>>>24&255,i=t>>>24&255,a=o(n>>>16&255,t>>>16&255),c=o(n>>>8&255,t>>>8&255),u=o(n&255,t&255),l=o(s,i)/255;return `rgba(${a},${c},${u},${l.toFixed(3)})`}function Sn(n){let t=/^#([0-9a-f]{6})$/i.exec(n);if(t)return `#${(16777215^parseInt(t[1],16)).toString(16).padStart(6,"0")}`;let e=/^#([0-9a-f]{3})$/i.exec(n);if(e){let[o,s,i]=e[1].split("").map(c=>parseInt(c+c,16)),a=c=>(255-c).toString(16).padStart(2,"0");return `#${a(o)}${a(s)}${a(i)}`}let r=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+)\s*)?\)$/i.exec(n);if(r){let o=255-Math.min(255,parseInt(r[1],10)),s=255-Math.min(255,parseInt(r[2],10)),i=255-Math.min(255,parseInt(r[3],10));return r[4]!==void 0?`rgba(${o},${s},${i},${r[4]})`:`rgb(${o},${s},${i})`}return n}function yn(n,t,e,r,o,s,i,a,c,u){let l=0,m=o-1,h=t,b=t+e;for(;h+1<b&&m>=0;){let f=n.getUint8(h),p=n.getUint8(h+1);if(h+=2,f===0)if(p===0)l=0,m--;else {if(p===1)break;if(p===2){if(h+1>=b)break;l+=n.getUint8(h),m-=n.getUint8(h+1),h+=2;}else {let M=p;if(i){let x=Math.ceil(M/2),E=0;for(let d=0;d<x&&h<b;d++){let A=n.getUint8(h++);for(let R=0;R<2&&E<M;R++){let g=R===0?A>>4&15:A&15;g<a.length&&l<r&&u(l,o-1-m,a[g][0],a[g][1],a[g][2],255),l++,E++;}}x&1&&h++;}else {for(let x=0;x<M&&h<b&&l<r;x++){let E=n.getUint8(h++);E<a.length&&u(l,o-1-m,a[E][0],a[E][1],a[E][2],255),l++;}M&1&&h++;}}}else if(i){let M=p>>4&15,x=p&15;for(let E=0;E<f&&l<r;E++){let d=(E&1)===0?M:x;d<a.length&&u(l,o-1-m,a[d][0],a[d][1],a[d][2],255),l++;}}else {let M=p,x=M<a.length?a[M]:[0,0,0];for(let E=0;E<f&&l<r;E++)u(l,o-1-m,x[0],x[1],x[2],255),l++;}}return ct(new Uint8ClampedArray(c.buffer,c.byteOffset,c.byteLength),r,o)}function Gt(n){if(n===0)return 0;let t=0,e=n;for(;(e&1)===0;)e>>>=1,t++;return t}var Me=3;function An(n,t,e,r,o){let s=0,i=0,a=0,c=0,u=0,l=0,m=1,h=1,b=1;if(r===Me){let f=t+e;if(f+12>n.byteLength)return null;s=n.getUint32(f,true),i=n.getUint32(f+4,true),a=n.getUint32(f+8,true),c=Gt(s),u=Gt(i),l=Gt(a),m=s>>>c||1,h=i>>>u||1,b=a>>>l||1;}else o===16&&(s=31744,i=992,a=31,c=10,u=5,l=0,m=31,h=31,b=31);return {rMask:s,gMask:i,bMask:a,rShift:c,gShift:u,bShift:l,rMax:m,gMax:h,bMax:b}}function Pn(n,t,e,r,o,s,i,a,c,u=false){let l=Math.floor((s*e+31)/32)*4,{rMask:m,gMask:h,bMask:b,rShift:f,gShift:p,bShift:M,rMax:x,gMax:E,bMax:d}=a;for(let A=0;A<r;A++){let R=o?A:r-1-A,g=t+R*l;if(!(g+l>n.byteLength))for(let S=0;S<e;S++){let y=(A*e+S)*4;if(s===1){let P=g+(S>>3),T=n.getUint8(P)>>7-(S&7)&1;T<i.length&&(c[y]=i[T][0],c[y+1]=i[T][1],c[y+2]=i[T][2]),c[y+3]=255;}else if(s===4){let P=g+(S>>1),T=(S&1)===0?n.getUint8(P)>>4&15:n.getUint8(P)&15;T<i.length&&(c[y]=i[T][0],c[y+1]=i[T][1],c[y+2]=i[T][2]),c[y+3]=255;}else if(s===8){let P=n.getUint8(g+S);P<i.length&&(c[y]=i[P][0],c[y+1]=i[P][1],c[y+2]=i[P][2]),c[y+3]=255;}else if(s===16){let P=n.getUint16(g+S*2,true);c[y]=Math.round(((P&m)>>>f)*255/x),c[y+1]=Math.round(((P&h)>>>p)*255/E),c[y+2]=Math.round(((P&b)>>>M)*255/d),c[y+3]=255;}else if(s===24){let P=g+S*3;c[y]=n.getUint8(P+2),c[y+1]=n.getUint8(P+1),c[y+2]=n.getUint8(P),c[y+3]=255;}else {let P=g+S*4,T=n.getUint8(P),C=n.getUint8(P+1),L=n.getUint8(P+2),_=n.getUint8(P+3);c[y]=L,c[y+1]=C,c[y+2]=T,c[y+3]=_===0&&!u?255:_;}}}}function Et(n,t,e,r,o,s=false){if(t<0||e<0||t+40>n.byteLength||e+r>n.byteLength)return null;let i=n.getUint32(t,true);if(i<40||t+i>n.byteLength)return null;let a=n.getInt32(t+4,true),c=n.getInt32(t+8,true),u=n.getUint16(t+12,true),l=n.getUint16(t+14,true),m=n.getUint32(t+16,true);if(u!==1||a<=0||c===0||a>8192||Math.abs(c)>8192)return null;let h=0,b=1,f=2,p=3;if(l!==1&&l!==4&&l!==8&&l!==16&&l!==24&&l!==32||m===b&&l!==8||m===f&&l!==4||m===p&&l!==16&&l!==32||m!==h&&m!==b&&m!==f&&m!==p)return null;let M=Math.abs(c),x=c<0,E=[];if(l<=8){let R=1<<l,g=n.getUint32(t+32,true)||R,S=Math.min(g,R),y=t+i,P=!!o&&o.length>0;if(y+S*(P?2:4)>n.byteLength)return null;for(let T=0;T<S;T++){if(P){let w=n.getUint16(y+T*2,true),I=o[w<o.length?w:0];E.push([I>>16&255,I>>8&255,I&255]);continue}let C=n.getUint8(y+T*4),L=n.getUint8(y+T*4+1),_=n.getUint8(y+T*4+2);E.push([_,L,C]);}}let d=An(n,t,i,m,l);if(!d)return null;let A=new Uint8ClampedArray(a*M*4);return m===b||m===f?yn(n,e,r,a,M,x,m===f,E,A,(g,S,y,P,T,C)=>{let L=(S*a+g)*4;A[L]=y,A[L+1]=P,A[L+2]=T,A[L+3]=C;}):(Pn(n,e,a,M,x,l,E,d,A,s),ct(A,a,M))}var Cn=[[0,0,0,255,0,0,0,0],[8,8,8,8,8,8,8,8],[128,64,32,16,8,4,2,1],[1,2,4,8,16,32,64,128],[8,8,8,255,8,8,8,8],[129,66,36,24,24,36,66,129]];function Ee(n,t,e){return ((Cn[n]??Cn[0])[e&7]>>7-(t&7)&1)===1}function gt(n){let t=/^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(n.trim());if(!t)return 0;let e=t[1].length===3?t[1].replace(/./g,r=>r+r):t[1];return parseInt(e,16)}function ge(n,t,e){if(t+16>n.byteLength)return null;let r=n.getInt32(t+4,true),o=n.getInt32(t+8,true),s=n.getUint16(t+14,true),i=Math.abs(o);if(s!==1||r<=0||i===0||r>256||i>256)return null;let a=(r+31>>5)*4;if(e+a*i>n.byteLength)return null;let c=new Uint8Array(r*i);for(let u=0;u<i;u++){let l=o>0?i-1-u:u,m=e+u*a;for(let h=0;h<r;h++)c[l*r+h]=n.getUint8(m+(h>>3))>>7-(h&7)&1;}return {width:r,height:i,bits:c}}function kr(n,t,e,r,o=null){if(e+24>n.byteLength)return null;let s=n.getUint32(e+8,true),i=n.getUint32(e+16,true),a=n.getUint32(e+20,true),c=t+s,u=t+i,l=c+16<=n.byteLength?n.getUint16(c+14,true):0;if(r||l===1){let f=ge(n,c,u);if(f&&r)return {kind:"mono",...f}}let m=Et(n,c,u,a,o);if(!m)return null;let h=new Uint32Array(m.width*m.height),b=m.data;for(let f=0;f<h.length;f++)h[f]=b[f*4]<<16|b[f*4+1]<<8|b[f*4+2];return {kind:"bitmap",width:m.width,height:m.height,rgb:h}}function Ln(n){if(n.brushStyle===1)return {kind:"none"};let t=n.brushPattern;if(!t)return {kind:"solid",rgb:gt(n.brushColor)};if(t.kind==="bitmap")return {kind:"tile",width:t.width,height:t.height,rgb:t.rgb};let e=gt(n.bkColor);if(t.kind==="hatch"){let s=gt(n.brushColor),i=new Uint32Array(64);for(let a=0;a<8;a++)for(let c=0;c<8;c++)i[a*8+c]=Ee(t.hatch,c,a)?s:e;return {kind:"tile",width:8,height:8,rgb:i}}let r=gt(n.textColor),o=new Uint32Array(t.width*t.height);for(let s=0;s<o.length;s++)o[s]=t.bits[s]?e:r;return {kind:"tile",width:t.width,height:t.height,rgb:o}}function Br(n,t,e,r,o){let s=((t-r)%n.width+n.width)%n.width,i=((e-o)%n.height+n.height)%n.height;return n.rgb[i*n.width+s]}function Xr(n){let t=[],e=0;for(let r=0;r<n.length;r++)t.push(e),e+=n[r];return t}function $r(n){let t=0;for(let e of n)t+=e;return t}function Wr(n,t,e,r){let o=n.slice();if(e===0||r<=0)return o;let s=0;for(let i=0;i<o.length&&i<t.length;i++){if(t[i]!==32)continue;let a=Math.round(s*e/r);s++;let c=Math.round(s*e/r);o[i]+=c-a;}return o}function Yr(n,t){return t==="center"?-n/2:t==="right"?-n:0}var Te=Math.PI/180;function Hr(n){let e=(n%3600+3600)%3600*Xt/3600,r=Math.floor(e),o=e-r,s=r*2*Math.PI/Xt,i=(r+1)*2*Math.PI/Xt;return o===0?{sin:Math.sin(s),cos:Math.cos(s)}:{sin:(1-o)*Math.sin(s)+o*Math.sin(i),cos:(1-o)*Math.cos(s)+o*Math.cos(i)}}var Xt=128;function zr(n){return -(n/10)*Te}var Re=1.15;function _n(n){return n===0?0:n<0?-n:n/Re}var ut=(...n)=>{},q=(...n)=>{};var In=true;async function On(n){try{if(n[0]===255&&n[1]===216){let{decodeJpegPixels:t}=await import('./jpeg-decoder-GGVNSSPW.js'),e=await t(n);return chunkQX63UNWK_js.a(e.width,e.height)?{...e,data:new Uint8ClampedArray(e.data)}:null}if(n.length>=20&&n[0]===82&&n[1]===73&&n[2]===70&&n[3]===70&&n[8]===87&&n[9]===69&&n[10]===66&&n[11]===80){let{decodeWebp:t}=await import('./webp-decoder-FY74YL2U.js');return t(n)}if(n.length>=13&&/^GIF8[79]a$/.test(String.fromCharCode(...n.subarray(0,6)))){let{decodeGif:t}=await import('./gif-decoder-ZZ27IQG6.js');return t(n)}if(n.length>=8&&(n[0]===73&&n[1]===73&&n[2]===42&&n[3]===0||n[0]===77&&n[1]===77&&n[2]===0&&n[3]===42)){let{decodeTiff:t}=await import('./tiff-decoder-Q6MTIHDV.js');return await t(n)}}catch{return null}return null}var Yt=class{constructor(){this.data=new Int32Array(96);this.length=0;}add(t,e,r){if(r<=e)return;let o=this.length*3;if(o>0&&this.data[o-3]===t&&this.data[o-1]===e){this.data[o-1]=r;return}if(o+3>this.data.length){let s=new Int32Array(this.data.length*2);s.set(this.data),this.data=s;}this.data[o]=t,this.data[o+1]=e,this.data[o+2]=r,this.length++;}append(t){for(let e=0;e<t.length*3;e+=3)this.add(t.data[e],t.data[e+1],t.data[e+2]);}bounds(){if(this.length===0)return null;let t=1/0,e=1/0,r=-1/0,o=-1/0,s=this.data;for(let i=0;i<this.length*3;i+=3)s[i]<e&&(e=s[i]),s[i]+1>o&&(o=s[i]+1),s[i+1]<t&&(t=s[i+1]),s[i+2]>r&&(r=s[i+2]);return {x0:t,y0:e,x1:r,y1:o}}};function vn(n,t){return Math.floor(n/t)}function lt(n,t){return -Math.floor(-n/t)}function Se(n,t,e=new Yt,r=-1/0,o=1/0){let s=[],i=1/0,a=-1/0;for(let f of n){let p=f.length>>1;if(!(p<2))for(let M=0;M<p;M++){let x=M+1===p?0:M+1,E=f[M*2],d=f[M*2+1],A=f[x*2],R=f[x*2+1];if(d===R)continue;let g=R>d?1:-1,S=g>0?E:A,y=g>0?d:R,P=g>0?A:E,T=g>0?R:d,C=lt(y,16),L=lt(T,16);L<=C||(s.push([C,L,S,y,P-S,T-y,g]),C<i&&(i=C),L>a&&(a=L));}}if(s.length===0)return e;s.sort((f,p)=>f[0]-p[0]);let c=Math.max(i,Math.ceil(r)),u=Math.min(a,Math.floor(o)),l=[],m=0,h=[],b=[];for(;m<s.length&&s[m][1]<=c;)m++;for(let f=c;f<u;f++){for(;m<s.length&&s[m][0]<=f;)s[m][1]>f&&l.push(s[m]),m++;for(let x=l.length-1;x>=0;x--)(l[x][1]<=f||l[x][0]>f)&&l[x][1]<=f&&l.splice(x,1);h.length=0,b.length=0;let p=f*16;for(let x of l){if(x[0]>f)continue;let E=x[2]*x[5]+(p-x[3])*x[4];h.push(lt(E,x[5]*16)),b.push(x[6]);}let M=h.length;if(!(M<2)){for(let x=1;x<M;x++){let E=h[x],d=b[x],A=x-1;for(;A>=0&&h[A]>E;)h[A+1]=h[A],b[A+1]=b[A],A--;h[A+1]=E,b[A+1]=d;}if(t){let x=0,E=0;for(let d=0;d<M;d++){let A=x;x+=b[d],A===0&&x!==0?E=h[d]:A!==0&&x===0&&e.add(f,E,h[d]);}}else for(let x=0;x+1<M;x+=2)e.add(f,h[x],h[x+1]);}}return e}function ye(n,t){return Math.abs(n)!==Math.abs(t)?10:t>0?2:n>0?136:68}function wn(n,t,e,r){let o=Math.abs(n)+Math.abs(t),s=8*e;if(o<s)return true;if(o>s)return false;let i;return n===0?i=t<0?1:2:t===0?i=n<0?4:8:n<0?i=t<0?16:64:i=t<0?32:128,(r&i)!==0}function Nn(n,t,e,r,o){let s=e-n,i=r-t;if(s===0&&i===0)return;let a=ye(s,i),c=Math.abs(s)>=Math.abs(i),u=c?n:t,l=c?t:n,m=c?e:r,h=c?r:e,b=m>u?1:-1,f=Math.abs(m-u),p=(h-l)*b,M=Math.abs(s)===Math.abs(i),x=Math.min(u,m),E=Math.max(u,m),d=(g,S,y)=>c?wn(g,S,y,a):wn(S,g,y,a),A=b>0?vn(x,16)-1:lt(E,16)+1,R=b>0?lt(E,16)+1:vn(x,16)-1;for(let g=A;b>0?g<=R:g>=R;g+=b){let S=g*16,y=l*f+(S-u)*p,P=y/f/16,T=Math.round(P);for(let C=T-1;C<=T+1;C++){let L=C*16,_=y-L*f,w=x-S,I=E-S,D;if(M){let N=p/f,X=_/f,B=Math.max(w,Math.min(0,I)),k=Math.max(w,Math.min(-X/N,I));D=d(2*B,2*(X+N*B),2)||d(2*k,2*(X+N*k),2)||d(B+k,2*X+N*(B+k),2);}else {let N=Math.max(w,Math.min(0,I));D=d(N*f,_+N*p,f);}D&&(d(m-S,h-L,1)||(c?o(g,C):o(C,g)));}}}var Fn=10,$t=3,kn=6*10912,Ae=kn*8;function $(n,t){return Math.floor(n/2**t)}var yt=class{constructor(t,e,r,o){let s=2**Fn;this.e0=t*s,this.e1=(o-t)*s,this.e2=6*(e-r-r+o)*s,this.e3=6*(t-e-e+r)*s;}lazyHalve(t){this.e2=$(this.e2+this.e3,1),this.e1=$(this.e1-$(this.e2,t),1);}steadyState(t){let e=2**$t;this.e0*=e,this.e1*=e;let r=t-$t;r<0?(this.e2*=2**-r,this.e3*=2**-r):(this.e2=$(this.e2,r),this.e3=$(this.e3,r));}halve(){this.e2=$(this.e2+this.e3,3),this.e1=$(this.e1-this.e2,1),this.e3=$(this.e3,2);}double(){this.e1+=this.e1+this.e2,this.e3*=4,this.e2=this.e2*8-this.e3;}step(){this.e0+=this.e1;let t=this.e2;this.e1+=t,this.e2+=t-this.e3,this.e3=t;}error(){return Math.max(Math.abs(this.e2),Math.abs(this.e3))}parentErrorDividedBy4(){return Math.max(Math.abs(this.e3),Math.abs(this.e2+this.e2-this.e3))}value(){let t=Fn+$t;return $(this.e0+2**(t-1),t)}};function Bn(n,t,e,r,o,s,i,a,c,u=1){let l=kn*u,m=Ae*u,h=new yt(n,e,o,i),b=new yt(t,r,s,a),f=1,p=0;for(;p<40&&(h.error()>l*2**p||b.error()>l*2**p);)p+=2,h.lazyHalve(p),b.lazyHalve(p),f*=2;h.steadyState(p),b.steadyState(p);for(let M=0;f>0&&M<1<<20;M++){for(Math.max(h.error(),b.error())>m&&(h.halve(),b.halve(),f*=2);f%2===0&&h.parentErrorDividedBy4()<=m/4&&b.parentErrorDividedBy4()<=m/4;)h.double(),b.double(),f/=2;f--,h.step(),b.step(),c.push(h.value(),b.value());}}var W=.5522847498307936;function At(n,t,e,r){return {ax:n,ay:t,exx:e-n,exy:0,eyx:0,eyy:r-t}}function Ht(n,t=false){if(!t)return Xn(n,false);let{halfX:e,...r}=n,o=Gn(r),s=[];for(let a=o.length-2;a>=0;a-=2)s.push(o[a],o[a+1]);let i=Math.abs(r.exx)%2;if(s[18]+=i,s[6]-=i,e)for(let a of [0,1,2,3,4,5,12])s[2*a]++;return s}function Gn(n){return Xn(n,true)}function Xn(n,t){let e=(T,C)=>C?Math.ceil(T/2):Math.floor(T/2),r=T=>e(T,false),o=T=>e(T,true),s=T=>Math.floor(T/2)+Math.ceil(W*Math.ceil(T/2)),i=T=>Math.ceil(T/2)-Math.ceil(W*Math.ceil(T/2)),a=T=>e(T,false),c=T=>e(T,true),u=T=>Math.floor(T/2)-Math.floor(W*Math.floor(T/2)),l=T=>T-u(T),m=T=>T%2===0?Math.ceil(W*Math.floor(T/2)):Math.floor(W*Math.ceil(T/2)),h=t?T=>a(T)-m(T):u,b=t?T=>a(T)-m(T):u,f=t?T=>c(T)+m(T):l,p=t?T=>c(T)+m(T):l,M=()=>0,x=T=>T,{ax:E,ay:d,exx:A,exy:R,eyx:g,eyy:S}=n,y=[],P=(T,C)=>{y.push(E+T(A)+C(g),d+T(R)+C(S));};if(P(x,c),P(x,h),P(s,M),P(r,M),P(i,M),P(M,b),P(M,a),P(M,f),P(i,x),P(o,x),P(s,x),P(x,p),P(x,c),n.halfX)for(let T of [0,1,2,3,4,5,12])y[2*T]++;return y}function Pe(n,t,e,r){return Ht(At(n,t,e,r))}function Zr(n){let t=[n[0],n[1]];for(let e=2;e+5<n.length;e+=6)Bn(n[e-2],n[e-1],n[e],n[e+1],n[e+2],n[e+3],n[e+4],n[e+5],t);return t}function Qr(n,t,e,r,o,s,i=false,a=false,c=false,u){let l=e-n,m=r-t;if(u){let g=(y,P)=>Math.floor(Math.fround(y*P)+.5),S=c?Math.floor(l/2):Math.ceil(l/2);o=2*Math.min(g(S,u[0]),S),s=2*Math.min(g(a?Math.ceil(m/2):Math.floor(m/2),u[1]),a?Math.ceil(m/2):Math.floor(m/2));}let h=Math.min(Math.abs(o),l),b=Math.min(Math.abs(s),m);(h===0||b===0)&&(h=0,b=0);let f=i||a?Math.round(b/2):Math.floor(m/2)-Math.floor((m-b)/2),p=i?Math.round(e-h/2):Math.floor(e-h/2),M=e-p,x=a?Math.ceil(W*f):Math.floor(W*f),E=c?Math.floor(W*M):Math.ceil(W*M),d=[e,t+f,e,t+f-x,e-M+E,t,p,t],A=g=>n+e-g,R=g=>t+r-g;return [d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],A(d[6]),d[7],A(d[4]),d[5],A(d[2]),d[3],A(d[0]),d[1],A(d[0]),R(d[1]),A(d[2]),R(d[3]),A(d[4]),R(d[5]),A(d[6]),R(d[7]),d[6],R(d[7]),d[4],R(d[5]),d[2],R(d[3]),d[0],R(d[1])]}var zt=2*Math.PI/128,Tt=n=>J(n)[0],Rt=n=>J(n)[1];function Ce(n,t){let e=[],r=(a,c)=>{if(Math.abs(c-a)<90){e.push({from:a,to:c,first:true});return}let u=Math.min(a,c),l=Math.max(a,c),m=Math.floor(l/90)-Math.floor(u/90)+1,h=[];for(let f=Math.floor(u/90)+1;f*90<l;f++)h.push(f*90);c<a&&h.reverse();let b=[a,...h,c];for(;b.length-1<m;)b.push(c);for(let f=0;f+1<b.length;f++)e.push({from:b[f],to:b[f+1],first:f===0});},o=t<0?-1:1,s=Math.min(8,Math.trunc(Math.abs(t)/360)),i=n+t-o*s*360;r(n,i);for(let a=1;a<=s;a++)r(i+o*360*(a-1),n+o*360*a),r(n+o*360*a,i+o*360*a);return e}function to(n,t,e,r,o,s){let i=o*Math.PI/180,a=s*Math.PI/180,c=4/3*Math.tan((a-i)/4),u=n+e*Tt(i),l=t-r*Rt(i),m=n+e*Tt(a),h=t-r*Rt(a);return [u-c*e*Rt(i),l-c*r*Tt(i),m+c*e*Rt(a),h+c*r*Tt(a),m,h]}function no(n,t,e){let r=Math.min(n.ax,n.ax+n.exx),o=Math.min(n.ay,n.ay+n.eyy),s=Math.abs(n.exx),i=Math.abs(n.eyy),a=r+s/2,c=o+i/2,u=Pe(r,o,r+s,o+i),l=Gn(At(r,o,r+s,o+i)),m=t*Math.PI/180,h=Math.abs(e)<=3?[Math.cos(m),Math.sin(m)]:J(m),b=[Math.round(a+s/2*h[0]),Math.round(c-i/2*h[1])];for(let f of Ce(t,e)){let p=f.to-f.from;if(!f.first&&Math.abs(p)===90&&f.from%90===0){let E=(Math.min(f.from,f.to)/90%4+4)%4*6;p>0?b.push(u[E+2],u[E+3],u[E+4],u[E+5],u[E+6],u[E+7]):b.push(l[E+4],l[E+5],l[E+2],l[E+3],l[E],l[E+1]);continue}let M=$n(f.from*Math.PI/180,f.to*Math.PI/180,Math.abs(e)<=3);for(let x=0;x<6;x+=2)b.push(Math.round(a+s/2*M.ctrl[x]),Math.round(c-i/2*M.ctrl[x+1]));}return b}var Le=3*Math.PI/180,St=(()=>{let n=[],t=[];for(let e=0;e<=129;e++)n.push(Math.fround(Math.cos(e*zt))),t.push(Math.fround(Math.sin(e*zt)));for(let e=0;e<=128;e+=32)n[e]=[1,0,-1,0,1][e/32],t[e]=[0,1,0,-1,0][e/32];return {cos:n,sin:t}})();function J(n){let t=n%(2*Math.PI);t<0&&(t+=2*Math.PI);let e=Math.fround(t/zt),r=Math.min(127,Math.floor(e)),o=e-r;return [St.cos[r]*(1-o)+St.cos[r+1]*o,St.sin[r]*(1-o)+St.sin[r+1]*o]}var Wt=Array.from({length:33},(n,t)=>Math.atan(t/32));function Un(n){let t=n*32,e=Math.min(31,Math.floor(t));return Wt[e]+(Wt[e+1]-Wt[e])*(t-e)}function _e(n,t){let e=Math.abs(n),r=Math.abs(t);if(e===0&&r===0)return 0;let o=r<=e?Un(Math.fround(r/e)):Math.PI/2-Un(Math.fround(e/r));return n>=0?t>=0?o:2*Math.PI-o:t>=0?Math.PI-o:Math.PI+o}function $n(n,t,e,r=1/0){let o=e?u=>[Math.cos(u),Math.sin(u)]:J,s=o(n),i=o(t);if(e&&6e-8*r/Math.abs(Math.sin(t-n))>.5){let u=Math.fround,l=[u(s[0]),u(s[1])],m=[u(i[0]),u(i[1])],h=u(u(l[0]*m[1])-u(l[1]*m[0]));if(h!==0){let b=[u(u(m[1]-l[1])/h),u(u(l[0]-m[0])/h)],f=u(J(Math.abs(t-n)/2)[0]),p=u(u(u(4/3)*f)/u(1+f));return {start:s,ctrl:[u(l[0]+u(p*u(b[0]-l[0]))),u(l[1]+u(p*u(b[1]-l[1]))),u(m[0]+u(p*u(b[0]-m[0]))),u(m[1]+u(p*u(b[1]-m[1]))),i[0],i[1]]}}}let a=s[0]*i[1]-s[1]*i[0],c;if(Math.abs(a)<1e-12)c=[s[0],s[1],i[0],i[1],i[0],i[1]];else {let u=[(i[1]-s[1])/a,(s[0]-i[0])/a],l=J(Math.abs(t-n)/2)[0],m=4/3*l/(1+l);c=[s[0]+m*(u[0]-s[0]),s[1]+m*(u[1]-s[1]),i[0]+m*(u[0]-i[0]),i[1]+m*(u[1]-i[1]),i[0],i[1]];}return {start:s,ctrl:c}}function eo(n,t,e,r,o,s,i,a,c,u=false,l=false,m=false){let h=e-n,b=r-t,f=Math.PI/2,p=Math.ceil(h/2),M=c?Math.ceil(b/2):Math.floor(b/2),x=n+Math.ceil(h/2),E=t+Math.ceil(b/2),d=(n+e)/2,A=(t+r)/2,R=(O,v)=>_e((O-d)/(h/2||1),-(v-A)/(b/2||1)),g=R(o,s),S=R(i,a),y=O=>c?(2*Math.PI-O)%(2*Math.PI):O,P=S!==g&&Math.abs(y(S)-y(g))<=Le,T=c?-1:1;if(T>0)for(;S<=g;)S+=2*Math.PI;else for(;S>=g;)S-=2*Math.PI;let C=(O,v)=>Math.fround(O*Math.fround(v)),L=(O,v)=>m?Math.round(x-C(Math.floor(h/2),O)):c&&u?Math.ceil(x+C(p,O)+.5-v):Math.round(x+C(p,O)+(u?1+v:0)),_=O=>Math.round(E-C(M,O)),w=m?At(e,t,n,r):At(n,t,e,r);u&&(w.halfX=true);let I=Ht(w);if(c){let O=Ht(w,true);for(let v=0;v<O.length;v+=2)I[O.length-2-v]=O[v],I[O.length-1-v]=O[v+1];}let D=P?[Math.cos(g),Math.sin(g)]:J(g),N=[L(D[0],D[1]),_(D[1])],X=O=>Math.abs(O/f-Math.round(O/f))<1e-9,B=O=>(Math.round(O/f)%4+4)%4;l&&X(g)&&(T>0?B(g)===1||B(g)===2:B(g)===2||B(g)===3)&&N.push(N[0],N[1],N[0],N[1],N[0],N[1]);let k=g;for(let O=0;O<8&&(T>0?k<S-1e-12:k>S+1e-12);O++){let v=T>0?Math.floor(k/f+1e-9)*f+f:Math.ceil(k/f-1e-9)*f-f,tt=Math.abs(k/f-Math.round(k/f))<1e-9,ee=T>0?v>=S-1e-12:v<=S+1e-12,mt=(Math.round(k/f)%4+4)%4,ht=(Math.round(v/f)%4+4)%4;if(!(O===0&&(T>0?mt===0||mt===3:mt===0||mt===1)||ee&&(T>0?ht===1||ht===2:ht===2||ht===3))&&tt&&(T>0?v<=S+1e-12:v>=S-1e-12)){let F=(Math.round(Math.min(k,v)/f)%4+4)%4*6;T>0?N.push(I[F+2],I[F+3],I[F+4],I[F+5],I[F+6],I[F+7]):N.push(I[F+4],I[F+5],I[F+2],I[F+3],I[F],I[F+1]),k=v;continue}let Vt=T>0?Math.min(v,S):Math.max(v,S),Lt=$n(k,Vt,P,Math.max(p,M));for(let F=0;F<6;F+=2)N.push(L(Lt.ctrl[F],Lt.ctrl[F+1]),_(Lt.ctrl[F+1]));k=Vt;}if(l&&X(S)&&(T>0?B(S)===3||B(S)===0:B(S)===1||B(S)===0)){let O=J(S),v=L(O[0],O[1]),tt=_(O[1]);N.push(v,tt,v,tt,v,tt);}return N}var Dn=class{constructor(){this.figures=[];this.getPath={pts:[],types:[]};this.current=null;}moveTo(t,e){this.current={pts:[t,e],closed:false},this.figures.push(this.current),this.log(t,e,6);}continueAt(t,e){let r=this.current;r&&r.pts[r.pts.length-2]===t&&r.pts[r.pts.length-1]===e||this.moveTo(t,e);}hasOpenFigure(){return this.current!==null}log(t,e,r){this.getPath.pts.push(t,e),this.getPath.types.push(r);}lineTo(t,e){if(!this.current){let r=this.lastPoint();this.moveTo(r?r[0]:t,r?r[1]:e);}this.current.pts.push(t,e),this.log(t,e,2);}bezierTo(t,e,r,o,s,i){if(!this.current){let c=this.lastPoint();this.moveTo(c?c[0]:t,c?c[1]:e);}let a=this.current.pts;this.flattenInto(a[a.length-2],a[a.length-1],t,e,r,o,s,i),this.log(t,e,4),this.log(r,o,4),this.log(s,i,4);}flattenInto(t,e,r,o,s,i,a,c){let u=this.current,l=u.pts.length/2-1;Bn(t,e,r,o,s,i,a,c,u.pts);let m=u.pts.length/2-2;if(m<=l){if(m===l){let p=u.pts.length;u.tangents??(u.tangents=new Map),u.tangentRoles??(u.tangentRoles=new Map),u.tangents.set(l,[u.pts[p-2]-u.pts[p-4],u.pts[p-1]-u.pts[p-3]]),u.tangentRoles.set(l,3);}return}let h=(p,M,x,E,d,A,R,g)=>x!==p||E!==M?[x-p,E-M]:d!==p||A!==M?[d-p,A-M]:R!==p||g!==M?[R-p,g-M]:null,b=h(t,e,r,o,s,i,a,c),f=h(s,i,a,c,a,c,a,c)??h(r,o,a,c,a,c,a,c)??h(t,e,a,c,a,c,a,c);u.curveSegs??(u.curveSegs=new Set);for(let p=l;p<=m;p++)u.curveSegs.add(p);u.tangents??(u.tangents=new Map),u.tangentRoles??(u.tangentRoles=new Map),b&&(u.tangents.set(l,b),u.tangentRoles.set(l,1)),f&&(u.tangents.set(m,f),u.tangentRoles.set(m,2));}addBeziers(t,e){e?this.moveTo(t[0],t[1]):this.lineTo(t[0],t[1]);for(let r=2;r+5<t.length;r+=6){this.flattenInto(t[r-2],t[r-1],t[r],t[r+1],t[r+2],t[r+3],t[r+4],t[r+5]);for(let o=r;o<r+6;o+=2)this.log(t[o],t[o+1],4);}}closeFigure(){if(this.current){this.current.closed=true,this.current=null;let t=this.getPath.types;t[t.length-1]|=1;}}append(t){for(let e of t.figures)this.figures.push({pts:e.pts.slice(),closed:e.closed,tangents:e.tangents&&new Map(e.tangents),tangentRoles:e.tangentRoles&&new Map(e.tangentRoles),curveSegs:e.curveSegs&&new Set(e.curveSegs),roundWiden:e.roundWiden});for(let e=0;e<t.getPath.types.length;e++)this.log(t.getPath.pts[2*e],t.getPath.pts[2*e+1],t.getPath.types[e]);this.current=null;}lastPoint(){let t=this.figures[this.figures.length-1];return t?t.closed?[t.pts[0],t.pts[1]]:[t.pts[t.pts.length-2],t.pts[t.pts.length-1]]:null}};function ro(n,t,e){return Se(n.figures.map(r=>r.pts),t,e)}function Wn(n,t){switch(n&15){case 1:return [18,6];case 2:return [3,3];case 3:return [9,6,3,6];case 4:return [9,3,3,3,3,3];case 7:return t&&t.length>0&&t.some(e=>e>0)?t.map(e=>Math.max(0,e)*3):null;case 8:return [1,1];default:return null}}function oo(n,t,e,r=1){let o=Math.max(t,1);switch(n&15){case 1:return [3*o,o];case 2:return [o,o];case 3:return [3*o,o,o,o];case 4:return [3*o,o,o,o,o,o];case 7:return e&&e.some(s=>s>0)?e.map(s=>Math.max(0,s)*r):null;default:return null}}function so(n){let t=n&15;return t>=1&&t<=4}function io(n,t,e,r,o={pos:0},s=true){let i=0;if(r)for(let c of r)i+=c;let a=(c,u)=>{if(!r||i===0){t.add(u,c,c+1);return}let l=o.pos%i;o.pos++;for(let m=0;m<r.length;m++){if(l<r[m]){m%2===0?t.add(u,c,c+1):e&&e.add(u,c,c+1);return}l-=r[m];}};n.figures.forEach((c,u)=>{u>0&&s&&(o.pos=0);let l=c.pts;for(let m=0;m+3<l.length;m+=2)Nn(l[m],l[m+1],l[m+2],l[m+3],a);if(c.closed&&l.length>=4){let m=l.length;(l[m-2]!==l[0]||l[m-1]!==l[1])&&Nn(l[m-2],l[m-1],l[0],l[1],a);}});}var U;async function To(){if(U!==void 0)return U;if(typeof OffscreenCanvas<"u"||typeof document<"u"||typeof process>"u"||!process.versions?.node)return U=null,U;try{U=await Qt();}catch{U=null;}return U}var Hn=false;function zn(){return typeof OffscreenCanvas>"u"&&typeof document>"u"&&!U}var Jn=1;function He(n,t,e,r,o=Jn,s=8192){let i=Math.max(1,Math.min(o,4)),a=Math.round(n*i),c=Math.round(t*i),u=i,l=i;if(e&&a>e){let f=e/a;a=e,c=Math.round(c*f),u*=f,l*=f;}if(r&&c>r){let f=r/c;a=Math.round(a*f),c=r,u*=f,l*=f;}let m=Math.max(1,Math.floor(s)),h=Math.max(1,Math.min(a,m)),b=Math.max(1,Math.min(c,m));return (h!==a||b!==c)&&console.warn(`[emf-converter] Canvas size clamped from ${a}\xD7${c} to ${h}\xD7${b}. Output may lose detail.`),{w:h,h:b,scaleX:u,scaleY:l}}var Ct={willReadFrequently:true};function Ro(n,t,e,r,o=Jn,s=8192){let{w:i,h:a,scaleX:c,scaleY:u}=He(n,t,e,r,o,s);try{if(zn()){ut(`createCanvas: using the software rasteriser ${i}\xD7${a}`);let l=new z(i,a);return {canvas:l,ctx:l.ctx,scaleX:c,scaleY:u}}if(typeof OffscreenCanvas<"u"){ut(`createCanvas: using OffscreenCanvas ${i}\xD7${a}, scale=(${c.toFixed(3)},${u.toFixed(3)})`);let l=new OffscreenCanvas(i,a),m=l.getContext("2d",Ct);return m?{canvas:l,ctx:m,scaleX:c,scaleY:u}:(q('createCanvas: OffscreenCanvas.getContext("2d") returned null'),null)}if(typeof document<"u"){ut(`createCanvas: using HTMLCanvasElement ${i}\xD7${a}, scale=(${c.toFixed(3)},${u.toFixed(3)})`);let l=document.createElement("canvas");l.width=i,l.height=a;let m=l.getContext("2d",Ct);return m?{canvas:l,ctx:m,scaleX:c,scaleY:u}:(q('createCanvas: HTMLCanvasElement.getContext("2d") returned null'),null)}if(U){ut(`createCanvas: using @napi-rs/canvas ${i}\xD7${a}, scale=(${c.toFixed(3)},${u.toFixed(3)})`);let l=U.createCanvas(i,a),m=l.getContext("2d");return m?{canvas:l,ctx:m,scaleX:c,scaleY:u}:(q('createCanvas: @napi-rs/canvas getContext("2d") returned null'),null)}return q("createCanvas: no OffscreenCanvas, no document, and no @napi-rs/canvas, cannot create canvas"),null}catch(l){return null}}function ze(n,t){if(n<=0||t<=0)return null;if(n=Math.max(1,Math.min(Math.floor(n),8192)),t=Math.max(1,Math.min(Math.floor(t),8192)),Hn);if(typeof OffscreenCanvas<"u"){let r=new OffscreenCanvas(n,t),o=r.getContext("2d",Ct);return o?{canvas:r,ctx:o}:null}if(typeof document<"u"){let r=document.createElement("canvas");r.width=n,r.height=t;let o=r.getContext("2d",Ct);return o?{canvas:r,ctx:o}:null}if(U){let r=U.createCanvas(n,t),o=r.getContext("2d");return o?{canvas:r,ctx:o}:null}let e=new z(n,t);return {canvas:e,ctx:e.ctx}}function Vn(n){switch(n){case 1:return {gco:"source-over",colorTransform:"black",exact:true};case 16:return {gco:"source-over",colorTransform:"white",exact:true};case 11:return {gco:"source-over",colorTransform:"skip",exact:true};case 4:return {gco:"source-over",colorTransform:"invert",exact:true};case 6:return {gco:"difference",colorTransform:"white",exact:true};case 7:case 5:return {gco:"difference",colorTransform:"none",exact:false};case 10:return {gco:"difference",colorTransform:"invert",exact:false};case 9:return {gco:"darken",colorTransform:"none",exact:false};case 3:case 2:return {gco:"darken",colorTransform:"invert",exact:false};case 15:case 14:return {gco:"lighten",colorTransform:"none",exact:false};case 12:case 8:return {gco:"lighten",colorTransform:"invert",exact:false};default:return {gco:"source-over",colorTransform:"none",exact:true}}}function jn(n,t){switch(t){case "invert":return Sn(n);case "black":return "#000000";case "white":return "#ffffff";case "skip":return "rgba(0,0,0,0)";default:return n}}function So(n,t){let e=Vn(t.rop2);if(n.globalCompositeOperation=e.gco,t.penStyle===5){n.strokeStyle="rgba(0,0,0,0)",n.lineWidth=0;return}n.strokeStyle=jn(t.penColor,e.colorTransform),n.lineWidth=Math.max(t.penWidth,1),n.setLineDash(t.penWidth<=1?Wn(t.penStyle,t.penUserStyle)??[]:[]);}function yo(n,t){let e=Vn(t.rop2);if(n.globalCompositeOperation=e.gco,Ln(t).kind==="none"){n.fillStyle="rgba(0,0,0,0)";return}n.fillStyle=jn(t.brushColor,e.colorTransform);}function Je(n){if(!n||n===400)return "";let t=Math.round(n/100)*100;return t===700?"bold":t>=100&&t<=900?String(t):n>=700?"bold":""}function Ve(n,t){let e=t?.[n.toLowerCase().trim()]??n;return /[\s,]/.test(e)&&!/^["']/.test(e)?`"${e}"`:e}function qn(n,t=1){return Math.max(_n(n.fontHeight)*Math.abs(t||1),8)}function Ao(n,t,e=1){let r=t.fontItalic?"italic ":"",o=Je(t.fontWeight),s=o?`${o} `:"",i=qn(t,e),a=Ve(t.fontFamily,t.fontFamilyMap);n.font=`${r}${s}${i}px ${a}`;}function Po(n,t,e,r,o,s=1){if(!t.fontUnderline&&!t.fontStrikeOut)return;let i=qn(t,s),a=Math.max(1,Math.round(i/14)),c=n.fillStyle;n.fillStyle=t.textColor,t.fontUnderline&&n.fillRect(e,r+Math.round(i*.12),o,a),t.fontStrikeOut&&n.fillRect(e,r-Math.round(i*.3),o,a),n.fillStyle=c;}function Co(n,t,e){if(e<=0)return "";let r=n.byteLength-t;if(r<=0)return "";let o=Math.min(e,Math.floor(r/2));if(o<=0)return "";let s;try{let a=new Uint8Array(n.buffer,n.byteOffset+t,o*2);s=new TextDecoder("utf-16le").decode(a);}catch{let a=[];for(let c=0;c<o;c++){let u=n.getUint16(t+c*2,true);if(u===0)return a.join("");a.push(String.fromCharCode(u));}return a.join("")}let i=s.indexOf("\0");return i===-1?s:s.slice(0,i)}function Lo(n){switch(n){case 0:return {kind:"brush",style:0,color:"#ffffff"};case 1:return {kind:"brush",style:0,color:"#c0c0c0"};case 2:return {kind:"brush",style:0,color:"#808080"};case 3:return {kind:"brush",style:0,color:"#404040"};case 4:return {kind:"brush",style:0,color:"#000000"};case 5:return {kind:"brush",style:1,color:"#000000"};case 6:return {kind:"pen",style:0,widthX:1,color:"#ffffff"};case 7:return {kind:"pen",style:0,widthX:1,color:"#000000"};case 8:return {kind:"pen",style:5,widthX:0,color:"#000000"};case 10:case 11:return {kind:"font",height:12,weight:400,italic:false,underline:false,strikeOut:false,family:"monospace"};case 12:case 13:case 14:case 17:return {kind:"font",height:12,weight:400,italic:false,underline:false,strikeOut:false,family:"sans-serif"};default:return null}}async function _o(n,t){let e=chunk32ASPP2J_js.a(new Uint8Array(n));if(e==="unsupported")return null;if(zn()){let s=await Yn(new Uint8Array(n));return s?{drawable:s,width:s.width,height:s.height,close:()=>{}}:null}if(!(e==="bundled"&&In)){if(U)try{let s=await U.loadImage(new Uint8Array(n));return {drawable:s,width:s.width,height:s.height,close:()=>{}}}catch{}else if(typeof createImageBitmap=="function")try{let s=t!==void 0?new Blob([n],{type:t}):new Blob([n]),i=await createImageBitmap(s);return {drawable:i,width:i.width,height:i.height,close:()=>i.close()}}catch{}}let r=await Yn(new Uint8Array(n)),o=r&&ze(r.width,r.height);return !r||!o?null:(je(o.ctx,ct(r.data,r.width,r.height),0,0),{drawable:o.canvas,width:r.width,height:r.height,close:()=>{}})}async function Yn(n){if(chunkOB5ODU4B_js.a(n))return chunkOB5ODU4B_js.c(n);if(n.length>=26&&n[0]===66&&n[1]===77){let t=new DataView(n.buffer,n.byteOffset,n.byteLength),e=t.getUint32(10,true),r=Et(t,14,e,t.byteLength-e);return r?{data:r.data,width:r.width,height:r.height}:null}return On(n)}function Io(n,t,e,r,o,s){n.drawImage.call(n,t,e,r,o,s);}function Oo(n,t,e,r,o){return n.getImageData.call(n,t,e,r,o)}function je(n,t,e,r){n.putImageData.call(n,t,e,r);}function vo(n,t,e){return n.createPattern.call(n,t,e)}function ct(n,t,e){if(typeof ImageData<"u")return new ImageData(n,t,e);if(U){let r=U.ImageData;return new r(n,t,e)}return {data:n,width:t,height:e,colorSpace:"srgb"}}var qe=Symbol("SvgContext");function Ke(n){return typeof n=="object"&&n!==null&&qe in n}function No(n){return !Ke(n)||n.canReadPixels}function Kn(n){return n.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F￾￿]/g,"").replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,"\uFFFD").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Zn(n,t){t.push("<",n.tag);for(let e of Object.keys(n.attrs))t.push(" ",e,'="',Kn(String(n.attrs[e])),'"');if(n.text!==void 0){t.push(">",Kn(n.text),"</",n.tag,">");return}if(!n.children||n.children.length===0){t.push("/>");return}t.push(">");for(let e of n.children)Zn(e,t);t.push("</",n.tag,">");}function Ze(n){let t=[];return Zn(n,t),t.join("")}var K="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Qe(n){let t=[];for(let r=0;r<n.length;r+=12288){let o=Math.min(n.length,r+12288),s="",i=r;for(;i+2<o;i+=3){let a=n[i]<<16|n[i+1]<<8|n[i+2];s+=K[a>>18]+K[a>>12&63]+K[a>>6&63]+K[a&63];}if(i<o){let a=n[i]<<16|(i+1<o?n[i+1]:0)<<8;s+=K[a>>18]+K[a>>12&63]+(i+1<o?K[a>>6&63]:"=")+"=";}t.push(s);}return t.join("")}function tr(n){if(typeof TextEncoder<"u")return new TextEncoder().encode(n);let t=[];for(let e of n){let r=e.codePointAt(0);r<128?t.push(r):r<2048?t.push(192|r>>6,128|r&63):r<65536?t.push(224|r>>12,128|r>>6&63,128|r&63):t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|r&63);}return Uint8Array.from(t)}function nr(n){return `data:image/svg+xml;base64,${Qe(tr(n))}`}function Uo(n){return nr(Ze(n))}var er={class:"className","xml:space":"xmlSpace","xlink:href":"xlinkHref","xmlns:xlink":"xmlnsXlink"};function Qn(n){let t=er[n];return t||(n.startsWith("data-")||n.startsWith("aria-")?n:n.replace(/[-:]([a-z])/g,(e,r)=>r.toUpperCase()))}function te(n){let t={};for(let e of n.split(";")){let r=e.indexOf(":");if(r<=0)continue;let o=e.slice(0,r).trim(),s=e.slice(r+1).trim();if(!o)continue;let i=o.startsWith("--")?o:o.replace(/-([a-z])/g,(a,c)=>c.toUpperCase());t[i]=s;}return t}function rr(n){let t={};for(let e of Object.keys(n)){let r=n[e];e==="style"?t.style=te(String(r)):t[Qn(e)]=r;}return t}function Do(n,t,e){let r=0,o=(a,c)=>{let u={key:r++,...rr(a.attrs),...c};if(a.text!==void 0)return t(a.tag,u,a.text);let l=(a.children??[]).map(m=>o(m));return t(a.tag,u,...l)},{key:s,...i}=e??{};return o(n,i)}function Jt(n){return JSON.stringify(n)}function or(n,t){if(n==="style"){let e=te(String(t));return `{{ ${Object.keys(e).map(o=>`${/^[a-zA-Z_$][\w$]*$/.test(o)?o:Jt(o)}: ${Jt(e[o])}`).join(", ")} }}`}return typeof t=="number"?Number.isFinite(t)?`{${t}}`:"{0}":/^[^"\\{}<>&\r\n]*$/.test(t)?`"${t}"`:`{${Jt(t)}}`}function sr(n){return `{${JSON.stringify(n)}}`}function ne(n,t,e,r){let o=" ".repeat(t),s=Object.keys(n.attrs).map(a=>`${Qn(a)}=${or(a,n.attrs[a])}`);r&&s.push("{...props}");let i=`${o}<${n.tag}${s.length?" "+s.join(" "):""}`;if(n.text!==void 0){e.push(`${i}>${sr(n.text)}</${n.tag}>`);return}if(!n.children||n.children.length===0){e.push(`${i} />`);return}e.push(`${i}>`);for(let a of n.children)ne(a,t+1,e,false);e.push(`${o}</${n.tag}>`);}function ko(n,t={}){let e=t.componentName??"Metafile";if(!/^[A-Z][A-Za-z0-9_$]*$/.test(e))throw new TypeError(`svgTreeToJsx: componentName must be a PascalCase identifier, got ${JSON.stringify(e)}`);let r=t.typescript??true,o=t.spreadProps??true,s=[];ne(n,2,s,o);let i=o?r?"props: SVGProps<SVGSVGElement>":"props":"";return [...r&&o?["import type { SVGProps } from 'react';",""]:[],`export function ${e}(${i}) {`," return (",...s," );","}","",`export default ${e};`,""].join(`
2
+ `)}exports.$=So;exports.A=Qr;exports.B=Ce;exports.C=to;exports.D=no;exports.E=eo;exports.F=Dn;exports.G=ro;exports.H=Wn;exports.I=oo;exports.J=so;exports.K=io;exports.L=nt;exports.M=ft;exports.N=tn;exports.O=It;exports.P=Ot;exports.Q=z;exports.R=Sr;exports.S=at;exports.T=To;exports.U=zn;exports.V=Jn;exports.W=He;exports.X=Ro;exports.Y=ze;exports.Z=Vn;exports._=jn;exports.a=Pr;exports.aa=yo;exports.b=Cr;exports.ba=Ve;exports.c=Lr;exports.ca=qn;exports.d=Et;exports.da=Ao;exports.e=Ee;exports.ea=Po;exports.f=ge;exports.fa=Co;exports.g=kr;exports.ga=Lo;exports.h=Ln;exports.ha=_o;exports.i=Br;exports.ia=Yn;exports.j=Xr;exports.ja=Io;exports.k=$r;exports.ka=Oo;exports.l=Wr;exports.la=je;exports.m=Yr;exports.ma=vo;exports.n=Hr;exports.na=ct;exports.o=zr;exports.oa=qe;exports.p=ut;exports.pa=Ke;exports.q=q;exports.qa=No;exports.r=ar;exports.ra=Ze;exports.s=Yt;exports.sa=Qe;exports.t=Se;exports.ta=nr;exports.u=Nn;exports.ua=Uo;exports.v=W;exports.va=Do;exports.w=At;exports.wa=ko;exports.x=Ht;exports.y=Pe;exports.z=Zr;
@@ -0,0 +1 @@
1
+ import {c}from'./chunk-6M4YGIQZ.mjs';var v=null;function z(o,r,e){if(!v){v=new Uint32Array(256);for(let n=0;n<256;n++){let c=n;for(let i=0;i<8;i++)c=c&1?3988292384^c>>>1:c>>>1;v[n]=c>>>0;}}let t=4294967295;for(let n=r;n<e;n++)t=v[(t^o[n])&255]^t>>>8;return (t^4294967295)>>>0}function E(o){let r=1,e=0;for(let t=0;t<o.length;){let n=Math.min(o.length,t+5552);for(;t<n;t++)r+=o[t],e+=r;r%=65521,e%=65521;}return (e<<16|r)>>>0}function L(o){let r=Math.max(1,Math.ceil(o.length/65535)),e=new Uint8Array(2+o.length+r*5+4);e[0]=120,e[1]=1;let t=2;for(let c=0;c<r;c++){let i=c*65535,l=Math.min(65535,o.length-i);e[t++]=c===r-1?1:0,e[t++]=l&255,e[t++]=l>>>8,e[t++]=~l&255,e[t++]=~l>>>8&255,e.set(o.subarray(i,i+l),t),t+=l;}let n=E(o);return e[t++]=n>>>24,e[t++]=n>>>16&255,e[t++]=n>>>8&255,e[t++]=n&255,e}async function V(o){if(typeof CompressionStream=="function"&&typeof Response=="function")try{let r=new Blob([o]).stream().pipeThrough(new CompressionStream("deflate"));return new Uint8Array(await new Response(r).arrayBuffer())}catch{}return L(o)}function _(o,r,e){let t=o+r-e,n=Math.abs(t-o),c=Math.abs(t-r),i=Math.abs(t-e);return n<=c&&n<=i?o:c<=i?r:e}function G(o,r){let e=0;for(let t=0;t<r;t++){let n=o[t];e+=n<128?n:256-n;}return e}var D=2155905152;function O(o,r){return (o|D)-(r&~D)^(o^r^D)&D}function T(o){let r=o>>>7&16843009,e=(o^r*255)+r,t=(e&16711935)+(e>>>8&16711935);return (t&65535)+(t>>>16)}function N(o,r,e){let t=o instanceof Uint8Array||o instanceof Uint8ClampedArray?new Uint8Array(o.buffer,o.byteOffset,o.length):Uint8Array.from(o),n=r*4,c$1=t.byteOffset%4===0?new Uint32Array(t.buffer,t.byteOffset,r*e):null,i=new Uint8Array((n+1)*e),l=new Uint8Array(n),x=new Uint8Array(n),h=new Uint32Array(l.buffer),m=new Uint32Array(x.buffer),w=new Uint8Array(n);for(let b=0;b<e;b++){(b&63)===0&&c();let u=b*n,d=u-n,S=b*(n+1);if(c$1&&b>0){let s=u>>2,f=d>>2,a=true;for(let y=0;y<r;y++)if(c$1[s+y]!==c$1[f+y]){a=false;break}if(a){i[S]=2;continue}}let I=t.subarray(u,u+n),U=0,k=u>>2;if(c$1)for(let s=0;s<r;s++)U+=T(c$1[k+s]);else U=G(I,n);if(U===0){i.set(I,S+1);continue}let g=0,p=0;if(c$1){let s=0;for(let f=0;f<r;f++){let a=c$1[k+f],y=O(a,s);h[f]=y,g+=T(y),s=a;}if(b>0)for(let f=0;f<r;f++){let a=O(c$1[k+f],c$1[k-r+f]);m[f]=a,p+=T(a);}else p=U;}else {for(let s=0;s<4&&s<n;s++){let f=t[u+s];l[s]=f,g+=f<128?f:256-f;}for(let s=4;s<n;s++){let f=t[u+s]-t[u+s-4]&255;l[s]=f,g+=f<128?f:256-f;}if(b>0)for(let s=0;s<n;s++){let f=t[u+s]-t[d+s]&255;x[s]=f,p+=f<128?f:256-f;}else p=U;}let B=I,M=0,A=U;if(g<A&&(A=g,B=l,M=1),p<A&&(A=p,B=x,M=2),b>0&&A>n>>3){w.set(x.subarray(0,4));let s=0;for(let f=0;f<4&&f<n;f++){let a=x[f];s+=a<128?a:256-a;}for(let f=4;f<n&&s<A;f++){let a=t[u+f-4],y=t[d+f],R=t[d+f-4],P=t[u+f]-_(a,y,R)&255;w[f]=P,s+=P<128?P:256-P;}s<A&&(B=w,M=4);}i[S]=M,i.set(B,S+1);}return i}function C(o,r){let e=new Uint8Array(12+r.length),t=new DataView(e.buffer);t.setUint32(0,r.length);for(let n=0;n<4;n++)e[4+n]=o.charCodeAt(n);return e.set(r,8),t.setUint32(8+r.length,z(e,4,8+r.length)),e}async function j(o,r,e){let t=new Uint8Array(13),n=new DataView(t.buffer);n.setUint32(0,r),n.setUint32(4,e),t[8]=8,t[9]=6;let c=await V(N(o,r,e)),i=[Uint8Array.of(137,80,78,71,13,10,26,10),C("IHDR",t),C("IDAT",c),C("IEND",new Uint8Array(0))],l=i.reduce((m,w)=>m+w.length,0),x=new Uint8Array(l),h=0;for(let m of i)x.set(m,h),h+=m.length;return x}export{V as a,j as b};
@@ -0,0 +1 @@
1
+ import {a}from'./chunk-PO4H7QFT.mjs';var N=[[23069,1,1,1],[9606,14,2,0],[4372,16,3,0],[2059,18,4,0],[984,20,5,0],[474,23,6,0],[229,25,7,0],[111,28,8,0],[54,30,9,0],[26,33,10,0],[13,35,11,0],[6,9,12,0],[3,10,13,0],[1,12,13,0],[23167,15,15,1],[16165,36,16,0],[11506,38,17,0],[8316,39,18,0],[6073,40,19,0],[4482,42,20,0],[3311,43,21,0],[2465,45,22,0],[1839,46,23,0],[1372,48,24,0],[1030,49,25,0],[771,51,26,0],[576,52,27,0],[433,54,28,0],[324,56,29,0],[245,57,30,0],[183,59,31,0],[138,60,32,0],[104,62,33,0],[78,63,34,0],[59,32,35,0],[44,33,9,0],[23265,37,37,1],[18508,64,38,0],[14861,65,39,0],[12017,67,40,0],[9759,68,41,0],[7987,69,42,0],[6568,70,43,0],[5400,72,44,0],[4471,73,45,0],[3700,74,46,0],[3067,75,47,0],[2552,77,48,0],[2145,78,49,0],[1798,79,50,0],[1485,48,51,0],[1246,50,52,0],[1039,50,53,0],[867,51,54,0],[724,52,55,0],[604,53,56,0],[504,54,57,0],[420,55,58,0],[352,56,59,0],[293,57,60,0],[246,58,61,0],[203,59,62,0],[171,61,63,0],[143,61,32,0],[23314,65,65,1],[19716,80,66,0],[16684,81,67,0],[14296,82,68,0],[12264,83,69,0],[10556,84,70,0],[9081,86,71,0],[7903,87,72,0],[6825,87,73,0],[5966,72,74,0],[5156,72,75,0],[4508,74,76,0],[3947,74,77,0],[3409,75,78,0],[2998,77,79,0],[2624,77,48,0],[22578,80,81,1],[19740,88,82,0],[17294,89,83,0],[15325,90,84,0],[13550,91,85,0],[11950,92,86,0],[10650,93,87,0],[9494,86,71,0],[21872,88,89,1],[19625,95,90,0],[17625,96,91,0],[15906,97,92,0],[14372,99,93,0],[12980,99,94,0],[11799,93,86,0],[22184,95,96,1],[20294,101,97,0],[18405,102,98,0],[16847,103,99,0],[15421,104,100,0],[14174,99,93,0],[21041,105,102,0],[19471,106,103,0],[17977,107,104,0],[16734,103,99,0],[22055,105,106,1],[20711,108,107,0],[19333,109,103,0],[21911,110,109,0],[20559,111,107,0],[23056,110,111,1],[21794,112,109,0],[23019,112,111,1],[23069,113,113,0]],O=new Int32Array(N.length),Q=new Int32Array(N.length),Y=new Int32Array(N.length);N.forEach(([t,e,n,f],l)=>{O[l]=t,Q[l]=e|f<<7,Y[l]=n;});var te=64,ne=256;function V(){return {dcL:new Array(16).fill(0),dcU:new Array(16).fill(1),acK:new Array(16).fill(5)}}var K=[0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63],L=class{constructor(e,n,f,l){this.data=e;this.cond=f;this.components=l;this.c=0;this.a=0;this.ct=-16;this.marker=false;this.failed=false;this.dcStats=[];this.acStats=[];this.fixed=new Uint8Array(1);this.pos=n,this.reset();}reset(){this.c=0,this.a=0,this.ct=-16,this.marker=false,this.failed=false,this.dcStats.length=0,this.acStats.length=0;for(let e=0;e<16;e++)this.dcStats.push(new Uint8Array(te)),this.acStats.push(new Uint8Array(ne));this.fixed[0]=113;for(let e of this.components)e.pred=0,e.ctx=0;}bit(e,n){for(;this.a<32768;){if(--this.ct<0){let a=0;if(!this.marker&&(a=this.pos<this.data.length?this.data[this.pos++]:0,a===255)){do a=this.pos<this.data.length?this.data[this.pos++]:0;while(a===255);a===0?a=255:(this.marker=true,this.pos-=2,a=0);}this.c=this.c<<8|a,(this.ct+=8)<0&&++this.ct===0&&(this.a=32768);}this.a<<=1;}let f=e[n],l=f&127,u=O[l],i=Q[l],s=Y[l],r=this.a-u;return this.a=r,r<<=this.ct,this.c>=r?(this.c-=r,this.a<u?(this.a=u,e[n]=f&128^s):(this.a=u,e[n]=f&128^i,f^=128)):this.a<32768&&(this.a<u?(e[n]=f&128^i,f^=128):e[n]=f&128^s),f>>7}dcDiff(e){let n=this.dcStats[e.dc],f=e.ctx;if(this.bit(n,f)===0)return e.ctx=0,true;let l=this.bit(n,f+1);f+=2+l;let u=this.bit(n,f);if(u!==0)for(f=20;this.bit(n,f);){if((u<<=1)===32768)return false;f++;}let i=1<<this.cond.dcL[e.dc]>>1,s=1<<this.cond.dcU[e.dc]>>1;e.ctx=u<i?0:u>s?12+l*4:4+l*4;let r=u;for(f+=14;u>>=1;)this.bit(n,f)&&(r|=u);return r+=1,e.pred+=l?-r:r,true}acFirst(e,n,f,l,u){let i=this.acStats[e.ac];for(let s=f;s<=l;s++){let r=3*(s-1);if(this.bit(i,r))break;for(;this.bit(i,r+1)===0;)if(r+=3,s++,s>l){this.failed=true;return}let a=this.bit(this.fixed,0);r+=2;let o=this.bit(i,r);if(o!==0&&this.bit(i,r))for(o<<=1,r=s<=this.cond.acK[e.ac]?189:217;this.bit(i,r);){if((o<<=1)===32768){this.failed=true;return}r++;}let c=o;for(r+=14;o>>=1;)this.bit(i,r)&&(c|=o);c+=1,e.coefs[n+K[s]]=(a?-c:c)*(1<<u);}}acRefine(e,n,f,l,u){let i=this.acStats[e.ac],s=e.coefs,r=1<<u,a=-1<<u,o=l;for(;o>0&&!s[n+K[o]];o--);for(let c=f;c<=l;c++){let p=3*(c-1);if(c>o&&this.bit(i,p))break;for(;;){let d=n+K[c];if(s[d]){this.bit(i,p+2)&&(s[d]+=s[d]<0?a:r);break}if(this.bit(i,p+1)){s[d]=this.bit(this.fixed,0)?a:r;break}if(p+=3,c++,c>l){this.failed=true;return}}}}block(e,n,f,l,u,i,s){if(!this.failed){if(!f){if(!this.dcDiff(e)){this.failed=true;return}e.coefs[n]=e.pred,this.acFirst(e,n,1,63,0);return}if(l===0){if(i===0){if(!this.dcDiff(e)){this.failed=true;return}e.coefs[n]=e.pred*(1<<s);}else this.bit(this.fixed,0)&&(e.coefs[n]|=1<<s);return}i===0?this.acFirst(e,n,l,u,s):this.acRefine(e,n,l,u,s);}}};var B=[0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63];function re(t,e){let n=new Int32Array(18).fill(-1),f=new Int32Array(17),l=new Int32Array(17),u=0,i=0;for(let s=1;s<=16;s++)f[s]=i,l[s]=u,u+=t[s-1],i+=t[s-1],n[s]=t[s-1]?u-1:-1,u<<=1;return {maxcode:n,valptr:f,mincode:l,values:e}}var Z=class{constructor(e,n){this.data=e;this.bits=0;this.count=0;this.marker=false;this.pos=n;}reset(){this.bits=0,this.count=0,this.marker=false;}bit(){if(this.count===0){let e=0;if(!this.marker&&this.pos<this.data.length&&(e=this.data[this.pos++],e===255)){let n=this.data[this.pos];for(;n===255;)this.pos++,n=this.data[this.pos];n===0?this.pos++:(this.marker=true,this.pos--,e=0);}this.bits=e,this.count=8;}return this.count--,this.bits>>this.count&1}receive(e){let n=0;for(;e--;)n=n<<1|this.bit();return n}receiveExtend(e){if(e===0)return 0;let n=this.receive(e);return n<1<<e-1?n-(1<<e)+1:n}decode(e){let n=0;for(let f=1;f<=16;f++)if(n=n<<1|this.bit(),e.maxcode[f]>=0&&n<=e.maxcode[f]&&n>=e.mincode[f])return e.values[e.valptr[f]+n-e.mincode[f]];throw new Error("Bad Huffman code")}},D=13,z=2,ie=2446,se=4433,ce=6270,le=9633,ue=12299,be=16819,he=25172;function R(t,e){return t+(1<<e-1)>>e}function $(t,e){let n=t[2],f=t[6],l=(n+f)*se,u=l+f*-15137,i=l+n*ce,s=t[0]+t[4]<<D,r=t[0]-t[4]<<D,a=s+i,o=s-i,c=r+u,p=r-u;s=t[7],r=t[5],u=t[3],i=t[1],l=s+i,n=r+u,f=s+u;let d=r+i,k=(f+d)*le;s*=ie,r*=be,u*=he,i*=ue,l*=-7373,n*=-20995,f*=-16069,d*=-3196,f+=k,d+=k,s+=l+f,r+=n+d,u+=n+f,i+=l+d,e[0]=a+i,e[7]=a-i,e[1]=c+u,e[6]=c-u,e[2]=p+r,e[5]=p-r,e[3]=o+s,e[4]=o-s;}var W=new Array(8).fill(0),G=new Array(8).fill(0);function pe(t,e,n,f,l,u,i){for(let s=0;s<8;s++){let r=0;for(let a=0;a<8;a++)W[a]=t[e+a*8+s]*n[a*8+s],a&&(r|=W[a]);if(!r){let a=W[0]<<z;for(let o=0;o<8;o++)i[o*8+s]=a;continue}$(W,G);for(let a=0;a<8;a++)i[a*8+s]=R(G[a],D-z);}for(let s=0;s<8;s++){let r=0;for(let o=0;o<8;o++)W[o]=i[s*8+o],o&&(r|=W[o]);let a=l+s*u;if(!r){let o=R(W[0],z+3)+128,c=o<0?0:o>255?255:o;for(let p=0;p<8;p++)f[a+p]=c;continue}$(W,G);for(let o=0;o<8;o++){let c=R(G[o],D+z+3)+128;f[a+o]=c<0?0:c>255?255:c;}}}function de(t,e,n,f,l,u,i,s){let r=new Uint8Array(i*s),a=(o,c)=>t[Math.min(f-1,Math.max(0,c))*e+o];if(l===1&&u===1){for(let o=0;o<s;o++)for(let c=0;c<i;c++)r[o*i+c]=t[o*e+c];return r}if(l===2&&u===1){for(let o=0;o<s;o++)for(let c=0;c<n;c++){let p=a(c,o),d=c===0?p:3*p+a(c-1,o)+1>>2,k=c===n-1?p:3*p+a(c+1,o)+2>>2;2*c<i&&(r[o*i+2*c]=d),2*c+1<i&&(r[o*i+2*c+1]=k);}return r}if(l===2&&u===2){for(let o=0;o<s;o++){let c=o>>1,p=(o&1)===0?c-1:c+1,d=k=>3*a(k,c)+a(k,p);for(let k=0;k<n;k++){let b=d(k),P=k===0?b*4+8>>4:3*b+d(k-1)+8>>4,w=k===n-1?b*4+7>>4:3*b+d(k+1)+7>>4;2*k<i&&(r[o*i+2*k]=P),2*k+1<i&&(r[o*i+2*k+1]=w);}}return r}if(l===1&&u===2){for(let o=0;o<s;o++){let c=o>>1,p=(o&1)===0,d=p?c-1:c+1,k=p?1:2;for(let b=0;b<i;b++)r[o*i+b]=3*a(b,c)+a(b,d)+k>>2;}return r}for(let o=0;o<s;o++)for(let c=0;c<i;c++)r[o*i+c]=t[Math.min(f-1,Math.floor(o/u))*e+Math.min(n-1,Math.floor(c/l))];return r}async function ee(t,e){try{let n=ye(t);return n?await Ae(n,e):null}catch{return null}}function ye(t){if(t[0]!==255||t[1]!==216)return null;let e=[],n=[],f=[],l=[],u=0,i=0,s=false,r=false,a=V(),o=0,c,p=1,d=1,k=false,b=2,P=new Int32Array(64);for(;b<t.length;){if(t[b]!==255){b++;continue}let x=t[b+1];if(x===255){b++;continue}if(b+=2,x===216||x===1||x>=208&&x<=215||x===0)continue;if(x===217)break;let M=t[b]*256+t[b+1],h=b+2,F=b+M;if(x===219){let m=h;for(;m<F;){let U=t[m]>>4,C=t[m]&15;m++;let y=new Int32Array(64);for(let _=0;_<64;_++)y[B[_]]=U?t[m]*256+t[m+1]:t[m],m+=U?2:1;e[C]=y;}}else if(x===192||x===193||x===194||x===201||x===202){if(t[h]!==8)return null;s=x===194||x===202,r=x>=201,i=t[h+1]*256+t[h+2],u=t[h+3]*256+t[h+4];let m=t[h+5];if(m!==1&&m!==3&&m!==4||!u||!i)return null;l=[];for(let y=0;y<m;y++){let _=t[h+7+y*3]>>4,g=t[h+7+y*3]&15;if(!_||!g)return null;l.push({id:t[h+6+y*3],h:_,v:g,tq:t[h+8+y*3],blocksW:0,blocksH:0,coefs:new Int16Array(0),pred:0,ctx:0,dc:0,ac:0});}p=Math.max(...l.map(y=>y.h)),d=Math.max(...l.map(y=>y.v));let U=Math.ceil(u/(8*p)),C=Math.ceil(i/(8*d));for(let y of l)y.blocksW=U*y.h,y.blocksH=C*y.v,y.coefs=new Int16Array(y.blocksW*y.blocksH*64);}else {if(x===195||x>=197&&x<=207&&x!==200&&x!==204&&x!==201&&x!==202)return null;if(x===204)for(let m=h;m+1<F;m+=2){let U=t[m]&15;t[m]>>4===0?(a.dcL[U]=t[m+1]&15,a.dcU[U]=t[m+1]>>4):a.acK[U]=t[m+1];}else if(x===196){let m=h;for(;m<F;){let U=t[m]>>4,C=t[m]&15;m++;let y=t.subarray(m,m+16);m+=16;let _=0;for(let A=0;A<16;A++)_+=y[A];let g=re(y,t.subarray(m,m+_));m+=_,(U?f:n)[C]=g;}}else if(x===221)o=t[h]*256+t[h+1];else if(x===238)M>=14&&String.fromCharCode(...t.subarray(h,h+5))==="Adobe"&&(c=t[h+11]);else if(x===218){if(!l.length)return null;let m=t[h],U=[];for(let A=0;A<m;A++){let v=l.find(T=>T.id===t[h+1+A*2]);if(!v)return null;v.dc=t[h+2+A*2]>>4,v.ac=t[h+2+A*2]&15,U.push(v);}let C=t[h+1+m*2],y=t[h+2+m*2],_=t[h+3+m*2]>>4,g=t[h+3+m*2]&15;b=ke(t,F,U,l,u,i,p,d,s,o,C,y,_,g,n,f,r?a:null),k=true;continue}}b=F;}if(!k||!l.length)return null;let w=l.map(x=>{if(p%x.h||d%x.v)throw new Error("Unsupported sampling");let M=x.blocksW*8,h=new Uint8Array(M*x.blocksH*8),F=e[x.tq];if(!F)throw new Error("Missing quantisation table");for(let C=0;C<x.blocksH;C++)for(let y=0;y<x.blocksW;y++)pe(x.coefs,(C*x.blocksW+y)*64,F,h,C*8*M+y*8,M,P);let m=Math.ceil(u*x.h/p),U=Math.ceil(i*x.v/d);return de(h,M,m,U,p/x.h,d/x.v,u,i)});return {width:u,height:i,planes:w,ids:l.map(x=>x.id),adobe:c}}async function Ae({width:t,height:e,planes:n,ids:f,adobe:l},u){if(n.length===4){let{cmykPlanesToRgba:r}=await import('./jpeg-cmyk-POM57I3O.mjs');return {width:t,height:e,data:r(n,t,e,l!==void 0&&l!==0)}}let i=new Uint8Array(t*e*4),s=u??(l!==void 0?l!==0:!f.every((r,a)=>r===[82,71,66][a]));if(n.length===1)for(let r=0;r<t*e;r++)i[r*4]=i[r*4+1]=i[r*4+2]=n[0][r],i[r*4+3]=255;else if(s){let r=b=>b<0?0:b>255?255:b,a=b=>Math.floor(b*65536+.5),c=a(1.402),p=a(1.772),d=-a(.71414),k=-a(.34414);for(let b=0;b<t*e;b++){let P=n[0][b],w=n[1][b]-128,x=n[2][b]-128;i[b*4]=r(P+(c*x+32768>>16)),i[b*4+1]=r(P+(k*w+32768+d*x>>16)),i[b*4+2]=r(P+(p*w+32768>>16)),i[b*4+3]=255;}}else for(let r=0;r<t*e;r++)i[r*4]=n[0][r],i[r*4+1]=n[1][r],i[r*4+2]=n[2][r],i[r*4+3]=255;return {width:t,height:e,data:i}}function ke(t,e,n,f,l,u,i,s,r,a,o,c,p,d,k,b,P){let w=new Z(t,e),x=P?new L(t,e,P,n):null,M=x??w,h=0,F=n.length===1,m=(g,A)=>{if(x){x.block(g,A,r,o,c,p,d);return}let v=g.coefs;if(!r){let I=w.decode(k[g.dc]);g.pred+=I===0?0:w.receiveExtend(I),v[A]=g.pred;let X=1;for(;X<64;){let E=w.decode(b[g.ac]),H=E&15,q=E>>4;if(H===0){if(q<15)break;X+=16;continue}if(X+=q,X>63)break;v[A+B[X]]=w.receiveExtend(H),X++;}return}if(o===0){if(p===0){let I=w.decode(k[g.dc]);g.pred+=I===0?0:w.receiveExtend(I),v[A]=g.pred*(1<<d);}else w.bit()&&(v[A]|=1<<d);return}if(p===0){if(h>0){h--;return}let I=o;for(;I<=c;){let X=w.decode(b[g.ac]),E=X&15,H=X>>4;if(E===0){if(H<15){h=w.receive(H)+(1<<H)-1;break}I+=16;continue}if(I+=H,I>63)break;v[A+B[I]]=w.receiveExtend(E)*(1<<d),I++;}return}let T=1<<d,J=-1<<d,S=o;if(h<=0)for(;S<=c;S++){let I=w.decode(b[g.ac]),X=I&15,E=I>>4,H=0;if(X===0){if(E<15){h=(1<<E)+w.receive(E);break}}else H=w.bit()?T:J;for(;S<=c;S++){let q=A+B[S];if(v[q]!==0)w.bit()&&(v[q]&T)===0&&(v[q]+=v[q]>=0?T:J);else {if(E===0){H&&(v[q]=H);break}E--;}}}if(h>0){for(;S<=c;S++){let I=A+B[S];v[I]!==0&&w.bit()&&(v[I]&T)===0&&(v[I]+=v[I]>=0?T:J);}h--;}},U,C;if(F){let g=n[0];C=Math.ceil(Math.ceil(l*g.h/i)/8),U=C*Math.ceil(Math.ceil(u*g.v/s)/8);}else C=Math.ceil(l/(8*i)),U=C*Math.ceil(u/(8*s));let y=g=>{let A=g;for(;A+1<t.length&&!(t[A]===255&&t[A+1]!==0&&t[A+1]!==255);)A++;return A},_=0;for(;_<U;){for(let v of f)v.pred=0;h=0,M.reset();let g=a?Math.min(U,_+a):U;for(;_<g;_++)if(F){let v=n[0];m(v,(Math.floor(_/C)*v.blocksW+_%C)*64);}else {let v=_%C,T=Math.floor(_/C);for(let J of n)for(let S=0;S<J.v;S++)for(let I=0;I<J.h;I++)m(J,((T*J.v+S)*J.blocksW+v*J.h+I)*64);}let A=y(M.pos);if(_>=U)return A;if(t[A+1]>=208&&t[A+1]<=215)M.pos=A+2;else return A}return y(M.pos)}async function _e(t,e){if(a(t)==="unsupported")throw new Error("Unsupported JPEG data precision");let n=await ee(t,e);if(n)return n;let{decodeJpegPixelsLegacy:f}=await import('./jpeg-decoder-legacy-4LSDXMCV.mjs');return f(t,e)}export{ye as a,_e as b};
@@ -0,0 +1 @@
1
+ 'use strict';var chunkDO2CGP4P_js=require('./chunk-DO2CGP4P.js');var v=null;function z(o,r,e){if(!v){v=new Uint32Array(256);for(let n=0;n<256;n++){let c=n;for(let i=0;i<8;i++)c=c&1?3988292384^c>>>1:c>>>1;v[n]=c>>>0;}}let t=4294967295;for(let n=r;n<e;n++)t=v[(t^o[n])&255]^t>>>8;return (t^4294967295)>>>0}function E(o){let r=1,e=0;for(let t=0;t<o.length;){let n=Math.min(o.length,t+5552);for(;t<n;t++)r+=o[t],e+=r;r%=65521,e%=65521;}return (e<<16|r)>>>0}function L(o){let r=Math.max(1,Math.ceil(o.length/65535)),e=new Uint8Array(2+o.length+r*5+4);e[0]=120,e[1]=1;let t=2;for(let c=0;c<r;c++){let i=c*65535,l=Math.min(65535,o.length-i);e[t++]=c===r-1?1:0,e[t++]=l&255,e[t++]=l>>>8,e[t++]=~l&255,e[t++]=~l>>>8&255,e.set(o.subarray(i,i+l),t),t+=l;}let n=E(o);return e[t++]=n>>>24,e[t++]=n>>>16&255,e[t++]=n>>>8&255,e[t++]=n&255,e}async function V(o){if(typeof CompressionStream=="function"&&typeof Response=="function")try{let r=new Blob([o]).stream().pipeThrough(new CompressionStream("deflate"));return new Uint8Array(await new Response(r).arrayBuffer())}catch{}return L(o)}function _(o,r,e){let t=o+r-e,n=Math.abs(t-o),c=Math.abs(t-r),i=Math.abs(t-e);return n<=c&&n<=i?o:c<=i?r:e}function G(o,r){let e=0;for(let t=0;t<r;t++){let n=o[t];e+=n<128?n:256-n;}return e}var D=2155905152;function O(o,r){return (o|D)-(r&~D)^(o^r^D)&D}function T(o){let r=o>>>7&16843009,e=(o^r*255)+r,t=(e&16711935)+(e>>>8&16711935);return (t&65535)+(t>>>16)}function N(o,r,e){let t=o instanceof Uint8Array||o instanceof Uint8ClampedArray?new Uint8Array(o.buffer,o.byteOffset,o.length):Uint8Array.from(o),n=r*4,c=t.byteOffset%4===0?new Uint32Array(t.buffer,t.byteOffset,r*e):null,i=new Uint8Array((n+1)*e),l=new Uint8Array(n),x=new Uint8Array(n),h=new Uint32Array(l.buffer),m=new Uint32Array(x.buffer),w=new Uint8Array(n);for(let b=0;b<e;b++){(b&63)===0&&chunkDO2CGP4P_js.c();let u=b*n,d=u-n,S=b*(n+1);if(c&&b>0){let s=u>>2,f=d>>2,a=true;for(let y=0;y<r;y++)if(c[s+y]!==c[f+y]){a=false;break}if(a){i[S]=2;continue}}let I=t.subarray(u,u+n),U=0,k=u>>2;if(c)for(let s=0;s<r;s++)U+=T(c[k+s]);else U=G(I,n);if(U===0){i.set(I,S+1);continue}let g=0,p=0;if(c){let s=0;for(let f=0;f<r;f++){let a=c[k+f],y=O(a,s);h[f]=y,g+=T(y),s=a;}if(b>0)for(let f=0;f<r;f++){let a=O(c[k+f],c[k-r+f]);m[f]=a,p+=T(a);}else p=U;}else {for(let s=0;s<4&&s<n;s++){let f=t[u+s];l[s]=f,g+=f<128?f:256-f;}for(let s=4;s<n;s++){let f=t[u+s]-t[u+s-4]&255;l[s]=f,g+=f<128?f:256-f;}if(b>0)for(let s=0;s<n;s++){let f=t[u+s]-t[d+s]&255;x[s]=f,p+=f<128?f:256-f;}else p=U;}let B=I,M=0,A=U;if(g<A&&(A=g,B=l,M=1),p<A&&(A=p,B=x,M=2),b>0&&A>n>>3){w.set(x.subarray(0,4));let s=0;for(let f=0;f<4&&f<n;f++){let a=x[f];s+=a<128?a:256-a;}for(let f=4;f<n&&s<A;f++){let a=t[u+f-4],y=t[d+f],R=t[d+f-4],P=t[u+f]-_(a,y,R)&255;w[f]=P,s+=P<128?P:256-P;}s<A&&(B=w,M=4);}i[S]=M,i.set(B,S+1);}return i}function C(o,r){let e=new Uint8Array(12+r.length),t=new DataView(e.buffer);t.setUint32(0,r.length);for(let n=0;n<4;n++)e[4+n]=o.charCodeAt(n);return e.set(r,8),t.setUint32(8+r.length,z(e,4,8+r.length)),e}async function j(o,r,e){let t=new Uint8Array(13),n=new DataView(t.buffer);n.setUint32(0,r),n.setUint32(4,e),t[8]=8,t[9]=6;let c=await V(N(o,r,e)),i=[Uint8Array.of(137,80,78,71,13,10,26,10),C("IHDR",t),C("IDAT",c),C("IEND",new Uint8Array(0))],l=i.reduce((m,w)=>m+w.length,0),x=new Uint8Array(l),h=0;for(let m of i)x.set(m,h),h+=m.length;return x}exports.a=V;exports.b=j;
@@ -0,0 +1 @@
1
+ 'use strict';var i=class{constructor(n){this.sliceStart=0;this.reason=null;this.signal=n.signal,this.timeoutMs=typeof n.timeoutMs=="number"&&n.timeoutMs>=0?n.timeoutMs:void 0,this.deadline=this.timeoutMs===void 0?1/0:performance.now()+this.timeoutMs,this.yields=!!this.signal;}check(){if(this.reason)throw this.reason.value;if(this.signal?.aborted)this.reason={value:this.signal.reason};else if(performance.now()>this.deadline)this.reason={value:s()};else return;throw this.reason.value}throwIfTripped(){if(this.reason)throw this.reason.value}get tripped(){return this.reason!==null}remaining(){return {signal:this.signal,timeoutMs:this.timeoutMs===void 0?void 0:Math.max(0,this.deadline-performance.now())}}};function s(){return new DOMException("The operation was aborted due to timeout","TimeoutError")}var o=Symbol("emf-converter.budget");function c(e){return e?e[o]?e[o]:e.signal===void 0&&e.timeoutMs===void 0?null:new i(e):null}var t=null;function f(){t&&t.check();}function h(){return t!==null&&t.yields&&performance.now()-t.sliceStart>16}function l(e,n){let r=t;t=e,e.sliceStart=performance.now();try{e.check();let u=n();return e.throwIfTripped(),u}finally{t=r;}}function a(e,n){return e?l(e,n):n()}function d(){return new Promise(e=>setTimeout(e,0))}async function m(e,n){for(;;){let r=a(e,()=>n.next());if(r.done)return r.value;await d(),e?.check();}}function p(e){for(;;){let n=e.next();if(n.done)return n.value}}exports.a=o;exports.b=c;exports.c=f;exports.d=h;exports.e=a;exports.f=m;exports.g=p;
@@ -0,0 +1 @@
1
+ var _=[137,80,78,71,13,10,26,10];function G(n){return n.length>=8&&_.every((o,s)=>n[s]===o)}async function O(n){if(typeof DecompressionStream=="function"&&typeof Response=="function")try{let o=new Blob([n]).stream().pipeThrough(new DecompressionStream("deflate"));return new Uint8Array(await new Response(o).arrayBuffer())}catch{}return z(n)}var X=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],Z=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],V=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],j=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],q=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function P(n,o){let s=new Uint16Array(16);for(let t=0;t<o;t++)s[n[t]]++;s[0]=0;let a=new Uint16Array(16);for(let t=1;t<16;t++)a[t]=a[t-1]+s[t-1];let r=new Uint16Array(o);for(let t=0;t<o;t++)n[t]&&(r[a[n[t]]++]=t);return {counts:s,symbols:r}}function z(n){let o=2,s=0,a=0,r=new Uint8Array(Math.max(1024,n.length*4)),t=0,w=m=>{if(t+m>r.length){let c=new Uint8Array(Math.max(r.length*2,t+m));c.set(r.subarray(0,t)),r=c;}},f=m=>{for(;a<m;){if(o>=n.length)throw new Error("inflate: unexpected end of data");s|=n[o++]<<a,a+=8;}let c=s&(1<<m)-1;return s>>>=m,a-=m,c},i=m=>{let c=0,M=0,l=0;for(let p=1;p<16;p++){c|=f(1);let R=m.counts[p];if(c-R<M)return m.symbols[l+(c-M)];l+=R,M=M+R<<1,c<<=1;}throw new Error("inflate: bad Huffman code")},y=null,H=null,h=0;for(;!h;){h=f(1);let m=f(2);if(m===0){s=0,a=0;let l=n[o]|n[o+1]<<8;o+=4,w(l),r.set(n.subarray(o,o+l),t),t+=l,o+=l;continue}let c,M;if(m===1){if(!y||!H){let l=new Uint8Array(288);l.fill(8,0,144),l.fill(9,144,256),l.fill(7,256,280),l.fill(8,280,288),y=P(l,288),H=P(new Uint8Array(30).fill(5),30);}c=y,M=H;}else if(m===2){let l=f(5)+257,p=f(5)+1,R=f(4)+4,u=new Uint8Array(19);for(let d=0;d<R;d++)u[q[d]]=f(3);let v=P(u,19),S=new Uint8Array(l+p);for(let d=0;d<l+p;){let D=i(v);if(D<16)S[d++]=D;else if(D===16){let T=S[d-1];for(let B=3+f(2);B>0;B--)S[d++]=T;}else D===17?d+=3+f(3):d+=11+f(7);}c=P(S.subarray(0,l),l),M=P(S.subarray(l),p);}else throw new Error("inflate: invalid block type");for(;;){let l=i(c);if(l<256)w(1),r[t++]=l;else {if(l===256)break;{let p=l-257,R=X[p]+f(Z[p]),u=i(M),v=V[u]+f(j[u]);w(R);for(let S=0;S<R;S++)r[t]=r[t-v],t++;}}}}return r.subarray(0,t)}var F=[[0,0,8,8],[4,0,8,8],[0,4,4,8],[2,0,4,4],[0,2,2,4],[1,0,2,2],[0,1,1,2]];function J(n,o,s){let a=n+o-s,r=Math.abs(a-n),t=Math.abs(a-o),w=Math.abs(a-s);return r<=t&&r<=w?n:t<=w?o:s}function K(n,o,s,a,r){let t=-1;for(let w=0;w<a;w++){let f=n[o],i=o+1;for(let y=0;y<s;y++){let H=y>=r?n[i+y-r]:0,h=t>=0?n[t+y]:0,m=t>=0&&y>=r?n[t+y-r]:0,c=n[i+y];switch(f){case 1:c+=H;break;case 2:c+=h;break;case 3:c+=H+h>>1;break;case 4:c+=J(H,h,m);break}n[i+y]=c&255;}t=i,o=i+s;}return o}async function Q(n){if(!G(n))return null;let o=new DataView(n.buffer,n.byteOffset,n.byteLength),s=0,a=0,r=0,t=-1,w=0,f=null,i=null,y=[],H=0;for(let e=8;e+12<=n.length;){let E=o.getUint32(e),U=String.fromCharCode(n[e+4],n[e+5],n[e+6],n[e+7]),g=n.subarray(e+8,Math.min(n.length,e+8+E));if(U==="IHDR"&&g.length>=13)s=o.getUint32(e+8),a=o.getUint32(e+12),r=g[8],t=g[9],w=g[12];else if(U==="PLTE")f=g;else if(U==="tRNS")i=g;else if(U==="IDAT")y.push(g),H+=g.length;else if(U==="IEND")break;e+=12+E;}let h={0:1,2:3,3:1,4:2,6:4}[t],m=t===0?[1,2,4,8,16].includes(r):t===3?[1,2,4,8].includes(r):[8,16].includes(r);if(!h||!m||s<=0||a<=0||H===0||t===3&&!f||s*a>268435456)return null;let c=new Uint8Array(H),M=0;for(let e of y)c.set(e,M),M+=e.length;let l;try{l=await O(c);}catch{return null}let p=h*r,R=Math.max(1,p>>3),u=new Uint8ClampedArray(s*a*4),v=(1<<r)-1,S=i&&t===0&&i.length>=2?i[0]<<8|i[1]:-1,d=i&&t===2&&i.length>=6?[i[0]<<8|i[1],i[2]<<8|i[3],i[4]<<8|i[5]]:null,D=(e,E)=>{if(r===8)return l[e+E];if(r===16)return l[e+E*2]<<8|l[e+E*2+1];let U=E*r;return l[e+(U>>3)]>>8-r-(U&7)&v},T=e=>r===16?e>>8:r===8?e:Math.round(e*255/v),B=(e,E,U,g,L)=>{for(let A=0;A<E;A++){let b=(U*s+g+A*L)*4;if(t===3){let x=D(e,A);u[b]=f[x*3]??0,u[b+1]=f[x*3+1]??0,u[b+2]=f[x*3+2]??0,u[b+3]=i&&x<i.length?i[x]:255;}else if(t===0||t===4){let x=D(e,A*h),k=T(x);u[b]=k,u[b+1]=k,u[b+2]=k,u[b+3]=t===4?T(D(e,A*h+1)):x===S?0:255;}else {let x=D(e,A*h),k=D(e,A*h+1),I=D(e,A*h+2);u[b]=T(x),u[b+1]=T(k),u[b+2]=T(I),u[b+3]=t===6?T(D(e,A*h+3)):d&&x===d[0]&&k===d[1]&&I===d[2]?0:255;}}},C=0,N=w===1?F:[[0,0,1,1]];for(let[e,E,U,g]of N){let L=Math.ceil((s-e)/U),A=Math.ceil((a-E)/g);if(L<=0||A<=0)continue;let b=Math.ceil(L*p/8);if(C+A*(b+1)>l.length)return null;let x=C;C=K(l,C,b,A,R);for(let k=0;k<A;k++)B(x+k*(b+1)+1,L,E+k*g,e,U);}return {width:s,height:a,data:u}}export{G as a,z as b,Q as c};
@@ -0,0 +1 @@
1
+ var g=Object.create;var f=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var m=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var n=(a,b)=>()=>{try{return b||a((b={exports:{}}).exports,b),b.exports}catch(c){throw b=0,c}};var l=(a,b,c,e)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of i(b))!k.call(a,d)&&d!==c&&f(a,d,{get:()=>b[d],enumerable:!(e=h(b,d))||e.enumerable});return a};var o=(a,b,c)=>(c=a!=null?g(j(a)):{},l(b||!a||!a.__esModule?f(c,"default",{value:a,enumerable:true}):c,a));export{m as a,n as b,o as c};
@@ -0,0 +1,2 @@
1
+ import {a as a$1,c}from'./chunk-DOQZZ5LA.mjs';import {a}from'./chunk-PO4H7QFT.mjs';import {a as a$2}from'./chunk-VQRM3TC4.mjs';async function Qt(){return null}async function ar(){return []}var _t=[1,0,0,1,0,0];function et(n,t){return [n[0]*t[0]+n[2]*t[1],n[1]*t[0]+n[3]*t[1],n[0]*t[2]+n[2]*t[3],n[1]*t[2]+n[3]*t[3],n[0]*t[4]+n[2]*t[5]+n[4],n[1]*t[4]+n[3]*t[5]+n[5]]}function Y(n){let t=n[0]*n[3]-n[1]*n[2];return !t||!Number.isFinite(t)?null:[n[3]/t,-n[1]/t,-n[2]/t,n[0]/t,(n[2]*n[5]-n[3]*n[4])/t,(n[1]*n[4]-n[0]*n[5])/t]}var nt=class n{constructor(){this.segs=[];this.cur=null;this.start=null;}reset(){this.segs=[],this.cur=null,this.start=null;}moveDevice(t){this.segs.push({t:"M",x:t.x,y:t.y}),this.cur=t,this.start=t;}lineDevice(t){if(!this.cur){this.moveDevice(t);return}this.segs.push({t:"L",x:t.x,y:t.y}),this.cur=t;}static map(t,e,r){return {x:t[0]*e+t[2]*r+t[4],y:t[1]*e+t[3]*r+t[5]}}moveTo(t,e,r){Number.isFinite(e)&&Number.isFinite(r)&&this.moveDevice(n.map(t,e,r));}lineTo(t,e,r){Number.isFinite(e)&&Number.isFinite(r)&&this.lineDevice(n.map(t,e,r));}curveUser(t,e,r,o,s,i,a){let c=n.map(t,e,r),u=n.map(t,o,s),l=n.map(t,i,a);this.cur||this.moveDevice(c),this.segs.push({t:"C",x1:c.x,y1:c.y,x2:u.x,y2:u.y,x:l.x,y:l.y}),this.cur=l;}bezierCurveTo(t,e,r,o,s,i,a){[e,r,o,s,i,a].every(Number.isFinite)&&this.curveUser(t,e,r,o,s,i,a);}quadraticCurveTo(t,e,r,o,s){if(![e,r,o,s].every(Number.isFinite))return;let i=Y(t),a=this.cur&&i?{x:i[0]*this.cur.x+i[2]*this.cur.y+i[4],y:i[1]*this.cur.x+i[3]*this.cur.y+i[5]}:{x:e,y:r};this.curveUser(t,a.x+2/3*(e-a.x),a.y+2/3*(r-a.y),o+2/3*(e-o),s+2/3*(r-s),o,s);}closePath(){this.cur&&(this.segs.push({t:"Z"}),this.cur=this.start);}rect(t,e,r,o,s){[e,r,o,s].every(Number.isFinite)&&(this.moveDevice(n.map(t,e,r)),this.lineDevice(n.map(t,e+o,r)),this.lineDevice(n.map(t,e+o,r+s)),this.lineDevice(n.map(t,e,r+s)),this.segs.push({t:"Z"}),this.moveDevice(n.map(t,e,r)));}ellipseUser(t,e,r,o,s,i,a,c,u){let l=Math.PI*2,m=c-a;u?m=-m>=l?-l:-((-m%l+l)%l):m=m>=l?l:(m%l+l)%l;let h=Math.cos(i),b=Math.sin(i),f=A=>{let R=o*Math.cos(A),g=s*Math.sin(A);return {x:e+R*h-g*b,y:r+R*b+g*h}},p=A=>{let R=-o*Math.sin(A),g=s*Math.cos(A);return {x:R*h-g*b,y:R*b+g*h}},M=f(a);if(this.lineDevice(n.map(t,M.x,M.y)),m===0)return;let x=Math.max(1,Math.ceil(Math.abs(m)/(Math.PI/2)-1e-9)),E=m/x,d=4/3*Math.tan(E/4);for(let A=0;A<x;A++){let R=a+A*E,g=R+E,S=f(R),y=f(g),P=p(R),T=p(g);this.curveUser(t,S.x+d*P.x,S.y+d*P.y,y.x-d*T.x,y.y-d*T.y,y.x,y.y);}}ellipse(t,e,r,o,s,i,a,c,u=false){if(o<0||s<0)throw new RangeError("The radii provided are negative");[e,r,o,s,i,a,c].every(Number.isFinite)&&this.ellipseUser(t,e,r,o,s,i,a,c,u);}arc(t,e,r,o,s,i,a=false){if(o<0)throw new RangeError("The radius provided is negative");[e,r,o,s,i].every(Number.isFinite)&&this.ellipseUser(t,e,r,o,o,0,s,i,a);}arcTo(t,e,r,o,s,i){if(![e,r,o,s,i].every(Number.isFinite)||i<0)return;if(!this.cur){this.moveDevice(n.map(t,e,r));return}let a=Y(t);if(!a)return;let c=a[0]*this.cur.x+a[2]*this.cur.y+a[4],u=a[1]*this.cur.x+a[3]*this.cur.y+a[5],l=c-e,m=u-r,h=o-e,b=s-r,f=Math.hypot(l,m),p=Math.hypot(h,b),M=l*b-m*h;if(i===0||f===0||p===0||Math.abs(M)<1e-12*f*p){this.lineDevice(n.map(t,e,r));return}let x=l/f,E=m/f,d=h/p,A=b/p,R=Math.acos(Math.max(-1,Math.min(1,x*d+E*A))),g=i/Math.tan(R/2),S={x:e+x*g,y:r+E*g},y={x:e+d*g,y:r+A*g},P=x+d,T=E+A,C=Math.hypot(P,T),L=i/Math.sin(R/2),_={x:e+P/C*L,y:r+T/C*L},w=Math.atan2(S.y-_.y,S.x-_.x),D=Math.atan2(y.y-_.y,y.x-_.x)-w;for(;D>Math.PI;)D-=2*Math.PI;for(;D<=-Math.PI;)D+=2*Math.PI;this.ellipseUser(t,_.x,_.y,i,i,0,w,w+D,D<0);}};function ft(n,t,e){let r=[],o=null,s=0,i=0,a=0,c=0,u=(l,m)=>{let h={pts:[l,m],smooth:[false],closed:false};return r.push(h),h};for(let l of n)switch(l.t){case "M":o=u(l.x,l.y),s=a=l.x,i=c=l.y;break;case "L":o||(o=u(s,i)),o.pts.push(l.x,l.y),o.smooth.push(false),a=l.x,c=l.y;break;case "C":{o||(o=u(s,i));let m=Math.max(Math.abs(a-2*l.x1+l.x2),Math.abs(l.x1-2*l.x2+l.x)),h=Math.max(Math.abs(c-2*l.y1+l.y2),Math.abs(l.y1-2*l.y2+l.y)),b=Math.hypot(m,h),f=e?e(a,c,l.x1,l.y1,l.x2,l.y2,l.x,l.y):Math.max(1,Math.min(1e3,Math.ceil(Math.sqrt(.75*b/t))));for(let p=1;p<=f;p++){let M=p/f,x=1-M,E=x*x*x,d=3*x*x*M,A=3*x*M*M,R=M*M*M;o.pts.push(E*a+d*l.x1+A*l.x2+R*l.x,E*c+d*l.y1+A*l.y2+R*l.y),o.smooth.push(p<f);}a=l.x,c=l.y;break}case "Z":o&&(o.closed=true,o=null,a=s,c=i);break}return r}function tn(n,t,e,r){let o=0,s=0;for(let i of n){let a=i.pts,c=a.length/2;if(!(c<2))for(let u=0;u<c;u++){let l=a[u*2],m=a[u*2+1],h=u+1<c?u+1:0,b=a[h*2],f=a[h*2+1];(m<=e?f>e:f<=e)&&l+(e-m)*(b-l)/(f-m)>t&&(s++,o+=f>m?1:-1);}}return r==="evenodd"?(s&1)===1:o!==0}function It(n){let t=/^\s*((?:(?:italic|oblique|normal|bold|bolder|lighter|small-caps|\d{3})\s+)*)([\d.]+)px\s+(.+)$/i.exec(n);if(!t)return {style:"",weight:"",size:10,family:"sans-serif"};let e=t[1].trim().split(/\s+/).filter(Boolean),r=e.find(s=>/^(italic|oblique)$/i.test(s))??"",o=e.find(s=>/^(bold|bolder|lighter|\d{3})$/i.test(s))??"";return {style:r,weight:o,size:parseFloat(t[2]),family:t[3].trim()}}function Ot(n,t){let e=0;for(let r of n)/[ilj.,;:'!|]/.test(r)?e+=.28:/[mwMW@]/.test(r)?e+=.83:/[A-Z0-9]/.test(r)?e+=.64:r===" "?e+=.28:r.charCodeAt(0)>11903?e+=1:e+=.52;return e*t}function nn(n,t,e,r,o,s,i){let a=It(r).size,c=Ot(n,a)*1.5+a;i!==void 0&&Number.isFinite(i)&&i>0&&(c=Math.min(c,i+a));let u=a*.3,l,m;o==="center"?(l=t-c/2,m=t+c/2):o==="right"||o==="end"?(l=t-c,m=t+u):(l=t-u,m=t+c);let h,b;switch(s){case "top":case "hanging":h=.3,b=1.5;break;case "middle":h=.9,b=.9;break;case "bottom":case "ideographic":h=1.5,b=.3;break;default:h=1.2,b=.5;}return {x0:l,y0:e-h*a,x1:m,y1:e+b*a}}var vt=new Float64Array(0),en=new Uint8Array(0),bt=[],G=new Float64Array(0);function re(n){if(G.length<n){let t=new Float64Array(Math.max(n,G.length*2,1024));t.set(G),G=t;}}function oe(n,t,e,r,o,s,i,a,c){if(i===c)return;let u=1;if(i>c){u=-1;let M=s;s=a,a=M,M=i,i=c,c=M;}let l=Math.max(0,i),m=Math.min(r,c);if(l>=m)return;let h=(M,x,E)=>{let d=M*e+x;n[d]+=E,t[d]||(t[d]=1,bt[M].push(x));},b=(a-s)/(c-i),f=Math.min(o,Math.max(0,s+(l-i)*b)),p=Math.ceil(m);for(let M=Math.floor(l);M<p;M++){let x=Math.min(M+1,m)-Math.max(M,l),E=f+b*x;E<0?E=0:E>o&&(E=o);let d=x*u,A=f<E?f:E,R=f<E?E:f,g=Math.floor(A),S=Math.ceil(R);if(S<=g+1){let y=.5*(f+E)-g;h(M,g,d-d*y),h(M,g+1,d*y);}else {let y=1/(R-A),P=A-g,T=.5*y*(1-P)*(1-P),C=R-S+1,L=.5*y*C*C;if(h(M,g,d*T),S===g+2)h(M,g+1,d*(1-T-L));else {let _=y*(1.5-P);h(M,g+1,d*(_-T));for(let I=g+2;I<S-1;I++)h(M,I,d*y);let w=_+(S-g-3)*y;h(M,S-1,d*(1-w-L));}h(M,S,d*L);}f=E;}}function se(n,t){let e;if(t){let r=Math.abs(n);r-=2*Math.floor(r/2),e=r>1?2-r:r;}else e=Math.abs(n),e>1&&(e=1);return Math.round(e*255)}var ie=(n,t)=>n-t;function rt(n,t,e,r){let o=1/0,s=1/0,i=-1/0,a=-1/0;for(let R of n)for(let g=0;g+1<R.length;g+=2){let S=R[g],y=R[g+1];S<o&&(o=S),S>i&&(i=S),y<s&&(s=y),y>a&&(a=y);}if(!(o<=i)||!(s<=a)||!Number.isFinite(o+i+s+a))return null;let c=Math.max(e.x0,Math.floor(o)),u=Math.max(e.y0,Math.floor(s)),l=Math.min(e.x1,Math.ceil(i)),m=Math.min(e.y1,Math.ceil(a));if(l<=c||m<=u)return null;let h=l-c,b=0,f=(R,g,S,y)=>{g!==y&&(re((b+1)*4),G[b*4]=R,G[b*4+1]=g,G[b*4+2]=S,G[b*4+3]=y,b++);},p=(R,g,S,y)=>{if(!(g===y||Math.max(g,y)<=u||Math.min(g,y)>=m)&&!(R>=h&&S>=h)){if(R>h||S>h){let P=(h-R)/(S-R),T=g+(y-g)*P;R>h?(R=h,g=T):(S=h,y=T);}if(R<=0&&S<=0){f(0,g,0,y);return}if(R<0||S<0){let P=(0-R)/(S-R),T=g+(y-g)*P;R<0?(f(0,g,0,T),f(0,T,S,y)):(f(R,g,0,T),f(0,T,0,y));return}f(R,g,S,y);}};for(let R of n){let g=R.length>>1;if(!(g<2))for(let S=0;S<g;S++){let y=S+1<g?S+1:0;p(R[S*2]-c,R[S*2+1],R[y*2]-c,R[y*2+1]);}}if(b===0)return null;let M=h+2,x=Math.max(1,Math.min(m-u,Math.floor(1048576/M)));for(vt.length<x*M&&(vt=new Float64Array(x*M),en=new Uint8Array(x*M));bt.length<x;)bt.push([]);let E=vt,d=en,A=t==="evenodd";for(let R=u;R<m;R+=x){let g=Math.min(x,m-R);for(let S=0;S<b;S++){let y=S*4,P=G[y+1]-R,T=G[y+3]-R;P<=0&&T<=0||P>=g&&T>=g||oe(E,d,M,g,h,G[y],P,G[y+2],T);}for(let S=0;S<g;S++){let y=bt[S];if(y.length===0)continue;y.sort(ie);let P=S*M,T=R+S,C=0;for(let L=0;L<y.length;L++){let _=y[L];if(C+=E[P+_],E[P+_]=0,d[P+_]=0,_>=h)continue;let w=L+1<y.length?Math.min(y[L+1],h):h,I=se(C,A);I&&r(T,c+_,c+w,I);}y.length=0;}}return {x0:c,y0:u,x1:l,y1:m}}var ae={black:0,white:16777215,red:16711680,lime:65280,green:32768,blue:255,yellow:16776960,cyan:65535,aqua:65535,magenta:16711935,fuchsia:16711935,gray:8421504,grey:8421504,silver:12632256,maroon:8388608,olive:8421376,teal:32896,navy:128,purple:8388736,orange:16753920,darkgray:11119017,darkgrey:11119017,lightgray:13882323,lightgrey:13882323,dimgray:6908265,dimgrey:6908265,whitesmoke:16119285,gainsboro:14474460},xt=new Map;function dt(n){let t=xt.get(n);if(t!==void 0)return t;let e=ce(n.trim().toLowerCase());return xt.size>4096&&xt.clear(),xt.set(n,e),e}function ce(n){if(n==="transparent")return [0,0,0,0];if(n[0]==="#"){let r=n.slice(1);if(!/^[0-9a-f]+$/.test(r))return null;if(r.length===3||r.length===4){let o=[...r].map(s=>parseInt(s+s,16));return [o[0],o[1],o[2],r.length===4?o[3]/255:1]}return r.length===6||r.length===8?[parseInt(r.slice(0,2),16),parseInt(r.slice(2,4),16),parseInt(r.slice(4,6),16),r.length===8?parseInt(r.slice(6,8),16)/255:1]:null}let t=/^rgba?\(([^)]*)\)$/.exec(n);if(t){let r=t[1].split(/[\s,/]+/).filter(Boolean);if(r.length<3)return null;let o=a=>{let c=a.endsWith("%")?parseFloat(a)*255/100:parseFloat(a);return Math.max(0,Math.min(255,Math.round(c)))},s=r.length>3?r[3].endsWith("%")?parseFloat(r[3])/100:parseFloat(r[3]):1,i=[o(r[0]),o(r[1]),o(r[2])];return i.some(a=>!Number.isFinite(a))||!Number.isFinite(s)?null:[i[0],i[1],i[2],Math.max(0,Math.min(1,s))]}let e=ae[n];return e===void 0?null:[e>>16&255,e>>8&255,e&255,1]}var H=class{constructor(t,e){this.kind=t;this.coords=e;this.stops=[];this.sorted=null;}addColorStop(t,e){if(!(t>=0&&t<=1))throw new RangeError("Gradient stop offset out of range");let r=dt(e);if(!r)throw new SyntaxError(`Invalid colour: ${e}`);this.stops.push({offset:t,color:r}),this.sorted=null;}sortedStops(){return this.sorted||(this.sorted=this.stops.map((t,e)=>({s:t,i:e})).sort((t,e)=>t.s.offset-e.s.offset||t.i-e.i).map(t=>t.s)),this.sorted}},V=class{constructor(t,e,r,o){this.data=t;this.width=e;this.height=r;this.repetition=o;this.matrix=[1,0,0,1,0,0];}setTransform(t){let e=[t?.a??1,t?.b??0,t?.c??0,t?.d??1,t?.e??0,t?.f??0];e.every(Number.isFinite)&&(this.matrix=e);}};function rn(n,t,e){let r,o=n.length;if(t<=n[0].offset)r=n[0].color;else if(t>=n[o-1].offset)r=n[o-1].color;else {let s=0,i=o-1;for(;i-s>1;){let h=s+i>>1;n[h].offset<=t?s=h:i=h;}let a=n[s],c=n[i],u=c.offset-a.offset,l=u>0?(t-a.offset)/u:1,m=a.color[3]+(c.color[3]-a.color[3])*l;e[0]=(a.color[0]+(c.color[0]-a.color[0])*l)*m,e[1]=(a.color[1]+(c.color[1]-a.color[1])*l)*m,e[2]=(a.color[2]+(c.color[2]-a.color[2])*l)*m,e[3]=m*255;return}e[0]=r[0]*r[3],e[1]=r[1]*r[3],e[2]=r[2]*r[3],e[3]=r[3]*255;}function ue(n,t){let e=n.sortedStops(),r=Y(t);if(e.length===0||!r)return null;let o=n.coords;if(n.kind==="linear"){let[p,M,x,E]=o,d=x-p,A=E-M,R=d*d+A*A;return R>0?{shade(g,S,y){let P=g+.5,T=S+.5,C=r[0]*P+r[2]*T+r[4],L=r[1]*P+r[3]*T+r[5];return rn(e,((C-p)*d+(L-M)*A)/R,y),true}}:null}let[s,i,a,c,u,l]=o;if(s===c&&i===u&&a===l)return null;let m=c-s,h=u-i,b=l-a,f=m*m+h*h-b*b;return {shade(p,M,x){let E=p+.5,d=M+.5,A=r[0]*E+r[2]*d+r[4]-s,R=r[1]*E+r[3]*d+r[5]-i,g=A*m+R*h+a*b,S=A*A+R*R-a*a,y;if(Math.abs(f)<1e-12){if(Math.abs(g)<1e-12||(y=S/(2*g),a+y*b<0))return false}else {let P=g*g-f*S;if(P<0)return false;let T=Math.sqrt(P),C=(g+T)/f,L=(g-T)/f,_=Math.max(C,L),w=Math.min(C,L);if(a+_*b>=0)y=_;else if(a+w*b>=0)y=w;else return false}return rn(e,y,x),true}}}function on(n,t){let e=n%t;return e<0?e+t:e}function le(n,t,e,r){if(n.transparentOutside&&(!n.wrapX&&(t<n.minX||t>=n.maxX)||!n.wrapY&&(e<n.minY||e>=n.maxY)))return false;let o=n.data,s=n.width,i=T=>n.wrapX?on(T,s):Math.min(n.maxX-1,Math.max(n.minX,T)),a=T=>n.wrapY?on(T,n.height):Math.min(n.maxY-1,Math.max(n.minY,T));if(!n.smooth){let T=(a(Math.floor(e))*s+i(Math.floor(t)))*4;return r[0]=o[T],r[1]=o[T+1],r[2]=o[T+2],r[3]=o[T+3],true}let c=t-.5,u=e-.5,l=Math.floor(c),m=Math.floor(u),h=c-l,b=u-m,f=i(l),p=i(l+1),M=a(m)*s,x=a(m+1)*s,E=(M+f)*4,d=(M+p)*4,A=(x+f)*4,R=(x+p)*4,g=(1-h)*(1-b),S=h*(1-b),y=(1-h)*b,P=h*b;for(let T=0;T<4;T++)r[T]=o[E+T]*g+o[d+T]*S+o[A+T]*y+o[R+T]*P;return true}function wt(n,t){let e=Y(t);return e?{shade(r,o,s){let i=r+.5,a=o+.5;return le(n,e[0]*i+e[2]*a+e[4],e[1]*i+e[3]*a+e[5],s)}}:null}function ot(n,t,e){if(typeof n=="string"){let r=dt(n);return r?{solid:[r[0]*r[3],r[1]*r[3],r[2]*r[3],r[3]*255]}:null}if(n instanceof H)return ue(n,t);if(n instanceof V){let r=n.repetition,o=r==="repeat"||r==="repeat-x",s=r==="repeat"||r==="repeat-y";return wt({data:n.data,width:n.width,height:n.height,wrapX:o,wrapY:s,minX:0,minY:0,maxX:n.width,maxY:n.height,transparentOutside:true,smooth:e},et(t,n.matrix))}return null}var un=new Set(["copy","source-in","source-out","destination-in","destination-atop"]),Nt={multiply:(n,t)=>n*t,screen:(n,t)=>n+t-n*t,overlay:(n,t)=>sn(t,n),darken:(n,t)=>Math.min(n,t),lighten:(n,t)=>Math.max(n,t),"color-dodge":(n,t)=>t===0?0:n>=1?1:Math.min(1,t/(1-n)),"color-burn":(n,t)=>t>=1?1:n<=0?0:1-Math.min(1,(1-t)/n),"hard-light":(n,t)=>sn(n,t),"soft-light":(n,t)=>{if(n<=.5)return t-(1-2*n)*t*(1-t);let e=t<=.25?((16*t-12)*t+4)*t:Math.sqrt(t);return t+(2*n-1)*(e-t)},difference:(n,t)=>Math.abs(n-t),exclusion:(n,t)=>n+t-2*n*t};function sn(n,t){return n<=.5?t*2*n:Nt.screen(2*n-1,t)}function Z(n,t,e){return .3*n+.59*t+.11*e}function me(n){let t=Z(n[0],n[1],n[2]),e=Math.min(n[0],n[1],n[2]),r=Math.max(n[0],n[1],n[2]),[o,s,i]=n;return e<0&&(o=t+(o-t)*t/(t-e),s=t+(s-t)*t/(t-e),i=t+(i-t)*t/(t-e)),r>1&&(o=t+(o-t)*(1-t)/(r-t),s=t+(s-t)*(1-t)/(r-t),i=t+(i-t)*(1-t)/(r-t)),[o,s,i]}function pt(n,t){let e=t-Z(n[0],n[1],n[2]);return me([n[0]+e,n[1]+e,n[2]+e])}function an(n){return Math.max(n[0],n[1],n[2])-Math.min(n[0],n[1],n[2])}function cn(n,t){let e=[0,1,2].sort((a,c)=>n[a]-n[c]),r=[0,0,0],[o,s,i]=e;return n[i]>n[o]&&(r[s]=(n[s]-n[o])*t/(n[i]-n[o]),r[i]=t),r}var ln={hue:(n,t)=>pt(cn(n,an(t)),Z(t[0],t[1],t[2])),saturation:(n,t)=>pt(cn(t,an(n)),Z(t[0],t[1],t[2])),color:(n,t)=>pt(n,Z(t[0],t[1],t[2])),luminosity:(n,t)=>pt(t,Z(n[0],n[1],n[2]))};function mn(n){return n in Nt||n in ln||["source-over","source-in","source-out","source-atop","destination-over","destination-in","destination-out","destination-atop","xor","copy","lighter"].includes(n)}function st(n,t,e,r,o,s,i,a){let c=n[t]/255,u=n[t+1]/255,l=n[t+2]/255,m=n[t+3]/255,h,b,f,p;switch(a){case "source-over":h=e+c*(1-s),b=r+u*(1-s),f=o+l*(1-s),p=s+m*(1-s);break;case "copy":h=e,b=r,f=o,p=s;break;case "destination-over":h=e*(1-m)+c,b=r*(1-m)+u,f=o*(1-m)+l,p=s*(1-m)+m;break;case "source-in":h=e*m,b=r*m,f=o*m,p=s*m;break;case "destination-in":h=c*s,b=u*s,f=l*s,p=m*s;break;case "source-out":h=e*(1-m),b=r*(1-m),f=o*(1-m),p=s*(1-m);break;case "destination-out":h=c*(1-s),b=u*(1-s),f=l*(1-s),p=m*(1-s);break;case "source-atop":h=e*m+c*(1-s),b=r*m+u*(1-s),f=o*m+l*(1-s),p=m;break;case "destination-atop":h=e*(1-m)+c*s,b=r*(1-m)+u*s,f=o*(1-m)+l*s,p=s;break;case "xor":h=e*(1-m)+c*(1-s),b=r*(1-m)+u*(1-s),f=o*(1-m)+l*(1-s),p=s*(1-m)+m*(1-s);break;case "lighter":h=Math.min(1,e+c),b=Math.min(1,r+u),f=Math.min(1,o+l),p=Math.min(1,s+m);break;default:{p=s+m-s*m;let M=s*m,x=[s>0?e/s:0,s>0?r/s:0,s>0?o/s:0],E=[m>0?c/m:0,m>0?u/m:0,m>0?l/m:0],d,A=Nt[a];if(A)d=[A(x[0],E[0]),A(x[1],E[1]),A(x[2],E[2])];else {let R=ln[a];if(!R){st(n,t,e,r,o,s,i,"source-over");return}d=R(x,E);}h=e*(1-m)+c*(1-s)+M*d[0],b=r*(1-m)+u*(1-s)+M*d[1],f=o*(1-m)+l*(1-s)+M*d[2];}}i<1&&(h=c+(h-c)*i,b=u+(b-u)*i,f=l+(f-l)*i,p=m+(p-m)*i),n[t]=h*255,n[t+1]=b*255,n[t+2]=f*255,n[t+3]=p*255;}function hn(n,t){let e=Math.abs(n),r=Math.abs(t);if(e<r){let o=e;e=r,r=o;}return e+r/2}function pn(n,t){let e=hn(n[0]*t,n[1]*t),r=hn(n[2]*t,n[3]*t);return e<=1&&r<=1?(e+r)/2:null}function dn(n,t,e,r,o,s,i,a){let c=i/3+2*n/3,u=a/3+2*t/3,l=n/3+2*i/3,m=t/3+2*a/3,h=Math.max(Math.abs(e-c),Math.abs(r-u),Math.abs(o-l),Math.abs(s-m)),b=1/8;for(let f=0;f<9;f++){if(h<b)return 1<<f;b*=4;}return 512}var Mt=32768;function fn(n,t){return Math.trunc(n*65536/t)}function bn(n,t){return n*t>>6}function Mn(n,t,e,r,o,s,i){let a=0,c=1,u=e-n,l=r-t,m=[[-u,n+1],[u,o+1-n],[-l,t+1],[l,s+1-t]];for(let[h,b]of m)if(h===0){if(b<0)return}else {let f=b/h;h<0?a=Math.max(a,f):c=Math.min(c,f);}a>c||Ft(Math.round((n+u*a)*64),Math.round((t+l*a)*64),Math.round((n+u*c)*64),Math.round((t+l*c)*64),i);}function Ft(n,t,e,r,o){if(Math.abs(e-n)>511*64||Math.abs(r-t)>511*64){let s=(n>>1)+(e>>1),i=(t>>1)+(r>>1);Ft(n,t,s,i,o),Ft(s,i,e,r,o);return}if(Math.abs(e-n)>Math.abs(r-t)){n>e&&([n,e]=[e,n],[t,r]=[r,t]);let s=n>>6,i=e+63>>6,a=t<<10,c=t===r?0:fn(r-t,e-n);a+=c*(32-(n&63))+32>>6,xn(s,i,a,c,e-n,n&63,e&63,(u,l,m,h)=>{m&&o(u,l-1,m),h&&o(u,l,h);});}else {if(n===e&&t===r)return;t>r&&([n,e]=[e,n],[t,r]=[r,t]);let s=t>>6,i=r+63>>6,a=n<<10,c=n===e?0:fn(e-n,r-t);a+=c*(32-(t&63))+32>>6,xn(s,i,a,c,r-t,t&63,r&63,(u,l,m,h)=>{m&&o(l-1,u,m),h&&o(l,u,h);});}}function xn(n,t,e,r,o,s,i,a){if(t<=n)return;let c,u;t-n===1?(c=o,u=0):(c=64-s,u=i);let l=(f,p,M)=>{p+=Mt;let x=p>>16,E=p>>8&255;return a(f,x,bn(255-E,M),bn(E,M)),p+r-Mt},m=l(n,e,c),h=n+1,b=t-h-(u>0?1:0);if(b>0){m+=Mt;for(let f=0;f<b;f++,h++){let p=m>>16,M=m>>8&255;a(h,p,255-M,M),m+=r;}m-=Mt;}u>0&&l(t-1,m,u);}var Q=1e-9;function En(n){let t=[],e=[],r=n.pts;for(let o=0;o<r.length;o+=2){let s=t.length;s>=2&&Math.abs(t[s-2]-r[o])<Q&&Math.abs(t[s-1]-r[o+1])<Q||(t.push(r[o],r[o+1]),e.push(n.smooth[o>>1]??false));}if(n.closed&&t.length>=4){let o=t.length;Math.abs(t[o-2]-t[0])<Q&&Math.abs(t[o-1]-t[1])<Q&&(t.length-=2,e.length-=1);}return e[0]=false,{pts:t,smooth:e,closed:n.closed}}function gn(n,t,e){let r=t.reduce((f,p)=>f+p,0);if(!(r>0))return [n];let o=n.pts,s=o.length>>1,i=n.closed?s:s-1;if(i<1)return [n];let a=e%r;a<0&&(a+=r);let c=0;for(;a>0&&a>=t[c];)a-=t[c],c=(c+1)%t.length;let u=t[c]-a,l=c%2===0,m=[],h=l?{pts:[o[0],o[1]],smooth:[false],closed:false}:null,b=l;for(let f=0;f<i;f++){let p=o[f*2],M=o[f*2+1],x=(f+1)%s,E=o[x*2],d=o[x*2+1],A=Math.hypot(E-p,d-M),R=0;for(;A-R>u;){R+=u;let g=R/A,S=p+(E-p)*g,y=M+(d-M)*g;l&&h?(h.pts.push(S,y),h.smooth.push(false),h.pts.length===4&&Math.abs(h.pts[0]-S)<Q&&Math.abs(h.pts[1]-y)<Q&&(h.pts.length=2,h.smooth.length=1,h.dir=[(E-p)/A,(d-M)/A]),m.push(h),h=null):h={pts:[S,y],smooth:[false],closed:false,dir:[(E-p)/A,(d-M)/A]},l=!l,c=(c+1)%t.length,u=t[c];}u-=A-R,l&&h&&(h.pts.push(E,d),h.smooth.push(x===0?false:n.smooth[x]));}if(l&&h){if(n.closed&&b&&m.length>0){let f=m.shift();h.pts.push(...f.pts.slice(2)),h.smooth.push(...f.smooth.slice(1));}m.push(h);}for(let f of m)f.pts.length>2&&delete f.dir;return m}function Ut(n,t,e,r,o,s,i){let a=Math.ceil(Math.abs(s)/i);for(let c=1;c<a;c++){let u=o+s*c/a;n.push(t+r*Math.cos(u),e+r*Math.sin(u));}}function he(n,t,e,r,o,s,i,a,c,u,l,m,h,b,f){let p=t+a*m,M=e+c*m,x=t+u*m,E=e+l*m,d=r*s+o*i,A=r*i-o*s;if(n.push(p,M),Math.abs(A)<1e-12&&d>0)return;if(!(a*s+c*i<0||Math.abs(A)<1e-12&&d<0)){n.push(t,e),n.push(x,E);return}if(h==="round"){let g=Math.atan2(c,a),S=Math.atan2(l,u)-g;for(;S<=-Math.PI;)S+=2*Math.PI;for(;S>Math.PI;)S-=2*Math.PI;Math.abs(A)<1e-12&&(S=Math.PI*Math.sign(a*o-c*r)),Ut(n,t,e,m,g,S,f);}else if(h==="miter"){let g=a*u+c*l,S=Math.sqrt(Math.max(0,(1+g)/2));if(S>1e-12&&1/S<=b){let y=a+u,P=c+l,T=Math.hypot(y,P);if(T>1e-12){let C=m/S;n.push(t+y/T*C,e+P/T*C);}}}n.push(x,E);}function fe(n,t,e,r){let o=t.lineWidth/2,s=n.pts,i=s.length>>1,a=t.lineCap;if(i===1){if(!r||n.closed||a==="butt")return [];let x=s[0],E=s[1],[d,A]=n.dir??[1,0];if(a==="round"){let S=[x+o,E];return Ut(S,x,E,o,0,2*Math.PI,e),[S]}let R=-A,g=d;return [[x+(d+R)*o,E+(A+g)*o,x+(-d+R)*o,E+(-A+g)*o,x+(-d-R)*o,E+(-A-g)*o,x+(d-R)*o,E+(A-g)*o]]}let c=n.closed?i:i-1,u=new Float64Array(c*2);for(let x=0;x<c;x++){let E=(x+1)%i,d=s[E*2]-s[x*2],A=s[E*2+1]-s[x*2+1],R=Math.hypot(d,A)||1;u[x*2]=d/R,u[x*2+1]=A/R;}let l=x=>{let E=[],d=n.closed?0:1,A=n.closed?i-1:i-2;n.closed||E.push(s[0]+x*u[1]*o,s[1]-x*u[0]*o);for(let R=d;R<=A;R++){let g=(R-1+c)%c,S=R%c,y=u[g*2],P=u[g*2+1],T=u[S*2],C=u[S*2+1],L=n.smooth[R]?"round":t.lineJoin;he(E,s[R*2],s[R*2+1],y,P,T,C,x*P,-x*y,x*C,-x*T,o,L,t.miterLimit,e);}if(!n.closed){let R=c-1;E.push(s[(i-1)*2]+x*u[R*2+1]*o,s[(i-1)*2+1]-x*u[R*2]*o);}return E},m=l(1),h=l(-1),b=x=>{let E=[];for(let d=x.length-2;d>=0;d-=2)E.push(x[d],x[d+1]);return E};if(n.closed)return [m,b(h)];let f=m.slice(),p=(x,E,d,A)=>{if(a==="square")f.push(x+(A+d)*o,E+(-d+A)*o),f.push(x+(-A+d)*o,E+(d+A)*o);else if(a==="round"){let R=Math.atan2(-d,A);Ut(f,x,E,o,R,Math.PI,e);}},M=i-1;return p(s[M*2],s[M*2+1],u[(c-1)*2],u[(c-1)*2+1]),f.push(...b(h)),p(s[0],s[1],-u[0],-u[1]),[f]}function Tn(n,t,e){let r=Y(t);if(!r)return [];let o=[];for(let s of n){let i={pts:new Array(s.pts.length),smooth:s.smooth,closed:s.closed};for(let u=0;u<s.pts.length;u+=2){let l=s.pts[u],m=s.pts[u+1];i.pts[u]=r[0]*l+r[2]*m+r[4],i.pts[u+1]=r[1]*l+r[3]*m+r[5];}let a=En(i),c=e.lineDash.length>0?gn(a,e.lineDash,e.lineDashOffset):[a];for(let u of c){let l=u.pts;for(let m=0;m<l.length;m+=2){let h=l[m],b=l[m+1];l[m]=t[0]*h+t[2]*b+t[4],l[m+1]=t[1]*h+t[3]*b+t[5];}o.push({pts:l,smooth:u.smooth,closed:u.closed});}}return o}function Dt(n,t,e,r){let o=Y(t);if(!o||!(e.lineWidth>0))return [];let s=Math.max(Math.hypot(t[0],t[1]),Math.hypot(t[2],t[3])),i=Math.max(1e-6,e.lineWidth/2*s),a=i<=r?Math.PI/2:Math.max(.05,2*Math.acos(1-r/i)),c=[];for(let u of n){let l={pts:new Array(u.pts.length),smooth:u.smooth,closed:u.closed};for(let f=0;f<u.pts.length;f+=2){let p=u.pts[f],M=u.pts[f+1];l.pts[f]=o[0]*p+o[2]*M+o[4],l.pts[f+1]=o[1]*p+o[3]*M+o[5];}let m=u.pts.length>=4,h=En(l),b=e.lineDash.length>0?gn(h,e.lineDash,e.lineDashOffset):[h];for(let f of b)for(let p of fe(f,e,a,m)){for(let M=0;M<p.length;M+=2){let x=p[M],E=p[M+1];p[M]=t[0]*x+t[2]*E+t[4],p[M+1]=t[1]*x+t[3]*E+t[5];}c.push(p);}}return c}var it=.05,kt=null;function be(){if(kt)return kt;let n=Math.fround,t=n(1/255),e=new Uint8Array(256*256);for(let r=1;r<256;r++){let o=n(1/n(r*t));for(let s=0;s<256;s++){let i=n(n(n(s*t)*o)*255),a=Math.min(Math.max(i,0),255),c=Math.floor(a),u=a-c;e[r<<8|s]=u>.5||u===.5&&c%2===1?c+1:c;}}return kt=e,e}var z=class{constructor(t,e){this.unknown=null;this.textDraws=0;this.width=Math.max(1,Math.floor(t)),this.height=Math.max(1,Math.floor(e)),this.data=new Uint8ClampedArray(this.width*this.height*4),this.words=new Uint32Array(this.data.buffer),this.ctx=new at(this);}getContext(t){return this.ctx}get pixels(){return this.readRgba(0,0,this.width,this.height)}readRgba(t,e,r,o){let s=new Uint8ClampedArray(Math.max(0,r*o*4)),{width:i,height:a,data:c}=this;for(let u=0;u<o;u++){let l=e+u;if(!(l<0||l>=a))for(let m=0;m<r;m++){let h=t+m;if(h<0||h>=i)continue;let b=(l*i+h)*4,f=(u*r+m)*4,p=c[b+3];if(p===255)s[f]=c[b],s[f+1]=c[b+1],s[f+2]=c[b+2],s[f+3]=255;else if(p!==0){let M=be(),x=p<<8;s[f]=M[x|c[b]],s[f+1]=M[x|c[b+1]],s[f+2]=M[x|c[b+2]],s[f+3]=p;}}}return s}unknownIn(t,e,r,o){let s=this.unknown;if(!s)return null;let i=null;for(let a=0;a<o;a++){let c=e+a;if(!(c<0||c>=this.height))for(let u=0;u<r;u++){let l=t+u;l>=0&&l<this.width&&s[c*this.width+l]&&(i??(i=new Uint8Array(r*o)),i[a*r+u]=1);}}return i}markUnknown(t,e=null){let r=e?e.box:{x0:0,y0:0,x1:this.width,y1:this.height};this.unknown??(this.unknown=new Uint8Array(this.width*this.height));let o=this.unknown;rt([t],"nonzero",r,(s,i,a)=>{for(let c=i;c<a;c++)(!e||j(e,c,s))&&(o[s*this.width+c]=1);});}};function Sr(n){return n instanceof z||n instanceof at}var xe=new Uint8Array(new Uint32Array([1]).buffer)[0]===1;function pe(n,t,e,r){let o=Math.round(n)&255,s=Math.round(t)&255,i=Math.round(e)&255,a=Math.round(r)&255;return (xe?a<<24|i<<16|s<<8|o:o<<24|s<<16|i<<8|a)>>>0}function j(n,t,e){let r=n.box;return t<r.x0||t>=r.x1||e<r.y0||e>=r.y1?0:n.mask?n.mask[(e-r.y0)*(r.x1-r.x0)+(t-r.x0)]:255}function Rn(n,t,e,r){let o=n[t*2]-n[e*2],s=n[t*2+1]-n[e*2+1],i=Math.hypot(o,s);i>0&&(n[t*2]+=o/i*r,n[t*2+1]+=s/i*r);}function de(n){let t=n.length>>1;if(t===5&&n[0]===n[8]&&n[1]===n[9]&&(t=4),t!==4)return null;let e=[n[0],n[2],n[4],n[6]],r=[n[1],n[3],n[5],n[7]];if(![...e,...r].every(Number.isInteger))return null;let o=r[0]===r[1]&&e[1]===e[2]&&r[2]===r[3]&&e[3]===e[0],s=e[0]===e[1]&&r[1]===r[2]&&e[2]===e[3]&&r[3]===r[0];return !o&&!s?null:{x0:Math.min(...e),y0:Math.min(...r),x1:Math.max(...e),y1:Math.max(...r)}}function Bt(n){if(n instanceof z)return {data:n.data,width:n.width,height:n.height};if(n instanceof at)return Bt(n.canvas);let t=n,e=null;if(t&&t.data instanceof Uint8ClampedArray&&typeof t.width=="number"&&typeof t.height=="number")e={data:t.data,width:t.width,height:t.height};else if(t&&typeof t.getContext=="function"&&typeof t.width=="number"&&typeof t.height=="number")try{let a=t.getContext("2d")?.getImageData?.(0,0,t.width,t.height);a&&(e={data:a.data,width:t.width,height:t.height});}catch{e=null;}if(!e||e.width<=0||e.height<=0)return null;let r=e.width*e.height*4;if(e.data.length<r)return null;let o=new Uint8ClampedArray(r),s=e.data;for(let i=0;i<r;i+=4){let a=s[i+3];if(a===255)o[i]=s[i],o[i+1]=s[i+1],o[i+2]=s[i+2],o[i+3]=255;else if(a!==0){let c=a/255;o[i]=s[i]*c,o[i+1]=s[i+1]*c,o[i+2]=s[i+2]*c,o[i+3]=a;}}return {data:o,width:e.width,height:e.height}}var at=class{constructor(t){this.state={transform:[..._t],fillStyle:"#000000",strokeStyle:"#000000",lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,lineDash:[],lineDashOffset:0,globalAlpha:1,gco:"source-over",font:"10px sans-serif",textAlign:"start",textBaseline:"alphabetic",imageSmoothingEnabled:true,imageSmoothingQuality:"low",clip:null};this.stack=[];this.path=new nt;this.flatCache=null;this.rowCache=null;this.px=new Float64Array(4);this.canvas=t;}get fillStyle(){return this.state.fillStyle}set fillStyle(t){this.acceptStyle(t)&&(this.state.fillStyle=t);}get strokeStyle(){return this.state.strokeStyle}set strokeStyle(t){this.acceptStyle(t)&&(this.state.strokeStyle=t);}acceptStyle(t){return typeof t=="string"&&dt(t)!==null||t instanceof H||t instanceof V}get lineWidth(){return this.state.lineWidth}set lineWidth(t){Number.isFinite(t)&&t>0&&(this.state.lineWidth=t);}get lineCap(){return this.state.lineCap}set lineCap(t){(t==="butt"||t==="round"||t==="square")&&(this.state.lineCap=t);}get lineJoin(){return this.state.lineJoin}set lineJoin(t){(t==="miter"||t==="round"||t==="bevel")&&(this.state.lineJoin=t);}get miterLimit(){return this.state.miterLimit}set miterLimit(t){Number.isFinite(t)&&t>0&&(this.state.miterLimit=t);}get lineDashOffset(){return this.state.lineDashOffset}set lineDashOffset(t){Number.isFinite(t)&&(this.state.lineDashOffset=t);}get globalAlpha(){return this.state.globalAlpha}set globalAlpha(t){Number.isFinite(t)&&t>=0&&t<=1&&(this.state.globalAlpha=t);}get globalCompositeOperation(){return this.state.gco}set globalCompositeOperation(t){mn(t)&&(this.state.gco=t);}get font(){return this.state.font}set font(t){this.state.font=t;}get textAlign(){return this.state.textAlign}set textAlign(t){this.state.textAlign=t;}get textBaseline(){return this.state.textBaseline}set textBaseline(t){this.state.textBaseline=t;}get imageSmoothingEnabled(){return this.state.imageSmoothingEnabled}set imageSmoothingEnabled(t){this.state.imageSmoothingEnabled=!!t;}get imageSmoothingQuality(){return this.state.imageSmoothingQuality}set imageSmoothingQuality(t){this.state.imageSmoothingQuality=t;}setLineDash(t){!Array.isArray(t)||t.some(e=>!Number.isFinite(e)||e<0)||(this.state.lineDash=t.length%2?[...t,...t]:[...t]);}getLineDash(){return [...this.state.lineDash]}save(){this.stack.push({...this.state,transform:[...this.state.transform],lineDash:[...this.state.lineDash]});}restore(){let t=this.stack.pop();t&&(this.state=t);}getTransform(){let[t,e,r,o,s,i]=this.state.transform;return {a:t,b:e,c:r,d:o,e:s,f:i}}setTransform(t,e,r,o,s,i){let a=typeof t=="object"?[t.a??1,t.b??0,t.c??0,t.d??1,t.e??0,t.f??0]:[t,e,r,o,s,i];a.every(Number.isFinite)&&(this.state.transform=a);}resetTransform(){this.state.transform=[..._t];}transform(t,e,r,o,s,i){[t,e,r,o,s,i].every(Number.isFinite)&&(this.state.transform=et(this.state.transform,[t,e,r,o,s,i]));}translate(t,e){this.transform(1,0,0,1,t,e);}scale(t,e){this.transform(t,0,0,e,0,0);}rotate(t){let e=Math.cos(t),r=Math.sin(t);this.transform(e,r,-r,e,0,0);}beginPath(){this.path.reset();}closePath(){this.path.closePath();}moveTo(t,e){this.path.moveTo(this.state.transform,t,e);}lineTo(t,e){this.path.lineTo(this.state.transform,t,e);}bezierCurveTo(t,e,r,o,s,i){this.path.bezierCurveTo(this.state.transform,t,e,r,o,s,i);}quadraticCurveTo(t,e,r,o){this.path.quadraticCurveTo(this.state.transform,t,e,r,o);}arc(t,e,r,o,s,i=false){this.path.arc(this.state.transform,t,e,r,o,s,i);}arcTo(t,e,r,o,s){this.path.arcTo(this.state.transform,t,e,r,o,s);}ellipse(t,e,r,o,s,i,a,c=false){this.path.ellipse(this.state.transform,t,e,r,o,s,i,a,c);}rect(t,e,r,o){this.path.rect(this.state.transform,t,e,r,o);}flattened(){let t=this.path.segs,e=this.flatCache;if(e&&e.segs===t&&e.length===t.length)return e.polys;let r=ft(t,it);return this.flatCache={segs:t,length:t.length,polys:r},this.rowCache=null,r}strokeParams(){let t=this.state;return {lineWidth:t.lineWidth,lineCap:t.lineCap,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset}}surfaceBounds(){let t=this.state.clip,e={x0:0,y0:0,x1:this.canvas.width,y1:this.canvas.height};return t&&(e.x0=Math.max(e.x0,t.box.x0),e.y0=Math.max(e.y0,t.box.y0),e.x1=Math.min(e.x1,t.box.x1),e.y1=Math.min(e.y1,t.box.y1)),e}paintRings(t,e,r){if(!r||t.length===0)return;let o=this.surfaceBounds();if(o.x1<=o.x0||o.y1<=o.y0)return;let s=this.state.gco;if(un.has(s)){this.paintUnbounded(t,e,r,o);return}let i=this.state.globalAlpha;if(i<=0)return;let{data:a,width:c}=this.canvas,u=this.state.clip?.mask?this.state.clip:null,l=this.canvas.unknown,m=this.px,h=r.solid,b=h?null:r.shade,f=h?h[0]*i/255:0,p=h?h[1]*i/255:0,M=h?h[2]*i/255:0,x=h?h[3]*i/255:0;if(h&&x<=0&&(s==="source-over"||s==="destination-out"||s==="source-atop"||s==="lighter"||s==="xor"))return;let E=h!==void 0&&x>=1&&s==="source-over",d=E?this.canvas.words:null,A=h?pe(h[0],h[1],h[2],255):0;rt(t,e,o,(R,g,S,y)=>{let P=R*c;if(d&&y===255&&!u){d.fill(A,P+g,P+S),l&&l.fill(0,P+g,P+S);return}let T=(P+g)*4,C=P+g;for(let L=g;L<S;L++,T+=4,C++){let _=y;if(u&&(_=_*j(u,L,R)/255),_<=0)continue;let w=_>=255?1:_/255,I=f,D=p,N=M,X=x;if(b){if(!b(L,R,m))continue;I=m[0]*i/255,D=m[1]*i/255,N=m[2]*i/255,X=m[3]*i/255;}E&&w===1?(a[T]=h[0],a[T+1]=h[1],a[T+2]=h[2],a[T+3]=255):st(a,T,I,D,N,X,w,s),l&&l[C]&&w===1&&X>=.9999&&(s==="source-over"||s==="destination-out")&&(l[C]=0);}});}paintUnbounded(t,e,r,o){let s=o.x1-o.x0,i=o.y1-o.y0,a=new Uint8Array(s*i);rt(t,e,o,(p,M,x,E)=>{let d=(p-o.y0)*s-o.x0;a.fill(E,d+M,d+x);});let{data:c,width:u}=this.canvas,l=this.state.clip,m=this.canvas.unknown,h=this.state.globalAlpha,b=this.state.gco,f=this.px;for(let p=o.y0;p<o.y1;p++)for(let M=o.x0;M<o.x1;M++){let x=l?j(l,M,p)/255:1;if(x<=0)continue;let E=a[(p-o.y0)*s+(M-o.x0)]/255,d=0,A=0,R=0,g=0;if(E>0){r.solid?[d,A,R,g]=r.solid:r.shade(M,p,f)&&([d,A,R,g]=f);let y=E*h/255;d*=y,A*=y,R*=y,g*=y;}let S=p*u+M;st(c,S*4,d,A,R,g,x,b),m&&x>=1&&b==="copy"&&(m[S]=0);}}fill(t="nonzero"){let e=this.flattened();this.paintRings(e.map(r=>r.pts),t==="evenodd"?"evenodd":"nonzero",ot(this.state.fillStyle,this.state.transform,this.state.imageSmoothingEnabled));}stroke(){this.strokeSegs(this.path.segs,this.flattened());}strokeSegs(t,e){let r=ot(this.state.strokeStyle,this.state.transform,this.state.imageSmoothingEnabled);if(!r)return;let o=pn(this.state.transform,this.state.lineWidth);if(o===null){let l=Dt(e,this.state.transform,this.strokeParams(),it);this.paintRings(l,"nonzero",r);return}let s=Tn(ft(t,it,dn),this.state.transform,this.strokeParams()),i=this.state.lineCap==="square"?.5:this.state.lineCap==="round"?Math.PI/8:0,{width:a,height:c}=this.canvas,u=this.hairlinePlotter(r,o);for(let l of s){let m=l.pts.slice(),h=m.length>>1;if(h<2)continue;i&&!l.closed&&(Rn(m,0,1,i),Rn(m,h-1,h-2,i));let b=l.closed?h:h-1;for(let f=0;f<b;f++){let p=(f+1)%h;Mn(m[f*2],m[f*2+1],m[p*2],m[p*2+1],a,c,u);}}}hairlinePlotter(t,e){let{data:r,width:o,height:s}=this.canvas,i=this.state.clip,a=this.state.gco,c=this.state.globalAlpha*Math.min(1,e),u=this.px;return (l,m,h)=>{if(l<0||m<0||l>=o||m>=s)return;let b=h/255;if(i&&(b*=j(i,l,m)/255),b<=0)return;let f,p,M,x;if(t.solid)[f,p,M,x]=t.solid;else {if(!t.shade(l,m,u))return;[f,p,M,x]=u;}let E=c/255;st(r,(m*o+l)*4,f*E,p*E,M*E,x*E,b,a);}}rectRing(t,e,r,o){let s=this.state.transform,i=[[t,e],[t+r,e],[t+r,e+o],[t,e+o]],a=[];for(let[c,u]of i)a.push(s[0]*c+s[2]*u+s[4],s[1]*c+s[3]*u+s[5]);return a}fillRect(t,e,r,o){![t,e,r,o].every(Number.isFinite)||r===0||o===0||this.paintRings([this.rectRing(t,e,r,o)],"nonzero",ot(this.state.fillStyle,this.state.transform,this.state.imageSmoothingEnabled));}strokeRect(t,e,r,o){if(![t,e,r,o].every(Number.isFinite))return;let s=new nt;s.rect(this.state.transform,t,e,r,o),this.strokeSegs(s.segs,ft(s.segs,it));}clearRect(t,e,r,o){if(![t,e,r,o].every(Number.isFinite)||r===0||o===0)return;let s={gco:this.state.gco,ga:this.state.globalAlpha};this.state.gco="destination-out",this.state.globalAlpha=1,this.paintRings([this.rectRing(t,e,r,o)],"nonzero",{solid:[0,0,0,255]}),this.state.gco=s.gco,this.state.globalAlpha=s.ga;}clip(t="nonzero"){let e=this.surfaceBounds(),r=this.state.clip,o=this.flattened().filter(u=>u.pts.length>=6).map(u=>u.pts),s={box:{x0:0,y0:0,x1:0,y1:0},mask:null},i=o.length===1?de(o[0]):null;if(i){let u={x0:Math.max(e.x0,i.x0),y0:Math.max(e.y0,i.y0),x1:Math.min(e.x1,i.x1),y1:Math.min(e.y1,i.y1)};if(u.x1<=u.x0||u.y1<=u.y0){this.state.clip=s;return}let l=null;if(r?.mask){let m=u.x1-u.x0;l=new Uint8Array(m*(u.y1-u.y0));for(let h=u.y0;h<u.y1;h++)for(let b=u.x0;b<u.x1;b++)l[(h-u.y0)*m+(b-u.x0)]=j(r,b,h);}this.state.clip={box:u,mask:l};return}let a=s,c=null;for(let u of o)for(let l=0;l+1<u.length;l+=2){let m=u[l],h=u[l+1];c??(c={x0:1/0,y0:1/0,x1:-1/0,y1:-1/0}),c.x0=Math.min(c.x0,m),c.y0=Math.min(c.y0,h),c.x1=Math.max(c.x1,m),c.y1=Math.max(c.y1,h);}if(c&&Number.isFinite(c.x0+c.x1+c.y0+c.y1)){let u={x0:Math.max(e.x0,Math.floor(c.x0)),y0:Math.max(e.y0,Math.floor(c.y0)),x1:Math.min(e.x1,Math.ceil(c.x1)),y1:Math.min(e.y1,Math.ceil(c.y1))};if(u.x1>u.x0&&u.y1>u.y0){let l=u.x1-u.x0,m=new Uint8Array(l*(u.y1-u.y0));rt(o,t==="evenodd"?"evenodd":"nonzero",u,(b,f,p,M)=>{let x=(b-u.y0)*l-u.x0;if(!r?.mask){m.fill(M,x+f,x+p);return}for(let E=f;E<p;E++)m[x+E]=Math.round(M*j(r,E,b)/255);})&&(a={box:u,mask:m});}}this.state.clip=a;}clipCoverage(t,e,r,o){let s=this.state.clip;if(!s)return null;let i=new Uint8Array(Math.max(0,r*o));for(let a=0;a<o;a++)for(let c=0;c<r;c++)i[a*r+c]=j(s,t+c,e+a);return i}isPointInPath(t,e,r="nonzero"){if(!Number.isFinite(t)||!Number.isFinite(e))return false;let o=this.flattened(),s=`${e}`,i=this.rowCache;if(!i||i.key!==s){let u=[],l=[];for(let f of o){let p=f.pts,M=p.length>>1;if(!(M<2))for(let x=0;x<M;x++){let E=x+1<M?x+1:0,d=p[x*2],A=p[x*2+1],R=p[E*2],g=p[E*2+1];(A<=e?g>e:g<=e)&&(u.push(d+(e-A)*(R-d)/(g-A)),l.push(g>A?1:-1));}}let m=u.map((f,p)=>p).sort((f,p)=>u[f]-u[p]),h=new Float64Array(m.length),b=new Int32Array(m.length+1);for(let f=0;f<m.length;f++)h[f]=u[m[f]];for(let f=m.length-1;f>=0;f--)b[f]=b[f+1]+l[m[f]];i={key:s,xs:h,suffixWinding:b,count:m.length},this.rowCache=i;}let a=0,c=i.count;for(;a<c;){let u=a+c>>1;i.xs[u]>t?c=u:a=u+1;}return r==="evenodd"?(i.count-a&1)===1:i.suffixWinding[a]!==0}isPointInStroke(t,e){let r=Dt(this.flattened(),this.state.transform,this.strokeParams(),it);return tn(r.map(o=>({pts:o,smooth:[],closed:true})),t,e,"nonzero")}createLinearGradient(t,e,r,o){return new H("linear",[t,e,r,o])}createRadialGradient(t,e,r,o,s,i){if(r<0||i<0)throw new RangeError("The radius provided is negative");return new H("radial",[t,e,r,o,s,i])}createPattern(t,e){let r=Bt(t);if(!r)return null;let o=e==="repeat-x"||e==="repeat-y"||e==="no-repeat"?e:"repeat";return new V(r.data.slice(),r.width,r.height,o)}measureText(t){let e=It(this.state.font).size,r=Ot(String(t),e);return {width:r,actualBoundingBoxLeft:0,actualBoundingBoxRight:r,actualBoundingBoxAscent:e*.8,actualBoundingBoxDescent:e*.2,fontBoundingBoxAscent:e*.9,fontBoundingBoxDescent:e*.25}}fillText(t,e,r,o){this.recordText(t,e,r,o,this.state.fillStyle);}strokeText(t,e,r,o){this.recordText(t,e,r,o,this.state.strokeStyle);}recordText(t,e,r,o,s){let i=String(t??"");if(!i.trim()||![e,r].every(Number.isFinite)||this.state.globalAlpha<=0)return;let a=ot(s,this.state.transform,true);if(!a||a.solid&&a.solid[3]<=0)return;this.canvas.textDraws++;let c=nn(i,e,r,this.state.font,this.state.textAlign,this.state.textBaseline,o),u=this.state.transform,l=[];for(let[m,h]of [[c.x0,c.y0],[c.x1,c.y0],[c.x1,c.y1],[c.x0,c.y1]])l.push(u[0]*m+u[2]*h+u[4],u[1]*m+u[3]*h+u[5]);this.canvas.markUnknown(l,this.state.clip);}drawImage(t,...e){let r=Bt(t);if(!r)return;(t===this.canvas||t===this)&&(r={...r,data:r.data.slice()});let o=0,s=0,i=r.width,a=r.height,c,u,l,m;if(e.length>=8?[o,s,i,a,c,u,l,m]=e:e.length>=4?[c,u,l,m]=e:([c,u]=e,l=i,m=a),![o,s,i,a,c,u,l,m].every(Number.isFinite)||!i||!a||!l||!m)return;i<0&&(o+=i,i=-i),a<0&&(s+=a,a=-a),l<0&&(c+=l,l=-l),m<0&&(u+=m,m=-m);let h=l/i,b=m/a,f=Math.max(0,o),p=Math.max(0,s),M=Math.min(r.width,o+i),x=Math.min(r.height,s+a);if(M<=f||x<=p)return;c+=(f-o)*h,u+=(p-s)*b,o=f,s=p,i=M-f,a=x-p;let E=[h,0,0,b,c-o*h,u-s*b],d=et(this.state.transform,E),A=wt({data:r.data,width:r.width,height:r.height,wrapX:false,wrapY:false,minX:Math.floor(o),minY:Math.floor(s),maxX:Math.ceil(o+i),maxY:Math.ceil(s+a),transparentOutside:false,smooth:this.state.imageSmoothingEnabled},d),R=d,g=[];for(let[S,y]of [[o,s],[o+i,s],[o+i,s+a],[o,s+a]])g.push(R[0]*S+R[2]*y+R[4],R[1]*S+R[3]*y+R[5]);this.paintRings([g],"nonzero",A);}createImageData(t,e){let r=Math.abs(Math.floor(t))||1,o=Math.abs(Math.floor(e))||1;return {data:new Uint8ClampedArray(r*o*4),width:r,height:o}}getImageData(t,e,r,o){let s=Math.floor(t),i=Math.floor(e),a=Math.floor(r),c=Math.floor(o);return a<0&&(s+=a,a=-a),c<0&&(i+=c,c=-c),{data:this.canvas.readRgba(s,i,a,c),width:a,height:c,colorSpace:"srgb"}}putImageData(t,e,r,o=0,s=0,i=t.width,a=t.height){let{width:c,height:u,data:l}=this.canvas,m=this.canvas.unknown,h=Math.round(e),b=Math.round(r);i<0&&(o+=i,i=-i),a<0&&(s+=a,a=-a);let f=Math.max(0,Math.floor(o)),p=Math.max(0,Math.floor(s)),M=Math.min(t.width,Math.floor(o+i)),x=Math.min(t.height,Math.floor(s+a)),E=t.data;for(let d=p;d<x;d++){let A=b+d;if(!(A<0||A>=u))for(let R=f;R<M;R++){let g=h+R;if(g<0||g>=c)continue;let S=(d*t.width+R)*4,y=(A*c+g)*4,P=E[S+3];if(P===255)l[y]=E[S],l[y+1]=E[S+1],l[y+2]=E[S+2];else {let T=P/255;l[y]=E[S]*T,l[y+1]=E[S+1]*T,l[y+2]=E[S+2]*T;}l[y+3]=P,m&&(m[A*c+g]=0);}}}};function Pr(n,t,e){let r=o=>o.toString(16).padStart(2,"0");return `#${r(n&255)}${r(t&255)}${r(e&255)}`}function Cr(n){let t=(n>>>24&255)/255,e=n>>>16&255,r=n>>>8&255,o=n&255;return `rgba(${e},${r},${o},${t.toFixed(3)})`}function Lr(n,t,e){let r=Math.min(1,Math.max(0,e)),o=(m,h)=>Math.round(m+(h-m)*r),s=n>>>24&255,i=t>>>24&255,a=o(n>>>16&255,t>>>16&255),c=o(n>>>8&255,t>>>8&255),u=o(n&255,t&255),l=o(s,i)/255;return `rgba(${a},${c},${u},${l.toFixed(3)})`}function Sn(n){let t=/^#([0-9a-f]{6})$/i.exec(n);if(t)return `#${(16777215^parseInt(t[1],16)).toString(16).padStart(6,"0")}`;let e=/^#([0-9a-f]{3})$/i.exec(n);if(e){let[o,s,i]=e[1].split("").map(c=>parseInt(c+c,16)),a=c=>(255-c).toString(16).padStart(2,"0");return `#${a(o)}${a(s)}${a(i)}`}let r=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+)\s*)?\)$/i.exec(n);if(r){let o=255-Math.min(255,parseInt(r[1],10)),s=255-Math.min(255,parseInt(r[2],10)),i=255-Math.min(255,parseInt(r[3],10));return r[4]!==void 0?`rgba(${o},${s},${i},${r[4]})`:`rgb(${o},${s},${i})`}return n}function yn(n,t,e,r,o,s,i,a,c,u){let l=0,m=o-1,h=t,b=t+e;for(;h+1<b&&m>=0;){let f=n.getUint8(h),p=n.getUint8(h+1);if(h+=2,f===0)if(p===0)l=0,m--;else {if(p===1)break;if(p===2){if(h+1>=b)break;l+=n.getUint8(h),m-=n.getUint8(h+1),h+=2;}else {let M=p;if(i){let x=Math.ceil(M/2),E=0;for(let d=0;d<x&&h<b;d++){let A=n.getUint8(h++);for(let R=0;R<2&&E<M;R++){let g=R===0?A>>4&15:A&15;g<a.length&&l<r&&u(l,o-1-m,a[g][0],a[g][1],a[g][2],255),l++,E++;}}x&1&&h++;}else {for(let x=0;x<M&&h<b&&l<r;x++){let E=n.getUint8(h++);E<a.length&&u(l,o-1-m,a[E][0],a[E][1],a[E][2],255),l++;}M&1&&h++;}}}else if(i){let M=p>>4&15,x=p&15;for(let E=0;E<f&&l<r;E++){let d=(E&1)===0?M:x;d<a.length&&u(l,o-1-m,a[d][0],a[d][1],a[d][2],255),l++;}}else {let M=p,x=M<a.length?a[M]:[0,0,0];for(let E=0;E<f&&l<r;E++)u(l,o-1-m,x[0],x[1],x[2],255),l++;}}return ct(new Uint8ClampedArray(c.buffer,c.byteOffset,c.byteLength),r,o)}function Gt(n){if(n===0)return 0;let t=0,e=n;for(;(e&1)===0;)e>>>=1,t++;return t}var Me=3;function An(n,t,e,r,o){let s=0,i=0,a=0,c=0,u=0,l=0,m=1,h=1,b=1;if(r===Me){let f=t+e;if(f+12>n.byteLength)return null;s=n.getUint32(f,true),i=n.getUint32(f+4,true),a=n.getUint32(f+8,true),c=Gt(s),u=Gt(i),l=Gt(a),m=s>>>c||1,h=i>>>u||1,b=a>>>l||1;}else o===16&&(s=31744,i=992,a=31,c=10,u=5,l=0,m=31,h=31,b=31);return {rMask:s,gMask:i,bMask:a,rShift:c,gShift:u,bShift:l,rMax:m,gMax:h,bMax:b}}function Pn(n,t,e,r,o,s,i,a,c,u=false){let l=Math.floor((s*e+31)/32)*4,{rMask:m,gMask:h,bMask:b,rShift:f,gShift:p,bShift:M,rMax:x,gMax:E,bMax:d}=a;for(let A=0;A<r;A++){let R=o?A:r-1-A,g=t+R*l;if(!(g+l>n.byteLength))for(let S=0;S<e;S++){let y=(A*e+S)*4;if(s===1){let P=g+(S>>3),T=n.getUint8(P)>>7-(S&7)&1;T<i.length&&(c[y]=i[T][0],c[y+1]=i[T][1],c[y+2]=i[T][2]),c[y+3]=255;}else if(s===4){let P=g+(S>>1),T=(S&1)===0?n.getUint8(P)>>4&15:n.getUint8(P)&15;T<i.length&&(c[y]=i[T][0],c[y+1]=i[T][1],c[y+2]=i[T][2]),c[y+3]=255;}else if(s===8){let P=n.getUint8(g+S);P<i.length&&(c[y]=i[P][0],c[y+1]=i[P][1],c[y+2]=i[P][2]),c[y+3]=255;}else if(s===16){let P=n.getUint16(g+S*2,true);c[y]=Math.round(((P&m)>>>f)*255/x),c[y+1]=Math.round(((P&h)>>>p)*255/E),c[y+2]=Math.round(((P&b)>>>M)*255/d),c[y+3]=255;}else if(s===24){let P=g+S*3;c[y]=n.getUint8(P+2),c[y+1]=n.getUint8(P+1),c[y+2]=n.getUint8(P),c[y+3]=255;}else {let P=g+S*4,T=n.getUint8(P),C=n.getUint8(P+1),L=n.getUint8(P+2),_=n.getUint8(P+3);c[y]=L,c[y+1]=C,c[y+2]=T,c[y+3]=_===0&&!u?255:_;}}}}function Et(n,t,e,r,o,s=false){if(t<0||e<0||t+40>n.byteLength||e+r>n.byteLength)return null;let i=n.getUint32(t,true);if(i<40||t+i>n.byteLength)return null;let a=n.getInt32(t+4,true),c=n.getInt32(t+8,true),u=n.getUint16(t+12,true),l=n.getUint16(t+14,true),m=n.getUint32(t+16,true);if(u!==1||a<=0||c===0||a>8192||Math.abs(c)>8192)return null;let h=0,b=1,f=2,p=3;if(l!==1&&l!==4&&l!==8&&l!==16&&l!==24&&l!==32||m===b&&l!==8||m===f&&l!==4||m===p&&l!==16&&l!==32||m!==h&&m!==b&&m!==f&&m!==p)return null;let M=Math.abs(c),x=c<0,E=[];if(l<=8){let R=1<<l,g=n.getUint32(t+32,true)||R,S=Math.min(g,R),y=t+i,P=!!o&&o.length>0;if(y+S*(P?2:4)>n.byteLength)return null;for(let T=0;T<S;T++){if(P){let w=n.getUint16(y+T*2,true),I=o[w<o.length?w:0];E.push([I>>16&255,I>>8&255,I&255]);continue}let C=n.getUint8(y+T*4),L=n.getUint8(y+T*4+1),_=n.getUint8(y+T*4+2);E.push([_,L,C]);}}let d=An(n,t,i,m,l);if(!d)return null;let A=new Uint8ClampedArray(a*M*4);return m===b||m===f?yn(n,e,r,a,M,x,m===f,E,A,(g,S,y,P,T,C)=>{let L=(S*a+g)*4;A[L]=y,A[L+1]=P,A[L+2]=T,A[L+3]=C;}):(Pn(n,e,a,M,x,l,E,d,A,s),ct(A,a,M))}var Cn=[[0,0,0,255,0,0,0,0],[8,8,8,8,8,8,8,8],[128,64,32,16,8,4,2,1],[1,2,4,8,16,32,64,128],[8,8,8,255,8,8,8,8],[129,66,36,24,24,36,66,129]];function Ee(n,t,e){return ((Cn[n]??Cn[0])[e&7]>>7-(t&7)&1)===1}function gt(n){let t=/^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(n.trim());if(!t)return 0;let e=t[1].length===3?t[1].replace(/./g,r=>r+r):t[1];return parseInt(e,16)}function ge(n,t,e){if(t+16>n.byteLength)return null;let r=n.getInt32(t+4,true),o=n.getInt32(t+8,true),s=n.getUint16(t+14,true),i=Math.abs(o);if(s!==1||r<=0||i===0||r>256||i>256)return null;let a=(r+31>>5)*4;if(e+a*i>n.byteLength)return null;let c=new Uint8Array(r*i);for(let u=0;u<i;u++){let l=o>0?i-1-u:u,m=e+u*a;for(let h=0;h<r;h++)c[l*r+h]=n.getUint8(m+(h>>3))>>7-(h&7)&1;}return {width:r,height:i,bits:c}}function kr(n,t,e,r,o=null){if(e+24>n.byteLength)return null;let s=n.getUint32(e+8,true),i=n.getUint32(e+16,true),a=n.getUint32(e+20,true),c=t+s,u=t+i,l=c+16<=n.byteLength?n.getUint16(c+14,true):0;if(r||l===1){let f=ge(n,c,u);if(f&&r)return {kind:"mono",...f}}let m=Et(n,c,u,a,o);if(!m)return null;let h=new Uint32Array(m.width*m.height),b=m.data;for(let f=0;f<h.length;f++)h[f]=b[f*4]<<16|b[f*4+1]<<8|b[f*4+2];return {kind:"bitmap",width:m.width,height:m.height,rgb:h}}function Ln(n){if(n.brushStyle===1)return {kind:"none"};let t=n.brushPattern;if(!t)return {kind:"solid",rgb:gt(n.brushColor)};if(t.kind==="bitmap")return {kind:"tile",width:t.width,height:t.height,rgb:t.rgb};let e=gt(n.bkColor);if(t.kind==="hatch"){let s=gt(n.brushColor),i=new Uint32Array(64);for(let a=0;a<8;a++)for(let c=0;c<8;c++)i[a*8+c]=Ee(t.hatch,c,a)?s:e;return {kind:"tile",width:8,height:8,rgb:i}}let r=gt(n.textColor),o=new Uint32Array(t.width*t.height);for(let s=0;s<o.length;s++)o[s]=t.bits[s]?e:r;return {kind:"tile",width:t.width,height:t.height,rgb:o}}function Br(n,t,e,r,o){let s=((t-r)%n.width+n.width)%n.width,i=((e-o)%n.height+n.height)%n.height;return n.rgb[i*n.width+s]}function Xr(n){let t=[],e=0;for(let r=0;r<n.length;r++)t.push(e),e+=n[r];return t}function $r(n){let t=0;for(let e of n)t+=e;return t}function Wr(n,t,e,r){let o=n.slice();if(e===0||r<=0)return o;let s=0;for(let i=0;i<o.length&&i<t.length;i++){if(t[i]!==32)continue;let a=Math.round(s*e/r);s++;let c=Math.round(s*e/r);o[i]+=c-a;}return o}function Yr(n,t){return t==="center"?-n/2:t==="right"?-n:0}var Te=Math.PI/180;function Hr(n){let e=(n%3600+3600)%3600*Xt/3600,r=Math.floor(e),o=e-r,s=r*2*Math.PI/Xt,i=(r+1)*2*Math.PI/Xt;return o===0?{sin:Math.sin(s),cos:Math.cos(s)}:{sin:(1-o)*Math.sin(s)+o*Math.sin(i),cos:(1-o)*Math.cos(s)+o*Math.cos(i)}}var Xt=128;function zr(n){return -(n/10)*Te}var Re=1.15;function _n(n){return n===0?0:n<0?-n:n/Re}var ut=(...n)=>{},q=(...n)=>{};var In=true;async function On(n){try{if(n[0]===255&&n[1]===216){let{decodeJpegPixels:t}=await import('./jpeg-decoder-CMP7ASL4.mjs'),e=await t(n);return a$2(e.width,e.height)?{...e,data:new Uint8ClampedArray(e.data)}:null}if(n.length>=20&&n[0]===82&&n[1]===73&&n[2]===70&&n[3]===70&&n[8]===87&&n[9]===69&&n[10]===66&&n[11]===80){let{decodeWebp:t}=await import('./webp-decoder-WYHITGE2.mjs');return t(n)}if(n.length>=13&&/^GIF8[79]a$/.test(String.fromCharCode(...n.subarray(0,6)))){let{decodeGif:t}=await import('./gif-decoder-HCVZWAHL.mjs');return t(n)}if(n.length>=8&&(n[0]===73&&n[1]===73&&n[2]===42&&n[3]===0||n[0]===77&&n[1]===77&&n[2]===0&&n[3]===42)){let{decodeTiff:t}=await import('./tiff-decoder-6LKFU47D.mjs');return await t(n)}}catch{return null}return null}var Yt=class{constructor(){this.data=new Int32Array(96);this.length=0;}add(t,e,r){if(r<=e)return;let o=this.length*3;if(o>0&&this.data[o-3]===t&&this.data[o-1]===e){this.data[o-1]=r;return}if(o+3>this.data.length){let s=new Int32Array(this.data.length*2);s.set(this.data),this.data=s;}this.data[o]=t,this.data[o+1]=e,this.data[o+2]=r,this.length++;}append(t){for(let e=0;e<t.length*3;e+=3)this.add(t.data[e],t.data[e+1],t.data[e+2]);}bounds(){if(this.length===0)return null;let t=1/0,e=1/0,r=-1/0,o=-1/0,s=this.data;for(let i=0;i<this.length*3;i+=3)s[i]<e&&(e=s[i]),s[i]+1>o&&(o=s[i]+1),s[i+1]<t&&(t=s[i+1]),s[i+2]>r&&(r=s[i+2]);return {x0:t,y0:e,x1:r,y1:o}}};function vn(n,t){return Math.floor(n/t)}function lt(n,t){return -Math.floor(-n/t)}function Se(n,t,e=new Yt,r=-1/0,o=1/0){let s=[],i=1/0,a=-1/0;for(let f of n){let p=f.length>>1;if(!(p<2))for(let M=0;M<p;M++){let x=M+1===p?0:M+1,E=f[M*2],d=f[M*2+1],A=f[x*2],R=f[x*2+1];if(d===R)continue;let g=R>d?1:-1,S=g>0?E:A,y=g>0?d:R,P=g>0?A:E,T=g>0?R:d,C=lt(y,16),L=lt(T,16);L<=C||(s.push([C,L,S,y,P-S,T-y,g]),C<i&&(i=C),L>a&&(a=L));}}if(s.length===0)return e;s.sort((f,p)=>f[0]-p[0]);let c=Math.max(i,Math.ceil(r)),u=Math.min(a,Math.floor(o)),l=[],m=0,h=[],b=[];for(;m<s.length&&s[m][1]<=c;)m++;for(let f=c;f<u;f++){for(;m<s.length&&s[m][0]<=f;)s[m][1]>f&&l.push(s[m]),m++;for(let x=l.length-1;x>=0;x--)(l[x][1]<=f||l[x][0]>f)&&l[x][1]<=f&&l.splice(x,1);h.length=0,b.length=0;let p=f*16;for(let x of l){if(x[0]>f)continue;let E=x[2]*x[5]+(p-x[3])*x[4];h.push(lt(E,x[5]*16)),b.push(x[6]);}let M=h.length;if(!(M<2)){for(let x=1;x<M;x++){let E=h[x],d=b[x],A=x-1;for(;A>=0&&h[A]>E;)h[A+1]=h[A],b[A+1]=b[A],A--;h[A+1]=E,b[A+1]=d;}if(t){let x=0,E=0;for(let d=0;d<M;d++){let A=x;x+=b[d],A===0&&x!==0?E=h[d]:A!==0&&x===0&&e.add(f,E,h[d]);}}else for(let x=0;x+1<M;x+=2)e.add(f,h[x],h[x+1]);}}return e}function ye(n,t){return Math.abs(n)!==Math.abs(t)?10:t>0?2:n>0?136:68}function wn(n,t,e,r){let o=Math.abs(n)+Math.abs(t),s=8*e;if(o<s)return true;if(o>s)return false;let i;return n===0?i=t<0?1:2:t===0?i=n<0?4:8:n<0?i=t<0?16:64:i=t<0?32:128,(r&i)!==0}function Nn(n,t,e,r,o){let s=e-n,i=r-t;if(s===0&&i===0)return;let a=ye(s,i),c=Math.abs(s)>=Math.abs(i),u=c?n:t,l=c?t:n,m=c?e:r,h=c?r:e,b=m>u?1:-1,f=Math.abs(m-u),p=(h-l)*b,M=Math.abs(s)===Math.abs(i),x=Math.min(u,m),E=Math.max(u,m),d=(g,S,y)=>c?wn(g,S,y,a):wn(S,g,y,a),A=b>0?vn(x,16)-1:lt(E,16)+1,R=b>0?lt(E,16)+1:vn(x,16)-1;for(let g=A;b>0?g<=R:g>=R;g+=b){let S=g*16,y=l*f+(S-u)*p,P=y/f/16,T=Math.round(P);for(let C=T-1;C<=T+1;C++){let L=C*16,_=y-L*f,w=x-S,I=E-S,D;if(M){let N=p/f,X=_/f,B=Math.max(w,Math.min(0,I)),k=Math.max(w,Math.min(-X/N,I));D=d(2*B,2*(X+N*B),2)||d(2*k,2*(X+N*k),2)||d(B+k,2*X+N*(B+k),2);}else {let N=Math.max(w,Math.min(0,I));D=d(N*f,_+N*p,f);}D&&(d(m-S,h-L,1)||(c?o(g,C):o(C,g)));}}}var Fn=10,$t=3,kn=6*10912,Ae=kn*8;function $(n,t){return Math.floor(n/2**t)}var yt=class{constructor(t,e,r,o){let s=2**Fn;this.e0=t*s,this.e1=(o-t)*s,this.e2=6*(e-r-r+o)*s,this.e3=6*(t-e-e+r)*s;}lazyHalve(t){this.e2=$(this.e2+this.e3,1),this.e1=$(this.e1-$(this.e2,t),1);}steadyState(t){let e=2**$t;this.e0*=e,this.e1*=e;let r=t-$t;r<0?(this.e2*=2**-r,this.e3*=2**-r):(this.e2=$(this.e2,r),this.e3=$(this.e3,r));}halve(){this.e2=$(this.e2+this.e3,3),this.e1=$(this.e1-this.e2,1),this.e3=$(this.e3,2);}double(){this.e1+=this.e1+this.e2,this.e3*=4,this.e2=this.e2*8-this.e3;}step(){this.e0+=this.e1;let t=this.e2;this.e1+=t,this.e2+=t-this.e3,this.e3=t;}error(){return Math.max(Math.abs(this.e2),Math.abs(this.e3))}parentErrorDividedBy4(){return Math.max(Math.abs(this.e3),Math.abs(this.e2+this.e2-this.e3))}value(){let t=Fn+$t;return $(this.e0+2**(t-1),t)}};function Bn(n,t,e,r,o,s,i,a,c,u=1){let l=kn*u,m=Ae*u,h=new yt(n,e,o,i),b=new yt(t,r,s,a),f=1,p=0;for(;p<40&&(h.error()>l*2**p||b.error()>l*2**p);)p+=2,h.lazyHalve(p),b.lazyHalve(p),f*=2;h.steadyState(p),b.steadyState(p);for(let M=0;f>0&&M<1<<20;M++){for(Math.max(h.error(),b.error())>m&&(h.halve(),b.halve(),f*=2);f%2===0&&h.parentErrorDividedBy4()<=m/4&&b.parentErrorDividedBy4()<=m/4;)h.double(),b.double(),f/=2;f--,h.step(),b.step(),c.push(h.value(),b.value());}}var W=.5522847498307936;function At(n,t,e,r){return {ax:n,ay:t,exx:e-n,exy:0,eyx:0,eyy:r-t}}function Ht(n,t=false){if(!t)return Xn(n,false);let{halfX:e,...r}=n,o=Gn(r),s=[];for(let a=o.length-2;a>=0;a-=2)s.push(o[a],o[a+1]);let i=Math.abs(r.exx)%2;if(s[18]+=i,s[6]-=i,e)for(let a of [0,1,2,3,4,5,12])s[2*a]++;return s}function Gn(n){return Xn(n,true)}function Xn(n,t){let e=(T,C)=>C?Math.ceil(T/2):Math.floor(T/2),r=T=>e(T,false),o=T=>e(T,true),s=T=>Math.floor(T/2)+Math.ceil(W*Math.ceil(T/2)),i=T=>Math.ceil(T/2)-Math.ceil(W*Math.ceil(T/2)),a=T=>e(T,false),c=T=>e(T,true),u=T=>Math.floor(T/2)-Math.floor(W*Math.floor(T/2)),l=T=>T-u(T),m=T=>T%2===0?Math.ceil(W*Math.floor(T/2)):Math.floor(W*Math.ceil(T/2)),h=t?T=>a(T)-m(T):u,b=t?T=>a(T)-m(T):u,f=t?T=>c(T)+m(T):l,p=t?T=>c(T)+m(T):l,M=()=>0,x=T=>T,{ax:E,ay:d,exx:A,exy:R,eyx:g,eyy:S}=n,y=[],P=(T,C)=>{y.push(E+T(A)+C(g),d+T(R)+C(S));};if(P(x,c),P(x,h),P(s,M),P(r,M),P(i,M),P(M,b),P(M,a),P(M,f),P(i,x),P(o,x),P(s,x),P(x,p),P(x,c),n.halfX)for(let T of [0,1,2,3,4,5,12])y[2*T]++;return y}function Pe(n,t,e,r){return Ht(At(n,t,e,r))}function Zr(n){let t=[n[0],n[1]];for(let e=2;e+5<n.length;e+=6)Bn(n[e-2],n[e-1],n[e],n[e+1],n[e+2],n[e+3],n[e+4],n[e+5],t);return t}function Qr(n,t,e,r,o,s,i=false,a=false,c=false,u){let l=e-n,m=r-t;if(u){let g=(y,P)=>Math.floor(Math.fround(y*P)+.5),S=c?Math.floor(l/2):Math.ceil(l/2);o=2*Math.min(g(S,u[0]),S),s=2*Math.min(g(a?Math.ceil(m/2):Math.floor(m/2),u[1]),a?Math.ceil(m/2):Math.floor(m/2));}let h=Math.min(Math.abs(o),l),b=Math.min(Math.abs(s),m);(h===0||b===0)&&(h=0,b=0);let f=i||a?Math.round(b/2):Math.floor(m/2)-Math.floor((m-b)/2),p=i?Math.round(e-h/2):Math.floor(e-h/2),M=e-p,x=a?Math.ceil(W*f):Math.floor(W*f),E=c?Math.floor(W*M):Math.ceil(W*M),d=[e,t+f,e,t+f-x,e-M+E,t,p,t],A=g=>n+e-g,R=g=>t+r-g;return [d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],A(d[6]),d[7],A(d[4]),d[5],A(d[2]),d[3],A(d[0]),d[1],A(d[0]),R(d[1]),A(d[2]),R(d[3]),A(d[4]),R(d[5]),A(d[6]),R(d[7]),d[6],R(d[7]),d[4],R(d[5]),d[2],R(d[3]),d[0],R(d[1])]}var zt=2*Math.PI/128,Tt=n=>J(n)[0],Rt=n=>J(n)[1];function Ce(n,t){let e=[],r=(a,c)=>{if(Math.abs(c-a)<90){e.push({from:a,to:c,first:true});return}let u=Math.min(a,c),l=Math.max(a,c),m=Math.floor(l/90)-Math.floor(u/90)+1,h=[];for(let f=Math.floor(u/90)+1;f*90<l;f++)h.push(f*90);c<a&&h.reverse();let b=[a,...h,c];for(;b.length-1<m;)b.push(c);for(let f=0;f+1<b.length;f++)e.push({from:b[f],to:b[f+1],first:f===0});},o=t<0?-1:1,s=Math.min(8,Math.trunc(Math.abs(t)/360)),i=n+t-o*s*360;r(n,i);for(let a=1;a<=s;a++)r(i+o*360*(a-1),n+o*360*a),r(n+o*360*a,i+o*360*a);return e}function to(n,t,e,r,o,s){let i=o*Math.PI/180,a=s*Math.PI/180,c=4/3*Math.tan((a-i)/4),u=n+e*Tt(i),l=t-r*Rt(i),m=n+e*Tt(a),h=t-r*Rt(a);return [u-c*e*Rt(i),l-c*r*Tt(i),m+c*e*Rt(a),h+c*r*Tt(a),m,h]}function no(n,t,e){let r=Math.min(n.ax,n.ax+n.exx),o=Math.min(n.ay,n.ay+n.eyy),s=Math.abs(n.exx),i=Math.abs(n.eyy),a=r+s/2,c=o+i/2,u=Pe(r,o,r+s,o+i),l=Gn(At(r,o,r+s,o+i)),m=t*Math.PI/180,h=Math.abs(e)<=3?[Math.cos(m),Math.sin(m)]:J(m),b=[Math.round(a+s/2*h[0]),Math.round(c-i/2*h[1])];for(let f of Ce(t,e)){let p=f.to-f.from;if(!f.first&&Math.abs(p)===90&&f.from%90===0){let E=(Math.min(f.from,f.to)/90%4+4)%4*6;p>0?b.push(u[E+2],u[E+3],u[E+4],u[E+5],u[E+6],u[E+7]):b.push(l[E+4],l[E+5],l[E+2],l[E+3],l[E],l[E+1]);continue}let M=$n(f.from*Math.PI/180,f.to*Math.PI/180,Math.abs(e)<=3);for(let x=0;x<6;x+=2)b.push(Math.round(a+s/2*M.ctrl[x]),Math.round(c-i/2*M.ctrl[x+1]));}return b}var Le=3*Math.PI/180,St=(()=>{let n=[],t=[];for(let e=0;e<=129;e++)n.push(Math.fround(Math.cos(e*zt))),t.push(Math.fround(Math.sin(e*zt)));for(let e=0;e<=128;e+=32)n[e]=[1,0,-1,0,1][e/32],t[e]=[0,1,0,-1,0][e/32];return {cos:n,sin:t}})();function J(n){let t=n%(2*Math.PI);t<0&&(t+=2*Math.PI);let e=Math.fround(t/zt),r=Math.min(127,Math.floor(e)),o=e-r;return [St.cos[r]*(1-o)+St.cos[r+1]*o,St.sin[r]*(1-o)+St.sin[r+1]*o]}var Wt=Array.from({length:33},(n,t)=>Math.atan(t/32));function Un(n){let t=n*32,e=Math.min(31,Math.floor(t));return Wt[e]+(Wt[e+1]-Wt[e])*(t-e)}function _e(n,t){let e=Math.abs(n),r=Math.abs(t);if(e===0&&r===0)return 0;let o=r<=e?Un(Math.fround(r/e)):Math.PI/2-Un(Math.fround(e/r));return n>=0?t>=0?o:2*Math.PI-o:t>=0?Math.PI-o:Math.PI+o}function $n(n,t,e,r=1/0){let o=e?u=>[Math.cos(u),Math.sin(u)]:J,s=o(n),i=o(t);if(e&&6e-8*r/Math.abs(Math.sin(t-n))>.5){let u=Math.fround,l=[u(s[0]),u(s[1])],m=[u(i[0]),u(i[1])],h=u(u(l[0]*m[1])-u(l[1]*m[0]));if(h!==0){let b=[u(u(m[1]-l[1])/h),u(u(l[0]-m[0])/h)],f=u(J(Math.abs(t-n)/2)[0]),p=u(u(u(4/3)*f)/u(1+f));return {start:s,ctrl:[u(l[0]+u(p*u(b[0]-l[0]))),u(l[1]+u(p*u(b[1]-l[1]))),u(m[0]+u(p*u(b[0]-m[0]))),u(m[1]+u(p*u(b[1]-m[1]))),i[0],i[1]]}}}let a=s[0]*i[1]-s[1]*i[0],c;if(Math.abs(a)<1e-12)c=[s[0],s[1],i[0],i[1],i[0],i[1]];else {let u=[(i[1]-s[1])/a,(s[0]-i[0])/a],l=J(Math.abs(t-n)/2)[0],m=4/3*l/(1+l);c=[s[0]+m*(u[0]-s[0]),s[1]+m*(u[1]-s[1]),i[0]+m*(u[0]-i[0]),i[1]+m*(u[1]-i[1]),i[0],i[1]];}return {start:s,ctrl:c}}function eo(n,t,e,r,o,s,i,a,c,u=false,l=false,m=false){let h=e-n,b=r-t,f=Math.PI/2,p=Math.ceil(h/2),M=c?Math.ceil(b/2):Math.floor(b/2),x=n+Math.ceil(h/2),E=t+Math.ceil(b/2),d=(n+e)/2,A=(t+r)/2,R=(O,v)=>_e((O-d)/(h/2||1),-(v-A)/(b/2||1)),g=R(o,s),S=R(i,a),y=O=>c?(2*Math.PI-O)%(2*Math.PI):O,P=S!==g&&Math.abs(y(S)-y(g))<=Le,T=c?-1:1;if(T>0)for(;S<=g;)S+=2*Math.PI;else for(;S>=g;)S-=2*Math.PI;let C=(O,v)=>Math.fround(O*Math.fround(v)),L=(O,v)=>m?Math.round(x-C(Math.floor(h/2),O)):c&&u?Math.ceil(x+C(p,O)+.5-v):Math.round(x+C(p,O)+(u?1+v:0)),_=O=>Math.round(E-C(M,O)),w=m?At(e,t,n,r):At(n,t,e,r);u&&(w.halfX=true);let I=Ht(w);if(c){let O=Ht(w,true);for(let v=0;v<O.length;v+=2)I[O.length-2-v]=O[v],I[O.length-1-v]=O[v+1];}let D=P?[Math.cos(g),Math.sin(g)]:J(g),N=[L(D[0],D[1]),_(D[1])],X=O=>Math.abs(O/f-Math.round(O/f))<1e-9,B=O=>(Math.round(O/f)%4+4)%4;l&&X(g)&&(T>0?B(g)===1||B(g)===2:B(g)===2||B(g)===3)&&N.push(N[0],N[1],N[0],N[1],N[0],N[1]);let k=g;for(let O=0;O<8&&(T>0?k<S-1e-12:k>S+1e-12);O++){let v=T>0?Math.floor(k/f+1e-9)*f+f:Math.ceil(k/f-1e-9)*f-f,tt=Math.abs(k/f-Math.round(k/f))<1e-9,ee=T>0?v>=S-1e-12:v<=S+1e-12,mt=(Math.round(k/f)%4+4)%4,ht=(Math.round(v/f)%4+4)%4;if(!(O===0&&(T>0?mt===0||mt===3:mt===0||mt===1)||ee&&(T>0?ht===1||ht===2:ht===2||ht===3))&&tt&&(T>0?v<=S+1e-12:v>=S-1e-12)){let F=(Math.round(Math.min(k,v)/f)%4+4)%4*6;T>0?N.push(I[F+2],I[F+3],I[F+4],I[F+5],I[F+6],I[F+7]):N.push(I[F+4],I[F+5],I[F+2],I[F+3],I[F],I[F+1]),k=v;continue}let Vt=T>0?Math.min(v,S):Math.max(v,S),Lt=$n(k,Vt,P,Math.max(p,M));for(let F=0;F<6;F+=2)N.push(L(Lt.ctrl[F],Lt.ctrl[F+1]),_(Lt.ctrl[F+1]));k=Vt;}if(l&&X(S)&&(T>0?B(S)===3||B(S)===0:B(S)===1||B(S)===0)){let O=J(S),v=L(O[0],O[1]),tt=_(O[1]);N.push(v,tt,v,tt,v,tt);}return N}var Dn=class{constructor(){this.figures=[];this.getPath={pts:[],types:[]};this.current=null;}moveTo(t,e){this.current={pts:[t,e],closed:false},this.figures.push(this.current),this.log(t,e,6);}continueAt(t,e){let r=this.current;r&&r.pts[r.pts.length-2]===t&&r.pts[r.pts.length-1]===e||this.moveTo(t,e);}hasOpenFigure(){return this.current!==null}log(t,e,r){this.getPath.pts.push(t,e),this.getPath.types.push(r);}lineTo(t,e){if(!this.current){let r=this.lastPoint();this.moveTo(r?r[0]:t,r?r[1]:e);}this.current.pts.push(t,e),this.log(t,e,2);}bezierTo(t,e,r,o,s,i){if(!this.current){let c=this.lastPoint();this.moveTo(c?c[0]:t,c?c[1]:e);}let a=this.current.pts;this.flattenInto(a[a.length-2],a[a.length-1],t,e,r,o,s,i),this.log(t,e,4),this.log(r,o,4),this.log(s,i,4);}flattenInto(t,e,r,o,s,i,a,c){let u=this.current,l=u.pts.length/2-1;Bn(t,e,r,o,s,i,a,c,u.pts);let m=u.pts.length/2-2;if(m<=l){if(m===l){let p=u.pts.length;u.tangents??(u.tangents=new Map),u.tangentRoles??(u.tangentRoles=new Map),u.tangents.set(l,[u.pts[p-2]-u.pts[p-4],u.pts[p-1]-u.pts[p-3]]),u.tangentRoles.set(l,3);}return}let h=(p,M,x,E,d,A,R,g)=>x!==p||E!==M?[x-p,E-M]:d!==p||A!==M?[d-p,A-M]:R!==p||g!==M?[R-p,g-M]:null,b=h(t,e,r,o,s,i,a,c),f=h(s,i,a,c,a,c,a,c)??h(r,o,a,c,a,c,a,c)??h(t,e,a,c,a,c,a,c);u.curveSegs??(u.curveSegs=new Set);for(let p=l;p<=m;p++)u.curveSegs.add(p);u.tangents??(u.tangents=new Map),u.tangentRoles??(u.tangentRoles=new Map),b&&(u.tangents.set(l,b),u.tangentRoles.set(l,1)),f&&(u.tangents.set(m,f),u.tangentRoles.set(m,2));}addBeziers(t,e){e?this.moveTo(t[0],t[1]):this.lineTo(t[0],t[1]);for(let r=2;r+5<t.length;r+=6){this.flattenInto(t[r-2],t[r-1],t[r],t[r+1],t[r+2],t[r+3],t[r+4],t[r+5]);for(let o=r;o<r+6;o+=2)this.log(t[o],t[o+1],4);}}closeFigure(){if(this.current){this.current.closed=true,this.current=null;let t=this.getPath.types;t[t.length-1]|=1;}}append(t){for(let e of t.figures)this.figures.push({pts:e.pts.slice(),closed:e.closed,tangents:e.tangents&&new Map(e.tangents),tangentRoles:e.tangentRoles&&new Map(e.tangentRoles),curveSegs:e.curveSegs&&new Set(e.curveSegs),roundWiden:e.roundWiden});for(let e=0;e<t.getPath.types.length;e++)this.log(t.getPath.pts[2*e],t.getPath.pts[2*e+1],t.getPath.types[e]);this.current=null;}lastPoint(){let t=this.figures[this.figures.length-1];return t?t.closed?[t.pts[0],t.pts[1]]:[t.pts[t.pts.length-2],t.pts[t.pts.length-1]]:null}};function ro(n,t,e){return Se(n.figures.map(r=>r.pts),t,e)}function Wn(n,t){switch(n&15){case 1:return [18,6];case 2:return [3,3];case 3:return [9,6,3,6];case 4:return [9,3,3,3,3,3];case 7:return t&&t.length>0&&t.some(e=>e>0)?t.map(e=>Math.max(0,e)*3):null;case 8:return [1,1];default:return null}}function oo(n,t,e,r=1){let o=Math.max(t,1);switch(n&15){case 1:return [3*o,o];case 2:return [o,o];case 3:return [3*o,o,o,o];case 4:return [3*o,o,o,o,o,o];case 7:return e&&e.some(s=>s>0)?e.map(s=>Math.max(0,s)*r):null;default:return null}}function so(n){let t=n&15;return t>=1&&t<=4}function io(n,t,e,r,o={pos:0},s=true){let i=0;if(r)for(let c of r)i+=c;let a=(c,u)=>{if(!r||i===0){t.add(u,c,c+1);return}let l=o.pos%i;o.pos++;for(let m=0;m<r.length;m++){if(l<r[m]){m%2===0?t.add(u,c,c+1):e&&e.add(u,c,c+1);return}l-=r[m];}};n.figures.forEach((c,u)=>{u>0&&s&&(o.pos=0);let l=c.pts;for(let m=0;m+3<l.length;m+=2)Nn(l[m],l[m+1],l[m+2],l[m+3],a);if(c.closed&&l.length>=4){let m=l.length;(l[m-2]!==l[0]||l[m-1]!==l[1])&&Nn(l[m-2],l[m-1],l[0],l[1],a);}});}var U;async function To(){if(U!==void 0)return U;if(typeof OffscreenCanvas<"u"||typeof document<"u"||typeof process>"u"||!process.versions?.node)return U=null,U;try{U=await Qt();}catch{U=null;}return U}var Hn=false;function zn(){return typeof OffscreenCanvas>"u"&&typeof document>"u"&&!U}var Jn=1;function He(n,t,e,r,o=Jn,s=8192){let i=Math.max(1,Math.min(o,4)),a=Math.round(n*i),c=Math.round(t*i),u=i,l=i;if(e&&a>e){let f=e/a;a=e,c=Math.round(c*f),u*=f,l*=f;}if(r&&c>r){let f=r/c;a=Math.round(a*f),c=r,u*=f,l*=f;}let m=Math.max(1,Math.floor(s)),h=Math.max(1,Math.min(a,m)),b=Math.max(1,Math.min(c,m));return (h!==a||b!==c)&&console.warn(`[emf-converter] Canvas size clamped from ${a}\xD7${c} to ${h}\xD7${b}. Output may lose detail.`),{w:h,h:b,scaleX:u,scaleY:l}}var Ct={willReadFrequently:true};function Ro(n,t,e,r,o=Jn,s=8192){let{w:i,h:a,scaleX:c,scaleY:u}=He(n,t,e,r,o,s);try{if(zn()){ut(`createCanvas: using the software rasteriser ${i}\xD7${a}`);let l=new z(i,a);return {canvas:l,ctx:l.ctx,scaleX:c,scaleY:u}}if(typeof OffscreenCanvas<"u"){ut(`createCanvas: using OffscreenCanvas ${i}\xD7${a}, scale=(${c.toFixed(3)},${u.toFixed(3)})`);let l=new OffscreenCanvas(i,a),m=l.getContext("2d",Ct);return m?{canvas:l,ctx:m,scaleX:c,scaleY:u}:(q('createCanvas: OffscreenCanvas.getContext("2d") returned null'),null)}if(typeof document<"u"){ut(`createCanvas: using HTMLCanvasElement ${i}\xD7${a}, scale=(${c.toFixed(3)},${u.toFixed(3)})`);let l=document.createElement("canvas");l.width=i,l.height=a;let m=l.getContext("2d",Ct);return m?{canvas:l,ctx:m,scaleX:c,scaleY:u}:(q('createCanvas: HTMLCanvasElement.getContext("2d") returned null'),null)}if(U){ut(`createCanvas: using @napi-rs/canvas ${i}\xD7${a}, scale=(${c.toFixed(3)},${u.toFixed(3)})`);let l=U.createCanvas(i,a),m=l.getContext("2d");return m?{canvas:l,ctx:m,scaleX:c,scaleY:u}:(q('createCanvas: @napi-rs/canvas getContext("2d") returned null'),null)}return q("createCanvas: no OffscreenCanvas, no document, and no @napi-rs/canvas, cannot create canvas"),null}catch(l){return null}}function ze(n,t){if(n<=0||t<=0)return null;if(n=Math.max(1,Math.min(Math.floor(n),8192)),t=Math.max(1,Math.min(Math.floor(t),8192)),Hn);if(typeof OffscreenCanvas<"u"){let r=new OffscreenCanvas(n,t),o=r.getContext("2d",Ct);return o?{canvas:r,ctx:o}:null}if(typeof document<"u"){let r=document.createElement("canvas");r.width=n,r.height=t;let o=r.getContext("2d",Ct);return o?{canvas:r,ctx:o}:null}if(U){let r=U.createCanvas(n,t),o=r.getContext("2d");return o?{canvas:r,ctx:o}:null}let e=new z(n,t);return {canvas:e,ctx:e.ctx}}function Vn(n){switch(n){case 1:return {gco:"source-over",colorTransform:"black",exact:true};case 16:return {gco:"source-over",colorTransform:"white",exact:true};case 11:return {gco:"source-over",colorTransform:"skip",exact:true};case 4:return {gco:"source-over",colorTransform:"invert",exact:true};case 6:return {gco:"difference",colorTransform:"white",exact:true};case 7:case 5:return {gco:"difference",colorTransform:"none",exact:false};case 10:return {gco:"difference",colorTransform:"invert",exact:false};case 9:return {gco:"darken",colorTransform:"none",exact:false};case 3:case 2:return {gco:"darken",colorTransform:"invert",exact:false};case 15:case 14:return {gco:"lighten",colorTransform:"none",exact:false};case 12:case 8:return {gco:"lighten",colorTransform:"invert",exact:false};default:return {gco:"source-over",colorTransform:"none",exact:true}}}function jn(n,t){switch(t){case "invert":return Sn(n);case "black":return "#000000";case "white":return "#ffffff";case "skip":return "rgba(0,0,0,0)";default:return n}}function So(n,t){let e=Vn(t.rop2);if(n.globalCompositeOperation=e.gco,t.penStyle===5){n.strokeStyle="rgba(0,0,0,0)",n.lineWidth=0;return}n.strokeStyle=jn(t.penColor,e.colorTransform),n.lineWidth=Math.max(t.penWidth,1),n.setLineDash(t.penWidth<=1?Wn(t.penStyle,t.penUserStyle)??[]:[]);}function yo(n,t){let e=Vn(t.rop2);if(n.globalCompositeOperation=e.gco,Ln(t).kind==="none"){n.fillStyle="rgba(0,0,0,0)";return}n.fillStyle=jn(t.brushColor,e.colorTransform);}function Je(n){if(!n||n===400)return "";let t=Math.round(n/100)*100;return t===700?"bold":t>=100&&t<=900?String(t):n>=700?"bold":""}function Ve(n,t){let e=t?.[n.toLowerCase().trim()]??n;return /[\s,]/.test(e)&&!/^["']/.test(e)?`"${e}"`:e}function qn(n,t=1){return Math.max(_n(n.fontHeight)*Math.abs(t||1),8)}function Ao(n,t,e=1){let r=t.fontItalic?"italic ":"",o=Je(t.fontWeight),s=o?`${o} `:"",i=qn(t,e),a=Ve(t.fontFamily,t.fontFamilyMap);n.font=`${r}${s}${i}px ${a}`;}function Po(n,t,e,r,o,s=1){if(!t.fontUnderline&&!t.fontStrikeOut)return;let i=qn(t,s),a=Math.max(1,Math.round(i/14)),c=n.fillStyle;n.fillStyle=t.textColor,t.fontUnderline&&n.fillRect(e,r+Math.round(i*.12),o,a),t.fontStrikeOut&&n.fillRect(e,r-Math.round(i*.3),o,a),n.fillStyle=c;}function Co(n,t,e){if(e<=0)return "";let r=n.byteLength-t;if(r<=0)return "";let o=Math.min(e,Math.floor(r/2));if(o<=0)return "";let s;try{let a=new Uint8Array(n.buffer,n.byteOffset+t,o*2);s=new TextDecoder("utf-16le").decode(a);}catch{let a=[];for(let c=0;c<o;c++){let u=n.getUint16(t+c*2,true);if(u===0)return a.join("");a.push(String.fromCharCode(u));}return a.join("")}let i=s.indexOf("\0");return i===-1?s:s.slice(0,i)}function Lo(n){switch(n){case 0:return {kind:"brush",style:0,color:"#ffffff"};case 1:return {kind:"brush",style:0,color:"#c0c0c0"};case 2:return {kind:"brush",style:0,color:"#808080"};case 3:return {kind:"brush",style:0,color:"#404040"};case 4:return {kind:"brush",style:0,color:"#000000"};case 5:return {kind:"brush",style:1,color:"#000000"};case 6:return {kind:"pen",style:0,widthX:1,color:"#ffffff"};case 7:return {kind:"pen",style:0,widthX:1,color:"#000000"};case 8:return {kind:"pen",style:5,widthX:0,color:"#000000"};case 10:case 11:return {kind:"font",height:12,weight:400,italic:false,underline:false,strikeOut:false,family:"monospace"};case 12:case 13:case 14:case 17:return {kind:"font",height:12,weight:400,italic:false,underline:false,strikeOut:false,family:"sans-serif"};default:return null}}async function _o(n,t){let e=a(new Uint8Array(n));if(e==="unsupported")return null;if(zn()){let s=await Yn(new Uint8Array(n));return s?{drawable:s,width:s.width,height:s.height,close:()=>{}}:null}if(!(e==="bundled"&&In)){if(U)try{let s=await U.loadImage(new Uint8Array(n));return {drawable:s,width:s.width,height:s.height,close:()=>{}}}catch{}else if(typeof createImageBitmap=="function")try{let s=t!==void 0?new Blob([n],{type:t}):new Blob([n]),i=await createImageBitmap(s);return {drawable:i,width:i.width,height:i.height,close:()=>i.close()}}catch{}}let r=await Yn(new Uint8Array(n)),o=r&&ze(r.width,r.height);return !r||!o?null:(je(o.ctx,ct(r.data,r.width,r.height),0,0),{drawable:o.canvas,width:r.width,height:r.height,close:()=>{}})}async function Yn(n){if(a$1(n))return c(n);if(n.length>=26&&n[0]===66&&n[1]===77){let t=new DataView(n.buffer,n.byteOffset,n.byteLength),e=t.getUint32(10,true),r=Et(t,14,e,t.byteLength-e);return r?{data:r.data,width:r.width,height:r.height}:null}return On(n)}function Io(n,t,e,r,o,s){n.drawImage.call(n,t,e,r,o,s);}function Oo(n,t,e,r,o){return n.getImageData.call(n,t,e,r,o)}function je(n,t,e,r){n.putImageData.call(n,t,e,r);}function vo(n,t,e){return n.createPattern.call(n,t,e)}function ct(n,t,e){if(typeof ImageData<"u")return new ImageData(n,t,e);if(U){let r=U.ImageData;return new r(n,t,e)}return {data:n,width:t,height:e,colorSpace:"srgb"}}var qe=Symbol("SvgContext");function Ke(n){return typeof n=="object"&&n!==null&&qe in n}function No(n){return !Ke(n)||n.canReadPixels}function Kn(n){return n.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F￾￿]/g,"").replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,"\uFFFD").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Zn(n,t){t.push("<",n.tag);for(let e of Object.keys(n.attrs))t.push(" ",e,'="',Kn(String(n.attrs[e])),'"');if(n.text!==void 0){t.push(">",Kn(n.text),"</",n.tag,">");return}if(!n.children||n.children.length===0){t.push("/>");return}t.push(">");for(let e of n.children)Zn(e,t);t.push("</",n.tag,">");}function Ze(n){let t=[];return Zn(n,t),t.join("")}var K="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Qe(n){let t=[];for(let r=0;r<n.length;r+=12288){let o=Math.min(n.length,r+12288),s="",i=r;for(;i+2<o;i+=3){let a=n[i]<<16|n[i+1]<<8|n[i+2];s+=K[a>>18]+K[a>>12&63]+K[a>>6&63]+K[a&63];}if(i<o){let a=n[i]<<16|(i+1<o?n[i+1]:0)<<8;s+=K[a>>18]+K[a>>12&63]+(i+1<o?K[a>>6&63]:"=")+"=";}t.push(s);}return t.join("")}function tr(n){if(typeof TextEncoder<"u")return new TextEncoder().encode(n);let t=[];for(let e of n){let r=e.codePointAt(0);r<128?t.push(r):r<2048?t.push(192|r>>6,128|r&63):r<65536?t.push(224|r>>12,128|r>>6&63,128|r&63):t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|r&63);}return Uint8Array.from(t)}function nr(n){return `data:image/svg+xml;base64,${Qe(tr(n))}`}function Uo(n){return nr(Ze(n))}var er={class:"className","xml:space":"xmlSpace","xlink:href":"xlinkHref","xmlns:xlink":"xmlnsXlink"};function Qn(n){let t=er[n];return t||(n.startsWith("data-")||n.startsWith("aria-")?n:n.replace(/[-:]([a-z])/g,(e,r)=>r.toUpperCase()))}function te(n){let t={};for(let e of n.split(";")){let r=e.indexOf(":");if(r<=0)continue;let o=e.slice(0,r).trim(),s=e.slice(r+1).trim();if(!o)continue;let i=o.startsWith("--")?o:o.replace(/-([a-z])/g,(a,c)=>c.toUpperCase());t[i]=s;}return t}function rr(n){let t={};for(let e of Object.keys(n)){let r=n[e];e==="style"?t.style=te(String(r)):t[Qn(e)]=r;}return t}function Do(n,t,e){let r=0,o=(a,c)=>{let u={key:r++,...rr(a.attrs),...c};if(a.text!==void 0)return t(a.tag,u,a.text);let l=(a.children??[]).map(m=>o(m));return t(a.tag,u,...l)},{key:s,...i}=e??{};return o(n,i)}function Jt(n){return JSON.stringify(n)}function or(n,t){if(n==="style"){let e=te(String(t));return `{{ ${Object.keys(e).map(o=>`${/^[a-zA-Z_$][\w$]*$/.test(o)?o:Jt(o)}: ${Jt(e[o])}`).join(", ")} }}`}return typeof t=="number"?Number.isFinite(t)?`{${t}}`:"{0}":/^[^"\\{}<>&\r\n]*$/.test(t)?`"${t}"`:`{${Jt(t)}}`}function sr(n){return `{${JSON.stringify(n)}}`}function ne(n,t,e,r){let o=" ".repeat(t),s=Object.keys(n.attrs).map(a=>`${Qn(a)}=${or(a,n.attrs[a])}`);r&&s.push("{...props}");let i=`${o}<${n.tag}${s.length?" "+s.join(" "):""}`;if(n.text!==void 0){e.push(`${i}>${sr(n.text)}</${n.tag}>`);return}if(!n.children||n.children.length===0){e.push(`${i} />`);return}e.push(`${i}>`);for(let a of n.children)ne(a,t+1,e,false);e.push(`${o}</${n.tag}>`);}function ko(n,t={}){let e=t.componentName??"Metafile";if(!/^[A-Z][A-Za-z0-9_$]*$/.test(e))throw new TypeError(`svgTreeToJsx: componentName must be a PascalCase identifier, got ${JSON.stringify(e)}`);let r=t.typescript??true,o=t.spreadProps??true,s=[];ne(n,2,s,o);let i=o?r?"props: SVGProps<SVGSVGElement>":"props":"";return [...r&&o?["import type { SVGProps } from 'react';",""]:[],`export function ${e}(${i}) {`," return (",...s," );","}","",`export default ${e};`,""].join(`
2
+ `)}export{So as $,Qr as A,Ce as B,to as C,no as D,eo as E,Dn as F,ro as G,Wn as H,oo as I,so as J,io as K,nt as L,ft as M,tn as N,It as O,Ot as P,z as Q,Sr as R,at as S,To as T,zn as U,Jn as V,He as W,Ro as X,ze as Y,Vn as Z,jn as _,Pr as a,yo as aa,Cr as b,Ve as ba,Lr as c,qn as ca,Et as d,Ao as da,Ee as e,Po as ea,ge as f,Co as fa,kr as g,Lo as ga,Ln as h,_o as ha,Br as i,Yn as ia,Xr as j,Io as ja,$r as k,Oo as ka,Wr as l,je as la,Yr as m,vo as ma,Hr as n,ct as na,zr as o,qe as oa,ut as p,Ke as pa,q,No as qa,ar as r,Ze as ra,Yt as s,Qe as sa,Se as t,nr as ta,Nn as u,Uo as ua,W as v,Do as va,At as w,ko as wa,Ht as x,Pe as y,Zr as z};
@@ -0,0 +1 @@
1
+ 'use strict';var g=Object.create;var f=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var m=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var n=(a,b)=>()=>{try{return b||a((b={exports:{}}).exports,b),b.exports}catch(c){throw b=0,c}};var l=(a,b,c,e)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of i(b))!k.call(a,d)&&d!==c&&f(a,d,{get:()=>b[d],enumerable:!(e=h(b,d))||e.enumerable});return a};var o=(a,b,c)=>(c=a!=null?g(j(a)):{},l(b||!a||!a.__esModule?f(c,"default",{value:a,enumerable:true}):c,a));exports.a=m;exports.b=n;exports.c=o;
@@ -0,0 +1 @@
1
+ 'use strict';var chunk32ASPP2J_js=require('./chunk-32ASPP2J.js');var N=[[23069,1,1,1],[9606,14,2,0],[4372,16,3,0],[2059,18,4,0],[984,20,5,0],[474,23,6,0],[229,25,7,0],[111,28,8,0],[54,30,9,0],[26,33,10,0],[13,35,11,0],[6,9,12,0],[3,10,13,0],[1,12,13,0],[23167,15,15,1],[16165,36,16,0],[11506,38,17,0],[8316,39,18,0],[6073,40,19,0],[4482,42,20,0],[3311,43,21,0],[2465,45,22,0],[1839,46,23,0],[1372,48,24,0],[1030,49,25,0],[771,51,26,0],[576,52,27,0],[433,54,28,0],[324,56,29,0],[245,57,30,0],[183,59,31,0],[138,60,32,0],[104,62,33,0],[78,63,34,0],[59,32,35,0],[44,33,9,0],[23265,37,37,1],[18508,64,38,0],[14861,65,39,0],[12017,67,40,0],[9759,68,41,0],[7987,69,42,0],[6568,70,43,0],[5400,72,44,0],[4471,73,45,0],[3700,74,46,0],[3067,75,47,0],[2552,77,48,0],[2145,78,49,0],[1798,79,50,0],[1485,48,51,0],[1246,50,52,0],[1039,50,53,0],[867,51,54,0],[724,52,55,0],[604,53,56,0],[504,54,57,0],[420,55,58,0],[352,56,59,0],[293,57,60,0],[246,58,61,0],[203,59,62,0],[171,61,63,0],[143,61,32,0],[23314,65,65,1],[19716,80,66,0],[16684,81,67,0],[14296,82,68,0],[12264,83,69,0],[10556,84,70,0],[9081,86,71,0],[7903,87,72,0],[6825,87,73,0],[5966,72,74,0],[5156,72,75,0],[4508,74,76,0],[3947,74,77,0],[3409,75,78,0],[2998,77,79,0],[2624,77,48,0],[22578,80,81,1],[19740,88,82,0],[17294,89,83,0],[15325,90,84,0],[13550,91,85,0],[11950,92,86,0],[10650,93,87,0],[9494,86,71,0],[21872,88,89,1],[19625,95,90,0],[17625,96,91,0],[15906,97,92,0],[14372,99,93,0],[12980,99,94,0],[11799,93,86,0],[22184,95,96,1],[20294,101,97,0],[18405,102,98,0],[16847,103,99,0],[15421,104,100,0],[14174,99,93,0],[21041,105,102,0],[19471,106,103,0],[17977,107,104,0],[16734,103,99,0],[22055,105,106,1],[20711,108,107,0],[19333,109,103,0],[21911,110,109,0],[20559,111,107,0],[23056,110,111,1],[21794,112,109,0],[23019,112,111,1],[23069,113,113,0]],O=new Int32Array(N.length),Q=new Int32Array(N.length),Y=new Int32Array(N.length);N.forEach(([t,e,n,f],l)=>{O[l]=t,Q[l]=e|f<<7,Y[l]=n;});var te=64,ne=256;function V(){return {dcL:new Array(16).fill(0),dcU:new Array(16).fill(1),acK:new Array(16).fill(5)}}var K=[0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63],L=class{constructor(e,n,f,l){this.data=e;this.cond=f;this.components=l;this.c=0;this.a=0;this.ct=-16;this.marker=false;this.failed=false;this.dcStats=[];this.acStats=[];this.fixed=new Uint8Array(1);this.pos=n,this.reset();}reset(){this.c=0,this.a=0,this.ct=-16,this.marker=false,this.failed=false,this.dcStats.length=0,this.acStats.length=0;for(let e=0;e<16;e++)this.dcStats.push(new Uint8Array(te)),this.acStats.push(new Uint8Array(ne));this.fixed[0]=113;for(let e of this.components)e.pred=0,e.ctx=0;}bit(e,n){for(;this.a<32768;){if(--this.ct<0){let a=0;if(!this.marker&&(a=this.pos<this.data.length?this.data[this.pos++]:0,a===255)){do a=this.pos<this.data.length?this.data[this.pos++]:0;while(a===255);a===0?a=255:(this.marker=true,this.pos-=2,a=0);}this.c=this.c<<8|a,(this.ct+=8)<0&&++this.ct===0&&(this.a=32768);}this.a<<=1;}let f=e[n],l=f&127,u=O[l],i=Q[l],s=Y[l],r=this.a-u;return this.a=r,r<<=this.ct,this.c>=r?(this.c-=r,this.a<u?(this.a=u,e[n]=f&128^s):(this.a=u,e[n]=f&128^i,f^=128)):this.a<32768&&(this.a<u?(e[n]=f&128^i,f^=128):e[n]=f&128^s),f>>7}dcDiff(e){let n=this.dcStats[e.dc],f=e.ctx;if(this.bit(n,f)===0)return e.ctx=0,true;let l=this.bit(n,f+1);f+=2+l;let u=this.bit(n,f);if(u!==0)for(f=20;this.bit(n,f);){if((u<<=1)===32768)return false;f++;}let i=1<<this.cond.dcL[e.dc]>>1,s=1<<this.cond.dcU[e.dc]>>1;e.ctx=u<i?0:u>s?12+l*4:4+l*4;let r=u;for(f+=14;u>>=1;)this.bit(n,f)&&(r|=u);return r+=1,e.pred+=l?-r:r,true}acFirst(e,n,f,l,u){let i=this.acStats[e.ac];for(let s=f;s<=l;s++){let r=3*(s-1);if(this.bit(i,r))break;for(;this.bit(i,r+1)===0;)if(r+=3,s++,s>l){this.failed=true;return}let a=this.bit(this.fixed,0);r+=2;let o=this.bit(i,r);if(o!==0&&this.bit(i,r))for(o<<=1,r=s<=this.cond.acK[e.ac]?189:217;this.bit(i,r);){if((o<<=1)===32768){this.failed=true;return}r++;}let c=o;for(r+=14;o>>=1;)this.bit(i,r)&&(c|=o);c+=1,e.coefs[n+K[s]]=(a?-c:c)*(1<<u);}}acRefine(e,n,f,l,u){let i=this.acStats[e.ac],s=e.coefs,r=1<<u,a=-1<<u,o=l;for(;o>0&&!s[n+K[o]];o--);for(let c=f;c<=l;c++){let p=3*(c-1);if(c>o&&this.bit(i,p))break;for(;;){let d=n+K[c];if(s[d]){this.bit(i,p+2)&&(s[d]+=s[d]<0?a:r);break}if(this.bit(i,p+1)){s[d]=this.bit(this.fixed,0)?a:r;break}if(p+=3,c++,c>l){this.failed=true;return}}}}block(e,n,f,l,u,i,s){if(!this.failed){if(!f){if(!this.dcDiff(e)){this.failed=true;return}e.coefs[n]=e.pred,this.acFirst(e,n,1,63,0);return}if(l===0){if(i===0){if(!this.dcDiff(e)){this.failed=true;return}e.coefs[n]=e.pred*(1<<s);}else this.bit(this.fixed,0)&&(e.coefs[n]|=1<<s);return}i===0?this.acFirst(e,n,l,u,s):this.acRefine(e,n,l,u,s);}}};var B=[0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63];function re(t,e){let n=new Int32Array(18).fill(-1),f=new Int32Array(17),l=new Int32Array(17),u=0,i=0;for(let s=1;s<=16;s++)f[s]=i,l[s]=u,u+=t[s-1],i+=t[s-1],n[s]=t[s-1]?u-1:-1,u<<=1;return {maxcode:n,valptr:f,mincode:l,values:e}}var Z=class{constructor(e,n){this.data=e;this.bits=0;this.count=0;this.marker=false;this.pos=n;}reset(){this.bits=0,this.count=0,this.marker=false;}bit(){if(this.count===0){let e=0;if(!this.marker&&this.pos<this.data.length&&(e=this.data[this.pos++],e===255)){let n=this.data[this.pos];for(;n===255;)this.pos++,n=this.data[this.pos];n===0?this.pos++:(this.marker=true,this.pos--,e=0);}this.bits=e,this.count=8;}return this.count--,this.bits>>this.count&1}receive(e){let n=0;for(;e--;)n=n<<1|this.bit();return n}receiveExtend(e){if(e===0)return 0;let n=this.receive(e);return n<1<<e-1?n-(1<<e)+1:n}decode(e){let n=0;for(let f=1;f<=16;f++)if(n=n<<1|this.bit(),e.maxcode[f]>=0&&n<=e.maxcode[f]&&n>=e.mincode[f])return e.values[e.valptr[f]+n-e.mincode[f]];throw new Error("Bad Huffman code")}},D=13,z=2,ie=2446,se=4433,ce=6270,le=9633,ue=12299,be=16819,he=25172;function R(t,e){return t+(1<<e-1)>>e}function $(t,e){let n=t[2],f=t[6],l=(n+f)*se,u=l+f*-15137,i=l+n*ce,s=t[0]+t[4]<<D,r=t[0]-t[4]<<D,a=s+i,o=s-i,c=r+u,p=r-u;s=t[7],r=t[5],u=t[3],i=t[1],l=s+i,n=r+u,f=s+u;let d=r+i,k=(f+d)*le;s*=ie,r*=be,u*=he,i*=ue,l*=-7373,n*=-20995,f*=-16069,d*=-3196,f+=k,d+=k,s+=l+f,r+=n+d,u+=n+f,i+=l+d,e[0]=a+i,e[7]=a-i,e[1]=c+u,e[6]=c-u,e[2]=p+r,e[5]=p-r,e[3]=o+s,e[4]=o-s;}var W=new Array(8).fill(0),G=new Array(8).fill(0);function pe(t,e,n,f,l,u,i){for(let s=0;s<8;s++){let r=0;for(let a=0;a<8;a++)W[a]=t[e+a*8+s]*n[a*8+s],a&&(r|=W[a]);if(!r){let a=W[0]<<z;for(let o=0;o<8;o++)i[o*8+s]=a;continue}$(W,G);for(let a=0;a<8;a++)i[a*8+s]=R(G[a],D-z);}for(let s=0;s<8;s++){let r=0;for(let o=0;o<8;o++)W[o]=i[s*8+o],o&&(r|=W[o]);let a=l+s*u;if(!r){let o=R(W[0],z+3)+128,c=o<0?0:o>255?255:o;for(let p=0;p<8;p++)f[a+p]=c;continue}$(W,G);for(let o=0;o<8;o++){let c=R(G[o],D+z+3)+128;f[a+o]=c<0?0:c>255?255:c;}}}function de(t,e,n,f,l,u,i,s){let r=new Uint8Array(i*s),a=(o,c)=>t[Math.min(f-1,Math.max(0,c))*e+o];if(l===1&&u===1){for(let o=0;o<s;o++)for(let c=0;c<i;c++)r[o*i+c]=t[o*e+c];return r}if(l===2&&u===1){for(let o=0;o<s;o++)for(let c=0;c<n;c++){let p=a(c,o),d=c===0?p:3*p+a(c-1,o)+1>>2,k=c===n-1?p:3*p+a(c+1,o)+2>>2;2*c<i&&(r[o*i+2*c]=d),2*c+1<i&&(r[o*i+2*c+1]=k);}return r}if(l===2&&u===2){for(let o=0;o<s;o++){let c=o>>1,p=(o&1)===0?c-1:c+1,d=k=>3*a(k,c)+a(k,p);for(let k=0;k<n;k++){let b=d(k),P=k===0?b*4+8>>4:3*b+d(k-1)+8>>4,w=k===n-1?b*4+7>>4:3*b+d(k+1)+7>>4;2*k<i&&(r[o*i+2*k]=P),2*k+1<i&&(r[o*i+2*k+1]=w);}}return r}if(l===1&&u===2){for(let o=0;o<s;o++){let c=o>>1,p=(o&1)===0,d=p?c-1:c+1,k=p?1:2;for(let b=0;b<i;b++)r[o*i+b]=3*a(b,c)+a(b,d)+k>>2;}return r}for(let o=0;o<s;o++)for(let c=0;c<i;c++)r[o*i+c]=t[Math.min(f-1,Math.floor(o/u))*e+Math.min(n-1,Math.floor(c/l))];return r}async function ee(t,e){try{let n=ye(t);return n?await Ae(n,e):null}catch{return null}}function ye(t){if(t[0]!==255||t[1]!==216)return null;let e=[],n=[],f=[],l=[],u=0,i=0,s=false,r=false,a=V(),o=0,c,p=1,d=1,k=false,b=2,P=new Int32Array(64);for(;b<t.length;){if(t[b]!==255){b++;continue}let x=t[b+1];if(x===255){b++;continue}if(b+=2,x===216||x===1||x>=208&&x<=215||x===0)continue;if(x===217)break;let M=t[b]*256+t[b+1],h=b+2,F=b+M;if(x===219){let m=h;for(;m<F;){let U=t[m]>>4,C=t[m]&15;m++;let y=new Int32Array(64);for(let _=0;_<64;_++)y[B[_]]=U?t[m]*256+t[m+1]:t[m],m+=U?2:1;e[C]=y;}}else if(x===192||x===193||x===194||x===201||x===202){if(t[h]!==8)return null;s=x===194||x===202,r=x>=201,i=t[h+1]*256+t[h+2],u=t[h+3]*256+t[h+4];let m=t[h+5];if(m!==1&&m!==3&&m!==4||!u||!i)return null;l=[];for(let y=0;y<m;y++){let _=t[h+7+y*3]>>4,g=t[h+7+y*3]&15;if(!_||!g)return null;l.push({id:t[h+6+y*3],h:_,v:g,tq:t[h+8+y*3],blocksW:0,blocksH:0,coefs:new Int16Array(0),pred:0,ctx:0,dc:0,ac:0});}p=Math.max(...l.map(y=>y.h)),d=Math.max(...l.map(y=>y.v));let U=Math.ceil(u/(8*p)),C=Math.ceil(i/(8*d));for(let y of l)y.blocksW=U*y.h,y.blocksH=C*y.v,y.coefs=new Int16Array(y.blocksW*y.blocksH*64);}else {if(x===195||x>=197&&x<=207&&x!==200&&x!==204&&x!==201&&x!==202)return null;if(x===204)for(let m=h;m+1<F;m+=2){let U=t[m]&15;t[m]>>4===0?(a.dcL[U]=t[m+1]&15,a.dcU[U]=t[m+1]>>4):a.acK[U]=t[m+1];}else if(x===196){let m=h;for(;m<F;){let U=t[m]>>4,C=t[m]&15;m++;let y=t.subarray(m,m+16);m+=16;let _=0;for(let A=0;A<16;A++)_+=y[A];let g=re(y,t.subarray(m,m+_));m+=_,(U?f:n)[C]=g;}}else if(x===221)o=t[h]*256+t[h+1];else if(x===238)M>=14&&String.fromCharCode(...t.subarray(h,h+5))==="Adobe"&&(c=t[h+11]);else if(x===218){if(!l.length)return null;let m=t[h],U=[];for(let A=0;A<m;A++){let v=l.find(T=>T.id===t[h+1+A*2]);if(!v)return null;v.dc=t[h+2+A*2]>>4,v.ac=t[h+2+A*2]&15,U.push(v);}let C=t[h+1+m*2],y=t[h+2+m*2],_=t[h+3+m*2]>>4,g=t[h+3+m*2]&15;b=ke(t,F,U,l,u,i,p,d,s,o,C,y,_,g,n,f,r?a:null),k=true;continue}}b=F;}if(!k||!l.length)return null;let w=l.map(x=>{if(p%x.h||d%x.v)throw new Error("Unsupported sampling");let M=x.blocksW*8,h=new Uint8Array(M*x.blocksH*8),F=e[x.tq];if(!F)throw new Error("Missing quantisation table");for(let C=0;C<x.blocksH;C++)for(let y=0;y<x.blocksW;y++)pe(x.coefs,(C*x.blocksW+y)*64,F,h,C*8*M+y*8,M,P);let m=Math.ceil(u*x.h/p),U=Math.ceil(i*x.v/d);return de(h,M,m,U,p/x.h,d/x.v,u,i)});return {width:u,height:i,planes:w,ids:l.map(x=>x.id),adobe:c}}async function Ae({width:t,height:e,planes:n,ids:f,adobe:l},u){if(n.length===4){let{cmykPlanesToRgba:r}=await import('./jpeg-cmyk-QL44AOOZ.js');return {width:t,height:e,data:r(n,t,e,l!==void 0&&l!==0)}}let i=new Uint8Array(t*e*4),s=u??(l!==void 0?l!==0:!f.every((r,a)=>r===[82,71,66][a]));if(n.length===1)for(let r=0;r<t*e;r++)i[r*4]=i[r*4+1]=i[r*4+2]=n[0][r],i[r*4+3]=255;else if(s){let r=b=>b<0?0:b>255?255:b,a=b=>Math.floor(b*65536+.5),c=a(1.402),p=a(1.772),d=-a(.71414),k=-a(.34414);for(let b=0;b<t*e;b++){let P=n[0][b],w=n[1][b]-128,x=n[2][b]-128;i[b*4]=r(P+(c*x+32768>>16)),i[b*4+1]=r(P+(k*w+32768+d*x>>16)),i[b*4+2]=r(P+(p*w+32768>>16)),i[b*4+3]=255;}}else for(let r=0;r<t*e;r++)i[r*4]=n[0][r],i[r*4+1]=n[1][r],i[r*4+2]=n[2][r],i[r*4+3]=255;return {width:t,height:e,data:i}}function ke(t,e,n,f,l,u,i,s,r,a,o,c,p,d,k,b,P){let w=new Z(t,e),x=P?new L(t,e,P,n):null,M=x??w,h=0,F=n.length===1,m=(g,A)=>{if(x){x.block(g,A,r,o,c,p,d);return}let v=g.coefs;if(!r){let I=w.decode(k[g.dc]);g.pred+=I===0?0:w.receiveExtend(I),v[A]=g.pred;let X=1;for(;X<64;){let E=w.decode(b[g.ac]),H=E&15,q=E>>4;if(H===0){if(q<15)break;X+=16;continue}if(X+=q,X>63)break;v[A+B[X]]=w.receiveExtend(H),X++;}return}if(o===0){if(p===0){let I=w.decode(k[g.dc]);g.pred+=I===0?0:w.receiveExtend(I),v[A]=g.pred*(1<<d);}else w.bit()&&(v[A]|=1<<d);return}if(p===0){if(h>0){h--;return}let I=o;for(;I<=c;){let X=w.decode(b[g.ac]),E=X&15,H=X>>4;if(E===0){if(H<15){h=w.receive(H)+(1<<H)-1;break}I+=16;continue}if(I+=H,I>63)break;v[A+B[I]]=w.receiveExtend(E)*(1<<d),I++;}return}let T=1<<d,J=-1<<d,S=o;if(h<=0)for(;S<=c;S++){let I=w.decode(b[g.ac]),X=I&15,E=I>>4,H=0;if(X===0){if(E<15){h=(1<<E)+w.receive(E);break}}else H=w.bit()?T:J;for(;S<=c;S++){let q=A+B[S];if(v[q]!==0)w.bit()&&(v[q]&T)===0&&(v[q]+=v[q]>=0?T:J);else {if(E===0){H&&(v[q]=H);break}E--;}}}if(h>0){for(;S<=c;S++){let I=A+B[S];v[I]!==0&&w.bit()&&(v[I]&T)===0&&(v[I]+=v[I]>=0?T:J);}h--;}},U,C;if(F){let g=n[0];C=Math.ceil(Math.ceil(l*g.h/i)/8),U=C*Math.ceil(Math.ceil(u*g.v/s)/8);}else C=Math.ceil(l/(8*i)),U=C*Math.ceil(u/(8*s));let y=g=>{let A=g;for(;A+1<t.length&&!(t[A]===255&&t[A+1]!==0&&t[A+1]!==255);)A++;return A},_=0;for(;_<U;){for(let v of f)v.pred=0;h=0,M.reset();let g=a?Math.min(U,_+a):U;for(;_<g;_++)if(F){let v=n[0];m(v,(Math.floor(_/C)*v.blocksW+_%C)*64);}else {let v=_%C,T=Math.floor(_/C);for(let J of n)for(let S=0;S<J.v;S++)for(let I=0;I<J.h;I++)m(J,((T*J.v+S)*J.blocksW+v*J.h+I)*64);}let A=y(M.pos);if(_>=U)return A;if(t[A+1]>=208&&t[A+1]<=215)M.pos=A+2;else return A}return y(M.pos)}async function _e(t,e){if(chunk32ASPP2J_js.a(t)==="unsupported")throw new Error("Unsupported JPEG data precision");let n=await ee(t,e);if(n)return n;let{decodeJpegPixelsLegacy:f}=await import('./jpeg-decoder-legacy-V73WBA5Z.js');return f(t,e)}exports.a=ye;exports.b=_e;
@@ -0,0 +1 @@
1
+ 'use strict';var _=[137,80,78,71,13,10,26,10];function G(n){return n.length>=8&&_.every((o,s)=>n[s]===o)}async function O(n){if(typeof DecompressionStream=="function"&&typeof Response=="function")try{let o=new Blob([n]).stream().pipeThrough(new DecompressionStream("deflate"));return new Uint8Array(await new Response(o).arrayBuffer())}catch{}return z(n)}var X=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],Z=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],V=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],j=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],q=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function P(n,o){let s=new Uint16Array(16);for(let t=0;t<o;t++)s[n[t]]++;s[0]=0;let a=new Uint16Array(16);for(let t=1;t<16;t++)a[t]=a[t-1]+s[t-1];let r=new Uint16Array(o);for(let t=0;t<o;t++)n[t]&&(r[a[n[t]]++]=t);return {counts:s,symbols:r}}function z(n){let o=2,s=0,a=0,r=new Uint8Array(Math.max(1024,n.length*4)),t=0,w=m=>{if(t+m>r.length){let c=new Uint8Array(Math.max(r.length*2,t+m));c.set(r.subarray(0,t)),r=c;}},f=m=>{for(;a<m;){if(o>=n.length)throw new Error("inflate: unexpected end of data");s|=n[o++]<<a,a+=8;}let c=s&(1<<m)-1;return s>>>=m,a-=m,c},i=m=>{let c=0,M=0,l=0;for(let p=1;p<16;p++){c|=f(1);let R=m.counts[p];if(c-R<M)return m.symbols[l+(c-M)];l+=R,M=M+R<<1,c<<=1;}throw new Error("inflate: bad Huffman code")},y=null,H=null,h=0;for(;!h;){h=f(1);let m=f(2);if(m===0){s=0,a=0;let l=n[o]|n[o+1]<<8;o+=4,w(l),r.set(n.subarray(o,o+l),t),t+=l,o+=l;continue}let c,M;if(m===1){if(!y||!H){let l=new Uint8Array(288);l.fill(8,0,144),l.fill(9,144,256),l.fill(7,256,280),l.fill(8,280,288),y=P(l,288),H=P(new Uint8Array(30).fill(5),30);}c=y,M=H;}else if(m===2){let l=f(5)+257,p=f(5)+1,R=f(4)+4,u=new Uint8Array(19);for(let d=0;d<R;d++)u[q[d]]=f(3);let v=P(u,19),S=new Uint8Array(l+p);for(let d=0;d<l+p;){let D=i(v);if(D<16)S[d++]=D;else if(D===16){let T=S[d-1];for(let B=3+f(2);B>0;B--)S[d++]=T;}else D===17?d+=3+f(3):d+=11+f(7);}c=P(S.subarray(0,l),l),M=P(S.subarray(l),p);}else throw new Error("inflate: invalid block type");for(;;){let l=i(c);if(l<256)w(1),r[t++]=l;else {if(l===256)break;{let p=l-257,R=X[p]+f(Z[p]),u=i(M),v=V[u]+f(j[u]);w(R);for(let S=0;S<R;S++)r[t]=r[t-v],t++;}}}}return r.subarray(0,t)}var F=[[0,0,8,8],[4,0,8,8],[0,4,4,8],[2,0,4,4],[0,2,2,4],[1,0,2,2],[0,1,1,2]];function J(n,o,s){let a=n+o-s,r=Math.abs(a-n),t=Math.abs(a-o),w=Math.abs(a-s);return r<=t&&r<=w?n:t<=w?o:s}function K(n,o,s,a,r){let t=-1;for(let w=0;w<a;w++){let f=n[o],i=o+1;for(let y=0;y<s;y++){let H=y>=r?n[i+y-r]:0,h=t>=0?n[t+y]:0,m=t>=0&&y>=r?n[t+y-r]:0,c=n[i+y];switch(f){case 1:c+=H;break;case 2:c+=h;break;case 3:c+=H+h>>1;break;case 4:c+=J(H,h,m);break}n[i+y]=c&255;}t=i,o=i+s;}return o}async function Q(n){if(!G(n))return null;let o=new DataView(n.buffer,n.byteOffset,n.byteLength),s=0,a=0,r=0,t=-1,w=0,f=null,i=null,y=[],H=0;for(let e=8;e+12<=n.length;){let E=o.getUint32(e),U=String.fromCharCode(n[e+4],n[e+5],n[e+6],n[e+7]),g=n.subarray(e+8,Math.min(n.length,e+8+E));if(U==="IHDR"&&g.length>=13)s=o.getUint32(e+8),a=o.getUint32(e+12),r=g[8],t=g[9],w=g[12];else if(U==="PLTE")f=g;else if(U==="tRNS")i=g;else if(U==="IDAT")y.push(g),H+=g.length;else if(U==="IEND")break;e+=12+E;}let h={0:1,2:3,3:1,4:2,6:4}[t],m=t===0?[1,2,4,8,16].includes(r):t===3?[1,2,4,8].includes(r):[8,16].includes(r);if(!h||!m||s<=0||a<=0||H===0||t===3&&!f||s*a>268435456)return null;let c=new Uint8Array(H),M=0;for(let e of y)c.set(e,M),M+=e.length;let l;try{l=await O(c);}catch{return null}let p=h*r,R=Math.max(1,p>>3),u=new Uint8ClampedArray(s*a*4),v=(1<<r)-1,S=i&&t===0&&i.length>=2?i[0]<<8|i[1]:-1,d=i&&t===2&&i.length>=6?[i[0]<<8|i[1],i[2]<<8|i[3],i[4]<<8|i[5]]:null,D=(e,E)=>{if(r===8)return l[e+E];if(r===16)return l[e+E*2]<<8|l[e+E*2+1];let U=E*r;return l[e+(U>>3)]>>8-r-(U&7)&v},T=e=>r===16?e>>8:r===8?e:Math.round(e*255/v),B=(e,E,U,g,L)=>{for(let A=0;A<E;A++){let b=(U*s+g+A*L)*4;if(t===3){let x=D(e,A);u[b]=f[x*3]??0,u[b+1]=f[x*3+1]??0,u[b+2]=f[x*3+2]??0,u[b+3]=i&&x<i.length?i[x]:255;}else if(t===0||t===4){let x=D(e,A*h),k=T(x);u[b]=k,u[b+1]=k,u[b+2]=k,u[b+3]=t===4?T(D(e,A*h+1)):x===S?0:255;}else {let x=D(e,A*h),k=D(e,A*h+1),I=D(e,A*h+2);u[b]=T(x),u[b+1]=T(k),u[b+2]=T(I),u[b+3]=t===6?T(D(e,A*h+3)):d&&x===d[0]&&k===d[1]&&I===d[2]?0:255;}}},C=0,N=w===1?F:[[0,0,1,1]];for(let[e,E,U,g]of N){let L=Math.ceil((s-e)/U),A=Math.ceil((a-E)/g);if(L<=0||A<=0)continue;let b=Math.ceil(L*p/8);if(C+A*(b+1)>l.length)return null;let x=C;C=K(l,C,b,A,R);for(let k=0;k<A;k++)B(x+k*(b+1)+1,L,E+k*g,e,U);}return {width:s,height:a,data:u}}exports.a=G;exports.b=z;exports.c=Q;