reflex-agent 0.18.2 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (313) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +101 -102
  3. package/.next/app-path-routes-manifest.json +9 -9
  4. package/.next/build-manifest.json +5 -5
  5. package/.next/prerender-manifest.json +3 -3
  6. package/.next/react-loadable-manifest.json +1 -1
  7. package/.next/required-server-files.json +2 -1
  8. package/.next/server/app/_not-found/page.js +1 -1
  9. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  10. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  11. package/.next/server/app/agents/[agentId]/page.js +2 -2
  12. package/.next/server/app/agents/[agentId]/page.js.nft.json +1 -1
  13. package/.next/server/app/agents/[agentId]/page_client-reference-manifest.js +1 -1
  14. package/.next/server/app/api/agents/[agentId]/respond/route.js +1 -1
  15. package/.next/server/app/api/agents/[agentId]/respond/route.js.nft.json +1 -1
  16. package/.next/server/app/api/agents/[agentId]/respond/route_client-reference-manifest.js +1 -1
  17. package/.next/server/app/api/images/[rootId]/[file]/route.js +1 -1
  18. package/.next/server/app/api/images/[rootId]/[file]/route_client-reference-manifest.js +1 -1
  19. package/.next/server/app/api/oauth/callback/route.js +2 -2
  20. package/.next/server/app/api/oauth/callback/route_client-reference-manifest.js +1 -1
  21. package/.next/server/app/api/oauth/start/route.js +1 -1
  22. package/.next/server/app/api/oauth/start/route_client-reference-manifest.js +1 -1
  23. package/.next/server/app/api/roots/[id]/attachments/route.js +0 -0
  24. package/.next/server/app/api/roots/[id]/attachments/route_client-reference-manifest.js +1 -1
  25. package/.next/server/app/api/roots/[id]/chat/[topicId]/send/route.js +1 -1
  26. package/.next/server/app/api/roots/[id]/chat/[topicId]/send/route.js.nft.json +1 -1
  27. package/.next/server/app/api/roots/[id]/chat/[topicId]/send/route_client-reference-manifest.js +1 -1
  28. package/.next/server/app/api/roots/[id]/chat/[topicId]/stop/route.js +1 -1
  29. package/.next/server/app/api/roots/[id]/chat/[topicId]/stop/route.js.nft.json +1 -1
  30. package/.next/server/app/api/roots/[id]/chat/[topicId]/stop/route_client-reference-manifest.js +1 -1
  31. package/.next/server/app/api/roots/[id]/chat/[topicId]/stream/route.js +2 -2
  32. package/.next/server/app/api/roots/[id]/chat/[topicId]/stream/route.js.nft.json +1 -1
  33. package/.next/server/app/api/roots/[id]/chat/[topicId]/stream/route_client-reference-manifest.js +1 -1
  34. package/.next/server/app/api/roots/[id]/dashboard/route.js +1 -1
  35. package/.next/server/app/api/roots/[id]/dashboard/route.js.nft.json +1 -1
  36. package/.next/server/app/api/roots/[id]/dashboard/route_client-reference-manifest.js +1 -1
  37. package/.next/server/app/api/roots/[id]/suggestions/route.js +1 -1
  38. package/.next/server/app/api/roots/[id]/suggestions/route.js.nft.json +1 -1
  39. package/.next/server/app/api/roots/[id]/suggestions/route_client-reference-manifest.js +1 -1
  40. package/.next/server/app/api/utilities/[scope]/[id]/bundle.js/route_client-reference-manifest.js +1 -1
  41. package/.next/server/app/api/utilities/[scope]/[id]/host/route.js +1 -1
  42. package/.next/server/app/api/utilities/[scope]/[id]/host/route.js.nft.json +1 -1
  43. package/.next/server/app/api/utilities/[scope]/[id]/host/route_client-reference-manifest.js +1 -1
  44. package/.next/server/app/api/utilities/[scope]/[id]/host-api.mjs/route_client-reference-manifest.js +1 -1
  45. package/.next/server/app/api/utilities/[scope]/[id]/host-ui.mjs/route_client-reference-manifest.js +1 -1
  46. package/.next/server/app/api/utilities/[scope]/[id]/iframe/route_client-reference-manifest.js +1 -1
  47. package/.next/server/app/api/utilities/[scope]/[id]/style.css/route_client-reference-manifest.js +1 -1
  48. package/.next/server/app/api/utilities/install-archive/route_client-reference-manifest.js +1 -1
  49. package/.next/server/app/audit/page.js +2 -2
  50. package/.next/server/app/audit/page.js.nft.json +1 -1
  51. package/.next/server/app/audit/page_client-reference-manifest.js +1 -1
  52. package/.next/server/app/dispatcher/page.js +2 -2
  53. package/.next/server/app/dispatcher/page.js.nft.json +1 -1
  54. package/.next/server/app/dispatcher/page_client-reference-manifest.js +1 -1
  55. package/.next/server/app/onboarding/page.js +3 -3
  56. package/.next/server/app/onboarding/page.js.nft.json +1 -1
  57. package/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  58. package/.next/server/app/page.js +2 -2
  59. package/.next/server/app/page.js.nft.json +1 -1
  60. package/.next/server/app/page_client-reference-manifest.js +1 -1
  61. package/.next/server/app/roots/[id]/chat/[topicId]/page.js +2 -2
  62. package/.next/server/app/roots/[id]/chat/[topicId]/page.js.nft.json +1 -1
  63. package/.next/server/app/roots/[id]/chat/[topicId]/page_client-reference-manifest.js +1 -1
  64. package/.next/server/app/roots/[id]/kb/[...slug]/page.js +2 -2
  65. package/.next/server/app/roots/[id]/kb/[...slug]/page.js.nft.json +1 -1
  66. package/.next/server/app/roots/[id]/kb/[...slug]/page_client-reference-manifest.js +1 -1
  67. package/.next/server/app/roots/[id]/memory/page.js +2 -2
  68. package/.next/server/app/roots/[id]/memory/page.js.nft.json +1 -1
  69. package/.next/server/app/roots/[id]/memory/page_client-reference-manifest.js +1 -1
  70. package/.next/server/app/roots/[id]/page.js +4 -4
  71. package/.next/server/app/roots/[id]/page.js.nft.json +1 -1
  72. package/.next/server/app/roots/[id]/page_client-reference-manifest.js +1 -1
  73. package/.next/server/app/roots/[id]/workflows/[wfId]/page.js +2 -2
  74. package/.next/server/app/roots/[id]/workflows/[wfId]/page.js.nft.json +1 -1
  75. package/.next/server/app/roots/[id]/workflows/[wfId]/page_client-reference-manifest.js +1 -1
  76. package/.next/server/app/roots/[id]/workflows/page.js +2 -2
  77. package/.next/server/app/roots/[id]/workflows/page.js.nft.json +1 -1
  78. package/.next/server/app/roots/[id]/workflows/page_client-reference-manifest.js +1 -1
  79. package/.next/server/app/roots/new/page.js +4 -4
  80. package/.next/server/app/roots/new/page.js.nft.json +1 -1
  81. package/.next/server/app/roots/new/page_client-reference-manifest.js +1 -1
  82. package/.next/server/app/settings/page.js +5 -5
  83. package/.next/server/app/settings/page.js.nft.json +1 -1
  84. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  85. package/.next/server/app/share/[id]/file/page.js +2 -2
  86. package/.next/server/app/share/[id]/file/page.js.nft.json +1 -1
  87. package/.next/server/app/share/[id]/file/page_client-reference-manifest.js +1 -1
  88. package/.next/server/app/share/[id]/page.js +2 -2
  89. package/.next/server/app/share/[id]/page.js.nft.json +1 -1
  90. package/.next/server/app/share/[id]/page_client-reference-manifest.js +1 -1
  91. package/.next/server/app/utilities/[scope]/[id]/page.js +2 -2
  92. package/.next/server/app/utilities/[scope]/[id]/page.js.nft.json +1 -1
  93. package/.next/server/app/utilities/[scope]/[id]/page_client-reference-manifest.js +1 -1
  94. package/.next/server/app/utilities/page.js +2 -2
  95. package/.next/server/app/utilities/page.js.nft.json +1 -1
  96. package/.next/server/app/utilities/page_client-reference-manifest.js +1 -1
  97. package/.next/server/app-paths-manifest.json +9 -9
  98. package/.next/server/chunks/{6435.js → 1088.js} +1 -1
  99. package/.next/server/chunks/1105.js +1 -1
  100. package/.next/server/chunks/1179.js +1 -0
  101. package/.next/server/chunks/1223.js +1 -1
  102. package/.next/server/chunks/1244.js +1 -1
  103. package/.next/server/chunks/1281.js +80 -0
  104. package/.next/server/chunks/1336.js +252 -0
  105. package/.next/server/chunks/1353.js +51 -0
  106. package/.next/server/chunks/1431.js +1 -0
  107. package/.next/server/chunks/146.js +2 -0
  108. package/.next/server/chunks/1491.js +79 -0
  109. package/.next/server/chunks/1496.js +148 -0
  110. package/.next/server/chunks/{9631.js → 1589.js} +2 -2
  111. package/.next/server/chunks/1623.js +1 -0
  112. package/.next/server/chunks/1862.js +77 -0
  113. package/.next/server/chunks/1888.js +1 -1
  114. package/.next/server/chunks/1908.js +1 -0
  115. package/.next/server/chunks/192.js +1 -0
  116. package/.next/server/chunks/2069.js +1 -0
  117. package/.next/server/chunks/2087.js +24 -0
  118. package/.next/server/chunks/209.js +1 -0
  119. package/.next/server/chunks/2115.js +77 -0
  120. package/.next/server/chunks/2232.js +80 -0
  121. package/.next/server/chunks/{4460.js → 2262.js} +2 -2
  122. package/.next/server/chunks/2280.js +1 -0
  123. package/.next/server/chunks/2433.js +1 -1
  124. package/.next/server/chunks/2485.js +3 -8
  125. package/.next/server/chunks/2503.js +1 -1
  126. package/.next/server/chunks/2539.js +93 -0
  127. package/.next/server/chunks/2764.js +80 -0
  128. package/.next/server/chunks/285.js +24 -75
  129. package/.next/server/chunks/2888.js +7 -0
  130. package/.next/server/chunks/302.js +1 -0
  131. package/.next/server/chunks/3029.js +36 -0
  132. package/.next/server/chunks/3110.js +0 -0
  133. package/.next/server/chunks/3117.js +1 -0
  134. package/.next/server/chunks/3258.js +23 -0
  135. package/.next/server/chunks/331.js +1 -0
  136. package/.next/server/chunks/3332.js +1 -1
  137. package/.next/server/chunks/{4251.js → 3474.js} +24 -25
  138. package/.next/server/chunks/3552.js +43 -0
  139. package/.next/server/chunks/3583.js +104 -0
  140. package/.next/server/chunks/3631.js +1 -0
  141. package/.next/server/chunks/3633.js +1 -0
  142. package/.next/server/chunks/383.js +1 -80
  143. package/.next/server/chunks/3834.js +1 -1
  144. package/.next/server/chunks/3953.js +1 -0
  145. package/.next/server/chunks/3992.js +1 -0
  146. package/.next/server/chunks/4013.js +1 -0
  147. package/.next/server/chunks/4031.js +3 -3
  148. package/.next/server/chunks/4119.js +1 -0
  149. package/.next/server/chunks/4230.js +12 -0
  150. package/.next/server/chunks/4250.js +1 -0
  151. package/.next/server/chunks/4294.js +1 -0
  152. package/.next/server/chunks/4312.js +1 -0
  153. package/.next/server/chunks/4342.js +1 -0
  154. package/.next/server/chunks/4360.js +1 -0
  155. package/.next/server/chunks/449.js +226 -0
  156. package/.next/server/chunks/4578.js +0 -0
  157. package/.next/server/chunks/4585.js +1 -0
  158. package/.next/server/chunks/4611.js +1 -1
  159. package/.next/server/chunks/4639.js +1 -0
  160. package/.next/server/chunks/4682.js +1 -0
  161. package/.next/server/chunks/4788.js +153 -0
  162. package/.next/server/chunks/4812.js +2 -2
  163. package/.next/server/chunks/4925.js +1 -1
  164. package/.next/server/chunks/4952.js +1 -0
  165. package/.next/server/chunks/4969.js +4 -1
  166. package/.next/server/chunks/4989.js +801 -0
  167. package/.next/server/chunks/5211.js +64 -0
  168. package/.next/server/chunks/5243.js +1 -1
  169. package/.next/server/chunks/5308.js +1 -0
  170. package/.next/server/chunks/5461.js +1 -0
  171. package/.next/server/chunks/5549.js +1 -0
  172. package/.next/server/chunks/5719.js +34 -0
  173. package/.next/server/chunks/5810.js +12 -0
  174. package/.next/server/chunks/5922.js +1 -0
  175. package/.next/server/chunks/6142.js +1 -1
  176. package/.next/server/chunks/6216.js +1 -1
  177. package/.next/server/chunks/6318.js +9 -0
  178. package/.next/server/chunks/6483.js +1 -1
  179. package/.next/server/chunks/6509.js +1 -0
  180. package/.next/server/chunks/6571.js +166 -0
  181. package/.next/server/chunks/660.js +1 -0
  182. package/.next/server/chunks/6692.js +1 -0
  183. package/.next/server/chunks/6730.js +1 -1
  184. package/.next/server/chunks/6852.js +1 -0
  185. package/.next/server/chunks/6970.js +1 -0
  186. package/.next/server/chunks/7007.js +1 -0
  187. package/.next/server/chunks/7188.js +1 -1
  188. package/.next/server/chunks/7220.js +1 -1
  189. package/.next/server/chunks/7228.js +1 -0
  190. package/.next/server/chunks/7244.js +1 -0
  191. package/.next/server/chunks/7373.js +90 -0
  192. package/.next/server/chunks/7430.js +1 -1
  193. package/.next/server/chunks/7523.js +1 -0
  194. package/.next/server/chunks/7576.js +1 -0
  195. package/.next/server/chunks/7742.js +7 -0
  196. package/.next/server/chunks/7811.js +215 -0
  197. package/.next/server/chunks/7885.js +1 -0
  198. package/.next/server/chunks/8032.js +3 -0
  199. package/.next/server/chunks/8095.js +24 -0
  200. package/.next/server/chunks/8129.js +5 -0
  201. package/.next/server/chunks/8294.js +1 -0
  202. package/.next/server/chunks/832.js +1 -0
  203. package/.next/server/chunks/8464.js +180 -0
  204. package/.next/server/chunks/8511.js +0 -0
  205. package/.next/server/chunks/8514.js +1 -1
  206. package/.next/server/chunks/8583.js +4 -0
  207. package/.next/server/chunks/8609.js +55 -0
  208. package/.next/server/chunks/8711.js +1 -0
  209. package/.next/server/chunks/8714.js +1 -0
  210. package/.next/server/chunks/8730.js +1 -0
  211. package/.next/server/chunks/8868.js +1 -0
  212. package/.next/server/chunks/9048.js +1 -0
  213. package/.next/server/chunks/9058.js +1 -0
  214. package/.next/server/chunks/9062.js +1 -0
  215. package/.next/server/chunks/9094.js +1 -0
  216. package/.next/server/chunks/9098.js +1 -1
  217. package/.next/server/chunks/9099.js +1 -0
  218. package/.next/server/chunks/9171.js +287 -0
  219. package/.next/server/chunks/9181.js +1 -0
  220. package/.next/server/chunks/9293.js +1 -1
  221. package/.next/server/chunks/9478.js +1 -0
  222. package/.next/server/chunks/9494.js +141 -0
  223. package/.next/server/chunks/952.js +1 -0
  224. package/.next/server/chunks/9600.js +1 -0
  225. package/.next/server/chunks/9607.js +29 -0
  226. package/.next/server/chunks/9653.js +115 -0
  227. package/.next/server/chunks/9784.js +1 -0
  228. package/.next/server/chunks/9798.js +1 -0
  229. package/.next/server/chunks/9990.js +1 -0
  230. package/.next/server/edge-instrumentation.js +2 -0
  231. package/.next/server/edge-instrumentation.js.map +1 -0
  232. package/.next/server/functions-config-manifest.json +3 -3
  233. package/.next/server/instrumentation.js +1 -0
  234. package/.next/server/instrumentation.js.nft.json +1 -0
  235. package/.next/server/middleware-build-manifest.js +1 -1
  236. package/.next/server/middleware-manifest.json +6 -5
  237. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  238. package/.next/server/pages/500.html +1 -1
  239. package/.next/server/pages/_error.js +3 -3
  240. package/.next/server/server-reference-manifest.js +1 -1
  241. package/.next/server/server-reference-manifest.json +1 -1
  242. package/.next/static/chunks/3363-f417b308a8cd156d.js +1 -0
  243. package/.next/static/chunks/3686-0107521d2c14950c.js +1 -0
  244. package/.next/static/chunks/3695-3576767108de7f38.js +1 -0
  245. package/.next/static/chunks/4108.19abaa6d618295ed.js +1 -0
  246. package/.next/static/chunks/5933-4013a6dab4565b5e.js +1 -0
  247. package/.next/static/chunks/7425-9684ea815b4b1731.js +1 -0
  248. package/.next/static/chunks/7552-def8a17828891c8c.js +1 -0
  249. package/.next/static/chunks/8776-2df966dd98c68fd7.js +1 -0
  250. package/.next/static/chunks/app/layout-baad68d32b917b8f.js +1 -0
  251. package/.next/static/chunks/app/onboarding/page-b1b1e6a4467ed781.js +1 -0
  252. package/.next/static/chunks/app/page-556a2139313c3c71.js +1 -0
  253. package/.next/static/chunks/app/roots/[id]/chat/[topicId]/page-52223811258d07b2.js +1 -0
  254. package/.next/static/chunks/app/roots/[id]/kb/[...slug]/page-0df769f27549cd16.js +1 -0
  255. package/.next/static/chunks/app/roots/[id]/memory/{page-4edc11023d8a13fd.js → page-1f6bc3a624b141a5.js} +1 -1
  256. package/.next/static/chunks/app/roots/[id]/page-17493991b2d391b3.js +1 -0
  257. package/.next/static/chunks/app/roots/[id]/workflows/[wfId]/page-a21fe3541418a80a.js +1 -0
  258. package/.next/static/chunks/app/roots/[id]/workflows/page-0952e5fb53d53c3e.js +1 -0
  259. package/.next/static/chunks/app/roots/new/{page-98d64261cc2ae2a1.js → page-4f571184c1856103.js} +1 -1
  260. package/.next/static/chunks/app/settings/page-8c0ad1c1856da988.js +1 -0
  261. package/.next/static/chunks/app/share/[id]/page-b27a0bc7b9c6cda9.js +1 -0
  262. package/.next/static/chunks/app/utilities/[scope]/[id]/page-0fe4c377098064d5.js +1 -0
  263. package/.next/static/chunks/app/utilities/page-445933dcd5a500ae.js +1 -0
  264. package/.next/static/chunks/{webpack-dbfe1e5d0f7f7a98.js → webpack-88066a85eb2d605f.js} +1 -1
  265. package/.next/trace +116 -90
  266. package/dist/lib/reflex/ids.js +66 -0
  267. package/dist/lib/reflex/ids.js.map +1 -0
  268. package/dist/lib/reflex/paths.js +26 -0
  269. package/dist/lib/reflex/paths.js.map +1 -1
  270. package/dist/lib/reflex/store/json-store.js +50 -0
  271. package/dist/lib/reflex/store/json-store.js.map +1 -0
  272. package/package.json +10 -6
  273. package/.next/server/chunks/133.js +0 -1
  274. package/.next/server/chunks/1358.js +0 -1
  275. package/.next/server/chunks/2389.js +0 -4
  276. package/.next/server/chunks/2787.js +0 -1
  277. package/.next/server/chunks/3240.js +0 -1
  278. package/.next/server/chunks/3295.js +0 -1
  279. package/.next/server/chunks/4842.js +0 -1
  280. package/.next/server/chunks/5319.js +0 -1
  281. package/.next/server/chunks/5543.js +0 -1
  282. package/.next/server/chunks/569.js +0 -1
  283. package/.next/server/chunks/6356.js +0 -3
  284. package/.next/server/chunks/7229.js +0 -2
  285. package/.next/server/chunks/7607.js +0 -1
  286. package/.next/server/chunks/8040.js +0 -1
  287. package/.next/server/chunks/8124.js +0 -1
  288. package/.next/server/chunks/8576.js +0 -7
  289. package/.next/server/chunks/9809.js +0 -1
  290. package/.next/server/chunks/9835.js +0 -1
  291. package/.next/static/chunks/2885-3b6efe9070ae7699.js +0 -1
  292. package/.next/static/chunks/334-e9ffb96d6720ee5b.js +0 -1
  293. package/.next/static/chunks/4108.a04c1e0b768f6392.js +0 -1
  294. package/.next/static/chunks/5371-f2503fe0dffea57d.js +0 -1
  295. package/.next/static/chunks/5744-eccd279a734c778c.js +0 -1
  296. package/.next/static/chunks/6568-e4d2de23d9f8d347.js +0 -1
  297. package/.next/static/chunks/6642-02be14d0b5ca62b7.js +0 -1
  298. package/.next/static/chunks/8566-5d4c89b722d9cee1.js +0 -1
  299. package/.next/static/chunks/8775-890699c74c28df61.js +0 -1
  300. package/.next/static/chunks/app/layout-48a6fb46c228b814.js +0 -1
  301. package/.next/static/chunks/app/onboarding/page-06103f281ff3f063.js +0 -1
  302. package/.next/static/chunks/app/page-eed31ba1b952cf24.js +0 -1
  303. package/.next/static/chunks/app/roots/[id]/chat/[topicId]/page-5fc17c5819406917.js +0 -1
  304. package/.next/static/chunks/app/roots/[id]/kb/[...slug]/page-a52b2005a7e538ca.js +0 -1
  305. package/.next/static/chunks/app/roots/[id]/page-0f0d498f4b4bd7bf.js +0 -1
  306. package/.next/static/chunks/app/roots/[id]/workflows/[wfId]/page-f93d6b1bb29e79f0.js +0 -1
  307. package/.next/static/chunks/app/roots/[id]/workflows/page-562913d54bcd08d5.js +0 -1
  308. package/.next/static/chunks/app/settings/page-7a4d8a407fbe5ed8.js +0 -1
  309. package/.next/static/chunks/app/share/[id]/page-a0540dba09771e84.js +0 -1
  310. package/.next/static/chunks/app/utilities/[scope]/[id]/page-2cee9be029f211c6.js +0 -1
  311. package/.next/static/chunks/app/utilities/page-197156f16167514e.js +0 -1
  312. /package/.next/static/{kKiRbrTiD77WXduAvKNfN → EXoiX_YvMRCB6oNXqJnaz}/_buildManifest.js +0 -0
  313. /package/.next/static/{kKiRbrTiD77WXduAvKNfN → EXoiX_YvMRCB6oNXqJnaz}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ "use strict";exports.id=4952,exports.ids=[4952],exports.modules={84952:(a,b,c)=>{c.d(b,{diagram:()=>ab});var d,e=c(77076),f=c(88745),g=c(28056),h=c(6850),i=c(24613),j=c(14861),k=function(){var a=(0,i.K2)(function(a,b,c,d){for(c=c||{},d=a.length;d--;c[a[d]]=b);return c},"o"),b=[1,10,12,14,16,18,19,21,23],c=[2,6],d=[1,3],e=[1,5],f=[1,6],g=[1,7],h=[1,5,10,12,14,16,18,19,21,23,34,35,36],j=[1,25],k=[1,26],l=[1,28],m=[1,29],n=[1,30],o=[1,31],p=[1,32],q=[1,33],r=[1,34],s=[1,35],t=[1,36],u=[1,37],v=[1,43],w=[1,42],x=[1,47],y=[1,50],z=[1,10,12,14,16,18,19,21,23,34,35,36],A=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],B=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],C=[1,64],D={trace:(0,i.K2)(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:(0,i.K2)(function(a,b,c,d,e,f,g){var h=f.length-1;switch(e){case 5:d.setOrientation(f[h]);break;case 9:d.setDiagramTitle(f[h].text.trim());break;case 12:d.setLineData({text:"",type:"text"},f[h]);break;case 13:d.setLineData(f[h-1],f[h]);break;case 14:d.setBarData({text:"",type:"text"},f[h]);break;case 15:d.setBarData(f[h-1],f[h]);break;case 16:this.$=f[h].trim(),d.setAccTitle(this.$);break;case 17:case 18:this.$=f[h].trim(),d.setAccDescription(this.$);break;case 19:case 27:this.$=f[h-1];break;case 20:this.$=[Number(f[h-2]),...f[h]];break;case 21:this.$=[Number(f[h])];break;case 22:d.setXAxisTitle(f[h]);break;case 23:d.setXAxisTitle(f[h-1]);break;case 24:d.setXAxisTitle({type:"text",text:""});break;case 25:d.setXAxisBand(f[h]);break;case 26:d.setXAxisRangeData(Number(f[h-2]),Number(f[h]));break;case 28:this.$=[f[h-2],...f[h]];break;case 29:this.$=[f[h]];break;case 30:d.setYAxisTitle(f[h]);break;case 31:d.setYAxisTitle(f[h-1]);break;case 32:d.setYAxisTitle({type:"text",text:""});break;case 33:d.setYAxisRangeData(Number(f[h-2]),Number(f[h]));break;case 37:case 38:this.$={text:f[h],type:"text"};break;case 39:this.$={text:f[h],type:"markdown"};break;case 40:this.$=f[h];break;case 41:this.$=f[h-1]+""+f[h]}},"anonymous"),table:[a(b,c,{3:1,4:2,7:4,5:d,34:e,35:f,36:g}),{1:[3]},a(b,c,{4:2,7:4,3:8,5:d,34:e,35:f,36:g}),a(b,c,{4:2,7:4,6:9,3:10,5:d,8:[1,11],34:e,35:f,36:g}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},a(h,[2,34]),a(h,[2,35]),a(h,[2,36]),{1:[2,1]},a(b,c,{4:2,7:4,3:21,5:d,34:e,35:f,36:g}),{1:[2,3]},a(h,[2,5]),a(b,[2,7],{4:22,34:e,35:f,36:g}),{11:23,37:24,38:j,39:k,40:27,41:l,42:m,43:n,44:o,45:p,46:q,47:r,48:s,49:t,50:u},{11:39,13:38,24:v,27:w,29:40,30:41,37:24,38:j,39:k,40:27,41:l,42:m,43:n,44:o,45:p,46:q,47:r,48:s,49:t,50:u},{11:45,15:44,27:x,33:46,37:24,38:j,39:k,40:27,41:l,42:m,43:n,44:o,45:p,46:q,47:r,48:s,49:t,50:u},{11:49,17:48,24:y,37:24,38:j,39:k,40:27,41:l,42:m,43:n,44:o,45:p,46:q,47:r,48:s,49:t,50:u},{11:52,17:51,24:y,37:24,38:j,39:k,40:27,41:l,42:m,43:n,44:o,45:p,46:q,47:r,48:s,49:t,50:u},{20:[1,53]},{22:[1,54]},a(z,[2,18]),{1:[2,2]},a(z,[2,8]),a(z,[2,9]),a(A,[2,37],{40:55,41:l,42:m,43:n,44:o,45:p,46:q,47:r,48:s,49:t,50:u}),a(A,[2,38]),a(A,[2,39]),a(B,[2,40]),a(B,[2,42]),a(B,[2,43]),a(B,[2,44]),a(B,[2,45]),a(B,[2,46]),a(B,[2,47]),a(B,[2,48]),a(B,[2,49]),a(B,[2,50]),a(B,[2,51]),a(z,[2,10]),a(z,[2,22],{30:41,29:56,24:v,27:w}),a(z,[2,24]),a(z,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:j,39:k,40:27,41:l,42:m,43:n,44:o,45:p,46:q,47:r,48:s,49:t,50:u},a(z,[2,11]),a(z,[2,30],{33:60,27:x}),a(z,[2,32]),{31:[1,61]},a(z,[2,12]),{17:62,24:y},{25:63,27:C},a(z,[2,14]),{17:65,24:y},a(z,[2,16]),a(z,[2,17]),a(B,[2,41]),a(z,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},a(z,[2,31]),{27:[1,69]},a(z,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},a(z,[2,15]),a(z,[2,26]),a(z,[2,27]),{11:59,32:72,37:24,38:j,39:k,40:27,41:l,42:m,43:n,44:o,45:p,46:q,47:r,48:s,49:t,50:u},a(z,[2,33]),a(z,[2,19]),{25:73,27:C},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:(0,i.K2)(function(a,b){if(b.recoverable)this.trace(a);else{var c=Error(a);throw c.hash=b,c}},"parseError"),parse:(0,i.K2)(function(a){var b=this,c=[0],d=[],e=[null],f=[],g=this.table,h="",j=0,k=0,l=0,m=f.slice.call(arguments,1),n=Object.create(this.lexer),o={};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(o[p]=this.yy[p]);n.setInput(a,o),o.lexer=n,o.parser=this,void 0===n.yylloc&&(n.yylloc={});var q=n.yylloc;f.push(q);var r=n.options&&n.options.ranges;function s(){var a;return"number"!=typeof(a=d.pop()||n.lex()||1)&&(a instanceof Array&&(a=(d=a).pop()),a=b.symbols_[a]||a),a}"function"==typeof o.parseError?this.parseError=o.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,i.K2)(function(a){c.length=c.length-2*a,e.length=e.length-a,f.length=f.length-a},"popStack"),(0,i.K2)(s,"lex");for(var t,u,v,w,x,y,z,A,B,C={};;){if(v=c[c.length-1],this.defaultActions[v]?w=this.defaultActions[v]:(null==t&&(t=s()),w=g[v]&&g[v][t]),void 0===w||!w.length||!w[0]){var D="";for(y in B=[],g[v])this.terminals_[y]&&y>2&&B.push("'"+this.terminals_[y]+"'");D=n.showPosition?"Parse error on line "+(j+1)+":\n"+n.showPosition()+"\nExpecting "+B.join(", ")+", got '"+(this.terminals_[t]||t)+"'":"Parse error on line "+(j+1)+": Unexpected "+(1==t?"end of input":"'"+(this.terminals_[t]||t)+"'"),this.parseError(D,{text:n.match,token:this.terminals_[t]||t,line:n.yylineno,loc:q,expected:B})}if(w[0]instanceof Array&&w.length>1)throw Error("Parse Error: multiple actions possible at state: "+v+", token: "+t);switch(w[0]){case 1:c.push(t),e.push(n.yytext),f.push(n.yylloc),c.push(w[1]),t=null,u?(t=u,u=null):(k=n.yyleng,h=n.yytext,j=n.yylineno,q=n.yylloc,l>0&&l--);break;case 2:if(z=this.productions_[w[1]][1],C.$=e[e.length-z],C._$={first_line:f[f.length-(z||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(z||1)].first_column,last_column:f[f.length-1].last_column},r&&(C._$.range=[f[f.length-(z||1)].range[0],f[f.length-1].range[1]]),void 0!==(x=this.performAction.apply(C,[h,k,j,o,w[1],e,f].concat(m))))return x;z&&(c=c.slice(0,-1*z*2),e=e.slice(0,-1*z),f=f.slice(0,-1*z)),c.push(this.productions_[w[1]][0]),e.push(C.$),f.push(C._$),A=g[c[c.length-2]][c[c.length-1]],c.push(A);break;case 3:return!0}}return!0},"parse")};function E(){this.yy={}}return D.lexer={EOF:1,parseError:(0,i.K2)(function(a,b){if(this.yy.parser)this.yy.parser.parseError(a,b);else throw Error(a)},"parseError"),setInput:(0,i.K2)(function(a,b){return this.yy=b||this.yy||{},this._input=a,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:(0,i.K2)(function(){var a=this._input[0];return this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a,a.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},"input"),unput:(0,i.K2)(function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this.yyleng=this.yytext.length,this},"unput"),more:(0,i.K2)(function(){return this._more=!0,this},"more"),reject:(0,i.K2)(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:(0,i.K2)(function(a){this.unput(this.match.slice(a))},"less"),pastInput:(0,i.K2)(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:(0,i.K2)(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:(0,i.K2)(function(){var a=this.pastInput(),b=Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},"showPosition"),test_match:(0,i.K2)(function(a,b){var c,d,e;if(this.options.backtrack_lexer&&(e={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(e.yylloc.range=this.yylloc.range.slice(0))),(d=a[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(a[0].length),this.matched+=a[0],c=this.performAction.call(this,this.yy,this,b,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack)for(var f in e)this[f]=e[f];return!1},"test_match"),next:(0,i.K2)(function(){if(this.done)return this.EOF;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var a,b,c,d,e=this._currentRules(),f=0;f<e.length;f++)if((c=this._input.match(this.rules[e[f]]))&&(!b||c[0].length>b[0].length)){if(b=c,d=f,this.options.backtrack_lexer){if(!1!==(a=this.test_match(c,e[f])))return a;if(!this._backtrack)return!1;b=!1;continue}if(!this.options.flex)break}return b?!1!==(a=this.test_match(b,e[d]))&&a:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:(0,i.K2)(function(){var a=this.next();return a||this.lex()},"lex"),begin:(0,i.K2)(function(a){this.conditionStack.push(a)},"begin"),popState:(0,i.K2)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,i.K2)(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:(0,i.K2)(function(a){return(a=this.conditionStack.length-1-Math.abs(a||0))>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:(0,i.K2)(function(a){this.begin(a)},"pushState"),stateStackSize:(0,i.K2)(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:(0,i.K2)(function(a,b,c,d){switch(c){case 0:case 1:case 5:case 44:break;case 2:case 3:return this.popState(),34;case 4:return 34;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:case 26:case 28:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 31;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 27;case 25:return this.popState(),26;case 27:this.pushState("string");break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 43;case 33:return"COLON";case 34:return 44;case 35:return 28;case 36:return 45;case 37:return 46;case 38:return 48;case 39:return 50;case 40:return 47;case 41:return 41;case 42:return 49;case 43:return 42;case 45:return 35;case 46:return 36}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}},(0,i.K2)(E,"Parser"),E.prototype=D,D.Parser=E,new E}();function l(a){return"bar"===a.type}function m(a){return"band"===a.type}function n(a){return"linear"===a.type}k.parser=k,(0,i.K2)(l,"isBarPlot"),(0,i.K2)(m,"isBandAxisData"),(0,i.K2)(n,"isLinearAxisData");var o=class{constructor(a){this.parentGroup=a}static{(0,i.K2)(this,"TextDimensionCalculatorWithFont")}getMaxDimension(a,b){if(!this.parentGroup)return{width:a.reduce((a,b)=>Math.max(b.length,a),0)*b,height:b};let c={width:0,height:0},d=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",b);for(let e of a){let a=(0,f.W6)(d,1,e),g=a?a.width:e.length*b,h=a?a.height:b;c.width=Math.max(c.width,g),c.height=Math.max(c.height,h)}return d.remove(),c}},p=class{constructor(a,b,c,d){this.axisConfig=a,this.title=b,this.textDimensionCalculator=c,this.axisThemeConfig=d,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left"}static{(0,i.K2)(this,"BaseAxis")}setRange(a){this.range=a,"left"===this.axisPosition||"right"===this.axisPosition?this.boundingRect.height=a[1]-a[0]:this.boundingRect.width=a[1]-a[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(a){this.axisPosition=a,this.setRange(this.range)}getTickDistance(){let a=this.getRange();return Math.abs(a[0]-a[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(a=>a.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){.7*this.getTickDistance()>2*this.outerPadding&&(this.outerPadding=Math.floor(.7*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(a){let b=a.height;if(this.axisConfig.showAxisLine&&b>this.axisConfig.axisLineWidth&&(b-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){let c=this.getLabelDimension(),d=.2*a.width;this.outerPadding=Math.min(c.width/2,d);let e=c.height+2*this.axisConfig.labelPadding;this.labelTextHeight=c.height,e<=b&&(b-=e,this.showLabel=!0)}if(this.axisConfig.showTick&&b>=this.axisConfig.tickLength&&(this.showTick=!0,b-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){let a=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),c=a.height+2*this.axisConfig.titlePadding;this.titleTextHeight=a.height,c<=b&&(b-=c,this.showTitle=!0)}this.boundingRect.width=a.width,this.boundingRect.height=a.height-b}calculateSpaceIfDrawnVertical(a){let b=a.width;if(this.axisConfig.showAxisLine&&b>this.axisConfig.axisLineWidth&&(b-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){let c=this.getLabelDimension(),d=.2*a.height;this.outerPadding=Math.min(c.height/2,d);let e=c.width+2*this.axisConfig.labelPadding;e<=b&&(b-=e,this.showLabel=!0)}if(this.axisConfig.showTick&&b>=this.axisConfig.tickLength&&(this.showTick=!0,b-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){let a=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),c=a.height+2*this.axisConfig.titlePadding;this.titleTextHeight=a.height,c<=b&&(b-=c,this.showTitle=!0)}this.boundingRect.width=a.width-b,this.boundingRect.height=a.height}calculateSpace(a){return"left"===this.axisPosition||"right"===this.axisPosition?this.calculateSpaceIfDrawnVertical(a):this.calculateSpaceIfDrawnHorizontally(a),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(a){this.boundingRect.x=a.x,this.boundingRect.y=a.y}getDrawableElementsForLeftAxis(){let a=[];if(this.showAxisLine){let b=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;a.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${b},${this.boundingRect.y} L ${b},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&a.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(a=>({text:a.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(a),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){let b=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);a.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(a=>({path:`M ${b},${this.getScaleValue(a)} L ${b-this.axisConfig.tickLength},${this.getScaleValue(a)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&a.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),a}getDrawableElementsForBottomAxis(){let a=[];if(this.showAxisLine){let b=this.boundingRect.y+this.axisConfig.axisLineWidth/2;a.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${b} L ${this.boundingRect.x+this.boundingRect.width},${b}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&a.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(a=>({text:a.toString(),x:this.getScaleValue(a),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){let b=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);a.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(a=>({path:`M ${this.getScaleValue(a)},${b} L ${this.getScaleValue(a)},${b+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&a.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),a}getDrawableElementsForTopAxis(){let a=[];if(this.showAxisLine){let b=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;a.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${b} L ${this.boundingRect.x+this.boundingRect.width},${b}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&a.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(a=>({text:a.toString(),x:this.getScaleValue(a),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+2*this.axisConfig.titlePadding:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){let b=this.boundingRect.y;a.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(a=>({path:`M ${this.getScaleValue(a)},${b+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(a)},${b+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&a.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),a}getDrawableElements(){if("left"===this.axisPosition)return this.getDrawableElementsForLeftAxis();if("right"===this.axisPosition)throw Error("Drawing of right axis is not implemented");return"bottom"===this.axisPosition?this.getDrawableElementsForBottomAxis():"top"===this.axisPosition?this.getDrawableElementsForTopAxis():[]}},q=class extends p{static{(0,i.K2)(this,"BandAxis")}constructor(a,b,c,d,e){super(a,d,e,b),this.categories=c,this.scale=(0,j.WH)().domain(this.categories).range(this.getRange())}setRange(a){super.setRange(a)}recalculateScale(){this.scale=(0,j.WH)().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),i.Rm.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(a){return this.scale(a)??this.getRange()[0]}},r=class extends p{static{(0,i.K2)(this,"LinearAxis")}constructor(a,b,c,d,e){super(a,d,e,b),this.domain=c,this.scale=(0,j.m4Y)().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){let a=[...this.domain];"left"===this.axisPosition&&a.reverse(),this.scale=(0,j.m4Y)().domain(a).range(this.getRange())}getScaleValue(a){return this.scale(a)}};function s(a,b,c,d){let e=new o(d);return m(a)?new q(b,c,a.categories,a.title,e):new r(b,c,[a.min,a.max],a.title,e)}(0,i.K2)(s,"getAxis");var t=class{constructor(a,b,c,d){this.textDimensionCalculator=a,this.chartConfig=b,this.chartData=c,this.chartThemeConfig=d,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{(0,i.K2)(this,"ChartTitle")}setBoundingBoxXY(a){this.boundingRect.x=a.x,this.boundingRect.y=a.y}calculateSpace(a){let b=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),c=Math.max(b.width,a.width),d=b.height+2*this.chartConfig.titlePadding;return b.width<=c&&b.height<=d&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=c,this.boundingRect.height=d,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){let a=[];return this.showChartTitle&&a.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),a}};function u(a,b,c,d){return new t(new o(d),a,b,c)}(0,i.K2)(u,"getChartTitleComponent");var v=class{constructor(a,b,c,d,e){this.plotData=a,this.xAxis=b,this.yAxis=c,this.orientation=d,this.plotIndex=e}static{(0,i.K2)(this,"LinePlot")}getDrawableElement(){let a,b=this.plotData.data.map(a=>[this.xAxis.getScaleValue(a[0]),this.yAxis.getScaleValue(a[1])]);return(a="horizontal"===this.orientation?(0,j.n8j)().y(a=>a[0]).x(a=>a[1])(b):(0,j.n8j)().x(a=>a[0]).y(a=>a[1])(b))?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:a,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},w=class{constructor(a,b,c,d,e,f){this.barData=a,this.boundingRect=b,this.xAxis=c,this.yAxis=d,this.orientation=e,this.plotIndex=f}static{(0,i.K2)(this,"BarPlot")}getDrawableElement(){let a=this.barData.data.map(a=>[this.xAxis.getScaleValue(a[0]),this.yAxis.getScaleValue(a[1])]),b=.95*Math.min(2*this.xAxis.getAxisOuterPadding(),this.xAxis.getTickDistance()),c=b/2;return"horizontal"===this.orientation?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:a.map(a=>({x:this.boundingRect.x,y:a[0]-c,height:b,width:a[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:a.map(a=>({x:a[0]-c,y:a[1],width:b,height:this.boundingRect.y+this.boundingRect.height-a[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},x=class{constructor(a,b,c){this.chartConfig=a,this.chartData=b,this.chartThemeConfig=c,this.boundingRect={x:0,y:0,width:0,height:0}}static{(0,i.K2)(this,"BasePlot")}setAxes(a,b){this.xAxis=a,this.yAxis=b}setBoundingBoxXY(a){this.boundingRect.x=a.x,this.boundingRect.y=a.y}calculateSpace(a){return this.boundingRect.width=a.width,this.boundingRect.height=a.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");let a=[];for(let[b,c]of this.chartData.plots.entries())switch(c.type){case"line":{let d=new v(c,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,b);a.push(...d.getDrawableElement())}break;case"bar":{let d=new w(c,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,b);a.push(...d.getDrawableElement())}}return a}};function y(a,b,c){return new x(a,b,c)}(0,i.K2)(y,"getPlotComponent");var z=class{constructor(a,b,c,d){this.chartConfig=a,this.chartData=b,this.componentStore={title:u(a,b,c,d),plot:y(a,b,c),xAxis:s(b.xAxis,a.xAxis,{titleColor:c.xAxisTitleColor,labelColor:c.xAxisLabelColor,tickColor:c.xAxisTickColor,axisLineColor:c.xAxisLineColor},d),yAxis:s(b.yAxis,a.yAxis,{titleColor:c.yAxisTitleColor,labelColor:c.yAxisLabelColor,tickColor:c.yAxisTickColor,axisLineColor:c.yAxisLineColor},d)}}static{(0,i.K2)(this,"Orchestrator")}calculateVerticalSpace(){let a=this.chartConfig.width,b=this.chartConfig.height,c=0,d=0,e=Math.floor(a*this.chartConfig.plotReservedSpacePercent/100),f=Math.floor(b*this.chartConfig.plotReservedSpacePercent/100),g=this.componentStore.plot.calculateSpace({width:e,height:f});a-=g.width,b-=g.height,d=(g=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:b})).height,b-=g.height,this.componentStore.xAxis.setAxisPosition("bottom"),g=this.componentStore.xAxis.calculateSpace({width:a,height:b}),b-=g.height,this.componentStore.yAxis.setAxisPosition("left"),c=(g=this.componentStore.yAxis.calculateSpace({width:a,height:b})).width,(a-=g.width)>0&&(e+=a,a=0),b>0&&(f+=b,b=0),this.componentStore.plot.calculateSpace({width:e,height:f}),this.componentStore.plot.setBoundingBoxXY({x:c,y:d}),this.componentStore.xAxis.setRange([c,c+e]),this.componentStore.xAxis.setBoundingBoxXY({x:c,y:d+f}),this.componentStore.yAxis.setRange([d,d+f]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:d}),this.chartData.plots.some(a=>l(a))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let a=this.chartConfig.width,b=this.chartConfig.height,c=0,d=0,e=0,f=Math.floor(a*this.chartConfig.plotReservedSpacePercent/100),g=Math.floor(b*this.chartConfig.plotReservedSpacePercent/100),h=this.componentStore.plot.calculateSpace({width:f,height:g});a-=h.width,b-=h.height,c=(h=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:b})).height,b-=h.height,this.componentStore.xAxis.setAxisPosition("left"),h=this.componentStore.xAxis.calculateSpace({width:a,height:b}),a-=h.width,d=h.width,this.componentStore.yAxis.setAxisPosition("top"),h=this.componentStore.yAxis.calculateSpace({width:a,height:b}),b-=h.height,e=c+h.height,a>0&&(f+=a,a=0),b>0&&(g+=b,b=0),this.componentStore.plot.calculateSpace({width:f,height:g}),this.componentStore.plot.setBoundingBoxXY({x:d,y:e}),this.componentStore.yAxis.setRange([d,d+f]),this.componentStore.yAxis.setBoundingBoxXY({x:d,y:c}),this.componentStore.xAxis.setRange([e,e+g]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:e}),this.chartData.plots.some(a=>l(a))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){"horizontal"===this.chartConfig.chartOrientation?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();let a=[];for(let b of(this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis),Object.values(this.componentStore)))a.push(...b.getDrawableElements());return a}},A=class{static{(0,i.K2)(this,"XYChartBuilder")}static build(a,b,c,d){return new z(a,b,c,d).getDrawableElement()}},B=0,C=J(),D=I(),E=K(),F=D.plotColorPalette.split(",").map(a=>a.trim()),G=!1,H=!1;function I(){let a=(0,h.P$)(),b=(0,h.zj)();return(0,g.$t)(a.xyChart,b.themeVariables.xyChart)}function J(){let a=(0,h.zj)();return(0,g.$t)(h.UI.xyChart,a.xyChart)}function K(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}function L(a){let b=(0,h.zj)();return(0,h.jZ)(a.trim(),b)}function M(a){d=a}function N(a){"horizontal"===a?C.chartOrientation="horizontal":C.chartOrientation="vertical"}function O(a){E.xAxis.title=L(a.text)}function P(a,b){E.xAxis={type:"linear",title:E.xAxis.title,min:a,max:b},G=!0}function Q(a){E.xAxis={type:"band",title:E.xAxis.title,categories:a.map(a=>L(a.text))},G=!0}function R(a){E.yAxis.title=L(a.text)}function S(a,b){E.yAxis={type:"linear",title:E.yAxis.title,min:a,max:b},H=!0}function T(a){let b=Math.min(...a),c=Math.max(...a),d=n(E.yAxis)?E.yAxis.min:1/0,e=n(E.yAxis)?E.yAxis.max:-1/0;E.yAxis={type:"linear",title:E.yAxis.title,min:Math.min(d,b),max:Math.max(e,c)}}function U(a){let b=[];if(0===a.length)return b;if(G||P(Math.min(n(E.xAxis)?E.xAxis.min:1/0,1),Math.max(n(E.xAxis)?E.xAxis.max:-1/0,a.length)),H||T(a),m(E.xAxis)&&(b=E.xAxis.categories.map((b,c)=>[b,a[c]])),n(E.xAxis)){let c=E.xAxis.min,d=E.xAxis.max,e=(d-c)/(a.length-1),f=[];for(let a=c;a<=d;a+=e)f.push(`${a}`);b=f.map((b,c)=>[b,a[c]])}return b}function V(a){return F[0===a?0:a%F.length]}function W(a,b){let c=U(b);E.plots.push({type:"line",strokeFill:V(B),strokeWidth:2,data:c}),B++}function X(a,b){let c=U(b);E.plots.push({type:"bar",fill:V(B),data:c}),B++}function Y(){if(0===E.plots.length)throw Error("No Plot to render, please provide a plot with some data");return E.title=(0,h.ab)(),A.build(C,E,D,d)}function Z(){return D}function $(){return C}function _(){return E}(0,i.K2)(I,"getChartDefaultThemeConfig"),(0,i.K2)(J,"getChartDefaultConfig"),(0,i.K2)(K,"getChartDefaultData"),(0,i.K2)(L,"textSanitizer"),(0,i.K2)(M,"setTmpSVGG"),(0,i.K2)(N,"setOrientation"),(0,i.K2)(O,"setXAxisTitle"),(0,i.K2)(P,"setXAxisRangeData"),(0,i.K2)(Q,"setXAxisBand"),(0,i.K2)(R,"setYAxisTitle"),(0,i.K2)(S,"setYAxisRangeData"),(0,i.K2)(T,"setYAxisRangeFromPlotData"),(0,i.K2)(U,"transformDataWithoutCategory"),(0,i.K2)(V,"getPlotColorFromPalette"),(0,i.K2)(W,"setLineData"),(0,i.K2)(X,"setBarData"),(0,i.K2)(Y,"getDrawableElem"),(0,i.K2)(Z,"getChartThemeConfig"),(0,i.K2)($,"getChartConfig"),(0,i.K2)(_,"getXYChartData");var aa={getDrawableElem:Y,clear:(0,i.K2)(function(){(0,h.IU)(),B=0,C=J(),E=K(),F=(D=I()).plotColorPalette.split(",").map(a=>a.trim()),G=!1,H=!1},"clear"),setAccTitle:h.SV,getAccTitle:h.iN,setDiagramTitle:h.ke,getDiagramTitle:h.ab,getAccDescription:h.m7,setAccDescription:h.EI,setOrientation:N,setXAxisTitle:O,setXAxisRangeData:P,setXAxisBand:Q,setYAxisTitle:R,setYAxisRangeData:S,setLineData:W,setBarData:X,setTmpSVGG:M,getChartThemeConfig:Z,getChartConfig:$,getXYChartData:_},ab={parser:k,db:aa,renderer:{draw:(0,i.K2)((a,b,c,d)=>{let f=d.db,g=f.getChartThemeConfig(),j=f.getChartConfig(),k=f.getXYChartData().plots[0].data.map(a=>a[1]);function l(a){return"top"===a?"text-before-edge":"middle"}function m(a){return"left"===a?"start":"right"===a?"end":"middle"}function n(a){return`translate(${a.x}, ${a.y}) rotate(${a.rotation||0})`}(0,i.K2)(l,"getDominantBaseLine"),(0,i.K2)(m,"getTextAnchor"),(0,i.K2)(n,"getTextTransformation"),i.Rm.debug("Rendering xychart chart\n"+a);let o=(0,e.D)(b),p=o.append("g").attr("class","main"),q=p.append("rect").attr("width",j.width).attr("height",j.height).attr("class","background");(0,h.a$)(o,j.height,j.width,!0),o.attr("viewBox",`0 0 ${j.width} ${j.height}`),q.attr("fill",g.backgroundColor),f.setTmpSVGG(o.append("g").attr("class","mermaid-tmp-group"));let r=f.getDrawableElem(),s={};function t(a){let b=p,c="";for(let[d]of a.entries()){let e=p;d>0&&s[c]&&(e=s[c]),c+=a[d],(b=s[c])||(b=s[c]=e.append("g").attr("class",a[d]))}return b}for(let a of((0,i.K2)(t,"getGroup"),r)){if(0===a.data.length)continue;let b=t(a.groupTexts);switch(a.type){case"rect":if(b.selectAll("rect").data(a.data).enter().append("rect").attr("x",a=>a.x).attr("y",a=>a.y).attr("width",a=>a.width).attr("height",a=>a.height).attr("fill",a=>a.fill).attr("stroke",a=>a.strokeFill).attr("stroke-width",a=>a.strokeWidth),j.showDataLabel){let c=j.showDataLabelOutsideBar;if("horizontal"===j.chartOrientation){let d=function(a,b){let{data:c,label:d}=a;return b*d.length*e<=c.width-f};(0,i.K2)(d,"fitsHorizontally");let e=.7,f=10,h=a.data.map((a,b)=>({data:a,label:k[b].toString()})).filter(a=>a.data.width>0&&a.data.height>0),j=Math.floor(Math.min(...h.map(a=>{let{data:b}=a,c=.7*b.height;for(;!d(a,c)&&c>0;)c-=1;return c}))),l=(0,i.K2)(a=>c?a.data.x+a.data.width+f:a.data.x+a.data.width-f,"determineLabelXPosition");b.selectAll("text").data(h).enter().append("text").attr("x",l).attr("y",a=>a.data.y+a.data.height/2).attr("text-anchor",c?"start":"end").attr("dominant-baseline","middle").attr("fill",g.dataLabelColor).attr("font-size",`${j}px`).text(a=>a.label)}else{let d=function(a,b,c){let{data:d,label:e}=a,f=b*e.length*.7,g=d.x+d.width/2,h=g-f/2,i=g+f/2,j=h>=d.x&&i<=d.x+d.width,k=d.y+c+b<=d.y+d.height;return j&&k};(0,i.K2)(d,"fitsInBar");let e=a.data.map((a,b)=>({data:a,label:k[b].toString()})).filter(a=>a.data.width>0&&a.data.height>0),f=Math.floor(Math.min(...e.map(a=>{let{data:b,label:c}=a,e=b.width/(.7*c.length);for(;!d(a,e,10)&&e>0;)e-=1;return e}))),h=(0,i.K2)(a=>c?a.data.y-10:a.data.y+10,"determineLabelYPosition");b.selectAll("text").data(e).enter().append("text").attr("x",a=>a.data.x+a.data.width/2).attr("y",h).attr("text-anchor","middle").attr("dominant-baseline",c?"auto":"hanging").attr("fill",g.dataLabelColor).attr("font-size",`${f}px`).text(a=>a.label)}}break;case"text":b.selectAll("text").data(a.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",a=>a.fill).attr("font-size",a=>a.fontSize).attr("dominant-baseline",a=>l(a.verticalPos)).attr("text-anchor",a=>m(a.horizontalPos)).attr("transform",a=>n(a)).text(a=>a.text);break;case"path":b.selectAll("path").data(a.data).enter().append("path").attr("d",a=>a.path).attr("fill",a=>a.fill?a.fill:"none").attr("stroke",a=>a.strokeFill).attr("stroke-width",a=>a.strokeWidth)}}},"draw")}}}};
@@ -1 +1,4 @@
1
- exports.id=4969,exports.ids=[4969],exports.modules={4929:(a,b,c)=>{"use strict";c.d(b,{p:()=>x});var d=c(64173),e=c(17240),f=c(71813),g=c(90775),h=c(56992),i=c(39755),j=c(66979),k=c(14878),l=c(62261),m=c(69552),n=c(96705),o=c(13530),p=c(12619),q=c(73569),r=c(44052),s=c(20583),t=c(47071),u=c(3265);let v=(0,u.createServerReference)("40660607a16b6bbb1f812fa5d0b684bf48222094f9",u.callServer,void 0,u.findSourceMapURL,"summarizeYoutubeAction");var w=c(54028);function x({source:a,onSendToChat:b,autoSummarizeYoutube:c}){let[f,j]=(0,e.useState)(null);return(0,d.jsxs)("div",{className:"prose prose-neutral dark:prose-invert max-w-none [&_pre]:bg-muted [&_pre]:rounded-md [&_pre]:p-4 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre_code]:bg-transparent [&_pre_code]:p-0 [&_pre_code]:text-foreground [&_:not(pre)>code]:bg-muted [&_:not(pre)>code]:px-1.5 [&_:not(pre)>code]:py-0.5 [&_:not(pre)>code]:rounded [&_:not(pre)>code]:text-[0.9em] [&_code]:font-mono [&_table]:text-sm",children:[(0,d.jsx)(g.oz,{remarkPlugins:[h.A],rehypePlugins:[[i.A,{detect:!0,ignoreMissing:!0}]],components:{a:({href:a,children:e,...f})=>{let g=a?function(a){try{let b=new URL(a),c=b.hostname.replace(/^www\./,"");if("youtu.be"===c){let a=b.pathname.slice(1).split("/")[0];return a&&/^[A-Za-z0-9_-]{6,}$/.test(a)?a:null}if("youtube.com"===c||"m.youtube.com"===c||"youtube-nocookie.com"===c){if("/watch"===b.pathname){let a=b.searchParams.get("v");return a&&/^[A-Za-z0-9_-]{6,}$/.test(a)?a:null}let a=/^\/(shorts|embed|live|v)\/([^/?#]+)/.exec(b.pathname);if(a&&/^[A-Za-z0-9_-]{6,}$/.test(a[2]))return a[2]}}catch{}return null}(a):null;return g&&a?(0,d.jsx)(A,{url:a,videoId:g,autoSummarize:c??!1,...b?{onSendToChat:b}:{}}):(0,d.jsx)("a",{href:a,...f,children:e})},img:({src:a,alt:b,title:c})=>"string"!=typeof a||0===a.length?null:(0,d.jsx)(y,{src:a,alt:"string"==typeof b?b:"",title:"string"==typeof c?c:void 0,onZoom:a=>j(a)})},children:a}),f&&(0,d.jsx)(z,{src:f.src,alt:f.alt,onClose:()=>j(null)})]})}function y({src:a,alt:b,title:c,onZoom:e}){let g=(0,f.c)("roots");return(0,d.jsx)("img",{src:a,alt:b,title:c??b??g("markdown.openFullscreen"),onClick:()=>e({src:a,alt:b}),className:"cursor-zoom-in rounded-md border bg-muted/40 transition hover:opacity-90",loading:"lazy"})}function z({src:a,alt:b,onClose:c}){let g=(0,f.c)("roots");return(0,e.useCallback)(a=>{"Escape"===a.key&&c()},[c]),(0,d.jsxs)("div",{className:"fixed inset-0 z-[80] flex items-center justify-center p-6 bg-background/85 backdrop-blur-sm cursor-zoom-out",onClick:c,role:"dialog","aria-label":b||g("markdown.imagePreview"),children:[(0,d.jsx)(s.$,{type:"button",size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-9 w-9 bg-card/80 hover:bg-card",onClick:a=>{a.stopPropagation(),c()},"aria-label":g("markdown.closeAria"),children:(0,d.jsx)(j.A,{className:"h-5 w-5"})}),(0,d.jsx)("img",{src:a,alt:b,className:"max-h-full max-w-full object-contain rounded-lg shadow-2xl",onClick:a=>a.stopPropagation()}),b&&(0,d.jsx)("div",{className:"absolute bottom-6 inset-x-0 mx-auto max-w-3xl px-6 text-center text-sm text-foreground/80 pointer-events-none",children:b})]})}function A({url:a,videoId:b,onSendToChat:c,autoSummarize:g}){let h=(0,f.c)("roots"),[i,u]=(0,e.useTransition)(),[x,y]=(0,e.useState)(null),[z,A]=(0,e.useState)(!1),[B,C]=(0,e.useState)(""),[D,E]=(0,e.useState)(!1);(0,e.useRef)(!1);let F=()=>{y(null),u(async()=>{let b=await v({url:a});if(b.ok){y(b.text),A(!1);return}if(b.needsKey)return void A(!0);r.oR.error(b.error)})},G=async()=>{if(!B.trim())return void r.oR.error(h("markdown.enterKey"));E(!0);try{let a=await (0,w.A)(B.trim());if(!a.ok)return void r.oR.error(a.error);r.oR.success(h("markdown.geminiKeySaved")),C(""),A(!1),F()}finally{E(!1)}};return(0,d.jsxs)("span",{className:"not-prose my-4 block rounded-lg border bg-card overflow-hidden",children:[(0,d.jsx)("span",{className:"relative block w-full",style:{paddingTop:"56.25%"},children:(0,d.jsx)("iframe",{src:`https://www.youtube-nocookie.com/embed/${b}`,className:"absolute inset-0 h-full w-full",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",referrerPolicy:"strict-origin-when-cross-origin",allowFullScreen:!0,title:"YouTube video"})}),(0,d.jsxs)("span",{className:"flex items-center gap-2 p-2 border-t bg-muted/30",children:[(0,d.jsx)(k.A,{className:"h-4 w-4 text-red-600 shrink-0"}),(0,d.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:underline truncate flex-1 min-w-0",children:a}),(0,d.jsxs)(s.$,{type:"button",size:"sm",variant:"outline",onClick:F,disabled:i,className:"gap-1 shrink-0 h-7",children:[i?(0,d.jsx)(l.A,{className:"h-3 w-3 animate-spin"}):(0,d.jsx)(m.A,{className:"h-3 w-3"}),h("markdown.summarize")]})]}),z&&(0,d.jsxs)("span",{className:"block border-t bg-amber-50/60 p-3 space-y-2",children:[(0,d.jsxs)("span",{className:"flex items-center gap-2 text-xs text-amber-900",children:[(0,d.jsx)(n.A,{className:"h-3.5 w-3.5"}),(0,d.jsx)("span",{className:"font-medium",children:h("markdown.needsGeminiKey")})]}),(0,d.jsx)("span",{className:"block text-[11px] text-amber-900/80",children:h.rich("markdown.geminiKeyHelp",{link:()=>(0,d.jsx)("a",{href:"https://aistudio.google.com/apikey",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"aistudio.google.com/apikey"}),path:()=>(0,d.jsx)("code",{className:"font-mono",children:"~/.reflex/api-keys/gemini.json"}),modelsList:()=>(0,d.jsx)("code",{className:"font-mono",children:"models.list"})})}),(0,d.jsxs)("span",{className:"flex items-center gap-2",children:[(0,d.jsx)(t.p,{type:"password",value:B,onChange:a=>C(a.target.value),placeholder:"AIza…",className:"font-mono text-xs h-8 flex-1",disabled:D}),(0,d.jsxs)(s.$,{type:"button",size:"sm",onClick:()=>void G(),disabled:D||!B.trim(),className:"h-8 gap-1",children:[D?(0,d.jsx)(l.A,{className:"h-3 w-3 animate-spin"}):(0,d.jsx)(o.A,{className:"h-3 w-3"}),h("markdown.saveAndContinue")]}),(0,d.jsx)(s.$,{type:"button",size:"icon",variant:"ghost",onClick:()=>A(!1),className:"h-8 w-8",children:(0,d.jsx)(j.A,{className:"h-3.5 w-3.5"})})]})]}),x&&(0,d.jsxs)("span",{className:"block border-t p-3 space-y-2",children:[(0,d.jsxs)("span",{className:"flex items-center gap-2 text-[11px] uppercase tracking-wider text-muted-foreground",children:[(0,d.jsx)(p.A,{className:"h-3 w-3 text-emerald-600"}),"Gemini summary",(0,d.jsxs)(s.$,{type:"button",size:"sm",variant:"ghost",onClick:F,className:"ml-auto h-6 text-[10px] gap-1",disabled:i,children:[i?(0,d.jsx)(l.A,{className:"h-3 w-3 animate-spin"}):(0,d.jsx)(m.A,{className:"h-3 w-3"}),h("markdown.redo")]}),c&&(0,d.jsxs)(s.$,{type:"button",size:"sm",variant:"outline",onClick:()=>c(x,a),className:"h-6 text-[10px] gap-1",children:[(0,d.jsx)(q.A,{className:"h-3 w-3"}),h("markdown.toChat")]})]}),(0,d.jsx)("span",{className:"block",children:(0,d.jsx)("span",{className:"block text-sm whitespace-pre-wrap leading-relaxed",children:x})})]})]})}},6993:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>g});var d=c(63003),e=c(9310),f=c(24576);async function g({children:a,params:b}){let{id:c}=await b;return await (0,f.getRoot)(c)||(0,e.notFound)(),(0,d.jsx)("div",{className:"flex-1 flex flex-col min-h-0",children:a})}},20400:(a,b,c)=>{"use strict";c.d(b,{t:()=>e});var d=c(3265);let e=(0,d.createServerReference)("60d3162b40ff46c448abd0ba793d003a91d3391d9a",d.callServer,void 0,d.findSourceMapURL,"restoreWidgetAction")},30515:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(42557).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},34639:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{Aq:()=>o,J7:()=>w,KV:()=>u,Mh:()=>s,cl:()=>x,hL:()=>p,kv:()=>v,mm:()=>t,ru:()=>r,tT:()=>q});var e=c(73745);c(66493);var f=c(65326),g=c(53905),h=c(69509),i=c(1405),j=c(93554),k=c(51021),l=c(63781),m=a([j,k]);async function n(a,b){let c=await (0,h.listWidgets)(a),d=await (0,h.readLayout)(a),e=b(d),f=(0,h.reconcileLayout)(e,c.map(a=>a.id),i.SYSTEM_WIDGET_IDS);return await (0,h.writeLayout)(a,f),{ok:!0,layout:f}}async function o(a,b){try{let c=await (0,g.getRoot)(a);if(!c)return{ok:!1,error:"Root not found"};let d=await n(c.path,a=>({...a,order:b.filter(b=>!a.hidden.includes(b))}));return(0,f.revalidatePath)(`/roots/${a}`),d}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function p(a,b){try{let c=await (0,g.getRoot)(a);if(!c)return{ok:!1,error:"Root not found"};let d=await n(c.path,a=>({order:a.order.filter(a=>a!==b),hidden:[...new Set([b,...a.hidden])]}));return(0,f.revalidatePath)(`/roots/${a}`),d}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function q(a,b){try{let c=await (0,g.getRoot)(a);if(!c)return{ok:!1,error:"Root not found"};let d=await n(c.path,a=>({order:[b,...a.order.filter(a=>a!==b)],hidden:a.hidden.filter(a=>a!==b)}));return(0,f.revalidatePath)(`/roots/${a}`),d}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function r(a,b,c,d){try{let e=await (0,g.getRoot)(a);if(!e)return{ok:!1,error:"Root not found"};let i=await (0,h.readWidget)(e.path,b);if(!i)return{ok:!1,error:"Widget not found"};if(!c||"object"!=typeof c)return{ok:!1,error:"newData must be an object"};let j={...i,data:c,updatedAt:new Date().toISOString(),...void 0!==d?{memory:d}:{}};return await (0,h.writeWidget)(e.path,j),(0,f.revalidatePath)(`/roots/${a}`),{ok:!0}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function s(a,b,c){try{let d=await (0,g.getRoot)(a);if(!d)return{ok:!1,error:"Root not found"};let e=await n(d.path,a=>({...a,sizes:{...a.sizes??{},[b]:c}}));return(0,f.revalidatePath)(`/roots/${a}`),e}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function t(a,b,c){try{let d=await (0,g.getRoot)(a);if(!d)return{ok:!1,error:"Root not found"};let e=await (0,h.readWidget)(d.path,b);if(!e)return{ok:!1,error:"Widget not found"};let i={...e,refresh:c};return await (0,h.writeWidget)(d.path,i),(0,f.revalidatePath)(`/roots/${a}`),{ok:!0}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function u(a,b){try{let d=await (0,g.getRoot)(a);if(!d)return{ok:!1,error:"Root not found"};let e=await (0,h.readWidget)(d.path,b);if(!e)return{ok:!1,error:"Widget not found"};if(!e.sourceTopicId)return{ok:!1,error:"Widget has no source topic — update it from any chat first."};if(j.z.isActive(e.sourceTopicId))return{ok:!1,error:"The source topic is already occupied by an agent — wait for the current turn to finish."};let f={...e,lastRefreshAt:new Date().toISOString()};await (0,h.writeWidget)(d.path,f);let{buildRefreshPromptForWidget:i}=await c.e(4553).then(c.bind(c,94553)),l=await i(d.path,f),m=await (0,k.startOrchestratorTurn)({rootId:a,topicId:e.sourceTopicId,message:l,attachments:[]});if("error"in m)return{ok:!1,error:m.error};return{ok:!0,agentId:m.agentId}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function v(a,b){let{refreshUtilityCard:d}=await Promise.all([c.e(9861),c.e(4031),c.e(269)]).then(c.bind(c,30269)),e=await d(a,b);return e.ok?{ok:!0,...void 0!==e.inner?{inner:e.inner}:{},...e.noop?{noop:!0}:{}}:{ok:!1,...e.error?{error:e.error}:{}}}async function w(a,b){try{let{getUtility:d}=await Promise.resolve().then(c.bind(c,8118)),e=await d(b.utilityScope,b.utilityId,"project"===b.utilityScope?a:void 0);if(!e)return{ok:!1,error:"Utility not installed"};if(!e.manifest.permissions.workers?.enabled)return{ok:!1,error:"Utility lacks permissions.workers.enabled"};let g=e.manifest.serverActions.find(a=>a.name===b.actionName);if(!g)return{ok:!1,error:`Unknown server action: ${b.actionName}`};let{runServerAction:h}=await Promise.all([c.e(9861),c.e(4031)]).then(c.bind(c,49556));await h({utility:e,action:g,args:b.args??{}});let{refreshUtilityCard:i}=await Promise.all([c.e(9861),c.e(4031),c.e(269)]).then(c.bind(c,30269)),j=await i(a,b.widgetId);return a&&(0,f.revalidatePath)(`/roots/${a}`),{ok:!0,...void 0!==j.inner?{inner:j.inner}:{}}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function x(a,b){try{if(i.SYSTEM_WIDGET_IDS.includes(b))return{ok:!1,error:"System widget cannot be deleted — only hidden."};let c=await (0,g.getRoot)(a);if(!c)return{ok:!1,error:"Root not found"};await (0,h.uv)(c.path,b);let d=await n(c.path,a=>({order:a.order.filter(a=>a!==b),hidden:a.hidden.filter(a=>a!==b)}));return(0,f.revalidatePath)(`/roots/${a}`),d}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}[j,k]=m.then?(await m)():m,(0,l.D)([o,p,q,r,s,t,u,v,w,x]),(0,e.A)(o,"608fc096d2ed2c6604326ff4891aaf5903f75638dc",null),(0,e.A)(p,"605a4abd674a5c905716f41eb0bff04a07dc41cbd3",null),(0,e.A)(q,"60d3162b40ff46c448abd0ba793d003a91d3391d9a",null),(0,e.A)(r,"783aa4bba291b273914d8c1022ab814fb9bead4d51",null),(0,e.A)(s,"708d6c3772416997bc8935ba8267e62f5af1c3eca0",null),(0,e.A)(t,"7010e188fb76de45f6f10a36ff128b55f690648e8f",null),(0,e.A)(u,"6074e6a3e4daf67c32928f64ffc1d7f969ec7b2f90",null),(0,e.A)(v,"6078c36a8d214be16e378e95b5a2534afe26181fe3",null),(0,e.A)(w,"6076176b6452d01651a14a012279246f3d825a73ad",null),(0,e.A)(x,"60d08bee7815d4a7b2adb32c0a3feacf972a1c4829",null),d()}catch(a){d(a)}})},45928:(a,b,c)=>{"use strict";c.d(b,{v:()=>O});var d=c(64173),e=c(71813),f=c(4929),g=c(17240),h=c(42557);let i=(0,h.A)("Newspaper",[["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-2 2Zm0 0a2 2 0 0 1-2-2v-9c0-1.1.9-2 2-2h2",key:"7pis2x"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M10 6h8v4h-8V6Z",key:"smlsk5"}]]);var j=c(65177),k=c(12619),l=c(66979);let m=(0,h.A)("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);var n=c(97338);let o=(0,h.A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]),p=(0,h.A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);var q=c(62481),r=c(25436),s=c(30515),t=c(62261),u=c(20583),v=c(47071);let w=(0,h.A)("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);var x=c(1056),y=c.n(x),z=c(68669);let A=(0,h.A)("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);var B=c(65943);let C=(0,h.A)("Route",[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]),D=(0,h.A)("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);var E=c(28082),F=c(44052),G=c(85548);function H({service:a,size:b=18,className:c}){return(0,d.jsx)("span",{className:"inline-flex items-center justify-center rounded-[5px] font-bold leading-none text-white shrink-0 "+(c??""),style:{background:a.brand,width:b,height:b,fontSize:Math.max(8,Math.floor(.55*b)),letterSpacing:a.glyph.length>1?"-0.05em":"0"},"aria-hidden":!0,children:a.glyph})}var I=c(3265);function J({point:a,services:b,interactive:c,onRemove:f}){let g=(0,e.c)("roots");return(0,d.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[b.slice(0,4).map(b=>(0,d.jsx)("a",{href:b.urlFor(a.lat,a.lng),target:"_blank",rel:"noopener noreferrer",className:"rounded p-0.5 hover:ring-1 hover:ring-offset-1 hover:ring-violet-300",title:g("mapWidget.navigationTitle",{service:b.label}),children:(0,d.jsx)(H,{service:b,size:18})},b.id)),(0,d.jsx)("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(`${a.lat}, ${a.lng}`).then(()=>F.oR.success(g("mapWidget.coordsCopied"))).catch(()=>F.oR.error(g("mapWidget.clipboardUnavailable")))},className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground",title:g("mapWidget.copyCoords"),children:(0,d.jsx)(E.A,{className:"h-3 w-3"})}),c&&(0,d.jsx)("button",{type:"button",onClick:f,className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-destructive",title:g("mapWidget.removePoint"),children:(0,d.jsx)(l.A,{className:"h-3 w-3"})})]})}function K({service:a,stops:b}){let c=(0,e.c)("roots"),f=a.routeUrlFor(b),g=b=>{b.preventDefault(),b.stopPropagation(),navigator.clipboard.writeText(f).then(()=>F.oR.success(c("mapWidget.linkCopied",{service:a.label}))).catch(()=>F.oR.error(c("mapWidget.clipboardUnavailable")))};return(0,d.jsxs)("a",{href:f,target:"_blank",rel:"noopener noreferrer",onContextMenu:g,className:"inline-flex items-center gap-1 rounded border px-1.5 py-0.5 text-[11px] hover:bg-accent",title:c("mapWidget.openTitle",{service:a.label}),children:[(0,d.jsx)(H,{service:a,size:16}),(0,d.jsx)("span",{className:"truncate max-w-[80px]",children:a.label}),(0,d.jsx)("button",{type:"button",onClick:g,className:"text-muted-foreground hover:text-foreground",title:c("mapWidget.copyLinkTitle"),children:(0,d.jsx)(E.A,{className:"h-2.5 w-2.5"})})]})}I.callServer,I.findSourceMapURL;let L=(0,I.createServerReference)("6076176b6452d01651a14a012279246f3d825a73ad",I.callServer,void 0,I.findSourceMapURL,"invokeCardActionAction");var M=c(69552);I.callServer,I.findSourceMapURL;let N={markdown:function({data:a}){return(0,d.jsx)("div",{className:"text-sm",children:(0,d.jsx)(f.p,{source:a.body??""})})},"news-list":function({data:a,readonly:b,onPatch:c}){let f=(0,e.c)("roots"),h=a.items??[],[m,n]=(0,g.useState)(h),[o,p]=(0,g.useTransition)();(0,g.useRef)("");let q=a=>{n(a),c&&p(async()=>{try{await c({items:a})}catch{}})};return 0===m.length?(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:f("newsListWidget.empty")}):(0,d.jsx)("ul",{className:"space-y-2",children:m.map((a,c)=>(0,d.jsxs)("li",{className:`group/row relative border-l-2 pl-2.5 py-0.5 transition ${a.read?"border-muted-foreground/30 opacity-60":"border-violet-200"}`,children:[(0,d.jsxs)("div",{className:"flex items-start gap-1.5",children:[(0,d.jsx)(i,{className:`h-3 w-3 mt-1 shrink-0 ${a.read?"text-muted-foreground":"text-violet-600"}`}),(0,d.jsxs)("div",{className:"min-w-0 flex-1 pr-12",children:[a.url?(0,d.jsxs)("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium hover:underline inline-flex items-center gap-1",children:[a.title,(0,d.jsx)(j.A,{className:"h-3 w-3 opacity-50"})]}):(0,d.jsx)("span",{className:"text-sm font-medium",children:a.title}),a.summary&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:a.summary}),(a.source||a.date)&&(0,d.jsxs)("div",{className:"text-[10px] text-muted-foreground mt-0.5 flex gap-1.5",children:[a.source&&(0,d.jsx)("span",{children:a.source}),a.source&&a.date&&(0,d.jsx)("span",{children:"\xb7"}),a.date&&(0,d.jsx)("span",{className:"font-mono",children:a.date})]})]})]}),!b&&(0,d.jsxs)("div",{className:"absolute top-0 right-0 flex items-center gap-0.5 opacity-0 group-hover/row:opacity-100 transition-opacity",children:[(0,d.jsx)("button",{type:"button",onClick:()=>{!b&&q(m.map((a,b)=>b===c?{...a,read:!a.read}:a))},disabled:o,"aria-label":a.read?f("newsListWidget.markUnreadAria"):f("newsListWidget.markReadAria"),title:a.read?f("newsListWidget.markUnreadTitle"):f("newsListWidget.markReadTitle"),className:"p-1 rounded hover:bg-emerald-100 dark:hover:bg-emerald-950/40 text-muted-foreground hover:text-emerald-600 disabled:opacity-30",children:(0,d.jsx)(k.A,{className:"h-3 w-3"})}),(0,d.jsx)("button",{type:"button",onClick:()=>{!b&&q(m.filter((a,b)=>b!==c))},disabled:o,"aria-label":f("newsListWidget.dismissAria"),title:f("newsListWidget.dismissTitle"),className:"p-1 rounded hover:bg-destructive/15 text-muted-foreground hover:text-destructive disabled:opacity-30",children:(0,d.jsx)(l.A,{className:"h-3 w-3"})})]})]},c))})},"link-list":function({data:a,readonly:b,onPatch:c}){let f=(0,e.c)("roots"),h=a.items??[],[i,k]=(0,g.useState)(h),[l,o]=(0,g.useTransition)();return((0,g.useRef)(""),0===i.length)?(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:f("linkListWidget.empty")}):(0,d.jsx)("ul",{className:"space-y-0.5",children:i.map((a,e)=>(0,d.jsxs)("li",{className:"group/row relative",children:[(0,d.jsxs)("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-start gap-1.5 rounded-md px-2 py-1.5 hover:bg-accent/40 transition",children:[(0,d.jsx)(m,{className:"h-3 w-3 mt-1 shrink-0 text-sky-600"}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("div",{className:"text-sm font-medium hover:underline inline-flex items-center gap-1",children:[a.title,(0,d.jsx)(j.A,{className:"h-3 w-3 opacity-50"})]}),a.hint&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:a.hint}),(0,d.jsx)("div",{className:"text-[10px] text-muted-foreground truncate font-mono mt-0.5",children:a.url})]})]}),!b&&(0,d.jsx)("button",{type:"button",onClick:()=>(a=>{if(!b){var d;k(d=i.filter((b,c)=>c!==a)),c&&o(async()=>{try{await c({items:d})}catch{}})}})(e),disabled:l,"aria-label":f("linkListWidget.removeAria"),className:"absolute top-1.5 right-1.5 opacity-0 group-hover/row:opacity-100 transition-opacity p-1 rounded hover:bg-destructive/15 text-muted-foreground hover:text-destructive disabled:opacity-30",children:(0,d.jsx)(n.A,{className:"h-3 w-3"})})]},e))})},kpi:function({data:a}){let b=(0,e.c)("roots"),c=a.items??[];if(0===c.length)return(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:b("kpiWidget.empty")});let f=Math.min(c.length,3);return(0,d.jsx)("div",{className:"grid gap-2",style:{gridTemplateColumns:`repeat(${f}, minmax(0,1fr))`},children:c.map((a,b)=>(0,d.jsxs)("div",{className:"rounded-md border bg-card px-3 py-2 flex flex-col gap-0.5",children:[(0,d.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground",children:a.label}),(0,d.jsxs)("div",{className:"flex items-baseline gap-1",children:[(0,d.jsx)("span",{className:"text-lg font-semibold tabular-nums",children:a.value}),"up"===a.delta&&(0,d.jsx)(o,{className:"h-3.5 w-3.5 text-emerald-600"}),"down"===a.delta&&(0,d.jsx)(p,{className:"h-3.5 w-3.5 text-rose-600"}),"flat"===a.delta&&(0,d.jsx)(q.A,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),a.hint&&(0,d.jsx)("div",{className:"text-[10px] text-muted-foreground leading-snug",children:a.hint})]},b))})},checklist:function({data:a,readonly:b,onPatch:c}){let f=(0,e.c)("roots"),h=a.items??[],[i,j]=(0,g.useState)(h),[l,m]=(0,g.useTransition)(),[o,p]=(0,g.useState)("");(0,g.useRef)("");let q=a=>{j(a),c&&m(async()=>{try{await c({items:a})}catch{}})},w=a=>{b||q(i.map((b,c)=>c===a?{...b,done:!b.done}:b))};return 0===i.length&&b?(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:f("checklistWidget.empty")}):(0,d.jsxs)("div",{className:"space-y-1.5",children:[(0,d.jsx)("ul",{className:"space-y-0.5",children:i.map((a,c)=>(0,d.jsxs)("li",{className:`group/row flex items-start gap-2 text-sm py-0.5 rounded hover:bg-accent/30 px-1 -mx-1 ${a.done?"text-muted-foreground":""}`,children:[(0,d.jsx)("button",{type:"button",onClick:()=>w(c),disabled:b||l,"aria-label":a.done?f("checklistWidget.uncheckAria"):f("checklistWidget.checkAria"),className:"shrink-0 mt-0.5 disabled:opacity-50",children:a.done?(0,d.jsx)(k.A,{className:"h-3.5 w-3.5 text-emerald-600"}):(0,d.jsx)(r.A,{className:"h-3.5 w-3.5 text-muted-foreground/60 hover:text-foreground"})}),(0,d.jsx)("span",{className:`flex-1 min-w-0 break-words ${a.done?"line-through":""}`,onClick:()=>w(c),style:b?{}:{cursor:"pointer"},children:a.text}),!b&&(0,d.jsx)("button",{type:"button",onClick:()=>{!b&&q(i.filter((a,b)=>b!==c))},disabled:l,"aria-label":f("checklistWidget.removeAria"),className:"opacity-0 group-hover/row:opacity-100 transition-opacity shrink-0 p-0.5 text-muted-foreground hover:text-destructive disabled:opacity-30",children:(0,d.jsx)(n.A,{className:"h-3 w-3"})})]},c))}),!b&&(0,d.jsxs)("form",{className:"flex items-center gap-1 pt-1",onSubmit:a=>{a.preventDefault(),(()=>{if(b)return;let a=o.trim();a&&(q([...i,{text:a,done:!1}]),p(""))})()},children:[(0,d.jsx)(s.A,{className:"h-3 w-3 text-muted-foreground shrink-0"}),(0,d.jsx)(v.p,{value:o,onChange:a=>p(a.target.value),placeholder:f("checklistWidget.newItemPlaceholder"),className:"h-7 text-xs flex-1 border-0 shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 px-1",disabled:l}),o.trim()&&(0,d.jsx)(u.$,{type:"submit",size:"sm",variant:"ghost",className:"h-6 text-[10px] px-1.5",disabled:l,children:l?(0,d.jsx)(t.A,{className:"h-3 w-3 animate-spin"}):f("checklistWidget.add")})]})]})},quote:function({data:a}){let b=(0,e.c)("roots");return a?.text?(0,d.jsxs)("figure",{className:"relative pl-6",children:[(0,d.jsx)(w,{className:"h-5 w-5 absolute left-0 top-0 text-violet-300"}),(0,d.jsx)("blockquote",{className:"text-sm italic leading-relaxed",children:a.text}),a.attribution&&(0,d.jsxs)("figcaption",{className:"text-xs text-muted-foreground mt-1.5",children:["— ",a.attribution]})]}):(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:b("quoteWidget.empty")})},"kb-pinned":function({rootId:a,data:b,readonly:c,onPatch:f}){let h=(0,e.c)("roots"),i=b.items??[],[j,k]=(0,g.useState)(i),[m,n]=(0,g.useTransition)();return((0,g.useRef)(""),0===j.length)?(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:h("kbPinnedWidget.empty")}):(0,d.jsx)("ul",{className:"space-y-1",children:j.map((b,e)=>{let g=b.rel.split("/").map(encodeURIComponent).join("/");return(0,d.jsxs)("li",{className:"group/row relative",children:[(0,d.jsxs)(y(),{href:`/roots/${a}/kb/${g}`,className:"flex items-start gap-2 rounded-md px-2 py-1.5 hover:bg-accent/40 transition pr-7",children:[(0,d.jsx)(z.A,{className:"h-3 w-3 mt-0.5 shrink-0 text-emerald-700"}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("div",{className:"text-sm font-medium truncate",children:b.title??b.rel}),b.snippet&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 leading-relaxed mt-0.5",children:b.snippet}),(0,d.jsx)("div",{className:"text-[10px] text-muted-foreground font-mono mt-0.5 truncate",children:b.rel})]})]}),!c&&(0,d.jsx)("button",{type:"button",onClick:()=>(a=>{if(!c){var b;k(b=j.filter((b,c)=>c!==a)),f&&n(async()=>{try{await f({items:b})}catch{}})}})(e),disabled:m,"aria-label":h("kbPinnedWidget.unpinAria"),title:h("kbPinnedWidget.unpinTitle"),className:"absolute top-1.5 right-1.5 opacity-0 group-hover/row:opacity-100 transition-opacity p-1 rounded hover:bg-destructive/15 text-muted-foreground hover:text-destructive disabled:opacity-30",children:(0,d.jsx)(l.A,{className:"h-3 w-3"})})]},e)})})},progress:function({data:a,readonly:b,onPatch:c}){let f=(0,e.c)("roots"),h=a.items??[],[i,j]=(0,g.useState)(h),[k,l]=(0,g.useTransition)();(0,g.useRef)("");let m=(a,d)=>{if(!b){var e;j(e=i.map((b,c)=>c===a?{...b,current:Math.max(0,b.current+d)}:b)),c&&l(async()=>{try{await c({items:e})}catch{}})}};return 0===i.length?(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:f("progressWidget.empty")}):(0,d.jsx)("ul",{className:"space-y-2.5",children:i.map((a,c)=>{let e=a.target>0?Math.max(0,Math.min(100,a.current/a.target*100)):0;return(0,d.jsxs)("li",{className:"space-y-1 group/row",children:[(0,d.jsxs)("div",{className:"flex items-baseline justify-between gap-2 text-sm",children:[(0,d.jsx)("span",{className:"truncate flex-1 min-w-0",children:a.label}),!b&&(0,d.jsxs)("div",{className:"flex items-center gap-0.5 opacity-0 group-hover/row:opacity-100 transition-opacity shrink-0",children:[(0,d.jsx)("button",{type:"button",onClick:()=>m(c,-1),disabled:k||a.current<=0,"aria-label":"−1",className:"p-0.5 rounded hover:bg-accent text-muted-foreground hover:text-foreground disabled:opacity-30",children:(0,d.jsx)(A,{className:"h-3 w-3"})}),(0,d.jsx)("button",{type:"button",onClick:()=>m(c,1),disabled:k,"aria-label":"+1",className:"p-0.5 rounded hover:bg-accent text-muted-foreground hover:text-foreground disabled:opacity-30",children:(0,d.jsx)(s.A,{className:"h-3 w-3"})})]}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground tabular-nums shrink-0",children:[a.current," / ",a.target,a.unit?` ${a.unit}`:""]})]}),(0,d.jsx)("div",{className:"h-1.5 rounded-full bg-muted overflow-hidden",children:(0,d.jsx)("div",{className:"h-full bg-violet-600 transition-all",style:{width:`${e}%`}})})]},c)})})},image:function({data:a}){let b=(0,e.c)("roots");return a?.url?(0,d.jsxs)("figure",{className:"space-y-1",children:[(0,d.jsx)("img",{src:a.url,alt:a.alt??"",className:"rounded-md w-full h-auto border",loading:"lazy"}),a.caption&&(0,d.jsx)("figcaption",{className:"text-xs text-muted-foreground text-center",children:a.caption})]}):(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:b("imageWidget.empty")})},"stat-table":function({data:a}){let b=(0,e.c)("roots"),c=a.rows??[];return 0===c.length?(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:b("statTableWidget.empty")}):(0,d.jsx)("div",{className:"overflow-x-auto -mx-1",children:(0,d.jsxs)("table",{className:"w-full text-sm",children:[a.columns&&a.columns.length>0&&(0,d.jsx)("thead",{children:(0,d.jsx)("tr",{className:"border-b",children:a.columns.map((a,b)=>(0,d.jsx)("th",{className:"text-left text-[10px] uppercase tracking-wider text-muted-foreground font-medium px-1.5 py-1.5",children:a},b))})}),(0,d.jsx)("tbody",{children:c.map((a,b)=>(0,d.jsx)("tr",{className:"border-b border-dashed last:border-b-0 hover:bg-accent/30",children:a.map((a,b)=>(0,d.jsx)("td",{className:"px-1.5 py-1.5 align-top",children:a},b))},b))})]})})},map:function({data:a,readonly:b,onPatch:c}){let f=(0,e.c)("roots"),h=(0,g.useRef)(null),i=(0,g.useRef)(null),[j,k]=(0,g.useState)(!1),[m,o]=(0,g.useState)(G.JY),[p,q]=(0,g.useState)(""),[r,u]=(0,g.useState)(!1),[v,w]=(0,g.useState)([]),[x,y]=(0,g.useState)(!1),[z,A]=(0,g.useState)([]),E=a.points??[],H=a.route?.stops??[],I=x?z:H,L=(0,g.useMemo)(()=>I.map(a=>E[a]).filter(a=>!!a).map(a=>({lat:a.lat,lng:a.lng})),[I,E]),M=(0,g.useMemo)(()=>G.yp.filter(a=>m.includes(a.id)),[m]);(0,g.useEffect)(()=>{if(!j||!h.current)return;let b=window.L;if(!b||(i.current&&(i.current.remove(),i.current=null),0===E.length))return;let c=b.map(h.current,{scrollWheelZoom:!1,zoomControl:!0});i.current=c,b.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',maxZoom:19}).addTo(c);let d=E.map((a,d)=>{let e=I.includes(d),g=function(a,b,c){let d=a=>a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),e=b.map(b=>{let c=b.urlFor(a.lat,a.lng);return`<a href="${d(c)}" target="_blank" rel="noopener noreferrer" title="${d(b.label)}" style="display:inline-flex;align-items:center;gap:4px;margin:2px 4px 2px 0;padding:2px 6px;border-radius:5px;border:1px solid #e5e7eb;text-decoration:none;font-size:11px;color:#111;background:#fff;"><span style="display:inline-block;width:14px;height:14px;border-radius:3px;background:${b.brand};color:#fff;font-size:9px;font-weight:700;line-height:14px;text-align:center;letter-spacing:${b.glyph.length>1?"-0.05em":"0"}">${d(b.glyph)}</span><span>${d(b.label)}</span></a>`}).join("");return['<div style="font-family:inherit;min-width:200px">',`<div style="font-weight:600;font-size:13px;margin-bottom:2px">${d(a.title)}</div>`,a.description?`<div style="font-size:12px;color:#666;margin-bottom:6px">${d(a.description)}</div>`:"",`<div style="font-family:monospace;font-size:10px;color:#888;margin-bottom:6px">${a.lat.toFixed(5)}, ${a.lng.toFixed(5)}</div>`,b.length>0?`<div style="font-size:10px;color:#888;text-transform:uppercase;letter-spacing:0.5px;margin-bottom:2px">${d(c.openIn)}</div>${e}`:"",`<div style="margin-top:6px"><button type="button" data-reflex-copy="${a.lat}, ${a.lng}" style="font-size:11px;padding:2px 8px;border:1px solid #ddd;border-radius:4px;background:#fff;cursor:pointer">📋 ${d(c.copyCoords)}</button></div>`,"</div>"].filter(Boolean).join("")}(a,M,{openIn:f("mapWidget.openIn"),copyCoords:f("mapWidget.copyCoords")}),h=b.marker([a.lat,a.lng],{opacity:x&&!e?.55:1}).addTo(c);return h.bindPopup(g,{maxWidth:280}),h.on("click",()=>{x&&A(a=>a.includes(d)?a.filter(a=>a!==d):[...a,d])}),h});L.length>=2&&b.polyline(L.map(a=>[a.lat,a.lng]),{color:a.route?.color??"#7c3aed",weight:4,opacity:.85,dashArray:x?"6,6":void 0}).addTo(c);let e=a=>{let b=a.target.closest("[data-reflex-copy]");if(b){let c=b.getAttribute("data-reflex-copy");c&&navigator.clipboard.writeText(c).then(()=>F.oR.success(f("mapWidget.copied"))).catch(()=>F.oR.error(f("mapWidget.clipboardUnavailable"))),a.preventDefault()}};if(h.current.addEventListener("click",e),a.center&&"number"==typeof a.zoom)c.setView([a.center.lat,a.center.lng],a.zoom);else if(1===E.length)c.setView([E[0].lat,E[0].lng],a.zoom??12);else{let a=b.featureGroup(d);c.fitBounds(a.getBounds().pad(.2))}return()=>{h.current?.removeEventListener("click",e),c.remove(),i.current=null}},[j,a,m.join("|"),x,z.join(",")]);let N=!b&&!!c,O=async()=>{let a=p.trim();if(a){u(!0),w([]);try{let b=`https://nominatim.openstreetmap.org/search?q=${encodeURIComponent(a)}&format=json&limit=6`,c=await fetch(b,{headers:{Accept:"application/json"}});if(!c.ok)throw Error(`status ${c.status}`);let d=await c.json();w(d),0===d.length&&F.oR.message(f("mapWidget.nothingFound"))}catch(a){F.oR.error(f("mapWidget.searchFailed",{error:a instanceof Error?a.message:String(a)}))}finally{u(!1)}}},P=async b=>{if(!N)return;let d=Number(b.lat),e=Number(b.lon);if(!Number.isFinite(d)||!Number.isFinite(e))return void F.oR.error(f("mapWidget.invalidCoordinates"));let g=b.display_name.split(",")[0]?.trim()||b.display_name.slice(0,60),h={...a,points:[...E,{lat:d,lng:e,title:g,description:b.display_name}]};w([]),q(""),await c?.(h)},Q=async b=>{if(!N)return;let d=E.filter((a,c)=>c!==b),e=a.route;if(a.route?.stops?.length){let c=a.route.stops.filter(a=>a!==b).map(a=>a>b?a-1:a);e=c.length>=2?{...a.route,stops:c}:void 0}let f={...a,points:d,...e?{route:e}:{route:void 0}};await c?.(f)},R=async()=>{if(!N)return;let b={...a,route:void 0};await c?.(b),y(!1),A([])},S=async()=>{if(!N)return;if(z.length<2)return void F.oR.error(f("mapWidget.routeNeedsTwo"));let b={...a,route:{...a.route??{},stops:z}};await c?.(b),y(!1)};return 0!==E.length||N?(0,d.jsxs)("div",{className:"space-y-2",children:[N&&(0,d.jsxs)("div",{className:"space-y-1.5",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsxs)("div",{className:"relative flex-1",children:[(0,d.jsx)(B.A,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground pointer-events-none"}),(0,d.jsx)("input",{type:"search",value:p,onChange:a=>q(a.target.value),onKeyDown:a=>{"Enter"===a.key&&(a.preventDefault(),O())},placeholder:f("mapWidget.searchPlaceholder"),className:"w-full rounded border bg-background pl-7 pr-2 py-1 text-xs focus:outline-none focus:ring-1 focus:ring-violet-400"})]}),(0,d.jsxs)("button",{type:"button",onClick:()=>void O(),disabled:r||!p.trim(),className:"rounded border px-2 py-1 text-xs hover:bg-accent disabled:opacity-50 inline-flex items-center gap-1",children:[r?(0,d.jsx)(t.A,{className:"h-3 w-3 animate-spin"}):(0,d.jsx)(B.A,{className:"h-3 w-3"}),f("mapWidget.search")]}),x?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("button",{type:"button",onClick:()=>void S(),className:"rounded px-2 py-1 text-xs bg-violet-600 text-white hover:bg-violet-700 inline-flex items-center gap-1",title:f("mapWidget.saveRouteTitle"),children:[(0,d.jsx)(C,{className:"h-3 w-3"})," ",f("mapWidget.save")]}),(0,d.jsx)("button",{type:"button",onClick:()=>{y(!1),A([])},className:"rounded border px-2 py-1 text-xs hover:bg-accent inline-flex items-center gap-1",title:f("mapWidget.cancelTitle"),children:(0,d.jsx)(l.A,{className:"h-3 w-3"})})]}):(0,d.jsxs)("button",{type:"button",onClick:()=>{A(H),y(!0)},disabled:E.length<2,className:"rounded border px-2 py-1 text-xs hover:bg-accent disabled:opacity-50 inline-flex items-center gap-1",title:f("mapWidget.routeButtonTitle"),children:[(0,d.jsx)(C,{className:"h-3 w-3"}),f("mapWidget.route")]})]}),v.length>0&&(0,d.jsx)("ul",{className:"rounded border bg-card divide-y text-xs max-h-44 overflow-y-auto",children:v.map((a,b)=>(0,d.jsx)("li",{children:(0,d.jsxs)("button",{type:"button",onClick:()=>void P(a),className:"w-full text-left flex items-start gap-2 px-2 py-1.5 hover:bg-accent",children:[(0,d.jsx)(s.A,{className:"h-3 w-3 mt-0.5 text-emerald-700 shrink-0"}),(0,d.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,d.jsx)("span",{className:"block font-medium truncate",children:a.display_name.split(",")[0]}),(0,d.jsx)("span",{className:"block text-[10px] text-muted-foreground truncate",children:a.display_name})]})]})},b))}),x&&(0,d.jsx)("div",{className:"rounded border border-violet-200 bg-violet-50 dark:bg-violet-950/30 dark:border-violet-900/50 px-2 py-1.5 text-[11px] text-violet-900 dark:text-violet-200",children:f.rich("mapWidget.routeModeHint",{count:z.length,strong:a=>(0,d.jsx)("strong",{children:a})})})]}),(0,d.jsx)("div",{ref:h,className:"rounded-md border overflow-hidden bg-muted/30",style:{height:280}}),!x&&L.length>=2&&M.length>0&&(0,d.jsx)("div",{className:"rounded border bg-card px-2 py-1.5",children:(0,d.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 text-[11px] font-medium",children:[(0,d.jsx)(C,{className:"h-3 w-3 text-violet-600"}),f("mapWidget.routeLabel",{count:L.length})]}),M.map(a=>(0,d.jsx)(K,{service:a,stops:L},a.id)),N&&(0,d.jsxs)("button",{type:"button",onClick:()=>void R(),className:"ml-auto text-[10px] text-muted-foreground hover:text-destructive inline-flex items-center gap-0.5",title:f("mapWidget.deleteRouteTitle"),children:[(0,d.jsx)(n.A,{className:"h-3 w-3"}),f("mapWidget.delete")]})]})}),(0,d.jsx)("ul",{className:"space-y-1",children:E.map((a,b)=>{let c=I.indexOf(b);return(0,d.jsxs)("li",{className:"flex items-start gap-2 rounded-md border bg-card px-2 py-1.5 text-xs "+(x&&c>=0?"ring-1 ring-violet-400 border-violet-300":""),children:[x?(0,d.jsx)("button",{type:"button",onClick:()=>A(a=>a.includes(b)?a.filter(a=>a!==b):[...a,b]),className:"h-5 w-5 mt-0.5 shrink-0 rounded-full border text-[10px] font-mono inline-flex items-center justify-center "+(c>=0?"bg-violet-600 text-white border-violet-600":"bg-card text-muted-foreground"),title:c>=0?f("mapWidget.removeFromRoute"):f("mapWidget.addToRoute"),children:c>=0?c+1:"+"}):(0,d.jsx)(D,{className:"h-3 w-3 mt-1 shrink-0 "+(H.includes(b)?"text-violet-600":"text-emerald-700")}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("div",{className:"font-medium truncate",children:a.title}),a.description&&(0,d.jsx)("p",{className:"text-muted-foreground leading-snug mt-0.5 line-clamp-2",children:a.description}),(0,d.jsxs)("div",{className:"text-[10px] text-muted-foreground/80 font-mono mt-0.5",children:[a.lat.toFixed(5),", ",a.lng.toFixed(5)]})]}),(0,d.jsx)(J,{point:a,services:M,interactive:N,onRemove:()=>void Q(b)})]},b)})})]}):(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:f("mapWidget.noPointsReadonly")})},"action-list":function({rootId:a,data:b,readonly:c,widgetId:e,utility:f}){let[h,i]=(0,g.useState)(b.groups??[]),[j,k]=(0,g.useState)(null),l=!c&&!!f&&!!e,m=async(b,c)=>{if(f&&e&&(!c.confirm||confirm(c.confirm))){k(b);try{let d=await L(a,{utilityId:f.id,utilityScope:f.scope,widgetId:e,actionName:c.actionName,args:{id:b,...c.args??{}}});if(!d.ok)return void F.oR.error(d.error??"Action failed");if(d.inner&&"action-list"===d.inner.kind){let a=d.inner.data;a?.groups&&i(a.groups)}}catch(a){F.oR.error(a instanceof Error?a.message:String(a))}finally{k(null)}}};return 0===h.length?(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"Nothing here yet."}):(0,d.jsx)("div",{className:"space-y-3",children:h.map((a,b)=>(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsxs)("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground",children:[a.label,a.items.length>0&&(0,d.jsx)("span",{className:"ml-1 text-muted-foreground/70",children:a.items.length})]}),0===a.items.length?(0,d.jsx)("p",{className:"text-[11px] text-muted-foreground/80 italic",children:a.emptyText??"empty"}):(0,d.jsx)("ul",{className:"space-y-1",children:a.items.map(a=>(0,d.jsxs)("li",{className:"flex items-center gap-2 rounded-md border bg-card px-2 py-1.5",children:[a.badge&&(0,d.jsx)("span",{className:"shrink-0 text-[10px] uppercase tracking-wide rounded bg-muted px-1.5 py-0.5 text-muted-foreground",children:a.badge}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("div",{className:"truncate text-xs font-medium",children:a.title}),a.subtitle&&(0,d.jsx)("div",{className:"truncate text-[10px] text-muted-foreground",children:a.subtitle})]}),a.action&&l&&(0,d.jsx)(u.$,{size:"sm",variant:"secondary",className:"h-7 shrink-0 text-[11px]",disabled:null!==j,onClick:()=>void m(a.id,a.action),children:j===a.id?(0,d.jsx)(t.A,{className:"h-3 w-3 animate-spin"}):a.action.label})]},a.id))})]},b))})},"utility-card":function({rootId:a,data:b,widgetId:c,readonly:f}){let h=(0,e.c)("roots"),[i,k]=(0,g.useState)(b.inner),[l,m]=(0,g.useState)(!1);(0,g.useRef)(!1);let n="project"===b.utilityScope?`/utilities/project/${b.utilityId}?rootId=${encodeURIComponent(a)}`:`/utilities/global/${b.utilityId}`;return(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 text-[10px] uppercase tracking-wider text-muted-foreground",children:[(0,d.jsx)(M.A,{className:"h-3 w-3 text-violet-600"}),(0,d.jsx)("span",{children:h("utilityCardWidget.miniAppLabel")}),(0,d.jsx)("span",{className:"font-mono normal-case tracking-normal text-muted-foreground/80",children:b.utilityId}),l&&(0,d.jsx)(t.A,{className:"h-2.5 w-2.5 animate-spin text-muted-foreground"}),(0,d.jsxs)(y(),{href:n,className:"ml-auto inline-flex items-center gap-0.5 text-[10px] text-violet-700 hover:underline normal-case tracking-normal",title:h("utilityCardWidget.openFullTitle"),children:[h("utilityCardWidget.openLabel"),(0,d.jsx)(j.A,{className:"h-2.5 w-2.5"})]})]}),i.title&&(0,d.jsx)("h4",{className:"text-sm font-medium",children:i.title}),i.description&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground -mt-1",children:i.description}),(0,d.jsx)("div",{children:O(a,i.kind,i.data,{readonly:"action-list"!==i.kind||!!f,...c?{widgetId:c}:{},utility:{id:b.utilityId,scope:b.utilityScope}})})]})}};function O(a,b,c,e){let f=N[b];return f?(0,d.jsx)(f,{rootId:a,data:c,readonly:e?.readonly??!1,onPatch:e?.onPatch,widgetId:e?.widgetId,utility:e?.utility}):(0,d.jsx)(P,{kind:b})}function P({kind:a}){let b=(0,e.c)("roots");return(0,d.jsx)("p",{className:"text-xs text-destructive",children:b.rich("widgetsCommon.unknownKind",{kind:a,code:a=>(0,d.jsx)("code",{className:"font-mono",children:a})})})}},48272:(a,b,c)=>{"use strict";c.d(b,{w:()=>f});var d=c(73745);c(66493);var e=c(36017);async function f(){return{ok:!0,enabled:(await (0,e.loadSettings)()).mapServices.enabled}}(0,c(63781).D)([f]),(0,d.A)(f,"0063b995d1f13f38427b0820c649cea8e2683d5354",null)},54028:(a,b,c)=>{"use strict";c.d(b,{A:()=>e});var d=c(3265);let e=(0,d.createServerReference)("40e7eed3c24ac1be2525c4f944d52b9636a10eedf8",d.callServer,void 0,d.findSourceMapURL,"saveGeminiKeyAction")},54874:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(42557).A)("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},62481:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(42557).A)("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])},80432:()=>{},85548:(a,b,c)=>{"use strict";function d(a){return`${a.lat},${a.lng}`}function e(a){return`${a.lng},${a.lat}`}c.d(b,{JY:()=>g,yp:()=>f});let f=[{id:"google",label:"Google Maps",description:"Global, navigation + street view. Works everywhere except where the RF blocks it.",brand:"#4285F4",glyph:"G",urlFor:(a,b)=>`https://www.google.com/maps/dir/?api=1&destination=${a},${b}`,routeUrlFor:a=>{if(a.length<2)return"";let b=d(a[0]),c=d(a[a.length-1]),e=a.slice(1,-1).map(d).join("|"),f=e?`&waypoints=${encodeURIComponent(e)}`:"";return`https://www.google.com/maps/dir/?api=1&origin=${b}&destination=${c}${f}`}},{id:"yandex",label:"Yandex Maps",description:"CIS region, best RF detail and real-time traffic.",brand:"#FFCC00",glyph:"Y",urlFor:(a,b)=>`https://yandex.ru/maps/?rtext=~${a},${b}&rtt=auto`,routeUrlFor:a=>`https://yandex.ru/maps/?rtext=${a.map(d).join("~")}&rtt=auto`},{id:"2gis",label:"2GIS",description:"CIS region, precise addresses and POI. Uniquely strong on RF cities.",brand:"#1BA049",glyph:"2",urlFor:(a,b)=>`https://2gis.ru/routeSearch/to/${b},${a}`,routeUrlFor:a=>{let b=e(a[0]),c=e(a[a.length-1]),d=a.slice(1,-1).map(a=>`/via/${e(a)}`).join("");return`https://2gis.ru/routeSearch/rsType/car/from/${b}${d}/to/${c}`}},{id:"apple",label:"Apple Maps",description:"Opens in the native app on iOS/macOS, otherwise on the website.",brand:"#1d1d1f",glyph:"A",urlFor:(a,b)=>`https://maps.apple.com/?daddr=${a},${b}`,routeUrlFor:a=>{let b=d(a[0]),c=a.slice(1).map(a=>`+to:${d(a)}`).join("");return`https://maps.apple.com/?saddr=${b}&daddr=${b}${c}`}},{id:"osm",label:"OpenStreetMap",description:"Open data, no account required. Basic navigation.",brand:"#7EB73F",glyph:"OSM",urlFor:(a,b)=>`https://www.openstreetmap.org/directions?to=${a},${b}`,routeUrlFor:a=>{let b=a.map(d).join(";");return`https://www.openstreetmap.org/directions?route=${encodeURIComponent(b)}`}},{id:"waze",label:"Waze",description:"Car navigation with crowd-sourced traffic and alerts.",brand:"#33CCFF",glyph:"W",urlFor:(a,b)=>`https://waze.com/ul?ll=${a},${b}&navigate=yes`,routeUrlFor:a=>{let b=a[a.length-1];return`https://waze.com/ul?ll=${b.lat},${b.lng}&navigate=yes`}},{id:"organic",label:"Organic Maps",description:"Offline maps with open data. Opens in the app.",brand:"#006C35",glyph:"OM",urlFor:(a,b)=>`om://map?ll=${a},${b}`,routeUrlFor:a=>{let b=a[0],c=a[a.length-1];return`om://route?sll=${b.lat},${b.lng}&saddr=&dll=${c.lat},${c.lng}&daddr=&type=vehicle`}}],g=["google","yandex","apple","osm"]},90160:()=>{}};
1
+ "use strict";exports.id=4969,exports.ids=[4969],exports.modules={74969:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{O:()=>l,createWorktree:()=>o,hasGhCli:()=>n,hasRemote:()=>m,isGitRepo:()=>k,listWorktrees:()=>s,mergeWorktree:()=>p,removeWorktree:()=>r});var e=c(7206),f=c(73024),g=c(76760),h=c.n(g),i=a([e]);e=(i.then?(await i)():i)[0];let w=h().join(".reflex","worktrees"),x=".reflex/worktrees/";async function j(a,b){let c=await (0,e.execa)("git",b,{cwd:a,timeout:3e4,reject:!1});return{stdout:"string"==typeof c.stdout?c.stdout:"",stderr:"string"==typeof c.stderr?c.stderr:"",code:"number"==typeof c.exitCode?c.exitCode:1}}async function k(a){let b=await j(a,["rev-parse","--is-inside-work-tree"]);return 0===b.code&&"true"===b.stdout.trim()}async function l(a){let b=await j(a,["symbolic-ref","--short","refs/remotes/origin/HEAD"]);return 0===b.code&&b.stdout.trim()?b.stdout.trim().replace(/^origin\//,""):(await j(a,["rev-parse","--abbrev-ref","HEAD"])).stdout.trim()||"main"}async function m(a){let b=await j(a,["remote"]);return 0===b.code&&b.stdout.trim().length>0}async function n(){let a=await (0,e.execa)("gh",["--version"],{timeout:5e3,reject:!1});return"number"==typeof a.exitCode&&0===a.exitCode}async function o(a){if(!await k(a.rootPath))throw Error("createWorktree: project root is not a git repo");let b=h().join(a.rootPath,w,a.slug),c=a.baseRef??await l(a.rootPath);try{throw await f.promises.stat(b),Error(`createWorktree: ${b} already exists`)}catch(a){if("ENOENT"!==a.code)throw a}let d=await j(a.rootPath,["rev-parse","--verify",`refs/heads/${a.branch}`]);if(0===d.code)throw Error(`createWorktree: branch ${a.branch} already exists; remove it first`);await f.promises.mkdir(h().dirname(b),{recursive:!0});let e=await j(a.rootPath,["worktree","add","-b",a.branch,b,c]);if(0!==e.code)throw Error(`git worktree add failed (${e.code}): ${e.stderr.trim()||e.stdout.trim()}`);return await u(a.rootPath,b),await v(a.rootPath),{dir:b,branch:a.branch,baseRef:c}}async function p(a){let b=a.intoRef??await l(a.rootPath),c=(await j(a.rootPath,["rev-parse","--abbrev-ref","HEAD"])).stdout.trim(),d=await j(a.rootPath,["checkout",b]);if(0!==d.code)return{ok:!1,conflicts:[],error:`checkout ${b} failed: ${d.stderr.trim()}`};let e=!1===a.noFf?[]:["--no-ff"],f=await j(a.rootPath,["merge",...e,a.branch]);if(0!==f.code){let b=await q(a.rootPath);return{ok:!1,conflicts:b,error:f.stderr.trim()||f.stdout.trim()||"merge failed"}}return c&&c!==b&&await j(a.rootPath,["checkout",c]),{ok:!0,mergedInto:b}}async function q(a){let b=await j(a,["diff","--name-only","--diff-filter=U"]);return 0!==b.code?[]:b.stdout.split("\n").map(a=>a.trim()).filter(Boolean)}async function r(a){let b=h().join(a.rootPath,w,a.slug),c=a.force?["--force"]:[],d=await j(a.rootPath,["worktree","remove",...c,b]);if(0!==d.code)try{return await f.promises.stat(b),{ok:!1,error:d.stderr.trim()||d.stdout.trim()||"worktree remove failed"}}catch{}if(a.deleteBranch??!0){let b=a.force?"-D":"-d";await j(a.rootPath,["branch",b,a.branch])}return await j(a.rootPath,["worktree","prune"]),{ok:!0}}async function s(a){let b=await j(a,["worktree","list","--porcelain"]);if(0!==b.code)return[];let c=[],d=null;for(let e of b.stdout.split("\n")){let b=e.trimEnd();if(!b){d?.dir&&c.push(t(d,a)),d=null;continue}b.startsWith("worktree ")?(d?.dir&&c.push(t(d,a)),d={dir:b.slice(9)}):d&&(b.startsWith("HEAD ")?d.head=b.slice(5):b.startsWith("branch refs/heads/")?d.branch=b.slice(18):"detached"===b?d.detached=!0:"bare"===b&&(d.bare=!0))}return d?.dir&&c.push(t(d,a)),c}function t(a,b){return{dir:a.dir,...a.branch?{branch:a.branch}:{},head:a.head??"",detached:!!a.detached,bare:!!a.bare,isMain:h().resolve(a.dir)===h().resolve(b)}}async function u(a,b){let c=h().join(a,".reflex","memory");await f.promises.mkdir(h().dirname(c),{recursive:!0}),await f.promises.mkdir(h().join(b,".reflex"),{recursive:!0});let d=h().join(b,".reflex","memory");try{if((await f.promises.lstat(d)).isSymbolicLink()&&await f.promises.readlink(d)===c)return;await f.promises.rm(d,{recursive:!0,force:!0})}catch(a){if("ENOENT"!==a.code)throw a}await f.promises.symlink(c,d,"dir")}async function v(a){let b=h().join(a,".reflexignore"),c="";try{c=await f.promises.readFile(b,"utf8")}catch{}if(c.split("\n").map(a=>a.trim()).filter(Boolean).includes(x))return;let d=c?`${c.replace(/\n*$/,"")}
2
+ ${x}
3
+ `:`${x}
4
+ `;await f.promises.writeFile(b,d,"utf8")}d()}catch(a){d(a)}})}};