@unchainedshop/admin-ui 5.0.0-alpha.11 → 5.0.0-alpha.12

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 (752) hide show
  1. package/README.md +1 -1
  2. package/dist/{chunk-WPLOTFGW.js → chunk-2HTCKO4E.js} +12 -3
  3. package/dist/{chunk-BMDNY67T.js → chunk-33ZO52Z7.js} +3241 -1753
  4. package/dist/{chunk-PJLYVMUM.js → chunk-4MXPTVDL.js} +2 -2
  5. package/dist/{chunk-I64TXIE7.js → chunk-ATZJXTRA.js} +1 -1
  6. package/dist/{chunk-QHR23GVH.js → chunk-CUYIP5XG.js} +1 -1
  7. package/dist/{chunk-5WPFHQZN.js → chunk-E6HDJYA6.js} +3 -3
  8. package/dist/{chunk-FDHXLNZQ.js → chunk-EAVP6XZQ.js} +1 -1
  9. package/dist/{chunk-E77YIMGR.js → chunk-ED2FP42R.js} +1 -1
  10. package/dist/{chunk-HJKRGBDG.js → chunk-GWMLIF3C.js} +1 -1
  11. package/dist/{chunk-3L6EZQ6P.js → chunk-NFJE5EJG.js} +1 -1
  12. package/dist/{chunk-ICJH36K4.js → chunk-YUXHILXY.js} +1 -1
  13. package/dist/components/ui/Loading.d.ts +8 -1
  14. package/dist/components/ui/Loading.d.ts.map +1 -1
  15. package/dist/components/ui/index.d.ts +1 -0
  16. package/dist/components/ui/index.d.ts.map +1 -1
  17. package/dist/form.js +797 -286
  18. package/dist/gql/schema-types.d.ts +3 -2
  19. package/dist/gql/schema-types.d.ts.map +1 -1
  20. package/dist/hooks.js +3 -3
  21. package/dist/modal.js +5 -5
  22. package/dist/modules/accounts.js +1 -1
  23. package/dist/modules/assortment.js +1 -1
  24. package/dist/modules/country.js +1 -1
  25. package/dist/modules/currency.js +1 -1
  26. package/dist/modules/delivery-provider.js +1 -1
  27. package/dist/modules/enrollment.js +1 -1
  28. package/dist/modules/event.js +1 -1
  29. package/dist/modules/filter.js +1 -1
  30. package/dist/modules/language.js +1 -1
  31. package/dist/modules/order.js +1 -1
  32. package/dist/modules/payment-providers.js +1 -1
  33. package/dist/modules/product-review.js +1 -1
  34. package/dist/modules/product.js +5 -5
  35. package/dist/modules/quotation.js +1 -1
  36. package/dist/modules/token.js +1 -1
  37. package/dist/modules/warehousing-providers.js +1 -1
  38. package/dist/modules/work.js +1 -1
  39. package/dist/plugins.js +1 -1
  40. package/dist/providers.js +5 -5
  41. package/dist/shims/admin-ui-plugins.js +1 -1
  42. package/dist/shims/apollo-client-react.js +1 -1
  43. package/dist/shims/apollo-client.js +1 -1
  44. package/dist/shims/next-head.js +1 -1
  45. package/dist/shims/next-image.js +1 -1
  46. package/dist/shims/next-link.js +1 -1
  47. package/dist/shims/next-router.js +1 -1
  48. package/dist/shims/react-dom-client.js +1 -1
  49. package/dist/shims/react-dom.js +1 -1
  50. package/dist/shims/react-hook-form.js +1 -1
  51. package/dist/shims/react-intl.js +1 -1
  52. package/dist/shims/react-jsx-runtime.js +1 -1
  53. package/dist/shims/react-toastify.js +1 -1
  54. package/dist/shims/react.js +1 -1
  55. package/dist/theme.js +1 -1
  56. package/dist/ui.js +3933 -3416
  57. package/out/403/index.html +3 -3
  58. package/out/404/index.html +3 -3
  59. package/out/404.html +3 -3
  60. package/out/423/index.html +3 -3
  61. package/out/500/index.html +3 -3
  62. package/out/_next/static/bg3Z_ZBjStiTvJAHlsPDE/_buildManifest.js +262 -0
  63. package/out/_next/static/chunks/0-kvzk5p0hp-4.js +11 -0
  64. package/out/_next/static/chunks/0-nzk-g6k41e-.js +119 -0
  65. package/out/_next/static/chunks/00wlebfe9j80r.js +24 -0
  66. package/out/_next/static/chunks/01isyk4v59s_4.js +5 -0
  67. package/out/_next/static/chunks/01otzjqxk372n.js +1 -0
  68. package/out/_next/static/chunks/03x_mgpai_kbn.js +1 -0
  69. package/out/_next/static/chunks/04327_1fq5i7-.js +9 -0
  70. package/out/_next/static/chunks/04_r4qnsjmy81.js +4 -0
  71. package/out/_next/static/chunks/04egfa7kckou_.js +165 -0
  72. package/out/_next/static/chunks/05474mknnr_tw.js +4 -0
  73. package/out/_next/static/chunks/{2ajr0rk0_yax6.js → 06kqbwwnuu3te.js} +1 -1
  74. package/out/_next/static/chunks/0728622u98g6r.js +1 -0
  75. package/out/_next/static/chunks/09irjy-7k1922.js +1 -0
  76. package/out/_next/static/chunks/0_3suta3t3lus.js +5 -0
  77. package/out/_next/static/chunks/0_a5fzdztv84p.js +272 -0
  78. package/out/_next/static/chunks/0_ppdn6x6ci0v.js +31 -0
  79. package/out/_next/static/chunks/0br42_xli8-2x.js +6 -0
  80. package/out/_next/static/chunks/0cdk-eqghrgee.js +5 -0
  81. package/out/_next/static/chunks/0d54jo566j9ka.js +12 -0
  82. package/out/_next/static/chunks/0gfia1t8drmnx.js +182 -0
  83. package/out/_next/static/chunks/0gwd6ju8j_bwr.js +39 -0
  84. package/out/_next/static/chunks/{0_pn7w49dpkak.js → 0hv3x0mo1tt7i.js} +2 -2
  85. package/out/_next/static/chunks/0i481ym5-ss1t.js +5 -0
  86. package/out/_next/static/chunks/0iohwbogpxe5r.js +1 -0
  87. package/out/_next/static/chunks/0j46qnxaxeqk_.js +1 -0
  88. package/out/_next/static/chunks/{1jmdpa0tc5puj.js → 0mcu2o1ir2t_w.js} +3 -3
  89. package/out/_next/static/chunks/0o4aj3bm49d_h.js +61 -0
  90. package/out/_next/static/chunks/0op3htrvd-ix6.js +5 -0
  91. package/out/_next/static/chunks/0p55j-ysba0wq.js +63 -0
  92. package/out/_next/static/chunks/0qv2nce7okzy5.js +103 -0
  93. package/out/_next/static/chunks/0rrhyxuk32t3n.js +95 -0
  94. package/out/_next/static/chunks/0rt4le6syjqdj.js +21 -0
  95. package/out/_next/static/chunks/0s2jvi6_qj0lc.js +16 -0
  96. package/out/_next/static/chunks/0uef4ugmc_g10.js +1 -0
  97. package/out/_next/static/chunks/0v1tb34y7e1y4.js +5 -0
  98. package/out/_next/static/chunks/0w9d4swf95hvu.js +33 -0
  99. package/out/_next/static/chunks/0we1tw4xvdb7o.js +7 -0
  100. package/out/_next/static/chunks/0zlzflyq18hhy.js +4 -0
  101. package/out/_next/static/chunks/0zqdvl0b4w5nc.js +7 -0
  102. package/out/_next/static/chunks/1-wbp_4f-c4-3.js +837 -0
  103. package/out/_next/static/chunks/11vnr4kb9qkjr.js +1 -0
  104. package/out/_next/static/chunks/12cy_5m_0fj96.js +44 -0
  105. package/out/_next/static/chunks/131uuhqexo4si.js +4 -0
  106. package/out/_next/static/chunks/14eqp21pspjud.js +234 -0
  107. package/out/_next/static/chunks/14jd75j8ij4u2.js +3 -0
  108. package/out/_next/static/chunks/153-_av1r1ssb.js +4 -0
  109. package/out/_next/static/chunks/{0m73vd78oga92.js → 157ndq6b9jcvv.js} +11 -11
  110. package/out/_next/static/chunks/177p92k5pdloo.js +1 -0
  111. package/out/_next/static/chunks/19-1z6h5eeq_w.js +134 -0
  112. package/out/_next/static/chunks/1bxznw06g-5u2.js +5 -0
  113. package/out/_next/static/chunks/1bypzyw5fs3w2.js +59 -0
  114. package/out/_next/static/chunks/1cz2fp89ssu5d.js +4 -0
  115. package/out/_next/static/chunks/1e2jykfql801f.js +16 -0
  116. package/out/_next/static/chunks/1eokbzdgdicpa.js +33 -0
  117. package/out/_next/static/chunks/1f0t23r6y0hni.js +1 -0
  118. package/out/_next/static/chunks/1fehej_7rgmmo.js +5 -0
  119. package/out/_next/static/chunks/1gl4h7w9t850f.js +1 -0
  120. package/out/_next/static/chunks/1gv0k-w7m83om.js +41 -0
  121. package/out/_next/static/chunks/1hzt0aoixrv4_.js +7 -0
  122. package/out/_next/static/chunks/1ia6hdgf7pj9y.js +174 -0
  123. package/out/_next/static/chunks/1in8spfokcjsp.js +8 -0
  124. package/out/_next/static/chunks/1j2gw9gyg8j80.js +5 -0
  125. package/out/_next/static/chunks/1k06h8wbfrx_v.js +5 -0
  126. package/out/_next/static/chunks/1kdcu-0jkya-b.js +61 -0
  127. package/out/_next/static/chunks/1msc4qrgaanh7.js +43 -0
  128. package/out/_next/static/chunks/{1iamjw8qh1m4o.js → 1mx0p6r-9c5u_.js} +1 -1
  129. package/out/_next/static/chunks/1oqc8etm-romv.js +1 -0
  130. package/out/_next/static/chunks/1p5lt4tkyouxz.js +4 -0
  131. package/out/_next/static/chunks/1q7wxp4rlhy0x.js +12 -0
  132. package/out/_next/static/chunks/1r61kgm2ct0nf.js +74 -0
  133. package/out/_next/static/chunks/1rmlm4404fsge.js +15 -0
  134. package/out/_next/static/chunks/1s3ool53utm9o.js +39 -0
  135. package/out/_next/static/chunks/1sc2ug6_szd_d.js +2 -0
  136. package/out/_next/static/chunks/{12yd8t4k6c0t1.js → 1t8jj0-6g8uyd.js} +1 -1
  137. package/out/_next/static/chunks/1tbd6m-xvx0um.js +353 -0
  138. package/out/_next/static/chunks/1th1-x1szvnq8.js +5 -0
  139. package/out/_next/static/chunks/1tosw188dr9d6.js +44 -0
  140. package/out/_next/static/chunks/1tw97cvdosb89.js +5 -0
  141. package/out/_next/static/chunks/1ubmbegreszhk.js +1 -0
  142. package/out/_next/static/chunks/{43uqmej6-s4am.js → 1ug1ie2lrhi0a.js} +3 -3
  143. package/out/_next/static/chunks/1uw7hr3o4w5cj.js +8 -0
  144. package/out/_next/static/chunks/1vzs8hvrsoslf.js +5 -0
  145. package/out/_next/static/chunks/1w6gc_cygbi6h.js +5 -0
  146. package/out/_next/static/chunks/1xybsisfyvqrj.js +115 -0
  147. package/out/_next/static/chunks/1yvl8l5yx1rj8.js +4 -0
  148. package/out/_next/static/chunks/{3dcwbsiechj8e.js → 1z-etrje5tsj6.js} +3 -3
  149. package/out/_next/static/chunks/1z1d11slpalrq.js +4 -0
  150. package/out/_next/static/chunks/1zdral15la_p7.js +99 -0
  151. package/out/_next/static/chunks/2-qo63s4vlxol.js +156 -0
  152. package/out/_next/static/chunks/20au-bdji0nu2.js +14 -0
  153. package/out/_next/static/chunks/21zghy5-42i1e.js +1 -0
  154. package/out/_next/static/chunks/22duvsj-priip.js +7 -0
  155. package/out/_next/static/chunks/22rdge7enz4nd.js +12 -0
  156. package/out/_next/static/chunks/{3m_9ozv0orvze.js → 249b4cg2ev597.js} +3 -3
  157. package/out/_next/static/chunks/24caedynuzux0.js +5 -0
  158. package/out/_next/static/chunks/25ite4-jpq_mo.js +4 -0
  159. package/out/_next/static/chunks/25vdihxswn7dy.js +1 -0
  160. package/out/_next/static/chunks/26guwpx1_pkxv.js +1 -0
  161. package/out/_next/static/chunks/28o6402k4vuky.js +11 -0
  162. package/out/_next/static/chunks/29x7cj-318eaa.js +1 -0
  163. package/out/_next/static/chunks/2_0v0fw6x71zy.js +46 -0
  164. package/out/_next/static/chunks/2a9dpzjx5mfjp.js +4 -0
  165. package/out/_next/static/chunks/2apnv1hcv-4zc.js +23 -0
  166. package/out/_next/static/chunks/2b4k5t_myq-pa.js +1 -0
  167. package/out/_next/static/chunks/2bugi3kot5jtu.js +1 -0
  168. package/out/_next/static/chunks/2bxdh-td1el8z.js +5 -0
  169. package/out/_next/static/chunks/2dz0_3jf4m9cy.js +31 -0
  170. package/out/_next/static/chunks/2ege1545af18d.js +4 -0
  171. package/out/_next/static/chunks/2erqawjj0rnih.js +117 -0
  172. package/out/_next/static/chunks/2gfzt_fdr-h96.js +81 -0
  173. package/out/_next/static/chunks/2grm6dtosrvoq.js +1 -0
  174. package/out/_next/static/chunks/2hc3d38gb0q-v.js +1 -0
  175. package/out/_next/static/chunks/2hci18oosfv5d.js +5 -0
  176. package/out/_next/static/chunks/2imf3_f1_ex86.js +1 -0
  177. package/out/_next/static/chunks/{3fpgg_wy6j2ph.js → 2ipcn3vy6d4_6.js} +1 -1
  178. package/out/_next/static/chunks/2iwst7mjldlcz.js +1 -0
  179. package/out/_next/static/chunks/2ja0dztzyw8zw.js +1 -0
  180. package/out/_next/static/chunks/2ja1--2x_gs49.js +83 -0
  181. package/out/_next/static/chunks/2lec5u8obskt6.js +5 -0
  182. package/out/_next/static/chunks/2m38nntt3z8zi.js +103 -0
  183. package/out/_next/static/chunks/2pogx3xggqd8y.js +1 -0
  184. package/out/_next/static/chunks/2q988j4vovsiy.js +8 -0
  185. package/out/_next/static/chunks/2s-0q8i8lr2p2.js +5 -0
  186. package/out/_next/static/chunks/{0a_gulnq-c7to.js → 2u64ldp2xfy8a.js} +7 -7
  187. package/out/_next/static/chunks/2ud5j0_nqocf4.js +5 -0
  188. package/out/_next/static/chunks/2uo6puoi0y082.js +5 -0
  189. package/out/_next/static/chunks/2w3z7kqh6nbmw.js +23 -0
  190. package/out/_next/static/chunks/2y11qf38baxpu.js +14 -0
  191. package/out/_next/static/chunks/{2yw5sk06gdixu.js → 2y8uau15r3p-o.js} +1 -1
  192. package/out/_next/static/chunks/2zb-xmda5rbn0.js +1 -0
  193. package/out/_next/static/chunks/2zsvxbghbsuz1.js +4 -0
  194. package/out/_next/static/chunks/{0s6u_6w75ggbw.js → 3205eg3ochzp4.js} +7 -7
  195. package/out/_next/static/chunks/32g5gxee1kcdc.js +28 -0
  196. package/out/_next/static/chunks/32whi9clpxjd0.js +5 -0
  197. package/out/_next/static/chunks/3368kg846t33d.js +57 -0
  198. package/out/_next/static/chunks/33oz-znvi5-m6.js +1 -0
  199. package/out/_next/static/chunks/345s7967cwd02.js +5 -0
  200. package/out/_next/static/chunks/34wf3lz_fft3k.js +2 -0
  201. package/out/_next/static/chunks/{3btkj1_irjkq7.js → 36x7q29atus_r.js} +6 -6
  202. package/out/_next/static/chunks/37jjn1wguhj-a.js +5 -0
  203. package/out/_next/static/chunks/{1so6ouxrq_ffa.js → 393--hagnnm97.js} +3 -3
  204. package/out/_next/static/chunks/39moagn46hde9.js +5 -0
  205. package/out/_next/static/chunks/3_0q-dmk8few_.css +1 -0
  206. package/out/_next/static/chunks/3_adkt8r_brx4.js +165 -0
  207. package/out/_next/static/chunks/3b1kt-r_75q1a.js +43 -0
  208. package/out/_next/static/chunks/3e38rrs6dszgt.js +8 -0
  209. package/out/_next/static/chunks/{01xy3u9ybz9ts.js → 3e7d8sb4289js.js} +2 -2
  210. package/out/_next/static/chunks/3ek1bahoqa_ll.js +5 -0
  211. package/out/_next/static/chunks/3ek680kdzjdr7.js +1 -0
  212. package/out/_next/static/chunks/3eth7s2-06yuz.js +1 -0
  213. package/out/_next/static/chunks/3exy4ii5maq4x.js +54 -0
  214. package/out/_next/static/chunks/3fevbt4ysloo8.js +8 -0
  215. package/out/_next/static/chunks/3fu072xwkf88o.js +6 -0
  216. package/out/_next/static/chunks/3h6a3clw5m5ro.js +4 -0
  217. package/out/_next/static/chunks/3hmoy4f23y1s4.js +147 -0
  218. package/out/_next/static/chunks/3i4_3b36nutw7.js +33 -0
  219. package/out/_next/static/chunks/3jfe0uesrzz7a.js +1 -0
  220. package/out/_next/static/chunks/3k01tdsm6l20w.js +54 -0
  221. package/out/_next/static/chunks/3lr6hkso67d68.js +6 -0
  222. package/out/_next/static/chunks/3lzin6_25n8rs.js +30 -0
  223. package/out/_next/static/chunks/3nrrzhhoy8amt.js +4 -0
  224. package/out/_next/static/chunks/3o-h2po9z09dk.js +4 -0
  225. package/out/_next/static/chunks/3onharcadlou0.js +327 -0
  226. package/out/_next/static/chunks/3pls-kicv4xu9.js +175 -0
  227. package/out/_next/static/chunks/3t48n1yk76zoa.js +1 -0
  228. package/out/_next/static/chunks/3t_520l4ihlg3.js +54 -0
  229. package/out/_next/static/chunks/3tg_clsx6ux4o.js +1 -0
  230. package/out/_next/static/chunks/3ttz1zgoq3xmp.js +1 -0
  231. package/out/_next/static/chunks/3uekb_s0jaboj.js +1 -0
  232. package/out/_next/static/chunks/3ujdligrod612.js +5 -0
  233. package/out/_next/static/chunks/3www97fxyknos.js +4 -0
  234. package/out/_next/static/chunks/3x_gia2m5w9_l.js +147 -0
  235. package/out/_next/static/chunks/{3j25u7rzawm9f.js → 3xs_undkbcqp7.js} +5 -5
  236. package/out/_next/static/chunks/3yktizlgzr6vc.js +4 -0
  237. package/out/_next/static/chunks/3ytp87o76hzmx.js +100 -0
  238. package/out/_next/static/chunks/40kvu3lk3s9h2.js +276 -0
  239. package/out/_next/static/chunks/41c4n9whpyrjc.js +7 -0
  240. package/out/_next/static/chunks/42dygj7ul4k54.js +33 -0
  241. package/out/_next/static/chunks/449x6nw2kd7l6.js +119 -0
  242. package/out/_next/static/chunks/44b7_q6pkf1k9.js +5 -0
  243. package/out/_next/static/chunks/44qc0zn0tudui.js +2 -0
  244. package/out/_next/static/chunks/45c05mbjow5wz.js +4 -0
  245. package/out/_next/static/chunks/{turbopack-2c3mg3r-05n1w.js → turbopack-077hmtqrhcoji.js} +1 -1
  246. package/out/_offline/index.html +3 -3
  247. package/out/account/forgot-password/index.html +3 -3
  248. package/out/account/index.html +3 -3
  249. package/out/assortments/AssortmentDetailPage/index.html +3 -3
  250. package/out/assortments/index.html +3 -3
  251. package/out/assortments/new/index.html +3 -3
  252. package/out/copilot/index.html +3 -3
  253. package/out/country/CountryDetailPage/index.html +3 -3
  254. package/out/country/index.html +3 -3
  255. package/out/country/new/index.html +3 -3
  256. package/out/currency/CurrencyDetailPage/index.html +3 -3
  257. package/out/currency/index.html +3 -3
  258. package/out/currency/new/index.html +3 -3
  259. package/out/delivery-provider/DeliveryProviderDetailPage/index.html +3 -3
  260. package/out/delivery-provider/index.html +3 -3
  261. package/out/delivery-provider/new/index.html +3 -3
  262. package/out/enrollments/EnrollmentDetailPage/index.html +3 -3
  263. package/out/enrollments/index.html +3 -3
  264. package/out/events/EventDetailPage/index.html +3 -3
  265. package/out/events/index.html +3 -3
  266. package/out/exports/index.html +3 -3
  267. package/out/ext/[[...slug]]/index.html +3 -3
  268. package/out/external/index.html +3 -3
  269. package/out/filters/FilterDetailPage/index.html +3 -3
  270. package/out/filters/index.html +3 -3
  271. package/out/filters/new/index.html +3 -3
  272. package/out/index.html +3 -3
  273. package/out/install/index.html +3 -3
  274. package/out/language/LanguageDetailPage/index.html +3 -3
  275. package/out/language/index.html +3 -3
  276. package/out/language/new/index.html +3 -3
  277. package/out/log-in/index.html +3 -3
  278. package/out/orders/OrderDetailPage/index.html +3 -3
  279. package/out/orders/index.html +3 -3
  280. package/out/payment-provider/PaymentProviderDetailPage/index.html +3 -3
  281. package/out/payment-provider/index.html +3 -3
  282. package/out/payment-provider/new/index.html +3 -3
  283. package/out/products/ProductDetailPage/index.html +3 -3
  284. package/out/products/index.html +3 -3
  285. package/out/products/new/index.html +3 -3
  286. package/out/quotations/QuotationDetailPage/index.html +3 -3
  287. package/out/quotations/index.html +3 -3
  288. package/out/reset-password/index.html +3 -3
  289. package/out/sign-up/index.html +3 -3
  290. package/out/styleguide/index.html +3 -3
  291. package/out/tokens/TokenDetailPage/index.html +3 -3
  292. package/out/tokens/index.html +3 -3
  293. package/out/users/UserDetailPage/index.html +3 -3
  294. package/out/users/index.html +3 -3
  295. package/out/users/new/index.html +3 -3
  296. package/out/verify-email/index.html +3 -3
  297. package/out/warehousing-provider/WarehousingProviderDetailPage/index.html +3 -3
  298. package/out/warehousing-provider/index.html +3 -3
  299. package/out/warehousing-provider/new/index.html +3 -3
  300. package/out/works/WorkDetailPage/index.html +3 -3
  301. package/out/works/WorkQueueListView/index.html +3 -3
  302. package/out/works/index.html +3 -3
  303. package/out/works/management/index.html +3 -3
  304. package/package.json +10 -10
  305. package/src/modules/accounts/hooks/logOut.ts +26 -0
  306. package/src/modules/accounts/hooks/useAddEmail.ts +34 -0
  307. package/src/modules/accounts/hooks/useAddWeb3Address.ts +38 -0
  308. package/src/modules/accounts/hooks/useAddWebAuthnCredentials.ts +48 -0
  309. package/src/modules/accounts/hooks/useBulkUserOperations.ts +91 -0
  310. package/src/modules/accounts/hooks/useChangePassword.ts +36 -0
  311. package/src/modules/accounts/hooks/useCreateUser.ts +74 -0
  312. package/src/modules/accounts/hooks/useCreateWebAuthnCredentialCreationOptions.ts +31 -0
  313. package/src/modules/accounts/hooks/useCreateWebAuthnCredentialRequestOptions.ts +30 -0
  314. package/src/modules/accounts/hooks/useCurrentUser.ts +44 -0
  315. package/src/modules/accounts/hooks/useDeleteUser.ts +26 -0
  316. package/src/modules/accounts/hooks/useEnrollUser.ts +48 -0
  317. package/src/modules/accounts/hooks/useForgotPassword.ts +35 -0
  318. package/src/modules/accounts/hooks/useGenerateLoginCredentials.ts +80 -0
  319. package/src/modules/accounts/hooks/useGenerateWebAuthCredentials.ts +102 -0
  320. package/src/modules/accounts/hooks/useLoginWithPassword.ts +65 -0
  321. package/src/modules/accounts/hooks/useLoginWithWebAuthn.ts +38 -0
  322. package/src/modules/accounts/hooks/useLogoutAllSessions.ts +27 -0
  323. package/src/modules/accounts/hooks/useRemoveBookmark.ts +36 -0
  324. package/src/modules/accounts/hooks/useRemoveEmail.ts +40 -0
  325. package/src/modules/accounts/hooks/useRemoveWeb3Address.ts +38 -0
  326. package/src/modules/accounts/hooks/useRemoveWebAuthCredentials.ts +36 -0
  327. package/src/modules/accounts/hooks/useResetPassword.ts +46 -0
  328. package/src/modules/accounts/hooks/useSendVerificationEmail.ts +35 -0
  329. package/src/modules/accounts/hooks/useSetPassword.ts +38 -0
  330. package/src/modules/accounts/hooks/useSetRoles.ts +40 -0
  331. package/src/modules/accounts/hooks/useSetUserTags.ts +48 -0
  332. package/src/modules/accounts/hooks/useSetUsername.ts +40 -0
  333. package/src/modules/accounts/hooks/useUpdateUserAvatar.ts +49 -0
  334. package/src/modules/accounts/hooks/useUpdateUserProfile.ts +40 -0
  335. package/src/modules/accounts/hooks/useUser.ts +201 -0
  336. package/src/modules/accounts/hooks/useUserBookmarks.ts +51 -0
  337. package/src/modules/accounts/hooks/useUserExport.ts +107 -0
  338. package/src/modules/accounts/hooks/useUserWebAuthnCredentials.ts +44 -0
  339. package/src/modules/accounts/hooks/useUsers.ts +82 -0
  340. package/src/modules/accounts/hooks/useUsersCount.ts +50 -0
  341. package/src/modules/accounts/hooks/useValidateEmailVerificationToken.ts +34 -0
  342. package/src/modules/accounts/hooks/useValidateResetPasswordToken.ts +35 -0
  343. package/src/modules/accounts/hooks/useVerifyEmail.ts +41 -0
  344. package/src/modules/accounts/hooks/useVerifyWeb3Address.ts +40 -0
  345. package/src/modules/assortment/fragments/AssortmentChildrenFragment.ts +16 -0
  346. package/src/modules/assortment/fragments/AssortmentFragment.ts +31 -0
  347. package/src/modules/assortment/fragments/AssortmentLinkFragment.ts +18 -0
  348. package/src/modules/assortment/fragments/AssortmentMediaFragment.ts +19 -0
  349. package/src/modules/assortment/fragments/AssortmentMediaTextsFragment.ts +12 -0
  350. package/src/modules/assortment/fragments/AssortmentTextsFragment.ts +14 -0
  351. package/src/modules/assortment/hooks/useAddAssortmentFilter.ts +46 -0
  352. package/src/modules/assortment/hooks/useAddAssortmentLink.ts +46 -0
  353. package/src/modules/assortment/hooks/useAddAssortmentMedia.ts +52 -0
  354. package/src/modules/assortment/hooks/useAddAssortmentProduct.ts +46 -0
  355. package/src/modules/assortment/hooks/useAssortment.ts +56 -0
  356. package/src/modules/assortment/hooks/useAssortmentChildren.ts +58 -0
  357. package/src/modules/assortment/hooks/useAssortmentExport.ts +60 -0
  358. package/src/modules/assortment/hooks/useAssortmentFilters.ts +51 -0
  359. package/src/modules/assortment/hooks/useAssortmentLinks.ts +54 -0
  360. package/src/modules/assortment/hooks/useAssortmentMedia.ts +57 -0
  361. package/src/modules/assortment/hooks/useAssortmentPaths.ts +39 -0
  362. package/src/modules/assortment/hooks/useAssortmentProducts.ts +62 -0
  363. package/src/modules/assortment/hooks/useAssortments.ts +103 -0
  364. package/src/modules/assortment/hooks/useAssortmentsCount.ts +51 -0
  365. package/src/modules/assortment/hooks/useBulkAssortmentOperations.ts +100 -0
  366. package/src/modules/assortment/hooks/useCreateAssortment.ts +55 -0
  367. package/src/modules/assortment/hooks/usePrepareAssortmentImport.ts +211 -0
  368. package/src/modules/assortment/hooks/useRemoveAssortment.ts +36 -0
  369. package/src/modules/assortment/hooks/useRemoveAssortmentFilter.ts +36 -0
  370. package/src/modules/assortment/hooks/useRemoveAssortmentLink.ts +36 -0
  371. package/src/modules/assortment/hooks/useRemoveAssortmentMedia.ts +36 -0
  372. package/src/modules/assortment/hooks/useRemoveAssortmentProduct.ts +36 -0
  373. package/src/modules/assortment/hooks/useReorderAssortmentFilters.ts +39 -0
  374. package/src/modules/assortment/hooks/useReorderAssortmentLinks.ts +37 -0
  375. package/src/modules/assortment/hooks/useReorderAssortmentMedia.ts +37 -0
  376. package/src/modules/assortment/hooks/useReorderAssortmentProducts.ts +39 -0
  377. package/src/modules/assortment/hooks/useTranslatedAssortmentMediaTexts.ts +41 -0
  378. package/src/modules/assortment/hooks/useTranslatedAssortmentTexts.ts +40 -0
  379. package/src/modules/assortment/hooks/useUpdateAssortment.ts +43 -0
  380. package/src/modules/assortment/hooks/useUpdateAssortmentMediaTexts.ts +45 -0
  381. package/src/modules/assortment/hooks/useUpdateAssortmentTexts.ts +42 -0
  382. package/src/modules/common/fragments/AddressFragment.ts +16 -0
  383. package/src/modules/common/hooks/useApp.ts +11 -0
  384. package/src/modules/common/hooks/useBulkActionConfirmation.tsx +68 -0
  385. package/src/modules/common/hooks/useBulkResultHandler.ts +83 -0
  386. package/src/modules/common/hooks/useBulkSelection.ts +86 -0
  387. package/src/modules/common/hooks/useCSVExport.ts +94 -0
  388. package/src/modules/common/hooks/useCSVImport.ts +69 -0
  389. package/src/modules/common/hooks/useChatEndpointChecker.ts +25 -0
  390. package/src/modules/common/hooks/useConfirmMediaUpload.ts +45 -0
  391. package/src/modules/common/hooks/useDashboardMetrics.ts +42 -0
  392. package/src/modules/common/hooks/useLocalStorage.ts +34 -0
  393. package/src/modules/common/hooks/useOrderAnalytics.ts +139 -0
  394. package/src/modules/common/hooks/useOrderItemsAnalytics.ts +107 -0
  395. package/src/modules/common/hooks/useOutsideClick.ts +29 -0
  396. package/src/modules/common/hooks/usePortal.ts +54 -0
  397. package/src/modules/common/hooks/useScrollRestoration.ts +123 -0
  398. package/src/modules/common/hooks/useShopConfiguration.ts +83 -0
  399. package/src/modules/common/hooks/useShopInfo.ts +65 -0
  400. package/src/modules/common/hooks/useStatusTypes.ts +29 -0
  401. package/src/modules/common/hooks/useSystemRoles.ts +29 -0
  402. package/src/modules/common/hooks/useTheme.ts +14 -0
  403. package/src/modules/copilot/hooks/useAvailableTools.ts +92 -0
  404. package/src/modules/copilot/hooks/useChatManager.ts +169 -0
  405. package/src/modules/copilot/hooks/useToolTextNormalizer.ts +84 -0
  406. package/src/modules/country/fragments/CountryFragment.ts +17 -0
  407. package/src/modules/country/hooks/useCountries.ts +66 -0
  408. package/src/modules/country/hooks/useCountry.ts +34 -0
  409. package/src/modules/country/hooks/useCreateCountry.ts +41 -0
  410. package/src/modules/country/hooks/useRemoveCountry.ts +38 -0
  411. package/src/modules/country/hooks/useUpdateCountry.ts +42 -0
  412. package/src/modules/currency/fragments/CurrencyFragment.ts +13 -0
  413. package/src/modules/currency/hooks/useCreateCurrency.ts +48 -0
  414. package/src/modules/currency/hooks/useCurrencies.ts +68 -0
  415. package/src/modules/currency/hooks/useCurrency.ts +34 -0
  416. package/src/modules/currency/hooks/useRemoveCurrency.ts +38 -0
  417. package/src/modules/currency/hooks/useUpdateCurrency.ts +47 -0
  418. package/src/modules/delivery-provider/hooks/useCreateDeliveryProvider.ts +67 -0
  419. package/src/modules/delivery-provider/hooks/useDeliveryInterfacesByType.ts +38 -0
  420. package/src/modules/delivery-provider/hooks/useDeliveryProvider.ts +60 -0
  421. package/src/modules/delivery-provider/hooks/useDeliveryProviderTypes.ts +34 -0
  422. package/src/modules/delivery-provider/hooks/useDeliveryProviders.ts +59 -0
  423. package/src/modules/delivery-provider/hooks/useRemoveDeliveryProvider.ts +38 -0
  424. package/src/modules/delivery-provider/hooks/useUpdateDeliveryProvider.ts +68 -0
  425. package/src/modules/enrollment/fragments/EnrollmentDetailFragment.ts +110 -0
  426. package/src/modules/enrollment/fragments/EnrollmentFragment.ts +66 -0
  427. package/src/modules/enrollment/hooks/useActivateEnrollment.ts +36 -0
  428. package/src/modules/enrollment/hooks/useEnrollment.ts +39 -0
  429. package/src/modules/enrollment/hooks/useEnrollments.ts +70 -0
  430. package/src/modules/enrollment/hooks/useSendEnrollmentEmail.ts +35 -0
  431. package/src/modules/enrollment/hooks/useSuspendEnrollment.ts +29 -0
  432. package/src/modules/enrollment/hooks/useTerminateEnrollment.ts +36 -0
  433. package/src/modules/enrollment/hooks/useUpdateEnrollmentPlan.ts +45 -0
  434. package/src/modules/enrollment/hooks/useUserEnrollments.ts +61 -0
  435. package/src/modules/event/fragments/EventFragment.ts +12 -0
  436. package/src/modules/event/hooks/useEvent.ts +32 -0
  437. package/src/modules/event/hooks/useEventTypes.ts +29 -0
  438. package/src/modules/event/hooks/useEvents.ts +77 -0
  439. package/src/modules/filter/fragments/FilterFragment.ts +24 -0
  440. package/src/modules/filter/fragments/FilterOptionFragment.ts +16 -0
  441. package/src/modules/filter/fragments/FilterTextsFragment.ts +12 -0
  442. package/src/modules/filter/hooks/useBulkFilterOperations.ts +59 -0
  443. package/src/modules/filter/hooks/useCreateFilter.ts +44 -0
  444. package/src/modules/filter/hooks/useCreateFilterOption.ts +42 -0
  445. package/src/modules/filter/hooks/useFilter.ts +44 -0
  446. package/src/modules/filter/hooks/useFilterExport.ts +35 -0
  447. package/src/modules/filter/hooks/useFilterOptions.ts +40 -0
  448. package/src/modules/filter/hooks/useFilterTypes.ts +34 -0
  449. package/src/modules/filter/hooks/useFilters.ts +78 -0
  450. package/src/modules/filter/hooks/useFiltersCount.ts +37 -0
  451. package/src/modules/filter/hooks/usePrepareFilterImport.ts +142 -0
  452. package/src/modules/filter/hooks/useRemoveFilter.ts +34 -0
  453. package/src/modules/filter/hooks/useRemoveFilterOption.ts +40 -0
  454. package/src/modules/filter/hooks/useTranslatedFilterTexts.ts +40 -0
  455. package/src/modules/filter/hooks/useUpdateFilter.ts +38 -0
  456. package/src/modules/filter/hooks/useUpdateFilterTexts.ts +48 -0
  457. package/src/modules/forms/hooks/useField.ts +151 -0
  458. package/src/modules/forms/hooks/useForm.ts +210 -0
  459. package/src/modules/forms/hooks/useFormContext.ts +7 -0
  460. package/src/modules/language/fragments/LanguageFragment.ts +13 -0
  461. package/src/modules/language/hooks/useCreateLanguage.ts +40 -0
  462. package/src/modules/language/hooks/useLanguage.ts +34 -0
  463. package/src/modules/language/hooks/useLanguages.ts +64 -0
  464. package/src/modules/language/hooks/useRemoveLanguage.ts +38 -0
  465. package/src/modules/language/hooks/useUpdateLanguage.ts +42 -0
  466. package/src/modules/modal/hooks/useModal.ts +8 -0
  467. package/src/modules/order/fragments/OrderDetailFragment.ts +255 -0
  468. package/src/modules/order/fragments/OrderFragment.ts +42 -0
  469. package/src/modules/order/hooks/useConfirmOrder.ts +36 -0
  470. package/src/modules/order/hooks/useDeliverOrder.ts +36 -0
  471. package/src/modules/order/hooks/useOrder.ts +35 -0
  472. package/src/modules/order/hooks/useOrders.ts +105 -0
  473. package/src/modules/order/hooks/usePayOrder.ts +36 -0
  474. package/src/modules/order/hooks/useRejectOrder.ts +36 -0
  475. package/src/modules/order/hooks/useRemoveOrder.ts +36 -0
  476. package/src/modules/order/hooks/useUserCart.ts +71 -0
  477. package/src/modules/order/hooks/useUserOrders.ts +65 -0
  478. package/src/modules/payment-providers/fragments/PaymentProviderFragment.ts +21 -0
  479. package/src/modules/payment-providers/hooks/useCreatePaymentProvider.ts +43 -0
  480. package/src/modules/payment-providers/hooks/usePaymentInterfacesByType.ts +38 -0
  481. package/src/modules/payment-providers/hooks/usePaymentProvider.ts +39 -0
  482. package/src/modules/payment-providers/hooks/usePaymentProviderTypes.ts +34 -0
  483. package/src/modules/payment-providers/hooks/usePaymentProviders.ts +42 -0
  484. package/src/modules/payment-providers/hooks/useRemovePaymentProvider.ts +38 -0
  485. package/src/modules/payment-providers/hooks/useUpdatePaymentProvider.ts +47 -0
  486. package/src/modules/product/fragments/ProductAssignmentFragment.ts +39 -0
  487. package/src/modules/product/fragments/ProductBriefFragment.ts +57 -0
  488. package/src/modules/product/fragments/ProductCatalogPriceFragment.ts +23 -0
  489. package/src/modules/product/fragments/ProductDetailFragment.ts +51 -0
  490. package/src/modules/product/fragments/ProductDimensionFragment.ts +12 -0
  491. package/src/modules/product/fragments/ProductMediaFragment.ts +24 -0
  492. package/src/modules/product/fragments/ProductMediaTextsFragment.ts +12 -0
  493. package/src/modules/product/fragments/ProductPlanConfigurationFragment.ts +14 -0
  494. package/src/modules/product/fragments/ProductTextsFragment.ts +17 -0
  495. package/src/modules/product/fragments/ProductVariationFragment.ts +27 -0
  496. package/src/modules/product/fragments/TokenFragment.ts +24 -0
  497. package/src/modules/product/hooks/useAddProductAssignment.ts +46 -0
  498. package/src/modules/product/hooks/useAddProductMedia.ts +47 -0
  499. package/src/modules/product/hooks/useBulkProductOperations.ts +123 -0
  500. package/src/modules/product/hooks/useCreateProduct.ts +72 -0
  501. package/src/modules/product/hooks/useCreateProductBundleItem.ts +40 -0
  502. package/src/modules/product/hooks/useCreateProductVariation.ts +46 -0
  503. package/src/modules/product/hooks/useCreateProductVariationOption.ts +46 -0
  504. package/src/modules/product/hooks/useExportToken.ts +51 -0
  505. package/src/modules/product/hooks/useMenuPosition.ts +34 -0
  506. package/src/modules/product/hooks/usePrepareProductImport.ts +350 -0
  507. package/src/modules/product/hooks/useProduct.ts +93 -0
  508. package/src/modules/product/hooks/useProductAssignments.ts +71 -0
  509. package/src/modules/product/hooks/useProductBundleItems.ts +61 -0
  510. package/src/modules/product/hooks/useProductCatalogPrices.ts +39 -0
  511. package/src/modules/product/hooks/useProductExport.ts +90 -0
  512. package/src/modules/product/hooks/useProductFulfillmentSimulation.ts +137 -0
  513. package/src/modules/product/hooks/useProductMedia.ts +44 -0
  514. package/src/modules/product/hooks/useProductPlan.ts +50 -0
  515. package/src/modules/product/hooks/useProductPlanConfigurationOptions.ts +42 -0
  516. package/src/modules/product/hooks/useProductReviews.ts +62 -0
  517. package/src/modules/product/hooks/useProductSupply.ts +52 -0
  518. package/src/modules/product/hooks/useProductTokenization.ts +51 -0
  519. package/src/modules/product/hooks/useProductVariationTypes.ts +34 -0
  520. package/src/modules/product/hooks/useProductVariations.ts +50 -0
  521. package/src/modules/product/hooks/useProductWarehousing.ts +45 -0
  522. package/src/modules/product/hooks/useProducts.ts +111 -0
  523. package/src/modules/product/hooks/useProductsCount.ts +50 -0
  524. package/src/modules/product/hooks/usePublishProduct.ts +39 -0
  525. package/src/modules/product/hooks/useReOrderProductMedia.ts +36 -0
  526. package/src/modules/product/hooks/useRemoveBundleItem.ts +37 -0
  527. package/src/modules/product/hooks/useRemoveProduct.ts +36 -0
  528. package/src/modules/product/hooks/useRemoveProductAssignment.ts +40 -0
  529. package/src/modules/product/hooks/useRemoveProductMedia.ts +36 -0
  530. package/src/modules/product/hooks/useRemoveProductVariation.ts +36 -0
  531. package/src/modules/product/hooks/useRemoveProductVariationOption.ts +43 -0
  532. package/src/modules/product/hooks/useScaffoldBundleItem.ts +38 -0
  533. package/src/modules/product/hooks/useScaffoldVariationProduct.ts +50 -0
  534. package/src/modules/product/hooks/useSmartContractStandards.ts +34 -0
  535. package/src/modules/product/hooks/useTranslatedProductMediaTexts.ts +39 -0
  536. package/src/modules/product/hooks/useTranslatedProductTexts.ts +42 -0
  537. package/src/modules/product/hooks/useUnPublishProduct.ts +39 -0
  538. package/src/modules/product/hooks/useUpdateProduct.ts +46 -0
  539. package/src/modules/product/hooks/useUpdateProductCommerce.ts +61 -0
  540. package/src/modules/product/hooks/useUpdateProductMediaTexts.ts +42 -0
  541. package/src/modules/product/hooks/useUpdateProductPlan.ts +54 -0
  542. package/src/modules/product/hooks/useUpdateProductSupply.ts +60 -0
  543. package/src/modules/product/hooks/useUpdateProductTexts.ts +39 -0
  544. package/src/modules/product/hooks/useUpdateProductTokenization.ts +51 -0
  545. package/src/modules/product/hooks/useUpdateProductVariationTexts.ts +50 -0
  546. package/src/modules/product/hooks/useUpdateProductWarehousing.ts +50 -0
  547. package/src/modules/product/hooks/useUserTokens.ts +48 -0
  548. package/src/modules/product-review/fragments/ProductReviewDetailFragment.ts +55 -0
  549. package/src/modules/product-review/hooks/useAddProductReviewVote.ts +55 -0
  550. package/src/modules/product-review/hooks/useCreateProductReview.ts +47 -0
  551. package/src/modules/product-review/hooks/useProductReviewsByProductId.ts +70 -0
  552. package/src/modules/product-review/hooks/useRemoveProductReview.ts +38 -0
  553. package/src/modules/product-review/hooks/useRemoveProductReviewVote.ts +43 -0
  554. package/src/modules/product-review/hooks/useUserProductReviews.ts +92 -0
  555. package/src/modules/quotation/fragments/QuotationDetailFragment.ts +70 -0
  556. package/src/modules/quotation/fragments/QuotationFragment.ts +54 -0
  557. package/src/modules/quotation/hooks/useMakeQuotationProposal.ts +41 -0
  558. package/src/modules/quotation/hooks/useQuotation.ts +37 -0
  559. package/src/modules/quotation/hooks/useQuotations.ts +61 -0
  560. package/src/modules/quotation/hooks/useRejectQuotation.ts +41 -0
  561. package/src/modules/quotation/hooks/useUserQuotations.ts +60 -0
  562. package/src/modules/quotation/hooks/useVerifyQuotation.ts +41 -0
  563. package/src/modules/search/fragments/GlobalSearchFragment.ts +20 -0
  564. package/src/modules/search/hooks/useGlobalSearch.ts +168 -0
  565. package/src/modules/token/hooks/useInvalidateTicket.ts +27 -0
  566. package/src/modules/token/hooks/useToken.ts +64 -0
  567. package/src/modules/token/hooks/useTokens.ts +72 -0
  568. package/src/modules/warehousing-providers/fragments/WarehousingProviderFragment.ts +21 -0
  569. package/src/modules/warehousing-providers/hooks/useCreateWarehousingProvider.ts +46 -0
  570. package/src/modules/warehousing-providers/hooks/useRemoveWarehousingProvider.ts +38 -0
  571. package/src/modules/warehousing-providers/hooks/useUpdateWarehousingProvider.ts +47 -0
  572. package/src/modules/warehousing-providers/hooks/useWarehousingInterfacesByType.ts +38 -0
  573. package/src/modules/warehousing-providers/hooks/useWarehousingProvider.ts +39 -0
  574. package/src/modules/warehousing-providers/hooks/useWarehousingProviderTypes.ts +34 -0
  575. package/src/modules/warehousing-providers/hooks/useWarehousingProviders.ts +41 -0
  576. package/src/modules/work/fragments/WorkFragment.ts +24 -0
  577. package/src/modules/work/hooks/useActiveWorkTypes.ts +29 -0
  578. package/src/modules/work/hooks/useAddWork.ts +62 -0
  579. package/src/modules/work/hooks/useAllocateWork.ts +40 -0
  580. package/src/modules/work/hooks/useRecentExports.ts +129 -0
  581. package/src/modules/work/hooks/useRegisteredWorkTypes.ts +27 -0
  582. package/src/modules/work/hooks/useRemoveWork.ts +36 -0
  583. package/src/modules/work/hooks/useWork.ts +42 -0
  584. package/src/modules/work/hooks/useWorkQueue.ts +98 -0
  585. package/src/sdk/README.md +2 -2
  586. package/out/_next/static/BPoacQET3TJr2q9E370Ez/_buildManifest.js +0 -262
  587. package/out/_next/static/chunks/02ir8k2vqhw7u.js +0 -4
  588. package/out/_next/static/chunks/03mdkmx9pb3yx.js +0 -28
  589. package/out/_next/static/chunks/03spbldywp99b.js +0 -31
  590. package/out/_next/static/chunks/0531sa8v36e39.js +0 -1
  591. package/out/_next/static/chunks/065ltxdt7s8b2.js +0 -134
  592. package/out/_next/static/chunks/06b1jza2fvc6f.js +0 -4
  593. package/out/_next/static/chunks/0701uizxsgs75.js +0 -4
  594. package/out/_next/static/chunks/09olk50zbo5r6.js +0 -5
  595. package/out/_next/static/chunks/09pabifvs84zb.js +0 -12
  596. package/out/_next/static/chunks/0agx-csdwbk-x.js +0 -5
  597. package/out/_next/static/chunks/0clmvy-auef0p.js +0 -14
  598. package/out/_next/static/chunks/0czktxcs2aa12.js +0 -1
  599. package/out/_next/static/chunks/0d_qylr054ab-.js +0 -5
  600. package/out/_next/static/chunks/0e2znhpcecrqs.js +0 -175
  601. package/out/_next/static/chunks/0ef4vp3ehm369.js +0 -4
  602. package/out/_next/static/chunks/0fggi8jpi5gjk.js +0 -165
  603. package/out/_next/static/chunks/0gyabz3vqllr6.js +0 -83
  604. package/out/_next/static/chunks/0j05dboa5_xkw.js +0 -5
  605. package/out/_next/static/chunks/0kr4ift9_1a3s.js +0 -1
  606. package/out/_next/static/chunks/0l8tmlevl_6p0.js +0 -1
  607. package/out/_next/static/chunks/0o91usftba97q.js +0 -54
  608. package/out/_next/static/chunks/0oi1kpp0levnm.js +0 -1
  609. package/out/_next/static/chunks/0p86ng98eiz5q.js +0 -11
  610. package/out/_next/static/chunks/0pw1zl8_l93xl.js +0 -5
  611. package/out/_next/static/chunks/0py8-umjmwiwi.js +0 -156
  612. package/out/_next/static/chunks/0q0m2pv-3b2e2.js +0 -4
  613. package/out/_next/static/chunks/0r57e83u39trg.js +0 -5
  614. package/out/_next/static/chunks/0r9a_mcjh1k24.js +0 -6
  615. package/out/_next/static/chunks/0rgtc82y8z7_x.js +0 -5
  616. package/out/_next/static/chunks/0rxhx_x-7dojh.js +0 -182
  617. package/out/_next/static/chunks/0teb3b5h78855.js +0 -44
  618. package/out/_next/static/chunks/0thsuuvsozjop.js +0 -54
  619. package/out/_next/static/chunks/0v6x3uondh5hw.js +0 -5
  620. package/out/_next/static/chunks/0v_uz3j8jolmq.js +0 -4
  621. package/out/_next/static/chunks/0vwmp6qrw7odm.js +0 -7
  622. package/out/_next/static/chunks/0w6t6v_jzrudq.js +0 -4
  623. package/out/_next/static/chunks/0w7gz501ry22r.js +0 -4
  624. package/out/_next/static/chunks/0xgn-89s97a5w.js +0 -1
  625. package/out/_next/static/chunks/0xqtemh7t38y9.js +0 -119
  626. package/out/_next/static/chunks/1-1rj15j67dqt.js +0 -1
  627. package/out/_next/static/chunks/10drou7w-k58p.js +0 -4
  628. package/out/_next/static/chunks/11w7hldkge7sg.js +0 -8
  629. package/out/_next/static/chunks/130c8cta7pec6.js +0 -1
  630. package/out/_next/static/chunks/13qi39a_b6gkv.js +0 -1
  631. package/out/_next/static/chunks/15142badc5ufq.js +0 -4
  632. package/out/_next/static/chunks/155boltbcvwo-.js +0 -63
  633. package/out/_next/static/chunks/15_nwd8p454gd.js +0 -1
  634. package/out/_next/static/chunks/15s4qkdyz56pg.js +0 -115
  635. package/out/_next/static/chunks/15vdx0kewzv-6.js +0 -33
  636. package/out/_next/static/chunks/16shuavdpgni8.js +0 -327
  637. package/out/_next/static/chunks/170j06y4-47o4.js +0 -5
  638. package/out/_next/static/chunks/18a5kibvycb6u.js +0 -1
  639. package/out/_next/static/chunks/1_bckhq06wfmb.js +0 -4
  640. package/out/_next/static/chunks/1_ymf_rfke1aw.js +0 -6
  641. package/out/_next/static/chunks/1a1m389awxw4k.js +0 -1
  642. package/out/_next/static/chunks/1albq_5cppsa1.js +0 -5
  643. package/out/_next/static/chunks/1bhibqf8k2-z1.js +0 -117
  644. package/out/_next/static/chunks/1bxesp6kakz8_.js +0 -353
  645. package/out/_next/static/chunks/1d80ahah359g5.js +0 -174
  646. package/out/_next/static/chunks/1dbjry-rs_5we.js +0 -1
  647. package/out/_next/static/chunks/1dlr1eig6zpl1.js +0 -12
  648. package/out/_next/static/chunks/1gq8ickcg_vmv.js +0 -147
  649. package/out/_next/static/chunks/1gyrsx1nip-lm.js +0 -2
  650. package/out/_next/static/chunks/1hma23kynopdj.js +0 -3
  651. package/out/_next/static/chunks/1i996uxxmc736.js +0 -234
  652. package/out/_next/static/chunks/1ivhp-mi-5l--.js +0 -57
  653. package/out/_next/static/chunks/1ktkks-wpk8q-.js +0 -1
  654. package/out/_next/static/chunks/1kz62r46jwi0y.js +0 -5
  655. package/out/_next/static/chunks/1lex3myb5hmsw.js +0 -1
  656. package/out/_next/static/chunks/1lha1nklxo2g7.js +0 -1
  657. package/out/_next/static/chunks/1mwmcucidjio0.js +0 -8
  658. package/out/_next/static/chunks/1mzejejof4s6g.js +0 -147
  659. package/out/_next/static/chunks/1os6pvhjeb16o.js +0 -1
  660. package/out/_next/static/chunks/1p937fyqa7ssz.js +0 -1
  661. package/out/_next/static/chunks/1po7d3udj6iv4.js +0 -5
  662. package/out/_next/static/chunks/1qxxbcidu-hmv.js +0 -1
  663. package/out/_next/static/chunks/1re4i2t_po4sr.js +0 -95
  664. package/out/_next/static/chunks/1s4oi1bw8zl5d.js +0 -31
  665. package/out/_next/static/chunks/1sb04cqudnfpj.js +0 -4
  666. package/out/_next/static/chunks/1uom050rz5iol.js +0 -272
  667. package/out/_next/static/chunks/1uymuiqrms2h8.js +0 -103
  668. package/out/_next/static/chunks/1wijj_fal57co.js +0 -2
  669. package/out/_next/static/chunks/1wpen9t3_zbte.js +0 -1
  670. package/out/_next/static/chunks/1wpv1sl7vwg04.js +0 -99
  671. package/out/_next/static/chunks/1y3poj860g968.js +0 -24
  672. package/out/_next/static/chunks/1yk0pxcl4urkd.js +0 -4
  673. package/out/_next/static/chunks/1z2rl3h7scna4.js +0 -7
  674. package/out/_next/static/chunks/1zyhq82pkterc.js +0 -61
  675. package/out/_next/static/chunks/2-zr9-ri30va5.css +0 -1
  676. package/out/_next/static/chunks/20j8cdot33hql.js +0 -13
  677. package/out/_next/static/chunks/21fo9zerxyx-l.js +0 -59
  678. package/out/_next/static/chunks/22sxsq82r3cwy.js +0 -41
  679. package/out/_next/static/chunks/23nwkbry8kz0-.js +0 -1
  680. package/out/_next/static/chunks/259ckrmoldaqg.js +0 -5
  681. package/out/_next/static/chunks/25y2dqqrhstuq.js +0 -5
  682. package/out/_next/static/chunks/28myh-gi8t3t7.js +0 -7
  683. package/out/_next/static/chunks/29y82c6-u55hj.js +0 -5
  684. package/out/_next/static/chunks/2ahlen2u4lbnm.js +0 -16
  685. package/out/_next/static/chunks/2c3ehieqiwiw8.js +0 -119
  686. package/out/_next/static/chunks/2c5gq6izeq6nx.js +0 -81
  687. package/out/_next/static/chunks/2cj8g3fxmitaa.js +0 -1
  688. package/out/_next/static/chunks/2d9lzme_uzwvq.js +0 -1
  689. package/out/_next/static/chunks/2dqoft2pp4355.js +0 -1
  690. package/out/_next/static/chunks/2gso7_8v7owco.js +0 -1
  691. package/out/_next/static/chunks/2hc4nowrexhn3.js +0 -100
  692. package/out/_next/static/chunks/2hoi6cb1lromr.js +0 -4
  693. package/out/_next/static/chunks/2hw2_8kkf_2fg.js +0 -1
  694. package/out/_next/static/chunks/2kd4p_esjbozz.js +0 -21
  695. package/out/_next/static/chunks/2lwhn1ypqwukz.js +0 -11
  696. package/out/_next/static/chunks/2oz432iieo_c6.js +0 -43
  697. package/out/_next/static/chunks/2qjnhmz4c5fq1.js +0 -23
  698. package/out/_next/static/chunks/2rdjgc7_za785.js +0 -9
  699. package/out/_next/static/chunks/2ru66cyp0hbxn.js +0 -103
  700. package/out/_next/static/chunks/2ung-az_h871_.js +0 -4
  701. package/out/_next/static/chunks/2v4rvvdyh028e.js +0 -1
  702. package/out/_next/static/chunks/2vsl3-revotpl.js +0 -43
  703. package/out/_next/static/chunks/2wbc_9uwtsjbp.js +0 -15
  704. package/out/_next/static/chunks/2xixk0t9e9mnw.js +0 -1
  705. package/out/_next/static/chunks/2y6i_xssusr93.js +0 -1
  706. package/out/_next/static/chunks/2y_t26eglpeka.js +0 -4
  707. package/out/_next/static/chunks/3-hgyqm9mhcm9.js +0 -33
  708. package/out/_next/static/chunks/364y5vueeinvz.js +0 -276
  709. package/out/_next/static/chunks/366b9y413lk4d.js +0 -33
  710. package/out/_next/static/chunks/36vauyb71ot_b.js +0 -61
  711. package/out/_next/static/chunks/394m309ssmlo3.js +0 -5
  712. package/out/_next/static/chunks/39pveojee3ma1.js +0 -33
  713. package/out/_next/static/chunks/3_--novhq2u1q.js +0 -807
  714. package/out/_next/static/chunks/3apnk6kuvwze8.js +0 -5
  715. package/out/_next/static/chunks/3b0868kyqqkn3.js +0 -5
  716. package/out/_next/static/chunks/3dyd0ilb-ee5w.js +0 -8
  717. package/out/_next/static/chunks/3eftzknnu45-s.js +0 -1
  718. package/out/_next/static/chunks/3ejsx4af27cct.js +0 -7
  719. package/out/_next/static/chunks/3es4yddhl8uwc.js +0 -7
  720. package/out/_next/static/chunks/3inp15oicq85k.js +0 -1
  721. package/out/_next/static/chunks/3kd-t_qz3nxh7.js +0 -30
  722. package/out/_next/static/chunks/3kl8vv7w9jkjr.js +0 -23
  723. package/out/_next/static/chunks/3kmfx3f7oyfdm.js +0 -5
  724. package/out/_next/static/chunks/3koj4-48a7p_9.js +0 -4
  725. package/out/_next/static/chunks/3l7glrtu8ueuo.js +0 -4
  726. package/out/_next/static/chunks/3lgq9oa_2erwo.js +0 -5
  727. package/out/_next/static/chunks/3muxcxam24i5z.js +0 -1
  728. package/out/_next/static/chunks/3nimt7ngr5zv6.js +0 -46
  729. package/out/_next/static/chunks/3pwezwpggrz59.js +0 -74
  730. package/out/_next/static/chunks/3r02t7a7jknrv.js +0 -7
  731. package/out/_next/static/chunks/3s40iuaou1rt4.js +0 -1
  732. package/out/_next/static/chunks/3selzn479n73i.js +0 -16
  733. package/out/_next/static/chunks/3srflqnqdfd60.js +0 -5
  734. package/out/_next/static/chunks/3t57k35xu2eo8.js +0 -5
  735. package/out/_next/static/chunks/3tu90a7do336z.js +0 -12
  736. package/out/_next/static/chunks/3ukgj2jzxf10n.js +0 -5
  737. package/out/_next/static/chunks/3vosu-lpiis6v.js +0 -5
  738. package/out/_next/static/chunks/3xaz8fvw2x6b3.js +0 -5
  739. package/out/_next/static/chunks/3xgjhwzul66dp.js +0 -4
  740. package/out/_next/static/chunks/3zze6y1x00k__.js +0 -165
  741. package/out/_next/static/chunks/40730dyt912zu.js +0 -5
  742. package/out/_next/static/chunks/40f26tfp8txip.js +0 -5
  743. package/out/_next/static/chunks/40kc42ezz2dri.js +0 -1
  744. package/out/_next/static/chunks/41f60q88qcigi.js +0 -39
  745. package/out/_next/static/chunks/41l5iphw-rna3.js +0 -44
  746. package/out/_next/static/chunks/423kk9x5t9_b8.js +0 -5
  747. package/out/_next/static/chunks/42k5e3tr3uyzs.js +0 -54
  748. package/out/_next/static/chunks/4481d7yj7bm2q.js +0 -5
  749. package/out/_next/static/chunks/448is1kpt9eaa.js +0 -39
  750. package/out/_next/static/chunks/44fkzg2e80pqt.js +0 -8
  751. /package/out/_next/static/{BPoacQET3TJr2q9E370Ez → bg3Z_ZBjStiTvJAHlsPDE}/_clientMiddlewareManifest.js +0 -0
  752. /package/out/_next/static/{BPoacQET3TJr2q9E370Ez → bg3Z_ZBjStiTvJAHlsPDE}/_ssgManifest.js +0 -0
