@foxy.io/elements 1.59.1 → 1.60.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/dist/cdn/foxy-access-recovery-form.js +1 -1
  2. package/dist/cdn/foxy-address-card.js +1 -1
  3. package/dist/cdn/foxy-address-form.js +1 -1
  4. package/dist/cdn/foxy-admin-subscription-card.js +1 -1
  5. package/dist/cdn/foxy-admin-subscription-form.js +1 -1
  6. package/dist/cdn/foxy-admin-transaction-card.js +1 -1
  7. package/dist/cdn/foxy-api-browser.js +1 -1
  8. package/dist/cdn/foxy-applied-coupon-code-card.js +1 -1
  9. package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
  10. package/dist/cdn/foxy-applied-tax-card.js +1 -1
  11. package/dist/cdn/foxy-attribute-card.js +1 -1
  12. package/dist/cdn/foxy-attribute-form.js +1 -1
  13. package/dist/cdn/foxy-billing-address-card.js +1 -1
  14. package/dist/cdn/foxy-cancellation-form.js +1 -1
  15. package/dist/cdn/foxy-cart-card.js +1 -1
  16. package/dist/cdn/foxy-cart-form.js +1 -1
  17. package/dist/cdn/foxy-client-card.js +1 -1
  18. package/dist/cdn/foxy-client-form.js +1 -1
  19. package/dist/cdn/foxy-collection-page.js +1 -1
  20. package/dist/cdn/foxy-collection-pages.js +1 -1
  21. package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
  22. package/dist/cdn/foxy-coupon-card.js +1 -1
  23. package/dist/cdn/foxy-coupon-code-card.js +1 -1
  24. package/dist/cdn/foxy-coupon-code-form.js +1 -1
  25. package/dist/cdn/foxy-coupon-codes-form.js +1 -1
  26. package/dist/cdn/foxy-coupon-detail-card.js +1 -1
  27. package/dist/cdn/foxy-coupon-form.js +1 -1
  28. package/dist/cdn/foxy-custom-field-card.js +1 -1
  29. package/dist/cdn/foxy-custom-field-form.js +1 -1
  30. package/dist/cdn/foxy-customer-api.js +1 -1
  31. package/dist/cdn/foxy-customer-card.js +1 -1
  32. package/dist/cdn/foxy-customer-form.js +1 -1
  33. package/dist/cdn/foxy-customer-portal-settings-form.js +1 -1
  34. package/dist/cdn/foxy-customer-portal-settings.js +1 -1
  35. package/dist/cdn/foxy-customer-portal.js +1 -1
  36. package/dist/cdn/foxy-customer.js +1 -1
  37. package/dist/cdn/foxy-customers-table.js +1 -1
  38. package/dist/cdn/foxy-discount-builder.js +1 -1
  39. package/dist/cdn/foxy-discount-card.js +1 -1
  40. package/dist/cdn/foxy-discount-detail-card.js +1 -1
  41. package/dist/cdn/foxy-donation.js +1 -1
  42. package/dist/cdn/foxy-downloadable-card.js +1 -1
  43. package/dist/cdn/foxy-downloadable-form.js +1 -1
  44. package/dist/cdn/foxy-email-template-card.js +1 -1
  45. package/dist/cdn/foxy-email-template-form.js +1 -1
  46. package/dist/cdn/foxy-error-entry-card.js +1 -1
  47. package/dist/cdn/foxy-experimental-add-to-cart-builder.js +1 -1
  48. package/dist/cdn/foxy-filter-attribute-card.js +1 -1
  49. package/dist/cdn/foxy-filter-attribute-form.js +1 -1
  50. package/dist/cdn/foxy-form-dialog.js +1 -1
  51. package/dist/cdn/foxy-generate-codes-form.js +1 -1
  52. package/dist/cdn/foxy-gift-card-card.js +1 -1
  53. package/dist/cdn/foxy-gift-card-code-card.js +1 -1
  54. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  55. package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
  56. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  57. package/dist/cdn/foxy-gift-card-form.js +1 -1
  58. package/dist/cdn/foxy-i18n-editor.js +1 -1
  59. package/dist/cdn/foxy-integration-card.js +1 -1
  60. package/dist/cdn/foxy-integration-form.js +1 -1
  61. package/dist/cdn/foxy-item-card.js +1 -1
  62. package/dist/cdn/foxy-item-category-card.js +1 -1
  63. package/dist/cdn/foxy-item-category-form.js +1 -1
  64. package/dist/cdn/foxy-item-form.js +1 -1
  65. package/dist/cdn/foxy-item-option-card.js +1 -1
  66. package/dist/cdn/foxy-item-option-form.js +1 -1
  67. package/dist/cdn/foxy-items-form.js +1 -1
  68. package/dist/cdn/foxy-native-integration-card.js +1 -1
  69. package/dist/cdn/foxy-native-integration-form.js +1 -1
  70. package/dist/cdn/foxy-nucleon-element.js +1 -1
  71. package/dist/cdn/foxy-pagination.js +1 -1
  72. package/dist/cdn/foxy-passkey-card.js +1 -1
  73. package/dist/cdn/foxy-passkey-form.js +1 -1
  74. package/dist/cdn/foxy-payment-card-embed.js +1 -1
  75. package/dist/cdn/foxy-payment-card.js +1 -1
  76. package/dist/cdn/foxy-payment-method-card.js +1 -1
  77. package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
  78. package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
  79. package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
  80. package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
  81. package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
  82. package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
  83. package/dist/cdn/foxy-query-builder.js +1 -1
  84. package/dist/cdn/foxy-report-form.js +1 -1
  85. package/dist/cdn/foxy-reports-table.js +6 -6
  86. package/dist/cdn/foxy-shipment-card.js +1 -1
  87. package/dist/cdn/foxy-shipping-container-card.js +1 -1
  88. package/dist/cdn/foxy-shipping-drop-type-card.js +1 -1
  89. package/dist/cdn/foxy-shipping-method-card.js +1 -1
  90. package/dist/cdn/foxy-shipping-service-card.js +1 -1
  91. package/dist/cdn/foxy-sign-in-form.js +1 -1
  92. package/dist/cdn/foxy-store-card.js +1 -1
  93. package/dist/cdn/foxy-store-form.js +1 -1
  94. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  95. package/dist/cdn/foxy-store-transaction-folder-card.js +1 -1
  96. package/dist/cdn/foxy-store-transaction-folder-form.js +1 -1
  97. package/dist/cdn/foxy-subscription-card.js +1 -1
  98. package/dist/cdn/foxy-subscription-form.js +1 -1
  99. package/dist/cdn/foxy-subscription-settings-form.js +1 -1
  100. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  101. package/dist/cdn/foxy-table.js +1 -1
  102. package/dist/cdn/foxy-tax-card.js +1 -1
  103. package/dist/cdn/foxy-tax-form.js +1 -1
  104. package/dist/cdn/foxy-template-config-form.js +1 -1
  105. package/dist/cdn/foxy-template-form.js +1 -1
  106. package/dist/cdn/foxy-template-set-card.js +1 -1
  107. package/dist/cdn/foxy-template-set-form.js +1 -1
  108. package/dist/cdn/foxy-transaction-card.js +1 -1
  109. package/dist/cdn/foxy-transaction.js +1 -1
  110. package/dist/cdn/foxy-transactions-table.js +1 -1
  111. package/dist/cdn/foxy-update-payment-method-form.js +1 -1
  112. package/dist/cdn/foxy-user-card.js +1 -1
  113. package/dist/cdn/foxy-user-form.js +1 -1
  114. package/dist/cdn/foxy-user-invitation-card.js +1 -1
  115. package/dist/cdn/foxy-user-invitation-form.js +1 -1
  116. package/dist/cdn/foxy-users-table.js +1 -1
  117. package/dist/cdn/foxy-webhook-card.js +1 -1
  118. package/dist/cdn/foxy-webhook-form.js +1 -1
  119. package/dist/cdn/foxy-webhook-log-card.js +1 -1
  120. package/dist/cdn/foxy-webhook-status-card.js +1 -1
  121. package/dist/cdn/{shared-7b6a899b.js → shared-091e97f3.js} +1 -1
  122. package/dist/cdn/shared-0996f4d0.js +1 -0
  123. package/dist/cdn/{shared-3991076b.js → shared-0b0ab3d2.js} +1 -1
  124. package/dist/cdn/{shared-14713ead.js → shared-18707481.js} +1 -1
  125. package/dist/cdn/{shared-336e73ce.js → shared-222b23bb.js} +1 -1
  126. package/dist/cdn/shared-2fbff8e7.js +1 -0
  127. package/dist/cdn/{shared-8ec1b077.js → shared-32a39c0b.js} +1 -1
  128. package/dist/cdn/shared-345b07f1.js +1 -0
  129. package/dist/cdn/{shared-bc74cd11.js → shared-3a61d8a6.js} +1 -1
  130. package/dist/cdn/{shared-1e9df11c.js → shared-3ef23488.js} +1 -1
  131. package/dist/cdn/{shared-33d770fe.js → shared-40a2705c.js} +1 -1
  132. package/dist/cdn/{shared-cb5305b9.js → shared-41f93e6c.js} +1 -1
  133. package/dist/cdn/{shared-45649d84.js → shared-4ab85bea.js} +1 -1
  134. package/dist/cdn/{shared-28fa98d7.js → shared-4ed4b075.js} +1 -1
  135. package/dist/cdn/{shared-20841d9c.js → shared-56278a3c.js} +1 -1
  136. package/dist/cdn/{shared-d743ec15.js → shared-5e7defee.js} +1 -1
  137. package/dist/cdn/{shared-59dfee2c.js → shared-7b15217c.js} +1 -1
  138. package/dist/cdn/{shared-1a814f90.js → shared-7e28c953.js} +1 -1
  139. package/dist/cdn/{shared-2652e98e.js → shared-8292d44e.js} +1 -1
  140. package/dist/cdn/shared-87e17c02.js +1 -0
  141. package/dist/cdn/{shared-a1bec4a0.js → shared-88f841ff.js} +1 -1
  142. package/dist/cdn/{shared-3eca56ee.js → shared-8be109a9.js} +1 -1
  143. package/dist/cdn/{shared-9f8b593b.js → shared-8f5c8c08.js} +1 -1
  144. package/dist/cdn/{shared-be20875c.js → shared-9b290320.js} +1 -1
  145. package/dist/cdn/{shared-b84996e5.js → shared-a95a66b8.js} +1 -1
  146. package/dist/cdn/{shared-4cc16cdf.js → shared-ac536c67.js} +1 -1
  147. package/dist/cdn/{shared-a44fcc6a.js → shared-ad5617ef.js} +1 -1
  148. package/dist/cdn/{shared-38e0a818.js → shared-af4f71bf.js} +1 -1
  149. package/dist/cdn/{shared-50ef1d5a.js → shared-c85c1864.js} +1 -1
  150. package/dist/cdn/{shared-760a2243.js → shared-cda51ccf.js} +1 -1
  151. package/dist/cdn/{shared-db17c9ee.js → shared-d2f777dc.js} +1 -1
  152. package/dist/cdn/{shared-fdf6df5c.js → shared-e9f9face.js} +1 -1
  153. package/dist/cdn/{shared-3baa9cc9.js → shared-eb349085.js} +1 -1
  154. package/dist/cdn/{shared-19b475f7.js → shared-f9c8881a.js} +1 -1
  155. package/dist/cdn/translations/user-invitation-form/en.json +4 -0
  156. package/dist/elements/public/UserInvitationForm/internal/InternalUserInvitationFormScopeControl/InternalUserInvitationFormScopeControl.d.ts +5 -2
  157. package/dist/elements/public/UserInvitationForm/internal/InternalUserInvitationFormScopeControl/InternalUserInvitationFormScopeControl.js +28 -8
  158. package/dist/elements/public/UserInvitationForm/internal/InternalUserInvitationFormScopeControl/InternalUserInvitationFormScopeControl.js.map +1 -1
  159. package/dist/utils/group-invitation-scopes.d.ts +1 -1
  160. package/dist/utils/group-invitation-scopes.js +4 -2
  161. package/dist/utils/group-invitation-scopes.js.map +1 -1
  162. package/dist/utils/invitation-scope.d.ts +1 -1
  163. package/dist/utils/invitation-scope.js +9 -10
  164. package/dist/utils/invitation-scope.js.map +1 -1
  165. package/dist/utils/user-scope.js +2 -2
  166. package/dist/utils/user-scope.js.map +1 -1
  167. package/package.json +1 -1
  168. package/dist/cdn/shared-36f1e29f.js +0 -1
  169. package/dist/cdn/shared-559b648a.js +0 -1
  170. package/dist/cdn/shared-ab1f5f1f.js +0 -1
  171. package/dist/cdn/shared-da3393a5.js +0 -1
