nolune 0.1.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 (616) hide show
  1. package/DESIGN.md +1622 -0
  2. package/LICENSE +21 -0
  3. package/README.md +226 -0
  4. package/build/client/_app/immutable/assets/0.CO3c3JBa.css +2 -0
  5. package/build/client/_app/immutable/assets/0.CO3c3JBa.css.br +0 -0
  6. package/build/client/_app/immutable/assets/0.CO3c3JBa.css.gz +0 -0
  7. package/build/client/_app/immutable/assets/10.DiHYpJ-g.css +1 -0
  8. package/build/client/_app/immutable/assets/10.DiHYpJ-g.css.br +0 -0
  9. package/build/client/_app/immutable/assets/10.DiHYpJ-g.css.gz +0 -0
  10. package/build/client/_app/immutable/assets/14.D8mCg27h.css +1 -0
  11. package/build/client/_app/immutable/assets/14.D8mCg27h.css.br +0 -0
  12. package/build/client/_app/immutable/assets/14.D8mCg27h.css.gz +0 -0
  13. package/build/client/_app/immutable/assets/AssistantAvatar.BH1P1JPA.css +1 -0
  14. package/build/client/_app/immutable/assets/AssistantAvatar.BH1P1JPA.css.br +0 -0
  15. package/build/client/_app/immutable/assets/AssistantAvatar.BH1P1JPA.css.gz +0 -0
  16. package/build/client/_app/immutable/assets/AvatarPicker.BWZNEVEv.css +1 -0
  17. package/build/client/_app/immutable/assets/AvatarPicker.BWZNEVEv.css.br +0 -0
  18. package/build/client/_app/immutable/assets/AvatarPicker.BWZNEVEv.css.gz +0 -0
  19. package/build/client/_app/immutable/assets/DotGrid.uBe8QJ6R.css +1 -0
  20. package/build/client/_app/immutable/assets/DotGrid.uBe8QJ6R.css.br +0 -0
  21. package/build/client/_app/immutable/assets/DotGrid.uBe8QJ6R.css.gz +0 -0
  22. package/build/client/_app/immutable/assets/ModelMenu.CfwWh95X.css +1 -0
  23. package/build/client/_app/immutable/assets/ModelMenu.CfwWh95X.css.br +0 -0
  24. package/build/client/_app/immutable/assets/ModelMenu.CfwWh95X.css.gz +0 -0
  25. package/build/client/_app/immutable/assets/confirm.BpBhXN_i.mp3 +0 -0
  26. package/build/client/_app/immutable/assets/data.9aNBaxbh.json +1 -0
  27. package/build/client/_app/immutable/assets/data.9aNBaxbh.json.br +0 -0
  28. package/build/client/_app/immutable/assets/data.9aNBaxbh.json.gz +0 -0
  29. package/build/client/_app/immutable/assets/data.BF1r6TM-.json +1 -0
  30. package/build/client/_app/immutable/assets/data.BF1r6TM-.json.br +0 -0
  31. package/build/client/_app/immutable/assets/data.BF1r6TM-.json.gz +0 -0
  32. package/build/client/_app/immutable/assets/data.BnNTV_b6.json +1 -0
  33. package/build/client/_app/immutable/assets/data.BnNTV_b6.json.br +0 -0
  34. package/build/client/_app/immutable/assets/data.BnNTV_b6.json.gz +0 -0
  35. package/build/client/_app/immutable/assets/data.CreAftJo.json +1 -0
  36. package/build/client/_app/immutable/assets/data.CreAftJo.json.br +0 -0
  37. package/build/client/_app/immutable/assets/data.CreAftJo.json.gz +0 -0
  38. package/build/client/_app/immutable/assets/data.DKp8PYJD.json +1 -0
  39. package/build/client/_app/immutable/assets/data.DKp8PYJD.json.br +0 -0
  40. package/build/client/_app/immutable/assets/data.DKp8PYJD.json.gz +0 -0
  41. package/build/client/_app/immutable/assets/figtree-latin-ext-wght-italic.Q0qr0lrZ.woff2 +0 -0
  42. package/build/client/_app/immutable/assets/figtree-latin-ext-wght-normal.DCwSJGxG.woff2 +0 -0
  43. package/build/client/_app/immutable/assets/figtree-latin-wght-italic.BEAWuiTz.woff2 +0 -0
  44. package/build/client/_app/immutable/assets/figtree-latin-wght-normal.D_ZTVpCC.woff2 +0 -0
  45. package/build/client/_app/immutable/assets/fira-mono-cyrillic-400-normal.BJkDdjbt.woff2 +0 -0
  46. package/build/client/_app/immutable/assets/fira-mono-cyrillic-400-normal.DUd3efVn.woff +0 -0
  47. package/build/client/_app/immutable/assets/fira-mono-cyrillic-500-normal.CAy0Dwk2.woff2 +0 -0
  48. package/build/client/_app/immutable/assets/fira-mono-cyrillic-500-normal.CFTSF0cD.woff +0 -0
  49. package/build/client/_app/immutable/assets/fira-mono-cyrillic-ext-400-normal.Co4MVjrD.woff +0 -0
  50. package/build/client/_app/immutable/assets/fira-mono-cyrillic-ext-400-normal.FAIU8e3o.woff2 +0 -0
  51. package/build/client/_app/immutable/assets/fira-mono-cyrillic-ext-500-normal.BDCQVX4y.woff +0 -0
  52. package/build/client/_app/immutable/assets/fira-mono-cyrillic-ext-500-normal.BGV2-mDE.woff2 +0 -0
  53. package/build/client/_app/immutable/assets/fira-mono-greek-400-normal.B_0AmgK7.woff +0 -0
  54. package/build/client/_app/immutable/assets/fira-mono-greek-400-normal.ftNhKy_S.woff2 +0 -0
  55. package/build/client/_app/immutable/assets/fira-mono-greek-500-normal.DNFqaoqB.woff +0 -0
  56. package/build/client/_app/immutable/assets/fira-mono-greek-500-normal.kj_VgxTv.woff2 +0 -0
  57. package/build/client/_app/immutable/assets/fira-mono-greek-ext-400-normal.BQ5yw6bY.woff +0 -0
  58. package/build/client/_app/immutable/assets/fira-mono-greek-ext-400-normal.Be4g_LSk.woff2 +0 -0
  59. package/build/client/_app/immutable/assets/fira-mono-greek-ext-500-normal.CGPEfoom.woff2 +0 -0
  60. package/build/client/_app/immutable/assets/fira-mono-greek-ext-500-normal.g6G8W_LY.woff +0 -0
  61. package/build/client/_app/immutable/assets/fira-mono-latin-400-normal.C3FQ26ho.woff +0 -0
  62. package/build/client/_app/immutable/assets/fira-mono-latin-400-normal.DVTTRLHv.woff2 +0 -0
  63. package/build/client/_app/immutable/assets/fira-mono-latin-500-normal.DknboRIW.woff +0 -0
  64. package/build/client/_app/immutable/assets/fira-mono-latin-500-normal.Du17Nws8.woff2 +0 -0
  65. package/build/client/_app/immutable/assets/fira-mono-latin-ext-400-normal.B2gPvaNr.woff2 +0 -0
  66. package/build/client/_app/immutable/assets/fira-mono-latin-ext-400-normal.CbD3vWRE.woff +0 -0
  67. package/build/client/_app/immutable/assets/fira-mono-latin-ext-500-normal.-0AGvlKU.woff +0 -0
  68. package/build/client/_app/immutable/assets/fira-mono-latin-ext-500-normal.DPED3Y3R.woff2 +0 -0
  69. package/build/client/_app/immutable/assets/fira-mono-symbols2-400-normal.C6JptOil.woff2 +0 -0
  70. package/build/client/_app/immutable/assets/fira-mono-symbols2-400-normal.CpeG9ob9.woff +0 -0
  71. package/build/client/_app/immutable/assets/fira-mono-symbols2-500-normal.0PpNbZw_.woff2 +0 -0
  72. package/build/client/_app/immutable/assets/fira-mono-symbols2-500-normal.fxu0Prpo.woff +0 -0
  73. package/build/client/_app/immutable/assets/music.z3ymEIJM.mp3 +0 -0
  74. package/build/client/_app/immutable/assets/select.CV-KWLNP.css +1 -0
  75. package/build/client/_app/immutable/assets/select.CV-KWLNP.css.br +1 -0
  76. package/build/client/_app/immutable/assets/select.CV-KWLNP.css.gz +0 -0
  77. package/build/client/_app/immutable/assets/wash.BnjShmr3.mp3 +0 -0
  78. package/build/client/_app/immutable/assets/yap.SNl9LSqC.mp3 +0 -0
  79. package/build/client/_app/immutable/chunks/-FJ70HB3.js +1 -0
  80. package/build/client/_app/immutable/chunks/-FJ70HB3.js.br +0 -0
  81. package/build/client/_app/immutable/chunks/-FJ70HB3.js.gz +0 -0
  82. package/build/client/_app/immutable/chunks/9J99lH1E.js +4 -0
  83. package/build/client/_app/immutable/chunks/9J99lH1E.js.br +0 -0
  84. package/build/client/_app/immutable/chunks/9J99lH1E.js.gz +0 -0
  85. package/build/client/_app/immutable/chunks/B4AK16CS.js +1 -0
  86. package/build/client/_app/immutable/chunks/B4AK16CS.js.br +0 -0
  87. package/build/client/_app/immutable/chunks/B4AK16CS.js.gz +0 -0
  88. package/build/client/_app/immutable/chunks/B5IRm2KW.js +1 -0
  89. package/build/client/_app/immutable/chunks/B5IRm2KW.js.br +0 -0
  90. package/build/client/_app/immutable/chunks/B5IRm2KW.js.gz +0 -0
  91. package/build/client/_app/immutable/chunks/BAJE4yH_.js +9 -0
  92. package/build/client/_app/immutable/chunks/BAJE4yH_.js.br +0 -0
  93. package/build/client/_app/immutable/chunks/BAJE4yH_.js.gz +0 -0
  94. package/build/client/_app/immutable/chunks/BDCREBKE.js +1 -0
  95. package/build/client/_app/immutable/chunks/BDCREBKE.js.br +0 -0
  96. package/build/client/_app/immutable/chunks/BDCREBKE.js.gz +0 -0
  97. package/build/client/_app/immutable/chunks/BOf4cn4q.js +16 -0
  98. package/build/client/_app/immutable/chunks/BOf4cn4q.js.br +0 -0
  99. package/build/client/_app/immutable/chunks/BOf4cn4q.js.gz +0 -0
  100. package/build/client/_app/immutable/chunks/BOixjj3c.js +1 -0
  101. package/build/client/_app/immutable/chunks/BOixjj3c.js.br +1 -0
  102. package/build/client/_app/immutable/chunks/BOixjj3c.js.gz +0 -0
  103. package/build/client/_app/immutable/chunks/BQb4WE-8.js +1 -0
  104. package/build/client/_app/immutable/chunks/BQb4WE-8.js.br +0 -0
  105. package/build/client/_app/immutable/chunks/BQb4WE-8.js.gz +0 -0
  106. package/build/client/_app/immutable/chunks/BTeK4a_a.js +1 -0
  107. package/build/client/_app/immutable/chunks/BTeK4a_a.js.br +0 -0
  108. package/build/client/_app/immutable/chunks/BTeK4a_a.js.gz +0 -0
  109. package/build/client/_app/immutable/chunks/BYNjkfU_.js +1 -0
  110. package/build/client/_app/immutable/chunks/BYNjkfU_.js.br +0 -0
  111. package/build/client/_app/immutable/chunks/BYNjkfU_.js.gz +0 -0
  112. package/build/client/_app/immutable/chunks/BeDhKqx_.js +1 -0
  113. package/build/client/_app/immutable/chunks/BeDhKqx_.js.br +3 -0
  114. package/build/client/_app/immutable/chunks/BeDhKqx_.js.gz +0 -0
  115. package/build/client/_app/immutable/chunks/Bjy-W4x2.js +81 -0
  116. package/build/client/_app/immutable/chunks/Bjy-W4x2.js.br +0 -0
  117. package/build/client/_app/immutable/chunks/Bjy-W4x2.js.gz +0 -0
  118. package/build/client/_app/immutable/chunks/Bmf5cCYM.js +1 -0
  119. package/build/client/_app/immutable/chunks/Bmf5cCYM.js.br +0 -0
  120. package/build/client/_app/immutable/chunks/Bmf5cCYM.js.gz +0 -0
  121. package/build/client/_app/immutable/chunks/Bo7a0aly.js +1 -0
  122. package/build/client/_app/immutable/chunks/Bo7a0aly.js.br +0 -0
  123. package/build/client/_app/immutable/chunks/Bo7a0aly.js.gz +0 -0
  124. package/build/client/_app/immutable/chunks/BvAz--0N.js +1 -0
  125. package/build/client/_app/immutable/chunks/BvAz--0N.js.br +0 -0
  126. package/build/client/_app/immutable/chunks/BvAz--0N.js.gz +0 -0
  127. package/build/client/_app/immutable/chunks/C-5HEoLn.js +1 -0
  128. package/build/client/_app/immutable/chunks/C-5HEoLn.js.br +0 -0
  129. package/build/client/_app/immutable/chunks/C-5HEoLn.js.gz +0 -0
  130. package/build/client/_app/immutable/chunks/C7dZK71a.js +1 -0
  131. package/build/client/_app/immutable/chunks/C7dZK71a.js.br +0 -0
  132. package/build/client/_app/immutable/chunks/C7dZK71a.js.gz +0 -0
  133. package/build/client/_app/immutable/chunks/C98TgtTN.js +1 -0
  134. package/build/client/_app/immutable/chunks/C98TgtTN.js.br +0 -0
  135. package/build/client/_app/immutable/chunks/C98TgtTN.js.gz +0 -0
  136. package/build/client/_app/immutable/chunks/C9u9ikCJ.js +1 -0
  137. package/build/client/_app/immutable/chunks/C9u9ikCJ.js.br +0 -0
  138. package/build/client/_app/immutable/chunks/C9u9ikCJ.js.gz +0 -0
  139. package/build/client/_app/immutable/chunks/CBy5xNAu.js +1 -0
  140. package/build/client/_app/immutable/chunks/CBy5xNAu.js.br +0 -0
  141. package/build/client/_app/immutable/chunks/CBy5xNAu.js.gz +0 -0
  142. package/build/client/_app/immutable/chunks/CCDGpt2Z.js +1 -0
  143. package/build/client/_app/immutable/chunks/CCDGpt2Z.js.br +0 -0
  144. package/build/client/_app/immutable/chunks/CCDGpt2Z.js.gz +0 -0
  145. package/build/client/_app/immutable/chunks/CNU7dyxe.js +1 -0
  146. package/build/client/_app/immutable/chunks/CNU7dyxe.js.br +3 -0
  147. package/build/client/_app/immutable/chunks/CNU7dyxe.js.gz +0 -0
  148. package/build/client/_app/immutable/chunks/CNij7yXO.js +1 -0
  149. package/build/client/_app/immutable/chunks/CNij7yXO.js.br +0 -0
  150. package/build/client/_app/immutable/chunks/CNij7yXO.js.gz +0 -0
  151. package/build/client/_app/immutable/chunks/CPbGz0nD.js +1 -0
  152. package/build/client/_app/immutable/chunks/CPbGz0nD.js.br +0 -0
  153. package/build/client/_app/immutable/chunks/CPbGz0nD.js.gz +0 -0
  154. package/build/client/_app/immutable/chunks/Ce5rxuHE.js +1 -0
  155. package/build/client/_app/immutable/chunks/Ce5rxuHE.js.br +0 -0
  156. package/build/client/_app/immutable/chunks/Ce5rxuHE.js.gz +0 -0
  157. package/build/client/_app/immutable/chunks/CgJaNa38.js +1 -0
  158. package/build/client/_app/immutable/chunks/CgJaNa38.js.br +0 -0
  159. package/build/client/_app/immutable/chunks/CgJaNa38.js.gz +0 -0
  160. package/build/client/_app/immutable/chunks/CgoZLTv2.js +1 -0
  161. package/build/client/_app/immutable/chunks/CgoZLTv2.js.br +0 -0
  162. package/build/client/_app/immutable/chunks/CgoZLTv2.js.gz +0 -0
  163. package/build/client/_app/immutable/chunks/Ch-tX5Y1.js +1 -0
  164. package/build/client/_app/immutable/chunks/Ch-tX5Y1.js.br +0 -0
  165. package/build/client/_app/immutable/chunks/Ch-tX5Y1.js.gz +0 -0
  166. package/build/client/_app/immutable/chunks/CkALdgl6.js +1 -0
  167. package/build/client/_app/immutable/chunks/CkALdgl6.js.br +0 -0
  168. package/build/client/_app/immutable/chunks/CkALdgl6.js.gz +0 -0
  169. package/build/client/_app/immutable/chunks/Cn31HPZM.js +1 -0
  170. package/build/client/_app/immutable/chunks/Cn31HPZM.js.br +0 -0
  171. package/build/client/_app/immutable/chunks/Cn31HPZM.js.gz +0 -0
  172. package/build/client/_app/immutable/chunks/CoVud_S-.js +1 -0
  173. package/build/client/_app/immutable/chunks/CoVud_S-.js.br +0 -0
  174. package/build/client/_app/immutable/chunks/CoVud_S-.js.gz +0 -0
  175. package/build/client/_app/immutable/chunks/CraKVm2C.js +1 -0
  176. package/build/client/_app/immutable/chunks/CraKVm2C.js.br +0 -0
  177. package/build/client/_app/immutable/chunks/CraKVm2C.js.gz +0 -0
  178. package/build/client/_app/immutable/chunks/D2KG5w4u.js +1 -0
  179. package/build/client/_app/immutable/chunks/D2KG5w4u.js.br +0 -0
  180. package/build/client/_app/immutable/chunks/D2KG5w4u.js.gz +0 -0
  181. package/build/client/_app/immutable/chunks/DD7ObTOV.js +1 -0
  182. package/build/client/_app/immutable/chunks/DD7ObTOV.js.br +0 -0
  183. package/build/client/_app/immutable/chunks/DD7ObTOV.js.gz +0 -0
  184. package/build/client/_app/immutable/chunks/DD9f1wuL.js +1 -0
  185. package/build/client/_app/immutable/chunks/DD9f1wuL.js.br +0 -0
  186. package/build/client/_app/immutable/chunks/DD9f1wuL.js.gz +0 -0
  187. package/build/client/_app/immutable/chunks/DFMQ7Wtb.js +1 -0
  188. package/build/client/_app/immutable/chunks/DFMQ7Wtb.js.br +0 -0
  189. package/build/client/_app/immutable/chunks/DFMQ7Wtb.js.gz +0 -0
  190. package/build/client/_app/immutable/chunks/DFO_JKVL.js +1 -0
  191. package/build/client/_app/immutable/chunks/DFO_JKVL.js.br +0 -0
  192. package/build/client/_app/immutable/chunks/DFO_JKVL.js.gz +0 -0
  193. package/build/client/_app/immutable/chunks/DGyl1a-y.js +2 -0
  194. package/build/client/_app/immutable/chunks/DGyl1a-y.js.br +0 -0
  195. package/build/client/_app/immutable/chunks/DGyl1a-y.js.gz +0 -0
  196. package/build/client/_app/immutable/chunks/DM7BiLiI.js +1 -0
  197. package/build/client/_app/immutable/chunks/DM7BiLiI.js.br +0 -0
  198. package/build/client/_app/immutable/chunks/DM7BiLiI.js.gz +0 -0
  199. package/build/client/_app/immutable/chunks/DRu3YDxz.js +1 -0
  200. package/build/client/_app/immutable/chunks/DRu3YDxz.js.br +2 -0
  201. package/build/client/_app/immutable/chunks/DRu3YDxz.js.gz +0 -0
  202. package/build/client/_app/immutable/chunks/DTmdu5jU.js +1 -0
  203. package/build/client/_app/immutable/chunks/DTmdu5jU.js.br +0 -0
  204. package/build/client/_app/immutable/chunks/DTmdu5jU.js.gz +0 -0
  205. package/build/client/_app/immutable/chunks/DW6oei0W.js +1 -0
  206. package/build/client/_app/immutable/chunks/DW6oei0W.js.br +0 -0
  207. package/build/client/_app/immutable/chunks/DW6oei0W.js.gz +0 -0
  208. package/build/client/_app/immutable/chunks/DZ_NkRbw.js +1 -0
  209. package/build/client/_app/immutable/chunks/DZ_NkRbw.js.br +0 -0
  210. package/build/client/_app/immutable/chunks/DZ_NkRbw.js.gz +0 -0
  211. package/build/client/_app/immutable/chunks/DfNBP7nd.js +1 -0
  212. package/build/client/_app/immutable/chunks/DfNBP7nd.js.br +0 -0
  213. package/build/client/_app/immutable/chunks/DfNBP7nd.js.gz +0 -0
  214. package/build/client/_app/immutable/chunks/DkhXP75k.js +1 -0
  215. package/build/client/_app/immutable/chunks/DkhXP75k.js.br +0 -0
  216. package/build/client/_app/immutable/chunks/DkhXP75k.js.gz +0 -0
  217. package/build/client/_app/immutable/chunks/DpugZNaj.js +1 -0
  218. package/build/client/_app/immutable/chunks/DpugZNaj.js.br +0 -0
  219. package/build/client/_app/immutable/chunks/DpugZNaj.js.gz +0 -0
  220. package/build/client/_app/immutable/chunks/DuEN1GTI.js +5 -0
  221. package/build/client/_app/immutable/chunks/DuEN1GTI.js.br +0 -0
  222. package/build/client/_app/immutable/chunks/DuEN1GTI.js.gz +0 -0
  223. package/build/client/_app/immutable/chunks/DubTk1R0.js +1 -0
  224. package/build/client/_app/immutable/chunks/DubTk1R0.js.br +0 -0
  225. package/build/client/_app/immutable/chunks/DubTk1R0.js.gz +0 -0
  226. package/build/client/_app/immutable/chunks/Dyxd9rrM.js +5 -0
  227. package/build/client/_app/immutable/chunks/Dyxd9rrM.js.br +0 -0
  228. package/build/client/_app/immutable/chunks/Dyxd9rrM.js.gz +0 -0
  229. package/build/client/_app/immutable/chunks/F14uK0sn.js +1 -0
  230. package/build/client/_app/immutable/chunks/F14uK0sn.js.br +1 -0
  231. package/build/client/_app/immutable/chunks/F14uK0sn.js.gz +0 -0
  232. package/build/client/_app/immutable/chunks/GbStyEBD.js +1 -0
  233. package/build/client/_app/immutable/chunks/GbStyEBD.js.br +0 -0
  234. package/build/client/_app/immutable/chunks/GbStyEBD.js.gz +0 -0
  235. package/build/client/_app/immutable/chunks/IV6C0355.js +1 -0
  236. package/build/client/_app/immutable/chunks/IV6C0355.js.br +0 -0
  237. package/build/client/_app/immutable/chunks/IV6C0355.js.gz +0 -0
  238. package/build/client/_app/immutable/chunks/KSWUKh8r.js +1 -0
  239. package/build/client/_app/immutable/chunks/KSWUKh8r.js.br +0 -0
  240. package/build/client/_app/immutable/chunks/KSWUKh8r.js.gz +0 -0
  241. package/build/client/_app/immutable/chunks/Nhc5CiNi.js +1 -0
  242. package/build/client/_app/immutable/chunks/Nhc5CiNi.js.br +0 -0
  243. package/build/client/_app/immutable/chunks/Nhc5CiNi.js.gz +0 -0
  244. package/build/client/_app/immutable/chunks/OrbH09aZ.js +318 -0
  245. package/build/client/_app/immutable/chunks/OrbH09aZ.js.br +0 -0
  246. package/build/client/_app/immutable/chunks/OrbH09aZ.js.gz +0 -0
  247. package/build/client/_app/immutable/chunks/PnjGAuWf.js +1 -0
  248. package/build/client/_app/immutable/chunks/PnjGAuWf.js.br +0 -0
  249. package/build/client/_app/immutable/chunks/PnjGAuWf.js.gz +0 -0
  250. package/build/client/_app/immutable/chunks/ZoO6eRK-.js +1 -0
  251. package/build/client/_app/immutable/chunks/ZoO6eRK-.js.br +0 -0
  252. package/build/client/_app/immutable/chunks/ZoO6eRK-.js.gz +0 -0
  253. package/build/client/_app/immutable/chunks/eHlSYfzc.js +67 -0
  254. package/build/client/_app/immutable/chunks/eHlSYfzc.js.br +0 -0
  255. package/build/client/_app/immutable/chunks/eHlSYfzc.js.gz +0 -0
  256. package/build/client/_app/immutable/chunks/kUgLbqVN.js +1 -0
  257. package/build/client/_app/immutable/chunks/kUgLbqVN.js.br +0 -0
  258. package/build/client/_app/immutable/chunks/kUgLbqVN.js.gz +0 -0
  259. package/build/client/_app/immutable/chunks/kW5akbMY.js +1 -0
  260. package/build/client/_app/immutable/chunks/kW5akbMY.js.br +0 -0
  261. package/build/client/_app/immutable/chunks/kW5akbMY.js.gz +0 -0
  262. package/build/client/_app/immutable/chunks/lOC7RXgz.js +1 -0
  263. package/build/client/_app/immutable/chunks/lOC7RXgz.js.br +0 -0
  264. package/build/client/_app/immutable/chunks/lOC7RXgz.js.gz +0 -0
  265. package/build/client/_app/immutable/chunks/mxa1wXkp.js +3 -0
  266. package/build/client/_app/immutable/chunks/mxa1wXkp.js.br +0 -0
  267. package/build/client/_app/immutable/chunks/mxa1wXkp.js.gz +0 -0
  268. package/build/client/_app/immutable/chunks/q0g666o4.js +6 -0
  269. package/build/client/_app/immutable/chunks/q0g666o4.js.br +0 -0
  270. package/build/client/_app/immutable/chunks/q0g666o4.js.gz +0 -0
  271. package/build/client/_app/immutable/chunks/rTK8FScS.js +1 -0
  272. package/build/client/_app/immutable/chunks/rTK8FScS.js.br +0 -0
  273. package/build/client/_app/immutable/chunks/rTK8FScS.js.gz +0 -0
  274. package/build/client/_app/immutable/chunks/uBIymjUX.js +1 -0
  275. package/build/client/_app/immutable/chunks/uBIymjUX.js.br +0 -0
  276. package/build/client/_app/immutable/chunks/uBIymjUX.js.gz +0 -0
  277. package/build/client/_app/immutable/chunks/vt9Yl3tP.js +1 -0
  278. package/build/client/_app/immutable/chunks/vt9Yl3tP.js.br +0 -0
  279. package/build/client/_app/immutable/chunks/vt9Yl3tP.js.gz +0 -0
  280. package/build/client/_app/immutable/chunks/xihTtKlq.js +1 -0
  281. package/build/client/_app/immutable/chunks/xihTtKlq.js.br +1 -0
  282. package/build/client/_app/immutable/chunks/xihTtKlq.js.gz +0 -0
  283. package/build/client/_app/immutable/entry/app.BBB0nTuC.js +2 -0
  284. package/build/client/_app/immutable/entry/app.BBB0nTuC.js.br +0 -0
  285. package/build/client/_app/immutable/entry/app.BBB0nTuC.js.gz +0 -0
  286. package/build/client/_app/immutable/entry/start.CmBINDhZ.js +1 -0
  287. package/build/client/_app/immutable/entry/start.CmBINDhZ.js.br +1 -0
  288. package/build/client/_app/immutable/entry/start.CmBINDhZ.js.gz +0 -0
  289. package/build/client/_app/immutable/nodes/0.But357jM.js +1 -0
  290. package/build/client/_app/immutable/nodes/0.But357jM.js.br +0 -0
  291. package/build/client/_app/immutable/nodes/0.But357jM.js.gz +0 -0
  292. package/build/client/_app/immutable/nodes/1.DT8uBymP.js +1 -0
  293. package/build/client/_app/immutable/nodes/1.DT8uBymP.js.br +4 -0
  294. package/build/client/_app/immutable/nodes/1.DT8uBymP.js.gz +0 -0
  295. package/build/client/_app/immutable/nodes/10.BacbVQXe.js +1 -0
  296. package/build/client/_app/immutable/nodes/10.BacbVQXe.js.br +0 -0
  297. package/build/client/_app/immutable/nodes/10.BacbVQXe.js.gz +0 -0
  298. package/build/client/_app/immutable/nodes/11.CF-CErr7.js +2 -0
  299. package/build/client/_app/immutable/nodes/11.CF-CErr7.js.br +0 -0
  300. package/build/client/_app/immutable/nodes/11.CF-CErr7.js.gz +0 -0
  301. package/build/client/_app/immutable/nodes/12.CAPJJBGQ.js +1 -0
  302. package/build/client/_app/immutable/nodes/12.CAPJJBGQ.js.br +0 -0
  303. package/build/client/_app/immutable/nodes/12.CAPJJBGQ.js.gz +0 -0
  304. package/build/client/_app/immutable/nodes/13.DFyrYJal.js +1 -0
  305. package/build/client/_app/immutable/nodes/13.DFyrYJal.js.br +0 -0
  306. package/build/client/_app/immutable/nodes/13.DFyrYJal.js.gz +0 -0
  307. package/build/client/_app/immutable/nodes/14.D35Ot9wm.js +46 -0
  308. package/build/client/_app/immutable/nodes/14.D35Ot9wm.js.br +0 -0
  309. package/build/client/_app/immutable/nodes/14.D35Ot9wm.js.gz +0 -0
  310. package/build/client/_app/immutable/nodes/15.Cp0A6oCa.js +1 -0
  311. package/build/client/_app/immutable/nodes/15.Cp0A6oCa.js.br +0 -0
  312. package/build/client/_app/immutable/nodes/15.Cp0A6oCa.js.gz +0 -0
  313. package/build/client/_app/immutable/nodes/2.DFKUnwHk.js +1 -0
  314. package/build/client/_app/immutable/nodes/2.DFKUnwHk.js.br +0 -0
  315. package/build/client/_app/immutable/nodes/2.DFKUnwHk.js.gz +0 -0
  316. package/build/client/_app/immutable/nodes/3.DtSCxjUL.js +1 -0
  317. package/build/client/_app/immutable/nodes/3.DtSCxjUL.js.br +0 -0
  318. package/build/client/_app/immutable/nodes/3.DtSCxjUL.js.gz +0 -0
  319. package/build/client/_app/immutable/nodes/4.BY04Tg68.js +2 -0
  320. package/build/client/_app/immutable/nodes/4.BY04Tg68.js.br +0 -0
  321. package/build/client/_app/immutable/nodes/4.BY04Tg68.js.gz +0 -0
  322. package/build/client/_app/immutable/nodes/5.CXq_oj0Q.js +1 -0
  323. package/build/client/_app/immutable/nodes/5.CXq_oj0Q.js.br +0 -0
  324. package/build/client/_app/immutable/nodes/5.CXq_oj0Q.js.gz +0 -0
  325. package/build/client/_app/immutable/nodes/6.BVjg5uYT.js +1 -0
  326. package/build/client/_app/immutable/nodes/6.BVjg5uYT.js.br +0 -0
  327. package/build/client/_app/immutable/nodes/6.BVjg5uYT.js.gz +0 -0
  328. package/build/client/_app/immutable/nodes/7.BX0HQjn_.js +1 -0
  329. package/build/client/_app/immutable/nodes/7.BX0HQjn_.js.br +0 -0
  330. package/build/client/_app/immutable/nodes/7.BX0HQjn_.js.gz +0 -0
  331. package/build/client/_app/immutable/nodes/8.De0kNeyT.js +4 -0
  332. package/build/client/_app/immutable/nodes/8.De0kNeyT.js.br +0 -0
  333. package/build/client/_app/immutable/nodes/8.De0kNeyT.js.gz +0 -0
  334. package/build/client/_app/immutable/nodes/9.CjcFLNkE.js +1 -0
  335. package/build/client/_app/immutable/nodes/9.CjcFLNkE.js.br +0 -0
  336. package/build/client/_app/immutable/nodes/9.CjcFLNkE.js.gz +0 -0
  337. package/build/client/_app/version.json +1 -0
  338. package/build/client/_app/version.json.br +0 -0
  339. package/build/client/_app/version.json.gz +0 -0
  340. package/build/client/apple-touch-icon.png +0 -0
  341. package/build/client/favicon.ico +0 -0
  342. package/build/client/robots.txt +3 -0
  343. package/build/client/robots.txt.br +0 -0
  344. package/build/client/robots.txt.gz +0 -0
  345. package/build/env.js +70 -0
  346. package/build/handler.js +26 -0
  347. package/build/index.js +149 -0
  348. package/build/server/chunks/chunks/AssistantAvatar.js-CR1xF68O.js +294 -0
  349. package/build/server/chunks/chunks/AvatarPicker.js-DZPhpy7w.js +136 -0
  350. package/build/server/chunks/chunks/Composer.js-mKR_nJD9.js +332 -0
  351. package/build/server/chunks/chunks/ComposerDock.js-CCH7a93l.js +58 -0
  352. package/build/server/chunks/chunks/CopyButton.js-BztgBjPI.js +81 -0
  353. package/build/server/chunks/chunks/DotGrid.js-CftrAYTh.js +107 -0
  354. package/build/server/chunks/chunks/LucideIcon.js-B_cwdnXZ.js +19 -0
  355. package/build/server/chunks/chunks/MemoryChangeItem.js-BBDjCjIq.js +2557 -0
  356. package/build/server/chunks/chunks/ModelMenu.js-DHccPOZS.js +510 -0
  357. package/build/server/chunks/chunks/MoveToFolderMenu.js-DI6yuRr_.js +288 -0
  358. package/build/server/chunks/chunks/NewChatForm.js-BesIRgmI.js +296 -0
  359. package/build/server/chunks/chunks/NewFolderDialog.js-BTTYnEvA.js +192 -0
  360. package/build/server/chunks/chunks/Notifications.js-BUIjQEFf.js +762 -0
  361. package/build/server/chunks/chunks/PageHeader.js-CBhoVn_r.js +59 -0
  362. package/build/server/chunks/chunks/RenameFolderDialog.js-DRXA1rE1.js +258 -0
  363. package/build/server/chunks/chunks/Rich.js-DEvHcohw.js +31 -0
  364. package/build/server/chunks/chunks/StepIcon.js-DbIHgd-j.js +38 -0
  365. package/build/server/chunks/chunks/TopBar.js-DL3V5e8_.js +34 -0
  366. package/build/server/chunks/chunks/TypedText.js-CBSV0Eww.js +62 -0
  367. package/build/server/chunks/chunks/UserAvatar.js-zDozVLYj.js +17 -0
  368. package/build/server/chunks/chunks/UserMenu.js-CD42Fp5q.js +960 -0
  369. package/build/server/chunks/chunks/access.js-0oJZgR4f.js +40 -0
  370. package/build/server/chunks/chunks/after-sleep.js-BBvqb2L4.js +10 -0
  371. package/build/server/chunks/chunks/alert-dialog.js-DFswoRFb.js +505 -0
  372. package/build/server/chunks/chunks/articles.js-DmiBPIor.js +16 -0
  373. package/build/server/chunks/chunks/auth.js-avakWenI.js +20044 -0
  374. package/build/server/chunks/chunks/avatars.js-CZXD-JBu.js +496 -0
  375. package/build/server/chunks/chunks/badge.js-CBKfxi1n.js +38 -0
  376. package/build/server/chunks/chunks/check.js-DlXI7kOF.js +15 -0
  377. package/build/server/chunks/chunks/chevron-right.js-D2YPHtEd.js +15 -0
  378. package/build/server/chunks/chunks/chevrons-up-down.js-kIInlPpp.js +15 -0
  379. package/build/server/chunks/chunks/client.js-DXLagFo3.js +120 -0
  380. package/build/server/chunks/chunks/clock.js-DLKiHbA7.js +19 -0
  381. package/build/server/chunks/chunks/collapsible.js-TEhMCaES.js +410 -0
  382. package/build/server/chunks/chunks/command.js-DYF1chyA.js +2231 -0
  383. package/build/server/chunks/chunks/core.js-fgH-0YTF.js +6 -0
  384. package/build/server/chunks/chunks/dialog.js-CSahHfdK.js +544 -0
  385. package/build/server/chunks/chunks/dist.js-Dgve-3EB.js +600 -0
  386. package/build/server/chunks/chunks/dist2.js-DzuN_1ds.js +347 -0
  387. package/build/server/chunks/chunks/dropdown-menu.js-CnOm2iRl.js +2396 -0
  388. package/build/server/chunks/chunks/env.js-l0sNRNKZ.js +2 -0
  389. package/build/server/chunks/chunks/eraser.js-CwqAwzLd.js +15 -0
  390. package/build/server/chunks/chunks/exports.js-DPPmkIPk.js +236 -0
  391. package/build/server/chunks/chunks/factory.js-B2lDZWU5.js +2344 -0
  392. package/build/server/chunks/chunks/files.js-BTCcxPsy.js +33 -0
  393. package/build/server/chunks/chunks/folder-input.js-bTjsbAVr.js +19 -0
  394. package/build/server/chunks/chunks/format.js-D-G-GNZJ.js +57 -0
  395. package/build/server/chunks/chunks/forms.js-TIFaBiDZ.js +4052 -0
  396. package/build/server/chunks/chunks/hidden-input.js-3jXOp67_.js +47 -0
  397. package/build/server/chunks/chunks/http.js-B-SIUg23.js +19 -0
  398. package/build/server/chunks/chunks/i18n.js-gmnYop5e.js +5049 -0
  399. package/build/server/chunks/chunks/icons.js-DqrSaQen.js +32087 -0
  400. package/build/server/chunks/chunks/index-server.js-BgjjN9Dl.js +146 -0
  401. package/build/server/chunks/chunks/internal.js-CPnM6pod.js +28 -0
  402. package/build/server/chunks/chunks/internal2.js-BJdu5v6t.js +1135 -0
  403. package/build/server/chunks/chunks/key-round.js-ALDn8H2Z.js +20 -0
  404. package/build/server/chunks/chunks/last-profile.js-CGCyMPCt.js +6 -0
  405. package/build/server/chunks/chunks/media-refs.js-CTbNjDi5.js +129 -0
  406. package/build/server/chunks/chunks/memory-categories.js-BMxcWbJ1.js +141 -0
  407. package/build/server/chunks/chunks/memory-export.js-B-0sQxo9.js +126 -0
  408. package/build/server/chunks/chunks/memory.js-BmjM2yTP.js +25 -0
  409. package/build/server/chunks/chunks/message-circle.js-Boy7xak8.js +15 -0
  410. package/build/server/chunks/chunks/motion.js-e6Xy0FvI.js +224 -0
  411. package/build/server/chunks/chunks/node.js-B1BYsTq2.js +9 -0
  412. package/build/server/chunks/chunks/node2.js-BoQ3pSBK.js +7 -0
  413. package/build/server/chunks/chunks/node3.js-DUajZgS1.js +2420 -0
  414. package/build/server/chunks/chunks/openai.js-usndTuuG.js +20473 -0
  415. package/build/server/chunks/chunks/paths.js-Dv5_wc5b.js +19 -0
  416. package/build/server/chunks/chunks/pencil.js-BBTMEZ3O.js +15 -0
  417. package/build/server/chunks/chunks/plus.js-BEkOQr9Q.js +15 -0
  418. package/build/server/chunks/chunks/preferences.svelte.js-CzoLtrIH.js +93 -0
  419. package/build/server/chunks/chunks/remote.js-DRgAwsBW.js +3 -0
  420. package/build/server/chunks/chunks/rolldown-runtime.js-n5G0F_TW.js +37 -0
  421. package/build/server/chunks/chunks/routing.js-CQ7vk27s.js +265 -0
  422. package/build/server/chunks/chunks/schedule.js-22hng-Kw.js +296 -0
  423. package/build/server/chunks/chunks/sdk.js-CRLWYx_O.js +42918 -0
  424. package/build/server/chunks/chunks/sdk2.js-Dp6IbCdi.js +13701 -0
  425. package/build/server/chunks/chunks/sdk3.js-DEwIpbCP.js +4 -0
  426. package/build/server/chunks/chunks/select.js-DGOA1VL9.js +1965 -0
  427. package/build/server/chunks/chunks/server.js-XxNf6kVC.js +3907 -0
  428. package/build/server/chunks/chunks/shared.js-1FwmeXhQ.js +789 -0
  429. package/build/server/chunks/chunks/sidebar.js-B-PyxBE9.js +1498 -0
  430. package/build/server/chunks/chunks/square-pen.js-B7nqpNVl.js +20 -0
  431. package/build/server/chunks/chunks/src.js-Cb-pJk2c.js +25288 -0
  432. package/build/server/chunks/chunks/state.js-CrwNc-tR.js +67 -0
  433. package/build/server/chunks/chunks/suggestions.js-DxdV1W1D.js +15 -0
  434. package/build/server/chunks/chunks/switch.js-CDuy0MzW.js +283 -0
  435. package/build/server/chunks/chunks/terminal.js-BEi5NMPR.js +15 -0
  436. package/build/server/chunks/chunks/textarea.js-DnOcXQXd.js +25 -0
  437. package/build/server/chunks/chunks/tint.js-D75gRPbz.js +165 -0
  438. package/build/server/chunks/chunks/tooltip.js-0flEKjnb.js +5863 -0
  439. package/build/server/chunks/chunks/uneval.js-C7SIrMEV.js +536 -0
  440. package/build/server/chunks/chunks/usage.js-BzKKyzUN.js +27 -0
  441. package/build/server/chunks/chunks/utils.js-rQQrRQUR.js +1020 -0
  442. package/build/server/chunks/chunks/utils2.js-BgS8NcJx.js +1167 -0
  443. package/build/server/chunks/chunks/zod.js-DkbjBCP6.js +18824 -0
  444. package/build/server/chunks/chunks/zod2.js-FNRC10wS.js +4 -0
  445. package/build/server/chunks/entries/endpoints/api/c/_id_/continue/_server.ts.js-DPkjAoli.js +45 -0
  446. package/build/server/chunks/entries/endpoints/api/c/_id_/effort/_server.ts.js-B8su8yn5.js +46 -0
  447. package/build/server/chunks/entries/endpoints/api/c/_id_/events/_server.ts.js-CLDxKKTx.js +73 -0
  448. package/build/server/chunks/entries/endpoints/api/c/_id_/folder/_server.ts.js-DT3NoKYe.js +54 -0
  449. package/build/server/chunks/entries/endpoints/api/c/_id_/media/_mediaId_/_server.ts.js-bvxQlwcS.js +52 -0
  450. package/build/server/chunks/entries/endpoints/api/c/_id_/messages/_server.ts.js-ClMX8O_R.js +57 -0
  451. package/build/server/chunks/entries/endpoints/api/c/_id_/preset/_server.ts.js-DQ8N5-g_.js +50 -0
  452. package/build/server/chunks/entries/endpoints/api/c/_id_/stop/_server.ts.js-4v8WbwCB.js +43 -0
  453. package/build/server/chunks/entries/endpoints/api/events/_server.ts.js-lUrCowKV.js +78 -0
  454. package/build/server/chunks/entries/endpoints/api/hooks/_token_/_server.ts.js-CoqUCiud.js +49 -0
  455. package/build/server/chunks/entries/endpoints/api/icons/_name_/_server.ts.js-k_TzYggq.js +18 -0
  456. package/build/server/chunks/entries/endpoints/api/models/_server.ts.js-BnE6M4aY.js +56 -0
  457. package/build/server/chunks/entries/endpoints/api/notifications/_id_/continue/_server.ts.js-7cVqAe1A.js +50 -0
  458. package/build/server/chunks/entries/endpoints/api/notifications/_id_/dismiss/_server.ts.js-nebszEA8.js +42 -0
  459. package/build/server/chunks/entries/endpoints/api/notifications/clear/_server.ts.js-8UNQWqlv.js +43 -0
  460. package/build/server/chunks/entries/endpoints/api/notifications/seen/_server.ts.js-BigNQ41d.js +43 -0
  461. package/build/server/chunks/entries/endpoints/api/p/_slug_/folders/_folder_/files/_file_/_server.ts.js-CVZofPL8.js +56 -0
  462. package/build/server/chunks/entries/endpoints/api/p/_slug_/folders/_server.ts.js--huBNcxm.js +57 -0
  463. package/build/server/chunks/entries/endpoints/api/p/_slug_/memory/_id_/undo/_server.ts.js-DILraLKg.js +57 -0
  464. package/build/server/chunks/entries/endpoints/api/p/_slug_/running/_server.ts.js-DysLWyt1.js +79 -0
  465. package/build/server/chunks/entries/endpoints/api/p/_slug_/suggestions/_server.ts.js-B8HQNn05.js +53 -0
  466. package/build/server/chunks/entries/endpoints/api/p/_slug_/templates/_id_/cover/_server.ts.js-DCJqd-KE.js +59 -0
  467. package/build/server/chunks/entries/endpoints/api/p/_slug_/uploads/_id_/_server.ts.js-DJh0dkU7.js +44 -0
  468. package/build/server/chunks/entries/endpoints/api/p/_slug_/uploads/_server.ts.js-CQi0je7g.js +72 -0
  469. package/build/server/chunks/entries/endpoints/logout/_server.ts.js-iwUOTHUJ.js +46 -0
  470. package/build/server/chunks/entries/fallbacks/error.svelte.js-BjT9T-qE.js +22 -0
  471. package/build/server/chunks/entries/hooks.server.js-CA451orY.js +1956 -0
  472. package/build/server/chunks/entries/pages/_layout.server.ts.js-DeA1Se1v.js +34 -0
  473. package/build/server/chunks/entries/pages/_layout.svelte.js-Cc0HS5vE.js +77 -0
  474. package/build/server/chunks/entries/pages/_page.server.ts.js-BP9VmKmv.js +20 -0
  475. package/build/server/chunks/entries/pages/_page.svelte.js-BP2EdQl3.js +5 -0
  476. package/build/server/chunks/entries/pages/admin/_page.server.ts.js-BGy54zg7.js +310 -0
  477. package/build/server/chunks/entries/pages/admin/_page.svelte.js-DC0lzbwL.js +2092 -0
  478. package/build/server/chunks/entries/pages/login/_page.server.ts.js-to8Vy4NV.js +42 -0
  479. package/build/server/chunks/entries/pages/login/_page.svelte.js-CRFRcLqG.js +74 -0
  480. package/build/server/chunks/entries/pages/p/_slug_/_layout.server.ts.js-BATtKhxU.js +50 -0
  481. package/build/server/chunks/entries/pages/p/_slug_/_layout.svelte.js-B4A4RVlj.js +1897 -0
  482. package/build/server/chunks/entries/pages/p/_slug_/_page.server.ts.js-CwhG-rBA.js +71 -0
  483. package/build/server/chunks/entries/pages/p/_slug_/_page.svelte.js-v85HZSJv.js +132 -0
  484. package/build/server/chunks/entries/pages/p/_slug_/automations/_page.server.ts.js-BYjEh_94.js +269 -0
  485. package/build/server/chunks/entries/pages/p/_slug_/automations/_page.svelte.js-C9MxplNZ.js +423 -0
  486. package/build/server/chunks/entries/pages/p/_slug_/c/_id_/_page.server.ts.js-DqYn7Ov8.js +68 -0
  487. package/build/server/chunks/entries/pages/p/_slug_/c/_id_/_page.svelte.js-DO1qyELK.js +2072 -0
  488. package/build/server/chunks/entries/pages/p/_slug_/f/_folder_/_page.server.ts.js-DK68gPIS.js +101 -0
  489. package/build/server/chunks/entries/pages/p/_slug_/f/_folder_/_page.svelte.js-a31Wj0H5.js +321 -0
  490. package/build/server/chunks/entries/pages/p/_slug_/images/_page.server.ts.js-DYwxYJjv.js +145 -0
  491. package/build/server/chunks/entries/pages/p/_slug_/images/_page.svelte.js-H3zU7YA6.js +526 -0
  492. package/build/server/chunks/entries/pages/p/_slug_/memory/_page.server.ts.js-C6jVrFqG.js +99 -0
  493. package/build/server/chunks/entries/pages/p/_slug_/memory/_page.svelte.js-D54hFXGF.js +902 -0
  494. package/build/server/chunks/entries/pages/p/_slug_/settings/_page.server.ts.js-BvhbrusJ.js +106 -0
  495. package/build/server/chunks/entries/pages/p/_slug_/settings/_page.svelte.js-K9Rx0fue.js +581 -0
  496. package/build/server/chunks/entries/pages/p/_slug_/skills/_page.server.ts.js-X_toxkHr.js +45 -0
  497. package/build/server/chunks/entries/pages/p/_slug_/skills/_page.svelte.js-9BpNF-xF.js +132 -0
  498. package/build/server/chunks/entries/pages/p/_slug_/welcome/_page.server.ts.js-1d4vkOo-.js +129 -0
  499. package/build/server/chunks/entries/pages/p/_slug_/welcome/_page@.svelte.js-32N16gxF.js +223 -0
  500. package/build/server/chunks/entries/pages/profiles/_page.server.ts.js-CYu6Uj8H.js +32 -0
  501. package/build/server/chunks/entries/pages/profiles/_page.svelte.js-Bhw4E_wV.js +89 -0
  502. package/build/server/chunks/handler-CsXFmZYe.js +1735 -0
  503. package/build/server/chunks/index.js-kWlRiTFB.js +3700 -0
  504. package/build/server/chunks/manifest.js-BU_jyr1-.js +314 -0
  505. package/build/server/chunks/nodes/0.js-D4qm-LVJ.js +42 -0
  506. package/build/server/chunks/nodes/1.js-Fjtm11_Q.js +9 -0
  507. package/build/server/chunks/nodes/10.js-C0jWz6L_.js +45 -0
  508. package/build/server/chunks/nodes/11.js-CvxSawBf.js +45 -0
  509. package/build/server/chunks/nodes/12.js-CFwkqqPw.js +45 -0
  510. package/build/server/chunks/nodes/13.js-8e3_MY_4.js +45 -0
  511. package/build/server/chunks/nodes/14.js-dFhmLvor.js +45 -0
  512. package/build/server/chunks/nodes/15.js-alFwV-ia.js +45 -0
  513. package/build/server/chunks/nodes/2.js-DlqVofm5.js +46 -0
  514. package/build/server/chunks/nodes/3.js-B11kFzfi.js +45 -0
  515. package/build/server/chunks/nodes/4.js-CJOa-BdF.js +46 -0
  516. package/build/server/chunks/nodes/5.js-BiasAa82.js +50 -0
  517. package/build/server/chunks/nodes/6.js-vEMr5YOn.js +47 -0
  518. package/build/server/chunks/nodes/7.js-BwwcgtyP.js +45 -0
  519. package/build/server/chunks/nodes/8.js-Mqkjlq-6.js +45 -0
  520. package/build/server/chunks/nodes/9.js-DtRpQ_En.js +45 -0
  521. package/build/shims.js +33 -0
  522. package/dist/chunks/chunk-45BRG6A7.js +85 -0
  523. package/dist/chunks/chunk-CL6JQXXZ.js +38 -0
  524. package/dist/chunks/chunk-KZL3QNDA.js +14397 -0
  525. package/dist/chunks/chunk-N4H4AYCQ.js +20 -0
  526. package/dist/chunks/chunk-W4U7L4LF.js +47 -0
  527. package/dist/chunks/io-DMGTB3B7.js +12 -0
  528. package/dist/chunks/node-4RSVEEU6.js +2233 -0
  529. package/dist/chunks/node-BBTNNFRQ.js +20 -0
  530. package/dist/chunks/openai-LNQCFHTY.js +21690 -0
  531. package/dist/chunks/run-6LM42GJD.js +22287 -0
  532. package/dist/chunks/sdk-UNMKBESV.js +53 -0
  533. package/dist/chunks/sdk-Z2WD4F5K.js +30854 -0
  534. package/dist/chunks/zod-H7KMPIPH.js +19934 -0
  535. package/dist/cli.js +130 -0
  536. package/package.json +102 -0
  537. package/packages/core/drizzle/0000_init.sql +123 -0
  538. package/packages/core/drizzle/0001_triggers.sql +82 -0
  539. package/packages/core/drizzle/0002_default_preset.sql +1 -0
  540. package/packages/core/drizzle/0003_trigger_summary.sql +2 -0
  541. package/packages/core/drizzle/0004_skill_toggles.sql +1 -0
  542. package/packages/core/drizzle/0005_media.sql +21 -0
  543. package/packages/core/drizzle/0006_attachments.sql +25 -0
  544. package/packages/core/drizzle/0007_folders.sql +35 -0
  545. package/packages/core/drizzle/0008_avatars.sql +26 -0
  546. package/packages/core/drizzle/0009_subagents.sql +28 -0
  547. package/packages/core/drizzle/0010_soul.sql +1 -0
  548. package/packages/core/drizzle/0011_claude_plan.sql +1 -0
  549. package/packages/core/drizzle/0012_model_switch.sql +4 -0
  550. package/packages/core/drizzle/0013_nolune_format.sql +1 -0
  551. package/packages/core/drizzle/0014_nolune_rename.sql +3 -0
  552. package/packages/core/drizzle/0015_learn_from_chats.sql +2 -0
  553. package/packages/core/drizzle/0016_memory_changes.sql +19 -0
  554. package/packages/core/drizzle/0017_member_person_note.sql +1 -0
  555. package/packages/core/drizzle/meta/0000_snapshot.json +809 -0
  556. package/packages/core/drizzle/meta/0001_snapshot.json +1354 -0
  557. package/packages/core/drizzle/meta/0002_snapshot.json +1362 -0
  558. package/packages/core/drizzle/meta/0003_snapshot.json +1376 -0
  559. package/packages/core/drizzle/meta/0004_snapshot.json +1384 -0
  560. package/packages/core/drizzle/meta/0005_snapshot.json +1523 -0
  561. package/packages/core/drizzle/meta/0006_snapshot.json +1679 -0
  562. package/packages/core/drizzle/meta/0007_snapshot.json +1921 -0
  563. package/packages/core/drizzle/meta/0008_snapshot.json +1929 -0
  564. package/packages/core/drizzle/meta/0009_snapshot.json +2109 -0
  565. package/packages/core/drizzle/meta/0010_snapshot.json +2117 -0
  566. package/packages/core/drizzle/meta/0011_snapshot.json +2124 -0
  567. package/packages/core/drizzle/meta/0012_snapshot.json +2138 -0
  568. package/packages/core/drizzle/meta/0013_snapshot.json +2145 -0
  569. package/packages/core/drizzle/meta/0014_snapshot.json +2145 -0
  570. package/packages/core/drizzle/meta/0015_snapshot.json +2160 -0
  571. package/packages/core/drizzle/meta/0016_snapshot.json +2286 -0
  572. package/packages/core/drizzle/meta/0017_snapshot.json +2293 -0
  573. package/packages/core/drizzle/meta/_journal.json +132 -0
  574. package/packages/core/image-templates/app-icon/TEMPLATE.md +37 -0
  575. package/packages/core/image-templates/app-icon/cover.webp +0 -0
  576. package/packages/core/image-templates/coloring-page/TEMPLATE.md +14 -0
  577. package/packages/core/image-templates/coloring-page/cover.webp +0 -0
  578. package/packages/core/image-templates/concept-art/TEMPLATE.md +46 -0
  579. package/packages/core/image-templates/concept-art/cover.webp +0 -0
  580. package/packages/core/image-templates/couple-portrait/TEMPLATE.md +35 -0
  581. package/packages/core/image-templates/couple-portrait/cover.webp +0 -0
  582. package/packages/core/image-templates/dream-bouquet/TEMPLATE.md +36 -0
  583. package/packages/core/image-templates/dream-bouquet/cover.webp +0 -0
  584. package/packages/core/image-templates/family-crest/TEMPLATE.md +38 -0
  585. package/packages/core/image-templates/family-crest/cover.webp +0 -0
  586. package/packages/core/image-templates/nail-art/TEMPLATE.md +32 -0
  587. package/packages/core/image-templates/nail-art/cover.webp +0 -0
  588. package/packages/core/image-templates/outfit-board/TEMPLATE.md +46 -0
  589. package/packages/core/image-templates/outfit-board/cover.webp +0 -0
  590. package/packages/core/image-templates/party-invitation/TEMPLATE.md +49 -0
  591. package/packages/core/image-templates/party-invitation/cover.webp +0 -0
  592. package/packages/core/image-templates/photo-booth/TEMPLATE.md +33 -0
  593. package/packages/core/image-templates/photo-booth/cover.webp +0 -0
  594. package/packages/core/image-templates/scribble/TEMPLATE.md +29 -0
  595. package/packages/core/image-templates/scribble/cover.webp +0 -0
  596. package/packages/core/image-templates/sprite-sheet/TEMPLATE.md +45 -0
  597. package/packages/core/image-templates/sprite-sheet/cover.webp +0 -0
  598. package/packages/core/image-templates/sticker-pack/TEMPLATE.md +37 -0
  599. package/packages/core/image-templates/sticker-pack/cover.webp +0 -0
  600. package/packages/core/image-templates/storybook-page/TEMPLATE.md +34 -0
  601. package/packages/core/image-templates/storybook-page/cover.webp +0 -0
  602. package/packages/core/image-templates/tattoo/TEMPLATE.md +44 -0
  603. package/packages/core/image-templates/tattoo/cover.webp +0 -0
  604. package/packages/core/image-templates/tileable-texture/TEMPLATE.md +34 -0
  605. package/packages/core/image-templates/tileable-texture/cover.webp +0 -0
  606. package/packages/core/image-templates/tiny-world/TEMPLATE.md +15 -0
  607. package/packages/core/image-templates/tiny-world/cover.webp +0 -0
  608. package/packages/core/image-templates/trip-postcard/TEMPLATE.md +21 -0
  609. package/packages/core/image-templates/trip-postcard/cover.webp +0 -0
  610. package/packages/core/image-templates/wanted-poster/TEMPLATE.md +27 -0
  611. package/packages/core/image-templates/wanted-poster/cover.webp +0 -0
  612. package/packages/core/skills/automations/SKILL.md +91 -0
  613. package/packages/core/skills/generate-images/SKILL.md +115 -0
  614. package/packages/core/skills/nolune/SKILL.md +281 -0
  615. package/packages/core/skills/subagents/SKILL.md +91 -0
  616. package/packages/core/skills/view-images/SKILL.md +88 -0
