@foxy.io/elements 1.31.1-beta.1 → 1.32.0-beta.1

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 (256) hide show
  1. package/dist/cdn/foxy-access-recovery-form.js +1 -1
  2. package/dist/cdn/foxy-address-card.js +1 -1
  3. package/dist/cdn/foxy-address-form.js +1 -1
  4. package/dist/cdn/foxy-admin-subscription-card.js +1 -1
  5. package/dist/cdn/foxy-admin-subscription-form.js +1 -1
  6. package/dist/cdn/foxy-api-browser.js +1 -1
  7. package/dist/cdn/foxy-applied-coupon-code-card.js +1 -1
  8. package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
  9. package/dist/cdn/foxy-applied-tax-card.js +1 -1
  10. package/dist/cdn/foxy-attribute-card.js +1 -1
  11. package/dist/cdn/foxy-attribute-form.js +1 -1
  12. package/dist/cdn/foxy-billing-address-card.js +1 -1
  13. package/dist/cdn/foxy-cancellation-form.js +1 -1
  14. package/dist/cdn/foxy-cart-card.js +1 -1
  15. package/dist/cdn/foxy-cart-form.js +1 -1
  16. package/dist/cdn/foxy-client-card.js +1 -1
  17. package/dist/cdn/foxy-client-form.js +1 -1
  18. package/dist/cdn/foxy-collection-page.js +1 -1
  19. package/dist/cdn/foxy-collection-pages.js +1 -1
  20. package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
  21. package/dist/cdn/foxy-coupon-card.js +1 -1
  22. package/dist/cdn/foxy-coupon-code-card.js +1 -1
  23. package/dist/cdn/foxy-coupon-code-form.js +1 -1
  24. package/dist/cdn/foxy-coupon-codes-form.js +1 -1
  25. package/dist/cdn/foxy-coupon-detail-card.js +1 -1
  26. package/dist/cdn/foxy-coupon-form.js +1 -1
  27. package/dist/cdn/foxy-custom-field-card.js +1 -1
  28. package/dist/cdn/foxy-custom-field-form.js +1 -1
  29. package/dist/cdn/foxy-customer-api.js +1 -1
  30. package/dist/cdn/foxy-customer-card.js +1 -1
  31. package/dist/cdn/foxy-customer-form.js +1 -1
  32. package/dist/cdn/foxy-customer-portal-settings-form.js +1 -1
  33. package/dist/cdn/foxy-customer-portal-settings.js +1 -1
  34. package/dist/cdn/foxy-customer-portal.js +1 -1
  35. package/dist/cdn/foxy-customer.js +1 -1
  36. package/dist/cdn/foxy-customers-table.js +1 -1
  37. package/dist/cdn/foxy-discount-builder.js +1 -1
  38. package/dist/cdn/foxy-discount-card.js +1 -1
  39. package/dist/cdn/foxy-discount-detail-card.js +1 -1
  40. package/dist/cdn/foxy-donation.js +1 -1
  41. package/dist/cdn/foxy-downloadable-card.js +1 -1
  42. package/dist/cdn/foxy-downloadable-form.js +1 -1
  43. package/dist/cdn/foxy-email-template-card.js +1 -1
  44. package/dist/cdn/foxy-email-template-form.js +1 -1
  45. package/dist/cdn/foxy-error-entry-card.js +1 -1
  46. package/dist/cdn/foxy-filter-attribute-card.js +1 -1
  47. package/dist/cdn/foxy-filter-attribute-form.js +1 -1
  48. package/dist/cdn/foxy-form-dialog.js +1 -1
  49. package/dist/cdn/foxy-generate-codes-form.js +1 -1
  50. package/dist/cdn/foxy-gift-card-card.js +1 -1
  51. package/dist/cdn/foxy-gift-card-code-card.js +1 -1
  52. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  53. package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
  54. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  55. package/dist/cdn/foxy-gift-card-form.js +1 -1
  56. package/dist/cdn/foxy-i18n-editor.js +1 -1
  57. package/dist/cdn/foxy-i18n.js +1 -1
  58. package/dist/cdn/foxy-integration-card.js +1 -1
  59. package/dist/cdn/foxy-integration-form.js +1 -1
  60. package/dist/cdn/foxy-item-card.js +1 -1
  61. package/dist/cdn/foxy-item-category-card.js +1 -1
  62. package/dist/cdn/foxy-item-category-form.js +1 -1
  63. package/dist/cdn/foxy-item-form.js +1 -1
  64. package/dist/cdn/foxy-item-option-card.js +1 -1
  65. package/dist/cdn/foxy-item-option-form.js +1 -1
  66. package/dist/cdn/foxy-items-form.js +1 -1
  67. package/dist/cdn/foxy-native-integration-card.js +1 -1
  68. package/dist/cdn/foxy-native-integration-form.js +1 -1
  69. package/dist/cdn/foxy-nucleon-element.js +1 -1
  70. package/dist/cdn/foxy-pagination.js +1 -1
  71. package/dist/cdn/foxy-passkey-card.js +1 -1
  72. package/dist/cdn/foxy-passkey-form.js +1 -1
  73. package/dist/cdn/foxy-payment-card-embed.js +1 -1
  74. package/dist/cdn/foxy-payment-card.js +1 -1
  75. package/dist/cdn/foxy-payment-method-card.js +1 -1
  76. package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
  77. package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
  78. package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
  79. package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
  80. package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
  81. package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
  82. package/dist/cdn/foxy-payments-api.js +1 -1
  83. package/dist/cdn/foxy-query-builder.js +2 -2
  84. package/dist/cdn/foxy-report-form.js +2 -2
  85. package/dist/cdn/foxy-reports-table.js +1 -1
  86. package/dist/cdn/foxy-shipment-card.js +1 -1
  87. package/dist/cdn/foxy-shipping-container-card.js +1 -1
  88. package/dist/cdn/foxy-shipping-drop-type-card.js +1 -1
  89. package/dist/cdn/foxy-shipping-method-card.js +1 -1
  90. package/dist/cdn/foxy-shipping-service-card.js +1 -1
  91. package/dist/cdn/foxy-sign-in-form.js +1 -1
  92. package/dist/cdn/foxy-spinner.js +2 -2
  93. package/dist/cdn/foxy-store-card.js +1 -1
  94. package/dist/cdn/foxy-store-form.js +1 -1
  95. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  96. package/dist/cdn/foxy-subscription-card.js +1 -1
  97. package/dist/cdn/foxy-subscription-form.js +1 -1
  98. package/dist/cdn/foxy-subscription-settings-form.js +1 -1
  99. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  100. package/dist/cdn/foxy-table.js +1 -1
  101. package/dist/cdn/foxy-tax-card.js +1 -1
  102. package/dist/cdn/foxy-tax-form.js +1 -1
  103. package/dist/cdn/foxy-template-config-form.js +1 -1
  104. package/dist/cdn/foxy-template-form.js +1 -1
  105. package/dist/cdn/foxy-template-set-card.js +1 -1
  106. package/dist/cdn/foxy-template-set-form.js +1 -1
  107. package/dist/cdn/foxy-transaction-card.js +1 -1
  108. package/dist/cdn/foxy-transaction.js +1 -1
  109. package/dist/cdn/foxy-transactions-table.js +7 -7
  110. package/dist/cdn/foxy-update-payment-method-form.js +1 -1
  111. package/dist/cdn/foxy-user-card.js +1 -1
  112. package/dist/cdn/foxy-user-form.js +1 -1
  113. package/dist/cdn/foxy-user-invitation-card.js +1 -0
  114. package/dist/cdn/foxy-user-invitation-form.js +1 -0
  115. package/dist/cdn/foxy-users-table.js +1 -1
  116. package/dist/cdn/foxy-webhook-card.js +1 -1
  117. package/dist/cdn/foxy-webhook-form.js +1 -1
  118. package/dist/cdn/foxy-webhook-log-card.js +1 -1
  119. package/dist/cdn/foxy-webhook-status-card.js +1 -1
  120. package/dist/cdn/{shared-12a7a15d.js → shared-019348d7.js} +1 -1
  121. package/dist/cdn/{shared-01b2cad8.js → shared-0e156ee7.js} +1 -1
  122. package/dist/cdn/{shared-9b2d6d62.js → shared-11694c05.js} +1 -1
  123. package/dist/cdn/{shared-21bc5d5e.js → shared-15100be0.js} +1 -1
  124. package/dist/cdn/{shared-f7a1193f.js → shared-17a61265.js} +1 -1
  125. package/dist/cdn/{shared-55e95bd2.js → shared-185dffc3.js} +1 -1
  126. package/dist/cdn/{shared-7c411b0a.js → shared-193bb806.js} +1 -1
  127. package/dist/cdn/{shared-f3773d62.js → shared-19df2a73.js} +1 -1
  128. package/dist/cdn/{shared-0700fd80.js → shared-1a30f25e.js} +1 -1
  129. package/dist/cdn/shared-1aff7995.js +1 -0
  130. package/dist/cdn/{shared-6e859df6.js → shared-239062b0.js} +1 -1
  131. package/dist/cdn/{shared-6918312e.js → shared-28ebee50.js} +1 -1
  132. package/dist/cdn/{shared-24d71d01.js → shared-2ad18636.js} +1 -1
  133. package/dist/cdn/{shared-3c3497d6.js → shared-2bc0d0cd.js} +1 -1
  134. package/dist/cdn/{shared-ac0368ec.js → shared-2e090291.js} +1 -1
  135. package/dist/cdn/{shared-8cd578ee.js → shared-374e6faa.js} +1 -1
  136. package/dist/cdn/{shared-280f868d.js → shared-40af05b3.js} +1 -1
  137. package/dist/cdn/{shared-c8a6496c.js → shared-482ba043.js} +5 -5
  138. package/dist/cdn/{shared-56bf05ef.js → shared-4903b2e3.js} +1 -1
  139. package/dist/cdn/shared-492da078.js +1 -0
  140. package/dist/cdn/{shared-90a47948.js → shared-5513e830.js} +1 -1
  141. package/dist/cdn/{shared-8f3398dc.js → shared-562d466d.js} +1 -1
  142. package/dist/cdn/shared-56ba2d28.js +1 -0
  143. package/dist/cdn/{shared-08e0a194.js → shared-5c35d93a.js} +1 -1
  144. package/dist/cdn/{shared-56a559fd.js → shared-5c846a3b.js} +1 -1
  145. package/dist/cdn/shared-5e09e162.js +1 -0
  146. package/dist/cdn/{shared-453d8f75.js → shared-60209b2d.js} +1 -1
  147. package/dist/cdn/{shared-6ac0d05e.js → shared-641786b2.js} +1 -1
  148. package/dist/cdn/{shared-09b4185a.js → shared-65479601.js} +1 -1
  149. package/dist/cdn/{shared-0f67d020.js → shared-6b8c2a83.js} +1 -1
  150. package/dist/cdn/{shared-a49a2300.js → shared-6e1b5baf.js} +1 -1
  151. package/dist/cdn/{shared-61b6ef6e.js → shared-6f0504e2.js} +1 -1
  152. package/dist/cdn/{shared-e778071b.js → shared-7275324b.js} +1 -1
  153. package/dist/cdn/{shared-937b497c.js → shared-745f340a.js} +1 -1
  154. package/dist/cdn/{shared-1f0b8b7e.js → shared-74eedbe6.js} +1 -1
  155. package/dist/cdn/{shared-d1c10d58.js → shared-7c15c149.js} +1 -1
  156. package/dist/cdn/{shared-a207423c.js → shared-7ceceb4c.js} +1 -1
  157. package/dist/cdn/{shared-ce75e928.js → shared-86a9b27a.js} +1 -1
  158. package/dist/cdn/{shared-91f5e0b3.js → shared-87b5a6aa.js} +1 -1
  159. package/dist/cdn/{shared-5be5874d.js → shared-8a3fd383.js} +1 -1
  160. package/dist/cdn/{shared-c388e926.js → shared-8a73d1aa.js} +1 -1
  161. package/dist/cdn/{shared-b8198665.js → shared-8b5e05df.js} +1 -1
  162. package/dist/cdn/{shared-e24da82e.js → shared-8da3186f.js} +2 -2
  163. package/dist/cdn/{shared-4b346553.js → shared-8fc527b7.js} +1 -1
  164. package/dist/cdn/{shared-ef78d7d9.js → shared-9092b5db.js} +1 -1
  165. package/dist/cdn/{shared-0a6a28ce.js → shared-913e1955.js} +1 -1
  166. package/dist/cdn/{shared-c2776a33.js → shared-91d8985f.js} +1 -1
  167. package/dist/cdn/{shared-5a2f398c.js → shared-92192fe1.js} +1 -1
  168. package/dist/cdn/{shared-d8c3067b.js → shared-97cfdcdb.js} +1 -1
  169. package/dist/cdn/{shared-19884cf4.js → shared-9a59aab2.js} +1 -1
  170. package/dist/cdn/{shared-522a172d.js → shared-9cf15285.js} +1 -1
  171. package/dist/cdn/{shared-28f74114.js → shared-9d309e97.js} +1 -1
  172. package/dist/cdn/{shared-2a5c89a4.js → shared-9e360643.js} +1 -1
  173. package/dist/cdn/{shared-388e9240.js → shared-aaf72aad.js} +1 -1
  174. package/dist/cdn/{shared-37efab30.js → shared-acd33590.js} +1 -1
  175. package/dist/cdn/{shared-44ce656d.js → shared-adcfd50a.js} +1 -1
  176. package/dist/cdn/{shared-f11b2116.js → shared-addddf0e.js} +1 -1
  177. package/dist/cdn/{shared-fb34e84c.js → shared-b726120d.js} +2 -2
  178. package/dist/cdn/{shared-0e055562.js → shared-bc023a29.js} +1 -1
  179. package/dist/cdn/{shared-6d645dc5.js → shared-c2efc54e.js} +1 -1
  180. package/dist/cdn/{shared-029d623b.js → shared-c4f15ea3.js} +1 -1
  181. package/dist/cdn/{shared-ce172224.js → shared-c508d5dc.js} +1 -1
  182. package/dist/cdn/{shared-c286c5ad.js → shared-c518ece2.js} +1 -1
  183. package/dist/cdn/{shared-16c17e32.js → shared-c538157f.js} +1 -1
  184. package/dist/cdn/{shared-f407c2cb.js → shared-c5647b62.js} +1 -1
  185. package/dist/cdn/{shared-60d586ba.js → shared-c9346893.js} +1 -1
  186. package/dist/cdn/{shared-d132bd37.js → shared-c98881c7.js} +1 -1
  187. package/dist/cdn/{shared-da9e048f.js → shared-ca0847b0.js} +1 -1
  188. package/dist/cdn/shared-d1195c27.js +15 -0
  189. package/dist/cdn/{shared-0b01f721.js → shared-d1cb97c6.js} +1 -1
  190. package/dist/cdn/{shared-fb0ca5e2.js → shared-d3044c4c.js} +1 -1
  191. package/dist/cdn/{shared-245f8836.js → shared-d4a1658e.js} +1 -1
  192. package/dist/cdn/shared-d8bffb38.js +14 -0
  193. package/dist/cdn/{shared-fc1dfa64.js → shared-df51ee50.js} +1 -1
  194. package/dist/cdn/{shared-edbf7378.js → shared-dfe41029.js} +1 -1
  195. package/dist/cdn/{shared-536a2d53.js → shared-e709057b.js} +1 -1
  196. package/dist/cdn/{shared-199e3870.js → shared-f5547471.js} +1 -1
  197. package/dist/cdn/{shared-0cc5420d.js → shared-f67f6fc5.js} +1 -1
  198. package/dist/cdn/{shared-7d38cb8a.js → shared-f8368b97.js} +1 -1
  199. package/dist/cdn/{shared-f2968508.js → shared-f893763a.js} +2 -2
  200. package/dist/cdn/{shared-b08ca8d0.js → shared-f998f9c8.js} +1 -1
  201. package/dist/cdn/{shared-ee36b83f.js → shared-fcdb896f.js} +1 -1
  202. package/dist/cdn/translations/user-invitation-card/en.json +17 -0
  203. package/dist/cdn/translations/user-invitation-form/en.json +94 -0
  204. package/dist/elements/public/UserCard/UserCard.d.ts +7 -0
  205. package/dist/elements/public/UserCard/UserCard.js +81 -2
  206. package/dist/elements/public/UserCard/UserCard.js.map +1 -1
  207. package/dist/elements/public/UserCard/index.d.ts +1 -0
  208. package/dist/elements/public/UserCard/index.js +1 -0
  209. package/dist/elements/public/UserCard/index.js.map +1 -1
  210. package/dist/elements/public/UserInvitationCard/UserInvitationCard.d.ts +16 -0
  211. package/dist/elements/public/UserInvitationCard/UserInvitationCard.js +110 -0
  212. package/dist/elements/public/UserInvitationCard/UserInvitationCard.js.map +1 -0
  213. package/dist/elements/public/UserInvitationCard/index.d.ts +4 -0
  214. package/dist/elements/public/UserInvitationCard/index.js +6 -0
  215. package/dist/elements/public/UserInvitationCard/index.js.map +1 -0
  216. package/dist/elements/public/UserInvitationCard/types.d.ts +1 -0
  217. package/dist/elements/public/UserInvitationCard/types.js +2 -0
  218. package/dist/elements/public/UserInvitationCard/types.js.map +1 -0
  219. package/dist/elements/public/UserInvitationForm/UserInvitationForm.d.ts +29 -0
  220. package/dist/elements/public/UserInvitationForm/UserInvitationForm.js +313 -0
  221. package/dist/elements/public/UserInvitationForm/UserInvitationForm.js.map +1 -0
  222. package/dist/elements/public/UserInvitationForm/index.d.ts +7 -0
  223. package/dist/elements/public/UserInvitationForm/index.js +9 -0
  224. package/dist/elements/public/UserInvitationForm/index.js.map +1 -0
  225. package/dist/elements/public/UserInvitationForm/internal/InternalUserInvitationFormAsyncAction/InternalUserInvitationFormAsyncAction.d.ts +10 -0
  226. package/dist/elements/public/UserInvitationForm/internal/InternalUserInvitationFormAsyncAction/InternalUserInvitationFormAsyncAction.js +51 -0
  227. package/dist/elements/public/UserInvitationForm/internal/InternalUserInvitationFormAsyncAction/InternalUserInvitationFormAsyncAction.js.map +1 -0
  228. package/dist/elements/public/UserInvitationForm/internal/InternalUserInvitationFormAsyncAction/index.d.ts +5 -0
  229. package/dist/elements/public/UserInvitationForm/internal/InternalUserInvitationFormAsyncAction/index.js +7 -0
  230. package/dist/elements/public/UserInvitationForm/internal/InternalUserInvitationFormAsyncAction/index.js.map +1 -0
  231. package/dist/elements/public/UserInvitationForm/internal/InternalUserInvitationFormSyncAction/InternalUserInvitationFormSyncAction.d.ts +9 -0
  232. package/dist/elements/public/UserInvitationForm/internal/InternalUserInvitationFormSyncAction/InternalUserInvitationFormSyncAction.js +32 -0
  233. package/dist/elements/public/UserInvitationForm/internal/InternalUserInvitationFormSyncAction/InternalUserInvitationFormSyncAction.js.map +1 -0
  234. package/dist/elements/public/UserInvitationForm/internal/InternalUserInvitationFormSyncAction/index.d.ts +5 -0
  235. package/dist/elements/public/UserInvitationForm/internal/InternalUserInvitationFormSyncAction/index.js +7 -0
  236. package/dist/elements/public/UserInvitationForm/internal/InternalUserInvitationFormSyncAction/index.js.map +1 -0
  237. package/dist/elements/public/UserInvitationForm/types.d.ts +33 -0
  238. package/dist/elements/public/UserInvitationForm/types.js +2 -0
  239. package/dist/elements/public/UserInvitationForm/types.js.map +1 -0
  240. package/dist/elements/public/index.d.ts +2 -0
  241. package/dist/elements/public/index.defined.d.ts +2 -0
  242. package/dist/elements/public/index.defined.js +2 -0
  243. package/dist/elements/public/index.defined.js.map +1 -1
  244. package/dist/elements/public/index.js +2 -0
  245. package/dist/elements/public/index.js.map +1 -1
  246. package/dist/mixins/themeable.js +4 -0
  247. package/dist/mixins/themeable.js.map +1 -1
  248. package/dist/utils/get-gravatar-url.d.ts +1 -0
  249. package/dist/utils/get-gravatar-url.js +8 -0
  250. package/dist/utils/get-gravatar-url.js.map +1 -0
  251. package/package.json +1 -1
  252. package/dist/cdn/shared-0f6e4584.js +0 -15
  253. package/dist/cdn/shared-3ee151ce.js +0 -1
  254. package/dist/cdn/shared-6474675f.js +0 -1
  255. package/dist/cdn/shared-9db46672.js +0 -1
  256. package/dist/cdn/shared-f34aeb6c.js +0 -1