@@ -1 +1 @@
1
- import"./shared-a8ae24f0.js";import"./shared-3eca56ee.js";import"./shared-1a814f90.js";import"./shared-b84996e5.js";import"./shared-c066b7fd.js";import{_ as e,l as t}from"./shared-8f9014ff.js";import{c as s,h as i,s as a,L as l}from"./shared-ba5c42c7.js";import{C as r}from"./shared-336e73ce.js";import{T as n,a as o,R as d}from"./shared-5b8c7250.js";import{I as c}from"./shared-930e68b7.js";import{N as h}from"./shared-50ef1d5a.js";import"./shared-dc6e5879.js";import"./shared-f410644a.js";import"./shared-f77994ad.js";import"./shared-45649d84.js";import"./shared-5212ef4f.js";import"./shared-791b4510.js";import"./shared-9496e995.js";import"./shared-56741bad.js";import"./shared-28cc8aa1.js";import"./shared-e9f51baa.js";import"./shared-53a5212e.js";import"./shared-c56c3e1e.js";import"./shared-53e42a77.js";import"./shared-4e709717.js";import"./shared-d8b880bb.js";import"./shared-6262e0d6.js";import"./shared-2fbfbe12.js";import"./shared-c3d6bcc0.js";import"./shared-da3393a5.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-0e19bda5.js";let m,_,p,g,u,f,v=e=>e;const b=r(n(o(d(c(l)),"pagination")));class y extends b{constructor(){super(...arguments),this.__handlePageElementUpdate=()=>this.requestUpdate(),this.__handleScrollAndResize=()=>{var e;null===(e=this.renderRoot.querySelector("dialog"))||void 0===e||e.close()},this.__pageElement=null,this.__customPage=1,this.__first="",this.__limit=20,this.__page=1}static get properties(){return e(e({},super.properties),{},{first:{type:String},__pageElement:{attribute:!1},__customPage:{attribute:!1},__first:{attribute:!1},__limit:{attribute:!1},__page:{attribute:!1}})}static get styles(){return[super.styles,s(m||(m=v`dialog{border-radius:calc(var(--lumo-border-radius-m) + 1px)}dialog::backdrop{background:0 0}`))]}get first(){return this.__first}set first(e){var t;this.__first=e,this.__page=1;try{const s=new URL(e),i=parseInt(null!==(t=s.searchParams.get("limit"))&&void 0!==t?t:"");this.__limit=Number.isNaN(i)||i<1||i>200?20:i}catch(e){this.__limit=20}}connectedCallback(){super.connectedCallback(),this.__connectPageElement(),addEventListener("scroll",this.__handleScrollAndResize),addEventListener("resize",this.__handleScrollAndResize)}render(){var e;const s=null===(e=this.__pageElement)||void 0===e?void 0:e.data,l=Number(t(s,"returned_items")),r=Number.isNaN(l)?0:l,n=Number(t(s,"total_items")),o=Number.isNaN(n)?0:n,d=[20,50,100,150,200];d.includes(this.__limit)||d.unshift(this.__limit);const c=o&&this.__limit?Math.ceil(o/this.__limit):0;return i(_||(_=v` <slot @slotchange="${0}"></slot> <div class="flex gap-m relative mt-s" ?hidden="${0}"> <div class="absolute inset-0 flex items-center justify-center"> <vaadin-button theme="tertiary-inline contrast" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" class="text-xs leading-none" key="pagination" .options="${0}"> </foxy-i18n> </vaadin-button> </div> <vaadin-button theme="tertiary-inline contrast" class="relative" ?disabled="${0}" @click="${0}"> ${0} <foxy-i18n infer="" class="leading-none sr-only sm-not-sr-only" key="first"></foxy-i18n> </vaadin-button> <vaadin-button theme="tertiary-inline contrast" class="relative" ?disabled="${0}" @click="${0}"> ${0} <foxy-i18n infer="" class="leading-none sr-only sm-not-sr-only" key="previous"> </foxy-i18n> </vaadin-button> <div class="flex-1"></div> <vaadin-button theme="tertiary-inline contrast" class="relative" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" class="leading-none sr-only sm-not-sr-only" key="next"></foxy-i18n> ${0} </vaadin-button> <vaadin-button theme="tertiary-inline contrast" class="relative" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" class="leading-none sr-only sm-not-sr-only" key="last"></foxy-i18n> ${0} </vaadin-button> </div> <dialog class="p-0 shadow-m bg-transparent focus-outline-none" @click="${0}"> <foxy-internal-summary-control helper-text="" label="" infer="" class="bg-base rounded border border-base" style="width:18rem"> <foxy-internal-select-control placeholder="${0}" helper-text="" layout="summary-item" label="${0}" infer="" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-select-control> <foxy-internal-number-control placeholder="1" helper-text="" layout="summary-item" label="${0}" infer="" step="1" min="1" max="${0}" .getValue="${0}" .setValue="${0}" @blur="${0}" @keydown="${0}"> </foxy-internal-number-control> </foxy-internal-summary-control> </dialog> `),this.__connectPageElement,c<=1,this.disabled,(e=>{const t=this.__dialog,s=e.currentTarget.getBoundingClientRect();t.showModal();const i=s.left+s.width/2-t.offsetWidth/2;t.style.margin=`calc(var(--lumo-space-xs) + ${s.bottom}px) auto auto ${i.toFixed(2)}px`,t.getBoundingClientRect().bottom>window.innerHeight&&(t.style.margin=`auto auto calc(${(window.innerHeight-s.top).toFixed(2)}px + var(--lumo-space-xs)) ${i.toFixed(2)}px`)}),{total:o,from:(this.__page-1)*this.__limit+1,to:(this.__page-1)*this.__limit+r},this.disabled||1===this.__page,(()=>this.__page=1),a(p||(p=v`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="inline-block" style="width: 1em; height: 1em; transform: translate(-0.15em, -0.05em) scale(1.5)"><path fill-rule="evenodd" d="M4.72 9.47a.75.75 0 0 0 0 1.06l4.25 4.25a.75.75 0 1 0 1.06-1.06L6.31 10l3.72-3.72a.75.75 0 1 0-1.06-1.06L4.72 9.47Zm9.25-4.25L9.72 9.47a.75.75 0 0 0 0 1.06l4.25 4.25a.75.75 0 1 0 1.06-1.06L11.31 10l3.72-3.72a.75.75 0 0 0-1.06-1.06Z" clip-rule="evenodd" /></svg>`)),this.disabled||1===this.__page,(()=>this.__page--),a(g||(g=v`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="inline-block" style="width: 1em; height: 1em; transform: translate(-0.15em, -0.05em) scale(1.5)"><path fill-rule="evenodd" d="M11.78 5.22a.75.75 0 0 1 0 1.06L8.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z" clip-rule="evenodd" /></svg>`)),this.disabled||this.__page>=c,(()=>this.__page++),a(u||(u=v`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="inline-block" style="width: 1em; height: 1em; transform: translate(0.15em, -0.05em) scale(1.5)"><path fill-rule="evenodd" d="M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" /></svg>`)),this.disabled||this.__page>=c,(()=>this.__page=c),a(f||(f=v`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="inline-block" style="width: 1em; height: 1em; transform: translate(0.15em, -0.05em) scale(1.5)"><path fill-rule="evenodd" d="M15.28 9.47a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 1 1-1.06-1.06L13.69 10 9.97 6.28a.75.75 0 0 1 1.06-1.06l4.25 4.25ZM6.03 5.22l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L8.69 10 4.97 6.28a.75.75 0 0 1 1.06-1.06Z" clip-rule="evenodd" /></svg>`)),(e=>{const t=e.currentTarget,s=t.getBoundingClientRect();s.top<=e.clientY&&e.clientY<=s.top+s.height&&s.left<=e.clientX&&e.clientX<=s.left+s.width||t.close()}),this.t("select"),this.t("per_page"),d.map((e=>({rawLabel:e,value:e}))),(()=>this.__limit),(e=>{var t;null===(t=this.__dialog)||void 0===t||t.close(),this.__limit=e,this.__page=1}),this.t("page_number"),c,(()=>this.__customPage),(e=>this.__customPage=e||1),(()=>{var e;this.__page=this.__customPage,null===(e=this.__dialog)||void 0===e||e.close()}),(e=>{var t;"Enter"===e.key&&(e.preventDefault(),this.__page=this.__customPage,null===(t=this.__dialog)||void 0===t||t.close())}))}updated(e){super.updated(e);if(["__first","__limit","__page"].some((t=>e.has(t))))try{const e=new URL(this.__first),t=this.__limit,s=this.__limit*(this.__page-1);e.searchParams.delete("limit"),e.searchParams.delete("offset"),t&&e.searchParams.set("limit",t.toString()),s&&e.searchParams.set("offset",s.toString()),this.__pageElement&&(this.__pageElement.href=e.toString())}catch(e){}}disconnectedCallback(){super.disconnectedCallback(),this.__disconnectPageElement(),removeEventListener("scroll",this.__handleScrollAndResize),removeEventListener("resize",this.__handleScrollAndResize)}get __dialog(){return this.renderRoot.querySelector("dialog")}__disconnectPageElement(){var e;null===(e=this.__pageElement)||void 0===e||e.removeEventListener("update",this.__handlePageElementUpdate),this.__pageElement=null}__connectPageElement(){var e;this.__disconnectPageElement();const t=this.renderRoot.querySelector("slot"),s=(null!==(e=null==t?void 0:t.assignedElements())&&void 0!==e?e:[]).find((e=>e instanceof h));s&&(this.__pageElement=s,this.__pageElement.addEventListener("update",this.__handlePageElementUpdate),this.__pageElement.href=this.first)}}customElements.define("foxy-pagination",y);export{y as Pagination};
1
+ import"./shared-a8ae24f0.js";import"./shared-8be109a9.js";import"./shared-7e28c953.js";import"./shared-a95a66b8.js";import"./shared-c066b7fd.js";import{_ as e,l as t}from"./shared-8f9014ff.js";import{c as s,h as i,s as a,L as l}from"./shared-ba5c42c7.js";import{C as r}from"./shared-222b23bb.js";import{T as n,a as o,R as d}from"./shared-5b8c7250.js";import{I as c}from"./shared-930e68b7.js";import{N as h}from"./shared-c85c1864.js";import"./shared-dc6e5879.js";import"./shared-f410644a.js";import"./shared-f77994ad.js";import"./shared-4ab85bea.js";import"./shared-5212ef4f.js";import"./shared-791b4510.js";import"./shared-9496e995.js";import"./shared-56741bad.js";import"./shared-28cc8aa1.js";import"./shared-e9f51baa.js";import"./shared-53a5212e.js";import"./shared-c56c3e1e.js";import"./shared-53e42a77.js";import"./shared-4e709717.js";import"./shared-d8b880bb.js";import"./shared-6262e0d6.js";import"./shared-2fbfbe12.js";import"./shared-c3d6bcc0.js";import"./shared-87e17c02.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-0e19bda5.js";let m,_,p,g,u,f,b=e=>e;const v=r(n(o(d(c(l)),"pagination")));class y extends v{constructor(){super(...arguments),this.__handlePageElementUpdate=()=>this.requestUpdate(),this.__handleScrollAndResize=()=>{var e;null===(e=this.renderRoot.querySelector("dialog"))||void 0===e||e.close()},this.__pageElement=null,this.__customPage=1,this.__first="",this.__limit=20,this.__page=1}static get properties(){return e(e({},super.properties),{},{first:{type:String},__pageElement:{attribute:!1},__customPage:{attribute:!1},__first:{attribute:!1},__limit:{attribute:!1},__page:{attribute:!1}})}static get styles(){return[super.styles,s(m||(m=b`dialog{border-radius:calc(var(--lumo-border-radius-m) + 1px)}dialog::backdrop{background:0 0}`))]}get first(){return this.__first}set first(e){var t;this.__first=e,this.__page=1;try{const s=new URL(e),i=parseInt(null!==(t=s.searchParams.get("limit"))&&void 0!==t?t:"");this.__limit=Number.isNaN(i)||i<1||i>200?20:i}catch(e){this.__limit=20}}connectedCallback(){super.connectedCallback(),this.__connectPageElement(),addEventListener("scroll",this.__handleScrollAndResize),addEventListener("resize",this.__handleScrollAndResize)}render(){var e;const s=null===(e=this.__pageElement)||void 0===e?void 0:e.data,l=Number(t(s,"returned_items")),r=Number.isNaN(l)?0:l,n=Number(t(s,"total_items")),o=Number.isNaN(n)?0:n,d=[20,50,100,150,200];d.includes(this.__limit)||d.unshift(this.__limit);const c=o&&this.__limit?Math.ceil(o/this.__limit):0;return i(_||(_=b` <slot @slotchange="${0}"></slot> <div class="flex gap-m relative mt-s" ?hidden="${0}"> <div class="absolute inset-0 flex items-center justify-center"> <vaadin-button theme="tertiary-inline contrast" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" class="text-xs leading-none" key="pagination" .options="${0}"> </foxy-i18n> </vaadin-button> </div> <vaadin-button theme="tertiary-inline contrast" class="relative" ?disabled="${0}" @click="${0}"> ${0} <foxy-i18n infer="" class="leading-none sr-only sm-not-sr-only" key="first"></foxy-i18n> </vaadin-button> <vaadin-button theme="tertiary-inline contrast" class="relative" ?disabled="${0}" @click="${0}"> ${0} <foxy-i18n infer="" class="leading-none sr-only sm-not-sr-only" key="previous"> </foxy-i18n> </vaadin-button> <div class="flex-1"></div> <vaadin-button theme="tertiary-inline contrast" class="relative" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" class="leading-none sr-only sm-not-sr-only" key="next"></foxy-i18n> ${0} </vaadin-button> <vaadin-button theme="tertiary-inline contrast" class="relative" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" class="leading-none sr-only sm-not-sr-only" key="last"></foxy-i18n> ${0} </vaadin-button> </div> <dialog class="p-0 shadow-m bg-transparent focus-outline-none" @click="${0}"> <foxy-internal-summary-control helper-text="" label="" infer="" class="bg-base rounded border border-base" style="width:18rem"> <foxy-internal-select-control placeholder="${0}" helper-text="" layout="summary-item" label="${0}" infer="" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-select-control> <foxy-internal-number-control placeholder="1" helper-text="" layout="summary-item" label="${0}" infer="" step="1" min="1" max="${0}" .getValue="${0}" .setValue="${0}" @blur="${0}" @keydown="${0}"> </foxy-internal-number-control> </foxy-internal-summary-control> </dialog> `),this.__connectPageElement,c<=1,this.disabled,(e=>{const t=this.__dialog,s=e.currentTarget.getBoundingClientRect();t.showModal();const i=s.left+s.width/2-t.offsetWidth/2;t.style.margin=`calc(var(--lumo-space-xs) + ${s.bottom}px) auto auto ${i.toFixed(2)}px`,t.getBoundingClientRect().bottom>window.innerHeight&&(t.style.margin=`auto auto calc(${(window.innerHeight-s.top).toFixed(2)}px + var(--lumo-space-xs)) ${i.toFixed(2)}px`)}),{total:o,from:(this.__page-1)*this.__limit+1,to:(this.__page-1)*this.__limit+r},this.disabled||1===this.__page,(()=>this.__page=1),a(p||(p=b`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="inline-block" style="width: 1em; height: 1em; transform: translate(-0.15em, -0.05em) scale(1.5)"><path fill-rule="evenodd" d="M4.72 9.47a.75.75 0 0 0 0 1.06l4.25 4.25a.75.75 0 1 0 1.06-1.06L6.31 10l3.72-3.72a.75.75 0 1 0-1.06-1.06L4.72 9.47Zm9.25-4.25L9.72 9.47a.75.75 0 0 0 0 1.06l4.25 4.25a.75.75 0 1 0 1.06-1.06L11.31 10l3.72-3.72a.75.75 0 0 0-1.06-1.06Z" clip-rule="evenodd" /></svg>`)),this.disabled||1===this.__page,(()=>this.__page--),a(g||(g=b`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="inline-block" style="width: 1em; height: 1em; transform: translate(-0.15em, -0.05em) scale(1.5)"><path fill-rule="evenodd" d="M11.78 5.22a.75.75 0 0 1 0 1.06L8.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z" clip-rule="evenodd" /></svg>`)),this.disabled||this.__page>=c,(()=>this.__page++),a(u||(u=b`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="inline-block" style="width: 1em; height: 1em; transform: translate(0.15em, -0.05em) scale(1.5)"><path fill-rule="evenodd" d="M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" /></svg>`)),this.disabled||this.__page>=c,(()=>this.__page=c),a(f||(f=b`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="inline-block" style="width: 1em; height: 1em; transform: translate(0.15em, -0.05em) scale(1.5)"><path fill-rule="evenodd" d="M15.28 9.47a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 1 1-1.06-1.06L13.69 10 9.97 6.28a.75.75 0 0 1 1.06-1.06l4.25 4.25ZM6.03 5.22l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L8.69 10 4.97 6.28a.75.75 0 0 1 1.06-1.06Z" clip-rule="evenodd" /></svg>`)),(e=>{const t=e.currentTarget,s=t.getBoundingClientRect();s.top<=e.clientY&&e.clientY<=s.top+s.height&&s.left<=e.clientX&&e.clientX<=s.left+s.width||t.close()}),this.t("select"),this.t("per_page"),d.map((e=>({rawLabel:e,value:e}))),(()=>this.__limit),(e=>{var t;null===(t=this.__dialog)||void 0===t||t.close(),this.__limit=e,this.__page=1}),this.t("page_number"),c,(()=>this.__customPage),(e=>this.__customPage=e||1),(()=>{var e;this.__page=this.__customPage,null===(e=this.__dialog)||void 0===e||e.close()}),(e=>{var t;"Enter"===e.key&&(e.preventDefault(),this.__page=this.__customPage,null===(t=this.__dialog)||void 0===t||t.close())}))}updated(e){super.updated(e);if(["__first","__limit","__page"].some((t=>e.has(t))))try{const e=new URL(this.__first),t=this.__limit,s=this.__limit*(this.__page-1);e.searchParams.delete("limit"),e.searchParams.delete("offset"),t&&e.searchParams.set("limit",t.toString()),s&&e.searchParams.set("offset",s.toString()),this.__pageElement&&(this.__pageElement.href=e.toString())}catch(e){}}disconnectedCallback(){super.disconnectedCallback(),this.__disconnectPageElement(),removeEventListener("scroll",this.__handleScrollAndResize),removeEventListener("resize",this.__handleScrollAndResize)}get __dialog(){return this.renderRoot.querySelector("dialog")}__disconnectPageElement(){var e;null===(e=this.__pageElement)||void 0===e||e.removeEventListener("update",this.__handlePageElementUpdate),this.__pageElement=null}__connectPageElement(){var e;this.__disconnectPageElement();const t=this.renderRoot.querySelector("slot"),s=(null!==(e=null==t?void 0:t.assignedElements())&&void 0!==e?e:[]).find((e=>e instanceof h));s&&(this.__pageElement=s,this.__pageElement.addEventListener("update",this.__handlePageElementUpdate),this.__pageElement.href=this.first)}}customElements.define("foxy-pagination",y);export{y as Pagination};
@@ -1 +1 @@
1
- import"./shared-559b648a.js";import{a as s}from"./shared-5b8c7250.js";import{T as r}from"./shared-14713ead.js";import{h as e}from"./shared-ba5c42c7.js";import{u as a}from"./shared-91c18cdd.js";import"./foxy-spinner.js";import"./shared-c59277a4.js";import"./shared-c3d6bcc0.js";import"./shared-f410644a.js";import"./shared-cf1965cb.js";import"./shared-c066b7fd.js";import"./shared-8f9014ff.js";import"./shared-930e68b7.js";import"./shared-20841d9c.js";import"./shared-50ef1d5a.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-da3393a5.js";import"./shared-0e19bda5.js";import"./shared-4e709717.js";import"./shared-336e73ce.js";import"./shared-53e42a77.js";let t,o,d=s=>s;const i=s(r,"passkey-card");class p extends i{get scopeCollection(){return"users"}renderBody(){return super.renderBody({title:s=>e(t||(t=d`${0}`),s.credential_id),subtitle:s=>{let r,t;return s.last_login_date&&s.last_login_ua?(r={last_login_date:new Date(s.last_login_date),last_login_ua:a.analyze(s.last_login_ua).toString()},t="subtitle"):(r={},t="subtitle_no_data"),e(o||(o=d`<foxy-i18n infer="" key="${0}" .options="${0}"></foxy-i18n>`),t,r)}})}}customElements.define("foxy-passkey-card",p);export{p as PasskeyCard};
1
+ import"./shared-0996f4d0.js";import{a as s}from"./shared-5b8c7250.js";import{T as r}from"./shared-18707481.js";import{h as e}from"./shared-ba5c42c7.js";import{u as t}from"./shared-91c18cdd.js";import"./foxy-spinner.js";import"./shared-c59277a4.js";import"./shared-c3d6bcc0.js";import"./shared-f410644a.js";import"./shared-cf1965cb.js";import"./shared-c066b7fd.js";import"./shared-8f9014ff.js";import"./shared-930e68b7.js";import"./shared-56278a3c.js";import"./shared-c85c1864.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-87e17c02.js";import"./shared-0e19bda5.js";import"./shared-4e709717.js";import"./shared-222b23bb.js";import"./shared-53e42a77.js";let a,o,d=s=>s;const i=s(r,"passkey-card");class p extends i{get scopeCollection(){return"users"}renderBody(){return super.renderBody({title:s=>e(a||(a=d`${0}`),s.credential_id),subtitle:s=>{let r,a;return s.last_login_date&&s.last_login_ua?(r={last_login_date:new Date(s.last_login_date),last_login_ua:t.analyze(s.last_login_ua).toString()},a="subtitle"):(r={},a="subtitle_no_data"),e(o||(o=d`<foxy-i18n infer="" key="${0}" .options="${0}"></foxy-i18n>`),a,r)}})}}customElements.define("foxy-passkey-card",p);export{p as PasskeyCard};
@@ -1 +1 @@
1
- import"./shared-3eca56ee.js";import"./shared-7b6a899b.js";import{I as r}from"./shared-be20875c.js";import"./foxy-spinner.js";import{R as e,a as s}from"./shared-5b8c7250.js";import{B as t}from"./shared-8f9014ff.js";import{h as a}from"./shared-ba5c42c7.js";import{u as o}from"./shared-91c18cdd.js";import"./shared-45649d84.js";import"./shared-5212ef4f.js";import"./shared-c066b7fd.js";import"./shared-930e68b7.js";import"./shared-336e73ce.js";import"./shared-53e42a77.js";import"./shared-da3393a5.js";import"./shared-50ef1d5a.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-53a5212e.js";import"./shared-dc6e5879.js";import"./shared-f410644a.js";import"./shared-c56c3e1e.js";import"./shared-28cc8aa1.js";import"./shared-e9f51baa.js";import"./shared-a8ae24f0.js";import"./shared-f77994ad.js";import"./shared-4e709717.js";import"./shared-d0aed1c1.js";import"./shared-760a2243.js";import"./shared-cb5305b9.js";import"./foxy-copy-to-clipboard.js";import"./shared-affe06c0.js";import"./shared-c59277a4.js";import"./shared-c3d6bcc0.js";import"./shared-cfc6735e.js";import"./shared-cf1965cb.js";import"./shared-bab2ea2c.js";let i,d,m=r=>r;const n=e(s(r,"passkey-form"));class p extends n{constructor(){super(...arguments),this.__lastLoginUaGetValue=()=>{var r,e;return o.analyze(null!==(e=null===(r=this.data)||void 0===r?void 0:r.last_login_ua)&&void 0!==e?e:"").toString()}}get scopeCollection(){return"users"}get readonlySelector(){return new t(`settings ${super.readonlySelector.toString()}`)}renderBody(){return this.data?a(d||(d=m` ${0} <foxy-internal-summary-control infer="settings"> <foxy-internal-text-control layout="summary-item" infer="credential-id"></foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="last-login-ua" .getValue="${0}"></foxy-internal-text-control> </foxy-internal-summary-control> ${0} `),this.renderHeader(),this.__lastLoginUaGetValue,super.renderBody()):a(i||(i=m` <div class="p-xl flex items-center justify-center"> <foxy-spinner infer="spinner" state="empty" layout="vertical"></foxy-spinner> </div> `))}}customElements.define("foxy-passkey-form",p);export{p as PasskeyForm};
1
+ import"./shared-8be109a9.js";import"./shared-091e97f3.js";import{I as r}from"./shared-9b290320.js";import"./foxy-spinner.js";import{R as e,a as s}from"./shared-5b8c7250.js";import{B as t}from"./shared-8f9014ff.js";import{h as a}from"./shared-ba5c42c7.js";import{u as o}from"./shared-91c18cdd.js";import"./shared-4ab85bea.js";import"./shared-5212ef4f.js";import"./shared-c066b7fd.js";import"./shared-930e68b7.js";import"./shared-222b23bb.js";import"./shared-53e42a77.js";import"./shared-87e17c02.js";import"./shared-c85c1864.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-53a5212e.js";import"./shared-dc6e5879.js";import"./shared-f410644a.js";import"./shared-c56c3e1e.js";import"./shared-28cc8aa1.js";import"./shared-e9f51baa.js";import"./shared-a8ae24f0.js";import"./shared-f77994ad.js";import"./shared-4e709717.js";import"./shared-d0aed1c1.js";import"./shared-cda51ccf.js";import"./shared-41f93e6c.js";import"./foxy-copy-to-clipboard.js";import"./shared-affe06c0.js";import"./shared-c59277a4.js";import"./shared-c3d6bcc0.js";import"./shared-cfc6735e.js";import"./shared-cf1965cb.js";import"./shared-bab2ea2c.js";let i,d,m=r=>r;const n=e(s(r,"passkey-form"));class p extends n{constructor(){super(...arguments),this.__lastLoginUaGetValue=()=>{var r,e;return o.analyze(null!==(e=null===(r=this.data)||void 0===r?void 0:r.last_login_ua)&&void 0!==e?e:"").toString()}}get scopeCollection(){return"users"}get readonlySelector(){return new t(`settings ${super.readonlySelector.toString()}`)}renderBody(){return this.data?a(d||(d=m` ${0} <foxy-internal-summary-control infer="settings"> <foxy-internal-text-control layout="summary-item" infer="credential-id"></foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="last-login-ua" .getValue="${0}"></foxy-internal-text-control> </foxy-internal-summary-control> ${0} `),this.renderHeader(),this.__lastLoginUaGetValue,super.renderBody()):a(i||(i=m` <div class="p-xl flex items-center justify-center"> <foxy-spinner infer="spinner" state="empty" layout="vertical"></foxy-spinner> </div> `))}}customElements.define("foxy-passkey-form",p);export{p as PasskeyForm};
@@ -1 +1 @@
1
- import"./shared-e9f51baa.js";import"./shared-6262e0d6.js";import"./shared-c56c3e1e.js";import"./shared-142df717.js";import"./shared-dc6e5879.js";import"./shared-28cc8aa1.js";import"./shared-c59277a4.js";import"./shared-cfc6735e.js";import"./foxy-spinner.js";import"./shared-c066b7fd.js";import{_ as e}from"./shared-8f9014ff.js";import{a as r,T as t}from"./shared-5b8c7250.js";import{C as o}from"./shared-336e73ce.js";import{h as s,L as a}from"./shared-ba5c42c7.js";import{P as l}from"./shared-7f7d6ceb.js";import"./shared-11de7969.js";import{I as d}from"./shared-930e68b7.js";import{c as i}from"./shared-4e709717.js";import{s as c}from"./shared-791b4510.js";import"./shared-f410644a.js";import"./shared-c3d6bcc0.js";import"./shared-cf1965cb.js";import"./shared-53e42a77.js";import"./shared-da3393a5.js";import"./shared-9496e995.js";let n,u=e=>e;const m=o(r(d(t(a)),"payment-card-embed"));class p extends m{constructor(){super(...arguments),this.url=null,this.__configRefreshInterval=null,this.__embed=null,this.__ready=!1}static get properties(){return e(e({},super.properties),{},{__ready:{attribute:!1},url:{}})}disconnectedCallback(){var e;super.disconnectedCallback(),clearInterval(null!==(e=this.__configRefreshInterval)&&void 0!==e?e:void 0)}connectedCallback(){super.connectedCallback(),this.__configRefreshInterval=setInterval((()=>{var e;const r=this.__config;r&&(null===(e=this.__embed)||void 0===e||e.configure(r))}),1e3)}tokenize(){var e,r;return null!==(r=null===(e=this.__embed)||void 0===e?void 0:e.tokenize())&&void 0!==r?r:Promise.reject()}updated(e){super.updated(e),(e.has("hidden")||e.has("url"))&&this.__setupEmbed()}render(){return s(n||(n=u` <div class="relative"> <div class="${0}" id="iframe-container"></div> <div class="${0}"> <foxy-spinner infer="spinner" layout="no-label"></foxy-spinner> </div> <div class="hidden ml-m mr-s bg-contrast-5 text-contrast-10 h-m w-xs rounded-tr-m rounded-br-s font-lumo text-m leading-xs" style="border-top-color:var(--lumo-primary-color);border-bottom-color:var(--lumo-primary-text-color);border-left-color:var(--lumo-primary-color-50pct);border-right-color:var(--lumo-secondary-text-color)" id="d1"></div> <div class="hidden text-s text-disabled" style="background-color:var(--lumo-body-text-color);border-top-color:var(--lumo-error-text-color);border-bottom-color:var(--lumo-error-color-10pct);border-left-color:var(--lumo-error-color-50pct)" id="d2"></div> <div class="hidden text-contrast-50 text-xs bg-base" id="d3"></div> </div> `),i({"transition-opacity relative":!0,"opacity-0":!this.__ready}),i({"absolute inset-0 flex items-center justify-center":!0,"transition-opacity pointer-events-none":!0,"opacity-0":this.__ready}))}clear(){var e;null===(e=this.__embed)||void 0===e||e.clear()}get __config(){const e=this.renderRoot.querySelector("#d1"),r=this.renderRoot.querySelector("#d2"),t=this.renderRoot.querySelector("#d3");if(!e||!r||!t)return null;const o=getComputedStyle(e),s=getComputedStyle(r),a=getComputedStyle(t),l={"--lumo-space-m":o.marginLeft,"--lumo-space-s":o.marginRight,"--lumo-contrast-5pct":o.backgroundColor,"--lumo-contrast-10pct":o.color,"--lumo-contrast-50pct":a.color,"--lumo-size-m":o.height,"--lumo-size-xs":o.width,"--lumo-border-radius-m":o.borderTopRightRadius,"--lumo-border-radius-s":o.borderBottomRightRadius,"--lumo-font-family":o.fontFamily,"--lumo-font-size-m":o.fontSize,"--lumo-font-size-s":s.fontSize,"--lumo-font-size-xs":a.fontSize,"--lumo-primary-color":o.borderTopColor,"--lumo-primary-text-color":o.borderBottomColor,"--lumo-primary-color-50pct":o.borderLeftColor,"--lumo-secondary-text-color":o.borderRightColor,"--lumo-disabled-text-color":s.color,"--lumo-body-text-color":s.backgroundColor,"--lumo-error-text-color":s.borderTopColor,"--lumo-error-color-10pct":s.borderBottomColor,"--lumo-error-color-50pct":s.borderLeftColor,"--lumo-line-height-xs":o.lineHeight,"--lumo-base-color":a.backgroundColor},d={};return["stripe.label","stripe.status.idle","stripe.status.busy","stripe.status.fail","square.label","square.status.idle","square.status.busy","square.status.fail","default.cc-number.label","default.cc-number.placeholder","default.cc-number.v8n_required","default.cc-number.v8n_invalid","default.cc-number.v8n_unsupported","default.cc-exp.label","default.cc-exp.placeholder","default.cc-exp.v8n_required","default.cc-exp.v8n_invalid","default.cc-exp.v8n_expired","default.cc-csc.label","default.cc-csc.placeholder","default.cc-csc.v8n_required","default.cc-csc.v8n_invalid","default.status.idle","default.status.busy","default.status.fail","default.status.misconfigured"].forEach((e=>c(d,e,this.t(e)))),{translations:d,disabled:this.disabled,readonly:this.readonly,style:l,lang:this.lang}}__setupEmbed(){this.__embed&&this.__embed.unmount();const r=this.__config,t=this.renderRoot.querySelector("#iframe-container"),o=this.url;if(null!==o&&t&&r&&!this.hidden){const s=this.constructor;this.__embed=new s.PaymentCardEmbed(e({url:o},r)),this.__embed.mount(t).then((()=>this.__ready=!0)),this.__embed.onsubmit=()=>this.dispatchEvent(new CustomEvent("submit"))}else this.__ready=!1,this.__embed=null}}p.PaymentCardEmbed=l,customElements.define("foxy-payment-card-embed",p);export{p as PaymentCardEmbed};
1
+ import"./shared-e9f51baa.js";import"./shared-6262e0d6.js";import"./shared-c56c3e1e.js";import"./shared-142df717.js";import"./shared-dc6e5879.js";import"./shared-28cc8aa1.js";import"./shared-c59277a4.js";import"./shared-cfc6735e.js";import"./foxy-spinner.js";import"./shared-c066b7fd.js";import{_ as e}from"./shared-8f9014ff.js";import{a as r,T as t}from"./shared-5b8c7250.js";import{C as o}from"./shared-222b23bb.js";import{h as s,L as a}from"./shared-ba5c42c7.js";import{P as l}from"./shared-7f7d6ceb.js";import"./shared-11de7969.js";import{I as d}from"./shared-930e68b7.js";import{c as i}from"./shared-4e709717.js";import{s as c}from"./shared-791b4510.js";import"./shared-f410644a.js";import"./shared-c3d6bcc0.js";import"./shared-cf1965cb.js";import"./shared-53e42a77.js";import"./shared-87e17c02.js";import"./shared-9496e995.js";let n,u=e=>e;const m=o(r(d(t(a)),"payment-card-embed"));class p extends m{constructor(){super(...arguments),this.url=null,this.__configRefreshInterval=null,this.__embed=null,this.__ready=!1}static get properties(){return e(e({},super.properties),{},{__ready:{attribute:!1},url:{}})}disconnectedCallback(){var e;super.disconnectedCallback(),clearInterval(null!==(e=this.__configRefreshInterval)&&void 0!==e?e:void 0)}connectedCallback(){super.connectedCallback(),this.__configRefreshInterval=setInterval((()=>{var e;const r=this.__config;r&&(null===(e=this.__embed)||void 0===e||e.configure(r))}),1e3)}tokenize(){var e,r;return null!==(r=null===(e=this.__embed)||void 0===e?void 0:e.tokenize())&&void 0!==r?r:Promise.reject()}updated(e){super.updated(e),(e.has("hidden")||e.has("url"))&&this.__setupEmbed()}render(){return s(n||(n=u` <div class="relative"> <div class="${0}" id="iframe-container"></div> <div class="${0}"> <foxy-spinner infer="spinner" layout="no-label"></foxy-spinner> </div> <div class="hidden ml-m mr-s bg-contrast-5 text-contrast-10 h-m w-xs rounded-tr-m rounded-br-s font-lumo text-m leading-xs" style="border-top-color:var(--lumo-primary-color);border-bottom-color:var(--lumo-primary-text-color);border-left-color:var(--lumo-primary-color-50pct);border-right-color:var(--lumo-secondary-text-color)" id="d1"></div> <div class="hidden text-s text-disabled" style="background-color:var(--lumo-body-text-color);border-top-color:var(--lumo-error-text-color);border-bottom-color:var(--lumo-error-color-10pct);border-left-color:var(--lumo-error-color-50pct)" id="d2"></div> <div class="hidden text-contrast-50 text-xs bg-base" id="d3"></div> </div> `),i({"transition-opacity relative":!0,"opacity-0":!this.__ready}),i({"absolute inset-0 flex items-center justify-center":!0,"transition-opacity pointer-events-none":!0,"opacity-0":this.__ready}))}clear(){var e;null===(e=this.__embed)||void 0===e||e.clear()}get __config(){const e=this.renderRoot.querySelector("#d1"),r=this.renderRoot.querySelector("#d2"),t=this.renderRoot.querySelector("#d3");if(!e||!r||!t)return null;const o=getComputedStyle(e),s=getComputedStyle(r),a=getComputedStyle(t),l={"--lumo-space-m":o.marginLeft,"--lumo-space-s":o.marginRight,"--lumo-contrast-5pct":o.backgroundColor,"--lumo-contrast-10pct":o.color,"--lumo-contrast-50pct":a.color,"--lumo-size-m":o.height,"--lumo-size-xs":o.width,"--lumo-border-radius-m":o.borderTopRightRadius,"--lumo-border-radius-s":o.borderBottomRightRadius,"--lumo-font-family":o.fontFamily,"--lumo-font-size-m":o.fontSize,"--lumo-font-size-s":s.fontSize,"--lumo-font-size-xs":a.fontSize,"--lumo-primary-color":o.borderTopColor,"--lumo-primary-text-color":o.borderBottomColor,"--lumo-primary-color-50pct":o.borderLeftColor,"--lumo-secondary-text-color":o.borderRightColor,"--lumo-disabled-text-color":s.color,"--lumo-body-text-color":s.backgroundColor,"--lumo-error-text-color":s.borderTopColor,"--lumo-error-color-10pct":s.borderBottomColor,"--lumo-error-color-50pct":s.borderLeftColor,"--lumo-line-height-xs":o.lineHeight,"--lumo-base-color":a.backgroundColor},d={};return["stripe.label","stripe.status.idle","stripe.status.busy","stripe.status.fail","square.label","square.status.idle","square.status.busy","square.status.fail","default.cc-number.label","default.cc-number.placeholder","default.cc-number.v8n_required","default.cc-number.v8n_invalid","default.cc-number.v8n_unsupported","default.cc-exp.label","default.cc-exp.placeholder","default.cc-exp.v8n_required","default.cc-exp.v8n_invalid","default.cc-exp.v8n_expired","default.cc-csc.label","default.cc-csc.placeholder","default.cc-csc.v8n_required","default.cc-csc.v8n_invalid","default.status.idle","default.status.busy","default.status.fail","default.status.misconfigured"].forEach((e=>c(d,e,this.t(e)))),{translations:d,disabled:this.disabled,readonly:this.readonly,style:l,lang:this.lang}}__setupEmbed(){this.__embed&&this.__embed.unmount();const r=this.__config,t=this.renderRoot.querySelector("#iframe-container"),o=this.url;if(null!==o&&t&&r&&!this.hidden){const s=this.constructor;this.__embed=new s.PaymentCardEmbed(e({url:o},r)),this.__embed.mount(t).then((()=>this.__ready=!0)),this.__embed.onsubmit=()=>this.dispatchEvent(new CustomEvent("submit"))}else this.__ready=!1,this.__embed=null}}p.PaymentCardEmbed=l,customElements.define("foxy-payment-card-embed",p);export{p as PaymentCardEmbed};
@@ -1 +1 @@
1
- import"./shared-559b648a.js";import"./foxy-nucleon-element.js";import"./shared-c066b7fd.js";import{_ as e}from"./shared-8f9014ff.js";import{l as t,u as a}from"./shared-cf613436.js";import{c as s}from"./shared-da3393a5.js";import{C as r}from"./shared-336e73ce.js";import{a as o}from"./shared-5b8c7250.js";import{I as n}from"./shared-20841d9c.js";import{i as d}from"./shared-53e42a77.js";import{h as i}from"./shared-ba5c42c7.js";import"./foxy-spinner.js";import"./shared-c59277a4.js";import"./shared-c3d6bcc0.js";import"./shared-f410644a.js";import"./shared-cf1965cb.js";import"./shared-930e68b7.js";import"./shared-50ef1d5a.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-4e709717.js";let l,c,p,y,u=e=>e;const h=r(o(n,"payment-card"));class _ extends h{constructor(){super(...arguments),this.hostedPaymentGatewaysHelper=null,this.paymentGatewaysHelper=null,this.__hostedPaymentGatewaysLoaderId="hostedPaymentGatewaysLoader",this.__paymentGatewaysLoaderId="paymentGatewaysLoader",this.__transactionLoaderId="transactionLoader",this.__storeLoaderId="storeLoader"}static get properties(){return e(e({},super.properties),{},{hostedPaymentGatewaysHelper:{attribute:"hosted-payment-gateways-helper"},paymentGatewaysHelper:{attribute:"payment-gateways-helper"}})}renderBody(){var e,s,r,o,n,h,_,m,f;const v=this.data,x=`${null!==(e=null==v?void 0:v.amount)&&void 0!==e?e:""} ${this.__currencyCode}`,$={currencyDisplay:this.__currencyDisplay,amount:x},w=null!==(r=null===(s=this.data)||void 0===s?void 0:s.fraud_protection_score)&&void 0!==r?r:0,b=w>0?"text-error":"text-success",j=w>0?"bg-error-10":"bg-success-10",L=(null!==(o=null==v?void 0:v.cc_type)&&void 0!==o?o:"unknown").toLowerCase(),g=null===(n=null==v?void 0:v.cc_exp_year)||void 0===n?void 0:n.substring(2),G=null==v?void 0:v.cc_exp_month,k=null===(h=null==v?void 0:v.cc_number_masked)||void 0===h?void 0:h.replace(/x/gi,"");return i(l||(l=u` <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <p class="leading-s"> <span class="block font-medium text-m" data-testid="line-1"> <foxy-i18n .options="${0}" infer="" key="price"></foxy-i18n> <span>&nbsp;&bull;&nbsp;</span> <foxy-i18n .options="${0}" infer="" key="date"></foxy-i18n> </span> <span class="block text-s text-secondary"> ${0} </span> ${0} <span class="mt-s flex space-x-s overflow-auto"> ${0} <foxy-i18n class="truncate flex font-medium h-xs items-center px-s rounded-s text-s ${0} ${0}" infer="" key="fraud_risk" .options="${0}"> </foxy-i18n> </span> </p> `),d(null!==(_=this.hostedPaymentGatewaysHelper)&&void 0!==_?_:void 0),this.__hostedPaymentGatewaysLoaderId,(()=>this.requestUpdate()),d(null!==(m=this.paymentGatewaysHelper)&&void 0!==m?m:void 0),this.__paymentGatewaysLoaderId,(()=>this.requestUpdate()),d(null==v?void 0:v._links["fx:transaction"].href),this.__transactionLoaderId,(()=>this.requestUpdate()),d(this.__canReadStore?null==v?void 0:v._links["fx:store"].href:void 0),this.__storeLoaderId,(()=>this.requestUpdate()),$,{value:null==v?void 0:v.date_created},this.__gatewayName||i(c||(c=u`<foxy-i18n infer="" key="unknown"></foxy-i18n>`)),["processor_response","paypal_payer_id","third_party_id","purchase_order"].map((e=>{if(!(null==v?void 0:v[e]))return;return i(p||(p=u`<foxy-i18n class="${0}" infer="" key="${0}" .options="${0}"></foxy-i18n>`),"block text-s text-tertiary",e,v)})),G&&g&&k?i(y||(y=u` <span class="truncate flex items-center h-xs rounded-s overflow-hidden bg-contrast-5" data-testid="card-info"> <span class="h-xs">${0}</span> <span class="font-medium px-s">•••• ${0} ${0}/${0}</span> </span> `),null!==(f=t[L])&&void 0!==f?f:a,k,G,g):"",b,j,{score:w})}get isBodyReady(){return!!super.isBodyReady&&(!!this.__currencyCode&&(!!this.__currencyDisplay&&(!this.hostedPaymentGatewaysHelper||!this.paymentGatewaysHelper||!!this.__gatewayName)))}get __hostedPaymentGatewaysLoader(){return this.renderRoot.querySelector(`#${this.__hostedPaymentGatewaysLoaderId}`)}get __paymentGatewaysLoader(){return this.renderRoot.querySelector(`#${this.__paymentGatewaysLoaderId}`)}get __transactionLoader(){return this.renderRoot.querySelector(`#${this.__transactionLoaderId}`)}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}get __canReadStore(){return s(this.currentUserScope,"stores")}get __currencyDisplay(){var e;const t=null===(e=this.__storeLoader)||void 0===e?void 0:e.data;return t||this.__canReadStore?t?t.use_international_currency_symbol?"code":"symbol":void 0:"symbol"}get __currencyCode(){var e,t;return null===(t=null===(e=this.__transactionLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.currency_code}get __gatewayName(){var e,t,a,s,r,o;const n=null===(e=this.data)||void 0===e?void 0:e.gateway_type;if(n){const e=null===(a=null===(t=this.__paymentGatewaysLoader)||void 0===t?void 0:t.data)||void 0===a?void 0:a.values[n],d=null===(r=null===(s=this.__hostedPaymentGatewaysLoader)||void 0===s?void 0:s.data)||void 0===r?void 0:r.values[n];return null!==(o=null==e?void 0:e.name)&&void 0!==o?o:null==d?void 0:d.name}}}customElements.define("foxy-payment-card",_);export{_ as PaymentCard};
1
+ import"./shared-0996f4d0.js";import"./foxy-nucleon-element.js";import"./shared-c066b7fd.js";import{_ as e}from"./shared-8f9014ff.js";import{l as t,u as a}from"./shared-cf613436.js";import{c as s}from"./shared-87e17c02.js";import{C as r}from"./shared-222b23bb.js";import{a as o}from"./shared-5b8c7250.js";import{I as n}from"./shared-56278a3c.js";import{i as d}from"./shared-53e42a77.js";import{h as i}from"./shared-ba5c42c7.js";import"./foxy-spinner.js";import"./shared-c59277a4.js";import"./shared-c3d6bcc0.js";import"./shared-f410644a.js";import"./shared-cf1965cb.js";import"./shared-930e68b7.js";import"./shared-c85c1864.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-4e709717.js";let l,c,p,y,u=e=>e;const h=r(o(n,"payment-card"));class _ extends h{constructor(){super(...arguments),this.hostedPaymentGatewaysHelper=null,this.paymentGatewaysHelper=null,this.__hostedPaymentGatewaysLoaderId="hostedPaymentGatewaysLoader",this.__paymentGatewaysLoaderId="paymentGatewaysLoader",this.__transactionLoaderId="transactionLoader",this.__storeLoaderId="storeLoader"}static get properties(){return e(e({},super.properties),{},{hostedPaymentGatewaysHelper:{attribute:"hosted-payment-gateways-helper"},paymentGatewaysHelper:{attribute:"payment-gateways-helper"}})}renderBody(){var e,s,r,o,n,h,_,m,f;const v=this.data,x=`${null!==(e=null==v?void 0:v.amount)&&void 0!==e?e:""} ${this.__currencyCode}`,$={currencyDisplay:this.__currencyDisplay,amount:x},w=null!==(r=null===(s=this.data)||void 0===s?void 0:s.fraud_protection_score)&&void 0!==r?r:0,b=w>0?"text-error":"text-success",j=w>0?"bg-error-10":"bg-success-10",L=(null!==(o=null==v?void 0:v.cc_type)&&void 0!==o?o:"unknown").toLowerCase(),g=null===(n=null==v?void 0:v.cc_exp_year)||void 0===n?void 0:n.substring(2),G=null==v?void 0:v.cc_exp_month,k=null===(h=null==v?void 0:v.cc_number_masked)||void 0===h?void 0:h.replace(/x/gi,"");return i(l||(l=u` <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <p class="leading-s"> <span class="block font-medium text-m" data-testid="line-1"> <foxy-i18n .options="${0}" infer="" key="price"></foxy-i18n> <span>&nbsp;&bull;&nbsp;</span> <foxy-i18n .options="${0}" infer="" key="date"></foxy-i18n> </span> <span class="block text-s text-secondary"> ${0} </span> ${0} <span class="mt-s flex space-x-s overflow-auto"> ${0} <foxy-i18n class="truncate flex font-medium h-xs items-center px-s rounded-s text-s ${0} ${0}" infer="" key="fraud_risk" .options="${0}"> </foxy-i18n> </span> </p> `),d(null!==(_=this.hostedPaymentGatewaysHelper)&&void 0!==_?_:void 0),this.__hostedPaymentGatewaysLoaderId,(()=>this.requestUpdate()),d(null!==(m=this.paymentGatewaysHelper)&&void 0!==m?m:void 0),this.__paymentGatewaysLoaderId,(()=>this.requestUpdate()),d(null==v?void 0:v._links["fx:transaction"].href),this.__transactionLoaderId,(()=>this.requestUpdate()),d(this.__canReadStore?null==v?void 0:v._links["fx:store"].href:void 0),this.__storeLoaderId,(()=>this.requestUpdate()),$,{value:null==v?void 0:v.date_created},this.__gatewayName||i(c||(c=u`<foxy-i18n infer="" key="unknown"></foxy-i18n>`)),["processor_response","paypal_payer_id","third_party_id","purchase_order"].map((e=>{if(!(null==v?void 0:v[e]))return;return i(p||(p=u`<foxy-i18n class="${0}" infer="" key="${0}" .options="${0}"></foxy-i18n>`),"block text-s text-tertiary",e,v)})),G&&g&&k?i(y||(y=u` <span class="truncate flex items-center h-xs rounded-s overflow-hidden bg-contrast-5" data-testid="card-info"> <span class="h-xs">${0}</span> <span class="font-medium px-s">•••• ${0} ${0}/${0}</span> </span> `),null!==(f=t[L])&&void 0!==f?f:a,k,G,g):"",b,j,{score:w})}get isBodyReady(){return!!super.isBodyReady&&(!!this.__currencyCode&&(!!this.__currencyDisplay&&(!this.hostedPaymentGatewaysHelper||!this.paymentGatewaysHelper||!!this.__gatewayName)))}get __hostedPaymentGatewaysLoader(){return this.renderRoot.querySelector(`#${this.__hostedPaymentGatewaysLoaderId}`)}get __paymentGatewaysLoader(){return this.renderRoot.querySelector(`#${this.__paymentGatewaysLoaderId}`)}get __transactionLoader(){return this.renderRoot.querySelector(`#${this.__transactionLoaderId}`)}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}get __canReadStore(){return s(this.currentUserScope,"stores")}get __currencyDisplay(){var e;const t=null===(e=this.__storeLoader)||void 0===e?void 0:e.data;return t||this.__canReadStore?t?t.use_international_currency_symbol?"code":"symbol":void 0:"symbol"}get __currencyCode(){var e,t;return null===(t=null===(e=this.__transactionLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.currency_code}get __gatewayName(){var e,t,a,s,r,o;const n=null===(e=this.data)||void 0===e?void 0:e.gateway_type;if(n){const e=null===(a=null===(t=this.__paymentGatewaysLoader)||void 0===t?void 0:t.data)||void 0===a?void 0:a.values[n],d=null===(r=null===(s=this.__hostedPaymentGatewaysLoader)||void 0===s?void 0:s.data)||void 0===r?void 0:r.values[n];return null!==(o=null==e?void 0:e.name)&&void 0!==o?o:null==d?void 0:d.name}}}customElements.define("foxy-payment-card",_);export{_ as PaymentCard};
@@ -1 +1 @@
1
- import"./shared-c59277a4.js";import"./shared-cf1965cb.js";import"./shared-a8ae24f0.js";import"./shared-760a2243.js";import"./shared-5212ef4f.js";import"./foxy-update-payment-method-form.js";import"./foxy-form-dialog.js";import"./foxy-spinner.js";import"./shared-c066b7fd.js";import{_ as e,B as t}from"./shared-8f9014ff.js";import{l as s,u as r}from"./shared-cf613436.js";import{C as a}from"./shared-336e73ce.js";import{T as i,a as o}from"./shared-5b8c7250.js";import"./foxy-nucleon-element.js";import{u as d,h as n,c}from"./shared-ba5c42c7.js";import{i as l}from"./shared-53e42a77.js";import{c as p}from"./shared-4e709717.js";import{N as m}from"./shared-50ef1d5a.js";import"./shared-c3d6bcc0.js";import"./shared-f410644a.js";import"./shared-dc6e5879.js";import"./shared-f77994ad.js";import"./shared-cb5305b9.js";import"./shared-69c98b7b.js";import"./shared-930e68b7.js";import"./shared-3baa9cc9.js";import"./shared-bc74cd11.js";import"./shared-91483320.js";import"./shared-d8b880bb.js";import"./shared-6262e0d6.js";import"./shared-28cc8aa1.js";import"./shared-2fbfbe12.js";import"./shared-e9f51baa.js";import"./shared-53a5212e.js";import"./shared-c56c3e1e.js";import"./shared-3eca56ee.js";import"./shared-45649d84.js";import"./shared-791b4510.js";import"./shared-9496e995.js";import"./foxy-collection-page.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./shared-da3393a5.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-0e19bda5.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-1a814f90.js";import"./shared-56741bad.js";import"./shared-b84996e5.js";import"./shared-be20875c.js";import"./foxy-copy-to-clipboard.js";import"./shared-affe06c0.js";import"./shared-cfc6735e.js";import"./shared-bab2ea2c.js";import"./foxy-template-set-card.js";import"./shared-14713ead.js";import"./shared-20841d9c.js";import"./foxy-payment-card-embed.js";import"./shared-142df717.js";import"./shared-7f7d6ceb.js";import"./shared-11de7969.js";const h=d("\n repeating-radial-gradient(\n circle at -100% 500%,\n rgba(255, 255, 255, 0),\n rgba(255, 255, 255, 0.05) 4px\n )\n"),f=d(Object.entries({unknown:"#797c85",amex:"#2557d6",diners:"#0079be",discover:"#4d4d4d",jcb:"#0e4c96",maestro:"#181818",mastercard:"#16366f",unionpay:"#0dadb5",visa:"#0e4595"}).map((([e,t])=>`.bg-${e} { background: ${t} ${h} }`)).join(" "));let u,b,j,y,g,v,$,_,x,S,w=e=>e;const T=i(a(o(m,"payment-method-card")));class U extends T{constructor(){super(...arguments),this.embedUrl=null,this.__renderActionsUpdate=()=>{var e;const t=!!(null===(e=this.data)||void 0===e?void 0:e.save_cc),s=t?"--lumo-primary-text-color: #fff; --lumo-primary-color-50pct: rgba(255, 255, 255, 0.5); --lumo-contrast-5pct: rgba(255, 255, 255, 0.05)":void 0;return n(u||(u=w` <div class="flex"> ${0} <foxy-form-dialog data-testid="update-dialog" readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="status ${0}" header="${0}" group="${0}" form="foxy-update-payment-method-form" href="${0}" lang="${0}" ns="${0} dialog" alert close-on-patch .currentUserScope="${0}" .props="${0}"> </foxy-form-dialog> <vaadin-button class="${0}" theme="${0}" style="${0}" aria-label="${0}" data-testid="actions:update" ?disabled="${0}" @click="${0}"> ${0} </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("actions:update:before"),this.readonlySelector.zoom("actions:update:form"),this.disabledSelector.zoom("actions:update:form"),this.hiddenSelector.zoom("actions:update:form"),t?"dialog_header_update":"dialog_header_add",this.group,this.href,this.lang,this.ns,this.currentUserScope,{".embedUrl":this.embedUrl},l(t?"px-xs rounded":void 0),t?"icon":"contrast small",l(s),this.t(t?"update":"add"),this.disabledSelector.matches("actions:update",!0),(e=>{const t=e.currentTarget;t.previousElementSibling.show(t)}),n(t?b||(b=w`<iron-icon icon="icons:create"></iron-icon>`):j||(j=w`<foxy-i18n infer="" key="add"></foxy-i18n>`)),this.renderTemplateOrSlot("actions:update:after"))},this.__renderActionsDelete=()=>n(y||(y=w` <div class="flex"> ${0} <vaadin-button class="px-xs rounded" theme="icon" style="--lumo-primary-text-color:#fff;--lumo-primary-color-50pct:rgba(255, 255, 255, 0.5);--lumo-contrast-5pct:rgba(255, 255, 255, 0.05)" aria-label="${0}" data-testid="actions:delete" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:delete"></iron-icon> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("actions:delete:before"),this.t("delete").toString(),this.disabledSelector.matches("actions:delete",!0),this.__handleDelete,this.renderTemplateOrSlot("actions:delete:after")),this.__renderActions=()=>{const e=this.hiddenSelector.matches("actions:update",!0)||!this.embedUrl,t=this.hiddenSelector.matches("actions:delete",!0);return n(g||(g=w` <div class="flex gap-s" data-testid="actions"> ${0} ${0} ${0} ${0} </div> `),this.renderTemplateOrSlot("actions:before"),e?"":this.__renderActionsUpdate(),t?"":this.__renderActionsDelete(),this.renderTemplateOrSlot("actions:after"))}}static get properties(){return e(e({},super.properties),{},{embedUrl:{attribute:"embed-url"}})}static get styles(){return[super.styles,f,c(v||(v=w`.ratio-card{padding-top:63%;position:relative;height:0}.ratio-card>*{position:absolute;top:0;right:0;bottom:0;left:0}`))]}get scopeCollection(){return"customers"}get scopeRules(){return[{path:"actions",collection:"customers",need:"write"}]}render(){var e,a,i,o,d,c;const{data:l,lang:m,ns:h}=this,f=this.errors.includes("error:access_denied");if(this.in({idle:"template"})||!(null==l?void 0:l.save_cc)||!this.in("idle")||f){const t=this.in("fail")||f?"error":this.in("busy")?"busy":"empty",s=this.hiddenSelector.matches("actions:update",!0)||!this.embedUrl||!this.data;return n($||($=w` <div class="ratio-card" aria-live="polite" aria-busy="${0}" data-testid="wrapper"> <div class="h-full bg-contrast-5"></div> <div class="absolute inset-0 flex flex-col gap-m items-center justify-center"> <foxy-spinner data-testid="spinner" layout="vertical" state="${0}" error-type="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> ${0} </div> </div> `),this.in("busy"),t,this.accessDenied||f?"access-denied":"generic",this.lang,h,null!==(a=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==a?a:"",s?"":this.__renderActionsUpdate())}const u=null!==(o=null===(i=l.cc_type)||void 0===i?void 0:i.toLowerCase())&&void 0!==o?o:"unknown",b=null!==(d=s[u])&&void 0!==d?d:r,j=null===(c=l.cc_number_masked)||void 0===c?void 0:c.substring(l.cc_number_masked.length-4);return n(_||(_=w` <foxy-internal-confirm-dialog data-testid="confirm" message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" lang="${0}" ns="${0}" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <div class="ratio-card" data-testid="wrapper" aria-busy="${0}" aria-live="polite"> <div class="flex flex-col justify-between text-base text-m leading-m font-lumo p-m bg-unknown bg-${0}"> <div class="${0}"> <div class="mr-auto rounded h-m">${0}</div> ${0} </div> <div class="font-tnum leading-none flex justify-between" style="color:#fff"> <div data-testid="expiry"> ${0} </div> <div data-testid="number"> ${0} </div> </div> </div> </div> `),m,h,this.__handleConfirmHide,this.in("busy"),u,p({"flex items-start":!0,"justify-between":this.readonlyControls===t.False,"justify-end":this.readonlyControls===t.True}),b,this.hiddenSelector.matches("actions",!0)?"":this.__renderActions(),l.cc_exp_month&&l.cc_exp_year?n(x||(x=w` <span class="sr-only">${0}&nbsp;</span> <span>${0} / ${0}</span> `),this.t("expires").toString(),l.cc_exp_month,l.cc_exp_year):"",j?n(S||(S=w` <span class="sr-only">${0}&nbsp;</span> <span aria-hidden="true">••••</span> <span>${0}</span> `),this.t("last_4_digits").toString(),j):"")}async _sendDelete(){const e=JSON.stringify({save_cc:!1});await this._fetch(this.href,{method:"PATCH",body:e});return m.Rumour(this.group).share({data:null,source:this.href,related:[this.parent]}),null}__handleDelete(e){this.renderRoot.querySelector("#confirm").show(e.currentTarget)}__handleConfirmHide(e){e.detail.cancelled||this.delete()}}customElements.define("foxy-payment-method-card",U);export{U as PaymentMethodCard};
1
+ import"./shared-c59277a4.js";import"./shared-cf1965cb.js";import"./shared-a8ae24f0.js";import"./shared-cda51ccf.js";import"./shared-5212ef4f.js";import"./foxy-update-payment-method-form.js";import"./foxy-form-dialog.js";import"./foxy-spinner.js";import"./shared-c066b7fd.js";import{_ as e,B as t}from"./shared-8f9014ff.js";import{l as s,u as r}from"./shared-cf613436.js";import{C as a}from"./shared-222b23bb.js";import{T as i,a as o}from"./shared-5b8c7250.js";import"./foxy-nucleon-element.js";import{u as d,h as n,c}from"./shared-ba5c42c7.js";import{i as l}from"./shared-53e42a77.js";import{c as p}from"./shared-4e709717.js";import{N as m}from"./shared-c85c1864.js";import"./shared-c3d6bcc0.js";import"./shared-f410644a.js";import"./shared-dc6e5879.js";import"./shared-f77994ad.js";import"./shared-41f93e6c.js";import"./shared-69c98b7b.js";import"./shared-930e68b7.js";import"./shared-eb349085.js";import"./shared-3a61d8a6.js";import"./shared-91483320.js";import"./shared-d8b880bb.js";import"./shared-6262e0d6.js";import"./shared-28cc8aa1.js";import"./shared-2fbfbe12.js";import"./shared-e9f51baa.js";import"./shared-53a5212e.js";import"./shared-c56c3e1e.js";import"./shared-8be109a9.js";import"./shared-4ab85bea.js";import"./shared-791b4510.js";import"./shared-9496e995.js";import"./foxy-collection-page.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./shared-87e17c02.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-0e19bda5.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-7e28c953.js";import"./shared-56741bad.js";import"./shared-a95a66b8.js";import"./shared-9b290320.js";import"./foxy-copy-to-clipboard.js";import"./shared-affe06c0.js";import"./shared-cfc6735e.js";import"./shared-bab2ea2c.js";import"./foxy-template-set-card.js";import"./shared-18707481.js";import"./shared-56278a3c.js";import"./foxy-payment-card-embed.js";import"./shared-142df717.js";import"./shared-7f7d6ceb.js";import"./shared-11de7969.js";const h=d("\n repeating-radial-gradient(\n circle at -100% 500%,\n rgba(255, 255, 255, 0),\n rgba(255, 255, 255, 0.05) 4px\n )\n"),f=d(Object.entries({unknown:"#797c85",amex:"#2557d6",diners:"#0079be",discover:"#4d4d4d",jcb:"#0e4c96",maestro:"#181818",mastercard:"#16366f",unionpay:"#0dadb5",visa:"#0e4595"}).map((([e,t])=>`.bg-${e} { background: ${t} ${h} }`)).join(" "));let u,b,j,y,g,v,$,_,x,S,w=e=>e;const T=i(a(o(m,"payment-method-card")));class U extends T{constructor(){super(...arguments),this.embedUrl=null,this.__renderActionsUpdate=()=>{var e;const t=!!(null===(e=this.data)||void 0===e?void 0:e.save_cc),s=t?"--lumo-primary-text-color: #fff; --lumo-primary-color-50pct: rgba(255, 255, 255, 0.5); --lumo-contrast-5pct: rgba(255, 255, 255, 0.05)":void 0;return n(u||(u=w` <div class="flex"> ${0} <foxy-form-dialog data-testid="update-dialog" readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="status ${0}" header="${0}" group="${0}" form="foxy-update-payment-method-form" href="${0}" lang="${0}" ns="${0} dialog" alert close-on-patch .currentUserScope="${0}" .props="${0}"> </foxy-form-dialog> <vaadin-button class="${0}" theme="${0}" style="${0}" aria-label="${0}" data-testid="actions:update" ?disabled="${0}" @click="${0}"> ${0} </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("actions:update:before"),this.readonlySelector.zoom("actions:update:form"),this.disabledSelector.zoom("actions:update:form"),this.hiddenSelector.zoom("actions:update:form"),t?"dialog_header_update":"dialog_header_add",this.group,this.href,this.lang,this.ns,this.currentUserScope,{".embedUrl":this.embedUrl},l(t?"px-xs rounded":void 0),t?"icon":"contrast small",l(s),this.t(t?"update":"add"),this.disabledSelector.matches("actions:update",!0),(e=>{const t=e.currentTarget;t.previousElementSibling.show(t)}),n(t?b||(b=w`<iron-icon icon="icons:create"></iron-icon>`):j||(j=w`<foxy-i18n infer="" key="add"></foxy-i18n>`)),this.renderTemplateOrSlot("actions:update:after"))},this.__renderActionsDelete=()=>n(y||(y=w` <div class="flex"> ${0} <vaadin-button class="px-xs rounded" theme="icon" style="--lumo-primary-text-color:#fff;--lumo-primary-color-50pct:rgba(255, 255, 255, 0.5);--lumo-contrast-5pct:rgba(255, 255, 255, 0.05)" aria-label="${0}" data-testid="actions:delete" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:delete"></iron-icon> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("actions:delete:before"),this.t("delete").toString(),this.disabledSelector.matches("actions:delete",!0),this.__handleDelete,this.renderTemplateOrSlot("actions:delete:after")),this.__renderActions=()=>{const e=this.hiddenSelector.matches("actions:update",!0)||!this.embedUrl,t=this.hiddenSelector.matches("actions:delete",!0);return n(g||(g=w` <div class="flex gap-s" data-testid="actions"> ${0} ${0} ${0} ${0} </div> `),this.renderTemplateOrSlot("actions:before"),e?"":this.__renderActionsUpdate(),t?"":this.__renderActionsDelete(),this.renderTemplateOrSlot("actions:after"))}}static get properties(){return e(e({},super.properties),{},{embedUrl:{attribute:"embed-url"}})}static get styles(){return[super.styles,f,c(v||(v=w`.ratio-card{padding-top:63%;position:relative;height:0}.ratio-card>*{position:absolute;top:0;right:0;bottom:0;left:0}`))]}get scopeCollection(){return"customers"}get scopeRules(){return[{path:"actions",collection:"customers",need:"write"}]}render(){var e,a,i,o,d,c;const{data:l,lang:m,ns:h}=this,f=this.errors.includes("error:access_denied");if(this.in({idle:"template"})||!(null==l?void 0:l.save_cc)||!this.in("idle")||f){const t=this.in("fail")||f?"error":this.in("busy")?"busy":"empty",s=this.hiddenSelector.matches("actions:update",!0)||!this.embedUrl||!this.data;return n($||($=w` <div class="ratio-card" aria-live="polite" aria-busy="${0}" data-testid="wrapper"> <div class="h-full bg-contrast-5"></div> <div class="absolute inset-0 flex flex-col gap-m items-center justify-center"> <foxy-spinner data-testid="spinner" layout="vertical" state="${0}" error-type="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> ${0} </div> </div> `),this.in("busy"),t,this.accessDenied||f?"access-denied":"generic",this.lang,h,null!==(a=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==a?a:"",s?"":this.__renderActionsUpdate())}const u=null!==(o=null===(i=l.cc_type)||void 0===i?void 0:i.toLowerCase())&&void 0!==o?o:"unknown",b=null!==(d=s[u])&&void 0!==d?d:r,j=null===(c=l.cc_number_masked)||void 0===c?void 0:c.substring(l.cc_number_masked.length-4);return n(_||(_=w` <foxy-internal-confirm-dialog data-testid="confirm" message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" lang="${0}" ns="${0}" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <div class="ratio-card" data-testid="wrapper" aria-busy="${0}" aria-live="polite"> <div class="flex flex-col justify-between text-base text-m leading-m font-lumo p-m bg-unknown bg-${0}"> <div class="${0}"> <div class="mr-auto rounded h-m">${0}</div> ${0} </div> <div class="font-tnum leading-none flex justify-between" style="color:#fff"> <div data-testid="expiry"> ${0} </div> <div data-testid="number"> ${0} </div> </div> </div> </div> `),m,h,this.__handleConfirmHide,this.in("busy"),u,p({"flex items-start":!0,"justify-between":this.readonlyControls===t.False,"justify-end":this.readonlyControls===t.True}),b,this.hiddenSelector.matches("actions",!0)?"":this.__renderActions(),l.cc_exp_month&&l.cc_exp_year?n(x||(x=w` <span class="sr-only">${0}&nbsp;</span> <span>${0} / ${0}</span> `),this.t("expires").toString(),l.cc_exp_month,l.cc_exp_year):"",j?n(S||(S=w` <span class="sr-only">${0}&nbsp;</span> <span aria-hidden="true">••••</span> <span>${0}</span> `),this.t("last_4_digits").toString(),j):"")}async _sendDelete(){const e=JSON.stringify({save_cc:!1});await this._fetch(this.href,{method:"PATCH",body:e});return m.Rumour(this.group).share({data:null,source:this.href,related:[this.parent]}),null}__handleDelete(e){this.renderRoot.querySelector("#confirm").show(e.currentTarget)}__handleConfirmHide(e){e.detail.cancelled||this.delete()}}customElements.define("foxy-payment-method-card",U);export{U as PaymentMethodCard};
@@ -1 +1 @@
1
- import"./shared-5212ef4f.js";import"./foxy-spinner.js";import"./shared-c066b7fd.js";import{_ as r}from"./shared-8f9014ff.js";import{a as e}from"./shared-5b8c7250.js";import{T as s}from"./shared-14713ead.js";import{h as t}from"./shared-ba5c42c7.js";import"./shared-c59277a4.js";import"./shared-c3d6bcc0.js";import"./shared-f410644a.js";import"./shared-cf1965cb.js";import"./shared-930e68b7.js";import"./shared-336e73ce.js";import"./shared-53e42a77.js";import"./shared-da3393a5.js";import"./shared-20841d9c.js";import"./shared-50ef1d5a.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-4e709717.js";let a,i,o,d=r=>r;const m=e(s,"payments-api-fraud-protection-card");class p extends m{constructor(){super(...arguments),this.getImageSrc=null}static get defaultImageSrc(){return"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 44 44'%3E%3Cpath fill='%23fff' d='M0 20.73v-9.9L10.83 0h9.9L0 20.73ZM0 0h9.41L0 9.41V0Zm0 22.14L22.14 0h9.9l-9.43 9.44-.61-.27-10.5 4.66v7-.29L0 32.04v-9.9Zm11.54-.23L0 33.46v9.9l14.14-14.14a15 15 0 0 1-2.6-7.3Zm3.2 8.12L.77 44h9.9l9.7-9.7a13.75 13.75 0 0 1-5.63-4.27Zm6.67 4.64L12.08 44h9.9L44 21.98v-9.9L32.16 23.92C31.01 29.15 27.05 33.6 22 34.83l-.59-.16Zm11.02-12.43L44 10.67V.77L31.42 13.35l1.08.48v7a13 13 0 0 1-.07 1.4Zm-1.99-9.32L43.35 0h-9.9l-9.87 9.87 6.86 3.05ZM23.4 44 44 23.4v9.9L33.3 44h-9.9Zm11.31 0L44 34.71V44h-9.29Z'/%3E%3Cpath fill='%23fff' d='M30.17 21.99H22V11.72l-8.17 3.63V22H22v10.42c4.34-1.34 7.55-5.63 8.17-10.43Z'/%3E%3C/svg%3E"}static get properties(){return r(r({},super.properties),{},{getImageSrc:{attribute:!1}})}get scopeCollection(){return"payment_settings"}renderBody(){var r,e;const s=super.renderBody({title:r=>t(a||(a=d`${0}`),r.helper.name),subtitle:r=>t(i||(i=d`${0}`),r.description)});if(!this.in({idle:"snapshot"}))return s;const m=p.defaultImageSrc,c=this.data;return t(o||(o=d` <figure class="flex items-center" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <img class="relative h-s w-s object-cover rounded-full bg-contrast-20 flex-shrink-0 shadow-xs" src="${0}" alt="${0}" @error="${0}"> <figcaption class="min-w-0 flex-1">${0}</figcaption> </figure> `),null!==(e=c?null===(r=this.getImageSrc)||void 0===r?void 0:r.call(this,c.type):null)&&void 0!==e?e:m,this.t("image_alt"),(r=>r.currentTarget.src=m),s)}}customElements.define("foxy-payments-api-fraud-protection-card",p);export{p as PaymentsApiFraudProtectionCard};
1
+ import"./shared-5212ef4f.js";import"./foxy-spinner.js";import"./shared-c066b7fd.js";import{_ as r}from"./shared-8f9014ff.js";import{a as e}from"./shared-5b8c7250.js";import{T as s}from"./shared-18707481.js";import{h as t}from"./shared-ba5c42c7.js";import"./shared-c59277a4.js";import"./shared-c3d6bcc0.js";import"./shared-f410644a.js";import"./shared-cf1965cb.js";import"./shared-930e68b7.js";import"./shared-222b23bb.js";import"./shared-53e42a77.js";import"./shared-87e17c02.js";import"./shared-56278a3c.js";import"./shared-c85c1864.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-4e709717.js";let a,i,o,m=r=>r;const d=e(s,"payments-api-fraud-protection-card");class c extends d{constructor(){super(...arguments),this.getImageSrc=null}static get defaultImageSrc(){return"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 44 44'%3E%3Cpath fill='%23fff' d='M0 20.73v-9.9L10.83 0h9.9L0 20.73ZM0 0h9.41L0 9.41V0Zm0 22.14L22.14 0h9.9l-9.43 9.44-.61-.27-10.5 4.66v7-.29L0 32.04v-9.9Zm11.54-.23L0 33.46v9.9l14.14-14.14a15 15 0 0 1-2.6-7.3Zm3.2 8.12L.77 44h9.9l9.7-9.7a13.75 13.75 0 0 1-5.63-4.27Zm6.67 4.64L12.08 44h9.9L44 21.98v-9.9L32.16 23.92C31.01 29.15 27.05 33.6 22 34.83l-.59-.16Zm11.02-12.43L44 10.67V.77L31.42 13.35l1.08.48v7a13 13 0 0 1-.07 1.4Zm-1.99-9.32L43.35 0h-9.9l-9.87 9.87 6.86 3.05ZM23.4 44 44 23.4v9.9L33.3 44h-9.9Zm11.31 0L44 34.71V44h-9.29Z'/%3E%3Cpath fill='%23fff' d='M30.17 21.99H22V11.72l-8.17 3.63V22H22v10.42c4.34-1.34 7.55-5.63 8.17-10.43Z'/%3E%3C/svg%3E"}static get properties(){return r(r({},super.properties),{},{getImageSrc:{attribute:!1}})}get scopeCollection(){return"payment_settings"}renderBody(){var r,e;const s=super.renderBody({title:r=>t(a||(a=m`${0}`),r.helper.name),subtitle:r=>t(i||(i=m`${0}`),r.description)});if(!this.in({idle:"snapshot"}))return s;const d=c.defaultImageSrc,p=this.data;return t(o||(o=m` <figure class="flex items-center" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <img class="relative h-s w-s object-cover rounded-full bg-contrast-20 flex-shrink-0 shadow-xs" src="${0}" alt="${0}" @error="${0}"> <figcaption class="min-w-0 flex-1">${0}</figcaption> </figure> `),null!==(e=p?null===(r=this.getImageSrc)||void 0===r?void 0:r.call(this,p.type):null)&&void 0!==e?e:d,this.t("image_alt"),(r=>r.currentTarget.src=d),s)}}customElements.define("foxy-payments-api-fraud-protection-card",c);export{c as PaymentsApiFraudProtectionCard};
@@ -1 +1 @@
1
- import"./shared-a8ae24f0.js";import"./shared-3eca56ee.js";import"./shared-59dfee2c.js";import"./shared-1a814f90.js";import"./shared-b84996e5.js";import"./shared-7b6a899b.js";import{I as e}from"./shared-be20875c.js";import"./foxy-nucleon-element.js";import"./shared-c066b7fd.js";import{_ as t,B as r,aN as o,l as a}from"./shared-8f9014ff.js";import{a as i}from"./shared-5b8c7250.js";import{i as s}from"./shared-53e42a77.js";import{c as n}from"./shared-4e709717.js";import{h as l}from"./shared-ba5c42c7.js";import{s as d}from"./shared-791b4510.js";import{h as c}from"./shared-c7796413.js";import"./shared-dc6e5879.js";import"./shared-f410644a.js";import"./shared-f77994ad.js";import"./shared-45649d84.js";import"./shared-5212ef4f.js";import"./shared-336e73ce.js";import"./shared-da3393a5.js";import"./shared-930e68b7.js";import"./shared-50ef1d5a.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-0e19bda5.js";import"./shared-affe06c0.js";import"./shared-c59277a4.js";import"./shared-c3d6bcc0.js";import"./shared-cfc6735e.js";import"./shared-56741bad.js";import"./shared-28cc8aa1.js";import"./shared-e9f51baa.js";import"./shared-53a5212e.js";import"./shared-c56c3e1e.js";import"./shared-d8b880bb.js";import"./shared-6262e0d6.js";import"./shared-2fbfbe12.js";import"./shared-d0aed1c1.js";import"./shared-760a2243.js";import"./shared-cb5305b9.js";import"./foxy-copy-to-clipboard.js";import"./shared-cf1965cb.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let p,f,h,u,m,v,y,b,_,j,g,$,x,L,w,F,P=e=>e;const S=i(e,"payments-api-fraud-protection-form");class I extends S{constructor(){super(...arguments),this.getImageSrc=null,this.__availableFraudProtectionsLoaderId="availableFraudProtections"}static get defaultImageSrc(){return"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 44 44'%3E%3Cpath fill='%23fff' d='M0 20.73v-9.9L10.83 0h9.9L0 20.73ZM0 0h9.41L0 9.41V0Zm0 22.14L22.14 0h9.9l-9.43 9.44-.61-.27-10.5 4.66v7-.29L0 32.04v-9.9Zm11.54-.23L0 33.46v9.9l14.14-14.14a15 15 0 0 1-2.6-7.3Zm3.2 8.12L.77 44h9.9l9.7-9.7a13.75 13.75 0 0 1-5.63-4.27Zm6.67 4.64L12.08 44h9.9L44 21.98v-9.9L32.16 23.92C31.01 29.15 27.05 33.6 22 34.83l-.59-.16Zm11.02-12.43L44 10.67V.77L31.42 13.35l1.08.48v7a13 13 0 0 1-.07 1.4Zm-1.99-9.32L43.35 0h-9.9l-9.87 9.87 6.86 3.05ZM23.4 44 44 23.4v9.9L33.3 44h-9.9Zm11.31 0L44 34.71V44h-9.29Z'/%3E%3Cpath fill='%23fff' d='M30.17 21.99H22V11.72l-8.17 3.63V22H22v10.42c4.34-1.34 7.55-5.63 8.17-10.43Z'/%3E%3C/svg%3E"}static get properties(){return t(t({},super.properties),{},{getImageSrc:{attribute:!1}})}static get v8n(){return[({description:e})=>!e||e.length<=100||"description:v8n_too_long",({type:e})=>!!e||"type:v8n_required",({score_threshold_reject:e})=>"number"!=typeof e||(e<=100&&e>=0||"score-threshold-reject:v8n_out_of_range"),e=>{var t,r,o,a;const i=null!==(o=null===(r=null===(t=e.helper)||void 0===t?void 0:t.json)||void 0===r?void 0:r.blocks)&&void 0!==o?o:[];let s;try{s=JSON.parse(null!==(a=e.json)&&void 0!==a?a:"{}")}catch(e){s={}}for(const e of i)for(const t of e.fields)if("optional"in t&&!t.optional){const r=[e.parent_id,e.id,t.id].filter((e=>!!e));if(!c(s,r)&&"checkbox"!==t.type)return"json:v8n_invalid"}return!0}]}get scopeCollection(){return"payment_settings"}get hiddenSelector(){return new r(`header:copy-json ${super.hiddenSelector}`.trimEnd())}get headerTitleOptions(){var e;return t(t({},this.data),{},{context:null!==(e=this.form.type)&&void 0!==e?e:"new"})}get headerSubtitleOptions(){return{id:this.headerCopyIdValue}}renderHeader(...e){var t;return l(p||(p=P` <div> ${0} ${0} </div> `),super.renderHeader(...e),(null===(t=this.data)||void 0===t?void 0:t.type)||!this.form.type?l(f||(f=P``)):l(h||(h=P` <vaadin-button data-testid="select-another-button" theme="tertiary-inline" @click="${0}"> <foxy-i18n infer="" key="select_another_button_label"></foxy-i18n> </vaadin-button> `),(()=>this.undo())))}renderBody(){const e=l(u||(u=P` <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),s(this.__availableFraudProtectionsHref),this.__availableFraudProtectionsLoaderId,(()=>this.requestUpdate()));return l(m||(m=P`${0}${0}${0}`),this.renderHeader(),this.form.type?this.__renderFraudProtectionConfig():this.__renderFraudProtectionSelector(),e)}get __availableFraudProtectionsLoader(){return this.renderRoot.querySelector(`#${this.__availableFraudProtectionsLoaderId}`)}get __availableFraudProtectionsHref(){try{const e=o(/\/payment_presets\/(.+)\//,{presetId:1}),t=new URL(this.href||this.parent).pathname,r=e.exec(t).groups.presetId;return new URL(`/payment_presets/${r}/available_fraud_protections`,this.href||this.parent).toString()}catch(e){}}get __availableFraudProtections(){var e,t;return null===(t=null===(e=this.__availableFraudProtectionsLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values}__renderFraudProtectionSelector(){var e;const t=this.__availableFraudProtectionsLoader;return l(v||(v=P` ${0} `),(null==t?void 0:t.data)?l(y||(y=P` <div class="grid grid-cols-2 gap-m" data-testid="select-protection-list"> ${0} </div> `),Object.entries(null!==(e=this.__availableFraudProtections)&&void 0!==e?e:{}).map((([e,t])=>this.__renderFraudProtectionButton({type:e,helper:t})))):l(b||(b=P` <foxy-spinner infer="list-spinner" state="${0}" error-type="${0}"> </foxy-spinner> `),(null==t?void 0:t.in("fail"))?"error":"busy",(null==t?void 0:t.accessDenied)?"access-denied":"generic"))}__renderFraudProtectionButton({type:e,helper:t}){var r,o;const a=I.defaultImageSrc,i=null!==(o=null===(r=this.getImageSrc)||void 0===r?void 0:r.call(this,e))&&void 0!==o?o:a,d=e=>e.currentTarget.src=a;return l(_||(_=P` <button class="${0}" ?disabled="${0}" title="${0}" @click="${0}"> <img class="absolute top-0 left-0 w-1-2 h-full object-cover bg-center filter saturate-200 blur-3xl" style="transform:translate3d(0,0,0)" src="${0}" alt="" ?hidden="${0}" @error="${0}"> <figure class="relative flex flex-col gap-m"> <img class="${0}" src="${0}" alt="" @error="${0}"> <figcaption class="${0}"> <div class="font-medium">${0}&ZeroWidthSpace;</div> <div class="text-xs ${0}">${0}</div> </figcaption> </figure> </button> `),n({"relative w-full block text-left p-s rounded bg-contrast-5 overflow-hidden":!0,"focus-outline-none focus-ring-2 focus-ring-primary-50":!0,"transition-colors hover-bg-contrast-10":!t.conflict,"cursor-default":!!t.conflict}),!!t.conflict,s(t.conflict?this.t("conflict_message"):void 0),(()=>this.edit({type:e,helper:t})),i,!!t.conflict,d,n({"h-m w-m object-cover rounded-full bg-contrast-20 flex-shrink-0 shadow-xs":!0,"filter grayscale":!!t.conflict}),i,d,n({"min-w-0 flex-1 truncate leading-s":!0,"text-disabled":!!t.conflict}),t.name,t.conflict?"":"text-secondary",e)}__renderFraudProtectionConfig(){var e,t,r;return l(j||(j=P` <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="description"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="setup"> ${0} ${0} </foxy-internal-summary-control> ${0} `),(null===(e=this.form.helper)||void 0===e?void 0:e.uses_rejection_threshold)?l(g||(g=P` <foxy-internal-number-control layout="summary-item" infer="score-threshold-reject"> </foxy-internal-number-control> `)):"",null===(r=null===(t=this.form.helper)||void 0===t?void 0:t.json)||void 0===r?void 0:r.blocks.map((e=>this.__renderBlock(e))),super.renderBody())}__renderBlock(e){return l($||($=P`${0}`),e.fields.map((t=>{var r,o,i;const s=()=>{var r,o;let i;try{i=JSON.parse(null!==(r=this.form.json)&&void 0!==r?r:"")}catch(e){i={}}const s=[e.parent_id,e.id,t.id].filter((e=>!!e));return null!==(o=a(i,s))&&void 0!==o?o:i.default_value},n=r=>{var o;let a;try{a=JSON.parse(null!==(o=this.form.json)&&void 0!==o?o:"")}catch(e){a={}}const i=[e.parent_id,e.id,t.id].filter((e=>!!e));this.edit({json:JSON.stringify(d(a,i,r))})},c=t.options,p=["json",...[e.parent_id,e.id,t.id].filter((e=>!!e))].join("-").replace(/_/g,"-");return l(x||(x=P` ${0} `),"checkbox"===t.type?l(L||(L=P` <foxy-internal-switch-control helper-text="${0}" label="${0}" infer="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> `),null!==(r=t.description)&&void 0!==r?r:"",t.name,p,s,n):"select"===t.type?l(w||(w=P` <foxy-internal-select-control helper-text="${0}" placeholder="${0}" layout="summary-item" label="${0}" infer="${0}" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-select-control> `),null!==(o=t.description)&&void 0!==o?o:"",this.t("default_additional_field_placeholder"),t.name,p,c.map((({name:e,value:t})=>({label:e,value:t}))),s,n):l(F||(F=P` <foxy-internal-text-control helper-text="${0}" placeholder="${0}" layout="summary-item" label="${0}" infer="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> `),null!==(i=t.description)&&void 0!==i?i:"",t.default_value||this.t("default_additional_field_placeholder"),t.name,p,s,n))})))}}customElements.define("foxy-payments-api-fraud-protection-form",I);export{I as PaymentsApiFraudProtectionForm};
1
+ import"./shared-a8ae24f0.js";import"./shared-8be109a9.js";import"./shared-7b15217c.js";import"./shared-7e28c953.js";import"./shared-a95a66b8.js";import"./shared-091e97f3.js";import{I as e}from"./shared-9b290320.js";import"./foxy-nucleon-element.js";import"./shared-c066b7fd.js";import{_ as t,B as r,aN as o,l as a}from"./shared-8f9014ff.js";import{a as i}from"./shared-5b8c7250.js";import{i as s}from"./shared-53e42a77.js";import{c as n}from"./shared-4e709717.js";import{h as l}from"./shared-ba5c42c7.js";import{s as d}from"./shared-791b4510.js";import{h as c}from"./shared-c7796413.js";import"./shared-dc6e5879.js";import"./shared-f410644a.js";import"./shared-f77994ad.js";import"./shared-4ab85bea.js";import"./shared-5212ef4f.js";import"./shared-222b23bb.js";import"./shared-87e17c02.js";import"./shared-930e68b7.js";import"./shared-c85c1864.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-0e19bda5.js";import"./shared-affe06c0.js";import"./shared-c59277a4.js";import"./shared-c3d6bcc0.js";import"./shared-cfc6735e.js";import"./shared-56741bad.js";import"./shared-28cc8aa1.js";import"./shared-e9f51baa.js";import"./shared-53a5212e.js";import"./shared-c56c3e1e.js";import"./shared-d8b880bb.js";import"./shared-6262e0d6.js";import"./shared-2fbfbe12.js";import"./shared-d0aed1c1.js";import"./shared-cda51ccf.js";import"./shared-41f93e6c.js";import"./foxy-copy-to-clipboard.js";import"./shared-cf1965cb.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let p,f,h,u,m,v,b,y,_,j,g,$,x,L,w,F,P=e=>e;const S=i(e,"payments-api-fraud-protection-form");class I extends S{constructor(){super(...arguments),this.getImageSrc=null,this.__availableFraudProtectionsLoaderId="availableFraudProtections"}static get defaultImageSrc(){return"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 44 44'%3E%3Cpath fill='%23fff' d='M0 20.73v-9.9L10.83 0h9.9L0 20.73ZM0 0h9.41L0 9.41V0Zm0 22.14L22.14 0h9.9l-9.43 9.44-.61-.27-10.5 4.66v7-.29L0 32.04v-9.9Zm11.54-.23L0 33.46v9.9l14.14-14.14a15 15 0 0 1-2.6-7.3Zm3.2 8.12L.77 44h9.9l9.7-9.7a13.75 13.75 0 0 1-5.63-4.27Zm6.67 4.64L12.08 44h9.9L44 21.98v-9.9L32.16 23.92C31.01 29.15 27.05 33.6 22 34.83l-.59-.16Zm11.02-12.43L44 10.67V.77L31.42 13.35l1.08.48v7a13 13 0 0 1-.07 1.4Zm-1.99-9.32L43.35 0h-9.9l-9.87 9.87 6.86 3.05ZM23.4 44 44 23.4v9.9L33.3 44h-9.9Zm11.31 0L44 34.71V44h-9.29Z'/%3E%3Cpath fill='%23fff' d='M30.17 21.99H22V11.72l-8.17 3.63V22H22v10.42c4.34-1.34 7.55-5.63 8.17-10.43Z'/%3E%3C/svg%3E"}static get properties(){return t(t({},super.properties),{},{getImageSrc:{attribute:!1}})}static get v8n(){return[({description:e})=>!e||e.length<=100||"description:v8n_too_long",({type:e})=>!!e||"type:v8n_required",({score_threshold_reject:e})=>"number"!=typeof e||(e<=100&&e>=0||"score-threshold-reject:v8n_out_of_range"),e=>{var t,r,o,a;const i=null!==(o=null===(r=null===(t=e.helper)||void 0===t?void 0:t.json)||void 0===r?void 0:r.blocks)&&void 0!==o?o:[];let s;try{s=JSON.parse(null!==(a=e.json)&&void 0!==a?a:"{}")}catch(e){s={}}for(const e of i)for(const t of e.fields)if("optional"in t&&!t.optional){const r=[e.parent_id,e.id,t.id].filter((e=>!!e));if(!c(s,r)&&"checkbox"!==t.type)return"json:v8n_invalid"}return!0}]}get scopeCollection(){return"payment_settings"}get hiddenSelector(){return new r(`header:copy-json ${super.hiddenSelector}`.trimEnd())}get headerTitleOptions(){var e;return t(t({},this.data),{},{context:null!==(e=this.form.type)&&void 0!==e?e:"new"})}get headerSubtitleOptions(){return{id:this.headerCopyIdValue}}renderHeader(...e){var t;return l(p||(p=P` <div> ${0} ${0} </div> `),super.renderHeader(...e),(null===(t=this.data)||void 0===t?void 0:t.type)||!this.form.type?l(f||(f=P``)):l(h||(h=P` <vaadin-button data-testid="select-another-button" theme="tertiary-inline" @click="${0}"> <foxy-i18n infer="" key="select_another_button_label"></foxy-i18n> </vaadin-button> `),(()=>this.undo())))}renderBody(){const e=l(u||(u=P` <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),s(this.__availableFraudProtectionsHref),this.__availableFraudProtectionsLoaderId,(()=>this.requestUpdate()));return l(m||(m=P`${0}${0}${0}`),this.renderHeader(),this.form.type?this.__renderFraudProtectionConfig():this.__renderFraudProtectionSelector(),e)}get __availableFraudProtectionsLoader(){return this.renderRoot.querySelector(`#${this.__availableFraudProtectionsLoaderId}`)}get __availableFraudProtectionsHref(){try{const e=o(/\/payment_presets\/(.+)\//,{presetId:1}),t=new URL(this.href||this.parent).pathname,r=e.exec(t).groups.presetId;return new URL(`/payment_presets/${r}/available_fraud_protections`,this.href||this.parent).toString()}catch(e){}}get __availableFraudProtections(){var e,t;return null===(t=null===(e=this.__availableFraudProtectionsLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values}__renderFraudProtectionSelector(){var e;const t=this.__availableFraudProtectionsLoader;return l(v||(v=P` ${0} `),(null==t?void 0:t.data)?l(b||(b=P` <div class="grid grid-cols-2 gap-m" data-testid="select-protection-list"> ${0} </div> `),Object.entries(null!==(e=this.__availableFraudProtections)&&void 0!==e?e:{}).map((([e,t])=>this.__renderFraudProtectionButton({type:e,helper:t})))):l(y||(y=P` <foxy-spinner infer="list-spinner" state="${0}" error-type="${0}"> </foxy-spinner> `),(null==t?void 0:t.in("fail"))?"error":"busy",(null==t?void 0:t.accessDenied)?"access-denied":"generic"))}__renderFraudProtectionButton({type:e,helper:t}){var r,o;const a=I.defaultImageSrc,i=null!==(o=null===(r=this.getImageSrc)||void 0===r?void 0:r.call(this,e))&&void 0!==o?o:a,d=e=>e.currentTarget.src=a;return l(_||(_=P` <button class="${0}" ?disabled="${0}" title="${0}" @click="${0}"> <img class="absolute top-0 left-0 w-1-2 h-full object-cover bg-center filter saturate-200 blur-3xl" style="transform:translate3d(0,0,0)" src="${0}" alt="" ?hidden="${0}" @error="${0}"> <figure class="relative flex flex-col gap-m"> <img class="${0}" src="${0}" alt="" @error="${0}"> <figcaption class="${0}"> <div class="font-medium">${0}&ZeroWidthSpace;</div> <div class="text-xs ${0}">${0}</div> </figcaption> </figure> </button> `),n({"relative w-full block text-left p-s rounded bg-contrast-5 overflow-hidden":!0,"focus-outline-none focus-ring-2 focus-ring-primary-50":!0,"transition-colors hover-bg-contrast-10":!t.conflict,"cursor-default":!!t.conflict}),!!t.conflict,s(t.conflict?this.t("conflict_message"):void 0),(()=>this.edit({type:e,helper:t})),i,!!t.conflict,d,n({"h-m w-m object-cover rounded-full bg-contrast-20 flex-shrink-0 shadow-xs":!0,"filter grayscale":!!t.conflict}),i,d,n({"min-w-0 flex-1 truncate leading-s":!0,"text-disabled":!!t.conflict}),t.name,t.conflict?"":"text-secondary",e)}__renderFraudProtectionConfig(){var e,t,r;return l(j||(j=P` <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="description"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="setup"> ${0} ${0} </foxy-internal-summary-control> ${0} `),(null===(e=this.form.helper)||void 0===e?void 0:e.uses_rejection_threshold)?l(g||(g=P` <foxy-internal-number-control layout="summary-item" infer="score-threshold-reject"> </foxy-internal-number-control> `)):"",null===(r=null===(t=this.form.helper)||void 0===t?void 0:t.json)||void 0===r?void 0:r.blocks.map((e=>this.__renderBlock(e))),super.renderBody())}__renderBlock(e){return l($||($=P`${0}`),e.fields.map((t=>{var r,o,i;const s=()=>{var r,o;let i;try{i=JSON.parse(null!==(r=this.form.json)&&void 0!==r?r:"")}catch(e){i={}}const s=[e.parent_id,e.id,t.id].filter((e=>!!e));return null!==(o=a(i,s))&&void 0!==o?o:i.default_value},n=r=>{var o;let a;try{a=JSON.parse(null!==(o=this.form.json)&&void 0!==o?o:"")}catch(e){a={}}const i=[e.parent_id,e.id,t.id].filter((e=>!!e));this.edit({json:JSON.stringify(d(a,i,r))})},c=t.options,p=["json",...[e.parent_id,e.id,t.id].filter((e=>!!e))].join("-").replace(/_/g,"-");return l(x||(x=P` ${0} `),"checkbox"===t.type?l(L||(L=P` <foxy-internal-switch-control helper-text="${0}" label="${0}" infer="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> `),null!==(r=t.description)&&void 0!==r?r:"",t.name,p,s,n):"select"===t.type?l(w||(w=P` <foxy-internal-select-control helper-text="${0}" placeholder="${0}" layout="summary-item" label="${0}" infer="${0}" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-select-control> `),null!==(o=t.description)&&void 0!==o?o:"",this.t("default_additional_field_placeholder"),t.name,p,c.map((({name:e,value:t})=>({label:e,value:t}))),s,n):l(F||(F=P` <foxy-internal-text-control helper-text="${0}" placeholder="${0}" layout="summary-item" label="${0}" infer="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> `),null!==(i=t.description)&&void 0!==i?i:"",t.default_value||this.t("default_additional_field_placeholder"),t.name,p,s,n))})))}}customElements.define("foxy-payments-api-fraud-protection-form",I);export{I as PaymentsApiFraudProtectionForm};
@@ -1 +1 @@
1
- import"./shared-559b648a.js";import{_ as e}from"./shared-8f9014ff.js";import{C as r}from"./shared-336e73ce.js";import{a as s}from"./shared-5b8c7250.js";import{I as t}from"./shared-20841d9c.js";import{h as a}from"./shared-ba5c42c7.js";import"./foxy-spinner.js";import"./shared-c59277a4.js";import"./shared-c3d6bcc0.js";import"./shared-f410644a.js";import"./shared-cf1965cb.js";import"./shared-c066b7fd.js";import"./shared-930e68b7.js";import"./shared-53e42a77.js";import"./shared-da3393a5.js";import"./shared-50ef1d5a.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-4e709717.js";let i,o=e=>e;const m=r(s(t,"payments-api-payment-method-card"));class d extends m{constructor(){super(...arguments),this.getImageSrc=null}static get defaultImageSrc(){return"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 44 44'%3E%3Cpath fill='%23fff' d='m29.3 14 14-14H32.1l-14 14h11.2Zm2.7 9.9 12-12V.7L30.62 14.1A2 2 0 0 1 32 16v7.9ZM13.31 44h11.18L44 24.5V13.3l-12 12V28a2 2 0 0 1-2 2h-2.69l-14 14Zm-1.41 0H.7l14-14h11.2l-14 14Zm14 0h11.2l6.9-6.9V25.9L25.9 44Zm12.6 0H44v-5.5L38.5 44Z'/%3E%3Cpath fill='%23fff' d='M30 28H14v-6h16v6Zm0-10v-2H14v2h16ZM0 43.3l13.4-13.4A2 2 0 0 1 12 28v-7.9L0 32.12V43.3Z'/%3E%3Cpath fill='%23fff' d='M16.7 14H14c-1.11 0-1.99.89-1.99 2v2.7L0 30.7V19.52L19.52 0H30.7l-14 14Zm1.4-14H6.92L0 6.92V18.1L18.1 0ZM5.5 0H0v5.5L5.5 0Z'/%3E%3C/svg%3E"}static get properties(){return e(e({},super.properties),{},{getImageSrc:{attribute:!1}})}get scopeCollection(){return"payment_settings"}renderBody(){var e,r;const s=d.defaultImageSrc,t=this.data;return a(i||(i=o` <figure class="flex items-center" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <img class="relative h-s w-s object-cover rounded-full bg-contrast-20 flex-shrink-0 shadow-xs" src="${0}" alt="${0}" @error="${0}"> <figcaption class="min-w-0 flex-1" data-testid="title"> ${0}&ZeroWidthSpace; </figcaption> </figure> `),null!==(r=t?null===(e=this.getImageSrc)||void 0===e?void 0:e.call(this,t.type):null)&&void 0!==r?r:s,this.t("image_alt"),(e=>e.currentTarget.src=s),null==t?void 0:t.helper.name)}}customElements.define("foxy-payments-api-payment-method-card",d);export{d as PaymentsApiPaymentMethodCard};
1
+ import"./shared-0996f4d0.js";import{_ as e}from"./shared-8f9014ff.js";import{C as r}from"./shared-222b23bb.js";import{a as s}from"./shared-5b8c7250.js";import{I as t}from"./shared-56278a3c.js";import{h as a}from"./shared-ba5c42c7.js";import"./foxy-spinner.js";import"./shared-c59277a4.js";import"./shared-c3d6bcc0.js";import"./shared-f410644a.js";import"./shared-cf1965cb.js";import"./shared-c066b7fd.js";import"./shared-930e68b7.js";import"./shared-53e42a77.js";import"./shared-87e17c02.js";import"./shared-c85c1864.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-4e709717.js";let i,o=e=>e;const m=r(s(t,"payments-api-payment-method-card"));class d extends m{constructor(){super(...arguments),this.getImageSrc=null}static get defaultImageSrc(){return"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 44 44'%3E%3Cpath fill='%23fff' d='m29.3 14 14-14H32.1l-14 14h11.2Zm2.7 9.9 12-12V.7L30.62 14.1A2 2 0 0 1 32 16v7.9ZM13.31 44h11.18L44 24.5V13.3l-12 12V28a2 2 0 0 1-2 2h-2.69l-14 14Zm-1.41 0H.7l14-14h11.2l-14 14Zm14 0h11.2l6.9-6.9V25.9L25.9 44Zm12.6 0H44v-5.5L38.5 44Z'/%3E%3Cpath fill='%23fff' d='M30 28H14v-6h16v6Zm0-10v-2H14v2h16ZM0 43.3l13.4-13.4A2 2 0 0 1 12 28v-7.9L0 32.12V43.3Z'/%3E%3Cpath fill='%23fff' d='M16.7 14H14c-1.11 0-1.99.89-1.99 2v2.7L0 30.7V19.52L19.52 0H30.7l-14 14Zm1.4-14H6.92L0 6.92V18.1L18.1 0ZM5.5 0H0v5.5L5.5 0Z'/%3E%3C/svg%3E"}static get properties(){return e(e({},super.properties),{},{getImageSrc:{attribute:!1}})}get scopeCollection(){return"payment_settings"}renderBody(){var e,r;const s=d.defaultImageSrc,t=this.data;return a(i||(i=o` <figure class="flex items-center" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <img class="relative h-s w-s object-cover rounded-full bg-contrast-20 flex-shrink-0 shadow-xs" src="${0}" alt="${0}" @error="${0}"> <figcaption class="min-w-0 flex-1" data-testid="title"> ${0}&ZeroWidthSpace; </figcaption> </figure> `),null!==(r=t?null===(e=this.getImageSrc)||void 0===e?void 0:e.call(this,t.type):null)&&void 0!==r?r:s,this.t("image_alt"),(e=>e.currentTarget.src=s),null==t?void 0:t.helper.name)}}customElements.define("foxy-payments-api-payment-method-card",d);export{d as PaymentsApiPaymentMethodCard};
@@ -1 +1 @@
1
- import"./shared-a8ae24f0.js";import"./shared-8ec1b077.js";import"./shared-3eca56ee.js";import"./shared-59dfee2c.js";import"./shared-b84996e5.js";import"./shared-1a814f90.js";import"./shared-7b6a899b.js";import{I as e}from"./shared-be20875c.js";import"./foxy-nucleon-element.js";import"./foxy-spinner.js";import"./shared-c066b7fd.js";import{l as t,_ as i,B as r}from"./shared-8f9014ff.js";import{g as n}from"./shared-bab2ea2c.js";import{a as s}from"./shared-5b8c7250.js";import{c as o}from"./shared-da3393a5.js";import{i as a}from"./shared-53e42a77.js";import{h as l,s as c}from"./shared-ba5c42c7.js";import{c as u}from"./shared-4e709717.js";import{h as d}from"./shared-c7796413.js";import{s as h}from"./shared-791b4510.js";import{a as f}from"./shared-50ef1d5a.js";import"./shared-dc6e5879.js";import"./shared-f410644a.js";import"./shared-f77994ad.js";import"./shared-5dbd66e3.js";import"./shared-28cc8aa1.js";import"./shared-53a5212e.js";import"./shared-c56c3e1e.js";import"./shared-e9f51baa.js";import"./foxy-copy-to-clipboard.js";import"./shared-affe06c0.js";import"./shared-c59277a4.js";import"./shared-c3d6bcc0.js";import"./shared-cfc6735e.js";import"./shared-cf1965cb.js";import"./shared-336e73ce.js";import"./shared-930e68b7.js";import"./shared-45649d84.js";import"./shared-5212ef4f.js";import"./shared-d8b880bb.js";import"./shared-6262e0d6.js";import"./shared-2fbfbe12.js";import"./shared-56741bad.js";import"./shared-d0aed1c1.js";import"./shared-760a2243.js";import"./shared-cb5305b9.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-0e19bda5.js";function p(e){return Array.isArray?Array.isArray(e):"[object Array]"===C(e)}const m=1/0;function _(e){return null==e?"":function(e){if("string"==typeof e)return e;let t=e+"";return"0"==t&&1/e==-m?"-0":t}(e)}function y(e){return"string"==typeof e}function g(e){return"number"==typeof e}function v(e){return!0===e||!1===e||function(e){return x(e)&&null!==e}(e)&&"[object Boolean]"==C(e)}function x(e){return"object"==typeof e}function $(e){return null!=e}function A(e){return!e.trim().length}function C(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const b=e=>`Missing ${e} property in key`,M=e=>`Property 'weight' in key '${e}' must be a positive integer`,k=Object.prototype.hasOwnProperty;class F{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach((e=>{let i=B(e);this._keys.push(i),this._keyMap[i.id]=i,t+=i.weight})),this._keys.forEach((e=>{e.weight/=t}))}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function B(e){let t=null,i=null,r=null,n=1,s=null;if(y(e)||p(e))r=e,t=D(e),i=E(e);else{if(!k.call(e,"name"))throw new Error(b("name"));const o=e.name;if(r=o,k.call(e,"weight")&&(n=e.weight,n<=0))throw new Error(M(o));t=D(o),i=E(o),s=e.getFn}return{path:t,id:i,weight:n,src:r,getFn:s}}function D(e){return p(e)?e:e.split(".")}function E(e){return p(e)?e.join("."):e}var L={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,...{useExtendedSearch:!1,getFn:function(e,t){let i=[],r=!1;const n=(e,t,s)=>{if($(e))if(t[s]){const o=e[t[s]];if(!$(o))return;if(s===t.length-1&&(y(o)||g(o)||v(o)))i.push(_(o));else if(p(o)){r=!0;for(let e=0,i=o.length;e<i;e+=1)n(o[e],t,s+1)}else t.length&&n(o,t,s+1)}else i.push(e)};return n(e,y(t)?t.split("."):t,0),r?i:i[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}};const S=/[^ ]+/g;class w{constructor({getFn:e=L.getFn,fieldNormWeight:t=L.fieldNormWeight}={}){this.norm=function(e=1,t=3){const i=new Map,r=Math.pow(10,t);return{get(t){const n=t.match(S).length;if(i.has(n))return i.get(n);const s=1/Math.pow(n,.5*e),o=parseFloat(Math.round(s*r)/r);return i.set(n,o),o},clear(){i.clear()}}}(t,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach(((e,t)=>{this._keysMap[e.id]=t}))}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,y(this.docs[0])?this.docs.forEach(((e,t)=>{this._addString(e,t)})):this.docs.forEach(((e,t)=>{this._addObject(e,t)})),this.norm.clear())}add(e){const t=this.size();y(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,i=this.size();t<i;t+=1)this.records[t].i-=1}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!$(e)||A(e))return;let i={v:e,i:t,n:this.norm.get(e)};this.records.push(i)}_addObject(e,t){let i={i:t,$:{}};this.keys.forEach(((t,r)=>{let n=t.getFn?t.getFn(e):this.getFn(e,t.path);if($(n))if(p(n)){let e=[];const t=[{nestedArrIndex:-1,value:n}];for(;t.length;){const{nestedArrIndex:i,value:r}=t.pop();if($(r))if(y(r)&&!A(r)){let t={v:r,i:i,n:this.norm.get(r)};e.push(t)}else p(r)&&r.forEach(((e,i)=>{t.push({nestedArrIndex:i,value:e})}))}i.$[r]=e}else if(y(n)&&!A(n)){let e={v:n,n:this.norm.get(n)};i.$[r]=e}})),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}}function j(e,t,{getFn:i=L.getFn,fieldNormWeight:r=L.fieldNormWeight}={}){const n=new w({getFn:i,fieldNormWeight:r});return n.setKeys(e.map(B)),n.setSources(t),n.create(),n}function I(e,{errors:t=0,currentLocation:i=0,expectedLocation:r=0,distance:n=L.distance,ignoreLocation:s=L.ignoreLocation}={}){const o=t/e.length;if(s)return o;const a=Math.abs(r-i);return n?o+a/n:a?1:o}const V=32;function P(e,t,i,{location:r=L.location,distance:n=L.distance,threshold:s=L.threshold,findAllMatches:o=L.findAllMatches,minMatchCharLength:a=L.minMatchCharLength,includeMatches:l=L.includeMatches,ignoreLocation:c=L.ignoreLocation}={}){if(t.length>V)throw new Error(`Pattern length exceeds max of ${V}.`);const u=t.length,d=e.length,h=Math.max(0,Math.min(r,d));let f=s,p=h;const m=a>1||l,_=m?Array(d):[];let y;for(;(y=e.indexOf(t,p))>-1;){let e=I(t,{currentLocation:y,expectedLocation:h,distance:n,ignoreLocation:c});if(f=Math.min(e,f),p=y+u,m){let e=0;for(;e<u;)_[y+e]=1,e+=1}}p=-1;let g=[],v=1,x=u+d;const $=1<<u-1;for(let r=0;r<u;r+=1){let s=0,a=x;for(;s<a;){I(t,{errors:r,currentLocation:h+a,expectedLocation:h,distance:n,ignoreLocation:c})<=f?s=a:x=a,a=Math.floor((x-s)/2+s)}x=a;let l=Math.max(1,h-a+1),y=o?d:Math.min(h+a,d)+u,A=Array(y+2);A[y+1]=(1<<r)-1;for(let s=y;s>=l;s-=1){let o=s-1,a=i[e.charAt(o)];if(m&&(_[o]=+!!a),A[s]=(A[s+1]<<1|1)&a,r&&(A[s]|=(g[s+1]|g[s])<<1|1|g[s+1]),A[s]&$&&(v=I(t,{errors:r,currentLocation:o,expectedLocation:h,distance:n,ignoreLocation:c}),v<=f)){if(f=v,p=o,p<=h)break;l=Math.max(1,2*h-p)}}if(I(t,{errors:r+1,currentLocation:h,expectedLocation:h,distance:n,ignoreLocation:c})>f)break;g=A}const A={isMatch:p>=0,score:Math.max(.001,v)};if(m){const e=function(e=[],t=L.minMatchCharLength){let i=[],r=-1,n=-1,s=0;for(let o=e.length;s<o;s+=1){let o=e[s];o&&-1===r?r=s:o||-1===r||(n=s-1,n-r+1>=t&&i.push([r,n]),r=-1)}return e[s-1]&&s-r>=t&&i.push([r,s-1]),i}(_,a);e.length?l&&(A.indices=e):A.isMatch=!1}return A}function R(e){let t={};for(let i=0,r=e.length;i<r;i+=1){const n=e.charAt(i);t[n]=(t[n]||0)|1<<r-i-1}return t}const O=String.prototype.normalize?e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,""):e=>e;class N{constructor(e,{location:t=L.location,threshold:i=L.threshold,distance:r=L.distance,includeMatches:n=L.includeMatches,findAllMatches:s=L.findAllMatches,minMatchCharLength:o=L.minMatchCharLength,isCaseSensitive:a=L.isCaseSensitive,ignoreDiacritics:l=L.ignoreDiacritics,ignoreLocation:c=L.ignoreLocation}={}){if(this.options={location:t,threshold:i,distance:r,includeMatches:n,findAllMatches:s,minMatchCharLength:o,isCaseSensitive:a,ignoreDiacritics:l,ignoreLocation:c},e=a?e:e.toLowerCase(),e=l?O(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const u=(e,t)=>{this.chunks.push({pattern:e,alphabet:R(e),startIndex:t})},d=this.pattern.length;if(d>V){let e=0;const t=d%V,i=d-t;for(;e<i;)u(this.pattern.substr(e,V),e),e+=V;if(t){const e=d-V;u(this.pattern.substr(e),e)}}else u(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,ignoreDiacritics:i,includeMatches:r}=this.options;if(e=t?e:e.toLowerCase(),e=i?O(e):e,this.pattern===e){let t={isMatch:!0,score:0};return r&&(t.indices=[[0,e.length-1]]),t}const{location:n,distance:s,threshold:o,findAllMatches:a,minMatchCharLength:l,ignoreLocation:c}=this.options;let u=[],d=0,h=!1;this.chunks.forEach((({pattern:t,alphabet:i,startIndex:f})=>{const{isMatch:p,score:m,indices:_}=P(e,t,i,{location:n+f,distance:s,threshold:o,findAllMatches:a,minMatchCharLength:l,includeMatches:r,ignoreLocation:c});p&&(h=!0),d+=m,p&&_&&(u=[...u,..._])}));let f={isMatch:h,score:h?d/this.chunks.length:1};return h&&r&&(f.indices=u),f}}class T{constructor(e){this.pattern=e}static isMultiMatch(e){return W(e,this.multiRegex)}static isSingleMatch(e){return W(e,this.singleRegex)}search(){}}function W(e,t){const i=e.match(t);return i?i[1]:null}class q extends T{constructor(e,{location:t=L.location,threshold:i=L.threshold,distance:r=L.distance,includeMatches:n=L.includeMatches,findAllMatches:s=L.findAllMatches,minMatchCharLength:o=L.minMatchCharLength,isCaseSensitive:a=L.isCaseSensitive,ignoreDiacritics:l=L.ignoreDiacritics,ignoreLocation:c=L.ignoreLocation}={}){super(e),this._bitapSearch=new N(e,{location:t,threshold:i,distance:r,includeMatches:n,findAllMatches:s,minMatchCharLength:o,isCaseSensitive:a,ignoreDiacritics:l,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class z extends T{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t,i=0;const r=[],n=this.pattern.length;for(;(t=e.indexOf(this.pattern,i))>-1;)i=t+n,r.push([t,i-1]);const s=!!r.length;return{isMatch:s,score:s?0:1,indices:r}}}const Z=[class extends T{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},z,class extends T{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},class extends T{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends T{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends T{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}},class extends T{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const t=-1===e.indexOf(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},q],H=Z.length,J=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/;const K=new Set([q.type,z.type]);class U{constructor(e,{isCaseSensitive:t=L.isCaseSensitive,ignoreDiacritics:i=L.ignoreDiacritics,includeMatches:r=L.includeMatches,minMatchCharLength:n=L.minMatchCharLength,ignoreLocation:s=L.ignoreLocation,findAllMatches:o=L.findAllMatches,location:a=L.location,threshold:l=L.threshold,distance:c=L.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:i,includeMatches:r,minMatchCharLength:n,findAllMatches:o,ignoreLocation:s,location:a,threshold:l,distance:c},e=t?e:e.toLowerCase(),e=i?O(e):e,this.pattern=e,this.query=function(e,t={}){return e.split("|").map((e=>{let i=e.trim().split(J).filter((e=>e&&!!e.trim())),r=[];for(let e=0,n=i.length;e<n;e+=1){const n=i[e];let s=!1,o=-1;for(;!s&&++o<H;){const e=Z[o];let i=e.isMultiMatch(n);i&&(r.push(new e(i,t)),s=!0)}if(!s)for(o=-1;++o<H;){const e=Z[o];let i=e.isSingleMatch(n);if(i){r.push(new e(i,t));break}}}return r}))}(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){const t=this.query;if(!t)return{isMatch:!1,score:1};const{includeMatches:i,isCaseSensitive:r,ignoreDiacritics:n}=this.options;e=r?e:e.toLowerCase(),e=n?O(e):e;let s=0,o=[],a=0;for(let r=0,n=t.length;r<n;r+=1){const n=t[r];o.length=0,s=0;for(let t=0,r=n.length;t<r;t+=1){const r=n[t],{isMatch:l,indices:c,score:u}=r.search(e);if(!l){a=0,s=0,o.length=0;break}if(s+=1,a+=u,i){const e=r.constructor.type;K.has(e)?o=[...o,...c]:o.push(c)}}if(s){let e={isMatch:!0,score:a/s};return i&&(e.indices=o),e}}return{isMatch:!1,score:1}}}const G=[];function Q(e,t){for(let i=0,r=G.length;i<r;i+=1){let r=G[i];if(r.condition(e,t))return new r(e,t)}return new N(e,t)}const X="$and",Y="$or",ee="$path",te="$val",ie=e=>!(!e[X]&&!e[Y]),re=e=>({[X]:Object.keys(e).map((t=>({[t]:e[t]})))});function ne(e,t,{auto:i=!0}={}){const r=e=>{let n=Object.keys(e);const s=(e=>!!e[ee])(e);if(!s&&n.length>1&&!ie(e))return r(re(e));if((e=>!p(e)&&x(e)&&!ie(e))(e)){const r=s?e[ee]:n[0],o=s?e[te]:e[r];if(!y(o))throw new Error((e=>`Invalid value for key ${e}`)(r));const a={keyId:E(r),pattern:o};return i&&(a.searcher=Q(o,t)),a}let o={children:[],operator:n[0]};return n.forEach((t=>{const i=e[t];p(i)&&i.forEach((e=>{o.children.push(r(e))}))})),o};return ie(e)||(e=re(e)),r(e)}function se(e,t){const i=e.matches;t.matches=[],$(i)&&i.forEach((e=>{if(!$(e.indices)||!e.indices.length)return;const{indices:i,value:r}=e;let n={indices:i,value:r};e.key&&(n.key=e.key.src),e.idx>-1&&(n.refIndex=e.idx),t.matches.push(n)}))}function oe(e,t){t.score=e.score}class ae{constructor(e,t={},i){this.options={...L,...t},this.options.useExtendedSearch,this._keyStore=new F(this.options.keys),this.setCollection(e,i)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof w))throw new Error("Incorrect 'index' type");this._myIndex=t||j(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){$(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=(()=>!1)){const t=[];for(let i=0,r=this._docs.length;i<r;i+=1){const n=this._docs[i];e(n,i)&&(this.removeAt(i),i-=1,r-=1,t.push(n))}return t}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:t=-1}={}){const{includeMatches:i,includeScore:r,shouldSort:n,sortFn:s,ignoreFieldNorm:o}=this.options;let a=y(e)?y(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return function(e,{ignoreFieldNorm:t=L.ignoreFieldNorm}){e.forEach((e=>{let i=1;e.matches.forEach((({key:e,norm:r,score:n})=>{const s=e?e.weight:null;i*=Math.pow(0===n&&s?Number.EPSILON:n,(s||1)*(t?1:r))})),e.score=i}))}(a,{ignoreFieldNorm:o}),n&&a.sort(s),g(t)&&t>-1&&(a=a.slice(0,t)),function(e,t,{includeMatches:i=L.includeMatches,includeScore:r=L.includeScore}={}){const n=[];return i&&n.push(se),r&&n.push(oe),e.map((e=>{const{idx:i}=e,r={item:t[i],refIndex:i};return n.length&&n.forEach((t=>{t(e,r)})),r}))}(a,this._docs,{includeMatches:i,includeScore:r})}_searchStringList(e){const t=Q(e,this.options),{records:i}=this._myIndex,r=[];return i.forEach((({v:e,i:i,n:n})=>{if(!$(e))return;const{isMatch:s,score:o,indices:a}=t.searchIn(e);s&&r.push({item:e,idx:i,matches:[{score:o,value:e,norm:n,indices:a}]})})),r}_searchLogical(e){const t=ne(e,this.options),i=(e,t,r)=>{if(!e.children){const{keyId:i,searcher:n}=e,s=this._findMatches({key:this._keyStore.get(i),value:this._myIndex.getValueForItemAtKeyId(t,i),searcher:n});return s&&s.length?[{idx:r,item:t,matches:s}]:[]}const n=[];for(let s=0,o=e.children.length;s<o;s+=1){const o=e.children[s],a=i(o,t,r);if(a.length)n.push(...a);else if(e.operator===X)return[]}return n},r=this._myIndex.records,n={},s=[];return r.forEach((({$:e,i:r})=>{if($(e)){let o=i(t,e,r);o.length&&(n[r]||(n[r]={idx:r,item:e,matches:[]},s.push(n[r])),o.forEach((({matches:e})=>{n[r].matches.push(...e)})))}})),s}_searchObjectList(e){const t=Q(e,this.options),{keys:i,records:r}=this._myIndex,n=[];return r.forEach((({$:e,i:r})=>{if(!$(e))return;let s=[];i.forEach(((i,r)=>{s.push(...this._findMatches({key:i,value:e[r],searcher:t}))})),s.length&&n.push({idx:r,item:e,matches:s})})),n}_findMatches({key:e,value:t,searcher:i}){if(!$(t))return[];let r=[];if(p(t))t.forEach((({v:t,i:n,n:s})=>{if(!$(t))return;const{isMatch:o,score:a,indices:l}=i.searchIn(t);o&&r.push({score:a,key:e,value:t,idx:n,norm:s,indices:l})}));else{const{v:n,n:s}=t,{isMatch:o,score:a,indices:l}=i.searchIn(n);o&&r.push({score:a,key:e,value:n,norm:s,indices:l})}return r}}ae.version="7.1.0",ae.createIndex=j,ae.parseIndex=function(e,{getFn:t=L.getFn,fieldNormWeight:i=L.fieldNormWeight}={}){const{keys:r,records:n}=e,s=new w({getFn:t,fieldNormWeight:i});return s.setKeys(r),s.setIndexRecords(n),s},ae.config=L,ae.parseQuery=ne,function(...e){G.push(...e)}(U);let le,ce,ue,de,he,fe,pe,me,_e,ye,ge,ve,xe,$e,Ae,Ce,be,Me,ke,Fe,Be,De,Ee,Le,Se,we,je,Ie,Ve,Pe,Re,Oe,Ne,Te,We,qe,ze,Ze,He,Je,Ke,Ue,Ge=e=>e;const Qe=["paypal_platform"],Xe=s(e,"payments-api-payment-method-form");class Ye extends Xe{constructor(){super(...arguments),this.paymentPreset=null,this.getImageSrc=null,this.getConnectRedirectUrl=null,this.store=null,this.__availablePaymentMethodsLoaderId="availablePaymentMethodsLoader",this.__paymentPresetLoaderId="paymentPresetLoader",this.__storeLoaderId="storeLoader",this.__threeDSecureResponseGetValue=()=>{var e;return null===(e=this.form.config_3d_secure)||void 0===e?void 0:e.endsWith("require_valid_response")},this.__threeDSecureResponseSetValue=e=>{const t=e?"_require_valid_response":"",i=this.form.config_3d_secure,r=(null==i?void 0:i.startsWith("all_cards"))?"all_cards":"maestro_only";this.edit({config_3d_secure:`${r}${t}`})},this.__threeDSecureToggleGetValue=()=>{const e=this.form.config_3d_secure;return(null==e?void 0:e.startsWith("all_cards"))?"all_cards":(null==e?void 0:e.startsWith("maestro_only"))?"maestro_only":"off"},this.__threeDSecureToggleSetValue=e=>{var t;let i="";"all_cards"!==e&&"maestro_only"!==e||(i=(null===(t=this.form.config_3d_secure)||void 0===t?void 0:t.endsWith("require_valid_response"))?`${e}_require_valid_response`:e),this.edit({config_3d_secure:i})},this.__threeDSecureToggleOptions=[{value:"off",label:"option_off"},{value:"all_cards",label:"option_all_cards"},{value:"maestro_only",label:"option_maestro_only"}],this.__cardVerificationOptions=[{label:"option_disabled",value:"disabled"},{label:"option_enabled_automatically",value:"enabled_automatically"},{label:"option_enabled_override",value:"enabled_override"}],this.__defaultTestCredentialsGetValue=()=>{const e=this.__additionalFieldsConfig;return this.__hasDefaultTestCredentials&&this.__defaultTestCredentials.every((([e,t])=>this.form[e]===t))&&this.__defaultTestFields.every((i=>t(e,i.id)===i.default_value))},this.__defaultTestCredentialsSetValue=e=>{const t=this.__additionalFieldsConfig,i={};this.__defaultTestCredentials.forEach((([t,r])=>i[t]=e?r:"")),this.__defaultTestFields.forEach((i=>{e?h(t,i.id,i.default_value):f(t,i.id)})),this.__defaultTestFields.length&&(i.additional_fields=JSON.stringify(t)),this.edit(i)},this.__search="",this.__connectState="idle",this.__connectKey=""}static get defaultImageSrc(){return"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 44 44'%3E%3Cpath fill='%23fff' d='m29.3 14 14-14H32.1l-14 14h11.2Zm2.7 9.9 12-12V.7L30.62 14.1A2 2 0 0 1 32 16v7.9ZM13.31 44h11.18L44 24.5V13.3l-12 12V28a2 2 0 0 1-2 2h-2.69l-14 14Zm-1.41 0H.7l14-14h11.2l-14 14Zm14 0h11.2l6.9-6.9V25.9L25.9 44Zm12.6 0H44v-5.5L38.5 44Z'/%3E%3Cpath fill='%23fff' d='M30 28H14v-6h16v6Zm0-10v-2H14v2h16ZM0 43.3l13.4-13.4A2 2 0 0 1 12 28v-7.9L0 32.12V43.3Z'/%3E%3Cpath fill='%23fff' d='M16.7 14H14c-1.11 0-1.99.89-1.99 2v2.7L0 30.7V19.52L19.52 0H30.7l-14 14Zm1.4-14H6.92L0 6.92V18.1L18.1 0ZM5.5 0H0v5.5L5.5 0Z'/%3E%3C/svg%3E"}static get properties(){return i(i({},super.properties),{},{paymentPreset:{attribute:"payment-preset"},getImageSrc:{attribute:!1},getConnectRedirectUrl:{attribute:!1},store:{},__search:{attribute:!1},__connectState:{attribute:!1},__connectKey:{attribute:!1}})}static get v8n(){return[({description:e})=>!e||e.length<=100||"description:v8n_too_long",({type:e})=>!!e||"type:v8n_required",e=>{var t,i,r,n;const s=null!==(r=null===(i=null===(t=e.helper)||void 0===t?void 0:t.additional_fields)||void 0===i?void 0:i.blocks)&&void 0!==r?r:[];let o;try{o=JSON.parse(null!==(n=e.additional_fields)&&void 0!==n?n:"{}")}catch(e){o={}}for(const e of s)for(const t of e.fields)if("optional"in t&&!t.optional&&!d(o,t.id)&&"checkbox"!==t.type)return"additional-fields:v8n_invalid";return!0}]}get scopeCollection(){return"payment_settings"}get hiddenSelector(){return new r(`header:copy-json ${super.hiddenSelector}`.trimEnd())}renderHeader(...e){var t;return l(le||(le=Ge` <div> ${0} ${0} </div> `),super.renderHeader(...e),(null===(t=this.data)||void 0===t?void 0:t.type)||!this.form.type?l(ce||(ce=Ge``)):l(ue||(ue=Ge` <vaadin-button data-testid="select-another-button" theme="tertiary-inline" @click="${0}"> <foxy-i18n infer="" key="select_another_button_label"></foxy-i18n> </vaadin-button> `),(()=>this.undo())))}get headerTitleOptions(){var e;return{context:this.form.type?"selected":"new",name:null===(e=this.form.helper)||void 0===e?void 0:e.name}}get headerSubtitleOptions(){if(this.href){const e=n(this.href),t=this.headerCopyIdValue;return e.startsWith("R")?{context:"regular",id:t}:{context:"hosted",id:t}}return{}}get headerCopyIdValue(){if(this.href){const e=n(this.href);return e.startsWith("R")?e.slice(1):e.slice(1).split("C")[0]}return""}renderBody(){var e;const t=null===(e=this.__paymentPresetLoader)||void 0===e?void 0:e.data,i=l(de||(de=Ge` <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> `),a(null==t?void 0:t._links["fx:available_payment_methods"].href),this.__availablePaymentMethodsLoaderId,(()=>this.requestUpdate()),a(this.store),this.__storeLoaderId,(()=>this.requestUpdate()),a(this.paymentPreset),this.__paymentPresetLoaderId,(()=>this.requestUpdate()));return l(he||(he=Ge`${0}${0}${0}`),this.renderHeader(),this.form.type?this.__renderPaymentMethodConfig():this.__renderPaymentMethodSelector(),i)}get __groupedAvailablePaymentMethods(){var e;const t=Object.entries(null!==(e=this.__availablePaymentMethods)&&void 0!==e?e:{});return(this.__search?new ae(t,{keys:["1.name"],threshold:.25}).search(this.__search).map((e=>e.item)):t).sort(((e,t)=>e[1].name.localeCompare(t[1].name,"en"))).reduce(((e,[t,i])=>{if(i.is_deprecated)return e;const r=i.name.charAt(0).toUpperCase(),n=!/\w/.test(r)?"#":r,s=e.find((e=>e.name===n)),o=Qe.includes(t)?this.__getConnectChoices(t).map((e=>({type:t,helper:i,choice:e}))):[{type:t,helper:i}];return s?s.items.push(...o):e.push({name:n,items:o}),e}),[])}get __availablePaymentMethodsLoader(){return this.renderRoot.querySelector(`#${this.__availablePaymentMethodsLoaderId}`)}get __availablePaymentMethods(){var e,t;return null===(t=null===(e=this.__availablePaymentMethodsLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values}get __paymentPresetLoader(){return this.renderRoot.querySelector(`#${this.__paymentPresetLoaderId}`)}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}get __liveBlocks(){var e,t,i;return null!==(i=null===(t=null===(e=this.form.helper)||void 0===e?void 0:e.additional_fields)||void 0===t?void 0:t.blocks.filter((e=>e.is_live)))&&void 0!==i?i:[]}get __testBlocks(){var e,t,i;return null!==(i=null===(t=null===(e=this.form.helper)||void 0===e?void 0:e.additional_fields)||void 0===t?void 0:t.blocks.filter((e=>!e.is_live)))&&void 0!==i?i:[]}get __defaultTestCredentials(){const e=this.form.helper;return[["test_account_id",null==e?void 0:e.test_id],["test_account_key",null==e?void 0:e.test_key],["test_third_party_key",null==e?void 0:e.test_third_party_key]].filter((e=>!!e[1]))}get __defaultTestFields(){return this.__testBlocks.flatMap((e=>e.fields)).filter((e=>"hidden"!==e.type&&"string"==typeof e.default_value)).filter((e=>""!==e.default_value))}get __hasDefaultTestCredentials(){return this.__defaultTestCredentials.length>0||this.__defaultTestFields.length>0}get __additionalFieldsConfig(){var e,t;try{return null!==(t=JSON.parse(null!==(e=this.form.additional_fields)&&void 0!==e?e:""))&&void 0!==t?t:{}}catch(e){return{}}}__renderPaymentMethodSelector(){const e=this.__availablePaymentMethodsLoader;return(null==e?void 0:e.data)?l(pe||(pe=Ge` <div> <input placeholder="${0}" class="w-full leading-m font-medium bg-contrast-5 rounded text-body transition-colors hover-bg-contrast-10 focus-bg-contrast-10 focus-outline-none focus-ring-2 focus-ring-primary-50" style="padding:var(--lumo-space-xs) calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" type="search" .value="${0}" @input="${0}"> <section data-testid="select-method-list"> ${0} </section> </div> `),this.t("search_placeholder"),this.__search,(e=>{this.__search=e.currentTarget.value}),this.__groupedAvailablePaymentMethods.map((({name:e,items:t})=>l(me||(me=Ge` <p class="font-medium text-tertiary py-m">${0}</p> <foxy-internal-summary-control infer="" label="" helper-text=""> ${0} </foxy-internal-summary-control> `),e,t.map(((e,i)=>this.__renderPaymentMethodButton(e,i,t.length))))))):l(fe||(fe=Ge` <foxy-spinner infer="list-spinner" state="${0}" error-type="${0}"> </foxy-spinner> `),(null==e?void 0:e.in("fail"))?"error":"busy",(null==e?void 0:e.accessDenied)?"access-denied":"generic")}__redirect(e){window.location.assign(e)}__getConnectChoices(e){return"paypal_platform"===e?[{key:"paypal_platform.ppcp",options:{paypal_product_type:"ppcp"}},{key:"paypal_platform.express_checkout",options:{paypal_product_type:"express_checkout"}}]:[{key:"default"}]}__getReconnectChoice(e){if("paypal_platform"===this.form.type){return{key:`paypal_platform.${e?"reconnect":"reconnect_with_cards"}`,options:{paypal_product_type:"ppcp"}}}return{key:"reconnect"}}async __connect(e,t){var i,r,n,s,o,a,l,c,u,d,h,f;const p=null===(r=null===(i=this.__paymentPresetLoader)||void 0===i?void 0:i.data)||void 0===r?void 0:r._links["fx:connect_gateway"],m=null!==(o=null===(s=null===(n=this.data)||void 0===n?void 0:n._links["fx:connect_gateway"])||void 0===s?void 0:s.href)&&void 0!==o?o:null==p?void 0:p.href;if(m&&this.paymentPreset&&"busy"!==this.__connectState){this.__connectState="busy",this.__connectKey=e.key,this.status=null;try{const i={type:t,final_redirect:null!==(l=null===(a=this.getConnectRedirectUrl)||void 0===a?void 0:a.call(this,this.paymentPreset))&&void 0!==l?l:window.location.href};e.options&&(i.options=e.options);const r=await this._fetch(m,{method:"POST",body:JSON.stringify(i)});if(!r.connection_url)throw new Error("No connection_url in the response.");this.__redirect(r.connection_url)}catch(t){let i="";if(t instanceof Response)try{const e=await t.json();i=null!==(h=null===(d=null===(u=null===(c=null==e?void 0:e._embedded)||void 0===c?void 0:c["fx:errors"])||void 0===u?void 0:u[0])||void 0===d?void 0:d.message)&&void 0!==h?h:""}catch(e){}const r=t instanceof Response&&403===t.status&&"ppcp"===(null===(f=e.options)||void 0===f?void 0:f.paypal_product_type)&&i.includes("'ppcp'");this.status=r?{key:"connect_error_ppcp_unsupported",type:"error"}:i?{key:"connect_error",options:{message:i},type:"error"}:{key:"connect_error_unknown",type:"error"},this.__connectState="idle"}}}__renderConnection(){var e,t,i,r;const n=null===(e=this.__paymentPresetLoader)||void 0===e?void 0:e.data;if(!n)return l(_e||(_e=Ge``));const s=n.is_live?"":"test_",o=null===(t=this.data)||void 0===t?void 0:t[`${s}account_id`],a=null!==(r=null===(i=this.data)||void 0===i?void 0:i[`${s}third_party_key`])&&void 0!==r?r:"",c=this.form.type,u=o?[this.__getReconnectChoice(a)]:this.__getConnectChoices(c),d="busy"===this.__connectState,h=this.readonlySelector.matches("connection",!0),f=d||this.disabledSelector.matches("connection",!0);return l(ye||(ye=Ge` <foxy-internal-summary-control infer="connection"> ${0} ${0} </foxy-internal-summary-control> `),o?l(ge||(ge=Ge` <p class="font-medium"> <foxy-i18n infer="" key="status_connected" .options="${0}"></foxy-i18n> </p> `),{email:o}):"",(h?[]:u).map((e=>l(ve||(ve=Ge` <div class="leading-xs"> <p class="font-medium"> <foxy-i18n infer="" key="${0}.label"></foxy-i18n> </p> <p class="text-s text-secondary"> <foxy-i18n infer="" key="${0}.description"></foxy-i18n> </p> </div> <div> <vaadin-button data-testid="connect-${0}" theme="tertiary-inline" ?disabled="${0}" @click="${0}"> ${0} </vaadin-button> </div> `),e.key,e.key,e.key,f,(()=>this.__connect(e,c)),d&&this.__connectKey===e.key?l(xe||(xe=Ge`<foxy-spinner layout="no-label" infer="connect-spinner"></foxy-spinner>`)):l($e||($e=Ge`<foxy-i18n infer="" key="${0}.button"></foxy-i18n>`),e.key)))))}__renderPaymentMethodConfig(){var e,t;if(this.form.type&&Qe.includes(this.form.type))return l(Ae||(Ae=Ge` <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="description"> </foxy-internal-text-control> </foxy-internal-summary-control> ${0} ${0} `),this.__renderConnection(),super.renderBody());return this.form.type&&["stripe_connect","stripe_v2","square_up","quickbook_payments","amazon_mws","paypal_platform"].includes(this.form.type)?l(Ce||(Ce=Ge` <div class="flex items-start rounded border border-primary" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px);padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <p> <foxy-i18n infer="" key="no_oauth_support_message"></foxy-i18n> <br> <a target="_blank" class="mt-xs inline-block rounded font-medium text-primary transition-colors cursor-pointer hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="https://admin.foxycart.com"> admin.foxycart.com </a> </p> </div> `),c(be||(be=Ge`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-primary" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`))):l(Me||(Me=Ge` <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="description"> </foxy-internal-text-control> ${0} ${0} </foxy-internal-summary-control> ${0} ${0} `),(null===(e=this.form.helper)||void 0===e?void 0:e.supports_auth_only)?l(ke||(ke=Ge` <foxy-internal-switch-control infer="use-auth-only" helper-text-as-tooltip> </foxy-internal-switch-control> `)):"",(null===(t=this.form.helper)||void 0===t?void 0:t.supports_3d_secure)?l(Fe||(Fe=Ge` <foxy-internal-select-control layout="summary-item" infer="three-d-secure-toggle" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-select-control> ${0} `),this.__threeDSecureToggleGetValue,this.__threeDSecureToggleSetValue,this.__threeDSecureToggleOptions,this.form.config_3d_secure?l(Be||(Be=Ge` <foxy-internal-switch-control layout="summary-item" infer="three-d-secure-response" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> `),this.__threeDSecureResponseGetValue,this.__threeDSecureResponseSetValue):""):"",["live","test"].map(((e,t)=>{var i,r,n,s,u,d,h,f,p,m,_,y,g,v,x;const $=o(this.currentUserScope,"stores"),A=0===t?"":`${e}_`,C=0===t?"":`${e}-`,b=0===t?this.__liveBlocks:this.__testBlocks,M=`${e}-group`,k="test"===e&&this.__defaultTestCredentialsGetValue();if("live"===e&&$&&!(null===(i=this.__storeLoader)||void 0===i?void 0:i.data))return l(De||(De=Ge``));if("live"===e&&$&&!(null===(n=null===(r=this.__storeLoader)||void 0===r?void 0:r.data)||void 0===n?void 0:n.is_active))return l(Ee||(Ee=Ge` <foxy-internal-summary-control infer="${0}-group"> <div class="flex items-start" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <p><foxy-i18n infer="" key="inactive_message"></foxy-i18n></p> </div> </foxy-internal-summary-control> `),e,c(Le||(Le=Ge`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-primary" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`)));const F=!0===(null===(u=null===(s=this.__storeLoader)||void 0===s?void 0:s.data)||void 0===u?void 0:u.is_active)&&("test"===e&&!0===(null===(h=null===(d=this.__paymentPresetLoader)||void 0===d?void 0:d.data)||void 0===h?void 0:h.is_live)||"live"===e&&!1===(null===(p=null===(f=this.__paymentPresetLoader)||void 0===f?void 0:f.data)||void 0===p?void 0:p.is_live));return l(Se||(Se=Ge` <foxy-internal-summary-control helper-text="${0}" layout="section" label="${0}" infer="${0}"> <foxy-internal-summary-control infer="" label="" helper-text=""> ${0} ${0} ${0} ${0} ${0} ${0} </foxy-internal-summary-control> ${0} </foxy-internal-summary-control> `),a(F?this.t(`${M}.helper_text_inactive`):void 0),a(F?this.t(`${M}.label_inactive`):void 0),M,"test"===e&&this.__hasDefaultTestCredentials?l(we||(we=Ge` <foxy-internal-switch-control infer="default-credentials" helper-text-as-tooltip .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> `),this.__defaultTestCredentialsGetValue,this.__defaultTestCredentialsSetValue):"",!(null===(m=this.form.helper)||void 0===m?void 0:m.id_description)||k&&this.form.helper.test_id?"":l(je||(je=Ge` <foxy-internal-text-control placeholder="${0}" helper-text="" layout="summary-item" label="${0}" infer="${0}account-id"> </foxy-internal-text-control> `),this.t("default_additional_field_placeholder"),this.form.helper.id_description,C),!(null===(_=this.form.helper)||void 0===_?void 0:_.third_party_key_description)||k&&this.form.helper.test_third_party_key?"":l(Ie||(Ie=Ge` <foxy-internal-password-control placeholder="${0}" helper-text="" layout="summary-item" label="${0}" infer="${0}third-party-key"> </foxy-internal-password-control> `),this.t("default_additional_field_placeholder"),this.form.helper.third_party_key_description,C),!(null===(y=this.form.helper)||void 0===y?void 0:y.key_description)||k&&this.form.helper.test_key?"":l(Ve||(Ve=Ge` <foxy-internal-password-control placeholder="${0}" layout="summary-item" helper-text="" label="${0}" infer="${0}account-key"> </foxy-internal-password-control> `),this.t("default_additional_field_placeholder"),this.form.helper.key_description,C),b.map((e=>this.__renderBlock(e,k?this.__defaultTestFields:[]))),(null===(g=this.form.helper)||void 0===g?void 0:g.supports_card_verification)?l(Pe||(Pe=Ge` <foxy-internal-select-control helper-text="${0}" layout="summary-item" infer="${0}card-verification" .options="${0}" .getValue="${0}"> </foxy-internal-select-control> `),this.t(`${M}.${C}card-verification.helper_text_${this.form[`${A}card_verification`]||"disabled"}`),C,this.__cardVerificationOptions,(()=>this.form[`${A}card_verification`]||"disabled")):"",(null===(v=this.form.helper)||void 0===v?void 0:v.supports_card_verification)&&(null===(x=this.form[`${A}card_verification`])||void 0===x?void 0:x.startsWith("enabled_"))?l(Re||(Re=Ge` <foxy-internal-summary-control layout="details" class="mt-s" infer="${0}card-verification-config"> ${0} </foxy-internal-summary-control> `),C,["visa","mastercard","american-express","discover","default"].map((e=>{var t;return l(Oe||(Oe=Ge` <foxy-internal-number-control json-template="${0}" json-path="verification_amounts.${0}" property="${0}card_verification_config" layout="summary-item" infer="${0}card-verification-config-verification-amounts-${0}" step="0.01" min="0"> </foxy-internal-number-control> `),a(null===(t=this.form.helper)||void 0===t?void 0:t.card_verification_config),e.replace(/-/g,"_"),A,C,e)}))):"")})),super.renderBody())}__renderPaymentMethodButton({type:e,helper:t,choice:i},r,n){var s,o;const c=Ye.defaultImageSrc,d=null!==(o=null===(s=this.getImageSrc)||void 0===s?void 0:s.call(this,e))&&void 0!==o?o:c,h="busy"===this.__connectState,f=h&&!!i&&this.__connectKey===i.key,p=!!i&&"default"!==i.key;return l(Ne||(Ne=Ge` <button class="${0}" data-testid="${0}" ?disabled="${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" @click="${0}"> <figure class="relative flex items-center" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <figcaption class="${0}"> <span class="font-medium"> ${0}&ZeroWidthSpace; </span> ${0} </figcaption> </figure> </button> `),u({"relative w-full block text-left bg-contrast-5 overflow-hidden":!0,"focus-outline-none focus-ring-inset focus-ring-2 focus-ring-primary-50":!0,"transition-colors hover-bg-contrast-10":!t.conflict,"cursor-default":!!t.conflict,"rounded-t":0===r,"rounded-b":r===n-1}),a(i?`connect-${i.key}`:void 0),!!t.conflict||h,(()=>i?this.__connect(i,e):this.edit({type:e,helper:t})),f?l(Te||(Te=Ge` <foxy-spinner data-testid="connect-spinner" class="h-m w-m flex items-center justify-center flex-shrink-0" layout="no-label" infer="connect-spinner"> </foxy-spinner> `)):l(We||(We=Ge` <img class="${0}" src="${0}" alt="" @error="${0}"> `),u({"h-m w-m object-cover rounded-full bg-contrast-20 flex-shrink-0 shadow-xs":!0,"filter grayscale":!!t.conflict}),d,(e=>e.currentTarget.src=c)),u({"min-w-0 flex-1 grid leading-xs":!0,"text-disabled":!!t.conflict}),p?this.t(`connection.${i.key}.label`):t.name,t.conflict?l(qe||(qe=Ge`<span class="text-xs"> ${0}</span>`),this.t("conflict_message",t.conflict)):i?l(ze||(ze=Ge` <span class="text-xs text-secondary"> ${0} ${0} </span> `),p?this.t(`connection.${i.key}.description`):"",this.t("connection.redirect_notice")):"")}__renderBlock(e,i=[]){return l(Ze||(Ze=Ge`${0}`),e.fields.map((r=>{var n,s,o;if("hidden"===r.type||i.includes(r))return;const a=["additional-fields",r.id].join("-").replace(/_/g,"-"),c=()=>{var i,n;try{const e=JSON.parse(null!==(i=this.form.additional_fields)&&void 0!==i?i:"{}");return null!==(n=t(e,r.id))&&void 0!==n?n:e.default_value}catch(t){return e.is_live?r.default_value:void 0}},u=e=>{var t;let i={};try{i=JSON.parse(null!==(t=this.form.additional_fields)&&void 0!==t?t:"")}catch(e){}this.edit({additional_fields:JSON.stringify(h(i,r.id,e))})},d=r.options;return l(He||(He=Ge` ${0} `),"checkbox"===r.type?l(Je||(Je=Ge` <foxy-internal-switch-control helper-text="${0}" label="${0}" infer="${0}" helper-text-as-tooltip .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> `),null!==(n=r.description)&&void 0!==n?n:"",r.name,a,c,u):"select"===r.type?l(Ke||(Ke=Ge` <foxy-internal-select-control placeholder="${0}" helper-text="${0}" layout="summary-item" label="${0}" infer="${0}" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-select-control> `),this.t("default_additional_field_select_placeholder"),null!==(s=r.description)&&void 0!==s?s:"",r.name,a,d.map((({name:e,value:t})=>({label:e,value:t}))),c,u):l(Ue||(Ue=Ge` <foxy-internal-text-control helper-text="${0}" placeholder="${0}" layout="summary-item" label="${0}" infer="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> `),null!==(o=r.description)&&void 0!==o?o:"",this.t("default_additional_field_placeholder"),r.name,a,c,u))})))}}customElements.define("foxy-payments-api-payment-method-form",Ye);export{Ye as PaymentsApiPaymentMethodForm};
1
+ import"./shared-a8ae24f0.js";import"./shared-32a39c0b.js";import"./shared-8be109a9.js";import"./shared-7b15217c.js";import"./shared-a95a66b8.js";import"./shared-7e28c953.js";import"./shared-091e97f3.js";import{I as e}from"./shared-9b290320.js";import"./foxy-nucleon-element.js";import"./foxy-spinner.js";import"./shared-c066b7fd.js";import{l as t,_ as i,B as r}from"./shared-8f9014ff.js";import{g as n}from"./shared-bab2ea2c.js";import{a as s}from"./shared-5b8c7250.js";import{c as o}from"./shared-87e17c02.js";import{i as a}from"./shared-53e42a77.js";import{h as l,s as c}from"./shared-ba5c42c7.js";import{c as u}from"./shared-4e709717.js";import{h as d}from"./shared-c7796413.js";import{s as h}from"./shared-791b4510.js";import{a as f}from"./shared-c85c1864.js";import"./shared-dc6e5879.js";import"./shared-f410644a.js";import"./shared-f77994ad.js";import"./shared-5dbd66e3.js";import"./shared-28cc8aa1.js";import"./shared-53a5212e.js";import"./shared-c56c3e1e.js";import"./shared-e9f51baa.js";import"./foxy-copy-to-clipboard.js";import"./shared-affe06c0.js";import"./shared-c59277a4.js";import"./shared-c3d6bcc0.js";import"./shared-cfc6735e.js";import"./shared-cf1965cb.js";import"./shared-222b23bb.js";import"./shared-930e68b7.js";import"./shared-4ab85bea.js";import"./shared-5212ef4f.js";import"./shared-d8b880bb.js";import"./shared-6262e0d6.js";import"./shared-2fbfbe12.js";import"./shared-56741bad.js";import"./shared-d0aed1c1.js";import"./shared-cda51ccf.js";import"./shared-41f93e6c.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-0e19bda5.js";function p(e){return Array.isArray?Array.isArray(e):"[object Array]"===C(e)}const m=1/0;function _(e){return null==e?"":function(e){if("string"==typeof e)return e;let t=e+"";return"0"==t&&1/e==-m?"-0":t}(e)}function y(e){return"string"==typeof e}function g(e){return"number"==typeof e}function v(e){return!0===e||!1===e||function(e){return x(e)&&null!==e}(e)&&"[object Boolean]"==C(e)}function x(e){return"object"==typeof e}function $(e){return null!=e}function A(e){return!e.trim().length}function C(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const b=e=>`Missing ${e} property in key`,M=e=>`Property 'weight' in key '${e}' must be a positive integer`,k=Object.prototype.hasOwnProperty;class F{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach((e=>{let i=B(e);this._keys.push(i),this._keyMap[i.id]=i,t+=i.weight})),this._keys.forEach((e=>{e.weight/=t}))}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function B(e){let t=null,i=null,r=null,n=1,s=null;if(y(e)||p(e))r=e,t=D(e),i=E(e);else{if(!k.call(e,"name"))throw new Error(b("name"));const o=e.name;if(r=o,k.call(e,"weight")&&(n=e.weight,n<=0))throw new Error(M(o));t=D(o),i=E(o),s=e.getFn}return{path:t,id:i,weight:n,src:r,getFn:s}}function D(e){return p(e)?e:e.split(".")}function E(e){return p(e)?e.join("."):e}var L={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,...{useExtendedSearch:!1,getFn:function(e,t){let i=[],r=!1;const n=(e,t,s)=>{if($(e))if(t[s]){const o=e[t[s]];if(!$(o))return;if(s===t.length-1&&(y(o)||g(o)||v(o)))i.push(_(o));else if(p(o)){r=!0;for(let e=0,i=o.length;e<i;e+=1)n(o[e],t,s+1)}else t.length&&n(o,t,s+1)}else i.push(e)};return n(e,y(t)?t.split("."):t,0),r?i:i[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}};const S=/[^ ]+/g;class w{constructor({getFn:e=L.getFn,fieldNormWeight:t=L.fieldNormWeight}={}){this.norm=function(e=1,t=3){const i=new Map,r=Math.pow(10,t);return{get(t){const n=t.match(S).length;if(i.has(n))return i.get(n);const s=1/Math.pow(n,.5*e),o=parseFloat(Math.round(s*r)/r);return i.set(n,o),o},clear(){i.clear()}}}(t,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach(((e,t)=>{this._keysMap[e.id]=t}))}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,y(this.docs[0])?this.docs.forEach(((e,t)=>{this._addString(e,t)})):this.docs.forEach(((e,t)=>{this._addObject(e,t)})),this.norm.clear())}add(e){const t=this.size();y(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,i=this.size();t<i;t+=1)this.records[t].i-=1}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!$(e)||A(e))return;let i={v:e,i:t,n:this.norm.get(e)};this.records.push(i)}_addObject(e,t){let i={i:t,$:{}};this.keys.forEach(((t,r)=>{let n=t.getFn?t.getFn(e):this.getFn(e,t.path);if($(n))if(p(n)){let e=[];const t=[{nestedArrIndex:-1,value:n}];for(;t.length;){const{nestedArrIndex:i,value:r}=t.pop();if($(r))if(y(r)&&!A(r)){let t={v:r,i:i,n:this.norm.get(r)};e.push(t)}else p(r)&&r.forEach(((e,i)=>{t.push({nestedArrIndex:i,value:e})}))}i.$[r]=e}else if(y(n)&&!A(n)){let e={v:n,n:this.norm.get(n)};i.$[r]=e}})),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}}function j(e,t,{getFn:i=L.getFn,fieldNormWeight:r=L.fieldNormWeight}={}){const n=new w({getFn:i,fieldNormWeight:r});return n.setKeys(e.map(B)),n.setSources(t),n.create(),n}function I(e,{errors:t=0,currentLocation:i=0,expectedLocation:r=0,distance:n=L.distance,ignoreLocation:s=L.ignoreLocation}={}){const o=t/e.length;if(s)return o;const a=Math.abs(r-i);return n?o+a/n:a?1:o}const V=32;function P(e,t,i,{location:r=L.location,distance:n=L.distance,threshold:s=L.threshold,findAllMatches:o=L.findAllMatches,minMatchCharLength:a=L.minMatchCharLength,includeMatches:l=L.includeMatches,ignoreLocation:c=L.ignoreLocation}={}){if(t.length>V)throw new Error(`Pattern length exceeds max of ${V}.`);const u=t.length,d=e.length,h=Math.max(0,Math.min(r,d));let f=s,p=h;const m=a>1||l,_=m?Array(d):[];let y;for(;(y=e.indexOf(t,p))>-1;){let e=I(t,{currentLocation:y,expectedLocation:h,distance:n,ignoreLocation:c});if(f=Math.min(e,f),p=y+u,m){let e=0;for(;e<u;)_[y+e]=1,e+=1}}p=-1;let g=[],v=1,x=u+d;const $=1<<u-1;for(let r=0;r<u;r+=1){let s=0,a=x;for(;s<a;){I(t,{errors:r,currentLocation:h+a,expectedLocation:h,distance:n,ignoreLocation:c})<=f?s=a:x=a,a=Math.floor((x-s)/2+s)}x=a;let l=Math.max(1,h-a+1),y=o?d:Math.min(h+a,d)+u,A=Array(y+2);A[y+1]=(1<<r)-1;for(let s=y;s>=l;s-=1){let o=s-1,a=i[e.charAt(o)];if(m&&(_[o]=+!!a),A[s]=(A[s+1]<<1|1)&a,r&&(A[s]|=(g[s+1]|g[s])<<1|1|g[s+1]),A[s]&$&&(v=I(t,{errors:r,currentLocation:o,expectedLocation:h,distance:n,ignoreLocation:c}),v<=f)){if(f=v,p=o,p<=h)break;l=Math.max(1,2*h-p)}}if(I(t,{errors:r+1,currentLocation:h,expectedLocation:h,distance:n,ignoreLocation:c})>f)break;g=A}const A={isMatch:p>=0,score:Math.max(.001,v)};if(m){const e=function(e=[],t=L.minMatchCharLength){let i=[],r=-1,n=-1,s=0;for(let o=e.length;s<o;s+=1){let o=e[s];o&&-1===r?r=s:o||-1===r||(n=s-1,n-r+1>=t&&i.push([r,n]),r=-1)}return e[s-1]&&s-r>=t&&i.push([r,s-1]),i}(_,a);e.length?l&&(A.indices=e):A.isMatch=!1}return A}function R(e){let t={};for(let i=0,r=e.length;i<r;i+=1){const n=e.charAt(i);t[n]=(t[n]||0)|1<<r-i-1}return t}const O=String.prototype.normalize?e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,""):e=>e;class N{constructor(e,{location:t=L.location,threshold:i=L.threshold,distance:r=L.distance,includeMatches:n=L.includeMatches,findAllMatches:s=L.findAllMatches,minMatchCharLength:o=L.minMatchCharLength,isCaseSensitive:a=L.isCaseSensitive,ignoreDiacritics:l=L.ignoreDiacritics,ignoreLocation:c=L.ignoreLocation}={}){if(this.options={location:t,threshold:i,distance:r,includeMatches:n,findAllMatches:s,minMatchCharLength:o,isCaseSensitive:a,ignoreDiacritics:l,ignoreLocation:c},e=a?e:e.toLowerCase(),e=l?O(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const u=(e,t)=>{this.chunks.push({pattern:e,alphabet:R(e),startIndex:t})},d=this.pattern.length;if(d>V){let e=0;const t=d%V,i=d-t;for(;e<i;)u(this.pattern.substr(e,V),e),e+=V;if(t){const e=d-V;u(this.pattern.substr(e),e)}}else u(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,ignoreDiacritics:i,includeMatches:r}=this.options;if(e=t?e:e.toLowerCase(),e=i?O(e):e,this.pattern===e){let t={isMatch:!0,score:0};return r&&(t.indices=[[0,e.length-1]]),t}const{location:n,distance:s,threshold:o,findAllMatches:a,minMatchCharLength:l,ignoreLocation:c}=this.options;let u=[],d=0,h=!1;this.chunks.forEach((({pattern:t,alphabet:i,startIndex:f})=>{const{isMatch:p,score:m,indices:_}=P(e,t,i,{location:n+f,distance:s,threshold:o,findAllMatches:a,minMatchCharLength:l,includeMatches:r,ignoreLocation:c});p&&(h=!0),d+=m,p&&_&&(u=[...u,..._])}));let f={isMatch:h,score:h?d/this.chunks.length:1};return h&&r&&(f.indices=u),f}}class T{constructor(e){this.pattern=e}static isMultiMatch(e){return W(e,this.multiRegex)}static isSingleMatch(e){return W(e,this.singleRegex)}search(){}}function W(e,t){const i=e.match(t);return i?i[1]:null}class q extends T{constructor(e,{location:t=L.location,threshold:i=L.threshold,distance:r=L.distance,includeMatches:n=L.includeMatches,findAllMatches:s=L.findAllMatches,minMatchCharLength:o=L.minMatchCharLength,isCaseSensitive:a=L.isCaseSensitive,ignoreDiacritics:l=L.ignoreDiacritics,ignoreLocation:c=L.ignoreLocation}={}){super(e),this._bitapSearch=new N(e,{location:t,threshold:i,distance:r,includeMatches:n,findAllMatches:s,minMatchCharLength:o,isCaseSensitive:a,ignoreDiacritics:l,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class z extends T{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t,i=0;const r=[],n=this.pattern.length;for(;(t=e.indexOf(this.pattern,i))>-1;)i=t+n,r.push([t,i-1]);const s=!!r.length;return{isMatch:s,score:s?0:1,indices:r}}}const Z=[class extends T{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},z,class extends T{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},class extends T{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends T{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends T{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}},class extends T{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const t=-1===e.indexOf(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},q],H=Z.length,J=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/;const K=new Set([q.type,z.type]);class U{constructor(e,{isCaseSensitive:t=L.isCaseSensitive,ignoreDiacritics:i=L.ignoreDiacritics,includeMatches:r=L.includeMatches,minMatchCharLength:n=L.minMatchCharLength,ignoreLocation:s=L.ignoreLocation,findAllMatches:o=L.findAllMatches,location:a=L.location,threshold:l=L.threshold,distance:c=L.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:i,includeMatches:r,minMatchCharLength:n,findAllMatches:o,ignoreLocation:s,location:a,threshold:l,distance:c},e=t?e:e.toLowerCase(),e=i?O(e):e,this.pattern=e,this.query=function(e,t={}){return e.split("|").map((e=>{let i=e.trim().split(J).filter((e=>e&&!!e.trim())),r=[];for(let e=0,n=i.length;e<n;e+=1){const n=i[e];let s=!1,o=-1;for(;!s&&++o<H;){const e=Z[o];let i=e.isMultiMatch(n);i&&(r.push(new e(i,t)),s=!0)}if(!s)for(o=-1;++o<H;){const e=Z[o];let i=e.isSingleMatch(n);if(i){r.push(new e(i,t));break}}}return r}))}(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){const t=this.query;if(!t)return{isMatch:!1,score:1};const{includeMatches:i,isCaseSensitive:r,ignoreDiacritics:n}=this.options;e=r?e:e.toLowerCase(),e=n?O(e):e;let s=0,o=[],a=0;for(let r=0,n=t.length;r<n;r+=1){const n=t[r];o.length=0,s=0;for(let t=0,r=n.length;t<r;t+=1){const r=n[t],{isMatch:l,indices:c,score:u}=r.search(e);if(!l){a=0,s=0,o.length=0;break}if(s+=1,a+=u,i){const e=r.constructor.type;K.has(e)?o=[...o,...c]:o.push(c)}}if(s){let e={isMatch:!0,score:a/s};return i&&(e.indices=o),e}}return{isMatch:!1,score:1}}}const G=[];function Q(e,t){for(let i=0,r=G.length;i<r;i+=1){let r=G[i];if(r.condition(e,t))return new r(e,t)}return new N(e,t)}const X="$and",Y="$or",ee="$path",te="$val",ie=e=>!(!e[X]&&!e[Y]),re=e=>({[X]:Object.keys(e).map((t=>({[t]:e[t]})))});function ne(e,t,{auto:i=!0}={}){const r=e=>{let n=Object.keys(e);const s=(e=>!!e[ee])(e);if(!s&&n.length>1&&!ie(e))return r(re(e));if((e=>!p(e)&&x(e)&&!ie(e))(e)){const r=s?e[ee]:n[0],o=s?e[te]:e[r];if(!y(o))throw new Error((e=>`Invalid value for key ${e}`)(r));const a={keyId:E(r),pattern:o};return i&&(a.searcher=Q(o,t)),a}let o={children:[],operator:n[0]};return n.forEach((t=>{const i=e[t];p(i)&&i.forEach((e=>{o.children.push(r(e))}))})),o};return ie(e)||(e=re(e)),r(e)}function se(e,t){const i=e.matches;t.matches=[],$(i)&&i.forEach((e=>{if(!$(e.indices)||!e.indices.length)return;const{indices:i,value:r}=e;let n={indices:i,value:r};e.key&&(n.key=e.key.src),e.idx>-1&&(n.refIndex=e.idx),t.matches.push(n)}))}function oe(e,t){t.score=e.score}class ae{constructor(e,t={},i){this.options={...L,...t},this.options.useExtendedSearch,this._keyStore=new F(this.options.keys),this.setCollection(e,i)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof w))throw new Error("Incorrect 'index' type");this._myIndex=t||j(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){$(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=(()=>!1)){const t=[];for(let i=0,r=this._docs.length;i<r;i+=1){const n=this._docs[i];e(n,i)&&(this.removeAt(i),i-=1,r-=1,t.push(n))}return t}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:t=-1}={}){const{includeMatches:i,includeScore:r,shouldSort:n,sortFn:s,ignoreFieldNorm:o}=this.options;let a=y(e)?y(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return function(e,{ignoreFieldNorm:t=L.ignoreFieldNorm}){e.forEach((e=>{let i=1;e.matches.forEach((({key:e,norm:r,score:n})=>{const s=e?e.weight:null;i*=Math.pow(0===n&&s?Number.EPSILON:n,(s||1)*(t?1:r))})),e.score=i}))}(a,{ignoreFieldNorm:o}),n&&a.sort(s),g(t)&&t>-1&&(a=a.slice(0,t)),function(e,t,{includeMatches:i=L.includeMatches,includeScore:r=L.includeScore}={}){const n=[];return i&&n.push(se),r&&n.push(oe),e.map((e=>{const{idx:i}=e,r={item:t[i],refIndex:i};return n.length&&n.forEach((t=>{t(e,r)})),r}))}(a,this._docs,{includeMatches:i,includeScore:r})}_searchStringList(e){const t=Q(e,this.options),{records:i}=this._myIndex,r=[];return i.forEach((({v:e,i:i,n:n})=>{if(!$(e))return;const{isMatch:s,score:o,indices:a}=t.searchIn(e);s&&r.push({item:e,idx:i,matches:[{score:o,value:e,norm:n,indices:a}]})})),r}_searchLogical(e){const t=ne(e,this.options),i=(e,t,r)=>{if(!e.children){const{keyId:i,searcher:n}=e,s=this._findMatches({key:this._keyStore.get(i),value:this._myIndex.getValueForItemAtKeyId(t,i),searcher:n});return s&&s.length?[{idx:r,item:t,matches:s}]:[]}const n=[];for(let s=0,o=e.children.length;s<o;s+=1){const o=e.children[s],a=i(o,t,r);if(a.length)n.push(...a);else if(e.operator===X)return[]}return n},r=this._myIndex.records,n={},s=[];return r.forEach((({$:e,i:r})=>{if($(e)){let o=i(t,e,r);o.length&&(n[r]||(n[r]={idx:r,item:e,matches:[]},s.push(n[r])),o.forEach((({matches:e})=>{n[r].matches.push(...e)})))}})),s}_searchObjectList(e){const t=Q(e,this.options),{keys:i,records:r}=this._myIndex,n=[];return r.forEach((({$:e,i:r})=>{if(!$(e))return;let s=[];i.forEach(((i,r)=>{s.push(...this._findMatches({key:i,value:e[r],searcher:t}))})),s.length&&n.push({idx:r,item:e,matches:s})})),n}_findMatches({key:e,value:t,searcher:i}){if(!$(t))return[];let r=[];if(p(t))t.forEach((({v:t,i:n,n:s})=>{if(!$(t))return;const{isMatch:o,score:a,indices:l}=i.searchIn(t);o&&r.push({score:a,key:e,value:t,idx:n,norm:s,indices:l})}));else{const{v:n,n:s}=t,{isMatch:o,score:a,indices:l}=i.searchIn(n);o&&r.push({score:a,key:e,value:n,norm:s,indices:l})}return r}}ae.version="7.1.0",ae.createIndex=j,ae.parseIndex=function(e,{getFn:t=L.getFn,fieldNormWeight:i=L.fieldNormWeight}={}){const{keys:r,records:n}=e,s=new w({getFn:t,fieldNormWeight:i});return s.setKeys(r),s.setIndexRecords(n),s},ae.config=L,ae.parseQuery=ne,function(...e){G.push(...e)}(U);let le,ce,ue,de,he,fe,pe,me,_e,ye,ge,ve,xe,$e,Ae,Ce,be,Me,ke,Fe,Be,De,Ee,Le,Se,we,je,Ie,Ve,Pe,Re,Oe,Ne,Te,We,qe,ze,Ze,He,Je,Ke,Ue,Ge=e=>e;const Qe=["paypal_platform"],Xe=s(e,"payments-api-payment-method-form");class Ye extends Xe{constructor(){super(...arguments),this.paymentPreset=null,this.getImageSrc=null,this.getConnectRedirectUrl=null,this.store=null,this.__availablePaymentMethodsLoaderId="availablePaymentMethodsLoader",this.__paymentPresetLoaderId="paymentPresetLoader",this.__storeLoaderId="storeLoader",this.__threeDSecureResponseGetValue=()=>{var e;return null===(e=this.form.config_3d_secure)||void 0===e?void 0:e.endsWith("require_valid_response")},this.__threeDSecureResponseSetValue=e=>{const t=e?"_require_valid_response":"",i=this.form.config_3d_secure,r=(null==i?void 0:i.startsWith("all_cards"))?"all_cards":"maestro_only";this.edit({config_3d_secure:`${r}${t}`})},this.__threeDSecureToggleGetValue=()=>{const e=this.form.config_3d_secure;return(null==e?void 0:e.startsWith("all_cards"))?"all_cards":(null==e?void 0:e.startsWith("maestro_only"))?"maestro_only":"off"},this.__threeDSecureToggleSetValue=e=>{var t;let i="";"all_cards"!==e&&"maestro_only"!==e||(i=(null===(t=this.form.config_3d_secure)||void 0===t?void 0:t.endsWith("require_valid_response"))?`${e}_require_valid_response`:e),this.edit({config_3d_secure:i})},this.__threeDSecureToggleOptions=[{value:"off",label:"option_off"},{value:"all_cards",label:"option_all_cards"},{value:"maestro_only",label:"option_maestro_only"}],this.__cardVerificationOptions=[{label:"option_disabled",value:"disabled"},{label:"option_enabled_automatically",value:"enabled_automatically"},{label:"option_enabled_override",value:"enabled_override"}],this.__defaultTestCredentialsGetValue=()=>{const e=this.__additionalFieldsConfig;return this.__hasDefaultTestCredentials&&this.__defaultTestCredentials.every((([e,t])=>this.form[e]===t))&&this.__defaultTestFields.every((i=>t(e,i.id)===i.default_value))},this.__defaultTestCredentialsSetValue=e=>{const t=this.__additionalFieldsConfig,i={};this.__defaultTestCredentials.forEach((([t,r])=>i[t]=e?r:"")),this.__defaultTestFields.forEach((i=>{e?h(t,i.id,i.default_value):f(t,i.id)})),this.__defaultTestFields.length&&(i.additional_fields=JSON.stringify(t)),this.edit(i)},this.__search="",this.__connectState="idle",this.__connectKey=""}static get defaultImageSrc(){return"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 44 44'%3E%3Cpath fill='%23fff' d='m29.3 14 14-14H32.1l-14 14h11.2Zm2.7 9.9 12-12V.7L30.62 14.1A2 2 0 0 1 32 16v7.9ZM13.31 44h11.18L44 24.5V13.3l-12 12V28a2 2 0 0 1-2 2h-2.69l-14 14Zm-1.41 0H.7l14-14h11.2l-14 14Zm14 0h11.2l6.9-6.9V25.9L25.9 44Zm12.6 0H44v-5.5L38.5 44Z'/%3E%3Cpath fill='%23fff' d='M30 28H14v-6h16v6Zm0-10v-2H14v2h16ZM0 43.3l13.4-13.4A2 2 0 0 1 12 28v-7.9L0 32.12V43.3Z'/%3E%3Cpath fill='%23fff' d='M16.7 14H14c-1.11 0-1.99.89-1.99 2v2.7L0 30.7V19.52L19.52 0H30.7l-14 14Zm1.4-14H6.92L0 6.92V18.1L18.1 0ZM5.5 0H0v5.5L5.5 0Z'/%3E%3C/svg%3E"}static get properties(){return i(i({},super.properties),{},{paymentPreset:{attribute:"payment-preset"},getImageSrc:{attribute:!1},getConnectRedirectUrl:{attribute:!1},store:{},__search:{attribute:!1},__connectState:{attribute:!1},__connectKey:{attribute:!1}})}static get v8n(){return[({description:e})=>!e||e.length<=100||"description:v8n_too_long",({type:e})=>!!e||"type:v8n_required",e=>{var t,i,r,n;const s=null!==(r=null===(i=null===(t=e.helper)||void 0===t?void 0:t.additional_fields)||void 0===i?void 0:i.blocks)&&void 0!==r?r:[];let o;try{o=JSON.parse(null!==(n=e.additional_fields)&&void 0!==n?n:"{}")}catch(e){o={}}for(const e of s)for(const t of e.fields)if("optional"in t&&!t.optional&&!d(o,t.id)&&"checkbox"!==t.type)return"additional-fields:v8n_invalid";return!0}]}get scopeCollection(){return"payment_settings"}get hiddenSelector(){return new r(`header:copy-json ${super.hiddenSelector}`.trimEnd())}renderHeader(...e){var t;return l(le||(le=Ge` <div> ${0} ${0} </div> `),super.renderHeader(...e),(null===(t=this.data)||void 0===t?void 0:t.type)||!this.form.type?l(ce||(ce=Ge``)):l(ue||(ue=Ge` <vaadin-button data-testid="select-another-button" theme="tertiary-inline" @click="${0}"> <foxy-i18n infer="" key="select_another_button_label"></foxy-i18n> </vaadin-button> `),(()=>this.undo())))}get headerTitleOptions(){var e;return{context:this.form.type?"selected":"new",name:null===(e=this.form.helper)||void 0===e?void 0:e.name}}get headerSubtitleOptions(){if(this.href){const e=n(this.href),t=this.headerCopyIdValue;return e.startsWith("R")?{context:"regular",id:t}:{context:"hosted",id:t}}return{}}get headerCopyIdValue(){if(this.href){const e=n(this.href);return e.startsWith("R")?e.slice(1):e.slice(1).split("C")[0]}return""}renderBody(){var e;const t=null===(e=this.__paymentPresetLoader)||void 0===e?void 0:e.data,i=l(de||(de=Ge` <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> `),a(null==t?void 0:t._links["fx:available_payment_methods"].href),this.__availablePaymentMethodsLoaderId,(()=>this.requestUpdate()),a(this.store),this.__storeLoaderId,(()=>this.requestUpdate()),a(this.paymentPreset),this.__paymentPresetLoaderId,(()=>this.requestUpdate()));return l(he||(he=Ge`${0}${0}${0}`),this.renderHeader(),this.form.type?this.__renderPaymentMethodConfig():this.__renderPaymentMethodSelector(),i)}get __groupedAvailablePaymentMethods(){var e;const t=Object.entries(null!==(e=this.__availablePaymentMethods)&&void 0!==e?e:{});return(this.__search?new ae(t,{keys:["1.name"],threshold:.25}).search(this.__search).map((e=>e.item)):t).sort(((e,t)=>e[1].name.localeCompare(t[1].name,"en"))).reduce(((e,[t,i])=>{if(i.is_deprecated)return e;const r=i.name.charAt(0).toUpperCase(),n=!/\w/.test(r)?"#":r,s=e.find((e=>e.name===n)),o=Qe.includes(t)?this.__getConnectChoices(t).map((e=>({type:t,helper:i,choice:e}))):[{type:t,helper:i}];return s?s.items.push(...o):e.push({name:n,items:o}),e}),[])}get __availablePaymentMethodsLoader(){return this.renderRoot.querySelector(`#${this.__availablePaymentMethodsLoaderId}`)}get __availablePaymentMethods(){var e,t;return null===(t=null===(e=this.__availablePaymentMethodsLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values}get __paymentPresetLoader(){return this.renderRoot.querySelector(`#${this.__paymentPresetLoaderId}`)}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}get __liveBlocks(){var e,t,i;return null!==(i=null===(t=null===(e=this.form.helper)||void 0===e?void 0:e.additional_fields)||void 0===t?void 0:t.blocks.filter((e=>e.is_live)))&&void 0!==i?i:[]}get __testBlocks(){var e,t,i;return null!==(i=null===(t=null===(e=this.form.helper)||void 0===e?void 0:e.additional_fields)||void 0===t?void 0:t.blocks.filter((e=>!e.is_live)))&&void 0!==i?i:[]}get __defaultTestCredentials(){const e=this.form.helper;return[["test_account_id",null==e?void 0:e.test_id],["test_account_key",null==e?void 0:e.test_key],["test_third_party_key",null==e?void 0:e.test_third_party_key]].filter((e=>!!e[1]))}get __defaultTestFields(){return this.__testBlocks.flatMap((e=>e.fields)).filter((e=>"hidden"!==e.type&&"string"==typeof e.default_value)).filter((e=>""!==e.default_value))}get __hasDefaultTestCredentials(){return this.__defaultTestCredentials.length>0||this.__defaultTestFields.length>0}get __additionalFieldsConfig(){var e,t;try{return null!==(t=JSON.parse(null!==(e=this.form.additional_fields)&&void 0!==e?e:""))&&void 0!==t?t:{}}catch(e){return{}}}__renderPaymentMethodSelector(){const e=this.__availablePaymentMethodsLoader;return(null==e?void 0:e.data)?l(pe||(pe=Ge` <div> <input placeholder="${0}" class="w-full leading-m font-medium bg-contrast-5 rounded text-body transition-colors hover-bg-contrast-10 focus-bg-contrast-10 focus-outline-none focus-ring-2 focus-ring-primary-50" style="padding:var(--lumo-space-xs) calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" type="search" .value="${0}" @input="${0}"> <section data-testid="select-method-list"> ${0} </section> </div> `),this.t("search_placeholder"),this.__search,(e=>{this.__search=e.currentTarget.value}),this.__groupedAvailablePaymentMethods.map((({name:e,items:t})=>l(me||(me=Ge` <p class="font-medium text-tertiary py-m">${0}</p> <foxy-internal-summary-control infer="" label="" helper-text=""> ${0} </foxy-internal-summary-control> `),e,t.map(((e,i)=>this.__renderPaymentMethodButton(e,i,t.length))))))):l(fe||(fe=Ge` <foxy-spinner infer="list-spinner" state="${0}" error-type="${0}"> </foxy-spinner> `),(null==e?void 0:e.in("fail"))?"error":"busy",(null==e?void 0:e.accessDenied)?"access-denied":"generic")}__redirect(e){window.location.assign(e)}__getConnectChoices(e){return"paypal_platform"===e?[{key:"paypal_platform.ppcp",options:{paypal_product_type:"ppcp"}},{key:"paypal_platform.express_checkout",options:{paypal_product_type:"express_checkout"}}]:[{key:"default"}]}__getReconnectChoice(e){if("paypal_platform"===this.form.type){return{key:`paypal_platform.${e?"reconnect":"reconnect_with_cards"}`,options:{paypal_product_type:"ppcp"}}}return{key:"reconnect"}}async __connect(e,t){var i,r,n,s,o,a,l,c,u,d,h,f;const p=null===(r=null===(i=this.__paymentPresetLoader)||void 0===i?void 0:i.data)||void 0===r?void 0:r._links["fx:connect_gateway"],m=null!==(o=null===(s=null===(n=this.data)||void 0===n?void 0:n._links["fx:connect_gateway"])||void 0===s?void 0:s.href)&&void 0!==o?o:null==p?void 0:p.href;if(m&&this.paymentPreset&&"busy"!==this.__connectState){this.__connectState="busy",this.__connectKey=e.key,this.status=null;try{const i={type:t,final_redirect:null!==(l=null===(a=this.getConnectRedirectUrl)||void 0===a?void 0:a.call(this,this.paymentPreset))&&void 0!==l?l:window.location.href};e.options&&(i.options=e.options);const r=await this._fetch(m,{method:"POST",body:JSON.stringify(i)});if(!r.connection_url)throw new Error("No connection_url in the response.");this.__redirect(r.connection_url)}catch(t){let i="";if(t instanceof Response)try{const e=await t.json();i=null!==(h=null===(d=null===(u=null===(c=null==e?void 0:e._embedded)||void 0===c?void 0:c["fx:errors"])||void 0===u?void 0:u[0])||void 0===d?void 0:d.message)&&void 0!==h?h:""}catch(e){}const r=t instanceof Response&&403===t.status&&"ppcp"===(null===(f=e.options)||void 0===f?void 0:f.paypal_product_type)&&i.includes("'ppcp'");this.status=r?{key:"connect_error_ppcp_unsupported",type:"error"}:i?{key:"connect_error",options:{message:i},type:"error"}:{key:"connect_error_unknown",type:"error"},this.__connectState="idle"}}}__renderConnection(){var e,t,i,r;const n=null===(e=this.__paymentPresetLoader)||void 0===e?void 0:e.data;if(!n)return l(_e||(_e=Ge``));const s=n.is_live?"":"test_",o=null===(t=this.data)||void 0===t?void 0:t[`${s}account_id`],a=null!==(r=null===(i=this.data)||void 0===i?void 0:i[`${s}third_party_key`])&&void 0!==r?r:"",c=this.form.type,u=o?[this.__getReconnectChoice(a)]:this.__getConnectChoices(c),d="busy"===this.__connectState,h=this.readonlySelector.matches("connection",!0),f=d||this.disabledSelector.matches("connection",!0);return l(ye||(ye=Ge` <foxy-internal-summary-control infer="connection"> ${0} ${0} </foxy-internal-summary-control> `),o?l(ge||(ge=Ge` <p class="font-medium"> <foxy-i18n infer="" key="status_connected" .options="${0}"></foxy-i18n> </p> `),{email:o}):"",(h?[]:u).map((e=>l(ve||(ve=Ge` <div class="leading-xs"> <p class="font-medium"> <foxy-i18n infer="" key="${0}.label"></foxy-i18n> </p> <p class="text-s text-secondary"> <foxy-i18n infer="" key="${0}.description"></foxy-i18n> </p> </div> <div> <vaadin-button data-testid="connect-${0}" theme="tertiary-inline" ?disabled="${0}" @click="${0}"> ${0} </vaadin-button> </div> `),e.key,e.key,e.key,f,(()=>this.__connect(e,c)),d&&this.__connectKey===e.key?l(xe||(xe=Ge`<foxy-spinner layout="no-label" infer="connect-spinner"></foxy-spinner>`)):l($e||($e=Ge`<foxy-i18n infer="" key="${0}.button"></foxy-i18n>`),e.key)))))}__renderPaymentMethodConfig(){var e,t;if(this.form.type&&Qe.includes(this.form.type))return l(Ae||(Ae=Ge` <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="description"> </foxy-internal-text-control> </foxy-internal-summary-control> ${0} ${0} `),this.__renderConnection(),super.renderBody());return this.form.type&&["stripe_connect","stripe_v2","square_up","quickbook_payments","amazon_mws","paypal_platform"].includes(this.form.type)?l(Ce||(Ce=Ge` <div class="flex items-start rounded border border-primary" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px);padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <p> <foxy-i18n infer="" key="no_oauth_support_message"></foxy-i18n> <br> <a target="_blank" class="mt-xs inline-block rounded font-medium text-primary transition-colors cursor-pointer hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="https://admin.foxycart.com"> admin.foxycart.com </a> </p> </div> `),c(be||(be=Ge`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-primary" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`))):l(Me||(Me=Ge` <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="description"> </foxy-internal-text-control> ${0} ${0} </foxy-internal-summary-control> ${0} ${0} `),(null===(e=this.form.helper)||void 0===e?void 0:e.supports_auth_only)?l(ke||(ke=Ge` <foxy-internal-switch-control infer="use-auth-only" helper-text-as-tooltip> </foxy-internal-switch-control> `)):"",(null===(t=this.form.helper)||void 0===t?void 0:t.supports_3d_secure)?l(Fe||(Fe=Ge` <foxy-internal-select-control layout="summary-item" infer="three-d-secure-toggle" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-select-control> ${0} `),this.__threeDSecureToggleGetValue,this.__threeDSecureToggleSetValue,this.__threeDSecureToggleOptions,this.form.config_3d_secure?l(Be||(Be=Ge` <foxy-internal-switch-control layout="summary-item" infer="three-d-secure-response" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> `),this.__threeDSecureResponseGetValue,this.__threeDSecureResponseSetValue):""):"",["live","test"].map(((e,t)=>{var i,r,n,s,u,d,h,f,p,m,_,y,g,v,x;const $=o(this.currentUserScope,"stores"),A=0===t?"":`${e}_`,C=0===t?"":`${e}-`,b=0===t?this.__liveBlocks:this.__testBlocks,M=`${e}-group`,k="test"===e&&this.__defaultTestCredentialsGetValue();if("live"===e&&$&&!(null===(i=this.__storeLoader)||void 0===i?void 0:i.data))return l(De||(De=Ge``));if("live"===e&&$&&!(null===(n=null===(r=this.__storeLoader)||void 0===r?void 0:r.data)||void 0===n?void 0:n.is_active))return l(Ee||(Ee=Ge` <foxy-internal-summary-control infer="${0}-group"> <div class="flex items-start" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <p><foxy-i18n infer="" key="inactive_message"></foxy-i18n></p> </div> </foxy-internal-summary-control> `),e,c(Le||(Le=Ge`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-primary" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`)));const F=!0===(null===(u=null===(s=this.__storeLoader)||void 0===s?void 0:s.data)||void 0===u?void 0:u.is_active)&&("test"===e&&!0===(null===(h=null===(d=this.__paymentPresetLoader)||void 0===d?void 0:d.data)||void 0===h?void 0:h.is_live)||"live"===e&&!1===(null===(p=null===(f=this.__paymentPresetLoader)||void 0===f?void 0:f.data)||void 0===p?void 0:p.is_live));return l(Se||(Se=Ge` <foxy-internal-summary-control helper-text="${0}" layout="section" label="${0}" infer="${0}"> <foxy-internal-summary-control infer="" label="" helper-text=""> ${0} ${0} ${0} ${0} ${0} ${0} </foxy-internal-summary-control> ${0} </foxy-internal-summary-control> `),a(F?this.t(`${M}.helper_text_inactive`):void 0),a(F?this.t(`${M}.label_inactive`):void 0),M,"test"===e&&this.__hasDefaultTestCredentials?l(we||(we=Ge` <foxy-internal-switch-control infer="default-credentials" helper-text-as-tooltip .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> `),this.__defaultTestCredentialsGetValue,this.__defaultTestCredentialsSetValue):"",!(null===(m=this.form.helper)||void 0===m?void 0:m.id_description)||k&&this.form.helper.test_id?"":l(je||(je=Ge` <foxy-internal-text-control placeholder="${0}" helper-text="" layout="summary-item" label="${0}" infer="${0}account-id"> </foxy-internal-text-control> `),this.t("default_additional_field_placeholder"),this.form.helper.id_description,C),!(null===(_=this.form.helper)||void 0===_?void 0:_.third_party_key_description)||k&&this.form.helper.test_third_party_key?"":l(Ie||(Ie=Ge` <foxy-internal-password-control placeholder="${0}" helper-text="" layout="summary-item" label="${0}" infer="${0}third-party-key"> </foxy-internal-password-control> `),this.t("default_additional_field_placeholder"),this.form.helper.third_party_key_description,C),!(null===(y=this.form.helper)||void 0===y?void 0:y.key_description)||k&&this.form.helper.test_key?"":l(Ve||(Ve=Ge` <foxy-internal-password-control placeholder="${0}" layout="summary-item" helper-text="" label="${0}" infer="${0}account-key"> </foxy-internal-password-control> `),this.t("default_additional_field_placeholder"),this.form.helper.key_description,C),b.map((e=>this.__renderBlock(e,k?this.__defaultTestFields:[]))),(null===(g=this.form.helper)||void 0===g?void 0:g.supports_card_verification)?l(Pe||(Pe=Ge` <foxy-internal-select-control helper-text="${0}" layout="summary-item" infer="${0}card-verification" .options="${0}" .getValue="${0}"> </foxy-internal-select-control> `),this.t(`${M}.${C}card-verification.helper_text_${this.form[`${A}card_verification`]||"disabled"}`),C,this.__cardVerificationOptions,(()=>this.form[`${A}card_verification`]||"disabled")):"",(null===(v=this.form.helper)||void 0===v?void 0:v.supports_card_verification)&&(null===(x=this.form[`${A}card_verification`])||void 0===x?void 0:x.startsWith("enabled_"))?l(Re||(Re=Ge` <foxy-internal-summary-control layout="details" class="mt-s" infer="${0}card-verification-config"> ${0} </foxy-internal-summary-control> `),C,["visa","mastercard","american-express","discover","default"].map((e=>{var t;return l(Oe||(Oe=Ge` <foxy-internal-number-control json-template="${0}" json-path="verification_amounts.${0}" property="${0}card_verification_config" layout="summary-item" infer="${0}card-verification-config-verification-amounts-${0}" step="0.01" min="0"> </foxy-internal-number-control> `),a(null===(t=this.form.helper)||void 0===t?void 0:t.card_verification_config),e.replace(/-/g,"_"),A,C,e)}))):"")})),super.renderBody())}__renderPaymentMethodButton({type:e,helper:t,choice:i},r,n){var s,o;const c=Ye.defaultImageSrc,d=null!==(o=null===(s=this.getImageSrc)||void 0===s?void 0:s.call(this,e))&&void 0!==o?o:c,h="busy"===this.__connectState,f=h&&!!i&&this.__connectKey===i.key,p=!!i&&"default"!==i.key;return l(Ne||(Ne=Ge` <button class="${0}" data-testid="${0}" ?disabled="${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" @click="${0}"> <figure class="relative flex items-center" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <figcaption class="${0}"> <span class="font-medium"> ${0}&ZeroWidthSpace; </span> ${0} </figcaption> </figure> </button> `),u({"relative w-full block text-left bg-contrast-5 overflow-hidden":!0,"focus-outline-none focus-ring-inset focus-ring-2 focus-ring-primary-50":!0,"transition-colors hover-bg-contrast-10":!t.conflict,"cursor-default":!!t.conflict,"rounded-t":0===r,"rounded-b":r===n-1}),a(i?`connect-${i.key}`:void 0),!!t.conflict||h,(()=>i?this.__connect(i,e):this.edit({type:e,helper:t})),f?l(Te||(Te=Ge` <foxy-spinner data-testid="connect-spinner" class="h-m w-m flex items-center justify-center flex-shrink-0" layout="no-label" infer="connect-spinner"> </foxy-spinner> `)):l(We||(We=Ge` <img class="${0}" src="${0}" alt="" @error="${0}"> `),u({"h-m w-m object-cover rounded-full bg-contrast-20 flex-shrink-0 shadow-xs":!0,"filter grayscale":!!t.conflict}),d,(e=>e.currentTarget.src=c)),u({"min-w-0 flex-1 grid leading-xs":!0,"text-disabled":!!t.conflict}),p?this.t(`connection.${i.key}.label`):t.name,t.conflict?l(qe||(qe=Ge`<span class="text-xs"> ${0}</span>`),this.t("conflict_message",t.conflict)):i?l(ze||(ze=Ge` <span class="text-xs text-secondary"> ${0} ${0} </span> `),p?this.t(`connection.${i.key}.description`):"",this.t("connection.redirect_notice")):"")}__renderBlock(e,i=[]){return l(Ze||(Ze=Ge`${0}`),e.fields.map((r=>{var n,s,o;if("hidden"===r.type||i.includes(r))return;const a=["additional-fields",r.id].join("-").replace(/_/g,"-"),c=()=>{var i,n;try{const e=JSON.parse(null!==(i=this.form.additional_fields)&&void 0!==i?i:"{}");return null!==(n=t(e,r.id))&&void 0!==n?n:e.default_value}catch(t){return e.is_live?r.default_value:void 0}},u=e=>{var t;let i={};try{i=JSON.parse(null!==(t=this.form.additional_fields)&&void 0!==t?t:"")}catch(e){}this.edit({additional_fields:JSON.stringify(h(i,r.id,e))})},d=r.options;return l(He||(He=Ge` ${0} `),"checkbox"===r.type?l(Je||(Je=Ge` <foxy-internal-switch-control helper-text="${0}" label="${0}" infer="${0}" helper-text-as-tooltip .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> `),null!==(n=r.description)&&void 0!==n?n:"",r.name,a,c,u):"select"===r.type?l(Ke||(Ke=Ge` <foxy-internal-select-control placeholder="${0}" helper-text="${0}" layout="summary-item" label="${0}" infer="${0}" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-select-control> `),this.t("default_additional_field_select_placeholder"),null!==(s=r.description)&&void 0!==s?s:"",r.name,a,d.map((({name:e,value:t})=>({label:e,value:t}))),c,u):l(Ue||(Ue=Ge` <foxy-internal-text-control helper-text="${0}" placeholder="${0}" layout="summary-item" label="${0}" infer="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> `),null!==(o=r.description)&&void 0!==o?o:"",this.t("default_additional_field_placeholder"),r.name,a,c,u))})))}}customElements.define("foxy-payments-api-payment-method-form",Ye);export{Ye as PaymentsApiPaymentMethodForm};
@@ -1 +1 @@
1
- import"./shared-5212ef4f.js";import"./foxy-spinner.js";import"./shared-c066b7fd.js";import{a as s}from"./shared-5b8c7250.js";import{T as e}from"./shared-14713ead.js";import{c as r}from"./shared-4e709717.js";import{h as t}from"./shared-ba5c42c7.js";import"./shared-c59277a4.js";import"./shared-c3d6bcc0.js";import"./shared-f410644a.js";import"./shared-cf1965cb.js";import"./shared-8f9014ff.js";import"./shared-930e68b7.js";import"./shared-336e73ce.js";import"./shared-53e42a77.js";import"./shared-da3393a5.js";import"./shared-20841d9c.js";import"./shared-50ef1d5a.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";let a,d,o=s=>s;const i=s(e,"payments-api-payment-preset-card");class p extends i{get scopeCollection(){return"payment_settings"}renderBody(){return super.renderBody({title:s=>t(a||(a=o`${0}`),s.description),subtitle:({is_live:s})=>t(d||(d=o` <foxy-i18n class="${0}" infer="" key="status_${0}"> </foxy-i18n> `),r({"text-success":s}),s?"live":"test")})}}customElements.define("foxy-payments-api-payment-preset-card",p);export{p as PaymentsApiPaymentPresetCard};
1
+ import"./shared-5212ef4f.js";import"./foxy-spinner.js";import"./shared-c066b7fd.js";import{a as s}from"./shared-5b8c7250.js";import{T as e}from"./shared-18707481.js";import{c as r}from"./shared-4e709717.js";import{h as t}from"./shared-ba5c42c7.js";import"./shared-c59277a4.js";import"./shared-c3d6bcc0.js";import"./shared-f410644a.js";import"./shared-cf1965cb.js";import"./shared-8f9014ff.js";import"./shared-930e68b7.js";import"./shared-222b23bb.js";import"./shared-53e42a77.js";import"./shared-87e17c02.js";import"./shared-56278a3c.js";import"./shared-c85c1864.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";let a,o,i=s=>s;const p=s(e,"payments-api-payment-preset-card");class d extends p{get scopeCollection(){return"payment_settings"}renderBody(){return super.renderBody({title:s=>t(a||(a=i`${0}`),s.description),subtitle:({is_live:s})=>t(o||(o=i` <foxy-i18n class="${0}" infer="" key="status_${0}"> </foxy-i18n> `),r({"text-success":s}),s?"live":"test")})}}customElements.define("foxy-payments-api-payment-preset-card",d);export{d as PaymentsApiPaymentPresetCard};
@@ -1 +1 @@
1
- import"./shared-bc74cd11.js";import"./shared-3eca56ee.js";import"./shared-59dfee2c.js";import"./shared-7b6a899b.js";import{I as e}from"./shared-be20875c.js";import"./foxy-payments-api-fraud-protection-card.js";import"./foxy-payments-api-fraud-protection-form.js";import"./foxy-payments-api-payment-method-card.js";import"./foxy-payments-api-payment-method-form.js";import{_ as t,B as r}from"./shared-8f9014ff.js";import{a as s}from"./shared-5b8c7250.js";import{c as o}from"./shared-da3393a5.js";import{i}from"./shared-53e42a77.js";import{h as a}from"./shared-ba5c42c7.js";import"./shared-dc6e5879.js";import"./shared-f410644a.js";import"./shared-c3d6bcc0.js";import"./shared-f77994ad.js";import"./shared-91483320.js";import"./shared-a8ae24f0.js";import"./shared-d8b880bb.js";import"./shared-6262e0d6.js";import"./shared-28cc8aa1.js";import"./shared-2fbfbe12.js";import"./shared-e9f51baa.js";import"./shared-53a5212e.js";import"./shared-c56c3e1e.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-c59277a4.js";import"./shared-cf1965cb.js";import"./shared-c066b7fd.js";import"./shared-930e68b7.js";import"./shared-336e73ce.js";import"./shared-50ef1d5a.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-760a2243.js";import"./shared-cb5305b9.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-1a814f90.js";import"./shared-56741bad.js";import"./shared-45649d84.js";import"./shared-5212ef4f.js";import"./shared-b84996e5.js";import"./shared-affe06c0.js";import"./shared-cfc6735e.js";import"./shared-d0aed1c1.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";import"./shared-14713ead.js";import"./shared-20841d9c.js";import"./foxy-nucleon-element.js";import"./shared-c7796413.js";import"./shared-559b648a.js";import"./shared-8ec1b077.js";import"./shared-5dbd66e3.js";let n,d=e=>e;const p=s(e,"payments-api-payment-preset-form");class m extends p{constructor(){super(...arguments),this.getConnectRedirectUrl=null,this.getFraudProtectionImageSrc=null,this.getPaymentMethodImageSrc=null,this.__isPurchaseOrderEnabledGetValue=()=>!!this.__isStoreActive&&this.form.is_purchase_order_enabled,this.__isLiveGetValue=()=>!!this.__isStoreActive&&this.form.is_live,this.__storeLoaderId="storeLoader"}static get properties(){return t(t({},super.properties),{},{getConnectRedirectUrl:{attribute:!1},getFraudProtectionImageSrc:{attribute:!1},getPaymentMethodImageSrc:{attribute:!1}})}static get v8n(){return[({description:e})=>!!e||"description:v8n_required",({description:e})=>e&&e.length<=100||"description:v8n_too_long"]}get scopeCollection(){return"payment_settings"}get readonlySelector(){const e=[super.readonlySelector.toString()];return this.__isStoreActive||e.unshift("general:is-live","general:is-purchase-order-enabled"),new r(e.join(" ").trim())}get hiddenSelector(){const e=["header:copy-json",super.hiddenSelector.toString()],t=this.__isStoreActive;return this.data||e.unshift("payment-methods","fraud-protections"),t||e.unshift("general:is-live","general:is-purchase-order-enabled"),new r(e.join(" ").trim())}renderBody(){var e,t,r,s;const o=this.__isStoreActive?"":"_inactive_store";return a(n||(n=d` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="description"> </foxy-internal-text-control> <foxy-internal-switch-control helper-text="${0}" infer="is-live" helper-text-as-tooltip .getValue="${0}"> </foxy-internal-switch-control> <foxy-internal-switch-control helper-text="${0}" infer="is-purchase-order-enabled" helper-text-as-tooltip .getValue="${0}"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-async-list-control infer="payment-methods" first="${0}" limit="5" item="foxy-payments-api-payment-method-card" form="foxy-payments-api-payment-method-form" alert wide .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="fraud-protections" first="${0}" limit="5" item="foxy-payments-api-fraud-protection-card" form="foxy-payments-api-fraud-protection-form" alert .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> ${0} <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),this.t(`general.is-live.helper_text${o}`),this.__isLiveGetValue,this.t(`general.is-purchase-order-enabled.helper_text${o}`),this.__isPurchaseOrderEnabledGetValue,i(null===(e=this.data)||void 0===e?void 0:e._links["fx:payment_methods"].href),{".getImageSrc":this.getPaymentMethodImageSrc},{".getConnectRedirectUrl":this.getConnectRedirectUrl,".getImageSrc":this.getPaymentMethodImageSrc,"payment-preset":this.href,store:null===(t=this.data)||void 0===t?void 0:t._links["fx:store"].href},i(null===(r=this.data)||void 0===r?void 0:r._links["fx:fraud_protections"].href),{".getImageSrc":this.getFraudProtectionImageSrc},{".getImageSrc":this.getFraudProtectionImageSrc},super.renderBody(),i(null===(s=this.data)||void 0===s?void 0:s._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()))}get __isStoreActive(){var e,t;return!o(this.currentUserScope,"stores")||!!(null===(t=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.is_active)}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-payments-api-payment-preset-form",m);export{m as PaymentsApiPaymentPresetForm};
1
+ import"./shared-3a61d8a6.js";import"./shared-8be109a9.js";import"./shared-7b15217c.js";import"./shared-091e97f3.js";import{I as e}from"./shared-9b290320.js";import"./foxy-payments-api-fraud-protection-card.js";import"./foxy-payments-api-fraud-protection-form.js";import"./foxy-payments-api-payment-method-card.js";import"./foxy-payments-api-payment-method-form.js";import{_ as t,B as r}from"./shared-8f9014ff.js";import{a as s}from"./shared-5b8c7250.js";import{c as o}from"./shared-87e17c02.js";import{i}from"./shared-53e42a77.js";import{h as a}from"./shared-ba5c42c7.js";import"./shared-dc6e5879.js";import"./shared-f410644a.js";import"./shared-c3d6bcc0.js";import"./shared-f77994ad.js";import"./shared-91483320.js";import"./shared-a8ae24f0.js";import"./shared-d8b880bb.js";import"./shared-6262e0d6.js";import"./shared-28cc8aa1.js";import"./shared-2fbfbe12.js";import"./shared-e9f51baa.js";import"./shared-53a5212e.js";import"./shared-c56c3e1e.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-c59277a4.js";import"./shared-cf1965cb.js";import"./shared-c066b7fd.js";import"./shared-930e68b7.js";import"./shared-222b23bb.js";import"./shared-c85c1864.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-cda51ccf.js";import"./shared-41f93e6c.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-7e28c953.js";import"./shared-56741bad.js";import"./shared-4ab85bea.js";import"./shared-5212ef4f.js";import"./shared-a95a66b8.js";import"./shared-affe06c0.js";import"./shared-cfc6735e.js";import"./shared-d0aed1c1.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";import"./shared-18707481.js";import"./shared-56278a3c.js";import"./foxy-nucleon-element.js";import"./shared-c7796413.js";import"./shared-0996f4d0.js";import"./shared-32a39c0b.js";import"./shared-5dbd66e3.js";let n,d=e=>e;const p=s(e,"payments-api-payment-preset-form");class m extends p{constructor(){super(...arguments),this.getConnectRedirectUrl=null,this.getFraudProtectionImageSrc=null,this.getPaymentMethodImageSrc=null,this.__isPurchaseOrderEnabledGetValue=()=>!!this.__isStoreActive&&this.form.is_purchase_order_enabled,this.__isLiveGetValue=()=>!!this.__isStoreActive&&this.form.is_live,this.__storeLoaderId="storeLoader"}static get properties(){return t(t({},super.properties),{},{getConnectRedirectUrl:{attribute:!1},getFraudProtectionImageSrc:{attribute:!1},getPaymentMethodImageSrc:{attribute:!1}})}static get v8n(){return[({description:e})=>!!e||"description:v8n_required",({description:e})=>e&&e.length<=100||"description:v8n_too_long"]}get scopeCollection(){return"payment_settings"}get readonlySelector(){const e=[super.readonlySelector.toString()];return this.__isStoreActive||e.unshift("general:is-live","general:is-purchase-order-enabled"),new r(e.join(" ").trim())}get hiddenSelector(){const e=["header:copy-json",super.hiddenSelector.toString()],t=this.__isStoreActive;return this.data||e.unshift("payment-methods","fraud-protections"),t||e.unshift("general:is-live","general:is-purchase-order-enabled"),new r(e.join(" ").trim())}renderBody(){var e,t,r,s;const o=this.__isStoreActive?"":"_inactive_store";return a(n||(n=d` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="description"> </foxy-internal-text-control> <foxy-internal-switch-control helper-text="${0}" infer="is-live" helper-text-as-tooltip .getValue="${0}"> </foxy-internal-switch-control> <foxy-internal-switch-control helper-text="${0}" infer="is-purchase-order-enabled" helper-text-as-tooltip .getValue="${0}"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-async-list-control infer="payment-methods" first="${0}" limit="5" item="foxy-payments-api-payment-method-card" form="foxy-payments-api-payment-method-form" alert wide .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="fraud-protections" first="${0}" limit="5" item="foxy-payments-api-fraud-protection-card" form="foxy-payments-api-fraud-protection-form" alert .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> ${0} <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),this.t(`general.is-live.helper_text${o}`),this.__isLiveGetValue,this.t(`general.is-purchase-order-enabled.helper_text${o}`),this.__isPurchaseOrderEnabledGetValue,i(null===(e=this.data)||void 0===e?void 0:e._links["fx:payment_methods"].href),{".getImageSrc":this.getPaymentMethodImageSrc},{".getConnectRedirectUrl":this.getConnectRedirectUrl,".getImageSrc":this.getPaymentMethodImageSrc,"payment-preset":this.href,store:null===(t=this.data)||void 0===t?void 0:t._links["fx:store"].href},i(null===(r=this.data)||void 0===r?void 0:r._links["fx:fraud_protections"].href),{".getImageSrc":this.getFraudProtectionImageSrc},{".getImageSrc":this.getFraudProtectionImageSrc},super.renderBody(),i(null===(s=this.data)||void 0===s?void 0:s._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()))}get __isStoreActive(){var e,t;return!o(this.currentUserScope,"stores")||!!(null===(t=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.is_active)}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-payments-api-payment-preset-form",m);export{m as PaymentsApiPaymentPresetForm};