@foxy.io/elements 1.23.0-beta.1 → 1.23.0-beta.3

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 (195) 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-api-browser.js +2 -3
  6. package/dist/cdn/foxy-applied-coupon-code-card.js +1 -1
  7. package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
  8. package/dist/cdn/foxy-applied-tax-card.js +1 -1
  9. package/dist/cdn/foxy-attribute-card.js +1 -1
  10. package/dist/cdn/foxy-attribute-form.js +1 -1
  11. package/dist/cdn/foxy-cancellation-form.js +1 -1
  12. package/dist/cdn/foxy-cart-card.js +1 -1
  13. package/dist/cdn/foxy-cart-form.js +1 -1
  14. package/dist/cdn/foxy-collection-page.js +1 -1
  15. package/dist/cdn/foxy-collection-pages.js +1 -1
  16. package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
  17. package/dist/cdn/foxy-coupon-card.js +1 -1
  18. package/dist/cdn/foxy-coupon-code-form.js +1 -1
  19. package/dist/cdn/foxy-coupon-codes-form.js +1 -1
  20. package/dist/cdn/foxy-coupon-detail-card.js +1 -1
  21. package/dist/cdn/foxy-coupon-form.js +1 -1
  22. package/dist/cdn/foxy-custom-field-card.js +1 -1
  23. package/dist/cdn/foxy-custom-field-form.js +1 -1
  24. package/dist/cdn/foxy-customer-card.js +1 -1
  25. package/dist/cdn/foxy-customer-form.js +1 -1
  26. package/dist/cdn/foxy-customer-portal-settings.js +1 -1
  27. package/dist/cdn/foxy-customer-portal.js +1 -1
  28. package/dist/cdn/foxy-customer.js +1 -1
  29. package/dist/cdn/foxy-customers-table.js +1 -1
  30. package/dist/cdn/foxy-discount-builder.js +1 -1
  31. package/dist/cdn/foxy-discount-card.js +1 -1
  32. package/dist/cdn/foxy-discount-detail-card.js +1 -1
  33. package/dist/cdn/foxy-donation.js +1 -1
  34. package/dist/cdn/foxy-downloadable-card.js +1 -1
  35. package/dist/cdn/foxy-downloadable-form.js +1 -1
  36. package/dist/cdn/foxy-email-template-card.js +1 -1
  37. package/dist/cdn/foxy-email-template-form.js +1 -1
  38. package/dist/cdn/foxy-error-entry-card.js +1 -1
  39. package/dist/cdn/foxy-form-dialog.js +1 -1
  40. package/dist/cdn/foxy-generate-codes-form.js +1 -1
  41. package/dist/cdn/foxy-gift-card-card.js +1 -1
  42. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  43. package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
  44. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  45. package/dist/cdn/foxy-gift-card-form.js +1 -1
  46. package/dist/cdn/foxy-i18n-editor.js +2 -2
  47. package/dist/cdn/foxy-i18n.js +1 -1
  48. package/dist/cdn/foxy-integration-card.js +1 -1
  49. package/dist/cdn/foxy-integration-form.js +1 -1
  50. package/dist/cdn/foxy-item-card.js +1 -1
  51. package/dist/cdn/foxy-item-category-card.js +1 -1
  52. package/dist/cdn/foxy-item-category-form.js +1 -1
  53. package/dist/cdn/foxy-item-form.js +1 -1
  54. package/dist/cdn/foxy-item-option-card.js +1 -1
  55. package/dist/cdn/foxy-item-option-form.js +1 -1
  56. package/dist/cdn/foxy-items-form.js +1 -1
  57. package/dist/cdn/foxy-pagination.js +1 -1
  58. package/dist/cdn/foxy-payment-card.js +1 -1
  59. package/dist/cdn/foxy-payment-method-card.js +1 -1
  60. package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
  61. package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
  62. package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
  63. package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
  64. package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
  65. package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
  66. package/dist/cdn/foxy-payments-api.js +1 -1
  67. package/dist/cdn/foxy-query-builder.js +1 -1
  68. package/dist/cdn/foxy-report-form.js +1 -1
  69. package/dist/cdn/foxy-reports-table.js +1 -1
  70. package/dist/cdn/foxy-shipment-card.js +1 -1
  71. package/dist/cdn/foxy-shipping-method-card.js +1 -1
  72. package/dist/cdn/foxy-sign-in-form.js +1 -1
  73. package/dist/cdn/foxy-spinner.js +1 -1
  74. package/dist/cdn/foxy-store-card.js +1 -1
  75. package/dist/cdn/foxy-store-form.js +1 -1
  76. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  77. package/dist/cdn/foxy-subscription-card.js +1 -1
  78. package/dist/cdn/foxy-subscription-form.js +3 -3
  79. package/dist/cdn/foxy-subscription-settings-form.js +1 -1
  80. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  81. package/dist/cdn/foxy-table.js +1 -1
  82. package/dist/cdn/foxy-tax-card.js +1 -1
  83. package/dist/cdn/foxy-tax-form.js +1 -1
  84. package/dist/cdn/foxy-template-config-form.js +1 -1
  85. package/dist/cdn/foxy-template-form.js +1 -1
  86. package/dist/cdn/foxy-template-set-card.js +1 -1
  87. package/dist/cdn/foxy-template-set-form.js +1 -1
  88. package/dist/cdn/foxy-transaction-card.js +1 -1
  89. package/dist/cdn/foxy-transaction.js +1 -1
  90. package/dist/cdn/foxy-transactions-table.js +1 -1
  91. package/dist/cdn/foxy-user-card.js +1 -1
  92. package/dist/cdn/foxy-user-form.js +1 -1
  93. package/dist/cdn/foxy-users-table.js +1 -1
  94. package/dist/cdn/foxy-webhook-card.js +1 -1
  95. package/dist/cdn/foxy-webhook-form.js +1 -1
  96. package/dist/cdn/foxy-webhook-log-card.js +1 -1
  97. package/dist/cdn/foxy-webhook-status-card.js +1 -1
  98. package/dist/cdn/{shared-5570ac69.js → shared-03b39ec4.js} +1 -1
  99. package/dist/cdn/{shared-df1816e8.js → shared-0543c6e0.js} +1 -1
  100. package/dist/cdn/{shared-14bb06d4.js → shared-068480a3.js} +1 -1
  101. package/dist/cdn/{shared-049d80d0.js → shared-08ff9a8d.js} +1 -1
  102. package/dist/cdn/{shared-b39fce1b.js → shared-0c02b4ee.js} +1 -1
  103. package/dist/cdn/{shared-3d6f0788.js → shared-0dc1d012.js} +1 -1
  104. package/dist/cdn/{shared-04634a6f.js → shared-16b542bc.js} +1 -1
  105. package/dist/cdn/{shared-0dd25feb.js → shared-1e5292a1.js} +1 -1
  106. package/dist/cdn/{shared-faad86eb.js → shared-23923638.js} +1 -1
  107. package/dist/cdn/{shared-bed220d3.js → shared-29aa4bca.js} +1 -1
  108. package/dist/cdn/{shared-a7347e96.js → shared-380db651.js} +1 -1
  109. package/dist/cdn/{shared-7fd77eed.js → shared-39761436.js} +1 -1
  110. package/dist/cdn/{shared-07e32de2.js → shared-3a252ccd.js} +1 -1
  111. package/dist/cdn/{shared-491c9063.js → shared-3a82d3f5.js} +1 -1
  112. package/dist/cdn/{shared-bb226a47.js → shared-43520428.js} +1 -1
  113. package/dist/cdn/shared-49d978e1.js +1 -0
  114. package/dist/cdn/{shared-ac05532a.js → shared-4abfda9b.js} +1 -1
  115. package/dist/cdn/{shared-98eec370.js → shared-4c9f96ec.js} +1 -1
  116. package/dist/cdn/{shared-40638f2c.js → shared-4db2c7b1.js} +4 -4
  117. package/dist/cdn/{shared-f19f05e1.js → shared-53fee01f.js} +1 -1
  118. package/dist/cdn/{shared-50908853.js → shared-5dd31b4e.js} +1 -1
  119. package/dist/cdn/{shared-cf65fcc7.js → shared-61a510d8.js} +1 -1
  120. package/dist/cdn/{shared-0237bfae.js → shared-6b53ef85.js} +2 -2
  121. package/dist/cdn/{shared-163e5fdb.js → shared-6bfa699d.js} +1 -1
  122. package/dist/cdn/{shared-ab69c97b.js → shared-6eb7dc77.js} +1 -1
  123. package/dist/cdn/{shared-4494ebfa.js → shared-6f465111.js} +1 -1
  124. package/dist/cdn/{shared-ec3332b9.js → shared-6fb923d5.js} +1 -1
  125. package/dist/cdn/{shared-f0c8a5bd.js → shared-7a290f36.js} +1 -1
  126. package/dist/cdn/{shared-394c2425.js → shared-7bf46d6d.js} +1 -1
  127. package/dist/cdn/{shared-c7954521.js → shared-7c5754a4.js} +1 -1
  128. package/dist/cdn/{shared-f23627ae.js → shared-8349938a.js} +1 -1
  129. package/dist/cdn/{shared-af7cde22.js → shared-85bc54a6.js} +1 -1
  130. package/dist/cdn/{shared-d1c45954.js → shared-86768244.js} +1 -1
  131. package/dist/cdn/{shared-a959c0d9.js → shared-8b73191b.js} +1 -1
  132. package/dist/cdn/{shared-726c0b56.js → shared-9048c076.js} +1 -1
  133. package/dist/cdn/{shared-539cde4d.js → shared-939fc890.js} +1 -1
  134. package/dist/cdn/{shared-80792dc8.js → shared-9e60ef60.js} +1 -1
  135. package/dist/cdn/{shared-bbb8ec69.js → shared-a6518411.js} +1 -1
  136. package/dist/cdn/{shared-ffd03d7b.js → shared-ad396f3c.js} +1 -1
  137. package/dist/cdn/{shared-64f2d6de.js → shared-aeec3cab.js} +1 -1
  138. package/dist/cdn/{shared-00b50abf.js → shared-b88e35b7.js} +1 -1
  139. package/dist/cdn/{shared-bdd5c908.js → shared-b95ef318.js} +1 -1
  140. package/dist/cdn/{shared-d2384b7b.js → shared-bb009254.js} +1 -1
  141. package/dist/cdn/{shared-694297c2.js → shared-bd81cc08.js} +1 -1
  142. package/dist/cdn/{shared-8ac00abe.js → shared-c3c67413.js} +1 -1
  143. package/dist/cdn/{shared-27d23dfd.js → shared-c40d85dc.js} +1 -1
  144. package/dist/cdn/{shared-313a39ef.js → shared-ca58ef47.js} +1 -1
  145. package/dist/cdn/{shared-025cab8b.js → shared-cb6f2388.js} +1 -1
  146. package/dist/cdn/{shared-520be2e9.js → shared-cd096e97.js} +1 -1
  147. package/dist/cdn/{shared-1e55acbb.js → shared-d493355a.js} +1 -1
  148. package/dist/cdn/{shared-797b6161.js → shared-dcbaa1c5.js} +1 -1
  149. package/dist/cdn/{shared-acda8da2.js → shared-e28f16db.js} +1 -1
  150. package/dist/cdn/{shared-77a700fe.js → shared-e5c19ea3.js} +1 -1
  151. package/dist/cdn/shared-e6066f46.js +2 -0
  152. package/dist/cdn/{shared-e7ce4e47.js → shared-eb4b4597.js} +1 -1
  153. package/dist/cdn/{shared-b34bef61.js → shared-ee13d1a6.js} +1 -1
  154. package/dist/cdn/{shared-7c761c65.js → shared-f3f5e87e.js} +1 -1
  155. package/dist/cdn/{shared-3206f265.js → shared-fbfb0943.js} +1 -1
  156. package/dist/cdn/translations/api-browser/en.json +4 -0
  157. package/dist/cdn/translations/email-template-form/en.json +9 -7
  158. package/dist/cdn/translations/template-form/en.json +9 -7
  159. package/dist/elements/internal/InternalSourceControl/InternalSourceControl.d.ts +18 -0
  160. package/dist/elements/internal/InternalSourceControl/InternalSourceControl.js +160 -0
  161. package/dist/elements/internal/InternalSourceControl/InternalSourceControl.js.map +1 -0
  162. package/dist/elements/internal/InternalSourceControl/index.d.ts +3 -0
  163. package/dist/elements/internal/InternalSourceControl/index.js +5 -0
  164. package/dist/elements/internal/InternalSourceControl/index.js.map +1 -0
  165. package/dist/elements/public/ApiBrowser/internal/InternalApiBrowserResourceForm/InternalApiBrowserResourceForm.d.ts +0 -2
  166. package/dist/elements/public/ApiBrowser/internal/InternalApiBrowserResourceForm/InternalApiBrowserResourceForm.js +27 -43
  167. package/dist/elements/public/ApiBrowser/internal/InternalApiBrowserResourceForm/InternalApiBrowserResourceForm.js.map +1 -1
  168. package/dist/elements/public/ApiBrowser/internal/InternalApiBrowserResourceForm/index.d.ts +1 -0
  169. package/dist/elements/public/ApiBrowser/internal/InternalApiBrowserResourceForm/index.js +1 -0
  170. package/dist/elements/public/ApiBrowser/internal/InternalApiBrowserResourceForm/index.js.map +1 -1
  171. package/dist/elements/public/EmailTemplateForm/EmailTemplateForm.d.ts +9 -7
  172. package/dist/elements/public/EmailTemplateForm/EmailTemplateForm.js +66 -60
  173. package/dist/elements/public/EmailTemplateForm/EmailTemplateForm.js.map +1 -1
  174. package/dist/elements/public/EmailTemplateForm/index.d.ts +1 -1
  175. package/dist/elements/public/EmailTemplateForm/index.js +1 -1
  176. package/dist/elements/public/EmailTemplateForm/index.js.map +1 -1
  177. package/dist/elements/public/PaymentsApi/PaymentsApi.d.ts +53 -7
  178. package/dist/elements/public/PaymentsApi/PaymentsApi.js +75 -12
  179. package/dist/elements/public/PaymentsApi/PaymentsApi.js.map +1 -1
  180. package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.d.ts +0 -4
  181. package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.js +66 -118
  182. package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.js.map +1 -1
  183. package/dist/elements/public/TemplateConfigForm/index.d.ts +1 -1
  184. package/dist/elements/public/TemplateConfigForm/index.js +1 -1
  185. package/dist/elements/public/TemplateConfigForm/index.js.map +1 -1
  186. package/dist/elements/public/TemplateForm/TemplateForm.d.ts +4 -3
  187. package/dist/elements/public/TemplateForm/TemplateForm.js +49 -50
  188. package/dist/elements/public/TemplateForm/TemplateForm.js.map +1 -1
  189. package/dist/elements/public/TemplateForm/index.d.ts +1 -1
  190. package/dist/elements/public/TemplateForm/index.js +1 -1
  191. package/dist/elements/public/TemplateForm/index.js.map +1 -1
  192. package/dist/mixins/themeable.js +14 -4
  193. package/dist/mixins/themeable.js.map +1 -1
  194. package/package.json +1 -1
  195. package/dist/cdn/shared-44594184.js +0 -1
