@baique/pi-web-sky 0.1.39 → 0.1.40

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 (379) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +9 -14
  3. package/.next/build-manifest.json +3 -3
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/react-loadable-manifest.json +51 -51
  6. package/.next/required-server-files.js +1 -1
  7. package/.next/required-server-files.json +1 -1
  8. package/.next/routes-manifest.json +3 -45
  9. package/.next/server/app/_global-error/page.js +2 -2
  10. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  11. package/.next/server/app/_global-error.html +1 -1
  12. package/.next/server/app/_global-error.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  15. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  16. package/.next/server/app/_not-found/page.js +1 -1
  17. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  18. package/.next/server/app/_not-found.html +1 -1
  19. package/.next/server/app/_not-found.rsc +3 -3
  20. package/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  21. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +3 -3
  22. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  23. package/.next/server/app/api/agent/[id]/bash-output/route.js +2 -2
  24. package/.next/server/app/api/agent/[id]/events/route.js +2 -2
  25. package/.next/server/app/api/agent/[id]/route.js +2 -2
  26. package/.next/server/app/api/agent/new/route.js +1 -1
  27. package/.next/server/app/api/agent/new/route.js.nft.json +1 -1
  28. package/.next/server/app/api/agent/running/route.js +1 -1
  29. package/.next/server/app/api/app-update/route.js +1 -1
  30. package/.next/server/app/api/auth/all-providers/route.js +1 -1
  31. package/.next/server/app/api/auth/api-key/[provider]/route.js +1 -1
  32. package/.next/server/app/api/auth/login/[provider]/route.js +1 -1
  33. package/.next/server/app/api/auth/logout/[provider]/route.js +1 -1
  34. package/.next/server/app/api/auth/providers/route.js +1 -1
  35. package/.next/server/app/api/boards/[id]/reconcile/route.js +1 -0
  36. package/.next/server/app/api/boards/[id]/reconcile/route_client-reference-manifest.js +1 -0
  37. package/.next/server/app/api/boards/[id]/route.js +1 -1
  38. package/.next/server/app/api/boards/purge-orphans/route.js +1 -1
  39. package/.next/server/app/api/boards/reorder/route.js +1 -1
  40. package/.next/server/app/api/boards/route.js +1 -1
  41. package/.next/server/app/api/cwd/browse/route.js +1 -1
  42. package/.next/server/app/api/cwd/validate/route.js +2 -2
  43. package/.next/server/app/api/default-cwd/route.js +2 -2
  44. package/.next/server/app/api/file-index/route.js +2 -2
  45. package/.next/server/app/api/files/[...path]/route.js +3 -3
  46. package/.next/server/app/api/files/[...path]/route.js.nft.json +1 -1
  47. package/.next/server/app/api/git/diff/route.js +1 -1
  48. package/.next/server/app/api/git/status/route.js +1 -1
  49. package/.next/server/app/api/home/route.js +1 -1
  50. package/.next/server/app/api/mcp/route.js +1 -1
  51. package/.next/server/app/api/models/route.js +2 -2
  52. package/.next/server/app/api/models-config/catalog/route.js +1 -1
  53. package/.next/server/app/api/models-config/discover/route.js +1 -1
  54. package/.next/server/app/api/models-config/route.js +1 -1
  55. package/.next/server/app/api/models-config/test/route.js +1 -1
  56. package/.next/server/app/api/plugins/route.js +2 -2
  57. package/.next/server/app/api/project-trust/route.js +2 -2
  58. package/.next/server/app/api/quota/route.js +1 -1
  59. package/.next/server/app/api/search/route.js +2 -2
  60. package/.next/server/app/api/sessions/[id]/auto-name/route.js +3 -3
  61. package/.next/server/app/api/sessions/[id]/context/route.js +2 -2
  62. package/.next/server/app/api/sessions/[id]/entries/[entryId]/thinking/route.js +2 -2
  63. package/.next/server/app/api/sessions/[id]/export/route.js +2 -2
  64. package/.next/server/app/api/sessions/[id]/route.js +1 -1
  65. package/.next/server/app/api/sessions/[id]/state/route.js +2 -2
  66. package/.next/server/app/api/sessions/[id]/todos/route.js +2 -2
  67. package/.next/server/app/api/sessions/route.js +2 -2
  68. package/.next/server/app/api/skills/check/route.js +1 -1
  69. package/.next/server/app/api/skills/install/route.js +2 -2
  70. package/.next/server/app/api/skills/route.js +1 -1
  71. package/.next/server/app/api/skills/search/route.js +1 -1
  72. package/.next/server/app/api/skills/update/route.js +1 -1
  73. package/.next/server/app/api/task-card-questions/[id]/answer/route.js +1 -1
  74. package/.next/server/app/api/task-card-questions/route.js +1 -1
  75. package/.next/server/app/api/task-cards/[id]/route.js +1 -1
  76. package/.next/server/app/api/task-cards/route.js +1 -1
  77. package/.next/server/app/api/task-scheduler/status/route.js +1 -1
  78. package/.next/server/app/api/tasks/[id]/board/route.js +1 -1
  79. package/.next/server/app/api/tasks/[id]/route.js +1 -1
  80. package/.next/server/app/api/tasks/reorder/route.js +1 -1
  81. package/.next/server/app/api/tasks/route.js +1 -1
  82. package/.next/server/app/api/terminal/[id]/events/route.js +2 -2
  83. package/.next/server/app/api/terminal/[id]/route.js +2 -2
  84. package/.next/server/app/api/terminal/route.js +2 -2
  85. package/.next/server/app/api/worktrees/route.js +2 -2
  86. package/.next/server/app/favicon.ico/route.js +1 -1
  87. package/.next/server/app/index.html +1 -1
  88. package/.next/server/app/index.rsc +5 -5
  89. package/.next/server/app/index.segments/__PAGE__.segment.rsc +5 -5
  90. package/.next/server/app/index.segments/_full.segment.rsc +5 -5
  91. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  92. package/.next/server/app/manifest.webmanifest/route.js +2 -2
  93. package/.next/server/app/page.js +7 -7
  94. package/.next/server/app/page_client-reference-manifest.js +1 -1
  95. package/.next/server/app-paths-manifest.json +9 -14
  96. package/.next/server/chunks/1094.js +2 -2
  97. package/.next/server/chunks/1601.js +1 -1
  98. package/.next/server/chunks/1860.js +1 -1
  99. package/.next/server/chunks/2075.js +1 -1
  100. package/.next/server/chunks/2169.js +1 -1
  101. package/.next/server/chunks/2404.js +1 -1
  102. package/.next/server/chunks/2524.js +1 -0
  103. package/.next/server/chunks/3012.js +1 -1
  104. package/.next/server/chunks/{5760.js → 3379.js} +1 -1
  105. package/.next/server/chunks/3500.js +1 -1
  106. package/.next/server/chunks/4226.js +5 -2
  107. package/.next/server/chunks/4267.js +1 -1
  108. package/.next/server/chunks/4563.js +1 -1
  109. package/.next/server/chunks/5318.js +1 -1
  110. package/.next/server/chunks/542.js +3 -44
  111. package/.next/server/chunks/5794.js +1 -1
  112. package/.next/server/chunks/6052.js +1 -1
  113. package/.next/server/chunks/6253.js +1 -1
  114. package/.next/server/chunks/6288.js +1 -1
  115. package/.next/server/chunks/6366.js +1 -1
  116. package/.next/server/chunks/673.js +1 -1
  117. package/.next/server/chunks/6916.js +2 -2
  118. package/.next/server/chunks/7128.js +43 -0
  119. package/.next/server/chunks/7265.js +2 -2
  120. package/.next/server/chunks/7799.js +1 -1
  121. package/.next/server/chunks/8106.js +1 -1
  122. package/.next/server/chunks/8333.js +1 -1
  123. package/.next/server/chunks/8604.js +1 -1
  124. package/.next/server/chunks/861.js +1 -0
  125. package/.next/server/chunks/8713.js +1 -1
  126. package/.next/server/chunks/8782.js +2 -2
  127. package/.next/server/chunks/898.js +1 -1
  128. package/.next/server/chunks/922.js +2 -2
  129. package/.next/server/chunks/9280.js +6 -6
  130. package/.next/server/chunks/9510.js +1 -1
  131. package/.next/server/instrumentation.js +1 -1
  132. package/.next/server/instrumentation.js.nft.json +1 -1
  133. package/.next/server/middleware-build-manifest.js +1 -1
  134. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  135. package/.next/server/pages/404.html +1 -1
  136. package/.next/server/pages/500.html +1 -1
  137. package/.next/server/server-reference-manifest.json +1 -1
  138. package/.next/static/chunks/{103.23142a67b02246a8.js → 103.6c91a059aa01d92c.js} +2 -2
  139. package/.next/static/chunks/{1032.12b382a9096ab2a4.js → 1032.9e8f793d46f463f8.js} +1 -1
  140. package/.next/static/chunks/{1063.775c442bdbeef08b.js → 1063.470df8a037dc8409.js} +1 -1
  141. package/.next/static/chunks/1a258343.f4fc2c133917ded8.js +2 -0
  142. package/.next/static/chunks/{1ba63609.b2ae90f43319a29e.js → 1ba63609.569928c7234f832c.js} +1 -1
  143. package/.next/static/chunks/{2181.ba21239d3ac39f81.js → 2181.b8dda21843ef5e74.js} +1 -1
  144. package/.next/static/chunks/{2325.23caf22075e51aa5.js → 2325.23e538886331cf64.js} +1 -1
  145. package/.next/static/chunks/{2356.523277bb8c6bf72a.js → 2356.b7312589c345edec.js} +1 -1
  146. package/.next/static/chunks/{268.72794ee2773c2060.js → 268.a1d90aca268be18a.js} +1 -1
  147. package/.next/static/chunks/{2695.6f49435bae1e6f33.js → 2695.5624aa3aae540e87.js} +1 -1
  148. package/.next/static/chunks/{2703.495a65ed14b2f094.js → 2703.097bc88286733740.js} +1 -1
  149. package/.next/static/chunks/{2821.934bcf60fbdc28c6.js → 2821.d2392a93d192fe92.js} +1 -1
  150. package/.next/static/chunks/3308.2cd6f20e6c0f4e92.js +73 -0
  151. package/.next/static/chunks/{3336.a76f9485fe7cb762.js → 3336.9b1dc9ec3507d64f.js} +1 -1
  152. package/.next/static/chunks/3546.779d2c7646aa77cc.js +1 -0
  153. package/.next/static/chunks/{370.8e8f3cf8eb0e29dd.js → 370.cde2a84caa84054f.js} +1 -1
  154. package/.next/static/chunks/{3716.72bf4c9d7325debd.js → 3716.5bac496cea32ca8f.js} +1 -1
  155. package/.next/static/chunks/{3995.eca0f5bef1fc3ae5.js → 3995.cd112debcd64c610.js} +1 -1
  156. package/.next/static/chunks/{4004.74b9bcf5478b1663.js → 4004.a8f79ef62f32aa30.js} +2 -2
  157. package/.next/static/chunks/{4202.8440832386f023c7.js → 4202.96f5b1beb8b3e3f5.js} +1 -1
  158. package/.next/static/chunks/{4238.6f102dcbcf2ae339.js → 4238.28efbf9aa0c82d90.js} +1 -1
  159. package/.next/static/chunks/{4405.7a19458960a1058e.js → 4405.cda46a596a02aef7.js} +1 -1
  160. package/.next/static/chunks/54a60aa6.5e4421e7afde4de8.js +78 -0
  161. package/.next/static/chunks/{6121.eb9023b1cbc78ee2.js → 6121.5e650e714b402b6f.js} +1 -1
  162. package/.next/static/chunks/{6195.1153369f5f8b13a2.js → 6195.1b7f9dc127381bbc.js} +1 -1
  163. package/.next/static/chunks/6380.d148a8e2c701ad78.js +68 -0
  164. package/.next/static/chunks/6582.efef0ed269bacae2.js +1 -0
  165. package/.next/static/chunks/6be7e44c.00d0163f409986f0.js +1 -0
  166. package/.next/static/chunks/{7331.2add3c4e125a2dba.js → 7331.4afa66d6353c8e07.js} +1 -1
  167. package/.next/static/chunks/752.f41a9dcb0e6548eb.js +1 -0
  168. package/.next/static/chunks/{8200.a36b9f8c983c6b9e.js → 8200.350d650649b977eb.js} +1 -1
  169. package/.next/static/chunks/{8885.cf60cac98bf8b70c.js → 8885.2c060cb45c85547b.js} +1 -1
  170. package/.next/static/chunks/{918.6a9bbe564e4a2d0f.js → 918.593eb466d35cb8ad.js} +1 -1
  171. package/.next/static/chunks/{9698.4d09a99b9d99f3e5.js → 9698.758755d0387e0e22.js} +2 -2
  172. package/.next/static/chunks/97.fb73c551e14b3612.js +2 -0
  173. package/.next/static/chunks/{993e5495.8797001fcfcf2889.js → 993e5495.12cdfbc3af5c79e9.js} +1 -1
  174. package/.next/static/chunks/{9974.9a0f79beca65e8c4.js → 9974.5ee982e074ad047e.js} +1 -1
  175. package/.next/static/chunks/app/_global-error/page-bb8f79f321e26750.js +1 -0
  176. package/.next/static/chunks/app/api/agent/[id]/bash-output/route-bb8f79f321e26750.js +1 -0
  177. package/.next/static/chunks/app/api/agent/[id]/events/route-bb8f79f321e26750.js +1 -0
  178. package/.next/static/chunks/app/api/agent/[id]/route-bb8f79f321e26750.js +1 -0
  179. package/.next/static/chunks/app/api/agent/new/route-bb8f79f321e26750.js +1 -0
  180. package/.next/static/chunks/app/api/agent/running/route-bb8f79f321e26750.js +1 -0
  181. package/.next/static/chunks/app/api/app-update/route-bb8f79f321e26750.js +1 -0
  182. package/.next/static/chunks/app/api/auth/all-providers/route-bb8f79f321e26750.js +1 -0
  183. package/.next/static/chunks/app/api/auth/api-key/[provider]/route-bb8f79f321e26750.js +1 -0
  184. package/.next/static/chunks/app/api/auth/login/[provider]/route-bb8f79f321e26750.js +1 -0
  185. package/.next/static/chunks/app/api/auth/logout/[provider]/route-bb8f79f321e26750.js +1 -0
  186. package/.next/static/chunks/app/api/auth/providers/route-bb8f79f321e26750.js +1 -0
  187. package/.next/static/chunks/app/api/boards/[id]/reconcile/route-bb8f79f321e26750.js +1 -0
  188. package/.next/static/chunks/app/api/boards/[id]/route-bb8f79f321e26750.js +1 -0
  189. package/.next/static/chunks/app/api/boards/purge-orphans/route-bb8f79f321e26750.js +1 -0
  190. package/.next/static/chunks/app/api/boards/reorder/route-bb8f79f321e26750.js +1 -0
  191. package/.next/static/chunks/app/api/boards/route-bb8f79f321e26750.js +1 -0
  192. package/.next/static/chunks/app/api/cwd/browse/route-bb8f79f321e26750.js +1 -0
  193. package/.next/static/chunks/app/api/cwd/validate/route-bb8f79f321e26750.js +1 -0
  194. package/.next/static/chunks/app/api/default-cwd/route-bb8f79f321e26750.js +1 -0
  195. package/.next/static/chunks/app/api/file-index/route-bb8f79f321e26750.js +1 -0
  196. package/.next/static/chunks/app/api/files/[...path]/route-bb8f79f321e26750.js +1 -0
  197. package/.next/static/chunks/app/api/git/diff/route-bb8f79f321e26750.js +1 -0
  198. package/.next/static/chunks/app/api/git/status/route-bb8f79f321e26750.js +1 -0
  199. package/.next/static/chunks/app/api/home/route-bb8f79f321e26750.js +1 -0
  200. package/.next/static/chunks/app/api/mcp/route-bb8f79f321e26750.js +1 -0
  201. package/.next/static/chunks/app/api/models/route-bb8f79f321e26750.js +1 -0
  202. package/.next/static/chunks/app/api/models-config/catalog/route-bb8f79f321e26750.js +1 -0
  203. package/.next/static/chunks/app/api/models-config/discover/route-bb8f79f321e26750.js +1 -0
  204. package/.next/static/chunks/app/api/models-config/route-bb8f79f321e26750.js +1 -0
  205. package/.next/static/chunks/app/api/models-config/test/route-bb8f79f321e26750.js +1 -0
  206. package/.next/static/chunks/app/api/plugins/route-bb8f79f321e26750.js +1 -0
  207. package/.next/static/chunks/app/api/project-trust/route-bb8f79f321e26750.js +1 -0
  208. package/.next/static/chunks/app/api/quota/route-bb8f79f321e26750.js +1 -0
  209. package/.next/static/chunks/app/api/search/route-bb8f79f321e26750.js +1 -0
  210. package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-bb8f79f321e26750.js +1 -0
  211. package/.next/static/chunks/app/api/sessions/[id]/context/route-bb8f79f321e26750.js +1 -0
  212. package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-bb8f79f321e26750.js +1 -0
  213. package/.next/static/chunks/app/api/sessions/[id]/export/route-bb8f79f321e26750.js +1 -0
  214. package/.next/static/chunks/app/api/sessions/[id]/route-bb8f79f321e26750.js +1 -0
  215. package/.next/static/chunks/app/api/sessions/[id]/state/route-bb8f79f321e26750.js +1 -0
  216. package/.next/static/chunks/app/api/sessions/[id]/todos/route-bb8f79f321e26750.js +1 -0
  217. package/.next/static/chunks/app/api/sessions/route-bb8f79f321e26750.js +1 -0
  218. package/.next/static/chunks/app/api/skills/check/route-bb8f79f321e26750.js +1 -0
  219. package/.next/static/chunks/app/api/skills/install/route-bb8f79f321e26750.js +1 -0
  220. package/.next/static/chunks/app/api/skills/route-bb8f79f321e26750.js +1 -0
  221. package/.next/static/chunks/app/api/skills/search/route-bb8f79f321e26750.js +1 -0
  222. package/.next/static/chunks/app/api/skills/update/route-bb8f79f321e26750.js +1 -0
  223. package/.next/static/chunks/app/api/task-card-questions/[id]/answer/route-bb8f79f321e26750.js +1 -0
  224. package/.next/static/chunks/app/api/task-card-questions/route-bb8f79f321e26750.js +1 -0
  225. package/.next/static/chunks/app/api/task-cards/[id]/route-bb8f79f321e26750.js +1 -0
  226. package/.next/static/chunks/app/api/task-cards/route-bb8f79f321e26750.js +1 -0
  227. package/.next/static/chunks/app/api/task-scheduler/status/route-bb8f79f321e26750.js +1 -0
  228. package/.next/static/chunks/app/api/tasks/[id]/board/route-bb8f79f321e26750.js +1 -0
  229. package/.next/static/chunks/app/api/tasks/[id]/route-bb8f79f321e26750.js +1 -0
  230. package/.next/static/chunks/app/api/tasks/reorder/route-bb8f79f321e26750.js +1 -0
  231. package/.next/static/chunks/app/api/tasks/route-bb8f79f321e26750.js +1 -0
  232. package/.next/static/chunks/app/api/terminal/[id]/events/route-bb8f79f321e26750.js +1 -0
  233. package/.next/static/chunks/app/api/terminal/[id]/route-bb8f79f321e26750.js +1 -0
  234. package/.next/static/chunks/app/api/terminal/route-bb8f79f321e26750.js +1 -0
  235. package/.next/static/chunks/app/api/worktrees/route-bb8f79f321e26750.js +1 -0
  236. package/.next/static/chunks/app/{layout-7761e430ed68b347.js → layout-702d3c97d297c42d.js} +1 -1
  237. package/.next/static/chunks/app/manifest.webmanifest/route-bb8f79f321e26750.js +1 -0
  238. package/.next/static/chunks/app/page-fd18462c3c937a50.js +89 -0
  239. package/.next/static/chunks/next/dist/client/components/builtin/app-error-bb8f79f321e26750.js +1 -0
  240. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-bb8f79f321e26750.js +1 -0
  241. package/.next/static/chunks/next/dist/client/components/builtin/not-found-bb8f79f321e26750.js +1 -0
  242. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-bb8f79f321e26750.js +1 -0
  243. package/.next/static/chunks/webpack-d17b4dde91b96c63.js +1 -0
  244. package/.next/static/css/0c7244f7214af81f.css +1 -0
  245. package/.next/static/css/12456255969ac8de.css +31 -0
  246. package/.next/trace +43 -49
  247. package/.next/trace-build +1 -1
  248. package/.next/types/app/api/boards/[id]/{reconcile-task-edges → reconcile}/route.ts +3 -3
  249. package/.next/types/routes.d.ts +2 -7
  250. package/.next/types/validator.ts +3 -48
  251. package/README.md +6 -9
  252. package/THIRD_PARTY_NOTICES.md +10 -82
  253. package/bin/pi-web-sky.js +3 -3
  254. package/lib/board-reconcile-scheduler.ts +56 -0
  255. package/lib/board-reconcile.test.mjs +252 -0
  256. package/lib/board-reconcile.ts +422 -0
  257. package/lib/board-store.test.mjs +26 -4
  258. package/lib/board-store.ts +44 -6
  259. package/lib/i18n/messages/en.ts +1 -1
  260. package/lib/i18n/messages/zh-CN.ts +1 -1
  261. package/lib/session-delete.ts +5 -0
  262. package/lib/sqlite-db.ts +13 -1
  263. package/lib/task-card-store.ts +26 -1
  264. package/lib/task-scheduler.test.mjs +79 -0
  265. package/lib/task-scheduler.ts +195 -21
  266. package/lib/yjs-room-server.mjs +139 -0
  267. package/package.json +12 -9
  268. package/server.mjs +7 -7
  269. package/.next/server/app/api/boards/[id]/canvas/route.js +0 -1
  270. package/.next/server/app/api/boards/[id]/canvas/route_client-reference-manifest.js +0 -1
  271. package/.next/server/app/api/boards/[id]/edges/[eid]/route.js +0 -1
  272. package/.next/server/app/api/boards/[id]/edges/[eid]/route.js.nft.json +0 -1
  273. package/.next/server/app/api/boards/[id]/edges/[eid]/route_client-reference-manifest.js +0 -1
  274. package/.next/server/app/api/boards/[id]/edges/route.js +0 -1
  275. package/.next/server/app/api/boards/[id]/edges/route.js.nft.json +0 -1
  276. package/.next/server/app/api/boards/[id]/edges/route_client-reference-manifest.js +0 -1
  277. package/.next/server/app/api/boards/[id]/nodes/[nid]/route.js +0 -1
  278. package/.next/server/app/api/boards/[id]/nodes/[nid]/route.js.nft.json +0 -1
  279. package/.next/server/app/api/boards/[id]/nodes/[nid]/route_client-reference-manifest.js +0 -1
  280. package/.next/server/app/api/boards/[id]/nodes/route.js +0 -1
  281. package/.next/server/app/api/boards/[id]/nodes/route.js.nft.json +0 -1
  282. package/.next/server/app/api/boards/[id]/nodes/route_client-reference-manifest.js +0 -1
  283. package/.next/server/app/api/boards/[id]/reconcile-task-edges/route.js +0 -1
  284. package/.next/server/app/api/boards/[id]/reconcile-task-edges/route.js.nft.json +0 -1
  285. package/.next/server/app/api/boards/[id]/reconcile-task-edges/route_client-reference-manifest.js +0 -1
  286. package/.next/static/chunks/3308.857c554428b3294e.js +0 -73
  287. package/.next/static/chunks/333.bf0651c789b2eb33.js +0 -1
  288. package/.next/static/chunks/5315.dba7515ae6e139ae.js +0 -4
  289. package/.next/static/chunks/54a60aa6.0e43cde7298ebcb7.js +0 -78
  290. package/.next/static/chunks/7999.879d5a20e8641752.js +0 -259
  291. package/.next/static/chunks/app/_global-error/page-d6f52627eddf9119.js +0 -1
  292. package/.next/static/chunks/app/api/agent/[id]/bash-output/route-d6f52627eddf9119.js +0 -1
  293. package/.next/static/chunks/app/api/agent/[id]/events/route-d6f52627eddf9119.js +0 -1
  294. package/.next/static/chunks/app/api/agent/[id]/route-d6f52627eddf9119.js +0 -1
  295. package/.next/static/chunks/app/api/agent/new/route-d6f52627eddf9119.js +0 -1
  296. package/.next/static/chunks/app/api/agent/running/route-d6f52627eddf9119.js +0 -1
  297. package/.next/static/chunks/app/api/app-update/route-d6f52627eddf9119.js +0 -1
  298. package/.next/static/chunks/app/api/auth/all-providers/route-d6f52627eddf9119.js +0 -1
  299. package/.next/static/chunks/app/api/auth/api-key/[provider]/route-d6f52627eddf9119.js +0 -1
  300. package/.next/static/chunks/app/api/auth/login/[provider]/route-d6f52627eddf9119.js +0 -1
  301. package/.next/static/chunks/app/api/auth/logout/[provider]/route-d6f52627eddf9119.js +0 -1
  302. package/.next/static/chunks/app/api/auth/providers/route-d6f52627eddf9119.js +0 -1
  303. package/.next/static/chunks/app/api/boards/[id]/canvas/route-d6f52627eddf9119.js +0 -1
  304. package/.next/static/chunks/app/api/boards/[id]/edges/[eid]/route-d6f52627eddf9119.js +0 -1
  305. package/.next/static/chunks/app/api/boards/[id]/edges/route-d6f52627eddf9119.js +0 -1
  306. package/.next/static/chunks/app/api/boards/[id]/nodes/[nid]/route-d6f52627eddf9119.js +0 -1
  307. package/.next/static/chunks/app/api/boards/[id]/nodes/route-d6f52627eddf9119.js +0 -1
  308. package/.next/static/chunks/app/api/boards/[id]/reconcile-task-edges/route-d6f52627eddf9119.js +0 -1
  309. package/.next/static/chunks/app/api/boards/[id]/route-d6f52627eddf9119.js +0 -1
  310. package/.next/static/chunks/app/api/boards/purge-orphans/route-d6f52627eddf9119.js +0 -1
  311. package/.next/static/chunks/app/api/boards/reorder/route-d6f52627eddf9119.js +0 -1
  312. package/.next/static/chunks/app/api/boards/route-d6f52627eddf9119.js +0 -1
  313. package/.next/static/chunks/app/api/cwd/browse/route-d6f52627eddf9119.js +0 -1
  314. package/.next/static/chunks/app/api/cwd/validate/route-d6f52627eddf9119.js +0 -1
  315. package/.next/static/chunks/app/api/default-cwd/route-d6f52627eddf9119.js +0 -1
  316. package/.next/static/chunks/app/api/file-index/route-d6f52627eddf9119.js +0 -1
  317. package/.next/static/chunks/app/api/files/[...path]/route-d6f52627eddf9119.js +0 -1
  318. package/.next/static/chunks/app/api/git/diff/route-d6f52627eddf9119.js +0 -1
  319. package/.next/static/chunks/app/api/git/status/route-d6f52627eddf9119.js +0 -1
  320. package/.next/static/chunks/app/api/home/route-d6f52627eddf9119.js +0 -1
  321. package/.next/static/chunks/app/api/mcp/route-d6f52627eddf9119.js +0 -1
  322. package/.next/static/chunks/app/api/models/route-d6f52627eddf9119.js +0 -1
  323. package/.next/static/chunks/app/api/models-config/catalog/route-d6f52627eddf9119.js +0 -1
  324. package/.next/static/chunks/app/api/models-config/discover/route-d6f52627eddf9119.js +0 -1
  325. package/.next/static/chunks/app/api/models-config/route-d6f52627eddf9119.js +0 -1
  326. package/.next/static/chunks/app/api/models-config/test/route-d6f52627eddf9119.js +0 -1
  327. package/.next/static/chunks/app/api/plugins/route-d6f52627eddf9119.js +0 -1
  328. package/.next/static/chunks/app/api/project-trust/route-d6f52627eddf9119.js +0 -1
  329. package/.next/static/chunks/app/api/quota/route-d6f52627eddf9119.js +0 -1
  330. package/.next/static/chunks/app/api/search/route-d6f52627eddf9119.js +0 -1
  331. package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-d6f52627eddf9119.js +0 -1
  332. package/.next/static/chunks/app/api/sessions/[id]/context/route-d6f52627eddf9119.js +0 -1
  333. package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-d6f52627eddf9119.js +0 -1
  334. package/.next/static/chunks/app/api/sessions/[id]/export/route-d6f52627eddf9119.js +0 -1
  335. package/.next/static/chunks/app/api/sessions/[id]/route-d6f52627eddf9119.js +0 -1
  336. package/.next/static/chunks/app/api/sessions/[id]/state/route-d6f52627eddf9119.js +0 -1
  337. package/.next/static/chunks/app/api/sessions/[id]/todos/route-d6f52627eddf9119.js +0 -1
  338. package/.next/static/chunks/app/api/sessions/route-d6f52627eddf9119.js +0 -1
  339. package/.next/static/chunks/app/api/skills/check/route-d6f52627eddf9119.js +0 -1
  340. package/.next/static/chunks/app/api/skills/install/route-d6f52627eddf9119.js +0 -1
  341. package/.next/static/chunks/app/api/skills/route-d6f52627eddf9119.js +0 -1
  342. package/.next/static/chunks/app/api/skills/search/route-d6f52627eddf9119.js +0 -1
  343. package/.next/static/chunks/app/api/skills/update/route-d6f52627eddf9119.js +0 -1
  344. package/.next/static/chunks/app/api/task-card-questions/[id]/answer/route-d6f52627eddf9119.js +0 -1
  345. package/.next/static/chunks/app/api/task-card-questions/route-d6f52627eddf9119.js +0 -1
  346. package/.next/static/chunks/app/api/task-cards/[id]/route-d6f52627eddf9119.js +0 -1
  347. package/.next/static/chunks/app/api/task-cards/route-d6f52627eddf9119.js +0 -1
  348. package/.next/static/chunks/app/api/task-scheduler/status/route-d6f52627eddf9119.js +0 -1
  349. package/.next/static/chunks/app/api/tasks/[id]/board/route-d6f52627eddf9119.js +0 -1
  350. package/.next/static/chunks/app/api/tasks/[id]/route-d6f52627eddf9119.js +0 -1
  351. package/.next/static/chunks/app/api/tasks/reorder/route-d6f52627eddf9119.js +0 -1
  352. package/.next/static/chunks/app/api/tasks/route-d6f52627eddf9119.js +0 -1
  353. package/.next/static/chunks/app/api/terminal/[id]/events/route-d6f52627eddf9119.js +0 -1
  354. package/.next/static/chunks/app/api/terminal/[id]/route-d6f52627eddf9119.js +0 -1
  355. package/.next/static/chunks/app/api/terminal/route-d6f52627eddf9119.js +0 -1
  356. package/.next/static/chunks/app/api/worktrees/route-d6f52627eddf9119.js +0 -1
  357. package/.next/static/chunks/app/manifest.webmanifest/route-d6f52627eddf9119.js +0 -1
  358. package/.next/static/chunks/app/page-2c87c41e7f848f45.js +0 -89
  359. package/.next/static/chunks/e3e7ddb2.a35db430b3564999.js +0 -1
  360. package/.next/static/chunks/next/dist/client/components/builtin/app-error-d6f52627eddf9119.js +0 -1
  361. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-d6f52627eddf9119.js +0 -1
  362. package/.next/static/chunks/next/dist/client/components/builtin/not-found-d6f52627eddf9119.js +0 -1
  363. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-d6f52627eddf9119.js +0 -1
  364. package/.next/static/chunks/webpack-4bbf04891e910713.js +0 -1
  365. package/.next/static/css/80c818c5781fbadc.css +0 -4
  366. package/.next/static/css/d3a2b5077b52c727.css +0 -1
  367. package/.next/types/app/api/boards/[id]/canvas/route.ts +0 -353
  368. package/.next/types/app/api/boards/[id]/edges/[eid]/route.ts +0 -353
  369. package/.next/types/app/api/boards/[id]/edges/route.ts +0 -353
  370. package/.next/types/app/api/boards/[id]/nodes/[nid]/route.ts +0 -353
  371. package/.next/types/app/api/boards/[id]/nodes/route.ts +0 -353
  372. package/lib/board-search.test.mjs +0 -110
  373. package/lib/board-search.ts +0 -63
  374. package/lib/file-explorer-state.test.mjs +0 -63
  375. package/lib/file-explorer-state.ts +0 -36
  376. package/lib/sync-room-server.mjs +0 -137
  377. /package/.next/server/app/api/boards/[id]/{canvas → reconcile}/route.js.nft.json +0 -0
  378. /package/.next/static/{IzmOG04jJst1VpUvr_fr5 → 12RFLqhiUZG8Sj49T1KKQ}/_buildManifest.js +0 -0
  379. /package/.next/static/{IzmOG04jJst1VpUvr_fr5 → 12RFLqhiUZG8Sj49T1KKQ}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3051],{94833:(e,t,i)=>{i.d(t,{K:()=>ea});var s=i(83102),r=i(54530),n=i(81467),a=i(24167),o=i(64411),h=i(43631),l=i(36649),p=i(52800),d=i(43336),g=i(97986),u=i(15727),c=i(48077),S=i(2311),f=i(19065),m=i(84469),y=i(89658),I=i(65390),P=i(59830),C=i(58347),w=i(75567),_=i(81962),x=i(54939),T=i(93286),b=i(46195),v=i(28879),E=i(23919),k=i(11421),A=i(4343),B=i(48877),M=i(69409),F=i(4599),U=i(20026),R=i(92599),O=i(1793),z=i(98466),L=i(49450),K=i(68935),D=i(32314),V=i(79224),W=i(98626),H=i(49402),N=i(51286),Z=i(8810),G=i(12318),X=i(99714),Y=i(73578),q=i(17858),j=i(2642),Q=i(43502),$=i(31832),J=i(40002),ee=i(13004),et=i(61307),ei=i(78943),es=Object.defineProperty,er=Object.getOwnPropertyDescriptor,en=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?er(t,i):t,a=e.length-1;a>=0;a--)(r=e[a])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&es(t,i,n),n};class ea extends o{id=(0,a.NF)();constructor({store:e,user:t,shapeUtils:i,bindingUtils:r,assetUtils:o,overlayUtils:g,tools:c,getContainer:S,cameraOptions:f,initialState:m,autoFocus:y,options:P,textOptions:C,getShapeVisibility:w,colorScheme:_,fontAssetUrls:x,themes:T,initialTheme:b}){super(),this._getShapeVisibility=w;const v=C?{...P,text:P?.text??C}:P;this.options={...I._,...v},this.store=e,this.history=new Z.c({store:e,annotateError:e=>{this.annotateError(e,{origin:"history.batch",willCrashApp:!0}),this.crash(e)}}),this.snaps=new q.m(this),this._spatialIndex=new j.i(this),this.disposables.add(()=>this._spatialIndex.dispose()),this.disposables.add(this.timers.dispose),this._cameraOptions.set({...u.zd,...f,...v?.camera}),this.getContainer=S,this._textOptions=(0,s.eU)("text options",v?.text??null),this.user=new ee.f(t??(0,h.b)(),_??"light"),this.disposables.add(()=>this.user.dispose()),this.textMeasure=new Q.T(this),this.disposables.add(()=>this.textMeasure.dispose()),this._themeManager=new $.N(this,{themes:(0,$.P)(T),initial:b??"default"}),this.disposables.add(()=>this._themeManager.dispose()),this._tickManager=new J.D(this),this.disposables.add(()=>this._tickManager.dispose()),this.disposables.add(()=>{this._setCameraState("idle")}),this.fonts=new N.L(this,x),this.disposables.add(()=>this.fonts.dispose()),this.inputs=new G.v(this),this.disposables.add(()=>this.inputs.dispose()),this.performance=new X._(this),this.disposables.add(()=>this.performance.dispose()),this.collaborators=new V.f(this);class E extends ei.y{static initial=m??""}this.root=new E(this),this.root.children={},this.markEventAsHandled=this.markEventAsHandled.bind(this);const k=(0,d.u)(i),A={},B={},M=new Map;for(const e of k){const t=new e(this);A[e.type]=t;const i=(0,n.lg)(e.props??{});for(const t of(B[e.type]=i,i.keys()))if(M.has(t.id)){if(M.get(t.id)!==t)throw Error(`Multiple style props with id "${t.id}" in use. Style prop IDs must be unique.`)}else M.set(t.id,t)}this.shapeUtils=A,this.styleProps=B;const F={};for(const e of k){const t=e.handledAssetTypes;if(t)for(const i of t)F[i]=A[e.type]}this._shapeUtilsByAssetType=F;const U=(0,p.t)(r),R={};for(const e of U){const t=new e(this);R[e.type]=t}if(this.bindingUtils=R,o){const e=(0,l.U)(o),t={};for(const i of e){const e=new i(this);t[i.type]=e}this.assetUtils=t}for(const e of[...c]){if((0,a.mQ)(this.root.children,e.id))throw Error(`Can't override tool with id "${e.id}"`);this.root.children[e.id]=new e(this,this.root)}if(this.scribbles=new Y.y(this),this.overlays=new et.Q(this),this.disposables.add(()=>this.overlays.dispose()),g)for(const e of g){const t=new e(this);this.overlays.registerUtil(t)}const O=(e,t)=>{let i=null,s=e.selectedShapeIds.filter(e=>!t.has(e));s.length!==e.selectedShapeIds.length&&(i||(i={...e}),i.selectedShapeIds=s);let r=e.erasingShapeIds.filter(e=>!t.has(e));r.length!==e.erasingShapeIds.length&&(i||(i={...e}),i.erasingShapeIds=r),e.hoveredShapeId&&t.has(e.hoveredShapeId)&&(i||(i={...e}),i.hoveredShapeId=null),e.editingShapeId&&t.has(e.editingShapeId)&&(i||(i={...e}),i.editingShapeId=null);let n=e.hintingShapeIds.filter(e=>!t.has(e));return n.length!==e.hintingShapeIds.length&&(i||(i={...e}),i.hintingShapeIds=n),e.focusedGroupId&&t.has(e.focusedGroupId)&&(i||(i={...e}),i.focusedGroupId=null),i};this.sideEffects=this.store.sideEffects;let z=new Map;const D=new Set,es=new Set,er=new Set;let en=new Set;if(this.disposables.add(this.sideEffects.registerOperationCompleteHandler(()=>{let e=D.size?new Set(D):null;if(D.clear(),e){let t=(0,a.oE)(this.getPageStates().map(t=>O(t,e)));t.length&&this.store.put(t)}let t=new Set(er);for(let e of(er.clear(),es)){if(es.delete(e),t.has(e))continue;let i=this.getShape(e);if(!i)continue;let s=this.getShapeUtil(i),r=s.onChildrenChange?.(i);r?.length&&this.updateShapes(r)}if(en.size){let e=en;for(let t of(en=new Set,e)){let e=this.getBindingUtil(t);e.onOperationComplete?.()}}if(z.size){let e=z;for(let t of(z=new Map,e.values()))this.getBindingUtil(t.binding).onAfterDelete?.(t)}this.emit("update")})),this.disposables.add(this.sideEffects.register({shape:{afterCreate:e=>{er.add(e.id),e.parentId&&(0,n.vc)(e.parentId)&&es.add(e.parentId)},afterChange:(e,t)=>{for(let i of this.getBindingsInvolvingShape(t))en.add(i.type),i.fromId===t.id&&this.getBindingUtil(i).onAfterChangeFromShape?.({binding:i,shapeBefore:e,shapeAfter:t,reason:"self"}),i.toId===t.id&&this.getBindingUtil(i).onAfterChangeToShape?.({binding:i,shapeBefore:e,shapeAfter:t,reason:"self"});if(e.parentId!==t.parentId){let e=e=>{let t=this.getShape(e);if(t)for(let e of this.getBindingsInvolvingShape(t))en.add(e.type),e.fromId===t.id&&this.getBindingUtil(e).onAfterChangeFromShape?.({binding:e,shapeBefore:t,shapeAfter:t,reason:"ancestry"}),e.toId===t.id&&this.getBindingUtil(e).onAfterChangeToShape?.({binding:e,shapeBefore:t,shapeAfter:t,reason:"ancestry"})};e(t.id),this.visitDescendants(t.id,e)}if(e.parentId!==t.parentId&&(0,n.xh)(t.parentId)){let i=new Set([e.id]);for(let s of(this.visitDescendants(e.id,e=>{i.add(e)}),this.getPageStates())){if(s.pageId===t.parentId)continue;let e=O(s,i);e&&this.store.put([e])}}e.parentId&&(0,n.vc)(e.parentId)&&es.add(e.parentId),t.parentId!==e.parentId&&(0,n.vc)(t.parentId)&&es.add(t.parentId)},beforeDelete:e=>{if(D.has(e.id))return;e.parentId&&(0,n.vc)(e.parentId)&&es.add(e.parentId),D.add(e.id);let t=[];for(let i of this.getBindingsInvolvingShape(e)){en.add(i.type),t.push(i.id);let s=this.getBindingUtil(i);i.fromId===e.id?(s.onBeforeIsolateToShape?.({binding:i,removedShape:e}),s.onBeforeDeleteFromShape?.({binding:i,shape:e})):(s.onBeforeIsolateFromShape?.({binding:i,removedShape:e}),s.onBeforeDeleteToShape?.({binding:i,shape:e}))}t.length&&this.deleteBindings(t)}},binding:{beforeCreate:e=>{let t=this.getBindingUtil(e).onBeforeCreate?.({binding:e});return t||e},afterCreate:e=>{en.add(e.type),this.getBindingUtil(e).onAfterCreate?.({binding:e})},beforeChange:(e,t)=>{let i=this.getBindingUtil(t).onBeforeChange?.({bindingBefore:e,bindingAfter:t});return i||t},afterChange:(e,t)=>{en.add(t.type),this.getBindingUtil(t).onAfterChange?.({bindingBefore:e,bindingAfter:t})},beforeDelete:e=>{this.getBindingUtil(e).onBeforeDelete?.({binding:e})},afterDelete:e=>{this.getBindingUtil(e).onAfterDelete?.({binding:e}),en.add(e.type)}},page:{afterCreate:e=>{let t=n.Xu.createId(e.id),i=n.jA.createId(e.id);this.store.has(t)||this.store.put([n.Xu.create({id:t})]),this.store.has(i)||this.store.put([n.jA.create({id:i,pageId:e.id})])},afterDelete:(e,t)=>{if(this.getInstanceState()?.currentPageId===e.id){let i=this.getPages().find(t=>t.id!==e.id)?.id;i?this.store.put([{...this.getInstanceState(),currentPageId:i}]):"user"===t&&this.store.ensureStoreIsUsable()}let i=n.Xu.createId(e.id),s=n.jA.createId(e.id);this.store.remove([i,s])}},instance:{afterChange:(e,t,i)=>{if(!this.store.has(t.currentPageId)){let s=this.store.has(e.currentPageId)?e.currentPageId:this.getPages()[0]?.id;s?this.store.update(t.id,e=>({...e,currentPageId:s})):"user"===i&&this.store.ensureStoreIsUsable()}}},instance_page_state:{afterChange:(e,t)=>{if(e?.focusedGroupId!==t?.focusedGroupId&&this.cancelDoubleClick(),e?.selectedShapeIds!==t?.selectedShapeIds){let e=t.selectedShapeIds.filter(e=>{let i=this.getShape(e)?.parentId;for(;(0,n.vc)(i);){if(t.selectedShapeIds.includes(i))return!1;i=this.getShape(i)?.parentId}return!0}),i=null;if(e.length>0){let t=this.findCommonAncestor((0,a.oE)(e.map(e=>this.getShape(e))),e=>this.isShapeOfType(e,"group"));t&&(i=t)}else t?.focusedGroupId&&(i=t.focusedGroupId);(e.length!==t.selectedShapeIds.length||i!==t.focusedGroupId)&&this.store.put([{...t,selectedShapeIds:e,focusedGroupId:i??null}])}}}})),this._currentPageShapeIds=(0,K.A)(this.store,()=>this.getCurrentPageId()),this._parentIdsToChildIds=(0,L.i)(this.store),this.disposables.add(this.store.listen(e=>{this.emit("change",e)})),this.disposables.add(this.history.dispose),this.run(()=>{this.store.ensureStoreIsUsable(),this._updateCurrentPageState({editingShapeId:null,hoveredShapeId:null,erasingShapeIds:[]})},{history:"ignore"}),m&&void 0===this.root.children[m])throw Error(`No state found for initialState "${m}".`);if(this.root.enter(void 0,"initial"),this.edgeScrollManager=new W.w(this),this.focusManager=new H.c(this,y),this.disposables.add(()=>this.focusManager.dispose()),this.getInstanceState().followingUserId&&this.stopFollowingUser(),this.on("tick",this._flushEventsForTick),this.on("mount",()=>{this._isMounted.set(!0)}),this.on("unmount",()=>{this._isMounted.set(!1)}),this.timers.requestAnimationFrame(()=>{this._tickManager.start()}),this.performanceTracker=new a.f6,this.store.props.collaboration?.mode){const e=this.store.props.collaboration.mode;this.disposables.add((0,s.wv)("update collaboration mode",()=>{this.store.put([{...this.getInstanceState(),isReadonly:"readonly"===e.get()}])}))}this.disposables.add((0,s.wv)("sync current user record",()=>{let e=this.store.props.users.currentUser.get();e&&this._ensureUserRecord(e)}))}_getShapeVisibility;getIsShapeHiddenCache(){return this._getShapeVisibility?this.store.createComputedCache("isShapeHidden",e=>{let t=this._getShapeVisibility(e,this);return!n.tv.isId(e.parentId)&&this.isShapeHidden(e.parentId)?"visible"!==t:"hidden"===t}):null}isShapeHidden(e){return!!this._getShapeVisibility&&!!this.getIsShapeHiddenCache().get("string"==typeof e?e:e.id)}options;licenseManager;contextId=(0,a.NF)();store;root;setTool(e,t){if(t??=this.root,(0,a.mQ)(t.children,e.id))throw Error(`Can't override tool with id "${e.id}"`);t.children[e.id]=new e(this,t)}removeTool(e,t){t??=this.root,(0,a.mQ)(t.children,e.id)&&delete t.children[e.id]}disposables=new Set;isDisposed=!1;_isMounted=(0,s.eU)("isMounted",!1);getIsMounted(){return this._isMounted.get()}_tickManager;inputs;snaps;performance;_spatialIndex;timers=y.s.forContext(this.contextId);collaborators;user;_themeManager;textMeasure;fonts;scribbles;overlays;sideEffects;edgeScrollManager;focusManager;getContainer;getContainerDocument(){return this.getContainer().ownerDocument}getContainerWindow(){return(0,c.mD)(this.getContainer())}dispose(){this._isMounted.get()&&this.emit("unmount"),this.stopCameraAnimation(),this.getInstanceState().followingUserId&&this.stopFollowingUser(),this.disposables.forEach(e=>e()),this.disposables.clear(),this.menus.clearOpenMenus(),this.store.dispose(),this.isDisposed=!0,this.emit("dispose"),this.removeAllListeners()}getColorMode(){return this._themeManager.getColorMode()}setColorMode(e){return this.user.updateUserPreferences({colorScheme:e}),this}getCurrentThemeId(){return this._themeManager.getCurrentThemeId()}getCurrentTheme(){return this._themeManager.getCurrentTheme()}setCurrentTheme(e){return this._themeManager.setCurrentTheme(e),this}getThemes(){return this._themeManager.getThemes()}getTheme(e){return this._themeManager.getTheme(e)}updateThemes(e){return this._themeManager.updateThemes(e),this}updateTheme(e){return this._themeManager.updateTheme(e),this}shapeUtils;_shapeUtilsByAssetType={};styleProps;getShapeUtil(e){let t="string"==typeof e?e:e.type,i=(0,a.g5)(this.shapeUtils,t);return(0,a.vA)(i,`No shape util found for type "${t}"`),i}hasShapeUtil(e){let t="string"==typeof e?e:e.type;return(0,a.mQ)(this.shapeUtils,t)}getShapeUtilForAssetType(e){return(0,a.g5)(this._shapeUtilsByAssetType,e)}bindingUtils;getBindingUtil(e){let t="string"==typeof e?e:e.type,i=(0,a.g5)(this.bindingUtils,t);return(0,a.vA)(i,`No binding util found for type "${t}"`),i}assetUtils={};getAssetUtil(e){let t="string"==typeof e?e:e.type,i=(0,a.g5)(this.assetUtils,t);return(0,a.vA)(i,`No asset util found for type "${t}"`),i}hasAssetUtil(e){let t="string"==typeof e?e:e.type;return(0,a.mQ)(this.assetUtils,t)}getAssetUtilForMimeType(e){for(let t of Object.values(this.assetUtils))if(t&&t.acceptsMimeType(e))return t;return null}history;undo(){return this._flushEventsForTick(0),this.complete(),this.history.undo(),this.performance._notifyUndoRedo("undo",this.history.getNumUndos(),this.history.getNumRedos()),this}canUndo(){return this.history.getNumUndos()>0}getCanUndo(){return this.canUndo()}redo(){return this._flushEventsForTick(0),this.complete(),this.history.redo(),this.performance._notifyUndoRedo("redo",this.history.getNumUndos(),this.history.getNumRedos()),this}canRedo(){return this.history.getNumRedos()>0}getCanRedo(){return this.canRedo()}clearHistory(){return this.history.clear(),this}markHistoryStoppingPoint(e){let t=`[${e??"stop"}]_${(0,a.NF)()}`;return this.history._mark(t),t}getMarkIdMatching(e){return this.history.getMarkIdMatching(e)}isReplayingHistory(){return this.history.isReplaying()}squashToMark(e){return this.history.squashToMark(e),this}bail(){return this.history.bail(),this}bailToMark(e){return this.history.bailToMark(e),this}_shouldIgnoreShapeLock=!1;run(e,t){let i=this._shouldIgnoreShapeLock;this._shouldIgnoreShapeLock=t?.ignoreShapeLock??i;try{this.history.batch(e,t)}finally{this._shouldIgnoreShapeLock=i}return this}annotateError(e,{origin:t,willCrashApp:i,tags:s,extras:r}){let n=this.createErrorAnnotations(t,i);return(0,a.TF)(e,{tags:{...n.tags,...s},extras:{...n.extras,...r}}),i&&this.store.markAsPossiblyCorrupted(),this}createErrorAnnotations(e,t){try{let i=this.getEditingShapeId();return{tags:{origin:e,willCrashApp:t},extras:{activeStateNode:this.root.getPath(),selectedShapes:this.getSelectedShapes().map(e=>{let{props:t,...i}=e,{text:s,richText:r,...n}=t;return{...i,props:n}}),selectionCount:this.getSelectedShapes().length,editingShape:i?this.getShape(i):void 0,inputs:this.inputs.toJson(),pageState:this.getCurrentPageState(),instanceState:this.getInstanceState(),collaboratorCount:this.getCollaboratorsOnCurrentPage().length}}}catch{return{tags:{origin:e,willCrashApp:t},extras:{}}}}_crashingError=null;getCrashingError(){return this._crashingError}crash(e){return this._crashingError=e,this.store.markAsPossiblyCorrupted(),this.emit("crash",{error:e}),this}getPath(){return this.root.getPath().split("root.")[1]}isIn(e){let t=e.split(".").reverse(),i=this.root;for(;t.length>0;){let e=t.pop();if(!e)return!0;let s=i.getCurrent();if(s?.id===e){if(0===t.length)return!0;i=s;continue}break}return!1}isInAny(...e){return e.some(e=>this.isIn(e))}setCurrentTool(e,t={}){return this.root.transition(e,t),this}getCurrentTool(){return this.root.getCurrent()}getCurrentToolId(){let e=this.getCurrentTool();return e?e.getCurrentToolIdMask()??e.id:""}getStateDescendant(e){let t=e.split(".").reverse(),i=this.root;for(;t.length>0;){let e=t.pop();if(!e)break;let s=i.children?.[e];if(!s)return;i=s}return i}getDocumentSettings(){return this.store.get(n.yI)}updateDocumentSettings(e){return this.run(()=>{this.store.put([{...this.getDocumentSettings(),...e}])},{history:"ignore"}),this}getInstanceState(){return this.store.get(n.O9)}updateInstanceState(e,t){return this._updateInstanceState(e,{history:"ignore",...t}),void 0!==e.isChangingStyle&&(clearTimeout(this._isChangingStyleTimeout),!0===e.isChangingStyle&&(this._isChangingStyleTimeout=this.timers.setTimeout(()=>{this._updateInstanceState({isChangingStyle:!1},{history:"ignore"})},1e3))),this}_updateInstanceState(e,t){this.run(()=>{this.store.put([{...this.getInstanceState(),...e}])},t)}_isChangingStyleTimeout=-1;menus=m.N.forContext(this.contextId);setCursor(e){let t=this.getInstanceState().cursor;return(void 0===e.type||e.type===t.type)&&(void 0===e.rotation||e.rotation===t.rotation)||this.updateInstanceState({cursor:{...t,...e}}),this}getPageStates(){return this._getPageStatesQuery().get()}_getPageStatesQuery(){return this.store.query.records("instance_page_state")}getCurrentPageState(){return this.store.get(this._getCurrentPageStateId())}_getCurrentPageStateId(){return n.jA.createId(this.getCurrentPageId())}updateCurrentPageState(e){return this._updateCurrentPageState(e),this}_updateCurrentPageState(e){this.store.update(e.id??this.getCurrentPageState().id,t=>({...t,...e}))}getSelectedShapeIds(){return this.getCurrentPageState().selectedShapeIds}getSelectedShapes(){return(0,a.oE)(this.getSelectedShapeIds().map(e=>this.store.get(e)))}setSelectedShapes(e){return this.run(()=>{let t=e.map(e=>"string"==typeof e?e:e.id),{selectedShapeIds:i}=this.getCurrentPageState(),s=new Set(i);if(t.length===s.size&&t.every(e=>s.has(e)))return null;this.store.put([{...this.getCurrentPageState(),selectedShapeIds:t}])},{history:"record-preserveRedoStack"})}isAncestorSelected(e){let t="string"==typeof e?e:e?.id??null,i=this.getShape(t);if(!i)return!1;let s=this.getSelectedShapeIds();return!!this.findShapeAncestor(i,e=>s.includes(e.id))}select(...e){let t="string"==typeof e[0]?e:e.map(e=>e.id);return this.setSelectedShapes(t),this}deselect(...e){let t="string"==typeof e[0]?e:e.map(e=>e.id),i=this.getSelectedShapeIds();return i.length>0&&t.length>0&&this.setSelectedShapes(i.filter(e=>!t.includes(e))),this}selectAll(){let e=null,t=this.getSelectedShapeIds();if(t.length>0)for(let i of t){let t=this.getShape(i);if(t){if(null===e)e=t.parentId;else if(e!==t.parentId)return this}}e||(e=this.getCurrentPageId());let i=this.getSortedChildIdsForParent(e);return i.length<=0||this.setSelectedShapes(this._getUnlockedShapeIds(i)),this}selectAdjacentShape(e){let t,i=this.getSelectedShapeIds(),s=i[0]?this.getShape(i[0])?.parentId:null,r=s&&i.every(e=>this.getShape(e)?.parentId===s)&&!(0,n.xh)(s),a=r?this.getCurrentPageShapes().filter(e=>e.parentId===s):this.getCurrentPageShapes().filter(e=>(0,n.xh)(e.parentId)),o=r?this._getShapesInReadingOrder(a):this.getCurrentPageShapesInReadingOrder(),h=1===i.length?i[0]:o.find(e=>i.includes(e.id))?.id;if("next"===e||"prev"===e){let i=o.map(e=>e.id),s=((h?i.indexOf(h):-1)+("next"===e?1:-1)+i.length)%i.length;t=i[s]}else{if(!h)return;t=this.getNearestAdjacentShape(a,h,e)}let l=this.getShape(t);l&&this._selectShapesAndZoom([l.id])}getCurrentPageShapesInReadingOrder(){let e=this.getCurrentPageShapes().filter(e=>(0,n.xh)(e.parentId));return this._getShapesInReadingOrder(e)}_getShapesInReadingOrder(e){let t=e.filter(e=>this.getShapeUtil(e).canTabTo(e));if(t.length<=1)return t;let i=t.map(e=>({shape:e,center:this.getShapePageBounds(e).center}));i.sort((e,t)=>e.center.y-t.center.y);let s=[];for(let e of i){let t=-1;for(let i=s.length-1;i>=0;i--){let r=s[i],n=r[r.length-1];if(100>Math.abs(e.center.y-n.center.y)){t=i;break}}-1===t?s.push([e]):s[t].push(e)}for(let e of s)e.sort((e,t)=>e.center.x-t.center.x);for(let e of s)if(!(e.length<=2))for(let t=0;t<e.length-2;t++){let i=e[t],s=e[t+1],r=e[t+2],n=b.l.Dist2(i.center,s.center);b.l.Dist2(i.center,r.center)<.9*n&&20>=Math.abs(b.l.Angle(i.center,r.center)*(180/Math.PI))&&([e[t+1],e[t+2]]=[e[t+2],e[t+1]])}return s.flat().map(e=>e.shape)}getNearestAdjacentShape(e,t,i){let s={right:0,left:180,down:90,up:270},r=this.getShape(t);if(!r)return t;let n=e.filter(e=>this.getShapeUtil(e).canTabTo(e)&&e.id!==t);if(!n.length)return t;let o=this.getShapePageBounds(r).center,h=n.map(e=>({shape:e,center:this.getShapePageBounds(e).center})).filter(({center:e})=>{let t=e.x>o.x,s=e.y>o.y,r=e.x-o.x,n=e.y-o.y,a=Math.abs(n)<2*Math.abs(r),h=Math.abs(r)<2*Math.abs(n);return"left"===i||"right"===i?a&&("right"===i?t:!t):"up"===i||"down"===i?h&&("down"===i?s:!s):void 0});return 0===h.length?t:(0,a.wq)(h,({center:e})=>{let t=b.l.Dist2(o,e),r=["left","right"].includes(i)?"x":"y",n=Math.abs(e[r]-o[r]),a=["left","right"].includes(i)?"y":"x";return+t+2*Math.abs(e[a]-o[a])+(t-n)*1.5+.5*Math.abs(Math.abs(b.l.Angle(o,e)*(180/Math.PI))-s[i])}).shape.id}selectParentShape(){let e=this.getOnlySelectedShape();if(!e)return;let t=this.getShape(e.parentId);t&&this._selectShapesAndZoom([t.id])}selectFirstChildShape(){let e=this.getSelectedShapes();if(!e.length)return;let t=e[0],i=this.getSortedChildIdsForParent(t.id).map(e=>this.getShape(e)).filter(e=>e),s=this._getShapesInReadingOrder(i);0!==s.length&&this._selectShapesAndZoom([s[0].id])}_selectShapesAndZoom(e){this.setSelectedShapes(e),this.zoomToSelectionIfOffscreen(256,{animation:{duration:this.options.animationMediumMs},inset:0})}selectNone(){return this.getSelectedShapeIds().length>0&&this.setSelectedShapes([]),this}getOnlySelectedShapeId(){return this.getOnlySelectedShape()?.id??null}getOnlySelectedShape(){let e=this.getSelectedShapes();return 1===e.length?e[0]:null}getShapesPageBounds(e){let t=(0,a.oE)(e.map(e=>this.getShapePageBounds(e)));return 0===t.length?null:P.az.Common(t)}getSelectionPageBounds(){return this.getShapesPageBounds(this.getSelectedShapeIds())}getSelectionScreenBounds(){let e=this.getSelectionPageBounds();if(!e)return;let{x:t,y:i}=this.pageToScreen(e.point),s=this.getZoomLevel();return new P.az(t,i,e.width*s,e.height*s)}getShapesSharedRotation(e){let t=!1,i=0;for(let s=0,r=e.length;s<r;s++){let r=this.getShapePageTransform(e[s]);if(r)if(t){if(r.rotation()!==i)return 0}else t=!0,i=r.rotation()}return i}getSelectionRotation(){return this.getShapesSharedRotation(this.getSelectedShapeIds())}getShapesRotatedPageBounds(e){if(0===e.length)return;let t=this.getShapesSharedRotation(e);if(0===t)return this.getShapesPageBounds(e)??void 0;if(1===e.length){let t=this.getShapeGeometry(e[0]).bounds.clone();return t.point=this.getShapePageTransform(e[0]).applyToPoint(t.point),t}let i=P.az.FromPoints(e.flatMap(e=>{let t=this.getShapePageTransform(e);return t?t.applyToPoints(this.getShapeGeometry(e).bounds.corners):[]}).map(e=>e.rot(-t)));return i.point=i.point.rot(t),i}getSelectionRotatedPageBounds(){return this.getShapesRotatedPageBounds(this.getSelectedShapeIds())}getSelectionRotatedScreenBounds(){let e=this.getSelectionRotatedPageBounds();if(!e)return;let{x:t,y:i}=this.pageToScreen(e.point),s=this.getZoomLevel();return new P.az(t,i,e.width*s,e.height*s)}getFocusedGroupId(){return this.getCurrentPageState().focusedGroupId??this.getCurrentPageId()}getFocusedGroup(){let e=this.getFocusedGroupId();return e?this.getShape(e):void 0}setFocusedGroup(e){let t="string"==typeof e?e:e?.id??null;if(null!==t){let e=this.getShape(t);if(!e)throw Error(`Editor.setFocusedGroup: Shape with id ${t} does not exist`);if(!this.isShapeOfType(e,"group"))throw Error(`Editor.setFocusedGroup: Cannot set focused group to shape of type ${e.type}`)}return t===this.getFocusedGroupId()?this:this.run(()=>{this.store.update(this.getCurrentPageState().id,e=>({...e,focusedGroupId:t}))},{history:"record-preserveRedoStack"})}popFocusedGroupId(){let e=this.getFocusedGroup();if(e){let t=this.findShapeAncestor(e,e=>this.isShapeOfType(e,"group"));this.setFocusedGroup(t?.id??null),this.select(e.id)}else this.setFocusedGroup(null),this.selectNone();return this}getEditingShapeId(){return this.getCurrentPageState().editingShapeId}getEditingShape(){let e=this.getEditingShapeId();return e?this.getShape(e):void 0}canEditShape(e,t){let i="string"==typeof e?e:e?.id??null;if(!i||i===this.getEditingShapeId())return!1;let s=this.getShape(i);if(!s)return!1;let r=this.getShapeUtil(s);return!(!r.canEdit(s,t??{type:"unknown"})||this.getIsReadonly()&&!r.canEditInReadonly(s)||this.isShapeOrAncestorLocked(s)&&!r.canEditWhileLocked(s))}setEditingShape(e){let t="string"==typeof e?e:e?.id??null;return t?this.canEditShape(t)&&this.run(()=>{let e=this.getEditingShapeId();if(e){let t=this.getShape(e);t&&this.getShapeUtil(t).onEditEnd?.(t)}this._updateCurrentPageState({editingShapeId:null}),this._currentRichTextEditor.set(null),this.select(t),this._updateCurrentPageState({editingShapeId:t});let i=this.getShape(t);this.getShapeUtil(i).onEditStart?.(i)},{history:"ignore"}):this.run(()=>{let e=this.getEditingShapeId();if(e){let t=this.getShape(e);t&&this.getShapeUtil(t).onEditEnd?.(t)}this._updateCurrentPageState({editingShapeId:null}),this._currentRichTextEditor.set(null)},{history:"ignore"}),this}_currentRichTextEditor=(0,s.eU)("rich text editor",null);getRichTextEditor(){return this._currentRichTextEditor.get()}setRichTextEditor(e){return this._currentRichTextEditor.set(e),this}getHoveredShapeId(){return this.getCurrentPageState().hoveredShapeId}getHoveredShape(){let e=this.getHoveredShapeId();return e?this.getShape(e):void 0}setHoveredShape(e){let t="string"==typeof e?e:e?.id??null;return t===this.getHoveredShapeId()||this.run(()=>{this.updateCurrentPageState({hoveredShapeId:t})},{history:"ignore"}),this}getHintingShapeIds(){return this.getCurrentPageState().hintingShapeIds}getHintingShape(){let e=this.getHintingShapeIds();return(0,a.oE)(e.map(e=>this.getShape(e)))}setHintingShapes(e){let t="string"==typeof e[0]?e:e.map(e=>e.id);return this.run(()=>{this._updateCurrentPageState({hintingShapeIds:(0,a.Qq)(t)})},{history:"ignore"}),this}getErasingShapeIds(){return this.getCurrentPageState().erasingShapeIds}getErasingShapes(){let e=this.getErasingShapeIds();return(0,a.oE)(e.map(e=>this.getShape(e)))}setErasingShapes(e){let t="string"==typeof e[0]?e:e.map(e=>e.id);t.sort();let i=this.getErasingShapeIds();return this.run(()=>{if(t.length===i.length){for(let e=0;e<t.length;e++)if(t[e]!==i[e]){this._updateCurrentPageState({erasingShapeIds:t});break}}else this._updateCurrentPageState({erasingShapeIds:t})},{history:"ignore"}),this}getCroppingShapeId(){return this.getCurrentPageState().croppingShapeId}canCropShape(e){if(!e)return!1;let t="string"==typeof e?e:e?.id??null;if(!t)return!1;let i=this.getShape(t);return!(!i||!this.getShapeUtil(i).canCrop(i)||this.isShapeOrAncestorLocked(i))}setCroppingShape(e){let t="string"==typeof e?e:e?.id??null;return t!==this.getCroppingShapeId()&&this.run(()=>{t?this.canCropShape(t)&&this.updateCurrentPageState({croppingShapeId:t}):this.updateCurrentPageState({croppingShapeId:null})},{history:"ignore"}),this}_textOptions;getTextOptions(){return(0,a.Z1)(this._textOptions.get(),"Cannot use text without setting textOptions")}_unsafe_getCameraId(){return n.Xu.createId(this.getCurrentPageId())}getCamera(){let e=this.store.get(this._unsafe_getCameraId());if(this._isLockedOnFollowingUser.get()){let t=this.getCameraForFollowing();if(t)return{...e,...t}}return e}_getFollowingPresence(e){let t=[this.user.getRecordId()],i=this.getCollaborators(),s=null;for(;e&&!t.includes(e);)s=i.find(t=>t.userId===e)??null,e=s?.followingUserId??null,s&&t.push(s.userId);return s}getViewportPageBoundsForFollowing(){let e=this._getFollowingPresence(this.getInstanceState().followingUserId);if(!e?.camera||!e?.screenBounds)return null;let{w:t,h:i}=e.screenBounds,{x:s,y:r,z:n}=e.camera,a=new P.az(-s,-r,t/n,i/n),o=this.getViewportScreenBounds().clone(),h=o.width/o.height;return o.width=a.width,o.height=o.width/h,o.height<a.height&&(o.height=a.height,o.width=o.height*h),o.center=a.center,o}getCameraForFollowing(){let e=this.getViewportPageBoundsForFollowing();return e?{x:-e.x,y:-e.y,z:this.getViewportScreenBounds().w/e.width}:null}getZoomLevel(){return this.getCamera().z}getResizeScaleFactor(){return this.user.getIsDynamicResizeMode()?1/this.getZoomLevel():1}_debouncedZoomLevel=(0,s.eU)("debounced zoom level",1);getDebouncedZoomLevel(){if(this.options.debouncedZoom&&"idle"!==this.getCameraState())return this._debouncedZoomLevel.get();return this.getZoomLevel()}_getAboveDebouncedZoomThreshold(){return this.getCurrentPageShapeIds().size>this.options.debouncedZoomThreshold}getEfficientZoomLevel(){return this._getAboveDebouncedZoomThreshold()?this.getDebouncedZoomLevel():this.getZoomLevel()}getInitialZoom(){let e=this.getCameraOptions();if(!e.constraints||"default"===e.constraints.initialZoom)return 1;let{zx:t,zy:i}=ep(this,e);switch(e.constraints.initialZoom){case"fit-min":return Math.max(t,i);case"fit-max":return Math.min(t,i);case"fit-x":return t;case"fit-y":return i;case"fit-min-100":return Math.min(1,Math.max(t,i));case"fit-max-100":return Math.min(1,Math.min(t,i));case"fit-x-100":return Math.min(1,t);case"fit-y-100":return Math.min(1,i);default:throw(0,a.h6)(e.constraints.initialZoom)}}getBaseZoom(){let e=this.getCameraOptions();if(!e.constraints||"default"===e.constraints.baseZoom)return 1;let{zx:t,zy:i}=ep(this,e);switch(e.constraints.baseZoom){case"fit-min":return Math.max(t,i);case"fit-max":return Math.min(t,i);case"fit-x":return t;case"fit-y":return i;case"fit-min-100":return Math.min(1,Math.max(t,i));case"fit-max-100":return Math.min(1,Math.min(t,i));case"fit-x-100":return Math.min(1,t);case"fit-y-100":return Math.min(1,i);default:throw(0,a.h6)(e.constraints.baseZoom)}}_cameraOptions=(0,s.eU)("camera options",u.zd);getCameraOptions(){return this._cameraOptions.get()}setCameraOptions(e){let t=(0,a.pN)({...this._cameraOptions.__unsafe__getWithoutCapture(),...e});return t.zoomSteps?.length<1&&(t.zoomSteps=[1]),this._cameraOptions.set(t),this.setCamera(this.getCamera()),this}getConstrainedCamera(e,t){let i=this.getCamera(),{x:s,y:r,z:n=i.z}=e,o=(e,t,s,r)=>{let n=i.z;return s===n?e:e+(t-e)*(1/r-1/n)/(1/s-1/n)};if(!t?.force){let e=this.getCameraOptions(),h=e.zoomSteps[0],l=(0,a.HV)(e.zoomSteps),p=this.getViewportScreenBounds();if(e.constraints){let{constraints:d}=e,g=Math.min(d.padding.y,p.w/2),u=Math.min(d.padding.x,p.h/2),c=P.az.From(e.constraints.bounds),S=(p.w-2*u)/c.w,f=(p.h-2*g)/c.h,m=this.getBaseZoom(),y=l*m,I=h*m;if(t?.reset&&(n=this.getInitialZoom()),n<I||n>y){let e=n;n=(0,T.qE)(n,I,y),s=o(i.x,s,e,n),r=o(i.y,r,e,n)}let C=u/n-c.x,w=g/n-c.y,_=(p.w-2*u)/n-c.w,x=(p.h-2*g)/n-c.h,b=C+_*d.origin.x,v=w+x*d.origin.y,E="string"==typeof d.behavior?d.behavior:d.behavior.x,k="string"==typeof d.behavior?d.behavior:d.behavior.y;if(t?.reset)s=b,r=v;else{switch(E){case"fixed":s=b;break;case"contain":s=n<S?b:(0,T.qE)(s,C+_,C);break;case"inside":s=n<S?(0,T.qE)(s,C,(p.w-u)/n-c.w):(0,T.qE)(s,C+_,C);break;case"outside":s=(0,T.qE)(s,u/n-c.w,(p.w-u)/n);break;case"free":break;default:throw(0,a.h6)(E)}switch(k){case"fixed":r=v;break;case"contain":r=n<f?v:(0,T.qE)(r,w+x,w);break;case"inside":r=n<f?(0,T.qE)(r,w,(p.h-g)/n-c.h):(0,T.qE)(r,w+x,w);break;case"outside":r=(0,T.qE)(r,g/n-c.h,(p.h-g)/n);break;case"free":break;default:throw(0,a.h6)(k)}}}else if(n>l||n<h){let e=n;n=(0,T.qE)(n,h,l),s=o(i.x,s,e,n),r=o(i.y,r,e,n)}}return{x:s,y:r,z:n}}_setCamera(e,t){let i=this.getCamera(),{x:r,y:n,z:a}=this.getConstrainedCamera(e,t);return i.x===r&&i.y===n&&i.z===a||(0,s.hL)(()=>{let e={...i,x:r,y:n,z:a};this.run(()=>{this.store.put([e])},{history:"ignore"});let s=this.inputs.getCurrentScreenPoint(),o=this.inputs.getCurrentPagePoint();(s.x/a-r!==o.x||s.y/a-n!==o.y)&&this.updatePointer({immediate:t?.immediate,pointerId:u.zm.CAMERA_MOVE}),this._tickCameraState()}),this}setCamera(e,t){let{isLocked:i}=this._cameraOptions.__unsafe__getWithoutCapture();if(i&&!t?.force)return this;this.stopCameraAnimation(),this.getInstanceState().followingUserId&&this.stopFollowingUser();let s=b.l.Cast(e);Number.isFinite(s.x)||(s.x=0),Number.isFinite(s.y)||(s.y=0),void 0!==s.z&&Number.isFinite(s.z)||(e.z=this.getZoomLevel());let r=this.getConstrainedCamera(s,t);if(t?.animation){let{width:e,height:i}=this.getViewportScreenBounds();this._animateToViewport(new P.az(-r.x,-r.y,e/r.z,i/r.z),t)}else this._setCamera(r,{...t,force:!0});return this}centerOnPoint(e,t){let{isLocked:i}=this.getCameraOptions();if(i&&!t?.force)return this;let{width:s,height:r}=this.getViewportPageBounds();return this.setCamera(new b.l(-(e.x-s/2),-(e.y-r/2),this.getCamera().z),t),this}zoomToFit(e){let t=[...this.getCurrentPageShapeIds()].filter(e=>!this.isShapeHidden(e));if(t.length<=0)return this;let i=P.az.Common((0,a.oE)(t.map(e=>this.getShapePageBounds(e))));return this.zoomToBounds(i,e),this}resetZoom(e=this.getViewportScreenCenter(),t){let{isLocked:i,constraints:s}=this.getCameraOptions();if(i&&!t?.force)return this;let{x:r,y:n,z:a}=this.getCamera(),{x:o,y:h}=e,l=1;if(s){let e=this.getInitialZoom();a!==e&&(l=e)}return this.setCamera(new b.l(r+(o/l-o)-(o/a-o),n+(h/l-h)-(h/a-h),l),t),this}zoomIn(e=this.getViewportScreenCenter(),t){let{isLocked:i}=this.getCameraOptions();if(i&&!t?.force)return this;let{x:s,y:r,z:n}=this.getCamera(),{zoomSteps:o}=this.getCameraOptions();if(null!==o&&o.length>1){let i=this.getBaseZoom(),h=(0,a.HV)(o)*i;for(let e=1;e<o.length;e++){let t=o[e-1]*i,s=o[e]*i;if(!(s-n<=(s-t)/2)){h=s;break}}this.setCamera(new b.l(s+(e.x/h-e.x)-(e.x/n-e.x),r+(e.y/h-e.y)-(e.y/n-e.y),h),t)}return this}zoomOut(e=this.getViewportScreenCenter(),t){let{isLocked:i}=this.getCameraOptions();if(i&&!t?.force)return this;let{zoomSteps:s}=this.getCameraOptions();if(null!==s&&s.length>1){let i=this.getBaseZoom(),{x:r,y:n,z:a}=this.getCamera(),o=s[0]*i;for(let e=s.length-1;e>0;e--){let t=s[e-1]*i,r=s[e]*i;if(!(r-a>=(r-t)/2)){o=t;break}}this.setCamera(new b.l(r+(e.x/o-e.x)-(e.x/a-e.x),n+(e.y/o-e.y)-(e.y/a-e.y),o),t)}return this}zoomToSelection(e){let{isLocked:t}=this.getCameraOptions();if(t&&!e?.force)return this;let i=this.getSelectionPageBounds();return i&&(.01>Math.abs(this.getZoomLevel()-1)?this.zoomToBounds(i,e):this.zoomToBounds(i,{targetZoom:1,...e})),this}zoomToSelectionIfOffscreen(e=16,t){let i=this.getSelectionPageBounds(),s=this.getViewportPageBounds();if(i&&!s.contains(i)){let r=i.clone().expandBy(e/this.getZoomLevel()).expand(s),n=s.clone().translate({x:(r.center.x-s.center.x)*2,y:(r.center.y-s.center.y)*2});this.zoomToBounds(n,t)}}zoomToBounds(e,t){let i=this._cameraOptions.__unsafe__getWithoutCapture();if(i.isLocked&&!t?.force)return this;let s=this.getViewportScreenBounds(),r=t?.inset??Math.min(this.options.zoomToFitPadding,.28*s.width),n=this.getBaseZoom(),o=i.zoomSteps[0],h=(0,a.HV)(i.zoomSteps),l=(0,T.qE)(Math.min((s.width-r)/e.w,(s.height-r)/e.h),o*n,h*n);return t?.targetZoom!==void 0&&(l=Math.min(t.targetZoom,l)),this.setCamera(new b.l(-e.x+(s.width-e.w*l)/2/l,-e.y+(s.height-e.h*l)/2/l,l),t),this}stopCameraAnimation(){return this.emit("stop-camera-animation"),this}_viewportAnimation=null;_animateViewport(e){if(!this._viewportAnimation)return;this._viewportAnimation.elapsed+=e;let{elapsed:t,easing:i,duration:s,start:r,end:n}=this._viewportAnimation;if(t>s){this.off("tick",this._animateViewport),this._viewportAnimation=null,this._setCamera(new b.l(-n.x,-n.y,this.getViewportScreenBounds().width/n.width));return}let a=i(1-(s-t)/s),o=r.minX+(n.minX-r.minX)*a,h=r.minY+(n.minY-r.minY)*a,l=r.maxX+(n.maxX-r.maxX)*a;this._setCamera(new b.l(-o,-h,this.getViewportScreenBounds().width/(l-o)),{force:!0})}_animateToViewport(e,t={animation:u.mp}){let{animation:i,...s}=t;if(!i)return;let{duration:r=0,easing:n=C.Z.easeInOutCubic}=i,a=this.user.getAnimationSpeed(),o=this.getViewportPageBounds();return(this.stopCameraAnimation(),this.getInstanceState().followingUserId&&this.stopFollowingUser(),0===r||0===a)?this._setCamera(new b.l(-e.x,-e.y,this.getViewportScreenBounds().width/e.width),{...s}):(this._viewportAnimation={elapsed:0,duration:r/a,easing:n,start:o.clone(),end:e.clone()},this.once("stop-camera-animation",()=>{this.off("tick",this._animateViewport),this._viewportAnimation=null}),this.on("tick",this._animateViewport),this)}slideCamera(e={}){let{isLocked:t}=this.getCameraOptions();if(t&&!e?.force||0===this.user.getAnimationSpeed())return this;this.stopCameraAnimation();let{speed:i,friction:s=this.options.cameraSlideFriction,direction:r,speedThreshold:n=.01}=e,a=Math.min(i,1),o=()=>{this.off("tick",l),this.off("stop-camera-animation",o)};this.once("stop-camera-animation",o);let h=r.z??0,l=e=>{let{x:t,y:i,z:l}=this.getCamera(),p=r.x*(a*e)/l,d=r.y*(a*e)/l,g=t+p,u=i+d,c=l;if(0!==h){c=l*(1+h*a*e);let t=this.getViewportScreenCenter();g+=t.x/c-t.x/l,u+=t.y/c-t.y/l}(a*=1-s)<n?o():this._setCamera(new b.l(g,u,c))};return this.on("tick",l),this}zoomToUser(e,t={animation:{duration:500}}){let i=this.getCollaborators().find(t=>t.userId===e);if(!i)return this;let s=i.cursor;return s&&this.run(()=>{null!==this.getInstanceState().followingUserId&&this.stopFollowingUser();let r=i.currentPageId===this.getCurrentPageId();r||this.setCurrentPage(i.currentPageId),t&&t.animation&&!r&&(t.animation=void 0),this.centerOnPoint(s,t);let{highlightedUserIds:n}=this.getInstanceState();this.updateInstanceState({highlightedUserIds:[...n,e]}),this.timers.setTimeout(()=>{let t=[...this.getInstanceState().highlightedUserIds],i=t.indexOf(e);i<0||(t.splice(i,1),this.updateInstanceState({highlightedUserIds:t}))},this.options.collaboratorIdleTimeoutMs)}),this}_willSetInitialBounds=!0;updateViewportScreenBounds(e,t=!1){if(e instanceof P.az)e.width=Math.max(e.width,1),e.height=Math.max(e.height,1);else{let t=e.getBoundingClientRect();e=new P.az(t.left||t.x,t.top||t.y,Math.max(t.width,1),Math.max(t.height,1))}let i=this.getContainerDocument();if(!i.body)return this;let s=[0!==e.minY,!(0,T.YY)(i.body.scrollWidth,e.maxX,1),!(0,T.YY)(i.body.scrollHeight,e.maxY,1),0!==e.minX],{_willSetInitialBounds:r}=this;this._willSetInitialBounds=!1;let{screenBounds:n,insets:a}=this.getInstanceState();if(e.equals(n)&&s.every((e,t)=>e===a[t]))return this;if(r)this.updateInstanceState({screenBounds:e.toJson(),insets:s}),this.emit("resize",e.toJson()),this.setCamera(this.getCamera());else if(t&&!this.getInstanceState().followingUserId){let t=this.getViewportPageBounds().center;this.updateInstanceState({screenBounds:e.toJson(),insets:s}),this.emit("resize",e.toJson()),this.centerOnPoint(t)}else this.updateInstanceState({screenBounds:e.toJson(),insets:s}),this.emit("resize",e.toJson()),this._setCamera(b.l.From({...this.getCamera()}));return this}getViewportScreenBounds(){let{x:e,y:t,w:i,h:s}=this.getInstanceState().screenBounds;return new P.az(e,t,i,s)}getViewportScreenCenter(){let e=this.getViewportScreenBounds();return new b.l(e.w/2,e.h/2)}getViewportPageBounds(){let{w:e,h:t}=this.getViewportScreenBounds(),{x:i,y:s,z:r}=this.getCamera();return new P.az(-i,-s,e/r,t/r)}screenToPage(e){let{screenBounds:t}=this.store.unsafeGetWithoutCapture(n.O9),{x:i,y:s,z:r=1}=this.getCamera();return new b.l((e.x-t.x)/r-i,(e.y-t.y)/r-s,e.z??.5)}pageToScreen(e){let{screenBounds:t}=this.store.unsafeGetWithoutCapture(n.O9),{x:i,y:s,z:r=1}=this.getCamera();return new b.l((e.x+i)*r+t.x,(e.y+s)*r+t.y,e.z??.5)}pageToViewport(e){let{x:t,y:i,z:s=1}=this.getCamera();return new b.l((e.x+t)*s,(e.y+i)*s,e.z??.5)}getCollaborators(){return this.collaborators.getCollaborators()}getCollaboratorsOnCurrentPage(){return this.collaborators.getCollaboratorsOnCurrentPage()}getVisibleCollaborators(){return this.collaborators.getVisibleCollaborators()}getVisibleCollaboratorsOnCurrentPage(){return this.collaborators.getVisibleCollaboratorsOnCurrentPage()}getAttributionUserId(){let e=this.store.props.users.currentUser.get();return e?(this._ensureUserRecord(e),n.XA.parseId(e.id)):null}_ensureUserRecord(e){let t=this.store.get(e.id);t&&t.name===e.name&&t.color===e.color&&t.imageUrl===e.imageUrl&&t.meta===e.meta||this.run(()=>{this.store.put([e])},{history:"ignore"})}getAttributionDisplayName(e){return e?this.store.props.users.resolve(e).get()?.name??this.store.get((0,n.dB)(e))?.name??null:null}getAttributionUser(e){return e?this.store.props.users.resolve(e).get()??this.store.get((0,n.dB)(e))??null:null}_getReferencedUserIds(e){let t=new Set;for(let i of e)for(let e of this.getShapeUtil(i).getReferencedUserIds(i))t.add(e);return t}_isLockedOnFollowingUser=(0,s.eU)("isLockedOnFollowingUser",!1);startFollowingUser(e){if(this.stopFollowingUser(),this.user.getExternalId()||console.warn("You should set the userId for the current instance before following a user"),!this._getFollowingPresence(e))return this;let t=(0,s.EW)("latestLeaderPresence",()=>this._getFollowingPresence(e));return(0,s.hL)(()=>{this.updateInstanceState({followingUserId:e},{history:"ignore"});let i=(0,s.wv)("update current page",()=>{let e=t.get();e?e.currentPageId!==this.getCurrentPageId()&&this.getPage(e.currentPageId)&&this.run(()=>{this.store.put([{...this.getInstanceState(),currentPageId:e.currentPageId}]),this._isLockedOnFollowingUser.set(!0)},{history:"ignore"}):this.stopFollowingUser()}),r=()=>{i(),this._isLockedOnFollowingUser.set(!1),this.off("frame",n),this.off("stop-following",r)},n=()=>{if(!t.get())return void this.stopFollowingUser();if(this._isLockedOnFollowingUser.get())return;let e=this.user.getAnimationSpeed();if(0===e)return void this._isLockedOnFollowingUser.set(!0);let i=this.getViewportPageBoundsForFollowing();if(!i)return void this.stopFollowingUser();let s=this.getViewportPageBounds(),r=Math.abs(i.minX-s.minX)+Math.abs(i.maxX-s.maxX),n=Math.abs(i.minY-s.minY)+Math.abs(i.maxY-s.maxY);if(r<this.options.followChaseViewportSnap&&n<this.options.followChaseViewportSnap)return void this._isLockedOnFollowingUser.set(!0);let o=(0,T.qE)(.5*e,.1,.8),h=new P.az((0,a.Cc)(s.minX,i.minX,o),(0,a.Cc)(s.minY,i.minY,o),(0,a.Cc)(s.width,i.width,o),(0,a.Cc)(s.height,i.height,o)),l=new b.l(-h.x,-h.y,this.getViewportScreenBounds().width/h.width);this.stopCameraAnimation(),this._setCamera(l)};this.once("stop-following",r),this.addListener("frame",n),n()}),this}stopFollowingUser(){return this.run(()=>{this.store.put([this.getCamera()]),this._isLockedOnFollowingUser.set(!1),this.updateInstanceState({followingUserId:null}),this.emit("stop-following")},{history:"ignore"}),this}getUnorderedRenderingShapes(e){let t=[],i=2*this.options.maxShapesPerPage,s=this.options.maxShapesPerPage,r=this.getErasingShapeIds(),n=(a,o,h)=>{let l=this.getShape(a);if(!l)return;if(this.isShapeHidden(l)){let e=h||r.includes(a);for(let t of this.getSortedChildIdsForParent(a))n(t,o,e);return}o*=l.opacity;let p=!1,d=this.getShapeUtil(l);e&&(p=!h&&r.includes(a))&&(o*=.32),t.push({id:a,shape:l,util:d,index:i,backgroundIndex:s,opacity:o}),i+=1,s+=1;let g=this.getSortedChildIdsForParent(a);if(!g.length)return;let u=null;for(let e of(d.providesBackgroundForChildren(l)&&(u=s,s=i,i+=this.options.maxShapesPerPage),g))n(e,o,h||p);null!==u&&(s=u)};for(let t of e?[this.getCurrentPage()]:this.getPages())for(let e of this.getSortedChildIdsForParent(t.id))n(e,1,!1);return t}_cameraStateTimeoutRemaining=0;_decayCameraStateTimeout(e){this._cameraStateTimeoutRemaining-=e,this._cameraStateTimeoutRemaining>0||(this.off("tick",this._decayCameraStateTimeout),this._setCameraState("idle"))}_tickCameraState(){this._cameraStateTimeoutRemaining=this.options.cameraMovingTimeoutMs,"idle"===this.getInstanceState().cameraState&&(this._setCameraState("moving"),this._debouncedZoomLevel.set((0,s.Pm)(()=>this.getCamera().z)),this.on("tick",this._decayCameraStateTimeout))}_setCameraState(e){this.updateInstanceState({cameraState:e},{history:"ignore"})}getCameraState(){return this.getInstanceState().cameraState}getRenderingShapes(){let e=this.getUnorderedRenderingShapes(!0);if(e.length<=100)return this._renderingShapesSortCache=null,e.sort(a.rb);let t=this._renderingShapesSortCache;if(null!==t&&t.size===e.length){let i=Array(e.length),s=!0;for(let r=0;r<e.length;r++){let n=e[r],a=t.get(n.id);if(void 0===a){s=!1;break}i[a]=n}if(s)return i}e.sort(a.rb);let i=new Map;for(let t=0;t<e.length;t++)i.set(e[t].id,t);return this._renderingShapesSortCache=i,e}_renderingShapesSortCache=null;_getAllPagesQuery(){return this.store.query.records("page")}getPages(){return Array.from(this._getAllPagesQuery().get()).sort(a.Ky)}getCurrentPage(){return this.getPage(this.getCurrentPageId())}getCurrentPageId(){return this.getInstanceState().currentPageId}getPage(e){return this.store.get("string"==typeof e?e:e.id)}_currentPageShapeIds;getCurrentPageShapeIds(){return this._currentPageShapeIds.get()}getCurrentPageShapeIdsSorted(){return Array.from(this.getCurrentPageShapeIds()).sort()}getPageShapeIds(e){let t="string"==typeof e?e:e.id,i=this.store.query.exec("shape",{parentId:{eq:t}});return this.getShapeAndDescendantIds(i.map(e=>e.id))}setCurrentPage(e){let t="string"==typeof e?e:e.id;return this.store.has(t)?(this.stopFollowingUser(),this.complete(),this.run(()=>{this.store.put([{...this.getInstanceState(),currentPageId:t}]),this.setCamera(this.getCamera())},{history:"record-preserveRedoStack"})):(console.error("Tried to set the current page id to a page that doesn't exist."),this)}updatePage(e){return this.getIsReadonly()||!this.getPage(e.id)?this:this.run(()=>this.store.update(e.id,t=>({...t,...e})))}createPage(e){return this.run(()=>{if(this.getIsReadonly()||this.getPages().length>=this.options.maxPages)return;let t=this.getPages(),i=(0,B.g)(e.name??"Page 1",t.map(e=>e.name)),s=e.index;(!s||t.some(e=>e.index===s))&&(s=(0,a.AQ)(t[t.length-1].index));let r=n.tv.create({meta:{},...e,name:i,index:s});this.store.put([r])}),this}deletePage(e){let t="string"==typeof e?e:e.id;return this.run(()=>{if(this.getIsReadonly())return;let e=this.getPages();if(1===e.length)return;let i=this.getPage(t);if(!i)return;if(t===this.getCurrentPageId()){let i=e.findIndex(e=>e.id===t),s=e[i-1]??e[i+1];this.setCurrentPage(s.id)}let s=this.getSortedChildIdsForParent(i.id);this.deleteShapes(s),this.store.remove([i.id])},{ignoreShapeLock:!0}),this}duplicatePage(e,t=n.tv.createId()){if(this.getPages().length>=this.options.maxPages)return this;let i="string"==typeof e?e:e.id,s=this.getPage(i);if(!s)return this;let r={...this.getCamera()},o=this.getContentFromCurrentPage(this.getSortedChildIdsForParent(s.id));return this.run(()=>{let e=this.getPages(),i=(0,a.HE)(s.index,e[e.indexOf(s)+1]?.index);if(this.createPage({name:s.name+" Copy",id:t,index:i}),this.setCurrentPage(t),this.setCamera(r),o)return this.putContentOntoCurrentPage(o)}),this}renamePage(e,t){let i="string"==typeof e?e:e.id;return this.getIsReadonly()||this.updatePage({id:i,name:t}),this}_getAllAssetsQuery(){return this.store.query.records("asset")}getAssets(){return this._getAllAssetsQuery().get()}createAssets(e){return this.getIsReadonly()||e.length<=0||this.run(()=>this.store.put(e),{history:"ignore"}),this}updateAssets(e){return this.getIsReadonly()||e.length<=0||this.run(()=>{this.store.put(e.map(e=>({...this.store.get(e.id),...e})))},{history:"ignore"}),this}deleteAssets(e){if(this.getIsReadonly())return this;let t="string"==typeof e[0]?e:e.map(e=>e.id);return t.length<=0||this.run(()=>{this.store.props.assets.remove?.(t),this.store.remove(t)},{history:"ignore"}),this}getAsset(e){return this.store.get("string"==typeof e?e:e.id)}async resolveAssetUrl(e,t){if(!e)return null;let i=this.getAsset(e);if(!i)return null;let{screenScale:s=1,shouldResolveToOriginal:r=!1,dpr:n=this.getInstanceState().devicePixelRatio}=t,a=Math.pow(2,Math.ceil(Math.log2(s))),o="connection"in navigator?navigator.connection?.effectiveType??null:null;return await this.store.props.assets.resolve(i,{screenScale:s||1,steppedScreenScale:a,dpr:n,networkEffectiveType:o,shouldResolveToOriginal:r})}async uploadAsset(e,t,i){return await this.store.props.assets.upload(e,t,i)}_shapeGeometryCaches={};getShapeGeometry(e,t){let i=t?.context??"none";return this._shapeGeometryCaches[i]||(this._shapeGeometryCaches[i]=this.store.createComputedCache("bounds",e=>(this.fonts.trackFontsForShape(e),this.getShapeUtil(e).getGeometry(e,t)),{areRecordsEqual:v.E})),this._shapeGeometryCaches[i].get("string"==typeof e?e:e.id)}_getShapeHandlesCache(){return this.store.createComputedCache("handles",e=>this.getShapeUtil(e).getHandles?.(e),{areRecordsEqual:v.E})}getShapeHandles(e){return this._getShapeHandlesCache().get("string"==typeof e?e:e.id)}getShapeLocalTransform(e){let t="string"==typeof e?e:e.id,i=this.getShape(t);if(!i)throw Error("Editor.getTransform: shape not found");return x.V.Identity().translate(i.x,i.y).rotate(i.rotation)}_getShapePageTransformCache(){return this.store.createComputedCache("pageTransformCache",e=>{if((0,n.xh)(e.parentId))return this.getShapeLocalTransform(e);let t=this._getShapePageTransformCache().get(e.parentId)??x.V.Identity();return x.V.Compose(t,this.getShapeLocalTransform(e))})}getShapeParentTransform(e){let t="string"==typeof e?e:e.id,i=this.getShape(t);return!i||(0,n.xh)(i.parentId)?x.V.Identity():this._getShapePageTransformCache().get(i.parentId)??x.V.Identity()}getShapePageTransform(e){let t="string"==typeof e?e:e.id;return this._getShapePageTransformCache().get(t)??x.V.Identity()}_getShapePageBoundsCache(){return this.store.createComputedCache("pageBoundsCache",e=>{let t=this.getShapePageTransform(e);if(t)return P.az.FromPoints(t.applyToPoints(this.getShapeGeometry(e).boundsVertices))})}getShapePageBounds(e){return this._getShapePageBoundsCache().get("string"==typeof e?e:e.id)}_getShapeClipPathCache(){return this.store.createComputedCache("clipPathCache",e=>{let t=this._getShapeMaskCache().get(e.id);if(!t)return;if(0===t.length)return"polygon(0px 0px, 0px 0px, 0px 0px)";let i=this._getShapePageTransformCache().get(e.id);if(!i)return;let s=x.V.applyToPoints(x.V.Inverse(i),t);return`polygon(${s.map(e=>`${e.x}px ${e.y}px`).join(",")})`})}getShapeClipPath(e){return this._getShapeClipPathCache().get("string"==typeof e?e:e.id)}_getShapeMaskCache(){return this.store.createComputedCache("pageMaskCache",e=>{if((0,n.xh)(e.parentId))return;let t=[];for(let i of this.getShapeAncestors(e.id)){let s=this.getShapeUtil(i),r=s.getClipPath?.(i);if(!r||s.shouldClipChild?.(e)===!1)continue;let n=this.getShapePageTransform(i.id);t.push(n.applyToPoints(r))}if(0!==t.length)return t.reduce((e,t)=>{let i=(0,_.oQ)(e,t);return i?i.map(b.l.Cast):[]})})}getShapeMask(e){return this._getShapeMaskCache().get("string"==typeof e?e:e.id)}getShapeMaskedPageBounds(e){return"string"!=typeof e&&(e=e.id),this._getShapeMaskedPageBoundsCache().get(e)}_getShapeMaskedPageBoundsCache(){return this.store.createComputedCache("shapeMaskedPageBoundsCache",e=>{let t=this._getShapePageBoundsCache().get(e.id);if(!t)return;let i=this._getShapeMaskCache().get(e.id);if(i){if(0===i.length)return;let{corners:e}=t;if(e.every((e,t)=>e&&b.l.Equals(e,i[t])))return t.clone();let s=(0,_.oQ)(i,e);if(!s)return;return P.az.FromPoints(s)}return t})}getShapeAncestors(e,t=[]){let i="string"==typeof e?e:e.id,s=this.getShape(i);if(!s)return t;let r=s.parentId;if((0,n.xh)(r))return t.reverse(),t;let a=this.store.get(r);return a?(t.push(a),this.getShapeAncestors(a,t)):t}findShapeAncestor(e,t){let i="string"==typeof e?e:e.id,s=this.getShape(i);if(!s)return;let r=s.parentId;if((0,n.xh)(r))return;let a=this.getShape(r);if(a)return t(a)?a:this.findShapeAncestor(a,t)}hasAncestor(e,t){let i="string"==typeof e?e:e?.id,s=i&&this.getShape(i);return!!s&&(s.parentId===t||this.hasAncestor(this.getShapeParent(s),t))}findCommonAncestor(e,t){if(0===e.length)return;let i="string"==typeof e[0]?e:e.map(e=>e.id),s=(0,a.oE)(i.map(e=>this.getShape(e)));if(1===s.length){let e=s[0].parentId;if((0,n.xh)(e))return;return t?this.findShapeAncestor(s[0],t)?.id:e}let[r,...o]=s,h=this.getShapeParent(r);for(;h;){if(t&&!t(h)){h=this.getShapeParent(h);continue}if(o.every(e=>this.hasAncestor(e,h.id)))return h.id;h=this.getShapeParent(h)}}isShapeOrAncestorLocked(e){let t=e&&this.getShape(e);return void 0!==t&&(!!t.isLocked||this.isShapeOrAncestorLocked(this.getShapeParent(t)))}getNotVisibleShapes(){return this._notVisibleShapes.get()}_notVisibleShapes=(0,z.s)(this);_culledShapesCache=null;getCulledShapes(){let e=this.getNotVisibleShapes(),t=this.getSelectedShapeIds(),i=this.getEditingShapeId(),s=new Set(e);i&&s.delete(i),t.forEach(e=>{s.delete(e)});let r=this._culledShapesCache;if(r){if(r.size!==s.size)return this._culledShapesCache=s,s;for(let e of r)if(!s.has(e))return this._culledShapesCache=s,s;return r}return this._culledShapesCache=s,s}getCurrentPageBounds(){let e;return this.getCurrentPageShapeIdsSorted().forEach(t=>{if(this.isShapeHidden(t))return;let i=this.getShapeMaskedPageBounds(t);i&&(e=e?e.expand(i):i.clone())}),e}getHitTestMargin(){let{hitTestMargin:e,coarseHitTestMargin:t}=this.options;return(this.getInstanceState().isCoarsePointer?t:e)/this.getZoomLevel()}getSelectedShapeAtPoint(e){let t=this.getSelectedShapeIds(),i=this.options.hitTestMargin/this.getZoomLevel(),s=this.getCurrentPageShapesSorted();for(let r=s.length-1;r>=0;r--){let n=s[r];if("group"!==n.type&&t.includes(n.id)&&this.getShapeGeometry(n).hitTestPoint(this.getPointInShapeSpace(n,e),i,!0))return n}}getShapeAtPoint(e,t={}){let i=this.getViewportPageBounds(),{filter:s,margin:r=0,hitLocked:n=!1,hitLabels:a=!1,hitInside:o=!1,hitFrameInside:h=!1}=t,[l,p]=Array.isArray(r)?r:[r,r],d=1/0,g=null,u=1/0,c=null,S=Math.max(l,p,this.getHitTestMargin()),f=this._spatialIndex.getShapeIdsAtPoint(e,S),m=(t.renderingOnly?this.getCurrentPageRenderingShapesSorted():this.getCurrentPageShapesSorted()).filter(t=>{if(!f.has(t.id)&&!this.isShapeFrameLike(t)||t.isLocked&&!n||this.isShapeHidden(t)||this.isShapeOfType(t,"group"))return!1;let i=this.getShapeMask(t);return(!i||!!(0,T.s3)(e,i))&&(!s||!!s(t))});for(let t=m.length-1;t>=0;t--){let s,r=m[t],n=this.getShapeGeometry(r),S=n instanceof w.I,f=this.getPointInShapeSpace(r,e),y=this.getShapeUtil(r),I=this.isShapeFrameLike(r);if(I||(this.isShapeOfType(r,"note")||this.isShapeOfType(r,"arrow")||this.isShapeOfType(r,"geo")&&"none"===r.props.fill)&&y.getText(r)?.trim()){for(let e of n.children)if(e.isLabel&&e.isPointInBounds(f))return r}if(I){let e=n.distanceToPoint(f,h);if(h?e>0&&e<=p||e<=0&&e>-l:e>0&&e<=p)return c||r;if(n.hitTestPoint(f,0,!0))return c||g||(h?r:void 0);continue}if(S){let e=1/0;for(let t of n.children){if(t.isLabel&&!a)continue;let i=t.distanceToPoint(f,o);i<e&&(e=i)}s=e}else s=0===p&&(n.bounds.w<1||n.bounds.h<1)||n.bounds.containsPoint(f,p)?n.distanceToPoint(f,o):1/0;if(n.isClosed){if(s<=p||o&&s<=0&&s>-l)if(n.isFilled||S&&n.children[0].isFilled){if(n.ignoreHit(f))continue;return c||r}else{if(this.getShapePageBounds(r).contains(i))continue;if(o?s>0&&s<=p||s<=0&&s>-l:Math.abs(s)<=Math.max(l,p))Math.abs(s)<u&&(u=Math.abs(s),c=r);else if(!c){let{area:e}=n;e<d&&(d=e,g=r)}}}else if(s<this.getHitTestMargin())return r}return c||g||void 0}getShapesAtPoint(e,t={}){let i=t.margin??0,s=this._spatialIndex.getShapeIdsAtPoint(e,i);return this.getCurrentPageShapesSorted().filter(i=>!this.isShapeHidden(i)&&(!!s.has(i.id)||!!this.isShapeFrameLike(i))&&this.isPointInShape(i,e,t)).reverse()}getShapeIdsInsideBounds(e){return this._spatialIndex.getShapeIdsInsideBounds(e)}isPointInShape(e,t,i={}){let{hitInside:s=!1,margin:r=0}=i,n="string"==typeof e?e:e.id,a=this.getShapeMask(n);return(!a||!!(0,T.s3)(t,a))&&this.getShapeGeometry(n).hitTestPoint(this.getPointInShapeSpace(e,t),r,s)}getPointInShapeSpace(e,t){let i="string"==typeof e?e:e.id;return this._getShapePageTransformCache().get(i).clone().invert().applyToPoint(t)}getPointInParentSpace(e,t){let i="string"==typeof e?e:e.id,s=this.getShape(i);if(!s)return new b.l(0,0);if((0,n.xh)(s.parentId))return b.l.From(t);let r=this.getShapePageTransform(s.parentId);return r?r.clone().invert().applyToPoint(t):b.l.From(t)}getCurrentPageShapes(){return Array.from(this.getCurrentPageShapeIds(),e=>this.store.get(e))}getCurrentPageShapesSorted(){let e=[],t=this.getSortedChildIdsForParent(this.getCurrentPageId());for(let i=0,s=t.length;i<s;i++)!function e(t,i,s){let r=t.getShape(i);if(!r)return;s.push(r);let n=t.getSortedChildIdsForParent(i);for(let i=0,r=n.length;i<r;i++)e(t,n[i],s)}(this,t[i],e);return e}getCurrentPageRenderingShapesSorted(){let e=this.getCulledShapes();return this.getCurrentPageShapesSorted().filter(({id:t})=>!e.has(t)&&!this.isShapeHidden(t))}isShapeOfType(e,t){let i="string"==typeof e?this.getShape(e):e;return!!i&&i.type===t}isShapeFrameLike(e){let t="string"==typeof e?this.getShape(e):e;return!!t&&this.getShapeUtil(t).isFrameLike(t)}getShape(e){let t="string"==typeof e?e:e.id;if((0,n.vc)(t))return this.store.get(t)}getShapeParent(e){let t="string"==typeof e?e:e?.id;if(!t)return;let i=this.getShape(t);if(void 0!==i&&(0,n.vc)(i.parentId))return this.getShape(i.parentId)}getShapeNearestSibling(e,t){return t?t.parentId===e.parentId?t:this.findShapeAncestor(t,t=>t.parentId===e.parentId):void 0}isShapeInPage(e,t=this.getCurrentPageId()){let i="string"==typeof e?e:e.id,s=this.getShape(i);if(!s)return!1;let r=!1;if(s.parentId===t)r=!0;else{let e=this.getShape(s.parentId);for(;e;){if(e.parentId===t){r=!0;break}e=this.getShape(e.parentId)}}return r}getAncestorPageId(e){let t="string"==typeof e?e:e?.id,i=t&&this.getShape(t);if(i)if((0,n.xh)(i.parentId))return i.parentId;else return this.getAncestorPageId(this.getShape(i.parentId))}_parentIdsToChildIds;reparentShapes(e,t,i){let s="string"==typeof e[0]?e:e.map(e=>e.id);if(0===s.length)return this;let r=[],o=(0,n.xh)(t)?x.V.Identity():this.getShapePageTransform(t),h=o.rotation(),l=[],p=(0,a.oE)(this.getSortedChildIdsForParent(t).map(e=>this.getShape(e)));if(i){let e=p.find(e=>e.index===i);if(e){let t=p[p.indexOf(e)+1];l=t?(0,a.MT)(i,t.index,s.length):(0,a.Zo)(i,s.length)}else{let e=p.sort(a.Ky).find(e=>e.index>i);l=e?(0,a.MT)(i,e.index,s.length):(0,a.Zo)(i,s.length)}}else{let e=p.length&&p[p.length-1];l=e?(0,a.Zo)(e.index,s.length):(0,a.uu)(s.length)}let d=o.clone().invert(),g=(0,a.oE)(s.map(e=>this.getShape(e))).sort(a.Ky);return this.run(()=>{for(let e=0;e<g.length;e++){let i=g[e],s=this.getShapePageTransform(i);if(!s)continue;let n=s.point();if(!n)continue;let a=d.applyToPoint(n),o=s.rotation()-h;if(i.id===t)throw Error("Attempted to reparent a shape to itself!");r.push({id:i.id,type:i.type,parentId:t,x:a.x,y:a.y,rotation:o,index:l[e]})}this.updateShapes(r)},{ignoreShapeLock:!0}),this}getHighestIndexForParent(e){let t="string"==typeof e?e:e.id,i=this._parentIdsToChildIds.get()[t];if(!i||0===i.length)return(0,a.AQ)(a.as);let s=this.getShape(i[i.length-1]);return(0,a.AQ)(s.index)}getSortedChildIdsForParent(e){let t="string"==typeof e?e:e.id,i=this._parentIdsToChildIds.get()[t];return i||s.Ml}visitDescendants(e,t){for(let i of this.getSortedChildIdsForParent(e))!1!==t(i)&&this.visitDescendants(i,t);return this}getShapeAndDescendantIds(e){let t=new Set;for(let i of e.map(e=>this.getShape(e)).sort(a.Ky))t.add(i.id),this.visitDescendants(i,e=>{t.add(e)});return t}getDraggingOverShape(e,t){let i=(0,a.oE)(t.map(e=>this.getShape(e))).filter(e=>!e.isLocked&&!this.isShapeHidden(e));for(let s of this.getShapesAtPoint(e,{hitInside:!0,margin:0}).filter(e=>!t.includes(e)&&!e.isLocked&&!this.isShapeHidden(e)&&!i.includes(e))){let e=this.getShapeUtil(s);if(e.onDragShapesOver||e.onDragShapesIn||e.onDragShapesOut||e.onDropShapesOver)return s}}getOutermostSelectableShape(e,t){let i="string"==typeof e?e:e.id,s=this.getShape(i),r=s,n=s,a=this.getFocusedGroup();for(;n;){if(this.isShapeOfType(n,"group")&&a?.id!==n.id&&!this.hasAncestor(a,n.id)&&(t?.(n)??!0))r=n;else if(a?.id===n.id)break;n=this.getShapeParent(n)}return r}_getBindingsIndexCache(){let e=(0,O.V)(this);return this.store.createComputedCache("bindingsIndex",t=>e.get().get(t.id),{areRecordsEqual:()=>!0})}getBinding(e){return this.store.get(e)}getBindingsFromShape(e,t){let i="string"==typeof e?e:e.id;return this.getBindingsInvolvingShape(i).filter(e=>e.fromId===i&&e.type===t)}getBindingsToShape(e,t){let i="string"==typeof e?e:e.id;return this.getBindingsInvolvingShape(i).filter(e=>e.toId===i&&e.type===t)}getBindingsInvolvingShape(e,t){let i="string"==typeof e?e:e.id,r=this._getBindingsIndexCache().get(i)??s.Ml;return t?r.filter(e=>e.type===t):r}createBindings(e){let t=[];for(let i of e){let e=this.getShape(i.fromId),s=this.getShape(i.toId);if(!e||!s||!this.canBindShapes({fromShape:e,toShape:s,binding:i}))continue;let r=this.getBindingUtil(i.type).getDefaultProps(),a=this.store.schema.types.binding.create({...i,id:i.id??(0,n.BN)(),props:{...r,...i.props}});t.push(a)}return this.store.put(t),this}createBinding(e){return this.createBindings([e])}updateBindings(e){let t=[];for(let i of e){if(!i)continue;let e=this.getBinding(i.id);if(!e)continue;let s=eh(e,i);if(s===e)continue;let r=this.getShape(s.fromId),n=this.getShape(s.toId);r&&n&&this.canBindShapes({fromShape:r,toShape:n,binding:s})&&t.push(s)}return this.store.put(t),this}updateBinding(e){return this.updateBindings([e])}deleteBindings(e,{isolateShapes:t=!1}={}){let i=e.map(e=>"string"==typeof e?e:e.id);return t?this.store.atomic(()=>{for(let e of i){let t=this.getBinding(e);if(!t)continue;let i=this.getBindingUtil(t);i.onBeforeIsolateFromShape?.({binding:t,removedShape:this.getShape(t.toId)}),i.onBeforeIsolateToShape?.({binding:t,removedShape:this.getShape(t.fromId)}),this.store.remove([e])}}):this.store.remove(i),this}deleteBinding(e,t){return this.deleteBindings([e],t)}canBindShapes({fromShape:e,toShape:t,binding:i}){let s="string"==typeof e?e:e.type,r="string"==typeof t?t:t.type,n={fromShape:"string"==typeof e?{type:e}:e,toShape:"string"==typeof t?{type:t}:t,bindingType:"string"==typeof i?i:i.type,fromShapeType:s,toShapeType:r};return s===r?this.getShapeUtil(s).canBind(n):this.getShapeUtil(s).canBind(n)&&this.getShapeUtil(r).canBind(n)}rotateShapesBy(e,t,i){let s="string"==typeof e[0]?e:e.map(e=>e.id);if(s.length<=0)return this;let r=(0,U.f)({editor:this,ids:s});return r&&(0,U._)({delta:t,snapshot:r,editor:this,stage:"one-off",centerOverride:i?.center}),this}getChangesToTranslateShape(e,t){let i=e,s=this.getShapeUtil(e),r=s.onTranslateStart?.(i);r&&(i=eh(i,r)),i=eh(i,{id:e.id,type:e.type,x:t.x,y:t.y});let n=s.onTranslate?.(e,i);n&&(i=eh(i,n));let a=s.onTranslateEnd?.(e,i);return a&&(i=eh(i,a)),i}nudgeShapes(e,t){let i="string"==typeof e[0]?e:e.map(e=>e.id);if(i.length<=0)return this;let s=[];for(let e of i){let i=this.getShape(e),r=b.l.From(t),n=this.getShapeParentTransform(i);n&&r.rot(-n.rotation()),s.push(this.getChangesToTranslateShape(i,r.add(i)))}return this.updateShapes(s),this}duplicateShapes(e,t){return this.run(()=>{let i="string"==typeof e[0]?e:e.map(e=>e.id),s=this._shouldIgnoreShapeLock?i:this._getUnlockedShapeIds(i);if(s.length<=0)return this;let r=new Set(s),o=this.getShapeAndDescendantIds(s),h=[...o].reverse(),l=new Map;for(let e of o)l.set(e,(0,n.n6)());let{shapesToCreateWithOriginals:p,bindingsToCreate:d}=el(this,o,e=>{let i=[];for(let t of e){let e=this.getBinding(t);if(!e)continue;let s=(0,n.BN)();i.push({...e,id:s,fromId:(0,a.Z1)(l.get(e.fromId)),toId:(0,a.Z1)(l.get(e.toId))})}let s=[];for(let e of h){let i=(0,a.Z1)(l.get(e)),n=this.getShape(e);if(!n)continue;let o=0,h=0;if(t&&r.has(e)){let e=this.getShapeParentTransform(n),i=new b.l(t.x,t.y).rot(-e.rotation());o=i.x,h=i.y}s.push({shape:{...n,id:i,x:n.x+o,y:n.y+h,index:"a1",parentId:l.get(n.parentId)??n.parentId},originalShape:n})}return{shapesToCreateWithOriginals:s,bindingsToCreate:i}});p.forEach(({shape:e,originalShape:t})=>{let i=t.parentId,s=this.getSortedChildIdsForParent(i),r=s.indexOf(t.id),n=s[r+1],o=n?this.getShape(n):void 0;e.index=(0,a.HE)(t.index,o?.index)});let g=p.map(({shape:e,originalShape:t})=>this.getShapeUtil(e).onBeforeDuplicate?.(t,e)??e);if(!this.canCreateShapes(g))return void eo(this);if(this.createShapes(g),this.createBindings(d),this.setSelectedShapes((0,a.oE)(s.map(e=>{let t=l.get(e);return t&&this.getShape(t)?t:null}))),void 0!==t){let e=this.getSelectionPageBounds(),t=this.getViewportPageBounds();e&&!t.contains(e)&&this.centerOnPoint(e.center,{animation:{duration:this.options.animationMediumMs}})}}),this}moveShapesToPage(e,t){let i="string"==typeof e[0]?e:e.map(e=>e.id);if(0===i.length||this.getIsReadonly()||t===this.getCurrentPageId()||!this.store.has(t))return this;let s=this.getContentFromCurrentPage(i);if(!s)return this;if(this.getPageShapeIds(t).size+s.shapes.length>this.options.maxShapesPerPage)return eo(this,t),this;let r=this.getCamera().z;return this.run(()=>{this.deleteShapes(i),this.setCurrentPage(t),this.setFocusedGroup(null),this.selectNone(),this.putContentOntoCurrentPage(s,{select:!0,preserveIds:!0,preservePosition:!0}),this.setCamera({...this.getCamera(),z:r}),this.centerOnPoint(this.getSelectionRotatedPageBounds().center)}),this}toggleLock(e){let t="string"==typeof e[0]?e:e.map(e=>e.id);if(this.getIsReadonly()||0===t.length)return this;let i=!0,s=!0,r=[];for(let e of t){let t=this.getShape(e);t&&(r.push(t),t.isLocked?s=!1:i=!1)}return this.run(()=>{s?(this.updateShapes(r.map(e=>({id:e.id,type:e.type,isLocked:!0}))),this.setSelectedShapes([])):i?this.updateShapes(r.map(e=>({id:e.id,type:e.type,isLocked:!1}))):this.updateShapes(r.map(e=>({id:e.id,type:e.type,isLocked:!0})))}),this}sendToBack(e){let t="string"==typeof e[0]?e:e.map(e=>e.id),i=(0,M.T)(this,"toBack",t,{considerAllShapes:!0});return i&&this.updateShapes(i),this}sendBackward(e,t={}){let i="string"==typeof e[0]?e:e.map(e=>e.id),s=(0,M.T)(this,"backward",i,t);return s&&this.updateShapes(s),this}bringForward(e,t={}){let i="string"==typeof e[0]?e:e.map(e=>e.id),s=(0,M.T)(this,"forward",i,t);return s&&this.updateShapes(s),this}bringToFront(e){let t="string"==typeof e[0]?e:e.map(e=>e.id),i=(0,M.T)(this,"toFront",t);return i&&this.updateShapes(i),this}getShapeClusters(e,t,i){let s="string"==typeof e[0]?e:e.map(e=>e.id),r=(0,a.oE)(s.map(e=>this.getShape(e)));i?.filterAxisAligned&&(r=r.filter(e=>this.getShapePageTransform(e)?.rotation()%(T.PI/2)==0));let n=[],o=[],h=new Set;for(let e of r){if(h.has(e.id))continue;h.add(e.id);let i=this.getShapePageBounds(e);if(!i||!this.getShapeUtil(e).canBeLaidOut?.(e,{type:t,shapes:r}))continue;let s=[e],a=[i];this.collectShapesViaArrowBindings({bindings:this.getBindingsToShape(e.id,"arrow"),initialShapes:r,resultShapes:s,resultBounds:a,visited:h});let l=P.az.Common(a);l&&(n.push({shapes:s,pageBounds:l}),o.push(l))}return{clusters:n,allBounds:o}}collectShapesViaArrowBindings(e){let{initialShapes:t,resultShapes:i,resultBounds:s,bindings:r,visited:n}=e;for(let a of r)for(let r of[a.fromId,a.toId])if(!n.has(r)){let a=t.find(e=>e.id===r);if(a&&!n.has(a.id)){n.add(a.id);let t=this.getShapePageBounds(a);if(!t)continue;i.push(a),s.push(t),this.collectShapesViaArrowBindings({...e,bindings:this.getBindingsInvolvingShape(a,"arrow")})}}}flipShapes(e,t){if(this.getIsReadonly())return this;let i="string"==typeof e[0]?e:e.map(e=>e.id),s=(0,a.oE)(i.map(e=>this.getShape(e)));for(let e of s)if(this.isShapeOfType(e,"group")){let t=(0,a.oE)(this.getSortedChildIdsForParent(e.id).map(e=>this.getShape(e)));s.push(...t)}let r=[],n=[];for(let e of s){let t=this.getShapeUtil(e);if(!t.canBeLaidOut(e,{type:"flip",shapes:s}))continue;let i=this.getShapePageBounds(e),a=this.getShapeGeometry(e).bounds,o=this.getShapePageTransform(e.id);i&&a&&o&&(r.push({shape:e,localBounds:a,pageTransform:o,isAspectRatioLocked:t.isAspectRatioLocked(e)}),n.push(i))}if(!r.length)return this;let o=P.az.Common(n).center;return this.run(()=>{for(let{shape:e,localBounds:i,pageTransform:s,isAspectRatioLocked:n}of r)this.resizeShape(e.id,{x:"horizontal"===t?-1:1,y:"vertical"===t?-1:1},{initialBounds:i,initialPageTransform:s,initialShape:e,isAspectRatioLocked:n,mode:"scale_shape",scaleOrigin:o,scaleAxisRotation:0})}),this}stackShapes(e,t,i){let s,r,n,a,o=i??this.options.adjacentShapeMargin;if(this.getIsReadonly())return this;let{clusters:h}=this.getShapeClusters(e,"stack"),l=h.length;if(0===o&&l<3||l<2)return this;"horizontal"===t?(s="x",r="minX",n="maxX",a="width"):(s="y",r="minY",n="maxY",a="height");let p=0;if(0===o){let e={};h.sort((e,t)=>e.pageBounds[r]-t.pageBounds[r]);for(let t=0;t<l-1;t++){let i=h[t],s=h[t+1].pageBounds[r]-i.pageBounds[n];e[s]||(e[s]=0),e[s]++}let t=1;for(let[i,s]of Object.entries(e))s>t&&(t=s,p=parseFloat(i));if(1===t){let t=0;for(let[i,s]of Object.entries(e))p+=parseFloat(i)*s,t+=s;p/=t}}else p=o;let d=[],g=h[0].pageBounds[n];for(let e=1;e<h.length;e++){let{shapes:t,pageBounds:i}=h[e],r=new b.l;for(let e of(r[s]=g+p-i[s],t)){let t=r.clone(),i=this.getShapeParent(e);if(i){let e=this.getShapePageTransform(i);e&&t.rot(-e.rotation())}t.add(e),d.push(this.getChangesToTranslateShape(e,t))}g+=i[a]+p}return this.updateShapes(d),this}packShapes(e,t){let i,s;if(this.getIsReadonly())return this;let r=t??this.options.adjacentShapeMargin,{clusters:n,allBounds:a}=this.getShapeClusters(e,"pack"),o=n.map(e=>({...e,nextPageBounds:e.pageBounds.clone()}));if(o.length<2)return this;let h=0;for(let{pageBounds:e}of o)h+=e.width*e.height;let l=P.az.Common(a),p=l.width;o.sort((e,t)=>e.pageBounds.width-t.pageBounds.width).sort((e,t)=>e.pageBounds.height-t.pageBounds.height);let d=Math.max(Math.ceil(Math.sqrt(h/.95)),p),g=[new P.az(l.x,l.y,d,1/0)],u=0,c=0;for(let{nextPageBounds:e}of o)for(let t=g.length-1;t>=0;t--)if(i=g[t],!(e.width>i.width)&&!(e.height>i.height)){e.x=i.x,e.y=i.y,c=Math.max(c,e.maxY),u=Math.max(u,e.maxX),e.width===i.width&&e.height===i.height?(s=g.pop(),t<g.length&&(g[t]=s)):e.height===i.height?(i.x+=e.width+r,i.width-=e.width+r):(e.width===i.width||g.push(new P.az(i.x+(e.width+r),i.y,i.width-(e.width+r),e.height)),i.y+=e.height+r,i.height-=e.height+r);break}let S=P.az.Common(o.map(e=>e.nextPageBounds)),f=b.l.Sub(l.center,S.center),m=[];for(let{shapes:e,pageBounds:t,nextPageBounds:i}of o){let s=b.l.Sub(i.point,t.point).add(f);for(let t of e){let e=s.clone();if(this.getShapeParent(t)){let i=this.getShapeParentTransform(t);i&&e.rot(-i.rotation())}e.add(t),m.push(this.getChangesToTranslateShape(t,e))}}return m.length&&this.updateShapes(m),this}alignShapes(e,t){if(this.getIsReadonly())return this;let{clusters:i,allBounds:s}=this.getShapeClusters(e,"align");if(i.length<2)return this;let r=P.az.Common(s),n=[];return i.forEach(({shapes:e,pageBounds:i})=>{let s=new b.l;switch(t){case"top":s.y=r.minY-i.minY;break;case"center-vertical":s.y=r.midY-i.minY-i.height/2;break;case"bottom":s.y=r.maxY-i.minY-i.height;break;case"left":s.x=r.minX-i.minX;break;case"center-horizontal":s.x=r.midX-i.minX-i.width/2;break;case"right":s.x=r.maxX-i.minX-i.width}for(let t of e){let e=s.clone(),i=this.getShapeParent(t);if(i){let t=this.getShapePageTransform(i);t&&e.rot(-t.rotation())}e.add(t),n.push(this.getChangesToTranslateShape(t,e))}}),this.updateShapes(n),this}distributeShapes(e,t){let i,s,r,n;if(this.getIsReadonly())return this;let{clusters:a}=this.getShapeClusters(e,"distribute");if(a.length<3)return this;"horizontal"===t?(i="x",s="minX",r="maxX",n="width"):(i="y",s="minY",r="maxY",n="height");let o=[],h=a.sort((e,t)=>e.pageBounds[s]-t.pageBounds[s])[0],l=a.sort((e,t)=>t.pageBounds[r]-e.pageBounds[r])[0];if(h===l){let i=new Set(h.shapes.map(e=>e.id)),s="string"==typeof e[0]?e:e.map(e=>e.id);return this.distributeShapes(s.filter(e=>!i.has(e)),t)}let p=a.filter(e=>e!==h&&e!==l).sort((e,t)=>e.pageBounds[s]===t.pageBounds[s]?e.shapes[0].id<t.shapes[0].id?-1:1:e.pageBounds[s]-t.pageBounds[s]),d=h.pageBounds[r],g=(l.pageBounds[s]-d-p.reduce((e,t)=>e+t.pageBounds[n],0))/(p.length+1);for(let e=d+g,t=0;t<p.length;t++){let{shapes:s,pageBounds:a}=p[t],h=new b.l;for(let t of(h[i]=e-a[i],e+a[n]>l.pageBounds[r]-1&&(h[i]=l.pageBounds[r]-a[r]-1),s)){let e=h.clone(),i=this.getShapeParent(t);if(i){let t=this.getShapePageTransform(i);t&&e.rot(-t.rotation())}e.add(t),o.push(this.getChangesToTranslateShape(t,e))}e+=a[n]+g}return this.updateShapes(o),this}stretchShapes(e,t){let i,s,r;if(this.getIsReadonly())return this;let{clusters:n,allBounds:a}=this.getShapeClusters(e,"stretch",{filterAxisAligned:!0});if(n.length<2)return this;let o=P.az.Common(a);return"horizontal"===t?(i="x",s="minX",r="width"):(i="y",s="minY",r="height"),this.run(()=>{n.forEach(({shapes:e,pageBounds:t})=>{let n=new b.l;n[i]=o[s]-t[s];let a=t.center.clone();a[i]=o[s];let h=new b.l(1,1);for(let s of(h[i]=o[r]/t[r],e)){let e=n.clone(),t=this.getShapeParentTransform(s);t&&e.rot(-t.rotation()),e.add(s);let i=this.getChangesToTranslateShape(s,e);this.updateShape(i),this.resizeShape(s.id,h,{initialBounds:this.getShapeGeometry(s).bounds,scaleOrigin:a,isAspectRatioLocked:this.getShapeUtil(s).isAspectRatioLocked(s),scaleAxisRotation:0})}})}),this}resizeToBounds(e,t){if(this.getIsReadonly())return this;let i=P.az.From(t),{clusters:s,allBounds:r}=this.getShapeClusters(e,"resize_to_bounds",{filterAxisAligned:!0});if(0===s.length)return this;let n=P.az.Common(r);if(!n||0===n.width||0===n.height)return this;let a=i.width/n.width,o=i.height/n.height,h=new b.l(a,o);return s.forEach(({shapes:e,pageBounds:t})=>{let s=new b.l(i.minX-n.minX+(t.minX-n.minX)*(a-1),i.minY-n.minY+(t.minY-n.minY)*(o-1)),r=new b.l(i.minX+(t.minX-n.minX)*a,i.minY+(t.minY-n.minY)*o);for(let t of e){let e=s.clone(),i=this.getShapeParentTransform(t);i&&e.rot(-i.rotation()),e.add(t);let n=this.getChangesToTranslateShape(t,e);this.updateShape(n),this.resizeShape(t.id,h,{initialBounds:this.getShapeGeometry(t).bounds,scaleOrigin:r,isAspectRatioLocked:this.getShapeUtil(t).isAspectRatioLocked(t),scaleAxisRotation:0})}}),this}resizeShape(e,t,i={}){let s=this.getResizeShapePartial(e,t,i);return s&&this.updateShapes([s]),this}getResizeShapePartial(e,t,i={}){let s="string"==typeof e?e:e.id;if(this.getIsReadonly())return null;Number.isFinite(t.x)||(t=new b.l(1,t.y)),Number.isFinite(t.y)||(t=new b.l(t.x,1));let r=i.initialShape??this.getShape(s);if(!r)return null;let n=i.scaleOrigin??this.getShapePageBounds(s)?.center;if(!n)return null;let a=i.initialPageTransform?x.V.Cast(i.initialPageTransform):this.getShapePageTransform(s);if(!a)return null;let o=a.rotation();if(null==o)return null;let h=i.scaleAxisRotation??o,l=i.initialBounds??this.getShapeGeometry(s).bounds;if(!l)return null;let p=i.isAspectRatioLocked??this.getShapeUtil(r).isAspectRatioLocked(r);if(!(0,T.jw)(o,h))return this._resizeUnalignedShape(s,t,{...i,initialBounds:l,scaleOrigin:n,scaleAxisRotation:h,initialPageTransform:a,isAspectRatioLocked:p,initialShape:r}),null;let d=this.getShapeUtil(r);p&&(t=Math.abs(t.x)>Math.abs(t.y)?new b.l(t.x,Math.sign(t.y)*Math.abs(t.x)):new b.l(Math.sign(t.x)*Math.abs(t.y),t.y));let g=null;if(d.onResize&&d.canResize(r)){let e=this._scalePagePoint(x.V.applyToPoint(a,new b.l(0,0)),n,t,h),p=this.getPointInParentSpace(r.id,e),u=new b.l(t.x,t.y),c=(0,T.YY)((o-h)%Math.PI,0);u.x=c?t.x:t.y,u.y=c?t.y:t.x;let S=x.V.applyToPoint(a,new b.l),{x:f,y:m}=this.getPointInParentSpace(r.id,S);g=r,i.skipStartAndEndCallbacks||(g=eh(r,d.onResizeStart?.(r)??void 0));let y=d.onResize({...r,x:f,y:m},{newPoint:p,handle:i.dragHandle??"bottom_right",mode:i.mode??"scale_shape",scaleX:u.x,scaleY:u.y,initialBounds:l,initialShape:r});if(g=eh(g,{id:s,type:r.type,x:p.x,y:p.y,...y}),i.skipStartAndEndCallbacks||(g=eh(g,d.onResizeEnd?.(r,g)??void 0)),y)return g}let u=x.V.applyToPoint(a,l.center),c=this._scalePagePoint(u,n,t,h),S=this.getPointInParentSpace(r.id,u),f=this.getPointInParentSpace(r.id,c),m=b.l.Sub(f,S);return g?{...g,x:r.x+m.x,y:r.y+m.y}:{id:s,type:r.type,x:r.x+m.x,y:r.y+m.y}}_scalePagePoint(e,t,i,s){let r=b.l.RotWith(e,t,-s).sub(t),n=b.l.MulV(r,i);return b.l.Add(n,t).rotWith(t,s)}_resizeUnalignedShape(e,t,i){let{type:s}=i.initialShape,r=new b.l(t.x,t.y);if(Math.abs(t.x)>Math.abs(t.y)?r.x=Math.sign(t.x)*Math.abs(t.y):r.y=Math.sign(t.y)*Math.abs(t.x),this.resizeShape(e,r,{initialShape:i.initialShape,initialBounds:i.initialBounds,isAspectRatioLocked:i.isAspectRatioLocked,initialPageTransform:i.initialPageTransform}),Math.sign(t.x)*Math.sign(t.y)<0){let t=this.getShapeParentTransform(e).rotation(),r=-i.initialShape.rotation-2*t;this.updateShapes([{id:e,type:s,rotation:r}])}let n=x.V.applyToPoint(i.initialPageTransform,i.initialBounds.center),a=this._scalePagePoint(n,i.scaleOrigin,t,i.scaleAxisRotation),o=this.getShapePageTransform(e),h=this.getShapeGeometry(e).bounds,l=x.V.applyToPoint(o,h.center),p=o.point();if(!l||!p)return this;let d=b.l.Sub(a,l),g=b.l.Add(p,d),{x:u,y:c}=this.getPointInParentSpace(e,g);return this.updateShapes([{id:e,type:s,x:u,y:c}]),this}getInitialMetaForShape(e){return{}}canCreateShape(e){return this.canCreateShapes([e])}canCreateShapes(e){return e.length+this.getCurrentPageShapeIds().size<=this.options.maxShapesPerPage}createShape(e){return this.createShapes([e]),this}createShapes(e){if(!Array.isArray(e))throw Error("Editor.createShapes: must provide an array of shapes or shape partials");if(this.getIsReadonly()||e.length<=0)return this;let t=this.getCurrentPageShapeIds();if(e.length+t.size>this.options.maxShapesPerPage)return eo(this),this;let i=this.getFocusedGroupId();return this.run(()=>{let t=this.getCurrentPageShapesSorted(),s=e.map(s=>{if(s.id||(s={id:(0,n.n6)(),...s}),!s.parentId||!(this.store.has(s.parentId)||e.some(e=>e.id===s.parentId))){let e=this.getFocusedGroupId();if(void 0!==s.x&&void 0!==s.y)for(let i=t.length-1;i>=0;i--){let r=t[i];if(this.getShapeUtil(r).canReceiveNewChildrenOfType(r,s.type)&&!this.isShapeHidden(r)&&this.isPointInShape(r,{x:s.x??0,y:s.y??0},{margin:0,hitInside:!0})){e=r.id;break}}let r=s.parentId;if(e===s.id&&(e=i),e!==r&&((s={...s}).parentId=e,(0,n.vc)(e))){let t=this.getPointInShapeSpace(this.getShape(e),{x:s.x??0,y:s.y??0});s.x=t.x,s.y=t.y,s.rotation=-this.getShapePageTransform(e).rotation()+(s.rotation??0)}}return s}),r=new Map,o=[],{opacityForNextShape:h}=this.getInstanceState();for(let e of s){let t=this.getShapeUtil(e),s=e.index;if(!s){let t=e.parentId??i;r.has(t)||r.set(t,this.getHighestIndexForParent(t)),s=r.get(t),r.set(t,(0,a.AQ)(s))}let n=t.getDefaultProps();for(let[t,i]of this.styleProps[e.type])n[i]=this.getStyleForNextShape(t);let l=this.store.schema.types.shape.create({...e,index:s,opacity:e.opacity??h,parentId:e.parentId??i,props:"props"in e?{...n,...e.props}:n});if(void 0===l.index)throw Error("no index!");let p=this.getShapeUtil(l).onBeforeCreate?.(l);p&&(l=p),o.push(l)}o.forEach(e=>{e.meta={...this.getInitialMetaForShape(e),...e.meta}}),this.emit("created-shapes",o),this.emit("edit"),this.store.put(o)}),this}animatingShapes=new Map;animateShape(e,t={animation:u.mp}){return this.animateShapes([e],t)}animateShapes(e,t={animation:u.mp}){let i,s,r;if(!t.animation)return this;let{duration:n=500,easing:o=C.Z.linear}=t.animation,h=(0,a.NF)(),l=n,p=[];for(let t=0,i=e.length;t<i;t++){if(!(s=e[t]))continue;let i=this.getShape(s.id);i&&(r={start:(0,a.pN)(i),end:eh((0,a.pN)(i),s)},p.push(r),this.animatingShapes.set(i.id,h))}let d=t=>{if((l-=t)<0){let{animatingShapes:t}=this,i=e.filter(e=>e&&t.get(e.id)===h);i.length&&this.updateShapes(i),this.off("tick",d);return}i=o(1-l/n);let{animatingShapes:s}=this,r=[];for(let e=0,t=p.length;e<t;e++){let{start:t,end:n}=p[e];s.get(t.id)===h&&r.push({...n,x:t.x+(n.x-t.x)*i,y:t.y+(n.y-t.y)*i,opacity:t.opacity+(n.opacity-t.opacity)*i,rotation:t.rotation+(n.rotation-t.rotation)*i,props:this.getShapeUtil(n).getInterpolatedProps?.(t,n,i)??n.props})}this._updateShapes(r)};return this.on("tick",d),this}groupShapes(e,t={}){let{groupId:i=(0,n.n6)(),select:s=!0}=t;if(!Array.isArray(e))throw Error("Editor.groupShapes: must provide an array of shapes or shape ids");if(this.getIsReadonly())return this;let r="string"==typeof e[0]?e:e.map(e=>e.id);if(r.length<=1)return this;let o=(0,a.oE)((this._shouldIgnoreShapeLock?r:this._getUnlockedShapeIds(r)).map(e=>this.getShape(e))),h=o.sort(a.Ky).map(e=>e.id),l=(0,a.oE)(o.map(e=>this.getShapePageBounds(e))),p=P.az.Common(l);if(!p.isValid())throw Error("Editor.groupShapes: group bounds are invalid (NaN).");let{x:d,y:g}=p.point,u=this.findCommonAncestor(o)??this.getCurrentPageId();if("select"!==this.getCurrentToolId())return this;this.isIn("select.idle")||this.cancel();let c=o.filter(e=>e.parentId===u).sort(a.Ky),S=c[c.length-1]?.index;return this.run(()=>{this.createShapes([{id:i,type:"group",parentId:u,index:S,x:d,y:g,opacity:1,props:{}}]),this.reparentShapes(h,i),s&&this.select(i)}),this}ungroupShapes(e,t={}){if(this.getIsReadonly())return this;let{select:i=!0}=t,s="string"==typeof e[0]?e:e.map(e=>e.id),r=(0,a.oE)((this._shouldIgnoreShapeLock?s:this._getUnlockedShapeIds(s)).map(e=>this.getShape(e)));if(0===r.length||"select"!==this.getCurrentToolId())return this;this.isIn("select.idle")||this.cancel();let n=new Set,o=[];return r.forEach(e=>{this.isShapeOfType(e,"group")?o.push(e):n.add(e.id)}),0===o.length||this.run(()=>{let e;for(let t=0,i=o.length;t<i;t++){e=o[t];let i=this.getSortedChildIdsForParent(e.id);for(let e=0,t=i.length;e<t;e++)n.add(i[e]);this.reparentShapes(i,e.parentId,e.index)}this.deleteShapes(o.map(e=>e.id)),i&&this.select(...n)}),this}updateShape(e){return this.updateShapes([e]),this}updateShapes(e){let t=Array(e.length);for(let i=0,s=e.length;i<s;i++){let s=e[i];if(!s)continue;let r=this.getShape(s.id);if(r){if(!this._shouldIgnoreShapeLock){if(r.isLocked){if(!(Object.hasOwn(s,"isLocked")&&!s.isLocked))continue}else if(this.isShapeOrAncestorLocked(r))continue}this.animatingShapes.delete(s.id),t.push(s)}}return this._updateShapes(t),this}_updateShapes(e){this.getIsReadonly()||this.run(()=>{let t,i,s=[];for(let r=0,n=e.length;r<n;r++){let n=e[r];n&&(t=this.getShape(n.id))&&(i=eh(t,n))!==t&&(i=this.getShapeUtil(t).onBeforeUpdate?.(t,i)??i,s.push(i))}this.emit("edited-shapes",s),this.emit("edit"),this.store.put(s)})}_getUnlockedShapeIds(e){return e.filter(e=>!this.getShape(e)?.isLocked)}deleteShapes(e){if(this.getIsReadonly())return this;if(!Array.isArray(e))throw Error("Editor.deleteShapes: must provide an array of shapes or shapeIds");let t="string"==typeof e[0]?e:e.map(e=>e.id),i=this._shouldIgnoreShapeLock?t:this._getUnlockedShapeIds(t);if(0===i.length)return this;let s=new Set(i);for(let e of i)this.visitDescendants(e,e=>{s.add(e)});return this.emit("deleted-shapes",[...s]),this.emit("edit"),this.run(()=>this.store.remove([...s]))}deleteShape(e){return this.deleteShapes(["string"==typeof e?e:e.id]),this}_extractSharedStyles(e,t){if(this.isShapeOfType(e,"group")){let i=this._parentIdsToChildIds.get()[e.id];if(i)for(let e=0,s=i.length;e<s;e++)this._extractSharedStyles(this.getShape(i[e]),t)}else for(let[i,s]of this.styleProps[e.type])t.applyValue(i,(0,a.g5)(e.props,s))}_getSelectionSharedStyles(){let e=this.getSelectedShapes(),t=new R.b;for(let i of e)this._extractSharedStyles(i,t);return t}getStyleForNextShape(e){let t=this.getInstanceState().stylesForNextShape[e.id];return void 0===t?e.defaultValue:t}getShapeStyleIfExists(e,t){let i=this.styleProps[e.type].get(t);if(void 0!==i)return(0,a.g5)(e.props,i)}getSharedStyles(){if(this.isIn("select")&&this.getSelectedShapeIds().length>0)return this._getSelectionSharedStyles();let e=this.root.getCurrent(),t=new R.b;if(!e)return t;if(e.shapeType)if("frame"!==e.shapeType||this.getShapeUtil("frame").options.showColors)for(let i of this.styleProps[e.shapeType].keys())t.applyValue(i,this.getStyleForNextShape(i));else for(let i of this.styleProps[e.shapeType].keys())"tldraw:color"!==i.id&&t.applyValue(i,this.getStyleForNextShape(i));return t}getSharedOpacity(){if(this.isIn("select")&&this.getSelectedShapeIds().length>0){let e=[],t=i=>{let s=this.getShape(i);if(s)if(this.isShapeOfType(s,"group"))for(let e of this.getSortedChildIdsForParent(s.id))t(e);else e.push(s)};for(let e of this.getSelectedShapeIds())t(e);let i=null;for(let t of e)if(null===i)i=t.opacity;else if(i!==t.opacity)return{type:"mixed"};if(null!==i)return{type:"shared",value:i}}return{type:"shared",value:this.getInstanceState().opacityForNextShape}}setOpacityForNextShapes(e,t){return this.updateInstanceState({opacityForNextShape:e},t),this}setOpacityForSelectedShapes(e){let t=this.getSelectedShapes();if(t.length>0){let i=[],s=e=>{if(this.isShapeOfType(e,"group"))for(let t of this.getSortedChildIdsForParent(e))s(this.getShape(t));else i.push(e)};for(let e of t)s(e);this.updateShapes(i.map(t=>({id:t.id,type:t.type,opacity:e})))}return this}setStyleForNextShapes(e,t,i){let s=this.getInstanceState().stylesForNextShape;return this.updateInstanceState({stylesForNextShape:{...s,[e.id]:t}},i),this}setStyleForSelectedShapes(e,t){let i=this.getSelectedShapes();if(i.length>0){let s=[],r=i=>{if(this.isShapeOfType(i,"group"))for(let e of this.getSortedChildIdsForParent(i.id))r(this.getShape(e));else{let r=this.getShapeUtil(i),n=this.styleProps[i.type].get(e);if(n){let e={id:i.id,type:i.type,props:{[n]:t}};s.push({util:r,originalShape:i,updatePartial:e})}}};for(let e of i)r(e);this.updateShapes(s.map(({updatePartial:e})=>e))}return this}externalAssetContentHandlers={file:null,url:null};temporaryAssetPreview=new Map;registerExternalAssetHandler(e,t){return this.externalAssetContentHandlers[e]=t,this}createTemporaryAssetPreview(e,t){if(this.temporaryAssetPreview.has(e))return this.temporaryAssetPreview.get(e);let i=URL.createObjectURL(t);return this.temporaryAssetPreview.set(e,i),setTimeout(()=>{this.temporaryAssetPreview.delete(e),URL.revokeObjectURL(i)},this.options.temporaryAssetPreviewLifetimeMs),i}getTemporaryAssetPreview(e){return this.temporaryAssetPreview.get(e)}async getAssetForExternalContent(e){return await this.externalAssetContentHandlers[e.type]?.(e)}hasExternalAssetHandler(e){return!!this.externalAssetContentHandlers[e]}externalContentHandlers={text:null,files:null,"file-replace":null,embed:null,"svg-text":null,url:null,tldraw:null,excalidraw:null};registerExternalContentHandler(e,t){return this.externalContentHandlers[e]=t,this}async putExternalContent(e,t={}){if(!(!t.force&&this.getIsReadonly()))return this.externalContentHandlers[e.type]?.(e)}async replaceExternalContent(e,t={}){if(!(!t.force&&this.getIsReadonly()))return this.externalContentHandlers[e.type]?.(e)}getContentFromCurrentPage(e){let t="string"==typeof e[0]?e:e.map(e=>e.id);if(!t||0===t.length)return;let i=this.getShapeAndDescendantIds(t);return el(this,i,e=>{let t=[];for(let i of e){let e=this.getBinding(i);e&&t.push(e)}let s=[],r=[];for(let e of i){let t=this.getShape(e);if(t)if(i.has(t.parentId))r.push(t);else{let e=this.getShapePageTransform(t.id),i=e.point();r.push({...t,x:i.x,y:i.y,rotation:e.rotation(),parentId:this.getCurrentPageId()}),s.push(t.id)}}let a=[],o=new Set;for(let e of r){if(!("assetId"in e.props))continue;let t=e.props.assetId;if(!t||o.has(t))continue;o.add(t);let i=this.getAsset(t);i&&a.push(i)}let h=[],l=new Set;for(let e of this._getReferencedUserIds(r)){let t=(0,n.dB)(e);if(l.has(t))continue;l.add(t);let i=this.store.get(t);i&&h.push(i)}return{schema:this.store.schema.serialize(),shapes:r,rootShapeIds:s,bindings:t,assets:a,users:h}})}async resolveAssetsInContent(e){if(!e)return;let t=[];return await Promise.allSettled(e.assets.map(async e=>{if("image"!==e.type&&"video"!==e.type||e.props.src?.startsWith("data:image")||e.props.src?.startsWith("data:video")||e.props.src?.startsWith("http"))t.push(e);else{let i=(0,a.pN)(e),s=await this.store.props.assets.resolve(e,{screenScale:1,steppedScreenScale:1,dpr:1,networkEffectiveType:null,shouldResolveToOriginal:!0});i.props.src=await a.Sm.blobToDataUrl(await (0,a.hd)(s).then(e=>e.blob())),t.push(i)}})),e.assets=t,e}putContentOntoCurrentPage(e,t={}){if(this.getIsReadonly())return this;if(!e.schema)throw Error("Could not put content:\ncontent is missing a schema.");let{select:i=!1,preserveIds:s=!1,preservePosition:r=!1}=t,{point:o}=t,h=this.getCurrentPageId(),{rootShapeIds:l}=e,p=[],d=[],g=[],u=[],c={store:{...Object.fromEntries(e.assets.map(e=>[e.id,e])),...Object.fromEntries(e.shapes.map(e=>[e.id,e])),...Object.fromEntries(e.bindings?.map(e=>[e.id,e])??[]),...Object.fromEntries(e.users?.map(e=>[e.id,e])??[])},schema:e.schema},S=this.store.schema.migrateStoreSnapshot(c);if("error"===S.type)throw Error("Could not put content: could not migrate content");for(let e of Object.values(S.value))switch(e.typeName){case"asset":p.push(e);break;case"shape":d.push(e);break;case"binding":g.push(e);break;case"user":u.push(e)}if(u.length>0){let e=new Set(this.store.allRecords().filter(e=>"user"===e.typeName).map(e=>e.id)),t=u.filter(t=>!e.has(t.id));t.length>0&&this.store.put(t)}let f=new Map(s?d.map(e=>[e.id,e.id]):d.map(e=>[e.id,(0,n.n6)()])),m=new Map(s?g.map(e=>[e.id,e.id]):g.map(e=>[e.id,(0,n.BN)()])),y=h,I=new Map(d.map(e=>[e.id,e])),C=(0,a.oE)(l.map(e=>I.get(e)));if(o){if(C.length>0){let e=this.getShapeAtPoint(o,{hitInside:!0,hitFrameInside:!0,hitLocked:!0,filter:e=>{let t=this.getShapeUtil(e);return C.every(i=>t.canReceiveNewChildrenOfType?.(e,i.type))}});y=e?.id??h}}else if(!r){let e=this.getSelectedShapes(),t=null,i=e=>{let t=this.getShapeUtil(e);return C.every(i=>t.canReceiveNewChildrenOfType?.(e,i.type))};for(let s of e){let e=i(s)?s:this.findShapeAncestor(s,i)??((0,n.vc)(s.parentId)?this.getShape(s.parentId):null);if(!e){t=null;break}if(t){if(t.id!==e.id){let s=this.getShapeAncestors(t);i(t)&&s.push(t);let r=s.filter(i),n=new Set([e.id,...this.getShapeAncestors(e).map(e=>e.id)]),a=null;for(let e=r.length-1;e>=0;e--)if(n.has(r[e].id)){a=r[e];break}if(!(t=a))break}}else t=e}t&&f.has(t.id)&&(t=null),t&&(y=t.id)}let w=this.getHighestIndexForParent(y),_=[],T=d.map(e=>{let t=f.get(e.id),i={...e,id:t};return s||(i=this.getShapeUtil(i).onBeforeDuplicate?.(e,i)??i),l.includes(e.id)&&(i.parentId=h,_.push(i)),f.has(i.parentId)?i.parentId=f.get(e.parentId):(l.push(i.id),i.index=w,w=(0,a.AQ)(w)),i});if(T.length+this.getCurrentPageShapeIds().size>this.options.maxShapesPerPage)return eo(this),this;let v=g.map(e=>({...e,id:(0,a.Z1)(m.get(e.id)),fromId:(0,a.Z1)(f.get(e.fromId)),toId:(0,a.Z1)(f.get(e.toId))})),k=[],A=[];for(let e of p)this.store.has(e.id)||(("image"===e.type&&e.props.src?.startsWith("data:image")||"video"===e.type&&e.props.src?.startsWith("data:video"))&&(A.push((0,a.pN)(e)),e.props.src=null),k.push(e));return Promise.allSettled(A.map(async e=>{let t=await (0,E.b)(e.props.src,e.props.name,e.props.mimeType??"image/png"),i=await this.getAssetForExternalContent({type:"file",file:t,assetId:e.id});i?this.updateAssets([{...i,id:e.id}]):this.deleteAssets([e.id])})),this.run(()=>{k.length>0&&this.createAssets(k),this.createShapes(T),this.createBindings(v),i&&this.select(..._.map(e=>e.id)),y!==h&&this.reparentShapes(_.map(e=>e.id),y);let e=P.az.Common((0,a.oE)(_.map(e=>this.getShapePageBounds(e.id))));if(void 0===o)if((0,n.xh)(y))if(r)o=e.center;else{let t=this.getViewportPageBounds();o=_.some(e=>{let i=this.getShapePageBounds(e.id);return i&&t.collides(i)})?e.center:t.center}else{let e=this.getShape(y);o=x.V.applyToPoint(this.getShapePageTransform(e),this.getShapeGeometry(e).bounds.center)}let t=P.az.Common((0,a.oE)(_.map(({id:e})=>this.getShapePageBounds(e)))).center,s=b.l.Sub(o,t);if((0!==s.x||0!==s.y)&&this.updateShapes(_.map(({id:e})=>{let t=this.getShape(e),i=this.getShapeParentTransform(e).decompose().rotation,r=b.l.Rot(s,-i);return{id:t.id,type:t.type,x:t.x+r.x,y:t.y+r.y}})),(0,n.xh)(y)){let e=(0,a.oE)(_.map(e=>this.getShape(e.id))),{reparenting:t}=(0,F.d)(this,e,(e,t)=>{if(f.has(t.id))return!1;let i=this.getShapePageBounds(e),s=this.getShapePageBounds(t);return!!i&&!!s&&s.containsPoint(i.center)});t.forEach((e,t)=>{0!==e.length&&this.reparentShapes(e.map(e=>e.id),t)})}let l=new Set(T.map(e=>e.id)),p=_.map(e=>e.id).filter(e=>{let t=this.getShape(e);return!(!t||(0,n.xh)(t.parentId))&&!this.getSortedChildIdsForParent(e).some(e=>l.has(e))});p.length>0&&(0,F.I)(this,p)}),this}async getSvgElement(e,t={}){let i=0===e.length?this.getCurrentPageShapeIdsSorted():"string"==typeof e[0]?e:e.map(e=>e.id);if(0!==i.length)return await this.fonts.loadRequiredFontsForCurrentPage(this.options.maxFontsToLoadBeforeRender),(0,S.W)(this,i,t)}async getSvgString(e,t={}){let i=await this.getSvgElement(e,t);if(i)return{svg:new XMLSerializer().serializeToString(i.svg),width:i.width,height:i.height,trimPadding:i.trimPadding}}async toImage(e,t={}){let i={format:"png",scale:1,pixelRatio:"svg"===t.format?void 0:2,...t},s=await this.getSvgString(e,i);if(!s)throw Error("Could not create SVG");switch(i.format){case"svg":{let e=s.svg,t=s.width,r=s.height;if(s.trimPadding>0){let n=await (0,f.XN)(e,{width:t,height:r,trimPadding:s.trimPadding,scale:i.scale});n&&(e=n.svg,t=n.width,r=n.height)}return{blob:new Blob([e],{type:"image/svg+xml"}),width:t,height:r}}case"jpeg":case"png":case"webp":{let e=await (0,f.q1)(s.svg,{type:i.format,quality:i.quality,pixelRatio:i.pixelRatio,width:s.width,height:s.height,trimPadding:s.trimPadding,scale:i.scale});if(!e)throw Error("Could not construct image.");return e}default:(0,a.h6)(i.format)}}async toImageDataUrl(e,t={}){let{blob:i,width:s,height:r}=await this.toImage(e,t);return{url:await a.Sm.blobToDataUrl(i),width:s,height:r}}cancel(){return this.dispatch({type:"misc",name:"cancel"}),this}interrupt(){return this.dispatch({type:"misc",name:"interrupt"}),this}complete(){return this.dispatch({type:"misc",name:"complete"}),this}updatePointer(e){let t={type:"pointer",target:"canvas",name:"pointer_move",point:e?.point??b.l.Add(this.inputs.getCurrentScreenPoint(),this.store.unsafeGetWithoutCapture(n.O9).screenBounds),pointerId:e?.pointerId??0,button:e?.button??0,isPen:e?.isPen??this.inputs.getIsPen(),shiftKey:e?.shiftKey??this.inputs.getShiftKey(),altKey:e?.altKey??this.inputs.getAltKey(),ctrlKey:e?.ctrlKey??this.inputs.getCtrlKey(),metaKey:e?.metaKey??this.inputs.getMetaKey(),accelKey:!1};return t.accelKey=e?.accelKey??this.inputs.getAccelKey(),e?.immediate?this._flushEventForTick(t):this.dispatch(t),this}focus({focusContainer:e=!0}={}){return this.getIsFocused()||(e&&this.focusManager.focus(),this.updateInstanceState({isFocused:!0})),this}blur({blurContainer:e=!0}={}){return this.getIsFocused()&&(this.focusManager.blur({blurContainer:e}),this.updateInstanceState({isFocused:!1})),this}getIsFocused(){return this.getInstanceState().isFocused}getIsReadonly(){return this.getInstanceState().isReadonly}getSnapshot(){return(0,g.d)(this.store)}loadSnapshot(e,t){return(0,g.N)(this.store,e,t),this}_zoomToFitPageContentAt100Percent(){let e=this.getCurrentPageBounds();e&&this.zoomToBounds(e,{immediate:!0,targetZoom:this.getBaseZoom()})}_navigateToDeepLink(e){this.run(()=>{switch(e.type){case"page":{let t=this.getPage(e.pageId);t&&this.setCurrentPage(t),this._zoomToFitPageContentAt100Percent();return}case"shapes":{let t=(0,a.oE)(e.shapeIds.map(e=>this.getShape(e))),i={};for(let e of t){let t=this.getAncestorPageId(e);t&&(i[t]??=[],i[t].push(e))}let[s,r]=Object.entries(i).sort(([e,t],[i,s])=>s.length-t.length)[0]??["",[]];if(s&&r.length){this.setCurrentPage(s);let e=P.az.Common(r.map(e=>this.getShapePageBounds(e)));this.zoomToBounds(e,{immediate:!0,targetZoom:this.getBaseZoom()})}else this._zoomToFitPageContentAt100Percent();return}case"viewport":if(e.pageId){if(!this.getPage(e.pageId))return void this._zoomToFitPageContentAt100Percent();this.setCurrentPage(e.pageId)}this.zoomToBounds(e.bounds,{immediate:!0,inset:0});return;default:(0,a.h6)(e)}})}navigateToDeepLink(e){if(e&&"type"in e)return this._navigateToDeepLink(e),this;let t=new URL(e?.url??window.location.href).searchParams.get(e?.param??"d");if(!t)return this._zoomToFitPageContentAt100Percent(),this;try{this._navigateToDeepLink((0,A.H)(t))}catch(e){console.warn(e),this._zoomToFitPageContentAt100Percent()}return this}createDeepLink(e){let t=new URL(e?.url??window.location.href);return t.searchParams.set(e?.param??"d",(0,A.w)(e?.to??{type:"viewport",pageId:1===this.options.maxPages?void 0:this.getCurrentPageId(),bounds:this.getViewportPageBounds()})),t}registerDeepLinkListener(e){if(e?.getUrl&&!e?.onChange)throw Error("[tldraw:urlStateSync] If you specify getUrl, you must also specify the onChange callback.");let t=(0,s.EW)("url with state",()=>{let t=e?.getUrl?.(this)??window.location.href;return this.createDeepLink({param:e?.param,url:t,to:e?.getTarget?.(this)}).toString()}),i=e?.onChange??(()=>{let t=this.createDeepLink({param:e?.param,to:e?.getTarget?.(this)});window.history.replaceState({},this.getContainerDocument().title,t.toString())}),r=(0,a.sg)(e=>e(),e?.debounceMs??500),n=(0,s.wv)("update url on state change",()=>i(new URL(t.get()),this),{scheduleEffect:r});return()=>{n(),r.cancel()}}_clickManager=new D.s(this);cancelDoubleClick(){this._clickManager.cancelDoubleClickTimeout()}_prevCursor="default";_shiftKeyTimeout=-1;_setShiftKeyTimeout(){this.inputs.setShiftKey(!1),this.dispatch({type:"keyboard",name:"key_up",key:"Shift",shiftKey:this.inputs.getShiftKey(),ctrlKey:this.inputs.getCtrlKey(),altKey:this.inputs.getAltKey(),metaKey:this.inputs.getMetaKey(),accelKey:this.inputs.getAccelKey(),code:"ShiftLeft"})}_altKeyTimeout=-1;_setAltKeyTimeout(){this.inputs.setAltKey(!1),this.dispatch({type:"keyboard",name:"key_up",key:"Alt",shiftKey:this.inputs.getShiftKey(),ctrlKey:this.inputs.getCtrlKey(),altKey:this.inputs.getAltKey(),metaKey:this.inputs.getMetaKey(),accelKey:this.inputs.getAccelKey(),code:"AltLeft"})}_ctrlKeyTimeout=-1;_setCtrlKeyTimeout(){this.inputs.setCtrlKey(!1),this.dispatch({type:"keyboard",name:"key_up",key:"Ctrl",shiftKey:this.inputs.getShiftKey(),ctrlKey:this.inputs.getCtrlKey(),altKey:this.inputs.getAltKey(),metaKey:this.inputs.getMetaKey(),accelKey:this.inputs.getAccelKey(),code:"ControlLeft"})}_metaKeyTimeout=-1;_setMetaKeyTimeout(){this.inputs.setMetaKey(!1),this.dispatch({type:"keyboard",name:"key_up",key:"Meta",shiftKey:this.inputs.getShiftKey(),ctrlKey:this.inputs.getCtrlKey(),altKey:this.inputs.getAltKey(),metaKey:this.inputs.getMetaKey(),accelKey:this.inputs.getAccelKey(),code:"MetaLeft"})}_restoreToolId="select";_didPinch=!1;_selectedShapeIdsAtPointerDown=[];_didCaptureSelectionAtPointerDown=!1;_longPressTimeout=-1;capturedPointerId=null;performanceTracker;performanceTrackerTimeout=-1;handledEvents=new WeakSet;markEventAsHandled(e){let t="nativeEvent"in e?e.nativeEvent:e;this.handledEvents.add(t)}wasEventAlreadyHandled(e){let t="nativeEvent"in e?e.nativeEvent:e;return this.handledEvents.has(t)}dispatch(e){return this._pendingEventsForNextTick.push(e),("pointer"!==e.type||"pointer_move"!==e.name)&&"wheel"!==e.type&&"pinch"!==e.type&&this._flushEventsForTick(0),this}_pendingEventsForNextTick=[];_flushEventsForTick(e){this.run(()=>{if(this._pendingEventsForNextTick.length>0){let e=[...this._pendingEventsForNextTick];for(let t of(this._pendingEventsForNextTick.length=0,e))this._flushEventForTick(t)}e>0&&this.root.handleEvent({type:"misc",name:"tick",elapsed:e}),this.scribbles.tick(e)})}_flushEventForTick(e){if(this.getCrashingError())return this;this.emit("before-event",e);let{inputs:t}=this,{type:i}=e;if("misc"===e.type){("cancel"===e.name||"complete"===e.name)&&(this.inputs.setIsDragging(!1),this.inputs.getIsPanning()&&(this.inputs.setIsPanning(!1),this.inputs.setIsSpacebarPanning(!1),this.setCursor({type:this._prevCursor,rotation:0}))),this.root.handleEvent(e),this.emit("event",e);return}e.shiftKey?(clearTimeout(this._shiftKeyTimeout),this._shiftKeyTimeout=-1,t.setShiftKey(!0)):!e.shiftKey&&t.getShiftKey()&&-1===this._shiftKeyTimeout&&(this._shiftKeyTimeout=this.timers.setTimeout(this._setShiftKeyTimeout,150)),e.altKey?(clearTimeout(this._altKeyTimeout),this._altKeyTimeout=-1,t.setAltKey(!0)):!e.altKey&&t.getAltKey()&&-1===this._altKeyTimeout&&(this._altKeyTimeout=this.timers.setTimeout(this._setAltKeyTimeout,150)),e.ctrlKey?(clearTimeout(this._ctrlKeyTimeout),this._ctrlKeyTimeout=-1,t.setCtrlKey(!0)):!e.ctrlKey&&t.getCtrlKey()&&-1===this._ctrlKeyTimeout&&(this._ctrlKeyTimeout=this.timers.setTimeout(this._setCtrlKeyTimeout,150)),e.metaKey&&"key_up"!==e.name?(clearTimeout(this._metaKeyTimeout),this._metaKeyTimeout=-1,t.setMetaKey(!0)):!e.metaKey&&t.getMetaKey()&&-1===this._metaKeyTimeout&&(this._metaKeyTimeout=this.timers.setTimeout(this._setMetaKeyTimeout,150)),t.getIsPointing()||t.setIsDragging(!1);let r=this.store.unsafeGetWithoutCapture(n.O9),a=this.store.get(this._getCurrentPageStateId()),o=this._cameraOptions.__unsafe__getWithoutCapture();switch(i){case"pinch":if(o.isLocked)return;switch(clearTimeout(this._longPressTimeout),this.inputs.updateFromEvent(e),e.name){case"pinch_start":if(t.getIsPinching())return;!t.getIsEditing()&&(this._didCaptureSelectionAtPointerDown||(this._selectedShapeIdsAtPointerDown=[...a.selectedShapeIds]),this._didPinch=!0,t.setIsPinching(!0),this.interrupt(),this._didCaptureSelectionAtPointerDown&&this.setSelectedShapes(this._selectedShapeIdsAtPointerDown)),this.emit("event",e);return;case"pinch":{if(!t.getIsPinching())return;let{point:{z:i=1},delta:{x:n,y:a}}=e,{x:h,y:l}=b.l.SubXY(e.point,r.screenBounds.x,r.screenBounds.y);this.stopCameraAnimation(),r.followingUserId&&this.stopFollowingUser();let{x:p,y:d,z:g}=(0,s.Pm)(()=>this.getCamera()),{panSpeed:u}=o;this._setCamera(new b.l(p+n*u/g-h/g+h/i,d+a*u/g-l/g+l/i,i),{immediate:!0}),this.performance._notifyCameraOperation("zooming"),this.emit("event",e);return}case"pinch_end":{if(!t.getIsPinching())return this;t.setIsPinching(!1);let{_selectedShapeIdsAtPointerDown:i}=this;this.setSelectedShapes(this._selectedShapeIdsAtPointerDown),this._selectedShapeIdsAtPointerDown=[],this._didCaptureSelectionAtPointerDown=!1,this._didPinch&&(this._didPinch=!1,i.length>0&&this.once("tick",()=>{this._didPinch||this.setSelectedShapes(i)})),this.emit("event",e);return}}case"wheel":{if(o.isLocked)return;this.inputs.updateFromEvent(e);let{panSpeed:t,zoomSpeed:i}=o,n=o.wheelBehavior,a=this.user.getUserPreferences().inputMode;if(null!==a&&(n="trackpad"===a?"pan":"zoom"),"none"!==n){this.stopCameraAnimation(),r.followingUserId&&this.stopFollowingUser();let{x:o,y:h,z:l}=(0,s.Pm)(()=>this.getCamera()),{x:p,y:d,z:g=0}=e.delta,u=n;switch(e.ctrlKey&&(u="pan"===n?"zoom":"pan"),u){case"zoom":{let{x:t,y:s}=this.inputs.getCurrentScreenPoint(),r=g;"zoom"===n&&(r=Math.abs(d)>10?10*Math.sign(d)/100:d/100);let p=(this.user.getUserPreferences().isZoomDirectionInverted&&"mouse"===a)??!1,u=r??0,c=l+(p?-u:u)*i*l;this._setCamera(new b.l(o+t/c-t/l,h+s/c-s/l,c),{immediate:!0}),this.maybeTrackPerformance("Zooming"),this.performance._notifyCameraOperation("zooming"),this.root.handleEvent(e),this.emit("event",e);return}case"pan":this._setCamera(new b.l(o+p*t/l,h+d*t/l,l),{immediate:!0}),this.maybeTrackPerformance("Panning"),this.performance._notifyCameraOperation("panning"),this.root.handleEvent(e),this.emit("event",e);return}}break}case"pointer":{if(t.getIsPinching())return;this.inputs.updateFromEvent(e);let{isPen:i}=e,{isPenMode:n}=r;switch(e.name){case"pointer_down":if(n&&!i)return;if(this.inputs.getIsPanning()||(this._longPressTimeout=this.timers.setTimeout(()=>{let t=this.getViewportScreenBounds();this.dispatch({...e,point:this.inputs.getOriginScreenPoint().clone().addXY(t.x,t.y),name:"long_press"})},this.options.longPressDurationMs)),this._didCaptureSelectionAtPointerDown||(this._selectedShapeIdsAtPointerDown=this.getSelectedShapeIds(),this._didCaptureSelectionAtPointerDown=!0),e.button===u.bH&&(this.capturedPointerId=e.pointerId),t.buttons.add(e.button),t.setIsPointing(!0),t.setIsDragging(!1),!n&&e.isPenDirect&&(this.updateInstanceState({isPenMode:!0}),this.interrupt()),e.button===u.Tf)this._restoreToolId=this.getCurrentToolId(),this.complete(),this.setCurrentTool("eraser");else if(e.button===u.R_)this.inputs.getIsPanning()||(this._prevCursor=this.getInstanceState().cursor.type),this.inputs.setIsPanning(!0),clearTimeout(this._longPressTimeout);else if(e.button===u.EI&&this.options.rightClickPanning)return this.inputs.setIsRightPointing(!0),clearTimeout(this._longPressTimeout),this;if(this.inputs.getIsPanning())return this.stopCameraAnimation(),this.setCursor({type:"grabbing",rotation:0}),this;break;case"pointer_move":{if(!i&&n)return;let{x:e,y:a,z:o}=(0,s.Pm)(()=>this.getCamera());if(this.inputs.getIsRightPointing()&&!this.inputs.getIsPanning()){let t=this.inputs.getCurrentScreenPoint(),i=this.inputs.getOriginScreenPoint();if(b.l.Dist2(i,t)>this.options.dragDistanceSquared){this._prevCursor=this.getInstanceState().cursor.type,this.inputs.setIsPanning(!0),this.setCursor({type:"grabbing",rotation:0}),this.stopCameraAnimation();let s=b.l.Sub(t,i);this.setCamera(new b.l(e+s.x/o,a+s.y/o,o),{immediate:!0}),this.maybeTrackPerformance("Panning")}return}if(this.inputs.getIsPanning()&&this.inputs.getIsPointing()){let t=this.inputs.getCurrentScreenPoint(),i=this.inputs.getPreviousScreenPoint(),s=b.l.Sub(t,i);this.setCamera(new b.l(e+s.x/o,a+s.y/o,o),{immediate:!0}),this.maybeTrackPerformance("Panning"),this.performance._notifyCameraOperation("panning");return}t.getIsPointing()&&!t.getIsDragging()&&b.l.Dist2(t.getOriginPagePoint(),t.getCurrentPagePoint())*this.getZoomLevel()>(r.isCoarsePointer?this.options.coarseDragDistanceSquared:this.options.dragDistanceSquared)/o&&(t.setIsDragging(!0),clearTimeout(this._longPressTimeout));break}case"pointer_up":if(t.setIsDragging(!1),t.setIsPointing(!1),clearTimeout(this._longPressTimeout),t.buttons.delete(e.button),r.isPenMode&&!i)return;if(this.inputs.getIsRightPointing()&&!this.inputs.getIsPanning()){this.inputs.setIsRightPointing(!1),this._selectedShapeIdsAtPointerDown=[],this._didCaptureSelectionAtPointerDown=!1;break}if(this.inputs.setIsRightPointing(!1),this.capturedPointerId===e.pointerId&&(this.capturedPointerId=null,e.button=0),t.getIsPanning()){t.keys.has("Space")||(t.setIsPanning(!1),t.setIsSpacebarPanning(!1));let i=this.inputs.getPointerVelocity(),s=Math.min(2,i.len());switch(e.button){case u.bH:this.setCursor({type:"grab",rotation:0});break;case u.R_:this.inputs.keys.has("Space")?this.setCursor({type:"grab",rotation:0}):this.setCursor({type:this._prevCursor,rotation:0});break;case u.EI:return this.inputs.keys.has("Space")?this.setCursor({type:"grab",rotation:0}):this.setCursor({type:this._prevCursor,rotation:0}),s>0&&this.slideCamera({speed:s,direction:{x:i.x,y:i.y,z:0}}),this._selectedShapeIdsAtPointerDown=[],this._didCaptureSelectionAtPointerDown=!1,this}s>0&&this.slideCamera({speed:s,direction:{x:i.x,y:i.y,z:0}})}else e.button===u.Tf&&(this.complete(),this.setCurrentTool(this._restoreToolId));this._selectedShapeIdsAtPointerDown=[],this._didCaptureSelectionAtPointerDown=!1}break}case"keyboard":switch("ShiftRight"===e.key&&(e.key="ShiftLeft"),"AltRight"===e.key&&(e.key="AltLeft"),"ControlRight"===e.code&&(e.code="ControlLeft"),"MetaRight"===e.code&&(e.code="MetaLeft"),e.name){case"key_down":if(t.keys.add(e.code),this.options.spacebarPanning&&("Space"!==e.code||e.ctrlKey||(this.inputs.getIsPanning()||(this._prevCursor=r.cursor.type),this.inputs.setIsPanning(!0),this.inputs.setIsSpacebarPanning(!0),clearTimeout(this._longPressTimeout),this.setCursor({type:this.inputs.getIsPointing()?"grabbing":"grab",rotation:0})),this.inputs.getIsSpacebarPanning())){let t;switch(e.code){case"ArrowUp":t=new b.l(0,-1);break;case"ArrowRight":t=new b.l(1,0);break;case"ArrowDown":t=new b.l(0,1);break;case"ArrowLeft":t=new b.l(-1,0)}if(t){let e=this.getViewportPageBounds(),i=e.clone().translate(t.mulV({x:e.w,y:e.h}));this._animateToViewport(i,{animation:{duration:320}})}}break;case"key_up":t.keys.delete(e.code),this.options.spacebarPanning&&"Space"===e.code&&(this.inputs.buttons.has(u.R_)||(this.inputs.setIsPanning(!1),this.inputs.setIsSpacebarPanning(!1),this.setCursor({type:this._prevCursor,rotation:0})))}}if("pointer"===e.type){e.button===u.R_?e.name="middle_click":e.button===u.EI&&(e.name="right_click"),"right_click"===e.name&&"select"!==this.getCurrentToolId()&&this.getStateDescendant("select")&&this.setCurrentTool("select");let{isPenMode:t}=this.store.unsafeGetWithoutCapture(n.O9);if(e.isPen===t){let t=this._clickManager.handlePointerEvent(e);if(e.name!==t.name){this.root.handleEvent(e),this.emit("event",e),this.root.handleEvent(t),this.emit("event",t);return}}}return this.root.handleEvent(e),this.emit("event",e),"pointer"===e.type&&"pointer_down"===e.name&&this.menus.clearOpenMenus(),this}maybeTrackPerformance(e){k.bG.measurePerformance.get()&&(this.performanceTracker.isStarted()?clearTimeout(this.performanceTrackerTimeout):this.performanceTracker.start(e),this.performanceTrackerTimeout=this.timers.setTimeout(()=>{this.performanceTracker.stop()},50))}}function eo(e,t=e.getCurrentPageId()){let i=e.getPage(t).name;e.emit("max-shapes",{name:i,pageId:t,count:e.options.maxShapesPerPage})}function eh(e,t){if(!t)return e;let i=null,s=Object.entries(t);for(let t=0,r=s.length;t<r;t++){let[r,n]=s[t];if(void 0!==n&&"id"!==r&&"type"!==r&&"typeName"!==r&&n!==e[r]){if(i||(i={...e}),"props"===r||"meta"===r){for(let[t,s]of(i[r]={...e[r]},Object.entries(n)))i[r][t]=s;continue}i[r]=n}}return i||e}function el(e,t,i){let s;if(e.run(()=>{let n=e.store.extractingChanges(()=>{let r=new Set,n=new Set;for(let i of t)if(e.getShape(i))for(let s of e.getBindingsInvolvingShape(i)){let e=t.has(s.fromId),i=t.has(s.toId);if(e&&i){r.add(s.id);continue}e&&i||n.add(s.id)}e.deleteBindings([...n],{isolateShapes:!0});try{s=a.Q7.ok(i(r))}catch(e){s=a.Q7.err(e)}});e.store.applyDiff((0,r.E8)(n),{runCallbacks:!1})},{history:"ignore"}),s.ok)return s.value;throw s.error}function ep(e,t){if(!t.constraints)throw Error("Should have constraints here");let{padding:{x:i,y:s}}=t.constraints,r=e.getViewportScreenBounds(),n=P.az.From(t.constraints.bounds);return{zx:(r.w-2*i)/n.w,zy:(r.h-2*s)/n.h}}en([s.EW],ea.prototype,"getIsShapeHiddenCache",1),en([s.EW],ea.prototype,"getIsMounted",1),en([s.EW],ea.prototype,"canUndo",1),en([s.EW],ea.prototype,"canRedo",1),en([s.EW],ea.prototype,"getPath",1),en([s.EW],ea.prototype,"getCurrentTool",1),en([s.EW],ea.prototype,"getCurrentToolId",1),en([s.EW],ea.prototype,"getDocumentSettings",1),en([s.EW],ea.prototype,"getInstanceState",1),en([s.EW],ea.prototype,"getPageStates",1),en([s.EW],ea.prototype,"_getPageStatesQuery",1),en([s.EW],ea.prototype,"getCurrentPageState",1),en([s.EW],ea.prototype,"_getCurrentPageStateId",1),en([s.EW],ea.prototype,"getSelectedShapeIds",1),en([s.EW],ea.prototype,"getSelectedShapes",1),en([s.EW],ea.prototype,"getCurrentPageShapesInReadingOrder",1),en([s.EW],ea.prototype,"getOnlySelectedShapeId",1),en([s.EW],ea.prototype,"getOnlySelectedShape",1),en([s.EW],ea.prototype,"getSelectionPageBounds",1),en([s.EW],ea.prototype,"getSelectionRotation",1),en([s.EW],ea.prototype,"getSelectionRotatedPageBounds",1),en([s.EW],ea.prototype,"getSelectionRotatedScreenBounds",1),en([s.EW],ea.prototype,"getFocusedGroupId",1),en([s.EW],ea.prototype,"getFocusedGroup",1),en([s.EW],ea.prototype,"getEditingShapeId",1),en([s.EW],ea.prototype,"getEditingShape",1),en([s.EW],ea.prototype,"getRichTextEditor",1),en([s.EW],ea.prototype,"getHoveredShapeId",1),en([s.EW],ea.prototype,"getHoveredShape",1),en([s.EW],ea.prototype,"getHintingShapeIds",1),en([s.EW],ea.prototype,"getHintingShape",1),en([s.EW],ea.prototype,"getErasingShapeIds",1),en([s.EW],ea.prototype,"getErasingShapes",1),en([s.EW],ea.prototype,"_unsafe_getCameraId",1),en([s.EW],ea.prototype,"getCamera",1),en([s.EW],ea.prototype,"getViewportPageBoundsForFollowing",1),en([s.EW],ea.prototype,"getCameraForFollowing",1),en([s.EW],ea.prototype,"getZoomLevel",1),en([s.EW],ea.prototype,"getResizeScaleFactor",1),en([s.EW],ea.prototype,"getDebouncedZoomLevel",1),en([s.EW],ea.prototype,"_getAboveDebouncedZoomThreshold",1),en([s.EW],ea.prototype,"getEfficientZoomLevel",1),en([s.EW],ea.prototype,"getViewportScreenBounds",1),en([s.EW],ea.prototype,"getViewportScreenCenter",1),en([s.EW],ea.prototype,"getViewportPageBounds",1),en([s.EW],ea.prototype,"getRenderingShapes",1),en([s.EW],ea.prototype,"_getAllPagesQuery",1),en([s.EW],ea.prototype,"getPages",1),en([s.EW],ea.prototype,"getCurrentPageId",1),en([s.EW],ea.prototype,"getCurrentPageShapeIdsSorted",1),en([s.EW],ea.prototype,"_getAllAssetsQuery",1),en([s.EW],ea.prototype,"_getShapeHandlesCache",1),en([s.EW],ea.prototype,"_getShapePageTransformCache",1),en([s.EW],ea.prototype,"_getShapePageBoundsCache",1),en([s.EW],ea.prototype,"_getShapeClipPathCache",1),en([s.EW],ea.prototype,"_getShapeMaskCache",1),en([s.EW],ea.prototype,"_getShapeMaskedPageBoundsCache",1),en([s.EW],ea.prototype,"getNotVisibleShapes",1),en([s.EW],ea.prototype,"getCulledShapes",1),en([s.EW],ea.prototype,"getCurrentPageBounds",1),en([s.EW],ea.prototype,"getHitTestMargin",1),en([s.EW],ea.prototype,"getCurrentPageShapes",1),en([s.EW],ea.prototype,"getCurrentPageShapesSorted",1),en([s.EW],ea.prototype,"getCurrentPageRenderingShapesSorted",1),en([s.EW],ea.prototype,"_getBindingsIndexCache",1),en([s.EW],ea.prototype,"_getSelectionSharedStyles",1),en([(0,s.EW)({isEqual:(e,t)=>e.equals(t)})],ea.prototype,"getSharedStyles",1),en([s.EW],ea.prototype,"getSharedOpacity",1),en([s.EW],ea.prototype,"getIsFocused",1),en([s.EW],ea.prototype,"getIsReadonly",1),en([a.oI],ea.prototype,"_setShiftKeyTimeout",1),en([a.oI],ea.prototype,"_setAltKeyTimeout",1),en([a.oI],ea.prototype,"_setCtrlKeyTimeout",1),en([a.oI],ea.prototype,"_setMetaKeyTimeout",1)}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[90,356,552,658,683,782,827,976,1004,1097,1337,1541,1651,1960,2053,2138,2453,2504,2614,2639,2835,2837,3379,3432,3507,3851,3933,3943,3955,4016,4037,4387,4515,4524,4896,5221,5843,5907,6202,6252,6450,6456,6541,6709,6819,6831,6849,6919,6988,7067,7483,7769,7812,7851,8167,8197,8278,8429,8499,8548,8658,8743,8933,9044,9156,9183,9742,9747,9787,9822,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[90,356,552,658,683,782,827,976,1004,1097,1337,1541,1651,1960,2053,2138,2453,2504,2614,2639,2835,2837,3379,3432,3507,3851,3933,3943,3955,4016,4037,4387,4515,4524,4896,5221,5843,5907,6202,6252,6450,6456,6541,6709,6819,6831,6849,6919,6988,7067,7483,7769,7812,7851,8167,8197,8278,8429,8499,8548,8658,8743,8933,9044,9156,9183,9742,9747,9787,9822,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[90,356,552,658,683,782,827,976,1004,1097,1337,1541,1651,1960,2053,2138,2453,2504,2614,2639,2835,2837,3379,3432,3507,3851,3933,3943,3955,4016,4037,4387,4515,4524,4896,5221,5843,5907,6202,6252,6450,6456,6541,6709,6819,6831,6849,6919,6988,7067,7483,7769,7812,7851,8167,8197,8278,8429,8499,8548,8658,8743,8933,9044,9156,9183,9742,9747,9787,9822,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[90,356,552,658,683,782,827,976,1004,1097,1337,1541,1651,1960,2053,2138,2453,2504,2614,2639,2835,2837,3379,3432,3507,3851,3933,3943,3955,4016,4037,4387,4515,4524,4896,5221,5843,5907,6202,6252,6450,6456,6541,6709,6819,6831,6849,6919,6988,7067,7483,7769,7812,7851,8167,8197,8278,8429,8499,8548,8658,8743,8933,9044,9156,9183,9742,9747,9787,9822,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (()=>{"use strict";var e,t,a,r,c,d,f,o,n,b={},i={};function l(e){var t=i[e];if(void 0!==t)return t.exports;var a=i[e]={id:e,loaded:!1,exports:{}},r=!0;try{b[e].call(a.exports,a,a.exports,l),r=!1}finally{r&&delete i[e]}return a.loaded=!0,a.exports}l.m=b,e=[],l.O=(t,a,r,c)=>{if(a){c=c||0;for(var d=e.length;d>0&&e[d-1][2]>c;d--)e[d]=e[d-1];e[d]=[a,r,c];return}for(var f=1/0,d=0;d<e.length;d++){for(var[a,r,c]=e[d],o=!0,n=0;n<a.length;n++)(!1&c||f>=c)&&Object.keys(l.O).every(e=>l.O[e](a[n]))?a.splice(n--,1):(o=!1,c<f&&(f=c));if(o){e.splice(d--,1);var b=r();void 0!==b&&(t=b)}}return t},l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},a=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,l.t=function(e,r){if(1&r&&(e=this(e)),8&r||"object"==typeof e&&e&&(4&r&&e.__esModule||16&r&&"function"==typeof e.then))return e;var c=Object.create(null);l.r(c);var d={};t=t||[null,a({}),a([]),a(a)];for(var f=2&r&&e;"object"==typeof f&&!~t.indexOf(f);f=a(f))Object.getOwnPropertyNames(f).forEach(t=>d[t]=()=>e[t]);return d.default=()=>e,l.d(c,d),c},l.d=(e,t)=>{for(var a in t)l.o(t,a)&&!l.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},l.f={},l.e=e=>Promise.all(Object.keys(l.f).reduce((t,a)=>(l.f[a](e,t),t),[])),l.u=e=>"static/chunks/"+(({277:"54a60aa6",988:"993e5495",1048:"db9d41be",3051:"e3e7ddb2",3888:"e868780c",5004:"70e0d97a",8133:"1ba63609",8747:"90542734",8924:"da12927c",9425:"bf2ff291"})[e]||e)+"."+({103:"23142a67b02246a8",268:"72794ee2773c2060",277:"0e43cde7298ebcb7",333:"bf0651c789b2eb33",370:"8e8f3cf8eb0e29dd",398:"ffa02af9062a3950",869:"7152372b662e31af",918:"6a9bbe564e4a2d0f",934:"9006461bd0548660",973:"88e865b52eff479a",988:"8797001fcfcf2889",1032:"12b382a9096ab2a4",1048:"e72ce090a86a3691",1063:"775c442bdbeef08b",1327:"09252bb80616cc3a",1708:"d029f8776e4578de",1781:"866132cea8e77cd0",2081:"47b6e9391094055f",2181:"ba21239d3ac39f81",2258:"4defa30121ef44a5",2325:"23caf22075e51aa5",2356:"523277bb8c6bf72a",2418:"b5d9e177e10a686e",2480:"cf27ca02e5b19761",2539:"c5a4f2fd8e421c70",2619:"9431a3f48da8eef4",2695:"6f49435bae1e6f33",2703:"495a65ed14b2f094",2821:"934bcf60fbdc28c6",3051:"a35db430b3564999",3251:"0dce7a0a0ff67235",3266:"a491c09b3f6b57e6",3308:"857c554428b3294e",3336:"a76f9485fe7cb762",3716:"72bf4c9d7325debd",3888:"1584512c612787d7",3995:"eca0f5bef1fc3ae5",4004:"74b9bcf5478b1663",4202:"8440832386f023c7",4238:"6f102dcbcf2ae339",4405:"7a19458960a1058e",4424:"fd0c93a807a333e1",4866:"d1060b4faf2ae1e2",4970:"8a63b4953b0e4946",5004:"337966195abe6fe0",5020:"9ac8d0dc8390bb6e",5137:"f163e94c74a94d01",5242:"7b643c6b3394cac1",5315:"dba7515ae6e139ae",5361:"afc00ab2626bacbf",5521:"cfdf2cfc6db31407",5526:"ff46471041fdcb79",5681:"dd0e66b0de16e54b",6121:"eb9023b1cbc78ee2",6161:"4836cd7d031026bf",6195:"1153369f5f8b13a2",6294:"24f510c0c3e3714c",6654:"16f727522ec47f5a",6794:"f746d8fbbf248ecf",7256:"e07cf52d87d40252",7268:"7bf6d531e3905a52",7331:"2add3c4e125a2dba",7543:"89f7b805ed0f2901",7999:"879d5a20e8641752",8133:"b2ae90f43319a29e",8200:"a36b9f8c983c6b9e",8747:"ae439f2382f58c51",8863:"fa0320ea586efb3b",8885:"cf60cac98bf8b70c",8901:"e117d206a917bda0",8924:"476aa688a637649c",9425:"3a109dffc1fe84af",9522:"c7c6e9c330f9ba6b",9614:"3221013d7f0af27f",9698:"4d09a99b9d99f3e5",9705:"40a82b97f214e28b",9764:"2669775c6e107a01",9793:"4567af813117ad25",9974:"9a0f79beca65e8c4"})[e]+".js",l.miniCssF=e=>"static/css/"+({1838:"659eccb5db697b76",6009:"80c818c5781fbadc"})[e]+".css",l.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r={},l.l=(e,t,a,c)=>{if(r[e])return void r[e].push(t);if(void 0!==a)for(var d,f,o=document.getElementsByTagName("script"),n=0;n<o.length;n++){var b=o[n];if(b.getAttribute("src")==e||b.getAttribute("data-webpack")=="_N_E:"+a){d=b;break}}d||(f=!0,(d=document.createElement("script")).charset="utf-8",d.timeout=120,l.nc&&d.setAttribute("nonce",l.nc),d.setAttribute("data-webpack","_N_E:"+a),d.src=l.tu(e)),r[e]=[t];var i=(t,a)=>{d.onerror=d.onload=null,clearTimeout(u);var c=r[e];if(delete r[e],d.parentNode&&d.parentNode.removeChild(d),c&&c.forEach(e=>e(a)),t)return t(a)},u=setTimeout(i.bind(null,void 0,{type:"timeout",target:d}),12e4);d.onerror=i.bind(null,d.onerror),d.onload=i.bind(null,d.onload),f&&document.head.appendChild(d)},l.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),l.tt=()=>(void 0===c&&(c={createScriptURL:e=>e},"u">typeof trustedTypes&&trustedTypes.createPolicy&&(c=trustedTypes.createPolicy("nextjs#bundler",c))),c),l.tu=e=>l.tt().createScriptURL(e),l.p="/_next/",d={8068:0},l.f.miniCss=(e,t)=>{if(d[e])t.push(d[e]);else 0!==d[e]&&({1838:1,6009:1})[e]&&t.push(d[e]=new Promise((t,a)=>{var r=l.miniCssF(e),c=l.p+r;if(((e,t)=>{for(var a=document.getElementsByTagName("link"),r=0;r<a.length;r++){var c=a[r],d=c.getAttribute("data-href")||c.getAttribute("href");if("stylesheet"===c.rel&&(d===e||d===t))return c}for(var f=document.getElementsByTagName("style"),r=0;r<f.length;r++){var c=f[r],d=c.getAttribute("data-href");if(d===e||d===t)return c}})(r,c))return t();((e,t,a,r)=>{var c=document.createElement("link");c.rel="stylesheet",c.type="text/css",c.onerror=c.onload=d=>{if(c.onerror=c.onload=null,"load"===d.type)a();else{var f=d&&("load"===d.type?"missing":d.type),o=d&&d.target&&d.target.href||t,n=Error("Loading CSS chunk "+e+" failed.\n("+o+")");n.code="CSS_CHUNK_LOAD_FAILED",n.type=f,n.request=o,c.parentNode.removeChild(c),r(n)}},c.href=t;if("function"==typeof _N_E_STYLE_LOAD){var d=c.href,f=c.onload,o=c.onerror;_N_E_STYLE_LOAD(0===d.indexOf(window.location.origin)?new URL(d).pathname:d).then(function(){f&&f.call(c,{type:"load"})},function(){o&&o.call(c,{})})}else document.head.appendChild(c)})(e,c,t,a)}).then(()=>{d[e]=0},t=>{throw delete d[e],t}))},f={8068:0,7389:0,7513:0,3578:0},l.f.j=(e,t)=>{var a=l.o(f,e)?f[e]:void 0;if(0!==a)if(a)t.push(a[2]);else if(/^((183|357|806)8|6009|7389|7513)$/.test(e))f[e]=0;else{var r=new Promise((t,r)=>a=f[e]=[t,r]);t.push(a[2]=r);var c=l.p+l.u(e),d=Error();l.l(c,t=>{if(l.o(f,e)&&(0!==(a=f[e])&&(f[e]=void 0),a)){var r=t&&("load"===t.type?"missing":t.type),c=t&&t.target&&t.target.src;d.message="Loading chunk "+e+" failed.\n("+r+": "+c+")",d.name="ChunkLoadError",d.type=r,d.request=c,a[1](d)}},"chunk-"+e,e)}},l.O.j=e=>0===f[e],o=(e,t)=>{var a,r,[c,d,o]=t,n=0;if(c.some(e=>0!==f[e])){for(a in d)l.o(d,a)&&(l.m[a]=d[a]);if(o)var b=o(l)}for(e&&e(t);n<c.length;n++)r=c[n],l.o(f,r)&&f[r]&&f[r][0](),f[r]=0;return l.O(b)},(n=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(o.bind(null,0)),n.push=o.bind(null,n.push.bind(n)),l.nc=void 0})();
@@ -1,4 +0,0 @@
1
- .tl-container{font-size:12px;--tl-space-1:2px;--tl-space-2:4px;--tl-space-3:8px;--tl-space-4:12px;--tl-space-5:16px;--tl-space-6:20px;--tl-space-7:28px;--tl-space-8:32px;--tl-space-9:64px;--tl-space-10:72px;--tl-radius-0:2px;--tl-radius-1:4px;--tl-radius-2:6px;--tl-radius-3:9px;--tl-radius-4:11px;--tl-layer-canvas-hidden:-999999;--tl-layer-canvas-background:100;--tl-layer-canvas-grid:150;--tl-layer-collaborators:245;--tl-layer-watermark:248;--tl-layer-canvas-in-front:250;--tl-layer-canvas-shapes:300;--tl-layer-canvas-overlays:500;--tl-layer-canvas-blocker:10000;--tl-layer-overlays-collaborator-scribble:10;--tl-layer-overlays-collaborator-brush:20;--tl-layer-overlays-collaborator-shape-indicator:30;--tl-layer-overlays-user-scribble:40;--tl-layer-overlays-user-brush:50;--tl-layer-overlays-user-snapline:90;--tl-layer-overlays-selection-fg:100;--tl-layer-overlays-user-handles:105;--tl-layer-overlays-user-indicator-hint:110;--tl-layer-overlays-collaborator-cursor-hint:120;--tl-layer-overlays-collaborator-cursor:130;--tl-layer-text-container:1;--tl-layer-text-content:3;--tl-layer-text-editor:4;--tl-layer-error-overlay:1;--tl-layer-error-canvas:2;--tl-layer-error-canvas-after:3;--tl-layer-error-content:4;--tl-zoom:1;--tl-tab-size:2;--tl-cursor-none:none;--tl-cursor-default:url("data:image/svg+xml,<svg height='32' width='32' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg' style='color: black;'><defs><filter id='shadow' y='-40%' x='-40%' width='180px' height='180%' color-interpolation-filters='sRGB'><feDropShadow dx='1' dy='1' stdDeviation='1.2' flood-opacity='.5'/></filter></defs><g fill='none' transform='rotate(0 16 16)' filter='url(%23shadow)'><path d='m12 24.4219v-16.015l11.591 11.619h-6.781l-.411.124z' fill='white'/><path d='m21.0845 25.0962-3.605 1.535-4.682-11.089 3.686-1.553z' fill='white'/><path d='m19.751 24.4155-1.844.774-3.1-7.374 1.841-.775z' fill='black'/><path d='m13 10.814v11.188l2.969-2.866.428-.139h4.768z' fill='black'/></g></svg>") 12 8,default;--tl-cursor-pointer:url("data:image/svg+xml,<svg height='32' width='32' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg' style='color: black;'><defs><filter id='shadow' y='-40%' x='-40%' width='180px' height='180%' color-interpolation-filters='sRGB'><feDropShadow dx='1' dy='1' stdDeviation='1.2' flood-opacity='.5'/></filter></defs><g fill='none' transform='rotate(0 16 16)' filter='url(%23shadow)'><path d='m13.3315 21.3799c-.284-.359-.629-1.093-1.243-1.984-.348-.504-1.211-1.453-1.468-1.935-.223-.426-.199-.617-.146-.97.094-.628.738-1.117 1.425-1.051.519.049.959.392 1.355.716.239.195.533.574.71.788.163.196.203.277.377.509.23.307.302.459.214.121-.071-.496-.187-1.343-.355-2.092-.128-.568-.159-.657-.281-1.093-.129-.464-.195-.789-.316-1.281-.084-.348-.235-1.059-.276-1.459-.057-.547-.087-1.439.264-1.849.275-.321.906-.418 1.297-.22.512.259.803 1.003.936 1.3.239.534.387 1.151.516 1.961.164 1.031.466 2.462.476 2.763.024-.369-.068-1.146-.004-1.5.058-.321.328-.694.666-.795.286-.085.621-.116.916-.055.313.064.643.288.766.499.362.624.369 1.899.384 1.831.086-.376.071-1.229.284-1.584.14-.234.497-.445.687-.479.294-.052.655-.068.964-.008.249.049.586.345.677.487.218.344.342 1.317.379 1.658.015.141.074-.392.293-.736.406-.639 1.843-.763 1.898.639.025.654.02.624.02 1.064 0 .517-.012.828-.04 1.202-.031.4-.117 1.304-.242 1.742-.086.301-.371.978-.652 1.384 0 0-1.074 1.25-1.191 1.813-.118.562-.079.566-.102.965-.023.398.121.922.121.922s-.802.104-1.234.035c-.391-.063-.875-.841-1-1.079-.172-.328-.539-.265-.682-.023-.225.383-.709 1.07-1.051 1.113-.668.084-2.054.031-3.139.02 0 0 .185-1.011-.227-1.358-.305-.259-.83-.784-1.144-1.06z' fill='white'/><g stroke='black' stroke-linecap='round' stroke-width='.75'><path d='m13.3315 21.3799c-.284-.359-.629-1.093-1.243-1.984-.348-.504-1.211-1.453-1.468-1.935-.223-.426-.199-.617-.146-.97.094-.628.738-1.117 1.425-1.051.519.049.959.392 1.355.716.239.195.533.574.71.788.163.196.203.277.377.509.23.307.302.459.214.121-.071-.496-.187-1.343-.355-2.092-.128-.568-.159-.657-.281-1.093-.129-.464-.195-.789-.316-1.281-.084-.348-.235-1.059-.276-1.459-.057-.547-.087-1.439.264-1.849.275-.321.906-.418 1.297-.22.512.259.803 1.003.936 1.3.239.534.387 1.151.516 1.961.164 1.031.466 2.462.476 2.763.024-.369-.068-1.146-.004-1.5.058-.321.328-.694.666-.795.286-.085.621-.116.916-.055.313.064.643.288.766.499.362.624.369 1.899.384 1.831.086-.376.071-1.229.284-1.584.14-.234.497-.445.687-.479.294-.052.655-.068.964-.008.249.049.586.345.677.487.218.344.342 1.317.379 1.658.015.141.074-.392.293-.736.406-.639 1.843-.763 1.898.639.025.654.02.624.02 1.064 0 .517-.012.828-.04 1.202-.031.4-.117 1.304-.242 1.742-.086.301-.371.978-.652 1.384 0 0-1.074 1.25-1.191 1.813-.118.562-.079.566-.102.965-.023.398.121.922.121.922s-.802.104-1.234.035c-.391-.063-.875-.841-1-1.079-.172-.328-.539-.265-.682-.023-.225.383-.709 1.07-1.051 1.113-.668.084-2.054.031-3.139.02 0 0 .185-1.011-.227-1.358-.305-.259-.83-.784-1.144-1.06z' stroke-linejoin='round'/><path d='m21.5664 21.7344v-3.459'/><path d='m19.5508 21.7461-.016-3.473'/><path d='m17.5547 18.3047.021 3.426'/></g></g></svg>") 14 10,pointer;--tl-cursor-cross:url("data:image/svg+xml,<svg height='32' width='32' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg' style='color: black;'><defs><filter id='shadow' y='-40%' x='-40%' width='180px' height='180%' color-interpolation-filters='sRGB'><feDropShadow dx='1' dy='1' stdDeviation='1.2' flood-opacity='.5'/></filter></defs><g fill='none' transform='rotate(0 16 16)' filter='url(%23shadow)'><path d='m25 16h-6.01v-6h-2.98v6h-6.01v3h6.01v6h2.98v-6h6.01z' fill='white'/><path d='m23.9902 17.0103h-6v-6.01h-.98v6.01h-6v.98h6v6.01h.98v-6.01h6z' fill='%23231f1f'/></g></svg>") 16 16,crosshair;--tl-cursor-comment:url("data:image/svg+xml,<svg height='32' width='32' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'><defs><filter id='shadow' y='-40%' x='-40%' width='180px' height='180%' color-interpolation-filters='sRGB'><feDropShadow dx='1' dy='1' stdDeviation='1.2' flood-opacity='.5'/></filter></defs><g filter='url(%23shadow)'><path d='M5 19.5 L5 11 A8 8 0 0 1 13 3 A8 8 0 0 1 21 11 A8 8 0 0 1 13 19 Z' fill='white' stroke='black' stroke-width='1' stroke-linejoin='round'/></g></svg>") 5 19,crosshair;--tl-cursor-move:url("data:image/svg+xml,<svg height='32' width='32' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg' style='color: black;'><defs><filter id='shadow' y='-40%' x='-40%' width='180px' height='180%' color-interpolation-filters='sRGB'><feDropShadow dx='1' dy='1' stdDeviation='1.2' flood-opacity='.5'/></filter></defs><g fill='none' transform='rotate(0 16 16)' filter='url(%23shadow)'><path d='m19 14h1v1h-1zm1 6h-1v-1h1zm-5-5h-1v-1h1zm0 5h-1v-1h1zm2-10.987-7.985 7.988 5.222 5.221 2.763 2.763 7.984-7.985z' fill='white'/><g fill='black'><path d='m23.5664 16.9971-2.557-2.809v1.829h-4.009-4.001v-1.829l-2.571 2.809 2.572 2.808-.001-1.808h4.001 4.009l-.001 1.808z'/><path d='m17.9873 17h.013v-4.001l1.807.001-2.807-2.571-2.809 2.57h1.809v4.001h.008v4.002l-1.828-.001 2.807 2.577 2.805-2.576h-1.805z'/></g></g></svg>") 16 16,move;--tl-cursor-grab:url("data:image/svg+xml,<svg height='32' width='32' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg' style='color: black;'><defs><filter id='shadow' y='-40%' x='-40%' width='180px' height='180%' color-interpolation-filters='sRGB'><feDropShadow dx='1' dy='1' stdDeviation='1.2' flood-opacity='.5'/></filter></defs><g fill='none' transform='rotate(0 16 16)' filter='url(%23shadow)'><path d='m13.5557 17.5742c-.098-.375-.196-.847-.406-1.552-.167-.557-.342-.859-.47-1.233-.155-.455-.303-.721-.496-1.181-.139-.329-.364-1.048-.457-1.44-.119-.509.033-.924.244-1.206.253-.339.962-.49 1.357-.351.371.13.744.512.916.788.288.46.357.632.717 1.542.393.992.564 1.918.611 2.231l.085.452c-.001-.04-.043-1.122-.044-1.162-.035-1.029-.06-1.823-.038-2.939.002-.126.064-.587.084-.715.078-.5.305-.8.673-.979.412-.201.926-.215 1.401-.017.423.173.626.55.687 1.022.014.109.094.987.093 1.107-.013 1.025.006 1.641.015 2.174.004.231.003 1.625.017 1.469.061-.656.094-3.189.344-3.942.144-.433.405-.746.794-.929.431-.203 1.113-.07 1.404.243.285.305.446.692.482 1.153.032.405-.019.897-.02 1.245 0 .867-.021 1.324-.037 2.121-.001.038-.015.298.023.182.094-.28.188-.542.266-.745.049-.125.241-.614.359-.859.114-.234.211-.369.415-.688.2-.313.415-.448.668-.561.54-.235 1.109.112 1.301.591.086.215.009.713-.028 1.105-.061.647-.254 1.306-.352 1.648-.128.447-.274 1.235-.34 1.601-.072.394-.234 1.382-.359 1.82-.086.301-.371.978-.652 1.384 0 0-1.074 1.25-1.192 1.812-.117.563-.078.567-.101.965-.024.399.121.923.121.923s-.802.104-1.234.034c-.391-.062-.875-.841-1-1.078-.172-.328-.539-.265-.682-.023-.225.383-.709 1.07-1.051 1.113-.668.084-2.054.03-3.139.02 0 0 .185-1.011-.227-1.358-.305-.26-.83-.784-1.144-1.06l-.832-.921c-.284-.36-.629-1.093-1.243-1.985-.348-.504-1.027-1.085-1.284-1.579-.223-.425-.331-.954-.19-1.325.225-.594.675-.897 1.362-.832.519.05.848.206 1.238.537.225.19.573.534.75.748.163.195.203.276.377.509.23.307.302.459.214.121' fill='white'/><g stroke='black' stroke-linecap='round' stroke-width='.75'><path d='m13.5557 17.5742c-.098-.375-.196-.847-.406-1.552-.167-.557-.342-.859-.47-1.233-.155-.455-.303-.721-.496-1.181-.139-.329-.364-1.048-.457-1.44-.119-.509.033-.924.244-1.206.253-.339.962-.49 1.357-.351.371.13.744.512.916.788.288.46.357.632.717 1.542.393.992.564 1.918.611 2.231l.085.452c-.001-.04-.043-1.122-.044-1.162-.035-1.029-.06-1.823-.038-2.939.002-.126.064-.587.084-.715.078-.5.305-.8.673-.979.412-.201.926-.215 1.401-.017.423.173.626.55.687 1.022.014.109.094.987.093 1.107-.013 1.025.006 1.641.015 2.174.004.231.003 1.625.017 1.469.061-.656.094-3.189.344-3.942.144-.433.405-.746.794-.929.431-.203 1.113-.07 1.404.243.285.305.446.692.482 1.153.032.405-.019.897-.02 1.245 0 .867-.021 1.324-.037 2.121-.001.038-.015.298.023.182.094-.28.188-.542.266-.745.049-.125.241-.614.359-.859.114-.234.211-.369.415-.688.2-.313.415-.448.668-.561.54-.235 1.109.112 1.301.591.086.215.009.713-.028 1.105-.061.647-.254 1.306-.352 1.648-.128.447-.274 1.235-.34 1.601-.072.394-.234 1.382-.359 1.82-.086.301-.371.978-.652 1.384 0 0-1.074 1.25-1.192 1.812-.117.563-.078.567-.101.965-.024.399.121.923.121.923s-.802.104-1.234.034c-.391-.062-.875-.841-1-1.078-.172-.328-.539-.265-.682-.023-.225.383-.709 1.07-1.051 1.113-.668.084-2.054.03-3.139.02 0 0 .185-1.011-.227-1.358-.305-.26-.83-.784-1.144-1.06l-.832-.921c-.284-.36-.629-1.093-1.243-1.985-.348-.504-1.027-1.085-1.284-1.579-.223-.425-.331-.954-.19-1.325.225-.594.675-.897 1.362-.832.519.05.848.206 1.238.537.225.19.573.534.75.748.163.195.203.276.377.509.23.307.302.459.214.121' stroke-linejoin='round'/><path d='m20.5664 21.7344v-3.459'/><path d='m18.5508 21.7461-.016-3.473'/><path d='m16.5547 18.3047.021 3.426'/></g></g></svg>") 16 16,grab;--tl-cursor-grabbing:url("data:image/svg+xml,<svg height='32' width='32' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg' style='color: black;'><defs><filter id='shadow' y='-40%' x='-40%' width='180px' height='180%' color-interpolation-filters='sRGB'><feDropShadow dx='1' dy='1' stdDeviation='1.2' flood-opacity='.5'/></filter></defs><g fill='none' transform='rotate(0 16 16)' filter='url(%23shadow)'><path d='m13.5732 12.0361c.48-.178 1.427-.069 1.677.473.213.462.396 1.241.406 1.075.024-.369-.024-1.167.137-1.584.117-.304.347-.59.686-.691.285-.086.62-.116.916-.055.313.064.642.287.765.499.362.623.368 1.899.385 1.831.064-.272.07-1.229.283-1.584.141-.235.497-.445.687-.479.294-.052.656-.068.964-.008.249.049.586.344.677.487.219.344.342 1.316.379 1.658.016.141.074-.393.293-.736.406-.639 1.844-.763 1.898.639.026.654.02.624.02 1.064 0 .516-.012.828-.04 1.202-.03.399-.116 1.304-.241 1.742-.086.301-.371.978-.653 1.384 0 0-1.074 1.25-1.191 1.812-.117.563-.078.567-.102.965-.023.399.121.923.121.923s-.801.104-1.234.034c-.391-.062-.875-.84-1-1.078-.172-.328-.539-.265-.682-.023-.224.383-.709 1.07-1.05 1.113-.669.084-2.055.03-3.14.02 0 0 .185-1.011-.227-1.358-.305-.26-.83-.784-1.144-1.06l-.832-.921c-.283-.36-1.002-.929-1.243-1.985-.213-.936-.192-1.395.037-1.77.232-.381.67-.589.854-.625.208-.042.692-.039.875.062.223.123.313.159.488.391.23.307.312.456.213.121-.076-.262-.322-.595-.434-.97-.109-.361-.401-.943-.38-1.526.008-.221.103-.771.832-1.042' fill='white'/><g stroke='black' stroke-width='.75'><path d='m13.5732 12.0361c.48-.178 1.427-.069 1.677.473.213.462.396 1.241.406 1.075.024-.369-.024-1.167.137-1.584.117-.304.347-.59.686-.691.285-.086.62-.116.916-.055.313.064.642.287.765.499.362.623.368 1.899.385 1.831.064-.272.07-1.229.283-1.584.141-.235.497-.445.687-.479.294-.052.656-.068.964-.008.249.049.586.344.677.487.219.344.342 1.316.379 1.658.016.141.074-.393.293-.736.406-.639 1.844-.763 1.898.639.026.654.02.624.02 1.064 0 .516-.012.828-.04 1.202-.03.399-.116 1.304-.241 1.742-.086.301-.371.978-.653 1.384 0 0-1.074 1.25-1.191 1.812-.117.563-.078.567-.102.965-.023.399.121.923.121.923s-.801.104-1.234.034c-.391-.062-.875-.84-1-1.078-.172-.328-.539-.265-.682-.023-.224.383-.709 1.07-1.05 1.113-.669.084-2.055.03-3.14.02 0 0 .185-1.011-.227-1.358-.305-.26-.83-.784-1.144-1.06l-.832-.921c-.283-.36-1.002-.929-1.243-1.985-.213-.936-.192-1.395.037-1.77.232-.381.67-.589.854-.625.208-.042.692-.039.875.062.223.123.313.159.488.391.23.307.312.456.213.121-.076-.262-.322-.595-.434-.97-.109-.361-.401-.943-.38-1.526.008-.221.103-.771.832-1.042z' stroke-linejoin='round'/><path d='m20.5664 19.7344v-3.459' stroke-linecap='round'/><path d='m18.5508 19.7461-.016-3.473' stroke-linecap='round'/><path d='m16.5547 16.3047.021 3.426' stroke-linecap='round'/></g></g></svg>") 16 16,grabbing;--tl-cursor-text:url("data:image/svg+xml,<svg height='32' width='32' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg' style='color: black;'><defs><filter id='shadow' y='-40%' x='-40%' width='180px' height='180%' color-interpolation-filters='sRGB'><feDropShadow dx='1' dy='1' stdDeviation='1.2' flood-opacity='.5'/></filter></defs><g fill='none' transform='rotate(0 16 16)' filter='url(%23shadow)'><path fill='white' d='M7.94 0a5.25 5.25 0 0 0-3.47 1.17A5.27 5.27 0 0 0 1 0H0v3h1c1.41 0 1.85.7 2 1v3.94H2v3h1v3c-.13.3-.57 1-2 1H0v3h1a5.27 5.27 0 0 0 3.47-1.17c.98.8 2.21 1.21 3.47 1.17h1v-3h-1c-1.41 0-1.85-.7-2-1v-3H7v-3H6V4c.13-.3.57-1 2-1h1V0H7.94z'/><path fill='black' d='M7.94 2V1a4 4 0 0 0-3.47 1.64A4 4 0 0 0 1 1v1c1.3-.17 2.56.6 3 1.84v5.1H3v1h1v4.16c-.45 1.24-1.7 2-3 1.84v1a4.05 4.05 0 0 0 3.47-1.63 4.05 4.05 0 0 0 3.47 1.63v-1A2.82 2.82 0 0 1 5 14.1V9.93h1v-1H5V3.85A2.81 2.81 0 0 1 7.94 2z'/></g></svg>") 4 10,text;--tl-cursor-zoom-in:url("data:image/svg+xml,<svg height='32' width='32' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg' style='color: black;'><defs><filter id='shadow' y='-40%' x='-40%' width='180px' height='180%' color-interpolation-filters='sRGB'><feDropShadow dx='1' dy='1' stdDeviation='1.2' flood-opacity='.5'/></filter></defs><g fill='none' transform='rotate(0 16 16)' filter='url(%23shadow)'><path d='m20.5 15c0 3.038-2.462 5.5-5.5 5.5s-5.5-2.462-5.5-5.5 2.462-5.5 5.5-5.5 5.5 2.462 5.5 5.5' fill='white'/><path d='m20.5 15c0 3.038-2.462 5.5-5.5 5.5s-5.5-2.462-5.5-5.5 2.462-5.5 5.5-5.5 5.5 2.462 5.5 5.5z' stroke='black'/><g fill='black'><path d='m18 14h-2v-2h-2v2h-2v1.98h2v2.02h2v-2.02h2z'/><path d='m23.5859 25 1.414-1.414-5.449-5.449-1.414 1.414z'/></g></g></svg>") 16 16,zoom-in;--tl-cursor-zoom-out:url("data:image/svg+xml,<svg height='32' width='32' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg' style='color: black;'><defs><filter id='shadow' y='-40%' x='-40%' width='180px' height='180%' color-interpolation-filters='sRGB'><feDropShadow dx='1' dy='1' stdDeviation='1.2' flood-opacity='.5'/></filter></defs><g fill='none' transform='rotate(0 16 16)' filter='url(%23shadow)'><path d='m20.5 15c0 3.038-2.462 5.5-5.5 5.5s-5.5-2.462-5.5-5.5 2.462-5.5 5.5-5.5 5.5 2.462 5.5 5.5' fill='white'/><path d='m20.5 15c0 3.038-2.462 5.5-5.5 5.5s-5.5-2.462-5.5-5.5 2.462-5.5 5.5-5.5 5.5 2.462 5.5 5.5z' stroke='black'/><g fill='black'><path d='m18 16h-5.98v-1.98h5.98z'/><path d='m23.5859 25 1.414-1.414-5.449-5.449-1.414 1.414z'/></g></g></svg>") 16 16,zoom-out;--tl-cursor:var(--tl-cursor-default);--tl-cursor-resize-edge:ew-resize;--tl-cursor-resize-corner:nesw-resize;--tl-cursor-ew-resize:ew-resize;--tl-cursor-ns-resize:ns-resize;--tl-cursor-nesw-resize:nesw-resize;--tl-cursor-nwse-resize:nwse-resize;--tl-cursor-rotate:pointer;--tl-cursor-nwse-rotate:pointer;--tl-cursor-nesw-rotate:pointer;--tl-cursor-senw-rotate:pointer;--tl-cursor-swne-rotate:pointer;--tl-scale:calc(1 / var(--tl-zoom));--tl-font-draw:"tldraw_draw",sans-serif;--tl-font-sans:"tldraw_sans",sans-serif;--tl-font-serif:"tldraw_serif",serif;--tl-font-mono:"tldraw_mono",monospace;--tl-text-outline-a:calc(min(0.5, 1 / var(--tl-zoom)) * 2px);--tl-text-outline-b:calc(min(0.5, 1 / var(--tl-zoom)) * -2px);--tl-text-outline-reference:0 var(--tl-text-outline-b) 0 var(--tl-color-background),0 var(--tl-text-outline-a) 0 var(--tl-color-background),var(--tl-text-outline-b) var(--tl-text-outline-b) 0 var(--tl-color-background),var(--tl-text-outline-a) var(--tl-text-outline-b) 0 var(--tl-color-background),var(--tl-text-outline-a) var(--tl-text-outline-a) 0 var(--tl-color-background),var(--tl-text-outline-b) var(--tl-text-outline-a) 0 var(--tl-color-background);--tl-text-outline:var(--tl-text-outline-reference);position:relative;inset:0;height:100%;width:100%;overflow:clip;color:var(--tl-color-text)}.tl-theme__light{--tl-color-selection-fill:hsl(210,100%,56%,24%);--tl-color-selection-stroke:hsl(214,84%,56%);--tl-color-background:hsl(210,20%,98%);--tl-color-grid:hsl(0,0%,43%);--tl-color-low:hsl(204,16%,94%);--tl-color-low-border:hsl(204,16%,92%);--tl-color-muted-none:hsl(0,0%,0%,0%);--tl-color-muted-0:hsl(0,0%,0%,2%);--tl-color-muted-1:hsl(0,0%,0%,10%);--tl-color-muted-2:hsl(0,0%,0%,4.3%);--tl-color-hint:hsl(0,0%,0%,5.5%);--tl-color-overlay:hsl(0,0%,0%,20%);--tl-color-divider:hsl(0,0%,91%);--tl-color-panel:hsl(0,0%,99%);--tl-color-panel-contrast:hsl(0,0%,100%);--tl-color-panel-overlay:hsl(0,0%,100%,82%);--tl-color-panel-transparent:hsla(0,0%,99%,0%);--tl-color-selected:hsl(214,84%,56%);--tl-color-selected-contrast:hsl(0,0%,100%);--tl-color-focus:hsl(219,65%,50%);--tl-color-tooltip:hsla(200,14%,4%,1);--tl-color-text:hsl(0,0%,0%);--tl-color-text-0:hsl(0,0%,11%);--tl-color-text-1:hsl(0,0%,18%);--tl-color-text-3:hsl(204,4%,45%);--tl-color-text-disabled:hsl(204,4%,55%);--tl-color-text-shadow:hsl(0,0%,100%);--tl-color-text-highlight:hsl(52,100%,50%);--tl-color-text-highlight-p3:color(display-p3 0.972 0.8205 0.05);--tl-color-primary:hsl(214,84%,56%);--tl-color-success:hsl(123,46%,34%);--tl-color-info:hsl(201,98%,41%);--tl-color-warning:hsl(27,98%,47%);--tl-color-danger:hsl(0,90%,43%);--tl-shadow-1:0px 1px 2px hsl(0,0%,0%,25%),0px 1px 3px hsl(0,0%,0%,9%);--tl-shadow-2:0px 0px 2px hsl(0,0%,0%,16%),0px 2px 3px hsl(0,0%,0%,24%),0px 2px 6px hsl(0,0%,0%,0.1),inset 0px 0px 0px 1px var(--tl-color-panel-contrast);--tl-shadow-3:0px 1px 2px hsl(0,0%,0%,28%),0px 2px 6px hsl(0,0%,0%,14%),inset 0px 0px 0px 1px var(--tl-color-panel-contrast);--tl-shadow-4:0px 0px 3px hsl(0,0%,0%,19%),0px 5px 4px hsl(0,0%,0%,16%),0px 2px 16px hsl(0,0%,0%,6%),inset 0px 0px 0px 1px var(--tl-color-panel-contrast)}.tl-theme__dark{--tl-color-selection-fill:hsl(209,100%,57%,20%);--tl-color-selection-stroke:hsl(214,84%,56%);--tl-color-background:hsl(240,5%,6.5%);--tl-color-grid:hsl(0,0%,40%);--tl-color-low:hsl(260,4.5%,10.5%);--tl-color-low-border:hsl(207,10%,10%);--tl-color-muted-none:hsl(0,0%,100%,0%);--tl-color-muted-0:hsl(0,0%,100%,2%);--tl-color-muted-1:hsl(0,0%,100%,10%);--tl-color-muted-2:hsl(0,0%,100%,5%);--tl-color-hint:hsl(0,0%,100%,7%);--tl-color-overlay:hsl(0,0%,0%,50%);--tl-color-divider:hsl(240,9%,22%);--tl-color-panel:hsl(235,6.8%,13.5%);--tl-color-panel-contrast:hsl(245,12%,23%);--tl-color-panel-overlay:hsl(210,10%,24%,82%);--tl-color-panel-transparent:hsla(235,6.8%,13.5%,0%);--tl-color-selected:hsl(217,89%,61%);--tl-color-selected-contrast:hsl(0,0%,100%);--tl-color-focus:hsl(217,76%,80%);--tl-color-tooltip:hsla(0,0%,100%,1);--tl-color-text:hsl(210,17%,98%);--tl-color-text-0:hsl(0,9%,94%);--tl-color-text-1:hsl(0,0%,85%);--tl-color-text-3:hsl(204,4%,75%);--tl-color-text-disabled:hsl(204,4%,50%);--tl-color-text-shadow:hsl(210,13%,18%);--tl-color-text-highlight:hsl(52,100%,41%);--tl-color-text-highlight-p3:color(display-p3 0.8078 0.6225 0.0312);--tl-color-primary:hsl(214,84%,56%);--tl-color-success:hsl(123,38%,57%);--tl-color-info:hsl(199,92%,56%);--tl-color-warning:hsl(36,100%,57%);--tl-color-danger:hsl(0,82%,66%);--tl-shadow-1:0px 1px 2px hsl(0,0%,0%,16.1%),0px 1px 3px hsl(0,0%,0%,22%),inset 0px 0px 0px 1px var(--tl-color-panel-contrast);--tl-shadow-2:0px 1px 3px hsl(0,0%,0%,66.6%),0px 2px 6px hsl(0,0%,0%,33%),inset 0px 0px 0px 1px var(--tl-color-panel-contrast);--tl-shadow-3:0px 1px 3px hsl(0,0%,0%,50%),0px 2px 12px hsl(0,0%,0%,50%),inset 0px 0px 0px 1px var(--tl-color-panel-contrast)}.tl-counter-scaled{transform:scale(var(--tl-scale));transform-origin:top left;width:calc(100% * var(--tl-zoom));height:calc(100% * var(--tl-zoom))}.tl-container,.tl-container *{-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;scrollbar-highlight-color:transparent;-webkit-user-select:none;user-select:none;box-sizing:border-box;outline:none}.tl-container a{-webkit-touch-callout:initial}.tl-container__focused{outline:1px solid var(--tl-color-low)}.tl-portal-host{display:contents}[contenteditable],[contenteditable] *,input{user-select:text}.tl-canvas{position:absolute;inset:0;height:100%;width:100%;color:var(--tl-color-text);cursor:var(--tl-cursor);overflow:clip;content-visibility:auto;touch-action:none;contain:strict}.tl-canvas__in-front{position:absolute;inset:0;pointer-events:none;z-index:var(--tl-layer-canvas-in-front)}.tl-shapes{position:relative;z-index:var(--tl-layer-canvas-shapes)}.tl-svg-context{top:0;left:0;pointer-events:none}.tl-background__wrapper,.tl-svg-context{position:absolute;width:100%;height:100%}.tl-background__wrapper{z-index:var(--tl-layer-canvas-background);inset:0}.tl-background{background-color:var(--tl-color-background);width:100%;height:100%}.tl-grid{position:absolute;inset:0;width:100%;height:100%;touch-action:none;pointer-events:none;z-index:var(--tl-layer-canvas-grid);contain:strict}.tl-grid-dot{fill:var(--tl-color-grid)}.tl-html-layer{top:0;left:0;width:1px;height:1px}.tl-collaborators,.tl-html-layer{position:absolute;contain:layout style size}.tl-collaborators{inset:0;z-index:var(--tl-layer-collaborators);pointer-events:none;overflow:clip}.tl-collaborators__item{position:absolute;top:0;left:0;overflow:visible;pointer-events:none;transform-origin:top left}.tl-cursor{overflow:visible}.tl-selection__bg{position:absolute;top:0;left:0;transform-origin:top left;background-color:transparent;pointer-events:all}.tl-transparent{fill:transparent;stroke:transparent}.tl-hidden{opacity:0;pointer-events:none}.tl-nametag{top:16px;padding:3px 6px;border-radius:var(--tl-radius-2)}.tl-nametag,.tl-nametag-title{left:13px;width:fit-content;height:fit-content;max-width:120px;white-space:nowrap;position:absolute;overflow:hidden;text-overflow:ellipsis;font-size:12px;color:var(--tl-color-selected-contrast)}.tl-nametag-title{top:-2px;padding:0 6px;text-shadow:var(--tl-text-outline)}.tl-nametag-chat{top:16px;left:13px;width:fit-content;height:fit-content;border-radius:var(--tl-radius-2)}.tl-cursor-chat,.tl-nametag-chat{color:var(--tl-color-selected-contrast);white-space:nowrap;position:absolute;padding:3px 6px;font-size:12px;opacity:1}.tl-cursor-chat{pointer-events:none;z-index:var(--tl-layer-cursor);margin-top:16px;margin-left:13px;border:none;user-select:text;border-radius:var(--tl-radius-2)}.tl-cursor-chat .tl-cursor-chat__bubble{padding-right:12px}.tl-cursor-chat::selection{background:var(--tl-color-selected);color:var(--tl-color-selected-contrast);text-shadow:none}.tl-cursor-chat::placeholder{color:var(--tl-color-selected-contrast);opacity:.7}.tl-text-shape-label{position:relative;font-weight:400;min-width:1px;padding:0;margin:0;border:none;width:fit-content;height:fit-content;font-variant:normal;font-style:normal;pointer-events:all;white-space:pre-wrap;overflow-wrap:break-word}.tl-plain-text-wrapper[data-isediting=true] .tl-text-content{opacity:0}.tl-rich-text-wrapper[data-isediting=true] .tl-text-content{display:none}.tl-text{margin:0;padding:0;appearance:auto;background:none;border-image:none;border:0;caret-color:var(--tl-color-text);color:inherit;column-count:auto!important;display:inline-block;font-family:inherit;font-feature-settings:normal;font-kerning:auto;font-optical-sizing:auto;font-size:inherit;font-stretch:100%;font-style:inherit;font-variant:inherit;font-variation-settings:normal;font-weight:inherit;letter-spacing:inherit;line-height:inherit;outline:none;text-align:inherit;text-indent:0;text-rendering:auto;text-shadow:inherit;text-transform:none;line-break:normal;word-spacing:0;writing-mode:horizontal-tb!important}.tl-text,.tl-text-measure{overflow-wrap:break-word;white-space:pre-wrap;word-wrap:break-word}.tl-text-measure{z-index:var(--tl-layer-canvas-hidden);opacity:0;visibility:hidden;position:absolute;top:0;left:0;width:max-content;box-sizing:border-box;pointer-events:none;resize:none;border:none;user-select:none;contain:layout style paint;unicode-bidi:plaintext;-webkit-user-select:none}.tl-text-content,.tl-text-input{position:absolute;inset:0;height:100%;width:100%;min-width:1px;min-height:1px;outline:none}.tl-text-content__wrapper{position:relative;width:fit-content;height:fit-content;display:flex;align-items:center;justify-content:center;pointer-events:none;min-height:auto}.tl-text-content{overflow:visible;pointer-events:none}.tl-text-input{resize:none;user-select:all;-webkit-user-select:text;cursor:var(--tl-cursor-text)}.tl-text-input:not(.tl-rich-text){overflow:hidden}.tl-text-input::selection{background:var(--tl-color-selected);color:var(--tl-color-selected-contrast);text-shadow:none}.tl-text-label{display:flex;justify-content:center;align-items:center;color:var(--tl-color-text);line-height:inherit;position:absolute;inset:0;height:100%;width:100%}.tl-text-label[data-hastext=false][data-isediting=false]>.tl-text-label__inner{width:40px;height:40px}.tl-text-label[data-hastext=true][data-isediting=false] .tl-text-content{pointer-events:all}.tl-text-label__inner>.tl-text-input.tl-rich-text{display:none;position:static}.tl-text-wrapper[data-isediting=false] .tl-text-input{opacity:0;cursor:var(--tl-cursor-default)}.tl-rich-text[data-is-ready-for-editing=true],.tl-text-wrapper[data-is-ready-for-editing=true] .tl-text-input{cursor:var(--tl-cursor-text)}.tl-text-label[data-textwrap=true]>.tl-text-label__inner{max-width:100%}.tl-text-label[data-isediting=true]{background-color:transparent;min-height:auto}.tl-text-wrapper .tl-text-content{pointer-events:all;z-index:var(--tl-layer-text-content)}.tl-text-label__inner>.tl-text-content{position:relative;top:0;left:0;padding:inherit;height:fit-content;width:fit-content;border-radius:var(--tl-radius-1);max-width:100%}.tl-text-label__inner>.tl-text-input{position:absolute;inset:0;height:100%;width:100%;padding:inherit}.tl-text-wrapper[data-isselected=true] .tl-text-input{z-index:var(--tl-layer-text-editor);pointer-events:all}.tl-canvas:is([data-iseditinganything=true],[data-isselectinganything=true])
2
- .tl-shape:not([data-shape-type=arrow],[data-shape-type=draw],[data-shape-type=line],[data-shape-type=highlight],[data-shape-is-filled=false]){pointer-events:all}.tl-rich-text .ProseMirror{word-wrap:break-word;overflow-wrap:break-word;white-space:pre-wrap;-webkit-font-variant-ligatures:inherit;font-variant-ligatures:inherit;font-feature-settings:inherit}.tl-rich-text{tab-size:var(--tl-tab-size,2)}.tl-rich-text p{margin:0;min-height:1lh}.tl-rich-text ol,.tl-rich-text ul{text-align:left;margin:0;padding-left:1.625ch;list-style:revert}.tl-rich-text ol:has(>li:nth-child(10)){padding-left:2.625ch}.tl-rich-text ol:has(>li:nth-child(100)){padding-left:3.625ch}.tl-rich-text h1,.tl-rich-text h2,.tl-rich-text h3,.tl-rich-text h4,.tl-rich-text h5,.tl-rich-text h6{margin-top:5px;margin-bottom:10px;line-height:var(--tl-rich-text-heading-line-height,1.35)}.tl-rich-text a{color:var(--tl-color-primary);text-decoration:underline}.tl-rich-text[data-is-select-tool-active=false] a{cursor:inherit}.tl-rich-text code{font-family:var(--tl-font-mono)}.tl-rich-text mark{background-color:#fddd00;color:currentColor;border-radius:2px}.tl-theme__light .tl-rich-text mark{text-shadow:none}.tl-theme__dark .tl-rich-text mark{background-color:var(--tl-color-text-highlight);color:currentColor;text-shadow:none}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){.tl-container:not(.tl-theme__force-sRGB) .tl-rich-text mark{background-color:var(--tl-color-text-highlight-p3)}}}.tl-text-wrapper[data-isediting=true] .tl-rich-text{display:block}.tl-text__outline{text-shadow:var(--tl-text-outline)}.tl-text__no-outline{text-shadow:none}.tl-loading{background-color:var(--tl-color-background);color:var(--tl-color-text-1);height:100%;width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:var(--tl-space-2);font-size:14px;font-weight:500;opacity:0;animation:tl-fade-in .2s ease-in-out forwards;animation-delay:.2s;position:absolute;inset:0;z-index:var(--tl-layer-canvas-blocker)}@keyframes tl-fade-in{0%{opacity:0}to{opacity:1}}.tl-spinner{animation:tl-spin 1s linear infinite}@keyframes tl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.tl-hyperlink-button{background:none;margin:0;position:absolute;top:0;right:0;height:44px;width:44px;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:400;color:var(--tl-color-text-1);padding:13px;cursor:var(--tl-cursor-pointer);border:none;outline:none;pointer-events:all;z-index:1}.tl-hyperlink-button:after{content:"";z-index:-1;position:absolute;right:6px;bottom:6px;display:block;width:calc(100% - 12px);height:calc(100% - 12px);border-radius:var(--tl-radius-1);background-color:var(--tl-color-background);pointer-events:none}.tl-hyperlink-button:focus-visible{color:var(--tl-color-selected)}.tl-hyperlink__icon{width:15px;height:15px;background-color:currentColor;pointer-events:none}.tl-hyperlink-button__hidden{display:none}.tl-shape-indicator{transform-origin:top left;fill:none;stroke-width:calc(1.5px * var(--tl-scale));contain:size layout}.tl-canvas-overlays{position:absolute;inset:0;pointer-events:none;z-index:var(--tl-layer-canvas-overlays)}.tl-shape{contain:size layout}.tl-shape,.tl-svg-container{position:absolute;pointer-events:none;overflow:visible;transform-origin:top left}.tl-svg-container{inset:0;height:100%;width:100%;stroke-linecap:round;stroke-linejoin:round}.tl-html-container{stroke-linecap:round;stroke-linejoin:round;color:var(--tl-color-text-1)}.tl-content-slot,.tl-html-container{position:absolute;inset:0;height:100%;width:100%;pointer-events:none;transform-origin:top left}.tl-group{stroke:var(--tl-color-text);stroke-width:calc(1px * var(--tl-scale));opacity:.5}.tl-shape[data-shape-type=arrow] .tl-text-label{position:absolute;top:-1px;left:-1px;width:2px;height:2px;padding:0;display:flex;justify-content:center;align-items:center;text-align:center;color:var(--tl-color-text)}.tl-shape[data-shape-type=arrow] .tl-text-label__inner{border-radius:var(--tl-radius-1);box-sizing:content-box;height:max-content;width:max-content}.tl-shape[data-shape-type=arrow] .tl-text{height:max-content}.tl-bookmark__container{width:100%;height:100%;position:relative;border:1px solid var(--tl-color-panel-contrast);background-color:var(--tl-color-panel);border-radius:var(--tl-radius-2);display:flex;flex-direction:column;overflow:hidden}.tl-bookmark__container--safariExport{border:1px solid var(--tl-color-divider)}.tl-bookmark__image_container{flex:1 1 100%;overflow:hidden;border-top-left-radius:var(--tl-radius-1);border-top-right-radius:var(--tl-radius-1);width:100%;height:100%;display:flex;justify-content:flex-end;align-items:flex-start;box-shadow:inset 0 0 0 1px var(--tl-color-divider)}.tl-bookmark__image_container>.tl-hyperlink-button:after{background-color:var(--tl-color-panel)}.tl-bookmark__placeholder{background-color:var(--tl-color-muted-2)}.tl-bookmark__image,.tl-bookmark__placeholder{width:100%;height:100%;border-bottom:1px solid var(--tl-color-muted-2)}.tl-bookmark__image{object-fit:cover;object-position:center}.tl-bookmark__copy_container{background-color:var(--tl-color-muted-0);padding:var(--tl-space-4);pointer-events:all;display:flex;flex-direction:column;justify-content:space-between;flex:1}.tl-bookmark__copy_container:has(.tl-bookmark__link:only-child){justify-content:center}.tl-bookmark__description,.tl-bookmark__heading,.tl-bookmark__link{margin:0;width:100%;font-family:inherit}.tl-bookmark__heading{font-size:16px;line-height:1.6;font-weight:700;padding-bottom:var(--tl-space-2);max-height:calc((16px * 1.6) * 2);-webkit-line-clamp:2;line-clamp:2}.tl-bookmark__description,.tl-bookmark__heading{overflow:hidden;-webkit-box-orient:vertical;text-overflow:ellipsis;display:-webkit-box}.tl-bookmark__description{font-size:12px;line-height:1.5;max-height:calc((12px * 1.5) * 3);-webkit-line-clamp:3;line-clamp:3;color:var(--tl-color-text-1);margin:var(--tl-space-2) 0}.tl-bookmark__description+.tl-bookmark__link,.tl-bookmark__heading+.tl-bookmark__link{margin-top:var(--tl-space-3)}.tl-bookmark__link{font-size:12px;pointer-events:all;display:flex;color:var(--tl-color-text-1);align-items:center;cursor:var(--tl-cursor-pointer);width:fit-content;max-width:100%;text-decoration:none}.tl-bookmark__link>span{flex-shrink:0px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tl-bookmark__link>.tl-hyperlink__icon{margin-right:8px;flex-shrink:0}.tl-bookmark__link>.tl-bookmark__favicon{margin-right:8px;width:16px;height:16px;flex-shrink:0}.tl-image,.tl-video{object-fit:cover;background-size:cover;width:100%;height:100%}.tl-embed-container,.tl-image-container,.tl-video-container{width:100%;height:100%;pointer-events:all;display:flex;justify-content:center;align-items:center}.tl-image-container{position:relative}.tl-image{position:absolute;inset:0}.tl-video.tl-video-is-fullscreen{object-fit:contain;background-size:contain}.tl-note__container{position:relative;width:100%;height:100%;pointer-events:all;opacity:1;z-index:var(--tl-layer-text-container);border-radius:1px}.tl-note__container>.tl-text-label{color:currentColor}.tl-note__attribution{position:absolute;bottom:calc(4px * var(--note-attribution-scale, 1));right:calc(8px * var(--note-attribution-scale, 1));font-family:var(--tl-font-sans);pointer-events:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:60%;z-index:1}.tl-frame__body{stroke-width:calc(1px * var(--tl-scale))}.tl-frame__creating{stroke:var(--tl-color-selected);fill:none}.tl-frame-heading{--tl-frame-padding-x:6px;--tl-frame-height:24px;--tl-frame-minimum-width:32px;--tl-frame-offset-width:16px;position:absolute;overflow:hidden;max-width:100%;min-width:var(--tl-frame-minimum-width);height:auto;font-size:12px;padding-bottom:4px}.tl-frame-heading,.tl-frame-heading-hit-area{display:flex;align-items:center;transform-origin:0 100%;pointer-events:all}.tl-frame-heading-hit-area{height:var(--tl-frame-height);width:100%;border-radius:var(--tl-radius-1)}.tl-frame-label{pointer-events:all;overflow:hidden;text-overflow:ellipsis;padding:0 var(--tl-frame-padding-x);border-radius:var(--tl-radius-1);position:relative;font-size:inherit;white-space:pre}.tl-frame-label__editing{color:transparent;white-space:pre;width:auto;min-width:var(--tl-frame-minimum-width);height:100%;overflow:visible;background-color:var(--tl-color-panel);border-color:var(--tl-color-selected);box-shadow:inset 0 0 0 1.5px var(--tl-color-selected)}.tl-frame-name-input{position:absolute;border:none;background:none;outline:none;padding:0 var(--tl-frame-padding-x);inset:0;height:100%;font-size:inherit;font-family:inherit;font-weight:inherit;width:100%;color:var(--tl-color-text-1);border-radius:var(--tl-radius-1);user-select:all;-webkit-user-select:text;white-space:pre;cursor:var(--tl-cursor-text)}.tl-embed{border:none;border-radius:var(--tl-radius-2)}.tl-shape-error-boundary{width:100%;height:100%;background-color:var(--tl-color-muted-1);border-width:calc(1px * var(--tl-scale));border-color:var(--tl-color-muted-1);border-style:solid;border-radius:calc(var(--tl-radius-1) * var(--tl-scale));display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:left;position:relative;pointer-events:all;overflow:hidden;padding:var(--tl-space-2)}.tl-shape-error-boundary:before{transform:scale(var(--tl-scale));content:"Error";font-size:12px;font-family:inherit;color:var(--tl-color-text-0)}.tl-error-boundary{width:100%;height:100%;display:flex;align-items:center;justify-content:center;padding:var(--tl-space-4);background-color:var(--tl-color-background);color:var(--tl-color-text-1);position:absolute}.tl-error-boundary__overlay{position:absolute;inset:0;height:100%;width:100%;z-index:var(--tl-layer-error-overlay);background-color:var(--tl-color-overlay)}.tl-error-boundary__content *{user-select:all;-webkit-user-select:text;pointer-events:all}.tl-error-boundary__canvas{pointer-events:none;position:absolute;inset:0;height:100%;width:100%;z-index:var(--tl-layer-error-canvas)}.tl-error-boundary__canvas:after{content:" ";display:block;position:absolute;inset:0;height:100%;width:100%;z-index:var(--tl-layer-error-canvas-after);pointer-events:all}.tl-error-boundary__content{width:fit-content;height:fit-content;max-width:100%;width:400px;max-height:100%;background-color:var(--tl-color-panel);padding:16px;border-radius:16px;box-shadow:var(--tl-shadow-2);font-size:14px;font-weight:400;display:flex;flex-direction:column;overflow:auto;z-index:var(--tl-layer-error-content);gap:12px}.tl-error-boundary__content__expanded{width:600px}.tl-error-boundary__content h2{font-size:16px;margin:0;font-weight:500}.tl-error-boundary__content h4{border:1px solid var(--tl-color-low-border);margin:-6px 0 0;padding:var(--tl-space-5);border-radius:var(--tl-radius-2);font-weight:400}.tl-error-boundary__content p{line-height:1.5;margin:0}.tl-error-boundary__content pre{background-color:var(--tl-color-muted-2);margin-top:0;padding:var(--tl-space-5);border-radius:var(--tl-radius-2);overflow:auto;font-size:12px;max-height:320px}.tl-error-boundary__content button{background:none;border:none;font-family:inherit;font-size:14px;font-weight:500;padding:var(--tl-space-4);border-radius:var(--tl-radius-3);cursor:var(--tl-cursor-pointer);color:inherit;background-color:transparent}.tl-error-boundary__content a{color:var(--tl-color-selected);font-weight:500;text-decoration:none}.tl-error-boundary__content__error{position:relative;margin:-6px 0 0}.tl-error-boundary__content__error button{position:absolute;top:var(--tl-space-2);right:var(--tl-space-2);font-size:12px;padding:var(--tl-space-2) var(--tl-space-3);background-color:var(--tl-color-panel);border-radius:var(--tl-radius-1)}.tl-error-boundary__content__actions{display:flex;justify-content:space-between;gap:var(--tl-space-4);margin:0 0 0 -4px}.tl-error-boundary__content__actions__group{display:flex;gap:var(--tl-space-4)}.tl-error-boundary__content .tl-error-boundary__reset{color:var(--tl-color-danger)}.tl-error-boundary__content .tl-error-boundary__refresh{background-color:var(--tl-color-primary);color:var(--tl-color-selected-contrast)}.tl-container__focused:not(.tl-container__no-focus-ring)
3
- .tlui-button.tl-error-boundary__refresh:focus-visible{border-radius:8px;outline-offset:0}.tl-hit-test-blocker{position:absolute;z-index:var(--tl-layer-canvas-blocker);inset:0;width:100%;height:100%;pointer-events:all}.tl-hit-test-blocker__hidden{display:none}@media (hover:hover){.tl-handle__create:hover{opacity:1}.tl-handle__bg:hover{cursor:var(--tl-cursor-grab);fill:var(--tl-color-selection-fill)}.tl-bookmark__link:hover,.tl-hyperlink-button:hover{color:var(--tl-color-selected)}.tl-error-boundary__content button:hover{background-color:var(--tl-color-low)}.tl-error-boundary__content a:hover{color:var(--tl-color-text-1)}.tl-error-boundary__content .tl-error-boundary__refresh:hover{background-color:var(--tl-color-primary);opacity:.9}.tl-canvas[data-iseditinganything=true] .tl-text-wrapper:hover .tl-text-input{z-index:var(--tl-layer-text-editor);pointer-events:all}}.tl-container{--tl-layer-above:1;--tl-layer-focused-input:10;--tl-layer-menu-click-capture:250;--tl-layer-panels:300;--tl-layer-menus:400;--tl-layer-toasts:650;--tl-layer-cursor:700;--tl-layer-header-footer:999}.tlui-button{position:relative;height:40px;min-width:40px;padding:0 12px;display:flex;align-items:center;justify-content:center;background-color:transparent;border:transparent;color:currentColor;cursor:pointer;pointer-events:all;font-weight:inherit;font-family:inherit;line-height:inherit;text-rendering:optimizeLegibility;font-size:12px;gap:0;color:var(--tl-color-text-1);z-index:0}.tlui-button:disabled,.tlui-button[data-disabled]{color:var(--tl-color-text-disabled);text-shadow:none;cursor:default}.tlui-button:disabled .tlui-kbd,.tlui-button[data-disabled] .tlui-kbd{color:var(--tl-color-text-disabled)}.tlui-button>*{position:relative;z-index:var(--tl-layer-above)}.tlui-button__label{font-size:12px;flex-grow:2;text-align:start;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tl-container__focused:not(.tl-container__no-focus-ring) .tlui-button:focus-visible{border-radius:10px;outline:2px solid var(--tl-color-focus);outline-offset:-5px}.tl-container__focused:not(.tl-container__no-focus-ring) .tlui-button__tool:focus-visible{border-radius:12px}.tlui-slider__container:has(.tlui-slider__thumb:focus-visible){border-radius:10px;outline:2px solid var(--tl-color-focus);outline-offset:-5px}.tlui-button:after{display:block;content:"";position:absolute;inset:4px;border-radius:var(--tl-radius-2);background:var(--tl-color-muted-2);opacity:0}.tlui-button__menu[data-highlighted]:after{opacity:1}.tlui-button[data-isactive=true]:after,.tlui-button[data-isactive=true]:not(:disabled,[data-disabled],:focus-visible):active:after{background:var(--tl-color-hint);opacity:1}.tlui-button[aria-expanded=true][data-direction=left]{background:linear-gradient(270deg,rgba(144,144,144,0) 0,var(--tl-color-muted-2) 100%);opacity:1}@media (hover:hover){.tlui-button[aria-expanded=true][data-direction=left]:not(:hover):after{background:linear-gradient(270deg,rgba(144,144,144,0) 0,var(--tl-color-muted-2) 100%);opacity:1}.tlui-button:not(:disabled,[data-disabled]):hover{z-index:1}.tlui-button:not(:disabled,[data-disabled]):hover:after{opacity:1}}.tlui-button__icon+.tlui-button__label{margin-inline-start:var(--tl-space-2)}.tlui-button__low{border-radius:var(--tl-radius-3);background-color:var(--tl-color-low)}.tlui-button__low:after{background-color:var(--tl-color-muted-2);opacity:0}@media (hover:hover){.tlui-button__low:hover:after{opacity:1}}.tlui-button__primary{color:var(--tl-color-primary)}.tlui-button__danger{color:var(--tl-color-danger);text-shadow:none}@media (hover:hover){.tlui-button__primary:not(:disabled,[data-disabled],:focus-visible):hover{color:var(--tl-color-primary)}.tlui-button__danger:not(:disabled,[data-disabled],:focus-visible):hover{color:var(--tl-color-danger);text-shadow:none}}.tlui-button__menu{height:40px;min-height:40px;width:100%;gap:8px;margin-top:-4px}.tlui-button__menu:after{inset:4px;border-radius:var(--tl-radius-2)}.tlui-button__menu>.tlui-icon+.tlui-button__label{margin-inline-start:0}.tlui-button__menu:first-child{margin-top:0}.tlui-button__menu:last-child{margin-bottom:0}.tlui-button__checkbox{padding-left:8px}.tlui-button__checkbox__indicator{width:15px;height:15px}.tlui-main-toolbar__lock-button{position:absolute;pointer-events:all;height:40px;width:40px;border-radius:var(--tl-radius-2)}.tlui-main-toolbar--horizontal .tlui-main-toolbar__lock-button{top:4px;right:0;min-width:0}.tlui-main-toolbar--vertical .tlui-main-toolbar__lock-button{bottom:0;min-height:0}.tlui-main-toolbar__lock-button:after{top:4px;left:8px;inset:4px}.tlui-button__tool{position:relative;height:48px;width:48px}.tlui-button__tool:after{inset:4px;border-radius:8px}.tlui-button__tool[aria-pressed=true]{color:var(--tl-color-selected-contrast)}.tlui-button__tool[aria-pressed=true]:not(:disabled,[data-disabled],:focus-visible):active{color:var(--tl-color-selected-contrast)}.tlui-button__tool[aria-pressed=true]:not(:disabled,[data-disabled]):after{background:var(--tl-color-selected);opacity:1}.tlui-layout__mobile .tlui-main-toolbar--horizontal .tlui-button__tool{height:48px;width:43px}.tlui-layout__mobile .tlui-main-toolbar--horizontal .tlui-button__tool>.tlui-icon{height:16px;width:16px}.tlui-row{display:flex;flex-direction:row;padding:0 2px}.tlui-row>*{margin-left:-2px;margin-right:-2px}.tlui-column{display:flex;flex-direction:column;padding:2px 0}.tlui-column>*{margin-top:-2px;margin-bottom:-2px}.tlui-grid{display:grid;grid-template-columns:repeat(4,1fr);grid-auto-flow:row;overflow:hidden;padding:2px}.tlui-grid>*{margin:-2px}.tlui-zoom-menu__button{width:60px;min-width:60px;text-align:center}.tlui-zoom-menu__button[data-state=open]:after{background:linear-gradient(0deg,rgba(144,144,144,0) 0,var(--tl-color-muted-2) 100%);opacity:1}.tlui-layout{position:relative;display:grid;grid-template-columns:1fr;grid-template-rows:minmax(0,1fr) auto;grid-auto-rows:auto;height:100%;max-height:100%;overflow:clip;pointer-events:none;user-select:none;contain:strict;z-index:var(--tl-layer-panels);transform:translateZ(0);--tl-sab:env(safe-area-inset-bottom);font-weight:500;line-height:1.6;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-smooth:antialiased;text-rendering:optimizeLegibility}.tlui-layout__top{grid-column:1;grid-row:1;display:flex;min-width:0;justify-content:space-between}.tlui-layout__top__left{flex-direction:column;align-items:flex-start;width:100%;flex:0 1 0}.tlui-layout__top__left,.tlui-layout__top__right{display:flex;justify-content:flex-start;height:100%}.tlui-layout__top__right{flex-direction:column;align-items:flex-end;flex:0 0 auto;min-width:0}.tlui-scrollable,.tlui-scrollable *{pointer-events:all;touch-action:auto;overscroll-behavior:none}.tlui-helper-buttons{position:relative;display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start;width:min-content;gap:var(--tl-space-3);margin:var(--tl-space-2) var(--tl-space-3);white-space:nowrap;pointer-events:none;z-index:var(--tl-layer-panels)}.tlui-icon{background-color:currentColor}.tlui-icon,.tlui-icon__placeholder{flex-shrink:0;width:18px;height:18px}.tlui-icon__placeholder{background-color:transparent}.tlui-icon__small{width:15px;height:15px}.tlui-icon__tiny{width:12px;height:12px}.tlui-slider__container{width:100%;padding:0 var(--tl-space-4)}.tlui-slider{position:relative;display:flex;align-items:center;user-select:none;touch-action:none;width:100%}.tlui-slider__track{position:relative;flex-grow:1;height:44px;cursor:pointer}.tlui-slider__track:after{display:block;content:"";width:100%;background-color:var(--tl-color-muted-1)}.tlui-slider__range,.tlui-slider__track:after{position:absolute;top:calc(50% - 2px);height:3px;border-radius:14px}.tlui-slider__range{left:0;background-color:var(--tl-color-selected)}.tlui-slider__thumb{all:unset;cursor:grab;display:block;width:18px;height:18px;position:relative;top:-1px;background-color:var(--tl-color-panel);border-radius:999px;box-shadow:inset 0 0 0 2px var(--tl-color-text-1)}.tlui-slider__thumb:active{cursor:grabbing;box-shadow:inset 0 0 0 2px var(--tl-color-text-1),var(--tl-shadow-1)}.tlui-input{background:none;margin:0;position:relative;z-index:var(--tl-layer-above);height:40px;max-height:40px;display:flex;align-items:center;justify-content:center;font-family:inherit;font-size:12px;font-weight:inherit;color:var(--tl-color-text-1);padding:var(--tl-space-4);padding-left:0;border:none;outline:none;text-overflow:ellipsis;width:100%;user-select:all;text-rendering:optimizeLegibility;-webkit-user-select:auto!important}.tlui-input::placeholder{color:var(--tl-color-text-3)}.tlui-input__wrapper{width:100%;height:44px;display:flex;align-items:center;gap:var(--tl-space-4);color:var(--tl-color-text)}.tlui-input__wrapper>.tlui-icon{flex-shrink:0}.tlui-input__wrapper>label{flex-shrink:0;overflow-wrap:normal}@supports (-webkit-touch-callout:none){.tlui-input{font-size:16px}}.tlui-select__trigger{justify-content:space-between;gap:var(--tl-space-3)}.tlui-select__trigger[data-state=open]:after{opacity:1}.tlui-select__value{display:flex;align-items:center;gap:var(--tl-space-2)}.tlui-select__chevron{flex-shrink:0;color:var(--tl-color-text-2)}.tlui-select__content{min-width:var(--radix-select-trigger-width);max-height:var(--radix-select-content-available-height)}.tlui-select__viewport{padding:4px 0}.tlui-select__item{justify-content:flex-start}.tlui-select__item-indicator{visibility:hidden}.tlui-select__item[data-state=checked] .tlui-select__item-indicator{visibility:visible}.tlui-kbd{font-family:inherit;font-size:11px;line-height:11px;display:grid;justify-items:center;grid-auto-flow:column;grid-template-columns:auto;grid-auto-columns:minmax(1em,auto);align-self:bottom;color:currentColor;margin-inline-start:var(--tl-space-4)}.tlui-kbd>span{width:100%;text-align:center;display:inline;margin:0;padding:2px;border-radius:2px}.tlui-kbd>span:last-child{padding-inline-end:0}.tlui-kbd:not(:last-child){margin-inline-end:var(--tl-space-2)}.tlui-focus-button{z-index:var(--tl-layer-panels);pointer-events:all}.tlui-menu:empty{display:none}.tlui-menu{z-index:var(--tl-layer-menus);height:fit-content;width:fit-content;border-radius:var(--tl-radius-3);pointer-events:all;touch-action:auto;overflow-y:auto;overscroll-behavior:none;background-color:var(--tl-color-panel);box-shadow:var(--tl-shadow-3)}@media (max-height:600px){.tlui-menu{max-height:70vh}}.tlui-menu::-webkit-scrollbar{display:none}.tlui-menu__group{width:100%}.tlui-menu__group:empty{display:none}.tlui-menu__group{border-bottom:1px solid var(--tl-color-divider)}.tlui-menu__group:last-of-type{border-bottom:none}.tlui-menu__submenu__trigger{--gradient-angle:90deg}.tlui-menu__submenu__trigger[data-direction=left]{--gradient-angle:270deg}.tlui-menu__submenu__trigger[data-state=open]:after{opacity:1;background:linear-gradient(var(--gradient-angle),rgba(144,144,144,0) 0,var(--tl-color-muted-2) 100%)}@media (hover:hover){.tlui-menu__submenu__trigger:is(:hover,[data-state=open]):after{opacity:1;background:linear-gradient(var(--gradient-angle),rgba(144,144,144,0) 0,var(--tl-color-muted-2) 100%)}}.tlui-menu[data-size=large]>.tlui-menu__group{min-width:auto}.tlui-menu[data-size=medium]>.tlui-menu__group{min-width:144px}.tlui-menu[data-size=small]>.tlui-menu__group{min-width:96px}.tlui-menu[data-size=tiny]>.tlui-menu__group{min-width:0}.tlui-menu-click-capture{position:fixed;inset:0;z-index:var(--tl-layer-menu-click-capture)}.tlui-popover{position:relative;display:flex;align-content:stretch}.tlui-popover__content{max-height:calc(var(--radix-popover-content-available-height) - 8px);overflow:hidden;overflow-y:auto;touch-action:auto;overscroll-behavior:none;scrollbar-width:none;-ms-overflow-style:none}.tlui-hover-card__content,.tlui-popover__content{position:relative;margin:0;border:none;border-radius:var(--tl-radius-3);background-color:var(--tl-color-panel);box-shadow:var(--tl-shadow-3);z-index:var(--tl-layer-menus)}.tlui-menu-zone{position:relative;z-index:var(--tl-layer-panels);width:fit-content;border-right:2px solid var(--tl-color-background);border-bottom:2px solid var(--tl-color-background);border-bottom-right-radius:var(--tl-radius-4);background-color:var(--tl-color-low)}.tlui-menu-zone [data-state=open]:after{background:linear-gradient(180deg,rgba(144,144,144,0) 0,var(--tl-color-muted-2) 100%);opacity:1}@media (hover:hover){.tlui-menu-zone [data-state=open]:not(:hover):after{background:linear-gradient(180deg,rgba(144,144,144,0) 0,var(--tl-color-muted-2) 100%);opacity:1}}.tlui-page-menu__wrapper{display:flex;flex-direction:column;width:220px}.tlui-page-menu__trigger{width:auto}.tlui-page-menu__trigger[data-state=open]:after{background:linear-gradient(180deg,rgba(144,144,144,0) 0,var(--tl-color-muted-2) 100%);opacity:1}.tlui-page-menu__list{flex:0 0 auto;overflow-x:hidden;overflow-y:auto;scrollbar-width:none;-ms-overflow-style:none}.tlui-page-menu__list::-webkit-scrollbar{display:none}.tlui-page-menu__list__content{position:relative;overflow:hidden}.tlui-page-menu__resize-handle{flex:0 0 auto;position:relative;height:1px;cursor:ns-resize;touch-action:none;background:var(--tl-color-divider);transition:background-color .15s ease-in-out 80ms;z-index:999}.tlui-page-menu__resize-handle:after{content:"";position:absolute;inset:-4px 0;background:none;z-index:2000;pointer-events:all}.tlui-page-menu__resize-handle:before{content:"";position:absolute;top:0;left:0;right:0;height:1.5px;background:transparent;pointer-events:none;z-index:2001}.tlui-page-menu__resize-handle[data-resizing=true]:before{background:var(--tl-color-selected);transition:none}.tlui-page-menu__create-button{flex:0 0 auto;margin:0}.tlui-page-menu__item__button{flex:1 1 auto;min-width:0}.tlui-page-menu__item__button:after,.tlui-page-menu__item__drag-handle:after{content:none}.tlui-page-menu__item__button>.tlui-button__label{padding-inline-end:calc(40px - 12px)}.tlui-page-menu__item{position:absolute;top:0;inset-inline-start:0;width:100%;height:40px;display:flex;flex-direction:row;align-items:center;overflow:hidden;transition:transform .08s ease-out}.tlui-page-menu__item:before{content:"";position:absolute;inset:4px;border-radius:var(--tl-radius-2);background:var(--tl-color-muted-2);opacity:0;pointer-events:none}.tlui-page-menu__item>*{position:relative;z-index:var(--tl-layer-above)}.tlui-page-menu__item[data-iscurrent=true]:not([data-editing=true]):before{background:var(--tl-color-hint);opacity:1}.tlui-page-menu__item__title{flex:1;height:40px;position:relative}.tlui-page-menu__item__title:before{content:"";position:absolute;inset:4px;border-radius:var(--tl-radius-2);border:1px solid var(--tl-color-primary);pointer-events:none}.tlui-page-menu__item__title>.tlui-input__wrapper{height:100%}.tlui-page-menu__item[data-dragging=true],.tlui-page-menu__item[data-dragging=true] .tlui-page-menu__item__button,.tlui-page-menu__item[data-dragging=true] .tlui-page-menu__item__drag-handle{cursor:grabbing;transition:none}.tlui-page-menu__item[data-dragging=true]{background:var(--tl-color-panel);opacity:1}.tlui-page-menu__item__drag-handle{flex:0 0 32px;min-width:32px;padding:0;color:var(--tl-color-text-3);cursor:grab;touch-action:none}.tlui-page-menu__item__drag-handle>.tlui-icon{position:relative;inset-inline-start:1px}.tlui-page-menu__item__drag-handle+.tlui-page-menu__item__button{padding-inline-start:0}.tlui-page-menu__item__input{margin-inline-start:12px}.tlui-page-menu__item__submenu{position:absolute;inset-inline-end:0;top:0;height:100%;z-index:10}.tlui-page-menu__item__submenu>.tlui-button{opacity:0;color:var(--tl-color-text-3)}.tlui-page-menu__item__submenu>.tlui-button:after{content:none}.tlui-page-menu__item:has(.tlui-button:focus-visible)>.tlui-page-menu__item__submenu>.tlui-button,.tlui-page-menu__item__submenu>.tlui-button:focus-visible,.tlui-page-menu__item__submenu>.tlui-button[data-state=open]{opacity:1}.tlui-page-menu__list__content[data-dragging=true]
4
- .tlui-page-menu__item>.tlui-page-menu__item__submenu>.tlui-button{opacity:0}.tl-container[data-coarse=true] .tlui-page-menu__item__submenu>.tlui-button{opacity:1}.tl-container[data-coarse=true] .tlui-page-menu__item__button>.tlui-button__label{padding-inline-end:calc(40px - 12px)}@media (hover:hover){.tlui-page-menu__resize-handle:hover:before{background:var(--tl-color-selected);height:2px;transition:background-color .15s 80ms}.tlui-page-menu__item:hover>.tlui-page-menu__item__submenu>.tlui-button,.tlui-page-menu__item:not([data-editing=true]):hover:before{opacity:1}.tlui-page-menu__item__button>.tlui-button__label{padding-inline-end:0}.tlui-page-menu__item:hover>.tlui-page-menu__item__button>.tlui-button__label{padding-inline-end:calc(40px - 12px)}.tlui-page-menu__item__submenu>.tlui-button:hover{color:var(--tl-color-text)}}.tl-skip-to-main-content{position:fixed;top:48px;left:-9999px;padding:8px 16px;z-index:var(--tl-layer-toasts)}.tl-skip-to-main-content:focus{left:8px}.tl-skip-to-main-content:focus+.tlui-layout__top .tlui-helper-buttons{display:none}.tlui-offline-indicator{display:flex;color:var(--tl-color-background);background-color:var(--tl-color-text);border:none;width:32px;height:32px;align-items:center;justify-content:center;border-radius:99px;cursor:default;opacity:0;animation:tl-fade-in;animation-duration:.12s;animation-delay:2s;animation-fill-mode:forwards}.tlui-style-panel__wrapper{box-shadow:var(--tl-shadow-2);border-radius:var(--tl-radius-3);pointer-events:all;background-color:var(--tl-color-panel);height:fit-content;max-height:100%;margin:4px 8px 8px;touch-action:auto;overscroll-behavior:none;overflow-y:auto;overflow-x:hidden;color:var(--tl-color-text)}.tlui-style-panel__wrapper:only-child{margin-top:8px}.tlui-style-panel{position:relative;z-index:var(--tl-layer-panels);pointer-events:all;width:148px;max-width:148px}.tlui-style-panel[data-enhanced-a11y-mode=true] .tlui-button[data-isactive=true]{border-radius:10px;outline:2px solid var(--tl-color-text);outline-offset:-5px}.tlui-style-panel::-webkit-scrollbar{display:none}.tlui-style-panel .tlui-button.select{width:100%}.tlui-style-panel__section{display:flex;position:relative;flex-direction:column}.tlui-style-panel__section:not(:nth-last-child(-n+1 of .tlui-style-panel__section:not(:empty))){border-bottom:1px solid var(--tl-color-divider)}.tlui-style-panel__section:has(.tlui-slider__container:last-child):not(:nth-last-child(-n+1 of .tlui-style-panel__section:not(:empty))){margin-bottom:7px}.tlui-style-panel__section:empty{display:none}.tlui-style-panel__section .tlui-toolbar:has(.tlui-toolbar){flex-wrap:wrap}.tlui-style-panel__section .tlui-toolbar:has(.tlui-toolbar) .tlui-style-panel__subheading{margin-left:-2px}.tlui-style-panel__section__common:not(:only-child){margin-bottom:7px;border-bottom:1px solid var(--tl-color-divider)}.tlui-style-panel__dropdown-picker>.tlui-button__icon,.tlui-toolbar-toggle-group-item{width:40px;padding:0}.tlui-style-panel__dropdown-picker:only-child{flex:1}.tlui-style-panel__double-select-picker{display:flex;grid-template-columns:1fr auto;align-items:center;padding-left:var(--tl-space-4);color:var(--tl-color-text-1);font-size:12px}.tlui-style-panel__double-select-picker-label{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;flex-grow:2;max-width:100%}.tlui-style-panel .tlui-button[data-state=open]:after{opacity:1;background:linear-gradient(270deg,rgba(144,144,144,0) 0,var(--tl-color-muted-2) 100%)}@media (hover:hover){.tlui-style-panel .tlui-button[aria-expanded=true]{background:none}.tlui-style-panel .tlui-button[data-state=open]:not(:hover):after{opacity:1;background:linear-gradient(270deg,rgba(144,144,144,0) 0,var(--tl-color-muted-2) 100%)}}.tlui-style-panel__section .tlui-style-panel__subheading,.tlui-style-panel__section__common .tlui-style-panel__subheading,.tlui-style-panel__subheading+.tlui-slider__container{margin:0;padding:var(--tl-space-2) var(--tl-space-3) 0 var(--tl-space-4);font-size:12px;font-weight:inherit;line-height:inherit}.tlui-style-panel .tlui-style-panel__subheading:first-of-type{padding-top:var(--tl-space-3)}.tlui-style-panel__subheading+.tlui-slider__container{padding-top:0}.tlui-layout__bottom{grid-row:2;width:100%;min-width:0}.tlui-layout__bottom__main{width:100%;display:flex;align-items:flex-end;justify-content:center}.tlui-navigation-panel{display:flex;width:min-content;flex-direction:column;z-index:var(--tl-layer-panels);pointer-events:all;position:absolute;left:0}.tl-container[dir=rtl] .tlui-navigation-panel{left:auto;right:0}.tlui-navigation-panel:before{content:"";display:block;position:absolute;z-index:-1;inset:-2px -2px 0 0;border-radius:0;border-top:2px solid var(--tl-color-background);border-right:2px solid var(--tl-color-background);border-top-right-radius:var(--tl-radius-4);background-color:var(--tl-color-low)}.tl-container[dir=rtl] .tlui-navigation-panel:before{inset:-2px 0 0 -2px;border-right:0;border-left:2px solid var(--tl-color-background);border-top-right-radius:0;border-top-left-radius:var(--tl-radius-4)}.tlui-navigation-panel[data-a11y=true]:before{display:none}.tlui-minimap{width:100%;height:96px;min-height:96px;overflow:hidden;padding:var(--tl-space-3);padding-top:0}.tlui-minimap__canvas{position:relative;width:100%;height:100%}.tlui-main-toolbar{grid-column:1/span 3;grid-row:1;display:flex;align-items:center;justify-content:center;flex-grow:2}.tlui-main-toolbar--horizontal{padding-bottom:calc(var(--tl-space-3) + var(--tl-sab));max-width:100%}.tlui-main-toolbar--vertical{position:absolute;left:0;top:90px;bottom:140px;padding-left:calc(var(--tl-space-3) + var(--tl-sab))}[data-breakpoints-below*="6"] .tlui-main-toolbar--vertical{bottom:90px}.tlui-main-toolbar__inner{position:relative;width:fit-content;display:flex;gap:var(--tl-space-3);align-items:flex-start}.tlui-main-toolbar--vertical .tlui-main-toolbar__inner{flex-direction:column}.tlui-main-toolbar--horizontal .tlui-main-toolbar__left{width:fit-content}.tlui-main-toolbar--vertical .tlui-main-toolbar__left{display:flex;height:fit-content}.tlui-main-toolbar__extras{position:relative;z-index:var(--tl-layer-above);pointer-events:none;align-self:stretch}.tlui-main-toolbar__extras:empty{display:none}.tlui-main-toolbar--horizontal .tlui-main-toolbar__extras{height:48px;top:6px}.tlui-main-toolbar--vertical .tlui-main-toolbar__extras{width:48px;order:1}.tlui-main-toolbar__extras__controls{position:relative;z-index:var(--tl-layer-above);background-color:var(--tl-color-low);border:2px solid var(--tl-color-background);pointer-events:all}.tlui-main-toolbar--horizontal .tlui-main-toolbar__extras__controls{border-top-left-radius:var(--tl-radius-4);border-top-right-radius:var(--tl-radius-4);margin-left:8px;margin-right:0;width:fit-content}.tlui-main-toolbar--vertical .tlui-main-toolbar__extras__controls{border-top-right-radius:var(--tl-radius-4);border-bottom-right-radius:var(--tl-radius-4);margin-top:8px;margin-left:-2px;margin-bottom:0;width:fit-content}.tlui-main-toolbar__tools{border-radius:var(--tl-radius-4);z-index:var(--tl-layer-panels);pointer-events:all;position:relative;background:var(--tl-color-panel);box-shadow:var(--tl-shadow-2);contain:layout style paint}.tlui-main-toolbar--horizontal .tlui-main-toolbar__mobile-style-panel{align-self:flex-end}.tlui-main-toolbar--vertical .tlui-main-toolbar__mobile-style-panel{align-self:flex-start}.tlui-main-toolbar--horizontal .tlui-main-toolbar__overflow{width:40px;margin-left:2px}.tlui-main-toolbar--vertical .tlui-main-toolbar__overflow{height:40px;margin-top:2px}.tlui-layout__mobile .tlui-main-toolbar--horizontal .tlui-main-toolbar__overflow{width:32px;padding:0}.tlui-main-toolbar--horizontal [data-state=open]:after{background:linear-gradient(0deg,rgba(144,144,144,0) 0,var(--tl-color-muted-2) 100%);opacity:1}.tlui-main-toolbar--vertical [data-state=open]:after{background:linear-gradient(90deg,rgba(144,144,144,0) 0,var(--tl-color-muted-2) 100%);opacity:1}.tlui-main-toolbar__overflow-content{touch-action:none}.tlui-main-toolbar__group:empty,.tlui-main-toolbar__overflow-content [data-toolbar-visible=false],.tlui-main-toolbar__tools [data-toolbar-visible=false]{display:none}.tlui-row.tlui-main-toolbar__group:not(:nth-last-child(-n+1 of [data-toolbar-visible=true])){border-right:1px solid var(--tl-color-divider);margin-right:2px}.tlui-column.tlui-main-toolbar__group:not(:nth-last-child(-n+1 of [data-toolbar-visible=true])){border-bottom:1px solid var(--tl-color-divider);margin-bottom:2px}.tlui-grid.tlui-main-toolbar__group{grid-column:1/span 4}.tlui-grid.tlui-main-toolbar__group:not(:nth-last-child(-n+1 of [data-toolbar-visible=true])){border-bottom:1px solid var(--tl-color-divider);margin-bottom:2px}@media (hover:hover){.tlui-main-toolbar--horizontal [data-state=open]:not(:hover):after{background:linear-gradient(0deg,rgba(144,144,144,0) 0,var(--tl-color-muted-2) 100%);opacity:1}.tlui-main-toolbar--vertical [data-state=open]:not(:hover):after{background:linear-gradient(90deg,rgba(144,144,144,0) 0,var(--tl-color-muted-2) 100%);opacity:1}}.tlui-tooltip{font-size:12px;padding:2px 8px;border-radius:4px;background-color:var(--tl-color-tooltip);box-shadow:none;color:var(--tl-color-text-shadow);max-width:400px;width:fit-content;text-align:center;will-change:transform,opacity;z-index:2}.tlui-tooltip__arrow{fill:var(--tl-color-tooltip);will-change:opacity}[data-radix-popper-content-wrapper]:has(.tlui-tooltip){z-index:var(--tl-layer-toasts)!important;pointer-events:none}.tlui-debug-panel{background-color:var(--tl-color-low);width:100%;display:grid;align-items:center;grid-template-columns:1fr auto auto auto;justify-content:space-between;padding-inline-start:var(--tl-space-4);border-top:1px solid var(--tl-color-background);font-size:12px;color:var(--tl-color-text-1);z-index:var(--tl-layer-panels);pointer-events:all}.tlui-debug-panel__current-state{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.tlui-debug-panel__fps{margin-right:8px}.tlui-debug-panel__fps__slow{font-weight:700;color:var(--tl-color-danger)}.tlui-a11y-audit{border-collapse:collapse}.tlui-a11y-audit td,.tlui-a11y-audit th{padding:8px;border:1px solid var(--tl-color-low-border)}.tlui-toast__viewport{position:absolute;inset:0;margin:0;display:flex;align-items:flex-end;justify-content:flex-end;flex-direction:column;gap:var(--tl-space-3);pointer-events:none;padding:0 var(--tl-space-3) 64px 0;z-index:var(--tl-layer-toasts)}.tl-container[dir=rtl] .tlui-toast__viewport{padding:0 0 64px var(--tl-space-3)}.tlui-toast__viewport>*{pointer-events:all}.tlui-toast__icon{padding-top:11px;padding-inline-start:var(--tl-space-4);color:var(--tl-color-text-1)}.tlui-toast__container{min-width:200px;display:flex;flex-direction:row;background-color:var(--tl-color-panel);box-shadow:var(--tl-shadow-2);border-radius:var(--tl-radius-3);font-size:12px}.tlui-toast__container[data-severity=success] .tlui-icon{color:var(--tl-color-success)}.tlui-toast__container[data-severity=info] .tlui-icon{color:var(--tl-color-info)}.tlui-toast__container[data-severity=warning] .tlui-icon{color:var(--tl-color-warning)}.tlui-toast__container[data-severity=error] .tlui-icon{color:var(--tl-color-danger)}.tlui-toast__main{flex-grow:2;max-width:280px;min-width:0}.tlui-toast__content{padding:var(--tl-space-4);display:flex;line-height:1.4;flex-direction:column;gap:var(--tl-space-3);min-width:0}.tlui-toast__main[data-actions=true] .tlui-toast__content{padding-bottom:var(--tl-space-2)}.tlui-toast__title{font-weight:700;line-height:16px}.tlui-toast__description,.tlui-toast__title{color:var(--tl-color-text-1);overflow-wrap:anywhere}.tlui-toast__description{margin:0;padding:0}.tlui-toast__icon+.tlui-toast__main>.tlui-toast__actions{padding-left:0}.tlui-toast__actions{display:flex;flex-direction:row;justify-content:flex-start;margin-left:0}.tlui-toast__close{align-self:flex-end;flex-shrink:0}@media (prefers-reduced-motion:no-preference){.tlui-toast__container[data-state=open]{animation:tlui-slide-in .2s cubic-bezier(.785,.135,.15,.86)}.tlui-toast__container[data-state=closed]{animation:tlui-fade-out .1s ease-in}.tlui-toast__container[data-swipe=move]{transform:translateX(var(--radix-toast-swipe-move-x))}.tlui-toast__container[data-swipe=cancel]{transform:translateX(0);transition:transform .2s ease-out}.tlui-toast__container[data-swipe=end]{animation:tlui-slide-out .1s ease-out}.tl-container[dir=rtl] .tlui-toast__container[data-state=open]{animation:tlui-slide-in-rtl .2s cubic-bezier(.785,.135,.15,.86)}.tl-container[dir=rtl] .tlui-toast__container[data-state=closed]{animation:tlui-fade-out .1s ease-in}.tl-container[dir=rtl] .tlui-toast__container[data-swipe=end]{animation:tlui-slide-out-rtl .1s ease-out}}.tlui-dialog__overlay{background-color:var(--tl-color-overlay);animation:tl-fade-in .12s ease-out}.tlui-dialog__overlay,.tlui-dialog__positioner{position:absolute;top:0;left:0;width:100%;height:100%;z-index:var(--tl-layer-canvas-overlays)}.tlui-dialog__positioner{pointer-events:all;display:grid;place-items:center;overflow-y:auto;padding:0 var(--tl-space-3)}.tlui-dialog__content{display:flex;flex-direction:column;position:relative;cursor:default;background-color:var(--tl-color-panel);box-shadow:var(--tl-shadow-3);border-radius:var(--tl-radius-3);font-size:12px;overflow:hidden;min-width:300px;max-width:100%;max-height:80%}.tlui-dialog__header{position:relative;display:flex;align-items:center;flex:0;z-index:var(--tl-layer-header-footer);padding-inline-start:var(--tl-space-4);color:var(--tl-color-text);height:40px}.tlui-dialog__header__title{flex:1;font-weight:inherit;font-size:12px;margin:0;color:var(--tl-color-text-1)}.tlui-dialog__header__close{justify-self:flex-end}.tlui-dialog__body{padding:var(--tl-space-4) var(--tl-space-4);flex:0 1;overflow-y:auto;overflow-x:hidden;color:var(--tl-color-text-1);user-select:all;-webkit-user-select:text;overflow-wrap:anywhere}.tlui-dialog__body a{color:var(--tl-color-selected)}.tlui-dialog__body ol,.tlui-dialog__body ul{padding-left:16px;display:flex;flex-direction:column;gap:var(--tl-space-2)}.tlui-dialog__footer{position:relative;min-height:12px;z-index:var(--tl-layer-header-footer)}.tlui-dialog__footer__actions{display:flex;align-items:center;justify-content:flex-end}.tlui-dialog__footer__actions>.tlui-button:nth-last-child(n+2){margin-right:-4px}.tlui-edit-link-dialog{display:flex;flex-direction:column;gap:var(--tl-space-4);color:var(--tl-color-text)}.tlui-edit-link-dialog__input{background-color:var(--tl-color-muted-2);flex-grow:2;border-radius:var(--tl-radius-2);padding:0 var(--tl-space-4)}.tlui-embed__spacer{flex-grow:2;min-height:0;margin-left:calc(-1 * var(--tl-space-4));margin-top:calc(-1 * var(--tl-space-4));pointer-events:none}.tlui-embed-dialog__list{display:flex;flex-direction:column;padding:0 var(--tl-space-3) var(--tl-space-4) var(--tl-space-3)}.tlui-embed-dialog__item__image{width:24px;height:24px;display:flex;align-items:center;justify-content:center;background-size:contain;background-repeat:no-repeat;background-position:50%;background-color:var(--tl-color-selected-contrast);border-radius:var(--tl-radius-1)}.tlui-embed-dialog__enter{display:flex;flex-direction:column;gap:var(--tl-space-4);color:var(--tl-color-text-1)}.tlui-embed-dialog__input{background-color:var(--tl-color-muted-2);flex-grow:2;border-radius:var(--tl-radius-2);padding:0 var(--tl-space-4)}.tlui-embed-dialog__warning{color:var(--tl-color-danger);text-shadow:none}.tlui-embed-dialog__instruction__link{display:flex;gap:var(--tl-space-1);margin-top:var(--tl-space-4)}.tlui-embed-dialog__enter a{color:var(--tl-color-text-1)}.tlui-shortcuts-dialog__header{border-bottom:1px solid var(--tl-color-divider)}.tlui-shortcuts-dialog__body{position:relative;column-count:3;column-gap:var(--tl-space-9);pointer-events:all;touch-action:auto;overflow-x:auto;scrollbar-width:none}.tlui-shortcuts-dialog__body::-webkit-scrollbar{display:none}.tlui-shortcuts-dialog__body__tablet{column-count:2}.tlui-shortcuts-dialog__body__mobile{column-count:1}.tlui-shortcuts-dialog__group{break-inside:avoid-column;padding-bottom:var(--tl-space-6)}.tlui-shortcuts-dialog__group__title{font-size:inherit;font-weight:inherit;margin:0;color:var(--tl-color-text-3);height:32px;display:flex;align-items:center}.tlui-shortcuts-dialog__group__content{display:flex;flex-direction:column;color:var(--tl-color-text-1)}.tlui-shortcuts-dialog__key-pair{display:flex;gap:var(--tl-space-4);align-items:center;justify-content:space-between;height:32px}.tlui-shortcuts-dialog__key-pair__key{flex:1;font-size:12px}.tlui-language-menu{max-height:500px}.tlui-language-menu:after{content:"";display:block;position:absolute;bottom:0;left:0;right:0;height:24px;background:linear-gradient(to bottom,var(--tl-color-panel-transparent) 0,var(--tl-color-panel) 90%,var(--tl-color-panel) 100%);border-bottom-left-radius:var(--tl-radius-3);border-bottom-right-radius:var(--tl-radius-3);pointer-events:none}.tlui-actions-menu{max-height:calc(100vh - 150px)}.tlui-help-menu{pointer-events:all;position:absolute;bottom:var(--tl-space-2);right:var(--tl-space-2);z-index:var(--tl-layer-panels);border:2px solid var(--tl-color-background);border-radius:100%}.tlui-share-zone{flex-direction:row;z-index:var(--tl-layer-panels);padding:2px 4px 0 0}.tlui-people-menu__avatars-button,.tlui-share-zone{display:flex;justify-content:flex-end;align-items:center}.tlui-people-menu__avatars-button{background:none;border:none;cursor:pointer;pointer-events:all;border-radius:var(--tl-radius-1);padding-right:1px;height:100%}.tlui-people-menu__avatars{display:flex;flex-direction:row}.tlui-people-menu__avatar{height:24px;width:24px;border:2px solid var(--tl-color-background);background-color:var(--tl-color-low);border-radius:100%;display:flex;align-items:center;justify-content:center;position:relative;font-size:10px;font-weight:700;text-align:center;color:var(--tl-color-selected-contrast);z-index:2}.tlui-people-menu__avatar:nth-of-type(n+2){margin-inline-start:-12px}.tlui-people-menu__avatars-button[data-state=open]{opacity:1}@media (hover:hover){.tlui-people-menu__avatars-button:hover .tlui-people-menu__avatar{border-color:var(--tl-color-low)}}.tlui-people-menu__more{min-width:0;font-size:11px;font-weight:600;color:var(--tl-color-text-1);font-family:inherit;padding:0 4px}.tlui-people-menu__more:after{border-radius:var(--tl-radius-2);inset:0}.tlui-people-menu__wrapper{position:relative;display:flex;flex-direction:column;width:220px;height:fit-content;max-height:50vh}.tlui-people-menu__section{position:relative;flex-direction:column;max-height:100%;overflow-x:hidden;overflow-y:auto;touch-action:auto}.tlui-people-menu__section:first-child,.tlui-people-menu__section:last-child{flex-shrink:0}.tlui-people-menu__section:not(:last-child){border-bottom:1px solid var(--tl-color-divider)}.tlui-people-menu__user{display:flex;justify-content:flex-start;align-items:center}.tlui-people-menu__user__color{flex-shrink:0}.tlui-people-menu__user__name{color:var(--tl-color-text-1);max-width:100%;flex-grow:1;flex-shrink:100}.tlui-people-menu__user__label,.tlui-people-menu__user__name{text-align:start;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}.tlui-people-menu__user__label{color:var(--tl-color-text-3);flex-grow:100;flex-shrink:0;margin-inline-start:4px}.tlui-people-menu__user__input{flex-grow:2;height:100%;padding:0;margin:0}.tlui-people-menu__user>.tlui-input__wrapper{width:auto;display:flex;align-items:auto;flex-grow:2;gap:8px;height:100%;padding:0}.tlui-people-menu__item{position:relative}.tlui-people-menu__item:last-of-type .tlui-button__menu{margin-bottom:0}.tlui-people-menu__item__button{padding:0 11px;overflow:hidden}.tlui-people-menu__item>.tlui-button__menu{width:auto;display:flex;align-items:auto;justify-content:flex-start;flex-grow:2;gap:11px}.tlui-people-menu__name{text-align:start;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tlui-people-menu__item__follow{position:absolute;top:0;inset-inline-end:0;max-width:40px;flex-shrink:0}.tlui-people-menu__item:has(.tlui-button:focus-visible),.tlui-people-menu__item[data-follow=true]{padding-inline-end:36px}.tlui-people-menu__item:has(.tlui-button:focus-visible) .tlui-people-menu__item__follow,.tlui-people-menu__item[data-follow=true] .tlui-people-menu__item__follow{opacity:1}@media (hover:hover){.tlui-people-menu__item__follow{opacity:0}.tlui-people-menu__item:hover{padding-right:36px}.tlui-people-menu__item:hover .tlui-people-menu__item__follow{opacity:1}}.tlui-following-indicator{display:block;position:absolute;inset:0;border-width:2px;border-style:solid;pointer-events:none}.tlui-contextual-toolbar{position:absolute}.tlui-contextual-toolbar,.tlui-contextual-toolbar *{pointer-events:all}.tlui-contextual-toolbar [data-isactive=true]:after{background-color:var(--tl-color-muted-2);opacity:1}.tlui-contextual-toolbar{opacity:0;transition:opacity .08s ease-in-out}.tlui-contextual-toolbar,.tlui-contextual-toolbar *{pointer-events:none}.tlui-contextual-toolbar[data-visible=true]{opacity:1;z-index:var(--tl-layer-menus)}.tlui-contextual-toolbar[data-interactive=true],.tlui-contextual-toolbar[data-interactive=true] *{pointer-events:all}.tlui-rich-text__toolbar-link-input{margin-left:12px;width:148px}.tlui-media__toolbar-alt-text-input{margin-left:12px;min-width:200px}.tlui-contextual-toolbar .tlui-input__wrapper{height:40px}.tlui-image__toolbar .tlui-slider__container{width:125px}.tlui-image__toolbar .tlui-slider{height:100%}.tlui-image__toolbar .tlui-slider__track{height:32px}.tlui-image__toolbar .tlui-slider__thumb{width:14px;height:14px}@keyframes tlui-fade-out{0%{opacity:1}to{opacity:0}}@keyframes tlui-slide-in{0%{transform:translateX(calc(100% + var(--tl-space-3)))}to{transform:translateX(0)}}@keyframes tlui-slide-out{0%{transform:translateX(var(--radix-toast-swipe-end-x))}to{transform:translateX(calc(100% + var(--tl-space-3)))}}@keyframes tlui-slide-in-rtl{0%{transform:translateX(calc(-100% - var(--tl-space-3)))}to{transform:translateX(0)}}@keyframes tlui-slide-out-rtl{0%{transform:translateX(var(--radix-toast-swipe-end-x))}to{transform:translateX(calc(-100% - var(--tl-space-3)))}}