groove-dev 0.27.86 → 0.27.88

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 (538) hide show
  1. package/CLAUDE.md +11 -0
  2. package/moe-training/client/scrubber.js +4 -2
  3. package/moe-training/client/step-classifier.js +17 -0
  4. package/moe-training/client/trajectory-capture.js +80 -6
  5. package/moe-training/client/transmission-queue.js +11 -0
  6. package/moe-training/test/client/scrubber.test.js +14 -4
  7. package/moe-training/test/client/step-classifier.test.js +47 -0
  8. package/moe-training/test/client/transmission-queue.test.js +33 -0
  9. package/node_modules/@groove-dev/cli/bin/groove.js +10 -1
  10. package/node_modules/@groove-dev/cli/package.json +1 -1
  11. package/node_modules/@groove-dev/cli/src/commands/connect.js +116 -205
  12. package/node_modules/@groove-dev/cli/src/commands/disconnect.js +38 -62
  13. package/node_modules/@groove-dev/cli/src/commands/remotes.js +75 -0
  14. package/node_modules/@groove-dev/daemon/package.json +1 -1
  15. package/node_modules/@groove-dev/daemon/src/api.js +115 -7
  16. package/node_modules/@groove-dev/daemon/src/conversations.js +29 -3
  17. package/node_modules/@groove-dev/daemon/src/process.js +56 -1
  18. package/node_modules/@groove-dev/daemon/src/providers/codex.js +28 -10
  19. package/node_modules/@groove-dev/daemon/src/registry.js +30 -0
  20. package/node_modules/@groove-dev/daemon/src/validate.js +23 -0
  21. package/node_modules/@groove-dev/gui/dist/assets/index-BSqk8cbI.css +1 -0
  22. package/node_modules/@groove-dev/gui/dist/assets/index-B_igwWvq.js +8642 -0
  23. package/node_modules/@groove-dev/gui/dist/index.html +2 -2
  24. package/node_modules/@groove-dev/gui/package.json +2 -1
  25. package/node_modules/@groove-dev/gui/src/components/agents/agent-file-tree.jsx +254 -0
  26. package/node_modules/@groove-dev/gui/src/components/agents/code-review.jsx +177 -0
  27. package/node_modules/@groove-dev/gui/src/components/agents/diff-viewer.jsx +148 -0
  28. package/node_modules/@groove-dev/gui/src/components/agents/workspace-mode.jsx +377 -0
  29. package/node_modules/@groove-dev/gui/src/components/chat/chat-input.jsx +117 -40
  30. package/node_modules/@groove-dev/gui/src/components/chat/chat-messages.jsx +10 -13
  31. package/node_modules/@groove-dev/gui/src/components/chat/chat-view.jsx +26 -1
  32. package/node_modules/@groove-dev/gui/src/components/chat/conversation-list.jsx +14 -14
  33. package/node_modules/@groove-dev/gui/src/components/chat/model-picker.jsx +5 -0
  34. package/node_modules/@groove-dev/gui/src/components/preview/preview-workspace.jsx +6 -5
  35. package/node_modules/@groove-dev/gui/src/components/preview/screenshot-overlay.jsx +41 -29
  36. package/node_modules/@groove-dev/gui/src/stores/groove.js +138 -3
  37. package/node_modules/@groove-dev/gui/src/views/agents.jsx +36 -3
  38. package/node_modules/@groove-dev/gui/src/views/settings.jsx +104 -26
  39. package/node_modules/base64-arraybuffer/CHANGELOG.md +28 -0
  40. package/node_modules/base64-arraybuffer/LICENSE +22 -0
  41. package/node_modules/base64-arraybuffer/README.md +27 -0
  42. package/node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js +50 -0
  43. package/node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js.map +1 -0
  44. package/node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js +61 -0
  45. package/node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js.map +1 -0
  46. package/node_modules/base64-arraybuffer/dist/lib/index.js +48 -0
  47. package/node_modules/base64-arraybuffer/dist/lib/index.js.map +1 -0
  48. package/node_modules/base64-arraybuffer/dist/types/index.d.ts +2 -0
  49. package/node_modules/base64-arraybuffer/package.json +54 -0
  50. package/node_modules/base64-arraybuffer/rollup.config.ts +40 -0
  51. package/node_modules/css-line-break/CHANGELOG.md +58 -0
  52. package/node_modules/css-line-break/LICENSE +22 -0
  53. package/node_modules/css-line-break/README.md +66 -0
  54. package/node_modules/css-line-break/dist/css-line-break.es5.js +706 -0
  55. package/node_modules/css-line-break/dist/css-line-break.es5.js.map +1 -0
  56. package/node_modules/css-line-break/dist/css-line-break.umd.js +718 -0
  57. package/node_modules/css-line-break/dist/css-line-break.umd.js.map +1 -0
  58. package/node_modules/css-line-break/dist/lib/LineBreak.js +516 -0
  59. package/node_modules/css-line-break/dist/lib/LineBreak.js.map +1 -0
  60. package/node_modules/css-line-break/dist/lib/Util.js +109 -0
  61. package/node_modules/css-line-break/dist/lib/Util.js.map +1 -0
  62. package/node_modules/css-line-break/dist/lib/index.js +9 -0
  63. package/node_modules/css-line-break/dist/lib/index.js.map +1 -0
  64. package/node_modules/css-line-break/dist/lib/linebreak-trie.js +6 -0
  65. package/node_modules/css-line-break/dist/lib/linebreak-trie.js.map +1 -0
  66. package/node_modules/css-line-break/dist/types/LineBreak.d.ts +38 -0
  67. package/node_modules/css-line-break/dist/types/Util.d.ts +5 -0
  68. package/node_modules/css-line-break/dist/types/index.d.ts +2 -0
  69. package/node_modules/css-line-break/dist/types/linebreak-trie.d.ts +2 -0
  70. package/node_modules/css-line-break/package.json +61 -0
  71. package/node_modules/css-line-break/rollup.config.ts +40 -0
  72. package/node_modules/html2canvas/CHANGELOG.md +566 -0
  73. package/node_modules/html2canvas/LICENSE +22 -0
  74. package/node_modules/html2canvas/README.md +73 -0
  75. package/node_modules/html2canvas/dist/html2canvas.esm.js +7822 -0
  76. package/node_modules/html2canvas/dist/html2canvas.esm.js.map +1 -0
  77. package/node_modules/html2canvas/dist/html2canvas.js +7830 -0
  78. package/node_modules/html2canvas/dist/html2canvas.js.map +1 -0
  79. package/node_modules/html2canvas/dist/html2canvas.min.js +20 -0
  80. package/node_modules/html2canvas/dist/lib/__tests__/index.js +144 -0
  81. package/node_modules/html2canvas/dist/lib/__tests__/index.js.map +1 -0
  82. package/node_modules/html2canvas/dist/lib/core/__mocks__/cache-storage.js +10 -0
  83. package/node_modules/html2canvas/dist/lib/core/__mocks__/cache-storage.js.map +1 -0
  84. package/node_modules/html2canvas/dist/lib/core/__mocks__/context.js +22 -0
  85. package/node_modules/html2canvas/dist/lib/core/__mocks__/context.js.map +1 -0
  86. package/node_modules/html2canvas/dist/lib/core/__mocks__/features.js +12 -0
  87. package/node_modules/html2canvas/dist/lib/core/__mocks__/features.js.map +1 -0
  88. package/node_modules/html2canvas/dist/lib/core/__mocks__/logger.js +24 -0
  89. package/node_modules/html2canvas/dist/lib/core/__mocks__/logger.js.map +1 -0
  90. package/node_modules/html2canvas/dist/lib/core/__tests__/cache-storage.js +420 -0
  91. package/node_modules/html2canvas/dist/lib/core/__tests__/cache-storage.js.map +1 -0
  92. package/node_modules/html2canvas/dist/lib/core/__tests__/logger.js +28 -0
  93. package/node_modules/html2canvas/dist/lib/core/__tests__/logger.js.map +1 -0
  94. package/node_modules/html2canvas/dist/lib/core/bitwise.js +6 -0
  95. package/node_modules/html2canvas/dist/lib/core/bitwise.js.map +1 -0
  96. package/node_modules/html2canvas/dist/lib/core/cache-storage.js +198 -0
  97. package/node_modules/html2canvas/dist/lib/core/cache-storage.js.map +1 -0
  98. package/node_modules/html2canvas/dist/lib/core/context.js +18 -0
  99. package/node_modules/html2canvas/dist/lib/core/context.js.map +1 -0
  100. package/node_modules/html2canvas/dist/lib/core/debugger.js +25 -0
  101. package/node_modules/html2canvas/dist/lib/core/debugger.js.map +1 -0
  102. package/node_modules/html2canvas/dist/lib/core/features.js +193 -0
  103. package/node_modules/html2canvas/dist/lib/core/features.js.map +1 -0
  104. package/node_modules/html2canvas/dist/lib/core/logger.js +88 -0
  105. package/node_modules/html2canvas/dist/lib/core/logger.js.map +1 -0
  106. package/node_modules/html2canvas/dist/lib/core/util.js +5 -0
  107. package/node_modules/html2canvas/dist/lib/core/util.js.map +1 -0
  108. package/node_modules/html2canvas/dist/lib/css/IPropertyDescriptor.js +3 -0
  109. package/node_modules/html2canvas/dist/lib/css/IPropertyDescriptor.js.map +1 -0
  110. package/node_modules/html2canvas/dist/lib/css/ITypeDescriptor.js +3 -0
  111. package/node_modules/html2canvas/dist/lib/css/ITypeDescriptor.js.map +1 -0
  112. package/node_modules/html2canvas/dist/lib/css/index.js +216 -0
  113. package/node_modules/html2canvas/dist/lib/css/index.js.map +1 -0
  114. package/node_modules/html2canvas/dist/lib/css/layout/__mocks__/bounds.js +9 -0
  115. package/node_modules/html2canvas/dist/lib/css/layout/__mocks__/bounds.js.map +1 -0
  116. package/node_modules/html2canvas/dist/lib/css/layout/bounds.js +42 -0
  117. package/node_modules/html2canvas/dist/lib/css/layout/bounds.js.map +1 -0
  118. package/node_modules/html2canvas/dist/lib/css/layout/text.js +137 -0
  119. package/node_modules/html2canvas/dist/lib/css/layout/text.js.map +1 -0
  120. package/node_modules/html2canvas/dist/lib/css/property-descriptors/__tests__/background-tests.js +48 -0
  121. package/node_modules/html2canvas/dist/lib/css/property-descriptors/__tests__/background-tests.js.map +1 -0
  122. package/node_modules/html2canvas/dist/lib/css/property-descriptors/__tests__/font-family.js +25 -0
  123. package/node_modules/html2canvas/dist/lib/css/property-descriptors/__tests__/font-family.js.map +1 -0
  124. package/node_modules/html2canvas/dist/lib/css/property-descriptors/__tests__/paint-order.js +88 -0
  125. package/node_modules/html2canvas/dist/lib/css/property-descriptors/__tests__/paint-order.js.map +1 -0
  126. package/node_modules/html2canvas/dist/lib/css/property-descriptors/__tests__/text-shadow.js +94 -0
  127. package/node_modules/html2canvas/dist/lib/css/property-descriptors/__tests__/text-shadow.js.map +1 -0
  128. package/node_modules/html2canvas/dist/lib/css/property-descriptors/__tests__/transform-tests.js +18 -0
  129. package/node_modules/html2canvas/dist/lib/css/property-descriptors/__tests__/transform-tests.js.map +1 -0
  130. package/node_modules/html2canvas/dist/lib/css/property-descriptors/background-clip.js +24 -0
  131. package/node_modules/html2canvas/dist/lib/css/property-descriptors/background-clip.js.map +1 -0
  132. package/node_modules/html2canvas/dist/lib/css/property-descriptors/background-color.js +11 -0
  133. package/node_modules/html2canvas/dist/lib/css/property-descriptors/background-color.js.map +1 -0
  134. package/node_modules/html2canvas/dist/lib/css/property-descriptors/background-image.js +24 -0
  135. package/node_modules/html2canvas/dist/lib/css/property-descriptors/background-image.js.map +1 -0
  136. package/node_modules/html2canvas/dist/lib/css/property-descriptors/background-origin.js +24 -0
  137. package/node_modules/html2canvas/dist/lib/css/property-descriptors/background-origin.js.map +1 -0
  138. package/node_modules/html2canvas/dist/lib/css/property-descriptors/background-position.js +17 -0
  139. package/node_modules/html2canvas/dist/lib/css/property-descriptors/background-position.js.map +1 -0
  140. package/node_modules/html2canvas/dist/lib/css/property-descriptors/background-repeat.js +36 -0
  141. package/node_modules/html2canvas/dist/lib/css/property-descriptors/background-repeat.js.map +1 -0
  142. package/node_modules/html2canvas/dist/lib/css/property-descriptors/background-size.js +24 -0
  143. package/node_modules/html2canvas/dist/lib/css/property-descriptors/background-size.js.map +1 -0
  144. package/node_modules/html2canvas/dist/lib/css/property-descriptors/border-color.js +15 -0
  145. package/node_modules/html2canvas/dist/lib/css/property-descriptors/border-color.js.map +1 -0
  146. package/node_modules/html2canvas/dist/lib/css/property-descriptors/border-radius.js +18 -0
  147. package/node_modules/html2canvas/dist/lib/css/property-descriptors/border-radius.js.map +1 -0
  148. package/node_modules/html2canvas/dist/lib/css/property-descriptors/border-style.js +27 -0
  149. package/node_modules/html2canvas/dist/lib/css/property-descriptors/border-style.js.map +1 -0
  150. package/node_modules/html2canvas/dist/lib/css/property-descriptors/border-width.js +21 -0
  151. package/node_modules/html2canvas/dist/lib/css/property-descriptors/border-width.js.map +1 -0
  152. package/node_modules/html2canvas/dist/lib/css/property-descriptors/box-shadow.js +55 -0
  153. package/node_modules/html2canvas/dist/lib/css/property-descriptors/box-shadow.js.map +1 -0
  154. package/node_modules/html2canvas/dist/lib/css/property-descriptors/color.js +11 -0
  155. package/node_modules/html2canvas/dist/lib/css/property-descriptors/color.js.map +1 -0
  156. package/node_modules/html2canvas/dist/lib/css/property-descriptors/content.js +20 -0
  157. package/node_modules/html2canvas/dist/lib/css/property-descriptors/content.js.map +1 -0
  158. package/node_modules/html2canvas/dist/lib/css/property-descriptors/counter-increment.js +31 -0
  159. package/node_modules/html2canvas/dist/lib/css/property-descriptors/counter-increment.js.map +1 -0
  160. package/node_modules/html2canvas/dist/lib/css/property-descriptors/counter-reset.js +27 -0
  161. package/node_modules/html2canvas/dist/lib/css/property-descriptors/counter-reset.js.map +1 -0
  162. package/node_modules/html2canvas/dist/lib/css/property-descriptors/direction.js +19 -0
  163. package/node_modules/html2canvas/dist/lib/css/property-descriptors/direction.js.map +1 -0
  164. package/node_modules/html2canvas/dist/lib/css/property-descriptors/display.js +82 -0
  165. package/node_modules/html2canvas/dist/lib/css/property-descriptors/display.js.map +1 -0
  166. package/node_modules/html2canvas/dist/lib/css/property-descriptors/duration.js +15 -0
  167. package/node_modules/html2canvas/dist/lib/css/property-descriptors/duration.js.map +1 -0
  168. package/node_modules/html2canvas/dist/lib/css/property-descriptors/float.js +23 -0
  169. package/node_modules/html2canvas/dist/lib/css/property-descriptors/float.js.map +1 -0
  170. package/node_modules/html2canvas/dist/lib/css/property-descriptors/font-family.js +33 -0
  171. package/node_modules/html2canvas/dist/lib/css/property-descriptors/font-family.js.map +1 -0
  172. package/node_modules/html2canvas/dist/lib/css/property-descriptors/font-size.js +11 -0
  173. package/node_modules/html2canvas/dist/lib/css/property-descriptors/font-size.js.map +1 -0
  174. package/node_modules/html2canvas/dist/lib/css/property-descriptors/font-style.js +21 -0
  175. package/node_modules/html2canvas/dist/lib/css/property-descriptors/font-style.js.map +1 -0
  176. package/node_modules/html2canvas/dist/lib/css/property-descriptors/font-variant.js +14 -0
  177. package/node_modules/html2canvas/dist/lib/css/property-descriptors/font-variant.js.map +1 -0
  178. package/node_modules/html2canvas/dist/lib/css/property-descriptors/font-weight.js +26 -0
  179. package/node_modules/html2canvas/dist/lib/css/property-descriptors/font-weight.js.map +1 -0
  180. package/node_modules/html2canvas/dist/lib/css/property-descriptors/letter-spacing.js +22 -0
  181. package/node_modules/html2canvas/dist/lib/css/property-descriptors/letter-spacing.js.map +1 -0
  182. package/node_modules/html2canvas/dist/lib/css/property-descriptors/line-break.js +24 -0
  183. package/node_modules/html2canvas/dist/lib/css/property-descriptors/line-break.js.map +1 -0
  184. package/node_modules/html2canvas/dist/lib/css/property-descriptors/line-height.js +25 -0
  185. package/node_modules/html2canvas/dist/lib/css/property-descriptors/line-height.js.map +1 -0
  186. package/node_modules/html2canvas/dist/lib/css/property-descriptors/list-style-image.js +17 -0
  187. package/node_modules/html2canvas/dist/lib/css/property-descriptors/list-style-image.js.map +1 -0
  188. package/node_modules/html2canvas/dist/lib/css/property-descriptors/list-style-position.js +19 -0
  189. package/node_modules/html2canvas/dist/lib/css/property-descriptors/list-style-position.js.map +1 -0
  190. package/node_modules/html2canvas/dist/lib/css/property-descriptors/list-style-type.js +123 -0
  191. package/node_modules/html2canvas/dist/lib/css/property-descriptors/list-style-type.js.map +1 -0
  192. package/node_modules/html2canvas/dist/lib/css/property-descriptors/margin.js +14 -0
  193. package/node_modules/html2canvas/dist/lib/css/property-descriptors/margin.js.map +1 -0
  194. package/node_modules/html2canvas/dist/lib/css/property-descriptors/opacity.js +17 -0
  195. package/node_modules/html2canvas/dist/lib/css/property-descriptors/opacity.js.map +1 -0
  196. package/node_modules/html2canvas/dist/lib/css/property-descriptors/overflow-wrap.js +19 -0
  197. package/node_modules/html2canvas/dist/lib/css/property-descriptors/overflow-wrap.js.map +1 -0
  198. package/node_modules/html2canvas/dist/lib/css/property-descriptors/overflow.js +28 -0
  199. package/node_modules/html2canvas/dist/lib/css/property-descriptors/overflow.js.map +1 -0
  200. package/node_modules/html2canvas/dist/lib/css/property-descriptors/padding.js +15 -0
  201. package/node_modules/html2canvas/dist/lib/css/property-descriptors/padding.js.map +1 -0
  202. package/node_modules/html2canvas/dist/lib/css/property-descriptors/paint-order.js +34 -0
  203. package/node_modules/html2canvas/dist/lib/css/property-descriptors/paint-order.js.map +1 -0
  204. package/node_modules/html2canvas/dist/lib/css/property-descriptors/position.js +23 -0
  205. package/node_modules/html2canvas/dist/lib/css/property-descriptors/position.js.map +1 -0
  206. package/node_modules/html2canvas/dist/lib/css/property-descriptors/quotes.js +42 -0
  207. package/node_modules/html2canvas/dist/lib/css/property-descriptors/quotes.js.map +1 -0
  208. package/node_modules/html2canvas/dist/lib/css/property-descriptors/text-align.js +22 -0
  209. package/node_modules/html2canvas/dist/lib/css/property-descriptors/text-align.js.map +1 -0
  210. package/node_modules/html2canvas/dist/lib/css/property-descriptors/text-decoration-color.js +11 -0
  211. package/node_modules/html2canvas/dist/lib/css/property-descriptors/text-decoration-color.js.map +1 -0
  212. package/node_modules/html2canvas/dist/lib/css/property-descriptors/text-decoration-line.js +29 -0
  213. package/node_modules/html2canvas/dist/lib/css/property-descriptors/text-decoration-line.js.map +1 -0
  214. package/node_modules/html2canvas/dist/lib/css/property-descriptors/text-shadow.js +47 -0
  215. package/node_modules/html2canvas/dist/lib/css/property-descriptors/text-shadow.js.map +1 -0
  216. package/node_modules/html2canvas/dist/lib/css/property-descriptors/text-transform.js +21 -0
  217. package/node_modules/html2canvas/dist/lib/css/property-descriptors/text-transform.js.map +1 -0
  218. package/node_modules/html2canvas/dist/lib/css/property-descriptors/transform-origin.js +25 -0
  219. package/node_modules/html2canvas/dist/lib/css/property-descriptors/transform-origin.js.map +1 -0
  220. package/node_modules/html2canvas/dist/lib/css/property-descriptors/transform.js +37 -0
  221. package/node_modules/html2canvas/dist/lib/css/property-descriptors/transform.js.map +1 -0
  222. package/node_modules/html2canvas/dist/lib/css/property-descriptors/visibility.js +21 -0
  223. package/node_modules/html2canvas/dist/lib/css/property-descriptors/visibility.js.map +1 -0
  224. package/node_modules/html2canvas/dist/lib/css/property-descriptors/webkit-text-stroke-color.js +11 -0
  225. package/node_modules/html2canvas/dist/lib/css/property-descriptors/webkit-text-stroke-color.js.map +1 -0
  226. package/node_modules/html2canvas/dist/lib/css/property-descriptors/webkit-text-stroke-width.js +17 -0
  227. package/node_modules/html2canvas/dist/lib/css/property-descriptors/webkit-text-stroke-width.js.map +1 -0
  228. package/node_modules/html2canvas/dist/lib/css/property-descriptors/word-break.js +27 -0
  229. package/node_modules/html2canvas/dist/lib/css/property-descriptors/word-break.js.map +1 -0
  230. package/node_modules/html2canvas/dist/lib/css/property-descriptors/z-index.js +20 -0
  231. package/node_modules/html2canvas/dist/lib/css/property-descriptors/z-index.js.map +1 -0
  232. package/node_modules/html2canvas/dist/lib/css/syntax/__tests__/tokernizer-tests.js +34 -0
  233. package/node_modules/html2canvas/dist/lib/css/syntax/__tests__/tokernizer-tests.js.map +1 -0
  234. package/node_modules/html2canvas/dist/lib/css/syntax/parser.js +147 -0
  235. package/node_modules/html2canvas/dist/lib/css/syntax/parser.js.map +1 -0
  236. package/node_modules/html2canvas/dist/lib/css/syntax/tokenizer.js +630 -0
  237. package/node_modules/html2canvas/dist/lib/css/syntax/tokenizer.js.map +1 -0
  238. package/node_modules/html2canvas/dist/lib/css/types/__tests__/color-tests.js +66 -0
  239. package/node_modules/html2canvas/dist/lib/css/types/__tests__/color-tests.js.map +1 -0
  240. package/node_modules/html2canvas/dist/lib/css/types/__tests__/image-tests.js +233 -0
  241. package/node_modules/html2canvas/dist/lib/css/types/__tests__/image-tests.js.map +1 -0
  242. package/node_modules/html2canvas/dist/lib/css/types/angle.js +81 -0
  243. package/node_modules/html2canvas/dist/lib/css/types/angle.js.map +1 -0
  244. package/node_modules/html2canvas/dist/lib/css/types/color.js +288 -0
  245. package/node_modules/html2canvas/dist/lib/css/types/color.js.map +1 -0
  246. package/node_modules/html2canvas/dist/lib/css/types/functions/-prefix-linear-gradient.js +33 -0
  247. package/node_modules/html2canvas/dist/lib/css/types/functions/-prefix-linear-gradient.js.map +1 -0
  248. package/node_modules/html2canvas/dist/lib/css/types/functions/-prefix-radial-gradient.js +84 -0
  249. package/node_modules/html2canvas/dist/lib/css/types/functions/-prefix-radial-gradient.js.map +1 -0
  250. package/node_modules/html2canvas/dist/lib/css/types/functions/-webkit-gradient.js +60 -0
  251. package/node_modules/html2canvas/dist/lib/css/types/functions/-webkit-gradient.js.map +1 -0
  252. package/node_modules/html2canvas/dist/lib/css/types/functions/__tests__/radial-gradient.js +68 -0
  253. package/node_modules/html2canvas/dist/lib/css/types/functions/__tests__/radial-gradient.js.map +1 -0
  254. package/node_modules/html2canvas/dist/lib/css/types/functions/counter.js +374 -0
  255. package/node_modules/html2canvas/dist/lib/css/types/functions/counter.js.map +1 -0
  256. package/node_modules/html2canvas/dist/lib/css/types/functions/gradient.js +165 -0
  257. package/node_modules/html2canvas/dist/lib/css/types/functions/gradient.js.map +1 -0
  258. package/node_modules/html2canvas/dist/lib/css/types/functions/linear-gradient.js +28 -0
  259. package/node_modules/html2canvas/dist/lib/css/types/functions/linear-gradient.js.map +1 -0
  260. package/node_modules/html2canvas/dist/lib/css/types/functions/radial-gradient.js +91 -0
  261. package/node_modules/html2canvas/dist/lib/css/types/functions/radial-gradient.js.map +1 -0
  262. package/node_modules/html2canvas/dist/lib/css/types/image.js +53 -0
  263. package/node_modules/html2canvas/dist/lib/css/types/image.js.map +1 -0
  264. package/node_modules/html2canvas/dist/lib/css/types/index.js +3 -0
  265. package/node_modules/html2canvas/dist/lib/css/types/index.js.map +1 -0
  266. package/node_modules/html2canvas/dist/lib/css/types/length-percentage.js +52 -0
  267. package/node_modules/html2canvas/dist/lib/css/types/length-percentage.js.map +1 -0
  268. package/node_modules/html2canvas/dist/lib/css/types/length.js +8 -0
  269. package/node_modules/html2canvas/dist/lib/css/types/length.js.map +1 -0
  270. package/node_modules/html2canvas/dist/lib/css/types/time.js +18 -0
  271. package/node_modules/html2canvas/dist/lib/css/types/time.js.map +1 -0
  272. package/node_modules/html2canvas/dist/lib/dom/__mocks__/document-cloner.js +24 -0
  273. package/node_modules/html2canvas/dist/lib/dom/__mocks__/document-cloner.js.map +1 -0
  274. package/node_modules/html2canvas/dist/lib/dom/document-cloner.js +530 -0
  275. package/node_modules/html2canvas/dist/lib/dom/document-cloner.js.map +1 -0
  276. package/node_modules/html2canvas/dist/lib/dom/element-container.js +35 -0
  277. package/node_modules/html2canvas/dist/lib/dom/element-container.js.map +1 -0
  278. package/node_modules/html2canvas/dist/lib/dom/elements/li-element-container.js +30 -0
  279. package/node_modules/html2canvas/dist/lib/dom/elements/li-element-container.js.map +1 -0
  280. package/node_modules/html2canvas/dist/lib/dom/elements/ol-element-container.js +31 -0
  281. package/node_modules/html2canvas/dist/lib/dom/elements/ol-element-container.js.map +1 -0
  282. package/node_modules/html2canvas/dist/lib/dom/elements/select-element-container.js +31 -0
  283. package/node_modules/html2canvas/dist/lib/dom/elements/select-element-container.js.map +1 -0
  284. package/node_modules/html2canvas/dist/lib/dom/elements/textarea-element-container.js +30 -0
  285. package/node_modules/html2canvas/dist/lib/dom/elements/textarea-element-container.js.map +1 -0
  286. package/node_modules/html2canvas/dist/lib/dom/node-parser.js +142 -0
  287. package/node_modules/html2canvas/dist/lib/dom/node-parser.js.map +1 -0
  288. package/node_modules/html2canvas/dist/lib/dom/replaced-elements/canvas-element-container.js +32 -0
  289. package/node_modules/html2canvas/dist/lib/dom/replaced-elements/canvas-element-container.js.map +1 -0
  290. package/node_modules/html2canvas/dist/lib/dom/replaced-elements/iframe-element-container.js +55 -0
  291. package/node_modules/html2canvas/dist/lib/dom/replaced-elements/iframe-element-container.js.map +1 -0
  292. package/node_modules/html2canvas/dist/lib/dom/replaced-elements/image-element-container.js +33 -0
  293. package/node_modules/html2canvas/dist/lib/dom/replaced-elements/image-element-container.js.map +1 -0
  294. package/node_modules/html2canvas/dist/lib/dom/replaced-elements/index.js +3 -0
  295. package/node_modules/html2canvas/dist/lib/dom/replaced-elements/index.js.map +1 -0
  296. package/node_modules/html2canvas/dist/lib/dom/replaced-elements/input-element-container.js +102 -0
  297. package/node_modules/html2canvas/dist/lib/dom/replaced-elements/input-element-container.js.map +1 -0
  298. package/node_modules/html2canvas/dist/lib/dom/replaced-elements/pseudo-elements.js +1 -0
  299. package/node_modules/html2canvas/dist/lib/dom/replaced-elements/pseudo-elements.js.map +1 -0
  300. package/node_modules/html2canvas/dist/lib/dom/replaced-elements/svg-element-container.js +38 -0
  301. package/node_modules/html2canvas/dist/lib/dom/replaced-elements/svg-element-container.js.map +1 -0
  302. package/node_modules/html2canvas/dist/lib/dom/text-container.js +32 -0
  303. package/node_modules/html2canvas/dist/lib/dom/text-container.js.map +1 -0
  304. package/node_modules/html2canvas/dist/lib/index.js +181 -0
  305. package/node_modules/html2canvas/dist/lib/index.js.map +1 -0
  306. package/node_modules/html2canvas/dist/lib/invariant.js +10 -0
  307. package/node_modules/html2canvas/dist/lib/invariant.js.map +1 -0
  308. package/node_modules/html2canvas/dist/lib/render/background.js +187 -0
  309. package/node_modules/html2canvas/dist/lib/render/background.js.map +1 -0
  310. package/node_modules/html2canvas/dist/lib/render/bezier-curve.js +36 -0
  311. package/node_modules/html2canvas/dist/lib/render/bezier-curve.js.map +1 -0
  312. package/node_modules/html2canvas/dist/lib/render/border.js +105 -0
  313. package/node_modules/html2canvas/dist/lib/render/border.js.map +1 -0
  314. package/node_modules/html2canvas/dist/lib/render/bound-curves.js +190 -0
  315. package/node_modules/html2canvas/dist/lib/render/bound-curves.js.map +1 -0
  316. package/node_modules/html2canvas/dist/lib/render/box-sizing.js +21 -0
  317. package/node_modules/html2canvas/dist/lib/render/box-sizing.js.map +1 -0
  318. package/node_modules/html2canvas/dist/lib/render/canvas/canvas-renderer.js +1030 -0
  319. package/node_modules/html2canvas/dist/lib/render/canvas/canvas-renderer.js.map +1 -0
  320. package/node_modules/html2canvas/dist/lib/render/canvas/foreignobject-renderer.js +108 -0
  321. package/node_modules/html2canvas/dist/lib/render/canvas/foreignobject-renderer.js.map +1 -0
  322. package/node_modules/html2canvas/dist/lib/render/effects.js +41 -0
  323. package/node_modules/html2canvas/dist/lib/render/effects.js.map +1 -0
  324. package/node_modules/html2canvas/dist/lib/render/font-metrics.js +55 -0
  325. package/node_modules/html2canvas/dist/lib/render/font-metrics.js.map +1 -0
  326. package/node_modules/html2canvas/dist/lib/render/path.js +27 -0
  327. package/node_modules/html2canvas/dist/lib/render/path.js.map +1 -0
  328. package/node_modules/html2canvas/dist/lib/render/renderer.js +12 -0
  329. package/node_modules/html2canvas/dist/lib/render/renderer.js.map +1 -0
  330. package/node_modules/html2canvas/dist/lib/render/stacking-context.js +172 -0
  331. package/node_modules/html2canvas/dist/lib/render/stacking-context.js.map +1 -0
  332. package/node_modules/html2canvas/dist/lib/render/vector.js +18 -0
  333. package/node_modules/html2canvas/dist/lib/render/vector.js.map +1 -0
  334. package/node_modules/html2canvas/dist/types/__tests__/index.d.ts +1 -0
  335. package/node_modules/html2canvas/dist/types/core/__mocks__/cache-storage.d.ts +2 -0
  336. package/node_modules/html2canvas/dist/types/core/__mocks__/context.d.ts +9 -0
  337. package/node_modules/html2canvas/dist/types/core/__mocks__/features.d.ts +8 -0
  338. package/node_modules/html2canvas/dist/types/core/__mocks__/logger.d.ts +9 -0
  339. package/node_modules/html2canvas/dist/types/core/__tests__/cache-storage.d.ts +1 -0
  340. package/node_modules/html2canvas/dist/types/core/__tests__/logger.d.ts +1 -0
  341. package/node_modules/html2canvas/dist/types/core/bitwise.d.ts +1 -0
  342. package/node_modules/html2canvas/dist/types/core/cache-storage.d.ts +26 -0
  343. package/node_modules/html2canvas/dist/types/core/context.d.ts +15 -0
  344. package/node_modules/html2canvas/dist/types/core/debugger.d.ts +8 -0
  345. package/node_modules/html2canvas/dist/types/core/features.d.ts +12 -0
  346. package/node_modules/html2canvas/dist/types/core/logger.d.ts +18 -0
  347. package/node_modules/html2canvas/dist/types/core/util.d.ts +1 -0
  348. package/node_modules/html2canvas/dist/types/css/IPropertyDescriptor.d.ts +36 -0
  349. package/node_modules/html2canvas/dist/types/css/ITypeDescriptor.d.ts +6 -0
  350. package/node_modules/html2canvas/dist/types/css/index.d.ts +132 -0
  351. package/node_modules/html2canvas/dist/types/css/layout/__mocks__/bounds.d.ts +2 -0
  352. package/node_modules/html2canvas/dist/types/css/layout/bounds.d.ts +14 -0
  353. package/node_modules/html2canvas/dist/types/css/layout/text.d.ts +10 -0
  354. package/node_modules/html2canvas/dist/types/css/property-descriptors/__tests__/background-tests.d.ts +1 -0
  355. package/node_modules/html2canvas/dist/types/css/property-descriptors/__tests__/font-family.d.ts +1 -0
  356. package/node_modules/html2canvas/dist/types/css/property-descriptors/__tests__/paint-order.d.ts +1 -0
  357. package/node_modules/html2canvas/dist/types/css/property-descriptors/__tests__/text-shadow.d.ts +1 -0
  358. package/node_modules/html2canvas/dist/types/css/property-descriptors/__tests__/transform-tests.d.ts +1 -0
  359. package/node_modules/html2canvas/dist/types/css/property-descriptors/background-clip.d.ts +8 -0
  360. package/node_modules/html2canvas/dist/types/css/property-descriptors/background-color.d.ts +2 -0
  361. package/node_modules/html2canvas/dist/types/css/property-descriptors/background-image.d.ts +3 -0
  362. package/node_modules/html2canvas/dist/types/css/property-descriptors/background-origin.d.ts +8 -0
  363. package/node_modules/html2canvas/dist/types/css/property-descriptors/background-position.d.ts +5 -0
  364. package/node_modules/html2canvas/dist/types/css/property-descriptors/background-repeat.d.ts +9 -0
  365. package/node_modules/html2canvas/dist/types/css/property-descriptors/background-size.d.ts +11 -0
  366. package/node_modules/html2canvas/dist/types/css/property-descriptors/border-color.d.ts +5 -0
  367. package/node_modules/html2canvas/dist/types/css/property-descriptors/border-radius.d.ts +7 -0
  368. package/node_modules/html2canvas/dist/types/css/property-descriptors/border-style.d.ts +12 -0
  369. package/node_modules/html2canvas/dist/types/css/property-descriptors/border-width.d.ts +5 -0
  370. package/node_modules/html2canvas/dist/types/css/property-descriptors/box-shadow.d.ts +14 -0
  371. package/node_modules/html2canvas/dist/types/css/property-descriptors/color.d.ts +2 -0
  372. package/node_modules/html2canvas/dist/types/css/property-descriptors/content.d.ts +4 -0
  373. package/node_modules/html2canvas/dist/types/css/property-descriptors/counter-increment.d.ts +7 -0
  374. package/node_modules/html2canvas/dist/types/css/property-descriptors/counter-reset.d.ts +7 -0
  375. package/node_modules/html2canvas/dist/types/css/property-descriptors/direction.d.ts +6 -0
  376. package/node_modules/html2canvas/dist/types/css/property-descriptors/display.d.ts +35 -0
  377. package/node_modules/html2canvas/dist/types/css/property-descriptors/duration.d.ts +2 -0
  378. package/node_modules/html2canvas/dist/types/css/property-descriptors/float.d.ts +9 -0
  379. package/node_modules/html2canvas/dist/types/css/property-descriptors/font-family.d.ts +4 -0
  380. package/node_modules/html2canvas/dist/types/css/property-descriptors/font-size.d.ts +2 -0
  381. package/node_modules/html2canvas/dist/types/css/property-descriptors/font-style.d.ts +7 -0
  382. package/node_modules/html2canvas/dist/types/css/property-descriptors/font-variant.d.ts +2 -0
  383. package/node_modules/html2canvas/dist/types/css/property-descriptors/font-weight.d.ts +2 -0
  384. package/node_modules/html2canvas/dist/types/css/property-descriptors/letter-spacing.d.ts +2 -0
  385. package/node_modules/html2canvas/dist/types/css/property-descriptors/line-break.d.ts +6 -0
  386. package/node_modules/html2canvas/dist/types/css/property-descriptors/line-height.d.ts +4 -0
  387. package/node_modules/html2canvas/dist/types/css/property-descriptors/list-style-image.d.ts +3 -0
  388. package/node_modules/html2canvas/dist/types/css/property-descriptors/list-style-position.d.ts +6 -0
  389. package/node_modules/html2canvas/dist/types/css/property-descriptors/list-style-type.d.ts +58 -0
  390. package/node_modules/html2canvas/dist/types/css/property-descriptors/margin.d.ts +5 -0
  391. package/node_modules/html2canvas/dist/types/css/property-descriptors/opacity.d.ts +2 -0
  392. package/node_modules/html2canvas/dist/types/css/property-descriptors/overflow-wrap.d.ts +6 -0
  393. package/node_modules/html2canvas/dist/types/css/property-descriptors/overflow.d.ts +9 -0
  394. package/node_modules/html2canvas/dist/types/css/property-descriptors/padding.d.ts +5 -0
  395. package/node_modules/html2canvas/dist/types/css/property-descriptors/paint-order.d.ts +8 -0
  396. package/node_modules/html2canvas/dist/types/css/property-descriptors/position.d.ts +9 -0
  397. package/node_modules/html2canvas/dist/types/css/property-descriptors/quotes.d.ts +8 -0
  398. package/node_modules/html2canvas/dist/types/css/property-descriptors/text-align.d.ts +7 -0
  399. package/node_modules/html2canvas/dist/types/css/property-descriptors/text-decoration-color.d.ts +2 -0
  400. package/node_modules/html2canvas/dist/types/css/property-descriptors/text-decoration-line.d.ts +10 -0
  401. package/node_modules/html2canvas/dist/types/css/property-descriptors/text-shadow.d.ts +12 -0
  402. package/node_modules/html2canvas/dist/types/css/property-descriptors/text-transform.d.ts +8 -0
  403. package/node_modules/html2canvas/dist/types/css/property-descriptors/transform-origin.d.ts +4 -0
  404. package/node_modules/html2canvas/dist/types/css/property-descriptors/transform.d.ts +4 -0
  405. package/node_modules/html2canvas/dist/types/css/property-descriptors/visibility.d.ts +7 -0
  406. package/node_modules/html2canvas/dist/types/css/property-descriptors/webkit-text-stroke-color.d.ts +2 -0
  407. package/node_modules/html2canvas/dist/types/css/property-descriptors/webkit-text-stroke-width.d.ts +2 -0
  408. package/node_modules/html2canvas/dist/types/css/property-descriptors/word-break.d.ts +7 -0
  409. package/node_modules/html2canvas/dist/types/css/property-descriptors/z-index.d.ts +7 -0
  410. package/node_modules/html2canvas/dist/types/css/syntax/__tests__/tokernizer-tests.d.ts +1 -0
  411. package/node_modules/html2canvas/dist/types/css/syntax/parser.d.ts +34 -0
  412. package/node_modules/html2canvas/dist/types/css/syntax/tokenizer.d.ts +94 -0
  413. package/node_modules/html2canvas/dist/types/css/types/__tests__/color-tests.d.ts +1 -0
  414. package/node_modules/html2canvas/dist/types/css/types/__tests__/image-tests.d.ts +1 -0
  415. package/node_modules/html2canvas/dist/types/css/types/angle.d.ts +7 -0
  416. package/node_modules/html2canvas/dist/types/css/types/color.d.ts +11 -0
  417. package/node_modules/html2canvas/dist/types/css/types/functions/-prefix-linear-gradient.d.ts +4 -0
  418. package/node_modules/html2canvas/dist/types/css/types/functions/-prefix-radial-gradient.d.ts +4 -0
  419. package/node_modules/html2canvas/dist/types/css/types/functions/-webkit-gradient.d.ts +4 -0
  420. package/node_modules/html2canvas/dist/types/css/types/functions/__tests__/radial-gradient.d.ts +1 -0
  421. package/node_modules/html2canvas/dist/types/css/types/functions/counter.d.ts +10 -0
  422. package/node_modules/html2canvas/dist/types/css/types/functions/gradient.d.ts +7 -0
  423. package/node_modules/html2canvas/dist/types/css/types/functions/linear-gradient.d.ts +4 -0
  424. package/node_modules/html2canvas/dist/types/css/types/functions/radial-gradient.d.ts +12 -0
  425. package/node_modules/html2canvas/dist/types/css/types/image.d.ts +54 -0
  426. package/node_modules/html2canvas/dist/types/css/types/index.d.ts +1 -0
  427. package/node_modules/html2canvas/dist/types/css/types/length-percentage.d.ts +11 -0
  428. package/node_modules/html2canvas/dist/types/css/types/length.d.ts +4 -0
  429. package/node_modules/html2canvas/dist/types/css/types/time.d.ts +2 -0
  430. package/node_modules/html2canvas/dist/types/dom/__mocks__/document-cloner.d.ts +6 -0
  431. package/node_modules/html2canvas/dist/types/dom/document-cloner.d.ts +45 -0
  432. package/node_modules/html2canvas/dist/types/dom/element-container.d.ts +19 -0
  433. package/node_modules/html2canvas/dist/types/dom/elements/li-element-container.d.ts +6 -0
  434. package/node_modules/html2canvas/dist/types/dom/elements/ol-element-container.d.ts +7 -0
  435. package/node_modules/html2canvas/dist/types/dom/elements/select-element-container.d.ts +6 -0
  436. package/node_modules/html2canvas/dist/types/dom/elements/textarea-element-container.d.ts +6 -0
  437. package/node_modules/html2canvas/dist/types/dom/node-parser.d.ts +23 -0
  438. package/node_modules/html2canvas/dist/types/dom/replaced-elements/canvas-element-container.d.ts +8 -0
  439. package/node_modules/html2canvas/dist/types/dom/replaced-elements/iframe-element-container.d.ts +11 -0
  440. package/node_modules/html2canvas/dist/types/dom/replaced-elements/image-element-container.d.ts +8 -0
  441. package/node_modules/html2canvas/dist/types/dom/replaced-elements/index.d.ts +4 -0
  442. package/node_modules/html2canvas/dist/types/dom/replaced-elements/input-element-container.d.ts +12 -0
  443. package/node_modules/html2canvas/dist/types/dom/replaced-elements/pseudo-elements.d.ts +0 -0
  444. package/node_modules/html2canvas/dist/types/dom/replaced-elements/svg-element-container.d.ts +8 -0
  445. package/node_modules/html2canvas/dist/types/dom/text-container.d.ts +8 -0
  446. package/node_modules/html2canvas/dist/types/index.d.ts +10 -0
  447. package/node_modules/html2canvas/dist/types/invariant.d.ts +1 -0
  448. package/node_modules/html2canvas/dist/types/render/background.d.ts +16 -0
  449. package/node_modules/html2canvas/dist/types/render/bezier-curve.d.ts +14 -0
  450. package/node_modules/html2canvas/dist/types/render/border.d.ts +6 -0
  451. package/node_modules/html2canvas/dist/types/render/bound-curves.d.ts +32 -0
  452. package/node_modules/html2canvas/dist/types/render/box-sizing.d.ts +4 -0
  453. package/node_modules/html2canvas/dist/types/render/canvas/canvas-renderer.d.ts +53 -0
  454. package/node_modules/html2canvas/dist/types/render/canvas/foreignobject-renderer.d.ts +11 -0
  455. package/node_modules/html2canvas/dist/types/render/effects.d.ts +38 -0
  456. package/node_modules/html2canvas/dist/types/render/font-metrics.d.ts +11 -0
  457. package/node_modules/html2canvas/dist/types/render/path.d.ts +13 -0
  458. package/node_modules/html2canvas/dist/types/render/renderer.d.ts +7 -0
  459. package/node_modules/html2canvas/dist/types/render/stacking-context.d.ts +24 -0
  460. package/node_modules/html2canvas/dist/types/render/vector.d.ts +9 -0
  461. package/node_modules/html2canvas/package.json +124 -0
  462. package/node_modules/html2canvas/tsconfig.json +21 -0
  463. package/node_modules/text-segmentation/CHANGELOG.md +43 -0
  464. package/node_modules/text-segmentation/LICENSE +22 -0
  465. package/node_modules/text-segmentation/README.md +27 -0
  466. package/node_modules/text-segmentation/dist/lib/GraphemeBreak.js +218 -0
  467. package/node_modules/text-segmentation/dist/lib/GraphemeBreak.js.map +1 -0
  468. package/node_modules/text-segmentation/dist/lib/grapheme-break-trie.js +6 -0
  469. package/node_modules/text-segmentation/dist/lib/grapheme-break-trie.js.map +1 -0
  470. package/node_modules/text-segmentation/dist/lib/index.js +9 -0
  471. package/node_modules/text-segmentation/dist/lib/index.js.map +1 -0
  472. package/node_modules/text-segmentation/dist/text-segmentation.es5.js +384 -0
  473. package/node_modules/text-segmentation/dist/text-segmentation.es5.js.map +1 -0
  474. package/node_modules/text-segmentation/dist/text-segmentation.umd.js +397 -0
  475. package/node_modules/text-segmentation/dist/text-segmentation.umd.js.map +1 -0
  476. package/node_modules/text-segmentation/dist/types/GraphemeBreak.d.ts +21 -0
  477. package/node_modules/text-segmentation/dist/types/grapheme-break-trie.d.ts +2 -0
  478. package/node_modules/text-segmentation/dist/types/index.d.ts +1 -0
  479. package/node_modules/text-segmentation/package.json +55 -0
  480. package/node_modules/text-segmentation/rollup.config.ts +40 -0
  481. package/node_modules/utrie/CHANGELOG.md +32 -0
  482. package/node_modules/utrie/LICENSE +22 -0
  483. package/node_modules/utrie/dist/lib/Trie.js +143 -0
  484. package/node_modules/utrie/dist/lib/Trie.js.map +1 -0
  485. package/node_modules/utrie/dist/lib/TrieBuilder.js +888 -0
  486. package/node_modules/utrie/dist/lib/TrieBuilder.js.map +1 -0
  487. package/node_modules/utrie/dist/lib/Util.js +54 -0
  488. package/node_modules/utrie/dist/lib/Util.js.map +1 -0
  489. package/node_modules/utrie/dist/lib/index.js +10 -0
  490. package/node_modules/utrie/dist/lib/index.js.map +1 -0
  491. package/node_modules/utrie/dist/types/Trie.d.ts +76 -0
  492. package/node_modules/utrie/dist/types/TrieBuilder.d.ts +65 -0
  493. package/node_modules/utrie/dist/types/Util.d.ts +3 -0
  494. package/node_modules/utrie/dist/types/index.d.ts +2 -0
  495. package/node_modules/utrie/dist/utrie.es5.js +1101 -0
  496. package/node_modules/utrie/dist/utrie.es5.js.map +1 -0
  497. package/node_modules/utrie/dist/utrie.umd.js +1114 -0
  498. package/node_modules/utrie/dist/utrie.umd.js.map +1 -0
  499. package/node_modules/utrie/package.json +53 -0
  500. package/node_modules/utrie/rollup.config.ts +40 -0
  501. package/package.json +1 -1
  502. package/packages/cli/bin/groove.js +10 -1
  503. package/packages/cli/package.json +1 -1
  504. package/packages/cli/src/commands/connect.js +116 -205
  505. package/packages/cli/src/commands/disconnect.js +38 -62
  506. package/packages/cli/src/commands/remotes.js +75 -0
  507. package/packages/daemon/package.json +1 -1
  508. package/packages/daemon/src/api.js +115 -7
  509. package/packages/daemon/src/conversations.js +29 -3
  510. package/packages/daemon/src/process.js +56 -1
  511. package/packages/daemon/src/providers/codex.js +28 -10
  512. package/packages/daemon/src/registry.js +30 -0
  513. package/packages/daemon/src/validate.js +23 -0
  514. package/packages/gui/dist/assets/index-BSqk8cbI.css +1 -0
  515. package/packages/gui/dist/assets/index-B_igwWvq.js +8642 -0
  516. package/packages/gui/dist/index.html +2 -2
  517. package/packages/gui/package.json +2 -1
  518. package/packages/gui/src/components/agents/agent-file-tree.jsx +254 -0
  519. package/packages/gui/src/components/agents/code-review.jsx +177 -0
  520. package/packages/gui/src/components/agents/diff-viewer.jsx +148 -0
  521. package/packages/gui/src/components/agents/workspace-mode.jsx +377 -0
  522. package/packages/gui/src/components/chat/chat-input.jsx +117 -40
  523. package/packages/gui/src/components/chat/chat-messages.jsx +10 -13
  524. package/packages/gui/src/components/chat/chat-view.jsx +26 -1
  525. package/packages/gui/src/components/chat/conversation-list.jsx +14 -14
  526. package/packages/gui/src/components/chat/model-picker.jsx +5 -0
  527. package/packages/gui/src/components/preview/preview-workspace.jsx +6 -5
  528. package/packages/gui/src/components/preview/screenshot-overlay.jsx +41 -29
  529. package/packages/gui/src/stores/groove.js +138 -3
  530. package/packages/gui/src/views/agents.jsx +36 -3
  531. package/packages/gui/src/views/settings.jsx +104 -26
  532. package/test/doomsday-clock/index.html +55 -0
  533. package/test/doomsday-clock/script.js +66 -0
  534. package/test/doomsday-clock/style.css +315 -0
  535. package/node_modules/@groove-dev/gui/dist/assets/index-BbDDgazC.js +0 -8616
  536. package/node_modules/@groove-dev/gui/dist/assets/index-fhMxiPGp.css +0 -1
  537. package/packages/gui/dist/assets/index-BbDDgazC.js +0 -8616
  538. package/packages/gui/dist/assets/index-fhMxiPGp.css +0 -1
