@foxy.io/elements 1.53.3 → 1.54.0

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 (73) hide show
  1. package/dist/cdn/foxy-address-form.js +1 -1
  2. package/dist/cdn/foxy-admin-subscription-form.js +1 -1
  3. package/dist/cdn/foxy-api-browser.js +1 -1
  4. package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
  5. package/dist/cdn/foxy-attribute-form.js +1 -1
  6. package/dist/cdn/foxy-cart-form.js +1 -1
  7. package/dist/cdn/foxy-client-form.js +1 -1
  8. package/dist/cdn/foxy-coupon-code-form.js +1 -1
  9. package/dist/cdn/foxy-coupon-codes-form.js +1 -1
  10. package/dist/cdn/foxy-coupon-form.js +1 -1
  11. package/dist/cdn/foxy-custom-field-form.js +1 -1
  12. package/dist/cdn/foxy-customer-form.js +1 -1
  13. package/dist/cdn/foxy-customer-portal-settings-form.js +1 -1
  14. package/dist/cdn/foxy-customer-portal.js +11 -11
  15. package/dist/cdn/foxy-customer.js +1 -1
  16. package/dist/cdn/foxy-downloadable-form.js +1 -1
  17. package/dist/cdn/foxy-email-template-form.js +1 -1
  18. package/dist/cdn/foxy-experimental-add-to-cart-builder.js +1 -1
  19. package/dist/cdn/foxy-filter-attribute-form.js +1 -1
  20. package/dist/cdn/foxy-generate-codes-form.js +1 -1
  21. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  22. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  23. package/dist/cdn/foxy-gift-card-form.js +1 -1
  24. package/dist/cdn/foxy-integration-form.js +1 -1
  25. package/dist/cdn/foxy-item-category-form.js +1 -1
  26. package/dist/cdn/foxy-item-form.js +1 -1
  27. package/dist/cdn/foxy-item-option-form.js +1 -1
  28. package/dist/cdn/foxy-native-integration-form.js +1 -1
  29. package/dist/cdn/foxy-passkey-form.js +1 -1
  30. package/dist/cdn/foxy-payment-method-card.js +1 -1
  31. package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
  32. package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
  33. package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
  34. package/dist/cdn/foxy-payments-api.js +1 -1
  35. package/dist/cdn/foxy-report-form.js +1 -1
  36. package/dist/cdn/foxy-store-form.js +1 -1
  37. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  38. package/dist/cdn/foxy-store-transaction-folder-form.js +1 -1
  39. package/dist/cdn/foxy-subscription-form.js +1 -1
  40. package/dist/cdn/foxy-subscription-settings-form.js +1 -1
  41. package/dist/cdn/foxy-tax-form.js +1 -1
  42. package/dist/cdn/foxy-template-config-form.js +1 -1
  43. package/dist/cdn/foxy-template-form.js +1 -1
  44. package/dist/cdn/foxy-template-set-form.js +1 -1
  45. package/dist/cdn/foxy-transaction.js +1 -1
  46. package/dist/cdn/foxy-update-payment-method-form.js +1 -1
  47. package/dist/cdn/foxy-user-form.js +1 -1
  48. package/dist/cdn/foxy-user-invitation-form.js +1 -1
  49. package/dist/cdn/foxy-users-table.js +1 -1
  50. package/dist/cdn/foxy-webhook-form.js +1 -1
  51. package/dist/cdn/{shared-ad26f72d.js → shared-13fed57b.js} +1 -1
  52. package/dist/cdn/{shared-e44d4a56.js → shared-6418bbb8.js} +1 -1
  53. package/dist/cdn/{shared-842078ca.js → shared-db8913cf.js} +1 -1
  54. package/dist/cdn/translations/payments-api-payment-method-form/en.json +51 -1
  55. package/dist/elements/internal/InternalForm/InternalForm.js +5 -3
  56. package/dist/elements/internal/InternalForm/InternalForm.js.map +1 -1
  57. package/dist/elements/internal/InternalForm/types.d.ts +2 -0
  58. package/dist/elements/internal/InternalForm/types.js.map +1 -1
  59. package/dist/elements/public/PaymentsApi/api/composers/payment_method.js +11 -5
  60. package/dist/elements/public/PaymentsApi/api/composers/payment_method.js.map +1 -1
  61. package/dist/elements/public/PaymentsApi/api/composers/payment_methods.js +1 -0
  62. package/dist/elements/public/PaymentsApi/api/composers/payment_methods.js.map +1 -1
  63. package/dist/elements/public/PaymentsApi/api/composers/payment_preset.js +1 -0
  64. package/dist/elements/public/PaymentsApi/api/composers/payment_preset.js.map +1 -1
  65. package/dist/elements/public/PaymentsApi/api/types.d.ts +3 -0
  66. package/dist/elements/public/PaymentsApi/api/types.js.map +1 -1
  67. package/dist/elements/public/PaymentsApiPaymentMethodForm/PaymentsApiPaymentMethodForm.d.ts +14 -0
  68. package/dist/elements/public/PaymentsApiPaymentMethodForm/PaymentsApiPaymentMethodForm.js +197 -16
  69. package/dist/elements/public/PaymentsApiPaymentMethodForm/PaymentsApiPaymentMethodForm.js.map +1 -1
  70. package/dist/elements/public/PaymentsApiPaymentPresetForm/PaymentsApiPaymentPresetForm.d.ts +2 -0
  71. package/dist/elements/public/PaymentsApiPaymentPresetForm/PaymentsApiPaymentPresetForm.js +4 -0
  72. package/dist/elements/public/PaymentsApiPaymentPresetForm/PaymentsApiPaymentPresetForm.js.map +1 -1
  73. package/package.json +4 -2
