@foxy.io/elements 1.26.0-beta.1 → 1.26.0-beta.2

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 (177) hide show
  1. package/dist/cdn/foxy-access-recovery-form.js +1 -1
  2. package/dist/cdn/foxy-address-card.js +1 -1
  3. package/dist/cdn/foxy-address-form.js +1 -1
  4. package/dist/cdn/foxy-admin-subscription-card.js +1 -1
  5. package/dist/cdn/foxy-api-browser.js +1 -1
  6. package/dist/cdn/foxy-applied-coupon-code-card.js +1 -1
  7. package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
  8. package/dist/cdn/foxy-applied-tax-card.js +1 -1
  9. package/dist/cdn/foxy-attribute-card.js +1 -1
  10. package/dist/cdn/foxy-attribute-form.js +1 -1
  11. package/dist/cdn/foxy-billing-address-card.js +1 -1
  12. package/dist/cdn/foxy-cancellation-form.js +1 -1
  13. package/dist/cdn/foxy-cart-card.js +1 -1
  14. package/dist/cdn/foxy-cart-form.js +1 -1
  15. package/dist/cdn/foxy-client-card.js +1 -1
  16. package/dist/cdn/foxy-client-form.js +1 -1
  17. package/dist/cdn/foxy-collection-page.js +1 -1
  18. package/dist/cdn/foxy-collection-pages.js +1 -1
  19. package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
  20. package/dist/cdn/foxy-coupon-card.js +1 -1
  21. package/dist/cdn/foxy-coupon-code-form.js +1 -1
  22. package/dist/cdn/foxy-coupon-codes-form.js +1 -1
  23. package/dist/cdn/foxy-coupon-detail-card.js +1 -1
  24. package/dist/cdn/foxy-coupon-form.js +1 -1
  25. package/dist/cdn/foxy-custom-field-card.js +1 -1
  26. package/dist/cdn/foxy-custom-field-form.js +1 -1
  27. package/dist/cdn/foxy-customer-card.js +1 -1
  28. package/dist/cdn/foxy-customer-form.js +1 -1
  29. package/dist/cdn/foxy-customer-portal-settings.js +1 -1
  30. package/dist/cdn/foxy-customer-portal.js +1 -1
  31. package/dist/cdn/foxy-customer.js +3 -3
  32. package/dist/cdn/foxy-customers-table.js +1 -1
  33. package/dist/cdn/foxy-discount-builder.js +1 -1
  34. package/dist/cdn/foxy-discount-card.js +1 -1
  35. package/dist/cdn/foxy-discount-detail-card.js +1 -1
  36. package/dist/cdn/foxy-donation.js +1 -1
  37. package/dist/cdn/foxy-downloadable-card.js +1 -1
  38. package/dist/cdn/foxy-downloadable-form.js +1 -1
  39. package/dist/cdn/foxy-email-template-card.js +1 -1
  40. package/dist/cdn/foxy-email-template-form.js +1 -1
  41. package/dist/cdn/foxy-error-entry-card.js +1 -1
  42. package/dist/cdn/foxy-filter-attribute-card.js +1 -1
  43. package/dist/cdn/foxy-filter-attribute-form.js +1 -1
  44. package/dist/cdn/foxy-form-dialog.js +1 -1
  45. package/dist/cdn/foxy-generate-codes-form.js +1 -1
  46. package/dist/cdn/foxy-gift-card-card.js +1 -1
  47. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  48. package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
  49. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  50. package/dist/cdn/foxy-gift-card-form.js +1 -1
  51. package/dist/cdn/foxy-i18n-editor.js +2 -2
  52. package/dist/cdn/foxy-i18n.js +1 -1
  53. package/dist/cdn/foxy-integration-card.js +1 -1
  54. package/dist/cdn/foxy-integration-form.js +1 -1
  55. package/dist/cdn/foxy-item-card.js +1 -1
  56. package/dist/cdn/foxy-item-category-card.js +1 -1
  57. package/dist/cdn/foxy-item-category-form.js +1 -1
  58. package/dist/cdn/foxy-item-form.js +3 -3
  59. package/dist/cdn/foxy-item-option-card.js +1 -1
  60. package/dist/cdn/foxy-item-option-form.js +1 -1
  61. package/dist/cdn/foxy-items-form.js +1 -1
  62. package/dist/cdn/foxy-native-integration-card.js +1 -1
  63. package/dist/cdn/foxy-native-integration-form.js +1 -1
  64. package/dist/cdn/foxy-pagination.js +1 -1
  65. package/dist/cdn/foxy-passkey-card.js +1 -1
  66. package/dist/cdn/foxy-passkey-form.js +1 -1
  67. package/dist/cdn/foxy-payment-card.js +1 -1
  68. package/dist/cdn/foxy-payment-method-card.js +1 -1
  69. package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
  70. package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
  71. package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
  72. package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
  73. package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
  74. package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
  75. package/dist/cdn/foxy-query-builder.js +1 -1
  76. package/dist/cdn/foxy-report-form.js +1 -1
  77. package/dist/cdn/foxy-reports-table.js +1 -1
  78. package/dist/cdn/foxy-shipment-card.js +1 -1
  79. package/dist/cdn/foxy-shipping-method-card.js +1 -1
  80. package/dist/cdn/foxy-sign-in-form.js +1 -1
  81. package/dist/cdn/foxy-spinner.js +2 -2
  82. package/dist/cdn/foxy-store-card.js +1 -1
  83. package/dist/cdn/foxy-store-form.js +1 -1
  84. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  85. package/dist/cdn/foxy-subscription-card.js +1 -1
  86. package/dist/cdn/foxy-subscription-form.js +1 -1
  87. package/dist/cdn/foxy-subscription-settings-form.js +1 -1
  88. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  89. package/dist/cdn/foxy-table.js +1 -1
  90. package/dist/cdn/foxy-tax-card.js +1 -1
  91. package/dist/cdn/foxy-tax-form.js +1 -1
  92. package/dist/cdn/foxy-template-config-form.js +1 -1
  93. package/dist/cdn/foxy-template-form.js +1 -1
  94. package/dist/cdn/foxy-template-set-card.js +1 -1
  95. package/dist/cdn/foxy-template-set-form.js +1 -1
  96. package/dist/cdn/foxy-transaction-card.js +1 -95
  97. package/dist/cdn/foxy-transaction.js +1 -1
  98. package/dist/cdn/foxy-transactions-table.js +4 -4
  99. package/dist/cdn/foxy-user-card.js +1 -1
  100. package/dist/cdn/foxy-user-form.js +1 -1
  101. package/dist/cdn/foxy-users-table.js +1 -1
  102. package/dist/cdn/foxy-webhook-card.js +1 -1
  103. package/dist/cdn/foxy-webhook-form.js +1 -1
  104. package/dist/cdn/foxy-webhook-log-card.js +1 -1
  105. package/dist/cdn/foxy-webhook-status-card.js +1 -1
  106. package/dist/cdn/shared-027a9660.js +1 -0
  107. package/dist/cdn/{shared-dbadd9cf.js → shared-0838fad0.js} +1 -1
  108. package/dist/cdn/{shared-7deff07c.js → shared-132b2b71.js} +1 -1
  109. package/dist/cdn/{shared-00c2793e.js → shared-16b391d9.js} +1 -1
  110. package/dist/cdn/{shared-99c0ae04.js → shared-19732959.js} +1 -1
  111. package/dist/cdn/{shared-43f449bb.js → shared-1c07b1be.js} +1 -1
  112. package/dist/cdn/{shared-e39807f8.js → shared-1e3d7d40.js} +1 -1
  113. package/dist/cdn/{shared-896982f9.js → shared-1f8ae298.js} +1 -1
  114. package/dist/cdn/{shared-76400719.js → shared-213c60d3.js} +1 -1
  115. package/dist/cdn/{shared-d21fa1a6.js → shared-2787655b.js} +1 -1
  116. package/dist/cdn/{shared-a8dc23f1.js → shared-2b68c60f.js} +1 -1
  117. package/dist/cdn/{shared-c9ba1b64.js → shared-2d40129d.js} +1 -1
  118. package/dist/cdn/{shared-30d00b64.js → shared-31b7a6ad.js} +1 -1
  119. package/dist/cdn/{shared-174f37e9.js → shared-360e1c8e.js} +1 -1
  120. package/dist/cdn/{shared-7e1953f5.js → shared-38499b40.js} +1 -1
  121. package/dist/cdn/{shared-4462dc70.js → shared-4721aeb1.js} +1 -1
  122. package/dist/cdn/{shared-7dd17943.js → shared-50a3cb63.js} +1 -1
  123. package/dist/cdn/{shared-ca4c5f0f.js → shared-51318b75.js} +1 -1
  124. package/dist/cdn/{shared-9df8f842.js → shared-533c0d6a.js} +1 -1
  125. package/dist/cdn/{shared-9c08cfab.js → shared-5407617a.js} +1 -1
  126. package/dist/cdn/{shared-5fa697c4.js → shared-550f9cae.js} +1 -1
  127. package/dist/cdn/{shared-e91453df.js → shared-55f58244.js} +1 -1
  128. package/dist/cdn/{shared-2bdc99f4.js → shared-60e167ae.js} +1 -1
  129. package/dist/cdn/{shared-ac7c5a5e.js → shared-69c67952.js} +3 -3
  130. package/dist/cdn/{shared-ff8ca16b.js → shared-6d34289d.js} +1 -1
  131. package/dist/cdn/{shared-8952aeac.js → shared-6da29a49.js} +1 -1
  132. package/dist/cdn/shared-76812651.js +95 -0
  133. package/dist/cdn/{shared-e83f2983.js → shared-7d24a3f1.js} +1 -1
  134. package/dist/cdn/{shared-ad34b6db.js → shared-87f81b69.js} +1 -1
  135. package/dist/cdn/{shared-029816d7.js → shared-8d51eaa6.js} +1 -1
  136. package/dist/cdn/{shared-32e736eb.js → shared-8ed04343.js} +1 -1
  137. package/dist/cdn/{shared-ff9791cf.js → shared-902b0773.js} +1 -1
  138. package/dist/cdn/{shared-cdd2358f.js → shared-927fa880.js} +1 -1
  139. package/dist/cdn/{shared-bc0d8d01.js → shared-942ef1fc.js} +2 -2
  140. package/dist/cdn/{shared-bed7aae1.js → shared-9f039798.js} +1 -1
  141. package/dist/cdn/{shared-2c8c4b43.js → shared-a26d7f7a.js} +1 -1
  142. package/dist/cdn/{shared-fc15a882.js → shared-a502026c.js} +1 -1
  143. package/dist/cdn/{shared-54b0e48f.js → shared-aa4f6a25.js} +1 -1
  144. package/dist/cdn/{shared-b509bc2c.js → shared-ac62d098.js} +1 -1
  145. package/dist/cdn/{shared-8201d0b5.js → shared-b06b1473.js} +1 -1
  146. package/dist/cdn/{shared-b1b8ea67.js → shared-bc113435.js} +1 -1
  147. package/dist/cdn/{shared-fa4f6cd3.js → shared-be5ef71d.js} +1 -1
  148. package/dist/cdn/{shared-4c124efc.js → shared-be8c90cc.js} +1 -1
  149. package/dist/cdn/{shared-4e59fd48.js → shared-c36477d7.js} +1 -1
  150. package/dist/cdn/{shared-268571df.js → shared-c37707da.js} +1 -1
  151. package/dist/cdn/{shared-c7b3d22b.js → shared-cadbb2e3.js} +1 -1
  152. package/dist/cdn/{shared-f9a3d1ff.js → shared-d28b95c6.js} +2 -2
  153. package/dist/cdn/{shared-4aa4d980.js → shared-d2dc8486.js} +1 -1
  154. package/dist/cdn/{shared-2f09d4df.js → shared-d7910e16.js} +1 -1
  155. package/dist/cdn/{shared-6a9ae42e.js → shared-dc8c202b.js} +1 -1
  156. package/dist/cdn/{shared-02bc0368.js → shared-de59c42c.js} +1 -1
  157. package/dist/cdn/{shared-ea527e98.js → shared-df8380e1.js} +1 -1
  158. package/dist/cdn/{shared-8d8bed82.js → shared-e7dffedb.js} +1 -1
  159. package/dist/cdn/{shared-be7bfbb0.js → shared-eaceb493.js} +1 -1
  160. package/dist/cdn/{shared-d57fac94.js → shared-ee54f718.js} +1 -1
  161. package/dist/cdn/{shared-2b27e2e7.js → shared-f1ee9bf9.js} +1 -1
  162. package/dist/cdn/shared-f2eb454c.js +1 -0
  163. package/dist/cdn/{shared-20ba4cdc.js → shared-f7365ea5.js} +1 -1
  164. package/dist/cdn/translations/customer/en.json +6 -6
  165. package/dist/cdn/translations/customer-portal/en.json +30 -6
  166. package/dist/cdn/translations/subscription-card/en.json +2 -0
  167. package/dist/cdn/translations/subscription-form/en.json +6 -6
  168. package/dist/elements/public/SubscriptionCard/SubscriptionCard.js +9 -1
  169. package/dist/elements/public/SubscriptionCard/SubscriptionCard.js.map +1 -1
  170. package/dist/elements/public/SubscriptionCard/index.d.ts +1 -0
  171. package/dist/elements/public/SubscriptionCard/index.js +1 -0
  172. package/dist/elements/public/SubscriptionCard/index.js.map +1 -1
  173. package/dist/mixins/themeable.js +16 -0
  174. package/dist/mixins/themeable.js.map +1 -1
  175. package/package.json +1 -1
  176. package/dist/cdn/shared-2cf08dd4.js +0 -1
  177. package/dist/cdn/shared-4c650e5c.js +0 -1