@@ -0,0 +1,1030 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
+ return new (P || (P = Promise))(function (resolve, reject) {
20
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
24
+ });
25
+ };
26
+ var __generator = (this && this.__generator) || function (thisArg, body) {
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
+ function verb(n) { return function (v) { return step([n, v]); }; }
30
+ function step(op) {
31
+ if (f) throw new TypeError("Generator is already executing.");
32
+ while (_) try {
33
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
+ if (y = 0, t) op = [op[0] & 2, t.value];
35
+ switch (op[0]) {
36
+ case 0: case 1: t = op; break;
37
+ case 4: _.label++; return { value: op[1], done: false };
38
+ case 5: _.label++; y = op[1]; op = [0]; continue;
39
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
+ default:
41
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
+ if (t[2]) _.ops.pop();
46
+ _.trys.pop(); continue;
47
+ }
48
+ op = body.call(thisArg, _);
49
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
+ }
52
+ };
53
+ Object.defineProperty(exports, "__esModule", { value: true });
54
+ exports.CanvasRenderer = void 0;
55
+ var stacking_context_1 = require("../stacking-context");
56
+ var color_1 = require("../../css/types/color");
57
+ var path_1 = require("../path");
58
+ var bound_curves_1 = require("../bound-curves");
59
+ var bezier_curve_1 = require("../bezier-curve");
60
+ var vector_1 = require("../vector");
61
+ var image_1 = require("../../css/types/image");
62
+ var border_1 = require("../border");
63
+ var background_1 = require("../background");
64
+ var parser_1 = require("../../css/syntax/parser");
65
+ var text_1 = require("../../css/layout/text");
66
+ var image_element_container_1 = require("../../dom/replaced-elements/image-element-container");
67
+ var box_sizing_1 = require("../box-sizing");
68
+ var canvas_element_container_1 = require("../../dom/replaced-elements/canvas-element-container");
69
+ var svg_element_container_1 = require("../../dom/replaced-elements/svg-element-container");
70
+ var effects_1 = require("../effects");
71
+ var bitwise_1 = require("../../core/bitwise");
72
+ var gradient_1 = require("../../css/types/functions/gradient");
73
+ var length_percentage_1 = require("../../css/types/length-percentage");
74
+ var font_metrics_1 = require("../font-metrics");
75
+ var bounds_1 = require("../../css/layout/bounds");
76
+ var line_height_1 = require("../../css/property-descriptors/line-height");
77
+ var input_element_container_1 = require("../../dom/replaced-elements/input-element-container");
78
+ var textarea_element_container_1 = require("../../dom/elements/textarea-element-container");
79
+ var select_element_container_1 = require("../../dom/elements/select-element-container");
80
+ var iframe_element_container_1 = require("../../dom/replaced-elements/iframe-element-container");
81
+ var renderer_1 = require("../renderer");
82
+ var MASK_OFFSET = 10000;
83
+ var CanvasRenderer = /** @class */ (function (_super) {
84
+ __extends(CanvasRenderer, _super);
85
+ function CanvasRenderer(context, options) {
86
+ var _this = _super.call(this, context, options) || this;
87
+ _this._activeEffects = [];
88
+ _this.canvas = options.canvas ? options.canvas : document.createElement('canvas');
89
+ _this.ctx = _this.canvas.getContext('2d');
90
+ if (!options.canvas) {
91
+ _this.canvas.width = Math.floor(options.width * options.scale);
92
+ _this.canvas.height = Math.floor(options.height * options.scale);
93
+ _this.canvas.style.width = options.width + "px";
94
+ _this.canvas.style.height = options.height + "px";
95
+ }
96
+ _this.fontMetrics = new font_metrics_1.FontMetrics(document);
97
+ _this.ctx.scale(_this.options.scale, _this.options.scale);
98
+ _this.ctx.translate(-options.x, -options.y);
99
+ _this.ctx.textBaseline = 'bottom';
100
+ _this._activeEffects = [];
101
+ _this.context.logger.debug("Canvas renderer initialized (" + options.width + "x" + options.height + ") with scale " + options.scale);
102
+ return _this;
103
+ }
104
+ CanvasRenderer.prototype.applyEffects = function (effects) {
105
+ var _this = this;
106
+ while (this._activeEffects.length) {
107
+ this.popEffect();
108
+ }
109
+ effects.forEach(function (effect) { return _this.applyEffect(effect); });
110
+ };
111
+ CanvasRenderer.prototype.applyEffect = function (effect) {
112
+ this.ctx.save();
113
+ if (effects_1.isOpacityEffect(effect)) {
114
+ this.ctx.globalAlpha = effect.opacity;
115
+ }
116
+ if (effects_1.isTransformEffect(effect)) {
117
+ this.ctx.translate(effect.offsetX, effect.offsetY);
118
+ this.ctx.transform(effect.matrix[0], effect.matrix[1], effect.matrix[2], effect.matrix[3], effect.matrix[4], effect.matrix[5]);
119
+ this.ctx.translate(-effect.offsetX, -effect.offsetY);
120
+ }
121
+ if (effects_1.isClipEffect(effect)) {
122
+ this.path(effect.path);
123
+ this.ctx.clip();
124
+ }
125
+ this._activeEffects.push(effect);
126
+ };
127
+ CanvasRenderer.prototype.popEffect = function () {
128
+ this._activeEffects.pop();
129
+ this.ctx.restore();
130
+ };
131
+ CanvasRenderer.prototype.renderStack = function (stack) {
132
+ return __awaiter(this, void 0, void 0, function () {
133
+ var styles;
134
+ return __generator(this, function (_a) {
135
+ switch (_a.label) {
136
+ case 0:
137
+ styles = stack.element.container.styles;
138
+ if (!styles.isVisible()) return [3 /*break*/, 2];
139
+ return [4 /*yield*/, this.renderStackContent(stack)];
140
+ case 1:
141
+ _a.sent();
142
+ _a.label = 2;
143
+ case 2: return [2 /*return*/];
144
+ }
145
+ });
146
+ });
147
+ };
148
+ CanvasRenderer.prototype.renderNode = function (paint) {
149
+ return __awaiter(this, void 0, void 0, function () {
150
+ return __generator(this, function (_a) {
151
+ switch (_a.label) {
152
+ case 0:
153
+ if (bitwise_1.contains(paint.container.flags, 16 /* DEBUG_RENDER */)) {
154
+ debugger;
155
+ }
156
+ if (!paint.container.styles.isVisible()) return [3 /*break*/, 3];
157
+ return [4 /*yield*/, this.renderNodeBackgroundAndBorders(paint)];
158
+ case 1:
159
+ _a.sent();
160
+ return [4 /*yield*/, this.renderNodeContent(paint)];
161
+ case 2:
162
+ _a.sent();
163
+ _a.label = 3;
164
+ case 3: return [2 /*return*/];
165
+ }
166
+ });
167
+ });
168
+ };
169
+ CanvasRenderer.prototype.renderTextWithLetterSpacing = function (text, letterSpacing, baseline) {
170
+ var _this = this;
171
+ if (letterSpacing === 0) {
172
+ this.ctx.fillText(text.text, text.bounds.left, text.bounds.top + baseline);
173
+ }
174
+ else {
175
+ var letters = text_1.segmentGraphemes(text.text);
176
+ letters.reduce(function (left, letter) {
177
+ _this.ctx.fillText(letter, left, text.bounds.top + baseline);
178
+ return left + _this.ctx.measureText(letter).width;
179
+ }, text.bounds.left);
180
+ }
181
+ };
182
+ CanvasRenderer.prototype.createFontStyle = function (styles) {
183
+ var fontVariant = styles.fontVariant
184
+ .filter(function (variant) { return variant === 'normal' || variant === 'small-caps'; })
185
+ .join('');
186
+ var fontFamily = fixIOSSystemFonts(styles.fontFamily).join(', ');
187
+ var fontSize = parser_1.isDimensionToken(styles.fontSize)
188
+ ? "" + styles.fontSize.number + styles.fontSize.unit
189
+ : styles.fontSize.number + "px";
190
+ return [
191
+ [styles.fontStyle, fontVariant, styles.fontWeight, fontSize, fontFamily].join(' '),
192
+ fontFamily,
193
+ fontSize
194
+ ];
195
+ };
196
+ CanvasRenderer.prototype.renderTextNode = function (text, styles) {
197
+ return __awaiter(this, void 0, void 0, function () {
198
+ var _a, font, fontFamily, fontSize, _b, baseline, middle, paintOrder;
199
+ var _this = this;
200
+ return __generator(this, function (_c) {
201
+ _a = this.createFontStyle(styles), font = _a[0], fontFamily = _a[1], fontSize = _a[2];
202
+ this.ctx.font = font;
203
+ this.ctx.direction = styles.direction === 1 /* RTL */ ? 'rtl' : 'ltr';
204
+ this.ctx.textAlign = 'left';
205
+ this.ctx.textBaseline = 'alphabetic';
206
+ _b = this.fontMetrics.getMetrics(fontFamily, fontSize), baseline = _b.baseline, middle = _b.middle;
207
+ paintOrder = styles.paintOrder;
208
+ text.textBounds.forEach(function (text) {
209
+ paintOrder.forEach(function (paintOrderLayer) {
210
+ switch (paintOrderLayer) {
211
+ case 0 /* FILL */:
212
+ _this.ctx.fillStyle = color_1.asString(styles.color);
213
+ _this.renderTextWithLetterSpacing(text, styles.letterSpacing, baseline);
214
+ var textShadows = styles.textShadow;
215
+ if (textShadows.length && text.text.trim().length) {
216
+ textShadows
217
+ .slice(0)
218
+ .reverse()
219
+ .forEach(function (textShadow) {
220
+ _this.ctx.shadowColor = color_1.asString(textShadow.color);
221
+ _this.ctx.shadowOffsetX = textShadow.offsetX.number * _this.options.scale;
222
+ _this.ctx.shadowOffsetY = textShadow.offsetY.number * _this.options.scale;
223
+ _this.ctx.shadowBlur = textShadow.blur.number;
224
+ _this.renderTextWithLetterSpacing(text, styles.letterSpacing, baseline);
225
+ });
226
+ _this.ctx.shadowColor = '';
227
+ _this.ctx.shadowOffsetX = 0;
228
+ _this.ctx.shadowOffsetY = 0;
229
+ _this.ctx.shadowBlur = 0;
230
+ }
231
+ if (styles.textDecorationLine.length) {
232
+ _this.ctx.fillStyle = color_1.asString(styles.textDecorationColor || styles.color);
233
+ styles.textDecorationLine.forEach(function (textDecorationLine) {
234
+ switch (textDecorationLine) {
235
+ case 1 /* UNDERLINE */:
236
+ // Draws a line at the baseline of the font
237
+ // TODO As some browsers display the line as more than 1px if the font-size is big,
238
+ // need to take that into account both in position and size
239
+ _this.ctx.fillRect(text.bounds.left, Math.round(text.bounds.top + baseline), text.bounds.width, 1);
240
+ break;
241
+ case 2 /* OVERLINE */:
242
+ _this.ctx.fillRect(text.bounds.left, Math.round(text.bounds.top), text.bounds.width, 1);
243
+ break;
244
+ case 3 /* LINE_THROUGH */:
245
+ // TODO try and find exact position for line-through
246
+ _this.ctx.fillRect(text.bounds.left, Math.ceil(text.bounds.top + middle), text.bounds.width, 1);
247
+ break;
248
+ }
249
+ });
250
+ }
251
+ break;
252
+ case 1 /* STROKE */:
253
+ if (styles.webkitTextStrokeWidth && text.text.trim().length) {
254
+ _this.ctx.strokeStyle = color_1.asString(styles.webkitTextStrokeColor);
255
+ _this.ctx.lineWidth = styles.webkitTextStrokeWidth;
256
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
257
+ _this.ctx.lineJoin = !!window.chrome ? 'miter' : 'round';
258
+ _this.ctx.strokeText(text.text, text.bounds.left, text.bounds.top + baseline);
259
+ }
260
+ _this.ctx.strokeStyle = '';
261
+ _this.ctx.lineWidth = 0;
262
+ _this.ctx.lineJoin = 'miter';
263
+ break;
264
+ }
265
+ });
266
+ });
267
+ return [2 /*return*/];
268
+ });
269
+ });
270
+ };
271
+ CanvasRenderer.prototype.renderReplacedElement = function (container, curves, image) {
272
+ if (image && container.intrinsicWidth > 0 && container.intrinsicHeight > 0) {
273
+ var box = box_sizing_1.contentBox(container);
274
+ var path = bound_curves_1.calculatePaddingBoxPath(curves);
275
+ this.path(path);
276
+ this.ctx.save();
277
+ this.ctx.clip();
278
+ this.ctx.drawImage(image, 0, 0, container.intrinsicWidth, container.intrinsicHeight, box.left, box.top, box.width, box.height);
279
+ this.ctx.restore();
280
+ }
281
+ };
282
+ CanvasRenderer.prototype.renderNodeContent = function (paint) {
283
+ return __awaiter(this, void 0, void 0, function () {
284
+ var container, curves, styles, _i, _a, child, image, e_1, image, e_2, iframeRenderer, canvas, size, _b, fontFamily, fontSize, baseline, bounds, x, textBounds, img, image, url, e_3, fontFamily, bounds;
285
+ return __generator(this, function (_c) {
286
+ switch (_c.label) {
287
+ case 0:
288
+ this.applyEffects(paint.getEffects(4 /* CONTENT */));
289
+ container = paint.container;
290
+ curves = paint.curves;
291
+ styles = container.styles;
292
+ _i = 0, _a = container.textNodes;
293
+ _c.label = 1;
294
+ case 1:
295
+ if (!(_i < _a.length)) return [3 /*break*/, 4];
296
+ child = _a[_i];
297
+ return [4 /*yield*/, this.renderTextNode(child, styles)];
298
+ case 2:
299
+ _c.sent();
300
+ _c.label = 3;
301
+ case 3:
302
+ _i++;
303
+ return [3 /*break*/, 1];
304
+ case 4:
305
+ if (!(container instanceof image_element_container_1.ImageElementContainer)) return [3 /*break*/, 8];
306
+ _c.label = 5;
307
+ case 5:
308
+ _c.trys.push([5, 7, , 8]);
309
+ return [4 /*yield*/, this.context.cache.match(container.src)];
310
+ case 6:
311
+ image = _c.sent();
312
+ this.renderReplacedElement(container, curves, image);
313
+ return [3 /*break*/, 8];
314
+ case 7:
315
+ e_1 = _c.sent();
316
+ this.context.logger.error("Error loading image " + container.src);
317
+ return [3 /*break*/, 8];
318
+ case 8:
319
+ if (container instanceof canvas_element_container_1.CanvasElementContainer) {
320
+ this.renderReplacedElement(container, curves, container.canvas);
321
+ }
322
+ if (!(container instanceof svg_element_container_1.SVGElementContainer)) return [3 /*break*/, 12];
323
+ _c.label = 9;
324
+ case 9:
325
+ _c.trys.push([9, 11, , 12]);
326
+ return [4 /*yield*/, this.context.cache.match(container.svg)];
327
+ case 10:
328
+ image = _c.sent();
329
+ this.renderReplacedElement(container, curves, image);
330
+ return [3 /*break*/, 12];
331
+ case 11:
332
+ e_2 = _c.sent();
333
+ this.context.logger.error("Error loading svg " + container.svg.substring(0, 255));
334
+ return [3 /*break*/, 12];
335
+ case 12:
336
+ if (!(container instanceof iframe_element_container_1.IFrameElementContainer && container.tree)) return [3 /*break*/, 14];
337
+ iframeRenderer = new CanvasRenderer(this.context, {
338
+ scale: this.options.scale,
339
+ backgroundColor: container.backgroundColor,
340
+ x: 0,
341
+ y: 0,
342
+ width: container.width,
343
+ height: container.height
344
+ });
345
+ return [4 /*yield*/, iframeRenderer.render(container.tree)];
346
+ case 13:
347
+ canvas = _c.sent();
348
+ if (container.width && container.height) {
349
+ this.ctx.drawImage(canvas, 0, 0, container.width, container.height, container.bounds.left, container.bounds.top, container.bounds.width, container.bounds.height);
350
+ }
351
+ _c.label = 14;
352
+ case 14:
353
+ if (container instanceof input_element_container_1.InputElementContainer) {
354
+ size = Math.min(container.bounds.width, container.bounds.height);
355
+ if (container.type === input_element_container_1.CHECKBOX) {
356
+ if (container.checked) {
357
+ this.ctx.save();
358
+ this.path([
359
+ new vector_1.Vector(container.bounds.left + size * 0.39363, container.bounds.top + size * 0.79),
360
+ new vector_1.Vector(container.bounds.left + size * 0.16, container.bounds.top + size * 0.5549),
361
+ new vector_1.Vector(container.bounds.left + size * 0.27347, container.bounds.top + size * 0.44071),
362
+ new vector_1.Vector(container.bounds.left + size * 0.39694, container.bounds.top + size * 0.5649),
363
+ new vector_1.Vector(container.bounds.left + size * 0.72983, container.bounds.top + size * 0.23),
364
+ new vector_1.Vector(container.bounds.left + size * 0.84, container.bounds.top + size * 0.34085),
365
+ new vector_1.Vector(container.bounds.left + size * 0.39363, container.bounds.top + size * 0.79)
366
+ ]);
367
+ this.ctx.fillStyle = color_1.asString(input_element_container_1.INPUT_COLOR);
368
+ this.ctx.fill();
369
+ this.ctx.restore();
370
+ }
371
+ }
372
+ else if (container.type === input_element_container_1.RADIO) {
373
+ if (container.checked) {
374
+ this.ctx.save();
375
+ this.ctx.beginPath();
376
+ this.ctx.arc(container.bounds.left + size / 2, container.bounds.top + size / 2, size / 4, 0, Math.PI * 2, true);
377
+ this.ctx.fillStyle = color_1.asString(input_element_container_1.INPUT_COLOR);
378
+ this.ctx.fill();
379
+ this.ctx.restore();
380
+ }
381
+ }
382
+ }
383
+ if (isTextInputElement(container) && container.value.length) {
384
+ _b = this.createFontStyle(styles), fontFamily = _b[0], fontSize = _b[1];
385
+ baseline = this.fontMetrics.getMetrics(fontFamily, fontSize).baseline;
386
+ this.ctx.font = fontFamily;
387
+ this.ctx.fillStyle = color_1.asString(styles.color);
388
+ this.ctx.textBaseline = 'alphabetic';
389
+ this.ctx.textAlign = canvasTextAlign(container.styles.textAlign);
390
+ bounds = box_sizing_1.contentBox(container);
391
+ x = 0;
392
+ switch (container.styles.textAlign) {
393
+ case 1 /* CENTER */:
394
+ x += bounds.width / 2;
395
+ break;
396
+ case 2 /* RIGHT */:
397
+ x += bounds.width;
398
+ break;
399
+ }
400
+ textBounds = bounds.add(x, 0, 0, -bounds.height / 2 + 1);
401
+ this.ctx.save();
402
+ this.path([
403
+ new vector_1.Vector(bounds.left, bounds.top),
404
+ new vector_1.Vector(bounds.left + bounds.width, bounds.top),
405
+ new vector_1.Vector(bounds.left + bounds.width, bounds.top + bounds.height),
406
+ new vector_1.Vector(bounds.left, bounds.top + bounds.height)
407
+ ]);
408
+ this.ctx.clip();
409
+ this.renderTextWithLetterSpacing(new text_1.TextBounds(container.value, textBounds), styles.letterSpacing, baseline);
410
+ this.ctx.restore();
411
+ this.ctx.textBaseline = 'alphabetic';
412
+ this.ctx.textAlign = 'left';
413
+ }
414
+ if (!bitwise_1.contains(container.styles.display, 2048 /* LIST_ITEM */)) return [3 /*break*/, 20];
415
+ if (!(container.styles.listStyleImage !== null)) return [3 /*break*/, 19];
416
+ img = container.styles.listStyleImage;
417
+ if (!(img.type === 0 /* URL */)) return [3 /*break*/, 18];
418
+ image = void 0;
419
+ url = img.url;
420
+ _c.label = 15;
421
+ case 15:
422
+ _c.trys.push([15, 17, , 18]);
423
+ return [4 /*yield*/, this.context.cache.match(url)];
424
+ case 16:
425
+ image = _c.sent();
426
+ this.ctx.drawImage(image, container.bounds.left - (image.width + 10), container.bounds.top);
427
+ return [3 /*break*/, 18];
428
+ case 17:
429
+ e_3 = _c.sent();
430
+ this.context.logger.error("Error loading list-style-image " + url);
431
+ return [3 /*break*/, 18];
432
+ case 18: return [3 /*break*/, 20];
433
+ case 19:
434
+ if (paint.listValue && container.styles.listStyleType !== -1 /* NONE */) {
435
+ fontFamily = this.createFontStyle(styles)[0];
436
+ this.ctx.font = fontFamily;
437
+ this.ctx.fillStyle = color_1.asString(styles.color);
438
+ this.ctx.textBaseline = 'middle';
439
+ this.ctx.textAlign = 'right';
440
+ bounds = new bounds_1.Bounds(container.bounds.left, container.bounds.top + length_percentage_1.getAbsoluteValue(container.styles.paddingTop, container.bounds.width), container.bounds.width, line_height_1.computeLineHeight(styles.lineHeight, styles.fontSize.number) / 2 + 1);
441
+ this.renderTextWithLetterSpacing(new text_1.TextBounds(paint.listValue, bounds), styles.letterSpacing, line_height_1.computeLineHeight(styles.lineHeight, styles.fontSize.number) / 2 + 2);
442
+ this.ctx.textBaseline = 'bottom';
443
+ this.ctx.textAlign = 'left';
444
+ }
445
+ _c.label = 20;
446
+ case 20: return [2 /*return*/];
447
+ }
448
+ });
449
+ });
450
+ };
451
+ CanvasRenderer.prototype.renderStackContent = function (stack) {
452
+ return __awaiter(this, void 0, void 0, function () {
453
+ var _i, _a, child, _b, _c, child, _d, _e, child, _f, _g, child, _h, _j, child, _k, _l, child, _m, _o, child;
454
+ return __generator(this, function (_p) {
455
+ switch (_p.label) {
456
+ case 0:
457
+ if (bitwise_1.contains(stack.element.container.flags, 16 /* DEBUG_RENDER */)) {
458
+ debugger;
459
+ }
460
+ // https://www.w3.org/TR/css-position-3/#painting-order
461
+ // 1. the background and borders of the element forming the stacking context.
462
+ return [4 /*yield*/, this.renderNodeBackgroundAndBorders(stack.element)];
463
+ case 1:
464
+ // https://www.w3.org/TR/css-position-3/#painting-order
465
+ // 1. the background and borders of the element forming the stacking context.
466
+ _p.sent();
467
+ _i = 0, _a = stack.negativeZIndex;
468
+ _p.label = 2;
469
+ case 2:
470
+ if (!(_i < _a.length)) return [3 /*break*/, 5];
471
+ child = _a[_i];
472
+ return [4 /*yield*/, this.renderStack(child)];
473
+ case 3:
474
+ _p.sent();
475
+ _p.label = 4;
476
+ case 4:
477
+ _i++;
478
+ return [3 /*break*/, 2];
479
+ case 5:
480
+ // 3. For all its in-flow, non-positioned, block-level descendants in tree order:
481
+ return [4 /*yield*/, this.renderNodeContent(stack.element)];
482
+ case 6:
483
+ // 3. For all its in-flow, non-positioned, block-level descendants in tree order:
484
+ _p.sent();
485
+ _b = 0, _c = stack.nonInlineLevel;
486
+ _p.label = 7;
487
+ case 7:
488
+ if (!(_b < _c.length)) return [3 /*break*/, 10];
489
+ child = _c[_b];
490
+ return [4 /*yield*/, this.renderNode(child)];
491
+ case 8:
492
+ _p.sent();
493
+ _p.label = 9;
494
+ case 9:
495
+ _b++;
496
+ return [3 /*break*/, 7];
497
+ case 10:
498
+ _d = 0, _e = stack.nonPositionedFloats;
499
+ _p.label = 11;
500
+ case 11:
501
+ if (!(_d < _e.length)) return [3 /*break*/, 14];
502
+ child = _e[_d];
503
+ return [4 /*yield*/, this.renderStack(child)];
504
+ case 12:
505
+ _p.sent();
506
+ _p.label = 13;
507
+ case 13:
508
+ _d++;
509
+ return [3 /*break*/, 11];
510
+ case 14:
511
+ _f = 0, _g = stack.nonPositionedInlineLevel;
512
+ _p.label = 15;
513
+ case 15:
514
+ if (!(_f < _g.length)) return [3 /*break*/, 18];
515
+ child = _g[_f];
516
+ return [4 /*yield*/, this.renderStack(child)];
517
+ case 16:
518
+ _p.sent();
519
+ _p.label = 17;
520
+ case 17:
521
+ _f++;
522
+ return [3 /*break*/, 15];
523
+ case 18:
524
+ _h = 0, _j = stack.inlineLevel;
525
+ _p.label = 19;
526
+ case 19:
527
+ if (!(_h < _j.length)) return [3 /*break*/, 22];
528
+ child = _j[_h];
529
+ return [4 /*yield*/, this.renderNode(child)];
530
+ case 20:
531
+ _p.sent();
532
+ _p.label = 21;
533
+ case 21:
534
+ _h++;
535
+ return [3 /*break*/, 19];
536
+ case 22:
537
+ _k = 0, _l = stack.zeroOrAutoZIndexOrTransformedOrOpacity;
538
+ _p.label = 23;
539
+ case 23:
540
+ if (!(_k < _l.length)) return [3 /*break*/, 26];
541
+ child = _l[_k];
542
+ return [4 /*yield*/, this.renderStack(child)];
543
+ case 24:
544
+ _p.sent();
545
+ _p.label = 25;
546
+ case 25:
547
+ _k++;
548
+ return [3 /*break*/, 23];
549
+ case 26:
550
+ _m = 0, _o = stack.positiveZIndex;
551
+ _p.label = 27;
552
+ case 27:
553
+ if (!(_m < _o.length)) return [3 /*break*/, 30];
554
+ child = _o[_m];
555
+ return [4 /*yield*/, this.renderStack(child)];
556
+ case 28:
557
+ _p.sent();
558
+ _p.label = 29;
559
+ case 29:
560
+ _m++;
561
+ return [3 /*break*/, 27];
562
+ case 30: return [2 /*return*/];
563
+ }
564
+ });
565
+ });
566
+ };
567
+ CanvasRenderer.prototype.mask = function (paths) {
568
+ this.ctx.beginPath();
569
+ this.ctx.moveTo(0, 0);
570
+ this.ctx.lineTo(this.canvas.width, 0);
571
+ this.ctx.lineTo(this.canvas.width, this.canvas.height);
572
+ this.ctx.lineTo(0, this.canvas.height);
573
+ this.ctx.lineTo(0, 0);
574
+ this.formatPath(paths.slice(0).reverse());
575
+ this.ctx.closePath();
576
+ };
577
+ CanvasRenderer.prototype.path = function (paths) {
578
+ this.ctx.beginPath();
579
+ this.formatPath(paths);
580
+ this.ctx.closePath();
581
+ };
582
+ CanvasRenderer.prototype.formatPath = function (paths) {
583
+ var _this = this;
584
+ paths.forEach(function (point, index) {
585
+ var start = bezier_curve_1.isBezierCurve(point) ? point.start : point;
586
+ if (index === 0) {
587
+ _this.ctx.moveTo(start.x, start.y);
588
+ }
589
+ else {
590
+ _this.ctx.lineTo(start.x, start.y);
591
+ }
592
+ if (bezier_curve_1.isBezierCurve(point)) {
593
+ _this.ctx.bezierCurveTo(point.startControl.x, point.startControl.y, point.endControl.x, point.endControl.y, point.end.x, point.end.y);
594
+ }
595
+ });
596
+ };
597
+ CanvasRenderer.prototype.renderRepeat = function (path, pattern, offsetX, offsetY) {
598
+ this.path(path);
599
+ this.ctx.fillStyle = pattern;
600
+ this.ctx.translate(offsetX, offsetY);
601
+ this.ctx.fill();
602
+ this.ctx.translate(-offsetX, -offsetY);
603
+ };
604
+ CanvasRenderer.prototype.resizeImage = function (image, width, height) {
605
+ var _a;
606
+ if (image.width === width && image.height === height) {
607
+ return image;
608
+ }
609
+ var ownerDocument = (_a = this.canvas.ownerDocument) !== null && _a !== void 0 ? _a : document;
610
+ var canvas = ownerDocument.createElement('canvas');
611
+ canvas.width = Math.max(1, width);
612
+ canvas.height = Math.max(1, height);
613
+ var ctx = canvas.getContext('2d');
614
+ ctx.drawImage(image, 0, 0, image.width, image.height, 0, 0, width, height);
615
+ return canvas;
616
+ };
617
+ CanvasRenderer.prototype.renderBackgroundImage = function (container) {
618
+ return __awaiter(this, void 0, void 0, function () {
619
+ var index, _loop_1, this_1, _i, _a, backgroundImage;
620
+ return __generator(this, function (_b) {
621
+ switch (_b.label) {
622
+ case 0:
623
+ index = container.styles.backgroundImage.length - 1;
624
+ _loop_1 = function (backgroundImage) {
625
+ var image, url, e_4, _c, path, x, y, width, height, pattern, _d, path, x, y, width, height, _e, lineLength, x0, x1, y0, y1, canvas, ctx, gradient_2, pattern, _f, path, left, top_1, width, height, position, x, y, _g, rx, ry, radialGradient_1, midX, midY, f, invF;
626
+ return __generator(this, function (_h) {
627
+ switch (_h.label) {
628
+ case 0:
629
+ if (!(backgroundImage.type === 0 /* URL */)) return [3 /*break*/, 5];
630
+ image = void 0;
631
+ url = backgroundImage.url;
632
+ _h.label = 1;
633
+ case 1:
634
+ _h.trys.push([1, 3, , 4]);
635
+ return [4 /*yield*/, this_1.context.cache.match(url)];
636
+ case 2:
637
+ image = _h.sent();
638
+ return [3 /*break*/, 4];
639
+ case 3:
640
+ e_4 = _h.sent();
641
+ this_1.context.logger.error("Error loading background-image " + url);
642
+ return [3 /*break*/, 4];
643
+ case 4:
644
+ if (image) {
645
+ _c = background_1.calculateBackgroundRendering(container, index, [
646
+ image.width,
647
+ image.height,
648
+ image.width / image.height
649
+ ]), path = _c[0], x = _c[1], y = _c[2], width = _c[3], height = _c[4];
650
+ pattern = this_1.ctx.createPattern(this_1.resizeImage(image, width, height), 'repeat');
651
+ this_1.renderRepeat(path, pattern, x, y);
652
+ }
653
+ return [3 /*break*/, 6];
654
+ case 5:
655
+ if (image_1.isLinearGradient(backgroundImage)) {
656
+ _d = background_1.calculateBackgroundRendering(container, index, [null, null, null]), path = _d[0], x = _d[1], y = _d[2], width = _d[3], height = _d[4];
657
+ _e = gradient_1.calculateGradientDirection(backgroundImage.angle, width, height), lineLength = _e[0], x0 = _e[1], x1 = _e[2], y0 = _e[3], y1 = _e[4];
658
+ canvas = document.createElement('canvas');
659
+ canvas.width = width;
660
+ canvas.height = height;
661
+ ctx = canvas.getContext('2d');
662
+ gradient_2 = ctx.createLinearGradient(x0, y0, x1, y1);
663
+ gradient_1.processColorStops(backgroundImage.stops, lineLength).forEach(function (colorStop) {
664
+ return gradient_2.addColorStop(colorStop.stop, color_1.asString(colorStop.color));
665
+ });
666
+ ctx.fillStyle = gradient_2;
667
+ ctx.fillRect(0, 0, width, height);
668
+ if (width > 0 && height > 0) {
669
+ pattern = this_1.ctx.createPattern(canvas, 'repeat');
670
+ this_1.renderRepeat(path, pattern, x, y);
671
+ }
672
+ }
673
+ else if (image_1.isRadialGradient(backgroundImage)) {
674
+ _f = background_1.calculateBackgroundRendering(container, index, [
675
+ null,
676
+ null,
677
+ null
678
+ ]), path = _f[0], left = _f[1], top_1 = _f[2], width = _f[3], height = _f[4];
679
+ position = backgroundImage.position.length === 0 ? [length_percentage_1.FIFTY_PERCENT] : backgroundImage.position;
680
+ x = length_percentage_1.getAbsoluteValue(position[0], width);
681
+ y = length_percentage_1.getAbsoluteValue(position[position.length - 1], height);
682
+ _g = gradient_1.calculateRadius(backgroundImage, x, y, width, height), rx = _g[0], ry = _g[1];
683
+ if (rx > 0 && ry > 0) {
684
+ radialGradient_1 = this_1.ctx.createRadialGradient(left + x, top_1 + y, 0, left + x, top_1 + y, rx);
685
+ gradient_1.processColorStops(backgroundImage.stops, rx * 2).forEach(function (colorStop) {
686
+ return radialGradient_1.addColorStop(colorStop.stop, color_1.asString(colorStop.color));
687
+ });
688
+ this_1.path(path);
689
+ this_1.ctx.fillStyle = radialGradient_1;
690
+ if (rx !== ry) {
691
+ midX = container.bounds.left + 0.5 * container.bounds.width;
692
+ midY = container.bounds.top + 0.5 * container.bounds.height;
693
+ f = ry / rx;
694
+ invF = 1 / f;
695
+ this_1.ctx.save();
696
+ this_1.ctx.translate(midX, midY);
697
+ this_1.ctx.transform(1, 0, 0, f, 0, 0);
698
+ this_1.ctx.translate(-midX, -midY);
699
+ this_1.ctx.fillRect(left, invF * (top_1 - midY) + midY, width, height * invF);
700
+ this_1.ctx.restore();
701
+ }
702
+ else {
703
+ this_1.ctx.fill();
704
+ }
705
+ }
706
+ }
707
+ _h.label = 6;
708
+ case 6:
709
+ index--;
710
+ return [2 /*return*/];
711
+ }
712
+ });
713
+ };
714
+ this_1 = this;
715
+ _i = 0, _a = container.styles.backgroundImage.slice(0).reverse();
716
+ _b.label = 1;
717
+ case 1:
718
+ if (!(_i < _a.length)) return [3 /*break*/, 4];
719
+ backgroundImage = _a[_i];
720
+ return [5 /*yield**/, _loop_1(backgroundImage)];
721
+ case 2:
722
+ _b.sent();
723
+ _b.label = 3;
724
+ case 3:
725
+ _i++;
726
+ return [3 /*break*/, 1];
727
+ case 4: return [2 /*return*/];
728
+ }
729
+ });
730
+ });
731
+ };
732
+ CanvasRenderer.prototype.renderSolidBorder = function (color, side, curvePoints) {
733
+ return __awaiter(this, void 0, void 0, function () {
734
+ return __generator(this, function (_a) {
735
+ this.path(border_1.parsePathForBorder(curvePoints, side));
736
+ this.ctx.fillStyle = color_1.asString(color);
737
+ this.ctx.fill();
738
+ return [2 /*return*/];
739
+ });
740
+ });
741
+ };
742
+ CanvasRenderer.prototype.renderDoubleBorder = function (color, width, side, curvePoints) {
743
+ return __awaiter(this, void 0, void 0, function () {
744
+ var outerPaths, innerPaths;
745
+ return __generator(this, function (_a) {
746
+ switch (_a.label) {
747
+ case 0:
748
+ if (!(width < 3)) return [3 /*break*/, 2];
749
+ return [4 /*yield*/, this.renderSolidBorder(color, side, curvePoints)];
750
+ case 1:
751
+ _a.sent();
752
+ return [2 /*return*/];
753
+ case 2:
754
+ outerPaths = border_1.parsePathForBorderDoubleOuter(curvePoints, side);
755
+ this.path(outerPaths);
756
+ this.ctx.fillStyle = color_1.asString(color);
757
+ this.ctx.fill();
758
+ innerPaths = border_1.parsePathForBorderDoubleInner(curvePoints, side);
759
+ this.path(innerPaths);
760
+ this.ctx.fill();
761
+ return [2 /*return*/];
762
+ }
763
+ });
764
+ });
765
+ };
766
+ CanvasRenderer.prototype.renderNodeBackgroundAndBorders = function (paint) {
767
+ return __awaiter(this, void 0, void 0, function () {
768
+ var styles, hasBackground, borders, backgroundPaintingArea, side, _i, borders_1, border;
769
+ var _this = this;
770
+ return __generator(this, function (_a) {
771
+ switch (_a.label) {
772
+ case 0:
773
+ this.applyEffects(paint.getEffects(2 /* BACKGROUND_BORDERS */));
774
+ styles = paint.container.styles;
775
+ hasBackground = !color_1.isTransparent(styles.backgroundColor) || styles.backgroundImage.length;
776
+ borders = [
777
+ { style: styles.borderTopStyle, color: styles.borderTopColor, width: styles.borderTopWidth },
778
+ { style: styles.borderRightStyle, color: styles.borderRightColor, width: styles.borderRightWidth },
779
+ { style: styles.borderBottomStyle, color: styles.borderBottomColor, width: styles.borderBottomWidth },
780
+ { style: styles.borderLeftStyle, color: styles.borderLeftColor, width: styles.borderLeftWidth }
781
+ ];
782
+ backgroundPaintingArea = calculateBackgroundCurvedPaintingArea(background_1.getBackgroundValueForIndex(styles.backgroundClip, 0), paint.curves);
783
+ if (!(hasBackground || styles.boxShadow.length)) return [3 /*break*/, 2];
784
+ this.ctx.save();
785
+ this.path(backgroundPaintingArea);
786
+ this.ctx.clip();
787
+ if (!color_1.isTransparent(styles.backgroundColor)) {
788
+ this.ctx.fillStyle = color_1.asString(styles.backgroundColor);
789
+ this.ctx.fill();
790
+ }
791
+ return [4 /*yield*/, this.renderBackgroundImage(paint.container)];
792
+ case 1:
793
+ _a.sent();
794
+ this.ctx.restore();
795
+ styles.boxShadow
796
+ .slice(0)
797
+ .reverse()
798
+ .forEach(function (shadow) {
799
+ _this.ctx.save();
800
+ var borderBoxArea = bound_curves_1.calculateBorderBoxPath(paint.curves);
801
+ var maskOffset = shadow.inset ? 0 : MASK_OFFSET;
802
+ var shadowPaintingArea = path_1.transformPath(borderBoxArea, -maskOffset + (shadow.inset ? 1 : -1) * shadow.spread.number, (shadow.inset ? 1 : -1) * shadow.spread.number, shadow.spread.number * (shadow.inset ? -2 : 2), shadow.spread.number * (shadow.inset ? -2 : 2));
803
+ if (shadow.inset) {
804
+ _this.path(borderBoxArea);
805
+ _this.ctx.clip();
806
+ _this.mask(shadowPaintingArea);
807
+ }
808
+ else {
809
+ _this.mask(borderBoxArea);
810
+ _this.ctx.clip();
811
+ _this.path(shadowPaintingArea);
812
+ }
813
+ _this.ctx.shadowOffsetX = shadow.offsetX.number + maskOffset;
814
+ _this.ctx.shadowOffsetY = shadow.offsetY.number;
815
+ _this.ctx.shadowColor = color_1.asString(shadow.color);
816
+ _this.ctx.shadowBlur = shadow.blur.number;
817
+ _this.ctx.fillStyle = shadow.inset ? color_1.asString(shadow.color) : 'rgba(0,0,0,1)';
818
+ _this.ctx.fill();
819
+ _this.ctx.restore();
820
+ });
821
+ _a.label = 2;
822
+ case 2:
823
+ side = 0;
824
+ _i = 0, borders_1 = borders;
825
+ _a.label = 3;
826
+ case 3:
827
+ if (!(_i < borders_1.length)) return [3 /*break*/, 13];
828
+ border = borders_1[_i];
829
+ if (!(border.style !== 0 /* NONE */ && !color_1.isTransparent(border.color) && border.width > 0)) return [3 /*break*/, 11];
830
+ if (!(border.style === 2 /* DASHED */)) return [3 /*break*/, 5];
831
+ return [4 /*yield*/, this.renderDashedDottedBorder(border.color, border.width, side, paint.curves, 2 /* DASHED */)];
832
+ case 4:
833
+ _a.sent();
834
+ return [3 /*break*/, 11];
835
+ case 5:
836
+ if (!(border.style === 3 /* DOTTED */)) return [3 /*break*/, 7];
837
+ return [4 /*yield*/, this.renderDashedDottedBorder(border.color, border.width, side, paint.curves, 3 /* DOTTED */)];
838
+ case 6:
839
+ _a.sent();
840
+ return [3 /*break*/, 11];
841
+ case 7:
842
+ if (!(border.style === 4 /* DOUBLE */)) return [3 /*break*/, 9];
843
+ return [4 /*yield*/, this.renderDoubleBorder(border.color, border.width, side, paint.curves)];
844
+ case 8:
845
+ _a.sent();
846
+ return [3 /*break*/, 11];
847
+ case 9: return [4 /*yield*/, this.renderSolidBorder(border.color, side, paint.curves)];
848
+ case 10:
849
+ _a.sent();
850
+ _a.label = 11;
851
+ case 11:
852
+ side++;
853
+ _a.label = 12;
854
+ case 12:
855
+ _i++;
856
+ return [3 /*break*/, 3];
857
+ case 13: return [2 /*return*/];
858
+ }
859
+ });
860
+ });
861
+ };
862
+ CanvasRenderer.prototype.renderDashedDottedBorder = function (color, width, side, curvePoints, style) {
863
+ return __awaiter(this, void 0, void 0, function () {
864
+ var strokePaths, boxPaths, startX, startY, endX, endY, length, dashLength, spaceLength, useLineDash, multiplier, numberOfDashes, minSpace, maxSpace, path1, path2, path1, path2;
865
+ return __generator(this, function (_a) {
866
+ this.ctx.save();
867
+ strokePaths = border_1.parsePathForBorderStroke(curvePoints, side);
868
+ boxPaths = border_1.parsePathForBorder(curvePoints, side);
869
+ if (style === 2 /* DASHED */) {
870
+ this.path(boxPaths);
871
+ this.ctx.clip();
872
+ }
873
+ if (bezier_curve_1.isBezierCurve(boxPaths[0])) {
874
+ startX = boxPaths[0].start.x;
875
+ startY = boxPaths[0].start.y;
876
+ }
877
+ else {
878
+ startX = boxPaths[0].x;
879
+ startY = boxPaths[0].y;
880
+ }
881
+ if (bezier_curve_1.isBezierCurve(boxPaths[1])) {
882
+ endX = boxPaths[1].end.x;
883
+ endY = boxPaths[1].end.y;
884
+ }
885
+ else {
886
+ endX = boxPaths[1].x;
887
+ endY = boxPaths[1].y;
888
+ }
889
+ if (side === 0 || side === 2) {
890
+ length = Math.abs(startX - endX);
891
+ }
892
+ else {
893
+ length = Math.abs(startY - endY);
894
+ }
895
+ this.ctx.beginPath();
896
+ if (style === 3 /* DOTTED */) {
897
+ this.formatPath(strokePaths);
898
+ }
899
+ else {
900
+ this.formatPath(boxPaths.slice(0, 2));
901
+ }
902
+ dashLength = width < 3 ? width * 3 : width * 2;
903
+ spaceLength = width < 3 ? width * 2 : width;
904
+ if (style === 3 /* DOTTED */) {
905
+ dashLength = width;
906
+ spaceLength = width;
907
+ }
908
+ useLineDash = true;
909
+ if (length <= dashLength * 2) {
910
+ useLineDash = false;
911
+ }
912
+ else if (length <= dashLength * 2 + spaceLength) {
913
+ multiplier = length / (2 * dashLength + spaceLength);
914
+ dashLength *= multiplier;
915
+ spaceLength *= multiplier;
916
+ }
917
+ else {
918
+ numberOfDashes = Math.floor((length + spaceLength) / (dashLength + spaceLength));
919
+ minSpace = (length - numberOfDashes * dashLength) / (numberOfDashes - 1);
920
+ maxSpace = (length - (numberOfDashes + 1) * dashLength) / numberOfDashes;
921
+ spaceLength =
922
+ maxSpace <= 0 || Math.abs(spaceLength - minSpace) < Math.abs(spaceLength - maxSpace)
923
+ ? minSpace
924
+ : maxSpace;
925
+ }
926
+ if (useLineDash) {
927
+ if (style === 3 /* DOTTED */) {
928
+ this.ctx.setLineDash([0, dashLength + spaceLength]);
929
+ }
930
+ else {
931
+ this.ctx.setLineDash([dashLength, spaceLength]);
932
+ }
933
+ }
934
+ if (style === 3 /* DOTTED */) {
935
+ this.ctx.lineCap = 'round';
936
+ this.ctx.lineWidth = width;
937
+ }
938
+ else {
939
+ this.ctx.lineWidth = width * 2 + 1.1;
940
+ }
941
+ this.ctx.strokeStyle = color_1.asString(color);
942
+ this.ctx.stroke();
943
+ this.ctx.setLineDash([]);
944
+ // dashed round edge gap
945
+ if (style === 2 /* DASHED */) {
946
+ if (bezier_curve_1.isBezierCurve(boxPaths[0])) {
947
+ path1 = boxPaths[3];
948
+ path2 = boxPaths[0];
949
+ this.ctx.beginPath();
950
+ this.formatPath([new vector_1.Vector(path1.end.x, path1.end.y), new vector_1.Vector(path2.start.x, path2.start.y)]);
951
+ this.ctx.stroke();
952
+ }
953
+ if (bezier_curve_1.isBezierCurve(boxPaths[1])) {
954
+ path1 = boxPaths[1];
955
+ path2 = boxPaths[2];
956
+ this.ctx.beginPath();
957
+ this.formatPath([new vector_1.Vector(path1.end.x, path1.end.y), new vector_1.Vector(path2.start.x, path2.start.y)]);
958
+ this.ctx.stroke();
959
+ }
960
+ }
961
+ this.ctx.restore();
962
+ return [2 /*return*/];
963
+ });
964
+ });
965
+ };
966
+ CanvasRenderer.prototype.render = function (element) {
967
+ return __awaiter(this, void 0, void 0, function () {
968
+ var stack;
969
+ return __generator(this, function (_a) {
970
+ switch (_a.label) {
971
+ case 0:
972
+ if (this.options.backgroundColor) {
973
+ this.ctx.fillStyle = color_1.asString(this.options.backgroundColor);
974
+ this.ctx.fillRect(this.options.x, this.options.y, this.options.width, this.options.height);
975
+ }
976
+ stack = stacking_context_1.parseStackingContexts(element);
977
+ return [4 /*yield*/, this.renderStack(stack)];
978
+ case 1:
979
+ _a.sent();
980
+ this.applyEffects([]);
981
+ return [2 /*return*/, this.canvas];
982
+ }
983
+ });
984
+ });
985
+ };
986
+ return CanvasRenderer;
987
+ }(renderer_1.Renderer));
988
+ exports.CanvasRenderer = CanvasRenderer;
989
+ var isTextInputElement = function (container) {
990
+ if (container instanceof textarea_element_container_1.TextareaElementContainer) {
991
+ return true;
992
+ }
993
+ else if (container instanceof select_element_container_1.SelectElementContainer) {
994
+ return true;
995
+ }
996
+ else if (container instanceof input_element_container_1.InputElementContainer && container.type !== input_element_container_1.RADIO && container.type !== input_element_container_1.CHECKBOX) {
997
+ return true;
998
+ }
999
+ return false;
1000
+ };
1001
+ var calculateBackgroundCurvedPaintingArea = function (clip, curves) {
1002
+ switch (clip) {
1003
+ case 0 /* BORDER_BOX */:
1004
+ return bound_curves_1.calculateBorderBoxPath(curves);
1005
+ case 2 /* CONTENT_BOX */:
1006
+ return bound_curves_1.calculateContentBoxPath(curves);
1007
+ case 1 /* PADDING_BOX */:
1008
+ default:
1009
+ return bound_curves_1.calculatePaddingBoxPath(curves);
1010
+ }
1011
+ };
1012
+ var canvasTextAlign = function (textAlign) {
1013
+ switch (textAlign) {
1014
+ case 1 /* CENTER */:
1015
+ return 'center';
1016
+ case 2 /* RIGHT */:
1017
+ return 'right';
1018
+ case 0 /* LEFT */:
1019
+ default:
1020
+ return 'left';
1021
+ }
1022
+ };
1023
+ // see https://github.com/niklasvh/html2canvas/pull/2645
1024
+ var iOSBrokenFonts = ['-apple-system', 'system-ui'];
1025
+ var fixIOSSystemFonts = function (fontFamilies) {
1026
+ return /iPhone OS 15_(0|1)/.test(window.navigator.userAgent)
1027
+ ? fontFamilies.filter(function (fontFamily) { return iOSBrokenFonts.indexOf(fontFamily) === -1; })
1028
+ : fontFamilies;
1029
+ };
1030
+ //# sourceMappingURL=canvas-renderer.js.map