@@ -1 +1 @@
1
- import"./shared-540adfea.js";import"./shared-f892683b.js";import"./shared-e77c5c90.js";import"./shared-01cd4e3c.js";import"./shared-909b8221.js";import"./shared-ee48a1ed.js";import{I as e}from"./shared-ad26f72d.js";import"./shared-9ed0a201.js";import{a as t}from"./shared-887ac0b0.js";import{B as i}from"./shared-8f9014ff.js";import{p as s}from"./shared-b1fa9899.js";import{h as o}from"./shared-ba5c42c7.js";import"./shared-3426159a.js";import{p as n}from"./shared-9b35fe34.js";import{I as a}from"./shared-b2f675d4.js";import"./shared-1d6a5e81.js";import"./shared-8449b585.js";import"./shared-9687ab7b.js";import"./shared-0fd68dc0.js";import"./shared-8d8975d5.js";import"./shared-99c53365.js";import"./shared-db623837.js";import"./shared-6cdfb858.js";import"./shared-0f92b865.js";import"./shared-2bb1f0f4.js";import"./shared-5212ef4f.js";import"./shared-41c9c53f.js";import"./shared-53e42a77.js";import"./shared-930e68b7.js";import"./shared-2b39e4d4.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-4e709717.js";import"./shared-5fd5805c.js";import"./shared-d0aed1c1.js";import"./shared-53e476fd.js";import"./shared-65094878.js";import"./shared-515003f6.js";import"./shared-a20ef119.js";import"./shared-b5e048f5.js";import"./shared-9a3bf65c.js";import"./shared-7892fd3f.js";import"./shared-a5d6db21.js";import"./shared-a0baefff.js";import"./shared-f8e360e6.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-19073761.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-609c9693.js";import"./shared-058530fc.js";import"./foxy-pagination.js";import"./shared-f6c6ce5f.js";import"./shared-8df8e77c.js";import"./shared-9d4fecb9.js";import"./shared-a0309d5f.js";import"./shared-ce05e482.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";let r,l=e=>e;const d=t(e);customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-form",class extends d{constructor(){super(...arguments),this.__valuesInputParams={type:"number",step:"1",min:"1",max:"999"},this.__valuesGetValue=()=>{var e;return null===(e=this.form.values)||void 0===e?void 0:e.map((e=>{if(".5m"===e)return{value:e,label:this.t("values.twice_a_week")};const{units:t,count:i}=s(e);return{value:e,label:this.t(`values.${t}`,{count:i})}}))},this.__valuesSetValue=e=>{const t=e.filter((({value:e})=>parseFloat(e)<=999)).map((({unit:e,value:t})=>e?`${t}${e}`:t)).filter(((e,t,i)=>i.indexOf(e)===t));this.edit({values:t})}}static get v8n(){return[({jsonataQuery:e})=>!!e||"jsonata-query:v8n_required",({jsonataQuery:e})=>!e||e.length<=200||"jsonata-query:v8n_too_long",({values:e})=>!!e&&e.length>0||"values:v8n_required",({values:e})=>!e||e.length<=20||"values:v8n_too_long"]}get hiddenSelector(){return new i(`timestamps ${super.hiddenSelector}`.trim())}renderBody(){return o(r||(r=l` <foxy-internal-source-control infer="jsonata-query" property="jsonataQuery"> </foxy-internal-source-control> <foxy-internal-editable-list-control infer="values" .inputParams="${0}" .getValue="${0}" .setValue="${0}" .units="${0}"> </foxy-internal-editable-list-control> ${0} `),this.__valuesInputParams,this.__valuesGetValue,this.__valuesSetValue,[{label:this.t("values.unit_years"),value:"y"},{label:this.t("values.unit_months"),value:"m"},{label:this.t("values.unit_weeks"),value:"w"},{label:this.t("values.unit_days"),value:"d"}],super.renderBody())}});let u,c=e=>e;const f=t(a);customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-card",class extends f{renderBody(){var e;const{jsonataQuery:t,values:i}=null!==(e=this.data)&&void 0!==e?e:{},n=null==i?void 0:i.map((e=>{if(".5m"===e)return this.t("twice_a_week");const{units:t,count:i}=s(e);return this.t(t,{count:i})}));return o(u||(u=c` <section class="h-s flex flex-col justify-center leading-xs"> <p class="text-m font-medium min-w-0"> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> </p> <p class="text-s text-secondary min-w-0"> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> </p> </section> `),"*"===t?"title_all":"title_matching",{query:t},(null==i?void 0:i.length)?"subtitle_list":"subtitle_empty",{list:null==n?void 0:n.join(", ")})}});let h,p=e=>e;const m=t(e);customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-form",class extends m{constructor(){super(...arguments),this.__minmaxRestrictionsGetValue=()=>{const e=[],t=this.form;return t.min&&e.push("min"),t.max&&e.push("max"),e},this.__minmaxRestrictionsSetValue=e=>{const t=this.form;this.edit({min:e.includes("min")?t.min||"1m":null,max:e.includes("max")?t.max||"1y":null})},this.__minmaxRestrictionsOptions=[{label:"option_min",value:"min"},{label:"option_max",value:"max"}],this.__dayAndDateRestrictionsGetValue=()=>{var e;const t=null===(e=this.form.allowedDays)||void 0===e?void 0:e.type;return"day"===t?"days":"month"===t?"dates":"none"},this.__dayAndDateRestrictionsSetValue=e=>{"dates"===e?this.edit({allowedDays:{type:"month",days:[]}}):"days"===e?this.edit({allowedDays:{type:"day",days:[]}}):this.edit({allowedDays:null})},this.__dayAndDateRestrictionsOptions=[{label:"option_none",value:"none"},{label:"option_dates",value:"dates"},{label:"option_days",value:"days"}],this.__daysOfWeekGetValue=()=>{var e,t;return null!==(t=null===(e=this.form.allowedDays)||void 0===e?void 0:e.days.map((e=>String(e))))&&void 0!==t?t:[]},this.__daysOfWeekSetValue=e=>{this.edit({allowedDays:{type:"day",days:e.map(Number)}})},this.__daysOfWeekOptions=[{label:"option_1",value:"1"},{label:"option_2",value:"2"},{label:"option_3",value:"3"},{label:"option_4",value:"4"},{label:"option_5",value:"5"},{label:"option_6",value:"6"},{label:"option_7",value:"7"}],this.__datesOfMonthInputParams={type:"number",min:"1",max:"31",step:"1"},this.__datesOfMonthGetValue=()=>{var e,t;return null!==(t=null===(e=this.form.allowedDays)||void 0===e?void 0:e.days.map((e=>({value:String(e)}))))&&void 0!==t?t:[]},this.__datesOfMonthSetValue=e=>{this.edit({allowedDays:{type:"month",days:e.map((e=>parseInt(e.value))).filter((e=>Number.isInteger(e)&&e>=1&&e<=31))}})},this.__disallowedDatesInputParams={type:"date"},this.__disallowedDatesGetValue=()=>{var e,t;return null!==(t=null===(e=this.form.disallowedDates)||void 0===e?void 0:e.map((e=>({value:e}))))&&void 0!==t?t:[]},this.__disallowedDatesSetValue=e=>{this.edit({disallowedDates:e.map((e=>e.value))})}}static get v8n(){return[({jsonataQuery:e})=>!!e||"jsonata-query:v8n_required",({jsonataQuery:e})=>!e||e.length<=200||"jsonata-query:v8n_too_long",({disallowedDates:e})=>!e||e.length<=10||"disallowed-dates:v8n_too_long"]}get hiddenSelector(){var e,t;const s=["timestamps",super.hiddenSelector.toString()],o=this.form;return o.min||s.unshift("min"),o.max||s.unshift("max"),"day"!==(null===(e=o.allowedDays)||void 0===e?void 0:e.type)&&s.unshift("days-of-week"),"month"!==(null===(t=o.allowedDays)||void 0===t?void 0:t.type)&&s.unshift("dates-of-month"),new i(s.join(" ").trim())}renderBody(){return o(h||(h=p` <foxy-internal-source-control infer="jsonata-query" property="jsonataQuery"> </foxy-internal-source-control> <foxy-internal-checkbox-group-control infer="minmax-restrictions" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-frequency-control infer="min"></foxy-internal-frequency-control> <foxy-internal-frequency-control infer="max"></foxy-internal-frequency-control> <foxy-internal-radio-group-control infer="day-and-date-restrictions" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-checkbox-group-control infer="days-of-week" theme="vertical" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-editable-list-control infer="dates-of-month" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-editable-list-control infer="disallowed-dates" range="optional" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> ${0} `),this.__minmaxRestrictionsGetValue,this.__minmaxRestrictionsSetValue,this.__minmaxRestrictionsOptions,this.__dayAndDateRestrictionsGetValue,this.__dayAndDateRestrictionsSetValue,this.__dayAndDateRestrictionsOptions,this.__daysOfWeekGetValue,this.__daysOfWeekSetValue,this.__daysOfWeekOptions,this.__datesOfMonthInputParams,this.__datesOfMonthGetValue,this.__datesOfMonthSetValue,this.__disallowedDatesInputParams,this.__disallowedDatesGetValue,this.__disallowedDatesSetValue,super.renderBody())}});let y,_=e=>e;const v=t(a);function x(e){try{return new URL(e).origin===e.toLowerCase()}catch(e){return!1}}customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-card",class extends v{renderBody(){var e;const{min:t,max:i,allowedDays:s,jsonataQuery:a,disallowedDates:r}=null!==(e=this.data)&&void 0!==e?e:{},l=t?n(t):void 0,d=i?n(i):void 0,u="*"===a?"line_1_all":"line_1_matching",c={query:a},f={from:l?this.t(`unit_${l.units}`,{count:l.count}):this.t("any"),to:d?this.t(`unit_${d.units}`,{count:d.count}):this.t("any")},h=`line_3_${s?s.type:"any"}`,p={list:"month"===(null==s?void 0:s.type)?null==s?void 0:s.days.join(", "):null==s?void 0:s.days.map((e=>this.t(`day_${e}`))).join(", ")},m=r?"line_4_some":"line_4_none",v={list:null==r?void 0:r.map((e=>{const[t,i]=e.split("..");return t&&i?this.t("date_range",{from:t,to:i}):this.t("single_date",{value:e})})).join(", ")};return o(y||(y=_` <section class="leading-xs" style="margin:-.25ch 0"> <p class="text-m font-medium truncate"> <foxy-i18n infer="" key="${0}" .options="${0}"></foxy-i18n> </p> <p class="text-s text-secondary"> <foxy-i18n infer="" class="block truncate" key="line_2" .options="${0}"> </foxy-i18n> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> </p> </section> `),u,c,f,h,p,m,v)}});let g,b=e=>e;const w=t(e,"customer-portal-settings-form");class j extends w{constructor(){super(...arguments),this.__sessionLifespanInMinutesOptions=[{value:"m",label:"option_minute"},{value:"h",label:"option_hour"},{value:"d",label:"option_day"},{value:"w",label:"option_week"}],this.__sessionLifespanInMinutesGetValue=()=>{var e;const t=null!==(e=this.form.sessionLifespanInMinutes)&&void 0!==e?e:0;return t%10080==0?t/10080+"w":t%1440==0?t/1440+"d":t%60==0?t/60+"h":`${t}m`},this.__sessionLifespanInMinutesSetValue=e=>{const t=parseInt(e);e.endsWith("w")?this.edit({sessionLifespanInMinutes:10080*t}):e.endsWith("d")?this.edit({sessionLifespanInMinutes:1440*t}):e.endsWith("h")?this.edit({sessionLifespanInMinutes:60*t}):this.edit({sessionLifespanInMinutes:t})},this.__allowedOriginsGetValue=()=>{var e;return null===(e=this.form.allowedOrigins)||void 0===e?void 0:e.map((e=>({label:x(e)?e:`⚠️ ${e}`,value:e})))},this.__allowedOriginsSetValue=e=>{this.edit({allowedOrigins:e.map((({value:e})=>function(e){try{return new URL(e).origin}catch(t){return e}}(e))).filter(((e,t,i)=>i.indexOf(e)===t))})},this.__ssoGetValue=()=>{var e;return null!==(e=this.form.sso)&&void 0!==e&&e},this.__ssoSetValue=e=>{this.edit({sso:e})},this.__signUpGetValue=()=>{var e,t;return null!==(t=null===(e=this.form.signUp)||void 0===e?void 0:e.enabled)&&void 0!==t&&t},this.__signUpSetValue=e=>{var t,i;this.edit({signUp:{enabled:e,verification:null!==(i=null===(t=this.form.signUp)||void 0===t?void 0:t.verification)&&void 0!==i?i:{type:"hcaptcha",siteKey:"",secretKey:""}}})},this.__frequencyModificationGetValue=()=>{var e,t;return(null!==(t=null===(e=this.form.subscriptions)||void 0===e?void 0:e.allowFrequencyModification.length)&&void 0!==t?t:0)>0},this.__frequencyModificationSetValue=e=>{var t,i,s,o;const n=null!==(i=null===(t=this.form.subscriptions)||void 0===t?void 0:t.allowFrequencyModification)&&void 0!==i?i:[];this.edit({subscriptions:{allowFrequencyModification:e?0===n.length?[{jsonataQuery:"*",values:[]}]:n:[],allowNextDateModification:null!==(o=null===(s=this.form.subscriptions)||void 0===s?void 0:s.allowNextDateModification)&&void 0!==o&&o}})},this.__nextDateModificationGetValue=()=>{var e,t;return null!==(t=null===(e=this.form.subscriptions)||void 0===e?void 0:e.allowNextDateModification)&&void 0!==t&&t},this.__nextDateModificationSetValue=e=>{var t,i,s;const o=null!==(i=null===(t=this.form.subscriptions)||void 0===t?void 0:t.allowFrequencyModification)&&void 0!==i?i:[];this.edit({subscriptions:{allowFrequencyModification:o,allowNextDateModification:!!e&&((null===(s=this.form.subscriptions)||void 0===s?void 0:s.allowNextDateModification)||[])}})},this.__signUpVerificationHcaptchaSiteKeyGetValue=()=>{var e,t,i;return null!==(i=null===(t=null===(e=this.form.signUp)||void 0===e?void 0:e.verification)||void 0===t?void 0:t.siteKey)&&void 0!==i?i:""},this.__signUpVerificationHcaptchaSiteKeySetValue=e=>{var t,i,s,o;this.edit({signUp:{enabled:!!(null===(t=this.form.signUp)||void 0===t?void 0:t.enabled),verification:{secretKey:null!==(o=null===(s=null===(i=this.form.signUp)||void 0===i?void 0:i.verification)||void 0===s?void 0:s.secretKey)&&void 0!==o?o:"",siteKey:e,type:"hcaptcha"}}})},this.__signUpVerificationHcaptchaSecretKeyGetValue=()=>{var e,t,i;return null!==(i=null===(t=null===(e=this.form.signUp)||void 0===e?void 0:e.verification)||void 0===t?void 0:t.secretKey)&&void 0!==i?i:""},this.__signUpVerificationHcaptchaSecretKeySetValue=e=>{var t,i,s,o;this.edit({signUp:{enabled:!!(null===(t=this.form.signUp)||void 0===t?void 0:t.enabled),verification:{secretKey:e,siteKey:null!==(o=null===(s=null===(i=this.form.signUp)||void 0===i?void 0:i.verification)||void 0===s?void 0:s.siteKey)&&void 0!==o?o:"",type:"hcaptcha"}}})},this.__jwtSecretGeneratorOptions={charset:"abcdefghijklmnopqrstuvwxyz0123456789",length:64}}static get v8n(){return[({sessionLifespanInMinutes:e})=>"number"!=typeof e||e<=40320||"session-lifespan-in-minutes:v8n_too_long",({allowedOrigins:e=[]})=>e.length<=10||"allowed-origins:v8n_too_many",({allowedOrigins:e=[]})=>e.every(x)||"allowed-origins:v8n_invalid",({jwtSharedSecret:e})=>!e||/^[a-z0-9-]+$/.test(e)||"jwt-shared-secret:v8n_invalid",({jwtSharedSecret:e})=>!e||e.length>=40||"jwt-shared-secret:v8n_too_short",({jwtSharedSecret:e})=>!e||e.length<=100||"jwt-shared-secret:v8n_too_long",({signUp:e})=>{const t=null==e?void 0:e.verification.siteKey;return!t||t.length<=100||"sign-up-verification-hcaptcha-site-key:v8n_too_long"},({signUp:e})=>{const t=null==e?void 0:e.verification.secretKey;return!t||t.length<=100||"sign-up-verification-hcaptcha-secret-key:v8n_too_long"}]}get hiddenSelector(){var e,t,s;const o=["header:copy-id",super.hiddenSelector.toString()];return(null===(e=this.form.signUp)||void 0===e?void 0:e.enabled)||o.push("hcaptcha"),(null===(t=this.form.subscriptions)||void 0===t?void 0:t.allowFrequencyModification.length)||o.push("subscriptions-allow-frequency-modification"),(null===(s=this.form.subscriptions)||void 0===s?void 0:s.allowNextDateModification)||o.push("subscriptions-allow-next-date-modification"),new i(o.join(" ").trim())}renderBody(){return o(g||(g=b` ${0} <foxy-internal-editable-list-control infer="allowed-origins" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-summary-control infer="features"> <foxy-internal-switch-control infer="sso" .getValue="${0}" .setValue="${0}"></foxy-internal-switch-control> <foxy-internal-switch-control infer="sign-up" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> <foxy-internal-switch-control infer="frequency-modification" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> <foxy-internal-switch-control infer="next-date-modification" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="hcaptcha"> <foxy-internal-password-control layout="summary-item" infer="sign-up-verification-hcaptcha-site-key" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> <foxy-internal-password-control layout="summary-item" infer="sign-up-verification-hcaptcha-secret-key" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> </foxy-internal-summary-control> <foxy-internal-async-list-control first="foxy://${0}/form/subscriptions/allowFrequencyModification" infer="subscriptions-allow-frequency-modification" limit="20" form="foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-form" item="foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-card" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control first="foxy://${0}/form/subscriptions/allowNextDateModification" infer="subscriptions-allow-next-date-modification" limit="20" form="foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-form" item="foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-card" alert> </foxy-internal-async-list-control> <foxy-internal-summary-control infer="security"> <foxy-internal-frequency-control layout="summary-item" infer="session-lifespan-in-minutes" max="" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-frequency-control> <foxy-internal-password-control layout="summary-item" property="jwtSharedSecret" infer="jwt-shared-secret" show-generator .generatorOptions="${0}"> </foxy-internal-password-control> </foxy-internal-summary-control> ${0} `),this.renderHeader(),this.__allowedOriginsGetValue,this.__allowedOriginsSetValue,this.__ssoGetValue,this.__ssoSetValue,this.__signUpGetValue,this.__signUpSetValue,this.__frequencyModificationGetValue,this.__frequencyModificationSetValue,this.__nextDateModificationGetValue,this.__nextDateModificationSetValue,this.__signUpVerificationHcaptchaSiteKeyGetValue,this.__signUpVerificationHcaptchaSiteKeySetValue,this.__signUpVerificationHcaptchaSecretKeyGetValue,this.__signUpVerificationHcaptchaSecretKeySetValue,this.virtualHost,this.virtualHost,this.__sessionLifespanInMinutesGetValue,this.__sessionLifespanInMinutesSetValue,this.__sessionLifespanInMinutesOptions,this.__jwtSecretGeneratorOptions,super.renderBody())}async _sendPost(e){return this.__removeNullProperties(e),super._sendPost(e)}async _sendPatch(e){return this.__removeNullProperties(e),super._sendPatch(e)}__removeNullProperties(e){var t,i;"object"==typeof(null===(t=e.subscriptions)||void 0===t?void 0:t.allowNextDateModification)&&(null===(i=e.subscriptions)||void 0===i||i.allowNextDateModification.forEach((e=>{for(const t in e){const i=t;null===e[i]&&delete e[i]}})))}}customElements.define("foxy-customer-portal-settings-form",j);export{j as CustomerPortalSettingsForm};
1
+ import"./shared-540adfea.js";import"./shared-f892683b.js";import"./shared-e77c5c90.js";import"./shared-01cd4e3c.js";import"./shared-909b8221.js";import"./shared-ee48a1ed.js";import{I as e}from"./shared-13fed57b.js";import"./shared-9ed0a201.js";import{a as t}from"./shared-887ac0b0.js";import{B as i}from"./shared-8f9014ff.js";import{p as s}from"./shared-b1fa9899.js";import{h as o}from"./shared-ba5c42c7.js";import"./shared-3426159a.js";import{p as n}from"./shared-9b35fe34.js";import{I as a}from"./shared-b2f675d4.js";import"./shared-1d6a5e81.js";import"./shared-8449b585.js";import"./shared-9687ab7b.js";import"./shared-0fd68dc0.js";import"./shared-8d8975d5.js";import"./shared-99c53365.js";import"./shared-db623837.js";import"./shared-6cdfb858.js";import"./shared-0f92b865.js";import"./shared-2bb1f0f4.js";import"./shared-5212ef4f.js";import"./shared-41c9c53f.js";import"./shared-53e42a77.js";import"./shared-930e68b7.js";import"./shared-2b39e4d4.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-4e709717.js";import"./shared-5fd5805c.js";import"./shared-d0aed1c1.js";import"./shared-53e476fd.js";import"./shared-65094878.js";import"./shared-515003f6.js";import"./shared-a20ef119.js";import"./shared-b5e048f5.js";import"./shared-9a3bf65c.js";import"./shared-7892fd3f.js";import"./shared-a5d6db21.js";import"./shared-a0baefff.js";import"./shared-f8e360e6.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-19073761.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-609c9693.js";import"./shared-058530fc.js";import"./foxy-pagination.js";import"./shared-f6c6ce5f.js";import"./shared-8df8e77c.js";import"./shared-9d4fecb9.js";import"./shared-a0309d5f.js";import"./shared-ce05e482.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";let r,l=e=>e;const u=t(e);customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-form",class extends u{constructor(){super(...arguments),this.__valuesInputParams={type:"number",step:"1",min:"1",max:"999"},this.__valuesGetValue=()=>{var e;return null===(e=this.form.values)||void 0===e?void 0:e.map((e=>{if(".5m"===e)return{value:e,label:this.t("values.twice_a_week")};const{units:t,count:i}=s(e);return{value:e,label:this.t(`values.${t}`,{count:i})}}))},this.__valuesSetValue=e=>{const t=e.filter((({value:e})=>parseFloat(e)<=999)).map((({unit:e,value:t})=>e?`${t}${e}`:t)).filter(((e,t,i)=>i.indexOf(e)===t));this.edit({values:t})}}static get v8n(){return[({jsonataQuery:e})=>!!e||"jsonata-query:v8n_required",({jsonataQuery:e})=>!e||e.length<=200||"jsonata-query:v8n_too_long",({values:e})=>!!e&&e.length>0||"values:v8n_required",({values:e})=>!e||e.length<=20||"values:v8n_too_long"]}get hiddenSelector(){return new i(`timestamps ${super.hiddenSelector}`.trim())}renderBody(){return o(r||(r=l` <foxy-internal-source-control infer="jsonata-query" property="jsonataQuery"> </foxy-internal-source-control> <foxy-internal-editable-list-control infer="values" .inputParams="${0}" .getValue="${0}" .setValue="${0}" .units="${0}"> </foxy-internal-editable-list-control> ${0} `),this.__valuesInputParams,this.__valuesGetValue,this.__valuesSetValue,[{label:this.t("values.unit_years"),value:"y"},{label:this.t("values.unit_months"),value:"m"},{label:this.t("values.unit_weeks"),value:"w"},{label:this.t("values.unit_days"),value:"d"}],super.renderBody())}});let d,c=e=>e;const f=t(a);customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-card",class extends f{renderBody(){var e;const{jsonataQuery:t,values:i}=null!==(e=this.data)&&void 0!==e?e:{},n=null==i?void 0:i.map((e=>{if(".5m"===e)return this.t("twice_a_week");const{units:t,count:i}=s(e);return this.t(t,{count:i})}));return o(d||(d=c` <section class="h-s flex flex-col justify-center leading-xs"> <p class="text-m font-medium min-w-0"> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> </p> <p class="text-s text-secondary min-w-0"> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> </p> </section> `),"*"===t?"title_all":"title_matching",{query:t},(null==i?void 0:i.length)?"subtitle_list":"subtitle_empty",{list:null==n?void 0:n.join(", ")})}});let h,p=e=>e;const m=t(e);customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-form",class extends m{constructor(){super(...arguments),this.__minmaxRestrictionsGetValue=()=>{const e=[],t=this.form;return t.min&&e.push("min"),t.max&&e.push("max"),e},this.__minmaxRestrictionsSetValue=e=>{const t=this.form;this.edit({min:e.includes("min")?t.min||"1m":null,max:e.includes("max")?t.max||"1y":null})},this.__minmaxRestrictionsOptions=[{label:"option_min",value:"min"},{label:"option_max",value:"max"}],this.__dayAndDateRestrictionsGetValue=()=>{var e;const t=null===(e=this.form.allowedDays)||void 0===e?void 0:e.type;return"day"===t?"days":"month"===t?"dates":"none"},this.__dayAndDateRestrictionsSetValue=e=>{"dates"===e?this.edit({allowedDays:{type:"month",days:[]}}):"days"===e?this.edit({allowedDays:{type:"day",days:[]}}):this.edit({allowedDays:null})},this.__dayAndDateRestrictionsOptions=[{label:"option_none",value:"none"},{label:"option_dates",value:"dates"},{label:"option_days",value:"days"}],this.__daysOfWeekGetValue=()=>{var e,t;return null!==(t=null===(e=this.form.allowedDays)||void 0===e?void 0:e.days.map((e=>String(e))))&&void 0!==t?t:[]},this.__daysOfWeekSetValue=e=>{this.edit({allowedDays:{type:"day",days:e.map(Number)}})},this.__daysOfWeekOptions=[{label:"option_1",value:"1"},{label:"option_2",value:"2"},{label:"option_3",value:"3"},{label:"option_4",value:"4"},{label:"option_5",value:"5"},{label:"option_6",value:"6"},{label:"option_7",value:"7"}],this.__datesOfMonthInputParams={type:"number",min:"1",max:"31",step:"1"},this.__datesOfMonthGetValue=()=>{var e,t;return null!==(t=null===(e=this.form.allowedDays)||void 0===e?void 0:e.days.map((e=>({value:String(e)}))))&&void 0!==t?t:[]},this.__datesOfMonthSetValue=e=>{this.edit({allowedDays:{type:"month",days:e.map((e=>parseInt(e.value))).filter((e=>Number.isInteger(e)&&e>=1&&e<=31))}})},this.__disallowedDatesInputParams={type:"date"},this.__disallowedDatesGetValue=()=>{var e,t;return null!==(t=null===(e=this.form.disallowedDates)||void 0===e?void 0:e.map((e=>({value:e}))))&&void 0!==t?t:[]},this.__disallowedDatesSetValue=e=>{this.edit({disallowedDates:e.map((e=>e.value))})}}static get v8n(){return[({jsonataQuery:e})=>!!e||"jsonata-query:v8n_required",({jsonataQuery:e})=>!e||e.length<=200||"jsonata-query:v8n_too_long",({disallowedDates:e})=>!e||e.length<=10||"disallowed-dates:v8n_too_long"]}get hiddenSelector(){var e,t;const s=["timestamps",super.hiddenSelector.toString()],o=this.form;return o.min||s.unshift("min"),o.max||s.unshift("max"),"day"!==(null===(e=o.allowedDays)||void 0===e?void 0:e.type)&&s.unshift("days-of-week"),"month"!==(null===(t=o.allowedDays)||void 0===t?void 0:t.type)&&s.unshift("dates-of-month"),new i(s.join(" ").trim())}renderBody(){return o(h||(h=p` <foxy-internal-source-control infer="jsonata-query" property="jsonataQuery"> </foxy-internal-source-control> <foxy-internal-checkbox-group-control infer="minmax-restrictions" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-frequency-control infer="min"></foxy-internal-frequency-control> <foxy-internal-frequency-control infer="max"></foxy-internal-frequency-control> <foxy-internal-radio-group-control infer="day-and-date-restrictions" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-checkbox-group-control infer="days-of-week" theme="vertical" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-editable-list-control infer="dates-of-month" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-editable-list-control infer="disallowed-dates" range="optional" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> ${0} `),this.__minmaxRestrictionsGetValue,this.__minmaxRestrictionsSetValue,this.__minmaxRestrictionsOptions,this.__dayAndDateRestrictionsGetValue,this.__dayAndDateRestrictionsSetValue,this.__dayAndDateRestrictionsOptions,this.__daysOfWeekGetValue,this.__daysOfWeekSetValue,this.__daysOfWeekOptions,this.__datesOfMonthInputParams,this.__datesOfMonthGetValue,this.__datesOfMonthSetValue,this.__disallowedDatesInputParams,this.__disallowedDatesGetValue,this.__disallowedDatesSetValue,super.renderBody())}});let y,_=e=>e;const v=t(a);function x(e){try{return new URL(e).origin===e.toLowerCase()}catch(e){return!1}}customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-card",class extends v{renderBody(){var e;const{min:t,max:i,allowedDays:s,jsonataQuery:a,disallowedDates:r}=null!==(e=this.data)&&void 0!==e?e:{},l=t?n(t):void 0,u=i?n(i):void 0,d="*"===a?"line_1_all":"line_1_matching",c={query:a},f={from:l?this.t(`unit_${l.units}`,{count:l.count}):this.t("any"),to:u?this.t(`unit_${u.units}`,{count:u.count}):this.t("any")},h=`line_3_${s?s.type:"any"}`,p={list:"month"===(null==s?void 0:s.type)?null==s?void 0:s.days.join(", "):null==s?void 0:s.days.map((e=>this.t(`day_${e}`))).join(", ")},m=r?"line_4_some":"line_4_none",v={list:null==r?void 0:r.map((e=>{const[t,i]=e.split("..");return t&&i?this.t("date_range",{from:t,to:i}):this.t("single_date",{value:e})})).join(", ")};return o(y||(y=_` <section class="leading-xs" style="margin:-.25ch 0"> <p class="text-m font-medium truncate"> <foxy-i18n infer="" key="${0}" .options="${0}"></foxy-i18n> </p> <p class="text-s text-secondary"> <foxy-i18n infer="" class="block truncate" key="line_2" .options="${0}"> </foxy-i18n> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> </p> </section> `),d,c,f,h,p,m,v)}});let g,b=e=>e;const w=t(e,"customer-portal-settings-form");class j extends w{constructor(){super(...arguments),this.__sessionLifespanInMinutesOptions=[{value:"m",label:"option_minute"},{value:"h",label:"option_hour"},{value:"d",label:"option_day"},{value:"w",label:"option_week"}],this.__sessionLifespanInMinutesGetValue=()=>{var e;const t=null!==(e=this.form.sessionLifespanInMinutes)&&void 0!==e?e:0;return t%10080==0?t/10080+"w":t%1440==0?t/1440+"d":t%60==0?t/60+"h":`${t}m`},this.__sessionLifespanInMinutesSetValue=e=>{const t=parseInt(e);e.endsWith("w")?this.edit({sessionLifespanInMinutes:10080*t}):e.endsWith("d")?this.edit({sessionLifespanInMinutes:1440*t}):e.endsWith("h")?this.edit({sessionLifespanInMinutes:60*t}):this.edit({sessionLifespanInMinutes:t})},this.__allowedOriginsGetValue=()=>{var e;return null===(e=this.form.allowedOrigins)||void 0===e?void 0:e.map((e=>({label:x(e)?e:`⚠️ ${e}`,value:e})))},this.__allowedOriginsSetValue=e=>{this.edit({allowedOrigins:e.map((({value:e})=>function(e){try{return new URL(e).origin}catch(t){return e}}(e))).filter(((e,t,i)=>i.indexOf(e)===t))})},this.__ssoGetValue=()=>{var e;return null!==(e=this.form.sso)&&void 0!==e&&e},this.__ssoSetValue=e=>{this.edit({sso:e})},this.__signUpGetValue=()=>{var e,t;return null!==(t=null===(e=this.form.signUp)||void 0===e?void 0:e.enabled)&&void 0!==t&&t},this.__signUpSetValue=e=>{var t,i;this.edit({signUp:{enabled:e,verification:null!==(i=null===(t=this.form.signUp)||void 0===t?void 0:t.verification)&&void 0!==i?i:{type:"hcaptcha",siteKey:"",secretKey:""}}})},this.__frequencyModificationGetValue=()=>{var e,t;return(null!==(t=null===(e=this.form.subscriptions)||void 0===e?void 0:e.allowFrequencyModification.length)&&void 0!==t?t:0)>0},this.__frequencyModificationSetValue=e=>{var t,i,s,o;const n=null!==(i=null===(t=this.form.subscriptions)||void 0===t?void 0:t.allowFrequencyModification)&&void 0!==i?i:[];this.edit({subscriptions:{allowFrequencyModification:e?0===n.length?[{jsonataQuery:"*",values:[]}]:n:[],allowNextDateModification:null!==(o=null===(s=this.form.subscriptions)||void 0===s?void 0:s.allowNextDateModification)&&void 0!==o&&o}})},this.__nextDateModificationGetValue=()=>{var e,t;return null!==(t=null===(e=this.form.subscriptions)||void 0===e?void 0:e.allowNextDateModification)&&void 0!==t&&t},this.__nextDateModificationSetValue=e=>{var t,i,s;const o=null!==(i=null===(t=this.form.subscriptions)||void 0===t?void 0:t.allowFrequencyModification)&&void 0!==i?i:[];this.edit({subscriptions:{allowFrequencyModification:o,allowNextDateModification:!!e&&((null===(s=this.form.subscriptions)||void 0===s?void 0:s.allowNextDateModification)||[])}})},this.__signUpVerificationHcaptchaSiteKeyGetValue=()=>{var e,t,i;return null!==(i=null===(t=null===(e=this.form.signUp)||void 0===e?void 0:e.verification)||void 0===t?void 0:t.siteKey)&&void 0!==i?i:""},this.__signUpVerificationHcaptchaSiteKeySetValue=e=>{var t,i,s,o;this.edit({signUp:{enabled:!!(null===(t=this.form.signUp)||void 0===t?void 0:t.enabled),verification:{secretKey:null!==(o=null===(s=null===(i=this.form.signUp)||void 0===i?void 0:i.verification)||void 0===s?void 0:s.secretKey)&&void 0!==o?o:"",siteKey:e,type:"hcaptcha"}}})},this.__signUpVerificationHcaptchaSecretKeyGetValue=()=>{var e,t,i;return null!==(i=null===(t=null===(e=this.form.signUp)||void 0===e?void 0:e.verification)||void 0===t?void 0:t.secretKey)&&void 0!==i?i:""},this.__signUpVerificationHcaptchaSecretKeySetValue=e=>{var t,i,s,o;this.edit({signUp:{enabled:!!(null===(t=this.form.signUp)||void 0===t?void 0:t.enabled),verification:{secretKey:e,siteKey:null!==(o=null===(s=null===(i=this.form.signUp)||void 0===i?void 0:i.verification)||void 0===s?void 0:s.siteKey)&&void 0!==o?o:"",type:"hcaptcha"}}})},this.__jwtSecretGeneratorOptions={charset:"abcdefghijklmnopqrstuvwxyz0123456789",length:64}}static get v8n(){return[({sessionLifespanInMinutes:e})=>"number"!=typeof e||e<=40320||"session-lifespan-in-minutes:v8n_too_long",({allowedOrigins:e=[]})=>e.length<=10||"allowed-origins:v8n_too_many",({allowedOrigins:e=[]})=>e.every(x)||"allowed-origins:v8n_invalid",({jwtSharedSecret:e})=>!e||/^[a-z0-9-]+$/.test(e)||"jwt-shared-secret:v8n_invalid",({jwtSharedSecret:e})=>!e||e.length>=40||"jwt-shared-secret:v8n_too_short",({jwtSharedSecret:e})=>!e||e.length<=100||"jwt-shared-secret:v8n_too_long",({signUp:e})=>{const t=null==e?void 0:e.verification.siteKey;return!t||t.length<=100||"sign-up-verification-hcaptcha-site-key:v8n_too_long"},({signUp:e})=>{const t=null==e?void 0:e.verification.secretKey;return!t||t.length<=100||"sign-up-verification-hcaptcha-secret-key:v8n_too_long"}]}get hiddenSelector(){var e,t,s;const o=["header:copy-id",super.hiddenSelector.toString()];return(null===(e=this.form.signUp)||void 0===e?void 0:e.enabled)||o.push("hcaptcha"),(null===(t=this.form.subscriptions)||void 0===t?void 0:t.allowFrequencyModification.length)||o.push("subscriptions-allow-frequency-modification"),(null===(s=this.form.subscriptions)||void 0===s?void 0:s.allowNextDateModification)||o.push("subscriptions-allow-next-date-modification"),new i(o.join(" ").trim())}renderBody(){return o(g||(g=b` ${0} <foxy-internal-editable-list-control infer="allowed-origins" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-summary-control infer="features"> <foxy-internal-switch-control infer="sso" .getValue="${0}" .setValue="${0}"></foxy-internal-switch-control> <foxy-internal-switch-control infer="sign-up" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> <foxy-internal-switch-control infer="frequency-modification" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> <foxy-internal-switch-control infer="next-date-modification" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="hcaptcha"> <foxy-internal-password-control layout="summary-item" infer="sign-up-verification-hcaptcha-site-key" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> <foxy-internal-password-control layout="summary-item" infer="sign-up-verification-hcaptcha-secret-key" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> </foxy-internal-summary-control> <foxy-internal-async-list-control first="foxy://${0}/form/subscriptions/allowFrequencyModification" infer="subscriptions-allow-frequency-modification" limit="20" form="foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-form" item="foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-card" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control first="foxy://${0}/form/subscriptions/allowNextDateModification" infer="subscriptions-allow-next-date-modification" limit="20" form="foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-form" item="foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-card" alert> </foxy-internal-async-list-control> <foxy-internal-summary-control infer="security"> <foxy-internal-frequency-control layout="summary-item" infer="session-lifespan-in-minutes" max="" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-frequency-control> <foxy-internal-password-control layout="summary-item" property="jwtSharedSecret" infer="jwt-shared-secret" show-generator .generatorOptions="${0}"> </foxy-internal-password-control> </foxy-internal-summary-control> ${0} `),this.renderHeader(),this.__allowedOriginsGetValue,this.__allowedOriginsSetValue,this.__ssoGetValue,this.__ssoSetValue,this.__signUpGetValue,this.__signUpSetValue,this.__frequencyModificationGetValue,this.__frequencyModificationSetValue,this.__nextDateModificationGetValue,this.__nextDateModificationSetValue,this.__signUpVerificationHcaptchaSiteKeyGetValue,this.__signUpVerificationHcaptchaSiteKeySetValue,this.__signUpVerificationHcaptchaSecretKeyGetValue,this.__signUpVerificationHcaptchaSecretKeySetValue,this.virtualHost,this.virtualHost,this.__sessionLifespanInMinutesGetValue,this.__sessionLifespanInMinutesSetValue,this.__sessionLifespanInMinutesOptions,this.__jwtSecretGeneratorOptions,super.renderBody())}async _sendPost(e){return this.__removeNullProperties(e),super._sendPost(e)}async _sendPatch(e){return this.__removeNullProperties(e),super._sendPatch(e)}__removeNullProperties(e){var t,i;"object"==typeof(null===(t=e.subscriptions)||void 0===t?void 0:t.allowNextDateModification)&&(null===(i=e.subscriptions)||void 0===i||i.allowNextDateModification.forEach((e=>{for(const t in e){const i=t;null===e[i]&&delete e[i]}})))}}customElements.define("foxy-customer-portal-settings-form",j);export{j as CustomerPortalSettingsForm};
@@ -1,4 +1,4 @@
1
- import"./foxy-customer.js";import"./shared-515003f6.js";import"./shared-19073761.js";import"./shared-db623837.js";import"./shared-ee48a1ed.js";import"./shared-5212ef4f.js";import{I as e}from"./shared-ad26f72d.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{u as s}from"./shared-842078ca.js";import"./foxy-sign-in-form.js";import"./foxy-form-dialog.js";import"./foxy-spinner.js";import"./shared-9b35fe34.js";import{_ as r,B as o,aI as i}from"./shared-8f9014ff.js";import{h as a,L as n,c as d}from"./shared-ba5c42c7.js";import{A as l}from"./shared-7f7d6ceb.js";import"./shared-11de7969.js";import{C as c}from"./shared-803be1e4.js";import{a as m,T as u}from"./shared-887ac0b0.js";import{U as p}from"./shared-cd96ff03.js";import{i as h}from"./shared-53e42a77.js";import{c as f}from"./shared-4e709717.js";import{A as g}from"./shared-69c98b7b.js";import{C as y}from"./shared-41c9c53f.js";import{I as $}from"./shared-930e68b7.js";import"./shared-0fd68dc0.js";import"./foxy-update-payment-method-form.js";import"./shared-e44d4a56.js";import"./shared-01cd4e3c.js";import"./shared-99c53365.js";import"./shared-6cdfb858.js";import"./shared-8d8975d5.js";import"./shared-65094878.js";import"./shared-a20ef119.js";import"./shared-b5e048f5.js";import"./shared-9a3bf65c.js";import"./shared-7892fd3f.js";import"./shared-a5d6db21.js";import"./shared-a0baefff.js";import"./shared-f8e360e6.js";import"./shared-f892683b.js";import"./shared-2bb1f0f4.js";import"./shared-2b39e4d4.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-f6c6ce5f.js";import"./shared-8df8e77c.js";import"./shared-9d4fecb9.js";import"./shared-609c9693.js";import"./shared-058530fc.js";import"./foxy-copy-to-clipboard.js";import"./shared-9687ab7b.js";import"./shared-0f92b865.js";import"./foxy-nucleon-element.js";import"./shared-53e476fd.js";import"./shared-bab2ea2c.js";import"./foxy-template-set-card.js";import"./shared-bbd07437.js";import"./shared-b2f675d4.js";import"./foxy-payment-card-embed.js";import"./shared-80950330.js";import"./shared-5fd5805c.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./shared-8449b585.js";import"./shared-9ed0a201.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./shared-1d6a5e81.js";import"./shared-a339f79c.js";import"./shared-d0aed1c1.js";import"./foxy-table.js";import"./shared-f9a22b7a.js";import"./shared-4314488c.js";import"./shared-a0309d5f.js";import"./shared-3eac4b7c.js";import"./shared-faa174b6.js";import"./shared-b948488a.js";import"./shared-afdf7b0c.js";import"./shared-02c0b25a.js";import"./shared-b1fa9899.js";import"./shared-96e4f603.js";import"./shared-cf613436.js";import"./shared-60497743.js";import"./shared-e650caf3.js";import"./shared-af6ccc54.js";import"./shared-2061be9a.js";import"./foxy-transaction-card.js";import"./shared-3426159a.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-c84333db.js";import"./shared-a6b2bd14.js";import"./shared-ce05e482.js";import"./shared-b738ee96.js";import"./shared-6a0e1b94.js";
1
+ import"./foxy-customer.js";import"./shared-515003f6.js";import"./shared-19073761.js";import"./shared-db623837.js";import"./shared-ee48a1ed.js";import"./shared-5212ef4f.js";import{I as e}from"./shared-13fed57b.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{u as s}from"./shared-db8913cf.js";import"./foxy-sign-in-form.js";import"./foxy-form-dialog.js";import"./foxy-spinner.js";import"./shared-9b35fe34.js";import{_ as r,B as o,aI as i}from"./shared-8f9014ff.js";import{h as a,L as n,c as d}from"./shared-ba5c42c7.js";import{A as l}from"./shared-7f7d6ceb.js";import"./shared-11de7969.js";import{C as c}from"./shared-803be1e4.js";import{a as m,T as u}from"./shared-887ac0b0.js";import{U as p}from"./shared-cd96ff03.js";import{i as h}from"./shared-53e42a77.js";import{c as f}from"./shared-4e709717.js";import{A as g}from"./shared-69c98b7b.js";import{C as y}from"./shared-41c9c53f.js";import{I as $}from"./shared-930e68b7.js";import"./shared-0fd68dc0.js";import"./foxy-update-payment-method-form.js";import"./shared-6418bbb8.js";import"./shared-01cd4e3c.js";import"./shared-99c53365.js";import"./shared-6cdfb858.js";import"./shared-8d8975d5.js";import"./shared-65094878.js";import"./shared-a20ef119.js";import"./shared-b5e048f5.js";import"./shared-9a3bf65c.js";import"./shared-7892fd3f.js";import"./shared-a5d6db21.js";import"./shared-a0baefff.js";import"./shared-f8e360e6.js";import"./shared-f892683b.js";import"./shared-2bb1f0f4.js";import"./shared-2b39e4d4.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-f6c6ce5f.js";import"./shared-8df8e77c.js";import"./shared-9d4fecb9.js";import"./shared-609c9693.js";import"./shared-058530fc.js";import"./foxy-copy-to-clipboard.js";import"./shared-9687ab7b.js";import"./shared-0f92b865.js";import"./foxy-nucleon-element.js";import"./shared-53e476fd.js";import"./shared-bab2ea2c.js";import"./foxy-template-set-card.js";import"./shared-bbd07437.js";import"./shared-b2f675d4.js";import"./foxy-payment-card-embed.js";import"./shared-80950330.js";import"./shared-5fd5805c.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./shared-8449b585.js";import"./shared-9ed0a201.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./shared-1d6a5e81.js";import"./shared-a339f79c.js";import"./shared-d0aed1c1.js";import"./foxy-table.js";import"./shared-f9a22b7a.js";import"./shared-4314488c.js";import"./shared-a0309d5f.js";import"./shared-3eac4b7c.js";import"./shared-faa174b6.js";import"./shared-b948488a.js";import"./shared-afdf7b0c.js";import"./shared-02c0b25a.js";import"./shared-b1fa9899.js";import"./shared-96e4f603.js";import"./shared-cf613436.js";import"./shared-60497743.js";import"./shared-e650caf3.js";import"./shared-af6ccc54.js";import"./shared-2061be9a.js";import"./foxy-transaction-card.js";import"./shared-3426159a.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-c84333db.js";import"./shared-a6b2bd14.js";import"./shared-ce05e482.js";import"./shared-b738ee96.js";import"./shared-6a0e1b94.js";
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -12,7 +12,7 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function v(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function b(e,t,s){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,s),s}let x,S,_,j=e=>e;var w;class T extends(m(u(c),"customer-portal")){constructor(){super(...arguments),this.transactionsTableColumns=[t.priceColumn,t.summaryColumn,t.statusColumn,t.idColumn,t.dateColumn,t.receiptColumn],w.set(this,null),this.skipPasswordReset=!1,this.embedUrl=null,this.group=""}static get properties(){return r(r({},super.properties),{},{transactionsTableColumns:{attribute:!1},skipPasswordReset:{type:Boolean,attribute:"skip-password-reset"},embedUrl:{attribute:"embed-url"},group:{type:String}})}render(){var e,t;let s;try{s=new URL("./customer_portal_settings",this.base)}catch(e){s=void 0}return this.api.storage.getItem(l.SESSION)?!this.skipPasswordReset&&this.api.usesTemporaryPassword&&v(this,w)?a(x||(x=j` <foxy-internal-customer-portal-password-reset-view password-old="${0}" infer="password-reset" href="${0}" @update="${0}" @skip="${0}"> </foxy-internal-customer-portal-password-reset-view> `),h(null!==(e=v(this,w))&&void 0!==e?e:void 0),this.base,this.__handlePasswordResetUpdate,this.__handlePasswordResetSkip):a(S||(S=j` <foxy-internal-customer-portal-logged-in-view embed-url="${0}" customer="${0}" class="h-full" infer="" href="${0}" .transactionsTableColumns="${0}"> </foxy-internal-customer-portal-logged-in-view> `),h(null!==(t=this.embedUrl)&&void 0!==t?t:void 0),this.base,h(null==s?void 0:s.toString()),this.transactionsTableColumns):a(_||(_=j` <foxy-internal-customer-portal-logged-out-view class="h-full" infer="" href="${0}" @password="${0}"> </foxy-internal-customer-portal-logged-out-view> `),h(null==s?void 0:s.toString()),(e=>{b(this,w,e.detail)}))}updated(e){super.updated(e);!(null!==this.api.storage.getItem(l.SESSION))||!this.skipPasswordReset&&this.api.usesTemporaryPassword||b(this,w,null)}__handlePasswordResetUpdate(e){var t;(null===(t=e.detail)||void 0===t?void 0:t.result)===p.UpdateResult.ResourceUpdated&&(this.api.usesTemporaryPassword=!1,b(this,w,null),this.requestUpdate(),this.dispatchEvent(new T.PasswordResetEvent("passwordreset",{detail:{result:"completed"}})))}__handlePasswordResetSkip(){b(this,w,null),this.requestUpdate(),this.dispatchEvent(new T.PasswordResetEvent("passwordreset",{detail:{result:"skipped"}}))}}w=new WeakMap,T.PasswordResetEvent=class extends CustomEvent{};let k,O,R,E,U=e=>e;class z extends(u(n)){constructor(){super(...arguments),this.disabled=!1,this.href="",this.icon=""}static get properties(){return r(r({},super.properties),{},{disabled:{type:Boolean},href:{type:String},icon:{type:String}})}render(){const e=f({"flex-auto leading-m font-medium tracking-wide text-m rounded-s transition-colors":!0,"text-primary hover-underline 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=a(k||(k=U` ${0} <slot></slot> `),this.icon?a(O||(O=U`<iron-icon icon="${0}" class="icon-inline"></iron-icon>`),this.icon):"");return this.disabled?a(R||(R=U`<button class="${0}" disabled="disabled">${0}</button>`),e,t):a(E||(E=U` <a class="${0}" href="${0}" rel="nofollow noopener">${0}</a> `),e,this.href,t)}}let N,P,C,A,I,H,q,F,L=e=>e;const B=m(e);let D,G,J,M,W,K,Q,V,X,Y,Z,ee,te,se,re,oe=e=>e;const ie=m(e);const ae=["html"],ne=["html"];let de,le,ce,me,ue,pe,he,fe,ge,ye,$e,ve,be=e=>e;const xe=m(y(u($(n))));let Se,_e,je,we=e=>e;const Te=y(u(m($(n),"customer-portal")));let ke,Oe,Re=e=>e;const Ee=s.passwordStrength;class Ue extends(m(e)){constructor(){super(...arguments),this.passwordOld=null,this.__generatorOptions={checkStrength:e=>Ee(e).id>=2}}static get properties(){return r(r({},super.properties),{},{passwordOld:{attribute:"password-old"}})}static get styles(){return[super.styles,d(ke||(ke=Re`.max-w-25rem{max-width:25rem}`))]}static get v8n(){return[({password:e})=>!!e||"password:v8n_required",({password:e})=>!e||e.length<=50||"password:v8n_too_long",({password:e})=>!e||Ee(e).id>=2||"password:v8n_too_weak"]}renderBody(){return a(Oe||(Oe=Re` <div class="m-auto max-w-25rem leading-s"> <p class="text-xxl font-medium ${0}"> <foxy-i18n infer="" key="title"></foxy-i18n> </p> <p class="text-l ${0}"> <foxy-i18n infer="" key="subtitle"></foxy-i18n> </p> <foxy-internal-password-control infer="password" class="mt-m" show-generator .generatorOptions="${0}"> </foxy-internal-password-control> <vaadin-button class="w-full mt-l" theme="primary" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="submit"></foxy-i18n> </vaadin-button> <vaadin-button class="w-full mt-s" theme="tertiary" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="skip"></foxy-i18n> </vaadin-button> </div> `),this.in("busy")?"text-disabled":"text-body",this.in("busy")?"text-disabled":"text-secondary",this.__generatorOptions,this.disabled||!this.in("idle"),(()=>this.submit()),this.disabled||!this.in("idle"),(()=>this.dispatchEvent(new CustomEvent("skip"))))}submit(){var e;this.edit({password_old:null!==(e=this.passwordOld)&&void 0!==e?e:""}),super.submit()}async _fetch(...e){const t=new Request(...e);if("PATCH"!==t.method)return super._fetch(...e);const s=await t.json(),r=await super._fetch(...e);return r.password_old=s.password_old,r.password=s.password,r}}customElements.define("foxy-internal-customer-portal-logged-in-view",class extends B{constructor(){var e;super(...arguments),e=this,this.customer="",this.embedUrl=null,this.loggingOutState="idle",this.transactionsTableColumns=[],this.loggingOutStateResetTimeout=null,this.__renderHeaderActionsSignOut=()=>{var t,s,r,o,i;const n="customer:header:actions:sign-out",d=this.loggingOutState,l=this.disabledSelector.matches(n)||!(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 a(N||(N=L` <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(`${n}: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 g(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?a(P||(P=L`<iron-icon icon="icons:exit-to-app"></iron-icon>`)):a(C||(C=L` <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!==(i=null===(o=customElements.get("foxy-spinner"))||void 0===o?void 0:o.defaultNS)&&void 0!==i?i:""].join(" ")),this.renderTemplateOrSlot(`${n}:after`))},this.__renderSubscriptions=(e,t)=>{const s="customer:subscriptions";return e(A||(A=L`
15
+ ***************************************************************************** */function b(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function v(e,t,s){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,s),s}let x,S,_,j=e=>e;var w;class T extends(m(u(c),"customer-portal")){constructor(){super(...arguments),this.transactionsTableColumns=[t.priceColumn,t.summaryColumn,t.statusColumn,t.idColumn,t.dateColumn,t.receiptColumn],w.set(this,null),this.skipPasswordReset=!1,this.embedUrl=null,this.group=""}static get properties(){return r(r({},super.properties),{},{transactionsTableColumns:{attribute:!1},skipPasswordReset:{type:Boolean,attribute:"skip-password-reset"},embedUrl:{attribute:"embed-url"},group:{type:String}})}render(){var e,t;let s;try{s=new URL("./customer_portal_settings",this.base)}catch(e){s=void 0}return this.api.storage.getItem(l.SESSION)?!this.skipPasswordReset&&this.api.usesTemporaryPassword&&b(this,w)?a(x||(x=j` <foxy-internal-customer-portal-password-reset-view password-old="${0}" infer="password-reset" href="${0}" @update="${0}" @skip="${0}"> </foxy-internal-customer-portal-password-reset-view> `),h(null!==(e=b(this,w))&&void 0!==e?e:void 0),this.base,this.__handlePasswordResetUpdate,this.__handlePasswordResetSkip):a(S||(S=j` <foxy-internal-customer-portal-logged-in-view embed-url="${0}" customer="${0}" class="h-full" infer="" href="${0}" .transactionsTableColumns="${0}"> </foxy-internal-customer-portal-logged-in-view> `),h(null!==(t=this.embedUrl)&&void 0!==t?t:void 0),this.base,h(null==s?void 0:s.toString()),this.transactionsTableColumns):a(_||(_=j` <foxy-internal-customer-portal-logged-out-view class="h-full" infer="" href="${0}" @password="${0}"> </foxy-internal-customer-portal-logged-out-view> `),h(null==s?void 0:s.toString()),(e=>{v(this,w,e.detail)}))}updated(e){super.updated(e);!(null!==this.api.storage.getItem(l.SESSION))||!this.skipPasswordReset&&this.api.usesTemporaryPassword||v(this,w,null)}__handlePasswordResetUpdate(e){var t;(null===(t=e.detail)||void 0===t?void 0:t.result)===p.UpdateResult.ResourceUpdated&&(this.api.usesTemporaryPassword=!1,v(this,w,null),this.requestUpdate(),this.dispatchEvent(new T.PasswordResetEvent("passwordreset",{detail:{result:"completed"}})))}__handlePasswordResetSkip(){v(this,w,null),this.requestUpdate(),this.dispatchEvent(new T.PasswordResetEvent("passwordreset",{detail:{result:"skipped"}}))}}w=new WeakMap,T.PasswordResetEvent=class extends CustomEvent{};let k,O,R,E,U=e=>e;class z extends(u(n)){constructor(){super(...arguments),this.disabled=!1,this.href="",this.icon=""}static get properties(){return r(r({},super.properties),{},{disabled:{type:Boolean},href:{type:String},icon:{type:String}})}render(){const e=f({"flex-auto leading-m font-medium tracking-wide text-m rounded-s transition-colors":!0,"text-primary hover-underline 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=a(k||(k=U` ${0} <slot></slot> `),this.icon?a(O||(O=U`<iron-icon icon="${0}" class="icon-inline"></iron-icon>`),this.icon):"");return this.disabled?a(R||(R=U`<button class="${0}" disabled="disabled">${0}</button>`),e,t):a(E||(E=U` <a class="${0}" href="${0}" rel="nofollow noopener">${0}</a> `),e,this.href,t)}}let N,P,C,A,I,H,q,F,L=e=>e;const B=m(e);let D,G,J,M,W,K,Q,V,X,Y,Z,ee,te,se,re,oe=e=>e;const ie=m(e);const ae=["html"],ne=["html"];let de,le,ce,me,ue,pe,he,fe,ge,ye,$e,be,ve=e=>e;const xe=m(y(u($(n))));let Se,_e,je,we=e=>e;const Te=y(u(m($(n),"customer-portal")));let ke,Oe,Re=e=>e;const Ee=s.passwordStrength;class Ue extends(m(e)){constructor(){super(...arguments),this.passwordOld=null,this.__generatorOptions={checkStrength:e=>Ee(e).id>=2}}static get properties(){return r(r({},super.properties),{},{passwordOld:{attribute:"password-old"}})}static get styles(){return[super.styles,d(ke||(ke=Re`.max-w-25rem{max-width:25rem}`))]}static get v8n(){return[({password:e})=>!!e||"password:v8n_required",({password:e})=>!e||e.length<=50||"password:v8n_too_long",({password:e})=>!e||Ee(e).id>=2||"password:v8n_too_weak"]}renderBody(){return a(Oe||(Oe=Re` <div class="m-auto max-w-25rem leading-s"> <p class="text-xxl font-medium ${0}"> <foxy-i18n infer="" key="title"></foxy-i18n> </p> <p class="text-l ${0}"> <foxy-i18n infer="" key="subtitle"></foxy-i18n> </p> <foxy-internal-password-control infer="password" class="mt-m" show-generator .generatorOptions="${0}"> </foxy-internal-password-control> <vaadin-button class="w-full mt-l" theme="primary" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="submit"></foxy-i18n> </vaadin-button> <vaadin-button class="w-full mt-s" theme="tertiary" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="skip"></foxy-i18n> </vaadin-button> </div> `),this.in("busy")?"text-disabled":"text-body",this.in("busy")?"text-disabled":"text-secondary",this.__generatorOptions,this.disabled||!this.in("idle"),(()=>this.submit()),this.disabled||!this.in("idle"),(()=>this.dispatchEvent(new CustomEvent("skip"))))}submit(){var e;this.edit({password_old:null!==(e=this.passwordOld)&&void 0!==e?e:""}),super.submit()}async _fetch(...e){const t=new Request(...e);if("PATCH"!==t.method)return super._fetch(...e);const s=await t.json(),r=await super._fetch(...e);return r.password_old=s.password_old,r.password=s.password,r}}customElements.define("foxy-internal-customer-portal-logged-in-view",class extends B{constructor(){var e;super(...arguments),e=this,this.customer="",this.embedUrl=null,this.loggingOutState="idle",this.transactionsTableColumns=[],this.loggingOutStateResetTimeout=null,this.__renderHeaderActionsSignOut=()=>{var t,s,r,o,i;const n="customer:header:actions:sign-out",d=this.loggingOutState,l=this.disabledSelector.matches(n)||!(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 a(N||(N=L` <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(`${n}: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 g(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?a(P||(P=L`<iron-icon icon="icons:exit-to-app"></iron-icon>`)):a(C||(C=L` <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!==(i=null===(o=customElements.get("foxy-spinner"))||void 0===o?void 0:o.defaultNS)&&void 0!==i?i:""].join(" ")),this.renderTemplateOrSlot(`${n}:after`))},this.__renderSubscriptions=(e,t)=>{const s="customer:subscriptions";return e(A||(A=L`
16
16
  ${0}
17
17
 
18
18
  <foxy-internal-customer-portal-subscriptions
@@ -66,7 +66,7 @@ PERFORMANCE OF THIS SOFTWARE.
66
66
  ${0}
67
67
  ${0}
68
68
  </div>
69
- `),r.matches("default",!0)?"":null==l?void 0:l(e,t),r.matches("subscriptions",!0)?"":s(e,t),r.matches("transactions",!0)?"":o(e,t))},a(F||(F=L` <foxy-customer readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" data-testid="customer" embed-url="${0}" group="${0}" href="${0}" lang="${0}" ns="${0} ${0}" id="customer" .templates="${0}" .settings="${0}" @update="${0}"> </foxy-customer> `),this.readonlySelector.zoom("customer").toString(),this.disabledSelector.zoom("customer").toString(),i,h(null!==(e=this.embedUrl)&&void 0!==e?e:void 0),this.group,this.customer,this.lang,this.ns,null!==(s=null===(t=customElements.get("foxy-customer"))||void 0===t?void 0:t.defaultNS)&&void 0!==s?s:"",n,this.data,(()=>this.requestUpdate()))}disconnectedCallback(){super.disconnectedCallback(),this.loggingOutStateResetTimeout&&clearTimeout(this.loggingOutStateResetTimeout)}get __customerElement(){return this.renderRoot.querySelector("#customer")}}),customElements.define("foxy-internal-customer-portal-logged-out-view",class extends ie{constructor(){super(...arguments),this.page="sign-in",this.__renderAccessRecoveryHeader=()=>{var e,t,s,r;const{lang:o,ns:i}=this,n=this.renderRoot.querySelector("#access-recovery-form"),d=!!(null==n?void 0:n.in("busy"));return a(D||(D=oe` <div class="flex flex-col leading-s font-lumo" data-testid="access-recovery:header"> ${0} <foxy-i18n class="text-xxl font-medium ${0}" lang="${0}" key="recover_access" ns="${0} ${0}"> </foxy-i18n> <foxy-i18n class="text-l ${0}" lang="${0}" key="recover_access_hint" ns="${0} ${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("access-recovery:header:before"),d?"text-disabled":"text-body",o,i,null!==(t=null===(e=customElements.get("foxy-access-recovery-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",d?"text-disabled":"text-secondary",o,i,null!==(r=null===(s=customElements.get("foxy-access-recovery-form"))||void 0===s?void 0:s.defaultNS)&&void 0!==r?r:"",this.renderTemplateOrSlot("access-recovery:header:after"))},this.__renderAccessRecoveryBack=()=>{var e,t;const s=this.renderRoot.querySelector("#access-recovery-form"),r=this.disabledSelector.zoom("access-recovery");return a(G||(G=oe` <div> ${0} <vaadin-button data-testid="access-recovery:back" class="w-full" theme="tertiary" ?disabled="${0}" @click="${0}"> <foxy-i18n lang="${0}" key="back" ns="${0} ${0}"> </foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("access-recovery:back:before"),!!(null==s?void 0:s.in("busy"))||r.matches("back",!0),(()=>this.page="sign-in"),this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-access-recovery-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",this.renderTemplateOrSlot("access-recovery:back:after"))},this.__renderAccessRecoveryForm=()=>{var e,t;const s="access-recovery:form",r=this.hiddenSelector.zoom(s);return a(J||(J=oe` <div> ${0} <foxy-access-recovery-form readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" data-testid="access-recovery:form" parent="foxy://customer-api/recover" group="${0}" lang="${0}" ns="${0} ${0}" id="access-recovery-form" .templates="${0}" @update="${0}"> </foxy-access-recovery-form> ${0} </div> `),this.renderTemplateOrSlot(`${s}:before`),this.readonlySelector.zoom(s).toString(),this.disabledSelector.zoom(s).toString(),r.toString(),this.group,this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-access-recovery-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",this.getNestedTemplates(s),(()=>this.requestUpdate()),this.renderTemplateOrSlot(`${s}:after`))},this.__renderAccessRecovery=()=>{const e="access-recovery",t=this.hiddenSelector.zoom(e);return a(M||(M=oe` <div class="h-full flex" data-testid="access-recovery"> <div class="m-auto max-w-25rem flex-1"> ${0} <div class="space-y-m"> ${0} <div class="space-y-s"> ${0} ${0} </div> </div> ${0} </div> </div> `),this.renderTemplateOrSlot(`${e}:before`),t.matches("header",!0)?"":this.__renderAccessRecoveryHeader(),t.matches("form",!0)?"":this.__renderAccessRecoveryForm(),t.matches("back",!0)?"":this.__renderAccessRecoveryBack(),this.renderTemplateOrSlot(`${e}:after`))},this.__renderSignInHeader=()=>{var e,t,s,r;const{lang:o,ns:i}=this,n=this.renderRoot.querySelector("#sign-in-form"),d=!!(null==n?void 0:n.in("busy"));return a(W||(W=oe` <div class="flex flex-col leading-s font-lumo" data-testid="sign-in:header"> ${0} <foxy-i18n class="text-xxl font-medium ${0}" lang="${0}" key="sign_in" ns="${0} ${0}"> </foxy-i18n> <foxy-i18n class="text-l ${0}" lang="${0}" key="sign_in_hint" ns="${0} ${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("sign-in:header:before"),d?"text-disabled":"text-body",o,i,null!==(t=null===(e=customElements.get("foxy-sign-in-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",d?"text-disabled":"text-secondary",o,i,null!==(r=null===(s=customElements.get("foxy-sign-in-form"))||void 0===s?void 0:s.defaultNS)&&void 0!==r?r:"",this.renderTemplateOrSlot("sign-in:header:after"))},this.__renderSignInRecover=()=>{var e,t;const s=this.renderRoot.querySelector("#sign-in-form"),r=this.disabledSelector.zoom("sign-in");return a(K||(K=oe` <div> ${0} <vaadin-button data-testid="sign-in:recover" class="w-full" theme="tertiary" ?disabled="${0}" @click="${0}"> <foxy-i18n lang="${0}" key="recover_access" ns="${0} ${0}"> </foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("sign-in:recover:before"),!!(null==s?void 0:s.in("busy"))||r.matches("recover",!0),(()=>this.page="access-recovery"),this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-sign-in-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",this.renderTemplateOrSlot("sign-in:recover:after"))},this.__renderSignInSignUp=()=>{const e=this.renderRoot.querySelector("#sign-in-form"),t=this.disabledSelector.zoom("sign-in");return a(Q||(Q=oe` <div> ${0} <vaadin-button data-testid="sign-in:signup" class="w-full" theme="tertiary" ?disabled="${0}" @click="${0}"> <foxy-i18n lang="${0}" key="sign_up" ns="${0} sign-in-form"> </foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("sign-in:signup:before"),!!(null==e?void 0:e.in("busy"))||t.matches("signup",!0),(()=>this.page="sign-up"),this.lang,this.ns,this.renderTemplateOrSlot("sign-in:signup:after"))},this.__renderSignInForm=()=>{var e,t;const s="sign-in:form",r=this.hiddenSelector.zoom(s);return a(V||(V=oe` <div> ${0} <foxy-sign-in-form readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" data-testid="sign-in:form" parent="foxy://customer-api/session" group="${0}" lang="${0}" id="sign-in-form" ns="${0} ${0}" .templates="${0}" @update="${0}"> </foxy-sign-in-form> ${0} </div> `),this.renderTemplateOrSlot(`${s}:before`),this.readonlySelector.zoom(s).toString(),this.disabledSelector.zoom(s).toString(),r.toString(),this.group,this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-sign-in-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",this.getNestedTemplates("sign-in:form"),(e=>{var t,s;const r=null!==(s=null===(t=e.currentTarget.form.credential)||void 0===t?void 0:t.password)&&void 0!==s?s:null;this.dispatchEvent(new CustomEvent("password",{detail:r})),this.requestUpdate()}),this.renderTemplateOrSlot(`${s}:after`))},this.__renderSignIn=()=>{var e,t;const s="sign-in",r=this.hiddenSelector.zoom(s),o=!0===(null===(t=null===(e=this.data)||void 0===e?void 0:e.sign_up)||void 0===t?void 0:t.enabled),i=r.matches("signup",!0)||!o;return a(X||(X=oe` <div class="h-full flex" data-testid="sign-in"> <div class="m-auto max-w-25rem flex-1 min-w-0"> ${0} <div class="space-y-m"> ${0} <div class="space-y-s"> ${0} <div class="flex justify-center gap-x-s flex-wrap"> ${0} ${0} </div> </div> </div> ${0} </div> </div> `),this.renderTemplateOrSlot(`${s}:before`),r.matches("header",!0)?"":this.__renderSignInHeader(),r.matches("form",!0)?"":this.__renderSignInForm(),i?"":this.__renderSignInSignUp(),r.matches("recover",!0)?"":this.__renderSignInRecover(),this.renderTemplateOrSlot(`${s}:after`))},this.__renderSignUpHeader=()=>{const{lang:e,ns:t}=this,s=this.renderRoot.querySelector("#sign-up-form"),r=!!(null==s?void 0:s.in("busy"));return a(Y||(Y=oe` <div class="flex flex-col leading-s font-lumo" data-testid="sign-up:header"> ${0} <foxy-i18n class="text-xxl font-medium ${0}" lang="${0}" key="sign_up" ns="${0} sign-up-form"> </foxy-i18n> <foxy-i18n class="text-l ${0}" lang="${0}" key="sign_up_hint" ns="${0} sign-up-form"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("sign-up:header:before"),r?"text-disabled":"text-body",e,t,r?"text-disabled":"text-secondary",e,t,this.renderTemplateOrSlot("sign-up:header:after"))},this.__renderSignUpGoBack=()=>{const e=this.renderRoot.querySelector("#sign-up-form"),t=this.disabledSelector.zoom("sign-up");return a(Z||(Z=oe` <div> ${0} <vaadin-button data-testid="sign-up:go-back" class="w-full" theme="tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n lang="${0}" key="go_back" ns="${0} sign-up-form"> </foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("sign-up:go-back:before"),!!(null==e?void 0:e.in("busy"))||t.matches("go-back",!0),(()=>this.page="sign-in"),this.lang,this.ns,this.renderTemplateOrSlot("sign-up:go-back:after"))},this.__renderSignUpForm=()=>{const e="sign-up:form",t=["header","tax-id","is-anonymous","password-old","forgot-password","timestamps","delete",this.hiddenSelector.zoom(e).toString()];return a(ee||(ee=oe` <div> ${0} <foxy-customer-form readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" data-testid="sign-up:form" parent="foxy://customer-api/signup" group="${0}" lang="${0}" id="sign-up-form" ns="${0} sign-up-form" .templates="${0}" .settings="${0}" @update="${0}"> </foxy-customer-form> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),this.readonlySelector.zoom(e).toString(),this.disabledSelector.zoom(e).toString(),new o(t.join(" ").trim()),this.group,this.lang,this.ns,this.getNestedTemplates("sign-up:form"),this.data,(()=>this.requestUpdate()),this.renderTemplateOrSlot(`${e}:after`))},this.__renderSignUp=()=>{const e="sign-up",t=this.hiddenSelector.zoom(e);return a(te||(te=oe` <div class="h-full flex" data-testid="sign-up"> <div class="m-auto max-w-25rem flex-1"> ${0} <div class="space-y-m"> ${0} ${0} ${0} </div> ${0} </div> </div> `),this.renderTemplateOrSlot(`${e}:before`),t.matches("header",!0)?"":this.__renderSignUpHeader(),t.matches("form",!0)?"":this.__renderSignUpForm(),t.matches("go-back",!0)?"":this.__renderSignUpGoBack(),this.renderTemplateOrSlot(`${e}:after`))}}static get properties(){return r(r({},super.properties),{},{group:{type:String},page:{type:String}})}static get styles(){return[super.styles,d(se||(se=oe`.max-w-25rem{max-width:25rem}`))]}renderBody(){const{page:e,hiddenSelector:t}=this;return"access-recovery"!==e||t.matches("access-recovery",!0)?"sign-in"!==e||t.matches("sign-in",!0)?"sign-up"!==e||t.matches("sign-up",!0)?a(re||(re=oe``)):this.__renderSignUp():this.__renderSignIn():this.__renderAccessRecovery()}}),customElements.define("foxy-internal-customer-portal-password-reset-view",Ue),customElements.define("foxy-internal-customer-portal-subscriptions",class extends xe{constructor(){super(...arguments),this.settings=null,this.customer=null,this.group="",this.__renderFormHeaderActionsUpdate=(e,t)=>{var s;const r=!!(null===(s=t.data)||void 0===s?void 0:s.end_date)&&new Date(t.data.end_date).getTime()<=Date.now();let o="";if(!r&&t.in({idle:"snapshot"})){const e=t.data._links["fx:sub_token_url"].href,s=new URL(e);s.searchParams.set("cart","checkout"),s.searchParams.set("sub_restart","auto"),o=s.toString()}return e(de||(de=be`
69
+ `),r.matches("default",!0)?"":null==l?void 0:l(e,t),r.matches("subscriptions",!0)?"":s(e,t),r.matches("transactions",!0)?"":o(e,t))},a(F||(F=L` <foxy-customer readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" data-testid="customer" embed-url="${0}" group="${0}" href="${0}" lang="${0}" ns="${0} ${0}" id="customer" .templates="${0}" .settings="${0}" @update="${0}"> </foxy-customer> `),this.readonlySelector.zoom("customer").toString(),this.disabledSelector.zoom("customer").toString(),i,h(null!==(e=this.embedUrl)&&void 0!==e?e:void 0),this.group,this.customer,this.lang,this.ns,null!==(s=null===(t=customElements.get("foxy-customer"))||void 0===t?void 0:t.defaultNS)&&void 0!==s?s:"",n,this.data,(()=>this.requestUpdate()))}disconnectedCallback(){super.disconnectedCallback(),this.loggingOutStateResetTimeout&&clearTimeout(this.loggingOutStateResetTimeout)}get __customerElement(){return this.renderRoot.querySelector("#customer")}}),customElements.define("foxy-internal-customer-portal-logged-out-view",class extends ie{constructor(){super(...arguments),this.page="sign-in",this.__renderAccessRecoveryHeader=()=>{var e,t,s,r;const{lang:o,ns:i}=this,n=this.renderRoot.querySelector("#access-recovery-form"),d=!!(null==n?void 0:n.in("busy"));return a(D||(D=oe` <div class="flex flex-col leading-s font-lumo" data-testid="access-recovery:header"> ${0} <foxy-i18n class="text-xxl font-medium ${0}" lang="${0}" key="recover_access" ns="${0} ${0}"> </foxy-i18n> <foxy-i18n class="text-l ${0}" lang="${0}" key="recover_access_hint" ns="${0} ${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("access-recovery:header:before"),d?"text-disabled":"text-body",o,i,null!==(t=null===(e=customElements.get("foxy-access-recovery-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",d?"text-disabled":"text-secondary",o,i,null!==(r=null===(s=customElements.get("foxy-access-recovery-form"))||void 0===s?void 0:s.defaultNS)&&void 0!==r?r:"",this.renderTemplateOrSlot("access-recovery:header:after"))},this.__renderAccessRecoveryBack=()=>{var e,t;const s=this.renderRoot.querySelector("#access-recovery-form"),r=this.disabledSelector.zoom("access-recovery");return a(G||(G=oe` <div> ${0} <vaadin-button data-testid="access-recovery:back" class="w-full" theme="tertiary" ?disabled="${0}" @click="${0}"> <foxy-i18n lang="${0}" key="back" ns="${0} ${0}"> </foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("access-recovery:back:before"),!!(null==s?void 0:s.in("busy"))||r.matches("back",!0),(()=>this.page="sign-in"),this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-access-recovery-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",this.renderTemplateOrSlot("access-recovery:back:after"))},this.__renderAccessRecoveryForm=()=>{var e,t;const s="access-recovery:form",r=this.hiddenSelector.zoom(s);return a(J||(J=oe` <div> ${0} <foxy-access-recovery-form readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" data-testid="access-recovery:form" parent="foxy://customer-api/recover" group="${0}" lang="${0}" ns="${0} ${0}" id="access-recovery-form" .templates="${0}" @update="${0}"> </foxy-access-recovery-form> ${0} </div> `),this.renderTemplateOrSlot(`${s}:before`),this.readonlySelector.zoom(s).toString(),this.disabledSelector.zoom(s).toString(),r.toString(),this.group,this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-access-recovery-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",this.getNestedTemplates(s),(()=>this.requestUpdate()),this.renderTemplateOrSlot(`${s}:after`))},this.__renderAccessRecovery=()=>{const e="access-recovery",t=this.hiddenSelector.zoom(e);return a(M||(M=oe` <div class="h-full flex" data-testid="access-recovery"> <div class="m-auto max-w-25rem flex-1"> ${0} <div class="space-y-m"> ${0} <div class="space-y-s"> ${0} ${0} </div> </div> ${0} </div> </div> `),this.renderTemplateOrSlot(`${e}:before`),t.matches("header",!0)?"":this.__renderAccessRecoveryHeader(),t.matches("form",!0)?"":this.__renderAccessRecoveryForm(),t.matches("back",!0)?"":this.__renderAccessRecoveryBack(),this.renderTemplateOrSlot(`${e}:after`))},this.__renderSignInHeader=()=>{var e,t,s,r;const{lang:o,ns:i}=this,n=this.renderRoot.querySelector("#sign-in-form"),d=!!(null==n?void 0:n.in("busy"));return a(W||(W=oe` <div class="flex flex-col leading-s font-lumo" data-testid="sign-in:header"> ${0} <foxy-i18n class="text-xxl font-medium ${0}" lang="${0}" key="sign_in" ns="${0} ${0}"> </foxy-i18n> <foxy-i18n class="text-l ${0}" lang="${0}" key="sign_in_hint" ns="${0} ${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("sign-in:header:before"),d?"text-disabled":"text-body",o,i,null!==(t=null===(e=customElements.get("foxy-sign-in-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",d?"text-disabled":"text-secondary",o,i,null!==(r=null===(s=customElements.get("foxy-sign-in-form"))||void 0===s?void 0:s.defaultNS)&&void 0!==r?r:"",this.renderTemplateOrSlot("sign-in:header:after"))},this.__renderSignInRecover=()=>{var e,t;const s=this.renderRoot.querySelector("#sign-in-form"),r=this.disabledSelector.zoom("sign-in");return a(K||(K=oe` <div> ${0} <vaadin-button data-testid="sign-in:recover" class="w-full" theme="tertiary" ?disabled="${0}" @click="${0}"> <foxy-i18n lang="${0}" key="recover_access" ns="${0} ${0}"> </foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("sign-in:recover:before"),!!(null==s?void 0:s.in("busy"))||r.matches("recover",!0),(()=>this.page="access-recovery"),this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-sign-in-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",this.renderTemplateOrSlot("sign-in:recover:after"))},this.__renderSignInSignUp=()=>{const e=this.renderRoot.querySelector("#sign-in-form"),t=this.disabledSelector.zoom("sign-in");return a(Q||(Q=oe` <div> ${0} <vaadin-button data-testid="sign-in:signup" class="w-full" theme="tertiary" ?disabled="${0}" @click="${0}"> <foxy-i18n lang="${0}" key="sign_up" ns="${0} sign-in-form"> </foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("sign-in:signup:before"),!!(null==e?void 0:e.in("busy"))||t.matches("signup",!0),(()=>this.page="sign-up"),this.lang,this.ns,this.renderTemplateOrSlot("sign-in:signup:after"))},this.__renderSignInForm=()=>{var e,t;const s="sign-in:form",r=this.hiddenSelector.zoom(s);return a(V||(V=oe` <div> ${0} <foxy-sign-in-form readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" data-testid="sign-in:form" parent="foxy://customer-api/session" group="${0}" lang="${0}" id="sign-in-form" ns="${0} ${0}" .templates="${0}" @update="${0}"> </foxy-sign-in-form> ${0} </div> `),this.renderTemplateOrSlot(`${s}:before`),this.readonlySelector.zoom(s).toString(),this.disabledSelector.zoom(s).toString(),r.toString(),this.group,this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-sign-in-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",this.getNestedTemplates("sign-in:form"),(e=>{var t,s;const r=null!==(s=null===(t=e.currentTarget.form.credential)||void 0===t?void 0:t.password)&&void 0!==s?s:null;this.dispatchEvent(new CustomEvent("password",{detail:r})),this.requestUpdate()}),this.renderTemplateOrSlot(`${s}:after`))},this.__renderSignIn=()=>{var e,t;const s="sign-in",r=this.hiddenSelector.zoom(s),o=!0===(null===(t=null===(e=this.data)||void 0===e?void 0:e.sign_up)||void 0===t?void 0:t.enabled),i=r.matches("signup",!0)||!o;return a(X||(X=oe` <div class="h-full flex" data-testid="sign-in"> <div class="m-auto max-w-25rem flex-1 min-w-0"> ${0} <div class="space-y-m"> ${0} <div class="space-y-s"> ${0} <div class="flex justify-center gap-x-s flex-wrap"> ${0} ${0} </div> </div> </div> ${0} </div> </div> `),this.renderTemplateOrSlot(`${s}:before`),r.matches("header",!0)?"":this.__renderSignInHeader(),r.matches("form",!0)?"":this.__renderSignInForm(),i?"":this.__renderSignInSignUp(),r.matches("recover",!0)?"":this.__renderSignInRecover(),this.renderTemplateOrSlot(`${s}:after`))},this.__renderSignUpHeader=()=>{const{lang:e,ns:t}=this,s=this.renderRoot.querySelector("#sign-up-form"),r=!!(null==s?void 0:s.in("busy"));return a(Y||(Y=oe` <div class="flex flex-col leading-s font-lumo" data-testid="sign-up:header"> ${0} <foxy-i18n class="text-xxl font-medium ${0}" lang="${0}" key="sign_up" ns="${0} sign-up-form"> </foxy-i18n> <foxy-i18n class="text-l ${0}" lang="${0}" key="sign_up_hint" ns="${0} sign-up-form"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("sign-up:header:before"),r?"text-disabled":"text-body",e,t,r?"text-disabled":"text-secondary",e,t,this.renderTemplateOrSlot("sign-up:header:after"))},this.__renderSignUpGoBack=()=>{const e=this.renderRoot.querySelector("#sign-up-form"),t=this.disabledSelector.zoom("sign-up");return a(Z||(Z=oe` <div> ${0} <vaadin-button data-testid="sign-up:go-back" class="w-full" theme="tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n lang="${0}" key="go_back" ns="${0} sign-up-form"> </foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("sign-up:go-back:before"),!!(null==e?void 0:e.in("busy"))||t.matches("go-back",!0),(()=>this.page="sign-in"),this.lang,this.ns,this.renderTemplateOrSlot("sign-up:go-back:after"))},this.__renderSignUpForm=()=>{const e="sign-up:form",t=["header","tax-id","is-anonymous","password-old","forgot-password","timestamps","delete",this.hiddenSelector.zoom(e).toString()];return a(ee||(ee=oe` <div> ${0} <foxy-customer-form readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" data-testid="sign-up:form" parent="foxy://customer-api/signup" group="${0}" lang="${0}" id="sign-up-form" ns="${0} sign-up-form" .templates="${0}" .settings="${0}" @update="${0}"> </foxy-customer-form> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),this.readonlySelector.zoom(e).toString(),this.disabledSelector.zoom(e).toString(),new o(t.join(" ").trim()),this.group,this.lang,this.ns,this.getNestedTemplates("sign-up:form"),this.data,(()=>this.requestUpdate()),this.renderTemplateOrSlot(`${e}:after`))},this.__renderSignUp=()=>{const e="sign-up",t=this.hiddenSelector.zoom(e);return a(te||(te=oe` <div class="h-full flex" data-testid="sign-up"> <div class="m-auto max-w-25rem flex-1"> ${0} <div class="space-y-m"> ${0} ${0} ${0} </div> ${0} </div> </div> `),this.renderTemplateOrSlot(`${e}:before`),t.matches("header",!0)?"":this.__renderSignUpHeader(),t.matches("form",!0)?"":this.__renderSignUpForm(),t.matches("go-back",!0)?"":this.__renderSignUpGoBack(),this.renderTemplateOrSlot(`${e}:after`))}}static get properties(){return r(r({},super.properties),{},{group:{type:String},page:{type:String}})}static get styles(){return[super.styles,d(se||(se=oe`.max-w-25rem{max-width:25rem}`))]}renderBody(){const{page:e,hiddenSelector:t}=this;return"access-recovery"!==e||t.matches("access-recovery",!0)?"sign-in"!==e||t.matches("sign-in",!0)?"sign-up"!==e||t.matches("sign-up",!0)?a(re||(re=oe``)):this.__renderSignUp():this.__renderSignIn():this.__renderAccessRecovery()}}),customElements.define("foxy-internal-customer-portal-password-reset-view",Ue),customElements.define("foxy-internal-customer-portal-subscriptions",class extends xe{constructor(){super(...arguments),this.settings=null,this.customer=null,this.group="",this.__renderFormHeaderActionsUpdate=(e,t)=>{var s;const r=!!(null===(s=t.data)||void 0===s?void 0:s.end_date)&&new Date(t.data.end_date).getTime()<=Date.now();let o="";if(!r&&t.in({idle:"snapshot"})){const e=t.data._links["fx:sub_token_url"].href,s=new URL(e);s.searchParams.set("cart","checkout"),s.searchParams.set("sub_restart","auto"),o=s.toString()}return e(de||(de=ve`
70
70
  ${0}
71
71
 
72
72
  <foxy-internal-customer-portal-link
@@ -78,7 +78,7 @@ PERFORMANCE OF THIS SOFTWARE.
78
78
  </foxy-internal-customer-portal-link>
79
79
 
80
80
  ${0}
81
- `),t.renderTemplateOrSlot("header:actions:update:before"),o,r||!t.in("idle"),t.lang,t.ns,t.renderTemplateOrSlot("header:actions:update:after"))},this.__renderFormHeaderActionsEnd=(e,t)=>{var s;const r=!!(null===(s=t.data)||void 0===s?void 0:s.end_date)&&"0000-00-00"!==t.data.end_date;let o="";if(!r&&t.in({idle:"snapshot"})){const e=new URL(t.data._links["fx:sub_token_url"].href);e.searchParams.set("sub_cancel","true"),o=e.toString()}return e(le||(le=be`
81
+ `),t.renderTemplateOrSlot("header:actions:update:before"),o,r||!t.in("idle"),t.lang,t.ns,t.renderTemplateOrSlot("header:actions:update:after"))},this.__renderFormHeaderActionsEnd=(e,t)=>{var s;const r=!!(null===(s=t.data)||void 0===s?void 0:s.end_date)&&"0000-00-00"!==t.data.end_date;let o="";if(!r&&t.in({idle:"snapshot"})){const e=new URL(t.data._links["fx:sub_token_url"].href);e.searchParams.set("sub_cancel","true"),o=e.toString()}return e(le||(le=ve`
82
82
  ${0}
83
83
 
84
84
  <foxy-internal-customer-portal-link
@@ -90,7 +90,7 @@ PERFORMANCE OF THIS SOFTWARE.
90
90
  </foxy-internal-customer-portal-link>
91
91
 
92
92
  ${0}
93
- `),t.renderTemplateOrSlot("header:actions:end:before"),o,r||!t.in("idle"),t.lang,t.ns,t.renderTemplateOrSlot("header:actions:end:after"))},this.__renderFormHeaderActions=(e,t)=>{const s=t.hiddenSelector.matches("header:actions:update"),r=t.hiddenSelector.matches("header:actions:end");return e(ce||(ce=be`
93
+ `),t.renderTemplateOrSlot("header:actions:end:before"),o,r||!t.in("idle"),t.lang,t.ns,t.renderTemplateOrSlot("header:actions:end:after"))},this.__renderFormHeaderActions=(e,t)=>{const s=t.hiddenSelector.matches("header:actions:update"),r=t.hiddenSelector.matches("header:actions:end");return e(ce||(ce=ve`
94
94
  <style>
95
95
  main {
96
96
  display: flex;
@@ -107,7 +107,7 @@ PERFORMANCE OF THIS SOFTWARE.
107
107
  </main>
108
108
 
109
109
  ${0}
110
- `),t.renderTemplateOrSlot("header:actions:before"),s?"":this.__renderFormHeaderActionsUpdate(e,t),r?"":this.__renderFormHeaderActionsEnd(e,t),t.renderTemplateOrSlot("header:actions:after"))},this.__renderFormItemsActionsUpdate=(e,t)=>{var s,r,o,i;const a=null!==(o=null===(r=null===(s=t.data)||void 0===s?void 0:s._links["fx:sub_modification_url"])||void 0===r?void 0:r.href)&&void 0!==o?o:"",n=!!(null===(i=t.data)||void 0===i?void 0:i.end_date)&&new Date(t.data.end_date).getTime()<=Date.now();return e(me||(me=be`
110
+ `),t.renderTemplateOrSlot("header:actions:before"),s?"":this.__renderFormHeaderActionsUpdate(e,t),r?"":this.__renderFormHeaderActionsEnd(e,t),t.renderTemplateOrSlot("header:actions:after"))},this.__renderFormItemsActionsUpdate=(e,t)=>{var s,r,o,i;const a=null!==(o=null===(r=null===(s=t.data)||void 0===s?void 0:s._links["fx:sub_modification_url"])||void 0===r?void 0:r.href)&&void 0!==o?o:"",n=!!(null===(i=t.data)||void 0===i?void 0:i.end_date)&&new Date(t.data.end_date).getTime()<=Date.now();return e(me||(me=ve`
111
111
  ${0}
112
112
 
113
113
  <foxy-internal-customer-portal-link
@@ -120,13 +120,13 @@ PERFORMANCE OF THIS SOFTWARE.
120
120
  </foxy-internal-customer-portal-link>
121
121
 
122
122
  ${0}
123
- `),t.renderTemplateOrSlot("items:actions:update:before"),a,n||!t.in("idle"),t.lang,t.ns,t.renderTemplateOrSlot("items:actions:update:after"))},this.__renderForm=e=>{var t,s;const i=r({},e.dialog.templates),n=i["header:after"],d=i["items:actions:after"];return i["header:after"]=(e,t)=>{const s=t.hiddenSelector.matches("header:actions",!0);return e(ue||(ue=be`
123
+ `),t.renderTemplateOrSlot("items:actions:update:before"),a,n||!t.in("idle"),t.lang,t.ns,t.renderTemplateOrSlot("items:actions:update:after"))},this.__renderForm=e=>{var t,s;const i=r({},e.dialog.templates),n=i["header:after"],d=i["items:actions:after"];return i["header:after"]=(e,t)=>{const s=t.hiddenSelector.matches("header:actions",!0);return e(ue||(ue=ve`
124
124
  ${0}
125
125
  ${0}
126
- `),s?"":this.__renderFormHeaderActions(e,t),null==n?void 0:n(e,t))},i["items:actions:after"]=(e,t)=>{var s;const r=!!(null===(s=t.data)||void 0===s?void 0:s._links["fx:sub_modification_url"]),o=t.hiddenSelector.matches("items:actions:update",!0);return e(pe||(pe=be`
126
+ `),s?"":this.__renderFormHeaderActions(e,t),null==n?void 0:n(e,t))},i["items:actions:after"]=(e,t)=>{var s;const r=!!(null===(s=t.data)||void 0===s?void 0:s._links["fx:sub_modification_url"]),o=t.hiddenSelector.matches("items:actions:update",!0);return e(pe||(pe=ve`
127
127
  ${0}
128
128
  ${0}
129
- `),r&&!o?this.__renderFormItemsActionsUpdate(e,t):"",null==d?void 0:d(e,t))},a(he||(he=be` <foxy-subscription-form disabledcontrols="${0}" readonlycontrols="${0}" hiddencontrols="${0}" settings="${0}" parent="${0}" group="${0}" lang="${0}" href="${0}" ns="${0} ${0}" id="form" .templates="${0}" @update="${0}" @fetch="${0}"> </foxy-subscription-form> `),e.dialog.disabledControls.toString(),e.dialog.readonlyControls.toString(),new o(`attributes timestamps start-date past-due-amount customer ${e.dialog.hiddenSelector}`),JSON.stringify(this.settings),e.dialog.parent,e.dialog.group,e.dialog.lang,e.dialog.href,e.dialog.ns,null!==(s=null===(t=customElements.get("foxy-subscription-form"))||void 0===t?void 0:t.defaultNS)&&void 0!==s?s:"",i,e.handleUpdate,e.handleFetch)},this.__renderPageItem=e=>{let{html:t}=e,s=i(e,ae);var r,o;return t(fe||(fe=be`
129
+ `),r&&!o?this.__renderFormItemsActionsUpdate(e,t):"",null==d?void 0:d(e,t))},a(he||(he=ve` <foxy-subscription-form disabledcontrols="${0}" readonlycontrols="${0}" hiddencontrols="${0}" settings="${0}" parent="${0}" group="${0}" lang="${0}" href="${0}" ns="${0} ${0}" id="form" .templates="${0}" @update="${0}" @fetch="${0}"> </foxy-subscription-form> `),e.dialog.disabledControls.toString(),e.dialog.readonlyControls.toString(),new o(`attributes timestamps start-date past-due-amount customer ${e.dialog.hiddenSelector}`),JSON.stringify(this.settings),e.dialog.parent,e.dialog.group,e.dialog.lang,e.dialog.href,e.dialog.ns,null!==(s=null===(t=customElements.get("foxy-subscription-form"))||void 0===t?void 0:t.defaultNS)&&void 0!==s?s:"",i,e.handleUpdate,e.handleFetch)},this.__renderPageItem=e=>{let{html:t}=e,s=i(e,ae);var r,o;return t(fe||(fe=ve`
130
130
  <button
131
131
  class=${0}
132
132
  ?disabled=${0}
@@ -144,7 +144,7 @@ PERFORMANCE OF THIS SOFTWARE.
144
144
  >
145
145
  </foxy-subscription-card>
146
146
  </button>
147
- `),f({"block w-full border border-contrast-10 p-m rounded-t-l rounded-b-l":!0,"focus-outline-none focus-border-primary":!0,"hover-border-contrast-30":null!==s.data}),null===s.data,(e=>{const t=new URL(s.href);t.searchParams.set("zoom","transaction_template:items"),this.__subscriptionDialog.href=t.toString(),this.__subscriptionDialog.show(e.currentTarget)}),JSON.stringify(this.settings),s.parent,s.group,s.lang,s.href,s.ns,null!==(o=null===(r=customElements.get("foxy-subscription-card"))||void 0===r?void 0:r.defaultNS)&&void 0!==o?o:"",s.templates)},this.__renderPage=e=>{let{html:t}=e,s=i(e,ne);return t(ge||(ge=be`
147
+ `),f({"block w-full border border-contrast-10 p-m rounded-t-l rounded-b-l":!0,"focus-outline-none focus-border-primary":!0,"hover-border-contrast-30":null!==s.data}),null===s.data,(e=>{const t=new URL(s.href);t.searchParams.set("zoom","transaction_template:items"),this.__subscriptionDialog.href=t.toString(),this.__subscriptionDialog.show(e.currentTarget)}),JSON.stringify(this.settings),s.parent,s.group,s.lang,s.href,s.ns,null!==(o=null===(r=customElements.get("foxy-subscription-card"))||void 0===r?void 0:r.defaultNS)&&void 0!==o?o:"",s.templates)},this.__renderPage=e=>{let{html:t}=e,s=i(e,ne);return t(ge||(ge=ve`
148
148
  <foxy-collection-page
149
149
  ns=${0}
150
150
  href=${0}
@@ -155,4 +155,4 @@ PERFORMANCE OF THIS SOFTWARE.
155
155
  .templates=${0}
156
156
  >
157
157
  </foxy-collection-page>
158
- `),s.ns,s.href,s.lang,s.group,this.__renderPageItem,s.templates)},this.__renderHeader=()=>a(ye||(ye=be` ${0} <foxy-i18n class="block text-l font-medium" lang="${0}" key="subscription_plural" ns="${0}"> </foxy-i18n> ${0} `),this.renderTemplateOrSlot("header:before"),this.lang,this.ns,this.renderTemplateOrSlot("header:after")),this.__renderList=()=>{var e;const t=this.disabledSelector.zoom("list"),s=this.readonlySelector.zoom("list"),r=[this.hiddenSelector.zoom("list").zoom("form").toString(),"end-date"];return a($e||($e=be` ${0} <foxy-form-dialog readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" header="update" parent="${0}" group="${0}" lang="${0}" ns="${0}" id="subscription-dialog" alert .form="${0}" .templates="${0}"> </foxy-form-dialog> <foxy-collection-pages class="block space-y-m" first="${0}" group="${0}" lang="${0}" ns="${0}" manual .page="${0}" .templates="${0}"> </foxy-collection-pages> ${0} `),this.renderTemplateOrSlot("list:before"),s.zoom("form").toString(),t.zoom("form").toString(),r.join(" ").trim(),h(null===(e=this.customer)||void 0===e?void 0:e._links["fx:subscriptions"].href),this.group,this.lang,this.ns,this.__renderForm,this.getNestedTemplates("list:form"),this.__activeSubscriptionsLink,this.group,this.lang,this.ns,this.__renderPage,this.getNestedTemplates("list:card"),this.renderTemplateOrSlot("list:after"))}}static get properties(){return r(r({},super.properties),{},{settings:{attribute:!1},customer:{attribute:!1},group:{type:String}})}render(){return a(ve||(ve=be` <div class="space-y-s" data-testid="subscriptions"> ${0} ${0} </div> `),this.hiddenSelector.matches("header",!0)?"":this.__renderHeader(),this.hiddenSelector.matches("list",!0)?"":this.__renderList())}get __subscriptionDialog(){return this.renderRoot.querySelector("#subscription-dialog")}get __activeSubscriptionsLink(){try{const e=new URL(this.customer._links["fx:subscriptions"].href);return e.searchParams.set("zoom","transaction_template:items"),e.toString()}catch(e){return""}}}),customElements.define("foxy-internal-customer-portal-transactions",class extends Te{constructor(){super(...arguments),this.customer=null,this.columns=[],this.group="",this.__renderHeader=()=>a(Se||(Se=we` <div> ${0} <foxy-i18n class="text-l font-medium" lang="${0}" key="transaction_plural" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("header:before"),this.lang,this.ns,this.renderTemplateOrSlot("header:after")),this.__renderList=()=>{let e="";if(this.customer){const t=new URL(this.customer._links["fx:transactions"].href);t.searchParams.set("zoom","items"),e=t.toString()}return a(_e||(_e=we` <div> ${0} <foxy-collection-pages spinner="foxy-spinner" group="${0}" first="${0}" class="block divide-y divide-contrast-10 px-m border border-contrast-10 rounded-t-l rounded-b-l" page="foxy-transactions-table" lang="${0}" ns="${0}" manual .templates="${0}" .props="${0}"> </foxy-collection-pages> ${0} </div> `),this.renderTemplateOrSlot("list:before"),this.group,e,this.lang,this.ns,this.getNestedTemplates("table"),{".columns":this.columns},this.renderTemplateOrSlot("list:after"))}}static get properties(){return r(r({},super.properties),{},{customer:{attribute:!1},columns:{attribute:!1},group:{type:String}})}render(){return a(je||(je=we` <div class="space-y-s" data-testid="transactions"> ${0} ${0} </div> `),this.hiddenSelector.matches("header")?"":this.__renderHeader(),this.hiddenSelector.matches("list")?"":this.__renderList())}}),customElements.define("foxy-internal-customer-portal-link",z),customElements.define("foxy-customer-portal",T);export{T as CustomerPortal};
158
+ `),s.ns,s.href,s.lang,s.group,this.__renderPageItem,s.templates)},this.__renderHeader=()=>a(ye||(ye=ve` ${0} <foxy-i18n class="block text-l font-medium" lang="${0}" key="subscription_plural" ns="${0}"> </foxy-i18n> ${0} `),this.renderTemplateOrSlot("header:before"),this.lang,this.ns,this.renderTemplateOrSlot("header:after")),this.__renderList=()=>{var e;const t=this.disabledSelector.zoom("list"),s=this.readonlySelector.zoom("list"),r=[this.hiddenSelector.zoom("list").zoom("form").toString(),"end-date"];return a($e||($e=ve` ${0} <foxy-form-dialog readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" header="update" parent="${0}" group="${0}" lang="${0}" ns="${0}" id="subscription-dialog" alert .form="${0}" .templates="${0}"> </foxy-form-dialog> <foxy-collection-pages class="block space-y-m" first="${0}" group="${0}" lang="${0}" ns="${0}" manual .page="${0}" .templates="${0}"> </foxy-collection-pages> ${0} `),this.renderTemplateOrSlot("list:before"),s.zoom("form").toString(),t.zoom("form").toString(),r.join(" ").trim(),h(null===(e=this.customer)||void 0===e?void 0:e._links["fx:subscriptions"].href),this.group,this.lang,this.ns,this.__renderForm,this.getNestedTemplates("list:form"),this.__activeSubscriptionsLink,this.group,this.lang,this.ns,this.__renderPage,this.getNestedTemplates("list:card"),this.renderTemplateOrSlot("list:after"))}}static get properties(){return r(r({},super.properties),{},{settings:{attribute:!1},customer:{attribute:!1},group:{type:String}})}render(){return a(be||(be=ve` <div class="space-y-s" data-testid="subscriptions"> ${0} ${0} </div> `),this.hiddenSelector.matches("header",!0)?"":this.__renderHeader(),this.hiddenSelector.matches("list",!0)?"":this.__renderList())}get __subscriptionDialog(){return this.renderRoot.querySelector("#subscription-dialog")}get __activeSubscriptionsLink(){try{const e=new URL(this.customer._links["fx:subscriptions"].href);return e.searchParams.set("zoom","transaction_template:items"),e.toString()}catch(e){return""}}}),customElements.define("foxy-internal-customer-portal-transactions",class extends Te{constructor(){super(...arguments),this.customer=null,this.columns=[],this.group="",this.__renderHeader=()=>a(Se||(Se=we` <div> ${0} <foxy-i18n class="text-l font-medium" lang="${0}" key="transaction_plural" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("header:before"),this.lang,this.ns,this.renderTemplateOrSlot("header:after")),this.__renderList=()=>{let e="";if(this.customer){const t=new URL(this.customer._links["fx:transactions"].href);t.searchParams.set("zoom","items"),e=t.toString()}return a(_e||(_e=we` <div> ${0} <foxy-collection-pages spinner="foxy-spinner" group="${0}" first="${0}" class="block divide-y divide-contrast-10 px-m border border-contrast-10 rounded-t-l rounded-b-l" page="foxy-transactions-table" lang="${0}" ns="${0}" manual .templates="${0}" .props="${0}"> </foxy-collection-pages> ${0} </div> `),this.renderTemplateOrSlot("list:before"),this.group,e,this.lang,this.ns,this.getNestedTemplates("table"),{".columns":this.columns},this.renderTemplateOrSlot("list:after"))}}static get properties(){return r(r({},super.properties),{},{customer:{attribute:!1},columns:{attribute:!1},group:{type:String}})}render(){return a(je||(je=we` <div class="space-y-s" data-testid="transactions"> ${0} ${0} </div> `),this.hiddenSelector.matches("header")?"":this.__renderHeader(),this.hiddenSelector.matches("list")?"":this.__renderList())}}),customElements.define("foxy-internal-customer-portal-link",z),customElements.define("foxy-customer-portal",T);export{T as CustomerPortal};
@@ -1,4 +1,4 @@
1
- import"./shared-db623837.js";import"./shared-19073761.js";import{h as t}from"./shared-0fd68dc0.js";import"./shared-515003f6.js";import"./shared-5212ef4f.js";import"./foxy-payment-method-card.js";import"./foxy-update-payment-method-form.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"./shared-842078ca.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./foxy-spinner.js";import"./foxy-table.js";import"./shared-9b35fe34.js";import{aI as e,_ as s}from"./shared-8f9014ff.js";import{L as r,h as a,c as o}from"./shared-ba5c42c7.js";import{C as i}from"./shared-41c9c53f.js";import"./shared-99c53365.js";import"./shared-0f92b865.js";import{z as h,S as d,T as n,a as l}from"./shared-887ac0b0.js";import{c as m}from"./shared-4e709717.js";import{S as c}from"./shared-4314488c.js";import"./shared-058530fc.js";import{G as v}from"./shared-afdf7b0c.js";import"./shared-a5d6db21.js";import"./shared-b5e048f5.js";import"./shared-f8e360e6.js";import"./shared-80950330.js";import"./shared-9a3bf65c.js";import{N as p}from"./shared-2b39e4d4.js";import{S as f}from"./shared-02c0b25a.js";import{i as g}from"./shared-53e42a77.js";import"./shared-6cdfb858.js";import"./shared-8d8975d5.js";import"./shared-609c9693.js";import"./shared-cf613436.js";import"./foxy-nucleon-element.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-930e68b7.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-e44d4a56.js";import"./shared-01cd4e3c.js";import"./shared-65094878.js";import"./shared-a20ef119.js";import"./shared-7892fd3f.js";import"./shared-a0baefff.js";import"./shared-f892683b.js";import"./shared-2bb1f0f4.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-f6c6ce5f.js";import"./shared-8df8e77c.js";import"./shared-9d4fecb9.js";import"./shared-ad26f72d.js";import"./foxy-copy-to-clipboard.js";import"./shared-9687ab7b.js";import"./shared-bab2ea2c.js";import"./shared-53e476fd.js";import"./foxy-template-set-card.js";import"./shared-bbd07437.js";import"./shared-b2f675d4.js";import"./foxy-payment-card-embed.js";import"./shared-7f7d6ceb.js";import"./shared-11de7969.js";import"./shared-5fd5805c.js";import"./shared-60497743.js";import"./shared-e650caf3.js";import"./shared-af6ccc54.js";import"./shared-2061be9a.js";import"./foxy-transaction-card.js";import"./shared-3426159a.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-b1fa9899.js";import"./shared-c84333db.js";import"./shared-96e4f603.js";import"./shared-f9a22b7a.js";import"./shared-8449b585.js";import"./shared-9ed0a201.js";import"./shared-a6b2bd14.js";import"./shared-ee48a1ed.js";import"./shared-ce05e482.js";import"./shared-a339f79c.js";import"./shared-d0aed1c1.js";import"./shared-b738ee96.js";import"./shared-1d6a5e81.js";import"./shared-a0309d5f.js";import"./shared-3eac4b7c.js";import"./shared-faa174b6.js";import"./shared-b948488a.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-db623837.js";import"./shared-19073761.js";import{h as t}from"./shared-0fd68dc0.js";import"./shared-515003f6.js";import"./shared-5212ef4f.js";import"./foxy-payment-method-card.js";import"./foxy-update-payment-method-form.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"./shared-db8913cf.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./foxy-spinner.js";import"./foxy-table.js";import"./shared-9b35fe34.js";import{aI as e,_ as s}from"./shared-8f9014ff.js";import{L as r,h as a,c as o}from"./shared-ba5c42c7.js";import{C as i}from"./shared-41c9c53f.js";import"./shared-99c53365.js";import"./shared-0f92b865.js";import{z as h,S as d,T as n,a as l}from"./shared-887ac0b0.js";import{c as m}from"./shared-4e709717.js";import{S as c}from"./shared-4314488c.js";import"./shared-058530fc.js";import{G as v}from"./shared-afdf7b0c.js";import"./shared-a5d6db21.js";import"./shared-b5e048f5.js";import"./shared-f8e360e6.js";import"./shared-80950330.js";import"./shared-9a3bf65c.js";import{N as p}from"./shared-2b39e4d4.js";import{S as f}from"./shared-02c0b25a.js";import{i as g}from"./shared-53e42a77.js";import"./shared-6cdfb858.js";import"./shared-8d8975d5.js";import"./shared-609c9693.js";import"./shared-cf613436.js";import"./foxy-nucleon-element.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-930e68b7.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-6418bbb8.js";import"./shared-01cd4e3c.js";import"./shared-65094878.js";import"./shared-a20ef119.js";import"./shared-7892fd3f.js";import"./shared-a0baefff.js";import"./shared-f892683b.js";import"./shared-2bb1f0f4.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-f6c6ce5f.js";import"./shared-8df8e77c.js";import"./shared-9d4fecb9.js";import"./shared-13fed57b.js";import"./foxy-copy-to-clipboard.js";import"./shared-9687ab7b.js";import"./shared-bab2ea2c.js";import"./shared-53e476fd.js";import"./foxy-template-set-card.js";import"./shared-bbd07437.js";import"./shared-b2f675d4.js";import"./foxy-payment-card-embed.js";import"./shared-7f7d6ceb.js";import"./shared-11de7969.js";import"./shared-5fd5805c.js";import"./shared-60497743.js";import"./shared-e650caf3.js";import"./shared-af6ccc54.js";import"./shared-2061be9a.js";import"./foxy-transaction-card.js";import"./shared-3426159a.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-b1fa9899.js";import"./shared-c84333db.js";import"./shared-96e4f603.js";import"./shared-f9a22b7a.js";import"./shared-8449b585.js";import"./shared-9ed0a201.js";import"./shared-a6b2bd14.js";import"./shared-ee48a1ed.js";import"./shared-ce05e482.js";import"./shared-a339f79c.js";import"./shared-d0aed1c1.js";import"./shared-b738ee96.js";import"./shared-1d6a5e81.js";import"./shared-a0309d5f.js";import"./shared-3eac4b7c.js";import"./shared-faa174b6.js";import"./shared-b948488a.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.
@@ -1,4 +1,4 @@
1
- import{a as e}from"./shared-2bb1f0f4.js";import"./shared-9a3bf65c.js";import"./shared-99c53365.js";import"./shared-a5d6db21.js";import"./shared-515003f6.js";import{h as r,P as t,B as o}from"./shared-0fd68dc0.js";import{E as a,T as i}from"./shared-8d8975d5.js";import"./shared-6cdfb858.js";import"./shared-9b35fe34.js";import{x as s,a as n}from"./shared-887ac0b0.js";import{c as l,h as A}from"./shared-ba5c42c7.js";import{i as d}from"./shared-53e42a77.js";import{c as p}from"./shared-4e709717.js";import"./shared-e44d4a56.js";import"./shared-f892683b.js";import"./shared-f6c6ce5f.js";import"./shared-a339f79c.js";import{I as u}from"./shared-ad26f72d.js";import"./foxy-item-category-card.js";import{_ as c}from"./shared-8f9014ff.js";import"./shared-5212ef4f.js";import"./shared-41c9c53f.js";import"./shared-930e68b7.js";import"./shared-2b39e4d4.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-01cd4e3c.js";import"./shared-65094878.js";import"./shared-a20ef119.js";import"./shared-b5e048f5.js";import"./shared-7892fd3f.js";import"./shared-a0baefff.js";import"./shared-f8e360e6.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-db623837.js";import"./shared-19073761.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-609c9693.js";import"./shared-058530fc.js";import"./foxy-pagination.js";import"./shared-9d4fecb9.js";import"./shared-8df8e77c.js";import"./foxy-copy-to-clipboard.js";import"./shared-9687ab7b.js";import"./shared-0f92b865.js";import"./foxy-nucleon-element.js";import"./shared-bab2ea2c.js";import"./shared-d0aed1c1.js";import"./shared-bbd07437.js";import"./shared-b2f675d4.js";const m=r`<dom-module id="lumo-progress-bar" theme-for="vaadin-progress-bar">
1
+ import{a as e}from"./shared-2bb1f0f4.js";import"./shared-9a3bf65c.js";import"./shared-99c53365.js";import"./shared-a5d6db21.js";import"./shared-515003f6.js";import{h as r,P as t,B as o}from"./shared-0fd68dc0.js";import{E as a,T as i}from"./shared-8d8975d5.js";import"./shared-6cdfb858.js";import"./shared-9b35fe34.js";import{x as s,a as n}from"./shared-887ac0b0.js";import{c as l,h as A}from"./shared-ba5c42c7.js";import{i as d}from"./shared-53e42a77.js";import{c as p}from"./shared-4e709717.js";import"./shared-6418bbb8.js";import"./shared-f892683b.js";import"./shared-f6c6ce5f.js";import"./shared-a339f79c.js";import{I as u}from"./shared-13fed57b.js";import"./foxy-item-category-card.js";import{_ as c}from"./shared-8f9014ff.js";import"./shared-5212ef4f.js";import"./shared-41c9c53f.js";import"./shared-930e68b7.js";import"./shared-2b39e4d4.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-01cd4e3c.js";import"./shared-65094878.js";import"./shared-a20ef119.js";import"./shared-b5e048f5.js";import"./shared-7892fd3f.js";import"./shared-a0baefff.js";import"./shared-f8e360e6.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-db623837.js";import"./shared-19073761.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-609c9693.js";import"./shared-058530fc.js";import"./foxy-pagination.js";import"./shared-9d4fecb9.js";import"./shared-8df8e77c.js";import"./foxy-copy-to-clipboard.js";import"./shared-9687ab7b.js";import"./shared-0f92b865.js";import"./foxy-nucleon-element.js";import"./shared-bab2ea2c.js";import"./shared-d0aed1c1.js";import"./shared-bbd07437.js";import"./shared-b2f675d4.js";const m=r`<dom-module id="lumo-progress-bar" theme-for="vaadin-progress-bar">
2
2
  <template>
3
3
  <style>
4
4
  :host {
@@ -1 +1 @@
1
- import"./shared-f892683b.js";import"./shared-9ed0a201.js";import"./shared-9d4fecb9.js";import"./shared-540adfea.js";import"./shared-a339f79c.js";import{I as t}from"./shared-ad26f72d.js";import"./shared-9b35fe34.js";import"./shared-515003f6.js";import{a as e}from"./shared-2bb1f0f4.js";import{_ as r,B as n}from"./shared-8f9014ff.js";import{N as o}from"./shared-2b39e4d4.js";import{h as a,s}from"./shared-ba5c42c7.js";import{a as i}from"./shared-887ac0b0.js";import{i as l}from"./shared-53e42a77.js";import"./shared-5fd5805c.js";import"./shared-a20ef119.js";import"./shared-99c53365.js";import"./shared-0fd68dc0.js";import"./shared-b5e048f5.js";import"./shared-9a3bf65c.js";import"./shared-8d8975d5.js";import"./shared-7892fd3f.js";import"./shared-6cdfb858.js";import"./shared-a5d6db21.js";import"./shared-a0baefff.js";import"./shared-f8e360e6.js";import"./shared-4e709717.js";import"./shared-9687ab7b.js";import"./shared-db623837.js";import"./shared-0f92b865.js";import"./shared-d0aed1c1.js";import"./shared-609c9693.js";import"./shared-058530fc.js";import"./shared-69c98b7b.js";import"./shared-41c9c53f.js";import"./shared-930e68b7.js";import"./foxy-copy-to-clipboard.js";import"./shared-19073761.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-5212ef4f.js";import"./shared-791b4510.js";import"./shared-9496e995.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-0e19bda5.js";let c,h=t=>t;customElements.define("foxy-internal-email-template-form-async-action",class extends e{constructor(){super(...arguments),this.theme=null,this.href=null,this.__state="idle"}static get properties(){return r(r({},super.properties),{},{__state:{type:String},theme:{type:String},href:{type:String}})}renderControl(){const t=this.__state,e="fail"===t?"error":"";return a(c||(c=h` <vaadin-button theme="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n key="${0}" infer=""></foxy-i18n> </vaadin-button> `),`${this.theme} ${null!=e?e:""}`.trim(),"busy"===t||this.disabled,this.__submit,t)}async __submit(){var t,e;if("busy"!==this.__state)try{this.__state="busy";const r=new o.API(this),n=await r.fetch(null!==(t=this.href)&&void 0!==t?t:"",{method:"POST"});this.__state=n.ok?"idle":"fail",n.ok&&(null===(e=this.nucleon)||void 0===e||e.refresh())}catch(t){this.__state="fail"}}});let m,f,d,u=t=>t;const p=i(t,"email-template-form");class x extends p{constructor(){super(...arguments),this.defaultSubject=null,this.__templateLanguageOptions=[{rawLabel:"Nunjucks",value:"nunjucks"},{rawLabel:"Handlebars",value:"handlebars"},{rawLabel:"Pug",value:"pug"},{rawLabel:"Twig",value:"twig"},{rawLabel:"EJS",value:"ejs"}],this.__toggleGetValue=()=>!!this.form.subject,this.__toggleSetValue=t=>{var e;t?this.edit({subject:null!==(e=this.defaultSubject)&&void 0!==e?e:this.t("general.subject.default_value")}):this.edit({subject:""})}}static get properties(){return r(r({},super.properties),{},{defaultSubject:{attribute:"default-subject"}})}get disabledSelector(){const t=[super.disabledSelector.toString()];return this.in({idle:{snapshot:"clean"}})&&this.data.content_html_url&&this.data.content_text_url||t.unshift("html-source:cache","text-source:cache"),this.form.subject||t.unshift("general:template-language","html-source","text-source","content-html","content-text"),new n(t.join(" ").trim())}get hiddenSelector(){var t,e,r,o,a,s,i;const l=[super.hiddenSelector.toString()];return(null===(t=this.data)||void 0===t?void 0:t.content_html_url)||l.unshift("html-source:cache"),(null===(e=this.data)||void 0===e?void 0:e.content_text_url)||l.unshift("text-source:cache"),this.form.content_html_url&&(null!==(o=null===(r=this.data)||void 0===r?void 0:r.content_html)&&void 0!==o?o:"")!==this.form.content_html||l.unshift("content-html-warning"),this.form.content_text_url&&(null!==(s=null===(a=this.data)||void 0===a?void 0:a.content_text)&&void 0!==s?s:"")!==this.form.content_text||l.unshift("content-text-warning"),(null===(i=this.data)||void 0===i?void 0:i.subject)||this.form.subject||l.unshift("general:template-language","general:subject","html-source","text-source","content-html","content-html-warning","content-text","content-text-warning"),new n(l.join(" ").trim())}renderBody(){var t,e;return a(m||(m=u` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="description"> </foxy-internal-text-control> <foxy-internal-switch-control infer="toggle" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> <foxy-internal-text-control layout="summary-item" infer="subject"> </foxy-internal-text-control> <foxy-internal-select-control layout="summary-item" infer="template-language" .options="${0}"> </foxy-internal-select-control> </foxy-internal-summary-control> ${0} <foxy-internal-source-control infer="content-html"></foxy-internal-source-control> <foxy-internal-summary-control infer="content-html-warning" label="" helper-text=""> <div class="flex gap-s bg-error-10 text-error leading-xs text-s"> ${0} <foxy-i18n infer="" key="text"></foxy-i18n> </div> </foxy-internal-summary-control> <foxy-internal-summary-control infer="html-source"> <foxy-internal-text-control layout="summary-item" infer="content-html-url"> </foxy-internal-text-control> <foxy-internal-email-template-form-async-action theme="tertiary-inline" infer="cache" href="${0}"> </foxy-internal-email-template-form-async-action> </foxy-internal-summary-control> <foxy-internal-source-control infer="content-text"></foxy-internal-source-control> <foxy-internal-summary-control infer="content-text-warning" label="" helper-text=""> <div class="flex gap-s bg-error-10 text-error leading-xs text-s"> ${0} <foxy-i18n infer="" key="text"></foxy-i18n> </div> </foxy-internal-summary-control> <foxy-internal-summary-control infer="text-source"> <foxy-internal-text-control layout="summary-item" infer="content-text-url"> </foxy-internal-text-control> <foxy-internal-email-template-form-async-action theme="tertiary-inline" infer="cache" href="${0}"> </foxy-internal-email-template-form-async-action> </foxy-internal-summary-control> ${0} `),this.renderHeader(),this.__toggleGetValue,this.__toggleSetValue,this.__templateLanguageOptions,this.renderTemplateOrSlot(),s(f||(f=u`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.25em; height: 1.25em; margin-top: 0.1em;" class="flex-shrink-0"><path fill-rule="evenodd" d="M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" clip-rule="evenodd" /></svg>`)),l(null===(t=this.data)||void 0===t?void 0:t._links["fx:cache"].href),s(d||(d=u`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.25em; height: 1.25em; margin-top: 0.1em;" class="flex-shrink-0"><path fill-rule="evenodd" d="M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" clip-rule="evenodd" /></svg>`)),l(null===(e=this.data)||void 0===e?void 0:e._links["fx:cache"].href),super.renderBody())}async _sendPost(t){const e=await super._sendPost(t);if(t.content_html_url&&t.content_text_url){const t=e._links["fx:cache"].href;if(!(await new x.API(this).fetch(t,{method:"POST"})).ok)throw["error:failed_to_cache"]}return await this._fetch(e._links.self.href)}async _sendPatch(t){const e=await super._sendPatch(t);if(!t.content_html_url&&!t.content_text_url)return e;const r=e._links["fx:cache"].href;if(!(await new x.API(this).fetch(r,{method:"POST"})).ok)throw["error:failed_to_cache"];return await this._fetch(e._links.self.href)}}customElements.define("foxy-email-template-form",x);export{x as EmailTemplateForm};
1
+ import"./shared-f892683b.js";import"./shared-9ed0a201.js";import"./shared-9d4fecb9.js";import"./shared-540adfea.js";import"./shared-a339f79c.js";import{I as t}from"./shared-13fed57b.js";import"./shared-9b35fe34.js";import"./shared-515003f6.js";import{a as e}from"./shared-2bb1f0f4.js";import{_ as r,B as n}from"./shared-8f9014ff.js";import{N as o}from"./shared-2b39e4d4.js";import{h as s,s as a}from"./shared-ba5c42c7.js";import{a as i}from"./shared-887ac0b0.js";import{i as l}from"./shared-53e42a77.js";import"./shared-5fd5805c.js";import"./shared-a20ef119.js";import"./shared-99c53365.js";import"./shared-0fd68dc0.js";import"./shared-b5e048f5.js";import"./shared-9a3bf65c.js";import"./shared-8d8975d5.js";import"./shared-7892fd3f.js";import"./shared-6cdfb858.js";import"./shared-a5d6db21.js";import"./shared-a0baefff.js";import"./shared-f8e360e6.js";import"./shared-4e709717.js";import"./shared-9687ab7b.js";import"./shared-db623837.js";import"./shared-0f92b865.js";import"./shared-d0aed1c1.js";import"./shared-609c9693.js";import"./shared-058530fc.js";import"./shared-69c98b7b.js";import"./shared-41c9c53f.js";import"./shared-930e68b7.js";import"./foxy-copy-to-clipboard.js";import"./shared-19073761.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-5212ef4f.js";import"./shared-791b4510.js";import"./shared-9496e995.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-0e19bda5.js";let c,h=t=>t;customElements.define("foxy-internal-email-template-form-async-action",class extends e{constructor(){super(...arguments),this.theme=null,this.href=null,this.__state="idle"}static get properties(){return r(r({},super.properties),{},{__state:{type:String},theme:{type:String},href:{type:String}})}renderControl(){const t=this.__state,e="fail"===t?"error":"";return s(c||(c=h` <vaadin-button theme="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n key="${0}" infer=""></foxy-i18n> </vaadin-button> `),`${this.theme} ${null!=e?e:""}`.trim(),"busy"===t||this.disabled,this.__submit,t)}async __submit(){var t,e;if("busy"!==this.__state)try{this.__state="busy";const r=new o.API(this),n=await r.fetch(null!==(t=this.href)&&void 0!==t?t:"",{method:"POST"});this.__state=n.ok?"idle":"fail",n.ok&&(null===(e=this.nucleon)||void 0===e||e.refresh())}catch(t){this.__state="fail"}}});let m,f,d,u=t=>t;const p=i(t,"email-template-form");class x extends p{constructor(){super(...arguments),this.defaultSubject=null,this.__templateLanguageOptions=[{rawLabel:"Nunjucks",value:"nunjucks"},{rawLabel:"Handlebars",value:"handlebars"},{rawLabel:"Pug",value:"pug"},{rawLabel:"Twig",value:"twig"},{rawLabel:"EJS",value:"ejs"}],this.__toggleGetValue=()=>!!this.form.subject,this.__toggleSetValue=t=>{var e;t?this.edit({subject:null!==(e=this.defaultSubject)&&void 0!==e?e:this.t("general.subject.default_value")}):this.edit({subject:""})}}static get properties(){return r(r({},super.properties),{},{defaultSubject:{attribute:"default-subject"}})}get disabledSelector(){const t=[super.disabledSelector.toString()];return this.in({idle:{snapshot:"clean"}})&&this.data.content_html_url&&this.data.content_text_url||t.unshift("html-source:cache","text-source:cache"),this.form.subject||t.unshift("general:template-language","html-source","text-source","content-html","content-text"),new n(t.join(" ").trim())}get hiddenSelector(){var t,e,r,o,s,a,i;const l=[super.hiddenSelector.toString()];return(null===(t=this.data)||void 0===t?void 0:t.content_html_url)||l.unshift("html-source:cache"),(null===(e=this.data)||void 0===e?void 0:e.content_text_url)||l.unshift("text-source:cache"),this.form.content_html_url&&(null!==(o=null===(r=this.data)||void 0===r?void 0:r.content_html)&&void 0!==o?o:"")!==this.form.content_html||l.unshift("content-html-warning"),this.form.content_text_url&&(null!==(a=null===(s=this.data)||void 0===s?void 0:s.content_text)&&void 0!==a?a:"")!==this.form.content_text||l.unshift("content-text-warning"),(null===(i=this.data)||void 0===i?void 0:i.subject)||this.form.subject||l.unshift("general:template-language","general:subject","html-source","text-source","content-html","content-html-warning","content-text","content-text-warning"),new n(l.join(" ").trim())}renderBody(){var t,e;return s(m||(m=u` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="description"> </foxy-internal-text-control> <foxy-internal-switch-control infer="toggle" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> <foxy-internal-text-control layout="summary-item" infer="subject"> </foxy-internal-text-control> <foxy-internal-select-control layout="summary-item" infer="template-language" .options="${0}"> </foxy-internal-select-control> </foxy-internal-summary-control> ${0} <foxy-internal-source-control infer="content-html"></foxy-internal-source-control> <foxy-internal-summary-control infer="content-html-warning" label="" helper-text=""> <div class="flex gap-s bg-error-10 text-error leading-xs text-s"> ${0} <foxy-i18n infer="" key="text"></foxy-i18n> </div> </foxy-internal-summary-control> <foxy-internal-summary-control infer="html-source"> <foxy-internal-text-control layout="summary-item" infer="content-html-url"> </foxy-internal-text-control> <foxy-internal-email-template-form-async-action theme="tertiary-inline" infer="cache" href="${0}"> </foxy-internal-email-template-form-async-action> </foxy-internal-summary-control> <foxy-internal-source-control infer="content-text"></foxy-internal-source-control> <foxy-internal-summary-control infer="content-text-warning" label="" helper-text=""> <div class="flex gap-s bg-error-10 text-error leading-xs text-s"> ${0} <foxy-i18n infer="" key="text"></foxy-i18n> </div> </foxy-internal-summary-control> <foxy-internal-summary-control infer="text-source"> <foxy-internal-text-control layout="summary-item" infer="content-text-url"> </foxy-internal-text-control> <foxy-internal-email-template-form-async-action theme="tertiary-inline" infer="cache" href="${0}"> </foxy-internal-email-template-form-async-action> </foxy-internal-summary-control> ${0} `),this.renderHeader(),this.__toggleGetValue,this.__toggleSetValue,this.__templateLanguageOptions,this.renderTemplateOrSlot(),a(f||(f=u`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.25em; height: 1.25em; margin-top: 0.1em;" class="flex-shrink-0"><path fill-rule="evenodd" d="M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" clip-rule="evenodd" /></svg>`)),l(null===(t=this.data)||void 0===t?void 0:t._links["fx:cache"].href),a(d||(d=u`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.25em; height: 1.25em; margin-top: 0.1em;" class="flex-shrink-0"><path fill-rule="evenodd" d="M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" clip-rule="evenodd" /></svg>`)),l(null===(e=this.data)||void 0===e?void 0:e._links["fx:cache"].href),super.renderBody())}async _sendPost(t){const e=await super._sendPost(t);if(t.content_html_url&&t.content_text_url){const t=e._links["fx:cache"].href;if(!(await new x.API(this).fetch(t,{method:"POST"})).ok)throw["error:failed_to_cache"]}return await this._fetch(e._links.self.href)}async _sendPatch(t){const e=await super._sendPatch(t);if(!t.content_html_url&&!t.content_text_url)return e;const r=e._links["fx:cache"].href;if(!(await new x.API(this).fetch(r,{method:"POST"})).ok)throw["error:failed_to_cache"];return await this._fetch(e._links.self.href)}}customElements.define("foxy-email-template-form",x);export{x as EmailTemplateForm};