@awacloud/fw 0.1.0 → 1.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 (609) hide show
  1. package/CHANGELOG.md +125 -0
  2. package/NOTICE +8 -0
  3. package/README.md +163 -31
  4. package/dist/build/fw.core.pure.meta.json +6 -6
  5. package/dist/build/fw.core.pure.min.js +15 -12
  6. package/dist/build/fw.full.pure.meta.json +13 -7
  7. package/dist/build/fw.full.pure.min.js +45 -42
  8. package/dist/build/fw.minimal.pure.meta.json +6 -6
  9. package/dist/build/fw.minimal.pure.min.js +16 -13
  10. package/dist/build/fw.pack.compress-heavy.pure.meta.json +6 -6
  11. package/dist/build/fw.pack.compress-heavy.pure.min.js +3 -3
  12. package/dist/build/fw.pack.crypto-advanced.pure.meta.json +6 -6
  13. package/dist/build/fw.pack.crypto-advanced.pure.min.js +1 -1
  14. package/dist/build/fw.pack.crypto-basic.pure.meta.json +6 -6
  15. package/dist/build/fw.pack.crypto-basic.pure.min.js +1 -1
  16. package/dist/build/fw.pack.crypto-identity.pure.meta.json +7 -6
  17. package/dist/build/fw.pack.crypto-identity.pure.min.js +4 -4
  18. package/dist/build/fw.pwa.pure.meta.json +7 -6
  19. package/dist/build/fw.pwa.pure.min.js +38 -35
  20. package/dist/build/fw.site-interactive.pure.meta.json +6 -6
  21. package/dist/build/fw.site-interactive.pure.min.js +37 -34
  22. package/dist/build/fw.site.pure.meta.json +6 -6
  23. package/dist/build/fw.site.pure.min.js +24 -21
  24. package/dist/build/fw.spa.pure.meta.json +8 -7
  25. package/dist/build/fw.spa.pure.min.js +41 -38
  26. package/dist/build/sanity-base-classic.min.js +1 -1
  27. package/dist/build/sanity.min.js +1 -1
  28. package/dist/types/core/internal.d.ts +29 -0
  29. package/dist/types/core/internal.d.ts.map +1 -0
  30. package/dist/types/core/logger.d.ts +23 -4
  31. package/dist/types/core/logger.d.ts.map +1 -1
  32. package/dist/types/core/modules.d.ts +374 -61
  33. package/dist/types/core/modules.d.ts.map +1 -1
  34. package/dist/types/core/runtime.d.ts +10 -6
  35. package/dist/types/core/runtime.d.ts.map +1 -1
  36. package/dist/types/core/worker-helper.d.ts +35 -0
  37. package/dist/types/core/worker-helper.d.ts.map +1 -1
  38. package/dist/types/crypto/cipher/aes.d.ts +1 -7
  39. package/dist/types/crypto/cipher/aes.d.ts.map +1 -1
  40. package/dist/types/crypto/cipher/chacha20.d.ts +0 -10
  41. package/dist/types/crypto/cipher/chacha20.d.ts.map +1 -1
  42. package/dist/types/crypto/hash/argon2.d.ts +0 -15
  43. package/dist/types/crypto/hash/argon2.d.ts.map +1 -1
  44. package/dist/types/crypto/hash/blake2b.d.ts.map +1 -1
  45. package/dist/types/crypto/hash/hmac.d.ts.map +1 -1
  46. package/dist/types/crypto/hash/pbkdf2.d.ts.map +1 -1
  47. package/dist/types/crypto/hash/poly1305.d.ts.map +1 -1
  48. package/dist/types/crypto/hash/sha224.d.ts +1 -1
  49. package/dist/types/crypto/hash/sha256.d.ts +4 -13
  50. package/dist/types/crypto/hash/sha256.d.ts.map +1 -1
  51. package/dist/types/crypto/hash/sha3.d.ts.map +1 -1
  52. package/dist/types/crypto/hash/sha384.d.ts +1 -1
  53. package/dist/types/crypto/hash/sha512.d.ts +4 -13
  54. package/dist/types/crypto/hash/sha512.d.ts.map +1 -1
  55. package/dist/types/crypto/mode/cmac.d.ts +0 -6
  56. package/dist/types/crypto/mode/cmac.d.ts.map +1 -1
  57. package/dist/types/crypto/mode/ctr.d.ts +0 -6
  58. package/dist/types/crypto/mode/ctr.d.ts.map +1 -1
  59. package/dist/types/crypto/mode/gcm.d.ts +0 -9
  60. package/dist/types/crypto/mode/gcm.d.ts.map +1 -1
  61. package/dist/types/crypto/pkc/ecc.d.ts +0 -1
  62. package/dist/types/crypto/pkc/ecc.d.ts.map +1 -1
  63. package/dist/types/crypto/pkc/ed25519.d.ts +4 -25
  64. package/dist/types/crypto/pkc/ed25519.d.ts.map +1 -1
  65. package/dist/types/crypto/pkc/hybridSign.d.ts +25 -5
  66. package/dist/types/crypto/pkc/hybridSign.d.ts.map +1 -1
  67. package/dist/types/crypto/pkc/ml_dsa.d.ts +6 -26
  68. package/dist/types/crypto/pkc/ml_dsa.d.ts.map +1 -1
  69. package/dist/types/crypto/pkc/ml_kem.d.ts +0 -43
  70. package/dist/types/crypto/pkc/ml_kem.d.ts.map +1 -1
  71. package/dist/types/crypto/pkc/rsa.d.ts +0 -24
  72. package/dist/types/crypto/pkc/rsa.d.ts.map +1 -1
  73. package/dist/types/crypto/pkc/slh_dsa.d.ts +6 -16
  74. package/dist/types/crypto/pkc/slh_dsa.d.ts.map +1 -1
  75. package/dist/types/crypto/pkc/x25519.d.ts +0 -6
  76. package/dist/types/crypto/pkc/x25519.d.ts.map +1 -1
  77. package/dist/types/crypto/utils/bitArray.d.ts +0 -8
  78. package/dist/types/crypto/utils/bitArray.d.ts.map +1 -1
  79. package/dist/types/crypto/utils/jws.d.ts +6 -14
  80. package/dist/types/crypto/utils/jws.d.ts.map +1 -1
  81. package/dist/types/crypto/utils/keyformat.d.ts +52 -0
  82. package/dist/types/crypto/utils/keyformat.d.ts.map +1 -1
  83. package/dist/types/crypto/utils/random.d.ts +1 -10
  84. package/dist/types/crypto/utils/random.d.ts.map +1 -1
  85. package/dist/types/crypto/utils/rsaKeygen.d.ts +0 -10
  86. package/dist/types/crypto/utils/rsaKeygen.d.ts.map +1 -1
  87. package/dist/types/crypto/utils/uuid.d.ts.map +1 -1
  88. package/dist/types/crypto/utils/x509.d.ts +397 -0
  89. package/dist/types/crypto/utils/x509.d.ts.map +1 -0
  90. package/dist/types/crypto/wasm/argon2.d.ts +2 -1
  91. package/dist/types/crypto/wasm/argon2.d.ts.map +1 -1
  92. package/dist/types/crypto/wasm/pbkdf2.d.ts +2 -2
  93. package/dist/types/crypto/wasm/pbkdf2.d.ts.map +1 -1
  94. package/dist/types/crypto/wasm/rsa.d.ts.map +1 -1
  95. package/dist/types/crypto/wasm/runtime.d.ts +13 -0
  96. package/dist/types/crypto/wasm/runtime.d.ts.map +1 -1
  97. package/dist/types/crypto/webcrypto/aes.d.ts.map +1 -1
  98. package/dist/types/crypto/webcrypto/aeskw.d.ts.map +1 -1
  99. package/dist/types/crypto/webcrypto/digest.d.ts +0 -4
  100. package/dist/types/crypto/webcrypto/digest.d.ts.map +1 -1
  101. package/dist/types/crypto/webcrypto/rsa.d.ts.map +1 -1
  102. package/dist/types/dom/fs/fileIntake.d.ts +59 -0
  103. package/dist/types/dom/fs/fileIntake.d.ts.map +1 -0
  104. package/dist/types/dom/fs/fsAccess.d.ts.map +1 -1
  105. package/dist/types/dom/query/dnd.d.ts.map +1 -1
  106. package/dist/types/dom/query/sound.d.ts +89 -0
  107. package/dist/types/dom/query/sound.d.ts.map +1 -0
  108. package/dist/types/dom/rendering/chart.d.ts.map +1 -1
  109. package/dist/types/dom/rendering/component.d.ts +9 -3
  110. package/dist/types/dom/rendering/component.d.ts.map +1 -1
  111. package/dist/types/dom/rendering/parser.d.ts +39 -0
  112. package/dist/types/dom/rendering/parser.d.ts.map +1 -1
  113. package/dist/types/dom/rendering/render.d.ts.map +1 -1
  114. package/dist/types/dom/rendering/sanitize.d.ts +4 -0
  115. package/dist/types/dom/rendering/sanitize.d.ts.map +1 -1
  116. package/dist/types/dom/rendering/secPolicy.d.ts.map +1 -1
  117. package/dist/types/dom/rendering/styleSheet.d.ts +74 -0
  118. package/dist/types/dom/rendering/styleSheet.d.ts.map +1 -0
  119. package/dist/types/dom/rendering/template.d.ts +9 -3
  120. package/dist/types/dom/rendering/template.d.ts.map +1 -1
  121. package/dist/types/dom/rendering/themeTokens.d.ts +9 -3
  122. package/dist/types/dom/rendering/themeTokens.d.ts.map +1 -1
  123. package/dist/types/dom/rendering/uiSession-core.d.ts +9 -3
  124. package/dist/types/dom/rendering/uiSession-core.d.ts.map +1 -1
  125. package/dist/types/dom/rendering/uiSession-list.d.ts +9 -3
  126. package/dist/types/dom/rendering/uiSession-list.d.ts.map +1 -1
  127. package/dist/types/dom/rendering/uiSession.d.ts +18 -6
  128. package/dist/types/dom/rendering/uiSession.d.ts.map +1 -1
  129. package/dist/types/dom/sw/installPrompt.d.ts +89 -0
  130. package/dist/types/dom/sw/installPrompt.d.ts.map +1 -0
  131. package/dist/types/dom/sw/precache.d.ts +149 -0
  132. package/dist/types/dom/sw/precache.d.ts.map +1 -0
  133. package/dist/types/dom/sw/swUpdate.d.ts +129 -0
  134. package/dist/types/dom/sw/swUpdate.d.ts.map +1 -0
  135. package/dist/types/dom/utils/clipboard.d.ts +8 -0
  136. package/dist/types/dom/utils/clipboard.d.ts.map +1 -1
  137. package/dist/types/dom/utils/keybindings.d.ts.map +1 -1
  138. package/dist/types/dom/utils/route.d.ts.map +1 -1
  139. package/dist/types/dom/utils/ua.d.ts +2 -2
  140. package/dist/types/dom/utils/ua.d.ts.map +1 -1
  141. package/dist/types/io/calc/crc32.d.ts.map +1 -1
  142. package/dist/types/io/codec/b64.d.ts +24 -0
  143. package/dist/types/io/codec/b64.d.ts.map +1 -1
  144. package/dist/types/io/codec/cbor.d.ts +1 -0
  145. package/dist/types/io/codec/cbor.d.ts.map +1 -1
  146. package/dist/types/io/codec/hex.d.ts.map +1 -1
  147. package/dist/types/io/codec/msgpack.d.ts +1 -0
  148. package/dist/types/io/codec/msgpack.d.ts.map +1 -1
  149. package/dist/types/io/codec/url.d.ts +3 -1
  150. package/dist/types/io/codec/url.d.ts.map +1 -1
  151. package/dist/types/io/codec/utf8.d.ts.map +1 -1
  152. package/dist/types/io/compress/bitstream.d.ts +1 -1
  153. package/dist/types/io/compress/brotli.d.ts +0 -1
  154. package/dist/types/io/compress/brotli.d.ts.map +1 -1
  155. package/dist/types/io/compress/brotli_shared.d.ts +0 -4
  156. package/dist/types/io/compress/brotli_shared.d.ts.map +1 -1
  157. package/dist/types/io/compress/deflate.d.ts +14 -1
  158. package/dist/types/io/compress/deflate.d.ts.map +1 -1
  159. package/dist/types/io/compress/gzip.d.ts +4 -0
  160. package/dist/types/io/compress/gzip.d.ts.map +1 -1
  161. package/dist/types/io/compress/huffman.d.ts +7 -0
  162. package/dist/types/io/compress/huffman.d.ts.map +1 -1
  163. package/dist/types/io/compress/lz4.d.ts +4 -2
  164. package/dist/types/io/compress/lz4.d.ts.map +1 -1
  165. package/dist/types/io/compress/lz77.d.ts +17 -0
  166. package/dist/types/io/compress/lz77.d.ts.map +1 -1
  167. package/dist/types/io/compress/lzw.d.ts +2 -0
  168. package/dist/types/io/compress/lzw.d.ts.map +1 -1
  169. package/dist/types/io/compress/zip.d.ts.map +1 -1
  170. package/dist/types/io/compress/zlib.d.ts +9 -2
  171. package/dist/types/io/compress/zlib.d.ts.map +1 -1
  172. package/dist/types/io/math/linalg.d.ts.map +1 -1
  173. package/dist/types/process/rpc.d.ts.map +1 -1
  174. package/dist/types/process/workerPool.d.ts.map +1 -1
  175. package/dist/types/sanity/base.d.ts +12 -2
  176. package/dist/types/sanity/base.d.ts.map +1 -1
  177. package/dist/types/sanity/lockdown.d.ts +6 -5
  178. package/dist/types/sanity/lockdown.d.ts.map +1 -1
  179. package/dist/types/sanity/wasm-gate.d.ts +1 -1
  180. package/docs/README.md +17 -10
  181. package/docs/api/README.md +5 -5
  182. package/docs/api/core/logger.md +2 -1
  183. package/docs/api/core/modules.md +3 -3
  184. package/docs/api/core/runtime.md +9 -9
  185. package/docs/api/core/worker-helper.md +12 -2
  186. package/docs/api/crypto/README.md +1 -1
  187. package/docs/api/crypto/cipher/README.md +2 -2
  188. package/docs/api/crypto/cipher/aes.md +5 -10
  189. package/docs/api/crypto/cipher/chacha20.md +3 -8
  190. package/docs/api/crypto/hash/README.md +5 -5
  191. package/docs/api/crypto/hash/adf.md +21 -11
  192. package/docs/api/crypto/hash/argon2.md +3 -12
  193. package/docs/api/crypto/hash/blake2b.md +12 -14
  194. package/docs/api/crypto/hash/pbkdf2.md +1 -1
  195. package/docs/api/crypto/hash/sha224.md +2 -2
  196. package/docs/api/crypto/hash/sha256.md +4 -4
  197. package/docs/api/crypto/hash/sha3.md +2 -2
  198. package/docs/api/crypto/hash/sha384.md +1 -1
  199. package/docs/api/crypto/hash/sha512.md +5 -5
  200. package/docs/api/crypto/hash/sha512_224.md +1 -1
  201. package/docs/api/crypto/hash/sha512_256.md +1 -1
  202. package/docs/api/crypto/mode/README.md +3 -3
  203. package/docs/api/crypto/mode/cbc.md +2 -2
  204. package/docs/api/crypto/mode/chacha20poly1305.md +1 -1
  205. package/docs/api/crypto/mode/cmac.md +4 -4
  206. package/docs/api/crypto/mode/ctr.md +2 -3
  207. package/docs/api/crypto/mode/gcm.md +5 -5
  208. package/docs/api/crypto/mode/kw.md +4 -4
  209. package/docs/api/crypto/pkc/README.md +8 -8
  210. package/docs/api/crypto/pkc/ecc.md +19 -17
  211. package/docs/api/crypto/pkc/ed25519.md +10 -15
  212. package/docs/api/crypto/pkc/hybridKem.md +8 -2
  213. package/docs/api/crypto/pkc/hybridSign.md +34 -7
  214. package/docs/api/crypto/pkc/ml_dsa.md +20 -19
  215. package/docs/api/crypto/pkc/ml_kem.md +3 -3
  216. package/docs/api/crypto/pkc/rsa.md +7 -9
  217. package/docs/api/crypto/pkc/slh_dsa.md +12 -12
  218. package/docs/api/crypto/pkc/x25519.md +5 -4
  219. package/docs/api/crypto/utils/README.md +7 -7
  220. package/docs/api/crypto/utils/aes_modes.md +2 -5
  221. package/docs/api/crypto/utils/asn1.md +25 -16
  222. package/docs/api/crypto/utils/jws.md +6 -4
  223. package/docs/api/crypto/utils/keyformat.md +24 -15
  224. package/docs/api/crypto/utils/pad.md +1 -1
  225. package/docs/api/crypto/utils/pem.md +3 -3
  226. package/docs/api/crypto/utils/random.md +3 -4
  227. package/docs/api/crypto/utils/rsaKeygen.md +2 -2
  228. package/docs/api/crypto/utils/totp.md +2 -2
  229. package/docs/api/crypto/utils/uuid.md +5 -5
  230. package/docs/api/crypto/utils/x509.md +124 -0
  231. package/docs/api/crypto/wasm/aes.md +1 -1
  232. package/docs/api/crypto/wasm/argon2.md +6 -4
  233. package/docs/api/crypto/wasm/ml_kem.md +1 -0
  234. package/docs/api/crypto/wasm/pbkdf2.md +8 -8
  235. package/docs/api/crypto/wasm/rsa.md +1 -1
  236. package/docs/api/crypto/wasm/runtime.md +27 -10
  237. package/docs/api/crypto/webcrypto/aes.md +1 -1
  238. package/docs/api/crypto/webcrypto/aeskw.md +2 -2
  239. package/docs/api/crypto/webcrypto/digest.md +3 -5
  240. package/docs/api/crypto/webcrypto/ecc.md +1 -1
  241. package/docs/api/crypto/webcrypto/ed25519.md +1 -1
  242. package/docs/api/crypto/webcrypto/rsa.md +3 -2
  243. package/docs/api/crypto/webcrypto/x25519.md +1 -1
  244. package/docs/api/dom/README.md +6 -1
  245. package/docs/api/dom/fs/README.md +1 -0
  246. package/docs/api/dom/fs/fileIntake.md +120 -0
  247. package/docs/api/dom/fs/fsAccess.md +1 -0
  248. package/docs/api/dom/fs/indexedDB.md +1 -1
  249. package/docs/api/dom/fs/storage.md +1 -1
  250. package/docs/api/dom/query/README.md +2 -1
  251. package/docs/api/dom/query/dnd.md +4 -1
  252. package/docs/api/dom/query/dom.md +5 -0
  253. package/docs/api/dom/query/sound.md +103 -0
  254. package/docs/api/dom/rendering/README.md +4 -3
  255. package/docs/api/dom/rendering/chart.md +5 -4
  256. package/docs/api/dom/rendering/component.md +25 -3
  257. package/docs/api/dom/rendering/parser.md +5 -2
  258. package/docs/api/dom/rendering/reactiveBind.md +1 -1
  259. package/docs/api/dom/rendering/render.md +2 -2
  260. package/docs/api/dom/rendering/sanitize.md +10 -2
  261. package/docs/api/dom/rendering/secPolicy.md +4 -4
  262. package/docs/api/dom/rendering/styleSheet.md +85 -0
  263. package/docs/api/dom/rendering/template.md +20 -5
  264. package/docs/api/dom/rendering/themeTokens.md +6 -3
  265. package/docs/api/dom/rendering/uiSession.md +18 -5
  266. package/docs/api/dom/rendering/virtualScroll.md +2 -2
  267. package/docs/api/dom/sensors/geolocation.md +1 -1
  268. package/docs/api/dom/sw/README.md +7 -1
  269. package/docs/api/dom/sw/cache.md +2 -1
  270. package/docs/api/dom/sw/installPrompt.md +111 -0
  271. package/docs/api/dom/sw/precache.md +124 -0
  272. package/docs/api/dom/sw/serviceWorker.md +4 -2
  273. package/docs/api/dom/sw/swUpdate.md +112 -0
  274. package/docs/api/dom/utils/clipboard.md +56 -5
  275. package/docs/api/dom/utils/entropyCollector.md +1 -1
  276. package/docs/api/dom/utils/keybindings.md +17 -2
  277. package/docs/api/dom/utils/leaderElection.md +2 -2
  278. package/docs/api/dom/utils/route.md +1 -0
  279. package/docs/api/dom/utils/ua.md +15 -10
  280. package/docs/api/io/calc/crc32.md +4 -1
  281. package/docs/api/io/codec/README.md +2 -2
  282. package/docs/api/io/codec/b64.md +31 -2
  283. package/docs/api/io/codec/buffer.md +1 -1
  284. package/docs/api/io/codec/cbor.md +6 -4
  285. package/docs/api/io/codec/csv.md +178 -178
  286. package/docs/api/io/codec/hex.md +10 -2
  287. package/docs/api/io/codec/msgpack.md +4 -3
  288. package/docs/api/io/codec/url.md +4 -3
  289. package/docs/api/io/codec/utf8.md +3 -3
  290. package/docs/api/io/compress/bitstream.md +6 -3
  291. package/docs/api/io/compress/brotli.md +36 -4
  292. package/docs/api/io/compress/brotli_shared.md +1 -1
  293. package/docs/api/io/compress/deflate.md +42 -34
  294. package/docs/api/io/compress/gzip.md +26 -6
  295. package/docs/api/io/compress/huffman.md +2 -1
  296. package/docs/api/io/compress/lz4.md +5 -3
  297. package/docs/api/io/compress/lz77.md +26 -3
  298. package/docs/api/io/compress/lzw.md +13 -8
  299. package/docs/api/io/compress/zip.md +36 -10
  300. package/docs/api/io/compress/zlib.md +21 -5
  301. package/docs/api/io/math/linalg.md +1 -1
  302. package/docs/api/io/utils/valid.md +1 -1
  303. package/docs/api/process/rpc.md +3 -2
  304. package/docs/api/process/workerPool.md +1 -1
  305. package/docs/api/sanity/base.md +9 -5
  306. package/docs/api/sanity/lockdown.md +7 -6
  307. package/docs/api/surface.json +12311 -0
  308. package/docs/api/typed.md +5 -3
  309. package/docs/dev/README.md +2 -0
  310. package/docs/dev/bench.md +76 -0
  311. package/docs/dev/crypto-references.md +54 -0
  312. package/docs/dev/provenance.md +30 -7
  313. package/docs/dev/publishing.md +7 -7
  314. package/docs/dev/runtime.md +1 -1
  315. package/docs/dev/testing.md +13 -0
  316. package/docs/evidence/l4-evidence.md +86 -0
  317. package/docs/evidence/pqc-hybrid-evidence.md +7 -6
  318. package/docs/guide/README.md +1 -0
  319. package/docs/guide/_QUICK_REF.md +5 -5
  320. package/docs/guide/doc-format.md +4 -3
  321. package/docs/guide/integrations-hmr.md +1 -1
  322. package/docs/guide/module-creation-workflow.md +8 -8
  323. package/docs/guide/rendering-pipeline.md +11 -4
  324. package/docs/guide/security.md +7 -5
  325. package/docs/guide/stability.md +123 -0
  326. package/docs/guide/tutorial-todo.md +20 -8
  327. package/docs/guide/typescript.md +9 -0
  328. package/docs/guide/worker-confinement.md +30 -17
  329. package/docs/notes/lz77-deflate-factorization.md +3 -3
  330. package/docs/tools/README.md +1 -1
  331. package/docs/tools/bundler.md +3 -3
  332. package/docs/tools/codegen.md +1 -1
  333. package/docs/tools/standalone.md +0 -1
  334. package/fw.config.json +2 -2
  335. package/integrations/_shared/catalog.generated.json +7 -1
  336. package/integrations/_shared/core.js +1 -1
  337. package/integrations/astro/index.js +1 -1
  338. package/integrations/eslint/README.md +7 -1
  339. package/integrations/nextjs/index.js +1 -1
  340. package/integrations/nodejs/README.md +3 -3
  341. package/integrations/turbopack/index.js +2 -2
  342. package/integrations/typedoc/categorize.js +1 -1
  343. package/integrations/typedoc/typedoc.json +2 -1
  344. package/integrations/vite/index.js +2 -2
  345. package/integrations/vite/vite-env.d.ts +7 -4
  346. package/integrations/webpack/index.js +3 -3
  347. package/package.json +76 -10
  348. package/src/core/internal.js +31 -0
  349. package/src/core/logger.js +95 -23
  350. package/src/core/modules.js +17 -8
  351. package/src/core/readyState.js +1 -1
  352. package/src/core/runtime.js +74 -27
  353. package/src/core/worker-helper.js +83 -4
  354. package/src/crypto/NIST_CONFORMANCE.md +47 -34
  355. package/src/crypto/cipher/aes.acvp.md +7 -8
  356. package/src/crypto/cipher/aes.js +280 -229
  357. package/src/crypto/cipher/chacha20.acvp.md +6 -7
  358. package/src/crypto/cipher/chacha20.js +91 -61
  359. package/src/crypto/hash/adf.js +1 -1
  360. package/src/crypto/hash/argon2.acvp.md +11 -15
  361. package/src/crypto/hash/argon2.js +9 -24
  362. package/src/crypto/hash/blake2b.js +157 -125
  363. package/src/crypto/hash/hkdf.acvp.md +15 -15
  364. package/src/crypto/hash/hkdf.js +1 -1
  365. package/src/crypto/hash/hmac.acvp.md +10 -12
  366. package/src/crypto/hash/hmac.js +5 -1
  367. package/src/crypto/hash/pbkdf2.acvp.md +13 -13
  368. package/src/crypto/hash/pbkdf2.js +36 -8
  369. package/src/crypto/hash/poly1305.acvp.md +10 -6
  370. package/src/crypto/hash/poly1305.js +171 -50
  371. package/src/crypto/hash/sha224.acvp.md +3 -3
  372. package/src/crypto/hash/sha224.js +4 -4
  373. package/src/crypto/hash/sha256.acvp.md +2 -2
  374. package/src/crypto/hash/sha256.js +514 -50
  375. package/src/crypto/hash/sha3.acvp.md +9 -9
  376. package/src/crypto/hash/sha3.js +127 -71
  377. package/src/crypto/hash/sha384.acvp.md +3 -3
  378. package/src/crypto/hash/sha384.js +4 -4
  379. package/src/crypto/hash/sha512.acvp.md +7 -8
  380. package/src/crypto/hash/sha512.js +107 -108
  381. package/src/crypto/hash/sha512_224.acvp.md +6 -6
  382. package/src/crypto/hash/sha512_224.js +2 -2
  383. package/src/crypto/hash/sha512_256.acvp.md +6 -6
  384. package/src/crypto/hash/sha512_256.js +2 -2
  385. package/src/crypto/mode/cbc.acvp.md +2 -2
  386. package/src/crypto/mode/cbc.js +1 -1
  387. package/src/crypto/mode/chacha20poly1305.acvp.md +6 -6
  388. package/src/crypto/mode/chacha20poly1305.js +3 -3
  389. package/src/crypto/mode/cmac.acvp.md +5 -5
  390. package/src/crypto/mode/cmac.js +8 -8
  391. package/src/crypto/mode/ctr.acvp.md +2 -2
  392. package/src/crypto/mode/ctr.js +1 -3
  393. package/src/crypto/mode/gcm.acvp.md +6 -6
  394. package/src/crypto/mode/gcm.js +7 -7
  395. package/src/crypto/mode/kw.acvp.md +4 -4
  396. package/src/crypto/mode/kw.js +5 -5
  397. package/src/crypto/pkc/ecc.acvp.md +13 -13
  398. package/src/crypto/pkc/ecc.js +9 -11
  399. package/src/crypto/pkc/ed25519.acvp.md +30 -34
  400. package/src/crypto/pkc/ed25519.js +453 -94
  401. package/src/crypto/pkc/hybrid-kat.provenance.md +4 -4
  402. package/src/crypto/pkc/hybridSign.js +103 -24
  403. package/src/crypto/pkc/ml_dsa.acvp.md +18 -18
  404. package/src/crypto/pkc/ml_dsa.js +29 -32
  405. package/src/crypto/pkc/ml_kem.acvp.md +7 -7
  406. package/src/crypto/pkc/ml_kem.js +15 -21
  407. package/src/crypto/pkc/rsa.acvp.md +11 -15
  408. package/src/crypto/pkc/rsa.js +7 -44
  409. package/src/crypto/pkc/slh_dsa.acvp.md +16 -16
  410. package/src/crypto/pkc/slh_dsa.js +16 -18
  411. package/src/crypto/pkc/x25519.acvp.md +13 -10
  412. package/src/crypto/pkc/x25519.js +273 -29
  413. package/src/crypto/utils/aes_modes.acvp.md +1 -2
  414. package/src/crypto/utils/aes_modes.js +2 -2
  415. package/src/crypto/utils/asn1-oid.js +1 -1
  416. package/src/crypto/utils/asn1.js +1 -1
  417. package/src/crypto/utils/bitArray.js +33 -48
  418. package/src/crypto/utils/bn.js +1 -1
  419. package/src/crypto/utils/jws.js +37 -41
  420. package/src/crypto/utils/keyformat.js +181 -2
  421. package/src/crypto/utils/pem.js +1 -1
  422. package/src/crypto/utils/random.acvp.md +5 -5
  423. package/src/crypto/utils/random.js +845 -846
  424. package/src/crypto/utils/rsaKeygen.acvp.md +3 -2
  425. package/src/crypto/utils/rsaKeygen.js +6 -6
  426. package/src/crypto/utils/totp.js +1 -1
  427. package/src/crypto/utils/uuid.acvp.md +5 -5
  428. package/src/crypto/utils/uuid.js +11 -10
  429. package/src/crypto/utils/x509.js +591 -0
  430. package/src/crypto/wasm/aes.js +1 -1
  431. package/src/crypto/wasm/aes.scalar.wasm +0 -0
  432. package/src/crypto/wasm/argon2.js +17 -1
  433. package/src/crypto/wasm/argon2.scalar.wasm +0 -0
  434. package/src/crypto/wasm/blake2b.scalar.wasm +0 -0
  435. package/src/crypto/wasm/blake2b.simd.wasm +0 -0
  436. package/src/crypto/wasm/chacha20poly1305.scalar.wasm +0 -0
  437. package/src/crypto/wasm/chacha20poly1305.simd.wasm +0 -0
  438. package/src/crypto/wasm/cmac.scalar.wasm +0 -0
  439. package/src/crypto/wasm/ecc.js +3 -3
  440. package/src/crypto/wasm/ecc.scalar.wasm +0 -0
  441. package/src/crypto/wasm/ed25519.js +1 -1
  442. package/src/crypto/wasm/ed25519.scalar.wasm +0 -0
  443. package/src/crypto/wasm/hkdf.scalar.wasm +0 -0
  444. package/src/crypto/wasm/hmac.scalar.wasm +0 -0
  445. package/src/crypto/wasm/ml_dsa.js +2 -2
  446. package/src/crypto/wasm/ml_dsa.scalar.wasm +0 -0
  447. package/src/crypto/wasm/ml_dsa.simd.wasm +0 -0
  448. package/src/crypto/wasm/ml_kem.js +2 -2
  449. package/src/crypto/wasm/ml_kem.scalar.wasm +0 -0
  450. package/src/crypto/wasm/ml_kem.simd.wasm +0 -0
  451. package/src/crypto/wasm/pbkdf2.js +8 -6
  452. package/src/crypto/wasm/pbkdf2.scalar.wasm +0 -0
  453. package/src/crypto/wasm/rsa.js +6 -5
  454. package/src/crypto/wasm/rsa.scalar.wasm +0 -0
  455. package/src/crypto/wasm/runtime.js +84 -17
  456. package/src/crypto/wasm/sha2.scalar.wasm +0 -0
  457. package/src/crypto/wasm/sha3.scalar.wasm +0 -0
  458. package/src/crypto/wasm/sha3.simd.wasm +0 -0
  459. package/src/crypto/wasm/slh_dsa.js +1 -1
  460. package/src/crypto/wasm/slh_dsa.scalar.wasm +0 -0
  461. package/src/crypto/wasm/x25519.js +1 -1
  462. package/src/crypto/wasm/x25519.scalar.wasm +0 -0
  463. package/src/crypto/webcrypto/aes.js +8 -2
  464. package/src/crypto/webcrypto/aeskw.js +7 -2
  465. package/src/crypto/webcrypto/digest.js +1 -15
  466. package/src/crypto/webcrypto/ecc.js +2 -2
  467. package/src/crypto/webcrypto/ed25519.js +2 -2
  468. package/src/crypto/webcrypto/hmac.js +2 -2
  469. package/src/crypto/webcrypto/rsa.js +7 -2
  470. package/src/crypto/webcrypto/x25519.js +2 -2
  471. package/src/dom/display/animate.js +1 -1
  472. package/src/dom/display/fullscreen.js +1 -1
  473. package/src/dom/fs/download.js +1 -1
  474. package/src/dom/fs/fileIntake.js +192 -0
  475. package/src/dom/fs/fsAccess.js +2 -3
  476. package/src/dom/fs/indexedDB.js +1 -1
  477. package/src/dom/fs/remoteStore.js +1 -1
  478. package/src/dom/fs/storage.js +1 -1
  479. package/src/dom/lifecycle/idle.js +1 -1
  480. package/src/dom/lifecycle/visibility.js +1 -1
  481. package/src/dom/lifecycle/wakeLock.js +1 -1
  482. package/src/dom/net/ajax.js +1 -1
  483. package/src/dom/net/network.js +1 -1
  484. package/src/dom/net/sse.js +1 -1
  485. package/src/dom/net/webrtc.js +1 -1
  486. package/src/dom/net/ws.js +1 -1
  487. package/src/dom/query/dnd.js +56 -4
  488. package/src/dom/query/dom.js +1 -1
  489. package/src/dom/query/events.js +1 -1
  490. package/src/dom/query/gesture.js +1 -1
  491. package/src/dom/query/media.js +1 -1
  492. package/src/dom/query/sound.js +333 -0
  493. package/src/dom/rendering/chart.js +736 -663
  494. package/src/dom/rendering/component.js +25 -14
  495. package/src/dom/rendering/devtools.js +2 -2
  496. package/src/dom/rendering/parser.js +155 -12
  497. package/src/dom/rendering/render.js +14 -4
  498. package/src/dom/rendering/sanitize.js +11 -4
  499. package/src/dom/rendering/secPolicy.js +6 -4
  500. package/src/dom/rendering/styleSheet.js +217 -0
  501. package/src/dom/rendering/template.js +72 -13
  502. package/src/dom/rendering/themeTokens.js +542 -522
  503. package/src/dom/rendering/uiSession-core.js +51 -6
  504. package/src/dom/rendering/uiSession-direct.js +1 -1
  505. package/src/dom/rendering/uiSession-list.js +4 -4
  506. package/src/dom/rendering/uiSession.js +1 -1
  507. package/src/dom/rendering/virtualScroll.js +341 -341
  508. package/src/dom/sensors/battery.js +1 -1
  509. package/src/dom/sensors/geolocation.js +1 -1
  510. package/src/dom/sensors/networkInfo.js +1 -1
  511. package/src/dom/sensors/sensors.js +1 -1
  512. package/src/dom/sw/backgroundSync.js +1 -1
  513. package/src/dom/sw/cache.js +1 -1
  514. package/src/dom/sw/installPrompt.js +151 -0
  515. package/src/dom/sw/precache.js +257 -0
  516. package/src/dom/sw/push.js +1 -1
  517. package/src/dom/sw/sharedWorker.js +1 -1
  518. package/src/dom/sw/swUpdate.js +239 -0
  519. package/src/dom/utils/a11y.js +1 -1
  520. package/src/dom/utils/clipboard.js +56 -6
  521. package/src/dom/utils/entropyCollector.js +1 -1
  522. package/src/dom/utils/focus.js +1 -1
  523. package/src/dom/utils/form.js +1 -1
  524. package/src/dom/utils/keybindings.js +600 -574
  525. package/src/dom/utils/leaderElection.js +1 -1
  526. package/src/dom/utils/notifications.js +1 -1
  527. package/src/dom/utils/permissions.js +107 -107
  528. package/src/dom/utils/route.js +14 -2
  529. package/src/dom/utils/ua.js +42 -28
  530. package/src/dom/utils/webauthn.js +1 -1
  531. package/src/io/binary/reader.js +1 -1
  532. package/src/io/binary/writer.js +1 -1
  533. package/src/io/calc/bigint.js +1 -1
  534. package/src/io/calc/crc32.js +28 -2
  535. package/src/io/calc/easing.js +514 -514
  536. package/src/io/codec/b64.js +189 -52
  537. package/src/io/codec/base32.js +1 -1
  538. package/src/io/codec/base58.js +1 -1
  539. package/src/io/codec/buffer.js +1 -1
  540. package/src/io/codec/cbor.js +111 -18
  541. package/src/io/codec/csv.js +1 -1
  542. package/src/io/codec/hex.js +51 -6
  543. package/src/io/codec/mime.js +1 -1
  544. package/src/io/codec/msgpack.js +47 -6
  545. package/src/io/codec/url.js +24 -7
  546. package/src/io/codec/utf8.js +5 -3
  547. package/src/io/codec/xml.js +1 -1
  548. package/src/io/compress/bitstream.js +2 -2
  549. package/src/io/compress/brotli.js +663 -163
  550. package/src/io/compress/brotli_dict.js +1 -1
  551. package/src/io/compress/brotli_dict_words.js +1 -1
  552. package/src/io/compress/brotli_frame.js +1 -1
  553. package/src/io/compress/brotli_shared.js +7 -7
  554. package/src/io/compress/deflate.js +87 -53
  555. package/src/io/compress/gzip.js +187 -74
  556. package/src/io/compress/huffman.js +24 -1
  557. package/src/io/compress/lz4.js +45 -7
  558. package/src/io/compress/lz77.js +148 -63
  559. package/src/io/compress/lzw.js +35 -19
  560. package/src/io/compress/zip.js +862 -815
  561. package/src/io/compress/zlib.js +87 -7
  562. package/src/io/i18n/i18n.js +1 -1
  563. package/src/io/math/fixed-point.js +1 -1
  564. package/src/io/math/geom.js +1 -1
  565. package/src/io/math/interp.js +1 -1
  566. package/src/io/math/linalg.js +10 -4
  567. package/src/io/math/stats.js +1 -1
  568. package/src/io/structures/btree.js +1 -1
  569. package/src/io/structures/heap.js +1 -1
  570. package/src/io/structures/lruCache.js +1 -1
  571. package/src/io/structures/ringBuffer.js +1 -1
  572. package/src/io/structures/tree-walker.js +1 -1
  573. package/src/io/structures/trie.js +1 -1
  574. package/src/io/sync/abort.js +1 -1
  575. package/src/io/sync/atomics.js +1 -1
  576. package/src/io/sync/cancellable.js +1 -1
  577. package/src/io/sync/channel.js +1 -1
  578. package/src/io/sync/mutex.js +1 -1
  579. package/src/io/sync/semaphore.js +1 -1
  580. package/src/io/sync/tokenBucket.js +1 -1
  581. package/src/io/text/ansi.js +1 -1
  582. package/src/io/text/html-entities.js +1 -1
  583. package/src/io/time/date.js +1 -1
  584. package/src/io/timing/clock.js +1 -1
  585. package/src/io/timing/rateLimit.js +1 -1
  586. package/src/io/timing/scheduler.js +1 -1
  587. package/src/io/utils/errors.js +1 -1
  588. package/src/io/utils/eventBus.js +1 -1
  589. package/src/io/utils/signal.js +1 -1
  590. package/src/io/utils/valid.js +1 -1
  591. package/src/main.js +1 -1
  592. package/src/process/message.js +1 -1
  593. package/src/process/rpc.js +7 -3
  594. package/src/process/workerPool.js +11 -4
  595. package/src/sanity/base.js +85 -39
  596. package/src/sanity/lockdown-apply.js +3 -3
  597. package/src/sanity/lockdown.js +58 -32
  598. package/src/sanity/wasm-gate.js +2 -2
  599. package/src/typed.js +7 -3
  600. package/third-party/NOTICE-brotli-dictionary.txt +69 -0
  601. package/third-party/NOTICE-fw-wasm-crypto.txt +576 -0
  602. package/third-party/NOTICE-whatwg-entities.txt +44 -0
  603. package/types/registry.generated.d.ts +7 -1
  604. package/types/typed.d.ts +7 -3
  605. package/dist/types/crypto/utils/aes_ctr.d.ts +0 -84
  606. package/dist/types/crypto/utils/aes_ctr.d.ts.map +0 -1
  607. package/docs/api/crypto/utils/aes_ctr.md +0 -71
  608. package/src/crypto/utils/aes_ctr.acvp.md +0 -67
  609. package/src/crypto/utils/aes_ctr.js +0 -134
@@ -3,53 +3,56 @@
3
3
  * Author: Matthieu Bouilloux
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- var s$=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-[\w.-]+)?(?:\+[\w.-]+)?$/,a$=/^(fw|sd|sde|sdc|lib)\.[a-z][\w.]*$/;function n$(T,j){let[N,M=""]=T.split("-",2),[D,R=""]=j.split("-",2),J=N.split("."),U=D.split(".");for(let Z=0;Z<3;Z++){let H=+J[Z]||0,Q=+U[Z]||0;if(H!==Q)return H<Q?-1:1}if(M&&!R)return-1;if(!M&&R)return 1;if(M===R)return 0;return M<R?-1:1}function R$(T){let j=T.lastIndexOf("@");if(j<=0)return{name:T,version:void 0};return{name:T.slice(0,j),version:T.slice(j+1)}}function M$(T,j){return T+"@"+j}class I${static NEVER_SWAP=Object.freeze(["signal"]);constructor(){this.modules=new Map,this.instances=new Map,this.context={}}register(T){if(!T||!T.name||!T.factory)throw Error("Invalid module definition");let j=T.version!=null?T.version:"0.0.0";if(!s$.test(j))throw Error(`Invalid version "${j}" for module "${T.name}"`);if(T.type!=null&&!a$.test(T.type))throw Error(`Invalid type "${T.type}" for module "${T.name}"`);let N=this.modules.get(T.name);if(!N)N={versions:new Map,latest:j,latestDef:T},this.modules.set(T.name,N);if(N.versions.set(j,T),n$(j,N.latest)>=0)N.latest=j,N.latestDef=T;return this}registerAll(T){for(let j of T)this.register(j);return this}registerDeep(T){let j=new Set,N=(M)=>{if(!M||typeof M!=="object"||!M.name||!M.factory)return;if(j.has(M.name))return;if(j.add(M.name),Array.isArray(M.deps))for(let R of M.deps)N(R);let D=M.version!=null?M.version:"0.0.0";if(!this.has(M.name,D))this.register(M)};return N(T),this}registerAllDeep(T){for(let j of T)this.registerDeep(j);return this}unregister(T,j){let N=R$(T),M=N.name,D=N.version||j,R=this.modules.get(M);if(!R)return!1;if(D===void 0)return this.modules.delete(M),!0;if(!R.versions.has(D))return!1;if(R.versions.delete(D),R.versions.size===0)return this.modules.delete(M),!0;if(D===R.latest){let J=null,U=null;for(let[Z,H]of R.versions)if(J===null||n$(Z,J)>0)J=Z,U=H;R.latest=J,R.latestDef=U}return!0}has(T,j){let N=this.modules.get(T);if(!N)return!1;if(j===void 0)return!0;return N.versions.has(j)}resolve(T,j={}){let N=R$(T),M=N.name,D=N.version||j.version,R=this.modules.get(M);if(!R)throw Error(`Module not found: ${M}`);let J,U;if(D!==void 0){if(J=R.versions.get(D),!J)throw Error(`Module not found: ${M}@${D}`);U=D}else J=R.latestDef,U=R.latest;let Z=!!j.isolation,H=j.instances instanceof Map?j.instances:null;if(!Z)if(H){let Y=M$(M,U);if(H.has(Y))return H.get(Y)}else{let Y=this.instances.get(M);if(Y&&Y.has(U))return Y.get(U)}let Q=(J.dependencies||[]).map((Y)=>this.resolve(Y,j)),G=J.factory.apply({},Q);if(!Z)if(H)H.set(M$(M,U),G);else{let Y=this.instances.get(M);if(!Y)Y=new Map,this.instances.set(M,Y);Y.set(U,G)}return G}resolveAll(T,j={}){let N={};for(let M of T)N[M]=this.resolve(M,j);return N}list(T={}){let j=[],N=T.name,M=T.version,D=T.type,R=typeof D==="string"&&D.endsWith(".");for(let[J,U]of this.modules){if(N&&N!==J)continue;for(let[Z,H]of U.versions){if(M&&M!==Z)continue;if(D){if(!H.type)continue;if(R){if(!H.type.startsWith(D))continue}else if(H.type!==D)continue}j.push(H)}}return j}snapshot(T={}){let j=[],N=T.name,M=T.version,D=T.type,R=typeof D==="string"&&D.endsWith(".");for(let[J,U]of this.modules){if(N&&N!==J)continue;let Z=this.instances.get(J);for(let[H,Q]of U.versions){if(M&&M!==H)continue;if(D){if(!Q.type)continue;if(R){if(!Q.type.startsWith(D))continue}else if(Q.type!==D)continue}let G=Q.dependencies,Y=Array.isArray(G)?G.slice():[];j.push(Object.freeze({name:J,version:H,type:Q.type!=null?Q.type:null,dependencies:Object.freeze(Y),latest:H===U.latest,instantiated:!!(Z&&Z.has(H))}))}}return Object.freeze(j)}invalidate(T,j={}){let N=R$(T),M=N.name,D=N.version,R=this.modules.get(M);if(!R)throw Error(`Module not found: ${M}`);if(D!==void 0&&!R.versions.has(D))throw Error(`Module not found: ${M}@${D}`);let J=new Map;if(J.set(M,new Set(D!==void 0?[D]:R.versions.keys())),j.cascade){let Q=!0;while(Q){Q=!1;for(let[G,Y]of this.modules)for(let[F,L]of Y.versions){let W=J.get(G);if(W&&W.has(F))continue;if(!this._dependsOnTarget(L,J))continue;if(W)W.add(F);else J.set(G,new Set([F]));Q=!0}}}for(let Q of J.keys())if(I$.NEVER_SWAP.includes(Q))throw Error(`Module "${Q}" is in the never-swap set and cannot be invalidated`);let U=[],Z={};for(let[Q,G]of J){let Y=this.instances.get(Q);if(!Y)continue;for(let F of G){if(!Y.has(F))continue;let L=Y.get(F),W=M$(Q,F);if(U.push({name:Q,version:F,key:W}),L&&typeof L.dehydrate==="function")Z[W]=L.dehydrate()}}let H=[];for(let Q of U){let G=this.instances.get(Q.name);if(G.delete(Q.version),G.size===0)this.instances.delete(Q.name);H.push(Q.key)}return Object.freeze({invalidated:Object.freeze(H),state:Object.freeze(Z)})}_dependsOnTarget(T,j){let N=T.dependencies;if(!Array.isArray(N))return!1;for(let M of N){let D=R$(M),R=j.get(D.name);if(!R)continue;if(D.version!==void 0){if(R.has(D.version))return!0;continue}let J=this.modules.get(D.name);if(J&&R.has(J.latest))return!0}return!1}serialize(T){let j=this._buildGraph(T),N=[],M=j.map((R)=>{let{name:J,version:U,def:Z}=R,H=M$(J,U);N.push(H);let Q=J.replace(/'/g,"\\'"),G=U.replace(/'/g,"\\'"),Y=Z.type?`,type:'${Z.type.replace(/'/g,"\\'")}'`:"",F=(Z.dependencies||[]).map((K)=>{let z=R$(K),O=this.modules.get(z.name),C=z.version||(O?O.latest:"0.0.0");return M$(z.name,C).replace(/'/g,"\\'")}),L=F.length>0?`['${F.join("','")}']`:"[]",W=Z.factory.toString().replace(/^factory/,"function");return`{name:'${Q}',version:'${G}'${Y},dependencies:${L},factory:${W}}`}).join(",");return{list:`[${N.length>0?`'${N.map((R)=>R.replace(/'/g,"\\'")).join("','")}'`:""}]`,content:`[${M}]`}}_buildGraph(T){let j=new Set,N=[],M=(D)=>{let R=R$(D),J=this.modules.get(R.name);if(!J)throw Error(`Module not found: ${R.name}`);let U=R.version||J.latest,Z=J.versions.get(U);if(!Z)throw Error(`Module not found: ${R.name}@${U}`);let H=M$(R.name,U);if(j.has(H))return;j.add(H),(Z.dependencies||[]).forEach(M),N.push({name:R.name,version:U,def:Z})};return T.forEach(M),N}}var t$=[`const SEMVER_RE = ${s$.toString()};`,`const TYPE_RE = ${a$.toString()};`,`const DEFAULT_VERSION = ${JSON.stringify("0.0.0")};`,n$.toString(),R$.toString(),M$.toString(),I$.toString()].join(`
6
+ var YZ=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-[\w.-]+)?(?:\+[\w.-]+)?$/,UZ=/^(fw|sd|sde|sdc|lib|app)\.[a-z][\w.]*$/;function $Z(E,S){let T=(X)=>{let H=X.indexOf("+"),Q=H===-1?X:X.slice(0,H),L=Q.indexOf("-");return L===-1?{core:Q,pre:""}:{core:Q.slice(0,L),pre:Q.slice(L+1)}},N=T(E),R=T(S),j=N.core.split("."),Z=R.core.split(".");for(let X=0;X<3;X++){let H=+j[X]||0,Q=+Z[X]||0;if(H!==Q)return H<Q?-1:1}if(N.pre&&!R.pre)return-1;if(!N.pre&&R.pre)return 1;if(N.pre===R.pre)return 0;let q=N.pre.split("."),$=R.pre.split("."),V=Math.max(q.length,$.length);for(let X=0;X<V;X++){if(X>=q.length)return-1;if(X>=$.length)return 1;let H=q[X],Q=$[X];if(H===Q)continue;let L=/^\d+$/.test(H),Y=/^\d+$/.test(Q);if(L&&Y){let G=H.replace(/^0+(?=\d)/,""),J=Q.replace(/^0+(?=\d)/,"");if(G.length!==J.length)return G.length<J.length?-1:1;if(G!==J)return G<J?-1:1;continue}if(L)return-1;if(Y)return 1;return H<Q?-1:1}return 0}function j$(E){let S=E.lastIndexOf("@");if(S<=0)return{name:E,version:void 0};return{name:E.slice(0,S),version:E.slice(S+1)}}function T$(E,S){return E+"@"+S}class y${static NEVER_SWAP=Object.freeze(["signal"]);constructor(){this.modules=new Map,this.instances=new Map,this.context={}}register(E){if(!E||!E.name||!E.factory)throw Error("Invalid module definition");let S=E.version!=null?E.version:"0.0.0";if(!YZ.test(S))throw Error(`Invalid version "${S}" for module "${E.name}"`);if(E.type!=null&&!UZ.test(E.type))throw Error(`Invalid type "${E.type}" for module "${E.name}"`);let T=this.modules.get(E.name);if(!T)T={versions:new Map,latest:S,latestDef:E},this.modules.set(E.name,T);if(T.versions.set(S,E),$Z(S,T.latest)>=0)T.latest=S,T.latestDef=E;return this}registerAll(E){for(let S of E)this.register(S);return this}registerDeep(E){let S=new Set,T=(N)=>{if(!N||typeof N!=="object"||!N.name||!N.factory)return;if(S.has(N.name))return;if(S.add(N.name),Array.isArray(N.deps))for(let j of N.deps)T(j);let R=N.version!=null?N.version:"0.0.0";if(!this.has(N.name,R))this.register(N)};return T(E),this}registerAllDeep(E){for(let S of E)this.registerDeep(S);return this}unregister(E,S){let T=j$(E),N=T.name,R=T.version||S,j=this.modules.get(N);if(!j)return!1;if(R===void 0)return this.modules.delete(N),!0;if(!j.versions.has(R))return!1;if(j.versions.delete(R),j.versions.size===0)return this.modules.delete(N),!0;if(R===j.latest){let Z=null,q=null;for(let[$,V]of j.versions)if(Z===null||$Z($,Z)>0)Z=$,q=V;j.latest=Z,j.latestDef=q}return!0}has(E,S){let T=this.modules.get(E);if(!T)return!1;if(S===void 0)return!0;return T.versions.has(S)}resolve(E,S={}){let T=j$(E),N=T.name,R=T.version||S.version,j=this.modules.get(N);if(!j)throw Error(`Module not found: ${N}`);let Z,q;if(R!==void 0){if(Z=j.versions.get(R),!Z)throw Error(`Module not found: ${N}@${R}`);q=R}else Z=j.latestDef,q=j.latest;let $=!!S.isolation,V=S.instances instanceof Map?S.instances:null;if(!$)if(V){let Q=T$(N,q);if(V.has(Q))return V.get(Q)}else{let Q=this.instances.get(N);if(Q&&Q.has(q))return Q.get(q)}let X=(Z.dependencies||[]).map((Q)=>this.resolve(Q,S)),H=Z.factory.apply({},X);if(!$)if(V)V.set(T$(N,q),H);else{let Q=this.instances.get(N);if(!Q)Q=new Map,this.instances.set(N,Q);Q.set(q,H)}return H}resolveAll(E,S={}){let T={};for(let N of E)T[N]=this.resolve(N,S);return T}list(E={}){let S=[],T=E.name,N=E.version,R=E.type,j=typeof R==="string"&&R.endsWith(".");for(let[Z,q]of this.modules){if(T&&T!==Z)continue;for(let[$,V]of q.versions){if(N&&N!==$)continue;if(R){if(!V.type)continue;if(j){if(!V.type.startsWith(R))continue}else if(V.type!==R)continue}let X={...V};if(Array.isArray(V.dependencies))X.dependencies=Object.freeze(V.dependencies.slice());S.push(Object.freeze(X))}}return Object.freeze(S)}snapshot(E={}){let S=[],T=E.name,N=E.version,R=E.type,j=typeof R==="string"&&R.endsWith(".");for(let[Z,q]of this.modules){if(T&&T!==Z)continue;let $=this.instances.get(Z);for(let[V,X]of q.versions){if(N&&N!==V)continue;if(R){if(!X.type)continue;if(j){if(!X.type.startsWith(R))continue}else if(X.type!==R)continue}let H=X.dependencies,Q=Array.isArray(H)?H.slice():[];S.push(Object.freeze({name:Z,version:V,type:X.type!=null?X.type:null,dependencies:Object.freeze(Q),latest:V===q.latest,instantiated:!!($&&$.has(V))}))}}return Object.freeze(S)}invalidate(E,S={}){let T=j$(E),N=T.name,R=T.version,j=this.modules.get(N);if(!j)throw Error(`Module not found: ${N}`);if(R!==void 0&&!j.versions.has(R))throw Error(`Module not found: ${N}@${R}`);let Z=new Map;if(Z.set(N,new Set(R!==void 0?[R]:j.versions.keys())),S.cascade){let X=!0;while(X){X=!1;for(let[H,Q]of this.modules)for(let[L,Y]of Q.versions){let G=Z.get(H);if(G&&G.has(L))continue;if(!this._dependsOnTarget(Y,Z))continue;if(G)G.add(L);else Z.set(H,new Set([L]));X=!0}}}for(let X of Z.keys())if(y$.NEVER_SWAP.includes(X))throw Error(`Module "${X}" is in the never-swap set and cannot be invalidated`);let q=[],$={};for(let[X,H]of Z){let Q=this.instances.get(X);if(!Q)continue;for(let L of H){if(!Q.has(L))continue;let Y=Q.get(L),G=T$(X,L);if(q.push({name:X,version:L,key:G}),Y&&typeof Y.dehydrate==="function")$[G]=Y.dehydrate()}}let V=[];for(let X of q){let H=this.instances.get(X.name);if(H.delete(X.version),H.size===0)this.instances.delete(X.name);V.push(X.key)}return Object.freeze({invalidated:Object.freeze(V),state:Object.freeze($)})}_dependsOnTarget(E,S){let T=E.dependencies;if(!Array.isArray(T))return!1;for(let N of T){let R=j$(N),j=S.get(R.name);if(!j)continue;if(R.version!==void 0){if(j.has(R.version))return!0;continue}let Z=this.modules.get(R.name);if(Z&&j.has(Z.latest))return!0}return!1}serialize(E){let S=this._buildGraph(E),T=[],N=S.map((j)=>{let{name:Z,version:q,def:$}=j,V=T$(Z,q);T.push(V);let X=Z.replace(/'/g,"\\'"),H=q.replace(/'/g,"\\'"),Q=$.type?`,type:'${$.type.replace(/'/g,"\\'")}'`:"",L=($.dependencies||[]).map((J)=>{let U=j$(J),W=this.modules.get(U.name),C=U.version||(W?W.latest:"0.0.0");return T$(U.name,C).replace(/'/g,"\\'")}),Y=L.length>0?`['${L.join("','")}']`:"[]",G=$.factory.toString().replace(/^factory/,"function");return`{name:'${X}',version:'${H}'${Q},dependencies:${Y},factory:${G}}`}).join(",");return{list:`[${T.length>0?`'${T.map((j)=>j.replace(/'/g,"\\'")).join("','")}'`:""}]`,content:`[${N}]`}}_buildGraph(E){let S=new Set,T=[],N=(R)=>{let j=j$(R),Z=this.modules.get(j.name);if(!Z)throw Error(`Module not found: ${j.name}`);let q=j.version||Z.latest,$=Z.versions.get(q);if(!$)throw Error(`Module not found: ${j.name}@${q}`);let V=T$(j.name,q);if(S.has(V))return;S.add(V),($.dependencies||[]).forEach(N),T.push({name:j.name,version:q,def:$})};return E.forEach(N),T}}var KZ=[`const SEMVER_RE = ${YZ.toString()};`,`const TYPE_RE = ${UZ.toString()};`,`const DEFAULT_VERSION = ${JSON.stringify("0.0.0")};`,$Z.toString(),j$.toString(),T$.toString(),y$.toString()].join(`
7
7
 
8
- `);var PJ=function(T){let j=typeof window<"u",N=j?window.console:globalThis.console,M=[],D=65536,R=1024,J=null,U=function(){M.splice(0)},Z=function(K){if(!isNaN(K)&&K>0&&K<=65536)R=K},H=function(){return M.slice()},Q=function(K){if(typeof K!=="function")throw Error("logger: fn must be a function");if(J!==null)throw Error("logger: subscriber already registered");J=K;let z=!0;return function(){if(z)z=!1,J=null}},G=function(K){if(J!==null)try{J(K)}catch(z){}},Y=function(K){if(M.push(K),M.length>R)M.shift();G(K)},F=function(K,z,O){let C={ts:Date.now(),lvl:K,data:z,stack:O};Y(C)},L=function(K){if(typeof K!=="string")return K;if(K.slice(-1)===`
9
- `)return K.slice(0,-1).split(`
10
- `);return K.split(`
11
- `)},W=function(K){return new Proxy(K,{get:function(z,O){let C=z[O];if(typeof C!=="function")return C;return function(){let q=Error().stack;if(F(String(O),[...arguments],q),T)return C.apply(z,[...arguments,L(q)])}},set:function(){return console.warn("Attempt to modify console"),!0}})};if(j){let K=W(N);Object.defineProperty(window,"console",{value:K,writable:!1,enumerable:!1,configurable:!1})}return{get:H,setLen:Z,clear:U,__push:Y,subscribe:Q}},DJ=function(T,j){let N=self.console,M=[],D=65536,R=1024,J=null,U=function(){M.splice(0)},Z=function(O){if(!isNaN(O)&&O>0&&O<=65536)R=O},H=function(){return M.slice()},Q=function(O){if(typeof O!=="function")throw Error("logger: fn must be a function");if(J!==null)throw Error("logger: subscriber already registered");J=O;let C=!0;return function(){if(C)C=!1,J=null}},G=function(O){if(J!==null)try{J(O)}catch(C){}},Y=function(O){let C=new WeakSet,q=function(P){return JSON.parse(JSON.stringify(P,function($,X){if(typeof X==="bigint")return X.toString()+"n";if(typeof X==="symbol")return X.toString();if(typeof X==="function")return"[Function "+(X.name||"anonymous")+"]";if(X instanceof Error)return{name:X.name,message:X.message,stack:X.stack};if(X instanceof Map)return{__type:"Map",value:Array.from(X.entries())};if(X instanceof Set)return{__type:"Set",value:Array.from(X.values())};if(X&&typeof X==="object"){if(C.has(X))return"[Circular]";C.add(X)}return X}))};try{return q(O)}catch(P){return{__type:"Unserializable",message:P&&P.message?P.message:"serializeLog failed"}}},F=function(O){if(M.push(O),M.length>R)M.shift();j.postMessage({__fw:!0,__type:"log",msg:O}),G(O)},L=function(O,C,q){let P={ts:Date.now(),lvl:O,data:Y(C),stack:q};F(P)},W=function(O){if(typeof O!=="string")return O;if(O.slice(-1)===`
12
- `)return O.slice(0,-1).split(`
13
- `);return O.split(`
14
- `)},z=function(O){return new Proxy(O,{get:function(C,q){let P=C[q];if(typeof P!=="function")return P;return function(){let $=Error().stack;if(L(String(q),[...arguments],$),T)return P.apply(C,[...arguments,W($)])}},set:function(){return console.warn("Attempt to modify console"),!0}})}(N);return Object.defineProperty(self,"console",{value:z,writable:!1,enumerable:!1,configurable:!1}),{get:H,setLen:Z,clear:U,subscribe:Q}},o$={main:PJ,worker:DJ};function e$(T,j,N,M,D){let U=[],Z=function(G,Y,F){return{libs:G.resolveAll(Y),process:{},args:F}},H=function(G){return!!(G&&G.__fw===!0)},Q=function(){if(T.LOG)return function(G){if(H(G.data)){if(G.stopImmediatePropagation(),G.data.__type==="log")M.__push(G.data.msg)}};else return function(G){if(H(G.data))G.stopImmediatePropagation()}};return function(Y,F={}){let L=F&&typeof F==="object"?F:{},W={dependencies:Array.isArray(L.dependencies)?L.dependencies:U,workerFw:typeof L.workerFw==="function"?L.workerFw:Z,args:Array.isArray(L.args)?L.args:[],terminate:typeof L.terminate==="function"?L.terminate:function(){}},K=j.serialize(W.dependencies),z=JSON.stringify(W.args),O=T.LOG?`(${D})(${T.DEV.toString()}, self);`:"",C=JSON.stringify(W.dependencies),q=O+`
15
- ${N}
8
+ `);var kJ=function(E){let S=typeof window<"u",T=S?window.console:globalThis.console,N=[],R=65536,j=1024,Z=null,q=function(){N.splice(0)},$=function(C){if(!isNaN(C)&&C>0&&C<=65536)j=C},V=function(){return N.slice()},X=function(C){if(typeof C!=="function")throw Error("logger: fn must be a function");if(Z!==null)throw Error("logger: subscriber already registered");Z=C;let P=!0;return function(){if(P)P=!1,Z=null}},H=function(C){if(Z!==null)try{Z(C)}catch(P){}},Q=function(C){if(N.push(C),N.length>j)N.shift();H(C)},L=function(C,P,D){let F={ts:Date.now(),lvl:C,data:P,stack:D};Q(F)},Y=function(C){if(typeof C!=="string")return C;if(C.slice(-1)===`
9
+ `)return C.slice(0,-1).split(`
10
+ `);return C.split(`
11
+ `)},G=Symbol.for("@awacloud/fw/console-sinks"),J=Symbol.for("@awacloud/fw/console-mode"),U=function(C){let P=[L],D={native:!1};return new Proxy(C,{get:function(F,K){if(K===G)return P;if(K===J)return D;let O=F[K];if(typeof O!=="function")return O;return function(){let M=Error().stack;for(let z=0;z<P.length;z++)P[z](String(K),[...arguments],M);if(D.native)return O.apply(F,arguments);if(E)return O.apply(F,[...arguments,Y(M)])}},set:function(){return console.warn("Attempt to modify console"),!0}})};if(S){let C=T&&T[G];if(Array.isArray(C))C.push(L);else{let P=Object.getOwnPropertyDescriptor(window,"console");if(!P||P.configurable||P.writable){let D=U(T);Object.defineProperty(window,"console",{value:D,writable:!1,enumerable:!1,configurable:!1})}}}return{get:V,setLen:$,clear:q,__push:Q,subscribe:X,native:function(C){let P=S&&window.console?window.console[J]:null;if(!P||typeof P!=="object")return!1;return P.native=C!==!1,!0}}},gJ=function(E,S){let T=self.console,N=[],R=65536,j=1024,Z=null,q=function(){N.splice(0)},$=function(D){if(!isNaN(D)&&D>0&&D<=65536)j=D},V=function(){return N.slice()},X=function(D){if(typeof D!=="function")throw Error("logger: fn must be a function");if(Z!==null)throw Error("logger: subscriber already registered");Z=D;let F=!0;return function(){if(F)F=!1,Z=null}},H=function(D){if(Z!==null)try{Z(D)}catch(F){}},Q=function(D){let F=new WeakSet,K=function(O){return JSON.parse(JSON.stringify(O,function(M,z){if(typeof z==="bigint")return z.toString()+"n";if(typeof z==="symbol")return z.toString();if(typeof z==="function")return"[Function "+(z.name||"anonymous")+"]";if(z instanceof Error)return{name:z.name,message:z.message,stack:z.stack};if(z instanceof Map)return{__type:"Map",value:Array.from(z.entries())};if(z instanceof Set)return{__type:"Set",value:Array.from(z.values())};if(z&&typeof z==="object"){if(F.has(z))return"[Circular]";F.add(z)}return z}))};try{return K(D)}catch(O){return{__type:"Unserializable",message:O&&O.message?O.message:"serializeLog failed"}}},L=function(D){if(N.push(D),N.length>j)N.shift();S.postMessage({__fw:!0,__type:"log",msg:D}),H(D)},Y=function(D,F,K){let O={ts:Date.now(),lvl:D,data:Q(F),stack:K};L(O)},G=function(D){if(typeof D!=="string")return D;if(D.slice(-1)===`
12
+ `)return D.slice(0,-1).split(`
13
+ `);return D.split(`
14
+ `)},J=Symbol.for("@awacloud/fw/console-sinks"),U=Symbol.for("@awacloud/fw/console-mode"),W=function(D){let F=[Y],K={native:!1};return new Proxy(D,{get:function(O,M){if(M===J)return F;if(M===U)return K;let z=O[M];if(typeof z!=="function")return z;return function(){let B=Error().stack;for(let I=0;I<F.length;I++)F[I](String(M),[...arguments],B);if(K.native)return z.apply(O,arguments);if(E)return z.apply(O,[...arguments,G(B)])}},set:function(){return console.warn("Attempt to modify console"),!0}})},C=T&&T[J];if(Array.isArray(C))C.push(Y);else{let D=Object.getOwnPropertyDescriptor(self,"console");if(!D||D.configurable||D.writable){let F=W(T);Object.defineProperty(self,"console",{value:F,writable:!1,enumerable:!1,configurable:!1})}}return{get:V,setLen:$,clear:q,subscribe:X,native:function(D){let F=self.console?self.console[U]:null;if(!F||typeof F!=="object")return!1;return F.native=D!==!1,!0}}},ZZ={main:kJ,worker:gJ};function zZ(E,S,T,N,R){let q=[],$=/^[A-Za-z_$][\w$]*$/,V=function(Y){for(let G of Y){for(let J=globalThis;J;J=Object.getPrototypeOf(J))if(Object.prototype.hasOwnProperty.call(J,G))try{delete J[G]}catch(U){}if(G in globalThis)throw Error('createWorker: could not revoke "'+G+'"')}},X=function(Y){let G=[];if(Y.revoke!==void 0){if(!Array.isArray(Y.revoke)||!Y.revoke.every((W)=>typeof W==="string"&&$.test(W)))throw TypeError("createWorker: revoke must be an array of global names");G=Y.revoke.slice()}let J=null,U=Y.lockdown;if(U===!0)J=new URL("../sanity/lockdown.js",import.meta.url).href;else if(U&&typeof U==="object")try{J=new URL(String(U.url)).href}catch(W){throw TypeError("createWorker: lockdown.url must be an absolute URL",{cause:W})}else if(U!==void 0&&U!==!1)throw TypeError("createWorker: lockdown must be true, false or { url }");return{revoke:G,lockdownUrl:J}},H=function(Y,G,J){return{libs:Y.resolveAll(G),process:{},args:J}},Q=function(Y){return!!(Y&&Y.__fw===!0)},L=function(){if(E.LOG)return function(Y){if(Q(Y.data)){if(Y.stopImmediatePropagation(),Y.data.__type==="log")N.__push(Y.data.msg)}};else return function(Y){if(Q(Y.data))Y.stopImmediatePropagation()}};return function(G,J={}){let U=J&&typeof J==="object"?J:{},W={dependencies:Array.isArray(U.dependencies)?U.dependencies:q,workerFw:typeof U.workerFw==="function"?U.workerFw:H,args:Array.isArray(U.args)?U.args:[],terminate:typeof U.terminate==="function"?U.terminate:function(){}},C=X(U),P=S.serialize(W.dependencies),D=JSON.stringify(W.args),F=E.LOG?`(${R})(${E.DEV===!0}, self);`:"",K=JSON.stringify(W.dependencies),O=C.lockdownUrl?`import { lockdown as __fwLockdown } from ${JSON.stringify(C.lockdownUrl)};
15
+ `:"",M=(C.revoke.length?`(${V.toString()})(${JSON.stringify(C.revoke)});`:"")+(C.lockdownUrl?"__fwLockdown();":""),z=O+F+`
16
+ ${T}
16
17
 
17
18
  const runtime = new ModuleRuntime();
18
19
 
19
- ${K.content}.forEach(m => {
20
+ ${P.content}.forEach(m => {
20
21
  runtime.register(m);
21
22
  });
22
23
 
23
- runtime.context = (${W.workerFw.toString()})(runtime, ${C}, ${z});
24
+ runtime.context = (${W.workerFw.toString()})(runtime, ${K}, ${D});
24
25
 
25
- (${Y.toString()})( runtime.context );
26
- `,P=URL.createObjectURL(new Blob([q],{type:"text/javascript"})),$;try{$=new Worker(P)}catch(S){throw URL.revokeObjectURL(P),S}let X=Q();$.addEventListener("message",X);let V=$.terminate.bind($),B=!1,A=function(){if(B)return!1;return B=!0,$.removeEventListener("message",X),URL.revokeObjectURL(P),W.terminate(),!0};return $.terminate=function(){A(),V()},$}}function $Z(){let T={status:!1,interactive:!1,complete:!1,queue:{interactive:[],complete:[]}},j=function(Z,H){try{Z.apply({},H)}catch(Q){}},N=function(Z){for(let H=0;H<Z.length;H++)j(Z[H][0],Z[H][1])},M=function(){if(T.status==="interactive")T.interactive=!0;else if(T.status==="complete")T.interactive=!0,T.complete=!0},D=function(){if(T.interactive&&T.queue.interactive.length>0)N(T.queue.interactive.splice(0));if(T.complete&&T.queue.complete.length>0)N(T.queue.complete.splice(0))},R=function(){if(T.status!==!1)return;if(T.status=document.readyState,M(),T.status==="complete")return;document.addEventListener("readystatechange",function(){T.status=document.readyState,M(),D()})};return{loaded:function(Z,H=[]){if(typeof Z!=="function")return;if(R(),T.interactive)j(Z,H);else T.queue.interactive.push([Z,H])},complete:function(Z,H=[]){if(typeof Z!=="function")return;if(R(),T.complete)j(Z,H);else T.queue.complete.push([Z,H])}}}var ZZ={name:"errors",version:"1.0.0",type:"fw.io.utils",dependencies:[],factory(){let T={debug:10,info:20,warn:30,error:40,silent:99};function j(D={}){let R=D.prefix||"",J=D.level&&T[D.level]!==void 0?D.level:"info",U=T[J],Z=typeof D.sink==="function"?D.sink:null;function H(G,Y,F){if(T[G]<U)return;let L={level:G,prefix:R,time:Date.now(),message:typeof Y==="string"?Y:String(Y),context:F&&typeof F==="object"?F:{}};if(Z){try{Z(L)}catch{}return}let W=R?`[${R}]`:"",K=F!==void 0?[W,L.message,L.context]:[W,L.message],z=typeof console<"u"&&console[G]||typeof console<"u"&&console.log;if(z)try{z.apply(console,K)}catch{}}return{debug(G,Y){H("debug",G,Y)},info(G,Y){H("info",G,Y)},warn(G,Y){H("warn",G,Y)},error(G,Y){H("error",G,Y)},child(G){let Y=R?`${R}:${G}`:G;return j({level:J,prefix:Y,sink:Z})},set level(G){if(T[G]!==void 0)J=G,U=T[G]},get level(){return J}}}function N(D={}){let R=typeof D.onError==="function"?D.onError:null,J=!!D.rethrow;return function(Z,H){if(typeof Z!=="function")throw Error("errors.guard: fn must be a function");let Q;try{Q=Z()}catch(G){if(R)try{R(G,H)}catch{}if(J)throw G;return}if(Q&&typeof Q.then==="function")return Q.catch((G)=>{if(R)try{R(G,H)}catch{}if(J)throw G;return});return Q}}function M(D,R,J={}){if(!D||typeof D.text!=="function")throw Error("errors.boundary: ui (UISession) is required");if(typeof R!=="string")throw Error("errors.boundary: blockId must be a string");let U=typeof J.onError==="function"?J.onError:null,Z=typeof J.render==="function"?J.render:null,H=typeof J.fallback==="string"?J.fallback:null,Q=!!J.clear;function G(Y){if(U)try{U(Y)}catch{}try{if(Z)Z(Y,D,R);else if(H!=null){if(D.get(R))D.text(R,H)}if(Q)D.clear(R)}catch{}}return function(F){if(typeof F!=="function")throw Error("errors.boundary: fn must be a function");let L;try{L=F()}catch(W){G(W);return}if(L&&typeof L.then==="function")return L.catch((W)=>{G(W);return});return L}}return{logger:j,guard:N,boundary:M}}};var w$={name:"eventBus",version:"1.0.0",type:"fw.io.utils",dependencies:[],factory(){function T(M,D=!0){if(typeof M!=="string"||M.length===0)throw TypeError("eventBus: topic must be a non-empty string");if(M==="*")throw Error('eventBus: global wildcard "*" is not allowed; use a namespaced pattern like "ns:*"');let R=(M.match(/\*/g)||[]).length;if(R>0){if(!D)throw Error("eventBus: wildcards not allowed in emit/set/clear topic: "+M);if(R>1||!M.endsWith(":*"))throw Error('eventBus: invalid wildcard pattern "'+M+'"; only "prefix:*" is allowed')}}function j(M,D){if(M===D)return!0;if(M.endsWith(":*")){let R=M.slice(0,-1);return D.startsWith(R)&&D.length>R.length}return!1}function N(){let M=new Map,D=new Map,R=new Map;function J(K){if(!M.has(K))M.set(K,new Set);return M.get(K)}function U(K){if(!D.has(K))D.set(K,new Set);return D.get(K)}function Z(K,z,O){if(T(K,!0),typeof z!=="function")throw TypeError("eventBus: listener must be a function");let C;if(K.endsWith(":*"))U(K).add(z),C=()=>H(K,z);else J(K).add(z),C=()=>H(K,z);if(O&&O.replay===!0&&R.has(K))try{z(R.get(K))}catch(q){console.error("eventBus sticky replay error:",q)}return C}function H(K,z){if(T(K,!0),K.endsWith(":*")){let O=D.get(K);if(O){if(O.delete(z),O.size===0)D.delete(K)}}else{let O=M.get(K);if(O){if(O.delete(z),O.size===0)M.delete(K)}}}function Q(K,z){T(K,!1);let O=M.get(K);if(O&&O.size>0)for(let C of[...O])try{C(z)}catch(q){console.error("eventBus handler error:",q)}for(let[C,q]of D)if(j(C,K))for(let P of[...q])try{P(z)}catch($){console.error("eventBus handler error:",$)}}function G(K,z){if(T(K,!0),typeof z!=="function")throw TypeError("eventBus: listener must be a function");let O=Z(K,z);if(R.has(K))try{z(R.get(K))}catch(C){console.error("eventBus sticky replay error:",C)}return O}function Y(K,z){T(K,!1),R.set(K,z),Q(K,z)}function F(K){if(K===void 0)R.clear();else T(K,!1),R.delete(K)}function L(){let K=[];function z(q,P){let $=Z(q,P);return K.push($),$}function O(q,P){let $=G(q,P);return K.push($),$}function C(){for(let q of K)try{q()}catch(P){console.error("eventBus scope dispose error:",P)}K.length=0}return{on:z,sticky:O,dispose:C}}function W(){let K=new Set;for(let[z,O]of M)if(O.size>0)K.add(z);for(let[z,O]of D)if(O.size>0)K.add(z);for(let z of R.keys())K.add(z);return[...K]}return{on:Z,off:H,emit:Q,sticky:G,set:Y,clear:F,scope:L,topics:W}}return{create:N}}};var k$={name:"signal",version:"1.2.0",type:"fw.io.utils",dependencies:[],factory(){let T=0,j=null,N=null,M="sync",D=null,R=!1,J=0,U=0,Z=new Set;function H(){R=!1;let $=D;if(D=null,!$)return;for(let[X,V]of $)for(let B of[...X._subs])try{B(V)}catch{}}function Q(){if(M==="raf"&&typeof requestAnimationFrame==="function")requestAnimationFrame(H);else Promise.resolve().then(H)}function G($,X){let V=$,B=X&&typeof X.eq==="function"?X.eq:Object.is,A=new Set,S={get(){if(N!==null)N.add(S);return V},peek(){return V},set(E){if(B(V,E))return;if(V=E,T>0){j.set(S,V);return}if(M!=="sync"){if(D===null)D=new Map;if(D.set(S,V),!R)R=!0,Q();return}for(let I of[...A])try{I(V)}catch{}},update(E){S.set(E(V))},subscribe(E){if(typeof E!=="function")return()=>{};return A.add(E),()=>A.delete(E)},get size(){return A.size},_isSignal:!0,_subs:A,_graphId:"s"+ ++J};return S}function Y($,X,V){if(!Array.isArray($)||$.some((g)=>!g||!g._isSignal))throw Error("signal.derived: deps must be an array of signals");if(typeof X!=="function")throw Error("signal.derived: fn must be a function");let B=()=>X(...$.map((g)=>g.peek())),A=G(B(),V),S=!1,E=$.map((g)=>g.subscribe(()=>{if(S)return;A.set(B())}));function I(){if(S)return;S=!0;for(let g of E)try{g()}catch{}E.length=0}return{get:A.get,peek:A.peek,subscribe:A.subscribe,dispose:I,get size(){return A.size},_isSignal:!0,_subs:A._subs}}function F($){if(typeof $!=="function")return;if(T===0)j=new Map;T++;try{$()}finally{if(T--,T===0){let X=j;j=null;for(let[V,B]of X)for(let A of[...V._subs])try{A(B)}catch{}}}}function L($){let X=N;N=null;try{return $()}finally{N=X}}function W($){if(typeof $!=="function")throw Error("signal.effect: fn must be a function");let X=new Set,V=!1,B={id:"e"+ ++U,deps:new Set};Z.add(B);function A(){for(let E of X)try{E()}catch{}X.clear()}function S(){if(V)return;A();let E=new Set,I=N;N=E;try{$()}catch(g){try{console.error("signal.effect: handler threw",g)}catch{}}finally{N=I}B.deps.clear();for(let g of E){B.deps.add(g._graphId);let k=g.subscribe(S);X.add(k)}}return S(),function(){V=!0,A(),B.deps.clear(),Z.delete(B)}}function K($,X){if(typeof $!=="function")throw Error("signal.resource: fetcher must be a function");let V=!(X&&X.autoStart===!1),B=X&&typeof X.eq==="function"?X.eq:(I,g)=>I.status===g.status&&I.value===g.value&&I.error===g.error,A=G({status:"idle",value:null,error:null},{eq:B}),S=0;function E(){let I=++S;A.set({status:"pending",value:A.peek().value,error:null}),Promise.resolve().then(()=>$()).then((g)=>{if(I!==S)return;A.set({status:"resolved",value:g,error:null})},(g)=>{if(I!==S)return;A.set({status:"rejected",value:A.peek().value,error:g instanceof Error?g:Error(String(g))})})}if(V)E();return{get:A.get,peek:A.peek,subscribe:A.subscribe,refresh:E,get size(){return A.size},_isSignal:!0,_subs:A._subs}}function z($,X,V){if(!Array.isArray($)||$.some((I)=>!I||!I._isSignal))throw Error("signal.derivedAsync: deps must be an array of signals");if(typeof X!=="function")throw Error("signal.derivedAsync: fn must be a function");let B=K(()=>Promise.resolve().then(()=>X(...$.map((I)=>I.peek()))),V),A=[],S=!1;for(let I of $){let g=I.subscribe(()=>{if(S)return;B.refresh()});A.push(g)}function E(){if(S)return;S=!0;for(let I of A)try{I()}catch{}A.length=0}return{get:B.get,peek:B.peek,subscribe:B.subscribe,refresh:B.refresh,dispose:E,get size(){return B.size},_isSignal:!0,_subs:B._subs}}function O($,X){if(typeof $!=="function")throw Error("signal.computed: fn must be a function");let V=X&&typeof X.eq==="function"?X.eq:Object.is,B=new Set,A=!0,S,E=[],I=!1;function g(){for(let x of E)try{x()}catch{}E=[]}function k(){if(I)return;if(!A)A=!0;g();let x=new Set,u=N;N=x;let v;try{v=$()}finally{N=u}let d=S;S=v,A=!1;for(let o of x)E.push(o.subscribe(k));if(!V(d,v))for(let o of[...B])try{o(v)}catch{}}function w(){g();let x=new Set,u=N;N=x;try{S=$()}finally{N=u}A=!1;for(let v of x)E.push(v.subscribe(k))}let f={get(){if(N!==null)N.add(f);if(A&&!I)w();return S},peek(){if(A&&!I){let x=N;N=null,w(),N=x}return S},subscribe(x){if(typeof x!=="function")return()=>{};return B.add(x),()=>B.delete(x)},dispose(){if(I)return;I=!0,g()},get size(){return B.size},_isSignal:!0,_subs:B,_graphId:"c"+ ++J};return Object.freeze(f)}function C($){let X=M;if(M=$,$==="sync"&&D!==null)H();return function(){if(M=X,X==="sync"&&D!==null)H()}}function q(){H()}function P(){return L(()=>{let $=[],X=[],V=[],B=new Set;for(let A of Z){X.push(Object.freeze({id:A.id,deps:A.deps.size}));for(let S of A.deps){if(!B.has(S))B.add(S),$.push(Object.freeze({id:S,kind:S[0]==="c"?"computed":"signal"}));V.push(Object.freeze({effect:A.id,signal:S}))}}return Object.freeze({signals:Object.freeze($),effects:Object.freeze(X),edges:Object.freeze(V)})})}return{create:G,derived:Y,batch:F,untrack:L,effect:W,resource:K,derivedAsync:z,computed:O,scheduleNotify:C,flushSync:q,inspectGraph:P}}};var g$={name:"valid",version:"1.0.0",type:"fw.io.utils",dependencies:[],factory(){let T={is(Q){return Object.prototype.toString.call(Q).slice(8,-1).toLowerCase()},isNumber(Q){return typeof Q==="number"&&Number.isFinite(Q)},isString(Q){return Object.prototype.toString.call(Q)==="[object String]"},isBoolean(Q){return Q===!0||Q===!1||Object.prototype.toString.call(Q)==="[object Boolean]"},isArray(Q){return Object.prototype.toString.call(Q)==="[object Array]"},isObject(Q){return Object.prototype.toString.call(Q)==="[object Object]"},isUint8Array(Q){return Object.prototype.toString.call(Q)==="[object Uint8Array]"},isUint8ClampedArray(Q){return Object.prototype.toString.call(Q)==="[object Uint8ClampedArray]"},isFunction(Q){return Object.prototype.toString.call(Q)==="[object Function]"}},j=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;function N(Q){if(typeof Q!=="string")return!1;if(Q.length===0||Q.length>254)return!1;let G=Q.lastIndexOf("@");if(G<1||G===Q.length-1)return!1;let Y=Q.slice(0,G),F=Q.slice(G+1);if(Y.length>64||F.length>255)return!1;if(Y.charCodeAt(0)===46)return!1;if(Y.charCodeAt(Y.length-1)===46)return!1;if(Y.indexOf("..")>=0)return!1;let L=F.lastIndexOf(".");if(L<0)return!1;if(F.length-L-1<2)return!1;return j.test(Q)}let M=new RegExp("^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:(:[0-9a-fA-F]{1,4}){1,6}|:(:[0-9a-fA-F]{1,4}){1,7}|::|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z.\\-_~]+|::(ffff(:0{1,4})?:)?((25[0-5]|(2[0-4]|1?[0-9])?[0-9])\\.){3}(25[0-5]|(2[0-4]|1?[0-9])?[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1?[0-9])?[0-9])\\.){3}(25[0-5]|(2[0-4]|1?[0-9])?[0-9]))$"),D={email:N,url:/^https?:\/\/[^\s/$.?#].[^\s]*$/i,uuid:/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,date:/^\d{4}-\d{2}-\d{2}$/,datetime:/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,ipv4:/^(25[0-5]|2[0-4]\d|[01]?\d\d?)(\.(25[0-5]|2[0-4]\d|[01]?\d\d?)){3}$/,ipv6:M,hex:/^[0-9a-f]+$/i,base64:/^[A-Za-z0-9+/]*={0,2}$/};function R(Q,G){if(Q===G)return!0;if(typeof Q!==typeof G)return!1;if(Q===null||G===null)return Q===G;if(Array.isArray(Q)){if(!Array.isArray(G)||Q.length!==G.length)return!1;for(let Y=0;Y<Q.length;Y++)if(!R(Q[Y],G[Y]))return!1;return!0}if(typeof Q==="object"){if(Array.isArray(G))return!1;let Y=Object.keys(Q),F=Object.keys(G);if(Y.length!==F.length)return!1;for(let L of Y)if(!R(Q[L],G[L]))return!1;return!0}return!1}function J(Q){if(Q===null)return"null";if(Array.isArray(Q))return"array";if(typeof Q==="number"){if(!Number.isFinite(Q))return"number";return Number.isInteger(Q)?"integer":"number"}if(typeof Q==="object")return"object";return typeof Q}function U(Q,G){let Y=J(Q);if(G==="number")return Y==="number"||Y==="integer";return Y===G}function Z(Q,G,Y,F){Q.push({path:G||"/",keyword:Y,message:F})}function H(Q,G,Y,F,L){if(G===!0)return;if(G===!1){Z(F,Y,"false","schema is false");return}if(!G||typeof G!=="object")return;if("const"in G){if(!R(Q,G.const))Z(F,Y,"const","must equal const")}if(Array.isArray(G.enum)){let K=!1;for(let z of G.enum)if(R(Q,z)){K=!0;break}if(!K)Z(F,Y,"enum","must be one of enum values")}if(G.type!==void 0){let K=Array.isArray(G.type)?G.type:[G.type],z=G.nullable?K.concat("null"):K,O=!1;for(let C of z)if(U(Q,C)){O=!0;break}if(!O){Z(F,Y,"type","must be "+z.join(" | "));return}}else if(G.nullable&&Q===null)return;let W=J(Q);if(W==="string"){if(typeof G.minLength==="number"&&Q.length<G.minLength)Z(F,Y,"minLength","string shorter than "+G.minLength);if(typeof G.maxLength==="number"&&Q.length>G.maxLength)Z(F,Y,"maxLength","string longer than "+G.maxLength);if(G.pattern!==void 0){if(!(G.pattern instanceof RegExp?G.pattern:new RegExp(G.pattern)).test(Q))Z(F,Y,"pattern","does not match pattern")}if(G.format){let K=L[G.format];if(K instanceof RegExp){if(!K.test(Q))Z(F,Y,"format","does not match format "+G.format)}else if(typeof K==="function"){if(!K(Q))Z(F,Y,"format","does not match format "+G.format)}}}if(W==="number"||W==="integer")if(!Number.isFinite(Q))Z(F,Y,"type","number must be finite");else{if(typeof G.minimum==="number"&&Q<G.minimum)Z(F,Y,"minimum","must be >= "+G.minimum);if(typeof G.maximum==="number"&&Q>G.maximum)Z(F,Y,"maximum","must be <= "+G.maximum);if(typeof G.exclusiveMinimum==="number"&&Q<=G.exclusiveMinimum)Z(F,Y,"exclusiveMinimum","must be > "+G.exclusiveMinimum);if(typeof G.exclusiveMaximum==="number"&&Q>=G.exclusiveMaximum)Z(F,Y,"exclusiveMaximum","must be < "+G.exclusiveMaximum);if(typeof G.multipleOf==="number"&&G.multipleOf>0){let K=Q/G.multipleOf;if(!Number.isFinite(K)||Math.abs(K-Math.round(K))>0.000000000001)Z(F,Y,"multipleOf","must be multiple of "+G.multipleOf)}}if(W==="array"){if(typeof G.minItems==="number"&&Q.length<G.minItems)Z(F,Y,"minItems","array shorter than "+G.minItems);if(typeof G.maxItems==="number"&&Q.length>G.maxItems)Z(F,Y,"maxItems","array longer than "+G.maxItems);if(G.uniqueItems){for(let K=0;K<Q.length;K++)for(let z=K+1;z<Q.length;z++)if(R(Q[K],Q[z])){Z(F,Y,"uniqueItems","duplicate items at ["+K+"] and ["+z+"]"),K=Q.length;break}}if(G.items)for(let K=0;K<Q.length;K++)H(Q[K],G.items,Y+"/"+K,F,L)}if(W==="object"){if(Array.isArray(G.required)){for(let C of G.required)if(!(C in Q))Z(F,Y+"/"+C,"required","missing required property")}let K=G.properties||null,z=G.patternProperties?Object.keys(G.patternProperties).map((C)=>({re:new RegExp(C),schema:G.patternProperties[C]})):null,O=G.additionalProperties;for(let C of Object.keys(Q)){let q=Y+"/"+C,P=!1;if(K&&C in K)H(Q[C],K[C],q,F,L),P=!0;if(z){for(let $ of z)if($.re.test(C))H(Q[C],$.schema,q,F,L),P=!0}if(!P){if(O===!1)Z(F,q,"additionalProperties","additional property not allowed");else if(O&&typeof O==="object")H(Q[C],O,q,F,L)}}}if(Array.isArray(G.allOf))for(let K of G.allOf)H(Q,K,Y,F,L);if(Array.isArray(G.anyOf)){let K=!1,z=[];for(let O of G.anyOf){let C=[];if(H(Q,O,Y,C,L),C.length===0){K=!0;break}z.push(C)}if(!K)Z(F,Y,"anyOf","did not match any schema in anyOf")}if(Array.isArray(G.oneOf)){let K=0;for(let z of G.oneOf){let O=[];if(H(Q,z,Y,O,L),O.length===0)K++;if(K>1)break}if(K!==1)Z(F,Y,"oneOf","must match exactly one schema in oneOf (matched "+K+")")}if(G.not!==void 0){let K=[];if(H(Q,G.not,Y,K,L),K.length===0)Z(F,Y,"not","must not match schema")}}return T.validate=function(Q,G,Y){let F=Y&&Y.formats?Object.assign({},D,Y.formats):D,L=[];return H(Q,G,"",L,F),{valid:L.length===0,errors:L}},T.test=function(Q,G,Y){return T.validate(Q,G,Y).valid},T.compile=function(Q,G){let Y=G&&G.formats?Object.assign({},D,G.formats):D;return{validate(F){let L=[];return H(F,Q,"",L,Y),{valid:L.length===0,errors:L}},test(F){let L=[];return H(F,Q,"",L,Y),L.length===0}}},T.formats=D,T}};var JZ={name:"ui8",version:"1.0.0",type:"fw.io.utils",dependencies:[],factory(){let T=function(R,J){let U=new Uint8Array(R.length+J.length);return U.set(R,0),U.set(J,R.length),U};function j(D,R){let J=new Uint8Array(D),U=0;for(let Z=0;Z<R.length;Z++)J.set(R[Z],U),U+=R[Z].length;return J}return{equal:function(R,J){if(R.length===J.length){for(let U=0;U<R.length;U++)if(R[U]!==J[U])return!1;return!0}else return!1},join:T,concat:function(R){let J=0;for(let U=0;U<R.length;U++)J+=R[U].length;return j(J,R)}}}};var x$={name:"abort",version:"1.0.0",type:"fw.io.sync",dependencies:[],factory(){function T(J){let U=typeof J==="string"?J:"The operation was aborted";if(typeof DOMException<"u")return new DOMException(U,"AbortError");let Z=Error(U);return Z.name="AbortError",Z}function j(J){if(typeof J!=="number"||isNaN(J)||J<=0)throw Error("abort: ms must be a positive number");let U=new AbortController,Z=setTimeout(()=>U.abort(T()),J);function H(Q){clearTimeout(Z),U.abort(Q!==void 0?Q:T())}return U.signal.addEventListener("abort",()=>clearTimeout(Z),{once:!0}),{signal:U.signal,controller:U,abort:H}}function N(...J){if(J.length===0)throw Error("abort: any() requires at least one signal");for(let Y of J)if(!(Y instanceof AbortSignal))throw Error("abort: any() arguments must be AbortSignal instances");if(typeof AbortSignal.any==="function")return AbortSignal.any(J);let U=J.find((Y)=>Y.aborted);if(U){let Y=new AbortController;return Y.abort(U.reason),Y.signal}let Z=new AbortController,H=[];function Q(Y){if(!Z.signal.aborted)Z.abort(Y.target.reason);G()}function G(){for(let[Y,F]of H)Y.removeEventListener("abort",F);H.length=0}for(let Y of J){let F=(L)=>Q(L);H.push([Y,F]),Y.addEventListener("abort",F,{once:!0})}return Z.signal}function M(J){if(!(J instanceof AbortSignal))throw Error("abort: wait() requires an AbortSignal");if(J.aborted)return Promise.reject(J.reason!==void 0?J.reason:T());return new Promise((U,Z)=>{J.addEventListener("abort",()=>{Z(J.reason!==void 0?J.reason:T())},{once:!0})})}function D(J,U){if(U===void 0||U===null)return J;if(!(U instanceof AbortSignal))throw Error("abort: race() second argument must be an AbortSignal or null/undefined");if(U.aborted)return Promise.reject(U.reason!==void 0?U.reason:T());return Promise.race([J,M(U)])}function R(J){if(J===void 0||J===null)return;if(J.aborted)throw J.reason!==void 0?J.reason:T()}return{timeout:j,any:N,wait:M,race:D,throwIfAborted:R,error:T}}};var f$={name:"clock",version:"1.0.0",type:"fw.io.timing",dependencies:[],factory(){let T=Date.now();function j(){return Date.now()}function N(){let J=Date.now();if(J<T)return T;return T=J,J}function M(J){return Math.max(0,N()-J)}function D(){return new Date().toISOString()}function R(J){let U=Number(J);if(!Number.isFinite(U))return String(J);let Z=Math.abs(U);if(Z<1)return U.toFixed(3)+" ms";if(Z<1000)return U.toFixed(1)+" ms";if(Z<60000)return(U/1000).toFixed(3)+" s";if(Z<3600000)return(U/60000).toFixed(2)+" min";return(U/3600000).toFixed(2)+" h"}return{now:j,monotonic:N,since:M,iso:D,format:R}}};var q$={name:"secPolicy",version:"1.0.0",type:"fw.dom.rendering",dependencies:[],factory(){let T=new Set(["href","src","action","formaction","srcset","xlink:href","data","codebase"]),j=/^(javascript|vbscript|file|jar|data:text|data:application)/,N=new Set(["http","https","mailto","tel","ftp"]),M=/^data:image\/(png|jpe?g|gif|webp|svg\+xml|bmp|ico|avif|apng);/;function D(z,O,C){if(typeof z!=="string")return!1;let q=z.replace(/[\x00-\x20\x7f]+/g,"").toLowerCase();if(q==="")return!0;if(q[0]==="#"||q[0]==="/"||q[0]==="?"||q[0]===".")return!0;if(j.test(q))return!1;if(q.startsWith("data:")){if(C===!1)return!1;return M.test(q)}let P=q.indexOf(":");if(P===-1)return!0;let $=q.indexOf("/");if($!==-1&&$<P)return!0;let X=Array.isArray(O)?O:N,V=q.slice(0,P);return X instanceof Set?X.has(V):X.includes(V)}let R=new Set(["id","name"]),J=new Set(["cookie","cookies","domain","location","write","writeln","open","close","body","head","title","URL","referrer","documentElement","documentURI","currentScript","designMode","forms","images","links","scripts","styleSheets","all","embeds","plugins","anchors","applets","parent","top","self","frames","frameElement","opener","elements","submit","reset","method","action"]);function U(z,O){return R.has(z)&&J.has(String(O))}let Z=/^on/i,H=/^[a-zA-Z]/;function Q(z){return typeof z==="string"&&Z.test(z)}function G(z){return typeof z==="string"&&H.test(z)&&!Z.test(z)}let Y=/^(script|object|embed|iframe)$/;function F(z){return typeof z==="string"&&Y.test(z)}let L=/expression\(|url\(['"]?(?:javascript|vbscript|data:text|data:application)/,W=new Set(["behavior","-ms-behavior"]);function K(z,O){if(typeof z==="string"&&W.has(z.toLowerCase()))return!1;if(O==null)return!0;let C=String(O).replace(/[\x00-\x20\x7f]+/g,"").toLowerCase();return!L.test(C)}return{URL_ATTRS:T,SCHEME_DANGEROUS_RE:j,SAFE_SCHEMES:N,DATA_IMAGE_RE:M,isSafeUrl:D,CLOBBER_ATTRS:R,CLOBBER_NAMES:J,isClobberValue:U,EVENT_ATTR_RE:Z,SAFE_ATTR_NAME_RE:H,isEventAttr:Q,isSafeAttrName:G,BLOCKED_TAGS_RE:Y,isBlockedTag:F,CSS_DANGEROUS_RE:L,CSS_BLOCKED_PROPS:W,isSafeCss:K}}};var H$={name:"dom",type:"fw.dom.query",dependencies:["secPolicy"],deps:[q$],factory(T){let j=function(D,R,J){if(!T.isSafeCss(R,J))return;D.style.setProperty(R,J)},N=function(D){if(Array.isArray(D)||D instanceof NodeList)return D;return[D]};return{queryAll(D,R){if((D instanceof HTMLElement||D instanceof SVGElement)&&typeof R==="string")return D.querySelectorAll(R);return[]},query(D,R){if((D instanceof HTMLElement||D instanceof SVGElement)&&typeof R==="string")return D.querySelector(R);return null},attr(D,R,J){let U=N(D);for(let Z=0;Z<U.length;Z++)U[Z].setAttribute(R,J)},attrGet(D,R){if(D instanceof Element)return D.getAttribute(R);return null},attrRemove(D,R){let J=N(D);for(let U=0;U<J.length;U++)J[U].removeAttribute(R)},attrHas(D,R){if(D instanceof Element)return D.hasAttribute(R);return!1},data(D,R,J){let U=N(D);for(let Z=0;Z<U.length;Z++)if("dataset"in U[Z])U[Z].dataset[R]=J},dataGet(D,R){if("dataset"in D)return D.dataset[R]??null;return null},dataRemove(D,R){let J=N(D);for(let U=0;U<J.length;U++)if("dataset"in J[U])delete J[U].dataset[R]},dataHas(D,R){if("dataset"in D)return R in D.dataset;return!1},classAdd(D,R){let J=R.trim().split(/\s+/),U=N(D);for(let Z=0;Z<U.length;Z++)U[Z].classList.add(...J)},classRemove(D,R){let J=R.trim().split(/\s+/),U=N(D);for(let Z=0;Z<U.length;Z++)U[Z].classList.remove(...J)},classHas(D,R){if(D instanceof Element)return D.classList.contains(R);return!1},classToggle(D,R){let J=N(D);for(let U=0;U<J.length;U++)J[U].classList.toggle(R)},classReplace(D,R,J){let U=N(D);for(let Z=0;Z<U.length;Z++)U[Z].classList.replace(R,J)},style(D,R,J){let U=N(D);for(let Z=0;Z<U.length;Z++)j(U[Z],R,J)},styleGet(D,R){if(D instanceof Element)return getComputedStyle(D).getPropertyValue(R);return null},styleGetAll(D){if(D instanceof Element)return getComputedStyle(D);return null},styleRemove(D,R){let J=N(D);for(let U=0;U<J.length;U++)J[U].style.removeProperty(R)},hide(D){let R=N(D);for(let J=0;J<R.length;J++)j(R[J],"display","none")},show(D,R){let J=R!==void 0?R:"",U=N(D);for(let Z=0;Z<U.length;Z++)if(J==="")U[Z].style.removeProperty("display");else j(U[Z],"display",J)},toggleVisibility(D){let R=N(D);for(let J=0;J<R.length;J++)if(R[J].style.display==="none")R[J].style.removeProperty("display");else j(R[J],"display","none")},rect(D){if(D instanceof Element)return D.getBoundingClientRect();return null},scrollPos(D){if(D instanceof Element)return{top:D.scrollTop,left:D.scrollLeft};return null},scrollTo(D,R,J){let U=N(D);for(let Z=0;Z<U.length;Z++){if(R!==void 0)U[Z].scrollTop=R;if(J!==void 0)U[Z].scrollLeft=J}},reorder(D,R){if(!(D instanceof Element))return;let J=D,U=typeof J.moveBefore==="function"?(H,Q)=>J.moveBefore(H,Q):(H,Q)=>D.insertBefore(H,Q),Z=D.firstChild;for(let H=0;H<R.length;H++){let Q=R[H];if(!(Q instanceof Element)||Q.parentNode!==D)continue;if(Q===Z){Z=Z.nextSibling;continue}U(Q,Z)}},fragment(D){let R=document.createDocumentFragment();if(D&&typeof D[Symbol.iterator]==="function"){for(let J of D)if(J instanceof Node)R.appendChild(J)}return R},bind(D,R,J,U,Z){if(!(R instanceof Element))throw Error("dom.bind: element must be an Element");if(typeof J!=="function"||typeof U!=="function")throw Error("dom.bind: getter and setter must be functions");let H=Z&&Z.event||"input",Q=!!(Z&&Z.checked),G=Q?()=>{let L=J();R.checked=!!L}:()=>{let L=J();R.value=L==null?"":String(L)};G();let Y=()=>{U(Q?R.checked:R.value)};R.addEventListener(H,Y);let F=!1;return{refresh:G,destroy(){if(F)return;F=!0,R.removeEventListener(H,Y)}}},focus(D){if(D instanceof Element)D.focus()},blur(D){if(D instanceof Element)D.blur()},text(D,R){let J=N(D);if(Array.isArray(R)){let Z=(H)=>{let Q=H.createDocumentFragment();for(let G of R){if(G==null)continue;let Y=String(G.text==null?"":G.text);if(G.lang){let F=H.createElement("span");if(F.setAttribute("lang",String(G.lang)),G.dir)F.setAttribute("dir",String(G.dir));F.textContent=Y,Q.appendChild(F)}else Q.appendChild(H.createTextNode(Y))}return Q};for(let H=0;H<J.length;H++){let Q=J[H];if(!(Q instanceof Element))continue;Q.textContent="",Q.appendChild(Z(Q.ownerDocument||document))}return}let U=R==null?"":String(R);for(let Z=0;Z<J.length;Z++)if(J[Z]instanceof Node)J[Z].textContent=U},textGet(D){if(D instanceof Node)return D.textContent;return null},val(D,R){let J=N(D);for(let U=0;U<J.length;U++)if("value"in J[U])J[U].value=R},valGet(D){if(D instanceof Element&&"value"in D)return D.value;return null},checked(D,R){let J=N(D);for(let U=0;U<J.length;U++)if("checked"in J[U])J[U].checked=!!R},checkedGet(D){if(D instanceof Element&&"checked"in D)return D.checked;return null},disabled(D,R){let J=N(D);for(let U=0;U<J.length;U++)if("disabled"in J[U])J[U].disabled=!!R},disabledGet(D){if(D instanceof Element&&"disabled"in D)return D.disabled;return null}}}};var V$={name:"events",type:"fw.dom.query",dependencies:[],factory(){let T={},j={};function N(Q,G,Y){return new CustomEvent(Q,{detail:G,bubbles:Y.bubbles??!0,cancelable:Y.cancelable??!1,composed:Y.composed??!1})}let M={};M.on=function(Q,G,Y,F,L=!1){if(T[Q])M.off(Q);G.addEventListener(Y,F,L),T[Q]={elm:G,type:Y,fn:F,options:L}},M.off=function(Q){let G=T[Q];if(G)G.elm.removeEventListener(G.type,G.fn,G.options),delete T[Q]},M.has=function(Q){return Object.prototype.hasOwnProperty.call(T,Q)},M.clear=function(){for(let Q of Object.keys(T))M.off(Q)},M.emit=function(Q,G,Y=null,F={}){Q.dispatchEvent(N(G,Y,F))},M.preset=function(Q,G,Y,F=null,L={}){j[Q]={elm:G,type:Y,detail:F,options:L}},M.dispatch=function(Q,G){let Y=j[Q];if(Y)Y.elm.dispatchEvent(N(Y.type,G!==void 0?G:Y.detail,Y.options))},M.unset=function(Q){delete j[Q]},M.delegate=function(Q,G,Y,F,L,W=!1){if(M.has(Q))M.off(Q);let K=function(z){let O=z.target;while(O&&O!==G){if(O.nodeType===1&&O.matches&&O.matches(F)){z.currentMatch=O,L.call(O,z);return}O=O.parentNode}};G.addEventListener(Y,K,W),T[Q]={elm:G,type:Y,fn:K,options:W}},M.scope=function(Q){let G=Q+":",Y=new Set;return{on(F,L,W,K,z){let O=G+F;return M.on(O,L,W,K,z),Y.add(O),O},delegate(F,L,W,K,z,O){let C=G+F;return M.delegate(C,L,W,K,z,O),Y.add(C),C},off(F){let L=G+F;M.off(L),Y.delete(L)},has(F){return M.has(G+F)},clear(){for(let F of[...Y])M.off(F);Y.clear()}}};let D=null,R=new WeakMap;function J(Q,G){if(!D)return;let Y=R.get(Q);if(!Y)Y=new Set,R.set(Q,Y);Y.add(G)}let{on:U,delegate:Z}=M;function H(Q){if(!Q)return;let G=R.get(Q);if(G){for(let F of G)M.off(F);R.delete(Q)}let Y=Q.childNodes;if(!Y)return;for(let F=0;F<Y.length;F++)H(Y[F])}return M.autoCleanup=function(Q){if(D)return M._disableAutoCleanup;let G=Q||(typeof document<"u"?document.body:null);if(!G)return()=>{};return D=new MutationObserver((Y)=>{for(let F of Y){let L=F.removedNodes;if(!L)continue;for(let W=0;W<L.length;W++)H(L[W])}}),D.observe(G,{childList:!0,subtree:!0}),M.on=function(Y,F,L,W,K){U.call(M,Y,F,L,W,K),J(F,Y)},M.delegate=function(Y,F,L,W,K,z){Z.call(M,Y,F,L,W,K,z),J(F,Y)},M._disableAutoCleanup=function(){if(!D)return;D.disconnect(),D=null,M.on=U,M.delegate=Z},M._disableAutoCleanup},M}};var h$={name:"easing",version:"1.0.0",type:"fw.io.calc",dependencies:[],factory(){let T={};return T.linear=function(j,N,M,D){return M*j/D+N},T.easeInQuad=function(j,N,M,D){return M*(j/=D)*j+N},T.easeOutQuad=function(j,N,M,D){return-M*(j/=D)*(j-2)+N},T.easeInOutQuad=function(j,N,M,D){if((j/=D/2)<1)return M/2*j*j+N;return-M/2*(--j*(j-2)-1)+N},T.easeInCubic=function(j,N,M,D){return M*(j/=D)*j*j+N},T.easeOutCubic=function(j,N,M,D){return M*((j=j/D-1)*j*j+1)+N},T.easeInOutCubic=function(j,N,M,D){if((j/=D/2)<1)return M/2*j*j*j+N;return M/2*((j-=2)*j*j+2)+N},T.easeInQuart=function(j,N,M,D){return M*(j/=D)*j*j*j+N},T.easeOutQuart=function(j,N,M,D){return-M*((j=j/D-1)*j*j*j-1)+N},T.easeInOutQuart=function(j,N,M,D){if((j/=D/2)<1)return M/2*j*j*j*j+N;return-M/2*((j-=2)*j*j*j-2)+N},T.easeInQuint=function(j,N,M,D){return M*(j/=D)*j*j*j*j+N},T.easeOutQuint=function(j,N,M,D){return M*((j=j/D-1)*j*j*j*j+1)+N},T.easeInOutQuint=function(j,N,M,D){if((j/=D/2)<1)return M/2*j*j*j*j*j+N;return M/2*((j-=2)*j*j*j*j+2)+N},T.easeInSine=function(j,N,M,D){return-M*Math.cos(j/D*(Math.PI/2))+M+N},T.easeOutSine=function(j,N,M,D){return M*Math.sin(j/D*(Math.PI/2))+N},T.easeInOutSine=function(j,N,M,D){return-M/2*(Math.cos(Math.PI*j/D)-1)+N},T.easeInExpo=function(j,N,M,D){return j===0?N:M*Math.pow(2,10*(j/D-1))+N},T.easeOutExpo=function(j,N,M,D){return j===D?N+M:M*(-Math.pow(2,-10*j/D)+1)+N},T.easeInOutExpo=function(j,N,M,D){if(j===0)return N;if(j===D)return N+M;if((j/=D/2)<1)return M/2*Math.pow(2,10*(j-1))+N;return M/2*(-Math.pow(2,-10*(j-1))+2)+N},T.easeInCirc=function(j,N,M,D){return-M*(Math.sqrt(1-(j/=D)*j)-1)+N},T.easeOutCirc=function(j,N,M,D){return M*Math.sqrt(1-(j=j/D-1)*j)+N},T.easeInOutCirc=function(j,N,M,D){if((j/=D/2)<1)return-M/2*(Math.sqrt(1-j*j)-1)+N;return M/2*(Math.sqrt(1-(j-=2)*j)+1)+N},T.easeInElastic=function(j,N,M,D){let R,J=0,U=M;if(j===0)return N;if((j/=D)===1)return N+M;if(!J)J=D*0.3;if(U<Math.abs(M))U=M,R=J/4;else R=J/(2*Math.PI)*Math.asin(M/U);return-(U*Math.pow(2,10*(j-=1))*Math.sin((j*D-R)*(2*Math.PI)/J))+N},T.easeOutElastic=function(j,N,M,D){let R,J=0,U=M;if(j===0)return N;if((j/=D)===1)return N+M;if(!J)J=D*0.3;if(U<Math.abs(M))U=M,R=J/4;else R=J/(2*Math.PI)*Math.asin(M/U);return U*Math.pow(2,-10*j)*Math.sin((j*D-R)*(2*Math.PI)/J)+M+N},T.easeInOutElastic=function(j,N,M,D){let R,J=0,U=M;if(j===0)return N;if((j/=D/2)===2)return N+M;if(!J)J=D*0.44999999999999996;if(U<Math.abs(M))U=M,R=J/4;else R=J/(2*Math.PI)*Math.asin(M/U);if(j<1)return-0.5*(U*Math.pow(2,10*(j-=1))*Math.sin((j*D-R)*(2*Math.PI)/J))+N;return U*Math.pow(2,-10*(j-=1))*Math.sin((j*D-R)*(2*Math.PI)/J)*0.5+M+N},T.easeInBack=function(j,N,M,D){return M*(j/=D)*j*(2.70158*j-1.70158)+N},T.easeOutBack=function(j,N,M,D){return M*((j=j/D-1)*j*(2.70158*j+1.70158)+1)+N},T.easeInOutBack=function(j,N,M,D){let R=1.70158;if((j/=D/2)<1)return M/2*(j*j*(((R*=1.525)+1)*j-R))+N;return M/2*((j-=2)*j*(((R*=1.525)+1)*j+R)+2)+N},T.easeInBounce=function(j,N,M,D){return M-T.easeOutBounce(D-j,0,M,D)+N},T.easeOutBounce=function(j,N,M,D){if((j/=D)<0.36363636363636365)return M*(7.5625*j*j)+N;else if(j<0.7272727272727273)return M*(7.5625*(j-=0.5454545454545454)*j+0.75)+N;else if(j<0.9090909090909091)return M*(7.5625*(j-=0.8181818181818182)*j+0.9375)+N;else return M*(7.5625*(j-=0.9545454545454546)*j+0.984375)+N},T.easeInOutBounce=function(j,N,M,D){if(j<D/2)return T.easeInBounce(j*2,0,M,D)*0.5+N;return T.easeOutBounce(j*2-D,0,M,D)*0.5+M*0.5+N},T}};var _$={name:"animate",type:"fw.dom.display",dependencies:["easing"],deps:[h$],factory(T){function j(N,M,D,R,J,U,Z,H){if(!H())return;let Q=Math.min(M-N,D);if(Q>0)U(R(Q,J.init,J.end-J.init,D),H);if(Q<D)requestAnimationFrame((G)=>j(N,G,D,R,J,U,Z,H));else if(Z!==null)Z()}return function(M,D,R,J,U=null,Z=()=>!0){if(typeof M!=="number"||!Number.isFinite(M)||M<=0)throw TypeError("animate: duration must be a finite positive number");if(typeof D!=="string"||typeof T[D]!=="function")throw TypeError(`animate: easingName '${D}' does not resolve to a function on the easing map`);if(R===null||typeof R!=="object"||typeof R.init!=="number"||!Number.isFinite(R.init)||typeof R.end!=="number"||!Number.isFinite(R.end))throw TypeError("animate: prop must be { init: number, end: number } with finite values");if(typeof J!=="function")throw TypeError("animate: progress must be a function");if(U!==null&&typeof U!=="function")throw TypeError("animate: onComplete must be a function or null");if(typeof Z!=="function")throw TypeError("animate: running must be a function");requestAnimationFrame((H)=>{j(H,H,M,T[D],R,J,U,Z)})}}};var QZ={name:"visibility",type:"fw.dom.lifecycle",dependencies:[],worker:!1,factory(){let T=new Set,j=null,N=null,M=null;function D(){if(j)return;j=(K)=>J(document.visibilityState,K),N=(K)=>J("hidden",K),M=(K)=>J(document.visibilityState||"visible",K),document.addEventListener("visibilitychange",j),document.addEventListener("pagehide",N),document.addEventListener("pageshow",M)}function R(){if(!j)return;document.removeEventListener("visibilitychange",j),document.removeEventListener("pagehide",N),document.removeEventListener("pageshow",M),j=N=M=null}function J(K,z){for(let O of T)O(K,z)}function U(K){T.add(K),D()}function Z(K){if(T.delete(K),T.size===0)R()}function H(){return typeof document<"u"&&"visibilityState"in document}function Q(){return document.visibilityState}function G(){return document.visibilityState==="visible"}function Y(){return document.visibilityState==="hidden"}function F(K,{immediate:z=!0}={}){if(U(K),z)K(document.visibilityState,null);return()=>Z(K)}function L(K){return F((O,C)=>{if(O==="visible")K(O,C)},{immediate:!0})}function W(K){return F((O,C)=>{if(O==="hidden")K(O,C)},{immediate:!1})}return{isSupported:H,state:Q,isVisible:G,isHidden:Y,onChange:F,onVisible:L,onHidden:W}}};var XZ={name:"a11y",version:"1.0.0",type:"fw.dom.utils",dependencies:[],factory(){let T=null,j=null;function N(Y){if(typeof document>"u"||!document.body)return null;let F=Y==="assertive"?j:T;if(F&&document.body.contains(F))return F;if(F&&!document.body.contains(F))if(Y==="assertive")j=null;else T=null;let L=document.createElement("div");if(L.setAttribute("aria-live",Y),L.setAttribute("aria-atomic","true"),L.setAttribute("role",Y==="assertive"?"alert":"status"),L.style.cssText="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0",L.setAttribute("data-fw-a11y",Y),document.body.appendChild(L),Y==="assertive")j=L;else T=L;return L}function M(Y,F){let L=N(F==="assertive"?"assertive":"polite");if(!L)return;L.textContent="",Promise.resolve().then(()=>{L.textContent=String(Y)})}function D(){if(T)T.textContent="";if(j)j.textContent=""}function R(Y,F){if(!Y||!F||typeof F!=="object")return;for(let L of Object.keys(F)){let W=F[L],K=L.startsWith("aria-")?L:"aria-"+L;if(W===null||W===!1||W===void 0)Y.removeAttribute(K);else Y.setAttribute(K,String(W))}}function J(Y){let F=Array.isArray(Y)?Y:[Y],L=[];for(let W of F){if(W==null)continue;if(typeof W==="string")L.push(W);else if(W&&W.id)L.push(W.id)}return L.join(" ")}function U(Y,F){if(!Y)return;let L=J(F);if(L)Y.setAttribute("aria-labelledby",L);else Y.removeAttribute("aria-labelledby")}function Z(Y,F){if(!Y)return;let L=J(F);if(L)Y.setAttribute("aria-describedby",L);else Y.removeAttribute("aria-describedby")}function H(Y,F){if(!Y)return;if(F==null||F===!1)Y.removeAttribute("role");else Y.setAttribute("role",String(F))}function Q(Y){if(Y)Y.removeAttribute("role")}function G(){if(typeof window>"u"||typeof window.matchMedia!=="function")return!1;try{return window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}return{announce:M,clearAnnouncements:D,aria:R,labelledBy:U,describedBy:Z,setRole:H,removeRole:Q,prefersReducedMotion:G}}};var GZ={name:"focus",version:"1.0.0",type:"fw.dom.utils",dependencies:["dom","events"],deps:[H$,V$],factory(T,j){let N=["a[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(",");function M(C){let q=C;while(q&&q!==document.body){if(q.hasAttribute&&q.hasAttribute("inert"))return!0;q=q.parentElement}return!1}function D(C){if(C.offsetParent!==null)return!0;let q=C.getBoundingClientRect();return q.width>0||q.height>0}function R(C){let q=C.getAttribute("tabindex");if(q===null)return 0;return parseInt(q,10)}function J(C){if(!C)return[];let P=Array.from(C.querySelectorAll(N)).filter((V)=>{if(R(V)<0)return!1;if(V.disabled)return!1;if(M(V))return!1;if(!D(V))return!1;return!0}),$=P.filter((V)=>{let B=V.getAttribute("tabindex");return B!==null&&parseInt(B,10)>0}).sort((V,B)=>parseInt(V.getAttribute("tabindex"),10)-parseInt(B.getAttribute("tabindex"),10)),X=P.filter((V)=>{let B=V.getAttribute("tabindex");return B===null||parseInt(B,10)===0});return[...$,...X]}function U(C){let q=C||document.body,P=J(q);if(!P.length)return;let $=P.indexOf(document.activeElement);P[($+1)%P.length].focus()}function Z(C){let q=C||document.body,P=J(q);if(!P.length)return;let $=P.indexOf(document.activeElement);P[($-1+P.length)%P.length].focus()}function H(){let C=document.activeElement;return{restore(){if(C&&typeof C.focus==="function")C.focus()}}}let Q=[];function G(C){if(Q.push(document.activeElement),C){let q=typeof C==="string"?document.querySelector(C):C;if(q&&typeof q.focus==="function")q.focus()}return Q.length}function Y(){if(!Q.length)return null;let C=Q.pop();if(C&&typeof C.focus==="function")C.focus();return C||null}function F(){return Q.length}function L(){Q.length=0}function W(C,q){G(q);try{let P=C();if(P&&typeof P.then==="function")return P.finally(()=>Y());return Y(),P}catch(P){throw Y(),P}}function K(){return document.activeElement}function z(C){let q=document.activeElement,P=()=>{let $=document.activeElement;if($!==q)C($,q),q=$};return document.addEventListener("focusin",P),function(){document.removeEventListener("focusin",P)}}function O(C,q={}){let{initialFocus:P=null,returnFocus:$=!0,escapeDeactivates:X=!1,allowOutsideClick:V=!1}=q,B=!1,A=!1,S=null;function E(){if(!P)return J(C)[0]||null;if(typeof P==="string")return C.querySelector(P);return P}function I(w){if(!B||A)return;let f=J(C);if(!f.length){w.preventDefault();return}if(w.key==="Tab"){w.preventDefault();let x=f.indexOf(document.activeElement);if(w.shiftKey)f[(x-1+f.length)%f.length].focus();else f[(x+1)%f.length].focus()}else if(w.key==="Escape"&&X)k.deactivate()}function g(w){if(!B||A)return;if(!C.contains(w.target)){let f=J(C);if(f.length)f[0].focus()}}let k={get paused(){return A},activate(){if(B)return;if(B=!0,$)S=H();C.addEventListener("keydown",I),document.addEventListener("focusin",g);let w=E();if(w)w.focus()},deactivate(){if(!B)return;if(B=!1,C.removeEventListener("keydown",I),document.removeEventListener("focusin",g),$&&S)S.restore(),S=null},pause(){A=!0},resume(){A=!1}};return k}return{trap:O,tabOrder:J,next:U,previous:Z,stash:H,current:K,onChange:z,pushFocus:G,popFocus:Y,focusStackDepth:F,clearFocusStack:L,restoreFocus:W}}};var YZ={name:"route",version:"1.1.0",type:"fw.dom.utils",dependencies:["events"],deps:[V$],factory(T){let j=[],N=!1;function M(K){let z=[],O=K.replace(/[.+^${}()|[\]\\]/g,"\\$&");if(O=O.replace(/\*([A-Za-z_]\w*)/g,(C,q)=>{return z.push({name:q,tail:!0}),"(.*)"}),O=O.replace(/:([A-Za-z_]\w*)/g,(C,q)=>{return z.push({name:q,tail:!1}),"([^/]+)"}),O!=="/"&&O!=="\\/")O=O.replace(/\/+$/,"")+"\\/?";return{regex:new RegExp("^"+O+"$"),paramNames:z}}function D(K,z){let O=K.pattern.replace(/\/+$/,""),C=z.startsWith("/")?z:"/"+z;return O+C}function R(K){let z=[K],O=K.parent?J(K.parent):null;while(O)z.unshift(O),O=O.parent?J(O.parent):null;return z}function J(K){for(let z of j)if(z.name===K)return z;return null}function U(K){let z=new Set,O=!0;while(O){O=!1;for(let C of j){if(z.has(C.name))continue;if(C.parent===K||z.has(C.parent))z.add(C.name),O=!0}}for(let C of j)if(z.has(C.name))C.chain=R(C)}function Z(K){let z=(K||"").replace(/^#/,""),O=z.startsWith("/")?z:"/"+z,C=O.indexOf("?"),q=C===-1?O:O.slice(0,C),P=C===-1?"":O.slice(C+1),$={};if(P)for(let X of P.split("&")){if(!X)continue;let V=X.indexOf("="),B=decodeURIComponent(V===-1?X:X.slice(0,V)),A=decodeURIComponent(V===-1?"":X.slice(V+1));$[B]=A}return{path:q||"/",query:$}}function H(K,z){let O="#"+(K.startsWith("/")?K:"/"+K);if(z&&typeof z==="object"){let C=Object.entries(z).filter(([,q])=>q!=null);if(C.length)O+="?"+C.map(([q,P])=>encodeURIComponent(q)+"="+encodeURIComponent(String(P))).join("&")}return O}let Q=!1,G=null;function Y(K){if(K&&typeof K.then==="function")return K.then((z)=>z!==!1);return K!==!1}function F(K){Q=!0;try{if(location.hash!==K)location.hash=K}finally{Q=!1}}async function L(){if(Q)return;Q=!0;let K=location.hash;try{let{path:z,query:O}=Z(K),C=[];for(let X of j){let V=X.regex.exec(z);if(!V)continue;let B={};for(let A=0;A<X.paramNames.length;++A)B[X.paramNames[A].name]=V[A+1];C.push({entry:X,params:B})}if(C.length===0){G=null;return}let q=C[0],P={path:z,hash:K,name:q.entry.name};if(G&&G.name!==q.entry.name){let X=J(G.name);if(X&&typeof X.beforeLeave==="function"){if(!await Y(X.beforeLeave(G.params,G.query,G.info))){F(G.hash);return}}}let $=q.entry.chain||[q.entry];for(let X of $)if(typeof X.beforeEnter==="function"){if(!await Y(X.beforeEnter(q.params,O,P))){if(G)F(G.hash);return}}for(let X of $)try{X.fn(q.params,O,{...P,name:X.name})}catch(V){try{console.error("route: handler threw",V)}catch{}}for(let X=1;X<C.length;++X){let V=C[X];try{V.entry.fn(V.params,O,{...P,name:V.entry.name})}catch(B){try{console.error("route: handler threw",B)}catch{}}}G={name:q.entry.name,params:q.params,query:O,info:P,hash:K}}finally{Q=!1}}return{on(K,z,O,C={}){if(typeof K!=="string"||!K)throw Error("route.on: name must be a non-empty string");if(typeof z!=="string")throw Error("route.on: pattern must be a string");if(typeof O!=="function")throw Error("route.on: fn must be a function");let q=(()=>{for(let B=j.length-1;B>=0;--B)if(j[B].name===K)return j.splice(B,1),!0;return!1})(),P=z;if(C.parent){let B=J(C.parent);if(!B)throw Error(`route.on: parent '${C.parent}' not found (define parent routes before children)`);P=D(B,z)}let{regex:$,paramNames:X}=M(P),V={name:K,pattern:P,regex:$,paramNames:X,fn:O,parent:C.parent||null,beforeEnter:typeof C.beforeEnter==="function"?C.beforeEnter:null,beforeLeave:typeof C.beforeLeave==="function"?C.beforeLeave:null};if(V.chain=R(V),j.push(V),q)U(K)},off(K){for(let z=j.length-1;z>=0;--z)if(j[z].name===K){j.splice(z,1);break}},go(K,z){let O=H(K,z);if(location.hash!==O)location.hash=O;return L().then(()=>G!==null&&G.hash===O)},replace(K,z){let O=H(K,z),C=location.href.split("#")[0];location.replace(C+O)},current(){let{path:K,query:z}=Z(location.hash);return{path:K,query:z,hash:location.hash}},active(){if(!G)return null;return{name:G.name,params:{...G.params},query:{...G.query},info:{...G.info},hash:G.hash}},refresh(){return L()},start(){if(N)return;N=!0,T.on("fw:route:hashchange",window,"hashchange",L),L()},dispose(){if(N)T.off("fw:route:hashchange"),N=!1;j.length=0,G=null},get size(){return j.length}}}};var N$={name:"render",type:"fw.dom.rendering",dependencies:["secPolicy"],deps:[q$],factory(T){let j=function($,X,V){let A=X!=null&&Object.prototype.hasOwnProperty.call(X,$.name)?X[$.name]:$.default,S;if(A===void 0)S=V;else if($.append)S=(V??"")+A;else if($.prepend)S=A+(V??"");else S=A;if($.tail!=null)S=(S??"")+$.tail;return S},N=function($,X){let V={data:$.data?{...$.data}:{}};if($.text!=null)V.text=$.text;if($.map&&$.map.length>0)for(let B of $.map)if(B.data)V.data[B.prop]=j(B,X,V.data[B.prop]);else V[B.prop]=j(B,X,V[B.prop]);return V},M=function($){return $.map(function(X){return{...X,data:X.data?{...X.data}:X.data,map:X.map?X.map.map(function(V){return{...V}}):X.map}})},D=function($,X,V=!1){let B=M($);return B.forEach(function(A){if(V!==!1){if(!Object.prototype.hasOwnProperty.call(A,"parent"))A.parent=V}if(A.map&&A.map.length>0)A.map.forEach(function(S){let E=Object.prototype.hasOwnProperty.call(X,S.name)?X[S.name]:S.default;if(E!==void 0)if(S.data)if(S.append)A.data[S.prop]+=E;else if(S.prepend)A.data[S.prop]=E+A.data[S.prop];else A.data[S.prop]=E;else if(S.append)A[S.prop]=A[S.prop]+E;else if(S.prepend)A[S.prop]=E+A[S.prop];else A[S.prop]=E;if(S.tail!=null)if(S.data)A.data[S.prop]=(A.data[S.prop]??"")+S.tail;else A[S.prop]=(A[S.prop]??"")+S.tail})}),B};function R(){let $=typeof globalThis<"u"?globalThis:{};if($.crypto&&typeof $.crypto.getRandomValues==="function"){let X=new Uint32Array(1);return $.crypto.getRandomValues(X),X[0]}return Math.random()*4294967295>>>0}let J=function($){let X=M($),V=new Map,B=new Map;return X.forEach(function(A,S){if(V.set(A.id,Date.now().toString(36)+S.toString()+R().toString(36)),A.id=V.get(A.id),Object.prototype.hasOwnProperty.call(A,"parent")&&V.has(A.parent))A.parent=V.get(A.parent);if(A.content)B.set(A.content,A.id)}),{arr:X,map:V,content:B}},U=function($,X={},V=!1){return J(D($,X,V))},Z=function($,X=[],V=!1){let B=[];return X.forEach(function(A){B.push(J(D($,A,V)))}),B},H=function($,X,V){let B=X||new Map,A=V||new Map,S=[];return $.forEach(function(E){let I=!1,g=!0;if(E.attach&&B.has(E.attach.elm))if(B.get(E.attach.elm).content.has(E.attach.name))I=B.get(E.attach.elm).content.get(E.attach.name);else g=!1;if(g)if(Array.isArray(E.data)){let k=Z(E.template,E.data,I);if(Object.prototype.hasOwnProperty.call(E,"id"))A.set(E.id,[]),k.forEach(function(w){S.push(...w.arr),A.get(E.id).push(w.map)});else k.forEach(function(w){S.push(...w.arr)})}else{let k=U(E.template,E.data,I);if(Object.prototype.hasOwnProperty.call(E,"id")){if(A.set(E.id,k.map),k.content.size>0)B.set(E.id,{content:k.content})}S.push(...k.arr)}else if(Object.prototype.hasOwnProperty.call(E,"id"))A.set(E.id,!1)}),{arr:S,map:A,attach:B}},Q=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),G=T.URL_ATTRS,Y=T.CLOBBER_NAMES,F=T.CLOBBER_ATTRS,L=T.SAFE_ATTR_NAME_RE,W=T.EVENT_ATTR_RE,K=($)=>T.isSafeUrl($);function z($){return String($).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function O($){if($==="text")return"span";if($.startsWith("svg_"))return $.slice(4);return $}function C($){let X=new Map,V=new Map,B=[];for(let A of $)X.set(A.id,A);for(let A of $)if(A.parent!=null){if(!V.has(A.parent))V.set(A.parent,[]);V.get(A.parent).push(A)}else B.push(A);return{byId:X,kids:V,roots:B}}function q($,X,V){let B=O($.tag),A=Q.has(B),S=[];if($.attrs)for(let g of $.attrs){if(W.test(g)||!L.test(g))continue;let k=$.data?.[g];if(k===null||k===!1||k===void 0)continue;if(G.has(g)&&!K(String(k)))continue;if(F.has(g)&&Y.has(String(k)))continue;if(k==="")S.push(" "+g);else S.push(" "+g+'="'+z(k)+'"')}if(V.hydrate&&$.id){let g=V.idPrefix?V.idPrefix+":"+$.id:$.id;S.push(' data-fw-id="'+z(g)+'"')}let E="<"+B+S.join("");if(A)return E+" />";let I="";if($.text!=null)I=z($.text);else if($.content!=null){let g=$.content;if(V.iterates&&V.iterates[g]!=null){let k=V.iteratesTemplates?.[g];if(k){let w=V.iterates[g],f=[];for(let x=0;x<w.length;++x){let u=w[x],v=D(k,u),d=C(v);for(let o of d.roots)f.push(q(o,d.kids,V))}I=f.join("")}}else if(V.slots&&V.slots[g]!=null){let k=V.slots[g];I=typeof k==="function"?String(k()):String(k)}}else{let g=X.get($.id);if(g&&g.length){let k=[];for(let w of g)k.push(q(w,X,V));I=k.join("")}}return E+">"+I+"</"+B+">"}return{elms:D,rewrite:J,parts:U,loop:Z,full:H,computeBoundValue:j,applyParsedElm:N,toHTML:function($,X,V){let B=Array.isArray($),A=B?$:$.template||[],S=B?null:$.iterates,E={hydrate:!0,idPrefix:"",slots:{},iterates:{},...V,iteratesTemplates:S||{}},I=D(A,X||{}),g=C(I),k=[];for(let w of g.roots)k.push(q(w,g.kids,E));return k.join("")}}}};var y$={name:"parser",version:"1.0.0",type:"fw.dom.rendering",dependencies:["secPolicy"],deps:[q$],factory(T){let N={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "};function M(h){if(h.indexOf("&")===-1)return h;return h.replace(/&(#x?[0-9a-fA-F]+|[a-zA-Z]+);/g,(m,b)=>{if(b[0]==="#"){let p=b[1]==="x"||b[1]==="X"?parseInt(b.slice(2),16):parseInt(b.slice(1),10);if(Number.isFinite(p)&&p>=0&&p<=1114111)try{return String.fromCodePoint(p)}catch{return m}return m}return N[b.toLowerCase()]??m})}function D(h,m){return{nodeType:Q,tagName:h.toUpperCase(),namespaceURI:m||null,attributes:[],childNodes:[],_attrMap:null,getAttribute(p){if(!this._attrMap){this._attrMap=Object.create(null);for(let i of this.attributes)this._attrMap[i.name]=i.value}return this._attrMap[p]??null}}}function R(h){return{nodeType:G,nodeValue:h}}function J(h){return{nodeType:Y,nodeValue:h}}function U(h,m){let b=h.length,p=m+1,i=p;while(p<b){let $$=h.charCodeAt(p);if($$>=48&&$$<=57||$$>=65&&$$<=90||$$>=97&&$$<=122||$$===45||$$===95)p++;else break}if(p===i)return null;let e=h.slice(i,p).toLowerCase(),J$=[],Q$=!1;while(p<b){while(p<b&&/\s/.test(h[p]))p++;if(p>=b)return null;let $$=h[p];if($$===">"){p++;break}if($$==="/"&&h[p+1]===">"){Q$=!0,p+=2;break}let X$=p;while(p<b&&!/[\s=/>]/.test(h[p]))p++;let n=h.slice(X$,p).toLowerCase();if(!n){p++;continue}while(p<b&&/\s/.test(h[p]))p++;let a="";if(h[p]==="="){p++;while(p<b&&/\s/.test(h[p]))p++;let s=h[p];if(s==='"'||s==="'"){let t=++p;while(p<b&&h[p]!==s)p++;if(a=M(h.slice(t,p)),h[p]===s)p++}else{let t=p;while(p<b&&!/[\s>]/.test(h[p]))p++;a=M(h.slice(t,p))}}J$.push({name:n,value:a})}return{tag:e,attrs:J$,selfClose:Q$,end:p}}let Z="http://www.w3.org/2000/svg",H=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Q=1,G=3,Y=8,F={text:"span"},L=T.BLOCKED_TAGS_RE,W=/^\s*\$\{([^}]+)\}\s*$/,K=/(#\{[^}]+\})/,z=/^#\{([^}]+)\}$/,O=/^\s*\$([a-zA-Z_]\w*)\s*$/,C=/^\s*([a-zA-Z_]\w*)\$\s*$/,q=T.SAFE_ATTR_NAME_RE,P=T.EVENT_ATTR_RE;function $(h){let m=D("root"),b=[{el:m,ns:null}],p=0,i=h.length;while(p<i){let e=b[b.length-1];if(h[p]==="<"){if(h.startsWith("<!--",p)){let r=h.indexOf("-->",p+4);if(r===-1)break;e.el.childNodes.push(J(h.slice(p+4,r))),p=r+3;continue}if(h.charCodeAt(p+1)===33||h.charCodeAt(p+1)===63){let r=h.indexOf(">",p);if(r===-1)break;p=r+1;continue}if(h[p+1]==="/"){let r=h.indexOf(">",p);if(r===-1)break;let G$=h.slice(p+2,r).trim().toLowerCase();for(let K$=b.length-1;K$>0;--K$)if(b[K$].el.tagName.toLowerCase()===G$){b.length=K$;break}p=r+1;continue}let n=U(h,p);if(!n){p++;continue}let a=e.ns,s=n.tag==="svg"?Z:a,t=D(n.tag,s);for(let r of n.attrs)t.attributes.push(r);if(e.el.childNodes.push(t),!(H.has(n.tag)||n.selfClose))b.push({el:t,ns:s});p=n.end;continue}let Q$=h.indexOf("<",p),$$=Q$===-1?i:Q$,X$=h.slice(p,$$);if(X$)e.el.childNodes.push(R(M(X$)));p=$$}return m}let X=0,V=new Set;function B(h,m){if(!h)return;for(let b of h){if(typeof b!=="string")continue;let p=b.trim();if(!p)continue;if(V.add(p),m)m.add(p)}}let A=(h)=>{let m="p"+X++;while(h&&h.has(m)||V.has(m))m="p"+X++;return m};function S(h,m){let b=m||new Set,p=h.childNodes;if(!p)return b;for(let i of p){if(i.nodeType!==Q)continue;let e=i.getAttribute?i.getAttribute("id"):null;if(e&&e.trim())b.add(e.trim());S(i,b)}return b}function E(h){let m=h.tagName.toLowerCase();if(h.namespaceURI===Z&&m!=="svg")return"svg_"+m;return m}function I(h){if(F[h])return F[h];if(h.startsWith("svg_"))return h.slice(4);return h}function g(h,m,b){let p=h.split(K);if(p.length===1)return{val:h,maps:[]};let i=[];p.forEach((Q$,$$)=>{let X$=Q$.match(z);if(X$)i.push({name:X$[1],idx:$$})});let e=[];if(i.length===1){let Q$=i[0],$$=p.slice(0,Q$.idx).join(""),X$=p.slice(Q$.idx+1).join(""),n={name:Q$.name,prop:m};if(b)n.data=!0;if($$&&!X$)n.append=!0;else if(!$$&&X$)n.prepend=!0;else if($$&&X$)n.append=!0,n.tail=X$;return e.push(n),{val:n.prepend?X$:$$,maps:e}}let J$=p.slice(0,i[0].idx).join("");return i.forEach((Q$,$$)=>{let X$=$$+1<i.length?i[$$+1].idx:p.length,n=p.slice(Q$.idx+1,X$).join(""),a={name:Q$.name,prop:m,append:!0};if(b)a.data=!0;if(n)a.tail=n;e.push(a)}),{val:J$,maps:e}}function k(h,m,b,p){let i=(m||[]).filter((J$)=>J$.prop===b&&!!J$.data===p);if(i.length===0)return h??"";if(i.length===1){let J$=i[0],Q$=`#{${J$.name}}`;if(J$.append)return(h||"")+Q$+(J$.tail||"");if(J$.prepend)return Q$+(h||"");return Q$}let e=h||"";return i.forEach((J$)=>{e+=`#{${J$.name}}`+(J$.tail||"")}),e}function w(h){let m=new Map,b=new Map,p=[];return h.forEach((i)=>{m.set(i.id,i),b.set(i.id,[])}),h.forEach((i)=>{if(i.parent&&m.has(i.parent))b.get(i.parent).push(i.id);else p.push(i.id)}),{byId:m,kids:b,roots:p}}function f(h,m,b,p){let i=m.byId.get(h);if(!i)return"";if(i.tag==="text")return k(i.text??"",i.map||[],"text",!1);let e=I(i.tag),J$=i.map||[],Q$=p||"",$$=Q$+" ",X$=$$+" ",n=`id="${i.id}"`;if(i.attrs)i.attrs.forEach((s)=>{let t=i.data?.[s]??"";n+=` ${s}="${k(t,J$,s,!0)}"`});if(H.has(e))return`${Q$}<${e} ${n}>`;let a="";if(i.content){let s=b&&b[i.content];if(s){let t=w(s),Z$=t.roots.map((r)=>f(r,t,b,X$)).join(`
27
- `);a=`
28
- ${$$}<!-- $${i.content} -->
29
- `+Z$+`
30
- ${$$}<!-- ${i.content}$ -->
31
- ${Q$}`}else a=`\${${i.content}}`}else if(Object.prototype.hasOwnProperty.call(i,"text")||J$.some((s)=>s.prop==="text"&&!s.data))a=k(i.text??"",J$,"text",!1);else{let s=m.kids.get(h)||[];if(s.length>0)if(s.some((Z$)=>{let r=m.byId.get(Z$);return r&&r.tag==="text"}))a=s.map((Z$)=>f(Z$,m,b,"")).join("");else a=`
32
- `+s.map((Z$)=>f(Z$,m,b,$$)).join(`
26
+ ${M}
27
+
28
+ (${G.toString()})( runtime.context );
29
+ `,B=URL.createObjectURL(new Blob([z],{type:"text/javascript"})),I;try{I=C.lockdownUrl?new Worker(B,{type:"module"}):new Worker(B)}catch(x){throw URL.revokeObjectURL(B),x}let A=L();I.addEventListener("message",A);let w=I.terminate.bind(I),k=!1,g=function(){if(k)return!1;return k=!0,I.removeEventListener("message",A),URL.revokeObjectURL(B),W.terminate(),!0};return I.terminate=function(){g(),w()},I}}function HZ(){let E={status:!1,interactive:!1,complete:!1,queue:{interactive:[],complete:[]}},S=function($,V){try{$.apply({},V)}catch(X){}},T=function($){for(let V=0;V<$.length;V++)S($[V][0],$[V][1])},N=function(){if(E.status==="interactive")E.interactive=!0;else if(E.status==="complete")E.interactive=!0,E.complete=!0},R=function(){if(E.interactive&&E.queue.interactive.length>0)T(E.queue.interactive.splice(0));if(E.complete&&E.queue.complete.length>0)T(E.queue.complete.splice(0))},j=function(){if(E.status!==!1)return;if(E.status=document.readyState,N(),E.status==="complete")return;document.addEventListener("readystatechange",function(){E.status=document.readyState,N(),R()})};return{loaded:function($,V=[]){if(typeof $!=="function")return;if(j(),E.interactive)S($,V);else E.queue.interactive.push([$,V])},complete:function($,V=[]){if(typeof $!=="function")return;if(j(),E.complete)S($,V);else E.queue.complete.push([$,V])}}}var VZ={name:"errors",version:"1.0.0",type:"fw.io.utils",dependencies:[],factory(){let E={debug:10,info:20,warn:30,error:40,silent:99};function S(R={}){let j=R.prefix||"",Z=R.level&&E[R.level]!==void 0?R.level:"info",q=E[Z],$=typeof R.sink==="function"?R.sink:null;function V(H,Q,L){if(E[H]<q)return;let Y={level:H,prefix:j,time:Date.now(),message:typeof Q==="string"?Q:String(Q),context:L&&typeof L==="object"?L:{}};if($){try{$(Y)}catch{}return}let G=j?`[${j}]`:"",J=L!==void 0?[G,Y.message,Y.context]:[G,Y.message],U=typeof console<"u"&&console[H]||typeof console<"u"&&console.log;if(U)try{U.apply(console,J)}catch{}}return{debug(H,Q){V("debug",H,Q)},info(H,Q){V("info",H,Q)},warn(H,Q){V("warn",H,Q)},error(H,Q){V("error",H,Q)},child(H){let Q=j?`${j}:${H}`:H;return S({level:Z,prefix:Q,sink:$})},set level(H){if(E[H]!==void 0)Z=H,q=E[H]},get level(){return Z}}}function T(R={}){let j=typeof R.onError==="function"?R.onError:null,Z=!!R.rethrow;return function($,V){if(typeof $!=="function")throw Error("errors.guard: fn must be a function");let X;try{X=$()}catch(H){if(j)try{j(H,V)}catch{}if(Z)throw H;return}if(X&&typeof X.then==="function")return X.catch((H)=>{if(j)try{j(H,V)}catch{}if(Z)throw H;return});return X}}function N(R,j,Z={}){if(!R||typeof R.text!=="function")throw Error("errors.boundary: ui (UISession) is required");if(typeof j!=="string")throw Error("errors.boundary: blockId must be a string");let q=typeof Z.onError==="function"?Z.onError:null,$=typeof Z.render==="function"?Z.render:null,V=typeof Z.fallback==="string"?Z.fallback:null,X=!!Z.clear;function H(Q){if(q)try{q(Q)}catch{}try{if($)$(Q,R,j);else if(V!=null){if(R.get(j))R.text(j,V)}if(X)R.clear(j)}catch{}}return function(L){if(typeof L!=="function")throw Error("errors.boundary: fn must be a function");let Y;try{Y=L()}catch(G){H(G);return}if(Y&&typeof Y.then==="function")return Y.catch((G)=>{H(G);return});return Y}}return{logger:S,guard:T,boundary:N}}};var v$={name:"eventBus",version:"1.0.0",type:"fw.io.utils",dependencies:[],factory(){function E(N,R=!0){if(typeof N!=="string"||N.length===0)throw TypeError("eventBus: topic must be a non-empty string");if(N==="*")throw Error('eventBus: global wildcard "*" is not allowed; use a namespaced pattern like "ns:*"');let j=(N.match(/\*/g)||[]).length;if(j>0){if(!R)throw Error("eventBus: wildcards not allowed in emit/set/clear topic: "+N);if(j>1||!N.endsWith(":*"))throw Error('eventBus: invalid wildcard pattern "'+N+'"; only "prefix:*" is allowed')}}function S(N,R){if(N===R)return!0;if(N.endsWith(":*")){let j=N.slice(0,-1);return R.startsWith(j)&&R.length>j.length}return!1}function T(){let N=new Map,R=new Map,j=new Map;function Z(J){if(!N.has(J))N.set(J,new Set);return N.get(J)}function q(J){if(!R.has(J))R.set(J,new Set);return R.get(J)}function $(J,U,W){if(E(J,!0),typeof U!=="function")throw TypeError("eventBus: listener must be a function");let C;if(J.endsWith(":*"))q(J).add(U),C=()=>V(J,U);else Z(J).add(U),C=()=>V(J,U);if(W&&W.replay===!0&&j.has(J))try{U(j.get(J))}catch(P){console.error("eventBus sticky replay error:",P)}return C}function V(J,U){if(E(J,!0),J.endsWith(":*")){let W=R.get(J);if(W){if(W.delete(U),W.size===0)R.delete(J)}}else{let W=N.get(J);if(W){if(W.delete(U),W.size===0)N.delete(J)}}}function X(J,U){E(J,!1);let W=N.get(J);if(W&&W.size>0)for(let C of[...W])try{C(U)}catch(P){console.error("eventBus handler error:",P)}for(let[C,P]of R)if(S(C,J))for(let D of[...P])try{D(U)}catch(F){console.error("eventBus handler error:",F)}}function H(J,U){if(E(J,!0),typeof U!=="function")throw TypeError("eventBus: listener must be a function");let W=$(J,U);if(j.has(J))try{U(j.get(J))}catch(C){console.error("eventBus sticky replay error:",C)}return W}function Q(J,U){E(J,!1),j.set(J,U),X(J,U)}function L(J){if(J===void 0)j.clear();else E(J,!1),j.delete(J)}function Y(){let J=[];function U(P,D){let F=$(P,D);return J.push(F),F}function W(P,D){let F=H(P,D);return J.push(F),F}function C(){for(let P of J)try{P()}catch(D){console.error("eventBus scope dispose error:",D)}J.length=0}return{on:U,sticky:W,dispose:C}}function G(){let J=new Set;for(let[U,W]of N)if(W.size>0)J.add(U);for(let[U,W]of R)if(W.size>0)J.add(U);for(let U of j.keys())J.add(U);return[...J]}return{on:$,off:V,emit:X,sticky:H,set:Q,clear:L,scope:Y,topics:G}}return{create:T}}};var h$={name:"signal",version:"1.2.0",type:"fw.io.utils",dependencies:[],factory(){let E=0,S=null,T=null,N="sync",R=null,j=!1,Z=0,q=0,$=new Set;function V(){j=!1;let F=R;if(R=null,!F)return;for(let[K,O]of F)for(let M of[...K._subs])try{M(O)}catch{}}function X(){if(N==="raf"&&typeof requestAnimationFrame==="function")requestAnimationFrame(V);else Promise.resolve().then(V)}function H(F,K){let O=F,M=K&&typeof K.eq==="function"?K.eq:Object.is,z=new Set,B={get(){if(T!==null)T.add(B);return O},peek(){return O},set(I){if(M(O,I))return;if(O=I,E>0){S.set(B,O);return}if(N!=="sync"){if(R===null)R=new Map;if(R.set(B,O),!j)j=!0,X();return}for(let A of[...z])try{A(O)}catch{}},update(I){B.set(I(O))},subscribe(I){if(typeof I!=="function")return()=>{};return z.add(I),()=>z.delete(I)},get size(){return z.size},_isSignal:!0,_subs:z,_graphId:"s"+ ++Z};return B}function Q(F,K,O){if(!Array.isArray(F)||F.some((w)=>!w||!w._isSignal))throw Error("signal.derived: deps must be an array of signals");if(typeof K!=="function")throw Error("signal.derived: fn must be a function");let M=()=>K(...F.map((w)=>w.peek())),z=H(M(),O),B=!1,I=F.map((w)=>w.subscribe(()=>{if(B)return;z.set(M())}));function A(){if(B)return;B=!0;for(let w of I)try{w()}catch{}I.length=0}return{get:z.get,peek:z.peek,subscribe:z.subscribe,dispose:A,get size(){return z.size},_isSignal:!0,_subs:z._subs}}function L(F){if(typeof F!=="function")return;if(E===0)S=new Map;E++;try{F()}finally{if(E--,E===0){let K=S;S=null;for(let[O,M]of K)for(let z of[...O._subs])try{z(M)}catch{}}}}function Y(F){let K=T;T=null;try{return F()}finally{T=K}}function G(F){if(typeof F!=="function")throw Error("signal.effect: fn must be a function");let K=new Set,O=!1,M={id:"e"+ ++q,deps:new Set};$.add(M);function z(){for(let I of K)try{I()}catch{}K.clear()}function B(){if(O)return;z();let I=new Set,A=T;T=I;try{F()}catch(w){try{console.error("signal.effect: handler threw",w)}catch{}}finally{T=A}M.deps.clear();for(let w of I){M.deps.add(w._graphId);let k=w.subscribe(B);K.add(k)}}return B(),function(){O=!0,z(),M.deps.clear(),$.delete(M)}}function J(F,K){if(typeof F!=="function")throw Error("signal.resource: fetcher must be a function");let O=!(K&&K.autoStart===!1),M=K&&typeof K.eq==="function"?K.eq:(A,w)=>A.status===w.status&&A.value===w.value&&A.error===w.error,z=H({status:"idle",value:null,error:null},{eq:M}),B=0;function I(){let A=++B;z.set({status:"pending",value:z.peek().value,error:null}),Promise.resolve().then(()=>F()).then((w)=>{if(A!==B)return;z.set({status:"resolved",value:w,error:null})},(w)=>{if(A!==B)return;z.set({status:"rejected",value:z.peek().value,error:w instanceof Error?w:Error(String(w))})})}if(O)I();return{get:z.get,peek:z.peek,subscribe:z.subscribe,refresh:I,get size(){return z.size},_isSignal:!0,_subs:z._subs}}function U(F,K,O){if(!Array.isArray(F)||F.some((A)=>!A||!A._isSignal))throw Error("signal.derivedAsync: deps must be an array of signals");if(typeof K!=="function")throw Error("signal.derivedAsync: fn must be a function");let M=J(()=>Promise.resolve().then(()=>K(...F.map((A)=>A.peek()))),O),z=[],B=!1;for(let A of F){let w=A.subscribe(()=>{if(B)return;M.refresh()});z.push(w)}function I(){if(B)return;B=!0;for(let A of z)try{A()}catch{}z.length=0}return{get:M.get,peek:M.peek,subscribe:M.subscribe,refresh:M.refresh,dispose:I,get size(){return M.size},_isSignal:!0,_subs:M._subs}}function W(F,K){if(typeof F!=="function")throw Error("signal.computed: fn must be a function");let O=K&&typeof K.eq==="function"?K.eq:Object.is,M=new Set,z=!0,B,I=[],A=!1;function w(){for(let f of I)try{f()}catch{}I=[]}function k(){if(A)return;if(!z)z=!0;w();let f=new Set,y=T;T=f;let _;try{_=F()}finally{T=y}let v=B;B=_,z=!1;for(let b of f)I.push(b.subscribe(k));if(!O(v,_))for(let b of[...M])try{b(_)}catch{}}function g(){w();let f=new Set,y=T;T=f;try{B=F()}finally{T=y}z=!1;for(let _ of f)I.push(_.subscribe(k))}let x={get(){if(T!==null)T.add(x);if(z&&!A)g();return B},peek(){if(z&&!A){let f=T;T=null,g(),T=f}return B},subscribe(f){if(typeof f!=="function")return()=>{};return M.add(f),()=>M.delete(f)},dispose(){if(A)return;A=!0,w()},get size(){return M.size},_isSignal:!0,_subs:M,_graphId:"c"+ ++Z};return Object.freeze(x)}function C(F){let K=N;if(N=F,F==="sync"&&R!==null)V();return function(){if(N=K,K==="sync"&&R!==null)V()}}function P(){V()}function D(){return Y(()=>{let F=[],K=[],O=[],M=new Set;for(let z of $){K.push(Object.freeze({id:z.id,deps:z.deps.size}));for(let B of z.deps){if(!M.has(B))M.add(B),F.push(Object.freeze({id:B,kind:B[0]==="c"?"computed":"signal"}));O.push(Object.freeze({effect:z.id,signal:B}))}}return Object.freeze({signals:Object.freeze(F),effects:Object.freeze(K),edges:Object.freeze(O)})})}return{create:H,derived:Q,batch:L,untrack:Y,effect:G,resource:J,derivedAsync:U,computed:W,scheduleNotify:C,flushSync:P,inspectGraph:D}}};var b$={name:"valid",version:"1.0.0",type:"fw.io.utils",dependencies:[],factory(){let E={is(X){return Object.prototype.toString.call(X).slice(8,-1).toLowerCase()},isNumber(X){return typeof X==="number"&&Number.isFinite(X)},isString(X){return Object.prototype.toString.call(X)==="[object String]"},isBoolean(X){return X===!0||X===!1||Object.prototype.toString.call(X)==="[object Boolean]"},isArray(X){return Object.prototype.toString.call(X)==="[object Array]"},isObject(X){return Object.prototype.toString.call(X)==="[object Object]"},isUint8Array(X){return Object.prototype.toString.call(X)==="[object Uint8Array]"},isUint8ClampedArray(X){return Object.prototype.toString.call(X)==="[object Uint8ClampedArray]"},isFunction(X){return Object.prototype.toString.call(X)==="[object Function]"}},S=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;function T(X){if(typeof X!=="string")return!1;if(X.length===0||X.length>254)return!1;let H=X.lastIndexOf("@");if(H<1||H===X.length-1)return!1;let Q=X.slice(0,H),L=X.slice(H+1);if(Q.length>64||L.length>255)return!1;if(Q.charCodeAt(0)===46)return!1;if(Q.charCodeAt(Q.length-1)===46)return!1;if(Q.indexOf("..")>=0)return!1;let Y=L.lastIndexOf(".");if(Y<0)return!1;if(L.length-Y-1<2)return!1;return S.test(X)}let N=new RegExp("^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:(:[0-9a-fA-F]{1,4}){1,6}|:(:[0-9a-fA-F]{1,4}){1,7}|::|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z.\\-_~]+|::(ffff(:0{1,4})?:)?((25[0-5]|(2[0-4]|1?[0-9])?[0-9])\\.){3}(25[0-5]|(2[0-4]|1?[0-9])?[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1?[0-9])?[0-9])\\.){3}(25[0-5]|(2[0-4]|1?[0-9])?[0-9]))$"),R={email:T,url:/^https?:\/\/[^\s/$.?#].[^\s]*$/i,uuid:/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,date:/^\d{4}-\d{2}-\d{2}$/,datetime:/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,ipv4:/^(25[0-5]|2[0-4]\d|[01]?\d\d?)(\.(25[0-5]|2[0-4]\d|[01]?\d\d?)){3}$/,ipv6:N,hex:/^[0-9a-f]+$/i,base64:/^[A-Za-z0-9+/]*={0,2}$/};function j(X,H){if(X===H)return!0;if(typeof X!==typeof H)return!1;if(X===null||H===null)return X===H;if(Array.isArray(X)){if(!Array.isArray(H)||X.length!==H.length)return!1;for(let Q=0;Q<X.length;Q++)if(!j(X[Q],H[Q]))return!1;return!0}if(typeof X==="object"){if(Array.isArray(H))return!1;let Q=Object.keys(X),L=Object.keys(H);if(Q.length!==L.length)return!1;for(let Y of Q)if(!j(X[Y],H[Y]))return!1;return!0}return!1}function Z(X){if(X===null)return"null";if(Array.isArray(X))return"array";if(typeof X==="number"){if(!Number.isFinite(X))return"number";return Number.isInteger(X)?"integer":"number"}if(typeof X==="object")return"object";return typeof X}function q(X,H){let Q=Z(X);if(H==="number")return Q==="number"||Q==="integer";return Q===H}function $(X,H,Q,L){X.push({path:H||"/",keyword:Q,message:L})}function V(X,H,Q,L,Y){if(H===!0)return;if(H===!1){$(L,Q,"false","schema is false");return}if(!H||typeof H!=="object")return;if("const"in H){if(!j(X,H.const))$(L,Q,"const","must equal const")}if(Array.isArray(H.enum)){let J=!1;for(let U of H.enum)if(j(X,U)){J=!0;break}if(!J)$(L,Q,"enum","must be one of enum values")}if(H.type!==void 0){let J=Array.isArray(H.type)?H.type:[H.type],U=H.nullable?J.concat("null"):J,W=!1;for(let C of U)if(q(X,C)){W=!0;break}if(!W){$(L,Q,"type","must be "+U.join(" | "));return}}else if(H.nullable&&X===null)return;let G=Z(X);if(G==="string"){if(typeof H.minLength==="number"&&X.length<H.minLength)$(L,Q,"minLength","string shorter than "+H.minLength);if(typeof H.maxLength==="number"&&X.length>H.maxLength)$(L,Q,"maxLength","string longer than "+H.maxLength);if(H.pattern!==void 0){if(!(H.pattern instanceof RegExp?H.pattern:new RegExp(H.pattern)).test(X))$(L,Q,"pattern","does not match pattern")}if(H.format){let J=Y[H.format];if(J instanceof RegExp){if(!J.test(X))$(L,Q,"format","does not match format "+H.format)}else if(typeof J==="function"){if(!J(X))$(L,Q,"format","does not match format "+H.format)}}}if(G==="number"||G==="integer")if(!Number.isFinite(X))$(L,Q,"type","number must be finite");else{if(typeof H.minimum==="number"&&X<H.minimum)$(L,Q,"minimum","must be >= "+H.minimum);if(typeof H.maximum==="number"&&X>H.maximum)$(L,Q,"maximum","must be <= "+H.maximum);if(typeof H.exclusiveMinimum==="number"&&X<=H.exclusiveMinimum)$(L,Q,"exclusiveMinimum","must be > "+H.exclusiveMinimum);if(typeof H.exclusiveMaximum==="number"&&X>=H.exclusiveMaximum)$(L,Q,"exclusiveMaximum","must be < "+H.exclusiveMaximum);if(typeof H.multipleOf==="number"&&H.multipleOf>0){let J=X/H.multipleOf;if(!Number.isFinite(J)||Math.abs(J-Math.round(J))>0.000000000001)$(L,Q,"multipleOf","must be multiple of "+H.multipleOf)}}if(G==="array"){if(typeof H.minItems==="number"&&X.length<H.minItems)$(L,Q,"minItems","array shorter than "+H.minItems);if(typeof H.maxItems==="number"&&X.length>H.maxItems)$(L,Q,"maxItems","array longer than "+H.maxItems);if(H.uniqueItems){for(let J=0;J<X.length;J++)for(let U=J+1;U<X.length;U++)if(j(X[J],X[U])){$(L,Q,"uniqueItems","duplicate items at ["+J+"] and ["+U+"]"),J=X.length;break}}if(H.items)for(let J=0;J<X.length;J++)V(X[J],H.items,Q+"/"+J,L,Y)}if(G==="object"){if(Array.isArray(H.required)){for(let C of H.required)if(!(C in X))$(L,Q+"/"+C,"required","missing required property")}let J=H.properties||null,U=H.patternProperties?Object.keys(H.patternProperties).map((C)=>({re:new RegExp(C),schema:H.patternProperties[C]})):null,W=H.additionalProperties;for(let C of Object.keys(X)){let P=Q+"/"+C,D=!1;if(J&&C in J)V(X[C],J[C],P,L,Y),D=!0;if(U){for(let F of U)if(F.re.test(C))V(X[C],F.schema,P,L,Y),D=!0}if(!D){if(W===!1)$(L,P,"additionalProperties","additional property not allowed");else if(W&&typeof W==="object")V(X[C],W,P,L,Y)}}}if(Array.isArray(H.allOf))for(let J of H.allOf)V(X,J,Q,L,Y);if(Array.isArray(H.anyOf)){let J=!1,U=[];for(let W of H.anyOf){let C=[];if(V(X,W,Q,C,Y),C.length===0){J=!0;break}U.push(C)}if(!J)$(L,Q,"anyOf","did not match any schema in anyOf")}if(Array.isArray(H.oneOf)){let J=0;for(let U of H.oneOf){let W=[];if(V(X,U,Q,W,Y),W.length===0)J++;if(J>1)break}if(J!==1)$(L,Q,"oneOf","must match exactly one schema in oneOf (matched "+J+")")}if(H.not!==void 0){let J=[];if(V(X,H.not,Q,J,Y),J.length===0)$(L,Q,"not","must not match schema")}}return E.validate=function(X,H,Q){let L=Q&&Q.formats?Object.assign({},R,Q.formats):R,Y=[];return V(X,H,"",Y,L),{valid:Y.length===0,errors:Y}},E.test=function(X,H,Q){return E.validate(X,H,Q).valid},E.compile=function(X,H){let Q=H&&H.formats?Object.assign({},R,H.formats):R;return{validate(L){let Y=[];return V(L,X,"",Y,Q),{valid:Y.length===0,errors:Y}},test(L){let Y=[];return V(L,X,"",Y,Q),Y.length===0}}},E.formats=R,E}};var WZ={name:"ui8",version:"1.0.0",type:"fw.io.utils",dependencies:[],factory(){let E=function(j,Z){let q=new Uint8Array(j.length+Z.length);return q.set(j,0),q.set(Z,j.length),q};function S(R,j){let Z=new Uint8Array(R),q=0;for(let $=0;$<j.length;$++)Z.set(j[$],q),q+=j[$].length;return Z}return{equal:function(j,Z){if(j.length===Z.length){for(let q=0;q<j.length;q++)if(j[q]!==Z[q])return!1;return!0}else return!1},join:E,concat:function(j){let Z=0;for(let q=0;q<j.length;q++)Z+=j[q].length;return S(Z,j)}}}};var u$={name:"abort",version:"1.0.0",type:"fw.io.sync",dependencies:[],factory(){function E(Z){let q=typeof Z==="string"?Z:"The operation was aborted";if(typeof DOMException<"u")return new DOMException(q,"AbortError");let $=Error(q);return $.name="AbortError",$}function S(Z){if(typeof Z!=="number"||isNaN(Z)||Z<=0)throw Error("abort: ms must be a positive number");let q=new AbortController,$=setTimeout(()=>q.abort(E()),Z);function V(X){clearTimeout($),q.abort(X!==void 0?X:E())}return q.signal.addEventListener("abort",()=>clearTimeout($),{once:!0}),{signal:q.signal,controller:q,abort:V}}function T(...Z){if(Z.length===0)throw Error("abort: any() requires at least one signal");for(let Q of Z)if(!(Q instanceof AbortSignal))throw Error("abort: any() arguments must be AbortSignal instances");if(typeof AbortSignal.any==="function")return AbortSignal.any(Z);let q=Z.find((Q)=>Q.aborted);if(q){let Q=new AbortController;return Q.abort(q.reason),Q.signal}let $=new AbortController,V=[];function X(Q){if(!$.signal.aborted)$.abort(Q.target.reason);H()}function H(){for(let[Q,L]of V)Q.removeEventListener("abort",L);V.length=0}for(let Q of Z){let L=(Y)=>X(Y);V.push([Q,L]),Q.addEventListener("abort",L,{once:!0})}return $.signal}function N(Z){if(!(Z instanceof AbortSignal))throw Error("abort: wait() requires an AbortSignal");if(Z.aborted)return Promise.reject(Z.reason!==void 0?Z.reason:E());return new Promise((q,$)=>{Z.addEventListener("abort",()=>{$(Z.reason!==void 0?Z.reason:E())},{once:!0})})}function R(Z,q){if(q===void 0||q===null)return Z;if(!(q instanceof AbortSignal))throw Error("abort: race() second argument must be an AbortSignal or null/undefined");if(q.aborted)return Promise.reject(q.reason!==void 0?q.reason:E());return Promise.race([Z,N(q)])}function j(Z){if(Z===void 0||Z===null)return;if(Z.aborted)throw Z.reason!==void 0?Z.reason:E()}return{timeout:S,any:T,wait:N,race:R,throwIfAborted:j,error:E}}};var m$={name:"clock",version:"1.0.0",type:"fw.io.timing",dependencies:[],factory(){let E=Date.now();function S(){return Date.now()}function T(){let Z=Date.now();if(Z<E)return E;return E=Z,Z}function N(Z){return Math.max(0,T()-Z)}function R(){return new Date().toISOString()}function j(Z){let q=Number(Z);if(!Number.isFinite(q))return String(Z);let $=Math.abs(q);if($<1)return q.toFixed(3)+" ms";if($<1000)return q.toFixed(1)+" ms";if($<60000)return(q/1000).toFixed(3)+" s";if($<3600000)return(q/60000).toFixed(2)+" min";return(q/3600000).toFixed(2)+" h"}return{now:S,monotonic:T,since:N,iso:R,format:j}}};var C$={name:"secPolicy",version:"1.0.0",type:"fw.dom.rendering",dependencies:[],factory(){let E=new Set(["href","src","action","formaction","srcset","xlink:href","data","codebase"]),S=/^(javascript|vbscript|file|jar|data:text|data:application)/,T=new Set(["http","https","mailto","tel","ftp"]),N=/^data:image\/(png|jpe?g|gif|webp|svg\+xml|bmp|ico|avif|apng)[;,]/;function R(U,W,C){if(typeof U!=="string")return!1;let P=U.replace(/[\x00-\x20\x7f]+/g,"").toLowerCase();if(P==="")return!0;if(P[0]==="#"||P[0]==="/"||P[0]==="?"||P[0]===".")return!0;if(S.test(P))return!1;if(P.startsWith("data:")){if(C===!1)return!1;return N.test(P)}let D=P.indexOf(":");if(D===-1)return!0;let F=P.indexOf("/");if(F!==-1&&F<D)return!0;let K=Array.isArray(W)||W instanceof Set?W:T,O=P.slice(0,D);return K instanceof Set?K.has(O):K.includes(O)}let j=new Set(["id","name"]),Z=new Set(["cookie","cookies","domain","location","write","writeln","open","close","body","head","title","URL","referrer","documentElement","documentURI","currentScript","designMode","forms","images","links","scripts","styleSheets","all","embeds","plugins","anchors","applets","parent","top","self","frames","frameElement","opener","elements","submit","reset","method","action"]);function q(U,W){return j.has(U)&&Z.has(String(W))}let $=/^on/i,V=/^[a-zA-Z]/;function X(U){return typeof U==="string"&&$.test(U)}function H(U){return typeof U==="string"&&V.test(U)&&!$.test(U)}let Q=/^(script|object|embed|iframe)$/;function L(U){return typeof U==="string"&&Q.test(U)}let Y=/expression\(|url\(['"]?(?:javascript|vbscript|data:text|data:application)/,G=new Set(["behavior","-ms-behavior"]);function J(U,W){if(typeof U==="string"&&G.has(U.toLowerCase()))return!1;if(W==null)return!0;let C=String(W).replace(/[\x00-\x20\x7f]+/g,"").toLowerCase();return!Y.test(C)}return{URL_ATTRS:E,SCHEME_DANGEROUS_RE:S,SAFE_SCHEMES:T,DATA_IMAGE_RE:N,isSafeUrl:R,CLOBBER_ATTRS:j,CLOBBER_NAMES:Z,isClobberValue:q,EVENT_ATTR_RE:$,SAFE_ATTR_NAME_RE:V,isEventAttr:X,isSafeAttrName:H,BLOCKED_TAGS_RE:Q,isBlockedTag:L,CSS_DANGEROUS_RE:Y,CSS_BLOCKED_PROPS:G,isSafeCss:J}}};var F$={name:"dom",type:"fw.dom.query",dependencies:["secPolicy"],deps:[C$],factory(E){let S=function(R,j,Z){if(!E.isSafeCss(j,Z))return;R.style.setProperty(j,Z)},T=function(R){if(Array.isArray(R)||R instanceof NodeList)return R;return[R]};return{queryAll(R,j){if((R instanceof HTMLElement||R instanceof SVGElement)&&typeof j==="string")return R.querySelectorAll(j);return[]},query(R,j){if((R instanceof HTMLElement||R instanceof SVGElement)&&typeof j==="string")return R.querySelector(j);return null},attr(R,j,Z){let q=T(R);for(let $=0;$<q.length;$++)q[$].setAttribute(j,Z)},attrGet(R,j){if(R instanceof Element)return R.getAttribute(j);return null},attrRemove(R,j){let Z=T(R);for(let q=0;q<Z.length;q++)Z[q].removeAttribute(j)},attrHas(R,j){if(R instanceof Element)return R.hasAttribute(j);return!1},data(R,j,Z){let q=T(R);for(let $=0;$<q.length;$++)if("dataset"in q[$])q[$].dataset[j]=Z},dataGet(R,j){if("dataset"in R)return R.dataset[j]??null;return null},dataRemove(R,j){let Z=T(R);for(let q=0;q<Z.length;q++)if("dataset"in Z[q])delete Z[q].dataset[j]},dataHas(R,j){if("dataset"in R)return j in R.dataset;return!1},classAdd(R,j){let Z=j.trim().split(/\s+/),q=T(R);for(let $=0;$<q.length;$++)q[$].classList.add(...Z)},classRemove(R,j){let Z=j.trim().split(/\s+/),q=T(R);for(let $=0;$<q.length;$++)q[$].classList.remove(...Z)},classHas(R,j){if(R instanceof Element)return R.classList.contains(j);return!1},classToggle(R,j){let Z=T(R);for(let q=0;q<Z.length;q++)Z[q].classList.toggle(j)},classReplace(R,j,Z){let q=T(R);for(let $=0;$<q.length;$++)q[$].classList.replace(j,Z)},style(R,j,Z){let q=T(R);for(let $=0;$<q.length;$++)S(q[$],j,Z)},styleGet(R,j){if(R instanceof Element)return getComputedStyle(R).getPropertyValue(j);return null},styleGetAll(R){if(R instanceof Element)return getComputedStyle(R);return null},styleRemove(R,j){let Z=T(R);for(let q=0;q<Z.length;q++)Z[q].style.removeProperty(j)},hide(R){let j=T(R);for(let Z=0;Z<j.length;Z++)S(j[Z],"display","none")},show(R,j){let Z=j!==void 0?j:"",q=T(R);for(let $=0;$<q.length;$++)if(Z==="")q[$].style.removeProperty("display");else S(q[$],"display",Z)},toggleVisibility(R){let j=T(R);for(let Z=0;Z<j.length;Z++)if(j[Z].style.display==="none")j[Z].style.removeProperty("display");else S(j[Z],"display","none")},rect(R){if(R instanceof Element)return R.getBoundingClientRect();return null},scrollPos(R){if(R instanceof Element)return{top:R.scrollTop,left:R.scrollLeft};return null},scrollTo(R,j,Z){let q=T(R);for(let $=0;$<q.length;$++){if(j!==void 0)q[$].scrollTop=j;if(Z!==void 0)q[$].scrollLeft=Z}},reorder(R,j){if(!(R instanceof Element))return;let Z=R,q=typeof Z.moveBefore==="function"?(V,X)=>Z.moveBefore(V,X):(V,X)=>R.insertBefore(V,X),$=R.firstChild;for(let V=0;V<j.length;V++){let X=j[V];if(!(X instanceof Element)||X.parentNode!==R)continue;if(X===$){$=$.nextSibling;continue}q(X,$)}},fragment(R){let j=document.createDocumentFragment();if(R&&typeof R[Symbol.iterator]==="function"){for(let Z of R)if(Z instanceof Node)j.appendChild(Z)}return j},bind(R,j,Z,q,$){if(!(j instanceof Element))throw Error("dom.bind: element must be an Element");if(typeof Z!=="function"||typeof q!=="function")throw Error("dom.bind: getter and setter must be functions");let V=$&&$.event||"input",X=!!($&&$.checked),H=X?()=>{let Y=Z();j.checked=!!Y}:()=>{let Y=Z();j.value=Y==null?"":String(Y)};H();let Q=()=>{q(X?j.checked:j.value)};j.addEventListener(V,Q);let L=!1;return{refresh:H,destroy(){if(L)return;L=!0,j.removeEventListener(V,Q)}}},focus(R){if(R instanceof Element)R.focus()},blur(R){if(R instanceof Element)R.blur()},text(R,j){let Z=T(R);if(Array.isArray(j)){let $=(V)=>{let X=V.createDocumentFragment();for(let H of j){if(H==null)continue;let Q=String(H.text==null?"":H.text);if(H.lang){let L=V.createElement("span");if(L.setAttribute("lang",String(H.lang)),H.dir)L.setAttribute("dir",String(H.dir));L.textContent=Q,X.appendChild(L)}else X.appendChild(V.createTextNode(Q))}return X};for(let V=0;V<Z.length;V++){let X=Z[V];if(!(X instanceof Element))continue;X.textContent="",X.appendChild($(X.ownerDocument||document))}return}let q=j==null?"":String(j);for(let $=0;$<Z.length;$++)if(Z[$]instanceof Node)Z[$].textContent=q},textGet(R){if(R instanceof Node)return R.textContent;return null},val(R,j){let Z=T(R);for(let q=0;q<Z.length;q++)if("value"in Z[q])Z[q].value=j},valGet(R){if(R instanceof Element&&"value"in R)return R.value;return null},checked(R,j){let Z=T(R);for(let q=0;q<Z.length;q++)if("checked"in Z[q])Z[q].checked=!!j},checkedGet(R){if(R instanceof Element&&"checked"in R)return R.checked;return null},disabled(R,j){let Z=T(R);for(let q=0;q<Z.length;q++)if("disabled"in Z[q])Z[q].disabled=!!j},disabledGet(R){if(R instanceof Element&&"disabled"in R)return R.disabled;return null}}}};var D$={name:"events",type:"fw.dom.query",dependencies:[],factory(){let E={},S={};function T(X,H,Q){return new CustomEvent(X,{detail:H,bubbles:Q.bubbles??!0,cancelable:Q.cancelable??!1,composed:Q.composed??!1})}let N={};N.on=function(X,H,Q,L,Y=!1){if(E[X])N.off(X);H.addEventListener(Q,L,Y),E[X]={elm:H,type:Q,fn:L,options:Y}},N.off=function(X){let H=E[X];if(H)H.elm.removeEventListener(H.type,H.fn,H.options),delete E[X]},N.has=function(X){return Object.prototype.hasOwnProperty.call(E,X)},N.clear=function(){for(let X of Object.keys(E))N.off(X)},N.emit=function(X,H,Q=null,L={}){X.dispatchEvent(T(H,Q,L))},N.preset=function(X,H,Q,L=null,Y={}){S[X]={elm:H,type:Q,detail:L,options:Y}},N.dispatch=function(X,H){let Q=S[X];if(Q)Q.elm.dispatchEvent(T(Q.type,H!==void 0?H:Q.detail,Q.options))},N.unset=function(X){delete S[X]},N.delegate=function(X,H,Q,L,Y,G=!1){if(N.has(X))N.off(X);let J=function(U){let W=U.target;while(W&&W!==H){if(W.nodeType===1&&W.matches&&W.matches(L)){U.currentMatch=W,Y.call(W,U);return}W=W.parentNode}};H.addEventListener(Q,J,G),E[X]={elm:H,type:Q,fn:J,options:G}},N.scope=function(X){let H=X+":",Q=new Set;return{on(L,Y,G,J,U){let W=H+L;return N.on(W,Y,G,J,U),Q.add(W),W},delegate(L,Y,G,J,U,W){let C=H+L;return N.delegate(C,Y,G,J,U,W),Q.add(C),C},off(L){let Y=H+L;N.off(Y),Q.delete(Y)},has(L){return N.has(H+L)},clear(){for(let L of[...Q])N.off(L);Q.clear()}}};let R=null,j=new WeakMap;function Z(X,H){if(!R)return;let Q=j.get(X);if(!Q)Q=new Set,j.set(X,Q);Q.add(H)}let{on:q,delegate:$}=N;function V(X){if(!X)return;let H=j.get(X);if(H){for(let L of H)N.off(L);j.delete(X)}let Q=X.childNodes;if(!Q)return;for(let L=0;L<Q.length;L++)V(Q[L])}return N.autoCleanup=function(X){if(R)return N._disableAutoCleanup;let H=X||(typeof document<"u"?document.body:null);if(!H)return()=>{};return R=new MutationObserver((Q)=>{for(let L of Q){let Y=L.removedNodes;if(!Y)continue;for(let G=0;G<Y.length;G++)V(Y[G])}}),R.observe(H,{childList:!0,subtree:!0}),N.on=function(Q,L,Y,G,J){q.call(N,Q,L,Y,G,J),Z(L,Q)},N.delegate=function(Q,L,Y,G,J,U){$.call(N,Q,L,Y,G,J,U),Z(L,Q)},N._disableAutoCleanup=function(){if(!R)return;R.disconnect(),R=null,N.on=q,N.delegate=$},N._disableAutoCleanup},N}};var p$={name:"easing",version:"1.0.0",type:"fw.io.calc",dependencies:[],factory(){let E={};return E.linear=function(S,T,N,R){return N*S/R+T},E.easeInQuad=function(S,T,N,R){return N*(S/=R)*S+T},E.easeOutQuad=function(S,T,N,R){return-N*(S/=R)*(S-2)+T},E.easeInOutQuad=function(S,T,N,R){if((S/=R/2)<1)return N/2*S*S+T;return-N/2*(--S*(S-2)-1)+T},E.easeInCubic=function(S,T,N,R){return N*(S/=R)*S*S+T},E.easeOutCubic=function(S,T,N,R){return N*((S=S/R-1)*S*S+1)+T},E.easeInOutCubic=function(S,T,N,R){if((S/=R/2)<1)return N/2*S*S*S+T;return N/2*((S-=2)*S*S+2)+T},E.easeInQuart=function(S,T,N,R){return N*(S/=R)*S*S*S+T},E.easeOutQuart=function(S,T,N,R){return-N*((S=S/R-1)*S*S*S-1)+T},E.easeInOutQuart=function(S,T,N,R){if((S/=R/2)<1)return N/2*S*S*S*S+T;return-N/2*((S-=2)*S*S*S-2)+T},E.easeInQuint=function(S,T,N,R){return N*(S/=R)*S*S*S*S+T},E.easeOutQuint=function(S,T,N,R){return N*((S=S/R-1)*S*S*S*S+1)+T},E.easeInOutQuint=function(S,T,N,R){if((S/=R/2)<1)return N/2*S*S*S*S*S+T;return N/2*((S-=2)*S*S*S*S+2)+T},E.easeInSine=function(S,T,N,R){return-N*Math.cos(S/R*(Math.PI/2))+N+T},E.easeOutSine=function(S,T,N,R){return N*Math.sin(S/R*(Math.PI/2))+T},E.easeInOutSine=function(S,T,N,R){return-N/2*(Math.cos(Math.PI*S/R)-1)+T},E.easeInExpo=function(S,T,N,R){return S===0?T:N*Math.pow(2,10*(S/R-1))+T},E.easeOutExpo=function(S,T,N,R){return S===R?T+N:N*(-Math.pow(2,-10*S/R)+1)+T},E.easeInOutExpo=function(S,T,N,R){if(S===0)return T;if(S===R)return T+N;if((S/=R/2)<1)return N/2*Math.pow(2,10*(S-1))+T;return N/2*(-Math.pow(2,-10*(S-1))+2)+T},E.easeInCirc=function(S,T,N,R){return-N*(Math.sqrt(1-(S/=R)*S)-1)+T},E.easeOutCirc=function(S,T,N,R){return N*Math.sqrt(1-(S=S/R-1)*S)+T},E.easeInOutCirc=function(S,T,N,R){if((S/=R/2)<1)return-N/2*(Math.sqrt(1-S*S)-1)+T;return N/2*(Math.sqrt(1-(S-=2)*S)+1)+T},E.easeInElastic=function(S,T,N,R){let j,Z=0,q=N;if(S===0)return T;if((S/=R)===1)return T+N;if(!Z)Z=R*0.3;if(q<Math.abs(N))q=N,j=Z/4;else j=Z/(2*Math.PI)*Math.asin(N/q);return-(q*Math.pow(2,10*(S-=1))*Math.sin((S*R-j)*(2*Math.PI)/Z))+T},E.easeOutElastic=function(S,T,N,R){let j,Z=0,q=N;if(S===0)return T;if((S/=R)===1)return T+N;if(!Z)Z=R*0.3;if(q<Math.abs(N))q=N,j=Z/4;else j=Z/(2*Math.PI)*Math.asin(N/q);return q*Math.pow(2,-10*S)*Math.sin((S*R-j)*(2*Math.PI)/Z)+N+T},E.easeInOutElastic=function(S,T,N,R){let j,Z=0,q=N;if(S===0)return T;if((S/=R/2)===2)return T+N;if(!Z)Z=R*0.44999999999999996;if(q<Math.abs(N))q=N,j=Z/4;else j=Z/(2*Math.PI)*Math.asin(N/q);if(S<1)return-0.5*(q*Math.pow(2,10*(S-=1))*Math.sin((S*R-j)*(2*Math.PI)/Z))+T;return q*Math.pow(2,-10*(S-=1))*Math.sin((S*R-j)*(2*Math.PI)/Z)*0.5+N+T},E.easeInBack=function(S,T,N,R){return N*(S/=R)*S*(2.70158*S-1.70158)+T},E.easeOutBack=function(S,T,N,R){return N*((S=S/R-1)*S*(2.70158*S+1.70158)+1)+T},E.easeInOutBack=function(S,T,N,R){let j=1.70158;if((S/=R/2)<1)return N/2*(S*S*(((j*=1.525)+1)*S-j))+T;return N/2*((S-=2)*S*(((j*=1.525)+1)*S+j)+2)+T},E.easeInBounce=function(S,T,N,R){return N-E.easeOutBounce(R-S,0,N,R)+T},E.easeOutBounce=function(S,T,N,R){if((S/=R)<0.36363636363636365)return N*(7.5625*S*S)+T;else if(S<0.7272727272727273)return N*(7.5625*(S-=0.5454545454545454)*S+0.75)+T;else if(S<0.9090909090909091)return N*(7.5625*(S-=0.8181818181818182)*S+0.9375)+T;else return N*(7.5625*(S-=0.9545454545454546)*S+0.984375)+T},E.easeInOutBounce=function(S,T,N,R){if(S<R/2)return E.easeInBounce(S*2,0,N,R)*0.5+T;return E.easeOutBounce(S*2-R,0,N,R)*0.5+N*0.5+T},E}};var d$={name:"animate",type:"fw.dom.display",dependencies:["easing"],deps:[p$],factory(E){function S(T,N,R,j,Z,q,$,V){if(!V())return;let X=Math.min(N-T,R);if(X>0)q(j(X,Z.init,Z.end-Z.init,R),V);if(X<R)requestAnimationFrame((H)=>S(T,H,R,j,Z,q,$,V));else if($!==null)$()}return function(N,R,j,Z,q=null,$=()=>!0){if(typeof N!=="number"||!Number.isFinite(N)||N<=0)throw TypeError("animate: duration must be a finite positive number");if(typeof R!=="string"||typeof E[R]!=="function")throw TypeError(`animate: easingName '${R}' does not resolve to a function on the easing map`);if(j===null||typeof j!=="object"||typeof j.init!=="number"||!Number.isFinite(j.init)||typeof j.end!=="number"||!Number.isFinite(j.end))throw TypeError("animate: prop must be { init: number, end: number } with finite values");if(typeof Z!=="function")throw TypeError("animate: progress must be a function");if(q!==null&&typeof q!=="function")throw TypeError("animate: onComplete must be a function or null");if(typeof $!=="function")throw TypeError("animate: running must be a function");requestAnimationFrame((V)=>{S(V,V,N,E[R],j,Z,q,$)})}}};var FZ={name:"visibility",type:"fw.dom.lifecycle",dependencies:[],worker:!1,factory(){let E=new Set,S=null,T=null,N=null;function R(){if(S)return;S=(J)=>Z(document.visibilityState,J),T=(J)=>Z("hidden",J),N=(J)=>Z(document.visibilityState||"visible",J),document.addEventListener("visibilitychange",S),document.addEventListener("pagehide",T),document.addEventListener("pageshow",N)}function j(){if(!S)return;document.removeEventListener("visibilitychange",S),document.removeEventListener("pagehide",T),document.removeEventListener("pageshow",N),S=T=N=null}function Z(J,U){for(let W of E)W(J,U)}function q(J){E.add(J),R()}function $(J){if(E.delete(J),E.size===0)j()}function V(){return typeof document<"u"&&"visibilityState"in document}function X(){return document.visibilityState}function H(){return document.visibilityState==="visible"}function Q(){return document.visibilityState==="hidden"}function L(J,{immediate:U=!0}={}){if(q(J),U)J(document.visibilityState,null);return()=>$(J)}function Y(J){return L((W,C)=>{if(W==="visible")J(W,C)},{immediate:!0})}function G(J){return L((W,C)=>{if(W==="hidden")J(W,C)},{immediate:!1})}return{isSupported:V,state:X,isVisible:H,isHidden:Q,onChange:L,onVisible:Y,onHidden:G}}};var qZ={name:"a11y",version:"1.0.0",type:"fw.dom.utils",dependencies:[],factory(){let E=null,S=null;function T(Q){if(typeof document>"u"||!document.body)return null;let L=Q==="assertive"?S:E;if(L&&document.body.contains(L))return L;if(L&&!document.body.contains(L))if(Q==="assertive")S=null;else E=null;let Y=document.createElement("div");if(Y.setAttribute("aria-live",Q),Y.setAttribute("aria-atomic","true"),Y.setAttribute("role",Q==="assertive"?"alert":"status"),Y.style.cssText="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0",Y.setAttribute("data-fw-a11y",Q),document.body.appendChild(Y),Q==="assertive")S=Y;else E=Y;return Y}function N(Q,L){let Y=T(L==="assertive"?"assertive":"polite");if(!Y)return;Y.textContent="",Promise.resolve().then(()=>{Y.textContent=String(Q)})}function R(){if(E)E.textContent="";if(S)S.textContent=""}function j(Q,L){if(!Q||!L||typeof L!=="object")return;for(let Y of Object.keys(L)){let G=L[Y],J=Y.startsWith("aria-")?Y:"aria-"+Y;if(G===null||G===!1||G===void 0)Q.removeAttribute(J);else Q.setAttribute(J,String(G))}}function Z(Q){let L=Array.isArray(Q)?Q:[Q],Y=[];for(let G of L){if(G==null)continue;if(typeof G==="string")Y.push(G);else if(G&&G.id)Y.push(G.id)}return Y.join(" ")}function q(Q,L){if(!Q)return;let Y=Z(L);if(Y)Q.setAttribute("aria-labelledby",Y);else Q.removeAttribute("aria-labelledby")}function $(Q,L){if(!Q)return;let Y=Z(L);if(Y)Q.setAttribute("aria-describedby",Y);else Q.removeAttribute("aria-describedby")}function V(Q,L){if(!Q)return;if(L==null||L===!1)Q.removeAttribute("role");else Q.setAttribute("role",String(L))}function X(Q){if(Q)Q.removeAttribute("role")}function H(){if(typeof window>"u"||typeof window.matchMedia!=="function")return!1;try{return window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}return{announce:N,clearAnnouncements:R,aria:j,labelledBy:q,describedBy:$,setRole:V,removeRole:X,prefersReducedMotion:H}}};var LZ={name:"focus",version:"1.0.0",type:"fw.dom.utils",dependencies:["dom","events"],deps:[F$,D$],factory(E,S){let T=["a[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(",");function N(C){let P=C;while(P&&P!==document.body){if(P.hasAttribute&&P.hasAttribute("inert"))return!0;P=P.parentElement}return!1}function R(C){if(C.offsetParent!==null)return!0;let P=C.getBoundingClientRect();return P.width>0||P.height>0}function j(C){let P=C.getAttribute("tabindex");if(P===null)return 0;return parseInt(P,10)}function Z(C){if(!C)return[];let D=Array.from(C.querySelectorAll(T)).filter((O)=>{if(j(O)<0)return!1;if(O.disabled)return!1;if(N(O))return!1;if(!R(O))return!1;return!0}),F=D.filter((O)=>{let M=O.getAttribute("tabindex");return M!==null&&parseInt(M,10)>0}).sort((O,M)=>parseInt(O.getAttribute("tabindex"),10)-parseInt(M.getAttribute("tabindex"),10)),K=D.filter((O)=>{let M=O.getAttribute("tabindex");return M===null||parseInt(M,10)===0});return[...F,...K]}function q(C){let P=C||document.body,D=Z(P);if(!D.length)return;let F=D.indexOf(document.activeElement);D[(F+1)%D.length].focus()}function $(C){let P=C||document.body,D=Z(P);if(!D.length)return;let F=D.indexOf(document.activeElement);D[(F-1+D.length)%D.length].focus()}function V(){let C=document.activeElement;return{restore(){if(C&&typeof C.focus==="function")C.focus()}}}let X=[];function H(C){if(X.push(document.activeElement),C){let P=typeof C==="string"?document.querySelector(C):C;if(P&&typeof P.focus==="function")P.focus()}return X.length}function Q(){if(!X.length)return null;let C=X.pop();if(C&&typeof C.focus==="function")C.focus();return C||null}function L(){return X.length}function Y(){X.length=0}function G(C,P){H(P);try{let D=C();if(D&&typeof D.then==="function")return D.finally(()=>Q());return Q(),D}catch(D){throw Q(),D}}function J(){return document.activeElement}function U(C){let P=document.activeElement,D=()=>{let F=document.activeElement;if(F!==P)C(F,P),P=F};return document.addEventListener("focusin",D),function(){document.removeEventListener("focusin",D)}}function W(C,P={}){let{initialFocus:D=null,returnFocus:F=!0,escapeDeactivates:K=!1,allowOutsideClick:O=!1}=P,M=!1,z=!1,B=null;function I(){if(!D)return Z(C)[0]||null;if(typeof D==="string")return C.querySelector(D);return D}function A(g){if(!M||z)return;let x=Z(C);if(!x.length){g.preventDefault();return}if(g.key==="Tab"){g.preventDefault();let f=x.indexOf(document.activeElement);if(g.shiftKey)x[(f-1+x.length)%x.length].focus();else x[(f+1)%x.length].focus()}else if(g.key==="Escape"&&K)k.deactivate()}function w(g){if(!M||z)return;if(!C.contains(g.target)){let x=Z(C);if(x.length)x[0].focus()}}let k={get paused(){return z},activate(){if(M)return;if(M=!0,F)B=V();C.addEventListener("keydown",A),document.addEventListener("focusin",w);let g=I();if(g)g.focus()},deactivate(){if(!M)return;if(M=!1,C.removeEventListener("keydown",A),document.removeEventListener("focusin",w),F&&B)B.restore(),B=null},pause(){z=!0},resume(){z=!1}};return k}return{trap:W,tabOrder:Z,next:q,previous:$,stash:V,current:J,onChange:U,pushFocus:H,popFocus:Q,focusStackDepth:L,clearFocusStack:Y,restoreFocus:G}}};var OZ={name:"route",version:"1.1.0",type:"fw.dom.utils",dependencies:["events"],deps:[D$],factory(E){let S=[],T=!1;function N(W){let C=[],P=W.replace(/[.+^${}()|[\]\\]/g,"\\$&");if(P=P.replace(/\*([A-Za-z_]\w*)/g,(D,F)=>{return C.push({name:F,tail:!0}),"(.*)"}),P=P.replace(/:([A-Za-z_]\w*)/g,(D,F)=>{return C.push({name:F,tail:!1}),"([^/]+)"}),P!=="/"&&P!=="\\/")P=P.replace(/\/+$/,"")+"\\/?";return{regex:new RegExp("^"+P+"$"),paramNames:C}}function R(W,C){let P=W.pattern.replace(/\/+$/,""),D=C.startsWith("/")?C:"/"+C;return P+D}function j(W){let C=[W],P=W.parent?Z(W.parent):null;while(P)C.unshift(P),P=P.parent?Z(P.parent):null;return C}function Z(W){for(let C of S)if(C.name===W)return C;return null}function q(W){let C=new Set,P=!0;while(P){P=!1;for(let D of S){if(C.has(D.name))continue;if(D.parent===W||C.has(D.parent))C.add(D.name),P=!0}}for(let D of S)if(C.has(D.name))D.chain=j(D)}function $(W){let C=(W||"").replace(/^#/,""),P=C.startsWith("/")?C:"/"+C,D=P.indexOf("?"),F=D===-1?P:P.slice(0,D),K=D===-1?"":P.slice(D+1),O={};if(K)for(let M of K.split("&")){if(!M)continue;let z=M.indexOf("="),B=decodeURIComponent(z===-1?M:M.slice(0,z)),I=decodeURIComponent(z===-1?"":M.slice(z+1));O[B]=I}return{path:F||"/",query:O}}function V(W,C){let P="#"+(W.startsWith("/")?W:"/"+W);if(C&&typeof C==="object"){let D=Object.entries(C).filter(([,F])=>F!=null);if(D.length)P+="?"+D.map(([F,K])=>encodeURIComponent(F)+"="+encodeURIComponent(String(K))).join("&")}return P}let X=!1,H=null,Q=null;function L(W){if(W&&typeof W.then==="function")return W.then((C)=>C!==!1);return W!==!1}function Y(W){X=!0;try{if(location.hash!==W)location.hash=W}finally{X=!1}}function G(){if(location.hash===Q)return;J()}async function J(){if(X)return;X=!0;let W=location.hash;Q=W;try{let{path:C,query:P}=$(W),D=[];for(let M of S){let z=M.regex.exec(C);if(!z)continue;let B={};for(let I=0;I<M.paramNames.length;++I)B[M.paramNames[I].name]=z[I+1];D.push({entry:M,params:B})}if(D.length===0){H=null;return}let F=D[0],K={path:C,hash:W,name:F.entry.name};if(H&&H.name!==F.entry.name){let M=Z(H.name);if(M&&typeof M.beforeLeave==="function"){if(!await L(M.beforeLeave(H.params,H.query,H.info))){Y(H.hash);return}}}let O=F.entry.chain||[F.entry];for(let M of O)if(typeof M.beforeEnter==="function"){if(!await L(M.beforeEnter(F.params,P,K))){if(H)Y(H.hash);return}}for(let M of O)try{M.fn(F.params,P,{...K,name:M.name})}catch(z){try{console.error("route: handler threw",z)}catch{}}for(let M=1;M<D.length;++M){let z=D[M];try{z.entry.fn(z.params,P,{...K,name:z.entry.name})}catch(B){try{console.error("route: handler threw",B)}catch{}}}H={name:F.entry.name,params:F.params,query:P,info:K,hash:W}}finally{X=!1}}return{on(W,C,P,D={}){if(typeof W!=="string"||!W)throw Error("route.on: name must be a non-empty string");if(typeof C!=="string")throw Error("route.on: pattern must be a string");if(typeof P!=="function")throw Error("route.on: fn must be a function");let F=(()=>{for(let B=S.length-1;B>=0;--B)if(S[B].name===W)return S.splice(B,1),!0;return!1})(),K=C;if(D.parent){let B=Z(D.parent);if(!B)throw Error(`route.on: parent '${D.parent}' not found (define parent routes before children)`);K=R(B,C)}let{regex:O,paramNames:M}=N(K),z={name:W,pattern:K,regex:O,paramNames:M,fn:P,parent:D.parent||null,beforeEnter:typeof D.beforeEnter==="function"?D.beforeEnter:null,beforeLeave:typeof D.beforeLeave==="function"?D.beforeLeave:null};if(z.chain=j(z),S.push(z),F)q(W)},off(W){for(let C=S.length-1;C>=0;--C)if(S[C].name===W){S.splice(C,1);break}},go(W,C){let P=V(W,C);if(location.hash!==P)location.hash=P;return J().then(()=>H!==null&&H.hash===P)},replace(W,C){let P=V(W,C),D=location.href.split("#")[0];location.replace(D+P)},current(){let{path:W,query:C}=$(location.hash);return{path:W,query:C,hash:location.hash}},active(){if(!H)return null;return{name:H.name,params:{...H.params},query:{...H.query},info:{...H.info},hash:H.hash}},refresh(){return J()},start(){if(T)return;T=!0,E.on("fw:route:hashchange",window,"hashchange",G),J()},dispose(){if(T)E.off("fw:route:hashchange"),T=!1;S.length=0,H=null,Q=null},get size(){return S.length}}}};var I$={name:"render",type:"fw.dom.rendering",dependencies:["secPolicy"],deps:[C$],factory(E){let S=function(F,K,O){let z=K!=null&&Object.prototype.hasOwnProperty.call(K,F.name)?K[F.name]:F.default,B;if(z===void 0)B=O;else if(F.append)B=(O??"")+z;else if(F.prepend)B=z+(O??"");else B=z;if(F.tail!=null)B=(B??"")+F.tail;return B},T=function(F,K){let O={data:F.data?{...F.data}:{}};if(F.text!=null)O.text=F.text;if(F.map&&F.map.length>0)for(let M of F.map)if(M.data)O.data[M.prop]=S(M,K,O.data[M.prop]);else O[M.prop]=S(M,K,O[M.prop]);return O},N=function(F){return F.map(function(K){return{...K,data:K.data?{...K.data}:K.data,map:K.map?K.map.map(function(O){return{...O}}):K.map}})},R=function(F,K,O=!1){let M=N(F);return M.forEach(function(z){if(O!==!1){if(!Object.prototype.hasOwnProperty.call(z,"parent"))z.parent=O}if(z.map&&z.map.length>0)z.map.forEach(function(B){let I=Object.prototype.hasOwnProperty.call(K,B.name)?K[B.name]:B.default;if(I!==void 0)if(B.data)if(B.append)z.data[B.prop]+=I;else if(B.prepend)z.data[B.prop]=I+z.data[B.prop];else z.data[B.prop]=I;else if(B.append)z[B.prop]=z[B.prop]+I;else if(B.prepend)z[B.prop]=I+z[B.prop];else z[B.prop]=I;if(B.tail!=null)if(B.data)z.data[B.prop]=(z.data[B.prop]??"")+B.tail;else z[B.prop]=(z[B.prop]??"")+B.tail})}),M};function j(){let F=typeof globalThis<"u"?globalThis:{};if(F.crypto&&typeof F.crypto.getRandomValues==="function"){let K=new Uint32Array(1);return F.crypto.getRandomValues(K),K[0]}return Math.random()*4294967295>>>0}let Z=function(F){let K=N(F),O=new Map,M=new Map;return K.forEach(function(z,B){if(O.set(z.id,Date.now().toString(36)+B.toString()+j().toString(36)),z.id=O.get(z.id),Object.prototype.hasOwnProperty.call(z,"parent")&&O.has(z.parent))z.parent=O.get(z.parent);if(z.content)M.set(z.content,z.id)}),{arr:K,map:O,content:M}},q=function(F,K={},O=!1){return Z(R(F,K,O))},$=function(F,K=[],O=!1){let M=[];return K.forEach(function(z){M.push(Z(R(F,z,O)))}),M},V=function(F,K,O){let M=K||new Map,z=O||new Map,B=[];return F.forEach(function(I){let A=!1,w=!0;if(I.attach&&M.has(I.attach.elm))if(M.get(I.attach.elm).content.has(I.attach.name))A=M.get(I.attach.elm).content.get(I.attach.name);else w=!1;if(w)if(Array.isArray(I.data)){let k=$(I.template,I.data,A);if(Object.prototype.hasOwnProperty.call(I,"id"))z.set(I.id,[]),k.forEach(function(g){B.push(...g.arr),z.get(I.id).push(g.map)});else k.forEach(function(g){B.push(...g.arr)})}else{let k=q(I.template,I.data,A);if(Object.prototype.hasOwnProperty.call(I,"id")){if(z.set(I.id,k.map),k.content.size>0)M.set(I.id,{content:k.content})}B.push(...k.arr)}else if(Object.prototype.hasOwnProperty.call(I,"id"))z.set(I.id,!1)}),{arr:B,map:z,attach:M}},X=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),H=E.URL_ATTRS,Q=E.CLOBBER_NAMES,L=E.CLOBBER_ATTRS,Y=E.SAFE_ATTR_NAME_RE,G=E.EVENT_ATTR_RE,J=(F)=>E.isSafeUrl(F);function U(F){return String(F).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function W(F){if(F==="text")return"span";if(F.startsWith("svg_"))return F.slice(4);return F}function C(F){let K=new Map,O=new Map,M=[];for(let z of F)K.set(z.id,z);for(let z of F)if(z.parent!=null){if(!O.has(z.parent))O.set(z.parent,[]);O.get(z.parent).push(z)}else M.push(z);return{byId:K,kids:O,roots:M}}function P(F,K,O,M){let z=W(F.tag),B=X.has(z),I=[];if(F.attrs)for(let k of F.attrs){if(G.test(k)||!Y.test(k))continue;let g=F.data?.[k];if(g===null||g===!1||g===void 0)continue;if(H.has(k)&&!J(String(g)))continue;if(L.has(k)&&Q.has(String(g)))continue;if(g==="")I.push(" "+k);else I.push(" "+k+'="'+U(g)+'"')}if(O.hydrate&&F.id){let k=O.idPrefix?O.idPrefix+":"+F.id:F.id;I.push(' data-fw-id="'+U(k)+'"')}if(O.hydrate&&M!==void 0)I.push(' data-fw-row="'+M+'"');let A="<"+z+I.join("");if(B)return A+" />";let w="";if(F.text!=null)w=U(F.text);else if(F.content!=null){let k=F.content;if(O.iterates&&O.iterates[k]!=null){let g=O.iteratesTemplates?.[k];if(g){let x=O.iterates[k],f=[];for(let y=0;y<x.length;++y){let _=x[y],v=R(g,_),b=C(v);for(let h of b.roots)f.push(P(h,b.kids,O,y))}w=f.join("")}}else if(O.slots&&O.slots[k]!=null){let g=O.slots[k];w=typeof g==="function"?String(g()):String(g)}}else{let k=K.get(F.id);if(k&&k.length){let g=[];for(let x of k)g.push(P(x,K,O));w=g.join("")}}return A+">"+w+"</"+z+">"}return{elms:R,rewrite:Z,parts:q,loop:$,full:V,computeBoundValue:S,applyParsedElm:T,toHTML:function(F,K,O){let M=Array.isArray(F),z=M?F:F.template||[],B=M?null:F.iterates,I={hydrate:!0,idPrefix:"",slots:{},iterates:{},...O,iteratesTemplates:B||{}},A=R(z,K||{}),w=C(A),k=[];for(let g of w.roots)k.push(P(g,w.kids,I));return k.join("")}}}};var c$={name:"parser",version:"1.0.0",type:"fw.dom.rendering",dependencies:["secPolicy"],deps:[C$],factory(E){let T={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "};function N(u){if(u.indexOf("&")===-1)return u;return u.replace(/&(#x?[0-9a-fA-F]+|[a-zA-Z]+);/g,(r,l)=>{if(l[0]==="#"){let p=l[1]==="x"||l[1]==="X"?parseInt(l.slice(2),16):parseInt(l.slice(1),10);if(Number.isFinite(p)&&p>=0&&p<=1114111)try{return String.fromCodePoint(p)}catch{return r}return r}return T[l.toLowerCase()]??r})}function R(u,r){return{nodeType:Q,tagName:u.toUpperCase(),namespaceURI:r||null,attributes:[],childNodes:[],_attrMap:null,getAttribute(p){if(!this._attrMap){this._attrMap=Object.create(null);for(let i of this.attributes)this._attrMap[i.name]=i.value}return this._attrMap[p]??null}}}function j(u){return{nodeType:L,nodeValue:u}}let Z=new Set(["a","abbr","b","bdi","bdo","br","cite","code","data","dfn","em","i","img","kbd","label","mark","q","s","samp","small","span","strong","sub","sup","time","u","var","wbr","button","input","select","textarea","output","svg"]);function q(u){return!!u&&u.nodeType===Q&&Z.has(String(u.tagName).toLowerCase())}function $(u){return{nodeType:Y,nodeValue:u}}function V(u,r){let l=u.length,p=r+1,i=p;while(p<l){let s=u.charCodeAt(p);if(s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122||s===45||s===95)p++;else break}if(p===i)return null;let a=u.slice(i,p).toLowerCase(),Z$=[],J$=!1;while(p<l){while(p<l&&/\s/.test(u[p]))p++;if(p>=l)return null;let s=u[p];if(s===">"){p++;break}if(s==="/"&&u[p+1]===">"){J$=!0,p+=2;break}let Y$=p;while(p<l&&!/[\s=/>]/.test(u[p]))p++;let X$=u.slice(Y$,p).toLowerCase();if(!X$){p++;continue}while(p<l&&/\s/.test(u[p]))p++;let U$="";if(u[p]==="="){p++;while(p<l&&/\s/.test(u[p]))p++;let z$=u[p];if(z$==='"'||z$==="'"){let V$=++p;while(p<l&&u[p]!==z$)p++;if(U$=N(u.slice(V$,p)),u[p]===z$)p++}else{let V$=p;while(p<l&&!/[\s>]/.test(u[p]))p++;U$=N(u.slice(V$,p))}}Z$.push({name:X$,value:U$})}return{tag:a,attrs:Z$,selfClose:J$,end:p}}let X="http://www.w3.org/2000/svg",H=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Q=1,L=3,Y=8,G={text:"span"},J=E.BLOCKED_TAGS_RE,U=/^\s*\$\{([^}]+)\}\s*$/,W=/(#\{[^}]+\})/,C=/^#\{([^}]+)\}$/,P=/^\s*\$([a-zA-Z_]\w*)\s*$/,D=/^\s*([a-zA-Z_]\w*)\$\s*$/,F=E.SAFE_ATTR_NAME_RE,K=E.EVENT_ATTR_RE;function O(u){let r=R("root"),l=[{el:r,ns:null}],p=0,i=u.length;while(p<i){let a=l[l.length-1];if(u[p]==="<"){if(u.startsWith("<!--",p)){let K$=u.indexOf("-->",p+4);if(K$===-1)break;a.el.childNodes.push($(u.slice(p+4,K$))),p=K$+3;continue}if(u.charCodeAt(p+1)===33||u.charCodeAt(p+1)===63){let K$=u.indexOf(">",p);if(K$===-1)break;p=K$+1;continue}if(u[p+1]==="/"){let K$=u.indexOf(">",p);if(K$===-1)break;let O$=u.slice(p+2,K$).trim().toLowerCase();for(let M$=l.length-1;M$>0;--M$)if(l[M$].el.tagName.toLowerCase()===O$){l.length=M$;break}p=K$+1;continue}let X$=V(u,p);if(!X$){p++;continue}let U$=a.ns,z$=X$.tag==="svg"?X:U$,V$=R(X$.tag,z$);for(let K$ of X$.attrs)V$.attributes.push(K$);if(a.el.childNodes.push(V$),!(H.has(X$.tag)||X$.selfClose))l.push({el:V$,ns:z$});p=X$.end;continue}let J$=u.indexOf("<",p),s=J$===-1?i:J$,Y$=u.slice(p,s);if(Y$)a.el.childNodes.push(j(N(Y$)));p=s}return r}let M=0,z=null,B=new Set,I=new Set;function A(u,r){if(!u)return;for(let l of u){if(typeof l!=="string")continue;let p=l.trim();if(!p)continue;if(I.add(p),r)r.add(p)}}let w=(u)=>{let r="p"+M++;while(u&&u.has(r)||I.has(r))r="p"+M++;if(z)z.push(r);return r};function k(u,r){let l=r||new Set,p=u.childNodes;if(!p)return l;for(let i of p){if(i.nodeType!==Q)continue;let a=i.getAttribute?i.getAttribute("id"):null;if(a&&a.trim())l.add(a.trim());k(i,l)}return l}function g(u){let r=u.tagName.toLowerCase();if(u.namespaceURI===X&&r!=="svg")return"svg_"+r;return r}function x(u){if(G[u])return G[u];if(u.startsWith("svg_"))return u.slice(4);return u}function f(u,r,l){let p=u.split(W);if(p.length===1)return{val:u,maps:[]};let i=[];p.forEach((J$,s)=>{let Y$=J$.match(C);if(Y$)i.push({name:Y$[1],idx:s})});let a=[];if(i.length===1){let J$=i[0],s=p.slice(0,J$.idx).join(""),Y$=p.slice(J$.idx+1).join(""),X$={name:J$.name,prop:r};if(l)X$.data=!0;if(s&&!Y$)X$.append=!0;else if(!s&&Y$)X$.prepend=!0;else if(s&&Y$)X$.append=!0,X$.tail=Y$;return a.push(X$),{val:X$.prepend?Y$:s,maps:a}}let Z$=p.slice(0,i[0].idx).join("");return i.forEach((J$,s)=>{let Y$=s+1<i.length?i[s+1].idx:p.length,X$=p.slice(J$.idx+1,Y$).join(""),U$={name:J$.name,prop:r,append:!0};if(l)U$.data=!0;if(X$)U$.tail=X$;a.push(U$)}),{val:Z$,maps:a}}function y(u,r,l,p){let i=(r||[]).filter((Z$)=>Z$.prop===l&&!!Z$.data===p);if(i.length===0)return u??"";if(i.length===1){let Z$=i[0],J$=`#{${Z$.name}}`;if(Z$.append)return(u||"")+J$+(Z$.tail||"");if(Z$.prepend)return J$+(u||"");return J$}let a=u||"";return i.forEach((Z$)=>{a+=`#{${Z$.name}}`+(Z$.tail||"")}),a}function _(u){let r=new Map,l=new Map,p=[];return u.forEach((i)=>{r.set(i.id,i),l.set(i.id,[])}),u.forEach((i)=>{if(i.parent&&r.has(i.parent))l.get(i.parent).push(i.id);else p.push(i.id)}),{byId:r,kids:l,roots:p}}function v(u,r,l,p){let i=r.byId.get(u);if(!i)return"";if(i.tag==="text")return y(i.text??"",i.map||[],"text",!1);let a=x(i.tag),Z$=i.map||[],J$=p||"",s=J$+" ",Y$=s+" ",X$=`id="${i.id}"`;if(i.attrs)i.attrs.forEach((z$)=>{let V$=i.data?.[z$]??"";X$+=` ${z$}="${y(V$,Z$,z$,!0)}"`});if(H.has(a))return`${J$}<${a} ${X$}>`;let U$="";if(i.content){let z$=l&&l[i.content];if(z$){let V$=_(z$),q$=V$.roots.map((K$)=>v(K$,V$,l,Y$)).join(`
30
+ `);U$=`
31
+ ${s}<!-- $${i.content} -->
32
+ `+q$+`
33
+ ${s}<!-- ${i.content}$ -->
34
+ ${J$}`}else U$=`\${${i.content}}`}else if(Object.prototype.hasOwnProperty.call(i,"text")||Z$.some((z$)=>z$.prop==="text"&&!z$.data))U$=y(i.text??"",Z$,"text",!1);else{let z$=r.kids.get(u)||[];if(z$.length>0)if(z$.some((q$)=>{let K$=r.byId.get(q$);return K$&&K$.tag==="text"}))U$=z$.map((q$)=>v(q$,r,l,"")).join("");else U$=`
35
+ `+z$.map((q$)=>v(q$,r,l,s)).join(`
33
36
  `)+`
34
- `+Q$}return`${Q$}<${e} ${n}>${a}</${e}>`}let x=64,u=new Map,v={hits:0,misses:0,evictions:0};function d(h){if(x===0)return;let m=u.get(h);if(m!==void 0)u.delete(h),u.set(h,m),v.hits++;else v.misses++;return m}function o(h,m){if(x===0)return;if(u.size>=x){let b=u.keys().next().value;u.delete(b),v.evictions++}u.set(h,m)}let _=function(h,m){let b=typeof DOMParser<"u"?new DOMParser().parseFromString("<html><body>"+h+"</body></html>","text/html").body:$(h),p=S(b);B(m,p);for(let $$ of p)V.add($$);let i=[],e={};function J$($$,X$,n){let a=$$.tagName.toLowerCase();if(L.test(a))return;let s=E($$),t=$$.getAttribute("id"),Z$=t&&t.trim()?t.trim():A(p),r={id:Z$,tag:s};if(X$!==null&&X$!==void 0)r.parent=X$;let G$=[],K$=[],F$={};for(let W$ of $$.attributes){if(W$.name==="id")continue;if(!q.test(W$.name))continue;if(P.test(W$.name))continue;let{val:Y$,maps:z$}=g(W$.value,W$.name,!0);K$.push(W$.name),F$[W$.name]=Y$,G$.push(...z$)}if(K$.length>0)r.attrs=K$,r.data={...F$};let E$=Array.from($$.childNodes),C$=null,P$=!1,A$=[],O$=[];for(let W$ of E$)if(W$.nodeType===Y){let Y$=W$.nodeValue.match(O),z$=W$.nodeValue.match(C);if(Y$)C$=Y$[1],P$=!0;else if(z$&&P$)P$=!1}else if(P$){if(W$.nodeType===Q)A$.push(W$)}else O$.push(W$);if(C$){r.content=C$;let W$=[];if(A$.forEach((Y$)=>J$(Y$,null,W$)),e[C$]=W$,G$.length>0)r.map=G$;n.push(r)}else if(O$.filter((Y$)=>Y$.nodeType===Q).length===0){let Y$=O$.filter((z$)=>z$.nodeType===G).map((z$)=>z$.nodeValue).join("").trim();if(Y$){let z$=Y$.match(W);if(z$)r.content=z$[1];else{let{val:j$,maps:D$}=g(Y$,"text",!1);r.text=j$,G$.push(...D$)}}if(G$.length>0)r.map=G$;n.push(r)}else{if(G$.length>0)r.map=G$;n.push(r),O$.forEach((Y$)=>{if(Y$.nodeType===Q)J$(Y$,Z$,n);else if(Y$.nodeType===G){let z$=Y$.nodeValue.trim();if(!z$)return;let j$=z$.match(W);if(j$)n.push({id:A(p),tag:"span",parent:Z$,content:j$[1]});else{let{val:D$,maps:U$}=g(z$,"text",!1),B$={id:A(p),tag:"text",parent:Z$,text:D$};if(U$.length>0)B$.map=U$;n.push(B$)}}})}}Array.from(b.childNodes).forEach(($$)=>{if($$.nodeType===Q)J$($$,null,i)});let Q$={template:i};if(Object.keys(e).length>0)Q$.iterates=e;return Q$};return{fromHTML:function(h,m){let b=m?m.reserveIds:void 0;if(typeof h!=="string")return _(h,b);if(b!==void 0&&b!==null)return _(h,b);let p=d(h);if(p!==void 0)return p;let i=_(h);return o(h,i),i},toHTML:function(h){let m=Array.isArray(h),b=m?h:h.template||[],p=m?{}:h.iterates||{},i=w(b);return i.roots.map((e)=>f(e,i,p,"")).join(`
35
- `)},cache:{clear(){u.clear(),v.hits=0,v.misses=0,v.evictions=0},setMax(h){x=Math.max(0,h|0);while(u.size>x){let m=u.keys().next().value;u.delete(m),v.evictions++}},getMax(){return x},size(){return u.size},stats(){return{...v,size:u.size,max:x}}}}}};var T$={name:"template",type:"fw.dom.rendering",dependencies:["secPolicy"],deps:[q$],factory(T){let j={},N={},M=new WeakMap,D=typeof document<"u"?document.querySelector('meta[name="csp-nonce"]')?.getAttribute("content")??"":"",R=T.SAFE_ATTR_NAME_RE,J=T.EVENT_ATTR_RE,U=T.URL_ATTRS,Z=T.CLOBBER_ATTRS,H=T.CLOBBER_NAMES,Q=(q)=>T.isSafeUrl(q);function G(q){return q instanceof SVGSVGElement&&q.children.length===1?q.children[0]:q}function Y(q,P){if(P.attrs)for(let $ of P.attrs){if(J.test($)||!R.test($))continue;let X=P.data?.[$];if(X===null||X===!1||X===void 0)continue;if(U.has($)&&!Q(String(X))){q.removeAttribute($);continue}if(Z.has($)&&H.has(String(X))){q.removeAttribute($);continue}q.setAttribute($,X)}if(P.text!=null)q.textContent=P.text;return q.setAttribute("id",P.id),q}function F(q,P){let $=j[q].tpl,X=P.tag==="text"?"span":P.tag;if(!Object.prototype.hasOwnProperty.call(N[$],X))return null;else return Y(N[$][X].cloneNode(),P)}function L(q,P,$){if($)q.insertBefore(P,q.firstChild);else q.appendChild(P)}function W(q,P){let $=j[q].map,X=[],V=[...P];while(V.length>0){let B=V.pop();if($[B]){if(V.push(...$[B].children),$[B].childCtxs)for(let A of $[B].childCtxs)C.clearContext(A);X.push(B),delete $[B]}}return X}let K="http://www.w3.org/2000/svg",z=["div","span","nav","header","footer","section","article","aside","main",{name:"a",attrs:{href:""}},"button","input","form","label","select","option","textarea","fieldset","legend","table","tr","td","th","thead","tbody","tfoot","caption","ul","li","ol","dl","dt","dd","h1","h2","h3","h4","h5","h6","br","hr","p","i","b","em","strong","small","pre","code","kbd","samp","var","mark","abbr","cite","q","blockquote","s","u","sub","sup","time","details","summary","figure","figcaption","dialog","progress","meter","video","audio","picture",{name:"img",attrs:{src:"",alt:""}},{name:"cvs",tag:"canvas"},{name:"svg",svg:!0},{name:"svg_use",svg:!0,child:"use"}];function O(q=z){return q.map((P)=>{let $=document.createElement("template"),X=typeof P==="object",V=X?P.name:P,B=X&&P.tag?P.tag:X&&P.svg?"svg":V;$.className=V;let A=X&&P.svg?document.createElementNS(K,B):document.createElement(B);if(X&&P.attrs)for(let[S,E]of Object.entries(P.attrs))A.setAttribute(S,E);if(X&&P.child)A.appendChild(document.createElementNS(K,P.child));return $.content.appendChild(A),$})}let C={};return C.init=function(q,P={}){if(j[q])throw Error(`template.init: context '${q}' already exists. Call clearContext('${q}') first if you want to re-init.`);let{main:$,page:X}=P,V=P.tpl,B=typeof P.to==="string"?document.querySelector(P.to):P.to,A=M.get(B);if(A){let S=j[A.ctxName].map[A.id];if(!S.childCtxs)S.childCtxs=[];S.childCtxs.push(q)}if(X){let S=B;j[q]={page:B,head:S.head,ctx:S.body,map:{},styles:{},scripts:{}}}else j[q]={ctx:B,map:{}};if($||V){let S=$?"main":q,E=typeof V==="string"?document.querySelectorAll(V+" > template"):V??O();N[S]={};let I=Array.from(E);for(let g of I)N[S][g.className]=G(g.content.firstChild);j[q].tpl=S}else j[q].tpl="main";return j[q]},C.DEFAULT_TAGS=z,C.generateTemplateTags=O,C.registerTags=function(q,P){let $=P?j[P]?.tpl??P:"main";if(!N[$])N[$]={};let X=O(q),V=[];for(let B of X)N[$][B.className]=G(B.content.firstChild),V.push(B.className);return V},C.reloadTags=function(q,P){let $=P?j[P]?.tpl??P:"main",X=N[$]?Object.keys(N[$]):[];N[$]={};let V=C.registerTags(q,P),B=X.filter((A)=>!V.includes(A));return{added:V,removed:B}},C.unregisterTag=function(q,P){let $=P?j[P]?.tpl??P:"main";if(N[$]&&Object.prototype.hasOwnProperty.call(N[$],q))return delete N[$][q],!0;return!1},C.container=function(q){return j[q]?.ctx??null},C.adoptNode=function(q,P,$,X){let V=j[q];if(!V)throw Error(`template.adoptNode: unknown context '${q}'`);if(V.map[P])throw Error(`template.adoptNode: id '${P}' is already registered in context '${q}'. Re-adoption with a different parentId would silently corrupt the tree.`);let B={node:$,target:$?.parentNode??null,tag:typeof $?.tagName==="string"?$.tagName.toLowerCase():"div",children:[]};if(V.map[P]=B,$)M.set($,{ctxName:q,id:P});if(X&&V.map[X])V.map[X].children.push(P)},C.setNonce=function(q){D=q?String(q):""},C.getNonce=function(){return D},C.getCtx=function(q){return j[q]??null},C.pageAttr=function(q,P){let $=j[q].ctx;for(let[X,V]of Object.entries(P))if(R.test(X)&&(X==="class"||X==="style"||X.startsWith("data-")))$.setAttribute(X,V)},C.elm=function(q,P,$,X=0){if(Array.isArray(P))C.elms(q,P);else if(P.tag&&typeof P.tag==="string"){if(!P.id||typeof P.id!=="string")P.id=Date.now().toString(36)+X.toString()+crypto.getRandomValues(new Uint32Array(1))[0].toString(36);let V=j[q];if(V.map[P.id]){C.clearIn(q,P.id);let B=V.map[P.id],A=F(q,P);if(A!==null)B.node.parentNode.replaceChild(A,B.node),B.node=A,M.set(A,{ctxName:q,id:P.id});if(P.child&&Array.isArray(P.child))C.elms(q,P.child,P.id)}else{let B={node:null,target:null,tag:P.tag==="text"?"text":P.tag,children:[]};if(P.parent&&V.map[P.parent])if(B.target=V.map[P.parent].node,P.prepend)V.map[P.parent].children.unshift(P.id);else V.map[P.parent].children.push(P.id);else if(typeof $==="string"&&V.map[$])if(B.target=V.map[$].node,P.prepend)V.map[$].children.unshift(P.id);else V.map[$].children.push(P.id);else B.target=V.ctx;let A=F(q,P);if(A!==null)L(B.target,A,P.prepend),B.node=A,V.map[P.id]=B,M.set(A,{ctxName:q,id:P.id});if(P.child&&Array.isArray(P.child))C.elms(q,P.child,P.id)}}},C.elms=function(q,P,$){P.forEach(function(X,V){C.elm(q,X,$,V)})},C.get=function(q,P){return j[q].map[P]?.node||null},C.has=function(q,P){return!!j[q]?.map[P]},C.move=function(q,P,$){let X=P instanceof Element?P.getAttribute("id"):null,V=$ instanceof Element?$.getAttribute("id"):null;if(X===null||V===null)return;let B=j[q],A=B.map[X],S=B.map[V];if(!A||!S)return;let E=A.target instanceof Element?A.target.getAttribute("id"):null;if(E!==null&&B.map[E]){let I=B.map[E].children,g=I.indexOf(X);if(g!==-1)I.splice(g,1)}$.appendChild(P),A.target=$,S.children.push(X)},C.style=function(q,P,$){let X=j[q];if(X.styles[P]){X.styles[P].textContent=$;return}let V=document.createElement("style");if(V.id=P,V.textContent=$,D)V.setAttribute("nonce",D);X.head.appendChild(V),X.styles[P]=V},C.removeStyle=function(q,P){let $=j[q];if($.styles[P])$.styles[P].remove(),delete $.styles[P]},C.script=function(q,P,$={}){let X=j[q];if(X.scripts[P])X.scripts[P].remove();let V=document.createElement("script");if(V.id=P,$.content)V.textContent=$.content;if($.type)V.type=$.type;if(D)V.setAttribute("nonce",D);X.head.appendChild(V),X.scripts[P]=V},C.removeScript=function(q,P){let $=j[q];if($.scripts[P])$.scripts[P].remove(),delete $.scripts[P]},C.clearContext=function(q){if(j[q])j[q].ctx.remove(),delete j[q]},C.clearAll=function(q){let P=j[q],$=[];for(let X in P.map){if(!P.map[X])continue;if(P.map[X].childCtxs)for(let V of P.map[X].childCtxs)C.clearContext(V);$.push(...W(q,P.map[X].children)),$.push(X)}return P.ctx.replaceChildren(),P.map={},$},C.clearElm=function(q,P){let $=j[q];if(!$.map[P])return[];let X=$.map[P];X.node.remove();let V=W(q,X.children);return V.push(P),delete $.map[P],V},C.fromParseResult=function(q){if(!q||typeof q!=="object"||Array.isArray(q))throw TypeError("template.fromParseResult: parseResult must be an object with a `template` array");if(!Array.isArray(q.template))throw TypeError("template.fromParseResult: parseResult.template must be an array");if(q.iterates!==void 0&&(typeof q.iterates!=="object"||q.iterates===null))throw TypeError("template.fromParseResult: parseResult.iterates must be an object when present");return q},C.clearIn=function(q,P){let $=j[q];if(!$.map[P])return[];let X=$.map[P];X.node.replaceChildren();let V=W(q,X.children);return X.children=[],V},C}};var UZ={name:"sanitize",type:"fw.dom.rendering",dependencies:["secPolicy"],deps:[q$],factory(T){let j=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),N=new Set(["a","abbr","b","blockquote","br","caption","cite","code","col","colgroup","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","mark","ol","p","pre","q","s","samp","section","small","span","strong","sub","summary","sup","table","tbody","td","th","thead","tfoot","tr","u","ul","var","wbr"]),M={"*":new Set(["class","id","title","dir","lang","tabindex"]),a:new Set(["href","name","target","rel"]),img:new Set(["src","alt","width","height","loading"]),td:new Set(["colspan","rowspan","align","valign"]),th:new Set(["colspan","rowspan","align","valign","scope"]),col:new Set(["span"]),colgroup:new Set(["span"]),ol:new Set(["start","type","reversed"]),li:new Set(["value"]),q:new Set(["cite"]),blockquote:new Set(["cite"]),del:new Set(["cite","datetime"]),ins:new Set(["cite","datetime"]),details:new Set(["open"])},D=["http","https","mailto","tel","ftp"],R={tags:N,attributes:M,urlSchemes:D},J=new Set(["script","style","iframe","object","embed","noscript","noembed","noframes","xmp","plaintext","textarea","svg","math","template","link","meta","head","frame","frameset"]),U=/<!--[\s\S]*?-->/g,Z=/<\s*(\/\s*)?([a-zA-Z][a-zA-Z0-9-]*)\s*([^>]*?)\s*(\/\s*)?\s*>/g,H=/([a-zA-Z_:][a-zA-Z0-9:._-]*)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'<>`=]+)))?/g;function Q(K,z,O){return T.isSafeUrl(K,z??D,!!O)}function G(K){let z={};if(!K)return z;H.lastIndex=0;let O;while((O=H.exec(K))!==null){let C=O[1].toLowerCase(),q=O[2]!==void 0?O[2]:O[3]!==void 0?O[3]:O[4]!==void 0?O[4]:"";z[C]=q}return z}let Y=new Set(["style","srcdoc","formaction","action","ping","xlink:href","xmlns","xlink:actuate","xlink:show","data-bind"]);function F(K,z,O){if(/^on[a-z]/i.test(K))return!1;if(K.startsWith("v-")||K.startsWith("ng-")||K.startsWith(":")||K.startsWith("@"))return!1;if(Y.has(K))return!1;let C=O.attributes||M,q=C["*"];if(q&&q.has(K))return!0;let P=C[z];if(P&&P.has(K))return!0;return!1}function L(K,z,O){let C=O.urlSchemes||D,q="";for(let P of Object.keys(K)){if(!F(P,z,O))continue;let $=K[P];if(P==="href"||P==="src"){if(!Q($,C,!1))continue}if($=String($).replace(/[<>"]/g,"").replace(/\s+/g," ").trim(),P==="href"||P==="src")$=$.replace(/[\r\n\t]/g,"");q+=" "+P+'="'+$+'"'}if(z==="a"){let P=K.href||"",$=(K.target||"").toLowerCase().trim();if(/^https?:\/\//i.test(P.trim())&&($==="_blank"||$!==""&&$!=="_self"&&$!=="_parent"&&$!=="_top")){let B=K.rel?K.rel.toLowerCase():"",A=B.includes("noopener"),S=B.includes("noreferrer");if(!A||!S){q=q.replace(/ rel="[^"]*"/,"");let E=[];if(B)E.push(B);if(!A)E.push("noopener");if(!S)E.push("noreferrer");q+=' rel="'+E.join(" ").trim()+'"'}}}return q}function W(K,z){if(typeof K!=="string"||K.length===0)return"";K=K.replace(/\x00/g,""),K=K.replace(U,"");let O={tags:z&&z.allowedTags?z.allowedTags instanceof Set?z.allowedTags:new Set(z.allowedTags):N,attributes:z&&z.allowedAttributes!==void 0?z.allowedAttributes:M,urlSchemes:z&&z.urlSchemes?z.urlSchemes:D},C=!(z&&z.dropDangerousContent===!1),q=K;if(C)for(let V of J){let B=new RegExp("<\\s*"+V+"(\\s[^>]*)?>([\\s\\S]*?)<\\s*\\/\\s*"+V+"\\s*>","gi");q=q.replace(B,"");let A=new RegExp("<\\s*"+V+"\\b[^>]*>[\\s\\S]*$","gi");q=q.replace(A,"");let S=new RegExp("<\\s*"+V+"\\b[^>]*/>","gi");q=q.replace(S,"");let E=new RegExp("<\\s*"+V+"\\b[^>]*>","gi");q=q.replace(E,"")}let P=[],$=0,X;Z.lastIndex=0;while((X=Z.exec(q))!==null){P.push(q.slice($,X.index)),$=X.index+X[0].length;let V=!!(X[1]&&X[1].trim()==="/"),B=X[2].toLowerCase(),A=X[3]||"",S=!!(X[4]&&X[4].trim()==="/");if(!O.tags.has(B))continue;if(V){P.push("</"+B+">");continue}let E=G(A),I=L(E,B,O);if(S||j.has(B))P.push("<"+B+I+" />");else P.push("<"+B+I+">")}return P.push(q.slice($)),P.join("")}return{sanitizeHtml:W,isSafeUrl:Q,defaultAllowlist:R}}};var v$={name:"uiSessionCore",version:"1.0.0",type:"fw.dom.rendering",dependencies:["template","render","parser","dom","events"],deps:[T$,N$,y$,H$,V$],factory(T,j,N,M,D){function R(U){if(U.template)return U;if(!U.block)return U;let Z=U.attach?.name,H=Z&&U.block.iterates?.[Z]?U.block.iterates[Z]:U.block.template,Q={...U,template:H};return delete Q.block,Q}return{methods:{parse(U){return N.fromHTML(U)},get(U,Z){let H=this._map.get(U);if(!H)return null;if(Array.isArray(H))return null;if(Z!==void 0){let G=H.get(Z);if(!G)return null;return T.get(this._container,G)}let Q=H.get(U)??H.values().next().value;if(!Q)return null;return T.get(this._container,Q)},_resolveSlotElement(U,Z){let H=this._attach.get(U)?.content?.get(Z);if(!H)return null;return T.get(this._container,H)},query(U,Z,H){let Q=this.get(U,Z);if(!Q)return null;return M.query(Q,H)},queryAll(U,Z,H){let Q=this.get(U,Z);if(!Q)return[];return M.queryAll(Q,H)},*iterate(U){let Z=this._map.get(U);if(!Z||Array.isArray(Z))return;for(let[H,Q]of Z){let G=T.get(this._container,Q);if(G)yield[H,G]}},exists(U,Z){let H=this._map.get(U);if(!H)return!1;if(Array.isArray(H)){if(Z==null)return H.length>0;return!1}if(Z==null)return!0;return H.has(Z)},hydrate(U,Z={}){if(!Array.isArray(U))throw Error("uiSession.hydrate: items must be an array");let H=Z.idPrefix||"",Q=T.container(this._container);if(!Q)throw Error(`uiSession.hydrate: container '${this._container}' is not initialized (call template.init first)`);let G=(K)=>H?`${H}:${K}`:K,Y=(K)=>{let z=`[data-fw-id="${CSS.escape(G(K))}"]`;return Q.querySelector(z)},F=Z.onMismatch||"throw",L=[];function W(K){if(typeof F==="function")try{return F(K)}catch{return"throw"}return F}$:for(let K of U){let z=R(K),O=z.template;if(!O)continue;let C=z.id,q=new Map,P=new Map;for(let $ of O){let X=G($.id),V=Y($.id);if(!V){let A=W({blockId:C,elm:$,realId:X,item:z,idPrefix:H});if(A==="rebuild"){L.push(K);continue $}if(A==="skip")continue $;throw Error(`uiSession.hydrate: no DOM node found for data-fw-id="${X}" (block '${C??"<anonymous>"}', template elm id='${$.id}'). Check that SSR was rendered with idPrefix='${H}' and the same template as the client. Pass opts.onMismatch='rebuild' to fall back to client render.`)}let B=$.parent?G($.parent):void 0;if(!T.has(this._container,X))T.adoptNode(this._container,X,V,B);if(q.set($.id,X),$.content)P.set($.content,X)}if(C){if(this._map.set(C,q),P.size>0)this._attach.set(C,{content:P})}if(C&&z.attach&&z.attach.elm){let $=this._children.get(z.attach.elm);if(!$)$=new Set,this._children.set(z.attach.elm,$);$.add(C)}}if(this._fireMount(U.map((K)=>K&&K.id).filter(Boolean)),L.length>0)this.add(L);return this},add(U){let Z=U.map(R);for(let Q of U)if(Q&&Q.id&&Q.attach&&Q.attach.elm){let G=this._children.get(Q.attach.elm);if(!G)G=new Set,this._children.set(Q.attach.elm,G);G.add(Q.id)}let H=j.full(Z,this._attach,this._map);return T.elms(this._container,H.arr),this._fireMount(U.map((Q)=>Q&&Q.id).filter(Boolean)),this},append(U){return this.add(U)},prepend(U){return this.add(U.map((Z)=>({prepend:!0,...Z})))},mount(U,Z,H){if(typeof H!=="function")throw Error("uiSession.mount: factory must be a function");let Q=Z?this._resolveSlotElement(U,Z):this.get(U);if(!Q)throw Error(`uiSession.mount: no ${Z?`slot '${Z}'`:"root"} resolved for block '${U}' (mount the block before calling mount)`);let G=H(Q,U);if(G&&(typeof G==="object"||typeof G==="function")){if(typeof G==="function"||G.dispose||G.destroy||G.abort||G.close||G.stop||G.clear)this.adopt(U,G)}return G},adopt(U,Z){let H=typeof Z==="function"?Z:Z&&(Z.dispose||Z.destroy||Z.abort||Z.close||Z.stop||Z.clear);if(typeof H!=="function")throw Error("uiSession.adopt: resource must be a function or expose one of {dispose, destroy, abort, close, stop, clear}");let Q=this._unmount.get(U);return this._unmount.set(U,()=>{try{H.call(Z)}catch{}if(Q)Q()}),Z},onUnmount(U,Z){if(typeof Z==="function")this._unmount.set(U,Z);else this._unmount.delete(U);return this},onMount(U,Z){if(typeof Z!=="function")return this._mount.delete(U),this;if(this._map.has(U))try{Z()}catch{}else this._mount.set(U,Z);return this},_fireMount(U){for(let Z of U){if(!Z)continue;let H=this._mount.get(Z);if(!H)continue;this._mount.delete(Z);try{H()}catch{}}},_fireUnmount(U){let Z=this._unmount.get(U);if(!Z)return;this._unmount.delete(U);try{Z()}catch{}},off(U){D.off(U);for(let[,Z]of this._listeners)for(let[,H]of Z)H.delete(U);return this},_offTracked(U,Z){let H=this._listeners.get(U);if(!H)return;if(Z==null){for(let Q of H.values())for(let G of Q)D.off(G);this._listeners.delete(U)}else{let Q=H.get(Z);if(Q){for(let G of Q)D.off(G);H.delete(Z)}}},remove(U,Z){let H=this._map.get(U)?.get(Z);if(H){if(T.clearElm(this._container,H),this._map.get(U).delete(Z),this._offTracked(U,Z),this._map.get(U)?.size===0)this._fireUnmount(U),this._map.delete(U),this._disposeListsFor(U)}return this},clear(U,Z){if(U==null){for(let H of[...this._unmount.keys()])this._fireUnmount(H);if(this._portals)for(let H of[...this._portals.keys()])this.closePortal(H);T.clearAll(this._container),this._map.clear(),this._attach.clear(),this._children.clear();for(let H of[...this._listeners.keys()])this._offTracked(H);this._listeners.clear();for(let H of[...this._lists.keys()])this._disposeListsFor(H);this._lists.clear()}else if(Z!=null){let H=this._map.get(U)?.get(Z);if(H)T.clearIn(this._container,H)}else{let H=this._children.get(U);if(H){for(let G of[...H])this.clear(G);this._children.delete(U)}this._fireUnmount(U);let Q=this._map.get(U);if(Q)Q.forEach((G)=>T.clearElm(this._container,G)),this._map.delete(U);this._offTracked(U),this._disposeListsFor(U)}return this},move(U,Z,H,Q){let G=this.get(U,Z),Y=this.get(H,Q);if(G&&Y)T.move(this._container,G,Y);return this},replace(U,Z){return this.clear(U),this.add(Z)},portal(U,Z={}){if(!this._portals)this._portals=new Map;let H=this._portals.get(U);if(H)return H;let Q=Z.to??(typeof document<"u"?document.body:null);if(!Q)throw Error(`uiSession.portal: no target element resolved for '${U}'`);let G=`${this._container}\x1Fportal\x1F${U}`;T.init(G,{to:Q});let Y=new this.constructor(G);return Y._isPortal=!0,Y._portalParent=this,Y._portalName=U,this._portals.set(U,Y),Y},closePortal(U){let Z=this._portals?.get(U);if(!Z)return this;return Z.clear(),T.clearContext?.(Z._container),this._portals.delete(U),this},_disposeListsFor(U){let Z=this._lists.get(U);if(!Z)return;for(let H of Z.values())H._dispose();this._lists.delete(U)}},resolveTemplate:R}}};var b$={name:"uiSessionDirect",version:"1.0.0",type:"fw.dom.rendering",dependencies:["dom","events"],deps:[H$,V$],factory(T,j){return{methods:{text(M,D,R){let J=arguments.length===2,U=J?this.get(M):this.get(M,D),Z=J?D:R;if(U)T.text(U,Z);return this},attr(M,D,R,J){let U=arguments.length===3,Z=U?this.get(M):this.get(M,D),H=U?D:R,Q=U?R:J;if(!Z)return this;if(Q===null||Q===!1||Q===void 0)T.attrRemove(Z,H);else T.attr(Z,H,Q);return this},on(M,D,R,J,U,Z){let H=typeof D==="string"&&typeof R==="function",Q=H?M:D,G=H?D:R,Y=H?R:J,F=H?J:U,L=H?U:Z,W=H?this.get(M):this.get(M,D);if(!W)return null;let K=F||`fw:ui:${this._container}:${++this._lseq}`;if(j.on(K,W,G,Y,L),!this._listeners.has(M))this._listeners.set(M,new Map);let z=this._listeners.get(M);if(!z.has(Q))z.set(Q,new Set);return z.get(Q).add(K),K},bind(M,D,R,J,U){if(!M||typeof M.subscribe!=="function")throw Error("uiSession.bind: first arg must be a signal");let Z,H,Q;if(arguments.length<=3)Z=void 0,H=R??"text",Q=void 0;else if(arguments.length===4&&J!==null&&typeof J==="object")Z=void 0,H=R,Q=J;else Z=R,H=J??"text",Q=U;let G=Q&&typeof Q.transform==="function"?Q.transform:null,Y=typeof H==="string"?H.indexOf(":"):-1,F=Y>0?H.slice(0,Y):null,L=Y>0?H.slice(Y+1):null,W=null,K=(C)=>{let q=G?G(C):C,P=Z===void 0?this.get(D):this.get(D,Z);if(!P)return;if(H==="text"){T.text(P,q);return}if(H==="class"){if(W!=null)T.classRemove(P,W);if(W=q==null||q===!1||q===""?null:String(q),W)T.classAdd(P,W);return}if(F==="class"){if(q)T.classAdd(P,L);else T.classRemove(P,L);return}if(F==="style"){if(q==null||q===!1)P.style.removeProperty(L);else T.style(P,L,String(q));return}if(F==="prop"){try{P[L]=q}catch{}return}if(q===null||q===!1||q===void 0)T.attrRemove(P,H);else T.attr(P,H,q)};K(M.get());let z=M.subscribe(K),O=this._unmount.get(D);return this._unmount.set(D,()=>{if(z(),O)O()}),z}}}}};var u$={name:"hex",version:"1.0.0",type:"fw.io.codec",dependencies:[],factory(){let j=new Int8Array(128).fill(-1);for(let R=0;R<16;R++)if(j["0123456789abcdef".charCodeAt(R)]=R,R>=10)j["ABCDEF".charCodeAt(R-10)]=R;return{toBytes:(R)=>{let J=R.length;if(J%2!==0)throw Error(`hex: odd-length input (length ${J})`);let U=new Uint8Array(J>>1);for(let Z=0,H=0;Z<J;Z+=2,H++){let Q=R.charCodeAt(Z),G=R.charCodeAt(Z+1),Y=Q<128?j[Q]:-1,F=G<128?j[G]:-1;if(Y<0||F<0)throw Error(`hex: invalid character at index ${Y<0?Z:Z+1}`);U[H]=Y<<4|F}return U},fromBytes:(R)=>{let J=Array(R.length);for(let U=0;U<R.length;U++)J[U]="0123456789abcdef"[(R[U]&240)>>4]+"0123456789abcdef"[R[U]&15];return J.join("")},test:(R)=>{if(typeof R!=="string")return!1;if(R.length%2!==0)return!1;return/^[0-9a-fA-F]*$/.test(R)}}}};var WZ={name:"b64",version:"1.0.0",type:"fw.io.codec",dependencies:[],factory(){let T=[],j="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(let Y=0;Y<64;Y++)T["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(Y)]=Y;function N(Y){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[Y>>18&63]+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[Y>>12&63]+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[Y>>6&63]+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[Y&63]}function M(Y,F,L,W){return T[Y.charCodeAt(0)]<<18|T[F.charCodeAt(0)]<<12|T[L.charCodeAt(0)]<<6|T[W.charCodeAt(0)]}function D(Y,F){Y.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[F>>2]),Y.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[F<<4&63]),Y.push("==")}function R(Y,F){Y.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[F>>10]),Y.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[F>>4&63]),Y.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[F<<2&63]),Y.push("=")}function J(Y,F,L,W){L=L-W;for(let K=0;K<L;K+=3)F.push(N((Y[K]<<16)+(Y[K+1]<<8)+Y[K+2]));if(L=Y.length,W===1)D(F,Y[L-1]);else if(W===2)R(F,(Y[L-2]<<8)+Y[L-1]);return F.join("")}function U(Y,F){Y.push(F>>8&255),Y.push(F&255)}function Z(Y,F,L,W,K){if(Y[W-2]==="=")K=2;else if(Y[W-1]==="=")K=1;W=K>0?W-4:W;let z;for(z=0;z<W;z+=4)L=M(Y[z],Y[z+1],Y[z+2],Y[z+3]),F.push(L>>16&255),F.push(L>>8&255),F.push(L&255);if(K===2)F.push((T[Y.charCodeAt(z)]<<2|T[Y.charCodeAt(z+1)]>>4)&255);else if(K===1)U(F,T[Y.charCodeAt(z)]<<10|T[Y.charCodeAt(z+1)]<<4|T[Y.charCodeAt(z+2)]>>2);return new Uint8Array(F)}return{fromBytes:function(Y){return J(Y,[],Y.length,Y.length%3)},toBytes:function(Y){return Z(Y,[],0,Y.length,0)},test:function(Y){return/^(?=(.{4})*$)[A-Za-z0-9+/]*={0,2}$/.test(Y)}}}};var L$={name:"utf8",version:"1.0.0",type:"fw.io.codec",dependencies:[],factory(){let T=typeof TextEncoder<"u",j=typeof TextDecoder<"u",N=T?new TextEncoder:null,M=j?new TextDecoder("utf-8",{fatal:!1}):null;function D(Z){let H=Z.length,Q=new Uint8Array(H*3),G=0;for(let Y=0;Y<H;Y++){let F=Z.charCodeAt(Y);if(F>=55296&&F<=56319&&Y+1<H){let L=Z.charCodeAt(Y+1);if(L>=56320&&L<=57343)F=65536+(F-55296<<10)+(L-56320),Y++;else F=65533}else if(F>=56320&&F<=57343)F=65533;if(F<128)Q[G++]=F;else if(F<2048)Q[G++]=192|F>>6,Q[G++]=128|F&63;else if(F<65536)Q[G++]=224|F>>12,Q[G++]=128|F>>6&63,Q[G++]=128|F&63;else Q[G++]=240|F>>18,Q[G++]=128|F>>12&63,Q[G++]=128|F>>6&63,Q[G++]=128|F&63}return Q.subarray(0,G)}function R(Z){let H=[],Q=Z.length,G=0;while(G<Q){let Y=Z[G],F;if(Y<128)F=Y,G+=1;else if(Y<192)F=65533,G+=1;else if(Y<224){if(G+1>=Q){H.push(String.fromCharCode(65533));break}F=(Y&31)<<6|Z[G+1]&63,G+=2}else if(Y<240){if(G+2>=Q){H.push(String.fromCharCode(65533));break}F=(Y&15)<<12|(Z[G+1]&63)<<6|Z[G+2]&63,G+=3}else if(Y<248){if(G+3>=Q){H.push(String.fromCharCode(65533));break}F=(Y&7)<<18|(Z[G+1]&63)<<12|(Z[G+2]&63)<<6|Z[G+3]&63,G+=4}else F=65533,G+=1;if(F<65536)H.push(String.fromCharCode(F));else F-=65536,H.push(String.fromCharCode(55296|F>>10,56320|F&1023))}return H.join("")}return{toBytes:function(Z){if(Z===""||Z==null)return new Uint8Array(0);if(N)return N.encode(String(Z));return D(String(Z))},fromBytes:function(Z){if(!Z||Z.length===0)return"";if(M){let H=Z instanceof Uint8Array?Z:new Uint8Array(Z);return M.decode(H)}return R(Z)}}}};var KZ={name:"url",version:"1.0.0",type:"fw.io.codec",dependencies:[],factory(){function T(W,K){let z=encodeURIComponent(String(W));return K==="plus"?z.replace(/%20/g,"+"):z}function j(W,K){try{if(K==="plus")W=W.replace(/\+/g," ");return decodeURIComponent(W)}catch{return W}}function N(W){if(W.indexOf("[")<0)return[W];let K=[],z=W.indexOf("[");K.push(W.slice(0,z));let O=z,C=W.length;while(O<C&&W[O]==="["){let q=W.indexOf("]",O);if(q<0)return K.push(W.slice(O)),K;K.push(W.slice(O+1,q)),O=q+1}return K}function M(W,K,z){let O=W;for(let C=0;C<K.length;C++){let q=K[C],P=C===K.length-1;if(q===""){if(!Array.isArray(O))return;if(P)O.push(z);else{let $={};O.push($),O=$}continue}if(P)if(Array.isArray(O)){let $=/^\d+$/.test(q)?parseInt(q,10):null;if($!==null)O[$]=z}else if(q in O){let $=O[q];if(Array.isArray($))$.push(z);else O[q]=[$,z]}else O[q]=z;else{let $=K[C+1],X=$===""||/^\d+$/.test($);if(Array.isArray(O)){let V=/^\d+$/.test(q)?parseInt(q,10):O.length;if(!O[V])O[V]=X?[]:{};O=O[V]}else{if(!(q in O))O[q]=X?[]:{};O=O[q]}}}}function D(W,K){K=K||{};let z=K.arrayFormat||"repeat",O=!!K.nested,C=K.space||"percent",q=K.delimiter||"&",P={};if(!W)return P;if(W[0]==="?"||W[0]==="#")W=W.slice(1);if(!W)return P;let $=W.split(q);for(let X=0;X<$.length;X++){let V=$[X];if(V==="")continue;let B=V.indexOf("="),A,S;if(B<0)A=V,S="";else A=V.slice(0,B),S=V.slice(B+1);let E=j(A,C),I=j(S,C);if(z==="comma"&&I.indexOf(",")>=0)I=I.split(",");if(O||z==="brackets"||z==="indices"){let g=N(E);if(g.length>1){if(Array.isArray(I))for(let k=0;k<I.length;k++)M(P,g,I[k]);else M(P,g,I);continue}}if(z==="none")P[E]=Array.isArray(I)?I[I.length-1]:I;else if(E in P){let g=P[E];if(Array.isArray(g))if(Array.isArray(I))for(let k of I)g.push(k);else g.push(I);else P[E]=Array.isArray(I)?[g,...I]:[g,I]}else P[E]=I}return P}function R(W,K,z,O){if(z===void 0)return;if(z===null){W.push(T(K,O)+"=");return}W.push(T(K,O)+"="+T(z,O))}function J(W,K){K=K||{};let z=K.arrayFormat||"repeat",O=!!K.nested,C=K.space||"percent",q=K.delimiter||"&",P=!!K.skipNull;if(!W||typeof W!=="object")return"";let $=[],X=(B,A)=>{if(A===void 0&&P)return;if(A===null&&P)return;if(Array.isArray(A)){if(A.length===0)return;switch(z){case"brackets":for(let S of A)X(B+"[]",S);return;case"indices":for(let S=0;S<A.length;S++)X(B+"["+S+"]",A[S]);return;case"comma":$.push(T(B,C)+"="+A.map((S)=>T(S==null?"":S,C)).join(","));return;case"repeat":default:for(let S of A)R($,B,S,C);return}}if(O&&A&&typeof A==="object"&&!(A instanceof Date)){for(let S of Object.keys(A))X(B+"["+S+"]",A[S]);return}if(A instanceof Date)A=A.toISOString();R($,B,A,C)},V=K.sort?Object.keys(W).sort():Object.keys(W);for(let B of V)X(B,W[B]);return $.join(q)}function U(W,K){if(typeof URL==="function"){let E=K?new URL(W,K):new URL(W);return{protocol:E.protocol,username:E.username,password:E.password,hostname:E.hostname,port:E.port,host:E.host,pathname:E.pathname,search:E.search,hash:E.hash,origin:E.origin,href:E.href,query:D(E.search)}}let z=/^(?:([a-z][a-z0-9+\-.]*:))?(?:\/\/((?:([^:@/]*)(?::([^@/]*))?@)?([^:/?#]*)(?::(\d+))?))?([^?#]*)(\?[^#]*)?(#.*)?$/i.exec(W);if(!z)throw Error("url: cannot parse");let O=z[1]||"",C=z[3]||"",q=z[4]||"",P=z[5]||"",$=z[6]||"",X=z[7]||"",V=z[8]||"",B=z[9]||"",A=P+($?":"+$:""),S=O&&P?O+"//"+A:"";return{protocol:O,username:C,password:q,hostname:P,port:$,host:A,pathname:X,search:V,hash:B,origin:S,href:W,query:D(V)}}function Z(W){if(!W)return"";let K="";if(W.protocol){if(K+=W.protocol,!K.endsWith(":"))K+=":";K+="//"}if(W.username){if(K+=encodeURIComponent(W.username),W.password)K+=":"+encodeURIComponent(W.password);K+="@"}if(W.host)K+=W.host;else if(W.hostname){if(K+=W.hostname,W.port)K+=":"+W.port}if(W.pathname)K+=W.pathname.startsWith("/")||!W.hostname?W.pathname:"/"+W.pathname;if(W.query!==void 0&&W.query!==null&&W.query!==""){let z=typeof W.query==="string"?W.query:J(W.query);if(z)K+="?"+z}else if(W.search)K+=W.search.startsWith("?")?W.search:"?"+W.search;if(W.hash)K+=W.hash.startsWith("#")?W.hash:"#"+W.hash;return K}let H=";/?:@&=+$,-_.!~*'()#";function Q(W){let K=Array(128);for(let z=0;z<128;z++){let O=String.fromCharCode(z);if(/[0-9A-Za-z]/.test(O))K[z]=O;else K[z]="%"+("0"+z.toString(16).toUpperCase()).slice(-2)}for(let z=0;z<W.length;z++)K[W.charCodeAt(z)]=W[z];return K}let G=Q(H),Y=/^[0-9a-fA-F]{2}$/;function F(W,K){if(!W)return W===""?"":String(W);let z=K&&K.safe!==void 0?Q(K.safe):G,O="",C=W.length;for(let q=0;q<C;q++){let P=W.charCodeAt(q);if(P===37&&q+2<C){if(Y.test(W.slice(q+1,q+3))){O+=W.slice(q,q+3),q+=2;continue}}if(P<128){O+=z[P];continue}if(P>=55296&&P<=57343){if(P<=56319&&q+1<C){let $=W.charCodeAt(q+1);if($>=56320&&$<=57343){O+=encodeURIComponent(W[q]+W[q+1]),q++;continue}}O+="%EF%BF%BD";continue}O+=encodeURIComponent(W[q])}return O}function L(W){if(!W)return W===""?"":String(W);try{return decodeURIComponent(W)}catch{return W}}return{parseQuery:D,stringifyQuery:J,parseURL:U,buildURL:Z,encodeSafe:F,decodeSafe:L}}};var m$={name:"unicode",version:"1.0.0",type:"fw.io.text",dependencies:[],factory(){let T=new Set(["NFC","NFD","NFKC","NFKD"]);function j(Q,G="NFC"){if(typeof Q!=="string")throw Error("unicode.normalize: str must be a string");if(!T.has(G))throw Error(`unicode.normalize: unknown form "${G}"`);return Q.normalize(G)}function N(Q,G){if(G)return Q.toLocaleLowerCase(G);return Q.toLowerCase()}function M(Q,G,Y={}){let{locale:F,...L}=Y;return new Intl.Collator(F,L).compare(Q,G)}function D(Q={}){let{locale:G,...Y}=Q,F=new Intl.Collator(G,Y);return{compare:F.compare.bind(F),sort:(L)=>[...L].sort(F.compare.bind(F))}}function*R(Q){if(typeof Intl<"u"&&typeof Intl.Segmenter==="function"){let G=new Intl.Segmenter(void 0,{granularity:"grapheme"});for(let{segment:Y}of G.segment(Q))yield Y}else for(let G of Q)yield G}let J=[[4352,4447],[11904,12031],[12032,12287],[12288,12351],[12352,13311],[13312,19903],[19968,40959],[40960,42191],[43360,43391],[44032,55295],[63744,64255],[65040,65055],[65072,65135],[65280,65376],[65504,65510],[110592,110847],[127744,129535],[131072,173791],[173824,183983],[183984,191471]];function U(Q){if(Q===0)return 0;if(Q<32||Q>=127&&Q<160)return 0;if(Q>=768&&Q<=879)return 0;if(Q>=8203&&Q<=8207)return 0;for(let[G,Y]of J)if(Q>=G&&Q<=Y)return 2;return 1}function Z(Q){let G=0;for(let Y of R(Q)){let F=Y.codePointAt(0);G+=U(F)}return G}function H(Q){return Q.normalize("NFD").replace(/\p{Mn}/gu,"").normalize("NFC")}return{normalize:j,casefold:N,compare:M,collator:D,graphemes:R,width:Z,stripDiacritics:H}}};var HZ={name:"str",version:"1.0.0",type:"fw.io.text",dependencies:["unicode"],deps:[m$],factory(T){function j(W){return W.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/([a-zA-Z])(\d)/g,"$1 $2").replace(/(\d)([a-zA-Z])/g,"$1 $2").split(/[\s\-_]+/).filter((z)=>z.length>0)}function N(W){let K=j(W);if(!K.length)return"";return K[0].toLowerCase()+K.slice(1).map((z)=>z[0].toUpperCase()+z.slice(1).toLowerCase()).join("")}function M(W){return j(W).map((K)=>K[0].toUpperCase()+K.slice(1).toLowerCase()).join("")}function D(W){return j(W).map((K)=>K.toLowerCase()).join("-")}function R(W){return j(W).map((K)=>K.toLowerCase()).join("_")}function J(W){return j(W).map((K)=>K.toUpperCase()).join("_")}function U(W){return j(W).map((K)=>K[0].toUpperCase()+K.slice(1).toLowerCase()).join(" ")}function Z(W,K={}){let{separator:z="-",lower:O=!0}=K,C=T.stripDiacritics(W);if(O)C=T.casefold(C);return C=C.replace(/[^a-zA-Z0-9]+/g,z),C=C.replace(new RegExp(`^${Y(z)}+|${Y(z)}+$`,"g"),""),C=C.replace(new RegExp(`${Y(z)}{2,}`,"g"),z),C}function H(W,K,z={}){let{suffix:O="…",wordBoundary:C=!0}=z;if(W.length<=K)return W;let q=K-O.length;if(q<=0)return O.slice(0,K);let P=W.slice(0,q);if(C){let $=P.lastIndexOf(" ");if($>0)P=P.slice(0,$)}return P+O}function Q(W,K,z=" ",O="left"){if(W.length>=K)return W;let C=K-W.length,q=z.repeat(Math.ceil(C/z.length)).slice(0,C);if(O==="right")return W+q;if(O==="both"){let P=Math.floor(C/2),$=C-P;return z.repeat(P).slice(0,P)+W+z.repeat($).slice(0,$)}return q+W}function G(W,K){return W.replace(/\{(\w+)\}/g,(z,O)=>(O in K)?String(K[O]):`{${O}}`)}function Y(W){return W.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function F(W){return W.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function L(W,K){if(W===K)return 1;let z=W.length,O=K.length;if(z===0&&O===0)return 1;if(z===0||O===0)return 0;let C=Array.from({length:O+1},(q,P)=>P);for(let q=1;q<=z;q++){let P=C[0];C[0]=q;for(let $=1;$<=O;$++){let X=C[$];C[$]=W[q-1]===K[$-1]?P:1+Math.min(P,C[$],C[$-1]),P=X}}return 1-C[O]/Math.max(z,O)}return{splitWords:j,camelCase:N,pascalCase:M,kebabCase:D,snakeCase:R,constantCase:J,titleCase:U,slug:Z,truncate:H,pad:Q,format:G,escapeRegExp:Y,escapeHTML:F,similarity:L}}};var zZ={name:"date",version:"1.0.0",type:"fw.io.time",dependencies:[],factory(){function T(W){return W instanceof Date&&!isNaN(W.getTime())}function j(W,K={}){let{locale:z="en-US",...O}=K;return new Intl.DateTimeFormat(z,O).format(W)}let N=[{unit:"year",ms:31557600000},{unit:"month",ms:2630016000},{unit:"week",ms:604800000},{unit:"day",ms:86400000},{unit:"hour",ms:3600000},{unit:"minute",ms:60000},{unit:"second",ms:1000}];function M(W,K,z={}){if(K===void 0||K===null)K=new Date;let{locale:O="en-US",...C}=z,q=W.getTime()-K.getTime(),P=Math.abs(q),$=new Intl.RelativeTimeFormat(O,{numeric:"auto",...C});for(let{unit:X,ms:V}of N)if(P>=V||X==="second"){let B=Math.round(q/V);return $.format(B,X)}return $.format(0,"second")}let D=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:?\d{2})$/;function R(W){if(typeof W!=="string"||!D.test(W))return null;let K=new Date(W);return T(K)?K:null}function J(W,K){if(!K){let f=new Date(W);return T(f)?f:null}let z={YYYY:null,MM:null,DD:null,HH:null,mm:null,ss:null,SSS:null},C=K.replace(/YYYY/g,"(\\d{4})").replace(/MM/g,"(\\d{2})").replace(/DD/g,"(\\d{2})").replace(/HH/g,"(\\d{2})").replace(/mm/g,"(\\d{2})").replace(/ss/g,"(\\d{2})").replace(/SSS/g,"(\\d{3})"),q=[],P=K,X=["YYYY","MM","DD","HH","mm","ss","SSS"].map((f)=>({t:f,idx:P.indexOf(f)})).filter((f)=>f.idx!==-1).sort((f,x)=>f.idx-x.idx);for(let{t:f}of X)q.push(f);let V=new RegExp("^"+C+"$").exec(W);if(!V)return null;for(let f=0;f<q.length;f++)z[q[f]]=parseInt(V[f+1],10);let B=z.YYYY??0,A=(z.MM??1)-1,S=z.DD??1,E=z.HH??0,I=z.mm??0,g=z.ss??0,k=z.SSS??0,w=new Date(B,A,S,E,I,g,k);return T(w)?w:null}function U(W,K,z,O){let C=new Date(W.getTime()),q=new Date(K,z+1,0).getDate();return C.setFullYear(K,z,Math.min(O,q)),C}function Z(W,K,z){switch(z){case"years":return U(W,W.getFullYear()+K,W.getMonth(),W.getDate());case"months":return U(W,W.getFullYear(),W.getMonth()+K,W.getDate());case"weeks":{let O=new Date(W.getTime());return O.setDate(W.getDate()+K*7),O}case"days":{let O=new Date(W.getTime());return O.setDate(W.getDate()+K),O}case"hours":{let O=new Date(W.getTime());return O.setTime(W.getTime()+K*3600000),O}case"minutes":{let O=new Date(W.getTime());return O.setTime(W.getTime()+K*60000),O}case"seconds":{let O=new Date(W.getTime());return O.setTime(W.getTime()+K*1000),O}case"ms":{let O=new Date(W.getTime());return O.setTime(W.getTime()+K),O}default:throw Error(`date.add: unknown unit "${z}"`)}}function H(W,K,z){return Z(W,-K,z)}function Q(W,K,z){let O=W.getTime()-K.getTime();switch(z){case"years":return Math.trunc(W.getFullYear()-K.getFullYear()+(W.getMonth()-K.getMonth())/12);case"months":{let C=W.getFullYear()-K.getFullYear(),q=W.getMonth()-K.getMonth(),P=C*12+q,$=P>=0?1:-1,X=W.getDate(),V=K.getDate();if($>0&&X<V)return P-1;if($<0&&X>V)return P+1;return P}case"weeks":return Math.trunc(O/604800000);case"days":return Math.trunc(O/86400000);case"hours":return Math.trunc(O/3600000);case"minutes":return Math.trunc(O/60000);case"seconds":return Math.trunc(O/1000);case"ms":return O;default:throw Error(`date.diff: unknown unit "${z}"`)}}function G(W,K){let z=new Date(W.getTime());switch(K){case"years":z.setMonth(0,1),z.setHours(0,0,0,0);break;case"months":z.setDate(1),z.setHours(0,0,0,0);break;case"days":z.setHours(0,0,0,0);break;case"hours":z.setMinutes(0,0,0);break;case"minutes":z.setSeconds(0,0);break;case"seconds":z.setMilliseconds(0);break}return z}function Y(W,K){let z=new Date(W.getTime());switch(K){case"years":z.setMonth(11,31),z.setHours(23,59,59,999);break;case"months":{let O=new Date(z.getFullYear(),z.getMonth()+1,0).getDate();z.setDate(O),z.setHours(23,59,59,999);break}case"days":z.setHours(23,59,59,999);break;case"hours":z.setMinutes(59,59,999);break;case"minutes":z.setSeconds(59,999);break;case"seconds":z.setMilliseconds(999);break}return z}function F(W,K){let z={timeZone:K,hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"},O=new Intl.DateTimeFormat("en-CA",z).formatToParts(W),C=(P)=>parseInt(O.find(($)=>$.type===P).value,10),q=new Date(Date.UTC(C("year"),C("month")-1,C("day"),C("hour"),C("minute"),C("second")));return Math.round((q.getTime()-W.getTime())/60000)}function L(){try{return Intl.supportedValuesOf("timeZone")}catch{return["UTC","Europe/London","Europe/Paris","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Asia/Tokyo","Asia/Shanghai","Australia/Sydney"]}}return{format:j,formatRelative:M,parse:J,parseISO:R,diff:Q,add:Z,sub:H,startOf:G,endOf:Y,getOffset:F,zones:L,isValid:T}}};var VZ={name:"i18n",version:"1.0.0",type:"fw.io.i18n",dependencies:[],factory(){function T(R,J){let U=Object.assign({},R);for(let Z of Object.keys(J))if(J[Z]&&typeof J[Z]==="object"&&!Array.isArray(J[Z])&&U[Z]&&typeof U[Z]==="object")U[Z]=T(U[Z],J[Z]);else U[Z]=J[Z];return U}function j(R){if(R===null||typeof R!=="object")return R;if(Array.isArray(R))return R.map(j);let J={};for(let U of Object.keys(R))J[U]=j(R[U]);return J}function N(R,J){if(!R)return;let U=J.split("."),Z=R;for(let H of U){if(Z==null||typeof Z!=="object")return;Z=Z[H]}return Z}function M(R,J){if(!J)return R;return R.replace(/\{(\w+)\}/g,(U,Z)=>(Z in J)?String(J[Z]):`{${Z}}`)}function D({locale:R="en",fallback:J="en",catalogs:U={}}={}){let Z=R,H=J,Q={};for(let[O,C]of Object.entries(U))Q[O]=j(C);function G(O){return N(Q[Z],O)??N(Q[H],O)??void 0}function Y(O,C){let q=G(O);if(q===void 0)return O;if(typeof q!=="string")return O;return M(q,C)}function F(O,C,q){let P=G(O);if(!P||typeof P!=="object")return O;let X=new Intl.PluralRules(Z).select(C),V=P[X]??P.other??O;if(typeof V!=="string")return O;return M(V,{count:C,...q})}function L(O){return N(Q[Z],O)!==void 0}function W(O){Z=O}function K(O,C){let q=j(C);Q[O]=Q[O]?T(Q[O],q):q}function z(O,C,q={}){switch(C){case"number":return new Intl.NumberFormat(Z,q).format(O);case"currency":{let{currency:P="USD",...$}=q;return new Intl.NumberFormat(Z,{style:"currency",currency:P,...$}).format(O)}case"date":return new Intl.DateTimeFormat(Z,q).format(O);case"relative":{let{value:P=O,unit:$="day",...X}=q;return new Intl.RelativeTimeFormat(Z,{numeric:"auto",...X}).format(P,$)}default:throw Error(`i18n.format: unknown type "${C}"`)}}return{t:Y,tn:F,has:L,setLocale:W,addCatalog:K,format:z,get locale(){return Z},get fallback(){return H}}}return{create:D}}};var FZ={name:"rateLimit",dependencies:[],factory(){function T(N,M,D){if(typeof N!=="function")throw Error("rateLimit: fn must be a function");if(typeof M!=="number"||isNaN(M)||M<=0)throw Error("rateLimit: delay must be a positive number");let R=D&&D.leading!==void 0?!!D.leading:!1,J=D&&D.trailing!==void 0?!!D.trailing:!0,U=D&&D.maxWait!==void 0?D.maxWait:void 0;if(U!==void 0&&(typeof U!=="number"||isNaN(U)||U<=0))throw Error("rateLimit: maxWait must be a positive number");let Z=null,H=null,Q=null,G=null,Y,F,L=0,W=!1;function K(B){return L=B,W=!1,Y=N.apply(G,Q),G=null,Q=null,Y}function z(B){Z=setTimeout(C,B)}function O(){if(H!==null)clearTimeout(H),H=null}function C(){let B=Date.now();if($(B))return q(B);let A=P(B);Z=setTimeout(C,A)}function q(B){if(Z=null,O(),J&&Q!==null)return K(B);Q=null,G=null,W=!1}function P(B){let A=B-F,S=B-L,E=M-A;return U!==void 0?Math.min(E,U-S):E}function $(B){let A=B-F,S=B-L;return F===void 0||A>=M||A<0||U!==void 0&&S>=U}function X(B){if(L=B,z(M),W=!0,R)return K(B)}function V(...B){let A=Date.now(),S=$(A);if(Q=B,G=this,F=A,W=!0,S){if(Z===null)return X(A);if(U!==void 0){if(Z!==null)clearTimeout(Z);return Z=setTimeout(C,M),K(A)}}if(Z===null)z(M);if(U!==void 0&&H===null)H=setTimeout(()=>{if(H=null,Q!==null)L=Date.now(),W=!1,Y=N.apply(G,Q),G=null,Q=null},U);return}return V.cancel=function(){if(Z!==null)clearTimeout(Z),Z=null;O(),Q=null,G=null,W=!1},V.flush=function(){if(Z!==null)clearTimeout(Z),Z=null;if(O(),Q!==null){let B=Date.now();W=!1,Y=N.apply(G,Q),G=null,Q=null,L=B}return Y},V.pending=function(){return W},V}function j(N,M,D){if(typeof N!=="function")throw Error("rateLimit: fn must be a function");if(typeof M!=="number"||isNaN(M)||M<=0)throw Error("rateLimit: interval must be a positive number");let R=D&&D.leading!==void 0?!!D.leading:!0,J=D&&D.trailing!==void 0?!!D.trailing:!0;if(!R&&!J)throw Error("rateLimit: throttle options leading and trailing cannot both be false");return T(N,M,{leading:R,trailing:J,maxWait:M})}return{debounce:T,throttle:j}}};var qZ={name:"ajax",type:"fw.dom.net",dependencies:[],factory(){function T(D,R){if(!R)return D;if(/^https?:\/\//i.test(R))return R;let J=D.endsWith("/")?D:D+"/";return new URL(R.replace(/^\//,""),J).href}async function j(D,R){if(R==="response")return D;if(R==="blob")return D.blob();if(R==="buffer")return D.arrayBuffer();if(R==="text")return D.text();if(R==="json"){let U=await D.text();try{return JSON.parse(U)}catch(Z){throw SyntaxError(`Invalid JSON response: ${Z.message}`,{cause:Z})}}let J=D.headers.get("content-type")??"";if(J.includes("application/json")||J.includes("+json")){let U=await D.text();try{return JSON.parse(U)}catch{return U}}if(J.startsWith("text/"))return D.text();return D.arrayBuffer()}class N extends Error{constructor(D){super(`HTTP ${D.status} ${D.statusText}`);Object.defineProperty(this,"name",{value:"HttpError",writable:!0,configurable:!0}),this.status=D.status,this.response=D}}async function M(D,R,{headers:J={},body:U,type:Z,timeout:H=0,signal:Q}={}){let G;if(H>0&&Q)G=typeof AbortSignal.any==="function"?AbortSignal.any([AbortSignal.timeout(H),Q]):Q;else if(H>0)G=AbortSignal.timeout(H);else if(Q)G=Q;let Y=new Headers(J),F={method:D,headers:Y,signal:G};if(U!==void 0&&U!==null)if(typeof U==="object"&&!(U instanceof FormData)&&!(U instanceof Blob)&&!(U instanceof ArrayBuffer)&&!(U instanceof URLSearchParams)){if(F.body=JSON.stringify(U),!Y.has("Content-Type"))Y.set("Content-Type","application/json")}else F.body=U;let L=await fetch(R,F);if(!L.ok)throw new N(L);return j(L,Z)}return function D(R="",J={}){let U=R?R.replace(/\/$/,""):typeof location<"u"?location.origin:"";function Z(H,Q,G={}){let Y={...J,...G};return Y.headers={...J.headers??{},...G.headers??{}},M(H,T(U,Q),Y)}return{get(H,Q){return Z("GET",H,Q)},post(H,Q,G){return Z("POST",H,{...G,body:Q})},put(H,Q,G){return Z("PUT",H,{...G,body:Q})},patch(H,Q,G){return Z("PATCH",H,{...G,body:Q})},del(H,Q){return Z("DELETE",H,Q)},scope(H="",Q={}){return D(T(U,H),{...J,...Q})},HttpError:N}}}};var LZ={name:"network",type:"fw.dom.net",dependencies:[],factory(){let T={online:new Set,offline:new Set,change:new Set,connection:new Set},j,N,M;function D(){return typeof window<"u"?window:typeof self<"u"?self:null}function R(){if(typeof navigator>"u")return null;return navigator.connection??navigator.mozConnection??navigator.webkitConnection??null}function J(){if(j)return;j=()=>{for(let O of T.online)O();for(let O of T.change)O(!0)},N=()=>{for(let O of T.offline)O();for(let O of T.change)O(!1)};let z=D();if(z)z.addEventListener("online",j),z.addEventListener("offline",N)}function U(){if(M)return;let z=R();if(!z||typeof z.addEventListener!=="function")return;M=()=>{let O=H();for(let C of T.connection)C(O)},z.addEventListener("change",M)}function Z(){return typeof navigator<"u"?navigator.onLine:!0}function H(){let z=R();if(!z)return null;return Object.freeze({effectiveType:z.effectiveType??null,downlink:typeof z.downlink==="number"?z.downlink:null,rtt:typeof z.rtt==="number"?z.rtt:null,saveData:!!z.saveData,type:z.type??null})}function Q(){let z=R();return!!(z&&z.saveData)}function G(z){return J(),T.online.add(z),()=>T.online.delete(z)}function Y(z){return J(),T.offline.add(z),()=>T.offline.delete(z)}function F(z,{immediate:O=!0}={}){if(J(),T.change.add(z),O)z(Z());return()=>T.change.delete(z)}function L(z,{immediate:O=!0}={}){if(U(),T.connection.add(z),O)z(H());return()=>T.connection.delete(z)}async function W(z,{timeout:O=3000,method:C="HEAD"}={}){let q=new AbortController,P=setTimeout(()=>q.abort(),O);try{return await fetch(z,{method:C,cache:"no-store",signal:q.signal,mode:"no-cors"}),!0}catch{return!1}finally{clearTimeout(P)}}function K(){T.online.clear(),T.offline.clear(),T.change.clear(),T.connection.clear();let z=D();if(z&&j)z.removeEventListener("online",j),z.removeEventListener("offline",N);j=null,N=null;let O=R();if(O&&M&&typeof O.removeEventListener==="function")O.removeEventListener("change",M);M=null}return{isOnline:Z,onOnline:G,onOffline:Y,onChange:F,connection:H,onConnectionChange:L,saveData:Q,ping:W,off:K}}};var OZ={name:"form",version:"1.1.0",type:"fw.dom.utils",dependencies:["dom","events"],deps:[H$,V$],factory(T,j){function N(R,J,U,Z,H={}){let Q=H.event||"input",G=!!H.checked,Y=G?()=>T.checked(J,!!U()):()=>T.val(J,U()==null?"":String(U()));return Y(),j.on(R,J,Q,()=>{Z(G?T.checkedGet(J):T.valGet(J))}),{refresh:Y,destroy(){j.off(R)}}}function M(R){if(Object.prototype.hasOwnProperty.call(R,"default"))return typeof R.default==="function"?R.default():R.default;if(R.type==="boolean")return!1;if(R.type==="array")return[];return""}function D(R){if(!R||typeof R.fields!=="object")throw Error("form.create: spec.fields is required");let J=R.fields,U=Object.create(null),Z=Object.create(null),H=Object.create(null),Q=Object.create(null),G=Object.create(null),Y=new Map,F=new Set,L=!1,W=Object.create(null);for(let X in J)U[X]=M(J[X]),H[X]=!1,Q[X]=!1,G[X]=!1,W[X]=0;function K(){let X=$.snapshot();for(let V of F)try{V(X)}catch{}}function z(X){let V=J[X];if(!V)return;let B=U[X],A=null;if(V.required){if(V.type==="array"){if(!Array.isArray(B)||B.length===0)A=V.requiredMessage||"Required"}else if(B===""||B==null)A=V.requiredMessage||"Required"}if(!A&&V.type==="array"&&Array.isArray(B)){let S=[],E=!1;for(let I=0;I<B.length;++I){let g=null;if(typeof V.itemValidate==="function")g=V.itemValidate(B[I],I,U)||null;if(S.push(g),g)E=!0}if(E){Z[X]=S;return}delete Z[X];return}if(!A&&typeof V.validate==="function"){let S=V.validate(B,U);if(S&&typeof S.then==="function"){let E=++W[X];G[X]=!0,K(),S.then((I)=>{if(E!==W[X])return;if(I)Z[X]=I;else delete Z[X];G[X]=!1,K()},(I)=>{if(E!==W[X])return;Z[X]=I&&I.message||"Validation error",G[X]=!1,K()});return}A=S||null}if(A)Z[X]=A;else delete Z[X]}function O(){for(let X in J)z(X);if(typeof R.validate==="function"){let X=R.validate(U)||{};for(let V in X)if(X[V])Z[V]=X[V];else delete Z[V]}}function C(X,V){if(!(X in J))return;U[X]=V,Q[X]=!0,z(X),K()}function q(X){let V=J[X];if(!V||V.type!=="array")throw Error(`form.array: field '${X}' is not declared as type:'array'`);function B(){return[...U[X]||[]]}function A(k){let w=Array.isArray(U[X])?U[X].slice():[];return w.push(k),C(X,w),w.length-1}function S(k){if(!Array.isArray(U[X]))return!1;if(k<0||k>=U[X].length)return!1;let w=U[X].slice();return w.splice(k,1),C(X,w),!0}function E(k,w){if(!Array.isArray(U[X]))return!1;let f=U[X].slice();if(k<0||k>=f.length)return!1;if(w<0||w>=f.length)return!1;let[x]=f.splice(k,1);return f.splice(w,0,x),C(X,f),!0}function I(k,w){if(!Array.isArray(U[X]))return!1;if(k<0||k>=U[X].length)return!1;let f=U[X].slice();return f[k]=w,C(X,f),!0}function g(){C(X,[])}return{get values(){return B()},get length(){return Array.isArray(U[X])?U[X].length:0},push:A,remove:S,move:E,set:I,clear:g,get(k){return U[X]?.[k]}}}function P(){let X=[];for(let V in G)if(G[V])X.push(new Promise((B)=>{let A=$.subscribe((S)=>{if(!S.validating[V])A(),B()})}));return X}let $={get values(){return{...U}},get errors(){let X=Object.create(null);for(let V in Z){let B=Z[V];X[V]=Array.isArray(B)?B.slice():B}return X},get touched(){return{...H}},get dirty(){return{...Q}},get validating(){return{...G}},get submitting(){return L},get isValid(){if(Object.keys(Z).length>0)return!1;for(let X in G)if(G[X])return!1;return!0},get(X){return U[X]},set(X,V){C(X,V);let B=Y.get(X);if(B)B.refresh()},touch(X){if(X in J&&!H[X])H[X]=!0,K()},array(X){return q(X)},attach(X,V,B={}){if(!(X in J))throw Error(`form.attach: unknown field '${X}'`);let S=J[X].type==="boolean",E=B.event||(S?"change":"input"),I=`fw:form:${X}`,g=Y.get(X);if(g)g.destroy(),j.off(`${I}:blur`);let k=N(I,V,()=>U[X],(w)=>C(X,w),{event:E,checked:S});Y.set(X,k),j.on(`${I}:blur`,V,"blur",()=>$.touch(X))},detach(){for(let[X,V]of Y)V.destroy(),j.off(`fw:form:${X}:blur`);Y.clear()},validate(){return O(),K(),$.isValid},async validateAsync(){O(),K();let X=P();if(X.length)await Promise.all(X);return $.isValid},subscribe(X){if(typeof X!=="function")return()=>{};return F.add(X),()=>F.delete(X)},snapshot(){let X=Object.create(null);for(let V in Z){let B=Z[V];X[V]=Array.isArray(B)?B.slice():B}return{values:{...U},errors:X,touched:{...H},dirty:{...Q},validating:{...G},isValid:$.isValid,submitting:L}},reset(X){for(let V in J)U[V]=M(J[V]),H[V]=!1,Q[V]=!1,G[V]=!1,W[V]++,delete Z[V];if(X){for(let V in X)if(V in J)U[V]=X[V]}for(let[,V]of Y)V.refresh();K()},async submit(){for(let V in J)H[V]=!0;O(),K();let X=P();if(X.length)await Promise.all(X);if(!$.isValid)return!1;if(typeof R.onSubmit!=="function")return!0;L=!0,K();try{return await R.onSubmit({...U}),!0}finally{L=!1,K()}}};return O(),$}return{bind:N,create:D}}};var PZ={name:"reactiveBind",version:"1.0.0",type:"fw.dom.rendering",dependencies:["signal"],deps:[k$],factory(T){function j(D){if(typeof D==="function")return D;if(D&&typeof D.get==="function")return()=>D.get();throw Error("reactiveBind: sigOrFn must be a signal or a function")}function N(D,R,J){let U=D.get(R,J);if(!U)throw Error(`reactiveBind: no element found for block="${R}", local="${J}". Ensure the block is rendered before binding.`);return U}function M(D){let R=[];function J(W){return R.push(W),W}function U(W,K,z){N(D,W,K);let O=j(z),C=T.effect(()=>{let q=O();D.text(W,K,q)});return J(C)}function Z(W,K,z,O){N(D,W,K);let C=j(O),q=T.effect(()=>{let P=C();D.attr(W,K,z,P)});return J(q)}function H(W,K,z,O){let C=N(D,W,K),q=j(O),P=T.effect(()=>{if(!!q())C.classList.add(z);else C.classList.remove(z)});return J(P)}function Q(W,K,z,O){let C=N(D,W,K),q=j(O),P=T.effect(()=>{let $=q();if($==null||$===!1)C.style.removeProperty(z);else C.style.setProperty(z,String($))});return J(P)}function G(W,K,z){N(D,W,K);let O=j(z),C=T.effect(()=>{let q=!!O();D.attr(W,K,"hidden",q?null:"")});return J(C)}function Y(W,K,z,O){let C=N(D,W,K);if(!z||typeof z.set!=="function")throw Error("reactiveBind.model: sig must be a writable signal (has .set)");let q=O&&O.event||"input",P=O&&typeof O.parse==="function"?O.parse:(S)=>S,$=O&&typeof O.format==="function"?O.format:(S)=>S==null?"":String(S),X=!1,V=T.effect(()=>{let S=z.get(),E=$(S);if(C.value!==E){X=!0;try{C.value=E}finally{X=!1}}}),B=()=>{if(X)return;let S=P(C.value);if(!Object.is(S,z.peek()))z.set(S)};return C.addEventListener(q,B),J(()=>{V(),C.removeEventListener(q,B)})}function F(W,K,z){if(!W||typeof W.sync!=="function")throw Error("reactiveBind.list: listController must have a sync() method");if(!K||typeof K.get!=="function")throw Error("reactiveBind.list: sigArray must be a signal");if(!z||typeof z.keyFn!=="function")throw Error("reactiveBind.list: opts.keyFn is required");let O=T.effect(()=>{let C=K.get();W.sync(Array.isArray(C)?C:[],z)});return J(O)}function L(){for(let W of R)try{W()}catch{}R.length=0}return{text:U,attr:Z,class:H,style:Q,show:G,model:Y,list:F,dispose:L}}return{create:M}}};var DZ={name:"component",version:"1.3.0",type:"fw.dom.rendering",dependencies:["reactiveBind"],deps:[PZ],factory(T){let j=0,N=new Set,M=typeof document<"u"?document.querySelector('meta[name="csp-nonce"]')?.getAttribute("content")??"":"";function D(Z,H,Q){let G={},Y=H||{};for(let[F,L]of Object.entries(Z)){let W=Object.prototype.hasOwnProperty.call(Y,F)?Y[F]:void 0;if(W===void 0){if(L.required)throw Error(`component${Q?`[${Q}]`:""}: required prop '${F}' is missing`);if(Object.prototype.hasOwnProperty.call(L,"default"))G[F]=typeof L.default==="function"?L.default():L.default;continue}if(L.type){let K;if(L.type==="array")K=Array.isArray(W);else if(L.type==="object")K=W!==null&&typeof W==="object"&&!Array.isArray(W);else K=typeof W===L.type;if(!K){let z=Array.isArray(W)?"array":W===null?"null":typeof W;throw Error(`component${Q?`[${Q}]`:""}: prop '${F}' expected ${L.type}, got ${z}`)}}if(typeof L.validator==="function"&&!L.validator(W))throw Error(`component${Q?`[${Q}]`:""}: prop '${F}' failed validator`);G[F]=W}for(let F of Object.keys(Y))if(!Object.prototype.hasOwnProperty.call(Z,F))G[F]=Y[F];return G}function R(Z,H){let Q=new Map,G=/@keyframes\s+([\w-]+)/g,Y;while((Y=G.exec(Z))!==null){let K=Y[1];if(!Q.has(K))Q.set(K,`${H}-${K}`)}let F=Z;if(Q.size>0){F=F.replace(/@keyframes\s+([\w-]+)/g,(O,C)=>{let q=Q.get(C);return q?`@keyframes ${q}`:O}),F=F.replace(/\banimation-name\s*:\s*([\w-]+)/g,(O,C)=>{let q=Q.get(C);return q?`animation-name: ${q}`:O});let K=[...Q.keys()].map((O)=>O.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),z=new RegExp(`(\\banimation\\s*:[^;{}]+?\\b)(${K})\\b`,"g");F=F.replace(z,(O,C,q)=>{let P=Q.get(q);return P?`${C}${P}`:O})}F=F.replace(/:global\(([^)]*)\)/g,(K,z)=>z);let L=`.${H}`,W;do W=F,F=F.replace(/&/g,L);while(F!==W);return F}function J(Z,H){if(typeof document>"u")return;if(N.has(H))return;N.add(H);let Q=R(Z,H),G=document.createElement("style");if(G.textContent=Q,G.setAttribute("data-fw-component",H),M)G.setAttribute("nonce",M);document.head.appendChild(G)}function U(Z){if(!Z||!Z.template||!Array.isArray(Z.template.template))throw Error("component.define: spec.template (ParseResult) is required");let H=Z.template,Q=typeof Z.name==="string"?Z.name:null,G=typeof Z.propsFn==="function"?Z.propsFn:null,Y=typeof Z.mount==="function"?Z.mount:null,F=typeof Z.update==="function"?Z.update:null,L=typeof Z.unmount==="function"?Z.unmount:null,W=Z.props&&typeof Z.props==="object"?Z.props:null,K=typeof Z.css==="string"?Z.css:null,z=null;if(K)z=`fw-comp-${++j}`,J(K,z);let O=0;return function(q={}){let P=q.ui;if(!P||typeof P.add!=="function")throw Error("component.create: opts.ui (UISession) is required");let $=q.id||`comp:${++O}`,X=W?D(W,q.props,Q):q.props||{},V=G?G(X):X,B={id:$,block:H,data:V};if(q.parent)B.attach={elm:q.parent,name:q.slot||"default"};if(P.add([B]),z){let I=P.get($);if(I&&I.classList)I.classList.add(z)}let A=null,S={props:V,rawProps:X,prevProps:void 0,prevRawProps:void 0,ui:P,blockId:$,scopeClass:z,state:{},get bind(){if(A===void 0)return;if(A===null)A=T.create(P);return A},get(I){return arguments.length===0?P.get($):P.get($,I)},text(...I){return P.text($,...I)},attr(...I){return P.attr($,...I)},on(...I){return P.on($,...I)},off(I){return P.off(I)},query(I,g){return P.query($,I,g)},queryAll(I,g){return P.queryAll($,I,g)}},E=!1;if(P.onUnmount($,()=>{if(E)return;if(E=!0,A!==null&&A!==void 0)try{A.dispose()}catch{}if(A=void 0,L)L(S)}),Y)Y(S);return{get props(){return S.props},get blockId(){return $},get state(){return S.state},get scopeClass(){return z},update(I){if(E)return;let g=W?D(W,I,Q):I||{},k=G?G(g):g;if(S.prevRawProps=X,S.prevProps=V,X=g,V=k,S.rawProps=X,S.props=V,F)F(S,S.prevProps)},destroy(){if(E)return;P.clear($)},get(I){return S.get(I)},text(...I){return S.text(...I)},attr(...I){return S.attr(...I)},on(...I){return S.on(...I)}}}}return{define:U}}};var p$={name:"uiSessionList",version:"1.0.0",type:"fw.dom.rendering",dependencies:["template","render","dom"],deps:[T$,N$,H$],factory(T,j,N){function M(Z,H){if(Object.is(Z,H))return!0;if(Z==null||H==null)return!1;if(typeof Z!=="object"||typeof H!=="object")return!1;let Q=Object.keys(Z),G=Object.keys(H);if(Q.length!==G.length)return!1;for(let Y of Q){if(!Object.prototype.hasOwnProperty.call(H,Y))return!1;if(!Object.is(Z[Y],H[Y]))return!1}return!0}function D(Z,H,Q){if(Object.is(Z,H))return!0;if(Q<=0)return!1;if(Z==null||H==null)return!1;if(typeof Z!=="object"||typeof H!=="object")return!1;let G=Array.isArray(Z),Y=Array.isArray(H);if(G!==Y)return!1;if(G){if(Z.length!==H.length)return!1;for(let W=0;W<Z.length;++W)if(!D(Z[W],H[W],Q-1))return!1;return!0}let F=Object.keys(Z),L=Object.keys(H);if(F.length!==L.length)return!1;for(let W of F){if(!Object.prototype.hasOwnProperty.call(H,W))return!1;if(!D(Z[W],H[W],Q-1))return!1}return!0}function R(Z){if(typeof Z==="function")return Z;if(Z==="shallow")return M;if(Z==="deep")return(H,Q)=>D(H,Q,8);return Object.is}class J{constructor(Z,H,Q,G){if(!G||typeof G.keyFn!=="function")throw Error("uiSession.list: options.keyFn is required");if(!G.block||!Array.isArray(G.block.template))throw Error("uiSession.list: options.block (ParseResult) is required");if(this._ui=Z,this._parent=H,this._slot=Q,this._keyFn=G.keyFn,this._block=G.block,this._eq=R(G.eqFn),this._onMount=typeof G.onMount==="function"?G.onMount:null,this._onRemove=typeof G.onRemove==="function"?G.onRemove:null,this._onEnter=typeof G.onEnter==="function"?G.onEnter:null,this._onLeave=typeof G.onLeave==="function"?G.onLeave:null,this._onUpdate=G.onUpdate??"replace",this._onUpdate==="patch"&&G.block?.iterates&&Object.keys(G.block.iterates).length>0)this._onUpdate="replace";this._dataFn=typeof G.dataFn==="function"?G.dataFn:null,this._metaFn=typeof G.metaFn==="function"?G.metaFn:null,this._order=[],this._data=new Map,this._meta=new Map,this._disposed=!1,this._slotEl=null}_dispose(){this._order=[],this._data.clear(),this._meta.clear(),this._slotEl=null,this._disposed=!0}_ensureAlive(){if(this._disposed)throw Error(`uiSession.list: list on (${this._parent}, ${this._slot}) is disposed (its parent block was removed). Create a new list after re-mounting the parent.`)}_itemId(Z){return`${this._parent}\x1Flist\x1F${this._slot}\x1F${Z}`}_key(Z){let H=this._keyFn(Z);if(H===void 0||H===null)throw Error("uiSession.list: keyFn returned null/undefined");return String(H)}_slotElement(){if(this._slotEl)return this._slotEl;let Z=this._ui._resolveSlotElement(this._parent,this._slot);if(!Z)throw Error(`uiSession.list: slot '${this._slot}' not resolved on block '${this._parent}' (parent must be rendered with a \${${this._slot}} slot before creating the list)`);return this._slotEl=Z,Z}_addItem(Z,H,Q=!1){this._slotElement();let G=this._dataFn?this._dataFn(H):H;if(this._ui.add([{id:this._itemId(Z),attach:{elm:this._parent,name:this._slot},block:this._block,data:G,prepend:Q}]),this._data.set(Z,H),this._metaFn)this._meta.set(Z,this._metaFn(H));if(this._onMount)this._onMount(Z,H);if(this._onEnter){let Y=this._ui.get(this._itemId(Z));if(Y)try{Promise.resolve(this._onEnter(Z,Y,H))}catch{}}}_removeItem(Z){if(this._onRemove){let H=this._data.get(Z);try{this._onRemove(Z,H)}catch{}}if(this._onLeave){let H=this._ui.get(this._itemId(Z)),Q=this._data.get(Z);if(H){let G;try{G=this._onLeave(Z,H,Q)}catch{G=null}if(G&&typeof G.then==="function"){this._meta.delete(Z),G.then(()=>this._ui.clear(this._itemId(Z)),()=>this._ui.clear(this._itemId(Z)));return}}}this._ui.clear(this._itemId(Z)),this._meta.delete(Z)}_replaceItem(Z,H){let Q=this._data.get(Z);if(this._onUpdate==="none"){if(this._data.set(Z,H),this._metaFn)this._meta.set(Z,this._metaFn(H));return"unchanged"}if(this._onUpdate==="patch")return this._patchItem(Z,Q,H),"patched";if(typeof this._onUpdate==="function"){let G=this._onUpdate(Z,Q,H,this);if(this._data.set(Z,H),this._metaFn)this._meta.set(Z,this._metaFn(H));return G==="patched"||G==="replaced"||G==="unchanged"?G:"unchanged"}return this._removeItem(Z),this._addItem(Z,H,!1),"replaced"}_patchItem(Z,H,Q){let G=this._dataFn?this._dataFn(H):H,Y=this._dataFn?this._dataFn(Q):Q,F=this._itemId(Z),L=this._ui._map.get(F);if(!L){this._addItem(Z,Q,!1);return}for(let W of this._block.template){if(!W.map||W.map.length===0)continue;let K=L.get(W.id);if(!K)continue;let z=T.get(this._ui._container,K);if(!z)continue;let O=j.applyParsedElm(W,Y),C=j.applyParsedElm(W,G),q=new Set;for(let P of W.map){let $=(P.data?"a:":"t:")+P.prop;if(q.has($))continue;if(q.add($),P.data){let X=O.data[P.prop],V=C.data[P.prop];if(X===V)continue;if(X===null||X===!1||X===void 0)N.attrRemove(z,P.prop);else N.attr(z,P.prop,X)}else{let X=O[P.prop],V=C[P.prop];if(X===V)continue;if(P.prop==="text")N.text(z,X);else N.attr(z,P.prop,X)}}}if(this._data.set(Z,Q),this._metaFn)this._meta.set(Z,this._metaFn(Q))}_reorderDom(){let Z=this._slotElement(),H=this._order.map((Q)=>this._ui.get(this._itemId(Q))).filter(Boolean);N.reorder(Z,H)}get size(){return this._order.length}has(Z){return this._data.has(String(Z))}get(Z){return this._data.get(String(Z))}*keys(){yield*this._order}*entries(){for(let Z of this._order)yield[Z,this._data.get(Z)]}*values(){for(let Z of this._order)yield this._data.get(Z)}[Symbol.iterator](){return this.entries()}element(Z){let H=String(Z);if(!this._data.has(H))return null;return this._ui.get(this._itemId(H))}itemId(Z){return this._itemId(String(Z))}meta(Z){return this._meta.get(String(Z))}attr(Z,...H){return this._ui.attr(this._itemId(String(Z)),...H)}text(Z,...H){return this._ui.text(this._itemId(String(Z)),...H)}on(Z,...H){return this._ui.on(this._itemId(String(Z)),...H)}query(Z,H){let Q=this._ui.get(this._itemId(String(Z)));if(!Q)return null;return N.query(Q,H)}queryAll(Z,H){let Q=this._ui.get(this._itemId(String(Z)));if(!Q)return[];return N.queryAll(Q,H)}push(Z){this._ensureAlive();let H=this._key(Z);if(this._data.has(H))throw Error(`uiSession.list.push: duplicate key '${H}'`);return this._addItem(H,Z,!1),this._order.push(H),H}prepend(Z){this._ensureAlive();let H=this._key(Z);if(this._data.has(H))throw Error(`uiSession.list.prepend: duplicate key '${H}'`);return this._addItem(H,Z,!0),this._order.unshift(H),H}insert(Z,H){this._ensureAlive();let Q=this._key(Z);if(this._data.has(Q))throw Error(`uiSession.list.insert: duplicate key '${Q}'`);this._addItem(Q,Z,!1);let G=H==null?-1:this._order.indexOf(String(H));if(G===-1)this._order.push(Q);else this._order.splice(G,0,Q),this._reorderDom();return Q}upsert(Z){this._ensureAlive();let H=this._key(Z);if(this._data.has(H)){let Q=this._data.get(H);if(this._eq(Q,Z))return"unchanged";let G=this._replaceItem(H,Z);if(G==="replaced")this._reorderDom();return G==="unchanged"?"unchanged":"updated"}return this._addItem(H,Z,!1),this._order.push(H),"added"}update(Z,H){this._ensureAlive();let Q=String(Z);if(!this._data.has(Q))throw Error(`uiSession.list.update: key '${Q}' not found`);let G=this._data.get(Q);if(this._eq(G,H))return"unchanged";let Y=this._replaceItem(Q,H);if(Y==="replaced")this._reorderDom();return Y==="unchanged"?"unchanged":"updated"}remove(Z){this._ensureAlive();let H=String(Z);if(!this._data.has(H))return!1;this._removeItem(H),this._data.delete(H);let Q=this._order.indexOf(H);if(Q!==-1)this._order.splice(Q,1);return!0}move(Z,H){this._ensureAlive();let Q=String(Z);if(!this._data.has(Q))return!1;let G=this._order.indexOf(Q);if(G===-1)return!1;this._order.splice(G,1);let Y=H==null?-1:this._order.indexOf(String(H));if(Y===-1)this._order.push(Q);else this._order.splice(Y,0,Q);return this._reorderDom(),!0}clear(){this._ensureAlive();for(let Z of this._order)this._removeItem(Z);this._order=[],this._data.clear()}adopt(Z,H={}){if(this._ensureAlive(),!Array.isArray(Z))throw Error("uiSession.list.adopt: items must be an array");if(this._order.length>0)throw Error(`uiSession.list.adopt: list on (${this._parent}, ${this._slot}) is not empty (${this._order.length} item(s)). adopt() must run on a freshly-created list, before any push/sync/upsert.`);let Q=H.idPrefix||"",G=this._slotElement(),Y=Array.from(G.children);if(Y.length!==Z.length)throw Error(`uiSession.list.adopt: row count mismatch - slot '${this._slot}' contains ${Y.length} child element(s) but ${Z.length} item(s) were passed. SSR and client must agree on the initial set.`);let F=this._block.template,L=F.filter((C)=>C.parent==null);if(L.length!==1)throw Error(`uiSession.list.adopt: row template must have exactly one root (found ${L.length}). Multi-root row templates can't be unambiguously adopted - recreate via push/sync instead.`);let W=L[0].id,K=this._ui._container,z=(C)=>Q?`${Q}:${C}`:C,O=new Set;for(let C=0;C<Z.length;++C){let q=Z[C],P=Y[C],$=this._key(q);if(O.has($))throw Error(`uiSession.list.adopt: duplicate key '${$}'`);O.add($);let X=this._itemId($),V=new Map;for(let A of F){let S;if(A.id===W)S=P;else S=P.querySelector(`[data-fw-id="${CSS.escape(z(A.id))}"]`);if(!S)throw Error(`uiSession.list.adopt: row ${C} (key='${$}'): no DOM node found for data-fw-id="${z(A.id)}" (elm.id='${A.id}'). Check that SSR was rendered with idPrefix='${Q}' and the same row template.`);let E=`${X}\x1F${A.id}`,I=A.parent!=null?`${X}\x1F${A.parent}`:void 0;T.adoptNode(K,E,S,I),V.set(A.id,E)}this._ui._map.set(X,V);let B=this._ui._children.get(this._parent);if(!B)B=new Set,this._ui._children.set(this._parent,B);if(B.add(X),this._data.set($,q),this._metaFn)this._meta.set($,this._metaFn(q));if(this._order.push($),this._onMount)try{this._onMount($,q)}catch{}}return this}sync(Z){if(this._ensureAlive(),!Array.isArray(Z))throw Error("uiSession.list.sync: items must be an array");let H=Array(Z.length),Q=new Set;for(let W=0;W<Z.length;++W){let K=this._key(Z[W]);if(Q.has(K))throw Error(`uiSession.list.sync: duplicate key '${K}'`);Q.add(K),H[W]=K}let G={added:new Set,kept:new Set,updated:new Set,removed:new Set,reordered:!1};this._order=this._order.filter((W)=>{if(Q.has(W))return!0;return this._removeItem(W),this._data.delete(W),G.removed.add(W),!1});let Y=!1;for(let W=0;W<Z.length;++W){let K=H[W],z=Z[W];if(!this._data.has(K))this._addItem(K,z,!1),G.added.add(K);else{let O=this._data.get(K);if(this._eq(O,z))G.kept.add(K);else{let C=this._replaceItem(K,z);if(C==="unchanged")G.kept.add(K);else if(G.updated.add(K),C==="replaced")Y=!0}}}let F=[...this._order];for(let W of H)if(G.added.has(W))F.push(W);let L=Y;if(!L){for(let W=0;W<H.length;++W)if(F[W]!==H[W]){L=!0;break}}if(this._order=H,L)this._reorderDom(),G.reordered=!0;return G}}return{UIList:J,methods:{list(Z,H,Q){let G=this._lists.get(Z);if(G&&G.has(H)){let F=G.get(H);if(Q&&Q.block&&Q.block!==F._block)throw Error(`uiSession.list: list on (${Z}, ${H}) already exists with a different block - pass the same ParseResult, or remove the parent first.`);return F}let Y=new J(this,Z,H,Q);if(!G)G=new Map,this._lists.set(Z,G);return G.set(H,Y),Y}}}}};var BZ={name:"uiSession",version:"1.0.0",type:"fw.dom.rendering",dependencies:["uiSessionCore","uiSessionDirect","uiSessionList"],deps:[v$,b$,p$],factory(T,j,N){class M{constructor(D){this._container=D,this._attach=new Map,this._map=new Map,this._listeners=new Map,this._lseq=0,this._lists=new Map,this._unmount=new Map,this._mount=new Map,this._children=new Map}}return Object.assign(M.prototype,T.methods,j.methods,N.methods),function(D){return new M(D)}}};var CZ={name:"devtools",version:"1.0.0",type:"fw.dom.rendering",dependencies:["clock"],deps:[f$],factory(T){let j=T;function N(Z){if(!Z||typeof Z!=="object")throw Error("devtools.inspect: session argument is required");let H={container:Z._container||null,blocks:[],attaches:[],children:[],listeners:[],mountHooks:[],unmountHooks:[],lists:[],portals:[]};if(Z._map)for(let[Q,G]of Z._map)if(Array.isArray(G))H.blocks.push({id:Q,logicalIds:G.map((Y)=>[...Y.keys()]),isLoop:!0});else H.blocks.push({id:Q,logicalIds:[...G.keys()],isLoop:!1});if(Z._attach)for(let[Q,G]of Z._attach){let Y=G&&G.content?[...G.content.keys()]:[];H.attaches.push({blockId:Q,slots:Y})}if(Z._children)for(let[Q,G]of Z._children)H.children.push({parent:Q,children:[...G]});if(Z._listeners)for(let[Q,G]of Z._listeners)for(let[Y,F]of G)H.listeners.push({blockId:Q,logicalId:Y,names:[...F]});if(Z._mount)for(let[Q]of Z._mount)H.mountHooks.push(Q);if(Z._unmount)for(let[Q]of Z._unmount)H.unmountHooks.push(Q);if(Z._lists)for(let[Q,G]of Z._lists)for(let[Y,F]of G)H.lists.push({parent:Q,slot:Y,size:F.size,disposed:!!F._disposed});if(Z._portals)for(let[Q,G]of Z._portals)H.portals.push({name:Q,container:G._container});return H}function M(Z){return N(Z).blocks.map((Q)=>`${Q.id}(${Q.isLoop?`loop×${Q.logicalIds.length}`:Q.logicalIds.join(",")})`).join(" ")}function D(Z,H={}){let Q=Array.isArray(Z)?Z:Z&&Z.template||[],G=H.indent||" ",Y=new Map(Q.map((z)=>[z.id,z])),F=new Map,L=[];for(let z of Q)if(z.parent&&Y.has(z.parent)){if(!F.has(z.parent))F.set(z.parent,[]);F.get(z.parent).push(z.id)}else L.push(z.id);let W=[];function K(z,O){let C=Y.get(z);if(!C)return;let q=G.repeat(O),P=[`<${C.tag}#${C.id}>`];if(C.text!=null)P.push(`text=${JSON.stringify(C.text)}`);if(C.content)P.push(`slot=${JSON.stringify(C.content)}`);if(C.attrs&&C.attrs.length)P.push(`attrs=[${C.attrs.join(",")}]`);if(C.map&&C.map.length){let X=C.map.map((V)=>`${V.data?"@":"$"}${V.prop}=#{${V.name}}`+(V.append?"+":V.prepend?"^":"=")).join(",");P.push(`map=[${X}]`)}W.push(q+P.join(" "));let $=F.get(z)||[];for(let X of $)K(X,O+1)}for(let z of L)K(z,0);if(Z&&Z.iterates)for(let z of Object.keys(Z.iterates))W.push(`-- iterate: ${z} --`),W.push(D({template:Z.iterates[z]},H));return W.join(`
36
- `)}function R(Z){if(typeof Z!=="function")throw Error("devtools.profile: fn must be a function");let H=j.monotonic(),Q=Z(),G=j.monotonic();return{result:Q,durationMs:G-H}}async function J(Z){if(typeof Z!=="function")throw Error("devtools.profileAsync: fn must be a function");let H=j.monotonic(),Q=await Z(),G=j.monotonic();return{result:Q,durationMs:G-H}}function U(){let Z=j,H=Z.monotonic(),Q=[];return{mark(G){let Y=Z.monotonic();if(Q.length>0){let F=Q[Q.length-1];F.durationMs=Y-F._startedAt,delete F._startedAt}Q.push({name:G,_startedAt:Y})},end(){let G=Z.monotonic();if(Q.length>0){let Y=Q[Q.length-1];Y.durationMs=G-Y._startedAt,delete Y._startedAt}return{total:G-H,segments:Q}}}}return{inspect:N,summarize:M,dumpTemplate:D,profile:R,profileAsync:J,timer:U}}};var jZ={name:"htmlEntities",version:"1.0.0",type:"fw.io.text",dependencies:[],factory(){let j=JSON.parse('{"AElig":"Æ","AMP":"&","Aacute":"Á","Abreve":"Ă","Acirc":"Â","Acy":"А","Afr":"\uD835\uDD04","Agrave":"À","Alpha":"Α","Amacr":"Ā","And":"⩓","Aogon":"Ą","Aopf":"\uD835\uDD38","ApplyFunction":"⁡","Aring":"Å","Ascr":"\uD835\uDC9C","Assign":"≔","Atilde":"Ã","Auml":"Ä","Backslash":"∖","Barv":"⫧","Barwed":"⌆","Bcy":"Б","Because":"∵","Bernoullis":"ℬ","Beta":"Β","Bfr":"\uD835\uDD05","Bopf":"\uD835\uDD39","Breve":"˘","Bscr":"ℬ","Bumpeq":"≎","CHcy":"Ч","COPY":"©","Cacute":"Ć","Cap":"⋒","CapitalDifferentialD":"ⅅ","Cayleys":"ℭ","Ccaron":"Č","Ccedil":"Ç","Ccirc":"Ĉ","Cconint":"∰","Cdot":"Ċ","Cedilla":"¸","CenterDot":"·","Cfr":"ℭ","Chi":"Χ","CircleDot":"⊙","CircleMinus":"⊖","CirclePlus":"⊕","CircleTimes":"⊗","ClockwiseContourIntegral":"∲","CloseCurlyDoubleQuote":"”","CloseCurlyQuote":"’","Colon":"∷","Colone":"⩴","Congruent":"≡","Conint":"∯","ContourIntegral":"∮","Copf":"ℂ","Coproduct":"∐","CounterClockwiseContourIntegral":"∳","Cross":"⨯","Cscr":"\uD835\uDC9E","Cup":"⋓","CupCap":"≍","DD":"ⅅ","DDotrahd":"⤑","DJcy":"Ђ","DScy":"Ѕ","DZcy":"Џ","Dagger":"‡","Darr":"↡","Dashv":"⫤","Dcaron":"Ď","Dcy":"Д","Del":"∇","Delta":"Δ","Dfr":"\uD835\uDD07","DiacriticalAcute":"´","DiacriticalDot":"˙","DiacriticalDoubleAcute":"˝","DiacriticalGrave":"`","DiacriticalTilde":"˜","Diamond":"⋄","DifferentialD":"ⅆ","Dopf":"\uD835\uDD3B","Dot":"¨","DotDot":"⃜","DotEqual":"≐","DoubleContourIntegral":"∯","DoubleDot":"¨","DoubleDownArrow":"⇓","DoubleLeftArrow":"⇐","DoubleLeftRightArrow":"⇔","DoubleLeftTee":"⫤","DoubleLongLeftArrow":"⟸","DoubleLongLeftRightArrow":"⟺","DoubleLongRightArrow":"⟹","DoubleRightArrow":"⇒","DoubleRightTee":"⊨","DoubleUpArrow":"⇑","DoubleUpDownArrow":"⇕","DoubleVerticalBar":"∥","DownArrow":"↓","DownArrowBar":"⤓","DownArrowUpArrow":"⇵","DownBreve":"̑","DownLeftRightVector":"⥐","DownLeftTeeVector":"⥞","DownLeftVector":"↽","DownLeftVectorBar":"⥖","DownRightTeeVector":"⥟","DownRightVector":"⇁","DownRightVectorBar":"⥗","DownTee":"⊤","DownTeeArrow":"↧","Downarrow":"⇓","Dscr":"\uD835\uDC9F","Dstrok":"Đ","ENG":"Ŋ","ETH":"Ð","Eacute":"É","Ecaron":"Ě","Ecirc":"Ê","Ecy":"Э","Edot":"Ė","Efr":"\uD835\uDD08","Egrave":"È","Element":"∈","Emacr":"Ē","EmptySmallSquare":"◻","EmptyVerySmallSquare":"▫","Eogon":"Ę","Eopf":"\uD835\uDD3C","Epsilon":"Ε","Equal":"⩵","EqualTilde":"≂","Equilibrium":"⇌","Escr":"ℰ","Esim":"⩳","Eta":"Η","Euml":"Ë","Exists":"∃","ExponentialE":"ⅇ","Fcy":"Ф","Ffr":"\uD835\uDD09","FilledSmallSquare":"◼","FilledVerySmallSquare":"▪","Fopf":"\uD835\uDD3D","ForAll":"∀","Fouriertrf":"ℱ","Fscr":"ℱ","GJcy":"Ѓ","GT":">","Gamma":"Γ","Gammad":"Ϝ","Gbreve":"Ğ","Gcedil":"Ģ","Gcirc":"Ĝ","Gcy":"Г","Gdot":"Ġ","Gfr":"\uD835\uDD0A","Gg":"⋙","Gopf":"\uD835\uDD3E","GreaterEqual":"≥","GreaterEqualLess":"⋛","GreaterFullEqual":"≧","GreaterGreater":"⪢","GreaterLess":"≷","GreaterSlantEqual":"⩾","GreaterTilde":"≳","Gscr":"\uD835\uDCA2","Gt":"≫","HARDcy":"Ъ","Hacek":"ˇ","Hat":"^","Hcirc":"Ĥ","Hfr":"ℌ","HilbertSpace":"ℋ","Hopf":"ℍ","HorizontalLine":"─","Hscr":"ℋ","Hstrok":"Ħ","HumpDownHump":"≎","HumpEqual":"≏","IEcy":"Е","IJlig":"IJ","IOcy":"Ё","Iacute":"Í","Icirc":"Î","Icy":"И","Idot":"İ","Ifr":"ℑ","Igrave":"Ì","Im":"ℑ","Imacr":"Ī","ImaginaryI":"ⅈ","Implies":"⇒","Int":"∬","Integral":"∫","Intersection":"⋂","InvisibleComma":"⁣","InvisibleTimes":"⁢","Iogon":"Į","Iopf":"\uD835\uDD40","Iota":"Ι","Iscr":"ℐ","Itilde":"Ĩ","Iukcy":"І","Iuml":"Ï","Jcirc":"Ĵ","Jcy":"Й","Jfr":"\uD835\uDD0D","Jopf":"\uD835\uDD41","Jscr":"\uD835\uDCA5","Jsercy":"Ј","Jukcy":"Є","KHcy":"Х","KJcy":"Ќ","Kappa":"Κ","Kcedil":"Ķ","Kcy":"К","Kfr":"\uD835\uDD0E","Kopf":"\uD835\uDD42","Kscr":"\uD835\uDCA6","LJcy":"Љ","LT":"<","Lacute":"Ĺ","Lambda":"Λ","Lang":"⟪","Laplacetrf":"ℒ","Larr":"↞","Lcaron":"Ľ","Lcedil":"Ļ","Lcy":"Л","LeftAngleBracket":"⟨","LeftArrow":"←","LeftArrowBar":"⇤","LeftArrowRightArrow":"⇆","LeftCeiling":"⌈","LeftDoubleBracket":"⟦","LeftDownTeeVector":"⥡","LeftDownVector":"⇃","LeftDownVectorBar":"⥙","LeftFloor":"⌊","LeftRightArrow":"↔","LeftRightVector":"⥎","LeftTee":"⊣","LeftTeeArrow":"↤","LeftTeeVector":"⥚","LeftTriangle":"⊲","LeftTriangleBar":"⧏","LeftTriangleEqual":"⊴","LeftUpDownVector":"⥑","LeftUpTeeVector":"⥠","LeftUpVector":"↿","LeftUpVectorBar":"⥘","LeftVector":"↼","LeftVectorBar":"⥒","Leftarrow":"⇐","Leftrightarrow":"⇔","LessEqualGreater":"⋚","LessFullEqual":"≦","LessGreater":"≶","LessLess":"⪡","LessSlantEqual":"⩽","LessTilde":"≲","Lfr":"\uD835\uDD0F","Ll":"⋘","Lleftarrow":"⇚","Lmidot":"Ŀ","LongLeftArrow":"⟵","LongLeftRightArrow":"⟷","LongRightArrow":"⟶","Longleftarrow":"⟸","Longleftrightarrow":"⟺","Longrightarrow":"⟹","Lopf":"\uD835\uDD43","LowerLeftArrow":"↙","LowerRightArrow":"↘","Lscr":"ℒ","Lsh":"↰","Lstrok":"Ł","Lt":"≪","Map":"⤅","Mcy":"М","MediumSpace":" ","Mellintrf":"ℳ","Mfr":"\uD835\uDD10","MinusPlus":"∓","Mopf":"\uD835\uDD44","Mscr":"ℳ","Mu":"Μ","NJcy":"Њ","Nacute":"Ń","Ncaron":"Ň","Ncedil":"Ņ","Ncy":"Н","NegativeMediumSpace":"​","NegativeThickSpace":"​","NegativeThinSpace":"​","NegativeVeryThinSpace":"​","NestedGreaterGreater":"≫","NestedLessLess":"≪","NewLine":"\\n","Nfr":"\uD835\uDD11","NoBreak":"⁠","NonBreakingSpace":" ","Nopf":"ℕ","Not":"⫬","NotCongruent":"≢","NotCupCap":"≭","NotDoubleVerticalBar":"∦","NotElement":"∉","NotEqual":"≠","NotEqualTilde":"≂̸","NotExists":"∄","NotGreater":"≯","NotGreaterEqual":"≱","NotGreaterFullEqual":"≧̸","NotGreaterGreater":"≫̸","NotGreaterLess":"≹","NotGreaterSlantEqual":"⩾̸","NotGreaterTilde":"≵","NotHumpDownHump":"≎̸","NotHumpEqual":"≏̸","NotLeftTriangle":"⋪","NotLeftTriangleBar":"⧏̸","NotLeftTriangleEqual":"⋬","NotLess":"≮","NotLessEqual":"≰","NotLessGreater":"≸","NotLessLess":"≪̸","NotLessSlantEqual":"⩽̸","NotLessTilde":"≴","NotNestedGreaterGreater":"⪢̸","NotNestedLessLess":"⪡̸","NotPrecedes":"⊀","NotPrecedesEqual":"⪯̸","NotPrecedesSlantEqual":"⋠","NotReverseElement":"∌","NotRightTriangle":"⋫","NotRightTriangleBar":"⧐̸","NotRightTriangleEqual":"⋭","NotSquareSubset":"⊏̸","NotSquareSubsetEqual":"⋢","NotSquareSuperset":"⊐̸","NotSquareSupersetEqual":"⋣","NotSubset":"⊂⃒","NotSubsetEqual":"⊈","NotSucceeds":"⊁","NotSucceedsEqual":"⪰̸","NotSucceedsSlantEqual":"⋡","NotSucceedsTilde":"≿̸","NotSuperset":"⊃⃒","NotSupersetEqual":"⊉","NotTilde":"≁","NotTildeEqual":"≄","NotTildeFullEqual":"≇","NotTildeTilde":"≉","NotVerticalBar":"∤","Nscr":"\uD835\uDCA9","Ntilde":"Ñ","Nu":"Ν","OElig":"Œ","Oacute":"Ó","Ocirc":"Ô","Ocy":"О","Odblac":"Ő","Ofr":"\uD835\uDD12","Ograve":"Ò","Omacr":"Ō","Omega":"Ω","Omicron":"Ο","Oopf":"\uD835\uDD46","OpenCurlyDoubleQuote":"“","OpenCurlyQuote":"‘","Or":"⩔","Oscr":"\uD835\uDCAA","Oslash":"Ø","Otilde":"Õ","Otimes":"⨷","Ouml":"Ö","OverBar":"‾","OverBrace":"⏞","OverBracket":"⎴","OverParenthesis":"⏜","PartialD":"∂","Pcy":"П","Pfr":"\uD835\uDD13","Phi":"Φ","Pi":"Π","PlusMinus":"±","Poincareplane":"ℌ","Popf":"ℙ","Pr":"⪻","Precedes":"≺","PrecedesEqual":"⪯","PrecedesSlantEqual":"≼","PrecedesTilde":"≾","Prime":"″","Product":"∏","Proportion":"∷","Proportional":"∝","Pscr":"\uD835\uDCAB","Psi":"Ψ","QUOT":"\\"","Qfr":"\uD835\uDD14","Qopf":"ℚ","Qscr":"\uD835\uDCAC","RBarr":"⤐","REG":"®","Racute":"Ŕ","Rang":"⟫","Rarr":"↠","Rarrtl":"⤖","Rcaron":"Ř","Rcedil":"Ŗ","Rcy":"Р","Re":"ℜ","ReverseElement":"∋","ReverseEquilibrium":"⇋","ReverseUpEquilibrium":"⥯","Rfr":"ℜ","Rho":"Ρ","RightAngleBracket":"⟩","RightArrow":"→","RightArrowBar":"⇥","RightArrowLeftArrow":"⇄","RightCeiling":"⌉","RightDoubleBracket":"⟧","RightDownTeeVector":"⥝","RightDownVector":"⇂","RightDownVectorBar":"⥕","RightFloor":"⌋","RightTee":"⊢","RightTeeArrow":"↦","RightTeeVector":"⥛","RightTriangle":"⊳","RightTriangleBar":"⧐","RightTriangleEqual":"⊵","RightUpDownVector":"⥏","RightUpTeeVector":"⥜","RightUpVector":"↾","RightUpVectorBar":"⥔","RightVector":"⇀","RightVectorBar":"⥓","Rightarrow":"⇒","Ropf":"ℝ","RoundImplies":"⥰","Rrightarrow":"⇛","Rscr":"ℛ","Rsh":"↱","RuleDelayed":"⧴","SHCHcy":"Щ","SHcy":"Ш","SOFTcy":"Ь","Sacute":"Ś","Sc":"⪼","Scaron":"Š","Scedil":"Ş","Scirc":"Ŝ","Scy":"С","Sfr":"\uD835\uDD16","ShortDownArrow":"↓","ShortLeftArrow":"←","ShortRightArrow":"→","ShortUpArrow":"↑","Sigma":"Σ","SmallCircle":"∘","Sopf":"\uD835\uDD4A","Sqrt":"√","Square":"□","SquareIntersection":"⊓","SquareSubset":"⊏","SquareSubsetEqual":"⊑","SquareSuperset":"⊐","SquareSupersetEqual":"⊒","SquareUnion":"⊔","Sscr":"\uD835\uDCAE","Star":"⋆","Sub":"⋐","Subset":"⋐","SubsetEqual":"⊆","Succeeds":"≻","SucceedsEqual":"⪰","SucceedsSlantEqual":"≽","SucceedsTilde":"≿","SuchThat":"∋","Sum":"∑","Sup":"⋑","Superset":"⊃","SupersetEqual":"⊇","Supset":"⋑","THORN":"Þ","TRADE":"™","TSHcy":"Ћ","TScy":"Ц","Tab":"\\t","Tau":"Τ","Tcaron":"Ť","Tcedil":"Ţ","Tcy":"Т","Tfr":"\uD835\uDD17","Therefore":"∴","Theta":"Θ","ThickSpace":"  ","ThinSpace":" ","Tilde":"∼","TildeEqual":"≃","TildeFullEqual":"≅","TildeTilde":"≈","Topf":"\uD835\uDD4B","TripleDot":"⃛","Tscr":"\uD835\uDCAF","Tstrok":"Ŧ","Uacute":"Ú","Uarr":"↟","Uarrocir":"⥉","Ubrcy":"Ў","Ubreve":"Ŭ","Ucirc":"Û","Ucy":"У","Udblac":"Ű","Ufr":"\uD835\uDD18","Ugrave":"Ù","Umacr":"Ū","UnderBar":"_","UnderBrace":"⏟","UnderBracket":"⎵","UnderParenthesis":"⏝","Union":"⋃","UnionPlus":"⊎","Uogon":"Ų","Uopf":"\uD835\uDD4C","UpArrow":"↑","UpArrowBar":"⤒","UpArrowDownArrow":"⇅","UpDownArrow":"↕","UpEquilibrium":"⥮","UpTee":"⊥","UpTeeArrow":"↥","Uparrow":"⇑","Updownarrow":"⇕","UpperLeftArrow":"↖","UpperRightArrow":"↗","Upsi":"ϒ","Upsilon":"Υ","Uring":"Ů","Uscr":"\uD835\uDCB0","Utilde":"Ũ","Uuml":"Ü","VDash":"⊫","Vbar":"⫫","Vcy":"В","Vdash":"⊩","Vdashl":"⫦","Vee":"⋁","Verbar":"‖","Vert":"‖","VerticalBar":"∣","VerticalLine":"|","VerticalSeparator":"❘","VerticalTilde":"≀","VeryThinSpace":" ","Vfr":"\uD835\uDD19","Vopf":"\uD835\uDD4D","Vscr":"\uD835\uDCB1","Vvdash":"⊪","Wcirc":"Ŵ","Wedge":"⋀","Wfr":"\uD835\uDD1A","Wopf":"\uD835\uDD4E","Wscr":"\uD835\uDCB2","Xfr":"\uD835\uDD1B","Xi":"Ξ","Xopf":"\uD835\uDD4F","Xscr":"\uD835\uDCB3","YAcy":"Я","YIcy":"Ї","YUcy":"Ю","Yacute":"Ý","Ycirc":"Ŷ","Ycy":"Ы","Yfr":"\uD835\uDD1C","Yopf":"\uD835\uDD50","Yscr":"\uD835\uDCB4","Yuml":"Ÿ","ZHcy":"Ж","Zacute":"Ź","Zcaron":"Ž","Zcy":"З","Zdot":"Ż","ZeroWidthSpace":"​","Zeta":"Ζ","Zfr":"ℨ","Zopf":"ℤ","Zscr":"\uD835\uDCB5","aacute":"á","abreve":"ă","ac":"∾","acE":"∾̳","acd":"∿","acirc":"â","acute":"´","acy":"а","aelig":"æ","af":"⁡","afr":"\uD835\uDD1E","agrave":"à","alefsym":"ℵ","aleph":"ℵ","alpha":"α","amacr":"ā","amalg":"⨿","amp":"&","and":"∧","andand":"⩕","andd":"⩜","andslope":"⩘","andv":"⩚","ang":"∠","ange":"⦤","angle":"∠","angmsd":"∡","angmsdaa":"⦨","angmsdab":"⦩","angmsdac":"⦪","angmsdad":"⦫","angmsdae":"⦬","angmsdaf":"⦭","angmsdag":"⦮","angmsdah":"⦯","angrt":"∟","angrtvb":"⊾","angrtvbd":"⦝","angsph":"∢","angst":"Å","angzarr":"⍼","aogon":"ą","aopf":"\uD835\uDD52","ap":"≈","apE":"⩰","apacir":"⩯","ape":"≊","apid":"≋","apos":"\'","approx":"≈","approxeq":"≊","aring":"å","ascr":"\uD835\uDCB6","ast":"*","asymp":"≈","asympeq":"≍","atilde":"ã","auml":"ä","awconint":"∳","awint":"⨑","bNot":"⫭","backcong":"≌","backepsilon":"϶","backprime":"‵","backsim":"∽","backsimeq":"⋍","barvee":"⊽","barwed":"⌅","barwedge":"⌅","bbrk":"⎵","bbrktbrk":"⎶","bcong":"≌","bcy":"б","bdquo":"„","becaus":"∵","because":"∵","bemptyv":"⦰","bepsi":"϶","bernou":"ℬ","beta":"β","beth":"ℶ","between":"≬","bfr":"\uD835\uDD1F","bigcap":"⋂","bigcirc":"◯","bigcup":"⋃","bigodot":"⨀","bigoplus":"⨁","bigotimes":"⨂","bigsqcup":"⨆","bigstar":"★","bigtriangledown":"▽","bigtriangleup":"△","biguplus":"⨄","bigvee":"⋁","bigwedge":"⋀","bkarow":"⤍","blacklozenge":"⧫","blacksquare":"▪","blacktriangle":"▴","blacktriangledown":"▾","blacktriangleleft":"◂","blacktriangleright":"▸","blank":"␣","blk12":"▒","blk14":"░","blk34":"▓","block":"█","bne":"=⃥","bnequiv":"≡⃥","bnot":"⌐","bopf":"\uD835\uDD53","bot":"⊥","bottom":"⊥","bowtie":"⋈","boxDL":"╗","boxDR":"╔","boxDl":"╖","boxDr":"╓","boxH":"═","boxHD":"╦","boxHU":"╩","boxHd":"╤","boxHu":"╧","boxUL":"╝","boxUR":"╚","boxUl":"╜","boxUr":"╙","boxV":"║","boxVH":"╬","boxVL":"╣","boxVR":"╠","boxVh":"╫","boxVl":"╢","boxVr":"╟","boxbox":"⧉","boxdL":"╕","boxdR":"╒","boxdl":"┐","boxdr":"┌","boxh":"─","boxhD":"╥","boxhU":"╨","boxhd":"┬","boxhu":"┴","boxminus":"⊟","boxplus":"⊞","boxtimes":"⊠","boxuL":"╛","boxuR":"╘","boxul":"┘","boxur":"└","boxv":"│","boxvH":"╪","boxvL":"╡","boxvR":"╞","boxvh":"┼","boxvl":"┤","boxvr":"├","bprime":"‵","breve":"˘","brvbar":"¦","bscr":"\uD835\uDCB7","bsemi":"⁏","bsim":"∽","bsime":"⋍","bsol":"\\\\","bsolb":"⧅","bsolhsub":"⟈","bull":"•","bullet":"•","bump":"≎","bumpE":"⪮","bumpe":"≏","bumpeq":"≏","cacute":"ć","cap":"∩","capand":"⩄","capbrcup":"⩉","capcap":"⩋","capcup":"⩇","capdot":"⩀","caps":"∩︀","caret":"⁁","caron":"ˇ","ccaps":"⩍","ccaron":"č","ccedil":"ç","ccirc":"ĉ","ccups":"⩌","ccupssm":"⩐","cdot":"ċ","cedil":"¸","cemptyv":"⦲","cent":"¢","centerdot":"·","cfr":"\uD835\uDD20","chcy":"ч","check":"✓","checkmark":"✓","chi":"χ","cir":"○","cirE":"⧃","circ":"ˆ","circeq":"≗","circlearrowleft":"↺","circlearrowright":"↻","circledR":"®","circledS":"Ⓢ","circledast":"⊛","circledcirc":"⊚","circleddash":"⊝","cire":"≗","cirfnint":"⨐","cirmid":"⫯","cirscir":"⧂","clubs":"♣","clubsuit":"♣","colon":":","colone":"≔","coloneq":"≔","comma":",","commat":"@","comp":"∁","compfn":"∘","complement":"∁","complexes":"ℂ","cong":"≅","congdot":"⩭","conint":"∮","copf":"\uD835\uDD54","coprod":"∐","copy":"©","copysr":"℗","crarr":"↵","cross":"✗","cscr":"\uD835\uDCB8","csub":"⫏","csube":"⫑","csup":"⫐","csupe":"⫒","ctdot":"⋯","cudarrl":"⤸","cudarrr":"⤵","cuepr":"⋞","cuesc":"⋟","cularr":"↶","cularrp":"⤽","cup":"∪","cupbrcap":"⩈","cupcap":"⩆","cupcup":"⩊","cupdot":"⊍","cupor":"⩅","cups":"∪︀","curarr":"↷","curarrm":"⤼","curlyeqprec":"⋞","curlyeqsucc":"⋟","curlyvee":"⋎","curlywedge":"⋏","curren":"¤","curvearrowleft":"↶","curvearrowright":"↷","cuvee":"⋎","cuwed":"⋏","cwconint":"∲","cwint":"∱","cylcty":"⌭","dArr":"⇓","dHar":"⥥","dagger":"†","daleth":"ℸ","darr":"↓","dash":"‐","dashv":"⊣","dbkarow":"⤏","dblac":"˝","dcaron":"ď","dcy":"д","dd":"ⅆ","ddagger":"‡","ddarr":"⇊","ddotseq":"⩷","deg":"°","delta":"δ","demptyv":"⦱","dfisht":"⥿","dfr":"\uD835\uDD21","dharl":"⇃","dharr":"⇂","diam":"⋄","diamond":"⋄","diamondsuit":"♦","diams":"♦","die":"¨","digamma":"ϝ","disin":"⋲","div":"÷","divide":"÷","divideontimes":"⋇","divonx":"⋇","djcy":"ђ","dlcorn":"⌞","dlcrop":"⌍","dollar":"$","dopf":"\uD835\uDD55","dot":"˙","doteq":"≐","doteqdot":"≑","dotminus":"∸","dotplus":"∔","dotsquare":"⊡","doublebarwedge":"⌆","downarrow":"↓","downdownarrows":"⇊","downharpoonleft":"⇃","downharpoonright":"⇂","drbkarow":"⤐","drcorn":"⌟","drcrop":"⌌","dscr":"\uD835\uDCB9","dscy":"ѕ","dsol":"⧶","dstrok":"đ","dtdot":"⋱","dtri":"▿","dtrif":"▾","duarr":"⇵","duhar":"⥯","dwangle":"⦦","dzcy":"џ","dzigrarr":"⟿","eDDot":"⩷","eDot":"≑","eacute":"é","easter":"⩮","ecaron":"ě","ecir":"≖","ecirc":"ê","ecolon":"≕","ecy":"э","edot":"ė","ee":"ⅇ","efDot":"≒","efr":"\uD835\uDD22","eg":"⪚","egrave":"è","egs":"⪖","egsdot":"⪘","el":"⪙","elinters":"⏧","ell":"ℓ","els":"⪕","elsdot":"⪗","emacr":"ē","empty":"∅","emptyset":"∅","emptyv":"∅","emsp13":" ","emsp14":" ","emsp":" ","eng":"ŋ","ensp":" ","eogon":"ę","eopf":"\uD835\uDD56","epar":"⋕","eparsl":"⧣","eplus":"⩱","epsi":"ε","epsilon":"ε","epsiv":"ϵ","eqcirc":"≖","eqcolon":"≕","eqsim":"≂","eqslantgtr":"⪖","eqslantless":"⪕","equals":"=","equest":"≟","equiv":"≡","equivDD":"⩸","eqvparsl":"⧥","erDot":"≓","erarr":"⥱","escr":"ℯ","esdot":"≐","esim":"≂","eta":"η","eth":"ð","euml":"ë","euro":"€","excl":"!","exist":"∃","expectation":"ℰ","exponentiale":"ⅇ","fallingdotseq":"≒","fcy":"ф","female":"♀","ffilig":"ffi","fflig":"ff","ffllig":"ffl","ffr":"\uD835\uDD23","filig":"fi","fjlig":"fj","flat":"♭","fllig":"fl","fltns":"▱","fnof":"ƒ","fopf":"\uD835\uDD57","forall":"∀","fork":"⋔","forkv":"⫙","fpartint":"⨍","frac12":"½","frac13":"⅓","frac14":"¼","frac15":"⅕","frac16":"⅙","frac18":"⅛","frac23":"⅔","frac25":"⅖","frac34":"¾","frac35":"⅗","frac38":"⅜","frac45":"⅘","frac56":"⅚","frac58":"⅝","frac78":"⅞","frasl":"⁄","frown":"⌢","fscr":"\uD835\uDCBB","gE":"≧","gEl":"⪌","gacute":"ǵ","gamma":"γ","gammad":"ϝ","gap":"⪆","gbreve":"ğ","gcirc":"ĝ","gcy":"г","gdot":"ġ","ge":"≥","gel":"⋛","geq":"≥","geqq":"≧","geqslant":"⩾","ges":"⩾","gescc":"⪩","gesdot":"⪀","gesdoto":"⪂","gesdotol":"⪄","gesl":"⋛︀","gesles":"⪔","gfr":"\uD835\uDD24","gg":"≫","ggg":"⋙","gimel":"ℷ","gjcy":"ѓ","gl":"≷","glE":"⪒","gla":"⪥","glj":"⪤","gnE":"≩","gnap":"⪊","gnapprox":"⪊","gne":"⪈","gneq":"⪈","gneqq":"≩","gnsim":"⋧","gopf":"\uD835\uDD58","grave":"`","gscr":"ℊ","gsim":"≳","gsime":"⪎","gsiml":"⪐","gt":">","gtcc":"⪧","gtcir":"⩺","gtdot":"⋗","gtlPar":"⦕","gtquest":"⩼","gtrapprox":"⪆","gtrarr":"⥸","gtrdot":"⋗","gtreqless":"⋛","gtreqqless":"⪌","gtrless":"≷","gtrsim":"≳","gvertneqq":"≩︀","gvnE":"≩︀","hArr":"⇔","hairsp":" ","half":"½","hamilt":"ℋ","hardcy":"ъ","harr":"↔","harrcir":"⥈","harrw":"↭","hbar":"ℏ","hcirc":"ĥ","hearts":"♥","heartsuit":"♥","hellip":"…","hercon":"⊹","hfr":"\uD835\uDD25","hksearow":"⤥","hkswarow":"⤦","hoarr":"⇿","homtht":"∻","hookleftarrow":"↩","hookrightarrow":"↪","hopf":"\uD835\uDD59","horbar":"―","hscr":"\uD835\uDCBD","hslash":"ℏ","hstrok":"ħ","hybull":"⁃","hyphen":"‐","iacute":"í","ic":"⁣","icirc":"î","icy":"и","iecy":"е","iexcl":"¡","iff":"⇔","ifr":"\uD835\uDD26","igrave":"ì","ii":"ⅈ","iiiint":"⨌","iiint":"∭","iinfin":"⧜","iiota":"℩","ijlig":"ij","imacr":"ī","image":"ℑ","imagline":"ℐ","imagpart":"ℑ","imath":"ı","imof":"⊷","imped":"Ƶ","in":"∈","incare":"℅","infin":"∞","infintie":"⧝","inodot":"ı","int":"∫","intcal":"⊺","integers":"ℤ","intercal":"⊺","intlarhk":"⨗","intprod":"⨼","iocy":"ё","iogon":"į","iopf":"\uD835\uDD5A","iota":"ι","iprod":"⨼","iquest":"¿","iscr":"\uD835\uDCBE","isin":"∈","isinE":"⋹","isindot":"⋵","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"⁢","itilde":"ĩ","iukcy":"і","iuml":"ï","jcirc":"ĵ","jcy":"й","jfr":"\uD835\uDD27","jmath":"ȷ","jopf":"\uD835\uDD5B","jscr":"\uD835\uDCBF","jsercy":"ј","jukcy":"є","kappa":"κ","kappav":"ϰ","kcedil":"ķ","kcy":"к","kfr":"\uD835\uDD28","kgreen":"ĸ","khcy":"х","kjcy":"ќ","kopf":"\uD835\uDD5C","kscr":"\uD835\uDCC0","lAarr":"⇚","lArr":"⇐","lAtail":"⤛","lBarr":"⤎","lE":"≦","lEg":"⪋","lHar":"⥢","lacute":"ĺ","laemptyv":"⦴","lagran":"ℒ","lambda":"λ","lang":"⟨","langd":"⦑","langle":"⟨","lap":"⪅","laquo":"«","larr":"←","larrb":"⇤","larrbfs":"⤟","larrfs":"⤝","larrhk":"↩","larrlp":"↫","larrpl":"⤹","larrsim":"⥳","larrtl":"↢","lat":"⪫","latail":"⤙","late":"⪭","lates":"⪭︀","lbarr":"⤌","lbbrk":"❲","lbrace":"{","lbrack":"[","lbrke":"⦋","lbrksld":"⦏","lbrkslu":"⦍","lcaron":"ľ","lcedil":"ļ","lceil":"⌈","lcub":"{","lcy":"л","ldca":"⤶","ldquo":"“","ldquor":"„","ldrdhar":"⥧","ldrushar":"⥋","ldsh":"↲","le":"≤","leftarrow":"←","leftarrowtail":"↢","leftharpoondown":"↽","leftharpoonup":"↼","leftleftarrows":"⇇","leftrightarrow":"↔","leftrightarrows":"⇆","leftrightharpoons":"⇋","leftrightsquigarrow":"↭","leftthreetimes":"⋋","leg":"⋚","leq":"≤","leqq":"≦","leqslant":"⩽","les":"⩽","lescc":"⪨","lesdot":"⩿","lesdoto":"⪁","lesdotor":"⪃","lesg":"⋚︀","lesges":"⪓","lessapprox":"⪅","lessdot":"⋖","lesseqgtr":"⋚","lesseqqgtr":"⪋","lessgtr":"≶","lesssim":"≲","lfisht":"⥼","lfloor":"⌊","lfr":"\uD835\uDD29","lg":"≶","lgE":"⪑","lhard":"↽","lharu":"↼","lharul":"⥪","lhblk":"▄","ljcy":"љ","ll":"≪","llarr":"⇇","llcorner":"⌞","llhard":"⥫","lltri":"◺","lmidot":"ŀ","lmoust":"⎰","lmoustache":"⎰","lnE":"≨","lnap":"⪉","lnapprox":"⪉","lne":"⪇","lneq":"⪇","lneqq":"≨","lnsim":"⋦","loang":"⟬","loarr":"⇽","lobrk":"⟦","longleftarrow":"⟵","longleftrightarrow":"⟷","longmapsto":"⟼","longrightarrow":"⟶","looparrowleft":"↫","looparrowright":"↬","lopar":"⦅","lopf":"\uD835\uDD5D","loplus":"⨭","lotimes":"⨴","lowast":"∗","lowbar":"_","loz":"◊","lozenge":"◊","lozf":"⧫","lpar":"(","lparlt":"⦓","lrarr":"⇆","lrcorner":"⌟","lrhar":"⇋","lrhard":"⥭","lrm":"‎","lrtri":"⊿","lsaquo":"‹","lscr":"\uD835\uDCC1","lsh":"↰","lsim":"≲","lsime":"⪍","lsimg":"⪏","lsqb":"[","lsquo":"‘","lsquor":"‚","lstrok":"ł","lt":"<","ltcc":"⪦","ltcir":"⩹","ltdot":"⋖","lthree":"⋋","ltimes":"⋉","ltlarr":"⥶","ltquest":"⩻","ltrPar":"⦖","ltri":"◃","ltrie":"⊴","ltrif":"◂","lurdshar":"⥊","luruhar":"⥦","lvertneqq":"≨︀","lvnE":"≨︀","mDDot":"∺","macr":"¯","male":"♂","malt":"✠","maltese":"✠","map":"↦","mapsto":"↦","mapstodown":"↧","mapstoleft":"↤","mapstoup":"↥","marker":"▮","mcomma":"⨩","mcy":"м","mdash":"-","measuredangle":"∡","mfr":"\uD835\uDD2A","mho":"℧","micro":"µ","mid":"∣","midast":"*","midcir":"⫰","middot":"·","minus":"−","minusb":"⊟","minusd":"∸","minusdu":"⨪","mlcp":"⫛","mldr":"…","mnplus":"∓","models":"⊧","mopf":"\uD835\uDD5E","mp":"∓","mscr":"\uD835\uDCC2","mstpos":"∾","mu":"μ","multimap":"⊸","mumap":"⊸","nGg":"⋙̸","nGt":"≫⃒","nGtv":"≫̸","nLeftarrow":"⇍","nLeftrightarrow":"⇎","nLl":"⋘̸","nLt":"≪⃒","nLtv":"≪̸","nRightarrow":"⇏","nVDash":"⊯","nVdash":"⊮","nabla":"∇","nacute":"ń","nang":"∠⃒","nap":"≉","napE":"⩰̸","napid":"≋̸","napos":"ʼn","napprox":"≉","natur":"♮","natural":"♮","naturals":"ℕ","nbsp":" ","nbump":"≎̸","nbumpe":"≏̸","ncap":"⩃","ncaron":"ň","ncedil":"ņ","ncong":"≇","ncongdot":"⩭̸","ncup":"⩂","ncy":"н","ndash":"–","ne":"≠","neArr":"⇗","nearhk":"⤤","nearr":"↗","nearrow":"↗","nedot":"≐̸","nequiv":"≢","nesear":"⤨","nesim":"≂̸","nexist":"∄","nexists":"∄","nfr":"\uD835\uDD2B","ngE":"≧̸","nge":"≱","ngeq":"≱","ngeqq":"≧̸","ngeqslant":"⩾̸","nges":"⩾̸","ngsim":"≵","ngt":"≯","ngtr":"≯","nhArr":"⇎","nharr":"↮","nhpar":"⫲","ni":"∋","nis":"⋼","nisd":"⋺","niv":"∋","njcy":"њ","nlArr":"⇍","nlE":"≦̸","nlarr":"↚","nldr":"‥","nle":"≰","nleftarrow":"↚","nleftrightarrow":"↮","nleq":"≰","nleqq":"≦̸","nleqslant":"⩽̸","nles":"⩽̸","nless":"≮","nlsim":"≴","nlt":"≮","nltri":"⋪","nltrie":"⋬","nmid":"∤","nopf":"\uD835\uDD5F","not":"¬","notin":"∉","notinE":"⋹̸","notindot":"⋵̸","notinva":"∉","notinvb":"⋷","notinvc":"⋶","notni":"∌","notniva":"∌","notnivb":"⋾","notnivc":"⋽","npar":"∦","nparallel":"∦","nparsl":"⫽⃥","npart":"∂̸","npolint":"⨔","npr":"⊀","nprcue":"⋠","npre":"⪯̸","nprec":"⊀","npreceq":"⪯̸","nrArr":"⇏","nrarr":"↛","nrarrc":"⤳̸","nrarrw":"↝̸","nrightarrow":"↛","nrtri":"⋫","nrtrie":"⋭","nsc":"⊁","nsccue":"⋡","nsce":"⪰̸","nscr":"\uD835\uDCC3","nshortmid":"∤","nshortparallel":"∦","nsim":"≁","nsime":"≄","nsimeq":"≄","nsmid":"∤","nspar":"∦","nsqsube":"⋢","nsqsupe":"⋣","nsub":"⊄","nsubE":"⫅̸","nsube":"⊈","nsubset":"⊂⃒","nsubseteq":"⊈","nsubseteqq":"⫅̸","nsucc":"⊁","nsucceq":"⪰̸","nsup":"⊅","nsupE":"⫆̸","nsupe":"⊉","nsupset":"⊃⃒","nsupseteq":"⊉","nsupseteqq":"⫆̸","ntgl":"≹","ntilde":"ñ","ntlg":"≸","ntriangleleft":"⋪","ntrianglelefteq":"⋬","ntriangleright":"⋫","ntrianglerighteq":"⋭","nu":"ν","num":"#","numero":"№","numsp":" ","nvDash":"⊭","nvHarr":"⤄","nvap":"≍⃒","nvdash":"⊬","nvge":"≥⃒","nvgt":">⃒","nvinfin":"⧞","nvlArr":"⤂","nvle":"≤⃒","nvlt":"<⃒","nvltrie":"⊴⃒","nvrArr":"⤃","nvrtrie":"⊵⃒","nvsim":"∼⃒","nwArr":"⇖","nwarhk":"⤣","nwarr":"↖","nwarrow":"↖","nwnear":"⤧","oS":"Ⓢ","oacute":"ó","oast":"⊛","ocir":"⊚","ocirc":"ô","ocy":"о","odash":"⊝","odblac":"ő","odiv":"⨸","odot":"⊙","odsold":"⦼","oelig":"œ","ofcir":"⦿","ofr":"\uD835\uDD2C","ogon":"˛","ograve":"ò","ogt":"⧁","ohbar":"⦵","ohm":"Ω","oint":"∮","olarr":"↺","olcir":"⦾","olcross":"⦻","oline":"‾","olt":"⧀","omacr":"ō","omega":"ω","omicron":"ο","omid":"⦶","ominus":"⊖","oopf":"\uD835\uDD60","opar":"⦷","operp":"⦹","oplus":"⊕","or":"∨","orarr":"↻","ord":"⩝","order":"ℴ","orderof":"ℴ","ordf":"ª","ordm":"º","origof":"⊶","oror":"⩖","orslope":"⩗","orv":"⩛","oscr":"ℴ","oslash":"ø","osol":"⊘","otilde":"õ","otimes":"⊗","otimesas":"⨶","ouml":"ö","ovbar":"⌽","par":"∥","para":"¶","parallel":"∥","parsim":"⫳","parsl":"⫽","part":"∂","pcy":"п","percnt":"%","period":".","permil":"‰","perp":"⊥","pertenk":"‱","pfr":"\uD835\uDD2D","phi":"φ","phiv":"ϕ","phmmat":"ℳ","phone":"☎","pi":"π","pitchfork":"⋔","piv":"ϖ","planck":"ℏ","planckh":"ℎ","plankv":"ℏ","plus":"+","plusacir":"⨣","plusb":"⊞","pluscir":"⨢","plusdo":"∔","plusdu":"⨥","pluse":"⩲","plusmn":"±","plussim":"⨦","plustwo":"⨧","pm":"±","pointint":"⨕","popf":"\uD835\uDD61","pound":"£","pr":"≺","prE":"⪳","prap":"⪷","prcue":"≼","pre":"⪯","prec":"≺","precapprox":"⪷","preccurlyeq":"≼","preceq":"⪯","precnapprox":"⪹","precneqq":"⪵","precnsim":"⋨","precsim":"≾","prime":"′","primes":"ℙ","prnE":"⪵","prnap":"⪹","prnsim":"⋨","prod":"∏","profalar":"⌮","profline":"⌒","profsurf":"⌓","prop":"∝","propto":"∝","prsim":"≾","prurel":"⊰","pscr":"\uD835\uDCC5","psi":"ψ","puncsp":" ","qfr":"\uD835\uDD2E","qint":"⨌","qopf":"\uD835\uDD62","qprime":"⁗","qscr":"\uD835\uDCC6","quaternions":"ℍ","quatint":"⨖","quest":"?","questeq":"≟","quot":"\\"","rAarr":"⇛","rArr":"⇒","rAtail":"⤜","rBarr":"⤏","rHar":"⥤","race":"∽̱","racute":"ŕ","radic":"√","raemptyv":"⦳","rang":"⟩","rangd":"⦒","range":"⦥","rangle":"⟩","raquo":"»","rarr":"→","rarrap":"⥵","rarrb":"⇥","rarrbfs":"⤠","rarrc":"⤳","rarrfs":"⤞","rarrhk":"↪","rarrlp":"↬","rarrpl":"⥅","rarrsim":"⥴","rarrtl":"↣","rarrw":"↝","ratail":"⤚","ratio":"∶","rationals":"ℚ","rbarr":"⤍","rbbrk":"❳","rbrace":"}","rbrack":"]","rbrke":"⦌","rbrksld":"⦎","rbrkslu":"⦐","rcaron":"ř","rcedil":"ŗ","rceil":"⌉","rcub":"}","rcy":"р","rdca":"⤷","rdldhar":"⥩","rdquo":"”","rdquor":"”","rdsh":"↳","real":"ℜ","realine":"ℛ","realpart":"ℜ","reals":"ℝ","rect":"▭","reg":"®","rfisht":"⥽","rfloor":"⌋","rfr":"\uD835\uDD2F","rhard":"⇁","rharu":"⇀","rharul":"⥬","rho":"ρ","rhov":"ϱ","rightarrow":"→","rightarrowtail":"↣","rightharpoondown":"⇁","rightharpoonup":"⇀","rightleftarrows":"⇄","rightleftharpoons":"⇌","rightrightarrows":"⇉","rightsquigarrow":"↝","rightthreetimes":"⋌","ring":"˚","risingdotseq":"≓","rlarr":"⇄","rlhar":"⇌","rlm":"‏","rmoust":"⎱","rmoustache":"⎱","rnmid":"⫮","roang":"⟭","roarr":"⇾","robrk":"⟧","ropar":"⦆","ropf":"\uD835\uDD63","roplus":"⨮","rotimes":"⨵","rpar":")","rpargt":"⦔","rppolint":"⨒","rrarr":"⇉","rsaquo":"›","rscr":"\uD835\uDCC7","rsh":"↱","rsqb":"]","rsquo":"’","rsquor":"’","rthree":"⋌","rtimes":"⋊","rtri":"▹","rtrie":"⊵","rtrif":"▸","rtriltri":"⧎","ruluhar":"⥨","rx":"℞","sacute":"ś","sbquo":"‚","sc":"≻","scE":"⪴","scap":"⪸","scaron":"š","sccue":"≽","sce":"⪰","scedil":"ş","scirc":"ŝ","scnE":"⪶","scnap":"⪺","scnsim":"⋩","scpolint":"⨓","scsim":"≿","scy":"с","sdot":"⋅","sdotb":"⊡","sdote":"⩦","seArr":"⇘","searhk":"⤥","searr":"↘","searrow":"↘","sect":"§","semi":";","seswar":"⤩","setminus":"∖","setmn":"∖","sext":"✶","sfr":"\uD835\uDD30","sfrown":"⌢","sharp":"♯","shchcy":"щ","shcy":"ш","shortmid":"∣","shortparallel":"∥","shy":"­","sigma":"σ","sigmaf":"ς","sigmav":"ς","sim":"∼","simdot":"⩪","sime":"≃","simeq":"≃","simg":"⪞","simgE":"⪠","siml":"⪝","simlE":"⪟","simne":"≆","simplus":"⨤","simrarr":"⥲","slarr":"←","smallsetminus":"∖","smashp":"⨳","smeparsl":"⧤","smid":"∣","smile":"⌣","smt":"⪪","smte":"⪬","smtes":"⪬︀","softcy":"ь","sol":"/","solb":"⧄","solbar":"⌿","sopf":"\uD835\uDD64","spades":"♠","spadesuit":"♠","spar":"∥","sqcap":"⊓","sqcaps":"⊓︀","sqcup":"⊔","sqcups":"⊔︀","sqsub":"⊏","sqsube":"⊑","sqsubset":"⊏","sqsubseteq":"⊑","sqsup":"⊐","sqsupe":"⊒","sqsupset":"⊐","sqsupseteq":"⊒","squ":"□","square":"□","squarf":"▪","squf":"▪","srarr":"→","sscr":"\uD835\uDCC8","ssetmn":"∖","ssmile":"⌣","sstarf":"⋆","star":"☆","starf":"★","straightepsilon":"ϵ","straightphi":"ϕ","strns":"¯","sub":"⊂","subE":"⫅","subdot":"⪽","sube":"⊆","subedot":"⫃","submult":"⫁","subnE":"⫋","subne":"⊊","subplus":"⪿","subrarr":"⥹","subset":"⊂","subseteq":"⊆","subseteqq":"⫅","subsetneq":"⊊","subsetneqq":"⫋","subsim":"⫇","subsub":"⫕","subsup":"⫓","succ":"≻","succapprox":"⪸","succcurlyeq":"≽","succeq":"⪰","succnapprox":"⪺","succneqq":"⪶","succnsim":"⋩","succsim":"≿","sum":"∑","sung":"♪","sup1":"¹","sup2":"²","sup3":"³","sup":"⊃","supE":"⫆","supdot":"⪾","supdsub":"⫘","supe":"⊇","supedot":"⫄","suphsol":"⟉","suphsub":"⫗","suplarr":"⥻","supmult":"⫂","supnE":"⫌","supne":"⊋","supplus":"⫀","supset":"⊃","supseteq":"⊇","supseteqq":"⫆","supsetneq":"⊋","supsetneqq":"⫌","supsim":"⫈","supsub":"⫔","supsup":"⫖","swArr":"⇙","swarhk":"⤦","swarr":"↙","swarrow":"↙","swnwar":"⤪","szlig":"ß","target":"⌖","tau":"τ","tbrk":"⎴","tcaron":"ť","tcedil":"ţ","tcy":"т","tdot":"⃛","telrec":"⌕","tfr":"\uD835\uDD31","there4":"∴","therefore":"∴","theta":"θ","thetasym":"ϑ","thetav":"ϑ","thickapprox":"≈","thicksim":"∼","thinsp":" ","thkap":"≈","thksim":"∼","thorn":"þ","tilde":"˜","times":"×","timesb":"⊠","timesbar":"⨱","timesd":"⨰","tint":"∭","toea":"⤨","top":"⊤","topbot":"⌶","topcir":"⫱","topf":"\uD835\uDD65","topfork":"⫚","tosa":"⤩","tprime":"‴","trade":"™","triangle":"▵","triangledown":"▿","triangleleft":"◃","trianglelefteq":"⊴","triangleq":"≜","triangleright":"▹","trianglerighteq":"⊵","tridot":"◬","trie":"≜","triminus":"⨺","triplus":"⨹","trisb":"⧍","tritime":"⨻","trpezium":"⏢","tscr":"\uD835\uDCC9","tscy":"ц","tshcy":"ћ","tstrok":"ŧ","twixt":"≬","twoheadleftarrow":"↞","twoheadrightarrow":"↠","uArr":"⇑","uHar":"⥣","uacute":"ú","uarr":"↑","ubrcy":"ў","ubreve":"ŭ","ucirc":"û","ucy":"у","udarr":"⇅","udblac":"ű","udhar":"⥮","ufisht":"⥾","ufr":"\uD835\uDD32","ugrave":"ù","uharl":"↿","uharr":"↾","uhblk":"▀","ulcorn":"⌜","ulcorner":"⌜","ulcrop":"⌏","ultri":"◸","umacr":"ū","uml":"¨","uogon":"ų","uopf":"\uD835\uDD66","uparrow":"↑","updownarrow":"↕","upharpoonleft":"↿","upharpoonright":"↾","uplus":"⊎","upsi":"υ","upsih":"ϒ","upsilon":"υ","upuparrows":"⇈","urcorn":"⌝","urcorner":"⌝","urcrop":"⌎","uring":"ů","urtri":"◹","uscr":"\uD835\uDCCA","utdot":"⋰","utilde":"ũ","utri":"▵","utrif":"▴","uuarr":"⇈","uuml":"ü","uwangle":"⦧","vArr":"⇕","vBar":"⫨","vBarv":"⫩","vDash":"⊨","vangrt":"⦜","varepsilon":"ϵ","varkappa":"ϰ","varnothing":"∅","varphi":"ϕ","varpi":"ϖ","varpropto":"∝","varr":"↕","varrho":"ϱ","varsigma":"ς","varsubsetneq":"⊊︀","varsubsetneqq":"⫋︀","varsupsetneq":"⊋︀","varsupsetneqq":"⫌︀","vartheta":"ϑ","vartriangleleft":"⊲","vartriangleright":"⊳","vcy":"в","vdash":"⊢","vee":"∨","veebar":"⊻","veeeq":"≚","vellip":"⋮","verbar":"|","vert":"|","vfr":"\uD835\uDD33","vltri":"⊲","vnsub":"⊂⃒","vnsup":"⊃⃒","vopf":"\uD835\uDD67","vprop":"∝","vrtri":"⊳","vscr":"\uD835\uDCCB","vsubnE":"⫋︀","vsubne":"⊊︀","vsupnE":"⫌︀","vsupne":"⊋︀","vzigzag":"⦚","wcirc":"ŵ","wedbar":"⩟","wedge":"∧","wedgeq":"≙","weierp":"℘","wfr":"\uD835\uDD34","wopf":"\uD835\uDD68","wp":"℘","wr":"≀","wreath":"≀","wscr":"\uD835\uDCCC","xcap":"⋂","xcirc":"◯","xcup":"⋃","xdtri":"▽","xfr":"\uD835\uDD35","xhArr":"⟺","xharr":"⟷","xi":"ξ","xlArr":"⟸","xlarr":"⟵","xmap":"⟼","xnis":"⋻","xodot":"⨀","xopf":"\uD835\uDD69","xoplus":"⨁","xotime":"⨂","xrArr":"⟹","xrarr":"⟶","xscr":"\uD835\uDCCD","xsqcup":"⨆","xuplus":"⨄","xutri":"△","xvee":"⋁","xwedge":"⋀","yacute":"ý","yacy":"я","ycirc":"ŷ","ycy":"ы","yen":"¥","yfr":"\uD835\uDD36","yicy":"ї","yopf":"\uD835\uDD6A","yscr":"\uD835\uDCCE","yucy":"ю","yuml":"ÿ","zacute":"ź","zcaron":"ž","zcy":"з","zdot":"ż","zeetrf":"ℨ","zeta":"ζ","zfr":"\uD835\uDD37","zhcy":"ж","zigrarr":"⇝","zopf":"\uD835\uDD6B","zscr":"\uD835\uDCCF","zwj":"‍","zwnj":"‌"}'),N="�",M={0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376},D=/&(?:#[xX]([0-9a-fA-F]+)|#([0-9]+)|([A-Za-z][A-Za-z0-9]*));/g,R=/&(?:#[xX]([0-9a-fA-F]+);?|#([0-9]+);?|([A-Za-z][A-Za-z0-9]*);?)/g;function J(H){if(H in M)return String.fromCodePoint(M[H]);if(H<0||H>1114111)return"�";if(H>=55296&&H<=57343)return"�";return String.fromCodePoint(H)}function U(H){if(typeof H!=="string"||H.indexOf("&")===-1)return H;return H.replace(D,(Q,G,Y,F)=>{if(G!==void 0)return J(parseInt(G,16));if(Y!==void 0)return J(parseInt(Y,10));let L=j[F];return L===void 0?Q:L})}function Z(H){if(typeof H!=="string"||H.indexOf("&")===-1)return H;return H.replace(R,(Q,G,Y,F)=>{if(G!==void 0)return J(parseInt(G,16));if(Y!==void 0)return J(parseInt(Y,10));let L=j[F];return L===void 0?Q:L})}return{decodeHtmlStrict:U,decodeHtml:Z,decodeCodePoint:J,HTML5_ENTITIES:j}}};var RZ={name:"csv",version:"1.0.0",type:"fw.io.codec",dependencies:[],factory(){let T=/^-?\d+$/,j=/^-?(?:\d+\.\d*|\.\d+|\d+)(?:[eE][+-]?\d+)?$/;function N(J){if(J==="")return"";if(J==="true")return!0;if(J==="false")return!1;if(J==="null")return null;if(T.test(J)){let U=Number(J);if(Number.isSafeInteger(U))return U;return J}if(j.test(J))return Number(J);return J}function M(J,U){U=U||{};let Z=U.delimiter||",",H=U.quote||'"',Q=U.skipEmpty!==!1,G=!!U.trim,Y=!!U.cast,F=U.comment||null,L=U.skipLines|0;if(Z.length!==1)throw Error("csv: delimiter must be a single character");if(H.length!==1)throw Error("csv: quote must be a single character");let W=0;if(J.charCodeAt(0)===65279)W=1;let K=[],z="",O=[],C=!1,q=!1,P=J.length,$=0,X=()=>{O.push(G&&!C?z.trim():z),z="",C=!1},V=()=>{if(X(),O.length===1&&O[0]===""&&Q){O=[];return}if(F!==null&&O.length>0&&(G?O[0].trimStart():O[0]).charAt(0)===F){O=[];return}if($<L){$++,O=[];return}K.push(O),O=[]},B=W;while(B<P){let A=J[B];if(q){if(A===H){if(J[B+1]===H){z+=H,B+=2;continue}q=!1,B++;continue}z+=A,B++;continue}if(A===H&&z===""){q=!0,C=!0,B++;continue}if(A===Z){X(),B++;continue}if(A==="\r"){V(),B+=J[B+1]===`
37
- `?2:1;continue}if(A===`
38
- `){V(),B++;continue}z+=A,B++}if(q)throw Error("csv: unterminated quoted field");if(z!==""||O.length>0)V();if(Y)for(let A=0;A<K.length;A++){let S=K[A];for(let E=0;E<S.length;E++)S[E]=N(S[E])}if(U.header){let A;if(Array.isArray(U.header))A=U.header;else{if(K.length===0)return[];if(A=K.shift(),Y)for(let E=0;E<A.length;E++)A[E]=String(A[E])}let S=Array(K.length);for(let E=0;E<K.length;E++){let I={},g=K[E];for(let k=0;k<A.length;k++)I[A[k]]=g[k];S[E]=I}return S}return K}function D(J){if(J===null||J===void 0)return"";if(J instanceof Date)return J.toISOString();if(typeof J==="bigint")return J.toString();return String(J)}function R(J,U){U=U||{};let Z=U.delimiter||",",H=U.quote||'"',Q=U.newline||`\r
39
- `;if(!J||J.length===0)return"";let G=!Array.isArray(J[0])&&typeof J[0]==="object"&&J[0]!==null&&!(J[0]instanceof Date),Y=null,F;if(G){Y=Array.isArray(U.header)?U.header:Object.keys(J[0]),F=Array(J.length);for(let q=0;q<J.length;q++){let P=J[q],$=Array(Y.length);for(let X=0;X<Y.length;X++)$[X]=P[Y[X]];F[q]=$}}else if(F=J,Array.isArray(U.header))Y=U.header;let L=(q)=>q.indexOf(Z)>=0||q.indexOf(H)>=0||q.indexOf(`
40
- `)>=0||q.indexOf("\r")>=0,W=H,K=H+H,z=(q)=>{if(L(q))return W+q.split(W).join(K)+W;return q},O=[];if(Y&&U.header!==!1){let q=Array(Y.length);for(let P=0;P<Y.length;P++)q[P]=z(String(Y[P]));O.push(q.join(Z))}for(let q=0;q<F.length;q++){let P=F[q],$=Array(P.length);for(let X=0;X<P.length;X++)$[X]=z(D(P[X]));O.push($.join(Z))}return O.join(Q)+Q}return{parse:M,stringify:R}}};var MZ={name:"xml",version:"1.0.0",type:"fw.io.codec",dependencies:[],factory(){class T extends Error{constructor(W,K){super(K);Object.defineProperty(this,"name",{value:"XmlParseError",writable:!0,configurable:!0}),this.code=W}}let j={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};function N(W){return W.replace(/&(#x[0-9a-fA-F]+|#\d+|[a-zA-Z]+);/g,(K,z)=>{if(z[0]==="#"){let O=z[1]==="x"?parseInt(z.slice(2),16):parseInt(z.slice(1),10);if(isNaN(O)||O<0||O>1114111||O>=55296&&O<=57343)return K;return String.fromCodePoint(O)}return j[z]!=null?j[z]:K})}function M(W){return String(W).replace(/[&<>]/g,(K)=>K==="&"?"&amp;":K==="<"?"&lt;":"&gt;")}function D(W){return String(W).replace(/[&<>"]/g,(K)=>K==="&"?"&amp;":K==="<"?"&lt;":K===">"?"&gt;":"&quot;")}function R(W,K,z){return{type:"element",name:W,attrs:K||{},children:z||[]}}function J(W){return{type:"text",value:W}}function U(W,K){let z=K+1,O=W.length,C="";while(z<O){let q=W[z];if(C){if(q===C)C=""}else if(q==='"'||q==="'")C=q;else if(q===">")return z;z++}return-1}function Z(W){let K=0,z=W.length;while(K<z&&!/\s/.test(W[K]))K++;let O=W.slice(0,K),C={};while(K<z){while(K<z&&/\s/.test(W[K]))K++;if(K>=z)break;let q=K;while(q<z&&W[q]!=="="&&!/\s/.test(W[q]))q++;let P=W.slice(K,q);if(!P)break;while(q<z&&/\s/.test(W[q]))q++;if(W[q]!=="="){C[P]="",K=q;continue}q++;while(q<z&&/\s/.test(W[q]))q++;let $=W[q];if($!=='"'&&$!=="'")throw new T("xml/parse-error",`XML: unquoted attribute "${P}"`);let X=W.indexOf($,q+1);if(X<0)throw new T("xml/parse-error",`XML: unterminated attribute "${P}"`);C[P]=N(W.slice(q+1,X)),K=X+1}return R(O,C)}function H(W){let K=0,z=W.length;if(W.charCodeAt(0)===65279)K=1;let O=[],C=null;while(K<z)if(W[K]==="<"){if(W.startsWith("<?",K)){let V=W.indexOf("?>",K+2);if(V<0)throw new T("xml/parse-error","XML: unterminated processing instruction");K=V+2;continue}if(W.startsWith("<!--",K)){let V=W.indexOf("-->",K+4);if(V<0)throw new T("xml/parse-error","XML: unterminated comment");K=V+3;continue}if(W.startsWith("<![CDATA[",K)){let V=W.indexOf("]]>",K+9);if(V<0)throw new T("xml/parse-error","XML: unterminated CDATA");let B=W.slice(K+9,V);if(O.length)O[O.length-1].children.push(J(B));K=V+3;continue}if(W.startsWith("<!",K)){let V=K+2,B=!1;while(V<z){if(W[V]==="["){B=!0;break}if(W[V]===">")break;V++}if(B){let A=W.indexOf("]>",V+1);if(A<0)throw new T("xml/parse-error","XML: unterminated declaration");K=A+2}else{if(V>=z)throw new T("xml/parse-error","XML: unterminated declaration");K=V+1}continue}if(W[K+1]==="/"){let V=W.indexOf(">",K);if(V<0)throw new T("xml/parse-error","XML: unterminated end tag");let B=W.slice(K+2,V).trim(),A=O.pop();if(!A||A.name!==B)throw new T("xml/parse-error",`XML: mismatched end tag </${B}> (expected </${A?A.name:"∅"}>)`);K=V+1;continue}let q=U(W,K);if(q<0)throw new T("xml/parse-error","XML: unterminated start tag");let P=W[q-1]==="/",$=W.slice(K+1,P?q-1:q),X=Z($);if(O.length)O[O.length-1].children.push(X);else{if(C)throw new T("xml/parse-error","XML: multiple root elements");C=X}if(!P)O.push(X);else if(!C)C=X;K=q+1}else{let q=W.indexOf("<",K),P=W.slice(K,q<0?z:q);if(O.length&&P.length)O[O.length-1].children.push(J(N(P)));if(q<0)break;K=q}if(O.length)throw new T("xml/parse-error",`XML: unclosed element <${O[O.length-1].name}>`);if(!C)throw new T("xml/parse-error","XML: no root element");return C}function Q(W){if(W.type==="text")return M(W.value);let K=Object.keys(W.attrs).map((O)=>` ${O}="${D(W.attrs[O])}"`).join("");if(!W.children||W.children.length===0)return`<${W.name}${K}/>`;let z=W.children.map(Q).join("");return`<${W.name}${K}>${z}</${W.name}>`}function G(W){return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
41
- `+Q(W)}function Y(W,K){if(!W.children)return null;for(let z of W.children)if(z.type==="element"&&z.name===K)return z;return null}function F(W,K){let z=[];if(!W.children)return z;for(let O of W.children)if(O.type==="element"&&O.name===K)z.push(O);return z}function L(W){if(!W)return"";if(W.type==="text")return W.value;if(!W.children)return"";return W.children.map(L).join("")}return{el:R,text:J,parse:H,serialize:G,serializeNode:Q,findChild:Y,findAll:F,textContent:L,encodeText:M,encodeAttr:D,decodeEntities:N,XmlParseError:T}}};var c$={name:"bitArray",version:"1.0.0",type:"fw.crypto.utils",dependencies:[],factory(){let T={ba_to_ui8:function(j){let N=[],M=T.bitLength(j),D,R;for(D=0;D<M/8;D++){if((D&3)===0)R=j[D/4];N.push(R>>>8>>>8>>>8),R<<=8}return new Uint8Array(N)},ui8_to_ba:function(j){let N=[],M,D=0;for(M=0;M<j.length;M++)if(D=D<<8|j[M],(M&3)===3)N.push(D),D=0;if(M&3)N.push(T.partial(8*(M&3),D));return N},bitSlice:function(j,N,M){return j=T._shiftRight(j.slice(N/32),32-(N&31)).slice(1),M===void 0?j:T.clamp(j,M-N)},extract:function(j,N,M){let D,R=(-N-M&31)>>0;if((N+M-1^N)&-32)D=j[N/32|0]<<32-R^j[N/32+1|0]>>>R;else D=j[N/32|0]>>>R;return D&(1<<M)-1},concat:function(j,N){if(j.length===0||N.length===0)return j.concat(N);let M=j[j.length-1],D=T.getPartial(M);if(D===32)return j.concat(N);else return T._shiftRight(N,D,M|0,j.slice(0,j.length-1))},bitLength:function(j){let N=j.length,M;if(N===0)return 0;return M=j[N-1],(N-1)*32+T.getPartial(M)},clamp:function(j,N){if(j.length*32<N)return j;j=j.slice(0,Math.ceil(N/32));let M=j.length;if(N=N&31,M>0&&N)j[M-1]=T.partial(N,j[M-1]&2147483648>>N-1,1);return j},partial:function(j,N,M){if(j===32)return N;return(M?N|0:N<<32-j)+j*1099511627776},getPartial:function(j){return Math.round(j/1099511627776)||32},equal:function(j,N){if(T.bitLength(j)!==T.bitLength(N))return!1;let M=0,D;for(D=0;D<j.length;D++)M|=j[D]^N[D];return M===0},_shiftRight:function(j,N,M,D){let R,J,U;if(D===void 0)D=[];for(;N>=32;N-=32)D.push(M),M=0;if(N===0)return D.concat(j);for(R=0;R<j.length;R++)D.push(M|j[R]>>>N),M=j[R]<<32-N;return J=j.length?j[j.length-1]:0,U=T.getPartial(J),D.push(T.partial(N+U&31,N+U>32?M:D.pop(),1)),D},_xor4:function(j,N){return[j[0]^N[0],j[1]^N[1],j[2]^N[2],j[3]^N[3]]},byteswapM:function(j){if(j.length>0&&T.getPartial(j[j.length-1])!==32)return console.warn("[crypto] INVALID: bitArray.byteswapM: partial words not supported"),!1;let N,M,D=65280;for(N=0;N<j.length;++N)M=j[N],j[N]=M>>>24|M>>>8&D|(M&D)<<8|M<<24;return j}};return T}};var AZ={name:"aes",version:"1.0.0",type:"fw.crypto.cipher",dependencies:[],factory(){let T=[[[],[],[],[],[]],[[],[],[],[],[]]];(function(){let H=T[0],Q=T[1],G=H[4],Y=Q[4],F=[],L=[],W,K,z,O,C,q,P,$,X;for(X=0;X<256;X++)L[(F[X]=X<<1^(X>>7)*283)^X]=X;for(W=K=0;!G[W];W^=z||1,K=L[K]||1){q=K^K<<1^K<<2^K<<3^K<<4,q=q>>8^q&255^99,G[W]=q,Y[q]=W,C=F[O=F[z=F[W]]],$=C*16843009^O*65537^z*257^W*16843008,P=F[q]*257^q*16843008;for(X=0;X<4;X++)H[X][W]=P=P<<24^P>>>8,Q[X][q]=$=$<<24^$>>>8}for(X=0;X<5;X++)H[X]=H[X].slice(0),Q[X]=Q[X].slice(0)})();function j(Z,H,Q,G){if(Z.length!==4)return console.warn("[crypto] INVALID: aes: invalid block size"),!1;let Y=Q[H],F=Z[0]^Y[0],L=Z[H?3:1]^Y[1],W=Z[2]^Y[2],K=Z[H?1:3]^Y[3],z,O,C,q=Y.length/4-2,P=4,$=[0,0,0,0],X=G[H],V=X[0],B=X[1],A=X[2],S=X[3],E=X[4];for(let I=0;I<q;I++)z=V[F>>>24]^B[L>>16&255]^A[W>>8&255]^S[K&255]^Y[P],O=V[L>>>24]^B[W>>16&255]^A[K>>8&255]^S[F&255]^Y[P+1],C=V[W>>>24]^B[K>>16&255]^A[F>>8&255]^S[L&255]^Y[P+2],K=V[K>>>24]^B[F>>16&255]^A[L>>8&255]^S[W&255]^Y[P+3],P+=4,F=z,L=O,W=C;for(let I=0;I<4;I++)$[H?3&-I:I]=E[F>>>24]<<24^E[L>>16&255]<<16^E[W>>8&255]<<8^E[K&255]^Y[P++],z=F,F=L,L=W,W=K,K=z;return $}function N(Z,H){let Q=0,G=Z&255;for(let Y=0;Y<256;Y++){let W=-(((Y^G)>>>0)-1>>>8&1)&255;Q|=H[Y]&W}return Q&255}function M(Z){return(Z<<1^(Z>>7)*27)&255}function D(Z,H,Q,G){let Y=Z^H^Q^G,F=Z^Y^M(Z^H),L=H^Y^M(H^Q),W=Q^Y^M(Q^G),K=G^Y^M(G^Z);return[F,L,W,K]}function R(Z,H,Q,G){let Y=M,F=(C)=>Y(Y(C)),L=(C)=>Y(F(C)),W=(C)=>L(C)^C,K=(C)=>L(C)^Y(C)^C,z=(C)=>L(C)^F(C)^C,O=(C)=>L(C)^F(C)^Y(C);return[(O(Z)^K(H)^z(Q)^W(G))&255,(W(Z)^O(H)^K(Q)^z(G))&255,(z(Z)^W(H)^O(Q)^K(G))&255,(K(Z)^z(H)^W(Q)^O(G))&255]}function J(Z,H,Q){if(Z.length!==4)return console.warn("[crypto] INVALID: aes: invalid block size"),!1;let G=T[0][4],Y=T[1][4],F=H?Y:G,L=!H,W=new Uint8Array(16);for(let q=0;q<4;q++){let P=Z[q];W[q*4]=P>>>24&255,W[q*4+1]=P>>>16&255,W[q*4+2]=P>>>8&255,W[q*4+3]=P&255}let K=Q[0],z=K.length/4-1,O=new Uint8Array(K.length*4);for(let q=0;q<K.length;q++)O[q*4]=K[q]>>>24&255,O[q*4+1]=K[q]>>>16&255,O[q*4+2]=K[q]>>>8&255,O[q*4+3]=K[q]&255;if(L){for(let q=0;q<16;q++)W[q]^=O[q];for(let q=1;q<z;q++){for(let $=0;$<16;$++)W[$]=N(W[$],F);let P=new Uint8Array(W);for(let $=0;$<4;$++)for(let X=0;X<4;X++)W[X*4+$]=P[(X+$&3)*4+$];for(let $=0;$<4;$++){let X=$*4,V=D(W[X],W[X+1],W[X+2],W[X+3]);W[X]=V[0],W[X+1]=V[1],W[X+2]=V[2],W[X+3]=V[3]}for(let $=0;$<16;$++)W[$]^=O[q*16+$]}for(let q=0;q<16;q++)W[q]=N(W[q],F);{let q=new Uint8Array(W);for(let P=0;P<4;P++)for(let $=0;$<4;$++)W[$*4+P]=q[($+P&3)*4+P]}for(let q=0;q<16;q++)W[q]^=O[z*16+q]}else{for(let q=0;q<16;q++)W[q]^=O[z*16+q];for(let q=z-1;q>=1;q--){let P=new Uint8Array(W);for(let $=0;$<4;$++)for(let X=0;X<4;X++)W[X*4+$]=P[(X-$+4&3)*4+$];for(let $=0;$<16;$++)W[$]=N(W[$],F);for(let $=0;$<16;$++)W[$]^=O[q*16+$];for(let $=0;$<4;$++){let X=$*4,V=R(W[X],W[X+1],W[X+2],W[X+3]);W[X]=V[0],W[X+1]=V[1],W[X+2]=V[2],W[X+3]=V[3]}}{let q=new Uint8Array(W);for(let P=0;P<4;P++)for(let $=0;$<4;$++)W[$*4+P]=q[($-P+4&3)*4+P]}for(let q=0;q<16;q++)W[q]=N(W[q],F);for(let q=0;q<16;q++)W[q]^=O[q]}let C=[0,0,0,0];for(let q=0;q<4;q++)C[q]=W[q*4]<<24|W[q*4+1]<<16|W[q*4+2]<<8|W[q*4+3];return C}let U={};return U.fn=function(Z,H=!0){let Q=Z.length;if(Q!==4&&Q!==6&&Q!==8)return console.warn("[crypto] INVALID: aes: invalid key size"),!1;let G=T[0][4],Y=Z.slice(0),F=1,L,W;for(L=Q;L<4*Q+28;L++){if(W=Y[L-1],L%Q===0||Q===8&&L%Q===4){if(W=G[W>>>24]<<24^G[W>>16&255]<<16^G[W>>8&255]<<8^G[W&255],L%Q===0)W=W<<8^W>>>24^F<<24,F=F<<1^(F>>7)*283}Y[L]=Y[L-Q]^W}let K=[Y],z={encrypt(O){return J(O,0,K)}};if(H)z.decrypt=(O)=>J(O,1,K);return z},U.ttable={fn(Z,H=!0){let Q=T.slice(),G=Q[0][4],Y=Q[1],F=Z.length,L=1,W,K,z;if(F!==4&&F!==6&&F!==8)return console.warn("[crypto] INVALID: aes: invalid key size"),!1;let O=Z.slice(0),C=[],q=[O,C];for(W=F;W<4*F+28;W++){if(z=O[W-1],W%F===0||F===8&&W%F===4){if(z=G[z>>>24]<<24^G[z>>16&255]<<16^G[z>>8&255]<<8^G[z&255],W%F===0)z=z<<8^z>>>24^L<<24,L=L<<1^(L>>7)*283}O[W]=O[W-F]^z}if(H)for(K=0;W;K++,W--)if(z=O[K&3?W:W-4],W<=4||K<4)C[K]=z;else C[K]=Y[0][G[z>>>24]]^Y[1][G[z>>16&255]]^Y[2][G[z>>8&255]]^Y[3][G[z&255]];let P={encrypt($){return j($,0,q,Q)}};if(H)P.decrypt=function($){return j($,1,q,Q)};return P}},U.bitsliced={fn:U.fn},U}};var NZ={name:"sha256",version:"1.0.0",type:"fw.crypto.hash",dependencies:["bitArray","utf8"],deps:[c$,L$],factory(T,j){let N=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],M=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function D(J,U){let Z={};return Z.fn=function(H){if(H)this._h=H._h.slice(0),this._buffer=H._buffer.slice(0),this._length=H._length;else this.reset()},Z.hash=function(H){return new Z.fn().update(H).finalize()},Z.fn.prototype={blockSize:512,_init:J,_key:M,reset(){return this._h=this._init.slice(0),this._buffer=[],this._length=0,this},update(H){if(typeof H==="string")H=T.ui8_to_ba(j.toBytes(H));let Q=this._buffer=T.concat(this._buffer,H),G=this._length,Y=this._length=G+T.bitLength(H);if(Y>9007199254740991)return console.warn("[crypto] INVALID: sha256: cannot hash more than 2^53 - 1 bits"),!1;let F=new Uint32Array(Q),L=0;for(let W=512+G-(512+G&511);W<=Y;W+=512)this._block(F.subarray(16*L,16*(L+1))),L+=1;return Q.splice(0,16*L),this},finalize(){let H=this._buffer,Q=this._h;H=T.concat(H,[T.partial(1,1)]);for(let G=H.length+2;G&15;G++)H.push(0);H.push(Math.floor(this._length/4294967296)),H.push(this._length|0);while(H.length)this._block(H.splice(0,16));return this.reset(),U<8?Q.slice(0,U):Q},_block(H){let Q=this._h,G=this._key,Y=Q[0],F=Q[1],L=Q[2],W=Q[3],K=Q[4],z=Q[5],O=Q[6],C=Q[7],q,P,$;for(let X=0;X<64;X++){if(X<16)q=H[X];else P=H[X+1&15],$=H[X+14&15],q=H[X&15]=(P>>>7^P>>>18^P>>>3^P<<25^P<<14)+($>>>17^$>>>19^$>>>10^$<<15^$<<13)+H[X&15]+H[X+9&15]|0;q=q+C+(K>>>6^K>>>11^K>>>25^K<<26^K<<21^K<<7)+(O^K&(z^O))+G[X],C=O,O=z,z=K,K=W+q|0,W=L,L=F,F=Y,Y=q+(F&L^W&(F^L))+(F>>>2^F>>>13^F>>>22^F<<30^F<<19^F<<10)|0}Q[0]=Q[0]+Y|0,Q[1]=Q[1]+F|0,Q[2]=Q[2]+L|0,Q[3]=Q[3]+W|0,Q[4]=Q[4]+K|0,Q[5]=Q[5]+z|0,Q[6]=Q[6]+O|0,Q[7]=Q[7]+C|0}},Z}let R=D(N,8);return{fn:R.fn,hash:R.hash,_internal:{makeSha:D}}}};var TZ={name:"random",version:"1.0.0",type:"fw.crypto.utils",dependencies:["bitArray","aes","sha256"],deps:[c$,AZ,NZ],factory(T,j,N){let D=typeof crypto<"u"&&!!crypto.getRandomValues;function R(k){let w=k.length>>>2,f=Array(w);for(let x=0;x<w;x++){let u=x<<2;f[x]=k[u]<<24|k[u+1]<<16|k[u+2]<<8|k[u+3]|0}return f}function J(k,w,f,x){for(let u=0;u<w;u++){let v=x+(u<<2);f[v]=k[u]>>>24&255,f[v+1]=k[u]>>>16&255,f[v+2]=k[u]>>>8&255,f[v+3]=k[u]&255}}let U=4,Z=512,H=13,Q={prev:-1,run:0},G={anchor:-1,count:0,idx:0},Y=!1;function F(k){if(Y)return!1;for(let w=0;w<k.length;w++){let f=k[w];if(f===Q.prev){if(Q.run++,Q.run>=U)return Y=!0,console.error("[crypto] CORRUPT: random: RCT health-test failed on entropy source"),!1}else Q.prev=f,Q.run=1;if(G.anchor===-1)G.anchor=f,G.count=1,G.idx=1;else{if(G.idx++,f===G.anchor){if(G.count++,G.count>H)return Y=!0,console.error("[crypto] CORRUPT: random: APT health-test failed on entropy source"),!1}if(G.idx>=Z)G.anchor=-1}}return!0}function L(){Q.prev=-1,Q.run=0,G.anchor=-1,G.count=0,G.idx=0,Y=!1}function W(k){if(!D)return console.error("[crypto] NOT READY: crypto.getRandomValues unavailable"),!1;let w=0;while(w<k.length){let f=Math.min(65536,k.length-w);crypto.getRandomValues(k.subarray(w,w+f)),w+=f}return k}function K(k){if(Y)return console.error("[crypto] CORRUPT: random: entropy source previously failed health test"),!1;let w=W(new Uint8Array(k));if(w===!1)return!1;if(!F(w))return!1;return w}let z=4,O=16,C=65536,q=4294967296;function P(k){k=k||{};let w=k.aesKeyBits||256,f=!!k.df;if(w!==128&&w!==192&&w!==256)return console.error("[crypto] BUG: ctr_drbg: aesKeyBits must be 128, 192 or 256"),!1;let x=w/8,u=x/4,v=x+O,d=v/4,o=Array(u).fill(0),_=Array(z).fill(0),y=null,c=0,l=!1;function h(n,a){let s=j.fn(R(n),!1);if(s===!1)return!1;let t=new Uint8Array(O);for(let Z$=0;Z$<a.length;Z$+=O){for(let G$=0;G$<O;G$++)t[G$]^=a[Z$+G$];let r=s.encrypt(R(t));J(r,z,t,0)}return t}function m(n,a){let s=n.length,t=a,Z$=8,r=8+s+1,G$=(O-r%O)%O,K$=r+G$,F$=new Uint8Array(K$);F$[0]=s>>>24&255,F$[1]=s>>>16&255,F$[2]=s>>>8&255,F$[3]=s&255,F$[4]=t>>>24&255,F$[5]=t>>>16&255,F$[6]=t>>>8&255,F$[7]=t&255;for(let U$=0;U$<s;U$++)F$[8+U$]=n[U$];F$[8+s]=128;let E$=new Uint8Array(x);for(let U$=0;U$<x;U$++)E$[U$]=U$;let C$=x+O,P$=new Uint8Array(Math.ceil(C$/O)*O),A$=0,O$=0;while(A$<C$){let U$=new Uint8Array(O+K$);U$[0]=O$>>>24&255,U$[1]=O$>>>16&255,U$[2]=O$>>>8&255,U$[3]=O$&255,U$.set(F$,O);let B$=h(E$,U$);if(B$===!1)return!1;P$.set(B$,A$),A$+=O,O$++}let W$=P$.subarray(0,x),Y$=P$.slice(x,x+O),z$=j.fn(R(W$),!1);if(z$===!1)return!1;let j$=new Uint8Array(a),D$=0;while(D$<a){let U$=z$.encrypt(R(Y$));J(U$,z,Y$,0);let B$=Math.min(O,a-D$);j$.set(Y$.subarray(0,B$),D$),D$+=B$}return j$}function b(){if(y=j.fn(o,!1),y===!1)return console.error("[crypto] BUG: ctr_drbg: AES key schedule failed"),!1;return!0}function p(){for(let n=z-1;n>=0;n--)if(_[n]=_[n]+1|0,_[n]!==0)break}function i(n){let a=Array(d).fill(0),s=0;while(s<d){p();let t=y.encrypt(_);for(let Z$=0;Z$<z&&s<d;Z$++)a[s++]=t[Z$]}for(let t=0;t<d;t++)a[t]^=n[t];return o=a.slice(0,u),_=a.slice(u,u+z),b()}function e(n,a,s){if(f){let Z$=n?n.length:0,r=s?s.length:0,G$=a?a.length:0,K$=new Uint8Array(Z$+r+G$);if(Z$)K$.set(n,0);if(r)K$.set(s,Z$);if(G$)K$.set(a,Z$+r);return m(K$,v)}if(!n||n.length!==v)return console.error("[crypto] BUG: ctr_drbg (no-df): entropy must be exactly "+v+" bytes"),!1;let t=new Uint8Array(v);if(t.set(n),a&&a.length>0){let Z$=Math.min(a.length,v);for(let r=0;r<Z$;r++)t[r]^=a[r]}return t}function J$(n,a,s){let t=e(n,a,s);if(t===!1)return!1;if(o.fill(0),_.fill(0),!b())return!1;if(!i(R(t)))return!1;return c=1,l=!0,!0}function Q$(n,a){if(!l)return console.warn("[crypto] NOT READY: ctr_drbg.reseed: not instantiated"),!1;let s=e(n,a,null);if(s===!1)return!1;if(!i(R(s)))return!1;return c=1,!0}function $$(n,a){if(!l)return console.warn("[crypto] NOT READY: ctr_drbg.generate: not instantiated"),!1;if(!Number.isInteger(n)||n<0||n>C)return console.warn("[crypto] INVALID: ctr_drbg.generate: n must be an integer in [0, "+C+"]"),!1;if(n===0)return new Uint8Array(0);if(c>q){let r=K(v);if(r===!1)return!1;if(!Q$(r,a))return!1;a=null}let s;if(a&&a.length>0){let r;if(f){if(r=m(a,v),r===!1)return!1}else r=new Uint8Array(v),r.set(a.subarray(0,Math.min(v,a.length)));if(s=R(r),!i(s))return!1}else s=Array(d).fill(0);let t=new Uint8Array(n),Z$=0;while(Z$<n){p();let r=y.encrypt(_),G$=n-Z$;if(G$>=16)J(r,z,t,Z$),Z$+=16;else{let K$=new Uint8Array(16);J(r,z,K$,0),t.set(K$.subarray(0,G$),Z$),Z$=n}}if(!i(s))return!1;return c++,t}function X$(){o.fill(0),_.fill(0),y=null,c=0,l=!1}return{instantiate:J$,reseed:Q$,generate:$$,uninstantiate:X$,get isLive(){return l},get reseedCounter(){return c},get securityStrength(){return w},get aesKeyBits(){return w},get useDf(){return f},get seedBytes(){return v}}}let $=A("e4bc23c5089a19d86f4119cb3fa08c0a4991e0a1def17e101e4c14d9c323460a7c2fb58e0b086c6c57b55f56cae25bad"),X=A("fd85a836bba85019881e8c6bad23c9061adc75477659acaea8e4a01dfe07a1832dad1c136f59d70f8653a5dc118663d6"),V="b2cb8905c05e5950ca31895096be29ea3d5a3b82b269495554eb80fe07de43e193b9e7c3ece73b80e062b1c1f68202fbb1c52a040ea2478864295282234aaada",B=null;function A(k){let w=new Uint8Array(k.length>>>1);for(let f=0;f<w.length;f++)w[f]=parseInt(k.substring(f*2,f*2+2),16);return w}function S(k){let w="";for(let f=0;f<k.length;f++){let x=k[f];w+=(x<16?"0":"")+x.toString(16)}return w}function E(){let k=P();if(!k||k===!1)return!1;if(!k.instantiate($))return!1;if(!k.reseed(X))return!1;if(k.generate(64)===!1)return!1;let w=k.generate(64);if(w===!1)return!1;let f=S(w);if(f!==V)return console.error("[crypto] CORRUPT: random.selfTest: CTR_DRBG KAT mismatch (got "+f+")"),!1;return!0}function I(){if(B===null)B=E();return B}let g={fill(k){return W(k)},float(){let k=W(new Uint8Array(4));if(k===!1)return!1;return((k[0]<<24|k[1]<<16|k[2]<<8|k[3])>>>0)/4294967296},int(k,w){if(k>w)throw RangeError("min must be ≤ max");let f=w-k+1,x=Math.floor(4294967296/f)*f,u=new Uint8Array(4),v;do{if(W(u)===!1)return!1;v=(u[0]<<24|u[1]<<16|u[2]<<8|u[3])>>>0}while(v>=x);return k+v%f},bytes(k){if(!Number.isInteger(k)||k<0)return console.warn("[crypto] INVALID: random.bytes expects a non-negative integer"),!1;return W(new Uint8Array(k))},words(k){if(!Number.isInteger(k)||k<0)return console.warn("[crypto] INVALID: random.words expects a non-negative integer"),!1;let w=W(new Uint8Array(k*4));if(w===!1)return!1;let f=Array(k);for(let x=0;x<k;x++){let u=x*4;f[x]=w[u]<<24|w[u+1]<<16|w[u+2]<<8|w[u+3]|0}return f},bits(k){if(!Number.isInteger(k)||k<0)return console.warn("[crypto] INVALID: random.bits expects a non-negative integer"),!1;let w=Math.ceil(k/32),f=g.words(w);if(f===!1)return!1;return T.clamp(f,k)},isReady(){return D},selfTest(){return B=E(),B},_internal:{makeDrbg:P},health:{feed(k){return F(k instanceof Uint8Array?k:new Uint8Array(k))},reset(){L()},get isDead(){return Y}},drbg(k={}){if(!I())return console.error("[crypto] CORRUPT: random.drbg refused - POST failed"),!1;let w=P(k);if(w===!1)return!1;let f=K(w.seedBytes);if(f===!1)return!1;if(!w.instantiate(f,k.personalisation))return!1;let x=null;return{generate(u,v){let d=v||null;if(x!==null)d=d===null?x:(()=>{let o=new Uint8Array(x.length+d.length);return o.set(x),o.set(d,x.length),o})(),x=null;return w.generate(u,d)},reseed(u){let v=K(w.seedBytes);if(v===!1)return!1;let d=u||null;if(x!==null)d=d===null?x:(()=>{let o=new Uint8Array(x.length+d.length);return o.set(x),o.set(d,x.length),o})(),x=null;return w.reseed(v,d)},addAdditionalInput(u){if(!(u instanceof Uint8Array))if(Array.isArray(u)||u instanceof Uint32Array){let d=new Uint8Array(u.length*4);for(let o=0;o<u.length;o++){let _=u[o]|0;d[o*4]=_>>>24&255,d[o*4+1]=_>>>16&255,d[o*4+2]=_>>>8&255,d[o*4+3]=_&255}u=d}else if(typeof u==="number"){let d=u|0;u=new Uint8Array([d>>>24&255,d>>>16&255,d>>>8&255,d&255])}else return console.warn("[crypto] BUG: drbg.addAdditionalInput: unsupported data type"),!1;let v=x===null?u:(()=>{let d=new Uint8Array(x.length+u.length);return d.set(x),d.set(u,x.length),d})();if(v.length<=w.seedBytes)x=v;else{let d=N.hash(R(v.subarray(0,v.length&-4))),o=new Uint8Array(32);J(d,8,o,0),x=o}return!0},uninstantiate(){x=null,w.uninstantiate()},get isLive(){return w.isLive},get reseedCounter(){return w.reseedCounter},get securityStrength(){return w.securityStrength}}}};return g}};var SZ={name:"mime",version:"1.0.0",type:"fw.io.codec",dependencies:["utf8","random"],deps:[L$,TZ],factory(T,j){function N(L,W,K){let z=W.length,O=L.length;if(z===0)return K;let C=O-z;$:for(let q=K;q<=C;q++){for(let P=0;P<z;P++)if(L[q+P]!==W[P])continue $;return q}return-1}function M(L){let W=0;for(let O=0;O<L.length;O++)W+=L[O].length;let K=new Uint8Array(W),z=0;for(let O=0;O<L.length;O++)K.set(L[O],z),z+=L[O].length;return K}function D(L){let W=/^([^']*)'[^']*'(.*)$/.exec(L);if(!W)return L;let K=W[1].toLowerCase(),z=W[2];try{if(K==="utf-8"||K==="")return decodeURIComponent(z);return z.replace(/%([0-9a-fA-F]{2})/g,(O,C)=>String.fromCharCode(parseInt(C,16)))}catch{return z}}function R(L){if(typeof L!=="string")return{value:"",params:{}};let W={},K={},z=0,O=L.length,C=(X)=>{let V="";while(z<O&&X.indexOf(L[z])<0)V+=L[z],z++;return V},q=()=>{while(z<O&&(L[z]===" "||L[z]==="\t"))z++},P=()=>{z++;let X="";while(z<O){let V=L[z];if(V==="\\"&&z+1<O){X+=L[z+1],z+=2;continue}if(V==='"')return z++,X;X+=V,z++}return X};q();let $=C(";").trim();while(z<O){if(L[z]!==";"){z++;continue}z++,q();let X=C("=;").trim().toLowerCase();if(!X)continue;let V;if(L[z]==="=")if(z++,q(),L[z]==='"')V=P();else V=C(";").trim();else V="";if(X.endsWith("*"))K[X.slice(0,-1)]=D(V);else if(!(X in W))W[X]=V}for(let X of Object.keys(K))W[X]=K[X];return{value:$,params:W}}let J=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function U(L,W){if(L&&typeof L==="object")W=L.params,L=L.value;let K=String(L||"");if(W)for(let z of Object.keys(W)){let O=W[z];if(O===void 0||O===null)continue;let C=String(O);K+="; "+z+"="+(J.test(C)?C:'"'+C.replace(/\\/g,"\\\\").replace(/"/g,"\\\"")+'"')}return K}function Z(L){let W={};if(!L)return W;let K=L.replace(/\r\n/g,`
37
+ `+J$}return`${J$}<${a} ${X$}>${U$}</${a}>`}let b=64,h=new Map,d={hits:0,misses:0,evictions:0};function n(u){if(b===0)return;let r=h.get(u);if(r!==void 0)h.delete(u),h.set(u,r),d.hits++;else d.misses++;return r}function m(u,r){if(b===0)return;if(h.size>=b){let l=h.keys().next().value;h.delete(l),d.evictions++}h.set(u,r)}let c=function(u,r){let l=typeof DOMParser<"u"?new DOMParser().parseFromString("<html><body>"+u+"</body></html>","text/html").body:O(u),p=k(l);B=new Set(p),A(r,p);for(let s of p)I.add(s);let i=[],a={};function Z$(s,Y$,X$){let U$=s.tagName.toLowerCase();if(J.test(U$))return;let z$=g(s),V$=s.getAttribute("id"),q$=V$&&V$.trim()?V$.trim():w(p),K$={id:q$,tag:z$};if(Y$!==null&&Y$!==void 0)K$.parent=Y$;let O$=[],M$=[],S$={};for(let W$ of s.attributes){if(W$.name==="id")continue;if(!F.test(W$.name))continue;if(K.test(W$.name))continue;let{val:L$,maps:B$}=f(W$.value,W$.name,!0);M$.push(W$.name),S$[W$.name]=L$,O$.push(...B$)}if(M$.length>0)K$.attrs=M$,K$.data={...S$};let _$=Array.from(s.childNodes),N$=null,A$=!1,H$=[],P$=[];for(let W$ of _$)if(W$.nodeType===Y){let L$=W$.nodeValue.match(P),B$=W$.nodeValue.match(D);if(L$)N$=L$[1],A$=!0;else if(B$&&A$)A$=!1}else if(A$){if(W$.nodeType===Q)H$.push(W$)}else P$.push(W$);if(N$){K$.content=N$;let W$=[];if(H$.forEach((L$)=>Z$(L$,null,W$)),a[N$]=W$,O$.length>0)K$.map=O$;X$.push(K$)}else if(P$.filter((L$)=>L$.nodeType===Q).length===0){let L$=P$.filter((B$)=>B$.nodeType===L).map((B$)=>B$.nodeValue).join("").trim();if(L$){let B$=L$.match(U);if(B$)K$.content=B$[1];else{let{val:g$,maps:x$}=f(L$,"text",!1);K$.text=g$,O$.push(...x$)}}if(O$.length>0)K$.map=O$;X$.push(K$)}else{if(O$.length>0)K$.map=O$;X$.push(K$),P$.forEach((L$,B$)=>{if(L$.nodeType===Q)Z$(L$,q$,X$);else if(L$.nodeType===L){let g$=L$.nodeValue,x$=g$.trim();if(!x$)return;let IJ=q(P$[B$-1]),EJ=q(P$[B$+1]),f$=x$;{if(IJ&&/^\s/.test(g$))f$=" "+f$;if(EJ&&/\s$/.test(g$))f$=f$+" "}let QZ=x$.match(U);if(QZ)X$.push({id:w(p),tag:"span",parent:q$,content:QZ[1]});else{let{val:wJ,maps:GZ}=f(f$,"text",!1),XZ={id:w(p),tag:"text",parent:q$,text:wJ};if(GZ.length>0)XZ.map=GZ;X$.push(XZ)}}})}}Array.from(l.childNodes).forEach((s)=>{if(s.nodeType===Q)Z$(s,null,i)});let J$={template:i};if(Object.keys(a).length>0)J$.iterates=a;return J$},o=function(u){let r=Array.isArray(u),l=r?u:u.template||[],p=r?{}:u.iterates||{},i=_(l);return i.roots.map((a)=>v(a,i,p,"")).join(`
38
+ `)},$$=function(u,r){let l=r?r.reserveIds:void 0;if(typeof u!=="string")return c(u,l);if(l!==void 0&&l!==null)return c(u,l);let p=r?r.cache:void 0;if(p&&typeof p._get==="function")return e(u,p);let i=n(u);if(i!==void 0)return G$(i);let a=c(u);return m(u,a),G$(a)};function e(u,r){let l=(typeof DOMParser<"u"?"d:":"t:")+u,p=r._get(l);if(p===void 0){z=[];let s;try{s=c(u),r._set(l,{result:s,minted:z,explicit:Array.from(B)})}finally{z=null}return G$(s)}for(let s of p.explicit)I.add(s);let i=new Set(p.explicit),a=new Map;for(let s of p.minted)a.set(s,w(i));let Z$=G$(p.result),J$=(s)=>{for(let Y$ of s){if(a.has(Y$.id))Y$.id=a.get(Y$.id);if(Y$.parent!==void 0&&a.has(Y$.parent))Y$.parent=a.get(Y$.parent)}};if(J$(Z$.template),Z$.iterates)for(let s of Object.keys(Z$.iterates))J$(Z$.iterates[s]);return Z$}function t(u){let r=Math.max(0,(u&&u.max!==void 0?u.max:64)|0),l=new Map,p={hits:0,misses:0,evictions:0};return{size(){return l.size},clear(){l.clear(),p.hits=0,p.misses=0,p.evictions=0},stats(){return{...p,size:l.size,max:r}},_get(i){if(r===0)return;let a=l.get(i);if(a===void 0){p.misses++;return}return l.delete(i),l.set(i,a),p.hits++,a},_set(i,a){if(r===0)return;if(l.size>=r)l.delete(l.keys().next().value),p.evictions++;l.set(i,a)}}}function G$(u){if(Array.isArray(u))return u.map(G$);if(u!==null&&typeof u==="object"){let r={};for(let l of Object.keys(u))r[l]=G$(u[l]);return r}return u}return{fromHTML:$$,toHTML:o,cache:{clear(){h.clear(),d.hits=0,d.misses=0,d.evictions=0},setMax(u){b=Math.max(0,u|0);while(h.size>b){let r=h.keys().next().value;h.delete(r),d.evictions++}},getMax(){return b},size(){return h.size},stats(){return{...d,size:h.size,max:b}}},createCache:t}}};var E$={name:"styleSheet",version:"1.0.0",type:"fw.dom.rendering",dependencies:[],factory(){let E="element",S=typeof document<"u"?document.querySelector('meta[name="csp-nonce"]')?.getAttribute("content")??"":"";function T(V){if(V!=="element"&&V!=="adopted")throw TypeError(`styleSheet: unknown mode '${V}'`);return V}function N(V){if(typeof V!=="string")throw TypeError("styleSheet: css must be a string")}function R(){return{constructable:typeof document<"u"&&"adoptedStyleSheets"in document&&typeof CSSStyleSheet==="function"&&typeof CSSStyleSheet.prototype.replaceSync==="function"}}function j(V){if(arguments.length===0||V===void 0)return E;E=T(V)}function Z(V,X,H,Q){let Y=X.ownerDocument.createElement("style");if(H!==null)Y.id=H;Y.textContent=V;let G=Q.attrs;if(G)for(let W of Object.keys(G))Y.setAttribute(W,String(G[W]));let J=typeof Q.nonce==="string"?Q.nonce:S;if(J)Y.setAttribute("nonce",J);X.appendChild(Y);let U=!1;return{mode:"element",id:H,element:Y,sheet:null,set(W){if(N(W),U)return;if(Y.textContent=W,!Y.isConnected)X.appendChild(Y)},detach(){if(U)return;U=!0,Y.remove()}}}function q(V,X,H){let Q=new X.defaultView.CSSStyleSheet;Q.replaceSync(V),X.adoptedStyleSheets=[...X.adoptedStyleSheets,Q];let L=!1;return{mode:"adopted",id:H,element:null,sheet:Q,set(Y){if(N(Y),L)return;Q.replaceSync(Y)},detach(){if(L)return;L=!0,X.adoptedStyleSheets=X.adoptedStyleSheets.filter((Y)=>Y!==Q)}}}function $(V,X){N(V);let H=X||{},Q=H.mode===void 0?E:T(H.mode),L=typeof H.id==="string"?H.id:null,Y=H.head||(typeof document<"u"?document.head:null);if(!Y)return{mode:"none",id:L,element:null,sheet:null,set(){},detach(){}};let G=Y.ownerDocument;if(Q==="adopted"){let J=G.defaultView&&G.defaultView.CSSStyleSheet;if(typeof J==="function"&&typeof J.prototype.replaceSync==="function"&&"adoptedStyleSheets"in G)return q(V,G,L)}return Z(V,Y,L,H)}return{support:R,mode:j,attach:$}}};var w$={name:"template",type:"fw.dom.rendering",dependencies:["secPolicy","styleSheet"],deps:[C$,E$],factory(E,S){let T={},N={},R=new WeakMap,j=typeof document<"u"?document.querySelector('meta[name="csp-nonce"]')?.getAttribute("content")??"":"",Z=E.SAFE_ATTR_NAME_RE,q=E.EVENT_ATTR_RE,$=E.URL_ATTRS,V=E.CLOBBER_ATTRS,X=E.CLOBBER_NAMES,H=(K)=>E.isSafeUrl(K);function Q(K){return K instanceof SVGSVGElement&&K.children.length===1?K.children[0]:K}function L(K,O){if(O.attrs)for(let M of O.attrs){if(q.test(M)||!Z.test(M))continue;let z=O.data?.[M];if(z===null||z===!1||z===void 0)continue;if($.has(M)&&!H(String(z))){K.removeAttribute(M);continue}if(V.has(M)&&X.has(String(z))){K.removeAttribute(M);continue}K.setAttribute(M,z)}if(O.text!=null)K.textContent=O.text;return K.setAttribute("id",O.id),K}function Y(K,O){let M=T[K].tpl,z=O.tag==="text"?"span":O.tag;if(Object.prototype.hasOwnProperty.call(N[M],z))return L(N[M][z].cloneNode(),O);let B=J(z);return B===null?null:L(B,O)}let G=/^[a-zA-Z][a-zA-Z0-9-]*$/;function J(K){if(typeof K!=="string")return null;if(K.startsWith("svg_")){let O=K.slice(4);return G.test(O)?document.createElementNS(C,O):null}if(!G.test(K)||E.isBlockedTag(K.toLowerCase()))return null;return document.createElement(K)}function U(K,O,M){if(M)K.insertBefore(O,K.firstChild);else K.appendChild(O)}function W(K,O){let M=T[K].map,z=[],B=[...O];while(B.length>0){let I=B.pop();if(M[I]){if(B.push(...M[I].children),M[I].childCtxs)for(let A of M[I].childCtxs)F.clearContext(A);z.push(I),delete M[I]}}return z}let C="http://www.w3.org/2000/svg",P=["div","span","nav","header","footer","section","article","aside","main",{name:"a",attrs:{href:""}},"button","input","form","label","select","option","textarea","fieldset","legend","table","tr","td","th","thead","tbody","tfoot","caption","ul","li","ol","dl","dt","dd","h1","h2","h3","h4","h5","h6","br","hr","p","i","b","em","strong","small","pre","code","kbd","samp","var","mark","abbr","cite","q","blockquote","s","u","sub","sup","time","details","summary","figure","figcaption","dialog","progress","meter","video","audio","picture",{name:"img",attrs:{src:"",alt:""}},{name:"cvs",tag:"canvas"},{name:"svg",svg:!0},{name:"svg_use",svg:!0,child:"use"}];function D(K=P){return K.map((O)=>{let M=document.createElement("template"),z=typeof O==="object",B=z?O.name:O,I=z&&O.tag?O.tag:z&&O.svg?"svg":B;M.className=B;let A=z&&O.svg?document.createElementNS(C,I):document.createElement(I);if(z&&O.attrs)for(let[w,k]of Object.entries(O.attrs))A.setAttribute(w,k);if(z&&O.child)A.appendChild(document.createElementNS(C,O.child));return M.content.appendChild(A),M})}let F={};return F.init=function(K,O={}){if(T[K])throw Error(`template.init: context '${K}' already exists. Call clearContext('${K}') first if you want to re-init.`);let{main:M,page:z}=O,B=O.tpl,I=typeof O.to==="string"?document.querySelector(O.to):O.to,A=R.get(I);if(A){let w=T[A.ctxName].map[A.id];if(!w.childCtxs)w.childCtxs=[];w.childCtxs.push(K)}if(z){let w=I;T[K]={page:I,head:w.head,ctx:w.body,map:{},styles:{},styleHandles:{},scripts:{}}}else T[K]={ctx:I,map:{}};if(M||B){let w=M?"main":K,k=typeof B==="string"?document.querySelectorAll(B+" > template"):B??D();N[w]={};let g=Array.from(k);for(let x of g)N[w][x.className]=Q(x.content.firstChild);T[K].tpl=w}else T[K].tpl="main";return T[K]},F.DEFAULT_TAGS=P,F.generateTemplateTags=D,F.registerTags=function(K,O){let M=O?T[O]?.tpl??O:"main";if(!N[M])N[M]={};let z=D(K),B=[];for(let I of z)N[M][I.className]=Q(I.content.firstChild),B.push(I.className);return B},F.reloadTags=function(K,O){let M=O?T[O]?.tpl??O:"main",z=N[M]?Object.keys(N[M]):[];N[M]={};let B=F.registerTags(K,O),I=z.filter((A)=>!B.includes(A));return{added:B,removed:I}},F.unregisterTag=function(K,O){let M=O?T[O]?.tpl??O:"main";if(N[M]&&Object.prototype.hasOwnProperty.call(N[M],K))return delete N[M][K],!0;return!1},F.container=function(K){return T[K]?.ctx??null},F.adoptNode=function(K,O,M,z){let B=T[K];if(!B)throw Error(`template.adoptNode: unknown context '${K}'`);if(B.map[O])throw Error(`template.adoptNode: id '${O}' is already registered in context '${K}'. Re-adoption with a different parentId would silently corrupt the tree.`);let I={node:M,target:M?.parentNode??null,tag:typeof M?.tagName==="string"?M.tagName.toLowerCase():"div",children:[]};if(B.map[O]=I,M)R.set(M,{ctxName:K,id:O});if(z&&B.map[z])B.map[z].children.push(O)},F.setNonce=function(K){j=K?String(K):""},F.getNonce=function(){return j},F.getCtx=function(K){return T[K]??null},F.pageAttr=function(K,O){let M=T[K].ctx;for(let[z,B]of Object.entries(O))if(Z.test(z)&&(z==="class"||z==="style"||z.startsWith("data-")))M.setAttribute(z,B)},F.elm=function(K,O,M,z=0){if(Array.isArray(O))F.elms(K,O);else if(O.tag&&typeof O.tag==="string"){if(!O.id||typeof O.id!=="string")O={...O,id:Date.now().toString(36)+z.toString()+crypto.getRandomValues(new Uint32Array(1))[0].toString(36)};let B=T[K];if(B.map[O.id]){F.clearIn(K,O.id);let I=B.map[O.id],A=Y(K,O);if(A!==null)I.node.parentNode.replaceChild(A,I.node),I.node=A,R.set(A,{ctxName:K,id:O.id});if(O.child&&Array.isArray(O.child))F.elms(K,O.child,O.id)}else{let I={node:null,target:null,tag:O.tag==="text"?"text":O.tag,children:[]};if(O.parent&&B.map[O.parent])if(I.target=B.map[O.parent].node,O.prepend)B.map[O.parent].children.unshift(O.id);else B.map[O.parent].children.push(O.id);else if(typeof M==="string"&&B.map[M])if(I.target=B.map[M].node,O.prepend)B.map[M].children.unshift(O.id);else B.map[M].children.push(O.id);else I.target=B.ctx;let A=Y(K,O);if(A!==null)U(I.target,A,O.prepend),I.node=A,B.map[O.id]=I,R.set(A,{ctxName:K,id:O.id});if(O.child&&Array.isArray(O.child))F.elms(K,O.child,O.id)}}},F.elms=function(K,O,M){O.forEach(function(z,B){F.elm(K,z,M,B)})},F.get=function(K,O){return T[K].map[O]?.node||null},F.has=function(K,O){return!!T[K]?.map[O]},F.move=function(K,O,M){let z=O instanceof Element?O.getAttribute("id"):null,B=M instanceof Element?M.getAttribute("id"):null;if(z===null||B===null)return;let I=T[K],A=I.map[z],w=I.map[B];if(!A||!w)return;let k=A.target instanceof Element?A.target.getAttribute("id"):null;if(k!==null&&I.map[k]){let g=I.map[k].children,x=g.indexOf(z);if(x!==-1)g.splice(x,1)}M.appendChild(O),A.target=M,w.children.push(z)},F.style=function(K,O,M){let z=T[K];if(S){let I=z.styleHandles[O];if(I){I.set(M);return}let A=S.attach(M,{id:O,head:z.head,nonce:j});if(z.styleHandles[O]=A,A.element)z.styles[O]=A.element;return}if(z.styles[O]){z.styles[O].textContent=M;return}let B=document.createElement("style");if(B.id=O,B.textContent=M,j)B.setAttribute("nonce",j);z.head.appendChild(B),z.styles[O]=B},F.removeStyle=function(K,O){let M=T[K];if(M.styleHandles&&M.styleHandles[O]){M.styleHandles[O].detach(),delete M.styleHandles[O],delete M.styles[O];return}if(M.styles[O])M.styles[O].remove(),delete M.styles[O]},F.script=function(K,O,M={}){let z=T[K];if(z.scripts[O])z.scripts[O].remove();let B=document.createElement("script");if(B.id=O,M.content)B.textContent=M.content;if(M.type)B.type=M.type;if(j)B.setAttribute("nonce",j);z.head.appendChild(B),z.scripts[O]=B},F.removeScript=function(K,O){let M=T[K];if(M.scripts[O])M.scripts[O].remove(),delete M.scripts[O]},F.clearContext=function(K){let O=T[K];if(!O)return;if(O.page){if(O.ctx.replaceChildren(),O.styleHandles)for(let M of Object.keys(O.styleHandles))O.styleHandles[M].detach();for(let M of Object.keys(O.styles))O.styles[M].remove();for(let M of Object.keys(O.scripts))O.scripts[M].remove()}else O.ctx.remove();delete T[K]},F.clearAll=function(K){let O=T[K],M=[];for(let z in O.map){if(!O.map[z])continue;if(O.map[z].childCtxs)for(let B of O.map[z].childCtxs)F.clearContext(B);M.push(...W(K,O.map[z].children)),M.push(z)}return O.ctx.replaceChildren(),O.map={},M},F.clearElm=function(K,O){let M=T[K];if(!M.map[O])return[];let z=M.map[O];z.node.remove();let B=W(K,z.children);return B.push(O),delete M.map[O],B},F.fromParseResult=function(K){if(!K||typeof K!=="object"||Array.isArray(K))throw TypeError("template.fromParseResult: parseResult must be an object with a `template` array");if(!Array.isArray(K.template))throw TypeError("template.fromParseResult: parseResult.template must be an array");if(K.iterates!==void 0&&(typeof K.iterates!=="object"||K.iterates===null))throw TypeError("template.fromParseResult: parseResult.iterates must be an object when present");return K},F.clearIn=function(K,O){let M=T[K];if(!M.map[O])return[];let z=M.map[O];z.node.replaceChildren();let B=W(K,z.children);return z.children=[],B},F}};var DZ={name:"sanitize",type:"fw.dom.rendering",dependencies:["secPolicy"],deps:[C$],factory(E){let S=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),T=new Set(["a","abbr","b","blockquote","br","caption","cite","code","col","colgroup","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","mark","ol","p","pre","q","s","samp","section","small","span","strong","sub","summary","sup","table","tbody","td","th","thead","tfoot","tr","u","ul","var","wbr"]),N={"*":new Set(["class","id","title","dir","lang","tabindex"]),a:new Set(["href","name","target","rel"]),img:new Set(["src","alt","width","height","loading"]),td:new Set(["colspan","rowspan","align","valign"]),th:new Set(["colspan","rowspan","align","valign","scope"]),col:new Set(["span"]),colgroup:new Set(["span"]),ol:new Set(["start","type","reversed"]),li:new Set(["value"]),q:new Set(["cite"]),blockquote:new Set(["cite"]),del:new Set(["cite","datetime"]),ins:new Set(["cite","datetime"]),details:new Set(["open"])},R=["http","https","mailto","tel","ftp"],j={tags:T,attributes:N,urlSchemes:R},Z=new Set(["script","style","iframe","object","embed","noscript","noembed","noframes","xmp","plaintext","textarea","svg","math","template","link","meta","head","frame","frameset"]),q=/<!--[\s\S]*?-->/g,$=/<\s*(\/\s*)?([a-zA-Z][a-zA-Z0-9-]*)\s*([^>]*?)\s*(\/\s*)?\s*>/g,V=/([a-zA-Z_:][a-zA-Z0-9:._-]*)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'<>`=]+)))?/g;function X(J,U,W){return E.isSafeUrl(J,U??R,!!W)}function H(J){let U={};if(!J)return U;V.lastIndex=0;let W;while((W=V.exec(J))!==null){let C=W[1].toLowerCase(),P=W[2]!==void 0?W[2]:W[3]!==void 0?W[3]:W[4]!==void 0?W[4]:"";U[C]=P}return U}let Q=new Set(["style","srcdoc","formaction","action","ping","xlink:href","xmlns","xlink:actuate","xlink:show","data-bind"]);function L(J,U,W){if(/^on[a-z]/i.test(J))return!1;if(J.startsWith("v-")||J.startsWith("ng-")||J.startsWith(":")||J.startsWith("@"))return!1;if(Q.has(J))return!1;let C=W.attributes||N,P=C["*"];if(P&&P.has(J))return!0;let D=C[U];if(D&&D.has(J))return!0;return!1}function Y(J,U,W){let C=W.urlSchemes||R,P="";for(let D of Object.keys(J)){if(!L(D,U,W))continue;let F=J[D];if(D==="href"||D==="src"){let K=W.allowDataImage&&U==="img"&&D==="src";if(!X(F,C,K))continue}if(F=String(F).replace(/[<>"]/g,"").replace(/\s+/g," ").trim(),D==="href"||D==="src")F=F.replace(/[\r\n\t]/g,"");P+=" "+D+'="'+F+'"'}if(U==="a"){let D=J.href||"",F=(J.target||"").toLowerCase().trim();if(/^https?:\/\//i.test(D.trim())&&(F==="_blank"||F!==""&&F!=="_self"&&F!=="_parent"&&F!=="_top")){let M=J.rel?J.rel.toLowerCase():"",z=M.includes("noopener"),B=M.includes("noreferrer");if(!z||!B){P=P.replace(/ rel="[^"]*"/,"");let I=[];if(M)I.push(M);if(!z)I.push("noopener");if(!B)I.push("noreferrer");P+=' rel="'+I.join(" ").trim()+'"'}}}return P}function G(J,U){if(typeof J!=="string"||J.length===0)return"";J=J.replace(/\x00/g,""),J=J.replace(q,"");let W={tags:U&&U.allowedTags?U.allowedTags instanceof Set?U.allowedTags:new Set(U.allowedTags):T,attributes:U&&U.allowedAttributes!==void 0?U.allowedAttributes:N,urlSchemes:U&&U.urlSchemes?U.urlSchemes:R,allowDataImage:U?U.allowDataImage===!0:!1},C=!(U&&U.dropDangerousContent===!1),P=J;if(C)for(let O of Z){let M=new RegExp("<\\s*"+O+"(\\s[^>]*)?>([\\s\\S]*?)<\\s*\\/\\s*"+O+"\\s*>","gi");P=P.replace(M,"");let z=new RegExp("<\\s*"+O+"\\b[^>]*>[\\s\\S]*$","gi");P=P.replace(z,"");let B=new RegExp("<\\s*"+O+"\\b[^>]*/>","gi");P=P.replace(B,"");let I=new RegExp("<\\s*"+O+"\\b[^>]*>","gi");P=P.replace(I,"")}let D=[],F=0,K;$.lastIndex=0;while((K=$.exec(P))!==null){D.push(P.slice(F,K.index)),F=K.index+K[0].length;let O=!!(K[1]&&K[1].trim()==="/"),M=K[2].toLowerCase(),z=K[3]||"",B=!!(K[4]&&K[4].trim()==="/");if(!W.tags.has(M))continue;if(O){D.push("</"+M+">");continue}let I=H(z),A=Y(I,M,W);if(B||S.has(M))D.push("<"+M+A+" />");else D.push("<"+M+A+">")}return D.push(P.slice(F)),D.join("")}return{sanitizeHtml:G,isSafeUrl:X,defaultAllowlist:j}}};var l$={name:"uiSessionCore",version:"1.0.0",type:"fw.dom.rendering",dependencies:["template","render","parser","dom","events"],deps:[w$,I$,c$,F$,D$],factory(E,S,T,N,R){function j($){if($.template)return $;if(!$.block)return $;let V=$.attach?.name,X=V&&$.block.iterates?.[V]?$.block.iterates[V]:$.block.template,H={...$,template:X};return delete H.block,H}function Z($){let V=new Set($.map((Q)=>Q.id)),X=[],H=new Map;for(let Q of $)if(Q.parent==null||!V.has(Q.parent)){let Y=[{...Q,prepend:!0}];X.push(Y),H.set(Q.id,Y)}else{let Y=H.get(Q.parent);Y.push(Q),H.set(Q.id,Y)}return X.reverse().flat()}return{methods:{parse($){return T.fromHTML($)},get($,V){let X=this._map.get($);if(!X)return null;if(Array.isArray(X))return null;if(V!==void 0){let Q=X.get(V);if(!Q)return null;return E.get(this._container,Q)}let H=X.get($)??X.values().next().value;if(!H)return null;return E.get(this._container,H)},_resolveSlotElement($,V){let X=this._attach.get($)?.content?.get(V);if(!X)return null;return E.get(this._container,X)},query($,V,X){let H=this.get($,V);if(!H)return null;return N.query(H,X)},queryAll($,V,X){let H=this.get($,V);if(!H)return[];return N.queryAll(H,X)},*iterate($){let V=this._map.get($);if(!V||Array.isArray(V))return;for(let[X,H]of V){let Q=E.get(this._container,H);if(Q)yield[X,Q]}},exists($,V){let X=this._map.get($);if(!X)return!1;if(Array.isArray(X)){if(V==null)return X.length>0;return!1}if(V==null)return!0;return X.has(V)},hydrate($,V={}){if(!Array.isArray($))throw Error("uiSession.hydrate: items must be an array");let X=V.idPrefix||"",H=E.container(this._container);if(!H)throw Error(`uiSession.hydrate: container '${this._container}' is not initialized (call template.init first)`);let Q=(U)=>X?`${X}:${U}`:U,L=(U)=>{let W=`[data-fw-id="${CSS.escape(Q(U))}"]`;return H.querySelector(W)},Y=V.onMismatch||"throw",G=[];function J(U){if(typeof Y==="function")try{return Y(U)}catch{return"throw"}return Y}$:for(let U of $){let W=j(U),C=W.template;if(!C)continue;let P=W.id,D=new Map,F=new Map;for(let K of C){let O=Q(K.id),M=L(K.id);if(!M){let B=J({blockId:P,elm:K,realId:O,item:W,idPrefix:X});if(B==="rebuild"){G.push(U);continue $}if(B==="skip")continue $;throw Error(`uiSession.hydrate: no DOM node found for data-fw-id="${O}" (block '${P??"<anonymous>"}', template elm id='${K.id}'). Check that SSR was rendered with idPrefix='${X}' and the same template as the client. Pass opts.onMismatch='rebuild' to fall back to client render.`)}let z=K.parent?Q(K.parent):void 0;if(!E.has(this._container,O))E.adoptNode(this._container,O,M,z);if(D.set(K.id,O),K.content)F.set(K.content,O)}if(P){if(this._map.set(P,D),F.size>0)this._attach.set(P,{content:F})}if(P&&W.attach&&W.attach.elm){let K=this._children.get(W.attach.elm);if(!K)K=new Set,this._children.set(W.attach.elm,K);K.add(P)}}if(this._fireMount($.map((U)=>U&&U.id).filter(Boolean)),G.length>0)this.add(G);return this},add($){for(let X of $)if(X&&X.id&&X.attach&&X.attach.elm){let H=this._children.get(X.attach.elm);if(!H)H=new Set,this._children.set(X.attach.elm,H);H.add(X.id)}let V=0;while(V<$.length){let X=!!($[V]&&$[V].prepend),H=V+1;while(H<$.length&&!!($[H]&&$[H].prepend)===X)H++;let Q=S.full($.slice(V,H).map(j),this._attach,this._map);E.elms(this._container,X?Z(Q.arr):Q.arr),V=H}return this._fireMount($.map((X)=>X&&X.id).filter(Boolean)),this},append($){return this.add($)},prepend($){return this.add($.map((V)=>({prepend:!0,...V})))},mount($,V,X){if(typeof X!=="function")throw Error("uiSession.mount: factory must be a function");let H=V?this._resolveSlotElement($,V):this.get($);if(!H)throw Error(`uiSession.mount: no ${V?`slot '${V}'`:"root"} resolved for block '${$}' (mount the block before calling mount)`);let Q=X(H,$);if(Q&&(typeof Q==="object"||typeof Q==="function")){if(typeof Q==="function"||Q.dispose||Q.destroy||Q.abort||Q.close||Q.stop||Q.clear)this.adopt($,Q)}return Q},adopt($,V){let X=typeof V==="function"?V:V&&(V.dispose||V.destroy||V.abort||V.close||V.stop||V.clear);if(typeof X!=="function")throw Error("uiSession.adopt: resource must be a function or expose one of {dispose, destroy, abort, close, stop, clear}");let H=this._unmount.get($);return this._unmount.set($,()=>{try{X.call(V)}catch{}if(H)H()}),V},onUnmount($,V){if(typeof V==="function")this._unmount.set($,V);else this._unmount.delete($);return this},onMount($,V){if(typeof V!=="function")return this._mount.delete($),this;if(this._map.has($))try{V()}catch{}else this._mount.set($,V);return this},_fireMount($){for(let V of $){if(!V)continue;let X=this._mount.get(V);if(!X)continue;this._mount.delete(V);try{X()}catch{}}},_fireUnmount($){let V=this._unmount.get($);if(!V)return;this._unmount.delete($);try{V()}catch{}},off($){R.off($);for(let[,V]of this._listeners)for(let[,X]of V)X.delete($);return this},_offTracked($,V){let X=this._listeners.get($);if(!X)return;if(V==null){for(let H of X.values())for(let Q of H)R.off(Q);this._listeners.delete($)}else{let H=X.get(V);if(H){for(let Q of H)R.off(Q);X.delete(V)}}},remove($,V){let X=this._map.get($)?.get(V);if(X){if(E.clearElm(this._container,X),this._map.get($).delete(V),this._offTracked($,V),this._map.get($)?.size===0)this._fireUnmount($),this._map.delete($),this._disposeListsFor($)}return this},clear($,V){if($==null){for(let X of[...this._unmount.keys()])this._fireUnmount(X);if(this._portals)for(let X of[...this._portals.keys()])this.closePortal(X);E.clearAll(this._container),this._map.clear(),this._attach.clear(),this._children.clear();for(let X of[...this._listeners.keys()])this._offTracked(X);this._listeners.clear();for(let X of[...this._lists.keys()])this._disposeListsFor(X);this._lists.clear()}else if(V!=null){let X=this._map.get($)?.get(V);if(X)E.clearIn(this._container,X)}else{let X=this._children.get($);if(X){for(let Q of[...X])this.clear(Q);this._children.delete($)}this._fireUnmount($);let H=this._map.get($);if(H)H.forEach((Q)=>E.clearElm(this._container,Q)),this._map.delete($);this._offTracked($),this._disposeListsFor($)}return this},move($,V,X,H){let Q=this.get($,V),L=this.get(X,H);if(Q&&L)E.move(this._container,Q,L);return this},replace($,V){return this.clear($),this.add(V)},portal($,V={}){if(!this._portals)this._portals=new Map;let X=this._portals.get($);if(X)return X;let H=V.to??(typeof document<"u"?document.body:null);if(!H)throw Error(`uiSession.portal: no target element resolved for '${$}'`);let Q=`${this._container}\x1Fportal\x1F${$}`,L=H.ownerDocument.createElement("div");L.setAttribute("data-fw-portal",String($)),H.appendChild(L),E.init(Q,{to:L});let Y=new this.constructor(Q);return Y._isPortal=!0,Y._portalParent=this,Y._portalName=$,this._portals.set($,Y),Y},closePortal($){let V=this._portals?.get($);if(!V)return this;return V.clear(),E.clearContext?.(V._container),this._portals.delete($),this},_disposeListsFor($){let V=this._lists.get($);if(!V)return;for(let X of V.values())X._dispose();this._lists.delete($)}},resolveTemplate:j}}};var i$={name:"uiSessionDirect",version:"1.0.0",type:"fw.dom.rendering",dependencies:["dom","events"],deps:[F$,D$],factory(E,S){return{methods:{text(N,R,j){let Z=arguments.length===2,q=Z?this.get(N):this.get(N,R),$=Z?R:j;if(q)E.text(q,$);return this},attr(N,R,j,Z){let q=arguments.length===3,$=q?this.get(N):this.get(N,R),V=q?R:j,X=q?j:Z;if(!$)return this;if(X===null||X===!1||X===void 0)E.attrRemove($,V);else E.attr($,V,X);return this},on(N,R,j,Z,q,$){let V=typeof R==="string"&&typeof j==="function",X=V?N:R,H=V?R:j,Q=V?j:Z,L=V?Z:q,Y=V?q:$,G=V?this.get(N):this.get(N,R);if(!G)return null;let J=L||`fw:ui:${this._container}:${++this._lseq}`;if(S.on(J,G,H,Q,Y),!this._listeners.has(N))this._listeners.set(N,new Map);let U=this._listeners.get(N);if(!U.has(X))U.set(X,new Set);return U.get(X).add(J),J},bind(N,R,j,Z,q){if(!N||typeof N.subscribe!=="function")throw Error("uiSession.bind: first arg must be a signal");let $,V,X;if(arguments.length<=3)$=void 0,V=j??"text",X=void 0;else if(arguments.length===4&&Z!==null&&typeof Z==="object")$=void 0,V=j,X=Z;else $=j,V=Z??"text",X=q;let H=X&&typeof X.transform==="function"?X.transform:null,Q=typeof V==="string"?V.indexOf(":"):-1,L=Q>0?V.slice(0,Q):null,Y=Q>0?V.slice(Q+1):null,G=null,J=(C)=>{let P=H?H(C):C,D=$===void 0?this.get(R):this.get(R,$);if(!D)return;if(V==="text"){E.text(D,P);return}if(V==="class"){if(G!=null)E.classRemove(D,G);if(G=P==null||P===!1||P===""?null:String(P),G)E.classAdd(D,G);return}if(L==="class"){if(P)E.classAdd(D,Y);else E.classRemove(D,Y);return}if(L==="style"){if(P==null||P===!1)D.style.removeProperty(Y);else E.style(D,Y,String(P));return}if(L==="prop"){try{D[Y]=P}catch{}return}if(P===null||P===!1||P===void 0)E.attrRemove(D,V);else E.attr(D,V,P)};J(N.get());let U=N.subscribe(J),W=this._unmount.get(R);return this._unmount.set(R,()=>{if(U(),W)W()}),U}}}}};var n$={name:"hex",version:"1.0.0",type:"fw.io.codec",dependencies:[],factory(){let S=new Int8Array(128).fill(-1);for(let L=0;L<16;L++)if(S["0123456789abcdef".charCodeAt(L)]=L,L>=10)S["ABCDEF".charCodeAt(L-10)]=L;let T=Uint8Array.from("0123456789abcdef",(L)=>L.charCodeAt(0)),N=new Uint8Array(new Uint16Array([1]).buffer)[0]===1,R=new Uint16Array(256);for(let L=0;L<256;L++){let Y=T[L>>4],G=T[L&15];R[L]=N?Y|G<<8:Y<<8|G}let j=Uint8Array.prototype,Z=typeof j.toHex==="function"?j.toHex:null,q=typeof TextDecoder==="function"?new TextDecoder:null,$=8192;function V(L){if(q)return q.decode(L);if(L.length<=$)return String.fromCharCode.apply(null,L);let Y=[];for(let G=0;G<L.length;G+=$)Y.push(String.fromCharCode.apply(null,L.subarray(G,G+$)));return Y.join("")}return{toBytes:(L)=>{let Y=L.length;if(Y%2!==0)throw Error(`hex: odd-length input (length ${Y})`);let G=new Uint8Array(Y>>1);for(let J=0,U=0;J<Y;J+=2,U++){let W=L.charCodeAt(J),C=L.charCodeAt(J+1),P=W<128?S[W]:-1,D=C<128?S[C]:-1;if(P<0||D<0)throw Error(`hex: invalid character at index ${P<0?J:J+1}`);G[U]=P<<4|D}return G},fromBytes:(L)=>{if(Z&&L instanceof Uint8Array)return Z.call(L);let Y=L.length,G=new Uint16Array(Y);for(let J=0;J<Y;J++)G[J]=R[L[J]&255];return V(new Uint8Array(G.buffer))},test:(L)=>{if(typeof L!=="string")return!1;if(L.length%2!==0)return!1;return/^[0-9a-fA-F]*$/.test(L)}}}};var BZ={name:"b64",version:"1.0.0",type:"fw.io.codec",dependencies:[],factory(){let E=[],S="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(let B=0;B<64;B++)E["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(B)]=B;function T(B,I,A,w){return E[B.charCodeAt(0)]<<18|E[I.charCodeAt(0)]<<12|E[A.charCodeAt(0)]<<6|E[w.charCodeAt(0)]}function N(B,I){B.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[I>>2]),B.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[I<<4&63]),B.push("==")}function R(B,I){B.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[I>>10]),B.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[I>>4&63]),B.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[I<<2&63]),B.push("=")}function j(B,I){B.push(I>>8&255),B.push(I&255)}function Z(B,I,A,w,k){if(B[w-2]==="=")k=2;else if(B[w-1]==="=")k=1;w=k>0?w-4:w;let g;for(g=0;g<w;g+=4)A=T(B[g],B[g+1],B[g+2],B[g+3]),I.push(A>>16&255),I.push(A>>8&255),I.push(A&255);if(k===2)I.push((E[B.charCodeAt(g)]<<2|E[B.charCodeAt(g+1)]>>4)&255);else if(k===1)j(I,E[B.charCodeAt(g)]<<10|E[B.charCodeAt(g+1)]<<4|E[B.charCodeAt(g+2)]>>2);return new Uint8Array(I)}let q=Uint8Array.from("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",(B)=>B.charCodeAt(0)),$=new Uint8Array(new Uint16Array([1]).buffer)[0]===1,V=new Uint16Array(4096);for(let B=0;B<4096;B++){let I=q[B>>6],A=q[B&63];V[B]=$?I|A<<8:I<<8|A}let X=new Uint8Array(256).fill(64);for(let B=0;B<64;B++)X["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(B)]=B;let H=Uint8Array,Q=typeof H.prototype.toBase64==="function"?H.prototype.toBase64:null,L=typeof H.fromBase64==="function"?H.fromBase64:null,Y=typeof TextDecoder==="function"?new TextDecoder:null,G=8192;function J(B){if(Y)return Y.decode(B);if(B.length<=G)return String.fromCharCode.apply(null,B);let I=[];for(let A=0;A<B.length;A+=G)I.push(String.fromCharCode.apply(null,B.subarray(A,A+G)));return I.join("")}function U(B){let I=B.length,A=I%3,w=I-A,k=new Uint16Array(w/3*2);for(let f=0,y=0;f<w;f+=3,y+=2){let _=(B[f]<<16)+(B[f+1]<<8)+B[f+2];k[y]=V[_>>12&4095],k[y+1]=V[_&4095]}let g=J(new Uint8Array(k.buffer));if(A===0)return g;let x=[];if(A===1)N(x,B[I-1]);else R(x,(B[I-2]<<8)+B[I-1]);return g+x.join("")}function W(B){let I=B.length;if(I%4!==0)return null;if(I===0)return new Uint8Array(0);let A=0;if(B.charCodeAt(I-1)===61)A=B.charCodeAt(I-2)===61?2:1;else if(B.charCodeAt(I-2)===61)return null;let w=new Uint8Array(I/4*3-A),k=A?I-4:I,g=0,x=0,f=0;for(let y=0;y<k;y+=4){let _=B.charCodeAt(y),v=B.charCodeAt(y+1),b=B.charCodeAt(y+2),h=B.charCodeAt(y+3);x|=_|v|b|h;let d=X[_],n=X[v],m=X[b],c=X[h];g|=d|n|m|c;let o=d<<18|n<<12|m<<6|c;w[f++]=o>>16,w[f++]=o>>8,w[f++]=o}if(A){let y=B.charCodeAt(k),_=B.charCodeAt(k+1),v=A===1?B.charCodeAt(k+2):65;x|=y|_|v;let b=X[y],h=X[_],d=X[v];if(g|=b|h|d,w[f++]=b<<2|h>>4,A===1)w[f]=h<<4|d>>2}return g&64||x>255?null:w}let C=function(B){if(Q&&B instanceof Uint8Array)return Q.call(B);return U(B)},P=function(B){if(typeof B!=="string")return Z(B,[],0,B.length,0);let I=B.length;if(L&&I%4===0&&I>0){let A=B.charCodeAt(I-1)===61,w=B.charCodeAt(I-2)===61;if(A||!w)try{let k=L(B);if(k.length===I/4*3-(A?w?2:1:0))return k}catch{}}return W(B)||Z(B,[],0,I,0)},D=function(B){return/^(?=(.{4})*$)[A-Za-z0-9+/]*={0,2}$/.test(B)},F="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",K=function(B){return C(B).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},O=function(B){if(typeof B!=="string"||!/^[A-Za-z0-9\-_]*$/.test(B))return!1;let I=B.length%4;if(I===1)return!1;if(I===0)return!0;let A=I===2?4:2;return(F.indexOf(B[B.length-1])&(1<<A)-1)===0};return{fromBytes:C,toBytes:P,test:D,url:{fromBytes:K,toBytes:function(B){if(!O(B))return!1;let I=B.replace(/-/g,"+").replace(/_/g,"/");return P(I+"=".repeat((4-B.length%4)%4))},test:O}}}};var R$={name:"utf8",version:"1.0.0",type:"fw.io.codec",dependencies:[],factory(){let E=typeof TextEncoder<"u",S=typeof TextDecoder<"u",T=E?new TextEncoder:null,N=S?new TextDecoder("utf-8",{fatal:!1}):null;function R($){let V=$.length,X=new Uint8Array(V*3),H=0;for(let Q=0;Q<V;Q++){let L=$.charCodeAt(Q);if(L>=55296&&L<=56319){let Y=Q+1<V?$.charCodeAt(Q+1):-1;if(Y>=56320&&Y<=57343)L=65536+(L-55296<<10)+(Y-56320),Q++;else L=65533}else if(L>=56320&&L<=57343)L=65533;if(L<128)X[H++]=L;else if(L<2048)X[H++]=192|L>>6,X[H++]=128|L&63;else if(L<65536)X[H++]=224|L>>12,X[H++]=128|L>>6&63,X[H++]=128|L&63;else X[H++]=240|L>>18,X[H++]=128|L>>12&63,X[H++]=128|L>>6&63,X[H++]=128|L&63}return X.subarray(0,H)}function j($){let V=[],X=$.length,H=0;while(H<X){let Q=$[H],L;if(Q<128)L=Q,H+=1;else if(Q<192)L=65533,H+=1;else if(Q<224){if(H+1>=X){V.push(String.fromCharCode(65533));break}L=(Q&31)<<6|$[H+1]&63,H+=2}else if(Q<240){if(H+2>=X){V.push(String.fromCharCode(65533));break}L=(Q&15)<<12|($[H+1]&63)<<6|$[H+2]&63,H+=3}else if(Q<248){if(H+3>=X){V.push(String.fromCharCode(65533));break}L=(Q&7)<<18|($[H+1]&63)<<12|($[H+2]&63)<<6|$[H+3]&63,H+=4}else L=65533,H+=1;if(L<65536)V.push(String.fromCharCode(L));else L-=65536,V.push(String.fromCharCode(55296|L>>10,56320|L&1023))}return V.join("")}return{toBytes:function($){if($===""||$==null)return new Uint8Array(0);if(T)return T.encode(String($));return R(String($))},fromBytes:function($){if(!$||$.length===0)return"";if(N){let V=$ instanceof Uint8Array?$:new Uint8Array($);return N.decode(V)}return j($)}}}};var PZ={name:"url",version:"1.0.0",type:"fw.io.codec",dependencies:[],factory(){function E(J,U){let W=encodeURIComponent(String(J));return U==="plus"?W.replace(/%20/g,"+"):W}function S(J,U){try{if(U==="plus")J=J.replace(/\+/g," ");return decodeURIComponent(J)}catch{return J}}function T(J){if(J.indexOf("[")<0)return[J];let U=[],W=J.indexOf("[");U.push(J.slice(0,W));let C=W,P=J.length;while(C<P&&J[C]==="["){let D=J.indexOf("]",C);if(D<0)return U.push(J.slice(C)),U;U.push(J.slice(C+1,D)),C=D+1}return U}function N(J,U,W){let C=J;for(let P=0;P<U.length;P++){let D=U[P],F=P===U.length-1;if(D===""){if(!Array.isArray(C))return;if(F)C.push(W);else{let K={};C.push(K),C=K}continue}if(F)if(Array.isArray(C)){let K=/^\d+$/.test(D)?parseInt(D,10):null;if(K!==null)C[K]=W}else if(D in C){let K=C[D];if(Array.isArray(K))K.push(W);else C[D]=[K,W]}else C[D]=W;else{let K=U[P+1],O=K===""||/^\d+$/.test(K);if(Array.isArray(C)){let M=/^\d+$/.test(D)?parseInt(D,10):C.length;if(!C[M])C[M]=O?[]:{};C=C[M]}else{if(!(D in C))C[D]=O?[]:{};C=C[D]}}}}function R(J,U){U=U||{};let W=U.arrayFormat||"repeat",C=!!U.nested,P=U.space||"percent",D=U.delimiter||"&",F={};if(!J)return F;if(J[0]==="?"||J[0]==="#")J=J.slice(1);if(!J)return F;let K=J.split(D);for(let O=0;O<K.length;O++){let M=K[O];if(M==="")continue;let z=M.indexOf("="),B,I;if(z<0)B=M,I="";else B=M.slice(0,z),I=M.slice(z+1);let A=S(B,P),w=S(I,P);if(W==="comma"&&w.indexOf(",")>=0)w=w.split(",");if(C||W==="brackets"||W==="indices"){let k=T(A);if(k.length>1){if(Array.isArray(w))for(let g=0;g<w.length;g++)N(F,k,w[g]);else N(F,k,w);continue}}if(W==="none")F[A]=Array.isArray(w)?w[w.length-1]:w;else if(A in F){let k=F[A];if(Array.isArray(k))if(Array.isArray(w))for(let g of w)k.push(g);else k.push(w);else F[A]=Array.isArray(w)?[k,...w]:[k,w]}else F[A]=w}return F}function j(J,U,W,C){if(W===void 0)return;if(W===null){J.push(E(U,C)+"=");return}J.push(E(U,C)+"="+E(W,C))}function Z(J,U){U=U||{};let W=U.arrayFormat||"repeat",C=!!U.nested,P=U.space||"percent",D=U.delimiter||"&",F=!!U.skipNull;if(!J||typeof J!=="object")return"";let K=[],O=(z,B)=>{if(B===void 0&&F)return;if(B===null&&F)return;if(Array.isArray(B)){if(B.length===0)return;switch(W){case"brackets":for(let I of B)O(z+"[]",I);return;case"indices":for(let I=0;I<B.length;I++)O(z+"["+I+"]",B[I]);return;case"comma":K.push(E(z,P)+"="+B.map((I)=>E(I==null?"":I,P)).join(","));return;case"repeat":default:for(let I of B)j(K,z,I,P);return}}if(C&&B&&typeof B==="object"&&!(B instanceof Date)){for(let I of Object.keys(B))O(z+"["+I+"]",B[I]);return}if(B instanceof Date)B=B.toISOString();j(K,z,B,P)},M=U.sort?Object.keys(J).sort():Object.keys(J);for(let z of M)O(z,J[z]);return K.join(D)}function q(J,U,W){let C=W&&W.space||"plus";if(typeof URL==="function"){let k=U?new URL(J,U):new URL(J);return{protocol:k.protocol,username:k.username,password:k.password,hostname:k.hostname,port:k.port,host:k.host,pathname:k.pathname,search:k.search,hash:k.hash,origin:k.origin,href:k.href,query:R(k.search,{space:C})}}let P=/^(?:([a-z][a-z0-9+\-.]*:))?(?:\/\/((?:([^:@/]*)(?::([^@/]*))?@)?(\[[^\]]*\]|[^:/?#]*)(?::(\d+))?))?([^?#]*)(\?[^#]*)?(#.*)?$/i.exec(J);if(!P)throw Error("url: cannot parse");let D=P[1]||"",F=P[3]||"",K=P[4]||"",O=P[5]||"",M=P[6]||"",z=P[7]||"",B=P[8]||"",I=P[9]||"",A=O+(M?":"+M:""),w=D&&O?D+"//"+A:"";return{protocol:D,username:F,password:K,hostname:O,port:M,host:A,pathname:z,search:B,hash:I,origin:w,href:J,query:R(B,{space:C})}}let $=new Set(["http","https","ws","wss","ftp","file"]);function V(J){if(!J)return"";let U="";if(J.protocol){if(U+=J.protocol,!U.endsWith(":"))U+=":";let W=U.slice(0,-1).toLowerCase();if(J.host||J.hostname||$.has(W))U+="//"}if(J.username){if(U+=encodeURIComponent(J.username),J.password)U+=":"+encodeURIComponent(J.password);U+="@"}if(J.host)U+=J.host;else if(J.hostname){if(U+=J.hostname,J.port)U+=":"+J.port}if(J.pathname)U+=J.pathname.startsWith("/")||!J.hostname?J.pathname:"/"+J.pathname;if(J.query!==void 0&&J.query!==null&&J.query!==""){let W=typeof J.query==="string"?J.query:Z(J.query);if(W)U+="?"+W}else if(J.search)U+=J.search.startsWith("?")?J.search:"?"+J.search;if(J.hash)U+=J.hash.startsWith("#")?J.hash:"#"+J.hash;return U}let X=";/?:@&=+$,-_.!~*'()#";function H(J){let U=Array(128);for(let W=0;W<128;W++){let C=String.fromCharCode(W);if(/[0-9A-Za-z]/.test(C))U[W]=C;else U[W]="%"+("0"+W.toString(16).toUpperCase()).slice(-2)}for(let W=0;W<J.length;W++)U[J.charCodeAt(W)]=J[W];return U}let Q=H(X),L=/^[0-9a-fA-F]{2}$/;function Y(J,U){if(!J)return J===""?"":String(J);let W=U&&U.safe!==void 0?H(U.safe):Q,C="",P=J.length;for(let D=0;D<P;D++){let F=J.charCodeAt(D);if(F===37&&D+2<P){if(L.test(J.slice(D+1,D+3))){C+=J.slice(D,D+3),D+=2;continue}}if(F<128){C+=W[F];continue}if(F>=55296&&F<=57343){if(F<=56319&&D+1<P){let K=J.charCodeAt(D+1);if(K>=56320&&K<=57343){C+=encodeURIComponent(J[D]+J[D+1]),D++;continue}}C+="%EF%BF%BD";continue}C+=encodeURIComponent(J[D])}return C}function G(J){if(!J)return J===""?"":String(J);try{return decodeURIComponent(J)}catch{return J}}return{parseQuery:R,stringifyQuery:Z,parseURL:q,buildURL:V,encodeSafe:Y,decodeSafe:G}}};var o$={name:"unicode",version:"1.0.0",type:"fw.io.text",dependencies:[],factory(){let E=new Set(["NFC","NFD","NFKC","NFKD"]);function S(X,H="NFC"){if(typeof X!=="string")throw Error("unicode.normalize: str must be a string");if(!E.has(H))throw Error(`unicode.normalize: unknown form "${H}"`);return X.normalize(H)}function T(X,H){if(H)return X.toLocaleLowerCase(H);return X.toLowerCase()}function N(X,H,Q={}){let{locale:L,...Y}=Q;return new Intl.Collator(L,Y).compare(X,H)}function R(X={}){let{locale:H,...Q}=X,L=new Intl.Collator(H,Q);return{compare:L.compare.bind(L),sort:(Y)=>[...Y].sort(L.compare.bind(L))}}function*j(X){if(typeof Intl<"u"&&typeof Intl.Segmenter==="function"){let H=new Intl.Segmenter(void 0,{granularity:"grapheme"});for(let{segment:Q}of H.segment(X))yield Q}else for(let H of X)yield H}let Z=[[4352,4447],[11904,12031],[12032,12287],[12288,12351],[12352,13311],[13312,19903],[19968,40959],[40960,42191],[43360,43391],[44032,55295],[63744,64255],[65040,65055],[65072,65135],[65280,65376],[65504,65510],[110592,110847],[127744,129535],[131072,173791],[173824,183983],[183984,191471]];function q(X){if(X===0)return 0;if(X<32||X>=127&&X<160)return 0;if(X>=768&&X<=879)return 0;if(X>=8203&&X<=8207)return 0;for(let[H,Q]of Z)if(X>=H&&X<=Q)return 2;return 1}function $(X){let H=0;for(let Q of j(X)){let L=Q.codePointAt(0);H+=q(L)}return H}function V(X){return X.normalize("NFD").replace(/\p{Mn}/gu,"").normalize("NFC")}return{normalize:S,casefold:T,compare:N,collator:R,graphemes:j,width:$,stripDiacritics:V}}};var CZ={name:"str",version:"1.0.0",type:"fw.io.text",dependencies:["unicode"],deps:[o$],factory(E){function S(G){return G.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/([a-zA-Z])(\d)/g,"$1 $2").replace(/(\d)([a-zA-Z])/g,"$1 $2").split(/[\s\-_]+/).filter((U)=>U.length>0)}function T(G){let J=S(G);if(!J.length)return"";return J[0].toLowerCase()+J.slice(1).map((U)=>U[0].toUpperCase()+U.slice(1).toLowerCase()).join("")}function N(G){return S(G).map((J)=>J[0].toUpperCase()+J.slice(1).toLowerCase()).join("")}function R(G){return S(G).map((J)=>J.toLowerCase()).join("-")}function j(G){return S(G).map((J)=>J.toLowerCase()).join("_")}function Z(G){return S(G).map((J)=>J.toUpperCase()).join("_")}function q(G){return S(G).map((J)=>J[0].toUpperCase()+J.slice(1).toLowerCase()).join(" ")}function $(G,J={}){let{separator:U="-",lower:W=!0}=J,C=E.stripDiacritics(G);if(W)C=E.casefold(C);return C=C.replace(/[^a-zA-Z0-9]+/g,U),C=C.replace(new RegExp(`^${Q(U)}+|${Q(U)}+$`,"g"),""),C=C.replace(new RegExp(`${Q(U)}{2,}`,"g"),U),C}function V(G,J,U={}){let{suffix:W="…",wordBoundary:C=!0}=U;if(G.length<=J)return G;let P=J-W.length;if(P<=0)return W.slice(0,J);let D=G.slice(0,P);if(C){let F=D.lastIndexOf(" ");if(F>0)D=D.slice(0,F)}return D+W}function X(G,J,U=" ",W="left"){if(G.length>=J)return G;let C=J-G.length,P=U.repeat(Math.ceil(C/U.length)).slice(0,C);if(W==="right")return G+P;if(W==="both"){let D=Math.floor(C/2),F=C-D;return U.repeat(D).slice(0,D)+G+U.repeat(F).slice(0,F)}return P+G}function H(G,J){return G.replace(/\{(\w+)\}/g,(U,W)=>(W in J)?String(J[W]):`{${W}}`)}function Q(G){return G.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function L(G){return G.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Y(G,J){if(G===J)return 1;let U=G.length,W=J.length;if(U===0&&W===0)return 1;if(U===0||W===0)return 0;let C=Array.from({length:W+1},(P,D)=>D);for(let P=1;P<=U;P++){let D=C[0];C[0]=P;for(let F=1;F<=W;F++){let K=C[F];C[F]=G[P-1]===J[F-1]?D:1+Math.min(D,C[F],C[F-1]),D=K}}return 1-C[W]/Math.max(U,W)}return{splitWords:S,camelCase:T,pascalCase:N,kebabCase:R,snakeCase:j,constantCase:Z,titleCase:q,slug:$,truncate:V,pad:X,format:H,escapeRegExp:Q,escapeHTML:L,similarity:Y}}};var RZ={name:"date",version:"1.0.0",type:"fw.io.time",dependencies:[],factory(){function E(G){return G instanceof Date&&!isNaN(G.getTime())}function S(G,J={}){let{locale:U="en-US",...W}=J;return new Intl.DateTimeFormat(U,W).format(G)}let T=[{unit:"year",ms:31557600000},{unit:"month",ms:2630016000},{unit:"week",ms:604800000},{unit:"day",ms:86400000},{unit:"hour",ms:3600000},{unit:"minute",ms:60000},{unit:"second",ms:1000}];function N(G,J,U={}){if(J===void 0||J===null)J=new Date;let{locale:W="en-US",...C}=U,P=G.getTime()-J.getTime(),D=Math.abs(P),F=new Intl.RelativeTimeFormat(W,{numeric:"auto",...C});for(let{unit:K,ms:O}of T)if(D>=O||K==="second"){let M=Math.round(P/O);return F.format(M,K)}return F.format(0,"second")}let R=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:?\d{2})$/;function j(G){if(typeof G!=="string"||!R.test(G))return null;let J=new Date(G);return E(J)?J:null}function Z(G,J){if(!J){let x=new Date(G);return E(x)?x:null}let U={YYYY:null,MM:null,DD:null,HH:null,mm:null,ss:null,SSS:null},C=J.replace(/YYYY/g,"(\\d{4})").replace(/MM/g,"(\\d{2})").replace(/DD/g,"(\\d{2})").replace(/HH/g,"(\\d{2})").replace(/mm/g,"(\\d{2})").replace(/ss/g,"(\\d{2})").replace(/SSS/g,"(\\d{3})"),P=[],D=J,K=["YYYY","MM","DD","HH","mm","ss","SSS"].map((x)=>({t:x,idx:D.indexOf(x)})).filter((x)=>x.idx!==-1).sort((x,f)=>x.idx-f.idx);for(let{t:x}of K)P.push(x);let O=new RegExp("^"+C+"$").exec(G);if(!O)return null;for(let x=0;x<P.length;x++)U[P[x]]=parseInt(O[x+1],10);let M=U.YYYY??0,z=(U.MM??1)-1,B=U.DD??1,I=U.HH??0,A=U.mm??0,w=U.ss??0,k=U.SSS??0,g=new Date(M,z,B,I,A,w,k);return E(g)?g:null}function q(G,J,U,W){let C=new Date(G.getTime()),P=new Date(J,U+1,0).getDate();return C.setFullYear(J,U,Math.min(W,P)),C}function $(G,J,U){switch(U){case"years":return q(G,G.getFullYear()+J,G.getMonth(),G.getDate());case"months":return q(G,G.getFullYear(),G.getMonth()+J,G.getDate());case"weeks":{let W=new Date(G.getTime());return W.setDate(G.getDate()+J*7),W}case"days":{let W=new Date(G.getTime());return W.setDate(G.getDate()+J),W}case"hours":{let W=new Date(G.getTime());return W.setTime(G.getTime()+J*3600000),W}case"minutes":{let W=new Date(G.getTime());return W.setTime(G.getTime()+J*60000),W}case"seconds":{let W=new Date(G.getTime());return W.setTime(G.getTime()+J*1000),W}case"ms":{let W=new Date(G.getTime());return W.setTime(G.getTime()+J),W}default:throw Error(`date.add: unknown unit "${U}"`)}}function V(G,J,U){return $(G,-J,U)}function X(G,J,U){let W=G.getTime()-J.getTime();switch(U){case"years":return Math.trunc(G.getFullYear()-J.getFullYear()+(G.getMonth()-J.getMonth())/12);case"months":{let C=G.getFullYear()-J.getFullYear(),P=G.getMonth()-J.getMonth(),D=C*12+P,F=D>=0?1:-1,K=G.getDate(),O=J.getDate();if(F>0&&K<O)return D-1;if(F<0&&K>O)return D+1;return D}case"weeks":return Math.trunc(W/604800000);case"days":return Math.trunc(W/86400000);case"hours":return Math.trunc(W/3600000);case"minutes":return Math.trunc(W/60000);case"seconds":return Math.trunc(W/1000);case"ms":return W;default:throw Error(`date.diff: unknown unit "${U}"`)}}function H(G,J){let U=new Date(G.getTime());switch(J){case"years":U.setMonth(0,1),U.setHours(0,0,0,0);break;case"months":U.setDate(1),U.setHours(0,0,0,0);break;case"days":U.setHours(0,0,0,0);break;case"hours":U.setMinutes(0,0,0);break;case"minutes":U.setSeconds(0,0);break;case"seconds":U.setMilliseconds(0);break}return U}function Q(G,J){let U=new Date(G.getTime());switch(J){case"years":U.setMonth(11,31),U.setHours(23,59,59,999);break;case"months":{let W=new Date(U.getFullYear(),U.getMonth()+1,0).getDate();U.setDate(W),U.setHours(23,59,59,999);break}case"days":U.setHours(23,59,59,999);break;case"hours":U.setMinutes(59,59,999);break;case"minutes":U.setSeconds(59,999);break;case"seconds":U.setMilliseconds(999);break}return U}function L(G,J){let U={timeZone:J,hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"},W=new Intl.DateTimeFormat("en-CA",U).formatToParts(G),C=(D)=>parseInt(W.find((F)=>F.type===D).value,10),P=new Date(Date.UTC(C("year"),C("month")-1,C("day"),C("hour"),C("minute"),C("second")));return Math.round((P.getTime()-G.getTime())/60000)}function Y(){try{return Intl.supportedValuesOf("timeZone")}catch{return["UTC","Europe/London","Europe/Paris","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Asia/Tokyo","Asia/Shanghai","Australia/Sydney"]}}return{format:S,formatRelative:N,parse:Z,parseISO:j,diff:X,add:$,sub:V,startOf:H,endOf:Q,getOffset:L,zones:Y,isValid:E}}};var MZ={name:"i18n",version:"1.0.0",type:"fw.io.i18n",dependencies:[],factory(){function E(j,Z){let q=Object.assign({},j);for(let $ of Object.keys(Z))if(Z[$]&&typeof Z[$]==="object"&&!Array.isArray(Z[$])&&q[$]&&typeof q[$]==="object")q[$]=E(q[$],Z[$]);else q[$]=Z[$];return q}function S(j){if(j===null||typeof j!=="object")return j;if(Array.isArray(j))return j.map(S);let Z={};for(let q of Object.keys(j))Z[q]=S(j[q]);return Z}function T(j,Z){if(!j)return;let q=Z.split("."),$=j;for(let V of q){if($==null||typeof $!=="object")return;$=$[V]}return $}function N(j,Z){if(!Z)return j;return j.replace(/\{(\w+)\}/g,(q,$)=>($ in Z)?String(Z[$]):`{${$}}`)}function R({locale:j="en",fallback:Z="en",catalogs:q={}}={}){let $=j,V=Z,X={};for(let[W,C]of Object.entries(q))X[W]=S(C);function H(W){return T(X[$],W)??T(X[V],W)??void 0}function Q(W,C){let P=H(W);if(P===void 0)return W;if(typeof P!=="string")return W;return N(P,C)}function L(W,C,P){let D=H(W);if(!D||typeof D!=="object")return W;let K=new Intl.PluralRules($).select(C),O=D[K]??D.other??W;if(typeof O!=="string")return W;return N(O,{count:C,...P})}function Y(W){return T(X[$],W)!==void 0}function G(W){$=W}function J(W,C){let P=S(C);X[W]=X[W]?E(X[W],P):P}function U(W,C,P={}){switch(C){case"number":return new Intl.NumberFormat($,P).format(W);case"currency":{let{currency:D="USD",...F}=P;return new Intl.NumberFormat($,{style:"currency",currency:D,...F}).format(W)}case"date":return new Intl.DateTimeFormat($,P).format(W);case"relative":{let{value:D=W,unit:F="day",...K}=P;return new Intl.RelativeTimeFormat($,{numeric:"auto",...K}).format(D,F)}default:throw Error(`i18n.format: unknown type "${C}"`)}}return{t:Q,tn:L,has:Y,setLocale:G,addCatalog:J,format:U,get locale(){return $},get fallback(){return V}}}return{create:R}}};var AZ={name:"rateLimit",dependencies:[],factory(){function E(T,N,R){if(typeof T!=="function")throw Error("rateLimit: fn must be a function");if(typeof N!=="number"||isNaN(N)||N<=0)throw Error("rateLimit: delay must be a positive number");let j=R&&R.leading!==void 0?!!R.leading:!1,Z=R&&R.trailing!==void 0?!!R.trailing:!0,q=R&&R.maxWait!==void 0?R.maxWait:void 0;if(q!==void 0&&(typeof q!=="number"||isNaN(q)||q<=0))throw Error("rateLimit: maxWait must be a positive number");let $=null,V=null,X=null,H=null,Q,L,Y=0,G=!1;function J(M){return Y=M,G=!1,Q=T.apply(H,X),H=null,X=null,Q}function U(M){$=setTimeout(C,M)}function W(){if(V!==null)clearTimeout(V),V=null}function C(){let M=Date.now();if(F(M))return P(M);let z=D(M);$=setTimeout(C,z)}function P(M){if($=null,W(),Z&&X!==null)return J(M);X=null,H=null,G=!1}function D(M){let z=M-L,B=M-Y,I=N-z;return q!==void 0?Math.min(I,q-B):I}function F(M){let z=M-L,B=M-Y;return L===void 0||z>=N||z<0||q!==void 0&&B>=q}function K(M){if(Y=M,U(N),G=!0,j)return J(M)}function O(...M){let z=Date.now(),B=F(z);if(X=M,H=this,L=z,G=!0,B){if($===null)return K(z);if(q!==void 0){if($!==null)clearTimeout($);return $=setTimeout(C,N),J(z)}}if($===null)U(N);if(q!==void 0&&V===null)V=setTimeout(()=>{if(V=null,X!==null)Y=Date.now(),G=!1,Q=T.apply(H,X),H=null,X=null},q);return}return O.cancel=function(){if($!==null)clearTimeout($),$=null;W(),X=null,H=null,G=!1},O.flush=function(){if($!==null)clearTimeout($),$=null;if(W(),X!==null){let M=Date.now();G=!1,Q=T.apply(H,X),H=null,X=null,Y=M}return Q},O.pending=function(){return G},O}function S(T,N,R){if(typeof T!=="function")throw Error("rateLimit: fn must be a function");if(typeof N!=="number"||isNaN(N)||N<=0)throw Error("rateLimit: interval must be a positive number");let j=R&&R.leading!==void 0?!!R.leading:!0,Z=R&&R.trailing!==void 0?!!R.trailing:!0;if(!j&&!Z)throw Error("rateLimit: throttle options leading and trailing cannot both be false");return E(T,N,{leading:j,trailing:Z,maxWait:N})}return{debounce:E,throttle:S}}};var NZ={name:"ajax",type:"fw.dom.net",dependencies:[],factory(){function E(R,j){if(!j)return R;if(/^https?:\/\//i.test(j))return j;let Z=R.endsWith("/")?R:R+"/";return new URL(j.replace(/^\//,""),Z).href}async function S(R,j){if(j==="response")return R;if(j==="blob")return R.blob();if(j==="buffer")return R.arrayBuffer();if(j==="text")return R.text();if(j==="json"){let q=await R.text();try{return JSON.parse(q)}catch($){throw SyntaxError(`Invalid JSON response: ${$.message}`,{cause:$})}}let Z=R.headers.get("content-type")??"";if(Z.includes("application/json")||Z.includes("+json")){let q=await R.text();try{return JSON.parse(q)}catch{return q}}if(Z.startsWith("text/"))return R.text();return R.arrayBuffer()}class T extends Error{constructor(R){super(`HTTP ${R.status} ${R.statusText}`);Object.defineProperty(this,"name",{value:"HttpError",writable:!0,configurable:!0}),this.status=R.status,this.response=R}}async function N(R,j,{headers:Z={},body:q,type:$,timeout:V=0,signal:X}={}){let H;if(V>0&&X)H=typeof AbortSignal.any==="function"?AbortSignal.any([AbortSignal.timeout(V),X]):X;else if(V>0)H=AbortSignal.timeout(V);else if(X)H=X;let Q=new Headers(Z),L={method:R,headers:Q,signal:H};if(q!==void 0&&q!==null)if(typeof q==="object"&&!(q instanceof FormData)&&!(q instanceof Blob)&&!(q instanceof ArrayBuffer)&&!(q instanceof URLSearchParams)){if(L.body=JSON.stringify(q),!Q.has("Content-Type"))Q.set("Content-Type","application/json")}else L.body=q;let Y=await fetch(j,L);if(!Y.ok)throw new T(Y);return S(Y,$)}return function R(j="",Z={}){let q=j?j.replace(/\/$/,""):typeof location<"u"?location.origin:"";function $(V,X,H={}){let Q={...Z,...H};return Q.headers={...Z.headers??{},...H.headers??{}},N(V,E(q,X),Q)}return{get(V,X){return $("GET",V,X)},post(V,X,H){return $("POST",V,{...H,body:X})},put(V,X,H){return $("PUT",V,{...H,body:X})},patch(V,X,H){return $("PATCH",V,{...H,body:X})},del(V,X){return $("DELETE",V,X)},scope(V="",X={}){return R(E(q,V),{...Z,...X})},HttpError:T}}}};var jZ={name:"network",type:"fw.dom.net",dependencies:[],factory(){let E={online:new Set,offline:new Set,change:new Set,connection:new Set},S,T,N;function R(){return typeof window<"u"?window:typeof self<"u"?self:null}function j(){if(typeof navigator>"u")return null;return navigator.connection??navigator.mozConnection??navigator.webkitConnection??null}function Z(){if(S)return;S=()=>{for(let W of E.online)W();for(let W of E.change)W(!0)},T=()=>{for(let W of E.offline)W();for(let W of E.change)W(!1)};let U=R();if(U)U.addEventListener("online",S),U.addEventListener("offline",T)}function q(){if(N)return;let U=j();if(!U||typeof U.addEventListener!=="function")return;N=()=>{let W=V();for(let C of E.connection)C(W)},U.addEventListener("change",N)}function $(){return typeof navigator<"u"?navigator.onLine:!0}function V(){let U=j();if(!U)return null;return Object.freeze({effectiveType:U.effectiveType??null,downlink:typeof U.downlink==="number"?U.downlink:null,rtt:typeof U.rtt==="number"?U.rtt:null,saveData:!!U.saveData,type:U.type??null})}function X(){let U=j();return!!(U&&U.saveData)}function H(U){return Z(),E.online.add(U),()=>E.online.delete(U)}function Q(U){return Z(),E.offline.add(U),()=>E.offline.delete(U)}function L(U,{immediate:W=!0}={}){if(Z(),E.change.add(U),W)U($());return()=>E.change.delete(U)}function Y(U,{immediate:W=!0}={}){if(q(),E.connection.add(U),W)U(V());return()=>E.connection.delete(U)}async function G(U,{timeout:W=3000,method:C="HEAD"}={}){let P=new AbortController,D=setTimeout(()=>P.abort(),W);try{return await fetch(U,{method:C,cache:"no-store",signal:P.signal,mode:"no-cors"}),!0}catch{return!1}finally{clearTimeout(D)}}function J(){E.online.clear(),E.offline.clear(),E.change.clear(),E.connection.clear();let U=R();if(U&&S)U.removeEventListener("online",S),U.removeEventListener("offline",T);S=null,T=null;let W=j();if(W&&N&&typeof W.removeEventListener==="function")W.removeEventListener("change",N);N=null}return{isOnline:$,onOnline:H,onOffline:Q,onChange:L,connection:V,onConnectionChange:Y,saveData:X,ping:G,off:J}}};var TZ={name:"form",version:"1.1.0",type:"fw.dom.utils",dependencies:["dom","events"],deps:[F$,D$],factory(E,S){function T(j,Z,q,$,V={}){let X=V.event||"input",H=!!V.checked,Q=H?()=>E.checked(Z,!!q()):()=>E.val(Z,q()==null?"":String(q()));return Q(),S.on(j,Z,X,()=>{$(H?E.checkedGet(Z):E.valGet(Z))}),{refresh:Q,destroy(){S.off(j)}}}function N(j){if(Object.prototype.hasOwnProperty.call(j,"default"))return typeof j.default==="function"?j.default():j.default;if(j.type==="boolean")return!1;if(j.type==="array")return[];return""}function R(j){if(!j||typeof j.fields!=="object")throw Error("form.create: spec.fields is required");let Z=j.fields,q=Object.create(null),$=Object.create(null),V=Object.create(null),X=Object.create(null),H=Object.create(null),Q=new Map,L=new Set,Y=!1,G=Object.create(null);for(let K in Z)q[K]=N(Z[K]),V[K]=!1,X[K]=!1,H[K]=!1,G[K]=0;function J(){let K=F.snapshot();for(let O of L)try{O(K)}catch{}}function U(K){let O=Z[K];if(!O)return;let M=q[K],z=null;if(O.required){if(O.type==="array"){if(!Array.isArray(M)||M.length===0)z=O.requiredMessage||"Required"}else if(M===""||M==null)z=O.requiredMessage||"Required"}if(!z&&O.type==="array"&&Array.isArray(M)){let B=[],I=!1;for(let A=0;A<M.length;++A){let w=null;if(typeof O.itemValidate==="function")w=O.itemValidate(M[A],A,q)||null;if(B.push(w),w)I=!0}if(I){$[K]=B;return}delete $[K];return}if(!z&&typeof O.validate==="function"){let B=O.validate(M,q);if(B&&typeof B.then==="function"){let I=++G[K];H[K]=!0,J(),B.then((A)=>{if(I!==G[K])return;if(A)$[K]=A;else delete $[K];H[K]=!1,J()},(A)=>{if(I!==G[K])return;$[K]=A&&A.message||"Validation error",H[K]=!1,J()});return}z=B||null}if(z)$[K]=z;else delete $[K]}function W(){for(let K in Z)U(K);if(typeof j.validate==="function"){let K=j.validate(q)||{};for(let O in K)if(K[O])$[O]=K[O];else delete $[O]}}function C(K,O){if(!(K in Z))return;q[K]=O,X[K]=!0,U(K),J()}function P(K){let O=Z[K];if(!O||O.type!=="array")throw Error(`form.array: field '${K}' is not declared as type:'array'`);function M(){return[...q[K]||[]]}function z(k){let g=Array.isArray(q[K])?q[K].slice():[];return g.push(k),C(K,g),g.length-1}function B(k){if(!Array.isArray(q[K]))return!1;if(k<0||k>=q[K].length)return!1;let g=q[K].slice();return g.splice(k,1),C(K,g),!0}function I(k,g){if(!Array.isArray(q[K]))return!1;let x=q[K].slice();if(k<0||k>=x.length)return!1;if(g<0||g>=x.length)return!1;let[f]=x.splice(k,1);return x.splice(g,0,f),C(K,x),!0}function A(k,g){if(!Array.isArray(q[K]))return!1;if(k<0||k>=q[K].length)return!1;let x=q[K].slice();return x[k]=g,C(K,x),!0}function w(){C(K,[])}return{get values(){return M()},get length(){return Array.isArray(q[K])?q[K].length:0},push:z,remove:B,move:I,set:A,clear:w,get(k){return q[K]?.[k]}}}function D(){let K=[];for(let O in H)if(H[O])K.push(new Promise((M)=>{let z=F.subscribe((B)=>{if(!B.validating[O])z(),M()})}));return K}let F={get values(){return{...q}},get errors(){let K=Object.create(null);for(let O in $){let M=$[O];K[O]=Array.isArray(M)?M.slice():M}return K},get touched(){return{...V}},get dirty(){return{...X}},get validating(){return{...H}},get submitting(){return Y},get isValid(){if(Object.keys($).length>0)return!1;for(let K in H)if(H[K])return!1;return!0},get(K){return q[K]},set(K,O){C(K,O);let M=Q.get(K);if(M)M.refresh()},touch(K){if(K in Z&&!V[K])V[K]=!0,J()},array(K){return P(K)},attach(K,O,M={}){if(!(K in Z))throw Error(`form.attach: unknown field '${K}'`);let B=Z[K].type==="boolean",I=M.event||(B?"change":"input"),A=`fw:form:${K}`,w=Q.get(K);if(w)w.destroy(),S.off(`${A}:blur`);let k=T(A,O,()=>q[K],(g)=>C(K,g),{event:I,checked:B});Q.set(K,k),S.on(`${A}:blur`,O,"blur",()=>F.touch(K))},detach(){for(let[K,O]of Q)O.destroy(),S.off(`fw:form:${K}:blur`);Q.clear()},validate(){return W(),J(),F.isValid},async validateAsync(){W(),J();let K=D();if(K.length)await Promise.all(K);return F.isValid},subscribe(K){if(typeof K!=="function")return()=>{};return L.add(K),()=>L.delete(K)},snapshot(){let K=Object.create(null);for(let O in $){let M=$[O];K[O]=Array.isArray(M)?M.slice():M}return{values:{...q},errors:K,touched:{...V},dirty:{...X},validating:{...H},isValid:F.isValid,submitting:Y}},reset(K){for(let O in Z)q[O]=N(Z[O]),V[O]=!1,X[O]=!1,H[O]=!1,G[O]++,delete $[O];if(K){for(let O in K)if(O in Z)q[O]=K[O]}for(let[,O]of Q)O.refresh();J()},async submit(){for(let O in Z)V[O]=!0;W(),J();let K=D();if(K.length)await Promise.all(K);if(!F.isValid)return!1;if(typeof j.onSubmit!=="function")return!0;Y=!0,J();try{return await j.onSubmit({...q}),!0}finally{Y=!1,J()}}};return W(),F}return{bind:T,create:R}}};var SZ={name:"reactiveBind",version:"1.0.0",type:"fw.dom.rendering",dependencies:["signal"],deps:[h$],factory(E){function S(R){if(typeof R==="function")return R;if(R&&typeof R.get==="function")return()=>R.get();throw Error("reactiveBind: sigOrFn must be a signal or a function")}function T(R,j,Z){let q=R.get(j,Z);if(!q)throw Error(`reactiveBind: no element found for block="${j}", local="${Z}". Ensure the block is rendered before binding.`);return q}function N(R){let j=[];function Z(G){return j.push(G),G}function q(G,J,U){T(R,G,J);let W=S(U),C=E.effect(()=>{let P=W();R.text(G,J,P)});return Z(C)}function $(G,J,U,W){T(R,G,J);let C=S(W),P=E.effect(()=>{let D=C();R.attr(G,J,U,D)});return Z(P)}function V(G,J,U,W){let C=T(R,G,J),P=S(W),D=E.effect(()=>{if(!!P())C.classList.add(U);else C.classList.remove(U)});return Z(D)}function X(G,J,U,W){let C=T(R,G,J),P=S(W),D=E.effect(()=>{let F=P();if(F==null||F===!1)C.style.removeProperty(U);else C.style.setProperty(U,String(F))});return Z(D)}function H(G,J,U){T(R,G,J);let W=S(U),C=E.effect(()=>{let P=!!W();R.attr(G,J,"hidden",P?null:"")});return Z(C)}function Q(G,J,U,W){let C=T(R,G,J);if(!U||typeof U.set!=="function")throw Error("reactiveBind.model: sig must be a writable signal (has .set)");let P=W&&W.event||"input",D=W&&typeof W.parse==="function"?W.parse:(B)=>B,F=W&&typeof W.format==="function"?W.format:(B)=>B==null?"":String(B),K=!1,O=E.effect(()=>{let B=U.get(),I=F(B);if(C.value!==I){K=!0;try{C.value=I}finally{K=!1}}}),M=()=>{if(K)return;let B=D(C.value);if(!Object.is(B,U.peek()))U.set(B)};return C.addEventListener(P,M),Z(()=>{O(),C.removeEventListener(P,M)})}function L(G,J,U){if(!G||typeof G.sync!=="function")throw Error("reactiveBind.list: listController must have a sync() method");if(!J||typeof J.get!=="function")throw Error("reactiveBind.list: sigArray must be a signal");if(!U||typeof U.keyFn!=="function")throw Error("reactiveBind.list: opts.keyFn is required");let W=E.effect(()=>{let C=J.get();G.sync(Array.isArray(C)?C:[],U)});return Z(W)}function Y(){for(let G of j)try{G()}catch{}j.length=0}return{text:q,attr:$,class:V,style:X,show:H,model:Q,list:L,dispose:Y}}return{create:N}}};var IZ={name:"component",version:"1.3.0",type:"fw.dom.rendering",dependencies:["reactiveBind","styleSheet"],deps:[SZ,E$],factory(E,S){let T=0,N=new Set,R=typeof document<"u"?document.querySelector('meta[name="csp-nonce"]')?.getAttribute("content")??"":"";function j(V,X,H){let Q={},L=X||{};for(let[Y,G]of Object.entries(V)){let J=Object.prototype.hasOwnProperty.call(L,Y)?L[Y]:void 0;if(J===void 0){if(G.required)throw Error(`component${H?`[${H}]`:""}: required prop '${Y}' is missing`);if(Object.prototype.hasOwnProperty.call(G,"default"))Q[Y]=typeof G.default==="function"?G.default():G.default;continue}if(G.type){let U;if(G.type==="array")U=Array.isArray(J);else if(G.type==="object")U=J!==null&&typeof J==="object"&&!Array.isArray(J);else U=typeof J===G.type;if(!U){let W=Array.isArray(J)?"array":J===null?"null":typeof J;throw Error(`component${H?`[${H}]`:""}: prop '${Y}' expected ${G.type}, got ${W}`)}}if(typeof G.validator==="function"&&!G.validator(J))throw Error(`component${H?`[${H}]`:""}: prop '${Y}' failed validator`);Q[Y]=J}for(let Y of Object.keys(L))if(!Object.prototype.hasOwnProperty.call(V,Y))Q[Y]=L[Y];return Q}function Z(V,X){let H=new Map,Q=/@keyframes\s+([\w-]+)/g,L;while((L=Q.exec(V))!==null){let U=L[1];if(!H.has(U))H.set(U,`${X}-${U}`)}let Y=V;if(H.size>0){Y=Y.replace(/@keyframes\s+([\w-]+)/g,(C,P)=>{let D=H.get(P);return D?`@keyframes ${D}`:C}),Y=Y.replace(/\banimation-name\s*:\s*([\w-]+)/g,(C,P)=>{let D=H.get(P);return D?`animation-name: ${D}`:C});let U=[...H.keys()].map((C)=>C.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),W=new RegExp(`(\\banimation\\s*:[^;{}]+?\\b)(${U})\\b`,"g");Y=Y.replace(W,(C,P,D)=>{let F=H.get(D);return F?`${P}${F}`:C})}Y=Y.replace(/:global\(([^)]*)\)/g,(U,W)=>W);let G=`.${X}`,J;do J=Y,Y=Y.replace(/&/g,G);while(Y!==J);return Y}function q(V,X){if(typeof document>"u")return;if(N.has(X))return;N.add(X);let H=Z(V,X);if(S){S.attach(H,{attrs:{"data-fw-component":X},nonce:R});return}let Q=document.createElement("style");if(Q.textContent=H,Q.setAttribute("data-fw-component",X),R)Q.setAttribute("nonce",R);document.head.appendChild(Q)}function $(V){if(!V||!V.template||!Array.isArray(V.template.template))throw Error("component.define: spec.template (ParseResult) is required");let X=V.template,H=typeof V.name==="string"?V.name:null,Q=typeof V.propsFn==="function"?V.propsFn:null,L=typeof V.mount==="function"?V.mount:null,Y=typeof V.update==="function"?V.update:null,G=typeof V.unmount==="function"?V.unmount:null,J=V.props&&typeof V.props==="object"?V.props:null,U=typeof V.css==="string"?V.css:null,W=null;if(U)W=`fw-comp-${++T}`,q(U,W);let C=0;return function(D={}){let F=D.ui;if(!F||typeof F.add!=="function")throw Error("component.create: opts.ui (UISession) is required");let K=D.id||`comp:${++C}`,O=J?j(J,D.props,H):D.props||{},M=Q?Q(O):O,z={id:K,block:X,data:M};if(D.parent)z.attach={elm:D.parent,name:D.slot||"default"};if(F.add([z]),W){let w=F.get(K);if(w&&w.classList)w.classList.add(W)}let B=null,I={props:M,rawProps:O,prevProps:void 0,prevRawProps:void 0,ui:F,blockId:K,scopeClass:W,state:{},get bind(){if(B===void 0)return;if(B===null)B=E.create(F);return B},get(w){return arguments.length===0?F.get(K):F.get(K,w)},text(...w){return F.text(K,...w)},attr(...w){return F.attr(K,...w)},on(...w){return F.on(K,...w)},off(w){return F.off(w)},query(w,k){return F.query(K,w,k)},queryAll(w,k){return F.queryAll(K,w,k)}},A=!1;if(F.onUnmount(K,()=>{if(A)return;if(A=!0,B!==null&&B!==void 0)try{B.dispose()}catch{}if(B=void 0,G)G(I)}),L)L(I);return{get props(){return I.props},get blockId(){return K},get state(){return I.state},get scopeClass(){return W},update(w){if(A)return;let k=J?j(J,w,H):w||{},g=Q?Q(k):k;if(I.prevRawProps=O,I.prevProps=M,O=k,M=g,I.rawProps=O,I.props=M,Y)Y(I,I.prevProps)},destroy(){if(A)return;F.clear(K)},get(w){return I.get(w)},text(...w){return I.text(...w)},attr(...w){return I.attr(...w)},on(...w){return I.on(...w)}}}}return{define:$}}};var r$={name:"uiSessionList",version:"1.0.0",type:"fw.dom.rendering",dependencies:["template","render","dom"],deps:[w$,I$,F$],factory(E,S,T){function N($,V){if(Object.is($,V))return!0;if($==null||V==null)return!1;if(typeof $!=="object"||typeof V!=="object")return!1;let X=Object.keys($),H=Object.keys(V);if(X.length!==H.length)return!1;for(let Q of X){if(!Object.prototype.hasOwnProperty.call(V,Q))return!1;if(!Object.is($[Q],V[Q]))return!1}return!0}function R($,V,X){if(Object.is($,V))return!0;if(X<=0)return!1;if($==null||V==null)return!1;if(typeof $!=="object"||typeof V!=="object")return!1;let H=Array.isArray($),Q=Array.isArray(V);if(H!==Q)return!1;if(H){if($.length!==V.length)return!1;for(let G=0;G<$.length;++G)if(!R($[G],V[G],X-1))return!1;return!0}let L=Object.keys($),Y=Object.keys(V);if(L.length!==Y.length)return!1;for(let G of L){if(!Object.prototype.hasOwnProperty.call(V,G))return!1;if(!R($[G],V[G],X-1))return!1}return!0}function j($){if(typeof $==="function")return $;if($==="shallow")return N;if($==="deep")return(V,X)=>R(V,X,8);return Object.is}class Z{constructor($,V,X,H){if(!H||typeof H.keyFn!=="function")throw Error("uiSession.list: options.keyFn is required");if(!H.block||!Array.isArray(H.block.template))throw Error("uiSession.list: options.block (ParseResult) is required");if(this._ui=$,this._parent=V,this._slot=X,this._keyFn=H.keyFn,this._block=H.block,this._eq=j(H.eqFn),this._onMount=typeof H.onMount==="function"?H.onMount:null,this._onRemove=typeof H.onRemove==="function"?H.onRemove:null,this._onEnter=typeof H.onEnter==="function"?H.onEnter:null,this._onLeave=typeof H.onLeave==="function"?H.onLeave:null,this._onUpdate=H.onUpdate??"replace",this._onUpdate==="patch"&&H.block?.iterates&&Object.keys(H.block.iterates).length>0)this._onUpdate="replace";this._dataFn=typeof H.dataFn==="function"?H.dataFn:null,this._metaFn=typeof H.metaFn==="function"?H.metaFn:null,this._order=[],this._data=new Map,this._meta=new Map,this._disposed=!1,this._slotEl=null}_dispose(){this._order=[],this._data.clear(),this._meta.clear(),this._slotEl=null,this._disposed=!0}_ensureAlive(){if(this._disposed)throw Error(`uiSession.list: list on (${this._parent}, ${this._slot}) is disposed (its parent block was removed). Create a new list after re-mounting the parent.`)}_itemId($){return`${this._parent}\x1Flist\x1F${this._slot}\x1F${$}`}_key($){let V=this._keyFn($);if(V===void 0||V===null)throw Error("uiSession.list: keyFn returned null/undefined");return String(V)}_slotElement(){if(this._slotEl)return this._slotEl;let $=this._ui._resolveSlotElement(this._parent,this._slot);if(!$)throw Error(`uiSession.list: slot '${this._slot}' not resolved on block '${this._parent}' (parent must be rendered with a \${${this._slot}} slot before creating the list)`);return this._slotEl=$,$}_addItem($,V,X=!1){this._slotElement();let H=this._dataFn?this._dataFn(V):V;if(this._ui.add([{id:this._itemId($),attach:{elm:this._parent,name:this._slot},block:this._block,data:H,prepend:X}]),this._data.set($,V),this._metaFn)this._meta.set($,this._metaFn(V));if(this._onMount)this._onMount($,V);if(this._onEnter){let Q=this._ui.get(this._itemId($));if(Q)try{Promise.resolve(this._onEnter($,Q,V))}catch{}}}_removeItem($){if(this._onRemove){let V=this._data.get($);try{this._onRemove($,V)}catch{}}if(this._onLeave){let V=this._ui.get(this._itemId($)),X=this._data.get($);if(V){let H;try{H=this._onLeave($,V,X)}catch{H=null}if(H&&typeof H.then==="function"){this._meta.delete($),H.then(()=>this._ui.clear(this._itemId($)),()=>this._ui.clear(this._itemId($)));return}}}this._ui.clear(this._itemId($)),this._meta.delete($)}_replaceItem($,V){let X=this._data.get($);if(this._onUpdate==="none"){if(this._data.set($,V),this._metaFn)this._meta.set($,this._metaFn(V));return"unchanged"}if(this._onUpdate==="patch")return this._patchItem($,X,V),"patched";if(typeof this._onUpdate==="function"){let H=this._onUpdate($,X,V,this);if(this._data.set($,V),this._metaFn)this._meta.set($,this._metaFn(V));return H==="patched"||H==="replaced"||H==="unchanged"?H:"unchanged"}return this._removeItem($),this._addItem($,V,!1),"replaced"}_patchItem($,V,X){let H=this._dataFn?this._dataFn(V):V,Q=this._dataFn?this._dataFn(X):X,L=this._itemId($),Y=this._ui._map.get(L);if(!Y){this._addItem($,X,!1);return}for(let G of this._block.template){if(!G.map||G.map.length===0)continue;let J=Y.get(G.id);if(!J)continue;let U=E.get(this._ui._container,J);if(!U)continue;let W=S.applyParsedElm(G,Q),C=S.applyParsedElm(G,H),P=new Set;for(let D of G.map){let F=(D.data?"a:":"t:")+D.prop;if(P.has(F))continue;if(P.add(F),D.data){let K=W.data[D.prop],O=C.data[D.prop];if(K===O)continue;if(K===null||K===!1||K===void 0)T.attrRemove(U,D.prop);else T.attr(U,D.prop,K)}else{let K=W[D.prop],O=C[D.prop];if(K===O)continue;if(D.prop==="text")T.text(U,K);else T.attr(U,D.prop,K)}}}if(this._data.set($,X),this._metaFn)this._meta.set($,this._metaFn(X))}_reorderDom(){let $=this._slotElement(),V=this._order.map((X)=>this._ui.get(this._itemId(X))).filter(Boolean);T.reorder($,V)}get size(){return this._order.length}has($){return this._data.has(String($))}get($){return this._data.get(String($))}*keys(){yield*this._order}*entries(){for(let $ of this._order)yield[$,this._data.get($)]}*values(){for(let $ of this._order)yield this._data.get($)}[Symbol.iterator](){return this.entries()}element($){let V=String($);if(!this._data.has(V))return null;return this._ui.get(this._itemId(V))}itemId($){return this._itemId(String($))}meta($){return this._meta.get(String($))}attr($,...V){return this._ui.attr(this._itemId(String($)),...V)}text($,...V){return this._ui.text(this._itemId(String($)),...V)}on($,...V){return this._ui.on(this._itemId(String($)),...V)}query($,V){let X=this._ui.get(this._itemId(String($)));if(!X)return null;return T.query(X,V)}queryAll($,V){let X=this._ui.get(this._itemId(String($)));if(!X)return[];return T.queryAll(X,V)}push($){this._ensureAlive();let V=this._key($);if(this._data.has(V))throw Error(`uiSession.list.push: duplicate key '${V}'`);return this._addItem(V,$,!1),this._order.push(V),V}prepend($){this._ensureAlive();let V=this._key($);if(this._data.has(V))throw Error(`uiSession.list.prepend: duplicate key '${V}'`);return this._addItem(V,$,!0),this._order.unshift(V),V}insert($,V){this._ensureAlive();let X=this._key($);if(this._data.has(X))throw Error(`uiSession.list.insert: duplicate key '${X}'`);this._addItem(X,$,!1);let H=V==null?-1:this._order.indexOf(String(V));if(H===-1)this._order.push(X);else this._order.splice(H,0,X),this._reorderDom();return X}upsert($){this._ensureAlive();let V=this._key($);if(this._data.has(V)){let X=this._data.get(V);if(this._eq(X,$))return"unchanged";let H=this._replaceItem(V,$);if(H==="replaced")this._reorderDom();return H==="unchanged"?"unchanged":"updated"}return this._addItem(V,$,!1),this._order.push(V),"added"}update($,V){this._ensureAlive();let X=String($);if(!this._data.has(X))throw Error(`uiSession.list.update: key '${X}' not found`);let H=this._data.get(X);if(this._eq(H,V))return"unchanged";let Q=this._replaceItem(X,V);if(Q==="replaced")this._reorderDom();return Q==="unchanged"?"unchanged":"updated"}remove($){this._ensureAlive();let V=String($);if(!this._data.has(V))return!1;this._removeItem(V),this._data.delete(V);let X=this._order.indexOf(V);if(X!==-1)this._order.splice(X,1);return!0}move($,V){this._ensureAlive();let X=String($);if(!this._data.has(X))return!1;let H=this._order.indexOf(X);if(H===-1)return!1;this._order.splice(H,1);let Q=V==null?-1:this._order.indexOf(String(V));if(Q===-1)this._order.push(X);else this._order.splice(Q,0,X);return this._reorderDom(),!0}clear(){this._ensureAlive();for(let $ of this._order)this._removeItem($);this._order=[],this._data.clear()}adopt($,V={}){if(this._ensureAlive(),!Array.isArray($))throw Error("uiSession.list.adopt: items must be an array");if(this._order.length>0)throw Error(`uiSession.list.adopt: list on (${this._parent}, ${this._slot}) is not empty (${this._order.length} item(s)). adopt() must run on a freshly-created list, before any push/sync/upsert.`);let X=V.idPrefix||"",H=this._slotElement(),Q=Array.from(H.children);if(Q.length!==$.length)throw Error(`uiSession.list.adopt: row count mismatch - slot '${this._slot}' contains ${Q.length} child element(s) but ${$.length} item(s) were passed. SSR and client must agree on the initial set.`);let L=this._block.template,Y=L.filter((C)=>C.parent==null);if(Y.length!==1)throw Error(`uiSession.list.adopt: row template must have exactly one root (found ${Y.length}). Multi-root row templates can't be unambiguously adopted - recreate via push/sync instead.`);let G=Y[0].id,J=this._ui._container,U=(C)=>X?`${X}:${C}`:C,W=new Set;for(let C=0;C<$.length;++C){let P=$[C],D=Q[C],F=this._key(P);if(W.has(F))throw Error(`uiSession.list.adopt: duplicate key '${F}'`);W.add(F);let K=this._itemId(F),O=new Map;for(let z of L){let B;if(z.id===G)B=D;else B=D.querySelector(`[data-fw-id="${CSS.escape(U(z.id))}"]`);if(!B)throw Error(`uiSession.list.adopt: row ${C} (key='${F}'): no DOM node found for data-fw-id="${U(z.id)}" (elm.id='${z.id}'). Check that SSR was rendered with idPrefix='${X}' and the same row template.`);let I=`${K}\x1F${z.id}`,A=z.parent!=null?`${K}\x1F${z.parent}`:void 0;E.adoptNode(J,I,B,A),O.set(z.id,I)}this._ui._map.set(K,O);let M=this._ui._children.get(this._parent);if(!M)M=new Set,this._ui._children.set(this._parent,M);if(M.add(K),this._data.set(F,P),this._metaFn)this._meta.set(F,this._metaFn(P));if(this._order.push(F),this._onMount)try{this._onMount(F,P)}catch{}}return this}sync($){if(this._ensureAlive(),!Array.isArray($))throw Error("uiSession.list.sync: items must be an array");let V=Array($.length),X=new Set;for(let G=0;G<$.length;++G){let J=this._key($[G]);if(X.has(J))throw Error(`uiSession.list.sync: duplicate key '${J}'`);X.add(J),V[G]=J}let H={added:new Set,kept:new Set,updated:new Set,removed:new Set,reordered:!1};this._order=this._order.filter((G)=>{if(X.has(G))return!0;return this._removeItem(G),this._data.delete(G),H.removed.add(G),!1});let Q=!1;for(let G=0;G<$.length;++G){let J=V[G],U=$[G];if(!this._data.has(J))this._addItem(J,U,!1),H.added.add(J);else{let W=this._data.get(J);if(this._eq(W,U))H.kept.add(J);else{let C=this._replaceItem(J,U);if(C==="unchanged")H.kept.add(J);else if(H.updated.add(J),C==="replaced")Q=!0}}}let L=[...this._order];for(let G of V)if(H.added.has(G))L.push(G);let Y=Q;if(!Y){for(let G=0;G<V.length;++G)if(L[G]!==V[G]){Y=!0;break}}if(this._order=V,Y)this._reorderDom(),H.reordered=!0;return H}}return{UIList:Z,methods:{list($,V,X){let H=this._lists.get($);if(H&&H.has(V)){let L=H.get(V);if(X&&X.block&&X.block!==L._block)throw Error(`uiSession.list: list on (${$}, ${V}) already exists with a different block - pass the same ParseResult, or remove the parent first.`);return L}let Q=new Z(this,$,V,X);if(!H)H=new Map,this._lists.set($,H);return H.set(V,Q),Q}}}}};var EZ={name:"uiSession",version:"1.0.0",type:"fw.dom.rendering",dependencies:["uiSessionCore","uiSessionDirect","uiSessionList"],deps:[l$,i$,r$],factory(E,S,T){class N{constructor(R){this._container=R,this._attach=new Map,this._map=new Map,this._listeners=new Map,this._lseq=0,this._lists=new Map,this._unmount=new Map,this._mount=new Map,this._children=new Map}}return Object.assign(N.prototype,E.methods,S.methods,T.methods),function(R){return new N(R)}}};var wZ={name:"devtools",version:"1.0.0",type:"fw.dom.rendering",dependencies:["clock"],deps:[m$],factory(E){let S=E;function T($){if(!$||typeof $!=="object")throw Error("devtools.inspect: session argument is required");let V={container:$._container||null,blocks:[],attaches:[],children:[],listeners:[],mountHooks:[],unmountHooks:[],lists:[],portals:[]};if($._map)for(let[X,H]of $._map)if(Array.isArray(H))V.blocks.push({id:X,logicalIds:H.map((Q)=>[...Q.keys()]),isLoop:!0});else V.blocks.push({id:X,logicalIds:[...H.keys()],isLoop:!1});if($._attach)for(let[X,H]of $._attach){let Q=H&&H.content?[...H.content.keys()]:[];V.attaches.push({blockId:X,slots:Q})}if($._children)for(let[X,H]of $._children)V.children.push({parent:X,children:[...H]});if($._listeners)for(let[X,H]of $._listeners)for(let[Q,L]of H)V.listeners.push({blockId:X,logicalId:Q,names:[...L]});if($._mount)for(let[X]of $._mount)V.mountHooks.push(X);if($._unmount)for(let[X]of $._unmount)V.unmountHooks.push(X);if($._lists)for(let[X,H]of $._lists)for(let[Q,L]of H)V.lists.push({parent:X,slot:Q,size:L.size,disposed:!!L._disposed});if($._portals)for(let[X,H]of $._portals)V.portals.push({name:X,container:H._container});return V}function N($){return T($).blocks.map((X)=>`${X.id}(${X.isLoop?`loop×${X.logicalIds.length}`:X.logicalIds.join(",")})`).join(" ")}function R($,V={}){let X=Array.isArray($)?$:$&&$.template||[],H=V.indent||" ",Q=new Map(X.map((U)=>[U.id,U])),L=new Map,Y=[];for(let U of X)if(U.parent&&Q.has(U.parent)){if(!L.has(U.parent))L.set(U.parent,[]);L.get(U.parent).push(U.id)}else Y.push(U.id);let G=[];function J(U,W){let C=Q.get(U);if(!C)return;let P=H.repeat(W),D=[`<${C.tag}#${C.id}>`];if(C.text!=null)D.push(`text=${JSON.stringify(C.text)}`);if(C.content)D.push(`slot=${JSON.stringify(C.content)}`);if(C.attrs&&C.attrs.length)D.push(`attrs=[${C.attrs.join(",")}]`);if(C.map&&C.map.length){let K=C.map.map((O)=>`${O.data?"@":"$"}${O.prop}=#{${O.name}}`+(O.append?"+":O.prepend?"^":"=")).join(",");D.push(`map=[${K}]`)}G.push(P+D.join(" "));let F=L.get(U)||[];for(let K of F)J(K,W+1)}for(let U of Y)J(U,0);if($&&$.iterates)for(let U of Object.keys($.iterates))G.push(`-- iterate: ${U} --`),G.push(R({template:$.iterates[U]},V));return G.join(`
39
+ `)}function j($){if(typeof $!=="function")throw Error("devtools.profile: fn must be a function");let V=S.monotonic(),X=$(),H=S.monotonic();return{result:X,durationMs:H-V}}async function Z($){if(typeof $!=="function")throw Error("devtools.profileAsync: fn must be a function");let V=S.monotonic(),X=await $(),H=S.monotonic();return{result:X,durationMs:H-V}}function q(){let $=S,V=$.monotonic(),X=[];return{mark(H){let Q=$.monotonic();if(X.length>0){let L=X[X.length-1];L.durationMs=Q-L._startedAt,delete L._startedAt}X.push({name:H,_startedAt:Q})},end(){let H=$.monotonic();if(X.length>0){let Q=X[X.length-1];Q.durationMs=H-Q._startedAt,delete Q._startedAt}return{total:H-V,segments:X}}}}return{inspect:T,summarize:N,dumpTemplate:R,profile:j,profileAsync:Z,timer:q}}};var kZ={name:"htmlEntities",version:"1.0.0",type:"fw.io.text",dependencies:[],factory(){let S=JSON.parse('{"AElig":"Æ","AMP":"&","Aacute":"Á","Abreve":"Ă","Acirc":"Â","Acy":"А","Afr":"\uD835\uDD04","Agrave":"À","Alpha":"Α","Amacr":"Ā","And":"⩓","Aogon":"Ą","Aopf":"\uD835\uDD38","ApplyFunction":"⁡","Aring":"Å","Ascr":"\uD835\uDC9C","Assign":"≔","Atilde":"Ã","Auml":"Ä","Backslash":"∖","Barv":"⫧","Barwed":"⌆","Bcy":"Б","Because":"∵","Bernoullis":"ℬ","Beta":"Β","Bfr":"\uD835\uDD05","Bopf":"\uD835\uDD39","Breve":"˘","Bscr":"ℬ","Bumpeq":"≎","CHcy":"Ч","COPY":"©","Cacute":"Ć","Cap":"⋒","CapitalDifferentialD":"ⅅ","Cayleys":"ℭ","Ccaron":"Č","Ccedil":"Ç","Ccirc":"Ĉ","Cconint":"∰","Cdot":"Ċ","Cedilla":"¸","CenterDot":"·","Cfr":"ℭ","Chi":"Χ","CircleDot":"⊙","CircleMinus":"⊖","CirclePlus":"⊕","CircleTimes":"⊗","ClockwiseContourIntegral":"∲","CloseCurlyDoubleQuote":"”","CloseCurlyQuote":"’","Colon":"∷","Colone":"⩴","Congruent":"≡","Conint":"∯","ContourIntegral":"∮","Copf":"ℂ","Coproduct":"∐","CounterClockwiseContourIntegral":"∳","Cross":"⨯","Cscr":"\uD835\uDC9E","Cup":"⋓","CupCap":"≍","DD":"ⅅ","DDotrahd":"⤑","DJcy":"Ђ","DScy":"Ѕ","DZcy":"Џ","Dagger":"‡","Darr":"↡","Dashv":"⫤","Dcaron":"Ď","Dcy":"Д","Del":"∇","Delta":"Δ","Dfr":"\uD835\uDD07","DiacriticalAcute":"´","DiacriticalDot":"˙","DiacriticalDoubleAcute":"˝","DiacriticalGrave":"`","DiacriticalTilde":"˜","Diamond":"⋄","DifferentialD":"ⅆ","Dopf":"\uD835\uDD3B","Dot":"¨","DotDot":"⃜","DotEqual":"≐","DoubleContourIntegral":"∯","DoubleDot":"¨","DoubleDownArrow":"⇓","DoubleLeftArrow":"⇐","DoubleLeftRightArrow":"⇔","DoubleLeftTee":"⫤","DoubleLongLeftArrow":"⟸","DoubleLongLeftRightArrow":"⟺","DoubleLongRightArrow":"⟹","DoubleRightArrow":"⇒","DoubleRightTee":"⊨","DoubleUpArrow":"⇑","DoubleUpDownArrow":"⇕","DoubleVerticalBar":"∥","DownArrow":"↓","DownArrowBar":"⤓","DownArrowUpArrow":"⇵","DownBreve":"̑","DownLeftRightVector":"⥐","DownLeftTeeVector":"⥞","DownLeftVector":"↽","DownLeftVectorBar":"⥖","DownRightTeeVector":"⥟","DownRightVector":"⇁","DownRightVectorBar":"⥗","DownTee":"⊤","DownTeeArrow":"↧","Downarrow":"⇓","Dscr":"\uD835\uDC9F","Dstrok":"Đ","ENG":"Ŋ","ETH":"Ð","Eacute":"É","Ecaron":"Ě","Ecirc":"Ê","Ecy":"Э","Edot":"Ė","Efr":"\uD835\uDD08","Egrave":"È","Element":"∈","Emacr":"Ē","EmptySmallSquare":"◻","EmptyVerySmallSquare":"▫","Eogon":"Ę","Eopf":"\uD835\uDD3C","Epsilon":"Ε","Equal":"⩵","EqualTilde":"≂","Equilibrium":"⇌","Escr":"ℰ","Esim":"⩳","Eta":"Η","Euml":"Ë","Exists":"∃","ExponentialE":"ⅇ","Fcy":"Ф","Ffr":"\uD835\uDD09","FilledSmallSquare":"◼","FilledVerySmallSquare":"▪","Fopf":"\uD835\uDD3D","ForAll":"∀","Fouriertrf":"ℱ","Fscr":"ℱ","GJcy":"Ѓ","GT":">","Gamma":"Γ","Gammad":"Ϝ","Gbreve":"Ğ","Gcedil":"Ģ","Gcirc":"Ĝ","Gcy":"Г","Gdot":"Ġ","Gfr":"\uD835\uDD0A","Gg":"⋙","Gopf":"\uD835\uDD3E","GreaterEqual":"≥","GreaterEqualLess":"⋛","GreaterFullEqual":"≧","GreaterGreater":"⪢","GreaterLess":"≷","GreaterSlantEqual":"⩾","GreaterTilde":"≳","Gscr":"\uD835\uDCA2","Gt":"≫","HARDcy":"Ъ","Hacek":"ˇ","Hat":"^","Hcirc":"Ĥ","Hfr":"ℌ","HilbertSpace":"ℋ","Hopf":"ℍ","HorizontalLine":"─","Hscr":"ℋ","Hstrok":"Ħ","HumpDownHump":"≎","HumpEqual":"≏","IEcy":"Е","IJlig":"IJ","IOcy":"Ё","Iacute":"Í","Icirc":"Î","Icy":"И","Idot":"İ","Ifr":"ℑ","Igrave":"Ì","Im":"ℑ","Imacr":"Ī","ImaginaryI":"ⅈ","Implies":"⇒","Int":"∬","Integral":"∫","Intersection":"⋂","InvisibleComma":"⁣","InvisibleTimes":"⁢","Iogon":"Į","Iopf":"\uD835\uDD40","Iota":"Ι","Iscr":"ℐ","Itilde":"Ĩ","Iukcy":"І","Iuml":"Ï","Jcirc":"Ĵ","Jcy":"Й","Jfr":"\uD835\uDD0D","Jopf":"\uD835\uDD41","Jscr":"\uD835\uDCA5","Jsercy":"Ј","Jukcy":"Є","KHcy":"Х","KJcy":"Ќ","Kappa":"Κ","Kcedil":"Ķ","Kcy":"К","Kfr":"\uD835\uDD0E","Kopf":"\uD835\uDD42","Kscr":"\uD835\uDCA6","LJcy":"Љ","LT":"<","Lacute":"Ĺ","Lambda":"Λ","Lang":"⟪","Laplacetrf":"ℒ","Larr":"↞","Lcaron":"Ľ","Lcedil":"Ļ","Lcy":"Л","LeftAngleBracket":"⟨","LeftArrow":"←","LeftArrowBar":"⇤","LeftArrowRightArrow":"⇆","LeftCeiling":"⌈","LeftDoubleBracket":"⟦","LeftDownTeeVector":"⥡","LeftDownVector":"⇃","LeftDownVectorBar":"⥙","LeftFloor":"⌊","LeftRightArrow":"↔","LeftRightVector":"⥎","LeftTee":"⊣","LeftTeeArrow":"↤","LeftTeeVector":"⥚","LeftTriangle":"⊲","LeftTriangleBar":"⧏","LeftTriangleEqual":"⊴","LeftUpDownVector":"⥑","LeftUpTeeVector":"⥠","LeftUpVector":"↿","LeftUpVectorBar":"⥘","LeftVector":"↼","LeftVectorBar":"⥒","Leftarrow":"⇐","Leftrightarrow":"⇔","LessEqualGreater":"⋚","LessFullEqual":"≦","LessGreater":"≶","LessLess":"⪡","LessSlantEqual":"⩽","LessTilde":"≲","Lfr":"\uD835\uDD0F","Ll":"⋘","Lleftarrow":"⇚","Lmidot":"Ŀ","LongLeftArrow":"⟵","LongLeftRightArrow":"⟷","LongRightArrow":"⟶","Longleftarrow":"⟸","Longleftrightarrow":"⟺","Longrightarrow":"⟹","Lopf":"\uD835\uDD43","LowerLeftArrow":"↙","LowerRightArrow":"↘","Lscr":"ℒ","Lsh":"↰","Lstrok":"Ł","Lt":"≪","Map":"⤅","Mcy":"М","MediumSpace":" ","Mellintrf":"ℳ","Mfr":"\uD835\uDD10","MinusPlus":"∓","Mopf":"\uD835\uDD44","Mscr":"ℳ","Mu":"Μ","NJcy":"Њ","Nacute":"Ń","Ncaron":"Ň","Ncedil":"Ņ","Ncy":"Н","NegativeMediumSpace":"​","NegativeThickSpace":"​","NegativeThinSpace":"​","NegativeVeryThinSpace":"​","NestedGreaterGreater":"≫","NestedLessLess":"≪","NewLine":"\\n","Nfr":"\uD835\uDD11","NoBreak":"⁠","NonBreakingSpace":" ","Nopf":"ℕ","Not":"⫬","NotCongruent":"≢","NotCupCap":"≭","NotDoubleVerticalBar":"∦","NotElement":"∉","NotEqual":"≠","NotEqualTilde":"≂̸","NotExists":"∄","NotGreater":"≯","NotGreaterEqual":"≱","NotGreaterFullEqual":"≧̸","NotGreaterGreater":"≫̸","NotGreaterLess":"≹","NotGreaterSlantEqual":"⩾̸","NotGreaterTilde":"≵","NotHumpDownHump":"≎̸","NotHumpEqual":"≏̸","NotLeftTriangle":"⋪","NotLeftTriangleBar":"⧏̸","NotLeftTriangleEqual":"⋬","NotLess":"≮","NotLessEqual":"≰","NotLessGreater":"≸","NotLessLess":"≪̸","NotLessSlantEqual":"⩽̸","NotLessTilde":"≴","NotNestedGreaterGreater":"⪢̸","NotNestedLessLess":"⪡̸","NotPrecedes":"⊀","NotPrecedesEqual":"⪯̸","NotPrecedesSlantEqual":"⋠","NotReverseElement":"∌","NotRightTriangle":"⋫","NotRightTriangleBar":"⧐̸","NotRightTriangleEqual":"⋭","NotSquareSubset":"⊏̸","NotSquareSubsetEqual":"⋢","NotSquareSuperset":"⊐̸","NotSquareSupersetEqual":"⋣","NotSubset":"⊂⃒","NotSubsetEqual":"⊈","NotSucceeds":"⊁","NotSucceedsEqual":"⪰̸","NotSucceedsSlantEqual":"⋡","NotSucceedsTilde":"≿̸","NotSuperset":"⊃⃒","NotSupersetEqual":"⊉","NotTilde":"≁","NotTildeEqual":"≄","NotTildeFullEqual":"≇","NotTildeTilde":"≉","NotVerticalBar":"∤","Nscr":"\uD835\uDCA9","Ntilde":"Ñ","Nu":"Ν","OElig":"Œ","Oacute":"Ó","Ocirc":"Ô","Ocy":"О","Odblac":"Ő","Ofr":"\uD835\uDD12","Ograve":"Ò","Omacr":"Ō","Omega":"Ω","Omicron":"Ο","Oopf":"\uD835\uDD46","OpenCurlyDoubleQuote":"“","OpenCurlyQuote":"‘","Or":"⩔","Oscr":"\uD835\uDCAA","Oslash":"Ø","Otilde":"Õ","Otimes":"⨷","Ouml":"Ö","OverBar":"‾","OverBrace":"⏞","OverBracket":"⎴","OverParenthesis":"⏜","PartialD":"∂","Pcy":"П","Pfr":"\uD835\uDD13","Phi":"Φ","Pi":"Π","PlusMinus":"±","Poincareplane":"ℌ","Popf":"ℙ","Pr":"⪻","Precedes":"≺","PrecedesEqual":"⪯","PrecedesSlantEqual":"≼","PrecedesTilde":"≾","Prime":"″","Product":"∏","Proportion":"∷","Proportional":"∝","Pscr":"\uD835\uDCAB","Psi":"Ψ","QUOT":"\\"","Qfr":"\uD835\uDD14","Qopf":"ℚ","Qscr":"\uD835\uDCAC","RBarr":"⤐","REG":"®","Racute":"Ŕ","Rang":"⟫","Rarr":"↠","Rarrtl":"⤖","Rcaron":"Ř","Rcedil":"Ŗ","Rcy":"Р","Re":"ℜ","ReverseElement":"∋","ReverseEquilibrium":"⇋","ReverseUpEquilibrium":"⥯","Rfr":"ℜ","Rho":"Ρ","RightAngleBracket":"⟩","RightArrow":"→","RightArrowBar":"⇥","RightArrowLeftArrow":"⇄","RightCeiling":"⌉","RightDoubleBracket":"⟧","RightDownTeeVector":"⥝","RightDownVector":"⇂","RightDownVectorBar":"⥕","RightFloor":"⌋","RightTee":"⊢","RightTeeArrow":"↦","RightTeeVector":"⥛","RightTriangle":"⊳","RightTriangleBar":"⧐","RightTriangleEqual":"⊵","RightUpDownVector":"⥏","RightUpTeeVector":"⥜","RightUpVector":"↾","RightUpVectorBar":"⥔","RightVector":"⇀","RightVectorBar":"⥓","Rightarrow":"⇒","Ropf":"ℝ","RoundImplies":"⥰","Rrightarrow":"⇛","Rscr":"ℛ","Rsh":"↱","RuleDelayed":"⧴","SHCHcy":"Щ","SHcy":"Ш","SOFTcy":"Ь","Sacute":"Ś","Sc":"⪼","Scaron":"Š","Scedil":"Ş","Scirc":"Ŝ","Scy":"С","Sfr":"\uD835\uDD16","ShortDownArrow":"↓","ShortLeftArrow":"←","ShortRightArrow":"→","ShortUpArrow":"↑","Sigma":"Σ","SmallCircle":"∘","Sopf":"\uD835\uDD4A","Sqrt":"√","Square":"□","SquareIntersection":"⊓","SquareSubset":"⊏","SquareSubsetEqual":"⊑","SquareSuperset":"⊐","SquareSupersetEqual":"⊒","SquareUnion":"⊔","Sscr":"\uD835\uDCAE","Star":"⋆","Sub":"⋐","Subset":"⋐","SubsetEqual":"⊆","Succeeds":"≻","SucceedsEqual":"⪰","SucceedsSlantEqual":"≽","SucceedsTilde":"≿","SuchThat":"∋","Sum":"∑","Sup":"⋑","Superset":"⊃","SupersetEqual":"⊇","Supset":"⋑","THORN":"Þ","TRADE":"™","TSHcy":"Ћ","TScy":"Ц","Tab":"\\t","Tau":"Τ","Tcaron":"Ť","Tcedil":"Ţ","Tcy":"Т","Tfr":"\uD835\uDD17","Therefore":"∴","Theta":"Θ","ThickSpace":"  ","ThinSpace":" ","Tilde":"∼","TildeEqual":"≃","TildeFullEqual":"≅","TildeTilde":"≈","Topf":"\uD835\uDD4B","TripleDot":"⃛","Tscr":"\uD835\uDCAF","Tstrok":"Ŧ","Uacute":"Ú","Uarr":"↟","Uarrocir":"⥉","Ubrcy":"Ў","Ubreve":"Ŭ","Ucirc":"Û","Ucy":"У","Udblac":"Ű","Ufr":"\uD835\uDD18","Ugrave":"Ù","Umacr":"Ū","UnderBar":"_","UnderBrace":"⏟","UnderBracket":"⎵","UnderParenthesis":"⏝","Union":"⋃","UnionPlus":"⊎","Uogon":"Ų","Uopf":"\uD835\uDD4C","UpArrow":"↑","UpArrowBar":"⤒","UpArrowDownArrow":"⇅","UpDownArrow":"↕","UpEquilibrium":"⥮","UpTee":"⊥","UpTeeArrow":"↥","Uparrow":"⇑","Updownarrow":"⇕","UpperLeftArrow":"↖","UpperRightArrow":"↗","Upsi":"ϒ","Upsilon":"Υ","Uring":"Ů","Uscr":"\uD835\uDCB0","Utilde":"Ũ","Uuml":"Ü","VDash":"⊫","Vbar":"⫫","Vcy":"В","Vdash":"⊩","Vdashl":"⫦","Vee":"⋁","Verbar":"‖","Vert":"‖","VerticalBar":"∣","VerticalLine":"|","VerticalSeparator":"❘","VerticalTilde":"≀","VeryThinSpace":" ","Vfr":"\uD835\uDD19","Vopf":"\uD835\uDD4D","Vscr":"\uD835\uDCB1","Vvdash":"⊪","Wcirc":"Ŵ","Wedge":"⋀","Wfr":"\uD835\uDD1A","Wopf":"\uD835\uDD4E","Wscr":"\uD835\uDCB2","Xfr":"\uD835\uDD1B","Xi":"Ξ","Xopf":"\uD835\uDD4F","Xscr":"\uD835\uDCB3","YAcy":"Я","YIcy":"Ї","YUcy":"Ю","Yacute":"Ý","Ycirc":"Ŷ","Ycy":"Ы","Yfr":"\uD835\uDD1C","Yopf":"\uD835\uDD50","Yscr":"\uD835\uDCB4","Yuml":"Ÿ","ZHcy":"Ж","Zacute":"Ź","Zcaron":"Ž","Zcy":"З","Zdot":"Ż","ZeroWidthSpace":"​","Zeta":"Ζ","Zfr":"ℨ","Zopf":"ℤ","Zscr":"\uD835\uDCB5","aacute":"á","abreve":"ă","ac":"∾","acE":"∾̳","acd":"∿","acirc":"â","acute":"´","acy":"а","aelig":"æ","af":"⁡","afr":"\uD835\uDD1E","agrave":"à","alefsym":"ℵ","aleph":"ℵ","alpha":"α","amacr":"ā","amalg":"⨿","amp":"&","and":"∧","andand":"⩕","andd":"⩜","andslope":"⩘","andv":"⩚","ang":"∠","ange":"⦤","angle":"∠","angmsd":"∡","angmsdaa":"⦨","angmsdab":"⦩","angmsdac":"⦪","angmsdad":"⦫","angmsdae":"⦬","angmsdaf":"⦭","angmsdag":"⦮","angmsdah":"⦯","angrt":"∟","angrtvb":"⊾","angrtvbd":"⦝","angsph":"∢","angst":"Å","angzarr":"⍼","aogon":"ą","aopf":"\uD835\uDD52","ap":"≈","apE":"⩰","apacir":"⩯","ape":"≊","apid":"≋","apos":"\'","approx":"≈","approxeq":"≊","aring":"å","ascr":"\uD835\uDCB6","ast":"*","asymp":"≈","asympeq":"≍","atilde":"ã","auml":"ä","awconint":"∳","awint":"⨑","bNot":"⫭","backcong":"≌","backepsilon":"϶","backprime":"‵","backsim":"∽","backsimeq":"⋍","barvee":"⊽","barwed":"⌅","barwedge":"⌅","bbrk":"⎵","bbrktbrk":"⎶","bcong":"≌","bcy":"б","bdquo":"„","becaus":"∵","because":"∵","bemptyv":"⦰","bepsi":"϶","bernou":"ℬ","beta":"β","beth":"ℶ","between":"≬","bfr":"\uD835\uDD1F","bigcap":"⋂","bigcirc":"◯","bigcup":"⋃","bigodot":"⨀","bigoplus":"⨁","bigotimes":"⨂","bigsqcup":"⨆","bigstar":"★","bigtriangledown":"▽","bigtriangleup":"△","biguplus":"⨄","bigvee":"⋁","bigwedge":"⋀","bkarow":"⤍","blacklozenge":"⧫","blacksquare":"▪","blacktriangle":"▴","blacktriangledown":"▾","blacktriangleleft":"◂","blacktriangleright":"▸","blank":"␣","blk12":"▒","blk14":"░","blk34":"▓","block":"█","bne":"=⃥","bnequiv":"≡⃥","bnot":"⌐","bopf":"\uD835\uDD53","bot":"⊥","bottom":"⊥","bowtie":"⋈","boxDL":"╗","boxDR":"╔","boxDl":"╖","boxDr":"╓","boxH":"═","boxHD":"╦","boxHU":"╩","boxHd":"╤","boxHu":"╧","boxUL":"╝","boxUR":"╚","boxUl":"╜","boxUr":"╙","boxV":"║","boxVH":"╬","boxVL":"╣","boxVR":"╠","boxVh":"╫","boxVl":"╢","boxVr":"╟","boxbox":"⧉","boxdL":"╕","boxdR":"╒","boxdl":"┐","boxdr":"┌","boxh":"─","boxhD":"╥","boxhU":"╨","boxhd":"┬","boxhu":"┴","boxminus":"⊟","boxplus":"⊞","boxtimes":"⊠","boxuL":"╛","boxuR":"╘","boxul":"┘","boxur":"└","boxv":"│","boxvH":"╪","boxvL":"╡","boxvR":"╞","boxvh":"┼","boxvl":"┤","boxvr":"├","bprime":"‵","breve":"˘","brvbar":"¦","bscr":"\uD835\uDCB7","bsemi":"⁏","bsim":"∽","bsime":"⋍","bsol":"\\\\","bsolb":"⧅","bsolhsub":"⟈","bull":"•","bullet":"•","bump":"≎","bumpE":"⪮","bumpe":"≏","bumpeq":"≏","cacute":"ć","cap":"∩","capand":"⩄","capbrcup":"⩉","capcap":"⩋","capcup":"⩇","capdot":"⩀","caps":"∩︀","caret":"⁁","caron":"ˇ","ccaps":"⩍","ccaron":"č","ccedil":"ç","ccirc":"ĉ","ccups":"⩌","ccupssm":"⩐","cdot":"ċ","cedil":"¸","cemptyv":"⦲","cent":"¢","centerdot":"·","cfr":"\uD835\uDD20","chcy":"ч","check":"✓","checkmark":"✓","chi":"χ","cir":"○","cirE":"⧃","circ":"ˆ","circeq":"≗","circlearrowleft":"↺","circlearrowright":"↻","circledR":"®","circledS":"Ⓢ","circledast":"⊛","circledcirc":"⊚","circleddash":"⊝","cire":"≗","cirfnint":"⨐","cirmid":"⫯","cirscir":"⧂","clubs":"♣","clubsuit":"♣","colon":":","colone":"≔","coloneq":"≔","comma":",","commat":"@","comp":"∁","compfn":"∘","complement":"∁","complexes":"ℂ","cong":"≅","congdot":"⩭","conint":"∮","copf":"\uD835\uDD54","coprod":"∐","copy":"©","copysr":"℗","crarr":"↵","cross":"✗","cscr":"\uD835\uDCB8","csub":"⫏","csube":"⫑","csup":"⫐","csupe":"⫒","ctdot":"⋯","cudarrl":"⤸","cudarrr":"⤵","cuepr":"⋞","cuesc":"⋟","cularr":"↶","cularrp":"⤽","cup":"∪","cupbrcap":"⩈","cupcap":"⩆","cupcup":"⩊","cupdot":"⊍","cupor":"⩅","cups":"∪︀","curarr":"↷","curarrm":"⤼","curlyeqprec":"⋞","curlyeqsucc":"⋟","curlyvee":"⋎","curlywedge":"⋏","curren":"¤","curvearrowleft":"↶","curvearrowright":"↷","cuvee":"⋎","cuwed":"⋏","cwconint":"∲","cwint":"∱","cylcty":"⌭","dArr":"⇓","dHar":"⥥","dagger":"†","daleth":"ℸ","darr":"↓","dash":"‐","dashv":"⊣","dbkarow":"⤏","dblac":"˝","dcaron":"ď","dcy":"д","dd":"ⅆ","ddagger":"‡","ddarr":"⇊","ddotseq":"⩷","deg":"°","delta":"δ","demptyv":"⦱","dfisht":"⥿","dfr":"\uD835\uDD21","dharl":"⇃","dharr":"⇂","diam":"⋄","diamond":"⋄","diamondsuit":"♦","diams":"♦","die":"¨","digamma":"ϝ","disin":"⋲","div":"÷","divide":"÷","divideontimes":"⋇","divonx":"⋇","djcy":"ђ","dlcorn":"⌞","dlcrop":"⌍","dollar":"$","dopf":"\uD835\uDD55","dot":"˙","doteq":"≐","doteqdot":"≑","dotminus":"∸","dotplus":"∔","dotsquare":"⊡","doublebarwedge":"⌆","downarrow":"↓","downdownarrows":"⇊","downharpoonleft":"⇃","downharpoonright":"⇂","drbkarow":"⤐","drcorn":"⌟","drcrop":"⌌","dscr":"\uD835\uDCB9","dscy":"ѕ","dsol":"⧶","dstrok":"đ","dtdot":"⋱","dtri":"▿","dtrif":"▾","duarr":"⇵","duhar":"⥯","dwangle":"⦦","dzcy":"џ","dzigrarr":"⟿","eDDot":"⩷","eDot":"≑","eacute":"é","easter":"⩮","ecaron":"ě","ecir":"≖","ecirc":"ê","ecolon":"≕","ecy":"э","edot":"ė","ee":"ⅇ","efDot":"≒","efr":"\uD835\uDD22","eg":"⪚","egrave":"è","egs":"⪖","egsdot":"⪘","el":"⪙","elinters":"⏧","ell":"ℓ","els":"⪕","elsdot":"⪗","emacr":"ē","empty":"∅","emptyset":"∅","emptyv":"∅","emsp13":" ","emsp14":" ","emsp":" ","eng":"ŋ","ensp":" ","eogon":"ę","eopf":"\uD835\uDD56","epar":"⋕","eparsl":"⧣","eplus":"⩱","epsi":"ε","epsilon":"ε","epsiv":"ϵ","eqcirc":"≖","eqcolon":"≕","eqsim":"≂","eqslantgtr":"⪖","eqslantless":"⪕","equals":"=","equest":"≟","equiv":"≡","equivDD":"⩸","eqvparsl":"⧥","erDot":"≓","erarr":"⥱","escr":"ℯ","esdot":"≐","esim":"≂","eta":"η","eth":"ð","euml":"ë","euro":"€","excl":"!","exist":"∃","expectation":"ℰ","exponentiale":"ⅇ","fallingdotseq":"≒","fcy":"ф","female":"♀","ffilig":"ffi","fflig":"ff","ffllig":"ffl","ffr":"\uD835\uDD23","filig":"fi","fjlig":"fj","flat":"♭","fllig":"fl","fltns":"▱","fnof":"ƒ","fopf":"\uD835\uDD57","forall":"∀","fork":"⋔","forkv":"⫙","fpartint":"⨍","frac12":"½","frac13":"⅓","frac14":"¼","frac15":"⅕","frac16":"⅙","frac18":"⅛","frac23":"⅔","frac25":"⅖","frac34":"¾","frac35":"⅗","frac38":"⅜","frac45":"⅘","frac56":"⅚","frac58":"⅝","frac78":"⅞","frasl":"⁄","frown":"⌢","fscr":"\uD835\uDCBB","gE":"≧","gEl":"⪌","gacute":"ǵ","gamma":"γ","gammad":"ϝ","gap":"⪆","gbreve":"ğ","gcirc":"ĝ","gcy":"г","gdot":"ġ","ge":"≥","gel":"⋛","geq":"≥","geqq":"≧","geqslant":"⩾","ges":"⩾","gescc":"⪩","gesdot":"⪀","gesdoto":"⪂","gesdotol":"⪄","gesl":"⋛︀","gesles":"⪔","gfr":"\uD835\uDD24","gg":"≫","ggg":"⋙","gimel":"ℷ","gjcy":"ѓ","gl":"≷","glE":"⪒","gla":"⪥","glj":"⪤","gnE":"≩","gnap":"⪊","gnapprox":"⪊","gne":"⪈","gneq":"⪈","gneqq":"≩","gnsim":"⋧","gopf":"\uD835\uDD58","grave":"`","gscr":"ℊ","gsim":"≳","gsime":"⪎","gsiml":"⪐","gt":">","gtcc":"⪧","gtcir":"⩺","gtdot":"⋗","gtlPar":"⦕","gtquest":"⩼","gtrapprox":"⪆","gtrarr":"⥸","gtrdot":"⋗","gtreqless":"⋛","gtreqqless":"⪌","gtrless":"≷","gtrsim":"≳","gvertneqq":"≩︀","gvnE":"≩︀","hArr":"⇔","hairsp":" ","half":"½","hamilt":"ℋ","hardcy":"ъ","harr":"↔","harrcir":"⥈","harrw":"↭","hbar":"ℏ","hcirc":"ĥ","hearts":"♥","heartsuit":"♥","hellip":"…","hercon":"⊹","hfr":"\uD835\uDD25","hksearow":"⤥","hkswarow":"⤦","hoarr":"⇿","homtht":"∻","hookleftarrow":"↩","hookrightarrow":"↪","hopf":"\uD835\uDD59","horbar":"―","hscr":"\uD835\uDCBD","hslash":"ℏ","hstrok":"ħ","hybull":"⁃","hyphen":"‐","iacute":"í","ic":"⁣","icirc":"î","icy":"и","iecy":"е","iexcl":"¡","iff":"⇔","ifr":"\uD835\uDD26","igrave":"ì","ii":"ⅈ","iiiint":"⨌","iiint":"∭","iinfin":"⧜","iiota":"℩","ijlig":"ij","imacr":"ī","image":"ℑ","imagline":"ℐ","imagpart":"ℑ","imath":"ı","imof":"⊷","imped":"Ƶ","in":"∈","incare":"℅","infin":"∞","infintie":"⧝","inodot":"ı","int":"∫","intcal":"⊺","integers":"ℤ","intercal":"⊺","intlarhk":"⨗","intprod":"⨼","iocy":"ё","iogon":"į","iopf":"\uD835\uDD5A","iota":"ι","iprod":"⨼","iquest":"¿","iscr":"\uD835\uDCBE","isin":"∈","isinE":"⋹","isindot":"⋵","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"⁢","itilde":"ĩ","iukcy":"і","iuml":"ï","jcirc":"ĵ","jcy":"й","jfr":"\uD835\uDD27","jmath":"ȷ","jopf":"\uD835\uDD5B","jscr":"\uD835\uDCBF","jsercy":"ј","jukcy":"є","kappa":"κ","kappav":"ϰ","kcedil":"ķ","kcy":"к","kfr":"\uD835\uDD28","kgreen":"ĸ","khcy":"х","kjcy":"ќ","kopf":"\uD835\uDD5C","kscr":"\uD835\uDCC0","lAarr":"⇚","lArr":"⇐","lAtail":"⤛","lBarr":"⤎","lE":"≦","lEg":"⪋","lHar":"⥢","lacute":"ĺ","laemptyv":"⦴","lagran":"ℒ","lambda":"λ","lang":"⟨","langd":"⦑","langle":"⟨","lap":"⪅","laquo":"«","larr":"←","larrb":"⇤","larrbfs":"⤟","larrfs":"⤝","larrhk":"↩","larrlp":"↫","larrpl":"⤹","larrsim":"⥳","larrtl":"↢","lat":"⪫","latail":"⤙","late":"⪭","lates":"⪭︀","lbarr":"⤌","lbbrk":"❲","lbrace":"{","lbrack":"[","lbrke":"⦋","lbrksld":"⦏","lbrkslu":"⦍","lcaron":"ľ","lcedil":"ļ","lceil":"⌈","lcub":"{","lcy":"л","ldca":"⤶","ldquo":"“","ldquor":"„","ldrdhar":"⥧","ldrushar":"⥋","ldsh":"↲","le":"≤","leftarrow":"←","leftarrowtail":"↢","leftharpoondown":"↽","leftharpoonup":"↼","leftleftarrows":"⇇","leftrightarrow":"↔","leftrightarrows":"⇆","leftrightharpoons":"⇋","leftrightsquigarrow":"↭","leftthreetimes":"⋋","leg":"⋚","leq":"≤","leqq":"≦","leqslant":"⩽","les":"⩽","lescc":"⪨","lesdot":"⩿","lesdoto":"⪁","lesdotor":"⪃","lesg":"⋚︀","lesges":"⪓","lessapprox":"⪅","lessdot":"⋖","lesseqgtr":"⋚","lesseqqgtr":"⪋","lessgtr":"≶","lesssim":"≲","lfisht":"⥼","lfloor":"⌊","lfr":"\uD835\uDD29","lg":"≶","lgE":"⪑","lhard":"↽","lharu":"↼","lharul":"⥪","lhblk":"▄","ljcy":"љ","ll":"≪","llarr":"⇇","llcorner":"⌞","llhard":"⥫","lltri":"◺","lmidot":"ŀ","lmoust":"⎰","lmoustache":"⎰","lnE":"≨","lnap":"⪉","lnapprox":"⪉","lne":"⪇","lneq":"⪇","lneqq":"≨","lnsim":"⋦","loang":"⟬","loarr":"⇽","lobrk":"⟦","longleftarrow":"⟵","longleftrightarrow":"⟷","longmapsto":"⟼","longrightarrow":"⟶","looparrowleft":"↫","looparrowright":"↬","lopar":"⦅","lopf":"\uD835\uDD5D","loplus":"⨭","lotimes":"⨴","lowast":"∗","lowbar":"_","loz":"◊","lozenge":"◊","lozf":"⧫","lpar":"(","lparlt":"⦓","lrarr":"⇆","lrcorner":"⌟","lrhar":"⇋","lrhard":"⥭","lrm":"‎","lrtri":"⊿","lsaquo":"‹","lscr":"\uD835\uDCC1","lsh":"↰","lsim":"≲","lsime":"⪍","lsimg":"⪏","lsqb":"[","lsquo":"‘","lsquor":"‚","lstrok":"ł","lt":"<","ltcc":"⪦","ltcir":"⩹","ltdot":"⋖","lthree":"⋋","ltimes":"⋉","ltlarr":"⥶","ltquest":"⩻","ltrPar":"⦖","ltri":"◃","ltrie":"⊴","ltrif":"◂","lurdshar":"⥊","luruhar":"⥦","lvertneqq":"≨︀","lvnE":"≨︀","mDDot":"∺","macr":"¯","male":"♂","malt":"✠","maltese":"✠","map":"↦","mapsto":"↦","mapstodown":"↧","mapstoleft":"↤","mapstoup":"↥","marker":"▮","mcomma":"⨩","mcy":"м","mdash":"-","measuredangle":"∡","mfr":"\uD835\uDD2A","mho":"℧","micro":"µ","mid":"∣","midast":"*","midcir":"⫰","middot":"·","minus":"−","minusb":"⊟","minusd":"∸","minusdu":"⨪","mlcp":"⫛","mldr":"…","mnplus":"∓","models":"⊧","mopf":"\uD835\uDD5E","mp":"∓","mscr":"\uD835\uDCC2","mstpos":"∾","mu":"μ","multimap":"⊸","mumap":"⊸","nGg":"⋙̸","nGt":"≫⃒","nGtv":"≫̸","nLeftarrow":"⇍","nLeftrightarrow":"⇎","nLl":"⋘̸","nLt":"≪⃒","nLtv":"≪̸","nRightarrow":"⇏","nVDash":"⊯","nVdash":"⊮","nabla":"∇","nacute":"ń","nang":"∠⃒","nap":"≉","napE":"⩰̸","napid":"≋̸","napos":"ʼn","napprox":"≉","natur":"♮","natural":"♮","naturals":"ℕ","nbsp":" ","nbump":"≎̸","nbumpe":"≏̸","ncap":"⩃","ncaron":"ň","ncedil":"ņ","ncong":"≇","ncongdot":"⩭̸","ncup":"⩂","ncy":"н","ndash":"–","ne":"≠","neArr":"⇗","nearhk":"⤤","nearr":"↗","nearrow":"↗","nedot":"≐̸","nequiv":"≢","nesear":"⤨","nesim":"≂̸","nexist":"∄","nexists":"∄","nfr":"\uD835\uDD2B","ngE":"≧̸","nge":"≱","ngeq":"≱","ngeqq":"≧̸","ngeqslant":"⩾̸","nges":"⩾̸","ngsim":"≵","ngt":"≯","ngtr":"≯","nhArr":"⇎","nharr":"↮","nhpar":"⫲","ni":"∋","nis":"⋼","nisd":"⋺","niv":"∋","njcy":"њ","nlArr":"⇍","nlE":"≦̸","nlarr":"↚","nldr":"‥","nle":"≰","nleftarrow":"↚","nleftrightarrow":"↮","nleq":"≰","nleqq":"≦̸","nleqslant":"⩽̸","nles":"⩽̸","nless":"≮","nlsim":"≴","nlt":"≮","nltri":"⋪","nltrie":"⋬","nmid":"∤","nopf":"\uD835\uDD5F","not":"¬","notin":"∉","notinE":"⋹̸","notindot":"⋵̸","notinva":"∉","notinvb":"⋷","notinvc":"⋶","notni":"∌","notniva":"∌","notnivb":"⋾","notnivc":"⋽","npar":"∦","nparallel":"∦","nparsl":"⫽⃥","npart":"∂̸","npolint":"⨔","npr":"⊀","nprcue":"⋠","npre":"⪯̸","nprec":"⊀","npreceq":"⪯̸","nrArr":"⇏","nrarr":"↛","nrarrc":"⤳̸","nrarrw":"↝̸","nrightarrow":"↛","nrtri":"⋫","nrtrie":"⋭","nsc":"⊁","nsccue":"⋡","nsce":"⪰̸","nscr":"\uD835\uDCC3","nshortmid":"∤","nshortparallel":"∦","nsim":"≁","nsime":"≄","nsimeq":"≄","nsmid":"∤","nspar":"∦","nsqsube":"⋢","nsqsupe":"⋣","nsub":"⊄","nsubE":"⫅̸","nsube":"⊈","nsubset":"⊂⃒","nsubseteq":"⊈","nsubseteqq":"⫅̸","nsucc":"⊁","nsucceq":"⪰̸","nsup":"⊅","nsupE":"⫆̸","nsupe":"⊉","nsupset":"⊃⃒","nsupseteq":"⊉","nsupseteqq":"⫆̸","ntgl":"≹","ntilde":"ñ","ntlg":"≸","ntriangleleft":"⋪","ntrianglelefteq":"⋬","ntriangleright":"⋫","ntrianglerighteq":"⋭","nu":"ν","num":"#","numero":"№","numsp":" ","nvDash":"⊭","nvHarr":"⤄","nvap":"≍⃒","nvdash":"⊬","nvge":"≥⃒","nvgt":">⃒","nvinfin":"⧞","nvlArr":"⤂","nvle":"≤⃒","nvlt":"<⃒","nvltrie":"⊴⃒","nvrArr":"⤃","nvrtrie":"⊵⃒","nvsim":"∼⃒","nwArr":"⇖","nwarhk":"⤣","nwarr":"↖","nwarrow":"↖","nwnear":"⤧","oS":"Ⓢ","oacute":"ó","oast":"⊛","ocir":"⊚","ocirc":"ô","ocy":"о","odash":"⊝","odblac":"ő","odiv":"⨸","odot":"⊙","odsold":"⦼","oelig":"œ","ofcir":"⦿","ofr":"\uD835\uDD2C","ogon":"˛","ograve":"ò","ogt":"⧁","ohbar":"⦵","ohm":"Ω","oint":"∮","olarr":"↺","olcir":"⦾","olcross":"⦻","oline":"‾","olt":"⧀","omacr":"ō","omega":"ω","omicron":"ο","omid":"⦶","ominus":"⊖","oopf":"\uD835\uDD60","opar":"⦷","operp":"⦹","oplus":"⊕","or":"∨","orarr":"↻","ord":"⩝","order":"ℴ","orderof":"ℴ","ordf":"ª","ordm":"º","origof":"⊶","oror":"⩖","orslope":"⩗","orv":"⩛","oscr":"ℴ","oslash":"ø","osol":"⊘","otilde":"õ","otimes":"⊗","otimesas":"⨶","ouml":"ö","ovbar":"⌽","par":"∥","para":"¶","parallel":"∥","parsim":"⫳","parsl":"⫽","part":"∂","pcy":"п","percnt":"%","period":".","permil":"‰","perp":"⊥","pertenk":"‱","pfr":"\uD835\uDD2D","phi":"φ","phiv":"ϕ","phmmat":"ℳ","phone":"☎","pi":"π","pitchfork":"⋔","piv":"ϖ","planck":"ℏ","planckh":"ℎ","plankv":"ℏ","plus":"+","plusacir":"⨣","plusb":"⊞","pluscir":"⨢","plusdo":"∔","plusdu":"⨥","pluse":"⩲","plusmn":"±","plussim":"⨦","plustwo":"⨧","pm":"±","pointint":"⨕","popf":"\uD835\uDD61","pound":"£","pr":"≺","prE":"⪳","prap":"⪷","prcue":"≼","pre":"⪯","prec":"≺","precapprox":"⪷","preccurlyeq":"≼","preceq":"⪯","precnapprox":"⪹","precneqq":"⪵","precnsim":"⋨","precsim":"≾","prime":"′","primes":"ℙ","prnE":"⪵","prnap":"⪹","prnsim":"⋨","prod":"∏","profalar":"⌮","profline":"⌒","profsurf":"⌓","prop":"∝","propto":"∝","prsim":"≾","prurel":"⊰","pscr":"\uD835\uDCC5","psi":"ψ","puncsp":" ","qfr":"\uD835\uDD2E","qint":"⨌","qopf":"\uD835\uDD62","qprime":"⁗","qscr":"\uD835\uDCC6","quaternions":"ℍ","quatint":"⨖","quest":"?","questeq":"≟","quot":"\\"","rAarr":"⇛","rArr":"⇒","rAtail":"⤜","rBarr":"⤏","rHar":"⥤","race":"∽̱","racute":"ŕ","radic":"√","raemptyv":"⦳","rang":"⟩","rangd":"⦒","range":"⦥","rangle":"⟩","raquo":"»","rarr":"→","rarrap":"⥵","rarrb":"⇥","rarrbfs":"⤠","rarrc":"⤳","rarrfs":"⤞","rarrhk":"↪","rarrlp":"↬","rarrpl":"⥅","rarrsim":"⥴","rarrtl":"↣","rarrw":"↝","ratail":"⤚","ratio":"∶","rationals":"ℚ","rbarr":"⤍","rbbrk":"❳","rbrace":"}","rbrack":"]","rbrke":"⦌","rbrksld":"⦎","rbrkslu":"⦐","rcaron":"ř","rcedil":"ŗ","rceil":"⌉","rcub":"}","rcy":"р","rdca":"⤷","rdldhar":"⥩","rdquo":"”","rdquor":"”","rdsh":"↳","real":"ℜ","realine":"ℛ","realpart":"ℜ","reals":"ℝ","rect":"▭","reg":"®","rfisht":"⥽","rfloor":"⌋","rfr":"\uD835\uDD2F","rhard":"⇁","rharu":"⇀","rharul":"⥬","rho":"ρ","rhov":"ϱ","rightarrow":"→","rightarrowtail":"↣","rightharpoondown":"⇁","rightharpoonup":"⇀","rightleftarrows":"⇄","rightleftharpoons":"⇌","rightrightarrows":"⇉","rightsquigarrow":"↝","rightthreetimes":"⋌","ring":"˚","risingdotseq":"≓","rlarr":"⇄","rlhar":"⇌","rlm":"‏","rmoust":"⎱","rmoustache":"⎱","rnmid":"⫮","roang":"⟭","roarr":"⇾","robrk":"⟧","ropar":"⦆","ropf":"\uD835\uDD63","roplus":"⨮","rotimes":"⨵","rpar":")","rpargt":"⦔","rppolint":"⨒","rrarr":"⇉","rsaquo":"›","rscr":"\uD835\uDCC7","rsh":"↱","rsqb":"]","rsquo":"’","rsquor":"’","rthree":"⋌","rtimes":"⋊","rtri":"▹","rtrie":"⊵","rtrif":"▸","rtriltri":"⧎","ruluhar":"⥨","rx":"℞","sacute":"ś","sbquo":"‚","sc":"≻","scE":"⪴","scap":"⪸","scaron":"š","sccue":"≽","sce":"⪰","scedil":"ş","scirc":"ŝ","scnE":"⪶","scnap":"⪺","scnsim":"⋩","scpolint":"⨓","scsim":"≿","scy":"с","sdot":"⋅","sdotb":"⊡","sdote":"⩦","seArr":"⇘","searhk":"⤥","searr":"↘","searrow":"↘","sect":"§","semi":";","seswar":"⤩","setminus":"∖","setmn":"∖","sext":"✶","sfr":"\uD835\uDD30","sfrown":"⌢","sharp":"♯","shchcy":"щ","shcy":"ш","shortmid":"∣","shortparallel":"∥","shy":"­","sigma":"σ","sigmaf":"ς","sigmav":"ς","sim":"∼","simdot":"⩪","sime":"≃","simeq":"≃","simg":"⪞","simgE":"⪠","siml":"⪝","simlE":"⪟","simne":"≆","simplus":"⨤","simrarr":"⥲","slarr":"←","smallsetminus":"∖","smashp":"⨳","smeparsl":"⧤","smid":"∣","smile":"⌣","smt":"⪪","smte":"⪬","smtes":"⪬︀","softcy":"ь","sol":"/","solb":"⧄","solbar":"⌿","sopf":"\uD835\uDD64","spades":"♠","spadesuit":"♠","spar":"∥","sqcap":"⊓","sqcaps":"⊓︀","sqcup":"⊔","sqcups":"⊔︀","sqsub":"⊏","sqsube":"⊑","sqsubset":"⊏","sqsubseteq":"⊑","sqsup":"⊐","sqsupe":"⊒","sqsupset":"⊐","sqsupseteq":"⊒","squ":"□","square":"□","squarf":"▪","squf":"▪","srarr":"→","sscr":"\uD835\uDCC8","ssetmn":"∖","ssmile":"⌣","sstarf":"⋆","star":"☆","starf":"★","straightepsilon":"ϵ","straightphi":"ϕ","strns":"¯","sub":"⊂","subE":"⫅","subdot":"⪽","sube":"⊆","subedot":"⫃","submult":"⫁","subnE":"⫋","subne":"⊊","subplus":"⪿","subrarr":"⥹","subset":"⊂","subseteq":"⊆","subseteqq":"⫅","subsetneq":"⊊","subsetneqq":"⫋","subsim":"⫇","subsub":"⫕","subsup":"⫓","succ":"≻","succapprox":"⪸","succcurlyeq":"≽","succeq":"⪰","succnapprox":"⪺","succneqq":"⪶","succnsim":"⋩","succsim":"≿","sum":"∑","sung":"♪","sup1":"¹","sup2":"²","sup3":"³","sup":"⊃","supE":"⫆","supdot":"⪾","supdsub":"⫘","supe":"⊇","supedot":"⫄","suphsol":"⟉","suphsub":"⫗","suplarr":"⥻","supmult":"⫂","supnE":"⫌","supne":"⊋","supplus":"⫀","supset":"⊃","supseteq":"⊇","supseteqq":"⫆","supsetneq":"⊋","supsetneqq":"⫌","supsim":"⫈","supsub":"⫔","supsup":"⫖","swArr":"⇙","swarhk":"⤦","swarr":"↙","swarrow":"↙","swnwar":"⤪","szlig":"ß","target":"⌖","tau":"τ","tbrk":"⎴","tcaron":"ť","tcedil":"ţ","tcy":"т","tdot":"⃛","telrec":"⌕","tfr":"\uD835\uDD31","there4":"∴","therefore":"∴","theta":"θ","thetasym":"ϑ","thetav":"ϑ","thickapprox":"≈","thicksim":"∼","thinsp":" ","thkap":"≈","thksim":"∼","thorn":"þ","tilde":"˜","times":"×","timesb":"⊠","timesbar":"⨱","timesd":"⨰","tint":"∭","toea":"⤨","top":"⊤","topbot":"⌶","topcir":"⫱","topf":"\uD835\uDD65","topfork":"⫚","tosa":"⤩","tprime":"‴","trade":"™","triangle":"▵","triangledown":"▿","triangleleft":"◃","trianglelefteq":"⊴","triangleq":"≜","triangleright":"▹","trianglerighteq":"⊵","tridot":"◬","trie":"≜","triminus":"⨺","triplus":"⨹","trisb":"⧍","tritime":"⨻","trpezium":"⏢","tscr":"\uD835\uDCC9","tscy":"ц","tshcy":"ћ","tstrok":"ŧ","twixt":"≬","twoheadleftarrow":"↞","twoheadrightarrow":"↠","uArr":"⇑","uHar":"⥣","uacute":"ú","uarr":"↑","ubrcy":"ў","ubreve":"ŭ","ucirc":"û","ucy":"у","udarr":"⇅","udblac":"ű","udhar":"⥮","ufisht":"⥾","ufr":"\uD835\uDD32","ugrave":"ù","uharl":"↿","uharr":"↾","uhblk":"▀","ulcorn":"⌜","ulcorner":"⌜","ulcrop":"⌏","ultri":"◸","umacr":"ū","uml":"¨","uogon":"ų","uopf":"\uD835\uDD66","uparrow":"↑","updownarrow":"↕","upharpoonleft":"↿","upharpoonright":"↾","uplus":"⊎","upsi":"υ","upsih":"ϒ","upsilon":"υ","upuparrows":"⇈","urcorn":"⌝","urcorner":"⌝","urcrop":"⌎","uring":"ů","urtri":"◹","uscr":"\uD835\uDCCA","utdot":"⋰","utilde":"ũ","utri":"▵","utrif":"▴","uuarr":"⇈","uuml":"ü","uwangle":"⦧","vArr":"⇕","vBar":"⫨","vBarv":"⫩","vDash":"⊨","vangrt":"⦜","varepsilon":"ϵ","varkappa":"ϰ","varnothing":"∅","varphi":"ϕ","varpi":"ϖ","varpropto":"∝","varr":"↕","varrho":"ϱ","varsigma":"ς","varsubsetneq":"⊊︀","varsubsetneqq":"⫋︀","varsupsetneq":"⊋︀","varsupsetneqq":"⫌︀","vartheta":"ϑ","vartriangleleft":"⊲","vartriangleright":"⊳","vcy":"в","vdash":"⊢","vee":"∨","veebar":"⊻","veeeq":"≚","vellip":"⋮","verbar":"|","vert":"|","vfr":"\uD835\uDD33","vltri":"⊲","vnsub":"⊂⃒","vnsup":"⊃⃒","vopf":"\uD835\uDD67","vprop":"∝","vrtri":"⊳","vscr":"\uD835\uDCCB","vsubnE":"⫋︀","vsubne":"⊊︀","vsupnE":"⫌︀","vsupne":"⊋︀","vzigzag":"⦚","wcirc":"ŵ","wedbar":"⩟","wedge":"∧","wedgeq":"≙","weierp":"℘","wfr":"\uD835\uDD34","wopf":"\uD835\uDD68","wp":"℘","wr":"≀","wreath":"≀","wscr":"\uD835\uDCCC","xcap":"⋂","xcirc":"◯","xcup":"⋃","xdtri":"▽","xfr":"\uD835\uDD35","xhArr":"⟺","xharr":"⟷","xi":"ξ","xlArr":"⟸","xlarr":"⟵","xmap":"⟼","xnis":"⋻","xodot":"⨀","xopf":"\uD835\uDD69","xoplus":"⨁","xotime":"⨂","xrArr":"⟹","xrarr":"⟶","xscr":"\uD835\uDCCD","xsqcup":"⨆","xuplus":"⨄","xutri":"△","xvee":"⋁","xwedge":"⋀","yacute":"ý","yacy":"я","ycirc":"ŷ","ycy":"ы","yen":"¥","yfr":"\uD835\uDD36","yicy":"ї","yopf":"\uD835\uDD6A","yscr":"\uD835\uDCCE","yucy":"ю","yuml":"ÿ","zacute":"ź","zcaron":"ž","zcy":"з","zdot":"ż","zeetrf":"ℨ","zeta":"ζ","zfr":"\uD835\uDD37","zhcy":"ж","zigrarr":"⇝","zopf":"\uD835\uDD6B","zscr":"\uD835\uDCCF","zwj":"‍","zwnj":"‌"}'),T="�",N={0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376},R=/&(?:#[xX]([0-9a-fA-F]+)|#([0-9]+)|([A-Za-z][A-Za-z0-9]*));/g,j=/&(?:#[xX]([0-9a-fA-F]+);?|#([0-9]+);?|([A-Za-z][A-Za-z0-9]*);?)/g;function Z(V){if(V in N)return String.fromCodePoint(N[V]);if(V<0||V>1114111)return"�";if(V>=55296&&V<=57343)return"�";return String.fromCodePoint(V)}function q(V){if(typeof V!=="string"||V.indexOf("&")===-1)return V;return V.replace(R,(X,H,Q,L)=>{if(H!==void 0)return Z(parseInt(H,16));if(Q!==void 0)return Z(parseInt(Q,10));let Y=S[L];return Y===void 0?X:Y})}function $(V){if(typeof V!=="string"||V.indexOf("&")===-1)return V;return V.replace(j,(X,H,Q,L)=>{if(H!==void 0)return Z(parseInt(H,16));if(Q!==void 0)return Z(parseInt(Q,10));let Y=S[L];return Y===void 0?X:Y})}return{decodeHtmlStrict:q,decodeHtml:$,decodeCodePoint:Z,HTML5_ENTITIES:S}}};var gZ={name:"csv",version:"1.0.0",type:"fw.io.codec",dependencies:[],factory(){let E=/^-?\d+$/,S=/^-?(?:\d+\.\d*|\.\d+|\d+)(?:[eE][+-]?\d+)?$/;function T(Z){if(Z==="")return"";if(Z==="true")return!0;if(Z==="false")return!1;if(Z==="null")return null;if(E.test(Z)){let q=Number(Z);if(Number.isSafeInteger(q))return q;return Z}if(S.test(Z))return Number(Z);return Z}function N(Z,q){q=q||{};let $=q.delimiter||",",V=q.quote||'"',X=q.skipEmpty!==!1,H=!!q.trim,Q=!!q.cast,L=q.comment||null,Y=q.skipLines|0;if($.length!==1)throw Error("csv: delimiter must be a single character");if(V.length!==1)throw Error("csv: quote must be a single character");let G=0;if(Z.charCodeAt(0)===65279)G=1;let J=[],U="",W=[],C=!1,P=!1,D=Z.length,F=0,K=()=>{W.push(H&&!C?U.trim():U),U="",C=!1},O=()=>{if(K(),W.length===1&&W[0]===""&&X){W=[];return}if(L!==null&&W.length>0&&(H?W[0].trimStart():W[0]).charAt(0)===L){W=[];return}if(F<Y){F++,W=[];return}J.push(W),W=[]},M=G;while(M<D){let z=Z[M];if(P){if(z===V){if(Z[M+1]===V){U+=V,M+=2;continue}P=!1,M++;continue}U+=z,M++;continue}if(z===V&&U===""){P=!0,C=!0,M++;continue}if(z===$){K(),M++;continue}if(z==="\r"){O(),M+=Z[M+1]===`
40
+ `?2:1;continue}if(z===`
41
+ `){O(),M++;continue}U+=z,M++}if(P)throw Error("csv: unterminated quoted field");if(U!==""||W.length>0)O();if(Q)for(let z=0;z<J.length;z++){let B=J[z];for(let I=0;I<B.length;I++)B[I]=T(B[I])}if(q.header){let z;if(Array.isArray(q.header))z=q.header;else{if(J.length===0)return[];if(z=J.shift(),Q)for(let I=0;I<z.length;I++)z[I]=String(z[I])}let B=Array(J.length);for(let I=0;I<J.length;I++){let A={},w=J[I];for(let k=0;k<z.length;k++)A[z[k]]=w[k];B[I]=A}return B}return J}function R(Z){if(Z===null||Z===void 0)return"";if(Z instanceof Date)return Z.toISOString();if(typeof Z==="bigint")return Z.toString();return String(Z)}function j(Z,q){q=q||{};let $=q.delimiter||",",V=q.quote||'"',X=q.newline||`\r
42
+ `;if(!Z||Z.length===0)return"";let H=!Array.isArray(Z[0])&&typeof Z[0]==="object"&&Z[0]!==null&&!(Z[0]instanceof Date),Q=null,L;if(H){Q=Array.isArray(q.header)?q.header:Object.keys(Z[0]),L=Array(Z.length);for(let P=0;P<Z.length;P++){let D=Z[P],F=Array(Q.length);for(let K=0;K<Q.length;K++)F[K]=D[Q[K]];L[P]=F}}else if(L=Z,Array.isArray(q.header))Q=q.header;let Y=(P)=>P.indexOf($)>=0||P.indexOf(V)>=0||P.indexOf(`
43
+ `)>=0||P.indexOf("\r")>=0,G=V,J=V+V,U=(P)=>{if(Y(P))return G+P.split(G).join(J)+G;return P},W=[];if(Q&&q.header!==!1){let P=Array(Q.length);for(let D=0;D<Q.length;D++)P[D]=U(String(Q[D]));W.push(P.join($))}for(let P=0;P<L.length;P++){let D=L[P],F=Array(D.length);for(let K=0;K<D.length;K++)F[K]=U(R(D[K]));W.push(F.join($))}return W.join(X)+X}return{parse:N,stringify:j}}};var xZ={name:"xml",version:"1.0.0",type:"fw.io.codec",dependencies:[],factory(){class E extends Error{constructor(G,J){super(J);Object.defineProperty(this,"name",{value:"XmlParseError",writable:!0,configurable:!0}),this.code=G}}let S={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};function T(G){return G.replace(/&(#x[0-9a-fA-F]+|#\d+|[a-zA-Z]+);/g,(J,U)=>{if(U[0]==="#"){let W=U[1]==="x"?parseInt(U.slice(2),16):parseInt(U.slice(1),10);if(isNaN(W)||W<0||W>1114111||W>=55296&&W<=57343)return J;return String.fromCodePoint(W)}return S[U]!=null?S[U]:J})}function N(G){return String(G).replace(/[&<>]/g,(J)=>J==="&"?"&amp;":J==="<"?"&lt;":"&gt;")}function R(G){return String(G).replace(/[&<>"]/g,(J)=>J==="&"?"&amp;":J==="<"?"&lt;":J===">"?"&gt;":"&quot;")}function j(G,J,U){return{type:"element",name:G,attrs:J||{},children:U||[]}}function Z(G){return{type:"text",value:G}}function q(G,J){let U=J+1,W=G.length,C="";while(U<W){let P=G[U];if(C){if(P===C)C=""}else if(P==='"'||P==="'")C=P;else if(P===">")return U;U++}return-1}function $(G){let J=0,U=G.length;while(J<U&&!/\s/.test(G[J]))J++;let W=G.slice(0,J),C={};while(J<U){while(J<U&&/\s/.test(G[J]))J++;if(J>=U)break;let P=J;while(P<U&&G[P]!=="="&&!/\s/.test(G[P]))P++;let D=G.slice(J,P);if(!D)break;while(P<U&&/\s/.test(G[P]))P++;if(G[P]!=="="){C[D]="",J=P;continue}P++;while(P<U&&/\s/.test(G[P]))P++;let F=G[P];if(F!=='"'&&F!=="'")throw new E("xml/parse-error",`XML: unquoted attribute "${D}"`);let K=G.indexOf(F,P+1);if(K<0)throw new E("xml/parse-error",`XML: unterminated attribute "${D}"`);C[D]=T(G.slice(P+1,K)),J=K+1}return j(W,C)}function V(G){let J=0,U=G.length;if(G.charCodeAt(0)===65279)J=1;let W=[],C=null;while(J<U)if(G[J]==="<"){if(G.startsWith("<?",J)){let O=G.indexOf("?>",J+2);if(O<0)throw new E("xml/parse-error","XML: unterminated processing instruction");J=O+2;continue}if(G.startsWith("<!--",J)){let O=G.indexOf("-->",J+4);if(O<0)throw new E("xml/parse-error","XML: unterminated comment");J=O+3;continue}if(G.startsWith("<![CDATA[",J)){let O=G.indexOf("]]>",J+9);if(O<0)throw new E("xml/parse-error","XML: unterminated CDATA");let M=G.slice(J+9,O);if(W.length)W[W.length-1].children.push(Z(M));J=O+3;continue}if(G.startsWith("<!",J)){let O=J+2,M=!1;while(O<U){if(G[O]==="["){M=!0;break}if(G[O]===">")break;O++}if(M){let z=G.indexOf("]>",O+1);if(z<0)throw new E("xml/parse-error","XML: unterminated declaration");J=z+2}else{if(O>=U)throw new E("xml/parse-error","XML: unterminated declaration");J=O+1}continue}if(G[J+1]==="/"){let O=G.indexOf(">",J);if(O<0)throw new E("xml/parse-error","XML: unterminated end tag");let M=G.slice(J+2,O).trim(),z=W.pop();if(!z||z.name!==M)throw new E("xml/parse-error",`XML: mismatched end tag </${M}> (expected </${z?z.name:"∅"}>)`);J=O+1;continue}let P=q(G,J);if(P<0)throw new E("xml/parse-error","XML: unterminated start tag");let D=G[P-1]==="/",F=G.slice(J+1,D?P-1:P),K=$(F);if(W.length)W[W.length-1].children.push(K);else{if(C)throw new E("xml/parse-error","XML: multiple root elements");C=K}if(!D)W.push(K);else if(!C)C=K;J=P+1}else{let P=G.indexOf("<",J),D=G.slice(J,P<0?U:P);if(W.length&&D.length)W[W.length-1].children.push(Z(T(D)));if(P<0)break;J=P}if(W.length)throw new E("xml/parse-error",`XML: unclosed element <${W[W.length-1].name}>`);if(!C)throw new E("xml/parse-error","XML: no root element");return C}function X(G){if(G.type==="text")return N(G.value);let J=Object.keys(G.attrs).map((W)=>` ${W}="${R(G.attrs[W])}"`).join("");if(!G.children||G.children.length===0)return`<${G.name}${J}/>`;let U=G.children.map(X).join("");return`<${G.name}${J}>${U}</${G.name}>`}function H(G){return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
44
+ `+X(G)}function Q(G,J){if(!G.children)return null;for(let U of G.children)if(U.type==="element"&&U.name===J)return U;return null}function L(G,J){let U=[];if(!G.children)return U;for(let W of G.children)if(W.type==="element"&&W.name===J)U.push(W);return U}function Y(G){if(!G)return"";if(G.type==="text")return G.value;if(!G.children)return"";return G.children.map(Y).join("")}return{el:j,text:Z,parse:V,serialize:H,serializeNode:X,findChild:Q,findAll:L,textContent:Y,encodeText:N,encodeAttr:R,decodeEntities:T,XmlParseError:E}}};var s$={name:"bitArray",version:"1.0.0",type:"fw.crypto.utils",dependencies:[],factory(){let E={ba_to_ui8:function(T){let N=[],R=E.bitLength(T),j,Z;for(j=0;j<R/8;j++){if((j&3)===0)Z=T[j/4];N.push(Z>>>8>>>8>>>8),Z<<=8}return new Uint8Array(N)},ui8_to_ba:function(T){let N=[],R,j=0;for(R=0;R<T.length;R++)if(j=j<<8|T[R],(R&3)===3)N.push(j),j=0;if(R&3)N.push(E.partial(8*(R&3),j));return N},bitSlice:function(T,N,R){return T=S(T.slice(N/32),32-(N&31)).slice(1),R===void 0?T:E.clamp(T,R-N)},extract:function(T,N,R){let j,Z=(-N-R&31)>>0;if((N+R-1^N)&-32)j=T[N/32|0]<<32-Z^T[N/32+1|0]>>>Z;else j=T[N/32|0]>>>Z;return j&(1<<R)-1},concat:function(T,N){if(T.length===0||N.length===0)return T.concat(N);let R=T[T.length-1],j=E.getPartial(R);if(j===32)return T.concat(N);else return S(N,j,R|0,T.slice(0,T.length-1))},bitLength:function(T){let N=T.length,R;if(N===0)return 0;return R=T[N-1],(N-1)*32+E.getPartial(R)},clamp:function(T,N){if(T.length*32<N)return T;T=T.slice(0,Math.ceil(N/32));let R=T.length;if(N=N&31,R>0&&N)T[R-1]=E.partial(N,T[R-1]&2147483648>>N-1,1);return T},partial:function(T,N,R){if(T===32)return N;return(R?N|0:N<<32-T)+T*1099511627776},getPartial:function(T){return Math.round(T/1099511627776)||32},equal:function(T,N){if(E.bitLength(T)!==E.bitLength(N))return!1;let R=0,j;for(j=0;j<T.length;j++)R|=T[j]^N[j];return R===0},byteswapM:function(T){if(T.length>0&&E.getPartial(T[T.length-1])!==32)return console.warn("[crypto] INVALID: bitArray.byteswapM: partial words not supported"),!1;let N,R,j=65280;for(N=0;N<T.length;++N)R=T[N],T[N]=R>>>24|R>>>8&j|(R&j)<<8|R<<24;return T}};function S(T,N,R,j){let Z,q,$;if(j===void 0)j=[];for(;N>=32;N-=32)j.push(R),R=0;if(N===0)return j.concat(T);for(Z=0;Z<T.length;Z++)j.push(R|T[Z]>>>N),R=T[Z]<<32-N;return q=T.length?T[T.length-1]:0,$=E.getPartial(q),j.push(E.partial(N+$&31,N+$>32?R:j.pop(),1)),j}return E}};var fZ={name:"aes",version:"1.0.0",type:"fw.crypto.cipher",dependencies:[],factory(){let E=[[[],[],[],[],[]],[[],[],[],[],[]]];(function(){let w=E[0],k=E[1],g=w[4],x=k[4],f=[],y=[],_,v,b,h,d,n,m,c,o;for(o=0;o<256;o++)y[(f[o]=o<<1^(o>>7)*283)^o]=o;for(_=v=0;!g[_];_^=b||1,v=y[v]||1){n=v^v<<1^v<<2^v<<3^v<<4,n=n>>8^n&255^99,g[_]=n,x[n]=_,d=f[h=f[b=f[_]]],c=d*16843009^h*65537^b*257^_*16843008,m=f[n]*257^n*16843008;for(o=0;o<4;o++)w[o][_]=m=m<<24^m>>>8,k[o][n]=c=c<<24^c>>>8}for(o=0;o<5;o++)w[o]=w[o].slice(0),k[o]=k[o].slice(0)})();function S(A,w,k,g){if(A.length!==4)return console.warn("[crypto] INVALID: aes: invalid block size"),!1;let x=k[w],f=A[0]^x[0],y=A[w?3:1]^x[1],_=A[2]^x[2],v=A[w?1:3]^x[3],b,h,d,n=x.length/4-2,m=4,c=[0,0,0,0],o=g[w],$$=o[0],e=o[1],t=o[2],G$=o[3],Q$=o[4];for(let u=0;u<n;u++)b=$$[f>>>24]^e[y>>16&255]^t[_>>8&255]^G$[v&255]^x[m],h=$$[y>>>24]^e[_>>16&255]^t[v>>8&255]^G$[f&255]^x[m+1],d=$$[_>>>24]^e[v>>16&255]^t[f>>8&255]^G$[y&255]^x[m+2],v=$$[v>>>24]^e[f>>16&255]^t[y>>8&255]^G$[_&255]^x[m+3],m+=4,f=b,y=h,_=d;for(let u=0;u<4;u++)c[w?3&-u:u]=Q$[f>>>24]<<24^Q$[y>>16&255]<<16^Q$[_>>8&255]<<8^Q$[v&255]^x[m++],b=f,f=y,y=_,_=v,v=b;return c}let T=65535;function N(A,w,k){let g=A[0],x=A[1],f=A[2],y=A[3],_=A[4],v=A[5],b=A[6],h=A[7],d=w[0],n=w[1],m=w[2],c=w[3],o=w[4],$$=w[5],e=w[6],t=w[7],G$=g&d,Q$=g&n^x&d,u=g&m^x&n^f&d,r=g&c^x&m^f&n^y&d,l=g&o^x&c^f&m^y&n^_&d,p=g&$$^x&o^f&c^y&m^_&n^v&d,i=g&e^x&$$^f&o^y&c^_&m^v&n^b&d,a=g&t^x&e^f&$$^y&o^_&c^v&m^b&n^h&d,Z$=x&t^f&e^y&$$^_&o^v&c^b&m^h&n,J$=f&t^y&e^_&$$^v&o^b&c^h&m,s=y&t^_&e^v&$$^b&o^h&c,Y$=_&t^v&e^b&$$^h&o,X$=v&t^b&e^h&$$,U$=b&t^h&e,z$=h&t;s^=z$,J$^=z$,a^=z$,i^=z$,J$^=U$,Z$^=U$,i^=U$,p^=U$,Z$^=X$,a^=X$,p^=X$,l^=X$,a^=Y$,i^=Y$,l^=Y$,r^=Y$,i^=s,p^=s,r^=s,u^=s,p^=J$,l^=J$,u^=J$,Q$^=J$,l^=Z$,r^=Z$,Q$^=Z$,G$^=Z$,k[0]=G$,k[1]=Q$,k[2]=u,k[3]=r,k[4]=l,k[5]=p,k[6]=i,k[7]=a}function R(A,w){let k=A[0],g=A[1],x=A[2],f=A[3],y=A[4],_=A[5],v=A[6],b=A[7];w[0]=k^y^v,w[1]=y^v^b,w[2]=g^_,w[3]=y^_^v^b,w[4]=x^y^b,w[5]=_^v,w[6]=f^_,w[7]=v^b}let j=new Int32Array(8),Z=new Int32Array(8),q=new Int32Array(8),$=new Int32Array(8),V=new Int32Array(8);function X(A){R(A,j),N(j,A,Z),R(Z,q),R(q,q),N(q,Z,$),R($,$),R($,$),R($,$),R($,$),N($,q,$),N($,j,A)}function H(A){X(A);for(let w=0;w<8;w++)V[w]=A[w];for(let w=0;w<8;w++)A[w]=V[w]^V[w+4&7]^V[w+5&7]^V[w+6&7]^V[w+7&7]^(99>>w&1?T:0)}function Q(A){for(let w=0;w<8;w++)V[w]=A[w];for(let w=0;w<8;w++)A[w]=V[w+2&7]^V[w+5&7]^V[w+7&7]^(5>>w&1?T:0);X(A)}function L(A,w){for(let k=0;k<8;k++){let g=A[k],x=g&4369;for(let f=1;f<4;f++){let y=4369<<f,_=g&y,v=4*f,b=w?_<<v|_>>>16-v:_>>>v|_<<16-v;x|=b&y}A[k]=x}}let Y=new Int32Array(8),G=new Int32Array(8);function J(A){for(let h=0;h<8;h++){let d=A[h],n=d>>>1&30583|(d&4369)<<3,m=n>>>1&30583|(n&4369)<<3,c=m>>>1&30583|(m&4369)<<3;Y[h]=d^n^m^c,G[h]=d^n}let w=G,k=w[7],g=w[0]^w[7],x=w[1],f=w[2]^w[7],y=w[3]^w[7],_=w[4],v=w[5],b=w[6];A[0]^=Y[0]^k,A[1]^=Y[1]^g,A[2]^=Y[2]^x,A[3]^=Y[3]^f,A[4]^=Y[4]^y,A[5]^=Y[5]^_,A[6]^=Y[6]^v,A[7]^=Y[7]^b}function U(A){J(A),J(A),J(A)}function W(A,w){w.fill(0);for(let k=0;k<4;k++){let g=A[k];for(let x=0;x<4;x++){let f=g>>>24-8*x&255,y=x+4*k;for(let _=0;_<8;_++)w[_]|=(f>>>_&1)<<y}}}function C(A){let w=[0,0,0,0];for(let k=0;k<4;k++){let g=0;for(let x=0;x<4;x++){let f=x+4*k,y=0;for(let _=0;_<8;_++)y|=(A[_]>>>f&1)<<_;g|=y<<24-8*x}w[k]=g}return w}let P=new Int32Array(8);function D(A){return W([A,0,0,0],P),H(P),C(P)[0]}function F(A){let w=A.length,k=A.slice(0),g=1;for(let x=w;x<4*w+28;x++){let f=k[x-1];if(x%w===0)f=D(f<<8|f>>>24)^g<<24,g=g<<1^(g>>7)*283;else if(w===8&&x%w===4)f=D(f);k[x]=k[x-w]^f}return k}function K(A){let w=E[0][4],k=A.length,g=A.slice(0),x=1;for(let f=k;f<4*k+28;f++){let y=g[f-1];if(f%k===0||k===8&&f%k===4){if(y=w[y>>>24]<<24^w[y>>16&255]<<16^w[y>>8&255]<<8^w[y&255],f%k===0)y=y<<8^y>>>24^x<<24,x=x<<1^(x>>7)*283}g[f]=g[f-k]^y}return g}function O(A){let w=[];for(let k=0;k<A.length/4;k++){let g=new Int32Array(8);W(A.slice(4*k,4*k+4),g),w.push(g)}return w}let M=(A,w)=>{for(let k=0;k<8;k++)A[k]^=w[k]};function z(A,w,k){if(!A||A.length!==4)return console.warn("[crypto] INVALID: aes: invalid block size"),!1;let g=P,x=k.length-1;if(W(A,g),!w){M(g,k[0]);for(let f=1;f<x;f++)H(g),L(g,!1),J(g),M(g,k[f]);H(g),L(g,!1),M(g,k[x])}else{M(g,k[x]);for(let f=x-1;f>=1;f--)L(g,!0),Q(g),M(g,k[f]),U(g);L(g,!0),Q(g),M(g,k[0])}return C(g)}let B=(A,w)=>z(A,0,w),I={};return I.fn=function(A,w=!0){let k=A.length;if(k!==4&&k!==6&&k!==8)return console.warn("[crypto] INVALID: aes: invalid key size"),!1;let g=O(F(A)),x={encrypt(f){return z(f,0,g)}};if(w)x.decrypt=(f)=>z(f,1,g);return x},I.ttable={fn(A,w=!0){let k=E.slice(),g=k[0][4],x=k[1],f=A.length,y=1,_,v,b;if(f!==4&&f!==6&&f!==8)return console.warn("[crypto] INVALID: aes: invalid key size"),!1;let h=A.slice(0),d=[],n=[h,d];for(_=f;_<4*f+28;_++){if(b=h[_-1],_%f===0||f===8&&_%f===4){if(b=g[b>>>24]<<24^g[b>>16&255]<<16^g[b>>8&255]<<8^g[b&255],_%f===0)b=b<<8^b>>>24^y<<24,y=y<<1^(y>>7)*283}h[_]=h[_-f]^b}if(w)for(v=0;_;v++,_--)if(b=h[v&3?_:_-4],_<=4||v<4)d[v]=b;else d[v]=x[0][g[b>>>24]]^x[1][g[b>>16&255]]^x[2][g[b>>8&255]]^x[3][g[b&255]];let m={encrypt(c){return S(c,0,n,k)}};if(w)m.decrypt=function(c){return S(c,1,n,k)};return m}},Object.defineProperty(I,Symbol.for("@awacloud/fw/internal"),{value:{sbox:E[0][4],sboxInv:E[1][4],bsSub(A){let w=new Int32Array(8);for(let k=0;k<16;k++)for(let g=0;g<8;g++)w[g]|=(A[k]>>>g&1)<<k;return H(w),Uint8Array.from({length:16},(k,g)=>{let x=0;for(let f=0;f<8;f++)x|=(w[f]>>>g&1)<<f;return x})},bsInvSub(A){let w=new Int32Array(8);for(let k=0;k<16;k++)for(let g=0;g<8;g++)w[g]|=(A[k]>>>g&1)<<k;return Q(w),Uint8Array.from({length:16},(k,g)=>{let x=0;for(let f=0;f<8;f++)x|=(w[f]>>>g&1)<<f;return x})},expandKey:F,expandKeyTable:K,bsEncrypt:B}}),I}};var yZ={name:"sha256",version:"1.0.0",type:"fw.crypto.hash",dependencies:["bitArray","utf8"],deps:[s$,R$],factory(E,S){let T=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],N=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],R=Int32Array.from(N),j=new Int32Array(16),Z=new Int32Array(64);function q(X,H){let Q=R,L=Z;for(let I=0;I<16;I++)L[I]=H[I]|0;for(let I=16;I<64;I++){let A=L[I-15],w=L[I-2],k=(A>>>7|A<<25)^(A>>>18|A<<14)^A>>>3,g=(w>>>17|w<<15)^(w>>>19|w<<13)^w>>>10;L[I]=(k+L[I-16]|0)+(g+L[I-7]|0)|0}let Y=X[0]|0,G=X[1]|0,J=X[2]|0,U=X[3]|0,W=X[4]|0,C=X[5]|0,P=X[6]|0,D=X[7]|0,F,K,O,M,z,B;M=(W>>>6|W<<26)^(W>>>11|W<<21)^(W>>>25|W<<7),z=P^W&(C^P),F=((D+M|0)+z|0)+(Q[0]+L[0]|0)|0,O=(Y>>>2|Y<<30)^(Y>>>13|Y<<19)^(Y>>>22|Y<<10),B=Y&G^J&(Y^G),K=O+B|0,U=U+F|0,D=F+K|0,M=(U>>>6|U<<26)^(U>>>11|U<<21)^(U>>>25|U<<7),z=C^U&(W^C),F=((P+M|0)+z|0)+(Q[1]+L[1]|0)|0,O=(D>>>2|D<<30)^(D>>>13|D<<19)^(D>>>22|D<<10),B=D&Y^G&(D^Y),K=O+B|0,J=J+F|0,P=F+K|0,M=(J>>>6|J<<26)^(J>>>11|J<<21)^(J>>>25|J<<7),z=W^J&(U^W),F=((C+M|0)+z|0)+(Q[2]+L[2]|0)|0,O=(P>>>2|P<<30)^(P>>>13|P<<19)^(P>>>22|P<<10),B=P&D^Y&(P^D),K=O+B|0,G=G+F|0,C=F+K|0,M=(G>>>6|G<<26)^(G>>>11|G<<21)^(G>>>25|G<<7),z=U^G&(J^U),F=((W+M|0)+z|0)+(Q[3]+L[3]|0)|0,O=(C>>>2|C<<30)^(C>>>13|C<<19)^(C>>>22|C<<10),B=C&P^D&(C^P),K=O+B|0,Y=Y+F|0,W=F+K|0,M=(Y>>>6|Y<<26)^(Y>>>11|Y<<21)^(Y>>>25|Y<<7),z=J^Y&(G^J),F=((U+M|0)+z|0)+(Q[4]+L[4]|0)|0,O=(W>>>2|W<<30)^(W>>>13|W<<19)^(W>>>22|W<<10),B=W&C^P&(W^C),K=O+B|0,D=D+F|0,U=F+K|0,M=(D>>>6|D<<26)^(D>>>11|D<<21)^(D>>>25|D<<7),z=G^D&(Y^G),F=((J+M|0)+z|0)+(Q[5]+L[5]|0)|0,O=(U>>>2|U<<30)^(U>>>13|U<<19)^(U>>>22|U<<10),B=U&W^C&(U^W),K=O+B|0,P=P+F|0,J=F+K|0,M=(P>>>6|P<<26)^(P>>>11|P<<21)^(P>>>25|P<<7),z=Y^P&(D^Y),F=((G+M|0)+z|0)+(Q[6]+L[6]|0)|0,O=(J>>>2|J<<30)^(J>>>13|J<<19)^(J>>>22|J<<10),B=J&U^W&(J^U),K=O+B|0,C=C+F|0,G=F+K|0,M=(C>>>6|C<<26)^(C>>>11|C<<21)^(C>>>25|C<<7),z=D^C&(P^D),F=((Y+M|0)+z|0)+(Q[7]+L[7]|0)|0,O=(G>>>2|G<<30)^(G>>>13|G<<19)^(G>>>22|G<<10),B=G&J^U&(G^J),K=O+B|0,W=W+F|0,Y=F+K|0,M=(W>>>6|W<<26)^(W>>>11|W<<21)^(W>>>25|W<<7),z=P^W&(C^P),F=((D+M|0)+z|0)+(Q[8]+L[8]|0)|0,O=(Y>>>2|Y<<30)^(Y>>>13|Y<<19)^(Y>>>22|Y<<10),B=Y&G^J&(Y^G),K=O+B|0,U=U+F|0,D=F+K|0,M=(U>>>6|U<<26)^(U>>>11|U<<21)^(U>>>25|U<<7),z=C^U&(W^C),F=((P+M|0)+z|0)+(Q[9]+L[9]|0)|0,O=(D>>>2|D<<30)^(D>>>13|D<<19)^(D>>>22|D<<10),B=D&Y^G&(D^Y),K=O+B|0,J=J+F|0,P=F+K|0,M=(J>>>6|J<<26)^(J>>>11|J<<21)^(J>>>25|J<<7),z=W^J&(U^W),F=((C+M|0)+z|0)+(Q[10]+L[10]|0)|0,O=(P>>>2|P<<30)^(P>>>13|P<<19)^(P>>>22|P<<10),B=P&D^Y&(P^D),K=O+B|0,G=G+F|0,C=F+K|0,M=(G>>>6|G<<26)^(G>>>11|G<<21)^(G>>>25|G<<7),z=U^G&(J^U),F=((W+M|0)+z|0)+(Q[11]+L[11]|0)|0,O=(C>>>2|C<<30)^(C>>>13|C<<19)^(C>>>22|C<<10),B=C&P^D&(C^P),K=O+B|0,Y=Y+F|0,W=F+K|0,M=(Y>>>6|Y<<26)^(Y>>>11|Y<<21)^(Y>>>25|Y<<7),z=J^Y&(G^J),F=((U+M|0)+z|0)+(Q[12]+L[12]|0)|0,O=(W>>>2|W<<30)^(W>>>13|W<<19)^(W>>>22|W<<10),B=W&C^P&(W^C),K=O+B|0,D=D+F|0,U=F+K|0,M=(D>>>6|D<<26)^(D>>>11|D<<21)^(D>>>25|D<<7),z=G^D&(Y^G),F=((J+M|0)+z|0)+(Q[13]+L[13]|0)|0,O=(U>>>2|U<<30)^(U>>>13|U<<19)^(U>>>22|U<<10),B=U&W^C&(U^W),K=O+B|0,P=P+F|0,J=F+K|0,M=(P>>>6|P<<26)^(P>>>11|P<<21)^(P>>>25|P<<7),z=Y^P&(D^Y),F=((G+M|0)+z|0)+(Q[14]+L[14]|0)|0,O=(J>>>2|J<<30)^(J>>>13|J<<19)^(J>>>22|J<<10),B=J&U^W&(J^U),K=O+B|0,C=C+F|0,G=F+K|0,M=(C>>>6|C<<26)^(C>>>11|C<<21)^(C>>>25|C<<7),z=D^C&(P^D),F=((Y+M|0)+z|0)+(Q[15]+L[15]|0)|0,O=(G>>>2|G<<30)^(G>>>13|G<<19)^(G>>>22|G<<10),B=G&J^U&(G^J),K=O+B|0,W=W+F|0,Y=F+K|0,M=(W>>>6|W<<26)^(W>>>11|W<<21)^(W>>>25|W<<7),z=P^W&(C^P),F=((D+M|0)+z|0)+(Q[16]+L[16]|0)|0,O=(Y>>>2|Y<<30)^(Y>>>13|Y<<19)^(Y>>>22|Y<<10),B=Y&G^J&(Y^G),K=O+B|0,U=U+F|0,D=F+K|0,M=(U>>>6|U<<26)^(U>>>11|U<<21)^(U>>>25|U<<7),z=C^U&(W^C),F=((P+M|0)+z|0)+(Q[17]+L[17]|0)|0,O=(D>>>2|D<<30)^(D>>>13|D<<19)^(D>>>22|D<<10),B=D&Y^G&(D^Y),K=O+B|0,J=J+F|0,P=F+K|0,M=(J>>>6|J<<26)^(J>>>11|J<<21)^(J>>>25|J<<7),z=W^J&(U^W),F=((C+M|0)+z|0)+(Q[18]+L[18]|0)|0,O=(P>>>2|P<<30)^(P>>>13|P<<19)^(P>>>22|P<<10),B=P&D^Y&(P^D),K=O+B|0,G=G+F|0,C=F+K|0,M=(G>>>6|G<<26)^(G>>>11|G<<21)^(G>>>25|G<<7),z=U^G&(J^U),F=((W+M|0)+z|0)+(Q[19]+L[19]|0)|0,O=(C>>>2|C<<30)^(C>>>13|C<<19)^(C>>>22|C<<10),B=C&P^D&(C^P),K=O+B|0,Y=Y+F|0,W=F+K|0,M=(Y>>>6|Y<<26)^(Y>>>11|Y<<21)^(Y>>>25|Y<<7),z=J^Y&(G^J),F=((U+M|0)+z|0)+(Q[20]+L[20]|0)|0,O=(W>>>2|W<<30)^(W>>>13|W<<19)^(W>>>22|W<<10),B=W&C^P&(W^C),K=O+B|0,D=D+F|0,U=F+K|0,M=(D>>>6|D<<26)^(D>>>11|D<<21)^(D>>>25|D<<7),z=G^D&(Y^G),F=((J+M|0)+z|0)+(Q[21]+L[21]|0)|0,O=(U>>>2|U<<30)^(U>>>13|U<<19)^(U>>>22|U<<10),B=U&W^C&(U^W),K=O+B|0,P=P+F|0,J=F+K|0,M=(P>>>6|P<<26)^(P>>>11|P<<21)^(P>>>25|P<<7),z=Y^P&(D^Y),F=((G+M|0)+z|0)+(Q[22]+L[22]|0)|0,O=(J>>>2|J<<30)^(J>>>13|J<<19)^(J>>>22|J<<10),B=J&U^W&(J^U),K=O+B|0,C=C+F|0,G=F+K|0,M=(C>>>6|C<<26)^(C>>>11|C<<21)^(C>>>25|C<<7),z=D^C&(P^D),F=((Y+M|0)+z|0)+(Q[23]+L[23]|0)|0,O=(G>>>2|G<<30)^(G>>>13|G<<19)^(G>>>22|G<<10),B=G&J^U&(G^J),K=O+B|0,W=W+F|0,Y=F+K|0,M=(W>>>6|W<<26)^(W>>>11|W<<21)^(W>>>25|W<<7),z=P^W&(C^P),F=((D+M|0)+z|0)+(Q[24]+L[24]|0)|0,O=(Y>>>2|Y<<30)^(Y>>>13|Y<<19)^(Y>>>22|Y<<10),B=Y&G^J&(Y^G),K=O+B|0,U=U+F|0,D=F+K|0,M=(U>>>6|U<<26)^(U>>>11|U<<21)^(U>>>25|U<<7),z=C^U&(W^C),F=((P+M|0)+z|0)+(Q[25]+L[25]|0)|0,O=(D>>>2|D<<30)^(D>>>13|D<<19)^(D>>>22|D<<10),B=D&Y^G&(D^Y),K=O+B|0,J=J+F|0,P=F+K|0,M=(J>>>6|J<<26)^(J>>>11|J<<21)^(J>>>25|J<<7),z=W^J&(U^W),F=((C+M|0)+z|0)+(Q[26]+L[26]|0)|0,O=(P>>>2|P<<30)^(P>>>13|P<<19)^(P>>>22|P<<10),B=P&D^Y&(P^D),K=O+B|0,G=G+F|0,C=F+K|0,M=(G>>>6|G<<26)^(G>>>11|G<<21)^(G>>>25|G<<7),z=U^G&(J^U),F=((W+M|0)+z|0)+(Q[27]+L[27]|0)|0,O=(C>>>2|C<<30)^(C>>>13|C<<19)^(C>>>22|C<<10),B=C&P^D&(C^P),K=O+B|0,Y=Y+F|0,W=F+K|0,M=(Y>>>6|Y<<26)^(Y>>>11|Y<<21)^(Y>>>25|Y<<7),z=J^Y&(G^J),F=((U+M|0)+z|0)+(Q[28]+L[28]|0)|0,O=(W>>>2|W<<30)^(W>>>13|W<<19)^(W>>>22|W<<10),B=W&C^P&(W^C),K=O+B|0,D=D+F|0,U=F+K|0,M=(D>>>6|D<<26)^(D>>>11|D<<21)^(D>>>25|D<<7),z=G^D&(Y^G),F=((J+M|0)+z|0)+(Q[29]+L[29]|0)|0,O=(U>>>2|U<<30)^(U>>>13|U<<19)^(U>>>22|U<<10),B=U&W^C&(U^W),K=O+B|0,P=P+F|0,J=F+K|0,M=(P>>>6|P<<26)^(P>>>11|P<<21)^(P>>>25|P<<7),z=Y^P&(D^Y),F=((G+M|0)+z|0)+(Q[30]+L[30]|0)|0,O=(J>>>2|J<<30)^(J>>>13|J<<19)^(J>>>22|J<<10),B=J&U^W&(J^U),K=O+B|0,C=C+F|0,G=F+K|0,M=(C>>>6|C<<26)^(C>>>11|C<<21)^(C>>>25|C<<7),z=D^C&(P^D),F=((Y+M|0)+z|0)+(Q[31]+L[31]|0)|0,O=(G>>>2|G<<30)^(G>>>13|G<<19)^(G>>>22|G<<10),B=G&J^U&(G^J),K=O+B|0,W=W+F|0,Y=F+K|0,M=(W>>>6|W<<26)^(W>>>11|W<<21)^(W>>>25|W<<7),z=P^W&(C^P),F=((D+M|0)+z|0)+(Q[32]+L[32]|0)|0,O=(Y>>>2|Y<<30)^(Y>>>13|Y<<19)^(Y>>>22|Y<<10),B=Y&G^J&(Y^G),K=O+B|0,U=U+F|0,D=F+K|0,M=(U>>>6|U<<26)^(U>>>11|U<<21)^(U>>>25|U<<7),z=C^U&(W^C),F=((P+M|0)+z|0)+(Q[33]+L[33]|0)|0,O=(D>>>2|D<<30)^(D>>>13|D<<19)^(D>>>22|D<<10),B=D&Y^G&(D^Y),K=O+B|0,J=J+F|0,P=F+K|0,M=(J>>>6|J<<26)^(J>>>11|J<<21)^(J>>>25|J<<7),z=W^J&(U^W),F=((C+M|0)+z|0)+(Q[34]+L[34]|0)|0,O=(P>>>2|P<<30)^(P>>>13|P<<19)^(P>>>22|P<<10),B=P&D^Y&(P^D),K=O+B|0,G=G+F|0,C=F+K|0,M=(G>>>6|G<<26)^(G>>>11|G<<21)^(G>>>25|G<<7),z=U^G&(J^U),F=((W+M|0)+z|0)+(Q[35]+L[35]|0)|0,O=(C>>>2|C<<30)^(C>>>13|C<<19)^(C>>>22|C<<10),B=C&P^D&(C^P),K=O+B|0,Y=Y+F|0,W=F+K|0,M=(Y>>>6|Y<<26)^(Y>>>11|Y<<21)^(Y>>>25|Y<<7),z=J^Y&(G^J),F=((U+M|0)+z|0)+(Q[36]+L[36]|0)|0,O=(W>>>2|W<<30)^(W>>>13|W<<19)^(W>>>22|W<<10),B=W&C^P&(W^C),K=O+B|0,D=D+F|0,U=F+K|0,M=(D>>>6|D<<26)^(D>>>11|D<<21)^(D>>>25|D<<7),z=G^D&(Y^G),F=((J+M|0)+z|0)+(Q[37]+L[37]|0)|0,O=(U>>>2|U<<30)^(U>>>13|U<<19)^(U>>>22|U<<10),B=U&W^C&(U^W),K=O+B|0,P=P+F|0,J=F+K|0,M=(P>>>6|P<<26)^(P>>>11|P<<21)^(P>>>25|P<<7),z=Y^P&(D^Y),F=((G+M|0)+z|0)+(Q[38]+L[38]|0)|0,O=(J>>>2|J<<30)^(J>>>13|J<<19)^(J>>>22|J<<10),B=J&U^W&(J^U),K=O+B|0,C=C+F|0,G=F+K|0,M=(C>>>6|C<<26)^(C>>>11|C<<21)^(C>>>25|C<<7),z=D^C&(P^D),F=((Y+M|0)+z|0)+(Q[39]+L[39]|0)|0,O=(G>>>2|G<<30)^(G>>>13|G<<19)^(G>>>22|G<<10),B=G&J^U&(G^J),K=O+B|0,W=W+F|0,Y=F+K|0,M=(W>>>6|W<<26)^(W>>>11|W<<21)^(W>>>25|W<<7),z=P^W&(C^P),F=((D+M|0)+z|0)+(Q[40]+L[40]|0)|0,O=(Y>>>2|Y<<30)^(Y>>>13|Y<<19)^(Y>>>22|Y<<10),B=Y&G^J&(Y^G),K=O+B|0,U=U+F|0,D=F+K|0,M=(U>>>6|U<<26)^(U>>>11|U<<21)^(U>>>25|U<<7),z=C^U&(W^C),F=((P+M|0)+z|0)+(Q[41]+L[41]|0)|0,O=(D>>>2|D<<30)^(D>>>13|D<<19)^(D>>>22|D<<10),B=D&Y^G&(D^Y),K=O+B|0,J=J+F|0,P=F+K|0,M=(J>>>6|J<<26)^(J>>>11|J<<21)^(J>>>25|J<<7),z=W^J&(U^W),F=((C+M|0)+z|0)+(Q[42]+L[42]|0)|0,O=(P>>>2|P<<30)^(P>>>13|P<<19)^(P>>>22|P<<10),B=P&D^Y&(P^D),K=O+B|0,G=G+F|0,C=F+K|0,M=(G>>>6|G<<26)^(G>>>11|G<<21)^(G>>>25|G<<7),z=U^G&(J^U),F=((W+M|0)+z|0)+(Q[43]+L[43]|0)|0,O=(C>>>2|C<<30)^(C>>>13|C<<19)^(C>>>22|C<<10),B=C&P^D&(C^P),K=O+B|0,Y=Y+F|0,W=F+K|0,M=(Y>>>6|Y<<26)^(Y>>>11|Y<<21)^(Y>>>25|Y<<7),z=J^Y&(G^J),F=((U+M|0)+z|0)+(Q[44]+L[44]|0)|0,O=(W>>>2|W<<30)^(W>>>13|W<<19)^(W>>>22|W<<10),B=W&C^P&(W^C),K=O+B|0,D=D+F|0,U=F+K|0,M=(D>>>6|D<<26)^(D>>>11|D<<21)^(D>>>25|D<<7),z=G^D&(Y^G),F=((J+M|0)+z|0)+(Q[45]+L[45]|0)|0,O=(U>>>2|U<<30)^(U>>>13|U<<19)^(U>>>22|U<<10),B=U&W^C&(U^W),K=O+B|0,P=P+F|0,J=F+K|0,M=(P>>>6|P<<26)^(P>>>11|P<<21)^(P>>>25|P<<7),z=Y^P&(D^Y),F=((G+M|0)+z|0)+(Q[46]+L[46]|0)|0,O=(J>>>2|J<<30)^(J>>>13|J<<19)^(J>>>22|J<<10),B=J&U^W&(J^U),K=O+B|0,C=C+F|0,G=F+K|0,M=(C>>>6|C<<26)^(C>>>11|C<<21)^(C>>>25|C<<7),z=D^C&(P^D),F=((Y+M|0)+z|0)+(Q[47]+L[47]|0)|0,O=(G>>>2|G<<30)^(G>>>13|G<<19)^(G>>>22|G<<10),B=G&J^U&(G^J),K=O+B|0,W=W+F|0,Y=F+K|0,M=(W>>>6|W<<26)^(W>>>11|W<<21)^(W>>>25|W<<7),z=P^W&(C^P),F=((D+M|0)+z|0)+(Q[48]+L[48]|0)|0,O=(Y>>>2|Y<<30)^(Y>>>13|Y<<19)^(Y>>>22|Y<<10),B=Y&G^J&(Y^G),K=O+B|0,U=U+F|0,D=F+K|0,M=(U>>>6|U<<26)^(U>>>11|U<<21)^(U>>>25|U<<7),z=C^U&(W^C),F=((P+M|0)+z|0)+(Q[49]+L[49]|0)|0,O=(D>>>2|D<<30)^(D>>>13|D<<19)^(D>>>22|D<<10),B=D&Y^G&(D^Y),K=O+B|0,J=J+F|0,P=F+K|0,M=(J>>>6|J<<26)^(J>>>11|J<<21)^(J>>>25|J<<7),z=W^J&(U^W),F=((C+M|0)+z|0)+(Q[50]+L[50]|0)|0,O=(P>>>2|P<<30)^(P>>>13|P<<19)^(P>>>22|P<<10),B=P&D^Y&(P^D),K=O+B|0,G=G+F|0,C=F+K|0,M=(G>>>6|G<<26)^(G>>>11|G<<21)^(G>>>25|G<<7),z=U^G&(J^U),F=((W+M|0)+z|0)+(Q[51]+L[51]|0)|0,O=(C>>>2|C<<30)^(C>>>13|C<<19)^(C>>>22|C<<10),B=C&P^D&(C^P),K=O+B|0,Y=Y+F|0,W=F+K|0,M=(Y>>>6|Y<<26)^(Y>>>11|Y<<21)^(Y>>>25|Y<<7),z=J^Y&(G^J),F=((U+M|0)+z|0)+(Q[52]+L[52]|0)|0,O=(W>>>2|W<<30)^(W>>>13|W<<19)^(W>>>22|W<<10),B=W&C^P&(W^C),K=O+B|0,D=D+F|0,U=F+K|0,M=(D>>>6|D<<26)^(D>>>11|D<<21)^(D>>>25|D<<7),z=G^D&(Y^G),F=((J+M|0)+z|0)+(Q[53]+L[53]|0)|0,O=(U>>>2|U<<30)^(U>>>13|U<<19)^(U>>>22|U<<10),B=U&W^C&(U^W),K=O+B|0,P=P+F|0,J=F+K|0,M=(P>>>6|P<<26)^(P>>>11|P<<21)^(P>>>25|P<<7),z=Y^P&(D^Y),F=((G+M|0)+z|0)+(Q[54]+L[54]|0)|0,O=(J>>>2|J<<30)^(J>>>13|J<<19)^(J>>>22|J<<10),B=J&U^W&(J^U),K=O+B|0,C=C+F|0,G=F+K|0,M=(C>>>6|C<<26)^(C>>>11|C<<21)^(C>>>25|C<<7),z=D^C&(P^D),F=((Y+M|0)+z|0)+(Q[55]+L[55]|0)|0,O=(G>>>2|G<<30)^(G>>>13|G<<19)^(G>>>22|G<<10),B=G&J^U&(G^J),K=O+B|0,W=W+F|0,Y=F+K|0,M=(W>>>6|W<<26)^(W>>>11|W<<21)^(W>>>25|W<<7),z=P^W&(C^P),F=((D+M|0)+z|0)+(Q[56]+L[56]|0)|0,O=(Y>>>2|Y<<30)^(Y>>>13|Y<<19)^(Y>>>22|Y<<10),B=Y&G^J&(Y^G),K=O+B|0,U=U+F|0,D=F+K|0,M=(U>>>6|U<<26)^(U>>>11|U<<21)^(U>>>25|U<<7),z=C^U&(W^C),F=((P+M|0)+z|0)+(Q[57]+L[57]|0)|0,O=(D>>>2|D<<30)^(D>>>13|D<<19)^(D>>>22|D<<10),B=D&Y^G&(D^Y),K=O+B|0,J=J+F|0,P=F+K|0,M=(J>>>6|J<<26)^(J>>>11|J<<21)^(J>>>25|J<<7),z=W^J&(U^W),F=((C+M|0)+z|0)+(Q[58]+L[58]|0)|0,O=(P>>>2|P<<30)^(P>>>13|P<<19)^(P>>>22|P<<10),B=P&D^Y&(P^D),K=O+B|0,G=G+F|0,C=F+K|0,M=(G>>>6|G<<26)^(G>>>11|G<<21)^(G>>>25|G<<7),z=U^G&(J^U),F=((W+M|0)+z|0)+(Q[59]+L[59]|0)|0,O=(C>>>2|C<<30)^(C>>>13|C<<19)^(C>>>22|C<<10),B=C&P^D&(C^P),K=O+B|0,Y=Y+F|0,W=F+K|0,M=(Y>>>6|Y<<26)^(Y>>>11|Y<<21)^(Y>>>25|Y<<7),z=J^Y&(G^J),F=((U+M|0)+z|0)+(Q[60]+L[60]|0)|0,O=(W>>>2|W<<30)^(W>>>13|W<<19)^(W>>>22|W<<10),B=W&C^P&(W^C),K=O+B|0,D=D+F|0,U=F+K|0,M=(D>>>6|D<<26)^(D>>>11|D<<21)^(D>>>25|D<<7),z=G^D&(Y^G),F=((J+M|0)+z|0)+(Q[61]+L[61]|0)|0,O=(U>>>2|U<<30)^(U>>>13|U<<19)^(U>>>22|U<<10),B=U&W^C&(U^W),K=O+B|0,P=P+F|0,J=F+K|0,M=(P>>>6|P<<26)^(P>>>11|P<<21)^(P>>>25|P<<7),z=Y^P&(D^Y),F=((G+M|0)+z|0)+(Q[62]+L[62]|0)|0,O=(J>>>2|J<<30)^(J>>>13|J<<19)^(J>>>22|J<<10),B=J&U^W&(J^U),K=O+B|0,C=C+F|0,G=F+K|0,M=(C>>>6|C<<26)^(C>>>11|C<<21)^(C>>>25|C<<7),z=D^C&(P^D),F=((Y+M|0)+z|0)+(Q[63]+L[63]|0)|0,O=(G>>>2|G<<30)^(G>>>13|G<<19)^(G>>>22|G<<10),B=G&J^U&(G^J),K=O+B|0,W=W+F|0,Y=F+K|0,X[0]=X[0]+Y|0,X[1]=X[1]+G|0,X[2]=X[2]+J|0,X[3]=X[3]+U|0,X[4]=X[4]+W|0,X[5]=X[5]+C|0,X[6]=X[6]+P|0,X[7]=X[7]+D|0}function $(X,H){let Q={};return Q.fn=function(L){if(L)this._h=L._h.slice(0),this._buffer=L._buffer.slice(0),this._length=L._length;else this.reset()},Q.hash=function(L){return new Q.fn().update(L).finalize()},Q.fn.prototype={blockSize:512,_init:X,_key:N,reset(){return this._h=this._init.slice(0),this._buffer=[],this._length=0,this},update(L){if(L instanceof Uint8Array&&this._buffer.length===0&&L.length>=64){let C=L.length-(L.length&63);if(this._length+C*8>9007199254740991)return console.warn("[crypto] INVALID: sha256: cannot hash more than 2^53 - 1 bits"),!1;let P=j;for(let D=0;D<C;D+=64){for(let F=0,K=D;F<16;F++,K+=4)P[F]=L[K]<<24|L[K+1]<<16|L[K+2]<<8|L[K+3];q(this._h,P)}if(this._length+=C*8,C===L.length)return this;L=L.subarray(C)}if(typeof L==="string")L=E.ui8_to_ba(S.toBytes(L));else if(L instanceof Uint8Array)L=E.ui8_to_ba(L);let Y=this._buffer=E.concat(this._buffer,L),G=this._length,J=this._length=G+E.bitLength(L);if(J>9007199254740991)return console.warn("[crypto] INVALID: sha256: cannot hash more than 2^53 - 1 bits"),!1;let U=new Int32Array(Y),W=0;for(let C=512+G-(512+G&511);C<=J;C+=512)this._block(U.subarray(16*W,16*(W+1))),W+=1;return Y.splice(0,16*W),this},finalize(){let L=this._buffer,Y=this._h;L=E.concat(L,[E.partial(1,1)]);for(let G=L.length+2;G&15;G++)L.push(0);L.push(Math.floor(this._length/4294967296)),L.push(this._length|0);while(L.length)this._block(L.splice(0,16));return this.reset(),H<8?Y.slice(0,H):Y},_block(L){q(this._h,L)}},Q}let V=$(T,8);return Object.defineProperty({fn:V.fn,hash:V.hash},Symbol.for("@awacloud/fw/internal"),{value:{makeSha:$,compress:q}})}};var _Z={name:"random",version:"1.0.0",type:"fw.crypto.utils",dependencies:["bitArray","aes","sha256"],deps:[s$,fZ,yZ],factory(E,S,T){let R=typeof crypto<"u"&&!!crypto.getRandomValues;function j(k){let g=k.length>>>2,x=Array(g);for(let f=0;f<g;f++){let y=f<<2;x[f]=k[y]<<24|k[y+1]<<16|k[y+2]<<8|k[y+3]|0}return x}function Z(k,g,x,f){for(let y=0;y<g;y++){let _=f+(y<<2);x[_]=k[y]>>>24&255,x[_+1]=k[y]>>>16&255,x[_+2]=k[y]>>>8&255,x[_+3]=k[y]&255}}let q=4,$=512,V=13,X={prev:-1,run:0},H={anchor:-1,count:0,idx:0},Q=!1;function L(k){if(Q)return!1;for(let g=0;g<k.length;g++){let x=k[g];if(x===X.prev){if(X.run++,X.run>=q)return Q=!0,console.error("[crypto] CORRUPT: random: RCT health-test failed on entropy source"),!1}else X.prev=x,X.run=1;if(H.anchor===-1)H.anchor=x,H.count=1,H.idx=1;else{if(H.idx++,x===H.anchor){if(H.count++,H.count>V)return Q=!0,console.error("[crypto] CORRUPT: random: APT health-test failed on entropy source"),!1}if(H.idx>=$)H.anchor=-1}}return!0}function Y(){X.prev=-1,X.run=0,H.anchor=-1,H.count=0,H.idx=0,Q=!1}function G(k){if(!R)return console.error("[crypto] NOT READY: crypto.getRandomValues unavailable"),!1;let g=0;while(g<k.length){let x=Math.min(65536,k.length-g);crypto.getRandomValues(k.subarray(g,g+x)),g+=x}return k}function J(k){if(Q)return console.error("[crypto] CORRUPT: random: entropy source previously failed health test"),!1;let g=G(new Uint8Array(k));if(g===!1)return!1;if(!L(g))return!1;return g}let U=4,W=16,C=65536,P=4294967296;function D(k){k=k||{};let g=k.aesKeyBits||256,x=!!k.df;if(g!==128&&g!==192&&g!==256)return console.error("[crypto] BUG: ctr_drbg: aesKeyBits must be 128, 192 or 256"),!1;let f=g/8,y=f/4,_=f+W,v=_/4,b=Array(y).fill(0),h=Array(U).fill(0),d=null,n=0,m=!1;function c(p,i){let a=S.fn(j(p),!1);if(a===!1)return!1;let Z$=new Uint8Array(W);for(let J$=0;J$<i.length;J$+=W){for(let Y$=0;Y$<W;Y$++)Z$[Y$]^=i[J$+Y$];let s=a.encrypt(j(Z$));Z(s,U,Z$,0)}return Z$}function o(p,i){let a=p.length,Z$=i,J$=8,s=8+a+1,Y$=(W-s%W)%W,X$=s+Y$,U$=new Uint8Array(X$);U$[0]=a>>>24&255,U$[1]=a>>>16&255,U$[2]=a>>>8&255,U$[3]=a&255,U$[4]=Z$>>>24&255,U$[5]=Z$>>>16&255,U$[6]=Z$>>>8&255,U$[7]=Z$&255;for(let H$=0;H$<a;H$++)U$[8+H$]=p[H$];U$[8+a]=128;let z$=new Uint8Array(f);for(let H$=0;H$<f;H$++)z$[H$]=H$;let V$=f+W,q$=new Uint8Array(Math.ceil(V$/W)*W),K$=0,O$=0;while(K$<V$){let H$=new Uint8Array(W+X$);H$[0]=O$>>>24&255,H$[1]=O$>>>16&255,H$[2]=O$>>>8&255,H$[3]=O$&255,H$.set(U$,W);let P$=c(z$,H$);if(P$===!1)return!1;q$.set(P$,K$),K$+=W,O$++}let M$=q$.subarray(0,f),S$=q$.slice(f,f+W),_$=S.fn(j(M$),!1);if(_$===!1)return!1;let N$=new Uint8Array(i),A$=0;while(A$<i){let H$=_$.encrypt(j(S$));Z(H$,U,S$,0);let P$=Math.min(W,i-A$);N$.set(S$.subarray(0,P$),A$),A$+=P$}return N$}function $$(){if(d=S.fn(b,!1),d===!1)return console.error("[crypto] BUG: ctr_drbg: AES key schedule failed"),!1;return!0}function e(){for(let p=U-1;p>=0;p--)if(h[p]=h[p]+1|0,h[p]!==0)break}function t(p){let i=Array(v).fill(0),a=0;while(a<v){e();let Z$=d.encrypt(h);for(let J$=0;J$<U&&a<v;J$++)i[a++]=Z$[J$]}for(let Z$=0;Z$<v;Z$++)i[Z$]^=p[Z$];return b=i.slice(0,y),h=i.slice(y,y+U),$$()}function G$(p,i,a){if(x){let J$=p?p.length:0,s=a?a.length:0,Y$=i?i.length:0,X$=new Uint8Array(J$+s+Y$);if(J$)X$.set(p,0);if(s)X$.set(a,J$);if(Y$)X$.set(i,J$+s);return o(X$,_)}if(!p||p.length!==_)return console.error("[crypto] BUG: ctr_drbg (no-df): entropy must be exactly "+_+" bytes"),!1;let Z$=new Uint8Array(_);if(Z$.set(p),i&&i.length>0){let J$=Math.min(i.length,_);for(let s=0;s<J$;s++)Z$[s]^=i[s]}return Z$}function Q$(p,i,a){let Z$=G$(p,i,a);if(Z$===!1)return!1;if(b.fill(0),h.fill(0),!$$())return!1;if(!t(j(Z$)))return!1;return n=1,m=!0,!0}function u(p,i){if(!m)return console.warn("[crypto] NOT READY: ctr_drbg.reseed: not instantiated"),!1;let a=G$(p,i,null);if(a===!1)return!1;if(!t(j(a)))return!1;return n=1,!0}function r(p,i){if(!m)return console.warn("[crypto] NOT READY: ctr_drbg.generate: not instantiated"),!1;if(!Number.isInteger(p)||p<0||p>C)return console.warn("[crypto] INVALID: ctr_drbg.generate: n must be an integer in [0, "+C+"]"),!1;if(p===0)return new Uint8Array(0);if(n>P){let s=J(_);if(s===!1)return!1;if(!u(s,i))return!1;i=null}let a;if(i&&i.length>0){let s;if(x){if(s=o(i,_),s===!1)return!1}else s=new Uint8Array(_),s.set(i.subarray(0,Math.min(_,i.length)));if(a=j(s),!t(a))return!1}else a=Array(v).fill(0);let Z$=new Uint8Array(p),J$=0;while(J$<p){e();let s=d.encrypt(h),Y$=p-J$;if(Y$>=16)Z(s,U,Z$,J$),J$+=16;else{let X$=new Uint8Array(16);Z(s,U,X$,0),Z$.set(X$.subarray(0,Y$),J$),J$=p}}if(!t(a))return!1;return n++,Z$}function l(){b.fill(0),h.fill(0),d=null,n=0,m=!1}return{instantiate:Q$,reseed:u,generate:r,uninstantiate:l,get isLive(){return m},get reseedCounter(){return n},get securityStrength(){return g},get aesKeyBits(){return g},get useDf(){return x},get seedBytes(){return _}}}let F=z("e4bc23c5089a19d86f4119cb3fa08c0a4991e0a1def17e101e4c14d9c323460a7c2fb58e0b086c6c57b55f56cae25bad"),K=z("fd85a836bba85019881e8c6bad23c9061adc75477659acaea8e4a01dfe07a1832dad1c136f59d70f8653a5dc118663d6"),O="b2cb8905c05e5950ca31895096be29ea3d5a3b82b269495554eb80fe07de43e193b9e7c3ece73b80e062b1c1f68202fbb1c52a040ea2478864295282234aaada",M=null;function z(k){let g=new Uint8Array(k.length>>>1);for(let x=0;x<g.length;x++)g[x]=parseInt(k.substring(x*2,x*2+2),16);return g}function B(k){let g="";for(let x=0;x<k.length;x++){let f=k[x];g+=(f<16?"0":"")+f.toString(16)}return g}function I(){let k=D();if(!k||k===!1)return!1;if(!k.instantiate(F))return!1;if(!k.reseed(K))return!1;if(k.generate(64)===!1)return!1;let g=k.generate(64);if(g===!1)return!1;let x=B(g);if(x!==O)return console.error("[crypto] CORRUPT: random.selfTest: CTR_DRBG KAT mismatch (got "+x+")"),!1;return!0}function A(){if(M===null)M=I();return M}let w=Object.defineProperty({fill(k){return G(k)},float(){let k=G(new Uint8Array(4));if(k===!1)return!1;return((k[0]<<24|k[1]<<16|k[2]<<8|k[3])>>>0)/4294967296},int(k,g){if(k>g)throw RangeError("min must be ≤ max");let x=g-k+1,f=Math.floor(4294967296/x)*x,y=new Uint8Array(4),_;do{if(G(y)===!1)return!1;_=(y[0]<<24|y[1]<<16|y[2]<<8|y[3])>>>0}while(_>=f);return k+_%x},bytes(k){if(!Number.isInteger(k)||k<0)return console.warn("[crypto] INVALID: random.bytes expects a non-negative integer"),!1;return G(new Uint8Array(k))},words(k){if(!Number.isInteger(k)||k<0)return console.warn("[crypto] INVALID: random.words expects a non-negative integer"),!1;let g=G(new Uint8Array(k*4));if(g===!1)return!1;let x=Array(k);for(let f=0;f<k;f++){let y=f*4;x[f]=g[y]<<24|g[y+1]<<16|g[y+2]<<8|g[y+3]|0}return x},bits(k){if(!Number.isInteger(k)||k<0)return console.warn("[crypto] INVALID: random.bits expects a non-negative integer"),!1;let g=Math.ceil(k/32),x=w.words(g);if(x===!1)return!1;return E.clamp(x,k)},isReady(){return R},selfTest(){return M=I(),M},health:{feed(k){return L(k instanceof Uint8Array?k:new Uint8Array(k))},reset(){Y()},get isDead(){return Q}},drbg(k={}){if(!A())return console.error("[crypto] CORRUPT: random.drbg refused - POST failed"),!1;let g=D(k);if(g===!1)return!1;let x=J(g.seedBytes);if(x===!1)return!1;if(!g.instantiate(x,k.personalisation))return!1;let f=null;return{generate(y,_){let v=_||null;if(f!==null)v=v===null?f:(()=>{let b=new Uint8Array(f.length+v.length);return b.set(f),b.set(v,f.length),b})(),f=null;return g.generate(y,v)},reseed(y){let _=J(g.seedBytes);if(_===!1)return!1;let v=y||null;if(f!==null)v=v===null?f:(()=>{let b=new Uint8Array(f.length+v.length);return b.set(f),b.set(v,f.length),b})(),f=null;return g.reseed(_,v)},addAdditionalInput(y){if(!(y instanceof Uint8Array))if(Array.isArray(y)||y instanceof Uint32Array){let v=new Uint8Array(y.length*4);for(let b=0;b<y.length;b++){let h=y[b]|0;v[b*4]=h>>>24&255,v[b*4+1]=h>>>16&255,v[b*4+2]=h>>>8&255,v[b*4+3]=h&255}y=v}else if(typeof y==="number"){let v=y|0;y=new Uint8Array([v>>>24&255,v>>>16&255,v>>>8&255,v&255])}else return console.warn("[crypto] BUG: drbg.addAdditionalInput: unsupported data type"),!1;let _=f===null?y:(()=>{let v=new Uint8Array(f.length+y.length);return v.set(f),v.set(y,f.length),v})();if(_.length<=g.seedBytes)f=_;else{let v=T.hash(j(_.subarray(0,_.length&-4))),b=new Uint8Array(32);Z(v,8,b,0),f=b}return!0},uninstantiate(){f=null,g.uninstantiate()},get isLive(){return g.isLive},get reseedCounter(){return g.reseedCounter},get securityStrength(){return g.securityStrength}}}},Symbol.for("@awacloud/fw/internal"),{value:{makeDrbg:D}});return w}};var vZ={name:"mime",version:"1.0.0",type:"fw.io.codec",dependencies:["utf8","random"],deps:[R$,_Z],factory(E,S){function T(Y,G,J){let U=G.length,W=Y.length;if(U===0)return J;let C=W-U;$:for(let P=J;P<=C;P++){for(let D=0;D<U;D++)if(Y[P+D]!==G[D])continue $;return P}return-1}function N(Y){let G=0;for(let W=0;W<Y.length;W++)G+=Y[W].length;let J=new Uint8Array(G),U=0;for(let W=0;W<Y.length;W++)J.set(Y[W],U),U+=Y[W].length;return J}function R(Y){let G=/^([^']*)'[^']*'(.*)$/.exec(Y);if(!G)return Y;let J=G[1].toLowerCase(),U=G[2];try{if(J==="utf-8"||J==="")return decodeURIComponent(U);return U.replace(/%([0-9a-fA-F]{2})/g,(W,C)=>String.fromCharCode(parseInt(C,16)))}catch{return U}}function j(Y){if(typeof Y!=="string")return{value:"",params:{}};let G={},J={},U=0,W=Y.length,C=(K)=>{let O="";while(U<W&&K.indexOf(Y[U])<0)O+=Y[U],U++;return O},P=()=>{while(U<W&&(Y[U]===" "||Y[U]==="\t"))U++},D=()=>{U++;let K="";while(U<W){let O=Y[U];if(O==="\\"&&U+1<W){K+=Y[U+1],U+=2;continue}if(O==='"')return U++,K;K+=O,U++}return K};P();let F=C(";").trim();while(U<W){if(Y[U]!==";"){U++;continue}U++,P();let K=C("=;").trim().toLowerCase();if(!K)continue;let O;if(Y[U]==="=")if(U++,P(),Y[U]==='"')O=D();else O=C(";").trim();else O="";if(K.endsWith("*"))J[K.slice(0,-1)]=R(O);else if(!(K in G))G[K]=O}for(let K of Object.keys(J))G[K]=J[K];return{value:F,params:G}}let Z=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function q(Y,G){if(Y&&typeof Y==="object")G=Y.params,Y=Y.value;let J=String(Y||"");if(G)for(let U of Object.keys(G)){let W=G[U];if(W===void 0||W===null)continue;let C=String(W);J+="; "+U+"="+(Z.test(C)?C:'"'+C.replace(/\\/g,"\\\\").replace(/"/g,"\\\"")+'"')}return J}function $(Y){let G={};if(!Y)return G;let J=Y.replace(/\r\n/g,`
42
45
  `).replace(/\r/g,`
43
46
  `).split(`
44
- `),z=null;for(let O=0;O<K.length;O++){let C=K[O];if(C==="")continue;if((C[0]===" "||C[0]==="\t")&&z){W[z]+=" "+C.trim();continue}let q=C.indexOf(":");if(q<0)continue;let P=C.slice(0,q).trim().toLowerCase(),$=C.slice(q+1).trim();if(P in W)W[P]+=", "+$;else W[P]=$;z=P}return W}function H(L){if(!L)return"";let W="";for(let K of Object.keys(L)){let z=K.replace(/(^|-)([a-z])/g,(O,C,q)=>C+q.toUpperCase());W+=z+": "+L[K]+`\r
45
- `}return W}let Q=new Uint8Array([13,10]);function G(L,W){if(!(L instanceof Uint8Array))throw Error("mime: decode expects Uint8Array");if(!W)throw Error("mime: boundary required");let K=T.toBytes("--"+W),z=N(L,K,0);if(z<0)throw Error("mime: boundary not found");let O=M([Q,K]),C=[],q=z+K.length;while(q<L.length){if(L[q]===45&&L[q+1]===45)break;if(L[q]===13&&L[q+1]===10)q+=2;else if(L[q]===10)q+=1;let P=N(L,O,q);if(P<0)throw Error("mime: unterminated part");let $=L.subarray(q,P),X=-1;for(let A=0;A<$.length-3;A++)if($[A]===13&&$[A+1]===10&&$[A+2]===13&&$[A+3]===10){X=A;break}let V,B;if(X>=0)V=T.fromBytes($.subarray(0,X)),B=$.subarray(X+4);else V="",B=$;C.push({headers:Z(V),body:B}),q=P+O.length}return C}function Y(){let L=j.bytes(8);if(L===!1||!L)throw Error("mime: CSPRNG entropy unavailable for boundary generation");let W="";for(let K=0;K<L.length;K++){let z=L[K];W+=(z<16?"0":"")+z.toString(16)}return"----FwBoundary"+W}function F(L,W){W=W||{};let K=W.boundary||Y(),z=W.type||"multipart/form-data",O=[],C=T.toBytes("--"+K+`\r
46
- `),q=T.toBytes(`\r
47
- --`+K+`--\r
48
- `),P=T.toBytes(`\r
49
- --`+K+`\r
50
- `);for(let $=0;$<L.length;$++){let X=L[$];O.push($===0?C:P),O.push(T.toBytes(H(X.headers||{})+`\r
51
- `));let V=X.body;if(typeof V==="string")O.push(T.toBytes(V));else if(V instanceof Uint8Array)O.push(V);else if(V==null);else throw Error("mime: part body must be string or Uint8Array")}if(L.length===0)O.push(T.toBytes("--"+K+`--\r
52
- `));else O.push(q);return{body:M(O),boundary:K,contentType:z+"; boundary="+K}}return{parseHeader:R,formatHeader:U,parseHeaders:Z,formatHeaders:H,encode:F,decode:G,randomBoundary:Y}}};var IZ={name:"keybindings",version:"1.0.0",type:"fw.dom.utils",dependencies:["events","eventBus"],deps:[V$,w$],factory(T,j){let N=new Set(["Escape","Tab","Enter","Space","Backspace","Delete","Insert","Home","End","PageUp","PageDown","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"]),M={esc:"Escape",escape:"Escape",return:"Enter",enter:"Enter",tab:"Tab",space:"Space",backspace:"Backspace",del:"Delete",delete:"Delete",insert:"Insert",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",arrowup:"ArrowUp",arrowdown:"ArrowDown",arrowleft:"ArrowLeft",arrowright:"ArrowRight"},D=new Set(["ctrl","shift","alt","meta","cmd","super"]);function R(Q){let G=Q.split("+"),Y={ctrl:!1,shift:!1,alt:!1,meta:!1},F=null;for(let L of G){let W=L.toLowerCase();if(D.has(W))if(W==="cmd"||W==="super")Y.meta=!0;else Y[W]=!0;else if(L.length===0)throw Error('keybindings: invalid combo segment "'+Q+'"');else{if(F!==null)throw Error('keybindings: multiple non-modifier keys in segment "'+Q+'"');let K=M[W];if(K)F=K;else if(N.has(L))F=L;else if(/^[a-zA-Z0-9]$/.test(L))F=L.toLowerCase();else throw Error('keybindings: unknown key "'+L+'" in segment "'+Q+'"')}}if(F===null)throw Error('keybindings: no key specified in segment "'+Q+'"');return{modifiers:Y,key:F}}function J(Q){if(typeof Q!=="string"||Q.trim().length===0)throw TypeError("keybindings: combo must be a non-empty string");let G=Q.trim().split(" ").filter((Y)=>Y.length>0);if(G.length===1)return R(G[0]);return G.map((Y)=>R(Y))}function U(Q){let G=Q.key;if(N.has(G))return G;let Y=M[G.toLowerCase()];if(Y)return Y;let F=Q.code;if(F&&/^Key[A-Z]$/.test(F))return F.slice(3).toLowerCase();if(F&&/^Digit[0-9]$/.test(F))return F.slice(5);if(G.length===1)return G.toLowerCase();return null}function Z(Q,G){let{modifiers:Y,key:F}=G,L=typeof Q.getModifierState==="function"&&Q.getModifierState("AltGraph"),W=Q.ctrlKey||L,K=Q.altKey||L;if(W!==Y.ctrl)return!1;if(Q.shiftKey!==Y.shift)return!1;if(K!==Y.alt)return!1;if(Q.metaKey!==Y.meta)return!1;return U(Q)===F}function H(Q={}){let G=Q.target||document,Y=typeof Q.chordTimeout==="number"?Q.chordTimeout:1500,F=j.create(),L=[],W=[],K=null,z=!1;function O(w,f,x={}){if(typeof w!=="string")throw TypeError("keybindings.bind: combo must be a string");if(typeof f!=="function")throw TypeError("keybindings.bind: fn must be a function");let u=J(w),v=x.context||null,d=typeof x.priority==="number"?x.priority:0,o=x.preventDefault!==!1,_=x.repeat===!0,y={combo:w,parsed:u,context:v,priority:d,preventDefault:o,repeat:_,fn:f};return L.push(y),function(){let l=L.indexOf(y);if(l!==-1)L.splice(l,1)}}function C(w,f){for(let x=L.length-1;x>=0;x--)if(L[x].combo===w){if(!f||L[x].fn===f)L.splice(x,1)}}function q(w){W.push(w)}function P(){if(W.length===0)throw RangeError("keybindings: context stack underflow");return W.pop()}function $(){return[...W]}function X(){return L.map((w)=>({combo:w.combo,context:w.context,priority:w.priority,fn:w.fn}))}function V(w){return L.filter((f)=>{let x=f.parsed;if(Array.isArray(x))return Z(w,x[0]);return Z(w,x)}).map((f)=>({combo:f.combo,context:f.context,priority:f.priority,fn:f.fn}))}function B(w){let f=W.length>0?W[W.length-1]:null;if(f===null)return w.filter((x)=>x.context===null);return w.filter((x)=>x.context===f)}function A(w,f){if(w.length===0)return;let x=w.reduce((v,d)=>Math.max(v,d.priority),-1/0),u=w.filter((v)=>v.priority===x);for(let v of u){if(v.preventDefault)f.preventDefault();try{v.fn(f)}catch(d){console.error("keybindings handler error:",d)}F.emit("keybindings:matched",{combo:v.combo,context:v.context,fn:v.fn})}}function S(w){if(K){let{parsed:d,matched:o,timer:_,binding:y}=K;clearTimeout(_),K=null;let c=o+1;if(Z(w,d[c])){if(c===d.length-1){let l=y;if(l.repeat||!w.repeat){if(l.preventDefault)w.preventDefault();try{l.fn(w)}catch(h){console.error("keybindings chord handler error:",h)}F.emit("keybindings:matched",{combo:l.combo,context:l.context,fn:l.fn})}}else K={parsed:d,matched:c,binding:y,timer:setTimeout(()=>{K=null},Y)};return}}let f=L.filter((d)=>{if(!Array.isArray(d.parsed))return!1;if(!Z(w,d.parsed[0]))return!1;let o=W.length>0?W[W.length-1]:null;if(o===null)return d.context===null;return d.context===o});if(f.length>0){let d=f.reduce((o,_)=>_.priority>o.priority?_:o,f[0]);K={parsed:d.parsed,matched:0,binding:d,timer:setTimeout(()=>{K=null},Y)};return}let x=L.filter((d)=>{if(Array.isArray(d.parsed))return!1;return Z(w,d.parsed)}),v=B(x).filter((d)=>d.repeat||!w.repeat);A(v,w)}function E(){if(z)return;z=!0,G.addEventListener("keydown",S)}function I(){if(!z)return;if(z=!1,G.removeEventListener("keydown",S),K)clearTimeout(K.timer),K=null}function g(){I(),L.length=0,W.length=0}function k(){let w=new Set;function f(...u){let v=O(...u);return w.add(v),v}function x(){for(let u of w)try{u()}catch{}w.clear()}return{bind:f,unbind:C,pushContext:q,popContext:P,dispose:x,clear:x}}return{bind:O,unbind:C,pushContext:q,popContext:P,currentContext:$,list:X,match:V,attach:E,detach:I,dispose:g,scope:k}}return{create:H,parse:J}}};var EZ={name:"gesture",version:"1.0.0",type:"fw.dom.query",dependencies:["events"],deps:[V$],factory(T){let j=0;function N(M,D={}){let R=D.tapMaxMs??250,J=D.doubletapMaxMs??300,U=D.longpressMs??500,Z=D.swipeMinPx??10,H=D.swipeMaxMs??300,Q=Object.create(null);function G(_,y){let c=Q[_];if(!c)return;for(let l of c)l(y)}let Y=new Map,F=0,L=0,W=0,K=null,z=!1,O=0,C=0,q=0,P=0,$=0,X=0,V=0,B=0,A=!1;function S(_,y,c,l){let h=c-_,m=l-y;return Math.sqrt(h*h+m*m)}function E(_,y,c,l){return Math.atan2(l-y,c-_)*180/Math.PI}function I(){if(K!==null)clearTimeout(K),K=null}function g(_){Y.set(_.pointerId,{startX:_.clientX,startY:_.clientY,x:_.clientX,y:_.clientY,t:Date.now()});try{M.setPointerCapture(_.pointerId)}catch(c){}let y=Y.size;if(y===1){O=_.clientX,C=_.clientY,q=_.clientX,P=_.clientY,$=0,X=0,z=!0,G("pan",{phase:"start",dx:0,dy:0,totalDx:0,totalDy:0,target:_.target}),I();let{clientX:c,clientY:l,target:h}=_,m=Date.now();K=setTimeout(()=>{K=null;let b=Date.now()-m;G("longpress",{x:c,y:l,target:h,durationMs:b})},U)}if(y===2){I(),z=!1;let c=[...Y.values()];V=S(c[0].x,c[0].y,c[1].x,c[1].y),B=E(c[0].x,c[0].y,c[1].x,c[1].y),A=!0;let l=(c[0].x+c[1].x)/2,h=(c[0].y+c[1].y)/2;G("pinch",{phase:"start",scale:1,center:{x:l,y:h},rotation:0})}}function k(_){if(!Y.has(_.pointerId))return;let y=Y.get(_.pointerId);Y.set(_.pointerId,{startX:y.startX,startY:y.startY,x:_.clientX,y:_.clientY,t:y.t});let c=Y.size;if(c===1&&z){let l=_.clientX-q,h=_.clientY-P;if($+=l,X+=h,q=_.clientX,P=_.clientY,S(O,C,_.clientX,_.clientY)>Z)I();G("pan",{phase:"move",dx:l,dy:h,totalDx:$,totalDy:X,target:_.target})}if(c===2&&A){let l=[...Y.values()],h=S(l[0].x,l[0].y,l[1].x,l[1].y),m=E(l[0].x,l[0].y,l[1].x,l[1].y),b=V>0?h/V:1,p=m-B,i=(l[0].x+l[1].x)/2,e=(l[0].y+l[1].y)/2;G("pinch",{phase:"move",scale:b,center:{x:i,y:e},rotation:p})}}function w(_){let y=Y.get(_.pointerId);if(!y)return;let c=Date.now(),l=c-y.t,h=_.clientX-y.startX,m=_.clientY-y.startY,b=S(y.startX,y.startY,_.clientX,_.clientY),p=Y.size;if(p===2&&A){A=!1;let i=[...Y.values()],e=i.length>=2?(i[0].x+i[1].x)/2:_.clientX,J$=i.length>=2?(i[0].y+i[1].y)/2:_.clientY,Q$=i.length>=2?S(i[0].x,i[0].y,i[1].x,i[1].y):0,$$=V>0?Q$/V:1;G("pinch",{phase:"end",scale:$$,center:{x:e,y:J$},rotation:0}),Y.delete(_.pointerId);return}if(Y.delete(_.pointerId),I(),p===1){if(z)G("pan",{phase:"end",dx:0,dy:0,totalDx:$,totalDy:X,target:_.target}),z=!1;if(b>=Z&&l<=H){let i=Math.abs(h),e=Math.abs(m),J$;if(i>=e)J$=h>0?"right":"left";else J$=m>0?"down":"up";let Q$=l>0?b/l:0;G("swipe",{direction:J$,distance:b,velocityPxPerMs:Q$,startX:y.startX,startY:y.startY,endX:_.clientX,endY:_.clientY})}else if(b<Z&&l<=R){G("tap",{x:_.clientX,y:_.clientY,target:_.target});let i=c-F,e=S(L,W,_.clientX,_.clientY);if(i<=J&&e<Z*3)G("doubletap",{x:_.clientX,y:_.clientY,target:_.target}),F=0;else F=c,L=_.clientX,W=_.clientY}}}function f(_){if(I(),z&&Y.size===1)z=!1,G("pan",{phase:"end",dx:0,dy:0,totalDx:$,totalDy:X,target:_.target});if(A)A=!1;Y.delete(_.pointerId)}let x=`gesture:${++j}`,u=T.scope(x);u.on("pointerdown",M,"pointerdown",g),u.on("pointermove",M,"pointermove",k),u.on("pointerup",M,"pointerup",w),u.on("pointercancel",M,"pointercancel",f);function v(_,y){if(!Q[_])Q[_]=new Set;return Q[_].add(y),()=>d(_,y)}function d(_,y){if(Q[_])Q[_].delete(y)}function o(){I(),u.clear();for(let _ of Object.keys(Q))delete Q[_];Y.clear(),z=!1,A=!1}return{on:v,off:d,detach:o,dispose:o}}return{attach:N}}};var wZ={name:"fullscreen",type:"fw.dom.display",dependencies:[],factory(){let T=!1,j={map:[],list:{}},N=null,M=null;function D(){return!!(document.fullscreenEnabled??document.webkitFullscreenEnabled)}function R(){return!!(document.fullscreenElement??document.webkitFullscreenElement)}function J(F){if(F.requestFullscreen)return F.requestFullscreen();if(F.webkitRequestFullscreen)return F.webkitRequestFullscreen();return Promise.reject(Error("Fullscreen API not supported"))}function U(){if(!R())return Promise.resolve();if(document.exitFullscreen)return document.exitFullscreen();if(document.webkitExitFullscreen)return document.webkitExitFullscreen();return Promise.reject(Error("Fullscreen API not supported"))}function Z(F){if(F instanceof Event)return F.currentTarget||F.target||document.documentElement;if(F instanceof Element)return F;return document.documentElement}function H(){T=R();for(let F=0;F<j.map.length;F++)j.list[j.map[F]](T)}function Q(){if(N)return;N=H,M="onfullscreenchange"in document?"fullscreenchange":"webkitfullscreenchange",document.addEventListener(M,N,!1)}function G(){if(!N)return;document.removeEventListener(M,N,!1),N=null,M=null}let Y={};return Y.isSupported=function(){return D()},Y.isFullscreen=function(){return T},Y.enter=function(F){return J(Z(F))},Y.exit=function(){return U()},Y.toggle=function(F){return T?Y.exit():Y.enter(F)},Y.listen={add(F,L){if(j.map.indexOf(F)<0)j.map.push(F);j.list[F]=L,Q()},del(F){let L=j.map.indexOf(F);if(L>-1)j.map.splice(L,1),delete j.list[F];if(j.map.length===0)G()}},Y.dispose=function(){j.map.length=0;for(let F of Object.keys(j.list))delete j.list[F];G()},Y}};var kZ={name:"idle",type:"fw.dom.lifecycle",dependencies:[],worker:!1,factory(){function T(){return typeof IdleDetector<"u"}async function j(){if(!T())return"denied";return IdleDetector.requestPermission()}async function N({threshold:D=60000}={}){if(!T())throw Error("idle: IdleDetector not supported - use fallback()");let R=new IdleDetector,J=new Set;return R.addEventListener("change",()=>{let U={userState:R.userState,screenState:R.screenState};J.forEach((Z)=>Z(U))}),{get userState(){return R.userState},get screenState(){return R.screenState},onChange(U){return J.add(U),()=>J.delete(U)},async start(){await R.start({threshold:D})},stop(){R.stop(),J.clear()}}}function M({threshold:D=60000,events:R=["mousemove","keydown","touchstart"]}={}){let J="active",U=null,Z=new Set,H=!1;function Q(){Z.forEach((F)=>F({userState:J}))}function G(){if(U!==null)clearTimeout(U);if(J!=="active")J="active",Q();U=setTimeout(()=>{J="idle",U=null,Q()},D)}function Y(){G()}return{get userState(){return J},onChange(F){return Z.add(F),()=>Z.delete(F)},start(){if(H)return;H=!0,R.forEach((F)=>window.addEventListener(F,Y)),G()},stop(){if(H=!1,R.forEach((F)=>window.removeEventListener(F,Y)),U!==null)clearTimeout(U),U=null;Z.clear()}}}return{isSupported:T,requestPermission:j,create:N,fallback:M}}};var gZ={name:"lruCache",version:"1.0.0",type:"fw.io.structures",dependencies:[],factory(){function T({maxSize:j,onEvict:N,snapshot:M}={}){if(!Number.isInteger(j)||j<1)throw Error("lruCache: maxSize must be an integer >= 1");let D={key:null,value:null,prev:null,next:null},R={key:null,value:null,prev:null,next:null};D.next=R,R.prev=D;let J=new Map;function U(q){q.prev.next=q.next,q.next.prev=q.prev}function Z(q){q.next=D.next,q.prev=D,D.next.prev=q,D.next=q}function H(){let q=R.prev;if(U(q),J.delete(q.key),typeof N==="function")N(q.key,q.value)}function Q(q){let P=J.get(q);if(!P)return;return U(P),Z(P),P.value}function G(q,P){if(J.has(q)){let X=J.get(q);X.value=P,U(X),Z(X);return}let $={key:q,value:P,prev:null,next:null};if(J.set(q,$),Z($),J.size>j)H()}function Y(q){return J.has(q)}function F(q){return J.get(q)?.value}function L(q){let P=J.get(q);if(!P)return!1;if(U(P),J.delete(q),typeof N==="function")N(q,P.value);return!0}function W(){if(typeof N==="function"){let q=D.next;while(q!==R)N(q.key,q.value),q=q.next}D.next=R,R.prev=D,J.clear()}function*K(){let q=D.next;while(q!==R)yield q.key,q=q.next}function*z(){let q=D.next;while(q!==R)yield q.value,q=q.next}function*O(){let q=D.next;while(q!==R)yield[q.key,q.value],q=q.next}function C(){let q=[],P=D.next;while(P!==R)q.push([P.key,P.value]),P=P.next;return{maxSize:j,entries:q}}if(M!==void 0){if(M.maxSize!==j)throw Error("lruCache: snapshot.maxSize mismatch");if(M.entries.length>j)throw Error("lruCache: snapshot exceeds maxSize");for(let q=M.entries.length-1;q>=0;q--){let[P,$]=M.entries[q],X={key:P,value:$,prev:null,next:null};J.set(P,X),Z(X)}}return{get:Q,set:G,has:Y,peek:F,delete:L,clear:W,keys:K,values:z,entries:O,snapshot:C,get size(){return J.size},get maxSize(){return j}}}return{create:T}}};var xZ={name:"ringBuffer",version:"1.0.0",type:"fw.io.structures",dependencies:[],factory(){function T({capacity:j,storage:N,snapshot:M}={}){if(!Number.isInteger(j)||j<1)throw Error("ringBuffer: capacity must be an integer >= 1");if(N!==void 0){let K=Array.isArray(N),z=ArrayBuffer.isView(N)&&!(N instanceof DataView);if(!K&&!z)throw Error("ringBuffer: storage must be Array or TypedArray");if(N.length<j)throw Error("ringBuffer: storage length must be >= capacity")}if(M!==void 0){if(M.capacity!==j)throw Error("ringBuffer: snapshot.capacity mismatch");if(!Number.isInteger(M.size)||M.size<0)throw Error("ringBuffer: snapshot.size must be a non-negative integer");if(M.size>j)throw Error("ringBuffer: snapshot.size exceeds capacity");if(!Array.isArray(M.data)||M.data.length<M.size)throw Error("ringBuffer: snapshot.data length must be >= snapshot.size")}let D=N!==void 0?N:Array(j),R=0,J=0;if(M!==void 0){J=M.size,R=0;for(let K=0;K<J;K++)D[K]=M.data[K]}function U(K){let z=(R+J)%j;if(D[z]=K,J<j)J++;else R=(R+1)%j}function Z(){if(J===0)return;let K=D[R];if(Array.isArray(D))D[R]=void 0;else D[R]=0;return R=(R+1)%j,J--,K}function H(){if(J===0)return;let K=(R+J-1)%j,z=D[K];if(Array.isArray(D))D[K]=void 0;else D[K]=0;return J--,z}function Q(){return J===0?void 0:D[R]}function G(){return J===0?void 0:D[(R+J-1)%j]}function Y(K){if(K<0||K>=J)return;return D[(R+K)%j]}function F(){let K=[];for(let z=0;z<J;z++)K.push(D[(R+z)%j]);return K}function L(){if(R=0,J=0,Array.isArray(D))D.fill(void 0);else D.fill(0)}function W(){let K=[];for(let z=0;z<J;z++)K.push(D[(R+z)%j]);return{capacity:j,size:J,data:K}}return{push:U,shift:Z,pop:H,peek:Q,peekLast:G,peekAt:Y,toArray:F,clear:L,snapshot:W,get size(){return J},get capacity(){return j},get isFull(){return J===j},get isEmpty(){return J===0}}}return{create:T}}};var fZ={name:"trie",version:"1.0.0",type:"fw.io.structures",dependencies:[],factory(){function T({snapshot:j}={}){let N={children:new Map,value:void 0,isEnd:!1},M=0;function D(L,W=!0){let K=N;for(let z of L){if(!K.children.has(z))K.children.set(z,{children:new Map,value:void 0,isEnd:!1});K=K.children.get(z)}if(!K.isEnd)M++;K.value=W,K.isEnd=!0}function R(L){let W=N;for(let K of L){if(!W.children.has(K))return null;W=W.children.get(K)}return W}function J(L){let W=R(L);return W!==null&&W.isEnd}function U(L){let W=R(L);return W&&W.isEnd?W.value:void 0}function Z(L){return R(L)!==null}function H(L,W=1/0){let K=R(L);if(!K)return[];let z=[];function O(C,q){if(z.length>=W)return;if(C.isEnd)z.push({key:q,value:C.value});for(let[P,$]of C.children){if(z.length>=W)return;O($,q+P)}}return O(K,L),z}function Q(L){let W=!1,K=[...L];function z(O,C){if(C===K.length){if(!O.isEnd)return!1;return W=!0,O.isEnd=!1,O.value=void 0,M--,O.children.size===0}let q=K[C],P=O.children.get(q);if(!P)return!1;if(z(P,C+1))O.children.delete(q);return!O.isEnd&&O.children.size===0}return z(N,0),W}function*G(){function*L(W,K){if(W.isEnd)yield K;for(let[z,O]of W.children)yield*L(O,K+z)}yield*L(N,"")}function Y(){N.children.clear(),M=0}function F(){let L=[];function W(K,z){if(K.isEnd)L.push([z,K.value]);for(let[O,C]of K.children)W(C,z+O)}return W(N,""),{entries:L}}if(j!==void 0&&j!==null)for(let[L,W]of j.entries)D(L,W);return{insert:D,has:J,get:U,hasPrefix:Z,search:H,delete:Q,keys:G,clear:Y,snapshot:F,get size(){return M}}}return{create:T}}};var hZ={name:"treeWalker",version:"1.0.0",type:"fw.io.structures",dependencies:[],factory(){function T(G,Y){let F=Error(Y);return F.name="ContractError",F.code=G,F}class j{constructor(G){this.current=G,this.root=G,this.entering=!0}next(){let G=this.current;if(G===null)return null;let Y=this.entering,F=G.firstChild!=null;if(Y&&F)this.current=G.firstChild,this.entering=!0;else if(G===this.root)this.current=null;else if(G.next==null)this.current=G.parent,this.entering=!1;else this.current=G.next,this.entering=!0;return{node:G,entering:Y}}resumeAt(G,Y){this.current=G,this.entering=Y===!0}}function N(G){if(G==null)throw TypeError("createWalker: root node required");return new j(G)}function*M(G){if(G==null)throw TypeError("walk: root node required");let Y=new j(G),F;while((F=Y.next())!==null)yield F}function D(G,Y){if(G==null)throw TypeError("findFirst: root node required");if(typeof Y!=="function")throw TypeError("findFirst: predicate must be a function");let F=new j(G),L;while((L=F.next())!==null)if(L.entering&&Y(L.node))return L.node;return null}function R(G,Y){if(G==null)throw TypeError("findAll: root node required");if(typeof Y!=="function")throw TypeError("findAll: predicate must be a function");let F=[],L=new j(G),W;while((W=L.next())!==null)if(W.entering&&Y(W.node))F.push(W.node);return F}function J(G,Y){if(!G||!Y)throw TypeError("replaceNode: both args required");if(!G.parent)throw T("tw/replace-node-no-parent","replaceNode: oldNode has no parent");return G.insertBefore(Y),G.unlink(),Y}function U(G,Y){if(!G)throw TypeError("wrapNode: node required");if(typeof Y!=="function")throw TypeError("wrapNode: wrapperFactory must be a function");if(!G.parent)throw T("tw/wrap-node-no-parent","wrapNode: node has no parent");let F=Y(G);if(!F)throw TypeError("wrapNode: wrapperFactory must return a wrapper node");return G.insertBefore(F),G.unlink(),F.appendChild(G),F}function Z(G){if(!G)throw TypeError("flattenNode: node required");if(!G.parent)throw T("tw/flatten-node-no-parent","flattenNode: node must have a parent");let Y=G.firstChild,F=G;while(Y){let L=Y.next;Y.unlink(),F.insertAfter(Y),F=Y,Y=L}G.unlink()}function H(G,Y=!0){if(!G)throw TypeError("cloneNode: node required");let F=Object.create(Object.getPrototypeOf(G),Object.getOwnPropertyDescriptors(G));if(F.parent=null,F.prev=null,F.next=null,F.firstChild=null,F.lastChild=null,Y){let L=G.firstChild;while(L)F.appendChild(H(L,!0)),L=L.next}return F}function Q(G,Y,F){if(G==null)return;if(typeof Y!=="function")throw TypeError("walkVisit: visitor must be a function");let L=F&&Array.isArray(F.nodeTypes)?F.nodeTypes:null,W=new Set,K=[{node:G,entering:!0}];while(K.length>0){let{node:z,entering:O}=K.pop();if(O){if(W.has(z))throw T("tree-walker/cycle","walkVisit: cycle detected in tree");W.add(z)}let C=z.firstChild!=null,q=!1;if(!L||L.includes(z.type)){let P=Y(z,O);if(O&&P===!1)q=!0}if(O&&C&&!q){K.push({node:z,entering:!1});let P=[],$=z.firstChild;while($)P.push($),$=$.next;for(let X=P.length-1;X>=0;X--)K.push({node:P[X],entering:!0})}else if(O&&C&&q){if(!L||L.includes(z.type))Y(z,!1)}}}return{createWalker:N,walk:M,walkVisit:Q,findFirst:D,findAll:R,replaceNode:J,wrapNode:U,flattenNode:Z,cloneNode:H}}};var _Z={name:"queue",version:"1.0.0",type:"fw.io.utils",dependencies:[],factory(){let T={PROCESSING:1,EOF:2,CLOSING:4,CLOSED:8},j=T.CLOSED|T.CLOSING;class N{constructor(M){if(arguments.length>1)throw Error("too many arguments");this.concurrency=N.parseConcurrency(M),this.length=0,this.running=0,this.error=void 0,this.stopped=!1,this._flags=0,this._array=[],this._callbackBound=(D)=>{this._callback(D)}}concat(M){if(!M||M.constructor!==Array)throw Error("jobs must be an Array");for(let D=0,R=M.length;D<R;D++)this.push(M[D])}end(M){if(this._flags&T.EOF)return;if(this._flags|=T.EOF,this._flags&j)return;this._tick(M)}onData(M,D){throw Error("Queue.onData callback must be defined")}onEnd(M){throw Error("Queue.onEnd callback must be defined")}push(M){if(this._flags&T.EOF)throw Error("Queue.push() was called after Queue.end()");if(this._flags&j)return;if(this._array.push(M),this.length++,!(this._flags&T.PROCESSING))this._process()}stop(M){if(this._flags&j)return;if(!M)this._flags|=T.CLOSING;this.stopped=!0,this._tick(M)}_callback(M){if(this._flags&T.CLOSED)throw Error("an onData handler called end() more than once");this.length--,this.running--,this._tick(M)}_process(){if(this._flags&j)return;if(this._flags&T.PROCESSING)return;this._flags|=T.PROCESSING;while(this._array.length){if(this._flags&j||this.running>=this.concurrency){this._flags&=~T.PROCESSING;return}this.running++,this.onData(this._array.shift(),this._callbackBound)}this._flags&=~T.PROCESSING}_tick(M){if(this._flags&T.CLOSED)return;if(M&&!(this._flags&T.CLOSING))this._flags|=T.CLOSING,this.error=M;if(this._flags&T.CLOSING)if(this.running===0){this._flags|=T.CLOSED,this.onEnd(this.error);return}else return;if(this._flags&T.EOF&&this.length===0){this._flags|=T.CLOSED,this.onEnd(void 0);return}this._process()}static parseConcurrency(M){if(M===void 0)return 1;if(M===!1)return 1;if(M===!0)return 1024;if(typeof M!=="number")throw Error("concurrency must be a number");if(Math.floor(M)!==M)throw Error("concurrency must be an integer");if(M<1)throw Error("concurrency must be at least 1");return M}}return N}};var yZ={name:"bitmap",version:"1.0.0",type:"fw.io.utils",dependencies:[],factory(){let T=[];for(let D=0;D<256;D++){T[D]=[];for(let R=0;R<8;R++)T[D].push(D>>R&1)}return{bytesToBits:function(D,R=[]){for(let J=0;J<D.length;J++)R.push(...T[D[J]]);return R},bitsToBytes:function(D,R=!1){if(R&&(D.length&7)!==0)throw Error("bitsToBytes expects a bit array length that is a multiple of 8");let J=new Uint8Array(D.length>>3);for(let U=0;U<D.length;U+=8)J[U>>3]=D[U]+(D[U+1]<<1)+(D[U+2]<<2)+(D[U+3]<<3)+(D[U+4]<<4)+(D[U+5]<<5)+(D[U+6]<<6)+(D[U+7]<<7);return J},padBitsToByte:function(D,R=0){let J=8-(D.length&7);if(J<8)for(let U=0;U<J;U++)D.push(R);return D}}}};var vZ={name:"interp",version:"1.0.0",type:"fw.io.math",dependencies:[],factory(){function T(F,L,W){return F+W*(L-F)}function j(F,L,W){let K=Math.max(0,Math.min(1,(W-F)/(L-F)));return K*K*(3-2*K)}function N(F,L,W){let K=Math.max(0,Math.min(1,(W-F)/(L-F)));return K*K*K*(K*(K*6-15)+10)}function M(F,L,W,K,z){let O=z*z,C=O*z;return(2*C-3*O+1)*F+(C-2*O+z)*W+(-2*C+3*O)*L+(C-O)*K}function D(F,L,W,K,z,O=0.5){function C(k,w){return Math.abs(w-k)}function q(k,w,f){return k+Math.pow(C(w,f)||0.0000000001,O)}let P=0,$=q(P,F,L),X=q($,L,W),V=q(X,W,K),B=T($,X,z),A=T(F,L,(B-P)/($-P||0.0000000001)),S=T(L,W,(B-$)/(X-$||0.0000000001)),E=T(W,K,(B-X)/(V-X||0.0000000001)),I=T(A,S,(B-P)/(X-P||0.0000000001)),g=T(S,E,(B-$)/(V-$||0.0000000001));return T(I,g,(B-$)/(X-$||0.0000000001))}function R(F,L,W,K){let z=1-K;return z*z*F+2*z*K*L+K*K*W}function J(F,L,W,K,z){let O=1-z,C=O*O,q=z*z;return C*O*F+3*C*z*L+3*O*q*W+q*z*K}function U(F,L,W,K,z,O){return F*(1-z)*(1-O)+L*z*(1-O)+W*(1-z)*O+K*z*O}function Z(F,L,W){let K=[0,1,2,3].map((z)=>{let O=F[z];return D(O[0],O[1],O[2],O[3],L)});return D(K[0],K[1],K[2],K[3],W)}function H(F,L,W,K){if(F.length!==L.length||F.length!==W.length)throw Error("interp: vec dimension mismatch");for(let z=0;z<F.length;z++)F[z]=L[z]+K*(W[z]-L[z]);return F}function Q(F,L,W,K){let z=W.x-L.x,O=W.y-L.y,C=K.x-L.x,q=K.y-L.y,P=F.x-L.x,$=F.y-L.y,X=z*z+O*O,V=z*C+O*q,B=C*C+q*q,A=P*z+$*O,S=P*C+$*q,E=X*B-V*V;if(Math.abs(E)<0.000000000001)throw Error("interp.barycentric: degenerate triangle (collinear or coincident vertices)");let I=(B*A-V*S)/E,g=(X*S-V*A)/E;return{u:1-I-g,v:I,w:g}}function G(F,L){let W=F.length;if(W===1)return F[0];let K=L*(W-1),z=Math.max(0,Math.min(W-2,Math.floor(K)));return T(F[z],F[z+1],K-z)}function Y(F,L,W,K,z){let O=K*(L-1),C=z*(W-1),q=Math.max(0,Math.min(L-2,Math.floor(O))),P=Math.max(0,Math.min(W-2,Math.floor(C))),$=O-q,X=C-P,V=F[P*L+q],B=F[P*L+q+1],A=F[(P+1)*L+q],S=F[(P+1)*L+q+1];return U(V,B,A,S,$,X)}return{linear:T,smoothstep:j,smootherstep:N,cubicHermite:M,catmullRom:D,bezier2:R,bezier3:J,bilinear:U,bicubic:Z,vec:H,barycentric:Q,sample:G,sample2D:Y}}};var bZ={name:"scheduler",dependencies:[],factory(){let T={minute:{min:0,max:59},hour:{min:0,max:23},day:{min:1,max:31},month:{min:1,max:12},weekday:{min:0,max:6}};function j(R,J){let{min:U,max:Z}=T[J],H=new Set;for(let Q of R.split(",")){let G=Q.match(/^(.+)\/(\d+)$/),Y=1,F=Q;if(G){if(Y=parseInt(G[2],10),Y<=0)throw Error(`scheduler: invalid cron expression - field ${J}: step must be > 0`);F=G[1]}let L,W;if(F==="*")L=U,W=Z;else if(/^\d+-\d+$/.test(F))[L,W]=F.split("-").map(Number);else if(/^\d+$/.test(F))L=W=parseInt(F,10);else throw Error(`scheduler: invalid cron expression - field ${J}: invalid token '${F}'`);if(!Number.isInteger(L)||!Number.isInteger(W)||L<U||W>Z||L>W)throw Error(`scheduler: invalid cron expression - field ${J}: value out of range ${U}-${Z}`);for(let K=L;K<=W;K+=Y)H.add(K)}return H}function N(R){let J=R.trim().split(/\s+/);if(J.length!==5){let C=J.length>5?"scheduler: invalid cron expression - seconds field not supported (expected 5 fields)":"scheduler: invalid cron expression - expected 5 fields";throw Error(C)}let[U,Z,H,Q,G]=J,Y={minute:j(U,"minute"),hour:j(Z,"hour"),day:j(H,"day"),month:j(Q,"month"),weekday:j(G,"weekday")},F=H==="*",L=G==="*";function W(C){let q=C.getDate(),P=C.getDay();if(!F&&!L)return Y.day.has(q)||Y.weekday.has(P);if(!F)return Y.day.has(q);if(!L)return Y.weekday.has(P);return!0}function K(C){return Y.month.has(C.getMonth()+1)&&W(C)&&Y.hour.has(C.getHours())&&Y.minute.has(C.getMinutes())}function z(C){let q=C?new Date(C):new Date;q.setSeconds(0,0),q.setMinutes(q.getMinutes()+1);let P=q.getTime()+157788000000,$=new Date(q);while($.getTime()<=P){if(!Y.month.has($.getMonth()+1)){$.setMonth($.getMonth()+1,1),$.setHours(0,0,0,0);continue}if(!W($)){$.setDate($.getDate()+1),$.setHours(0,0,0,0);continue}if(!Y.hour.has($.getHours())){$.setHours($.getHours()+1,0,0,0);continue}if(!Y.minute.has($.getMinutes())){$.setMinutes($.getMinutes()+1,0,0);continue}return new Date($)}throw Error("scheduler: no firing in 5y horizon")}function O(C,q){let P=[],$=q;for(let X=0;X<C;X++){let V=z($);P.push(V),$=V}return P}return{expression:R,next:z,nextN:O,matches:K,fields:{minute:Y.minute,hour:Y.hour,day:Y.day,month:Y.month,weekday:Y.weekday}}}function M(R,J){if(typeof R!=="function")throw Error("scheduler: callback must be a function");if(typeof J!=="number"||!isFinite(J)||J<=0)throw Error("scheduler: ms must be a positive number");let U=null;function Z(){if(U!==null)return;U=setInterval(()=>{try{R()}catch(Q){console.error(Q)}},J)}function H(){if(U===null)return;clearInterval(U),U=null}return{start:Z,stop:H,get running(){return U!==null}}}function D(R,J){if(typeof J!=="function")throw Error("scheduler: callback must be a function");let U=N(R),Z=null,H=null,Q=!0;function G(){if(Q)return;H=U.next();let L=Math.max(0,H.getTime()-Date.now());Z=setTimeout(()=>{if(Z=null,Q)return;try{J()}catch(W){console.error(W)}if(Q)return;G()},L)}function Y(){if(!Q)return;Q=!1,G()}function F(){if(Q=!0,Z!==null)clearTimeout(Z),Z=null;H=null}return{start:Y,stop:F,get running(){return!Q},get next(){return H},get expression(){return R}}}return{cron:N,interval:M,job:D}}};var d$={name:"broadcastChannel",type:"fw.dom.net",dependencies:[],factory(){function T(){return typeof BroadcastChannel<"u"||typeof globalThis.BroadcastChannel<"u"}function j(N){let M=typeof BroadcastChannel<"u"?BroadcastChannel:globalThis.BroadcastChannel;if(!M)throw Error("broadcastChannel: BroadcastChannel is not available in this environment");let D=new M(N),R=N,J=new Set;D.onmessage=(G)=>{for(let Y of J)try{Y(G.data,G)}catch(F){console.error("broadcastChannel listener error:",F)}};function U(G){D.postMessage(G)}function Z(G){return J.add(G),()=>J.delete(G)}function H(G){J.delete(G)}function Q(){if(!D)return;J.clear(),D.onmessage=null,D.close(),D=null}return{post:U,on:Z,off:H,close:Q,get name(){return D?D.name:R}}}return{create:j,isSupported:T}}};var uZ={name:"storage",version:"1.0.0",type:"fw.dom.fs",dependencies:["broadcastChannel"],deps:[d$],factory(T){let j={crossTab:!0,namespace:""};function N({crossTab:Q,namespace:G}={}){if(J()>0)throw Error("storage: configure must be called before any listen.add");if(G!==void 0){if(typeof G!=="string"||G.includes(":"))throw Error('storage: namespace must be a string without ":"');j.namespace=G}if(Q!==void 0){if(typeof Q!=="boolean")throw Error("storage: crossTab must be a boolean");j.crossTab=Q}}function M(Q){try{return Q.setItem("__probe__","__probe__"),Q.removeItem("__probe__"),!0}catch{return!1}}function D(Q){try{return JSON.parse(Q)}catch{return Q}}let R=null;function J(){if(!R)return 0;return R.map.length}function U(Q,G){let Y={map:[],list:{}};if(G==="local")R=Y;let F=!1,L=null;function W(P,$,X,V){let B={type:P,key:$,value:X,cross:V};for(let A=0;A<Y.map.length;A++)Y.list[Y.map[A]](B)}function K(P){if(P.storageArea!==Q)return;if(P.key===null)W("clear",null,null,!0);else if(P.newValue===null)W("del",P.key,null,!0);else W("set",P.key,D(P.newValue),!0)}function z(){return j.namespace?`storage:${j.namespace}:local`:"storage:local"}function O(){if(G!=="local")return;if(!j.crossTab)return;if(T.isSupported())L=T.create(z()),L.on((P)=>W(P.type,P.key,P.value,!0));else window.addEventListener("storage",K,!1),F=!0}function C(){if(G!=="local")return;if(L)L.close(),L=null;else if(F)window.removeEventListener("storage",K,!1),F=!1}function q(P,$,X){if(G==="local"&&L)L.post({type:P,key:$,value:X})}return{set(P,$){Q.setItem(P,JSON.stringify($)),W("set",P,$,!1),q("set",P,$)},get(P){let $=Q.getItem(P);return $===null?null:D($)},has(P){return Q.getItem(P)!==null},del(P){Q.removeItem(P),W("del",P,null,!1),q("del",P,null)},clear(){Q.clear(),W("clear",null,null,!1),q("clear",null,null)},keys(){let P=[];for(let $=0;$<Q.length;$++)P.push(Q.key($));return P},get length(){return Q.length},listen:{add(P,$){let X=Y.map.length===0;if(Y.map.indexOf(P)<0)Y.map.push(P);if(Y.list[P]=$,X&&Y.map.length===1)O()},del(P){let $=Y.map.indexOf(P);if($>-1){if(Y.map.splice($,1),delete Y.list[P],Y.map.length===0)C()}}}}}let Z=typeof localStorage<"u"&&M(localStorage)?U(localStorage,"local"):null,H=typeof sessionStorage<"u"&&M(sessionStorage)?U(sessionStorage,"session"):null;return{local:Z,session:H,isSupported(){return Z!==null||H!==null},configure:N}}};var mZ={name:"download",version:"1.0.0",type:"fw.dom.fs",dependencies:[],factory(){function T(j,N,M){let D=document.createElement("a");if(D.href=j,D.download=N,document.body.appendChild(D),D.click(),document.body.removeChild(D),M)URL.revokeObjectURL(j)}return{url(j,N){T(j,N,!1)},blob(j,N){T(URL.createObjectURL(j),N,!0)},bytes(j,N,M="application/octet-stream"){this.blob(new Blob([j],{type:M}),N)},text(j,N,M="text/plain;charset=utf-8"){this.blob(new Blob([j],{type:M}),N)}}}};var pZ={name:"clipboard",version:"1.0.0",type:"fw.dom.utils",dependencies:[],factory(){let T=typeof navigator<"u"?navigator:null,j=T?.clipboard??null,N=!!(j&&typeof j.writeText==="function"),M=!!(j&&typeof j.readText==="function"),D=!!(T&&typeof T.share==="function");return{isSupported(){return{read:M,write:N,share:D}},set(R){return j.writeText(R)},get(){return j.readText()},share(R={}){return T.share(R)}}}};var cZ={name:"ua",version:"1.0.0",type:"fw.dom.utils",dependencies:[],factory(){let T=typeof navigator<"u"?navigator.userAgent||navigator.vendor||"":"",j=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i,N=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i,M=j.test(T)||N.test(T.substring(0,4)),D=T.toLowerCase(),R=/iphone|ipad|ipod/.test(D)?"ios":/android/.test(D)?"android":/windows/.test(D)?"windows":/macintosh|mac os x/.test(D)?"mac":/linux/.test(D)?"linux":"unknown";return{string(){return T},mobile(){return M},touch(){return typeof window<"u"&&"ontouchstart"in window||typeof navigator<"u"&&navigator.maxTouchPoints>0},platform(){return R}}}};var dZ={name:"uuid",dependencies:["hex"],deps:[u$],factory(T){let j=new Uint8Array(16),N,M,D=0,R=0;function J(Q,G){let Y=T.fromBytes(Q);if(G==="rfc4122")return Y.slice(0,8)+"-"+Y.slice(8,12)+"-"+Y.slice(12,16)+"-"+Y.slice(16,20)+"-"+Y.slice(20,32);return Y}function U(Q,G){if(Q!==!1&&typeof Q==="function"){let Y=G.slice(0),F=Q(G);if(F instanceof Uint8Array&&F.length>=16)return F;if(F===void 0||F===null||F===G){for(let L=0;L<16;L++)if(G[L]!==Y[L])return G}}return crypto.getRandomValues(G)}return{v1:function(Q=!1,G=!1,Y="compact"){let F=0,L=j,W=N,K=M;if(W==null||K==null){let $=U(G,j);if(W==null)W=N=[$[0]|1,$[1],$[2],$[3],$[4],$[5]];if(K==null)K=M=($[6]<<8|$[7])&16383}let z=Date.now(),O=R+1,C=z-D+(O-R)/1e4;if(C<0)K=K+1&16383;if(C<0||z>D)O=0;else if(O>=1e4)K=K+1&16383,O=0;D=z,R=O,M=K,z+=12219292800000;let q=((z&268435455)*1e4+O)%4294967296;L[F++]=q>>>24&255,L[F++]=q>>>16&255,L[F++]=q>>>8&255,L[F++]=q&255;let P=z/4294967296*1e4&268435455;L[F++]=P>>>8&255,L[F++]=P&255,L[F++]=P>>>24&15|16,L[F++]=P>>>16&255,L[F++]=K>>>8|128,L[F++]=K&255;for(let $=0;$<6;++$)L[F+$]=W[$];return Q?j.slice(0):J(j,Y)},v4:function(Q=!1,G=!1,Y="compact"){let F=U(G,j);return F[6]=F[6]&15|64,F[8]=F[8]&63|128,Q?F.slice(0,16):J(F,Y)}}}};var lZ={name:"virtualScroll",version:"1.1.0",type:"fw.dom.rendering",dependencies:["dom"],deps:[H$],factory(T){function j(N){let{container:M,renderItem:D}=N,R=N.itemHeight,J=N.total,U=N.overscan!==void 0?N.overscan:3,Z=N.mode||"fixed",H=new Map,Q=R||40,G=document.createElement("div");G.style.position="relative";let Y=document.createElement("div");Y.style.position="absolute",Y.style.top="0",Y.style.left="0",Y.style.width="100%",M.style.position="relative",M.style.overflow="auto",M.appendChild(G),M.appendChild(Y);function F(){if(Z==="fixed")return J*R;let I=0;for(let g=0;g<J;g++)I+=H.has(g)?H.get(g):Q;return I}function L(I){if(Z==="fixed")return I*R;let g=0;for(let k=0;k<I;k++)g+=H.has(k)?H.get(k):Q;return g}function W(I){if(Z==="fixed")return Math.floor(I/R);let g=0;for(let k=0;k<J;k++){let w=H.has(k)?H.get(k):Q;if(g+=w,g>I)return k}return J-1}function K(){return M.getBoundingClientRect().height||M.clientHeight||0}function z(){let I=M.scrollTop||0,g=K(),k=Math.max(0,W(I)-U),w=W(I+g),f=Math.min(J-1,w+U);return{start:k,end:f}}function O(I){let g=D(I);if(g instanceof Element)return g;if(Array.isArray(g)){if(T&&typeof T.create==="function")return T.create(g);if(g.length>0&&g[0]instanceof Element)return g[0]}let k=document.createElement("span");return k.textContent=String(I),k}let C=-1,q=-1;function P(){let{start:I,end:g}=z();if(I===C&&g===q)return;C=I,q=g,G.style.height=F()+"px";let k=L(I);Y.style.top=k+"px",Y.textContent="";for(let w=I;w<=g;w++){let f=O(w);if(Y.appendChild(f),Z==="variable"&&!H.has(w)){let x=f.getBoundingClientRect().height;if(x>0)H.set(w,x)}}}function $(){P()}M.addEventListener("scroll",$,{passive:!0}),P();function X(){C=-1,q=-1,P()}function V(I){if(J=I,Z==="variable"){for(let g of H.keys())if(g>=I)H.delete(g)}X()}function B(I,g){let k=g&&g.align||"start",w=L(I),f=K(),x;if(k==="start"||k==="auto")x=w;else if(k==="end"){let u=Z==="fixed"?R:H.get(I)||Q;x=w+u-f}else if(k==="center"){let u=Z==="fixed"?R:H.get(I)||Q;x=w-f/2+u/2}else x=w;M.scrollTop=Math.max(0,x),P()}function A(){return z()}function S(I){if(Z==="fixed")return R;return H.has(I)?H.get(I):Q}function E(){if(M.removeEventListener("scroll",$,{passive:!0}),Y.textContent="",G.parentNode===M)M.removeChild(G);if(Y.parentNode===M)M.removeChild(Y);H.clear()}return{refresh:X,setTotal:V,scrollTo:B,visibleRange:A,measure:S,dispose:E}}return{create:j}}};var iZ={name:"themeTokens",version:"1.1.0",type:"fw.dom.rendering",dependencies:["dom"],deps:[H$],factory(T){let j=0,R={neutral:{"color-bg":{light:"#ffffff",dark:"#0b0b0d",highContrast:"#000000"},"color-fg":{light:"#1a1a1a",dark:"#f2f2f2",highContrast:"#ffffff"},"color-muted":{light:"#6b7280",dark:"#9ca3af",highContrast:"#cccccc"},"color-accent":{light:"#2563eb",dark:"#60a5fa",highContrast:"#ffff00"},"color-danger":{light:"#dc2626",dark:"#f87171",highContrast:"#ff6b6b"},"color-success":{light:"#16a34a",dark:"#4ade80",highContrast:"#00ff7f"},"color-border":{light:"#e5e7eb",dark:"#27272a",highContrast:"#ffffff"},"space-1":"4px","space-2":"8px","space-3":"12px","space-4":"16px","space-6":"24px","space-8":"32px","radius-sm":"4px","radius-md":"8px","radius-lg":"16px","font-sans":"system-ui, -apple-system, sans-serif","font-mono":"ui-monospace, Menlo, Consolas, monospace","duration-fast":{default:"120ms",reducedMotion:"0ms"},"duration-base":{default:"240ms",reducedMotion:"0ms"},"duration-slow":{default:"480ms",reducedMotion:"0ms"},"easing-standard":"cubic-bezier(.2,0,0,1)"},material:{"color-bg":{light:"#fffbfe",dark:"#1c1b1f",highContrast:"#000000"},"color-fg":{light:"#1c1b1f",dark:"#e6e1e5",highContrast:"#ffffff"},"color-surface":{light:"#f7f2fa",dark:"#2b292d"},"color-primary":{light:"#6750a4",dark:"#d0bcff",highContrast:"#ffff00"},"color-on-primary":{light:"#ffffff",dark:"#371e73"},"color-secondary":{light:"#625b71",dark:"#ccc2dc"},"color-error":{light:"#b3261e",dark:"#f2b8b5"},"color-outline":{light:"#79747e",dark:"#938f99"},"space-1":"4px","space-2":"8px","space-3":"12px","space-4":"16px","space-6":"24px","radius-sm":"4px","radius-md":"12px","radius-lg":"28px","font-sans":"Roboto, system-ui, sans-serif","font-mono":"Roboto Mono, ui-monospace, monospace","elevation-1":"0 1px 2px rgba(0,0,0,.30), 0 1px 3px 1px rgba(0,0,0,.15)","elevation-2":"0 1px 2px rgba(0,0,0,.30), 0 2px 6px 2px rgba(0,0,0,.15)","duration-fast":{default:"150ms",reducedMotion:"0ms"},"duration-base":{default:"250ms",reducedMotion:"0ms"},"duration-slow":{default:"400ms",reducedMotion:"0ms"},"easing-standard":"cubic-bezier(.2,0,0,1)","easing-emphasized":"cubic-bezier(.2,0,0,1)"},tailwind:{"color-bg":{light:"#ffffff",dark:"#0f172a",highContrast:"#000000"},"color-fg":{light:"#0f172a",dark:"#f1f5f9",highContrast:"#ffffff"},"color-muted":{light:"#64748b",dark:"#94a3b8",highContrast:"#cccccc"},"color-accent":{light:"#3b82f6",dark:"#60a5fa",highContrast:"#ffff00"},"color-danger":{light:"#ef4444",dark:"#f87171"},"color-success":{light:"#22c55e",dark:"#4ade80"},"color-warning":{light:"#eab308",dark:"#facc15"},"color-border":{light:"#e2e8f0",dark:"#1e293b",highContrast:"#ffffff"},"space-1":"0.25rem","space-2":"0.5rem","space-3":"0.75rem","space-4":"1rem","space-6":"1.5rem","space-8":"2rem","radius-sm":"0.125rem","radius-md":"0.375rem","radius-lg":"0.5rem","radius-xl":"0.75rem","font-sans":"ui-sans-serif, system-ui, sans-serif","font-mono":"ui-monospace, SFMono-Regular, Menlo, monospace","shadow-sm":"0 1px 2px 0 rgb(0 0 0 / .05)","shadow-md":"0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1)","duration-fast":{default:"150ms",reducedMotion:"0ms"},"duration-base":{default:"200ms",reducedMotion:"0ms"},"duration-slow":{default:"300ms",reducedMotion:"0ms"},"easing-standard":"cubic-bezier(.4,0,.2,1)"}};function J(U={}){let Z=U.prefix??"",H=U.scope??":root",Q=`data-fw-theme-tokens-${++j}`,G=!1,Y={},F="auto",L="light",W=!1,K=new Set,z=null,O=null,C=null,q=null,P=null,$=null,X=null,V=null;function B(){if(F==="high-contrast")return"high-contrast";let y=q?q.matches:!1,c=O?O.matches:!1,l=z?z.matches:!1;if(y||c)return"high-contrast";if(F==="dark")return"dark";if(F==="light")return"light";return l?"dark":"light"}function A(y,c,l){if(typeof y==="string"||typeof y==="number")return String(y);if(l&&y.reducedMotion!==void 0)return String(y.reducedMotion);if(c==="high-contrast"&&y.highContrast!==void 0)return String(y.highContrast);if(c==="dark"&&y.dark!==void 0)return String(y.dark);if(c==="light"&&y.light!==void 0)return String(y.light);if(y.default!==void 0)return String(y.default);if(c==="high-contrast"){if(y.dark!==void 0)return String(y.dark);if(y.light!==void 0)return String(y.light)}return}function S(){if(H instanceof Element)return{selector:":root",element:document.documentElement};let y=H||":root",c;try{c=document.querySelector(y)}catch{c=null}if(!c)c=document.documentElement;return{selector:y,element:c}}function E(){let y=[];for(let[l,h]of Object.entries(Y)){let m=A(h,L,W);if(m!==void 0)y.push(` --${Z}${l}: ${m};`)}let{selector:c}=S();return y.length?`${c} {
53
- ${y.join(`
47
+ `),U=null;for(let W=0;W<J.length;W++){let C=J[W];if(C==="")continue;if((C[0]===" "||C[0]==="\t")&&U){G[U]+=" "+C.trim();continue}let P=C.indexOf(":");if(P<0)continue;let D=C.slice(0,P).trim().toLowerCase(),F=C.slice(P+1).trim();if(D in G)G[D]+=", "+F;else G[D]=F;U=D}return G}function V(Y){if(!Y)return"";let G="";for(let J of Object.keys(Y)){let U=J.replace(/(^|-)([a-z])/g,(W,C,P)=>C+P.toUpperCase());G+=U+": "+Y[J]+`\r
48
+ `}return G}let X=new Uint8Array([13,10]);function H(Y,G){if(!(Y instanceof Uint8Array))throw Error("mime: decode expects Uint8Array");if(!G)throw Error("mime: boundary required");let J=E.toBytes("--"+G),U=T(Y,J,0);if(U<0)throw Error("mime: boundary not found");let W=N([X,J]),C=[],P=U+J.length;while(P<Y.length){if(Y[P]===45&&Y[P+1]===45)break;if(Y[P]===13&&Y[P+1]===10)P+=2;else if(Y[P]===10)P+=1;let D=T(Y,W,P);if(D<0)throw Error("mime: unterminated part");let F=Y.subarray(P,D),K=-1;for(let z=0;z<F.length-3;z++)if(F[z]===13&&F[z+1]===10&&F[z+2]===13&&F[z+3]===10){K=z;break}let O,M;if(K>=0)O=E.fromBytes(F.subarray(0,K)),M=F.subarray(K+4);else O="",M=F;C.push({headers:$(O),body:M}),P=D+W.length}return C}function Q(){let Y=S.bytes(8);if(Y===!1||!Y)throw Error("mime: CSPRNG entropy unavailable for boundary generation");let G="";for(let J=0;J<Y.length;J++){let U=Y[J];G+=(U<16?"0":"")+U.toString(16)}return"----FwBoundary"+G}function L(Y,G){G=G||{};let J=G.boundary||Q(),U=G.type||"multipart/form-data",W=[],C=E.toBytes("--"+J+`\r
49
+ `),P=E.toBytes(`\r
50
+ --`+J+`--\r
51
+ `),D=E.toBytes(`\r
52
+ --`+J+`\r
53
+ `);for(let F=0;F<Y.length;F++){let K=Y[F];W.push(F===0?C:D),W.push(E.toBytes(V(K.headers||{})+`\r
54
+ `));let O=K.body;if(typeof O==="string")W.push(E.toBytes(O));else if(O instanceof Uint8Array)W.push(O);else if(O==null);else throw Error("mime: part body must be string or Uint8Array")}if(Y.length===0)W.push(E.toBytes("--"+J+`--\r
55
+ `));else W.push(P);return{body:N(W),boundary:J,contentType:U+"; boundary="+J}}return{parseHeader:j,formatHeader:q,parseHeaders:$,formatHeaders:V,encode:L,decode:H,randomBoundary:Q}}};var hZ={name:"keybindings",version:"1.0.0",type:"fw.dom.utils",dependencies:["events","eventBus"],deps:[D$,v$],factory(E,S){let T=new Set(["Escape","Tab","Enter","Space","Backspace","Delete","Insert","Home","End","PageUp","PageDown","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"]),N={esc:"Escape",escape:"Escape",return:"Enter",enter:"Enter",tab:"Tab",space:"Space",backspace:"Backspace",del:"Delete",delete:"Delete",insert:"Insert",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",arrowup:"ArrowUp",arrowdown:"ArrowDown",arrowleft:"ArrowLeft",arrowright:"ArrowRight",plus:"Plus",minus:"Minus",equal:"Equal",equals:"Equal","-":"Minus","=":"Equal"},R={"+":"Plus","-":"Minus","=":"Equal"},j=new Set(Object.values(R)),Z=new Set(["ctrl","shift","alt","meta","cmd","super"]);function q(Q){let L=Q.split("+"),Y={ctrl:!1,shift:!1,alt:!1,meta:!1},G=null;for(let J of L){let U=J.toLowerCase();if(Z.has(U))if(U==="cmd"||U==="super")Y.meta=!0;else Y[U]=!0;else if(J.length===0)throw Error('keybindings: invalid combo segment "'+Q+'"');else{if(G!==null)throw Error('keybindings: multiple non-modifier keys in segment "'+Q+'"');let W=N[U];if(W)G=W;else if(T.has(J))G=J;else if(/^[a-zA-Z0-9]$/.test(J))G=J.toLowerCase();else throw Error('keybindings: unknown key "'+J+'" in segment "'+Q+'"')}}if(Y.shift&&G!==null&&j.has(G))throw Error('keybindings: Shift cannot qualify punctuation key "'+G+'" in segment "'+Q+'"');if(G===null)throw Error('keybindings: no key specified in segment "'+Q+'"');return{modifiers:Y,key:G}}function $(Q){if(typeof Q!=="string"||Q.trim().length===0)throw TypeError("keybindings: combo must be a non-empty string");let L=Q.trim().split(" ").filter((Y)=>Y.length>0);if(L.length===1)return q(L[0]);return L.map((Y)=>q(Y))}function V(Q){let L=Q.key;if(T.has(L))return L;let Y=N[L.toLowerCase()];if(Y)return Y;if(R[L])return R[L];let G=Q.code;if(G&&/^Key[A-Z]$/.test(G))return G.slice(3).toLowerCase();if(G&&/^Digit[0-9]$/.test(G))return G.slice(5);if(L.length===1)return L.toLowerCase();return null}function X(Q,L){let{modifiers:Y,key:G}=L,J=typeof Q.getModifierState==="function"&&Q.getModifierState("AltGraph"),U=Q.ctrlKey||J,W=Q.altKey||J;if(U!==Y.ctrl)return!1;if(!j.has(G)&&Q.shiftKey!==Y.shift)return!1;if(W!==Y.alt)return!1;if(Q.metaKey!==Y.meta)return!1;return V(Q)===G}function H(Q={}){let L=Q.target||document,Y=typeof Q.chordTimeout==="number"?Q.chordTimeout:1500,G=S.create(),J=[],U=[],W=null,C=!1;function P(y,_,v={}){if(typeof y!=="string")throw TypeError("keybindings.bind: combo must be a string");if(typeof _!=="function")throw TypeError("keybindings.bind: fn must be a function");let b=$(y),h=v.context||null,d=typeof v.priority==="number"?v.priority:0,n=v.preventDefault!==!1,m=v.repeat===!0,c={combo:y,parsed:b,context:h,priority:d,preventDefault:n,repeat:m,fn:_};return J.push(c),function(){let $$=J.indexOf(c);if($$!==-1)J.splice($$,1)}}function D(y,_){for(let v=J.length-1;v>=0;v--)if(J[v].combo===y){if(!_||J[v].fn===_)J.splice(v,1)}}function F(y){U.push(y)}function K(){if(U.length===0)throw RangeError("keybindings: context stack underflow");return U.pop()}function O(){return[...U]}function M(){return J.map((y)=>({combo:y.combo,context:y.context,priority:y.priority,fn:y.fn}))}function z(y){return J.filter((_)=>{let v=_.parsed;if(Array.isArray(v))return X(y,v[0]);return X(y,v)}).map((_)=>({combo:_.combo,context:_.context,priority:_.priority,fn:_.fn}))}function B(y){let _=U.length>0?U[U.length-1]:null;if(_===null)return y.filter((v)=>v.context===null);return y.filter((v)=>v.context===_)}function I(y){return y.reduce((_,v)=>v.priority>_.priority?v:_,y[0])}function A(y,_){if(y.length===0)return;let v=y.reduce((h,d)=>Math.max(h,d.priority),-1/0),b=y.filter((h)=>h.priority===v);for(let h of b){if(h.preventDefault)_.preventDefault();try{h.fn(_)}catch(d){console.error("keybindings handler error:",d)}G.emit("keybindings:matched",{combo:h.combo,context:h.context,fn:h.fn})}}function w(y){if(W){let{candidates:d,matched:n,timer:m}=W;clearTimeout(m),W=null;let c=n+1,o=d.filter(($$)=>X(y,$$.parsed[c]));if(o.length>0){let $$=o.filter((e)=>e.parsed.length-1===c);if($$.length>0){let e=I($$);if(e.repeat||!y.repeat){if(e.preventDefault)y.preventDefault();try{e.fn(y)}catch(t){console.error("keybindings chord handler error:",t)}G.emit("keybindings:matched",{combo:e.combo,context:e.context,fn:e.fn})}}else W={candidates:o,matched:c,timer:setTimeout(()=>{W=null},Y)};return}}let _=J.filter((d)=>{if(!Array.isArray(d.parsed))return!1;if(!X(y,d.parsed[0]))return!1;let n=U.length>0?U[U.length-1]:null;if(n===null)return d.context===null;return d.context===n});if(_.length>0){W={candidates:_,matched:0,timer:setTimeout(()=>{W=null},Y)};return}let v=J.filter((d)=>{if(Array.isArray(d.parsed))return!1;return X(y,d.parsed)}),h=B(v).filter((d)=>d.repeat||!y.repeat);A(h,y)}function k(){if(C)return;C=!0,L.addEventListener("keydown",w)}function g(){if(!C)return;if(C=!1,L.removeEventListener("keydown",w),W)clearTimeout(W.timer),W=null}function x(){g(),J.length=0,U.length=0}function f(){let y=new Set;function _(...b){let h=P(...b);return y.add(h),h}function v(){for(let b of y)try{b()}catch{}y.clear()}return{bind:_,unbind:D,pushContext:F,popContext:K,dispose:v,clear:v}}return{bind:P,unbind:D,pushContext:F,popContext:K,currentContext:O,list:M,match:z,attach:k,detach:g,dispose:x,scope:f}}return{create:H,parse:$}}};var bZ={name:"gesture",version:"1.0.0",type:"fw.dom.query",dependencies:["events"],deps:[D$],factory(E){let S=0;function T(N,R={}){let j=R.tapMaxMs??250,Z=R.doubletapMaxMs??300,q=R.longpressMs??500,$=R.swipeMinPx??10,V=R.swipeMaxMs??300,X=Object.create(null);function H(h,d){let n=X[h];if(!n)return;for(let m of n)m(d)}let Q=new Map,L=0,Y=0,G=0,J=null,U=!1,W=0,C=0,P=0,D=0,F=0,K=0,O=0,M=0,z=!1;function B(h,d,n,m){let c=n-h,o=m-d;return Math.sqrt(c*c+o*o)}function I(h,d,n,m){return Math.atan2(m-d,n-h)*180/Math.PI}function A(){if(J!==null)clearTimeout(J),J=null}function w(h){Q.set(h.pointerId,{startX:h.clientX,startY:h.clientY,x:h.clientX,y:h.clientY,t:Date.now()});try{N.setPointerCapture(h.pointerId)}catch(n){}let d=Q.size;if(d===1){W=h.clientX,C=h.clientY,P=h.clientX,D=h.clientY,F=0,K=0,U=!0,H("pan",{phase:"start",dx:0,dy:0,totalDx:0,totalDy:0,target:h.target}),A();let{clientX:n,clientY:m,target:c}=h,o=Date.now();J=setTimeout(()=>{J=null;let $$=Date.now()-o;H("longpress",{x:n,y:m,target:c,durationMs:$$})},q)}if(d===2){A(),U=!1;let n=[...Q.values()];O=B(n[0].x,n[0].y,n[1].x,n[1].y),M=I(n[0].x,n[0].y,n[1].x,n[1].y),z=!0;let m=(n[0].x+n[1].x)/2,c=(n[0].y+n[1].y)/2;H("pinch",{phase:"start",scale:1,center:{x:m,y:c},rotation:0})}}function k(h){if(!Q.has(h.pointerId))return;let d=Q.get(h.pointerId);Q.set(h.pointerId,{startX:d.startX,startY:d.startY,x:h.clientX,y:h.clientY,t:d.t});let n=Q.size;if(n===1&&U){let m=h.clientX-P,c=h.clientY-D;if(F+=m,K+=c,P=h.clientX,D=h.clientY,B(W,C,h.clientX,h.clientY)>$)A();H("pan",{phase:"move",dx:m,dy:c,totalDx:F,totalDy:K,target:h.target})}if(n===2&&z){let m=[...Q.values()],c=B(m[0].x,m[0].y,m[1].x,m[1].y),o=I(m[0].x,m[0].y,m[1].x,m[1].y),$$=O>0?c/O:1,e=o-M,t=(m[0].x+m[1].x)/2,G$=(m[0].y+m[1].y)/2;H("pinch",{phase:"move",scale:$$,center:{x:t,y:G$},rotation:e})}}function g(h){let d=Q.get(h.pointerId);if(!d)return;let n=Date.now(),m=n-d.t,c=h.clientX-d.startX,o=h.clientY-d.startY,$$=B(d.startX,d.startY,h.clientX,h.clientY),e=Q.size;if(e===2&&z){z=!1;let t=[...Q.values()],G$=t.length>=2?(t[0].x+t[1].x)/2:h.clientX,Q$=t.length>=2?(t[0].y+t[1].y)/2:h.clientY,u=t.length>=2?B(t[0].x,t[0].y,t[1].x,t[1].y):0,r=O>0?u/O:1;H("pinch",{phase:"end",scale:r,center:{x:G$,y:Q$},rotation:0}),Q.delete(h.pointerId);return}if(Q.delete(h.pointerId),A(),e===1){if(U)H("pan",{phase:"end",dx:0,dy:0,totalDx:F,totalDy:K,target:h.target}),U=!1;if($$>=$&&m<=V){let t=Math.abs(c),G$=Math.abs(o),Q$;if(t>=G$)Q$=c>0?"right":"left";else Q$=o>0?"down":"up";let u=m>0?$$/m:0;H("swipe",{direction:Q$,distance:$$,velocityPxPerMs:u,startX:d.startX,startY:d.startY,endX:h.clientX,endY:h.clientY})}else if($$<$&&m<=j){H("tap",{x:h.clientX,y:h.clientY,target:h.target});let t=n-L,G$=B(Y,G,h.clientX,h.clientY);if(t<=Z&&G$<$*3)H("doubletap",{x:h.clientX,y:h.clientY,target:h.target}),L=0;else L=n,Y=h.clientX,G=h.clientY}}}function x(h){if(A(),U&&Q.size===1)U=!1,H("pan",{phase:"end",dx:0,dy:0,totalDx:F,totalDy:K,target:h.target});if(z)z=!1;Q.delete(h.pointerId)}let f=`gesture:${++S}`,y=E.scope(f);y.on("pointerdown",N,"pointerdown",w),y.on("pointermove",N,"pointermove",k),y.on("pointerup",N,"pointerup",g),y.on("pointercancel",N,"pointercancel",x);function _(h,d){if(!X[h])X[h]=new Set;return X[h].add(d),()=>v(h,d)}function v(h,d){if(X[h])X[h].delete(d)}function b(){A(),y.clear();for(let h of Object.keys(X))delete X[h];Q.clear(),U=!1,z=!1}return{on:_,off:v,detach:b,dispose:b}}return{attach:T}}};var uZ={name:"fullscreen",type:"fw.dom.display",dependencies:[],factory(){let E=!1,S={map:[],list:{}},T=null,N=null;function R(){return!!(document.fullscreenEnabled??document.webkitFullscreenEnabled)}function j(){return!!(document.fullscreenElement??document.webkitFullscreenElement)}function Z(L){if(L.requestFullscreen)return L.requestFullscreen();if(L.webkitRequestFullscreen)return L.webkitRequestFullscreen();return Promise.reject(Error("Fullscreen API not supported"))}function q(){if(!j())return Promise.resolve();if(document.exitFullscreen)return document.exitFullscreen();if(document.webkitExitFullscreen)return document.webkitExitFullscreen();return Promise.reject(Error("Fullscreen API not supported"))}function $(L){if(L instanceof Event)return L.currentTarget||L.target||document.documentElement;if(L instanceof Element)return L;return document.documentElement}function V(){E=j();for(let L=0;L<S.map.length;L++)S.list[S.map[L]](E)}function X(){if(T)return;T=V,N="onfullscreenchange"in document?"fullscreenchange":"webkitfullscreenchange",document.addEventListener(N,T,!1)}function H(){if(!T)return;document.removeEventListener(N,T,!1),T=null,N=null}let Q={};return Q.isSupported=function(){return R()},Q.isFullscreen=function(){return E},Q.enter=function(L){return Z($(L))},Q.exit=function(){return q()},Q.toggle=function(L){return E?Q.exit():Q.enter(L)},Q.listen={add(L,Y){if(S.map.indexOf(L)<0)S.map.push(L);S.list[L]=Y,X()},del(L){let Y=S.map.indexOf(L);if(Y>-1)S.map.splice(Y,1),delete S.list[L];if(S.map.length===0)H()}},Q.dispose=function(){S.map.length=0;for(let L of Object.keys(S.list))delete S.list[L];H()},Q}};var mZ={name:"idle",type:"fw.dom.lifecycle",dependencies:[],worker:!1,factory(){function E(){return typeof IdleDetector<"u"}async function S(){if(!E())return"denied";return IdleDetector.requestPermission()}async function T({threshold:R=60000}={}){if(!E())throw Error("idle: IdleDetector not supported - use fallback()");let j=new IdleDetector,Z=new Set;return j.addEventListener("change",()=>{let q={userState:j.userState,screenState:j.screenState};Z.forEach(($)=>$(q))}),{get userState(){return j.userState},get screenState(){return j.screenState},onChange(q){return Z.add(q),()=>Z.delete(q)},async start(){await j.start({threshold:R})},stop(){j.stop(),Z.clear()}}}function N({threshold:R=60000,events:j=["mousemove","keydown","touchstart"]}={}){let Z="active",q=null,$=new Set,V=!1;function X(){$.forEach((L)=>L({userState:Z}))}function H(){if(q!==null)clearTimeout(q);if(Z!=="active")Z="active",X();q=setTimeout(()=>{Z="idle",q=null,X()},R)}function Q(){H()}return{get userState(){return Z},onChange(L){return $.add(L),()=>$.delete(L)},start(){if(V)return;V=!0,j.forEach((L)=>window.addEventListener(L,Q)),H()},stop(){if(V=!1,j.forEach((L)=>window.removeEventListener(L,Q)),q!==null)clearTimeout(q),q=null;$.clear()}}}return{isSupported:E,requestPermission:S,create:T,fallback:N}}};var pZ={name:"lruCache",version:"1.0.0",type:"fw.io.structures",dependencies:[],factory(){function E({maxSize:S,onEvict:T,snapshot:N}={}){if(!Number.isInteger(S)||S<1)throw Error("lruCache: maxSize must be an integer >= 1");let R={key:null,value:null,prev:null,next:null},j={key:null,value:null,prev:null,next:null};R.next=j,j.prev=R;let Z=new Map;function q(P){P.prev.next=P.next,P.next.prev=P.prev}function $(P){P.next=R.next,P.prev=R,R.next.prev=P,R.next=P}function V(){let P=j.prev;if(q(P),Z.delete(P.key),typeof T==="function")T(P.key,P.value)}function X(P){let D=Z.get(P);if(!D)return;return q(D),$(D),D.value}function H(P,D){if(Z.has(P)){let K=Z.get(P);K.value=D,q(K),$(K);return}let F={key:P,value:D,prev:null,next:null};if(Z.set(P,F),$(F),Z.size>S)V()}function Q(P){return Z.has(P)}function L(P){return Z.get(P)?.value}function Y(P){let D=Z.get(P);if(!D)return!1;if(q(D),Z.delete(P),typeof T==="function")T(P,D.value);return!0}function G(){if(typeof T==="function"){let P=R.next;while(P!==j)T(P.key,P.value),P=P.next}R.next=j,j.prev=R,Z.clear()}function*J(){let P=R.next;while(P!==j)yield P.key,P=P.next}function*U(){let P=R.next;while(P!==j)yield P.value,P=P.next}function*W(){let P=R.next;while(P!==j)yield[P.key,P.value],P=P.next}function C(){let P=[],D=R.next;while(D!==j)P.push([D.key,D.value]),D=D.next;return{maxSize:S,entries:P}}if(N!==void 0){if(N.maxSize!==S)throw Error("lruCache: snapshot.maxSize mismatch");if(N.entries.length>S)throw Error("lruCache: snapshot exceeds maxSize");for(let P=N.entries.length-1;P>=0;P--){let[D,F]=N.entries[P],K={key:D,value:F,prev:null,next:null};Z.set(D,K),$(K)}}return{get:X,set:H,has:Q,peek:L,delete:Y,clear:G,keys:J,values:U,entries:W,snapshot:C,get size(){return Z.size},get maxSize(){return S}}}return{create:E}}};var dZ={name:"ringBuffer",version:"1.0.0",type:"fw.io.structures",dependencies:[],factory(){function E({capacity:S,storage:T,snapshot:N}={}){if(!Number.isInteger(S)||S<1)throw Error("ringBuffer: capacity must be an integer >= 1");if(T!==void 0){let J=Array.isArray(T),U=ArrayBuffer.isView(T)&&!(T instanceof DataView);if(!J&&!U)throw Error("ringBuffer: storage must be Array or TypedArray");if(T.length<S)throw Error("ringBuffer: storage length must be >= capacity")}if(N!==void 0){if(N.capacity!==S)throw Error("ringBuffer: snapshot.capacity mismatch");if(!Number.isInteger(N.size)||N.size<0)throw Error("ringBuffer: snapshot.size must be a non-negative integer");if(N.size>S)throw Error("ringBuffer: snapshot.size exceeds capacity");if(!Array.isArray(N.data)||N.data.length<N.size)throw Error("ringBuffer: snapshot.data length must be >= snapshot.size")}let R=T!==void 0?T:Array(S),j=0,Z=0;if(N!==void 0){Z=N.size,j=0;for(let J=0;J<Z;J++)R[J]=N.data[J]}function q(J){let U=(j+Z)%S;if(R[U]=J,Z<S)Z++;else j=(j+1)%S}function $(){if(Z===0)return;let J=R[j];if(Array.isArray(R))R[j]=void 0;else R[j]=0;return j=(j+1)%S,Z--,J}function V(){if(Z===0)return;let J=(j+Z-1)%S,U=R[J];if(Array.isArray(R))R[J]=void 0;else R[J]=0;return Z--,U}function X(){return Z===0?void 0:R[j]}function H(){return Z===0?void 0:R[(j+Z-1)%S]}function Q(J){if(J<0||J>=Z)return;return R[(j+J)%S]}function L(){let J=[];for(let U=0;U<Z;U++)J.push(R[(j+U)%S]);return J}function Y(){if(j=0,Z=0,Array.isArray(R))R.fill(void 0);else R.fill(0)}function G(){let J=[];for(let U=0;U<Z;U++)J.push(R[(j+U)%S]);return{capacity:S,size:Z,data:J}}return{push:q,shift:$,pop:V,peek:X,peekLast:H,peekAt:Q,toArray:L,clear:Y,snapshot:G,get size(){return Z},get capacity(){return S},get isFull(){return Z===S},get isEmpty(){return Z===0}}}return{create:E}}};var cZ={name:"trie",version:"1.0.0",type:"fw.io.structures",dependencies:[],factory(){function E({snapshot:S}={}){let T={children:new Map,value:void 0,isEnd:!1},N=0;function R(Y,G=!0){let J=T;for(let U of Y){if(!J.children.has(U))J.children.set(U,{children:new Map,value:void 0,isEnd:!1});J=J.children.get(U)}if(!J.isEnd)N++;J.value=G,J.isEnd=!0}function j(Y){let G=T;for(let J of Y){if(!G.children.has(J))return null;G=G.children.get(J)}return G}function Z(Y){let G=j(Y);return G!==null&&G.isEnd}function q(Y){let G=j(Y);return G&&G.isEnd?G.value:void 0}function $(Y){return j(Y)!==null}function V(Y,G=1/0){let J=j(Y);if(!J)return[];let U=[];function W(C,P){if(U.length>=G)return;if(C.isEnd)U.push({key:P,value:C.value});for(let[D,F]of C.children){if(U.length>=G)return;W(F,P+D)}}return W(J,Y),U}function X(Y){let G=!1,J=[...Y];function U(W,C){if(C===J.length){if(!W.isEnd)return!1;return G=!0,W.isEnd=!1,W.value=void 0,N--,W.children.size===0}let P=J[C],D=W.children.get(P);if(!D)return!1;if(U(D,C+1))W.children.delete(P);return!W.isEnd&&W.children.size===0}return U(T,0),G}function*H(){function*Y(G,J){if(G.isEnd)yield J;for(let[U,W]of G.children)yield*Y(W,J+U)}yield*Y(T,"")}function Q(){T.children.clear(),N=0}function L(){let Y=[];function G(J,U){if(J.isEnd)Y.push([U,J.value]);for(let[W,C]of J.children)G(C,U+W)}return G(T,""),{entries:Y}}if(S!==void 0&&S!==null)for(let[Y,G]of S.entries)R(Y,G);return{insert:R,has:Z,get:q,hasPrefix:$,search:V,delete:X,keys:H,clear:Q,snapshot:L,get size(){return N}}}return{create:E}}};var lZ={name:"treeWalker",version:"1.0.0",type:"fw.io.structures",dependencies:[],factory(){function E(H,Q){let L=Error(Q);return L.name="ContractError",L.code=H,L}class S{constructor(H){this.current=H,this.root=H,this.entering=!0}next(){let H=this.current;if(H===null)return null;let Q=this.entering,L=H.firstChild!=null;if(Q&&L)this.current=H.firstChild,this.entering=!0;else if(H===this.root)this.current=null;else if(H.next==null)this.current=H.parent,this.entering=!1;else this.current=H.next,this.entering=!0;return{node:H,entering:Q}}resumeAt(H,Q){this.current=H,this.entering=Q===!0}}function T(H){if(H==null)throw TypeError("createWalker: root node required");return new S(H)}function*N(H){if(H==null)throw TypeError("walk: root node required");let Q=new S(H),L;while((L=Q.next())!==null)yield L}function R(H,Q){if(H==null)throw TypeError("findFirst: root node required");if(typeof Q!=="function")throw TypeError("findFirst: predicate must be a function");let L=new S(H),Y;while((Y=L.next())!==null)if(Y.entering&&Q(Y.node))return Y.node;return null}function j(H,Q){if(H==null)throw TypeError("findAll: root node required");if(typeof Q!=="function")throw TypeError("findAll: predicate must be a function");let L=[],Y=new S(H),G;while((G=Y.next())!==null)if(G.entering&&Q(G.node))L.push(G.node);return L}function Z(H,Q){if(!H||!Q)throw TypeError("replaceNode: both args required");if(!H.parent)throw E("tw/replace-node-no-parent","replaceNode: oldNode has no parent");return H.insertBefore(Q),H.unlink(),Q}function q(H,Q){if(!H)throw TypeError("wrapNode: node required");if(typeof Q!=="function")throw TypeError("wrapNode: wrapperFactory must be a function");if(!H.parent)throw E("tw/wrap-node-no-parent","wrapNode: node has no parent");let L=Q(H);if(!L)throw TypeError("wrapNode: wrapperFactory must return a wrapper node");return H.insertBefore(L),H.unlink(),L.appendChild(H),L}function $(H){if(!H)throw TypeError("flattenNode: node required");if(!H.parent)throw E("tw/flatten-node-no-parent","flattenNode: node must have a parent");let Q=H.firstChild,L=H;while(Q){let Y=Q.next;Q.unlink(),L.insertAfter(Q),L=Q,Q=Y}H.unlink()}function V(H,Q=!0){if(!H)throw TypeError("cloneNode: node required");let L=Object.create(Object.getPrototypeOf(H),Object.getOwnPropertyDescriptors(H));if(L.parent=null,L.prev=null,L.next=null,L.firstChild=null,L.lastChild=null,Q){let Y=H.firstChild;while(Y)L.appendChild(V(Y,!0)),Y=Y.next}return L}function X(H,Q,L){if(H==null)return;if(typeof Q!=="function")throw TypeError("walkVisit: visitor must be a function");let Y=L&&Array.isArray(L.nodeTypes)?L.nodeTypes:null,G=new Set,J=[{node:H,entering:!0}];while(J.length>0){let{node:U,entering:W}=J.pop();if(W){if(G.has(U))throw E("tree-walker/cycle","walkVisit: cycle detected in tree");G.add(U)}let C=U.firstChild!=null,P=!1;if(!Y||Y.includes(U.type)){let D=Q(U,W);if(W&&D===!1)P=!0}if(W&&C&&!P){J.push({node:U,entering:!1});let D=[],F=U.firstChild;while(F)D.push(F),F=F.next;for(let K=D.length-1;K>=0;K--)J.push({node:D[K],entering:!0})}else if(W&&C&&P){if(!Y||Y.includes(U.type))Q(U,!1)}}}return{createWalker:T,walk:N,walkVisit:X,findFirst:R,findAll:j,replaceNode:Z,wrapNode:q,flattenNode:$,cloneNode:V}}};var iZ={name:"queue",version:"1.0.0",type:"fw.io.utils",dependencies:[],factory(){let E={PROCESSING:1,EOF:2,CLOSING:4,CLOSED:8},S=E.CLOSED|E.CLOSING;class T{constructor(N){if(arguments.length>1)throw Error("too many arguments");this.concurrency=T.parseConcurrency(N),this.length=0,this.running=0,this.error=void 0,this.stopped=!1,this._flags=0,this._array=[],this._callbackBound=(R)=>{this._callback(R)}}concat(N){if(!N||N.constructor!==Array)throw Error("jobs must be an Array");for(let R=0,j=N.length;R<j;R++)this.push(N[R])}end(N){if(this._flags&E.EOF)return;if(this._flags|=E.EOF,this._flags&S)return;this._tick(N)}onData(N,R){throw Error("Queue.onData callback must be defined")}onEnd(N){throw Error("Queue.onEnd callback must be defined")}push(N){if(this._flags&E.EOF)throw Error("Queue.push() was called after Queue.end()");if(this._flags&S)return;if(this._array.push(N),this.length++,!(this._flags&E.PROCESSING))this._process()}stop(N){if(this._flags&S)return;if(!N)this._flags|=E.CLOSING;this.stopped=!0,this._tick(N)}_callback(N){if(this._flags&E.CLOSED)throw Error("an onData handler called end() more than once");this.length--,this.running--,this._tick(N)}_process(){if(this._flags&S)return;if(this._flags&E.PROCESSING)return;this._flags|=E.PROCESSING;while(this._array.length){if(this._flags&S||this.running>=this.concurrency){this._flags&=~E.PROCESSING;return}this.running++,this.onData(this._array.shift(),this._callbackBound)}this._flags&=~E.PROCESSING}_tick(N){if(this._flags&E.CLOSED)return;if(N&&!(this._flags&E.CLOSING))this._flags|=E.CLOSING,this.error=N;if(this._flags&E.CLOSING)if(this.running===0){this._flags|=E.CLOSED,this.onEnd(this.error);return}else return;if(this._flags&E.EOF&&this.length===0){this._flags|=E.CLOSED,this.onEnd(void 0);return}this._process()}static parseConcurrency(N){if(N===void 0)return 1;if(N===!1)return 1;if(N===!0)return 1024;if(typeof N!=="number")throw Error("concurrency must be a number");if(Math.floor(N)!==N)throw Error("concurrency must be an integer");if(N<1)throw Error("concurrency must be at least 1");return N}}return T}};var nZ={name:"bitmap",version:"1.0.0",type:"fw.io.utils",dependencies:[],factory(){let E=[];for(let R=0;R<256;R++){E[R]=[];for(let j=0;j<8;j++)E[R].push(R>>j&1)}return{bytesToBits:function(R,j=[]){for(let Z=0;Z<R.length;Z++)j.push(...E[R[Z]]);return j},bitsToBytes:function(R,j=!1){if(j&&(R.length&7)!==0)throw Error("bitsToBytes expects a bit array length that is a multiple of 8");let Z=new Uint8Array(R.length>>3);for(let q=0;q<R.length;q+=8)Z[q>>3]=R[q]+(R[q+1]<<1)+(R[q+2]<<2)+(R[q+3]<<3)+(R[q+4]<<4)+(R[q+5]<<5)+(R[q+6]<<6)+(R[q+7]<<7);return Z},padBitsToByte:function(R,j=0){let Z=8-(R.length&7);if(Z<8)for(let q=0;q<Z;q++)R.push(j);return R}}}};var oZ={name:"interp",version:"1.0.0",type:"fw.io.math",dependencies:[],factory(){function E(L,Y,G){return L+G*(Y-L)}function S(L,Y,G){let J=Math.max(0,Math.min(1,(G-L)/(Y-L)));return J*J*(3-2*J)}function T(L,Y,G){let J=Math.max(0,Math.min(1,(G-L)/(Y-L)));return J*J*J*(J*(J*6-15)+10)}function N(L,Y,G,J,U){let W=U*U,C=W*U;return(2*C-3*W+1)*L+(C-2*W+U)*G+(-2*C+3*W)*Y+(C-W)*J}function R(L,Y,G,J,U,W=0.5){function C(k,g){return Math.abs(g-k)}function P(k,g,x){return k+Math.pow(C(g,x)||0.0000000001,W)}let D=0,F=P(D,L,Y),K=P(F,Y,G),O=P(K,G,J),M=E(F,K,U),z=E(L,Y,(M-D)/(F-D||0.0000000001)),B=E(Y,G,(M-F)/(K-F||0.0000000001)),I=E(G,J,(M-K)/(O-K||0.0000000001)),A=E(z,B,(M-D)/(K-D||0.0000000001)),w=E(B,I,(M-F)/(O-F||0.0000000001));return E(A,w,(M-F)/(K-F||0.0000000001))}function j(L,Y,G,J){let U=1-J;return U*U*L+2*U*J*Y+J*J*G}function Z(L,Y,G,J,U){let W=1-U,C=W*W,P=U*U;return C*W*L+3*C*U*Y+3*W*P*G+P*U*J}function q(L,Y,G,J,U,W){return L*(1-U)*(1-W)+Y*U*(1-W)+G*(1-U)*W+J*U*W}function $(L,Y,G){let J=[0,1,2,3].map((U)=>{let W=L[U];return R(W[0],W[1],W[2],W[3],Y)});return R(J[0],J[1],J[2],J[3],G)}function V(L,Y,G,J){if(L.length!==Y.length||L.length!==G.length)throw Error("interp: vec dimension mismatch");for(let U=0;U<L.length;U++)L[U]=Y[U]+J*(G[U]-Y[U]);return L}function X(L,Y,G,J){let U=G.x-Y.x,W=G.y-Y.y,C=J.x-Y.x,P=J.y-Y.y,D=L.x-Y.x,F=L.y-Y.y,K=U*U+W*W,O=U*C+W*P,M=C*C+P*P,z=D*U+F*W,B=D*C+F*P,I=K*M-O*O;if(Math.abs(I)<0.000000000001)throw Error("interp.barycentric: degenerate triangle (collinear or coincident vertices)");let A=(M*z-O*B)/I,w=(K*B-O*z)/I;return{u:1-A-w,v:A,w}}function H(L,Y){let G=L.length;if(G===1)return L[0];let J=Y*(G-1),U=Math.max(0,Math.min(G-2,Math.floor(J)));return E(L[U],L[U+1],J-U)}function Q(L,Y,G,J,U){let W=J*(Y-1),C=U*(G-1),P=Math.max(0,Math.min(Y-2,Math.floor(W))),D=Math.max(0,Math.min(G-2,Math.floor(C))),F=W-P,K=C-D,O=L[D*Y+P],M=L[D*Y+P+1],z=L[(D+1)*Y+P],B=L[(D+1)*Y+P+1];return q(O,M,z,B,F,K)}return{linear:E,smoothstep:S,smootherstep:T,cubicHermite:N,catmullRom:R,bezier2:j,bezier3:Z,bilinear:q,bicubic:$,vec:V,barycentric:X,sample:H,sample2D:Q}}};var rZ={name:"scheduler",dependencies:[],factory(){let E={minute:{min:0,max:59},hour:{min:0,max:23},day:{min:1,max:31},month:{min:1,max:12},weekday:{min:0,max:6}};function S(j,Z){let{min:q,max:$}=E[Z],V=new Set;for(let X of j.split(",")){let H=X.match(/^(.+)\/(\d+)$/),Q=1,L=X;if(H){if(Q=parseInt(H[2],10),Q<=0)throw Error(`scheduler: invalid cron expression - field ${Z}: step must be > 0`);L=H[1]}let Y,G;if(L==="*")Y=q,G=$;else if(/^\d+-\d+$/.test(L))[Y,G]=L.split("-").map(Number);else if(/^\d+$/.test(L))Y=G=parseInt(L,10);else throw Error(`scheduler: invalid cron expression - field ${Z}: invalid token '${L}'`);if(!Number.isInteger(Y)||!Number.isInteger(G)||Y<q||G>$||Y>G)throw Error(`scheduler: invalid cron expression - field ${Z}: value out of range ${q}-${$}`);for(let J=Y;J<=G;J+=Q)V.add(J)}return V}function T(j){let Z=j.trim().split(/\s+/);if(Z.length!==5){let C=Z.length>5?"scheduler: invalid cron expression - seconds field not supported (expected 5 fields)":"scheduler: invalid cron expression - expected 5 fields";throw Error(C)}let[q,$,V,X,H]=Z,Q={minute:S(q,"minute"),hour:S($,"hour"),day:S(V,"day"),month:S(X,"month"),weekday:S(H,"weekday")},L=V==="*",Y=H==="*";function G(C){let P=C.getDate(),D=C.getDay();if(!L&&!Y)return Q.day.has(P)||Q.weekday.has(D);if(!L)return Q.day.has(P);if(!Y)return Q.weekday.has(D);return!0}function J(C){return Q.month.has(C.getMonth()+1)&&G(C)&&Q.hour.has(C.getHours())&&Q.minute.has(C.getMinutes())}function U(C){let P=C?new Date(C):new Date;P.setSeconds(0,0),P.setMinutes(P.getMinutes()+1);let D=P.getTime()+157788000000,F=new Date(P);while(F.getTime()<=D){if(!Q.month.has(F.getMonth()+1)){F.setMonth(F.getMonth()+1,1),F.setHours(0,0,0,0);continue}if(!G(F)){F.setDate(F.getDate()+1),F.setHours(0,0,0,0);continue}if(!Q.hour.has(F.getHours())){F.setHours(F.getHours()+1,0,0,0);continue}if(!Q.minute.has(F.getMinutes())){F.setMinutes(F.getMinutes()+1,0,0);continue}return new Date(F)}throw Error("scheduler: no firing in 5y horizon")}function W(C,P){let D=[],F=P;for(let K=0;K<C;K++){let O=U(F);D.push(O),F=O}return D}return{expression:j,next:U,nextN:W,matches:J,fields:{minute:Q.minute,hour:Q.hour,day:Q.day,month:Q.month,weekday:Q.weekday}}}function N(j,Z){if(typeof j!=="function")throw Error("scheduler: callback must be a function");if(typeof Z!=="number"||!isFinite(Z)||Z<=0)throw Error("scheduler: ms must be a positive number");let q=null;function $(){if(q!==null)return;q=setInterval(()=>{try{j()}catch(X){console.error(X)}},Z)}function V(){if(q===null)return;clearInterval(q),q=null}return{start:$,stop:V,get running(){return q!==null}}}function R(j,Z){if(typeof Z!=="function")throw Error("scheduler: callback must be a function");let q=T(j),$=null,V=null,X=!0;function H(){if(X)return;V=q.next();let Y=Math.max(0,V.getTime()-Date.now());$=setTimeout(()=>{if($=null,X)return;try{Z()}catch(G){console.error(G)}if(X)return;H()},Y)}function Q(){if(!X)return;X=!1,H()}function L(){if(X=!0,$!==null)clearTimeout($),$=null;V=null}return{start:Q,stop:L,get running(){return!X},get next(){return V},get expression(){return j}}}return{cron:T,interval:N,job:R}}};var a$={name:"broadcastChannel",type:"fw.dom.net",dependencies:[],factory(){function E(){return typeof BroadcastChannel<"u"||typeof globalThis.BroadcastChannel<"u"}function S(T){let N=typeof BroadcastChannel<"u"?BroadcastChannel:globalThis.BroadcastChannel;if(!N)throw Error("broadcastChannel: BroadcastChannel is not available in this environment");let R=new N(T),j=T,Z=new Set;R.onmessage=(H)=>{for(let Q of Z)try{Q(H.data,H)}catch(L){console.error("broadcastChannel listener error:",L)}};function q(H){R.postMessage(H)}function $(H){return Z.add(H),()=>Z.delete(H)}function V(H){Z.delete(H)}function X(){if(!R)return;Z.clear(),R.onmessage=null,R.close(),R=null}return{post:q,on:$,off:V,close:X,get name(){return R?R.name:j}}}return{create:S,isSupported:E}}};var sZ={name:"storage",version:"1.0.0",type:"fw.dom.fs",dependencies:["broadcastChannel"],deps:[a$],factory(E){let S={crossTab:!0,namespace:""};function T({crossTab:X,namespace:H}={}){if(Z()>0)throw Error("storage: configure must be called before any listen.add");if(H!==void 0){if(typeof H!=="string"||H.includes(":"))throw Error('storage: namespace must be a string without ":"');S.namespace=H}if(X!==void 0){if(typeof X!=="boolean")throw Error("storage: crossTab must be a boolean");S.crossTab=X}}function N(X){try{return X.setItem("__probe__","__probe__"),X.removeItem("__probe__"),!0}catch{return!1}}function R(X){try{return JSON.parse(X)}catch{return X}}let j=null;function Z(){if(!j)return 0;return j.map.length}function q(X,H){let Q={map:[],list:{}};if(H==="local")j=Q;let L=!1,Y=null;function G(D,F,K,O){let M={type:D,key:F,value:K,cross:O};for(let z=0;z<Q.map.length;z++)Q.list[Q.map[z]](M)}function J(D){if(D.storageArea!==X)return;if(D.key===null)G("clear",null,null,!0);else if(D.newValue===null)G("del",D.key,null,!0);else G("set",D.key,R(D.newValue),!0)}function U(){return S.namespace?`storage:${S.namespace}:local`:"storage:local"}function W(){if(H!=="local")return;if(!S.crossTab)return;if(E.isSupported())Y=E.create(U()),Y.on((D)=>G(D.type,D.key,D.value,!0));else window.addEventListener("storage",J,!1),L=!0}function C(){if(H!=="local")return;if(Y)Y.close(),Y=null;else if(L)window.removeEventListener("storage",J,!1),L=!1}function P(D,F,K){if(H==="local"&&Y)Y.post({type:D,key:F,value:K})}return{set(D,F){X.setItem(D,JSON.stringify(F)),G("set",D,F,!1),P("set",D,F)},get(D){let F=X.getItem(D);return F===null?null:R(F)},has(D){return X.getItem(D)!==null},del(D){X.removeItem(D),G("del",D,null,!1),P("del",D,null)},clear(){X.clear(),G("clear",null,null,!1),P("clear",null,null)},keys(){let D=[];for(let F=0;F<X.length;F++)D.push(X.key(F));return D},get length(){return X.length},listen:{add(D,F){let K=Q.map.length===0;if(Q.map.indexOf(D)<0)Q.map.push(D);if(Q.list[D]=F,K&&Q.map.length===1)W()},del(D){let F=Q.map.indexOf(D);if(F>-1){if(Q.map.splice(F,1),delete Q.list[D],Q.map.length===0)C()}}}}}let $=typeof localStorage<"u"&&N(localStorage)?q(localStorage,"local"):null,V=typeof sessionStorage<"u"&&N(sessionStorage)?q(sessionStorage,"session"):null;return{local:$,session:V,isSupported(){return $!==null||V!==null},configure:T}}};var aZ={name:"download",version:"1.0.0",type:"fw.dom.fs",dependencies:[],factory(){function E(S,T,N){let R=document.createElement("a");if(R.href=S,R.download=T,document.body.appendChild(R),R.click(),document.body.removeChild(R),N)URL.revokeObjectURL(S)}return{url(S,T){E(S,T,!1)},blob(S,T){E(URL.createObjectURL(S),T,!0)},bytes(S,T,N="application/octet-stream"){this.blob(new Blob([S],{type:N}),T)},text(S,T,N="text/plain;charset=utf-8"){this.blob(new Blob([S],{type:N}),T)}}}};var tZ={name:"clipboard",version:"1.0.0",type:"fw.dom.utils",dependencies:[],factory(){let E=typeof navigator<"u"?navigator:null,S=E?.clipboard??null,T=!!(S&&typeof S.writeText==="function"),N=!!(S&&typeof S.readText==="function"),R=!!(E&&typeof E.share==="function"),j=typeof globalThis.ClipboardItem==="function"?globalThis.ClipboardItem:null,Z=!!(S&&typeof S.write==="function"&&j),q=($,V)=>Promise.resolve($).then((X)=>new Blob([X],{type:V}));return{isSupported(){return{read:N,write:T,richWrite:Z,share:R}},set($){return S.writeText($)},setRich({html:$,text:V}){if(!Z)return Promise.reject(Error("clipboard: rich write unsupported (navigator.clipboard.write or ClipboardItem missing)"));let X=q($,"text/html"),H=q(V,"text/plain"),Q=S.write([new j({"text/html":X,"text/plain":H})]);return Promise.all([X,H,Q]).then(()=>{return})},get(){return S.readText()},share($={}){return E.share($)}}}};var eZ={name:"ua",version:"1.0.0",type:"fw.dom.utils",dependencies:[],factory(){let E=typeof navigator<"u"?navigator:null,S=E?E.userAgent||E.vendor||"":"",T=E&&E.userAgentData&&typeof E.userAgentData==="object"?E.userAgentData:null,N=T&&typeof T.mobile==="boolean"?T.mobile:/Mobi/i.test(S),R={windows:"windows",macos:"mac",linux:"linux",android:"android",ios:"ios","chrome os":"linux"};function j(){let q=S.toLowerCase();if(/iphone|ipad|ipod/.test(q))return"ios";if(/android/.test(q))return"android";if(/windows/.test(q))return"windows";if(/macintosh|mac os x/.test(q))return E&&E.maxTouchPoints>1?"ios":"mac";if(/linux|cros/.test(q))return"linux";return"unknown"}let Z=T&&typeof T.platform==="string"&&T.platform?R[T.platform.toLowerCase()]||"unknown":j();return{string(){return S},mobile(){return N},touch(){return typeof window<"u"&&"ontouchstart"in window||typeof navigator<"u"&&navigator.maxTouchPoints>0},platform(){return Z}}}};var $J={name:"uuid",dependencies:["hex"],deps:[n$],factory(E){let S=new Uint8Array(16),T,N,R=0,j=0;function Z(X,H){let Q=E.fromBytes(X);if(H==="rfc4122")return Q.slice(0,8)+"-"+Q.slice(8,12)+"-"+Q.slice(12,16)+"-"+Q.slice(16,20)+"-"+Q.slice(20,32);return Q}function q(X,H){if(X!==!1&&typeof X==="function"){let Q=H.slice(0),L=X(H);if(L instanceof Uint8Array&&L.length>=16)return L;if(L===void 0||L===null||L===H){for(let Y=0;Y<16;Y++)if(H[Y]!==Q[Y])return H}}return crypto.getRandomValues(H)}return{v1:function(X=!1,H=!1,Q="rfc4122"){let L=0,Y=S,G=T,J=N;if(G==null||J==null){let F=q(H,S);if(G==null)G=T=[F[0]|1,F[1],F[2],F[3],F[4],F[5]];if(J==null)J=N=(F[6]<<8|F[7])&16383}let U=Date.now(),W=j+1,C=U-R+(W-j)/1e4;if(C<0)J=J+1&16383;if(C<0||U>R)W=0;else if(W>=1e4)J=J+1&16383,W=0;R=U,j=W,N=J,U+=12219292800000;let P=((U&268435455)*1e4+W)%4294967296;Y[L++]=P>>>24&255,Y[L++]=P>>>16&255,Y[L++]=P>>>8&255,Y[L++]=P&255;let D=U/4294967296*1e4&268435455;Y[L++]=D>>>8&255,Y[L++]=D&255,Y[L++]=D>>>24&15|16,Y[L++]=D>>>16&255,Y[L++]=J>>>8|128,Y[L++]=J&255;for(let F=0;F<6;++F)Y[L+F]=G[F];return X?S.slice(0):Z(S,Q)},v4:function(X=!1,H=!1,Q="rfc4122"){let L=q(H,S);return L[6]=L[6]&15|64,L[8]=L[8]&63|128,X?L.slice(0,16):Z(L,Q)}}}};var ZJ={name:"virtualScroll",version:"1.1.0",type:"fw.dom.rendering",dependencies:["dom"],deps:[F$],factory(E){function S(T){let{container:N,renderItem:R}=T,j=T.itemHeight,Z=T.total,q=T.overscan!==void 0?T.overscan:3,$=T.mode||"fixed",V=new Map,X=j||40,H=document.createElement("div");H.style.position="relative";let Q=document.createElement("div");Q.style.position="absolute",Q.style.top="0",Q.style.left="0",Q.style.width="100%",N.style.position="relative",N.style.overflow="auto",N.appendChild(H),N.appendChild(Q);function L(){if($==="fixed")return Z*j;let A=0;for(let w=0;w<Z;w++)A+=V.has(w)?V.get(w):X;return A}function Y(A){if($==="fixed")return A*j;let w=0;for(let k=0;k<A;k++)w+=V.has(k)?V.get(k):X;return w}function G(A){if($==="fixed")return Math.floor(A/j);let w=0;for(let k=0;k<Z;k++){let g=V.has(k)?V.get(k):X;if(w+=g,w>A)return k}return Z-1}function J(){return N.getBoundingClientRect().height||N.clientHeight||0}function U(){let A=N.scrollTop||0,w=J(),k=Math.max(0,G(A)-q),g=G(A+w),x=Math.min(Z-1,g+q);return{start:k,end:x}}function W(A){let w=R(A);if(w instanceof Element)return w;if(Array.isArray(w)){if(E&&typeof E.create==="function")return E.create(w);if(w.length>0&&w[0]instanceof Element)return w[0]}let k=document.createElement("span");return k.textContent=String(A),k}let C=-1,P=-1;function D(){let{start:A,end:w}=U();if(A===C&&w===P)return;C=A,P=w,H.style.height=L()+"px";let k=Y(A);Q.style.top=k+"px",Q.textContent="";for(let g=A;g<=w;g++){let x=W(g);if(Q.appendChild(x),$==="variable"&&!V.has(g)){let f=x.getBoundingClientRect().height;if(f>0)V.set(g,f)}}}function F(){D()}N.addEventListener("scroll",F,{passive:!0}),D();function K(){C=-1,P=-1,D()}function O(A){if(Z=A,$==="variable"){for(let w of V.keys())if(w>=A)V.delete(w)}K()}function M(A,w){let k=w&&w.align||"start",g=Y(A),x=J(),f;if(k==="start"||k==="auto")f=g;else if(k==="end"){let y=$==="fixed"?j:V.get(A)||X;f=g+y-x}else if(k==="center"){let y=$==="fixed"?j:V.get(A)||X;f=g-x/2+y/2}else f=g;N.scrollTop=Math.max(0,f),D()}function z(){return U()}function B(A){if($==="fixed")return j;return V.has(A)?V.get(A):X}function I(){if(N.removeEventListener("scroll",F,{passive:!0}),Q.textContent="",H.parentNode===N)N.removeChild(H);if(Q.parentNode===N)N.removeChild(Q);V.clear()}return{refresh:K,setTotal:O,scrollTo:M,visibleRange:z,measure:B,dispose:I}}return{create:S}}};var JJ={name:"themeTokens",version:"1.1.0",type:"fw.dom.rendering",dependencies:["dom","styleSheet"],deps:[F$,E$],factory(E,S){let T=0,Z={neutral:{"color-bg":{light:"#ffffff",dark:"#0b0b0d",highContrast:"#000000"},"color-fg":{light:"#1a1a1a",dark:"#f2f2f2",highContrast:"#ffffff"},"color-muted":{light:"#6b7280",dark:"#9ca3af",highContrast:"#cccccc"},"color-accent":{light:"#2563eb",dark:"#60a5fa",highContrast:"#ffff00"},"color-danger":{light:"#dc2626",dark:"#f87171",highContrast:"#ff6b6b"},"color-success":{light:"#16a34a",dark:"#4ade80",highContrast:"#00ff7f"},"color-border":{light:"#e5e7eb",dark:"#27272a",highContrast:"#ffffff"},"space-1":"4px","space-2":"8px","space-3":"12px","space-4":"16px","space-6":"24px","space-8":"32px","radius-sm":"4px","radius-md":"8px","radius-lg":"16px","font-sans":"system-ui, -apple-system, sans-serif","font-mono":"ui-monospace, Menlo, Consolas, monospace","duration-fast":{default:"120ms",reducedMotion:"0ms"},"duration-base":{default:"240ms",reducedMotion:"0ms"},"duration-slow":{default:"480ms",reducedMotion:"0ms"},"easing-standard":"cubic-bezier(.2,0,0,1)"},material:{"color-bg":{light:"#fffbfe",dark:"#1c1b1f",highContrast:"#000000"},"color-fg":{light:"#1c1b1f",dark:"#e6e1e5",highContrast:"#ffffff"},"color-surface":{light:"#f7f2fa",dark:"#2b292d"},"color-primary":{light:"#6750a4",dark:"#d0bcff",highContrast:"#ffff00"},"color-on-primary":{light:"#ffffff",dark:"#371e73"},"color-secondary":{light:"#625b71",dark:"#ccc2dc"},"color-error":{light:"#b3261e",dark:"#f2b8b5"},"color-outline":{light:"#79747e",dark:"#938f99"},"space-1":"4px","space-2":"8px","space-3":"12px","space-4":"16px","space-6":"24px","radius-sm":"4px","radius-md":"12px","radius-lg":"28px","font-sans":"Roboto, system-ui, sans-serif","font-mono":"Roboto Mono, ui-monospace, monospace","elevation-1":"0 1px 2px rgba(0,0,0,.30), 0 1px 3px 1px rgba(0,0,0,.15)","elevation-2":"0 1px 2px rgba(0,0,0,.30), 0 2px 6px 2px rgba(0,0,0,.15)","duration-fast":{default:"150ms",reducedMotion:"0ms"},"duration-base":{default:"250ms",reducedMotion:"0ms"},"duration-slow":{default:"400ms",reducedMotion:"0ms"},"easing-standard":"cubic-bezier(.2,0,0,1)","easing-emphasized":"cubic-bezier(.2,0,0,1)"},tailwind:{"color-bg":{light:"#ffffff",dark:"#0f172a",highContrast:"#000000"},"color-fg":{light:"#0f172a",dark:"#f1f5f9",highContrast:"#ffffff"},"color-muted":{light:"#64748b",dark:"#94a3b8",highContrast:"#cccccc"},"color-accent":{light:"#3b82f6",dark:"#60a5fa",highContrast:"#ffff00"},"color-danger":{light:"#ef4444",dark:"#f87171"},"color-success":{light:"#22c55e",dark:"#4ade80"},"color-warning":{light:"#eab308",dark:"#facc15"},"color-border":{light:"#e2e8f0",dark:"#1e293b",highContrast:"#ffffff"},"space-1":"0.25rem","space-2":"0.5rem","space-3":"0.75rem","space-4":"1rem","space-6":"1.5rem","space-8":"2rem","radius-sm":"0.125rem","radius-md":"0.375rem","radius-lg":"0.5rem","radius-xl":"0.75rem","font-sans":"ui-sans-serif, system-ui, sans-serif","font-mono":"ui-monospace, SFMono-Regular, Menlo, monospace","shadow-sm":"0 1px 2px 0 rgb(0 0 0 / .05)","shadow-md":"0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1)","duration-fast":{default:"150ms",reducedMotion:"0ms"},"duration-base":{default:"200ms",reducedMotion:"0ms"},"duration-slow":{default:"300ms",reducedMotion:"0ms"},"easing-standard":"cubic-bezier(.4,0,.2,1)"}};function q($={}){let V=$.prefix??"",X=$.scope??":root",H=`data-fw-theme-tokens-${++T}`,Q=!1,L=null,Y={},G="auto",J="light",U=!1,W=new Set,C=null,P=null,D=null,F=null,K=null,O=null,M=null,z=null;function B(){if(G==="high-contrast")return"high-contrast";let m=F?F.matches:!1,c=P?P.matches:!1,o=C?C.matches:!1;if(m||c)return"high-contrast";if(G==="dark")return"dark";if(G==="light")return"light";return o?"dark":"light"}function I(m,c,o){if(typeof m==="string"||typeof m==="number")return String(m);if(o&&m.reducedMotion!==void 0)return String(m.reducedMotion);if(c==="high-contrast"&&m.highContrast!==void 0)return String(m.highContrast);if(c==="dark"&&m.dark!==void 0)return String(m.dark);if(c==="light"&&m.light!==void 0)return String(m.light);if(m.default!==void 0)return String(m.default);if(c==="high-contrast"){if(m.dark!==void 0)return String(m.dark);if(m.light!==void 0)return String(m.light)}return}function A(){if(X instanceof Element)return{selector:":root",element:document.documentElement};let m=X||":root",c;try{c=document.querySelector(m)}catch{c=null}if(!c)c=document.documentElement;return{selector:m,element:c}}function w(){let m=[];for(let[o,$$]of Object.entries(Y)){let e=I($$,J,U);if(e!==void 0)m.push(` --${V}${o}: ${e};`)}let{selector:c}=A();return m.length?`${c} {
56
+ ${m.join(`
54
57
  `)}
55
- }`:""}function I(){let y=document.getElementById(Q);if(!y)y=document.createElement("style"),y.id=Q,document.head.appendChild(y);return y}function g(){let y=E(),c=I();c.textContent=y}function k(){let y=B(),c=C?C.matches:!1,l=y!==L||c!==W;if(L=y,W=c,g(),l){let h={mode:F,resolved:L,reducedMotion:W};for(let m of K)m(h)}}function w(){if(z&&P)z.removeEventListener("change",P);if(O&&$)O.removeEventListener("change",$);if(C&&X)C.removeEventListener("change",X);if(q&&V)q.removeEventListener("change",V);z=window.matchMedia("(prefers-color-scheme: dark)"),O=window.matchMedia("(prefers-contrast: more)"),C=window.matchMedia("(prefers-reduced-motion: reduce)"),q=window.matchMedia("(forced-colors: active)"),P=()=>k(),$=()=>k(),X=()=>k(),V=()=>k(),z.addEventListener("change",P),O.addEventListener("change",$),C.addEventListener("change",X),q.addEventListener("change",V)}w(),L=B(),W=C?C.matches:!1;function f(y){if(G)return;for(let[c,l]of Object.entries(y))Y[c]=l;g()}function x(y){if(!["light","dark","auto","high-contrast"].includes(y))throw Error(`themeTokens: invalid mode "${y}"`);if(G)return;F=y,L=B(),W=C?C.matches:!1,g();let c={mode:F,resolved:L,reducedMotion:W};for(let l of K)l(c)}function u(){return{mode:F,resolved:L,reducedMotion:W}}function v(y){if(G)return"";let{element:c}=S(),l=H instanceof Element?H:c;return getComputedStyle(l).getPropertyValue(`--${Z}${y}`).trim()}function d(y){if(G)return()=>{};return K.add(y),()=>K.delete(y)}function o(){if(G)return;if(G=!0,z&&P)z.removeEventListener("change",P);if(O&&$)O.removeEventListener("change",$);if(C&&X)C.removeEventListener("change",X);if(q&&V)q.removeEventListener("change",V);z=O=C=q=null,P=$=X=V=null,K.clear();let y=document.getElementById(Q);if(y)y.remove()}function _(y){if(G)return;let c=typeof y==="string"?R[y]:y;if(!c)throw Error(`themeTokens.applyPreset: unknown preset '${y}'`);f(c)}return{define:f,mode:x,current:u,get:v,onChange:d,dispose:o,applyPreset:_}}return{create:J,presets:R}}};var l$={name:"stats",version:"1.0.0",type:"fw.io.math",dependencies:[],factory(){function T($){if(!$||$.length===0)throw Error("stats: empty array");for(let X=0;X<$.length;X++)if(typeof $[X]!=="number"||Number.isNaN($[X]))throw Error("stats: NaN in input")}function j($){T($);let X=0;for(let V=0;V<$.length;V++)X+=$[V];return X}function N($){T($);let X=1;for(let V=0;V<$.length;V++)X*=$[V];return X}function M($){T($);let X=0;for(let V=0;V<$.length;V++)X+=$[V];return X/$.length}function D($){T($);let X=$[0];for(let V=1;V<$.length;V++)if($[V]<X)X=$[V];return X}function R($){T($);let X=$[0];for(let V=1;V<$.length;V++)if($[V]>X)X=$[V];return X}function J($){return R($)-D($)}function U($){return[...$].sort((X,V)=>X-V)}function Z($){T($);let X=U($),V=X.length,B=Math.floor(V/2);return V%2===0?(X[B-1]+X[B])/2:X[B]}function H($){T($);let X=new Map;for(let A of $)X.set(A,(X.get(A)??0)+1);let V=$[0],B=0;for(let[A,S]of X)if(S>B)V=A,B=S;return V}function Q($){T($);let X=0;for(let V of $)X+=Math.log(V);return Math.exp(X/$.length)}function G($){T($);let X=0;for(let V of $)X+=1/V;return $.length/X}function Y($,X=!1){T($);let V=M($),B=0;for(let A of $)B+=(A-V)**2;return B/(X?$.length-1:$.length)}function F($,X=!1){return Math.sqrt(Y($,X))}function L($,X){if(T($),X<0||X>1)throw Error("stats: q must be in [0, 1]");let V=U($),B=V.length;if(B===1)return V[0];let A=X*(B-1),S=Math.floor(A),E=Math.ceil(A);if(S===E)return V[S];return V[S]+(A-S)*(V[E]-V[S])}function W($,X){return L($,X/100)}function K($){return L($,0.75)-L($,0.25)}function z($){T($);let X=Z($),V=$.map((B)=>Math.abs(B-X));return Z(V)}function O($,X){T($);let V=D($),B=R($),A;if(Array.isArray(X))A=X;else{let E=typeof X==="number"?X:10,I=(B-V)/E;A=[];for(let g=0;g<=E;g++)A.push(V+g*I)}let S=Array(A.length-1).fill(0);for(let E of $)for(let I=0;I<A.length-1;I++)if(E>=A[I]&&(E<A[I+1]||I===A.length-2&&E<=A[I+1])){S[I]++;break}return{edges:A,counts:S}}function C($,X){let V=M(X),B=F(X);if(B===0)return 0;return($-V)/B}function q($,{min:X=0,max:V=1}={}){T($);let B=D($),S=R($)-B;if(S===0)return Array.from($,()=>X);return Array.from($,(E)=>X+(E-B)/S*(V-X))}function P($){let X=M($),V=F($);if(V===0)return Array.from($,()=>0);return Array.from($,(B)=>(B-X)/V)}return{mean:M,median:Z,mode:H,geomean:Q,harmean:G,variance:Y,stddev:F,range:J,iqr:K,mad:z,min:D,max:R,sum:j,product:N,quantile:L,percentile:W,histogram:O,zscore:C,normalize:q,standardize:P}}};var S$={name:"linalg",version:"1.0.0",type:"fw.io.math",dependencies:[],factory(){let j={create(J){let U=new Float32Array(2);if(J)U[0]=J[0],U[1]=J[1];return U},copy(J,U){return J[0]=U[0],J[1]=U[1],J},set(J,U,Z){return J[0]=U,J[1]=Z,J},add(J,U,Z){return J[0]=U[0]+Z[0],J[1]=U[1]+Z[1],J},sub(J,U,Z){return J[0]=U[0]-Z[0],J[1]=U[1]-Z[1],J},mul(J,U,Z){return J[0]=U[0]*Z[0],J[1]=U[1]*Z[1],J},scale(J,U,Z){return J[0]=U[0]*Z,J[1]=U[1]*Z,J},dot(J,U){return J[0]*U[0]+J[1]*U[1]},length(J){return Math.sqrt(J[0]*J[0]+J[1]*J[1])},lengthSq(J){return J[0]*J[0]+J[1]*J[1]},normalize(J,U){let Z=Math.sqrt(U[0]*U[0]+U[1]*U[1])||1;return J[0]=U[0]/Z,J[1]=U[1]/Z,J},distance(J,U){let Z=J[0]-U[0],H=J[1]-U[1];return Math.sqrt(Z*Z+H*H)},lerp(J,U,Z,H){return J[0]=U[0]+(Z[0]-U[0])*H,J[1]=U[1]+(Z[1]-U[1])*H,J},equals(J,U,Z=0.000001){return Math.abs(J[0]-U[0])<=Z&&Math.abs(J[1]-U[1])<=Z}},N={create(J){let U=new Float32Array(3);if(J)U[0]=J[0],U[1]=J[1],U[2]=J[2];return U},copy(J,U){return J[0]=U[0],J[1]=U[1],J[2]=U[2],J},set(J,U,Z,H){return J[0]=U,J[1]=Z,J[2]=H,J},add(J,U,Z){return J[0]=U[0]+Z[0],J[1]=U[1]+Z[1],J[2]=U[2]+Z[2],J},sub(J,U,Z){return J[0]=U[0]-Z[0],J[1]=U[1]-Z[1],J[2]=U[2]-Z[2],J},mul(J,U,Z){return J[0]=U[0]*Z[0],J[1]=U[1]*Z[1],J[2]=U[2]*Z[2],J},scale(J,U,Z){return J[0]=U[0]*Z,J[1]=U[1]*Z,J[2]=U[2]*Z,J},dot(J,U){return J[0]*U[0]+J[1]*U[1]+J[2]*U[2]},cross(J,U,Z){let H=U[0],Q=U[1],G=U[2],Y=Z[0],F=Z[1],L=Z[2];return J[0]=Q*L-G*F,J[1]=G*Y-H*L,J[2]=H*F-Q*Y,J},length(J){return Math.sqrt(J[0]*J[0]+J[1]*J[1]+J[2]*J[2])},lengthSq(J){return J[0]*J[0]+J[1]*J[1]+J[2]*J[2]},normalize(J,U){let Z=Math.sqrt(U[0]*U[0]+U[1]*U[1]+U[2]*U[2])||1;return J[0]=U[0]/Z,J[1]=U[1]/Z,J[2]=U[2]/Z,J},distance(J,U){let Z=J[0]-U[0],H=J[1]-U[1],Q=J[2]-U[2];return Math.sqrt(Z*Z+H*H+Q*Q)},lerp(J,U,Z,H){return J[0]=U[0]+(Z[0]-U[0])*H,J[1]=U[1]+(Z[1]-U[1])*H,J[2]=U[2]+(Z[2]-U[2])*H,J},equals(J,U,Z=0.000001){return Math.abs(J[0]-U[0])<=Z&&Math.abs(J[1]-U[1])<=Z&&Math.abs(J[2]-U[2])<=Z}},M={create(J){let U=new Float32Array(4);if(J)U[0]=J[0],U[1]=J[1],U[2]=J[2],U[3]=J[3];return U},copy(J,U){return J[0]=U[0],J[1]=U[1],J[2]=U[2],J[3]=U[3],J},set(J,U,Z,H,Q){return J[0]=U,J[1]=Z,J[2]=H,J[3]=Q,J},add(J,U,Z){return J[0]=U[0]+Z[0],J[1]=U[1]+Z[1],J[2]=U[2]+Z[2],J[3]=U[3]+Z[3],J},sub(J,U,Z){return J[0]=U[0]-Z[0],J[1]=U[1]-Z[1],J[2]=U[2]-Z[2],J[3]=U[3]-Z[3],J},mul(J,U,Z){return J[0]=U[0]*Z[0],J[1]=U[1]*Z[1],J[2]=U[2]*Z[2],J[3]=U[3]*Z[3],J},scale(J,U,Z){return J[0]=U[0]*Z,J[1]=U[1]*Z,J[2]=U[2]*Z,J[3]=U[3]*Z,J},dot(J,U){return J[0]*U[0]+J[1]*U[1]+J[2]*U[2]+J[3]*U[3]},length(J){return Math.sqrt(J[0]*J[0]+J[1]*J[1]+J[2]*J[2]+J[3]*J[3])},lengthSq(J){return J[0]*J[0]+J[1]*J[1]+J[2]*J[2]+J[3]*J[3]},normalize(J,U){let Z=Math.sqrt(U[0]*U[0]+U[1]*U[1]+U[2]*U[2]+U[3]*U[3])||1;return J[0]=U[0]/Z,J[1]=U[1]/Z,J[2]=U[2]/Z,J[3]=U[3]/Z,J},distance(J,U){let Z=J[0]-U[0],H=J[1]-U[1],Q=J[2]-U[2],G=J[3]-U[3];return Math.sqrt(Z*Z+H*H+Q*Q+G*G)},lerp(J,U,Z,H){return J[0]=U[0]+(Z[0]-U[0])*H,J[1]=U[1]+(Z[1]-U[1])*H,J[2]=U[2]+(Z[2]-U[2])*H,J[3]=U[3]+(Z[3]-U[3])*H,J},equals(J,U,Z=0.000001){return Math.abs(J[0]-U[0])<=Z&&Math.abs(J[1]-U[1])<=Z&&Math.abs(J[2]-U[2])<=Z&&Math.abs(J[3]-U[3])<=Z}},D={create(){let J=new Float32Array(9);return J[0]=1,J[4]=1,J[8]=1,J},identity(J){return J.fill(0),J[0]=1,J[4]=1,J[8]=1,J},copy(J,U){for(let Z=0;Z<9;Z++)J[Z]=U[Z];return J},multiply(J,U,Z){let[H,Q,G,Y,F,L,W,K,z]=U,[O,C,q,P,$,X,V,B,A]=Z;return J[0]=H*O+Y*C+W*q,J[1]=Q*O+F*C+K*q,J[2]=G*O+L*C+z*q,J[3]=H*P+Y*$+W*X,J[4]=Q*P+F*$+K*X,J[5]=G*P+L*$+z*X,J[6]=H*V+Y*B+W*A,J[7]=Q*V+F*B+K*A,J[8]=G*V+L*B+z*A,J},translate(J,U,Z){let[H,Q,G,Y,F,L,W,K,z]=U,O=Z[0],C=Z[1];return J[0]=H,J[1]=Q,J[2]=G,J[3]=Y,J[4]=F,J[5]=L,J[6]=H*O+Y*C+W,J[7]=Q*O+F*C+K,J[8]=G*O+L*C+z,J},rotate(J,U,Z){let H=Math.cos(Z),Q=Math.sin(Z),[G,Y,F,L,W,K,z,O,C]=U;return J[0]=G*H+L*Q,J[1]=Y*H+W*Q,J[2]=F*H+K*Q,J[3]=L*H-G*Q,J[4]=W*H-Y*Q,J[5]=K*H-F*Q,J[6]=z,J[7]=O,J[8]=C,J},scale(J,U,Z){let H=Z[0],Q=Z[1],[G,Y,F,L,W,K,z,O,C]=U;return J[0]=G*H,J[1]=Y*H,J[2]=F*H,J[3]=L*Q,J[4]=W*Q,J[5]=K*Q,J[6]=z,J[7]=O,J[8]=C,J},determinant(J){let[U,Z,H,Q,G,Y,F,L,W]=J;return U*(G*W-Y*L)-Q*(Z*W-H*L)+F*(Z*Y-H*G)},invert(J,U){let Z=D.determinant(U);if(Math.abs(Z)<0.0000000001)return!1;let H=1/Z,[Q,G,Y,F,L,W,K,z,O]=U;return J[0]=(L*O-W*z)*H,J[1]=(Y*z-G*O)*H,J[2]=(G*W-Y*L)*H,J[3]=(W*K-F*O)*H,J[4]=(Q*O-Y*K)*H,J[5]=(Y*F-Q*W)*H,J[6]=(F*z-L*K)*H,J[7]=(G*K-Q*z)*H,J[8]=(Q*L-G*F)*H,!0},transpose(J,U){return J[0]=U[0],J[1]=U[3],J[2]=U[6],J[3]=U[1],J[4]=U[4],J[5]=U[7],J[6]=U[2],J[7]=U[5],J[8]=U[8],J},transform(J,U,Z){let H=Z[0],Q=Z[1];return J[0]=U[0]*H+U[3]*Q+U[6],J[1]=U[1]*H+U[4]*Q+U[7],J}};return{vec2:j,vec3:N,vec4:M,mat3:D,mat4:{create(){let J=new Float32Array(16);return J[0]=1,J[5]=1,J[10]=1,J[15]=1,J},identity(J){return J.fill(0),J[0]=1,J[5]=1,J[10]=1,J[15]=1,J},copy(J,U){for(let Z=0;Z<16;Z++)J[Z]=U[Z];return J},multiply(J,U,Z){let H=U[0],Q=U[1],G=U[2],Y=U[3],F=U[4],L=U[5],W=U[6],K=U[7],z=U[8],O=U[9],C=U[10],q=U[11],P=U[12],$=U[13],X=U[14],V=U[15],B=Z[0],A=Z[1],S=Z[2],E=Z[3];return J[0]=H*B+F*A+z*S+P*E,J[1]=Q*B+L*A+O*S+$*E,J[2]=G*B+W*A+C*S+X*E,J[3]=Y*B+K*A+q*S+V*E,B=Z[4],A=Z[5],S=Z[6],E=Z[7],J[4]=H*B+F*A+z*S+P*E,J[5]=Q*B+L*A+O*S+$*E,J[6]=G*B+W*A+C*S+X*E,J[7]=Y*B+K*A+q*S+V*E,B=Z[8],A=Z[9],S=Z[10],E=Z[11],J[8]=H*B+F*A+z*S+P*E,J[9]=Q*B+L*A+O*S+$*E,J[10]=G*B+W*A+C*S+X*E,J[11]=Y*B+K*A+q*S+V*E,B=Z[12],A=Z[13],S=Z[14],E=Z[15],J[12]=H*B+F*A+z*S+P*E,J[13]=Q*B+L*A+O*S+$*E,J[14]=G*B+W*A+C*S+X*E,J[15]=Y*B+K*A+q*S+V*E,J},translate(J,U,Z){let H=Z[0],Q=Z[1],G=Z[2];if(J!==U)for(let Y=0;Y<16;Y++)J[Y]=U[Y];return J[12]=U[0]*H+U[4]*Q+U[8]*G+U[12],J[13]=U[1]*H+U[5]*Q+U[9]*G+U[13],J[14]=U[2]*H+U[6]*Q+U[10]*G+U[14],J[15]=U[3]*H+U[7]*Q+U[11]*G+U[15],J},rotate(J,U,Z,H){let Q=H[0],G=H[1],Y=H[2],F=Math.sqrt(Q*Q+G*G+Y*Y)||1;Q/=F,G/=F,Y/=F;let L=Math.cos(Z),W=Math.sin(Z),K=1-L,z=Q*Q*K+L,O=G*Q*K+Y*W,C=Y*Q*K-G*W,q=Q*G*K-Y*W,P=G*G*K+L,$=Y*G*K+Q*W,X=Q*Y*K+G*W,V=G*Y*K-Q*W,B=Y*Y*K+L,[A,S,E,I,g,k,w,f,x,u,v,d]=U;if(J[0]=A*z+g*O+x*C,J[1]=S*z+k*O+u*C,J[2]=E*z+w*O+v*C,J[3]=I*z+f*O+d*C,J[4]=A*q+g*P+x*$,J[5]=S*q+k*P+u*$,J[6]=E*q+w*P+v*$,J[7]=I*q+f*P+d*$,J[8]=A*X+g*V+x*B,J[9]=S*X+k*V+u*B,J[10]=E*X+w*V+v*B,J[11]=I*X+f*V+d*B,J!==U)J[12]=U[12],J[13]=U[13],J[14]=U[14],J[15]=U[15];return J},scale(J,U,Z){let H=Z[0],Q=Z[1],G=Z[2];return J[0]=U[0]*H,J[1]=U[1]*H,J[2]=U[2]*H,J[3]=U[3]*H,J[4]=U[4]*Q,J[5]=U[5]*Q,J[6]=U[6]*Q,J[7]=U[7]*Q,J[8]=U[8]*G,J[9]=U[9]*G,J[10]=U[10]*G,J[11]=U[11]*G,J[12]=U[12],J[13]=U[13],J[14]=U[14],J[15]=U[15],J},invert(J,U){let[Z,H,Q,G,Y,F,L,W,K,z,O,C,q,P,$,X]=U,V=Z*F-H*Y,B=Z*L-Q*Y,A=Z*W-G*Y,S=H*L-Q*F,E=H*W-G*F,I=Q*W-G*L,g=K*P-z*q,k=K*$-O*q,w=K*X-C*q,f=z*$-O*P,x=z*X-C*P,u=O*X-C*$,v=V*u-B*x+A*f+S*w-E*k+I*g;if(!v)return!1;return v=1/v,J[0]=(F*u-L*x+W*f)*v,J[1]=(Q*x-H*u-G*f)*v,J[2]=(P*I-$*E+X*S)*v,J[3]=(O*E-z*I-C*S)*v,J[4]=(L*w-Y*u-W*k)*v,J[5]=(Z*u-Q*w+G*k)*v,J[6]=($*A-q*I-X*B)*v,J[7]=(K*I-O*A+C*B)*v,J[8]=(Y*x-F*w+W*g)*v,J[9]=(H*w-Z*x-G*g)*v,J[10]=(q*E-P*A+X*V)*v,J[11]=(z*A-K*E-C*V)*v,J[12]=(F*k-Y*f-L*g)*v,J[13]=(Z*f-H*k+Q*g)*v,J[14]=(P*B-q*S-$*V)*v,J[15]=(K*S-z*B+O*V)*v,!0},transpose(J,U){if(J===U){let Z;Z=U[1],J[1]=U[4],J[4]=Z,Z=U[2],J[2]=U[8],J[8]=Z,Z=U[3],J[3]=U[12],J[12]=Z,Z=U[6],J[6]=U[9],J[9]=Z,Z=U[7],J[7]=U[13],J[13]=Z,Z=U[11],J[11]=U[14],J[14]=Z}else J[0]=U[0],J[1]=U[4],J[2]=U[8],J[3]=U[12],J[4]=U[1],J[5]=U[5],J[6]=U[9],J[7]=U[13],J[8]=U[2],J[9]=U[6],J[10]=U[10],J[11]=U[14],J[12]=U[3],J[13]=U[7],J[14]=U[11],J[15]=U[15];return J},perspective(J,U,Z,H,Q){let G=1/Math.tan(U/2),Y=1/(H-Q);return J.fill(0),J[0]=G/Z,J[5]=G,J[10]=(Q+H)*Y,J[11]=-1,J[14]=2*Q*H*Y,J},ortho(J,U,Z,H,Q,G,Y){let F=1/(U-Z),L=1/(H-Q),W=1/(G-Y);return J[0]=-2*F,J[1]=0,J[2]=0,J[3]=0,J[4]=0,J[5]=-2*L,J[6]=0,J[7]=0,J[8]=0,J[9]=0,J[10]=2*W,J[11]=0,J[12]=(U+Z)*F,J[13]=(Q+H)*L,J[14]=(Y+G)*W,J[15]=1,J},lookAt(J,U,Z,H){let Q=U[0],G=U[1],Y=U[2],F=Z[0],L=Z[1],W=Z[2],K=Q-F,z=G-L,O=Y-W,C=Math.sqrt(K*K+z*z+O*O)||1;K/=C,z/=C,O/=C;let q=H[1]*O-H[2]*z,P=H[2]*K-H[0]*O,$=H[0]*z-H[1]*K,X=Math.sqrt(q*q+P*P+$*$)||1;q/=X,P/=X,$/=X;let V=z*$-O*P,B=O*q-K*$,A=K*P-z*q;return J[0]=q,J[1]=V,J[2]=K,J[3]=0,J[4]=P,J[5]=B,J[6]=z,J[7]=0,J[8]=$,J[9]=A,J[10]=O,J[11]=0,J[12]=-(q*Q+P*G+$*Y),J[13]=-(V*Q+B*G+A*Y),J[14]=-(K*Q+z*G+O*Y),J[15]=1,J},transform(J,U,Z){let H=Z[0],Q=Z[1],G=Z[2],Y=U[3]*H+U[7]*Q+U[11]*G+U[15]||1;return J[0]=(U[0]*H+U[4]*Q+U[8]*G+U[12])/Y,J[1]=(U[1]*H+U[5]*Q+U[9]*G+U[13])/Y,J[2]=(U[2]*H+U[6]*Q+U[10]*G+U[14])/Y,J},transform4(J,U,Z){let H=Z[0],Q=Z[1],G=Z[2],Y=Z[3];return J[0]=U[0]*H+U[4]*Q+U[8]*G+U[12]*Y,J[1]=U[1]*H+U[5]*Q+U[9]*G+U[13]*Y,J[2]=U[2]*H+U[6]*Q+U[10]*G+U[14]*Y,J[3]=U[3]*H+U[7]*Q+U[11]*G+U[15]*Y,J}}}}};var nZ={name:"chart",version:"1.0.0",type:"fw.dom.rendering",dependencies:["dom","animate","stats","linalg"],deps:[H$,_$,l$,S$],factory(T,j,N,M){function D($){if(!Array.isArray($)||$.length===0)return[];if(typeof $[0]==="number")return $.map((X,V)=>({x:V,y:X}));return $.map((X)=>({x:Number(X.x),y:Number(X.y)}))}function R($){if(!$.length)return[0,1];let X=N.min($),V=N.max($);if(X===V)return[X-1,V+1];return[X,V]}function J($,X){if(X&&X.length===2)return[X[0],X[1]];let[V,B]=R($),A=(B-V)*0.05;return[V-A,B+A]}function U($,X,V=5){let B=(X-$)/(V-1||1),A=[];for(let S=0;S<V;S++)A.push($+B*S);return A}function Z($,X,V,B){if(V===X)return B/2;return($-X)/(V-X)*B}function H($,X){let V=$.length;if(V<2)return 0;if(X===0)return($[1].y-$[0].y)/($[1].x-$[0].x||1);if(X===V-1)return($[V-1].y-$[V-2].y)/($[V-1].x-$[V-2].x||1);let B=($[X].y-$[X-1].y)/($[X].x-$[X-1].x||1),A=($[X+1].y-$[X].y)/($[X+1].x-$[X].x||1);if(B*A<=0)return 0;let S=(B+A)/2;return Math.sign(S)*Math.min(Math.abs(S),3*Math.min(Math.abs(B),Math.abs(A)))}function Q($){if($&&$.tagName==="CANVAS")return $;let X=document.createElement("canvas");return $.appendChild(X),X}function G($,X,V){let B=(typeof devicePixelRatio==="number"?devicePixelRatio:1)||1;$.width=Math.round(X*B),$.height=Math.round(V*B),$.style.width=X+"px",$.style.height=V+"px";let A=$.getContext("2d");if(A)A.scale(B,B);return A}function Y($){let X=$.clientWidth||$.width||300,V=$.clientHeight||$.height||150;return{w:X,h:V}}let F={top:10,right:10,bottom:30,left:40};function L($,X,V,B,A,S,E,I){let{w:g,h:k}=X,w=F.left,f=F.right,x=F.top,u=F.bottom,v=g-w-f,d=k-x-u;$.save(),$.strokeStyle="#888",$.fillStyle="#888",$.lineWidth=1,$.font="10px sans-serif",$.textAlign="right",$.textBaseline="middle";let o=I&&I.ticks||U(A,S,5),_=I&&I.format||((l)=>String(Math.round(l*100)/100));for(let l of o){let h=x+d-Z(l,A,S,d);$.beginPath(),$.moveTo(w-4,h),$.lineTo(w,h),$.stroke(),$.fillText(_(l),w-6,h)}let y=E&&E.ticks||U(V,B,5),c=E&&E.format||((l)=>String(Math.round(l*100)/100));$.textAlign="center",$.textBaseline="top";for(let l of y){let h=w+Z(l,V,B,v);$.beginPath(),$.moveTo(h,x+d),$.lineTo(h,x+d+4),$.stroke(),$.fillText(c(l),h,x+d+6)}$.beginPath(),$.moveTo(w,x),$.lineTo(w,x+d),$.lineTo(w+v,x+d),$.stroke(),$.restore()}function W($,X,V,B,A,S,E,I,g,k){if(!V.length)return;let{w,h:f}=X,x=F.left,u=F.right,v=F.top,d=F.bottom,o=w-x-u,_=f-v-d;$.save(),$.beginPath();let y=(m)=>x+Z(m,B,A,o),c=(m)=>v+_-Z(m,S,E,_),l=y(V[0].x),h=c(V[0].y);if($.moveTo(l,h),g==="monotone"&&V.length>2)for(let m=0;m<V.length-1;m++){let b=y(V[m].x+(V[m+1].x-V[m].x)/3),p=c(V[m].y+H(V,m)*(V[m+1].x-V[m].x)/3),i=y(V[m+1].x-(V[m+1].x-V[m].x)/3),e=c(V[m+1].y-H(V,m+1)*(V[m+1].x-V[m].x)/3);$.bezierCurveTo(b,p,i,e,y(V[m+1].x),c(V[m+1].y))}else for(let m=1;m<V.length;m++)$.lineTo(y(V[m].x),c(V[m].y));if(k){let m=v+_;if($.lineTo(y(V[V.length-1].x),m),$.lineTo(y(V[0].x),m),$.closePath(),$.fillStyle=I+"33",$.fill(),$.beginPath(),$.moveTo(l,h),g==="monotone"&&V.length>2)for(let b=0;b<V.length-1;b++){let p=y(V[b].x+(V[b+1].x-V[b].x)/3),i=c(V[b].y+H(V,b)*(V[b+1].x-V[b].x)/3),e=y(V[b+1].x-(V[b+1].x-V[b].x)/3),J$=c(V[b+1].y-H(V,b+1)*(V[b+1].x-V[b].x)/3);$.bezierCurveTo(p,i,e,J$,y(V[b+1].x),c(V[b+1].y))}else for(let b=1;b<V.length;b++)$.lineTo(y(V[b].x),c(V[b].y))}$.strokeStyle=I,$.lineWidth=1.5,$.stroke(),$.restore()}function K($,X,V,B,A,S,E,I){if(!V.length)return;let{w:g,h:k}=X,w=F.left,f=F.right,x=F.top,u=F.bottom,v=g-w-f,d=k-x-u,o=(l)=>w+Z(l,B,A,v),_=(l)=>x+d-Z(l,S,E,d),y=Math.max(2,v/V.length*0.7),c=x+d;$.save(),$.fillStyle=I+"aa",$.strokeStyle=I,$.lineWidth=1;for(let l of V){let h=o(l.x)-y/2,m=_(l.y),b=c-m;if(b>0)$.fillRect(h,m,y,b),$.strokeRect(h,m,y,b)}$.restore()}function z($,X){let V=Object.assign({color:"#4a9eff",smoothing:"none",animate:!1},$),B=D(V.data||[]),A=Q(V.el),S=null,E=!1,I=null,g={data:B,xDomain:[0,1],yDomain:[0,1]};function k(){let _=B.map((c)=>c.x),y=B.map((c)=>c.y);g.xDomain=J(_,V.xAxis&&V.xAxis.domain),g.yDomain=J(y,V.yAxis&&V.yAxis.domain)}function w(){if(E)return;k();let{w:_,h:y}=Y(A),c=G(A,_,y);if(!c)return;c.clearRect(0,0,_,y);let[l,h]=g.xDomain,[m,b]=g.yDomain;if(X!=="bar")L(c,{w:_,h:y},l,h,m,b,V.xAxis,V.yAxis),W(c,{w:_,h:y},B,l,h,m,b,V.color,V.smoothing||"none",X==="area");else L(c,{w:_,h:y},l,h,m,b,V.xAxis,V.yAxis),K(c,{w:_,h:y},B,l,h,m,b,V.color)}function f(){if(E)return;if(I!==null)cancelAnimationFrame(I);let _=typeof V.animate==="number"?V.animate:300,{w:y,h:c}=Y(A),l=G(A,y,c);if(!l){w();return}let h={ts:null};function m(b){if(E)return;if(h.ts===null)h.ts=b;let p=b-h.ts,i=Math.min(p/_,1);if(l.globalAlpha=i,w(),l.globalAlpha=1,i<1)I=requestAnimationFrame(m);else I=null}I=requestAnimationFrame(m)}function x(){if(V.animate)f();else w()}if(V.el&&V.el.tagName!=="CANVAS"&&typeof ResizeObserver<"u")S=new ResizeObserver(()=>v()),S.observe(V.el);x();function u(_){B=D(_),g.data=B,x()}function v(){if(E)return;w()}function d(_){if(V=Object.assign(V,_),_.data!==void 0)B=D(_.data),g.data=B;x()}function o(){if(E=!0,S)S.disconnect(),S=null;if(I!==null)cancelAnimationFrame(I),I=null}return{update:u,resize:v,setOpts:d,dispose:o,_state:g}}function O($){return z($,"line")}function C($){return z($,"area")}function q($){return z($,"bar")}function P($){let X=Q($.el),V=D($.data||[]),B=Object.assign({color:"#4a9eff",smoothing:"none",animate:!1},$),A=null,S=!1,E={data:V,xDomain:[0,1],yDomain:[0,1]};function I(){if(S)return;let{w:x,h:u}=Y(X),v=G(X,x,u);if(!v)return;if(v.clearRect(0,0,x,u),!V.length)return;let d=V.map((b)=>b.x),o=V.map((b)=>b.y),[_,y]=J(d,void 0),[c,l]=J(o,void 0);E.xDomain=[_,y],E.yDomain=[c,l];let h=(b)=>Z(b,_,y,x),m=(b)=>u-Z(b,c,l,u);v.save(),v.beginPath(),v.moveTo(h(V[0].x),m(V[0].y));for(let b=1;b<V.length;b++)v.lineTo(h(V[b].x),m(V[b].y));v.strokeStyle=B.color,v.lineWidth=1.5,v.stroke(),v.restore()}if(B.el&&B.el.tagName!=="CANVAS"&&typeof ResizeObserver<"u")A=new ResizeObserver(()=>I()),A.observe(B.el);I();function g(x){V=D(x),E.data=V,I()}function k(){if(!S)I()}function w(x){if(B=Object.assign(B,x),x.data!==void 0)V=D(x.data),E.data=V;I()}function f(){if(S=!0,A)A.disconnect(),A=null}return{update:g,resize:k,setOpts:w,dispose:f,_state:E}}return{line:O,area:C,bar:q,sparkline:P}}};var oZ={name:"indexedDB",version:"1.0.0",type:"fw.dom.fs",dependencies:["broadcastChannel"],deps:[d$],factory(T){let j=globalThis.indexedDB;function N(R){return new Promise((J,U)=>{R.onsuccess=()=>J(R.result),R.onerror=()=>U(R.error)})}function M(R,J,U,Z){return new Promise((H,Q)=>{let G;try{G=R.transaction(J,U)}catch(Y){return Q(Y)}G.onerror=()=>Q(G.error),N(Z(G.objectStore(J))).then(H,Q)})}function D(R,J,U){return{get(Z){return M(R,J,"readonly",(H)=>H.get(Z))},set(Z,H){return M(R,J,"readwrite",(Q)=>Q.put(H,Z)).then((Q)=>{return U("set",Z),Q})},del(Z){return M(R,J,"readwrite",(H)=>H.delete(Z)).then((H)=>{return U("del",Z),H})},has(Z){return M(R,J,"readonly",(H)=>H.count(Z)).then((H)=>H>0)},clear(){return M(R,J,"readwrite",(Z)=>Z.clear()).then((Z)=>{return U("clear",null),Z})},count(Z){return M(R,J,"readonly",(H)=>H.count(Z))},getAll(Z,H){return M(R,J,"readonly",(Q)=>Q.getAll(Z,H))},getAllKeys(Z,H){return M(R,J,"readonly",(Q)=>Q.getAllKeys(Z,H))},each(Z){return new Promise((H,Q)=>{let G;try{G=R.transaction(J,"readonly")}catch(F){return Q(F)}G.onerror=()=>Q(G.error);let Y=G.objectStore(J).openCursor();Y.onsuccess=()=>{let F=Y.result;if(F&&Z(F.value,F.key)!==!1)F.continue();else H()},Y.onerror=()=>Q(Y.error)})}}}return{isSupported(){return!!j},open(R,J,U,Z){if(!j)return Promise.reject(Error("IndexedDB is not supported in this environment"));let H=Z&&Z.crossTab!==void 0?Z.crossTab:!0,Q=Z&&Z.namespace!==void 0?Z.namespace:"";if(typeof H!=="boolean")return Promise.reject(Error("indexedDB: crossTab must be a boolean"));if(typeof Q!=="string"||Q.includes(":"))return Promise.reject(Error('indexedDB: namespace must be a string without ":"'));let G=Q?`idb:${Q}:${R}`:`idb:${R}`;return new Promise((Y,F)=>{let L=j.open(R,J);L.onerror=()=>F(L.error),L.onupgradeneeded=(W)=>{if(typeof U==="function")U(L.result,W.oldVersion,W.newVersion)},L.onsuccess=()=>{let W=L.result;W.onversionchange=()=>W.close();let K=H&&T.isSupported()?T.create(G):null,z={map:[],list:{}};function O(q){for(let P=0;P<z.map.length;P++)z.list[z.map[P]](q)}if(K)K.on((q)=>O({...q,cross:!0}));function C(q,P,$){if(O({type:q,store:P,key:$,cross:!1}),K)K.post({type:q,store:P,key:$})}Y({store(q){return D(W,q,(P,$)=>C(P,q,$))},close(){if(K)K.close();W.close()},get name(){return W.name},get version(){return W.version},get storeNames(){return Array.from(W.objectStoreNames)},listen:{add(q,P){if(z.map.indexOf(q)<0)z.map.push(q);z.list[q]=P},del(q){let P=z.map.indexOf(q);if(P>-1)z.map.splice(P,1),delete z.list[q]}}})}})},drop(R){if(!j)return Promise.reject(Error("IndexedDB is not supported in this environment"));return new Promise((J,U)=>{let Z=j.deleteDatabase(R);Z.onsuccess=()=>J(),Z.onerror=()=>U(Z.error),Z.onblocked=()=>U(Error(`Cannot delete "${R}": other connections are still open. Close all tabs using this database and retry.`))})}}}};var rZ={name:"mutex",version:"1.0.0",type:"fw.io.sync",dependencies:[],factory(){function T(){let j=!1,N=[];function M(U){let Z=U&&U.signal;if(Z&&Z.aborted)return Promise.reject(Z.reason??Error("mutex: acquire aborted"));if(!j)return j=!0,Promise.resolve();return new Promise((H,Q)=>{let G={resolve:H,reject:Q};if(Z){let Y=()=>{let L=N.indexOf(G);if(L!==-1)N.splice(L,1);Q(Z.reason??Error("mutex: acquire aborted"))};G.signal=Z,G.onAbort=Y,Z.addEventListener("abort",Y,{once:!0});let F=H;G.resolve=()=>{Z.removeEventListener("abort",Y),F()}}N.push(G)})}function D(){if(!j)throw Error("mutex: release on unlocked");if(N.length>0)N.shift().resolve();else j=!1}function R(){if(j)return!1;return j=!0,!0}async function J(U,Z){await M(Z);try{return await U()}finally{D()}}return{acquire:M,release:D,tryAcquire:R,runExclusive:J,get locked(){return j}}}return{create:T}}};var sZ={name:"semaphore",version:"1.0.0",type:"fw.io.sync",dependencies:[],factory(){function T(j){if(!Number.isInteger(j)||j<1)throw Error("semaphore: capacity must be an integer >= 1");let N=j,M=j,D=[];function R(H){let Q=H&&H.signal;if(Q&&Q.aborted)return Promise.reject(Q.reason??Error("semaphore: acquire aborted"));if(M>0)return M--,Promise.resolve();return new Promise((G,Y)=>{let F={resolve:G,reject:Y};if(Q){let L=()=>{let K=D.indexOf(F);if(K!==-1)D.splice(K,1);Y(Q.reason??Error("semaphore: acquire aborted"))};F.signal=Q,F.onAbort=L,Q.addEventListener("abort",L,{once:!0});let W=G;F.resolve=()=>{Q.removeEventListener("abort",L),W()}}D.push(F)})}function J(){if(M>=N)throw Error("semaphore: release exceeds capacity");if(D.length>0)D.shift().resolve();else M++}function U(){if(M<=0)return!1;return M--,!0}async function Z(H,Q){await R(Q);try{return await H()}finally{J()}}return{acquire:R,release:J,tryAcquire:U,runExclusive:Z,get permits(){return M},get capacity(){return N}}}return{create:T}}};var aZ={name:"channel",version:"1.0.0",type:"fw.io.sync",dependencies:[],factory(){function T({capacity:j=0}={}){if(!Number.isInteger(j)||j<0)throw Error("channel: capacity must be a non-negative integer");let N=j,M=[],D=!1,R=[],J=[];function U(){while(M.length<N&&R.length>0){let W=R.shift();M.push(W.value),W.resolve()}}function Z(){while(J.length>0&&M.length>0){let W=J.shift(),K=M.shift();W.resolve({value:K,done:!1}),U()}}function H(W,K,z,O){let C=()=>{let $=K.indexOf(W);if($!==-1)K.splice($,1);W.reject?.(z.reason??Error(O))};W.signal=z,W.onAbort=C,z.addEventListener("abort",C,{once:!0});let q=W.resolve;W.resolve=($)=>{z.removeEventListener("abort",C),q($)};let P=W.reject;if(P)W.reject=($)=>{z.removeEventListener("abort",C),P($)}}function Q(W,K){if(D)return Promise.reject(Error("channel: send on closed"));let z=K&&K.signal;if(z&&z.aborted)return Promise.reject(z.reason??Error("channel: send aborted"));if(N===0){if(J.length>0)return J.shift().resolve({value:W,done:!1}),Promise.resolve();return new Promise((O,C)=>{let q={resolve:O,reject:C,value:W};if(z)H(q,R,z,"channel: send aborted");R.push(q)})}if(M.length<N)return M.push(W),Z(),Promise.resolve();return new Promise((O,C)=>{let q={resolve:O,reject:C,value:W};if(z)H(q,R,z,"channel: send aborted");R.push(q)})}function G(W){let K=W&&W.signal;if(K&&K.aborted)return Promise.reject(K.reason??Error("channel: recv aborted"));if(M.length>0){let z=M.shift();return U(),Promise.resolve({value:z,done:!1})}if(N===0&&R.length>0){let z=R.shift();return z.resolve(),Promise.resolve({value:z.value,done:!1})}if(D)return Promise.resolve({value:void 0,done:!0});return new Promise((z,O)=>{let C={resolve:z,reject:O};if(K)H(C,J,K,"channel: recv aborted");J.push(C)})}function Y(W){if(D)throw Error("channel: send on closed");if(N===0){if(J.length>0)return J.shift().resolve({value:W,done:!1}),!0;return!1}if(M.length<N)return M.push(W),Z(),!0;return!1}function F(){if(M.length>0){let W=M.shift();return U(),{value:W,done:!1}}if(N===0&&R.length>0){let W=R.shift();return W.resolve(),{value:W.value,done:!1}}if(D)return{value:void 0,done:!0};return{value:void 0,done:!1,empty:!0}}function L(){if(D)return;D=!0;for(let W of J)W.resolve({value:void 0,done:!0});J.length=0;for(let W of R)W.reject(Error("channel: closed during send"));R.length=0}return{send:Q,recv:G,trySend:Y,tryRecv:F,close:L,get closed(){return D},get capacity(){return N},get size(){return M.length},get pendingSenders(){return R.length},get pendingReceivers(){return J.length}}}return{create:T}}};var tZ={name:"cancellable",version:"1.0.0",type:"fw.io.sync",dependencies:["abort"],deps:[x$],factory(T){function j(J){if(typeof J!=="function")throw Error("cancellable: asyncFn must be a function");let U=new AbortController,Z=[],H=!1,Q=!1,G=!1;function Y(z){if(typeof z!=="function")throw Error("cancellable: onCancel requires a function");if(G){Promise.resolve().then(()=>{try{z()}catch(O){console.error(O)}});return}Z.push(z)}function F(){T.throwIfAborted(U.signal)}function L(){let z=Z.splice(0).reverse(),O=[];for(let C of z)try{let q=C();if(q&&typeof q.then==="function")O.push(q.catch((P)=>console.error(P)))}catch(q){console.error(q)}return Promise.all(O)}function W(z){if(Q||G)return Promise.resolve();if(G=!0,U.abort(T.error(z??"cancellable: cancelled")),!H)return Promise.resolve();return L()}async function K(){if(H)throw Error("cancellable: task already started");if(H=!0,G)throw Q=!0,U.signal.reason??T.error("cancellable: cancelled before run");try{let z=await J({signal:U.signal,onCancel:Y,throwIfAborted:F});return Q=!0,z}catch(z){throw Q=!0,z}}return{run:K,cancel:W,get cancelled(){return G},get done(){return Q},get signal(){return U.signal}}}function N(J){if(!J||typeof J.run!=="function"||typeof J.cancel!=="function")throw Error("cancellable: argument must be a task from cancellable.create")}function M(...J){if(J.length===0)throw Error("cancellable: race requires at least one task");for(let U of J)N(U);return new Promise((U,Z)=>{let H=!1;for(let Q of J)Q.run().then((G)=>{if(H)return;H=!0,U(G);for(let Y of J)if(Y!==Q)Y.cancel("cancellable: race lost")},(G)=>{if(H)return;H=!0,Z(G);for(let Y of J)if(Y!==Q)Y.cancel("cancellable: race lost")})})}function D(J){if(!Array.isArray(J)||J.length===0)throw Error("cancellable: all requires a non-empty array of tasks");for(let U of J)N(U);return new Promise((U,Z)=>{let H=Array(J.length),Q=0,G=!1;J.forEach((Y,F)=>{Y.run().then((L)=>{if(G)return;if(H[F]=L,++Q===J.length)U(H)},(L)=>{if(G)return;G=!0,Z(L);for(let W of J)W.cancel("cancellable: all failed")})})})}function R(J){let U=J&&typeof J.onError==="function"?J.onError:null,Z=new Set,H=!1;function Q(Y){if(N(Y),Y.done)throw Error("cancellable: cannot add a completed task to pool");H=!1,Z.add(Y),Y.run().then(()=>{Z.delete(Y)},(F)=>{if(Z.delete(Y),U)try{U(F,Y)}catch(L){console.error(L)}})}async function G(Y){let F=[];for(let L of Z)F.push(L.cancel(Y??"cancellable: pool cancelled"));await Promise.all(F),Z.clear(),H=!0}return{add:Q,cancelAll:G,get size(){return Z.size},get cleared(){return H}}}return{create:j,race:M,all:D,pool:R}}};var eZ={name:"tokenBucket",version:"1.0.0",type:"fw.io.sync",dependencies:[],factory(){function T({capacity:j,refillRate:N,refillInterval:M=1000,initial:D}={}){if(!Number.isInteger(j)||j<1)throw Error("tokenBucket: capacity must be an integer >= 1");if(typeof N!=="number"||N<0)throw Error("tokenBucket: refillRate must be a number >= 0");let J=D!==void 0?D:j;function U(){let C=Date.now();if(C<Z)return Z;return C}let Z=Date.now(),H=!1,Q=null;function G(){if(N===0)return;let C=U(),q=C-Z;if(q<=0){Z=C;return}let P=q/M*N;J=Math.min(j,J+P),Z=C}let Y=[];function F(C){if(Q!==null)return;Q=setTimeout(()=>{Q=null,L()},Math.max(1,Math.ceil(C)))}function L(){while(Y.length>0){G();let{n:C,resolve:q}=Y[0];if(J>=C)J-=C,Y.shift(),q();else{if(N>0){let P=(C-J)/N*M;F(P)}break}}}function W(C=1){if(G(),J>=C)return J-=C,!0;return!1}function K(C=1){if(C>j)return Promise.reject(Error(`tokenBucket: n (${C}) exceeds capacity (${j})`));if(H)return Promise.reject(Error("tokenBucket: cancelled"));if(G(),J>=C&&Y.length===0)return J-=C,Promise.resolve();return new Promise((q,P)=>{if(Y.push({n:C,resolve:q,reject:P}),N>0){let $=(C-J)/N*M;F(Math.max(0,$))}})}function z(){J=j,Z=Date.now(),L()}function O(){if(H=!0,Q!==null)clearTimeout(Q),Q=null;let C=Error("tokenBucket: cancelled"),q=Y.splice(0);for(let{reject:P}of q)P(C)}return{tryTake:W,take:K,reset:z,cancel:O,get available(){return G(),Math.floor(J)},get capacity(){return j},get refillRate(){return N},get refillInterval(){return M}}}return{create:T}}};var $J={name:"base32",version:"1.0.0",type:"fw.io.codec",dependencies:[],factory(){let j=new Int8Array(128).fill(-1);for(let R=0;R<32;R++)j["ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".charCodeAt(R)]=R;return{fromBytes:function(R){let J=R.length;if(J===0)return"";let U=[],Z=0,H=0;for(let Q=0;Q<J;Q++){Z=Z<<8|R[Q]&255,H+=8;while(H>=5)H-=5,U.push("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"[Z>>H&31])}if(H>0)U.push("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"[Z<<5-H&31]);while(U.length%8!==0)U.push("=");return U.join("")},toBytes:function(R){let J=R.length;while(J>0&&R.charCodeAt(J-1)===61)J--;if(J===0)return new Uint8Array(0);let U=[],Z=0,H=0;for(let Q=0;Q<J;Q++){let G=R.charCodeAt(Q);if(G>=97&&G<=122)G-=32;let Y=G<128?j[G]:-1;if(Y<0)continue;if(Z=Z<<5|Y,H+=5,H>=8)H-=8,U.push(Z>>H&255)}return new Uint8Array(U)},test:function(R){return/^(?:[A-Z2-7]{8})*(?:[A-Z2-7]{2}={6}|[A-Z2-7]{4}={4}|[A-Z2-7]{5}={3}|[A-Z2-7]{7}=)?$/.test(R)}}}};var ZJ={name:"base58",version:"1.0.0",type:"fw.io.codec",dependencies:[],factory(){let j=new Int8Array(128).fill(-1);for(let R=0;R<58;R++)j["123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".charCodeAt(R)]=R;return{fromBytes:function(R){let J=R.length;if(J===0)return"";let U=0;while(U<J&&R[U]===0)U++;let Z=new Uint8Array(J);for(let Y=0;Y<J;Y++)Z[Y]=R[Y]&255;let H=[],Q=U;while(Q<J){let Y=0;for(let F=Q;F<J;F++){let L=(Y<<8)+Z[F];Z[F]=L/58|0,Y=L%58}H.push("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"[Y]);while(Q<J&&Z[Q]===0)Q++}let G="";for(let Y=0;Y<U;Y++)G+="1";for(let Y=H.length-1;Y>=0;Y--)G+=H[Y];return G},toBytes:function(R){let J=R.length;if(J===0)return new Uint8Array(0);let U=49,Z=0;while(Z<J&&R.charCodeAt(Z)===U)Z++;let H=new Int16Array(J);for(let F=0;F<J;F++){let L=R.charCodeAt(F),W=L<128?j[L]:-1;if(W<0)throw Error(`Invalid base58 character '${R[F]}' at index ${F}`);H[F]=W}let Q=[],G=Z;while(G<J){let F=0;for(let L=G;L<J;L++){let W=F*58+H[L];H[L]=W/256|0,F=W&255}Q.push(F);while(G<J&&H[G]===0)G++}let Y=new Uint8Array(Z+Q.length);for(let F=0;F<Q.length;F++)Y[Z+F]=Q[Q.length-1-F];return Y},test:function(R){return/^[1-9A-HJ-NP-Za-km-z]*$/.test(R)}}}};var JJ={name:"buffer",version:"1.0.0",type:"fw.io.codec",dependencies:["valid","utf8"],deps:[g$,L$],factory(T,j){let N={},M=["-","number","string","boolean","array","object","uint8array","uint8clampedarray"],D={number:1,string:2,boolean:3,array:4,object:5,uint8array:6,uint8clampedarray:7},R=new Uint8Array(2),J=4,U={uint8:1,int8:2,uint16:3,int16:4,uint32:5,int32:6,float16:7,float32:8,float64:9};N.const={map:M,type:D,empty:R};function Z(P){if(P<256)return 1;else if(P<65536)return 2;else if(P<16777216)return 3;else return 4}N.get_len=function(P,$,X=0){for(let V=0;V<P;V++)X+=$[V+1]<<V*8;return X},N.gen_len=function(P,$,X){X=new Uint8Array($);for(let V=0;V<$;V++)X[V]=P>>V*8&255;return X},N.uint_concat=function(P,$,X,V=0){X=new Uint8Array(P);for(let B=0;B<$.length;B++)X.set($[B],V),V+=$[B].length;return X},N.build_value=function(P,$,X=0,V=0,B=0,A){if(X=$.length,X>4294967295)throw Error(`buffer: payload length ${X} exceeds 2^32 - 1 limit`);if(V=Z(X),B=(V-1<<4)+N.const.type[P],A=new Uint8Array(X+V+1),A[0]=B,V===1)A[1]=X;else A.set(N.gen_len(X,V),1);return A.set($,V+1),A};function H(P,$,X,V=0){for(let B=0;B<X;B++)V+=P[$+B]<<B*8;return V}function Q(P,$=0){if($>=P.length)return null;let X=P[$],V=X&15;if(V<=0||V>=N.const.map.length)return null;let B=(X>>4)+1;if(B<1||B>4)return null;if($+B>=P.length)return null;let A=B===1?P[$+1]:H(P,$+1,B),S=1+B+A;if($+S>P.length)return null;return{type:V,len:A,head:B,start:$+1+B,end:$+1+B+A,next:$+S}}function G(P){let $=P&32768?-1:1,X=P>>10&31,V=P&1023;if(X===0){if(V===0)return $*0;return $*Math.pow(2,-14)*(V/1024)}if(X===31)return V?NaN:$*(1/0);return $*Math.pow(2,X-15)*(1+V/1024)}function Y(P){if(Number.isNaN(P))return 32256;if(P===1/0)return 31744;if(P===-1/0)return 64512;let $=new Float32Array(1),X=new Uint32Array($.buffer);$[0]=P;let V=X[0],B=V>>16&32768,A=(V>>23&255)-127,S=V&8388607;if(A===128)return B|31744|(S?512:0);if(A+=15,A>=31)return B|31744;if(A<=0){if(A<-10)return B;if(S=(S|8388608)>>1-A,S&4096)S+=8192;return B|S>>13}if(S&4096){if(S+=8192,S&8388608){if(S=0,A+=1,A>=31)return B|31744}}return B|A<<10|S>>13}function F(P){let $=new Float32Array(1);return $[0]=P,Object.is($[0],P)}function L(P){let $=Y(P),X=G($);return Object.is(X,P)}function W(P){let $=Number(P);if(Number.isNaN($)||!Number.isFinite($)){let A=new ArrayBuffer(9),S=new Uint8Array(A);return S[0]=U.float64,new DataView(A,1).setFloat64(0,$,!0),S}if(!Object.is($,-0)&&Number.isInteger($))if($>=0){if($<=255){let A=new ArrayBuffer(2),S=new Uint8Array(A);return S[0]=U.uint8,new DataView(A,1).setUint8(0,$),S}if($<=65535){let A=new ArrayBuffer(3),S=new Uint8Array(A);return S[0]=U.uint16,new DataView(A,1).setUint16(0,$,!0),S}if($<=4294967295){let A=new ArrayBuffer(5),S=new Uint8Array(A);return S[0]=U.uint32,new DataView(A,1).setUint32(0,$,!0),S}}else{if($>=-128){let A=new ArrayBuffer(2),S=new Uint8Array(A);return S[0]=U.int8,new DataView(A,1).setInt8(0,$),S}if($>=-32768){let A=new ArrayBuffer(3),S=new Uint8Array(A);return S[0]=U.int16,new DataView(A,1).setInt16(0,$,!0),S}if($>=-2147483648){let A=new ArrayBuffer(5),S=new Uint8Array(A);return S[0]=U.int32,new DataView(A,1).setInt32(0,$,!0),S}}if(L($)){let A=new ArrayBuffer(3),S=new Uint8Array(A);return S[0]=U.float16,new DataView(A,1).setUint16(0,Y($),!0),S}if(F($)){let A=new ArrayBuffer(5),S=new Uint8Array(A);return S[0]=U.float32,new DataView(A,1).setFloat32(0,$,!0),S}let V=new ArrayBuffer(9),B=new Uint8Array(V);return B[0]=U.float64,new DataView(V,1).setFloat64(0,$,!0),B}N.parse_array_in=function(P,$=[]){let X=0;while(X<P.length){let V=Q(P,X);if(!V)break;$.push(O(V.type,V.len,P.subarray(V.start,V.end))),X=V.next}return $},N.parse_array_out=function(P,$=[],X=0){for(let V=0;V<P.length;V++){let B=z(P[V]);$.push(B),X+=B.length}return N.uint_concat(X,$)},N.parse_object_in=function(P,$=[],X={},V){if($=N.parse_array_in(P),$.length===2){V=$[1].length===$[0].length?$[0].length:Math.min($[1].length,$[0].length);for(let B=0;B<V;B++)X[$[0][B]]=$[1][B].length>2?C($[1][B]):[]}return X},N.parse_object_out=function(P,$=[],X=[]){for(let V in P)if(Object.prototype.hasOwnProperty.call(P,V))$[X.push(V)-1]=z(P[V]);return N.parse_array_out([X,$])},N.in=[!1,function($){if(!$.length)return 0;let X=$[0],V=new DataView($.buffer,$.byteOffset+1,$.length-1);switch(X){case U.uint8:return V.getUint8(0);case U.int8:return V.getInt8(0);case U.uint16:return V.getUint16(0,!0);case U.int16:return V.getInt16(0,!0);case U.uint32:return V.getUint32(0,!0);case U.int32:return V.getInt32(0,!0);case U.float16:{let B=V.getUint16(0,!0);return G(B)}case U.float32:return V.getFloat32(0,!0);case U.float64:return V.getFloat64(0,!0);default:return 0}},function($){return j.fromBytes($)},function($){return $[0]===1},function($){return N.parse_array_in($)},function($){return N.parse_object_in($)},function($){return $},function($){return new Uint8ClampedArray($)}],N.out=[!1,function($){return N.build_value("number",W($))},function($){return N.build_value("string",j.toBytes($))},function($){return N.build_value("boolean",new Uint8Array([$?1:0]))},function($){return N.build_value("array",N.parse_array_out($))},function($){return N.build_value("object",N.parse_object_out($))},function($){return N.build_value("uint8array",$)},function($){return N.build_value("uint8clampedarray",$)}];function K(P,$){if(P>0)return N.out[P]($);else return N.const.empty}function z(P){return K(N.const.map.indexOf(T.is(P)),P)}function O(P,$,X){return N.in[P](X.slice(0,$))}function C(P){let $=Q(P,0);if(!$)return null;return O($.type,$.len,P.subarray($.start,$.end))}function q(P,$=[]){let X=0;while(X<P.length){let V=Q(P,X);if(!V)break;$.push(O(V.type,V.len,P.subarray(V.start,V.end))),X=V.next}return $}return{consume:q,clone:function(P){return C(z(P))},out:z,in:C,concat:N.uint_concat}}};var QJ={name:"cbor",version:"1.0.0",type:"fw.io.codec",dependencies:["utf8"],deps:[L$],factory(T){class j{constructor($,X){this.tag=$,this.value=X}}class N{constructor($){if(!Number.isInteger($)||$<0||$>255)throw Error(`CBOR Simple: value must be 0..255, got ${$}`);this.value=$}}let M=Symbol("cbor/break");function D($){let X=$&32768?-1:1,V=$>>10&31,B=$&1023;if(V===0)return B===0?X*0:X*Math.pow(2,-14)*(B/1024);if(V===31)return B?NaN:X*(1/0);return X*Math.pow(2,V-15)*(1+B/1024)}function R($){if(Number.isNaN($))return 32256;if($===1/0)return 31744;if($===-1/0)return 64512;let X=new Float32Array(1),V=new Uint32Array(X.buffer);X[0]=$;let B=V[0],A=B>>16&32768,S=(B>>23&255)-127,E=B&8388607;if(S===128)return A|31744|(E?512:0);if(S+=15,S>=31)return A|31744;if(S<=0){if(S<-10)return A;if(E=(E|8388608)>>1-S,E&4096)E+=8192;return A|E>>13}if(E&4096){if(E+=8192,E&8388608){if(E=0,S+=1,S>=31)return A|31744}}return A|S<<10|E>>13}function J($){return Object.is(D(R($)),$)}function U($){let X=new Float32Array(1);return X[0]=$,Object.is(X[0],$)}function Z($,X){$.push(new Uint8Array([X]))}function H($){let X=0;for(let A=0;A<$.length;A++)X+=$[A].length;let V=new Uint8Array(X),B=0;for(let A=0;A<$.length;A++)V.set($[A],B),B+=$[A].length;return V}function Q($,X){let V=$.length<X.length?$.length:X.length;for(let B=0;B<V;B++)if($[B]!==X[B])return $[B]-X[B];return $.length-X.length}function G($,X,V){let B=X<<5;if(typeof V==="bigint"){if(V<24n)$.push(new Uint8Array([B|Number(V)]));else if(V<0x100n)$.push(new Uint8Array([B|24,Number(V)]));else if(V<0x10000n){let A=new Uint8Array(3);A[0]=B|25;let S=Number(V);A[1]=S>>8&255,A[2]=S&255,$.push(A)}else if(V<0x100000000n){let A=new Uint8Array(5);A[0]=B|26,new DataView(A.buffer).setUint32(1,Number(V),!1),$.push(A)}else{let A=new Uint8Array(9);A[0]=B|27,new DataView(A.buffer).setBigUint64(1,V,!1),$.push(A)}return}if(V<24)$.push(new Uint8Array([B|V]));else if(V<256)$.push(new Uint8Array([B|24,V]));else if(V<65536){let A=new Uint8Array(3);A[0]=B|25,A[1]=V>>8&255,A[2]=V&255,$.push(A)}else if(V<4294967296){let A=new Uint8Array(5);A[0]=B|26,new DataView(A.buffer).setUint32(1,V,!1),$.push(A)}else{let A=new Uint8Array(9);A[0]=B|27,new DataView(A.buffer).setBigUint64(1,BigInt(V),!1),$.push(A)}}function Y($){let X=$.toString(16),V=X.length%2?"0"+X:X,B=V.length/2,A=new Uint8Array(B);for(let S=0;S<B;S++)A[S]=parseInt(V.substr(S*2,2),16);return A}function F($,X){if(Number.isNaN($)||!Number.isFinite($)||J($)){let B=new Uint8Array(3);B[0]=249;let A=Number.isNaN($)?32256:R($);B[1]=A>>8&255,B[2]=A&255,X.push(B);return}if(U($)){let B=new Uint8Array(5);B[0]=250,new DataView(B.buffer).setFloat32(1,$,!1),X.push(B);return}let V=new Uint8Array(9);V[0]=251,new DataView(V.buffer).setFloat64(1,$,!1),X.push(V)}function L($,X){if($>=24&&$<=31)throw Error(`CBOR: simple(${$}) is reserved and MUST NOT be emitted`);if($<24){Z(X,224|$);return}X.push(new Uint8Array([248,$]))}function W($,X,V){if(V){let B=Array($.length);for(let A=0;A<$.length;A++){let[S,E]=$[A],I=[];K(S,I,!0),B[A]={keyBytes:H(I),keyChunks:I,v:E}}B.sort((A,S)=>Q(A.keyBytes,S.keyBytes)),G(X,5,B.length);for(let A=0;A<B.length;A++){let S=B[A];for(let E=0;E<S.keyChunks.length;E++)X.push(S.keyChunks[E]);K(S.v,X,!0)}}else{G(X,5,$.length);for(let B=0;B<$.length;B++)K($[B][0],X,!1),K($[B][1],X,!1)}}function K($,X,V){if($===!1){Z(X,244);return}if($===!0){Z(X,245);return}if($===null){Z(X,246);return}if($===void 0){Z(X,247);return}if(typeof $==="number"){if(Object.is($,-0)){X.push(new Uint8Array([249,128,0]));return}if(Number.isInteger($)&&$>=-4294967296&&$<=4294967295){if($>=0)G(X,0,$);else G(X,1,-1-$);return}F($,X);return}if(typeof $==="bigint"){if($>=0n&&$<=0xffffffffffffffffn){G(X,0,$);return}if($<0n&&$>=-0x10000000000000000n){G(X,1,-1n-$);return}if($>=0n){G(X,6,2);let B=Y($);G(X,2,B.length),X.push(B)}else{G(X,6,3);let B=Y(-1n-$);G(X,2,B.length),X.push(B)}return}if(typeof $==="string"){let B=T.toBytes($);G(X,3,B.length),X.push(B);return}if($ instanceof Uint8Array){G(X,2,$.length),X.push($);return}if($ instanceof N){L($.value,X);return}if($ instanceof j){G(X,6,$.tag),K($.value,X,V);return}if(Array.isArray($)){G(X,4,$.length);for(let B=0;B<$.length;B++)K($[B],X,V);return}if($ instanceof Map){W([...$],X,V);return}if(typeof $==="object"){let B=Object.keys($),A=Array(B.length);for(let S=0;S<B.length;S++)A[S]=[B[S],$[B[S]]];W(A,X,V);return}throw Error(`CBOR: cannot encode value of type ${typeof $}`)}function z($,X){let V=!!(X&&X.deterministic),B=[];return K($,B,V),H(B)}function O($,X){let{view:V}=$;if(X<24)return X;if(X===24){let B=V.getUint8($.offset);return $.offset+=1,B}if(X===25){let B=V.getUint16($.offset,!1);return $.offset+=2,B}if(X===26){let B=V.getUint32($.offset,!1);return $.offset+=4,B}if(X===27){let B=V.getUint32($.offset,!1),A=V.getUint32($.offset+4,!1);if($.offset+=8,B<=2097151)return B*4294967296+A;return BigInt(B)<<32n|BigInt(A)}throw Error(`CBOR: invalid additional info ${X}`)}function C($,X){if($.useMap){let B=new Map;for(let A=0;A<X;A++){let S=q($);B.set(S,q($))}return B}let V={};for(let B=0;B<X;B++){let A=q($);V[A]=q($)}return V}function q($){let{view:X,bytes:V}=$;if($.offset>=V.length)throw Error("CBOR: unexpected end of input");let B=X.getUint8($.offset++),A=B>>5,S=B&31;if(A===7){if(S===20)return!1;if(S===21)return!0;if(S===22)return null;if(S===23)return;if(S<24)return new N(S);if(S===24){let I=X.getUint8($.offset);return $.offset+=1,new N(I)}if(S===25){let I=X.getUint16($.offset,!1);return $.offset+=2,D(I)}if(S===26){let I=X.getFloat32($.offset,!1);return $.offset+=4,I}if(S===27){let I=X.getFloat64($.offset,!1);return $.offset+=8,I}if(S===31)return M;throw Error(`CBOR: invalid info ${S} for major 7`)}if(S===31){if(A===2){let I=[];for(;;){let g=q($);if(g===M)break;if(!(g instanceof Uint8Array))throw Error("CBOR: expected byte string chunk");I.push(g)}return H(I)}if(A===3){let I="";for(;;){let g=q($);if(g===M)break;if(typeof g!=="string")throw Error("CBOR: expected text string chunk");I+=g}return I}if(A===4){let I=[];for(;;){let g=q($);if(g===M)break;I.push(g)}return I}if(A===5){if($.useMap){let g=new Map;for(;;){let k=q($);if(k===M)break;g.set(k,q($))}return g}let I={};for(;;){let g=q($);if(g===M)break;I[g]=q($)}return I}throw Error(`CBOR: indefinite length not allowed for major ${A}`)}let E=O($,S);switch(A){case 0:return E;case 1:if(typeof E==="bigint")return-1n-E;return-1-E;case 2:{let I=Number(E),g=V.slice($.offset,$.offset+I);return $.offset+=I,g}case 3:{let I=Number(E),g=T.fromBytes(V.subarray($.offset,$.offset+I));return $.offset+=I,g}case 4:{let I=Number(E),g=Array(I);for(let k=0;k<I;k++)g[k]=q($);return g}case 5:return C($,Number(E));case 6:{let I=q($),g=typeof E==="bigint"?Number(E):E;if(g===2&&I instanceof Uint8Array){let k=0n;for(let w=0;w<I.length;w++)k=k<<8n|BigInt(I[w]);return k}if(g===3&&I instanceof Uint8Array){let k=0n;for(let w=0;w<I.length;w++)k=k<<8n|BigInt(I[w]);return-1n-k}return new j(g,I)}}throw Error(`CBOR: invalid major type ${A}`)}function P($,X){let V={bytes:$,view:new DataView($.buffer,$.byteOffset,$.byteLength),offset:0,useMap:!!(X&&X.useMap)};return q(V)}return{encode:z,decode:P,Tagged:j,Simple:N}}};var XJ={name:"msgpack",version:"1.0.0",type:"fw.io.codec",dependencies:["utf8"],deps:[L$],factory(T){class j{constructor($,X){this.type=$,this.data=X}}function N($,X){$.push(new Uint8Array([X]))}function M($){let X=new Float32Array(1);return X[0]=$,Object.is(X[0],$)}function D($,X){let V=$.getTime(),B=Math.floor(V/1000),A=(V-B*1000)*1e6;if(A<0)B-=1,A+=1e9;if(A===0&&B>=0&&B<=4294967295){let I=new Uint8Array(6);I[0]=214,I[1]=255,new DataView(I.buffer).setUint32(2,B,!1),X.push(I);return}if(B>=0&&B<17179869184){let I=BigInt(A)<<34n|BigInt(B),g=new Uint8Array(10);g[0]=215,g[1]=255,new DataView(g.buffer).setBigUint64(2,I,!1),X.push(g);return}let S=new Uint8Array(15);S[0]=199,S[1]=12,S[2]=255;let E=new DataView(S.buffer);E.setUint32(3,A,!1),E.setBigInt64(7,BigInt(B),!1),X.push(S)}function R($,X,V){if(V===4){let B=$.getUint32(X,!1);return new Date(B*1000)}if(V===8){let B=$.getBigUint64(X,!1),A=Number(B>>34n),S=Number(B&(1n<<34n)-1n);return new Date(S*1000+Math.round(A/1e6))}if(V===12){let B=$.getUint32(X,!1),A=$.getBigInt64(X+4,!1);return new Date(Number(A)*1000+Math.round(B/1e6))}return null}function J($,X){if(Object.is($,-0)){let B=new Uint8Array(5);B[0]=202,new DataView(B.buffer).setFloat32(1,-0,!1),X.push(B);return}if(Number.isFinite($)&&Number.isInteger($)&&$>=-2147483648&&$<=4294967295){if($>=0){if($<=127){N(X,$);return}if($<=255){X.push(new Uint8Array([204,$]));return}if($<=65535){let S=new Uint8Array(3);S[0]=205,new DataView(S.buffer).setUint16(1,$,!1),X.push(S);return}let A=new Uint8Array(5);A[0]=206,new DataView(A.buffer).setUint32(1,$,!1),X.push(A);return}if($>=-32){N(X,$&255);return}if($>=-128){X.push(new Uint8Array([208,$&255]));return}if($>=-32768){let A=new Uint8Array(3);A[0]=209,new DataView(A.buffer).setInt16(1,$,!1),X.push(A);return}let B=new Uint8Array(5);B[0]=210,new DataView(B.buffer).setInt32(1,$,!1),X.push(B);return}if(Number.isFinite($)&&M($)){let B=new Uint8Array(5);B[0]=202,new DataView(B.buffer).setFloat32(1,$,!1),X.push(B);return}let V=new Uint8Array(9);V[0]=203,new DataView(V.buffer).setFloat64(1,$,!1),X.push(V)}function U($,X){if($>=0n&&$<=0xffffffffffffffffn){let V=new Uint8Array(9);V[0]=207,new DataView(V.buffer).setBigUint64(1,$,!1),X.push(V);return}if($<0n&&$>=-0x8000000000000000n){let V=new Uint8Array(9);V[0]=211,new DataView(V.buffer).setBigInt64(1,$,!1),X.push(V);return}throw Error(`msgpack: BigInt out of 64-bit range: ${$}`)}function Z($,X){let V=T.toBytes($),B=V.length;if(B<=31)X.push(new Uint8Array([160|B]));else if(B<=255)X.push(new Uint8Array([217,B]));else if(B<=65535){let A=new Uint8Array(3);A[0]=218,new DataView(A.buffer).setUint16(1,B,!1),X.push(A)}else{let A=new Uint8Array(5);A[0]=219,new DataView(A.buffer).setUint32(1,B,!1),X.push(A)}X.push(V)}function H($,X){let V=$.length;if(V<=255)X.push(new Uint8Array([196,V]));else if(V<=65535){let B=new Uint8Array(3);B[0]=197,new DataView(B.buffer).setUint16(1,V,!1),X.push(B)}else{let B=new Uint8Array(5);B[0]=198,new DataView(B.buffer).setUint32(1,V,!1),X.push(B)}X.push($)}function Q($,X){if(X<=15)N($,144|X);else if(X<=65535){let V=new Uint8Array(3);V[0]=220,new DataView(V.buffer).setUint16(1,X,!1),$.push(V)}else{let V=new Uint8Array(5);V[0]=221,new DataView(V.buffer).setUint32(1,X,!1),$.push(V)}}function G($,X){if(X<=15)N($,128|X);else if(X<=65535){let V=new Uint8Array(3);V[0]=222,new DataView(V.buffer).setUint16(1,X,!1),$.push(V)}else{let V=new Uint8Array(5);V[0]=223,new DataView(V.buffer).setUint32(1,X,!1),$.push(V)}}function Y($,X){let V=$.data.length,B=$.type&255;if(V===1){X.push(new Uint8Array([212,B])),X.push($.data);return}if(V===2){X.push(new Uint8Array([213,B])),X.push($.data);return}if(V===4){X.push(new Uint8Array([214,B])),X.push($.data);return}if(V===8){X.push(new Uint8Array([215,B])),X.push($.data);return}if(V===16){X.push(new Uint8Array([216,B])),X.push($.data);return}if(V<=255)X.push(new Uint8Array([199,V,B]));else if(V<=65535){let A=new Uint8Array(4);A[0]=200,new DataView(A.buffer).setUint16(1,V,!1),A[3]=B,X.push(A)}else{let A=new Uint8Array(6);A[0]=201,new DataView(A.buffer).setUint32(1,V,!1),A[5]=B,X.push(A)}X.push($.data)}function F($,X){if($===null||$===void 0){N(X,192);return}if($===!1){N(X,194);return}if($===!0){N(X,195);return}let V=typeof $;if(V==="number"){J($,X);return}if(V==="bigint"){U($,X);return}if(V==="string"){Z($,X);return}if($ instanceof Date){D($,X);return}if($ instanceof Uint8Array){H($,X);return}if($ instanceof j){Y($,X);return}if(Array.isArray($)){Q(X,$.length);for(let B=0;B<$.length;B++)F($[B],X);return}if($ instanceof Map){G(X,$.size);for(let[B,A]of $)F(B,X),F(A,X);return}if(V==="object"){let B=Object.keys($);G(X,B.length);for(let A=0;A<B.length;A++)F(B[A],X),F($[B[A]],X);return}throw Error(`msgpack: cannot encode value of type ${V}`)}function L($){let X=[];F($,X);let V=0;for(let S=0;S<X.length;S++)V+=X[S].length;let B=new Uint8Array(V),A=0;for(let S=0;S<X.length;S++)B.set(X[S],A),A+=X[S].length;return B}function W($,X){let V=$.bytes.slice($.offset,$.offset+X);return $.offset+=X,V}function K($,X){let V=T.fromBytes($.bytes.subarray($.offset,$.offset+X));return $.offset+=X,V}function z($,X){let V=Array(X);for(let B=0;B<X;B++)V[B]=q($);return V}function O($,X){if($.useMap){let B=new Map;for(let A=0;A<X;A++){let S=q($);B.set(S,q($))}return B}let V={};for(let B=0;B<X;B++){let A=q($);V[A]=q($)}return V}function C($,X){let V=$.view.getInt8($.offset);if($.offset+=1,V===-1){let A=R($.view,$.offset,X);if(A!==null)return $.offset+=X,A}let B=$.bytes.slice($.offset,$.offset+X);return $.offset+=X,new j(V,B)}function q($){let{view:X}=$;if($.offset>=$.bytes.length)throw Error("msgpack: unexpected end of input");let V=X.getUint8($.offset++);if(V<=127)return V;if(V>=224)return V-256;if(V>=128&&V<=143)return O($,V&15);if(V>=144&&V<=159)return z($,V&15);if(V>=160&&V<=191)return K($,V&31);switch(V){case 192:return null;case 194:return!1;case 195:return!0;case 196:{let B=X.getUint8($.offset);return $.offset+=1,W($,B)}case 197:{let B=X.getUint16($.offset,!1);return $.offset+=2,W($,B)}case 198:{let B=X.getUint32($.offset,!1);return $.offset+=4,W($,B)}case 199:{let B=X.getUint8($.offset);return $.offset+=1,C($,B)}case 200:{let B=X.getUint16($.offset,!1);return $.offset+=2,C($,B)}case 201:{let B=X.getUint32($.offset,!1);return $.offset+=4,C($,B)}case 202:{let B=X.getFloat32($.offset,!1);return $.offset+=4,B}case 203:{let B=X.getFloat64($.offset,!1);return $.offset+=8,B}case 204:{let B=X.getUint8($.offset);return $.offset+=1,B}case 205:{let B=X.getUint16($.offset,!1);return $.offset+=2,B}case 206:{let B=X.getUint32($.offset,!1);return $.offset+=4,B}case 207:{let B=X.getUint32($.offset,!1),A=X.getUint32($.offset+4,!1);if($.offset+=8,B<=2097151)return B*4294967296+A;return BigInt(B)<<32n|BigInt(A)}case 208:{let B=X.getInt8($.offset);return $.offset+=1,B}case 209:{let B=X.getInt16($.offset,!1);return $.offset+=2,B}case 210:{let B=X.getInt32($.offset,!1);return $.offset+=4,B}case 211:{let B=X.getBigInt64($.offset,!1);if($.offset+=8,B>=-0x20000000000000n&&B<=0x20000000000000n)return Number(B);return B}case 212:return C($,1);case 213:return C($,2);case 214:return C($,4);case 215:return C($,8);case 216:return C($,16);case 217:{let B=X.getUint8($.offset);return $.offset+=1,K($,B)}case 218:{let B=X.getUint16($.offset,!1);return $.offset+=2,K($,B)}case 219:{let B=X.getUint32($.offset,!1);return $.offset+=4,K($,B)}case 220:{let B=X.getUint16($.offset,!1);return $.offset+=2,z($,B)}case 221:{let B=X.getUint32($.offset,!1);return $.offset+=4,z($,B)}case 222:{let B=X.getUint16($.offset,!1);return $.offset+=2,O($,B)}case 223:{let B=X.getUint32($.offset,!1);return $.offset+=4,O($,B)}}throw Error(`msgpack: unknown prefix 0x${V.toString(16)}`)}function P($,X){let V={bytes:$,view:new DataView($.buffer,$.byteOffset,$.byteLength),offset:0,useMap:!!(X&&X.useMap)};return q(V)}return{encode:L,decode:P,Ext:j}}};var GJ={name:"crc32",version:"1.0.0",type:"fw.io.calc",dependencies:[],factory(){let T=new Uint32Array(256);for(let N=0;N<256;N++){let M=N;for(let D=0;D<8;D++)if(M&1)M=M>>>1^3988292384;else M=M>>>1;T[N]=M}function j(){this.crc=-1}return j.prototype.append=function(N){let M=this.crc|0;for(let D=0,R=N.length|0;D<R;D++)M=M>>>8^T[(M^N[D])&255];this.crc=M},j.prototype.get=function(){return~this.crc>>>0},j}};var YJ={name:"adler32",version:"1.0.0",type:"fw.io.calc",dependencies:[],factory(){function T(){this._a=1,this._b=0}return T.prototype.append=function(j){let N=this._a,M=this._b,D=j.length|0;for(let R=0;R!==D;){let J=Math.min(R+2655,D);for(;R<J;++R)M+=N+=j[R];N=(N&65535)+15*(N>>16),M=(M&65535)+15*(M>>16)}this._a=N,this._b=M},T.prototype.get=function(){return(this._b%65521<<16|this._a%65521)>>>0},T}};var UJ={name:"bigint",version:"1.0.0",type:"fw.io.calc",dependencies:[],factory(){function T(Y){if(Y===0n)return 0;let F=Y<0n?-Y:Y,L=0;while(F>0n)F>>=1n,L++;return L}function j(Y){let F=T(Y<0n?-Y-1n:Y);return Math.max(1,Math.ceil(F/8))}function N(Y,{byteLength:F,endian:L="be",signed:W=!1}={}){if(!W&&Y<0n)throw Error("bigint: negative value requires signed=true");let K;if(W){let q=T(Y<0n?-Y-1n:Y);K=Math.max(1,Math.ceil((q+1)/8))}else K=j(Y);let z=F!==void 0?F:K;if(F!==void 0&&F<K)throw Error(`bigint: byteLength ${F} insufficient (need ${K})`);let O=new Uint8Array(z),C=W&&Y<0n?(1n<<BigInt(z*8))+Y:Y;for(let q=z-1;q>=0;q--)O[L==="be"?q:z-1-q]=Number(C&0xffn),C>>=8n;return O}function M(Y,{endian:F="be",signed:L=!1}={}){let W=0n,K=Y.length;for(let z=0;z<K;z++){let O=BigInt(Y[F==="be"?z:K-1-z]);W=W<<8n|O}if(L&&K>0&&Y[F==="be"?0:K-1]&128)W-=1n<<BigInt(K*8);return W}function D(Y,F,L){if(F<0n)throw Error("bigint: exp must be >= 0");if(L<=0n)throw Error("bigint: mod must be > 0");if(L===1n)return 0n;let W=1n;if(Y=Y%L,Y<0n)Y+=L;while(F>0n){if(F&1n)W=W*Y%L;F>>=1n,Y=Y*Y%L}return W}function R(Y,F){Y=Y<0n?-Y:Y,F=F<0n?-F:F;while(F){let L=F;F=Y%F,Y=L}return Y}function J(Y,F){return Y/R(Y,F)*F}function U(Y,F){if(F<=0n)throw Error("bigint: mod must be > 0");let[L,W]=[Y%F,F],[K,z]=[1n,0n];while(W!==0n){let O=L/W;[L,W]=[W,L-O*W],[K,z]=[z,K-O*z]}if(L!==1n)throw Error("bigint: no modular inverse");return(K%F+F)%F}function Z(Y,F=20){if(Y<2n)return!1;if(Y===2n||Y===3n)return!0;if(Y%2n===0n)return!1;let L=Y-1n,W=0;while(L%2n===0n)L/=2n,W++;let K=[2n,3n,5n,7n,11n,13n,17n,19n,23n,29n,31n,37n,41n,43n,47n,53n,59n,61n,67n,71n],z=Math.min(F,K.length);$:for(let O=0;O<z;O++){let C=K[O];if(C>=Y-1n)continue;let q=D(C,L,Y);if(q===1n||q===Y-1n)continue;for(let P=0;P<W-1;P++)if(q=q*q%Y,q===Y-1n)continue $;return!1}return!0}function H(Y,F,L){if(Y>F)throw Error("bigint: min > max");let W=F-Y+1n,K=T(W-1n),z=Math.ceil(K/8);while(!0){let O=L(z),C=0n;for(let P=0;P<O.length;P++)C=C<<8n|BigInt(O[P]);let q=(1n<<BigInt(K))-1n;if(C&=q,C<W)return Y+C}}function Q(Y,F=10){if(Y=Y.trim(),F===16){let L=!1;if(Y.startsWith("-"))L=!0,Y=Y.slice(1);if(Y.startsWith("0x")||Y.startsWith("0X"))Y=Y.slice(2);return L?-BigInt("0x"+Y):BigInt("0x"+Y)}if(F===10)return BigInt(Y);return BigInt(parseInt(Y,F))}function G(Y,F=10){if(F===10)return Y.toString();if(F===16){let L=Y<0n,W=L?-Y:Y;return(L?"-":"")+W.toString(16)}return Y.toString(F)}return{toBytes:N,fromBytes:M,bitLength:T,byteLength:j,modPow:D,modInv:U,gcd:R,lcm:J,isPrime:Z,randomBetween:H,parse:Q,toString:G}}};var WJ={name:"geom",version:"1.0.0",type:"fw.io.math",dependencies:["linalg"],deps:[S$],factory(T){let j={create:(Z,H)=>({x:Z,y:H}),distance:(Z,H)=>Math.sqrt((H.x-Z.x)**2+(H.y-Z.y)**2),midpoint:(Z,H)=>({x:(Z.x+H.x)/2,y:(Z.y+H.y)/2}),equals:(Z,H,Q=0.000001)=>Math.abs(Z.x-H.x)<=Q&&Math.abs(Z.y-H.y)<=Q},N={create:(Z,H,Q,G)=>({x:Z,y:H,w:Q,h:G}),contains:(Z,H)=>H.x>=Z.x&&H.x<Z.x+Z.w&&H.y>=Z.y&&H.y<Z.y+Z.h,intersects:(Z,H)=>!(Z.x+Z.w<=H.x||H.x+H.w<=Z.x||Z.y+Z.h<=H.y||H.y+H.h<=Z.y),intersection:(Z,H)=>{let Q=Math.max(Z.x,H.x),G=Math.max(Z.y,H.y),Y=Math.min(Z.x+Z.w,H.x+H.w),F=Math.min(Z.y+Z.h,H.y+H.h);if(Y<=Q||F<=G)return null;return{x:Q,y:G,w:Y-Q,h:F-G}},union:(Z,H)=>{let Q=Math.min(Z.x,H.x),G=Math.min(Z.y,H.y),Y=Math.max(Z.x+Z.w,H.x+H.w),F=Math.max(Z.y+Z.h,H.y+H.h);return{x:Q,y:G,w:Y-Q,h:F-G}},area:(Z)=>Z.w*Z.h,center:(Z)=>({x:Z.x+Z.w/2,y:Z.y+Z.h/2}),normalize:(Z)=>({x:Z.w<0?Z.x+Z.w:Z.x,y:Z.h<0?Z.y+Z.h:Z.y,w:Math.abs(Z.w),h:Math.abs(Z.h)})},M={create:(Z,H,Q)=>({cx:Z,cy:H,r:Q}),contains:(Z,H)=>(H.x-Z.cx)**2+(H.y-Z.cy)**2<=Z.r*Z.r,intersectsCircle:(Z,H)=>{return(Z.cx-H.cx)**2+(Z.cy-H.cy)**2<=(Z.r+H.r)**2},intersectsRect:(Z,H)=>{let Q=Math.max(H.x,Math.min(Z.cx,H.x+H.w)),G=Math.max(H.y,Math.min(Z.cy,H.y+H.h));return(Z.cx-Q)**2+(Z.cy-G)**2<=Z.r*Z.r}},D={create:(Z,H,Q,G)=>({x1:Z,y1:H,x2:Q,y2:G}),length:(Z)=>Math.sqrt((Z.x2-Z.x1)**2+(Z.y2-Z.y1)**2),intersects:(Z,H)=>{let Q=Z.x2-Z.x1,G=Z.y2-Z.y1,Y=H.x2-H.x1,F=H.y2-H.y1,L=Q*F-G*Y;if(Math.abs(L)<0.0000000001)return!1;let W=H.x1-Z.x1,K=H.y1-Z.y1,z=(W*F-K*Y)/L,O=(W*G-K*Q)/L;return z>=0&&z<=1&&O>=0&&O<=1},intersection:(Z,H)=>{let Q=Z.x2-Z.x1,G=Z.y2-Z.y1,Y=H.x2-H.x1,F=H.y2-H.y1,L=Q*F-G*Y;if(Math.abs(L)<0.0000000001)return null;let W=H.x1-Z.x1,K=H.y1-Z.y1,z=(W*F-K*Y)/L,O=(W*G-K*Q)/L;if(z<0||z>1||O<0||O>1)return null;return{x:Z.x1+z*Q,y:Z.y1+z*G}},distanceToPoint:(Z,H)=>{let Q=Z.x2-Z.x1,G=Z.y2-Z.y1,Y=Q*Q+G*G;if(Y===0)return j.distance({x:Z.x1,y:Z.y1},H);let F=Math.max(0,Math.min(1,((H.x-Z.x1)*Q+(H.y-Z.y1)*G)/Y));return j.distance({x:Z.x1+F*Q,y:Z.y1+F*G},H)},closestPoint:(Z,H)=>{let Q=Z.x2-Z.x1,G=Z.y2-Z.y1,Y=Q*Q+G*G;if(Y===0)return{x:Z.x1,y:Z.y1};let F=Math.max(0,Math.min(1,((H.x-Z.x1)*Q+(H.y-Z.y1)*G)/Y));return{x:Z.x1+F*Q,y:Z.y1+F*G}}},R={create:(Z)=>({points:Z}),area:(Z)=>{let H=Z.points,Q=0,G=H.length;for(let Y=0;Y<G;Y++){let F=(Y+1)%G;Q+=H[Y].x*H[F].y-H[F].x*H[Y].y}return Q/2},isCcw:(Z)=>R.area(Z)>0,bbox:(Z)=>{let H=Z.points,Q=H[0].x,G=H[0].x,Y=H[0].y,F=H[0].y;for(let L of H){if(L.x<Q)Q=L.x;if(L.x>G)G=L.x;if(L.y<Y)Y=L.y;if(L.y>F)F=L.y}return N.create(Q,Y,G-Q,F-Y)},contains:(Z,H)=>{let Q=Z.points,G=Q.length,Y=!1;for(let F=0,L=G-1;F<G;L=F++){let W=Q[F].x,K=Q[F].y,z=Q[L].x,O=Q[L].y;if(K>H.y!==O>H.y&&H.x<(z-W)*(H.y-K)/(O-K)+W)Y=!Y}return Y},simplify:(Z,H)=>{let Q=Z.points;if(Q.length<=2)return Z;function G(Y,F){if(Y.length<=2)return Y;let L=Y[0],W=Y[Y.length-1],K=D.create(L.x,L.y,W.x,W.y),z=0,O=0;for(let C=1;C<Y.length-1;C++){let q=D.distanceToPoint(K,Y[C]);if(q>z)z=q,O=C}if(z<=F)return[L,W];return[...G(Y.slice(0,O+1),F).slice(0,-1),...G(Y.slice(O),F)]}return{points:G(Q,H)}}};function J(Z,H){if("w"in Z&&"h"in Z)return N.contains(Z,H);if("r"in Z&&"cx"in Z)return M.contains(Z,H);if("points"in Z)return R.contains(Z,H);return!1}function U(Z,H){let Q=T.vec2.create();return T.mat3.transform(Q,H,T.vec2.create([Z.x,Z.y])),{x:Q[0],y:Q[1]}}return{Point:j,Rect:N,Circle:M,Line:D,Polygon:R,hitTest:J,transform:U}}};var KJ={name:"fixedPoint",version:"1.0.0",type:"fw.io.math",dependencies:[],factory(){function T(H,Q,G,Y=!0){let F=Q+G,L=H;if(Y){let W=Math.pow(2,F),K=W/2;if(L&K)L=L-W}return L/Math.pow(2,G)}function j(H,Q,G,Y=!0,F={}){let L=F&&F.strict===!0,W=Q+G;if(typeof H!=="number"||H!==H){if(L)throw RangeError(`fixedPoint: invalid value ${H}`);return 0}let K=Math.pow(2,G),z=Math.round(H*K),O=Math.pow(2,W),C=O/2,q=Y?-C:0,P=Y?C-1:O-1;if(!isFinite(z)||z<q||z>P){if(L)throw RangeError(`fixedPoint: value ${H} out of range [${q/K}, ${P/K}]`);z=z<q||z===-1/0?q:P}if(W>=32)return z>>>0;return z&(1<<W)-1}function N(H){return(H|0)/65536}function M(H,Q){let G=Q&&Q.strict===!0;if(typeof H!=="number"||H!==H){if(G)throw RangeError(`fixedPoint: invalid value ${H}`);return 0}let Y=-2147483648,F=2147483647,L=Math.round(H*65536);if(!isFinite(L)||L<Y||L>F){if(G)throw RangeError(`fixedPoint: value ${H} out of Fixed16.16 range [-32768, 32767.99998…]`);L=L<Y||L===-1/0?Y:F}return L>>>0}function D(H){return(H>>>0)/65536}function R(H,Q){let G=Q&&Q.strict===!0;if(typeof H!=="number"||!isFinite(H)){if(G)throw RangeError(`fixedPoint: invalid value ${H}`);return 0}let Y=Math.round(H*65536),F=0,L=4294967295;if(Y<F||Y>L){if(G)throw RangeError(`fixedPoint: value ${H} out of UFix16.16 range [0, 65535.99998…]`);Y=Y<F?F:L}return Y>>>0}function J(H){let Q=H&65535;if(Q&32768)Q=Q-65536;return Q/16384}function U(H,Q){let G=Q&&Q.strict===!0;if(typeof H!=="number"||!isFinite(H)){if(G)throw RangeError(`fixedPoint: invalid value ${H}`);return 0}let Y=Math.round(H*16384),F=-32768,L=32767;if(Y<F||Y>L){if(G)throw RangeError(`fixedPoint: value ${H} out of F2Dot14 range [-2, 1.99993…]`);Y=Y<F?F:L}return Y&65535}function Z(H,Q,G){return G*(Q/H)}return{fixed16ToFloat:N,floatToFixed16:M,ufixed16ToFloat:D,floatToUfixed16:R,f2dot14ToFloat:J,floatToF2dot14:U,funitToPx:Z,fixedToFloat:T,floatToFixed:j}}};var HJ={name:"binaryReader",version:"1.0.0",type:"fw.io.binary",dependencies:[],factory(){let T=new TextDecoder("utf-8");function j(M,D,R){let J=Error(D);if(J.name="ContractError",J.code=M,R)J.context=R;return J}function N(M,D){if(!(M instanceof Uint8Array))throw j("binary/reader-input","binaryReader.create expects Uint8Array",{actual:typeof M});let J=(D||{}).endian==="le"?"le":"be",U=M,Z=new DataView(M.buffer,M.byteOffset,M.byteLength),H=M.byteLength,Q=0;function G(L){if(Q+L>H)throw j("binary/reader-eof","unexpected end of stream",{needed:L,pos:Q,length:H})}let Y=()=>J==="le",F={get pos(){return Q},get length(){return H},eof(){return Q>=H},tell(){return Q},seek(L){if(L<0||L>H)throw j("binary/reader-seek","seek out of bounds",{offset:L,length:H});return Q=L,F},skip(L){return F.seek(Q+L)},peek(L){return G(L),new Uint8Array(U.buffer,U.byteOffset+Q,L)},setEndian(L){if(L!=="be"&&L!=="le")throw j("binary/reader-endian",'endian must be "be" or "le"',{actual:L});J=L},u8(){G(1);let L=Z.getUint8(Q);return Q+=1,L},u16(){G(2);let L=Z.getUint16(Q,Y());return Q+=2,L},u24(){G(3);let L;if(Y())L=Z.getUint8(Q)|Z.getUint8(Q+1)<<8|Z.getUint8(Q+2)<<16;else L=Z.getUint8(Q)<<16|Z.getUint8(Q+1)<<8|Z.getUint8(Q+2);return Q+=3,L>>>0},u32(){G(4);let L=Z.getUint32(Q,Y());return Q+=4,L>>>0},u64(){G(8);let L=Z.getBigUint64(Q,Y());return Q+=8,L},u64Safe(){let L=F.u64();if(L>BigInt(Number.MAX_SAFE_INTEGER))throw j("binary/reader-u64safe","u64 value exceeds Number.MAX_SAFE_INTEGER",{value:L.toString()});return Number(L)},i8(){G(1);let L=Z.getInt8(Q);return Q+=1,L},i16(){G(2);let L=Z.getInt16(Q,Y());return Q+=2,L},i32(){G(4);let L=Z.getInt32(Q,Y());return Q+=4,L},i64(){G(8);let L=Z.getBigInt64(Q,Y());return Q+=8,L},f32(){G(4);let L=Z.getFloat32(Q,Y());return Q+=4,L},f64(){G(8);let L=Z.getFloat64(Q,Y());return Q+=8,L},bytes(L){G(L);let W=new Uint8Array(U.buffer,U.byteOffset+Q,L);return Q+=L,W},utf8(L){let W=F.bytes(L);return T.decode(W)},ascii(L){G(L);let W="";for(let K=0;K<L;K++){let z=Z.getUint8(Q+K);if(z>127)throw j("binary/reader-ascii","non-ASCII byte encountered",{byte:z,pos:Q+K});W+=String.fromCharCode(z)}return Q+=L,W},cstring(){let L=Q;while(L<H&&Z.getUint8(L)!==0)L++;if(L>=H)throw j("binary/reader-cstring","NUL terminator not found before end of buffer",{pos:Q,length:H});let W=new Uint8Array(U.buffer,U.byteOffset+Q,L-Q),K=T.decode(W);return Q=L+1,K},sub(L,W){if(L<0||W<0||L+W>H)throw j("binary/reader-sub","sub-reader range out of bounds",{offset:L,length:W,parentLength:H});let K=U.subarray(L,L+W);return N(K,{endian:J})}};return F}return{create:N}}};var zJ={name:"binaryWriter",version:"1.0.0",type:"fw.io.binary",dependencies:[],factory(){let N=new TextEncoder;function M(R,J,U){let Z=Error(J);if(Z.name="ContractError",Z.code=R,U)Z.context=U;return Z}function D(R){let J=R||{},U=J.endian==="le"?"le":"be",Z=J.initialSize&&J.initialSize>0?J.initialSize:256,H=new ArrayBuffer(Z),Q=new Uint8Array(H),G=new DataView(H),Y=0,F=0,L=()=>U==="le";function W(O){let C=Y+O;if(C<=Z)return;let q=Z*2;while(q<C)q*=2;let P=new ArrayBuffer(q),$=new Uint8Array(P);$.set(Q.subarray(0,F)),Z=q,H=P,Q=$,G=new DataView(P)}function K(O){if(Y+=O,Y>F)F=Y}let z={get pos(){return Y},get length(){return F},seek(O){if(O<0)throw M("binary/writer-seek","seek offset must be >= 0",{offset:O});return Y=O,z},align(O){if(O<=0)throw M("binary/writer-align","align argument must be > 0",{n:O});let C=Y%O;if(C===0)return z;let q=O-C;W(q);for(let P=0;P<q;P++)Q[Y+P]=0;return K(q),z},u8(O){return W(1),G.setUint8(Y,O&255),K(1),z},u16(O){return W(2),G.setUint16(Y,O&65535,L()),K(2),z},u24(O){if(W(3),L())Q[Y]=O&255,Q[Y+1]=O>>>8&255,Q[Y+2]=O>>>16&255;else Q[Y]=O>>>16&255,Q[Y+1]=O>>>8&255,Q[Y+2]=O&255;return K(3),z},u32(O){return W(4),G.setUint32(Y,O>>>0,L()),K(4),z},u64(O){return W(8),G.setBigUint64(Y,O,L()),K(8),z},i8(O){return W(1),G.setInt8(Y,O),K(1),z},i16(O){return W(2),G.setInt16(Y,O,L()),K(2),z},i32(O){return W(4),G.setInt32(Y,O,L()),K(4),z},i64(O){return W(8),G.setBigInt64(Y,O,L()),K(8),z},f32(O){return W(4),G.setFloat32(Y,O,L()),K(4),z},f64(O){return W(8),G.setFloat64(Y,O,L()),K(8),z},bytes(O){if(!(O instanceof Uint8Array))throw M("binary/writer-bytes","bytes() expects Uint8Array",{actual:typeof O});return W(O.byteLength),Q.set(O,Y),K(O.byteLength),z},utf8(O){if(typeof O!=="string")throw M("binary/writer-utf8","utf8() expects string",{actual:typeof O});let C=N.encode(O);return z.bytes(C)},ascii(O){if(typeof O!=="string")throw M("binary/writer-ascii","ascii() expects string",{actual:typeof O});W(O.length);for(let C=0;C<O.length;C++){let q=O.charCodeAt(C);if(q>127)throw M("binary/writer-ascii","non-ASCII character encountered",{char:O[C],code:q,index:C});Q[Y+C]=q}return K(O.length),z},cstring(O){if(typeof O!=="string")throw M("binary/writer-cstring","cstring() expects string",{actual:typeof O});return z.utf8(O),z.u8(0),z},finalize(){return new Uint8Array(H.slice(0,F))}};return z}return{create:D}}};var VJ={name:"processMessage",version:"1.0.0",type:"fw.process",dependencies:[],factory(){let N=new Set(["postMessage","onmessage","addEventListener","removeEventListener"]),M=()=>{},D=(Y)=>Y!==null&&typeof Y==="object"&&Y.__fw===!0,R=(Y,F)=>{let{data:L,ports:W}=F;if(D(L)){if(L.__type==="cmd"){if(typeof L.name==="string"){let K=Y.handlers.get(L.name);if(K)return K(L.msg,W)}}return}for(let K of Y.listeners)K(F);Y.onmessage(F)},J=(Y)=>{Y.addEventListener=(F,L)=>{if(F==="message"&&typeof L==="function")Y.listeners.push(L)},Y.removeEventListener=(F,L)=>{if(F==="message")Y.listeners=Y.listeners.filter((W)=>W!==L)}},U=(Y)=>{let F={postMessage:(...L)=>Y.postMessage(...L),addEventListener:(...L)=>Y.addEventListener(...L),removeEventListener:(...L)=>Y.removeEventListener(...L)};return new Proxy(Y,{set(L,W,K){if(typeof K==="function"){if(!N.has(W))L.handlers.set(W,K);else if(W==="onmessage")Y.onmessage=K;return!0}if(K===!1){if(!N.has(W))L.handlers.delete(W);else if(W==="onmessage")Y.onmessage=()=>{};return!0}return!1},get(L,W){if(L.handlers.has(W))return L.handlers.get(W);if(N.has(W))return F[W]??!1;return!1}})};return{sync:()=>{let Y=()=>({handlers:new Map,onmessage:M,postMessage:M,addEventListener:M,removeEventListener:M,listeners:[]}),F=Y(),L=Y();return F.postMessage=(W,K)=>R(L,{data:W,ports:K}),J(F),L.postMessage=(W,K)=>R(F,{data:W,ports:K}),J(L),{process:U(F),manager:L}},worker:()=>{let Y={handlers:new Map,onmessage:()=>{},postMessage:(...L)=>self.postMessage(...L),addEventListener:M,removeEventListener:M,listeners:[]},F=U(Y);return J(Y),self.addEventListener("message",(L)=>{if(L&&L.data!==void 0){if(D(L.data))L.stopImmediatePropagation();R(Y,L)}}),F},workerCommand:(Y)=>{return new Proxy(Object.freeze({}),{set:()=>!1,get:(F,L)=>(W,K=[])=>Y.postMessage({["__fw"]:!0,__type:"cmd",name:L,msg:W},K)})},workerFramework:(Y,F,L)=>{let W=Y.resolveAll(F),K=W.processMessage.worker();return{libs:W,process:K,args:L}}}}};var FJ={name:"processRPC",version:"1.0.0",type:"fw.process",dependencies:[],factory(){let R=new Set(["__proto__","constructor","prototype"]),J=new Set(["then","toJSON","valueOf","toString","inspect","nodeType","asymmetricMatch"]),U=(G,Y=0)=>{if(Y>8||G===null||typeof G!=="object")return null;let F=Object.create(null);for(let L of Object.keys(G)){if(R.has(L))continue;let W=G[L];if(typeof W==="function")F[L]="fn";else if(W!==null&&typeof W==="object"&&!Array.isArray(W)){let K=U(W,Y+1);if(K)F[L]=K}else F[L]="val"}return F},Z=(G,Y)=>{let F=G;for(let L of Y){if(typeof L!=="string"||R.has(L))return{ok:!1};if(F===null||typeof F!=="object")return{ok:!1};if(!Object.prototype.hasOwnProperty.call(F,L))return{ok:!1};F=F[L]}return{ok:!0,value:F}};return{create:(G)=>{let Y=U(G),F=new MessageChannel;return F.port1.postMessage({["__rpc_init"]:!0,desc:Y}),F.port1.onmessage=async(L)=>{let W=L.data;if(W===null||typeof W!=="object"||typeof W.id!=="number"||!Array.isArray(W.path))return;let{id:K,path:z,args:O}=W;try{let C=Z(G,z);if(!C.ok){F.port1.postMessage({id:K,error:"Path not found: "+z.join(".")});return}let q=typeof C.value==="function"?await C.value(...Array.isArray(O)?O:[]):C.value;F.port1.postMessage({id:K,result:q})}catch(C){F.port1.postMessage({id:K,error:String(C)})}},{port:[F.port2],close:()=>{F.port1.close()}}},open:(G,Y={})=>{let F=typeof Y.timeout==="number"&&Y.timeout>0?Y.timeout:30000,L=new Map,W=0,K=(C)=>{let{id:q,result:P,error:$}=C.data,X=L.get(q);if(!X)return;if(L.delete(q),clearTimeout(X.timer),$!==void 0)X.reject(Error($));else X.resolve(P)},z=(C,q)=>{let P=W++;if(W>4294967295)W=0;return new Promise(($,X)=>{let V=setTimeout(()=>{L.delete(P),X(Error("RPC timeout: "+C.join(".")))},F);L.set(P,{resolve:$,reject:X,timer:V}),G.postMessage({id:P,path:C,args:q})})},O=(C,q)=>{return new Proxy(Object.create(null),{get(P,$){if(typeof $==="symbol")return;if(R.has($))return;let X=C[$];if(X===void 0){if(J.has($))return;throw Error("RPC endpoint not found: "+[...q,$].join("."))}if(X==="fn")return(...V)=>z([...q,$],V);if(X==="val")return z([...q,$],[]);return O(X,[...q,$])},set(){return!1},has(P,$){if(typeof $==="symbol")return!1;return $ in C}})};return new Promise((C,q)=>{let P=setTimeout(()=>{G.onmessage=null,q(Error("RPC open timeout: descriptor not received"))},F);G.onmessage=($)=>{let X=$.data;if(X&&X.__rpc_init===!0&&X.desc)clearTimeout(P),G.onmessage=K,C(O(X.desc,[]))}})}}}};var qJ={name:"dnd",version:"1.1.0",type:"fw.dom.query",dependencies:[],factory(){let T=null,j=new Set;function N(Q,G,Y){Q.style.left=G+"px",Q.style.top=Y+"px"}function M(Q,G,Y){Q.style.position="fixed",Q.style.pointerEvents="none",Q.style.zIndex="2147483647",Q.style.margin="0",N(Q,G,Y),document.body.appendChild(Q)}function D(Q,G){if(!Q||!Q.parentNode)return;if(G>0)Q.style.transition=`opacity ${G}ms`,Q.style.opacity="0",setTimeout(()=>{if(Q.parentNode)Q.parentNode.removeChild(Q)},G);else Q.parentNode.removeChild(Q)}function R(Q,G){let Y=document.elementsFromPoint?document.elementsFromPoint(Q,G):[];for(let F of j)if(Y.includes(F._el))return F;return null}function J(Q,G){document.dispatchEvent(new CustomEvent(Q,{detail:G,bubbles:!0}))}function U(Q,G={}){if(!Q)throw Error("dnd.draggable: el is required");let Y=G.axis??"both",F=G.threshold??5,L=G.cancelMs??150,W=!0,K=0,z=0,O=!1,C=null,q=null,P=!1;function $(){if(P)return;P=!0,document.addEventListener("pointermove",A),document.addEventListener("pointerup",S,{once:!0}),document.addEventListener("pointercancel",E,{once:!0})}function X(){if(!P)return;P=!1,document.removeEventListener("pointermove",A),document.removeEventListener("pointerup",S),document.removeEventListener("pointercancel",E)}function V(){if(!G.handle)return Q;if(typeof G.handle==="string")return Q.querySelector(G.handle);return G.handle}function B(w){if(!W)return;if(w.button!==void 0&&w.button!==0)return;let f=V();if(f&&!f.contains(w.target)&&f!==w.target)return;if(P)return;K=w.clientX,z=w.clientY,O=!1,q=null,Q.setPointerCapture(w.pointerId),$()}function A(w){let f=w.clientX-K,x=w.clientY-z,u=Math.sqrt(f*f+x*x);if(!O){if(u<F)return;if(T)return;O=!0;let _=null;if(G.data)try{_=G.data()}catch(y){if(O=!1,X(),G.onError)try{G.onError(y)}catch{}return}if(G.preview)C=G.preview(_);else C=Q.cloneNode(!0),C.style.opacity="0.6";if(M(C,w.clientX,w.clientY),T={data:_,preview:C,source:Q,x:w.clientX,y:w.clientY},J("dnd:start",{data:_,source:Q}),G.onStart)G.onStart({data:_,x:w.clientX,y:w.clientY})}let{clientX:v,clientY:d}=w;if(Y==="x")d=z;if(Y==="y")v=K;N(C,v,d),T.x=v,T.y=d;let o=R(v,d);if(o!==q){if(q&&q._accept(T.data)){if(q._opts.hoverClass)q._el.classList.remove(q._opts.hoverClass);if(q._opts.onLeave)q._opts.onLeave(T.data)}if(q=o,q&&q._accept(T.data)){if(q._opts.hoverClass)q._el.classList.add(q._opts.hoverClass);if(q._opts.onEnter)q._opts.onEnter(T.data)}}else if(q&&q._accept(T.data)){if(q._opts.onOver)q._opts.onOver(T.data,{x:v,y:d})}if(G.onMove)G.onMove({data:T.data,x:v,y:d})}function S(w){if(X(),!O){q=null;return}let{clientX:f,clientY:x}=w;if(q&&q._accept(T.data)){if(q._opts.hoverClass)q._el.classList.remove(q._opts.hoverClass);if(q._opts.onDrop(T.data,{x:f,y:x,target:q._el}),q._opts.onLeave)q._opts.onLeave(T.data)}q=null,D(C,L),C=null;let u=T?T.data:null;if(T=null,O=!1,J("dnd:end",{data:u,source:Q}),G.onEnd)G.onEnd({data:u,x:f,y:x})}function E(w){if(X(),!O){q=null;return}let f=w?.clientX??(T?.x??0),x=w?.clientY??(T?.y??0);if(q){if(q._opts.hoverClass)q._el.classList.remove(q._opts.hoverClass);if(q._opts.onLeave)try{q._opts.onLeave(T?.data)}catch{}}q=null,D(C,L),C=null;let u=T?T.data:null;if(T=null,O=!1,J("dnd:end",{data:u,source:Q,cancelled:!0}),G.onEnd)G.onEnd({data:u,x:f,y:x,cancelled:!0})}Q.addEventListener("pointerdown",B);function I(){W=!1}function g(){W=!0}function k(){if(Q.removeEventListener("pointerdown",B),X(),T&&T.source===Q){let{x:w,y:f,data:x}=T;if(q){if(q._opts.hoverClass)q._el.classList.remove(q._opts.hoverClass);if(q._opts.onLeave)try{q._opts.onLeave(x)}catch{}}if(q=null,D(C,0),C=null,T=null,O=!1,J("dnd:end",{data:x,source:Q,cancelled:!0}),G.onEnd)G.onEnd({data:x,x:w,y:f,cancelled:!0})}else{if(C&&C.parentNode)C.parentNode.removeChild(C);C=null}}return{disable:I,enable:g,dispose:k}}function Z(Q,G={}){if(!Q)throw Error("dnd.dropTarget: el is required");if(!G.accept)throw Error("dnd.dropTarget: accept is required");if(!G.onDrop)throw Error("dnd.dropTarget: onDrop is required");let Y={_el:Q,_opts:G,_accept:G.accept};j.add(Y);function F(){j.delete(Y)}return{dispose:F}}function H(){return T}return{draggable:U,dropTarget:Z,active:H}}};var LJ={name:"media",type:"fw.dom.query",dependencies:[],factory(){let T=typeof navigator<"u"?navigator.mediaDevices:null,j=T?.getSupportedConstraints?.()??{},N=Object.keys(j).length>0;function M(X){return!N||!!j[X]}let D={audio:{},video:{}},R={audio:!1,video:!1},J={audio:null,video:null},U={},Z={map:[],list:{}},H={audio:!!(T&&typeof T.getUserMedia==="function"),video:!!(T&&typeof T.getUserMedia==="function"),screen:!!(T&&typeof T.getDisplayMedia==="function")};function Q(X){let V={},B={};for(let A of X)if(A.kind==="audioinput")V[A.deviceId]=A;else if(A.kind==="videoinput")B[A.deviceId]=A;return{audio:V,video:B}}function G(X){D.audio=X.audio,D.video=X.video,R.audio=Object.values(X.audio).some((V)=>!!V.label),R.video=Object.values(X.video).some((V)=>!!V.label)}function Y(){let X={audio:Object.values(D.audio),video:Object.values(D.video)};for(let V of Z.map)Z.list[V](X)}function F(){return T.enumerateDevices().then((X)=>{return G(Q(X)),Y(),{audio:Object.values(D.audio),video:Object.values(D.video)}})}let L=()=>F();if(T&&typeof T.addEventListener==="function")T.addEventListener("devicechange",L);function W(X){let V={};if(X.deviceId!==void 0&&M("deviceId"))V.deviceId={exact:X.deviceId};if(X.sampleRate!==void 0&&M("sampleRate"))V.sampleRate=X.sampleRate;if(X.sampleSize!==void 0&&M("sampleSize"))V.sampleSize=X.sampleSize;if(X.channelCount!==void 0&&M("channelCount"))V.channelCount=X.channelCount;if(X.echoCancellation!==void 0&&M("echoCancellation"))V.echoCancellation=X.echoCancellation;if(X.noiseSuppression!==void 0&&M("noiseSuppression"))V.noiseSuppression=X.noiseSuppression;if(X.autoGainControl!==void 0&&M("autoGainControl"))V.autoGainControl=X.autoGainControl;return{audio:Object.keys(V).length?V:!0,video:!1}}function K(X){let V={};if(X.deviceId!==void 0&&M("deviceId"))V.deviceId={exact:X.deviceId};if(X.width!==void 0&&M("width"))V.width=X.width;if(X.height!==void 0&&M("height"))V.height=X.height;if(X.frameRate!==void 0&&M("frameRate"))V.frameRate=X.frameRate;if(X.aspectRatio!==void 0&&M("aspectRatio"))V.aspectRatio=X.aspectRatio;if(X.facingMode!==void 0&&M("facingMode"))V.facingMode=X.facingMode;return{audio:!1,video:Object.keys(V).length?V:!0}}function z(X){let V={};if(X.frameRate!==void 0)V.frameRate=X.frameRate;if(X.cursor!==void 0)V.cursor=X.cursor;if(X.width!==void 0)V.width=X.width;if(X.height!==void 0)V.height=X.height;return{video:Object.keys(V).length?V:{cursor:"always"},audio:X.audio===!0}}function O(X,V){let B=V.getTracks();return{id:V.id,type:X,stream:V,tracks:B,settings:B.map((A)=>A.getSettings()),constraints:B.map((A)=>A.getConstraints()),stop(){C(V.id)}}}function C(X){let V=U[X];if(!V)return;for(let B of V.tracks)B.stop();delete U[X]}async function q(X={}){let V=X.deviceId??J.audio??void 0,B=W(V!==void 0?{...X,deviceId:V}:X),A=await T.getUserMedia(B);await F();let S=O("audio",A);U[A.id]=S;let E=S.settings[0]?.deviceId;if(E)J.audio=E;return S}async function P(X={}){let V=X.deviceId??J.video??void 0,B=K(V!==void 0?{...X,deviceId:V}:X),A=await T.getUserMedia(B);await F();let S=O("video",A);U[A.id]=S;let E=S.settings[0]?.deviceId;if(E)J.video=E;return S}async function $(X={}){let V=await T.getDisplayMedia(z(X)),B=O("screen",V);U[V.id]=B;for(let A of B.tracks)A.addEventListener("ended",()=>C(V.id),{once:!0});return B}return{isSupported(){return{...H}},permissions(){return{...R}},devices:{refresh:F,list(){return{audio:Object.values(D.audio),video:Object.values(D.video)}},audio(){return Object.values(D.audio)},video(){return Object.values(D.video)},listen:{add(X,V){if(Z.map.indexOf(X)<0)Z.map.push(X);Z.list[X]=V},del(X){let V=Z.map.indexOf(X);if(V>-1)Z.map.splice(V,1),delete Z.list[X]}}},audio:{start:q},video:{start:P},screen:{start:$},streams:{list(){return Object.values(U)},get(X){return U[X]??null},byType(X){return Object.values(U).filter((V)=>V.type===X)},stop(X){C(X)},stopAll(){for(let X of Object.keys(U))C(X)},stopType(X){for(let V of Object.keys(U))if(U[V]?.type===X)C(V)}},select(X,V){if(X==="audio"||X==="video")J[X]=V},selected(){return{...J}},dispose(){for(let X of Object.keys(U))C(X);if(T&&typeof T.removeEventListener==="function")T.removeEventListener("devicechange",L);Z.map.length=0;for(let X of Object.keys(Z.list))delete Z.list[X];D.audio={},D.video={}}}}};var i$={DEV:!1,LOG:!0},OJ=i$.LOG?o$.main(i$.DEV):!1,r$=new I$;r$.registerAllDeep([ZZ,w$,k$,g$,JZ,x$,f$,H$,V$,_$,QZ,XZ,GZ,YZ,N$,y$,T$,UZ,q$,v$,b$,u$,WZ,L$,KZ,HZ,zZ,VZ,FZ,qZ,LZ,OZ,DZ,BZ,p$,CZ,jZ,m$,RZ,MZ,SZ,IZ,EZ,wZ,kZ,gZ,xZ,fZ,hZ,_Z,yZ,h$,vZ,bZ,uZ,mZ,pZ,cZ,dZ,lZ,iZ,nZ,oZ,rZ,sZ,aZ,tZ,eZ,$J,ZJ,JJ,QJ,XJ,GJ,YJ,UJ,S$,WJ,l$,KJ,HJ,zJ,VJ,FJ,qJ,LJ]);var BJ=e$(i$,r$,t$,OJ,o$.worker.toString()),CJ=$Z(),jJ={ENV:i$,log:OJ,runtime:r$,createWorker:BJ,domReady:CJ},i6=jJ;export{i6 as default};
58
+ }`:""}function k(){let m=document.getElementById(H);if(!m)m=document.createElement("style"),m.id=H,document.head.appendChild(m);return m}function g(){let m=w();if(S){if(L)L.set(m);else L=S.attach(m,{id:H});return}let c=k();c.textContent=m}function x(){let m=B(),c=D?D.matches:!1,o=m!==J||c!==U;if(J=m,U=c,g(),o){let $$={mode:G,resolved:J,reducedMotion:U};for(let e of W)e($$)}}function f(){if(C&&K)C.removeEventListener("change",K);if(P&&O)P.removeEventListener("change",O);if(D&&M)D.removeEventListener("change",M);if(F&&z)F.removeEventListener("change",z);C=window.matchMedia("(prefers-color-scheme: dark)"),P=window.matchMedia("(prefers-contrast: more)"),D=window.matchMedia("(prefers-reduced-motion: reduce)"),F=window.matchMedia("(forced-colors: active)"),K=()=>x(),O=()=>x(),M=()=>x(),z=()=>x(),C.addEventListener("change",K),P.addEventListener("change",O),D.addEventListener("change",M),F.addEventListener("change",z)}f(),J=B(),U=D?D.matches:!1;function y(m){if(Q)return;for(let[c,o]of Object.entries(m))Y[c]=o;g()}function _(m){if(!["light","dark","auto","high-contrast"].includes(m))throw Error(`themeTokens: invalid mode "${m}"`);if(Q)return;G=m,J=B(),U=D?D.matches:!1,g();let c={mode:G,resolved:J,reducedMotion:U};for(let o of W)o(c)}function v(){return{mode:G,resolved:J,reducedMotion:U}}function b(m){if(Q)return"";let{element:c}=A(),o=X instanceof Element?X:c;return getComputedStyle(o).getPropertyValue(`--${V}${m}`).trim()}function h(m){if(Q)return()=>{};return W.add(m),()=>W.delete(m)}function d(){if(Q)return;if(Q=!0,C&&K)C.removeEventListener("change",K);if(P&&O)P.removeEventListener("change",O);if(D&&M)D.removeEventListener("change",M);if(F&&z)F.removeEventListener("change",z);if(C=P=D=F=null,K=O=M=z=null,W.clear(),L){L.detach(),L=null;return}let m=document.getElementById(H);if(m)m.remove()}function n(m){if(Q)return;let c=typeof m==="string"?Z[m]:m;if(!c)throw Error(`themeTokens.applyPreset: unknown preset '${m}'`);y(c)}return{define:y,mode:_,current:v,get:b,onChange:h,dispose:d,applyPreset:n}}return{create:q,presets:Z}}};var t$={name:"stats",version:"1.0.0",type:"fw.io.math",dependencies:[],factory(){function E(F){if(!F||F.length===0)throw Error("stats: empty array");for(let K=0;K<F.length;K++)if(typeof F[K]!=="number"||Number.isNaN(F[K]))throw Error("stats: NaN in input")}function S(F){E(F);let K=0;for(let O=0;O<F.length;O++)K+=F[O];return K}function T(F){E(F);let K=1;for(let O=0;O<F.length;O++)K*=F[O];return K}function N(F){E(F);let K=0;for(let O=0;O<F.length;O++)K+=F[O];return K/F.length}function R(F){E(F);let K=F[0];for(let O=1;O<F.length;O++)if(F[O]<K)K=F[O];return K}function j(F){E(F);let K=F[0];for(let O=1;O<F.length;O++)if(F[O]>K)K=F[O];return K}function Z(F){return j(F)-R(F)}function q(F){return[...F].sort((K,O)=>K-O)}function $(F){E(F);let K=q(F),O=K.length,M=Math.floor(O/2);return O%2===0?(K[M-1]+K[M])/2:K[M]}function V(F){E(F);let K=new Map;for(let z of F)K.set(z,(K.get(z)??0)+1);let O=F[0],M=0;for(let[z,B]of K)if(B>M)O=z,M=B;return O}function X(F){E(F);let K=0;for(let O of F)K+=Math.log(O);return Math.exp(K/F.length)}function H(F){E(F);let K=0;for(let O of F)K+=1/O;return F.length/K}function Q(F,K=!1){E(F);let O=N(F),M=0;for(let z of F)M+=(z-O)**2;return M/(K?F.length-1:F.length)}function L(F,K=!1){return Math.sqrt(Q(F,K))}function Y(F,K){if(E(F),K<0||K>1)throw Error("stats: q must be in [0, 1]");let O=q(F),M=O.length;if(M===1)return O[0];let z=K*(M-1),B=Math.floor(z),I=Math.ceil(z);if(B===I)return O[B];return O[B]+(z-B)*(O[I]-O[B])}function G(F,K){return Y(F,K/100)}function J(F){return Y(F,0.75)-Y(F,0.25)}function U(F){E(F);let K=$(F),O=F.map((M)=>Math.abs(M-K));return $(O)}function W(F,K){E(F);let O=R(F),M=j(F),z;if(Array.isArray(K))z=K;else{let I=typeof K==="number"?K:10,A=(M-O)/I;z=[];for(let w=0;w<=I;w++)z.push(O+w*A)}let B=Array(z.length-1).fill(0);for(let I of F)for(let A=0;A<z.length-1;A++)if(I>=z[A]&&(I<z[A+1]||A===z.length-2&&I<=z[A+1])){B[A]++;break}return{edges:z,counts:B}}function C(F,K){let O=N(K),M=L(K);if(M===0)return 0;return(F-O)/M}function P(F,{min:K=0,max:O=1}={}){E(F);let M=R(F),B=j(F)-M;if(B===0)return Array.from(F,()=>K);return Array.from(F,(I)=>K+(I-M)/B*(O-K))}function D(F){let K=N(F),O=L(F);if(O===0)return Array.from(F,()=>0);return Array.from(F,(M)=>(M-K)/O)}return{mean:N,median:$,mode:V,geomean:X,harmean:H,variance:Q,stddev:L,range:Z,iqr:J,mad:U,min:R,max:j,sum:S,product:T,quantile:Y,percentile:G,histogram:W,zscore:C,normalize:P,standardize:D}}};var k$={name:"linalg",version:"1.0.0",type:"fw.io.math",dependencies:[],factory(){let S={create(Z){let q=new Float32Array(2);if(Z)q[0]=Z[0],q[1]=Z[1];return q},copy(Z,q){return Z[0]=q[0],Z[1]=q[1],Z},set(Z,q,$){return Z[0]=q,Z[1]=$,Z},add(Z,q,$){return Z[0]=q[0]+$[0],Z[1]=q[1]+$[1],Z},sub(Z,q,$){return Z[0]=q[0]-$[0],Z[1]=q[1]-$[1],Z},mul(Z,q,$){return Z[0]=q[0]*$[0],Z[1]=q[1]*$[1],Z},scale(Z,q,$){return Z[0]=q[0]*$,Z[1]=q[1]*$,Z},dot(Z,q){return Z[0]*q[0]+Z[1]*q[1]},length(Z){return Math.sqrt(Z[0]*Z[0]+Z[1]*Z[1])},lengthSq(Z){return Z[0]*Z[0]+Z[1]*Z[1]},normalize(Z,q){let $=Math.sqrt(q[0]*q[0]+q[1]*q[1])||1;return Z[0]=q[0]/$,Z[1]=q[1]/$,Z},distance(Z,q){let $=Z[0]-q[0],V=Z[1]-q[1];return Math.sqrt($*$+V*V)},lerp(Z,q,$,V){return Z[0]=q[0]+($[0]-q[0])*V,Z[1]=q[1]+($[1]-q[1])*V,Z},equals(Z,q,$=0.000001){return Math.abs(Z[0]-q[0])<=$&&Math.abs(Z[1]-q[1])<=$}},T={create(Z){let q=new Float32Array(3);if(Z)q[0]=Z[0],q[1]=Z[1],q[2]=Z[2];return q},copy(Z,q){return Z[0]=q[0],Z[1]=q[1],Z[2]=q[2],Z},set(Z,q,$,V){return Z[0]=q,Z[1]=$,Z[2]=V,Z},add(Z,q,$){return Z[0]=q[0]+$[0],Z[1]=q[1]+$[1],Z[2]=q[2]+$[2],Z},sub(Z,q,$){return Z[0]=q[0]-$[0],Z[1]=q[1]-$[1],Z[2]=q[2]-$[2],Z},mul(Z,q,$){return Z[0]=q[0]*$[0],Z[1]=q[1]*$[1],Z[2]=q[2]*$[2],Z},scale(Z,q,$){return Z[0]=q[0]*$,Z[1]=q[1]*$,Z[2]=q[2]*$,Z},dot(Z,q){return Z[0]*q[0]+Z[1]*q[1]+Z[2]*q[2]},cross(Z,q,$){let V=q[0],X=q[1],H=q[2],Q=$[0],L=$[1],Y=$[2];return Z[0]=X*Y-H*L,Z[1]=H*Q-V*Y,Z[2]=V*L-X*Q,Z},length(Z){return Math.sqrt(Z[0]*Z[0]+Z[1]*Z[1]+Z[2]*Z[2])},lengthSq(Z){return Z[0]*Z[0]+Z[1]*Z[1]+Z[2]*Z[2]},normalize(Z,q){let $=Math.sqrt(q[0]*q[0]+q[1]*q[1]+q[2]*q[2])||1;return Z[0]=q[0]/$,Z[1]=q[1]/$,Z[2]=q[2]/$,Z},distance(Z,q){let $=Z[0]-q[0],V=Z[1]-q[1],X=Z[2]-q[2];return Math.sqrt($*$+V*V+X*X)},lerp(Z,q,$,V){return Z[0]=q[0]+($[0]-q[0])*V,Z[1]=q[1]+($[1]-q[1])*V,Z[2]=q[2]+($[2]-q[2])*V,Z},equals(Z,q,$=0.000001){return Math.abs(Z[0]-q[0])<=$&&Math.abs(Z[1]-q[1])<=$&&Math.abs(Z[2]-q[2])<=$}},N={create(Z){let q=new Float32Array(4);if(Z)q[0]=Z[0],q[1]=Z[1],q[2]=Z[2],q[3]=Z[3];return q},copy(Z,q){return Z[0]=q[0],Z[1]=q[1],Z[2]=q[2],Z[3]=q[3],Z},set(Z,q,$,V,X){return Z[0]=q,Z[1]=$,Z[2]=V,Z[3]=X,Z},add(Z,q,$){return Z[0]=q[0]+$[0],Z[1]=q[1]+$[1],Z[2]=q[2]+$[2],Z[3]=q[3]+$[3],Z},sub(Z,q,$){return Z[0]=q[0]-$[0],Z[1]=q[1]-$[1],Z[2]=q[2]-$[2],Z[3]=q[3]-$[3],Z},mul(Z,q,$){return Z[0]=q[0]*$[0],Z[1]=q[1]*$[1],Z[2]=q[2]*$[2],Z[3]=q[3]*$[3],Z},scale(Z,q,$){return Z[0]=q[0]*$,Z[1]=q[1]*$,Z[2]=q[2]*$,Z[3]=q[3]*$,Z},dot(Z,q){return Z[0]*q[0]+Z[1]*q[1]+Z[2]*q[2]+Z[3]*q[3]},length(Z){return Math.sqrt(Z[0]*Z[0]+Z[1]*Z[1]+Z[2]*Z[2]+Z[3]*Z[3])},lengthSq(Z){return Z[0]*Z[0]+Z[1]*Z[1]+Z[2]*Z[2]+Z[3]*Z[3]},normalize(Z,q){let $=Math.sqrt(q[0]*q[0]+q[1]*q[1]+q[2]*q[2]+q[3]*q[3])||1;return Z[0]=q[0]/$,Z[1]=q[1]/$,Z[2]=q[2]/$,Z[3]=q[3]/$,Z},distance(Z,q){let $=Z[0]-q[0],V=Z[1]-q[1],X=Z[2]-q[2],H=Z[3]-q[3];return Math.sqrt($*$+V*V+X*X+H*H)},lerp(Z,q,$,V){return Z[0]=q[0]+($[0]-q[0])*V,Z[1]=q[1]+($[1]-q[1])*V,Z[2]=q[2]+($[2]-q[2])*V,Z[3]=q[3]+($[3]-q[3])*V,Z},equals(Z,q,$=0.000001){return Math.abs(Z[0]-q[0])<=$&&Math.abs(Z[1]-q[1])<=$&&Math.abs(Z[2]-q[2])<=$&&Math.abs(Z[3]-q[3])<=$}},R={create(){let Z=new Float32Array(9);return Z[0]=1,Z[4]=1,Z[8]=1,Z},identity(Z){return Z.fill(0),Z[0]=1,Z[4]=1,Z[8]=1,Z},copy(Z,q){for(let $=0;$<9;$++)Z[$]=q[$];return Z},multiply(Z,q,$){let[V,X,H,Q,L,Y,G,J,U]=q,[W,C,P,D,F,K,O,M,z]=$;return Z[0]=V*W+Q*C+G*P,Z[1]=X*W+L*C+J*P,Z[2]=H*W+Y*C+U*P,Z[3]=V*D+Q*F+G*K,Z[4]=X*D+L*F+J*K,Z[5]=H*D+Y*F+U*K,Z[6]=V*O+Q*M+G*z,Z[7]=X*O+L*M+J*z,Z[8]=H*O+Y*M+U*z,Z},translate(Z,q,$){let[V,X,H,Q,L,Y,G,J,U]=q,W=$[0],C=$[1];return Z[0]=V,Z[1]=X,Z[2]=H,Z[3]=Q,Z[4]=L,Z[5]=Y,Z[6]=V*W+Q*C+G,Z[7]=X*W+L*C+J,Z[8]=H*W+Y*C+U,Z},rotate(Z,q,$){let V=Math.cos($),X=Math.sin($),[H,Q,L,Y,G,J,U,W,C]=q;return Z[0]=H*V+Y*X,Z[1]=Q*V+G*X,Z[2]=L*V+J*X,Z[3]=Y*V-H*X,Z[4]=G*V-Q*X,Z[5]=J*V-L*X,Z[6]=U,Z[7]=W,Z[8]=C,Z},scale(Z,q,$){let V=$[0],X=$[1],[H,Q,L,Y,G,J,U,W,C]=q;return Z[0]=H*V,Z[1]=Q*V,Z[2]=L*V,Z[3]=Y*X,Z[4]=G*X,Z[5]=J*X,Z[6]=U,Z[7]=W,Z[8]=C,Z},determinant(Z){let[q,$,V,X,H,Q,L,Y,G]=Z;return q*(H*G-Q*Y)-X*($*G-V*Y)+L*($*Q-V*H)},invert(Z,q){let $=R.determinant(q);if(Math.abs($)<0.0000000001)return!1;let V=1/$,[X,H,Q,L,Y,G,J,U,W]=q;return Z[0]=(Y*W-G*U)*V,Z[1]=(Q*U-H*W)*V,Z[2]=(H*G-Q*Y)*V,Z[3]=(G*J-L*W)*V,Z[4]=(X*W-Q*J)*V,Z[5]=(Q*L-X*G)*V,Z[6]=(L*U-Y*J)*V,Z[7]=(H*J-X*U)*V,Z[8]=(X*Y-H*L)*V,!0},transpose(Z,q){if(Z===q){let $;$=q[1],Z[1]=q[3],Z[3]=$,$=q[2],Z[2]=q[6],Z[6]=$,$=q[5],Z[5]=q[7],Z[7]=$}else Z[0]=q[0],Z[1]=q[3],Z[2]=q[6],Z[3]=q[1],Z[4]=q[4],Z[5]=q[7],Z[6]=q[2],Z[7]=q[5],Z[8]=q[8];return Z},transform(Z,q,$){let V=$[0],X=$[1];return Z[0]=q[0]*V+q[3]*X+q[6],Z[1]=q[1]*V+q[4]*X+q[7],Z}};return{vec2:S,vec3:T,vec4:N,mat3:R,mat4:{create(){let Z=new Float32Array(16);return Z[0]=1,Z[5]=1,Z[10]=1,Z[15]=1,Z},identity(Z){return Z.fill(0),Z[0]=1,Z[5]=1,Z[10]=1,Z[15]=1,Z},copy(Z,q){for(let $=0;$<16;$++)Z[$]=q[$];return Z},multiply(Z,q,$){let V=q[0],X=q[1],H=q[2],Q=q[3],L=q[4],Y=q[5],G=q[6],J=q[7],U=q[8],W=q[9],C=q[10],P=q[11],D=q[12],F=q[13],K=q[14],O=q[15],M=$[0],z=$[1],B=$[2],I=$[3];return Z[0]=V*M+L*z+U*B+D*I,Z[1]=X*M+Y*z+W*B+F*I,Z[2]=H*M+G*z+C*B+K*I,Z[3]=Q*M+J*z+P*B+O*I,M=$[4],z=$[5],B=$[6],I=$[7],Z[4]=V*M+L*z+U*B+D*I,Z[5]=X*M+Y*z+W*B+F*I,Z[6]=H*M+G*z+C*B+K*I,Z[7]=Q*M+J*z+P*B+O*I,M=$[8],z=$[9],B=$[10],I=$[11],Z[8]=V*M+L*z+U*B+D*I,Z[9]=X*M+Y*z+W*B+F*I,Z[10]=H*M+G*z+C*B+K*I,Z[11]=Q*M+J*z+P*B+O*I,M=$[12],z=$[13],B=$[14],I=$[15],Z[12]=V*M+L*z+U*B+D*I,Z[13]=X*M+Y*z+W*B+F*I,Z[14]=H*M+G*z+C*B+K*I,Z[15]=Q*M+J*z+P*B+O*I,Z},translate(Z,q,$){let V=$[0],X=$[1],H=$[2];if(Z!==q)for(let Q=0;Q<16;Q++)Z[Q]=q[Q];return Z[12]=q[0]*V+q[4]*X+q[8]*H+q[12],Z[13]=q[1]*V+q[5]*X+q[9]*H+q[13],Z[14]=q[2]*V+q[6]*X+q[10]*H+q[14],Z[15]=q[3]*V+q[7]*X+q[11]*H+q[15],Z},rotate(Z,q,$,V){let X=V[0],H=V[1],Q=V[2],L=Math.sqrt(X*X+H*H+Q*Q)||1;X/=L,H/=L,Q/=L;let Y=Math.cos($),G=Math.sin($),J=1-Y,U=X*X*J+Y,W=H*X*J+Q*G,C=Q*X*J-H*G,P=X*H*J-Q*G,D=H*H*J+Y,F=Q*H*J+X*G,K=X*Q*J+H*G,O=H*Q*J-X*G,M=Q*Q*J+Y,[z,B,I,A,w,k,g,x,f,y,_,v]=q;if(Z[0]=z*U+w*W+f*C,Z[1]=B*U+k*W+y*C,Z[2]=I*U+g*W+_*C,Z[3]=A*U+x*W+v*C,Z[4]=z*P+w*D+f*F,Z[5]=B*P+k*D+y*F,Z[6]=I*P+g*D+_*F,Z[7]=A*P+x*D+v*F,Z[8]=z*K+w*O+f*M,Z[9]=B*K+k*O+y*M,Z[10]=I*K+g*O+_*M,Z[11]=A*K+x*O+v*M,Z!==q)Z[12]=q[12],Z[13]=q[13],Z[14]=q[14],Z[15]=q[15];return Z},scale(Z,q,$){let V=$[0],X=$[1],H=$[2];return Z[0]=q[0]*V,Z[1]=q[1]*V,Z[2]=q[2]*V,Z[3]=q[3]*V,Z[4]=q[4]*X,Z[5]=q[5]*X,Z[6]=q[6]*X,Z[7]=q[7]*X,Z[8]=q[8]*H,Z[9]=q[9]*H,Z[10]=q[10]*H,Z[11]=q[11]*H,Z[12]=q[12],Z[13]=q[13],Z[14]=q[14],Z[15]=q[15],Z},invert(Z,q){let[$,V,X,H,Q,L,Y,G,J,U,W,C,P,D,F,K]=q,O=$*L-V*Q,M=$*Y-X*Q,z=$*G-H*Q,B=V*Y-X*L,I=V*G-H*L,A=X*G-H*Y,w=J*D-U*P,k=J*F-W*P,g=J*K-C*P,x=U*F-W*D,f=U*K-C*D,y=W*K-C*F,_=O*y-M*f+z*x+B*g-I*k+A*w;if(!_)return!1;return _=1/_,Z[0]=(L*y-Y*f+G*x)*_,Z[1]=(X*f-V*y-H*x)*_,Z[2]=(D*A-F*I+K*B)*_,Z[3]=(W*I-U*A-C*B)*_,Z[4]=(Y*g-Q*y-G*k)*_,Z[5]=($*y-X*g+H*k)*_,Z[6]=(F*z-P*A-K*M)*_,Z[7]=(J*A-W*z+C*M)*_,Z[8]=(Q*f-L*g+G*w)*_,Z[9]=(V*g-$*f-H*w)*_,Z[10]=(P*I-D*z+K*O)*_,Z[11]=(U*z-J*I-C*O)*_,Z[12]=(L*k-Q*x-Y*w)*_,Z[13]=($*x-V*k+X*w)*_,Z[14]=(D*M-P*B-F*O)*_,Z[15]=(J*B-U*M+W*O)*_,!0},transpose(Z,q){if(Z===q){let $;$=q[1],Z[1]=q[4],Z[4]=$,$=q[2],Z[2]=q[8],Z[8]=$,$=q[3],Z[3]=q[12],Z[12]=$,$=q[6],Z[6]=q[9],Z[9]=$,$=q[7],Z[7]=q[13],Z[13]=$,$=q[11],Z[11]=q[14],Z[14]=$}else Z[0]=q[0],Z[1]=q[4],Z[2]=q[8],Z[3]=q[12],Z[4]=q[1],Z[5]=q[5],Z[6]=q[9],Z[7]=q[13],Z[8]=q[2],Z[9]=q[6],Z[10]=q[10],Z[11]=q[14],Z[12]=q[3],Z[13]=q[7],Z[14]=q[11],Z[15]=q[15];return Z},perspective(Z,q,$,V,X){let H=1/Math.tan(q/2),Q=1/(V-X);return Z.fill(0),Z[0]=H/$,Z[5]=H,Z[10]=(X+V)*Q,Z[11]=-1,Z[14]=2*X*V*Q,Z},ortho(Z,q,$,V,X,H,Q){let L=1/(q-$),Y=1/(V-X),G=1/(H-Q);return Z[0]=-2*L,Z[1]=0,Z[2]=0,Z[3]=0,Z[4]=0,Z[5]=-2*Y,Z[6]=0,Z[7]=0,Z[8]=0,Z[9]=0,Z[10]=2*G,Z[11]=0,Z[12]=(q+$)*L,Z[13]=(X+V)*Y,Z[14]=(Q+H)*G,Z[15]=1,Z},lookAt(Z,q,$,V){let X=q[0],H=q[1],Q=q[2],L=$[0],Y=$[1],G=$[2],J=X-L,U=H-Y,W=Q-G,C=Math.sqrt(J*J+U*U+W*W)||1;J/=C,U/=C,W/=C;let P=V[1]*W-V[2]*U,D=V[2]*J-V[0]*W,F=V[0]*U-V[1]*J,K=Math.sqrt(P*P+D*D+F*F)||1;P/=K,D/=K,F/=K;let O=U*F-W*D,M=W*P-J*F,z=J*D-U*P;return Z[0]=P,Z[1]=O,Z[2]=J,Z[3]=0,Z[4]=D,Z[5]=M,Z[6]=U,Z[7]=0,Z[8]=F,Z[9]=z,Z[10]=W,Z[11]=0,Z[12]=-(P*X+D*H+F*Q),Z[13]=-(O*X+M*H+z*Q),Z[14]=-(J*X+U*H+W*Q),Z[15]=1,Z},transform(Z,q,$){let V=$[0],X=$[1],H=$[2],Q=q[3]*V+q[7]*X+q[11]*H+q[15]||1;return Z[0]=(q[0]*V+q[4]*X+q[8]*H+q[12])/Q,Z[1]=(q[1]*V+q[5]*X+q[9]*H+q[13])/Q,Z[2]=(q[2]*V+q[6]*X+q[10]*H+q[14])/Q,Z},transform4(Z,q,$){let V=$[0],X=$[1],H=$[2],Q=$[3];return Z[0]=q[0]*V+q[4]*X+q[8]*H+q[12]*Q,Z[1]=q[1]*V+q[5]*X+q[9]*H+q[13]*Q,Z[2]=q[2]*V+q[6]*X+q[10]*H+q[14]*Q,Z[3]=q[3]*V+q[7]*X+q[11]*H+q[15]*Q,Z}}}}};var QJ={name:"chart",version:"1.0.0",type:"fw.dom.rendering",dependencies:["dom","animate","stats","linalg"],deps:[F$,d$,t$,k$],factory(E,S,T,N){function R(z){if(!Array.isArray(z)||z.length===0)return[];if(typeof z[0]==="number")return z.map((B,I)=>({x:I,y:B}));return z.map((B)=>({x:Number(B.x),y:Number(B.y)}))}function j(z){if(!z.length)return[0,1];let B=T.min(z),I=T.max(z);if(B===I)return[B-1,I+1];return[B,I]}function Z(z,B){if(B&&B.length===2)return[B[0],B[1]];let[I,A]=j(z),w=(A-I)*0.05;return[I-w,A+w]}let q=[1,2,2.5,5,10];function $(z,B,I=5){if(!(isFinite(z)&&isFinite(B))||!(B>z))return{ticks:[z],decimals:2};let A=(B-z)/Math.max(1,I-1),w=Math.floor(Math.log10(A)),k=Math.pow(10,w),g=10;for(let v of q)if(A<=v*k*1.000000001){g=v;break}let x=g*k,f=Math.max(0,-w)+(g===2.5?1:0),y=[],_=Math.ceil(z/x-0.000000001);for(let v=_;v*x<=B+x*0.000000001;v++)y.push(Number((v*x).toFixed(Math.min(f,20))));return{ticks:y,decimals:f}}function V(z,B,I,A){if(I===B)return A/2;return(z-B)/(I-B)*A}function X(z,B){let I=z.length;if(I<2)return 0;if(B===0)return(z[1].y-z[0].y)/(z[1].x-z[0].x||1);if(B===I-1)return(z[I-1].y-z[I-2].y)/(z[I-1].x-z[I-2].x||1);let A=(z[B].y-z[B-1].y)/(z[B].x-z[B-1].x||1),w=(z[B+1].y-z[B].y)/(z[B+1].x-z[B].x||1);if(A*w<=0)return 0;let k=(A+w)/2;return Math.sign(k)*Math.min(Math.abs(k),3*Math.min(Math.abs(A),Math.abs(w)))}function H(z){if(z&&z.tagName==="CANVAS")return z;let B=document.createElement("canvas");return z.appendChild(B),B}function Q(z,B,I){let A=(typeof devicePixelRatio==="number"?devicePixelRatio:1)||1;z.width=Math.round(B*A),z.height=Math.round(I*A),z.style.width=B+"px",z.style.height=I+"px";let w=z.getContext("2d");if(w)w.scale(A,A);return w}function L(z){let B=z.clientWidth||z.width||300,I=z.clientHeight||z.height||150;return{w:B,h:I}}let Y={top:10,right:10,bottom:30,left:40},G="10px sans-serif";function J(z,B){if(z&&typeof z.measureText==="function"){let I=z.measureText(B);if(I&&typeof I.width==="number")return I.width}return 6*String(B).length}function U(z,B,I,A,w,k,g){let x=(d,n,m)=>{let c=d&&d.ticks,o=c?null:$(n,m,5),$$=c||o.ticks,e=d&&d.format||(o?(t)=>String(Number(t.toFixed(Math.min(o.decimals,20)))):(t)=>String(Math.round(t*100)/100));return{ticks:$$,fmt:e}},f=x(g,A,w),y=x(k,B,I);if(z)z.font=G;let _=0;for(let d of f.ticks)_=Math.max(_,J(z,f.fmt(d)));let v=y.ticks.length?J(z,y.fmt(y.ticks[0])):0,b=y.ticks.length?J(z,y.fmt(y.ticks[y.ticks.length-1])):0;return{pad:{top:Y.top,bottom:Y.bottom,left:Math.max(Y.left,Math.ceil(_)+8,Math.ceil(v/2)+2),right:Math.max(Y.right,Math.ceil(b/2)+2)},xTicks:y.ticks,yTicks:f.ticks,xFmt:y.fmt,yFmt:f.fmt}}function W(z,B,I,A,w,k,g,x,f){let{w:y,h:_}=B,v=f||U(z,I,A,w,k,g,x),b=v.pad.left,h=v.pad.right,d=v.pad.top,n=v.pad.bottom,m=y-b-h,c=_-d-n;z.save(),z.strokeStyle="#888",z.fillStyle="#888",z.lineWidth=1,z.font=G,z.textAlign="right",z.textBaseline="middle";let{yTicks:o,yFmt:$$}=v;for(let G$ of o){let Q$=d+c-V(G$,w,k,c);z.beginPath(),z.moveTo(b-4,Q$),z.lineTo(b,Q$),z.stroke(),z.fillText($$(G$),b-6,Q$)}let{xTicks:e,xFmt:t}=v;z.textAlign="center",z.textBaseline="top";for(let G$ of e){let Q$=b+V(G$,I,A,m);z.beginPath(),z.moveTo(Q$,d+c),z.lineTo(Q$,d+c+4),z.stroke(),z.fillText(t(G$),Q$,d+c+6)}z.beginPath(),z.moveTo(b,d),z.lineTo(b,d+c),z.lineTo(b+m,d+c),z.stroke(),z.restore()}function C(z,B,I,A,w,k,g,x,f,y,_){if(!I.length)return;let{w:v,h:b}=B,h=_||Y,d=h.left,n=h.right,m=h.top,c=h.bottom,o=v-d-n,$$=b-m-c;z.save(),z.beginPath();let e=(u)=>d+V(u,A,w,o),t=(u)=>m+$$-V(u,k,g,$$),G$=e(I[0].x),Q$=t(I[0].y);if(z.moveTo(G$,Q$),f==="monotone"&&I.length>2)for(let u=0;u<I.length-1;u++){let r=e(I[u].x+(I[u+1].x-I[u].x)/3),l=t(I[u].y+X(I,u)*(I[u+1].x-I[u].x)/3),p=e(I[u+1].x-(I[u+1].x-I[u].x)/3),i=t(I[u+1].y-X(I,u+1)*(I[u+1].x-I[u].x)/3);z.bezierCurveTo(r,l,p,i,e(I[u+1].x),t(I[u+1].y))}else for(let u=1;u<I.length;u++)z.lineTo(e(I[u].x),t(I[u].y));if(y){let u=m+$$;z.lineTo(e(I[I.length-1].x),u),z.lineTo(e(I[0].x),u),z.closePath();let r=z.globalAlpha;if(z.fillStyle=x,z.globalAlpha=r*51/255,z.fill(),z.globalAlpha=r,z.beginPath(),z.moveTo(G$,Q$),f==="monotone"&&I.length>2)for(let l=0;l<I.length-1;l++){let p=e(I[l].x+(I[l+1].x-I[l].x)/3),i=t(I[l].y+X(I,l)*(I[l+1].x-I[l].x)/3),a=e(I[l+1].x-(I[l+1].x-I[l].x)/3),Z$=t(I[l+1].y-X(I,l+1)*(I[l+1].x-I[l].x)/3);z.bezierCurveTo(p,i,a,Z$,e(I[l+1].x),t(I[l+1].y))}else for(let l=1;l<I.length;l++)z.lineTo(e(I[l].x),t(I[l].y))}z.strokeStyle=x,z.lineWidth=1.5,z.stroke(),z.restore()}function P(z,B,I,A,w,k,g,x,f){if(!I.length)return;let{w:y,h:_}=B,v=f||Y,b=v.left,h=v.right,d=v.top,n=v.bottom,m=y-b-h,c=_-d-n,o=(Q$)=>b+V(Q$,A,w,m),$$=(Q$)=>d+c-V(Q$,k,g,c),e=Math.max(2,m/I.length*0.7),t=d+c;z.save(),z.fillStyle=x,z.strokeStyle=x,z.lineWidth=1;let G$=z.globalAlpha;for(let Q$ of I){let u=o(Q$.x)-e/2,r=$$(Q$.y),l=t-r;if(l>0)z.globalAlpha=G$*170/255,z.fillRect(u,r,e,l),z.globalAlpha=G$,z.strokeRect(u,r,e,l)}z.restore()}function D(z,B){let I=Object.assign({color:"#4a9eff",smoothing:"none",animate:!1},z),A=R(I.data||[]),w=H(I.el),k=null,g=!1,x=null,f={data:A,xDomain:[0,1],yDomain:[0,1],pad:Y};function y(){let c=A.map(($$)=>$$.x),o=A.map(($$)=>$$.y);f.xDomain=Z(c,I.xAxis&&I.xAxis.domain),f.yDomain=Z(o,I.yAxis&&I.yAxis.domain)}function _(){if(g)return;y();let{w:c,h:o}=L(w),$$=Q(w,c,o);if(!$$)return;$$.clearRect(0,0,c,o);let[e,t]=f.xDomain,[G$,Q$]=f.yDomain,u=U($$,e,t,G$,Q$,I.xAxis,I.yAxis);if(f.pad=u.pad,W($$,{w:c,h:o},e,t,G$,Q$,I.xAxis,I.yAxis,u),B!=="bar")C($$,{w:c,h:o},A,e,t,G$,Q$,I.color,I.smoothing||"none",B==="area",u.pad);else P($$,{w:c,h:o},A,e,t,G$,Q$,I.color,u.pad)}function v(){if(g)return;if(x!==null)cancelAnimationFrame(x);let c=typeof I.animate==="number"?I.animate:300,{w:o,h:$$}=L(w),e=Q(w,o,$$);if(!e){_();return}let t={ts:null};function G$(Q$){if(g)return;if(t.ts===null)t.ts=Q$;let u=Q$-t.ts,r=Math.min(u/c,1);if(e.globalAlpha=r,_(),e.globalAlpha=1,r<1)x=requestAnimationFrame(G$);else x=null}x=requestAnimationFrame(G$)}function b(){if(I.animate)v();else _()}if(I.el&&I.el.tagName!=="CANVAS"&&typeof ResizeObserver<"u")k=new ResizeObserver(()=>d()),k.observe(I.el);b();function h(c){A=R(c),f.data=A,b()}function d(){if(g)return;_()}function n(c){if(I=Object.assign(I,c),c.data!==void 0)A=R(c.data),f.data=A;b()}function m(){if(g=!0,k)k.disconnect(),k=null;if(x!==null)cancelAnimationFrame(x),x=null}return{update:h,resize:d,setOpts:n,dispose:m,_state:f}}function F(z){return D(z,"line")}function K(z){return D(z,"area")}function O(z){return D(z,"bar")}function M(z){let B=H(z.el),I=R(z.data||[]),A=Object.assign({color:"#4a9eff",smoothing:"none",animate:!1},z),w=null,k=!1,g={data:I,xDomain:[0,1],yDomain:[0,1]};function x(){if(k)return;let{w:b,h}=L(B),d=Q(B,b,h);if(!d)return;if(d.clearRect(0,0,b,h),!I.length)return;let n=I.map((Q$)=>Q$.x),m=I.map((Q$)=>Q$.y),[c,o]=Z(n,void 0),[$$,e]=Z(m,void 0);g.xDomain=[c,o],g.yDomain=[$$,e];let t=(Q$)=>V(Q$,c,o,b),G$=(Q$)=>h-V(Q$,$$,e,h);d.save(),d.beginPath(),d.moveTo(t(I[0].x),G$(I[0].y));for(let Q$=1;Q$<I.length;Q$++)d.lineTo(t(I[Q$].x),G$(I[Q$].y));d.strokeStyle=A.color,d.lineWidth=1.5,d.stroke(),d.restore()}if(A.el&&A.el.tagName!=="CANVAS"&&typeof ResizeObserver<"u")w=new ResizeObserver(()=>x()),w.observe(A.el);x();function f(b){I=R(b),g.data=I,x()}function y(){if(!k)x()}function _(b){if(A=Object.assign(A,b),b.data!==void 0)I=R(b.data),g.data=I;x()}function v(){if(k=!0,w)w.disconnect(),w=null}return{update:f,resize:y,setOpts:_,dispose:v,_state:g}}return{line:F,area:K,bar:O,sparkline:M}}};var GJ={name:"indexedDB",version:"1.0.0",type:"fw.dom.fs",dependencies:["broadcastChannel"],deps:[a$],factory(E){let S=globalThis.indexedDB;function T(j){return new Promise((Z,q)=>{j.onsuccess=()=>Z(j.result),j.onerror=()=>q(j.error)})}function N(j,Z,q,$){return new Promise((V,X)=>{let H;try{H=j.transaction(Z,q)}catch(Q){return X(Q)}H.onerror=()=>X(H.error),T($(H.objectStore(Z))).then(V,X)})}function R(j,Z,q){return{get($){return N(j,Z,"readonly",(V)=>V.get($))},set($,V){return N(j,Z,"readwrite",(X)=>X.put(V,$)).then((X)=>{return q("set",$),X})},del($){return N(j,Z,"readwrite",(V)=>V.delete($)).then((V)=>{return q("del",$),V})},has($){return N(j,Z,"readonly",(V)=>V.count($)).then((V)=>V>0)},clear(){return N(j,Z,"readwrite",($)=>$.clear()).then(($)=>{return q("clear",null),$})},count($){return N(j,Z,"readonly",(V)=>V.count($))},getAll($,V){return N(j,Z,"readonly",(X)=>X.getAll($,V))},getAllKeys($,V){return N(j,Z,"readonly",(X)=>X.getAllKeys($,V))},each($){return new Promise((V,X)=>{let H;try{H=j.transaction(Z,"readonly")}catch(L){return X(L)}H.onerror=()=>X(H.error);let Q=H.objectStore(Z).openCursor();Q.onsuccess=()=>{let L=Q.result;if(L&&$(L.value,L.key)!==!1)L.continue();else V()},Q.onerror=()=>X(Q.error)})}}}return{isSupported(){return!!S},open(j,Z,q,$){if(!S)return Promise.reject(Error("IndexedDB is not supported in this environment"));let V=$&&$.crossTab!==void 0?$.crossTab:!0,X=$&&$.namespace!==void 0?$.namespace:"";if(typeof V!=="boolean")return Promise.reject(Error("indexedDB: crossTab must be a boolean"));if(typeof X!=="string"||X.includes(":"))return Promise.reject(Error('indexedDB: namespace must be a string without ":"'));let H=X?`idb:${X}:${j}`:`idb:${j}`;return new Promise((Q,L)=>{let Y=S.open(j,Z);Y.onerror=()=>L(Y.error),Y.onupgradeneeded=(G)=>{if(typeof q==="function")q(Y.result,G.oldVersion,G.newVersion)},Y.onsuccess=()=>{let G=Y.result;G.onversionchange=()=>G.close();let J=V&&E.isSupported()?E.create(H):null,U={map:[],list:{}};function W(P){for(let D=0;D<U.map.length;D++)U.list[U.map[D]](P)}if(J)J.on((P)=>W({...P,cross:!0}));function C(P,D,F){if(W({type:P,store:D,key:F,cross:!1}),J)J.post({type:P,store:D,key:F})}Q({store(P){return R(G,P,(D,F)=>C(D,P,F))},close(){if(J)J.close();G.close()},get name(){return G.name},get version(){return G.version},get storeNames(){return Array.from(G.objectStoreNames)},listen:{add(P,D){if(U.map.indexOf(P)<0)U.map.push(P);U.list[P]=D},del(P){let D=U.map.indexOf(P);if(D>-1)U.map.splice(D,1),delete U.list[P]}}})}})},drop(j){if(!S)return Promise.reject(Error("IndexedDB is not supported in this environment"));return new Promise((Z,q)=>{let $=S.deleteDatabase(j);$.onsuccess=()=>Z(),$.onerror=()=>q($.error),$.onblocked=()=>q(Error(`Cannot delete "${j}": other connections are still open. Close all tabs using this database and retry.`))})}}}};var XJ={name:"mutex",version:"1.0.0",type:"fw.io.sync",dependencies:[],factory(){function E(){let S=!1,T=[];function N(q){let $=q&&q.signal;if($&&$.aborted)return Promise.reject($.reason??Error("mutex: acquire aborted"));if(!S)return S=!0,Promise.resolve();return new Promise((V,X)=>{let H={resolve:V,reject:X};if($){let Q=()=>{let Y=T.indexOf(H);if(Y!==-1)T.splice(Y,1);X($.reason??Error("mutex: acquire aborted"))};H.signal=$,H.onAbort=Q,$.addEventListener("abort",Q,{once:!0});let L=V;H.resolve=()=>{$.removeEventListener("abort",Q),L()}}T.push(H)})}function R(){if(!S)throw Error("mutex: release on unlocked");if(T.length>0)T.shift().resolve();else S=!1}function j(){if(S)return!1;return S=!0,!0}async function Z(q,$){await N($);try{return await q()}finally{R()}}return{acquire:N,release:R,tryAcquire:j,runExclusive:Z,get locked(){return S}}}return{create:E}}};var YJ={name:"semaphore",version:"1.0.0",type:"fw.io.sync",dependencies:[],factory(){function E(S){if(!Number.isInteger(S)||S<1)throw Error("semaphore: capacity must be an integer >= 1");let T=S,N=S,R=[];function j(V){let X=V&&V.signal;if(X&&X.aborted)return Promise.reject(X.reason??Error("semaphore: acquire aborted"));if(N>0)return N--,Promise.resolve();return new Promise((H,Q)=>{let L={resolve:H,reject:Q};if(X){let Y=()=>{let J=R.indexOf(L);if(J!==-1)R.splice(J,1);Q(X.reason??Error("semaphore: acquire aborted"))};L.signal=X,L.onAbort=Y,X.addEventListener("abort",Y,{once:!0});let G=H;L.resolve=()=>{X.removeEventListener("abort",Y),G()}}R.push(L)})}function Z(){if(N>=T)throw Error("semaphore: release exceeds capacity");if(R.length>0)R.shift().resolve();else N++}function q(){if(N<=0)return!1;return N--,!0}async function $(V,X){await j(X);try{return await V()}finally{Z()}}return{acquire:j,release:Z,tryAcquire:q,runExclusive:$,get permits(){return N},get capacity(){return T}}}return{create:E}}};var UJ={name:"channel",version:"1.0.0",type:"fw.io.sync",dependencies:[],factory(){function E({capacity:S=0}={}){if(!Number.isInteger(S)||S<0)throw Error("channel: capacity must be a non-negative integer");let T=S,N=[],R=!1,j=[],Z=[];function q(){while(N.length<T&&j.length>0){let G=j.shift();N.push(G.value),G.resolve()}}function $(){while(Z.length>0&&N.length>0){let G=Z.shift(),J=N.shift();G.resolve({value:J,done:!1}),q()}}function V(G,J,U,W){let C=()=>{let F=J.indexOf(G);if(F!==-1)J.splice(F,1);G.reject?.(U.reason??Error(W))};G.signal=U,G.onAbort=C,U.addEventListener("abort",C,{once:!0});let P=G.resolve;G.resolve=(F)=>{U.removeEventListener("abort",C),P(F)};let D=G.reject;if(D)G.reject=(F)=>{U.removeEventListener("abort",C),D(F)}}function X(G,J){if(R)return Promise.reject(Error("channel: send on closed"));let U=J&&J.signal;if(U&&U.aborted)return Promise.reject(U.reason??Error("channel: send aborted"));if(T===0){if(Z.length>0)return Z.shift().resolve({value:G,done:!1}),Promise.resolve();return new Promise((W,C)=>{let P={resolve:W,reject:C,value:G};if(U)V(P,j,U,"channel: send aborted");j.push(P)})}if(N.length<T)return N.push(G),$(),Promise.resolve();return new Promise((W,C)=>{let P={resolve:W,reject:C,value:G};if(U)V(P,j,U,"channel: send aborted");j.push(P)})}function H(G){let J=G&&G.signal;if(J&&J.aborted)return Promise.reject(J.reason??Error("channel: recv aborted"));if(N.length>0){let U=N.shift();return q(),Promise.resolve({value:U,done:!1})}if(T===0&&j.length>0){let U=j.shift();return U.resolve(),Promise.resolve({value:U.value,done:!1})}if(R)return Promise.resolve({value:void 0,done:!0});return new Promise((U,W)=>{let C={resolve:U,reject:W};if(J)V(C,Z,J,"channel: recv aborted");Z.push(C)})}function Q(G){if(R)throw Error("channel: send on closed");if(T===0){if(Z.length>0)return Z.shift().resolve({value:G,done:!1}),!0;return!1}if(N.length<T)return N.push(G),$(),!0;return!1}function L(){if(N.length>0){let G=N.shift();return q(),{value:G,done:!1}}if(T===0&&j.length>0){let G=j.shift();return G.resolve(),{value:G.value,done:!1}}if(R)return{value:void 0,done:!0};return{value:void 0,done:!1,empty:!0}}function Y(){if(R)return;R=!0;for(let G of Z)G.resolve({value:void 0,done:!0});Z.length=0;for(let G of j)G.reject(Error("channel: closed during send"));j.length=0}return{send:X,recv:H,trySend:Q,tryRecv:L,close:Y,get closed(){return R},get capacity(){return T},get size(){return N.length},get pendingSenders(){return j.length},get pendingReceivers(){return Z.length}}}return{create:E}}};var KJ={name:"cancellable",version:"1.0.0",type:"fw.io.sync",dependencies:["abort"],deps:[u$],factory(E){function S(Z){if(typeof Z!=="function")throw Error("cancellable: asyncFn must be a function");let q=new AbortController,$=[],V=!1,X=!1,H=!1;function Q(U){if(typeof U!=="function")throw Error("cancellable: onCancel requires a function");if(H){Promise.resolve().then(()=>{try{U()}catch(W){console.error(W)}});return}$.push(U)}function L(){E.throwIfAborted(q.signal)}function Y(){let U=$.splice(0).reverse(),W=[];for(let C of U)try{let P=C();if(P&&typeof P.then==="function")W.push(P.catch((D)=>console.error(D)))}catch(P){console.error(P)}return Promise.all(W)}function G(U){if(X||H)return Promise.resolve();if(H=!0,q.abort(E.error(U??"cancellable: cancelled")),!V)return Promise.resolve();return Y()}async function J(){if(V)throw Error("cancellable: task already started");if(V=!0,H)throw X=!0,q.signal.reason??E.error("cancellable: cancelled before run");try{let U=await Z({signal:q.signal,onCancel:Q,throwIfAborted:L});return X=!0,U}catch(U){throw X=!0,U}}return{run:J,cancel:G,get cancelled(){return H},get done(){return X},get signal(){return q.signal}}}function T(Z){if(!Z||typeof Z.run!=="function"||typeof Z.cancel!=="function")throw Error("cancellable: argument must be a task from cancellable.create")}function N(...Z){if(Z.length===0)throw Error("cancellable: race requires at least one task");for(let q of Z)T(q);return new Promise((q,$)=>{let V=!1;for(let X of Z)X.run().then((H)=>{if(V)return;V=!0,q(H);for(let Q of Z)if(Q!==X)Q.cancel("cancellable: race lost")},(H)=>{if(V)return;V=!0,$(H);for(let Q of Z)if(Q!==X)Q.cancel("cancellable: race lost")})})}function R(Z){if(!Array.isArray(Z)||Z.length===0)throw Error("cancellable: all requires a non-empty array of tasks");for(let q of Z)T(q);return new Promise((q,$)=>{let V=Array(Z.length),X=0,H=!1;Z.forEach((Q,L)=>{Q.run().then((Y)=>{if(H)return;if(V[L]=Y,++X===Z.length)q(V)},(Y)=>{if(H)return;H=!0,$(Y);for(let G of Z)G.cancel("cancellable: all failed")})})})}function j(Z){let q=Z&&typeof Z.onError==="function"?Z.onError:null,$=new Set,V=!1;function X(Q){if(T(Q),Q.done)throw Error("cancellable: cannot add a completed task to pool");V=!1,$.add(Q),Q.run().then(()=>{$.delete(Q)},(L)=>{if($.delete(Q),q)try{q(L,Q)}catch(Y){console.error(Y)}})}async function H(Q){let L=[];for(let Y of $)L.push(Y.cancel(Q??"cancellable: pool cancelled"));await Promise.all(L),$.clear(),V=!0}return{add:X,cancelAll:H,get size(){return $.size},get cleared(){return V}}}return{create:S,race:N,all:R,pool:j}}};var zJ={name:"tokenBucket",version:"1.0.0",type:"fw.io.sync",dependencies:[],factory(){function E({capacity:S,refillRate:T,refillInterval:N=1000,initial:R}={}){if(!Number.isInteger(S)||S<1)throw Error("tokenBucket: capacity must be an integer >= 1");if(typeof T!=="number"||T<0)throw Error("tokenBucket: refillRate must be a number >= 0");let Z=R!==void 0?R:S;function q(){let C=Date.now();if(C<$)return $;return C}let $=Date.now(),V=!1,X=null;function H(){if(T===0)return;let C=q(),P=C-$;if(P<=0){$=C;return}let D=P/N*T;Z=Math.min(S,Z+D),$=C}let Q=[];function L(C){if(X!==null)return;X=setTimeout(()=>{X=null,Y()},Math.max(1,Math.ceil(C)))}function Y(){while(Q.length>0){H();let{n:C,resolve:P}=Q[0];if(Z>=C)Z-=C,Q.shift(),P();else{if(T>0){let D=(C-Z)/T*N;L(D)}break}}}function G(C=1){if(H(),Z>=C)return Z-=C,!0;return!1}function J(C=1){if(C>S)return Promise.reject(Error(`tokenBucket: n (${C}) exceeds capacity (${S})`));if(V)return Promise.reject(Error("tokenBucket: cancelled"));if(H(),Z>=C&&Q.length===0)return Z-=C,Promise.resolve();return new Promise((P,D)=>{if(Q.push({n:C,resolve:P,reject:D}),T>0){let F=(C-Z)/T*N;L(Math.max(0,F))}})}function U(){Z=S,$=Date.now(),Y()}function W(){if(V=!0,X!==null)clearTimeout(X),X=null;let C=Error("tokenBucket: cancelled"),P=Q.splice(0);for(let{reject:D}of P)D(C)}return{tryTake:G,take:J,reset:U,cancel:W,get available(){return H(),Math.floor(Z)},get capacity(){return S},get refillRate(){return T},get refillInterval(){return N}}}return{create:E}}};var HJ={name:"base32",version:"1.0.0",type:"fw.io.codec",dependencies:[],factory(){let S=new Int8Array(128).fill(-1);for(let j=0;j<32;j++)S["ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".charCodeAt(j)]=j;return{fromBytes:function(j){let Z=j.length;if(Z===0)return"";let q=[],$=0,V=0;for(let X=0;X<Z;X++){$=$<<8|j[X]&255,V+=8;while(V>=5)V-=5,q.push("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"[$>>V&31])}if(V>0)q.push("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"[$<<5-V&31]);while(q.length%8!==0)q.push("=");return q.join("")},toBytes:function(j){let Z=j.length;while(Z>0&&j.charCodeAt(Z-1)===61)Z--;if(Z===0)return new Uint8Array(0);let q=[],$=0,V=0;for(let X=0;X<Z;X++){let H=j.charCodeAt(X);if(H>=97&&H<=122)H-=32;let Q=H<128?S[H]:-1;if(Q<0)continue;if($=$<<5|Q,V+=5,V>=8)V-=8,q.push($>>V&255)}return new Uint8Array(q)},test:function(j){return/^(?:[A-Z2-7]{8})*(?:[A-Z2-7]{2}={6}|[A-Z2-7]{4}={4}|[A-Z2-7]{5}={3}|[A-Z2-7]{7}=)?$/.test(j)}}}};var VJ={name:"base58",version:"1.0.0",type:"fw.io.codec",dependencies:[],factory(){let S=new Int8Array(128).fill(-1);for(let j=0;j<58;j++)S["123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".charCodeAt(j)]=j;return{fromBytes:function(j){let Z=j.length;if(Z===0)return"";let q=0;while(q<Z&&j[q]===0)q++;let $=new Uint8Array(Z);for(let Q=0;Q<Z;Q++)$[Q]=j[Q]&255;let V=[],X=q;while(X<Z){let Q=0;for(let L=X;L<Z;L++){let Y=(Q<<8)+$[L];$[L]=Y/58|0,Q=Y%58}V.push("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"[Q]);while(X<Z&&$[X]===0)X++}let H="";for(let Q=0;Q<q;Q++)H+="1";for(let Q=V.length-1;Q>=0;Q--)H+=V[Q];return H},toBytes:function(j){let Z=j.length;if(Z===0)return new Uint8Array(0);let q=49,$=0;while($<Z&&j.charCodeAt($)===q)$++;let V=new Int16Array(Z);for(let L=0;L<Z;L++){let Y=j.charCodeAt(L),G=Y<128?S[Y]:-1;if(G<0)throw Error(`Invalid base58 character '${j[L]}' at index ${L}`);V[L]=G}let X=[],H=$;while(H<Z){let L=0;for(let Y=H;Y<Z;Y++){let G=L*58+V[Y];V[Y]=G/256|0,L=G&255}X.push(L);while(H<Z&&V[H]===0)H++}let Q=new Uint8Array($+X.length);for(let L=0;L<X.length;L++)Q[$+L]=X[X.length-1-L];return Q},test:function(j){return/^[1-9A-HJ-NP-Za-km-z]*$/.test(j)}}}};var WJ={name:"buffer",version:"1.0.0",type:"fw.io.codec",dependencies:["valid","utf8"],deps:[b$,R$],factory(E,S){let T={},N=["-","number","string","boolean","array","object","uint8array","uint8clampedarray"],R={number:1,string:2,boolean:3,array:4,object:5,uint8array:6,uint8clampedarray:7},j=new Uint8Array(2),Z=4,q={uint8:1,int8:2,uint16:3,int16:4,uint32:5,int32:6,float16:7,float32:8,float64:9};T.const={map:N,type:R,empty:j};function $(D){if(D<256)return 1;else if(D<65536)return 2;else if(D<16777216)return 3;else return 4}T.get_len=function(D,F,K=0){for(let O=0;O<D;O++)K+=F[O+1]<<O*8;return K},T.gen_len=function(D,F,K){K=new Uint8Array(F);for(let O=0;O<F;O++)K[O]=D>>O*8&255;return K},T.uint_concat=function(D,F,K,O=0){K=new Uint8Array(D);for(let M=0;M<F.length;M++)K.set(F[M],O),O+=F[M].length;return K},T.build_value=function(D,F,K=0,O=0,M=0,z){if(K=F.length,K>4294967295)throw Error(`buffer: payload length ${K} exceeds 2^32 - 1 limit`);if(O=$(K),M=(O-1<<4)+T.const.type[D],z=new Uint8Array(K+O+1),z[0]=M,O===1)z[1]=K;else z.set(T.gen_len(K,O),1);return z.set(F,O+1),z};function V(D,F,K,O=0){for(let M=0;M<K;M++)O+=D[F+M]<<M*8;return O}function X(D,F=0){if(F>=D.length)return null;let K=D[F],O=K&15;if(O<=0||O>=T.const.map.length)return null;let M=(K>>4)+1;if(M<1||M>4)return null;if(F+M>=D.length)return null;let z=M===1?D[F+1]:V(D,F+1,M),B=1+M+z;if(F+B>D.length)return null;return{type:O,len:z,head:M,start:F+1+M,end:F+1+M+z,next:F+B}}function H(D){let F=D&32768?-1:1,K=D>>10&31,O=D&1023;if(K===0){if(O===0)return F*0;return F*Math.pow(2,-14)*(O/1024)}if(K===31)return O?NaN:F*(1/0);return F*Math.pow(2,K-15)*(1+O/1024)}function Q(D){if(Number.isNaN(D))return 32256;if(D===1/0)return 31744;if(D===-1/0)return 64512;let F=new Float32Array(1),K=new Uint32Array(F.buffer);F[0]=D;let O=K[0],M=O>>16&32768,z=(O>>23&255)-127,B=O&8388607;if(z===128)return M|31744|(B?512:0);if(z+=15,z>=31)return M|31744;if(z<=0){if(z<-10)return M;if(B=(B|8388608)>>1-z,B&4096)B+=8192;return M|B>>13}if(B&4096){if(B+=8192,B&8388608){if(B=0,z+=1,z>=31)return M|31744}}return M|z<<10|B>>13}function L(D){let F=new Float32Array(1);return F[0]=D,Object.is(F[0],D)}function Y(D){let F=Q(D),K=H(F);return Object.is(K,D)}function G(D){let F=Number(D);if(Number.isNaN(F)||!Number.isFinite(F)){let z=new ArrayBuffer(9),B=new Uint8Array(z);return B[0]=q.float64,new DataView(z,1).setFloat64(0,F,!0),B}if(!Object.is(F,-0)&&Number.isInteger(F))if(F>=0){if(F<=255){let z=new ArrayBuffer(2),B=new Uint8Array(z);return B[0]=q.uint8,new DataView(z,1).setUint8(0,F),B}if(F<=65535){let z=new ArrayBuffer(3),B=new Uint8Array(z);return B[0]=q.uint16,new DataView(z,1).setUint16(0,F,!0),B}if(F<=4294967295){let z=new ArrayBuffer(5),B=new Uint8Array(z);return B[0]=q.uint32,new DataView(z,1).setUint32(0,F,!0),B}}else{if(F>=-128){let z=new ArrayBuffer(2),B=new Uint8Array(z);return B[0]=q.int8,new DataView(z,1).setInt8(0,F),B}if(F>=-32768){let z=new ArrayBuffer(3),B=new Uint8Array(z);return B[0]=q.int16,new DataView(z,1).setInt16(0,F,!0),B}if(F>=-2147483648){let z=new ArrayBuffer(5),B=new Uint8Array(z);return B[0]=q.int32,new DataView(z,1).setInt32(0,F,!0),B}}if(Y(F)){let z=new ArrayBuffer(3),B=new Uint8Array(z);return B[0]=q.float16,new DataView(z,1).setUint16(0,Q(F),!0),B}if(L(F)){let z=new ArrayBuffer(5),B=new Uint8Array(z);return B[0]=q.float32,new DataView(z,1).setFloat32(0,F,!0),B}let O=new ArrayBuffer(9),M=new Uint8Array(O);return M[0]=q.float64,new DataView(O,1).setFloat64(0,F,!0),M}T.parse_array_in=function(D,F=[]){let K=0;while(K<D.length){let O=X(D,K);if(!O)break;F.push(W(O.type,O.len,D.subarray(O.start,O.end))),K=O.next}return F},T.parse_array_out=function(D,F=[],K=0){for(let O=0;O<D.length;O++){let M=U(D[O]);F.push(M),K+=M.length}return T.uint_concat(K,F)},T.parse_object_in=function(D,F=[],K={},O){if(F=T.parse_array_in(D),F.length===2){O=F[1].length===F[0].length?F[0].length:Math.min(F[1].length,F[0].length);for(let M=0;M<O;M++)K[F[0][M]]=F[1][M].length>2?C(F[1][M]):[]}return K},T.parse_object_out=function(D,F=[],K=[]){for(let O in D)if(Object.prototype.hasOwnProperty.call(D,O))F[K.push(O)-1]=U(D[O]);return T.parse_array_out([K,F])},T.in=[!1,function(F){if(!F.length)return 0;let K=F[0],O=new DataView(F.buffer,F.byteOffset+1,F.length-1);switch(K){case q.uint8:return O.getUint8(0);case q.int8:return O.getInt8(0);case q.uint16:return O.getUint16(0,!0);case q.int16:return O.getInt16(0,!0);case q.uint32:return O.getUint32(0,!0);case q.int32:return O.getInt32(0,!0);case q.float16:{let M=O.getUint16(0,!0);return H(M)}case q.float32:return O.getFloat32(0,!0);case q.float64:return O.getFloat64(0,!0);default:return 0}},function(F){return S.fromBytes(F)},function(F){return F[0]===1},function(F){return T.parse_array_in(F)},function(F){return T.parse_object_in(F)},function(F){return F},function(F){return new Uint8ClampedArray(F)}],T.out=[!1,function(F){return T.build_value("number",G(F))},function(F){return T.build_value("string",S.toBytes(F))},function(F){return T.build_value("boolean",new Uint8Array([F?1:0]))},function(F){return T.build_value("array",T.parse_array_out(F))},function(F){return T.build_value("object",T.parse_object_out(F))},function(F){return T.build_value("uint8array",F)},function(F){return T.build_value("uint8clampedarray",F)}];function J(D,F){if(D>0)return T.out[D](F);else return T.const.empty}function U(D){return J(T.const.map.indexOf(E.is(D)),D)}function W(D,F,K){return T.in[D](K.slice(0,F))}function C(D){let F=X(D,0);if(!F)return null;return W(F.type,F.len,D.subarray(F.start,F.end))}function P(D,F=[]){let K=0;while(K<D.length){let O=X(D,K);if(!O)break;F.push(W(O.type,O.len,D.subarray(O.start,O.end))),K=O.next}return F}return{consume:P,clone:function(D){return C(U(D))},out:U,in:C,concat:T.uint_concat}}};var FJ={name:"cbor",version:"1.0.0",type:"fw.io.codec",dependencies:["utf8"],deps:[R$],factory(E){class S{constructor(A,w){this.tag=A,this.value=w}}class T{constructor(A){if(!Number.isInteger(A)||A<0||A>255)throw Error(`CBOR Simple: value must be 0..255, got ${A}`);this.value=A}}let N=Symbol("cbor/break");function R(A){let w=A&32768?-1:1,k=A>>10&31,g=A&1023;if(k===0)return g===0?w*0:w*Math.pow(2,-14)*(g/1024);if(k===31)return g?NaN:w*(1/0);return w*Math.pow(2,k-15)*(1+g/1024)}function j(A){if(Number.isNaN(A))return 32256;if(A===1/0)return 31744;if(A===-1/0)return 64512;let w=new Float32Array(1),k=new Uint32Array(w.buffer);w[0]=A;let g=k[0],x=g>>16&32768,f=(g>>23&255)-127,y=g&8388607;if(f===128)return x|31744|(y?512:0);if(f+=15,f>=31)return x|31744;if(f<=0){if(f<-10)return x;if(y=(y|8388608)>>1-f,y&4096)y+=8192;return x|y>>13}if(y&4096){if(y+=8192,y&8388608){if(y=0,f+=1,f>=31)return x|31744}}return x|f<<10|y>>13}function Z(A){return Object.is(R(j(A)),A)}function q(A){let w=new Float32Array(1);return w[0]=A,Object.is(w[0],A)}function $(A,w){A.push(new Uint8Array([w]))}function V(A){let w=0;for(let x=0;x<A.length;x++)w+=A[x].length;let k=new Uint8Array(w),g=0;for(let x=0;x<A.length;x++)k.set(A[x],g),g+=A[x].length;return k}function X(A,w){let k=A.length<w.length?A.length:w.length;for(let g=0;g<k;g++)if(A[g]!==w[g])return A[g]-w[g];return A.length-w.length}function H(A,w,k){let g=w<<5;if(typeof k==="bigint"){if(k<24n)A.push(new Uint8Array([g|Number(k)]));else if(k<0x100n)A.push(new Uint8Array([g|24,Number(k)]));else if(k<0x10000n){let x=new Uint8Array(3);x[0]=g|25;let f=Number(k);x[1]=f>>8&255,x[2]=f&255,A.push(x)}else if(k<0x100000000n){let x=new Uint8Array(5);x[0]=g|26,new DataView(x.buffer).setUint32(1,Number(k),!1),A.push(x)}else{let x=new Uint8Array(9);x[0]=g|27,new DataView(x.buffer).setBigUint64(1,k,!1),A.push(x)}return}if(k<24)A.push(new Uint8Array([g|k]));else if(k<256)A.push(new Uint8Array([g|24,k]));else if(k<65536){let x=new Uint8Array(3);x[0]=g|25,x[1]=k>>8&255,x[2]=k&255,A.push(x)}else if(k<4294967296){let x=new Uint8Array(5);x[0]=g|26,new DataView(x.buffer).setUint32(1,k,!1),A.push(x)}else{let x=new Uint8Array(9);x[0]=g|27,new DataView(x.buffer).setBigUint64(1,BigInt(k),!1),A.push(x)}}function Q(A){let w=A.toString(16),k=w.length%2?"0"+w:w,g=k.length/2,x=new Uint8Array(g);for(let f=0;f<g;f++)x[f]=parseInt(k.substr(f*2,2),16);return x}function L(A,w){if(Number.isNaN(A)||!Number.isFinite(A)||Z(A)){let g=new Uint8Array(3);g[0]=249;let x=Number.isNaN(A)?32256:j(A);g[1]=x>>8&255,g[2]=x&255,w.push(g);return}if(q(A)){let g=new Uint8Array(5);g[0]=250,new DataView(g.buffer).setFloat32(1,A,!1),w.push(g);return}let k=new Uint8Array(9);k[0]=251,new DataView(k.buffer).setFloat64(1,A,!1),w.push(k)}function Y(A,w){if(A>=24&&A<=31)throw Error(`CBOR: simple(${A}) is reserved and MUST NOT be emitted`);if(A<24){$(w,224|A);return}w.push(new Uint8Array([248,A]))}function G(A,w,k){if(k){let g=Array(A.length);for(let x=0;x<A.length;x++){let[f,y]=A[x],_=[];J(f,_,!0),g[x]={keyBytes:V(_),keyChunks:_,v:y}}g.sort((x,f)=>X(x.keyBytes,f.keyBytes)),H(w,5,g.length);for(let x=0;x<g.length;x++){let f=g[x];for(let y=0;y<f.keyChunks.length;y++)w.push(f.keyChunks[y]);J(f.v,w,!0)}}else{H(w,5,A.length);for(let g=0;g<A.length;g++)J(A[g][0],w,!1),J(A[g][1],w,!1)}}function J(A,w,k){if(A===!1){$(w,244);return}if(A===!0){$(w,245);return}if(A===null){$(w,246);return}if(A===void 0){$(w,247);return}if(typeof A==="number"){if(Object.is(A,-0)){w.push(new Uint8Array([249,128,0]));return}if(Number.isInteger(A)&&A>=-4294967296&&A<=4294967295){if(A>=0)H(w,0,A);else H(w,1,-1-A);return}if(Number.isSafeInteger(A)){if(A>=0)H(w,0,BigInt(A));else H(w,1,-1n-BigInt(A));return}L(A,w);return}if(typeof A==="bigint"){if(A>=0n&&A<=0xffffffffffffffffn){H(w,0,A);return}if(A<0n&&A>=-0x10000000000000000n){H(w,1,-1n-A);return}if(A>=0n){H(w,6,2);let g=Q(A);H(w,2,g.length),w.push(g)}else{H(w,6,3);let g=Q(-1n-A);H(w,2,g.length),w.push(g)}return}if(typeof A==="string"){let g=E.toBytes(A);H(w,3,g.length),w.push(g);return}if(A instanceof Uint8Array){H(w,2,A.length),w.push(A);return}if(A instanceof T){Y(A.value,w);return}if(A instanceof S){H(w,6,A.tag),J(A.value,w,k);return}if(Array.isArray(A)){H(w,4,A.length);for(let g=0;g<A.length;g++)J(A[g],w,k);return}if(A instanceof Map){G([...A],w,k);return}if(typeof A==="object"){let g=Object.keys(A),x=Array(g.length);for(let f=0;f<g.length;f++)x[f]=[g[f],A[g[f]]];G(x,w,k);return}throw Error(`CBOR: cannot encode value of type ${typeof A}`)}function U(A,w,k){if(w==="__proto__")Object.defineProperty(A,w,{value:k,writable:!0,enumerable:!0,configurable:!0});else A[w]=k}function W(A,w){let k=!!(w&&w.deterministic),g=[];return J(A,g,k),V(g)}let C=512;function P(A){if(++A.depth>A.maxDepth)throw Error("CBOR: nesting deeper than maxDepth ("+A.maxDepth+")")}function D(A){let w=A&&A.maxDepth;if(w===void 0||w===null)return C;if(!Number.isInteger(w)||w<1)throw RangeError("cbor.decode: maxDepth must be a positive integer");return w}function F(A,w){let{view:k}=A;if(w<24)return w;if(w===24){let g=k.getUint8(A.offset);return A.offset+=1,g}if(w===25){let g=k.getUint16(A.offset,!1);return A.offset+=2,g}if(w===26){let g=k.getUint32(A.offset,!1);return A.offset+=4,g}if(w===27){let g=k.getUint32(A.offset,!1),x=k.getUint32(A.offset+4,!1);if(A.offset+=8,g<=2097151)return g*4294967296+x;return BigInt(g)<<32n|BigInt(x)}throw Error(`CBOR: invalid additional info ${w}`)}function K(A,w){if(P(A),A.useMap){let g=new Map;for(let x=0;x<w;x++){let f=O(A);g.set(f,O(A))}return A.depth--,g}let k=Object.create(null);for(let g=0;g<w;g++){let x=O(A);U(k,x,O(A))}return A.depth--,k}function O(A){let w=B(A);if(w===N)throw Error("CBOR: break outside an indefinite-length item");return w}function M(A,w){if(A.offset>=A.bytes.length)throw Error("CBOR: unexpected end of input");let k=A.bytes[A.offset];if(k===255)return A.offset++,N;if(k>>5!==w||(k&31)===31)throw Error("CBOR: an indefinite-length string chunk must be a definite-length string of the same type");return B(A)}function z(A,w){if(!(w<=A.bytes.length-A.offset))throw Error("CBOR: unexpected end of input")}function B(A){let{view:w,bytes:k}=A;if(A.offset>=k.length)throw Error("CBOR: unexpected end of input");let g=w.getUint8(A.offset++),x=g>>5,f=g&31;if(x===7){if(f===20)return!1;if(f===21)return!0;if(f===22)return null;if(f===23)return;if(f<24)return new T(f);if(f===24){let _=w.getUint8(A.offset);if(A.offset+=1,_<32)throw Error("CBOR: simple value "+_+" in a two-byte encoding");return new T(_)}if(f===25){let _=w.getUint16(A.offset,!1);return A.offset+=2,R(_)}if(f===26){let _=w.getFloat32(A.offset,!1);return A.offset+=4,_}if(f===27){let _=w.getFloat64(A.offset,!1);return A.offset+=8,_}if(f===31)return N;throw Error(`CBOR: invalid info ${f} for major 7`)}if(f===31){if(x===2){let _=[];for(;;){let v=M(A,2);if(v===N)break;if(!(v instanceof Uint8Array))throw Error("CBOR: expected byte string chunk");_.push(v)}return V(_)}if(x===3){let _="";for(;;){let v=M(A,3);if(v===N)break;if(typeof v!=="string")throw Error("CBOR: expected text string chunk");_+=v}return _}if(x===4){P(A);let _=[];for(;;){let v=B(A);if(v===N)break;_.push(v)}return A.depth--,_}if(x===5){if(P(A),A.useMap){let v=new Map;for(;;){let b=B(A);if(b===N)break;v.set(b,O(A))}return A.depth--,v}let _=Object.create(null);for(;;){let v=B(A);if(v===N)break;U(_,v,O(A))}return A.depth--,_}throw Error(`CBOR: indefinite length not allowed for major ${x}`)}let y=F(A,f);switch(x){case 0:return y;case 1:if(typeof y==="bigint")return-1n-y;return-1-y;case 2:{let _=Number(y);z(A,_);let v=k.slice(A.offset,A.offset+_);return A.offset+=_,v}case 3:{let _=Number(y);z(A,_);let v=E.fromBytes(k.subarray(A.offset,A.offset+_));return A.offset+=_,v}case 4:{let _=Number(y);P(A);let v=Array(_);for(let b=0;b<_;b++)v[b]=O(A);return A.depth--,v}case 5:return K(A,Number(y));case 6:{P(A);let _=O(A);A.depth--;let v=typeof y==="bigint"?Number(y):y;if(v===2&&_ instanceof Uint8Array){let b=0n;for(let h=0;h<_.length;h++)b=b<<8n|BigInt(_[h]);return b}if(v===3&&_ instanceof Uint8Array){let b=0n;for(let h=0;h<_.length;h++)b=b<<8n|BigInt(_[h]);return-1n-b}return new S(v,_)}}throw Error(`CBOR: invalid major type ${x}`)}function I(A,w){let k={bytes:A,view:new DataView(A.buffer,A.byteOffset,A.byteLength),offset:0,useMap:!!(w&&w.useMap),depth:0,maxDepth:D(w)};return O(k)}return{encode:W,decode:I,Tagged:S,Simple:T}}};var qJ={name:"msgpack",version:"1.0.0",type:"fw.io.codec",dependencies:["utf8"],deps:[R$],factory(E){class S{constructor(z,B){this.type=z,this.data=B}}function T(z,B){z.push(new Uint8Array([B]))}function N(z){let B=new Float32Array(1);return B[0]=z,Object.is(B[0],z)}function R(z,B){let I=z.getTime(),A=Math.floor(I/1000),w=(I-A*1000)*1e6;if(w<0)A-=1,w+=1e9;if(w===0&&A>=0&&A<=4294967295){let x=new Uint8Array(6);x[0]=214,x[1]=255,new DataView(x.buffer).setUint32(2,A,!1),B.push(x);return}if(A>=0&&A<17179869184){let x=BigInt(w)<<34n|BigInt(A),f=new Uint8Array(10);f[0]=215,f[1]=255,new DataView(f.buffer).setBigUint64(2,x,!1),B.push(f);return}let k=new Uint8Array(15);k[0]=199,k[1]=12,k[2]=255;let g=new DataView(k.buffer);g.setUint32(3,w,!1),g.setBigInt64(7,BigInt(A),!1),B.push(k)}function j(z,B,I){if(I===4){let A=z.getUint32(B,!1);return new Date(A*1000)}if(I===8){let A=z.getBigUint64(B,!1),w=Number(A>>34n),k=Number(A&(1n<<34n)-1n);return new Date(k*1000+Math.round(w/1e6))}if(I===12){let A=z.getUint32(B,!1),w=z.getBigInt64(B+4,!1);return new Date(Number(w)*1000+Math.round(A/1e6))}return null}function Z(z,B){if(Object.is(z,-0)){let A=new Uint8Array(5);A[0]=202,new DataView(A.buffer).setFloat32(1,-0,!1),B.push(A);return}if(Number.isFinite(z)&&Number.isInteger(z)&&z>=-2147483648&&z<=4294967295){if(z>=0){if(z<=127){T(B,z);return}if(z<=255){B.push(new Uint8Array([204,z]));return}if(z<=65535){let k=new Uint8Array(3);k[0]=205,new DataView(k.buffer).setUint16(1,z,!1),B.push(k);return}let w=new Uint8Array(5);w[0]=206,new DataView(w.buffer).setUint32(1,z,!1),B.push(w);return}if(z>=-32){T(B,z&255);return}if(z>=-128){B.push(new Uint8Array([208,z&255]));return}if(z>=-32768){let w=new Uint8Array(3);w[0]=209,new DataView(w.buffer).setInt16(1,z,!1),B.push(w);return}let A=new Uint8Array(5);A[0]=210,new DataView(A.buffer).setInt32(1,z,!1),B.push(A);return}if(Number.isFinite(z)&&N(z)){let A=new Uint8Array(5);A[0]=202,new DataView(A.buffer).setFloat32(1,z,!1),B.push(A);return}let I=new Uint8Array(9);I[0]=203,new DataView(I.buffer).setFloat64(1,z,!1),B.push(I)}function q(z,B){if(z>=0n&&z<=0xffffffffffffffffn){let I=new Uint8Array(9);I[0]=207,new DataView(I.buffer).setBigUint64(1,z,!1),B.push(I);return}if(z<0n&&z>=-0x8000000000000000n){let I=new Uint8Array(9);I[0]=211,new DataView(I.buffer).setBigInt64(1,z,!1),B.push(I);return}throw Error(`msgpack: BigInt out of 64-bit range: ${z}`)}function $(z,B){let I=E.toBytes(z),A=I.length;if(A<=31)B.push(new Uint8Array([160|A]));else if(A<=255)B.push(new Uint8Array([217,A]));else if(A<=65535){let w=new Uint8Array(3);w[0]=218,new DataView(w.buffer).setUint16(1,A,!1),B.push(w)}else{let w=new Uint8Array(5);w[0]=219,new DataView(w.buffer).setUint32(1,A,!1),B.push(w)}B.push(I)}function V(z,B){let I=z.length;if(I<=255)B.push(new Uint8Array([196,I]));else if(I<=65535){let A=new Uint8Array(3);A[0]=197,new DataView(A.buffer).setUint16(1,I,!1),B.push(A)}else{let A=new Uint8Array(5);A[0]=198,new DataView(A.buffer).setUint32(1,I,!1),B.push(A)}B.push(z)}function X(z,B){if(B<=15)T(z,144|B);else if(B<=65535){let I=new Uint8Array(3);I[0]=220,new DataView(I.buffer).setUint16(1,B,!1),z.push(I)}else{let I=new Uint8Array(5);I[0]=221,new DataView(I.buffer).setUint32(1,B,!1),z.push(I)}}function H(z,B){if(B<=15)T(z,128|B);else if(B<=65535){let I=new Uint8Array(3);I[0]=222,new DataView(I.buffer).setUint16(1,B,!1),z.push(I)}else{let I=new Uint8Array(5);I[0]=223,new DataView(I.buffer).setUint32(1,B,!1),z.push(I)}}function Q(z,B){let I=z.data.length,A=z.type&255;if(I===1){B.push(new Uint8Array([212,A])),B.push(z.data);return}if(I===2){B.push(new Uint8Array([213,A])),B.push(z.data);return}if(I===4){B.push(new Uint8Array([214,A])),B.push(z.data);return}if(I===8){B.push(new Uint8Array([215,A])),B.push(z.data);return}if(I===16){B.push(new Uint8Array([216,A])),B.push(z.data);return}if(I<=255)B.push(new Uint8Array([199,I,A]));else if(I<=65535){let w=new Uint8Array(4);w[0]=200,new DataView(w.buffer).setUint16(1,I,!1),w[3]=A,B.push(w)}else{let w=new Uint8Array(6);w[0]=201,new DataView(w.buffer).setUint32(1,I,!1),w[5]=A,B.push(w)}B.push(z.data)}function L(z,B){if(z===null||z===void 0){T(B,192);return}if(z===!1){T(B,194);return}if(z===!0){T(B,195);return}let I=typeof z;if(I==="number"){Z(z,B);return}if(I==="bigint"){q(z,B);return}if(I==="string"){$(z,B);return}if(z instanceof Date){R(z,B);return}if(z instanceof Uint8Array){V(z,B);return}if(z instanceof S){Q(z,B);return}if(Array.isArray(z)){X(B,z.length);for(let A=0;A<z.length;A++)L(z[A],B);return}if(z instanceof Map){H(B,z.size);for(let[A,w]of z)L(A,B),L(w,B);return}if(I==="object"){let A=Object.keys(z);H(B,A.length);for(let w=0;w<A.length;w++)L(A[w],B),L(z[A[w]],B);return}throw Error(`msgpack: cannot encode value of type ${I}`)}function Y(z,B,I){if(B==="__proto__")Object.defineProperty(z,B,{value:I,writable:!0,enumerable:!0,configurable:!0});else z[B]=I}function G(z){let B=[];L(z,B);let I=0;for(let k=0;k<B.length;k++)I+=B[k].length;let A=new Uint8Array(I),w=0;for(let k=0;k<B.length;k++)A.set(B[k],w),w+=B[k].length;return A}function J(z,B){let I=z.bytes.slice(z.offset,z.offset+B);return z.offset+=B,I}function U(z,B){let I=E.fromBytes(z.bytes.subarray(z.offset,z.offset+B));return z.offset+=B,I}let W=512;function C(z){if(++z.depth>z.maxDepth)throw Error("MessagePack: nesting deeper than maxDepth ("+z.maxDepth+")")}function P(z){let B=z&&z.maxDepth;if(B===void 0||B===null)return W;if(!Number.isInteger(B)||B<1)throw RangeError("messagepack.decode: maxDepth must be a positive integer");return B}function D(z,B){C(z);let I=Array(B);for(let A=0;A<B;A++)I[A]=O(z);return z.depth--,I}function F(z,B){if(C(z),z.useMap){let A=new Map;for(let w=0;w<B;w++){let k=O(z);A.set(k,O(z))}return z.depth--,A}let I=Object.create(null);for(let A=0;A<B;A++){let w=O(z);Y(I,w,O(z))}return z.depth--,I}function K(z,B){let I=z.view.getInt8(z.offset);if(z.offset+=1,I===-1){let w=j(z.view,z.offset,B);if(w!==null)return z.offset+=B,w}let A=z.bytes.slice(z.offset,z.offset+B);return z.offset+=B,new S(I,A)}function O(z){let{view:B}=z;if(z.offset>=z.bytes.length)throw Error("msgpack: unexpected end of input");let I=B.getUint8(z.offset++);if(I<=127)return I;if(I>=224)return I-256;if(I>=128&&I<=143)return F(z,I&15);if(I>=144&&I<=159)return D(z,I&15);if(I>=160&&I<=191)return U(z,I&31);switch(I){case 192:return null;case 194:return!1;case 195:return!0;case 196:{let A=B.getUint8(z.offset);return z.offset+=1,J(z,A)}case 197:{let A=B.getUint16(z.offset,!1);return z.offset+=2,J(z,A)}case 198:{let A=B.getUint32(z.offset,!1);return z.offset+=4,J(z,A)}case 199:{let A=B.getUint8(z.offset);return z.offset+=1,K(z,A)}case 200:{let A=B.getUint16(z.offset,!1);return z.offset+=2,K(z,A)}case 201:{let A=B.getUint32(z.offset,!1);return z.offset+=4,K(z,A)}case 202:{let A=B.getFloat32(z.offset,!1);return z.offset+=4,A}case 203:{let A=B.getFloat64(z.offset,!1);return z.offset+=8,A}case 204:{let A=B.getUint8(z.offset);return z.offset+=1,A}case 205:{let A=B.getUint16(z.offset,!1);return z.offset+=2,A}case 206:{let A=B.getUint32(z.offset,!1);return z.offset+=4,A}case 207:{let A=B.getUint32(z.offset,!1),w=B.getUint32(z.offset+4,!1);if(z.offset+=8,A<=2097151)return A*4294967296+w;return BigInt(A)<<32n|BigInt(w)}case 208:{let A=B.getInt8(z.offset);return z.offset+=1,A}case 209:{let A=B.getInt16(z.offset,!1);return z.offset+=2,A}case 210:{let A=B.getInt32(z.offset,!1);return z.offset+=4,A}case 211:{let A=B.getBigInt64(z.offset,!1);if(z.offset+=8,A>=-0x20000000000000n&&A<=0x20000000000000n)return Number(A);return A}case 212:return K(z,1);case 213:return K(z,2);case 214:return K(z,4);case 215:return K(z,8);case 216:return K(z,16);case 217:{let A=B.getUint8(z.offset);return z.offset+=1,U(z,A)}case 218:{let A=B.getUint16(z.offset,!1);return z.offset+=2,U(z,A)}case 219:{let A=B.getUint32(z.offset,!1);return z.offset+=4,U(z,A)}case 220:{let A=B.getUint16(z.offset,!1);return z.offset+=2,D(z,A)}case 221:{let A=B.getUint32(z.offset,!1);return z.offset+=4,D(z,A)}case 222:{let A=B.getUint16(z.offset,!1);return z.offset+=2,F(z,A)}case 223:{let A=B.getUint32(z.offset,!1);return z.offset+=4,F(z,A)}}throw Error(`msgpack: unknown prefix 0x${I.toString(16)}`)}function M(z,B){let I={bytes:z,view:new DataView(z.buffer,z.byteOffset,z.byteLength),offset:0,useMap:!!(B&&B.useMap),depth:0,maxDepth:P(B)};return O(I)}return{encode:G,decode:M,Ext:S}}};var LJ={name:"crc32",version:"1.0.0",type:"fw.io.calc",dependencies:[],factory(){let E=new Uint32Array(256);for(let N=0;N<256;N++){let R=N;for(let j=0;j<8;j++)if(R&1)R=R>>>1^3988292384;else R=R>>>1;E[N]=R}let S=new Uint32Array(4096);S.set(E);for(let N=256;N<4096;N++){let R=S[N-256];S[N]=R>>>8^E[R&255]}function T(){this.crc=-1}return T.prototype.append=function(N){let R=this.crc|0,j=N.length|0,Z=0;if(N instanceof Uint8Array){let q=S;for(let $=j-15;Z<$;Z+=16){let V=R^(N[Z]|N[Z+1]<<8|N[Z+2]<<16|N[Z+3]<<24);R=q[3840+(V&255)]^q[3584+(V>>>8&255)]^q[3328+(V>>>16&255)]^q[3072+(V>>>24)]^q[2816+N[Z+4]]^q[2560+N[Z+5]]^q[2304+N[Z+6]]^q[2048+N[Z+7]]^q[1792+N[Z+8]]^q[1536+N[Z+9]]^q[1280+N[Z+10]]^q[1024+N[Z+11]]^q[768+N[Z+12]]^q[512+N[Z+13]]^q[256+N[Z+14]]^q[N[Z+15]]}}for(;Z<j;Z++)R=R>>>8^E[(R^N[Z])&255];this.crc=R},T.prototype.get=function(){return~this.crc>>>0},T}};var OJ={name:"adler32",version:"1.0.0",type:"fw.io.calc",dependencies:[],factory(){function E(){this._a=1,this._b=0}return E.prototype.append=function(S){let T=this._a,N=this._b,R=S.length|0;for(let j=0;j!==R;){let Z=Math.min(j+2655,R);for(;j<Z;++j)N+=T+=S[j];T=(T&65535)+15*(T>>16),N=(N&65535)+15*(N>>16)}this._a=T,this._b=N},E.prototype.get=function(){return(this._b%65521<<16|this._a%65521)>>>0},E}};var DJ={name:"bigint",version:"1.0.0",type:"fw.io.calc",dependencies:[],factory(){function E(Q){if(Q===0n)return 0;let L=Q<0n?-Q:Q,Y=0;while(L>0n)L>>=1n,Y++;return Y}function S(Q){let L=E(Q<0n?-Q-1n:Q);return Math.max(1,Math.ceil(L/8))}function T(Q,{byteLength:L,endian:Y="be",signed:G=!1}={}){if(!G&&Q<0n)throw Error("bigint: negative value requires signed=true");let J;if(G){let P=E(Q<0n?-Q-1n:Q);J=Math.max(1,Math.ceil((P+1)/8))}else J=S(Q);let U=L!==void 0?L:J;if(L!==void 0&&L<J)throw Error(`bigint: byteLength ${L} insufficient (need ${J})`);let W=new Uint8Array(U),C=G&&Q<0n?(1n<<BigInt(U*8))+Q:Q;for(let P=U-1;P>=0;P--)W[Y==="be"?P:U-1-P]=Number(C&0xffn),C>>=8n;return W}function N(Q,{endian:L="be",signed:Y=!1}={}){let G=0n,J=Q.length;for(let U=0;U<J;U++){let W=BigInt(Q[L==="be"?U:J-1-U]);G=G<<8n|W}if(Y&&J>0&&Q[L==="be"?0:J-1]&128)G-=1n<<BigInt(J*8);return G}function R(Q,L,Y){if(L<0n)throw Error("bigint: exp must be >= 0");if(Y<=0n)throw Error("bigint: mod must be > 0");if(Y===1n)return 0n;let G=1n;if(Q=Q%Y,Q<0n)Q+=Y;while(L>0n){if(L&1n)G=G*Q%Y;L>>=1n,Q=Q*Q%Y}return G}function j(Q,L){Q=Q<0n?-Q:Q,L=L<0n?-L:L;while(L){let Y=L;L=Q%L,Q=Y}return Q}function Z(Q,L){return Q/j(Q,L)*L}function q(Q,L){if(L<=0n)throw Error("bigint: mod must be > 0");let[Y,G]=[Q%L,L],[J,U]=[1n,0n];while(G!==0n){let W=Y/G;[Y,G]=[G,Y-W*G],[J,U]=[U,J-W*U]}if(Y!==1n)throw Error("bigint: no modular inverse");return(J%L+L)%L}function $(Q,L=20){if(Q<2n)return!1;if(Q===2n||Q===3n)return!0;if(Q%2n===0n)return!1;let Y=Q-1n,G=0;while(Y%2n===0n)Y/=2n,G++;let J=[2n,3n,5n,7n,11n,13n,17n,19n,23n,29n,31n,37n,41n,43n,47n,53n,59n,61n,67n,71n],U=Math.min(L,J.length);$:for(let W=0;W<U;W++){let C=J[W];if(C>=Q-1n)continue;let P=R(C,Y,Q);if(P===1n||P===Q-1n)continue;for(let D=0;D<G-1;D++)if(P=P*P%Q,P===Q-1n)continue $;return!1}return!0}function V(Q,L,Y){if(Q>L)throw Error("bigint: min > max");let G=L-Q+1n,J=E(G-1n),U=Math.ceil(J/8);while(!0){let W=Y(U),C=0n;for(let D=0;D<W.length;D++)C=C<<8n|BigInt(W[D]);let P=(1n<<BigInt(J))-1n;if(C&=P,C<G)return Q+C}}function X(Q,L=10){if(Q=Q.trim(),L===16){let Y=!1;if(Q.startsWith("-"))Y=!0,Q=Q.slice(1);if(Q.startsWith("0x")||Q.startsWith("0X"))Q=Q.slice(2);return Y?-BigInt("0x"+Q):BigInt("0x"+Q)}if(L===10)return BigInt(Q);return BigInt(parseInt(Q,L))}function H(Q,L=10){if(L===10)return Q.toString();if(L===16){let Y=Q<0n,G=Y?-Q:Q;return(Y?"-":"")+G.toString(16)}return Q.toString(L)}return{toBytes:T,fromBytes:N,bitLength:E,byteLength:S,modPow:R,modInv:q,gcd:j,lcm:Z,isPrime:$,randomBetween:V,parse:X,toString:H}}};var BJ={name:"geom",version:"1.0.0",type:"fw.io.math",dependencies:["linalg"],deps:[k$],factory(E){let S={create:($,V)=>({x:$,y:V}),distance:($,V)=>Math.sqrt((V.x-$.x)**2+(V.y-$.y)**2),midpoint:($,V)=>({x:($.x+V.x)/2,y:($.y+V.y)/2}),equals:($,V,X=0.000001)=>Math.abs($.x-V.x)<=X&&Math.abs($.y-V.y)<=X},T={create:($,V,X,H)=>({x:$,y:V,w:X,h:H}),contains:($,V)=>V.x>=$.x&&V.x<$.x+$.w&&V.y>=$.y&&V.y<$.y+$.h,intersects:($,V)=>!($.x+$.w<=V.x||V.x+V.w<=$.x||$.y+$.h<=V.y||V.y+V.h<=$.y),intersection:($,V)=>{let X=Math.max($.x,V.x),H=Math.max($.y,V.y),Q=Math.min($.x+$.w,V.x+V.w),L=Math.min($.y+$.h,V.y+V.h);if(Q<=X||L<=H)return null;return{x:X,y:H,w:Q-X,h:L-H}},union:($,V)=>{let X=Math.min($.x,V.x),H=Math.min($.y,V.y),Q=Math.max($.x+$.w,V.x+V.w),L=Math.max($.y+$.h,V.y+V.h);return{x:X,y:H,w:Q-X,h:L-H}},area:($)=>$.w*$.h,center:($)=>({x:$.x+$.w/2,y:$.y+$.h/2}),normalize:($)=>({x:$.w<0?$.x+$.w:$.x,y:$.h<0?$.y+$.h:$.y,w:Math.abs($.w),h:Math.abs($.h)})},N={create:($,V,X)=>({cx:$,cy:V,r:X}),contains:($,V)=>(V.x-$.cx)**2+(V.y-$.cy)**2<=$.r*$.r,intersectsCircle:($,V)=>{return($.cx-V.cx)**2+($.cy-V.cy)**2<=($.r+V.r)**2},intersectsRect:($,V)=>{let X=Math.max(V.x,Math.min($.cx,V.x+V.w)),H=Math.max(V.y,Math.min($.cy,V.y+V.h));return($.cx-X)**2+($.cy-H)**2<=$.r*$.r}},R={create:($,V,X,H)=>({x1:$,y1:V,x2:X,y2:H}),length:($)=>Math.sqrt(($.x2-$.x1)**2+($.y2-$.y1)**2),intersects:($,V)=>{let X=$.x2-$.x1,H=$.y2-$.y1,Q=V.x2-V.x1,L=V.y2-V.y1,Y=X*L-H*Q;if(Math.abs(Y)<0.0000000001)return!1;let G=V.x1-$.x1,J=V.y1-$.y1,U=(G*L-J*Q)/Y,W=(G*H-J*X)/Y;return U>=0&&U<=1&&W>=0&&W<=1},intersection:($,V)=>{let X=$.x2-$.x1,H=$.y2-$.y1,Q=V.x2-V.x1,L=V.y2-V.y1,Y=X*L-H*Q;if(Math.abs(Y)<0.0000000001)return null;let G=V.x1-$.x1,J=V.y1-$.y1,U=(G*L-J*Q)/Y,W=(G*H-J*X)/Y;if(U<0||U>1||W<0||W>1)return null;return{x:$.x1+U*X,y:$.y1+U*H}},distanceToPoint:($,V)=>{let X=$.x2-$.x1,H=$.y2-$.y1,Q=X*X+H*H;if(Q===0)return S.distance({x:$.x1,y:$.y1},V);let L=Math.max(0,Math.min(1,((V.x-$.x1)*X+(V.y-$.y1)*H)/Q));return S.distance({x:$.x1+L*X,y:$.y1+L*H},V)},closestPoint:($,V)=>{let X=$.x2-$.x1,H=$.y2-$.y1,Q=X*X+H*H;if(Q===0)return{x:$.x1,y:$.y1};let L=Math.max(0,Math.min(1,((V.x-$.x1)*X+(V.y-$.y1)*H)/Q));return{x:$.x1+L*X,y:$.y1+L*H}}},j={create:($)=>({points:$}),area:($)=>{let V=$.points,X=0,H=V.length;for(let Q=0;Q<H;Q++){let L=(Q+1)%H;X+=V[Q].x*V[L].y-V[L].x*V[Q].y}return X/2},isCcw:($)=>j.area($)>0,bbox:($)=>{let V=$.points,X=V[0].x,H=V[0].x,Q=V[0].y,L=V[0].y;for(let Y of V){if(Y.x<X)X=Y.x;if(Y.x>H)H=Y.x;if(Y.y<Q)Q=Y.y;if(Y.y>L)L=Y.y}return T.create(X,Q,H-X,L-Q)},contains:($,V)=>{let X=$.points,H=X.length,Q=!1;for(let L=0,Y=H-1;L<H;Y=L++){let G=X[L].x,J=X[L].y,U=X[Y].x,W=X[Y].y;if(J>V.y!==W>V.y&&V.x<(U-G)*(V.y-J)/(W-J)+G)Q=!Q}return Q},simplify:($,V)=>{let X=$.points;if(X.length<=2)return $;function H(Q,L){if(Q.length<=2)return Q;let Y=Q[0],G=Q[Q.length-1],J=R.create(Y.x,Y.y,G.x,G.y),U=0,W=0;for(let C=1;C<Q.length-1;C++){let P=R.distanceToPoint(J,Q[C]);if(P>U)U=P,W=C}if(U<=L)return[Y,G];return[...H(Q.slice(0,W+1),L).slice(0,-1),...H(Q.slice(W),L)]}return{points:H(X,V)}}};function Z($,V){if("w"in $&&"h"in $)return T.contains($,V);if("r"in $&&"cx"in $)return N.contains($,V);if("points"in $)return j.contains($,V);return!1}function q($,V){let X=E.vec2.create();return E.mat3.transform(X,V,E.vec2.create([$.x,$.y])),{x:X[0],y:X[1]}}return{Point:S,Rect:T,Circle:N,Line:R,Polygon:j,hitTest:Z,transform:q}}};var PJ={name:"fixedPoint",version:"1.0.0",type:"fw.io.math",dependencies:[],factory(){function E(V,X,H,Q=!0){let L=X+H,Y=V;if(Q){let G=Math.pow(2,L),J=G/2;if(Y&J)Y=Y-G}return Y/Math.pow(2,H)}function S(V,X,H,Q=!0,L={}){let Y=L&&L.strict===!0,G=X+H;if(typeof V!=="number"||V!==V){if(Y)throw RangeError(`fixedPoint: invalid value ${V}`);return 0}let J=Math.pow(2,H),U=Math.round(V*J),W=Math.pow(2,G),C=W/2,P=Q?-C:0,D=Q?C-1:W-1;if(!isFinite(U)||U<P||U>D){if(Y)throw RangeError(`fixedPoint: value ${V} out of range [${P/J}, ${D/J}]`);U=U<P||U===-1/0?P:D}if(G>=32)return U>>>0;return U&(1<<G)-1}function T(V){return(V|0)/65536}function N(V,X){let H=X&&X.strict===!0;if(typeof V!=="number"||V!==V){if(H)throw RangeError(`fixedPoint: invalid value ${V}`);return 0}let Q=-2147483648,L=2147483647,Y=Math.round(V*65536);if(!isFinite(Y)||Y<Q||Y>L){if(H)throw RangeError(`fixedPoint: value ${V} out of Fixed16.16 range [-32768, 32767.99998…]`);Y=Y<Q||Y===-1/0?Q:L}return Y>>>0}function R(V){return(V>>>0)/65536}function j(V,X){let H=X&&X.strict===!0;if(typeof V!=="number"||!isFinite(V)){if(H)throw RangeError(`fixedPoint: invalid value ${V}`);return 0}let Q=Math.round(V*65536),L=0,Y=4294967295;if(Q<L||Q>Y){if(H)throw RangeError(`fixedPoint: value ${V} out of UFix16.16 range [0, 65535.99998…]`);Q=Q<L?L:Y}return Q>>>0}function Z(V){let X=V&65535;if(X&32768)X=X-65536;return X/16384}function q(V,X){let H=X&&X.strict===!0;if(typeof V!=="number"||!isFinite(V)){if(H)throw RangeError(`fixedPoint: invalid value ${V}`);return 0}let Q=Math.round(V*16384),L=-32768,Y=32767;if(Q<L||Q>Y){if(H)throw RangeError(`fixedPoint: value ${V} out of F2Dot14 range [-2, 1.99993…]`);Q=Q<L?L:Y}return Q&65535}function $(V,X,H){return H*(X/V)}return{fixed16ToFloat:T,floatToFixed16:N,ufixed16ToFloat:R,floatToUfixed16:j,f2dot14ToFloat:Z,floatToF2dot14:q,funitToPx:$,fixedToFloat:E,floatToFixed:S}}};var CJ={name:"binaryReader",version:"1.0.0",type:"fw.io.binary",dependencies:[],factory(){let E=new TextDecoder("utf-8");function S(N,R,j){let Z=Error(R);if(Z.name="ContractError",Z.code=N,j)Z.context=j;return Z}function T(N,R){if(!(N instanceof Uint8Array))throw S("binary/reader-input","binaryReader.create expects Uint8Array",{actual:typeof N});let Z=(R||{}).endian==="le"?"le":"be",q=N,$=new DataView(N.buffer,N.byteOffset,N.byteLength),V=N.byteLength,X=0;function H(Y){if(X+Y>V)throw S("binary/reader-eof","unexpected end of stream",{needed:Y,pos:X,length:V})}let Q=()=>Z==="le",L={get pos(){return X},get length(){return V},eof(){return X>=V},tell(){return X},seek(Y){if(Y<0||Y>V)throw S("binary/reader-seek","seek out of bounds",{offset:Y,length:V});return X=Y,L},skip(Y){return L.seek(X+Y)},peek(Y){return H(Y),new Uint8Array(q.buffer,q.byteOffset+X,Y)},setEndian(Y){if(Y!=="be"&&Y!=="le")throw S("binary/reader-endian",'endian must be "be" or "le"',{actual:Y});Z=Y},u8(){H(1);let Y=$.getUint8(X);return X+=1,Y},u16(){H(2);let Y=$.getUint16(X,Q());return X+=2,Y},u24(){H(3);let Y;if(Q())Y=$.getUint8(X)|$.getUint8(X+1)<<8|$.getUint8(X+2)<<16;else Y=$.getUint8(X)<<16|$.getUint8(X+1)<<8|$.getUint8(X+2);return X+=3,Y>>>0},u32(){H(4);let Y=$.getUint32(X,Q());return X+=4,Y>>>0},u64(){H(8);let Y=$.getBigUint64(X,Q());return X+=8,Y},u64Safe(){let Y=L.u64();if(Y>BigInt(Number.MAX_SAFE_INTEGER))throw S("binary/reader-u64safe","u64 value exceeds Number.MAX_SAFE_INTEGER",{value:Y.toString()});return Number(Y)},i8(){H(1);let Y=$.getInt8(X);return X+=1,Y},i16(){H(2);let Y=$.getInt16(X,Q());return X+=2,Y},i32(){H(4);let Y=$.getInt32(X,Q());return X+=4,Y},i64(){H(8);let Y=$.getBigInt64(X,Q());return X+=8,Y},f32(){H(4);let Y=$.getFloat32(X,Q());return X+=4,Y},f64(){H(8);let Y=$.getFloat64(X,Q());return X+=8,Y},bytes(Y){H(Y);let G=new Uint8Array(q.buffer,q.byteOffset+X,Y);return X+=Y,G},utf8(Y){let G=L.bytes(Y);return E.decode(G)},ascii(Y){H(Y);let G="";for(let J=0;J<Y;J++){let U=$.getUint8(X+J);if(U>127)throw S("binary/reader-ascii","non-ASCII byte encountered",{byte:U,pos:X+J});G+=String.fromCharCode(U)}return X+=Y,G},cstring(){let Y=X;while(Y<V&&$.getUint8(Y)!==0)Y++;if(Y>=V)throw S("binary/reader-cstring","NUL terminator not found before end of buffer",{pos:X,length:V});let G=new Uint8Array(q.buffer,q.byteOffset+X,Y-X),J=E.decode(G);return X=Y+1,J},sub(Y,G){if(Y<0||G<0||Y+G>V)throw S("binary/reader-sub","sub-reader range out of bounds",{offset:Y,length:G,parentLength:V});let J=q.subarray(Y,Y+G);return T(J,{endian:Z})}};return L}return{create:T}}};var RJ={name:"binaryWriter",version:"1.0.0",type:"fw.io.binary",dependencies:[],factory(){let T=new TextEncoder;function N(j,Z,q){let $=Error(Z);if($.name="ContractError",$.code=j,q)$.context=q;return $}function R(j){let Z=j||{},q=Z.endian==="le"?"le":"be",$=Z.initialSize&&Z.initialSize>0?Z.initialSize:256,V=new ArrayBuffer($),X=new Uint8Array(V),H=new DataView(V),Q=0,L=0,Y=()=>q==="le";function G(W){let C=Q+W;if(C<=$)return;let P=$*2;while(P<C)P*=2;let D=new ArrayBuffer(P),F=new Uint8Array(D);F.set(X.subarray(0,L)),$=P,V=D,X=F,H=new DataView(D)}function J(W){if(Q+=W,Q>L)L=Q}let U={get pos(){return Q},get length(){return L},seek(W){if(W<0)throw N("binary/writer-seek","seek offset must be >= 0",{offset:W});return Q=W,U},align(W){if(W<=0)throw N("binary/writer-align","align argument must be > 0",{n:W});let C=Q%W;if(C===0)return U;let P=W-C;G(P);for(let D=0;D<P;D++)X[Q+D]=0;return J(P),U},u8(W){return G(1),H.setUint8(Q,W&255),J(1),U},u16(W){return G(2),H.setUint16(Q,W&65535,Y()),J(2),U},u24(W){if(G(3),Y())X[Q]=W&255,X[Q+1]=W>>>8&255,X[Q+2]=W>>>16&255;else X[Q]=W>>>16&255,X[Q+1]=W>>>8&255,X[Q+2]=W&255;return J(3),U},u32(W){return G(4),H.setUint32(Q,W>>>0,Y()),J(4),U},u64(W){return G(8),H.setBigUint64(Q,W,Y()),J(8),U},i8(W){return G(1),H.setInt8(Q,W),J(1),U},i16(W){return G(2),H.setInt16(Q,W,Y()),J(2),U},i32(W){return G(4),H.setInt32(Q,W,Y()),J(4),U},i64(W){return G(8),H.setBigInt64(Q,W,Y()),J(8),U},f32(W){return G(4),H.setFloat32(Q,W,Y()),J(4),U},f64(W){return G(8),H.setFloat64(Q,W,Y()),J(8),U},bytes(W){if(!(W instanceof Uint8Array))throw N("binary/writer-bytes","bytes() expects Uint8Array",{actual:typeof W});return G(W.byteLength),X.set(W,Q),J(W.byteLength),U},utf8(W){if(typeof W!=="string")throw N("binary/writer-utf8","utf8() expects string",{actual:typeof W});let C=T.encode(W);return U.bytes(C)},ascii(W){if(typeof W!=="string")throw N("binary/writer-ascii","ascii() expects string",{actual:typeof W});G(W.length);for(let C=0;C<W.length;C++){let P=W.charCodeAt(C);if(P>127)throw N("binary/writer-ascii","non-ASCII character encountered",{char:W[C],code:P,index:C});X[Q+C]=P}return J(W.length),U},cstring(W){if(typeof W!=="string")throw N("binary/writer-cstring","cstring() expects string",{actual:typeof W});return U.utf8(W),U.u8(0),U},finalize(){return new Uint8Array(V.slice(0,L))}};return U}return{create:R}}};var MJ={name:"processMessage",version:"1.0.0",type:"fw.process",dependencies:[],factory(){let T=new Set(["postMessage","onmessage","addEventListener","removeEventListener"]),N=()=>{},R=(Q)=>Q!==null&&typeof Q==="object"&&Q.__fw===!0,j=(Q,L)=>{let{data:Y,ports:G}=L;if(R(Y)){if(Y.__type==="cmd"){if(typeof Y.name==="string"){let J=Q.handlers.get(Y.name);if(J)return J(Y.msg,G)}}return}for(let J of Q.listeners)J(L);Q.onmessage(L)},Z=(Q)=>{Q.addEventListener=(L,Y)=>{if(L==="message"&&typeof Y==="function")Q.listeners.push(Y)},Q.removeEventListener=(L,Y)=>{if(L==="message")Q.listeners=Q.listeners.filter((G)=>G!==Y)}},q=(Q)=>{let L={postMessage:(...Y)=>Q.postMessage(...Y),addEventListener:(...Y)=>Q.addEventListener(...Y),removeEventListener:(...Y)=>Q.removeEventListener(...Y)};return new Proxy(Q,{set(Y,G,J){if(typeof J==="function"){if(!T.has(G))Y.handlers.set(G,J);else if(G==="onmessage")Q.onmessage=J;return!0}if(J===!1){if(!T.has(G))Y.handlers.delete(G);else if(G==="onmessage")Q.onmessage=()=>{};return!0}return!1},get(Y,G){if(Y.handlers.has(G))return Y.handlers.get(G);if(T.has(G))return L[G]??!1;return!1}})};return{sync:()=>{let Q=()=>({handlers:new Map,onmessage:N,postMessage:N,addEventListener:N,removeEventListener:N,listeners:[]}),L=Q(),Y=Q();return L.postMessage=(G,J)=>j(Y,{data:G,ports:J}),Z(L),Y.postMessage=(G,J)=>j(L,{data:G,ports:J}),Z(Y),{process:q(L),manager:Y}},worker:()=>{let Q={handlers:new Map,onmessage:()=>{},postMessage:(...Y)=>self.postMessage(...Y),addEventListener:N,removeEventListener:N,listeners:[]},L=q(Q);return Z(Q),self.addEventListener("message",(Y)=>{if(Y&&Y.data!==void 0){if(R(Y.data))Y.stopImmediatePropagation();j(Q,Y)}}),L},workerCommand:(Q)=>{return new Proxy(Object.freeze({}),{set:()=>!1,get:(L,Y)=>(G,J=[])=>Q.postMessage({["__fw"]:!0,__type:"cmd",name:Y,msg:G},J)})},workerFramework:(Q,L,Y)=>{let G=Q.resolveAll(L),J=G.processMessage.worker();return{libs:G,process:J,args:Y}}}}};var AJ={name:"processRPC",version:"1.0.0",type:"fw.process",dependencies:[],factory(){let Z=new Set(["__proto__","constructor","prototype"]),q=new Set(["then","toJSON","valueOf","toString","inspect","nodeType","asymmetricMatch"]),$=(Q,L=0)=>{if(L>8||Q===null||typeof Q!=="object")return null;let Y=Object.create(null);for(let G of Object.keys(Q)){if(Z.has(G))continue;let J=Q[G];if(typeof J==="function")Y[G]="fn";else if(J!==null&&typeof J==="object"&&!Array.isArray(J)){let U=$(J,L+1);if(U)Y[G]=U}else Y[G]="val"}return Y},V=(Q,L)=>{let Y=Q;for(let G of L){if(typeof G!=="string"||Z.has(G))return{ok:!1};if(Y===null||typeof Y!=="object")return{ok:!1};if(!Object.prototype.hasOwnProperty.call(Y,G))return{ok:!1};Y=Y[G]}return{ok:!0,value:Y}};return{create:(Q)=>{let L=$(Q),Y=new MessageChannel;return Y.port1.postMessage({["__rpc_init"]:!0,desc:L}),Y.port1.onmessage=async(G)=>{let J=G.data;if(J===null||typeof J!=="object"||typeof J.id!=="number"||!Array.isArray(J.path))return;let{id:U,path:W,args:C}=J;try{let P=V(Q,W);if(!P.ok){Y.port1.postMessage({id:U,error:"Path not found: "+W.join(".")});return}let D=typeof P.value==="function"?await P.value(...Array.isArray(C)?C:[]):P.value;Y.port1.postMessage({id:U,result:D})}catch(P){Y.port1.postMessage({id:U,error:String(P)})}},{port:[Y.port2],close:()=>{Y.port1.close()}}},open:(Q,L={})=>{let Y=typeof L.timeout==="number"&&L.timeout>0?Math.min(L.timeout,2147483647):30000,G=new Map,J=0,U=(P)=>{let{id:D,result:F,error:K}=P.data,O=G.get(D);if(!O)return;if(G.delete(D),clearTimeout(O.timer),K!==void 0)O.reject(Error(K));else O.resolve(F)},W=(P,D)=>{let F=J++;if(J>4294967295)J=0;return new Promise((K,O)=>{let M=setTimeout(()=>{G.delete(F),O(Error("RPC timeout: "+P.join(".")))},Y);G.set(F,{resolve:K,reject:O,timer:M}),Q.postMessage({id:F,path:P,args:D})})},C=(P,D)=>{return new Proxy(Object.create(null),{get(F,K){if(typeof K==="symbol")return;if(Z.has(K))return;let O=P[K];if(O===void 0){if(q.has(K))return;throw Error("RPC endpoint not found: "+[...D,K].join("."))}if(O==="fn")return(...M)=>W([...D,K],M);if(O==="val")return W([...D,K],[]);return C(O,[...D,K])},set(){return!1},has(F,K){if(typeof K==="symbol")return!1;return K in P}})};return new Promise((P,D)=>{let F=setTimeout(()=>{Q.onmessage=null,D(Error("RPC open timeout: descriptor not received"))},Y);Q.onmessage=(K)=>{let O=K.data;if(O&&O.__rpc_init===!0&&O.desc)clearTimeout(F),Q.onmessage=U,P(C(O.desc,[]))}})}}}};var NJ={name:"dnd",version:"1.1.0",type:"fw.dom.query",dependencies:[],factory(){let E=null,S=new Set;function T(G,J,U){G.style.left=J+"px",G.style.top=U+"px"}function N(G,J,U){G.style.position="fixed",G.style.pointerEvents="none",G.style.zIndex="2147483647",G.style.margin="0",T(G,J,U),document.body.appendChild(G)}let R=null;function j(){let G=document.documentElement&&document.documentElement.style;if(!G||R!==null)return;R=[G.userSelect,G.webkitUserSelect],G.userSelect="none",G.webkitUserSelect="none"}function Z(){let G=document.documentElement&&document.documentElement.style;if(!G||R===null)return;G.userSelect=R[0],G.webkitUserSelect=R[1],R=null}function q(){let G=typeof window<"u"&&window.getSelection?window.getSelection():null;return!!(G&&!G.isCollapsed)}function $(){let G=typeof window<"u"&&window.getSelection?window.getSelection():null;if(G&&G.removeAllRanges)G.removeAllRanges()}function V(G,J){if(!G||!G.parentNode)return;if(J>0)G.style.transition=`opacity ${J}ms`,G.style.opacity="0",setTimeout(()=>{if(G.parentNode)G.parentNode.removeChild(G)},J);else G.parentNode.removeChild(G)}function X(G,J){let U=document.elementsFromPoint?document.elementsFromPoint(G,J):[];for(let W of S)if(U.includes(W._el))return W;return null}function H(G,J){document.dispatchEvent(new CustomEvent(G,{detail:J,bubbles:!0}))}function Q(G,J={}){if(!G)throw Error("dnd.draggable: el is required");let U=J.axis??"both",W=J.threshold??5,C=J.cancelMs??150,P=!0,D=0,F=0,K=!1,O=null,M=null,z=!1,B=!1;function I(){if(B)return;B=!0,document.addEventListener("pointermove",g),document.addEventListener("pointerup",x,{once:!0}),document.addEventListener("pointercancel",f,{once:!0})}function A(){if(!B)return;B=!1,document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",x),document.removeEventListener("pointercancel",f)}function w(){if(!J.handle)return G;if(typeof J.handle==="string")return G.querySelector(J.handle);return J.handle}function k(b){if(!P)return;if(b.button!==void 0&&b.button!==0)return;let h=w();if(h&&!h.contains(b.target)&&h!==b.target)return;if(B)return;D=b.clientX,F=b.clientY,K=!1,M=null,z=q(),G.setPointerCapture(b.pointerId),I()}function g(b){let h=b.clientX-D,d=b.clientY-F,n=Math.sqrt(h*h+d*d);if(!K){if(n<W)return;if(E)return;K=!0;let $$=null;if(J.data)try{$$=J.data()}catch(e){if(K=!1,A(),J.onError)try{J.onError(e)}catch{}return}if(J.preview)O=J.preview($$);else{let e=G.getBoundingClientRect();O=G.cloneNode(!0);let t=O.style;t.opacity="0.6",t.boxSizing="border-box",t.width=e.width+"px",t.height=e.height+"px"}if(N(O,b.clientX,b.clientY),j(),!z)$();if(E={data:$$,preview:O,source:G,x:b.clientX,y:b.clientY},H("dnd:start",{data:$$,source:G}),J.onStart)J.onStart({data:$$,x:b.clientX,y:b.clientY})}let{clientX:m,clientY:c}=b;if(U==="x")c=F;if(U==="y")m=D;T(O,m,c),E.x=m,E.y=c;let o=X(m,c);if(o!==M){if(M&&M._accept(E.data)){if(M._opts.hoverClass)M._el.classList.remove(M._opts.hoverClass);if(M._opts.onLeave)M._opts.onLeave(E.data)}if(M=o,M&&M._accept(E.data)){if(M._opts.hoverClass)M._el.classList.add(M._opts.hoverClass);if(M._opts.onEnter)M._opts.onEnter(E.data)}}else if(M&&M._accept(E.data)){if(M._opts.onOver)M._opts.onOver(E.data,{x:m,y:c})}if(J.onMove)J.onMove({data:E.data,x:m,y:c})}function x(b){if(A(),!K){M=null;return}let{clientX:h,clientY:d}=b;if(M&&M._accept(E.data)){if(M._opts.hoverClass)M._el.classList.remove(M._opts.hoverClass);if(M._opts.onDrop(E.data,{x:h,y:d,target:M._el}),M._opts.onLeave)M._opts.onLeave(E.data)}M=null,V(O,C),O=null,Z();let n=E?E.data:null;if(E=null,K=!1,H("dnd:end",{data:n,source:G}),J.onEnd)J.onEnd({data:n,x:h,y:d})}function f(b){if(A(),!K){M=null;return}let h=b?.clientX??(E?.x??0),d=b?.clientY??(E?.y??0);if(M){if(M._opts.hoverClass)M._el.classList.remove(M._opts.hoverClass);if(M._opts.onLeave)try{M._opts.onLeave(E?.data)}catch{}}M=null,V(O,C),O=null,Z();let n=E?E.data:null;if(E=null,K=!1,H("dnd:end",{data:n,source:G,cancelled:!0}),J.onEnd)J.onEnd({data:n,x:h,y:d,cancelled:!0})}G.addEventListener("pointerdown",k);function y(){P=!1}function _(){P=!0}function v(){if(G.removeEventListener("pointerdown",k),A(),E&&E.source===G){let{x:b,y:h,data:d}=E;if(M){if(M._opts.hoverClass)M._el.classList.remove(M._opts.hoverClass);if(M._opts.onLeave)try{M._opts.onLeave(d)}catch{}}if(M=null,V(O,0),O=null,Z(),E=null,K=!1,H("dnd:end",{data:d,source:G,cancelled:!0}),J.onEnd)J.onEnd({data:d,x:b,y:h,cancelled:!0})}else{if(O&&O.parentNode)O.parentNode.removeChild(O);O=null}}return{disable:y,enable:_,dispose:v}}function L(G,J={}){if(!G)throw Error("dnd.dropTarget: el is required");if(!J.accept)throw Error("dnd.dropTarget: accept is required");if(!J.onDrop)throw Error("dnd.dropTarget: onDrop is required");let U={_el:G,_opts:J,_accept:J.accept};S.add(U);function W(){S.delete(U)}return{dispose:W}}function Y(){return E}return{draggable:Q,dropTarget:L,active:Y}}};var jJ={name:"media",type:"fw.dom.query",dependencies:[],factory(){let E=typeof navigator<"u"?navigator.mediaDevices:null,S=E?.getSupportedConstraints?.()??{},T=Object.keys(S).length>0;function N(K){return!T||!!S[K]}let R={audio:{},video:{}},j={audio:!1,video:!1},Z={audio:null,video:null},q={},$={map:[],list:{}},V={audio:!!(E&&typeof E.getUserMedia==="function"),video:!!(E&&typeof E.getUserMedia==="function"),screen:!!(E&&typeof E.getDisplayMedia==="function")};function X(K){let O={},M={};for(let z of K)if(z.kind==="audioinput")O[z.deviceId]=z;else if(z.kind==="videoinput")M[z.deviceId]=z;return{audio:O,video:M}}function H(K){R.audio=K.audio,R.video=K.video,j.audio=Object.values(K.audio).some((O)=>!!O.label),j.video=Object.values(K.video).some((O)=>!!O.label)}function Q(){let K={audio:Object.values(R.audio),video:Object.values(R.video)};for(let O of $.map)$.list[O](K)}function L(){return E.enumerateDevices().then((K)=>{return H(X(K)),Q(),{audio:Object.values(R.audio),video:Object.values(R.video)}})}let Y=()=>L();if(E&&typeof E.addEventListener==="function")E.addEventListener("devicechange",Y);function G(K){let O={};if(K.deviceId!==void 0&&N("deviceId"))O.deviceId={exact:K.deviceId};if(K.sampleRate!==void 0&&N("sampleRate"))O.sampleRate=K.sampleRate;if(K.sampleSize!==void 0&&N("sampleSize"))O.sampleSize=K.sampleSize;if(K.channelCount!==void 0&&N("channelCount"))O.channelCount=K.channelCount;if(K.echoCancellation!==void 0&&N("echoCancellation"))O.echoCancellation=K.echoCancellation;if(K.noiseSuppression!==void 0&&N("noiseSuppression"))O.noiseSuppression=K.noiseSuppression;if(K.autoGainControl!==void 0&&N("autoGainControl"))O.autoGainControl=K.autoGainControl;return{audio:Object.keys(O).length?O:!0,video:!1}}function J(K){let O={};if(K.deviceId!==void 0&&N("deviceId"))O.deviceId={exact:K.deviceId};if(K.width!==void 0&&N("width"))O.width=K.width;if(K.height!==void 0&&N("height"))O.height=K.height;if(K.frameRate!==void 0&&N("frameRate"))O.frameRate=K.frameRate;if(K.aspectRatio!==void 0&&N("aspectRatio"))O.aspectRatio=K.aspectRatio;if(K.facingMode!==void 0&&N("facingMode"))O.facingMode=K.facingMode;return{audio:!1,video:Object.keys(O).length?O:!0}}function U(K){let O={};if(K.frameRate!==void 0)O.frameRate=K.frameRate;if(K.cursor!==void 0)O.cursor=K.cursor;if(K.width!==void 0)O.width=K.width;if(K.height!==void 0)O.height=K.height;return{video:Object.keys(O).length?O:{cursor:"always"},audio:K.audio===!0}}function W(K,O){let M=O.getTracks();return{id:O.id,type:K,stream:O,tracks:M,settings:M.map((z)=>z.getSettings()),constraints:M.map((z)=>z.getConstraints()),stop(){C(O.id)}}}function C(K){let O=q[K];if(!O)return;for(let M of O.tracks)M.stop();delete q[K]}async function P(K={}){let O=K.deviceId??Z.audio??void 0,M=G(O!==void 0?{...K,deviceId:O}:K),z=await E.getUserMedia(M);await L();let B=W("audio",z);q[z.id]=B;let I=B.settings[0]?.deviceId;if(I)Z.audio=I;return B}async function D(K={}){let O=K.deviceId??Z.video??void 0,M=J(O!==void 0?{...K,deviceId:O}:K),z=await E.getUserMedia(M);await L();let B=W("video",z);q[z.id]=B;let I=B.settings[0]?.deviceId;if(I)Z.video=I;return B}async function F(K={}){let O=await E.getDisplayMedia(U(K)),M=W("screen",O);q[O.id]=M;for(let z of M.tracks)z.addEventListener("ended",()=>C(O.id),{once:!0});return M}return{isSupported(){return{...V}},permissions(){return{...j}},devices:{refresh:L,list(){return{audio:Object.values(R.audio),video:Object.values(R.video)}},audio(){return Object.values(R.audio)},video(){return Object.values(R.video)},listen:{add(K,O){if($.map.indexOf(K)<0)$.map.push(K);$.list[K]=O},del(K){let O=$.map.indexOf(K);if(O>-1)$.map.splice(O,1),delete $.list[K]}}},audio:{start:P},video:{start:D},screen:{start:F},streams:{list(){return Object.values(q)},get(K){return q[K]??null},byType(K){return Object.values(q).filter((O)=>O.type===K)},stop(K){C(K)},stopAll(){for(let K of Object.keys(q))C(K)},stopType(K){for(let O of Object.keys(q))if(q[O]?.type===K)C(O)}},select(K,O){if(K==="audio"||K==="video")Z[K]=O},selected(){return{...Z}},dispose(){for(let K of Object.keys(q))C(K);if(E&&typeof E.removeEventListener==="function")E.removeEventListener("devicechange",Y);$.map.length=0;for(let K of Object.keys($.list))delete $.list[K];R.audio={},R.video={}}}}};var TJ={name:"sound",version:"1.0.0",type:"fw.dom.query",dependencies:[],factory(){let E=["audio/webm;codecs=opus","audio/ogg;codecs=opus","audio/mp4","audio/webm","audio/ogg"],S=null,T=0,N=new Set,R=new Set,j=()=>typeof AudioContext<"u"?AudioContext:globalThis.webkitAudioContext||null,Z=()=>typeof MediaRecorder<"u"?MediaRecorder:null;function q(){if(S)return S;let K=j();if(!K)throw TypeError("sound: Web Audio is not available here");return S=new K,S}function $(){let K=Z();return{context:!!j(),recorder:!!K,mimeTypes:K&&typeof K.isTypeSupported==="function"?E.filter((O)=>K.isTypeSupported(O)):[]}}async function V(){let K=q();if(K.state!=="running")await K.resume()}function X(K){let O=!0,M=()=>{if(!O)throw TypeError("sound: the clip was disposed")},z={id:"clip-"+ ++T,durationMs:K.length*1000/K.sampleRate,sampleRate:K.sampleRate,channels:K.numberOfChannels,buffer:K,bytes:async()=>{return M(),F(K)},dispose:()=>{O=!1,N.delete(z)}};return Object.defineProperty(z,"_live",{value:M}),N.add(z),z}function H(K){if(!K||typeof K._live!=="function")throw TypeError("sound: not a clip");K._live()}function Q(K,O){let M=q().createBuffer(K.length,Math.max(1,K[0].length),O);return K.forEach((z,B)=>M.getChannelData(B).set(z)),M}let L=(K)=>Array.from({length:K.numberOfChannels},(O,M)=>K.getChannelData(M));function Y(K){if(!K||typeof K.getChannelData!=="function"||!(K.length>0))throw TypeError("sound: fromBuffer needs a non-empty AudioBuffer");return X(Q(L(K),K.sampleRate))}async function G(K){if(!(K instanceof ArrayBuffer))throw TypeError("sound: fromBytes needs an ArrayBuffer");let O=await q().decodeAudioData(K.slice(0));return X(O)}function J(K,O){H(K);let M=O&&O.thresholdDb!==void 0?O.thresholdDb:-45;if(typeof M!=="number"||!Number.isFinite(M)||M>0)throw TypeError("sound: thresholdDb must be a finite number <= 0");let z=10**(M/20),B=L(K.buffer),I=(k)=>B.some((g)=>Math.abs(g[k])>z),A=0;while(A<K.buffer.length&&!I(A))A++;if(A===K.buffer.length)return X(Q(B.map(()=>new Float32Array(1)),K.sampleRate));let w=K.buffer.length-1;while(w>A&&!I(w))w--;return X(Q(B.map((k)=>k.slice(A,w+1)),K.sampleRate))}function U(K,O){H(K);let M=O&&O.peak!==void 0?O.peak:0.9;if(typeof M!=="number"||!(M>0&&M<=1))throw TypeError("sound: peak must be in (0, 1]");let z=L(K.buffer),B=0;for(let A of z)for(let w of A)B=Math.max(B,Math.abs(w));let I=B===0?1:M/B;return X(Q(z.map((A)=>A.map((w)=>w*I)),K.sampleRate))}function W(K,O){H(K);let M=O||{},z=M.rate===void 0?1:M.rate,B=M.gain===void 0?1:M.gain;if(typeof z!=="number"||!(z>0)||!Number.isFinite(z))throw TypeError("sound: rate must be a positive number");if(typeof B!=="number"||!(B>=0)||!Number.isFinite(B))throw TypeError("sound: gain must be a non-negative number");if(M.when!==void 0&&(typeof M.when!=="number"||!(M.when>=0)))throw TypeError("sound: when must be a time >= 0");let I=q(),A=I.createBufferSource();A.buffer=K.buffer,A.playbackRate.value=z;let w=I.createGain();w.gain.value=B,A.connect(w).connect(I.destination);let k={source:A},g,x=new Promise((f)=>{g=f});return A.onended=()=>{R.delete(k);try{A.disconnect(),w.disconnect()}catch(f){}g()},R.add(k),A.start(M.when),{stop(){try{A.stop()}catch(f){}},ended:x}}let C=(K)=>2**(K/12);function P(K,O){let M=K&&K.stream?K.stream:K;if(!M||typeof M.getAudioTracks!=="function")throw TypeError("sound: record needs a StreamHandle or a MediaStream");let z=O||{},B=z.maxMs===void 0?1500:z.maxMs;if(typeof B!=="number"||!(B>0)||!Number.isFinite(B))throw TypeError("sound: maxMs must be a positive number");let I=Z();if(!I)throw TypeError("sound: MediaRecorder is not available here");let A=z.mimeType;if(A!==void 0&&!(typeof I.isTypeSupported==="function"&&I.isTypeSupported(A)))throw TypeError("sound: the recorder cannot write "+A);if(A===void 0)A=$().mimeTypes[0];let w=q(),k=w.createMediaStreamSource(M),g=w.createAnalyser();g.fftSize=2048,k.connect(g);let x=new Float32Array(g.fftSize),f=A?new I(M,{mimeType:A}):new I(M),y=[],_="recording",v=null,b,h=()=>{try{k.disconnect(),g.disconnect()}catch(m){}};f.ondataavailable=(m)=>{if(m.data&&m.data.size)y.push(m.data)},f.onstop=()=>{if(b)b()},f.start();let d=setTimeout(()=>{n()},B);function n(){if(v)return v;if(_==="cancelled")return Promise.reject(Error("sound: recording cancelled"));if(_="stopping",clearTimeout(d),v=new Promise((m)=>{b=m}).then(()=>new Blob(y,{type:f.mimeType}).arrayBuffer()).then((m)=>w.decodeAudioData(m)).then((m)=>{return _="stopped",h(),X(m)}),f.state!=="inactive")f.stop();else b();return v}return{level(){if(_!=="recording")return 0;g.getFloatTimeDomainData(x);let m=0;for(let c of x)m+=c*c;return Math.min(1,Math.sqrt(m/x.length))},stop:n,cancel(){if(_!=="recording")return;if(_="cancelled",clearTimeout(d),f.ondataavailable=null,f.onstop=null,f.state!=="inactive")f.stop();h()}}}async function D(){for(let O of Array.from(R))try{O.source.stop()}catch(M){}R.clear();for(let O of Array.from(N))O.dispose();let K=S;if(S=null,K&&K.state!=="closed")await K.close()}function F(K){let O=L(K),M=K.length,z=new ArrayBuffer(44+M*O.length*2),B=new DataView(z),I=(w,k)=>{for(let g=0;g<4;g++)B.setUint8(w+g,k.charCodeAt(g))};I(0,"RIFF"),B.setUint32(4,36+M*O.length*2,!0),I(8,"WAVE"),I(12,"fmt "),B.setUint32(16,16,!0),B.setUint16(20,1,!0),B.setUint16(22,O.length,!0),B.setUint32(24,K.sampleRate,!0),B.setUint32(28,K.sampleRate*O.length*2,!0),B.setUint16(32,O.length*2,!0),B.setUint16(34,16,!0),I(36,"data"),B.setUint32(40,M*O.length*2,!0);let A=44;for(let w=0;w<M;w++)for(let k of O)B.setInt16(A,Math.max(-32768,Math.min(32767,Math.round(k[w]*32768))),!0),A+=2;return z}return{support:$,unlock:V,record:P,fromBytes:G,fromBuffer:Y,trim:J,normalize:U,play:W,rate:C,disposeAll:D}}};var e$={DEV:!1,LOG:!0},SJ=e$.LOG?ZZ.main(e$.DEV):!1,JZ=new y$;JZ.registerAllDeep([VZ,v$,h$,b$,WZ,u$,m$,F$,D$,d$,FZ,qZ,LZ,OZ,I$,c$,w$,DZ,C$,l$,i$,n$,BZ,R$,PZ,CZ,RZ,MZ,AZ,NZ,jZ,TZ,IZ,EZ,r$,wZ,kZ,o$,gZ,xZ,vZ,hZ,bZ,uZ,mZ,pZ,dZ,cZ,lZ,iZ,nZ,p$,oZ,rZ,sZ,aZ,tZ,eZ,$J,ZJ,JJ,QJ,GJ,XJ,YJ,UJ,KJ,zJ,HJ,VJ,WJ,FJ,qJ,LJ,OJ,DJ,k$,BJ,t$,PJ,CJ,RJ,MJ,AJ,NJ,jJ,TJ]);var xJ=zZ(e$,JZ,KZ,SJ,ZZ.worker.toString()),fJ=HZ(),yJ={ENV:e$,log:SJ,runtime:JZ,createWorker:xJ,domReady:fJ},WG=yJ;export{WG as default};