@@ -1 +1 @@
1
- import"./shared-2f09d4df.js";import"./shared-ca4c5f0f.js";import"./shared-20ba4cdc.js";import{I as t}from"./shared-ff8ca16b.js";import{I as e}from"./shared-fc15a882.js";import"./shared-029816d7.js";import{i as s}from"./shared-d3bf9ac0.js";import{h as r}from"./shared-7f33a83a.js";import{c as o,_ as a,B as i}from"./shared-1522d76f.js";import{S as n,a as d}from"./shared-5fa697c4.js";import{v as l}from"./shared-b738ee96.js";import{c as h}from"./shared-4e709717.js";import"./shared-f9a3d1ff.js";import"./shared-43f449bb.js";import"./shared-61ade33e.js";import"./shared-c9ba1b64.js";import"./shared-b509bc2c.js";import"./shared-ff9791cf.js";import"./shared-bed7aae1.js";import"./shared-d57fac94.js";import"./shared-c7b3d22b.js";import"./shared-d21fa1a6.js";import"./shared-268571df.js";import"./shared-07e9d1fb.js";import"./shared-343d1fd7.js";import"./shared-b23c903e.js";import"./shared-30cbf0a6.js";import"./foxy-spinner.js";import"./shared-30d00b64.js";import"./shared-6a7f96c4.js";import"./shared-3ab0306f.js";import"./shared-eb116b3e.js";import"./shared-f9180815.js";!function(){function t(t,e,s){if(null!=s){const r=t.includes("?")?"&":"?";return t+r+e+"="+encodeURIComponent(s)}return t}class e extends Error{constructor(t){super(`[hcaptcha-web-component]: ${t}`),Object.setPrototypeOf(this,e.prototype)}}class s extends HTMLElement{connectedCallback(){(function(e){if(window._hCaptchaOnLoadPromise)return window._hCaptchaOnLoadPromise;if(window.hcaptcha)return console.warn("[vanilla-hcaptcha] hCaptcha JS API detected to be externally loaded. Unless you know what are you doing, this task should be delegated to this web component."),window._hCaptchaOnLoadPromise=Promise.resolve(),window._hCaptchaOnLoadPromise;{let s,r;window._hCaptchaOnLoadPromise=new Promise(((t,e)=>{s=t,r=e})),window._hCaptchaOnLoad=s;const o=function(e){let s=e.jsapi;return s=t(s,"render","explicit"),s=t(s,"onload","_hCaptchaOnLoad"),s=t(s,"recaptchacompat",!1===e.reCaptchaCompat?"off":null),s=t(s,"host",e.host),s=t(s,"hl",e.hl),s=t(s,"sentry",JSON.stringify(e.sentry)),s=t(s,"endpoint",e.endpoint),s=t(s,"assethost",e.assethost),s=t(s,"imghost",e.imghost),s=t(s,"reportapi",e.reportapi),s}(e),a=document.createElement("script");return a.src=o,a.async=!0,a.defer=!0,a.onerror=t=>{const e=`Failed to load hCaptcha JS API: "${o}"`;console.error(e,t),r(e)},document.head.appendChild(a),window._hCaptchaOnLoadPromise}})({host:this.getAttribute("host"),hl:this.getAttribute("hl"),sentry:"false"!==this.getAttribute("sentry"),reCaptchaCompat:"false"===this.getAttribute("reCaptchaCompat"),jsapi:this.getAttribute("jsapi")||"https://js.hcaptcha.com/1/api.js",endpoint:this.getAttribute("endpoint"),reportapi:this.getAttribute("reportapi"),assethost:this.getAttribute("assethost"),imghost:this.getAttribute("imghost")}).then(this.onApiLoaded.bind(this)).catch(this.onError.bind(this))}onApiLoaded(){this.$emit("loaded");const t="false"!==this.getAttribute("auto-render"),e={sitekey:this.getAttribute("sitekey")||this.getAttribute("site-key"),theme:this.getAttribute("theme"),size:this.getAttribute("size"),hl:this.getAttribute("hl"),tplinks:"off"===this.getAttribute("tplinks")?"off":"on",tabindex:parseInt(this.getAttribute("tabindex")),custom:"true"===this.getAttribute("custom")},s=this.getAttribute("challenge-container");s&&(e["challenge-container"]=s);const r=this.getAttribute("rqdata");t&&!e.sitekey||t&&(this.render(e),this.setData(r))}assertApiLoaded(t){if(!hcaptcha)throw new e(`hCaptcha JS API was not loaded yet. Please wait for \`loaded\` event to safely call "${t}".`)}assertRendered(){if(!this.hcaptchaId)throw new e('hCaptcha was not yet rendered. Please call "render()" first.')}onError(t){console.error(t),this.$emit("error",{error:t})}$emit(t,e){let s;"function"==typeof Event?s=new Event(t):(s=document.createEvent("Event"),s.initEvent(t,!1,!1)),e&&Object.assign(s,e),this.dispatchEvent(s)}render(t){this.assertApiLoaded("render"),this.hcaptchaId?console.warn("hCaptcha was already rendered. You may want to call 'reset()' first."):this.hcaptchaId=hcaptcha.render(this,Object.assign(Object.assign({},t),{callback:()=>{const t=hcaptcha.getResponse(this.hcaptchaId),e=hcaptcha.getRespKey(this.hcaptchaId);this.$emit("verified",{token:t,eKey:e,key:t})},"expired-callback":()=>{this.$emit("expired")},"chalexpired-callback":()=>{this.$emit("challenge-expired")},"error-callback":this.onError.bind(this),"open-callback":()=>{this.$emit("opened")},"close-callback":()=>{this.$emit("closed")}}))}setData(t){this.assertRendered(),hcaptcha.setData(this.hcaptchaId,{rqdata:t})}execute(){this.assertApiLoaded("execute"),this.assertRendered(),hcaptcha.execute(this.hcaptchaId)}executeAsync(){return this.assertApiLoaded("execute"),this.assertRendered(),hcaptcha.execute(this.hcaptchaId,{async:!0})}reset(){this.assertApiLoaded("reset"),this.assertRendered(),hcaptcha.reset(this.hcaptchaId)}}customElements.define("h-captcha",s)}();let c,p=t=>t;customElements.define("foxy-internal-customer-form-legal-notice-control",class extends e{renderControl(){var t,e;const o=this.nucleon;return r(c||(c=p` <p class="leading-s text-xs text-secondary"> <foxy-i18n infer="" key="text"></foxy-i18n> <a class="font-medium text-body rounded hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50" target="_blank" href="${0}" rel="noopener noreferrer"> <foxy-i18n infer="" key="link"></foxy-i18n> </a> </p> `),s(null===(e=null===(t=null==o?void 0:o.settings)||void 0===t?void 0:t.tos_checkbox_settings)||void 0===e?void 0:e.url))}});var m=o((function(t){!function(){const e=[{id:0,value:"Too weak",minDiversity:0,minLength:0},{id:1,value:"Weak",minDiversity:2,minLength:6},{id:2,value:"Medium",minDiversity:4,minLength:8},{id:3,value:"Strong",minDiversity:4,minLength:10}],s=(t,s=e,r="!\"#$%&'()*+,-./:;<=>?@[\\\\\\]^_`{|}~")=>{let o=t||"";s[0].minDiversity=0,s[0].minLength=0;const a=[{regex:"[a-z]",message:"lowercase"},{regex:"[A-Z]",message:"uppercase"},{regex:"[0-9]",message:"number"}];r&&a.push({regex:`[${r}]`,message:"symbol"});let i={};i.contains=a.filter((t=>new RegExp(`${t.regex}`).test(o))).map((t=>t.message)),i.length=o.length;let n=s.filter((t=>i.contains.length>=t.minDiversity)).filter((t=>i.length>=t.minLength)).sort(((t,e)=>e.id-t.id)).map((t=>({id:t.id,value:t.value})));return Object.assign(i,n[0]),i};t.exports={passwordStrength:s,defaultOptions:e}}()}));let u,f,g=t=>t;const _=n(d(t,"customer-form")),y=m.passwordStrength;class x extends _{constructor(){super(...arguments),this.passwordless=!1,this.templates={},this.settings=null,this.__isAnonymousGetValue=()=>{var t;return!1===(null===(t=this.form)||void 0===t?void 0:t.is_anonymous)?"false":"true"},this.__isAnonymousSetValue=t=>{const e="true"===t;this.edit({is_anonymous:e}),e&&this.form.password&&this.edit({password:""}),e&&this.form.password_old&&this.edit({password_old:""}),e&&this.form.forgot_password&&this.edit({forgot_password:""})},this.__isAnonymousOptions=[{value:"true",label:"option_true"},{value:"false",label:"option_false"}],this.__refreshInterval=null}static get scopedElements(){return{"foxy-internal-customer-form-legal-notice-control":customElements.get("foxy-internal-customer-form-legal-notice-control"),"foxy-internal-radio-group-control":customElements.get("foxy-internal-radio-group-control"),"foxy-internal-timestamps-control":customElements.get("foxy-internal-timestamps-control"),"foxy-internal-password-control":customElements.get("foxy-internal-password-control"),"foxy-internal-create-control":customElements.get("foxy-internal-create-control"),"foxy-internal-delete-control":customElements.get("foxy-internal-delete-control"),"foxy-internal-text-control":customElements.get("foxy-internal-text-control"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"h-captcha":customElements.get("h-captcha"),"vaadin-button":customElements.get("vaadin-button")}}static get properties(){return a(a({},super.properties),{},{passwordless:{type:Boolean},settings:{type:Object}})}static get v8n(){return[({password:t,_links:e,is_anonymous:s=!0},r)=>!!r.passwordless||(!!(e||s||t)||"password:v8n_required"),({password_old:t,password:e,_links:s},r)=>{var o;return!s||(void 0===(null===(o=r.settings)||void 0===o?void 0:o.sign_up)||(!(e&&!t)||"password-old:v8n_required"))},({first_name:t})=>!t||t.length<=50||"first-name:v8n_too_long",({last_name:t})=>!t||t.length<=50||"last-name:v8n_too_long",({password:t})=>!t||y(t).id>=2||"password:v8n_too_weak",({password:t})=>!t||t.length<=50||"password:v8n_too_long",({tax_id:t})=>!t||t.length<=50||"tax-id:v8n_too_long",({email:t})=>t&&t.length>0||"email:v8n_required",({email:t})=>!t||t.length<=100||"email:v8n_too_long",({email:t})=>!t||l(t)||"email:v8n_invalid_email"]}get readonlySelector(){const t=this.data?["is-anonymous"]:[];return t.push(super.readonlySelector.toString()),new i(t.join(" ").trim())}get hiddenSelector(){const t=new Set(super.hiddenSelector.toString().split(" "));return this.settings?(t.add("forgot-password"),t.add("is-anonymous"),this.form.password||t.add("password-old"),"none"===this.settings.tos_checkbox_settings.usage&&t.add("legal-notice")):(!1!==this.form.is_anonymous&&(t.add("forgot-password"),t.add("password")),t.add("password-old"),t.add("legal-notice")),this.href&&t.add("legal-notice"),new i(Array.from(t).join(" ").trim())}disconnectedCallback(){super.disconnectedCallback();const t=this.__refreshInterval;t&&clearInterval(t)}connectedCallback(){super.connectedCallback();const t=setInterval((()=>this.requestUpdate()),6e4);this.__refreshInterval=t}renderBody(){var t,e,s,o;const a=this.hiddenSelector.matches("first-name",!0),i=this.hiddenSelector.matches("last-name",!0);return r(u||(u=g` <div class="${0}"> <foxy-internal-text-control infer="first-name"></foxy-internal-text-control> <foxy-internal-text-control infer="last-name"></foxy-internal-text-control> </div> <foxy-internal-text-control infer="tax-id"></foxy-internal-text-control> <foxy-internal-text-control helper-text="${0}" infer="email"> </foxy-internal-text-control> <foxy-internal-radio-group-control infer="is-anonymous" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-password-control placeholder="${0}" helper-text="${0}" infer="password" show-generator> </foxy-internal-password-control> <foxy-internal-password-control infer="password-old"></foxy-internal-password-control> <foxy-internal-password-control helper-text="${0}" infer="forgot-password" show-generator> </foxy-internal-password-control> <foxy-internal-customer-form-legal-notice-control infer="legal-notice"> </foxy-internal-customer-form-legal-notice-control> ${0} ${0} `),h({"grid-cols-2":!a&&!i,hidden:a&&i,"gap-m":!0,grid:!a||!i}),this.__emailHelperText,this.__isAnonymousGetValue,this.__isAnonymousSetValue,this.__isAnonymousOptions,this.__passwordPlaceholder,this.__passwordHelperText,this.__forgotPasswordHelperText,!this.data&&(null===(e=null===(t=this.settings)||void 0===t?void 0:t.sign_up)||void 0===e?void 0:e.enabled)&&"hcaptcha"===(null===(o=null===(s=this.settings)||void 0===s?void 0:s.sign_up)||void 0===o?void 0:o.verification.type)?r(f||(f=g` <h-captcha site-key="${0}" class="hidden" size="invisible" hl="${0}" @verified="${0}"> </h-captcha> `),this.settings.sign_up.verification.site_key,this.lang,(({token:t})=>{this.edit({verification:{type:"hcaptcha",token:t}}),super.submit()})):"",super.renderBody())}submit(){var t,e,s,r,o;"hcaptcha"!==(null===(s=null===(e=null===(t=this.settings)||void 0===t?void 0:t.sign_up)||void 0===e?void 0:e.verification)||void 0===s?void 0:s.type)||this.data?super.submit():(null===(r=this.__hcaptcha)||void 0===r||r.reset(),null===(o=this.__hcaptcha)||void 0===o||o.execute())}async _sendPatch(t){const e=await super._sendPatch(t);if(t.password){const t={key:"password_change_success",options:{email:e.email}};this.status=t}return e}async _sendGet(){return this.status=null,await super._sendGet()}async _fetch(...t){try{return await super._fetch(...t)}catch(t){let e;try{e=(await t.json())._embedded["fx:errors"][0].message}catch(e){throw t}throw"Conflict"===e||e.startsWith("This email address is already in use")?["error:email_already_used"]:e.startsWith("Customer registration is disabled")?["error:registration_disabled"]:e.startsWith("Client verification failed")?["error:verification_failed"]:e.startsWith("Provided password is incorrect")?["error:old_password_incorrect"]:t}}get __forgotPasswordHelperText(){var t,e;const s=null===(t=this.data)||void 0===t?void 0:t.forgot_password_timestamp,r="forgot-password.helper_text";if((null===(e=this.data)||void 0===e?void 0:e.forgot_password)&&s){const t=new Date(new Date(s).getTime()+18e5),e=Math.floor((t.getTime()-Date.now())/1e3/60);return e<=0?this.t(`${r}_expired_on`,{expiresOn:t}):this.t(`${r}_expires_in`,{expiresInMin:`${e}minutes`})}return this.t(r)}get __passwordPlaceholder(){return this.data?this.t("password.placeholder_new"):this.t("password.placeholder")}get __passwordHelperText(){return this.data?this.t("password.helper_text_new"):this.t("password.helper_text")}get __emailHelperText(){var t;return(null===(t=this.data)||void 0===t?void 0:t.last_login_date)?this.t("email.helper_text_last_login_date",{date:this.data.last_login_date}):this.t("email.helper_text")}get __hcaptcha(){return this.renderRoot.querySelector("h-captcha")}}customElements.define("foxy-customer-form",x);export{x as CustomerForm};
1
+ import"./shared-d7910e16.js";import"./shared-51318b75.js";import"./shared-f7365ea5.js";import{I as t}from"./shared-6d34289d.js";import{I as e}from"./shared-a502026c.js";import"./shared-8d51eaa6.js";import{i as s}from"./shared-d3bf9ac0.js";import{h as r}from"./shared-7f33a83a.js";import{c as o,_ as a,B as i}from"./shared-1522d76f.js";import{S as n,a as d}from"./shared-550f9cae.js";import{v as l}from"./shared-b738ee96.js";import{c as h}from"./shared-4e709717.js";import"./shared-d28b95c6.js";import"./shared-1c07b1be.js";import"./shared-61ade33e.js";import"./shared-2d40129d.js";import"./shared-ac62d098.js";import"./shared-902b0773.js";import"./shared-9f039798.js";import"./shared-ee54f718.js";import"./shared-cadbb2e3.js";import"./shared-2787655b.js";import"./shared-c37707da.js";import"./shared-07e9d1fb.js";import"./shared-343d1fd7.js";import"./shared-b23c903e.js";import"./shared-30cbf0a6.js";import"./foxy-spinner.js";import"./shared-31b7a6ad.js";import"./shared-6a7f96c4.js";import"./shared-3ab0306f.js";import"./shared-eb116b3e.js";import"./shared-f9180815.js";!function(){function t(t,e,s){if(null!=s){const r=t.includes("?")?"&":"?";return t+r+e+"="+encodeURIComponent(s)}return t}class e extends Error{constructor(t){super(`[hcaptcha-web-component]: ${t}`),Object.setPrototypeOf(this,e.prototype)}}class s extends HTMLElement{connectedCallback(){(function(e){if(window._hCaptchaOnLoadPromise)return window._hCaptchaOnLoadPromise;if(window.hcaptcha)return console.warn("[vanilla-hcaptcha] hCaptcha JS API detected to be externally loaded. Unless you know what are you doing, this task should be delegated to this web component."),window._hCaptchaOnLoadPromise=Promise.resolve(),window._hCaptchaOnLoadPromise;{let s,r;window._hCaptchaOnLoadPromise=new Promise(((t,e)=>{s=t,r=e})),window._hCaptchaOnLoad=s;const o=function(e){let s=e.jsapi;return s=t(s,"render","explicit"),s=t(s,"onload","_hCaptchaOnLoad"),s=t(s,"recaptchacompat",!1===e.reCaptchaCompat?"off":null),s=t(s,"host",e.host),s=t(s,"hl",e.hl),s=t(s,"sentry",JSON.stringify(e.sentry)),s=t(s,"endpoint",e.endpoint),s=t(s,"assethost",e.assethost),s=t(s,"imghost",e.imghost),s=t(s,"reportapi",e.reportapi),s}(e),a=document.createElement("script");return a.src=o,a.async=!0,a.defer=!0,a.onerror=t=>{const e=`Failed to load hCaptcha JS API: "${o}"`;console.error(e,t),r(e)},document.head.appendChild(a),window._hCaptchaOnLoadPromise}})({host:this.getAttribute("host"),hl:this.getAttribute("hl"),sentry:"false"!==this.getAttribute("sentry"),reCaptchaCompat:"false"===this.getAttribute("reCaptchaCompat"),jsapi:this.getAttribute("jsapi")||"https://js.hcaptcha.com/1/api.js",endpoint:this.getAttribute("endpoint"),reportapi:this.getAttribute("reportapi"),assethost:this.getAttribute("assethost"),imghost:this.getAttribute("imghost")}).then(this.onApiLoaded.bind(this)).catch(this.onError.bind(this))}onApiLoaded(){this.$emit("loaded");const t="false"!==this.getAttribute("auto-render"),e={sitekey:this.getAttribute("sitekey")||this.getAttribute("site-key"),theme:this.getAttribute("theme"),size:this.getAttribute("size"),hl:this.getAttribute("hl"),tplinks:"off"===this.getAttribute("tplinks")?"off":"on",tabindex:parseInt(this.getAttribute("tabindex")),custom:"true"===this.getAttribute("custom")},s=this.getAttribute("challenge-container");s&&(e["challenge-container"]=s);const r=this.getAttribute("rqdata");t&&!e.sitekey||t&&(this.render(e),this.setData(r))}assertApiLoaded(t){if(!hcaptcha)throw new e(`hCaptcha JS API was not loaded yet. Please wait for \`loaded\` event to safely call "${t}".`)}assertRendered(){if(!this.hcaptchaId)throw new e('hCaptcha was not yet rendered. Please call "render()" first.')}onError(t){console.error(t),this.$emit("error",{error:t})}$emit(t,e){let s;"function"==typeof Event?s=new Event(t):(s=document.createEvent("Event"),s.initEvent(t,!1,!1)),e&&Object.assign(s,e),this.dispatchEvent(s)}render(t){this.assertApiLoaded("render"),this.hcaptchaId?console.warn("hCaptcha was already rendered. You may want to call 'reset()' first."):this.hcaptchaId=hcaptcha.render(this,Object.assign(Object.assign({},t),{callback:()=>{const t=hcaptcha.getResponse(this.hcaptchaId),e=hcaptcha.getRespKey(this.hcaptchaId);this.$emit("verified",{token:t,eKey:e,key:t})},"expired-callback":()=>{this.$emit("expired")},"chalexpired-callback":()=>{this.$emit("challenge-expired")},"error-callback":this.onError.bind(this),"open-callback":()=>{this.$emit("opened")},"close-callback":()=>{this.$emit("closed")}}))}setData(t){this.assertRendered(),hcaptcha.setData(this.hcaptchaId,{rqdata:t})}execute(){this.assertApiLoaded("execute"),this.assertRendered(),hcaptcha.execute(this.hcaptchaId)}executeAsync(){return this.assertApiLoaded("execute"),this.assertRendered(),hcaptcha.execute(this.hcaptchaId,{async:!0})}reset(){this.assertApiLoaded("reset"),this.assertRendered(),hcaptcha.reset(this.hcaptchaId)}}customElements.define("h-captcha",s)}();let c,p=t=>t;customElements.define("foxy-internal-customer-form-legal-notice-control",class extends e{renderControl(){var t,e;const o=this.nucleon;return r(c||(c=p` <p class="leading-s text-xs text-secondary"> <foxy-i18n infer="" key="text"></foxy-i18n> <a class="font-medium text-body rounded hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50" target="_blank" href="${0}" rel="noopener noreferrer"> <foxy-i18n infer="" key="link"></foxy-i18n> </a> </p> `),s(null===(e=null===(t=null==o?void 0:o.settings)||void 0===t?void 0:t.tos_checkbox_settings)||void 0===e?void 0:e.url))}});var m=o((function(t){!function(){const e=[{id:0,value:"Too weak",minDiversity:0,minLength:0},{id:1,value:"Weak",minDiversity:2,minLength:6},{id:2,value:"Medium",minDiversity:4,minLength:8},{id:3,value:"Strong",minDiversity:4,minLength:10}],s=(t,s=e,r="!\"#$%&'()*+,-./:;<=>?@[\\\\\\]^_`{|}~")=>{let o=t||"";s[0].minDiversity=0,s[0].minLength=0;const a=[{regex:"[a-z]",message:"lowercase"},{regex:"[A-Z]",message:"uppercase"},{regex:"[0-9]",message:"number"}];r&&a.push({regex:`[${r}]`,message:"symbol"});let i={};i.contains=a.filter((t=>new RegExp(`${t.regex}`).test(o))).map((t=>t.message)),i.length=o.length;let n=s.filter((t=>i.contains.length>=t.minDiversity)).filter((t=>i.length>=t.minLength)).sort(((t,e)=>e.id-t.id)).map((t=>({id:t.id,value:t.value})));return Object.assign(i,n[0]),i};t.exports={passwordStrength:s,defaultOptions:e}}()}));let u,f,g=t=>t;const _=n(d(t,"customer-form")),y=m.passwordStrength;class x extends _{constructor(){super(...arguments),this.passwordless=!1,this.templates={},this.settings=null,this.__isAnonymousGetValue=()=>{var t;return!1===(null===(t=this.form)||void 0===t?void 0:t.is_anonymous)?"false":"true"},this.__isAnonymousSetValue=t=>{const e="true"===t;this.edit({is_anonymous:e}),e&&this.form.password&&this.edit({password:""}),e&&this.form.password_old&&this.edit({password_old:""}),e&&this.form.forgot_password&&this.edit({forgot_password:""})},this.__isAnonymousOptions=[{value:"true",label:"option_true"},{value:"false",label:"option_false"}],this.__refreshInterval=null}static get scopedElements(){return{"foxy-internal-customer-form-legal-notice-control":customElements.get("foxy-internal-customer-form-legal-notice-control"),"foxy-internal-radio-group-control":customElements.get("foxy-internal-radio-group-control"),"foxy-internal-timestamps-control":customElements.get("foxy-internal-timestamps-control"),"foxy-internal-password-control":customElements.get("foxy-internal-password-control"),"foxy-internal-create-control":customElements.get("foxy-internal-create-control"),"foxy-internal-delete-control":customElements.get("foxy-internal-delete-control"),"foxy-internal-text-control":customElements.get("foxy-internal-text-control"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"h-captcha":customElements.get("h-captcha"),"vaadin-button":customElements.get("vaadin-button")}}static get properties(){return a(a({},super.properties),{},{passwordless:{type:Boolean},settings:{type:Object}})}static get v8n(){return[({password:t,_links:e,is_anonymous:s=!0},r)=>!!r.passwordless||(!!(e||s||t)||"password:v8n_required"),({password_old:t,password:e,_links:s},r)=>{var o;return!s||(void 0===(null===(o=r.settings)||void 0===o?void 0:o.sign_up)||(!(e&&!t)||"password-old:v8n_required"))},({first_name:t})=>!t||t.length<=50||"first-name:v8n_too_long",({last_name:t})=>!t||t.length<=50||"last-name:v8n_too_long",({password:t})=>!t||y(t).id>=2||"password:v8n_too_weak",({password:t})=>!t||t.length<=50||"password:v8n_too_long",({tax_id:t})=>!t||t.length<=50||"tax-id:v8n_too_long",({email:t})=>t&&t.length>0||"email:v8n_required",({email:t})=>!t||t.length<=100||"email:v8n_too_long",({email:t})=>!t||l(t)||"email:v8n_invalid_email"]}get readonlySelector(){const t=this.data?["is-anonymous"]:[];return t.push(super.readonlySelector.toString()),new i(t.join(" ").trim())}get hiddenSelector(){const t=new Set(super.hiddenSelector.toString().split(" "));return this.settings?(t.add("forgot-password"),t.add("is-anonymous"),this.form.password||t.add("password-old"),"none"===this.settings.tos_checkbox_settings.usage&&t.add("legal-notice")):(!1!==this.form.is_anonymous&&(t.add("forgot-password"),t.add("password")),t.add("password-old"),t.add("legal-notice")),this.href&&t.add("legal-notice"),new i(Array.from(t).join(" ").trim())}disconnectedCallback(){super.disconnectedCallback();const t=this.__refreshInterval;t&&clearInterval(t)}connectedCallback(){super.connectedCallback();const t=setInterval((()=>this.requestUpdate()),6e4);this.__refreshInterval=t}renderBody(){var t,e,s,o;const a=this.hiddenSelector.matches("first-name",!0),i=this.hiddenSelector.matches("last-name",!0);return r(u||(u=g` <div class="${0}"> <foxy-internal-text-control infer="first-name"></foxy-internal-text-control> <foxy-internal-text-control infer="last-name"></foxy-internal-text-control> </div> <foxy-internal-text-control infer="tax-id"></foxy-internal-text-control> <foxy-internal-text-control helper-text="${0}" infer="email"> </foxy-internal-text-control> <foxy-internal-radio-group-control infer="is-anonymous" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-password-control placeholder="${0}" helper-text="${0}" infer="password" show-generator> </foxy-internal-password-control> <foxy-internal-password-control infer="password-old"></foxy-internal-password-control> <foxy-internal-password-control helper-text="${0}" infer="forgot-password" show-generator> </foxy-internal-password-control> <foxy-internal-customer-form-legal-notice-control infer="legal-notice"> </foxy-internal-customer-form-legal-notice-control> ${0} ${0} `),h({"grid-cols-2":!a&&!i,hidden:a&&i,"gap-m":!0,grid:!a||!i}),this.__emailHelperText,this.__isAnonymousGetValue,this.__isAnonymousSetValue,this.__isAnonymousOptions,this.__passwordPlaceholder,this.__passwordHelperText,this.__forgotPasswordHelperText,!this.data&&(null===(e=null===(t=this.settings)||void 0===t?void 0:t.sign_up)||void 0===e?void 0:e.enabled)&&"hcaptcha"===(null===(o=null===(s=this.settings)||void 0===s?void 0:s.sign_up)||void 0===o?void 0:o.verification.type)?r(f||(f=g` <h-captcha site-key="${0}" class="hidden" size="invisible" hl="${0}" @verified="${0}"> </h-captcha> `),this.settings.sign_up.verification.site_key,this.lang,(({token:t})=>{this.edit({verification:{type:"hcaptcha",token:t}}),super.submit()})):"",super.renderBody())}submit(){var t,e,s,r,o;"hcaptcha"!==(null===(s=null===(e=null===(t=this.settings)||void 0===t?void 0:t.sign_up)||void 0===e?void 0:e.verification)||void 0===s?void 0:s.type)||this.data?super.submit():(null===(r=this.__hcaptcha)||void 0===r||r.reset(),null===(o=this.__hcaptcha)||void 0===o||o.execute())}async _sendPatch(t){const e=await super._sendPatch(t);if(t.password){const t={key:"password_change_success",options:{email:e.email}};this.status=t}return e}async _sendGet(){return this.status=null,await super._sendGet()}async _fetch(...t){try{return await super._fetch(...t)}catch(t){let e;try{e=(await t.json())._embedded["fx:errors"][0].message}catch(e){throw t}throw"Conflict"===e||e.startsWith("This email address is already in use")?["error:email_already_used"]:e.startsWith("Customer registration is disabled")?["error:registration_disabled"]:e.startsWith("Client verification failed")?["error:verification_failed"]:e.startsWith("Provided password is incorrect")?["error:old_password_incorrect"]:t}}get __forgotPasswordHelperText(){var t,e;const s=null===(t=this.data)||void 0===t?void 0:t.forgot_password_timestamp,r="forgot-password.helper_text";if((null===(e=this.data)||void 0===e?void 0:e.forgot_password)&&s){const t=new Date(new Date(s).getTime()+18e5),e=Math.floor((t.getTime()-Date.now())/1e3/60);return e<=0?this.t(`${r}_expired_on`,{expiresOn:t}):this.t(`${r}_expires_in`,{expiresInMin:`${e}minutes`})}return this.t(r)}get __passwordPlaceholder(){return this.data?this.t("password.placeholder_new"):this.t("password.placeholder")}get __passwordHelperText(){return this.data?this.t("password.helper_text_new"):this.t("password.helper_text")}get __emailHelperText(){var t;return(null===(t=this.data)||void 0===t?void 0:t.last_login_date)?this.t("email.helper_text_last_login_date",{date:this.data.last_login_date}):this.t("email.helper_text")}get __hcaptcha(){return this.renderRoot.querySelector("h-captcha")}}customElements.define("foxy-customer-form",x);export{x as CustomerForm};
@@ -1 +1 @@
1
- import{d as e,an as t,ag as s,ai as i,ao as a,_ as n,ap as l,aq as r}from"./shared-1522d76f.js";import"./shared-ff9791cf.js";import{B as d}from"./shared-c7b3d22b.js";import{E as o,F as h}from"./shared-76400719.js";import"./shared-f9a3d1ff.js";import"./shared-9c08cfab.js";import{L as c,h as u,c as _}from"./shared-7f33a83a.js";import{z as g,w as p,x as v,A as m}from"./shared-5fa697c4.js";import{D as x,a as y,C as $,b as f}from"./shared-e39807f8.js";import"./shared-268571df.js";import{a as b,I as w,D as k,S as E,M as C,W as S,c as R,t as I}from"./shared-4c124efc.js";import"./shared-ea527e98.js";import"./shared-c9ba1b64.js";import{I as j}from"./shared-99c0ae04.js";import{C as V}from"./shared-ad34b6db.js";import"./shared-4e59fd48.js";import{p as M}from"./shared-029816d7.js";import"./shared-b509bc2c.js";import{c as q}from"./shared-4e709717.js";import"./shared-30d00b64.js";import{P as N}from"./shared-d57fac94.js";import{G as T}from"./shared-a8dc23f1.js";import{j as D}from"./shared-250a399a.js";import{p as A}from"./shared-43e2c3f6.js";import{W as U}from"./shared-be7bfbb0.js";import{D as O}from"./shared-ac7c5a5e.js";import{c as F}from"./shared-3d251e6f.js";import{i as L}from"./shared-eb116b3e.js";import"./shared-43f449bb.js";import"./shared-61ade33e.js";import"./shared-9df8f842.js";import"./shared-30cbf0a6.js";import"./shared-11c2efc8.js";import"./shared-07e9d1fb.js";import"./shared-343d1fd7.js";import"./shared-b23c903e.js";import"./shared-d3bf9ac0.js";import"./shared-2b27e2e7.js";import"./shared-2c8c4b43.js";import"./shared-db306674.js";var B=1/0,z=17976931348623157e292;function P(e){return e?(e=g(e))===B||e===-B?(e<0?-1:1)*z:e==e?e:0:0===e?e:0}function Q(e){return e}var K=Math.floor,J=Math.random;var G=parseFloat,H=Math.min,W=Math.random;function Y(a,n,l){if(l&&"boolean"!=typeof l&&function(a,n,l){if(!e(l))return!1;var r=typeof n;return!!("number"==r?t(l)&&s(n,l.length):"string"==r&&n in l)&&i(l[n],a)}(a,n,l)&&(n=l=void 0),void 0===l&&("boolean"==typeof n?(l=n,n=void 0):"boolean"==typeof a&&(l=a,a=void 0)),void 0===a&&void 0===n?(a=0,n=1):(a=P(a),void 0===n?(n=a,a=0):n=P(n)),a>n){var r=a;a=n,n=r}if(l||a%1||n%1){var d=W();return H(a+d*(n-a+G("1e-"+((d+"").length-1))),n)}return function(e,t){return e+K(J()*(t-e+1))}(a,n)}var X=4294967295,Z=Math.min;function ee(e,t){if(e=function(e){var t=P(e),s=t%1;return t==t?s?t-s:t:0}(e),e<1||e>9007199254740991)return[];var s,i=X,n=Z(e,X);e-=X;for(var l=a(n,t="function"==typeof(s=t)?s:Q);++i<e;)t(i);return l}class te extends CustomEvent{constructor(e){super("change",{detail:e})}}let se,ie,ae=e=>e;class ne extends c{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.getText=e=>e}static get properties(){return n(n({},super.properties),{},{value:{type:Array},disabled:{type:Boolean},getText:{type:Object}})}static get styles(){return p.styles}render(){return u(se||(se=ae` <div class="font-lumo text-m w-full"> <ul> ${0} </ul> <div class="p-m"> <slot></slot> </div> </div> `),this.value.map(((e,t)=>u(ie||(ie=ae` <li class="${0}"> <slot name="${0}">${0}</slot> <button ?disabled="${0}" class="w-l h-l rounded text-tertiary transition duration-150 hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </li> `),"ml-m h-l text-body flex justify-between items-center"+(t>0?" border-t border-contrast-10":""),t,this.getText(e),this.disabled,(()=>this.__remove(t))))))}__remove(e){this.value=this.value.filter(((t,s)=>s!==e)),this.dispatchEvent(new te(this.value))}}let le,re,de=e=>e;class oe extends c{static get styles(){return[p.styles,_(le||(le=de`:host{position:absolute;top:0;right:0;bottom:0;left:0}.top-center{top:calc(50% - (var(--lumo-size-xl)/ 2))}@keyframes dash0{from{transform:translate(0,0)}to{transform:translate(5.681301px,3.368302px)}}@keyframes dash1{from{transform:translate(0,0)}to{transform:translate(5.677051px,3.457428px)}}@keyframes dash2{from{transform:translate(0,0)}to{transform:translate(5.686002px,3.127455px)}}@keyframes dash3{from{transform:translate(-5.6842px,-3.404556px)}to{transform:translate(0,0)}}`))]}render(){return u(re||(re=de` <div class="h-full bg-base text-primary"> <svg xmlns="http://www.w3.org/2000/svg" class="fill-current w-xl h-xl mx-auto sticky top-center" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" viewBox="0 0 64 64"> <path id="ew5fy7afo2w2" fill-rule="evenodd" stroke="none" stroke-width="1" d="M41.93 49.46c0 .18-.2.3-.36.2l-1.78-1.07-22.73-13.76a1.5 1.5 0 01-.7-1.3V11.08c0-.18.2-.3.36-.2l1.75 1.04c.44.25.74.75.74 1.32v19.27c0 .08.05.16.12.2L41.22 46c.47.28.73.8.72 1.32v2.15z" clip-rule="evenodd"/> <path id="ew5fy7afo2w3" fill-rule="evenodd" stroke="none" stroke-width="1" d="M47.64 52.9c0 .2-.2.3-.36.21l-1.8-1.08c-.42-.26-.7-.74-.7-1.3v-19.3a.24.24 0 00-.12-.2L25.27 19.47a.24.24 0 00-.37.21v12.55c0 .19-.21.3-.37.2l-1.76-1.06a1.46 1.46 0 01-.71-1.28V16.7c0-.54.27-1.03.71-1.3.45-.27 1-.26 1.44 0l22.72 13.77c.44.26.7.76.7 1.3v20.27l.01 2.17z" clip-rule="evenodd"/> <g style="animation:dash0 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w4" fill-rule="evenodd" stroke="none" stroke-width="1" d="M30.59 35.68c0 .2-.21.3-.37.21l-1.8-1.1c-.41-.27-.68-.74-.68-1.28V27v-2.15c0-.2.2-.3.37-.21l1.78 1.06c.42.26.7.74.7 1.3v8.68z" clip-rule="evenodd"/> </g> <g style="animation:dash1 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w5" fill-rule="evenodd" stroke="none" stroke-width="1" d="M36.28 39.13c0 .2-.2.3-.37.21l-1.79-1.1c-.41-.25-.69-.73-.69-1.28v-6.51-2.16c0-.2.2-.31.37-.21l1.76 1.06c.44.26.73.75.73 1.3v8.69z" clip-rule="evenodd"/> </g> <g style="animation:dash2 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w6" fill-rule="evenodd" stroke="none" stroke-width="1" d="M41.96 42.57c0 .2-.2.3-.37.21L39.8 41.7a1.52 1.52 0 01-.71-1.3v-6.51-2.17c0-.2.2-.31.37-.21l1.74 1.06c.45.25.75.75.75 1.32v8.68z" clip-rule="evenodd"/> </g> <g transform="translate(-5.68 -3.4)" style="animation:dash3 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w7" fill-rule="evenodd" stroke="none" stroke-width="1" d="M30.59 35.68c0 .2-.21.3-.37.21l-1.8-1.1c-.41-.27-.68-.74-.68-1.28V27v-2.15c0-.2.2-.3.37-.21l1.78 1.06c.42.26.7.74.7 1.3v8.68z" clip-rule="evenodd"/> </g> </svg> </div> `))}}let he,ce,ue=e=>e;class _e extends c{static get styles(){return[p.styles,_(he||(he=ue`::slotted(:not([slot])){margin-top:var(--lumo-space-xl)}`))]}render(){return u(ce||(ce=ue` <article class="relative antialiased font-lumo"> <header class="space-y-xs leading-s"> <h1 class="font-medium text-header text-xl border-b border-contrast-10 pb-s mb-s"> <slot name="title"></slot> </h1> <p class="text-l text-secondary"> <slot name="subtitle"></slot> </p> </header> <slot></slot> </article> `))}}let ge,pe,ve=e=>e;class me extends _e{static get styles(){return[super.styles,_(ge||(ge=ve`::slotted(:not([slot])){margin-top:var(--lumo-space-m)}`))]}render(){return u(pe||(pe=ve` <section class="leading-s antialiased font-lumo"> <header> <h2 class="text-header font-medium text-l"> <slot name="title"></slot> </h2> <p class="text-secondary text-m"> <slot name="subtitle"></slot> </p> </header> <slot></slot> </section> `))}}let xe,ye=e=>e;class $e extends CustomEvent{constructor(e){super("change",{detail:e})}}class fe extends c{constructor(){super(...arguments),this.disabled=!1,this.checked=!1}static get properties(){return n(n({},super.properties),{},{disabled:{attribute:!1},checked:{attribute:!1}})}static get styles(){return p.styles}render(){return u(xe||(xe=ye` <label class="${0}"> <span class="text-body font-medium text-m mr-m"> <slot></slot> </span> <span style="border-radius:var(--lumo-size-xl);width:calc((var(--lumo-space-l) * 2) + (var(--lumo-space-xs) * 2))" class="${0}"> <span style="width:var(--lumo-space-l);height:var(--lumo-space-l)" class="${0}"></span> <input type="checkbox" class="opacity-0 absolute inset-0" .checked="${0}" .disabled="${0}" @change="${0}"> </span> </label> `),q({"transition duration-200 flex justify-between items-center group":!0,"cursor-pointer":!this.disabled}),q({"transition duration-150 relative flex flex-shrink-0 items-center":!0,"bg-success focus-within-shadow-outline-success":!this.disabled&&this.checked,"bg-contrast-10 focus-within-shadow-outline":this.disabled||!this.checked,"bg-contrast-20":!this.disabled&&!this.checked}),q({"bg-tint transition duration-200 transform block rounded-full m-xs":!0,"translate-x-l":this.checked,"translate-x-0":!this.checked,"shadow-xs group-hover-shadow-s group-hover-scale-110":!this.disabled}),this.checked,this.disabled,(()=>{this.checked=!this.checked,this.dispatchEvent(new $e(this.checked))}))}}class be extends Error{constructor(){super("Unhandled request detected. Please add a request handler to connect this component to a backend.")}}class we extends CustomEvent{static emit(e){return new Promise(((t,s)=>{const i=new we(n({resolve:t,reject:s},e));e.source.dispatchEvent(i)&&s(new be)}))}constructor({source:e,resolve:t,reject:s,init:i}){var a;super("request",{cancelable:!0,composed:!0,bubbles:!0,detail:{source:e,handle:async function(e){a.stopImmediatePropagation(),a.preventDefault();try{t(await e(...i))}catch(e){s(e)}}}}),a=this}}let ke,Ee=e=>e;class Ce extends CustomEvent{constructor(e){super("change",{detail:e})}}class Se extends v{constructor(){super(...arguments),this.disabled=!1,this.value=1,this.__errorMessage=null,this.__customFieldI18n={formatValue:e=>{const t=parseInt(e[0]);if(isNaN(t))return"0";const s=e[1];return"w"===s?(10080*t).toFixed(0):"d"===s?(1440*t).toFixed(0):"h"===s?(60*t).toFixed(0):t.toFixed(0)},parseValue:e=>{const t=parseInt(e);return t%10080==0?[(t/10080).toFixed(0),"w"]:t%1440==0?[(t/1440).toFixed(0),"d"]:t%60==0?[(t/60).toFixed(0),"h"]:[t.toFixed(0),"m"]}},this.__renderer=this.__renderItems.bind(this)}static get scopedElements(){return{"vaadin-integer-field":j,"vaadin-custom-field":V,"vaadin-select":b,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{attribute:!1},value:{attribute:!1}})}render(){var e;return u(ke||(ke=Ee` <div class="text-xs text-tertiary font-lumo"> <vaadin-custom-field ?disabled="${0}" .label="${0}" .value="${0}" .i18n="${0}" data-testid="field" id="field" @change="${0}"> <vaadin-integer-field .disabled="${0}" .min="${0}" data-testid="count" has-controls> </vaadin-integer-field> <vaadin-select .disabled="${0}" .renderer="${0}" data-testid="units"> </vaadin-select> </vaadin-custom-field> <br> <x-i18n .lang="${0}" .ns="${0}" .key="${0}" data-testid="error" class="${0}"> </x-i18n> </div> `),this.disabled||!this._isI18nReady,this._isI18nReady?this._t("session.title").toString():"---",this._isI18nReady?this.value.toString():"",this.__customFieldI18n,this.__handleChange,this.disabled||!this._isI18nReady,1,this.disabled||!this._isI18nReady,this._isI18nReady?this.__renderer:null,this.lang,this.ns,this._t(`session.${null!==(e=this.__errorMessage)&&void 0!==e?e:"subtitle"}`).toString(),q({"text-error":null!==this.__errorMessage&&!this.disabled}))}firstUpdated(){this.shadowRoot.getElementById("field").value=this.value.toString()}updated(e){e.has("value")&&this.__reportValidity()}__renderItems(e){let t=e.querySelector("vaadin-list-box");null===t&&(t=document.createElement("vaadin-list-box"),e.appendChild(t));const s=["m","h","d","w"],i=["minute_plural","hour_plural","d_plural","w_plural"],a=t.querySelectorAll("vaadin-item");for(let e=0;e<Math.max(s.length,a.length);++e)if(s[e]){let n;a[e]?n=a[e]:(n=document.createElement("vaadin-item"),t.appendChild(n)),n.value=s[e],n.textContent=this._t(i[e])}else a[e].remove()}__handleChange(e){e.stopPropagation(),this.value=parseInt(e.target.value),this.dispatchEvent(new Ce({value:this.value,invalid:!this.__reportValidity()}))}__reportValidity(){return this.__errorMessage=this.value<1?"too_short":this.value>40320?"too_long":null,this.requestUpdate(),null===this.__errorMessage}}let Re,Ie=e=>e;class je extends CustomEvent{constructor(e){super("change",{detail:e})}}class Ve extends v{constructor(){super(...arguments),this.disabled=!1,this.value="",this.__errorMessage=""}static get scopedElements(){return{"vaadin-password-field":N,"vaadin-button":d,"iron-icon":customElements.get("iron-icon"),"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{attribute:!1},value:{attribute:!1}})}render(){const e=""!==this.__errorMessage&&!this.disabled,t=e?this._t(`jwt.${this.__errorMessage}`).toString():"";return u(Re||(Re=Ie` <div class="space-y-xs"> <div class="flex items-start"> <vaadin-password-field .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" .label="${0}" data-testid="input" class="w-full" @change="${0}" @input="${0}"> </vaadin-password-field> <vaadin-button class="flex-shrink-0 ml-s" style="margin-top:calc(var(--lumo-font-size-s) * 1.5)" theme="error" data-testid="button" .disabled="${0}" @click="${0}"> <x-i18n .lang="${0}" .ns="${0}" key="jwt.refresh"></x-i18n> <iron-icon icon="icons:refresh" slot="suffix"></iron-icon> </vaadin-button> </div> <x-i18n .lang="${0}" .ns="${0}" key="jwt.subtitle" class="text-xs text-tertiary font-lumo"> </x-i18n> </div> `),t,this.disabled||!this._isI18nReady,e,this._isI18nReady?this.value:"",this._isI18nReady?this._t("jwt.title").toString():"---",(e=>e.stopPropagation()),this.__handleInput,this.disabled||!this._isI18nReady,this.__regenerateValue,this.lang,this.ns,this.lang,this.ns)}updated(e){e.has("value")&&this.__reportValidity()}__regenerateValue(){this.__errorMessage="",this.value=ee(72,(()=>Y(35).toString(36))).join(""),this.dispatchEvent(new je({value:this.value,invalid:!1}))}__handleInput(e){this.value=e.target.value,this.dispatchEvent(new je({value:this.value,invalid:!this.__reportValidity()}))}__reportValidity(){var e;return this.__errorMessage=0===this.value.length?"required":this.value.length<40?"too_short":this.value.length>100?"too_long":(e=this.value,/^[a-z0-9-]+$/i.test(e)?"":"invalid"),this.requestUpdate(),""===this.__errorMessage}}function Me(e){return t=>{t.preventDefault(),e(t)}}class qe extends x{}let Ne,Te=e=>e;class De extends v{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=De.defaultValue,this.__items=["y","m","w","d"]}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"vaadin-button":customElements.get("vaadin-button"),"x-dropdown":k}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:String}})}render(){return u(Ne||(Ne=Te` <div class="grid grid-cols-2 gap-s"> <vaadin-integer-field data-testid="value" class="w-full" min="1" has-controls .value="${0}" .disabled="${0}" @change="${0}"> </vaadin-integer-field> <x-dropdown data-testid="units" .disabled="${0}" .getText="${0}" .items="${0}" .value="${0}" @change="${0}"> </x-dropdown> </div> `),this._isI18nReady?this.__numericValue:"",this.disabled,this.__handleNumberChange,this.disabled,(e=>this._isI18nReady?this._t(`${e}_plural`):""),this.__items,this._isI18nReady?this.__unitsValue:"",this.__handleUnitsChange)}get __numericValue(){var e;return M(null!==(e=this.value)&&void 0!==e?e:"").count}get __unitsValue(){var e;return M(null!==(e=this.value)&&void 0!==e?e:"").units}__handleNumberChange(e){e.stopPropagation();const t=e.target.value;this.value=this.value.replace(String(this.__numericValue),t),this.__sendChange()}__handleUnitsChange(e){this.value=this.value.replace(String(this.__unitsValue),e.detail),this.__sendChange()}__sendChange(){this.dispatchEvent(new qe(this.value))}}De.defaultValue="1w";class Ae extends te{}let Ue,Oe,Fe,Le,Be=e=>e;class ze extends v{constructor(){super("customer-portal-settings"),this.value=[],this.disabled=!1,this.__newValue=De.defaultValue}static get scopedElements(){return{"iron-icon":customElements.get("iron-icon"),"vaadin-button":customElements.get("vaadin-button"),"x-frequency-input":De,"x-skeleton":E,"x-list":ne,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const e=this.disabled||!this._isI18nReady||this.value.length>=20;return u(Ue||(Ue=Be` <x-list data-testid="list" .value="${0}" .disabled="${0}" @change="${0}"> ${0} <div class="w-full md-flex"> <x-frequency-input data-testid="input" class="mb-s md-mb-0 md-mr-s" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-input> <vaadin-button data-testid="button" class="w-full md-w-auto" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_option"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> </div> ${0} </x-list> `),this.value,this.disabled||!this._isI18nReady,this.__handleListChange,this.value.map(((e,t)=>this._isI18nReady?u(Oe||(Oe=Be`<span slot="${0}">${0}</span>`),t,this.__getText(e)):u(Fe||(Fe=Be`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this.lang,this.__newValue,e,this.__handleNewValueChange,e,this.__handleSubmit,this.ns,this.lang,this.value.length>0?u(Le||(Le=Be` <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_option_hint" class="${0}"> </x-i18n> `),this.ns,this.lang,q({"block text-xs mt-xs text-center md-text-left":!0,"text-tertiary":this.value.length<20,"text-primary":this.value.length>=20})):"")}__handleNewValueChange(e){this.__newValue=e.detail}__handleListChange(e){this.value=e.detail,this.__sendChange()}__handleSubmit(){this.value=[...this.value,this.__newValue],this.__newValue=De.defaultValue,this.__sendChange()}__sendChange(){this.dispatchEvent(new Ae(this.value))}__getText(e){const t=e[e.length-1],s=parseInt(e.replace(t,""));return this._t("duration",{count:s,units:this._t(t,{count:s})})}}class Pe extends y{}let Qe,Ke,Je=e=>e;class Ge extends v{constructor(){super(...arguments),this.disabled=!1,this.value="*",this.__errorMessage="",this.__items=["all","some"],this.__handleNewValueChange=m((e=>{try{D(e).evaluate({}),this.value=e,this.__errorMessage="",this.__sendChange()}catch(e){this.__errorMessage=e.message}this.requestUpdate()}),275)}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"iron-icon":customElements.get("iron-icon"),"x-choice":$,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:String}})}render(){const e="pl-xs text-primary rounded font-medium cursor-pointer transition duration-200 focus-outline-none focus-shadow-outline hover-underline";return u(Qe||(Qe=Je` <x-choice data-testid="choice" .disabled="${0}" .value="${0}" .items="${0}" @change="${0}"> <x-i18n slot="all-label" .ns="${0}" .lang="${0}" key="jsonata.all"></x-i18n> <x-i18n slot="some-label" .ns="${0}" .lang="${0}" key="jsonata.some"></x-i18n> ${0} </x-choice> `),this.disabled||!this._isI18nReady,this.__choice,this.__items,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.__choice===this.__items[1]?u(Ke||(Ke=Je` <div slot="${0}" class="space-y-s pb-m"> <x-i18n .ns="${0}" .lang="${0}" key="jsonata.hint" class="block font-lumo text-s text-tertiary leading-s"> <a target="_blank" class="${0}" href="https://docs.jsonata.org" rel="noopener noreferrer"> JSONata <iron-icon icon="icons:open-in-new" class="icon-inline"></iron-icon> </a> <a target="_blank" class="${0}" href="https://api.foxycart.com/rels/subscription" rel="noopener noreferrer"> hAPI subscription <iron-icon icon="icons:open-in-new" class="icon-inline"></iron-icon> </a> </x-i18n> <vaadin-text-field class="w-full" data-testid="input" .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" @keydown="${0}" @change="${0}" @input="${0}"> </vaadin-text-field> </div> `),this.__items[1],this.ns,this.lang,e,e,this.__errorMessage,this.disabled||!this._isI18nReady,this.__errorMessage.length>0,this._isI18nReady?this.value:"",this.__stopNavigation,(e=>e.stopPropagation()),(e=>this.__handleNewValueChange(e.target.value))):"")}get __choice(){return this.__items["*"===this.value?0:1]}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?"*":'$contains(frequency, "w")',this.__sendChange()}__stopNavigation(e){e.key.startsWith("Arrow")&&e.stopPropagation()}__sendChange(){this.dispatchEvent(new Pe(this.value))}}class He extends CustomEvent{constructor(e){super("change",{detail:e})}}class We extends CustomEvent{constructor(){super("remove")}}let Ye,Xe,Ze=e=>e;class et extends v{constructor(){super(...arguments),this.open=!1,this.value={jsonataQuery:"*",values:[]},this.disabled=!1}static get scopedElements(){return{"x-frequency-list":ze,"x-jsonata-input":Ge,"iron-icon":customElements.get("iron-icon"),"x-group":T,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{open:{attribute:!1},value:{attribute:!1},disabled:{attribute:!1}})}render(){const{jsonataQuery:e,values:t}=this.value,s=this.open?"":"rounded-b-l";return u(Ye||(Ye=Ze` <x-group frame> <details data-testid="details" class="${0}" ?open="${0}" @toggle="${0}"> <summary class="${0} cursor-pointer relative leading-s rounded-t-l focus-outline-none focus-shadow-outline"> <div class="p-m space-y-xs mr-xl"> <x-i18n .ns="${0}" .lang="${0}" .key="${0}" class="block text-m text-header font-medium"> ${0} </x-i18n> <x-i18n .ns="${0}" .lang="${0}" class="block text-s text-tertiary" key="fmod.valuesLabel"> <x-i18n .ns="${0}" .key="${0}" .lang="${0}" .opts="${0}" class="text-secondary"> </x-i18n> </x-i18n> </div> <button data-testid="remove" .disabled="${0}" class="flex items-center justify-center rounded absolute top-0 right-0 text-tertiary hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" style="width:54px;height:54px" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </summary> <div class="space-y-l pt-m" slot="content"> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="fmod.match"></x-i18n> <x-jsonata-input data-testid="jsonata" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-jsonata-input> </x-group> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="fmod.options"> </x-i18n> <x-frequency-list data-testid="frequency" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-list> </x-group> </div> </details> </x-group> `),q({"font-lumo":!0,"pointer-events-none":!this._isI18nReady}),this.open,(()=>this.open=!this.open),s,this.ns,this.lang,`fmod.${"*"===e?"all":"some"}Title`,"*"!==e?this.__renderJSONataSummary(e):"",this.ns,this.lang,this.ns,"fmod.valuesList"+(0===t.length?"Empty":""),this.lang,{values:t.map((e=>this.__translateFrequency(e)))},this.disabled||!this._isI18nReady,Me((()=>{this.dispatchEvent(new We)})),this.ns,this.lang,this.ns,this.lang,this.value.jsonataQuery,this.disabled||!this._isI18nReady,this.__handleQueryChange,this.ns,this.lang,this.lang,this.value.values,this.disabled||!this._isI18nReady,this.__handleValuesChange)}__translateFrequency(e){if(".5m"===e)return this._t("frequency_0_5m");const{count:t,units:s}=M(e);return this._t("frequency",{units:this._t(s,{count:t}),count:t})}__renderJSONataSummary(e){return u(Xe||(Xe=Ze` <code class="inline-block rounded bg-success-10 text-success px-xs text-xs leading-s"> ${0} </code> `),e)}__handleQueryChange(e){this.value=n(n({},this.value),{},{jsonataQuery:e.detail}),this.__sendChange()}__handleValuesChange(e){this.value=n(n({},this.value),{},{values:e.detail}),this.__sendChange()}__sendChange(){this.dispatchEvent(new He(this.value))}}class tt extends CustomEvent{constructor(e){super("change",{detail:e})}}let st,it,at=e=>e;class nt extends v{constructor(){super(...arguments),this.value=[],this.disabled=!1}static get scopedElements(){return{"x-frequency-modification-rule":et,"vaadin-button":customElements.get("vaadin-button"),"x-section":me,"iron-icon":customElements.get("iron-icon"),"x-group":T,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const{ns:e,lang:t}=this;return u(st||(st=at` <x-section> <x-i18n .ns="${0}" .lang="${0}" key="fmod.title" slot="title" class="text-l"></x-i18n> <x-i18n .ns="${0}" .lang="${0}" key="fmod.subtitle" slot="subtitle" class="mr-xl"></x-i18n> ${0} <div class="mt-m sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="add" theme="primary" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_rule"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="fmod.add_rule_hint" class="${0}"> </x-i18n> </div> </x-section> `),e,t,e,t,this.value.map(((e,t,s)=>u(it||(it=at` <x-frequency-modification-rule data-testid="rule" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @remove="${0}" @change="${0}"> </x-frequency-modification-rule> `),this.disabled,e,this.lang,this.ns,(()=>{this.value=s.filter(((e,s)=>s!==t)),this.__sendChange()}),(e=>{this.value=s.map(((s,i)=>i===t?e.detail:s)),this.__sendChange()})))),this.disabled||this.value.length>=10||!this._isI18nReady,this.__addRule,this.ns,this.lang,this.lang,this.ns,q({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":this.value.length<10,"text-primary":this.value.length>=10,hidden:0===this.value.length}))}__addRule(){this.value=[...this.value,{jsonataQuery:"*",values:[]}],this.__sendChange()}__sendChange(){this.dispatchEvent(new tt(this.value))}}function lt(e,t){const s=(new Date).getFullYear(),i={month:"long",day:"numeric"};return e.split("..").map((e=>{const a=A(e),l=(null==a?void 0:a.getFullYear())===s?void 0:"numeric";return null==a?void 0:a.toLocaleDateString(t,n({year:l},i))})).join(" – ")}class rt extends CustomEvent{constructor(e){super("change",{detail:e})}}let dt,ot,ht,ct=e=>e;class ut extends v{constructor(){super("customer-portal-settings"),this.disabled=!1,this.__items=["all","month","day"]}static get scopedElements(){return{"x-monthday-picker":C,"x-weekday-picker":S,"x-choice":$,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Object}})}render(){var e,t,s,i;return u(dt||(dt=ct` <x-choice data-testid="choice" .value="${0}" .items="${0}" .disabled="${0}" @change="${0}"> <x-i18n slot="all-label" key="ndmod.all" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="month-label" key="ndmod.month" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="day-label" key="ndmod.day" .ns="${0}" .lang="${0}"></x-i18n> ${0} </x-choice> `),null!==(t=null===(e=this.value)||void 0===e?void 0:e.type)&&void 0!==t?t:"all",this.__items,this.disabled,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,"month"===(null===(s=this.value)||void 0===s?void 0:s.type)?u(ot||(ot=ct` <x-monthday-picker slot="month" class="mb-m" data-testid="monthday-picker" .lang="${0}" .disabled="${0}" .value="${0}" @change="${0}"> </x-monthday-picker> `),this.lang,this.disabled||!this._isI18nReady,this.value.days,this.__handleNewValueChange):"day"===(null===(i=this.value)||void 0===i?void 0:i.type)?u(ht||(ht=ct` <x-weekday-picker slot="day" class="mb-m" data-testid="weekday-picker" .lang="${0}" .disabled="${0}" .value="${0}" @change="${0}"> </x-weekday-picker> `),this.lang,this.disabled||!this._isI18nReady,this.value.days,this.__handleNewValueChange):"")}__handleNewValueChange(e){this.value.days=e.detail,this.__sendChange()}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?void 0:e.detail===this.__items[1]?{type:"month",days:[]}:{type:"day",days:[]},this.__sendChange()}__sendChange(){this.dispatchEvent(new rt(this.value))}}class _t extends te{}let gt,pt,vt,mt,xt=e=>e;class yt extends v{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.__startValue="",this.__endValue=""}static get scopedElements(){return{"vaadin-date-picker":O,"vaadin-button":d,"x-skeleton":E,"iron-icon":customElements.get("iron-icon"),"x-i18n":w,"x-list":ne}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const e=this.value.length>=20||this.disabled||!this._isI18nReady;return u(gt||(gt=xt` <x-list data-testid="list" .value="${0}" .disabled="${0}" @change="${0}"> ${0} <div class="sm-flex sm-items-end"> <div class="grid grid-cols-2 gap-s"> <vaadin-date-picker data-testid="start" .label="${0}" .value="${0}" .disabled="${0}" .placeholder="${0}" @change="${0}"> </vaadin-date-picker> <vaadin-date-picker data-testid="end" .min="${0}" .label="${0}" .value="${0}" .disabled="${0}" .placeholder="${0}" clear-button-visible @change="${0}"> </vaadin-date-picker> </div> <vaadin-button .disabled="${0}" data-testid="submit" class="w-full mt-s sm-mt-0 sm-w-auto sm-ml-s" @click="${0}"> <x-i18n .lang="${0}" .key="ndmod.add_${0}" .ns="${0}"> </x-i18n> <iron-icon icon="icons:add" slot="suffix"></iron-icon> </vaadin-button> </div> ${0} </x-list> `),this.value,this.disabled||!this._isI18nReady,this.__handleListChange,this.value.map(((e,t)=>this._isI18nReady?u(pt||(pt=xt`<span slot="${0}" class="truncate">${0}</span>`),t,lt(e,this.lang)):u(vt||(vt=xt`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this._t("ndmod.range_start").toString(),this.__startValue,e,this._isI18nReady?this._t("ndmod.select").toString():"",this.__handleStartValueChange,this.__startValue,this._t("ndmod.range_end").toString(),this.__endValue,e||!this.__startValue,this._isI18nReady?this._t("ndmod.select").toString():"",this.__handleEndValueChange,e||!this.__startValue,this.__submit,this.lang,this.__endValue?"range":"single",this.ns,this.value.length>0?u(mt||(mt=xt` <x-i18n .ns="${0}" .lang="${0}" key="ndmod.add_range_hint" class="${0}"> </x-i18n> `),this.ns,this.lang,q({"block text-xs mt-xs text-center sm-text-left":!0,"text-tertiary":this.value.length<20,"text-primary":this.value.length>=20})):"")}updated(){const e=this.constructor.getScopedTagName("vaadin-date-picker"),t=this.shadowRoot.querySelectorAll(e);Array.from(t).forEach((e=>e.validate()))}__handleStartValueChange(e){e.stopPropagation(),this.__startValue=e.target.value;const t=A(this.__endValue),s=A(this.__startValue);t&&t.getTime()<s.getTime()&&(this.__endValue=""),this.requestUpdate()}__handleEndValueChange(e){e.stopPropagation(),this.__endValue=e.target.value,this.requestUpdate()}__submit(){this.__startValue&&this.__endValue?this.value=[...this.value,[this.__startValue,this.__endValue].join("..")]:this.value=[...this.value,this.__startValue],this.__sendChange(),this.__startValue="",this.__endValue=""}__handleListChange(e){this.value=e.detail,this.__sendChange()}__sendChange(){this.dispatchEvent(new _t(this.value))}}class $t extends CustomEvent{constructor(e){super("change",{detail:e})}}let ft,bt,wt=e=>e;class kt extends v{constructor(){super("customer-portal-settings"),this.disabled=!1,this.type="min",this.__items=["none","custom"]}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"x-frequency-input":De,"x-choice":$,"x-group":T,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:String},type:{type:String}})}render(){return u(ft||(ft=wt` <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="${0}"> </x-i18n> <x-choice data-testid="choice" .disabled="${0}" .value="${0}" .items="${0}" @change="${0}"> <x-i18n slot="none-label" .ns="${0}" .lang="${0}" key="ndmod.none"></x-i18n> <x-i18n slot="custom-label" .ns="${0}" .lang="${0}" key="ndmod.custom"></x-i18n> ${0} </x-choice> </x-group> `),this.ns,this.lang,`ndmod.${this.type}`,this.disabled,this.__choice,this.__items,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.__choice===this.__items[1]?u(bt||(bt=wt` <div slot="${0}" class="space-y-s"> <x-frequency-input data-testid="input" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-input> <p class="text-s text-tertiary leading-s">${0}</p> </div> `),this.__items[1],this.value,this.disabled,this.__handleNewValueChange,this.__hint):"")}get __choice(){return this.__items[this.value?1:0]}get __hint(){var e;if(!this._isI18nReady)return"";const{count:t,units:s}=M(null!==(e=this.value)&&void 0!==e?e:"");return this._t(`ndmod.${this.type}Hint`,{duration:this._t("duration",{count:t,units:this._t(null!=s?s:"",{count:t})})})}__handleNewValueChange(e){this.value=e.detail,this.__sendChange()}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?void 0:"1w",this.__sendChange()}__sendChange(){this.dispatchEvent(new $t(this.value))}}class Et extends CustomEvent{constructor(e){super("change",{detail:e})}}class Ct extends CustomEvent{constructor(){super("remove")}}let St,Rt,It,jt,Vt,Mt,qt,Nt,Tt,Dt=e=>e;class At extends v{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value={jsonataQuery:"*"},this.open=!1}static get scopedElements(){return{"x-disallowed-dates":yt,"x-jsonata-input":Ge,"x-offset-input":kt,"x-allowed-days":ut,"iron-icon":customElements.get("iron-icon"),"x-warning":U,"x-group":T,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Object},open:{type:Boolean}})}render(){const{min:e,max:t,allowedDays:s,jsonataQuery:i,disallowedDates:a}=this.value,l=e||t,r=s&&s.days.length>0,d=a&&a.length>0,o=this.open?"":"rounded-b-l";return u(St||(St=Dt` <x-group frame> <details data-testid="details" class="${0}" ?open="${0}" @toggle="${0}"> <summary class="${0} cursor-pointer relative leading-s rounded-t-l focus-outline-none focus-shadow-outline"> <div class="p-m mr-xl text-m text-header font-medium space-y-s"> <div> <x-i18n .ns="${0}" .lang="${0}" key="${0}"> ${0} </x-i18n> </div> ${0} </div> <button data-testid="remove" .disabled="${0}" class="flex items-center justify-center rounded absolute top-0 right-0 text-tertiary hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" style="width:54px;height:54px" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </summary> <article class="space-y-l"> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.match"> </x-i18n> <x-jsonata-input data-testid="jsonata" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-jsonata-input> </x-group> <div class="flex flex-col md-flex-row"> <div class="mb-l md-mb-0 md-w-1-2 md-border-r md-border-contrast-10"> <x-offset-input data-testid="min" type="min" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-offset-input> </div> <div class="md-w-1-2"> <x-offset-input data-testid="max" type="max" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-offset-input> </div> </div> ${0} <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.allowed"> </x-i18n> <x-allowed-days data-testid="allowed" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-allowed-days> </x-group> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.excluded"> </x-i18n> <x-disallowed-dates data-testid="disallowed" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-disallowed-dates> </x-group> </article> </details> </x-group> `),q({"font-lumo":!0,"pointer-events-none":!this._isI18nReady}),this.open,(()=>this.open=!this.open),o,this.ns,this.lang,`ndmod.${"*"===i?"all":"some"}Title`,"*"!==i?this.__renderJSONataSummary(i):"",l||r||d?u(Rt||(Rt=Dt` <div> ${0} </div> `),R(l&&this.__renderMinMaxSummary(e,t),r&&this.__renderAllowedSummary(s),d&&this.__renderDisallowedSummary(a))):"",this.disabled||!this._isI18nReady,Me((()=>this.dispatchEvent(new Ct))),this.ns,this.lang,this.ns,this.lang,i,this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{jsonataQuery:e.detail}),this.__sendUpdate()}),this.lang,e,this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{min:e.detail}),this.__sendUpdate()}),this.lang,t,this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{max:e.detail}),this.__sendUpdate()}),-1===this.__compareDurations(e,t)?u(It||(It=Dt` <x-warning class="mx-m" data-testid="warning"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.minWarning"> </x-i18n> </x-warning> `),this.ns,this.lang):"",this.ns,this.lang,this.lang,s,this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{allowedDays:e.detail}),this.__sendUpdate()}),this.ns,this.lang,this.ns,this.lang,null!=a?a:[],this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{disallowedDates:e.detail}),this.__sendUpdate()}))}__sendUpdate(){this.dispatchEvent(new Et(this.value))}__getEstimatedDaysFrom(e){const{count:t,units:s}=M(e);return t*{y:365,m:31,w:7,d:1}[s]}__compareDurations(e,t){return e===t?0:e&&t?this.__getEstimatedDaysFrom(e)<this.__getEstimatedDaysFrom(t)?1:-1:1}__renderJSONataSummary(e){return u(jt||(jt=Dt` <code class="inline-block rounded bg-success-10 text-success px-xs text-xs leading-s"> ${0} </code> `),e)}__renderMinMaxContent(e){if(e){const{count:t,units:s}=e;return u(Vt||(Vt=Dt` ${0} <x-i18n .ns="${0}" .lang="${0}" key="${0}" .opts="${0}"></x-i18n> `),t,this.ns,this.lang,s,{count:t})}return u(Mt||(Mt=Dt`<x-i18n .ns="${0}" .lang="${0}" key="ndmod.any"></x-i18n>`),this.ns,this.lang)}__renderMinMaxSummary(e,t){return u(qt||(qt=Dt` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.range"> <span>:</span> <span class="text-secondary"> ${0} &mdash; ${0} </span> </x-i18n> </div> `),this.ns,this.lang,this.__renderMinMaxContent(e?M(e):void 0),this.__renderMinMaxContent(t?M(t):void 0))}__renderAllowedSummary({type:e,days:t}){return u(Nt||(Nt=Dt` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.allowed"> <span>:</span> <span class="text-secondary"> ${0} ${0} </span> </x-i18n> </div> `),this.ns,this.lang,"month"===e?t.join(", "):"","day"===e?t.map((e=>I(e,this.lang,"short"))).join(", "):"")}__renderDisallowedSummary(e){return u(Tt||(Tt=Dt` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.excluded"> <span>:</span> <span class="text-secondary"> ${0} </span> </x-i18n> </div> `),this.ns,this.lang,e.map((e=>lt(e,this.lang))).join("; "))}}class Ut extends CustomEvent{constructor(e){super("change",{detail:e})}}let Ot,Ft,Lt,Bt=e=>e;class zt extends v{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=!1}static get scopedElements(){return{"x-next-date-modification-rule":At,"vaadin-button":customElements.get("vaadin-button"),"x-section":me,"iron-icon":customElements.get("iron-icon"),"x-switch":fe,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Array}})}render(){const e=!this._isI18nReady||this.disabled||!this.value||Array.isArray(this.value)&&this.value.length>=10;return u(Ot||(Ot=Bt` <x-section> <x-switch slot="title" class="-my-xs" data-testid="toggle" .checked="${0}" .disabled="${0}" @change="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.title" class="text-l"></x-i18n> </x-switch> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.subtitle" slot="subtitle" class="mr-xl"> </x-i18n> ${0} <div class="mt-m sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="add" theme="primary" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.add"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="ndmod.add_hint" class="${0}"> </x-i18n> </div> </x-section> `),Boolean(this.value),this.disabled||!this._isI18nReady,this.__toggleValue,this.ns,this.lang,this.ns,this.lang,this.value?u(Ft||(Ft=Bt` ${0} `),this.__normalizedValue.map(((e,t,s)=>u(Lt||(Lt=Bt` <x-next-date-modification-rule data-testid="rule" .disabled="${0}" .value="${0}" .lang="${0}" @remove="${0}" @change="${0}"> </x-next-date-modification-rule> `),this.disabled||!this._isI18nReady,e,this.lang,(()=>{this.value=s.filter(((e,s)=>s!==t)),this.__sendChange()}),(e=>{this.value=s.map(((s,i)=>i===t?e.detail:s)),this.__sendChange()}))))):"",e,this.__addRule,this.ns,this.lang,this.lang,this.ns,q({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":Array.isArray(this.value)&&this.value.length<10,"text-primary":Array.isArray(this.value)&&this.value.length>=10,hidden:!Array.isArray(this.value)||0===this.value.length}))}get __normalizedValue(){return"boolean"==typeof this.value?[]:this.value}__addRule(){this.value=[...this.__normalizedValue,{jsonataQuery:"*"}],this.__sendChange()}__toggleValue(){this.value=!this.value,this.__sendChange()}__sendChange(){this.dispatchEvent(new Ut(this.value))}}class Pt extends te{}let Qt,Kt,Jt,Gt=e=>e;class Ht extends v{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.__errorCode="invalid",this.__invalid=!1,this.__newValue=""}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-button":customElements.get("vaadin-button"),"x-skeleton":E,"iron-icon":customElements.get("iron-icon"),"x-group":T,"x-list":ne,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},invalid:{type:Boolean},disabled:{type:Boolean}})}render(){return u(Qt||(Qt=Gt` <x-group frame> <x-list data-testid="list" .disabled="${0}" .value="${0}" @change="${0}"> ${0} <div class="flex flex-col sm-flex-row sm-items-start"> <vaadin-text-field data-testid="input" class="mb-s sm-mb-0 sm-mr-s" .placeholder="${0}" .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" @keypress="${0}" @change="${0}" @input="${0}"> </vaadin-text-field> <div class="sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="button" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="origins.add"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="origins.add_hint" class="${0}"> </x-i18n> </div> </div> </x-list> </x-group> `),this.disabled||!this._isI18nReady,this.value,this.__handleChange,this.value.map(((e,t)=>this._isI18nReady?u(Kt||(Kt=Gt` <div class="flex items-center" slot="${0}"> <img height="16" width="16" class="mr-m" src="https://www.google.com/s2/favicons?domain=${0}"> ${0} </div> `),t,e,e):u(Jt||(Jt=Gt`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this._isI18nReady?"https://foxy.io":"",this._t(`origins.${this.__errorCode}`).toString(),this.disabled||!this._isI18nReady,this.__invalid,this.__newValue,(e=>"Enter"===e.key&&this.__submit()),(e=>e.stopPropagation()),this.__handleInput,!this._isI18nReady||this.disabled||this.__invalid||this.value.length>=10,this.__submit,this.ns,this.lang,this.lang,this.ns,q({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":this.value.length<10,"text-primary":this.value.length>=10,hidden:0===this.value.length}))}__sendChange(){this.dispatchEvent(new Pt(this.value))}__handleInput(e){this.__newValue=e.target.value;try{const e=new URL(this.__newValue),t="https:"===e.protocol,s="localhost"===e.hostname;this.__invalid=!s&&!t,this.__errorCode="https_only"}catch(e){this.__invalid=this.__newValue.length>0,this.__errorCode="invalid"}this.requestUpdate()}__submit(){this.__newValue.length>0&&(this.value=[...this.value,new URL(this.__newValue).origin],this.__newValue="",this.__invalid=!1,this.__sendChange()),this.requestUpdate()}__handleChange(e){this.value=e.detail,this.__sendChange()}}class Wt extends CustomEvent{constructor(e){super("change",{detail:e})}}let Yt,Xt=e=>e;class Zt extends v{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=!1}static get scopedElements(){return{"x-section":me,"x-switch":fe,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Array}})}render(){return u(Yt||(Yt=Xt` <x-section> <x-switch slot="title" class="-my-xs" data-testid="toggle" .checked="${0}" .disabled="${0}" @change="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="sso.title" class="text-l"></x-i18n> </x-switch> <x-i18n .ns="${0}" .lang="${0}" key="sso.subtitle" slot="subtitle" class="mr-xl"> </x-i18n> </x-section> `),Boolean(this.value),this.disabled||!this._isI18nReady,this.__toggleValue,this.ns,this.lang,this.ns,this.lang)}__toggleValue(){this.value=!this.value,this.__sendChange()}__sendChange(){this.dispatchEvent(new Wt(this.value))}}const es=f.assign({error:(e,t)=>t.data.type}),ts=f.assign({oldResource:(e,t)=>t.data.resource,newResource:(e,t)=>t.data.resource,store:(e,t)=>t.data.store}),ss=f.assign({oldResource:e=>e.newResource}),is=f.assign({invalid:[],newResource:({oldResource:e})=>e}),as=f.assign({invalid:[],newResource:e=>({allowedOrigins:[],subscriptions:{allowFrequencyModification:[],allowNextDateModification:!1},jwtSharedSecret:ee(72,(()=>Y(35).toString(36))).join(""),sessionLifespanInMinutes:40320,signUp:{enabled:!1,verification:{type:"hcaptcha",siteKey:"",secretKey:""}},sso:!1,date_created:(new Date).toISOString(),date_modified:(new Date).toISOString(),_links:{"fx:store":e.store._links.self,curies:e.store._links.curies,self:e.store._links["fx:customer_portal_settings"]}})}),ns=f.assign({newResource:null}),ls=f.assign({error:"setup_needed"}),rs=f.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{allowedOrigins:s})}}),ds=f.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{subscriptions:n(n({},e.subscriptions),{},{allowFrequencyModification:s})})}}),os=f.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{subscriptions:n(n({},e.subscriptions),{},{allowNextDateModification:s})})}}),hs=f.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{signUp:s})}}),cs=f.assign({invalid:(e,t)=>{const s="sessionLifespanInMinutes",i=t.invalid;return e.invalid.filter((e=>e!==s)).concat(...i?[s]:[])},newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{sessionLifespanInMinutes:s})}}),us=f.assign({invalid:(e,t)=>{const s="jwtSharedSecret",i=t.invalid;return e.invalid.filter((e=>e!==s)).concat(...i?[s]:[])},newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{jwtSharedSecret:s})}}),_s=f.assign({oldResource:null,newResource:null,store:null,error:null,href:(e,t)=>t.data}),gs=f.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{sso:s})}}),ps={SET_SSO:{target:"#cps.idle",actions:"setSSO"},SET_SECRET:{target:"#cps.idle",actions:"setSecret"},SET_ORIGINS:{target:"#cps.idle",actions:"setOrigins"},SET_SESSION:{target:"#cps.idle",actions:"setSession"},SET_SIGN_UP:{target:"#cps.idle",actions:"setSignUp"},SET_FREQUENCY_MODIFICATION:{target:"#cps.idle",actions:"setFrequencyModification"},SET_NEXT_DATE_MODIFICATION:{target:"#cps.idle",actions:"setNextDateModification"}},vs={initial:"unknown",states:{unknown:{always:[{target:"invalid",cond:"isInvalid"},{target:"valid"}]},invalid:{},valid:{}}},ms=l({id:"cps",initial:"unknown",context:{oldResource:null,newResource:null,invalid:[],store:null,error:null,href:null},states:{unknown:{always:[{target:"error",cond:"isSetupNeeded",actions:"requireSetup"},{target:"idle",cond:"isLoaded"},{target:"busy"}]},error:{on:{RELOAD:{target:"busy.loading"}}},busy:{initial:"loading",states:{loading:{invoke:{src:"load",onDone:{target:"#cps.idle.clean",actions:"handleLoadingSuccess"},onError:{target:"#cps.error",actions:"handleError"}}},saving:{invoke:{src:"save",onDone:{target:"#cps.idle.clean",actions:"handleSavingSuccess"},onError:{target:"#cps.error",actions:"handleError"}}}}},idle:{initial:"unknown",on:{DISABLE:{target:"#cps.idle",actions:"remove"},ENABLE:{target:"#cps.idle",actions:"create"},RESET:{target:"#cps.idle",actions:"reset"}},states:{unknown:{always:[{target:"clean",cond:"isClean"},{target:"dirty"}]},clean:{initial:"unknown",states:{unknown:{always:[{target:"enabled",cond:"isEnabled"},{target:"disabled"}]},enabled:{on:ps},disabled:{}}},dirty:{on:{SAVE:"#cps.busy.saving"},initial:"unknown",states:{unknown:{always:[{target:"created",cond:"isCreated"},{target:"deleted",cond:"isDeleted"},{target:"updated"}]},created:n({on:ps},vs),updated:n({on:ps},vs),deleted:{}}}}}},on:{SET_HREF:{actions:"setHref",target:"unknown"}}},{guards:{isClean:e=>r(e.newResource,e.oldResource),isLoaded:e=>null!==e.store,isInvalid:e=>e.invalid.length>0,isEnabled:e=>null!==e.oldResource,isCreated:e=>null===e.oldResource&&null!==e.newResource,isDeleted:e=>null!==e.oldResource&&null===e.newResource,isSetupNeeded:e=>null===e.href},actions:{setFrequencyModification:ds,setNextDateModification:os,setOrigins:rs,setSession:cs,setSecret:us,setSignUp:hs,setHref:_s,setSSO:gs,handleLoadingSuccess:ts,handleSavingSuccess:ss,handleError:es,create:as,reset:is,remove:ns,requireSetup:ls}});class xs extends CustomEvent{constructor(e){super("change",{detail:e})}}let ys,$s,fs=e=>e;class bs extends v{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=void 0}static get scopedElements(){return{"vaadin-password-field":N,"x-section":me,"x-switch":fe,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Object}})}render(){var e,t,s;return u(ys||(ys=fs` <x-section> <x-switch data-testid="toggle" class="-my-xs" slot="title" .disabled="${0}" .checked="${0}" @change="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="sign_up.title" class="text-l"></x-i18n> </x-switch> <x-i18n class="mr-xl" slot="subtitle" key="sign_up.subtitle" .lang="${0}" .ns="${0}"> </x-i18n> ${0} </x-section> `),this.disabled||!this._isI18nReady,this.__normalizedValue.enabled,(()=>{const e=this.__normalizedValue;e.enabled=!e.enabled,e.enabled||(e.verification.siteKey="",e.verification.secretKey=""),this.value=e,this.requestUpdate(),this.__sendChange()}),this.ns,this.lang,this.lang,this.ns,(null===(e=this.__normalizedValue)||void 0===e?void 0:e.enabled)?u($s||($s=fs` <div class="grid gap-m sm-grid-cols-2"> <vaadin-password-field .placeholder="${0}" .disabled="${0}" .value="${0}" .label="${0}" autocomplete="off" data-testid="site-key" @change="${0}" @input="${0}"> </vaadin-password-field> <vaadin-password-field .placeholder="${0}" .disabled="${0}" .value="${0}" .label="${0}" autocomplete="off" data-testid="secret-key" @change="${0}" @input="${0}"> </vaadin-password-field> <x-i18n class="sm-col-span-2 text-s text-secondary" lang="${0}" key="sign_up.hcaptcha_explainer" ns="${0}"> </x-i18n> </div> `),this._isI18nReady?this._t("sign_up.site_key_placeholder").toString():"---",this.disabled||!this._isI18nReady,this._isI18nReady?null===(t=this.value)||void 0===t?void 0:t.verification.siteKey:"",this._isI18nReady?this._t("sign_up.site_key_label").toString():"---",(e=>e.stopPropagation()),(e=>{const t=this.__normalizedValue;t.verification.siteKey=e.target.value,this.value=t,this.requestUpdate(),this.__sendChange()}),this._isI18nReady?this._t("sign_up.secret_key_placeholder").toString():"---",this.disabled||!this._isI18nReady,this._isI18nReady?null===(s=this.value)||void 0===s?void 0:s.verification.secretKey:"",this._isI18nReady?this._t("sign_up.secret_key_label").toString():"---",(e=>e.stopPropagation()),(e=>{const t=this.__normalizedValue;t.verification.secretKey=e.target.value,this.value=t,this.requestUpdate(),this.__sendChange()}),this.lang,this.ns):"")}get __normalizedValue(){return this.value?F(this.value):{verification:{type:"hcaptcha",siteKey:"",secretKey:""},enabled:!1}}__sendChange(){this.dispatchEvent(new xs(this.value))}}let ws,ks,Es,Cs,Ss=e=>e;function Rs(e){if(!e.ok)throw new h(401===e.status?"unauthorized":"unknown")}class Is extends CustomEvent{constructor(){super("ready")}}class js extends CustomEvent{constructor(){super("update")}}class Vs extends v{constructor(){super("customer-portal-settings"),this.rel="customer_portal_settings",this.__machine=ms.withConfig({services:{load:()=>this.__load(),save:()=>this.__save()}}),this.__service=L(this.__machine).onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}static get scopedElements(){return{"iron-icon":customElements.get("iron-icon"),"vaadin-button":customElements.get("vaadin-button"),"x-frequency-modification":nt,"x-next-date-modification":zt,"x-session-duration":Se,"x-session-secret":Ve,"x-loading-screen":oe,"x-error-screen":o,"x-origins-list":Ht,"x-sso-switch":Zt,"x-skeleton":E,"x-section":me,"x-sign-up":bs,"x-switch":fe,"x-i18n":w,"x-page":_e}}static get properties(){return n(n({},super.properties),{},{href:{type:String,noAccessor:!0}})}get href(){return this.__service.state.context.href}set href(e){this.__service.send({type:"SET_HREF",data:e})}render(){var e,t,s,i,a,l;if(this.__service.state.matches("error"))return u(ws||(ws=Ss` <x-error-screen data-testid="error" lang="${0}" type="${0}" reload @reload="${0}"> </x-error-screen> `),this.lang,this.__service.state.context.error,this.__reload);const{newResource:r}=this.__service.state.context,d=this.__service.state.matches("idle.dirty.created"),o=this.__service.state.matches("idle.dirty.deleted"),h=this.__service.state.matches("idle.dirty.updated"),c=this.__service.state.matches("idle.clean.enabled"),_=this.__service.state.matches("idle.dirty.updated.invalid")||this.__service.state.matches("idle.dirty.created.invalid");return u(ks||(ks=Ss` <x-page class="relative"> <x-switch slot="title" data-testid="switch" .disabled="${0}" .checked="${0}" @change="${0}"> <x-i18n key="title" class="text-xxl" .ns="${0}" .lang="${0}"> <sup class="text-tertiary"> <x-i18n key="beta" .ns="${0}" .lang="${0}"> </x-i18n> </sup> </x-i18n> </x-switch> <x-i18n class="block mr-xl" slot="subtitle" key="subtitle" .ns="${0}" .lang="${0}"> </x-i18n> <x-section> <x-i18n slot="title" key="origins.title" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="subtitle" key="origins.subtitle" .ns="${0}" .lang="${0}"></x-i18n> <x-origins-list data-testid="origins" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-origins-list> </x-section> <x-frequency-modification data-testid="fmod" .lang="${0}" .ns="${0}" .value="${0}" ?disabled="${0}" @change="${0}"> </x-frequency-modification> <x-next-date-modification data-testid="ndmod" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-next-date-modification> <x-sso-switch data-testid="sso" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-sso-switch> <x-sign-up data-testid="signup" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @change="${0}"> </x-sign-up> <x-section> <x-i18n slot="title" key="advanced.title" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="subtitle" key="advanced.subtitle" .ns="${0}" .lang="${0}"> </x-i18n> <x-session-duration data-testid="session" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @change="${0}"> </x-session-duration> <x-session-secret data-testid="secret" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @change="${0}"> </x-session-secret> </x-section> ${0} </x-page> `),!this.__service.state.matches("idle")||!this._isI18nReady,c||d||h,(e=>{this.__service.send(e.detail?"ENABLE":"DISABLE")}),this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.lang,this.ns,null!==(e=null==r?void 0:r.allowedOrigins)&&void 0!==e?e:[],!r,(e=>{this.__service.send({type:"SET_ORIGINS",value:e.detail})}),this.lang,this.ns,null!==(t=null==r?void 0:r.subscriptions.allowFrequencyModification)&&void 0!==t?t:[],!r,(e=>{this.__service.send({type:"SET_FREQUENCY_MODIFICATION",value:e.detail})}),this.lang,this.ns,null!==(s=null==r?void 0:r.subscriptions.allowNextDateModification)&&void 0!==s&&s,!r,(e=>{this.__service.send({type:"SET_NEXT_DATE_MODIFICATION",value:e.detail})}),this.lang,this.ns,null!==(i=null==r?void 0:r.sso)&&void 0!==i&&i,!r,(e=>{this.__service.send({type:"SET_SSO",value:e.detail})}),!r,null==r?void 0:r.signUp,this.lang,this.ns,(e=>{this.__service.send({type:"SET_SIGN_UP",value:e.detail})}),this.ns,this.lang,this.ns,this.lang,!r||!this._isI18nReady,null!==(a=null==r?void 0:r.sessionLifespanInMinutes)&&void 0!==a?a:1,this.lang,this.ns,(({detail:e})=>{this.__service.send(n({type:"SET_SESSION"},e))}),!r||!this._isI18nReady,null!==(l=null==r?void 0:r.jwtSharedSecret)&&void 0!==l?l:"",this.lang,this.ns,(({detail:e})=>{this.__service.send(n({type:"SET_SECRET"},e))}),this.__service.state.matches("idle.dirty")?u(Es||(Es=Ss` <div class="sticky flex justify-between rounded-t-l rounded-b-l shadow-m -mx-s p-s bg-contrast" style="bottom:var(--lumo-space-m)"> <vaadin-button data-testid="save" theme="primary ${0}" .disabled="${0}" @click="${0}"> <x-i18n lang="${0}" ns="${0}" key="save_${0}"> </x-i18n> </vaadin-button> <vaadin-button style="--lumo-contrast:var(--lumo-base-color)" data-testid="reset" theme="contrast tertiary" @click="${0}"> <x-i18n lang="${0}" key="undo_all"></x-i18n> <iron-icon icon="lumo:reload" slot="suffix"></iron-icon> </vaadin-button> </div> `),o?"error":"success",_,(()=>this.__service.send("SAVE")),this.lang,this.ns,d?"create":o?"delete":"update",(()=>this.__service.send("RESET")),this.lang):this.__service.state.matches("busy")?u(Cs||(Cs=Ss`<x-loading-screen data-testid="loading" class="mt-0"></x-loading-screen>`)):"")}async __reload(){this.__service.stop(),this.__service.onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}async __load(){if(null===this.href)throw new h("setup_needed");try{await this.updateComplete;const e=await we.emit({source:this,init:[this.href]});let t,s;if(e.status.toString().startsWith("4")){t=null;const e=await we.emit({source:this,init:["/"]});Rs(e);const i=(await e.json())._links["fx:store"].href,a=await we.emit({source:this,init:[i]});Rs(a),s=await a.json()}else{Rs(e),t=await e.json();const i=t._links["fx:store"].href,a=await we.emit({source:this,init:[i]});Rs(a),s=await a.json()}return{store:s,resource:t}}catch(e){if(e instanceof h)throw e;if(e instanceof be)throw new h("setup_needed");throw new h("unknown")}finally{await this.updateComplete,this.dispatchEvent(new Is)}}async __save(){try{const e=this.__service.state.context,t=F(e.newResource),s=t?"PUT":"DELETE";t&&(delete t._links,delete t.date_created,delete t.date_modified);const i={method:s,body:t?JSON.stringify(t):void 0};Rs(await we.emit({source:this,init:[this.href,i]}))}catch(e){if(e instanceof h)throw e;if(e instanceof be)throw new h("setup_needed");throw new h("unknown")}finally{await this.updateComplete,this.dispatchEvent(new js)}}}customElements.define("foxy-customer-portal-settings",Vs);export{Vs as CustomerPortalSettings};
1
+ import{d as e,an as t,ag as s,ai as i,ao as a,_ as n,ap as l,aq as r}from"./shared-1522d76f.js";import"./shared-902b0773.js";import{B as d}from"./shared-cadbb2e3.js";import{E as o,F as h}from"./shared-213c60d3.js";import"./shared-d28b95c6.js";import"./shared-5407617a.js";import{L as c,h as u,c as _}from"./shared-7f33a83a.js";import{z as g,w as p,x as v,A as m}from"./shared-550f9cae.js";import{D as x,a as y,C as $,b as f}from"./shared-1e3d7d40.js";import"./shared-c37707da.js";import{a as b,I as w,D as k,S as E,M as C,W as S,c as R,t as I}from"./shared-be8c90cc.js";import"./shared-df8380e1.js";import"./shared-2d40129d.js";import{I as j}from"./shared-19732959.js";import{C as V}from"./shared-87f81b69.js";import"./shared-c36477d7.js";import{p as M}from"./shared-8d51eaa6.js";import"./shared-ac62d098.js";import{c as q}from"./shared-4e709717.js";import"./shared-31b7a6ad.js";import{P as N}from"./shared-ee54f718.js";import{G as T}from"./shared-2b68c60f.js";import{j as D}from"./shared-250a399a.js";import{p as A}from"./shared-43e2c3f6.js";import{W as U}from"./shared-eaceb493.js";import{D as O}from"./shared-69c67952.js";import{c as F}from"./shared-3d251e6f.js";import{i as L}from"./shared-eb116b3e.js";import"./shared-1c07b1be.js";import"./shared-61ade33e.js";import"./shared-533c0d6a.js";import"./shared-30cbf0a6.js";import"./shared-11c2efc8.js";import"./shared-07e9d1fb.js";import"./shared-343d1fd7.js";import"./shared-b23c903e.js";import"./shared-d3bf9ac0.js";import"./shared-f1ee9bf9.js";import"./shared-a26d7f7a.js";import"./shared-db306674.js";var B=1/0,z=17976931348623157e292;function P(e){return e?(e=g(e))===B||e===-B?(e<0?-1:1)*z:e==e?e:0:0===e?e:0}function Q(e){return e}var K=Math.floor,J=Math.random;var G=parseFloat,H=Math.min,W=Math.random;function Y(a,n,l){if(l&&"boolean"!=typeof l&&function(a,n,l){if(!e(l))return!1;var r=typeof n;return!!("number"==r?t(l)&&s(n,l.length):"string"==r&&n in l)&&i(l[n],a)}(a,n,l)&&(n=l=void 0),void 0===l&&("boolean"==typeof n?(l=n,n=void 0):"boolean"==typeof a&&(l=a,a=void 0)),void 0===a&&void 0===n?(a=0,n=1):(a=P(a),void 0===n?(n=a,a=0):n=P(n)),a>n){var r=a;a=n,n=r}if(l||a%1||n%1){var d=W();return H(a+d*(n-a+G("1e-"+((d+"").length-1))),n)}return function(e,t){return e+K(J()*(t-e+1))}(a,n)}var X=4294967295,Z=Math.min;function ee(e,t){if(e=function(e){var t=P(e),s=t%1;return t==t?s?t-s:t:0}(e),e<1||e>9007199254740991)return[];var s,i=X,n=Z(e,X);e-=X;for(var l=a(n,t="function"==typeof(s=t)?s:Q);++i<e;)t(i);return l}class te extends CustomEvent{constructor(e){super("change",{detail:e})}}let se,ie,ae=e=>e;class ne extends c{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.getText=e=>e}static get properties(){return n(n({},super.properties),{},{value:{type:Array},disabled:{type:Boolean},getText:{type:Object}})}static get styles(){return p.styles}render(){return u(se||(se=ae` <div class="font-lumo text-m w-full"> <ul> ${0} </ul> <div class="p-m"> <slot></slot> </div> </div> `),this.value.map(((e,t)=>u(ie||(ie=ae` <li class="${0}"> <slot name="${0}">${0}</slot> <button ?disabled="${0}" class="w-l h-l rounded text-tertiary transition duration-150 hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </li> `),"ml-m h-l text-body flex justify-between items-center"+(t>0?" border-t border-contrast-10":""),t,this.getText(e),this.disabled,(()=>this.__remove(t))))))}__remove(e){this.value=this.value.filter(((t,s)=>s!==e)),this.dispatchEvent(new te(this.value))}}let le,re,de=e=>e;class oe extends c{static get styles(){return[p.styles,_(le||(le=de`:host{position:absolute;top:0;right:0;bottom:0;left:0}.top-center{top:calc(50% - (var(--lumo-size-xl)/ 2))}@keyframes dash0{from{transform:translate(0,0)}to{transform:translate(5.681301px,3.368302px)}}@keyframes dash1{from{transform:translate(0,0)}to{transform:translate(5.677051px,3.457428px)}}@keyframes dash2{from{transform:translate(0,0)}to{transform:translate(5.686002px,3.127455px)}}@keyframes dash3{from{transform:translate(-5.6842px,-3.404556px)}to{transform:translate(0,0)}}`))]}render(){return u(re||(re=de` <div class="h-full bg-base text-primary"> <svg xmlns="http://www.w3.org/2000/svg" class="fill-current w-xl h-xl mx-auto sticky top-center" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" viewBox="0 0 64 64"> <path id="ew5fy7afo2w2" fill-rule="evenodd" stroke="none" stroke-width="1" d="M41.93 49.46c0 .18-.2.3-.36.2l-1.78-1.07-22.73-13.76a1.5 1.5 0 01-.7-1.3V11.08c0-.18.2-.3.36-.2l1.75 1.04c.44.25.74.75.74 1.32v19.27c0 .08.05.16.12.2L41.22 46c.47.28.73.8.72 1.32v2.15z" clip-rule="evenodd"/> <path id="ew5fy7afo2w3" fill-rule="evenodd" stroke="none" stroke-width="1" d="M47.64 52.9c0 .2-.2.3-.36.21l-1.8-1.08c-.42-.26-.7-.74-.7-1.3v-19.3a.24.24 0 00-.12-.2L25.27 19.47a.24.24 0 00-.37.21v12.55c0 .19-.21.3-.37.2l-1.76-1.06a1.46 1.46 0 01-.71-1.28V16.7c0-.54.27-1.03.71-1.3.45-.27 1-.26 1.44 0l22.72 13.77c.44.26.7.76.7 1.3v20.27l.01 2.17z" clip-rule="evenodd"/> <g style="animation:dash0 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w4" fill-rule="evenodd" stroke="none" stroke-width="1" d="M30.59 35.68c0 .2-.21.3-.37.21l-1.8-1.1c-.41-.27-.68-.74-.68-1.28V27v-2.15c0-.2.2-.3.37-.21l1.78 1.06c.42.26.7.74.7 1.3v8.68z" clip-rule="evenodd"/> </g> <g style="animation:dash1 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w5" fill-rule="evenodd" stroke="none" stroke-width="1" d="M36.28 39.13c0 .2-.2.3-.37.21l-1.79-1.1c-.41-.25-.69-.73-.69-1.28v-6.51-2.16c0-.2.2-.31.37-.21l1.76 1.06c.44.26.73.75.73 1.3v8.69z" clip-rule="evenodd"/> </g> <g style="animation:dash2 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w6" fill-rule="evenodd" stroke="none" stroke-width="1" d="M41.96 42.57c0 .2-.2.3-.37.21L39.8 41.7a1.52 1.52 0 01-.71-1.3v-6.51-2.17c0-.2.2-.31.37-.21l1.74 1.06c.45.25.75.75.75 1.32v8.68z" clip-rule="evenodd"/> </g> <g transform="translate(-5.68 -3.4)" style="animation:dash3 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w7" fill-rule="evenodd" stroke="none" stroke-width="1" d="M30.59 35.68c0 .2-.21.3-.37.21l-1.8-1.1c-.41-.27-.68-.74-.68-1.28V27v-2.15c0-.2.2-.3.37-.21l1.78 1.06c.42.26.7.74.7 1.3v8.68z" clip-rule="evenodd"/> </g> </svg> </div> `))}}let he,ce,ue=e=>e;class _e extends c{static get styles(){return[p.styles,_(he||(he=ue`::slotted(:not([slot])){margin-top:var(--lumo-space-xl)}`))]}render(){return u(ce||(ce=ue` <article class="relative antialiased font-lumo"> <header class="space-y-xs leading-s"> <h1 class="font-medium text-header text-xl border-b border-contrast-10 pb-s mb-s"> <slot name="title"></slot> </h1> <p class="text-l text-secondary"> <slot name="subtitle"></slot> </p> </header> <slot></slot> </article> `))}}let ge,pe,ve=e=>e;class me extends _e{static get styles(){return[super.styles,_(ge||(ge=ve`::slotted(:not([slot])){margin-top:var(--lumo-space-m)}`))]}render(){return u(pe||(pe=ve` <section class="leading-s antialiased font-lumo"> <header> <h2 class="text-header font-medium text-l"> <slot name="title"></slot> </h2> <p class="text-secondary text-m"> <slot name="subtitle"></slot> </p> </header> <slot></slot> </section> `))}}let xe,ye=e=>e;class $e extends CustomEvent{constructor(e){super("change",{detail:e})}}class fe extends c{constructor(){super(...arguments),this.disabled=!1,this.checked=!1}static get properties(){return n(n({},super.properties),{},{disabled:{attribute:!1},checked:{attribute:!1}})}static get styles(){return p.styles}render(){return u(xe||(xe=ye` <label class="${0}"> <span class="text-body font-medium text-m mr-m"> <slot></slot> </span> <span style="border-radius:var(--lumo-size-xl);width:calc((var(--lumo-space-l) * 2) + (var(--lumo-space-xs) * 2))" class="${0}"> <span style="width:var(--lumo-space-l);height:var(--lumo-space-l)" class="${0}"></span> <input type="checkbox" class="opacity-0 absolute inset-0" .checked="${0}" .disabled="${0}" @change="${0}"> </span> </label> `),q({"transition duration-200 flex justify-between items-center group":!0,"cursor-pointer":!this.disabled}),q({"transition duration-150 relative flex flex-shrink-0 items-center":!0,"bg-success focus-within-shadow-outline-success":!this.disabled&&this.checked,"bg-contrast-10 focus-within-shadow-outline":this.disabled||!this.checked,"bg-contrast-20":!this.disabled&&!this.checked}),q({"bg-tint transition duration-200 transform block rounded-full m-xs":!0,"translate-x-l":this.checked,"translate-x-0":!this.checked,"shadow-xs group-hover-shadow-s group-hover-scale-110":!this.disabled}),this.checked,this.disabled,(()=>{this.checked=!this.checked,this.dispatchEvent(new $e(this.checked))}))}}class be extends Error{constructor(){super("Unhandled request detected. Please add a request handler to connect this component to a backend.")}}class we extends CustomEvent{static emit(e){return new Promise(((t,s)=>{const i=new we(n({resolve:t,reject:s},e));e.source.dispatchEvent(i)&&s(new be)}))}constructor({source:e,resolve:t,reject:s,init:i}){var a;super("request",{cancelable:!0,composed:!0,bubbles:!0,detail:{source:e,handle:async function(e){a.stopImmediatePropagation(),a.preventDefault();try{t(await e(...i))}catch(e){s(e)}}}}),a=this}}let ke,Ee=e=>e;class Ce extends CustomEvent{constructor(e){super("change",{detail:e})}}class Se extends v{constructor(){super(...arguments),this.disabled=!1,this.value=1,this.__errorMessage=null,this.__customFieldI18n={formatValue:e=>{const t=parseInt(e[0]);if(isNaN(t))return"0";const s=e[1];return"w"===s?(10080*t).toFixed(0):"d"===s?(1440*t).toFixed(0):"h"===s?(60*t).toFixed(0):t.toFixed(0)},parseValue:e=>{const t=parseInt(e);return t%10080==0?[(t/10080).toFixed(0),"w"]:t%1440==0?[(t/1440).toFixed(0),"d"]:t%60==0?[(t/60).toFixed(0),"h"]:[t.toFixed(0),"m"]}},this.__renderer=this.__renderItems.bind(this)}static get scopedElements(){return{"vaadin-integer-field":j,"vaadin-custom-field":V,"vaadin-select":b,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{attribute:!1},value:{attribute:!1}})}render(){var e;return u(ke||(ke=Ee` <div class="text-xs text-tertiary font-lumo"> <vaadin-custom-field ?disabled="${0}" .label="${0}" .value="${0}" .i18n="${0}" data-testid="field" id="field" @change="${0}"> <vaadin-integer-field .disabled="${0}" .min="${0}" data-testid="count" has-controls> </vaadin-integer-field> <vaadin-select .disabled="${0}" .renderer="${0}" data-testid="units"> </vaadin-select> </vaadin-custom-field> <br> <x-i18n .lang="${0}" .ns="${0}" .key="${0}" data-testid="error" class="${0}"> </x-i18n> </div> `),this.disabled||!this._isI18nReady,this._isI18nReady?this._t("session.title").toString():"---",this._isI18nReady?this.value.toString():"",this.__customFieldI18n,this.__handleChange,this.disabled||!this._isI18nReady,1,this.disabled||!this._isI18nReady,this._isI18nReady?this.__renderer:null,this.lang,this.ns,this._t(`session.${null!==(e=this.__errorMessage)&&void 0!==e?e:"subtitle"}`).toString(),q({"text-error":null!==this.__errorMessage&&!this.disabled}))}firstUpdated(){this.shadowRoot.getElementById("field").value=this.value.toString()}updated(e){e.has("value")&&this.__reportValidity()}__renderItems(e){let t=e.querySelector("vaadin-list-box");null===t&&(t=document.createElement("vaadin-list-box"),e.appendChild(t));const s=["m","h","d","w"],i=["minute_plural","hour_plural","d_plural","w_plural"],a=t.querySelectorAll("vaadin-item");for(let e=0;e<Math.max(s.length,a.length);++e)if(s[e]){let n;a[e]?n=a[e]:(n=document.createElement("vaadin-item"),t.appendChild(n)),n.value=s[e],n.textContent=this._t(i[e])}else a[e].remove()}__handleChange(e){e.stopPropagation(),this.value=parseInt(e.target.value),this.dispatchEvent(new Ce({value:this.value,invalid:!this.__reportValidity()}))}__reportValidity(){return this.__errorMessage=this.value<1?"too_short":this.value>40320?"too_long":null,this.requestUpdate(),null===this.__errorMessage}}let Re,Ie=e=>e;class je extends CustomEvent{constructor(e){super("change",{detail:e})}}class Ve extends v{constructor(){super(...arguments),this.disabled=!1,this.value="",this.__errorMessage=""}static get scopedElements(){return{"vaadin-password-field":N,"vaadin-button":d,"iron-icon":customElements.get("iron-icon"),"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{attribute:!1},value:{attribute:!1}})}render(){const e=""!==this.__errorMessage&&!this.disabled,t=e?this._t(`jwt.${this.__errorMessage}`).toString():"";return u(Re||(Re=Ie` <div class="space-y-xs"> <div class="flex items-start"> <vaadin-password-field .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" .label="${0}" data-testid="input" class="w-full" @change="${0}" @input="${0}"> </vaadin-password-field> <vaadin-button class="flex-shrink-0 ml-s" style="margin-top:calc(var(--lumo-font-size-s) * 1.5)" theme="error" data-testid="button" .disabled="${0}" @click="${0}"> <x-i18n .lang="${0}" .ns="${0}" key="jwt.refresh"></x-i18n> <iron-icon icon="icons:refresh" slot="suffix"></iron-icon> </vaadin-button> </div> <x-i18n .lang="${0}" .ns="${0}" key="jwt.subtitle" class="text-xs text-tertiary font-lumo"> </x-i18n> </div> `),t,this.disabled||!this._isI18nReady,e,this._isI18nReady?this.value:"",this._isI18nReady?this._t("jwt.title").toString():"---",(e=>e.stopPropagation()),this.__handleInput,this.disabled||!this._isI18nReady,this.__regenerateValue,this.lang,this.ns,this.lang,this.ns)}updated(e){e.has("value")&&this.__reportValidity()}__regenerateValue(){this.__errorMessage="",this.value=ee(72,(()=>Y(35).toString(36))).join(""),this.dispatchEvent(new je({value:this.value,invalid:!1}))}__handleInput(e){this.value=e.target.value,this.dispatchEvent(new je({value:this.value,invalid:!this.__reportValidity()}))}__reportValidity(){var e;return this.__errorMessage=0===this.value.length?"required":this.value.length<40?"too_short":this.value.length>100?"too_long":(e=this.value,/^[a-z0-9-]+$/i.test(e)?"":"invalid"),this.requestUpdate(),""===this.__errorMessage}}function Me(e){return t=>{t.preventDefault(),e(t)}}class qe extends x{}let Ne,Te=e=>e;class De extends v{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=De.defaultValue,this.__items=["y","m","w","d"]}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"vaadin-button":customElements.get("vaadin-button"),"x-dropdown":k}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:String}})}render(){return u(Ne||(Ne=Te` <div class="grid grid-cols-2 gap-s"> <vaadin-integer-field data-testid="value" class="w-full" min="1" has-controls .value="${0}" .disabled="${0}" @change="${0}"> </vaadin-integer-field> <x-dropdown data-testid="units" .disabled="${0}" .getText="${0}" .items="${0}" .value="${0}" @change="${0}"> </x-dropdown> </div> `),this._isI18nReady?this.__numericValue:"",this.disabled,this.__handleNumberChange,this.disabled,(e=>this._isI18nReady?this._t(`${e}_plural`):""),this.__items,this._isI18nReady?this.__unitsValue:"",this.__handleUnitsChange)}get __numericValue(){var e;return M(null!==(e=this.value)&&void 0!==e?e:"").count}get __unitsValue(){var e;return M(null!==(e=this.value)&&void 0!==e?e:"").units}__handleNumberChange(e){e.stopPropagation();const t=e.target.value;this.value=this.value.replace(String(this.__numericValue),t),this.__sendChange()}__handleUnitsChange(e){this.value=this.value.replace(String(this.__unitsValue),e.detail),this.__sendChange()}__sendChange(){this.dispatchEvent(new qe(this.value))}}De.defaultValue="1w";class Ae extends te{}let Ue,Oe,Fe,Le,Be=e=>e;class ze extends v{constructor(){super("customer-portal-settings"),this.value=[],this.disabled=!1,this.__newValue=De.defaultValue}static get scopedElements(){return{"iron-icon":customElements.get("iron-icon"),"vaadin-button":customElements.get("vaadin-button"),"x-frequency-input":De,"x-skeleton":E,"x-list":ne,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const e=this.disabled||!this._isI18nReady||this.value.length>=20;return u(Ue||(Ue=Be` <x-list data-testid="list" .value="${0}" .disabled="${0}" @change="${0}"> ${0} <div class="w-full md-flex"> <x-frequency-input data-testid="input" class="mb-s md-mb-0 md-mr-s" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-input> <vaadin-button data-testid="button" class="w-full md-w-auto" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_option"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> </div> ${0} </x-list> `),this.value,this.disabled||!this._isI18nReady,this.__handleListChange,this.value.map(((e,t)=>this._isI18nReady?u(Oe||(Oe=Be`<span slot="${0}">${0}</span>`),t,this.__getText(e)):u(Fe||(Fe=Be`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this.lang,this.__newValue,e,this.__handleNewValueChange,e,this.__handleSubmit,this.ns,this.lang,this.value.length>0?u(Le||(Le=Be` <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_option_hint" class="${0}"> </x-i18n> `),this.ns,this.lang,q({"block text-xs mt-xs text-center md-text-left":!0,"text-tertiary":this.value.length<20,"text-primary":this.value.length>=20})):"")}__handleNewValueChange(e){this.__newValue=e.detail}__handleListChange(e){this.value=e.detail,this.__sendChange()}__handleSubmit(){this.value=[...this.value,this.__newValue],this.__newValue=De.defaultValue,this.__sendChange()}__sendChange(){this.dispatchEvent(new Ae(this.value))}__getText(e){const t=e[e.length-1],s=parseInt(e.replace(t,""));return this._t("duration",{count:s,units:this._t(t,{count:s})})}}class Pe extends y{}let Qe,Ke,Je=e=>e;class Ge extends v{constructor(){super(...arguments),this.disabled=!1,this.value="*",this.__errorMessage="",this.__items=["all","some"],this.__handleNewValueChange=m((e=>{try{D(e).evaluate({}),this.value=e,this.__errorMessage="",this.__sendChange()}catch(e){this.__errorMessage=e.message}this.requestUpdate()}),275)}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"iron-icon":customElements.get("iron-icon"),"x-choice":$,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:String}})}render(){const e="pl-xs text-primary rounded font-medium cursor-pointer transition duration-200 focus-outline-none focus-shadow-outline hover-underline";return u(Qe||(Qe=Je` <x-choice data-testid="choice" .disabled="${0}" .value="${0}" .items="${0}" @change="${0}"> <x-i18n slot="all-label" .ns="${0}" .lang="${0}" key="jsonata.all"></x-i18n> <x-i18n slot="some-label" .ns="${0}" .lang="${0}" key="jsonata.some"></x-i18n> ${0} </x-choice> `),this.disabled||!this._isI18nReady,this.__choice,this.__items,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.__choice===this.__items[1]?u(Ke||(Ke=Je` <div slot="${0}" class="space-y-s pb-m"> <x-i18n .ns="${0}" .lang="${0}" key="jsonata.hint" class="block font-lumo text-s text-tertiary leading-s"> <a target="_blank" class="${0}" href="https://docs.jsonata.org" rel="noopener noreferrer"> JSONata <iron-icon icon="icons:open-in-new" class="icon-inline"></iron-icon> </a> <a target="_blank" class="${0}" href="https://api.foxycart.com/rels/subscription" rel="noopener noreferrer"> hAPI subscription <iron-icon icon="icons:open-in-new" class="icon-inline"></iron-icon> </a> </x-i18n> <vaadin-text-field class="w-full" data-testid="input" .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" @keydown="${0}" @change="${0}" @input="${0}"> </vaadin-text-field> </div> `),this.__items[1],this.ns,this.lang,e,e,this.__errorMessage,this.disabled||!this._isI18nReady,this.__errorMessage.length>0,this._isI18nReady?this.value:"",this.__stopNavigation,(e=>e.stopPropagation()),(e=>this.__handleNewValueChange(e.target.value))):"")}get __choice(){return this.__items["*"===this.value?0:1]}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?"*":'$contains(frequency, "w")',this.__sendChange()}__stopNavigation(e){e.key.startsWith("Arrow")&&e.stopPropagation()}__sendChange(){this.dispatchEvent(new Pe(this.value))}}class He extends CustomEvent{constructor(e){super("change",{detail:e})}}class We extends CustomEvent{constructor(){super("remove")}}let Ye,Xe,Ze=e=>e;class et extends v{constructor(){super(...arguments),this.open=!1,this.value={jsonataQuery:"*",values:[]},this.disabled=!1}static get scopedElements(){return{"x-frequency-list":ze,"x-jsonata-input":Ge,"iron-icon":customElements.get("iron-icon"),"x-group":T,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{open:{attribute:!1},value:{attribute:!1},disabled:{attribute:!1}})}render(){const{jsonataQuery:e,values:t}=this.value,s=this.open?"":"rounded-b-l";return u(Ye||(Ye=Ze` <x-group frame> <details data-testid="details" class="${0}" ?open="${0}" @toggle="${0}"> <summary class="${0} cursor-pointer relative leading-s rounded-t-l focus-outline-none focus-shadow-outline"> <div class="p-m space-y-xs mr-xl"> <x-i18n .ns="${0}" .lang="${0}" .key="${0}" class="block text-m text-header font-medium"> ${0} </x-i18n> <x-i18n .ns="${0}" .lang="${0}" class="block text-s text-tertiary" key="fmod.valuesLabel"> <x-i18n .ns="${0}" .key="${0}" .lang="${0}" .opts="${0}" class="text-secondary"> </x-i18n> </x-i18n> </div> <button data-testid="remove" .disabled="${0}" class="flex items-center justify-center rounded absolute top-0 right-0 text-tertiary hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" style="width:54px;height:54px" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </summary> <div class="space-y-l pt-m" slot="content"> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="fmod.match"></x-i18n> <x-jsonata-input data-testid="jsonata" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-jsonata-input> </x-group> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="fmod.options"> </x-i18n> <x-frequency-list data-testid="frequency" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-list> </x-group> </div> </details> </x-group> `),q({"font-lumo":!0,"pointer-events-none":!this._isI18nReady}),this.open,(()=>this.open=!this.open),s,this.ns,this.lang,`fmod.${"*"===e?"all":"some"}Title`,"*"!==e?this.__renderJSONataSummary(e):"",this.ns,this.lang,this.ns,"fmod.valuesList"+(0===t.length?"Empty":""),this.lang,{values:t.map((e=>this.__translateFrequency(e)))},this.disabled||!this._isI18nReady,Me((()=>{this.dispatchEvent(new We)})),this.ns,this.lang,this.ns,this.lang,this.value.jsonataQuery,this.disabled||!this._isI18nReady,this.__handleQueryChange,this.ns,this.lang,this.lang,this.value.values,this.disabled||!this._isI18nReady,this.__handleValuesChange)}__translateFrequency(e){if(".5m"===e)return this._t("frequency_0_5m");const{count:t,units:s}=M(e);return this._t("frequency",{units:this._t(s,{count:t}),count:t})}__renderJSONataSummary(e){return u(Xe||(Xe=Ze` <code class="inline-block rounded bg-success-10 text-success px-xs text-xs leading-s"> ${0} </code> `),e)}__handleQueryChange(e){this.value=n(n({},this.value),{},{jsonataQuery:e.detail}),this.__sendChange()}__handleValuesChange(e){this.value=n(n({},this.value),{},{values:e.detail}),this.__sendChange()}__sendChange(){this.dispatchEvent(new He(this.value))}}class tt extends CustomEvent{constructor(e){super("change",{detail:e})}}let st,it,at=e=>e;class nt extends v{constructor(){super(...arguments),this.value=[],this.disabled=!1}static get scopedElements(){return{"x-frequency-modification-rule":et,"vaadin-button":customElements.get("vaadin-button"),"x-section":me,"iron-icon":customElements.get("iron-icon"),"x-group":T,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const{ns:e,lang:t}=this;return u(st||(st=at` <x-section> <x-i18n .ns="${0}" .lang="${0}" key="fmod.title" slot="title" class="text-l"></x-i18n> <x-i18n .ns="${0}" .lang="${0}" key="fmod.subtitle" slot="subtitle" class="mr-xl"></x-i18n> ${0} <div class="mt-m sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="add" theme="primary" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_rule"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="fmod.add_rule_hint" class="${0}"> </x-i18n> </div> </x-section> `),e,t,e,t,this.value.map(((e,t,s)=>u(it||(it=at` <x-frequency-modification-rule data-testid="rule" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @remove="${0}" @change="${0}"> </x-frequency-modification-rule> `),this.disabled,e,this.lang,this.ns,(()=>{this.value=s.filter(((e,s)=>s!==t)),this.__sendChange()}),(e=>{this.value=s.map(((s,i)=>i===t?e.detail:s)),this.__sendChange()})))),this.disabled||this.value.length>=10||!this._isI18nReady,this.__addRule,this.ns,this.lang,this.lang,this.ns,q({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":this.value.length<10,"text-primary":this.value.length>=10,hidden:0===this.value.length}))}__addRule(){this.value=[...this.value,{jsonataQuery:"*",values:[]}],this.__sendChange()}__sendChange(){this.dispatchEvent(new tt(this.value))}}function lt(e,t){const s=(new Date).getFullYear(),i={month:"long",day:"numeric"};return e.split("..").map((e=>{const a=A(e),l=(null==a?void 0:a.getFullYear())===s?void 0:"numeric";return null==a?void 0:a.toLocaleDateString(t,n({year:l},i))})).join(" – ")}class rt extends CustomEvent{constructor(e){super("change",{detail:e})}}let dt,ot,ht,ct=e=>e;class ut extends v{constructor(){super("customer-portal-settings"),this.disabled=!1,this.__items=["all","month","day"]}static get scopedElements(){return{"x-monthday-picker":C,"x-weekday-picker":S,"x-choice":$,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Object}})}render(){var e,t,s,i;return u(dt||(dt=ct` <x-choice data-testid="choice" .value="${0}" .items="${0}" .disabled="${0}" @change="${0}"> <x-i18n slot="all-label" key="ndmod.all" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="month-label" key="ndmod.month" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="day-label" key="ndmod.day" .ns="${0}" .lang="${0}"></x-i18n> ${0} </x-choice> `),null!==(t=null===(e=this.value)||void 0===e?void 0:e.type)&&void 0!==t?t:"all",this.__items,this.disabled,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,"month"===(null===(s=this.value)||void 0===s?void 0:s.type)?u(ot||(ot=ct` <x-monthday-picker slot="month" class="mb-m" data-testid="monthday-picker" .lang="${0}" .disabled="${0}" .value="${0}" @change="${0}"> </x-monthday-picker> `),this.lang,this.disabled||!this._isI18nReady,this.value.days,this.__handleNewValueChange):"day"===(null===(i=this.value)||void 0===i?void 0:i.type)?u(ht||(ht=ct` <x-weekday-picker slot="day" class="mb-m" data-testid="weekday-picker" .lang="${0}" .disabled="${0}" .value="${0}" @change="${0}"> </x-weekday-picker> `),this.lang,this.disabled||!this._isI18nReady,this.value.days,this.__handleNewValueChange):"")}__handleNewValueChange(e){this.value.days=e.detail,this.__sendChange()}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?void 0:e.detail===this.__items[1]?{type:"month",days:[]}:{type:"day",days:[]},this.__sendChange()}__sendChange(){this.dispatchEvent(new rt(this.value))}}class _t extends te{}let gt,pt,vt,mt,xt=e=>e;class yt extends v{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.__startValue="",this.__endValue=""}static get scopedElements(){return{"vaadin-date-picker":O,"vaadin-button":d,"x-skeleton":E,"iron-icon":customElements.get("iron-icon"),"x-i18n":w,"x-list":ne}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const e=this.value.length>=20||this.disabled||!this._isI18nReady;return u(gt||(gt=xt` <x-list data-testid="list" .value="${0}" .disabled="${0}" @change="${0}"> ${0} <div class="sm-flex sm-items-end"> <div class="grid grid-cols-2 gap-s"> <vaadin-date-picker data-testid="start" .label="${0}" .value="${0}" .disabled="${0}" .placeholder="${0}" @change="${0}"> </vaadin-date-picker> <vaadin-date-picker data-testid="end" .min="${0}" .label="${0}" .value="${0}" .disabled="${0}" .placeholder="${0}" clear-button-visible @change="${0}"> </vaadin-date-picker> </div> <vaadin-button .disabled="${0}" data-testid="submit" class="w-full mt-s sm-mt-0 sm-w-auto sm-ml-s" @click="${0}"> <x-i18n .lang="${0}" .key="ndmod.add_${0}" .ns="${0}"> </x-i18n> <iron-icon icon="icons:add" slot="suffix"></iron-icon> </vaadin-button> </div> ${0} </x-list> `),this.value,this.disabled||!this._isI18nReady,this.__handleListChange,this.value.map(((e,t)=>this._isI18nReady?u(pt||(pt=xt`<span slot="${0}" class="truncate">${0}</span>`),t,lt(e,this.lang)):u(vt||(vt=xt`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this._t("ndmod.range_start").toString(),this.__startValue,e,this._isI18nReady?this._t("ndmod.select").toString():"",this.__handleStartValueChange,this.__startValue,this._t("ndmod.range_end").toString(),this.__endValue,e||!this.__startValue,this._isI18nReady?this._t("ndmod.select").toString():"",this.__handleEndValueChange,e||!this.__startValue,this.__submit,this.lang,this.__endValue?"range":"single",this.ns,this.value.length>0?u(mt||(mt=xt` <x-i18n .ns="${0}" .lang="${0}" key="ndmod.add_range_hint" class="${0}"> </x-i18n> `),this.ns,this.lang,q({"block text-xs mt-xs text-center sm-text-left":!0,"text-tertiary":this.value.length<20,"text-primary":this.value.length>=20})):"")}updated(){const e=this.constructor.getScopedTagName("vaadin-date-picker"),t=this.shadowRoot.querySelectorAll(e);Array.from(t).forEach((e=>e.validate()))}__handleStartValueChange(e){e.stopPropagation(),this.__startValue=e.target.value;const t=A(this.__endValue),s=A(this.__startValue);t&&t.getTime()<s.getTime()&&(this.__endValue=""),this.requestUpdate()}__handleEndValueChange(e){e.stopPropagation(),this.__endValue=e.target.value,this.requestUpdate()}__submit(){this.__startValue&&this.__endValue?this.value=[...this.value,[this.__startValue,this.__endValue].join("..")]:this.value=[...this.value,this.__startValue],this.__sendChange(),this.__startValue="",this.__endValue=""}__handleListChange(e){this.value=e.detail,this.__sendChange()}__sendChange(){this.dispatchEvent(new _t(this.value))}}class $t extends CustomEvent{constructor(e){super("change",{detail:e})}}let ft,bt,wt=e=>e;class kt extends v{constructor(){super("customer-portal-settings"),this.disabled=!1,this.type="min",this.__items=["none","custom"]}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"x-frequency-input":De,"x-choice":$,"x-group":T,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:String},type:{type:String}})}render(){return u(ft||(ft=wt` <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="${0}"> </x-i18n> <x-choice data-testid="choice" .disabled="${0}" .value="${0}" .items="${0}" @change="${0}"> <x-i18n slot="none-label" .ns="${0}" .lang="${0}" key="ndmod.none"></x-i18n> <x-i18n slot="custom-label" .ns="${0}" .lang="${0}" key="ndmod.custom"></x-i18n> ${0} </x-choice> </x-group> `),this.ns,this.lang,`ndmod.${this.type}`,this.disabled,this.__choice,this.__items,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.__choice===this.__items[1]?u(bt||(bt=wt` <div slot="${0}" class="space-y-s"> <x-frequency-input data-testid="input" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-input> <p class="text-s text-tertiary leading-s">${0}</p> </div> `),this.__items[1],this.value,this.disabled,this.__handleNewValueChange,this.__hint):"")}get __choice(){return this.__items[this.value?1:0]}get __hint(){var e;if(!this._isI18nReady)return"";const{count:t,units:s}=M(null!==(e=this.value)&&void 0!==e?e:"");return this._t(`ndmod.${this.type}Hint`,{duration:this._t("duration",{count:t,units:this._t(null!=s?s:"",{count:t})})})}__handleNewValueChange(e){this.value=e.detail,this.__sendChange()}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?void 0:"1w",this.__sendChange()}__sendChange(){this.dispatchEvent(new $t(this.value))}}class Et extends CustomEvent{constructor(e){super("change",{detail:e})}}class Ct extends CustomEvent{constructor(){super("remove")}}let St,Rt,It,jt,Vt,Mt,qt,Nt,Tt,Dt=e=>e;class At extends v{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value={jsonataQuery:"*"},this.open=!1}static get scopedElements(){return{"x-disallowed-dates":yt,"x-jsonata-input":Ge,"x-offset-input":kt,"x-allowed-days":ut,"iron-icon":customElements.get("iron-icon"),"x-warning":U,"x-group":T,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Object},open:{type:Boolean}})}render(){const{min:e,max:t,allowedDays:s,jsonataQuery:i,disallowedDates:a}=this.value,l=e||t,r=s&&s.days.length>0,d=a&&a.length>0,o=this.open?"":"rounded-b-l";return u(St||(St=Dt` <x-group frame> <details data-testid="details" class="${0}" ?open="${0}" @toggle="${0}"> <summary class="${0} cursor-pointer relative leading-s rounded-t-l focus-outline-none focus-shadow-outline"> <div class="p-m mr-xl text-m text-header font-medium space-y-s"> <div> <x-i18n .ns="${0}" .lang="${0}" key="${0}"> ${0} </x-i18n> </div> ${0} </div> <button data-testid="remove" .disabled="${0}" class="flex items-center justify-center rounded absolute top-0 right-0 text-tertiary hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" style="width:54px;height:54px" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </summary> <article class="space-y-l"> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.match"> </x-i18n> <x-jsonata-input data-testid="jsonata" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-jsonata-input> </x-group> <div class="flex flex-col md-flex-row"> <div class="mb-l md-mb-0 md-w-1-2 md-border-r md-border-contrast-10"> <x-offset-input data-testid="min" type="min" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-offset-input> </div> <div class="md-w-1-2"> <x-offset-input data-testid="max" type="max" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-offset-input> </div> </div> ${0} <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.allowed"> </x-i18n> <x-allowed-days data-testid="allowed" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-allowed-days> </x-group> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.excluded"> </x-i18n> <x-disallowed-dates data-testid="disallowed" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-disallowed-dates> </x-group> </article> </details> </x-group> `),q({"font-lumo":!0,"pointer-events-none":!this._isI18nReady}),this.open,(()=>this.open=!this.open),o,this.ns,this.lang,`ndmod.${"*"===i?"all":"some"}Title`,"*"!==i?this.__renderJSONataSummary(i):"",l||r||d?u(Rt||(Rt=Dt` <div> ${0} </div> `),R(l&&this.__renderMinMaxSummary(e,t),r&&this.__renderAllowedSummary(s),d&&this.__renderDisallowedSummary(a))):"",this.disabled||!this._isI18nReady,Me((()=>this.dispatchEvent(new Ct))),this.ns,this.lang,this.ns,this.lang,i,this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{jsonataQuery:e.detail}),this.__sendUpdate()}),this.lang,e,this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{min:e.detail}),this.__sendUpdate()}),this.lang,t,this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{max:e.detail}),this.__sendUpdate()}),-1===this.__compareDurations(e,t)?u(It||(It=Dt` <x-warning class="mx-m" data-testid="warning"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.minWarning"> </x-i18n> </x-warning> `),this.ns,this.lang):"",this.ns,this.lang,this.lang,s,this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{allowedDays:e.detail}),this.__sendUpdate()}),this.ns,this.lang,this.ns,this.lang,null!=a?a:[],this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{disallowedDates:e.detail}),this.__sendUpdate()}))}__sendUpdate(){this.dispatchEvent(new Et(this.value))}__getEstimatedDaysFrom(e){const{count:t,units:s}=M(e);return t*{y:365,m:31,w:7,d:1}[s]}__compareDurations(e,t){return e===t?0:e&&t?this.__getEstimatedDaysFrom(e)<this.__getEstimatedDaysFrom(t)?1:-1:1}__renderJSONataSummary(e){return u(jt||(jt=Dt` <code class="inline-block rounded bg-success-10 text-success px-xs text-xs leading-s"> ${0} </code> `),e)}__renderMinMaxContent(e){if(e){const{count:t,units:s}=e;return u(Vt||(Vt=Dt` ${0} <x-i18n .ns="${0}" .lang="${0}" key="${0}" .opts="${0}"></x-i18n> `),t,this.ns,this.lang,s,{count:t})}return u(Mt||(Mt=Dt`<x-i18n .ns="${0}" .lang="${0}" key="ndmod.any"></x-i18n>`),this.ns,this.lang)}__renderMinMaxSummary(e,t){return u(qt||(qt=Dt` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.range"> <span>:</span> <span class="text-secondary"> ${0} &mdash; ${0} </span> </x-i18n> </div> `),this.ns,this.lang,this.__renderMinMaxContent(e?M(e):void 0),this.__renderMinMaxContent(t?M(t):void 0))}__renderAllowedSummary({type:e,days:t}){return u(Nt||(Nt=Dt` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.allowed"> <span>:</span> <span class="text-secondary"> ${0} ${0} </span> </x-i18n> </div> `),this.ns,this.lang,"month"===e?t.join(", "):"","day"===e?t.map((e=>I(e,this.lang,"short"))).join(", "):"")}__renderDisallowedSummary(e){return u(Tt||(Tt=Dt` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.excluded"> <span>:</span> <span class="text-secondary"> ${0} </span> </x-i18n> </div> `),this.ns,this.lang,e.map((e=>lt(e,this.lang))).join("; "))}}class Ut extends CustomEvent{constructor(e){super("change",{detail:e})}}let Ot,Ft,Lt,Bt=e=>e;class zt extends v{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=!1}static get scopedElements(){return{"x-next-date-modification-rule":At,"vaadin-button":customElements.get("vaadin-button"),"x-section":me,"iron-icon":customElements.get("iron-icon"),"x-switch":fe,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Array}})}render(){const e=!this._isI18nReady||this.disabled||!this.value||Array.isArray(this.value)&&this.value.length>=10;return u(Ot||(Ot=Bt` <x-section> <x-switch slot="title" class="-my-xs" data-testid="toggle" .checked="${0}" .disabled="${0}" @change="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.title" class="text-l"></x-i18n> </x-switch> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.subtitle" slot="subtitle" class="mr-xl"> </x-i18n> ${0} <div class="mt-m sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="add" theme="primary" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.add"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="ndmod.add_hint" class="${0}"> </x-i18n> </div> </x-section> `),Boolean(this.value),this.disabled||!this._isI18nReady,this.__toggleValue,this.ns,this.lang,this.ns,this.lang,this.value?u(Ft||(Ft=Bt` ${0} `),this.__normalizedValue.map(((e,t,s)=>u(Lt||(Lt=Bt` <x-next-date-modification-rule data-testid="rule" .disabled="${0}" .value="${0}" .lang="${0}" @remove="${0}" @change="${0}"> </x-next-date-modification-rule> `),this.disabled||!this._isI18nReady,e,this.lang,(()=>{this.value=s.filter(((e,s)=>s!==t)),this.__sendChange()}),(e=>{this.value=s.map(((s,i)=>i===t?e.detail:s)),this.__sendChange()}))))):"",e,this.__addRule,this.ns,this.lang,this.lang,this.ns,q({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":Array.isArray(this.value)&&this.value.length<10,"text-primary":Array.isArray(this.value)&&this.value.length>=10,hidden:!Array.isArray(this.value)||0===this.value.length}))}get __normalizedValue(){return"boolean"==typeof this.value?[]:this.value}__addRule(){this.value=[...this.__normalizedValue,{jsonataQuery:"*"}],this.__sendChange()}__toggleValue(){this.value=!this.value,this.__sendChange()}__sendChange(){this.dispatchEvent(new Ut(this.value))}}class Pt extends te{}let Qt,Kt,Jt,Gt=e=>e;class Ht extends v{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.__errorCode="invalid",this.__invalid=!1,this.__newValue=""}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-button":customElements.get("vaadin-button"),"x-skeleton":E,"iron-icon":customElements.get("iron-icon"),"x-group":T,"x-list":ne,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},invalid:{type:Boolean},disabled:{type:Boolean}})}render(){return u(Qt||(Qt=Gt` <x-group frame> <x-list data-testid="list" .disabled="${0}" .value="${0}" @change="${0}"> ${0} <div class="flex flex-col sm-flex-row sm-items-start"> <vaadin-text-field data-testid="input" class="mb-s sm-mb-0 sm-mr-s" .placeholder="${0}" .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" @keypress="${0}" @change="${0}" @input="${0}"> </vaadin-text-field> <div class="sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="button" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="origins.add"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="origins.add_hint" class="${0}"> </x-i18n> </div> </div> </x-list> </x-group> `),this.disabled||!this._isI18nReady,this.value,this.__handleChange,this.value.map(((e,t)=>this._isI18nReady?u(Kt||(Kt=Gt` <div class="flex items-center" slot="${0}"> <img height="16" width="16" class="mr-m" src="https://www.google.com/s2/favicons?domain=${0}"> ${0} </div> `),t,e,e):u(Jt||(Jt=Gt`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this._isI18nReady?"https://foxy.io":"",this._t(`origins.${this.__errorCode}`).toString(),this.disabled||!this._isI18nReady,this.__invalid,this.__newValue,(e=>"Enter"===e.key&&this.__submit()),(e=>e.stopPropagation()),this.__handleInput,!this._isI18nReady||this.disabled||this.__invalid||this.value.length>=10,this.__submit,this.ns,this.lang,this.lang,this.ns,q({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":this.value.length<10,"text-primary":this.value.length>=10,hidden:0===this.value.length}))}__sendChange(){this.dispatchEvent(new Pt(this.value))}__handleInput(e){this.__newValue=e.target.value;try{const e=new URL(this.__newValue),t="https:"===e.protocol,s="localhost"===e.hostname;this.__invalid=!s&&!t,this.__errorCode="https_only"}catch(e){this.__invalid=this.__newValue.length>0,this.__errorCode="invalid"}this.requestUpdate()}__submit(){this.__newValue.length>0&&(this.value=[...this.value,new URL(this.__newValue).origin],this.__newValue="",this.__invalid=!1,this.__sendChange()),this.requestUpdate()}__handleChange(e){this.value=e.detail,this.__sendChange()}}class Wt extends CustomEvent{constructor(e){super("change",{detail:e})}}let Yt,Xt=e=>e;class Zt extends v{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=!1}static get scopedElements(){return{"x-section":me,"x-switch":fe,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Array}})}render(){return u(Yt||(Yt=Xt` <x-section> <x-switch slot="title" class="-my-xs" data-testid="toggle" .checked="${0}" .disabled="${0}" @change="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="sso.title" class="text-l"></x-i18n> </x-switch> <x-i18n .ns="${0}" .lang="${0}" key="sso.subtitle" slot="subtitle" class="mr-xl"> </x-i18n> </x-section> `),Boolean(this.value),this.disabled||!this._isI18nReady,this.__toggleValue,this.ns,this.lang,this.ns,this.lang)}__toggleValue(){this.value=!this.value,this.__sendChange()}__sendChange(){this.dispatchEvent(new Wt(this.value))}}const es=f.assign({error:(e,t)=>t.data.type}),ts=f.assign({oldResource:(e,t)=>t.data.resource,newResource:(e,t)=>t.data.resource,store:(e,t)=>t.data.store}),ss=f.assign({oldResource:e=>e.newResource}),is=f.assign({invalid:[],newResource:({oldResource:e})=>e}),as=f.assign({invalid:[],newResource:e=>({allowedOrigins:[],subscriptions:{allowFrequencyModification:[],allowNextDateModification:!1},jwtSharedSecret:ee(72,(()=>Y(35).toString(36))).join(""),sessionLifespanInMinutes:40320,signUp:{enabled:!1,verification:{type:"hcaptcha",siteKey:"",secretKey:""}},sso:!1,date_created:(new Date).toISOString(),date_modified:(new Date).toISOString(),_links:{"fx:store":e.store._links.self,curies:e.store._links.curies,self:e.store._links["fx:customer_portal_settings"]}})}),ns=f.assign({newResource:null}),ls=f.assign({error:"setup_needed"}),rs=f.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{allowedOrigins:s})}}),ds=f.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{subscriptions:n(n({},e.subscriptions),{},{allowFrequencyModification:s})})}}),os=f.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{subscriptions:n(n({},e.subscriptions),{},{allowNextDateModification:s})})}}),hs=f.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{signUp:s})}}),cs=f.assign({invalid:(e,t)=>{const s="sessionLifespanInMinutes",i=t.invalid;return e.invalid.filter((e=>e!==s)).concat(...i?[s]:[])},newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{sessionLifespanInMinutes:s})}}),us=f.assign({invalid:(e,t)=>{const s="jwtSharedSecret",i=t.invalid;return e.invalid.filter((e=>e!==s)).concat(...i?[s]:[])},newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{jwtSharedSecret:s})}}),_s=f.assign({oldResource:null,newResource:null,store:null,error:null,href:(e,t)=>t.data}),gs=f.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{sso:s})}}),ps={SET_SSO:{target:"#cps.idle",actions:"setSSO"},SET_SECRET:{target:"#cps.idle",actions:"setSecret"},SET_ORIGINS:{target:"#cps.idle",actions:"setOrigins"},SET_SESSION:{target:"#cps.idle",actions:"setSession"},SET_SIGN_UP:{target:"#cps.idle",actions:"setSignUp"},SET_FREQUENCY_MODIFICATION:{target:"#cps.idle",actions:"setFrequencyModification"},SET_NEXT_DATE_MODIFICATION:{target:"#cps.idle",actions:"setNextDateModification"}},vs={initial:"unknown",states:{unknown:{always:[{target:"invalid",cond:"isInvalid"},{target:"valid"}]},invalid:{},valid:{}}},ms=l({id:"cps",initial:"unknown",context:{oldResource:null,newResource:null,invalid:[],store:null,error:null,href:null},states:{unknown:{always:[{target:"error",cond:"isSetupNeeded",actions:"requireSetup"},{target:"idle",cond:"isLoaded"},{target:"busy"}]},error:{on:{RELOAD:{target:"busy.loading"}}},busy:{initial:"loading",states:{loading:{invoke:{src:"load",onDone:{target:"#cps.idle.clean",actions:"handleLoadingSuccess"},onError:{target:"#cps.error",actions:"handleError"}}},saving:{invoke:{src:"save",onDone:{target:"#cps.idle.clean",actions:"handleSavingSuccess"},onError:{target:"#cps.error",actions:"handleError"}}}}},idle:{initial:"unknown",on:{DISABLE:{target:"#cps.idle",actions:"remove"},ENABLE:{target:"#cps.idle",actions:"create"},RESET:{target:"#cps.idle",actions:"reset"}},states:{unknown:{always:[{target:"clean",cond:"isClean"},{target:"dirty"}]},clean:{initial:"unknown",states:{unknown:{always:[{target:"enabled",cond:"isEnabled"},{target:"disabled"}]},enabled:{on:ps},disabled:{}}},dirty:{on:{SAVE:"#cps.busy.saving"},initial:"unknown",states:{unknown:{always:[{target:"created",cond:"isCreated"},{target:"deleted",cond:"isDeleted"},{target:"updated"}]},created:n({on:ps},vs),updated:n({on:ps},vs),deleted:{}}}}}},on:{SET_HREF:{actions:"setHref",target:"unknown"}}},{guards:{isClean:e=>r(e.newResource,e.oldResource),isLoaded:e=>null!==e.store,isInvalid:e=>e.invalid.length>0,isEnabled:e=>null!==e.oldResource,isCreated:e=>null===e.oldResource&&null!==e.newResource,isDeleted:e=>null!==e.oldResource&&null===e.newResource,isSetupNeeded:e=>null===e.href},actions:{setFrequencyModification:ds,setNextDateModification:os,setOrigins:rs,setSession:cs,setSecret:us,setSignUp:hs,setHref:_s,setSSO:gs,handleLoadingSuccess:ts,handleSavingSuccess:ss,handleError:es,create:as,reset:is,remove:ns,requireSetup:ls}});class xs extends CustomEvent{constructor(e){super("change",{detail:e})}}let ys,$s,fs=e=>e;class bs extends v{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=void 0}static get scopedElements(){return{"vaadin-password-field":N,"x-section":me,"x-switch":fe,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Object}})}render(){var e,t,s;return u(ys||(ys=fs` <x-section> <x-switch data-testid="toggle" class="-my-xs" slot="title" .disabled="${0}" .checked="${0}" @change="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="sign_up.title" class="text-l"></x-i18n> </x-switch> <x-i18n class="mr-xl" slot="subtitle" key="sign_up.subtitle" .lang="${0}" .ns="${0}"> </x-i18n> ${0} </x-section> `),this.disabled||!this._isI18nReady,this.__normalizedValue.enabled,(()=>{const e=this.__normalizedValue;e.enabled=!e.enabled,e.enabled||(e.verification.siteKey="",e.verification.secretKey=""),this.value=e,this.requestUpdate(),this.__sendChange()}),this.ns,this.lang,this.lang,this.ns,(null===(e=this.__normalizedValue)||void 0===e?void 0:e.enabled)?u($s||($s=fs` <div class="grid gap-m sm-grid-cols-2"> <vaadin-password-field .placeholder="${0}" .disabled="${0}" .value="${0}" .label="${0}" autocomplete="off" data-testid="site-key" @change="${0}" @input="${0}"> </vaadin-password-field> <vaadin-password-field .placeholder="${0}" .disabled="${0}" .value="${0}" .label="${0}" autocomplete="off" data-testid="secret-key" @change="${0}" @input="${0}"> </vaadin-password-field> <x-i18n class="sm-col-span-2 text-s text-secondary" lang="${0}" key="sign_up.hcaptcha_explainer" ns="${0}"> </x-i18n> </div> `),this._isI18nReady?this._t("sign_up.site_key_placeholder").toString():"---",this.disabled||!this._isI18nReady,this._isI18nReady?null===(t=this.value)||void 0===t?void 0:t.verification.siteKey:"",this._isI18nReady?this._t("sign_up.site_key_label").toString():"---",(e=>e.stopPropagation()),(e=>{const t=this.__normalizedValue;t.verification.siteKey=e.target.value,this.value=t,this.requestUpdate(),this.__sendChange()}),this._isI18nReady?this._t("sign_up.secret_key_placeholder").toString():"---",this.disabled||!this._isI18nReady,this._isI18nReady?null===(s=this.value)||void 0===s?void 0:s.verification.secretKey:"",this._isI18nReady?this._t("sign_up.secret_key_label").toString():"---",(e=>e.stopPropagation()),(e=>{const t=this.__normalizedValue;t.verification.secretKey=e.target.value,this.value=t,this.requestUpdate(),this.__sendChange()}),this.lang,this.ns):"")}get __normalizedValue(){return this.value?F(this.value):{verification:{type:"hcaptcha",siteKey:"",secretKey:""},enabled:!1}}__sendChange(){this.dispatchEvent(new xs(this.value))}}let ws,ks,Es,Cs,Ss=e=>e;function Rs(e){if(!e.ok)throw new h(401===e.status?"unauthorized":"unknown")}class Is extends CustomEvent{constructor(){super("ready")}}class js extends CustomEvent{constructor(){super("update")}}class Vs extends v{constructor(){super("customer-portal-settings"),this.rel="customer_portal_settings",this.__machine=ms.withConfig({services:{load:()=>this.__load(),save:()=>this.__save()}}),this.__service=L(this.__machine).onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}static get scopedElements(){return{"iron-icon":customElements.get("iron-icon"),"vaadin-button":customElements.get("vaadin-button"),"x-frequency-modification":nt,"x-next-date-modification":zt,"x-session-duration":Se,"x-session-secret":Ve,"x-loading-screen":oe,"x-error-screen":o,"x-origins-list":Ht,"x-sso-switch":Zt,"x-skeleton":E,"x-section":me,"x-sign-up":bs,"x-switch":fe,"x-i18n":w,"x-page":_e}}static get properties(){return n(n({},super.properties),{},{href:{type:String,noAccessor:!0}})}get href(){return this.__service.state.context.href}set href(e){this.__service.send({type:"SET_HREF",data:e})}render(){var e,t,s,i,a,l;if(this.__service.state.matches("error"))return u(ws||(ws=Ss` <x-error-screen data-testid="error" lang="${0}" type="${0}" reload @reload="${0}"> </x-error-screen> `),this.lang,this.__service.state.context.error,this.__reload);const{newResource:r}=this.__service.state.context,d=this.__service.state.matches("idle.dirty.created"),o=this.__service.state.matches("idle.dirty.deleted"),h=this.__service.state.matches("idle.dirty.updated"),c=this.__service.state.matches("idle.clean.enabled"),_=this.__service.state.matches("idle.dirty.updated.invalid")||this.__service.state.matches("idle.dirty.created.invalid");return u(ks||(ks=Ss` <x-page class="relative"> <x-switch slot="title" data-testid="switch" .disabled="${0}" .checked="${0}" @change="${0}"> <x-i18n key="title" class="text-xxl" .ns="${0}" .lang="${0}"> <sup class="text-tertiary"> <x-i18n key="beta" .ns="${0}" .lang="${0}"> </x-i18n> </sup> </x-i18n> </x-switch> <x-i18n class="block mr-xl" slot="subtitle" key="subtitle" .ns="${0}" .lang="${0}"> </x-i18n> <x-section> <x-i18n slot="title" key="origins.title" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="subtitle" key="origins.subtitle" .ns="${0}" .lang="${0}"></x-i18n> <x-origins-list data-testid="origins" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-origins-list> </x-section> <x-frequency-modification data-testid="fmod" .lang="${0}" .ns="${0}" .value="${0}" ?disabled="${0}" @change="${0}"> </x-frequency-modification> <x-next-date-modification data-testid="ndmod" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-next-date-modification> <x-sso-switch data-testid="sso" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-sso-switch> <x-sign-up data-testid="signup" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @change="${0}"> </x-sign-up> <x-section> <x-i18n slot="title" key="advanced.title" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="subtitle" key="advanced.subtitle" .ns="${0}" .lang="${0}"> </x-i18n> <x-session-duration data-testid="session" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @change="${0}"> </x-session-duration> <x-session-secret data-testid="secret" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @change="${0}"> </x-session-secret> </x-section> ${0} </x-page> `),!this.__service.state.matches("idle")||!this._isI18nReady,c||d||h,(e=>{this.__service.send(e.detail?"ENABLE":"DISABLE")}),this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.lang,this.ns,null!==(e=null==r?void 0:r.allowedOrigins)&&void 0!==e?e:[],!r,(e=>{this.__service.send({type:"SET_ORIGINS",value:e.detail})}),this.lang,this.ns,null!==(t=null==r?void 0:r.subscriptions.allowFrequencyModification)&&void 0!==t?t:[],!r,(e=>{this.__service.send({type:"SET_FREQUENCY_MODIFICATION",value:e.detail})}),this.lang,this.ns,null!==(s=null==r?void 0:r.subscriptions.allowNextDateModification)&&void 0!==s&&s,!r,(e=>{this.__service.send({type:"SET_NEXT_DATE_MODIFICATION",value:e.detail})}),this.lang,this.ns,null!==(i=null==r?void 0:r.sso)&&void 0!==i&&i,!r,(e=>{this.__service.send({type:"SET_SSO",value:e.detail})}),!r,null==r?void 0:r.signUp,this.lang,this.ns,(e=>{this.__service.send({type:"SET_SIGN_UP",value:e.detail})}),this.ns,this.lang,this.ns,this.lang,!r||!this._isI18nReady,null!==(a=null==r?void 0:r.sessionLifespanInMinutes)&&void 0!==a?a:1,this.lang,this.ns,(({detail:e})=>{this.__service.send(n({type:"SET_SESSION"},e))}),!r||!this._isI18nReady,null!==(l=null==r?void 0:r.jwtSharedSecret)&&void 0!==l?l:"",this.lang,this.ns,(({detail:e})=>{this.__service.send(n({type:"SET_SECRET"},e))}),this.__service.state.matches("idle.dirty")?u(Es||(Es=Ss` <div class="sticky flex justify-between rounded-t-l rounded-b-l shadow-m -mx-s p-s bg-contrast" style="bottom:var(--lumo-space-m)"> <vaadin-button data-testid="save" theme="primary ${0}" .disabled="${0}" @click="${0}"> <x-i18n lang="${0}" ns="${0}" key="save_${0}"> </x-i18n> </vaadin-button> <vaadin-button style="--lumo-contrast:var(--lumo-base-color)" data-testid="reset" theme="contrast tertiary" @click="${0}"> <x-i18n lang="${0}" key="undo_all"></x-i18n> <iron-icon icon="lumo:reload" slot="suffix"></iron-icon> </vaadin-button> </div> `),o?"error":"success",_,(()=>this.__service.send("SAVE")),this.lang,this.ns,d?"create":o?"delete":"update",(()=>this.__service.send("RESET")),this.lang):this.__service.state.matches("busy")?u(Cs||(Cs=Ss`<x-loading-screen data-testid="loading" class="mt-0"></x-loading-screen>`)):"")}async __reload(){this.__service.stop(),this.__service.onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}async __load(){if(null===this.href)throw new h("setup_needed");try{await this.updateComplete;const e=await we.emit({source:this,init:[this.href]});let t,s;if(e.status.toString().startsWith("4")){t=null;const e=await we.emit({source:this,init:["/"]});Rs(e);const i=(await e.json())._links["fx:store"].href,a=await we.emit({source:this,init:[i]});Rs(a),s=await a.json()}else{Rs(e),t=await e.json();const i=t._links["fx:store"].href,a=await we.emit({source:this,init:[i]});Rs(a),s=await a.json()}return{store:s,resource:t}}catch(e){if(e instanceof h)throw e;if(e instanceof be)throw new h("setup_needed");throw new h("unknown")}finally{await this.updateComplete,this.dispatchEvent(new Is)}}async __save(){try{const e=this.__service.state.context,t=F(e.newResource),s=t?"PUT":"DELETE";t&&(delete t._links,delete t.date_created,delete t.date_modified);const i={method:s,body:t?JSON.stringify(t):void 0};Rs(await we.emit({source:this,init:[this.href,i]}))}catch(e){if(e instanceof h)throw e;if(e instanceof be)throw new h("setup_needed");throw new h("unknown")}finally{await this.updateComplete,this.dispatchEvent(new js)}}}customElements.define("foxy-customer-portal-settings",Vs);export{Vs as CustomerPortalSettings};
@@ -1,4 +1,4 @@
1
- import"./foxy-customer.js";import"./shared-c7b3d22b.js";import"./shared-30d00b64.js";import"./shared-ff9791cf.js";import"./shared-f9180815.js";import{I as e}from"./shared-ff8ca16b.js";import"./foxy-access-recovery-form.js";import"./foxy-payment-method-card.js";import{TransactionsTable as t}from"./foxy-transactions-table.js";import"./foxy-subscription-card.js";import"./foxy-subscription-form.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import"./foxy-customer-form.js";import"./foxy-sign-in-form.js";import"./foxy-form-dialog.js";import"./foxy-spinner.js";import{_ as s,B as r,aj as o}from"./shared-1522d76f.js";import{h as i,L as n,c as a}from"./shared-7f33a83a.js";import{A as d}from"./shared-f1e743df.js";import"./shared-250a399a.js";import{C as l}from"./shared-e8621807.js";import{a as c,T as m}from"./shared-5fa697c4.js";import{i as u}from"./shared-d3bf9ac0.js";import{c as h}from"./shared-4e709717.js";import{A as p}from"./shared-07e9d1fb.js";import{C as f}from"./shared-b23c903e.js";import{I as g}from"./shared-30cbf0a6.js";import"./shared-43f449bb.js";import"./foxy-attribute-card.js";import"./shared-6a7f96c4.js";import"./shared-343d1fd7.js";import"./shared-3ab0306f.js";import"./shared-eb116b3e.js";import"./shared-029816d7.js";import"./foxy-attribute-form.js";import"./shared-9df8f842.js";import"./shared-f9a3d1ff.js";import"./shared-c9ba1b64.js";import"./shared-b509bc2c.js";import"./shared-61ade33e.js";import"./shared-d21fa1a6.js";import"./shared-268571df.js";import"./shared-9c08cfab.js";import"./shared-e39807f8.js";import"./shared-ea527e98.js";import"./shared-99c0ae04.js";import"./shared-ad34b6db.js";import"./shared-4e59fd48.js";import"./shared-2c8c4b43.js";import"./shared-11c2efc8.js";import"./shared-4c124efc.js";import"./shared-2b27e2e7.js";import"./shared-a8dc23f1.js";import"./shared-2bdc99f4.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./foxy-table.js";import"./shared-00c2793e.js";import"./foxy-nucleon-element.js";import"./shared-02bc0368.js";import"./shared-4c650e5c.js";import"./shared-d7be11de.js";import"./foxy-transaction-card.js";import"./shared-2cf08dd4.js";import"./shared-e91453df.js";import"./shared-bab2ea2c.js";import"./shared-fc15a882.js";import"./shared-8201d0b5.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-bed7aae1.js";import"./shared-6a9ae42e.js";import"./foxy-cancellation-form.js";import"./shared-43e2c3f6.js";import"./shared-79d0699c.js";import"./shared-be7bfbb0.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-d519a301.js";import"./shared-2f09d4df.js";import"./shared-ca4c5f0f.js";import"./shared-d57fac94.js";import"./shared-20ba4cdc.js";import"./shared-b738ee96.js";import"./shared-174f37e9.js";import"./shared-4462dc70.js";let $,y,v=e=>e;class b extends(c(m(l),"customer-portal")){constructor(){super(...arguments),this.transactionsTableColumns=[t.priceColumn,t.summaryColumn,t.statusColumn,t.idColumn,t.dateColumn,t.receiptColumn],this.group=""}static get properties(){return s(s({},super.properties),{},{transactionsTableColumns:{attribute:!1},group:{type:String}})}render(){let e;try{e=new URL("./customer_portal_settings",this.base).toString()}catch(t){e=void 0}return this.api.storage.getItem(d.SESSION)?i($||($=v` <foxy-internal-customer-portal-logged-in-view customer="${0}" class="h-full" infer="" href="${0}" .transactionsTableColumns="${0}"> </foxy-internal-customer-portal-logged-in-view> `),this.base,u(e),this.transactionsTableColumns):i(y||(y=v` <foxy-internal-customer-portal-logged-out-view class="h-full" infer="" href="${0}"> </foxy-internal-customer-portal-logged-out-view> `),u(e))}}let S,x,_,j,T=e=>e;class O extends(m(n)){constructor(){super(...arguments),this.disabled=!1,this.href="",this.icon=""}static get properties(){return s(s({},super.properties),{},{disabled:{type:Boolean},href:{type:String},icon:{type:String}})}render(){const e=h({"flex-auto font-medium tracking-wide text-s rounded-s transition-colors":!0,"hover-text-primary hover-cursor-pointer":!this.disabled,"focus-outline-none focus-ring-2 ring-primary-50 ring-offset-2":!this.disabled,"text-disabled cursor-default":this.disabled}),t=i(S||(S=T` ${0} <slot></slot> `),this.icon?i(x||(x=T`<iron-icon icon="${0}" class="icon-inline"></iron-icon>`),this.icon):"");return this.disabled?i(_||(_=T`<button class="${0}" disabled="disabled">${0}</button>`),e,t):i(j||(j=T` <a class="${0}" href="${0}" rel="nofollow noopener">${0}</a> `),e,this.href,t)}}let k,w,z,R,E,U,N,A,C=e=>e;const H=c(e);let I,F,L,q,P,B,D,G,J,K,M,Q,V,W,X,Y=e=>e;const Z=c(e);const ee=["html"],te=["html"];let se,re,oe,ie,ne,ae,de,le,ce,me,ue,he,pe=e=>e;const fe=c(f(m(g(n))));let ge,$e,ye,ve=e=>e;const be=f(m(c(g(n),"customer-portal")));customElements.define("foxy-internal-customer-portal-logged-in-view",class extends H{constructor(){var e;super(...arguments),e=this,this.templates={},this.customer="",this.loggingOutState="idle",this.transactionsTableColumns=[],this.loggingOutStateResetTimeout=null,this.__renderHeaderActionsSignOut=()=>{var t,s,r,o,n;const a="customer:header:actions:sign-out",d=this.loggingOutState,l=this.disabledSelector.matches(a)||!(null===(t=this.__customerElement)||void 0===t?void 0:t.in({idle:"snapshot"}))||"idle"!==d,c={"border-radius":"100%",padding:"var(--lumo-space-xs)",display:"flex",margin:"0",cursor:l?"default":"pointer"};return i(k||(k=C` <div style="display:flex;margin-left:var(--lumo-space-m)"> ${0} <vaadin-button data-testid="sign-out" aria-label="${0}" style="${0}" theme="icon" ?disabled="${0}" @click="${0}"> ${0} </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot(`${a}:before`),this.t("sign_out").toString(),Object.entries(c).reduce(((e,[t,s])=>`${e}${t}:${s};`),""),l,(async function(){try{e.loggingOutState="busy",await new p(e).fetch("foxy://customer-api/session",{method:"DELETE"}),e.loggingOutState="idle"}catch(t){e.loggingOutState="fail",e.loggingOutStateResetTimeout=setTimeout((()=>{e.loggingOutState="idle",e.loggingOutStateResetTimeout=null}),1e3)}}),"idle"===d?i(w||(w=C`<iron-icon icon="icons:exit-to-app"></iron-icon>`)):i(z||(z=C` <foxy-spinner layout="no-label" state="${0}" style="margin:auto" lang="${0}" ns="${0}"> </foxy-spinner> `),"fail"===d?"error":"busy",this.lang,[this.ns,null!==(r=null===(s=customElements.get("foxy-customer"))||void 0===s?void 0:s.defaultNS)&&void 0!==r?r:"",null!==(n=null===(o=customElements.get("foxy-spinner"))||void 0===o?void 0:o.defaultNS)&&void 0!==n?n:""].join(" ")),this.renderTemplateOrSlot(`${a}:after`))},this.__renderSubscriptions=(e,t)=>{const s="customer:subscriptions";return e(R||(R=C`
1
+ import"./foxy-customer.js";import"./shared-cadbb2e3.js";import"./shared-31b7a6ad.js";import"./shared-902b0773.js";import"./shared-f9180815.js";import{I as e}from"./shared-6d34289d.js";import"./foxy-access-recovery-form.js";import"./foxy-payment-method-card.js";import{TransactionsTable as t}from"./foxy-transactions-table.js";import"./foxy-subscription-card.js";import"./foxy-subscription-form.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import"./foxy-customer-form.js";import"./foxy-sign-in-form.js";import"./foxy-form-dialog.js";import"./foxy-spinner.js";import{_ as s,B as r,aj as o}from"./shared-1522d76f.js";import{h as i,L as n,c as a}from"./shared-7f33a83a.js";import{A as d}from"./shared-f1e743df.js";import"./shared-250a399a.js";import{C as l}from"./shared-e8621807.js";import{a as c,T as m}from"./shared-550f9cae.js";import{i as u}from"./shared-d3bf9ac0.js";import{c as h}from"./shared-4e709717.js";import{A as p}from"./shared-07e9d1fb.js";import{C as f}from"./shared-b23c903e.js";import{I as g}from"./shared-30cbf0a6.js";import"./shared-1c07b1be.js";import"./foxy-attribute-card.js";import"./shared-6a7f96c4.js";import"./shared-343d1fd7.js";import"./shared-3ab0306f.js";import"./shared-eb116b3e.js";import"./shared-8d51eaa6.js";import"./foxy-attribute-form.js";import"./shared-533c0d6a.js";import"./shared-d28b95c6.js";import"./shared-2d40129d.js";import"./shared-ac62d098.js";import"./shared-61ade33e.js";import"./shared-2787655b.js";import"./shared-c37707da.js";import"./shared-5407617a.js";import"./shared-1e3d7d40.js";import"./shared-df8380e1.js";import"./shared-19732959.js";import"./shared-87f81b69.js";import"./shared-c36477d7.js";import"./shared-a26d7f7a.js";import"./shared-11c2efc8.js";import"./shared-be8c90cc.js";import"./shared-f1ee9bf9.js";import"./shared-2b68c60f.js";import"./shared-60e167ae.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./foxy-table.js";import"./shared-16b391d9.js";import"./foxy-nucleon-element.js";import"./shared-de59c42c.js";import"./shared-027a9660.js";import"./shared-d7be11de.js";import"./shared-76812651.js";import"./shared-a502026c.js";import"./shared-b06b1473.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-9f039798.js";import"./shared-dc8c202b.js";import"./foxy-cancellation-form.js";import"./shared-43e2c3f6.js";import"./shared-79d0699c.js";import"./shared-eaceb493.js";import"./foxy-transaction-card.js";import"./shared-f2eb454c.js";import"./shared-55f58244.js";import"./shared-bab2ea2c.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-d519a301.js";import"./shared-d7910e16.js";import"./shared-51318b75.js";import"./shared-ee54f718.js";import"./shared-f7365ea5.js";import"./shared-b738ee96.js";import"./shared-360e1c8e.js";import"./shared-4721aeb1.js";let $,y,v=e=>e;class b extends(c(m(l),"customer-portal")){constructor(){super(...arguments),this.transactionsTableColumns=[t.priceColumn,t.summaryColumn,t.statusColumn,t.idColumn,t.dateColumn,t.receiptColumn],this.group=""}static get properties(){return s(s({},super.properties),{},{transactionsTableColumns:{attribute:!1},group:{type:String}})}render(){let e;try{e=new URL("./customer_portal_settings",this.base).toString()}catch(t){e=void 0}return this.api.storage.getItem(d.SESSION)?i($||($=v` <foxy-internal-customer-portal-logged-in-view customer="${0}" class="h-full" infer="" href="${0}" .transactionsTableColumns="${0}"> </foxy-internal-customer-portal-logged-in-view> `),this.base,u(e),this.transactionsTableColumns):i(y||(y=v` <foxy-internal-customer-portal-logged-out-view class="h-full" infer="" href="${0}"> </foxy-internal-customer-portal-logged-out-view> `),u(e))}}let S,x,_,j,T=e=>e;class O extends(m(n)){constructor(){super(...arguments),this.disabled=!1,this.href="",this.icon=""}static get properties(){return s(s({},super.properties),{},{disabled:{type:Boolean},href:{type:String},icon:{type:String}})}render(){const e=h({"flex-auto font-medium tracking-wide text-s rounded-s transition-colors":!0,"hover-text-primary hover-cursor-pointer":!this.disabled,"focus-outline-none focus-ring-2 ring-primary-50 ring-offset-2":!this.disabled,"text-disabled cursor-default":this.disabled}),t=i(S||(S=T` ${0} <slot></slot> `),this.icon?i(x||(x=T`<iron-icon icon="${0}" class="icon-inline"></iron-icon>`),this.icon):"");return this.disabled?i(_||(_=T`<button class="${0}" disabled="disabled">${0}</button>`),e,t):i(j||(j=T` <a class="${0}" href="${0}" rel="nofollow noopener">${0}</a> `),e,this.href,t)}}let k,w,z,R,E,U,N,A,C=e=>e;const H=c(e);let I,F,L,q,P,B,D,G,J,K,M,Q,V,W,X,Y=e=>e;const Z=c(e);const ee=["html"],te=["html"];let se,re,oe,ie,ne,ae,de,le,ce,me,ue,he,pe=e=>e;const fe=c(f(m(g(n))));let ge,$e,ye,ve=e=>e;const be=f(m(c(g(n),"customer-portal")));customElements.define("foxy-internal-customer-portal-logged-in-view",class extends H{constructor(){var e;super(...arguments),e=this,this.templates={},this.customer="",this.loggingOutState="idle",this.transactionsTableColumns=[],this.loggingOutStateResetTimeout=null,this.__renderHeaderActionsSignOut=()=>{var t,s,r,o,n;const a="customer:header:actions:sign-out",d=this.loggingOutState,l=this.disabledSelector.matches(a)||!(null===(t=this.__customerElement)||void 0===t?void 0:t.in({idle:"snapshot"}))||"idle"!==d,c={"border-radius":"100%",padding:"var(--lumo-space-xs)",display:"flex",margin:"0",cursor:l?"default":"pointer"};return i(k||(k=C` <div style="display:flex;margin-left:var(--lumo-space-m)"> ${0} <vaadin-button data-testid="sign-out" aria-label="${0}" style="${0}" theme="icon" ?disabled="${0}" @click="${0}"> ${0} </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot(`${a}:before`),this.t("sign_out").toString(),Object.entries(c).reduce(((e,[t,s])=>`${e}${t}:${s};`),""),l,(async function(){try{e.loggingOutState="busy",await new p(e).fetch("foxy://customer-api/session",{method:"DELETE"}),e.loggingOutState="idle"}catch(t){e.loggingOutState="fail",e.loggingOutStateResetTimeout=setTimeout((()=>{e.loggingOutState="idle",e.loggingOutStateResetTimeout=null}),1e3)}}),"idle"===d?i(w||(w=C`<iron-icon icon="icons:exit-to-app"></iron-icon>`)):i(z||(z=C` <foxy-spinner layout="no-label" state="${0}" style="margin:auto" lang="${0}" ns="${0}"> </foxy-spinner> `),"fail"===d?"error":"busy",this.lang,[this.ns,null!==(r=null===(s=customElements.get("foxy-customer"))||void 0===s?void 0:s.defaultNS)&&void 0!==r?r:"",null!==(n=null===(o=customElements.get("foxy-spinner"))||void 0===o?void 0:o.defaultNS)&&void 0!==n?n:""].join(" ")),this.renderTemplateOrSlot(`${a}:after`))},this.__renderSubscriptions=(e,t)=>{const s="customer:subscriptions";return e(R||(R=C`
2
2
  ${0}
3
3
 
4
4
  <foxy-internal-customer-portal-subscriptions
@@ -1,4 +1,4 @@
1
- import"./shared-ff9791cf.js";import"./shared-30d00b64.js";import{h as t}from"./shared-43f449bb.js";import"./shared-c7b3d22b.js";import"./shared-f9180815.js";import"./foxy-payment-method-card.js";import"./foxy-subscription-form.js";import"./foxy-form-dialog.js";import"./foxy-transactions-table.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-customer-form.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./foxy-spinner.js";import"./foxy-table.js";import"./shared-029816d7.js";import{aj as e,_ as s}from"./shared-1522d76f.js";import{L as r,h as a,c as o}from"./shared-7f33a83a.js";import{C as i}from"./shared-b23c903e.js";import"./shared-f9a3d1ff.js";import"./shared-9c08cfab.js";import{w as h,S as d,T as n,a as l}from"./shared-5fa697c4.js";import{c as m}from"./shared-4e709717.js";import"./shared-e39807f8.js";import"./shared-268571df.js";import{S as c}from"./shared-4c124efc.js";import"./shared-ea527e98.js";import"./shared-c9ba1b64.js";import"./shared-99c0ae04.js";import"./shared-ad34b6db.js";import"./shared-4e59fd48.js";import{G as v}from"./shared-a8dc23f1.js";import"./shared-b509bc2c.js";import{N as p}from"./shared-6a7f96c4.js";import{S as f}from"./shared-02bc0368.js";import{i as g}from"./shared-d3bf9ac0.js";import"./shared-61ade33e.js";import"./shared-d21fa1a6.js";import"./shared-d7be11de.js";import"./foxy-nucleon-element.js";import"./shared-07e9d1fb.js";import"./shared-343d1fd7.js";import"./shared-3ab0306f.js";import"./shared-30cbf0a6.js";import"./shared-eb116b3e.js";import"./foxy-transaction-card.js";import"./shared-2cf08dd4.js";import"./shared-e91453df.js";import"./shared-bab2ea2c.js";import"./shared-ff8ca16b.js";import"./shared-fc15a882.js";import"./shared-8201d0b5.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-bed7aae1.js";import"./shared-6a9ae42e.js";import"./foxy-cancellation-form.js";import"./shared-43e2c3f6.js";import"./shared-79d0699c.js";import"./shared-be7bfbb0.js";import"./shared-9df8f842.js";import"./shared-11c2efc8.js";import"./shared-2b27e2e7.js";import"./shared-2c8c4b43.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-4c650e5c.js";import"./shared-f1e743df.js";import"./shared-250a399a.js";import"./shared-00c2793e.js";import"./shared-d519a301.js";import"./shared-2bdc99f4.js";import"./shared-2f09d4df.js";import"./shared-ca4c5f0f.js";import"./shared-d57fac94.js";import"./shared-20ba4cdc.js";import"./shared-b738ee96.js";let z,u,b,$=t=>t;class H extends r{constructor(){super(...arguments),this.value=0,this.size=0}static get properties(){return{value:{type:Number},size:{type:Number}}}static get styles(){return h.styles}render(){const t=[],e=[];for(let s=0;s<this.size;++s)t.push(a(z||(z=$` <button id="tab-${0}" role="tab" class="${0}" aria-controls="panel-${0}" aria-selected="${0}" @click="${0}" @keydown="${0}"> <slot name="tab-${0}"></slot> </button> `),s,m({"text-l font-medium px-s rounded focus-outline-none focus-shadow-outline":!0,"text-tertiary hover-text-body focus-text-body":this.value!==s}),s,this.value===s,(()=>this.value=s),this.__handleKeyDown,s)),e.push(a(u||(u=$` <slot id="panel-${0}" role="tabpanel" name="panel-${0}" class="${0}" aria-hidden="${0}" aria-labelledby="tab-${0}"> </slot> `),s,s,m({hidden:this.value!==s}),this.value!==s,s));return a(b||(b=$` <div role="tablist" aria-orientation="horizontal" class="-mx-s mb-s">${0}</div> ${0} `),t,e)}__handleKeyDown(t){if(t.key.startsWith("Arrow")){t.preventDefault();const e=t.target;let s=null;"ArrowRight"===t.key||"ArrowDown"===t.key?s=e.nextElementSibling:"ArrowLeft"!==t.key&&"ArrowUp"!==t.key||(s=e.previousElementSibling),null==s||s.click(),null==s||s.focus()}}}
1
+ import"./shared-902b0773.js";import"./shared-31b7a6ad.js";import{h as t}from"./shared-1c07b1be.js";import"./shared-cadbb2e3.js";import"./shared-f9180815.js";import"./foxy-payment-method-card.js";import"./foxy-subscription-form.js";import"./foxy-form-dialog.js";import"./foxy-transactions-table.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-customer-form.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./foxy-spinner.js";import"./foxy-table.js";import"./shared-8d51eaa6.js";import{aj as e,_ as s}from"./shared-1522d76f.js";import{L as r,h as a,c as o}from"./shared-7f33a83a.js";import{C as i}from"./shared-b23c903e.js";import"./shared-d28b95c6.js";import"./shared-5407617a.js";import{w as h,S as d,T as n,a as l}from"./shared-550f9cae.js";import{c as m}from"./shared-4e709717.js";import"./shared-1e3d7d40.js";import"./shared-c37707da.js";import{S as c}from"./shared-be8c90cc.js";import"./shared-df8380e1.js";import"./shared-2d40129d.js";import"./shared-19732959.js";import"./shared-87f81b69.js";import"./shared-c36477d7.js";import{G as v}from"./shared-2b68c60f.js";import"./shared-ac62d098.js";import{N as p}from"./shared-6a7f96c4.js";import{S as g}from"./shared-de59c42c.js";import{i as f}from"./shared-d3bf9ac0.js";import"./shared-61ade33e.js";import"./shared-2787655b.js";import"./shared-d7be11de.js";import"./foxy-nucleon-element.js";import"./shared-07e9d1fb.js";import"./shared-343d1fd7.js";import"./shared-3ab0306f.js";import"./shared-30cbf0a6.js";import"./shared-eb116b3e.js";import"./shared-76812651.js";import"./shared-6d34289d.js";import"./shared-a502026c.js";import"./shared-b06b1473.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-9f039798.js";import"./shared-dc8c202b.js";import"./foxy-cancellation-form.js";import"./shared-43e2c3f6.js";import"./shared-79d0699c.js";import"./shared-eaceb493.js";import"./shared-533c0d6a.js";import"./shared-11c2efc8.js";import"./shared-f1ee9bf9.js";import"./shared-a26d7f7a.js";import"./foxy-transaction-card.js";import"./shared-f2eb454c.js";import"./shared-55f58244.js";import"./shared-bab2ea2c.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-027a9660.js";import"./shared-f1e743df.js";import"./shared-250a399a.js";import"./shared-16b391d9.js";import"./shared-d519a301.js";import"./shared-60e167ae.js";import"./shared-d7910e16.js";import"./shared-51318b75.js";import"./shared-ee54f718.js";import"./shared-f7365ea5.js";import"./shared-b738ee96.js";let z,u,b,$=t=>t;class H extends r{constructor(){super(...arguments),this.value=0,this.size=0}static get properties(){return{value:{type:Number},size:{type:Number}}}static get styles(){return h.styles}render(){const t=[],e=[];for(let s=0;s<this.size;++s)t.push(a(z||(z=$` <button id="tab-${0}" role="tab" class="${0}" aria-controls="panel-${0}" aria-selected="${0}" @click="${0}" @keydown="${0}"> <slot name="tab-${0}"></slot> </button> `),s,m({"text-l font-medium px-s rounded focus-outline-none focus-shadow-outline":!0,"text-tertiary hover-text-body focus-text-body":this.value!==s}),s,this.value===s,(()=>this.value=s),this.__handleKeyDown,s)),e.push(a(u||(u=$` <slot id="panel-${0}" role="tabpanel" name="panel-${0}" class="${0}" aria-hidden="${0}" aria-labelledby="tab-${0}"> </slot> `),s,s,m({hidden:this.value!==s}),this.value!==s,s));return a(b||(b=$` <div role="tablist" aria-orientation="horizontal" class="-mx-s mb-s">${0}</div> ${0} `),t,e)}__handleKeyDown(t){if(t.key.startsWith("Arrow")){t.preventDefault();const e=t.target;let s=null;"ArrowRight"===t.key||"ArrowDown"===t.key?s=e.nextElementSibling:"ArrowLeft"!==t.key&&"ArrowUp"!==t.key||(s=e.previousElementSibling),null==s||s.click(),null==s||s.focus()}}}
2
2
  /**
3
3
  @license
4
4
  Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
@@ -79,7 +79,7 @@ found at http://polymer.github.io/PATENTS.txt
79
79
  <g id="vertical-align-top"><path d="M8 11h3v10h2V11h3l-4-4-4 4zM4 3v2h16V3H4z"></path></g>
80
80
  <g id="wrap-text"><path d="M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3 3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"></path></g>
81
81
  </defs></svg>
82
- </iron-iconset-svg>`;document.head.appendChild(y.content);let x;const V=o(x||(x=(t=>t)`:host{--tile-width:16rem}.w-tile{width:var(--tile-width)}.w-payment-method-card{width:calc(var(--tile-width) + ((var(--lumo-space-m) * 2)) + 2px)}`)),M=["html"];let S,_,j,L,T,w,k,A,C,O,E,N,P,R,q,D,U,K,G,W,B,F,I,J,Q,X,Y=t=>t;const Z=d(i(n(l(p,"customer"))));class tt extends Z{constructor(){super(...arguments),this.templates={},this.settings=null,this.__renderHeaderActionsEdit=()=>{const{readonlySelector:t,disabledSelector:e,hiddenSelector:s}=this,r="header:actions:edit:form",o="customer-dialog",i=!this.in({idle:"snapshot"})||e.matches("header:actions:edit",!0);return a(S||(S=Y` ${0} <foxy-form-dialog data-testid="header:actions:edit:form" header="update" parent="${0}" group="${0}" href="${0}" form="foxy-customer-form" lang="${0}" ns="${0}" id="${0}" readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" .templates="${0}" .props="${0}"> </foxy-form-dialog> <vaadin-button data-testid="header:actions:edit" aria-label="${0}" class="px-xs rounded-full" theme="icon" ?disabled="${0}" @click="${0}"> <iron-icon icon="editor:mode-edit"></iron-icon> </vaadin-button> ${0} `),this.renderTemplateOrSlot("header:actions:edit:before"),this.parent,this.group,this.href,this.lang,this.ns,o,t.zoom(r).toString(),e.zoom(r).toString(),s.zoom(r).toString(),this.getNestedTemplates("header:actions:edit:form"),{".settings":this.settings},this.t("update").toString(),i,(t=>{this.renderRoot.querySelector(`#${o}`).show(t.currentTarget)}),this.renderTemplateOrSlot("header:actions:edit:after"))},this.__renderHeaderActions=()=>{const t=this.hiddenSelector.zoom("header:actions");return a(_||(_=Y` <div class="flex" data-testid="header:actions"> ${0} ${0} ${0} </div> `),this.renderTemplateOrSlot("header:actions:before"),t.matches("edit",!0)?"":this.__renderHeaderActionsEdit(),this.renderTemplateOrSlot("header:actions:after"))},this.__renderHeader=()=>{const t=g(this.in("busy")?void 0:"static");return a(j||(j=Y` ${0} <header class="flex items-center justify-between space-x-m pb-s border-b border-contrast-10" data-testid="header"> <h1 class="text-xxl font-medium truncate min-w-0 flex-1"> ${0} </h1> ${0} </header> ${0} `),this.renderTemplateOrSlot("header:before"),this.in({idle:"snapshot"})?a(L||(L=Y`${0} ${0}`),this.data.first_name,this.data.last_name):a(T||(T=Y`<x-skeleton class="w-full" variant="${0}">&nbsp;</x-skeleton>`),t),this.hiddenSelector.matches("header:actions",!0)?"":this.__renderHeaderActions(),this.renderTemplateOrSlot("header:after"))},this.__renderAddressesActionsCreate=()=>{var t;const{data:e,lang:s,ns:r}=this,o=this.disabledSelector.zoom("addresses:actions"),i=this.readonlySelector.zoom("addresses:actions"),h=this.hiddenSelector.zoom("addresses:actions"),d=!this.in({idle:"snapshot"})||o.matches("create",!0);return a(w||(w=Y` ${0} <vaadin-button data-testid="addresses:actions:create" aria-label="${0}" class="px-xs rounded-full" theme="small icon" ?disabled="${0}" @click="${0}"> <foxy-form-dialog readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" data-testid="addresses:actions:create:form" parent="${0}" header="create" group="${0}" form="foxy-address-form" lang="${0}" ns="${0}" id="address-dialog" .templates="${0}"> </foxy-form-dialog> <iron-icon slot="suffix" icon="icons:add"></iron-icon> </vaadin-button> ${0} `),this.renderTemplateOrSlot("addresses:actions:create:before"),this.t("create").toString(),d,(t=>{if(null===e)return;const s=t.target;s.firstElementChild.show(s)}),i.zoom("create:form").toString(),o.zoom("create:form").toString(),h.zoom("create:form").toString(),null!==(t=null==e?void 0:e._links["fx:customer_addresses"].href)&&void 0!==t?t:"",this.group,s,r,this.getNestedTemplates("addresses:actions:create:form"),this.renderTemplateOrSlot("addresses:actions:create:after"))},this.__renderAddressesActions=()=>{const t=this.hiddenSelector.zoom("addresses:actions");return a(k||(k=Y` <div data-testid="addresses:actions"> ${0} ${0} ${0} </div> `),this.renderTemplateOrSlot("addresses:actions:before"),t.matches("create",!0)?"":this.__renderAddressesActionsCreate(),this.renderTemplateOrSlot("addresses:actions:after"))},this.__renderAddressesListCard=t=>{var e,s;const r=m({"snap-start text-left p-m rounded-t-l rounded-b-l flex-shrink-0":!0,"border border-contrast-10":!0,"hover-border-contrast-30 focus-outline-none focus-border-primary":null!==t.data}),o=this.readonlySelector.matches("addresses:list:card",!0),i=this.disabledSelector.matches("addresses:list:card",!0);return a(A||(A=Y` <button data-testclass="addresses:list:card" class="${0}" ?disabled="${0}" @click="${0}"> <foxy-address-card hiddencontrols="${0}" parent="${0}" class="w-tile" group="${0}" lang="${0}" href="${0}" ns="${0} ${0}" .templates="${0}"> </foxy-address-card> </button> `),r,!t.data||o||i,(e=>{if(null===t.data)return;const s=e.target,r=s.getRootNode().querySelector("#addresses-list-form");r.href=t.data._links.self.href,r.show(s)}),t.hiddenControls.toString(),t.parent,t.group,t.lang,t.href,t.ns,null!==(s=null===(e=customElements.get("foxy-address-card"))||void 0===e?void 0:e.defaultNS)&&void 0!==s?s:"",t.templates)},this.__renderAddressesListPage=t=>t.html(C||(C=Y`
82
+ </iron-iconset-svg>`;document.head.appendChild(y.content);let x;const V=o(x||(x=(t=>t)`:host{--tile-width:16rem}.w-tile{width:var(--tile-width)}.w-payment-method-card{width:calc(var(--tile-width) + ((var(--lumo-space-m) * 2)) + 2px)}`)),M=["html"];let S,_,j,L,T,w,k,A,C,O,E,N,P,R,q,D,U,K,G,W,B,F,I,J,Q,X,Y=t=>t;const Z=d(i(n(l(p,"customer"))));class tt extends Z{constructor(){super(...arguments),this.templates={},this.settings=null,this.__renderHeaderActionsEdit=()=>{const{readonlySelector:t,disabledSelector:e,hiddenSelector:s}=this,r="header:actions:edit:form",o="customer-dialog",i=!this.in({idle:"snapshot"})||e.matches("header:actions:edit",!0);return a(S||(S=Y` ${0} <foxy-form-dialog data-testid="header:actions:edit:form" header="update" parent="${0}" group="${0}" href="${0}" form="foxy-customer-form" lang="${0}" ns="${0}" id="${0}" readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" .templates="${0}" .props="${0}"> </foxy-form-dialog> <vaadin-button data-testid="header:actions:edit" aria-label="${0}" class="px-xs rounded-full" theme="icon" ?disabled="${0}" @click="${0}"> <iron-icon icon="editor:mode-edit"></iron-icon> </vaadin-button> ${0} `),this.renderTemplateOrSlot("header:actions:edit:before"),this.parent,this.group,this.href,this.lang,this.ns,o,t.zoom(r).toString(),e.zoom(r).toString(),s.zoom(r).toString(),this.getNestedTemplates("header:actions:edit:form"),{".settings":this.settings},this.t("update").toString(),i,(t=>{this.renderRoot.querySelector(`#${o}`).show(t.currentTarget)}),this.renderTemplateOrSlot("header:actions:edit:after"))},this.__renderHeaderActions=()=>{const t=this.hiddenSelector.zoom("header:actions");return a(_||(_=Y` <div class="flex" data-testid="header:actions"> ${0} ${0} ${0} </div> `),this.renderTemplateOrSlot("header:actions:before"),t.matches("edit",!0)?"":this.__renderHeaderActionsEdit(),this.renderTemplateOrSlot("header:actions:after"))},this.__renderHeader=()=>{const t=f(this.in("busy")?void 0:"static");return a(j||(j=Y` ${0} <header class="flex items-center justify-between space-x-m pb-s border-b border-contrast-10" data-testid="header"> <h1 class="text-xxl font-medium truncate min-w-0 flex-1"> ${0} </h1> ${0} </header> ${0} `),this.renderTemplateOrSlot("header:before"),this.in({idle:"snapshot"})?a(L||(L=Y`${0} ${0}`),this.data.first_name,this.data.last_name):a(T||(T=Y`<x-skeleton class="w-full" variant="${0}">&nbsp;</x-skeleton>`),t),this.hiddenSelector.matches("header:actions",!0)?"":this.__renderHeaderActions(),this.renderTemplateOrSlot("header:after"))},this.__renderAddressesActionsCreate=()=>{var t;const{data:e,lang:s,ns:r}=this,o=this.disabledSelector.zoom("addresses:actions"),i=this.readonlySelector.zoom("addresses:actions"),h=this.hiddenSelector.zoom("addresses:actions"),d=!this.in({idle:"snapshot"})||o.matches("create",!0);return a(w||(w=Y` ${0} <vaadin-button data-testid="addresses:actions:create" aria-label="${0}" class="px-xs rounded-full" theme="small icon" ?disabled="${0}" @click="${0}"> <foxy-form-dialog readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" data-testid="addresses:actions:create:form" parent="${0}" header="create" group="${0}" form="foxy-address-form" lang="${0}" ns="${0}" id="address-dialog" .templates="${0}"> </foxy-form-dialog> <iron-icon slot="suffix" icon="icons:add"></iron-icon> </vaadin-button> ${0} `),this.renderTemplateOrSlot("addresses:actions:create:before"),this.t("create").toString(),d,(t=>{if(null===e)return;const s=t.target;s.firstElementChild.show(s)}),i.zoom("create:form").toString(),o.zoom("create:form").toString(),h.zoom("create:form").toString(),null!==(t=null==e?void 0:e._links["fx:customer_addresses"].href)&&void 0!==t?t:"",this.group,s,r,this.getNestedTemplates("addresses:actions:create:form"),this.renderTemplateOrSlot("addresses:actions:create:after"))},this.__renderAddressesActions=()=>{const t=this.hiddenSelector.zoom("addresses:actions");return a(k||(k=Y` <div data-testid="addresses:actions"> ${0} ${0} ${0} </div> `),this.renderTemplateOrSlot("addresses:actions:before"),t.matches("create",!0)?"":this.__renderAddressesActionsCreate(),this.renderTemplateOrSlot("addresses:actions:after"))},this.__renderAddressesListCard=t=>{var e,s;const r=m({"snap-start text-left p-m rounded-t-l rounded-b-l flex-shrink-0":!0,"border border-contrast-10":!0,"hover-border-contrast-30 focus-outline-none focus-border-primary":null!==t.data}),o=this.readonlySelector.matches("addresses:list:card",!0),i=this.disabledSelector.matches("addresses:list:card",!0);return a(A||(A=Y` <button data-testclass="addresses:list:card" class="${0}" ?disabled="${0}" @click="${0}"> <foxy-address-card hiddencontrols="${0}" parent="${0}" class="w-tile" group="${0}" lang="${0}" href="${0}" ns="${0} ${0}" .templates="${0}"> </foxy-address-card> </button> `),r,!t.data||o||i,(e=>{if(null===t.data)return;const s=e.target,r=s.getRootNode().querySelector("#addresses-list-form");r.href=t.data._links.self.href,r.show(s)}),t.hiddenControls.toString(),t.parent,t.group,t.lang,t.href,t.ns,null!==(s=null===(e=customElements.get("foxy-address-card"))||void 0===e?void 0:e.defaultNS)&&void 0!==s?s:"",t.templates)},this.__renderAddressesListPage=t=>t.html(C||(C=Y`
83
83
  <foxy-collection-page
84
84
  hiddencontrols=${0}
85
85
  class="space-x-m flex"
@@ -110,7 +110,7 @@ found at http://polymer.github.io/PATENTS.txt
110
110
  >
111
111
  </foxy-attribute-card>
112
112
  </button>
113
- `),r,null===t.data,(e=>{if(null===t.data)return;const s=e.target,r=s.getRootNode().querySelector("#attributes-list-form");r.href=t.data._links.self.href,r.show(s)}),t.hiddenControls.toString(),t.parent,t.group,t.lang,t.href,t.ns,null!==(s=null===(e=customElements.get("foxy-attribute-card"))||void 0===e?void 0:e.defaultNS)&&void 0!==s?s:"",t.templates)},this.__renderAttributesListPage=t=>a(U||(U=Y` <foxy-collection-page hiddencontrols="${0}" class="space-x-m flex" group="${0}" lang="${0}" href="${0}" ns="${0}" .item="${0}" .templates="${0}"> </foxy-collection-page> `),t.hiddenControls.toString(),t.group,t.lang,t.href,t.ns,this.__renderAttributesListCard,t.templates),this.__renderAttributesList=()=>{var t,e,s,r;const o="attributes:list:form",i="attributes:list:card";return a(K||(K=Y` ${0} <foxy-form-dialog readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" data-testclass="i18n" data-testid="attributes:list:form" parent="${0}" header="update" group="${0}" form="foxy-attribute-form" lang="${0}" ns="${0}" id="attributes-list-form" .templates="${0}"> </foxy-form-dialog> <foxy-collection-pages hiddencontrols="${0}" data-testid="attributes:list" first="${0}" class="snap-x-mandatory flex items-center space-x-m overflow-auto" group="${0}" lang="${0}" ns="${0}" .page="${0}" .templates="${0}"> </foxy-collection-pages> ${0} `),this.renderTemplateOrSlot("attributes:list:before"),this.readonlySelector.zoom(o).toString(),this.disabledSelector.zoom(o).toString(),this.hiddenSelector.zoom(o).toString(),null!==(e=null===(t=this.data)||void 0===t?void 0:t._links["fx:attributes"].href)&&void 0!==e?e:"",this.group,this.lang,this.ns,this.getNestedTemplates(o),this.hiddenControls.zoom(i).toString(),null!==(r=null===(s=this.data)||void 0===s?void 0:s._links["fx:attributes"].href)&&void 0!==r?r:"",this.group,this.lang,this.ns,this.__renderAttributesListPage,this.getNestedTemplates(i),this.renderTemplateOrSlot("attributes:list:after"))},this.__renderAttributes=()=>{const{lang:t,ns:e}=this,s=this.hiddenSelector.zoom("attributes");return a(G||(G=Y` ${0} <section class="pt-m" data-testid="attributes"> <header class="space-x-m flex items-center mb-s"> <h2 class="text-l font-medium"> <foxy-i18n ns="${0}" lang="${0}" key="attribute_plural"></foxy-i18n> </h2> ${0} </header> ${0} </section> ${0} `),this.renderTemplateOrSlot("attributes:before"),e,t,s.matches("actions",!0)?"":this.__renderAttributesActions(),s.matches("list",!0)?"":this.__renderAttributesList(),this.renderTemplateOrSlot("attributes:after"))},this.__renderTransactions=()=>{let t="";if(this.in({idle:"snapshot"})){const e=new URL(this.data._links["fx:transactions"].href);e.searchParams.set("zoom","items"),t=e.toString()}return a(W||(W=Y` ${0} <x-group frame> <foxy-collection-pages data-testid="transactions" spinner="foxy-spinner" first="${0}" class="divide-y divide-contrast-10 block mx-m" group="${0}" page="foxy-transactions-table" lang="${0}" ns="${0}" .templates="${0}"> </foxy-collection-pages> </x-group> ${0} `),this.renderTemplateOrSlot("transactions:before"),t,this.group,this.lang,this.ns,this.getNestedTemplates("transactions:table"),this.renderTemplateOrSlot("transactions:after"))},this.__subscriptionsTableColumns=[f.priceColumn,f.summaryColumn,f.statusColumn,{cell:({html:t,lang:e,data:s})=>t(B||(B=Y`
113
+ `),r,null===t.data,(e=>{if(null===t.data)return;const s=e.target,r=s.getRootNode().querySelector("#attributes-list-form");r.href=t.data._links.self.href,r.show(s)}),t.hiddenControls.toString(),t.parent,t.group,t.lang,t.href,t.ns,null!==(s=null===(e=customElements.get("foxy-attribute-card"))||void 0===e?void 0:e.defaultNS)&&void 0!==s?s:"",t.templates)},this.__renderAttributesListPage=t=>a(U||(U=Y` <foxy-collection-page hiddencontrols="${0}" class="space-x-m flex" group="${0}" lang="${0}" href="${0}" ns="${0}" .item="${0}" .templates="${0}"> </foxy-collection-page> `),t.hiddenControls.toString(),t.group,t.lang,t.href,t.ns,this.__renderAttributesListCard,t.templates),this.__renderAttributesList=()=>{var t,e,s,r;const o="attributes:list:form",i="attributes:list:card";return a(K||(K=Y` ${0} <foxy-form-dialog readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" data-testclass="i18n" data-testid="attributes:list:form" parent="${0}" header="update" group="${0}" form="foxy-attribute-form" lang="${0}" ns="${0}" id="attributes-list-form" .templates="${0}"> </foxy-form-dialog> <foxy-collection-pages hiddencontrols="${0}" data-testid="attributes:list" first="${0}" class="snap-x-mandatory flex items-center space-x-m overflow-auto" group="${0}" lang="${0}" ns="${0}" .page="${0}" .templates="${0}"> </foxy-collection-pages> ${0} `),this.renderTemplateOrSlot("attributes:list:before"),this.readonlySelector.zoom(o).toString(),this.disabledSelector.zoom(o).toString(),this.hiddenSelector.zoom(o).toString(),null!==(e=null===(t=this.data)||void 0===t?void 0:t._links["fx:attributes"].href)&&void 0!==e?e:"",this.group,this.lang,this.ns,this.getNestedTemplates(o),this.hiddenControls.zoom(i).toString(),null!==(r=null===(s=this.data)||void 0===s?void 0:s._links["fx:attributes"].href)&&void 0!==r?r:"",this.group,this.lang,this.ns,this.__renderAttributesListPage,this.getNestedTemplates(i),this.renderTemplateOrSlot("attributes:list:after"))},this.__renderAttributes=()=>{const{lang:t,ns:e}=this,s=this.hiddenSelector.zoom("attributes");return a(G||(G=Y` ${0} <section class="pt-m" data-testid="attributes"> <header class="space-x-m flex items-center mb-s"> <h2 class="text-l font-medium"> <foxy-i18n ns="${0}" lang="${0}" key="attribute_plural"></foxy-i18n> </h2> ${0} </header> ${0} </section> ${0} `),this.renderTemplateOrSlot("attributes:before"),e,t,s.matches("actions",!0)?"":this.__renderAttributesActions(),s.matches("list",!0)?"":this.__renderAttributesList(),this.renderTemplateOrSlot("attributes:after"))},this.__renderTransactions=()=>{let t="";if(this.in({idle:"snapshot"})){const e=new URL(this.data._links["fx:transactions"].href);e.searchParams.set("zoom","items"),t=e.toString()}return a(W||(W=Y` ${0} <x-group frame> <foxy-collection-pages data-testid="transactions" spinner="foxy-spinner" first="${0}" class="divide-y divide-contrast-10 block mx-m" group="${0}" page="foxy-transactions-table" lang="${0}" ns="${0}" .templates="${0}"> </foxy-collection-pages> </x-group> ${0} `),this.renderTemplateOrSlot("transactions:before"),t,this.group,this.lang,this.ns,this.getNestedTemplates("transactions:table"),this.renderTemplateOrSlot("transactions:after"))},this.__subscriptionsTableColumns=[g.priceColumn,g.summaryColumn,g.statusColumn,{cell:({html:t,lang:e,data:s})=>t(B||(B=Y`
114
114
  <vaadin-button
115
115
  data-testclass="edit"
116
116
  theme="small tertiary-inline"
@@ -1 +1 @@
1
- import"./foxy-spinner.js";import"./shared-029816d7.js";import{T as s}from"./shared-00c2793e.js";import{a}from"./shared-5fa697c4.js";import{h as e}from"./shared-7f33a83a.js";import"./shared-ff9791cf.js";import"./shared-43f449bb.js";import"./shared-30d00b64.js";import"./shared-1522d76f.js";import"./shared-30cbf0a6.js";import"./shared-343d1fd7.js";import"./shared-b23c903e.js";import"./shared-d3bf9ac0.js";import"./foxy-nucleon-element.js";import"./shared-6a7f96c4.js";import"./shared-07e9d1fb.js";import"./shared-3ab0306f.js";import"./shared-eb116b3e.js";import"./shared-4e709717.js";let t,n,o,r,d=s=>s;class m extends(a(s,"customers-table")){constructor(){super(...arguments),this.columns=[m.nameColumn,m.idColumn,m.dateColumn,m.emailColumn]}}m.nameColumn={cell:s=>e(t||(t=d` <span data-testclass="names">${0} ${0}</span> `),s.data.first_name,s.data.last_name)},m.idColumn={hideBelow:"md",cell:s=>e(n||(n=d` <span role="presentation" class="text-m text-tertiary">ID&nbsp;</span> <span data-testclass="ids" class="text-m text-secondary font-tnum">${0}</span> `),s.data.id)},m.dateColumn={hideBelow:"md",cell:s=>e(o||(o=d` <span class="text-m text-secondary font-tnum"> <foxy-i18n data-testclass="i18n" lang="${0}" key="date_created" ns="${0}"> </foxy-i18n> <foxy-i18n data-testclass="dates i18n" lang="${0}" key="date" ns="${0}" .options="${0}"> </foxy-i18n> </span> `),s.lang,s.ns,s.lang,s.ns,{value:s.data.date_created})},m.emailColumn={cell:s=>e(r||(r=d`<span data-testclass="emails" class="text-m text-secondary">${0}</span>`),s.data.email)},m.__ns="customers-table",customElements.define("foxy-customers-table",m);export{m as CustomersTable};
1
+ import"./foxy-spinner.js";import"./shared-8d51eaa6.js";import{T as s}from"./shared-16b391d9.js";import{a}from"./shared-550f9cae.js";import{h as e}from"./shared-7f33a83a.js";import"./shared-902b0773.js";import"./shared-1c07b1be.js";import"./shared-31b7a6ad.js";import"./shared-1522d76f.js";import"./shared-30cbf0a6.js";import"./shared-343d1fd7.js";import"./shared-b23c903e.js";import"./shared-d3bf9ac0.js";import"./foxy-nucleon-element.js";import"./shared-6a7f96c4.js";import"./shared-07e9d1fb.js";import"./shared-3ab0306f.js";import"./shared-eb116b3e.js";import"./shared-4e709717.js";let t,n,o,r,d=s=>s;class m extends(a(s,"customers-table")){constructor(){super(...arguments),this.columns=[m.nameColumn,m.idColumn,m.dateColumn,m.emailColumn]}}m.nameColumn={cell:s=>e(t||(t=d` <span data-testclass="names">${0} ${0}</span> `),s.data.first_name,s.data.last_name)},m.idColumn={hideBelow:"md",cell:s=>e(n||(n=d` <span role="presentation" class="text-m text-tertiary">ID&nbsp;</span> <span data-testclass="ids" class="text-m text-secondary font-tnum">${0}</span> `),s.data.id)},m.dateColumn={hideBelow:"md",cell:s=>e(o||(o=d` <span class="text-m text-secondary font-tnum"> <foxy-i18n data-testclass="i18n" lang="${0}" key="date_created" ns="${0}"> </foxy-i18n> <foxy-i18n data-testclass="dates i18n" lang="${0}" key="date" ns="${0}" .options="${0}"> </foxy-i18n> </span> `),s.lang,s.ns,s.lang,s.ns,{value:s.data.date_created})},m.emailColumn={cell:s=>e(r||(r=d`<span data-testclass="emails" class="text-m text-secondary">${0}</span>`),s.data.email)},m.__ns="customers-table",customElements.define("foxy-customers-table",m);export{m as CustomersTable};