@@ -0,0 +1,2557 @@
1
+ import { al as attr, ap as escape_html, at as attr_class, am as clsx, _ as derived, ao as html$2 } from './server.js-XxNf6kVC.js';
2
+ import { F } from './media-refs.js-CTbNjDi5.js';
3
+ import { g as getI18n } from './i18n.js-gmnYop5e.js';
4
+ import './client.js-DXLagFo3.js';
5
+ import { c as cn } from './utils2.js-BgS8NcJx.js';
6
+ import { B as Button } from './forms.js-TIFaBiDZ.js';
7
+ import { P as Plus } from './plus.js-BEkOQr9Q.js';
8
+ import { P as Pencil } from './pencil.js-BBTMEZ3O.js';
9
+ import { e as errorMessage } from './http.js-B-SIUg23.js';
10
+ import { m as memoryTitle } from './memory.js-BmjM2yTP.js';
11
+ import { I as ImageOff, C as Copy, F as File, D as Download, a as Image, b as FileX } from './icons.js-DqrSaQen.js';
12
+
13
+ /*! @license DOMPurify 3.4.16 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.16/LICENSE */
14
+ function _arrayLikeToArray(r, a) {
15
+ (null == a || a > r.length) && (a = r.length);
16
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
17
+ return n;
18
+ }
19
+ function _arrayWithHoles(r) {
20
+ if (Array.isArray(r)) return r;
21
+ }
22
+ function _iterableToArrayLimit(r, l) {
23
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
24
+ if (null != t) {
25
+ var e, n, i, u, a = [], f = true, o = false;
26
+ try {
27
+ if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
28
+ } catch (r) {
29
+ o = true, n = r;
30
+ } finally {
31
+ try {
32
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
33
+ } finally {
34
+ if (o) throw n;
35
+ }
36
+ }
37
+ return a;
38
+ }
39
+ }
40
+ function _nonIterableRest() {
41
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
42
+ }
43
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
44
+ function _slicedToArray(r, e) {
45
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
46
+ }
47
+ function _unsupportedIterableToArray(r, a) {
48
+ if (r) {
49
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
50
+ var t = {}.toString.call(r).slice(8, -1);
51
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
52
+ }
53
+ }
54
+ const entries = Object.entries;
55
+ const setPrototypeOf = Object.setPrototypeOf;
56
+ const isFrozen = Object.isFrozen;
57
+ const getPrototypeOf = Object.getPrototypeOf;
58
+ const getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
59
+ let freeze = Object.freeze;
60
+ let seal = Object.seal;
61
+ let create = Object.create;
62
+ let _ref = typeof Reflect !== "undefined" && Reflect;
63
+ let apply = _ref.apply;
64
+ let construct = _ref.construct;
65
+ if (!freeze) freeze = function freeze(x) {
66
+ return x;
67
+ };
68
+ if (!seal) seal = function seal(x) {
69
+ return x;
70
+ };
71
+ if (!apply) apply = function apply(func, thisArg) {
72
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) args[_key - 2] = arguments[_key];
73
+ return func.apply(thisArg, args);
74
+ };
75
+ if (!construct) construct = function construct(Func) {
76
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) args[_key2 - 1] = arguments[_key2];
77
+ return new Func(...args);
78
+ };
79
+ const arrayForEach = unapply(Array.prototype.forEach);
80
+ const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
81
+ const arrayPop = unapply(Array.prototype.pop);
82
+ const arrayPush = unapply(Array.prototype.push);
83
+ const arraySplice = unapply(Array.prototype.splice);
84
+ const arrayIsArray = Array.isArray;
85
+ const stringToLowerCase = unapply(String.prototype.toLowerCase);
86
+ const stringToString = unapply(String.prototype.toString);
87
+ const stringMatch = unapply(String.prototype.match);
88
+ const stringReplace = unapply(String.prototype.replace);
89
+ const stringIndexOf = unapply(String.prototype.indexOf);
90
+ const stringTrim = unapply(String.prototype.trim);
91
+ const numberToString = unapply(Number.prototype.toString);
92
+ const booleanToString = unapply(Boolean.prototype.toString);
93
+ const bigintToString = typeof BigInt === "undefined" ? null : unapply(BigInt.prototype.toString);
94
+ const symbolToString = typeof Symbol === "undefined" ? null : unapply(Symbol.prototype.toString);
95
+ const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
96
+ const objectToString = unapply(Object.prototype.toString);
97
+ const regExpTest = unapply(RegExp.prototype.test);
98
+ const typeErrorCreate = unconstruct(TypeError);
99
+ /**
100
+ * Creates a new function that calls the given function with a specified thisArg and arguments.
101
+ *
102
+ * @param func - The function to be wrapped and called.
103
+ * @returns A new function that calls the given function with a specified thisArg and arguments.
104
+ */
105
+ function unapply(func) {
106
+ return function(thisArg) {
107
+ if (thisArg instanceof RegExp) thisArg.lastIndex = 0;
108
+ for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) args[_key3 - 1] = arguments[_key3];
109
+ return apply(func, thisArg, args);
110
+ };
111
+ }
112
+ /**
113
+ * Creates a new function that constructs an instance of the given constructor function with the provided arguments.
114
+ *
115
+ * @param func - The constructor function to be wrapped and called.
116
+ * @returns A new function that constructs an instance of the given constructor function with the provided arguments.
117
+ */
118
+ function unconstruct(Func) {
119
+ return function() {
120
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) args[_key4] = arguments[_key4];
121
+ return construct(Func, args);
122
+ };
123
+ }
124
+ /**
125
+ * Add properties to a lookup table
126
+ *
127
+ * @param set - The set to which elements will be added.
128
+ * @param array - The array containing elements to be added to the set.
129
+ * @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.
130
+ * @returns The modified set with added elements.
131
+ */
132
+ function addToSet(set, array) {
133
+ let transformCaseFunc = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : stringToLowerCase;
134
+ if (setPrototypeOf) setPrototypeOf(set, null);
135
+ if (!arrayIsArray(array)) return set;
136
+ let l = array.length;
137
+ while (l--) {
138
+ let element = array[l];
139
+ if (typeof element === "string") {
140
+ const lcElement = transformCaseFunc(element);
141
+ if (lcElement !== element) {
142
+ if (!isFrozen(array)) array[l] = lcElement;
143
+ element = lcElement;
144
+ }
145
+ }
146
+ set[element] = true;
147
+ }
148
+ return set;
149
+ }
150
+ /**
151
+ * Clean up an array to harden against CSPP
152
+ *
153
+ * @param array - The array to be cleaned.
154
+ * @returns The cleaned version of the array
155
+ */
156
+ function cleanArray(array) {
157
+ for (let index = 0; index < array.length; index++) if (!objectHasOwnProperty(array, index)) array[index] = null;
158
+ return array;
159
+ }
160
+ /**
161
+ * Shallow clone an object
162
+ *
163
+ * @param object - The object to be cloned.
164
+ * @returns A new object that copies the original.
165
+ */
166
+ function clone(object) {
167
+ const newObject = create(null);
168
+ for (const _ref2 of entries(object)) {
169
+ var _ref3 = _slicedToArray(_ref2, 2);
170
+ const property = _ref3[0];
171
+ const value = _ref3[1];
172
+ if (objectHasOwnProperty(object, property)) {
173
+ if (arrayIsArray(value)) newObject[property] = cleanArray(value);
174
+ else if (value && typeof value === "object" && value.constructor === Object) newObject[property] = clone(value);
175
+ else newObject[property] = value;
176
+ }
177
+ }
178
+ return newObject;
179
+ }
180
+ /**
181
+ * Convert non-node values into strings without depending on direct property access.
182
+ *
183
+ * @param value - The value to stringify.
184
+ * @returns A string representation of the provided value.
185
+ */
186
+ function stringifyValue(value) {
187
+ switch (typeof value) {
188
+ case "string": return value;
189
+ case "number": return numberToString(value);
190
+ case "boolean": return booleanToString(value);
191
+ case "bigint": return bigintToString ? bigintToString(value) : "0";
192
+ case "symbol": return symbolToString ? symbolToString(value) : "Symbol()";
193
+ case "undefined": return objectToString(value);
194
+ case "function":
195
+ case "object": {
196
+ if (value === null) return objectToString(value);
197
+ const valueAsRecord = value;
198
+ const valueToString = lookupGetter(valueAsRecord, "toString");
199
+ if (typeof valueToString === "function") {
200
+ const stringified = valueToString(valueAsRecord);
201
+ return typeof stringified === "string" ? stringified : objectToString(stringified);
202
+ }
203
+ return objectToString(value);
204
+ }
205
+ default: return objectToString(value);
206
+ }
207
+ }
208
+ /**
209
+ * This method automatically checks if the prop is function or getter and behaves accordingly.
210
+ *
211
+ * @param object - The object to look up the getter function in its prototype chain.
212
+ * @param prop - The property name for which to find the getter function.
213
+ * @returns The getter function found in the prototype chain or a fallback function.
214
+ */
215
+ function lookupGetter(object, prop) {
216
+ while (object !== null) {
217
+ const desc = getOwnPropertyDescriptor(object, prop);
218
+ if (desc) {
219
+ if (desc.get) return unapply(desc.get);
220
+ if (typeof desc.value === "function") return unapply(desc.value);
221
+ }
222
+ object = getPrototypeOf(object);
223
+ }
224
+ function fallbackValue() {
225
+ return null;
226
+ }
227
+ return fallbackValue;
228
+ }
229
+ function isRegex(value) {
230
+ try {
231
+ regExpTest(value, "");
232
+ return true;
233
+ } catch (_unused) {
234
+ return false;
235
+ }
236
+ }
237
+ const html$1 = freeze([
238
+ "a",
239
+ "abbr",
240
+ "acronym",
241
+ "address",
242
+ "area",
243
+ "article",
244
+ "aside",
245
+ "audio",
246
+ "b",
247
+ "bdi",
248
+ "bdo",
249
+ "big",
250
+ "blink",
251
+ "blockquote",
252
+ "body",
253
+ "br",
254
+ "button",
255
+ "canvas",
256
+ "caption",
257
+ "center",
258
+ "cite",
259
+ "code",
260
+ "col",
261
+ "colgroup",
262
+ "content",
263
+ "data",
264
+ "datalist",
265
+ "dd",
266
+ "decorator",
267
+ "del",
268
+ "details",
269
+ "dfn",
270
+ "dialog",
271
+ "dir",
272
+ "div",
273
+ "dl",
274
+ "dt",
275
+ "element",
276
+ "em",
277
+ "fieldset",
278
+ "figcaption",
279
+ "figure",
280
+ "font",
281
+ "footer",
282
+ "form",
283
+ "h1",
284
+ "h2",
285
+ "h3",
286
+ "h4",
287
+ "h5",
288
+ "h6",
289
+ "head",
290
+ "header",
291
+ "hgroup",
292
+ "hr",
293
+ "html",
294
+ "i",
295
+ "img",
296
+ "input",
297
+ "ins",
298
+ "kbd",
299
+ "label",
300
+ "legend",
301
+ "li",
302
+ "main",
303
+ "map",
304
+ "mark",
305
+ "marquee",
306
+ "menu",
307
+ "menuitem",
308
+ "meter",
309
+ "nav",
310
+ "nobr",
311
+ "ol",
312
+ "optgroup",
313
+ "option",
314
+ "output",
315
+ "p",
316
+ "picture",
317
+ "pre",
318
+ "progress",
319
+ "q",
320
+ "rp",
321
+ "rt",
322
+ "ruby",
323
+ "s",
324
+ "samp",
325
+ "search",
326
+ "section",
327
+ "select",
328
+ "shadow",
329
+ "slot",
330
+ "small",
331
+ "source",
332
+ "spacer",
333
+ "span",
334
+ "strike",
335
+ "strong",
336
+ "style",
337
+ "sub",
338
+ "summary",
339
+ "sup",
340
+ "table",
341
+ "tbody",
342
+ "td",
343
+ "template",
344
+ "textarea",
345
+ "tfoot",
346
+ "th",
347
+ "thead",
348
+ "time",
349
+ "tr",
350
+ "track",
351
+ "tt",
352
+ "u",
353
+ "ul",
354
+ "var",
355
+ "video",
356
+ "wbr"
357
+ ]);
358
+ const svg$1 = freeze([
359
+ "svg",
360
+ "a",
361
+ "altglyph",
362
+ "altglyphdef",
363
+ "altglyphitem",
364
+ "animatecolor",
365
+ "animatemotion",
366
+ "animatetransform",
367
+ "circle",
368
+ "clippath",
369
+ "defs",
370
+ "desc",
371
+ "ellipse",
372
+ "enterkeyhint",
373
+ "exportparts",
374
+ "filter",
375
+ "font",
376
+ "g",
377
+ "glyph",
378
+ "glyphref",
379
+ "hkern",
380
+ "image",
381
+ "inputmode",
382
+ "line",
383
+ "lineargradient",
384
+ "marker",
385
+ "mask",
386
+ "metadata",
387
+ "mpath",
388
+ "part",
389
+ "path",
390
+ "pattern",
391
+ "polygon",
392
+ "polyline",
393
+ "radialgradient",
394
+ "rect",
395
+ "stop",
396
+ "style",
397
+ "switch",
398
+ "symbol",
399
+ "text",
400
+ "textpath",
401
+ "title",
402
+ "tref",
403
+ "tspan",
404
+ "view",
405
+ "vkern"
406
+ ]);
407
+ const svgFilters = freeze([
408
+ "feBlend",
409
+ "feColorMatrix",
410
+ "feComponentTransfer",
411
+ "feComposite",
412
+ "feConvolveMatrix",
413
+ "feDiffuseLighting",
414
+ "feDisplacementMap",
415
+ "feDistantLight",
416
+ "feDropShadow",
417
+ "feFlood",
418
+ "feFuncA",
419
+ "feFuncB",
420
+ "feFuncG",
421
+ "feFuncR",
422
+ "feGaussianBlur",
423
+ "feImage",
424
+ "feMerge",
425
+ "feMergeNode",
426
+ "feMorphology",
427
+ "feOffset",
428
+ "fePointLight",
429
+ "feSpecularLighting",
430
+ "feSpotLight",
431
+ "feTile",
432
+ "feTurbulence"
433
+ ]);
434
+ const svgDisallowed = freeze([
435
+ "animate",
436
+ "color-profile",
437
+ "cursor",
438
+ "discard",
439
+ "font-face",
440
+ "font-face-format",
441
+ "font-face-name",
442
+ "font-face-src",
443
+ "font-face-uri",
444
+ "foreignobject",
445
+ "hatch",
446
+ "hatchpath",
447
+ "mesh",
448
+ "meshgradient",
449
+ "meshpatch",
450
+ "meshrow",
451
+ "missing-glyph",
452
+ "script",
453
+ "set",
454
+ "solidcolor",
455
+ "unknown",
456
+ "use"
457
+ ]);
458
+ const mathMl$1 = freeze([
459
+ "math",
460
+ "menclose",
461
+ "merror",
462
+ "mfenced",
463
+ "mfrac",
464
+ "mglyph",
465
+ "mi",
466
+ "mlabeledtr",
467
+ "mmultiscripts",
468
+ "mn",
469
+ "mo",
470
+ "mover",
471
+ "mpadded",
472
+ "mphantom",
473
+ "mroot",
474
+ "mrow",
475
+ "ms",
476
+ "mspace",
477
+ "msqrt",
478
+ "mstyle",
479
+ "msub",
480
+ "msup",
481
+ "msubsup",
482
+ "mtable",
483
+ "mtd",
484
+ "mtext",
485
+ "mtr",
486
+ "munder",
487
+ "munderover",
488
+ "mprescripts"
489
+ ]);
490
+ const mathMlDisallowed = freeze([
491
+ "maction",
492
+ "maligngroup",
493
+ "malignmark",
494
+ "mlongdiv",
495
+ "mscarries",
496
+ "mscarry",
497
+ "msgroup",
498
+ "mstack",
499
+ "msline",
500
+ "msrow",
501
+ "semantics",
502
+ "annotation",
503
+ "annotation-xml",
504
+ "mprescripts",
505
+ "none"
506
+ ]);
507
+ const text = freeze(["#text"]);
508
+ const html = freeze([
509
+ "accept",
510
+ "action",
511
+ "align",
512
+ "alt",
513
+ "autocapitalize",
514
+ "autocomplete",
515
+ "autopictureinpicture",
516
+ "autoplay",
517
+ "background",
518
+ "bgcolor",
519
+ "border",
520
+ "capture",
521
+ "cellpadding",
522
+ "cellspacing",
523
+ "checked",
524
+ "cite",
525
+ "class",
526
+ "clear",
527
+ "color",
528
+ "cols",
529
+ "colspan",
530
+ "command",
531
+ "commandfor",
532
+ "controls",
533
+ "controlslist",
534
+ "coords",
535
+ "crossorigin",
536
+ "datetime",
537
+ "decoding",
538
+ "default",
539
+ "dir",
540
+ "disabled",
541
+ "disablepictureinpicture",
542
+ "disableremoteplayback",
543
+ "download",
544
+ "draggable",
545
+ "enctype",
546
+ "enterkeyhint",
547
+ "exportparts",
548
+ "face",
549
+ "for",
550
+ "headers",
551
+ "height",
552
+ "hidden",
553
+ "high",
554
+ "href",
555
+ "hreflang",
556
+ "id",
557
+ "inert",
558
+ "inputmode",
559
+ "integrity",
560
+ "ismap",
561
+ "kind",
562
+ "label",
563
+ "lang",
564
+ "list",
565
+ "loading",
566
+ "loop",
567
+ "low",
568
+ "max",
569
+ "maxlength",
570
+ "media",
571
+ "method",
572
+ "min",
573
+ "minlength",
574
+ "multiple",
575
+ "muted",
576
+ "name",
577
+ "nonce",
578
+ "noshade",
579
+ "novalidate",
580
+ "nowrap",
581
+ "open",
582
+ "optimum",
583
+ "part",
584
+ "pattern",
585
+ "placeholder",
586
+ "playsinline",
587
+ "popover",
588
+ "popovertarget",
589
+ "popovertargetaction",
590
+ "poster",
591
+ "preload",
592
+ "pubdate",
593
+ "radiogroup",
594
+ "readonly",
595
+ "rel",
596
+ "required",
597
+ "rev",
598
+ "reversed",
599
+ "role",
600
+ "rows",
601
+ "rowspan",
602
+ "spellcheck",
603
+ "scope",
604
+ "selected",
605
+ "shape",
606
+ "size",
607
+ "sizes",
608
+ "slot",
609
+ "span",
610
+ "srclang",
611
+ "start",
612
+ "src",
613
+ "srcset",
614
+ "step",
615
+ "style",
616
+ "summary",
617
+ "tabindex",
618
+ "title",
619
+ "translate",
620
+ "type",
621
+ "usemap",
622
+ "valign",
623
+ "value",
624
+ "width",
625
+ "wrap",
626
+ "xmlns"
627
+ ]);
628
+ const svg = freeze([
629
+ "accent-height",
630
+ "accumulate",
631
+ "additive",
632
+ "alignment-baseline",
633
+ "amplitude",
634
+ "ascent",
635
+ "attributename",
636
+ "attributetype",
637
+ "azimuth",
638
+ "basefrequency",
639
+ "baseline-shift",
640
+ "begin",
641
+ "bias",
642
+ "by",
643
+ "class",
644
+ "clip",
645
+ "clippathunits",
646
+ "clip-path",
647
+ "clip-rule",
648
+ "color",
649
+ "color-interpolation",
650
+ "color-interpolation-filters",
651
+ "color-profile",
652
+ "color-rendering",
653
+ "cx",
654
+ "cy",
655
+ "d",
656
+ "dx",
657
+ "dy",
658
+ "diffuseconstant",
659
+ "direction",
660
+ "display",
661
+ "divisor",
662
+ "dominant-baseline",
663
+ "dur",
664
+ "edgemode",
665
+ "elevation",
666
+ "end",
667
+ "exponent",
668
+ "fill",
669
+ "fill-opacity",
670
+ "fill-rule",
671
+ "filter",
672
+ "filterunits",
673
+ "flood-color",
674
+ "flood-opacity",
675
+ "font-family",
676
+ "font-size",
677
+ "font-size-adjust",
678
+ "font-stretch",
679
+ "font-style",
680
+ "font-variant",
681
+ "font-weight",
682
+ "fx",
683
+ "fy",
684
+ "g1",
685
+ "g2",
686
+ "glyph-name",
687
+ "glyphref",
688
+ "gradientunits",
689
+ "gradienttransform",
690
+ "height",
691
+ "href",
692
+ "id",
693
+ "image-rendering",
694
+ "in",
695
+ "in2",
696
+ "intercept",
697
+ "k",
698
+ "k1",
699
+ "k2",
700
+ "k3",
701
+ "k4",
702
+ "kerning",
703
+ "keypoints",
704
+ "keysplines",
705
+ "keytimes",
706
+ "lang",
707
+ "lengthadjust",
708
+ "letter-spacing",
709
+ "kernelmatrix",
710
+ "kernelunitlength",
711
+ "lighting-color",
712
+ "local",
713
+ "marker-end",
714
+ "marker-mid",
715
+ "marker-start",
716
+ "markerheight",
717
+ "markerunits",
718
+ "markerwidth",
719
+ "maskcontentunits",
720
+ "maskunits",
721
+ "max",
722
+ "mask",
723
+ "mask-type",
724
+ "media",
725
+ "method",
726
+ "mode",
727
+ "min",
728
+ "name",
729
+ "numoctaves",
730
+ "offset",
731
+ "operator",
732
+ "opacity",
733
+ "order",
734
+ "orient",
735
+ "orientation",
736
+ "origin",
737
+ "overflow",
738
+ "paint-order",
739
+ "path",
740
+ "pathlength",
741
+ "patterncontentunits",
742
+ "patterntransform",
743
+ "patternunits",
744
+ "pointer-events",
745
+ "points",
746
+ "preservealpha",
747
+ "preserveaspectratio",
748
+ "primitiveunits",
749
+ "r",
750
+ "rx",
751
+ "ry",
752
+ "radius",
753
+ "refx",
754
+ "refy",
755
+ "repeatcount",
756
+ "repeatdur",
757
+ "restart",
758
+ "result",
759
+ "rotate",
760
+ "scale",
761
+ "seed",
762
+ "shape-rendering",
763
+ "slope",
764
+ "specularconstant",
765
+ "specularexponent",
766
+ "spreadmethod",
767
+ "startoffset",
768
+ "stddeviation",
769
+ "stitchtiles",
770
+ "stop-color",
771
+ "stop-opacity",
772
+ "stroke-dasharray",
773
+ "stroke-dashoffset",
774
+ "stroke-linecap",
775
+ "stroke-linejoin",
776
+ "stroke-miterlimit",
777
+ "stroke-opacity",
778
+ "stroke",
779
+ "stroke-width",
780
+ "style",
781
+ "surfacescale",
782
+ "systemlanguage",
783
+ "tabindex",
784
+ "tablevalues",
785
+ "targetx",
786
+ "targety",
787
+ "transform",
788
+ "transform-origin",
789
+ "text-anchor",
790
+ "text-decoration",
791
+ "text-orientation",
792
+ "text-rendering",
793
+ "textlength",
794
+ "type",
795
+ "u1",
796
+ "u2",
797
+ "unicode",
798
+ "values",
799
+ "vector-effect",
800
+ "viewbox",
801
+ "visibility",
802
+ "version",
803
+ "vert-adv-y",
804
+ "vert-origin-x",
805
+ "vert-origin-y",
806
+ "width",
807
+ "word-spacing",
808
+ "wrap",
809
+ "writing-mode",
810
+ "xchannelselector",
811
+ "ychannelselector",
812
+ "x",
813
+ "x1",
814
+ "x2",
815
+ "xmlns",
816
+ "y",
817
+ "y1",
818
+ "y2",
819
+ "z",
820
+ "zoomandpan"
821
+ ]);
822
+ const mathMl = freeze([
823
+ "accent",
824
+ "accentunder",
825
+ "align",
826
+ "bevelled",
827
+ "close",
828
+ "columnalign",
829
+ "columnlines",
830
+ "columnspacing",
831
+ "columnspan",
832
+ "denomalign",
833
+ "depth",
834
+ "dir",
835
+ "display",
836
+ "displaystyle",
837
+ "encoding",
838
+ "fence",
839
+ "frame",
840
+ "height",
841
+ "href",
842
+ "id",
843
+ "largeop",
844
+ "length",
845
+ "linethickness",
846
+ "lquote",
847
+ "lspace",
848
+ "mathbackground",
849
+ "mathcolor",
850
+ "mathsize",
851
+ "mathvariant",
852
+ "maxsize",
853
+ "minsize",
854
+ "movablelimits",
855
+ "notation",
856
+ "numalign",
857
+ "open",
858
+ "rowalign",
859
+ "rowlines",
860
+ "rowspacing",
861
+ "rowspan",
862
+ "rspace",
863
+ "rquote",
864
+ "scriptlevel",
865
+ "scriptminsize",
866
+ "scriptsizemultiplier",
867
+ "selection",
868
+ "separator",
869
+ "separators",
870
+ "stretchy",
871
+ "subscriptshift",
872
+ "supscriptshift",
873
+ "symmetric",
874
+ "voffset",
875
+ "width",
876
+ "xmlns"
877
+ ]);
878
+ const xml = freeze([
879
+ "xlink:href",
880
+ "xml:id",
881
+ "xlink:title",
882
+ "xml:space",
883
+ "xmlns:xlink"
884
+ ]);
885
+ const MUSTACHE_EXPR = seal(/{{[\w\W]*|^[\w\W]*}}/g);
886
+ const ERB_EXPR = seal(/<%[\w\W]*|^[\w\W]*%>/g);
887
+ const TMPLIT_EXPR = seal(/\${[\w\W]*/g);
888
+ const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/);
889
+ const ARIA_ATTR = seal(/^aria-[\-\w]+$/);
890
+ const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i);
891
+ const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
892
+ const ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g);
893
+ const DOCTYPE_NAME = seal(/^html$/i);
894
+ const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
895
+ const ELEMENT_MARKUP_PROBE = seal(/<[/\w!]/g);
896
+ const COMMENT_MARKUP_PROBE = seal(/<[/\w]/g);
897
+ const FALLBACK_TAG_CLOSE = seal(/<\/no(script|embed|frames)/i);
898
+ const SELF_CLOSING_TAG = seal(/\/>/i);
899
+ const NODE_TYPE = {
900
+ element: 1,
901
+ attribute: 2,
902
+ text: 3,
903
+ cdataSection: 4,
904
+ entityReference: 5,
905
+ entityNode: 6,
906
+ processingInstruction: 7,
907
+ comment: 8,
908
+ document: 9,
909
+ documentType: 10,
910
+ documentFragment: 11,
911
+ notation: 12
912
+ };
913
+ const LITERAL_TEXT_ELEMENT_NAMES = [
914
+ "style",
915
+ "script",
916
+ "xmp",
917
+ "iframe",
918
+ "noembed",
919
+ "noframes",
920
+ "plaintext",
921
+ "noscript"
922
+ ];
923
+ const LITERAL_TEXT_ELEMENTS = freeze(addToSet({}, LITERAL_TEXT_ELEMENT_NAMES));
924
+ const LITERAL_TEXT_CLOSE = function() {
925
+ const map = {};
926
+ arrayForEach(LITERAL_TEXT_ELEMENT_NAMES, (name) => {
927
+ map[name] = seal(new RegExp("</" + name + "(?=[\\t\\n\\f\\r />])", "i"));
928
+ });
929
+ return freeze(map);
930
+ }();
931
+ const getGlobal = function getGlobal() {
932
+ return typeof window === "undefined" ? null : window;
933
+ };
934
+ /**
935
+ * Creates a no-op policy for internal use only.
936
+ * Don't export this function outside this module!
937
+ * @param trustedTypes The policy factory.
938
+ * @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).
939
+ * @return The policy created (or null, if Trusted Types
940
+ * are not supported or creating the policy failed).
941
+ */
942
+ const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {
943
+ if (typeof trustedTypes !== "object" || typeof trustedTypes.createPolicy !== "function") return null;
944
+ let suffix = null;
945
+ const ATTR_NAME = "data-tt-policy-suffix";
946
+ if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) suffix = purifyHostElement.getAttribute(ATTR_NAME);
947
+ const policyName = "dompurify" + (suffix ? "#" + suffix : "");
948
+ try {
949
+ return trustedTypes.createPolicy(policyName, {
950
+ createHTML(html) {
951
+ return html;
952
+ },
953
+ createScriptURL(scriptUrl) {
954
+ return scriptUrl;
955
+ }
956
+ });
957
+ } catch (_) {
958
+ console.warn("TrustedTypes policy " + policyName + " could not be created.");
959
+ return null;
960
+ }
961
+ };
962
+ const _createHooksMap = function _createHooksMap() {
963
+ return {
964
+ afterSanitizeAttributes: [],
965
+ afterSanitizeElements: [],
966
+ afterSanitizeShadowDOM: [],
967
+ beforeSanitizeAttributes: [],
968
+ beforeSanitizeElements: [],
969
+ beforeSanitizeShadowDOM: [],
970
+ uponSanitizeAttribute: [],
971
+ uponSanitizeElement: [],
972
+ uponSanitizeShadowNode: []
973
+ };
974
+ };
975
+ /**
976
+ * Resolve a set-valued configuration option: a fresh set built from
977
+ * cfg[key] when it is an own array property (seeded with a clone of
978
+ * options.base when given, case-normalized via options.transform),
979
+ * the fallback set otherwise.
980
+ *
981
+ * @param cfg the cloned, prototype-free configuration object
982
+ * @param key the configuration property to read
983
+ * @param fallback the set to use when the option is absent or not an array
984
+ * @param options transform and optional base set to merge into
985
+ * @returns the resolved set
986
+ */
987
+ const _resolveSetOption = function _resolveSetOption(cfg, key, fallback, options) {
988
+ return objectHasOwnProperty(cfg, key) && arrayIsArray(cfg[key]) ? addToSet(options.base ? clone(options.base) : {}, cfg[key], options.transform) : fallback;
989
+ };
990
+ /**
991
+ * Resolve an object-valued configuration option: a prototype-free clone
992
+ * of cfg[key] when it is an own, truthy object property, else a fresh
993
+ * fallback built by makeFallback (fresh on every parse, so a previous
994
+ * parse can never leak state into the next one).
995
+ *
996
+ * @param cfg the cloned, prototype-free configuration object
997
+ * @param key the configuration property to read
998
+ * @param makeFallback builds the fallback value when the option is absent
999
+ * @returns the resolved object
1000
+ */
1001
+ const _resolveObjectOption = function _resolveObjectOption(cfg, key, makeFallback) {
1002
+ const value = objectHasOwnProperty(cfg, key) ? cfg[key] : void 0;
1003
+ return value && typeof value === "object" ? clone(value) : makeFallback();
1004
+ };
1005
+ function createDOMPurify() {
1006
+ let window = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
1007
+ const DOMPurify = (root) => createDOMPurify(root);
1008
+ DOMPurify.version = "3.4.16";
1009
+ DOMPurify.removed = [];
1010
+ if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
1011
+ DOMPurify.isSupported = false;
1012
+ return DOMPurify;
1013
+ }
1014
+ let document = window.document;
1015
+ const originalDocument = document;
1016
+ const currentScript = originalDocument.currentScript;
1017
+ window.DocumentFragment;
1018
+ const HTMLTemplateElement = window.HTMLTemplateElement, Node = window.Node, Element = window.Element, NodeFilter = window.NodeFilter;
1019
+ window.NamedNodeMap === void 0 && (window.NamedNodeMap || window.MozNamedAttrMap);
1020
+ window.HTMLFormElement;
1021
+ const DOMParser = window.DOMParser, trustedTypes = window.trustedTypes;
1022
+ const ElementPrototype = Element.prototype;
1023
+ const cloneNode = lookupGetter(ElementPrototype, "cloneNode");
1024
+ const remove = lookupGetter(ElementPrototype, "remove");
1025
+ const removeAttributeNode = lookupGetter(ElementPrototype, "removeAttributeNode");
1026
+ const getNextSibling = lookupGetter(ElementPrototype, "nextSibling");
1027
+ const getChildNodes = lookupGetter(ElementPrototype, "childNodes");
1028
+ const getParentNode = lookupGetter(ElementPrototype, "parentNode");
1029
+ const getShadowRoot = lookupGetter(ElementPrototype, "shadowRoot");
1030
+ const getAttributes = lookupGetter(ElementPrototype, "attributes");
1031
+ const getNodeType = Node && Node.prototype ? lookupGetter(Node.prototype, "nodeType") : null;
1032
+ const getNodeName = Node && Node.prototype ? lookupGetter(Node.prototype, "nodeName") : null;
1033
+ const getOwnerDocument = Node && Node.prototype ? lookupGetter(Node.prototype, "ownerDocument") : null;
1034
+ const _readNodeType = function _readNodeType(node) {
1035
+ return getNodeType ? getNodeType(node) : node.nodeType;
1036
+ };
1037
+ const _readNodeName = function _readNodeName(node) {
1038
+ return getNodeName ? getNodeName(node) : node.nodeName;
1039
+ };
1040
+ if (typeof HTMLTemplateElement === "function") {
1041
+ const template = document.createElement("template");
1042
+ if (template.content && template.content.ownerDocument) document = template.content.ownerDocument;
1043
+ }
1044
+ let trustedTypesPolicy;
1045
+ let emptyHTML = "";
1046
+ let defaultTrustedTypesPolicy;
1047
+ let defaultTrustedTypesPolicyResolved = false;
1048
+ let IN_TRUSTED_TYPES_POLICY = 0;
1049
+ const _assertNotInTrustedTypesPolicy = function _assertNotInTrustedTypesPolicy() {
1050
+ if (IN_TRUSTED_TYPES_POLICY > 0) throw typeErrorCreate("A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the \"DOMPurify and Trusted Types\" section of the README.");
1051
+ };
1052
+ const _createTrustedHTML = function _createTrustedHTML(html) {
1053
+ _assertNotInTrustedTypesPolicy();
1054
+ IN_TRUSTED_TYPES_POLICY++;
1055
+ try {
1056
+ return trustedTypesPolicy.createHTML(html);
1057
+ } finally {
1058
+ IN_TRUSTED_TYPES_POLICY--;
1059
+ }
1060
+ };
1061
+ const _createTrustedScriptURL = function _createTrustedScriptURL(scriptUrl) {
1062
+ _assertNotInTrustedTypesPolicy();
1063
+ IN_TRUSTED_TYPES_POLICY++;
1064
+ try {
1065
+ return trustedTypesPolicy.createScriptURL(scriptUrl);
1066
+ } finally {
1067
+ IN_TRUSTED_TYPES_POLICY--;
1068
+ }
1069
+ };
1070
+ const _getDefaultTrustedTypesPolicy = function _getDefaultTrustedTypesPolicy() {
1071
+ if (!defaultTrustedTypesPolicyResolved) {
1072
+ defaultTrustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
1073
+ defaultTrustedTypesPolicyResolved = true;
1074
+ }
1075
+ return defaultTrustedTypesPolicy;
1076
+ };
1077
+ const _document = document, implementation = _document.implementation, createNodeIterator = _document.createNodeIterator, createDocumentFragment = _document.createDocumentFragment, getElementsByTagName = _document.getElementsByTagName;
1078
+ const importNode = originalDocument.importNode;
1079
+ let hooks = _createHooksMap();
1080
+ /**
1081
+ * Expose whether this browser supports running the full DOMPurify.
1082
+ */
1083
+ DOMPurify.isSupported = typeof entries === "function" && typeof getParentNode === "function" && implementation && implementation.createHTMLDocument !== void 0;
1084
+ const MUSTACHE_EXPR$1 = MUSTACHE_EXPR, ERB_EXPR$1 = ERB_EXPR, TMPLIT_EXPR$1 = TMPLIT_EXPR, DATA_ATTR$1 = DATA_ATTR, ARIA_ATTR$1 = ARIA_ATTR, IS_SCRIPT_OR_DATA$1 = IS_SCRIPT_OR_DATA, ATTR_WHITESPACE$1 = ATTR_WHITESPACE, CUSTOM_ELEMENT$1 = CUSTOM_ELEMENT;
1085
+ let IS_ALLOWED_URI$1 = IS_ALLOWED_URI;
1086
+ /**
1087
+ * We consider the elements and attributes below to be safe. Ideally
1088
+ * don't add any new ones but feel free to remove unwanted ones.
1089
+ */
1090
+ let ALLOWED_TAGS = null;
1091
+ const DEFAULT_ALLOWED_TAGS = addToSet({}, [
1092
+ ...html$1,
1093
+ ...svg$1,
1094
+ ...svgFilters,
1095
+ ...mathMl$1,
1096
+ ...text
1097
+ ]);
1098
+ let ALLOWED_ATTR = null;
1099
+ const DEFAULT_ALLOWED_ATTR = addToSet({}, [
1100
+ ...html,
1101
+ ...svg,
1102
+ ...mathMl,
1103
+ ...xml
1104
+ ]);
1105
+ let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {
1106
+ tagNameCheck: {
1107
+ writable: true,
1108
+ configurable: false,
1109
+ enumerable: true,
1110
+ value: null
1111
+ },
1112
+ attributeNameCheck: {
1113
+ writable: true,
1114
+ configurable: false,
1115
+ enumerable: true,
1116
+ value: null
1117
+ },
1118
+ allowCustomizedBuiltInElements: {
1119
+ writable: true,
1120
+ configurable: false,
1121
+ enumerable: true,
1122
+ value: false
1123
+ }
1124
+ }));
1125
+ let FORBID_TAGS = null;
1126
+ let FORBID_ATTR = null;
1127
+ const EXTRA_ELEMENT_HANDLING = Object.seal(create(null, {
1128
+ tagCheck: {
1129
+ writable: true,
1130
+ configurable: false,
1131
+ enumerable: true,
1132
+ value: null
1133
+ },
1134
+ attributeCheck: {
1135
+ writable: true,
1136
+ configurable: false,
1137
+ enumerable: true,
1138
+ value: null
1139
+ }
1140
+ }));
1141
+ let ALLOW_ARIA_ATTR = true;
1142
+ let ALLOW_DATA_ATTR = true;
1143
+ let ALLOW_UNKNOWN_PROTOCOLS = false;
1144
+ let ALLOW_SELF_CLOSE_IN_ATTR = true;
1145
+ let SAFE_FOR_TEMPLATES = false;
1146
+ let SAFE_FOR_XML = true;
1147
+ let WHOLE_DOCUMENT = false;
1148
+ let SET_CONFIG = false;
1149
+ let SET_CONFIG_ALLOWED_TAGS = null;
1150
+ let SET_CONFIG_ALLOWED_ATTR = null;
1151
+ let FORCE_BODY = false;
1152
+ let RETURN_DOM = false;
1153
+ let RETURN_DOM_FRAGMENT = false;
1154
+ let RETURN_TRUSTED_TYPE = false;
1155
+ let SANITIZE_DOM = true;
1156
+ let SANITIZE_NAMED_PROPS = false;
1157
+ const SANITIZE_NAMED_PROPS_PREFIX = "user-content-";
1158
+ let KEEP_CONTENT = true;
1159
+ let IN_PLACE = false;
1160
+ let USE_PROFILES = {};
1161
+ let FORBID_CONTENTS = null;
1162
+ const DEFAULT_FORBID_CONTENTS = addToSet({}, [
1163
+ "annotation-xml",
1164
+ "audio",
1165
+ "colgroup",
1166
+ "desc",
1167
+ "foreignobject",
1168
+ "head",
1169
+ "iframe",
1170
+ "math",
1171
+ "mi",
1172
+ "mn",
1173
+ "mo",
1174
+ "ms",
1175
+ "mtext",
1176
+ "noembed",
1177
+ "noframes",
1178
+ "noscript",
1179
+ "plaintext",
1180
+ "script",
1181
+ "selectedcontent",
1182
+ "style",
1183
+ "svg",
1184
+ "template",
1185
+ "thead",
1186
+ "title",
1187
+ "video",
1188
+ "xmp"
1189
+ ]);
1190
+ let DATA_URI_TAGS = null;
1191
+ const DEFAULT_DATA_URI_TAGS = addToSet({}, [
1192
+ "audio",
1193
+ "video",
1194
+ "img",
1195
+ "source",
1196
+ "image",
1197
+ "track"
1198
+ ]);
1199
+ let URI_SAFE_ATTRIBUTES = null;
1200
+ const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, [
1201
+ "alt",
1202
+ "class",
1203
+ "for",
1204
+ "id",
1205
+ "label",
1206
+ "name",
1207
+ "pattern",
1208
+ "placeholder",
1209
+ "role",
1210
+ "summary",
1211
+ "title",
1212
+ "value",
1213
+ "style",
1214
+ "xmlns"
1215
+ ]);
1216
+ const MATHML_NAMESPACE = "http://www.w3.org/1998/Math/MathML";
1217
+ const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
1218
+ const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
1219
+ let NAMESPACE = HTML_NAMESPACE;
1220
+ let IS_EMPTY_INPUT = false;
1221
+ let ALLOWED_NAMESPACES = null;
1222
+ const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [
1223
+ MATHML_NAMESPACE,
1224
+ SVG_NAMESPACE,
1225
+ HTML_NAMESPACE
1226
+ ], stringToString);
1227
+ const DEFAULT_MATHML_TEXT_INTEGRATION_POINTS = freeze([
1228
+ "mi",
1229
+ "mo",
1230
+ "mn",
1231
+ "ms",
1232
+ "mtext"
1233
+ ]);
1234
+ let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS);
1235
+ const DEFAULT_HTML_INTEGRATION_POINTS = freeze(["annotation-xml"]);
1236
+ let HTML_INTEGRATION_POINTS = addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS);
1237
+ const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, [
1238
+ "title",
1239
+ "style",
1240
+ "font",
1241
+ "a",
1242
+ "script"
1243
+ ]);
1244
+ let PARSER_MEDIA_TYPE = null;
1245
+ const SUPPORTED_PARSER_MEDIA_TYPES = ["application/xhtml+xml", "text/html"];
1246
+ const DEFAULT_PARSER_MEDIA_TYPE = "text/html";
1247
+ let transformCaseFunc = null;
1248
+ let CONFIG = null;
1249
+ const formElement = document.createElement("form");
1250
+ const isRegexOrFunction = function isRegexOrFunction(testValue) {
1251
+ return testValue instanceof RegExp || testValue instanceof Function;
1252
+ };
1253
+ /**
1254
+ * _parseConfig
1255
+ *
1256
+ * @param cfg optional config literal
1257
+ */
1258
+ const _parseConfig = function _parseConfig() {
1259
+ let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1260
+ if (CONFIG && CONFIG === cfg) return;
1261
+ if (!cfg || typeof cfg !== "object") cfg = {};
1262
+ cfg = clone(cfg);
1263
+ PARSER_MEDIA_TYPE = SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
1264
+ transformCaseFunc = PARSER_MEDIA_TYPE === "application/xhtml+xml" ? stringToString : stringToLowerCase;
1265
+ ALLOWED_TAGS = _resolveSetOption(cfg, "ALLOWED_TAGS", DEFAULT_ALLOWED_TAGS, { transform: transformCaseFunc });
1266
+ ALLOWED_ATTR = _resolveSetOption(cfg, "ALLOWED_ATTR", DEFAULT_ALLOWED_ATTR, { transform: transformCaseFunc });
1267
+ ALLOWED_NAMESPACES = _resolveSetOption(cfg, "ALLOWED_NAMESPACES", DEFAULT_ALLOWED_NAMESPACES, { transform: stringToString });
1268
+ URI_SAFE_ATTRIBUTES = _resolveSetOption(cfg, "ADD_URI_SAFE_ATTR", DEFAULT_URI_SAFE_ATTRIBUTES, {
1269
+ transform: transformCaseFunc,
1270
+ base: DEFAULT_URI_SAFE_ATTRIBUTES
1271
+ });
1272
+ DATA_URI_TAGS = _resolveSetOption(cfg, "ADD_DATA_URI_TAGS", DEFAULT_DATA_URI_TAGS, {
1273
+ transform: transformCaseFunc,
1274
+ base: DEFAULT_DATA_URI_TAGS
1275
+ });
1276
+ FORBID_CONTENTS = _resolveSetOption(cfg, "FORBID_CONTENTS", DEFAULT_FORBID_CONTENTS, { transform: transformCaseFunc });
1277
+ FORBID_TAGS = _resolveSetOption(cfg, "FORBID_TAGS", clone({}), { transform: transformCaseFunc });
1278
+ FORBID_ATTR = _resolveSetOption(cfg, "FORBID_ATTR", clone({}), { transform: transformCaseFunc });
1279
+ USE_PROFILES = objectHasOwnProperty(cfg, "USE_PROFILES") ? cfg.USE_PROFILES && typeof cfg.USE_PROFILES === "object" ? clone(cfg.USE_PROFILES) : cfg.USE_PROFILES : false;
1280
+ ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false;
1281
+ ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false;
1282
+ ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false;
1283
+ ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false;
1284
+ SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false;
1285
+ SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false;
1286
+ WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false;
1287
+ RETURN_DOM = cfg.RETURN_DOM || false;
1288
+ RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false;
1289
+ RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false;
1290
+ FORCE_BODY = cfg.FORCE_BODY || false;
1291
+ SANITIZE_DOM = cfg.SANITIZE_DOM !== false;
1292
+ SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false;
1293
+ KEEP_CONTENT = cfg.KEEP_CONTENT !== false;
1294
+ IN_PLACE = cfg.IN_PLACE || false;
1295
+ IS_ALLOWED_URI$1 = isRegex(cfg.ALLOWED_URI_REGEXP) ? cfg.ALLOWED_URI_REGEXP : IS_ALLOWED_URI;
1296
+ NAMESPACE = typeof cfg.NAMESPACE === "string" ? cfg.NAMESPACE : HTML_NAMESPACE;
1297
+ MATHML_TEXT_INTEGRATION_POINTS = _resolveObjectOption(cfg, "MATHML_TEXT_INTEGRATION_POINTS", () => addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS));
1298
+ HTML_INTEGRATION_POINTS = _resolveObjectOption(cfg, "HTML_INTEGRATION_POINTS", () => addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS));
1299
+ const customElementHandling = _resolveObjectOption(cfg, "CUSTOM_ELEMENT_HANDLING", () => create(null));
1300
+ CUSTOM_ELEMENT_HANDLING = create(null);
1301
+ if (objectHasOwnProperty(customElementHandling, "tagNameCheck") && isRegexOrFunction(customElementHandling.tagNameCheck)) CUSTOM_ELEMENT_HANDLING.tagNameCheck = customElementHandling.tagNameCheck;
1302
+ if (objectHasOwnProperty(customElementHandling, "attributeNameCheck") && isRegexOrFunction(customElementHandling.attributeNameCheck)) CUSTOM_ELEMENT_HANDLING.attributeNameCheck = customElementHandling.attributeNameCheck;
1303
+ if (objectHasOwnProperty(customElementHandling, "allowCustomizedBuiltInElements") && typeof customElementHandling.allowCustomizedBuiltInElements === "boolean") CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = customElementHandling.allowCustomizedBuiltInElements;
1304
+ seal(CUSTOM_ELEMENT_HANDLING);
1305
+ if (SAFE_FOR_TEMPLATES) ALLOW_DATA_ATTR = false;
1306
+ if (RETURN_DOM_FRAGMENT) RETURN_DOM = true;
1307
+ if (USE_PROFILES) {
1308
+ ALLOWED_TAGS = addToSet({}, text);
1309
+ ALLOWED_ATTR = create(null);
1310
+ if (USE_PROFILES.html === true) {
1311
+ addToSet(ALLOWED_TAGS, html$1);
1312
+ addToSet(ALLOWED_ATTR, html);
1313
+ }
1314
+ if (USE_PROFILES.svg === true) {
1315
+ addToSet(ALLOWED_TAGS, svg$1);
1316
+ addToSet(ALLOWED_ATTR, svg);
1317
+ addToSet(ALLOWED_ATTR, xml);
1318
+ }
1319
+ if (USE_PROFILES.svgFilters === true) {
1320
+ addToSet(ALLOWED_TAGS, svgFilters);
1321
+ addToSet(ALLOWED_ATTR, svg);
1322
+ addToSet(ALLOWED_ATTR, xml);
1323
+ }
1324
+ if (USE_PROFILES.mathMl === true) {
1325
+ addToSet(ALLOWED_TAGS, mathMl$1);
1326
+ addToSet(ALLOWED_ATTR, mathMl);
1327
+ addToSet(ALLOWED_ATTR, xml);
1328
+ }
1329
+ }
1330
+ EXTRA_ELEMENT_HANDLING.tagCheck = null;
1331
+ EXTRA_ELEMENT_HANDLING.attributeCheck = null;
1332
+ if (objectHasOwnProperty(cfg, "ADD_TAGS")) {
1333
+ if (typeof cfg.ADD_TAGS === "function") EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;
1334
+ else if (arrayIsArray(cfg.ADD_TAGS)) {
1335
+ if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) ALLOWED_TAGS = clone(ALLOWED_TAGS);
1336
+ addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
1337
+ }
1338
+ }
1339
+ if (objectHasOwnProperty(cfg, "ADD_ATTR")) {
1340
+ if (typeof cfg.ADD_ATTR === "function") EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;
1341
+ else if (arrayIsArray(cfg.ADD_ATTR)) {
1342
+ if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) ALLOWED_ATTR = clone(ALLOWED_ATTR);
1343
+ addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
1344
+ }
1345
+ }
1346
+ if (objectHasOwnProperty(cfg, "ADD_FORBID_CONTENTS") && arrayIsArray(cfg.ADD_FORBID_CONTENTS)) {
1347
+ if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) FORBID_CONTENTS = clone(FORBID_CONTENTS);
1348
+ addToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc);
1349
+ }
1350
+ if (KEEP_CONTENT) ALLOWED_TAGS["#text"] = true;
1351
+ if (WHOLE_DOCUMENT) addToSet(ALLOWED_TAGS, [
1352
+ "html",
1353
+ "head",
1354
+ "body"
1355
+ ]);
1356
+ if (ALLOWED_TAGS.table) {
1357
+ addToSet(ALLOWED_TAGS, ["tbody"]);
1358
+ delete FORBID_TAGS.tbody;
1359
+ }
1360
+ if (cfg.TRUSTED_TYPES_POLICY) {
1361
+ if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== "function") throw typeErrorCreate("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
1362
+ if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== "function") throw typeErrorCreate("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
1363
+ const previousTrustedTypesPolicy = trustedTypesPolicy;
1364
+ trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
1365
+ try {
1366
+ emptyHTML = _createTrustedHTML("");
1367
+ } catch (error) {
1368
+ trustedTypesPolicy = previousTrustedTypesPolicy;
1369
+ throw error;
1370
+ }
1371
+ } else if (cfg.TRUSTED_TYPES_POLICY === null) {
1372
+ trustedTypesPolicy = void 0;
1373
+ emptyHTML = "";
1374
+ } else {
1375
+ if (trustedTypesPolicy === void 0) trustedTypesPolicy = _getDefaultTrustedTypesPolicy();
1376
+ if (trustedTypesPolicy && typeof emptyHTML === "string") emptyHTML = _createTrustedHTML("");
1377
+ }
1378
+ if (freeze) freeze(cfg);
1379
+ CONFIG = cfg;
1380
+ };
1381
+ const ALL_SVG_TAGS = addToSet({}, [
1382
+ ...svg$1,
1383
+ ...svgFilters,
1384
+ ...svgDisallowed
1385
+ ]);
1386
+ const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
1387
+ /**
1388
+ * Namespace rules for an element in the SVG namespace.
1389
+ *
1390
+ * @param tagName the element's lowercase tag name
1391
+ * @param parent the (possibly simulated) parent node
1392
+ * @param parentTagName the parent's lowercase tag name
1393
+ * @returns true if a spec-compliant parser could produce this element
1394
+ */
1395
+ const _checkSvgNamespace = function _checkSvgNamespace(tagName, parent, parentTagName) {
1396
+ if (parent.namespaceURI === HTML_NAMESPACE) return tagName === "svg";
1397
+ if (parent.namespaceURI === MATHML_NAMESPACE) return tagName === "svg" && (parentTagName === "annotation-xml" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
1398
+ return Boolean(ALL_SVG_TAGS[tagName]);
1399
+ };
1400
+ /**
1401
+ * Namespace rules for an element in the MathML namespace.
1402
+ *
1403
+ * @param tagName the element's lowercase tag name
1404
+ * @param parent the (possibly simulated) parent node
1405
+ * @param parentTagName the parent's lowercase tag name
1406
+ * @returns true if a spec-compliant parser could produce this element
1407
+ */
1408
+ const _checkMathMlNamespace = function _checkMathMlNamespace(tagName, parent, parentTagName) {
1409
+ if (parent.namespaceURI === HTML_NAMESPACE) return tagName === "math";
1410
+ if (parent.namespaceURI === SVG_NAMESPACE) return tagName === "math" && HTML_INTEGRATION_POINTS[parentTagName];
1411
+ return Boolean(ALL_MATHML_TAGS[tagName]);
1412
+ };
1413
+ /**
1414
+ * Namespace rules for an element in the HTML namespace.
1415
+ *
1416
+ * @param tagName the element's lowercase tag name
1417
+ * @param parent the (possibly simulated) parent node
1418
+ * @param parentTagName the parent's lowercase tag name
1419
+ * @returns true if a spec-compliant parser could produce this element
1420
+ */
1421
+ const _checkHtmlNamespace = function _checkHtmlNamespace(tagName, parent, parentTagName) {
1422
+ if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) return false;
1423
+ if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) return false;
1424
+ return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
1425
+ };
1426
+ /**
1427
+ * @param element a DOM element whose namespace is being checked
1428
+ * @returns Return false if the element has a
1429
+ * namespace that a spec-compliant parser would never
1430
+ * return. Return true otherwise.
1431
+ */
1432
+ const _checkValidNamespace = function _checkValidNamespace(element) {
1433
+ let parent = getParentNode(element);
1434
+ if (!parent || !parent.tagName) parent = {
1435
+ namespaceURI: NAMESPACE,
1436
+ tagName: "template"
1437
+ };
1438
+ const tagName = stringToLowerCase(element.tagName);
1439
+ const parentTagName = stringToLowerCase(parent.tagName);
1440
+ if (!ALLOWED_NAMESPACES[element.namespaceURI]) return false;
1441
+ if (element.namespaceURI === SVG_NAMESPACE) return _checkSvgNamespace(tagName, parent, parentTagName);
1442
+ if (element.namespaceURI === MATHML_NAMESPACE) return _checkMathMlNamespace(tagName, parent, parentTagName);
1443
+ if (element.namespaceURI === HTML_NAMESPACE) return _checkHtmlNamespace(tagName, parent, parentTagName);
1444
+ if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && ALLOWED_NAMESPACES[element.namespaceURI]) return true;
1445
+ return false;
1446
+ };
1447
+ /**
1448
+ * _forceRemove
1449
+ *
1450
+ * @param node a DOM node
1451
+ */
1452
+ const _forceRemove = function _forceRemove(node) {
1453
+ arrayPush(DOMPurify.removed, { element: node });
1454
+ try {
1455
+ getParentNode(node).removeChild(node);
1456
+ } catch (_) {
1457
+ remove(node);
1458
+ if (!getParentNode(node)) throw typeErrorCreate("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
1459
+ }
1460
+ };
1461
+ /**
1462
+ * _stripAttributeNode
1463
+ *
1464
+ * Remove a single Attr node case/namespace-exactly on an attribute-teardown
1465
+ * path. Name-based removeAttribute() ASCII-lowercases its lookup key for an
1466
+ * HTML element in an HTML document and so silently misses a case-preserved
1467
+ * handler (e.g. `ONERROR` off an XML/XHTML import) - the same defect
1468
+ * _removeAttribute() was fixed for, which a name-based call would reintroduce
1469
+ * on these IN_PLACE teardown paths. Unlike _removeAttribute this does not
1470
+ * record into DOMPurify.removed: the neutralize passes intentionally do not
1471
+ * book-keep. A clobbered/detached node falls back to best-effort name-based
1472
+ * removal.
1473
+ *
1474
+ * @param element the element to strip the attribute from
1475
+ * @param attribute the Attr node to remove
1476
+ * @param name the attribute's name, for the fallback path
1477
+ */
1478
+ const _stripAttributeNode = function _stripAttributeNode(element, attribute, name) {
1479
+ try {
1480
+ removeAttributeNode(element, attribute);
1481
+ } catch (_) {
1482
+ try {
1483
+ element.removeAttribute(name);
1484
+ } catch (_) {}
1485
+ }
1486
+ };
1487
+ /**
1488
+ * _neutralizeRoot
1489
+ *
1490
+ * Fail-closed teardown of an in-place root after the sanitize walk aborts
1491
+ * (campaign-3 F2). An internal throw mid-walk — e.g. a page-registered
1492
+ * custom element's reaction detaches a node so `_forceRemove`'s deliberate
1493
+ * parentless guard throws, or any other re-entrant engine mutation — would
1494
+ * otherwise leave the caller's *live* tree half-sanitized, with everything
1495
+ * after the abort point still carrying its handlers. There is no safe way
1496
+ * to resume the walk (the tree mutated under us), so we strip the root bare:
1497
+ * remove every child and every attribute, then let the caller's catch see
1498
+ * the original error. Clobber-safe (cached `remove`/`childNodes`/`attributes`
1499
+ * getters; the root was already clobber-pre-flighted at the IN_PLACE entry).
1500
+ *
1501
+ * @param root the in-place root to empty
1502
+ */
1503
+ const _neutralizeRoot = function _neutralizeRoot(root) {
1504
+ _neutralizeSubtree(root);
1505
+ const childNodes = getChildNodes(root);
1506
+ if (childNodes) {
1507
+ const snapshot = [];
1508
+ arrayForEach(childNodes, (child) => {
1509
+ arrayPush(snapshot, child);
1510
+ });
1511
+ arrayForEach(snapshot, (child) => {
1512
+ try {
1513
+ remove(child);
1514
+ } catch (_) {}
1515
+ });
1516
+ }
1517
+ const attributes = getAttributes(root);
1518
+ if (attributes) for (let i = attributes.length - 1; i >= 0; --i) {
1519
+ const attribute = attributes[i];
1520
+ const name = attribute && attribute.name;
1521
+ if (typeof name === "string") _stripAttributeNode(root, attribute, name);
1522
+ }
1523
+ };
1524
+ /**
1525
+ * _removeAttribute
1526
+ *
1527
+ * Name-based getAttributeNode()/removeAttribute() ASCII-lowercase their
1528
+ * lookup key for HTML elements in an HTML document, so they silently miss an
1529
+ * attribute whose stored qualified name still contains uppercase ASCII
1530
+ * letters. That happens when the node came from a case-preserving source
1531
+ * (an XML/XHTML document imported via importNode(), or createAttributeNS()),
1532
+ * where e.g. `ONERROR` survives the walk: the policy check lowercases to
1533
+ * `onerror` and rejects it, but `removeAttribute('ONERROR')` looks up
1534
+ * `onerror` and finds nothing. Remove the exact Attr node instead, which is
1535
+ * case- and namespace-exact, and fall back to name-based removal only when
1536
+ * the caller could not supply the node.
1537
+ *
1538
+ * @param name an Attribute name
1539
+ * @param element a DOM node
1540
+ * @param attr the exact Attr node to remove, when the caller has it
1541
+ */
1542
+ const _removeAttribute = function _removeAttribute(name, element, attr) {
1543
+ if (!attr) try {
1544
+ attr = element.getAttributeNode(name);
1545
+ } catch (_) {
1546
+ attr = null;
1547
+ }
1548
+ arrayPush(DOMPurify.removed, {
1549
+ attribute: attr || null,
1550
+ from: element
1551
+ });
1552
+ try {
1553
+ if (attr) removeAttributeNode(element, attr);
1554
+ else element.removeAttribute(name);
1555
+ } catch (_) {
1556
+ try {
1557
+ element.removeAttribute(name);
1558
+ } catch (_) {}
1559
+ }
1560
+ if (name === "is") {
1561
+ if (RETURN_DOM || RETURN_DOM_FRAGMENT) try {
1562
+ _forceRemove(element);
1563
+ } catch (_) {}
1564
+ else try {
1565
+ element.setAttribute(name, "");
1566
+ } catch (_) {}
1567
+ }
1568
+ };
1569
+ /**
1570
+ * _stripDisallowedAttributes
1571
+ *
1572
+ * Removes every attribute the active configuration does not allow from a
1573
+ * single element, using the same allowlist as the main attribute pass (so
1574
+ * `on*` handlers go, but no `/^on/` blocklist is introduced). Used only to
1575
+ * neutralise nodes that are being discarded from an in-place tree.
1576
+ *
1577
+ * @param element the element to strip
1578
+ */
1579
+ const _stripDisallowedAttributes = function _stripDisallowedAttributes(element) {
1580
+ const attributes = getAttributes(element);
1581
+ if (!attributes) return;
1582
+ for (let i = attributes.length - 1; i >= 0; --i) {
1583
+ const attribute = attributes[i];
1584
+ const name = attribute && attribute.name;
1585
+ if (typeof name !== "string" || ALLOWED_ATTR[transformCaseFunc(name)]) continue;
1586
+ _stripAttributeNode(element, attribute, name);
1587
+ }
1588
+ };
1589
+ /**
1590
+ * _neutralizeSubtree
1591
+ *
1592
+ * Completes the audit-5 F1 fix across every removal path. The KEEP_CONTENT
1593
+ * move-hoist neutralises only disallowed-tag removals; clobber, mXSS-canary,
1594
+ * namespace, comment, processing-instruction and KEEP_CONTENT:false removals
1595
+ * all drop their subtree wholesale via `_forceRemove`. On the IN_PLACE path
1596
+ * those dropped nodes are detached from the caller's LIVE tree but a
1597
+ * handler-bearing original among them (an `<img onerror>`/`<video>` that was
1598
+ * loading) keeps its queued resource event, which fires in page scope after
1599
+ * sanitize returns. This walks a removed subtree and strips every attribute
1600
+ * the active configuration does not allow — so `on*` handlers are cancelled
1601
+ * through the SAME allowlist that governs kept nodes, not a separate `/^on/`
1602
+ * blocklist. Run synchronously before sanitize returns, i.e. before any
1603
+ * queued event can fire. Hook-free by design: these nodes leave the output,
1604
+ * so firing attribute hooks for them would be surprising. Clobber-safe reads;
1605
+ * a doomed clobbered node may shadow `removeAttribute` (its own attributes are
1606
+ * irrelevant — it is discarded — while its non-clobbered descendants, e.g.
1607
+ * the `<img>`, are reached and scrubbed).
1608
+ *
1609
+ * @param root the root of a removed subtree to neutralise
1610
+ */
1611
+ const _neutralizeSubtree = function _neutralizeSubtree(root) {
1612
+ const stack = [root];
1613
+ while (stack.length > 0) {
1614
+ const node = stack.pop();
1615
+ if (_readNodeType(node) === NODE_TYPE.element) _stripDisallowedAttributes(node);
1616
+ const childNodes = getChildNodes(node);
1617
+ if (childNodes) for (let i = childNodes.length - 1; i >= 0; --i) stack.push(childNodes[i]);
1618
+ }
1619
+ };
1620
+ /**
1621
+ * _neutralizePatchLinkage
1622
+ *
1623
+ * IN_PLACE entry pre-pass (declarative-partial-updates / streaming
1624
+ * hardening, https://github.com/WICG/declarative-partial-updates).
1625
+ *
1626
+ * The main walk strips patch linkage (`for`/`patchsrc`) and removes range
1627
+ * markers (PIs / markup comments) node-by-node, in document order, AS it
1628
+ * reaches each node. On a live in-place root that leaves a window: from the
1629
+ * moment the root is connected until the walk arrives at a given node, that
1630
+ * node's linkage is live. A patch applied on connection/stream can fire as
1631
+ * a microtask during the walk and inject or teleport an unsanitized DOM
1632
+ * range into a region the iterator has already passed and will not revisit,
1633
+ * so the post-return "tree is sanitized" contract is violated. Sweep the
1634
+ * whole tree once up front and sever every linkage before the walk begins,
1635
+ * closing that window.
1636
+ *
1637
+ * This CANNOT undo a patch that already fired before sanitize ran — that is
1638
+ * the irreducible "do not IN_PLACE a live-connected attacker tree" caveat —
1639
+ * but it closes everything from sanitize-start onward. Gated on SAFE_FOR_XML
1640
+ * to group with the rest of the declarative-partial-updates handling and
1641
+ * stay overridable, consistent with the codebase.
1642
+ *
1643
+ * Clobber-safe traversal (cached childNodes getter); per-node try/catch so a
1644
+ * clobbered root cannot defeat the sweep of its non-clobbered descendants.
1645
+ *
1646
+ * NOTE (pending real-Chrome confirmation, see test/declarative-patch-probe
1647
+ * .html Q1): this mirrors the existing policy of keeping `for` on
1648
+ * <label>/<output>. If the shipping feature can drive a patch through a
1649
+ * surviving `for`-on-label/output + `id` pair, this pre-pass and the
1650
+ * attribute check at _isBasicCustomElement's caller must additionally drop
1651
+ * that pair on the IN_PLACE path. Left as-is until the taxonomy is verified.
1652
+ *
1653
+ * @param root the in-place root to sweep
1654
+ */
1655
+ /**
1656
+ * Central policy for declarative-partial-updates patch-linkage attributes,
1657
+ * shared by the _neutralizePatchLinkage pre-pass and _isValidAttribute so
1658
+ * the two sites cannot drift: `patchsrc` always links, `for` links
1659
+ * everywhere except on <label>/<output>, and the whole policy is gated on
1660
+ * SAFE_FOR_XML (see the rationale block in _isValidAttribute).
1661
+ *
1662
+ * @param lcName the transformCaseFunc'd attribute name
1663
+ * @param lcTag the transformCaseFunc'd tag name of the carrying element
1664
+ * @return true if the attribute is patch linkage and must be dropped
1665
+ */
1666
+ const _isPatchLinkageAttribute = function _isPatchLinkageAttribute(lcName, lcTag) {
1667
+ if (!SAFE_FOR_XML) return false;
1668
+ if (lcName === "patchsrc") return true;
1669
+ return lcName === "for" && lcTag !== "label" && lcTag !== "output";
1670
+ };
1671
+ const _neutralizePatchLinkage = function _neutralizePatchLinkage(root) {
1672
+ if (!SAFE_FOR_XML) return;
1673
+ const stack = [root];
1674
+ while (stack.length > 0) {
1675
+ const node = stack.pop();
1676
+ const nodeType = _readNodeType(node);
1677
+ if (nodeType === NODE_TYPE.processingInstruction || nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, node.data)) {
1678
+ try {
1679
+ remove(node);
1680
+ } catch (_) {}
1681
+ continue;
1682
+ }
1683
+ if (nodeType === NODE_TYPE.element) {
1684
+ const element = node;
1685
+ const lcTag = transformCaseFunc(_readNodeName(node));
1686
+ try {
1687
+ if (element.hasAttribute && element.hasAttribute("patchsrc")) element.removeAttribute("patchsrc");
1688
+ if (element.hasAttribute && element.hasAttribute("for") && _isPatchLinkageAttribute("for", lcTag)) element.removeAttribute("for");
1689
+ } catch (_) {}
1690
+ }
1691
+ const childNodes = getChildNodes(node);
1692
+ if (childNodes) for (let i = childNodes.length - 1; i >= 0; --i) stack.push(childNodes[i]);
1693
+ }
1694
+ };
1695
+ /**
1696
+ * _initDocument
1697
+ *
1698
+ * @param dirty - a string of dirty markup
1699
+ * @return a DOM, filled with the dirty markup
1700
+ */
1701
+ const _initDocument = function _initDocument(dirty) {
1702
+ let doc = null;
1703
+ let leadingWhitespace = null;
1704
+ if (FORCE_BODY) dirty = "<remove></remove>" + dirty;
1705
+ else {
1706
+ const matches = stringMatch(dirty, /^[\r\n\t ]+/);
1707
+ leadingWhitespace = matches && matches[0];
1708
+ }
1709
+ if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && NAMESPACE === HTML_NAMESPACE) dirty = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + dirty + "</body></html>";
1710
+ const dirtyPayload = trustedTypesPolicy ? _createTrustedHTML(dirty) : dirty;
1711
+ if (NAMESPACE === HTML_NAMESPACE) try {
1712
+ doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
1713
+ } catch (_) {}
1714
+ if (!doc || !doc.documentElement) {
1715
+ doc = implementation.createDocument(NAMESPACE, "template", null);
1716
+ try {
1717
+ doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
1718
+ } catch (_) {}
1719
+ }
1720
+ const body = doc.body || doc.documentElement;
1721
+ if (dirty && leadingWhitespace) body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
1722
+ if (NAMESPACE === HTML_NAMESPACE) return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? "html" : "body")[0];
1723
+ return WHOLE_DOCUMENT ? doc.documentElement : body;
1724
+ };
1725
+ /**
1726
+ * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
1727
+ *
1728
+ * @param root The root element or node to start traversing on.
1729
+ * @return The created NodeIterator
1730
+ */
1731
+ const _createNodeIterator = function _createNodeIterator(root) {
1732
+ const doc = getOwnerDocument ? getOwnerDocument(root) : root.ownerDocument;
1733
+ return createNodeIterator.call(doc || root, root, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
1734
+ };
1735
+ /**
1736
+ * Replace template expression syntax (mustache, ERB, template
1737
+ * literal) with a space; shared by all SAFE_FOR_TEMPLATES scrub
1738
+ * sites. Order matters: mustache, then ERB, then template literal.
1739
+ *
1740
+ * @param value the string to scrub
1741
+ * @returns the scrubbed string
1742
+ */
1743
+ const _stripTemplateExpressions = function _stripTemplateExpressions(value) {
1744
+ value = stringReplace(value, MUSTACHE_EXPR$1, " ");
1745
+ value = stringReplace(value, ERB_EXPR$1, " ");
1746
+ value = stringReplace(value, TMPLIT_EXPR$1, " ");
1747
+ return value;
1748
+ };
1749
+ /**
1750
+ * Strip template-engine expressions ({{...}}, ${...}, <%...%>) from the
1751
+ * character data of an element subtree. Used as the final safety net for
1752
+ * SAFE_FOR_TEMPLATES on every DOM-returning code path so that expressions
1753
+ * which only form after text-node normalization (e.g. fragments split across
1754
+ * stripped elements) cannot survive into a template-evaluating framework.
1755
+ *
1756
+ * Walks text/comment/CDATA/processing-instruction nodes and mutates `.data`
1757
+ * in place rather than round-tripping through innerHTML. This preserves
1758
+ * descendant node references (important for IN_PLACE callers), avoids a
1759
+ * serialize/reparse cycle, and reads literal character data — which means
1760
+ * `<%...%>` in text content matches the ERB regex against its real bytes
1761
+ * instead of the HTML-entity-escaped form innerHTML would produce.
1762
+ *
1763
+ * Attribute values are not visited here; SAFE_FOR_TEMPLATES handling for
1764
+ * attributes is performed during the per-node `_sanitizeAttributes` pass.
1765
+ *
1766
+ * @param node The root element whose character data should be scrubbed.
1767
+ */
1768
+ const _scrubTemplateExpressions2 = function _scrubTemplateExpressions(node) {
1769
+ var _node$querySelectorAl;
1770
+ node.normalize();
1771
+ const doc = getOwnerDocument ? getOwnerDocument(node) : node.ownerDocument;
1772
+ const walker = createNodeIterator.call(doc || node, node, NodeFilter.SHOW_TEXT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_CDATA_SECTION | NodeFilter.SHOW_PROCESSING_INSTRUCTION, null);
1773
+ let currentNode = walker.nextNode();
1774
+ while (currentNode) {
1775
+ currentNode.data = _stripTemplateExpressions(currentNode.data);
1776
+ currentNode = walker.nextNode();
1777
+ }
1778
+ const templates = (_node$querySelectorAl = node.querySelectorAll) === null || _node$querySelectorAl === void 0 ? void 0 : _node$querySelectorAl.call(node, "template");
1779
+ if (templates) arrayForEach(templates, (tmpl) => {
1780
+ if (_isDocumentFragment(tmpl.content)) _scrubTemplateExpressions2(tmpl.content);
1781
+ });
1782
+ };
1783
+ /**
1784
+ * _isClobbered
1785
+ *
1786
+ * Detect DOM-clobbering on HTMLFormElement nodes. Form is the only HTML
1787
+ * interface with [LegacyOverrideBuiltIns]; a descendant element with a
1788
+ * `name` attribute matching a prototype property shadows that property
1789
+ * on direct reads. We use this check at the IN_PLACE entry-point and
1790
+ * during attribute sanitization to refuse clobbered forms.
1791
+ *
1792
+ * @param element element to check for clobbering attacks
1793
+ * @return true if clobbered, false if safe
1794
+ */
1795
+ const _isClobbered = function _isClobbered(element) {
1796
+ const realTagName = getNodeName ? getNodeName(element) : null;
1797
+ if (typeof realTagName !== "string") return false;
1798
+ if (transformCaseFunc(realTagName) !== "form") return false;
1799
+ return typeof element.nodeName !== "string" || typeof element.textContent !== "string" || typeof element.removeChild !== "function" || element.attributes !== getAttributes(element) || typeof element.removeAttribute !== "function" || typeof element.removeAttributeNode !== "function" || typeof element.getAttributeNode !== "function" || typeof element.setAttribute !== "function" || typeof element.namespaceURI !== "string" || typeof element.insertBefore !== "function" || typeof element.hasChildNodes !== "function" || element.nodeType !== getNodeType(element) || element.childNodes !== getChildNodes(element);
1800
+ };
1801
+ /**
1802
+ * Checks whether the given value is a DocumentFragment from any realm.
1803
+ *
1804
+ * The realm-independent replacement reads `nodeType` through the cached
1805
+ * Node.prototype getter and compares to the DOCUMENT_FRAGMENT_NODE
1806
+ * constant (11). nodeType is a numeric value resolved from the node's
1807
+ * internal slot, identical across realms for the same kind of node.
1808
+ *
1809
+ * @param value object to check
1810
+ * @return true if value is a DocumentFragment-shaped node from any realm
1811
+ */
1812
+ const _isDocumentFragment = function _isDocumentFragment(value) {
1813
+ if (!getNodeType || typeof value !== "object" || value === null) return false;
1814
+ try {
1815
+ return getNodeType(value) === NODE_TYPE.documentFragment;
1816
+ } catch (_) {
1817
+ return false;
1818
+ }
1819
+ };
1820
+ /**
1821
+ * Checks whether the given object is a DOM node, including nodes that
1822
+ * originate from a different window/realm (e.g. an iframe's
1823
+ * contentDocument). The previous `value instanceof Node` check was
1824
+ * realm-bound: nodes from a different window failed it, causing
1825
+ * sanitize() to silently stringify them and reset IN_PLACE to false,
1826
+ * returning the original node unsanitized. See GHSA-4w3q-35jp-p934.
1827
+ *
1828
+ * @param value object to check whether it's a DOM node
1829
+ * @return true if value is a DOM node from any realm
1830
+ */
1831
+ const _isNode = function _isNode(value) {
1832
+ if (!getNodeType || typeof value !== "object" || value === null) return false;
1833
+ try {
1834
+ return typeof getNodeType(value) === "number";
1835
+ } catch (_) {
1836
+ return false;
1837
+ }
1838
+ };
1839
+ function _executeHooks(hooks, currentNode, data) {
1840
+ if (hooks.length === 0) return;
1841
+ arrayForEach(hooks, (hook) => {
1842
+ hook.call(DOMPurify, currentNode, data, CONFIG);
1843
+ });
1844
+ }
1845
+ /**
1846
+ * Structural-threat checks that condemn a node regardless of the
1847
+ * allowlists: mXSS via namespace confusion, risky CSS construction,
1848
+ * processing instructions, markup-bearing comments. Pure predicate;
1849
+ * the caller removes. Check order is load-bearing.
1850
+ *
1851
+ * @param currentNode the node to inspect
1852
+ * @param tagName the node's transformCaseFunc'd tag name
1853
+ * @return true if the node must be removed
1854
+ */
1855
+ const _isUnsafeNode = function _isUnsafeNode(currentNode, tagName) {
1856
+ if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.textContent) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.innerHTML)) return true;
1857
+ if (SAFE_FOR_XML && currentNode.namespaceURI === HTML_NAMESPACE && LITERAL_TEXT_ELEMENTS[tagName] && (_isNode(currentNode.firstElementChild) || typeof currentNode.textContent === "string" && regExpTest(LITERAL_TEXT_CLOSE[tagName], currentNode.textContent))) return true;
1858
+ if (currentNode.nodeType === NODE_TYPE.processingInstruction) return true;
1859
+ if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, currentNode.data)) return true;
1860
+ return false;
1861
+ };
1862
+ /**
1863
+ * Evaluate a CUSTOM_ELEMENT_HANDLING check (a RegExp or a predicate
1864
+ * function, per the validation in _parseConfig) against a name.
1865
+ * Additional arguments are forwarded to predicate functions - the
1866
+ * attributeNameCheck predicate receives the tag name as its second
1867
+ * argument. A null/absent check never matches.
1868
+ *
1869
+ * @param check the configured tagNameCheck / attributeNameCheck value
1870
+ * @param name the name to test
1871
+ * @param args extra arguments forwarded to a predicate function
1872
+ * @return true if the check matches the name
1873
+ */
1874
+ const _matchesNameCheck = function _matchesNameCheck(check, name) {
1875
+ if (check instanceof RegExp) return regExpTest(check, name);
1876
+ if (check instanceof Function) {
1877
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) args[_key - 2] = arguments[_key];
1878
+ return Boolean(check(name, ...args));
1879
+ }
1880
+ return false;
1881
+ };
1882
+ /**
1883
+ * Handle a node whose tag is forbidden or not allowlisted: keep
1884
+ * allowed custom elements (false return exits _sanitizeElements
1885
+ * early - the namespace and fallback-tag removal checks are
1886
+ * intentionally skipped for kept custom elements), else hoist
1887
+ * content per KEEP_CONTENT and remove.
1888
+ *
1889
+ * A kept custom element is the ONLY case in which this function
1890
+ * returns false, so the caller uses that return value to run the
1891
+ * afterSanitizeElements hook on the kept element and keep the
1892
+ * element-hook lifecycle consistent with normal allowlisted
1893
+ * elements (GHSA-c2j3-45gr-mqc4).
1894
+ *
1895
+ * @param currentNode the disallowed node
1896
+ * @param tagName the node's transformCaseFunc'd tag name
1897
+ * @return true if the node was removed, false if kept
1898
+ */
1899
+ const _sanitizeDisallowedNode = function _sanitizeDisallowedNode(currentNode, tagName, root) {
1900
+ if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) return false;
1901
+ if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
1902
+ const parentNode = getParentNode(currentNode);
1903
+ const childNodes = getChildNodes(currentNode);
1904
+ if (childNodes && parentNode) {
1905
+ const childCount = childNodes.length;
1906
+ for (let i = childCount - 1; i >= 0; --i) {
1907
+ const hoisted = currentNode === root ? cloneNode(childNodes[i], true) : childNodes[i];
1908
+ parentNode.insertBefore(hoisted, getNextSibling(currentNode));
1909
+ }
1910
+ }
1911
+ }
1912
+ _forceRemove(currentNode);
1913
+ return true;
1914
+ };
1915
+ /**
1916
+ * Fork a hook-mutable allowlist off its shared binding the first time a
1917
+ * (possibly lazily-installed) uponSanitize* hook is about to see it, so the
1918
+ * hook cannot widen the per-instance default or the setConfig binding by
1919
+ * reference and leak past the call. Returns the set unchanged once it is
1920
+ * already call-local, so repeated calls across elements are idempotent.
1921
+ *
1922
+ * @param hookList the uponSanitize* hook array for this event
1923
+ * @param set the current ALLOWED_TAGS / ALLOWED_ATTR binding
1924
+ * @param defaultSet the per-instance DEFAULT_ALLOWED_* constant
1925
+ * @param setConfigSet the captured setConfig() binding, or null
1926
+ * @return a call-local clone if a hook is present and set is still shared,
1927
+ * else set unchanged
1928
+ */
1929
+ const _forkSharedAllowlist = function _forkSharedAllowlist(hookList, set, defaultSet, setConfigSet) {
1930
+ if (hookList.length === 0) return set;
1931
+ return set === defaultSet || set === setConfigSet ? clone(set) : set;
1932
+ };
1933
+ /**
1934
+ * Shared guard for a node that a hook has detached from the walk tree,
1935
+ * used after each element-hook site in _sanitizeElements. Detaching is a
1936
+ * long-standing user pattern (issue #469; draw.io-style foreignObject
1937
+ * filtering). Per the cached, unclobberable parentNode getter the node is
1938
+ * genuinely out of the tree, so it can reach neither the serialized
1939
+ * output nor an IN_PLACE live tree; treat it as removed and stop
1940
+ * processing it. Without this guard, the unsafe-node / namespace checks
1941
+ * would call _forceRemove on a parentless node and hit the REPORT-3
1942
+ * fail-closed throw — which exists for nodes DOMPurify wants gone but
1943
+ * *cannot* detach (clobbered / parentless roots), the opposite of a node
1944
+ * that is already safely gone. The walk root is exempt: a detached
1945
+ * IN_PLACE root is legitimate input and must still be fully sanitized,
1946
+ * and a kill-decision on it must keep hitting the REPORT-3 throw.
1947
+ *
1948
+ * Nodes detached by hooks stay the hook's responsibility for placement:
1949
+ * they are not recorded in DOMPurify.removed, so the post-walk IN_PLACE
1950
+ * pass (which iterates DOMPurify.removed) does not reach them. But a
1951
+ * hook-detached subtree can still hold a queued resource-event handler -
1952
+ * e.g. an <img onload> that began loading when the caller built the live
1953
+ * tree - which fires in page scope after sanitize returns even though the
1954
+ * handler never reached the returned tree. That is the audit-5 F1 hazard,
1955
+ * and the documented node.remove() hook pattern walks straight into it.
1956
+ * So on the IN_PLACE path we neutralize the detached subtree inline,
1957
+ * stripping its non-allow-listed attributes before returning, exactly as
1958
+ * the post-walk pass does for _forceRemove'd subtrees.
1959
+ *
1960
+ * @param currentNode the node a hook may have detached
1961
+ * @param root the current walk root
1962
+ * @return true if the node is detached and now handled, false otherwise
1963
+ */
1964
+ const _handleHookDetachedNode = function _handleHookDetachedNode(currentNode, root) {
1965
+ if (currentNode === root || getParentNode(currentNode) !== null) return false;
1966
+ if (IN_PLACE) _neutralizeSubtree(currentNode);
1967
+ return true;
1968
+ };
1969
+ /**
1970
+ * _sanitizeElements
1971
+ *
1972
+ * @protect nodeName
1973
+ * @protect textContent
1974
+ * @protect removeChild
1975
+ * @param currentNode to check for permission to exist
1976
+ * @return true if node was killed, false if left alive
1977
+ */
1978
+ const _sanitizeElements = function _sanitizeElements(currentNode, root) {
1979
+ _executeHooks(hooks.beforeSanitizeElements, currentNode, null);
1980
+ if (_handleHookDetachedNode(currentNode, root)) return true;
1981
+ if (_isClobbered(currentNode)) {
1982
+ _forceRemove(currentNode);
1983
+ return true;
1984
+ }
1985
+ const tagName = transformCaseFunc(_readNodeName(currentNode));
1986
+ ALLOWED_TAGS = _forkSharedAllowlist(hooks.uponSanitizeElement, ALLOWED_TAGS, DEFAULT_ALLOWED_TAGS, SET_CONFIG_ALLOWED_TAGS);
1987
+ _executeHooks(hooks.uponSanitizeElement, currentNode, {
1988
+ tagName,
1989
+ allowedTags: ALLOWED_TAGS
1990
+ });
1991
+ if (_handleHookDetachedNode(currentNode, root)) return true;
1992
+ if (_isUnsafeNode(currentNode, tagName)) {
1993
+ _forceRemove(currentNode);
1994
+ return true;
1995
+ }
1996
+ if (FORBID_TAGS[tagName] || !(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && !ALLOWED_TAGS[tagName]) {
1997
+ const removed = _sanitizeDisallowedNode(currentNode, tagName, root);
1998
+ if (removed === false) {
1999
+ _executeHooks(hooks.afterSanitizeElements, currentNode, null);
2000
+ if (_handleHookDetachedNode(currentNode, root)) return true;
2001
+ }
2002
+ return removed;
2003
+ }
2004
+ if (_readNodeType(currentNode) === NODE_TYPE.element && !_checkValidNamespace(currentNode)) {
2005
+ _forceRemove(currentNode);
2006
+ return true;
2007
+ }
2008
+ if ((tagName === "noscript" || tagName === "noembed" || tagName === "noframes") && regExpTest(FALLBACK_TAG_CLOSE, currentNode.innerHTML)) {
2009
+ _forceRemove(currentNode);
2010
+ return true;
2011
+ }
2012
+ if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
2013
+ const content = _stripTemplateExpressions(currentNode.textContent);
2014
+ if (currentNode.textContent !== content) {
2015
+ arrayPush(DOMPurify.removed, { element: currentNode.cloneNode() });
2016
+ currentNode.textContent = content;
2017
+ }
2018
+ }
2019
+ _executeHooks(hooks.afterSanitizeElements, currentNode, null);
2020
+ return _handleHookDetachedNode(currentNode, root);
2021
+ };
2022
+ /**
2023
+ * _isValidAttribute
2024
+ *
2025
+ * @param lcTag Lowercase tag name of containing element.
2026
+ * @param lcName Lowercase attribute name.
2027
+ * @param value Attribute value.
2028
+ * @return Returns true if `value` is valid, otherwise false.
2029
+ */
2030
+ const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
2031
+ if (FORBID_ATTR[lcName]) return false;
2032
+ if (_isPatchLinkageAttribute(lcName, lcTag)) return false;
2033
+ if (SANITIZE_DOM && (lcName === "id" || lcName === "name") && (value in document || value in formElement)) return false;
2034
+ const nameIsPermitted = ALLOWED_ATTR[lcName] || EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag);
2035
+ if (ALLOW_DATA_ATTR && regExpTest(DATA_ATTR$1, lcName)) return true;
2036
+ if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$1, lcName)) return true;
2037
+ if (!nameIsPermitted) return _isBasicCustomElement(lcTag) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName, lcTag) || lcName === "is" && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value);
2038
+ if (URI_SAFE_ATTRIBUTES[lcName]) return true;
2039
+ if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE$1, ""))) return true;
2040
+ if ((lcName === "src" || lcName === "xlink:href" || lcName === "href") && lcTag !== "script" && stringIndexOf(value, "data:") === 0 && DATA_URI_TAGS[lcTag]) return true;
2041
+ if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$1, stringReplace(value, ATTR_WHITESPACE$1, ""))) return true;
2042
+ return !value;
2043
+ };
2044
+ const RESERVED_CUSTOM_ELEMENT_NAMES = addToSet({}, [
2045
+ "annotation-xml",
2046
+ "color-profile",
2047
+ "font-face",
2048
+ "font-face-format",
2049
+ "font-face-name",
2050
+ "font-face-src",
2051
+ "font-face-uri",
2052
+ "missing-glyph"
2053
+ ]);
2054
+ /**
2055
+ * _isBasicCustomElement
2056
+ * checks if at least one dash is included in tagName, and it's not the first char
2057
+ * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name
2058
+ *
2059
+ * @param tagName name of the tag of the node to sanitize
2060
+ * @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.
2061
+ */
2062
+ const _isBasicCustomElement = function _isBasicCustomElement(tagName) {
2063
+ return !RESERVED_CUSTOM_ELEMENT_NAMES[stringToLowerCase(tagName)] && regExpTest(CUSTOM_ELEMENT$1, tagName);
2064
+ };
2065
+ /**
2066
+ * Wrap an attribute value in the matching Trusted Types object when
2067
+ * the active policy requires it. Namespaced attributes pass through
2068
+ * unchanged (no TT support yet, see
2069
+ * https://bugs.chromium.org/p/chromium/issues/detail?id=1305293).
2070
+ *
2071
+ * @param lcTag lowercase tag name of the containing element
2072
+ * @param lcName lowercase attribute name
2073
+ * @param namespaceURI the attribute's namespace, if any
2074
+ * @param value the attribute value to wrap
2075
+ * @return the value, wrapped when Trusted Types demand it
2076
+ */
2077
+ const _applyTrustedTypesToAttribute = function _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value) {
2078
+ if (trustedTypesPolicy && typeof trustedTypes === "object" && typeof trustedTypes.getAttributeType === "function" && !namespaceURI) switch (trustedTypes.getAttributeType(lcTag, lcName)) {
2079
+ case "TrustedHTML": return _createTrustedHTML(value);
2080
+ case "TrustedScriptURL": return _createTrustedScriptURL(value);
2081
+ }
2082
+ return value;
2083
+ };
2084
+ /**
2085
+ * Write a modified attribute value back onto the element. On
2086
+ * success, re-probe for clobbering introduced by the new value and
2087
+ * remove the element when found; otherwise, when this writeback is the
2088
+ * recreate half of the SANITIZE_NAMED_PROPS remove-and-recreate, pop the
2089
+ * removal entry that path recorded so it does not show as removed. On
2090
+ * failure, remove the attribute instead.
2091
+ *
2092
+ * Returns true only on a clean write (the value was set and the new value
2093
+ * introduced no clobbering). The caller uses that, together with its own
2094
+ * knowledge of whether this attribute pushed a DOMPurify.removed record, to
2095
+ * decide whether to pop that record. The pop must happen ONLY for the
2096
+ * named-prop remove-and-recreate; popping on any other value change (trim,
2097
+ * template scrubbing, Trusted Types) would consume an unrelated _forceRemove
2098
+ * subtree-cleanup record and let that detached subtree keep a live event
2099
+ * handler through the IN_PLACE neutralization pass (SO-001).
2100
+ *
2101
+ * @param currentNode the element carrying the attribute
2102
+ * @param name the attribute name as present on the element
2103
+ * @param namespaceURI the attribute's namespace, if any
2104
+ * @param value the new attribute value
2105
+ * @return true if the value was written without introducing clobbering
2106
+ */
2107
+ const _setAttributeValue = function _setAttributeValue(currentNode, name, namespaceURI, value) {
2108
+ try {
2109
+ if (namespaceURI) currentNode.setAttributeNS(namespaceURI, name, value);
2110
+ else currentNode.setAttribute(name, value);
2111
+ if (_isClobbered(currentNode)) {
2112
+ _forceRemove(currentNode);
2113
+ return false;
2114
+ }
2115
+ return true;
2116
+ } catch (_) {
2117
+ _removeAttribute(name, currentNode);
2118
+ return false;
2119
+ }
2120
+ };
2121
+ /**
2122
+ * _sanitizeAttributes
2123
+ *
2124
+ * @protect attributes
2125
+ * @protect nodeName
2126
+ * @protect removeAttribute
2127
+ * @protect setAttribute
2128
+ *
2129
+ * @param currentNode to sanitize
2130
+ * @param root the current walk root
2131
+ */
2132
+ const _sanitizeAttributes = function _sanitizeAttributes(currentNode, root) {
2133
+ _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
2134
+ if (_handleHookDetachedNode(currentNode, root)) return;
2135
+ const attributes = currentNode.attributes;
2136
+ if (!attributes || _isClobbered(currentNode)) return;
2137
+ ALLOWED_ATTR = _forkSharedAllowlist(hooks.uponSanitizeAttribute, ALLOWED_ATTR, DEFAULT_ALLOWED_ATTR, SET_CONFIG_ALLOWED_ATTR);
2138
+ const hookEvent = {
2139
+ attrName: "",
2140
+ attrValue: "",
2141
+ keepAttr: true,
2142
+ allowedAttributes: ALLOWED_ATTR,
2143
+ forceKeepAttr: void 0
2144
+ };
2145
+ let l = attributes.length;
2146
+ const lcTag = transformCaseFunc(currentNode.nodeName);
2147
+ while (l--) {
2148
+ const attr = attributes[l];
2149
+ const name = attr.name, namespaceURI = attr.namespaceURI, attrValue = attr.value;
2150
+ const lcName = transformCaseFunc(name);
2151
+ const initValue = attrValue;
2152
+ let value = name === "value" ? initValue : stringTrim(initValue);
2153
+ let recreatedNamedProp = false;
2154
+ hookEvent.attrName = lcName;
2155
+ hookEvent.attrValue = value;
2156
+ hookEvent.keepAttr = true;
2157
+ hookEvent.forceKeepAttr = void 0;
2158
+ _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);
2159
+ value = hookEvent.attrValue;
2160
+ if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name") && stringIndexOf(value, SANITIZE_NAMED_PROPS_PREFIX) !== 0) {
2161
+ _removeAttribute(name, currentNode, attr);
2162
+ value = SANITIZE_NAMED_PROPS_PREFIX + value;
2163
+ recreatedNamedProp = true;
2164
+ }
2165
+ if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, value)) {
2166
+ _removeAttribute(name, currentNode, attr);
2167
+ continue;
2168
+ }
2169
+ if (lcName === "attributename" && stringMatch(value, "href")) {
2170
+ _removeAttribute(name, currentNode, attr);
2171
+ continue;
2172
+ }
2173
+ if (hookEvent.forceKeepAttr) continue;
2174
+ if (!hookEvent.keepAttr) {
2175
+ _removeAttribute(name, currentNode, attr);
2176
+ continue;
2177
+ }
2178
+ if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(SELF_CLOSING_TAG, value)) {
2179
+ _removeAttribute(name, currentNode, attr);
2180
+ continue;
2181
+ }
2182
+ if (SAFE_FOR_TEMPLATES) value = _stripTemplateExpressions(value);
2183
+ if (!_isValidAttribute(lcTag, lcName, value)) {
2184
+ _removeAttribute(name, currentNode, attr);
2185
+ continue;
2186
+ }
2187
+ value = _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value);
2188
+ if (value !== initValue) {
2189
+ if (_setAttributeValue(currentNode, name, namespaceURI, value) && recreatedNamedProp) arrayPop(DOMPurify.removed);
2190
+ }
2191
+ }
2192
+ _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
2193
+ _handleHookDetachedNode(currentNode, root);
2194
+ };
2195
+ /**
2196
+ * _sanitizeShadowDOM
2197
+ *
2198
+ * @param fragment to iterate over recursively
2199
+ */
2200
+ const _sanitizeShadowDOM2 = function _sanitizeShadowDOM(fragment) {
2201
+ let shadowNode = null;
2202
+ const shadowIterator = _createNodeIterator(fragment);
2203
+ _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);
2204
+ while (shadowNode = shadowIterator.nextNode()) {
2205
+ _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
2206
+ _sanitizeElements(shadowNode, fragment);
2207
+ _sanitizeAttributes(shadowNode, fragment);
2208
+ if (_isDocumentFragment(shadowNode.content)) _sanitizeShadowDOM2(shadowNode.content);
2209
+ if (_readNodeType(shadowNode) === NODE_TYPE.element) {
2210
+ const innerSr = getShadowRoot(shadowNode);
2211
+ if (_isDocumentFragment(innerSr)) {
2212
+ _sanitizeAttachedShadowRoots(innerSr);
2213
+ _sanitizeShadowDOM2(innerSr);
2214
+ }
2215
+ }
2216
+ }
2217
+ _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
2218
+ };
2219
+ /**
2220
+ * _sanitizeAttachedShadowRoots
2221
+ *
2222
+ * Walks `root` and feeds every attached shadow root we encounter into
2223
+ * the existing _sanitizeShadowDOM pipeline. The default node iterator
2224
+ * does not descend into shadow trees, so nodes inside an attached
2225
+ * shadow root would otherwise be skipped entirely.
2226
+ *
2227
+ * Two real input paths put attached shadow roots in front of us:
2228
+ * 1. IN_PLACE on a DOM node that already has shadow roots attached.
2229
+ * 2. DOM-node input where importNode(dirty, true) deep-clones the
2230
+ * shadow root because it was created with `clonable: true`.
2231
+ *
2232
+ * This pass runs once, up front, so the main iteration loop (and the
2233
+ * existing _sanitizeShadowDOM template-content recursion) stay
2234
+ * untouched — string-input paths are not affected.
2235
+ *
2236
+ * @param root the subtree root to walk for attached shadow roots
2237
+ */
2238
+ const _sanitizeAttachedShadowRoots = function _sanitizeAttachedShadowRoots(root) {
2239
+ const stack = [{
2240
+ node: root,
2241
+ shadow: null
2242
+ }];
2243
+ while (stack.length > 0) {
2244
+ const item = stack.pop();
2245
+ if (item.shadow) {
2246
+ _sanitizeShadowDOM2(item.shadow);
2247
+ continue;
2248
+ }
2249
+ const node = item.node;
2250
+ const isElement = _readNodeType(node) === NODE_TYPE.element;
2251
+ const childNodes = getChildNodes(node);
2252
+ if (childNodes) for (let i = childNodes.length - 1; i >= 0; --i) stack.push({
2253
+ node: childNodes[i],
2254
+ shadow: null
2255
+ });
2256
+ if (isElement) {
2257
+ const rootName = getNodeName ? getNodeName(node) : null;
2258
+ if (typeof rootName === "string" && transformCaseFunc(rootName) === "template") {
2259
+ const content = node.content;
2260
+ if (_isDocumentFragment(content)) stack.push({
2261
+ node: content,
2262
+ shadow: null
2263
+ });
2264
+ }
2265
+ }
2266
+ if (isElement) {
2267
+ const sr = getShadowRoot(node);
2268
+ if (_isDocumentFragment(sr)) stack.push({
2269
+ node: null,
2270
+ shadow: sr
2271
+ }, {
2272
+ node: sr,
2273
+ shadow: null
2274
+ });
2275
+ }
2276
+ }
2277
+ };
2278
+ DOMPurify.sanitize = function(dirty) {
2279
+ let cfg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2280
+ let body = null;
2281
+ let importedNode = null;
2282
+ let currentNode = null;
2283
+ let returnNode = null;
2284
+ IS_EMPTY_INPUT = !dirty;
2285
+ if (IS_EMPTY_INPUT) dirty = "<!-->";
2286
+ if (typeof dirty !== "string" && !_isNode(dirty)) {
2287
+ dirty = stringifyValue(dirty);
2288
+ if (typeof dirty !== "string") throw typeErrorCreate("dirty is not a string, aborting");
2289
+ }
2290
+ if (!DOMPurify.isSupported) return dirty;
2291
+ if (SET_CONFIG) {
2292
+ ALLOWED_TAGS = SET_CONFIG_ALLOWED_TAGS;
2293
+ ALLOWED_ATTR = SET_CONFIG_ALLOWED_ATTR;
2294
+ } else _parseConfig(cfg);
2295
+ if (hooks.uponSanitizeElement.length > 0 || hooks.uponSanitizeAttribute.length > 0) ALLOWED_TAGS = clone(ALLOWED_TAGS);
2296
+ if (hooks.uponSanitizeAttribute.length > 0) ALLOWED_ATTR = clone(ALLOWED_ATTR);
2297
+ DOMPurify.removed = [];
2298
+ const inPlace = IN_PLACE && typeof dirty !== "string" && _isNode(dirty);
2299
+ if (inPlace) {
2300
+ _neutralizePatchLinkage(dirty);
2301
+ const nn = _readNodeName(dirty);
2302
+ if (typeof nn === "string") {
2303
+ const tagName = transformCaseFunc(nn);
2304
+ if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
2305
+ _neutralizeRoot(dirty);
2306
+ throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place");
2307
+ }
2308
+ }
2309
+ if (_isClobbered(dirty)) {
2310
+ _neutralizeRoot(dirty);
2311
+ throw typeErrorCreate("root node is clobbered and cannot be sanitized in-place");
2312
+ }
2313
+ try {
2314
+ _sanitizeAttachedShadowRoots(dirty);
2315
+ } catch (error) {
2316
+ _neutralizeRoot(dirty);
2317
+ throw error;
2318
+ }
2319
+ } else if (_isNode(dirty)) {
2320
+ body = _initDocument("<!---->");
2321
+ importedNode = body.ownerDocument.importNode(dirty, true);
2322
+ if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === "BODY") body = importedNode;
2323
+ else if (importedNode.nodeName === "HTML") body = importedNode;
2324
+ else body.appendChild(importedNode);
2325
+ _sanitizeAttachedShadowRoots(body);
2326
+ } else {
2327
+ if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && dirty.indexOf("<") === -1) return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(dirty) : dirty;
2328
+ body = _initDocument(dirty);
2329
+ if (!body) return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : "";
2330
+ }
2331
+ if (body && FORCE_BODY) _forceRemove(body.firstChild);
2332
+ const walkRoot = inPlace ? dirty : body;
2333
+ try {
2334
+ const nodeIterator = _createNodeIterator(walkRoot);
2335
+ while (currentNode = nodeIterator.nextNode()) {
2336
+ _sanitizeElements(currentNode, walkRoot);
2337
+ _sanitizeAttributes(currentNode, walkRoot);
2338
+ if (_isDocumentFragment(currentNode.content)) _sanitizeShadowDOM2(currentNode.content);
2339
+ }
2340
+ } catch (error) {
2341
+ if (inPlace) {
2342
+ _neutralizeRoot(dirty);
2343
+ arrayForEach(DOMPurify.removed, (entry) => {
2344
+ if (entry.element) _neutralizeSubtree(entry.element);
2345
+ });
2346
+ }
2347
+ throw error;
2348
+ }
2349
+ if (inPlace) {
2350
+ let rootWasRemoved = false;
2351
+ arrayForEach(DOMPurify.removed, (entry) => {
2352
+ if (entry.element) {
2353
+ if (entry.element === dirty) rootWasRemoved = true;
2354
+ _neutralizeSubtree(entry.element);
2355
+ }
2356
+ });
2357
+ if (rootWasRemoved) throw typeErrorCreate("a node selected for removal could not be safely returned; refusing to sanitize in place");
2358
+ if (SAFE_FOR_TEMPLATES) _scrubTemplateExpressions2(dirty);
2359
+ return dirty;
2360
+ }
2361
+ if (RETURN_DOM) {
2362
+ if (SAFE_FOR_TEMPLATES) _scrubTemplateExpressions2(body);
2363
+ if (RETURN_DOM_FRAGMENT) {
2364
+ returnNode = createDocumentFragment.call(body.ownerDocument);
2365
+ while (body.firstChild) returnNode.appendChild(body.firstChild);
2366
+ } else returnNode = body;
2367
+ if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) returnNode = importNode.call(originalDocument, returnNode, true);
2368
+ return returnNode;
2369
+ }
2370
+ let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
2371
+ if (WHOLE_DOCUMENT && ALLOWED_TAGS["!doctype"] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) serializedHTML = "<!DOCTYPE " + body.ownerDocument.doctype.name + ">\n" + serializedHTML;
2372
+ if (SAFE_FOR_TEMPLATES) serializedHTML = _stripTemplateExpressions(serializedHTML);
2373
+ return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(serializedHTML) : serializedHTML;
2374
+ };
2375
+ DOMPurify.setConfig = function() {
2376
+ let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2377
+ _parseConfig(cfg);
2378
+ SET_CONFIG = true;
2379
+ SET_CONFIG_ALLOWED_TAGS = ALLOWED_TAGS;
2380
+ SET_CONFIG_ALLOWED_ATTR = ALLOWED_ATTR;
2381
+ };
2382
+ DOMPurify.clearConfig = function() {
2383
+ CONFIG = null;
2384
+ SET_CONFIG = false;
2385
+ SET_CONFIG_ALLOWED_TAGS = null;
2386
+ SET_CONFIG_ALLOWED_ATTR = null;
2387
+ trustedTypesPolicy = defaultTrustedTypesPolicy;
2388
+ emptyHTML = "";
2389
+ };
2390
+ DOMPurify.isValidAttribute = function(tag, attr, value) {
2391
+ if (!CONFIG) _parseConfig({});
2392
+ const lcTag = transformCaseFunc(tag);
2393
+ const lcName = transformCaseFunc(attr);
2394
+ return _isValidAttribute(lcTag, lcName, value);
2395
+ };
2396
+ DOMPurify.addHook = function(entryPoint, hookFunction) {
2397
+ if (typeof hookFunction !== "function") return;
2398
+ if (!objectHasOwnProperty(hooks, entryPoint)) return;
2399
+ arrayPush(hooks[entryPoint], hookFunction);
2400
+ };
2401
+ DOMPurify.removeHook = function(entryPoint, hookFunction) {
2402
+ if (!objectHasOwnProperty(hooks, entryPoint)) return;
2403
+ if (hookFunction !== void 0) {
2404
+ const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
2405
+ return index === -1 ? void 0 : arraySplice(hooks[entryPoint], index, 1)[0];
2406
+ }
2407
+ return arrayPop(hooks[entryPoint]);
2408
+ };
2409
+ DOMPurify.removeHooks = function(entryPoint) {
2410
+ if (!objectHasOwnProperty(hooks, entryPoint)) return;
2411
+ hooks[entryPoint] = [];
2412
+ };
2413
+ DOMPurify.removeAllHooks = function() {
2414
+ hooks = _createHooksMap();
2415
+ };
2416
+ return DOMPurify;
2417
+ }
2418
+ createDOMPurify();
2419
+
2420
+ //#region src/lib/markdown.ts
2421
+ /** A Lucide icon as markup, for the buttons and cards inside rendered HTML. */
2422
+ function iconSvg(node, size, className) {
2423
+ return `<svg xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"${className ? ` class="${className}"` : ""}>${node.map(([tag, attrs]) => `<${tag} ${Object.entries(attrs).map(([name, value]) => `${name}="${value}"`).join(" ")}/>`).join("")}</svg>`;
2424
+ }
2425
+ var COPY_ICON = iconSvg(Copy, 14);
2426
+ iconSvg(File, 20, "shrink-0 text-muted-foreground");
2427
+ iconSvg(Download, 16, "shrink-0 text-muted-foreground");
2428
+ iconSvg(Image, 20, "shrink-0");
2429
+ var IMAGE_OFF_ICON = iconSvg(ImageOff, 16, "shrink-0 text-muted-foreground");
2430
+ iconSvg(FileX, 16, "shrink-0 text-muted-foreground");
2431
+ function escapeHtml(text) {
2432
+ return text.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll("\"", "&quot;");
2433
+ }
2434
+ var INLINE = "my-1 mr-1.5 inline-flex align-middle";
2435
+ /** Something the reply links to that couldn't be copied. `label` is HTML. */
2436
+ function problem(icon, label, reason, layout) {
2437
+ return `<span data-media-problem class="${layout} max-w-full items-center gap-2 rounded-xl border border-dashed px-3 py-2 text-sm leading-snug">${icon}<span class="min-w-0"><span class="font-medium">${label}</span> <span class="text-muted-foreground">· ${escapeHtml(reason)}</span></span></span>`;
2438
+ }
2439
+ /** The interface's language, while renderMarkdown parses. */
2440
+ function words() {
2441
+ throw new Error("renderMarkdown sets the language before parsing");
2442
+ }
2443
+ new F({
2444
+ gfm: true,
2445
+ renderer: {
2446
+ code({ text, lang }) {
2447
+ const { m } = words();
2448
+ return `<div data-code-block class="my-3 overflow-hidden rounded-2xl border bg-muted/50">
2449
+ <div class="flex h-9 items-center justify-between pr-2 pl-4 text-xs text-muted-foreground"><span>${escapeHtml((lang ?? "").split(/\s/)[0]) || m.markdown.text}</span><button type="button" data-copy class="flex items-center gap-1.5 rounded-lg px-2 py-1 hover:bg-accent hover:text-foreground">${COPY_ICON}<span>${escapeHtml(m.common.copy)}</span></button></div>
2450
+ <pre class="overflow-x-auto px-4 pb-4"><code>${escapeHtml(text)}</code></pre></div>`;
2451
+ },
2452
+ image({ href, text, tokens }) {
2453
+ const alt = tokens ? this.parser.parseInline(tokens, this.parser.textRenderer) : text;
2454
+ const { markdown } = words().m;
2455
+ return problem(IMAGE_OFF_ICON, escapeHtml(alt || markdown.picture), markdown.notAvailable, INLINE);
2456
+ },
2457
+ link(token) {
2458
+ return false;
2459
+ }
2460
+ }
2461
+ });
2462
+ /**
2463
+ * Markdown to sanitized HTML. Only used in the browser; the server never renders messages.
2464
+ * With `media`, pictures and file links show the copies made for the reply. `lang` is the
2465
+ * interface's, for the copy buttons and file cards around the text; the text stays as it is.
2466
+ */
2467
+ function renderMarkdown(text, lang, media) {
2468
+ return `<p>${escapeHtml(text)}</p>`;
2469
+ }
2470
+ //#endregion
2471
+ //#region src/lib/components/chat/Markdown.svelte
2472
+ function Markdown($$renderer, $$props) {
2473
+ $$renderer.component(($$renderer) => {
2474
+ /** For replies: where their pictures and files come from. */
2475
+ let { text, media, class: className } = $$props;
2476
+ getI18n();
2477
+ const html$1 = derived(() => renderMarkdown(text));
2478
+ $$renderer.push(`<div${attr_class(clsx(cn("markdown", className)))}>${html$2(html$1())}</div>`);
2479
+ });
2480
+ }
2481
+ //#endregion
2482
+ //#region src/lib/components/memory/MemoryChangeItem.svelte
2483
+ function MemoryChangeItem($$renderer, $$props) {
2484
+ $$renderer.component(($$renderer) => {
2485
+ /**
2486
+ * One thing the note-taker saved: the fact as it reads now (and before, for a change), the note
2487
+ * it's in, and Undo, which puts the note back as it was. `note`: the note's link, as each place
2488
+ * wants it. `after`: more on the same line as the note, like the chat it came from. `onundone`:
2489
+ * after an undo, for places that don't get it live.
2490
+ */
2491
+ let { change, slug, note, after, onundone } = $$props;
2492
+ const { m } = getI18n();
2493
+ const t = derived(() => m.memory.changes);
2494
+ let undoing = false;
2495
+ let problem = null;
2496
+ async function undo() {
2497
+ undoing = true;
2498
+ problem = null;
2499
+ try {
2500
+ const res = await fetch(`/api/p/${slug}/memory/${change.id}/undo`, { method: "POST" });
2501
+ if (res.ok) {
2502
+ onundone?.();
2503
+ return;
2504
+ }
2505
+ const text = await res.text();
2506
+ const reason = res.status === 409 ? JSON.parse(text).reason : null;
2507
+ problem = reason === "changed" ? t().changedSince : reason === "undone" ? t().alreadyUndone : errorMessage(text, res.headers.get("content-type")) ?? m.errors.requestFailed(res.status);
2508
+ } catch {
2509
+ problem = m.errors.requestFailed(0);
2510
+ } finally {
2511
+ undoing = false;
2512
+ }
2513
+ }
2514
+ $$renderer.push(`<li class="flex items-start gap-2"><span class="mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground"${attr("title", change.op === "add" ? t().added : t().changed)}>`);
2515
+ if (change.op === "add") {
2516
+ $$renderer.push("<!--[0-->");
2517
+ Plus($$renderer, { class: "size-3" });
2518
+ } else {
2519
+ $$renderer.push("<!--[-1-->");
2520
+ Pencil($$renderer, { class: "size-3" });
2521
+ }
2522
+ $$renderer.push(`<!--]--> <span class="sr-only">${escape_html(change.op === "add" ? t().added : t().changed)}</span></span> <div class="min-w-0 flex-1 space-y-0.5"><p${attr_class(clsx(cn("break-words", change.undone && "text-muted-foreground line-through")))}>${escape_html(change.fact)}</p> `);
2523
+ if (change.before !== null) $$renderer.push(`<!--[0--><p class="text-xs break-words text-muted-foreground">${escape_html(t().before(change.before))}</p>`);
2524
+ else $$renderer.push("<!--[-1-->");
2525
+ $$renderer.push(`<!--]--> <p class="flex flex-wrap items-center gap-x-1.5 text-xs text-muted-foreground">`);
2526
+ note($$renderer, memoryTitle(m, change.note));
2527
+ $$renderer.push(`<!----> `);
2528
+ if (after) {
2529
+ $$renderer.push(`<!--[0--><span aria-hidden="true">·</span>`);
2530
+ after($$renderer);
2531
+ $$renderer.push(`<!---->`);
2532
+ } else $$renderer.push("<!--[-1-->");
2533
+ $$renderer.push(`<!--]--></p> `);
2534
+ if (problem) $$renderer.push(`<!--[0--><p class="text-xs text-destructive" role="alert">${escape_html(problem)}</p>`);
2535
+ else $$renderer.push("<!--[-1-->");
2536
+ $$renderer.push(`<!--]--></div> `);
2537
+ if (change.undone) $$renderer.push(`<!--[0--><span class="shrink-0 py-1 text-xs text-muted-foreground">${escape_html(change.undone.by ? t().undoneBy(change.undone.by) : t().undone)}</span>`);
2538
+ else {
2539
+ $$renderer.push("<!--[-1-->");
2540
+ Button($$renderer, {
2541
+ variant: "ghost",
2542
+ size: "sm",
2543
+ class: "-my-1 h-7 shrink-0 px-2 text-xs text-muted-foreground",
2544
+ disabled: undoing,
2545
+ onclick: undo,
2546
+ children: ($$renderer) => {
2547
+ $$renderer.push(`<!---->${escape_html(t().undo)}`);
2548
+ },
2549
+ $$slots: { default: true }
2550
+ });
2551
+ }
2552
+ $$renderer.push(`<!--]--></li>`);
2553
+ });
2554
+ }
2555
+
2556
+ export { MemoryChangeItem as M, Markdown as a };
2557
+ //# sourceMappingURL=MemoryChangeItem.js-BBDjCjIq.js.map