@@ -1 +1 @@
1
- import"./shared-313a39ef.js";import"./shared-acda8da2.js";import"./shared-bdd5c908.js";import"./shared-77a700fe.js";import"./shared-0479553e.js";import"./foxy-spinner.js";import"./shared-d1c45954.js";import{_ as e}from"./shared-98755831.js";import{l as t}from"./shared-99065f2a.js";import{C as s,a as i}from"./shared-b34bef61.js";import{h as o}from"./shared-7f33a83a.js";import{C as n}from"./shared-ffd03d7b.js";import{C as a}from"./shared-de790de9.js";import{N as r}from"./shared-eb900735.js";import{T as d,a as l,S as c,R as u}from"./shared-04634a6f.js";import{c as h}from"./shared-4e709717.js";import{i as g}from"./shared-d3bf9ac0.js";import{G as p}from"./shared-049d80d0.js";import{l as f}from"./shared-f3b35364.js";import"./shared-f0c8a5bd.js";import"./shared-27d23dfd.js";import"./shared-98eec370.js";import"./shared-a8cf402a.js";import"./shared-64657919.js";import"./shared-4494ebfa.js";import"./shared-64f2d6de.js";import"./shared-7c761c65.js";import"./shared-14bb06d4.js";import"./shared-df1816e8.js";import"./shared-40638f2c.js";import"./shared-11c2efc8.js";import"./shared-a89cb472.js";import"./shared-509a2f52.js";import"./shared-d6276c83.js";let _,y,x,b,m,$=e=>e;const v=a(d(l(r)));class k extends v{constructor(){super(...arguments),this.regions=[],this.name="",this.code="",this.__newRegion=""}static get properties(){return e(e({},super.properties),{},{__newRegion:{attribute:!1},regions:{type:Array},name:{type:String},code:{type:String}})}render(){var e,t;return o(_||(_=$` <div class="${0}"> <div data-testid="country" class="h-m flex justify-between items-center border-b border-contrast-10"> <div class="ml-m"> <span>${0}</span> ${0} </div> <button aria-label="${0}" class="${0}" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m"></iron-icon> </button> </div> <div data-testid="regions" class="flex flex-wrap p-xs"> ${0} <div data-testid="new-region" style="border-radius:var(--lumo-size-s)" class="${0}"> <input placeholder="${0}" class="bg-transparent appearance-none h-s text-s px-s focus-outline-none" style="width:8rem" list="list" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> <button style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:add" class="icon-inline text-m"></iron-icon> </button> </div> <datalist id="list"> ${0} </datalist> </div> </div> `),h({"border border-contrast-10 rounded text-s":!0,"text-disabled":this.disabled}),this.name||this.code,this.name?o(y||(y=$`<span class="text-secondary">${0}</span>`),this.code):"",this.t("delete"),h({"mr-xs items-center justify-center rounded-full transition-colors":!0,"hover-bg-error-10 hover-text-error":!this.disabled,"focus-outline-none focus-ring-2 ring-inset ring-error-50":!this.disabled,"cursor-default":this.disabled,flex:!this.readonly,hidden:this.readonly}),this.disabled,(()=>this.dispatchEvent(new CustomEvent("delete"))),this.regions.map((e=>{var t,s;const i=null===(s=null===(t=this.data)||void 0===t?void 0:t.values[e])||void 0===s?void 0:s.default;return o(x||(x=$` <div class="flex items-center border border-contrast-10 h-s m-xs" style="border-radius:var(--lumo-size-s)"> <span class="mx-s"> <span>${0}</span> ${0} </span> <button aria-label="${0}" class="${0}" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m"></iron-icon> </button> </div> `),i||e,i?o(b||(b=$`<span class="text-secondary">${0}</span>`),e):"",this.t("delete"),h({"items-center justify-center rounded-full transition-colors":!0,"hover-bg-error-10 hover-text-error":!this.disabled,"focus-outline-none focus-ring-2 ring-inset ring-error-50":!this.disabled,"cursor-default":this.disabled,flex:!this.readonly,hidden:this.readonly}),this.disabled,(()=>{this.regions=this.regions.filter((t=>t!==e)),this.dispatchEvent(new CustomEvent("update:regions"))}))})),h({"h-s m-xs items-center transition-colors border border-contrast-10":!0,"hover-border-contrast-40":!this.disabled,"focus-within-ring-1 ring-primary-50 focus-within-border-primary-50":!this.disabled,flex:!this.readonly,hidden:this.readonly}),this.t("add_region"),this.__newRegion,this.disabled,this.readonly,(e=>{"Enter"===e.key&&this.__newRegion&&this.__addRegion()}),(e=>{const t=e.currentTarget;this.__newRegion=t.value}),h({"flex-shrink-0":!0,"flex items-center justify-center rounded-full transition-colors":!0,"bg-contrast-5 text-disabled cursor-default":!this.__newRegion,"bg-success-10 text-success cursor-pointer":!!this.__newRegion,"hover-bg-success hover-text-success-contrast":!!this.__newRegion,"focus-outline-none focus-ring-2 ring-inset ring-success-50":!!this.__newRegion}),this.disabled||!this.__newRegion,this.__addRegion,Object.values(null!==(t=null===(e=this.data)||void 0===e?void 0:e.values)&&void 0!==t?t:{}).map((e=>o(m||(m=$`<option value="${0}">${0}</option>`),e.code,e.default))))}__addRegion(){this.regions=[...new Set([...this.regions,this.__newRegion])],this.__newRegion="",this.dispatchEvent(new CustomEvent("update:regions"))}}let w,S,j,O=e=>e;const T=c(a(d(l(r))));class q extends T{constructor(){super(...arguments),this.countries={},this.regions="",this.__newCountry=""}static get scopedElements(){return{"x-country-card":k,"iron-icon":customElements.get("iron-icon")}}static get properties(){return e(e({},super.properties),{},{__newCountry:{attribute:!1},countries:{type:Object},regions:{type:String}})}render(){var t,s;return o(w||(w=O` <div> <div class="space-y-s" data-testid="countries"> ${0} <div data-testid="new-country" class="${0}"> <input placeholder="${0}" class="w-full bg-transparent appearance-none h-m text-s px-m focus-outline-none" list="list" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> <button aria-label="${0}" class="${0}" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:add" class="icon-inline text-m"></iron-icon> </button> </div> </div> <datalist id="list"> ${0} </datalist> </div> `),Object.entries(this.countries).map((([t,s])=>{var i,n;let a;try{const e=new URL(this.regions);e.searchParams.set("country_code",t),a=e.toString()}catch(e){a=""}return o(S||(S=O` <x-country-card regions="${0}" code="${0}" name="${0}" href="${0}" lang="${0}" ns="${0}" ?disabled="${0}" ?readonly="${0}" @update:regions="${0}" @delete="${0}"> </x-country-card> `),JSON.stringify("*"===s?[]:s),t,g(null===(n=null===(i=this.data)||void 0===i?void 0:i.values[t])||void 0===n?void 0:n.default),a,this.lang,this.ns,this.disabled,this.readonly,(s=>{const i=e({},this.countries),o=s.currentTarget.regions;i[t]=o.length?o:"*",this.countries=i,this.dispatchEvent(new CustomEvent("update:countries"))}),(()=>{const s=e({},this.countries);delete s[t],this.countries=s,this.dispatchEvent(new CustomEvent("update:countries"))}))})),h({"h-m flex items-center rounded transition-colors":!0,"border border-contrast-10 ring-primary-50":!0,"hover-border-contrast-40":!this.disabled,"focus-within-ring-1 focus-within-border-primary-50":!this.disabled,flex:!this.readonly,hidden:this.readonly}),this.t("add_country"),this.__newCountry,this.disabled,this.readonly,(e=>{"Enter"===e.key&&this.__newCountry&&this.__addCountry()}),(e=>{const t=e.currentTarget;this.__newCountry=t.value}),this.t("create"),h({"mr-xs flex-shrink-0":!0,"flex items-center justify-center rounded-full transition-colors":!0,"bg-contrast-5 text-disabled cursor-default":!this.__newCountry,"bg-success-10 text-success cursor-pointer":!!this.__newCountry,"hover-bg-success hover-text-success-contrast":!!this.__newCountry,"focus-outline-none focus-ring-2 ring-inset ring-success-50":!!this.__newCountry}),!this.__newCountry||this.disabled,this.__addCountry,Object.entries(null!==(s=null===(t=this.data)||void 0===t?void 0:t.values)&&void 0!==s?s:{}).map((([e,t])=>o(j||(j=O`<option value="${0}">${0}</option>`),e,t.default))))}__addCountry(){this.countries=e(e({},this.countries),{},{[this.__newCountry]:"*"}),this.__newCountry="",this.dispatchEvent(new CustomEvent("update:countries"))}}let C,J,N,E,F,R,H,I,V,z,A,D,G,L,U,B,P,M,W,K,Q,X,Y,Z,ee,te,se,ie=e=>e;const oe=c(u(a(d(l(r,"template-config-form")))));class ne extends oe{constructor(){super(...arguments),this.templates={},this.countries="",this.regions="",this.__addHiddenFieldInputValue=""}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-text-area":customElements.get("vaadin-text-area"),"iron-icon":customElements.get("iron-icon"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"x-countries-list":q,"x-checkbox":n,"x-choice":s,"x-group":p}}static get properties(){return e(e({},super.properties),{},{__addHiddenFieldInputValue:{attribute:!1},countries:{type:String},regions:{type:String}})}render(){var e,t;const s=this.hiddenSelector,i=this.form.json?JSON.parse(this.form.json):{cart_type:"default",checkout_type:"default_account",csc_requirements:"all_cards",tos_checkbox_settings:{usage:"none",initial_state:"unchecked",is_hidden:!1,url:""},eu_secure_data_transfer_consent:{usage:"required"},newsletter_subscribe:{usage:"none"},analytics_config:{usage:"none",google_analytics:{usage:"none",account_id:"",include_on_site:!1},google_tag:{usage:"none",send_to:"",account_id:""}},colors:{usage:"none",primary:"4D4D4D",secondary:"FFFFFF",tertiary:"FFFFFF"},use_checkout_confirmation_window:{usage:"none"},supported_payment_cards:["visa","mastercard","discover","amex"],custom_checkout_field_requirements:{cart_controls:"enabled",coupon_entry:"enabled",billing_first_name:"required",billing_last_name:"required",billing_company:"optional",billing_tax_id:"hidden",billing_phone:"optional",billing_address1:"required",billing_address2:"optional",billing_city:"required",billing_region:"default",billing_postal_code:"required",billing_country:"required"},cart_display_config:{usage:"none",show_product_weight:!0,show_product_category:!0,show_product_code:!0,show_product_options:!0,show_sub_frequency:!0,show_sub_startdate:!0,show_sub_nextdate:!0,show_sub_enddate:!0,hidden_product_options:[]},foxycomplete:{usage:"required",show_combobox:!0,combobox_open:"\\u25bc",combobox_close:"\\u25b2",show_flags:!0},custom_script_values:{header:"",footer:"",checkout_fields:"",multiship_checkout_fields:""},http_receipt:!1,custom_config:"",debug:{usage:"none"},location_filtering:{usage:"none",shipping_filter_type:"blacklist",billing_filter_type:"blacklist",shipping_filter_values:{},billing_filter_values:{}},postal_code_lookup:{usage:"enabled"}};return o(C||(C=ie` <div class="relative" aria-busy="${0}" aria-live="polite"> <div class="space-y-l"> ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} </div> <div class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.in("busy"),s.matches("cart-type",!0)?"":this.__renderCartType(i),s.matches("foxycomplete",!0)?"":this.__renderFoxycomplete(i),s.matches("locations",!0)?"":this.__renderLocations(i),s.matches("hidden-fields",!0)?"":this.__renderHiddenFields(i),s.matches("cards",!0)?"":this.__renderCards(i),s.matches("checkout-type",!0)?"":this.__renderCheckoutType(i),s.matches("consent",!0)?"":this.__renderConsent(i),s.matches("fields",!0)?"":this.__renderFields(i),s.matches("google-analytics",!0)?"":this.__renderGoogleAnalytics(i),s.matches("google-tag",!0)?"":this.__renderGoogleTag(i),s.matches("troubleshooting",!0)?"":this.__renderTroubleshooting(i),s.matches("custom-config",!0)?"":this.__renderCustomConfig(i),s.matches("header",!0)?"":this.__renderHeader(i),s.matches("custom-fields",!0)?"":this.__renderCustomFields(i),s.matches("footer",!0)?"":this.__renderFooter(i),h({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":this.in("idle")}),this.in("fail")?"error":"busy",this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"")}__renderCartType(t){const{lang:s,ns:i}=this,n=["default","fullpage","custom"],a=!this.in("idle")||this.disabledSelector.matches("cart-type",!0);return o(J||(J=ie` <div data-testid="cart-type"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="cart_type" ns="${0}"> </foxy-i18n> <x-choice data-testid="cart-type-choice" .value="${0}" .items="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} </x-choice> </x-group> ${0} </div> `),this.renderTemplateOrSlot("cart-type:before"),a?"text-disabled":"",s,i,t.cart_type,n,a,this.readonlySelector.matches("cart-type",!0),(s=>{this.edit({json:JSON.stringify(e(e({},t),{},{cart_type:s.detail}))})}),n.map((e=>o(N||(N=ie` <div slot="${0}-label" class="grid leading-s py-s"> <foxy-i18n lang="${0}" key="cart_type_${0}" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs ${0}" lang="${0}" key="cart_type_${0}_explainer" ns="${0}"> </foxy-i18n> </div> `),e,s,e,i,a?"text-disabled":"text-secondary",s,e,i))),this.renderTemplateOrSlot("cart-type:after"))}__renderFoxycomplete(e){const{lang:t,ns:s}=this,n=!this.in("idle")||this.disabledSelector.matches("foxycomplete",!0),a=this.readonlySelector.matches("foxycomplete",!0),r=e.foxycomplete,d=["combobox","search","disabled"],l="none"===r.usage?"disabled":r.show_combobox?"combobox":"search",c=o(E||(E=ie` <x-checkbox data-testid="foxycomplete-flags-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n lang="${0}" key="show_country_flags" ns="${0}"></foxy-i18n> </x-checkbox> `),n,a,r.show_flags,(t=>{r.show_flags=t.detail,this.edit({json:JSON.stringify(e)})}),t,s);return o(F||(F=ie` <div data-testid="foxycomplete"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="foxycomplete" ns="${0}"> </foxy-i18n> <x-choice data-testid="foxycomplete-choice" .value="${0}" .items="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} <div slot="combobox" class="space-y-m pb-s" ?hidden="${0}"> <div class="grid grid-cols-2 gap-m" style="max-width:16rem"> ${0} </div> ${0} </div> <div slot="search" class="pb-s" ?hidden="${0}">${0}</div> </x-choice> <div class="border-t border-contrast-10 p-m"> <x-checkbox data-testid="foxycomplete-lookup-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n lang="${0}" key="enable_postcode_lookup" ns="${0}"></foxy-i18n> </x-checkbox> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("foxycomplete:before"),n?"text-disabled":"",t,s,l,d,n,a,(t=>{t instanceof i&&(r.usage="disabled"===t.detail?"none":"required",r.show_combobox="combobox"===t.detail,this.edit({json:JSON.stringify(e)}))}),d.map((e=>o(R||(R=ie` <div slot="${0}-label" class="grid leading-s py-s"> <foxy-i18n lang="${0}" key="foxycomplete_${0}" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs ${0}" lang="${0}" key="foxycomplete_${0}_explainer" ns="${0}"> </foxy-i18n> </div> `),e,t,e,s,n?"text-disabled":"text-secondary",t,e,s))),"combobox"!==l,["open","close"].map((t=>{const s="open"===t?"combobox_open":"combobox_close";return o(H||(H=ie` <vaadin-text-field data-testid="foxycomplete-${0}-icon" style="--lumo-border-radius:var(--lumo-border-radius-s)" label="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> </vaadin-text-field> `),t,this.t(`${t}_icon`),r[s],n,a,(e=>"Enter"===e.key&&this.submit()),(t=>{r[s]=t.currentTarget.value,this.edit({json:JSON.stringify(e)})}))})),c,"search"!==l,c,n,a,"enabled"===e.postal_code_lookup.usage,(t=>{e.postal_code_lookup.usage=t.detail?"enabled":"none",this.edit({json:JSON.stringify(e)})}),t,s,this.renderTemplateOrSlot("foxycomplete:after"))}__renderLocations(e){const{lang:t,ns:s}=this,i=e.location_filtering,n=!this.in("idle")||this.disabledSelector.matches("locations",!0),a=this.readonlySelector.matches("locations",!0),r="blacklist"===i.shipping_filter_type?"block":"allow",d="both"===i.usage?"copy":"blacklist"===i.billing_filter_type?"block":"allow",l=()=>{if("both"===i.usage)i.billing_filter_type=i.shipping_filter_type,i.billing_filter_values=i.shipping_filter_values;else{const e=Object.keys(i.billing_filter_values).length>0,t=Object.keys(i.shipping_filter_values).length>0;i.usage=e||t?e&&!t?"billing":t&&!e?"shipping":"independent":"none"}};return o(I||(I=ie` <div data-testid="locations"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="location_plural" ns="${0}"> </foxy-i18n> <div class="grid sm-grid-cols-2 bg-contrast-10" style="gap:1px"> <x-group class="bg-base pt-m"> <foxy-i18n class="${0}" slot="header" lang="${0}" key="shipping" ns="${0}"> </foxy-i18n> <x-choice data-testid="locations-shipping-choice" .items="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> <foxy-i18n slot="allow-label" lang="${0}" key="allowlist" ns="${0}"></foxy-i18n> <foxy-i18n slot="block-label" lang="${0}" key="blocklist" ns="${0}"></foxy-i18n> <x-countries-list data-testid="locations-shipping-list" countries="${0}" regions="${0}" class="mb-m" href="${0}" slot="${0}" lang="${0}" ns="${0}" ?disabled="${0}" ?readonly="${0}" @update:countries="${0}"> </x-countries-list> </x-choice> </x-group> <x-group class="bg-base pt-m"> <foxy-i18n class="${0}" slot="header" lang="${0}" key="billing" ns="${0}"> </foxy-i18n> <x-choice data-testid="locations-billing-choice" .items="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> <foxy-i18n slot="allow-label" lang="${0}" key="allowlist" ns="${0}"></foxy-i18n> <foxy-i18n slot="block-label" lang="${0}" key="blocklist" ns="${0}"></foxy-i18n> <foxy-i18n slot="copy-label" lang="${0}" key="same_as_shipping" ns="${0}"> </foxy-i18n> <x-countries-list data-testid="locations-billing-list" countries="${0}" regions="${0}" class="mb-m" href="${0}" slot="${0}" lang="${0}" ns="${0}" ?disabled="${0}" ?readonly="${0}" ?hidden="${0}" @update:countries="${0}"> </x-countries-list> </x-choice> </x-group> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("locations:before"),n?"text-disabled":"",t,s,n?"text-disabled":"text-tertiary",t,s,["allow","block"],r,n,a,(t=>{"both"!==i.usage&&(i.usage="independent"),i.shipping_filter_type="block"===t.detail?"blacklist":"whitelist",l(),this.edit({json:JSON.stringify(e)})}),t,s,t,s,JSON.stringify(i.shipping_filter_values),this.regions,this.countries,r,t,s,n,a,(t=>{i.shipping_filter_values=t.currentTarget.countries,l(),this.edit({json:JSON.stringify(e)})}),n?"text-disabled":"text-tertiary",t,s,["allow","block","copy"],d,n,a,(t=>{"copy"===t.detail?i.usage="both":(i.usage="independent",i.billing_filter_type="block"===t.detail?"blacklist":"whitelist"),l(),this.edit({json:JSON.stringify(e)})}),t,s,t,s,t,s,JSON.stringify(i.billing_filter_values),this.regions,this.countries,d,t,s,n,a,"copy"===d,(t=>{i.billing_filter_values=t.currentTarget.countries,l(),this.edit({json:JSON.stringify(e)})}),this.renderTemplateOrSlot("locations:after"))}__renderHiddenFields(e){const{lang:t,ns:s}=this,i=[],n=[],a=e.cart_display_config,r=!this.in("idle")||this.disabledSelector.matches("hidden-fields",!0),d=this.readonlySelector.matches("hidden-fields",!0);for(const e in a){if(!e.startsWith("show_"))continue;const t=e.substring(5);i.push(t),"required"!==a.usage||a[e]||n.push(t)}"required"===a.usage&&n.push(...a.hidden_product_options);const l=()=>{a.usage="required",i.includes(this.__addHiddenFieldInputValue)?a[`show_${this.__addHiddenFieldInputValue}`]=!1:a.hidden_product_options.includes(this.__addHiddenFieldInputValue)||a.hidden_product_options.push(this.__addHiddenFieldInputValue),this.edit({json:JSON.stringify(e)}),this.__addHiddenFieldInputValue=""},c="calc(var(--lumo-border-radius-l) / 1.2)",u=0===n.length?[c]:["0","0",c,c],g=r||!this.__addHiddenFieldInputValue;return o(V||(V=ie` <div data-testid="hidden-fields"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="hidden_fields" ns="${0}"> </foxy-i18n> <div class="divide-y divide-contrast-10" data-testid="hidden-fields-list"> ${0} </div> <div data-testid="hidden-fields-new" style="border-radius:${0}" class="${0}"> <input placeholder="${0}" class="w-full bg-transparent appearance-none h-m px-m focus-outline-none" list="hidden-fields-list" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> <datalist id="hidden-fields-list"> ${0} </datalist> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:add" class="icon-inline text-m"></iron-icon> </button> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("hidden-fields:before"),r?"text-disabled":"",t,s,n.map((n=>o(z||(z=ie` <div class="${0}"> ${0} <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m m-auto"></iron-icon> </button> </div> `),h({"h-m ml-m pr-xs flex items-center justify-between":!0,"text-secondary":d,"text-disabled":r}),i.includes(n)?o(A||(A=ie`<foxy-i18n lang="${0}" key="${0}" ns="${0}"></foxy-i18n>`),t,n,s):o(D||(D=ie`<span>${0}</span>`),n),this.t("delete"),h({"w-xs h-xs rounded-full transition-colors":!0,"hover-bg-error-10 hover-text-error":!r,"focus-outline-none focus-ring-2 ring-inset ring-error-50":!r,"cursor-default":r,flex:!d,hidden:d}),r,(()=>{"boolean"==typeof a[`show_${n}`]?a[`show_${n}`]=!0:a.hidden_product_options=a.hidden_product_options.filter((e=>e!==n)),this.edit({json:JSON.stringify(e)})})))),u.join(" "),h({"h-m flex items-center ring-inset ring-primary-50 focus-within-ring-2":!0,"border-t border-contrast-10":n.length>0,flex:!d,hidden:d}),this.t("add_field"),f(this.__addHiddenFieldInputValue),r,d,(e=>"Enter"===e.key&&l()),(e=>{this.__addHiddenFieldInputValue=e.currentTarget.value}),i.filter((e=>!n.includes(e))).map((e=>o(G||(G=ie`<option value="${0}">${0}</option>`),e,this.t(e)))),this.t("add_field"),h({"w-xs h-xs mr-xs flex-shrink-0 ring-inset ring-success-50":!0,"flex items-center justify-center rounded-full transition-colors":!0,"bg-contrast-5 text-disabled cursor-default":g,"bg-success-10 text-success cursor-pointer":!g,"hover-bg-success hover-text-success-contrast":!g,"focus-outline-none focus-ring-2":!g}),g,l,this.renderTemplateOrSlot("hidden-fields:after"))}__renderCards(e){const{lang:s,ns:i}=this,n=!this.in("idle")||this.disabledSelector.matches("cards",!0),a=this.readonlySelector.matches("cards",!0),r=e.supported_payment_cards;let d,l;"all_cards"===e.csc_requirements?(d=!1,l=!1):"sso_only"===e.csc_requirements?(d=!0,l=!1):(d=!0,l=!0);const c={amex:"American Express",diners:"Diners Club",discover:"Discover",jcb:"JCB",maestro:"Maestro",mastercard:"Mastercard",unionpay:"UnionPay",visa:"Visa"};return o(L||(L=ie` <div data-testid="cards"> ${0} <div class="space-y-xs"> <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="supported_cards" ns="${0}"> </foxy-i18n> <div class="flex flex-wrap m-xs p-s"> ${0} </div> <div class="flex flex-wrap p-s border-t border-contrast-10"> <x-checkbox data-testid="cards-saved-check" class="m-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="leading-s block" lang="${0}" key="skip_csc_for_saved" ns="${0}"> </foxy-i18n> </x-checkbox> <x-checkbox data-testid="cards-sso-check" class="m-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="leading-s block" lang="${0}" key="skip_csc_for_sso" ns="${0}"> </foxy-i18n> </x-checkbox> </div> </x-group> <foxy-i18n class="text-xs leading-s block ${0}" lang="${0}" key="supported_cards_disclaimer" ns="${0}"> </foxy-i18n> </div> ${0} </div> `),this.renderTemplateOrSlot("cards:before"),n?"text-disabled":"",s,i,Object.entries(t).map((([t,s])=>{if(!c[t])return;const i=r.includes(t);return o(U||(U=ie` <div class="${0}"> <label class="${0}"> <div class="h-s">${0}</div> <div class="text-s font-medium mx-s my-auto leading-none"> ${0} </div> <input type="checkbox" class="sr-only" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> </label> </div> `),h({"m-xs rounded":!0,"opacity-50 cursor-default":n,"cursor-pointer ring-primary-50 focus-within-ring-2":!n}),h({"overflow-hidden transition-colors flex rounded-s border":!0,"border-primary bg-primary-10 text-primary":i&&!a,"border-contrast bg-contrast-5 text-secondary":i&&a,"hover-text-body":i&&!n&&!a,"border-contrast-10":!i,"hover-border-primary":!i&&!n&&!a,"hover-text-primary":!i&&!n&&!a}),s,c[t],n,a,i,(s=>{if(a)return s.preventDefault();s.stopPropagation(),s.currentTarget.checked?r.push(t):r.splice(r.indexOf(t),1),this.edit({json:JSON.stringify(e)})}))})),n||"new_cards_only"===e.csc_requirements,a,d,(t=>{e.csc_requirements=t.detail?"sso_only":"all_cards",this.edit({json:JSON.stringify(e)})}),s,i,n,a,l,(t=>{e.csc_requirements=t.detail?"new_cards_only":d?"sso_only":"all_cards",this.edit({json:JSON.stringify(e)})}),s,i,n?"text-disabled":"text-secondary",s,i,this.renderTemplateOrSlot("cards:after"))}__renderCheckoutType(e){const{lang:t,ns:s}=this,i=!this.in("idle")||this.disabledSelector.matches("checkout-type",!0),n=this.readonlySelector.matches("checkout-type",!0);return o(B||(B=ie` <div data-testid="checkout-type"> ${0} <div class="space-y-xs"> <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="checkout_type" ns="${0}"> </foxy-i18n> <x-choice data-testid="checkout-type-choice" ?disabled="${0}" ?readonly="${0}" .items="${0}" .value="${0}" .getText="${0}" @change="${0}"> </x-choice> </x-group> <foxy-i18n class="text-xs leading-s block ${0}" lang="${0}" key="checkout_type_helper_text" ns="${0}"> </foxy-i18n> </div> ${0} </div> `),this.renderTemplateOrSlot("checkout-type:before"),i?"text-disabled":"",t,s,i,n,["default_account","default_guest","guest_only","account_only"],e.checkout_type,(e=>this.t(`checkout_type_${e}`)),(t=>{e.checkout_type=t.detail,this.edit({json:JSON.stringify(e)})}),i?"text-disabled":"text-secondary",t,s,this.renderTemplateOrSlot("checkout-type:after"))}__renderConsent(e){const{lang:t,ns:s}=this,i=e.tos_checkbox_settings,n=e.newsletter_subscribe,a=e.eu_secure_data_transfer_consent,r=!this.in("idle")||this.disabledSelector.matches("consent",!0),d=this.readonlySelector.matches("consent",!0),l="margin-left: calc(1.125rem + (var(--lumo-space-m) * 2))";return o(P||(P=ie` <div data-testid="consent"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="consent" ns="${0}"> </foxy-i18n> <x-checkbox data-testid="consent-tos-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" class="m-m" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="display_tos_link" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s ${0}" lang="${0}" key="display_tos_link_explainer" ns="${0}"> </foxy-i18n> </div> <div slot="content" ?hidden="${0}"> <vaadin-text-field data-testid="consent-tos-field" label="${0}" class="w-full mt-m" placeholder="https://example.com/path/to/tos" clear-button-visible ?disabled="${0}" ?readonly="${0}" .value="${0}" @input="${0}"> </vaadin-text-field> <div class="flex flex-wrap -mx-s -mb-s mt-s"> <x-checkbox data-testid="consent-tos-require-check" class="m-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="leading-s block" lang="${0}" key="require_consent" ns="${0}"> </foxy-i18n> </x-checkbox> <x-checkbox data-testid="consent-tos-state-check" class="m-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="leading-s block" lang="${0}" key="checked_by_default" ns="${0}"> </foxy-i18n> </x-checkbox> </div> </div> </x-checkbox> <div style="${0}" class="border-b border-contrast-10"></div> <x-checkbox data-testid="consent-mail-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" class="m-m" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="newsletter_subscribe" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s ${0}" lang="${0}" key="newsletter_subscribe_explainer" ns="${0}"> </foxy-i18n> </div> </x-checkbox> <div style="${0}" class="border-b border-contrast-10"></div> <x-checkbox data-testid="consent-sdta-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" class="m-m" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="display_sdta" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s ${0}" lang="${0}" key="display_sdta_explainer" ns="${0}"> </foxy-i18n> </div> </x-checkbox> </x-group> ${0} </div> `),this.renderTemplateOrSlot("consent:before"),r?"text-disabled":"",t,s,r,d,"required"===i.usage||"optional"===i.usage,(t=>{i.initial_state=t.detail?i.initial_state:"unchecked",i.is_hidden=!1,i.usage=t.detail?"required":"none",i.url=t.detail?i.url:"",this.edit({json:JSON.stringify(e)})}),t,s,r?"text-disabled":"text-secondary",t,s,"none"===i.usage,this.t("location_url"),r,d,i.url,(t=>{i.url=t.currentTarget.value,this.edit({json:JSON.stringify(e)})}),r,d,"required"===i.usage,(t=>{i.usage=t.detail?"required":"optional",this.edit({json:JSON.stringify(e)})}),t,s,r,d,"checked"===i.initial_state,(t=>{i.initial_state=t.detail?"checked":"unchecked",this.edit({json:JSON.stringify(e)})}),t,s,l,r,d,"required"===n.usage,(t=>{n.usage=t.detail?"required":"none",this.edit({json:JSON.stringify(e)})}),t,s,r?"text-disabled":"text-secondary",t,s,l,r,d,"required"===a.usage,(t=>{a.usage=t.detail?"required":"none",this.edit({json:JSON.stringify(e)})}),t,s,r?"text-disabled":"text-secondary",t,s,this.renderTemplateOrSlot("consent:after"))}__renderFields(e){const{lang:t,ns:s}=this,i=!this.in("idle")||this.disabledSelector.matches("fields",!0),n=this.readonlySelector.matches("fields",!0),a=e.custom_checkout_field_requirements;return o(M||(M=ie` <div data-testid="fields"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="field_plural" ns="${0}"> </foxy-i18n> <div class="bg-contrast-10 grid grid-cols-1 sm-grid-cols-2" style="gap:1px"> ${0} <div class="bg-base hidden sm-block"></div> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("fields:before"),i?"text-disabled":"",t,s,Object.entries({cart_controls:["enabled","disabled"],coupon_entry:["enabled","disabled"],billing_first_name:["default","optional","required","hidden"],billing_last_name:["default","optional","required","hidden"],billing_company:["default","optional","required","hidden"],billing_tax_id:["default","optional","required","hidden"],billing_phone:["default","optional","required","hidden"],billing_address1:["default","optional","required","hidden"],billing_address2:["default","optional","required","hidden"],billing_city:["default","optional","required","hidden"],billing_region:["default","optional","required","hidden"],billing_postal_code:["default","optional","required","hidden"],billing_country:["default","optional","required","hidden"]}).map((([r,d])=>o(W||(W=ie` <label class="${0}"> <foxy-i18n class="flex-1" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> <div class="${0}"> ${0} </div> <div class="${0}"> <select data-testid="fields-${0}" class="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} </select> <iron-icon class="pointer-events-none icon-inline text-xl" icon="icons:expand-more"> </iron-icon> </div> </label> `),h({"flex items-center pl-m bg-base":!0,"text-secondary":n,"text-disabled":i}),t,r.replace("billing_",""),s,h({"flex items-center text-right font-medium h-s px-s m-xs":n,hidden:!n}),this.t(d.find((e=>a[r]===e))),h({"px-s m-xs flex items-center rounded leading-none":!0,"ring-primary-50 ring-inset focus-within-ring-2":!i,"hover-text-primary":!i,"cursor-pointer":!i,"cursor-default":i,flex:!n,hidden:n}),r,h({"h-s mr-xs text-right appearance-none bg-transparent font-medium":!0,"focus-outline-none cursor-pointer":!i,"cursor-default":i}),i,n,(t=>{const s=t.currentTarget,i=s.options[s.options.selectedIndex].value;a[r]=i,this.edit({json:JSON.stringify(e)})}),d.map((e=>o(K||(K=ie` <option value="${0}" ?selected="${0}"> ${0} </option> `),e,a[r]===e,this.t(e))))))),this.renderTemplateOrSlot("fields:after"))}__renderGoogleAnalytics(e){const{lang:t,ns:s}=this,i=e.analytics_config,n=i.google_tag,a=i.google_analytics,r=!this.in("idle")||this.disabledSelector.matches("google-analytics",!0),d=this.readonlySelector.matches("google-analytics",!0);return o(Q||(Q=ie` <div data-testid="google-analytics"> ${0} <x-group frame> <span class="${0}" slot="header">Google Analytics</span> <foxy-i18n class="block bg-error-10 text-error font-medium rounded-t p-m" infer="" key="ga_deprecation_notice"> </foxy-i18n> <div class="p-m space-y-m"> <vaadin-text-field data-testid="google-analytics-field" style="--lumo-border-radius:var(--lumo-border-radius-s)" class="w-full" label="${0}" placeholder="UA-1234567-1" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" clear-button-visible @keydown="${0}" @input="${0}"> </vaadin-text-field> <x-checkbox data-testid="google-analytics-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="ga_include_on_site" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s ${0}" lang="${0}" key="ga_include_on_site_explainer" ns="${0}"> </foxy-i18n> </div> </x-checkbox> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("google-analytics:before"),r?"text-disabled":"",this.t("ga_account_id"),this.t("ga_account_id_explainer"),f(a.account_id),r,d,(e=>"Enter"===e.key&&this.submit()),(t=>{a.account_id=t.currentTarget.value,a.usage=a.account_id?"required":"none",i.usage=a.account_id||n.account_id?"required":"none",this.edit({json:JSON.stringify(e)})}),r,d,a.include_on_site,(t=>{a.include_on_site=t.detail,this.edit({json:JSON.stringify(e)})}),t,s,r?"text-disabled":"text-secondary",t,s,this.renderTemplateOrSlot("google-analytics:after"))}__renderGoogleTag(e){const t=e.analytics_config,s=t.google_tag,i=t.google_analytics,n=!this.in("idle")||this.disabledSelector.matches("google-tag",!0),a=this.readonlySelector.matches("google-tag",!0);return o(X||(X=ie` <div data-testid="google-tag"> ${0} <x-group frame> <span class="${0}" slot="header">Google Tag</span> <div class="p-m space-y-m"> <vaadin-text-field data-testid="google-tag-account-id" style="--lumo-border-radius:var(--lumo-border-radius-s)" class="w-full" label="${0}" placeholder="G-123456789" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" clear-button-visible @keydown="${0}" @input="${0}"> </vaadin-text-field> <vaadin-text-field data-testid="google-tag-send-to" style="--lumo-border-radius:var(--lumo-border-radius-s)" class="w-full" label="${0}" placeholder="AW-123456789/sABDCLqU3K2BEJb8cxDE" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" clear-button-visible @keydown="${0}" @input="${0}"> </vaadin-text-field> <p class="text-xs text-secondary"> <foxy-i18n infer="" key="gt_usage_notice"></foxy-i18n> <a target="_blank" class="cursor-pointer group text-primary rounded-s font-medium focus-outline-none focus-ring-2 focus-ring-primary-50" href="https://wiki.foxycart.com/v/2.0/analytics#google_tag_ga4_google_ads" rel="nofollow noreferrer noopener"> <foxy-i18n class="transition-opacity group-hover-opacity-80" infer="" key="gt_docs_link"> </foxy-i18n> </a> </p> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("google-tag:before"),n?"text-disabled":"",this.t("gt_account_id"),this.t("gt_account_id_explainer"),f(s.account_id),n,a,(e=>"Enter"===e.key&&this.submit()),(o=>{s.account_id=o.currentTarget.value,s.usage=s.account_id?"required":"none",t.usage=s.account_id||i.account_id?"required":"none",this.edit({json:JSON.stringify(e)})}),this.t("gt_send_to"),this.t("gt_send_to_explainer"),f(s.send_to),n,a,(e=>"Enter"===e.key&&this.submit()),(o=>{s.send_to=o.currentTarget.value,s.usage=s.account_id?"required":"none",t.usage=s.account_id||i.account_id?"required":"none",this.edit({json:JSON.stringify(e)})}),this.renderTemplateOrSlot("google-tag:after"))}__renderTroubleshooting(e){const{lang:t,ns:s}=this,i=e.debug,n=!this.in("idle")||this.disabledSelector.matches("troubleshooting",!0),a=this.readonlySelector.matches("troubleshooting",!0);return o(Y||(Y=ie` <div data-testid="troubleshooting"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="troubleshooting" ns="${0}"> </foxy-i18n> <div class="p-m space-y-m"> <x-checkbox data-testid="troubleshooting-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="troubleshooting_debug" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s ${0}" lang="${0}" key="troubleshooting_debug_explainer" ns="${0}"> </foxy-i18n> </div> </x-checkbox> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("troubleshooting:before"),n?"text-disabled":"",t,s,n,a,"required"===i.usage,(t=>{i.usage=t.detail?"required":"none",this.edit({json:JSON.stringify(e)})}),t,s,n?"text-disabled":"text-secondary",t,s,this.renderTemplateOrSlot("troubleshooting:after"))}__renderCustomConfig(e){return o(Z||(Z=ie` <div data-testid="custom-config"> ${0} <vaadin-text-area data-testid="custom-config-field" class="w-full" label="${0}" placeholder='{ "key": "value" }' helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @input="${0}"> </vaadin-text-area> ${0} </div> `),this.renderTemplateOrSlot("custom-config:before"),this.t("custom_config"),this.t("custom_config_helper_text"),e.custom_config?JSON.stringify(e.custom_config,null,2):"",!this.in("idle")||this.disabledSelector.matches("custom-config",!0),this.readonlySelector.matches("custom-config",!0),(t=>{const s=t.currentTarget;try{e.custom_config=s.value?JSON.parse(s.value):"",this.edit({json:JSON.stringify(e)}),s.invalid=!1}catch(e){s.invalid=!0}}),this.renderTemplateOrSlot("custom-config:after"))}__renderHeader(t){return o(ee||(ee=ie` <div data-testid="header"> ${0} <vaadin-text-area data-testid="header-field" class="w-full" label="${0}" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @input="${0}"> </vaadin-text-area> ${0} </div> `),this.renderTemplateOrSlot("header:before"),this.t("custom_header"),this.t("custom_header_helper_text"),t.custom_script_values.header,!this.in("idle")||this.disabledSelector.matches("header",!0),this.readonlySelector.matches("header",!0),(s=>{const i=s.currentTarget,o=e(e({},t.custom_script_values),{},{header:i.value});this.edit({json:JSON.stringify(e(e({},t),{},{custom_script_values:o}))})}),this.renderTemplateOrSlot("header:after"))}__renderCustomFields(e){return o(te||(te=ie` <div data-testid="custom-fields"> ${0} <vaadin-text-area data-testid="custom-fields-field" class="w-full" label="${0}" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @input="${0}"> </vaadin-text-area> ${0} </div> `),this.renderTemplateOrSlot("custom-fields:before"),this.t("custom_fields"),this.t("custom_fields_helper_text"),e.custom_script_values.checkout_fields,!this.in("idle")||this.disabledSelector.matches("custom-fields",!0),this.readonlySelector.matches("custom-fields",!0),(t=>{const s=t.currentTarget.value;e.custom_script_values.checkout_fields=s,this.edit({json:JSON.stringify(e)})}),this.renderTemplateOrSlot("custom-fields:after"))}__renderFooter(t){return o(se||(se=ie` <div data-testid="footer"> ${0} <vaadin-text-area data-testid="footer-field" class="w-full" label="${0}" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @input="${0}"> </vaadin-text-area> ${0} </div> `),this.renderTemplateOrSlot("footer:before"),this.t("custom_footer"),this.t("custom_footer_helper_text"),t.custom_script_values.footer,!this.in("idle")||this.disabledSelector.matches("footer",!0),this.readonlySelector.matches("footer",!0),(s=>{const i=s.currentTarget,o=e(e({},t.custom_script_values),{},{footer:i.value});this.edit({json:JSON.stringify(e(e({},t),{},{custom_script_values:o}))})}),this.renderTemplateOrSlot("footer:after"))}}customElements.define("foxy-template-config-form",ne);export{ne as TemplateConfigForm};
1
+ import"./shared-ca58ef47.js";import"./shared-e28f16db.js";import"./shared-b95ef318.js";import"./shared-e6066f46.js";import"./shared-0479553e.js";import"./foxy-spinner.js";import"./shared-86768244.js";import{_ as e}from"./shared-98755831.js";import{l as t}from"./shared-99065f2a.js";import{C as s,a as i}from"./shared-ee13d1a6.js";import{h as o}from"./shared-7f33a83a.js";import{C as n}from"./shared-ad396f3c.js";import{C as a}from"./shared-de790de9.js";import{N as r}from"./shared-eb900735.js";import{T as l,a as d,S as c,R as u}from"./shared-16b542bc.js";import{c as h}from"./shared-4e709717.js";import{i as g}from"./shared-d3bf9ac0.js";import{G as p}from"./shared-08ff9a8d.js";import{l as f}from"./shared-f3b35364.js";import"./shared-7a290f36.js";import"./shared-c40d85dc.js";import"./shared-4c9f96ec.js";import"./shared-0c02b4ee.js";import"./shared-5dd31b4e.js";import"./shared-a8cf402a.js";import"./shared-d519a301.js";import"./shared-64657919.js";import"./shared-6f465111.js";import"./shared-aeec3cab.js";import"./shared-f3f5e87e.js";import"./shared-e5c19ea3.js";import"./shared-068480a3.js";import"./shared-0543c6e0.js";import"./shared-4db2c7b1.js";import"./shared-11c2efc8.js";import"./shared-a89cb472.js";import"./shared-509a2f52.js";import"./shared-d6276c83.js";let y,_,x,b,m,$=e=>e;const v=a(l(d(r)));class k extends v{constructor(){super(...arguments),this.regions=[],this.name="",this.code="",this.__newRegion=""}static get properties(){return e(e({},super.properties),{},{__newRegion:{attribute:!1},regions:{type:Array},name:{type:String},code:{type:String}})}render(){var e,t;return o(y||(y=$` <div class="${0}"> <div data-testid="country" class="h-m flex justify-between items-center border-b border-contrast-10"> <div class="ml-m"> <span>${0}</span> ${0} </div> <button aria-label="${0}" class="${0}" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m"></iron-icon> </button> </div> <div data-testid="regions" class="flex flex-wrap p-xs"> ${0} <div data-testid="new-region" style="border-radius:var(--lumo-size-s)" class="${0}"> <input placeholder="${0}" class="bg-transparent appearance-none h-s text-s px-s focus-outline-none" style="width:8rem" list="list" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> <button style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:add" class="icon-inline text-m"></iron-icon> </button> </div> <datalist id="list"> ${0} </datalist> </div> </div> `),h({"border border-contrast-10 rounded text-s":!0,"text-disabled":this.disabled}),this.name||this.code,this.name?o(_||(_=$`<span class="text-secondary">${0}</span>`),this.code):"",this.t("delete"),h({"mr-xs items-center justify-center rounded-full transition-colors":!0,"hover-bg-error-10 hover-text-error":!this.disabled,"focus-outline-none focus-ring-2 ring-inset ring-error-50":!this.disabled,"cursor-default":this.disabled,flex:!this.readonly,hidden:this.readonly}),this.disabled,(()=>this.dispatchEvent(new CustomEvent("delete"))),this.regions.map((e=>{var t,s;const i=null===(s=null===(t=this.data)||void 0===t?void 0:t.values[e])||void 0===s?void 0:s.default;return o(x||(x=$` <div class="flex items-center border border-contrast-10 h-s m-xs" style="border-radius:var(--lumo-size-s)"> <span class="mx-s"> <span>${0}</span> ${0} </span> <button aria-label="${0}" class="${0}" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m"></iron-icon> </button> </div> `),i||e,i?o(b||(b=$`<span class="text-secondary">${0}</span>`),e):"",this.t("delete"),h({"items-center justify-center rounded-full transition-colors":!0,"hover-bg-error-10 hover-text-error":!this.disabled,"focus-outline-none focus-ring-2 ring-inset ring-error-50":!this.disabled,"cursor-default":this.disabled,flex:!this.readonly,hidden:this.readonly}),this.disabled,(()=>{this.regions=this.regions.filter((t=>t!==e)),this.dispatchEvent(new CustomEvent("update:regions"))}))})),h({"h-s m-xs items-center transition-colors border border-contrast-10":!0,"hover-border-contrast-40":!this.disabled,"focus-within-ring-1 ring-primary-50 focus-within-border-primary-50":!this.disabled,flex:!this.readonly,hidden:this.readonly}),this.t("add_region"),this.__newRegion,this.disabled,this.readonly,(e=>{"Enter"===e.key&&this.__newRegion&&this.__addRegion()}),(e=>{const t=e.currentTarget;this.__newRegion=t.value}),h({"flex-shrink-0":!0,"flex items-center justify-center rounded-full transition-colors":!0,"bg-contrast-5 text-disabled cursor-default":!this.__newRegion,"bg-success-10 text-success cursor-pointer":!!this.__newRegion,"hover-bg-success hover-text-success-contrast":!!this.__newRegion,"focus-outline-none focus-ring-2 ring-inset ring-success-50":!!this.__newRegion}),this.disabled||!this.__newRegion,this.__addRegion,Object.values(null!==(t=null===(e=this.data)||void 0===e?void 0:e.values)&&void 0!==t?t:{}).map((e=>o(m||(m=$`<option value="${0}">${0}</option>`),e.code,e.default))))}__addRegion(){this.regions=[...new Set([...this.regions,this.__newRegion])],this.__newRegion="",this.dispatchEvent(new CustomEvent("update:regions"))}}let w,S,j,O=e=>e;const q=c(a(l(d(r))));class T extends q{constructor(){super(...arguments),this.countries={},this.regions="",this.__newCountry=""}static get scopedElements(){return{"x-country-card":k,"iron-icon":customElements.get("iron-icon")}}static get properties(){return e(e({},super.properties),{},{__newCountry:{attribute:!1},countries:{type:Object},regions:{type:String}})}render(){var t,s;return o(w||(w=O` <div> <div class="space-y-s" data-testid="countries"> ${0} <div data-testid="new-country" class="${0}"> <input placeholder="${0}" class="w-full bg-transparent appearance-none h-m text-s px-m focus-outline-none" list="list" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> <button aria-label="${0}" class="${0}" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:add" class="icon-inline text-m"></iron-icon> </button> </div> </div> <datalist id="list"> ${0} </datalist> </div> `),Object.entries(this.countries).map((([t,s])=>{var i,n;let a;try{const e=new URL(this.regions);e.searchParams.set("country_code",t),a=e.toString()}catch(e){a=""}return o(S||(S=O` <x-country-card regions="${0}" code="${0}" name="${0}" href="${0}" lang="${0}" ns="${0}" ?disabled="${0}" ?readonly="${0}" @update:regions="${0}" @delete="${0}"> </x-country-card> `),JSON.stringify("*"===s?[]:s),t,g(null===(n=null===(i=this.data)||void 0===i?void 0:i.values[t])||void 0===n?void 0:n.default),a,this.lang,this.ns,this.disabled,this.readonly,(s=>{const i=e({},this.countries),o=s.currentTarget.regions;i[t]=o.length?o:"*",this.countries=i,this.dispatchEvent(new CustomEvent("update:countries"))}),(()=>{const s=e({},this.countries);delete s[t],this.countries=s,this.dispatchEvent(new CustomEvent("update:countries"))}))})),h({"h-m flex items-center rounded transition-colors":!0,"border border-contrast-10 ring-primary-50":!0,"hover-border-contrast-40":!this.disabled,"focus-within-ring-1 focus-within-border-primary-50":!this.disabled,flex:!this.readonly,hidden:this.readonly}),this.t("add_country"),this.__newCountry,this.disabled,this.readonly,(e=>{"Enter"===e.key&&this.__newCountry&&this.__addCountry()}),(e=>{const t=e.currentTarget;this.__newCountry=t.value}),this.t("create"),h({"mr-xs flex-shrink-0":!0,"flex items-center justify-center rounded-full transition-colors":!0,"bg-contrast-5 text-disabled cursor-default":!this.__newCountry,"bg-success-10 text-success cursor-pointer":!!this.__newCountry,"hover-bg-success hover-text-success-contrast":!!this.__newCountry,"focus-outline-none focus-ring-2 ring-inset ring-success-50":!!this.__newCountry}),!this.__newCountry||this.disabled,this.__addCountry,Object.entries(null!==(s=null===(t=this.data)||void 0===t?void 0:t.values)&&void 0!==s?s:{}).map((([e,t])=>o(j||(j=O`<option value="${0}">${0}</option>`),e,t.default))))}__addCountry(){this.countries=e(e({},this.countries),{},{[this.__newCountry]:"*"}),this.__newCountry="",this.dispatchEvent(new CustomEvent("update:countries"))}}let J,N,C,E,F,V,R,H,I,z,A,D,G,L,U,B,P,M,W,K,Q,X,Y,Z=e=>e;const ee=c(u(a(l(d(r,"template-config-form")))));class te extends ee{constructor(){super(...arguments),this.templates={},this.countries="",this.regions="",this.__addHiddenFieldInputValue=""}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"iron-icon":customElements.get("iron-icon"),"foxy-internal-source-control":customElements.get("foxy-internal-source-control"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"x-countries-list":T,"x-checkbox":n,"x-choice":s,"x-group":p}}static get properties(){return e(e({},super.properties),{},{__addHiddenFieldInputValue:{attribute:!1},countries:{type:String},regions:{type:String}})}render(){var e,t;const s=this.hiddenSelector,i=this.form.json?JSON.parse(this.form.json):{cart_type:"default",checkout_type:"default_account",csc_requirements:"all_cards",tos_checkbox_settings:{usage:"none",initial_state:"unchecked",is_hidden:!1,url:""},eu_secure_data_transfer_consent:{usage:"required"},newsletter_subscribe:{usage:"none"},analytics_config:{usage:"none",google_analytics:{usage:"none",account_id:"",include_on_site:!1},google_tag:{usage:"none",send_to:"",account_id:""}},colors:{usage:"none",primary:"4D4D4D",secondary:"FFFFFF",tertiary:"FFFFFF"},use_checkout_confirmation_window:{usage:"none"},supported_payment_cards:["visa","mastercard","discover","amex"],custom_checkout_field_requirements:{cart_controls:"enabled",coupon_entry:"enabled",billing_first_name:"required",billing_last_name:"required",billing_company:"optional",billing_tax_id:"hidden",billing_phone:"optional",billing_address1:"required",billing_address2:"optional",billing_city:"required",billing_region:"default",billing_postal_code:"required",billing_country:"required"},cart_display_config:{usage:"none",show_product_weight:!0,show_product_category:!0,show_product_code:!0,show_product_options:!0,show_sub_frequency:!0,show_sub_startdate:!0,show_sub_nextdate:!0,show_sub_enddate:!0,hidden_product_options:[]},foxycomplete:{usage:"required",show_combobox:!0,combobox_open:"\\u25bc",combobox_close:"\\u25b2",show_flags:!0},custom_script_values:{header:"",footer:"",checkout_fields:"",multiship_checkout_fields:""},http_receipt:!1,custom_config:"",debug:{usage:"none"},location_filtering:{usage:"none",shipping_filter_type:"blacklist",billing_filter_type:"blacklist",shipping_filter_values:{},billing_filter_values:{}},postal_code_lookup:{usage:"enabled"}};return o(J||(J=Z` <div class="relative" aria-busy="${0}" aria-live="polite"> <div class="space-y-l"> ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} <foxy-internal-source-control data-testid="custom-config" helper-text="${0}" placeholder='{ "key": "value" }' label="${0}" infer="custom-config" .getValue="${0}" .setValue="${0}"> </foxy-internal-source-control> <foxy-internal-source-control data-testid="header" placeholder="<style>h1 { color: red }</style>" helper-text="${0}" label="${0}" infer="header" .getValue="${0}" .setValue="${0}"> </foxy-internal-source-control> <foxy-internal-source-control data-testid="custom-fields" placeholder='<label>Comment: <input name="comment"></label>' helper-text="${0}" label="${0}" infer="custom-fields" .getValue="${0}" .setValue="${0}"> </foxy-internal-source-control> <foxy-internal-source-control data-testid="footer" placeholder='<script src="https://example.com/code.js"></script>' helper-text="${0}" label="${0}" infer="footer" .getValue="${0}" .setValue="${0}"> </foxy-internal-source-control> </div> <div class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.in("busy"),s.matches("cart-type",!0)?"":this.__renderCartType(i),s.matches("foxycomplete",!0)?"":this.__renderFoxycomplete(i),s.matches("locations",!0)?"":this.__renderLocations(i),s.matches("hidden-fields",!0)?"":this.__renderHiddenFields(i),s.matches("cards",!0)?"":this.__renderCards(i),s.matches("checkout-type",!0)?"":this.__renderCheckoutType(i),s.matches("consent",!0)?"":this.__renderConsent(i),s.matches("fields",!0)?"":this.__renderFields(i),s.matches("google-analytics",!0)?"":this.__renderGoogleAnalytics(i),s.matches("google-tag",!0)?"":this.__renderGoogleTag(i),s.matches("troubleshooting",!0)?"":this.__renderTroubleshooting(i),this.t("custom_config_helper_text"),this.t("custom_config"),(()=>"string"==typeof i.custom_config?i.custom_config:JSON.stringify(i.custom_config,null,2)),(e=>{try{i.custom_config=JSON.parse(e)}catch(t){i.custom_config=e}this.edit({json:JSON.stringify(i)})}),this.t("custom_header_helper_text"),this.t("custom_header"),(()=>i.custom_script_values.header),(e=>{i.custom_script_values.header=e,this.edit({json:JSON.stringify(i)})}),this.t("custom_fields_helper_text"),this.t("custom_fields"),(()=>i.custom_script_values.checkout_fields),(e=>{i.custom_script_values.checkout_fields=e,this.edit({json:JSON.stringify(i)})}),this.t("custom_footer_helper_text"),this.t("custom_footer"),(()=>i.custom_script_values.footer),(e=>{i.custom_script_values.footer=e,this.edit({json:JSON.stringify(i)})}),h({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":this.in("idle")}),this.in("fail")?"error":"busy",this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"")}__renderCartType(t){const{lang:s,ns:i}=this,n=["default","fullpage","custom"],a=!this.in("idle")||this.disabledSelector.matches("cart-type",!0);return o(N||(N=Z` <div data-testid="cart-type"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="cart_type" ns="${0}"> </foxy-i18n> <x-choice data-testid="cart-type-choice" .value="${0}" .items="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} </x-choice> </x-group> ${0} </div> `),this.renderTemplateOrSlot("cart-type:before"),a?"text-disabled":"",s,i,t.cart_type,n,a,this.readonlySelector.matches("cart-type",!0),(s=>{this.edit({json:JSON.stringify(e(e({},t),{},{cart_type:s.detail}))})}),n.map((e=>o(C||(C=Z` <div slot="${0}-label" class="grid leading-s py-s"> <foxy-i18n lang="${0}" key="cart_type_${0}" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs ${0}" lang="${0}" key="cart_type_${0}_explainer" ns="${0}"> </foxy-i18n> </div> `),e,s,e,i,a?"text-disabled":"text-secondary",s,e,i))),this.renderTemplateOrSlot("cart-type:after"))}__renderFoxycomplete(e){const{lang:t,ns:s}=this,n=!this.in("idle")||this.disabledSelector.matches("foxycomplete",!0),a=this.readonlySelector.matches("foxycomplete",!0),r=e.foxycomplete,l=["combobox","search","disabled"],d="none"===r.usage?"disabled":r.show_combobox?"combobox":"search",c=o(E||(E=Z` <x-checkbox data-testid="foxycomplete-flags-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n lang="${0}" key="show_country_flags" ns="${0}"></foxy-i18n> </x-checkbox> `),n,a,r.show_flags,(t=>{r.show_flags=t.detail,this.edit({json:JSON.stringify(e)})}),t,s);return o(F||(F=Z` <div data-testid="foxycomplete"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="foxycomplete" ns="${0}"> </foxy-i18n> <x-choice data-testid="foxycomplete-choice" .value="${0}" .items="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} <div slot="combobox" class="space-y-m pb-s" ?hidden="${0}"> <div class="grid grid-cols-2 gap-m" style="max-width:16rem"> ${0} </div> ${0} </div> <div slot="search" class="pb-s" ?hidden="${0}">${0}</div> </x-choice> <div class="border-t border-contrast-10 p-m"> <x-checkbox data-testid="foxycomplete-lookup-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n lang="${0}" key="enable_postcode_lookup" ns="${0}"></foxy-i18n> </x-checkbox> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("foxycomplete:before"),n?"text-disabled":"",t,s,d,l,n,a,(t=>{t instanceof i&&(r.usage="disabled"===t.detail?"none":"required",r.show_combobox="combobox"===t.detail,this.edit({json:JSON.stringify(e)}))}),l.map((e=>o(V||(V=Z` <div slot="${0}-label" class="grid leading-s py-s"> <foxy-i18n lang="${0}" key="foxycomplete_${0}" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs ${0}" lang="${0}" key="foxycomplete_${0}_explainer" ns="${0}"> </foxy-i18n> </div> `),e,t,e,s,n?"text-disabled":"text-secondary",t,e,s))),"combobox"!==d,["open","close"].map((t=>{const s="open"===t?"combobox_open":"combobox_close";return o(R||(R=Z` <vaadin-text-field data-testid="foxycomplete-${0}-icon" style="--lumo-border-radius:var(--lumo-border-radius-s)" label="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> </vaadin-text-field> `),t,this.t(`${t}_icon`),r[s],n,a,(e=>"Enter"===e.key&&this.submit()),(t=>{r[s]=t.currentTarget.value,this.edit({json:JSON.stringify(e)})}))})),c,"search"!==d,c,n,a,"enabled"===e.postal_code_lookup.usage,(t=>{e.postal_code_lookup.usage=t.detail?"enabled":"none",this.edit({json:JSON.stringify(e)})}),t,s,this.renderTemplateOrSlot("foxycomplete:after"))}__renderLocations(e){const{lang:t,ns:s}=this,i=e.location_filtering,n=!this.in("idle")||this.disabledSelector.matches("locations",!0),a=this.readonlySelector.matches("locations",!0),r="blacklist"===i.shipping_filter_type?"block":"allow",l="both"===i.usage?"copy":"blacklist"===i.billing_filter_type?"block":"allow",d=()=>{if("both"===i.usage)i.billing_filter_type=i.shipping_filter_type,i.billing_filter_values=i.shipping_filter_values;else{const e=Object.keys(i.billing_filter_values).length>0,t=Object.keys(i.shipping_filter_values).length>0;i.usage=e||t?e&&!t?"billing":t&&!e?"shipping":"independent":"none"}};return o(H||(H=Z` <div data-testid="locations"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="location_plural" ns="${0}"> </foxy-i18n> <div class="grid sm-grid-cols-2 bg-contrast-10" style="gap:1px"> <x-group class="bg-base pt-m"> <foxy-i18n class="${0}" slot="header" lang="${0}" key="shipping" ns="${0}"> </foxy-i18n> <x-choice data-testid="locations-shipping-choice" .items="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> <foxy-i18n slot="allow-label" lang="${0}" key="allowlist" ns="${0}"></foxy-i18n> <foxy-i18n slot="block-label" lang="${0}" key="blocklist" ns="${0}"></foxy-i18n> <x-countries-list data-testid="locations-shipping-list" countries="${0}" regions="${0}" class="mb-m" href="${0}" slot="${0}" lang="${0}" ns="${0}" ?disabled="${0}" ?readonly="${0}" @update:countries="${0}"> </x-countries-list> </x-choice> </x-group> <x-group class="bg-base pt-m"> <foxy-i18n class="${0}" slot="header" lang="${0}" key="billing" ns="${0}"> </foxy-i18n> <x-choice data-testid="locations-billing-choice" .items="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> <foxy-i18n slot="allow-label" lang="${0}" key="allowlist" ns="${0}"></foxy-i18n> <foxy-i18n slot="block-label" lang="${0}" key="blocklist" ns="${0}"></foxy-i18n> <foxy-i18n slot="copy-label" lang="${0}" key="same_as_shipping" ns="${0}"> </foxy-i18n> <x-countries-list data-testid="locations-billing-list" countries="${0}" regions="${0}" class="mb-m" href="${0}" slot="${0}" lang="${0}" ns="${0}" ?disabled="${0}" ?readonly="${0}" ?hidden="${0}" @update:countries="${0}"> </x-countries-list> </x-choice> </x-group> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("locations:before"),n?"text-disabled":"",t,s,n?"text-disabled":"text-tertiary",t,s,["allow","block"],r,n,a,(t=>{"both"!==i.usage&&(i.usage="independent"),i.shipping_filter_type="block"===t.detail?"blacklist":"whitelist",d(),this.edit({json:JSON.stringify(e)})}),t,s,t,s,JSON.stringify(i.shipping_filter_values),this.regions,this.countries,r,t,s,n,a,(t=>{i.shipping_filter_values=t.currentTarget.countries,d(),this.edit({json:JSON.stringify(e)})}),n?"text-disabled":"text-tertiary",t,s,["allow","block","copy"],l,n,a,(t=>{"copy"===t.detail?i.usage="both":(i.usage="independent",i.billing_filter_type="block"===t.detail?"blacklist":"whitelist"),d(),this.edit({json:JSON.stringify(e)})}),t,s,t,s,t,s,JSON.stringify(i.billing_filter_values),this.regions,this.countries,l,t,s,n,a,"copy"===l,(t=>{i.billing_filter_values=t.currentTarget.countries,d(),this.edit({json:JSON.stringify(e)})}),this.renderTemplateOrSlot("locations:after"))}__renderHiddenFields(e){const{lang:t,ns:s}=this,i=[],n=[],a=e.cart_display_config,r=!this.in("idle")||this.disabledSelector.matches("hidden-fields",!0),l=this.readonlySelector.matches("hidden-fields",!0);for(const e in a){if(!e.startsWith("show_"))continue;const t=e.substring(5);i.push(t),"required"!==a.usage||a[e]||n.push(t)}"required"===a.usage&&n.push(...a.hidden_product_options);const d=()=>{a.usage="required",i.includes(this.__addHiddenFieldInputValue)?a[`show_${this.__addHiddenFieldInputValue}`]=!1:a.hidden_product_options.includes(this.__addHiddenFieldInputValue)||a.hidden_product_options.push(this.__addHiddenFieldInputValue),this.edit({json:JSON.stringify(e)}),this.__addHiddenFieldInputValue=""},c="calc(var(--lumo-border-radius-l) / 1.2)",u=0===n.length?[c]:["0","0",c,c],g=r||!this.__addHiddenFieldInputValue;return o(I||(I=Z` <div data-testid="hidden-fields"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="hidden_fields" ns="${0}"> </foxy-i18n> <div class="divide-y divide-contrast-10" data-testid="hidden-fields-list"> ${0} </div> <div data-testid="hidden-fields-new" style="border-radius:${0}" class="${0}"> <input placeholder="${0}" class="w-full bg-transparent appearance-none h-m px-m focus-outline-none" list="hidden-fields-list" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> <datalist id="hidden-fields-list"> ${0} </datalist> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:add" class="icon-inline text-m"></iron-icon> </button> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("hidden-fields:before"),r?"text-disabled":"",t,s,n.map((n=>o(z||(z=Z` <div class="${0}"> ${0} <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m m-auto"></iron-icon> </button> </div> `),h({"h-m ml-m pr-xs flex items-center justify-between":!0,"text-secondary":l,"text-disabled":r}),i.includes(n)?o(A||(A=Z`<foxy-i18n lang="${0}" key="${0}" ns="${0}"></foxy-i18n>`),t,n,s):o(D||(D=Z`<span>${0}</span>`),n),this.t("delete"),h({"w-xs h-xs rounded-full transition-colors":!0,"hover-bg-error-10 hover-text-error":!r,"focus-outline-none focus-ring-2 ring-inset ring-error-50":!r,"cursor-default":r,flex:!l,hidden:l}),r,(()=>{"boolean"==typeof a[`show_${n}`]?a[`show_${n}`]=!0:a.hidden_product_options=a.hidden_product_options.filter((e=>e!==n)),this.edit({json:JSON.stringify(e)})})))),u.join(" "),h({"h-m flex items-center ring-inset ring-primary-50 focus-within-ring-2":!0,"border-t border-contrast-10":n.length>0,flex:!l,hidden:l}),this.t("add_field"),f(this.__addHiddenFieldInputValue),r,l,(e=>"Enter"===e.key&&d()),(e=>{this.__addHiddenFieldInputValue=e.currentTarget.value}),i.filter((e=>!n.includes(e))).map((e=>o(G||(G=Z`<option value="${0}">${0}</option>`),e,this.t(e)))),this.t("add_field"),h({"w-xs h-xs mr-xs flex-shrink-0 ring-inset ring-success-50":!0,"flex items-center justify-center rounded-full transition-colors":!0,"bg-contrast-5 text-disabled cursor-default":g,"bg-success-10 text-success cursor-pointer":!g,"hover-bg-success hover-text-success-contrast":!g,"focus-outline-none focus-ring-2":!g}),g,d,this.renderTemplateOrSlot("hidden-fields:after"))}__renderCards(e){const{lang:s,ns:i}=this,n=!this.in("idle")||this.disabledSelector.matches("cards",!0),a=this.readonlySelector.matches("cards",!0),r=e.supported_payment_cards;let l,d;"all_cards"===e.csc_requirements?(l=!1,d=!1):"sso_only"===e.csc_requirements?(l=!0,d=!1):(l=!0,d=!0);const c={amex:"American Express",diners:"Diners Club",discover:"Discover",jcb:"JCB",maestro:"Maestro",mastercard:"Mastercard",unionpay:"UnionPay",visa:"Visa"};return o(L||(L=Z` <div data-testid="cards"> ${0} <div class="space-y-xs"> <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="supported_cards" ns="${0}"> </foxy-i18n> <div class="flex flex-wrap m-xs p-s"> ${0} </div> <div class="flex flex-wrap p-s border-t border-contrast-10"> <x-checkbox data-testid="cards-saved-check" class="m-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="leading-s block" lang="${0}" key="skip_csc_for_saved" ns="${0}"> </foxy-i18n> </x-checkbox> <x-checkbox data-testid="cards-sso-check" class="m-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="leading-s block" lang="${0}" key="skip_csc_for_sso" ns="${0}"> </foxy-i18n> </x-checkbox> </div> </x-group> <foxy-i18n class="text-xs leading-s block ${0}" lang="${0}" key="supported_cards_disclaimer" ns="${0}"> </foxy-i18n> </div> ${0} </div> `),this.renderTemplateOrSlot("cards:before"),n?"text-disabled":"",s,i,Object.entries(t).map((([t,s])=>{if(!c[t])return;const i=r.includes(t);return o(U||(U=Z` <div class="${0}"> <label class="${0}"> <div class="h-s">${0}</div> <div class="text-s font-medium mx-s my-auto leading-none"> ${0} </div> <input type="checkbox" class="sr-only" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> </label> </div> `),h({"m-xs rounded":!0,"opacity-50 cursor-default":n,"cursor-pointer ring-primary-50 focus-within-ring-2":!n}),h({"overflow-hidden transition-colors flex rounded-s border":!0,"border-primary bg-primary-10 text-primary":i&&!a,"border-contrast bg-contrast-5 text-secondary":i&&a,"hover-text-body":i&&!n&&!a,"border-contrast-10":!i,"hover-border-primary":!i&&!n&&!a,"hover-text-primary":!i&&!n&&!a}),s,c[t],n,a,i,(s=>{if(a)return s.preventDefault();s.stopPropagation(),s.currentTarget.checked?r.push(t):r.splice(r.indexOf(t),1),this.edit({json:JSON.stringify(e)})}))})),n||"new_cards_only"===e.csc_requirements,a,l,(t=>{e.csc_requirements=t.detail?"sso_only":"all_cards",this.edit({json:JSON.stringify(e)})}),s,i,n,a,d,(t=>{e.csc_requirements=t.detail?"new_cards_only":l?"sso_only":"all_cards",this.edit({json:JSON.stringify(e)})}),s,i,n?"text-disabled":"text-secondary",s,i,this.renderTemplateOrSlot("cards:after"))}__renderCheckoutType(e){const{lang:t,ns:s}=this,i=!this.in("idle")||this.disabledSelector.matches("checkout-type",!0),n=this.readonlySelector.matches("checkout-type",!0);return o(B||(B=Z` <div data-testid="checkout-type"> ${0} <div class="space-y-xs"> <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="checkout_type" ns="${0}"> </foxy-i18n> <x-choice data-testid="checkout-type-choice" ?disabled="${0}" ?readonly="${0}" .items="${0}" .value="${0}" .getText="${0}" @change="${0}"> </x-choice> </x-group> <foxy-i18n class="text-xs leading-s block ${0}" lang="${0}" key="checkout_type_helper_text" ns="${0}"> </foxy-i18n> </div> ${0} </div> `),this.renderTemplateOrSlot("checkout-type:before"),i?"text-disabled":"",t,s,i,n,["default_account","default_guest","guest_only","account_only"],e.checkout_type,(e=>this.t(`checkout_type_${e}`)),(t=>{e.checkout_type=t.detail,this.edit({json:JSON.stringify(e)})}),i?"text-disabled":"text-secondary",t,s,this.renderTemplateOrSlot("checkout-type:after"))}__renderConsent(e){const{lang:t,ns:s}=this,i=e.tos_checkbox_settings,n=e.newsletter_subscribe,a=e.eu_secure_data_transfer_consent,r=!this.in("idle")||this.disabledSelector.matches("consent",!0),l=this.readonlySelector.matches("consent",!0),d="margin-left: calc(1.125rem + (var(--lumo-space-m) * 2))";return o(P||(P=Z` <div data-testid="consent"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="consent" ns="${0}"> </foxy-i18n> <x-checkbox data-testid="consent-tos-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" class="m-m" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="display_tos_link" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s ${0}" lang="${0}" key="display_tos_link_explainer" ns="${0}"> </foxy-i18n> </div> <div slot="content" ?hidden="${0}"> <vaadin-text-field data-testid="consent-tos-field" label="${0}" class="w-full mt-m" placeholder="https://example.com/path/to/tos" clear-button-visible ?disabled="${0}" ?readonly="${0}" .value="${0}" @input="${0}"> </vaadin-text-field> <div class="flex flex-wrap -mx-s -mb-s mt-s"> <x-checkbox data-testid="consent-tos-require-check" class="m-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="leading-s block" lang="${0}" key="require_consent" ns="${0}"> </foxy-i18n> </x-checkbox> <x-checkbox data-testid="consent-tos-state-check" class="m-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="leading-s block" lang="${0}" key="checked_by_default" ns="${0}"> </foxy-i18n> </x-checkbox> </div> </div> </x-checkbox> <div style="${0}" class="border-b border-contrast-10"></div> <x-checkbox data-testid="consent-mail-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" class="m-m" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="newsletter_subscribe" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s ${0}" lang="${0}" key="newsletter_subscribe_explainer" ns="${0}"> </foxy-i18n> </div> </x-checkbox> <div style="${0}" class="border-b border-contrast-10"></div> <x-checkbox data-testid="consent-sdta-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" class="m-m" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="display_sdta" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s ${0}" lang="${0}" key="display_sdta_explainer" ns="${0}"> </foxy-i18n> </div> </x-checkbox> </x-group> ${0} </div> `),this.renderTemplateOrSlot("consent:before"),r?"text-disabled":"",t,s,r,l,"required"===i.usage||"optional"===i.usage,(t=>{i.initial_state=t.detail?i.initial_state:"unchecked",i.is_hidden=!1,i.usage=t.detail?"required":"none",i.url=t.detail?i.url:"",this.edit({json:JSON.stringify(e)})}),t,s,r?"text-disabled":"text-secondary",t,s,"none"===i.usage,this.t("location_url"),r,l,i.url,(t=>{i.url=t.currentTarget.value,this.edit({json:JSON.stringify(e)})}),r,l,"required"===i.usage,(t=>{i.usage=t.detail?"required":"optional",this.edit({json:JSON.stringify(e)})}),t,s,r,l,"checked"===i.initial_state,(t=>{i.initial_state=t.detail?"checked":"unchecked",this.edit({json:JSON.stringify(e)})}),t,s,d,r,l,"required"===n.usage,(t=>{n.usage=t.detail?"required":"none",this.edit({json:JSON.stringify(e)})}),t,s,r?"text-disabled":"text-secondary",t,s,d,r,l,"required"===a.usage,(t=>{a.usage=t.detail?"required":"none",this.edit({json:JSON.stringify(e)})}),t,s,r?"text-disabled":"text-secondary",t,s,this.renderTemplateOrSlot("consent:after"))}__renderFields(e){const{lang:t,ns:s}=this,i=!this.in("idle")||this.disabledSelector.matches("fields",!0),n=this.readonlySelector.matches("fields",!0),a=e.custom_checkout_field_requirements;return o(M||(M=Z` <div data-testid="fields"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="field_plural" ns="${0}"> </foxy-i18n> <div class="bg-contrast-10 grid grid-cols-1 sm-grid-cols-2" style="gap:1px"> ${0} <div class="bg-base hidden sm-block"></div> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("fields:before"),i?"text-disabled":"",t,s,Object.entries({cart_controls:["enabled","disabled"],coupon_entry:["enabled","disabled"],billing_first_name:["default","optional","required","hidden"],billing_last_name:["default","optional","required","hidden"],billing_company:["default","optional","required","hidden"],billing_tax_id:["default","optional","required","hidden"],billing_phone:["default","optional","required","hidden"],billing_address1:["default","optional","required","hidden"],billing_address2:["default","optional","required","hidden"],billing_city:["default","optional","required","hidden"],billing_region:["default","optional","required","hidden"],billing_postal_code:["default","optional","required","hidden"],billing_country:["default","optional","required","hidden"]}).map((([r,l])=>o(W||(W=Z` <label class="${0}"> <foxy-i18n class="flex-1" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> <div class="${0}"> ${0} </div> <div class="${0}"> <select data-testid="fields-${0}" class="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} </select> <iron-icon class="pointer-events-none icon-inline text-xl" icon="icons:expand-more"> </iron-icon> </div> </label> `),h({"flex items-center pl-m bg-base":!0,"text-secondary":n,"text-disabled":i}),t,r.replace("billing_",""),s,h({"flex items-center text-right font-medium h-s px-s m-xs":n,hidden:!n}),this.t(l.find((e=>a[r]===e))),h({"px-s m-xs flex items-center rounded leading-none":!0,"ring-primary-50 ring-inset focus-within-ring-2":!i,"hover-text-primary":!i,"cursor-pointer":!i,"cursor-default":i,flex:!n,hidden:n}),r,h({"h-s mr-xs text-right appearance-none bg-transparent font-medium":!0,"focus-outline-none cursor-pointer":!i,"cursor-default":i}),i,n,(t=>{const s=t.currentTarget,i=s.options[s.options.selectedIndex].value;a[r]=i,this.edit({json:JSON.stringify(e)})}),l.map((e=>o(K||(K=Z` <option value="${0}" ?selected="${0}"> ${0} </option> `),e,a[r]===e,this.t(e))))))),this.renderTemplateOrSlot("fields:after"))}__renderGoogleAnalytics(e){const{lang:t,ns:s}=this,i=e.analytics_config,n=i.google_tag,a=i.google_analytics,r=!this.in("idle")||this.disabledSelector.matches("google-analytics",!0),l=this.readonlySelector.matches("google-analytics",!0);return o(Q||(Q=Z` <div data-testid="google-analytics"> ${0} <x-group frame> <span class="${0}" slot="header">Google Analytics</span> <foxy-i18n class="block bg-error-10 text-error font-medium rounded-t p-m" infer="" key="ga_deprecation_notice"> </foxy-i18n> <div class="p-m space-y-m"> <vaadin-text-field data-testid="google-analytics-field" style="--lumo-border-radius:var(--lumo-border-radius-s)" class="w-full" label="${0}" placeholder="UA-1234567-1" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" clear-button-visible @keydown="${0}" @input="${0}"> </vaadin-text-field> <x-checkbox data-testid="google-analytics-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="ga_include_on_site" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s ${0}" lang="${0}" key="ga_include_on_site_explainer" ns="${0}"> </foxy-i18n> </div> </x-checkbox> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("google-analytics:before"),r?"text-disabled":"",this.t("ga_account_id"),this.t("ga_account_id_explainer"),f(a.account_id),r,l,(e=>"Enter"===e.key&&this.submit()),(t=>{a.account_id=t.currentTarget.value,a.usage=a.account_id?"required":"none",i.usage=a.account_id||n.account_id?"required":"none",this.edit({json:JSON.stringify(e)})}),r,l,a.include_on_site,(t=>{a.include_on_site=t.detail,this.edit({json:JSON.stringify(e)})}),t,s,r?"text-disabled":"text-secondary",t,s,this.renderTemplateOrSlot("google-analytics:after"))}__renderGoogleTag(e){const t=e.analytics_config,s=t.google_tag,i=t.google_analytics,n=!this.in("idle")||this.disabledSelector.matches("google-tag",!0),a=this.readonlySelector.matches("google-tag",!0);return o(X||(X=Z` <div data-testid="google-tag"> ${0} <x-group frame> <span class="${0}" slot="header">Google Tag</span> <div class="p-m space-y-m"> <vaadin-text-field data-testid="google-tag-account-id" style="--lumo-border-radius:var(--lumo-border-radius-s)" class="w-full" label="${0}" placeholder="G-123456789" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" clear-button-visible @keydown="${0}" @input="${0}"> </vaadin-text-field> <vaadin-text-field data-testid="google-tag-send-to" style="--lumo-border-radius:var(--lumo-border-radius-s)" class="w-full" label="${0}" placeholder="AW-123456789/sABDCLqU3K2BEJb8cxDE" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" clear-button-visible @keydown="${0}" @input="${0}"> </vaadin-text-field> <p class="text-xs text-secondary"> <foxy-i18n infer="" key="gt_usage_notice"></foxy-i18n> <a target="_blank" class="cursor-pointer group text-primary rounded-s font-medium focus-outline-none focus-ring-2 focus-ring-primary-50" href="https://wiki.foxycart.com/v/2.0/analytics#google_tag_ga4_google_ads" rel="nofollow noreferrer noopener"> <foxy-i18n class="transition-opacity group-hover-opacity-80" infer="" key="gt_docs_link"> </foxy-i18n> </a> </p> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("google-tag:before"),n?"text-disabled":"",this.t("gt_account_id"),this.t("gt_account_id_explainer"),f(s.account_id),n,a,(e=>"Enter"===e.key&&this.submit()),(o=>{s.account_id=o.currentTarget.value,s.usage=s.account_id?"required":"none",t.usage=s.account_id||i.account_id?"required":"none",this.edit({json:JSON.stringify(e)})}),this.t("gt_send_to"),this.t("gt_send_to_explainer"),f(s.send_to),n,a,(e=>"Enter"===e.key&&this.submit()),(o=>{s.send_to=o.currentTarget.value,s.usage=s.account_id?"required":"none",t.usage=s.account_id||i.account_id?"required":"none",this.edit({json:JSON.stringify(e)})}),this.renderTemplateOrSlot("google-tag:after"))}__renderTroubleshooting(e){const{lang:t,ns:s}=this,i=e.debug,n=!this.in("idle")||this.disabledSelector.matches("troubleshooting",!0),a=this.readonlySelector.matches("troubleshooting",!0);return o(Y||(Y=Z` <div data-testid="troubleshooting"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="troubleshooting" ns="${0}"> </foxy-i18n> <div class="p-m space-y-m"> <x-checkbox data-testid="troubleshooting-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="troubleshooting_debug" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s ${0}" lang="${0}" key="troubleshooting_debug_explainer" ns="${0}"> </foxy-i18n> </div> </x-checkbox> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("troubleshooting:before"),n?"text-disabled":"",t,s,n,a,"required"===i.usage,(t=>{i.usage=t.detail?"required":"none",this.edit({json:JSON.stringify(e)})}),t,s,n?"text-disabled":"text-secondary",t,s,this.renderTemplateOrSlot("troubleshooting:after"))}}customElements.define("foxy-template-config-form",te);export{te as TemplateConfigForm};
@@ -1 +1 @@
1
- import"./shared-bdd5c908.js";import"./shared-77a700fe.js";import"./shared-025cab8b.js";import"./shared-3d6f0788.js";import"./shared-0479553e.js";import"./foxy-spinner.js";import"./shared-d1c45954.js";import{_ as e}from"./shared-98755831.js";import{c as t,h as s}from"./shared-7f33a83a.js";import"./shared-acda8da2.js";import"./shared-27d23dfd.js";import"./shared-4494ebfa.js";import{S as a,T as i,a as r}from"./shared-04634a6f.js";import{c as n}from"./shared-4e709717.js";import{C as o,a as d}from"./shared-b34bef61.js";import"./shared-80792dc8.js";import"./shared-0237bfae.js";import"./shared-64f2d6de.js";import"./shared-7c761c65.js";import"./shared-14bb06d4.js";import"./shared-df1816e8.js";import{G as l}from"./shared-049d80d0.js";import"./shared-98eec370.js";import{P as c}from"./shared-394c2425.js";import{C as h}from"./shared-de790de9.js";import{N as m}from"./shared-eb900735.js";import{l as p}from"./shared-f3b35364.js";import"./shared-f0c8a5bd.js";import"./shared-313a39ef.js";import"./shared-a8cf402a.js";import"./shared-64657919.js";import"./shared-11c2efc8.js";import"./shared-a89cb472.js";import"./shared-509a2f52.js";import"./shared-520be2e9.js";import"./shared-40638f2c.js";import"./shared-d3bf9ac0.js";import"./shared-d6276c83.js";let f,u,$,v,b,y,_,x=e=>e;const g=a(i(h(r(m,"template-form"))));class j extends g{constructor(){super(...arguments),this.templates={},this.__cacheState="idle",this.__contentChoice="default"}static get properties(){return e(e({},super.properties),{},{__cacheState:{attribute:!1},__contentChoice:{attribute:!1}})}static get styles(){return[...super.styles,t(f||(f=x`#cached-content::part(input-field){max-height:15em}`))]}static get scopedElements(){return{"foxy-internal-confirm-dialog":customElements.get("foxy-internal-confirm-dialog"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-text-area":customElements.get("vaadin-text-area"),"vaadin-button":customElements.get("vaadin-button"),"x-property-table":c,"x-choice":o,"x-group":l}}render(){var e,t;const{hiddenSelector:a,href:i,lang:r,ns:o}=this,d=i?"delete":"create",l=this.in("busy"),c=this.in("fail");return s(u||(u=x` <div class="space-y-m relative"> ${0} ${0} ${0} ${0} <div data-testid="spinner" class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),a.matches("description",!0)?"":this.__renderDescription(),a.matches("content",!0)?"":this.__renderContent(),a.matches("timestamps",!0)||!i?"":this.__renderTimestamps(),a.matches(d)?"":this.__renderAction(d),n({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!l&&!c}),c?"error":l?"busy":"empty",r,o,null!==(t=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"")}__renderDescription(){var e,t;const a="description";return s($||($=x` <div> ${0} <vaadin-text-field data-testid="${0}" class="w-full mb-s" label="${0}" ?disabled="${0}" ?readonly="${0}" .value="${0}" @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot(`${a}:before`),a,this.t(a),!this.in("idle")||this.disabledSelector.matches(a),this.readonlySelector.matches(a),null!==(t=null===(e=this.form)||void 0===e?void 0:e.description)&&void 0!==t?t:"",(e=>"Enter"===e.key&&this.submit()),(e=>{this.edit({description:e.currentTarget.value})}),this.renderTemplateOrSlot(`${a}:after`))}__renderContent(){var e;const t="content",a=!this.in("idle")||this.disabledSelector.matches(t),i=this.readonlySelector.matches(t),r=this.form.content_url?"url":this.form.content?"clipboard":this.__contentChoice;return s(v||(v=x` <div data-testid="content"> ${0} <x-group frame> <foxy-i18n class="${0}" lang="${0}" slot="header" key="template" ns="${0}"> </foxy-i18n> <x-choice data-testid="content-type" .value="${0}" .items="${0}" ?readonly="${0}" ?disabled="${0}" @change="${0}"> ${0} <div style="--lumo-border-radius:var(--lumo-border-radius-s)" slot="url" ?hidden="${0}"> <div class="flex items-center mt-0 mb-m"> <vaadin-text-field data-testid="content-url" class="mr-s flex-grow" ?readonly="${0}" ?disabled="${0}" .value="${0}" @keydown="${0}" @input="${0}"> </vaadin-text-field> <vaadin-button data-testid="cache" class="relative" ?hidden="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n class="${0}" lang="${0}" key="cache" ns="${0}"> </foxy-i18n> <div class="${0}"> <foxy-spinner layout="no-label" class="m-auto" state="${0}" lang="${0}" ns="${0}"> </foxy-spinner> </div> </vaadin-button> </div> </div> <div style="--lumo-border-radius:var(--lumo-border-radius-s)" slot="clipboard" ?hidden="${0}"> <vaadin-text-area id="cached-content" data-testid="content-clipboard" class="w-full mb-m" ?readonly="${0}" ?disabled="${0}" .value="${0}" @input="${0}"> </vaadin-text-area> </div> </x-choice> </x-group> ${0} </div> `),this.renderTemplateOrSlot("content:before"),n({"transition-colors":!0,"text-disabled":a}),this.lang,this.ns,r,["default","url","clipboard"],i,a,(e=>{e instanceof d&&(this.edit({content:"",content_url:""}),this.__contentChoice=e.detail)}),["default","url","clipboard"].map((e=>s(b||(b=x` <div slot="${0}-label" class="py-s leading-s"> <foxy-i18n class="block" lang="${0}" key="template_${0}" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-s opacity-70" lang="${0}" key="template_${0}_explainer" ns="${0}"> </foxy-i18n> </div> `),e,this.lang,e,this.ns,this.lang,e,this.ns))),"url"!==r,i,a,this.form.content_url,(e=>"Enter"===e.key&&this.submit()),(e=>{const t=e.currentTarget.value;this.edit({content:"",content_url:t})}),i||this.form.content_url!==(null===(e=this.data)||void 0===e?void 0:e.content_url),a||"busy"===this.__cacheState,this.__cache,n({"relative transition-opacity":!0,"opacity-0":"idle"!==this.__cacheState}),this.lang,this.ns,n({"absolute inset-0 flex transition-opacity":!0,"opacity-0":"idle"===this.__cacheState}),"fail"===this.__cacheState?"error":"busy",this.lang,this.ns,"clipboard"!==r,i,a,p(this.form.content),(e=>{const t=e.currentTarget.value;this.edit({content:t,content_url:""})}),this.renderTemplateOrSlot("content:after"))}__renderTimestamps(){const e="timestamps";return s(y||(y=x` <div> ${0} <x-property-table data-testid="timestamps" .items="${0}"> </x-property-table> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),["date_modified","date_created"].map((e=>{var t;return{name:this.t(e),value:(null===(t=this.data)||void 0===t?void 0:t[e])?this.t("date",{value:new Date(this.data[e])}):""}})),this.renderTemplateOrSlot(`${e}:after`))}__renderAction(e){const{disabledSelector:t,href:a,lang:i,ns:r}=this,n=this.in({idle:{template:{dirty:"valid"}}}),o=this.in({idle:{snapshot:{dirty:"valid"}}}),d=!this.in("idle")||t.matches(e,!0),l=n||o;return s(_||(_=x` <div> ${0} <foxy-internal-confirm-dialog message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" lang="${0}" ns="${0}" id="confirm" data-testid="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <vaadin-button class="w-full" theme="${0}" data-testid="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="${0}" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),i,r,(e=>{e.detail.cancelled||this.delete()}),this.in("idle")?a?"error":"primary success":"",e,this.in({idle:"template"})&&!l||d,(t=>{if("delete"===e){this.renderRoot.querySelector("#confirm").show(t.currentTarget)}else this.submit()}),r,e,i,this.renderTemplateOrSlot(`${e}:after`))}async __cache(){var e,t;this.__cacheState="busy";try{const s=null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:cache"].href)&&void 0!==t?t:"",a=await new j.API(this).fetch(s,{method:"POST"});this.__cacheState=a.ok?"idle":"fail"}catch(e){this.__cacheState="fail"}}}customElements.define("foxy-template-form",j);export{j as TemplateForm};
1
+ import"./shared-b95ef318.js";import"./shared-cb6f2388.js";import"./shared-0dc1d012.js";import"./shared-e6066f46.js";import"./shared-0479553e.js";import"./foxy-spinner.js";import"./shared-86768244.js";import{_ as e}from"./shared-98755831.js";import{h as t}from"./shared-7f33a83a.js";import"./shared-e28f16db.js";import"./shared-c40d85dc.js";import"./shared-6f465111.js";import{S as s,T as a,a as i}from"./shared-16b542bc.js";import{c as r}from"./shared-4e709717.js";import{C as o,a as n}from"./shared-ee13d1a6.js";import"./shared-9e60ef60.js";import"./shared-6b53ef85.js";import"./shared-aeec3cab.js";import"./shared-f3f5e87e.js";import"./shared-068480a3.js";import"./shared-0543c6e0.js";import{G as d}from"./shared-08ff9a8d.js";import"./shared-4c9f96ec.js";import{P as l}from"./shared-7bf46d6d.js";import{C as c}from"./shared-de790de9.js";import{N as h}from"./shared-eb900735.js";import"./shared-7a290f36.js";import"./shared-0c02b4ee.js";import"./shared-5dd31b4e.js";import"./shared-a8cf402a.js";import"./shared-d519a301.js";import"./shared-ca58ef47.js";import"./shared-64657919.js";import"./shared-e5c19ea3.js";import"./shared-11c2efc8.js";import"./shared-a89cb472.js";import"./shared-509a2f52.js";import"./shared-cd096e97.js";import"./shared-4db2c7b1.js";import"./shared-d3bf9ac0.js";import"./shared-d6276c83.js";let m,f,p,u,_,b,y=e=>e;const $=s(a(c(i(h,"template-form"))));class v extends ${constructor(){super(...arguments),this.templates={},this.__cacheState="idle",this.__contentChoice="default"}static get properties(){return e(e({},super.properties),{},{__cacheState:{attribute:!1},__contentChoice:{attribute:!1}})}static get scopedElements(){return{"foxy-internal-confirm-dialog":customElements.get("foxy-internal-confirm-dialog"),"foxy-internal-source-control":customElements.get("foxy-internal-source-control"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-button":customElements.get("vaadin-button"),"x-property-table":l,"x-choice":o,"x-group":d}}render(){var e,s;const{hiddenSelector:a,href:i,lang:o,ns:n}=this,d=i?"delete":"create",l=this.in("busy"),c=this.in("fail");return t(m||(m=y` <div class="space-y-m relative"> ${0} ${0} ${0} ${0} <div data-testid="spinner" class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),a.matches("description",!0)?"":this.__renderDescription(),a.matches("content",!0)?"":this.__renderContent(),a.matches("timestamps",!0)||!i?"":this.__renderTimestamps(),a.matches(d)?"":this.__renderAction(d),r({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!l&&!c}),c?"error":l?"busy":"empty",o,n,null!==(s=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==s?s:"")}async _sendPost(e){const t=await super._sendPost(e);if(!t.content_url)return t;this.__cacheState="busy";const s=t._links["fx:cache"].href,a=await new v.API(this).fetch(s,{method:"POST"});return this.__cacheState=a.ok?"idle":"fail",await this._fetch(t._links.self.href)}async _sendPatch(e){const t=await super._sendPatch(e);if(!e.content_url)return t;this.__cacheState="busy";const s=t._links["fx:cache"].href,a=await new v.API(this).fetch(s,{method:"POST"});return this.__cacheState=a.ok?"idle":"fail",await this._fetch(t._links.self.href)}__renderDescription(){var e,s;const a="description";return t(f||(f=y` <div> ${0} <vaadin-text-field data-testid="${0}" class="w-full mb-s" label="${0}" ?disabled="${0}" ?readonly="${0}" .value="${0}" @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot(`${a}:before`),a,this.t(a),!this.in("idle")||this.disabledSelector.matches(a),this.readonlySelector.matches(a),null!==(s=null===(e=this.form)||void 0===e?void 0:e.description)&&void 0!==s?s:"",(e=>"Enter"===e.key&&this.submit()),(e=>{this.edit({description:e.currentTarget.value})}),this.renderTemplateOrSlot(`${a}:after`))}__renderContent(){var e,s;const a="content",i=this.form.content_url,o=this.form.content,d=i?"url":o?"clipboard":this.__contentChoice,l=!this.in("idle")||this.disabledSelector.matches(a),c=this.readonlySelector.matches(a),h=c||!(null===(e=this.data)||void 0===e?void 0:e.content_url)||i!==this.data.content_url;return t(p||(p=y` <div data-testid="content"> <x-group frame> <foxy-i18n class="${0}" lang="${0}" slot="header" key="template" ns="${0}"> </foxy-i18n> <x-choice data-testid="content-type" .value="${0}" .items="${0}" ?readonly="${0}" ?disabled="${0}" @change="${0}"> ${0} <div style="--lumo-border-radius:var(--lumo-border-radius-s)" class="mb-m" slot="url" ?hidden="${0}"> <div class="flex items-end mt-0"> <vaadin-text-field data-testid="content-url" placeholder="https://example.com/my-template" label="${0}" class="flex-1 min-w-0" ?readonly="${0}" ?disabled="${0}" .value="${0}" @keydown="${0}" @input="${0}"> </vaadin-text-field> <vaadin-button data-testid="cache" class="relative flex-shrink-0 ml-s" ?hidden="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n class="${0}" lang="${0}" key="cache" ns="${0}"> </foxy-i18n> <div class="${0}"> <foxy-spinner layout="no-label" class="m-auto" state="${0}" lang="${0}" ns="${0}"> </foxy-spinner> </div> </vaadin-button> </div> <foxy-internal-source-control placeholder="${0}" label="${0}" infer="content" class="mt-m${0}"> </foxy-internal-source-control> </div> <foxy-internal-source-control placeholder="${0}" label="${0}" infer="content" class="mb-m${0}" style="--lumo-border-radius:var(--lumo-border-radius-s)" slot="clipboard"> </foxy-internal-source-control> </x-choice> </x-group> </div> `),r({"transition-colors":!0,"text-disabled":l}),this.lang,this.ns,d,["default","url","clipboard"],c,l,(e=>{e instanceof n&&(this.edit({content:"",content_url:""}),this.__contentChoice=e.detail)}),["default","url","clipboard"].map((e=>t(u||(u=y` <div slot="${0}-label" class="py-s leading-s"> <foxy-i18n class="block" lang="${0}" key="template_${0}" ns="${0}"> </foxy-i18n> </div> `),e,this.lang,e,this.ns))),"url"!==d,this.t("url"),c,l,this.form.content_url,(e=>"Enter"===e.key&&this.submit()),(e=>{const t=e.currentTarget.value;this.edit({content:"",content_url:t})}),h,l||"busy"===this.__cacheState,this.__cache,r({"relative transition-opacity":!0,"opacity-0":"idle"!==this.__cacheState}),this.lang,this.ns,r({"absolute inset-0 flex transition-opacity":!0,"opacity-0":"idle"===this.__cacheState}),"fail"===this.__cacheState?"error":"busy",this.lang,this.ns,this.t("url_source_placeholder"),this.t("url_source_label"),(null===(s=this.data)||void 0===s?void 0:s.content)?"":" hidden",this.t("clipboard_source_placeholder"),this.t("clipboard_source_label"),"clipboard"===d?"":" hidden")}__renderTimestamps(){const e="timestamps";return t(_||(_=y` <div> ${0} <x-property-table data-testid="timestamps" .items="${0}"> </x-property-table> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),["date_modified","date_created"].map((e=>{var t;return{name:this.t(e),value:(null===(t=this.data)||void 0===t?void 0:t[e])?this.t("date",{value:new Date(this.data[e])}):""}})),this.renderTemplateOrSlot(`${e}:after`))}__renderAction(e){const{disabledSelector:s,href:a,lang:i,ns:r}=this,o=this.in({idle:{template:{dirty:"valid"}}}),n=this.in({idle:{snapshot:{dirty:"valid"}}}),d=!this.in("idle")||s.matches(e,!0),l=o||n;return t(b||(b=y` <div> ${0} <foxy-internal-confirm-dialog message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" lang="${0}" ns="${0}" id="confirm" data-testid="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <vaadin-button class="w-full" theme="${0}" data-testid="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="${0}" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),i,r,(e=>{e.detail.cancelled||this.delete()}),this.in("idle")?a?"error":"primary success":"",e,this.in({idle:"template"})&&!l||d,(t=>{if("delete"===e){this.renderRoot.querySelector("#confirm").show(t.currentTarget)}else this.submit()}),r,e,i,this.renderTemplateOrSlot(`${e}:after`))}async __cache(){var e,t;this.__cacheState="busy";try{const s=null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:cache"].href)&&void 0!==t?t:"",a=await new v.API(this).fetch(s,{method:"POST"});this.__cacheState=a.ok?"idle":"fail",this.refresh()}catch(e){this.__cacheState="fail"}}}customElements.define("foxy-template-form",v);export{v as TemplateForm};
@@ -1 +1 @@
1
- import"./shared-0479553e.js";import"./foxy-spinner.js";import{a as r}from"./shared-04634a6f.js";import{T as s}from"./shared-8ac00abe.js";import{h as e}from"./shared-7f33a83a.js";import"./shared-acda8da2.js";import"./shared-f0c8a5bd.js";import"./shared-313a39ef.js";import"./shared-d1c45954.js";import"./shared-98755831.js";import"./shared-64657919.js";import"./shared-a8cf402a.js";import"./shared-de790de9.js";import"./shared-d3bf9ac0.js";import"./shared-07e32de2.js";import"./shared-eb900735.js";import"./shared-509a2f52.js";import"./shared-d6276c83.js";import"./shared-a89cb472.js";import"./shared-4e709717.js";let a,d,t=r=>r;const o=r(s,"template-set-card");class m extends o{renderBody(){return super.renderBody({title:r=>e(a||(a=t`${0}`),r.description),subtitle:r=>e(d||(d=t`${0}`),r.code)})}}customElements.define("foxy-template-set-card",m);export{m as TemplateSetCard};
1
+ import"./shared-0479553e.js";import"./foxy-spinner.js";import{a as r}from"./shared-16b542bc.js";import{T as s}from"./shared-c3c67413.js";import{h as e}from"./shared-7f33a83a.js";import"./shared-e28f16db.js";import"./shared-7a290f36.js";import"./shared-ca58ef47.js";import"./shared-86768244.js";import"./shared-98755831.js";import"./shared-64657919.js";import"./shared-a8cf402a.js";import"./shared-de790de9.js";import"./shared-d3bf9ac0.js";import"./shared-3a252ccd.js";import"./shared-eb900735.js";import"./shared-509a2f52.js";import"./shared-d6276c83.js";import"./shared-a89cb472.js";import"./shared-4e709717.js";let a,t,d=r=>r;const o=r(s,"template-set-card");class m extends o{renderBody(){return super.renderBody({title:r=>e(a||(a=d`${0}`),r.description),subtitle:r=>e(t||(t=d`${0}`),r.code)})}}customElements.define("foxy-template-set-card",m);export{m as TemplateSetCard};
@@ -1 +1 @@
1
- import"./shared-faad86eb.js";import"./shared-491c9063.js";import"./shared-0dd25feb.js";import"./shared-0479553e.js";import{I as e}from"./shared-ec3332b9.js";import"./foxy-nucleon-element.js";import"./foxy-i18n-editor.js";import{_ as t,B as o}from"./shared-98755831.js";import{R as r,a}from"./shared-04634a6f.js";import{i as s}from"./shared-d3bf9ac0.js";import{h as d}from"./shared-7f33a83a.js";import"./shared-df1816e8.js";import"./shared-27d23dfd.js";import"./shared-f0c8a5bd.js";import"./shared-98eec370.js";import"./shared-40638f2c.js";import"./shared-acda8da2.js";import"./shared-bdd5c908.js";import"./shared-b39fce1b.js";import"./shared-50908853.js";import"./shared-d1c45954.js";import"./shared-64657919.js";import"./shared-a8cf402a.js";import"./shared-de790de9.js";import"./shared-eb900735.js";import"./shared-509a2f52.js";import"./shared-d6276c83.js";import"./shared-a89cb472.js";import"./shared-025cab8b.js";import"./shared-3d6f0788.js";import"./shared-80792dc8.js";import"./shared-4e709717.js";import"./foxy-spinner.js";import"./shared-313a39ef.js";import"./shared-af7cde22.js";import"./shared-520be2e9.js";import"./shared-d519a301.js";let i,n,l=e=>e;const h=r(a(e,"template-set-form"));class c extends h{constructor(){super(...arguments),this.paymentMethodSets=null,this.languageStrings=null,this.localeCodes=null,this.languages=null,this.templates={},this.__paymentMethodSetLoaderId="paymentMethodSetLoader",this.__localeCodesLoaderId="localeCodesLoader",this.__languagesLoaderId="languagesLoader"}static get properties(){return t(t({},super.properties),{},{paymentMethodSets:{attribute:"payment-method-sets"},languageStrings:{attribute:"language-strings"},localeCodes:{attribute:"locale-codes"},languages:{}})}static get v8n(){return[({description:e})=>!!e||"description:v8n_required",({description:e})=>!!e&&e.length<=100||"description:v8n_too_long",({code:e})=>!!e||"code:v8n_required",({code:e})=>!!e&&e.length<=50||"code:v8n_too_long",({language:e})=>!!e||"language:v8n_required",({locale_code:e})=>!!e||"locale_code:v8n_required"]}get disabledSelector(){var e,t,r;const a=[];return(null===(e=this.__languagesLoader)||void 0===e?void 0:e.data)||a.push("language"),(null===(t=this.__localeCodesLoader)||void 0===t?void 0:t.data)||a.push("locale-code"),!(null===(r=this.__paymentMethodSetLoader)||void 0===r?void 0:r.data)&&this.form.payment_method_set_uri&&a.push("payment-method-set-uri"),new o(`${a.join(" ")} ${super.disabledSelector}`)}get readonlySelector(){var e;const t=[];return"DEFAULT"===(null===(e=this.data)||void 0===e?void 0:e.code)&&t.push("code","description"),new o(`${t.join(" ")} ${super.readonlySelector}`)}get hiddenSelector(){var e;const t=[];return"DEFAULT"===(null===(e=this.data)||void 0===e?void 0:e.code)&&t.push("delete"),new o(`${t.join(" ")} ${super.hiddenSelector}`)}renderBody(){var e,t,o,r,a,h,c,u,p;const m=Object.entries(null!==(o=null===(t=null===(e=this.__localeCodesLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values)&&void 0!==o?o:{}).map((([e,t])=>({value:e,label:t}))),g=Object.entries(null!==(h=null===(a=null===(r=this.__languagesLoader)||void 0===r?void 0:r.data)||void 0===a?void 0:a.values)&&void 0!==h?h:{}).map((([e,t])=>({value:e,label:t})));return d(i||(i=l` <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <div class="grid grid-cols-1 gap-m sm-grid-cols-2"> <foxy-internal-text-control infer="description"></foxy-internal-text-control> <foxy-internal-text-control infer="code"></foxy-internal-text-control> <foxy-internal-select-control infer="language" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control infer="locale-code" .options="${0}"> </foxy-internal-select-control> </div> <foxy-internal-async-combo-box-control item-label-path="description" item-id-path="_links.self.href" infer="payment-method-set-uri" first="${0}" .selectedItem="${0}"> </foxy-internal-async-combo-box-control> ${0} ${0} `),s(null!==(c=this.languages)&&void 0!==c?c:void 0),this.__languagesLoaderId,(()=>this.requestUpdate()),s(null!==(u=this.localeCodes)&&void 0!==u?u:void 0),this.__localeCodesLoaderId,(()=>this.requestUpdate()),s(this.form.payment_method_set_uri||void 0),this.__paymentMethodSetLoaderId,(()=>this.requestUpdate()),g,m,this.paymentMethodSets,null===(p=this.__paymentMethodSetLoader)||void 0===p?void 0:p.data,this.data&&this.languageStrings&&!this.hiddenSelector.matches("language-overrides",!0)?d(n||(n=l` ${0} <foxy-i18n-editor language-overrides="${0}" selected-language="${0}" infer="language-overrides" href="${0}"> </foxy-i18n-editor> ${0} `),this.renderTemplateOrSlot("language-overrides:before"),this.data._links["fx:language_overrides"].href,this.form.language,this.languageStrings,this.renderTemplateOrSlot("language-overrides:after")):"",super.renderBody())}get __paymentMethodSetLoader(){return this.renderRoot.querySelector(`#${this.__paymentMethodSetLoaderId}`)}get __localeCodesLoader(){return this.renderRoot.querySelector(`#${this.__localeCodesLoaderId}`)}get __languagesLoader(){return this.renderRoot.querySelector(`#${this.__languagesLoaderId}`)}}customElements.define("foxy-template-set-form",c);export{c as TemplateSetForm};
1
+ import"./shared-23923638.js";import"./shared-3a82d3f5.js";import"./shared-1e5292a1.js";import"./shared-0479553e.js";import{I as e}from"./shared-6fb923d5.js";import"./foxy-nucleon-element.js";import"./foxy-i18n-editor.js";import{_ as t,B as o}from"./shared-98755831.js";import{R as r,a}from"./shared-16b542bc.js";import{i as s}from"./shared-d3bf9ac0.js";import{h as d}from"./shared-7f33a83a.js";import"./shared-0543c6e0.js";import"./shared-c40d85dc.js";import"./shared-7a290f36.js";import"./shared-4c9f96ec.js";import"./shared-4db2c7b1.js";import"./shared-e28f16db.js";import"./shared-b95ef318.js";import"./shared-0c02b4ee.js";import"./shared-5dd31b4e.js";import"./shared-86768244.js";import"./shared-64657919.js";import"./shared-a8cf402a.js";import"./shared-de790de9.js";import"./shared-eb900735.js";import"./shared-509a2f52.js";import"./shared-d6276c83.js";import"./shared-a89cb472.js";import"./shared-cb6f2388.js";import"./shared-0dc1d012.js";import"./shared-9e60ef60.js";import"./shared-4e709717.js";import"./foxy-spinner.js";import"./shared-ca58ef47.js";import"./shared-85bc54a6.js";import"./shared-cd096e97.js";import"./shared-d519a301.js";let i,n,l=e=>e;const h=r(a(e,"template-set-form"));class c extends h{constructor(){super(...arguments),this.paymentMethodSets=null,this.languageStrings=null,this.localeCodes=null,this.languages=null,this.templates={},this.__paymentMethodSetLoaderId="paymentMethodSetLoader",this.__localeCodesLoaderId="localeCodesLoader",this.__languagesLoaderId="languagesLoader"}static get properties(){return t(t({},super.properties),{},{paymentMethodSets:{attribute:"payment-method-sets"},languageStrings:{attribute:"language-strings"},localeCodes:{attribute:"locale-codes"},languages:{}})}static get v8n(){return[({description:e})=>!!e||"description:v8n_required",({description:e})=>!!e&&e.length<=100||"description:v8n_too_long",({code:e})=>!!e||"code:v8n_required",({code:e})=>!!e&&e.length<=50||"code:v8n_too_long",({language:e})=>!!e||"language:v8n_required",({locale_code:e})=>!!e||"locale_code:v8n_required"]}get disabledSelector(){var e,t,r;const a=[];return(null===(e=this.__languagesLoader)||void 0===e?void 0:e.data)||a.push("language"),(null===(t=this.__localeCodesLoader)||void 0===t?void 0:t.data)||a.push("locale-code"),!(null===(r=this.__paymentMethodSetLoader)||void 0===r?void 0:r.data)&&this.form.payment_method_set_uri&&a.push("payment-method-set-uri"),new o(`${a.join(" ")} ${super.disabledSelector}`)}get readonlySelector(){var e;const t=[];return"DEFAULT"===(null===(e=this.data)||void 0===e?void 0:e.code)&&t.push("code","description"),new o(`${t.join(" ")} ${super.readonlySelector}`)}get hiddenSelector(){var e;const t=[];return"DEFAULT"===(null===(e=this.data)||void 0===e?void 0:e.code)&&t.push("delete"),new o(`${t.join(" ")} ${super.hiddenSelector}`)}renderBody(){var e,t,o,r,a,h,c,u,p;const m=Object.entries(null!==(o=null===(t=null===(e=this.__localeCodesLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values)&&void 0!==o?o:{}).map((([e,t])=>({value:e,label:t}))),g=Object.entries(null!==(h=null===(a=null===(r=this.__languagesLoader)||void 0===r?void 0:r.data)||void 0===a?void 0:a.values)&&void 0!==h?h:{}).map((([e,t])=>({value:e,label:t})));return d(i||(i=l` <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <div class="grid grid-cols-1 gap-m sm-grid-cols-2"> <foxy-internal-text-control infer="description"></foxy-internal-text-control> <foxy-internal-text-control infer="code"></foxy-internal-text-control> <foxy-internal-select-control infer="language" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control infer="locale-code" .options="${0}"> </foxy-internal-select-control> </div> <foxy-internal-async-combo-box-control item-label-path="description" item-id-path="_links.self.href" infer="payment-method-set-uri" first="${0}" .selectedItem="${0}"> </foxy-internal-async-combo-box-control> ${0} ${0} `),s(null!==(c=this.languages)&&void 0!==c?c:void 0),this.__languagesLoaderId,(()=>this.requestUpdate()),s(null!==(u=this.localeCodes)&&void 0!==u?u:void 0),this.__localeCodesLoaderId,(()=>this.requestUpdate()),s(this.form.payment_method_set_uri||void 0),this.__paymentMethodSetLoaderId,(()=>this.requestUpdate()),g,m,this.paymentMethodSets,null===(p=this.__paymentMethodSetLoader)||void 0===p?void 0:p.data,this.data&&this.languageStrings&&!this.hiddenSelector.matches("language-overrides",!0)?d(n||(n=l` ${0} <foxy-i18n-editor language-overrides="${0}" selected-language="${0}" infer="language-overrides" href="${0}"> </foxy-i18n-editor> ${0} `),this.renderTemplateOrSlot("language-overrides:before"),this.data._links["fx:language_overrides"].href,this.form.language,this.languageStrings,this.renderTemplateOrSlot("language-overrides:after")):"",super.renderBody())}get __paymentMethodSetLoader(){return this.renderRoot.querySelector(`#${this.__paymentMethodSetLoaderId}`)}get __localeCodesLoader(){return this.renderRoot.querySelector(`#${this.__localeCodesLoaderId}`)}get __languagesLoader(){return this.renderRoot.querySelector(`#${this.__languagesLoaderId}`)}}customElements.define("foxy-template-set-form",c);export{c as TemplateSetForm};
@@ -1 +1 @@
1
- import"./shared-0479553e.js";import"./foxy-spinner.js";import"./shared-d1c45954.js";import{h as t}from"./shared-7f33a83a.js";import{C as e}from"./shared-de790de9.js";import{N as s}from"./shared-eb900735.js";import{T as i,a as r}from"./shared-04634a6f.js";import{c as a}from"./shared-4e709717.js";import"./shared-acda8da2.js";import"./shared-f0c8a5bd.js";import"./shared-313a39ef.js";import"./shared-98755831.js";import"./shared-a8cf402a.js";import"./shared-64657919.js";import"./shared-d3bf9ac0.js";import"./shared-509a2f52.js";import"./shared-d6276c83.js";import"./shared-a89cb472.js";let n,o,d,c,l,m,h,p,u,f,v,y,_=t=>t;const $=i(e(r(s,"transaction-card")));class x extends ${constructor(){super(...arguments),this.templates={},this.__currencyDisplay=""}render(){var e,s;const i=this.hiddenSelector,r=!i.matches("total",!0),d=!i.matches("status",!0);return t(n||(n=_` <div aria-busy="${0}" aria-live="polite" class="relative leading-s 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"),a({"transition-opacity":!0,"opacity-0":!this.data}),r||d?t(o||(o=_` <div class="flex items-center justify-between"> ${0} ${0} </div> `),r?this.__renderTotal():"",d?this.__renderStatus():""):"",i.matches("description",!0)?"":this.__renderDescription(),i.matches("customer",!0)?"":this.__renderCustomer(),a({"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:"")}async _sendGet(){var t;const e=await super._sendGet(),s=null===(t=e._links["fx:store"])||void 0===t?void 0:t.href;if("string"==typeof s){const t=await super._fetch(s);this.__currencyDisplay=t.use_international_currency_symbol?"code":"symbol"}else this.__currencyDisplay="symbol";return e}__renderTotal(){const e=this.data;let s;if(e){const i=`${e.total_order} ${e.currency_code}`,r=this.__currencyDisplay;s=t(d||(d=_` <foxy-i18n options="${0}" lang="${0}" key="price" ns="${0}"> </foxy-i18n> `),JSON.stringify({amount:i,currencyDisplay:r}),this.lang,this.ns)}else s=t(c||(c=_`&ZeroWidthSpace;`));return t(l||(l=_` <div data-testid="total"> ${0} <div class="font-medium truncate">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("total:before"),s,this.renderTemplateOrSlot("total:after"))}__renderStatus(){var e,s,i,r;const a=(null===(e=this.data)||void 0===e?void 0:e.status)||"completed";return t(m||(m=_` <div data-testid="status"> ${0} <div class="text-tertiary text-s flex items-center space-x-s"> <foxy-i18n options="${0}" lang="${0}" key="time" ns="${0}"> </foxy-i18n> <iron-icon data-testid="status-icon" class="icon-inline text-l ${0}" title="${0}" icon="${0}"> </iron-icon> </div> ${0} </div> `),this.renderTemplateOrSlot("status:before"),JSON.stringify({value:null===(s=this.data)||void 0===s?void 0:s.transaction_date}),this.lang,this.ns,null!==(i={completed:"text-success",rejected:"text-error",declined:"text-error"}[a])&&void 0!==i?i:"text-tertiary",this.t(`transaction_${a}`),null!==(r={completed:"icons:done-all",refunded:"icons:restore",rejected:"icons:highlight-off",declined:"icons:highlight-off",voided:"icons:remove-circle-outline"}[a])&&void 0!==r?r:"icons:schedule",this.renderTemplateOrSlot("status:after"))}__renderDescription(){var e,s;const i=null===(s=null===(e=this.data)||void 0===e?void 0:e._embedded)||void 0===s?void 0:s["fx:items"];let r;if(i){const e={most_expensive_item:[...i].sort(((t,e)=>t.price-e.price))[0],count_minus_one:i.length-1,count:i.length};r=t(h||(h=_` <foxy-i18n options="${0}" lang="${0}" key="transaction_summary" ns="${0}"> </foxy-i18n> `),JSON.stringify(e),this.lang,this.ns)}else r=t(p||(p=_`&ZeroWidthSpace;`));return t(u||(u=_` <div data-testid="description"> ${0} <div class="text-s text-secondary truncate">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("description:before"),r,this.renderTemplateOrSlot("description:after"))}__renderCustomer(){const e=this.data,s=e?t(f||(f=_`${0} ${0} (${0})`),e.customer_first_name,e.customer_last_name,e.customer_email):t(v||(v=_`&ZeroWidthSpace;`));return t(y||(y=_` <div data-testid="customer"> ${0} <div class="text-tertiary truncate text-s">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("customer:before"),s,this.renderTemplateOrSlot("customer:after"))}}customElements.define("foxy-transaction-card",x);export{x as TransactionCard};
1
+ import"./shared-0479553e.js";import"./foxy-spinner.js";import"./shared-86768244.js";import{h as t}from"./shared-7f33a83a.js";import{C as e}from"./shared-de790de9.js";import{N as s}from"./shared-eb900735.js";import{T as i,a as r}from"./shared-16b542bc.js";import{c as a}from"./shared-4e709717.js";import"./shared-e28f16db.js";import"./shared-7a290f36.js";import"./shared-ca58ef47.js";import"./shared-98755831.js";import"./shared-a8cf402a.js";import"./shared-64657919.js";import"./shared-d3bf9ac0.js";import"./shared-509a2f52.js";import"./shared-d6276c83.js";import"./shared-a89cb472.js";let n,o,d,c,l,m,h,p,u,f,v,y,_=t=>t;const $=i(e(r(s,"transaction-card")));class x extends ${constructor(){super(...arguments),this.templates={},this.__currencyDisplay=""}render(){var e,s;const i=this.hiddenSelector,r=!i.matches("total",!0),d=!i.matches("status",!0);return t(n||(n=_` <div aria-busy="${0}" aria-live="polite" class="relative leading-s 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"),a({"transition-opacity":!0,"opacity-0":!this.data}),r||d?t(o||(o=_` <div class="flex items-center justify-between"> ${0} ${0} </div> `),r?this.__renderTotal():"",d?this.__renderStatus():""):"",i.matches("description",!0)?"":this.__renderDescription(),i.matches("customer",!0)?"":this.__renderCustomer(),a({"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:"")}async _sendGet(){var t;const e=await super._sendGet(),s=null===(t=e._links["fx:store"])||void 0===t?void 0:t.href;if("string"==typeof s){const t=await super._fetch(s);this.__currencyDisplay=t.use_international_currency_symbol?"code":"symbol"}else this.__currencyDisplay="symbol";return e}__renderTotal(){const e=this.data;let s;if(e){const i=`${e.total_order} ${e.currency_code}`,r=this.__currencyDisplay;s=t(d||(d=_` <foxy-i18n options="${0}" lang="${0}" key="price" ns="${0}"> </foxy-i18n> `),JSON.stringify({amount:i,currencyDisplay:r}),this.lang,this.ns)}else s=t(c||(c=_`&ZeroWidthSpace;`));return t(l||(l=_` <div data-testid="total"> ${0} <div class="font-medium truncate">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("total:before"),s,this.renderTemplateOrSlot("total:after"))}__renderStatus(){var e,s,i,r;const a=(null===(e=this.data)||void 0===e?void 0:e.status)||"completed";return t(m||(m=_` <div data-testid="status"> ${0} <div class="text-tertiary text-s flex items-center space-x-s"> <foxy-i18n options="${0}" lang="${0}" key="time" ns="${0}"> </foxy-i18n> <iron-icon data-testid="status-icon" class="icon-inline text-l ${0}" title="${0}" icon="${0}"> </iron-icon> </div> ${0} </div> `),this.renderTemplateOrSlot("status:before"),JSON.stringify({value:null===(s=this.data)||void 0===s?void 0:s.transaction_date}),this.lang,this.ns,null!==(i={completed:"text-success",rejected:"text-error",declined:"text-error"}[a])&&void 0!==i?i:"text-tertiary",this.t(`transaction_${a}`),null!==(r={completed:"icons:done-all",refunded:"icons:restore",rejected:"icons:highlight-off",declined:"icons:highlight-off",voided:"icons:remove-circle-outline"}[a])&&void 0!==r?r:"icons:schedule",this.renderTemplateOrSlot("status:after"))}__renderDescription(){var e,s;const i=null===(s=null===(e=this.data)||void 0===e?void 0:e._embedded)||void 0===s?void 0:s["fx:items"];let r;if(i){const e={most_expensive_item:[...i].sort(((t,e)=>t.price-e.price))[0],count_minus_one:i.length-1,count:i.length};r=t(h||(h=_` <foxy-i18n options="${0}" lang="${0}" key="transaction_summary" ns="${0}"> </foxy-i18n> `),JSON.stringify(e),this.lang,this.ns)}else r=t(p||(p=_`&ZeroWidthSpace;`));return t(u||(u=_` <div data-testid="description"> ${0} <div class="text-s text-secondary truncate">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("description:before"),r,this.renderTemplateOrSlot("description:after"))}__renderCustomer(){const e=this.data,s=e?t(f||(f=_`${0} ${0} (${0})`),e.customer_first_name,e.customer_last_name,e.customer_email):t(v||(v=_`&ZeroWidthSpace;`));return t(y||(y=_` <div data-testid="customer"> ${0} <div class="text-tertiary truncate text-s">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("customer:before"),s,this.renderTemplateOrSlot("customer:after"))}}customElements.define("foxy-transaction-card",x);export{x as TransactionCard};
@@ -1 +1 @@
1
- import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-custom-field-form.js";import"./foxy-custom-field-card.js";import"./foxy-applied-tax-card.js";import"./foxy-discount-card.js";import"./foxy-shipment-card.js";import"./foxy-payment-card.js";import"./foxy-item-form.js";import"./shared-d1c45954.js";import"./shared-539cde4d.js";import{I as t}from"./shared-ec3332b9.js";import{I as o}from"./shared-50908853.js";import"./foxy-customer-card.js";import"./foxy-form-dialog.js";import"./foxy-customer.js";import{h as r,c as e}from"./shared-7f33a83a.js";import{i}from"./shared-d3bf9ac0.js";import"./shared-025cab8b.js";import"./shared-3d6f0788.js";import{_ as s,B as n}from"./shared-98755831.js";import{N as a}from"./shared-eb900735.js";import{a as d}from"./shared-04634a6f.js";import"./shared-313a39ef.js";import"./shared-acda8da2.js";import"./shared-f0c8a5bd.js";import"./shared-0479553e.js";import"./foxy-spinner.js";import"./shared-a8cf402a.js";import"./shared-64657919.js";import"./shared-de790de9.js";import"./shared-4e709717.js";import"./shared-509a2f52.js";import"./shared-d6276c83.js";import"./shared-a89cb472.js";import"./shared-77a700fe.js";import"./shared-27d23dfd.js";import"./shared-bdd5c908.js";import"./shared-98eec370.js";import"./shared-4494ebfa.js";import"./shared-b34bef61.js";import"./shared-64f2d6de.js";import"./shared-7c761c65.js";import"./shared-14bb06d4.js";import"./shared-df1816e8.js";import"./shared-40638f2c.js";import"./shared-11c2efc8.js";import"./shared-80792dc8.js";import"./shared-0237bfae.js";import"./shared-520be2e9.js";import"./shared-049d80d0.js";import"./shared-394c2425.js";import"./shared-1e55acbb.js";import"./shared-8ac00abe.js";import"./shared-07e32de2.js";import"./shared-694297c2.js";import"./foxy-item-card.js";import"./shared-44594184.js";import"./foxy-nucleon-element.js";import"./shared-00b50abf.js";import"./shared-b39fce1b.js";import"./shared-cf65fcc7.js";import"./shared-0dd25feb.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-coupon-card.js";import"./shared-faad86eb.js";import"./foxy-discount-builder.js";import"./shared-d519a301.js";import"./shared-e6f3e9f0.js";import"./shared-3206f265.js";import"./shared-726c0b56.js";import"./shared-bc7f58ef.js";import"./shared-a7347e96.js";import"./foxy-subscription-card.js";import"./shared-d2384b7b.js";import"./foxy-subscription-form.js";import"./shared-5570ac69.js";import"./foxy-collection-page.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./foxy-cancellation-form.js";import"./foxy-transaction-card.js";import"./shared-daf52401.js";import"./shared-b5517c1b.js";import"./shared-99065f2a.js";import"./foxy-payment-method-card.js";import"./foxy-transactions-table.js";import"./shared-ab69c97b.js";import"./foxy-collection-pages.js";import"./foxy-customer-form.js";import"./shared-b738ee96.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./foxy-table.js";import"./shared-e7ce4e47.js";let l,c=t=>t;customElements.define("foxy-internal-transaction-customer-control",class extends o{renderControl(){var t,o,e,s;return r(l||(l=c` <foxy-internal-details summary="customer" infer="" open> <foxy-form-dialog header="header" infer="dialog" form="foxy-customer" href="${0}" id="dialog"> </foxy-form-dialog> <button class="w-full text-left block rounded-b-l transition-colors hover-bg-contrast-5 focus-outline-none focus-ring-2 focus-ring-primary-50" @click="${0}"> <foxy-customer-card infer="card" class="p-m" href="${0}"> </foxy-customer-card> </button> </foxy-internal-details> `),i(null===(o=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===o?void 0:o._links["fx:customer"].href),(t=>{this.renderRoot.querySelector("#dialog").show(t.currentTarget)}),i(null===(s=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===s?void 0:s._links["fx:customer"].href))}});let f,m=t=>t;customElements.define("foxy-internal-transaction-post-action-control",class extends o{constructor(){super(...arguments),this.theme=null,this.href=null,this.__state="idle"}static get properties(){return s(s({},super.properties),{},{__state:{type:String},theme:{type:String},href:{type:String}})}renderControl(){const t=this.__state,o="fail"===t?"error":"idle"===t?this.theme:"";return r(f||(f=m` <foxy-internal-confirm-dialog header="header" infer="confirm" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <vaadin-button class="w-full" theme="${0} tertiary" ?disabled="${0}" @click="${0}"> <foxy-i18n key="${0}" infer=""></foxy-i18n> </vaadin-button> `),(t=>!t.detail.cancelled&&this.__submit()),o,"busy"===t||this.disabled,(t=>{this.renderRoot.querySelector("#confirm").show(t.currentTarget)}),t)}async __submit(){var t;if("busy"!==this.__state)try{this.__state="busy";const o=new a.API(this),r=await o.fetch(null!==(t=this.href)&&void 0!==t?t:"",{method:"POST"});this.__state=r.ok?"idle":"fail",r.ok&&this.dispatchEvent(new CustomEvent("done"))}catch(t){this.__state="fail"}}});let u,p,h,y,x,v=t=>t;customElements.define("foxy-internal-transaction-actions-control",class extends o{renderControl(){var t,o,e,i,s,n,a,d;return r(u||(u=v` <div class="divide-y divide-contrast-10"> ${0} ${0} ${0} ${0} </div> `),(null===(o=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===o?void 0:o._links["fx:capture"])?this.__renderCaptureAction():"",(null===(i=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===i?void 0:i._links["fx:void"])?this.__renderVoidAction():"",(null===(n=null===(s=this.nucleon)||void 0===s?void 0:s.data)||void 0===n?void 0:n._links["fx:refund"])?this.__renderRefundAction():"",(null===(d=null===(a=this.nucleon)||void 0===a?void 0:a.data)||void 0===d?void 0:d._links["fx:send_emails"])?this.__renderSendEmailsAction():"")}__renderSendEmailsAction(){var t,o;return r(p||(p=v` <foxy-internal-transaction-post-action-control infer="send-emails" theme="contrast" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),i(null===(o=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===o?void 0:o._links["fx:send_emails"].href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderCaptureAction(){var t,o;return r(h||(h=v` <foxy-internal-transaction-post-action-control theme="success" infer="capture" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),i(null===(o=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===o?void 0:o._links["fx:capture"].href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderVoidAction(){var t,o,e;return r(y||(y=v` <foxy-internal-transaction-post-action-control theme="error" infer="void" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),i(null===(e=null===(o=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===o?void 0:o._links["fx:void"])||void 0===e?void 0:e.href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderRefundAction(){var t,o,e;return r(x||(x=v` <foxy-internal-transaction-post-action-control theme="contrast" infer="refund" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),i(null===(e=null===(o=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===o?void 0:o._links["fx:refund"])||void 0===e?void 0:e.href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}});let j,_,b,$,g,k,w,S,A,E=t=>t;customElements.define("foxy-internal-transaction-summary-control",class extends o{renderControl(){var t;return r(j||(j=E` <div class="border-t border-transparent"> <div class="h-m flex items-center justify-between"> <div class="text-xl font-medium">${0}</div> <div>${0}</div> </div> <div class="border-t border-contrast-10 mb-s"></div> ${0} </div> `),this.__renderPrice(),(null===(t=this.nucleon)||void 0===t?void 0:t.data)?this.__renderStatus():"",this.__renderTotals())}__renderStatus(){var t,o;const e={authorized:"bg-success text-success-contrast",completed:"bg-success text-success-contrast",declined:"bg-error text-error-contrast",rejected:"bg-error text-error-contrast"},i=(null===(o=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===o?void 0:o.status)||"completed";return r(_||(_=E` <foxy-i18n class="flex items-center h-xs px-s text-s font-medium rounded ${0}" infer="" key="transaction_${0}"> </foxy-i18n> `),i in e?e[i]:"bg-contrast-5 text-contrast",i)}__renderPrice(){var t;const o=null===(t=this.nucleon)||void 0===t?void 0:t.data,e=null==o?void 0:o.currency_code;if(!o)return r(b||(b=E`--`));const i={amount:`${o.total_order} ${e}`};return r($||($=E`<foxy-i18n infer="" key="price" .options="${0}"></foxy-i18n>`),i)}__renderTotals(){var t,o;const e=null===(t=this.nucleon)||void 0===t?void 0:t.data,i=null===(o=null==e?void 0:e._embedded)||void 0===o?void 0:o["fx:discounts"],s=null==i?void 0:i.reduce(((t,o)=>t+o.amount),0),n=null==e?void 0:e.currency_code;return r(g||(g=E` ${0} ${0} `),["total_item_price","total_shipping","total_tax"].map((t=>{const o={amount:`${null==e?void 0:e[t]} ${n}`};return r(k||(k=E` <div class="flex justify-between text-m text-secondary"> <foxy-i18n key="${0}" infer=""></foxy-i18n> ${0} </div> `),t,e?r(w||(w=E`<foxy-i18n infer="" key="price" .options="${0}"></foxy-i18n>`),o):r(S||(S=E`<span>--</span>`)))})),s?r(A||(A=E` <div class="flex justify-between text-m text-secondary"> <foxy-i18n key="total_discount" infer=""></foxy-i18n> <foxy-i18n infer="" key="${0}" .options="${0}"> </foxy-i18n> </div> `),20===(null==i?void 0:i.length)?"total_discount_see_below":"price",{amount:`${s} ${n}`}):"")}});let C,T,P=t=>t;class R extends(d(t,"transaction")){static get styles(){return[...super.styles,e(C||(C=P`#body{display:grid;grid-template-columns:repeat(auto-fill,minmax(calc(18.75 * var(--lumo-space-m)),1fr))}#body>:first-child{grid-column-start:1;grid-column-end:-2}`))]}get readonlySelector(){var t,o,r;return Boolean(null!==(o=null===(t=this.data)||void 0===t?void 0:t._links["fx:void"])&&void 0!==o?o:null===(r=this.data)||void 0===r?void 0:r._links["fx:refund"])?super.readonlySelector:new n(`${super.readonlySelector} attributes custom-fields`)}renderBody(){var t,o,e,s,n,a;return r(T||(T=P` <div id="body" class="gap-m"> <foxy-internal-async-details-control infer="shipments" first="${0}" item="foxy-shipment-card" open> </foxy-internal-async-details-control> <div class="grid gap-m self-start"> <foxy-internal-transaction-summary-control infer="summary"> </foxy-internal-transaction-summary-control> <foxy-internal-transaction-customer-control infer="customer"> </foxy-internal-transaction-customer-control> <foxy-internal-async-details-control infer="payments" class="max-w-full overflow-hidden" first="${0}" limit="1" item="foxy-payment-card" open> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="discounts" first="${0}" limit="5" item="foxy-discount-card"> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="applied-taxes" first="${0}" limit="5" item="foxy-applied-tax-card"> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="custom-fields" first="${0}" limit="5" form="foxy-custom-field-form" item="foxy-custom-field-card" .related="${0}"> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="attributes" first="${0}" limit="5" form="foxy-attribute-form" item="foxy-attribute-card" .related="${0}"> </foxy-internal-async-details-control> <foxy-internal-transaction-actions-control infer="actions"> </foxy-internal-transaction-actions-control> </div> </div> `),i(null===(t=this.data)||void 0===t?void 0:t._links["fx:shipments"].href),i(null===(o=this.data)||void 0===o?void 0:o._links["fx:payments"].href),i(null===(e=this.data)||void 0===e?void 0:e._links["fx:discounts"].href),i(null===(s=this.data)||void 0===s?void 0:s._links["fx:applied_taxes"].href),i(null===(n=this.data)||void 0===n?void 0:n._links["fx:custom_fields"].href),[this.href],i(null===(a=this.data)||void 0===a?void 0:a._links["fx:attributes"].href),[this.href])}}customElements.define("foxy-transaction",R);export{R as Transaction};
1
+ import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-custom-field-form.js";import"./foxy-custom-field-card.js";import"./foxy-applied-tax-card.js";import"./foxy-discount-card.js";import"./foxy-shipment-card.js";import"./foxy-payment-card.js";import"./foxy-item-form.js";import"./shared-86768244.js";import"./shared-939fc890.js";import{I as t}from"./shared-6fb923d5.js";import{I as o}from"./shared-5dd31b4e.js";import"./foxy-customer-card.js";import"./foxy-form-dialog.js";import"./foxy-customer.js";import{h as r,c as e}from"./shared-7f33a83a.js";import{i}from"./shared-d3bf9ac0.js";import"./shared-cb6f2388.js";import"./shared-0dc1d012.js";import{_ as s,B as n}from"./shared-98755831.js";import{N as a}from"./shared-eb900735.js";import{a as d}from"./shared-16b542bc.js";import"./shared-ca58ef47.js";import"./shared-e28f16db.js";import"./shared-7a290f36.js";import"./shared-0479553e.js";import"./foxy-spinner.js";import"./shared-a8cf402a.js";import"./shared-64657919.js";import"./shared-de790de9.js";import"./shared-4e709717.js";import"./shared-509a2f52.js";import"./shared-d6276c83.js";import"./shared-a89cb472.js";import"./shared-e5c19ea3.js";import"./shared-c40d85dc.js";import"./shared-b95ef318.js";import"./shared-4c9f96ec.js";import"./shared-6f465111.js";import"./shared-ee13d1a6.js";import"./shared-aeec3cab.js";import"./shared-f3f5e87e.js";import"./shared-068480a3.js";import"./shared-0543c6e0.js";import"./shared-4db2c7b1.js";import"./shared-11c2efc8.js";import"./shared-9e60ef60.js";import"./shared-6b53ef85.js";import"./shared-cd096e97.js";import"./shared-08ff9a8d.js";import"./shared-7bf46d6d.js";import"./shared-d493355a.js";import"./shared-c3c67413.js";import"./shared-3a252ccd.js";import"./shared-bd81cc08.js";import"./foxy-item-card.js";import"./shared-49d978e1.js";import"./foxy-nucleon-element.js";import"./shared-b88e35b7.js";import"./shared-0c02b4ee.js";import"./shared-61a510d8.js";import"./shared-1e5292a1.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-coupon-card.js";import"./shared-23923638.js";import"./foxy-discount-builder.js";import"./shared-d519a301.js";import"./shared-e6f3e9f0.js";import"./shared-fbfb0943.js";import"./shared-9048c076.js";import"./shared-bc7f58ef.js";import"./shared-380db651.js";import"./foxy-subscription-card.js";import"./shared-bb009254.js";import"./foxy-subscription-form.js";import"./shared-03b39ec4.js";import"./foxy-collection-page.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./foxy-cancellation-form.js";import"./foxy-transaction-card.js";import"./shared-daf52401.js";import"./shared-b5517c1b.js";import"./shared-99065f2a.js";import"./foxy-payment-method-card.js";import"./foxy-transactions-table.js";import"./shared-6eb7dc77.js";import"./foxy-collection-pages.js";import"./foxy-customer-form.js";import"./shared-b738ee96.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./foxy-table.js";import"./shared-eb4b4597.js";let l,c=t=>t;customElements.define("foxy-internal-transaction-customer-control",class extends o{renderControl(){var t,o,e,s;return r(l||(l=c` <foxy-internal-details summary="customer" infer="" open> <foxy-form-dialog header="header" infer="dialog" form="foxy-customer" href="${0}" id="dialog"> </foxy-form-dialog> <button class="w-full text-left block rounded-b-l transition-colors hover-bg-contrast-5 focus-outline-none focus-ring-2 focus-ring-primary-50" @click="${0}"> <foxy-customer-card infer="card" class="p-m" href="${0}"> </foxy-customer-card> </button> </foxy-internal-details> `),i(null===(o=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===o?void 0:o._links["fx:customer"].href),(t=>{this.renderRoot.querySelector("#dialog").show(t.currentTarget)}),i(null===(s=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===s?void 0:s._links["fx:customer"].href))}});let f,m=t=>t;customElements.define("foxy-internal-transaction-post-action-control",class extends o{constructor(){super(...arguments),this.theme=null,this.href=null,this.__state="idle"}static get properties(){return s(s({},super.properties),{},{__state:{type:String},theme:{type:String},href:{type:String}})}renderControl(){const t=this.__state,o="fail"===t?"error":"idle"===t?this.theme:"";return r(f||(f=m` <foxy-internal-confirm-dialog header="header" infer="confirm" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <vaadin-button class="w-full" theme="${0} tertiary" ?disabled="${0}" @click="${0}"> <foxy-i18n key="${0}" infer=""></foxy-i18n> </vaadin-button> `),(t=>!t.detail.cancelled&&this.__submit()),o,"busy"===t||this.disabled,(t=>{this.renderRoot.querySelector("#confirm").show(t.currentTarget)}),t)}async __submit(){var t;if("busy"!==this.__state)try{this.__state="busy";const o=new a.API(this),r=await o.fetch(null!==(t=this.href)&&void 0!==t?t:"",{method:"POST"});this.__state=r.ok?"idle":"fail",r.ok&&this.dispatchEvent(new CustomEvent("done"))}catch(t){this.__state="fail"}}});let u,p,h,y,x,v=t=>t;customElements.define("foxy-internal-transaction-actions-control",class extends o{renderControl(){var t,o,e,i,s,n,a,d;return r(u||(u=v` <div class="divide-y divide-contrast-10"> ${0} ${0} ${0} ${0} </div> `),(null===(o=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===o?void 0:o._links["fx:capture"])?this.__renderCaptureAction():"",(null===(i=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===i?void 0:i._links["fx:void"])?this.__renderVoidAction():"",(null===(n=null===(s=this.nucleon)||void 0===s?void 0:s.data)||void 0===n?void 0:n._links["fx:refund"])?this.__renderRefundAction():"",(null===(d=null===(a=this.nucleon)||void 0===a?void 0:a.data)||void 0===d?void 0:d._links["fx:send_emails"])?this.__renderSendEmailsAction():"")}__renderSendEmailsAction(){var t,o;return r(p||(p=v` <foxy-internal-transaction-post-action-control infer="send-emails" theme="contrast" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),i(null===(o=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===o?void 0:o._links["fx:send_emails"].href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderCaptureAction(){var t,o;return r(h||(h=v` <foxy-internal-transaction-post-action-control theme="success" infer="capture" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),i(null===(o=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===o?void 0:o._links["fx:capture"].href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderVoidAction(){var t,o,e;return r(y||(y=v` <foxy-internal-transaction-post-action-control theme="error" infer="void" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),i(null===(e=null===(o=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===o?void 0:o._links["fx:void"])||void 0===e?void 0:e.href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderRefundAction(){var t,o,e;return r(x||(x=v` <foxy-internal-transaction-post-action-control theme="contrast" infer="refund" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),i(null===(e=null===(o=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===o?void 0:o._links["fx:refund"])||void 0===e?void 0:e.href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}});let j,_,b,$,g,k,w,S,A,E=t=>t;customElements.define("foxy-internal-transaction-summary-control",class extends o{renderControl(){var t;return r(j||(j=E` <div class="border-t border-transparent"> <div class="h-m flex items-center justify-between"> <div class="text-xl font-medium">${0}</div> <div>${0}</div> </div> <div class="border-t border-contrast-10 mb-s"></div> ${0} </div> `),this.__renderPrice(),(null===(t=this.nucleon)||void 0===t?void 0:t.data)?this.__renderStatus():"",this.__renderTotals())}__renderStatus(){var t,o;const e={authorized:"bg-success text-success-contrast",completed:"bg-success text-success-contrast",declined:"bg-error text-error-contrast",rejected:"bg-error text-error-contrast"},i=(null===(o=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===o?void 0:o.status)||"completed";return r(_||(_=E` <foxy-i18n class="flex items-center h-xs px-s text-s font-medium rounded ${0}" infer="" key="transaction_${0}"> </foxy-i18n> `),i in e?e[i]:"bg-contrast-5 text-contrast",i)}__renderPrice(){var t;const o=null===(t=this.nucleon)||void 0===t?void 0:t.data,e=null==o?void 0:o.currency_code;if(!o)return r(b||(b=E`--`));const i={amount:`${o.total_order} ${e}`};return r($||($=E`<foxy-i18n infer="" key="price" .options="${0}"></foxy-i18n>`),i)}__renderTotals(){var t,o;const e=null===(t=this.nucleon)||void 0===t?void 0:t.data,i=null===(o=null==e?void 0:e._embedded)||void 0===o?void 0:o["fx:discounts"],s=null==i?void 0:i.reduce(((t,o)=>t+o.amount),0),n=null==e?void 0:e.currency_code;return r(g||(g=E` ${0} ${0} `),["total_item_price","total_shipping","total_tax"].map((t=>{const o={amount:`${null==e?void 0:e[t]} ${n}`};return r(k||(k=E` <div class="flex justify-between text-m text-secondary"> <foxy-i18n key="${0}" infer=""></foxy-i18n> ${0} </div> `),t,e?r(w||(w=E`<foxy-i18n infer="" key="price" .options="${0}"></foxy-i18n>`),o):r(S||(S=E`<span>--</span>`)))})),s?r(A||(A=E` <div class="flex justify-between text-m text-secondary"> <foxy-i18n key="total_discount" infer=""></foxy-i18n> <foxy-i18n infer="" key="${0}" .options="${0}"> </foxy-i18n> </div> `),20===(null==i?void 0:i.length)?"total_discount_see_below":"price",{amount:`${s} ${n}`}):"")}});let C,T,P=t=>t;class R extends(d(t,"transaction")){static get styles(){return[...super.styles,e(C||(C=P`#body{display:grid;grid-template-columns:repeat(auto-fill,minmax(calc(18.75 * var(--lumo-space-m)),1fr))}#body>:first-child{grid-column-start:1;grid-column-end:-2}`))]}get readonlySelector(){var t,o,r;return Boolean(null!==(o=null===(t=this.data)||void 0===t?void 0:t._links["fx:void"])&&void 0!==o?o:null===(r=this.data)||void 0===r?void 0:r._links["fx:refund"])?super.readonlySelector:new n(`${super.readonlySelector} attributes custom-fields`)}renderBody(){var t,o,e,s,n,a;return r(T||(T=P` <div id="body" class="gap-m"> <foxy-internal-async-details-control infer="shipments" first="${0}" item="foxy-shipment-card" open> </foxy-internal-async-details-control> <div class="grid gap-m self-start"> <foxy-internal-transaction-summary-control infer="summary"> </foxy-internal-transaction-summary-control> <foxy-internal-transaction-customer-control infer="customer"> </foxy-internal-transaction-customer-control> <foxy-internal-async-details-control infer="payments" class="max-w-full overflow-hidden" first="${0}" limit="1" item="foxy-payment-card" open> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="discounts" first="${0}" limit="5" item="foxy-discount-card"> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="applied-taxes" first="${0}" limit="5" item="foxy-applied-tax-card"> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="custom-fields" first="${0}" limit="5" form="foxy-custom-field-form" item="foxy-custom-field-card" .related="${0}"> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="attributes" first="${0}" limit="5" form="foxy-attribute-form" item="foxy-attribute-card" .related="${0}"> </foxy-internal-async-details-control> <foxy-internal-transaction-actions-control infer="actions"> </foxy-internal-transaction-actions-control> </div> </div> `),i(null===(t=this.data)||void 0===t?void 0:t._links["fx:shipments"].href),i(null===(o=this.data)||void 0===o?void 0:o._links["fx:payments"].href),i(null===(e=this.data)||void 0===e?void 0:e._links["fx:discounts"].href),i(null===(s=this.data)||void 0===s?void 0:s._links["fx:applied_taxes"].href),i(null===(n=this.data)||void 0===n?void 0:n._links["fx:custom_fields"].href),[this.href],i(null===(a=this.data)||void 0===a?void 0:a._links["fx:attributes"].href),[this.href])}}customElements.define("foxy-transaction",R);export{R as Transaction};
@@ -1,4 +1,4 @@
1
- import"./shared-313a39ef.js";import"./shared-acda8da2.js";import"./foxy-spinner.js";import"./shared-d1c45954.js";import{T as t}from"./shared-ab69c97b.js";import{a as s}from"./shared-04634a6f.js";import"./shared-f0c8a5bd.js";import"./shared-98755831.js";import"./shared-7f33a83a.js";import"./shared-a8cf402a.js";import"./shared-64657919.js";import"./shared-de790de9.js";import"./shared-d3bf9ac0.js";import"./foxy-nucleon-element.js";import"./shared-eb900735.js";import"./shared-509a2f52.js";import"./shared-d6276c83.js";import"./shared-a89cb472.js";import"./shared-4e709717.js";let e,a,n,o,r,i,l=t=>t;class m extends(s(t,"transactions-table")){constructor(){super(...arguments),this.columns=[m.priceColumn,m.summaryColumn,m.statusColumn,m.idColumn,m.dateColumn,m.receiptColumn]}}m.priceColumn={cell:t=>t.html(e||(e=l`
1
+ import"./shared-ca58ef47.js";import"./shared-e28f16db.js";import"./foxy-spinner.js";import"./shared-86768244.js";import{T as t}from"./shared-6eb7dc77.js";import{a as s}from"./shared-16b542bc.js";import"./shared-7a290f36.js";import"./shared-98755831.js";import"./shared-7f33a83a.js";import"./shared-a8cf402a.js";import"./shared-64657919.js";import"./shared-de790de9.js";import"./shared-d3bf9ac0.js";import"./foxy-nucleon-element.js";import"./shared-eb900735.js";import"./shared-509a2f52.js";import"./shared-d6276c83.js";import"./shared-a89cb472.js";import"./shared-4e709717.js";let e,a,n,o,r,i,l=t=>t;class m extends(s(t,"transactions-table")){constructor(){super(...arguments),this.columns=[m.priceColumn,m.summaryColumn,m.statusColumn,m.idColumn,m.dateColumn,m.receiptColumn]}}m.priceColumn={cell:t=>t.html(e||(e=l`
2
2
  <foxy-i18n
3
3
  data-testclass="i18n totals"
4
4
  class="text-m font-medium font-tnum"
@@ -1 +1 @@
1
- import"./shared-0479553e.js";import"./foxy-spinner.js";import"./shared-d1c45954.js";import{a as r}from"./shared-04634a6f.js";import{T as s}from"./shared-8ac00abe.js";import{h as e}from"./shared-7f33a83a.js";import"./shared-acda8da2.js";import"./shared-f0c8a5bd.js";import"./shared-313a39ef.js";import"./shared-98755831.js";import"./shared-a8cf402a.js";import"./shared-64657919.js";import"./shared-de790de9.js";import"./shared-d3bf9ac0.js";import"./shared-07e32de2.js";import"./shared-eb900735.js";import"./shared-509a2f52.js";import"./shared-d6276c83.js";import"./shared-a89cb472.js";import"./shared-4e709717.js";let a,t,d=r=>r;const o=r(s,"user-card");class i extends o{renderBody(){return super.renderBody({title:r=>{const s=[r.first_name.trim(),r.last_name.trim()];return e(a||(a=d`${0}`),s.filter((r=>!!r)).join(" ")||this.t("no_name"))},subtitle:r=>e(t||(t=d`${0}`),r.email)})}}customElements.define("foxy-user-card",i);export{i as UserCard};
1
+ import"./shared-0479553e.js";import"./foxy-spinner.js";import"./shared-86768244.js";import{a as r}from"./shared-16b542bc.js";import{T as s}from"./shared-c3c67413.js";import{h as e}from"./shared-7f33a83a.js";import"./shared-e28f16db.js";import"./shared-7a290f36.js";import"./shared-ca58ef47.js";import"./shared-98755831.js";import"./shared-a8cf402a.js";import"./shared-64657919.js";import"./shared-de790de9.js";import"./shared-d3bf9ac0.js";import"./shared-3a252ccd.js";import"./shared-eb900735.js";import"./shared-509a2f52.js";import"./shared-d6276c83.js";import"./shared-a89cb472.js";import"./shared-4e709717.js";let a,t,d=r=>r;const o=r(s,"user-card");class i extends o{renderBody(){return super.renderBody({title:r=>{const s=[r.first_name.trim(),r.last_name.trim()];return e(a||(a=d`${0}`),s.filter((r=>!!r)).join(" ")||this.t("no_name"))},subtitle:r=>e(t||(t=d`${0}`),r.email)})}}customElements.define("foxy-user-card",i);export{i as UserCard};
@@ -1 +1 @@
1
- import"./shared-bdd5c908.js";import"./shared-025cab8b.js";import"./shared-3d6f0788.js";import"./shared-ec3332b9.js";import"./foxy-spinner.js";import"./shared-d1c45954.js";export{U as UserForm}from"./shared-a959c0d9.js";import"./shared-27d23dfd.js";import"./shared-f0c8a5bd.js";import"./shared-04634a6f.js";import"./shared-98755831.js";import"./shared-7f33a83a.js";import"./shared-98eec370.js";import"./shared-80792dc8.js";import"./shared-509a2f52.js";import"./shared-64657919.js";import"./shared-de790de9.js";import"./shared-d3bf9ac0.js";import"./shared-a8cf402a.js";import"./shared-4e709717.js";import"./shared-50908853.js";import"./shared-0479553e.js";import"./shared-eb900735.js";import"./shared-d6276c83.js";import"./shared-a89cb472.js";import"./shared-acda8da2.js";import"./shared-313a39ef.js";import"./shared-b738ee96.js";import"./shared-ffd03d7b.js";import"./shared-4494ebfa.js";import"./shared-049d80d0.js";
1
+ import"./shared-b95ef318.js";import"./shared-cb6f2388.js";import"./shared-0dc1d012.js";import"./shared-6fb923d5.js";import"./foxy-spinner.js";import"./shared-86768244.js";export{U as UserForm}from"./shared-8b73191b.js";import"./shared-c40d85dc.js";import"./shared-7a290f36.js";import"./shared-16b542bc.js";import"./shared-98755831.js";import"./shared-7f33a83a.js";import"./shared-4c9f96ec.js";import"./shared-9e60ef60.js";import"./shared-509a2f52.js";import"./shared-64657919.js";import"./shared-de790de9.js";import"./shared-d3bf9ac0.js";import"./shared-a8cf402a.js";import"./shared-4e709717.js";import"./shared-5dd31b4e.js";import"./shared-0479553e.js";import"./shared-eb900735.js";import"./shared-d6276c83.js";import"./shared-a89cb472.js";import"./shared-e28f16db.js";import"./shared-ca58ef47.js";import"./shared-b738ee96.js";import"./shared-ad396f3c.js";import"./shared-6f465111.js";import"./shared-08ff9a8d.js";
@@ -1 +1 @@
1
- import"./shared-025cab8b.js";import"./foxy-form-dialog.js";import{r as s}from"./shared-a959c0d9.js";import"./foxy-spinner.js";import"./shared-d1c45954.js";import{h as e}from"./shared-7f33a83a.js";import{T as a}from"./shared-ab69c97b.js";import{a as t}from"./shared-04634a6f.js";import"./shared-27d23dfd.js";import"./shared-f0c8a5bd.js";import"./shared-3d6f0788.js";import"./shared-98755831.js";import"./shared-80792dc8.js";import"./shared-509a2f52.js";import"./shared-64657919.js";import"./shared-de790de9.js";import"./shared-d3bf9ac0.js";import"./shared-a8cf402a.js";import"./shared-4e709717.js";import"./shared-d6276c83.js";import"./shared-bdd5c908.js";import"./shared-98eec370.js";import"./shared-ec3332b9.js";import"./shared-50908853.js";import"./shared-0479553e.js";import"./shared-eb900735.js";import"./shared-a89cb472.js";import"./shared-b738ee96.js";import"./shared-ffd03d7b.js";import"./shared-acda8da2.js";import"./shared-4494ebfa.js";import"./shared-049d80d0.js";import"./shared-313a39ef.js";import"./foxy-nucleon-element.js";let r,o,d,i,m,n,l,p=s=>s;class f extends(t(a,"users-table")){constructor(){super(...arguments),this.columns=[f.nameColumn,f.emailColumn,f.rolesColumn,f.lastUpdatedColumn,f.actionsColumn]}render(){return e(r||(r=p` <foxy-form-dialog parent="${0}" form="foxy-user-form" lang="${0}" ns="${0}" id="form"> </foxy-form-dialog> ${0} `),this.href,this.lang,this.ns,super.render())}}f.nameColumn={cell:s=>e(o||(o=p` <span data-testclass="name" class="text-m font-medium"> ${0} ${0} </span> `),s.data.first_name,s.data.last_name)},f.emailColumn={hideBelow:"md",cell:s=>e(d||(d=p` <span data-testclass="email" class="text-m text-secondary">${0}</span> `),s.data.email)},f.rolesColumn={cell:a=>e(i||(i=p` <div data-testclass="roles" class="flex space-x-s"> ${0} </div> `),["is_merchant","is_programmer","is_front_end_developer","is_designer"].map((t=>e(m||(m=p` <div class="${0}" style="width:1rem;height:1rem"> ${0} </div> `),a.data[t]?"":"text-disabled",s.find((s=>s.property===t)).icon))))},f.lastUpdatedColumn={hideBelow:"lg",cell:s=>e(n||(n=p` <span data-testclass="lastUpdated" class="text-m text-secondary font-tnum"> <foxy-i18n options="${0}" lang="${0}" key="date" ns="${0}"> </foxy-i18n> <foxy-i18n options="${0}" lang="${0}" key="time" ns="${0}"> </foxy-i18n> </span> `),JSON.stringify({value:s.data.date_modified}),s.lang,s.ns,JSON.stringify({value:s.data.date_modified}),s.lang,s.ns)},f.actionsColumn={cell:s=>e(l||(l=p` <vaadin-button data-testclass="actions" theme="tertiary small" @click="${0}"> <foxy-i18n lang="${0}" key="update" ns="${0}"></foxy-i18n> </vaadin-button> `),(e=>{const a=e.target,t=a.getRootNode().querySelector("#form");t.href=s.data._links.self.href,t.show(a)}),s.lang,s.ns)},customElements.define("foxy-users-table",f);export{f as UsersTable};
1
+ import"./shared-cb6f2388.js";import"./foxy-form-dialog.js";import{r as s}from"./shared-8b73191b.js";import"./foxy-spinner.js";import"./shared-86768244.js";import{h as e}from"./shared-7f33a83a.js";import{T as a}from"./shared-6eb7dc77.js";import{a as t}from"./shared-16b542bc.js";import"./shared-c40d85dc.js";import"./shared-7a290f36.js";import"./shared-0dc1d012.js";import"./shared-98755831.js";import"./shared-9e60ef60.js";import"./shared-509a2f52.js";import"./shared-64657919.js";import"./shared-de790de9.js";import"./shared-d3bf9ac0.js";import"./shared-a8cf402a.js";import"./shared-4e709717.js";import"./shared-d6276c83.js";import"./shared-b95ef318.js";import"./shared-4c9f96ec.js";import"./shared-6fb923d5.js";import"./shared-5dd31b4e.js";import"./shared-0479553e.js";import"./shared-eb900735.js";import"./shared-a89cb472.js";import"./shared-b738ee96.js";import"./shared-ad396f3c.js";import"./shared-e28f16db.js";import"./shared-6f465111.js";import"./shared-08ff9a8d.js";import"./shared-ca58ef47.js";import"./foxy-nucleon-element.js";let r,o,d,i,m,n,l,p=s=>s;class f extends(t(a,"users-table")){constructor(){super(...arguments),this.columns=[f.nameColumn,f.emailColumn,f.rolesColumn,f.lastUpdatedColumn,f.actionsColumn]}render(){return e(r||(r=p` <foxy-form-dialog parent="${0}" form="foxy-user-form" lang="${0}" ns="${0}" id="form"> </foxy-form-dialog> ${0} `),this.href,this.lang,this.ns,super.render())}}f.nameColumn={cell:s=>e(o||(o=p` <span data-testclass="name" class="text-m font-medium"> ${0} ${0} </span> `),s.data.first_name,s.data.last_name)},f.emailColumn={hideBelow:"md",cell:s=>e(d||(d=p` <span data-testclass="email" class="text-m text-secondary">${0}</span> `),s.data.email)},f.rolesColumn={cell:a=>e(i||(i=p` <div data-testclass="roles" class="flex space-x-s"> ${0} </div> `),["is_merchant","is_programmer","is_front_end_developer","is_designer"].map((t=>e(m||(m=p` <div class="${0}" style="width:1rem;height:1rem"> ${0} </div> `),a.data[t]?"":"text-disabled",s.find((s=>s.property===t)).icon))))},f.lastUpdatedColumn={hideBelow:"lg",cell:s=>e(n||(n=p` <span data-testclass="lastUpdated" class="text-m text-secondary font-tnum"> <foxy-i18n options="${0}" lang="${0}" key="date" ns="${0}"> </foxy-i18n> <foxy-i18n options="${0}" lang="${0}" key="time" ns="${0}"> </foxy-i18n> </span> `),JSON.stringify({value:s.data.date_modified}),s.lang,s.ns,JSON.stringify({value:s.data.date_modified}),s.lang,s.ns)},f.actionsColumn={cell:s=>e(l||(l=p` <vaadin-button data-testclass="actions" theme="tertiary small" @click="${0}"> <foxy-i18n lang="${0}" key="update" ns="${0}"></foxy-i18n> </vaadin-button> `),(e=>{const a=e.target,t=a.getRootNode().querySelector("#form");t.href=s.data._links.self.href,t.show(a)}),s.lang,s.ns)},customElements.define("foxy-users-table",f);export{f as UsersTable};
@@ -1 +1 @@
1
- import"./shared-313a39ef.js";import"./shared-acda8da2.js";import"./shared-44594184.js";import{I as s}from"./shared-07e32de2.js";import{h as e}from"./shared-7f33a83a.js";import{a}from"./shared-04634a6f.js";import"./shared-f0c8a5bd.js";import"./foxy-spinner.js";import"./shared-d1c45954.js";import"./shared-98755831.js";import"./shared-64657919.js";import"./shared-a8cf402a.js";import"./shared-eb900735.js";import"./shared-509a2f52.js";import"./shared-d6276c83.js";import"./shared-a89cb472.js";import"./shared-4e709717.js";let i,r=s=>s;class o extends(a(s,"webhook-card")){renderBody(){var s,a,o,t;return e(i||(i=r` <div class="grid grid-cols-1 gap-s leading-none"> <p class="flex justify-between items-center font-medium"> <span class="truncate">${0}&ZeroWidthSpace;</span> <span class="uppercase inline-block text-xs bg-contrast-5 rounded p-xs flex-shrink-0"> ${0}&ZeroWidthSpace; </span> </p> <div class="flex items-center gap-s text-secondary"> <iron-icon class="icon-inline flex-shrink-0" icon="icons:language"></iron-icon> <p class="truncate">${0}&ZeroWidthSpace;</p> </div> <div class="flex items-center gap-s text-secondary"> <iron-icon class="icon-inline flex-shrink-0" icon="icons:settings-input-antenna"> </iron-icon> <p class="truncate">${0}&ZeroWidthSpace;</p> </div> </div> `),null===(s=this.data)||void 0===s?void 0:s.name,null===(a=this.data)||void 0===a?void 0:a.format,null===(o=this.data)||void 0===o?void 0:o.url,null===(t=this.data)||void 0===t?void 0:t.event_resource)}}customElements.define("foxy-webhook-card",o);export{o as WebhookCard};
1
+ import"./shared-ca58ef47.js";import"./shared-e28f16db.js";import"./shared-49d978e1.js";import{I as s}from"./shared-3a252ccd.js";import{h as e}from"./shared-7f33a83a.js";import{a}from"./shared-16b542bc.js";import"./shared-7a290f36.js";import"./foxy-spinner.js";import"./shared-86768244.js";import"./shared-98755831.js";import"./shared-64657919.js";import"./shared-a8cf402a.js";import"./shared-eb900735.js";import"./shared-509a2f52.js";import"./shared-d6276c83.js";import"./shared-a89cb472.js";import"./shared-4e709717.js";let i,r=s=>s;class o extends(a(s,"webhook-card")){renderBody(){var s,a,o,t;return e(i||(i=r` <div class="grid grid-cols-1 gap-s leading-none"> <p class="flex justify-between items-center font-medium"> <span class="truncate">${0}&ZeroWidthSpace;</span> <span class="uppercase inline-block text-xs bg-contrast-5 rounded p-xs flex-shrink-0"> ${0}&ZeroWidthSpace; </span> </p> <div class="flex items-center gap-s text-secondary"> <iron-icon class="icon-inline flex-shrink-0" icon="icons:language"></iron-icon> <p class="truncate">${0}&ZeroWidthSpace;</p> </div> <div class="flex items-center gap-s text-secondary"> <iron-icon class="icon-inline flex-shrink-0" icon="icons:settings-input-antenna"> </iron-icon> <p class="truncate">${0}&ZeroWidthSpace;</p> </div> </div> `),null===(s=this.data)||void 0===s?void 0:s.name,null===(a=this.data)||void 0===a?void 0:a.format,null===(o=this.data)||void 0===o?void 0:o.url,null===(t=this.data)||void 0===t?void 0:t.event_resource)}}customElements.define("foxy-webhook-card",o);export{o as WebhookCard};
@@ -1 +1 @@
1
- import"./shared-539cde4d.js";import"./shared-bbb8ec69.js";import"./shared-0dd25feb.js";import{I as e}from"./shared-ec3332b9.js";import"./foxy-webhook-status-card.js";import"./foxy-webhook-log-card.js";import{a as r}from"./shared-04634a6f.js";import{h as o}from"./shared-7f33a83a.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-acda8da2.js";import"./shared-f0c8a5bd.js";import"./shared-313a39ef.js";import"./shared-d1c45954.js";import"./shared-98755831.js";import"./shared-64657919.js";import"./shared-a8cf402a.js";import"./shared-de790de9.js";import"./shared-d3bf9ac0.js";import"./shared-eb900735.js";import"./shared-509a2f52.js";import"./shared-d6276c83.js";import"./shared-a89cb472.js";import"./shared-d519a301.js";import"./shared-11c2efc8.js";import"./foxy-form-dialog.js";import"./shared-3d6f0788.js";import"./shared-025cab8b.js";import"./shared-27d23dfd.js";import"./shared-80792dc8.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-50908853.js";import"./shared-0479553e.js";import"./shared-bdd5c908.js";import"./shared-98eec370.js";import"./shared-b39fce1b.js";import"./shared-44594184.js";import"./shared-07e32de2.js";let t,s,a=e=>e;class n extends(r(e,"webhook-form")){constructor(){super(...arguments),this.__formats=[{value:"json",label:"JSON"},{value:"webflow",label:"Webflow"},{value:"zapier",label:"Zapier"}],this.__eventResources=[{value:"subscription",label:"event_resource_subscription"},{value:"transaction",label:"event_resource_transaction"},{value:"customer",label:"event_resource_customer"}]}static get v8n(){return[({name:e})=>!!e||"name:v8n_required",({name:e})=>!!e&&e.length<=255||"name:v8n_too_long",({version:e})=>!!e||"version:v8n_required",({format:e})=>!!e||"format:v8n_required",({url:e})=>!e||e.length<=1e3||"url:v8n_too_long",({query:e})=>!e||e.length<=1e3||"query:v8n_too_long",({encryption_key:e})=>!e||e.length<=1e3||"encryption-key:v8n_too_long"]}renderBody(){return o(t||(t=a` <foxy-internal-text-control infer="name"></foxy-internal-text-control> <foxy-internal-radio-group-control infer="event-resource" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-text-control infer="query"></foxy-internal-text-control> <foxy-internal-text-control infer="url"></foxy-internal-text-control> <foxy-internal-radio-group-control infer="format" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-text-control infer="encryption-key"></foxy-internal-text-control> <foxy-internal-text-control infer="version"></foxy-internal-text-control> ${0} ${0} `),this.__eventResources,this.__formats,this.data?o(s||(s=a` <foxy-internal-async-details-control first="${0}" infer="statuses" limit="10" item="foxy-webhook-status-card"> </foxy-internal-async-details-control> <foxy-internal-async-details-control first="${0}" infer="logs" limit="5" item="foxy-webhook-log-card"> </foxy-internal-async-details-control> `),this.data._links["fx:statuses"].href,this.data._links["fx:logs"].href):"",super.renderBody())}}customElements.define("foxy-webhook-form",n);export{n as WebhookForm};
1
+ import"./shared-939fc890.js";import"./shared-a6518411.js";import"./shared-1e5292a1.js";import{I as e}from"./shared-6fb923d5.js";import"./foxy-webhook-status-card.js";import"./foxy-webhook-log-card.js";import{a as r}from"./shared-16b542bc.js";import{h as o}from"./shared-7f33a83a.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-e28f16db.js";import"./shared-7a290f36.js";import"./shared-ca58ef47.js";import"./shared-86768244.js";import"./shared-98755831.js";import"./shared-64657919.js";import"./shared-a8cf402a.js";import"./shared-de790de9.js";import"./shared-d3bf9ac0.js";import"./shared-eb900735.js";import"./shared-509a2f52.js";import"./shared-d6276c83.js";import"./shared-a89cb472.js";import"./shared-d519a301.js";import"./shared-11c2efc8.js";import"./foxy-form-dialog.js";import"./shared-0dc1d012.js";import"./shared-cb6f2388.js";import"./shared-c40d85dc.js";import"./shared-9e60ef60.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-5dd31b4e.js";import"./shared-0479553e.js";import"./shared-b95ef318.js";import"./shared-4c9f96ec.js";import"./shared-0c02b4ee.js";import"./shared-49d978e1.js";import"./shared-3a252ccd.js";let t,s,a=e=>e;class n extends(r(e,"webhook-form")){constructor(){super(...arguments),this.__formats=[{value:"json",label:"JSON"},{value:"webflow",label:"Webflow"},{value:"zapier",label:"Zapier"}],this.__eventResources=[{value:"subscription",label:"event_resource_subscription"},{value:"transaction",label:"event_resource_transaction"},{value:"customer",label:"event_resource_customer"}]}static get v8n(){return[({name:e})=>!!e||"name:v8n_required",({name:e})=>!!e&&e.length<=255||"name:v8n_too_long",({version:e})=>!!e||"version:v8n_required",({format:e})=>!!e||"format:v8n_required",({url:e})=>!e||e.length<=1e3||"url:v8n_too_long",({query:e})=>!e||e.length<=1e3||"query:v8n_too_long",({encryption_key:e})=>!e||e.length<=1e3||"encryption-key:v8n_too_long"]}renderBody(){return o(t||(t=a` <foxy-internal-text-control infer="name"></foxy-internal-text-control> <foxy-internal-radio-group-control infer="event-resource" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-text-control infer="query"></foxy-internal-text-control> <foxy-internal-text-control infer="url"></foxy-internal-text-control> <foxy-internal-radio-group-control infer="format" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-text-control infer="encryption-key"></foxy-internal-text-control> <foxy-internal-text-control infer="version"></foxy-internal-text-control> ${0} ${0} `),this.__eventResources,this.__formats,this.data?o(s||(s=a` <foxy-internal-async-details-control first="${0}" infer="statuses" limit="10" item="foxy-webhook-status-card"> </foxy-internal-async-details-control> <foxy-internal-async-details-control first="${0}" infer="logs" limit="5" item="foxy-webhook-log-card"> </foxy-internal-async-details-control> `),this.data._links["fx:statuses"].href,this.data._links["fx:logs"].href):"",super.renderBody())}}customElements.define("foxy-webhook-form",n);export{n as WebhookForm};
@@ -1 +1 @@
1
- import"./shared-d1c45954.js";import"./shared-44594184.js";import{a as e}from"./shared-04634a6f.js";import{I as s}from"./shared-07e32de2.js";import{h as r}from"./shared-7f33a83a.js";import"./shared-98755831.js";import"./shared-64657919.js";import"./shared-a8cf402a.js";import"./foxy-spinner.js";import"./shared-acda8da2.js";import"./shared-f0c8a5bd.js";import"./shared-313a39ef.js";import"./shared-eb900735.js";import"./shared-509a2f52.js";import"./shared-d6276c83.js";import"./shared-a89cb472.js";import"./shared-4e709717.js";let a,o=e=>e;class t extends(e(s,"webhook-log-card")){renderBody(){var e;const{date_created:s,response_code:t,response_body:d}=null!==(e=this.data)&&void 0!==e?e:{};return r(a||(a=o` <div class="leading-none space-y-xs"> <p class="flex justify-between items-center font-medium"> <foxy-i18n .options="${0}" infer="" key="date"></foxy-i18n> <span class="inline-block text-xs bg-contrast-5 text-secondary rounded p-xs"> ${0}&ZeroWidthSpace; </span> </p> <p class="text-tertiary">${0}&ZeroWidthSpace;</p> </div> `),{value:s},t,d)}}customElements.define("foxy-webhook-log-card",t);export{t as WebhookLogCard};
1
+ import"./shared-86768244.js";import"./shared-49d978e1.js";import{a as e}from"./shared-16b542bc.js";import{I as s}from"./shared-3a252ccd.js";import{h as r}from"./shared-7f33a83a.js";import"./shared-98755831.js";import"./shared-64657919.js";import"./shared-a8cf402a.js";import"./foxy-spinner.js";import"./shared-e28f16db.js";import"./shared-7a290f36.js";import"./shared-ca58ef47.js";import"./shared-eb900735.js";import"./shared-509a2f52.js";import"./shared-d6276c83.js";import"./shared-a89cb472.js";import"./shared-4e709717.js";let a,o=e=>e;class t extends(e(s,"webhook-log-card")){renderBody(){var e;const{date_created:s,response_code:t,response_body:d}=null!==(e=this.data)&&void 0!==e?e:{};return r(a||(a=o` <div class="leading-none space-y-xs"> <p class="flex justify-between items-center font-medium"> <foxy-i18n .options="${0}" infer="" key="date"></foxy-i18n> <span class="inline-block text-xs bg-contrast-5 text-secondary rounded p-xs"> ${0}&ZeroWidthSpace; </span> </p> <p class="text-tertiary">${0}&ZeroWidthSpace;</p> </div> `),{value:s},t,d)}}customElements.define("foxy-webhook-log-card",t);export{t as WebhookLogCard};
@@ -1 +1 @@
1
- import"./shared-d1c45954.js";import"./shared-44594184.js";import{a as s}from"./shared-04634a6f.js";import{I as e}from"./shared-07e32de2.js";import{h as a}from"./shared-7f33a83a.js";import{c as r}from"./shared-4e709717.js";import"./shared-98755831.js";import"./shared-64657919.js";import"./shared-a8cf402a.js";import"./foxy-spinner.js";import"./shared-acda8da2.js";import"./shared-f0c8a5bd.js";import"./shared-313a39ef.js";import"./shared-eb900735.js";import"./shared-509a2f52.js";import"./shared-d6276c83.js";import"./shared-a89cb472.js";let t,o=s=>s;const d=s(e,"webhook-status-card");class i extends d{renderBody(){var s,e;const d=null===(s=this.data)||void 0===s?void 0:s.status;return a(t||(t=o` <p class="flex justify-between items-center leading-none"> <foxy-i18n .options="${0}" class="font-medium" infer="" key="date"> </foxy-i18n> <foxy-i18n class="${0}" infer="" key="status_${0}"> </foxy-i18n> </p> `),{value:null===(e=this.data)||void 0===e?void 0:e.date_created},r({"text-error":"failed"===d,"text-tertiary":"pending"===d,"text-success":"successful"===d}),d)}}customElements.define("foxy-webhook-status-card",i);export{i as WebhookStatusCard};
1
+ import"./shared-86768244.js";import"./shared-49d978e1.js";import{a as s}from"./shared-16b542bc.js";import{I as e}from"./shared-3a252ccd.js";import{h as r}from"./shared-7f33a83a.js";import{c as t}from"./shared-4e709717.js";import"./shared-98755831.js";import"./shared-64657919.js";import"./shared-a8cf402a.js";import"./foxy-spinner.js";import"./shared-e28f16db.js";import"./shared-7a290f36.js";import"./shared-ca58ef47.js";import"./shared-eb900735.js";import"./shared-509a2f52.js";import"./shared-d6276c83.js";import"./shared-a89cb472.js";let a,o=s=>s;const d=s(e,"webhook-status-card");class i extends d{renderBody(){var s,e;const d=null===(s=this.data)||void 0===s?void 0:s.status;return r(a||(a=o` <p class="flex justify-between items-center leading-none"> <foxy-i18n .options="${0}" class="font-medium" infer="" key="date"> </foxy-i18n> <foxy-i18n class="${0}" infer="" key="status_${0}"> </foxy-i18n> </p> `),{value:null===(e=this.data)||void 0===e?void 0:e.date_created},t({"text-error":"failed"===d,"text-tertiary":"pending"===d,"text-success":"successful"===d}),d)}}customElements.define("foxy-webhook-status-card",i);export{i as WebhookStatusCard};