@unchainedshop/admin-ui 4.0.2 → 4.0.4

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 (187) hide show
  1. package/README.md +0 -11
  2. package/out/403/index.html +2 -2
  3. package/out/404/index.html +2 -2
  4. package/out/404.html +2 -2
  5. package/out/423/index.html +2 -2
  6. package/out/500/index.html +2 -2
  7. package/out/_next/static/chunks/{167-7321818874ca3933.js → 167-5cfe6c448dacc4fc.js} +1 -1
  8. package/out/_next/static/chunks/2968-826b5bc65c5257d1.js +1 -0
  9. package/out/_next/static/chunks/3285-f32aeccdb42bdfdf.js +1 -0
  10. package/out/_next/static/chunks/3572-b1712878842659a7.js +1 -0
  11. package/out/_next/static/chunks/{3828-2a03632320234562.js → 3828-8b4796b708cec2b1.js} +1 -1
  12. package/out/_next/static/chunks/5501-fb4de5961d94b8f9.js +1 -0
  13. package/out/_next/static/chunks/602-b7712531f08422db.js +1 -0
  14. package/out/_next/static/chunks/6044-cf9bf27fdd78a03b.js +1 -0
  15. package/out/_next/static/chunks/{6148-861cba5f5b692327.js → 6148-41a42dd488192adb.js} +1 -1
  16. package/out/_next/static/chunks/{707-e5d168bb1375305a.js → 707-ec339a6d66ea39e5.js} +1 -1
  17. package/out/_next/static/chunks/{7150-83fb2e992d99bf1a.js → 7150-d1f3c58912d1346f.js} +1 -1
  18. package/out/_next/static/chunks/{7627-dceb49d16573add4.js → 7627-478d84138b9675aa.js} +1 -1
  19. package/out/_next/static/chunks/7659-759a9353c86e85d0.js +1 -0
  20. package/out/_next/static/chunks/7892-68e1d4960009d13f.js +1 -0
  21. package/out/_next/static/chunks/8637-62092dcde5c82afc.js +1 -0
  22. package/out/_next/static/chunks/9341-2be7e69b50ef88f5.js +1 -0
  23. package/out/_next/static/chunks/9861-bf272628d1aacae9.js +1 -0
  24. package/out/_next/static/chunks/9884-4632f6f000e09465.js +1 -0
  25. package/out/_next/static/chunks/pages/_app-9c8e6c5224f342e3.js +14 -0
  26. package/out/_next/static/chunks/pages/account/forgot-password-b947b4cae896f4f3.js +1 -0
  27. package/out/_next/static/chunks/pages/account-2ffd0e003497a773.js +1 -0
  28. package/out/_next/static/chunks/pages/assortments/AssortmentDetailPage-8da1816bfab77db7.js +1 -0
  29. package/out/_next/static/chunks/pages/assortments/new-01ab26f710712c6d.js +1 -0
  30. package/out/_next/static/chunks/pages/{assortments-60c56cc45de4e68b.js → assortments-5ee3af01744547f3.js} +1 -1
  31. package/out/_next/static/chunks/pages/country/CountryDetailPage-549a8644a354d68e.js +1 -0
  32. package/out/_next/static/chunks/pages/country/new-634954f9a7915424.js +1 -0
  33. package/out/_next/static/chunks/pages/{country-db3a9cbfb956952b.js → country-1ef3aef9ab2260c5.js} +1 -1
  34. package/out/_next/static/chunks/pages/currency/CurrencyDetailPage-e99485ae5e671c55.js +1 -0
  35. package/out/_next/static/chunks/pages/currency/new-df5c39a5f0a04629.js +1 -0
  36. package/out/_next/static/chunks/pages/currency-50584267ab3818c4.js +1 -0
  37. package/out/_next/static/chunks/pages/delivery-provider/DeliveryProviderDetailPage-0497f26bef0b731e.js +1 -0
  38. package/out/_next/static/chunks/pages/delivery-provider/new-803bd01ec9f56302.js +1 -0
  39. package/out/_next/static/chunks/pages/{delivery-provider-c3a557e69c07ae61.js → delivery-provider-e509367e2a9f478e.js} +1 -1
  40. package/out/_next/static/chunks/pages/enrollments/EnrollmentDetailPage-2efdef3989266f54.js +1 -0
  41. package/out/_next/static/chunks/pages/{enrollments-9319535851e5a6bf.js → enrollments-1304ae0e4fb97054.js} +1 -1
  42. package/out/_next/static/chunks/pages/events/EventDetailPage-3f01704632966279.js +1 -0
  43. package/out/_next/static/chunks/pages/{events-eda36e057c1abdaf.js → events-2ea3d09ae5aacfd2.js} +1 -1
  44. package/out/_next/static/chunks/pages/filters/FilterDetailPage-7393fba87a4da768.js +1 -0
  45. package/out/_next/static/chunks/pages/filters/new-828121948bce3054.js +1 -0
  46. package/out/_next/static/chunks/pages/filters-e80fd7356af3ba3c.js +1 -0
  47. package/out/_next/static/chunks/pages/index-5529b01e2f43d086.js +1 -0
  48. package/out/_next/static/chunks/pages/language/LanguageDetailPage-74464ca9772b4dfd.js +1 -0
  49. package/out/_next/static/chunks/pages/language/new-ff785c4c43f74343.js +1 -0
  50. package/out/_next/static/chunks/pages/language-59c405a700fdffca.js +1 -0
  51. package/out/_next/static/chunks/pages/log-in-9bd6abe5a26c11ff.js +1 -0
  52. package/out/_next/static/chunks/pages/orders/{OrderDetailPage-6f021ab011630559.js → OrderDetailPage-90ca7edf613d9d4a.js} +1 -1
  53. package/out/_next/static/chunks/pages/orders-42d05738ec21992c.js +1 -0
  54. package/out/_next/static/chunks/pages/payment-provider/PaymentProviderDetailPage-7147ee30ec89931c.js +1 -0
  55. package/out/_next/static/chunks/pages/payment-provider/new-35398c1228bd287c.js +1 -0
  56. package/out/_next/static/chunks/pages/payment-provider-1e319b4cd16528e9.js +1 -0
  57. package/out/_next/static/chunks/pages/products/ProductDetailPage-663c1e2a8c3f6fea.js +1 -0
  58. package/out/_next/static/chunks/pages/products/new-882924ff5e09c97e.js +1 -0
  59. package/out/_next/static/chunks/pages/products-e2e10ef6a4016960.js +1 -0
  60. package/out/_next/static/chunks/pages/quotations/QuotationDetailPage-c5ba0989466ac5f3.js +1 -0
  61. package/out/_next/static/chunks/pages/quotations-4e769b648934f41a.js +1 -0
  62. package/out/_next/static/chunks/pages/reset-password-7465238f3bc10d1b.js +1 -0
  63. package/out/_next/static/chunks/pages/sign-up-bc5fc53aaf0c4b4c.js +1 -0
  64. package/out/_next/static/chunks/pages/tokens/TokenDetailPage-8f4d743f7215c39a.js +1 -0
  65. package/out/_next/static/chunks/pages/tokens-88a1aaf6685d545b.js +1 -0
  66. package/out/_next/static/chunks/pages/users/UserDetailPage-2a1290414ab1a4ba.js +1 -0
  67. package/out/_next/static/chunks/pages/users/new-2e4376fc7b94d876.js +1 -0
  68. package/out/_next/static/chunks/pages/{users-2857984a8349998f.js → users-5f79f87a848820a3.js} +1 -1
  69. package/out/_next/static/chunks/pages/verify-email-361925a83f966421.js +1 -0
  70. package/out/_next/static/chunks/pages/warehousing-provider/WarehousingProviderDetailPage-0ef27245bf6df702.js +1 -0
  71. package/out/_next/static/chunks/pages/warehousing-provider/new-4e02e4ce67a67aaf.js +1 -0
  72. package/out/_next/static/chunks/pages/warehousing-provider-4faf8c7dd2687865.js +1 -0
  73. package/out/_next/static/chunks/pages/works/WorkDetailPage-fa3ca1b096398991.js +1 -0
  74. package/out/_next/static/chunks/pages/works/management-bb70257c5db839a8.js +1 -0
  75. package/out/_next/static/chunks/pages/{works-aa07bfdb5a835134.js → works-31adbe460dd79e88.js} +1 -1
  76. package/out/_next/static/sG3AFdaYltNrITQQAcZdO/_buildManifest.js +1 -0
  77. package/out/_offline/index.html +2 -2
  78. package/out/account/forgot-password/index.html +2 -2
  79. package/out/account/index.html +2 -2
  80. package/out/admin-ui-permissions.js +10 -16
  81. package/out/assortments/AssortmentDetailPage/index.html +2 -2
  82. package/out/assortments/index.html +2 -2
  83. package/out/assortments/new/index.html +2 -2
  84. package/out/country/CountryDetailPage/index.html +2 -2
  85. package/out/country/index.html +2 -2
  86. package/out/country/new/index.html +2 -2
  87. package/out/currency/CurrencyDetailPage/index.html +2 -2
  88. package/out/currency/index.html +2 -2
  89. package/out/currency/new/index.html +2 -2
  90. package/out/delivery-provider/DeliveryProviderDetailPage/index.html +2 -2
  91. package/out/delivery-provider/index.html +2 -2
  92. package/out/delivery-provider/new/index.html +2 -2
  93. package/out/enrollments/EnrollmentDetailPage/index.html +2 -2
  94. package/out/enrollments/index.html +2 -2
  95. package/out/events/EventDetailPage/index.html +2 -2
  96. package/out/events/index.html +2 -2
  97. package/out/external/index.html +2 -2
  98. package/out/filters/FilterDetailPage/index.html +2 -2
  99. package/out/filters/index.html +2 -2
  100. package/out/filters/new/index.html +2 -2
  101. package/out/index.html +2 -2
  102. package/out/language/LanguageDetailPage/index.html +2 -2
  103. package/out/language/index.html +2 -2
  104. package/out/language/new/index.html +2 -2
  105. package/out/log-in/index.html +2 -2
  106. package/out/orders/OrderDetailPage/index.html +2 -2
  107. package/out/orders/index.html +2 -2
  108. package/out/payment-provider/PaymentProviderDetailPage/index.html +2 -2
  109. package/out/payment-provider/index.html +2 -2
  110. package/out/payment-provider/new/index.html +2 -2
  111. package/out/products/ProductDetailPage/index.html +2 -2
  112. package/out/products/index.html +2 -2
  113. package/out/products/new/index.html +2 -2
  114. package/out/quotations/QuotationDetailPage/index.html +2 -2
  115. package/out/quotations/index.html +2 -2
  116. package/out/reset-password/index.html +2 -2
  117. package/out/sign-up/index.html +2 -2
  118. package/out/tokens/TokenDetailPage/index.html +2 -2
  119. package/out/tokens/index.html +2 -2
  120. package/out/users/UserDetailPage/index.html +2 -2
  121. package/out/users/index.html +2 -2
  122. package/out/users/new/index.html +2 -2
  123. package/out/verify-email/index.html +2 -2
  124. package/out/warehousing-provider/WarehousingProviderDetailPage/index.html +2 -2
  125. package/out/warehousing-provider/index.html +2 -2
  126. package/out/warehousing-provider/new/index.html +2 -2
  127. package/out/works/WorkDetailPage/index.html +2 -2
  128. package/out/works/index.html +2 -2
  129. package/out/works/management/index.html +2 -2
  130. package/package.json +6 -7
  131. package/out/_next/static/cRu7Ep1qPiF3UJ6jMwX8j/_buildManifest.js +0 -1
  132. package/out/_next/static/chunks/2968-b64a8e76f9a4910f.js +0 -1
  133. package/out/_next/static/chunks/3285-28bfa9bfb37a9ad4.js +0 -1
  134. package/out/_next/static/chunks/3572-8f7efd3b3698d9b7.js +0 -1
  135. package/out/_next/static/chunks/5501-5200a77f9245ded9.js +0 -1
  136. package/out/_next/static/chunks/602-2a7628fa4a1b3318.js +0 -1
  137. package/out/_next/static/chunks/6044-b4c97930a60db990.js +0 -1
  138. package/out/_next/static/chunks/7033-bfb7804bc69965e0.js +0 -1
  139. package/out/_next/static/chunks/7659-2d6e8019cb635e1a.js +0 -1
  140. package/out/_next/static/chunks/8637-d06523472d7ae116.js +0 -1
  141. package/out/_next/static/chunks/9341-a8537dfe78483683.js +0 -1
  142. package/out/_next/static/chunks/9861-5bc855ce8d6ae104.js +0 -1
  143. package/out/_next/static/chunks/9884-385a18891c4190b0.js +0 -1
  144. package/out/_next/static/chunks/pages/_app-4c65131ebcc0a107.js +0 -14
  145. package/out/_next/static/chunks/pages/account/forgot-password-aa09e16f0c5b7ea5.js +0 -1
  146. package/out/_next/static/chunks/pages/account-19e67d460d4386b8.js +0 -1
  147. package/out/_next/static/chunks/pages/assortments/AssortmentDetailPage-132a8c1e200623a7.js +0 -1
  148. package/out/_next/static/chunks/pages/assortments/new-cd24555dd0494692.js +0 -1
  149. package/out/_next/static/chunks/pages/country/CountryDetailPage-bd30ba8cfc5cb2c4.js +0 -1
  150. package/out/_next/static/chunks/pages/country/new-2f434006e2c32db5.js +0 -1
  151. package/out/_next/static/chunks/pages/currency/CurrencyDetailPage-6fa3761e7426e556.js +0 -1
  152. package/out/_next/static/chunks/pages/currency/new-295e362a132d0f8e.js +0 -1
  153. package/out/_next/static/chunks/pages/currency-8d47bf66ebbe7f44.js +0 -1
  154. package/out/_next/static/chunks/pages/delivery-provider/DeliveryProviderDetailPage-ebcc453d2973cdb2.js +0 -1
  155. package/out/_next/static/chunks/pages/delivery-provider/new-b6f4f61779d0a1be.js +0 -1
  156. package/out/_next/static/chunks/pages/enrollments/EnrollmentDetailPage-4ccae79933ff3704.js +0 -1
  157. package/out/_next/static/chunks/pages/events/EventDetailPage-05c474733e96f32e.js +0 -1
  158. package/out/_next/static/chunks/pages/filters/FilterDetailPage-2d433e9f1452e92a.js +0 -1
  159. package/out/_next/static/chunks/pages/filters/new-664bab8f0ebfef13.js +0 -1
  160. package/out/_next/static/chunks/pages/filters-eccd51bd6c5c0cce.js +0 -1
  161. package/out/_next/static/chunks/pages/index-c2d69638aa411d5d.js +0 -1
  162. package/out/_next/static/chunks/pages/language/LanguageDetailPage-61470a50fc11f3e4.js +0 -1
  163. package/out/_next/static/chunks/pages/language/new-2cd0b48fad1a9c1a.js +0 -1
  164. package/out/_next/static/chunks/pages/language-b22bf0f5a6b8f040.js +0 -1
  165. package/out/_next/static/chunks/pages/log-in-a371792743325530.js +0 -1
  166. package/out/_next/static/chunks/pages/orders-43c749e616429740.js +0 -1
  167. package/out/_next/static/chunks/pages/payment-provider/PaymentProviderDetailPage-26c6d9f328393195.js +0 -1
  168. package/out/_next/static/chunks/pages/payment-provider/new-452f822d7c092778.js +0 -1
  169. package/out/_next/static/chunks/pages/payment-provider-a11f1c1cd2e0ed33.js +0 -1
  170. package/out/_next/static/chunks/pages/products/ProductDetailPage-fe55102ed5bff908.js +0 -1
  171. package/out/_next/static/chunks/pages/products/new-7a0150f3a5b765ad.js +0 -1
  172. package/out/_next/static/chunks/pages/products-30570bbe68f1e222.js +0 -1
  173. package/out/_next/static/chunks/pages/quotations/QuotationDetailPage-5068193d4674176d.js +0 -1
  174. package/out/_next/static/chunks/pages/quotations-548680e4c71cf189.js +0 -1
  175. package/out/_next/static/chunks/pages/reset-password-16333d89e40e4bfb.js +0 -1
  176. package/out/_next/static/chunks/pages/sign-up-1720cbd50cc442a4.js +0 -1
  177. package/out/_next/static/chunks/pages/tokens/TokenDetailPage-f0e570b99cd88daf.js +0 -1
  178. package/out/_next/static/chunks/pages/tokens-68b24afc6ada1a43.js +0 -1
  179. package/out/_next/static/chunks/pages/users/UserDetailPage-94e5a94fd9a54a78.js +0 -1
  180. package/out/_next/static/chunks/pages/users/new-753a44b788743c4a.js +0 -1
  181. package/out/_next/static/chunks/pages/verify-email-6ba404dfe03ba57d.js +0 -1
  182. package/out/_next/static/chunks/pages/warehousing-provider/WarehousingProviderDetailPage-e7bc2528d9af8cc0.js +0 -1
  183. package/out/_next/static/chunks/pages/warehousing-provider/new-aac2c3353e372b15.js +0 -1
  184. package/out/_next/static/chunks/pages/warehousing-provider-9b962a6b18fcd165.js +0 -1
  185. package/out/_next/static/chunks/pages/works/WorkDetailPage-b669547323b8a801.js +0 -1
  186. package/out/_next/static/chunks/pages/works/management-87693692b8045a69.js +0 -1
  187. /package/out/_next/static/{cRu7Ep1qPiF3UJ6jMwX8j → sG3AFdaYltNrITQQAcZdO}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2968],{7207:(e,t,n)=>{n.d(t,{A:()=>o});var l=n(37876),a=n(15039),s=n.n(a),i=n(90638),r=n(13867),d=n(14232);let u=e=>{let{header:t,body:n,headerCSS:a="",bodyCSS:u="",itemContainerCSS:o="",itemindex:c=1}=e,[m,p]=(0,d.useState)(!1);return(0,l.jsxs)("div",{className:s()("mt-3",o),"data-itemindex":c,children:[(0,l.jsxs)("button",{type:"button",onClick:()=>p(!m),className:s()("relative cursor-pointer border dark:border-slate-700 bg-white dark:bg-slate-900 text-slate-500 dark:text-slate-200 hover:bg-slate-50 dark:hover:bg-slate-700 w-full",a),children:[(0,l.jsx)("div",{className:"w-full",children:t}),(0,l.jsx)("span",{className:"px-2",children:m?(0,l.jsx)(i.A,{className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",strokeWidth:2}):(0,l.jsx)(r.A,{className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",strokeWidth:2})})]}),m?(0,l.jsx)("div",{className:s()("rounded-lg p-0 text-slate-400 dark:text-slate-200 ",u),children:n}):""]})},o=e=>{let{data:t,containerCSS:n="",headerCSS:a="",bodyCSS:i="",itemContainerCSS:r="",...d}=e;return(0,l.jsx)("div",{className:s()("my-3",n),...d,children:t.map((e,t)=>{let{header:n,body:s}=e;return(0,l.jsx)(u,{itemindex:t,header:n,body:s,headerCSS:a,bodyCSS:i,itemContainerCSS:r},t)})})}},14025:(e,t,n)=>{n.d(t,{A:()=>s});var l=n(96427);function a(){let e=(0,l._)(["\n fragment ProductDetailFragment on Product {\n _id\n sequence\n status\n created\n tags\n updated\n published\n\n media {\n _id\n tags\n file {\n _id\n url\n }\n }\n reviews {\n _id\n created\n author {\n _id\n username\n isGuest\n }\n rating\n title\n review\n voteCount\n ownVotes {\n type\n timestamp\n }\n }\n siblings {\n _id\n media {\n _id\n file {\n _id\n url\n }\n }\n }\n }\n"]);return a=function(){return e},e}let s=(0,n(79350).J1)(a())},19444:(e,t,n)=>{n.d(t,{A:()=>u});var l=n(96427),a=n(79350),s=n(54431),i=n(54760);function r(){let e=(0,l._)(["\n query Currencies(\n $queryString: String\n $limit: Int\n $offset: Int\n $includeInactive: Boolean\n $sort: [SortOptionInput!]\n ) {\n currencies(\n queryString: $queryString\n limit: $limit\n offset: $offset\n includeInactive: $includeInactive\n sort: $sort\n ) {\n ...CurrencyFragment\n }\n currenciesCount(\n includeInactive: $includeInactive\n queryString: $queryString\n )\n }\n ","\n"]);return r=function(){return e},e}let d=(0,a.J1)(r(),i.A),u=function(){let{queryString:e="",limit:t=20,offset:n=0,includeInactive:l=!0,sort:a=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{data:i,loading:r,error:u}=(0,s.IT)(d,{variables:{queryString:e,limit:t,offset:n,includeInactive:l,sort:a}}),o=(null==i?void 0:i.currencies)||[],c=null==i?void 0:i.currenciesCount,m=(null==o?void 0:o.length)<c;return{currencies:o,currenciesCount:c,hasMore:m,loading:r,error:u}}},22968:(e,t,n)=>{n.r(t),n.d(t,{default:()=>la});var l=n(37876),a=n(54749),s=n(89099),i=n(77742),r=n(8733),d=n(4301),u=n(41863),o=n(38772),c=n(66448),m=n(91562),p=n(22168),x=n(19074),g=n(84338),f=n(31094),h=n(10920),v=n(2240),b=n(34600),j=n(64378),y=n(14232);let w=y.forwardRef(function(e,t){let{title:n,titleId:l,...a}=e;return y.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:t,"aria-labelledby":l},a),n?y.createElement("title",{id:l},n):null,y.createElement("path",{fillRule:"evenodd",d:"M2.25 13.5a8.25 8.25 0 0 1 8.25-8.25.75.75 0 0 1 .75.75v6.75H18a.75.75 0 0 1 .75.75 8.25 8.25 0 0 1-16.5 0Z",clipRule:"evenodd"}),y.createElement("path",{fillRule:"evenodd",d:"M12.75 3a.75.75 0 0 1 .75-.75 8.25 8.25 0 0 1 8.25 8.25.75.75 0 0 1-.75.75h-7.5a.75.75 0 0 1-.75-.75V3Z",clipRule:"evenodd"}))}),I=y.forwardRef(function(e,t){let{title:n,titleId:l,...a}=e;return y.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:t,"aria-labelledby":l},a),n?y.createElement("title",{id:l},n):null,y.createElement("path",{d:"M3.375 3C2.339 3 1.5 3.84 1.5 4.875v.75c0 1.036.84 1.875 1.875 1.875h17.25c1.035 0 1.875-.84 1.875-1.875v-.75C22.5 3.839 21.66 3 20.625 3H3.375Z"}),y.createElement("path",{fillRule:"evenodd",d:"m3.087 9 .54 9.176A3 3 0 0 0 6.62 21h10.757a3 3 0 0 0 2.995-2.824L20.913 9H3.087Zm6.163 3.75A.75.75 0 0 1 10 12h4a.75.75 0 0 1 0 1.5h-4a.75.75 0 0 1-.75-.75Z",clipRule:"evenodd"}))}),_=y.forwardRef(function(e,t){let{title:n,titleId:l,...a}=e;return y.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:t,"aria-labelledby":l},a),n?y.createElement("title",{id:l},n):null,y.createElement("path",{fillRule:"evenodd",d:"M2.25 4.125c0-1.036.84-1.875 1.875-1.875h5.25c1.036 0 1.875.84 1.875 1.875V17.25a4.5 4.5 0 1 1-9 0V4.125Zm4.5 14.25a1.125 1.125 0 1 0 0-2.25 1.125 1.125 0 0 0 0 2.25Z",clipRule:"evenodd"}),y.createElement("path",{d:"M10.719 21.75h9.156c1.036 0 1.875-.84 1.875-1.875v-5.25c0-1.036-.84-1.875-1.875-1.875h-.14l-8.742 8.743c-.09.089-.18.175-.274.257ZM12.738 17.625l6.474-6.474a1.875 1.875 0 0 0 0-2.651L15.5 4.787a1.875 1.875 0 0 0-2.651 0l-.1.099V17.25c0 .126-.003.251-.01.375Z"}))}),A=y.forwardRef(function(e,t){let{title:n,titleId:l,...a}=e;return y.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:t,"aria-labelledby":l},a),n?y.createElement("title",{id:l},n):null,y.createElement("path",{fillRule:"evenodd",d:"M2.25 2.25a.75.75 0 0 0 0 1.5H3v10.5a3 3 0 0 0 3 3h1.21l-1.172 3.513a.75.75 0 0 0 1.424.474l.329-.987h8.418l.33.987a.75.75 0 0 0 1.422-.474l-1.17-3.513H18a3 3 0 0 0 3-3V3.75h.75a.75.75 0 0 0 0-1.5H2.25Zm6.54 15h6.42l.5 1.5H8.29l.5-1.5Zm8.085-8.995a.75.75 0 1 0-.75-1.299 12.81 12.81 0 0 0-3.558 3.05L11.03 8.47a.75.75 0 0 0-1.06 0l-3 3a.75.75 0 1 0 1.06 1.06l2.47-2.47 1.617 1.618a.75.75 0 0 0 1.146-.102 11.312 11.312 0 0 1 3.612-3.321Z",clipRule:"evenodd"}))}),N=y.forwardRef(function(e,t){let{title:n,titleId:l,...a}=e;return y.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:t,"aria-labelledby":l},a),n?y.createElement("title",{id:l},n):null,y.createElement("path",{d:"M4.5 6.375a4.125 4.125 0 1 1 8.25 0 4.125 4.125 0 0 1-8.25 0ZM14.25 8.625a3.375 3.375 0 1 1 6.75 0 3.375 3.375 0 0 1-6.75 0ZM1.5 19.125a7.125 7.125 0 0 1 14.25 0v.003l-.001.119a.75.75 0 0 1-.363.63 13.067 13.067 0 0 1-6.761 1.873c-2.472 0-4.786-.684-6.76-1.873a.75.75 0 0 1-.364-.63l-.001-.122ZM17.25 19.128l-.001.144a2.25 2.25 0 0 1-.233.96 10.088 10.088 0 0 0 5.06-1.01.75.75 0 0 0 .42-.643 4.875 4.875 0 0 0-6.957-4.611 8.586 8.586 0 0 1 1.71 5.157v.003Z"}))});var P=n(86622);let M=y.forwardRef(function(e,t){let{title:n,titleId:l,...a}=e;return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":l},a),n?y.createElement("title",{id:l},n):null,y.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.622 1.757-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244"}))});var k=n(1097),C=n(27956),$=n(33905),T=n(51485),S=n(73607),V=n(98670),R=n(19444),D=n(49563),E=n(21088),q=n(47345),J=n(47646),B=n(69230),O=n(26985),L=n(67032),U=n(88817),F=n(96427),Q=n(79350),W=n(54431);function z(){let e=(0,F._)(["\n fragment ProductCatalogPriceFragment on ProductCatalogPrice {\n isTaxable\n isNetPrice\n country {\n _id\n isoCode\n name\n flagEmoji\n }\n currency {\n _id\n isoCode\n isActive\n }\n amount\n maxQuantity\n }\n"]);return z=function(){return e},e}let Z=(0,Q.J1)(z());function H(){let e=(0,F._)(["\n query ProductCatalogPrices($productId: ID!) {\n productCatalogPrices(productId: $productId) {\n ...ProductCatalogPriceFragment\n }\n }\n ","\n"]);return H=function(){return e},e}let K=(0,Q.J1)(H(),Z),G=e=>{let{productId:t}=e,{data:n,loading:l,error:a}=(0,W.IT)(K,{skip:!t,variables:{productId:t}});return{catalogPrices:(null==n?void 0:n.productCatalogPrices)||[],loading:l,error:a}};var Y=n(53588),X=n(14025);function ee(){let e=(0,F._)(["\n mutation UpdateProductCommerce(\n $productId: ID!\n $commerce: UpdateProductCommerceInput!\n ) {\n updateProductCommerce(productId: $productId, commerce: $commerce) {\n ...ProductDetailFragment\n }\n }\n ","\n"]);return ee=function(){return e},e}let et=(0,Q.J1)(ee(),X.A),en=()=>{let[e]=(0,Y.n)(et);return{updateProductCommerce:async t=>{let{productId:n,commerce:{pricing:l}}=t;return e({variables:{productId:n,commerce:{pricing:l}},refetchQueries:["Products"]})}}},el=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map(e=>({countryCode:e.country.isoCode,currencyCode:e.currency.isoCode,isTaxable:!!e.isTaxable,isNetPrice:!!e.isNetPrice,amount:e.amount,maxQuantity:e.maxQuantity}))},ea=e=>{var t;let{productId:n}=e,{formatMessage:a}=(0,i.A)(),{catalogPrices:s}=G({productId:n}),{hasRole:r}=(0,u.A)(),{updateProductCommerce:d}=en(),{countries:o}=(0,V.A)(),{currencies:c}=(0,R.A)(),m=null==o?void 0:o.find(e=>{let{isBase:t}=e;return t}),p=null==m?void 0:m.isoCode,x=null==m||null==(t=m.defaultCurrency)?void 0:t.isoCode,g=async e=>{let{pricing:t}=e;return await d({productId:n,commerce:{pricing:t}}),{success:!0}},f=a({id:"saved",defaultMessage:"Saved"}),h=(0,L.A)({submit:g,successMessage:f,enableReinitialize:!0,initialValues:{pricing:[...el(s)||[{maxQuantity:"",amount:null,isTaxable:!1,isNetPrice:!1,currencyCode:x,countryCode:p}]]}}),{values:v}=h.formik,{pricing:b}=v;return(0,l.jsxs)("div",{className:"flex flex-col ",children:[(0,l.jsx)("div",{className:"md:col-span-1",children:(0,l.jsxs)("div",{className:"px-4 sm:px-0",children:[(0,l.jsx)("h3",{className:"text-lg font-medium leading-6 text-slate-900 dark:text-slate-200",children:a({id:"texts",defaultMessage:"Texts"})}),(0,l.jsx)("p",{className:"mt-1 text-sm text-slate-600 dark:text-slate-200",children:a({id:"product_commerce_info",defaultMessage:"One price list should have a max quantity field empty and no price should have the same max quantity along with currency and country specified"})})]})}),(0,l.jsx)("div",{className:"mt-5 md:col-span-3 lg:mt-0",children:(0,l.jsx)(T.A,{children:(0,l.jsxs)(E.A,{className:"mt-3 rounded-md",form:h,children:[(0,l.jsxs)("div",{className:"relative max-w-full p-3 sm:p-5",children:[(0,l.jsx)("div",{className:"max-w-full justify-between align-baseline"}),(0,l.jsxs)("label",{className:"sr-only flex w-full font-sans text-sm text-black dark:text-slate-200 lg:not-sr-only",children:[(0,l.jsxs)("span",{className:"flex w-full",children:[(0,l.jsx)("span",{className:"w-full",children:a({id:"max_quantity",defaultMessage:"Max Quantity"})}),(0,l.jsx)("span",{className:"w-full",children:a({id:"price",defaultMessage:"Price"})})]}),(0,l.jsxs)("span",{className:"ml-3 flex w-full",children:[(0,l.jsx)("span",{className:"w-full",children:a({id:"vat_suspect",defaultMessage:"Vat Suspect"})}),(0,l.jsx)("span",{className:"w-full",children:a({id:"net_price",defaultMessage:"Net Price"})})]}),(0,l.jsxs)("span",{className:"mr-5 flex w-full",children:[(0,l.jsx)("span",{className:"ml-10 w-full",children:a({id:"country",defaultMessage:"Country"})}),(0,l.jsx)("span",{className:"w-full",children:a({id:"currency",defaultMessage:"Currency"})})]})]}),(0,l.jsx)($.ED,{name:"pricing",children:e=>{let{push:t,remove:n}=e;return(0,l.jsxs)("div",{children:[v.pricing.map((e,t)=>(0,l.jsxs)("div",{className:"relative max-w-full border-b py-3 align-baseline lg:flex",children:[(0,l.jsxs)("div",{className:"flex w-full gap-x-2",children:[(0,l.jsx)(O.A,{className:"w-full",validators:[(0,U.lw)(t,b),(0,U.IE)(b)],name:"pricing[".concat(t,"].maxQuantity"),id:"pricing[".concat(t,"].maxQuantity"),type:"number",min:0,hideLabel:!0,label:a({id:"max_quantity",defaultMessage:"Max Quantity"}),placeholder:a({id:"max_quantity",defaultMessage:"Max Quantity"})}),(0,l.jsx)(O.A,{type:"number",className:"w-full",name:"pricing[".concat(t,"].amount"),id:"pricing[".concat(t,"].amount"),required:!0,hideLabel:!0,label:a({id:"price",defaultMessage:"Price "}),placeholder:a({id:"price",defaultMessage:"Price"})})]}),(0,l.jsxs)("div",{className:"flex w-full gap-x-2 pt-3 pb-2",children:[(0,l.jsx)("div",{className:"w-full lg:ml-8 lg:items-center",children:(0,l.jsx)(D.A,{name:"pricing[".concat(t,"].isTaxable"),labelClassName:"lg:sr-only items-center ",label:a({id:"vat_suspect",defaultMessage:"Vat Suspect"}),className:"mr-2 h-4 w-4 rounded-sm border-slate-300 text-indigo-600 focus:ring-indigo-400 lg:items-center",type:"checkbox"})}),(0,l.jsx)("div",{className:"w-full lg:ml-8",children:(0,l.jsx)(D.A,{name:"pricing[".concat(t,"].isNetPrice"),labelClassName:"lg:sr-only items-center",label:a({id:"net_price",defaultMessage:"Net Price"}),hideLabel:!0,className:"mr-2 h-4 w-4 justify-between rounded-sm border-slate-300 text-indigo-600 focus:ring-indigo-400 lg:items-center",type:"checkbox"})})]}),(0,l.jsxs)("div",{className:"flex w-full gap-x-2",children:[(0,l.jsx)(J.A,{defaultValue:p,className:"w-full lg:ml-4 lg:mr-4",label:a({id:"country",defaultMessage:"Country"}),name:"pricing[".concat(t,"].countryCode"),id:"pricing[".concat(t,"].countryCode"),required:!0,options:(0,S.A)(o,"isoCode","isoCode"),hideLabel:!0}),(0,l.jsx)(J.A,{defaultValue:x,className:"w-full lg:mr-8 ",label:a({id:"currency",defaultMessage:"Currency"}),name:"pricing[".concat(t,"].currencyCode"),id:"pricing[".concat(t,"].currencyCode"),required:!0,options:(0,S.A)(c,"isoCode","isoCode"),hideLabel:!0,placeholder:a({id:"country_currency",defaultMessage:"Currency"})})]}),(0,l.jsx)("div",{className:"absolute top-0 right-0 mt-0 mr-0 shrink-0 pb-1 md:mr-0 lg:mt-6 lg:py-0 lg:px-0 ",children:(0,l.jsx)("button",{className:"items-center rounded-full bg-white px-1 py-1 text-sm text-red-500 hover:bg-red-50 focus:outline-hidden focus:ring-0 focus:ring-red-500 focus:ring-offset-2",type:"button",onClick:()=>n(t),children:(0,l.jsxs)("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,l.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,l.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),(0,l.jsx)("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),(0,l.jsx)("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})})})]},t)),(0,l.jsxs)("div",{className:"mt-2 flex flex-wrap items-center justify-between sm:flex-nowrap",children:[(0,l.jsx)("div",{className:" "}),(0,l.jsx)("div",{className:"mt-2 shrink-0",children:(0,l.jsx)("div",{className:"shrink-0",children:(0,l.jsx)("button",{type:"button",className:"items-right inline-flex rounded-full border border-transparent bg-indigo-500 px-2 py-2 text-sm font-medium text-white shadow-xs hover:bg-indigo-700 focus:outline-hidden focus:ring-2 focus:ring-indigo-400 focus:ring-offset-2",onClick:()=>t({maxQuantity:"",amount:null,isTaxable:!1,isNetPrice:!1,currencyCode:x,countryCode:p}),children:(0,l.jsx)("svg",{className:"h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:(0,l.jsx)("path",{fillRule:"evenodd",d:"M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z",clipRule:"evenodd"})})})})})]})]})}})]}),(0,l.jsx)(q.A,{displayFieldErrors:!0}),(0,l.jsx)("div",{className:"border-t-indigo-50 border-t dark:border-slate-700 space-y-6 bg-slate-50 dark:bg-slate-800 px-5 py-6 text-right",children:(0,l.jsx)(B.A,{hidden:!r("editProductCommerce"),label:a({id:"save",defaultMessage:"Save"})})})]})})})]})};var es=n(93171),ei=n(93192);function er(){let e=(0,F._)(["\n query TranslatedProductTexts($productId: ID!) {\n translatedProductTexts(productId: $productId) {\n ...ProductTextsFragment\n ","\n }\n }\n ","\n"]);return er=function(){return e},e}let ed=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,Q.J1)(er(),e,ei.A)},eu=e=>{let{productId:t}=e,{customProperties:n}=(0,es.A)(),{data:l,loading:a,error:s}=(0,W.IT)(ed(null==n?void 0:n.ProductTexts),{skip:!t,variables:{productId:t}});return{translatedTexts:(null==l?void 0:l.translatedProductTexts)||[],loading:a,error:s}};function eo(){let e=(0,F._)(["\n mutation UpdateProductTexts($productId: ID!, $texts: [ProductTextInput!]!) {\n updateProductTexts(productId: $productId, texts: $texts) {\n ...ProductTextsFragment\n }\n }\n ","\n"]);return eo=function(){return e},e}let ec=(0,Q.J1)(eo(),ei.A),em=()=>{let[e]=(0,Y.n)(ec);return{updateProductTexts:async t=>{let{productId:n,texts:l}=t;return e({variables:{productId:n,texts:l},refetchQueries:["Product"]})}}};var ep=n(65146),ex=n(25449),eg=n(14634);let ef=e=>{let{productId:t,selectedLocale:n=null}=e,{formatMessage:a}=(0,i.A)(),{hasRole:s}=(0,u.A)(),{translatedTexts:d}=eu({productId:t}),o=a({id:"saved",defaultMessage:"Saved"}),{updateProductTexts:c}=em(),m=async e=>{let{slug:l,title:a,subtitle:s,vendor:i,description:r,brand:d,labels:u}=e;return await c({productId:t,texts:[{locale:n,slug:l,title:a,subtitle:s,vendor:i,description:r,brand:d,labels:u}]}),{success:!0}},p=(0,L.A)({submit:m,successMessage:o,initialValues:{slug:"",title:"",subtitle:"",vendor:"",description:"",brand:"",labels:[]}});return(0,y.useEffect)(()=>{let e=null==d?void 0:d.find(e=>e.locale===n);e&&p.formik.setValues(e)},[d,n]),(0,l.jsx)(ep.A,{documentationLabel:a({id:"texts",defaultMessage:"Texts"}),className:"mt-2 sm:mt-0",documentation:(0,l.jsx)(r.A,{id:"product_text_form_description",defaultMessage:"<ul> <li>A Slug is the unique identifying part of a web address, typically at the end of the URL. </li> <li> You can change the language of text by using the localization dropdown found at top right corner </li> <li> Description area accepts text that are compatible with markdown or HTML. Tip: in order to add a line break use \\ </li> </ul>",values:{ul:e=>(0,l.jsxs)("ul",{className:"list-disc list-inside",children:[e," "]}),li:e=>(0,l.jsxs)("li",{children:[e," "]})}}),children:(0,l.jsx)(T.A,{children:(0,l.jsxs)(E.A,{form:p,children:[(0,l.jsxs)("div",{className:"relative text-slate-500 dark:text-slate-200 px-4 py-5 sm:p-6",children:[(0,l.jsxs)("div",{className:"grid grid-cols-6 gap-6",children:[(0,l.jsx)("div",{className:"col-span-6 sm:col-span-3",children:(0,l.jsx)(O.A,{name:"slug",required:!0,id:"slug",label:a({id:"slug",defaultMessage:"Slug"}),autoComplete:"on",className:"text-sm font-medium"})}),(0,l.jsx)("div",{className:"col-span-6 sm:col-span-3",children:(0,l.jsx)(O.A,{name:"title",required:!0,id:"title",label:a({id:"title",defaultMessage:"Title"}),autoComplete:"on",className:"text-sm font-medium"})}),(0,l.jsx)("div",{className:"col-span-6 sm:col-span-3",children:(0,l.jsx)(O.A,{name:"subtitle",id:"subtitle",label:a({id:"subtitle",defaultMessage:"Subtitle"}),autoComplete:"on",className:"text-sm font-medium"})}),(0,l.jsx)("div",{className:"col-span-6 sm:col-span-3",children:(0,l.jsx)(O.A,{name:"vendor",id:"vendor",label:a({id:"vendor",defaultMessage:"Vendor"}),autoComplete:"on",className:"text-sm font-medium"})}),(0,l.jsx)("div",{className:"col-span-6 sm:col-span-3",children:(0,l.jsx)(O.A,{name:"brand",id:"brand",label:a({id:"brand",defaultMessage:"Brand"}),autoComplete:"on",className:"text-sm font-medium"})}),(0,l.jsx)("div",{className:"col-span-6 sm:col-span-3",children:(0,l.jsx)(eg.A,{name:"labels",id:"labels",label:a({id:"labels",defaultMessage:"Labels"}),buttonText:a({id:"add",defaultMessage:"Add"}),autoComplete:"on",className:"text-sm font-medium"})})]}),(0,l.jsx)("div",{className:"col-span-6 mt-6 sm:col-span-3",children:(0,l.jsx)(ex.A,{name:"description",id:"description",label:a({id:"description",defaultMessage:"Description"})})})]}),(0,l.jsx)("div",{className:"border-t-indigo-50 border-t dark:border-t-slate-700 bg-slate-50 dark:bg-slate-800 px-4 py-5 text-right sm:px-6",children:(0,l.jsx)(B.A,{hidden:!s("editProductTexts"),label:a({id:"save",defaultMessage:"Save"})})})]})})})};var eh=n(14664),ev=n(54287),eb=n(70420),ej=n(86974),ey=n(39892);function ew(){let e=(0,F._)(["\n mutation PrepareProductMediaUpload($mediaName: String!, $productId: ID!) {\n prepareProductMediaUpload(mediaName: $mediaName, productId: $productId) {\n _id\n putURL\n expires\n }\n }\n"]);return ew=function(){return e},e}let eI=(0,Q.J1)(ew()),e_=()=>{let[e]=(0,Y.n)(eI),{confirmMediaUpload:t}=(0,ey.A)({refetchQueries:["Product"]});return{addProductMedia:async n=>{let{productId:l,media:a}=n,{data:s}=await e({variables:{productId:l,mediaName:a.name}}),{prepareProductMediaUpload:i}=s;return await (0,ej.A)(a,i.putURL),t({mediaUploadTicketId:i._id,size:null==a?void 0:a.size,type:a.type})}}};var eA=n(66985);function eN(){let e=(0,F._)(["\n fragment ProductMediaFragment on ProductMedia {\n _id\n tags\n file {\n _id\n name\n type\n size\n url\n }\n sortKey\n texts {\n _id\n locale\n title\n subtitle\n }\n }\n"]);return eN=function(){return e},e}let eP=(0,Q.J1)(eN());function eM(){let e=(0,F._)(["\n query ProductMedia($productId: ID, $slug: String) {\n product(productId: $productId, slug: $slug) {\n _id\n media {\n ...ProductMediaFragment\n }\n }\n }\n ","\n"]);return eM=function(){return e},e}let ek=(0,Q.J1)(eM(),eP),eC=function(){var e;let{productId:t=null,slug:n=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=(0,eA.id)(n),{data:a,loading:s,error:i}=(0,W.IT)(ek,{skip:!t&&!l,variables:{productId:t||l}});return{productMedia:(null==a||null==(e=a.product)?void 0:e.media)||[],loading:s,error:i}};function e$(){let e=(0,F._)(["\n mutation RemoveProductMedia($productMediaId: ID!) {\n removeProductMedia(productMediaId: $productMediaId) {\n _id\n }\n }\n"]);return e$=function(){return e},e}let eT=(0,Q.J1)(e$()),eS=()=>{let[e]=(0,Y.n)(eT);return{removeProductMedia:async t=>{let{productMediaId:n}=t;return e({variables:{productMediaId:n},refetchQueries:["ProductMedia"]})}}};var eV=n(28107),eR=n(23342);function eD(){let e=(0,F._)(["\n fragment ProductMediaTextsFragment on ProductMediaTexts {\n _id\n locale\n title\n subtitle\n }\n"]);return eD=function(){return e},e}let eE=(0,Q.J1)(eD());function eq(){let e=(0,F._)(["\n query TranslatedProductMediaTexts($productMediaId: ID!) {\n translatedProductMediaTexts(productMediaId: $productMediaId) {\n ...ProductMediaTextsFragment\n }\n }\n ","\n"]);return eq=function(){return e},e}let eJ=(0,Q.J1)(eq(),eE),eB=e=>{let{productMediaId:t}=e,{data:n,loading:l,error:a}=(0,W.IT)(eJ,{skip:!t,variables:{productMediaId:t}});return{translatedMediaTexts:(null==n?void 0:n.translatedProductMediaTexts)||[],loading:l,error:a}};function eO(){let e=(0,F._)(["\n mutation UpdateProductMediaTexts(\n $productMediaId: ID!\n $texts: [ProductMediaTextInput!]!\n ) {\n updateProductMediaTexts(productMediaId: $productMediaId, texts: $texts) {\n ...ProductMediaTextsFragment\n }\n }\n ","\n"]);return eO=function(){return e},e}let eL=(0,Q.J1)(eO(),eE),eU=()=>{let[e]=(0,Y.n)(eL);return{updateProductMediaTexts:async t=>{let{productMediaId:n,texts:l}=t;return e({variables:{productMediaId:n,texts:l},refetchQueries:["TranslatedProductMediaTexts"]})}}},eF=e=>{let{media:t,onDelete:n,locale:a,id:s}=e,{updateProductMediaTexts:i}=eU(),[r,d]=(0,y.useState)(!1),{translatedMediaTexts:u}=eB({productMediaId:t._id}),o=(null==u?void 0:u.find(e=>e.locale===a))||{},c=async e=>{let{title:n,subtitle:l}=e;return await i({productMediaId:t._id,texts:[{title:n,locale:a,subtitle:l}]}),d(!1),!0};return(0,l.jsx)(eR.A,{id:s,media:t,mediaText:o,isEdit:r,onDelete:n,onEdit:d,onUpdate:c})},eQ=e=>{let{medias:t,selectedLocale:n,onDeleteMedia:a,items:s}=e,{formatMessage:r}=(0,i.A)();return(0,l.jsx)("div",{className:"rounded-md shadow-sm dark:shadow-none lg:col-span-6 px-6 lg:px-0",children:(0,l.jsxs)("div",{className:"mx-auto max-w-7xl overflow-hidden",children:[(0,l.jsx)("h2",{className:"sr-only",children:r({id:"product_media",defaultMessage:"Product Media"})}),(0,l.jsx)("div",{className:"flow-root dark:bg-slate-800",children:(0,l.jsx)(ev.gB,{items:s,strategy:ev._G,children:(0,l.jsx)("ul",{className:"space-y-4 p-5 rounded-md transition-[background-color] ease-in-out delay-200 ",children:(null==t?void 0:t.length)?s.map(e=>{let s=Object.values(t).find(t=>t._id===e);return(0,l.jsx)(eF,{id:e,media:s,locale:n,onDelete:a},s._id)}):(0,l.jsx)(eV.A,{message:r({id:"media",defaultMessage:"Media"})})})})})]})})};function eW(){let e=(0,F._)(["\n mutation ReOrderProductMedia($sortKeys: [ReorderProductMediaInput!]!) {\n reorderProductMedia(sortKeys: $sortKeys) {\n _id\n }\n }\n"]);return eW=function(){return e},e}let ez=(0,Q.J1)(eW()),eZ=()=>{let[e]=(0,Y.n)(ez);return{reOrderProductMedia:async t=>{let{sortKeys:n}=t;return e({variables:{sortKeys:n},refetchQueries:["ProductMedia"]})}}},eH=e=>{let{productId:t,selectedLocale:n=null}=e,{productMedia:a}=eC({productId:t}),{setModal:s}=(0,h.A)(),{formatMessage:r}=(0,i.A)(),{removeProductMedia:u}=eS(),{addProductMedia:o}=e_(),{reOrderProductMedia:c}=eZ(),m=null==a?void 0:a.map(e=>e._id),p=async e=>{try{await o({productId:t,media:e}),d.oR.success(r({id:"product_media_upload",defaultMessage:"Media uploaded successfully"}))}catch(e){d.oR.error(r({id:"fail_upload",defaultMessage:"Media upload failed"}))}},x=async e=>{await s((0,l.jsx)(f.A,{onCancelClick:async()=>s(""),message:r({id:"delete_product_media_confirmation",defaultMessage:"This action might cause inconsistencies with other data that relates to it. Are you sure you want to delete this media? "}),onOkClick:async()=>{s(""),await u({productMediaId:e}),d.oR.success(r({id:"product_media_deleted",defaultMessage:"Media deleted successfully"}))},okText:r({id:"delete_product_media",defaultMessage:"Delete media"})}))},g=async e=>{let{active:t,over:n}=e;if(t.id!==n.id){let e=m.indexOf(t.id),l=m.indexOf(n.id),a=(0,ev.be)(m,e,l).map((e,t)=>({productMediaId:e,sortKey:t}));try{await c({sortKeys:a}),d.oR.success(r({id:"link_reorder",defaultMessage:"Link reorder successfully"}))}catch(e){d.oR.error(r({id:"fail_reorder",defaultMessage:"Reordering failed, Try again!"}))}}else d.oR.info(r({id:"reorder_original",defaultMessage:"Reorder to original location"}))},v=(0,eh.FR)((0,eh.MS)(eh.AN,{activationConstraint:{distance:5}}),(0,eh.MS)(eh.uN,{coordinateGetter:ev.JR}));return(0,l.jsxs)("div",{className:"mx-auto mt-5 space-y-5 lg:space-y-0 max-w-full bg-white dark:bg-slate-900 py-6 shadow-sm dark:shadow-none lg:grid lg:grid-cols-12 lg:gap-4 lg:rounded-sm",children:[(0,l.jsx)("div",{className:"mx-auto w-full px-6 lg:col-span-6 lg:col-start-1",children:(0,l.jsx)(eb.A,{onlyDragAndDrop:!0,addMedia:p})}),(0,l.jsx)(eh.Mp,{sensors:v,collisionDetection:eh.fp,onDragEnd:g,children:(0,l.jsx)(eQ,{medias:a,selectedLocale:n,onDeleteMedia:x,items:m})})]})};function eK(){let e=(0,F._)(["\n fragment ProductPlanConfigurationFragment on ProductPlanConfiguration {\n usageCalculationType\n billingInterval\n trialInterval\n trialIntervalCount\n billingIntervalCount\n }\n"]);return eK=function(){return e},e}let eG=(0,Q.J1)(eK());function eY(){let e=(0,F._)(["\n query ProductPlan($productId: ID, $slug: String) {\n product(productId: $productId, slug: $slug) {\n _id\n ... on PlanProduct {\n plan {\n ...ProductPlanConfigurationFragment\n }\n }\n }\n }\n ","\n"]);return eY=function(){return e},e}let eX=(0,Q.J1)(eY(),eG),e0=function(){let{productId:e=null,slug:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(0,eA.id)(t),{data:l,loading:a,error:s}=(0,W.IT)(eX,{skip:!e&&!n,variables:{productId:e||n}}),i=null==l?void 0:l.product;return{plan:null==i?void 0:i.plan,loading:a,error:s}};function e1(){let e=(0,F._)(['\n query ProductPlanConfigurationOptions {\n usageCalculationTypes: __type(name: "ProductPlanUsageCalculationType") {\n options: enumValues {\n value: name\n label: description\n }\n }\n configurationIntervals: __type(name: "ProductPlanConfigurationInterval") {\n options: enumValues {\n value: name\n label: description\n }\n }\n }\n']);return e1=function(){return e},e}let e5=(0,Q.J1)(e1()),e2=()=>{var e,t;let{data:n,loading:l,error:a}=(0,W.IT)(e5),s=(null==n||null==(e=n.usageCalculationTypes)?void 0:e.options)||[];return{configurationIntervals:(null==n||null==(t=n.configurationIntervals)?void 0:t.options)||[],usageCalculationTypes:s,loading:l,error:a}};function e4(){let e=(0,F._)(["\n mutation UpdateProductPlan($productId: ID!, $plan: UpdateProductPlanInput!) {\n updateProductPlan(productId: $productId, plan: $plan) {\n _id\n }\n }\n"]);return e4=function(){return e},e}let e7=(0,Q.J1)(e4()),e3=()=>{let[e]=(0,Y.n)(e7);return{updateProductPlan:async t=>{let{productId:n,plan:{usageCalculationType:l,billingInterval:a,billingIntervalCount:s=null,trialInterval:i=null,trialIntervalCount:r=null}}=t;return e({variables:{productId:n,plan:{usageCalculationType:l,billingInterval:a,billingIntervalCount:s,trialInterval:i,trialIntervalCount:r}},refetchQueries:["Products"]})}}},e6=e=>{let{productId:t}=e,{formatMessage:n}=(0,i.A)(),{configurationIntervals:a,usageCalculationTypes:s}=e2(),{plan:d,loading:o}=e0({productId:t}),{hasRole:c}=(0,u.A)(),{updateProductPlan:m}=e3(),p=n({id:"enrollment_updated_successfully",defaultMessage:"Enrollment saved successfully"}),x=async e=>{let{trialInterval:n,trialIntervalCount:l,billingInterval:a,billingIntervalCount:s,usageCalculationType:i}=e;return await m({productId:t,plan:{billingInterval:a,usageCalculationType:i,billingIntervalCount:s,trialInterval:n,trialIntervalCount:l}}),{success:!0}},g=(0,L.A)({submit:x,successMessage:p,initialValues:{trialInterval:"",trialIntervalCount:"",billingInterval:"",billingIntervalCount:"",usageCalculationType:""},getSubmitErrorMessage:e=>{var t;return(null==e||null==(t=e.message)?void 0:t.includes("Status of the product does not allow this operation"))?n({id:"subscription_product_type_not_valid",defaultMessage:"Status of the product does not allow this operation"}):(null==e?void 0:e.message)||""}});return(0,y.useEffect)(()=>{d&&!o&&g.formik.setValues(d)},[d]),(0,l.jsx)(ep.A,{documentationLabel:n({id:"subscription",defaultMessage:"Subscription"}),className:"mt-2 sm:mt-0",documentation:(0,l.jsx)(r.A,{id:"product_subscription_form_description",defaultMessage:"<ul><li> Information that will be used to calculate price of a subscription based product </li> <li>The price specified in commerce section will be used when calculating fees on each interval. </li> <li>Price will not be included for the specified trial period </li> </ul>",values:{ul:e=>(0,l.jsxs)("ul",{className:"list-disc list-inside",children:[e," "]}),li:e=>(0,l.jsx)("li",{children:e})}}),children:(0,l.jsx)(T.A,{children:(0,l.jsx)(E.A,{form:g,children:(0,l.jsxs)("div",{className:"relative max-w-full space-y-6 rounded-md sm:p-6",children:[(0,l.jsx)(J.A,{required:!0,className:"mt-2.5 w-full py-1.5 text-sm font-medium text-slate-500",label:n({id:"usage_calculation_type",defaultMessage:"Usage calculation type"}),placeholder:n({id:"usage_calculation_type",defaultMessage:"Usage calculation type"}),name:"usageCalculationType",options:(0,S.A)(s,"value","value")}),(0,l.jsxs)("div",{className:"w-full items-end justify-end sm:flex",children:[(0,l.jsx)(J.A,{className:"mt-2.5 w-full text-sm font-medium text-slate-500",required:!0,label:n({id:"billing_interval_unit",defaultMessage:"Billing interval unit"}),placeholder:n({id:"billing_interval_unit",defaultMessage:"Billing interval unit"}),name:"billingInterval",options:(0,S.A)(a,"value","value")}),(0,l.jsx)(O.A,{name:"billingIntervalCount",id:"billing_unit",type:"number",required:!0,label:n({id:"billing_unit",defaultMessage:"Billing Unit"}),placeholder:n({id:"billing_unit",defaultMessage:"Billing Unit"}),className:"mt-1 w-full text-sm font-medium text-slate-500 sm:ml-1"})]}),(0,l.jsxs)("div",{className:"max-w-full items-end justify-end sm:flex",children:[(0,l.jsx)(J.A,{className:"mt-2.5 w-full text-sm font-medium text-slate-500",label:n({id:"trial_interval_unit",defaultMessage:"Trial interval unit"}),placeholder:n({id:"trial_interval_unit",defaultMessage:"Trial interval unit"}),name:"trialInterval",options:(0,S.A)(a,"value","value")}),(0,l.jsx)(O.A,{type:"number",name:"trialIntervalCount",id:"trialIntervalCount ",label:n({id:"trial_unit",defaultMessage:"Trial Unit"}),placeholder:n({id:"trial_unit",defaultMessage:"Trial Unit"}),required:!0,className:"mt-1 w-full text-sm font-medium text-slate-500 sm:ml-1"})]}),(0,l.jsx)("div",{className:"border-t-indigo-50 border-t space-y-6 bg-slate-50 dark:bg-slate-500 text-right sm:p-6",children:(0,l.jsx)(B.A,{hidden:!c("addEnrollment"),label:n({id:"save",defaultMessage:"Save"})})})]})})})})};function e8(){let e=(0,F._)(["\n fragment ProductDimensionFragment on Dimensions {\n weight(unit: GRAM)\n length(unit: MILLIMETERS)\n width(unit: MILLIMETERS)\n height(unit: MILLIMETERS)\n }\n"]);return e8=function(){return e},e}let e9=(0,Q.J1)(e8());function te(){let e=(0,F._)(["\n query ProductSupply($productId: ID, $slug: String) {\n product(productId: $productId, slug: $slug) {\n _id\n ... on SimpleProduct {\n dimensions {\n ...ProductDimensionFragment\n }\n }\n }\n }\n ","\n"]);return te=function(){return e},e}let tt=(0,Q.J1)(te(),e9),tn=function(){let{productId:e=null,slug:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(0,eA.id)(t),{data:l,loading:a,error:s}=(0,W.IT)(tt,{skip:!e&&!t,variables:{productId:e||n}}),i=null==l?void 0:l.product;return{dimensions:(null==i?void 0:i.dimensions)||{},loading:a,error:s}};function tl(){let e=(0,F._)(["\n mutation UpdateProductSupply(\n $productId: ID!\n $supply: UpdateProductSupplyInput!\n ) {\n updateProductSupply(productId: $productId, supply: $supply) {\n _id\n ... on SimpleProduct {\n dimensions {\n ...ProductDimensionFragment\n }\n }\n }\n }\n ","\n"]);return tl=function(){return e},e}let ta=(0,Q.J1)(tl(),e9),ts=()=>{let[e]=(0,Y.n)(ta);return{updateProductSupply:async t=>{let{productId:n,supply:{weightInGram:l=null,heightInMillimeters:a=null,lengthInMillimeters:s=null,widthInMillimeters:i=null}}=t;return e({variables:{productId:n,supply:{weightInGram:l||null,heightInMillimeters:a||null,lengthInMillimeters:s||null,widthInMillimeters:i||null}},refetchQueries:["Products"]})}}},ti=e=>{let{productId:t}=e,{formatMessage:n}=(0,i.A)(),a=n({id:"saved",defaultMessage:"Saved"}),{hasRole:s}=(0,u.A)(),{updateProductSupply:d}=ts(),{dimensions:o}=tn({productId:t}),c=async e=>{let{weight:n,length:l,width:a,height:s}=e;return await d({productId:t,supply:{weightInGram:n,lengthInMillimeters:l,heightInMillimeters:s,widthInMillimeters:a}}),{success:!0}},m=(0,L.A)({submit:c,getSubmitErrorMessage:e=>(e.message.includes("supply.weightInGram")&&e.message.includes("Expected type Int")?m.formik.setFieldError("weight","Invalid value, only integer is accepted"):e.message.includes("supply.heightInMillimeters")&&e.message.includes("Expected type Int")?m.formik.setFieldError("height","Invalid value, only integer is accepted"):e.message.includes("supply.lengthInMillimeters")&&e.message.includes("Expected type Int")&&m.formik.setFieldError("length","Invalid value, only integer is accepted"),null),successMessage:a,initialValues:{weight:"",length:"",width:"",height:""}});return(0,y.useEffect)(()=>{Object.keys(o).length&&m.formik.setValues(o)},[o]),(0,l.jsx)(ep.A,{documentationLabel:n({id:"supply",defaultMessage:"Supply"}),className:"mt-2 sm:mt-0",documentation:(0,l.jsx)(r.A,{id:"product_supply_form_description",defaultMessage:"<ul><li> Information that will be used to identify dimensions of a product </li> </ul>",values:{ul:e=>(0,l.jsxs)("ul",{className:"list-disc list-inside",children:[e," "]}),li:e=>(0,l.jsxs)("li",{children:[e," "]})}}),children:(0,l.jsx)(T.A,{children:(0,l.jsxs)(E.A,{form:m,children:[(0,l.jsx)("div",{className:"relative px-4 py-5 sm:p-6",children:(0,l.jsxs)("div",{className:"grid grid-cols-6 gap-6",children:[(0,l.jsx)("div",{className:"col-span-6 sm:col-span-3",children:(0,l.jsx)(O.A,{validators:[(0,U.L6)()],type:"number",name:"weight",id:"weight",label:n({id:"weight_gram",defaultMessage:"Weight (Gram)"}),className:"text-sm font-medium"})}),(0,l.jsx)("div",{className:"col-span-6 sm:col-span-3",children:(0,l.jsx)(O.A,{validators:[(0,U.L6)()],name:"length",id:"length",type:"number",label:n({id:"length_millimeter",defaultMessage:"Length (Millimeter)"}),className:"text-sm font-medium"})}),(0,l.jsx)("div",{className:"col-span-6 sm:col-span-3",children:(0,l.jsx)(O.A,{validators:[(0,U.L6)()],type:"number",name:"width",id:"width ",label:n({id:"width",defaultMessage:"Width (Millimeter)"}),className:"text-sm font-medium"})}),(0,l.jsx)("div",{className:"col-span-6 sm:col-span-3",children:(0,l.jsx)(O.A,{validators:[(0,U.L6)()],name:"height",type:"number",id:"height",label:n({id:"height",defaultMessage:"Height (Millimeter)"}),className:"text-sm font-medium"})})]})}),(0,l.jsx)("div",{className:"border-t-indigo-50 border-t dark:border-t-slate-700 space-y-6 bg-slate-50 dark:bg-slate-800 text-right sm:p-6",children:(0,l.jsx)(B.A,{hidden:!s("editProductSupply"),label:n({id:"save",defaultMessage:"Save"}),full:!0})})]})})})};function tr(){let e=(0,F._)(["\n mutation CreateProductVariation(\n $productId: ID!\n $variation: CreateProductVariationInput!\n $texts: [ProductVariationTextInput!]\n ) {\n createProductVariation(\n productId: $productId\n variation: $variation\n texts: $texts\n ) {\n _id\n }\n }\n"]);return tr=function(){return e},e}let td=(0,Q.J1)(tr()),tu=()=>{let[e]=(0,Y.n)(td);return{createProductVariation:async t=>{let{productId:n,variation:{key:l,type:a},texts:s}=t;return e({variables:{productId:n,variation:{key:l,type:a},texts:s},refetchQueries:["ProductVariations"]})}}};function to(){let e=(0,F._)(["\n fragment ProductVariationFragment on ProductVariation {\n _id\n type\n key\n texts {\n _id\n locale\n title\n subtitle\n }\n options {\n _id\n texts {\n _id\n locale\n title\n subtitle\n }\n value\n }\n }\n"]);return to=function(){return e},e}let tc=(0,Q.J1)(to());function tm(){let e=(0,F._)(["\n query ProductVariations($productId: ID, $slug: String) {\n product(productId: $productId, slug: $slug) {\n _id\n ... on ConfigurableProduct {\n variations {\n ...ProductVariationFragment\n }\n }\n }\n }\n ","\n"]);return tm=function(){return e},e}let tp=(0,Q.J1)(tm(),tc),tx=function(){let{productId:e=null,slug:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(0,eA.id)(t),{data:l,loading:a,error:s}=(0,W.IT)(tp,{skip:!e&&!n,variables:{productId:e||n}}),i=null==l?void 0:l.product;return{variations:null==i?void 0:i.variations,loading:a,error:s}};function tg(){let e=(0,F._)(['\n query ProductVariationType {\n variationTypes: __type(name: "ProductVariationType") {\n options: enumValues {\n value: name\n label: description\n }\n }\n }\n']);return tg=function(){return e},e}let tf=(0,Q.J1)(tg()),th=()=>{var e;let{data:t,loading:n,error:l}=(0,W.IT)(tf);return{variationTypes:(null==t||null==(e=t.variationTypes)?void 0:e.options)||[],loading:n,error:l}},tv=e=>{let{onSubmit:t}=e,{formatMessage:n}=(0,i.A)(),{variationTypes:a}=th(),{hasRole:s}=(0,u.A)(),r=n({id:"product_variation_added",defaultMessage:"Product variation added successfully"}),d=(0,L.A)({submit:t,successMessage:r,initialValues:{title:"",key:"",type:""}});return(0,l.jsx)(T.A,{children:(0,l.jsxs)(E.A,{form:d,children:[(0,l.jsxs)("div",{className:"max-w-full space-y-6 rounded-md p-4 sm:p-6",children:[(0,l.jsxs)("div",{className:"max-w-full",children:[(0,l.jsx)(O.A,{name:"title",id:"title",label:n({id:"title",defaultMessage:"Title"}),required:!0,autoComplete:"on",className:"mt-1 w-full py-2 text-sm font-medium text-slate-500 dark:text-slate-200"}),(0,l.jsx)(O.A,{name:"key",id:"key ",label:n({id:"key",defaultMessage:"Key"}),required:!0,autoComplete:"on",className:"mt-1 w-full py-2 text-sm font-medium text-slate-500 dark:text-slate-200"})]}),(0,l.jsx)(J.A,{required:!0,className:"mt-2.5 w-full py-1.5 text-sm font-medium text-slate-500 dark:text-slate-200",label:n({id:"type",defaultMessage:"Type"}),placeholder:n({id:"type",defaultMessage:"Type"}),name:"type",options:(0,S.A)(a,"value","value")})]}),(0,l.jsx)("div",{className:"space-y-6 bg-slate-50 dark:bg-slate-700 px-5 py-6 text-right",children:(0,l.jsx)(B.A,{hidden:!s("addProductVariation"),label:n({id:"save",defaultMessage:"Save"})})})]})})};var tb=n(7207);function tj(){let e=(0,F._)(["\n mutation RemoveProductVariation($productVariationId: ID!) {\n removeProductVariation(productVariationId: $productVariationId) {\n _id\n }\n }\n"]);return tj=function(){return e},e}let ty=(0,Q.J1)(tj()),tw=()=>{let[e]=(0,Y.n)(ty);return{removeProductVariation:async t=>{let{productVariationId:n}=t;return e({variables:{productVariationId:n},refetchQueries:["ProductVariations"]})}}};var tI=n(15039),t_=n.n(tI),tA=n(99583),tN=n(29639),tP=n(78801);function tM(){let e=(0,F._)(["\n mutation UpdateProductVariationTexts(\n $productVariationId: ID!\n $productVariationOptionValue: String\n $texts: [ProductVariationTextInput!]!\n ) {\n updateProductVariationTexts(\n productVariationId: $productVariationId\n productVariationOptionValue: $productVariationOptionValue\n texts: $texts\n ) {\n _id\n }\n }\n"]);return tM=function(){return e},e}let tk=(0,Q.J1)(tM()),tC=()=>{let[e]=(0,Y.n)(tk);return{updateProductVariationTexts:async t=>{let{productVariationId:n,productVariationOptionValue:l,texts:a}=t;return e({variables:{productVariationId:n,productVariationOptionValue:l,texts:a},refetchQueries:["ProductVariations"]})}}},t$=e=>{var t,n,a,s;let{type:r,variation:d,selectedLocale:u,onDelete:o}=e,{updateProductVariationTexts:c}=tC(),[m,p]=(0,y.useState)(!1),{formatMessage:x}=(0,i.A)(),g=async e=>{let{title:t,subtitle:n}=e;return await c({productVariationId:d._id,texts:[{title:t,subtitle:n,locale:u}]}),{success:!0}},f=(0,L.A)({submit:g,initialValues:{title:null==d||null==(t=d.texts)?void 0:t.title,subtitle:null==d||null==(n=d.texts)?void 0:n.subtitle}});return(0,l.jsx)(E.A,{form:f,className:"variation-update-form","data-variationid":d._id,children:(0,l.jsx)("div",{className:"flow-root ",children:(0,l.jsx)("li",{className:"list-none",children:(0,l.jsxs)("div",{className:"grid grid-cols-8 items-center justify-items-start ",tabIndex:-1,children:[(0,l.jsxs)("div",{className:"col-span-2 flex flex-col text-left ",children:[(0,l.jsx)("div",{children:(0,l.jsx)(tA.A,{text:r,square:!0,color:"cyan",className:"justify-start"})}),(0,l.jsx)("div",{className:"mt-1 font-bold",children:null==d?void 0:d.key})]}),(0,l.jsxs)("div",{className:t_()("col-span-6 flex w-full items-center justify-between",{"flex-col":m}),children:[(0,l.jsxs)("div",{className:"space-y-1",onClick:e=>{e.stopPropagation(),e.preventDefault()},onKeyUp:e=>{e.stopPropagation(),e.preventDefault()},children:[(0,l.jsx)("p",{className:"truncate text-sm font-medium text-slate-900 dark:text-slate-200",children:m?(0,l.jsx)(O.A,{className:"mt-0 py-1",name:"title",required:!0,label:x({id:"title",defaultMessage:"Title"})}):null==d||null==(a=d.texts)?void 0:a.title}),(0,l.jsx)("p",{className:"truncate text-sm font-normal text-slate-500 dark:text-slate-200",children:m?(0,l.jsx)(O.A,{className:"mt-0 py-1",name:"subtitle",label:x({id:"subtitle",defaultMessage:"Subtitle"})}):null==d||null==(s=d.texts)?void 0:s.subtitle})]}),(0,l.jsx)("div",{className:t_()("ml-auto",{"mx-auto":m}),onClick:e=>{e.stopPropagation(),e.preventDefault()},onKeyUp:e=>{e.stopPropagation(),e.preventDefault()},children:m?(0,l.jsxs)("div",{className:"flex space-x-2 py-2",children:[(0,l.jsx)("button",{onClick:()=>p(!m),type:"button",className:"rounded-md pl-2 pr-2 bg-white font-medium text-red-500 hover:text-red-600 focus:outline-hidden focus:ring-2 focus:ring-purple-500 focus:ring-offset-2",children:x({id:"cancel",defaultMessage:"Cancel"})}),(0,l.jsx)("span",{className:"text-slate-300","aria-hidden":"true",children:"|"}),(0,l.jsx)("button",{onClick:()=>{f.formik.submitForm(),p(!1)},type:"submit",className:"rounded-md pl-2 pr-2 bg-white font-medium text-indigo-600 hover:text-indigo-500 focus:outline-hidden focus:ring-2 focus:ring-purple-500 focus:ring-offset-2",children:x({id:"save",defaultMessage:"Save"})})]}):(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,l.jsx)("div",{onClick:()=>p(!m),children:(0,l.jsx)(tP.A,{})}),(0,l.jsx)(tN.A,{onClick:()=>o(d._id),className:"ml-1 mr-1 "})]})})]})]})})})})};function tT(){let e=(0,F._)(["\n mutation CreateProductVariationOption(\n $productVariationId: ID!\n $option: String!\n $texts: [ProductVariationTextInput!]\n ) {\n createProductVariationOption(\n productVariationId: $productVariationId\n option: $option\n texts: $texts\n ) {\n _id\n }\n }\n"]);return tT=function(){return e},e}let tS=(0,Q.J1)(tT()),tV=()=>{let[e]=(0,Y.n)(tS);return{createProductVariationOption:async t=>{let{productVariationId:n,option:l,texts:a}=t;return e({variables:{productVariationId:n,option:l,texts:a},refetchQueries:["ProductVariations","Product"]})}}};function tR(){let e=(0,F._)(["\n mutation RemoveProductVariationOption(\n $productVariationId: ID!\n $productVariationOptionValue: String!\n ) {\n removeProductVariationOption(\n productVariationId: $productVariationId\n productVariationOptionValue: $productVariationOptionValue\n ) {\n _id\n }\n }\n"]);return tR=function(){return e},e}let tD=(0,Q.J1)(tR()),tE=()=>{let[e]=(0,Y.n)(tD);return{removeProductVariationOption:async t=>{let{productVariationId:n,productVariationOptionValue:l}=t;return e({variables:{productVariationId:n,productVariationOptionValue:l},refetchQueries:["ProductVariations"]})}}},tq=e=>{let{onSubmit:t}=e,{formatMessage:n}=(0,i.A)(),{hasRole:a}=(0,u.A)(),s=n({id:"variation_option_added",defaultMessage:"Variation option added successfully!"}),r=(0,L.A)({submit:t,successMessage:s,initialValues:{value:"",title:""}});return(0,l.jsx)(E.A,{form:r,className:"variation-option-form",children:(0,l.jsxs)("div",{className:"mt-2 flex gap-2 px-2 pt-2 sm:px-4",children:[(0,l.jsx)(O.A,{className:"mt-0 shrink grow basis-1/3 py-1",name:"title",label:n({id:"title",defaultMessage:"Title"}),required:!0}),(0,l.jsx)(O.A,{className:"mt-0 shrink grow basis-1/3 py-1",name:"value",label:n({id:"value",defaultMessage:"Value"}),required:!0}),(0,l.jsx)("span",{className:"flex-auto self-end",children:(0,l.jsx)(B.A,{hidden:!a("addProductVariationOption"),className:"p-0",label:n({id:"add_option",defaultMessage:"Add option"})})})]})})},tJ=e=>{var t,n;let{option:a,onDelete:s,variationId:r,selectedLocale:d}=e,{formatMessage:u}=(0,i.A)(),[o,c]=(0,y.useState)(!1),m=u({id:"variation_option_updated",defaultMessage:"Variation option updated successfully!"}),{updateProductVariationTexts:p}=tC(),x=async e=>{let{title:t,subtitle:n}=e,l=await p({productVariationId:r,productVariationOptionValue:a.value,texts:[{title:t,subtitle:n,locale:d}]});return c(!1),{data:l,success:!0}},g=(0,L.A)({submit:x,successMessage:m,initialValues:{title:null==a?void 0:a.texts.title,subtitle:null==a?void 0:a.texts.subtitle}});return(0,l.jsx)(E.A,{form:g,className:"last:pb-2 variation-option-update-form",children:(0,l.jsx)("div",{className:"my-2 flow-root rounded-sm border sm:mx-4 ",children:(0,l.jsx)("li",{className:"list-none py-2 dark:bg-slate-500 dark:text-slate-200 pl-2 pr-2",children:(0,l.jsxs)("div",{className:"grid grid-cols-6 items-center gap-2",children:[(0,l.jsx)("span",{className:"col-span-1",children:(0,l.jsx)(tA.A,{text:null==a?void 0:a.value,color:"slate"})}),(0,l.jsxs)("div",{className:"col-span-4 min-w-0",children:[(0,l.jsx)("p",{className:"truncate text-sm font-medium text-slate-900 dark:text-slate-200",children:o?(0,l.jsx)(O.A,{className:"mt-0",name:"title",required:!0,label:u({id:"title",defaultMessage:"Title"})}):null==a||null==(t=a.texts)?void 0:t.title}),(0,l.jsx)("p",{className:"truncate text-sm text-slate-500",children:o?(0,l.jsx)(O.A,{className:"mt-0",name:"subtitle",label:u({id:"subtitle",defaultMessage:"Subtitle"})}):null==a||null==(n=a.texts)?void 0:n.subtitle})]}),(0,l.jsx)("div",{className:"col-span-1",children:o?(0,l.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,l.jsx)("button",{onClick:()=>c(!o),"aria-label":u({id:"cancel",defaultMessage:"Cancel"}),type:"button",className:"rounded-md bg-white font-medium text-red-500 hover:text-red-600 focus:outline-hidden focus:ring-2 focus:ring-purple-500 focus:ring-offset-2",children:u({id:"cancel",defaultMessage:"Cancel"})}),(0,l.jsx)("button",{type:"submit","aria-label":u({id:"save",defaultMessage:"Save"}),className:"rounded-md bg-white font-medium text-indigo-600 hover:text-indigo-500 focus:outline-hidden focus:ring-2 focus:ring-purple-500 focus:ring-offset-2",children:u({id:"save",defaultMessage:"Save"})})]}):(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,l.jsx)("div",{onClick:()=>c(!o),"data-optionvalue":null==a?void 0:a.value,id:"edit_variation_option",children:(0,l.jsx)(tP.A,{})}),(0,l.jsx)(tN.A,{onClick:()=>s(a.value),className:"ml-1 mr-1"})]})})]})})})})},tB=e=>{let{variationId:t,options:n,selectedLocale:a}=e,{createProductVariationOption:s}=tV(),{formatMessage:r}=(0,i.A)(),{setModal:u}=(0,h.A)(),{removeProductVariationOption:o}=tE(),c=async e=>{await u((0,l.jsx)(f.A,{message:r({id:"delete_variation_option_confirmation",defaultMessage:"This action might cause inconsistencies with other data that relates to it. Are you sure you want to delete this option? "}),onCancelClick:()=>u(""),onOkClick:async()=>{u(""),await o({productVariationId:t,productVariationOptionValue:e}),d.oR.success(r({id:"product_variation_option_deleted",defaultMessage:"Variation option deleted successfully"}))},okText:r({id:"delete_variation_option",defaultMessage:"Delete option"})}))},m=async e=>{let{value:n,title:l}=e;return await s({productVariationId:t,option:n,texts:[{title:l,locale:a}]}),{success:!0}};return(0,l.jsxs)("div",{children:[(0,l.jsx)(tq,{onSubmit:m}),n.length?n.map(e=>(0,l.jsx)(tJ,{variationId:t,option:e,selectedLocale:a,onDelete:c},e._id)):(0,l.jsx)(eV.A,{message:r({id:"option",defaultMessage:"Option"})})]})},tO=e=>{let{productVariationId:t,selectedLocale:n,variation:a}=e,{formatMessage:s}=(0,i.A)(),{setModal:r}=(0,h.A)(),{options:u}=a,{removeProductVariation:o}=tw(),c=async()=>{await r((0,l.jsx)(f.A,{onCancelClick:async()=>r(""),message:s({id:"delete_product_variation_confirmation",defaultMessage:"This action might cause inconsistencies with other data that relates to it. Are you sure you want to delete this variation? "}),onOkClick:async()=>{r(""),await o({productVariationId:t}),d.oR.success(s({id:"product_variation_deleted",defaultMessage:"Variation deleted successfully"}))},okText:s({id:"delete_product_variation",defaultMessage:"Delete variation"})}))},m=[{header:(0,l.jsx)(t$,{onDelete:c,selectedLocale:n,variation:a,...a}),body:(0,l.jsx)(tB,{selectedLocale:n,variationId:a._id,options:u},t)}];return(0,l.jsx)(tb.A,{"data-variationid":a._id,data:m,containerCSS:"w-full my-0",bodyCSS:"bg-white dark:bg-slate-800",itemContainerCSS:"mt-0 my-0",headerCSS:"w-full flex items-center rounded-sm justify-between p-2 bg-white dark:bg-slate-800"})},tL=e=>{let{productId:t,selectedLocale:n=null}=e,{createProductVariation:a}=tu(),{formatMessage:s}=(0,i.A)(),{variations:r,loading:d}=tx({productId:t}),u=async e=>{let{title:l,key:s,type:i}=e;return await a({productId:t,variation:{key:s,type:i},texts:[{title:l,locale:n}]}),{success:!0}};return d?(0,l.jsx)(m.A,{}):(0,l.jsx)("div",{className:"mt-6 overflow-hidden rounded-md",children:(0,l.jsxs)("div",{className:"lg:grid lg:grid-cols-12",children:[(0,l.jsx)("div",{className:"mb-5 lg:col-span-5 lg:pr-5 ",children:(0,l.jsx)(tv,{onSubmit:u})}),(0,l.jsx)("div",{className:"lg:col-span-7 lg:w-full",children:(0,l.jsx)("div",{className:"flex flex-col gap-y-2",children:(null==r?void 0:r.length)?null==r?void 0:r.map(e=>(0,l.jsx)(tO,{selectedLocale:n,productVariationId:e._id,variation:e},e._id)):(0,l.jsx)(eV.A,{message:s({id:"variation",defaultMessage:"Variation product"})})})})]})})};function tU(){let e=(0,F._)(["\n query ProductWarehousing($productId: ID, $slug: String) {\n product(productId: $productId, slug: $slug) {\n _id\n ... on SimpleProduct {\n sku\n baseUnit\n }\n }\n }\n"]);return tU=function(){return e},e}let tF=(0,Q.J1)(tU()),tQ=function(){let{productId:e=null,slug:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(0,eA.id)(t),{data:l,loading:a,error:s}=(0,W.IT)(tF,{skip:!e&&!n,variables:{productId:e||n}});return{product:(null==l?void 0:l.product)||{},loading:a,error:s}};function tW(){let e=(0,F._)(["\n mutation UpdateProductWarehousing(\n $productId: ID!\n $warehousing: UpdateProductWarehousingInput!\n ) {\n updateProductWarehousing(productId: $productId, warehousing: $warehousing) {\n _id\n ... on SimpleProduct {\n sku\n baseUnit\n }\n }\n }\n"]);return tW=function(){return e},e}let tz=(0,Q.J1)(tW()),tZ=()=>{let[e]=(0,Y.n)(tz);return{updateProductWarehousing:async t=>{let{productId:n,warehousing:{sku:l=null,baseUnit:a=null}}=t;return e({variables:{productId:n,warehousing:{sku:l,baseUnit:a}},refetchQueries:["Products"]})}}},tH=e=>{let{productId:t}=e,{formatMessage:n}=(0,i.A)(),{product:a}=tQ({productId:t}),{hasRole:s}=(0,u.A)(),{updateProductWarehousing:d}=tZ(),o=n({id:"saved",defaultMessage:"Saved"}),c=async e=>{let{sku:n,baseUnit:l}=e;return{data:await d({productId:t,warehousing:{baseUnit:l,sku:n}}),success:!0}},m=(0,L.A)({submit:c,successMessage:o,initialValues:{sku:"",baseUnit:""}});return(0,y.useEffect)(()=>{Object.keys(a).length&&m.formik.setValues({...a})},[a]),(0,l.jsx)(ep.A,{documentationLabel:n({id:"warehousing",defaultMessage:"Warehousing"}),className:"mt-2 sm:mt-0",documentation:(0,l.jsx)(r.A,{id:"product_warehousing_form_description",defaultMessage:"<ul><li> Information regarding product storage </li> </ul>",values:{ul:e=>(0,l.jsxs)("ul",{className:"list-disc list-inside",children:[e," "]}),li:e=>(0,l.jsxs)("li",{children:[e," "]})}}),children:(0,l.jsx)(T.A,{children:(0,l.jsxs)(E.A,{className:"rounded",form:m,children:[(0,l.jsx)("div",{className:"relative px-4 pb-5 sm:p-6",children:(0,l.jsxs)("div",{className:"w-full justify-between align-baseline",children:[(0,l.jsx)(O.A,{name:"sku",id:"sku",label:n({id:"sku",defaultMessage:"SKU"}),className:"mb-4 text-sm font-medium"}),(0,l.jsx)(O.A,{name:"baseUnit",id:"baseUnit",label:n({id:"baseUnit",defaultMessage:"Base Unit"}),className:"text-sm font-medium "})]})}),(0,l.jsx)("div",{className:"border-t-indigo-50 border-t dark:border-t-slate-700 space-y-6 bg-slate-50 dark:bg-slate-800 text-right sm:p-6",children:(0,l.jsx)(B.A,{hidden:!s("editProductWarehousing"),label:n({id:"save",defaultMessage:"Save"})})})]})})})};function tK(){let e=(0,F._)(["\n mutation PublishProduct($productId: ID!) {\n publishProduct(productId: $productId) {\n ...ProductDetailFragment\n }\n }\n ","\n"]);return tK=function(){return e},e}let tG=(0,Q.J1)(tK(),X.A),tY=()=>{let[e]=(0,Y.n)(tG);return{publishProduct:async t=>{let{productId:n}=t;return e({variables:{productId:n}})}}};function tX(){let e=(0,F._)(["\n mutation UnpublishProduct($productId: ID!) {\n unpublishProduct(productId: $productId) {\n ...ProductDetailFragment\n }\n }\n ","\n"]);return tX=function(){return e},e}let t0=(0,Q.J1)(tX(),X.A),t1=()=>{let[e]=(0,Y.n)(t0);return{unPublishProduct:async t=>{let{productId:n}=t;return e({variables:{productId:n}})}}};var t5=n(38755),t2=n(61697),t4=n(40338);function t7(){let e=(0,F._)(["\n query ProductReviewByProduct(\n $productId: ID\n $slug: String\n $limit: Int\n $offset: Int\n $sort: [SortOptionInput!]\n ) {\n product(productId: $productId, slug: $slug) {\n _id\n reviews(limit: $limit, offset: $offset, sort: $sort) {\n ...ProductReviewDetailFragment\n }\n reviewsCount\n }\n }\n ","\n"]);return t7=function(){return e},e}let t3=(0,Q.J1)(t7(),t4.A),t6=function(){let{productId:e=null,slug:t=null,limit:n=10,offset:l=0,sort:a=[{key:"created",value:t2.t4.Desc}]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{data:s,loading:i,error:r,fetchMore:d}=(0,W.IT)(t3,{skip:!e,variables:{productId:e,slug:t,limit:n,offset:l,sort:a}}),u=null==s?void 0:s.product,o=(null==u?void 0:u.reviews)||[];return{productReviews:o,loading:i,error:r,reviewsCount:(null==u?void 0:u.reviewsCount)||0,loadMore:()=>{d({variables:{offset:null==o?void 0:o.length}})}}};var t8=n(81196);let t9=y.forwardRef(function(e,t){let{title:n,titleId:l,...a}=e;return y.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:t,"aria-labelledby":l},a),n?y.createElement("title",{id:l},n):null,y.createElement("path",{fillRule:"evenodd",d:"M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.006 5.404.434c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.434 2.082-5.005Z",clipRule:"evenodd"}))});var ne=n(60046),nt=n(4011);let nn=e=>{let{productReviews:t}=e,{formatMessage:n}=(0,i.A)(),a=t.reduce((e,t)=>e+t.upVote,0),s=t.reduce((e,t)=>e+t.downVote,0),d=a?a/(a+s)*100:0,u=d?100-d:0;return(0,l.jsxs)("div",{className:"lg:col-span-4",children:[(0,l.jsx)("h2",{className:"text-2xl font-extrabold tracking-tight",children:n({id:"customer_reviews",defaultMessage:"Customer Reviews"})}),(0,l.jsxs)("div",{className:"mt-3 flex items-center",children:[(0,l.jsx)("div",{children:(0,l.jsx)("div",{title:"".concat(d),className:"flex items-center",children:[0,1,2,3,4].map(e=>(0,l.jsx)(t9,{className:"\n ".concat(d>=20*e?"text-yellow-400":"text-slate-400","\n h-5 w-5 shrink-0\n "),"aria-hidden":"true"},e))})}),(0,l.jsx)("div",{className:"ml-2 text-sm",children:(0,l.jsx)(r.A,{id:"review_summary",defaultMessage:"<div> Based on <cta> {total} </cta> reviews</div>",values:{div:e=>(0,l.jsx)("div",{children:e}),cta:e=>(0,l.jsx)("b",{className:"font-bold",children:e}),total:t.length}})})]}),(0,l.jsxs)("div",{className:"mt-6",children:[(0,l.jsx)("h3",{className:"sr-only",children:n({id:"review_data",defaultMessage:"Review data"})}),(0,l.jsxs)("dl",{className:"space-y-3",children:[(0,l.jsxs)("div",{className:"flex items-center text-sm",children:[(0,l.jsxs)("dt",{className:"flex flex-1 items-center",children:[(0,l.jsx)("p",{className:"font-medium",children:a}),(0,l.jsxs)("div",{"aria-hidden":"true",className:"ml-2 flex flex-1 items-center",children:[(0,l.jsx)(ne.A,{className:"\n ".concat(a>0?"text-yellow-400":"text-slate-400","\n h-5 w-5 shrink-0"),"aria-hidden":"true"}),(0,l.jsxs)("div",{className:"relative ml-3 flex-1",children:[(0,l.jsx)("div",{className:"h-3 rounded-full border border-slate-200 dark:border-slate-800 bg-slate-100"}),a>0?(0,l.jsx)("div",{className:"absolute inset-y-0 rounded-full border border-yellow-400 bg-yellow-400",style:{width:"calc(".concat(d,"%)")}}):null]})]})]}),(0,l.jsxs)("dd",{className:"ml-3 w-10 text-right text-sm tabular-nums",children:[Math.round(d),"%"]})]}),(0,l.jsxs)("div",{className:"flex items-center text-sm",children:[(0,l.jsxs)("dt",{className:"flex flex-1 items-center",children:[(0,l.jsxs)("p",{className:"font-medium",children:[s,(0,l.jsx)("span",{className:"sr-only",children:n({id:"star_reviews",defaultMessage:"Star reviews"})})]}),(0,l.jsxs)("div",{"aria-hidden":"true",className:"ml-2 flex flex-1 items-center",children:[(0,l.jsx)(nt.A,{className:"\n ".concat(s>0?"text-yellow-400":"text-slate-400","\n h-5 w-5 shrink-0\n "),"aria-hidden":"true"}),(0,l.jsxs)("div",{className:"relative ml-3 flex-1",children:[(0,l.jsx)("div",{className:"h-3 rounded-full border border-slate-200 dark:border-slate-800 bg-slate-100"}),s>0?(0,l.jsx)("div",{className:"absolute inset-y-0 rounded-full border border-yellow-400 bg-yellow-400",style:{width:"calc(".concat(u,"%)")}}):null]})]})]}),(0,l.jsxs)("dd",{className:"ml-3 w-10 text-right text-sm tabular-nums",children:[Math.round(u),"%"]})]})]})]})]})};var nl=n(23368);let na=e=>{let{onSubmit:t,onSubmitSuccess:n=null,defaultValue:a={},isEdit:s=!1}=e,{formatMessage:r}=(0,i.A)(),{hasRole:d}=(0,u.A)(),o=r({id:"product_review_added",defaultMessage:"Review added successfully!"}),c=r({id:"product_review_updated",defaultMessage:"Review updated successfully!"}),m=(0,L.A)({submit:t,onSubmitSuccess:n,successMessage:s?c:o,initialValues:{title:"",review:"",rating:1,...a}});return(0,l.jsxs)(E.A,{form:m,children:[(0,l.jsxs)("div",{className:"px-5 py-2",children:[(0,l.jsx)(O.A,{name:"title",id:"title",label:r({id:"title",defaultMessage:"Title"}),autoComplete:"off",required:!0,className:"my-4"}),(0,l.jsx)(nl.A,{rows:3,name:"review",id:"review",label:r({id:"review",defaultMessage:"Review"})})]}),(0,l.jsx)("div",{className:"border-t-indigo-50 border-t dark:border-t-slate-700 space-y-6 rounded-b-md bg-slate-50 dark:bg-slate-800 p-5 text-right",children:(0,l.jsx)(B.A,{hidden:!d("reviewProduct"),label:r(s?{id:"update_review",defaultMessage:"Update Review"}:{id:"add_review",defaultMessage:"Add Review"})})})]})};function ns(){let e=(0,F._)(["\n mutation CreateProductReview(\n $productId: ID!\n $productReview: ProductReviewInput!\n ) {\n createProductReview(productId: $productId, productReview: $productReview) {\n ...ProductReviewDetailFragment\n }\n }\n ","\n"]);return ns=function(){return e},e}let ni=(0,Q.J1)(ns(),t4.A),nr=()=>{let[e]=(0,Y.n)(ni);return{createProductReview:async t=>{let{productId:n,productReview:{title:l,rating:a,review:s}}=t;return e({variables:{productId:n,productReview:{title:l,rating:a,review:s}},refetchQueries:["ProductReviewByProduct","ProductReviewByUser"]})}}};var nd=n(5314);let nu=e=>{let{productId:t}=e,{productReviews:n,loadMore:a,reviewsCount:s}=t6({productId:t}),{createProductReview:r}=nr(),{formatMessage:d}=(0,i.A)();return(0,l.jsxs)("div",{className:"mt-5 sm:max-w-full",children:[(0,l.jsx)("div",{className:"rounded bg-white dark:bg-slate-900 shadow-sm text-slate-900 dark:shadow-none dark:text-slate-200",children:(0,l.jsxs)("div",{className:"mx-auto p-4 sm:p-6 lg:grid lg:max-w-7xl lg:grid-cols-12 lg:gap-x-8 lg:p-8",children:[(0,l.jsx)(nn,{productReviews:n}),(0,l.jsxs)("div",{className:"mt-16 lg:col-span-7 lg:col-start-6 lg:mt-0",children:[t&&(0,l.jsx)(na,{onSubmit:async e=>{let{title:n,review:l,rating:a}=e;return await r({productId:t,productReview:{title:n,review:l,rating:10}})}}),(0,l.jsx)("h3",{className:"sr-only",children:d({id:"recent_reviews",defaultMessage:"Recent reviews"})}),(0,l.jsx)("div",{className:"flow-root",children:(0,l.jsx)("div",{className:"-my-3",children:n.map(e=>(0,l.jsx)(t8.A,{review:e},e._id))})})]})]})}),s>(null==n?void 0:n.length)?(0,l.jsx)(nd.A,{text:d({id:"load-more-reviews",defaultMessage:"Load reviews"}),onClick:a}):null]})};var no=n(90203);function nc(){let e=(0,F._)(["\n mutation CreateProductBundleItem(\n $productId: ID!\n $item: CreateProductBundleItemInput!\n ) {\n createProductBundleItem(productId: $productId, item: $item) {\n _id\n }\n }\n"]);return nc=function(){return e},e}let nm=(0,Q.J1)(nc()),np=()=>{let[e]=(0,Y.n)(nm);return{createProductBundleItem:async t=>{let{productId:n,item:l}=t;return e({variables:{productId:n,item:l},refetchQueries:["ProductBundleItems"]})}}};var nx=n(83149);let ng=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map(e=>{var t;let{_id:n,status:l,texts:a,media:s}=e;return{id:n,tag:l,...a,image:(null==s?void 0:s.length)?null==(t=s[0])?void 0:t.file.url:null}})},nf=e=>{let{productId:t}=e,[n,a]=(0,y.useState)(""),{createProductBundleItem:s}=np(),{hasRole:r}=(0,u.A)(),{formatMessage:d}=(0,i.A)(),{products:o,loading:c}=(0,nx.A)({queryString:n,includeDrafts:!0,limit:50,sort:[{key:"created",value:t2.t4.Desc}]}),m=async e=>{let{productId:n,quantity:l}=e;return await s({item:{productId:n,quantity:l},productId:t}),{success:!0}},p=d({id:"bundle_item_added",defaultMessage:"Bundle product added successfully"}),x=(0,L.A)({submit:m,successMessage:p,onSubmitSuccess:()=>(x.formik.resetForm(),null),initialValues:{productId:"",quantity:1}});return(0,l.jsxs)(E.A,{form:x,children:[(0,l.jsx)(no.A,{name:"productId",onFilter:a,queryString:n,label:d({id:"product",defaultMessage:"Product"}),data:ng(o),isLoading:c,className:"mt-1 w-full py-2 text-sm font-medium text-slate-500",required:!0}),(0,l.jsx)(O.A,{name:"quantity",type:"number",required:!0,label:d({id:"quantity",defaultMessage:"Quantity"})}),(0,l.jsx)(B.A,{hidden:!r("addProductBundleItem"),label:d({id:"submit",defaultMessage:"Submit"}),className:"mt-2"})]})};var nh=n(15284);function nv(){let e=(0,F._)(["\n query ProductBundleItems($productId: ID, $slug: String) {\n product(productId: $productId, slug: $slug) {\n _id\n ... on BundleProduct {\n bundleItems {\n product {\n ...ProductBriefFragment\n }\n quantity\n }\n }\n }\n }\n ","\n"]);return nv=function(){return e},e}let nb=(0,Q.J1)(nv(),nh.A),nj=function(){var e;let{productId:t=null,slug:n=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=(0,eA.id)(n),{data:a,loading:s,error:i}=(0,W.IT)(nb,{skip:!t&&!l,variables:{productId:t||l}});return{bundleItems:(null==a||null==(e=a.product)?void 0:e.bundleItems)||[],loading:s,error:i}};function ny(){let e=(0,F._)(["\n mutation RemoveBundleItem($productId: ID!, $index: Int!) {\n removeBundleItem(productId: $productId, index: $index) {\n _id\n }\n }\n"]);return ny=function(){return e},e}let nw=(0,Q.J1)(ny()),nI=()=>{let[e]=(0,Y.n)(nw);return{removeBundleItem:async t=>{let{productId:n,index:l}=t;return e({variables:{productId:n,index:l},refetchQueries:["ProductBundleItems"]})}}};var n_=n(9875),nA=n(95218);let nN=e=>{var t,n,a,s,i,r;let{item:d,onDelete:u,index:o}=e,{product:c,quantity:m}=d;return(0,l.jsxs)("div",{className:"flex w-full items-center justify-between border-b border-slate-200 dark:border-slate-600 last:border-none",children:[(0,l.jsxs)("div",{className:"flex w-full items-center space-x-6 py-4",children:[(null==(t=c.media)?void 0:t.length)?(0,l.jsx)("div",{className:"flex w-20 flex-col items-center",children:(0,l.jsx)("div",{className:"relative m-1 mr-2 mt-1 flex items-center justify-center rounded-full ",children:(0,l.jsx)(n_.A,{className:"mx-auto w-auto",src:null==(n=c.media[0])?void 0:n.file.url,width:160,height:100,alt:(null==c||null==(a=c.texts)?void 0:a.title)||(null==c||null==(s=c.texts)?void 0:s.subtitle)})})}):(0,l.jsx)(nA.A,{className:"h-10 w-10"}),(0,l.jsxs)("div",{className:"shrink grow basis-1/2",children:[(0,l.jsx)("h3",{className:"text-lg text-slate-800 dark:text-slate-200",children:null==c||null==(i=c.texts)?void 0:i.title}),(0,l.jsx)("p",{className:"text-xs text-slate-600 dark:text-slate-200",children:null==c||null==(r=c.texts)?void 0:r.subtitle})]}),(0,l.jsx)("div",{className:"ml-auto",children:(0,l.jsx)(tA.A,{text:m,color:"indigo",square:!0})})]}),(0,l.jsx)(tN.A,{onClick:()=>u(o),className:"ml-2"})]})},nP=e=>{let{productId:t}=e,{formatMessage:n}=(0,i.A)(),{setModal:a}=(0,h.A)(),{bundleItems:s,loading:r}=nj({productId:t}),{removeBundleItem:u}=nI(),o=async e=>{await a((0,l.jsx)(f.A,{onCancelClick:async()=>a(""),message:n({id:"delete_bundle_item_confirmation",defaultMessage:"This action might cause inconsistencies with other data that relates to it. Are you sure you want to delete this bundle item? "}),onOkClick:async()=>{a(""),await u({productId:t,index:e}),d.oR.success(n({id:"bundle_item_deleted",defaultMessage:"Bundle item deleted successfully"}))},okText:n({id:"delete_bundle_item",defaultMessage:"Delete item"})}))};return r?(0,l.jsx)(m.A,{}):s.length?(0,l.jsx)(l.Fragment,{children:s.map((e,t)=>(0,l.jsx)(nN,{index:t,item:e,onDelete:o},e.product._id))}):(0,l.jsx)(eV.A,{message:n({id:"bundle",defaultMessage:"Bundle product"})})},nM=e=>{let{productId:t}=e;return(0,l.jsx)("div",{className:"mt-6 rounded-md",children:(0,l.jsxs)("div",{className:"lg:grid lg:grid-cols-9",children:[(0,l.jsx)("div",{className:"mb-5 lg:col-span-4 lg:pr-5",children:(0,l.jsx)(nf,{productId:t})}),(0,l.jsx)("div",{className:"col-span-5 ml-auto rounded-md bg-white dark:bg-slate-800 px-8 shadow-md dark:shadow-none lg:w-full",children:(0,l.jsx)("div",{className:"py-4",children:(0,l.jsx)(nP,{productId:t})})})]})})};var nk=n(97377),nC=n(46660),n$=n(30267),nT=n(38442);function nS(){let e=(0,F._)(["\n mutation AddProductAssignment(\n $proxyId: ID!\n $productId: ID!\n $vectors: [ProductAssignmentVectorInput!]!\n ) {\n addProductAssignment(\n proxyId: $proxyId\n productId: $productId\n vectors: $vectors\n ) {\n _id\n }\n }\n"]);return nS=function(){return e},e}let nV=(0,Q.J1)(nS()),nR=()=>{let[e]=(0,Y.n)(nV);return{addProductAssignment:async t=>{let{productId:n,proxyId:l,vectors:a}=t;return e({variables:{productId:n,proxyId:l,vectors:a},refetchQueries:["ProductAssignments"]})}}};function nD(){let e=(0,F._)(["\n fragment ProductAssignmentFragment on ProductVariationAssignment {\n _id\n vectors {\n _id\n option {\n _id\n value\n texts {\n _id\n title\n subtitle\n }\n }\n variation {\n _id\n key\n texts {\n _id\n locale\n title\n }\n }\n }\n product {\n _id\n texts {\n _id\n title\n slug\n subtitle\n }\n }\n }\n"]);return nD=function(){return e},e}let nE=(0,Q.J1)(nD());function nq(){let e=(0,F._)(["\n query ProductAssignments($productId: ID, $slug: String) {\n product(productId: $productId, slug: $slug) {\n _id\n ... on ConfigurableProduct {\n texts {\n _id\n subtitle\n slug\n title\n }\n variations {\n _id\n key\n texts {\n _id\n title\n }\n options {\n _id\n value\n texts {\n _id\n title\n }\n }\n }\n assignments(includeInactive: true) {\n ...ProductAssignmentFragment\n }\n }\n }\n }\n ","\n"]);return nq=function(){return e},e}let nJ=(0,Q.J1)(nq(),nE),nB=function(){let{productId:e=null,slug:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(0,eA.id)(t),{data:l,loading:a,error:s}=(0,W.IT)(nJ,{skip:!e&&!n,variables:{productId:e||n}});return{product:null==l?void 0:l.product,loading:a,error:s}};var nO=n(83010);function nL(){let e=(0,F._)(["\n mutation RemoveProductAssignment(\n $proxyId: ID!\n $vectors: [ProductAssignmentVectorInput!]!\n ) {\n removeProductAssignment(proxyId: $proxyId, vectors: $vectors) {\n _id\n }\n }\n"]);return nL=function(){return e},e}let nU=(0,Q.J1)(nL()),nF=()=>{let[e]=(0,Y.n)(nU);return{removeProductAssignment:async t=>{let{proxyId:n,vectors:l}=t;return e({variables:{proxyId:n,vectors:l},refetchQueries:["ProductAssignments"]})}}};var nQ=n(99922);let nW=(e,t,n)=>{let l=e[n],a=[];return(null==l||l.values.filter(e=>e.length).forEach(e=>{let n={};n[l.key]=e,t.length>0?t.forEach(e=>{a.push({...e,...n})}):a.push(n)}),e.length>n+1)?nW(e,a,n+1):Array.from(new Set(a.map(e=>JSON.stringify(e)))).map(e=>JSON.parse(e))},nz=e=>{let{_id:t,texts:n}=e;return{value:t,label:null==n?void 0:n.title}},nZ=e=>{let{proxyId:t}=e,{formatMessage:n}=(0,i.A)(),{addProductAssignment:a}=nR(),{removeProductAssignment:s}=nF(),{setModal:r}=(0,h.A)(),[d,u]=(0,y.useState)(""),{products:o}=(0,nx.A)({queryString:d,limit:50,sort:[{key:"created",value:t2.t4.Desc}]}),{product:c,loading:m}=nB({productId:t}),p=c&&(null==c?void 0:c.variations)||[],x=p.filter(e=>{let{options:t}=e;return t.length}).map(e=>{let{key:t}=e;return t}),g=p.map(e=>{let{key:t,options:n}=e;return{values:(n||[]).map(e=>e.value),key:t}}),v=g.length>0?nW(g.filter(e=>{let{values:t}=e;return t.length}),[],0):[],b=c&&c.assignments||[],j={};b.forEach(e=>{let t={};e.vectors.forEach(e=>{var n,l;t[null==e||null==(n=e.variation)?void 0:n.key]=null==e||null==(l=e.option)?void 0:l.value}),j[Object.values(t).join("")]=e.product});let w=v.map(e=>{let t=Object.values(e).join("");return{_id:t,product:j[t],columns:Object.values(e),columnsText:Object.values(e)}}).sort((e,t)=>e.product&&t.product||!e.product&&!t.product?e.columns.length>t.columns.length?1:-1:e.product?-1:+!!t.product),I=(e,t)=>({key:x[t],value:e}),_=e=>async n=>{let{value:l}=n,s=e.map(I);await a({proxyId:t,productId:l,vectors:s})},A=e=>async()=>{await r((0,l.jsx)(f.A,{onCancelClick:async()=>r(""),message:n({id:"delete_product_assignment",defaultMessage:"This action might cause inconsistencies with other data that relates to it. Are you sure you want to delete this assignment? "}),onOkClick:async()=>{r("");let n=e.map(I);await s({proxyId:t,vectors:n})},okText:n({id:"delete_variation_assignment",defaultMessage:"Delete assignment"})}))},N=(0,nQ.A)(200)(u);return(0,l.jsx)(T.A,{children:(0,l.jsx)(nO.A,{children:w.map(e=>{var t;let{_id:a,columns:s,product:i}=e;return(0,l.jsxs)(nO.A.Row,{children:[s.map(e=>(0,l.jsx)(nO.A.Cell,{children:e},"".concat(e).concat(a))),(0,l.jsxs)(nO.A.Cell,{children:[" ",i?null==i||null==(t=i.texts)?void 0:t.title:(0,l.jsx)(nT.Ay,{name:"productId-".concat(a),placeholder:n({id:"search_product",defaultMessage:"Search product"}),isLoading:m,onChange:_(s),onInputChange:N,value:d,options:(o||[]).map(nz),className:"mt-1 w-full py-2 text-sm font-medium text-slate-500"})]}),(0,l.jsx)(nO.A.Cell,{children:i&&i._id&&(0,l.jsx)(tN.A,{onClick:A(s)})})]},a)})})})};function nH(){let e=(0,F._)(["\n query ProductTokenization($productId: ID, $slug: String) {\n product(productId: $productId, slug: $slug) {\n _id\n ... on TokenizedProduct {\n contractConfiguration {\n tokenId\n supply\n }\n contractStandard\n contractAddress\n }\n }\n }\n"]);return nH=function(){return e},e}let nK=(0,Q.J1)(nH()),nG=function(){let{productId:e=null,slug:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(0,eA.id)(t),{data:l,loading:a,error:s}=(0,W.IT)(nK,{skip:!e&&!t,variables:{productId:e||n}});return{product:null==l?void 0:l.product,loading:a,error:s}};function nY(){let e=(0,F._)(['\n query SmartContractStandards {\n smartContractStandards: __type(name: "SmartContractStandard") {\n options: enumValues {\n value: name\n label: name\n }\n }\n }\n']);return nY=function(){return e},e}let nX=(0,Q.J1)(nY()),n0=()=>{var e;let{data:t,loading:n,error:l}=(0,W.IT)(nX);return{smartContractStandards:(null==t||null==(e=t.smartContractStandards)?void 0:e.options)||[],loading:n,error:l}};function n1(){let e=(0,F._)(["\n mutation UpdateProductTokenization(\n $productId: ID!\n $tokenization: UpdateProductTokenizationInput!\n ) {\n updateProductTokenization(\n productId: $productId\n tokenization: $tokenization\n ) {\n _id\n }\n }\n"]);return n1=function(){return e},e}let n5=(0,Q.J1)(n1()),n2=()=>{let[e]=(0,Y.n)(n5);return{updateProductTokenization:async t=>{let{productId:n,tokenization:{contractAddress:l,contractStandard:a,tokenId:s,supply:i}}=t;return e({variables:{productId:n,tokenization:{contractAddress:l,contractStandard:a,tokenId:s,supply:parseInt(i,10)}},refetchQueries:["Product","Products"]})}}},n4=e=>{let{productId:t}=e,{formatMessage:n}=(0,i.A)(),{hasRole:a}=(0,u.A)(),{smartContractStandards:s}=n0(),{updateProductTokenization:d}=n2(),{product:o,loading:c}=nG({productId:t}),m=async e=>{let{contractAddress:n,contractStandard:l,tokenId:a,supply:s}=e;return await d({productId:t,tokenization:{contractAddress:n,contractStandard:l,tokenId:a||"",supply:s}}),{success:!0}},p=n({id:"token_updated",defaultMessage:"Token update successfully!"}),x=(0,L.A)({submit:m,successMessage:p,initialValues:{contractAddress:"",contractStandard:"",tokenId:"",supply:""}});return(0,y.useEffect)(()=>{var e,t;c||x.formik.setValues({contractAddress:(null==o?void 0:o.contractAddress)||"",contractStandard:(null==o?void 0:o.contractStandard)||"",tokenId:(null==o||null==(e=o.contractConfiguration)?void 0:e.tokenId)||"",supply:(null==o||null==(t=o.contractConfiguration)?void 0:t.supply)||""})},[c]),(0,l.jsx)(ep.A,{documentationLabel:n({id:"texts",defaultMessage:"Texts"}),className:"mt-2 sm:mt-0",documentation:(0,l.jsx)(r.A,{id:"tokenized_product_text_form_description",defaultMessage:"<b>Contract standards </b> <ol> <dt><b> ERC721 </b></dt> <dd> Buying multiple Products leads to multiple Tokens (make sure to set the tokenId to 0 to make it auto generate new id's) </dd> <dt> <b> ERC1155 </b></dt> <dd> Buying multiple Products leads to a new token with balance 3 of token with tokenId assigned </dd> <dt> <b> Contract address </b></dt> <dd> Address of a token on a given network </dd> </ol>",values:{ol:e=>(0,l.jsxs)("ol",{children:[e," "]}),dt:e=>(0,l.jsxs)("dt",{className:"bold",children:[e," "]}),dd:e=>(0,l.jsxs)("dd",{children:[e," "]}),b:e=>(0,l.jsxs)("b",{children:[e," "]})}}),children:(0,l.jsx)(T.A,{children:(0,l.jsxs)(E.A,{form:x,children:[(0,l.jsxs)("div",{className:"p-5 pb-7 sm:max-w-full",children:[(0,l.jsx)("div",{className:"my-5 flex items-center",children:(0,l.jsx)(J.A,{className:"mt-1 w-full",label:n({id:"contract-standard",defaultMessage:"Contract standard"}),placeholder:n({id:"contract-standard",defaultMessage:"Contract standard"}),required:!0,name:"contractStandard",options:(0,S.A)(s,"label","value")})}),(0,l.jsx)(O.A,{name:"contractAddress",id:"contractAddress",label:n({id:"contract-address-label",defaultMessage:"Contract Address"}),placeholder:n({id:"contract-address-label",defaultMessage:"Contract Address"}),required:!0,className:"block w-full max-w-full rounded-md border-slate-200 dark:border-slate-800 text-sm focus:border-indigo-400 focus:ring-indigo-400 sm:text-sm"}),(0,l.jsx)(O.A,{name:"supply",id:"supply",type:"number",label:n({id:"token-supply",defaultMessage:"Supply"}),placeholder:n({id:"token-supply",defaultMessage:"Supply"}),required:!0,className:"block w-full max-w-full rounded-md border-slate-200 dark:border-slate-800 text-sm focus:border-indigo-400 focus:ring-indigo-400 sm:text-sm"}),(0,l.jsx)(O.A,{name:"tokenId",id:"tokenId",label:n({id:"token-id-label",defaultMessage:"Token ID"}),placeholder:n({id:"token-id-label",defaultMessage:"Token ID"}),className:"block w-full max-w-full rounded-md border-slate-200 dark:border-slate-800 text-sm focus:border-indigo-400 focus:ring-indigo-400 sm:text-sm"})]}),(0,l.jsx)("div",{className:"space-y-6 border-t border-t-indigo-50 dark:border-t-slate-700 bg-slate-50 dark:bg-slate-800 p-5 text-right",children:(0,l.jsx)(B.A,{hidden:!a("editProduct"),label:n({id:"update_token",defaultMessage:"Update token"})})})]})})})};var n7=n(39416);let n3=e=>{let{id:t,selectedView:n,...a}=e;return"texts"===n?(0,l.jsx)(k.A,{children:(0,l.jsx)(ef,{productId:t})}):"media"===n?(0,l.jsx)(k.A,{children:(0,l.jsx)(eH,{productId:t})}):"commerce"===n?(0,l.jsx)(ea,{productId:t}):"supply"===n?(0,l.jsx)(ti,{productId:t}):"warehousing"===n?(0,l.jsx)(tH,{productId:t}):"variations"===n?(0,l.jsx)(k.A,{children:(0,l.jsx)(tL,{productId:t})}):"bundled_products"===n?(0,l.jsx)(nM,{productId:t}):"subscriptions"===n?(0,l.jsx)(e6,{productId:t}):"reviews"===n?(0,l.jsx)(nu,{productId:t}):"assignments"===n?(0,l.jsx)(nZ,{proxyId:t}):"token"===n?(0,l.jsx)(n4,{productId:t}):"extended"===n?(0,l.jsx)(n7.A,{data:a}):(0,l.jsx)(k.A,{children:(0,l.jsx)(ef,{productId:t})})},n6=e=>{let{product:t,extendedData:n}=e,{formatMessage:a}=(0,i.A)(),{hasRole:s}=(0,u.A)(),{publishProduct:r}=tY(),{unPublishProduct:o}=t1(),{updateProduct:c}=(0,nC.A)(),m=async e=>{e.target.value&&await c({productId:null==t?void 0:t._id,product:{sequence:parseInt(e.target.value,10)}})},{status:p,__typename:x}=t||{},g=[{id:"texts",title:a({id:"general_text",defaultMessage:"Text"}),Icon:(0,l.jsx)(v.A,{className:"h-4 w-5"})},{id:"media",title:a({id:"media",defaultMessage:"Media"}),Icon:(0,l.jsx)(b.A,{className:"h-4 w-5"})},x!==n$.W.ConfigurableProduct&&{id:"commerce",title:a({id:"commerce",defaultMessage:"Commerce"}),Icon:(0,l.jsx)(j.A,{className:"h-4 w-5"})},x===n$.W.SimpleProduct&&{id:"supply",title:a({id:"supply",defaultMessage:"Supply"}),Icon:(0,l.jsx)(w,{className:"h-4 w-5"})},x===n$.W.SimpleProduct&&{id:"warehousing",title:a({id:"warehousing",defaultMessage:"Warehousing"}),Icon:(0,l.jsx)(I,{className:"h-4 w-5"})},x===n$.W.ConfigurableProduct&&{id:"variations",title:a({id:"variations",defaultMessage:"Variations"}),Icon:(0,l.jsx)(_,{className:"h-4 w-5"})},x===n$.W.BundleProduct&&{id:"bundled_products",title:a({id:"bundles",defaultMessage:"Bundles"}),Icon:(0,l.jsx)(A,{className:"h-4 w-5"})},x===n$.W.PlanProduct&&{id:"subscriptions",title:a({id:"subscriptions",defaultMessage:"Subscriptions"}),Icon:(0,l.jsx)(N,{className:"h-4 w-5"})},x===n$.W.ConfigurableProduct&&{id:"assignments",title:a({id:"assignments",defaultMessage:"Assignments"}),Icon:(0,l.jsx)(M,{className:"h-4 w-5"})},x===n$.W.TokenizedProduct&&{id:"token",title:a({id:"token",defaultMessage:"Token"}),Icon:(0,l.jsx)(M,{className:"h-4 w-5"})},{id:"reviews",title:a({id:"reviews",defaultMessage:"Reviews"}),Icon:(0,l.jsx)(A,{className:"h-4 w-5"})},null!==n&&{id:"extended",title:a({id:"extended-fields",defaultMessage:"Extended"}),Icon:(0,l.jsx)(P.A,{className:"h-4 w-5"})}].filter(e=>e),f=[{id:"active",title:a({id:"publish",defaultMessage:"Publish"}),selectedTitle:a({id:"published",defaultMessage:"Published"}),description:a({id:"publish_product_description",defaultMessage:"Product will be discoverable and can be ordered"}),current:"ACTIVE"===p,onClick:async()=>{await r({productId:null==t?void 0:t._id}),d.oR.success(a({id:"product_published",defaultMessage:"Published successfully "}))},bgColor:"green"},{id:"draft",title:a({id:"draft",defaultMessage:"Draft"}),description:a({id:"draft_product_description",defaultMessage:"Product will not be discoverable and can not be ordered"}),current:"DRAFT"===p,selectedTitle:a({id:"not_published",defaultMessage:"Not published"}),bgColor:"slate",onClick:async()=>{await o({productId:null==t?void 0:t._id}),d.oR.success(a({id:"product_drafted",defaultMessage:"Drafted successfully "}))}}],h=async e=>{let{tags:n}=e;return await c({productId:null==t?void 0:t._id,product:{tags:n}}),!0};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-y-1",children:[(0,l.jsx)("h1",{className:"",children:null==t?void 0:t.__typename}),(0,l.jsx)(nk.A,{defaultValue:null==t?void 0:t.tags,onSubmit:h,enableEdit:s("editProduct")}),(0,l.jsx)("input",{type:"number",id:"sequence-input",className:"w-24 shadow-xs focus:ring-indigo-500 dark:bg-slate-800 dark:border-slate-700 focus:border-indigo-500 block text-sm border-gray-300 rounded-full mr-2 font-bold text-indigo-500",defaultValue:null==t?void 0:t.sequence,onBlur:m}),(0,l.jsx)(C.A,{options:f,type:a({id:"product",defaultMessage:"Product"})})]}),(0,l.jsx)(t5.A,{tabItems:g,defaultTab:"texts",children:(0,l.jsx)(n3,{id:null==t?void 0:t._id,...n})})]})};function n8(){let e=(0,F._)(["\n query Product($productId: ID, $slug: String) {\n product(productId: $productId, slug: $slug) {\n ...ProductDetailFragment\n ","\n ... on SimpleProduct {\n texts {\n _id\n title\n subtitle\n description\n }\n }\n ... on ConfigurableProduct {\n texts {\n _id\n title\n subtitle\n description\n }\n }\n ... on PlanProduct {\n texts {\n _id\n title\n subtitle\n description\n }\n }\n ... on BundleProduct {\n texts {\n _id\n title\n subtitle\n description\n }\n }\n }\n }\n ","\n"]);return n8=function(){return e},e}let n9=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,Q.J1)(n8(),e,X.A)},le=function(){let{productId:e=null,slug:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(0,eA.id)(t),{customProperties:l,hydrateFragment:a}=(0,es.A)(),{data:s,loading:i,error:r}=(0,W.IT)(n9(null==l?void 0:l.Product),{skip:!e&&!n,variables:{productId:e||n}}),d=a(null==l?void 0:l.Product,null==s?void 0:s.product);return{product:null==s?void 0:s.product,loading:i,error:r,extendedData:d}};function lt(){let e=(0,F._)(["\n mutation RemoveProduct($productId: ID!) {\n removeProduct(productId: $productId) {\n _id\n }\n }\n"]);return lt=function(){return e},e}let ln=(0,Q.J1)(lt()),ll=()=>{let[e]=(0,Y.n)(ln);return{removeProduct:async t=>{let{productId:n}=t;return e({variables:{productId:n},refetchQueries:["Products"]})}}},la=e=>{var t;let{slug:n}=e,{formatMessage:v}=(0,i.A)(),{formatDateTime:b}=(0,g.A)(),{hasRole:j}=(0,u.A)(),{query:y,...w}=(0,s.useRouter)(),{setModal:I}=(0,h.A)(),{product:_,loading:A,extendedData:N}=le({slug:n}),{removeProduct:P}=ll(),M=async()=>{await I((0,l.jsx)(f.A,{onCancelClick:()=>I(""),message:v({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()=>{I("");try{await P({productId:null==_?void 0:_._id}),d.oR.success(v({id:"product_deleted_success",defaultMessage:"Deleted successfully "})),w.push("/products")}catch(e){await I((0,l.jsx)(f.A,{onCancelClick:()=>I(""),headerText:v({id:"error",defaultMessage:"Error"}),message:e instanceof x.A?e.message:e,icon:(0,l.jsx)("div",{className:"mx-auto flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10",children:(0,l.jsx)(a.A,{className:"h-6 w-6 text-red-600",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})}),okText:v({id:"ok",defaultMessage:"Ok"}),onOkClick:async()=>{I("")}}))}}}))};return(0,l.jsxs)("div",{className:"mt-6 max-w-full",children:[(0,l.jsx)(o.A,{routeName:n,depth:3,currentPageTitle:null==_||null==(t=_.texts)?void 0:t.title}),(0,l.jsxs)("div",{className:"align-center flex min-w-full justify-between",children:[(0,l.jsx)(p.A,{headerText:(0,l.jsx)(r.A,{id:"product_detail_header",defaultMessage:"Product detail <b>({id})</b>",values:{b:e=>(0,l.jsx)("b",{className:"text-lg",children:e}),id:null==_?void 0:_._id}}),children:(0,l.jsxs)("div",{className:"mr-4",children:[(null==_?void 0:_.created)&&(0,l.jsx)(r.A,{id:"added_date",defaultMessage:"<b>Created :</b> {created} ",values:{b:e=>(0,l.jsx)("b",{children:e}),created:b(_.created,{dateStyle:"long",timeStyle:"short"})},tagName:"div"}),(null==_?void 0:_.published)&&(0,l.jsx)(r.A,{id:"published_date",defaultMessage:"<b>Published :</b> {published} ",values:{b:e=>(0,l.jsx)("b",{children:e}),published:b(_.published,{dateStyle:"long",timeStyle:"short"})},tagName:"div"}),(null==_?void 0:_.updated)&&(0,l.jsx)(r.A,{id:"updated_date",defaultMessage:"<b>Updated :</b> {updated} ",values:{b:e=>(0,l.jsx)("b",{children:e}),updated:b(_.updated,{dateStyle:"long",timeStyle:"short"})},tagName:"div"})]})}),_&&"DRAFT"===_.status&&j("removeProduct")?(0,l.jsx)(c.A,{onClick:M}):null]}),A?(0,l.jsx)(m.A,{}):(0,l.jsx)(n6,{product:_,extendedData:N})]})}},30267:(e,t,n)=>{n.d(t,{W:()=>l});let l={SimpleProduct:"SimpleProduct",BundleProduct:"BundleProduct",PlanProduct:"PlanProduct",ConfigurableProduct:"ConfigurableProduct",TokenizedProduct:"TokenizedProduct"}},46660:(e,t,n)=>{n.d(t,{A:()=>u});var l=n(96427),a=n(79350),s=n(53588),i=n(14025);function r(){let e=(0,l._)(["\n mutation UpdateProduct($productId: ID!, $product: UpdateProductInput!) {\n updateProduct(productId: $productId, product: $product) {\n ...ProductDetailFragment\n }\n }\n ","\n"]);return r=function(){return e},e}let d=(0,a.J1)(r(),i.A),u=()=>{let[e]=(0,s.n)(d);return{updateProduct:async t=>{let{productId:n,product:{tags:l,sequence:a,meta:s}}=t;return e({variables:{productId:n,product:{tags:l,sequence:a,meta:s}}})}}}},47646:(e,t,n)=>{n.d(t,{A:()=>d});var l=n(37876),a=n(15039),s=n.n(a),i=n(43503),r=n(74231);let d=e=>{let{options:t,...n}=(0,i.A)(e),{className:a}=e||{className:""};return(0,l.jsx)(r.A,{...n,children:(0,l.jsx)("div",{className:"select-wrap",children:(0,l.jsxs)("select",{className:s()("mt-1 block w-full dark:bg-slate-900 rounded-md border border-slate-200 dark:text-white dark:border-slate-700 py-2.5 pl-3 pr-10 text-base text-black shadow-xs focus:border-indigo-400 focus:outline-hidden focus:ring-indigo-400 sm:text-sm",a,{"border-red-300 text-red-600":!!n.error}),disabled:n.disabled,id:n.name,name:n.name,onChange:n.onChange,onBlur:n.onBlur,value:n.value,children:[(!!n.placeholder||!n.required)&&(0,l.jsx)("option",{className:"dark:text-slate-200",value:"",disabled:n.required,hidden:n.required,children:n.placeholder||n.label}),Object.entries(t).map(e=>{let[t,n]=e;return(0,l.jsx)("option",{className:"dark:text-slate-200",value:t,children:n},t)})]})})})}},49563:(e,t,n)=>{n.d(t,{A:()=>r});var l=n(37876),a=n(15039),s=n.n(a),i=n(43503);let r=e=>{let{disabled:t,labelClassName:n,containerClassName:a,inputClassName:r,...d}=e,u=(0,i.A)({...e,type:"checkbox"});return(0,l.jsxs)("div",{className:s()("",{"text-red-600":!!u.error,checkbox:!0,disabled:u.disabled,required:u.required},a),children:[(0,l.jsx)("input",{checked:!!u.value,disabled:t,id:u.name,name:u.name,onChange:u.onChange,onBlur:u.onBlur,type:"checkbox",className:(s()("h-4 w-4 rounded-xs border-slate-300 text-indigo-600 focus:ring-indigo-400"),r),...d}),(0,l.jsx)("label",{htmlFor:u.name,className:s()("text-sm text-slate-900 dark:text-slate-200",n,{"text-danger":!!u.error}),children:u.label})]})}},54760:(e,t,n)=>{n.d(t,{A:()=>s});var l=n(96427);function a(){let e=(0,l._)(["\n fragment CurrencyFragment on Currency {\n _id\n isoCode\n isActive\n contractAddress\n decimals\n }\n"]);return a=function(){return e},e}let s=(0,n(79350).J1)(a())},64378:(e,t,n)=>{n.d(t,{A:()=>a});var l=n(14232);let a=l.forwardRef(function(e,t){let{title:n,titleId:a,...s}=e;return l.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:t,"aria-labelledby":a},s),n?l.createElement("title",{id:a},n):null,l.createElement("path",{fillRule:"evenodd",d:"M7.5 6v.75H5.513c-.96 0-1.764.724-1.865 1.679l-1.263 12A1.875 1.875 0 0 0 4.25 22.5h15.5a1.875 1.875 0 0 0 1.865-2.071l-1.263-12a1.875 1.875 0 0 0-1.865-1.679H16.5V6a4.5 4.5 0 1 0-9 0ZM12 3a3 3 0 0 0-3 3v.75h6V6a3 3 0 0 0-3-3Zm-3 8.25a3 3 0 1 0 6 0v-.75a.75.75 0 0 1 1.5 0v.75a4.5 4.5 0 1 1-9 0v-.75a.75.75 0 0 1 1.5 0v.75Z",clipRule:"evenodd"}))})},73607:(e,t,n)=>{n.d(t,{A:()=>l});let l=(e,t,n)=>Object.assign({},...(null==e?void 0:e.map(e=>({[e[n]]:e[t]})))||[])},93192:(e,t,n)=>{n.d(t,{A:()=>s});var l=n(96427);function a(){let e=(0,l._)(["\n fragment ProductTextsFragment on ProductTexts {\n _id\n locale\n slug\n title\n subtitle\n description\n vendor\n brand\n labels\n }\n"]);return a=function(){return e},e}let s=(0,n(79350).J1)(a())}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3285],{1097:(e,t,n)=>{n.d(t,{A:()=>d});var l=n(37876),s=n(14232),i=n(77742),a=n(61881),r=n(98670);let o=(e,t)=>{let n=[];return e.forEach(e=>{let{_id:l,isoCode:s}=e;n.push({_id:l,isoCode:s}),t.forEach(e=>{let{isoCode:t,_id:i}=e,a="".concat(s,"_").concat(t.toLowerCase());n.push({_id:"".concat(i,"-").concat(l),isoCode:a})})}),n},d=e=>{let{children:t}=e,{languages:n,loading:d}=(0,a.A)(),{countries:u}=(0,r.A)(),{locale:c}=(0,i.A)(),[g,m]=(0,s.useState)(c);(0,s.useEffect)(()=>{if(!d){var e;let t=null==(e=n.filter(e=>e.isBase||e.isoCode===c))?void 0:e.map(e=>{let{isoCode:t}=e;return t});m(t.includes(c)?c:t[0])}},[n,d,c]);let x=o(n,u);return(0,l.jsxs)("div",{className:"my-3",children:[(0,l.jsx)("div",{className:"relative mb-2",children:(0,l.jsx)("div",{className:"w-fit ml-auto",children:(0,l.jsx)("select",{id:"locale-wrapper",className:"cursor-pointer rounded-md border-slate-300 dark:border-slate-700 py-1 pr-8 text-sm lg:py-1 lg:pr-10 text-black dark:text-slate-400 dark:bg-slate-800",value:g,onChange:e=>{e.stopPropagation(),m(e.target.value)},children:null==x?void 0:x.map(e=>(0,l.jsx)("option",{value:e.isoCode,children:e.isoCode},e._id))})})}),(0,l.jsx)("div",{children:s.cloneElement(t,{selectedLocale:g})})]})}},21112:(e,t,n)=>{n.d(t,{A:()=>s});var l=n(37876);let s=()=>(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 text-indigo-500 group-hover:text-indigo-400",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:(0,l.jsx)("path",{d:"M8.5 17c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm7-10c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm-7 3c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm7 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-7-14c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})})},23342:(e,t,n)=>{n.d(t,{A:()=>j});var l=n(37876),s=n(14232),i=n(77742),a=n(54287),r=n(63727),o=n(21088),d=n(26985),u=n(67032),c=n(10920),g=n(9875);let m=()=>{let{setModal:e}=(0,c.A)(),{formatMessage:t}=(0,i.A)();return{displayImageInModal:n=>{let{url:s,closeOnOutsideClick:i=!0}=n;e((0,l.jsx)("div",{className:"flex h-96 w-96",children:(0,l.jsx)(g.A,{src:s,alt:t({id:"image-not-found",defaultMessage:"Image not found"}),className:"absolute top-0 left-0 -z-10 h-full w-full grow object-contain object-center",layout:"fill"})}),{closeOnOutsideClick:i})}}};var x=n(29639),h=n(78801),f=n(85269),v=n(47345),p=n(21112);let j=e=>{var t;let{media:n,mediaText:c,onEdit:j,isEdit:b,onDelete:N,onUpdate:y,id:w}=e,{formatMessage:C}=(0,i.A)(),{displayImageInModal:A}=m(),$=C({id:"media_updated",defaultMessage:"Media updated"}),k=(0,u.A)({submit:y,successMessage:$,initialValues:{title:c.title||"",subtitle:c.subTitle||""}});(0,s.useEffect)(()=>{c&&k.formik.setValues(c)},[c]);let{attributes:_,listeners:S,setNodeRef:I,transform:M,transition:q}=(0,a.gl)({id:w}),F={transform:r.Ks.Transform.toString(M),transition:q};return(0,l.jsxs)("li",{ref:I,style:F,className:"flex flex-wrap gap-4 rounded-sm hover:cursor-pointer",children:[(0,l.jsxs)("div",{className:"flex-1 basis-1/3",children:[(0,l.jsx)("a",{onClick:()=>{var e;return A({url:null==n||null==(e=n.file)?void 0:e.url})},children:(0,l.jsx)(g.A,{src:null==n||null==(t=n.file)?void 0:t.url,alt:(null==c?void 0:c.title)||(null==c?void 0:c.subtitle)||C({id:"error-loading-image-alt",defaultMessage:"Error loading image"}),className:"h-36 w-36 flex-none rounded-md bg-slate-10 object-cover object-center",width:100,height:100})}),(null==n?void 0:n.tags)&&(0,l.jsx)("div",{className:"space-x-2",children:null==n?void 0:n.tags.map((e,t)=>(0,l.jsx)("span",{className:"rounded border px-1 text-sm font-light capitalize text-slate-900 dark:text-slate-200 shadow-xs dark:shadow-none",children:e},"".concat(e).concat(t+1)))})]}),(0,l.jsx)("div",{className:"my-auto flex-1 basis-1/3",children:(0,l.jsx)(o.A,{form:k,children:(0,l.jsxs)("div",{className:"space-y-2 sm:flex sm:flex-col sm:items-start sm:justify-between",children:[(0,l.jsxs)("div",{className:"flex flex-auto flex-col justify-center space-y-1 text-sm font-medium text-slate-900 dark:text-slate-200",children:[(0,l.jsx)("h3",{children:b?(0,l.jsx)(d.A,{name:"title",label:C({id:"title",defaultMessage:"Title"})}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{children:C({id:"media_title",defaultMessage:"Title:"})}),(0,l.jsx)("span",{className:"ml-2",children:null==c?void 0:c.title})]})}),(0,l.jsx)("p",{className:"sm:block",children:b?(0,l.jsx)(d.A,{name:"subtitle",label:C({id:"subtitle",defaultMessage:"Subtitle"})}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{children:C({id:"media_subtitle",defaultMessage:"Subtitle:"})}),(0,l.jsx)("span",{className:"ml-2",children:null==c?void 0:c.subtitle})]})})]}),(0,l.jsx)(v.A,{}),b?(0,l.jsx)(f.A,{className:"justify-end",onCancel:()=>j(!b)}):(0,l.jsx)("button",{id:"edit",type:"button",onClick:e=>{e.stopPropagation(),j(!b)},children:(0,l.jsx)(h.A,{})})]})})}),(0,l.jsxs)("span",{className:"flex items-center",onClick:e=>{e.stopPropagation()},children:[(0,l.jsx)("button",{type:"button",..._,...S,className:"hover:cursor-move",children:(0,l.jsx)(p.A,{})}),(0,l.jsx)(x.A,{className:"mt-2 mr-2",onClick:async e=>{e.stopPropagation(),N(n._id)}})]})]},n._id)}},27956:(e,t,n)=>{n.d(t,{A:()=>c});var l=n(37876),s=n(14232),i=n(99854),a=n(89625),r=n(9668),o=n(13867),d=n(77742);function u(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(Boolean).join(" ")}let c=e=>{let{options:t,type:n}=e,[c,g]=(0,s.useState)(!1),[m,x]=(0,s.useState)(null==t?void 0:t.filter(e=>{let{current:t}=e;return t})[0]),{formatMessage:h}=(0,d.A)();return(null==m?void 0:m.id)?(0,l.jsx)(i.WF,{value:m,onChange:x,children:e=>{let{open:d}=e;return(0,l.jsxs)("div",{id:m.id,children:[(0,l.jsx)(i.WF.Label,{className:"sr-only",children:h({id:"select_options_toggle",defaultMessage:"Change {type} status"},{type:n})}),(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)("div",{className:"inline-flex divide-x rounded-md shadow-xs divide-".concat(null==m?void 0:m.bgColor,"-600"),children:(0,l.jsxs)("div",{onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),className:"relative z-0 inline-flex divide-x rounded-md shadow-xs divide-".concat(null==m?void 0:m.bgColor,"-600"),children:[(0,l.jsxs)("div",{className:u("inline-flex items-center bg-".concat(null==m?void 0:m.bgColor,"-500 hover:cursor-pointer rounded-l-md border border-transparent py-[0.3rem] pl-2 pr-2 text-white shadow-xs lg:py-2 lg:pl-3 lg:pr-4"),c&&"bg-".concat(null==m?void 0:m.bgColor,"-600")),children:[(0,l.jsx)(r.A,{className:"h-4 w-4 lg:h-5 lg:w-5","aria-hidden":"true"}),(0,l.jsx)("p",{className:"ml-2.5 text-xs font-medium lg:text-sm",children:(null==m?void 0:m.selectedTitle)||m.title})]}),(0,l.jsxs)(i.WF.Button,{className:u("inline-flex items-center bg-".concat(null==m?void 0:m.bgColor,"-500 hover:cursor-pointer rounded-l-none rounded-r-md border-none text-sm font-medium text-white outline-hidden focus:z-10 focus:outline-hidden "),c&&"bg-".concat(null==m?void 0:m.bgColor,"-600")),children:[(0,l.jsx)("span",{className:"absolute inset-0"}),(0,l.jsx)("span",{className:"sr-only",children:h({id:"select_options_toggle",defaultMessage:"Change {type} status"},{type:n})}),(0,l.jsx)(o.A,{className:"h-4 w-4 text-white lg:h-5 lg:w-5","aria-hidden":"true"})]})]})}),(0,l.jsx)(a.e,{show:d,as:s.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,l.jsx)(i.WF.Options,{className:"mt-1 absolute right-0 z-10 w-full origin-top-right divide-y divide-slate-200 overflow-hidden rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-hidden",children:t.map(e=>(0,l.jsx)(i.WF.Option,{className:()=>u("group hover:bg-indigo-500 hover:text-white",(null==e?void 0:e.disable)&&"cursor-not-allowed",e.id===m.id?"text-white bg-".concat(e.bgColor,"-500"):"text-slate-900","relative cursor-default select-none px-4 py-2 text-sm"),value:e,disabled:e.disable,children:(0,l.jsxs)("div",{className:"flex flex-col ".concat((null==e?void 0:e.disable)&&"pointer-events-none"," "),onClick:null==e?void 0:e.onClick,children:[(0,l.jsxs)("div",{className:"flex cursor-pointer justify-between",children:[(0,l.jsx)("p",{className:e.id===m.id?"font-semibold":"font-normal",children:e.title}),e.id===m.id?(0,l.jsx)("span",{className:e.id===m.id?"text-white":"text-indigo-500",children:(0,l.jsx)(r.A,{className:"h-5 w-5","aria-hidden":"true"})}):null]}),(0,l.jsx)("div",{className:u("mt-2",e.id===m.id?"text-green-100":"text-slate-500 group-hover:text-white",""),children:null==e?void 0:e.description})]})},e.title))})})]})]})}}):null}},61881:(e,t,n)=>{n.d(t,{A:()=>d});var l=n(96427),s=n(79350),i=n(54431),a=n(98714);function r(){let e=(0,l._)(["\n query Languages(\n $queryString: String\n $offset: Int\n $limit: Int\n $includeInactive: Boolean\n $sort: [SortOptionInput!]\n ) {\n languages(\n queryString: $queryString\n offset: $offset\n limit: $limit\n includeInactive: $includeInactive\n sort: $sort\n ) {\n ...LanguageFragment\n }\n languagesCount(includeInactive: $includeInactive, queryString: $queryString)\n }\n ","\n"]);return r=function(){return e},e}let o=(0,s.J1)(r(),a.A),d=function(){let{queryString:e="",limit:t=20,offset:n=0,includeInactive:l=!0,sort:s=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{data:a,loading:r,error:d}=(0,i.IT)(o,{variables:{queryString:e,limit:t,offset:n,includeInactive:l,sort:s}});return{languages:(null==a?void 0:a.languages)||[],languagesCount:null==a?void 0:a.languagesCount,loading:r,error:d}}},66448:(e,t,n)=>{n.d(t,{A:()=>a});var l=n(37876),s=n(54749),i=n(77742);let a=e=>{let{onClick:t,text:n=null,Icon:a=null}=e,{formatMessage:r}=(0,i.A)();return(0,l.jsxs)("button",{type:"button",onClick:t,"aria-describedby":"header-delete-button",className:"my-auto flex items-center justify-center rounded-sm border-2 border-red-600 px-3 py-2 text-sm font-semibold text-red-600 shadow-xs hover:border-red-800 hover:bg-red-700 hover:text-white focus:outline-hidden focus:ring-2 focus:ring-red-700 focus:ring-offset-2",children:[(0,l.jsx)("span",{className:"pr-1",children:a||(0,l.jsx)(s.A,{className:"h-5 w-5"})}),n||r({id:"delete",defaultMessage:"Delete"})]})}},70420:(e,t,n)=>{n.d(t,{A:()=>o});var l=n(37876),s=n(15039),i=n.n(s),a=n(14232),r=n(77742);let o=e=>{let{enableDragAndDrop:t=!0,onlyDragAndDrop:n,text:s=null,addMedia:o}=e,[d,u]=(0,a.useState)(!1),{formatMessage:c}=(0,r.A)();return(0,l.jsxs)(l.Fragment,{children:[!n&&(0,l.jsxs)("div",{className:"text-slate-500 dark:text-slate-200",children:[(0,l.jsx)("h3",{className:"text-lg font-medium leading-6 text-slate-900 dark:text-slate-200",children:c({id:"avatar",defaultMessage:"Avatar"})}),(0,l.jsxs)("div",{className:"my-4 flex items-center",children:[(0,l.jsx)("span",{className:"inline-block h-12 w-12 overflow-hidden rounded-full bg-slate-100",children:(0,l.jsx)("svg",{className:"h-full w-full text-slate-300 dark:text-slate-200",fill:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{d:"M24 20.993V24H0v-2.996A14.977 14.977 0 0112.004 15c4.904 0 9.26 2.354 11.996 5.993zM16.002 8.999a4 4 0 11-8 0 4 4 0 018 0z"})})}),(0,l.jsx)("button",{type:"button",className:"ml-5 rounded-md border border-slate-300 bg-white py-2 px-3 text-sm font-medium leading-4 text-slate-700 shadow-xs hover:bg-slate-50 focus:outline-hidden focus:ring-2 focus:ring-indigo-400 focus:ring-offset-2",children:s||c({id:"upload",defaultMessage:"Upload"})})]})]}),t&&(0,l.jsxs)("div",{id:"media_uploader",onDrop:e=>{e.stopPropagation(),e.preventDefault();let{files:t}=e.dataTransfer;[...t].forEach(e=>{o(e)}),u(!1)},onDragOver:e=>{e.stopPropagation(),e.preventDefault(),u(!0)},onDragEnter:e=>{e.stopPropagation(),e.preventDefault(),u(!0)},onDragLeave:e=>{e.stopPropagation(),e.preventDefault(),u(!1)},className:"text-slate-500 dark:text-slate-200",children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-slate-700 dark:text-slate-200"}),(0,l.jsx)("div",{className:i()("mt-1 flex justify-center rounded-md border-2 border-dashed border-slate-300 px-6 pt-5 pb-6",{"border-indigo-600":d}),children:(0,l.jsxs)("div",{className:"space-y-1 text-center",children:[(0,l.jsx)("svg",{className:"mx-auto h-12 w-12 text-slate-400 dark:text-slate-200",stroke:"currentColor",fill:"none",viewBox:"0 0 48 48","aria-hidden":"true",children:(0,l.jsx)("path",{d:"M28 8H12a4 4 0 00-4 4v20m32-12v8m0 0v8a4 4 0 01-4 4H12a4 4 0 01-4-4v-4m32-4l-3.172-3.172a4 4 0 00-5.656 0L28 28M8 32l9.172-9.172a4 4 0 015.656 0L28 28m0 0l4 4m4-24h8m-4-4v8m-12 4h.02",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,l.jsxs)("div",{className:"flex text-sm text-slate-600 dark:text-slate-200",children:[(0,l.jsxs)("label",{htmlFor:"file-upload",className:"px-1 mr-1 relative cursor-pointer rounded-md font-medium text-indigo-600 dark:text-indigo-200 focus-within:outline-hidden focus-within:ring-2 focus-within:ring-indigo-500 focus-within:ring-offset-2 hover:text-indigo-500",children:[(0,l.jsx)("span",{children:c({id:"upload_file",defaultMessage:"Upload a file"})}),(0,l.jsx)("input",{id:"file-upload",name:"file-upload",type:"file",className:"sr-only",onChange:e=>{e.stopPropagation(),e.preventDefault();let{files:t}=e.target;[...t].forEach(e=>{o(e)}),u(!1)}})]}),(0,l.jsx)("p",{className:"pl-1",children:c({id:"or_drag_and_drop",defaultMessage:"or drag and drop"})})]}),(0,l.jsx)("p",{className:"text-xs",children:"PNG, JPG, GIF up to 10MB"})]})})]})]})}},78801:(e,t,n)=>{n.d(t,{A:()=>i});var l=n(37876),s=n(21111);let i=()=>(0,l.jsx)("div",{id:"edit__icon_button",className:"rounded-full bg-white dark:bg-slate-800 dark:hover:bg-slate-600 px-1 py-1 text-sm text-indigo-500 hover:bg-indigo-50 focus:outline-hidden focus:ring-0 focus:ring-red-500 focus:ring-offset-2",children:(0,l.jsx)(s.A,{className:"h-5 w-5"})})},83149:(e,t,n)=>{n.d(t,{A:()=>d});var l=n(96427),s=n(79350),i=n(54431),a=n(15284);function r(){let e=(0,l._)(["\n query Products(\n $queryString: String\n $tags: [LowerCaseString!]\n $slugs: [String!]\n $limit: Int\n $offset: Int\n $includeDrafts: Boolean\n $sort: [SortOptionInput!]\n ) {\n products(\n queryString: $queryString\n tags: $tags\n slugs: $slugs\n limit: $limit\n offset: $offset\n includeDrafts: $includeDrafts\n sort: $sort\n ) {\n ...ProductBriefFragment\n }\n productsCount(\n tags: $tags\n slugs: $slugs\n includeDrafts: $includeDrafts\n queryString: $queryString\n )\n }\n ","\n"]);return r=function(){return e},e}let o=(0,s.J1)(r(),a.A),d=function(){let{queryString:e="",limit:t=20,offset:n=0,tags:l=null,includeDrafts:s=!0,slugs:a=null,sort:r=[],forceLocale:d=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{data:u,loading:c,error:g}=(0,i.IT)(o,{context:{headers:{forceLocale:d}},variables:{queryString:e,limit:t,offset:n,includeDrafts:s,tags:l,slugs:a,sort:r.length?r:[{key:"sequence",value:"ASC"}]}}),m=(null==u?void 0:u.products)||[],x=null==u?void 0:u.productsCount,h=(null==m?void 0:m.length)<x;return{products:m,productsCount:x,hasMore:h,loading:c,error:g}}},90203:(e,t,n)=>{n.d(t,{A:()=>u});var l=n(37876),s=n(15039),i=n.n(s),a=n(38442),r=n(74231),o=n(43503),d=n(99922);let u=e=>{let{data:t,onFilter:n,...s}=e,u=(0,o.A)({...s}),c=(0,d.A)(200)(n);return(0,l.jsx)("div",{className:"relative flex flex-col items-center dark:text-slate-900",children:(0,l.jsx)("div",{className:"w-full",children:(0,l.jsx)("div",{className:i()("my-2 flex items-center rounded-sm border-slate-200 dark:border-slate-800",s.className),children:(0,l.jsx)("div",{className:"w-full",children:(0,l.jsx)(r.A,{...u,children:(0,l.jsx)(a.Ay,{isDisabled:!!u.disabled,id:u.id,isLoading:s.isLoading,name:u.name,onBlur:u.onBlur,onInputChange:c,onChange:e=>{let{value:t}=e;u.setValue(t,!0)},placeholder:u.placeholder,options:null==t?void 0:t.map(e=>({label:e.title,value:e.id}))})})})})})})}},97232:(e,t,n)=>{n.d(t,{A:()=>i});var l=n(96427);function s(){let e=(0,l._)(["\n fragment CountryFragment on Country {\n _id\n isoCode\n isActive\n isBase\n\n defaultCurrency {\n _id\n isoCode\n }\n }\n"]);return s=function(){return e},e}let i=(0,n(79350).J1)(s())},98670:(e,t,n)=>{n.d(t,{A:()=>d});var l=n(96427),s=n(79350),i=n(54431),a=n(97232);function r(){let e=(0,l._)(["\n query Countries(\n $queryString: String\n $limit: Int\n $offset: Int\n $includeInactive: Boolean\n $sort: [SortOptionInput!]\n ) {\n countries(\n queryString: $queryString\n limit: $limit\n offset: $offset\n includeInactive: $includeInactive\n sort: $sort\n ) {\n ...CountryFragment\n }\n countriesCount(includeInactive: $includeInactive, queryString: $queryString)\n }\n\n ","\n"]);return r=function(){return e},e}let o=(0,s.J1)(r(),a.A),d=function(){let{queryString:e="",limit:t=20,offset:n=0,includeInactive:l=!0,sort:s=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{data:a,loading:r,error:d}=(0,i.IT)(o,{variables:{queryString:e,limit:t,offset:n,includeInactive:l,sort:s}}),u=(null==a?void 0:a.countries)||[],c=null==a?void 0:a.countriesCount,g=(null==u?void 0:u.length)<c;return{countries:u,countriesCount:c,hasMore:g,loading:r,error:d}}},98714:(e,t,n)=>{n.d(t,{A:()=>i});var l=n(96427);function s(){let e=(0,l._)(["\n fragment LanguageFragment on Language {\n _id\n isoCode\n isActive\n isBase\n name\n }\n"]);return s=function(){return e},e}let i=(0,n(79350).J1)(s())}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3572],{3359:(e,t,l)=>{l.d(t,{A:()=>n});var a=l(37876),r=l(15039),s=l.n(r);let n=e=>{var t;let{value:l,className:r,onChange:n=()=>{},...i}=e;return(0,a.jsx)("textarea",{className:s()("text-black dark:bg-slate-900 dark:text-slate-200 border-slate-200 dark:border-slate-800",r),value:l,onChange:n,rows:Math.max(((null==(t=l||" ")?void 0:t.split(" "))||[]).length/2,7),...i})}},6284:(e,t,l)=>{l.d(t,{A:()=>r});var a=l(14232);let r=a.forwardRef(function(e,t){let{title:l,titleId:r,...s}=e;return a.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:t,"aria-labelledby":r},s),l?a.createElement("title",{id:r},l):null,a.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"}))})},10920:(e,t,l)=>{l.d(t,{A:()=>s});var a=l(14232),r=l(88591);let s=()=>(0,a.useContext)(r.A)},11764:(e,t,l)=>{l.d(t,{A:()=>o});var a=l(37876),r=l(14232);let s=r.forwardRef(function(e,t){let{title:l,titleId:a,...s}=e;return r.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:t,"aria-labelledby":a},s),l?r.createElement("title",{id:a},l):null,r.createElement("path",{fillRule:"evenodd",d:"M8.603 3.799A4.49 4.49 0 0 1 12 2.25c1.357 0 2.573.6 3.397 1.549a4.49 4.49 0 0 1 3.498 1.307 4.491 4.491 0 0 1 1.307 3.497A4.49 4.49 0 0 1 21.75 12a4.49 4.49 0 0 1-1.549 3.397 4.491 4.491 0 0 1-1.307 3.497 4.491 4.491 0 0 1-3.497 1.307A4.49 4.49 0 0 1 12 21.75a4.49 4.49 0 0 1-3.397-1.549 4.49 4.49 0 0 1-3.498-1.306 4.491 4.491 0 0 1-1.307-3.498A4.49 4.49 0 0 1 2.25 12c0-1.357.6-2.573 1.549-3.397a4.49 4.49 0 0 1 1.307-3.497 4.49 4.49 0 0 1 3.497-1.307Zm7.007 6.387a.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"}))});var n=l(89244),i=l(15039),d=l.n(i);let o=e=>{let{isActive:t,activeIcon:l=null,inActiveIcon:r=null,activeClassName:i="",inActiveClassName:o="",containerClassName:c="",iconClassName:u=""}=e;return(0,a.jsx)("span",{className:d()("",c),children:t?l||(0,a.jsx)(s,{className:d()("text-green-400 w-5 h-5 mr-2",u,i)}):r||(0,a.jsx)(n.A,{className:d()("text-red-400 w-5 h-5 mr-2",u,o)})})}},22953:(e,t,l)=>{l.d(t,{A:()=>o});var a=l(37876),r=l(15039),s=l.n(r),n=l(3359),i=l(43503),d=l(74231);let o=e=>{var t;let{validators:l=[],rows:r=10,...o}=e,c=(0,i.A)({...o,validators:[...l,{isValid:e=>{try{var t;return null==(t=JSON)||t.parse(e),!0}catch(e){return!1}},intlMessageDescriptor:{id:"invalid_json_input",defaultMessage:"Invalid JSON input"}}]});return(0,a.jsx)(d.A,{...c,children:(0,a.jsx)(n.A,{className:s()("mt-1 block w-full max-w-full rounded-md border-2 border-slate-200 dark:border-slate-800 dark:bg-slate-900 dark:text-slate-200 shadow-xs dark:shadow-none focus:border-indigo-400 focus:ring-indigo-400 sm:text-sm",{"border-red-300 text-red-600 focus:border-red-600 focus:ring-red-600":!!c.error},o.className),disabled:c.disabled,id:c.name,name:c.name,onChange:e=>{try{JSON.parse(e.target.value||"{}"),c.setError("")}catch(e){var t;c.setError(null==(t=e.message)?void 0:t.replace("JSON.parse",""))}finally{c.setValue(e.target.value,!0),c.setTouched(!0)}},onBlur:e=>{try{c.setValue(JSON.stringify(JSON.parse(e.target.value),void 0,2),!0),c.setError("")}catch(e){c.setError(e.message)}},placeholder:c.placeholder,autoComplete:c.autoComplete,value:c.value,rows:Math.max(((null==(t=c.value)?void 0:t.split(" "))||[]).length/2,r)})})}},31094:(e,t,l)=>{l.d(t,{A:()=>s});var a=l(37876),r=l(77742);let s=e=>{let{onOkClick:t,onCancelClick:l,okText:s=null,cancelText:n=null,headerText:i=null,message:d=null,icon:o=null,close:c=null}=e,{formatMessage:u}=(0,r.A)();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"sm:flex sm:items-start",children:[o||(0,a.jsx)("div",{className:"mx-auto flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10",children:(0,a.jsx)("svg",{className:"h-6 w-6 text-red-600",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:(0,a.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,a.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,a.jsx)("h3",{className:"text-lg font-medium leading-6 text-slate-900 dark:text-slate-200",id:"modal-title",children:i||u({id:"warning",defaultMessage:"Warning!"})}),(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)("p",{className:"text-sm text-slate-500 dark:text-slate-200",children:d||u({id:"are_you_sure",defaultMessage:"Are you sure?"})})})]})]}),(0,a.jsxs)("div",{className:"mt-5 sm:mt-4 sm:flex sm:flex-row-reverse",children:[(0,a.jsx)("button",{id:"danger_continue",onClick:t,type:"button",className:"inline-flex w-full justify-center rounded-md border border-transparent bg-red-600 px-4 py-2 text-base font-medium text-white shadow-xs hover:bg-red-700 focus:outline-hidden focus:ring-2 focus:ring-red-500 focus:ring-offset-2 sm:ml-3 sm:w-auto sm:text-sm",children:s||u({id:"continue",defaultMessage:"Continue"})}),(0,a.jsx)("button",{id:"danger_cancel",onClick:l||c,type:"button",className:"mt-3 inline-flex w-full justify-center rounded-md border border-slate-300 bg-white px-4 py-2 text-base font-medium text-slate-700 shadow-xs hover:bg-slate-50 focus:outline-hidden focus:ring-2 focus:ring-indigo-400 focus:ring-offset-2 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm",children:n||u({id:"cancel",defaultMessage:"Cancel"})})]})]})}},33865:(e,t,l)=>{l.d(t,{A:()=>h});var a=l(37876),r=l(6284),s=l(77742),n=l(85126),i=l(84338),d=l(59884),o=l(22953),c=l(69230),u=l(67032),m=l(21088),f=l(47345);let x=e=>{let{onSubmit:t,onSubmitSuccess:l,provider:r,readOnly:n}=e,{formatMessage:i}=(0,s.A)(),d=(0,u.A)({initialValues:{configuration:JSON.stringify((null==r?void 0:r.configuration)||{},null,2)},submit:t,getSubmitErrorMessage:async e=>(null==e?void 0:e.message)||"",onSubmitSuccess:l});return(0,a.jsx)(m.A,{form:d,className:"mt-6",children:(0,a.jsxs)("div",{className:"mt-1 sm:mt-0",children:[(0,a.jsx)(o.A,{id:"configuration",name:"configuration",value:d.formik.values.configuration,label:i({id:"configuration",defaultMessage:"Configuration"})}),(0,a.jsx)(f.A,{}),(0,a.jsx)(c.A,{hidden:n,label:i({id:"update_configuration",defaultMessage:"Update configuration"}),className:"my-2"})]})})};var g=l(11764);let h=e=>{let{provider:t,onSubmit:l,onSubmitSuccess:o,readOnly:c}=e,{formatMessage:u}=(0,s.A)(),{formatDateTime:m}=(0,i.A)();return(0,a.jsx)("div",{className:"my-6",children:(0,a.jsx)("div",{className:"space-y-8 divide-y divide-slate-200",children:(0,a.jsxs)("div",{className:"space-y-8 divide-y divide-slate-200 sm:space-y-5",children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("h3",{className:"text-2xl font-medium leading-6 text-slate-900 dark:text-slate-200 mr-2",children:(0,n.SS)(null==t?void 0:t.interface)}),(0,a.jsx)(g.A,{containerClassName:"self-end",isActive:null==t?void 0:t.isActive})]}),(0,a.jsxs)("div",{className:"mt-6 flex flex-col",children:[(0,a.jsxs)("div",{className:"flex flex-col items-start sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex justify-center py-4 sm:py-5",children:[(0,a.jsx)("dt",{className:"my-auto inline-block text-sm font-medium text-slate-400 ",children:u({id:"type_colon",defaultMessage:"Type:"})}),(0,a.jsx)("dd",{className:"bg-".concat(d.m7[null==t?void 0:t.type],"-100 text-").concat(d.m7[null==t?void 0:t.type],"-800 ml-4 inline-block rounded-lg border p-2 text-lg font-bold leading-4"),children:null==t?void 0:t.type})]}),(0,a.jsxs)("div",{className:"flex flex-col justify-center",children:[(0,a.jsxs)("div",{className:"flex flex-auto items-center",children:[(0,a.jsx)("dt",{className:"text-sm font-normal text-slate-400 sm:justify-self-end pr-2",children:u({id:"created_colon",defaultMessage:"Created:"})}),(0,a.jsx)("dd",{className:"ml-auto text-base font-medium",children:m(null==t?void 0:t.created,{dateStyle:"long",timeStyle:"short"})})]}),(0,a.jsxs)("div",{className:"flex flex-auto",children:[(0,a.jsx)("dt",{className:"text-sm font-normal text-slate-400 sm:justify-self-end pr-2",children:u({id:"last_updated",defaultMessage:"Last Updated:"})}),(0,a.jsx)("dd",{className:"text-base font-medium",children:m(null==t?void 0:t.updated,{dateStyle:"long",timeStyle:"short"})})]})]})]}),(0,a.jsx)(x,{onSubmit:l,onSubmitSuccess:o,provider:t,readOnly:c}),(0,a.jsxs)("div",{className:"mt-6 mb-3",children:[(0,a.jsx)("dt",{className:"inline-block text-sm font-normal text-slate-400",children:u({id:"configuration_error",defaultMessage:"Configuration error"})}),(null==t?void 0:t.configurationError)?(0,a.jsx)("dd",{className:"block",children:null==t?void 0:t.configurationError}):(0,a.jsx)(r.A,{className:"ml-2 inline-block h-6 w-6 text-green-500"})]})]})]})})})}},47345:(e,t,l)=>{l.d(t,{A:()=>o});var a=l(37876),r=l(14232),s=l(90770);let n=e=>()=>{let t=document.getElementById(e);t&&t.focus()},i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.fromEntries(Object.entries(e).reduce(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],[l,a]=arguments.length>1?arguments[1]:void 0;return"string"==typeof a||r.isValidElement(a)?[...e,["".concat(t).concat(l),a]]:[...Object.entries(i(Object.assign({},...a),"".concat(t).concat(l,"."))),...e]},[]))},d=e=>{let{submitError:t="",fieldErrors:l=[]}=e;return(0,a.jsx)("div",{className:"mx-4 pl-4 text-left text-red-600",children:(0,a.jsxs)("ul",{className:"list-disc list-inside",children:[t&&(0,a.jsx)("li",{className:"disabled",children:(0,a.jsx)("span",{dangerouslySetInnerHTML:{__html:t}})},"submitError"),Object.entries(i(l)).map(e=>{let[t,l]=e;return(0,a.jsx)("li",{className:"disabled",children:(0,a.jsx)("button",{type:"button",className:"no-button text-red-600","aria-label":"Error button",onClick:n(t),children:r.isValidElement(l)?l:(0,a.jsx)("span",{dangerouslySetInnerHTML:{__html:l}})})},t)})]})})},o=e=>{let{displayFieldErrors:t=!1}=e,{submitError:l,formik:r}=(0,s.A)(),n=null==r?void 0:r.errors;return(l||t)&&(0,a.jsx)(d,{submitError:l,fieldErrors:t&&n})}},54749:(e,t,l)=>{l.d(t,{A:()=>r});var a=l(14232);let r=a.forwardRef(function(e,t){let{title:l,titleId:r,...s}=e;return a.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:t,"aria-labelledby":r},s),l?a.createElement("title",{id:r},l):null,a.createElement("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))})},66448:(e,t,l)=>{l.d(t,{A:()=>n});var a=l(37876),r=l(54749),s=l(77742);let n=e=>{let{onClick:t,text:l=null,Icon:n=null}=e,{formatMessage:i}=(0,s.A)();return(0,a.jsxs)("button",{type:"button",onClick:t,"aria-describedby":"header-delete-button",className:"my-auto flex items-center justify-center rounded-sm border-2 border-red-600 px-3 py-2 text-sm font-semibold text-red-600 shadow-xs hover:border-red-800 hover:bg-red-700 hover:text-white focus:outline-hidden focus:ring-2 focus:ring-red-700 focus:ring-offset-2",children:[(0,a.jsx)("span",{className:"pr-1",children:n||(0,a.jsx)(r.A,{className:"h-5 w-5"})}),l||i({id:"delete",defaultMessage:"Delete"})]})}},69230:(e,t,l)=>{l.d(t,{A:()=>d});var a=l(37876),r=l(15039),s=l.n(r),n=l(33905),i=l(90770);let d=e=>{let{label:t,disabled:l=!1,className:r="",hidden:d=!1,...o}=e,c=(0,n.j7)(),{...u}=o,m=Object.fromEntries(Object.keys(c.initialValues).map(e=>[e,c.getFieldMeta(e)])),{disabled:f}=(0,i.A)(),x=Object.values(m).reduce((e,t)=>{let{error:l,touched:a}=t;return e||l&&a},!1),g=l||f||c.isSubmitting||x;return(0,a.jsx)("input",{className:s()("inline-flex cursor-pointer justify-center rounded-md border border-transparent px-4 py-2 text-center text-sm font-medium leading-5 text-white shadow-xs focus:ring-indigo-400",r,{"bg-red-200 dark:bg-red-300 dark:text-red-900 cursor-not-allowed":g," bg-indigo-500 hover:bg-indigo-700 focus:outline-hidden focus:ring-2 focus:ring-offset-2 ":!g,hidden:d}),"aria-label":t,type:"submit",value:t,disabled:g,...u})}},84338:(e,t,l)=>{l.d(t,{A:()=>s});var a=l(18136),r=l(32479);let s=()=>({formatDateTime:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e||!Date.parse(e))return"n/a";try{let l="undefined"!=typeof navigator&&navigator.language||"de-ch";return Intl.DateTimeFormat(l,t).format(new Date(e).getTime())}catch(t){return Intl.DateTimeFormat("default",{year:"numeric",month:"short",day:"numeric"}).format(new Date(e).getTime())}},getDateFormatPattern:()=>{let e="undefined"!=typeof navigator&&navigator.language||"de-ch";return new Intl.DateTimeFormat(e).formatToParts(new Date).map(e=>{switch(e.type){case"day":return"d".repeat(e.value.length);case"month":return"M".repeat(e.value.length);case"year":return"y".repeat(e.value.length);case"literal":return e.value;default:return"dd.mm.yyyy"}}).join("")},parseDate:e=>(0,a.GP)((0,r.uk)(e,Intl.DateTimeFormat().resolvedOptions().timeZone),"yyyy-MM-dd")})},89244:(e,t,l)=>{l.d(t,{A:()=>r});var a=l(14232);let r=a.forwardRef(function(e,t){let{title:l,titleId:r,...s}=e;return a.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:t,"aria-labelledby":r},s),l?a.createElement("title",{id:r},l):null,a.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"}))})}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5501],{350:(e,s,a)=>{a.d(s,{A:()=>r});var t=a(96427);function l(){let e=(0,t._)(["\n fragment EnrollmentFragment on Enrollment {\n _id\n country {\n _id\n isoCode\n }\n currency {\n _id\n isoCode\n }\n enrollmentNumber\n updated\n status\n created\n expires\n isExpired\n periods {\n start\n end\n isTrial\n }\n payment {\n provider {\n _id\n }\n }\n delivery {\n provider {\n _id\n }\n }\n plan {\n product {\n _id\n media {\n _id\n file {\n _id\n url\n }\n }\n texts {\n _id\n title\n }\n }\n quantity\n }\n user {\n _id\n username\n name\n avatar {\n _id\n url\n }\n }\n }\n"]);return l=function(){return e},e}let r=(0,a(79350).J1)(l())},3580:(e,s,a)=>{a.d(s,{A:()=>i});var t=a(96427),l=a(79350),r=a(53588);function n(){let e=(0,t._)(["\n mutation DeleteUser($userId: ID) {\n removeUser(userId: $userId) {\n _id\n }\n }\n"]);return n=function(){return e},e}let d=(0,l.J1)(n()),i=()=>{let[e]=(0,r.n)(d);return{deleteUser:async function(){let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return e({variables:{userId:s}})}}}},3837:(e,s,a)=>{a.d(s,{A:()=>v});var t=a(37876),l=a(13626),r=a(15039),n=a.n(r),d=a(14232),i=a(77742),o=a(96427),u=a(79350),c=a(53588),m=a(51750);function x(){let e=(0,o._)(["\n mutation ExportToken(\n $tokenId: ID!\n $quantity: Int! = 1\n $recipientWalletAddress: String!\n ) {\n exportToken(\n tokenId: $tokenId\n quantity: $quantity\n recipientWalletAddress: $recipientWalletAddress\n ) {\n ...TokenFragment\n }\n }\n ","\n"]);return x=function(){return e},e}let h=(0,u.J1)(x(),m.A),f=()=>{let[e]=(0,c.n)(h);return{exportToken:async s=>{let{quantity:a,recipientWalletAddress:t,tokenId:l}=s;return e({variables:{quantity:a,recipientWalletAddress:t,tokenId:l}})}}},g=e=>{let{isOpen:s,addresses:a,cancel:l,onExport:r}=e,[n,o]=(0,d.useState)(""),{formatMessage:u}=(0,i.A)();return s&&(0,t.jsxs)("div",{className:"relative z-10","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",children:[(0,t.jsx)("div",{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"}),(0,t.jsx)("div",{className:"fixed inset-0 z-10 overflow-y-auto",children:(0,t.jsx)("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:(0,t.jsxs)("div",{className:"relative transform overflow-hidden rounded-lg bg-white px-4 pt-5 pb-4 text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg sm:p-6",children:[(0,t.jsx)("div",{children:(0,t.jsx)("fieldset",{className:"space-y-5",children:null==a?void 0:a.map(e=>{var s;return(0,t.jsxs)("div",{className:"relative flex items-start",children:[(0,t.jsx)("div",{className:"flex h-5 items-center",children:(0,t.jsx)("input",{id:e.address,name:"addresses",value:e.address,onChange:()=>{o(e.address)},checked:(null==n?void 0:n.toLowerCase())===(null==(s=e.address)?void 0:s.toLowerCase()),type:"checkbox",className:"h-4 w-4 rounded-sm border-gray-300 text-indigo-600 focus:ring-indigo-500"})}),(0,t.jsx)("div",{className:"ml-3 text-sm",children:(0,t.jsx)("label",{htmlFor:"comments",className:"font-medium text-gray-700",children:e.address})})]},e.address)})})}),(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsx)("label",{htmlFor:"Address",className:"block text-sm font-medium text-gray-700",children:u({id:"or_manually_enter_address",defaultMessage:"Or enter address manually"})}),(0,t.jsx)("div",{className:"mt-1",children:(0,t.jsx)("input",{type:"text",onChange:e=>o(e.target.value),value:n,name:"Address",id:"Address",className:"block w-full rounded-md border-gray-300 shadow-xs focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm",placeholder:"0xF5F72AE7fa1fa990ebaF163208Ed7aD6a3f42DEA"})})]}),(0,t.jsxs)("div",{className:"mt-5 sm:mt-6 sm:grid sm:grid-flow-row-dense sm:grid-cols-2 sm:gap-3",children:[(0,t.jsx)("button",{type:"button",onClick:()=>r(n),className:"inline-flex w-full justify-center rounded-md border border-transparent bg-indigo-600 px-4 py-2 text-base font-medium text-white shadow-xs hover:bg-indigo-700 focus:outline-hidden focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 sm:col-start-2 sm:text-sm",children:u({id:"export",defaultMessage:"Export"})}),(0,t.jsx)("button",{type:"button",onClick:l,className:"mt-3 inline-flex w-full justify-center rounded-md border border-gray-300 bg-white px-4 py-2 text-base font-medium text-gray-700 shadow-xs hover:bg-gray-50 focus:outline-hidden focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 sm:col-start-1 sm:mt-0 sm:text-sm",children:u({id:"cancel",defaultMessage:"Cancel"})})]})]})})})]})},v=e=>{let{tokenId:s,tokenStatus:a,addresses:r=[]}=e,{exportToken:o}=f(),{formatMessage:u}=(0,i.A)(),[c,m]=(0,d.useState)(!1),x=async e=>{await o({tokenId:s,recipientWalletAddress:e}),m(!1)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g,{isOpen:c,cancel:()=>{m(!1)},onExport:x,addresses:r}),"DECENTRALIZED"!==a&&(0,t.jsxs)("button",{type:"button",onClick:()=>m(!0),disabled:"EXPORTING"===a,className:n()(" text-center inline-flex truncate rounded-md border border-transparent bg-indigo-600 px-5 py-1 text-base font-medium text-white shadow-xs hover:bg-indigo-700 focus:outline-hidden focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2",{"bg-gray-400 hover:bg-gray-500":"EXPORTING"===a}),children:[(0,t.jsx)(l.A,{className:"w-6 h-6 mr-2"}),u("CENTRALIZED"===a?{id:"export",defaultMessage:"Export"}:{id:"exporting",defaultMessage:"Exporting"})]})]})}},4450:(e,s,a)=>{a.d(s,{A:()=>u});var t=a(34974),l=a(96427),r=a(79350),n=a(53588);function d(){let e=(0,l._)(["\n mutation CreateWebAuthnCredentialCreationOptions($username: String!) {\n createWebAuthnCredentialCreationOptions(username: $username)\n }\n"]);return d=function(){return e},e}let i=(0,r.J1)(d()),o=()=>{let[e]=(0,n.n)(i);return{createWebAuthnCredentialCreationOptions:async s=>{let{username:a}=s;return e({variables:{username:a}})}}},u=()=>{let{createWebAuthnCredentialCreationOptions:e}=o();return{generateWebAuthCredentials:async s=>{let{username:a}=s,{data:l}=await e({username:a}),{createWebAuthnCredentialCreationOptions:r}=l,n=new TextEncoder;r.challenge=(0,t.A)(r.challenge),r.user={id:n.encode(a),name:a,displayName:a};let d=await navigator.credentials.create({publicKey:r}),i=window.btoa(String.fromCharCode(...new Uint8Array(d.response.attestationObject))),o=window.btoa(String.fromCharCode(...new Uint8Array(d.response.clientDataJSON)));return{id:window.btoa(String.fromCharCode(...new Uint8Array(d.rawId))),response:{clientDataJSON:o,attestationObject:i}}}}}},7965:(e,s,a)=>{a.d(s,{A:()=>t});let t=e=>e?"".concat(e.substr(0,6),"...").concat(e.substr(-4,4)):"0x0"},10073:(e,s,a)=>{a.d(s,{A:()=>f});var t=a(37876),l=a(77742),r=a(83010),n=a(48230),d=a.n(n),i=a(99583),o=a(36729),u=a(47334),c=a(66985),m=a(84338);let x={REQUESTED:"orange",PROCESSING:"yellow",PROPOSED:"cyan",REJECTED:"red",FULLFILLED:"green"},h=e=>{var s,a,n;let{quotation:h,showUser:f}=e,{formatMessage:g}=(0,l.A)(),{formatDateTime:v}=(0,m.A)();return(0,t.jsxs)(r.A.Row,{children:[(0,t.jsx)(r.A.Cell,{children:(0,t.jsx)("div",{className:"flex items-center text-sm ",children:(0,t.jsx)(d(),{href:"/quotations?quotationId=".concat(null==h?void 0:h._id),className:"font-medium text-blue-500 dark:text-blue-400",children:(null==h?void 0:h.quotationNumber)||(null==h?void 0:h._id)})})}),(0,t.jsx)(r.A.Cell,{children:(0,t.jsx)("div",{className:"flex items-center text-sm ",children:v(h.created,{dateStyle:"short",timeStyle:"short"})})}),(0,t.jsx)(r.A.Cell,{children:(0,t.jsx)("div",{className:"flex items-center text-sm ",children:h.isExpired?(0,t.jsx)(i.A,{text:g({id:"expired",defaultMessage:"Expired"}),color:"red"}):v(null==h?void 0:h.expires,{dateStyle:"short",timeStyle:"short"})})}),f&&(0,t.jsx)(r.A.Cell,{children:(0,t.jsxs)(d(),{href:"/users?userId=".concat(null==h?void 0:h.user._id),className:"flex items-center text-sm text-blue-500 dark:text-blue-400 hover:text-decoration",children:[(0,t.jsx)(o.A,{file:null==h||null==(s=h.user)?void 0:s.avatar,className:"mr-2"}),(0,t.jsx)("span",{className:"font-medium ml-2",children:(0,u.A)(null==h?void 0:h.user)})]})}),(0,t.jsx)(r.A.Cell,{children:(0,t.jsx)("div",{children:(0,t.jsxs)(d(),{href:"/products?slug=".concat((0,c.Ay)(h.product)),className:"flex items-center text-sm text-blue-500 dark:text-blue-400 hover:text-decoration",children:[(0,t.jsx)(o.A,{file:null==(n=h.product)||null==(a=n.media[0])?void 0:a.file,className:"mr-2"}),(0,t.jsx)("span",{className:"font-medium ml-2",children:null==h?void 0:h.product.texts.title})]})})}),(0,t.jsx)(r.A.Cell,{children:(0,t.jsx)(i.A,{text:null==h?void 0:h.status,color:x[null==h?void 0:h.status],square:!0})})]})},f=e=>{let{quotations:s,sortable:a=!1,showUser:n=!1}=e,{formatMessage:d}=(0,l.A)();return(0,t.jsxs)(r.A,{className:"min-w-full",children:[null==s?void 0:s.map(e=>(0,t.jsxs)(r.A.Row,{header:!0,enableSort:a,children:[(0,t.jsx)(r.A.Cell,{sortKey:"quotationNumber",children:d({id:"quotation_number",defaultMessage:"Quotation number"})}),(0,t.jsx)(r.A.Cell,{sortKey:"created",children:d({id:"created",defaultMessage:"Created"})}),(0,t.jsx)(r.A.Cell,{sortKey:"expires",children:d({id:"expires",defaultMessage:"Expires"})}),n&&(0,t.jsx)(r.A.Cell,{children:d({id:"user",defaultMessage:"User"})}),(0,t.jsx)(r.A.Cell,{children:d({id:"product",defaultMessage:"Product"})}),(0,t.jsx)(r.A.Cell,{sortKey:"status",children:d({id:"status",defaultMessage:"Status"})})]},null==e?void 0:e._id)),null==s?void 0:s.map(e=>(0,t.jsx)(h,{showUser:n,quotation:e},"".concat(null==e?void 0:e._id,"-body")))]})}},11764:(e,s,a)=>{a.d(s,{A:()=>o});var t=a(37876),l=a(14232);let r=l.forwardRef(function(e,s){let{title:a,titleId:t,...r}=e;return l.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:s,"aria-labelledby":t},r),a?l.createElement("title",{id:t},a):null,l.createElement("path",{fillRule:"evenodd",d:"M8.603 3.799A4.49 4.49 0 0 1 12 2.25c1.357 0 2.573.6 3.397 1.549a4.49 4.49 0 0 1 3.498 1.307 4.491 4.491 0 0 1 1.307 3.497A4.49 4.49 0 0 1 21.75 12a4.49 4.49 0 0 1-1.549 3.397 4.491 4.491 0 0 1-1.307 3.497 4.491 4.491 0 0 1-3.497 1.307A4.49 4.49 0 0 1 12 21.75a4.49 4.49 0 0 1-3.397-1.549 4.49 4.49 0 0 1-3.498-1.306 4.491 4.491 0 0 1-1.307-3.498A4.49 4.49 0 0 1 2.25 12c0-1.357.6-2.573 1.549-3.397a4.49 4.49 0 0 1 1.307-3.497 4.49 4.49 0 0 1 3.497-1.307Zm7.007 6.387a.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"}))});var n=a(89244),d=a(15039),i=a.n(d);let o=e=>{let{isActive:s,activeIcon:a=null,inActiveIcon:l=null,activeClassName:d="",inActiveClassName:o="",containerClassName:u="",iconClassName:c=""}=e;return(0,t.jsx)("span",{className:i()("",u),children:s?a||(0,t.jsx)(r,{className:i()("text-green-400 w-5 h-5 mr-2",c,d)}):l||(0,t.jsx)(n.A,{className:i()("text-red-400 w-5 h-5 mr-2",c,o)})})}},14724:(e,s,a)=>{a.d(s,{A:()=>u});var t=a(37876),l=a(15039),r=a.n(l),n=a(43503),d=a(88817),i=a(74231);let o=e=>{let s=new Date(e);return isNaN(s.getTime())?null:s.toISOString().split("T")[0]},u=e=>{let{validators:s=[],className:a,parseDate:l=o,...u}=e,c=(0,n.A)({validators:[...s,d.ZV],...u}),m=c.value?new Date(c.value).toISOString().split("T")[0]:"";return(0,t.jsx)(i.A,{...c,className:u.containerClassName,children:(0,t.jsx)("input",{type:"date",id:c.id,name:c.name,disabled:c.disabled,className:r()("relative mt-0 block w-full appearance-none rounded-md rounded-b-md border-2 border-slate-200 dark:border-slate-800 px-4 py-2.5 text-sm text-slate-900 dark:text-slate-200 dark:bg-slate-900 placeholder-slate-400 shadow-xs focus:z-10 focus:border-indigo-400 focus:outline-hidden focus:ring-indigo-400",a,{"border-red-300":!!c.error}),onChange:e=>c.setValue(e.target.value),value:m,placeholder:c.placeholder,autoComplete:"off",...u})})}},30217:(e,s,a)=>{a.d(s,{A:()=>l});var t=a(14232);let l=t.forwardRef(function(e,s){let{title:a,titleId:l,...r}=e;return t.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:s,"aria-labelledby":l},r),a?t.createElement("title",{id:l},a):null,t.createElement("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 0 0-5.25 5.25v3a3 3 0 0 0-3 3v6.75a3 3 0 0 0 3 3h10.5a3 3 0 0 0 3-3v-6.75a3 3 0 0 0-3-3v-3c0-2.9-2.35-5.25-5.25-5.25Zm3.75 8.25v-3a3.75 3.75 0 1 0-7.5 0v3h7.5Z",clipRule:"evenodd"}))})},34974:(e,s,a)=>{a.d(s,{A:()=>t});let t=e=>{if(window.atob&&Uint8Array){let s=window.atob(e),a=s.length,t=new Uint8Array(a);for(let e=0;e<a;e+=1)t[e]=s.charCodeAt(e);return t.buffer}throw Error("The atob and Uint8Array methods are not available")}},36729:(e,s,a)=>{a.d(s,{A:()=>o});var t=a(37876),l=a(15039),r=a.n(l),n=a(77742),d=a(9875),i=a(95218);let o=e=>{let{file:s,className:a}=e,{formatMessage:l}=(0,n.A)();return(0,t.jsx)("div",{className:r()("h-10 w-10 shrink-0",a),children:s?(0,t.jsx)(d.A,{className:"relative h-10 w-10 rounded-full",src:s.url,width:100,height:100,alt:l({id:"image_not_available",defaultMessage:"Image not available"})}):(0,t.jsx)(i.A,{})})}},40027:(e,s,a)=>{a.d(s,{A:()=>i});var t=a(37876),l=a(15039),r=a.n(l),n=a(14232),d=a(26985);let i=e=>{let{autoComplete:s="on",...a}=e,[l,i]=(0,n.useState)(!1),o=e=>{e.preventDefault(),i(!l)};return(0,t.jsxs)("div",{className:r()("relative",a.className),children:[(0,t.jsx)(d.A,{autoComplete:s||"on",name:"password",...a,type:l?"text":"password"}),(0,t.jsx)("div",{className:"relative",children:(0,t.jsx)("span",{role:"button",tabIndex:-1,"aria-label":"toggle password visibility",className:"absolute translate-y-[-150%] outline-hidden block right-3",onClick:o,onKeyUp:o,children:l?(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"#6366F1",children:[(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]}):(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"#6366F1",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"})})})})]})}},42910:(e,s,a)=>{a.d(s,{A:()=>sX});var t=a(37876),l=a(14232);let r=l.forwardRef(function(e,s){let{title:a,titleId:t,...r}=e;return l.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:s,"aria-labelledby":t},r),a?l.createElement("title",{id:t},a):null,l.createElement("path",{fillRule:"evenodd",d:"M7.5 6a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM3.751 20.105a8.25 8.25 0 0 1 16.498 0 .75.75 0 0 1-.437.695A18.683 18.683 0 0 1 12 22.5c-2.786 0-5.433-.608-7.812-1.7a.75.75 0 0 1-.437-.695Z",clipRule:"evenodd"}))});var n=a(30217),d=a(62932);let i=l.forwardRef(function(e,s){let{title:a,titleId:t,...r}=e;return l.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:s,"aria-labelledby":t},r),a?l.createElement("title",{id:t},a):null,l.createElement("path",{d:"M12 7.5a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5Z"}),l.createElement("path",{fillRule:"evenodd",d:"M1.5 4.875C1.5 3.839 2.34 3 3.375 3h17.25c1.035 0 1.875.84 1.875 1.875v9.75c0 1.036-.84 1.875-1.875 1.875H3.375A1.875 1.875 0 0 1 1.5 14.625v-9.75ZM8.25 9.75a3.75 3.75 0 1 1 7.5 0 3.75 3.75 0 0 1-7.5 0ZM18.75 9a.75.75 0 0 0-.75.75v.008c0 .414.336.75.75.75h.008a.75.75 0 0 0 .75-.75V9.75a.75.75 0 0 0-.75-.75h-.008ZM4.5 9.75A.75.75 0 0 1 5.25 9h.008a.75.75 0 0 1 .75.75v.008a.75.75 0 0 1-.75.75H5.25a.75.75 0 0 1-.75-.75V9.75Z",clipRule:"evenodd"}),l.createElement("path",{d:"M2.25 18a.75.75 0 0 0 0 1.5c5.4 0 10.63.722 15.6 2.075 1.19.324 2.4-.558 2.4-1.82V18.75a.75.75 0 0 0-.75-.75H2.25Z"}))});var o=a(63151);let u=l.forwardRef(function(e,s){let{title:a,titleId:t,...r}=e;return l.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:s,"aria-labelledby":t},r),a?l.createElement("title",{id:t},a):null,l.createElement("path",{d:"M4.5 3.75a3 3 0 0 0-3 3v.75h21v-.75a3 3 0 0 0-3-3h-15Z"}),l.createElement("path",{fillRule:"evenodd",d:"M22.5 9.75h-21v7.5a3 3 0 0 0 3 3h15a3 3 0 0 0 3-3v-7.5Zm-18 3.75a.75.75 0 0 1 .75-.75h6a.75.75 0 0 1 0 1.5h-6a.75.75 0 0 1-.75-.75Zm.75 2.25a.75.75 0 0 0 0 1.5h3a.75.75 0 0 0 0-1.5h-3Z",clipRule:"evenodd"}))});var c=a(64456),m=a(86622),x=a(77742),h=a(39416),f=a(84338),g=a(85126);let v=e=>{let{label:s,value:a}=e;return(0,t.jsxs)("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between mb-3",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-gray-600 mb-1 md:mb-0 md:mr-4",children:s}),(0,t.jsx)("span",{className:"text-sm text-left text-gray-900",children:a})]})},p=e=>{var s;let{loginData:a}=e,{formatMessage:l,locale:r}=(0,x.A)(),{formatDateTime:n}=(0,f.A)();return a?(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow-md overflow-hidden mt-4 p-4",children:[(0,t.jsx)(v,{label:l({id:"country",defaultMessage:"Country"}),value:(null==a?void 0:a.countryCode)&&(0,g.gQ)(r,null==a?void 0:a.countryCode)}),(0,t.jsx)(v,{label:l({id:"language",defaultMessage:"Language"}),value:(null==a?void 0:a.locale)&&(0,g.Sn)(r,null==(s=a.locale)?void 0:s.split("_")[0])}),(0,t.jsx)(v,{label:l({id:"browser",defaultMessage:"Browser"}),value:a.userAgent}),(0,t.jsx)(v,{label:l({id:"ip",defaultMessage:"IP Address"}),value:a.remoteAddress}),(0,t.jsx)(v,{label:l({id:"time",defaultMessage:"Time"}),value:a.timestamp?n(a.timestamp,{dateStyle:"short",timeStyle:"short"}):"n/a"})]}):null},b=e=>{let{firstName:s,lastName:a,company:l,addressLine:r,addressLine2:n,postalCode:d,countryCode:i,regionCode:o,city:u}=e,{formatMessage:c,locale:m}=(0,x.A)();return(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow-md overflow-hidden mt-4 p-4",children:[(0,t.jsx)(v,{label:c({id:"fullName",defaultMessage:"FullName"}),value:"".concat(s||""," ").concat(a||"")}),(0,t.jsx)(v,{label:c({id:"company",defaultMessage:"Company"}),value:l}),(0,t.jsx)(v,{label:c({id:"address",defaultMessage:"Address"}),value:r}),(0,t.jsx)(v,{label:c({id:"address2",defaultMessage:"Address 2"}),value:n}),(0,t.jsx)(v,{label:c({id:"postal_code",defaultMessage:"Postal/ZIP code"}),value:d}),(0,t.jsx)(v,{label:c({id:"country",defaultMessage:"Country"}),value:(0,g.gQ)(m,i)}),(0,t.jsx)(v,{label:c({id:"city",defaultMessage:"City"}),value:u}),(0,t.jsx)(v,{label:c({id:"region",defaultMessage:"Region"}),value:o})]})},w=e=>{let{lastBillingAddress:s,lastLogin:a}=e;return(0,t.jsxs)("div",{className:"container mx-auto p-4",children:[(0,t.jsx)("div",{className:"row",children:(0,t.jsx)(p,{loginData:a})}),(0,t.jsx)("div",{className:"row",children:(0,t.jsx)(b,{...s})})]})};var j=a(91562),y=a(38755),A=a(96427),N=a(79350),_=a(54431),M=a(61697),k=a(15284),C=a(40338);function I(){let e=(0,A._)(["\n query UserProductReviews(\n $userId: ID!\n $limit: Int\n $offset: Int\n $sort: [SortOptionInput!]\n ) {\n user(userId: $userId) {\n _id\n reviews(limit: $limit, offset: $offset, sort: $sort) {\n ...ProductReviewDetailFragment\n product {\n ...ProductBriefFragment\n }\n }\n reviewsCount\n }\n }\n ","\n ","\n"]);return I=function(){return e},e}let E=(0,N.J1)(I(),C.A,k.A),S=e=>{let{userId:s=null,limit:a=10,offset:t=0,sort:l=[{key:"created",value:M.t4.Desc}]}=e,{data:r,loading:n,error:d,fetchMore:i}=(0,_.IT)(E,{skip:!s,variables:{userId:s,limit:a,offset:t,sort:l}}),o=null==r?void 0:r.user,u=(null==o?void 0:o.reviews)||[];return{reviews:u,loading:n,error:d,loadMore:()=>{i({variables:{offset:null==u?void 0:u.length}})},reviewsCount:(null==o?void 0:o.reviewsCount)||0}};var R=a(65291),$=a(5314);let P=e=>{let{_id:s}=e,{formatMessage:a}=(0,x.A)(),{reviews:l,loadMore:r,reviewsCount:n}=S({userId:s});return(0,t.jsxs)("div",{className:"space-y-4 mt-4 bg-white",children:[(0,t.jsx)(R.A,{reviews:l,enableDelete:!0,showProduct:!0}),n>(null==l?void 0:l.length)?(0,t.jsx)($.A,{text:a({id:"load-more-reviews",defaultMessage:"Load reviews"}),className:"",onClick:r}):null]})};var U=a(8733),q=a(41863),D=a(65146),T=a(15922),L=a(4301),F=a(21088),O=a(47345),V=a(40027),Z=a(69230),W=a(67032),J=a(53588);function H(){let e=(0,A._)(["\n mutation ChangePassword($oldPassword: String!, $newPassword: String!) {\n changePassword(oldPassword: $oldPassword, newPassword: $newPassword) {\n success\n }\n }\n"]);return H=function(){return e},e}let B=(0,N.J1)(H()),z=()=>{let[e]=(0,J.n)(B);return{changePassword:async s=>{let{oldPassword:a,newPassword:t}=s;return e({variables:{oldPassword:a,newPassword:t}})}}},K=()=>{let{changePassword:e}=z(),{formatMessage:s}=(0,x.A)(),a=async s=>{var a;let{oldPassword:t,newPassword:l}=s,{data:r}=await e({oldPassword:t,newPassword:l});return{success:null==r||null==(a=r.changePassword)?void 0:a.success}},l=(0,W.A)({submit:a,enableReinitialize:!0,onSubmitSuccess:()=>(L.oR.success(s({id:"password_success",defaultMessage:"Password changed successfully."})),!0),getSubmitErrorMessage:e=>(L.oR.error(s({id:"password_change_failed",defaultMessage:"Password change failed, try again later"},{error:e.message})),s({id:"password_change_failed",defaultMessage:"Password change failed, try again later"},{error:e.message})),validate:e=>{let{newPassword:a,oldPassword:t}=e;return a===t?{misMatchError:s({id:"password_identical",defaultMessage:"Provided new password identical to previous password"})}:{}},initialValues:{oldPassword:"",newPassword:""}});return(0,t.jsxs)(F.A,{form:l,children:[(0,t.jsxs)("div",{className:"relative max-w-full mb-4 p-3 space-y-6 sm:p-6",children:[(0,t.jsx)(V.A,{label:s({id:"current_password",defaultMessage:"Current password"}),placeholder:s({id:"current_password",defaultMessage:"Current password"}),name:"oldPassword",id:"oldPassword",required:!0,className:"text-sm"}),(0,t.jsx)(V.A,{label:s({id:"new_password",defaultMessage:"New password"}),placeholder:s({id:"new_password",defaultMessage:"New password"}),name:"newPassword",id:"newPassword",required:!0,className:"text-sm"})]}),(0,t.jsx)(O.A,{displayFieldErrors:!0}),(0,t.jsx)("div",{className:"border-t-indigo-50 border-t dark:border-t-slate-700 space-y-6 bg-slate-50 dark:bg-slate-800 text-right p-6",children:(0,t.jsx)(Z.A,{label:s({id:"change_password",defaultMessage:"Change password"})})})]})};var Q=a(15039),G=a.n(Q),X=a(26985),Y=a(90362);function ee(){let e=(0,A._)(["\n mutation AddEmail($email: String!, $userId: ID) {\n addEmail(email: $email, userId: $userId) {\n ...UserFragment\n }\n }\n ","\n"]);return ee=function(){return e},e}let es=(0,N.J1)(ee(),Y.A),ea=()=>{let[e]=(0,J.n)(es);return{addEmail:async s=>{let{email:a,userId:t}=s;return e({variables:{email:a,userId:t}})}}};function et(){let e=(0,A._)(["\n mutation RemoveEmail($email: String!, $userId: ID) {\n removeEmail(email: $email, userId: $userId) {\n ...UserFragment\n }\n }\n ","\n"]);return et=function(){return e},e}let el=(0,N.J1)(et(),Y.A),er=()=>{let[e]=(0,J.n)(el);return{removeEmail:async s=>{let{email:a,userId:t}=s;return e({variables:{email:a,userId:t}})}}};function en(){let e=(0,A._)(["\n mutation SendVerificationEmail($email: String) {\n sendVerificationEmail(email: $email) {\n success\n }\n }\n"]);return en=function(){return e},e}let ed=(0,N.J1)(en()),ei=()=>{let[e]=(0,J.n)(ed);return{sendVerificationEmail:async s=>{let{email:a}=s;return e({variables:{email:a}})}}};var eo=a(10920),eu=a(31094),ec=a(11764),em=a(29639);let ex=e=>{let{emails:s,userId:a,enableVerification:l,emailBodyContainer:r}=e,{removeEmail:n}=er(),{sendVerificationEmail:d}=ei(),{addEmail:i}=ea(),{formatMessage:o}=(0,x.A)(),{setModal:u}=(0,eo.A)(),c=async e=>{let{email:s}=e;return await i({email:s,userId:a}),{success:!0}},m=async e=>{let{email:s}=e;await u((0,t.jsx)(eu.A,{onCancelClick:async()=>u(""),message:o({id:"delete_email_confirmation",defaultMessage:"This action might cause inconsistencies with other data that relates to it. Are you sure you want to delete this email? "}),onOkClick:async()=>{u(""),await n({email:s,userId:a}),L.oR.success(o({id:"email_deleted",defaultMessage:"email {id} deleted successfully"},{id:a}))},okText:o({id:"delete_email",defaultMessage:"Delete email"})}))},h=async e=>{let{email:s}=e,{data:a}=await d({email:s});a.sendVerificationEmail.success?L.oR.success(o({id:"verification_sent_success",defaultMessage:"Verification email sent successfully "})):L.oR.error(o({id:"verification_sent_error",defaultMessage:"Error occurred while sending verification email, please try again"}))},f=o({id:"email_added",defaultMessage:"Email added successfully!"}),g=(0,W.A)({submit:c,successMessage:f,enableReinitialize:!0,initialValues:{email:""}});return(0,t.jsxs)("div",{className:G()("rounded-md shadow-sm px-4 py-5 sm:p-6 bg-white dark:bg-slate-800",r),children:[(0,t.jsx)("ul",{className:"-my-5 divide-y divide-slate-200 dark:divide-slate-700",children:(s||[]).map(e=>{let{address:s,verified:a}=e;return(0,t.jsx)("li",{className:"py-4",children:(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between",children:[(0,t.jsxs)("div",{className:"mr-2 flex max-w-md flex-wrap items-center space-x-2",children:[(0,t.jsx)("div",{className:"truncate text-sm font-medium text-slate-900 dark:text-slate-200",children:s}),(0,t.jsx)(ec.A,{isActive:a})]}),(0,t.jsxs)("div",{className:"my-1 flex items-center cursor-pointer",children:[l&&!a&&(0,t.jsx)("a",{id:"send_verification_mail",onClick:async()=>{await h({email:s})},className:"inline-flex items-center rounded-md dark:text-indigo-400 border border-slate-300 dark:border-slate-700 bg-white dark:bg-slate-800 px-4 py-2 text-sm font-medium text-slate-700 shadow-xs hover:bg-slate-50 focus:outline-hidden focus:ring-2 focus:ring-indigo-400 focus:ring-offset-2",children:o({id:"send_verification_mail",defaultMessage:"Send verification mail"})}),(0,t.jsx)(em.A,{className:"ml-2 inline-flex items-center rounded-full hover:bg-red-50",onClick:()=>m({email:s})})]})]})},s)})}),(0,t.jsx)(F.A,{form:g,children:(0,t.jsx)("div",{className:"mt-4 border-t dark:border-t-slate-700",children:(0,t.jsxs)("div",{className:"items-between mt-4 flex space-x-4",children:[(0,t.jsx)(X.A,{className:"mt-0",name:"email",required:!0,placeholder:o({id:"email",defaultMessage:"Email"}),label:o({id:"email",defaultMessage:"Email"})}),(0,t.jsx)("span",{className:"shrink-0 flex items-end",children:(0,t.jsx)(Z.A,{className:"py-2.5",label:o({id:"add_email",defaultMessage:"Add email"})})})]})})})]})};var eh=a(70806);function ef(){let e=(0,A._)(["\n mutation SetPassword($newPlainPassword: String!, $userId: ID!) {\n setPassword(newPassword: $newPlainPassword, userId: $userId) {\n ...UserFragment\n }\n }\n ","\n"]);return ef=function(){return e},e}let eg=(0,N.J1)(ef(),Y.A),ev=()=>{let[e]=(0,J.n)(eg);return{setPassword:async s=>{let{newPlainPassword:a,userId:t}=s;return e({variables:{newPlainPassword:a,userId:t}})}}},ep=e=>{let{userId:s,isInitialPassword:a,primaryEmail:l}=e,{hasRole:r}=(0,q.A)(),{setPassword:n}=ev(),{formatMessage:d}=(0,x.A)(),{sendEnrollmentEmail:i}=(0,eh.A)(),o=async e=>{let{newPassword:a}=e,{data:t}=await n({newPlainPassword:a,userId:s});return{success:!0,data:null==t?void 0:t.setPassword}},u=async()=>{var e;let{data:s}=await i({email:l.address});(null==s||null==(e=s.sendEnrollmentEmail)?void 0:e.success)?L.oR.success(d({id:"enrollment_success",defaultMessage:"Email sent to the user successfully"})):L.oR.error(d({id:"enrollment_error",defaultMessage:"Failed sending email, please try again"}))},c=(0,W.A)({submit:o,enableReinitialize:!0,onSubmitSuccess:()=>(L.oR.success(d({id:"password_success",defaultMessage:"Password changed successfully."})),null),getSubmitErrorMessage:e=>(L.oR.error(d({id:"password_change_failed",defaultMessage:"Password change failed, try again later"},{error:e.message})),d({id:"password_change_failed",defaultMessage:"Password change failed, try again later"},{error:e.message})),initialValues:{newPassword:""}});return(0,t.jsxs)(F.A,{form:c,children:[(0,t.jsx)("div",{className:"relative max-w-full mb-4 p-3 space-y-6 sm:p-6",children:(0,t.jsx)(V.A,{label:d({id:"new_password",defaultMessage:"New password"}),placeholder:d({id:"new_password",defaultMessage:"New password"}),name:"newPassword",id:"newPassword",required:!0,className:"text-sm"})}),(0,t.jsx)(O.A,{}),(0,t.jsxs)("div",{className:"border-t-indigo-50 border-t align-baseline flex items-center justify-between dark:border-t-slate-700 space-y-6 bg-slate-50 dark:bg-slate-800 text-right sm:p-6",children:[a&&(0,t.jsx)($.A,{text:d({id:"send__enrollment_email_button",defaultMessage:"Send enrollment Email"}),className:"mt-4",onClick:u}),(0,t.jsx)(Z.A,{label:d({id:"change_password",defaultMessage:"Change password"}),disabled:!r("editUserPassword")&&!r("editUser")})]})]})};function eb(){let e=(0,A._)(["\n mutation SetUsername($username: String!, $userId: ID!) {\n setUsername(username: $username, userId: $userId) {\n ...UserFragment\n }\n }\n ","\n"]);return eb=function(){return e},e}let ew=(0,N.J1)(eb(),Y.A),ej=()=>{let[e]=(0,J.n)(ew);return{setUserName:async s=>{let{username:a,userId:t}=s;return e({variables:{username:a,userId:t},refetchQueries:["User"]})}}},ey=e=>{let{_id:s,username:a}=e,{setUserName:r}=ej(),[n,d]=(0,l.useState)(!1),{formatMessage:i}=(0,x.A)(),{hasRole:o}=(0,q.A)(),u=async e=>{let{username:a}=e,t=await r({username:a,userId:s});return d(!1),{success:!0,data:t}},c=i({id:"username_updated",defaultMessage:"Username updated successfully!"}),m=(0,W.A)({submit:u,getSubmitErrorMessage:async e=>{var s;return(null==e||null==(s=e.message)?void 0:s.toLowerCase().includes("duplicate"))?i({id:"username_exists_error",defaultMessage:"Username is taken please provide another"}):(null==e?void 0:e.message)||""},successMessage:c,initialValues:{username:a}});return(0,t.jsx)(F.A,{form:m,children:(0,t.jsx)("dl",{className:"divide-y divide-slate-200",children:(0,t.jsxs)("div",{className:"flex flex-wrap items-center sm:grid sm:grid-cols-3 sm:gap-4",children:[(0,t.jsx)("div",{className:"shrink grow basis-2/5 text-sm font-medium text-slate-500 dark:text-slate-200",children:!n&&i({id:"username",defaultMessage:"Username"})}),(0,t.jsxs)("div",{className:"shrink mt-1 flex grow basis-3/5 flex-wrap items-center gap-4 text-sm sm:col-span-2 sm:mt-0 sm:gap-0",children:[(0,t.jsx)("span",{className:"grow",children:n?(0,t.jsx)(X.A,{className:"mt-0",name:"username",required:!0,label:i({id:"username",defaultMessage:"Username"})}):(0,t.jsx)("div",{className:"text-base font-medium text-slate-900 dark:text-white",children:a})}),(0,t.jsx)(O.A,{}),o("editUsername")&&(0,t.jsxs)("span",{className:"ml-4 mt-1 flex shrink-0 items-center space-x-4",children:[(0,t.jsx)("button",{"data-id":"cancel_update",onClick:()=>d(!n),type:"button",className:G()(n?"":"focus:ring-indigo-400","inline-flex items-center rounded-md border border-slate-300 bg-white px-4 py-2 text-sm font-medium text-slate-700 shadow-xs hover:bg-slate-50 focus:outline-hidden focus:ring-2 focus:ring-indigo-400 focus:ring-offset-2"),children:n?i({id:"cancel",defaultMessage:"Cancel"}):i({id:"update",defaultMessage:"Update"})}),n&&(0,t.jsx)("button",{type:"submit",className:"inline-flex items-center rounded-md border border-transparent bg-indigo-500 px-4 py-2 text-sm font-medium text-white shadow-xs hover:bg-indigo-700 focus:outline-hidden focus:ring-2 focus:ring-indigo-400 focus:ring-offset-2",children:i({id:"save",defaultMessage:"Save"})})]})]})]})})})};function eA(){let e=(0,A._)(["\n query SystemRoles {\n shopInfo {\n _id\n userRoles\n }\n }\n"]);return eA=function(){return e},e}let eN=(0,N.J1)(eA()),e_=()=>{var e;let{data:s,loading:a,error:t}=(0,_.IT)(eN);return{systemRoles:(null==s||null==(e=s.shopInfo)?void 0:e.userRoles)||[],loading:a,error:t}};var eM=a(43503);let ek=e=>{let{multiple:s,options:a,...l}=e,r=(0,eM.A)({multiple:s,options:a,...l}),{choiceClassName:n="col-md-6 col-lg-4'",choiceContainerClassName:d="",labelClassName:i="",inputClassName:o=""}=l,u="string"==typeof r.value?[r.value]:r.value,{className:c,hideLabel:m}=l;return(0,t.jsxs)("div",{className:G()("container",c,{"is-invalid":!!r.error,disabled:r.disabled,required:r.required}),children:[(0,t.jsx)("label",{className:G()("text-sm",c,{"text-red-600":!!r.error,"sr-only":m}),children:r.label}),(0,t.jsx)("div",{className:G()("row ".concat(d),c),children:Object.entries(r.options).map(e=>{let[s,a]=e;return(0,t.jsx)("div",{className:G()("mb-3 ".concat(n),c),children:(0,t.jsxs)("label",{htmlFor:"".concat(r.name,"-").concat(s),className:G()("",i),children:[(0,t.jsx)("input",{value:s,checked:u.includes(s),className:G()("mr-2 h-4 w-4 rounded-sm border-slate-300 text-indigo-600 focus:ring-indigo-400",o),disabled:r.disabled,id:"".concat(r.name,"-").concat(s),name:r.name,onChange:r.onChange,type:r.multiple?"checkbox":"radio"}),(0,t.jsx)("span",{children:a})]})},s)})})]})};function eC(){let e=(0,A._)(["\n mutation SetRoles($roles: [String!]!, $userId: ID!) {\n setRoles(roles: $roles, userId: $userId) {\n ...UserFragment\n }\n }\n ","\n"]);return eC=function(){return e},e}let eI=(0,N.J1)(eC(),Y.A),eE=()=>{let[e]=(0,J.n)(eI);return{setRoles:async s=>{let{roles:a=[],userId:t=null}=s;return e({variables:{roles:a,userId:t},refetchQueries:["User"]})}}},eS=e=>{let{roles:s,userId:a}=e,{formatMessage:l}=(0,x.A)(),{setRoles:r}=eE(),{hasRole:n}=(0,q.A)(),{systemRoles:d}=e_(),i=async e=>{let{updatedRoles:s}=e;return await r({roles:s,userId:a}),{success:!0}},o=l({id:"role_updated",defaultMessage:"Role updated successfully!"}),u=(0,W.A)({submit:i,successMessage:o,initialValues:{updatedRoles:[...s||[]]}});return(0,t.jsxs)(F.A,{form:u,children:[(0,t.jsx)(ek,{name:"updatedRoles",labelClassName:"flex items-center mt-1",choiceContainerClassName:"flex flex-wrap",inputClassName:"ml-2",options:Object.fromEntries((d||[]).map(e=>[e,e])),label:l({id:"select_role",defaultMessage:"Select role"}),placeholder:l({id:"select_role",defaultMessage:"Select role"}),multiple:!0},"user-roles"),(0,t.jsx)(O.A,{}),n("editUserRoles")&&(0,t.jsx)(Z.A,{disabled:!n("editUserRoles"),label:l({id:"update_role",defaultMessage:"Update role"})})]})};function eR(){let e=(0,A._)(["\n mutation SetUserTags($tags: [LowerCaseString]!, $userId: ID!) {\n setUserTags(tags: $tags, userId: $userId) {\n _id\n tags\n }\n }\n"]);return eR=function(){return e},e}let e$=(0,N.J1)(eR()),eP=()=>{let[e]=(0,J.n)(e$);return{setUserTags:async s=>{let{tags:a=[],userId:t=null}=s;return e({variables:{tags:a,userId:t}})}}};var eU=a(97377);let eq=e=>{let{tags:s=[],userId:a}=e,{hasRole:l}=(0,q.A)(),{setUserTags:r}=eP(),n=async e=>{let{tags:s}=e;await r({tags:s,userId:a})};return(0,t.jsx)(eU.A,{defaultValue:s,onSubmit:n,enableEdit:l("editUserTags")})};var eD=a(94038);function eT(){let e=(0,A._)(["\n mutation AddWebAuthnCredentials($credentials: JSON!) {\n addWebAuthnCredentials(credentials: $credentials) {\n ...UserFragment\n webAuthnCredentials {\n _id\n created\n aaguid\n counter\n mdsMetadata {\n ...MD5MetaDataFragment\n }\n }\n }\n }\n ","\n ","\n"]);return eT=function(){return e},e}let eL=(0,N.J1)(eT(),Y.A,eD.A),eF=()=>{let[e]=(0,J.n)(eL);return{addWebAuthnCredentials:async s=>{let{credentials:a}=s;return e({variables:{credentials:a}})}}};var eO=a(4450);function eV(){let e=(0,A._)(["\n mutation removeWebAuthCredentials($credentialsId: ID!) {\n removeWebAuthnCredentials(credentialsId: $credentialsId) {\n ...UserFragment\n }\n }\n ","\n"]);return eV=function(){return e},e}let eZ=(0,N.J1)(eV(),Y.A),eW=()=>{let[e]=(0,J.n)(eZ);return{removeWebAuthCredentials:async s=>{let{credentialsId:a}=s;return e({variables:{credentialsId:a}})}}};function eJ(){let e=(0,A._)(["\n query UserWebAuthnCredentials($userId: ID!) {\n user(userId: $userId) {\n _id\n webAuthnCredentials {\n _id\n created\n aaguid\n counter\n mdsMetadata {\n ...MD5MetaDataFragment\n }\n }\n }\n }\n ","\n"]);return eJ=function(){return e},e}let eH=(0,N.J1)(eJ(),eD.A),eB=e=>{var s;let{userId:a}=e,{data:t,loading:l,error:r}=(0,_.IT)(eH,{variables:{userId:a}});return{webAuthnCredentials:null==t||null==(s=t.user)?void 0:s.webAuthnCredentials,loading:l,error:r}};var ez=a(99583),eK=a(9875),eQ=a(53719);let eG=e=>{let{_id:s,aaguid:a,counter:l,created:r,md5Metadata:n,onRemoveCredential:d,removeDisabled:i}=e,{formatMessage:o}=(0,x.A)(),{formatDateTime:u}=(0,f.A)();return(0,t.jsxs)("li",{className:"col-span-1 flex shadow-xs rounded-md ",children:[(null==n?void 0:n.icon)&&(0,t.jsx)("div",{className:"shrink-0 flex items-center justify-center w-16 text-sm font-medium rounded-l-md",children:(0,t.jsx)(eK.A,{className:"inline-block h-10 w-10 rounded-full border-2",src:null==n?void 0:n.icon,loader:eQ.A,width:36,height:36,alt:o({id:"web_auth_icon",defaultMessage:"Auth icon"})})}),(0,t.jsxs)("div",{className:"flex-1 flex items-center justify-between border-t border-r border-b border-slate-200 dark:bg-slate-800 bg-white rounded-r-md truncate dark:text-slate-200",children:[(0,t.jsxs)("div",{className:"flex-1 px-4 py-2 text-sm truncate",children:[(0,t.jsx)("span",{className:"text-slate-900 dark:text-slate-200 font-medium ",children:a}),(0,t.jsx)("div",{className:"mt-1 mb-1",children:null==n?void 0:n.description}),(0,t.jsx)("div",{children:(0,t.jsx)(ez.A,{text:l})})]}),(0,t.jsxs)("div",{className:"shrink-0 pr-2 justify-between h-100 text-right",children:[(0,t.jsx)("div",{children:u(r)}),!i&&(0,t.jsx)("div",{className:"align-bottom",children:(0,t.jsx)(em.A,{onClick:()=>d(s)})})]})]})]})},eX=e=>{let{userId:s}=e,{formatMessage:a}=(0,x.A)(),{currentUser:r}=(0,T.A)(),{addWebAuthnCredentials:n}=eF(),{webAuthnCredentials:d}=eB({userId:s}),{setModal:i}=(0,eo.A)(),{hasRole:o}=(0,q.A)(),{generateWebAuthCredentials:u}=(0,eO.A)(),{removeWebAuthCredentials:c}=eW(),m=async e=>{await i((0,t.jsx)(eu.A,{onCancelClick:async()=>i(""),message:a({id:"delete_web_auth_credential",defaultMessage:"Are you sure you want to unlink this device from your account?"}),onOkClick:async()=>{i(""),await c({credentialsId:e}),L.oR.success(a({id:"web_auth_credential_removed",defaultMessage:"Credential removed successfully"}))}}))},h=async()=>{if(!r.username)return void L.oR.error(a({id:"web_auth_username_required",defaultMessage:"A username is required to use WebAuthn"}));let e=await u({username:r.username});await n({credentials:e})};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{children:(0,t.jsx)("ul",{className:"border-slate-200 divide-slate-200",children:null==d?void 0:d.map(e=>(0,l.createElement)(eG,{md5Metadata:null==e?void 0:e.mdsMetadata,...e,key:null==e?void 0:e._id,onRemoveCredential:m,removeDisabled:s!==(null==r?void 0:r._id)&&!o("editUserProfile")}))})}),(0,t.jsx)("button",{type:"button",disabled:s!==(null==r?void 0:r._id),className:G()("inline-flex cursor-pointer ml-4 justify-center rounded-md border border-transparent px-4 py-2 text-center text-sm font-medium leading-5 text-white shadow-xs focus:ring-indigo-400 bg-indigo-500 hover:bg-indigo-700 focus:outline-hidden focus:ring-2 focus:ring-offset-2",{"focus:ring-indigo-200 bg-indigo-300 hover:bg-indigo-200":s!==(null==r?void 0:r._id)}),onClick:h,children:a({id:"add_web_auth",defaultMessage:"Add WebAuth"})})]})};function eY(){let e=(0,A._)(["\n mutation RemoveWeb3Address($address: String!) {\n removeWeb3Address(address: $address) {\n ...UserFragment\n }\n }\n ","\n"]);return eY=function(){return e},e}let e0=(0,N.J1)(eY(),Y.A),e5=()=>{let[e]=(0,J.n)(e0);return{removeWeb3Address:async s=>{let{address:a}=s;return e({variables:{address:a}})}}};function e1(){let e=(0,A._)(["\n mutation AddWeb3Address($address: String!) {\n addWeb3Address(address: $address) {\n ...UserFragment\n }\n }\n ","\n"]);return e1=function(){return e},e}let e2=(0,N.J1)(e1(),Y.A),e7=()=>{let[e]=(0,J.n)(e2);return{addWeb3Address:async s=>{let{address:a}=s;return e({variables:{address:a}})}}},e3=e=>{let{text:s}=e,{formatMessage:a}=(0,x.A)(),[r,n]=(0,l.useState)(a({id:"copy_to_clipboard",defaultMessage:"Copy to clipboard"}));return(0,t.jsx)("div",{onClick:()=>{let e=document.createElement("textarea");e.value=document.getElementById("copyable").innerText,e.setAttribute("readonly",""),e.style.position="absolute",e.style.left="-9999px",document.body.appendChild(e);let s=document.getSelection().rangeCount>0&&document.getSelection().getRangeAt(0);e.select(),e.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(e),s&&(document.getSelection().removeAllRanges(),document.getSelection().addRange(s)),n(a({id:"copied",defaultMessage:"Copied"}))},className:"relative inline-flex items-center rounded-md border border-transparent bg-indigo-600 px-4 py-2 text-sm font-medium text-white shadow-xs hover:bg-indigo-700 focus:outline-hidden focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2",onMouseEnter:()=>n(a({id:"copy_to_clipboard",defaultMessage:"Copy to clipboard"})),children:(0,t.jsxs)("pre",{children:[(0,t.jsx)("span",{children:r}),(0,t.jsx)("code",{id:"copyable",className:"sr-only",children:s})]})})};var e4=a(25449);function e9(){let e=(0,A._)(["\n mutation VerifyWeb3Address($address: String!, $hash: String!) {\n verifyWeb3Address(address: $address, hash: $hash) {\n ...UserFragment\n }\n }\n ","\n"]);return e9=function(){return e},e}let e6=(0,N.J1)(e9(),Y.A),e8=()=>{let[e]=(0,J.n)(e6);return{verifyWeb3Address:async s=>{let{address:a,hash:t}=s;return e({variables:{address:a,hash:t}})}}},se=e=>{let{nonce:s,address:a,close:l}=e,{formatMessage:r}=(0,x.A)(),{verifyWeb3Address:n}=e8(),d=r({id:"web3_verified_success",defaultMessage:"Address verified successfully!"}),i=async e=>{let{hash:s}=e;return await n({hash:s,address:a}),l(),{success:!0}},o=(0,W.A)({submit:i,successMessage:d,enableReinitialize:!0,getSubmitErrorMessage:e=>{var s,a;return(null==e||null==(s=e.message)?void 0:s.toLowerCase().includes("signature does not match web3 account"))&&o.formik.setFieldError("hash",r({id:"signature_not_match_error",defaultMessage:"Signature does not match"})),(null==e||null==(a=e.message)?void 0:a.toLowerCase().includes("invalid signature length"))&&o.formik.setFieldError("hash",r({id:"invalid_signature_length",defaultMessage:"Invalid signature"})),r({id:"invalid_signature_length",defaultMessage:"Invalid signature"})},initialValues:{hash:""}});return(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"border-b border-gray-200 bg-white mb",children:(0,t.jsxs)("div",{className:"-ml-4 -mt-4 flex flex-wrap items-center justify-between sm:flex-nowrap",children:[(0,t.jsxs)("div",{className:"ml-4 mt-4",children:[(0,t.jsx)("h3",{className:"text-lg font-medium leading-6 text-gray-900",children:r({id:"sign_address_header",defaultMessage:"Sign address"})}),(0,t.jsx)("p",{className:"mt-1 text-sm text-gray-500 mb-4",children:(0,t.jsx)(U.A,{id:"web3_address_signature_instruction",defaultMessage:"<p>Copy the following nonce <b> ({nonce})</b> and past the signature on the space provided below </p>",values:{p:e=>(0,t.jsxs)("p",{children:[e," "]}),b:e=>(0,t.jsxs)("b",{className:"border-l text-2xl",children:[e," "]}),nonce:s}})})]}),(0,t.jsx)("div",{className:"ml-4 mt-4 shrink-0",children:(0,t.jsx)(e3,{text:s})})]})}),(0,t.jsxs)(F.A,{form:o,children:[(0,t.jsx)(e4.A,{required:!0,name:"hash",label:r({id:"signature_hash",defaultMessage:"Signature hash"}),placeholder:r({id:"signature_hash",defaultMessage:"Signature hash"})}),(0,t.jsxs)("div",{className:"mt-5 sm:mt-4 sm:flex sm:flex-row-reverse justify-between",children:[(0,t.jsx)(Z.A,{label:r({id:"register-with-web3",defaultMessage:"Register"})}),(0,t.jsx)("button",{id:"danger_cancel",onClick:l,type:"button",className:"mt-3 inline-flex w-full justify-center rounded-md border border-slate-300 bg-white px-4 py-2 text-base font-medium text-slate-700 shadow-xs hover:bg-slate-50 focus:outline-hidden focus:ring-2 focus:ring-indigo-400 focus:ring-offset-2 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm",children:r({id:"cancel",defaultMessage:"Cancel"})})]})]})]})},ss=e=>{let{web3Addresses:s}=e,{removeWeb3Address:a}=e5(),{addWeb3Address:l}=e7(),{formatMessage:r}=(0,x.A)(),{setModal:n}=(0,eo.A)(),d=async e=>{let{address:s}=e;return await l({address:s}),{success:!0}},i=async e=>{let{address:s}=e;await n((0,t.jsx)(eu.A,{onCancelClick:async()=>n(""),message:r({id:"delete_web3_address_confirmation",defaultMessage:"This action might cause inconsistencies with other data that relates to it. Are you sure you want to delete this address? "}),onOkClick:async()=>{n(""),await a({address:s}),L.oR.success(r({id:"web3_address_deleted",defaultMessage:"Address deleted successfully"}))},okText:r({id:"delete_web3_address",defaultMessage:"Delete address?"})}))},o=async e=>{let{address:s,nonce:a}=e;await n((0,t.jsx)(se,{address:s,nonce:a,close:async()=>n("")}))},u=r({id:"web3_address_added",defaultMessage:"Address added successfully!"}),c=(0,W.A)({submit:d,successMessage:u,enableReinitialize:!0,initialValues:{address:""}});return(0,t.jsxs)("div",{className:"rounded-md shadow-sm px-4 py-5 sm:p-6 bg-white dark:bg-slate-800",children:[(0,t.jsx)("ul",{className:"-my-5 divide-y divide-slate-200 dark:divide-slate-700",children:(s||[]).map(e=>{let{address:s,verified:a,nonce:l}=e;return(0,t.jsx)("li",{className:"py-4",children:(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between",children:[(0,t.jsxs)("div",{className:"mr-2 flex max-w-md flex-wrap items-center space-x-2",children:[(0,t.jsx)("div",{className:"truncate text-sm font-medium text-slate-900 dark:text-slate-200",children:s}),(0,t.jsx)(ec.A,{isActive:a})]}),(0,t.jsxs)("div",{className:"my-1 flex items-center cursor-pointer",children:[!a&&(0,t.jsx)("a",{id:"send_verification_mail",onClick:async()=>{await o({address:s,nonce:l})},className:"inline-flex items-center rounded-md border border-slate-300 bg-white px-4 py-2 text-sm font-medium text-slate-700 shadow-xs hover:bg-slate-50 focus:outline-hidden focus:ring-2 focus:ring-indigo-400 focus:ring-offset-2",children:r({id:"verification_web3_address",defaultMessage:"Verify"})}),(0,t.jsx)(em.A,{onClick:()=>i({address:s}),className:"ml-2 inline-flex items-center rounded-full bg-white hover:bg-red-50"})]})]})},s)})}),(0,t.jsx)(F.A,{form:c,children:(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsxs)("div",{className:"items-between mt-4 flex space-x-4",children:[(0,t.jsx)(X.A,{className:"mt-0",name:"address",required:!0,validators:[{isValid:e=>e.match(/^0x/)&&42===e.length,intlMessageDescriptor:{id:"invalid-web3-address",defaultMessage:"Invalid {label} "}}],placeholder:r({id:"web3_address",defaultMessage:"Web3 Address"}),label:r({id:"web3_address",defaultMessage:"Web3 Address"})}),(0,t.jsx)("span",{className:"shrink-0 flex items-end",children:(0,t.jsx)(Z.A,{className:"py-2.5",label:r({id:"add_web3_address",defaultMessage:"Add address"})})})]})})})]})},sa=e=>{let{_id:s,emails:a,web3Addresses:l,username:r,roles:n,tags:d,isInitialPassword:i,primaryEmail:o}=e,{formatMessage:u}=(0,x.A)(),{currentUser:c}=(0,T.A)(),{hasRole:m}=(0,q.A)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(D.A,{documentationLabel:u({id:"account",defaultMessage:"Account"}),documentation:u({id:"account_notice",defaultMessage:"This information will be displayed publicly so be careful what you share."}),children:(0,t.jsx)("div",{className:"space-y-6 overflow-hidden rounded-md p-3 shadow-sm bg-white dark:bg-slate-800 sm:p-6",children:(0,t.jsx)(ey,{username:r,_id:s})})}),(0,t.jsx)(D.A,{documentationLabel:u({id:"email_addresses",defaultMessage:"Email addresses"}),children:(0,t.jsx)("div",{className:"space-y-6 overflow-hidden rounded-md border-slate-200 dark:border-slate-800 py-5",children:(0,t.jsx)(ex,{emails:a,enableVerification:!0,userId:s,emailBodyContainer:"rounded-md shadow-sm"})})}),(null==c?void 0:c._id)===s&&(0,t.jsx)(D.A,{documentationLabel:u({id:"web3_addresses",defaultMessage:"Web3 addresses"}),documentation:(0,t.jsx)(U.A,{id:"web3_address_verify_link",defaultMessage:"<p> Go to <a> etherscan </a> to verify address </p>",values:{p:e=>(0,t.jsxs)("p",{className:"text-lg",children:[e," "]}),a:e=>(0,t.jsxs)("a",{href:"https://etherscan.io/verifiedSignatures",target:"__blank",className:"text-lg text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-300",children:[e," "]})}}),children:(0,t.jsx)("div",{className:"space-y-6 overflow-hidden rounded-md border-slate-200 dark:border-slate-800 py-5",children:(0,t.jsx)(ss,{web3Addresses:l})})}),(0,t.jsx)(D.A,{documentationLabel:u({id:"tags",defaultMessage:"Tags"}),children:(0,t.jsx)("div",{className:"my-2 rounded-md px-4 py-5 shadow-sm bg-white dark:bg-slate-800 sm:p-6",children:(0,t.jsx)(eq,{tags:d,userId:s})})}),m("showUserRoles")?(0,t.jsx)(D.A,{documentationLabel:u({id:"roles",defaultMessage:"Roles"}),children:(0,t.jsx)("div",{className:"space-y-6 overflow-hidden rounded-md border-b bg-white dark:bg-slate-800 text-slate-900 dark:text-slate-200 border-slate-200 dark:border-slate-800 px-4 py-5 shadow-sm sm:p-6",children:(0,t.jsx)(eS,{roles:n,userId:s})})}):null,m("showUserPassword")&&(null==c?void 0:c._id)!==s?(0,t.jsx)(D.A,{documentationLabel:u({id:"set_password",defaultMessage:"Set password"}),children:(0,t.jsx)("div",{className:"space-y-6 overflow-hidden rounded-md border-b bg-white dark:bg-slate-800 text-slate-900 dark:text-slate-200 border-slate-200 dark:border-slate-800 px-4 py-5 shadow-sm sm:p-6",children:(0,t.jsx)(ep,{userId:s,isInitialPassword:i,primaryEmail:o})})}):null,(null==c?void 0:c._id)===s&&(0,t.jsx)(D.A,{documentationLabel:u({id:"change_password",defaultMessage:"Change password"}),children:(0,t.jsx)("div",{className:"space-y-6 overflow-hidden rounded-md border-b bg-white dark:bg-slate-800 text-slate-900 dark:text-slate-200 border-slate-200 dark:border-slate-800 shadow-sm",children:(0,t.jsx)(K,{})})}),m("showWebAuthn")&&(0,t.jsx)(D.A,{documentationLabel:u({id:"web_authentication",defaultMessage:"Web Authentication"}),children:(0,t.jsx)("div",{className:"overflow-hidden rounded-md border-b bg-white dark:bg-slate-800 text-slate-900 dark:text-slate-200 border-slate-200 dark:border-slate-800 px-4 py-5 shadow-sm sm:p-6",children:(0,t.jsx)(eX,{userId:s})})})]})};var st=a(28107);let sl=e=>{let{paymentCredentials:s}=e,{formatMessage:a}=(0,x.A)();return(0,t.jsx)("div",{className:"my-8 flex w-full min-w-full flex-row flex-nowrap divide-y divide-slate-200 overflow-hidden rounded-lg shadow-sm dark:shadow-none sm:bg-white dark:sm:bg-slate-600 text-slate-900 dark:text-slate-200",children:(null==s?void 0:s.length)?(0,t.jsx)("ul",{className:"-my-5 divide-y divide-slate-200 dark:divide-slate-700",children:(s||[]).map(e=>{let{_id:s,isPreferred:l,isActive:r,isValid:n}=e;return(0,t.jsx)("li",{className:"py-4",children:(0,t.jsxs)("div",{className:" flex items-center space-x-4",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"truncate text-sm font-medium",children:s}),l&&(0,t.jsx)("p",{className:"truncate text-sm text-slate-500 dark:text-slate-200",children:(0,t.jsx)(ez.A,{text:a({id:"preferred",defaultMessage:"Preferred"}),color:"green",square:!0})})]}),(0,t.jsx)("div",{children:r?(0,t.jsx)(ez.A,{text:a({id:"active",defaultMessage:"Active"}),color:"green",square:!0}):(0,t.jsx)(ez.A,{text:a({id:"in_active",defaultMessage:"In-Active"}),color:"red",square:!0})}),(0,t.jsx)("div",{children:n?(0,t.jsx)(ez.A,{text:a({id:"valid",defaultMessage:"Valid"}),color:"green",square:!0}):(0,t.jsx)(ez.A,{text:a({id:"in_valid",defaultMessage:"InValid"}),color:"red",square:!0})})]})},s)})}):(0,t.jsx)(st.A,{message:a({id:"payment_credentials",defaultMessage:"Payment credentials"})})})};var sr=a(14724),sn=a(47646),sd=a(39892),si=a(86974);function so(){let e=(0,A._)(["\n mutation PrepareUserAvatarUpload($mediaName: String!, $userId: ID) {\n prepareUserAvatarUpload(mediaName: $mediaName, userId: $userId) {\n _id\n putURL\n expires\n }\n }\n"]);return so=function(){return e},e}let su=(0,N.J1)(so()),sc=()=>{let[e]=(0,J.n)(su),{confirmMediaUpload:s}=(0,sd.A)({refetchQueries:["User","CurrentUser"]});return{updateUserAvatar:async a=>{let{avatar:t,userId:l=null}=a,{data:r}=await e({variables:{mediaName:t.name,userId:l}}),{prepareUserAvatarUpload:n}=r;await (0,si.A)(t,n.putURL),await s({mediaUploadTicketId:n._id,size:t.size,type:t.type})}}};function sm(){let e=(0,A._)(["\n mutation UpdateUserProfile($profile: UserProfileInput!, $userId: ID) {\n updateUserProfile(profile: $profile, userId: $userId) {\n ...UserFragment\n }\n }\n ","\n"]);return sm=function(){return e},e}let sx=(0,N.J1)(sm(),Y.A),sh=()=>{let[e]=(0,J.n)(sx);return{updateUserProfile:async s=>{let{profile:a,userId:t=null}=s;return e({variables:{profile:a,userId:t}})}}};var sf=a(85269);let sg=e=>{let{isEdit:s,address:a,setIsEdit:l}=e,{formatMessage:r}=(0,x.A)();return(0,t.jsxs)("dl",{className:"space-y-4 -mb-6",children:[(0,t.jsxs)("div",{children:[!s&&(0,t.jsx)("label",{className:"text-sm font-medium text-slate-500 dark:text-slate-200",children:r({id:"full_name",defaultMessage:"Full name"})}),(0,t.jsx)("div",{className:"flex text-sm text-slate-900 dark:text-slate-200 sm:col-span-2 sm:mt-0",children:s?(0,t.jsxs)("div",{className:"flex w-full gap-2",children:[(0,t.jsx)(X.A,{className:"w-full",labelClassName:"text-sm font-medium text-slate-500 dark:text-slate-200",name:"firstName",label:r({id:"first_name",defaultMessage:"First name"}),placeholder:r({id:"first_name",defaultMessage:"First name"})}),(0,t.jsx)(X.A,{className:"w-full",labelClassName:"text-sm font-medium text-slate-500 dark:text-slate-200",name:"lastName",label:r({id:"last_Name",defaultMessage:"Last name"}),placeholder:r({id:"last_Name",defaultMessage:"Last name"})})]}):(0,t.jsxs)("span",{className:"grow",children:[null==a?void 0:a.firstName," ",null==a?void 0:a.lastName," "]})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-sm font-medium text-slate-500 dark:text-slate-200",children:!s&&r({id:"company",defaultMessage:"Company"})}),(0,t.jsx)("div",{className:"mt-1 flex text-sm text-slate-900 dark:text-slate-200 sm:mt-0",children:s?(0,t.jsx)(X.A,{className:"mt-0 w-full",name:"company",label:r({id:"company",defaultMessage:"Company"}),placeholder:r({id:"company",defaultMessage:"Company"})}):(0,t.jsx)("span",{className:"grow",children:null==a?void 0:a.company})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-sm font-medium text-slate-500 dark:text-slate-200",children:!s&&r({id:"address_line_1",defaultMessage:"Address line 1 (Street, House no)"})}),(0,t.jsx)("div",{className:"mt-1 flex text-sm text-slate-900 dark:text-slate-200 sm:mt-0",children:s?(0,t.jsx)(X.A,{className:"mt-0 w-full",name:"addressLine",label:r({id:"address_line_1",defaultMessage:"Address line 1 (Street, House no)"}),placeholder:r({id:"address_line_1",defaultMessage:"Address line 1 (Street, House no)"})}):(0,t.jsx)("span",{className:"grow",children:null==a?void 0:a.addressLine})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-sm font-medium text-slate-500 dark:text-slate-200",children:!s&&r({id:"address_line_2",defaultMessage:"Address line 2"})}),(0,t.jsx)("div",{className:"mt-1 flex text-sm text-slate-900 dark:text-slate-200 sm:mt-0",children:s?(0,t.jsx)(X.A,{className:"mt-0 w-full",name:"addressLine2",label:r({id:"address_line_2",defaultMessage:"Address line 2"}),placeholder:r({id:"address_line_2",defaultMessage:"Address line 2"})}):(0,t.jsx)("span",{className:"grow",children:null==a?void 0:a.addressLine2})})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-x-2 sm:grid-cols-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-sm font-medium text-slate-500 dark:text-slate-200",children:!s&&r({id:"region",defaultMessage:"Region"})}),(0,t.jsx)("div",{className:"mt-1 flex text-sm text-slate-900 dark:text-slate-200 sm:mt-0",children:s?(0,t.jsx)(X.A,{className:"mt-0 w-full",name:"regionCode",label:r({id:"region_Code",defaultMessage:"Region"}),placeholder:r({id:"region_Code",defaultMessage:"Region"})}):null==a?void 0:a.regionCode})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-sm font-medium text-slate-500 dark:text-slate-200",children:!s&&r({id:"postal_code",defaultMessage:"Postal/ZIP code"})}),(0,t.jsx)("div",{className:"mt-1 w-full text-sm text-slate-900 dark:text-slate-200 sm:mt-0",children:s?(0,t.jsx)(X.A,{className:"mt-0 w-full",name:"postalCode",label:r({id:"postal_code",defaultMessage:"Postal/ZIP code"}),placeholder:r({id:"postal_code",defaultMessage:"Postal/ZIP code"})}):null==a?void 0:a.postalCode})]}),(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-slate-500 dark:text-slate-200",children:!s&&r({id:"city",defaultMessage:"City"})}),(0,t.jsx)("div",{className:"mt-1 text-sm text-slate-900 dark:text-slate-200 sm:mt-0",children:s?(0,t.jsx)(X.A,{className:"mt-0 w-full",name:"city",label:r({id:"city",defaultMessage:"City"}),placeholder:r({id:"city",defaultMessage:"City"})}):null==a?void 0:a.city})]}),(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-slate-500 dark:text-slate-200",children:!s&&r({id:"country_code",defaultMessage:"Country code"})}),(0,t.jsx)("div",{className:"mt-1 text-sm text-slate-900 dark:text-slate-200 sm:mt-0",children:s?(0,t.jsx)(X.A,{className:"mt-0 w-full",name:"countryCode",label:r({id:"country_code",defaultMessage:"Country code"}),placeholder:r({id:"country_code",defaultMessage:"Country code"})}):null==a?void 0:a.countryCode})]})]}),(0,t.jsx)("div",{className:"border-t border-t-indigo-50 dark:border-t-slate-700 mt-3 -mx-6 -mb-6 bg-slate-50 dark:bg-slate-800 flex shrink-0 items-center justify-end space-x-4 pr-5",children:s?(0,t.jsx)(sf.A,{onCancel:()=>l(!s)}):null})]})};var sv=a(51485),sp=a(88817);let sb=e=>{let{profile:s,avatar:a,_id:r}=e,{address:n}=s||{},d=(0,l.useRef)(void 0),{formatMessage:i}=(0,x.A)(),{currentUser:o}=(0,T.A)(),{formatDateTime:u}=(0,f.A)(),{updateUserProfile:c}=sh(),{updateUserAvatar:m}=sc(),{hasRole:h}=(0,q.A)(),[g,v]=(0,l.useState)(!1),p=async e=>{let{displayName:s,phoneMobile:a,birthday:t,gender:l}=e,{firstName:n,lastName:d,company:i,addressLine:o,addressLine2:u,postalCode:m,regionCode:x,countryCode:h,city:f}=e,g=await c({profile:{displayName:s,phoneMobile:a,birthday:t,gender:l,address:{firstName:n,lastName:d,company:i,addressLine:o,addressLine2:u,postalCode:m,regionCode:x,countryCode:h,city:f}},userId:r});return v(!1),{success:!0,data:g}},b=async e=>{let{target:s}=e,[a]=s.files;return await m({userId:r,avatar:a}),!0},w=i({id:"profile_updated",defaultMessage:"Profile updated successfully!"}),j=(0,W.A)({submit:p,successMessage:w,initialValues:{birthday:null,displayName:null,gender:null,phoneMobile:null,firstName:null,lastName:null,city:null,company:null,addressLine:null,addressLine2:null,postalCode:null,countryCode:null,regionCode:null}});return(0,l.useEffect)(()=>{Object.keys(s||{}).length&&j.formik.setValues({birthday:(null==s?void 0:s.birthday)?new Date(null==s?void 0:s.birthday):null,displayName:null==s?void 0:s.displayName,gender:null==s?void 0:s.gender,phoneMobile:null==s?void 0:s.phoneMobile,firstName:null==n?void 0:n.firstName,lastName:null==n?void 0:n.lastName,city:null==n?void 0:n.city,company:null==n?void 0:n.company,addressLine:null==n?void 0:n.addressLine,addressLine2:null==n?void 0:n.addressLine2,postalCode:null==n?void 0:n.postalCode,countryCode:null==n?void 0:n.countryCode,regionCode:null==n?void 0:n.regionCode})},[s]),(0,t.jsx)(sv.A,{className:"shadow-none",children:(0,t.jsx)(F.A,{form:j,children:(0,t.jsxs)("div",{className:"mt-6 overflow-hidden rounded-md bg-slate-100 dark:bg-slate-900",children:[(0,t.jsxs)("div",{className:"lg:grid lg:grid-cols-3",children:[(0,t.jsxs)("div",{className:"mb-5 lg:col-span-1 lg:pr-5",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("h3",{className:"text-lg font-medium leading-6 text-slate-900 dark:text-slate-200",children:i({id:"profile",defaultMessage:"Profile"})}),(0,t.jsx)("p",{className:"-my-5 divide-y divide-slate-200 text-slate-600 dark:divide-slate-700 dark:text-slate-400 mr-4",children:i({id:"profile_notice",defaultMessage:"This information will be displayed publicly so be careful what you share."})})]}),(h("editUserProfile")||(null==o?void 0:o._id)===r)&&(0,t.jsx)(sf.A,{showSubmit:g,onCancel:()=>v(!g),showCancel:!0,cancelText:i(g?{id:"cancel",defaultMessage:"Cancel"}:{id:"update_profile",defaultMessage:"Update profile / address"})})]}),(0,t.jsxs)("div",{className:"col-span-2 ml-auto rounded-md px-6 shadow-sm dark:shadow-none lg:w-full bg-white dark:bg-slate-800",children:[(0,t.jsxs)("div",{className:"py-4",children:[(0,t.jsxs)("div",{className:"py-4 sm:grid sm:py-2",children:[(0,t.jsx)("label",{className:"text-slate-70 block text-sm font-medium",children:i({id:"photo",defaultMessage:"Photo"})}),(0,t.jsxs)("div",{className:"mt-1 flex items-center space-x-5 text-sm sm:col-span-2 sm:mt-0",children:[(0,t.jsxs)("span",{className:"",children:[(0,t.jsx)("input",{onChange:b,multiple:!1,ref:d,type:"file",hidden:!0}),a?(0,t.jsx)(eK.A,{src:null==a?void 0:a.url,width:100,height:100,alt:i({id:"unchained_logo",defaultMessage:"Unchained Logo"})},null==a?void 0:a.url):(0,t.jsx)("span",{className:"inline-block h-12 w-12 overflow-hidden rounded-full bg-slate-100",children:(0,t.jsx)("svg",{className:"h-full w-full text-slate-300",fill:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M24 20.993V24H0v-2.996A14.977 14.977 0 0112.004 15c4.904 0 9.26 2.354 11.996 5.993zM16.002 8.999a4 4 0 11-8 0 4 4 0 018 0z"})})})]}),h("editUserAvatar")&&(0,t.jsx)("span",{className:"mt-1 ml-4 flex shrink-0 items-start space-x-4",children:(0,t.jsx)("button",{onClick:()=>{var e,s;(null==d||null==(e=d.current)?void 0:e.click)&&(null==d||null==(s=d.current)||s.click())},type:"button",className:"rounded-md border border-slate-300 dark:border-slate-700 bg-white py-2 px-3 text-sm font-medium leading-4 text-slate-700 shadow-xs hover:bg-slate-50 focus:outline-hidden focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2",children:i({id:"change",defaultMessage:"Change"})})})]})]}),(0,t.jsxs)("div",{className:"py-4 sm:grid sm:gap-1 sm:py-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-slate-500 dark:text-slate-200",children:!g&&i({id:"displayName",defaultMessage:"Display Name"})}),(0,t.jsx)("div",{className:"mt-1 flex text-sm text-slate-900 dark:text-slate-200 sm:mt-0",children:g?(0,t.jsx)(X.A,{className:"mt-0 w-full",name:"displayName",label:i({id:"displayName",defaultMessage:"Display Name"}),placeholder:i({id:"displayName",defaultMessage:"Display Name"})}):(0,t.jsx)("span",{className:"grow",children:null==s?void 0:s.displayName})})]}),(0,t.jsxs)("div",{className:"py-4 sm:grid sm:gap-1 sm:py-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-slate-500 dark:text-slate-200",children:!g&&i({id:"gender",defaultMessage:"Gender"})}),(0,t.jsx)("div",{className:"mt-1 flex text-sm text-slate-900 dark:text-slate-200 sm:mt-0",children:g?(0,t.jsx)(sn.A,{className:"mt-0 w-full",label:i({id:"gender",defaultMessage:"Gender"}),placeholder:i({id:"gender",defaultMessage:"Gender"}),name:"gender",options:{M:i({id:"male",defaultMessage:"Male"}),F:i({id:"female",defaultMessage:"Female"})}}):(0,t.jsx)("span",{className:"grow",children:(null==s?void 0:s.gender)||"n/a"})})]}),(0,t.jsxs)("div",{className:"py-4 sm:grid sm:gap-1 sm:py-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-slate-500 dark:text-slate-200",children:!g&&i({id:"birthday",defaultMessage:"Birthday"})}),(0,t.jsx)("div",{className:"mt-1 flex text-sm text-slate-900 dark:text-slate-200 sm:mt-0",children:g?(0,t.jsx)(sr.A,{label:i({id:"birthday",defaultMessage:"Birthday"}),placeholder:i({id:"birthday",defaultMessage:"Birthday"}),className:"mt-0 w-full",name:"birthday",validators:[sp.IN]}):(0,t.jsx)("span",{className:"grow",children:u(null==s?void 0:s.birthday,{dateStyle:"short"})})})]}),(0,t.jsxs)("div",{className:"py-4 sm:grid sm:gap-1 sm:py-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-slate-500 dark:text-slate-200",children:!g&&i({id:"mobile_phone",defaultMessage:"Mobile phone"})}),(0,t.jsx)("div",{className:"mt-1 flex text-sm text-slate-900 dark:text-slate-200 sm:mt-0",children:g?(0,t.jsx)(X.A,{className:"mt-0 w-full",name:"phoneMobile",label:i({id:"mobile_phone",defaultMessage:"Mobile phone"}),placeholder:i({id:"mobile_phone",defaultMessage:"Mobile phone"})}):(0,t.jsx)("span",{className:"grow",children:(null==s?void 0:s.phoneMobile)||"n/a"})})]})]}),(0,t.jsx)("div",{className:"border-t border-t-indigo-50 dark:border-slate-700 -mx-6 bg-slate-50 dark:bg-slate-800 flex shrink-0 items-center justify-end space-x-4 pr-5",children:g?(0,t.jsx)(sf.A,{onCancel:()=>v(!g)}):null})]})]}),(0,t.jsxs)("div",{className:"my-7 border-t dark:border-t-slate-800 pt-6 lg:grid lg:grid-cols-3",children:[(0,t.jsxs)("div",{className:"col-span-1 space-y-1 py-3 lg:py-0 ",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("h3",{className:"text-lg font-medium leading-6 text-slate-900 dark:text-slate-200",children:i({id:"address",defaultMessage:"Address"})}),(0,t.jsx)("p",{className:"-my-5 divide-y divide-slate-200 text-slate-600 dark:divide-slate-700 dark:text-slate-400 mr-4",children:i({id:"address_notice",defaultMessage:"This information will be displayed publicly so be careful what you share."})})]}),(h("editUserProfile")||(null==o?void 0:o._id)===r)&&(0,t.jsx)(sf.A,{showSubmit:g,onCancel:()=>v(!g),showCancel:!0,cancelText:i(g?{id:"cancel",defaultMessage:"Cancel"}:{id:"update_profile",defaultMessage:"Update profile / address"})})]}),(0,t.jsx)("div",{className:"col-span-2 w-full border-slate-200 dark:border-slate-800 px-6 py-6 rounded-md shadow-sm dark:shadow-none lg:ml-auto lg:w-full bg-white dark:bg-slate-800 ",children:(0,t.jsx)(sg,{isEdit:g,address:n,setIsEdit:v})})]})]})})})};var sw=a(89099),sj=a(52398),sy=a(58213),sA=a(350);function sN(){let e=(0,A._)(["\n query UserEnrollments($userId: ID!, $queryString: String) {\n user(userId: $userId) {\n _id\n enrollments(queryString: $queryString) {\n ...EnrollmentFragment\n }\n }\n }\n ","\n"]);return sN=function(){return e},e}let s_=(0,N.J1)(sN(),sA.A),sM=e=>{var s;let{userId:a=null,queryString:t=""}=e,{data:l,loading:r,error:n}=(0,_.IT)(s_,{skip:!a,variables:{userId:a,queryString:t}});return{enrollments:(null==l||null==(s=l.user)?void 0:s.enrollments)||[],loading:r,error:n}},sk=e=>{let{_id:s}=e,{query:a,push:l}=(0,sw.useRouter)(),{queryString:r,...n}=a,{enrollments:d}=sM({userId:s,queryString:r});return(0,t.jsxs)("div",{className:"space-y-4 mt-4",children:[(0,t.jsx)(sj.A,{defaultValue:r,onInputChange:e=>{let{skip:s,...a}=n;e?l({query:{...a,queryString:e}}):l({query:{...n}})}}),(0,t.jsx)(sy.A,{enrollments:d}),";"]})};var sC=a(60124),sI=a(74420);function sE(){let e=(0,A._)(["\n query UserOrder(\n $userId: ID\n $queryString: String\n $sort: [SortOptionInput!]\n ) {\n user(userId: $userId) {\n orders(queryString: $queryString, sort: $sort) {\n ...OrderFragment\n }\n }\n }\n ","\n"]);return sE=function(){return e},e}let sS=(0,N.J1)(sE(),sI.A),sR=function(){var e;let{userId:s=null,queryString:a="",sort:t=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{data:l,loading:r,error:n}=(0,_.IT)(sS,{skip:!s,variables:{userId:s,queryString:a,sort:t.length?t:[{key:"ordered",value:M.t4.Desc}]}});return{orders:null==l||null==(e=l.user)?void 0:e.orders,loading:r,error:n}},s$=e=>{let{_id:s}=e,{query:a,push:l}=(0,sw.useRouter)(),{queryString:r,...n}=a,d=null==a?void 0:a.sort,{orders:i,loading:o}=sR({userId:s,queryString:r,sort:(0,g.XM)(d)});return(0,t.jsxs)("div",{className:"space-y-4 mt-4",children:[(0,t.jsx)(sj.A,{defaultValue:r,onInputChange:e=>{let{skip:s,...a}=n;e?l({query:{...a,queryString:e}}):l({query:{...n}})}}),(0,t.jsx)(sC.A,{loading:o,orders:i,showUser:!1,sortable:!0})]})};var sP=a(10073),sU=a(93196);function sq(){let e=(0,A._)(["\n query UserQuotations($userId: ID!, $queryString: String) {\n user(userId: $userId) {\n _id\n quotations(queryString: $queryString) {\n ...QuotationFragment\n }\n }\n }\n ","\n"]);return sq=function(){return e},e}let sD=(0,N.J1)(sq(),sU.A),sT=e=>{var s;let{userId:a=null,queryString:t=""}=e,{data:l,loading:r,error:n}=(0,_.IT)(sD,{skip:!a,variables:{userId:a,queryString:t}});return{quotations:(null==l||null==(s=l.user)?void 0:s.quotations)||[],loading:r,error:n}},sL=e=>{let{_id:s}=e,{query:a,push:l}=(0,sw.useRouter)(),{queryString:r,...n}=a,{quotations:d,loading:i}=sT({userId:s,queryString:r});return i?(0,t.jsx)(j.A,{}):(0,t.jsxs)("div",{className:"space-y-4 mt-4",children:[(0,t.jsx)(sj.A,{defaultValue:r,onInputChange:e=>{let{skip:s,...a}=n;e?l({query:{...a,queryString:e}}):l({query:{...n}})}}),(0,t.jsx)(sP.A,{quotations:d}),";"]})};var sF=a(48230),sO=a.n(sF),sV=a(66985),sZ=a(7965),sW=a(51750);function sJ(){let e=(0,A._)(["\n query UserTokens($userId: ID!) {\n user(userId: $userId) {\n _id\n web3Addresses {\n address\n nonce\n verified\n }\n\n tokens {\n ...TokenFragment\n product {\n ...ProductBriefFragment\n simulatedPrice {\n amount\n currencyCode\n }\n }\n }\n }\n }\n ","\n ","\n"]);return sJ=function(){return e},e}let sH=(0,N.J1)(sJ(),sW.A,k.A),sB=e=>{var s,a;let{userId:t=null}=e,{data:l,loading:r,error:n}=(0,_.IT)(sH,{variables:{userId:t}});return{tokens:(null==l||null==(s=l.user)?void 0:s.tokens)||[],web3Addresses:(null==l||null==(a=l.user)?void 0:a.web3Addresses)||[],loading:r,error:n}};var sz=a(3837);let sK={CENTRALIZED:"purple",EXPORTING:"yellow",DECENTRALIZED:"green"},sQ=e=>{let{_id:s}=e,{tokens:a,web3Addresses:l,loading:r}=sB({userId:s}),{formatMessage:n}=(0,x.A)(),{formatPrice:d}=(0,g.Ab)();return r?(0,t.jsx)(j.A,{}):a.length?(0,t.jsx)("div",{className:"bg-white",children:(0,t.jsx)("div",{className:"mt-5 -mx-px grid grid-cols-1 border-l border-gray-200 sm:mx-0 sm:grid-cols-2 lg:grid-cols-3",children:null==a?void 0:a.map(e=>{var s,a,l;let{_id:r,walletAddress:i,chainId:o,chainTokenId:u,product:c,status:m}=e;return(0,t.jsxs)("div",{className:"group relative border-r border-b border-gray-200 p-4 sm:p-6",children:[(0,t.jsxs)(sO(),{href:"/products?slug=".concat((0,sV.Ay)(c)),className:"aspect-w-1 aspect-h-1 overflow-hidden rounded-lg bg-gray-200 group-hover:opacity-75",children:[(0,t.jsx)("div",{children:(0,t.jsx)(eK.A,{src:(null==c||null==(s=c.media)?void 0:s.length)&&(null==(a=c.media[0].file)?void 0:a.url)||"/no-image.jpg",loader:eQ.A,alt:n({id:"product-image",defaultMessage:"Product image"}),width:100,height:100,layout:"responsive",className:" h-full w-full "})}),(0,t.jsxs)("div",{className:"pt-2",children:[(0,t.jsx)("h3",{className:"text-lg font-medium text-gray-900",children:null==c||null==(l=c.texts)?void 0:l.title}),(0,t.jsx)("p",{children:n({id:"token-id",defaultMessage:"Token ID {chainTokenId}"},{chainTokenId:u})}),i?(0,t.jsx)("div",{children:n({id:"wallet-address",defaultMessage:"Wallet {walletAddress}"},{walletAddress:(0,sZ.A)(i)})}):null,(0,t.jsx)("p",{children:n({id:"chain-id",defaultMessage:"Chain ID {chainId}"},{chainId:o})}),(0,t.jsx)("p",{children:n({id:"token-id",defaultMessage:"Token ID {chainTokenId}"},{chainTokenId:u})}),(0,t.jsx)("p",{className:"mt-2 text-base font-medium text-gray-900",children:d(null==c?void 0:c.simulatedPrice)}),(0,t.jsx)("div",{className:"mt-2 mb-8",children:(0,t.jsx)("div",{className:"",children:(0,t.jsx)(ez.A,{text:"CENTRALIZED"===m?"Off-Chain \uD83C\uDFDB":"On-Chain ⛓",color:sK[m]})})})]})]}),"DECENTRALIZED"!==m&&(0,t.jsx)("div",{className:"mt-3 flex items-center justify-between",children:(0,t.jsx)(sz.A,{tokenId:r,tokenStatus:m})})]},r)})})}):(0,t.jsx)(st.A,{message:n({id:"tokens",defaultMessage:"Tokens"})})},sG=e=>{let{user:s,selectedView:a,...l}=e;return s?"profile"===a?(0,t.jsx)(sb,{...s}):"account"===a?(0,t.jsx)(sa,{...s}):"orders"===a?(0,t.jsx)(s$,{...s}):"quotations"===a?(0,t.jsx)(sL,{...s}):"enrollments"===a?(0,t.jsx)(sk,{...s}):"reviews"===a?(0,t.jsx)(P,{...s}):"payment_credentials"===a?(0,t.jsx)(sl,{...s}):"tokens"===a?(0,t.jsx)(sQ,{...s}):"extended"===a?(0,t.jsx)(h.A,{data:l}):"logs"===a?(0,t.jsx)(w,{...s}):(0,t.jsx)(sb,{...s}):(0,t.jsx)(j.A,{})},sX=e=>{let{user:s,extendedData:a}=e,{formatMessage:l}=(0,x.A)(),h=[{id:"profile",title:l({id:"profile",defaultMessage:"Profile"}),Icon:(0,t.jsx)(r,{className:"h-4 w-5"})},{id:"account",title:l({id:"account",defaultMessage:"Account"}),Icon:(0,t.jsx)(n.A,{className:"h-4 w-5"})},{id:"orders",title:l({id:"orders",defaultMessage:"Orders"}),Icon:(0,t.jsx)(d.A,{className:"h-4 w-5"})},{id:"quotations",title:l({id:"quotations",defaultMessage:"Quotations"}),Icon:(0,t.jsx)(i,{className:"h-4 w-5"})},{id:"enrollments",title:l({id:"enrollments",defaultMessage:"Enrollments"}),Icon:(0,t.jsx)(o.A,{className:"h-4 w-5"})},{id:"payment_credentials",title:l({id:"payment_credentials",defaultMessage:"Payment credentials"}),Icon:(0,t.jsx)(u,{className:"h-4 w-5"})},{id:"tokens",title:l({id:"tokens",defaultMessage:"Tokens"}),Icon:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"h-4 w-5",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 18.75a60.07 60.07 0 0115.797 2.101c.727.198 1.453-.342 1.453-1.096V18.75M3.75 4.5v.75A.75.75 0 013 6h-.75m0 0v-.375c0-.621.504-1.125 1.125-1.125H20.25M2.25 6v9m18-10.5v.75c0 .414.336.75.75.75h.75m-1.5-1.5h.375c.621 0 1.125.504 1.125 1.125v9.75c0 .621-.504 1.125-1.125 1.125h-.375m1.5-1.5H21a.75.75 0 00-.75.75v.75m0 0H3.75m0 0h-.375a1.125 1.125 0 01-1.125-1.125V15m1.5 1.5v-.75A.75.75 0 003 15h-.75M15 10.5a3 3 0 11-6 0 3 3 0 016 0zm3 0h.008v.008H18V10.5zm-12 0h.008v.008H6V10.5z"})})},{id:"reviews",title:l({id:"reviews",defaultMessage:"Reviews"}),Icon:(0,t.jsx)(c.A,{className:"h-4 w-5"})},{id:"logs",title:l({id:"user-activities",defaultMessage:"Activity"}),Icon:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"h-4 w-5",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 18.75a60.07 60.07 0 0115.797 2.101c.727.198 1.453-.342 1.453-1.096V18.75M3.75 4.5v.75A.75.75 0 013 6h-.75m0 0v-.375c0-.621.504-1.125 1.125-1.125H20.25M2.25 6v9m18-10.5v.75c0 .414.336.75.75.75h.75m-1.5-1.5h.375c.621 0 1.125.504 1.125 1.125v9.75c0 .621-.504 1.125-1.125 1.125h-.375m1.5-1.5H21a.75.75 0 00-.75.75v.75m0 0H3.75m0 0h-.375a1.125 1.125 0 01-1.125-1.125V15m1.5 1.5v-.75A.75.75 0 003 15h-.75M15 10.5a3 3 0 11-6 0 3 3 0 016 0zm3 0h.008v.008H18V10.5zm-12 0h.008v.008H6V10.5z"})})},null!==a&&{id:"extended",title:l({id:"extended-fields",defaultMessage:"Extended"}),Icon:(0,t.jsx)(m.A,{className:"h-4 w-5"})}];return(0,t.jsx)(y.A,{tabItems:h,defaultTab:"profile",children:(0,t.jsx)(sG,{user:s,...a})})}},47646:(e,s,a)=>{a.d(s,{A:()=>i});var t=a(37876),l=a(15039),r=a.n(l),n=a(43503),d=a(74231);let i=e=>{let{options:s,...a}=(0,n.A)(e),{className:l}=e||{className:""};return(0,t.jsx)(d.A,{...a,children:(0,t.jsx)("div",{className:"select-wrap",children:(0,t.jsxs)("select",{className:r()("mt-1 block w-full dark:bg-slate-900 rounded-md border border-slate-200 dark:text-white dark:border-slate-700 py-2.5 pl-3 pr-10 text-base text-black shadow-xs focus:border-indigo-400 focus:outline-hidden focus:ring-indigo-400 sm:text-sm",l,{"border-red-300 text-red-600":!!a.error}),disabled:a.disabled,id:a.name,name:a.name,onChange:a.onChange,onBlur:a.onBlur,value:a.value,children:[(!!a.placeholder||!a.required)&&(0,t.jsx)("option",{className:"dark:text-slate-200",value:"",disabled:a.required,hidden:a.required,children:a.placeholder||a.label}),Object.entries(s).map(e=>{let[s,a]=e;return(0,t.jsx)("option",{className:"dark:text-slate-200",value:s,children:a},s)})]})})})}},51750:(e,s,a)=>{a.d(s,{A:()=>r});var t=a(96427);function l(){let e=(0,t._)(["\n fragment TokenFragment on Token {\n _id\n walletAddress\n status\n quantity\n contractAddress\n chainId\n chainTokenId\n invalidatedDate\n expiryDate\n ercMetadata\n accessKey\n isInvalidateable\n }\n"]);return l=function(){return e},e}let r=(0,a(79350).J1)(l())},58213:(e,s,a)=>{a.d(s,{A:()=>f});var t=a(37876),l=a(77742),r=a(83010),n=a(48230),d=a.n(n),i=a(99583),o=a(84338),u=a(66985),c=a(36729),m=a(47334);let x={INITIAL:"orange",PAUSED:"yellow",TERMINATED:"red",ACTIVE:"green"},h=e=>{var s,a,n,h,f;let{enrollment:g,showUser:v}=e,{formatMessage:p}=(0,l.A)(),{formatDateTime:b}=(0,o.A)();return(0,t.jsxs)(r.A.Row,{children:[(0,t.jsx)(r.A.Cell,{children:(0,t.jsx)("div",{className:"text-sm",children:(0,t.jsx)(d(),{href:"/enrollments?enrollmentId=".concat(g._id),className:"font-medium text-blue-500 dark:text-blue-400",children:(null==g?void 0:g.enrollmentNumber)||(null==(s=g._id)?void 0:s.substr(0,10))})})}),(0,t.jsx)(r.A.Cell,{children:(0,t.jsx)("div",{className:"flex items-center text-sm ",children:b(g.created,{dateStyle:"medium",timeStyle:"medium"})})}),(0,t.jsx)(r.A.Cell,{children:(0,t.jsx)("div",{className:"flex items-center text-sm ",children:g.isExpired?(0,t.jsx)(i.A,{text:p({id:"expired",defaultMessage:"Expired"}),color:"red"}):b(g.expires,{dateStyle:"medium",timeStyle:"medium"})})}),v&&g.user&&(0,t.jsx)(r.A.Cell,{children:(0,t.jsxs)(d(),{href:"/users?userId=".concat(g.user._id),className:"flex items-center text-sm text-blue-500 dark:text-blue-400 hover:text-decoration",children:[(0,t.jsx)("span",{className:"inline-block h-9 w-9 rounded-full",children:(0,t.jsx)(c.A,{file:null==g||null==(a=g.user)?void 0:a.avatar,className:"mr-2"})}),(0,t.jsx)("span",{className:"ml-2",children:(0,m.A)(g.user)})]})}),(0,t.jsx)(r.A.Cell,{children:(0,t.jsxs)(d(),{href:"/products?slug=".concat((0,u.Ay)(g.plan.product)),className:"flex items-center text-sm text-blue-500 dark:text-blue-400 hover:text-decoration",children:[(0,t.jsx)(c.A,{file:null==g||null==(f=g.plan)||null==(h=f.product)||null==(n=h.media)?void 0:n.file,className:"mr-2"}),(0,t.jsx)("span",{className:"ml-2",children:null==g?void 0:g.plan.product.texts.title})]})}),(0,t.jsx)(r.A.Cell,{children:(0,t.jsx)(i.A,{text:null==g?void 0:g.status,color:x[g.status],square:!0})})]})},f=e=>{let{enrollments:s,showUser:a=null,sortable:n=!1}=e,{formatMessage:d}=(0,l.A)();return(0,t.jsxs)(r.A,{className:"min-w-full",children:[null==s?void 0:s.map(e=>(0,t.jsxs)(r.A.Row,{header:!0,enableSort:n,children:[(0,t.jsx)(r.A.Cell,{sortKey:"enrollmentNumber",children:d({id:"enrollment_number",defaultMessage:"Enrollment number"})}),(0,t.jsx)(r.A.Cell,{sortKey:"created",children:d({id:"created",defaultMessage:"Created"})}),(0,t.jsx)(r.A.Cell,{children:d({id:"expires",defaultMessage:"Expires"})}),a&&(0,t.jsx)(r.A.Cell,{children:d({id:"user",defaultMessage:"User"})}),(0,t.jsx)(r.A.Cell,{children:d({id:"product",defaultMessage:"Product"})}),(0,t.jsx)(r.A.Cell,{sortKey:"status",children:d({id:"status",defaultMessage:"Status"})})]},e._id)),null==s?void 0:s.map(e=>(0,t.jsx)(h,{showUser:!0,enrollment:e},"".concat(null==e?void 0:e._id,"-body")))]})}},60124:(e,s,a)=>{a.d(s,{A:()=>g});var t=a(37876),l=a(77742),r=a(83010),n=a(48230),d=a.n(n),i=a(99583),o=a(36729),u=a(59884),c=a(47334),m=a(84338),x=a(85126);let h=e=>{var s;let{order:a,showUser:n}=e,{formatMessage:h}=(0,l.A)(),{formatPrice:f}=(0,x.Ab)(),{formatDateTime:g}=(0,m.A)();return(0,t.jsxs)(r.A.Row,{children:[(0,t.jsx)(r.A.Cell,{children:(0,t.jsx)("div",{className:"flex items-center text-sm",children:(0,t.jsx)(d(),{href:"/orders?orderId=".concat(a._id),className:"font-medium text-blue-500 dark:text-blue-400",children:(null==a?void 0:a.orderNumber)||(0,t.jsxs)(t.Fragment,{children:[a._id," ",(0,t.jsx)(i.A,{color:"yellow",text:h({id:"cart",defaultMessage:"Cart"})})]})})})}),(0,t.jsx)(r.A.Cell,{children:(0,t.jsx)("div",{className:"flex items-center text-sm",children:g(a.ordered,{dateStyle:"short",timeStyle:"short"})})}),(0,t.jsx)(r.A.Cell,{children:(0,t.jsx)("div",{className:"flex items-center text-sm",children:f(a.total)})}),n&&a.user&&(0,t.jsx)(r.A.Cell,{children:(0,t.jsxs)(d(),{href:"/users?userId=".concat(a.user._id),className:"flex items-center text-sm text-blue-500 dark:text-blue-400 hover:text-decoration",children:[(0,t.jsx)(o.A,{file:null==(s=a.user)?void 0:s.avatar,className:"mr-2"}),(0,t.jsx)("span",{className:"font-medium ml-2",children:(0,c.A)(a.user)})]})}),(0,t.jsx)(r.A.Cell,{children:(0,t.jsx)(i.A,{text:null==a?void 0:a.status,color:u.wm[a.status],square:!0})})]})};var f=a(91562);let g=e=>{var s,a;let{orders:n,showUser:d,loading:i,sortable:o}=e,{formatMessage:u}=(0,l.A)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(r.A,{className:"min-w-full",children:[null==(s=n||[])?void 0:s.map(e=>(0,t.jsxs)(r.A.Row,{header:!0,enableSort:o,children:[(0,t.jsx)(r.A.Cell,{sortKey:"orderNumber",children:u({id:"order_number",defaultMessage:"Order #"})}),(0,t.jsx)(r.A.Cell,{sortKey:"ordered",defaultSortDirection:"DESC",children:u({id:"order_date",defaultMessage:"Order date"})}),(0,t.jsx)(r.A.Cell,{children:u({id:"total",defaultMessage:"Total"})}),d&&(0,t.jsx)(r.A.Cell,{children:u({id:"user",defaultMessage:"User"})}),(0,t.jsx)(r.A.Cell,{sortKey:"status",children:u({id:"status",defaultMessage:"Status"})})]},e._id)),null==(a=n||[])?void 0:a.map(e=>(0,t.jsx)(h,{order:e,showUser:!0},"".concat(null==e?void 0:e._id,"-body")))]}),i&&(0,t.jsx)(f.A,{})]})}},62932:(e,s,a)=>{a.d(s,{A:()=>l});var t=a(14232);let l=t.forwardRef(function(e,s){let{title:a,titleId:l,...r}=e;return t.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:s,"aria-labelledby":l},r),a?t.createElement("title",{id:l},a):null,t.createElement("path",{d:"M2.25 2.25a.75.75 0 0 0 0 1.5h1.386c.17 0 .318.114.362.278l2.558 9.592a3.752 3.752 0 0 0-2.806 3.63c0 .414.336.75.75.75h15.75a.75.75 0 0 0 0-1.5H5.378A2.25 2.25 0 0 1 7.5 15h11.218a.75.75 0 0 0 .674-.421 60.358 60.358 0 0 0 2.96-7.228.75.75 0 0 0-.525-.965A60.864 60.864 0 0 0 5.68 4.509l-.232-.867A1.875 1.875 0 0 0 3.636 2.25H2.25ZM3.75 20.25a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0ZM16.5 20.25a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0Z"}))})},63151:(e,s,a)=>{a.d(s,{A:()=>l});var t=a(14232);let l=t.forwardRef(function(e,s){let{title:a,titleId:l,...r}=e;return t.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:s,"aria-labelledby":l},r),a?t.createElement("title",{id:l},a):null,t.createElement("path",{fillRule:"evenodd",d:"M7.502 6h7.128A3.375 3.375 0 0 1 18 9.375v9.375a3 3 0 0 0 3-3V6.108c0-1.505-1.125-2.811-2.664-2.94a48.972 48.972 0 0 0-.673-.05A3 3 0 0 0 15 1.5h-1.5a3 3 0 0 0-2.663 1.618c-.225.015-.45.032-.673.05C8.662 3.295 7.554 4.542 7.502 6ZM13.5 3A1.5 1.5 0 0 0 12 4.5h4.5A1.5 1.5 0 0 0 15 3h-1.5Z",clipRule:"evenodd"}),t.createElement("path",{fillRule:"evenodd",d:"M3 9.375C3 8.339 3.84 7.5 4.875 7.5h9.75c1.036 0 1.875.84 1.875 1.875v11.25c0 1.035-.84 1.875-1.875 1.875h-9.75A1.875 1.875 0 0 1 3 20.625V9.375ZM6 12a.75.75 0 0 1 .75-.75h.008a.75.75 0 0 1 .75.75v.008a.75.75 0 0 1-.75.75H6.75a.75.75 0 0 1-.75-.75V12Zm2.25 0a.75.75 0 0 1 .75-.75h3.75a.75.75 0 0 1 0 1.5H9a.75.75 0 0 1-.75-.75ZM6 15a.75.75 0 0 1 .75-.75h.008a.75.75 0 0 1 .75.75v.008a.75.75 0 0 1-.75.75H6.75a.75.75 0 0 1-.75-.75V15Zm2.25 0a.75.75 0 0 1 .75-.75h3.75a.75.75 0 0 1 0 1.5H9a.75.75 0 0 1-.75-.75ZM6 18a.75.75 0 0 1 .75-.75h.008a.75.75 0 0 1 .75.75v.008a.75.75 0 0 1-.75.75H6.75a.75.75 0 0 1-.75-.75V18Zm2.25 0a.75.75 0 0 1 .75-.75h3.75a.75.75 0 0 1 0 1.5H9a.75.75 0 0 1-.75-.75Z",clipRule:"evenodd"}))})},64456:(e,s,a)=>{a.d(s,{A:()=>l});var t=a(14232);let l=t.forwardRef(function(e,s){let{title:a,titleId:l,...r}=e;return t.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:s,"aria-labelledby":l},r),a?t.createElement("title",{id:l},a):null,t.createElement("path",{d:"M3.478 2.404a.75.75 0 0 0-.926.941l2.432 7.905H13.5a.75.75 0 0 1 0 1.5H4.984l-2.432 7.905a.75.75 0 0 0 .926.94 60.519 60.519 0 0 0 18.445-8.986.75.75 0 0 0 0-1.218A60.517 60.517 0 0 0 3.478 2.404Z"}))})},65291:(e,s,a)=>{a.d(s,{A:()=>d});var t=a(37876),l=a(77742),r=a(28107),n=a(81196);let d=e=>{let{reviews:s,className:a="",enableDelete:d=!1,showProduct:i=!1}=e,{formatMessage:o}=(0,l.A)();return s&&s.length?(0,t.jsx)("div",{className:"".concat(a||""," "),children:s.map(e=>(0,t.jsx)(n.A,{showProduct:i,review:e,enableDelete:d},e._id))}):(0,t.jsx)(r.A,{message:o({id:"reviews",defaultMessage:"Reviews"})})}},70806:(e,s,a)=>{a.d(s,{A:()=>i});var t=a(96427),l=a(79350),r=a(53588);function n(){let e=(0,t._)(["\n mutation SendEnrollmentEmail($email: String!) {\n sendEnrollmentEmail(email: $email) {\n success\n }\n }\n"]);return n=function(){return e},e}let d=(0,l.J1)(n()),i=()=>{let[e]=(0,r.n)(d);return{sendEnrollmentEmail:async s=>{let{email:a}=s;return e({variables:{email:a}})}}}},74420:(e,s,a)=>{a.d(s,{A:()=>r});var t=a(96427);function l(){let e=(0,t._)(["\n fragment OrderFragment on Order {\n _id\n status\n created\n updated\n ordered\n orderNumber\n confirmed\n fullfilled\n contact {\n telNumber\n emailAddress\n }\n total {\n isTaxable\n isNetPrice\n amount\n currencyCode\n }\n user {\n _id\n username\n isGuest\n avatar {\n _id\n url\n }\n profile {\n displayName\n address {\n firstName\n lastName\n }\n }\n }\n }\n"]);return l=function(){return e},e}let r=(0,a(79350).J1)(l())},89244:(e,s,a)=>{a.d(s,{A:()=>l});var t=a(14232);let l=t.forwardRef(function(e,s){let{title:a,titleId:l,...r}=e;return t.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:s,"aria-labelledby":l},r),a?t.createElement("title",{id:l},a):null,t.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"}))})},93196:(e,s,a)=>{a.d(s,{A:()=>r});var t=a(96427);function l(){let e=(0,t._)(["\n fragment QuotationFragment on Quotation {\n _id\n user {\n _id\n username\n avatar {\n _id\n url\n }\n name\n primaryEmail {\n verified\n address\n }\n }\n product {\n _id\n texts {\n _id\n slug\n subtitle\n title\n description\n }\n media {\n _id\n file {\n _id\n type\n url\n }\n }\n }\n currency {\n _id\n contractAddress\n decimals\n isoCode\n }\n status\n created\n expires\n updated\n isExpired\n quotationNumber\n fullfilled\n rejected\n }\n"]);return l=function(){return e},e}let r=(0,a(79350).J1)(l())}}]);