@@ -1 +1 @@
1
- import"./foxy-spinner.js";import{_ as e}from"./shared-0f6e4584.js";import{h as t}from"./shared-dc73b9a5.js";import{a as s}from"./shared-fb34e84c.js";import{C as r}from"./shared-0b01f721.js";import{F as i}from"./shared-343d1fd7.js";import{N as a}from"./shared-24d71d01.js";import{r as n}from"./shared-a0c6a159.js";import{s as o}from"./shared-99940888.js";import"./shared-90a47948.js";import"./shared-44ce656d.js";import"./shared-56bf05ef.js";import"./shared-37efab30.js";import"./shared-f7a1193f.js";import"./shared-9803aa7c.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";let l,d=e=>e;const h=r(s(a));class p extends h{constructor(){super(),this.props={},this.__pageFetchEventHandler=e=>this.__handlePageFetchEvent(e),this.item="foxy-null"}static get properties(){return e(e({},super.properties),{},{props:{type:Object},item:{type:String}})}get item(){return this.__item}set item(e){const t=null!=e?e:"foxy-null";this.__renderItem="string"==typeof t?new Function("ctx",`return ctx.html\`\n <${t}\n disabledcontrols=\${ctx.disabledControls.toString()}\n readonlycontrols=\${ctx.readonlyControls.toString()}\n hiddencontrols=\${ctx.hiddenControls.toString()}\n data-testclass="items"\n related=\${JSON.stringify(ctx.related)}\n parent=\${ctx.parent}\n group=\${ctx.group}\n href=\${ctx.href}\n lang=\${ctx.lang}\n ns="\${ctx.ns} \${customElements.get('${t}')?.defaultNS ?? ''}"\n ?disabled=\${ctx.disabled}\n ?readonly=\${ctx.readonly}\n ?hidden=\${ctx.hidden}\n .simplifyNsLoading=\${ctx.simplifyNsLoading}\n .templates=\${ctx.templates}\n ...=\${ctx.spread(ctx.props)}\n >\n </${t}>\``):t,this.__item=e,this.requestUpdate()}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener("fetch",this.__pageFetchEventHandler)}render(){let e=[];return e=this.in("busy")?[{key:"stalled",href:"foxy://collection-page/stall",data:null}]:this.in("fail")?[{key:"failed",href:"foxy://collection-page/fail",data:null}]:this.in({idle:"template"})||0===this.__items.length?[{key:"empty",href:"",data:null}]:this.__items.map((e=>({key:e._links.self.href,href:e._links.self.href,data:e}))),t(l||(l=d`${0}`),n(e,(e=>e.key),((s,r)=>{var i,a,n,l,d;return null===(i=this.__renderItem)||void 0===i?void 0:i.call(this,{simplifyNsLoading:this.simplifyNsLoading,disabledControls:this.disabledControls,readonlyControls:this.readonlyControls,hiddenControls:this.hiddenControls,templates:this.templates,disabled:this.disabled,readonly:this.readonly,previous:null!==(n=null===(a=e[r-1])||void 0===a?void 0:a.data)&&void 0!==n?n:null,related:this.related,hidden:this.hidden,parent:this.href,spread:o,props:this.props,group:this.group,lang:this.lang,data:s.data,href:s.href,next:null!==(d=null===(l=e[r+1])||void 0===l?void 0:l.data)&&void 0!==d?d:null,ns:this.ns,html:t})})))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("fetch",this.__pageFetchEventHandler)}get __items(){var e,t;return Array.from(Object.values(null!==(t=null===(e=this.form)||void 0===e?void 0:e._embedded)&&void 0!==t?t:{})).reduce(((e,t)=>[...e,...t]),[])}__handlePageFetchEvent(e){if(!(e instanceof i)||e.target===this)return;const{method:t,url:s}=e.request;return"GET"===t?"foxy://collection-page/stall"===s?this.__stallRequest(e):"foxy://collection-page/fail"===s?this.__failRequest(e):void 0:void 0}__stallRequest(e){e.stopImmediatePropagation(),e.respondWith(new Promise((()=>{})))}__failRequest(e){e.stopImmediatePropagation(),e.respondWith(Promise.resolve(new Response(null,{status:500})))}}customElements.define("foxy-collection-page",p);export{p as CollectionPage};
1
+ import"./foxy-spinner.js";import{_ as e}from"./shared-d1195c27.js";import{h as t}from"./shared-dc73b9a5.js";import{a as s}from"./shared-b726120d.js";import{C as r}from"./shared-d1cb97c6.js";import{F as i}from"./shared-343d1fd7.js";import{N as n}from"./shared-2ad18636.js";import{r as a}from"./shared-a0c6a159.js";import{s as o}from"./shared-99940888.js";import"./shared-5513e830.js";import"./shared-adcfd50a.js";import"./shared-4903b2e3.js";import"./shared-acd33590.js";import"./shared-17a61265.js";import"./shared-9803aa7c.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";let d,l=e=>e;const h=r(s(n));class p extends h{constructor(){super(),this.props={},this.__pageFetchEventHandler=e=>this.__handlePageFetchEvent(e),this.item="foxy-null"}static get properties(){return e(e({},super.properties),{},{props:{type:Object},item:{type:String}})}get item(){return this.__item}set item(e){const t=null!=e?e:"foxy-null";this.__renderItem="string"==typeof t?new Function("ctx",`return ctx.html\`\n <${t}\n disabledcontrols=\${ctx.disabledControls.toString()}\n readonlycontrols=\${ctx.readonlyControls.toString()}\n hiddencontrols=\${ctx.hiddenControls.toString()}\n data-testclass="items"\n related=\${JSON.stringify(ctx.related)}\n parent=\${ctx.parent}\n group=\${ctx.group}\n href=\${ctx.href}\n lang=\${ctx.lang}\n ns="\${ctx.ns} \${customElements.get('${t}')?.defaultNS ?? ''}"\n ?disabled=\${ctx.disabled}\n ?readonly=\${ctx.readonly}\n ?hidden=\${ctx.hidden}\n .simplifyNsLoading=\${ctx.simplifyNsLoading}\n .templates=\${ctx.templates}\n ...=\${ctx.spread(ctx.props)}\n >\n </${t}>\``):t,this.__item=e,this.requestUpdate()}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener("fetch",this.__pageFetchEventHandler)}render(){let e=[];return e=this.in("busy")?[{key:"stalled",href:"foxy://collection-page/stall",data:null}]:this.in("fail")?[{key:"failed",href:"foxy://collection-page/fail",data:null}]:this.in({idle:"template"})||0===this.__items.length?[{key:"empty",href:"",data:null}]:this.__items.map((e=>({key:e._links.self.href,href:e._links.self.href,data:e}))),t(d||(d=l`${0}`),a(e,(e=>e.key),((s,r)=>{var i,n,a,d,l;return null===(i=this.__renderItem)||void 0===i?void 0:i.call(this,{simplifyNsLoading:this.simplifyNsLoading,disabledControls:this.disabledControls,readonlyControls:this.readonlyControls,hiddenControls:this.hiddenControls,templates:this.templates,disabled:this.disabled,readonly:this.readonly,previous:null!==(a=null===(n=e[r-1])||void 0===n?void 0:n.data)&&void 0!==a?a:null,related:this.related,hidden:this.hidden,parent:this.href,spread:o,props:this.props,group:this.group,lang:this.lang,data:s.data,href:s.href,next:null!==(l=null===(d=e[r+1])||void 0===d?void 0:d.data)&&void 0!==l?l:null,ns:this.ns,html:t})})))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("fetch",this.__pageFetchEventHandler)}get __items(){var e,t;return Array.from(Object.values(null!==(t=null===(e=this.form)||void 0===e?void 0:e._embedded)&&void 0!==t?t:{})).reduce(((e,t)=>[...e,...t]),[])}__handlePageFetchEvent(e){if(!(e instanceof i)||e.target===this)return;const{method:t,url:s}=e.request;return"GET"===t?"foxy://collection-page/stall"===s?this.__stallRequest(e):"foxy://collection-page/fail"===s?this.__failRequest(e):void 0:void 0}__stallRequest(e){e.stopImmediatePropagation(),e.respondWith(new Promise((()=>{})))}__failRequest(e){e.stopImmediatePropagation(),e.respondWith(Promise.resolve(new Response(null,{status:500})))}}customElements.define("foxy-collection-page",p);export{p as CollectionPage};
@@ -1 +1 @@
1
- import"./shared-6e859df6.js";import"./foxy-collection-page.js";import"./shared-37efab30.js";import{o as e,aE as t,_ as s,R as r}from"./shared-0f6e4584.js";import{h as a,L as i}from"./shared-dc73b9a5.js";import{C as n}from"./shared-0b01f721.js";import{F as o}from"./shared-343d1fd7.js";import{N as d,s as l}from"./shared-24d71d01.js";import{r as c}from"./shared-a0c6a159.js";import{I as h}from"./shared-f7a1193f.js";import{i as p}from"./shared-ee36b83f.js";import{s as u}from"./shared-99940888.js";import"./shared-b08ca8d0.js";import"./shared-44ce656d.js";import"./shared-fb34e84c.js";import"./shared-09b4185a.js";import"./shared-61ade33e.js";import"./foxy-spinner.js";import"./shared-90a47948.js";import"./shared-56bf05ef.js";import"./shared-9803aa7c.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";const _=e({manual:(e,t)=>t.data}),g=e({error:(e,t)=>t.data}),m=e({first:(e,t)=>t.data,pages:[],error:null}),f=e({first:(e,t)=>{var s,r;return null!==(r=null===(s=t.data[0])||void 0===s?void 0:s._links.self.href)&&void 0!==r?r:""},pages:(e,t)=>t.data,error:null}),v=e({pages:(e,t)=>0===t.data.returned_items?e.pages:[...e.pages,t.data]}),y=e=>e.manual,b=t({id:"pages",initial:"idle",context:{first:"",pages:[],error:null,manual:!1},states:{busy:{invoke:{src:"sendGet",onError:{target:"fail",actions:g},onDone:[{target:"idle.empty",cond:(e,t)=>0==t.data.total_items},{target:"idle.end",cond:(e,t)=>t.data.returned_items<t.data.limit,actions:v},{target:"idle.paused.manual",cond:y,actions:v},{target:"idle.paused.auto",actions:v}]},on:{SET_MANUAL:{actions:_}}},fail:{on:{SET_MANUAL:{actions:_}}},idle:{initial:"empty",states:{paused:{states:{auto:{invoke:{src:"observeChildren"}},manual:{}},on:{RESUME:"#pages.busy",SET_MANUAL:[{cond:y,actions:_,target:".manual"},{actions:_,target:".auto"}]}},empty:{on:{SET_MANUAL:{actions:_}}},end:{on:{SET_MANUAL:{actions:_}}}}}},on:{SET_FIRST:[{cond:(e,t)=>0===t.data.trim().length,target:"idle.empty",actions:m},{target:"busy",actions:m}],SET_PAGES:[{cond:(e,t)=>0===t.data.length,target:"idle.empty",actions:f},{target:"idle.paused",actions:f}]}});let x,E,k,S=e=>e;const j=n(h(i));class R extends j{constructor(){var e;super(),e=this,this.props={},this.lang="",this.ns="",this.__group="",this.__fetchEventHandler=e=>this.__handleFetchEvent(e),this.__service=p(b.withConfig({services:{observeChildren:()=>e=>{const t=new IntersectionObserver((t=>{t.some((e=>e.isIntersecting))&&e("RESUME")}));return t.observe(this.renderRoot.children[this.renderRoot.children.length-1]),()=>t.disconnect()},sendGet:async function(t){var s;const r=t.pages[t.pages.length-1],a=null!==(s=null==r?void 0:r._links.next.href)&&void 0!==s?s:t.first,i=await new d.API(e).fetch(a);if(!i.ok)throw i;const n=await i.json();return e.__stopTrackingRumour(),d.Rumour(e.group).share({source:n._links.self.href,data:n}),e.__trackRumour(),n}}})),this.page="foxy-collection-page foxy-null"}static get properties(){return s(s({},super.properties),{},{manual:{type:Boolean,reflect:!0},first:{type:String,noAccessor:!0},pages:{type:Array,noAccessor:!0},group:{type:String},props:{type:Object},lang:{type:String},page:{type:String},ns:{type:String}})}get page(){return this.__page}set page(e){if("string"==typeof e){const t=e.split(" ").pop(),s=t?`item="${t}"`:"";this.__renderPage=new Function("ctx",`return ctx.html\`\n <${e}\n disabledcontrols=\${ctx.disabledControls.toString()}\n readonlycontrols=\${ctx.readonlyControls.toString()}\n hiddencontrols=\${ctx.hiddenControls.toString()}\n group=\${ctx.group}\n href=\${ctx.href}\n lang=\${ctx.lang}\n ns="\${ctx.ns} \${customElements.get('${e}')?.defaultNS ?? ''}"\n ${s}\n ?disabled=\${ctx.disabled}\n ?readonly=\${ctx.readonly}\n ?hidden=\${ctx.hidden}\n .templates=\${ctx.templates}\n ...=\${ctx.spread(ctx.props)}\n >\n </${e}>\``)}else this.__renderPage=e;this.__page=e,this.requestUpdate()}get first(){var e,t;return null!==(t=null===(e=this.__service.state)||void 0===e?void 0:e.context.first)&&void 0!==t?t:""}set first(e){this.__service.send({type:"SET_FIRST",data:e})}get pages(){var e,t;return null!==(t=null===(e=this.__service.state)||void 0===e?void 0:e.context.pages)&&void 0!==t?t:[]}set pages(e){this.__service.send({type:"SET_PAGES",data:e})}get group(){return this.__group}set group(e){var t;this.__group=e,null===(t=this.__stopTrackingRumour)||void 0===t||t.call(this),this.__trackRumour()}get manual(){var e;return!!(null===(e=this.__service.state)||void 0===e?void 0:e.context.manual)}set manual(e){this.__service.send({type:"SET_MANUAL",data:e})}in(e){var t;return!!(null===(t=this.__service.state)||void 0===t?void 0:t.matches(e))}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener("fetch",this.__fetchEventHandler),this.__createService(),this.__trackRumour()}render(){var e,t,s;const r=this.pages.map((e=>({key:e._links.self.href,href:e._links.self.href})));return(null===(e=this.__service.state)||void 0===e?void 0:e.matches("busy"))?r.push({key:"stalled",href:"foxy://collection-pages/stall"}):(null===(t=this.__service.state)||void 0===t?void 0:t.matches("fail"))?r.push({key:"failed",href:"foxy://collection-pages/fail"}):(null===(s=this.__service.state)||void 0===s?void 0:s.matches({idle:"empty"}))&&r.push({key:"empty",href:""}),a(x||(x=S` ${0} ${0} `),c(r,(e=>e.key),((e,t)=>{var s;return this.__renderPage({disabledControls:this.disabledControls,readonlyControls:this.readonlyControls,hiddenControls:this.hiddenControls,templates:this.templates,disabled:this.disabled,readonly:this.readonly,hidden:this.hidden,spread:u,props:this.props,group:this.group,data:null!==(s=this.pages[t])&&void 0!==s?s:null,href:e.href,lang:this.lang,ns:this.ns,html:a})})),this.manual?this.in({idle:"paused"})?a(E||(E=S` <vaadin-button theme="small contrast" @click="${0}"> <foxy-i18n lang="${0}" key="load_more" ns="${0}"></foxy-i18n> </vaadin-button> `),(()=>this.__service.send("RESUME")),this.lang,this.ns):"":a(k||(k=S` <span></span> `)))}updated(e){super.updated(e),this.dispatchEvent(new d.UpdateEvent)}disconnectedCallback(){var e;super.disconnectedCallback(),this.removeEventListener("fetch",this.__fetchEventHandler),this.__service.stop(),null===(e=this.__stopTrackingRumour)||void 0===e||e.call(this)}__trackRumour(){this.__stopTrackingRumour=d.Rumour(this.group).track((e=>{try{0===this.pages.length?e({_links:{self:{href:this.first}}}):this.pages.map((t=>e(t)))}catch(e){if(!(e instanceof r.UpdateError))throw e;this.__service.send({type:"SET_FIRST",data:this.first})}}))}__createService(){this.__service.onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}__handleFetchEvent(e){if(!(e instanceof o)||e.target===this)return;const{method:t,url:s}=e.request;return"GET"===t?"foxy://collection-pages/stall"===s?this.__stallRequest(e):"foxy://collection-pages/fail"===s?this.__failRequest(e):void this.__respondIfPossible(e):void 0}__respondIfPossible(e){const t=l(e.request.url,this.pages);t.ok&&(e.respondWith(Promise.resolve(t)),console.debug(`%c@foxy.io/elements::${this.localName}\n%c200%c GET ${e.request.url}`,"color: gray","background: gray; padding: 0 .2em; border-radius: .2em; color: white;",""))}__stallRequest(e){e.stopImmediatePropagation(),e.respondWith(new Promise((()=>{})))}__failRequest(e){var t;const s=null===(t=this.__service.state)||void 0===t?void 0:t.context.error,r=null!=s?s:new Response("Unknown error, details unavailable.",{status:500});e.stopImmediatePropagation(),e.respondWith(Promise.resolve(r))}}customElements.define("foxy-collection-pages",R);export{R as CollectionPages};
1
+ import"./shared-239062b0.js";import"./foxy-collection-page.js";import"./shared-acd33590.js";import{o as e,aE as t,_ as s,R as r}from"./shared-d1195c27.js";import{h as a,L as i}from"./shared-dc73b9a5.js";import{C as n}from"./shared-d1cb97c6.js";import{F as o}from"./shared-343d1fd7.js";import{N as d,s as l}from"./shared-2ad18636.js";import{r as c}from"./shared-a0c6a159.js";import{I as h}from"./shared-17a61265.js";import{i as p}from"./shared-fcdb896f.js";import{s as u}from"./shared-99940888.js";import"./shared-f998f9c8.js";import"./shared-adcfd50a.js";import"./shared-b726120d.js";import"./shared-65479601.js";import"./shared-61ade33e.js";import"./foxy-spinner.js";import"./shared-5513e830.js";import"./shared-4903b2e3.js";import"./shared-9803aa7c.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";const _=e({manual:(e,t)=>t.data}),g=e({error:(e,t)=>t.data}),m=e({first:(e,t)=>t.data,pages:[],error:null}),f=e({first:(e,t)=>{var s,r;return null!==(r=null===(s=t.data[0])||void 0===s?void 0:s._links.self.href)&&void 0!==r?r:""},pages:(e,t)=>t.data,error:null}),v=e({pages:(e,t)=>0===t.data.returned_items?e.pages:[...e.pages,t.data]}),y=e=>e.manual,b=t({id:"pages",initial:"idle",context:{first:"",pages:[],error:null,manual:!1},states:{busy:{invoke:{src:"sendGet",onError:{target:"fail",actions:g},onDone:[{target:"idle.empty",cond:(e,t)=>0==t.data.total_items},{target:"idle.end",cond:(e,t)=>t.data.returned_items<t.data.limit,actions:v},{target:"idle.paused.manual",cond:y,actions:v},{target:"idle.paused.auto",actions:v}]},on:{SET_MANUAL:{actions:_}}},fail:{on:{SET_MANUAL:{actions:_}}},idle:{initial:"empty",states:{paused:{states:{auto:{invoke:{src:"observeChildren"}},manual:{}},on:{RESUME:"#pages.busy",SET_MANUAL:[{cond:y,actions:_,target:".manual"},{actions:_,target:".auto"}]}},empty:{on:{SET_MANUAL:{actions:_}}},end:{on:{SET_MANUAL:{actions:_}}}}}},on:{SET_FIRST:[{cond:(e,t)=>0===t.data.trim().length,target:"idle.empty",actions:m},{target:"busy",actions:m}],SET_PAGES:[{cond:(e,t)=>0===t.data.length,target:"idle.empty",actions:f},{target:"idle.paused",actions:f}]}});let x,E,k,S=e=>e;const j=n(h(i));class R extends j{constructor(){var e;super(),e=this,this.props={},this.lang="",this.ns="",this.__group="",this.__fetchEventHandler=e=>this.__handleFetchEvent(e),this.__service=p(b.withConfig({services:{observeChildren:()=>e=>{const t=new IntersectionObserver((t=>{t.some((e=>e.isIntersecting))&&e("RESUME")}));return t.observe(this.renderRoot.children[this.renderRoot.children.length-1]),()=>t.disconnect()},sendGet:async function(t){var s;const r=t.pages[t.pages.length-1],a=null!==(s=null==r?void 0:r._links.next.href)&&void 0!==s?s:t.first,i=await new d.API(e).fetch(a);if(!i.ok)throw i;const n=await i.json();return e.__stopTrackingRumour(),d.Rumour(e.group).share({source:n._links.self.href,data:n}),e.__trackRumour(),n}}})),this.page="foxy-collection-page foxy-null"}static get properties(){return s(s({},super.properties),{},{manual:{type:Boolean,reflect:!0},first:{type:String,noAccessor:!0},pages:{type:Array,noAccessor:!0},group:{type:String},props:{type:Object},lang:{type:String},page:{type:String},ns:{type:String}})}get page(){return this.__page}set page(e){if("string"==typeof e){const t=e.split(" ").pop(),s=t?`item="${t}"`:"";this.__renderPage=new Function("ctx",`return ctx.html\`\n <${e}\n disabledcontrols=\${ctx.disabledControls.toString()}\n readonlycontrols=\${ctx.readonlyControls.toString()}\n hiddencontrols=\${ctx.hiddenControls.toString()}\n group=\${ctx.group}\n href=\${ctx.href}\n lang=\${ctx.lang}\n ns="\${ctx.ns} \${customElements.get('${e}')?.defaultNS ?? ''}"\n ${s}\n ?disabled=\${ctx.disabled}\n ?readonly=\${ctx.readonly}\n ?hidden=\${ctx.hidden}\n .templates=\${ctx.templates}\n ...=\${ctx.spread(ctx.props)}\n >\n </${e}>\``)}else this.__renderPage=e;this.__page=e,this.requestUpdate()}get first(){var e,t;return null!==(t=null===(e=this.__service.state)||void 0===e?void 0:e.context.first)&&void 0!==t?t:""}set first(e){this.__service.send({type:"SET_FIRST",data:e})}get pages(){var e,t;return null!==(t=null===(e=this.__service.state)||void 0===e?void 0:e.context.pages)&&void 0!==t?t:[]}set pages(e){this.__service.send({type:"SET_PAGES",data:e})}get group(){return this.__group}set group(e){var t;this.__group=e,null===(t=this.__stopTrackingRumour)||void 0===t||t.call(this),this.__trackRumour()}get manual(){var e;return!!(null===(e=this.__service.state)||void 0===e?void 0:e.context.manual)}set manual(e){this.__service.send({type:"SET_MANUAL",data:e})}in(e){var t;return!!(null===(t=this.__service.state)||void 0===t?void 0:t.matches(e))}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener("fetch",this.__fetchEventHandler),this.__createService(),this.__trackRumour()}render(){var e,t,s;const r=this.pages.map((e=>({key:e._links.self.href,href:e._links.self.href})));return(null===(e=this.__service.state)||void 0===e?void 0:e.matches("busy"))?r.push({key:"stalled",href:"foxy://collection-pages/stall"}):(null===(t=this.__service.state)||void 0===t?void 0:t.matches("fail"))?r.push({key:"failed",href:"foxy://collection-pages/fail"}):(null===(s=this.__service.state)||void 0===s?void 0:s.matches({idle:"empty"}))&&r.push({key:"empty",href:""}),a(x||(x=S` ${0} ${0} `),c(r,(e=>e.key),((e,t)=>{var s;return this.__renderPage({disabledControls:this.disabledControls,readonlyControls:this.readonlyControls,hiddenControls:this.hiddenControls,templates:this.templates,disabled:this.disabled,readonly:this.readonly,hidden:this.hidden,spread:u,props:this.props,group:this.group,data:null!==(s=this.pages[t])&&void 0!==s?s:null,href:e.href,lang:this.lang,ns:this.ns,html:a})})),this.manual?this.in({idle:"paused"})?a(E||(E=S` <vaadin-button theme="small contrast" @click="${0}"> <foxy-i18n lang="${0}" key="load_more" ns="${0}"></foxy-i18n> </vaadin-button> `),(()=>this.__service.send("RESUME")),this.lang,this.ns):"":a(k||(k=S` <span></span> `)))}updated(e){super.updated(e),this.dispatchEvent(new d.UpdateEvent)}disconnectedCallback(){var e;super.disconnectedCallback(),this.removeEventListener("fetch",this.__fetchEventHandler),this.__service.stop(),null===(e=this.__stopTrackingRumour)||void 0===e||e.call(this)}__trackRumour(){this.__stopTrackingRumour=d.Rumour(this.group).track((e=>{try{0===this.pages.length?e({_links:{self:{href:this.first}}}):this.pages.map((t=>e(t)))}catch(e){if(!(e instanceof r.UpdateError))throw e;this.__service.send({type:"SET_FIRST",data:this.first})}}))}__createService(){this.__service.onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}__handleFetchEvent(e){if(!(e instanceof o)||e.target===this)return;const{method:t,url:s}=e.request;return"GET"===t?"foxy://collection-pages/stall"===s?this.__stallRequest(e):"foxy://collection-pages/fail"===s?this.__failRequest(e):void this.__respondIfPossible(e):void 0}__respondIfPossible(e){const t=l(e.request.url,this.pages);t.ok&&(e.respondWith(Promise.resolve(t)),console.debug(`%c@foxy.io/elements::${this.localName}\n%c200%c GET ${e.request.url}`,"color: gray","background: gray; padding: 0 .2em; border-radius: .2em; color: white;",""))}__stallRequest(e){e.stopImmediatePropagation(),e.respondWith(new Promise((()=>{})))}__failRequest(e){var t;const s=null===(t=this.__service.state)||void 0===t?void 0:t.context.error,r=null!=s?s:new Response("Unknown error, details unavailable.",{status:500});e.stopImmediatePropagation(),e.respondWith(Promise.resolve(r))}}customElements.define("foxy-collection-pages",R);export{R as CollectionPages};
@@ -1 +1 @@
1
- import"./shared-9b2d6d62.js";import"./shared-56bf05ef.js";import"./shared-90a47948.js";import"./shared-37efab30.js";import{_ as t}from"./shared-0f6e4584.js";import{c as o,h as e,L as i}from"./shared-dc73b9a5.js";import{C as s}from"./shared-0b01f721.js";import{I as r}from"./shared-f7a1193f.js";import{a}from"./shared-fb34e84c.js";import"./shared-44ce656d.js";import"./shared-09b4185a.js";import"./shared-b08ca8d0.js";import"./shared-029d623b.js";import"./shared-343d1fd7.js";import"./shared-9803aa7c.js";let n,d,c=t=>t;const p=s(a(r(i),"copy-to-clipboard"));class l extends p{constructor(){super(...arguments),this.icon=null,this.text=null,this.__state="idle"}static get properties(){return t(t({},super.properties),{},{text:{type:String},icon:{type:String},__state:{attribute:!1}})}static get styles(){return o(n||(n=c`button{position:relative;appearance:none;background:0 0;border:none;border-radius:var(--lumo-border-radius-s);color:inherit;font-size:inherit;padding:0;width:1.5em;height:1.5em;display:flex;justify-content:center;align-items:center}button::before{position:absolute;inset:0;content:' ';display:block;background:currentColor;opacity:.08;transition:opacity .15s ease;border-radius:var(--lumo-border-radius-s)}button:focus{outline:0;box-shadow:0 0 0 2px currentColor}button:disabled{opacity:.5;cursor:default}@media (hover:hover){button:not(:disabled):hover{cursor:pointer}button:not(:disabled):hover::before{opacity:.16}}iron-icon{--iron-icon-height:1em;--iron-icon-width:1em}`))}render(){var t;let o="",i="";return"busy"===this.__state?(o="copying",i="icons:hourglass-empty"):"fail"===this.__state?(o="failed_to_copy",i="icons:error-outline"):"done"===this.__state?(o="done",i="icons:done"):(o="click_to_copy",i=null!==(t=this.icon)&&void 0!==t?t:"icons:content-copy"),e(d||(d=c` <button id="trigger" ?disabled="${0}" @click="${0}"> <iron-icon icon="${0}"></iron-icon> </button> <vcf-tooltip for="trigger" position="bottom"> <span class="text-s"><foxy-i18n infer="" class="text-s" key="${0}"></foxy-i18n></span> </vcf-tooltip> `),this.disabled,(()=>{var t;"idle"===this.__state&&(this.__state="busy",navigator.clipboard.writeText(null!==(t=this.text)&&void 0!==t?t:"").then((()=>this.__state="done")).catch((()=>this.__state="fail")).then((()=>setTimeout((()=>this.__state="idle"),2e3))))}),i,o)}}customElements.define("foxy-copy-to-clipboard",l);export{l as CopyToClipboard};
1
+ import"./shared-11694c05.js";import"./shared-4903b2e3.js";import"./shared-5513e830.js";import"./shared-acd33590.js";import{_ as t}from"./shared-d1195c27.js";import{c as o,h as e,L as i}from"./shared-dc73b9a5.js";import{C as s}from"./shared-d1cb97c6.js";import{I as r}from"./shared-17a61265.js";import{a}from"./shared-b726120d.js";import"./shared-adcfd50a.js";import"./shared-65479601.js";import"./shared-f998f9c8.js";import"./shared-c4f15ea3.js";import"./shared-343d1fd7.js";import"./shared-9803aa7c.js";let n,d,c=t=>t;const p=s(a(r(i),"copy-to-clipboard"));class l extends p{constructor(){super(...arguments),this.icon=null,this.text=null,this.__state="idle"}static get properties(){return t(t({},super.properties),{},{text:{type:String},icon:{type:String},__state:{attribute:!1}})}static get styles(){return o(n||(n=c`button{position:relative;appearance:none;background:0 0;border:none;border-radius:var(--lumo-border-radius-s);color:inherit;font-size:inherit;padding:0;width:1.5em;height:1.5em;display:flex;justify-content:center;align-items:center}button::before{position:absolute;inset:0;content:' ';display:block;background:currentColor;opacity:.08;transition:opacity .15s ease;border-radius:var(--lumo-border-radius-s)}button:focus{outline:0;box-shadow:0 0 0 2px currentColor}button:disabled{opacity:.5;cursor:default}@media (hover:hover){button:not(:disabled):hover{cursor:pointer}button:not(:disabled):hover::before{opacity:.16}}iron-icon{--iron-icon-height:1em;--iron-icon-width:1em}`))}render(){var t;let o="",i="";return"busy"===this.__state?(o="copying",i="icons:hourglass-empty"):"fail"===this.__state?(o="failed_to_copy",i="icons:error-outline"):"done"===this.__state?(o="done",i="icons:done"):(o="click_to_copy",i=null!==(t=this.icon)&&void 0!==t?t:"icons:content-copy"),e(d||(d=c` <button id="trigger" ?disabled="${0}" @click="${0}"> <iron-icon icon="${0}"></iron-icon> </button> <vcf-tooltip for="trigger" position="bottom"> <span class="text-s"><foxy-i18n infer="" class="text-s" key="${0}"></foxy-i18n></span> </vcf-tooltip> `),this.disabled,(()=>{var t;"idle"===this.__state&&(this.__state="busy",navigator.clipboard.writeText(null!==(t=this.text)&&void 0!==t?t:"").then((()=>this.__state="done")).catch((()=>this.__state="fail")).then((()=>setTimeout((()=>this.__state="idle"),2e3))))}),i,o)}}customElements.define("foxy-copy-to-clipboard",l);export{l as CopyToClipboard};
@@ -1 +1 @@
1
- import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-37efab30.js";import{h as t}from"./shared-dc73b9a5.js";import{C as e}from"./shared-0b01f721.js";import{N as s}from"./shared-24d71d01.js";import{T as i,a}from"./shared-fb34e84c.js";import{c as r}from"./shared-4e709717.js";import"./shared-90a47948.js";import"./shared-44ce656d.js";import"./shared-56bf05ef.js";import"./shared-0f6e4584.js";import"./shared-f7a1193f.js";import"./shared-343d1fd7.js";import"./shared-9803aa7c.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";let n,d,o,l,c,p,h,m=t=>t;const u=i(e(a(s,"coupon-card")));class f extends u{render(){var e,s;const i=this.hiddenSelector;return t(n||(n=m` <div aria-busy="${0}" aria-live="polite" class="relative leading-m font-lumo text-m"> <div class="${0}"> ${0} ${0} ${0} </div> <div class="${0}"> <foxy-spinner data-testid="spinner" state="${0}" class="m-auto" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.in("busy"),r({"transition-opacity":!0,"opacity-0":!this.data}),i.matches("title",!0)?"":this.__renderTitle(),i.matches("description",!0)?"":this.__renderDescription(),i.matches("status",!0)?"":this.__renderStatus(),r({"pointer-events-none absolute inset-0 flex transition-opacity":!0,"opacity-0":!!this.data}),this.in("fail")?"error":this.in({idle:"template"})?"empty":"busy",this.lang,this.ns,null!==(s=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==s?s:"")}__renderTitle(){var e,s,i,a,r,n;const l=null!==(s=null===(e=this.data)||void 0===e?void 0:e.number_of_uses_to_date)&&void 0!==s?s:0,c=null!==(a=null===(i=this.data)||void 0===i?void 0:i.number_of_uses_allowed)&&void 0!==a?a:0;return t(d||(d=m` <div data-testid="title"> ${0} <div class="flex items-center justify-between"> <div class="font-medium truncate">${0}</div> <foxy-i18n options="${0}" class="text-tertiary text-s flex-shrink-0" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> </div> ${0} </div> `),this.renderTemplateOrSlot("title:before"),null!==(n=null===(r=this.data)||void 0===r?void 0:r.name)&&void 0!==n?n:t(o||(o=m`&ZeroWidthSpace;`)),JSON.stringify({count:l,total:c}),this.lang,0===c?"uses_count":"uses_to_total_count",this.ns,this.renderTemplateOrSlot("title:after"))}__renderDescription(){let e=null;if(this.data){const s=this.data.coupon_discount_details,i=this.data.coupon_discount_type,a=this.ns;e=t(l||(l=m` <foxy-i18n options="${0}" lang="${0}" key="discount_summary" ns="${0}"> </foxy-i18n> `),JSON.stringify({params:{details:s,type:i,ns:a}}),this.lang,this.ns)}return t(c||(c=m` <div data-testid="description"> ${0} <div class="truncate text-s text-secondary">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("description:before"),null!=e?e:t(p||(p=m`&ZeroWidthSpace;`)),this.renderTemplateOrSlot("description:after"))}__renderStatus(){var e;const{start_date:s,end_date:i}=null!==(e=this.data)&&void 0!==e?e:{},a=s&&i?"complete":s?"from":i?"until":"any";return t(h||(h=m` <div data-testid="status"> ${0} <foxy-i18n options="${0}" class="block truncate text-s text-tertiary" lang="${0}" key="date_range_${0}" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("status:before"),JSON.stringify({start:s,end:i}),this.lang,a,this.ns,this.renderTemplateOrSlot("status:after"))}}customElements.define("foxy-coupon-card",f);export{f as CouponCard};
1
+ import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-acd33590.js";import{h as t}from"./shared-dc73b9a5.js";import{C as s}from"./shared-d1cb97c6.js";import{N as e}from"./shared-2ad18636.js";import{T as i,a}from"./shared-b726120d.js";import{c as r}from"./shared-4e709717.js";import"./shared-5513e830.js";import"./shared-adcfd50a.js";import"./shared-4903b2e3.js";import"./shared-d1195c27.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-9803aa7c.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";let d,n,o,l,c,p,h,m=t=>t;const u=i(s(a(e,"coupon-card")));class f extends u{render(){var s,e;const i=this.hiddenSelector;return t(d||(d=m` <div aria-busy="${0}" aria-live="polite" class="relative leading-m font-lumo text-m"> <div class="${0}"> ${0} ${0} ${0} </div> <div class="${0}"> <foxy-spinner data-testid="spinner" state="${0}" class="m-auto" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.in("busy"),r({"transition-opacity":!0,"opacity-0":!this.data}),i.matches("title",!0)?"":this.__renderTitle(),i.matches("description",!0)?"":this.__renderDescription(),i.matches("status",!0)?"":this.__renderStatus(),r({"pointer-events-none absolute inset-0 flex transition-opacity":!0,"opacity-0":!!this.data}),this.in("fail")?"error":this.in({idle:"template"})?"empty":"busy",this.lang,this.ns,null!==(e=null===(s=customElements.get("foxy-spinner"))||void 0===s?void 0:s.defaultNS)&&void 0!==e?e:"")}__renderTitle(){var s,e,i,a,r,d;const l=null!==(e=null===(s=this.data)||void 0===s?void 0:s.number_of_uses_to_date)&&void 0!==e?e:0,c=null!==(a=null===(i=this.data)||void 0===i?void 0:i.number_of_uses_allowed)&&void 0!==a?a:0;return t(n||(n=m` <div data-testid="title"> ${0} <div class="flex items-center justify-between"> <div class="font-medium truncate">${0}</div> <foxy-i18n options="${0}" class="text-tertiary text-s flex-shrink-0" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> </div> ${0} </div> `),this.renderTemplateOrSlot("title:before"),null!==(d=null===(r=this.data)||void 0===r?void 0:r.name)&&void 0!==d?d:t(o||(o=m`&ZeroWidthSpace;`)),JSON.stringify({count:l,total:c}),this.lang,0===c?"uses_count":"uses_to_total_count",this.ns,this.renderTemplateOrSlot("title:after"))}__renderDescription(){let s=null;if(this.data){const e=this.data.coupon_discount_details,i=this.data.coupon_discount_type,a=this.ns;s=t(l||(l=m` <foxy-i18n options="${0}" lang="${0}" key="discount_summary" ns="${0}"> </foxy-i18n> `),JSON.stringify({params:{details:e,type:i,ns:a}}),this.lang,this.ns)}return t(c||(c=m` <div data-testid="description"> ${0} <div class="truncate text-s text-secondary">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("description:before"),null!=s?s:t(p||(p=m`&ZeroWidthSpace;`)),this.renderTemplateOrSlot("description:after"))}__renderStatus(){var s;const{start_date:e,end_date:i}=null!==(s=this.data)&&void 0!==s?s:{},a=e&&i?"complete":e?"from":i?"until":"any";return t(h||(h=m` <div data-testid="status"> ${0} <foxy-i18n options="${0}" class="block truncate text-s text-tertiary" lang="${0}" key="date_range_${0}" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("status:before"),JSON.stringify({start:e,end:i}),this.lang,a,this.ns,this.renderTemplateOrSlot("status:after"))}}customElements.define("foxy-coupon-card",f);export{f as CouponCard};
@@ -1 +1 @@
1
- import"./shared-3ee151ce.js";import"./shared-37efab30.js";import{a as s}from"./shared-fb34e84c.js";import{I as e}from"./shared-f3773d62.js";import{h as t}from"./shared-dc73b9a5.js";import"./foxy-spinner.js";import"./shared-90a47948.js";import"./shared-44ce656d.js";import"./shared-56bf05ef.js";import"./shared-0f6e4584.js";import"./shared-f7a1193f.js";import"./shared-343d1fd7.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-4e709717.js";let r,o=s=>s;const a=s(e,"coupon-code-card");class i extends a{renderBody(){var s;return t(r||(r=o` <section class="h-s flex flex-col justify-center leading-xs"> <p class="flex items-center justify-between min-w-0"> <foxy-i18n infer="" class="block truncate text-m font-medium" key="line_1" .options="${0}"> </foxy-i18n> <foxy-i18n infer="" class="text-s text-tertiary" key="uses_count" .options="${0}"> </foxy-i18n> </p> <p class="text-s text-secondary min-w-0"> <foxy-i18n infer="" class="block truncate" key="line_2" .options="${0}"> </foxy-i18n> </p> </section> `),this.data,{count:null===(s=this.data)||void 0===s?void 0:s.number_of_uses_to_date},this.data)}}customElements.define("foxy-coupon-code-card",i);export{i as CouponCodeCard};
1
+ import"./shared-5e09e162.js";import"./shared-acd33590.js";import{a as s}from"./shared-b726120d.js";import{I as e}from"./shared-19df2a73.js";import{h as t}from"./shared-dc73b9a5.js";import"./foxy-spinner.js";import"./shared-5513e830.js";import"./shared-adcfd50a.js";import"./shared-4903b2e3.js";import"./shared-d1195c27.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-2ad18636.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-4e709717.js";let r,o=s=>s;const a=s(e,"coupon-code-card");class i extends a{renderBody(){var s;return t(r||(r=o` <section class="h-s flex flex-col justify-center leading-xs"> <p class="flex items-center justify-between min-w-0"> <foxy-i18n infer="" class="block truncate text-m font-medium" key="line_1" .options="${0}"> </foxy-i18n> <foxy-i18n infer="" class="text-s text-tertiary" key="uses_count" .options="${0}"> </foxy-i18n> </p> <p class="text-s text-secondary min-w-0"> <foxy-i18n infer="" class="block truncate" key="line_2" .options="${0}"> </foxy-i18n> </p> </section> `),this.data,{count:null===(s=this.data)||void 0===s?void 0:s.number_of_uses_to_date},this.data)}}customElements.define("foxy-coupon-code-card",i);export{i as CouponCodeCard};
@@ -1 +1 @@
1
- import"./shared-388e9240.js";import"./shared-08e0a194.js";import{I as r}from"./shared-0e055562.js";import"./foxy-transaction-card.js";import{_ as e,B as s}from"./shared-0f6e4584.js";import{a as o}from"./shared-fb34e84c.js";import{i as t}from"./shared-9803aa7c.js";import{h as a}from"./shared-dc73b9a5.js";import"./shared-b08ca8d0.js";import"./shared-44ce656d.js";import"./shared-90a47948.js";import"./shared-09b4185a.js";import"./shared-61b6ef6e.js";import"./shared-61ade33e.js";import"./shared-280f868d.js";import"./shared-c2776a33.js";import"./shared-e24da82e.js";import"./shared-6e859df6.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-56bf05ef.js";import"./shared-37efab30.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-6918312e.js";import"./shared-fc1dfa64.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-7d38cb8a.js";import"./shared-51c4a6dd.js";import"./shared-b8198665.js";import"./shared-a207423c.js";import"./shared-4b346553.js";import"./shared-8f3398dc.js";import"./shared-22ba9566.js";import"./foxy-copy-to-clipboard.js";import"./shared-9b2d6d62.js";import"./shared-029d623b.js";import"./shared-bab2ea2c.js";import"./shared-3ee151ce.js";import"./shared-f3773d62.js";let i,d=r=>r;const n=o(r,"coupon-code-form");class p extends n{constructor(){super(...arguments),this.getTransactionPageHref=null}static get properties(){return e(e({},super.properties),{},{getTransactionPageHref:{attribute:!1}})}static get v8n(){return[({code:r})=>!!r||"code:v8n_required",({code:r})=>!r||r.length<=50||"code:v8n_too_long",({code:r})=>!(null==r?void 0:r.includes(" "))||"code:v8n_has_spaces"]}get hiddenSelector(){const r=[super.hiddenSelector.toString()];return this.href||r.unshift("transactions"),new s(r.join(" ").trim())}renderBody(){var r,e;let s;try{const o=new URL(null!==(e=null===(r=this.data)||void 0===r?void 0:r._links["fx:coupon_code_transactions"].href)&&void 0!==e?e:"");o.searchParams.set("zoom","items"),s=o.toString()}catch(r){s=void 0}return a(i||(i=d` ${0} <foxy-internal-text-control infer="code"></foxy-internal-text-control> <foxy-internal-async-list-control first="${0}" infer="transactions" limit="5" item="foxy-transaction-card" .getPageHref="${0}" hide-delete-button> </foxy-internal-async-list-control> ${0} `),this.renderHeader(),t(s),this.getTransactionPageHref,super.renderBody())}}customElements.define("foxy-coupon-code-form",p);export{p as CouponCodeForm};
1
+ import"./shared-aaf72aad.js";import"./shared-5c35d93a.js";import{I as r}from"./shared-bc023a29.js";import"./foxy-transaction-card.js";import{_ as e,B as s}from"./shared-d1195c27.js";import{a as o}from"./shared-b726120d.js";import{i as t}from"./shared-9803aa7c.js";import{h as a}from"./shared-dc73b9a5.js";import"./shared-f998f9c8.js";import"./shared-adcfd50a.js";import"./shared-5513e830.js";import"./shared-65479601.js";import"./shared-6f0504e2.js";import"./shared-61ade33e.js";import"./shared-40af05b3.js";import"./shared-91d8985f.js";import"./shared-8da3186f.js";import"./shared-239062b0.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-4903b2e3.js";import"./shared-acd33590.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-d1cb97c6.js";import"./shared-2ad18636.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-28ebee50.js";import"./shared-df51ee50.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-f8368b97.js";import"./shared-51c4a6dd.js";import"./shared-8b5e05df.js";import"./shared-7ceceb4c.js";import"./shared-8fc527b7.js";import"./shared-562d466d.js";import"./shared-22ba9566.js";import"./foxy-copy-to-clipboard.js";import"./shared-11694c05.js";import"./shared-c4f15ea3.js";import"./shared-bab2ea2c.js";import"./shared-5e09e162.js";import"./shared-19df2a73.js";let i,d=r=>r;const n=o(r,"coupon-code-form");class c extends n{constructor(){super(...arguments),this.getTransactionPageHref=null}static get properties(){return e(e({},super.properties),{},{getTransactionPageHref:{attribute:!1}})}static get v8n(){return[({code:r})=>!!r||"code:v8n_required",({code:r})=>!r||r.length<=50||"code:v8n_too_long",({code:r})=>!(null==r?void 0:r.includes(" "))||"code:v8n_has_spaces"]}get hiddenSelector(){const r=[super.hiddenSelector.toString()];return this.href||r.unshift("transactions"),new s(r.join(" ").trim())}renderBody(){var r,e;let s;try{const o=new URL(null!==(e=null===(r=this.data)||void 0===r?void 0:r._links["fx:coupon_code_transactions"].href)&&void 0!==e?e:"");o.searchParams.set("zoom","items"),s=o.toString()}catch(r){s=void 0}return a(i||(i=d` ${0} <foxy-internal-text-control infer="code"></foxy-internal-text-control> <foxy-internal-async-list-control first="${0}" infer="transactions" limit="5" item="foxy-transaction-card" .getPageHref="${0}" hide-delete-button> </foxy-internal-async-list-control> ${0} `),this.renderHeader(),t(s),this.getTransactionPageHref,super.renderBody())}}customElements.define("foxy-coupon-code-form",c);export{c as CouponCodeForm};
@@ -1 +1 @@
1
- import"./shared-28f74114.js";import{I as e}from"./shared-0e055562.js";import{a as s}from"./shared-fb34e84c.js";import{B as r}from"./shared-0f6e4584.js";import{h as o}from"./shared-dc73b9a5.js";import"./shared-9b2d6d62.js";import"./shared-44ce656d.js";import"./shared-09b4185a.js";import"./shared-b08ca8d0.js";import"./shared-90a47948.js";import"./shared-029d623b.js";import"./shared-7d38cb8a.js";import"./shared-51c4a6dd.js";import"./shared-37efab30.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-9803aa7c.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-4e709717.js";import"./shared-a0c6a159.js";import"./shared-22ba9566.js";import"./shared-99940888.js";import"./shared-6e859df6.js";import"./shared-61ade33e.js";import"./shared-6918312e.js";import"./shared-fc1dfa64.js";import"./foxy-copy-to-clipboard.js";import"./shared-56bf05ef.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let t,d=e=>e;const a=s(e,"coupon-codes-form");class i extends a{constructor(){super(...arguments),this.__couponCodesGetValue=()=>{var e,s;return null!==(s=null===(e=this.form.coupon_codes)||void 0===e?void 0:e.map((e=>({value:e}))))&&void 0!==s?s:[]},this.__couponCodesSetValue=e=>{this.edit({coupon_codes:e.map((({value:e})=>e.split(" ").map((e=>e.trim())))).flat().filter(((e,s,r)=>r.indexOf(e)===s))})}}static get v8n(){return[({coupon_codes:e})=>e&&e.length>0||"coupon-codes:v8n_required"]}get readonlySelector(){const e=[super.readonlySelector.toString()];return this.href&&e.push("coupon-codes"),new r(e.join(" ").trim())}get hiddenSelector(){const e=["delete timestamps",super.hiddenSelector.toString()];return new r(e.join(" ").trim())}renderBody(){return o(t||(t=d` <foxy-internal-editable-list-control infer="coupon-codes" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> ${0} `),this.__couponCodesGetValue,this.__couponCodesSetValue,super.renderBody())}async _sendPost(e){const s=JSON.stringify(e),r=await this._fetch(this.parent,{body:s,method:"POST"});return this.status={key:"success"},r}}customElements.define("foxy-coupon-codes-form",i);export{i as CouponCodesForm};
1
+ import"./shared-9d309e97.js";import{I as e}from"./shared-bc023a29.js";import{a as s}from"./shared-b726120d.js";import{B as r}from"./shared-d1195c27.js";import{h as o}from"./shared-dc73b9a5.js";import"./shared-11694c05.js";import"./shared-adcfd50a.js";import"./shared-65479601.js";import"./shared-f998f9c8.js";import"./shared-5513e830.js";import"./shared-c4f15ea3.js";import"./shared-f8368b97.js";import"./shared-51c4a6dd.js";import"./shared-acd33590.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-d1cb97c6.js";import"./shared-9803aa7c.js";import"./shared-2ad18636.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-4e709717.js";import"./shared-a0c6a159.js";import"./shared-22ba9566.js";import"./shared-99940888.js";import"./shared-239062b0.js";import"./shared-61ade33e.js";import"./shared-28ebee50.js";import"./shared-df51ee50.js";import"./foxy-copy-to-clipboard.js";import"./shared-4903b2e3.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let t,d=e=>e;const a=s(e,"coupon-codes-form");class i extends a{constructor(){super(...arguments),this.__couponCodesGetValue=()=>{var e,s;return null!==(s=null===(e=this.form.coupon_codes)||void 0===e?void 0:e.map((e=>({value:e}))))&&void 0!==s?s:[]},this.__couponCodesSetValue=e=>{this.edit({coupon_codes:e.map((({value:e})=>e.split(" ").map((e=>e.trim())))).flat().filter(((e,s,r)=>r.indexOf(e)===s))})}}static get v8n(){return[({coupon_codes:e})=>e&&e.length>0||"coupon-codes:v8n_required"]}get readonlySelector(){const e=[super.readonlySelector.toString()];return this.href&&e.push("coupon-codes"),new r(e.join(" ").trim())}get hiddenSelector(){const e=["delete timestamps",super.hiddenSelector.toString()];return new r(e.join(" ").trim())}renderBody(){return o(t||(t=d` <foxy-internal-editable-list-control infer="coupon-codes" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> ${0} `),this.__couponCodesGetValue,this.__couponCodesSetValue,super.renderBody())}async _sendPost(e){const s=JSON.stringify(e),r=await this._fetch(this.parent,{body:s,method:"POST"});return this.status={key:"success"},r}}customElements.define("foxy-coupon-codes-form",i);export{i as CouponCodesForm};
@@ -1 +1 @@
1
- import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-37efab30.js";import{h as r}from"./shared-dc73b9a5.js";import{a as s}from"./shared-fb34e84c.js";import{T as e}from"./shared-fb0ca5e2.js";import"./shared-90a47948.js";import"./shared-44ce656d.js";import"./shared-56bf05ef.js";import"./shared-0f6e4584.js";import"./shared-f7a1193f.js";import"./shared-343d1fd7.js";import"./shared-0b01f721.js";import"./shared-9803aa7c.js";import"./shared-f3773d62.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-4e709717.js";let t,a,i=r=>r;const c=s(e,"coupon-detail-card");class o extends c{constructor(){super(...arguments),this.__currencyDisplay="",this.__currency=""}renderBody(){return super.renderBody({title:s=>r(t||(t=i`${0} &bull; ${0}`),s.name,s.code),subtitle:s=>{let e;try{e=Math.abs(s.amount_per).toLocaleString(this.lang||"en",{maximumFractionDigits:2,minimumFractionDigits:2,currencyDisplay:this.__currencyDisplay,currency:this.__currency,style:"currency"})}catch(r){e="--"}return r(a||(a=i` <span class="${0}">${0}</span> `),s.amount_per>0?"text-success":"text-error",e)}})}async _sendGet(){const r=await super._sendGet(),[s,e]=await Promise.all([super._fetch(r._links["fx:transaction"].href),super._fetch(r._links["fx:store"].href)]);return this.__currency=s.currency_code,this.__currencyDisplay=e.use_international_currency_symbol?"code":"symbol",r}}customElements.define("foxy-coupon-detail-card",o);export{o as CouponDetailCard};
1
+ import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-acd33590.js";import{h as r}from"./shared-dc73b9a5.js";import{a as s}from"./shared-b726120d.js";import{T as e}from"./shared-d3044c4c.js";import"./shared-5513e830.js";import"./shared-adcfd50a.js";import"./shared-4903b2e3.js";import"./shared-d1195c27.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-d1cb97c6.js";import"./shared-9803aa7c.js";import"./shared-19df2a73.js";import"./shared-2ad18636.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-4e709717.js";let t,a,c=r=>r;const i=s(e,"coupon-detail-card");class o extends i{constructor(){super(...arguments),this.__currencyDisplay="",this.__currency=""}renderBody(){return super.renderBody({title:s=>r(t||(t=c`${0} &bull; ${0}`),s.name,s.code),subtitle:s=>{let e;try{e=Math.abs(s.amount_per).toLocaleString(this.lang||"en",{maximumFractionDigits:2,minimumFractionDigits:2,currencyDisplay:this.__currencyDisplay,currency:this.__currency,style:"currency"})}catch(r){e="--"}return r(a||(a=c` <span class="${0}">${0}</span> `),s.amount_per>0?"text-success":"text-error",e)}})}async _sendGet(){const r=await super._sendGet(),[s,e]=await Promise.all([super._fetch(r._links["fx:transaction"].href),super._fetch(r._links["fx:store"].href)]);return this.__currency=s.currency_code,this.__currencyDisplay=e.use_international_currency_symbol?"code":"symbol",r}}customElements.define("foxy-coupon-detail-card",o);export{o as CouponDetailCard};
@@ -1 +1 @@
1
- import"./shared-3c3497d6.js";import"./shared-ce75e928.js";import"./shared-28f74114.js";import{I as t}from"./shared-7d38cb8a.js";import"./foxy-query-builder.js";import{_ as e,B as o}from"./shared-0f6e4584.js";import{O as r,T as s}from"./shared-8874ec69.js";import{c as i}from"./shared-4e709717.js";import{h as n}from"./shared-dc73b9a5.js";import"./shared-8cd578ee.js";import"./shared-937b497c.js";import"./shared-c388e926.js";import"./shared-08e0a194.js";import"./shared-60d586ba.js";import{I as a}from"./shared-0e055562.js";import"./foxy-generate-codes-form.js";import"./foxy-item-category-card.js";import"./foxy-coupon-codes-form.js";import"./foxy-coupon-code-card.js";import"./foxy-coupon-code-form.js";import"./foxy-nucleon-element.js";import"./foxy-attribute-form.js";import"./foxy-attribute-card.js";import"./foxy-copy-to-clipboard.js";import"./foxy-discount-builder.js";import"./shared-37efab30.js";import{R as l,a as c}from"./shared-fb34e84c.js";import{i as d}from"./shared-9803aa7c.js";import"./shared-61b6ef6e.js";import"./shared-b08ca8d0.js";import"./shared-44ce656d.js";import"./shared-09b4185a.js";import"./shared-61ade33e.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-90a47948.js";import"./shared-56bf05ef.js";import"./shared-f7a1193f.js";import"./shared-343d1fd7.js";import"./shared-0b01f721.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-pagination.js";import"./shared-6e859df6.js";import"./foxy-form-dialog.js";import"./shared-6918312e.js";import"./shared-fc1dfa64.js";import"./shared-9b2d6d62.js";import"./shared-029d623b.js";import"./shared-22ba9566.js";import"./shared-51c4a6dd.js";import"./shared-8438d4ca.js";import"./shared-79d0699c.js";import"./shared-d132bd37.js";import"./shared-4b346553.js";import"./shared-8f3398dc.js";import"./shared-b8198665.js";import"./shared-a207423c.js";import"./shared-0700fd80.js";import"./shared-19884cf4.js";import"./shared-c2776a33.js";import"./shared-56a559fd.js";import"./shared-280f868d.js";import"./shared-e24da82e.js";import"./shared-f2968508.js";import"./shared-d8c3067b.js";import"./shared-43e2c3f6.js";import"./shared-bab2ea2c.js";import"./shared-ac0368ec.js";import"./shared-21bc5d5e.js";import"./shared-fb0ca5e2.js";import"./shared-f3773d62.js";import"./shared-3ee151ce.js";import"./shared-388e9240.js";import"./foxy-swipe-actions.js";import"./foxy-transaction-card.js";import"./shared-f407c2cb.js";let u,m,p,f,y,_=t=>t;customElements.define("foxy-internal-query-builder-control",class extends t{constructor(){super(...arguments),this.operators=Object.values(r),this.disableOr=!1,this.layout=null}static get properties(){return e(e({},super.properties),{},{operators:{type:Array},disableOr:{type:Boolean,attribute:"disable-or"},layout:{}})}renderControl(){var t;const{label:e,helperText:o,_errorMessage:r}=this,s=r&&!this.disabled&&!this.readonly,a=null!==(t=this.layout)&&void 0!==t?t:"standalone",l=n(u||(u=_` <foxy-query-builder infer="query-builder" class="${0}" style="${0}" .operators="${0}" .value="${0}" ?disable-or="${0}" @change="${0}"> </foxy-query-builder> `),i({"mt-xs":"summary-item"===a}),"summary-item"===a?"--lumo-border-radius: var(--lumo-border-radius-s)":"",this.operators,this._value,this.disableOr,(t=>{var e;const o=t.currentTarget;this._value=null!==(e=o.value)&&void 0!==e?e:""}));return n(m||(m=_` <section class="${0}"> ${0} ${0} ${0} ${0} ${0} </section> `),i({"grid gap-xs leading-xs transition-colors text-secondary":!0,"hover-text-body":"standalone"===a&&!this.disabled&&!this.readonly,"text-disabled":this.disabled,"text-body":this.readonly}),e?n(p||(p=_` <p class="${0}"> ${0} </p> `),i({"text-s font-medium":"standalone"===a,"text-m text-body":"summary-item"===a,hidden:!e}),e):"","standalone"===a?l:"",o?n(f||(f=_`<p class="text-xs">${0}</p>`),o):"",s?n(y||(y=_`<p class="text-xs text-error">${0}</p>`),r):"","summary-item"===a?l:"")}});let h,x,b,j,v,g=t=>t;customElements.define("foxy-internal-coupon-form-rules-control",class extends t{renderControl(){var t,e;const o=this.nucleon,r=null!==(t=null==o?void 0:o.form.coupon_discount_details)&&void 0!==t?t:"",s=null!==(e=null==o?void 0:o.form.coupon_discount_type)&&void 0!==e?e:"quantity_amount",a=this.helperText,l=this.__renderRulesDescription(),c=this._errorMessage;return n(h||(h=g` <section> <p class="leading-xs flex items-center justify-between space-x-m text-s mb-xs"> <span class="${0}"> ${0} </span> <span class="min-w-0">${0}</span> </p> <foxy-discount-builder infer="discount-builder" .parsedValue="${0}" @change="${0}"> </foxy-discount-builder> ${0} ${0} </section> `),i({"transition-colors font-medium flex-1":!0,"text-secondary":!this.disabled,"text-disabled":this.disabled}),this.label,this.__renderPreset(),{details:r,type:s,name:"Rules"},(t=>{const e=t.currentTarget.parsedValue,o=this.nucleon;null==o||o.edit({coupon_discount_details:e.details,coupon_discount_type:e.type})}),a||l?n(x||(x=g` <p class="${0}"> ${0} </p> `),i({"text-xs mt-xs leading-xs transition-colors":!0,"text-secondary":!this.disabled&&!this.readonly,"text-disabled":this.disabled,"text-body":this.readonly}),l||a):"",!c||this.disabled||this.readonly?"":n(b||(b=g`<p class="mt-xs text-xs leading-xs text-error">${0}</p>`),this._errorMessage))}__renderRulesDescription(){var t,e;const o=this.nucleon,r=null!==(t=null==o?void 0:o.form.coupon_discount_type)&&void 0!==t?t:"quantity_amount",s=null!==(e=null==o?void 0:o.form.coupon_discount_details)&&void 0!==e?e:"";return s?this.t("discount_summary",{params:{details:s,type:r,ns:this.ns}}):null}__renderPreset(){const t=this.nucleon,o=null==t?void 0:t.form.coupon_discount_details,r=null==t?void 0:t.form.coupon_discount_type,s=[{type:"quantity_amount",details:"allunits|2-2"},{type:"quantity_percentage",details:"allunits|5-10|10-20"},{type:"quantity_amount",details:"incremental|3-5"},{type:"quantity_percentage",details:"incremental|11-10|51-15|101-20"},{type:"quantity_percentage",details:"repeat|2-100"},{type:"quantity_percentage",details:"repeat|4-50"},{type:"quantity_amount",details:"single|5-10"},{type:"price_percentage",details:"single|99.99-10"}],a=s.find((t=>t.details===o&&t.type===r));return n(j||(j=g` <label data-testid="rules:preset" class="${0}"> <foxy-i18n class="sr-only" infer="" key="preset"></foxy-i18n> <span class="relative font-medium flex items-center"> <span class="truncate"> ${0} </span> <iron-icon class="icon-inline text-xl ml-xs -mr-xs" icon="icons:expand-more"></iron-icon> <select data-testclass="interactive editable" data-testid="rules:preset:select" class="opacity-0 absolute inset-0 focus-outline-none" ?disabled="${0}" @change="${0}"> ${0} <option value="custom" ?selected="${0}"> ${0} </option> </select> </span> </label> `),i({"whitespace-nowrap block ring-primary-50 rounded px-xs -mx-xs transition-colors":!0,"text-body hover-text-primary focus-within-ring-2":!this.disabled&&!this.readonly,"text-secondary":this.readonly,"text-disabled":this.disabled}),a?this.t("discount_summary",{params:e(e({},a),{},{ns:this.ns})}):this.t("custom_discount"),this.disabled||this.readonly,(t=>{var e,o;const r=t.currentTarget,i=s[r.selectedIndex],n=this.nucleon;null==n||n.edit({coupon_discount_details:null!==(e=null==i?void 0:i.details)&&void 0!==e?e:"",coupon_discount_type:null!==(o=null==i?void 0:i.type)&&void 0!==o?o:"quantity_amount"})}),s.map((t=>n(v||(v=g` <option value="${0}" ?selected="${0}"> ${0} </option> `),t.details,t===a,this.t("discount_summary",{params:e(e({},t),{},{ns:this.ns})})))),!a&&!!o&&!!r,this.t("custom_discount"))}});let $,w,k=t=>t;const q=l(c(a,"coupon-form"));class R extends q{constructor(){var t;super(...arguments),t=this,this.getTransactionPageHref=null,this.__customerSubscriptionRestrictionsGetValue=()=>{var t;const e=null===(t=this.form.customer_subscription_restrictions)||void 0===t?void 0:t.split(",").map((t=>t.trim())).filter(((t,e,o)=>!!t&&o.indexOf(t)===e)).map((t=>({value:t})));return null!=e?e:[]},this.__customerSubscriptionRestrictionsSetValue=t=>{this.edit({customer_subscription_restrictions:t.map((({value:t})=>t.trim())).filter(((t,e,o)=>!!t&&o.indexOf(t)===e)).join()}),this.edit({customer_auto_apply:!!this.form.customer_subscription_restrictions||!!this.form.customer_attribute_restrictions})},this.__productCodeRestrictionsGetValue=()=>{var t;return null===(t=this.form.product_code_restrictions)||void 0===t?void 0:t.split(",").filter((t=>!!t.trim())).map((t=>({value:t,label:t.startsWith("-")?this.t("product-code-restrictions.label_block",{value:t.substring(1)}):this.t("product-code-restrictions.label_allow",{value:t})})))},this.__productCodeRestrictionsSetValue=t=>{this.edit({product_code_restrictions:t.map((({value:t,unit:e})=>"block"===e?`-${t}`:t)).filter(((t,e,o)=>!!t&&o.indexOf(t)===e)).join(",")})},this.__itemOptionRestrictionsOperators=[r.In],this.__itemOptionRestrictionsGetValue=()=>{var t;const e=new URLSearchParams,o=null!==(t=this.form.item_option_restrictions)&&void 0!==t?t:{};for(const t in o)e.set(`${t}:in`,o[t].join(","));return e.toString()},this.__itemOptionRestrictionsSetValue=t=>{const e=Object.fromEntries(Array.from(new URLSearchParams(t).entries()).map((([t,e])=>[t.replace(":in",""),e.split(",").filter((t=>!!t.trim()))])));this.edit({item_option_restrictions:e})},this.__storeLoaderId="storeLoader",this.__codesFilters=[{label:"code",path:"code",type:s.String},{label:"used_codes",path:"number_of_uses_to_date",type:s.Number},{label:"date_created",path:"date_created",type:s.Date},{label:"date_modified",path:"date_modified",type:s.Date}],this.__couponCodesActions=[{theme:"contrast",state:"idle",text:"copy_button_text",onClick:async function(e){t.__couponCodesActions[0].state="busy",t.__couponCodesActions=[...t.__couponCodesActions];try{await navigator.clipboard.writeText(e.code),t.__couponCodesActions[0].state="end"}catch(e){t.__couponCodesActions[0].state="error"}finally{t.__couponCodesActions=[...t.__couponCodesActions],setTimeout((()=>{t.__couponCodesActions[0].state="idle",t.__couponCodesActions=[...t.__couponCodesActions]}),1e3)}}}]}static get properties(){return e(e({},super.properties),{},{getTransactionPageHref:{attribute:!1},__couponCodesActions:{type:Array}})}static get v8n(){return[({name:t})=>!!t||"name:v8n_required",({name:t})=>!t||t.length<=50||"name:v8n_too_long",({inclusive_tax_rate:t})=>!t||t>=0||"inclusive-tax-rate:v8n_too_small",({inclusive_tax_rate:t})=>!t||t<=1||"inclusive-tax-rate:v8n_too_big",({number_of_uses_allowed:t})=>!t||t>=0||"number-of-uses-allowed:v8n_too_small",({coupon_discount_details:t})=>!!t||"rules:v8n_required",({coupon_discount_details:t})=>!t||t.length<=200||"rules:v8n_too_long",({item_option_restrictions:t})=>!t||JSON.stringify(t).length<=6e3||"item-option-restrictions:v8n_too_long",({product_code_restrictions:t})=>!t||t.length<=5e3||"product-code-restrictions:v8n_too_long",({customer_attribute_restrictions:t})=>!t||t.length<=2e3||"customer-attribute-restrictions:v8n_too_long",({number_of_uses_allowed_per_code:t})=>!t||t>=0||"number-of-uses-allowed-per-code:v8n_too_small",({customer_subscription_restrictions:t})=>!t||t.length<=200||"customer-subscription-restrictions:v8n_too_long",({number_of_uses_allowed_per_customer:t})=>!t||t>=0||"number-of-uses-allowed-per-customer:v8n_too_small"]}get hiddenSelector(){const t=[super.hiddenSelector.toString()];return this.data||t.push("coupon-codes","category-restrictions","attributes"),new o(t.join(" ").trim())}get headerSubtitleOptions(){return e(e({},super.headerSubtitleOptions),{},{id:this.headerCopyIdValue})}renderHeaderActions(t){return n($||($=k` <foxy-internal-bulk-add-action-control parent="${0}" infer="generate" form="foxy-generate-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> <foxy-internal-bulk-add-action-control parent="${0}" infer="import" form="foxy-coupon-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> ${0} `),t._links["fx:generate_codes"].href,[t._links["fx:coupon_codes"].href],t._links["fx:coupon_codes"].href,[t._links["fx:coupon_codes"].href],super.renderHeaderActions(t))}renderBody(){var t,e,o,r,s,i,a,l;let c;try{const o=new URL(null!==(e=null===(t=this.data)||void 0===t?void 0:t._links["fx:coupon_codes"].href)&&void 0!==e?e:"");o.searchParams.set("order","date_created desc"),c=o.toString()}catch(t){c=void 0}return n(w||(w=k` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="name"></foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-coupon-form-rules-control infer="rules"> </foxy-internal-coupon-form-rules-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="coupon-codes" item="foxy-coupon-code-card" form="foxy-coupon-code-form" alert .formProps="${0}" .actions="${0}" .filters="${0}"> </foxy-internal-async-list-control> <foxy-internal-editable-list-control infer="product-code-restrictions" .getValue="${0}" .setValue="${0}" .units="${0}"> </foxy-internal-editable-list-control> <foxy-internal-query-builder-control infer="item-option-restrictions" disable-or .operators="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-query-builder-control> <foxy-internal-summary-control infer="customer-restrictions"> <foxy-internal-query-builder-control layout="summary-item" infer="customer-attribute-restrictions"> </foxy-internal-query-builder-control> <foxy-internal-editable-list-control layout="summary-item" infer="customer-subscription-restrictions" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-switch-control infer="customer-auto-apply"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-async-resource-link-list-control foreign-key-for-uri="item_category_uri" foreign-key-for-id="item_category_id" own-key-for-uri="coupon_uri" own-uri="${0}" embed-key="fx:coupon_item_categories" options-href="${0}" links-href="${0}" infer="category-restrictions" limit="5" item="foxy-item-category-card"> </foxy-internal-async-resource-link-list-control> <foxy-internal-summary-control infer="uses"> <foxy-internal-number-control layout="summary-item" infer="number-of-uses-allowed" step="1" min="0"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" infer="number-of-uses-allowed-per-customer" step="1" min="0"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" infer="number-of-uses-allowed-per-code" step="1" min="0"> </foxy-internal-number-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="timeframe"> <foxy-internal-date-control layout="summary-item" infer="start-date"> </foxy-internal-date-control> <foxy-internal-date-control layout="summary-item" infer="end-date"> </foxy-internal-date-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="taxes"> <foxy-internal-number-control layout="summary-item" infer="inclusive-tax-rate" min="0" max="1"> </foxy-internal-number-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="options"> <foxy-internal-switch-control infer="multiple-codes-allowed"></foxy-internal-switch-control> <foxy-internal-switch-control infer="combinable"></foxy-internal-switch-control> <foxy-internal-switch-control infer="exclude-category-discounts"> </foxy-internal-switch-control> <foxy-internal-switch-control infer="exclude-line-item-discounts"> </foxy-internal-switch-control> <foxy-internal-switch-control infer="is-taxable"></foxy-internal-switch-control> <foxy-internal-switch-control infer="shared-codes-allowed"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="attributes" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> ${0} <foxy-nucleon infer="" class="hidden" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),c,{".getTransactionPageHref":this.getTransactionPageHref},this.__couponCodesActions,this.__codesFilters,this.__productCodeRestrictionsGetValue,this.__productCodeRestrictionsSetValue,[{label:this.t("product-code-restrictions.unit_allow"),value:"allow"},{label:this.t("product-code-restrictions.unit_block"),value:"block"}],this.__itemOptionRestrictionsOperators,this.__itemOptionRestrictionsGetValue,this.__itemOptionRestrictionsSetValue,this.__customerSubscriptionRestrictionsGetValue,this.__customerSubscriptionRestrictionsSetValue,d(null===(o=this.data)||void 0===o?void 0:o._links.self.href),d(null===(s=null===(r=this.__storeLoader)||void 0===r?void 0:r.data)||void 0===s?void 0:s._links["fx:item_categories"].href),d(null===(i=this.data)||void 0===i?void 0:i._links["fx:coupon_item_categories"].href),d(null===(a=this.data)||void 0===a?void 0:a._links["fx:attributes"].href),super.renderBody(),d(null===(l=this.data)||void 0===l?void 0:l._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-coupon-form",R);export{R as CouponForm};
1
+ import"./shared-2bc0d0cd.js";import"./shared-86a9b27a.js";import"./shared-9d309e97.js";import{I as t}from"./shared-f8368b97.js";import"./foxy-query-builder.js";import{_ as e,B as o}from"./shared-d1195c27.js";import{O as r,T as s}from"./shared-8874ec69.js";import{c as i}from"./shared-4e709717.js";import{h as n}from"./shared-dc73b9a5.js";import"./shared-374e6faa.js";import"./shared-745f340a.js";import"./shared-8a73d1aa.js";import"./shared-5c35d93a.js";import"./shared-c9346893.js";import{I as a}from"./shared-bc023a29.js";import"./foxy-generate-codes-form.js";import"./foxy-item-category-card.js";import"./foxy-coupon-codes-form.js";import"./foxy-coupon-code-card.js";import"./foxy-coupon-code-form.js";import"./foxy-nucleon-element.js";import"./foxy-attribute-form.js";import"./foxy-attribute-card.js";import"./foxy-copy-to-clipboard.js";import"./foxy-discount-builder.js";import"./shared-acd33590.js";import{R as l,a as c}from"./shared-b726120d.js";import{i as d}from"./shared-9803aa7c.js";import"./shared-6f0504e2.js";import"./shared-f998f9c8.js";import"./shared-adcfd50a.js";import"./shared-65479601.js";import"./shared-61ade33e.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-5513e830.js";import"./shared-4903b2e3.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-d1cb97c6.js";import"./shared-2ad18636.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-pagination.js";import"./shared-239062b0.js";import"./foxy-form-dialog.js";import"./shared-28ebee50.js";import"./shared-df51ee50.js";import"./shared-11694c05.js";import"./shared-c4f15ea3.js";import"./shared-22ba9566.js";import"./shared-51c4a6dd.js";import"./shared-8438d4ca.js";import"./shared-79d0699c.js";import"./shared-c98881c7.js";import"./shared-8fc527b7.js";import"./shared-562d466d.js";import"./shared-8b5e05df.js";import"./shared-7ceceb4c.js";import"./shared-1a30f25e.js";import"./shared-9a59aab2.js";import"./shared-91d8985f.js";import"./shared-5c846a3b.js";import"./shared-40af05b3.js";import"./shared-8da3186f.js";import"./shared-f893763a.js";import"./shared-97cfdcdb.js";import"./shared-43e2c3f6.js";import"./shared-bab2ea2c.js";import"./shared-2e090291.js";import"./shared-15100be0.js";import"./shared-d3044c4c.js";import"./shared-19df2a73.js";import"./shared-5e09e162.js";import"./shared-aaf72aad.js";import"./foxy-swipe-actions.js";import"./foxy-transaction-card.js";import"./shared-c5647b62.js";let u,m,p,f,y,_=t=>t;customElements.define("foxy-internal-query-builder-control",class extends t{constructor(){super(...arguments),this.operators=Object.values(r),this.disableOr=!1,this.layout=null}static get properties(){return e(e({},super.properties),{},{operators:{type:Array},disableOr:{type:Boolean,attribute:"disable-or"},layout:{}})}renderControl(){var t;const{label:e,helperText:o,_errorMessage:r}=this,s=r&&!this.disabled&&!this.readonly,a=null!==(t=this.layout)&&void 0!==t?t:"standalone",l=n(u||(u=_` <foxy-query-builder infer="query-builder" class="${0}" style="${0}" .operators="${0}" .value="${0}" ?disable-or="${0}" @change="${0}"> </foxy-query-builder> `),i({"mt-xs":"summary-item"===a}),"summary-item"===a?"--lumo-border-radius: var(--lumo-border-radius-s)":"",this.operators,this._value,this.disableOr,(t=>{var e;const o=t.currentTarget;this._value=null!==(e=o.value)&&void 0!==e?e:""}));return n(m||(m=_` <section class="${0}"> ${0} ${0} ${0} ${0} ${0} </section> `),i({"grid gap-xs leading-xs transition-colors text-secondary":!0,"hover-text-body":"standalone"===a&&!this.disabled&&!this.readonly,"text-disabled":this.disabled,"text-body":this.readonly}),e?n(p||(p=_` <p class="${0}"> ${0} </p> `),i({"text-s font-medium":"standalone"===a,"text-m text-body":"summary-item"===a,hidden:!e}),e):"","standalone"===a?l:"",o?n(f||(f=_`<p class="text-xs">${0}</p>`),o):"",s?n(y||(y=_`<p class="text-xs text-error">${0}</p>`),r):"","summary-item"===a?l:"")}});let h,x,b,j,v,g=t=>t;customElements.define("foxy-internal-coupon-form-rules-control",class extends t{renderControl(){var t,e;const o=this.nucleon,r=null!==(t=null==o?void 0:o.form.coupon_discount_details)&&void 0!==t?t:"",s=null!==(e=null==o?void 0:o.form.coupon_discount_type)&&void 0!==e?e:"quantity_amount",a=this.helperText,l=this.__renderRulesDescription(),c=this._errorMessage;return n(h||(h=g` <section> <p class="leading-xs flex items-center justify-between space-x-m text-s mb-xs"> <span class="${0}"> ${0} </span> <span class="min-w-0">${0}</span> </p> <foxy-discount-builder infer="discount-builder" .parsedValue="${0}" @change="${0}"> </foxy-discount-builder> ${0} ${0} </section> `),i({"transition-colors font-medium flex-1":!0,"text-secondary":!this.disabled,"text-disabled":this.disabled}),this.label,this.__renderPreset(),{details:r,type:s,name:"Rules"},(t=>{const e=t.currentTarget.parsedValue,o=this.nucleon;null==o||o.edit({coupon_discount_details:e.details,coupon_discount_type:e.type})}),a||l?n(x||(x=g` <p class="${0}"> ${0} </p> `),i({"text-xs mt-xs leading-xs transition-colors":!0,"text-secondary":!this.disabled&&!this.readonly,"text-disabled":this.disabled,"text-body":this.readonly}),l||a):"",!c||this.disabled||this.readonly?"":n(b||(b=g`<p class="mt-xs text-xs leading-xs text-error">${0}</p>`),this._errorMessage))}__renderRulesDescription(){var t,e;const o=this.nucleon,r=null!==(t=null==o?void 0:o.form.coupon_discount_type)&&void 0!==t?t:"quantity_amount",s=null!==(e=null==o?void 0:o.form.coupon_discount_details)&&void 0!==e?e:"";return s?this.t("discount_summary",{params:{details:s,type:r,ns:this.ns}}):null}__renderPreset(){const t=this.nucleon,o=null==t?void 0:t.form.coupon_discount_details,r=null==t?void 0:t.form.coupon_discount_type,s=[{type:"quantity_amount",details:"allunits|2-2"},{type:"quantity_percentage",details:"allunits|5-10|10-20"},{type:"quantity_amount",details:"incremental|3-5"},{type:"quantity_percentage",details:"incremental|11-10|51-15|101-20"},{type:"quantity_percentage",details:"repeat|2-100"},{type:"quantity_percentage",details:"repeat|4-50"},{type:"quantity_amount",details:"single|5-10"},{type:"price_percentage",details:"single|99.99-10"}],a=s.find((t=>t.details===o&&t.type===r));return n(j||(j=g` <label data-testid="rules:preset" class="${0}"> <foxy-i18n class="sr-only" infer="" key="preset"></foxy-i18n> <span class="relative font-medium flex items-center"> <span class="truncate"> ${0} </span> <iron-icon class="icon-inline text-xl ml-xs -mr-xs" icon="icons:expand-more"></iron-icon> <select data-testclass="interactive editable" data-testid="rules:preset:select" class="opacity-0 absolute inset-0 focus-outline-none" ?disabled="${0}" @change="${0}"> ${0} <option value="custom" ?selected="${0}"> ${0} </option> </select> </span> </label> `),i({"whitespace-nowrap block ring-primary-50 rounded px-xs -mx-xs transition-colors":!0,"text-body hover-text-primary focus-within-ring-2":!this.disabled&&!this.readonly,"text-secondary":this.readonly,"text-disabled":this.disabled}),a?this.t("discount_summary",{params:e(e({},a),{},{ns:this.ns})}):this.t("custom_discount"),this.disabled||this.readonly,(t=>{var e,o;const r=t.currentTarget,i=s[r.selectedIndex],n=this.nucleon;null==n||n.edit({coupon_discount_details:null!==(e=null==i?void 0:i.details)&&void 0!==e?e:"",coupon_discount_type:null!==(o=null==i?void 0:i.type)&&void 0!==o?o:"quantity_amount"})}),s.map((t=>n(v||(v=g` <option value="${0}" ?selected="${0}"> ${0} </option> `),t.details,t===a,this.t("discount_summary",{params:e(e({},t),{},{ns:this.ns})})))),!a&&!!o&&!!r,this.t("custom_discount"))}});let $,w,k=t=>t;const q=l(c(a,"coupon-form"));class R extends q{constructor(){var t;super(...arguments),t=this,this.getTransactionPageHref=null,this.__customerSubscriptionRestrictionsGetValue=()=>{var t;const e=null===(t=this.form.customer_subscription_restrictions)||void 0===t?void 0:t.split(",").map((t=>t.trim())).filter(((t,e,o)=>!!t&&o.indexOf(t)===e)).map((t=>({value:t})));return null!=e?e:[]},this.__customerSubscriptionRestrictionsSetValue=t=>{this.edit({customer_subscription_restrictions:t.map((({value:t})=>t.trim())).filter(((t,e,o)=>!!t&&o.indexOf(t)===e)).join()}),this.edit({customer_auto_apply:!!this.form.customer_subscription_restrictions||!!this.form.customer_attribute_restrictions})},this.__productCodeRestrictionsGetValue=()=>{var t;return null===(t=this.form.product_code_restrictions)||void 0===t?void 0:t.split(",").filter((t=>!!t.trim())).map((t=>({value:t,label:t.startsWith("-")?this.t("product-code-restrictions.label_block",{value:t.substring(1)}):this.t("product-code-restrictions.label_allow",{value:t})})))},this.__productCodeRestrictionsSetValue=t=>{this.edit({product_code_restrictions:t.map((({value:t,unit:e})=>"block"===e?`-${t}`:t)).filter(((t,e,o)=>!!t&&o.indexOf(t)===e)).join(",")})},this.__itemOptionRestrictionsOperators=[r.In],this.__itemOptionRestrictionsGetValue=()=>{var t;const e=new URLSearchParams,o=null!==(t=this.form.item_option_restrictions)&&void 0!==t?t:{};for(const t in o)e.set(`${t}:in`,o[t].join(","));return e.toString()},this.__itemOptionRestrictionsSetValue=t=>{const e=Object.fromEntries(Array.from(new URLSearchParams(t).entries()).map((([t,e])=>[t.replace(":in",""),e.split(",").filter((t=>!!t.trim()))])));this.edit({item_option_restrictions:e})},this.__storeLoaderId="storeLoader",this.__codesFilters=[{label:"code",path:"code",type:s.String},{label:"used_codes",path:"number_of_uses_to_date",type:s.Number},{label:"date_created",path:"date_created",type:s.Date},{label:"date_modified",path:"date_modified",type:s.Date}],this.__couponCodesActions=[{theme:"contrast",state:"idle",text:"copy_button_text",onClick:async function(e){t.__couponCodesActions[0].state="busy",t.__couponCodesActions=[...t.__couponCodesActions];try{await navigator.clipboard.writeText(e.code),t.__couponCodesActions[0].state="end"}catch(e){t.__couponCodesActions[0].state="error"}finally{t.__couponCodesActions=[...t.__couponCodesActions],setTimeout((()=>{t.__couponCodesActions[0].state="idle",t.__couponCodesActions=[...t.__couponCodesActions]}),1e3)}}}]}static get properties(){return e(e({},super.properties),{},{getTransactionPageHref:{attribute:!1},__couponCodesActions:{type:Array}})}static get v8n(){return[({name:t})=>!!t||"name:v8n_required",({name:t})=>!t||t.length<=50||"name:v8n_too_long",({inclusive_tax_rate:t})=>!t||t>=0||"inclusive-tax-rate:v8n_too_small",({inclusive_tax_rate:t})=>!t||t<=1||"inclusive-tax-rate:v8n_too_big",({number_of_uses_allowed:t})=>!t||t>=0||"number-of-uses-allowed:v8n_too_small",({coupon_discount_details:t})=>!!t||"rules:v8n_required",({coupon_discount_details:t})=>!t||t.length<=200||"rules:v8n_too_long",({item_option_restrictions:t})=>!t||JSON.stringify(t).length<=6e3||"item-option-restrictions:v8n_too_long",({product_code_restrictions:t})=>!t||t.length<=5e3||"product-code-restrictions:v8n_too_long",({customer_attribute_restrictions:t})=>!t||t.length<=2e3||"customer-attribute-restrictions:v8n_too_long",({number_of_uses_allowed_per_code:t})=>!t||t>=0||"number-of-uses-allowed-per-code:v8n_too_small",({customer_subscription_restrictions:t})=>!t||t.length<=200||"customer-subscription-restrictions:v8n_too_long",({number_of_uses_allowed_per_customer:t})=>!t||t>=0||"number-of-uses-allowed-per-customer:v8n_too_small"]}get hiddenSelector(){const t=[super.hiddenSelector.toString()];return this.data||t.push("coupon-codes","category-restrictions","attributes"),new o(t.join(" ").trim())}get headerSubtitleOptions(){return e(e({},super.headerSubtitleOptions),{},{id:this.headerCopyIdValue})}renderHeaderActions(t){return n($||($=k` <foxy-internal-bulk-add-action-control parent="${0}" infer="generate" form="foxy-generate-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> <foxy-internal-bulk-add-action-control parent="${0}" infer="import" form="foxy-coupon-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> ${0} `),t._links["fx:generate_codes"].href,[t._links["fx:coupon_codes"].href],t._links["fx:coupon_codes"].href,[t._links["fx:coupon_codes"].href],super.renderHeaderActions(t))}renderBody(){var t,e,o,r,s,i,a,l;let c;try{const o=new URL(null!==(e=null===(t=this.data)||void 0===t?void 0:t._links["fx:coupon_codes"].href)&&void 0!==e?e:"");o.searchParams.set("order","date_created desc"),c=o.toString()}catch(t){c=void 0}return n(w||(w=k` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="name"></foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-coupon-form-rules-control infer="rules"> </foxy-internal-coupon-form-rules-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="coupon-codes" item="foxy-coupon-code-card" form="foxy-coupon-code-form" alert .formProps="${0}" .actions="${0}" .filters="${0}"> </foxy-internal-async-list-control> <foxy-internal-editable-list-control infer="product-code-restrictions" .getValue="${0}" .setValue="${0}" .units="${0}"> </foxy-internal-editable-list-control> <foxy-internal-query-builder-control infer="item-option-restrictions" disable-or .operators="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-query-builder-control> <foxy-internal-summary-control infer="customer-restrictions"> <foxy-internal-query-builder-control layout="summary-item" infer="customer-attribute-restrictions"> </foxy-internal-query-builder-control> <foxy-internal-editable-list-control layout="summary-item" infer="customer-subscription-restrictions" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-switch-control infer="customer-auto-apply"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-async-resource-link-list-control foreign-key-for-uri="item_category_uri" foreign-key-for-id="item_category_id" own-key-for-uri="coupon_uri" own-uri="${0}" embed-key="fx:coupon_item_categories" options-href="${0}" links-href="${0}" infer="category-restrictions" limit="5" item="foxy-item-category-card"> </foxy-internal-async-resource-link-list-control> <foxy-internal-summary-control infer="uses"> <foxy-internal-number-control layout="summary-item" infer="number-of-uses-allowed" step="1" min="0"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" infer="number-of-uses-allowed-per-customer" step="1" min="0"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" infer="number-of-uses-allowed-per-code" step="1" min="0"> </foxy-internal-number-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="timeframe"> <foxy-internal-date-control layout="summary-item" infer="start-date"> </foxy-internal-date-control> <foxy-internal-date-control layout="summary-item" infer="end-date"> </foxy-internal-date-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="taxes"> <foxy-internal-number-control layout="summary-item" infer="inclusive-tax-rate" min="0" max="1"> </foxy-internal-number-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="options"> <foxy-internal-switch-control infer="multiple-codes-allowed"></foxy-internal-switch-control> <foxy-internal-switch-control infer="combinable"></foxy-internal-switch-control> <foxy-internal-switch-control infer="exclude-category-discounts"> </foxy-internal-switch-control> <foxy-internal-switch-control infer="exclude-line-item-discounts"> </foxy-internal-switch-control> <foxy-internal-switch-control infer="is-taxable"></foxy-internal-switch-control> <foxy-internal-switch-control infer="shared-codes-allowed"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="attributes" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> ${0} <foxy-nucleon infer="" class="hidden" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),c,{".getTransactionPageHref":this.getTransactionPageHref},this.__couponCodesActions,this.__codesFilters,this.__productCodeRestrictionsGetValue,this.__productCodeRestrictionsSetValue,[{label:this.t("product-code-restrictions.unit_allow"),value:"allow"},{label:this.t("product-code-restrictions.unit_block"),value:"block"}],this.__itemOptionRestrictionsOperators,this.__itemOptionRestrictionsGetValue,this.__itemOptionRestrictionsSetValue,this.__customerSubscriptionRestrictionsGetValue,this.__customerSubscriptionRestrictionsSetValue,d(null===(o=this.data)||void 0===o?void 0:o._links.self.href),d(null===(s=null===(r=this.__storeLoader)||void 0===r?void 0:r.data)||void 0===s?void 0:s._links["fx:item_categories"].href),d(null===(i=this.data)||void 0===i?void 0:i._links["fx:coupon_item_categories"].href),d(null===(a=this.data)||void 0===a?void 0:a._links["fx:attributes"].href),super.renderBody(),d(null===(l=this.data)||void 0===l?void 0:l._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-coupon-form",R);export{R as CouponForm};
@@ -1 +1 @@
1
- import"./shared-51c4a6dd.js";import"./shared-3ee151ce.js";import{h as r}from"./shared-dc73b9a5.js";import{a as s}from"./shared-fb34e84c.js";import{T as e}from"./shared-fb0ca5e2.js";import"./foxy-spinner.js";import"./shared-90a47948.js";import"./shared-44ce656d.js";import"./shared-56bf05ef.js";import"./shared-37efab30.js";import"./shared-0f6e4584.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-f3773d62.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-4e709717.js";import"./shared-0b01f721.js";import"./shared-9803aa7c.js";let d,a,t=r=>r;class o extends(s(e,"custom-field-card")){renderBody(){return super.renderBody({title:s=>r(d||(d=t`${0}`),s.name),subtitle:s=>r(a||(a=t`${0}`),s.value)})}}customElements.define("foxy-custom-field-card",o);export{o as CustomFieldCard};
1
+ import"./shared-51c4a6dd.js";import"./shared-5e09e162.js";import{h as r}from"./shared-dc73b9a5.js";import{a as s}from"./shared-b726120d.js";import{T as e}from"./shared-d3044c4c.js";import"./foxy-spinner.js";import"./shared-5513e830.js";import"./shared-adcfd50a.js";import"./shared-4903b2e3.js";import"./shared-acd33590.js";import"./shared-d1195c27.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-19df2a73.js";import"./shared-2ad18636.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-4e709717.js";import"./shared-d1cb97c6.js";import"./shared-9803aa7c.js";let d,a,t=r=>r;class o extends(s(e,"custom-field-card")){renderBody(){return super.renderBody({title:s=>r(d||(d=t`${0}`),s.name),subtitle:s=>r(a||(a=t`${0}`),s.value)})}}customElements.define("foxy-custom-field-card",o);export{o as CustomFieldCard};
@@ -1 +1 @@
1
- import"./shared-0cc5420d.js";import"./shared-21bc5d5e.js";import{I as e}from"./shared-0e055562.js";import{a as r}from"./shared-fb34e84c.js";import{h as s}from"./shared-dc73b9a5.js";import"./shared-61b6ef6e.js";import"./shared-b08ca8d0.js";import"./shared-44ce656d.js";import"./shared-09b4185a.js";import"./shared-61ade33e.js";import"./shared-a207423c.js";import"./shared-90a47948.js";import"./shared-7d38cb8a.js";import"./shared-51c4a6dd.js";import"./shared-37efab30.js";import"./shared-0f6e4584.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-9803aa7c.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-a0c6a159.js";import"./shared-6e859df6.js";import"./shared-6918312e.js";import"./shared-fc1dfa64.js";import"./shared-4e709717.js";import"./foxy-copy-to-clipboard.js";import"./shared-9b2d6d62.js";import"./shared-029d623b.js";import"./shared-56bf05ef.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let i,t=e=>e;const o=r(e,"custom-field-form");class a extends o{constructor(){super(...arguments),this.__visibilityGetValue=()=>this.form.is_hidden?["hidden"]:[],this.__visibilitySetValue=e=>{this.edit({is_hidden:e.includes("hidden")})},this.__visibilityOptions=[{label:"option_hidden",value:"hidden"}]}static get v8n(){return[({value:e})=>e&&e.length>0||"value:v8n_required",({value:e})=>!e||e.length<=700||"value:v8n_too_long",({name:e})=>e&&e.length>0||"name:v8n_required",({name:e})=>!e||e.length<=100||"name:v8n_too_long"]}renderBody(){return s(i||(i=t` ${0} <foxy-internal-source-control infer="name"></foxy-internal-source-control> <foxy-internal-source-control infer="value"></foxy-internal-source-control> <foxy-internal-checkbox-group-control infer="visibility" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} `),this.renderHeader(),this.__visibilityGetValue,this.__visibilitySetValue,this.__visibilityOptions,super.renderBody())}}customElements.define("foxy-custom-field-form",a);export{a as CustomFieldForm};
1
+ import"./shared-f67f6fc5.js";import"./shared-15100be0.js";import{I as e}from"./shared-bc023a29.js";import{a as r}from"./shared-b726120d.js";import{h as s}from"./shared-dc73b9a5.js";import"./shared-6f0504e2.js";import"./shared-f998f9c8.js";import"./shared-adcfd50a.js";import"./shared-65479601.js";import"./shared-61ade33e.js";import"./shared-7ceceb4c.js";import"./shared-5513e830.js";import"./shared-f8368b97.js";import"./shared-51c4a6dd.js";import"./shared-acd33590.js";import"./shared-d1195c27.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-d1cb97c6.js";import"./shared-9803aa7c.js";import"./shared-2ad18636.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-a0c6a159.js";import"./shared-239062b0.js";import"./shared-28ebee50.js";import"./shared-df51ee50.js";import"./shared-4e709717.js";import"./foxy-copy-to-clipboard.js";import"./shared-11694c05.js";import"./shared-c4f15ea3.js";import"./shared-4903b2e3.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let i,t=e=>e;const o=r(e,"custom-field-form");class a extends o{constructor(){super(...arguments),this.__visibilityGetValue=()=>this.form.is_hidden?["hidden"]:[],this.__visibilitySetValue=e=>{this.edit({is_hidden:e.includes("hidden")})},this.__visibilityOptions=[{label:"option_hidden",value:"hidden"}]}static get v8n(){return[({value:e})=>e&&e.length>0||"value:v8n_required",({value:e})=>!e||e.length<=700||"value:v8n_too_long",({name:e})=>e&&e.length>0||"name:v8n_required",({name:e})=>!e||e.length<=100||"name:v8n_too_long"]}renderBody(){return s(i||(i=t` ${0} <foxy-internal-source-control infer="name"></foxy-internal-source-control> <foxy-internal-source-control infer="value"></foxy-internal-source-control> <foxy-internal-checkbox-group-control infer="visibility" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} `),this.renderHeader(),this.__visibilityGetValue,this.__visibilitySetValue,this.__visibilityOptions,super.renderBody())}}customElements.define("foxy-custom-field-form",a);export{a as CustomFieldForm};
@@ -1 +1 @@
1
- import{C as s}from"./shared-91f5e0b3.js";export{C as CustomerApi}from"./shared-91f5e0b3.js";import"./shared-0f6e4584.js";import"./shared-dc73b9a5.js";import"./shared-01b2cad8.js";import"./shared-6d645dc5.js";import"./shared-0b01f721.js";import"./shared-9803aa7c.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";customElements.define("foxy-customer-api",s);
1
+ import{C as s}from"./shared-87b5a6aa.js";export{C as CustomerApi}from"./shared-87b5a6aa.js";import"./shared-d1195c27.js";import"./shared-dc73b9a5.js";import"./shared-0e156ee7.js";import"./shared-c2efc54e.js";import"./shared-d1cb97c6.js";import"./shared-9803aa7c.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";customElements.define("foxy-customer-api",s);
@@ -1 +1 @@
1
- import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-37efab30.js";import{h as e}from"./shared-dc73b9a5.js";import{C as t}from"./shared-0b01f721.js";import{N as a}from"./shared-24d71d01.js";import{T as s,a as i}from"./shared-fb34e84c.js";import{c as r}from"./shared-4e709717.js";import"./shared-90a47948.js";import"./shared-44ce656d.js";import"./shared-56bf05ef.js";import"./shared-0f6e4584.js";import"./shared-f7a1193f.js";import"./shared-343d1fd7.js";import"./shared-9803aa7c.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";let d,o,n,l,m,h,p,c=e=>e;const f=s(t(i(a,"customer-card")));class v extends f{render(){var t,a;const s=this.hiddenSelector;return e(d||(d=c` <div aria-busy="${0}" aria-live="polite" class="relative leading-m font-lumo text-m"> <div class="${0}"> ${0} ${0} </div> <div class="${0}"> <foxy-spinner data-testid="spinner" state="${0}" class="m-auto" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.in("busy"),r({"leading-xs transition-opacity":!0,"opacity-0":!this.data}),s.matches("name",!0)?"":this.__renderName(),s.matches("email",!0)?"":this.__renderEmail(),r({"pointer-events-none absolute inset-0 flex transition-opacity":!0,"opacity-0":!!this.data}),this.in("fail")?"error":this.in({idle:"template"})?"empty":"busy",this.lang,this.ns,null!==(a=null===(t=customElements.get("foxy-spinner"))||void 0===t?void 0:t.defaultNS)&&void 0!==a?a:"")}__renderName(){var t,a,s,i,r;const d=this.data,m=`${null!==(t=null==d?void 0:d.first_name)&&void 0!==t?t:""} ${null!==(a=null==d?void 0:d.last_name)&&void 0!==a?a:""}`.trim()||"–",h=d?e(o||(o=c`${0}`),m):e(n||(n=c`&ZeroWidthSpace;`));let p;try{p=null!==(r=new URL(null!==(i=null===(s=this.data)||void 0===s?void 0:s._links.self.href)&&void 0!==i?i:"").pathname.split("/").pop())&&void 0!==r?r:""}catch(e){p=""}return e(l||(l=c` <div data-testid="name"> ${0} <div class="flex items-center gap-m"> <div class="font-medium text-body truncate mr-auto">${0}</div> <div class="text-tertiary text-s">ID ${0}</div> </div> ${0} </div> `),this.renderTemplateOrSlot("name:before"),h,p,this.renderTemplateOrSlot("name:after"))}__renderEmail(){var t;const a=this.data,s=`${null!==(t=null==a?void 0:a.email)&&void 0!==t?t:""}`.trim()||"–",i=a?e(m||(m=c`${0}`),s):e(h||(h=c`&ZeroWidthSpace;`));return e(p||(p=c` <div data-testid="email"> ${0} <div class="text-secondary truncate text-s">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("email:before"),i,this.renderTemplateOrSlot("email:after"))}}customElements.define("foxy-customer-card",v);export{v as CustomerCard};
1
+ import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-acd33590.js";import{h as e}from"./shared-dc73b9a5.js";import{C as t}from"./shared-d1cb97c6.js";import{N as s}from"./shared-2ad18636.js";import{T as a,a as i}from"./shared-b726120d.js";import{c as r}from"./shared-4e709717.js";import"./shared-5513e830.js";import"./shared-adcfd50a.js";import"./shared-4903b2e3.js";import"./shared-d1195c27.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-9803aa7c.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";let d,o,n,l,m,c,h,p=e=>e;const v=a(t(i(s,"customer-card")));class f extends v{render(){var t,s;const a=this.hiddenSelector;return e(d||(d=p` <div aria-busy="${0}" aria-live="polite" class="relative leading-m font-lumo text-m"> <div class="${0}"> ${0} ${0} </div> <div class="${0}"> <foxy-spinner data-testid="spinner" state="${0}" class="m-auto" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.in("busy"),r({"leading-xs transition-opacity":!0,"opacity-0":!this.data}),a.matches("name",!0)?"":this.__renderName(),a.matches("email",!0)?"":this.__renderEmail(),r({"pointer-events-none absolute inset-0 flex transition-opacity":!0,"opacity-0":!!this.data}),this.in("fail")?"error":this.in({idle:"template"})?"empty":"busy",this.lang,this.ns,null!==(s=null===(t=customElements.get("foxy-spinner"))||void 0===t?void 0:t.defaultNS)&&void 0!==s?s:"")}__renderName(){var t,s,a,i,r;const d=this.data,m=`${null!==(t=null==d?void 0:d.first_name)&&void 0!==t?t:""} ${null!==(s=null==d?void 0:d.last_name)&&void 0!==s?s:""}`.trim()||"–",c=d?e(o||(o=p`${0}`),m):e(n||(n=p`&ZeroWidthSpace;`));let h;try{h=null!==(r=new URL(null!==(i=null===(a=this.data)||void 0===a?void 0:a._links.self.href)&&void 0!==i?i:"").pathname.split("/").pop())&&void 0!==r?r:""}catch(e){h=""}return e(l||(l=p` <div data-testid="name"> ${0} <div class="flex items-center gap-m"> <div class="font-medium text-body truncate mr-auto">${0}</div> <div class="text-tertiary text-s">ID ${0}</div> </div> ${0} </div> `),this.renderTemplateOrSlot("name:before"),c,h,this.renderTemplateOrSlot("name:after"))}__renderEmail(){var t;const s=this.data,a=`${null!==(t=null==s?void 0:s.email)&&void 0!==t?t:""}`.trim()||"–",i=s?e(m||(m=p`${0}`),a):e(c||(c=p`&ZeroWidthSpace;`));return e(h||(h=p` <div data-testid="email"> ${0} <div class="text-secondary truncate text-s">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("email:before"),i,this.renderTemplateOrSlot("email:after"))}}customElements.define("foxy-customer-card",f);export{f as CustomerCard};
@@ -1 +1 @@
1
- import"./shared-f407c2cb.js";import"./shared-7c411b0a.js";import"./shared-08e0a194.js";import{I as t}from"./shared-0e055562.js";import{a as e}from"./shared-7d38cb8a.js";import"./shared-37efab30.js";import{i as s}from"./shared-9803aa7c.js";import{h as o}from"./shared-dc73b9a5.js";import{c as r,_ as a,B as i}from"./shared-0f6e4584.js";import{S as n,a as d}from"./shared-fb34e84c.js";import{v as l}from"./shared-b738ee96.js";import{c as h}from"./shared-4e709717.js";import"./shared-b08ca8d0.js";import"./shared-44ce656d.js";import"./shared-09b4185a.js";import"./shared-61ade33e.js";import"./shared-a207423c.js";import"./shared-90a47948.js";import"./shared-2a5c89a4.js";import"./shared-4b346553.js";import"./shared-b8198665.js";import"./shared-8f3398dc.js";import"./shared-22ba9566.js";import"./shared-6e859df6.js";import"./shared-6918312e.js";import"./shared-fc1dfa64.js";import"./shared-c286c5ad.js";import"./shared-343d1fd7.js";import"./shared-0b01f721.js";import"./shared-f7a1193f.js";import"./foxy-copy-to-clipboard.js";import"./shared-9b2d6d62.js";import"./shared-029d623b.js";import"./shared-56bf05ef.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-24d71d01.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-51c4a6dd.js";!function(){function t(t,e,s){if(null!=s){const o=t.includes("?")?"&":"?";return t+o+e+"="+encodeURIComponent(s)}return t}class e extends Error{constructor(t){super(`[hcaptcha-web-component]: ${t}`),Object.setPrototypeOf(this,e.prototype)}}class s extends HTMLElement{connectedCallback(){(function(e){if(window._hCaptchaOnLoadPromise)return window._hCaptchaOnLoadPromise;if(window.hcaptcha)return console.warn("[vanilla-hcaptcha] hCaptcha JS API detected to be externally loaded. Unless you know what are you doing, this task should be delegated to this web component."),window._hCaptchaOnLoadPromise=Promise.resolve(),window._hCaptchaOnLoadPromise;{let s,o;window._hCaptchaOnLoadPromise=new Promise(((t,e)=>{s=t,o=e})),window._hCaptchaOnLoad=s;const r=function(e){let s=e.jsapi;return s=t(s,"render","explicit"),s=t(s,"onload","_hCaptchaOnLoad"),s=t(s,"recaptchacompat",!1===e.reCaptchaCompat?"off":null),s=t(s,"host",e.host),s=t(s,"hl",e.hl),s=t(s,"sentry",JSON.stringify(e.sentry)),s=t(s,"endpoint",e.endpoint),s=t(s,"assethost",e.assethost),s=t(s,"imghost",e.imghost),s=t(s,"reportapi",e.reportapi),s}(e),a=document.createElement("script");return a.src=r,a.async=!0,a.defer=!0,a.onerror=t=>{const e=`Failed to load hCaptcha JS API: "${r}"`;console.error(e,t),o(e)},document.head.appendChild(a),window._hCaptchaOnLoadPromise}})({host:this.getAttribute("host"),hl:this.getAttribute("hl"),sentry:"false"!==this.getAttribute("sentry"),reCaptchaCompat:"false"===this.getAttribute("reCaptchaCompat"),jsapi:this.getAttribute("jsapi")||"https://js.hcaptcha.com/1/api.js",endpoint:this.getAttribute("endpoint"),reportapi:this.getAttribute("reportapi"),assethost:this.getAttribute("assethost"),imghost:this.getAttribute("imghost")}).then(this.onApiLoaded.bind(this)).catch(this.onError.bind(this))}onApiLoaded(){this.$emit("loaded");const t="false"!==this.getAttribute("auto-render"),e={sitekey:this.getAttribute("sitekey")||this.getAttribute("site-key"),theme:this.getAttribute("theme"),size:this.getAttribute("size"),hl:this.getAttribute("hl"),tplinks:"off"===this.getAttribute("tplinks")?"off":"on",tabindex:parseInt(this.getAttribute("tabindex")),custom:"true"===this.getAttribute("custom")},s=this.getAttribute("challenge-container");s&&(e["challenge-container"]=s);const o=this.getAttribute("rqdata");t&&!e.sitekey||t&&(this.render(e),this.setData(o))}assertApiLoaded(t){if(!hcaptcha)throw new e(`hCaptcha JS API was not loaded yet. Please wait for \`loaded\` event to safely call "${t}".`)}assertRendered(){if(!this.hcaptchaId)throw new e('hCaptcha was not yet rendered. Please call "render()" first.')}onError(t){console.error(t),this.$emit("error",{error:t})}$emit(t,e){let s;"function"==typeof Event?s=new Event(t):(s=document.createEvent("Event"),s.initEvent(t,!1,!1)),e&&Object.assign(s,e),this.dispatchEvent(s)}render(t){this.assertApiLoaded("render"),this.hcaptchaId?console.warn("hCaptcha was already rendered. You may want to call 'reset()' first."):this.hcaptchaId=hcaptcha.render(this,Object.assign(Object.assign({},t),{callback:()=>{const t=hcaptcha.getResponse(this.hcaptchaId),e=hcaptcha.getRespKey(this.hcaptchaId);this.$emit("verified",{token:t,eKey:e,key:t})},"expired-callback":()=>{this.$emit("expired")},"chalexpired-callback":()=>{this.$emit("challenge-expired")},"error-callback":this.onError.bind(this),"open-callback":()=>{this.$emit("opened")},"close-callback":()=>{this.$emit("closed")}}))}setData(t){this.assertRendered(),hcaptcha.setData(this.hcaptchaId,{rqdata:t})}execute(){this.assertApiLoaded("execute"),this.assertRendered(),hcaptcha.execute(this.hcaptchaId)}executeAsync(){return this.assertApiLoaded("execute"),this.assertRendered(),hcaptcha.execute(this.hcaptchaId,{async:!0})}reset(){this.assertApiLoaded("reset"),this.assertRendered(),hcaptcha.reset(this.hcaptchaId)}}customElements.define("h-captcha",s)}();let c,p=t=>t;customElements.define("foxy-internal-customer-form-legal-notice-control",class extends e{renderControl(){var t,e;const r=this.nucleon;return o(c||(c=p` <p class="leading-s text-xs text-secondary"> <foxy-i18n infer="" key="text"></foxy-i18n> <a class="font-medium text-body rounded hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50" target="_blank" href="${0}" rel="noopener noreferrer"> <foxy-i18n infer="" key="link"></foxy-i18n> </a> </p> `),s(null===(e=null===(t=null==r?void 0:r.settings)||void 0===t?void 0:t.tos_checkbox_settings)||void 0===e?void 0:e.url))}});var m=r((function(t){!function(){const e=[{id:0,value:"Too weak",minDiversity:0,minLength:0},{id:1,value:"Weak",minDiversity:2,minLength:6},{id:2,value:"Medium",minDiversity:4,minLength:8},{id:3,value:"Strong",minDiversity:4,minLength:10}],s=(t,s=e,o="!\"#$%&'()*+,-./:;<=>?@[\\\\\\]^_`{|}~")=>{let r=t||"";s[0].minDiversity=0,s[0].minLength=0;const a=[{regex:"[a-z]",message:"lowercase"},{regex:"[A-Z]",message:"uppercase"},{regex:"[0-9]",message:"number"}];o&&a.push({regex:`[${o}]`,message:"symbol"});let i={};i.contains=a.filter((t=>new RegExp(`${t.regex}`).test(r))).map((t=>t.message)),i.length=r.length;let n=s.filter((t=>i.contains.length>=t.minDiversity)).filter((t=>i.length>=t.minLength)).sort(((t,e)=>e.id-t.id)).map((t=>({id:t.id,value:t.value})));return Object.assign(i,n[0]),i};t.exports={passwordStrength:s,defaultOptions:e}}()}));let u,f,g=t=>t;const _=n(d(t,"customer-form")),y=m.passwordStrength;class x extends _{constructor(){super(...arguments),this.passwordless=!1,this.settings=null,this.__passwordGeneratorOptions={checkStrength:t=>y(t).id>=2},this.__isAnonymousGetValue=()=>{var t;return!1===(null===(t=this.form)||void 0===t?void 0:t.is_anonymous)?"false":"true"},this.__isAnonymousSetValue=t=>{const e="true"===t;this.edit({is_anonymous:e}),e&&this.form.password&&this.edit({password:""}),e&&this.form.password_old&&this.edit({password_old:""}),e&&this.form.forgot_password&&this.edit({forgot_password:""})},this.__isAnonymousOptions=[{value:"true",label:"option_true"},{value:"false",label:"option_false"}],this.__refreshInterval=null}static get scopedElements(){return{"foxy-internal-customer-form-legal-notice-control":customElements.get("foxy-internal-customer-form-legal-notice-control"),"foxy-internal-radio-group-control":customElements.get("foxy-internal-radio-group-control"),"foxy-internal-timestamps-control":customElements.get("foxy-internal-timestamps-control"),"foxy-internal-password-control":customElements.get("foxy-internal-password-control"),"foxy-internal-submit-control":customElements.get("foxy-internal-submit-control"),"foxy-internal-delete-control":customElements.get("foxy-internal-delete-control"),"foxy-internal-text-control":customElements.get("foxy-internal-text-control"),"foxy-internal-undo-control":customElements.get("foxy-internal-undo-control"),"foxy-copy-to-clipboard":customElements.get("foxy-copy-to-clipboard"),"foxy-spinner":customElements.get("foxy-spinner"),"vcf-tooltip":customElements.get("vcf-tooltip"),"foxy-i18n":customElements.get("foxy-i18n"),"h-captcha":customElements.get("h-captcha"),"vaadin-button":customElements.get("vaadin-button")}}static get properties(){return a(a({},super.properties),{},{passwordless:{type:Boolean},settings:{type:Object}})}static get v8n(){return[({password:t,_links:e,is_anonymous:s=!0},o)=>!!o.passwordless||(!!(e||s||t)||"password:v8n_required"),({password_old:t,password:e,_links:s},o)=>{var r;return!s||(void 0===(null===(r=o.settings)||void 0===r?void 0:r.sign_up)||(!(e&&!t)||"password-old:v8n_required"))},({first_name:t})=>!t||t.length<=50||"first-name:v8n_too_long",({last_name:t})=>!t||t.length<=50||"last-name:v8n_too_long",({password:t})=>!t||y(t).id>=2||"password:v8n_too_weak",({password:t})=>!t||t.length<=50||"password:v8n_too_long",({tax_id:t})=>!t||t.length<=50||"tax-id:v8n_too_long",({email:t})=>t&&t.length>0||"email:v8n_required",({email:t})=>!t||t.length<=100||"email:v8n_too_long",({email:t})=>!t||l(t)||"email:v8n_invalid_email"]}get hiddenSelector(){const t=new Set(super.hiddenSelector.toString().split(" "));return this.settings?(t.add("forgot-password"),t.add("is-anonymous"),this.form.password||t.add("password-old"),"none"===this.settings.tos_checkbox_settings.usage&&t.add("legal-notice")):(!1!==this.form.is_anonymous&&(t.add("forgot-password"),t.add("password")),t.add("password-old"),t.add("legal-notice")),this.href&&(t.add("is-anonymous"),t.add("legal-notice")),new i(Array.from(t).join(" ").trim())}get headerTitleOptions(){var t,e;const s=this.data;return!s||(null===(t=s.first_name)||void 0===t?void 0:t.trim())||(null===(e=s.last_name)||void 0===e?void 0:e.trim())?super.headerTitleOptions:a(a({},super.headerTitleOptions),{},{context:"no_name"})}get headerSubtitleKey(){var t;return(null===(t=this.data)||void 0===t?void 0:t.is_anonymous)?"subtitle_anonymous":"subtitle_registered"}get headerSubtitleOptions(){return a(a({},super.headerSubtitleOptions),{},{id:this.headerCopyIdValue})}disconnectedCallback(){super.disconnectedCallback();const t=this.__refreshInterval;t&&clearInterval(t)}connectedCallback(){super.connectedCallback();const t=setInterval((()=>this.requestUpdate()),6e4);this.__refreshInterval=t}renderBody(){var t,e,s,r;const a=this.hiddenSelector.matches("first-name",!0),i=this.hiddenSelector.matches("last-name",!0);return o(u||(u=g` ${0} <div class="${0}"> <foxy-internal-text-control infer="first-name"></foxy-internal-text-control> <foxy-internal-text-control infer="last-name"></foxy-internal-text-control> </div> <foxy-internal-text-control helper-text="${0}" infer="email"> </foxy-internal-text-control> <foxy-internal-radio-group-control infer="is-anonymous" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-password-control placeholder="${0}" helper-text="${0}" infer="password" show-generator .generatorOptions="${0}"> </foxy-internal-password-control> <foxy-internal-password-control infer="password-old"></foxy-internal-password-control> <foxy-internal-password-control helper-text="${0}" infer="forgot-password" show-generator> </foxy-internal-password-control> <foxy-internal-text-control infer="tax-id"></foxy-internal-text-control> <foxy-internal-customer-form-legal-notice-control infer="legal-notice"> </foxy-internal-customer-form-legal-notice-control> ${0} ${0} `),this.renderHeader(),h({"grid-cols-2":!a&&!i,hidden:a&&i,"gap-m":!0,grid:!a||!i}),this.__emailHelperText,this.__isAnonymousGetValue,this.__isAnonymousSetValue,this.__isAnonymousOptions,this.__passwordPlaceholder,this.__passwordHelperText,this.__passwordGeneratorOptions,this.__forgotPasswordHelperText,!this.data&&(null===(e=null===(t=this.settings)||void 0===t?void 0:t.sign_up)||void 0===e?void 0:e.enabled)&&"hcaptcha"===(null===(r=null===(s=this.settings)||void 0===s?void 0:s.sign_up)||void 0===r?void 0:r.verification.type)?o(f||(f=g` <h-captcha site-key="${0}" class="hidden" size="invisible" hl="${0}" @verified="${0}"> </h-captcha> `),this.settings.sign_up.verification.site_key,this.lang,(({token:t})=>{this.edit({verification:{type:"hcaptcha",token:t}}),super.submit()})):"",super.renderBody())}submit(){var t,e,s,o,r;"hcaptcha"!==(null===(s=null===(e=null===(t=this.settings)||void 0===t?void 0:t.sign_up)||void 0===e?void 0:e.verification)||void 0===s?void 0:s.type)||this.data?super.submit():(null===(o=this.__hcaptcha)||void 0===o||o.reset(),null===(r=this.__hcaptcha)||void 0===r||r.execute())}async _sendPatch(t){const e=await super._sendPatch(t);if(t.password){const t={key:"password_change_success",options:{email:e.email}};this.status=t}return e}async _sendGet(){return this.status=null,await super._sendGet()}async _fetch(...t){try{return await super._fetch(...t)}catch(t){let e;try{e=(await t.json())._embedded["fx:errors"][0].message}catch(e){throw t}throw"Conflict"===e||e.startsWith("This email address is already in use")?["error:email_already_used"]:e.startsWith("Customer registration is disabled")?["error:registration_disabled"]:e.startsWith("Client verification failed")?["error:verification_failed"]:e.startsWith("Provided password is incorrect")?["error:old_password_incorrect"]:t}}get __forgotPasswordHelperText(){var t,e;const s=null===(t=this.data)||void 0===t?void 0:t.forgot_password_timestamp,o="forgot-password.helper_text";if((null===(e=this.data)||void 0===e?void 0:e.forgot_password)&&s){const t=new Date(new Date(s).getTime()+18e5),e=Math.floor((t.getTime()-Date.now())/1e3/60);return e<=0?this.t(`${o}_expired_on`,{expiresOn:t}):this.t(`${o}_expires_in`,{expiresInMin:`${e}minutes`})}return this.t(o)}get __passwordPlaceholder(){return this.data?this.t("password.placeholder_new"):this.t("password.placeholder")}get __passwordHelperText(){return this.data?this.t("password.helper_text_new"):this.t("password.helper_text")}get __emailHelperText(){var t;return(null===(t=this.data)||void 0===t?void 0:t.last_login_date)?this.t("email.helper_text_last_login_date",{date:this.data.last_login_date}):this.t("email.helper_text")}get __hcaptcha(){return this.renderRoot.querySelector("h-captcha")}}customElements.define("foxy-customer-form",x);export{x as CustomerForm};
1
+ import"./shared-c5647b62.js";import"./shared-193bb806.js";import"./shared-5c35d93a.js";import{I as t}from"./shared-bc023a29.js";import{a as e}from"./shared-f8368b97.js";import"./shared-acd33590.js";import{i as s}from"./shared-9803aa7c.js";import{h as o}from"./shared-dc73b9a5.js";import{c as r,_ as i,B as a}from"./shared-d1195c27.js";import{S as n,a as d}from"./shared-b726120d.js";import{v as l}from"./shared-b738ee96.js";import{c as h}from"./shared-4e709717.js";import"./shared-f998f9c8.js";import"./shared-adcfd50a.js";import"./shared-65479601.js";import"./shared-61ade33e.js";import"./shared-7ceceb4c.js";import"./shared-5513e830.js";import"./shared-9e360643.js";import"./shared-8fc527b7.js";import"./shared-8b5e05df.js";import"./shared-562d466d.js";import"./shared-22ba9566.js";import"./shared-239062b0.js";import"./shared-28ebee50.js";import"./shared-df51ee50.js";import"./shared-c518ece2.js";import"./shared-343d1fd7.js";import"./shared-d1cb97c6.js";import"./shared-17a61265.js";import"./foxy-copy-to-clipboard.js";import"./shared-11694c05.js";import"./shared-c4f15ea3.js";import"./shared-4903b2e3.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-2ad18636.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-51c4a6dd.js";!function(){function t(t,e,s){if(null!=s){const o=t.includes("?")?"&":"?";return t+o+e+"="+encodeURIComponent(s)}return t}class e extends Error{constructor(t){super(`[hcaptcha-web-component]: ${t}`),Object.setPrototypeOf(this,e.prototype)}}class s extends HTMLElement{connectedCallback(){(function(e){if(window._hCaptchaOnLoadPromise)return window._hCaptchaOnLoadPromise;if(window.hcaptcha)return console.warn("[vanilla-hcaptcha] hCaptcha JS API detected to be externally loaded. Unless you know what are you doing, this task should be delegated to this web component."),window._hCaptchaOnLoadPromise=Promise.resolve(),window._hCaptchaOnLoadPromise;{let s,o;window._hCaptchaOnLoadPromise=new Promise(((t,e)=>{s=t,o=e})),window._hCaptchaOnLoad=s;const r=function(e){let s=e.jsapi;return s=t(s,"render","explicit"),s=t(s,"onload","_hCaptchaOnLoad"),s=t(s,"recaptchacompat",!1===e.reCaptchaCompat?"off":null),s=t(s,"host",e.host),s=t(s,"hl",e.hl),s=t(s,"sentry",JSON.stringify(e.sentry)),s=t(s,"endpoint",e.endpoint),s=t(s,"assethost",e.assethost),s=t(s,"imghost",e.imghost),s=t(s,"reportapi",e.reportapi),s}(e),i=document.createElement("script");return i.src=r,i.async=!0,i.defer=!0,i.onerror=t=>{const e=`Failed to load hCaptcha JS API: "${r}"`;console.error(e,t),o(e)},document.head.appendChild(i),window._hCaptchaOnLoadPromise}})({host:this.getAttribute("host"),hl:this.getAttribute("hl"),sentry:"false"!==this.getAttribute("sentry"),reCaptchaCompat:"false"===this.getAttribute("reCaptchaCompat"),jsapi:this.getAttribute("jsapi")||"https://js.hcaptcha.com/1/api.js",endpoint:this.getAttribute("endpoint"),reportapi:this.getAttribute("reportapi"),assethost:this.getAttribute("assethost"),imghost:this.getAttribute("imghost")}).then(this.onApiLoaded.bind(this)).catch(this.onError.bind(this))}onApiLoaded(){this.$emit("loaded");const t="false"!==this.getAttribute("auto-render"),e={sitekey:this.getAttribute("sitekey")||this.getAttribute("site-key"),theme:this.getAttribute("theme"),size:this.getAttribute("size"),hl:this.getAttribute("hl"),tplinks:"off"===this.getAttribute("tplinks")?"off":"on",tabindex:parseInt(this.getAttribute("tabindex")),custom:"true"===this.getAttribute("custom")},s=this.getAttribute("challenge-container");s&&(e["challenge-container"]=s);const o=this.getAttribute("rqdata");t&&!e.sitekey||t&&(this.render(e),this.setData(o))}assertApiLoaded(t){if(!hcaptcha)throw new e(`hCaptcha JS API was not loaded yet. Please wait for \`loaded\` event to safely call "${t}".`)}assertRendered(){if(!this.hcaptchaId)throw new e('hCaptcha was not yet rendered. Please call "render()" first.')}onError(t){console.error(t),this.$emit("error",{error:t})}$emit(t,e){let s;"function"==typeof Event?s=new Event(t):(s=document.createEvent("Event"),s.initEvent(t,!1,!1)),e&&Object.assign(s,e),this.dispatchEvent(s)}render(t){this.assertApiLoaded("render"),this.hcaptchaId?console.warn("hCaptcha was already rendered. You may want to call 'reset()' first."):this.hcaptchaId=hcaptcha.render(this,Object.assign(Object.assign({},t),{callback:()=>{const t=hcaptcha.getResponse(this.hcaptchaId),e=hcaptcha.getRespKey(this.hcaptchaId);this.$emit("verified",{token:t,eKey:e,key:t})},"expired-callback":()=>{this.$emit("expired")},"chalexpired-callback":()=>{this.$emit("challenge-expired")},"error-callback":this.onError.bind(this),"open-callback":()=>{this.$emit("opened")},"close-callback":()=>{this.$emit("closed")}}))}setData(t){this.assertRendered(),hcaptcha.setData(this.hcaptchaId,{rqdata:t})}execute(){this.assertApiLoaded("execute"),this.assertRendered(),hcaptcha.execute(this.hcaptchaId)}executeAsync(){return this.assertApiLoaded("execute"),this.assertRendered(),hcaptcha.execute(this.hcaptchaId,{async:!0})}reset(){this.assertApiLoaded("reset"),this.assertRendered(),hcaptcha.reset(this.hcaptchaId)}}customElements.define("h-captcha",s)}();let c,p=t=>t;customElements.define("foxy-internal-customer-form-legal-notice-control",class extends e{renderControl(){var t,e;const r=this.nucleon;return o(c||(c=p` <p class="leading-s text-xs text-secondary"> <foxy-i18n infer="" key="text"></foxy-i18n> <a class="font-medium text-body rounded hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50" target="_blank" href="${0}" rel="noopener noreferrer"> <foxy-i18n infer="" key="link"></foxy-i18n> </a> </p> `),s(null===(e=null===(t=null==r?void 0:r.settings)||void 0===t?void 0:t.tos_checkbox_settings)||void 0===e?void 0:e.url))}});var m=r((function(t){!function(){const e=[{id:0,value:"Too weak",minDiversity:0,minLength:0},{id:1,value:"Weak",minDiversity:2,minLength:6},{id:2,value:"Medium",minDiversity:4,minLength:8},{id:3,value:"Strong",minDiversity:4,minLength:10}],s=(t,s=e,o="!\"#$%&'()*+,-./:;<=>?@[\\\\\\]^_`{|}~")=>{let r=t||"";s[0].minDiversity=0,s[0].minLength=0;const i=[{regex:"[a-z]",message:"lowercase"},{regex:"[A-Z]",message:"uppercase"},{regex:"[0-9]",message:"number"}];o&&i.push({regex:`[${o}]`,message:"symbol"});let a={};a.contains=i.filter((t=>new RegExp(`${t.regex}`).test(r))).map((t=>t.message)),a.length=r.length;let n=s.filter((t=>a.contains.length>=t.minDiversity)).filter((t=>a.length>=t.minLength)).sort(((t,e)=>e.id-t.id)).map((t=>({id:t.id,value:t.value})));return Object.assign(a,n[0]),a};t.exports={passwordStrength:s,defaultOptions:e}}()}));let u,f,g=t=>t;const _=n(d(t,"customer-form")),y=m.passwordStrength;class x extends _{constructor(){super(...arguments),this.passwordless=!1,this.settings=null,this.__passwordGeneratorOptions={checkStrength:t=>y(t).id>=2},this.__isAnonymousGetValue=()=>{var t;return!1===(null===(t=this.form)||void 0===t?void 0:t.is_anonymous)?"false":"true"},this.__isAnonymousSetValue=t=>{const e="true"===t;this.edit({is_anonymous:e}),e&&this.form.password&&this.edit({password:""}),e&&this.form.password_old&&this.edit({password_old:""}),e&&this.form.forgot_password&&this.edit({forgot_password:""})},this.__isAnonymousOptions=[{value:"true",label:"option_true"},{value:"false",label:"option_false"}],this.__refreshInterval=null}static get scopedElements(){return{"foxy-internal-customer-form-legal-notice-control":customElements.get("foxy-internal-customer-form-legal-notice-control"),"foxy-internal-radio-group-control":customElements.get("foxy-internal-radio-group-control"),"foxy-internal-timestamps-control":customElements.get("foxy-internal-timestamps-control"),"foxy-internal-password-control":customElements.get("foxy-internal-password-control"),"foxy-internal-submit-control":customElements.get("foxy-internal-submit-control"),"foxy-internal-delete-control":customElements.get("foxy-internal-delete-control"),"foxy-internal-text-control":customElements.get("foxy-internal-text-control"),"foxy-internal-undo-control":customElements.get("foxy-internal-undo-control"),"foxy-copy-to-clipboard":customElements.get("foxy-copy-to-clipboard"),"foxy-spinner":customElements.get("foxy-spinner"),"vcf-tooltip":customElements.get("vcf-tooltip"),"foxy-i18n":customElements.get("foxy-i18n"),"h-captcha":customElements.get("h-captcha"),"vaadin-button":customElements.get("vaadin-button")}}static get properties(){return i(i({},super.properties),{},{passwordless:{type:Boolean},settings:{type:Object}})}static get v8n(){return[({password:t,_links:e,is_anonymous:s=!0},o)=>!!o.passwordless||(!!(e||s||t)||"password:v8n_required"),({password_old:t,password:e,_links:s},o)=>{var r;return!s||(void 0===(null===(r=o.settings)||void 0===r?void 0:r.sign_up)||(!(e&&!t)||"password-old:v8n_required"))},({first_name:t})=>!t||t.length<=50||"first-name:v8n_too_long",({last_name:t})=>!t||t.length<=50||"last-name:v8n_too_long",({password:t})=>!t||y(t).id>=2||"password:v8n_too_weak",({password:t})=>!t||t.length<=50||"password:v8n_too_long",({tax_id:t})=>!t||t.length<=50||"tax-id:v8n_too_long",({email:t})=>t&&t.length>0||"email:v8n_required",({email:t})=>!t||t.length<=100||"email:v8n_too_long",({email:t})=>!t||l(t)||"email:v8n_invalid_email"]}get hiddenSelector(){const t=new Set(super.hiddenSelector.toString().split(" "));return this.settings?(t.add("forgot-password"),t.add("is-anonymous"),this.form.password||t.add("password-old"),"none"===this.settings.tos_checkbox_settings.usage&&t.add("legal-notice")):(!1!==this.form.is_anonymous&&(t.add("forgot-password"),t.add("password")),t.add("password-old"),t.add("legal-notice")),this.href&&(t.add("is-anonymous"),t.add("legal-notice")),new a(Array.from(t).join(" ").trim())}get headerTitleOptions(){var t,e;const s=this.data;return!s||(null===(t=s.first_name)||void 0===t?void 0:t.trim())||(null===(e=s.last_name)||void 0===e?void 0:e.trim())?super.headerTitleOptions:i(i({},super.headerTitleOptions),{},{context:"no_name"})}get headerSubtitleKey(){var t;return(null===(t=this.data)||void 0===t?void 0:t.is_anonymous)?"subtitle_anonymous":"subtitle_registered"}get headerSubtitleOptions(){return i(i({},super.headerSubtitleOptions),{},{id:this.headerCopyIdValue})}disconnectedCallback(){super.disconnectedCallback();const t=this.__refreshInterval;t&&clearInterval(t)}connectedCallback(){super.connectedCallback();const t=setInterval((()=>this.requestUpdate()),6e4);this.__refreshInterval=t}renderBody(){var t,e,s,r;const i=this.hiddenSelector.matches("first-name",!0),a=this.hiddenSelector.matches("last-name",!0);return o(u||(u=g` ${0} <div class="${0}"> <foxy-internal-text-control infer="first-name"></foxy-internal-text-control> <foxy-internal-text-control infer="last-name"></foxy-internal-text-control> </div> <foxy-internal-text-control helper-text="${0}" infer="email"> </foxy-internal-text-control> <foxy-internal-radio-group-control infer="is-anonymous" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-password-control placeholder="${0}" helper-text="${0}" infer="password" show-generator .generatorOptions="${0}"> </foxy-internal-password-control> <foxy-internal-password-control infer="password-old"></foxy-internal-password-control> <foxy-internal-password-control helper-text="${0}" infer="forgot-password" show-generator> </foxy-internal-password-control> <foxy-internal-text-control infer="tax-id"></foxy-internal-text-control> <foxy-internal-customer-form-legal-notice-control infer="legal-notice"> </foxy-internal-customer-form-legal-notice-control> ${0} ${0} `),this.renderHeader(),h({"grid-cols-2":!i&&!a,hidden:i&&a,"gap-m":!0,grid:!i||!a}),this.__emailHelperText,this.__isAnonymousGetValue,this.__isAnonymousSetValue,this.__isAnonymousOptions,this.__passwordPlaceholder,this.__passwordHelperText,this.__passwordGeneratorOptions,this.__forgotPasswordHelperText,!this.data&&(null===(e=null===(t=this.settings)||void 0===t?void 0:t.sign_up)||void 0===e?void 0:e.enabled)&&"hcaptcha"===(null===(r=null===(s=this.settings)||void 0===s?void 0:s.sign_up)||void 0===r?void 0:r.verification.type)?o(f||(f=g` <h-captcha site-key="${0}" class="hidden" size="invisible" hl="${0}" @verified="${0}"> </h-captcha> `),this.settings.sign_up.verification.site_key,this.lang,(({token:t})=>{this.edit({verification:{type:"hcaptcha",token:t}}),super.submit()})):"",super.renderBody())}submit(){var t,e,s,o,r;"hcaptcha"!==(null===(s=null===(e=null===(t=this.settings)||void 0===t?void 0:t.sign_up)||void 0===e?void 0:e.verification)||void 0===s?void 0:s.type)||this.data?super.submit():(null===(o=this.__hcaptcha)||void 0===o||o.reset(),null===(r=this.__hcaptcha)||void 0===r||r.execute())}async _sendPatch(t){const e=await super._sendPatch(t);if(t.password){const t={key:"password_change_success",options:{email:e.email}};this.status=t}return e}async _sendGet(){return this.status=null,await super._sendGet()}async _fetch(...t){try{return await super._fetch(...t)}catch(t){let e;try{e=(await t.json())._embedded["fx:errors"][0].message}catch(e){throw t}throw"Conflict"===e||e.startsWith("This email address is already in use")?["error:email_already_used"]:e.startsWith("Customer registration is disabled")?["error:registration_disabled"]:e.startsWith("Client verification failed")?["error:verification_failed"]:e.startsWith("Provided password is incorrect")?["error:old_password_incorrect"]:t}}get __forgotPasswordHelperText(){var t,e;const s=null===(t=this.data)||void 0===t?void 0:t.forgot_password_timestamp,o="forgot-password.helper_text";if((null===(e=this.data)||void 0===e?void 0:e.forgot_password)&&s){const t=new Date(new Date(s).getTime()+18e5),e=Math.floor((t.getTime()-Date.now())/1e3/60);return e<=0?this.t(`${o}_expired_on`,{expiresOn:t}):this.t(`${o}_expires_in`,{expiresInMin:`${e}minutes`})}return this.t(o)}get __passwordPlaceholder(){return this.data?this.t("password.placeholder_new"):this.t("password.placeholder")}get __passwordHelperText(){return this.data?this.t("password.helper_text_new"):this.t("password.helper_text")}get __emailHelperText(){var t;return(null===(t=this.data)||void 0===t?void 0:t.last_login_date)?this.t("email.helper_text_last_login_date",{date:this.data.last_login_date}):this.t("email.helper_text")}get __hcaptcha(){return this.renderRoot.querySelector("h-captcha")}}customElements.define("foxy-customer-form",x);export{x as CustomerForm};
@@ -1 +1 @@
1
- import"./shared-0cc5420d.js";import"./shared-28f74114.js";import"./shared-388e9240.js";import"./shared-5a2f398c.js";import"./shared-7c411b0a.js";import{I as e}from"./shared-0e055562.js";import"./shared-21bc5d5e.js";import{a as t}from"./shared-fb34e84c.js";import{B as i}from"./shared-0f6e4584.js";import{p as s}from"./shared-f34aeb6c.js";import{h as o}from"./shared-dc73b9a5.js";import"./shared-3ee151ce.js";import{p as n}from"./shared-37efab30.js";import{I as a}from"./shared-f3773d62.js";import"./shared-f407c2cb.js";import"./shared-61b6ef6e.js";import"./shared-b08ca8d0.js";import"./shared-44ce656d.js";import"./shared-09b4185a.js";import"./shared-61ade33e.js";import"./shared-a207423c.js";import"./shared-90a47948.js";import"./shared-7d38cb8a.js";import"./shared-51c4a6dd.js";import"./shared-0b01f721.js";import"./shared-9803aa7c.js";import"./shared-f7a1193f.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-9b2d6d62.js";import"./shared-029d623b.js";import"./shared-4e709717.js";import"./shared-a0c6a159.js";import"./shared-22ba9566.js";import"./shared-99940888.js";import"./shared-280f868d.js";import"./shared-c2776a33.js";import"./shared-e24da82e.js";import"./shared-6e859df6.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-56bf05ef.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-6918312e.js";import"./shared-fc1dfa64.js";import"./foxy-pagination.js";import"./shared-d132bd37.js";import"./shared-4b346553.js";import"./shared-8f3398dc.js";import"./shared-b8198665.js";import"./shared-ac0368ec.js";import"./shared-16c17e32.js";import"./shared-0a6a28ce.js";import"./shared-19884cf4.js";import"./shared-651c44fa.js";import"./shared-f2968508.js";import"./shared-d8c3067b.js";import"./shared-2a5c89a4.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";let r,l=e=>e;const d=t(e);customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-form",class extends d{constructor(){super(...arguments),this.__valuesInputParams={type:"number",step:"1",min:"1",max:"999"},this.__valuesGetValue=()=>{var e;return null===(e=this.form.values)||void 0===e?void 0:e.map((e=>{if(".5m"===e)return{value:e,label:this.t("values.twice_a_week")};const{units:t,count:i}=s(e);return{value:e,label:this.t(`values.${t}`,{count:i})}}))},this.__valuesSetValue=e=>{const t=e.filter((({value:e})=>parseFloat(e)<=999)).map((({unit:e,value:t})=>e?`${t}${e}`:t)).filter(((e,t,i)=>i.indexOf(e)===t));this.edit({values:t})}}static get v8n(){return[({jsonataQuery:e})=>!!e||"jsonata-query:v8n_required",({jsonataQuery:e})=>!e||e.length<=200||"jsonata-query:v8n_too_long",({values:e})=>!!e&&e.length>0||"values:v8n_required",({values:e})=>!e||e.length<=20||"values:v8n_too_long"]}get hiddenSelector(){return new i(`timestamps ${super.hiddenSelector}`.trim())}renderBody(){return o(r||(r=l` <foxy-internal-source-control infer="jsonata-query" property="jsonataQuery"> </foxy-internal-source-control> <foxy-internal-editable-list-control infer="values" .inputParams="${0}" .getValue="${0}" .setValue="${0}" .units="${0}"> </foxy-internal-editable-list-control> ${0} `),this.__valuesInputParams,this.__valuesGetValue,this.__valuesSetValue,[{label:this.t("values.unit_years"),value:"y"},{label:this.t("values.unit_months"),value:"m"},{label:this.t("values.unit_weeks"),value:"w"},{label:this.t("values.unit_days"),value:"d"}],super.renderBody())}});let u,c=e=>e;const p=t(a);customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-card",class extends p{renderBody(){var e;const{jsonataQuery:t,values:i}=null!==(e=this.data)&&void 0!==e?e:{},n=null==i?void 0:i.map((e=>{if(".5m"===e)return this.t("twice_a_week");const{units:t,count:i}=s(e);return this.t(t,{count:i})}));return o(u||(u=c` <section class="h-s flex flex-col justify-center leading-xs"> <p class="text-m font-medium min-w-0"> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> </p> <p class="text-s text-secondary min-w-0"> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> </p> </section> `),"*"===t?"title_all":"title_matching",{query:t},(null==i?void 0:i.length)?"subtitle_list":"subtitle_empty",{list:null==n?void 0:n.join(", ")})}});let f,h=e=>e;const m=t(e);customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-form",class extends m{constructor(){super(...arguments),this.__minmaxRestrictionsGetValue=()=>{const e=[],t=this.form;return t.min&&e.push("min"),t.max&&e.push("max"),e},this.__minmaxRestrictionsSetValue=e=>{const t=this.form;this.edit({min:e.includes("min")?t.min||"1m":null,max:e.includes("max")?t.max||"1y":null})},this.__minmaxRestrictionsOptions=[{label:"option_min",value:"min"},{label:"option_max",value:"max"}],this.__dayAndDateRestrictionsGetValue=()=>{var e;const t=null===(e=this.form.allowedDays)||void 0===e?void 0:e.type;return"day"===t?"days":"month"===t?"dates":"none"},this.__dayAndDateRestrictionsSetValue=e=>{"dates"===e?this.edit({allowedDays:{type:"month",days:[]}}):"days"===e?this.edit({allowedDays:{type:"day",days:[]}}):this.edit({allowedDays:null})},this.__dayAndDateRestrictionsOptions=[{label:"option_none",value:"none"},{label:"option_dates",value:"dates"},{label:"option_days",value:"days"}],this.__daysOfWeekGetValue=()=>{var e,t;return null!==(t=null===(e=this.form.allowedDays)||void 0===e?void 0:e.days.map((e=>String(e))))&&void 0!==t?t:[]},this.__daysOfWeekSetValue=e=>{this.edit({allowedDays:{type:"day",days:e.map(Number)}})},this.__daysOfWeekOptions=[{label:"option_1",value:"1"},{label:"option_2",value:"2"},{label:"option_3",value:"3"},{label:"option_4",value:"4"},{label:"option_5",value:"5"},{label:"option_6",value:"6"},{label:"option_7",value:"7"}],this.__datesOfMonthInputParams={type:"number",min:"1",max:"31",step:"1"},this.__datesOfMonthGetValue=()=>{var e,t;return null!==(t=null===(e=this.form.allowedDays)||void 0===e?void 0:e.days.map((e=>({value:String(e)}))))&&void 0!==t?t:[]},this.__datesOfMonthSetValue=e=>{this.edit({allowedDays:{type:"month",days:e.map((e=>parseInt(e.value))).filter((e=>Number.isInteger(e)&&e>=1&&e<=31))}})},this.__disallowedDatesInputParams={type:"date"},this.__disallowedDatesGetValue=()=>{var e,t;return null!==(t=null===(e=this.form.disallowedDates)||void 0===e?void 0:e.map((e=>({value:e}))))&&void 0!==t?t:[]},this.__disallowedDatesSetValue=e=>{this.edit({disallowedDates:e.map((e=>e.value))})}}static get v8n(){return[({jsonataQuery:e})=>!!e||"jsonata-query:v8n_required",({jsonataQuery:e})=>!e||e.length<=200||"jsonata-query:v8n_too_long",({disallowedDates:e})=>!e||e.length<=10||"disallowed-dates:v8n_too_long"]}get hiddenSelector(){var e,t;const s=["timestamps",super.hiddenSelector.toString()],o=this.form;return o.min||s.unshift("min"),o.max||s.unshift("max"),"day"!==(null===(e=o.allowedDays)||void 0===e?void 0:e.type)&&s.unshift("days-of-week"),"month"!==(null===(t=o.allowedDays)||void 0===t?void 0:t.type)&&s.unshift("dates-of-month"),new i(s.join(" ").trim())}renderBody(){return o(f||(f=h` <foxy-internal-source-control infer="jsonata-query" property="jsonataQuery"> </foxy-internal-source-control> <foxy-internal-checkbox-group-control infer="minmax-restrictions" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-frequency-control infer="min"></foxy-internal-frequency-control> <foxy-internal-frequency-control infer="max"></foxy-internal-frequency-control> <foxy-internal-radio-group-control infer="day-and-date-restrictions" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-checkbox-group-control infer="days-of-week" theme="vertical" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-editable-list-control infer="dates-of-month" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-editable-list-control infer="disallowed-dates" range="optional" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> ${0} `),this.__minmaxRestrictionsGetValue,this.__minmaxRestrictionsSetValue,this.__minmaxRestrictionsOptions,this.__dayAndDateRestrictionsGetValue,this.__dayAndDateRestrictionsSetValue,this.__dayAndDateRestrictionsOptions,this.__daysOfWeekGetValue,this.__daysOfWeekSetValue,this.__daysOfWeekOptions,this.__datesOfMonthInputParams,this.__datesOfMonthGetValue,this.__datesOfMonthSetValue,this.__disallowedDatesInputParams,this.__disallowedDatesGetValue,this.__disallowedDatesSetValue,super.renderBody())}});let y,_=e=>e;const v=t(a);function x(e){try{return new URL(e).origin===e.toLowerCase()}catch(e){return!1}}customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-card",class extends v{renderBody(){var e;const{min:t,max:i,allowedDays:s,jsonataQuery:a,disallowedDates:r}=null!==(e=this.data)&&void 0!==e?e:{},l=t?n(t):void 0,d=i?n(i):void 0,u="*"===a?"line_1_all":"line_1_matching",c={query:a},p={from:l?this.t(`unit_${l.units}`,{count:l.count}):this.t("any"),to:d?this.t(`unit_${d.units}`,{count:d.count}):this.t("any")},f=`line_3_${s?s.type:"any"}`,h={list:"month"===(null==s?void 0:s.type)?null==s?void 0:s.days.join(", "):null==s?void 0:s.days.map((e=>this.t(`day_${e}`))).join(", ")},m=r?"line_4_some":"line_4_none",v={list:null==r?void 0:r.map((e=>{const[t,i]=e.split("..");return t&&i?this.t("date_range",{from:t,to:i}):this.t("single_date",{value:e})})).join(", ")};return o(y||(y=_` <section class="leading-xs" style="margin:-.25ch 0"> <p class="text-m font-medium truncate"> <foxy-i18n infer="" key="${0}" .options="${0}"></foxy-i18n> </p> <p class="text-s text-secondary"> <foxy-i18n infer="" class="block truncate" key="line_2" .options="${0}"> </foxy-i18n> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> </p> </section> `),u,c,p,f,h,m,v)}});let g,b=e=>e;const j=t(e,"customer-portal-settings-form");class w extends j{constructor(){super(...arguments),this.__sessionLifespanInMinutesOptions=[{value:"m",label:"option_minute"},{value:"h",label:"option_hour"},{value:"d",label:"option_day"},{value:"w",label:"option_week"}],this.__sessionLifespanInMinutesGetValue=()=>{var e;const t=null!==(e=this.form.sessionLifespanInMinutes)&&void 0!==e?e:0;return t%10080==0?t/10080+"w":t%1440==0?t/1440+"d":t%60==0?t/60+"h":`${t}m`},this.__sessionLifespanInMinutesSetValue=e=>{const t=parseInt(e);e.endsWith("w")?this.edit({sessionLifespanInMinutes:10080*t}):e.endsWith("d")?this.edit({sessionLifespanInMinutes:1440*t}):e.endsWith("h")?this.edit({sessionLifespanInMinutes:60*t}):this.edit({sessionLifespanInMinutes:t})},this.__allowedOriginsGetValue=()=>{var e;return null===(e=this.form.allowedOrigins)||void 0===e?void 0:e.map((e=>({label:x(e)?e:`⚠️ ${e}`,value:e})))},this.__allowedOriginsSetValue=e=>{this.edit({allowedOrigins:e.map((({value:e})=>function(e){try{return new URL(e).origin}catch(t){return e}}(e))).filter(((e,t,i)=>i.indexOf(e)===t))})},this.__featuresOptions=[{value:"sso",label:"option_sso"},{value:"sign-up",label:"option_sign_up"},{value:"frequency-modification",label:"option_frequency_modification"},{value:"next-date-modification",label:"option_next_date_modification"}],this.__featuresGetValue=()=>{var e,t,i;const s=[];return this.form.sso&&s.push("sso"),(null===(e=this.form.signUp)||void 0===e?void 0:e.enabled)&&s.push("sign-up"),(null===(t=this.form.subscriptions)||void 0===t?void 0:t.allowNextDateModification)&&s.push("next-date-modification"),(null===(i=this.form.subscriptions)||void 0===i?void 0:i.allowFrequencyModification.length)&&s.push("frequency-modification"),s},this.__featuresSetValue=e=>{var t,i,s,o,n;const a=null!==(i=null===(t=this.form.subscriptions)||void 0===t?void 0:t.allowFrequencyModification)&&void 0!==i?i:[];this.edit({sso:e.includes("sso"),signUp:{enabled:e.includes("sign-up"),verification:null!==(o=null===(s=this.form.signUp)||void 0===s?void 0:s.verification)&&void 0!==o?o:{type:"hcaptcha",siteKey:"",secretKey:""}},subscriptions:{allowFrequencyModification:e.includes("frequency-modification")?0===a.length?[{jsonataQuery:"*",values:[]}]:a:[],allowNextDateModification:!!e.includes("next-date-modification")&&((null===(n=this.form.subscriptions)||void 0===n?void 0:n.allowNextDateModification)||[])}})},this.__signUpVerificationHcaptchaSiteKeyGetValue=()=>{var e,t,i;return null!==(i=null===(t=null===(e=this.form.signUp)||void 0===e?void 0:e.verification)||void 0===t?void 0:t.siteKey)&&void 0!==i?i:""},this.__signUpVerificationHcaptchaSiteKeySetValue=e=>{var t,i,s,o;this.edit({signUp:{enabled:!!(null===(t=this.form.signUp)||void 0===t?void 0:t.enabled),verification:{secretKey:null!==(o=null===(s=null===(i=this.form.signUp)||void 0===i?void 0:i.verification)||void 0===s?void 0:s.secretKey)&&void 0!==o?o:"",siteKey:e,type:"hcaptcha"}}})},this.__signUpVerificationHcaptchaSecretKeyGetValue=()=>{var e,t,i;return null!==(i=null===(t=null===(e=this.form.signUp)||void 0===e?void 0:e.verification)||void 0===t?void 0:t.secretKey)&&void 0!==i?i:""},this.__signUpVerificationHcaptchaSecretKeySetValue=e=>{var t,i,s,o;this.edit({signUp:{enabled:!!(null===(t=this.form.signUp)||void 0===t?void 0:t.enabled),verification:{secretKey:e,siteKey:null!==(o=null===(s=null===(i=this.form.signUp)||void 0===i?void 0:i.verification)||void 0===s?void 0:s.siteKey)&&void 0!==o?o:"",type:"hcaptcha"}}})},this.__jwtSecretGeneratorOptions={charset:"abcdefghijklmnopqrstuvwxyz0123456789",length:64}}static get v8n(){return[({sessionLifespanInMinutes:e})=>"number"!=typeof e||e<=40320||"session-lifespan-in-minutes:v8n_too_long",({allowedOrigins:e=[]})=>e.length<=10||"allowed-origins:v8n_too_many",({allowedOrigins:e=[]})=>e.every(x)||"allowed-origins:v8n_invalid",({jwtSharedSecret:e})=>!e||/^[a-z0-9-]+$/.test(e)||"jwt-shared-secret:v8n_invalid",({jwtSharedSecret:e})=>!e||e.length>=40||"jwt-shared-secret:v8n_too_short",({jwtSharedSecret:e})=>!e||e.length<=100||"jwt-shared-secret:v8n_too_long",({signUp:e})=>{const t=null==e?void 0:e.verification.siteKey;return!t||t.length<=100||"sign-up-verification-hcaptcha-site-key:v8n_too_long"},({signUp:e})=>{const t=null==e?void 0:e.verification.secretKey;return!t||t.length<=100||"sign-up-verification-hcaptcha-secret-key:v8n_too_long"}]}get hiddenSelector(){var e,t,s;const o=["header:copy-id",super.hiddenSelector.toString()];return(null===(e=this.form.signUp)||void 0===e?void 0:e.enabled)||o.push("sign-up-verification-hcaptcha-site-key","sign-up-verification-hcaptcha-secret-key"),(null===(t=this.form.subscriptions)||void 0===t?void 0:t.allowFrequencyModification.length)||o.push("subscriptions-allow-frequency-modification"),(null===(s=this.form.subscriptions)||void 0===s?void 0:s.allowNextDateModification)||o.push("subscriptions-allow-next-date-modification"),new i(o.join(" ").trim())}renderBody(){return o(g||(g=b` ${0} <foxy-internal-editable-list-control infer="allowed-origins" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-checkbox-group-control infer="features" theme="vertical" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-password-control infer="sign-up-verification-hcaptcha-site-key" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> <foxy-internal-password-control infer="sign-up-verification-hcaptcha-secret-key" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> <foxy-internal-async-list-control first="foxy://${0}/form/subscriptions/allowFrequencyModification" infer="subscriptions-allow-frequency-modification" limit="20" form="foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-form" item="foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-card" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control first="foxy://${0}/form/subscriptions/allowNextDateModification" infer="subscriptions-allow-next-date-modification" limit="20" form="foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-form" item="foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-card" alert> </foxy-internal-async-list-control> <foxy-internal-frequency-control infer="session-lifespan-in-minutes" max="" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-frequency-control> <foxy-internal-password-control property="jwtSharedSecret" infer="jwt-shared-secret" show-generator .generatorOptions="${0}"> </foxy-internal-password-control> ${0} `),this.renderHeader(),this.__allowedOriginsGetValue,this.__allowedOriginsSetValue,this.__featuresGetValue,this.__featuresSetValue,this.__featuresOptions,this.__signUpVerificationHcaptchaSiteKeyGetValue,this.__signUpVerificationHcaptchaSiteKeySetValue,this.__signUpVerificationHcaptchaSecretKeyGetValue,this.__signUpVerificationHcaptchaSecretKeySetValue,this.virtualHost,this.virtualHost,this.__sessionLifespanInMinutesGetValue,this.__sessionLifespanInMinutesSetValue,this.__sessionLifespanInMinutesOptions,this.__jwtSecretGeneratorOptions,super.renderBody())}async _sendPost(e){return this.__removeNullProperties(e),super._sendPost(e)}async _sendPatch(e){return this.__removeNullProperties(e),super._sendPatch(e)}__removeNullProperties(e){var t,i;"object"==typeof(null===(t=e.subscriptions)||void 0===t?void 0:t.allowNextDateModification)&&(null===(i=e.subscriptions)||void 0===i||i.allowNextDateModification.forEach((e=>{for(const t in e){const i=t;null===e[i]&&delete e[i]}})))}}customElements.define("foxy-customer-portal-settings-form",w);export{w as CustomerPortalSettingsForm};
1
+ import"./shared-f67f6fc5.js";import"./shared-9d309e97.js";import"./shared-aaf72aad.js";import"./shared-92192fe1.js";import"./shared-193bb806.js";import{I as e}from"./shared-bc023a29.js";import"./shared-15100be0.js";import{a as t}from"./shared-b726120d.js";import{B as i}from"./shared-d1195c27.js";import{p as s}from"./shared-492da078.js";import{h as o}from"./shared-dc73b9a5.js";import"./shared-5e09e162.js";import{p as n}from"./shared-acd33590.js";import{I as a}from"./shared-19df2a73.js";import"./shared-c5647b62.js";import"./shared-6f0504e2.js";import"./shared-f998f9c8.js";import"./shared-adcfd50a.js";import"./shared-65479601.js";import"./shared-61ade33e.js";import"./shared-7ceceb4c.js";import"./shared-5513e830.js";import"./shared-f8368b97.js";import"./shared-51c4a6dd.js";import"./shared-d1cb97c6.js";import"./shared-9803aa7c.js";import"./shared-17a61265.js";import"./shared-2ad18636.js";import"./shared-c518ece2.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-11694c05.js";import"./shared-c4f15ea3.js";import"./shared-4e709717.js";import"./shared-a0c6a159.js";import"./shared-22ba9566.js";import"./shared-99940888.js";import"./shared-40af05b3.js";import"./shared-91d8985f.js";import"./shared-8da3186f.js";import"./shared-239062b0.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-4903b2e3.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-28ebee50.js";import"./shared-df51ee50.js";import"./foxy-pagination.js";import"./shared-c98881c7.js";import"./shared-8fc527b7.js";import"./shared-562d466d.js";import"./shared-8b5e05df.js";import"./shared-2e090291.js";import"./shared-c538157f.js";import"./shared-913e1955.js";import"./shared-9a59aab2.js";import"./shared-651c44fa.js";import"./shared-f893763a.js";import"./shared-97cfdcdb.js";import"./shared-9e360643.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";let r,l=e=>e;const d=t(e);customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-form",class extends d{constructor(){super(...arguments),this.__valuesInputParams={type:"number",step:"1",min:"1",max:"999"},this.__valuesGetValue=()=>{var e;return null===(e=this.form.values)||void 0===e?void 0:e.map((e=>{if(".5m"===e)return{value:e,label:this.t("values.twice_a_week")};const{units:t,count:i}=s(e);return{value:e,label:this.t(`values.${t}`,{count:i})}}))},this.__valuesSetValue=e=>{const t=e.filter((({value:e})=>parseFloat(e)<=999)).map((({unit:e,value:t})=>e?`${t}${e}`:t)).filter(((e,t,i)=>i.indexOf(e)===t));this.edit({values:t})}}static get v8n(){return[({jsonataQuery:e})=>!!e||"jsonata-query:v8n_required",({jsonataQuery:e})=>!e||e.length<=200||"jsonata-query:v8n_too_long",({values:e})=>!!e&&e.length>0||"values:v8n_required",({values:e})=>!e||e.length<=20||"values:v8n_too_long"]}get hiddenSelector(){return new i(`timestamps ${super.hiddenSelector}`.trim())}renderBody(){return o(r||(r=l` <foxy-internal-source-control infer="jsonata-query" property="jsonataQuery"> </foxy-internal-source-control> <foxy-internal-editable-list-control infer="values" .inputParams="${0}" .getValue="${0}" .setValue="${0}" .units="${0}"> </foxy-internal-editable-list-control> ${0} `),this.__valuesInputParams,this.__valuesGetValue,this.__valuesSetValue,[{label:this.t("values.unit_years"),value:"y"},{label:this.t("values.unit_months"),value:"m"},{label:this.t("values.unit_weeks"),value:"w"},{label:this.t("values.unit_days"),value:"d"}],super.renderBody())}});let u,c=e=>e;const p=t(a);customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-card",class extends p{renderBody(){var e;const{jsonataQuery:t,values:i}=null!==(e=this.data)&&void 0!==e?e:{},n=null==i?void 0:i.map((e=>{if(".5m"===e)return this.t("twice_a_week");const{units:t,count:i}=s(e);return this.t(t,{count:i})}));return o(u||(u=c` <section class="h-s flex flex-col justify-center leading-xs"> <p class="text-m font-medium min-w-0"> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> </p> <p class="text-s text-secondary min-w-0"> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> </p> </section> `),"*"===t?"title_all":"title_matching",{query:t},(null==i?void 0:i.length)?"subtitle_list":"subtitle_empty",{list:null==n?void 0:n.join(", ")})}});let f,h=e=>e;const m=t(e);customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-form",class extends m{constructor(){super(...arguments),this.__minmaxRestrictionsGetValue=()=>{const e=[],t=this.form;return t.min&&e.push("min"),t.max&&e.push("max"),e},this.__minmaxRestrictionsSetValue=e=>{const t=this.form;this.edit({min:e.includes("min")?t.min||"1m":null,max:e.includes("max")?t.max||"1y":null})},this.__minmaxRestrictionsOptions=[{label:"option_min",value:"min"},{label:"option_max",value:"max"}],this.__dayAndDateRestrictionsGetValue=()=>{var e;const t=null===(e=this.form.allowedDays)||void 0===e?void 0:e.type;return"day"===t?"days":"month"===t?"dates":"none"},this.__dayAndDateRestrictionsSetValue=e=>{"dates"===e?this.edit({allowedDays:{type:"month",days:[]}}):"days"===e?this.edit({allowedDays:{type:"day",days:[]}}):this.edit({allowedDays:null})},this.__dayAndDateRestrictionsOptions=[{label:"option_none",value:"none"},{label:"option_dates",value:"dates"},{label:"option_days",value:"days"}],this.__daysOfWeekGetValue=()=>{var e,t;return null!==(t=null===(e=this.form.allowedDays)||void 0===e?void 0:e.days.map((e=>String(e))))&&void 0!==t?t:[]},this.__daysOfWeekSetValue=e=>{this.edit({allowedDays:{type:"day",days:e.map(Number)}})},this.__daysOfWeekOptions=[{label:"option_1",value:"1"},{label:"option_2",value:"2"},{label:"option_3",value:"3"},{label:"option_4",value:"4"},{label:"option_5",value:"5"},{label:"option_6",value:"6"},{label:"option_7",value:"7"}],this.__datesOfMonthInputParams={type:"number",min:"1",max:"31",step:"1"},this.__datesOfMonthGetValue=()=>{var e,t;return null!==(t=null===(e=this.form.allowedDays)||void 0===e?void 0:e.days.map((e=>({value:String(e)}))))&&void 0!==t?t:[]},this.__datesOfMonthSetValue=e=>{this.edit({allowedDays:{type:"month",days:e.map((e=>parseInt(e.value))).filter((e=>Number.isInteger(e)&&e>=1&&e<=31))}})},this.__disallowedDatesInputParams={type:"date"},this.__disallowedDatesGetValue=()=>{var e,t;return null!==(t=null===(e=this.form.disallowedDates)||void 0===e?void 0:e.map((e=>({value:e}))))&&void 0!==t?t:[]},this.__disallowedDatesSetValue=e=>{this.edit({disallowedDates:e.map((e=>e.value))})}}static get v8n(){return[({jsonataQuery:e})=>!!e||"jsonata-query:v8n_required",({jsonataQuery:e})=>!e||e.length<=200||"jsonata-query:v8n_too_long",({disallowedDates:e})=>!e||e.length<=10||"disallowed-dates:v8n_too_long"]}get hiddenSelector(){var e,t;const s=["timestamps",super.hiddenSelector.toString()],o=this.form;return o.min||s.unshift("min"),o.max||s.unshift("max"),"day"!==(null===(e=o.allowedDays)||void 0===e?void 0:e.type)&&s.unshift("days-of-week"),"month"!==(null===(t=o.allowedDays)||void 0===t?void 0:t.type)&&s.unshift("dates-of-month"),new i(s.join(" ").trim())}renderBody(){return o(f||(f=h` <foxy-internal-source-control infer="jsonata-query" property="jsonataQuery"> </foxy-internal-source-control> <foxy-internal-checkbox-group-control infer="minmax-restrictions" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-frequency-control infer="min"></foxy-internal-frequency-control> <foxy-internal-frequency-control infer="max"></foxy-internal-frequency-control> <foxy-internal-radio-group-control infer="day-and-date-restrictions" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-checkbox-group-control infer="days-of-week" theme="vertical" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-editable-list-control infer="dates-of-month" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-editable-list-control infer="disallowed-dates" range="optional" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> ${0} `),this.__minmaxRestrictionsGetValue,this.__minmaxRestrictionsSetValue,this.__minmaxRestrictionsOptions,this.__dayAndDateRestrictionsGetValue,this.__dayAndDateRestrictionsSetValue,this.__dayAndDateRestrictionsOptions,this.__daysOfWeekGetValue,this.__daysOfWeekSetValue,this.__daysOfWeekOptions,this.__datesOfMonthInputParams,this.__datesOfMonthGetValue,this.__datesOfMonthSetValue,this.__disallowedDatesInputParams,this.__disallowedDatesGetValue,this.__disallowedDatesSetValue,super.renderBody())}});let y,_=e=>e;const v=t(a);function x(e){try{return new URL(e).origin===e.toLowerCase()}catch(e){return!1}}customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-card",class extends v{renderBody(){var e;const{min:t,max:i,allowedDays:s,jsonataQuery:a,disallowedDates:r}=null!==(e=this.data)&&void 0!==e?e:{},l=t?n(t):void 0,d=i?n(i):void 0,u="*"===a?"line_1_all":"line_1_matching",c={query:a},p={from:l?this.t(`unit_${l.units}`,{count:l.count}):this.t("any"),to:d?this.t(`unit_${d.units}`,{count:d.count}):this.t("any")},f=`line_3_${s?s.type:"any"}`,h={list:"month"===(null==s?void 0:s.type)?null==s?void 0:s.days.join(", "):null==s?void 0:s.days.map((e=>this.t(`day_${e}`))).join(", ")},m=r?"line_4_some":"line_4_none",v={list:null==r?void 0:r.map((e=>{const[t,i]=e.split("..");return t&&i?this.t("date_range",{from:t,to:i}):this.t("single_date",{value:e})})).join(", ")};return o(y||(y=_` <section class="leading-xs" style="margin:-.25ch 0"> <p class="text-m font-medium truncate"> <foxy-i18n infer="" key="${0}" .options="${0}"></foxy-i18n> </p> <p class="text-s text-secondary"> <foxy-i18n infer="" class="block truncate" key="line_2" .options="${0}"> </foxy-i18n> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> </p> </section> `),u,c,p,f,h,m,v)}});let g,b=e=>e;const j=t(e,"customer-portal-settings-form");class w extends j{constructor(){super(...arguments),this.__sessionLifespanInMinutesOptions=[{value:"m",label:"option_minute"},{value:"h",label:"option_hour"},{value:"d",label:"option_day"},{value:"w",label:"option_week"}],this.__sessionLifespanInMinutesGetValue=()=>{var e;const t=null!==(e=this.form.sessionLifespanInMinutes)&&void 0!==e?e:0;return t%10080==0?t/10080+"w":t%1440==0?t/1440+"d":t%60==0?t/60+"h":`${t}m`},this.__sessionLifespanInMinutesSetValue=e=>{const t=parseInt(e);e.endsWith("w")?this.edit({sessionLifespanInMinutes:10080*t}):e.endsWith("d")?this.edit({sessionLifespanInMinutes:1440*t}):e.endsWith("h")?this.edit({sessionLifespanInMinutes:60*t}):this.edit({sessionLifespanInMinutes:t})},this.__allowedOriginsGetValue=()=>{var e;return null===(e=this.form.allowedOrigins)||void 0===e?void 0:e.map((e=>({label:x(e)?e:`⚠️ ${e}`,value:e})))},this.__allowedOriginsSetValue=e=>{this.edit({allowedOrigins:e.map((({value:e})=>function(e){try{return new URL(e).origin}catch(t){return e}}(e))).filter(((e,t,i)=>i.indexOf(e)===t))})},this.__featuresOptions=[{value:"sso",label:"option_sso"},{value:"sign-up",label:"option_sign_up"},{value:"frequency-modification",label:"option_frequency_modification"},{value:"next-date-modification",label:"option_next_date_modification"}],this.__featuresGetValue=()=>{var e,t,i;const s=[];return this.form.sso&&s.push("sso"),(null===(e=this.form.signUp)||void 0===e?void 0:e.enabled)&&s.push("sign-up"),(null===(t=this.form.subscriptions)||void 0===t?void 0:t.allowNextDateModification)&&s.push("next-date-modification"),(null===(i=this.form.subscriptions)||void 0===i?void 0:i.allowFrequencyModification.length)&&s.push("frequency-modification"),s},this.__featuresSetValue=e=>{var t,i,s,o,n;const a=null!==(i=null===(t=this.form.subscriptions)||void 0===t?void 0:t.allowFrequencyModification)&&void 0!==i?i:[];this.edit({sso:e.includes("sso"),signUp:{enabled:e.includes("sign-up"),verification:null!==(o=null===(s=this.form.signUp)||void 0===s?void 0:s.verification)&&void 0!==o?o:{type:"hcaptcha",siteKey:"",secretKey:""}},subscriptions:{allowFrequencyModification:e.includes("frequency-modification")?0===a.length?[{jsonataQuery:"*",values:[]}]:a:[],allowNextDateModification:!!e.includes("next-date-modification")&&((null===(n=this.form.subscriptions)||void 0===n?void 0:n.allowNextDateModification)||[])}})},this.__signUpVerificationHcaptchaSiteKeyGetValue=()=>{var e,t,i;return null!==(i=null===(t=null===(e=this.form.signUp)||void 0===e?void 0:e.verification)||void 0===t?void 0:t.siteKey)&&void 0!==i?i:""},this.__signUpVerificationHcaptchaSiteKeySetValue=e=>{var t,i,s,o;this.edit({signUp:{enabled:!!(null===(t=this.form.signUp)||void 0===t?void 0:t.enabled),verification:{secretKey:null!==(o=null===(s=null===(i=this.form.signUp)||void 0===i?void 0:i.verification)||void 0===s?void 0:s.secretKey)&&void 0!==o?o:"",siteKey:e,type:"hcaptcha"}}})},this.__signUpVerificationHcaptchaSecretKeyGetValue=()=>{var e,t,i;return null!==(i=null===(t=null===(e=this.form.signUp)||void 0===e?void 0:e.verification)||void 0===t?void 0:t.secretKey)&&void 0!==i?i:""},this.__signUpVerificationHcaptchaSecretKeySetValue=e=>{var t,i,s,o;this.edit({signUp:{enabled:!!(null===(t=this.form.signUp)||void 0===t?void 0:t.enabled),verification:{secretKey:e,siteKey:null!==(o=null===(s=null===(i=this.form.signUp)||void 0===i?void 0:i.verification)||void 0===s?void 0:s.siteKey)&&void 0!==o?o:"",type:"hcaptcha"}}})},this.__jwtSecretGeneratorOptions={charset:"abcdefghijklmnopqrstuvwxyz0123456789",length:64}}static get v8n(){return[({sessionLifespanInMinutes:e})=>"number"!=typeof e||e<=40320||"session-lifespan-in-minutes:v8n_too_long",({allowedOrigins:e=[]})=>e.length<=10||"allowed-origins:v8n_too_many",({allowedOrigins:e=[]})=>e.every(x)||"allowed-origins:v8n_invalid",({jwtSharedSecret:e})=>!e||/^[a-z0-9-]+$/.test(e)||"jwt-shared-secret:v8n_invalid",({jwtSharedSecret:e})=>!e||e.length>=40||"jwt-shared-secret:v8n_too_short",({jwtSharedSecret:e})=>!e||e.length<=100||"jwt-shared-secret:v8n_too_long",({signUp:e})=>{const t=null==e?void 0:e.verification.siteKey;return!t||t.length<=100||"sign-up-verification-hcaptcha-site-key:v8n_too_long"},({signUp:e})=>{const t=null==e?void 0:e.verification.secretKey;return!t||t.length<=100||"sign-up-verification-hcaptcha-secret-key:v8n_too_long"}]}get hiddenSelector(){var e,t,s;const o=["header:copy-id",super.hiddenSelector.toString()];return(null===(e=this.form.signUp)||void 0===e?void 0:e.enabled)||o.push("sign-up-verification-hcaptcha-site-key","sign-up-verification-hcaptcha-secret-key"),(null===(t=this.form.subscriptions)||void 0===t?void 0:t.allowFrequencyModification.length)||o.push("subscriptions-allow-frequency-modification"),(null===(s=this.form.subscriptions)||void 0===s?void 0:s.allowNextDateModification)||o.push("subscriptions-allow-next-date-modification"),new i(o.join(" ").trim())}renderBody(){return o(g||(g=b` ${0} <foxy-internal-editable-list-control infer="allowed-origins" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-checkbox-group-control infer="features" theme="vertical" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-password-control infer="sign-up-verification-hcaptcha-site-key" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> <foxy-internal-password-control infer="sign-up-verification-hcaptcha-secret-key" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> <foxy-internal-async-list-control first="foxy://${0}/form/subscriptions/allowFrequencyModification" infer="subscriptions-allow-frequency-modification" limit="20" form="foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-form" item="foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-card" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control first="foxy://${0}/form/subscriptions/allowNextDateModification" infer="subscriptions-allow-next-date-modification" limit="20" form="foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-form" item="foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-card" alert> </foxy-internal-async-list-control> <foxy-internal-frequency-control infer="session-lifespan-in-minutes" max="" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-frequency-control> <foxy-internal-password-control property="jwtSharedSecret" infer="jwt-shared-secret" show-generator .generatorOptions="${0}"> </foxy-internal-password-control> ${0} `),this.renderHeader(),this.__allowedOriginsGetValue,this.__allowedOriginsSetValue,this.__featuresGetValue,this.__featuresSetValue,this.__featuresOptions,this.__signUpVerificationHcaptchaSiteKeyGetValue,this.__signUpVerificationHcaptchaSiteKeySetValue,this.__signUpVerificationHcaptchaSecretKeyGetValue,this.__signUpVerificationHcaptchaSecretKeySetValue,this.virtualHost,this.virtualHost,this.__sessionLifespanInMinutesGetValue,this.__sessionLifespanInMinutesSetValue,this.__sessionLifespanInMinutesOptions,this.__jwtSecretGeneratorOptions,super.renderBody())}async _sendPost(e){return this.__removeNullProperties(e),super._sendPost(e)}async _sendPatch(e){return this.__removeNullProperties(e),super._sendPatch(e)}__removeNullProperties(e){var t,i;"object"==typeof(null===(t=e.subscriptions)||void 0===t?void 0:t.allowNextDateModification)&&(null===(i=e.subscriptions)||void 0===i||i.allowNextDateModification.forEach((e=>{for(const t in e){const i=t;null===e[i]&&delete e[i]}})))}}customElements.define("foxy-customer-portal-settings-form",w);export{w as CustomerPortalSettingsForm};