@@ -0,0 +1,3 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,60166,(e,t,s)=>{let a="/copilot";(window.__NEXT_P=window.__NEXT_P||[]).push([a,()=>e.r(95944)]),t.hot&&t.hot.dispose(function(){window.__NEXT_P.push([a])})},95944,e=>{"use strict";var t=e.i(91398),s=e.i(91788),a=e.i(95377);e.i(16717);var r=e.i(7654),l=e.i(31858),d=e.i(3812),i=e.i(98634),n=e.i(9675);let c=({text:e,className:s})=>(0,t.jsx)("div",{className:`prose dark:prose-invert max-w-none [&>*:last-child]:mb-0 ${s||"mb-4"}`,children:(0,t.jsx)(r.f,{components:{img:({node:e,...s})=>(0,t.jsx)(n.default,{alt:"",src:s.src,...s,width:200,height:50})},rehypePlugins:[l.f,d.f,i.f],children:e})});var o=e.i(75229),x=e.i(3326);let m=({data:e})=>{let[a,r]=(0,s.useState)(!1),{formatMessage:l}=(0,x.X)();return(0,t.jsx)("div",{className:"relative mb-4",children:(0,t.jsxs)("div",{className:"my-4 relative rounded-md bg-surface border border-border-subtle",children:[(0,t.jsx)("pre",{className:`p-4 text-xs overflow-x-auto overflow-y-hidden ${!a?"max-h-[300px]":""}`,children:(0,t.jsx)("code",{className:"text-text-secondary",children:JSON.stringify(e,null,2)})}),!a&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-24 bg-gradient-to-t from-slate-50 dark:from-slate-800 to-transparent pointer-events-none"}),(0,t.jsx)("button",{onClick:()=>r(!0),className:"absolute bottom-2 left-1/2 transform -translate-x-1/2 px-4 py-1.5 dark:bg-slate-700 text-sm text-text-secondary border border-border-default rounded-md hover:bg-white dark:hover:bg-slate-600 transition-colors shadow-xs",children:l({id:"show_full_response",defaultMessage:"Show full response"})})]}),a&&(0,t.jsx)("button",{onClick:()=>r(!1),className:"sticky bottom-2 left-1/2 transform -translate-x-1/2 mt-2 mb-2 px-4 py-1.5 bg-surface text-sm text-text-secondary border border-border-default rounded-md hover:bg-surface-raised transition-colors shadow-sm",children:l({id:"show_less",defaultMessage:"Show less"})})]})})};var u=e.i(44112),h=e.i(83147),f=e.i(84818),g=e.i(41158);let p=({id:e,label:a=null,className:r="text-xs text-text-muted"})=>{let{formatMessage:l}=(0,x.X)(),[d,i]=(0,s.useState)(!1),n=async()=>{try{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),2e3)}catch(e){console.error("Failed to copy to clipboard:",e)}},c=a||l({id:"id",defaultMessage:"ID"});return(0,t.jsxs)("div",{className:"relative inline-block group bg-surface-raised px-2 py-1 rounded text-xs text-text-muted",children:[(0,t.jsxs)("button",{onClick:n,className:`${r} hover:text-slate-700 dark:hover:text-slate-200 cursor-pointer transition-colors truncate text-left`,children:[c,":"," ",d?(0,t.jsx)("span",{className:"text-green-600 dark:text-green-400",children:l({id:"copied",defaultMessage:"Copied!"})}):(0,t.jsx)("span",{className:"font-mono",children:e})]}),!d&&(0,t.jsxs)("div",{className:"absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-2 py-1 bg-slate-900 dark:bg-slate-700 text-white text-xs rounded shadow-lg opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none whitespace-nowrap z-10",children:[l({id:"click_to_copy",defaultMessage:"Click to copy ID"}),(0,t.jsx)("div",{className:"absolute top-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-l-4 border-r-4 border-t-4 border-transparent border-t-slate-900 dark:border-t-slate-700"})]})]})},j=({event:e})=>{let{formatDateTime:a}=(0,f.f)(),{formatMessage:r}=(0,x.X)(),[l,d]=(0,s.useState)(!1);return(0,t.jsxs)("div",{className:"flex flex-col p-3 bg-surface rounded-lg shadow-sm border border-border-subtle",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-text-primary",children:e.type}),(0,t.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.payload.type}),(0,t.jsx)(p,{id:e._id,className:"text-[11px] text-text-muted break-all"})]}),(0,t.jsx)("div",{className:"text-xs text-text-muted text-right whitespace-nowrap mr-4",children:a(e.created,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}),(0,t.jsxs)("div",{className:"flex flex-col text-xs items-end space-y-1",children:[(0,t.jsx)(g.default,{href:`/events?eventId=${e._id}`,className:"px-3 py-1.5 text-sm text-text-secondary hover:text-text-primary border border-border-default rounded-md hover:bg-surface-raised transition-colors flex-shrink-0",children:r({id:"view",defaultMessage:"View"})}),(0,t.jsx)("button",{onClick:()=>d(!l),className:"px-2 py-1 text-xs border border-border-default rounded-md hover:bg-surface-raised transition-colors",children:r(l?{id:"hide_payload",defaultMessage:"Hide Payload"}:{id:"show_payload",defaultMessage:"Show Payload"})})]})]}),l&&(0,t.jsx)(m,{data:e?.payload})]},e._id)};var b=e.i(42469),v=e.i(60193);let N=({work:e})=>{let{formatDateTime:s}=(0,f.f)(),{formatMessage:a}=(0,x.X)();if(!e)return null;let r=e?.deleted?"DELETED":e?.started||e?.finished?e?.started&&!e?.finished?"ALLOCATED":e?.started&&e?.finished&&e?.success?"SUCCESS":e?.started&&e?.finished&&!e?.success?"FAILED":null:"NEW";return(0,t.jsxs)("div",{className:"flex justify-between items-center p-3 bg-surface rounded-lg shadow-sm border border-border-subtle",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-text-primary truncate",children:e.type}),(0,t.jsx)(p,{id:e._id,className:"text-xs text-text-muted break-all"}),e.worker&&(0,t.jsxs)("p",{className:"text-xs text-blue-600 dark:text-blue-300",children:[a({id:"worker",defaultMessage:"Worker"}),":"," ",e.worker]})]}),(0,t.jsxs)("div",{className:"text-xs text-text-muted text-right whitespace-nowrap mr-4",children:[(0,t.jsx)(b.f,{text:r,color:v.Q[r],square:!0}),(0,t.jsx)("br",{}),a({id:"created",defaultMessage:"Created"}),":"," ",s(e.created,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})]}),(0,t.jsx)("div",{className:"flex flex-col items-end",children:(0,t.jsx)(g.default,{href:`/works?workerId=${e._id}`,className:"px-3 py-1.5 text-sm text-text-secondary hover:text-text-primary border border-border-default rounded-md hover:bg-surface-raised transition-colors flex-shrink-0",children:a({id:"view",defaultMessage:"View"})})})]},e._id)},y=({type:e})=>{let{formatMessage:s}=(0,x.X)();return(0,t.jsxs)("div",{className:"flex items-center justify-between p-3 bg-surface rounded-lg shadow-sm border border-border-subtle",children:[(0,t.jsx)("div",{className:"flex-1 min-w-0",children:(0,t.jsx)("h3",{className:"text-sm font-medium text-text-primary truncate",children:e.replace(/_/g," ")})}),(0,t.jsx)(g.default,{href:`/works/?types=${encodeURIComponent(e)}`,className:"px-3 py-1.5 text-sm text-text-secondary hover:text-text-primary border border-border-default rounded-md hover:bg-surface-raised transition-colors flex-shrink-0",children:s({id:"view",defaultMessage:"View"})})]})},w=e=>{let s=({count:s})=>{let{formatMessage:a}=(0,x.X)(),r={EVENT:a({id:"events",defaultMessage:"Events"}),WORKER:a({id:"workers",defaultMessage:"Workers"}),PRODUCT:a({id:"products",defaultMessage:"Products"}),ASSORTMENT:a({id:"assortments",defaultMessage:"Assortments"}),LANGUAGE:a({id:"languages",defaultMessage:"Languages"}),COUNTRY:a({id:"countries",defaultMessage:"Countries"}),CURRENCY:a({id:"currencies",defaultMessage:"Currencies"}),USER:a({id:"users",defaultMessage:"Users"}),ORDER:a({id:"orders",defaultMessage:"Orders"}),FILTER:a({id:"filters",defaultMessage:"Filters"})}[e]||a({id:"items",defaultMessage:"Items"});return(0,t.jsx)("div",{className:"p-6 bg-surface rounded-lg shadow-sm border border-border-subtle text-center",children:(0,t.jsxs)("dl",{children:[(0,t.jsx)("dt",{className:"text-sm font-semibold text-text-secondary mb-2",children:r}),(0,t.jsx)("dd",{className:"text-3xl font-bold text-text-primary",children:s.toLocaleString()})]})})};return s.displayName=`CopilotCount(${e})`,s},_=({toolsMap:e,fallbackComponent:s})=>({action:a,data:r,...l})=>{if(!a)return null;let d=e[a];return d?(0,t.jsx)(d,{...r,...l}):s?s({action:a,data:r}):(0,t.jsx)("pre",{className:"p-2 bg-gray-100 rounded text-xs overflow-auto",children:JSON.stringify({action:a,data:r},null,2)})},M=(e,t)=>Object.fromEntries(e.map(e=>[e,t])),E=(...e)=>Object.assign({},...e),k=_({toolsMap:E({SHOP_INFO:e=>{let{formatMessage:s,locale:a}=(0,x.X)(),r=[{label:s({id:"default_system_locale",defaultMessage:"Default Locale"}),value:(0,h.I)(a,e?.defaultLanguageIsoCode)},{label:s({id:"language",defaultMessage:"Language"}),value:(0,h.I)(a,e?.language?.isoCode)},{label:s({id:"country",defaultMessage:"Country"}),value:(0,h.Q)(a,e?.country?.isoCode)},{label:s({id:"currency",defaultMessage:"Currency"}),value:(0,h.j)(a,e?.country?.defaultCurrencyCode)},{label:s({id:"version",defaultMessage:"Version"}),value:e?.version}];return(0,t.jsxs)("div",{className:"mt-5 flex gap-4 p-4 bg-surface border border-border-subtle rounded-lg shadow-sm hover:shadow-md transition-shadow duration-200",children:[(0,t.jsx)("div",{className:"w-12 h-12 flex-shrink-0 bg-surface-raised rounded-md flex items-center justify-center text-blue-500",children:(0,t.jsx)(u.f,{className:"w-6 h-6"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-text-primary mb-1",children:s({id:"shop_info",defaultMessage:"Shop Info"})}),(0,t.jsx)("dl",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-sm text-text-secondary",children:r.map(({label:e,value:s})=>(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:e}),(0,t.jsx)("dd",{className:"font-medium truncate",children:s||"—"})]},e))})]})]})},EVENT_LIST:({events:e,toolCallId:s})=>{let{formatMessage:a}=(0,x.X)();return e?.length?(0,t.jsx)("div",{className:"w-full space-y-3",children:e.sort((e,t)=>new Date(t.created).getTime()-new Date(e.created).getTime()).map(e=>(0,t.jsx)(j,{event:e},`${e._id}-${s}`))}):(0,t.jsx)("div",{className:"p-4 text-center text-slate-500",children:a({id:"no_event_found",defaultMessage:"No event found"})})},EVENT_GET:j,EVENT_STATISTICS:({statistics:e})=>{let{formatMessage:s}=(0,x.X)();if(!e?.length)return(0,t.jsx)("div",{className:"p-4 text-center text-slate-500",children:s({id:"no_statistics_available",defaultMessage:"No statistics available"})});let a=[...e].sort((e,t)=>e.type.localeCompare(t.type));return(0,t.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4",children:a.map(e=>(0,t.jsxs)("div",{className:"p-4 bg-surface rounded-lg shadow-sm border border-border-subtle flex flex-col items-center",children:[(0,t.jsx)("p",{className:"text-lg font-semibold text-text-primary",children:e.emitCount}),(0,t.jsx)("p",{className:"text-xs text-text-muted text-center break-words",children:e.type})]},e.type))})},WORKER_LIST:({works:e,toolCallId:s})=>{let{formatMessage:a}=(0,x.X)();return e?.length?(0,t.jsx)("div",{className:"w-full space-y-3",children:e.sort((e,t)=>new Date(t.scheduled).getTime()-new Date(e.scheduled).getTime()).map(e=>(0,t.jsx)(N,{work:e},`${e._id}-${s}`))}):(0,t.jsx)("div",{className:"p-4 text-center text-slate-500",children:a({id:"no_works_found",defaultMessage:"No works found"})})},WORKER_ACTIVE_WORK_TYPES:({activeTypes:e})=>{let{formatMessage:s}=(0,x.X)();return e?.length?(0,t.jsxs)("div",{className:"w-full space-y-1",children:[(0,t.jsx)("h2",{className:"text-sm font-semibold text-text-secondary mb-2",children:s({id:"active_types",defaultMessage:"Active Worker Types ({count})"},{count:e.length})}),e.map(e=>(0,t.jsx)(y,{type:e},e))]}):(0,t.jsx)("div",{className:"p-4 text-center text-slate-500",children:s({id:"no_active_types",defaultMessage:"No active worker types found"})})},WORKER_STATISTICS:({statistics:e})=>{let{formatMessage:s}=(0,x.X)(),{formatDateTime:a}=(0,f.f)();return e?.allocationMap?.length?(0,t.jsxs)("div",{className:"flex flex-col gap-2 w-full",children:[e.dateRange?.from&&e.dateRange?.to&&(0,t.jsxs)("div",{className:"text-xs text-text-muted mb-2",children:[s({id:"worker.dateRange",defaultMessage:"Date Range"}),":",` ${a(e.dateRange.from)} → ${a(e.dateRange.to)}`]}),(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-2",children:e.allocationMap.map(e=>(0,t.jsxs)("div",{className:"p-2 bg-surface rounded shadow border border-border-subtle text-xs flex flex-col gap-1",children:[(0,t.jsx)("div",{className:"font-semibold text-text-primary truncate",children:s({id:`worker.type.${e.type}`,defaultMessage:e.type})}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",children:[(0,t.jsxs)("span",{className:"px-1 py-0.5 bg-surface-raised rounded text-text-secondary",children:[s({id:"worker.startCount",defaultMessage:"Start"}),": ",e.startCount]}),(0,t.jsxs)("span",{className:"px-1 py-0.5 bg-blue-100 dark:bg-blue-800 rounded text-blue-700 dark:text-blue-200",children:[s({id:"worker.successCount",defaultMessage:"Success"}),": ",e.successCount]}),e.errorCount>0&&(0,t.jsxs)("span",{className:"px-1 py-0.5 bg-red-100 dark:bg-red-800 rounded text-red-700 dark:text-red-200",children:[s({id:"worker.errorCount",defaultMessage:"Error"}),": ",e.errorCount]}),e.deleteCount>0&&(0,t.jsxs)("span",{className:"px-1 py-0.5 bg-yellow-100 dark:bg-yellow-800 rounded text-yellow-700 dark:text-yellow-200",children:[s({id:"worker.deleteCount",defaultMessage:"Deleted"}),": ",e.deleteCount]}),(0,t.jsxs)("span",{className:"px-1 py-0.5 bg-surface-raised rounded text-text-secondary",children:[s({id:"worker.newCount",defaultMessage:"New"}),": ",e.newCount]})]})]},e.type))})]}):(0,t.jsx)("p",{className:"text-xs text-text-muted",children:s({id:"worker.noStatistics",defaultMessage:"No statistics available"})})},EVENT_COUNT:w("EVENT"),WORKER_COUNT:w("WORKER")},M(["WORKER_GET","WORKER_ADD","WORKER_REMOVE","WORKER_ALLOCATE","WORKER_PROCESS_NEXT","WORKER_FINISH_WORK"],N))});var T=e.i(87284),C=e.i(1880),R=e.i(75155);let A=({product:e})=>{let{formatMessage:s}=(0,x.X)(),{formatPrice:a}=(0,h.d)(),{texts:r,media:l,catalogPrice:d,commerce:i}=e,n=r?.[0]??r??{},c=d||i?.pricing?.[0];return(0,t.jsxs)("div",{className:"gap-3 my-5 bg-surface rounded-lg shadow-md border border-border-default overflow-hidden hover:shadow-md transition-shadow duration-200",style:{display:"grid",gridTemplateRows:"subgrid",gridRow:"span 6"},children:[(0,t.jsx)("div",{className:"aspect-square bg-surface relative",children:l?.length?(0,t.jsx)(T.f,{src:l[0]?.file?.url,alt:n?.title,className:"w-full h-full object-contain p-4",width:300,height:300}):(0,t.jsx)("div",{className:"flex items-center justify-center h-full text-slate-400",children:(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"text-6xl mb-2",children:"📦"}),(0,t.jsx)("div",{className:"text-sm",children:"No Image"})]})})}),(0,t.jsx)("h3",{className:"text-sm font-medium text-text-primary px-4 line-clamp-2",children:n.title}),(0,t.jsxs)("div",{className:"px-4 flex items-center gap-2",children:[(0,t.jsx)(R.f,{status:e?.status}),(0,t.jsx)("span",{className:"text-xs text-text-muted bg-slate-100 dark:bg-slate-600 px-2 py-1 rounded",children:(e.__typename||e.type||"SimpleProduct").replace("Product","")||"Simple"})]}),(0,t.jsx)("p",{className:"text-sm text-text-secondary px-4",children:c?(0,t.jsx)(t.Fragment,{children:a(c)}):(0,t.jsx)("span",{className:"text-slate-400",children:"No price"})}),(0,t.jsx)("p",{className:"text-xs text-text-muted px-4",children:e._id||"auf Lager"}),(0,t.jsx)("div",{className:"border-t border-border-subtle",children:(0,t.jsx)(g.default,{href:`/products?slug=${(0,C.U)(e)}`,className:"block text-center text-sm text-text-primary hover:text-slate-800 dark:hover:text-slate-300 py-3",children:s({id:"edit",defaultMessage:"Edit"})})})]})},S=({product:e,tab:s=null,children:a=null})=>{let{formatMessage:r}=(0,x.X)(),{formatPrice:l}=(0,h.d)();if(!e)return a;let{texts:d=[],media:i=[],catalogPrice:n,commerce:c,warehousing:o={},supply:m={},tags:u=[],variations:f=[],proxy:j,bundleItems:b=[],_id:v,type:N,status:y,reviews:w=[]}=e,_=Array.isArray(d)?d[0]:d,M=n||c?.pricing?.[0],E=i[0]?.file?.url,k=f.length,A=j?.assignments?.length??0,S=b.length,I=w?.length,O=(0,C.U)(e);return(0,t.jsxs)("div",{className:"relative border rounded-xl p-4 shadow-sm bg-surface-input space-y-4",children:[(0,t.jsx)(g.default,{href:`/products?slug=${O}`,className:"absolute top-2 right-2 px-2 py-1 text-xs font-medium text-text-secondary hover:text-text-primary border border-border-default rounded-md hover:bg-surface-raised transition-colors",children:r({id:"edit",defaultMessage:"Edit"})}),u?.length>0&&(0,t.jsx)("div",{className:"absolute top-10 right-2 flex flex-wrap gap-1 justify-end max-w-[60%]",children:u.map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-0.5 text-xs rounded-full bg-blue-100 dark:bg-blue-700 text-blue-800 dark:text-blue-200",children:e},s))}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)(T.f,{src:E,alt:_?.title||"Product image",width:60,height:60,className:"rounded-md object-cover shrink-0"}),(0,t.jsxs)("div",{className:"flex-1 space-y-1 overflow-hidden",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-text-primary truncate",children:_?.title||"Untitled Product"}),(0,t.jsxs)("div",{className:"flex items-center gap-3 mt-1",children:[(0,t.jsx)(R.f,{status:y}),(0,t.jsx)("span",{className:"text-xs text-text-muted bg-slate-100 dark:bg-slate-600 px-2 py-1 rounded",children:(e.__typename||N||"SimpleProduct").replace("_PRODUCT","")}),(0,t.jsx)("span",{className:"text-sm font-medium text-text-primary",children:M?l(M):(0,t.jsx)("span",{className:"text-slate-400",children:r({id:"no_price",defaultMessage:"N/A"})})}),(0,t.jsx)(p,{id:v})]}),(0,t.jsxs)("div",{className:"flex flex-wrap text-xs gap-2 mt-2",children:["CONFIGURABLE_PRODUCT"===N&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(g.default,{href:`/products?slug=${O}&tab=variations`,className:"px-2 py-0.5 text-xs rounded-full bg-blue-100 dark:bg-blue-700 text-blue-800 dark:text-blue-200 hover:underline",children:[r({id:"variations",defaultMessage:"Variations"}),": ",(0,t.jsx)("strong",{children:k})]}),(0,t.jsxs)(g.default,{href:`/products?slug=${O}&tab=assignments`,className:"px-2 py-0.5 text-xs rounded-full bg-green-100 dark:bg-green-700 text-green-800 dark:text-green-200 hover:underline",children:[r({id:"products",defaultMessage:"Products"}),": ",(0,t.jsx)("strong",{children:A})]})]}),"BUNDLE_PRODUCT"===N&&(0,t.jsxs)(g.default,{href:`/products?slug=${O}&tab=bundled_products`,className:"px-2 py-0.5 text-xs rounded-full bg-blue-100 dark:bg-blue-700 text-blue-800 dark:text-blue-200 hover:underline",children:[r({id:"bundle_products",defaultMessage:"Bundles"}),": ",(0,t.jsx)("strong",{children:S})]}),(0,t.jsxs)(g.default,{href:`/products?slug=${O}&tab=reviews`,className:"px-2 py-0.5 text-xs rounded-full bg-blue-100 dark:bg-blue-700 text-blue-800 dark:text-blue-200 hover:underline",children:[r({id:"reviews",defaultMessage:"Reviews"}),": ",(0,t.jsx)("strong",{children:I})]}),o.sku&&(0,t.jsxs)("div",{children:[r({id:"sku",defaultMessage:"SKU"}),":"," ",(0,t.jsx)("strong",{children:o.sku})]}),o.baseUnit&&(0,t.jsxs)("div",{children:[r({id:"unit",defaultMessage:"Unit"}),":"," ",(0,t.jsx)("strong",{children:o.baseUnit})]}),m&&(0,t.jsxs)("div",{children:[r({id:"dimensions",defaultMessage:"Dimensions"}),":"," ",(0,t.jsxs)("strong",{children:[m.lengthInMillimeters,"×",m.widthInMillimeters,"×",m.heightInMillimeters," mm"]})]}),m?.weightInGram&&(0,t.jsxs)("div",{children:[r({id:"weight",defaultMessage:"Weight"}),":"," ",(0,t.jsxs)("strong",{children:[m.weightInGram," g"]})]})]})]})]}),a&&(0,t.jsx)("div",{className:"pt-2",children:(0,t.jsx)("div",{className:"p-3 bg-surface rounded-lg shadow-inner border border-border-subtle",children:a})})]})},I=({product:e,quantity:s})=>{let{formatPrice:a}=(0,h.d)(),{formatMessage:r}=(0,x.X)(),l=e?.texts?.title??r({id:"product_untitled",defaultMessage:"Untitled product"}),d=e?.warehousing?.sku,i=e?.warehousing?.baseUnit,n=e?.type?.replace("_PRODUCT",""),c=e?.media?.[0]?.file?.url,o=e?.commerce?.pricing?.[0]?a(e.commerce.pricing[0]):null,m=e?.supply,u=e?.tags;return(0,t.jsxs)("div",{className:"flex items-start gap-4 border rounded-xl p-3 shadow-sm bg-surface-input hover:shadow-md transition-shadow relative",children:[(0,t.jsxs)("div",{className:"flex-1 flex gap-3 items-start",children:[(0,t.jsx)(T.f,{src:c,alt:l,width:60,height:60,className:"rounded-md object-cover shrink-0"}),(0,t.jsxs)("div",{className:"flex-1 flex flex-col gap-1 overflow-hidden",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-text-primary truncate",children:l}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1 text-xs text-text-muted",children:[n&&(0,t.jsx)("span",{className:"bg-surface-raised px-2 py-0.5 rounded-full",children:n}),u?.map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-0.5 text-xs rounded-full text-text-secondary truncate bg-blue-100 dark:bg-blue-700",children:e},s))]}),(0,t.jsx)("div",{className:"mt-1",children:(0,t.jsxs)("span",{className:"px-2 py-0.5 text-xs font-semibold rounded-full bg-surface-raised text-text-primary",children:[r({id:"quantity",defaultMessage:"Quantity"}),":"," ",s]})}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 text-xs text-text-secondary mt-1",children:[d&&(0,t.jsxs)("span",{children:[r({id:"sku",defaultMessage:"SKU"}),":"," ",(0,t.jsx)("strong",{children:d})]}),i&&(0,t.jsxs)("span",{children:[r({id:"unit",defaultMessage:"Unit"}),":"," ",(0,t.jsx)("strong",{children:i})]}),(0,t.jsxs)("span",{children:[r({id:"id",defaultMessage:"ID"}),":"," ",(0,t.jsx)("strong",{children:e?._id})]})]})]})]}),(0,t.jsxs)("div",{className:"flex flex-col text-xs text-text-secondary items-end min-w-[120px] gap-1",children:[o&&(0,t.jsx)("div",{className:"text-sm font-semibold text-text-primary",children:o}),m&&(0,t.jsxs)("div",{children:[r({id:"dimensions",defaultMessage:"Dimensions"}),":"," ",(0,t.jsxs)("strong",{children:[m.lengthInMillimeters,"×",m.widthInMillimeters,"×",m.heightInMillimeters," mm"]})]}),m?.weightInGram&&(0,t.jsxs)("div",{children:[r({id:"weight",defaultMessage:"Weight"}),":"," ",(0,t.jsxs)("strong",{children:[m.weightInGram," g"]})]}),(0,t.jsx)(g.default,{href:`/products?slug=${(0,C.U)(e)}`,className:"mt-1 text-sm px-3 py-1 rounded-md border border-border-default hover:bg-surface-raised text-slate-700 dark:text-white transition-colors",children:r({id:"edit",defaultMessage:"Edit"})})]})]})},O=({variation:e})=>{let{formatMessage:s}=(0,x.X)(),{formatDateTime:a}=(0,f.f)();return(0,t.jsxs)("div",{className:"flex items-center gap-4 p-3 bg-surface rounded-lg shadow-sm border border-border-subtle hover:shadow-md transition-shadow duration-200 w-full overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-text-primary truncate",children:e.key||s({id:"variation.untitled",defaultMessage:"Untitled Variation"})}),(0,t.jsxs)("div",{className:"flex items-center gap-3 mt-1 text-xs",children:[(0,t.jsx)("span",{className:"text-text-muted bg-slate-100 dark:bg-slate-600 px-2 py-0.5 rounded",children:e.type}),(0,t.jsxs)("span",{className:"text-slate-400 truncate",children:[s({id:"variation.id",defaultMessage:"ID"}),":"," ",e._id]})]})]}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 max-w-[40%]",children:e.options?.map((e,s)=>(0,t.jsx)("span",{className:"inline-block px-2 py-1 text-xs font-medium text-green-700 bg-green-100 dark:bg-green-800 dark:text-green-200 rounded",children:e},s))}),(0,t.jsxs)("div",{className:"flex flex-col items-end text-xs text-text-muted whitespace-nowrap",children:[(0,t.jsxs)("span",{children:[s({id:"created",defaultMessage:"Created"}),":"," ",a(e.created,{dateStyle:"medium",timeStyle:"short"})]}),(0,t.jsxs)("span",{children:[s({id:"updated",defaultMessage:"Updated"}),":"," ",a(e.updated,{dateStyle:"medium",timeStyle:"short"})]})]})]})},D={BUNDLE_PRODUCT:({bundleItems:e})=>e?.length?e.map(({product:e,quantity:s},a)=>(0,t.jsx)(I,{product:e,quantity:s},`${a}-${e._id}`)):null,CONFIGURABLE_PRODUCT:({variations:e})=>e?.length?e.map((e,s)=>(0,t.jsx)(O,{variation:e},`${s}-${e?._id}`)):null},U={BUNDLE_PRODUCT:"bundle_products",CONFIGURABLE_PRODUCT:"variations"},$=({product:e,...s})=>{let a=D?.[e?.type],r=U?.[e?.type],l=null;if(a){let t=a({...e,...s});t&&(!Array.isArray(t)||t.length>0)&&(l=t)}return(0,t.jsx)(S,{product:e,tab:r,children:l})};var L=e.i(56206),P=e.i(26915),P=P,X=e.i(1943),X=X,G=e.i(79684);let V=({storageKey:e="listViewMode",className:s,children:a})=>{let[r,l]=(0,G.f)(e,"list");return(0,t.jsxs)("div",{className:(0,L.U)("space-y-4",s),children:[(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsxs)("div",{className:"flex bg-surface-raised rounded-lg p-1",children:[(0,t.jsx)("button",{onClick:()=>l("grid"),className:(0,L.U)("p-2 rounded-md transition-colors","grid"===r?"bg-surface text-text-primary shadow-sm":"text-text-muted hover:text-slate-700 dark:hover:text-slate-200"),children:(0,t.jsx)(P.f,{className:"w-4 h-4"})}),(0,t.jsx)("button",{onClick:()=>l("list"),className:(0,L.U)("p-2 rounded-md transition-colors","list"===r?"bg-surface text-text-primary shadow-sm":"text-text-muted hover:text-slate-700 dark:hover:text-slate-200"),children:(0,t.jsx)(X.f,{className:"w-4 h-4"})})]})}),a(r)]})},F=({products:e})=>{let{formatMessage:a}=(0,x.X)(),[r,l]=(0,s.useState)("ALL"),d="ALL"===r?e:e.filter(e=>e.status===r||"DRAFT"===r&&!e.status),i=[...new Set(e.map(e=>e.status?e.status:"DRAFT"))].filter(Boolean);return(0,t.jsxs)("div",{children:[i.length>1&&(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)("div",{className:"px-3 py-1 text-sm rounded-md transition-colors text-text-secondary hover:text-text-primary",children:[a({id:"all",defaultMessage:"All"})," (",e.length,")"]}),i.map(s=>{let a=e.filter(e=>e.status===s||"DRAFT"===s&&!e.status).length;return(0,t.jsxs)("button",{onClick:()=>l(s),className:`px-3 py-1 text-sm rounded-md transition-colors ${r===s?"bg-surface-raised text-text-primary":"text-text-secondary hover:text-text-primary"}`,children:[s," (",a,")"]},s)})]}),(0,t.jsx)(V,{children:e=>"grid"===e?(0,t.jsx)("div",{className:"gap-4 max-w-full overflow-hidden",style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gridTemplateRows:"span 6"},children:d.map(e=>(0,t.jsx)(A,{product:e},e._id))}):(0,t.jsx)("div",{className:"space-y-2 max-w-full overflow-hidden",children:d.map(e=>(0,t.jsx)($,{product:e},e._id))})})]})},K=({assignments:e})=>{let{formatMessage:s}=(0,x.X)(),{formatPrice:a}=(0,h.d)();return e?.length?(0,t.jsx)("div",{className:"space-y-4",children:e.map(({assignment:e},r)=>{let l=e?.product,d=a(l?.commerce?.pricing?.[0]),i=l?.media?.[0]?.file?.url;return(0,t.jsxs)("div",{className:"flex gap-4 items-center border rounded-xl p-3 shadow-sm bg-surface-input",children:[(0,t.jsx)(T.f,{src:i,alt:"Product image",width:60,height:60,className:"rounded-md object-cover"}),(0,t.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"text-sm font-semibold text-text-primary",children:[l?.texts?.title," "]}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 text-xs",children:Object.entries(e.vector).map(([e,s])=>(0,t.jsxs)("span",{className:"bg-surface-raised text-slate-800 dark:text-white px-2 py-0.5 rounded",children:[e,": ",s]},e))}),(0,t.jsxs)("div",{className:"text-xs text-text-muted",children:[l?.type?.replace("_PRODUCT","")," ·"," ",l?.warehousing?.sku&&s({id:"sku",defaultMessage:"SKU"}),": ",l?.warehousing?.sku," "]}),(0,t.jsxs)("span",{className:"text-xs text-text-muted",children:[s({id:"id",defaultMessage:"ID"}),":"," ",l?._id]})]}),d&&(0,t.jsx)("div",{className:"text-right text-sm font-semibold text-text-primary min-w-[80px]",children:d}),l&&(0,t.jsx)("div",{className:"ml-4",children:(0,t.jsx)(g.default,{href:`/products?slug=${(0,C.U)(l)}`,className:"text-sm px-3 py-1 rounded-md border border-border-default hover:bg-surface-raised text-slate-700 dark:text-white",children:s({id:"edit",defaultMessage:"Edit"})})})]},r)})}):null},W=({product:e,vectors:s})=>{let{formatMessage:a}=(0,x.X)(),r=e?.texts?.title||a({id:"assignment.title",defaultMessage:"Product Assignment"}),l=e?.texts?.subtitle||"",d=e?.texts?.brand||"",i=e?.warehousing?.sku||"",n=e?.tags||[],c=e?.pricing?.amount,o=e?.pricing?.currencyCode;return(0,t.jsxs)("div",{className:"relative flex items-start gap-4 p-3 bg-surface rounded-lg shadow-sm border border-border-subtle hover:shadow-md transition-shadow duration-200 w-full overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-text-primary truncate",children:r}),(l||d)&&(0,t.jsxs)("p",{className:"text-xs text-text-secondary truncate",children:[d&&(0,t.jsx)("span",{className:"font-semibold",children:d}),d&&l?" — ":"",l]}),i&&(0,t.jsxs)("p",{className:"text-xs text-text-muted mt-0.5",children:[a({id:"assignment_sku",defaultMessage:"SKU"}),":"," ",i]}),n.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:n.map((e,s)=>(0,t.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-surface-raised text-text-secondary rounded",children:e},s))}),void 0!==c&&o&&(0,t.jsxs)("p",{className:"text-xs font-semibold text-text-primary mt-1",children:[(c/100).toFixed(2)," ",o]})]}),s?.length>0&&(0,t.jsxs)("div",{className:"flex flex-col items-end gap-1 max-w-[40%]",children:[(0,t.jsx)("div",{className:"flex flex-wrap gap-1 justify-end",children:s.map((e,s)=>(0,t.jsxs)("span",{className:"inline-flex items-center px-1.5 py-0.5 text-[10px] font-medium text-blue-700 bg-blue-100 dark:bg-blue-800 dark:text-blue-200 rounded",children:[e.key,": ",e.value]},s))}),(0,t.jsx)(g.default,{href:`/products?slug=${(0,C.U)(e)}`,className:"px-3 py-1.5 text-sm text-text-secondary hover:text-text-primary border border-border-default rounded-md hover:bg-surface-raised transition-colors flex-shrink-0",children:a({id:"edit",defaultMessage:"Edit"})})]})]})},q=({media:e})=>{let{formatMessage:s}=(0,x.X)(),{formatDateTime:a}=(0,f.f)();return e?.length?(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 w-full",children:e.map(e=>{let r=e.file?.url||e.url;return(0,t.jsxs)("div",{className:"flex flex-col items-start gap-2 p-3 bg-surface rounded-lg shadow-sm border border-border-subtle hover:shadow-md transition-shadow duration-200 w-full",children:[(0,t.jsx)("div",{className:"w-full h-32 flex-shrink-0 bg-surface rounded-md overflow-hidden",children:r?(0,t.jsx)(T.f,{src:r,alt:e.name,className:"w-full h-full object-cover",width:256,height:128}):(0,t.jsx)("div",{className:"flex items-center justify-center h-full text-slate-400",children:(0,t.jsx)("span",{className:"text-3xl",children:"🖼️"})})}),(0,t.jsxs)("div",{className:"flex-1 w-full",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-text-primary truncate",children:e.name}),(0,t.jsxs)("div",{className:"flex items-center gap-3 mt-1 text-xs text-text-muted flex-wrap",children:[(0,t.jsxs)("span",{children:[s({id:"media.size",defaultMessage:"Size"}),":"," ",(e?.file?.size/1024).toFixed(1)," KB"]}),(0,t.jsxs)("span",{children:[s({id:"media.type",defaultMessage:"Type"}),":"," ",e?.file?.type]})]})]}),(0,t.jsxs)("div",{className:"flex flex-col items-start text-xs text-text-muted mt-2",children:[(0,t.jsxs)("span",{className:"text-xs text-text-muted",children:[s({id:"media.id",defaultMessage:"ID"}),":"," ",e._id]}),(0,t.jsxs)("span",{children:[s({id:"created",defaultMessage:"Created"}),": ",a(e.created)]}),(0,t.jsxs)("span",{children:[s({id:"updated",defaultMessage:"Updated"}),": ",a(e.updated)]})]})]},e._id)})}):null},Y=({product:e,price:s,leveledCatalogPrice:a=[],priceRange:r})=>{let{formatPrice:l}=(0,h.d)(),{formatMessage:d}=(0,x.X)(),i=r?.minPrice?.amount===r?.maxPrice?.amount,n=r?i?l(r.minPrice):`${l(r.minPrice)} – ${l(r.maxPrice)}`:null;return(0,t.jsx)(S,{product:e,tab:"commerce",children:(0,t.jsxs)("div",{className:"flex flex-col gap-3 text-sm text-center text-text-secondary min-w-[140px]",children:[s&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"font-semibold text-text-primary",children:l(s)}),(0,t.jsxs)("span",{className:"text-xs text-text-muted",children:[d(s.isNetPrice?{id:"net_price",defaultMessage:"Net Price"}:{id:"gross_price",defaultMessage:"Gross"})," · ",d(s.isTaxable?{id:"taxable",defaultMessage:"Taxable"}:{id:"non_taxable",defaultMessage:"Non-Taxable"})]})]}),r&&(0,t.jsxs)("div",{className:"text-xs",children:[(0,t.jsx)("div",{className:"text-text-muted",children:d({id:"price_range",defaultMessage:"Price Range"})}),(0,t.jsx)("div",{className:"font-medium text-text-primary",children:n})]}),!!a.length&&(0,t.jsxs)("div",{className:"pt-2 border-t border-border-subtle text-left",children:[(0,t.jsx)("div",{className:"font-medium mb-1 text-xs text-slate-600 uppercase",children:d({id:"tiered_pricing",defaultMessage:"Tiered Pricing"})}),(0,t.jsx)("ul",{className:"space-y-1 text-xs",children:a.map(({minQuantity:e,maxQuantity:s,price:a},r)=>(0,t.jsxs)("li",{className:"flex justify-between",children:[(0,t.jsxs)("span",{children:[e,null!==s?` – ${s}`:"+"]}),(0,t.jsx)("span",{className:"text-text-primary font-medium",children:l(a)})]},r))})]})]})})},B=({products:e,requestedFilters:s})=>{let{formatMessage:a}=(0,x.X)(),r=e.reduce((e,t)=>{let s=t.status||"DRAFT";return e[s]||(e[s]=0),e[s]++,e},{}),l=e.length,d=r.DRAFT||0,i=r.ACTIVE||0;return(0,t.jsxs)("div",{className:"my-4 p-3 bg-surface border border-border-subtle rounded-md",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsx)("h4",{className:"text-sm font-medium text-text-primary",children:a({id:"products_found",defaultMessage:"{count} products found"},{count:l})}),s?.status&&(0,t.jsxs)("span",{className:"text-xs text-text-secondary",children:["Filter: ",s.status]})]}),(0,t.jsxs)("div",{className:"flex gap-4 text-sm",children:[d>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"w-2 h-2 bg-yellow-500 rounded-full"}),(0,t.jsxs)("span",{className:"text-text-secondary",children:[d," ",a({id:"draft",defaultMessage:"Draft"})]})]}),i>0&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"w-2 h-2 bg-emerald-500 rounded-full"}),(0,t.jsxs)("span",{className:"text-text-secondary",children:[i," ",a({id:"active",defaultMessage:"Active"})]})]}),Object.entries(r).map(([e,s])=>"DRAFT"===e||"ACTIVE"===e?null:(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"w-2 h-2 bg-slate-500 rounded-full"}),(0,t.jsxs)("span",{className:"text-text-secondary",children:[l," ",e]})]},e))]}),s?.status&&!r[s.status]&&(0,t.jsx)("div",{className:"mt-2 text-xs text-amber-600 dark:text-amber-400",children:a({id:"products_not_found",defaultMessage:"No {status} products found in these results"},{status:s.status})})]})};var H=e.i(24629);let J=({text:e})=>{let{formatMessage:s}=(0,x.X)(),a=(e,s)=>s?(0,t.jsxs)("div",{className:"text-sm text-text-secondary",children:[(0,t.jsxs)("span",{className:"font-medium text-text-secondary",children:[e,":"]})," ",s]}):null;return(0,t.jsxs)("div",{className:"flex items-start gap-4 p-4 bg-surface rounded-lg shadow-sm border border-border-subtle hover:shadow-md transition-shadow duration-200",children:[(0,t.jsx)("div",{className:"w-16 h-16 flex-shrink-0 bg-surface rounded-md flex items-center justify-center text-2xl text-slate-400",children:(0,t.jsx)(H.f,{className:"w-6 h-6"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-text-primary",children:e.title||"Untitled"}),(0,t.jsx)(b.f,{text:e.locale.toUpperCase(),color:"blue",square:!0,dotted:!0})]}),a(s({id:"subtitle",defaultMessage:"Subtitle"}),e.subtitle),a(s({id:"description",defaultMessage:"Description"}),e.description),a(s({id:"slug",defaultMessage:"Slug"}),e.slug),a(s({id:"brand",defaultMessage:"Brand"}),e.brand),a(s({id:"vendor",defaultMessage:"Vendor"}),e.vendor),a(s({id:"variation_option",defaultMessage:"Variation option"}),e?.productVariationOptionValue),a(s({id:"variation_id",defaultMessage:"Variation ID"}),e?.productVariationId),e.labels&&e.labels.length>0&&(0,t.jsxs)("div",{className:"text-sm text-text-secondary",children:[(0,t.jsxs)("span",{className:"font-medium text-text-secondary",children:[s({id:"labels",defaultMessage:"Labels"}),":"]})," ",e.labels.join(", ")]}),(0,t.jsxs)("div",{className:"text-xs text-text-muted",children:[s({id:"id",defaultMessage:"ID"}),": ",e._id]})]})]})},z=({texts:e,...s})=>(0,t.jsx)("div",{className:"space-y-3",children:e.map(e=>(0,t.jsx)(J,{text:e,...s},e._id))}),Q=e=>{let s=s=>s?.texts?(0,t.jsx)(z,{tool:e,...s}):null;return s.displayName=`RenderTexts(${e})`,s},Z=s.forwardRef(function({title:e,titleId:t,...a},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},a),e?s.createElement("title",{id:t},e):null,s.createElement("path",{fillRule:"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",clipRule:"evenodd"}))}),ee=s.forwardRef(function({title:e,titleId:t,...a},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},a),e?s.createElement("title",{id:t},e):null,s.createElement("path",{fillRule:"evenodd",d:"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z",clipRule:"evenodd"}))}),et=({success:e})=>{let{formatMessage:s}=(0,x.X)();return e?(0,t.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-green-100 text-green-800 rounded-md",children:[(0,t.jsx)(Z,{className:"w-5 h-5"}),(0,t.jsx)("span",{children:s({id:"operation_success",defaultMessage:"Operation succeeded!"})})]}):(0,t.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-red-100 text-red-800 rounded-md",children:[(0,t.jsx)(ee,{className:"w-5 h-5"}),(0,t.jsx)("span",{children:s({id:"operation_failed",defaultMessage:"Operation failed!!"})})]})},es=_({toolsMap:E({ADD_ASSIGNMENT:e=>(0,t.jsx)(W,{...e}),GET_ASSIGNMENTS:e=>(0,t.jsx)(K,{...e}),COUNT:w("PRODUCT")},M(["LIST","GET_VARIATION_PRODUCTS","GET_PRODUCTS","GET_SIBLINGS"],e=>e?.products?.length?(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)(B,{products:e.products,requestedFilters:e.filters}),(0,t.jsx)(F,{products:e.products})]}):null),M(["GET","CREATE","UPDATE","UPDATE_STATUS","CREATE_OPTION","CREATE_VARIATION","ADD_VARIATION_OPTION","ADD_BUNDLE_ITEM","GET_BUNDLE_ITEMS","ADD_MEDIA"],e=>(0,t.jsx)($,{...e})),M(["REMOVE","REMOVE_ASSIGNMENT","REMOVE_MEDIA","REMOVE_BUNDLE_ITEM"],e=>(0,t.jsx)(et,{...e})),M(["GET_MEDIA","REORDER_MEDIA"],e=>(0,t.jsx)(q,{...e})),M(["SIMULATE_PRICE","SIMULATE_PRICE_RANGE","GET_CATALOG_PRICE"],e=>(0,t.jsx)(Y,{...e})),Object.fromEntries(["GET_PRODUCT_TEXTS","GET_VARIATION_TEXTS","GET_MEDIA_TEXTS","UPDATE_VARIATION_TEXTS","UPDATE_MEDIA_TEXTS","UPDATE_PRODUCT_TEXTS"].map(e=>[e,Q(e)])))});var ea=e.i(87179),er=e.i(35750);let el=({assortment:e,className:s})=>{var a;let r,l,{formatMessage:d}=(0,x.X)(),{formatDateTime:i}=(0,f.f)();return(0,t.jsxs)("div",{className:(0,L.U)("bg-surface rounded-lg border border-border-subtle overflow-hidden hover:shadow-md transition-shadow",s),style:{display:"grid",gridTemplateRows:"subgrid",gridRow:"span 6"},children:[(0,t.jsxs)("div",{className:"relative",children:[(r=e.media?.[0],r?.file?.url?(0,t.jsx)("img",{src:r.file.url,alt:e.texts?.title||"Assortment",className:"w-full h-32 object-cover"}):(0,t.jsx)("div",{className:"w-full h-32 bg-surface-raised flex items-center justify-center",children:(0,t.jsx)(ea.f,{className:"w-12 h-12 text-slate-400 dark:text-slate-600"})})),(0,t.jsx)("div",{className:"absolute top-3 right-3",children:(l=e.isActive,(0,t.jsx)(b.f,{text:d(l?{id:"active",defaultMessage:"Active"}:{id:"inactive",defaultMessage:"In-Active"}),color:l?"green":"yellow",square:!0,dotted:!0}))})]}),(0,t.jsx)("h3",{className:"font-medium text-text-primary line-clamp-2 px-4 pt-0",children:e.texts?.title||d({id:"untitled_assortment",defaultMessage:"Untitled Assortment"})}),(0,t.jsx)("div",{className:"px-4",children:e.texts?.subtitle?(0,t.jsx)("p",{className:"text-sm text-text-secondary line-clamp-2",children:e.texts.subtitle}):(0,t.jsx)("div",{className:"h-5"})}),(0,t.jsxs)("div",{className:"flex items-center justify-between text-xs text-text-muted px-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(er.f,{className:"w-3 h-3"}),(a=e.updated)?i(a,{dateStyle:"medium"}):""]}),e.sequence&&(0,t.jsxs)("span",{className:"font-mono",children:["#",e.sequence]})]}),(0,t.jsxs)("div",{className:"px-4",children:[(0,t.jsxs)("span",{className:"text-xs text-text-muted truncate",children:["ID: ",e._id]}),e.tags&&e.tags.length>0?(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.tags.slice(0,3).map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-1 text-xs bg-surface-raised text-text-secondary rounded",children:e},s)),e.tags.length>3&&(0,t.jsxs)("span",{className:"px-2 py-1 text-xs bg-surface-raised text-text-secondary rounded",children:["+",e.tags.length-3]})]}):e.childrenCount>0?(0,t.jsx)("div",{className:"text-xs text-text-secondary",children:d({id:"children_count",defaultMessage:"{count} children"},{count:e.childrenCount})}):(0,t.jsx)("div",{className:"h-6"})]}),(0,t.jsx)("div",{className:"border-t border-border-subtle flex items-center justify-center",children:(0,t.jsx)(g.default,{href:`/assortments?assortmentSlug=${(0,C.U)(e)}`,className:"text-center text-sm text-text-primary hover:text-slate-800 dark:hover:text-slate-300 py-3",children:d({id:"edit",defaultMessage:"Edit"})})})]})},ed=({assortment:e,children:s=null})=>{let{formatMessage:a}=(0,x.X)(),{formatDateTime:r}=(0,f.f)();if(!e)return null;let{texts:l={},media:d=[],tags:i=[],_id:n,updated:c,sequence:o,products:m=[],links:u=[],filters:h=[],isActive:j}=e,v=m?.length??0,N=h?.length??0,y=u?.length??0,w=(0,C.U)(e),_=d[0]?.file?.url;return(0,t.jsxs)("div",{className:"relative border rounded-xl p-4 shadow-sm bg-surface-input space-y-4",children:[(0,t.jsx)(g.default,{href:`/assortments?assortmentSlug=${w}`,className:"absolute top-2 right-2 px-2 py-1 text-xs font-medium text-text-secondary hover:text-text-primary border border-border-default rounded-md hover:bg-surface-raised transition-colors",children:a({id:"edit",defaultMessage:"Edit"})}),(0,t.jsxs)("div",{className:"flex items-start gap-4",children:[(0,t.jsx)("div",{className:"w-16 h-16 flex-shrink-0 bg-surface rounded-md overflow-hidden",children:_?(0,t.jsx)(T.f,{src:_,alt:l.title||"Assortment",className:"w-full h-full object-cover",width:64,height:64}):(0,t.jsx)("div",{className:"flex items-center justify-center h-full text-slate-400 text-2xl",children:"📁"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-text-primary truncate",children:l.title||a({id:"untitled_assortment",defaultMessage:"Untitled Assortment"})}),l.subtitle&&(0,t.jsx)("div",{className:"text-xs text-text-muted truncate mt-1",children:l.subtitle}),(0,t.jsx)(p,{id:n}),i?.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-2",children:i.map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-0.5 text-xs rounded-full bg-blue-100 dark:bg-blue-700 text-blue-800 dark:text-blue-200",children:e},e+s))})]}),(0,t.jsxs)("div",{className:"flex flex-col items-end text-xs text-text-muted whitespace-nowrap mt-8 gap-1",children:[(0,t.jsx)(b.f,{text:a(j?{id:"active",defaultMessage:"Active"}:{id:"inactive",defaultMessage:"In-Active"}),color:j?"green":"yellow",square:!0,dotted:!0}),o&&(0,t.jsxs)("span",{className:"font-mono",children:["#",o]}),c&&(0,t.jsx)("span",{children:c?r(c,{dateStyle:"medium"}):""})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between text-xs text-text-secondary border-t pt-2 mt-2",children:[(0,t.jsxs)(g.default,{href:`/assortments/?assortmentSlug=${w}&tab=links`,className:"flex items-center gap-1 hover:text-blue-600 dark:hover:text-blue-400 transition-colors",children:[a({id:"children",defaultMessage:"Children"}),(0,t.jsx)("span",{className:"px-2 py-0.5 text-[10px] font-medium rounded-full bg-surface-raised text-text-secondary",children:y})]}),(0,t.jsxs)(g.default,{href:`/assortments?assortmentSlug=${w}&tab=filters`,className:"flex items-center gap-1 hover:text-blue-600 dark:hover:text-blue-400 transition-colors",children:[a({id:"filters",defaultMessage:"Filters"}),(0,t.jsx)("span",{className:"px-2 py-0.5 text-[10px] font-medium rounded-full bg-surface-raised text-text-secondary",children:N})]}),(0,t.jsxs)(g.default,{href:`/assortments?assortmentSlug=${w}&tab=products`,className:"flex items-center gap-1 hover:text-blue-600 dark:hover:text-blue-400 transition-colors",children:[a({id:"products",defaultMessage:"Products"}),(0,t.jsx)("span",{className:"px-2 py-0.5 text-[10px] font-medium rounded-full bg-surface-raised text-text-secondary",children:v})]})]}),s&&(0,t.jsx)("div",{className:"pt-2",children:(0,t.jsx)("div",{className:"p-3 bg-surface rounded-lg shadow-inner \n border border-border-subtle",children:s})})]})},ei=({assortments:e,className:s,toolCallId:a})=>e?.length?(0,t.jsx)(V,{className:s,children:s=>"grid"===s?(0,t.jsx)("div",{className:"gap-5",style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",gridTemplateRows:"span 6"},children:e?.map(e=>(0,t.jsx)(el,{assortment:e},`${a}-${e._id}`))}):(0,t.jsx)("div",{className:"space-y-2",children:e.map(e=>(0,t.jsx)(ed,{assortment:e},e._id))})}):null;var en=e.i(91412),ec=e.i(92248),ec=ec;let eo=({assortments:e,requestedFilters:s,className:a})=>{let{formatMessage:r}=(0,x.X)(),l={total:e.length,active:e.filter(e=>e.isActive).length,inactive:e.filter(e=>!1===e.isActive).length,withChildren:e.filter(e=>e.childrenCount>0).length,roots:e.filter(e=>e.isRoot).length},d=(e,s)=>{let a="active"===s;return(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:(0,L.U)("w-2 h-2 rounded-full",a?"bg-emerald-500":"bg-slate-400")}),(0,t.jsx)("span",{className:"text-sm text-text-secondary",children:a?(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(en.f,{className:"w-4 h-4"}),r({id:"active",defaultMessage:"Active"}),":"," ",e]}):(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(ec.f,{className:"w-4 h-4"}),r({id:"inactive",defaultMessage:"In-Active"}),": ",e]})})]})};return(0,t.jsxs)("div",{className:(0,L.U)("dark:bg-slate-900 rounded-lg border-1 dark:border-slate-700 p-4 my-5",a),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(ea.f,{className:"w-5 h-5 text-text-secondary"}),(0,t.jsx)("h3",{className:"font-medium text-text-primary",children:r({id:"assortment_search_results",defaultMessage:"Assortment Search Results"})})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-4",children:[(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"text-lg font-semibold text-text-primary",children:l.total}),(0,t.jsx)("div",{className:"text-xs text-text-muted",children:r({id:"total",defaultMessage:"Total"})})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"text-lg font-semibold text-emerald-600 dark:text-emerald-400",children:l.active}),(0,t.jsx)("div",{className:"text-xs text-text-muted",children:r({id:"active",defaultMessage:"Active"})})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"text-lg font-semibold text-text-secondary",children:l.inactive}),(0,t.jsx)("div",{className:"text-xs text-text-muted",children:r({id:"inactive",defaultMessage:"In-Active"})})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"text-lg font-semibold text-blue-600 dark:text-blue-400",children:l.withChildren}),(0,t.jsx)("div",{className:"text-xs text-text-muted",children:r({id:"with_children",defaultMessage:"With Children"})})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[d(l.active,"active"),d(l.inactive,"inactive")]}),s&&(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-text-muted",children:[(0,t.jsx)(u.f,{className:"w-4 h-4"}),r({id:"filtered_results",defaultMessage:"Filtered results"})]})]}),l.roots>0&&(0,t.jsx)("div",{className:"mt-2 pt-2 border-t border-border-subtle",children:(0,t.jsx)("div",{className:"text-xs text-text-secondary",children:r({id:"root_assortments_count",defaultMessage:"{count} root assortments found"},{count:l.roots})})}),0===l.total&&(0,t.jsx)("div",{className:"text-center py-4",children:(0,t.jsx)("div",{className:"text-text-muted",children:r({id:"no_assortments_found",defaultMessage:"No assortments found matching your criteria"})})})]})},ex=({filter:e,toolCallId:s=""})=>{let{formatMessage:a}=(0,x.X)(),{formatDateTime:r}=(0,f.f)();return(0,t.jsxs)("div",{className:"relative border rounded-xl p-4 shadow-sm bg-surface-input space-y-4 w-full",children:[(0,t.jsx)(g.default,{href:`/filters?filterId=${e._id}`,className:"absolute top-2 right-2 px-2 py-1 text-xs font-medium text-text-secondary hover:text-text-primary border border-border-default rounded-md hover:bg-surface-raised transition-colors",children:a({id:"edit",defaultMessage:"Edit"})}),(0,t.jsxs)("div",{className:"flex items-start gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-text-primary truncate",children:e.texts?.name||e.key}),(0,t.jsx)(p,{id:e._id}),(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-1 text-xs",children:[(0,t.jsx)("span",{className:"bg-slate-100 dark:bg-slate-600 text-slate-500 dark:text-slate-300 px-2 py-0.5 rounded",children:e.type}),"number"==typeof e.sortKey&&(0,t.jsxs)("span",{className:"bg-purple-100 text-purple-700 dark:bg-purple-800 dark:text-purple-200 px-2 py-0.5 rounded",children:[a({id:"filter.sortKey",defaultMessage:"Sort"}),": ",e.sortKey]})]}),e.options?.length>0&&(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)("div",{className:"text-xs font-medium text-text-secondary mb-1",children:[a({id:"filter.options",defaultMessage:"Options"}),":"]}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:e.options.map(e=>(0,t.jsx)("span",{className:`inline-block px-2 py-0.5 text-xs font-medium rounded ${e.isActive?"bg-blue-100 text-blue-700 dark:bg-blue-800 dark:text-blue-200":"bg-slate-100 text-slate-500 dark:bg-slate-700 dark:text-slate-400"}`,children:e.filterOption||e.key},`${s}-${e.filterOption}`))})]})]}),(0,t.jsxs)("div",{className:"flex flex-col items-end text-xs text-text-muted whitespace-nowrap mt-8 gap-1",children:[(0,t.jsx)("span",{className:`text-xs font-medium rounded px-2 py-0.5 ${e.isActive?"bg-green-100 text-green-700 dark:bg-green-800 dark:text-green-200":"bg-red-100 text-red-700 dark:bg-red-800 dark:text-red-200"}`,children:a(e.isActive?{id:"active",defaultMessage:"Active"}:{id:"inactive",defaultMessage:"Inactive"})}),(0,t.jsxs)("span",{children:[a({id:"created",defaultMessage:"Created"}),":"," ",r(e.created)]}),e.updated&&(0,t.jsxs)("span",{children:[a({id:"updated",defaultMessage:"Updated"}),": ",r(e.updated)]}),e.tags?.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1 justify-end",children:e.tags.map(e=>(0,t.jsx)("span",{className:"bg-yellow-100 text-yellow-800 dark:bg-yellow-800 dark:text-yellow-200 px-2 py-0.5 rounded text-xs",children:e},`${s}-${e}`))})]})]})]})},em=({filters:e,toolCallId:s=""})=>e?.length?(0,t.jsx)("div",{className:"flex flex-col gap-3 w-full",children:e.map(e=>(0,t.jsx)(ex,{filter:e,toolCallId:s},`${s}-${e._id}`))}):null,eu=_({toolsMap:E({LIST:e=>e?.assortments?(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)(eo,{assortments:e.assortments,requestedFilters:e.filters}),(0,t.jsx)(ei,{...e})]}):null,GET_CHILDREN:({assortment:e,children:s})=>(0,t.jsx)(ed,{assortment:e,children:(0,t.jsx)(ei,{assortments:s})}),GET_LINKS:({assortment:e,links:s})=>(0,t.jsx)(ed,{assortment:e,children:(0,t.jsx)(ei,{assortments:s})}),GET_PRODUCTS:({assortment:e,products:s})=>(0,t.jsx)(ed,{assortment:e,children:(0,t.jsx)(F,{products:s})}),GET_FILTERS:({assortment:e,filters:s})=>(0,t.jsx)(ed,{assortment:e,children:(0,t.jsx)(em,{filters:s})}),REORDER_LINKS:ei,REORDER_PRODUCTS:F,REORDER_FILTERS:em,COUNT:w("ASSORTMENT")},M(["REMOVE_MEDIA","REMOVE"],et),M(["GET","CREATE","UPDATE","SET_BASE","UPDATE_STATUS","ADD_LINK","ADD_MEDIA","ADD_PRODUCT","ADD_FILTER"],ed),M(["GET_MEDIA","REORDER_MEDIA"],q),Object.fromEntries(["GET_TEXTS","GET_MEDIA_TEXTS","UPDATE_MEDIA_TEXTS"].map(e=>[e,Q(e)]))),fallbackComponent:({action:e,data:t})=>JSON.stringify({action:e,data:t},null,2)});var eh=e.i(95677),eh=eh;let ef=({iface:e})=>{let{formatMessage:s}=(0,x.X)();return(0,t.jsxs)("div",{className:"relative border rounded-xl p-4 shadow-sm bg-surface-input flex items-start gap-4 w-full",children:[(0,t.jsx)("div",{className:"shrink-0 mt-1 text-slate-500 dark:text-slate-300",children:(0,t.jsx)(eh.f,{className:"w-7 h-7"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 space-y-1",children:[(0,t.jsx)("div",{className:"flex items-center justify-between gap-2",children:(0,t.jsx)("h3",{className:"text-sm font-semibold text-text-primary truncate",children:e.label})}),(0,t.jsxs)("div",{className:"flex items-center flex-wrap gap-3 text-xs text-text-muted",children:[(0,t.jsx)(b.f,{text:e.version,square:!0,dotted:!0}),(0,t.jsxs)("span",{className:"bg-surface-raised px-2 py-1 rounded truncate",children:[s({id:"id",defaultMessage:"ID"}),": ",e._id]})]})]})]})},eg=({interfaces:e})=>e?.length?e.map(e=>(0,t.jsx)(ef,{iface:e},e._id)):null;var ep=e.i(52606);let ej=({configuration:e})=>e&&0!==e.length?(0,t.jsx)("div",{className:"p-3 bg-surface rounded-lg shadow-inner border border-border-subtle",children:(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2 text-xs text-text-secondary",children:JSON.parse(e)?.map(({key:e,value:s})=>(0,t.jsxs)("div",{className:"flex justify-between items-center gap-2 truncate",children:[(0,t.jsx)("span",{className:"font-medium text-text-secondary truncate",children:e}),(0,t.jsx)("span",{className:"truncate text-right text-text-muted",children:s})]},e))})}):null,eb=({provider:e,type:s})=>{let{formatMessage:a}=(0,x.X)(),{formatDateTime:r}=(0,f.f)();return(0,t.jsxs)("div",{className:"relative border rounded-xl p-4 shadow-sm bg-surface-input space-y-4 w-full",children:[(0,t.jsx)(g.default,{href:("PAYMENT"===s?`/payment-provider?paymentProviderId=${e._id}`:"DELIVERY"===s?`/delivery-provider?deliveryProviderId=${e._id}`:"WAREHOUSING"===s?`/warehousing-provider?warehousingProviderId=${e._id}`:void 0)||"/",className:"absolute top-2 right-2 px-2 py-1 text-xs font-medium text-text-secondary hover:text-text-primary border border-border-default rounded-md hover:bg-surface-raised transition-colors",children:a({id:"edit",defaultMessage:"Edit"})}),(0,t.jsxs)("div",{className:"flex items-start gap-4",children:[(0,t.jsx)("div",{className:"shrink-0 mt-1 text-slate-500 dark:text-slate-300",children:(0,t.jsx)(ep.f,{className:"w-8 h-8"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 space-y-1",children:[(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsx)("h3",{className:"text-sm font-semibold text-text-primary truncate",children:e.adapterKey})}),(0,t.jsxs)("div",{className:"flex items-center flex-wrap gap-3 text-xs text-text-muted",children:[(0,t.jsx)(b.f,{text:e.type,square:!0,dotted:!0}),(0,t.jsx)(p,{id:e._id,className:"bg-surface-raised px-2 py-1 rounded text-xs text-text-muted"}),(0,t.jsxs)("span",{children:[a({id:"created",defaultMessage:"Created"}),":"," ",r(e.created,{dateStyle:"medium"})]}),(0,t.jsxs)("span",{children:[a({id:"provider_configuration_items",defaultMessage:"Config items"}),": ",e.configuration?.length??0]})]})]})]}),(0,t.jsx)(ej,{configuration:e.configuration})]})},ev=({providers:e,type:s})=>e?.length?(0,t.jsx)("div",{className:"space-y-4",children:e.map(e=>(0,t.jsx)(eb,{type:s,provider:e},e._id))}):null,eN=["CREATE","UPDATE","REMOVE","GET"],ey=E(...["PAYMENT","DELIVERY","WAREHOUSING"].map(e=>Object.fromEntries(Object.entries({...M(eN,eb),LIST:ev,INTERFACES:eg}).map(([t,s])=>[`${e}_${t}`,s]))));var ew=e.i(51782);let e_=({order:e,children:s=null})=>{let{formatPrice:a}=(0,h.d)(),{formatDateTime:r}=(0,f.f)(),{formatMessage:l}=(0,x.X)();return e?(0,t.jsxs)("div",{className:"relative border rounded-xl p-4 shadow-sm bg-surface-input space-y-4",children:[(0,t.jsx)(g.default,{href:`/orders?orderId=${e?._id}`,className:"absolute top-2 right-2 px-2 py-1 text-xs font-medium text-text-secondary hover:text-text-primary border border-border-default rounded-md hover:bg-surface-raised transition-colors",children:l({id:"view",defaultMessage:"View"})}),(0,t.jsx)("div",{className:"absolute top-10 right-2 flex gap-2 items-end",children:(0,t.jsx)("div",{className:"text-sm font-semibold text-text-primary whitespace-nowrap",children:a(e?.total)})}),(0,t.jsxs)("div",{className:"absolute top-16 right-2 flex gap-2 items-end",children:[(0,t.jsx)(ew.f,{status:e?.status}),e?.delivery?.status&&(0,t.jsx)(b.f,{text:e.delivery.status,color:v.p[e.delivery.status],square:!0,className:"uppercase"}),e?.payment?.status&&(0,t.jsx)(b.f,{text:e.payment.status,color:v.J[e.payment.status],square:!0,className:"uppercase"})]}),(0,t.jsx)("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-start gap-4",children:(0,t.jsxs)("div",{className:"flex-1 min-w-0 space-y-1 overflow-hidden",children:[(0,t.jsxs)("div",{className:"text-sm font-semibold text-text-primary truncate",children:[l({id:"order_number",defaultMessage:"Order #"})," ",e?.orderNumber||e?._id]}),(0,t.jsxs)("div",{className:"text-sm text-text-muted truncate",children:[e?.billingAddress?.firstName," ",e?.billingAddress?.lastName,e?.billingAddress?.company&&` — ${e.billingAddress.company}`]}),(0,t.jsxs)("div",{className:"text-xs text-slate-400 truncate",children:[e?.billingAddress?.city,", ",e?.billingAddress?.countryCode]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 mt-2 text-xs text-text-muted",children:[(0,t.jsxs)("span",{children:[l({id:"ordered",defaultMessage:"Ordered"}),":"," ",(0,t.jsx)("strong",{children:r(e?.ordered)})]}),(0,t.jsxs)("span",{children:[l({id:"confirmed",defaultMessage:"Confirmed"}),":"," ",(0,t.jsx)("strong",{children:r(e?.confirmed)})]}),e?.fulfilled&&(0,t.jsxs)("span",{children:[l({id:"fulfilled",defaultMessage:"Fulfilled"}),": ",(0,t.jsx)("strong",{children:r(e?.fulfilled)})]}),e?.delivery?.delivered&&(0,t.jsxs)("span",{children:[l({id:"delivered",defaultMessage:"Delivered"}),": ",(0,t.jsx)("strong",{children:r(e?.delivery?.delivered)})]}),e?.payment?.paid&&(0,t.jsxs)("span",{children:[l({id:"paid",defaultMessage:"Paid"}),":"," ",(0,t.jsx)("strong",{children:r(e?.payment?.paid)})]})]})]})}),s&&(0,t.jsx)("div",{className:"pt-2",children:(0,t.jsx)("div",{className:"p-3 bg-surface rounded-lg shadow-inner border border-border-subtle",children:s})})]}):s},eM=({order:e,toolCallId:s=null})=>{if(!e)return null;let a=(e?.items||[])?.map(a=>(0,t.jsx)($,{product:a},`${a?._id}-${e?._id}-${s}`));return(0,t.jsx)(e_,{order:e,children:a?.length?a:null})},eE=({orders:e,toolCallId:s})=>e?.length?(0,t.jsx)("div",{className:"space-y-2",children:e.map(e=>(0,t.jsx)(eM,{order:e,toolCallId:s},`${e._id}-${s}`))}):null;var ek=e.i(32394),eT=e.i(82717),eC=e.i(26626),eR=e.i(85429),eA=e.i(71394),eS=e.i(2254),eI=e.i(76835),eO=e.i(67018),eD=e.i(34201),eU=e.i(80902),eU=eU,e$=e.i(88737),eL=e.i(40391);let eP=({currencyCode:e,orderCount:s,averageOrderValue:a,summary:r=[],totalSalesAmount:l,dateRange:d})=>{let{formatMessage:i}=(0,x.X)(),{formatPrice:n}=(0,h.d)(),c={sales:{label:"Sales",color:"hsl(var(--chart-1))"},orders:{label:"Orders",color:"hsl(var(--chart-2))"},avgOrderValue:{label:"Avg Order Value",color:"hsl(var(--chart-3))"}};return(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 my-8",children:[(0,t.jsx)(eD.f,{icon:(0,t.jsx)(eL.f,{className:"h-4 w-4"}),title:i({id:"total_sales",defaultMessage:"Total sales"}),value:n({currencyCode:e,amount:l}),chart:(0,t.jsx)(eO.T,{config:c,children:(0,t.jsxs)(eA.f,{accessibilityLayer:!0,data:r,margin:{left:12,right:12},children:[(0,t.jsx)(eC.f,{vertical:!1}),(0,t.jsx)(eS.f,{dataKey:"date",tickLine:!1,axisLine:!1,tickMargin:8,tickFormatter:e=>e.slice(0,6)}),(0,t.jsx)(eI.f,{hide:!0}),(0,t.jsx)(eO.f,{wrapperStyle:{pointerEvents:"auto",zIndex:50},cursor:!1,content:(0,t.jsx)(eO.m,{formatter:t=>n({currencyCode:e,amount:t})})}),(0,t.jsx)(eR.R,{dataKey:"sales",type:"natural",stroke:"var(--color-sales)",strokeWidth:2,dot:!1})]})}),dateRange:d}),(0,t.jsx)(eD.f,{icon:(0,t.jsx)(e$.f,{className:"h-4 w-4"}),title:i({id:"total_orders",defaultMessage:"Total orders"}),value:s,chart:(0,t.jsx)(eO.T,{config:c,children:(0,t.jsxs)(eT.f,{accessibilityLayer:!0,data:r,margin:{left:12,right:12},children:[(0,t.jsx)(eC.f,{vertical:!1}),(0,t.jsx)(eS.f,{dataKey:"date",tickLine:!1,axisLine:!1,tickMargin:8}),(0,t.jsx)(eI.f,{hide:!0}),(0,t.jsx)(eO.f,{cursor:!1,content:(0,t.jsx)(eO.m,{})}),(0,t.jsx)(ek.e,{dataKey:"orders",fill:"var(--color-orders)",radius:4})]})}),dateRange:d}),(0,t.jsx)(eD.f,{icon:(0,t.jsx)(eU.f,{className:"h-4 w-4"}),title:i({id:"average_order_value",defaultMessage:"Average order value"}),value:n({amount:a,currencyCode:e}),chart:(0,t.jsx)(eO.T,{config:c,children:(0,t.jsxs)(eA.f,{accessibilityLayer:!0,data:r,margin:{left:12,right:12},children:[(0,t.jsx)(eC.f,{vertical:!1}),(0,t.jsx)(eS.f,{dataKey:"date",tickLine:!1,axisLine:!1,tickMargin:8,tickFormatter:e=>e.slice(0,6)}),(0,t.jsx)(eI.f,{hide:!0}),(0,t.jsx)(eO.f,{cursor:!1,content:(0,t.jsx)(eO.m,{formatter:t=>n({currencyCode:e,amount:t})})}),(0,t.jsx)(eR.R,{dataKey:"avgOrderValue",type:"natural",stroke:"var(--color-avgOrderValue)",strokeWidth:2,dot:!1})]})}),dateRange:d})]})},eX=({customers:e,dateRange:s})=>{let{formatMessage:a}=(0,x.X)(),{formatPrice:r}=(0,h.d)(),{formatDateTime:l}=(0,f.f)();return(0,t.jsxs)("div",{className:"space-y-4",children:[(s?.start||s?.end)&&(0,t.jsxs)("div",{className:"text-sm text-text-muted",children:[a({id:"date_range_prefix",defaultMessage:"Showing data from"})," ",(0,t.jsx)("strong",{children:l(s?.start)||"—"})," ",a({id:"date_range_to",defaultMessage:"to"})," ",(0,t.jsx)("strong",{children:l(s?.end)||"—"})]}),e?.length?(0,t.jsx)("div",{className:"space-y-3",children:e.map(e=>{let[s]=e.user?.avatar||[];return(0,t.jsxs)("div",{className:"flex items-center gap-4 p-4 bg-surface rounded-lg shadow-sm border border-border-subtle hover:shadow-md transition-shadow duration-200",children:[(0,t.jsx)("div",{className:"w-14 h-14 flex-shrink-0 rounded-full overflow-hidden bg-surface-raised",children:s?.file?.url?(0,t.jsx)(T.f,{src:s.file.url,alt:"Customer avatar",width:56,height:56,className:"w-full h-full object-cover"}):(0,t.jsx)("div",{className:"flex items-center justify-center h-full text-slate-400",children:(0,t.jsx)("span",{className:"text-2xl",children:"👤"})})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-text-primary truncate",children:e?.user?.profile?.displayName||e?.user?.username||"Unknown User"}),(0,t.jsxs)("div",{className:"text-xs text-text-muted",children:[a({id:"id",defaultMessage:"ID"})," ",e.userId]}),(0,t.jsxs)("div",{className:"text-xs text-text-muted mt-1",children:[a({id:"orders",defaultMessage:"Orders"}),":"," ",(0,t.jsx)("strong",{children:e.orderCount})," •"," ",a({id:"average_order_value",defaultMessage:"Average order value"}),":"," ",(0,t.jsx)("strong",{children:r({amount:e.averageOrderValue,currencyCode:e?.currencyCode})})," ","•"," ",a({id:"total_spent",defaultMessage:"Spent"}),":"," ",(0,t.jsx)("strong",{children:r({amount:e.totalSpent,currencyCode:e?.currencyCode||"CHF"})})]}),(0,t.jsxs)("div",{className:"text-xs text-text-muted mt-0.5",children:[a({id:"last_order_date",defaultMessage:"Last order"}),": ",l(e.lastOrderDate)]})]}),(0,t.jsx)(g.default,{href:`/users?userId=${e.userId}`,className:"px-3 py-1.5 text-sm text-text-secondary hover:text-text-primary border border-border-default rounded-md hover:bg-surface-raised transition-colors flex-shrink-0",children:a({id:"edit",defaultMessage:"Edit"})})]},e.userId)})}):(0,t.jsx)("div",{className:"text-sm text-text-muted",children:a({id:"no_customers",defaultMessage:"No top customers found."})})]})},eG=({product:e})=>{let s=(0,x.X)(),{formatPrice:a}=(0,h.d)(),{product:r,totalSold:l,totalRevenue:d,currencyCode:i}=e,n=r.texts,c=r.commerce?.pricing?.[0],{formatMessage:o}=s;return(0,t.jsxs)("div",{className:"flex items-center gap-4 p-3 bg-surface rounded-lg shadow-sm border border-border-subtle hover:shadow-md transition-shadow duration-200",children:[(0,t.jsx)("div",{className:"w-16 h-16 flex-shrink-0 bg-surface rounded-md overflow-hidden",children:(0,t.jsx)(T.f,{src:r.media?.[0]?.file?.url,alt:n.title,className:"w-full h-full object-cover",width:64,height:64})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-text-primary truncate",children:n.title||o({id:"product_untitled",defaultMessage:"Untitled Product"})}),(0,t.jsxs)("div",{className:"flex items-center gap-3 mt-1",children:[(0,t.jsx)(R.f,{status:r?.status}),(0,t.jsx)("span",{className:"text-xs text-text-muted bg-slate-100 dark:bg-slate-600 px-2 py-1 rounded",children:(r.type||"SIMPLE_PRODUCT").replace("_PRODUCT","")}),(0,t.jsx)("span",{className:"text-sm font-medium text-text-primary",children:c?a(c):o({id:"product_no_price",defaultMessage:"No price"})}),(0,t.jsxs)("span",{className:"text-xs text-text-muted truncate",children:[o({id:"product_id",defaultMessage:"ID"}),": ",r._id]})]}),(0,t.jsxs)("div",{className:"mt-1 text-xs text-text-muted",children:[(0,t.jsxs)("span",{className:"font-medium",children:[o({id:"product_sold",defaultMessage:"Sold"}),":"]})," ",l,(0,t.jsx)("span",{className:"mx-2",children:"•"}),(0,t.jsxs)("span",{className:"font-medium",children:[o({id:"product_revenue",defaultMessage:"Revenue"}),":"]})," ",a({amount:d,currencyCode:i||c?.currencyCode})]})]}),(0,t.jsx)(g.default,{href:`/products?slug=${(0,C.U)(r)}`,className:"px-3 py-1.5 text-sm text-text-secondary hover:text-text-primary border border-border-default rounded-md hover:bg-surface-raised transition-colors flex-shrink-0",children:o({id:"action_edit",defaultMessage:"Edit"})})]})},eV=({products:e,dateRange:s})=>{let{formatMessage:a}=(0,x.X)(),{formatDateTime:r}=(0,f.f)();return e?.length?(0,t.jsxs)("div",{className:"space-y-3",children:[(s?.start||s?.end)&&(0,t.jsxs)("div",{className:"text-sm text-text-muted",children:[a({id:"date_range_prefix",defaultMessage:"Showing data from"})," ",(0,t.jsx)("strong",{children:r(s?.start)||"—"})," ",a({id:"date_range_to",defaultMessage:"to"})," ",(0,t.jsx)("strong",{children:r(s?.end)||"—"})]}),e.map(e=>(0,t.jsx)(eG,{product:e},e.productId))]}):(0,t.jsx)("div",{className:"text-sm text-text-muted",children:a({id:"top_selling_no_products",defaultMessage:"No top selling products found."})})},eF=e=>e?(0,t.jsx)(eP,{...e}):null,eK=_({toolsMap:E({TOP_CUSTOMERS:e=>e?(0,t.jsx)(eX,{...e}):null,MONTHLY_BREAKDOWN:eF,SALES_SUMMARY:eF,TOP_PRODUCTS:e=>e?(0,t.jsx)(eV,{...e}):null},M(["LIST"],e=>(0,t.jsx)(eE,{...e})),M(["GET","GET_CART","PAY_ORDER","DELIVER_ORDER","CONFIRM_ORDER","REJECT_ORDER"],e=>(0,t.jsx)(eM,{...e})))}),eW=e=>e&&2===e.length?e.toUpperCase().replace(/./g,e=>String.fromCodePoint(127462+e.charCodeAt(0)-65)):"",eq=({country:e})=>{let{formatMessage:s,locale:a}=(0,x.X)(),{formatDateTime:r}=(0,f.f)(),l=eW(e.isoCode);return(0,t.jsxs)("div",{className:"relative border rounded-xl p-4 shadow-sm bg-surface-input space-y-4",children:[(0,t.jsx)(g.default,{href:`/country?countryId=${e._id}`,className:"absolute top-2 right-2 px-2 py-1 text-xs font-medium text-text-secondary hover:text-text-primary border border-border-default rounded-md hover:bg-surface-raised transition-colors",children:s({id:"edit",defaultMessage:"Edit"})}),(0,t.jsxs)("div",{className:"flex items-start gap-4",children:[(0,t.jsx)("div",{className:"w-12 h-12 flex-shrink-0 bg-surface-raised rounded-md flex items-center justify-center text-xl",children:l||(0,t.jsx)(H.f,{className:"w-6 h-6"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-text-primary truncate",children:(0,h.Q)(a,e.isoCode)}),(0,t.jsx)(p,{id:e._id}),(0,t.jsxs)("div",{className:"text-xs text-text-secondary mt-1",children:[s({id:"default_currency",defaultMessage:"Default currency"}),": ",(0,h.j)(a,e.defaultCurrencyCode)]})]}),(0,t.jsxs)("div",{className:"flex flex-col items-end text-xs text-text-muted whitespace-nowrap mt-8 gap-1",children:[(0,t.jsx)("span",{className:`text-xs font-medium rounded px-2 py-0.5 ${e.isActive?"bg-green-100 text-green-700 dark:bg-green-800 dark:text-green-200":"bg-red-100 text-red-700 dark:bg-red-800 dark:text-red-200"}`,children:s(e.isActive?{id:"active",defaultMessage:"Active"}:{id:"inactive",defaultMessage:"In-Active"})}),(0,t.jsxs)("span",{children:[s({id:"created",defaultMessage:"Created"}),":"," ",r(e.created)]}),e.updated&&(0,t.jsxs)("span",{children:[s({id:"updated",defaultMessage:"Updated"}),":"," ",r(e.updated)]})]})]})]})};var eY=e.i(99525),eY=eY;let eB=({currency:e})=>{let{locale:s,formatMessage:a}=(0,x.X)(),{formatDateTime:r}=(0,f.f)(),l=e.decimals??2;return(0,t.jsxs)("div",{className:"relative border rounded-xl p-4 shadow-sm bg-surface-input space-y-4",children:[(0,t.jsx)(g.default,{href:`/currency?currencyId=${e._id}`,className:"absolute top-2 right-2 px-2 py-1 text-xs font-medium text-text-secondary hover:text-text-primary border border-border-default rounded-md hover:bg-surface-raised transition-colors",children:a({id:"edit",defaultMessage:"Edit"})}),(0,t.jsxs)("div",{className:"flex items-start gap-4",children:[(0,t.jsx)("div",{className:"w-10 h-10 flex-shrink-0 bg-surface-raised rounded-md flex items-center justify-center text-emerald-500",children:(0,t.jsx)(eY.f,{className:"w-5 h-5"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-text-primary truncate",children:(0,h.j)(s,e.isoCode)}),(0,t.jsx)(p,{id:e._id}),(0,t.jsxs)("div",{className:"text-xs text-text-secondary mt-1",children:[a({id:"decimals",defaultMessage:"Decimals"}),":"," ",l]}),e.contractAddress&&(0,t.jsxs)("div",{className:"text-xs text-text-secondary truncate mt-1",children:[a({id:"contract_address",defaultMessage:"Contract Address"}),": ",(0,t.jsx)("span",{className:"font-mono",children:e.contractAddress})]})]}),(0,t.jsxs)("div",{className:"flex flex-col items-end text-xs text-text-muted whitespace-nowrap mt-8 gap-1",children:[(0,t.jsx)("span",{className:`text-xs font-medium rounded px-2 py-0.5 ${e.isActive?"bg-green-100 text-green-700 dark:bg-green-800 dark:text-green-200":"bg-red-100 text-red-700 dark:bg-red-800 dark:text-red-200"}`,children:a(e.isActive?{id:"active",defaultMessage:"Active"}:{id:"inactive",defaultMessage:"In-Active"})}),(0,t.jsxs)("span",{children:[a({id:"created",defaultMessage:"Created"}),":"," ",r(e.created)]}),e.updated&&(0,t.jsxs)("span",{children:[a({id:"updated",defaultMessage:"Updated"}),":"," ",r(e.updated)]})]})]})]})};var eH=e.i(87999),eH=eH;let eJ=({language:e})=>{let{locale:s,formatMessage:a}=(0,x.X)(),{formatDateTime:r}=(0,f.f)(),l=eW(e.isoCode);return(0,t.jsxs)("div",{className:"relative border rounded-xl p-4 shadow-sm bg-surface-input space-y-4",children:[(0,t.jsx)(g.default,{href:`/language?languageId=${e._id}`,className:"absolute top-2 right-2 px-2 py-1 text-xs font-medium text-text-secondary hover:text-text-primary border border-border-default rounded-md hover:bg-surface-raised transition-colors",children:a({id:"edit",defaultMessage:"Edit"})}),(0,t.jsxs)("div",{className:"flex items-start gap-4",children:[(0,t.jsx)("div",{className:"w-12 h-12 flex-shrink-0 bg-surface-raised rounded-md flex items-center justify-center text-xl",children:l||(0,t.jsx)(eH.f,{className:"w-6 h-6 text-blue-500"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-text-primary truncate",children:(0,h.I)(s,e.isoCode)}),(0,t.jsx)(p,{id:e._id})]}),(0,t.jsxs)("div",{className:"flex flex-col items-end text-xs text-text-muted whitespace-nowrap mt-8 gap-1",children:[(0,t.jsx)("span",{className:`text-xs font-medium rounded px-2 py-0.5 ${e.isActive?"bg-green-100 text-green-700 dark:bg-green-800 dark:text-green-200":"bg-red-100 text-red-700 dark:bg-red-800 dark:text-red-200"}`,children:a(e.isActive?{id:"active",defaultMessage:"Active"}:{id:"inactive",defaultMessage:"Inactive"})}),(0,t.jsxs)("span",{children:[a({id:"created",defaultMessage:"Created"}),":"," ",r(e.created)]}),e.updated&&(0,t.jsxs)("span",{children:[a({id:"updated",defaultMessage:"Updated"}),":"," ",r(e.updated)]})]})]})]})},ez=["CREATE","UPDATE","GET"],eQ={COUNTRY:{...M(ez,eq),LIST:({countries:e,toolCallId:s})=>e?.length?(0,t.jsx)("div",{className:"space-y-3",children:e.map(e=>(0,t.jsx)(eq,{country:e},`${s}-${e?._id}`))}):null,COUNT:w("COUNTRY"),REMOVE:et},CURRENCY:{...M(ez,eB),LIST:({currencies:e,toolCallId:s})=>e?.length?(0,t.jsx)("div",{className:"space-y-2",children:e.map(e=>(0,t.jsx)(eB,{currency:e},`${s}-${e._id}`))}):null,COUNT:w("CURRENCY"),REMOVE:et},LANGUAGE:{...M(ez,eJ),LIST:({languages:e,toolCallId:s})=>e?.length?(0,t.jsx)("div",{className:"space-y-3",children:e.map(e=>(0,t.jsx)(eJ,{language:e},`${s}-${e._id}`))}):null,COUNT:w("LANGUAGE"),REMOVE:et}},eZ=({user:e})=>{let{formatMessage:s}=(0,x.X)(),{formatDateTime:a}=(0,f.f)();if(!e)return null;let r=[{key:"orders",label:s({id:"orders",defaultMessage:"Orders"}),href:`/users?userId=${e._id}&tab=orders`},{key:"enrollments",label:s({id:"enrollments",defaultMessage:"Enrollments"}),href:`/users?userId=${e._id}&tab=enrollments`},{key:"reviews",label:s({id:"reviews",defaultMessage:"Reviews"}),href:`/users?userId=${e._id}&tab=reviews`},{key:"quotations",label:s({id:"quotations",defaultMessage:"Quotations"}),href:`/users?userId=${e._id}&tab=quotations`},{key:"paymentCredentials",label:s({id:"payment_credentials",defaultMessage:"Payment Credentials"}),href:`/users?userId=${e._id}&tab=payment_credentials`},{key:"tokens",label:s({id:"tokens",defaultMessage:"Tokens"}),href:`/users?userId=${e._id}&tab=tokens`}],[l]=e?.avatar||[],d=e?.name.split(" ").map(e=>e[0]).join("").slice(0,2).toUpperCase();return(0,t.jsxs)("div",{className:"relative border rounded-xl p-4 shadow-sm bg-surface-input space-y-4 w-full",children:[(0,t.jsxs)("div",{className:"flex justify-between items-start w-full",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"w-10 h-10 rounded-full bg-surface-raised flex items-center justify-center overflow-hidden flex-shrink-0",children:l?.file?.url?(0,t.jsx)(T.f,{src:l?.file?.url,alt:e?.name,width:200,height:200,className:"w-full h-full object-cover"}):(0,t.jsx)("span",{className:"text-sm font-medium text-text-secondary",children:d})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("h3",{className:"text-sm font-medium text-text-primary truncate",children:[e?.name," "," - "," ",e?.username?`@${e?.username}`:""]}),e?.emails?.length>0&&(0,t.jsxs)("p",{className:"text-xs text-text-muted",children:[e?.primaryEmail?.address," ",e?.primaryEmail?.verified?(0,t.jsx)(b.f,{text:s({id:"verified",defaultMessage:"Verified"}),color:"green",square:!0}):(0,t.jsx)(b.f,{text:s({id:"unverified",defaultMessage:"Unverified"}),color:"yellow",square:!0})]}),e?.roles?.length>0?(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:e.roles.map(e=>(0,t.jsx)(b.f,{text:e,color:"purple",square:!0},e))}):(0,t.jsxs)("p",{className:"text-xs text-text-muted",children:[s({id:"roles",defaultMessage:"Roles"}),": –"]}),(0,t.jsxs)("p",{className:"text-xs text-slate-400 mt-1",children:[s({id:"registered",defaultMessage:"Registered"}),": ",a(e.created)]})]})]}),(0,t.jsxs)("div",{className:"flex flex-col items-end text-xs text-text-muted ml-4 whitespace-nowrap gap-1",children:[(0,t.jsx)(g.default,{href:`/users?userId=${e._id}`,className:"mt-2 px-2 py-1 text-xs font-medium text-text-secondary hover:text-text-primary border border-border-default rounded-md hover:bg-surface-raised transition-colors",children:s({id:"edit",defaultMessage:"Edit"})}),(0,t.jsx)(p,{id:e._id}),!!e.guest&&(0,t.jsx)(b.f,{text:s({id:"guest",defaultMessage:"Guest"}),color:"yellow",square:!0}),e?.lastLogin?.timestamp&&(0,t.jsxs)("span",{children:[s({id:"last_login",defaultMessage:"Last log in"}),":"," ",a(e.lastLogin.timestamp,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})]})]})]}),e?.tags?.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-3 w-full",children:e.tags.map(e=>(0,t.jsx)(b.f,{text:e,color:"blue"},e))}),(0,t.jsx)("div",{className:"flex flex-wrap justify-between gap-4 mt-4 text-xs text-text-secondary border-t border-border-subtle pt-3",children:r.map(({key:s,label:a,href:r})=>{let l=e[s]?.length??0;return(0,t.jsxs)(g.default,{href:r,className:"hover:underline flex items-center gap-1",children:[(0,t.jsxs)("span",{className:"font-medium",children:[a,":"]}),(0,t.jsx)("span",{children:l})]},s)})})]},e._id)},e0=_({toolsMap:E({LIST:({users:e,toolCallId:s})=>{let{formatMessage:a}=(0,x.X)();return e?.length?(0,t.jsx)("div",{className:"flex flex-col gap-3 w-full",children:e.map(e=>(0,t.jsx)(eZ,{user:e},`${e._id}-${s}`))}):(0,t.jsx)("div",{className:"p-4 text-center text-slate-500",children:a({id:"no_users_found",defaultMessage:"No users found"})})},GET_ORDERS:eE,COUNT:w("USER")},M(["GET","UPDATE","CREATE","SET_TAGS","SET_USERNAME","ADD_EMAIL","ENROLL","GET_CURRENT_USER"],eZ),M(["SEND_VERIFICATION_EMAIL","SEND_ENROLLMENT_EMAIL","REMOVE","REMOVE_PRODUCT_REVIEWS","REMOVE_EMAIL"],et))}),e2=_({toolsMap:E({LIST:em,REMOVE:et,COUNT:w("FILTER")},M(["GET","CREATE","UPDATE","REMOVE_OPTION","CREATE_OPTION"],ex),Object.fromEntries(["GET_TEXTS","UPDATE_TEXTS"].map(e=>[e,Q(e)]))),fallbackComponent:({action:e,data:t})=>JSON.stringify({action:e,data:t},null,2)});var e1=e.i(50216),e4=e.i(27861),e5=e.i(57322),e3=e.i(24323),e6=e.i(60836),e7=e.i(2848),e8=e.i(27765),e9=e.i(35113),te=e.i(36980);function tt(e,t,s){let a,r,l=(0,e4.f)(),d=s?.locale??l.locale??e1.f,i=(0,e6.f)(e,t);if(isNaN(i))throw RangeError("Invalid time value");let n=Object.assign({},s,{addSuffix:s?.addSuffix,comparison:i}),[c,o]=(0,e3.f)(s?.in,...i>0?[t,e]:[e,t]),x=(r=((0,e9.f)(o)-(0,e9.f)(c))/1e3,(0,te.f)(void 0)(r)),m=Math.round((x-((0,e5.f)(o)-(0,e5.f)(c))/1e3)/60);if(m<2)if(s?.includeSeconds)if(x<5)return d.formatDistance("lessThanXSeconds",5,n);else if(x<10)return d.formatDistance("lessThanXSeconds",10,n);else if(x<20)return d.formatDistance("lessThanXSeconds",20,n);else if(x<40)return d.formatDistance("halfAMinute",0,n);else if(x<60)return d.formatDistance("lessThanXMinutes",1,n);else return d.formatDistance("xMinutes",1,n);else if(0===m)return d.formatDistance("lessThanXMinutes",1,n);else return d.formatDistance("xMinutes",m,n);if(m<45)return d.formatDistance("xMinutes",m,n);if(m<90)return d.formatDistance("aboutXHours",1,n);if(m<e7.k){let e=Math.round(m/60);return d.formatDistance("aboutXHours",e,n)}if(m<2520)return d.formatDistance("xDays",1,n);else if(m<e7.d){let e=Math.round(m/e7.k);return d.formatDistance("xDays",e,n)}else if(m<2*e7.d)return a=Math.round(m/e7.d),d.formatDistance("aboutXMonths",a,n);if((a=function(e,t){var s;let a,r,l,[d,i,n]=(0,e3.f)(void 0,e,e,t),c=(0,e6.f)(i,n),o=Math.abs(function(e,t){let[s,a]=(0,e3.f)(void 0,e,t);return 12*(s.getFullYear()-a.getFullYear())+(s.getMonth()-a.getMonth())}(i,n));if(o<1)return 0;1===i.getMonth()&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-c*o);let x=(0,e6.f)(i,n)===-c;a=(0,e9.f)(d,void 0),+(0,e8.f)(a,void 0)==+(s=void 0,l=(r=(0,e9.f)(a,s?.in)).getMonth(),r.setFullYear(r.getFullYear(),l+1,0),r.setHours(23,59,59,999),r)&&1===o&&1===(0,e6.f)(d,n)&&(x=!1);let m=c*(o-x);return 0===m?0:m}(o,c))<12){let e=Math.round(m/e7.d);return d.formatDistance("xMonths",e,n)}{let e=a%12,t=Math.trunc(a/12);return e<3?d.formatDistance("aboutXYears",t,n):e<9?d.formatDistance("overXYears",t,n):d.formatDistance("almostXYears",t+1,n)}}let ts=({quotation:e,children:s})=>{let{formatMessage:a}=(0,x.X)();if(!e)return s;let{_id:r,quotationNumber:l,status:d,created:i,expires:n,user:c,country:o,currency:m,configuration:u}=e,h=c?.username||c?.profile?.displayName||c?.name||c?.emails?.[0]?.address,f=c?._id,j=i?tt(new Date(i),new Date,{addSuffix:!0}):"",N=n?tt(new Date(n),new Date,{addSuffix:!0}):null;return(0,t.jsxs)("div",{className:"relative border rounded-xl p-4 shadow-sm bg-surface-input space-y-4",children:[(0,t.jsx)("div",{className:"absolute top-2 right-2 text-xs font-medium",children:(0,t.jsx)(b.f,{text:d,color:v.L[d],square:!0})}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[l&&(0,t.jsxs)("span",{className:"text-xs text-text-muted bg-slate-100 dark:bg-slate-600 px-2 py-1 rounded",children:["#",l]}),(0,t.jsx)(p,{id:r})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 text-xs text-text-muted",children:[(0,t.jsxs)("div",{children:[a({id:"requested_by",defaultMessage:"Requested by"}),":"," ",f?(0,t.jsx)(g.default,{href:`/users/edit?userId=${f}`,className:"font-medium text-blue-600 dark:text-blue-400 hover:underline",children:h}):(0,t.jsx)("strong",{children:h})]}),(0,t.jsxs)("div",{children:[a({id:"created",defaultMessage:"Created"}),":"," ",(0,t.jsx)("strong",{children:j})]}),N&&(0,t.jsxs)("div",{children:[a({id:"expires",defaultMessage:"Expires"}),":"," ",(0,t.jsx)("strong",{children:N})]}),o&&(0,t.jsx)("div",{className:"px-2 py-0.5 rounded bg-surface-raised",children:o.isoCode}),m&&(0,t.jsx)("div",{className:"px-2 py-0.5 rounded bg-surface-raised",children:m.isoCode})]}),(0,t.jsx)(ej,{configuration:u})]}),s&&(0,t.jsx)("div",{className:"pt-2",children:(0,t.jsx)("div",{className:"p-3 bg-surface rounded-lg shadow-inner border border-border-subtle",children:s})})]})},ta=({...e})=>(0,t.jsx)(ts,{quotation:e,children:(0,t.jsx)(S,{product:e.product})}),tr=({quotations:e})=>e&&0!==e.length?(0,t.jsx)("div",{className:"space-y-4",children:e.map(e=>(0,t.jsx)(ta,{...e},e._id))}):null,tl={system_management:k,generateImage:e=>{let{imageUrl:s,media:a,file:r}=e||{};if(s)return(0,t.jsx)(n.default,{alt:"Generated image",src:s,width:1200,height:50});let l=r?.url;return l?(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(T.f,{src:l,alt:r?.name||`Media file: ${l}`,width:128,height:128,className:"w-100 object-cover rounded shadow"}),(0,t.jsx)("a",{href:l,target:"_blank",className:"text-xs font-mono link",children:l})]}):a?.length?(0,t.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4 mb-6",children:a.map(e=>(0,t.jsxs)("div",{className:"flex flex-col items-center space-y-2",children:[(0,t.jsx)(T.f,{src:e?.file?.url,alt:e.file?.name||`Media file: ${e.file?._id||"Unknown"}`,width:128,height:128,className:"w-full h-full object-cover rounded shadow"}),(0,t.jsx)("span",{className:"text-xs text-gray-500 break-all font-mono",children:e._id})]},e.id||e.file?.url))}):null},product_management:es,localization_management:({localizationType:e,action:s,data:a,...r})=>{let l=eQ?.[e]?.[s];return l?(0,t.jsx)(l,{type:e,...a,...r}):null},assortment_management:eu,order_management:eK,quotation_management:_({toolsMap:E({COUNT:w("QUOTATION")},M(["LIST"],e=>e?.quotations?.length?(0,t.jsx)("div",{className:"mb-6",children:(0,t.jsx)(tr,{quotations:e.quotations})}):null),M(["GET","VERIFY","MAKE_PROPOSAL","REJECT"],e=>(0,t.jsx)(ta,{...e})))}),provider_management:({providerType:e,action:s,data:a})=>{let r=ey[`${e}_${s}`];return r?(0,t.jsx)(r,{type:e,...a}):null},filter_manage:e2,filter_management:e2,users_management:e0},td=({part:e})=>{let{formatMessage:s}=(0,x.X)(),{toolName:a,output:r,toolCallId:l}=e??{};if(!a||!r?.content?.length)return null;let d=r.content[0],i=d?.text??d;try{let e="string"==typeof i?i:JSON.stringify(i);if(e.startsWith("Error"))return null;let s=JSON.parse(e||"{}"),r=tl?.[a];return(0,t.jsx)("div",{className:"mb-6",children:r?r({...s,toolCallId:l}):(0,t.jsx)(m,{data:s})})}catch(e){return(0,t.jsxs)("div",{className:"text-sm text-rose-500 mb-4",children:[(0,t.jsxs)("div",{children:[" ",s({id:"failed_tool_response",defaultMessage:"Failed to parse tool result."})," "]}),(0,t.jsxs)("details",{className:"mt-2",children:[(0,t.jsx)("summary",{className:"cursor-pointer text-xs",children:"Debug info"}),(0,t.jsx)("pre",{className:"text-xs mt-1 p-2 bg-rose-50 dark:bg-rose-950 rounded overflow-auto",children:`Tool: ${a}
2
+ Error: ${e?.message||"Unknown error"}
3
+ Content: ${JSON.stringify(r?.content,null,2)}`})]})]})}},ti=({message:e,user:s})=>{let a="user"===e.role;return(0,t.jsxs)("div",{className:`flex ${a?"justify-end":"justify-start"}`,children:[a&&s&&(0,t.jsx)("div",{className:"flex-shrink-0 mr-2",children:(0,t.jsx)(o.f,{showName:!1,name:s.username})}),(0,t.jsx)("div",{className:`${a?"bg-surface-raised rounded-br-none rounded-xl max-w-md px-3 py-2":"text-text-secondary flex-1 max-w-full py-3 overflow-hidden"}`,children:e.parts.map((e,s)=>{switch(e.type){case"text":return(0,t.jsx)(c,{text:e.text,className:"mb-0"},s);case"dynamic-tool":return(0,t.jsx)(td,{part:e},s);case"step-start":case"reasoning":return null;case"tool-generateImage":return(0,t.jsx)(td,{part:{toolName:"generateImage",output:{content:[{text:e.output}]}}},s);default:return(0,t.jsxs)("div",{className:"text-sm text-amber-600",children:["Unknown part: ",JSON.stringify(e)]},s)}})})]})};var tn=e.i(24271);let tc=()=>{let{status:e}=(0,a.k)();return"ready"===e?null:(0,t.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3",children:[(0,t.jsx)("div",{className:"w-8 h-8 bg-gradient-to-br from-slate-600 to-slate-800 dark:from-slate-500 dark:to-slate-700 rounded-lg flex items-center justify-center shadow-sm",children:(0,t.jsx)(tn.f,{className:"w-5 h-5 text-white animate-pulse"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("div",{className:"flex items-center gap-2 mb-1",children:(0,t.jsx)("span",{className:"text-sm font-medium text-text-secondary",children:"Copilot"})}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm text-text-muted italic transition-opacity duration-300",children:{submitted:"Processing...",streaming:"Generating..."}[e]}),(0,t.jsxs)("div",{className:"flex gap-1",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-slate-300 dark:bg-slate-600 rounded-full animate-bounce",style:{animationDelay:"0ms"}}),(0,t.jsx)("div",{className:"w-2 h-2 bg-slate-300 dark:bg-slate-600 rounded-full animate-bounce",style:{animationDelay:"150ms"}}),(0,t.jsx)("div",{className:"w-2 h-2 bg-slate-300 dark:bg-slate-600 rounded-full animate-bounce",style:{animationDelay:"300ms"}})]})]})]})]})};var to=e.i(51870),tx=e.i(39382);let tm=()=>{let{formatMessage:e}=(0,x.X)(),{messages:s,clearHistory:r}=(0,a.k)();return(0,t.jsxs)("header",{className:"p-4 mt-1 flex items-center justify-between max-w-4xl mx-auto w-full",children:[(0,t.jsxs)("div",{className:"text-xl font-semibold text-text-primary",children:["Unchained",(0,t.jsxs)("span",{className:"font-light ml-1",children:["Copilot",(0,t.jsx)("span",{className:"text-xs ml-1",children:" 1.0"})]})]}),s.length>0&&(0,t.jsxs)("button",{onClick:r,className:"flex items-center gap-2 px-3 py-1.5 text-sm text-text-secondary hover:text-slate-900 hover:bg-white dark:hover:text-slate-200 border border-transparent hover:border-slate-100 hover:border-slate-300 dark:hover:border-slate-600 rounded-md dark:hover:bg-slate-700 transition-colors",children:[(0,t.jsx)(tx.f,{className:"h-4 w-4"}),e({id:"clear_history",defaultMessage:"Clear History"})]})]})};var tu=e.i(79337),tu=tu,th=e.i(53463),tf=e.i(24608),tg=e.i(3954),tg=tg,tp=e.i(86129);let tj=()=>{let[e,r]=(0,s.useState)(""),{status:l,stop:d,handleSubmit:i,addInterruptionMessage:c,reload:o}=(0,a.k)(),[x,m]=(0,G.f)("copilot-input-history",[]),[u,h]=(0,s.useState)([]),[f,g]=(0,s.useState)(!1),[p,j]=(0,s.useState)(!1);(0,s.useEffect)(()=>{("submitted"===l||"streaming"===l)&&j(!1)},[l]);let b=async t=>{t.preventDefault();try{if(e.trim()||u.length>0){let t=e.trim();r(""),t&&(0===x.length||x[x.length-1]!==t)&&m(e=>[...e,t]);let s=[...u];h([]),i(e,s)}}catch(t){let e=t instanceof Error?t.message:String(t);e.includes("401")||e.includes("invalid_token")||console.error(t)}},v=async e=>{let t=new FormData;t.append("image",e);try{let e=await fetch("/temp-upload",{method:"POST",body:t,credentials:"include"}),s=await e.json();return s?.url}catch(e){return console.error("Upload failed",e),null}},N=async e=>{if(!e.target.files)return;g(!0);let t=Array.from(e.target.files),s=await Promise.all(t.map(e=>v(e)));h(e=>[...e,...s.filter(Boolean)]),g(!1)};return(0,s.useEffect)(()=>{let e=setTimeout(()=>{x.length>0&&localStorage.setItem("copilot-input-history",JSON.stringify(x.slice(-50)))},500);return()=>clearTimeout(e)},[x,m]),(0,s.useEffect)(()=>{if(""===e){let e=document.getElementById("copilot-input");e&&(e.style.height="20px")}},[e]),(0,t.jsx)("div",{className:"sticky bottom-0 left-0 right-0 bg-surface border-t border-border-subtle",children:(0,t.jsx)("div",{className:"max-w-4xl mx-auto px-4 py-4",children:(0,t.jsxs)("form",{onSubmit:b,className:"relative",children:[(0,t.jsxs)("div",{className:"flex items-end bg-surface border border-border-default rounded-2xl shadow-sm hover:shadow-md transition-shadow duration-200 focus-within:border-gray-400 dark:focus-within:border-gray-500",children:[u.length>0&&(0,t.jsx)("div",{className:"p-3 pb-0",children:(0,t.jsx)("div",{className:"flex gap-2 flex-wrap",children:u.map((e,s)=>(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(n.default,{src:e,alt:`Selected ${s}`,width:48,height:48,className:"h-12 w-12 object-cover rounded-lg border border-border-default"}),(0,t.jsx)("button",{type:"button",onClick:()=>h(e=>e.filter((e,t)=>t!==s)),className:"absolute -top-1 -right-1 bg-gray-600 hover:bg-gray-700 text-white rounded-full w-4 h-4 flex items-center justify-center text-xs transition-colors",children:(0,t.jsx)(tf.f,{className:"h-3 w-3",strokeWidth:2})})]},e))})}),(0,t.jsxs)("div",{className:"flex-1 flex items-center min-h-12",children:[(0,t.jsx)("div",{className:"flex-1 px-3",children:(0,t.jsx)("textarea",{value:e,id:"copilot-input",onChange:e=>r(e.target.value),onKeyDown:t=>{if("Enter"===t.key&&!t.shiftKey){if(t.preventDefault(),e.trim()||u.length>0){let e=t.currentTarget.closest("form");e?.requestSubmit()}return}},placeholder:"Message Copilot...",className:"w-full border-0 bg-transparent text-text-primary placeholder-gray-500 dark:placeholder-gray-400 focus:ring-0 focus:outline-none resize-none text-base leading-5 overflow-hidden py-1",rows:1,style:{height:"20px",minHeight:"20px",maxHeight:"120px"},onInput:e=>{let t=e.target;t.style.height="20px";let s=t.scrollHeight;t.style.height=Math.min(s,120)+"px",s>120?t.style.overflowY="auto":t.style.overflowY="hidden"}})}),(0,t.jsxs)("div",{className:"flex items-center gap-1 p-2",children:[(0,t.jsx)("input",{type:"file",accept:"image/*",multiple:!0,onChange:N,className:"hidden",id:"image-upload"}),(0,t.jsx)("label",{htmlFor:"image-upload",className:"flex items-center justify-center w-8 h-8 text-text-secondary hover:text-text-primary cursor-pointer hover:bg-surface-raised rounded-full transition-all duration-200",title:"Attach images",tabIndex:0,children:(0,t.jsx)(tu.f,{className:"h-5 w-5",strokeWidth:1.5})}),("ready"===l||p)&&(0,t.jsx)("button",{type:"button",onClick:o,className:"flex items-center justify-center w-8 h-8 text-text-secondary hover:text-text-primary hover:bg-surface-raised rounded-full transition-all duration-200",title:"Regenerate last response",children:(0,t.jsx)(tp.f,{className:"h-5 w-5",strokeWidth:1.5})}),"submitted"!==l&&"streaming"!==l||p?(0,t.jsx)("button",{type:"submit",disabled:!e.trim()&&0===u.length,className:"flex items-center justify-center w-8 h-8 bg-gray-900 dark:bg-gray-100 text-white dark:text-gray-900 hover:bg-gray-800 dark:hover:bg-gray-200 disabled:bg-gray-300 dark:disabled:bg-gray-600 disabled:text-gray-500 dark:disabled:text-gray-400 disabled:cursor-not-allowed rounded-full transition-all duration-200",title:"Send message",children:(0,t.jsx)(th.f,{className:"h-5 w-5",strokeWidth:1.5})}):(0,t.jsx)("button",{type:"button",onClick:()=>{j(!0),d(),setTimeout(()=>{c(l)},100)},className:"flex items-center justify-center w-8 h-8 bg-gray-600 dark:bg-gray-700 text-white hover:bg-gray-700 dark:hover:bg-gray-600 rounded-full transition-all duration-200",title:"Stop generation",children:(0,t.jsx)(tg.f,{className:"h-5 w-5",strokeWidth:1.5})})]})]})]}),f&&(0,t.jsx)("div",{className:"mt-2 px-2",children:(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"Uploading images..."})})]})})})};var tb=e.i(22576),tb=tb;let tv=s.default.memo(({onIntroClick:e})=>{let{formatMessage:s}=(0,x.X)();return(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center min-h-[60vh] text-center space-y-6",children:[(0,t.jsx)("div",{className:"w-16 h-16 bg-surface-raised rounded-full flex items-center justify-center",children:(0,t.jsx)(tb.f,{className:"w-8 h-8 text-text-muted"})}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("h2",{className:"text-2xl font-semibold text-text-primary",children:s({id:"copilot_welcome_title",defaultMessage:"Welcome to Unchained Copilot"})}),(0,t.jsx)("p",{className:"text-text-secondary max-w-md",children:s({id:"copilot_welcome_description",defaultMessage:"Your AI assistant is ready to help you manage your Unchained Commerce store."})})]}),(0,t.jsxs)("button",{onClick:e,className:"inline-flex items-center gap-2 px-6 py-3 bg-slate-800 hover:bg-slate-900 dark:bg-slate-600 dark:hover:bg-slate-500 text-white font-medium rounded-lg transition-colors",children:[(0,t.jsx)(tb.f,{className:"w-5 h-5"}),s({id:"say_hi_get_to_know_me",defaultMessage:"Say Hi and Get To Know Me"})]})]})});var tN=e.i(38187),ty=e.i(32665),tw=e.i(83345),t_=e.i(75325),t_=t_,tM=e.i(1672),tE=e.i(57973),tk=e.i(81618),tT=e.i(57748),tC=e.i(85192);let tR={"Product Management":tw.f,"Order Management":e$.f,"Customer Management":t_.f,"Shop Configuration":tM.f,Filters:tE.f,Assortments:tC.f,"Media & Content":tk.f,"Other Tools":tT.f},tA={"Product Management":"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300","Order Management":"bg-emerald-50 dark:bg-emerald-900/20 text-emerald-700 dark:text-emerald-300","Customer Management":"bg-purple-50 dark:bg-purple-900/20 text-purple-700 dark:text-purple-300","Shop Configuration":"bg-amber-50 dark:bg-amber-900/20 text-amber-700 dark:text-amber-300",Filters:"bg-rose-50 dark:bg-rose-900/20 text-rose-700 dark:text-rose-300",Assortments:"bg-indigo-50 dark:bg-indigo-900/20 text-indigo-700 dark:text-indigo-300","Media & Content":"bg-teal-50 dark:bg-teal-900/20 text-teal-700 dark:text-teal-300","Other Tools":"bg-surface-subtle/20 text-text-secondary"},tS=({tool:e})=>{let{normalizeToolName:a,getToolDescription:r}=(()=>{let{formatMessage:e}=(0,x.X)(),t=e=>{if(!e)return"";let t=e.split("_");if(2!==t.length)return e;let[s,a]=t,r=a.match(/^([a-z]+)(.*)$/),l=r?.[1]??a,d=r?.[2]??"",i=e=>e.charAt(0).toUpperCase()+e.slice(1),n=s.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(" ").map(i),c=d?i(d):"";return`${i(l)} ${n.join(" ")}${c?` ${c}`:""}`};return{getToolDescription:(0,s.useCallback)(s=>{let a=s.toLowerCase(),r={product_management:e({id:"list_product_tool_definition",defaultMessage:"Show me all draft products"})};return r[a]?`"${r[a]}"`:a.includes("assortment")?e({id:"assortment_management_tool_definition",defaultMessage:'"Manage product categories"'}):a.includes("media")&&a.includes("remove")?e({id:"media_remover_tool_definition",defaultMessage:'"Remove media files"'}):a.includes("media")&&a.includes("add")?e({id:"media_add_tool_definition",defaultMessage:'"Add media files"'}):a.includes("media")?e({id:"media_management_tool_definition",defaultMessage:'"Manage media files"'}):e({id:"general_tool_definition",defaultMessage:'"Help me with {toolName}"'},{toolName:t(s)})},[e]),normalizeToolName:t}})(),l=tR[e.category]||tT.f,d=tA[e.category]||tA["Other Tools"];return(0,t.jsxs)("div",{className:"group relative p-4 bg-surface rounded-lg border border-border-subtle hover:border-slate-300 dark:hover:border-slate-600 transition-all hover:shadow-md",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:`p-2 rounded-lg ${d}`,children:(0,t.jsx)(l,{className:"h-5 w-5"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-text-primary truncate",children:a(e.name)}),(0,t.jsx)("p",{className:"text-xs text-text-muted mt-1 line-clamp-2",children:e.description}),(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsx)("p",{className:"text-xs text-text-secondary italic",children:r(e.name)})})]})]}),e.description.length>60&&(0,t.jsxs)("div",{className:"absolute bottom-full left-0 right-0 mb-2 p-3 bg-slate-900 dark:bg-slate-950 text-white text-xs rounded-lg shadow-lg opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none z-10",children:[e.description,(0,t.jsx)("div",{className:"absolute top-full left-1/2 -translate-x-1/2 -mt-1 border-4 border-transparent border-t-slate-900 dark:border-t-slate-950"})]})]})};var tI=e.i(42248);let tO=()=>(0,t.jsx)("div",{className:"space-y-6",children:(0,t.jsxs)("div",{className:"animate-pulse",children:[(0,t.jsx)("div",{className:"h-10 bg-surface-raised rounded-lg w-48 mb-6"}),[1,2,3].map(e=>(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)("div",{className:"h-5 bg-surface-raised rounded w-32 mb-3"}),(0,t.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[1,2,3,4].map(e=>(0,t.jsx)("div",{className:"p-4 bg-surface-raised rounded-lg",children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"w-9 h-9 bg-surface-raised rounded-lg"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("div",{className:"h-4 bg-surface-raised rounded w-3/4 mb-2"}),(0,t.jsx)("div",{className:"h-3 bg-surface-raised rounded w-full"})]})]})},e))})]},e))]})}),tD=({error:e})=>(0,t.jsxs)("div",{className:"text-center py-8",children:[(0,t.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 bg-rose-100 dark:bg-rose-900/20 rounded-full mb-4",children:(0,t.jsx)("svg",{className:"w-8 h-8 text-danger",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),(0,t.jsx)("h3",{className:"text-lg font-medium text-text-primary mb-2",children:"Unable to load tools"}),(0,t.jsx)("p",{className:"text-sm text-text-secondary max-w-md mx-auto",children:e}),(0,t.jsx)("p",{className:"text-xs text-text-muted mt-4",children:"Using default tool set. Full capabilities will be available when connected to the backend."})]}),tU=({groupedTools:e,loading:a,error:r})=>{let l,[d,i]=(0,s.useState)(""),[n,c]=(0,s.useState)({}),o=(l={},Object.entries(e).forEach(([e,t])=>{let s=t.filter(e=>{if(""===d)return!0;let t=d.toLowerCase(),s=e.name.toLowerCase(),a=e.description.toLowerCase(),r=s.includes(t),l=a.includes(t),i=s.replace(/_/g," ").includes(t);return r||l||i});s.length>0&&(l[e]=s)}),l),x=Object.values(e).flat().length;return(Object.keys(e),a)?(0,t.jsx)(tO,{}):r&&0===x?(0,t.jsx)(tD,{error:r}):(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)("div",{className:"space-y-4",children:(0,t.jsxs)("div",{className:"flex items-center justify-between flex-wrap gap-4",children:[(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsxs)("span",{className:"text-sm font-medium text-text-primary",children:[x," tools available"]})}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(tI.f,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-slate-400"}),(0,t.jsx)("input",{type:"text",placeholder:"Search tools...",value:d,onChange:e=>i(e.target.value),className:"pl-10 pr-4 py-2 text-sm border border-border-subtle rounded-lg bg-surface text-text-primary placeholder-slate-400 dark:placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-focus-ring"})]})]})}),(0,t.jsx)("div",{className:"space-y-6",children:0===Object.entries(o).length?(0,t.jsx)("div",{className:"text-center py-8",children:(0,t.jsxs)("p",{className:"text-text-muted",children:['No tools found matching "',d,'"']})}):Object.entries(o).map(([e,s])=>{let a=n[e]||""!==d&&s.length>0;return(0,t.jsxs)("div",{className:"border border-border-subtle rounded-lg overflow-hidden",children:[(0,t.jsx)("button",{onClick:()=>{c(t=>({...t,[e]:!t[e]}))},className:"w-full p-4 bg-surface/50 hover:bg-surface-raised transition-colors text-left",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-text-secondary",children:e}),(0,t.jsx)("span",{className:"text-xs text-text-muted bg-surface-raised px-2 py-1 rounded-full",children:s.length})]}),a?(0,t.jsx)(ty.f,{className:"w-4 h-4 text-slate-400"}):(0,t.jsx)(tN.f,{className:"w-4 h-4 text-slate-400"})]})}),a&&(0,t.jsx)("div",{className:"p-4 bg-surface",children:(0,t.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:s.map(e=>(0,t.jsx)(tS,{tool:e},e.name))})})]},e)})})]})},t$=s.default.memo(({messages:e,loading:a,currentUser:r,showTools:l,toggleShowTools:d,groupedTools:i,toolsLoading:n,toolsError:c})=>{let{formatMessage:o}=(0,x.X)();return 0===e.length?null:(0,t.jsx)(t.Fragment,{children:e.map((e,x)=>(0,t.jsxs)(s.default.Fragment,{children:[(0,t.jsx)(ti,{message:e,user:r}),0===x&&!a&&(0,t.jsxs)("div",{className:"py-4",children:[(0,t.jsx)("div",{className:"mb-6",children:(0,t.jsx)("button",{onClick:d,className:"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-text-secondary bg-surface border border-border-default rounded-lg hover:bg-surface-raised transition-colors",children:l?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ty.f,{className:"w-4 h-4"}),o({id:"hide_available_tools",defaultMessage:"Hide Available Tools"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tN.f,{className:"w-4 h-4"}),o({id:"show_available_tools",defaultMessage:"Show Available Tools"})]})})}),l&&(0,t.jsx)("div",{className:"mt-8",children:(0,t.jsx)(tU,{groupedTools:i,loading:n,error:c})})]})]},e.id))})}),tL=s.default.memo(({onRetry:e})=>{let{formatMessage:s}=(0,x.X)();return(0,t.jsx)("div",{className:"flex flex-col min-h-screen bg-surface-subtle font-sans",children:(0,t.jsxs)("div",{className:"py-16 text-center max-w-lg mx-auto",children:[(0,t.jsx)("p",{className:"mt-2 text-sm text-rose-400 dark:text-rose-300",children:s({id:"chat_error_retry_message",defaultMessage:"An error occurred while processing your request, please reload the conversation and submit something shorter."})}),(0,t.jsx)("button",{onClick:e,className:"mt-6 bg-white hover:bg-slate-950 text-slate-950 hover:text-white dark:hover:text-white rounded-sm shadow-sm hover:shadow-lg py-2 px-4 border border-slate-950 dark:border-slate-200 hover:border-transparent",children:s({id:"retry_prompt",defaultMessage:"Retry"})})]})})}),tP=()=>{let{formatMessage:e}=(0,x.X)(),{messages:r,status:l,reload:d,sendMessage:i}=(0,a.k)(),{chatEnabled:n}=function(){let[e,t]=(0,s.useState)(!1),[a,r]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{(async()=>{try{let e=await fetch("/chat",{method:"OPTIONS"});r(e.ok)}catch{r(!1)}finally{t(!1)}})()},[]),{chatEnabled:a,loading:e}}(),{currentUser:c}=(0,to.f)(),{groupedTools:o,loading:m,error:u}=(()=>{let{formatMessage:e}=(0,x.X)(),[t,a]=(0,s.useState)([]),[r,l]=(0,s.useState)(!0),[d,i]=(0,s.useState)(null),n=(0,s.useCallback)(async()=>{l(!0),i(null);try{let e=await fetch("/chat/tools",{credentials:"include"});if(!e.ok)throw Error(`HTTP error: ${e.statusText}`);let t=await e.json();if(t.error&&!t.tools?.length)throw Error(t.error);a(t.tools||[])}catch(s){let t=e({id:"tool_fetch_failed_error",defaultMessage:"Failed to fetch available tools"});console.error("Error fetching tools:",s),i(t),a([])}finally{l(!1)}},[e]);(0,s.useEffect)(()=>{n()},[n]);let c=(0,s.useMemo)(()=>t.reduce((e,t)=>((e[t.category]||=[]).push(t),e),{}),[t]);return{tools:t,groupedTools:c,loading:r,error:d}})(),h=(0,s.useRef)(null),f="ready"!==l&&"error"!==l,[g,p]=(0,s.useState)(!1),j=async()=>{let t=e({id:"copilot-into-message",defaultMessage:"Hello! Please introduce yourself and explain what you can help me with in managing my Unchained Commerce store. Be friendly and informative about your current capabilities."});try{i({text:t})}catch(e){console.error("Failed to append introduction:",e)}};(0,s.useLayoutEffect)(()=>{let e=h.current;if(!e||!r||0===r.length)return;let t=requestAnimationFrame(()=>{e&&e.scrollIntoView&&e.scrollIntoView({behavior:"smooth"})});return()=>{t&&cancelAnimationFrame(t)}},[r]);let b=(0,s.useMemo)(()=>Array.isArray(r)?r.filter(e=>("assistant"!==e.role||!!e.parts&&0!==e.parts.length&&(e.parts[0]?.type!=="text"||!!e.parts[0]?.text))&&"intro-message"!==e.id):[],[r]);return n?(0,t.jsxs)("div",{className:"flex flex-col min-h-screen bg-surface-subtle font-sans",children:[(0,t.jsx)(tm,{}),(0,t.jsxs)("main",{className:"flex-1 overflow-y-auto py-6 space-y-4 max-w-4xl mx-auto w-full px-4",children:[0!==r.length||f?(0,t.jsx)(t$,{messages:b,loading:f,currentUser:c,showTools:g,toggleShowTools:()=>p(e=>!e),groupedTools:o,toolsLoading:m,toolsError:u}):(0,t.jsx)(tv,{onIntroClick:j}),"error"===l&&(0,t.jsx)(tL,{onRetry:d}),f&&(0,t.jsx)(tc,{}),(0,t.jsx)("div",{ref:h,className:r.length>0||f?"pb-6":""})]}),(0,t.jsx)(tj,{})]}):(0,t.jsx)("div",{className:"flex flex-col min-h-screen bg-surface-subtle font-sans",children:(0,t.jsxs)("div",{className:"py-16 text-center",children:[(0,t.jsx)("h1",{className:"text-4xl font-extrabold text-rose-900 dark:text-rose-200",children:e({id:"chat_disabled_title",defaultMessage:"Chat is Disabled"})}),(0,t.jsx)("p",{className:"mt-2 text-base text-text-muted",children:e({id:"chat_disabled_message",defaultMessage:"Copilot chat is currently disabled in this shop. Please check your engine configuration"})})]})})};var tX=e.i(98926);e.s(["default",0,()=>{let e=(0,tX.f)();return(0,s.useEffect)(()=>()=>{e.cache.reset()},[e]),(0,t.jsx)(a.s,{children:(0,t.jsx)(tP,{})})}],95944)}]);
@@ -0,0 +1,4 @@
1
+ __turbopack_load_page_chunks__("/warehousing-provider/new", [
2
+ "static/chunks/3b1kt-r_75q1a.js",
3
+ "static/chunks/turbopack-077hmtqrhcoji.js"
4
+ ])
@@ -1,4 +1,4 @@
1
- (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,79001,34981,58101,e=>{var s=e.i(91398),t=e.i(69322);e.i(51523);var a=e.i(19518),r=e.i(28401),i=e.i(59295),n=e.i(6277),l=e.i(53576),d=e.i(15971),o=e.i(6607),c=e.i(65530),m=e.i(57569),u=e.i(91788),f=e.i(69211),x=e.i(21128),g=e.i(98949),h=e.i(35339),p=e.i(47542),v=e.i(13120),j=e.i(58971),y=e.i(5505),b=e.i(63094),M=e.i(37547),A=e.i(59080),_=e.i(32171);let I=A.a`
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,79001,34981,58101,e=>{"use strict";var s=e.i(91398),t=e.i(3326);e.i(51523);var a=e.i(19518),r=e.i(28401),i=e.i(59295),n=e.i(6277),l=e.i(53576),d=e.i(15971),o=e.i(6607),c=e.i(65530),m=e.i(57569),u=e.i(91788),f=e.i(69211),x=e.i(21128),g=e.i(98949),h=e.i(35339),p=e.i(47542),v=e.i(13120),j=e.i(58971),y=e.i(5505),b=e.i(63094),M=e.i(37547),A=e.i(59080),_=e.i(32171);let I=A.a`
2
2
  query AssortmentPaths($assortmentId: ID!) {
3
3
  assortment(assortmentId: $assortmentId) {
4
4
  assortmentPaths {
@@ -15,7 +15,7 @@
15
15
  sortKey
16
16
  }
17
17
  }
18
- `;var K=e.i(60195);e.s(["f",0,({assortmentId:e})=>{let{formatMessage:u}=(0,t.X)(),{setModal:f}=(0,o.f)(),{hasRole:x}=(0,j.f)(),{linkedAssortments:g,loading:h}=(0,c.f)({assortmentId:e}),{removeAssortmentLink:p}=(0,m.f)(),{reorderAssortmentLink:v}=(()=>{let[e]=(0,R.f)(q);return{reorderAssortmentLink:async({sortKeys:s})=>e({variables:{sortKeys:s},refetchQueries:["AssortmentLinks"]})}})(),y=g?.map(e=>e._id),b=async e=>{await f((0,s.jsx)(d.f,{onCancelClick:async()=>f(""),message:u({id:"delete_assortment_link",defaultMessage:"This action might cause inconsistencies with other data that relates to it. Are you sure you want to delete this language? "}),onOkClick:async()=>{f(""),await p({assortmentLinkId:e}),r.toast.success(u({id:"assortment_link",defaultMessage:"Link deleted successfully"}))},okText:u({id:"delete_link",defaultMessage:"Delete link"})}))},M=async e=>{let{active:s,over:t}=e;if(s.id!==t.id){let e=y.indexOf(s.id),a=y.indexOf(t.id),i=(0,n.e)(y,e,a).map((e,s)=>({assortmentLinkId:e,sortKey:s}));try{await v({sortKeys:i}),r.toast.success(u({id:"link_reorder",defaultMessage:"Link reorder successfully"}))}catch(e){r.toast.error(u({id:"fail_reorder",defaultMessage:"Reordering failed, Try again!"}))}}else r.toast.info(u({id:"reorder_original",defaultMessage:"Reorder to original location"}))},A=(0,i.n)((0,i.J)(i.k,{activationConstraint:{distance:5}}),(0,i.J)(i.y,{coordinateGetter:n.j}));return(0,s.jsxs)(s.Fragment,{children:[x(a.C.ManageAssortments)&&(0,s.jsx)(K.f,{documentationLabel:u({id:"assortment_link_form_header",defaultMessage:"Child assortments"}),className:"mt-2 lg:mt-5",documentation:(0,s.jsx)(t.L,{id:"assortment_link_form_description",defaultMessage:"<ul> <li>Assign assortment that are direct child of this assortment </li>\n </ul>",values:{ul:e=>(0,s.jsxs)("ul",{className:"space-y-2",children:[e," "]}),li:e=>(0,s.jsxs)("li",{className:"text-sm",children:[e," "]},Math.random()),strong:e=>(0,s.jsx)("strong",{className:"font-semibold text-text-secondary",children:e})}}),children:(0,s.jsx)(N,{assortmentId:e})}),(0,s.jsx)(K.f,{documentationLabel:u({id:"assortment_links_header",defaultMessage:"Assortment links"}),className:"sm:mt-4",documentation:(0,s.jsx)(t.L,{id:"assortment_link_list_description",defaultMessage:"<ul> <li>All assortments found on the assortment relation tree</li>\n <li> Drag and drop list items to sort assortment links </li>\n <li> Parents are assortments found in the ancestors tree on any level </li>\n <li> Descendants are assortments found in the children tree on any level </li> </ul>",values:{ul:e=>(0,s.jsxs)("ul",{className:"space-y-2",children:[e," "]}),li:e=>(0,s.jsxs)("li",{className:"text-sm",children:[e," "]},Math.random()),strong:e=>(0,s.jsx)("strong",{className:"font-semibold text-text-secondary",children:e})}}),children:h?(0,s.jsx)(l.f,{}):(0,s.jsx)("div",{className:"ml-auto shadow-sm dark:shadow-none dark:bg-slate-800 w-full md:col-span-2 bg-white",children:(0,s.jsx)(i.H,{sensors:A,collisionDetection:i.P,onDragEnd:M,id:"assortment-link",children:(0,s.jsx)(F,{currentAssortmentId:e,links:g||[],onRemoveLink:b,items:y})})})})]})}],79001);var O=e.i(54529);let U=A.a`
18
+ `;var K=e.i(60195);e.s(["f",0,({assortmentId:e})=>{let{formatMessage:u}=(0,t.X)(),{setModal:f}=(0,o.f)(),{hasRole:x}=(0,j.f)(),{linkedAssortments:g,loading:h}=(0,c.f)({assortmentId:e}),{removeAssortmentLink:p}=(0,m.f)(),{reorderAssortmentLink:v}=(()=>{let[e]=(0,R.f)(q);return{reorderAssortmentLink:async({sortKeys:s})=>e({variables:{sortKeys:s},refetchQueries:["AssortmentLinks"]})}})(),y=g?.map(e=>e._id),b=async e=>{await f((0,s.jsx)(d.f,{onCancelClick:async()=>f(""),message:u({id:"delete_assortment_link",defaultMessage:"This action might cause inconsistencies with other data that relates to it. Are you sure you want to delete this language? "}),onOkClick:async()=>{f(""),await p({assortmentLinkId:e}),r.toast.success(u({id:"assortment_link",defaultMessage:"Link deleted successfully"}))},okText:u({id:"delete_link",defaultMessage:"Delete link"})}))},M=async e=>{let{active:s,over:t}=e;if(s.id!==t.id){let e=y.indexOf(s.id),a=y.indexOf(t.id),i=(0,n.e)(y,e,a).map((e,s)=>({assortmentLinkId:e,sortKey:s}));try{await v({sortKeys:i}),r.toast.success(u({id:"link_reorder",defaultMessage:"Link reorder successfully"}))}catch(e){r.toast.error(u({id:"fail_reorder",defaultMessage:"Reordering failed, Try again!"}))}}else r.toast.info(u({id:"reorder_original",defaultMessage:"Reorder to original location"}))},A=(0,i.n)((0,i.J)(i.k,{activationConstraint:{distance:5}}),(0,i.J)(i.y,{coordinateGetter:n.j}));return(0,s.jsxs)(s.Fragment,{children:[x(a.C.ManageAssortments)&&(0,s.jsx)(K.f,{documentationLabel:u({id:"assortment_link_form_header",defaultMessage:"Child assortments"}),className:"mt-2 lg:mt-5",documentation:(0,s.jsx)(t.L,{id:"assortment_link_form_description",defaultMessage:"<ul> <li>Assign assortment that are direct child of this assortment </li>\n </ul>",values:{ul:e=>(0,s.jsxs)("ul",{className:"space-y-2",children:[e," "]}),li:e=>(0,s.jsxs)("li",{className:"text-sm",children:[e," "]},Math.random()),strong:e=>(0,s.jsx)("strong",{className:"font-semibold text-text-secondary",children:e})}}),children:(0,s.jsx)(N,{assortmentId:e})}),(0,s.jsx)(K.f,{documentationLabel:u({id:"assortment_links_header",defaultMessage:"Assortment links"}),className:"sm:mt-4",documentation:(0,s.jsx)(t.L,{id:"assortment_link_list_description",defaultMessage:"<ul> <li>All assortments found on the assortment relation tree</li>\n <li> Drag and drop list items to sort assortment links </li>\n <li> Parents are assortments found in the ancestors tree on any level </li>\n <li> Descendants are assortments found in the children tree on any level </li> </ul>",values:{ul:e=>(0,s.jsxs)("ul",{className:"space-y-2",children:[e," "]}),li:e=>(0,s.jsxs)("li",{className:"text-sm",children:[e," "]},Math.random()),strong:e=>(0,s.jsx)("strong",{className:"font-semibold text-text-secondary",children:e})}}),children:h?(0,s.jsx)(l.f,{variant:"list"}):(0,s.jsx)("div",{className:"ml-auto shadow-sm dark:shadow-none dark:bg-slate-800 w-full md:col-span-2 bg-white",children:(0,s.jsx)(i.H,{sensors:A,collisionDetection:i.P,onDragEnd:M,id:"assortment-link",children:(0,s.jsx)(F,{currentAssortmentId:e,links:g||[],onRemoveLink:b,items:y})})})})]})}],79001);var O=e.i(54529);let U=A.a`
19
19
  query AssortmentProducts(
20
20
  $assortmentId: ID
21
21
  $slug: String
@@ -63,7 +63,7 @@
63
63
  sortKey
64
64
  }
65
65
  }
66
- `;e.s(["f",0,({assortmentId:e})=>{let{formatMessage:c}=(0,t.X)(),{linkedProducts:m,loading:u}=(({assortmentId:e=null,slug:s=null}={})=>{let{selectedLocale:t}=(0,w.f)(),a=(0,T.Q)(s),{data:r,loading:i,error:n}=(0,_.f)(U,{skip:!e&&!a,variables:{assortmentId:e||a,forceLocale:t},context:{headers:{forceLocale:t}}}),l=r?.assortment;return{loading:i,error:n,linkedProducts:l?.productAssignments||[]}})({assortmentId:e}),{setModal:f}=(0,o.f)(),{hasRole:x}=(0,j.f)(),{removeAssortmentProduct:g}=(()=>{let[e]=(0,R.f)(E);return{removeAssortmentProduct:async({assortmentProductId:s})=>e({variables:{assortmentProductId:s},refetchQueries:["AssortmentProducts"]})}})(),{reorderAssortmentProducts:h}=(()=>{let[e]=(0,R.f)(J);return{reorderAssortmentProducts:async({sortKeys:s})=>e({variables:{sortKeys:s},refetchQueries:["AssortmentProducts"]})}})(),p=m?.map(e=>e._id),v=async e=>{await f((0,s.jsx)(d.f,{onCancelClick:async()=>f(""),message:c({id:"delete_product_confirmation",defaultMessage:"This action might cause inconsistencies with other data that relates to it and it is nonreversible. Are you sure you want to delete this product? "}),onOkClick:async()=>{f(""),await g({assortmentProductId:e}),r.toast.success(c({id:"product_deleted",defaultMessage:"Product deleted successfully"}))},okText:c({id:"delete_product",defaultMessage:"Delete Product"})}))},y=async e=>{let{active:s,over:t}=e;if(s.id!==t.id){let e=p.indexOf(s.id),a=p.indexOf(t.id),i=(0,n.e)(p,e,a).map((e,s)=>({assortmentProductId:e,sortKey:s}));try{await h({sortKeys:i}),r.toast.success(c({id:"link_reorder",defaultMessage:"Link reorder successfully"}))}catch(e){r.toast.error(c({id:"fail_reorder",defaultMessage:"Reordering failed, Try again!"}))}}else r.toast.info(c({id:"reorder_original",defaultMessage:"Reorder to original location"}))},b=(0,i.n)((0,i.J)(i.k,{activationConstraint:{distance:5}}),(0,i.J)(i.y,{coordinateGetter:n.j}));return(0,s.jsxs)(s.Fragment,{children:[x(a.C.ManageAssortments)&&(0,s.jsx)(K.f,{documentationLabel:c({id:"assortment_product_form_header",defaultMessage:"Products"}),className:"mt-2 lg:mt-5",documentation:(0,s.jsx)(t.L,{id:"assortment_product_form_description",defaultMessage:"<ul> <li>Products that belong to this assortment </li>\n </ul>",values:{ul:e=>(0,s.jsxs)("ul",{className:"space-y-2",children:[e," "]}),li:e=>(0,s.jsxs)("li",{className:"text-sm",children:[e," "]},Math.random()),strong:e=>(0,s.jsx)("strong",{className:"font-semibold text-text-secondary",children:e})}}),children:(0,s.jsx)(X,{assortmentId:e})}),(0,s.jsx)(K.f,{documentationLabel:c({id:"assortment_products_header",defaultMessage:"Assortment product"}),className:"sm:mt-4",documentation:(0,s.jsx)(t.L,{id:"assortment_product_list_description",defaultMessage:"<ul> <li>All products that belong to this assortment</li>\n <li> Drag and drop list items to sort products order </li>\n </ul>",values:{ul:e=>(0,s.jsxs)("ul",{className:"space-y-2",children:[e," "]}),li:e=>(0,s.jsxs)("li",{className:"text-sm",children:[e," "]},Math.random()),strong:e=>(0,s.jsx)("strong",{className:"font-semibold text-text-secondary",children:e})}}),children:u?(0,s.jsx)("div",{className:"ml-auto w-full md:col-span-2 my-auto",children:(0,s.jsx)(l.f,{})}):(0,s.jsx)("div",{className:"ml-auto my-auto w-full rounded-sm shadow-sm dark:shadow-none md:col-span-2",children:(0,s.jsx)(i.H,{sensors:b,collisionDetection:i.P,onDragEnd:y,id:"assortment-product",children:(0,s.jsx)(B,{products:m,onRemoveProduct:v,items:p})})})})]})}],34981);var H=e.i(80294);let z=A.a`
66
+ `;e.s(["f",0,({assortmentId:e})=>{let{formatMessage:c}=(0,t.X)(),{linkedProducts:m,loading:u}=(({assortmentId:e=null,slug:s=null}={})=>{let{selectedLocale:t}=(0,w.f)(),a=(0,T.Q)(s),{data:r,loading:i,error:n}=(0,_.f)(U,{skip:!e&&!a,variables:{assortmentId:e||a,forceLocale:t},context:{headers:{forceLocale:t}}}),l=r?.assortment;return{loading:i,error:n,linkedProducts:l?.productAssignments||[]}})({assortmentId:e}),{setModal:f}=(0,o.f)(),{hasRole:x}=(0,j.f)(),{removeAssortmentProduct:g}=(()=>{let[e]=(0,R.f)(E);return{removeAssortmentProduct:async({assortmentProductId:s})=>e({variables:{assortmentProductId:s},refetchQueries:["AssortmentProducts"]})}})(),{reorderAssortmentProducts:h}=(()=>{let[e]=(0,R.f)(J);return{reorderAssortmentProducts:async({sortKeys:s})=>e({variables:{sortKeys:s},refetchQueries:["AssortmentProducts"]})}})(),p=m?.map(e=>e._id),v=async e=>{await f((0,s.jsx)(d.f,{onCancelClick:async()=>f(""),message:c({id:"delete_product_confirmation",defaultMessage:"This action might cause inconsistencies with other data that relates to it and it is nonreversible. Are you sure you want to delete this product? "}),onOkClick:async()=>{f(""),await g({assortmentProductId:e}),r.toast.success(c({id:"product_deleted",defaultMessage:"Product deleted successfully"}))},okText:c({id:"delete_product",defaultMessage:"Delete Product"})}))},y=async e=>{let{active:s,over:t}=e;if(s.id!==t.id){let e=p.indexOf(s.id),a=p.indexOf(t.id),i=(0,n.e)(p,e,a).map((e,s)=>({assortmentProductId:e,sortKey:s}));try{await h({sortKeys:i}),r.toast.success(c({id:"link_reorder",defaultMessage:"Link reorder successfully"}))}catch(e){r.toast.error(c({id:"fail_reorder",defaultMessage:"Reordering failed, Try again!"}))}}else r.toast.info(c({id:"reorder_original",defaultMessage:"Reorder to original location"}))},b=(0,i.n)((0,i.J)(i.k,{activationConstraint:{distance:5}}),(0,i.J)(i.y,{coordinateGetter:n.j}));return(0,s.jsxs)(s.Fragment,{children:[x(a.C.ManageAssortments)&&(0,s.jsx)(K.f,{documentationLabel:c({id:"assortment_product_form_header",defaultMessage:"Products"}),className:"mt-2 lg:mt-5",documentation:(0,s.jsx)(t.L,{id:"assortment_product_form_description",defaultMessage:"<ul> <li>Products that belong to this assortment </li>\n </ul>",values:{ul:e=>(0,s.jsxs)("ul",{className:"space-y-2",children:[e," "]}),li:e=>(0,s.jsxs)("li",{className:"text-sm",children:[e," "]},Math.random()),strong:e=>(0,s.jsx)("strong",{className:"font-semibold text-text-secondary",children:e})}}),children:(0,s.jsx)(X,{assortmentId:e})}),(0,s.jsx)(K.f,{documentationLabel:c({id:"assortment_products_header",defaultMessage:"Assortment product"}),className:"sm:mt-4",documentation:(0,s.jsx)(t.L,{id:"assortment_product_list_description",defaultMessage:"<ul> <li>All products that belong to this assortment</li>\n <li> Drag and drop list items to sort products order </li>\n </ul>",values:{ul:e=>(0,s.jsxs)("ul",{className:"space-y-2",children:[e," "]}),li:e=>(0,s.jsxs)("li",{className:"text-sm",children:[e," "]},Math.random()),strong:e=>(0,s.jsx)("strong",{className:"font-semibold text-text-secondary",children:e})}}),children:u&&!m.length?(0,s.jsx)("div",{className:"ml-auto w-full md:col-span-2 my-auto",children:(0,s.jsx)(l.f,{variant:"list"})}):(0,s.jsx)("div",{className:"ml-auto my-auto w-full rounded-sm shadow-sm dark:shadow-none md:col-span-2",children:(0,s.jsx)(i.H,{sensors:b,collisionDetection:i.P,onDragEnd:y,id:"assortment-product",children:(0,s.jsx)(B,{products:m,onRemoveProduct:v,items:p})})})})]})}],34981);var H=e.i(80294);let z=A.a`
67
67
  query AssortmentFilters($assortmentId: ID, $slug: String) {
68
68
  assortment(assortmentId: $assortmentId, slug: $slug) {
69
69
  _id
@@ -107,7 +107,7 @@
107
107
  sortKey
108
108
  }
109
109
  }
110
- `;e.s(["f",0,({assortmentId:e})=>{let{formatMessage:c}=(0,t.X)(),{assortmentFilters:m,loading:u}=(({assortmentId:e=null,slug:s=null}={})=>{let t=(0,T.Q)(s),{data:a,loading:r,error:i}=(0,_.f)(z,{skip:!e&&!t,variables:{assortmentId:e||t}}),n=a?.assortment;return{loading:r,error:i,assortmentFilters:n?.filterAssignments||[]}})({assortmentId:e}),{setModal:f}=(0,o.f)(),{hasRole:x}=(0,j.f)(),{removeAssortmentFilter:g}=(()=>{let[e]=(0,R.f)(G);return{removeAssortmentFilter:async({assortmentFilterId:s})=>e({variables:{assortmentFilterId:s},refetchQueries:["AssortmentFilters"]})}})(),{reorderAssortmentFilters:h}=(()=>{let[e]=(0,R.f)(ea);return{reorderAssortmentFilters:async({sortKeys:s})=>e({variables:{sortKeys:s},refetchQueries:["AssortmentFilters"]})}})(),p=m?.map(e=>e._id),v=async e=>{await f((0,s.jsx)(d.f,{onCancelClick:async()=>f(""),message:c({id:"delete_assortment_filter_confirmation",defaultMessage:"This action might cause inconsistencies with other data that relates to it. Are you sure you want to delete this language? "}),onOkClick:async()=>{f(""),await g({assortmentFilterId:e}),r.toast.success(c({id:"assortment_filter_deleted",defaultMessage:"Assortment filter deleted successfully"}))},okText:c({id:"delete_filter",defaultMessage:"Delete filter"})}))},y=async e=>{let{active:s,over:t}=e;if(s.id!==t.id){let e=p.indexOf(s.id),a=p.indexOf(t.id),i=(0,n.e)(p,e,a).map((e,s)=>({assortmentFilterId:e,sortKey:s}));try{await h({sortKeys:i}),r.toast.success(c({id:"link_reorder",defaultMessage:"Link reorder successfully"}))}catch(e){r.toast.error(c({id:"fail_reorder",defaultMessage:"Reordering failed, Try again!"}))}}else r.toast.info(c({id:"reorder_original",defaultMessage:"Reorder to original location"}))},b=(0,i.n)((0,i.J)(i.k,{activationConstraint:{distance:5}}),(0,i.J)(i.y,{coordinateGetter:n.j}));return(0,s.jsxs)(s.Fragment,{children:[x(a.C.ManageAssortments)&&(0,s.jsx)(K.f,{documentationLabel:c({id:"assortment_filters_form_header",defaultMessage:"Filters"}),className:"mt-2 lg:mt-5",documentation:(0,s.jsx)(t.L,{id:"assortment_filter_form_description",defaultMessage:"<ul> <li>Assign filters that will be applied for the assortment </li>\n </ul>",values:{ul:e=>(0,s.jsxs)("ul",{className:"space-y-2",children:[e," "]}),li:e=>(0,s.jsxs)("li",{className:"text-sm",children:[e," "]},Math.random()),strong:e=>(0,s.jsx)("strong",{className:"font-semibold text-text-secondary",children:e})}}),children:(0,s.jsx)(et,{assortmentId:e})}),(0,s.jsx)(K.f,{documentationLabel:c({id:"assortment_filters_header",defaultMessage:"Assortment filters"}),className:"sm:mt-4",documentation:(0,s.jsx)(t.L,{id:"assortment_filter_list_description",defaultMessage:"<ul> <li>All filters that are applied when searching for this assortment </li>\n <li> Drag and drop list items to sort filters order </li>\n </ul>",values:{ul:e=>(0,s.jsxs)("ul",{className:"space-y-2",children:[e," "]}),li:e=>(0,s.jsxs)("li",{className:"text-sm",children:[e," "]},Math.random()),strong:e=>(0,s.jsx)("strong",{className:"font-semibold text-text-secondary",children:e})}}),children:u?(0,s.jsx)("div",{className:"ml-auto shadow-sm dark:shadow-none w-full md:col-span-2",children:(0,s.jsx)(l.f,{})}):(0,s.jsx)("div",{className:"ml-auto shadow-sm dark:shadow-none w-full md:col-span-2 bg-surface",children:(0,s.jsx)(i.H,{sensors:b,collisionDetection:i.P,onDragEnd:y,id:"assortment-filter",children:(0,s.jsx)(Y,{filters:m,onRemoveFilter:v,items:p})})})})]})}],58101)},45856,24941,e=>{var s=e.i(91398),t=e.i(91788);e.i(51523);var a=e.i(19518),r=e.i(69322),i=e.i(69211),n=e.i(21128),l=e.i(16984),d=e.i(98949),o=e.i(59080),c=e.i(32171);let m=o.a`
110
+ `;e.s(["f",0,({assortmentId:e})=>{let{formatMessage:c}=(0,t.X)(),{assortmentFilters:m,loading:u}=(({assortmentId:e=null,slug:s=null}={})=>{let t=(0,T.Q)(s),{data:a,loading:r,error:i}=(0,_.f)(z,{skip:!e&&!t,variables:{assortmentId:e||t}}),n=a?.assortment;return{loading:r,error:i,assortmentFilters:n?.filterAssignments||[]}})({assortmentId:e}),{setModal:f}=(0,o.f)(),{hasRole:x}=(0,j.f)(),{removeAssortmentFilter:g}=(()=>{let[e]=(0,R.f)(G);return{removeAssortmentFilter:async({assortmentFilterId:s})=>e({variables:{assortmentFilterId:s},refetchQueries:["AssortmentFilters"]})}})(),{reorderAssortmentFilters:h}=(()=>{let[e]=(0,R.f)(ea);return{reorderAssortmentFilters:async({sortKeys:s})=>e({variables:{sortKeys:s},refetchQueries:["AssortmentFilters"]})}})(),p=m?.map(e=>e._id),v=async e=>{await f((0,s.jsx)(d.f,{onCancelClick:async()=>f(""),message:c({id:"delete_assortment_filter_confirmation",defaultMessage:"This action might cause inconsistencies with other data that relates to it. Are you sure you want to delete this language? "}),onOkClick:async()=>{f(""),await g({assortmentFilterId:e}),r.toast.success(c({id:"assortment_filter_deleted",defaultMessage:"Assortment filter deleted successfully"}))},okText:c({id:"delete_filter",defaultMessage:"Delete filter"})}))},y=async e=>{let{active:s,over:t}=e;if(s.id!==t.id){let e=p.indexOf(s.id),a=p.indexOf(t.id),i=(0,n.e)(p,e,a).map((e,s)=>({assortmentFilterId:e,sortKey:s}));try{await h({sortKeys:i}),r.toast.success(c({id:"link_reorder",defaultMessage:"Link reorder successfully"}))}catch(e){r.toast.error(c({id:"fail_reorder",defaultMessage:"Reordering failed, Try again!"}))}}else r.toast.info(c({id:"reorder_original",defaultMessage:"Reorder to original location"}))},b=(0,i.n)((0,i.J)(i.k,{activationConstraint:{distance:5}}),(0,i.J)(i.y,{coordinateGetter:n.j}));return(0,s.jsxs)(s.Fragment,{children:[x(a.C.ManageAssortments)&&(0,s.jsx)(K.f,{documentationLabel:c({id:"assortment_filters_form_header",defaultMessage:"Filters"}),className:"mt-2 lg:mt-5",documentation:(0,s.jsx)(t.L,{id:"assortment_filter_form_description",defaultMessage:"<ul> <li>Assign filters that will be applied for the assortment </li>\n </ul>",values:{ul:e=>(0,s.jsxs)("ul",{className:"space-y-2",children:[e," "]}),li:e=>(0,s.jsxs)("li",{className:"text-sm",children:[e," "]},Math.random()),strong:e=>(0,s.jsx)("strong",{className:"font-semibold text-text-secondary",children:e})}}),children:(0,s.jsx)(et,{assortmentId:e})}),(0,s.jsx)(K.f,{documentationLabel:c({id:"assortment_filters_header",defaultMessage:"Assortment filters"}),className:"sm:mt-4",documentation:(0,s.jsx)(t.L,{id:"assortment_filter_list_description",defaultMessage:"<ul> <li>All filters that are applied when searching for this assortment </li>\n <li> Drag and drop list items to sort filters order </li>\n </ul>",values:{ul:e=>(0,s.jsxs)("ul",{className:"space-y-2",children:[e," "]}),li:e=>(0,s.jsxs)("li",{className:"text-sm",children:[e," "]},Math.random()),strong:e=>(0,s.jsx)("strong",{className:"font-semibold text-text-secondary",children:e})}}),children:u?(0,s.jsx)("div",{className:"ml-auto shadow-sm dark:shadow-none w-full md:col-span-2",children:(0,s.jsx)(l.f,{variant:"list"})}):(0,s.jsx)("div",{className:"ml-auto shadow-sm dark:shadow-none w-full md:col-span-2 bg-surface",children:(0,s.jsx)(i.H,{sensors:b,collisionDetection:i.P,onDragEnd:y,id:"assortment-filter",children:(0,s.jsx)(Y,{filters:m,onRemoveFilter:v,items:p})})})})]})}],58101)},45856,24941,e=>{"use strict";var s=e.i(91398),t=e.i(91788);e.i(51523);var a=e.i(19518),r=e.i(3326),i=e.i(69211),n=e.i(21128),l=e.i(16984),d=e.i(98949),o=e.i(59080),c=e.i(32171);let m=o.a`
111
111
  fragment AssortmentTextsFragment on AssortmentTexts {
112
112
  _id
113
113
  locale
@@ -211,7 +211,7 @@
211
211
  }
212
212
  }
213
213
  ${O}
214
- `,Q=({media:e,onDelete:a,locale:r,id:i})=>{let[n,l]=(0,t.useState)(!1),{updateAssortmentMediaTexts:d}=(()=>{let[e]=(0,f.f)(E);return{updateAssortmentMediaTexts:async({assortmentMediaId:s,texts:t})=>e({variables:{assortmentMediaId:s,texts:t},refetchQueries:["TranslatedAssortmentMediaTexts"]})}})(),{translatedAssortmentMediaTexts:o}=(({assortmentMediaId:e=null})=>{let{data:s,loading:t,error:a}=(0,c.f)(U,{skip:!e,variables:{assortmentMediaId:e}});return{loading:t,error:a,translatedAssortmentMediaTexts:s?.translatedAssortmentMediaTexts||[]}})({assortmentMediaId:e._id}),m=o?.find(e=>e.locale===r)||{},u=async({title:s,subtitle:t})=>(await d({assortmentMediaId:e._id,texts:[{title:s,locale:r,subtitle:t}]}),l(!1),!0);return(0,s.jsx)(K.f,{media:e,mediaText:m,isEdit:n,onDelete:a,onEdit:l,onUpdate:u,id:i})},V=({medias:e=[],onDeleteMedia:t,items:a=[]})=>{let{formatMessage:i}=(0,r.X)(),{selectedLocale:n}=(0,j.f)();return A.V&&Q&&q.f?(0,s.jsx)("div",{className:"rounded-md lg:col-span-6",children:(0,s.jsxs)("div",{className:"mx-auto max-w-7xl overflow-hidden",children:[(0,s.jsx)("h2",{className:"sr-only",children:i({id:"assortment_media",defaultMessage:"Assortment Media"})}),(0,s.jsx)(A.V,{items:a,strategy:A.W,children:(0,s.jsx)("ul",{className:"space-y-4 transition-[background-color] ease-in-out delay-200",children:e.length?a.map(a=>{let r=Object.values(e).find(e=>e._id===a);return r?(0,s.jsx)(Q,{id:a,media:r,locale:n,onDelete:t},r._id):(console.warn(`Media with ID ${a} not found in medias array`),null)}).filter(Boolean):(0,s.jsx)(q.f,{message:i({id:"media",defaultMessage:"Media"})})})})]})}):(console.error("Required components not loaded in AssortmentMediaList:",{SortableContext:!!A.V,AssortmentMediaListItem:!!Q,NoData:!!q.f}),(0,s.jsx)("div",{className:"rounded-md lg:col-span-6",children:(0,s.jsx)("div",{className:"mx-auto max-w-7xl overflow-hidden",children:(0,s.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,s.jsx)("div",{className:"text-rose-500",children:"Media list component loading error. Please refresh the page."})})})}))},X=({assortmentId:e})=>{let{assortmentMedia:t,loading:i,error:n}=T({assortmentId:e}),{formatMessage:l}=(0,r.X)(),{setModal:d}=(0,w.f)(),{hasRole:o}=(0,h.f)(),{removeAssortmentMedia:c}=P(),{reorderAssortmentMedia:m}=R(),{addAssortmentMedia:u}=C(),f=(0,M.n)((0,M.J)(M.k,{activationConstraint:{distance:5}}),(0,M.J)(M.y,{coordinateGetter:A.j})),x=(t||[]).map(e=>e._id);if(!_.f||!M.H||!V)return console.error("Required components not loaded:",{MediaUploader:!!_.f,DndContext:!!M.H,AssortmentMediaList:!!V}),(0,s.jsx)("div",{className:"mx-auto mt-5 max-w-full bg-surface py-6 shadow-sm dark:shadow-none lg:rounded-sm",children:(0,s.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,s.jsx)("div",{className:"text-rose-500",children:l({id:"component_loading_error",defaultMessage:"Component loading error. Please refresh the page."})})})});if(i)return(0,s.jsx)("div",{className:"mx-auto mt-5 max-w-full bg-surface py-6 shadow-sm dark:shadow-none lg:rounded-sm",children:(0,s.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,s.jsx)("div",{className:"text-text-muted",children:l({id:"loading_media",defaultMessage:"Loading media..."})})})});if(n)return(0,s.jsx)("div",{className:"mx-auto mt-5 max-w-full bg-surface py-6 shadow-sm dark:shadow-none lg:rounded-sm",children:(0,s.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,s.jsxs)("div",{className:"text-rose-500",children:[l({id:"error_loading_media",defaultMessage:"Error loading media: "})," ",n.message]})})});let g=async s=>{try{await u({assortmentId:e,media:s}),b.toast.success(l({id:"assortment_media_upload",defaultMessage:"Media uploaded successfully"}))}catch(e){b.toast.error(l({id:"fail_upload",defaultMessage:"Media upload failed"}))}},p=async e=>{await d((0,s.jsx)(I.f,{onCancelClick:async()=>d(""),message:l({id:"delete_assortment_media_confirmation",defaultMessage:"This action might cause inconsistencies with other data that relates to it. Are you sure you want to delete this currency? "}),onOkClick:async()=>{d(""),await c({assortmentMediaId:e}),b.toast.success(l({id:"assortment_media_deleted",defaultMessage:"Media deleted successfully"}))},okText:l({id:"delete_assortment_media",defaultMessage:"Delete media"})}))},v=async e=>{let{active:s,over:t}=e;if(s.id!==t.id){let e=x.indexOf(s.id),a=x.indexOf(t.id),r=(0,A.e)(x,e,a).map((e,s)=>({assortmentMediaId:e,sortKey:s}));try{await m({sortKeys:r}),b.toast.success(l({id:"link_reorder",defaultMessage:"Link reorder successfully"}))}catch(e){b.toast.error(l({id:"fail_reorder",defaultMessage:"Reordering failed, Try again!"}))}}else b.toast.info(l({id:"reorder_original",defaultMessage:"Reorder to original location"}))};return(0,s.jsxs)("div",{className:"mx-auto mt-5 max-w-fullpy-6 grid lg:grid-cols-12 gap-5",children:[o(a.C.ManageAssortments)&&(0,s.jsx)("div",{className:"lg:col-span-6",children:(0,s.jsx)(_.f,{onlyDragAndDrop:!0,addMedia:g})}),(0,s.jsx)("div",{className:"lg:col-span-6",children:(0,s.jsx)(M.H,{sensors:f,collisionDetection:M.P,onDragEnd:v,id:"assortment-media",children:(0,s.jsx)(V,{medias:t,onDeleteMedia:p,items:x})})})]})};e.s(["f",0,e=>{let t=Object.entries({MediaUploader:_.f,DangerMessage:I.f,useModal:w.f,useAddAssortmentMedia:C,useAssortmentMedia:T,useRemoveAssortmentMedia:P,useReorderAssortmentMedia:R,AssortmentMediaList:V,DndContext:M.H,closestCenter:M.P,KeyboardSensor:M.y,PointerSensor:M.k,useSensor:M.J,useSensors:M.n,arrayMove:A.e,sortableKeyboardCoordinates:A.j}).filter(([e,s])=>!s).map(([e])=>e);if(t.length>0)return console.error("Missing dependencies in AssortmentMediaForm:",t),(0,s.jsx)("div",{className:"mx-auto mt-5 max-w-full bg-surface py-6 shadow-sm dark:shadow-none lg:rounded-sm",children:(0,s.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("div",{className:"text-rose-500 mb-2",children:"Missing Dependencies"}),(0,s.jsxs)("div",{className:"text-sm text-text-secondary",children:["The following dependencies are missing:"," ",t.join(", ")]})]})})});try{return(0,s.jsx)(X,{...e})}catch(e){return console.error("Error rendering AssortmentMediaForm:",e),(0,s.jsx)("div",{className:"mx-auto mt-5 max-w-full bg-surface py-6 shadow-sm dark:shadow-none lg:rounded-sm",children:(0,s.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("div",{className:"text-rose-500 mb-2",children:"Component Error"}),(0,s.jsx)("div",{className:"text-sm text-text-secondary",children:e instanceof Error?e.message:"Unknown error occurred"})]})})})}}],24941)},50931,e=>{var s=e.i(59080);let t=s.a`
214
+ `,Q=({media:e,onDelete:a,locale:r,id:i})=>{let[n,l]=(0,t.useState)(!1),{updateAssortmentMediaTexts:d}=(()=>{let[e]=(0,f.f)(E);return{updateAssortmentMediaTexts:async({assortmentMediaId:s,texts:t})=>e({variables:{assortmentMediaId:s,texts:t},refetchQueries:["TranslatedAssortmentMediaTexts"]})}})(),{translatedAssortmentMediaTexts:o}=(({assortmentMediaId:e=null})=>{let{data:s,loading:t,error:a}=(0,c.f)(U,{skip:!e,variables:{assortmentMediaId:e}});return{loading:t,error:a,translatedAssortmentMediaTexts:s?.translatedAssortmentMediaTexts||[]}})({assortmentMediaId:e._id}),m=o?.find(e=>e.locale===r)||{},u=async({title:s,subtitle:t})=>(await d({assortmentMediaId:e._id,texts:[{title:s,locale:r,subtitle:t}]}),l(!1),!0);return(0,s.jsx)(K.f,{media:e,mediaText:m,isEdit:n,onDelete:a,onEdit:l,onUpdate:u,id:i})},V=({medias:e=[],onDeleteMedia:t,items:a=[]})=>{let{formatMessage:i}=(0,r.X)(),{selectedLocale:n}=(0,j.f)();return A.V&&Q&&q.f?(0,s.jsx)("div",{className:"rounded-md lg:col-span-6",children:(0,s.jsxs)("div",{className:"mx-auto max-w-7xl overflow-hidden",children:[(0,s.jsx)("h2",{className:"sr-only",children:i({id:"assortment_media",defaultMessage:"Assortment Media"})}),(0,s.jsx)(A.V,{items:a,strategy:A.W,children:(0,s.jsx)("ul",{className:"space-y-4 transition-[background-color] ease-in-out delay-200",children:e.length?a.map(a=>{let r=Object.values(e).find(e=>e._id===a);return r?(0,s.jsx)(Q,{id:a,media:r,locale:n,onDelete:t},r._id):(console.warn(`Media with ID ${a} not found in medias array`),null)}).filter(Boolean):(0,s.jsx)(q.f,{message:i({id:"media",defaultMessage:"Media"})})})})]})}):(console.error("Required components not loaded in AssortmentMediaList:",{SortableContext:!!A.V,AssortmentMediaListItem:!!Q,NoData:!!q.f}),(0,s.jsx)("div",{className:"rounded-md lg:col-span-6",children:(0,s.jsx)("div",{className:"mx-auto max-w-7xl overflow-hidden",children:(0,s.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,s.jsx)("div",{className:"text-rose-500",children:"Media list component loading error. Please refresh the page."})})})}))},X=({assortmentId:e})=>{let{assortmentMedia:t,loading:i,error:n}=T({assortmentId:e}),{formatMessage:l}=(0,r.X)(),{setModal:d}=(0,w.f)(),{hasRole:o}=(0,h.f)(),{removeAssortmentMedia:c}=P(),{reorderAssortmentMedia:m}=R(),{addAssortmentMedia:u}=C(),f=(0,M.n)((0,M.J)(M.k,{activationConstraint:{distance:5}}),(0,M.J)(M.y,{coordinateGetter:A.j})),x=(t||[]).map(e=>e._id);if(!_.f||!M.H||!V)return console.error("Required components not loaded:",{MediaUploader:!!_.f,DndContext:!!M.H,AssortmentMediaList:!!V}),(0,s.jsx)("div",{className:"mx-auto mt-5 max-w-full bg-surface py-6 shadow-sm dark:shadow-none lg:rounded-sm",children:(0,s.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,s.jsx)("div",{className:"text-rose-500",children:l({id:"component_loading_error",defaultMessage:"Component loading error. Please refresh the page."})})})});if(i)return(0,s.jsx)("div",{className:"mx-auto mt-5 max-w-full bg-surface py-6 shadow-sm dark:shadow-none lg:rounded-sm",children:(0,s.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,s.jsx)("div",{className:"text-text-muted",children:l({id:"loading_media",defaultMessage:"Loading media..."})})})});if(n)return(0,s.jsx)("div",{className:"mx-auto mt-5 max-w-full bg-surface py-6 shadow-sm dark:shadow-none lg:rounded-sm",children:(0,s.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,s.jsxs)("div",{className:"text-rose-500",children:[l({id:"error_loading_media",defaultMessage:"Error loading media: "})," ",n.message]})})});let g=async s=>{try{await u({assortmentId:e,media:s}),b.toast.success(l({id:"assortment_media_upload",defaultMessage:"Media uploaded successfully"}))}catch(e){b.toast.error(l({id:"fail_upload",defaultMessage:"Media upload failed"}))}},p=async e=>{await d((0,s.jsx)(I.f,{onCancelClick:async()=>d(""),message:l({id:"delete_assortment_media_confirmation",defaultMessage:"This action might cause inconsistencies with other data that relates to it. Are you sure you want to delete this currency? "}),onOkClick:async()=>{d(""),await c({assortmentMediaId:e}),b.toast.success(l({id:"assortment_media_deleted",defaultMessage:"Media deleted successfully"}))},okText:l({id:"delete_assortment_media",defaultMessage:"Delete media"})}))},v=async e=>{let{active:s,over:t}=e;if(s.id!==t.id){let e=x.indexOf(s.id),a=x.indexOf(t.id),r=(0,A.e)(x,e,a).map((e,s)=>({assortmentMediaId:e,sortKey:s}));try{await m({sortKeys:r}),b.toast.success(l({id:"link_reorder",defaultMessage:"Link reorder successfully"}))}catch(e){b.toast.error(l({id:"fail_reorder",defaultMessage:"Reordering failed, Try again!"}))}}else b.toast.info(l({id:"reorder_original",defaultMessage:"Reorder to original location"}))};return(0,s.jsxs)("div",{className:"mx-auto mt-5 max-w-fullpy-6 grid lg:grid-cols-12 gap-5",children:[o(a.C.ManageAssortments)&&(0,s.jsx)("div",{className:"lg:col-span-6",children:(0,s.jsx)(_.f,{onlyDragAndDrop:!0,addMedia:g})}),(0,s.jsx)("div",{className:"lg:col-span-6",children:(0,s.jsx)(M.H,{sensors:f,collisionDetection:M.P,onDragEnd:v,id:"assortment-media",children:(0,s.jsx)(V,{medias:t,onDeleteMedia:p,items:x})})})]})};e.s(["f",0,e=>{let t=Object.entries({MediaUploader:_.f,DangerMessage:I.f,useModal:w.f,useAddAssortmentMedia:C,useAssortmentMedia:T,useRemoveAssortmentMedia:P,useReorderAssortmentMedia:R,AssortmentMediaList:V,DndContext:M.H,closestCenter:M.P,KeyboardSensor:M.y,PointerSensor:M.k,useSensor:M.J,useSensors:M.n,arrayMove:A.e,sortableKeyboardCoordinates:A.j}).filter(([e,s])=>!s).map(([e])=>e);if(t.length>0)return console.error("Missing dependencies in AssortmentMediaForm:",t),(0,s.jsx)("div",{className:"mx-auto mt-5 max-w-full bg-surface py-6 shadow-sm dark:shadow-none lg:rounded-sm",children:(0,s.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("div",{className:"text-rose-500 mb-2",children:"Missing Dependencies"}),(0,s.jsxs)("div",{className:"text-sm text-text-secondary",children:["The following dependencies are missing:"," ",t.join(", ")]})]})})});try{return(0,s.jsx)(X,{...e})}catch(e){return console.error("Error rendering AssortmentMediaForm:",e),(0,s.jsx)("div",{className:"mx-auto mt-5 max-w-full bg-surface py-6 shadow-sm dark:shadow-none lg:rounded-sm",children:(0,s.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("div",{className:"text-rose-500 mb-2",children:"Component Error"}),(0,s.jsx)("div",{className:"text-sm text-text-secondary",children:e instanceof Error?e.message:"Unknown error occurred"})]})})})}}],24941)},50931,e=>{"use strict";var s=e.i(59080);let t=s.a`
215
215
  fragment AssortmentFragment on Assortment {
216
216
  _id
217
217
  isActive
@@ -237,7 +237,7 @@
237
237
  }
238
238
  }
239
239
  }
240
- `;e.s(["f",0,t])},65530,57569,35339,e=>{var s=e.i(59080),t=e.i(32171),a=e.i(1880),r=e.i(50931),i=e.i(57561);let n=s.a`
240
+ `;e.s(["f",0,t])},65530,57569,35339,e=>{"use strict";var s=e.i(59080),t=e.i(32171),a=e.i(1880),r=e.i(50931),i=e.i(57561);let n=s.a`
241
241
  query AssortmentLinks(
242
242
  $assortmentId: ID
243
243
  $slug: String
@@ -278,7 +278,7 @@
278
278
  _id
279
279
  }
280
280
  }
281
- `;e.s(["f",0,()=>{let[e]=(0,l.f)(o);return{addAssortmentLink:async({parentAssortmentId:s,childAssortmentId:t,tags:a})=>e({variables:{parentAssortmentId:s,childAssortmentId:t,tags:a},refetchQueries:["AssortmentLinks"]})}}],35339)},37547,e=>{var s=e.i(59080),t=e.i(32171),a=e.i(50931);let r=s.a`
281
+ `;e.s(["f",0,()=>{let[e]=(0,l.f)(o);return{addAssortmentLink:async({parentAssortmentId:s,childAssortmentId:t,tags:a})=>e({variables:{parentAssortmentId:s,childAssortmentId:t,tags:a},refetchQueries:["AssortmentLinks"]})}}],35339)},37547,e=>{"use strict";var s=e.i(59080),t=e.i(32171),a=e.i(50931);let r=s.a`
282
282
  query Assortments(
283
283
  $queryString: String
284
284
  $tags: [LowerCaseString!]
@@ -316,13 +316,13 @@
316
316
  )
317
317
  }
318
318
  ${a.f}
319
- `;e.s(["f",0,({queryString:e="",tags:s=null,slugs:a=null,limit:i=20,offset:n=0,includeInactive:l=!0,includeLeaves:d=!1,sort:o=[],forceLocale:c=""}={})=>{let{data:m,loading:u,error:f,fetchMore:x,client:g}=(0,t.f)(r,{variables:{queryString:e,tags:s,slugs:a||null,limit:i,offset:n,includeInactive:l,includeLeaves:d,sort:o.length?o:[{key:"sequence",value:"ASC"}],forceLocale:c},context:{headers:{forceLocale:c}}}),h=m?.assortments||[],p=m?.assortmentsCount,v=h?.length<p;return{loading:u,error:f,assortmentsCount:p,hasMore:v,assortments:m?.assortments||[],loadMore:()=>{x({variables:{offset:h?.length}})},client:g}}])},75818,e=>{var s=e.i(59080),t=e.i(76204);let a=s.a`
319
+ `;e.s(["f",0,({queryString:e="",tags:s=null,slugs:a=null,limit:i=20,offset:n=0,includeInactive:l=!0,includeLeaves:d=!1,sort:o=[],forceLocale:c=""}={})=>{let{data:m,loading:u,error:f,fetchMore:x,client:g}=(0,t.f)(r,{variables:{queryString:e,tags:s,slugs:a||null,limit:i,offset:n,includeInactive:l,includeLeaves:d,sort:o.length?o:[{key:"sequence",value:"ASC"}],forceLocale:c},context:{headers:{forceLocale:c}}}),h=m?.assortments||[],p=m?.assortmentsCount,v=h?.length<p;return{loading:u,error:f,assortmentsCount:p,hasMore:v,assortments:m?.assortments||[],loadMore:()=>{x({variables:{offset:h?.length}})},client:g}}])},75818,e=>{"use strict";var s=e.i(59080),t=e.i(76204);let a=s.a`
320
320
  mutation RemoveAssortment($assortmentId: ID!) {
321
321
  removeAssortment(assortmentId: $assortmentId) {
322
322
  _id
323
323
  }
324
324
  }
325
- `;e.s(["f",0,()=>{let[e]=(0,t.f)(a);return{removeAssortment:async({assortmentId:s})=>e({variables:{assortmentId:s},refetchQueries:["Assortments","Assortment","ShopStatus","ShopInfo"]})}}])},921,e=>{var s=e.i(59080),t=e.i(76204);let a=s.a`
325
+ `;e.s(["f",0,()=>{let[e]=(0,t.f)(a);return{removeAssortment:async({assortmentId:s})=>e({variables:{assortmentId:s},refetchQueries:["Assortments","Assortment","ShopStatus","ShopInfo"]})}}])},921,e=>{"use strict";var s=e.i(59080),t=e.i(76204);let a=s.a`
326
326
  mutation UpdateAssortment(
327
327
  $assortment: UpdateAssortmentInput!
328
328
  $assortmentId: ID!
@@ -331,7 +331,7 @@
331
331
  _id
332
332
  }
333
333
  }
334
- `;e.s(["f",0,()=>{let[e]=(0,t.f)(a);return{updateAssortment:async({assortmentId:s,assortment:{isRoot:t,tags:a,sequence:r,isActive:i}})=>e({variables:{assortment:{isRoot:t,tags:a,sequence:r,isActive:i},assortmentId:s},refetchQueries:["Assortments","Assortment"]})}}])},98568,e=>{var s=e.i(91398),t=e.i(69322);e.i(51523);var a=e.i(19518),r=e.i(28401),i=e.i(3828),n=e.i(50595),l=e.i(53576),d=e.i(25327),o=e.i(13534),c=e.i(70475),m=e.i(25705),u=e.i(27927),f=e.i(50243),x=e.i(52745),g=e.i(93259),h=e.i(76929),p=e.i(11056),v=e.i(92276),j=e.i(21623),y=e.i(24608),b=e.i(83788),M=e.i(15971),A=e.i(75818),_=e.i(45856),I=e.i(24941),w=e.i(79001),N=e.i(34981),k=e.i(58101),$=e.i(921),C=e.i(56779),L=e.i(34948),D=e.i(58971),T=e.i(6607),S=e.i(31494),P=e.i(57561);let F=({id:e,selectedView:t,...a})=>{if("texts"===t)return(0,s.jsx)(p.f,{children:(0,s.jsx)(_.f,{assortmentId:e})});if("links"===t)return(0,s.jsx)(p.f,{children:(0,s.jsx)(w.f,{assortmentId:e})});if("media"===t)return(0,s.jsx)(b.f,{children:(0,s.jsx)(p.f,{children:(0,s.jsx)(I.f,{assortmentId:e})})});if("products"===t)return(0,s.jsx)(p.f,{children:(0,s.jsx)(N.f,{assortmentId:e})});if("filters"===t)return(0,s.jsx)(p.f,{children:(0,s.jsx)(k.f,{assortmentId:e})});if("extended"===t)return(0,s.jsx)(p.f,{children:(0,s.jsx)(S.f,{data:a})});if(t?.startsWith("plugin:")){let a=t.replace("plugin:","");return(0,s.jsx)(c.f,{slot:"assortment:tabs",entityId:e,children:(t,r)=>r.component===a?(0,s.jsx)(t,{entityId:e}):null})}return(0,s.jsx)(p.f,{children:(0,s.jsx)(_.f,{assortmentId:e})})},R=({assortment:e,extendedData:n,hideControls:l=!1})=>{let{isActive:d,isRoot:c}=e||{},{hasRole:p}=(0,D.f)(),{shopInfo:b}=(0,P.f)(),{getSlotPlugins:_}=(0,o.L)(),{formatMessage:I}=(0,t.X)(),{updateAssortment:w}=(0,$.f)(),{removeAssortment:N}=(0,A.f)(),{setModal:k}=(0,T.f)(),S=(0,i.useRouter)(),R=async s=>{s.target.value&&await w({assortmentId:e?._id,assortment:{sequence:parseInt(s.target.value,10)}})},q=[{id:"texts",title:I({id:"texts",defaultMessage:"Texts"}),Icon:(0,s.jsx)(m.f,{className:"h-5 w-5"})},{id:"links",title:I({id:"links",defaultMessage:"Links"}),Icon:(0,s.jsx)(u.f,{className:"h-5 w-5"})},{id:"media",title:I({id:"media",defaultMessage:"Media"}),Icon:(0,s.jsx)(f.f,{className:"h-5 w-5"})},{id:"products",title:I({id:"products",defaultMessage:"Products"}),Icon:(0,s.jsx)(x.f,{className:"h-5 w-5"})},{id:"filters",title:I({id:"filters",defaultMessage:"Filters"}),Icon:(0,s.jsx)(g.f,{className:"h-5 w-5"})},null!==n&&{id:"extended",title:I({id:"extended-fields",defaultMessage:"Extended"}),Icon:(0,s.jsx)(h.f,{className:"h-5 w-5"})},..._("assortment:tabs").map(({config:e})=>({id:`plugin:${e.component}`,title:e.label,Icon:(0,s.jsx)(h.f,{className:"h-5 w-5"})}))],K=async s=>(await w({assortmentId:e?._id,assortment:{isRoot:s}}),!0),O=async({tags:s})=>(await w({assortmentId:e?._id,assortment:{tags:s}}),!0),U=async s=>(await w({assortmentId:e?._id,assortment:{isActive:s}}),!0),E=[{id:"active",title:I({id:"activate",defaultMessage:"Activate"}),selectedTitle:I({id:"activated",defaultMessage:"Activated"}),description:I({id:"activate_assortment_description",defaultMessage:"Will be visible on search"}),current:d,bgColor:"emerald",disable:!p(a.C.ManageAssortments),onClick:async()=>{await U(!0),r.toast.success(I({id:"assortment_activated",defaultMessage:"Assortment activated successfully"}))}},{id:"in-active",title:I({id:"deactivate",defaultMessage:"Deactivate"}),selectedTitle:I({id:"deactivated",defaultMessage:"Deactivated"}),description:I({id:"deactivate_assortment_description",defaultMessage:"Will not be visible on search"}),current:!d,bgColor:"amber",disable:!p(a.C.ManageAssortments),onClick:async()=>{await U(!1),r.toast.success(I({id:"assortment_deactivated",defaultMessage:"Assortment deactivated successfully"}))}}],Q=[{id:"root",title:I({id:"make_root",defaultMessage:"Make root"}),selectedTitle:I({id:"root",defaultMessage:"Root"}),description:I({id:"root_assortment_description",defaultMessage:"Can not be assigned as a child of another assortment "}),current:c,bgColor:"emerald",disable:!p(a.C.ManageAssortments),onClick:async()=>{await K(!0),r.toast.success(I({id:"assortment_changed_to_root",defaultMessage:"Assortment changed to root"}))}},{id:"leaf",selectedTitle:I({id:"leaf",defaultMessage:"Leaf"}),title:I({id:"make_leaf",defaultMessage:"Make leaf"}),description:I({id:"leaf_assortment_description",defaultMessage:"Can be assigned as a child of another assortment "}),current:!c,bgColor:"emerald",disable:!p(a.C.ManageAssortments),onClick:async()=>{await K(!1),r.toast.success(I({id:"assortment_changed_to_leaf",defaultMessage:"Assortment changed to leaf"}))}}],V=async()=>{await k((0,s.jsx)(M.f,{onCancelClick:()=>k(""),message:I({id:"delete_assortment_confirmation",defaultMessage:"This action might cause inconsistencies with other data that relates to it and it is nonreversible. Are you sure you want to delete this assortment?"}),onOkClick:async()=>{k(""),await N({assortmentId:e._id}),r.toast.success(I({id:"assortment_deleted_success",defaultMessage:"Deleted successfully"})),S.push("/assortments")}}))};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"mt-5 flex flex-wrap items-center justify-between gap-10",children:[(0,s.jsx)(L.f,{defaultValue:e?.tags,onSubmit:O,enableEdit:p(a.C.ManageAssortments),availableTagOptions:b?.adminUiConfig?.assortmentTags?.filter(s=>!(e?.tags||[])?.includes(s))?.map(e=>({value:e,label:e}))||[]}),!l&&(0,s.jsxs)("div",{className:"mt-5 flex flex-wrap gap-3",children:[(0,s.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-md px-4 py-2 text-sm font-medium leading-5 shadow-sm bg-surface h-[38px]",children:[(0,s.jsx)("label",{htmlFor:"sequence",className:"text-text-secondary font-medium",children:I({id:"sequence",defaultMessage:"Display Order"})}),(0,s.jsx)("input",{id:"sequence",type:"number",className:"text-center w-12 bg-transparent border border-border-default rounded focus:ring-0 focus:outline-none text-sm font-semibold text-text-primary px-2 py-1",defaultValue:e?.sequence,disabled:!p(a.C.ManageAssortments),onBlur:R})]}),(0,s.jsx)(v.f,{options:Q,type:I({id:"assortment",defaultMessage:"Assortment"})}),(0,s.jsx)(v.f,{options:E,type:I({id:"assortment",defaultMessage:"Assortment"})}),p(a.C.ManageAssortments)&&(0,s.jsx)(j.f,{variant:"danger",icon:(0,s.jsx)(y.f,{className:"h-5 w-5"}),text:"Delete",onClick:V})]})]}),(0,s.jsx)(C.f,{tabItems:q,defaultTab:"texts",children:(0,s.jsx)(F,{id:e?._id,...n})})]})};var q=e.i(59080),K=e.i(32171),O=e.i(1880),U=e.i(70693),E=e.i(50931),Q=e.i(84818),V=e.i(87284);let X=({media:e=[],onEditMedia:t})=>(0,s.jsx)("div",{className:"my-5",children:(0,s.jsx)("div",{className:"flex gap-3 overflow-x-auto",children:e.map(e=>(0,s.jsx)("div",{className:"relative flex-shrink-0 group",children:(0,s.jsx)("div",{className:"w-16 h-16 bg-surface-raised rounded-lg overflow-hidden cursor-pointer border border-border-subtle",onClick:()=>{var s;return s=e._id,void(t&&t(s))},children:(0,s.jsx)(V.f,{src:e?.file?.url,alt:e.texts?.[0]?.title||e?.file?.url,width:128,height:128,className:"w-full h-full object-cover"})})},e._id))})});e.s(["default",0,({assortmentSlug:e})=>{let{formatDateTime:o}=(0,Q.f)(),{formatMessage:c}=(0,t.X)(),{hasRole:m}=(0,D.f)(),{updateAssortment:u}=(0,$.f)(),{removeAssortment:f}=(0,A.f)(),{setModal:x}=(0,T.f)(),g=(0,i.useRouter)(),{assortment:h,loading:p,extendedData:b}=(({assortmentId:e=null,slug:s=null}={})=>{let t=(0,O.Q)(s),{customProperties:a,hydrateFragment:r}=(0,U.f)(),{selectedLocale:i}=(0,P.f)(),{data:n,loading:l,error:d}=(0,K.f)(((e="")=>q.a`
334
+ `;e.s(["f",0,()=>{let[e]=(0,t.f)(a);return{updateAssortment:async({assortmentId:s,assortment:{isRoot:t,tags:a,sequence:r,isActive:i}})=>e({variables:{assortment:{isRoot:t,tags:a,sequence:r,isActive:i},assortmentId:s},refetchQueries:["Assortments","Assortment"]})}}])},98568,e=>{"use strict";var s=e.i(91398),t=e.i(3326);e.i(51523);var a=e.i(19518),r=e.i(28401),i=e.i(3828),n=e.i(50595),l=e.i(53576),d=e.i(25327),o=e.i(13534),c=e.i(70475),m=e.i(25705),u=e.i(27927),f=e.i(50243),x=e.i(52745),g=e.i(93259),h=e.i(76929),p=e.i(11056),v=e.i(92276),j=e.i(21623),y=e.i(24608),b=e.i(83788),M=e.i(15971),A=e.i(75818),_=e.i(45856),I=e.i(24941),w=e.i(79001),N=e.i(34981),k=e.i(58101),$=e.i(921),C=e.i(56779),L=e.i(34948),D=e.i(58971),T=e.i(6607),S=e.i(31494),P=e.i(57561);let F=({id:e,selectedView:t,...a})=>{if("texts"===t)return(0,s.jsx)(p.f,{children:(0,s.jsx)(_.f,{assortmentId:e})});if("links"===t)return(0,s.jsx)(p.f,{children:(0,s.jsx)(w.f,{assortmentId:e})});if("media"===t)return(0,s.jsx)(b.f,{children:(0,s.jsx)(p.f,{children:(0,s.jsx)(I.f,{assortmentId:e})})});if("products"===t)return(0,s.jsx)(p.f,{children:(0,s.jsx)(N.f,{assortmentId:e})});if("filters"===t)return(0,s.jsx)(p.f,{children:(0,s.jsx)(k.f,{assortmentId:e})});if("extended"===t)return(0,s.jsx)(p.f,{children:(0,s.jsx)(S.f,{data:a})});if(t?.startsWith("plugin:")){let a=t.replace("plugin:","");return(0,s.jsx)(c.f,{slot:"assortment:tabs",entityId:e,children:(t,r)=>r.component===a?(0,s.jsx)(t,{entityId:e}):null})}return(0,s.jsx)(p.f,{children:(0,s.jsx)(_.f,{assortmentId:e})})},R=({assortment:e,extendedData:n,hideControls:l=!1})=>{let{isActive:d,isRoot:c}=e||{},{hasRole:p}=(0,D.f)(),{shopInfo:b}=(0,P.f)(),{getSlotPlugins:_}=(0,o.L)(),{formatMessage:I}=(0,t.X)(),{updateAssortment:w}=(0,$.f)(),{removeAssortment:N}=(0,A.f)(),{setModal:k}=(0,T.f)(),S=(0,i.useRouter)(),R=async s=>{s.target.value&&await w({assortmentId:e?._id,assortment:{sequence:parseInt(s.target.value,10)}})},q=[{id:"texts",title:I({id:"texts",defaultMessage:"Texts"}),Icon:(0,s.jsx)(m.f,{className:"h-5 w-5"})},{id:"links",title:I({id:"links",defaultMessage:"Links"}),Icon:(0,s.jsx)(u.f,{className:"h-5 w-5"})},{id:"media",title:I({id:"media",defaultMessage:"Media"}),Icon:(0,s.jsx)(f.f,{className:"h-5 w-5"})},{id:"products",title:I({id:"products",defaultMessage:"Products"}),Icon:(0,s.jsx)(x.f,{className:"h-5 w-5"})},{id:"filters",title:I({id:"filters",defaultMessage:"Filters"}),Icon:(0,s.jsx)(g.f,{className:"h-5 w-5"})},null!==n&&{id:"extended",title:I({id:"extended-fields",defaultMessage:"Extended"}),Icon:(0,s.jsx)(h.f,{className:"h-5 w-5"})},..._("assortment:tabs").map(({config:e})=>({id:`plugin:${e.component}`,title:e.label,Icon:(0,s.jsx)(h.f,{className:"h-5 w-5"})}))],K=async s=>(await w({assortmentId:e?._id,assortment:{isRoot:s}}),!0),O=async({tags:s})=>(await w({assortmentId:e?._id,assortment:{tags:s}}),!0),U=async s=>(await w({assortmentId:e?._id,assortment:{isActive:s}}),!0),E=[{id:"active",title:I({id:"activate",defaultMessage:"Activate"}),selectedTitle:I({id:"activated",defaultMessage:"Activated"}),description:I({id:"activate_assortment_description",defaultMessage:"Will be visible on search"}),current:d,bgColor:"emerald",disable:!p(a.C.ManageAssortments),onClick:async()=>{await U(!0),r.toast.success(I({id:"assortment_activated",defaultMessage:"Assortment activated successfully"}))}},{id:"in-active",title:I({id:"deactivate",defaultMessage:"Deactivate"}),selectedTitle:I({id:"deactivated",defaultMessage:"Deactivated"}),description:I({id:"deactivate_assortment_description",defaultMessage:"Will not be visible on search"}),current:!d,bgColor:"amber",disable:!p(a.C.ManageAssortments),onClick:async()=>{await U(!1),r.toast.success(I({id:"assortment_deactivated",defaultMessage:"Assortment deactivated successfully"}))}}],Q=[{id:"root",title:I({id:"make_root",defaultMessage:"Make root"}),selectedTitle:I({id:"root",defaultMessage:"Root"}),description:I({id:"root_assortment_description",defaultMessage:"Can not be assigned as a child of another assortment "}),current:c,bgColor:"emerald",disable:!p(a.C.ManageAssortments),onClick:async()=>{await K(!0),r.toast.success(I({id:"assortment_changed_to_root",defaultMessage:"Assortment changed to root"}))}},{id:"leaf",selectedTitle:I({id:"leaf",defaultMessage:"Leaf"}),title:I({id:"make_leaf",defaultMessage:"Make leaf"}),description:I({id:"leaf_assortment_description",defaultMessage:"Can be assigned as a child of another assortment "}),current:!c,bgColor:"emerald",disable:!p(a.C.ManageAssortments),onClick:async()=>{await K(!1),r.toast.success(I({id:"assortment_changed_to_leaf",defaultMessage:"Assortment changed to leaf"}))}}],V=async()=>{await k((0,s.jsx)(M.f,{onCancelClick:()=>k(""),message:I({id:"delete_assortment_confirmation",defaultMessage:"This action might cause inconsistencies with other data that relates to it and it is nonreversible. Are you sure you want to delete this assortment?"}),onOkClick:async()=>{k(""),await N({assortmentId:e._id}),r.toast.success(I({id:"assortment_deleted_success",defaultMessage:"Deleted successfully"})),S.push("/assortments")}}))};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"mt-5 flex flex-wrap items-center justify-between gap-10",children:[(0,s.jsx)(L.f,{defaultValue:e?.tags,onSubmit:O,enableEdit:p(a.C.ManageAssortments),availableTagOptions:b?.adminUiConfig?.assortmentTags?.filter(s=>!(e?.tags||[])?.includes(s))?.map(e=>({value:e,label:e}))||[]}),!l&&(0,s.jsxs)("div",{className:"mt-5 flex flex-wrap gap-3",children:[(0,s.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-md px-4 py-2 text-sm font-medium leading-5 shadow-sm bg-surface h-[38px]",children:[(0,s.jsx)("label",{htmlFor:"sequence",className:"text-text-secondary font-medium",children:I({id:"sequence",defaultMessage:"Display Order"})}),(0,s.jsx)("input",{id:"sequence",type:"number",className:"text-center w-12 bg-transparent border border-border-default rounded focus:ring-0 focus:outline-none text-sm font-semibold text-text-primary px-2 py-1",defaultValue:e?.sequence,disabled:!p(a.C.ManageAssortments),onBlur:R})]}),(0,s.jsx)(v.f,{options:Q,type:I({id:"assortment",defaultMessage:"Assortment"})}),(0,s.jsx)(v.f,{options:E,type:I({id:"assortment",defaultMessage:"Assortment"})}),p(a.C.ManageAssortments)&&(0,s.jsx)(j.f,{variant:"danger",icon:(0,s.jsx)(y.f,{className:"h-5 w-5"}),text:"Delete",onClick:V})]})]}),(0,s.jsx)(C.f,{tabItems:q,defaultTab:"texts",children:(0,s.jsx)(F,{id:e?._id,...n})})]})};var q=e.i(59080),K=e.i(32171),O=e.i(1880),U=e.i(70693),E=e.i(50931),Q=e.i(84818),V=e.i(87284);let X=({media:e=[],onEditMedia:t})=>(0,s.jsx)("div",{className:"my-5",children:(0,s.jsx)("div",{className:"flex gap-3 overflow-x-auto",children:e.map(e=>(0,s.jsx)("div",{className:"relative flex-shrink-0 group",children:(0,s.jsx)("div",{className:"w-16 h-16 bg-surface-raised rounded-lg overflow-hidden cursor-pointer border border-border-subtle",onClick:()=>{var s;return s=e._id,void(t&&t(s))},children:(0,s.jsx)(V.f,{src:e?.file?.url,alt:e.texts?.[0]?.title||e?.file?.url,width:128,height:128,className:"w-full h-full object-cover"})})},e._id))})});e.s(["default",0,({assortmentSlug:e})=>{let{formatDateTime:o}=(0,Q.f)(),{formatMessage:c}=(0,t.X)(),{hasRole:m}=(0,D.f)(),{updateAssortment:u}=(0,$.f)(),{removeAssortment:f}=(0,A.f)(),{setModal:x}=(0,T.f)(),g=(0,i.useRouter)(),{assortment:h,loading:p,extendedData:b}=(({assortmentId:e=null,slug:s=null}={})=>{let t=(0,O.Q)(s),{customProperties:a,hydrateFragment:r}=(0,U.f)(),{selectedLocale:i}=(0,P.f)(),{data:n,loading:l,error:d}=(0,K.f)(((e="")=>q.a`
335
335
  query Assortment($assortmentId: ID, $slug: String, $forceLocale: Locale) {
336
336
  assortment(assortmentId: $assortmentId, slug: $slug) {
337
337
  ...AssortmentFragment
@@ -339,4 +339,4 @@
339
339
  }
340
340
  }
341
341
  ${E.f}
342
- `)(a?.Assortment),{skip:!e&&!s,variables:{assortmentId:e||t,forceLocale:i}}),o=n?.assortment,c=r(a?.Assortment,o);return{loading:l,error:d,assortment:o,extendedData:c}})({slug:e}),{isActive:_,isRoot:I}=h||{},w=async e=>{e.target.value&&await u({assortmentId:h?._id,assortment:{sequence:parseInt(e.target.value,10)}})},N=async e=>(await u({assortmentId:h?._id,assortment:{isRoot:e}}),!0),k=async e=>(await u({assortmentId:h?._id,assortment:{isActive:e}}),!0),C=[{id:"active",title:c({id:"activate",defaultMessage:"Activate"}),selectedTitle:c({id:"activated",defaultMessage:"Activated"}),description:c({id:"activate_assortment_description",defaultMessage:"Will be visible on search"}),current:_,disable:!m(a.C.ManageAssortments),bgColor:"emerald",onClick:async()=>{await k(!0),r.toast.success(c({id:"assortment_activated",defaultMessage:"Assortment activated successfully"}))}},{id:"in-active",title:c({id:"deactivate",defaultMessage:"Deactivate"}),selectedTitle:c({id:"deactivated",defaultMessage:"Deactivated"}),description:c({id:"deactivate_assortment_description",defaultMessage:"Will not be visible on search"}),current:!_,disable:!m(a.C.ManageAssortments),bgColor:"amber",onClick:async()=>{await k(!1),r.toast.success(c({id:"assortment_deactivated",defaultMessage:"Assortment deactivated successfully"}))}}],L=[{id:"root",title:c({id:"make_root",defaultMessage:"Make root"}),selectedTitle:c({id:"root",defaultMessage:"Root"}),description:c({id:"root_assortment_description",defaultMessage:"Can not be assigned as a child of another assortment "}),disable:!m(a.C.ManageAssortments),current:I,bgColor:"stone",onClick:async()=>{await N(!0),r.toast.success(c({id:"assortment_changed_to_root",defaultMessage:"Assortment changed to root"}))}},{id:"leaf",selectedTitle:c({id:"leaf",defaultMessage:"Leaf"}),title:c({id:"make_leaf",defaultMessage:"Make leaf"}),disable:!m(a.C.ManageAssortments),description:c({id:"leaf_assortment_description",defaultMessage:"Can be assigned as a child of another assortment "}),current:!I,bgColor:"emerald",onClick:async()=>{await N(!1),r.toast.success(c({id:"assortment_changed_to_leaf",defaultMessage:"Assortment changed to leaf"}))}}],S=async()=>{await x((0,s.jsx)(M.f,{onCancelClick:()=>x(""),message:c({id:"delete_assortment_confirmation",defaultMessage:"This action might cause inconsistencies with other data that relates to it and it is nonreversible. Are you sure you want to delete this assortment?"}),onOkClick:async()=>{x(""),await f({assortmentId:h._id}),r.toast.success(c({id:"assortment_deleted_success",defaultMessage:"Deleted successfully"})),g.push("/assortments")}}))};return h||p?p?(0,s.jsx)(l.f,{}):(0,s.jsxs)("div",{className:"mt-5 max-w-full",children:[(0,s.jsx)(n.f,{routeName:e,depth:3,currentPageTitle:h?.texts?.title}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"items-center flex-wrap flex gap-5 min-w-full justify-between",children:[(0,s.jsx)(d.f,{headerText:h?.texts?.title||"Untitled Assortment",title:`${h?.texts?.title||"Assortment"} (${h?._id})`}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-3",children:[(0,s.jsx)(v.f,{options:C,type:c({id:"assortment",defaultMessage:"Assortment"})}),(0,s.jsx)(v.f,{options:L,type:c({id:"assortment",defaultMessage:"Assortment"})}),(0,s.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-md px-4 py-2 text-sm font-medium leading-5 shadow-sm bg-surface h-[38px]",children:[(0,s.jsx)("label",{htmlFor:"sequence",className:"text-text-secondary font-medium",children:c({id:"sequence",defaultMessage:"Display Order"})}),(0,s.jsx)("input",{id:"sequence",type:"number",disabled:!m(a.C.ManageAssortments),className:"text-center w-12 bg-transparent border border-border-default rounded focus:ring-0 focus:outline-none text-sm font-semibold text-text-primary px-2 py-1",defaultValue:h?.sequence,onBlur:w})]}),m(a.C.ManageAssortments)&&(0,s.jsx)(j.f,{variant:"danger",icon:(0,s.jsx)(y.f,{className:"h-5 w-5"}),text:"Delete",onClick:S})]})]}),(0,s.jsxs)("div",{className:"mt-8 flex flex-wrap gap-3 gap-x-10 text-text-secondary",children:[(0,s.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,s.jsx)("span",{className:"text-xs text-text-secondary",children:"ID:"}),(0,s.jsx)("span",{className:"text-sm font-mono",children:h?._id})]}),h?.created&&(0,s.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,s.jsxs)("span",{className:"text-xs text-text-secondary",children:[c({id:"created",defaultMessage:"Created"}),":"]}),(0,s.jsx)("span",{className:"text-sm font-mono",children:o(h.created,{dateStyle:"medium",timeStyle:"short"})})]}),h?.updated&&(0,s.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,s.jsxs)("span",{className:"text-xs text-text-secondary",children:[c({id:"updated",defaultMessage:"Updated"}),":"]}),(0,s.jsx)("span",{className:"text-sm font-mono",children:o(h.updated,{dateStyle:"medium",timeStyle:"short"})})]})]})]}),(0,s.jsx)(X,{assortmentId:h?._id,media:h?.media||[],onEditMedia:e=>{g.push({pathname:g.pathname,query:{...g.query,tab:"media"}},void 0,{shallow:!0})},canEdit:m(a.C.ManageAssortments)}),(0,s.jsx)(R,{assortment:h,extendedData:b,hideControls:!0})]}):(g.push("/404"),null)}],98568)},93259,e=>{var s=e.i(91788);let t=s.forwardRef(function({title:e,titleId:t,...a},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},a),e?s.createElement("title",{id:t},e):null,s.createElement("path",{fillRule:"evenodd",d:"M2.628 1.601C5.028 1.206 7.49 1 10 1s4.973.206 7.372.601a.75.75 0 0 1 .628.74v2.288a2.25 2.25 0 0 1-.659 1.59l-4.682 4.683a2.25 2.25 0 0 0-.659 1.59v3.037c0 .684-.31 1.33-.844 1.757l-1.937 1.55A.75.75 0 0 1 8 18.25v-5.757a2.25 2.25 0 0 0-.659-1.591L2.659 6.22A2.25 2.25 0 0 1 2 4.629V2.34a.75.75 0 0 1 .628-.74Z",clipRule:"evenodd"}))});e.s(["f",0,t],93259)}])})();
342
+ `)(a?.Assortment),{skip:!e&&!s,variables:{assortmentId:e||t,forceLocale:i}}),o=n?.assortment,c=r(a?.Assortment,o);return{loading:l,error:d,assortment:o,extendedData:c}})({slug:e}),{isActive:_,isRoot:I}=h||{},w=async e=>{e.target.value&&await u({assortmentId:h?._id,assortment:{sequence:parseInt(e.target.value,10)}})},N=async e=>(await u({assortmentId:h?._id,assortment:{isRoot:e}}),!0),k=async e=>(await u({assortmentId:h?._id,assortment:{isActive:e}}),!0),C=[{id:"active",title:c({id:"activate",defaultMessage:"Activate"}),selectedTitle:c({id:"activated",defaultMessage:"Activated"}),description:c({id:"activate_assortment_description",defaultMessage:"Will be visible on search"}),current:_,disable:!m(a.C.ManageAssortments),bgColor:"emerald",onClick:async()=>{await k(!0),r.toast.success(c({id:"assortment_activated",defaultMessage:"Assortment activated successfully"}))}},{id:"in-active",title:c({id:"deactivate",defaultMessage:"Deactivate"}),selectedTitle:c({id:"deactivated",defaultMessage:"Deactivated"}),description:c({id:"deactivate_assortment_description",defaultMessage:"Will not be visible on search"}),current:!_,disable:!m(a.C.ManageAssortments),bgColor:"amber",onClick:async()=>{await k(!1),r.toast.success(c({id:"assortment_deactivated",defaultMessage:"Assortment deactivated successfully"}))}}],L=[{id:"root",title:c({id:"make_root",defaultMessage:"Make root"}),selectedTitle:c({id:"root",defaultMessage:"Root"}),description:c({id:"root_assortment_description",defaultMessage:"Can not be assigned as a child of another assortment "}),disable:!m(a.C.ManageAssortments),current:I,bgColor:"stone",onClick:async()=>{await N(!0),r.toast.success(c({id:"assortment_changed_to_root",defaultMessage:"Assortment changed to root"}))}},{id:"leaf",selectedTitle:c({id:"leaf",defaultMessage:"Leaf"}),title:c({id:"make_leaf",defaultMessage:"Make leaf"}),disable:!m(a.C.ManageAssortments),description:c({id:"leaf_assortment_description",defaultMessage:"Can be assigned as a child of another assortment "}),current:!I,bgColor:"emerald",onClick:async()=>{await N(!1),r.toast.success(c({id:"assortment_changed_to_leaf",defaultMessage:"Assortment changed to leaf"}))}}],S=async()=>{await x((0,s.jsx)(M.f,{onCancelClick:()=>x(""),message:c({id:"delete_assortment_confirmation",defaultMessage:"This action might cause inconsistencies with other data that relates to it and it is nonreversible. Are you sure you want to delete this assortment?"}),onOkClick:async()=>{x(""),await f({assortmentId:h._id}),r.toast.success(c({id:"assortment_deleted_success",defaultMessage:"Deleted successfully"})),g.push("/assortments")}}))};return h||p?p?(0,s.jsx)(l.f,{variant:"detail"}):(0,s.jsxs)("div",{className:"mt-5 max-w-full",children:[(0,s.jsx)(n.f,{routeName:e,depth:3,currentPageTitle:h?.texts?.title}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"items-center flex-wrap flex gap-5 min-w-full justify-between",children:[(0,s.jsx)(d.f,{headerText:h?.texts?.title||"Untitled Assortment",title:`${h?.texts?.title||"Assortment"} (${h?._id})`}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-3",children:[(0,s.jsx)(v.f,{options:C,type:c({id:"assortment",defaultMessage:"Assortment"})}),(0,s.jsx)(v.f,{options:L,type:c({id:"assortment",defaultMessage:"Assortment"})}),(0,s.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-md px-4 py-2 text-sm font-medium leading-5 shadow-sm bg-surface h-[38px]",children:[(0,s.jsx)("label",{htmlFor:"sequence",className:"text-text-secondary font-medium",children:c({id:"sequence",defaultMessage:"Display Order"})}),(0,s.jsx)("input",{id:"sequence",type:"number",disabled:!m(a.C.ManageAssortments),className:"text-center w-12 bg-transparent border border-border-default rounded focus:ring-0 focus:outline-none text-sm font-semibold text-text-primary px-2 py-1",defaultValue:h?.sequence,onBlur:w})]}),m(a.C.ManageAssortments)&&(0,s.jsx)(j.f,{variant:"danger",icon:(0,s.jsx)(y.f,{className:"h-5 w-5"}),text:"Delete",onClick:S})]})]}),(0,s.jsxs)("div",{className:"mt-8 flex flex-wrap gap-3 gap-x-10 text-text-secondary",children:[(0,s.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,s.jsx)("span",{className:"text-xs text-text-secondary",children:"ID:"}),(0,s.jsx)("span",{className:"text-sm font-mono",children:h?._id})]}),h?.created&&(0,s.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,s.jsxs)("span",{className:"text-xs text-text-secondary",children:[c({id:"created",defaultMessage:"Created"}),":"]}),(0,s.jsx)("span",{className:"text-sm font-mono",children:o(h.created,{dateStyle:"medium",timeStyle:"short"})})]}),h?.updated&&(0,s.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,s.jsxs)("span",{className:"text-xs text-text-secondary",children:[c({id:"updated",defaultMessage:"Updated"}),":"]}),(0,s.jsx)("span",{className:"text-sm font-mono",children:o(h.updated,{dateStyle:"medium",timeStyle:"short"})})]})]})]}),(0,s.jsx)(X,{assortmentId:h?._id,media:h?.media||[],onEditMedia:e=>{g.push({pathname:g.pathname,query:{...g.query,tab:"media"}},void 0,{shallow:!0})},canEdit:m(a.C.ManageAssortments)}),(0,s.jsx)(R,{assortment:h,extendedData:b,hideControls:!0})]}):(g.push("/404"),null)}],98568)},93259,e=>{"use strict";var s=e.i(91788);let t=s.forwardRef(function({title:e,titleId:t,...a},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},a),e?s.createElement("title",{id:t},e):null,s.createElement("path",{fillRule:"evenodd",d:"M2.628 1.601C5.028 1.206 7.49 1 10 1s4.973.206 7.372.601a.75.75 0 0 1 .628.74v2.288a2.25 2.25 0 0 1-.659 1.59l-4.682 4.683a2.25 2.25 0 0 0-.659 1.59v3.037c0 .684-.31 1.33-.844 1.757l-1.937 1.55A.75.75 0 0 1 8 18.25v-5.757a2.25 2.25 0 0 0-.659-1.591L2.659 6.22A2.25 2.25 0 0 1 2 4.629V2.34a.75.75 0 0 1 .628-.74Z",clipRule:"evenodd"}))});e.s(["f",0,t],93259)}]);