@foxy.io/elements 1.8.0-beta.1 → 1.8.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/foxy-access-recovery-form.js +1 -1
- package/dist/cdn/foxy-address-card.js +2 -2
- package/dist/cdn/foxy-address-form.js +1 -1
- package/dist/cdn/foxy-attribute-card.js +1 -1
- package/dist/cdn/foxy-attribute-form.js +1 -1
- package/dist/cdn/foxy-cancellation-form.js +1 -1
- package/dist/cdn/foxy-collection-page.js +1 -1
- package/dist/cdn/foxy-collection-pages.js +1 -1
- package/dist/cdn/foxy-customer-api.js +1 -1
- package/dist/cdn/foxy-customer-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings.js +3 -3
- package/dist/cdn/foxy-customer-portal.js +14 -14
- package/dist/cdn/foxy-customer.js +1 -1
- package/dist/cdn/foxy-customers-table.js +1 -1
- package/dist/cdn/foxy-donation.js +1 -1
- package/dist/cdn/foxy-error-entry-card.js +1 -1
- package/dist/cdn/foxy-form-dialog.js +1 -1
- package/dist/cdn/foxy-i18n.js +1 -1
- package/dist/cdn/foxy-items-form.js +1 -1
- package/dist/cdn/foxy-nucleon-element.js +1 -1
- package/dist/cdn/foxy-payment-method-card.js +1 -1
- package/dist/cdn/foxy-sign-in-form.js +230 -1
- package/dist/cdn/foxy-spinner.js +2 -2
- package/dist/cdn/foxy-subscription-card.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +2 -2
- package/dist/cdn/foxy-subscriptions-table.js +1 -1
- package/dist/cdn/foxy-table.js +1 -1
- package/dist/cdn/foxy-transactions-table.js +1 -1
- package/dist/cdn/foxy-user-form.js +1 -1
- package/dist/cdn/foxy-users-table.js +1 -1
- package/dist/cdn/{shared-3747bcc6.js → shared-090432b4.js} +1 -1
- package/dist/cdn/shared-1d0ef57d.js +1 -0
- package/dist/cdn/{shared-720656e1.js → shared-23966eed.js} +1 -1
- package/dist/cdn/{shared-0fab8117.js → shared-497fd63c.js} +1 -1
- package/dist/cdn/{shared-963eb150.js → shared-4b33c6d2.js} +2 -2
- package/dist/cdn/{shared-18f51b0f.js → shared-525dd8c8.js} +1 -1
- package/dist/cdn/{shared-654b4125.js → shared-6872bf5c.js} +1 -1
- package/dist/cdn/shared-69d0ca61.js +1 -0
- package/dist/cdn/{shared-0073399d.js → shared-6f84ea16.js} +1 -1
- package/dist/cdn/{shared-3fbdd8df.js → shared-77bdf956.js} +1 -1
- package/dist/cdn/shared-8057ee9c.js +1 -0
- package/dist/cdn/{shared-67b701fa.js → shared-84203d52.js} +1 -1
- package/dist/cdn/shared-851b97ef.js +1 -0
- package/dist/cdn/{shared-3eee4ff4.js → shared-8f34ce95.js} +1 -1
- package/dist/cdn/{shared-75c1b56a.js → shared-92d03925.js} +1 -1
- package/dist/cdn/{shared-4d16f087.js → shared-96de56d4.js} +1 -1
- package/dist/cdn/{shared-090ed5f4.js → shared-9f78e096.js} +1 -1
- package/dist/cdn/{shared-c7566461.js → shared-a5fbfdc7.js} +1 -1
- package/dist/cdn/{shared-4b3d6aeb.js → shared-a7709d26.js} +1 -1
- package/dist/cdn/{shared-b817761e.js → shared-aac9fed8.js} +1 -1
- package/dist/cdn/{shared-4b7b3564.js → shared-b13a5ed3.js} +1 -1
- package/dist/cdn/{shared-a67a2bc1.js → shared-bba615b8.js} +1 -1
- package/dist/cdn/{shared-3e548f74.js → shared-bf28ab5e.js} +1 -1
- package/dist/cdn/shared-c70d9713.js +1 -0
- package/dist/cdn/{shared-5bfca1d2.js → shared-e058cb87.js} +1 -1
- package/dist/cdn/{shared-97fc8fd7.js → shared-f06d08d5.js} +1 -1
- package/dist/cdn/translations/shared/en.json +3 -0
- package/dist/cdn/translations/shared/es.json +3 -0
- package/dist/elements/private/Dialog/DialogWindow.d.ts +3 -2
- package/dist/elements/private/Dialog/DialogWindow.js +11 -1
- package/dist/elements/private/Dialog/DialogWindow.js.map +1 -1
- package/dist/elements/public/CustomerApi/cookieStorage.js +2 -1
- package/dist/elements/public/CustomerApi/cookieStorage.js.map +1 -1
- package/dist/elements/public/CustomerPortalSettings/private/DisallowedDates/DisallowedDates.js +1 -1
- package/dist/elements/public/CustomerPortalSettings/private/DisallowedDates/DisallowedDates.js.map +1 -1
- package/dist/elements/public/CustomerPortalSettings/private/FrequencyList/FrequencyList.js +3 -2
- package/dist/elements/public/CustomerPortalSettings/private/FrequencyList/FrequencyList.js.map +1 -1
- package/dist/elements/public/CustomerPortalSettings/private/NextDateModificationRule/NextDateModificationRule.js +2 -2
- package/dist/elements/public/CustomerPortalSettings/private/NextDateModificationRule/NextDateModificationRule.js.map +1 -1
- package/dist/elements/public/CustomerPortalSettings/private/OriginsList/OriginsList.js +2 -1
- package/dist/elements/public/CustomerPortalSettings/private/OriginsList/OriginsList.js.map +1 -1
- package/dist/elements/public/SignInForm/SignInForm.d.ts +7 -0
- package/dist/elements/public/SignInForm/SignInForm.js +57 -2
- package/dist/elements/public/SignInForm/SignInForm.js.map +1 -1
- package/dist/elements/public/SignInForm/index.d.ts +1 -0
- package/dist/elements/public/SignInForm/index.js +1 -0
- package/dist/elements/public/SignInForm/index.js.map +1 -1
- package/dist/elements/public/SignInForm/types.d.ts +3 -0
- package/dist/elements/public/SignInForm/types.js.map +1 -1
- package/dist/elements/public/SubscriptionCard/SubscriptionCard.js +2 -2
- package/dist/elements/public/SubscriptionCard/SubscriptionCard.js.map +1 -1
- package/dist/elements/public/SubscriptionForm/SubscriptionForm.js +1 -1
- package/dist/elements/public/SubscriptionForm/SubscriptionForm.js.map +1 -1
- package/dist/elements/public/SubscriptionsTable/SubscriptionsTable.js +8 -2
- package/dist/elements/public/SubscriptionsTable/SubscriptionsTable.js.map +1 -1
- package/dist/mixins/themeable.js +30 -25
- package/dist/mixins/themeable.js.map +1 -1
- package/dist/mixins/translatable.d.ts +3 -4
- package/dist/mixins/translatable.js +2 -6
- package/dist/mixins/translatable.js.map +1 -1
- package/package.json +2 -2
- package/dist/cdn/shared-51f550e3.js +0 -1
- package/dist/cdn/shared-6dc6912f.js +0 -1
- package/dist/cdn/shared-75bde6c4.js +0 -1
- package/dist/cdn/shared-916991a9.js +0 -1
- package/dist/cdn/shared-a494131d.js +0 -1
- package/dist/cdn/shared-c7ab8ec5.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aA as e,aB as t,aC as s,aD as i,aE as a,aF as n,aG as r,aH as o,aI as l,aJ as d,aK as h,aL as u,aM as c,aN as p,aO as _,aP as m,aQ as v,aR as g,aS as f,aT as y,aU as b,aV as x,aW as w,aX as $,aY as k,aZ as D,L as S,_ as C,h as E,c as I,a_ as A,a$ as M}from"./shared-67b701fa.js";import{F as T,D as O,t as V,f as j,a as F}from"./shared-45d647e4.js";import{E as R,T as P,B as N,D as B,C as z}from"./shared-b98f88c9.js";import{E as q,F as Y}from"./shared-5bfca1d2.js";import"./shared-e0248713.js";import{b as L,c as W}from"./shared-c7ab8ec5.js";import{a as H,b as U,I as X,c as K,D as Q,S as G,d as J,C as Z,M as ee,W as te,e as se,t as ie,f as ae}from"./shared-a67a2bc1.js";import"./shared-75bde6c4.js";import{O as ne,a as re,b as oe,c as le,I as de}from"./shared-54c485d2.js";import{T as he}from"./shared-3ae39e52.js";import"./foxy-i18n.js";import{c as ue}from"./shared-4e709717.js";import{h as ce,P as pe,G as _e,a as me,t as ve,c as ge,y as fe}from"./shared-747b0842.js";import"./shared-cd700eac.js";import{P as ye}from"./shared-2860a3d3.js";import{G as be}from"./shared-18f51b0f.js";import{p as xe}from"./shared-87ca7818.js";import{j as we}from"./shared-b817761e.js";import{p as $e,W as ke}from"./shared-51f550e3.js";import{i as De}from"./shared-090ed5f4.js";import"./shared-0fab8117.js";import"./shared-720656e1.js";import"./shared-6dc6912f.js";var Se=/\s/;var Ce=/^\s+/;function Ee(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&Se.test(e.charAt(t)););return t}(e)+1).replace(Ce,""):e}var Ie=/^[-+]0x[0-9a-f]+$/i,Ae=/^0b[01]+$/i,Me=/^0o[0-7]+$/i,Te=parseInt;function Oe(s){if("number"==typeof s)return s;if(e(s))return NaN;if(t(s)){var i="function"==typeof s.valueOf?s.valueOf():s;s=t(i)?i+"":i}if("string"!=typeof s)return 0===s?s:+s;s=Ee(s);var a=Ae.test(s);return a||Me.test(s)?Te(s.slice(2),a?2:8):Ie.test(s)?NaN:+s}function Ve(e){return e?Infinity===(e=Oe(e))||-Infinity===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function je(e){return e}var Fe=Object.create,Re=function(){function e(){}return function(s){if(!t(s))return{};if(Fe)return Fe(s);e.prototype=s;var i=new e;return e.prototype=void 0,i}}();var Pe=function(){try{var e=s(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();function Ne(e,t,s){"__proto__"==t&&Pe?Pe(e,t,{configurable:!0,enumerable:!0,value:s,writable:!0}):e[t]=s}var Be=Object.prototype.hasOwnProperty;function ze(e,t,s){var a=e[t];Be.call(e,t)&&i(a,s)&&(void 0!==s||t in e)||Ne(e,t,s)}function qe(e,t,s,i){var a=!s;s||(s={});for(var n=-1,r=t.length;++n<r;){var o=t[n],l=i?i(s[o],e[o],o,s,e):void 0;void 0===l&&(l=e[o]),a?Ne(s,o,l):ze(s,o,l)}return s}var Ye=Object.prototype.hasOwnProperty;function Le(e){if(!t(e))return function(e){var t=[];if(null!=e)for(var s in Object(e))t.push(s);return t}(e);var s=r(e),i=[];for(var a in e)("constructor"!=a||!s&&Ye.call(e,a))&&i.push(a);return i}function We(e){return a(e)?o(e,!0):Le(e)}var He=l(Object.getPrototypeOf,Object);var Ue="object"==typeof exports&&exports&&!exports.nodeType&&exports,Xe=Ue&&"object"==typeof module&&module&&!module.nodeType&&module,Ke=Xe&&Xe.exports===Ue?h.Buffer:void 0,Qe=Ke?Ke.allocUnsafe:void 0;var Ge=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)p(t,u(e)),e=He(e);return t}:c;function Je(e){return _(e,We,Ge)}var Ze=Object.prototype.hasOwnProperty;function et(e){var t=new e.constructor(e.byteLength);return new m(t).set(new m(e)),t}var tt=/\w*$/;var st=v?v.prototype:void 0,it=st?st.valueOf:void 0;function at(e,t,s){var i,a,n,r=e.constructor;switch(t){case"[object ArrayBuffer]":return et(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return function(e,t){var s=t?et(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.byteLength)}(e,s);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e,t){var s=t?et(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.length)}(e,s);case"[object Map]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return(n=new(a=e).constructor(a.source,tt.exec(a))).lastIndex=a.lastIndex,n;case"[object Set]":return new r;case"[object Symbol]":return i=e,it?Object(it.call(i)):{}}}var nt=y&&y.isMap,rt=nt?b(nt):function(e){return g(e)&&"[object Map]"==f(e)};var ot=y&&y.isSet,lt=ot?b(ot):function(e){return g(e)&&"[object Set]"==f(e)},dt={};function ht(e,s,i,a,n,o){var l,h=1&s,c=2&s,p=4&s;if(i&&(l=n?i(e,a,n,o):i(e)),void 0!==l)return l;if(!t(e))return e;var _=$(e);if(_){if(l=function(e){var t=e.length,s=new e.constructor(t);return t&&"string"==typeof e[0]&&Ze.call(e,"index")&&(s.index=e.index,s.input=e.input),s}(e),!h)return function(e,t){var s=-1,i=e.length;for(t||(t=Array(i));++s<i;)t[s]=e[s];return t}(e,l)}else{var m=f(e),v="[object Function]"==m||"[object GeneratorFunction]"==m;if(x(e))return function(e,t){if(t)return e.slice();var s=e.length,i=Qe?Qe(s):new e.constructor(s);return e.copy(i),i}(e,h);if("[object Object]"==m||"[object Arguments]"==m||v&&!n){if(l=c||v?{}:function(e){return"function"!=typeof e.constructor||r(e)?{}:Re(He(e))}(e),!h)return c?function(e,t){return qe(e,Ge(e),t)}(e,function(e,t){return e&&qe(t,We(t),e)}(l,e)):function(e,t){return qe(e,u(e),t)}(e,function(e,t){return e&&qe(t,d(t),e)}(l,e))}else{if(!dt[m])return n?e:{};l=at(e,m,h)}}o||(o=new w);var g=o.get(e);if(g)return g;o.set(e,l),lt(e)?e.forEach((function(t){l.add(ht(t,s,i,t,e,o))})):rt(e)&&e.forEach((function(t,a){l.set(a,ht(t,s,i,a,e,o))}));var y=_?void 0:(p?c?Je:k:c?We:d)(e);return function(e,t){for(var s=-1,i=null==e?0:e.length;++s<i&&!1!==t(e[s],s,e););}(y||e,(function(t,a){y&&(t=e[a=t]),ze(l,a,ht(t,s,i,a,e,o))})),l}dt["[object Arguments]"]=dt["[object Array]"]=dt["[object ArrayBuffer]"]=dt["[object DataView]"]=dt["[object Boolean]"]=dt["[object Date]"]=dt["[object Float32Array]"]=dt["[object Float64Array]"]=dt["[object Int8Array]"]=dt["[object Int16Array]"]=dt["[object Int32Array]"]=dt["[object Map]"]=dt["[object Number]"]=dt["[object Object]"]=dt["[object RegExp]"]=dt["[object Set]"]=dt["[object String]"]=dt["[object Symbol]"]=dt["[object Uint8Array]"]=dt["[object Uint8ClampedArray]"]=dt["[object Uint16Array]"]=dt["[object Uint32Array]"]=!0,dt["[object Error]"]=dt["[object Function]"]=dt["[object WeakMap]"]=!1;var ut=function(){return h.Date.now()},ct=Math.max,pt=Math.min;function _t(e,s,i){var a,n,r,o,l,d,h=0,u=!1,c=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function _(t){var s=a,i=n;return a=n=void 0,h=t,o=e.apply(i,s)}function m(e){return h=e,l=setTimeout(g,s),u?_(e):o}function v(e){var t=e-d;return void 0===d||t>=s||t<0||c&&e-h>=r}function g(){var e=ut();if(v(e))return f(e);l=setTimeout(g,function(e){var t=s-(e-d);return c?pt(t,r-(e-h)):t}(e))}function f(e){return l=void 0,p&&a?_(e):(a=n=void 0,o)}function y(){var e=ut(),t=v(e);if(a=arguments,n=this,d=e,t){if(void 0===l)return m(d);if(c)return clearTimeout(l),l=setTimeout(g,s),_(d)}return void 0===l&&(l=setTimeout(g,s)),o}return s=Oe(s)||0,t(i)&&(u=!!i.leading,r=(c="maxWait"in i)?ct(Oe(i.maxWait)||0,s):r,p="trailing"in i?!!i.trailing:p),y.cancel=function(){void 0!==l&&clearTimeout(l),h=0,a=d=n=l=void 0},y.flush=function(){return void 0===l?o:f(ut())},y}var mt=Math.floor,vt=Math.random;var gt=parseFloat,ft=Math.min,yt=Math.random;function bt(e,s,r){if(r&&"boolean"!=typeof r&&function(e,s,r){if(!t(r))return!1;var o=typeof s;return!!("number"==o?a(r)&&n(s,r.length):"string"==o&&s in r)&&i(r[s],e)}(e,s,r)&&(s=r=void 0),void 0===r&&("boolean"==typeof s?(r=s,s=void 0):"boolean"==typeof e&&(r=e,e=void 0)),void 0===e&&void 0===s?(e=0,s=1):(e=Ve(e),void 0===s?(s=e,e=0):s=Ve(s)),e>s){var o=e;e=s,s=o}if(r||e%1||s%1){var l=yt();return ft(e+l*(s-e+gt("1e-"+((l+"").length-1))),s)}return function(e,t){return e+mt(vt()*(t-e+1))}(e,s)}var xt=Math.min;function wt(e,t){if((e=function(e){var t=Ve(e),s=t%1;return t==t?s?t-s:t:0}(e))<1||e>9007199254740991)return[];var s,i=4294967295,a=xt(e,4294967295);e-=4294967295;for(var n=D(a,t="function"==typeof(s=t)?s:je);++i<e;)t(i);return n}class $t extends CustomEvent{constructor(e){super("change",{detail:e})}}let kt,Dt,St=e=>e;class Ct extends S{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.getText=e=>e}static get properties(){return C(C({},super.properties),{},{value:{type:Array},disabled:{type:Boolean},getText:{type:Object}})}static get styles(){return L.styles}render(){return E(kt||(kt=St` <div class="font-lumo text-m w-full"> <ul> ${0} </ul> <div class="p-m"> <slot></slot> </div> </div> `),this.value.map(((e,t)=>E(Dt||(Dt=St` <li class="${0}"> <slot name="${0}">${0}</slot> <button ?disabled="${0}" class="w-l h-l rounded text-tertiary transition duration-150 hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </li> `),"ml-m h-l text-body flex justify-between items-center"+(t>0?" border-t border-contrast-10":""),t,this.getText(e),this.disabled,(()=>this.__remove(t))))))}__remove(e){this.value=this.value.filter(((t,s)=>s!==e)),this.dispatchEvent(new $t(this.value))}}let Et,It,At=e=>e;class Mt extends S{static get styles(){return[L.styles,I(Et||(Et=At`:host{position:absolute;top:0;right:0;bottom:0;left:0}.top-center{top:calc(50% - (var(--lumo-size-xl)/ 2))}@keyframes dash0{from{transform:translate(0,0)}to{transform:translate(5.681301px,3.368302px)}}@keyframes dash1{from{transform:translate(0,0)}to{transform:translate(5.677051px,3.457428px)}}@keyframes dash2{from{transform:translate(0,0)}to{transform:translate(5.686002px,3.127455px)}}@keyframes dash3{from{transform:translate(-5.6842px,-3.404556px)}to{transform:translate(0,0)}}`))]}render(){return E(It||(It=At` <div class="h-full bg-base text-primary"> <svg xmlns="http://www.w3.org/2000/svg" class="fill-current w-xl h-xl mx-auto sticky top-center" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" viewBox="0 0 64 64"> <path id="ew5fy7afo2w2" fill-rule="evenodd" stroke="none" stroke-width="1" d="M41.93 49.46c0 .18-.2.3-.36.2l-1.78-1.07-22.73-13.76a1.5 1.5 0 01-.7-1.3V11.08c0-.18.2-.3.36-.2l1.75 1.04c.44.25.74.75.74 1.32v19.27c0 .08.05.16.12.2L41.22 46c.47.28.73.8.72 1.32v2.15z" clip-rule="evenodd"/> <path id="ew5fy7afo2w3" fill-rule="evenodd" stroke="none" stroke-width="1" d="M47.64 52.9c0 .2-.2.3-.36.21l-1.8-1.08c-.42-.26-.7-.74-.7-1.3v-19.3a.24.24 0 00-.12-.2L25.27 19.47a.24.24 0 00-.37.21v12.55c0 .19-.21.3-.37.2l-1.76-1.06a1.46 1.46 0 01-.71-1.28V16.7c0-.54.27-1.03.71-1.3.45-.27 1-.26 1.44 0l22.72 13.77c.44.26.7.76.7 1.3v20.27l.01 2.17z" clip-rule="evenodd"/> <g style="animation:dash0 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w4" fill-rule="evenodd" stroke="none" stroke-width="1" d="M30.59 35.68c0 .2-.21.3-.37.21l-1.8-1.1c-.41-.27-.68-.74-.68-1.28V27v-2.15c0-.2.2-.3.37-.21l1.78 1.06c.42.26.7.74.7 1.3v8.68z" clip-rule="evenodd"/> </g> <g style="animation:dash1 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w5" fill-rule="evenodd" stroke="none" stroke-width="1" d="M36.28 39.13c0 .2-.2.3-.37.21l-1.79-1.1c-.41-.25-.69-.73-.69-1.28v-6.51-2.16c0-.2.2-.31.37-.21l1.76 1.06c.44.26.73.75.73 1.3v8.69z" clip-rule="evenodd"/> </g> <g style="animation:dash2 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w6" fill-rule="evenodd" stroke="none" stroke-width="1" d="M41.96 42.57c0 .2-.2.3-.37.21L39.8 41.7a1.52 1.52 0 01-.71-1.3v-6.51-2.17c0-.2.2-.31.37-.21l1.74 1.06c.45.25.75.75.75 1.32v8.68z" clip-rule="evenodd"/> </g> <g transform="translate(-5.68 -3.4)" style="animation:dash3 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w7" fill-rule="evenodd" stroke="none" stroke-width="1" d="M30.59 35.68c0 .2-.21.3-.37.21l-1.8-1.1c-.41-.27-.68-.74-.68-1.28V27v-2.15c0-.2.2-.3.37-.21l1.78 1.06c.42.26.7.74.7 1.3v8.68z" clip-rule="evenodd"/> </g> </svg> </div> `))}}let Tt,Ot,Vt=e=>e;class jt extends S{static get styles(){return[L.styles,I(Tt||(Tt=Vt`::slotted(:not([slot])){margin-top:var(--lumo-space-xl)}`))]}render(){return E(Ot||(Ot=Vt` <article class="relative antialiased font-lumo"> <header class="space-y-xs leading-s"> <h1 class="font-bold text-header text-xl border-b border-contrast-10 pb-s mb-s"> <slot name="title"></slot> </h1> <p class="text-l text-secondary"> <slot name="subtitle"></slot> </p> </header> <slot></slot> </article> `))}}let Ft,Rt,Pt=e=>e;class Nt extends jt{static get styles(){return[super.styles,I(Ft||(Ft=Pt`::slotted(:not([slot])){margin-top:var(--lumo-space-m)}`))]}render(){return E(Rt||(Rt=Pt` <section class="leading-s antialiased font-lumo"> <header> <h2 class="text-header font-semibold text-l"> <slot name="title"></slot> </h2> <p class="text-secondary text-m"> <slot name="subtitle"></slot> </p> </header> <slot></slot> </section> `))}}let Bt,zt=e=>e;class qt extends CustomEvent{constructor(e){super("change",{detail:e})}}class Yt extends S{constructor(){super(...arguments),this.disabled=!1,this.checked=!1}static get properties(){return C(C({},super.properties),{},{disabled:{attribute:!1},checked:{attribute:!1}})}static get styles(){return L.styles}render(){return E(Bt||(Bt=zt` <label class="${0}"> <span class="text-body text-m mr-m"> <slot></slot> </span> <span style="border-radius:var(--lumo-size-xl);width:calc((var(--lumo-space-l) * 2) + (var(--lumo-space-xs) * 2))" class="${0}"> <span style="width:var(--lumo-space-l);height:var(--lumo-space-l)" class="${0}"></span> <input type="checkbox" class="opacity-0 absolute inset-0" .checked="${0}" .disabled="${0}" @change="${0}"> </span> </label> `),ue({"transition duration-200 flex justify-between items-center group":!0,"cursor-pointer":!this.disabled}),ue({"transition duration-150 relative flex flex-shrink-0 items-center":!0,"bg-success focus-within-shadow-outline-success":!this.disabled&&this.checked,"bg-contrast-10 focus-within-shadow-outline":this.disabled||!this.checked,"bg-contrast-20":!this.disabled&&!this.checked}),ue({"bg-tint transition duration-200 transform block rounded-full m-xs":!0,"translate-x-l":this.checked,"translate-x-0":!this.checked,"shadow-xs group-hover-shadow-s group-hover-scale-110":!this.disabled}),this.checked,this.disabled,(()=>{this.checked=!this.checked,this.dispatchEvent(new qt(this.checked))}))}}class Lt extends Error{constructor(){super("Unhandled request detected. Please add a request handler to connect this component to a backend.")}}class Wt extends CustomEvent{static emit(e){return new Promise(((t,s)=>{const i=new Wt(C({resolve:t,reject:s},e));e.source.dispatchEvent(i)&&s(new Lt)}))}constructor({source:e,resolve:t,reject:s,init:i}){var a;super("request",{cancelable:!0,composed:!0,bubbles:!0,detail:{source:e,handle:async function(e){a.stopImmediatePropagation(),a.preventDefault();try{t(await e(...i))}catch(e){s(e)}}}}),a=this}}const Ht=ce`<dom-module id="lumo-custom-field" theme-for="vaadin-custom-field">
|
|
1
|
+
import{aA as e,aB as t,aC as s,aD as i,aE as a,aF as n,aG as r,aH as o,aI as l,aJ as d,aK as h,aL as u,aM as c,aN as p,aO as _,aP as m,aQ as v,aR as g,aS as f,aT as y,aU as b,aV as x,aW as w,aX as $,aY as k,aZ as D,L as S,_ as C,h as E,c as I,a_ as A,a$ as M}from"./shared-84203d52.js";import{F as T,D as O,t as V,f as j,a as F}from"./shared-45d647e4.js";import{E as R,T as P,B as N,D as B,C as z}from"./shared-b98f88c9.js";import{E as q,F as Y}from"./shared-e058cb87.js";import"./shared-e0248713.js";import{b as L,c as W}from"./shared-8057ee9c.js";import{a as H,b as U,I as X,c as K,D as Q,S as G,d as J,C as Z,M as ee,W as te,e as se,t as ie,f as ae}from"./shared-bba615b8.js";import"./shared-851b97ef.js";import{O as ne,a as re,b as oe,c as le,I as de}from"./shared-54c485d2.js";import{T as he}from"./shared-3ae39e52.js";import"./foxy-i18n.js";import{c as ue}from"./shared-4e709717.js";import{h as ce,P as pe,G as _e,a as me,t as ve,c as ge,y as fe}from"./shared-747b0842.js";import"./shared-cd700eac.js";import{P as ye}from"./shared-2860a3d3.js";import{G as be}from"./shared-525dd8c8.js";import{p as xe}from"./shared-87ca7818.js";import{j as we}from"./shared-aac9fed8.js";import{p as $e,W as ke}from"./shared-c70d9713.js";import{i as De}from"./shared-9f78e096.js";import"./shared-497fd63c.js";import"./shared-23966eed.js";var Se=/\s/;var Ce=/^\s+/;function Ee(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&Se.test(e.charAt(t)););return t}(e)+1).replace(Ce,""):e}var Ie=/^[-+]0x[0-9a-f]+$/i,Ae=/^0b[01]+$/i,Me=/^0o[0-7]+$/i,Te=parseInt;function Oe(s){if("number"==typeof s)return s;if(e(s))return NaN;if(t(s)){var i="function"==typeof s.valueOf?s.valueOf():s;s=t(i)?i+"":i}if("string"!=typeof s)return 0===s?s:+s;s=Ee(s);var a=Ae.test(s);return a||Me.test(s)?Te(s.slice(2),a?2:8):Ie.test(s)?NaN:+s}function Ve(e){return e?Infinity===(e=Oe(e))||-Infinity===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function je(e){return e}var Fe=Object.create,Re=function(){function e(){}return function(s){if(!t(s))return{};if(Fe)return Fe(s);e.prototype=s;var i=new e;return e.prototype=void 0,i}}();var Pe=function(){try{var e=s(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();function Ne(e,t,s){"__proto__"==t&&Pe?Pe(e,t,{configurable:!0,enumerable:!0,value:s,writable:!0}):e[t]=s}var Be=Object.prototype.hasOwnProperty;function ze(e,t,s){var a=e[t];Be.call(e,t)&&i(a,s)&&(void 0!==s||t in e)||Ne(e,t,s)}function qe(e,t,s,i){var a=!s;s||(s={});for(var n=-1,r=t.length;++n<r;){var o=t[n],l=i?i(s[o],e[o],o,s,e):void 0;void 0===l&&(l=e[o]),a?Ne(s,o,l):ze(s,o,l)}return s}var Ye=Object.prototype.hasOwnProperty;function Le(e){if(!t(e))return function(e){var t=[];if(null!=e)for(var s in Object(e))t.push(s);return t}(e);var s=r(e),i=[];for(var a in e)("constructor"!=a||!s&&Ye.call(e,a))&&i.push(a);return i}function We(e){return a(e)?o(e,!0):Le(e)}var He=l(Object.getPrototypeOf,Object);var Ue="object"==typeof exports&&exports&&!exports.nodeType&&exports,Xe=Ue&&"object"==typeof module&&module&&!module.nodeType&&module,Ke=Xe&&Xe.exports===Ue?h.Buffer:void 0,Qe=Ke?Ke.allocUnsafe:void 0;var Ge=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)p(t,u(e)),e=He(e);return t}:c;function Je(e){return _(e,We,Ge)}var Ze=Object.prototype.hasOwnProperty;function et(e){var t=new e.constructor(e.byteLength);return new m(t).set(new m(e)),t}var tt=/\w*$/;var st=v?v.prototype:void 0,it=st?st.valueOf:void 0;function at(e,t,s){var i,a,n,r=e.constructor;switch(t){case"[object ArrayBuffer]":return et(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return function(e,t){var s=t?et(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.byteLength)}(e,s);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e,t){var s=t?et(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.length)}(e,s);case"[object Map]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return(n=new(a=e).constructor(a.source,tt.exec(a))).lastIndex=a.lastIndex,n;case"[object Set]":return new r;case"[object Symbol]":return i=e,it?Object(it.call(i)):{}}}var nt=y&&y.isMap,rt=nt?b(nt):function(e){return g(e)&&"[object Map]"==f(e)};var ot=y&&y.isSet,lt=ot?b(ot):function(e){return g(e)&&"[object Set]"==f(e)},dt={};function ht(e,s,i,a,n,o){var l,h=1&s,c=2&s,p=4&s;if(i&&(l=n?i(e,a,n,o):i(e)),void 0!==l)return l;if(!t(e))return e;var _=$(e);if(_){if(l=function(e){var t=e.length,s=new e.constructor(t);return t&&"string"==typeof e[0]&&Ze.call(e,"index")&&(s.index=e.index,s.input=e.input),s}(e),!h)return function(e,t){var s=-1,i=e.length;for(t||(t=Array(i));++s<i;)t[s]=e[s];return t}(e,l)}else{var m=f(e),v="[object Function]"==m||"[object GeneratorFunction]"==m;if(x(e))return function(e,t){if(t)return e.slice();var s=e.length,i=Qe?Qe(s):new e.constructor(s);return e.copy(i),i}(e,h);if("[object Object]"==m||"[object Arguments]"==m||v&&!n){if(l=c||v?{}:function(e){return"function"!=typeof e.constructor||r(e)?{}:Re(He(e))}(e),!h)return c?function(e,t){return qe(e,Ge(e),t)}(e,function(e,t){return e&&qe(t,We(t),e)}(l,e)):function(e,t){return qe(e,u(e),t)}(e,function(e,t){return e&&qe(t,d(t),e)}(l,e))}else{if(!dt[m])return n?e:{};l=at(e,m,h)}}o||(o=new w);var g=o.get(e);if(g)return g;o.set(e,l),lt(e)?e.forEach((function(t){l.add(ht(t,s,i,t,e,o))})):rt(e)&&e.forEach((function(t,a){l.set(a,ht(t,s,i,a,e,o))}));var y=_?void 0:(p?c?Je:k:c?We:d)(e);return function(e,t){for(var s=-1,i=null==e?0:e.length;++s<i&&!1!==t(e[s],s,e););}(y||e,(function(t,a){y&&(t=e[a=t]),ze(l,a,ht(t,s,i,a,e,o))})),l}dt["[object Arguments]"]=dt["[object Array]"]=dt["[object ArrayBuffer]"]=dt["[object DataView]"]=dt["[object Boolean]"]=dt["[object Date]"]=dt["[object Float32Array]"]=dt["[object Float64Array]"]=dt["[object Int8Array]"]=dt["[object Int16Array]"]=dt["[object Int32Array]"]=dt["[object Map]"]=dt["[object Number]"]=dt["[object Object]"]=dt["[object RegExp]"]=dt["[object Set]"]=dt["[object String]"]=dt["[object Symbol]"]=dt["[object Uint8Array]"]=dt["[object Uint8ClampedArray]"]=dt["[object Uint16Array]"]=dt["[object Uint32Array]"]=!0,dt["[object Error]"]=dt["[object Function]"]=dt["[object WeakMap]"]=!1;var ut=function(){return h.Date.now()},ct=Math.max,pt=Math.min;function _t(e,s,i){var a,n,r,o,l,d,h=0,u=!1,c=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function _(t){var s=a,i=n;return a=n=void 0,h=t,o=e.apply(i,s)}function m(e){return h=e,l=setTimeout(g,s),u?_(e):o}function v(e){var t=e-d;return void 0===d||t>=s||t<0||c&&e-h>=r}function g(){var e=ut();if(v(e))return f(e);l=setTimeout(g,function(e){var t=s-(e-d);return c?pt(t,r-(e-h)):t}(e))}function f(e){return l=void 0,p&&a?_(e):(a=n=void 0,o)}function y(){var e=ut(),t=v(e);if(a=arguments,n=this,d=e,t){if(void 0===l)return m(d);if(c)return clearTimeout(l),l=setTimeout(g,s),_(d)}return void 0===l&&(l=setTimeout(g,s)),o}return s=Oe(s)||0,t(i)&&(u=!!i.leading,r=(c="maxWait"in i)?ct(Oe(i.maxWait)||0,s):r,p="trailing"in i?!!i.trailing:p),y.cancel=function(){void 0!==l&&clearTimeout(l),h=0,a=d=n=l=void 0},y.flush=function(){return void 0===l?o:f(ut())},y}var mt=Math.floor,vt=Math.random;var gt=parseFloat,ft=Math.min,yt=Math.random;function bt(e,s,r){if(r&&"boolean"!=typeof r&&function(e,s,r){if(!t(r))return!1;var o=typeof s;return!!("number"==o?a(r)&&n(s,r.length):"string"==o&&s in r)&&i(r[s],e)}(e,s,r)&&(s=r=void 0),void 0===r&&("boolean"==typeof s?(r=s,s=void 0):"boolean"==typeof e&&(r=e,e=void 0)),void 0===e&&void 0===s?(e=0,s=1):(e=Ve(e),void 0===s?(s=e,e=0):s=Ve(s)),e>s){var o=e;e=s,s=o}if(r||e%1||s%1){var l=yt();return ft(e+l*(s-e+gt("1e-"+((l+"").length-1))),s)}return function(e,t){return e+mt(vt()*(t-e+1))}(e,s)}var xt=Math.min;function wt(e,t){if((e=function(e){var t=Ve(e),s=t%1;return t==t?s?t-s:t:0}(e))<1||e>9007199254740991)return[];var s,i=4294967295,a=xt(e,4294967295);e-=4294967295;for(var n=D(a,t="function"==typeof(s=t)?s:je);++i<e;)t(i);return n}class $t extends CustomEvent{constructor(e){super("change",{detail:e})}}let kt,Dt,St=e=>e;class Ct extends S{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.getText=e=>e}static get properties(){return C(C({},super.properties),{},{value:{type:Array},disabled:{type:Boolean},getText:{type:Object}})}static get styles(){return L.styles}render(){return E(kt||(kt=St` <div class="font-lumo text-m w-full"> <ul> ${0} </ul> <div class="p-m"> <slot></slot> </div> </div> `),this.value.map(((e,t)=>E(Dt||(Dt=St` <li class="${0}"> <slot name="${0}">${0}</slot> <button ?disabled="${0}" class="w-l h-l rounded text-tertiary transition duration-150 hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </li> `),"ml-m h-l text-body flex justify-between items-center"+(t>0?" border-t border-contrast-10":""),t,this.getText(e),this.disabled,(()=>this.__remove(t))))))}__remove(e){this.value=this.value.filter(((t,s)=>s!==e)),this.dispatchEvent(new $t(this.value))}}let Et,It,At=e=>e;class Mt extends S{static get styles(){return[L.styles,I(Et||(Et=At`:host{position:absolute;top:0;right:0;bottom:0;left:0}.top-center{top:calc(50% - (var(--lumo-size-xl)/ 2))}@keyframes dash0{from{transform:translate(0,0)}to{transform:translate(5.681301px,3.368302px)}}@keyframes dash1{from{transform:translate(0,0)}to{transform:translate(5.677051px,3.457428px)}}@keyframes dash2{from{transform:translate(0,0)}to{transform:translate(5.686002px,3.127455px)}}@keyframes dash3{from{transform:translate(-5.6842px,-3.404556px)}to{transform:translate(0,0)}}`))]}render(){return E(It||(It=At` <div class="h-full bg-base text-primary"> <svg xmlns="http://www.w3.org/2000/svg" class="fill-current w-xl h-xl mx-auto sticky top-center" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" viewBox="0 0 64 64"> <path id="ew5fy7afo2w2" fill-rule="evenodd" stroke="none" stroke-width="1" d="M41.93 49.46c0 .18-.2.3-.36.2l-1.78-1.07-22.73-13.76a1.5 1.5 0 01-.7-1.3V11.08c0-.18.2-.3.36-.2l1.75 1.04c.44.25.74.75.74 1.32v19.27c0 .08.05.16.12.2L41.22 46c.47.28.73.8.72 1.32v2.15z" clip-rule="evenodd"/> <path id="ew5fy7afo2w3" fill-rule="evenodd" stroke="none" stroke-width="1" d="M47.64 52.9c0 .2-.2.3-.36.21l-1.8-1.08c-.42-.26-.7-.74-.7-1.3v-19.3a.24.24 0 00-.12-.2L25.27 19.47a.24.24 0 00-.37.21v12.55c0 .19-.21.3-.37.2l-1.76-1.06a1.46 1.46 0 01-.71-1.28V16.7c0-.54.27-1.03.71-1.3.45-.27 1-.26 1.44 0l22.72 13.77c.44.26.7.76.7 1.3v20.27l.01 2.17z" clip-rule="evenodd"/> <g style="animation:dash0 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w4" fill-rule="evenodd" stroke="none" stroke-width="1" d="M30.59 35.68c0 .2-.21.3-.37.21l-1.8-1.1c-.41-.27-.68-.74-.68-1.28V27v-2.15c0-.2.2-.3.37-.21l1.78 1.06c.42.26.7.74.7 1.3v8.68z" clip-rule="evenodd"/> </g> <g style="animation:dash1 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w5" fill-rule="evenodd" stroke="none" stroke-width="1" d="M36.28 39.13c0 .2-.2.3-.37.21l-1.79-1.1c-.41-.25-.69-.73-.69-1.28v-6.51-2.16c0-.2.2-.31.37-.21l1.76 1.06c.44.26.73.75.73 1.3v8.69z" clip-rule="evenodd"/> </g> <g style="animation:dash2 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w6" fill-rule="evenodd" stroke="none" stroke-width="1" d="M41.96 42.57c0 .2-.2.3-.37.21L39.8 41.7a1.52 1.52 0 01-.71-1.3v-6.51-2.17c0-.2.2-.31.37-.21l1.74 1.06c.45.25.75.75.75 1.32v8.68z" clip-rule="evenodd"/> </g> <g transform="translate(-5.68 -3.4)" style="animation:dash3 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w7" fill-rule="evenodd" stroke="none" stroke-width="1" d="M30.59 35.68c0 .2-.21.3-.37.21l-1.8-1.1c-.41-.27-.68-.74-.68-1.28V27v-2.15c0-.2.2-.3.37-.21l1.78 1.06c.42.26.7.74.7 1.3v8.68z" clip-rule="evenodd"/> </g> </svg> </div> `))}}let Tt,Ot,Vt=e=>e;class jt extends S{static get styles(){return[L.styles,I(Tt||(Tt=Vt`::slotted(:not([slot])){margin-top:var(--lumo-space-xl)}`))]}render(){return E(Ot||(Ot=Vt` <article class="relative antialiased font-lumo"> <header class="space-y-xs leading-s"> <h1 class="font-bold text-header text-xl border-b border-contrast-10 pb-s mb-s"> <slot name="title"></slot> </h1> <p class="text-l text-secondary"> <slot name="subtitle"></slot> </p> </header> <slot></slot> </article> `))}}let Ft,Rt,Pt=e=>e;class Nt extends jt{static get styles(){return[super.styles,I(Ft||(Ft=Pt`::slotted(:not([slot])){margin-top:var(--lumo-space-m)}`))]}render(){return E(Rt||(Rt=Pt` <section class="leading-s antialiased font-lumo"> <header> <h2 class="text-header font-semibold text-l"> <slot name="title"></slot> </h2> <p class="text-secondary text-m"> <slot name="subtitle"></slot> </p> </header> <slot></slot> </section> `))}}let Bt,zt=e=>e;class qt extends CustomEvent{constructor(e){super("change",{detail:e})}}class Yt extends S{constructor(){super(...arguments),this.disabled=!1,this.checked=!1}static get properties(){return C(C({},super.properties),{},{disabled:{attribute:!1},checked:{attribute:!1}})}static get styles(){return L.styles}render(){return E(Bt||(Bt=zt` <label class="${0}"> <span class="text-body text-m mr-m"> <slot></slot> </span> <span style="border-radius:var(--lumo-size-xl);width:calc((var(--lumo-space-l) * 2) + (var(--lumo-space-xs) * 2))" class="${0}"> <span style="width:var(--lumo-space-l);height:var(--lumo-space-l)" class="${0}"></span> <input type="checkbox" class="opacity-0 absolute inset-0" .checked="${0}" .disabled="${0}" @change="${0}"> </span> </label> `),ue({"transition duration-200 flex justify-between items-center group":!0,"cursor-pointer":!this.disabled}),ue({"transition duration-150 relative flex flex-shrink-0 items-center":!0,"bg-success focus-within-shadow-outline-success":!this.disabled&&this.checked,"bg-contrast-10 focus-within-shadow-outline":this.disabled||!this.checked,"bg-contrast-20":!this.disabled&&!this.checked}),ue({"bg-tint transition duration-200 transform block rounded-full m-xs":!0,"translate-x-l":this.checked,"translate-x-0":!this.checked,"shadow-xs group-hover-shadow-s group-hover-scale-110":!this.disabled}),this.checked,this.disabled,(()=>{this.checked=!this.checked,this.dispatchEvent(new qt(this.checked))}))}}class Lt extends Error{constructor(){super("Unhandled request detected. Please add a request handler to connect this component to a backend.")}}class Wt extends CustomEvent{static emit(e){return new Promise(((t,s)=>{const i=new Wt(C({resolve:t,reject:s},e));e.source.dispatchEvent(i)&&s(new Lt)}))}constructor({source:e,resolve:t,reject:s,init:i}){var a;super("request",{cancelable:!0,composed:!0,bubbles:!0,detail:{source:e,handle:async function(e){a.stopImmediatePropagation(),a.preventDefault();try{t(await e(...i))}catch(e){s(e)}}}}),a=this}}const Ht=ce`<dom-module id="lumo-custom-field" theme-for="vaadin-custom-field">
|
|
2
2
|
<template>
|
|
3
3
|
<style include="lumo-required-field">
|
|
4
4
|
:host {
|
|
@@ -166,7 +166,7 @@ This program is available under Apache License Version 2.0, available at https:/
|
|
|
166
166
|
</div>
|
|
167
167
|
<div part="error-message" id="[[__errorId]]" aria-live="assertive" aria-hidden\$="[[__getErrorMessageAriaHidden(invalid, errorMessage, __errorId)]]">[[errorMessage]]</div>
|
|
168
168
|
</div>
|
|
169
|
-
`}static get is(){return"vaadin-custom-field"}static get version(){return"1.3.0"}static get properties(){return{label:{type:String,value:"",observer:"_labelChanged"},name:String,required:{type:Boolean,reflectToAttribute:!0},value:{type:String,observer:"__valueChanged",notify:!0},invalid:{type:Boolean,reflectToAttribute:!0,notify:!0,value:!1,observer:"__invalidChanged"},errorMessage:{type:String,value:"",observer:"__errorMessageChanged"},helperText:{type:String,value:"",observer:"__helperTextChanged"}}}static get observers(){return["__getActiveErrorId(invalid, errorMessage, __errorId, helperText, __helperTextId, __hasSlottedHelper)","__getActiveLabelId(label, __labelId)","__toggleHasValue(value)"]}__invalidChanged(e){this.__setOrToggleAttribute("aria-invalid",e,this)}__errorMessageChanged(e){this.__setOrToggleAttribute("has-error-message",!!e,this)}__helperTextChanged(e){this.__setOrToggleAttribute("has-helper",!!e,this)}__toggleHasValue(e){null!==e&&""!==e.trim()?this.setAttribute("has-value",""):this.removeAttribute("has-value")}_labelChanged(e){""!==e&&null!=e?this.setAttribute("has-label",""):this.removeAttribute("has-label")}validate(){return!(this.invalid=!this.checkValidity())}checkValidity(){return!(this.inputs.filter((e=>!(e.validate||e.checkValidity).call(e))).length||this.required&&!this.value.trim())}__setOrToggleAttribute(e,t,s){e&&s&&s.hasAttribute(e)===!t&&(t?s.setAttribute(e,"boolean"==typeof t?"":t):s.removeAttribute(e))}__getActiveErrorId(e,t,s,i,a,n){const r=[];(i||n)&&r.push(a),t&&e&&r.push(s),r.length>0?this.setAttribute("aria-describedby",r.join(" ")):this.removeAttribute("aria-describedby")}__getActiveLabelId(e,t){this.__setOrToggleAttribute("aria-labelledby",e?t:void 0,this)}__getErrorMessageAriaHidden(e,t,s){return(!(t&&e?s:void 0)).toString()}}customElements.define(Xt.is,Xt);let Kt,Qt=e=>e;class Gt extends CustomEvent{constructor(e){super("change",{detail:e})}}class Jt extends W{constructor(){super(...arguments),this.disabled=!1,this.value=1,this.__errorMessage=null,this.__customFieldI18n={formatValue:e=>{const t=parseInt(e[0]);if(isNaN(t))return"0";const s=e[1];return"w"===s?(10080*t).toFixed(0):"d"===s?(1440*t).toFixed(0):"h"===s?(60*t).toFixed(0):t.toFixed(0)},parseValue:e=>{const t=parseInt(e);return t%10080==0?[(t/10080).toFixed(0),"w"]:t%1440==0?[(t/1440).toFixed(0),"d"]:t%60==0?[(t/60).toFixed(0),"h"]:[t.toFixed(0),"m"]}},this.__renderer=this.__renderItems.bind(this)}static get scopedElements(){return{"vaadin-integer-field":H,"vaadin-custom-field":Xt,"vaadin-select":U,"x-i18n":X}}static get properties(){return C(C({},super.properties),{},{disabled:{attribute:!1},value:{attribute:!1}})}render(){var e;return E(Kt||(Kt=Qt` <div class="text-xs text-tertiary font-lumo"> <vaadin-custom-field ?disabled="${0}" .label="${0}" .value="${0}" .i18n="${0}" data-testid="field" id="field" @change="${0}"> <vaadin-integer-field .disabled="${0}" .min="${0}" data-testid="count" has-controls> </vaadin-integer-field> <vaadin-select .disabled="${0}" .renderer="${0}" data-testid="units"> </vaadin-select> </vaadin-custom-field> <br> <x-i18n .lang="${0}" .ns="${0}" .key="${0}" data-testid="error" class="${0}"> </x-i18n> </div> `),this.disabled||!this._isI18nReady,this._isI18nReady?this._t("session.title").toString():"---",this._isI18nReady?this.value.toString():"",this.__customFieldI18n,this.__handleChange,this.disabled||!this._isI18nReady,1,this.disabled||!this._isI18nReady,this._isI18nReady?this.__renderer:null,this.lang,this.ns,this._t(`session.${null!==(e=this.__errorMessage)&&void 0!==e?e:"subtitle"}`).toString(),ue({"text-error":null!==this.__errorMessage&&!this.disabled}))}firstUpdated(){this.shadowRoot.getElementById("field").value=this.value.toString()}updated(e){e.has("value")&&this.__reportValidity()}__renderItems(e){let t=e.querySelector("vaadin-list-box");null===t&&(t=document.createElement("vaadin-list-box"),e.appendChild(t));const s=["m","h","d","w"],i=["minute_plural","hour_plural","d_plural","w_plural"],a=t.querySelectorAll("vaadin-item");for(let e=0;e<Math.max(s.length,a.length);++e)if(s[e]){let n;a[e]?n=a[e]:(n=document.createElement("vaadin-item"),t.appendChild(n)),n.value=s[e],n.textContent=this._t(i[e])}else a[e].remove()}__handleChange(e){e.stopPropagation(),this.value=parseInt(e.target.value),this.dispatchEvent(new Gt({value:this.value,invalid:!this.__reportValidity()}))}__reportValidity(){return this.__errorMessage=this.value<1?"too_short":this.value>40320?"too_long":null,this.requestUpdate(),null===this.__errorMessage}}let Zt,es=e=>e;class ts extends CustomEvent{constructor(e){super("change",{detail:e})}}class ss extends W{constructor(){super(...arguments),this.disabled=!1,this.value="",this.__errorMessage=""}static get scopedElements(){return{"vaadin-password-field":ye,"vaadin-button":N,"iron-icon":customElements.get("iron-icon"),"x-i18n":X}}static get properties(){return C(C({},super.properties),{},{disabled:{attribute:!1},value:{attribute:!1}})}render(){const e=""!==this.__errorMessage&&!this.disabled,t=e?this._t(`jwt.${this.__errorMessage}`).toString():"";return E(Zt||(Zt=es` <div class="space-y-xs"> <div class="flex items-start"> <vaadin-password-field .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" .label="${0}" data-testid="input" class="w-full" @change="${0}" @input="${0}"> </vaadin-password-field> <vaadin-button class="flex-shrink-0 ml-s" style="margin-top:calc(var(--lumo-font-size-s) * 1.5)" theme="error" data-testid="button" .disabled="${0}" @click="${0}"> <x-i18n .lang="${0}" .ns="${0}" key="jwt.refresh"></x-i18n> <iron-icon icon="icons:refresh" slot="suffix"></iron-icon> </vaadin-button> </div> <x-i18n .lang="${0}" .ns="${0}" key="jwt.subtitle" class="text-xs text-tertiary font-lumo"> </x-i18n> </div> `),t,this.disabled||!this._isI18nReady,e,this._isI18nReady?this.value:"",this._isI18nReady?this._t("jwt.title").toString():"---",(e=>e.stopPropagation()),this.__handleInput,this.disabled||!this._isI18nReady,this.__regenerateValue,this.lang,this.ns,this.lang,this.ns)}updated(e){e.has("value")&&this.__reportValidity()}__regenerateValue(){this.__errorMessage="",this.value=wt(72,(()=>bt(35).toString(36))).join(""),this.dispatchEvent(new ts({value:this.value,invalid:!1}))}__handleInput(e){this.value=e.target.value,this.dispatchEvent(new ts({value:this.value,invalid:!this.__reportValidity()}))}__reportValidity(){var e;return this.__errorMessage=0===this.value.length?"required":this.value.length<40?"too_short":this.value.length>100?"too_long":(e=this.value,/^[a-z0-9-]+$/i.test(e)?"":"invalid"),this.requestUpdate(),""===this.__errorMessage}}function is(e){return t=>{t.preventDefault(),e(t)}}class as extends K{}let ns,rs=e=>e;class os extends W{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=os.defaultValue,this.__items=["y","m","w","d"]}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"vaadin-button":customElements.get("vaadin-button"),"x-dropdown":Q}}static get properties(){return C(C({},super.properties),{},{disabled:{type:Boolean},value:{type:String}})}render(){return E(ns||(ns=rs` <div class="grid grid-cols-2 gap-s"> <vaadin-integer-field data-testid="value" class="w-full" min="1" has-controls .value="${0}" .disabled="${0}" @change="${0}"> </vaadin-integer-field> <x-dropdown data-testid="units" .disabled="${0}" .getText="${0}" .items="${0}" .value="${0}" @change="${0}"> </x-dropdown> </div> `),this._isI18nReady?this.__numericValue:"",this.disabled,this.__handleNumberChange,this.disabled,(e=>this._isI18nReady?this._t(`${e}_plural`):""),this.__items,this._isI18nReady?this.__unitsValue:"",this.__handleUnitsChange)}get __numericValue(){var e;return xe(null!==(e=this.value)&&void 0!==e?e:"").count}get __unitsValue(){var e;return xe(null!==(e=this.value)&&void 0!==e?e:"").units}__handleNumberChange(e){e.stopPropagation();const t=e.target.value;this.value=this.value.replace(String(this.__numericValue),t),this.__sendChange()}__handleUnitsChange(e){this.value=this.value.replace(String(this.__unitsValue),e.detail),this.__sendChange()}__sendChange(){this.dispatchEvent(new as(this.value))}}os.defaultValue="1w";class ls extends $t{}let ds,hs,us,cs,ps=e=>e;class _s extends W{constructor(){super("customer-portal-settings"),this.value=[],this.disabled=!1,this.__newValue=os.defaultValue}static get scopedElements(){return{"iron-icon":customElements.get("iron-icon"),"vaadin-button":customElements.get("vaadin-button"),"x-frequency-input":os,"x-skeleton":G,"x-list":Ct,"x-i18n":X}}static get properties(){return C(C({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const e=this.disabled||!this._isI18nReady||this.value.length>=20;return E(ds||(ds=ps` <x-list data-testid="list" .value="${0}" .disabled="${0}" @change="${0}"> ${0} <div class="space-y-s md-space-y-0 md-space-x-s w-full md-flex"> <x-frequency-input data-testid="input" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-input> <vaadin-button data-testid="button" class="w-full md-w-auto" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_option"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> </div> ${0} </x-list> `),this.value,this.disabled||!this._isI18nReady,this.__handleListChange,this.value.map(((e,t)=>this._isI18nReady?E(hs||(hs=ps`<span slot="${0}">${0}</span>`),t,this.__getText(e)):E(us||(us=ps`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this.lang,this.__newValue,e,this.__handleNewValueChange,e,this.__handleSubmit,this.ns,this.lang,this.value.length>0?E(cs||(cs=ps` <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_option_hint" class="${0}"> </x-i18n> `),this.ns,this.lang,ue({"block text-xs mt-xs":!0,"text-tertiary":this.value.length<20,"text-primary":this.value.length>=20})):"")}__handleNewValueChange(e){this.__newValue=e.detail}__handleListChange(e){this.value=e.detail,this.__sendChange()}__handleSubmit(){this.value=[...this.value,this.__newValue],this.__newValue=os.defaultValue,this.__sendChange()}__sendChange(){this.dispatchEvent(new ls(this.value))}__getText(e){const t=e[e.length-1],s=parseInt(e.replace(t,""));return this._t("duration",{count:s,units:this._t(t,{count:s})})}}class ms extends J{}let vs,gs,fs=e=>e;class ys extends W{constructor(){super(...arguments),this.disabled=!1,this.value="*",this.__errorMessage="",this.__items=["all","some"],this.__handleNewValueChange=_t((e=>{try{we(e).evaluate({}),this.value=e,this.__errorMessage="",this.__sendChange()}catch(e){this.__errorMessage=e.message}this.requestUpdate()}),275)}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"iron-icon":customElements.get("iron-icon"),"x-choice":Z,"x-i18n":X}}static get properties(){return C(C({},super.properties),{},{disabled:{type:Boolean},value:{type:String}})}render(){const e="pl-xs text-primary rounded font-medium cursor-pointer transition duration-200 focus-outline-none focus-shadow-outline hover-underline";return E(vs||(vs=fs` <x-choice data-testid="choice" .disabled="${0}" .value="${0}" .items="${0}" @change="${0}"> <x-i18n slot="all-label" .ns="${0}" .lang="${0}" key="jsonata.all"></x-i18n> <x-i18n slot="some-label" .ns="${0}" .lang="${0}" key="jsonata.some"></x-i18n> ${0} </x-choice> `),this.disabled||!this._isI18nReady,this.__choice,this.__items,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.__choice===this.__items[1]?E(gs||(gs=fs` <div slot="${0}" class="space-y-s pb-m"> <x-i18n .ns="${0}" .lang="${0}" key="jsonata.hint" class="block font-lumo text-s text-tertiary leading-s"> <a target="_blank" class="${0}" href="https://docs.jsonata.org" rel="noopener noreferrer"> JSONata <iron-icon icon="icons:open-in-new" class="icon-inline"></iron-icon> </a> <a target="_blank" class="${0}" href="https://api.foxycart.com/rels/subscription" rel="noopener noreferrer"> hAPI subscription <iron-icon icon="icons:open-in-new" class="icon-inline"></iron-icon> </a> </x-i18n> <vaadin-text-field class="w-full" data-testid="input" .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" @keydown="${0}" @change="${0}" @input="${0}"> </vaadin-text-field> </div> `),this.__items[1],this.ns,this.lang,e,e,this.__errorMessage,this.disabled||!this._isI18nReady,this.__errorMessage.length>0,this._isI18nReady?this.value:"",this.__stopNavigation,(e=>e.stopPropagation()),(e=>this.__handleNewValueChange(e.target.value))):"")}get __choice(){return this.__items["*"===this.value?0:1]}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?"*":'$contains(frequency, "w")',this.__sendChange()}__stopNavigation(e){e.key.startsWith("Arrow")&&e.stopPropagation()}__sendChange(){this.dispatchEvent(new ms(this.value))}}class bs extends CustomEvent{constructor(e){super("change",{detail:e})}}class xs extends CustomEvent{constructor(){super("remove")}}let ws,$s,ks=e=>e;class Ds extends W{constructor(){super(...arguments),this.open=!1,this.value={jsonataQuery:"*",values:[]},this.disabled=!1}static get scopedElements(){return{"x-frequency-list":_s,"x-jsonata-input":ys,"iron-icon":customElements.get("iron-icon"),"x-group":be,"x-i18n":X}}static get properties(){return C(C({},super.properties),{},{open:{attribute:!1},value:{attribute:!1},disabled:{attribute:!1}})}render(){const{jsonataQuery:e,values:t}=this.value,s=this.open?"":"rounded-b-l";return E(ws||(ws=ks` <x-group frame> <details data-testid="details" class="${0}" ?open="${0}" @toggle="${0}"> <summary class="${0} cursor-pointer relative leading-s rounded-t-l focus-outline-none focus-shadow-outline"> <div class="p-m space-y-xs mr-xl"> <x-i18n .ns="${0}" .lang="${0}" .key="${0}" class="block text-m text-header font-medium"> ${0} </x-i18n> <x-i18n .ns="${0}" .lang="${0}" class="block text-s text-tertiary" key="fmod.valuesLabel"> <x-i18n .ns="${0}" .key="${0}" .lang="${0}" .opts="${0}" class="text-secondary"> </x-i18n> </x-i18n> </div> <button data-testid="remove" .disabled="${0}" class="flex items-center justify-center rounded absolute top-0 right-0 text-tertiary hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" style="width:54px;height:54px" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </summary> <div class="space-y-l pt-m" slot="content"> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="fmod.match"></x-i18n> <x-jsonata-input data-testid="jsonata" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-jsonata-input> </x-group> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="fmod.options"> </x-i18n> <x-frequency-list data-testid="frequency" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-list> </x-group> </div> </details> </x-group> `),ue({"font-lumo":!0,"pointer-events-none":!this._isI18nReady}),this.open,(()=>this.open=!this.open),s,this.ns,this.lang,`fmod.${"*"===e?"all":"some"}Title`,"*"!==e?this.__renderJSONataSummary(e):"",this.ns,this.lang,this.ns,"fmod.valuesList"+(0===t.length?"Empty":""),this.lang,{values:t.map((e=>this.__translateFrequency(e)))},this.disabled||!this._isI18nReady,is((()=>{this.dispatchEvent(new xs)})),this.ns,this.lang,this.ns,this.lang,this.value.jsonataQuery,this.disabled||!this._isI18nReady,this.__handleQueryChange,this.ns,this.lang,this.lang,this.value.values,this.disabled||!this._isI18nReady,this.__handleValuesChange)}__translateFrequency(e){if(".5m"===e)return this._t("frequency_0_5m");const{count:t,units:s}=xe(e);return this._t("frequency",{units:this._t(s,{count:t}),count:t})}__renderJSONataSummary(e){return E($s||($s=ks` <code class="inline-block rounded bg-success-10 text-success px-xs text-xs leading-s"> ${0} </code> `),e)}__handleQueryChange(e){this.value=C(C({},this.value),{},{jsonataQuery:e.detail}),this.__sendChange()}__handleValuesChange(e){this.value=C(C({},this.value),{},{values:e.detail}),this.__sendChange()}__sendChange(){this.dispatchEvent(new bs(this.value))}}class Ss extends CustomEvent{constructor(e){super("change",{detail:e})}}let Cs,Es,Is=e=>e;class As extends W{constructor(){super(...arguments),this.value=[],this.disabled=!1}static get scopedElements(){return{"x-frequency-modification-rule":Ds,"vaadin-button":customElements.get("vaadin-button"),"x-section":Nt,"iron-icon":customElements.get("iron-icon"),"x-group":be,"x-i18n":X}}static get properties(){return C(C({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const{ns:e,lang:t}=this;return E(Cs||(Cs=Is` <x-section> <x-i18n .ns="${0}" .lang="${0}" key="fmod.title" slot="title" class="text-l"></x-i18n> <x-i18n .ns="${0}" .lang="${0}" key="fmod.subtitle" slot="subtitle" class="mr-xl"></x-i18n> ${0} <div class="mt-m sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="add" theme="primary" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_rule"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="fmod.add_rule_hint" class="${0}"> </x-i18n> </div> </x-section> `),e,t,e,t,this.value.map(((e,t,s)=>E(Es||(Es=Is` <x-frequency-modification-rule data-testid="rule" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @remove="${0}" @change="${0}"> </x-frequency-modification-rule> `),this.disabled,e,this.lang,this.ns,(()=>{this.value=s.filter(((e,s)=>s!==t)),this.__sendChange()}),(e=>{this.value=s.map(((s,i)=>i===t?e.detail:s)),this.__sendChange()})))),this.disabled||this.value.length>=10||!this._isI18nReady,this.__addRule,this.ns,this.lang,this.lang,this.ns,ue({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":this.value.length<10,"text-primary":this.value.length>=10,hidden:0===this.value.length}))}__addRule(){this.value=[...this.value,{jsonataQuery:"*",values:[]}],this.__sendChange()}__sendChange(){this.dispatchEvent(new Ss(this.value))}}function Ms(e,t){const s=(new Date).getFullYear(),i={month:"long",day:"numeric"};return e.split("..").map((e=>{const a=$e(e),n=(null==a?void 0:a.getFullYear())===s?void 0:"numeric";return null==a?void 0:a.toLocaleDateString(t,C({year:n},i))})).join(" – ")}class Ts extends CustomEvent{constructor(e){super("change",{detail:e})}}let Os,Vs,js,Fs=e=>e;class Rs extends W{constructor(){super("customer-portal-settings"),this.disabled=!1,this.__items=["all","month","day"]}static get scopedElements(){return{"x-monthday-picker":ee,"x-weekday-picker":te,"x-choice":Z,"x-i18n":X}}static get properties(){return C(C({},super.properties),{},{disabled:{type:Boolean},value:{type:Object}})}render(){var e,t,s,i;return E(Os||(Os=Fs` <x-choice data-testid="choice" .value="${0}" .items="${0}" .disabled="${0}" @change="${0}"> <x-i18n slot="all-label" key="ndmod.all" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="month-label" key="ndmod.month" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="day-label" key="ndmod.day" .ns="${0}" .lang="${0}"></x-i18n> ${0} </x-choice> `),null!==(t=null===(e=this.value)||void 0===e?void 0:e.type)&&void 0!==t?t:"all",this.__items,this.disabled,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,"month"===(null===(s=this.value)||void 0===s?void 0:s.type)?E(Vs||(Vs=Fs` <x-monthday-picker slot="month" class="mb-m" data-testid="monthday-picker" .lang="${0}" .disabled="${0}" .value="${0}" @change="${0}"> </x-monthday-picker> `),this.lang,this.disabled||!this._isI18nReady,this.value.days,this.__handleNewValueChange):"day"===(null===(i=this.value)||void 0===i?void 0:i.type)?E(js||(js=Fs` <x-weekday-picker slot="day" class="mb-m" data-testid="weekday-picker" .lang="${0}" .disabled="${0}" .value="${0}" @change="${0}"> </x-weekday-picker> `),this.lang,this.disabled||!this._isI18nReady,this.value.days,this.__handleNewValueChange):"")}__handleNewValueChange(e){this.value.days=e.detail,this.__sendChange()}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?void 0:e.detail===this.__items[1]?{type:"month",days:[]}:{type:"day",days:[]},this.__sendChange()}__sendChange(){this.dispatchEvent(new Ts(this.value))}}const Ps=ce`<dom-module id="lumo-date-picker-overlay" theme-for="vaadin-date-picker-overlay">
|
|
169
|
+
`}static get is(){return"vaadin-custom-field"}static get version(){return"1.3.0"}static get properties(){return{label:{type:String,value:"",observer:"_labelChanged"},name:String,required:{type:Boolean,reflectToAttribute:!0},value:{type:String,observer:"__valueChanged",notify:!0},invalid:{type:Boolean,reflectToAttribute:!0,notify:!0,value:!1,observer:"__invalidChanged"},errorMessage:{type:String,value:"",observer:"__errorMessageChanged"},helperText:{type:String,value:"",observer:"__helperTextChanged"}}}static get observers(){return["__getActiveErrorId(invalid, errorMessage, __errorId, helperText, __helperTextId, __hasSlottedHelper)","__getActiveLabelId(label, __labelId)","__toggleHasValue(value)"]}__invalidChanged(e){this.__setOrToggleAttribute("aria-invalid",e,this)}__errorMessageChanged(e){this.__setOrToggleAttribute("has-error-message",!!e,this)}__helperTextChanged(e){this.__setOrToggleAttribute("has-helper",!!e,this)}__toggleHasValue(e){null!==e&&""!==e.trim()?this.setAttribute("has-value",""):this.removeAttribute("has-value")}_labelChanged(e){""!==e&&null!=e?this.setAttribute("has-label",""):this.removeAttribute("has-label")}validate(){return!(this.invalid=!this.checkValidity())}checkValidity(){return!(this.inputs.filter((e=>!(e.validate||e.checkValidity).call(e))).length||this.required&&!this.value.trim())}__setOrToggleAttribute(e,t,s){e&&s&&s.hasAttribute(e)===!t&&(t?s.setAttribute(e,"boolean"==typeof t?"":t):s.removeAttribute(e))}__getActiveErrorId(e,t,s,i,a,n){const r=[];(i||n)&&r.push(a),t&&e&&r.push(s),r.length>0?this.setAttribute("aria-describedby",r.join(" ")):this.removeAttribute("aria-describedby")}__getActiveLabelId(e,t){this.__setOrToggleAttribute("aria-labelledby",e?t:void 0,this)}__getErrorMessageAriaHidden(e,t,s){return(!(t&&e?s:void 0)).toString()}}customElements.define(Xt.is,Xt);let Kt,Qt=e=>e;class Gt extends CustomEvent{constructor(e){super("change",{detail:e})}}class Jt extends W{constructor(){super(...arguments),this.disabled=!1,this.value=1,this.__errorMessage=null,this.__customFieldI18n={formatValue:e=>{const t=parseInt(e[0]);if(isNaN(t))return"0";const s=e[1];return"w"===s?(10080*t).toFixed(0):"d"===s?(1440*t).toFixed(0):"h"===s?(60*t).toFixed(0):t.toFixed(0)},parseValue:e=>{const t=parseInt(e);return t%10080==0?[(t/10080).toFixed(0),"w"]:t%1440==0?[(t/1440).toFixed(0),"d"]:t%60==0?[(t/60).toFixed(0),"h"]:[t.toFixed(0),"m"]}},this.__renderer=this.__renderItems.bind(this)}static get scopedElements(){return{"vaadin-integer-field":H,"vaadin-custom-field":Xt,"vaadin-select":U,"x-i18n":X}}static get properties(){return C(C({},super.properties),{},{disabled:{attribute:!1},value:{attribute:!1}})}render(){var e;return E(Kt||(Kt=Qt` <div class="text-xs text-tertiary font-lumo"> <vaadin-custom-field ?disabled="${0}" .label="${0}" .value="${0}" .i18n="${0}" data-testid="field" id="field" @change="${0}"> <vaadin-integer-field .disabled="${0}" .min="${0}" data-testid="count" has-controls> </vaadin-integer-field> <vaadin-select .disabled="${0}" .renderer="${0}" data-testid="units"> </vaadin-select> </vaadin-custom-field> <br> <x-i18n .lang="${0}" .ns="${0}" .key="${0}" data-testid="error" class="${0}"> </x-i18n> </div> `),this.disabled||!this._isI18nReady,this._isI18nReady?this._t("session.title").toString():"---",this._isI18nReady?this.value.toString():"",this.__customFieldI18n,this.__handleChange,this.disabled||!this._isI18nReady,1,this.disabled||!this._isI18nReady,this._isI18nReady?this.__renderer:null,this.lang,this.ns,this._t(`session.${null!==(e=this.__errorMessage)&&void 0!==e?e:"subtitle"}`).toString(),ue({"text-error":null!==this.__errorMessage&&!this.disabled}))}firstUpdated(){this.shadowRoot.getElementById("field").value=this.value.toString()}updated(e){e.has("value")&&this.__reportValidity()}__renderItems(e){let t=e.querySelector("vaadin-list-box");null===t&&(t=document.createElement("vaadin-list-box"),e.appendChild(t));const s=["m","h","d","w"],i=["minute_plural","hour_plural","d_plural","w_plural"],a=t.querySelectorAll("vaadin-item");for(let e=0;e<Math.max(s.length,a.length);++e)if(s[e]){let n;a[e]?n=a[e]:(n=document.createElement("vaadin-item"),t.appendChild(n)),n.value=s[e],n.textContent=this._t(i[e])}else a[e].remove()}__handleChange(e){e.stopPropagation(),this.value=parseInt(e.target.value),this.dispatchEvent(new Gt({value:this.value,invalid:!this.__reportValidity()}))}__reportValidity(){return this.__errorMessage=this.value<1?"too_short":this.value>40320?"too_long":null,this.requestUpdate(),null===this.__errorMessage}}let Zt,es=e=>e;class ts extends CustomEvent{constructor(e){super("change",{detail:e})}}class ss extends W{constructor(){super(...arguments),this.disabled=!1,this.value="",this.__errorMessage=""}static get scopedElements(){return{"vaadin-password-field":ye,"vaadin-button":N,"iron-icon":customElements.get("iron-icon"),"x-i18n":X}}static get properties(){return C(C({},super.properties),{},{disabled:{attribute:!1},value:{attribute:!1}})}render(){const e=""!==this.__errorMessage&&!this.disabled,t=e?this._t(`jwt.${this.__errorMessage}`).toString():"";return E(Zt||(Zt=es` <div class="space-y-xs"> <div class="flex items-start"> <vaadin-password-field .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" .label="${0}" data-testid="input" class="w-full" @change="${0}" @input="${0}"> </vaadin-password-field> <vaadin-button class="flex-shrink-0 ml-s" style="margin-top:calc(var(--lumo-font-size-s) * 1.5)" theme="error" data-testid="button" .disabled="${0}" @click="${0}"> <x-i18n .lang="${0}" .ns="${0}" key="jwt.refresh"></x-i18n> <iron-icon icon="icons:refresh" slot="suffix"></iron-icon> </vaadin-button> </div> <x-i18n .lang="${0}" .ns="${0}" key="jwt.subtitle" class="text-xs text-tertiary font-lumo"> </x-i18n> </div> `),t,this.disabled||!this._isI18nReady,e,this._isI18nReady?this.value:"",this._isI18nReady?this._t("jwt.title").toString():"---",(e=>e.stopPropagation()),this.__handleInput,this.disabled||!this._isI18nReady,this.__regenerateValue,this.lang,this.ns,this.lang,this.ns)}updated(e){e.has("value")&&this.__reportValidity()}__regenerateValue(){this.__errorMessage="",this.value=wt(72,(()=>bt(35).toString(36))).join(""),this.dispatchEvent(new ts({value:this.value,invalid:!1}))}__handleInput(e){this.value=e.target.value,this.dispatchEvent(new ts({value:this.value,invalid:!this.__reportValidity()}))}__reportValidity(){var e;return this.__errorMessage=0===this.value.length?"required":this.value.length<40?"too_short":this.value.length>100?"too_long":(e=this.value,/^[a-z0-9-]+$/i.test(e)?"":"invalid"),this.requestUpdate(),""===this.__errorMessage}}function is(e){return t=>{t.preventDefault(),e(t)}}class as extends K{}let ns,rs=e=>e;class os extends W{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=os.defaultValue,this.__items=["y","m","w","d"]}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"vaadin-button":customElements.get("vaadin-button"),"x-dropdown":Q}}static get properties(){return C(C({},super.properties),{},{disabled:{type:Boolean},value:{type:String}})}render(){return E(ns||(ns=rs` <div class="grid grid-cols-2 gap-s"> <vaadin-integer-field data-testid="value" class="w-full" min="1" has-controls .value="${0}" .disabled="${0}" @change="${0}"> </vaadin-integer-field> <x-dropdown data-testid="units" .disabled="${0}" .getText="${0}" .items="${0}" .value="${0}" @change="${0}"> </x-dropdown> </div> `),this._isI18nReady?this.__numericValue:"",this.disabled,this.__handleNumberChange,this.disabled,(e=>this._isI18nReady?this._t(`${e}_plural`):""),this.__items,this._isI18nReady?this.__unitsValue:"",this.__handleUnitsChange)}get __numericValue(){var e;return xe(null!==(e=this.value)&&void 0!==e?e:"").count}get __unitsValue(){var e;return xe(null!==(e=this.value)&&void 0!==e?e:"").units}__handleNumberChange(e){e.stopPropagation();const t=e.target.value;this.value=this.value.replace(String(this.__numericValue),t),this.__sendChange()}__handleUnitsChange(e){this.value=this.value.replace(String(this.__unitsValue),e.detail),this.__sendChange()}__sendChange(){this.dispatchEvent(new as(this.value))}}os.defaultValue="1w";class ls extends $t{}let ds,hs,us,cs,ps=e=>e;class _s extends W{constructor(){super("customer-portal-settings"),this.value=[],this.disabled=!1,this.__newValue=os.defaultValue}static get scopedElements(){return{"iron-icon":customElements.get("iron-icon"),"vaadin-button":customElements.get("vaadin-button"),"x-frequency-input":os,"x-skeleton":G,"x-list":Ct,"x-i18n":X}}static get properties(){return C(C({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const e=this.disabled||!this._isI18nReady||this.value.length>=20;return E(ds||(ds=ps` <x-list data-testid="list" .value="${0}" .disabled="${0}" @change="${0}"> ${0} <div class="w-full md-flex"> <x-frequency-input data-testid="input" class="mb-s md-mb-0 md-mr-s" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-input> <vaadin-button data-testid="button" class="w-full md-w-auto" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_option"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> </div> ${0} </x-list> `),this.value,this.disabled||!this._isI18nReady,this.__handleListChange,this.value.map(((e,t)=>this._isI18nReady?E(hs||(hs=ps`<span slot="${0}">${0}</span>`),t,this.__getText(e)):E(us||(us=ps`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this.lang,this.__newValue,e,this.__handleNewValueChange,e,this.__handleSubmit,this.ns,this.lang,this.value.length>0?E(cs||(cs=ps` <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_option_hint" class="${0}"> </x-i18n> `),this.ns,this.lang,ue({"block text-xs mt-xs text-center md-text-left":!0,"text-tertiary":this.value.length<20,"text-primary":this.value.length>=20})):"")}__handleNewValueChange(e){this.__newValue=e.detail}__handleListChange(e){this.value=e.detail,this.__sendChange()}__handleSubmit(){this.value=[...this.value,this.__newValue],this.__newValue=os.defaultValue,this.__sendChange()}__sendChange(){this.dispatchEvent(new ls(this.value))}__getText(e){const t=e[e.length-1],s=parseInt(e.replace(t,""));return this._t("duration",{count:s,units:this._t(t,{count:s})})}}class ms extends J{}let vs,gs,fs=e=>e;class ys extends W{constructor(){super(...arguments),this.disabled=!1,this.value="*",this.__errorMessage="",this.__items=["all","some"],this.__handleNewValueChange=_t((e=>{try{we(e).evaluate({}),this.value=e,this.__errorMessage="",this.__sendChange()}catch(e){this.__errorMessage=e.message}this.requestUpdate()}),275)}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"iron-icon":customElements.get("iron-icon"),"x-choice":Z,"x-i18n":X}}static get properties(){return C(C({},super.properties),{},{disabled:{type:Boolean},value:{type:String}})}render(){const e="pl-xs text-primary rounded font-medium cursor-pointer transition duration-200 focus-outline-none focus-shadow-outline hover-underline";return E(vs||(vs=fs` <x-choice data-testid="choice" .disabled="${0}" .value="${0}" .items="${0}" @change="${0}"> <x-i18n slot="all-label" .ns="${0}" .lang="${0}" key="jsonata.all"></x-i18n> <x-i18n slot="some-label" .ns="${0}" .lang="${0}" key="jsonata.some"></x-i18n> ${0} </x-choice> `),this.disabled||!this._isI18nReady,this.__choice,this.__items,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.__choice===this.__items[1]?E(gs||(gs=fs` <div slot="${0}" class="space-y-s pb-m"> <x-i18n .ns="${0}" .lang="${0}" key="jsonata.hint" class="block font-lumo text-s text-tertiary leading-s"> <a target="_blank" class="${0}" href="https://docs.jsonata.org" rel="noopener noreferrer"> JSONata <iron-icon icon="icons:open-in-new" class="icon-inline"></iron-icon> </a> <a target="_blank" class="${0}" href="https://api.foxycart.com/rels/subscription" rel="noopener noreferrer"> hAPI subscription <iron-icon icon="icons:open-in-new" class="icon-inline"></iron-icon> </a> </x-i18n> <vaadin-text-field class="w-full" data-testid="input" .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" @keydown="${0}" @change="${0}" @input="${0}"> </vaadin-text-field> </div> `),this.__items[1],this.ns,this.lang,e,e,this.__errorMessage,this.disabled||!this._isI18nReady,this.__errorMessage.length>0,this._isI18nReady?this.value:"",this.__stopNavigation,(e=>e.stopPropagation()),(e=>this.__handleNewValueChange(e.target.value))):"")}get __choice(){return this.__items["*"===this.value?0:1]}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?"*":'$contains(frequency, "w")',this.__sendChange()}__stopNavigation(e){e.key.startsWith("Arrow")&&e.stopPropagation()}__sendChange(){this.dispatchEvent(new ms(this.value))}}class bs extends CustomEvent{constructor(e){super("change",{detail:e})}}class xs extends CustomEvent{constructor(){super("remove")}}let ws,$s,ks=e=>e;class Ds extends W{constructor(){super(...arguments),this.open=!1,this.value={jsonataQuery:"*",values:[]},this.disabled=!1}static get scopedElements(){return{"x-frequency-list":_s,"x-jsonata-input":ys,"iron-icon":customElements.get("iron-icon"),"x-group":be,"x-i18n":X}}static get properties(){return C(C({},super.properties),{},{open:{attribute:!1},value:{attribute:!1},disabled:{attribute:!1}})}render(){const{jsonataQuery:e,values:t}=this.value,s=this.open?"":"rounded-b-l";return E(ws||(ws=ks` <x-group frame> <details data-testid="details" class="${0}" ?open="${0}" @toggle="${0}"> <summary class="${0} cursor-pointer relative leading-s rounded-t-l focus-outline-none focus-shadow-outline"> <div class="p-m space-y-xs mr-xl"> <x-i18n .ns="${0}" .lang="${0}" .key="${0}" class="block text-m text-header font-medium"> ${0} </x-i18n> <x-i18n .ns="${0}" .lang="${0}" class="block text-s text-tertiary" key="fmod.valuesLabel"> <x-i18n .ns="${0}" .key="${0}" .lang="${0}" .opts="${0}" class="text-secondary"> </x-i18n> </x-i18n> </div> <button data-testid="remove" .disabled="${0}" class="flex items-center justify-center rounded absolute top-0 right-0 text-tertiary hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" style="width:54px;height:54px" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </summary> <div class="space-y-l pt-m" slot="content"> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="fmod.match"></x-i18n> <x-jsonata-input data-testid="jsonata" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-jsonata-input> </x-group> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="fmod.options"> </x-i18n> <x-frequency-list data-testid="frequency" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-list> </x-group> </div> </details> </x-group> `),ue({"font-lumo":!0,"pointer-events-none":!this._isI18nReady}),this.open,(()=>this.open=!this.open),s,this.ns,this.lang,`fmod.${"*"===e?"all":"some"}Title`,"*"!==e?this.__renderJSONataSummary(e):"",this.ns,this.lang,this.ns,"fmod.valuesList"+(0===t.length?"Empty":""),this.lang,{values:t.map((e=>this.__translateFrequency(e)))},this.disabled||!this._isI18nReady,is((()=>{this.dispatchEvent(new xs)})),this.ns,this.lang,this.ns,this.lang,this.value.jsonataQuery,this.disabled||!this._isI18nReady,this.__handleQueryChange,this.ns,this.lang,this.lang,this.value.values,this.disabled||!this._isI18nReady,this.__handleValuesChange)}__translateFrequency(e){if(".5m"===e)return this._t("frequency_0_5m");const{count:t,units:s}=xe(e);return this._t("frequency",{units:this._t(s,{count:t}),count:t})}__renderJSONataSummary(e){return E($s||($s=ks` <code class="inline-block rounded bg-success-10 text-success px-xs text-xs leading-s"> ${0} </code> `),e)}__handleQueryChange(e){this.value=C(C({},this.value),{},{jsonataQuery:e.detail}),this.__sendChange()}__handleValuesChange(e){this.value=C(C({},this.value),{},{values:e.detail}),this.__sendChange()}__sendChange(){this.dispatchEvent(new bs(this.value))}}class Ss extends CustomEvent{constructor(e){super("change",{detail:e})}}let Cs,Es,Is=e=>e;class As extends W{constructor(){super(...arguments),this.value=[],this.disabled=!1}static get scopedElements(){return{"x-frequency-modification-rule":Ds,"vaadin-button":customElements.get("vaadin-button"),"x-section":Nt,"iron-icon":customElements.get("iron-icon"),"x-group":be,"x-i18n":X}}static get properties(){return C(C({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const{ns:e,lang:t}=this;return E(Cs||(Cs=Is` <x-section> <x-i18n .ns="${0}" .lang="${0}" key="fmod.title" slot="title" class="text-l"></x-i18n> <x-i18n .ns="${0}" .lang="${0}" key="fmod.subtitle" slot="subtitle" class="mr-xl"></x-i18n> ${0} <div class="mt-m sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="add" theme="primary" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_rule"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="fmod.add_rule_hint" class="${0}"> </x-i18n> </div> </x-section> `),e,t,e,t,this.value.map(((e,t,s)=>E(Es||(Es=Is` <x-frequency-modification-rule data-testid="rule" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @remove="${0}" @change="${0}"> </x-frequency-modification-rule> `),this.disabled,e,this.lang,this.ns,(()=>{this.value=s.filter(((e,s)=>s!==t)),this.__sendChange()}),(e=>{this.value=s.map(((s,i)=>i===t?e.detail:s)),this.__sendChange()})))),this.disabled||this.value.length>=10||!this._isI18nReady,this.__addRule,this.ns,this.lang,this.lang,this.ns,ue({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":this.value.length<10,"text-primary":this.value.length>=10,hidden:0===this.value.length}))}__addRule(){this.value=[...this.value,{jsonataQuery:"*",values:[]}],this.__sendChange()}__sendChange(){this.dispatchEvent(new Ss(this.value))}}function Ms(e,t){const s=(new Date).getFullYear(),i={month:"long",day:"numeric"};return e.split("..").map((e=>{const a=$e(e),n=(null==a?void 0:a.getFullYear())===s?void 0:"numeric";return null==a?void 0:a.toLocaleDateString(t,C({year:n},i))})).join(" – ")}class Ts extends CustomEvent{constructor(e){super("change",{detail:e})}}let Os,Vs,js,Fs=e=>e;class Rs extends W{constructor(){super("customer-portal-settings"),this.disabled=!1,this.__items=["all","month","day"]}static get scopedElements(){return{"x-monthday-picker":ee,"x-weekday-picker":te,"x-choice":Z,"x-i18n":X}}static get properties(){return C(C({},super.properties),{},{disabled:{type:Boolean},value:{type:Object}})}render(){var e,t,s,i;return E(Os||(Os=Fs` <x-choice data-testid="choice" .value="${0}" .items="${0}" .disabled="${0}" @change="${0}"> <x-i18n slot="all-label" key="ndmod.all" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="month-label" key="ndmod.month" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="day-label" key="ndmod.day" .ns="${0}" .lang="${0}"></x-i18n> ${0} </x-choice> `),null!==(t=null===(e=this.value)||void 0===e?void 0:e.type)&&void 0!==t?t:"all",this.__items,this.disabled,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,"month"===(null===(s=this.value)||void 0===s?void 0:s.type)?E(Vs||(Vs=Fs` <x-monthday-picker slot="month" class="mb-m" data-testid="monthday-picker" .lang="${0}" .disabled="${0}" .value="${0}" @change="${0}"> </x-monthday-picker> `),this.lang,this.disabled||!this._isI18nReady,this.value.days,this.__handleNewValueChange):"day"===(null===(i=this.value)||void 0===i?void 0:i.type)?E(js||(js=Fs` <x-weekday-picker slot="day" class="mb-m" data-testid="weekday-picker" .lang="${0}" .disabled="${0}" .value="${0}" @change="${0}"> </x-weekday-picker> `),this.lang,this.disabled||!this._isI18nReady,this.value.days,this.__handleNewValueChange):"")}__handleNewValueChange(e){this.value.days=e.detail,this.__sendChange()}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?void 0:e.detail===this.__items[1]?{type:"month",days:[]}:{type:"day",days:[]},this.__sendChange()}__sendChange(){this.dispatchEvent(new Ts(this.value))}}const Ps=ce`<dom-module id="lumo-date-picker-overlay" theme-for="vaadin-date-picker-overlay">
|
|
170
170
|
<template>
|
|
171
171
|
<style include="lumo-menu-overlay">
|
|
172
172
|
[part="overlay"] {
|
|
@@ -969,4 +969,4 @@ This program is available under Apache License Version 2.0, available at https:/
|
|
|
969
969
|
|
|
970
970
|
<iron-media-query query="[[_fullscreenMediaQuery]]" query-matches="{{_fullscreen}}">
|
|
971
971
|
</iron-media-query>
|
|
972
|
-
`}static get is(){return"vaadin-date-picker"}static get version(){return"4.4.1"}static get properties(){return{clearButtonVisible:{type:Boolean,value:!1},disabled:{type:Boolean,value:!1,reflectToAttribute:!0},errorMessage:String,placeholder:String,helperText:{type:String,value:""},readonly:{type:Boolean,value:!1,reflectToAttribute:!0},invalid:{type:Boolean,reflectToAttribute:!0,notify:!0,value:!1},_userInputValue:String}}static get observers(){return["_userInputValueChanged(_userInputValue)","_setClearButtonLabel(i18n.clear)"]}ready(){super.ready(),re(this,(()=>this._inputElement.validate=()=>{})),this._inputElement.addEventListener("change",(e=>{""!==this._inputElement.value||e.__fromClearButton||(this.__dispatchChange=!0)}))}_onVaadinOverlayClose(e){this._openedWithFocusRing&&this.hasAttribute("focused")?this.focusElement.setAttribute("focus-ring",""):this.hasAttribute("focused")||this.focusElement.blur(),e.detail.sourceEvent&&-1!==e.detail.sourceEvent.composedPath().indexOf(this)&&e.preventDefault()}_toggle(e){e.stopPropagation(),this[this._overlayInitialized&&this.$.overlay.opened?"close":"open"]()}_input(){return this.$.input}set _inputValue(e){this._inputElement.value=e}get _inputValue(){return this._inputElement.value}_getAriaExpanded(e){return Boolean(e).toString()}get focusElement(){return this._input()||this}_setClearButtonLabel(e){this._inputElement.shadowRoot.querySelector('[part="clear-button"]').setAttribute("aria-label",e)}}customElements.define(Js.is,Js);class Zs extends $t{}let ei,ti,si,ii,ai=e=>e;class ni extends W{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.__startValue="",this.__endValue=""}static get scopedElements(){return{"vaadin-date-picker":Js,"vaadin-button":N,"x-skeleton":G,"iron-icon":customElements.get("iron-icon"),"x-i18n":X,"x-list":Ct}}static get properties(){return C(C({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const e=this.value.length>=20||this.disabled||!this._isI18nReady;return E(ei||(ei=ai` <x-list data-testid="list" .value="${0}" .disabled="${0}" @change="${0}"> ${0} <div class="sm-flex sm-items-end"> <div class="grid grid-cols-2 gap-s"> <vaadin-date-picker data-testid="start" .label="${0}" .value="${0}" .disabled="${0}" .placeholder="${0}" @change="${0}"> </vaadin-date-picker> <vaadin-date-picker data-testid="end" .min="${0}" .label="${0}" .value="${0}" .disabled="${0}" .placeholder="${0}" clear-button-visible @change="${0}"> </vaadin-date-picker> </div> <vaadin-button .disabled="${0}" data-testid="submit" class="w-full mt-s sm-mt-0 sm-w-auto sm-ml-s" @click="${0}"> <x-i18n .lang="${0}" .key="ndmod.add_${0}" .ns="${0}"> </x-i18n> <iron-icon icon="icons:add" slot="suffix"></iron-icon> </vaadin-button> </div> ${0} </x-list> `),this.value,this.disabled||!this._isI18nReady,this.__handleListChange,this.value.map(((e,t)=>this._isI18nReady?E(ti||(ti=ai`<span slot="${0}" class="truncate">${0}</span>`),t,Ms(e,this.lang)):E(si||(si=ai`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this._t("ndmod.range_start").toString(),this.__startValue,e,this._isI18nReady?this._t("ndmod.select").toString():"",this.__handleStartValueChange,this.__startValue,this._t("ndmod.range_end").toString(),this.__endValue,e||!this.__startValue,this._isI18nReady?this._t("ndmod.select").toString():"",this.__handleEndValueChange,e||!this.__startValue,this.__submit,this.lang,this.__endValue?"range":"single",this.ns,this.value.length>0?E(ii||(ii=ai` <x-i18n .ns="${0}" .lang="${0}" key="ndmod.add_range_hint" class="${0}"> </x-i18n> `),this.ns,this.lang,ue({"block text-xs mt-xs":!0,"text-tertiary":this.value.length<20,"text-primary":this.value.length>=20})):"")}updated(){const e=this.constructor.getScopedTagName("vaadin-date-picker"),t=this.shadowRoot.querySelectorAll(e);Array.from(t).forEach((e=>e.validate()))}__handleStartValueChange(e){e.stopPropagation(),this.__startValue=e.target.value;const t=$e(this.__endValue),s=$e(this.__startValue);t&&t.getTime()<s.getTime()&&(this.__endValue=""),this.requestUpdate()}__handleEndValueChange(e){e.stopPropagation(),this.__endValue=e.target.value,this.requestUpdate()}__submit(){this.__startValue&&this.__endValue?this.value=[...this.value,[this.__startValue,this.__endValue].join("..")]:this.value=[...this.value,this.__startValue],this.__sendChange(),this.__startValue="",this.__endValue=""}__handleListChange(e){this.value=e.detail,this.__sendChange()}__sendChange(){this.dispatchEvent(new Zs(this.value))}}class ri extends CustomEvent{constructor(e){super("change",{detail:e})}}let oi,li,di=e=>e;class hi extends W{constructor(){super("customer-portal-settings"),this.disabled=!1,this.type="min",this.__items=["none","custom"]}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"x-frequency-input":os,"x-choice":Z,"x-group":be,"x-i18n":X}}static get properties(){return C(C({},super.properties),{},{disabled:{type:Boolean},value:{type:String},type:{type:String}})}render(){return E(oi||(oi=di` <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="${0}"> </x-i18n> <x-choice data-testid="choice" .disabled="${0}" .value="${0}" .items="${0}" @change="${0}"> <x-i18n slot="none-label" .ns="${0}" .lang="${0}" key="ndmod.none"></x-i18n> <x-i18n slot="custom-label" .ns="${0}" .lang="${0}" key="ndmod.custom"></x-i18n> ${0} </x-choice> </x-group> `),this.ns,this.lang,`ndmod.${this.type}`,this.disabled,this.__choice,this.__items,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.__choice===this.__items[1]?E(li||(li=di` <div slot="${0}" class="space-y-s"> <x-frequency-input data-testid="input" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-input> <p class="text-s text-tertiary leading-s">${0}</p> </div> `),this.__items[1],this.value,this.disabled,this.__handleNewValueChange,this.__hint):"")}get __choice(){return this.__items[this.value?1:0]}get __hint(){var e;if(!this._isI18nReady)return"";const{count:t,units:s}=xe(null!==(e=this.value)&&void 0!==e?e:"");return this._t(`ndmod.${this.type}Hint`,{duration:this._t("duration",{count:t,units:this._t(null!=s?s:"",{count:t})})})}__handleNewValueChange(e){this.value=e.detail,this.__sendChange()}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?void 0:"1w",this.__sendChange()}__sendChange(){this.dispatchEvent(new ri(this.value))}}class ui extends CustomEvent{constructor(e){super("change",{detail:e})}}class ci extends CustomEvent{constructor(){super("remove")}}let pi,_i,mi,vi,gi,fi,yi,bi,xi,wi=e=>e;class $i extends W{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value={jsonataQuery:"*"},this.open=!1}static get scopedElements(){return{"x-disallowed-dates":ni,"x-jsonata-input":ys,"x-offset-input":hi,"x-allowed-days":Rs,"iron-icon":customElements.get("iron-icon"),"x-warning":ke,"x-group":be,"x-i18n":X}}static get properties(){return C(C({},super.properties),{},{disabled:{type:Boolean},value:{type:Object},open:{type:Boolean}})}render(){const{min:e,max:t,allowedDays:s,jsonataQuery:i,disallowedDates:a}=this.value,n=e||t,r=s&&s.days.length>0,o=a&&a.length>0,l=this.open?"":"rounded-b-l";return E(pi||(pi=wi` <x-group frame> <details data-testid="details" class="${0}" ?open="${0}" @toggle="${0}"> <summary class="${0} cursor-pointer relative leading-s rounded-t-l focus-outline-none focus-shadow-outline"> <div class="p-m mr-xl text-m text-header font-medium space-y-s"> <div> <x-i18n .ns="${0}" .lang="${0}" key="${0}"> ${0} </x-i18n> </div> ${0} </div> <button data-testid="remove" .disabled="${0}" class="flex items-center justify-center rounded absolute top-0 right-0 text-tertiary hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" style="width:54px;height:54px" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </summary> <article class="space-y-l"> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.match"> </x-i18n> <x-jsonata-input data-testid="jsonata" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-jsonata-input> </x-group> <div class="flex space-y-l md-space-y-0 flex-col md-flex-row"> <div class="md-w-1-2 md-border-r md-border-contrast-10"> <x-offset-input data-testid="min" type="min" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-offset-input> </div> <div class="md-w-1-2"> <x-offset-input data-testid="max" type="max" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-offset-input> </div> </div> ${0} <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.allowed"> </x-i18n> <x-allowed-days data-testid="allowed" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-allowed-days> </x-group> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.excluded"> </x-i18n> <x-disallowed-dates data-testid="disallowed" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-disallowed-dates> </x-group> </article> </details> </x-group> `),ue({"font-lumo":!0,"pointer-events-none":!this._isI18nReady}),this.open,(()=>this.open=!this.open),l,this.ns,this.lang,`ndmod.${"*"===i?"all":"some"}Title`,"*"!==i?this.__renderJSONataSummary(i):"",n||r||o?E(_i||(_i=wi` <div> ${0} </div> `),se(n&&this.__renderMinMaxSummary(e,t),r&&this.__renderAllowedSummary(s),o&&this.__renderDisallowedSummary(a))):"",this.disabled||!this._isI18nReady,is((()=>this.dispatchEvent(new ci))),this.ns,this.lang,this.ns,this.lang,i,this.disabled||!this._isI18nReady,(e=>{this.value=C(C({},this.value),{},{jsonataQuery:e.detail}),this.__sendUpdate()}),this.lang,e,this.disabled||!this._isI18nReady,(e=>{this.value=C(C({},this.value),{},{min:e.detail}),this.__sendUpdate()}),this.lang,t,this.disabled||!this._isI18nReady,(e=>{this.value=C(C({},this.value),{},{max:e.detail}),this.__sendUpdate()}),-1===this.__compareDurations(e,t)?E(mi||(mi=wi` <x-warning class="mx-m" data-testid="warning"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.minWarning"> </x-i18n> </x-warning> `),this.ns,this.lang):"",this.ns,this.lang,this.lang,s,this.disabled||!this._isI18nReady,(e=>{this.value=C(C({},this.value),{},{allowedDays:e.detail}),this.__sendUpdate()}),this.ns,this.lang,this.ns,this.lang,null!=a?a:[],this.disabled||!this._isI18nReady,(e=>{this.value=C(C({},this.value),{},{disallowedDates:e.detail}),this.__sendUpdate()}))}__sendUpdate(){this.dispatchEvent(new ui(this.value))}__getEstimatedDaysFrom(e){const{count:t,units:s}=xe(e);return t*{y:365,m:31,w:7,d:1}[s]}__compareDurations(e,t){return e===t?0:e&&t?this.__getEstimatedDaysFrom(e)<this.__getEstimatedDaysFrom(t)?1:-1:1}__renderJSONataSummary(e){return E(vi||(vi=wi` <code class="inline-block rounded bg-success-10 text-success px-xs text-xs leading-s"> ${0} </code> `),e)}__renderMinMaxContent(e){if(e){const{count:t,units:s}=e;return E(gi||(gi=wi` ${0} <x-i18n .ns="${0}" .lang="${0}" key="${0}" .opts="${0}"></x-i18n> `),t,this.ns,this.lang,s,{count:t})}return E(fi||(fi=wi`<x-i18n .ns="${0}" .lang="${0}" key="ndmod.any"></x-i18n>`),this.ns,this.lang)}__renderMinMaxSummary(e,t){return E(yi||(yi=wi` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.range"> <span>:</span> <span class="text-secondary"> ${0} — ${0} </span> </x-i18n> </div> `),this.ns,this.lang,this.__renderMinMaxContent(e?xe(e):void 0),this.__renderMinMaxContent(t?xe(t):void 0))}__renderAllowedSummary({type:e,days:t}){return E(bi||(bi=wi` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.allowed"> <span>:</span> <span class="text-secondary"> ${0} ${0} </span> </x-i18n> </div> `),this.ns,this.lang,"month"===e?t.join(", "):"","day"===e?t.map((e=>ie(e,this.lang,"short"))).join(", "):"")}__renderDisallowedSummary(e){return E(xi||(xi=wi` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.excluded"> <span>:</span> <span class="text-secondary"> ${0} </span> </x-i18n> </div> `),this.ns,this.lang,e.map((e=>Ms(e,this.lang))).join("; "))}}class ki extends CustomEvent{constructor(e){super("change",{detail:e})}}let Di,Si,Ci,Ei=e=>e;class Ii extends W{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=!1}static get scopedElements(){return{"x-next-date-modification-rule":$i,"vaadin-button":customElements.get("vaadin-button"),"x-section":Nt,"iron-icon":customElements.get("iron-icon"),"x-switch":Yt,"x-i18n":X}}static get properties(){return C(C({},super.properties),{},{disabled:{type:Boolean},value:{type:Array}})}render(){const e=!this._isI18nReady||this.disabled||!this.value||Array.isArray(this.value)&&this.value.length>=10;return E(Di||(Di=Ei` <x-section> <x-switch slot="title" class="-my-xs" data-testid="toggle" .checked="${0}" .disabled="${0}" @change="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.title" class="text-l"></x-i18n> </x-switch> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.subtitle" slot="subtitle" class="mr-xl"> </x-i18n> ${0} <div class="mt-m sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="add" theme="primary" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.add"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="ndmod.add_hint" class="${0}"> </x-i18n> </div> </x-section> `),Boolean(this.value),this.disabled||!this._isI18nReady,this.__toggleValue,this.ns,this.lang,this.ns,this.lang,this.value?E(Si||(Si=Ei` ${0} `),this.__normalizedValue.map(((e,t,s)=>E(Ci||(Ci=Ei` <x-next-date-modification-rule data-testid="rule" .disabled="${0}" .value="${0}" .lang="${0}" @remove="${0}" @change="${0}"> </x-next-date-modification-rule> `),this.disabled||!this._isI18nReady,e,this.lang,(()=>{this.value=s.filter(((e,s)=>s!==t)),this.__sendChange()}),(e=>{this.value=s.map(((s,i)=>i===t?e.detail:s)),this.__sendChange()}))))):"",e,this.__addRule,this.ns,this.lang,this.lang,this.ns,ue({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":Array.isArray(this.value)&&this.value.length<10,"text-primary":Array.isArray(this.value)&&this.value.length>=10,hidden:!Array.isArray(this.value)||0===this.value.length}))}get __normalizedValue(){return"boolean"==typeof this.value?[]:this.value}__addRule(){this.value=[...this.__normalizedValue,{jsonataQuery:"*"}],this.__sendChange()}__toggleValue(){this.value=!this.value,this.__sendChange()}__sendChange(){this.dispatchEvent(new ki(this.value))}}class Ai extends $t{}let Mi,Ti,Oi,Vi=e=>e;class ji extends W{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.__errorCode="invalid",this.__invalid=!1,this.__newValue=""}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-button":customElements.get("vaadin-button"),"x-skeleton":G,"iron-icon":customElements.get("iron-icon"),"x-group":be,"x-list":Ct,"x-i18n":X}}static get properties(){return C(C({},super.properties),{},{value:{type:Array},invalid:{type:Boolean},disabled:{type:Boolean}})}render(){return E(Mi||(Mi=Vi` <x-group frame> <x-list data-testid="list" .disabled="${0}" .value="${0}" @change="${0}"> ${0} <div class="flex flex-col space-y-s sm-space-y-0 sm-flex-row sm-space-x-s sm-items-start"> <vaadin-text-field data-testid="input" .placeholder="${0}" .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" @keypress="${0}" @change="${0}" @input="${0}"> </vaadin-text-field> <div class="sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="button" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="origins.add"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="origins.add_hint" class="${0}"> </x-i18n> </div> </div> </x-list> </x-group> `),this.disabled||!this._isI18nReady,this.value,this.__handleChange,this.value.map(((e,t)=>this._isI18nReady?E(Ti||(Ti=Vi` <div class="flex items-center" slot="${0}"> <img height="16" width="16" class="mr-m" src="https://www.google.com/s2/favicons?domain=${0}"> ${0} </div> `),t,e,e):E(Oi||(Oi=Vi`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this._isI18nReady?"https://foxy.io":"",this._t(`origins.${this.__errorCode}`).toString(),this.disabled||!this._isI18nReady,this.__invalid,this.__newValue,(e=>"Enter"===e.key&&this.__submit()),(e=>e.stopPropagation()),this.__handleInput,!this._isI18nReady||this.disabled||this.__invalid||this.value.length>=10,this.__submit,this.ns,this.lang,this.lang,this.ns,ue({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":this.value.length<10,"text-primary":this.value.length>=10,hidden:0===this.value.length}))}__sendChange(){this.dispatchEvent(new Ai(this.value))}__handleInput(e){this.__newValue=e.target.value;try{const e=new URL(this.__newValue),t="https:"===e.protocol,s="localhost"===e.hostname;this.__invalid=!s&&!t,this.__errorCode="https_only"}catch(e){this.__invalid=this.__newValue.length>0,this.__errorCode="invalid"}this.requestUpdate()}__submit(){this.__newValue.length>0&&(this.value=[...this.value,new URL(this.__newValue).origin],this.__newValue="",this.__invalid=!1,this.__sendChange()),this.requestUpdate()}__handleChange(e){this.value=e.detail,this.__sendChange()}}const Fi=ae.assign({error:(e,t)=>t.data.type}),Ri=ae.assign({oldResource:(e,t)=>t.data.resource,newResource:(e,t)=>t.data.resource,store:(e,t)=>t.data.store}),Pi=ae.assign({oldResource:e=>e.newResource}),Ni=ae.assign({invalid:[],newResource:({oldResource:e})=>e}),Bi=ae.assign({invalid:[],newResource:e=>({allowedOrigins:[],subscriptions:{allowFrequencyModification:[],allowNextDateModification:!1},jwtSharedSecret:wt(72,(()=>bt(35).toString(36))).join(""),sessionLifespanInMinutes:40320,sso:!1,date_created:(new Date).toISOString(),date_modified:(new Date).toISOString(),_links:{"fx:store":e.store._links.self,curies:e.store._links.curies,self:e.store._links["fx:customer_portal_settings"]}})}),zi=ae.assign({newResource:null}),qi=ae.assign({error:"setup_needed"}),Yi=ae.assign({newResource:({newResource:e},t)=>{const s=t.value;return C(C({},e),{},{allowedOrigins:s})}}),Li=ae.assign({newResource:({newResource:e},t)=>{const s=t.value;return C(C({},e),{},{subscriptions:C(C({},e.subscriptions),{},{allowFrequencyModification:s})})}}),Wi=ae.assign({newResource:({newResource:e},t)=>{const s=t.value;return C(C({},e),{},{subscriptions:C(C({},e.subscriptions),{},{allowNextDateModification:s})})}}),Hi=ae.assign({invalid:(e,t)=>{const s="sessionLifespanInMinutes",i=t.invalid;return e.invalid.filter((e=>e!==s)).concat(...i?[s]:[])},newResource:({newResource:e},t)=>{const s=t.value;return C(C({},e),{},{sessionLifespanInMinutes:s})}}),Ui=ae.assign({invalid:(e,t)=>{const s="jwtSharedSecret",i=t.invalid;return e.invalid.filter((e=>e!==s)).concat(...i?[s]:[])},newResource:({newResource:e},t)=>{const s=t.value;return C(C({},e),{},{jwtSharedSecret:s})}}),Xi=ae.assign({oldResource:null,newResource:null,store:null,error:null,href:(e,t)=>t.data}),Ki={SET_SECRET:{target:"#cps.idle",actions:"setSecret"},SET_ORIGINS:{target:"#cps.idle",actions:"setOrigins"},SET_SESSION:{target:"#cps.idle",actions:"setSession"},SET_FREQUENCY_MODIFICATION:{target:"#cps.idle",actions:"setFrequencyModification"},SET_NEXT_DATE_MODIFICATION:{target:"#cps.idle",actions:"setNextDateModification"}},Qi={initial:"unknown",states:{unknown:{always:[{target:"invalid",cond:"isInvalid"},{target:"valid"}]},invalid:{},valid:{}}},Gi=A({id:"cps",initial:"unknown",context:{oldResource:null,newResource:null,invalid:[],store:null,error:null,href:null},states:{unknown:{always:[{target:"error",cond:"isSetupNeeded",actions:"requireSetup"},{target:"idle",cond:"isLoaded"},{target:"busy"}]},error:{on:{RELOAD:{target:"busy.loading"}}},busy:{initial:"loading",states:{loading:{invoke:{src:"load",onDone:{target:"#cps.idle.clean",actions:"handleLoadingSuccess"},onError:{target:"#cps.error",actions:"handleError"}}},saving:{invoke:{src:"save",onDone:{target:"#cps.idle.clean",actions:"handleSavingSuccess"},onError:{target:"#cps.error",actions:"handleError"}}}}},idle:{initial:"unknown",on:{DISABLE:{target:"#cps.idle",actions:"remove"},ENABLE:{target:"#cps.idle",actions:"create"},RESET:{target:"#cps.idle",actions:"reset"}},states:{unknown:{always:[{target:"clean",cond:"isClean"},{target:"dirty"}]},clean:{initial:"unknown",states:{unknown:{always:[{target:"enabled",cond:"isEnabled"},{target:"disabled"}]},enabled:{on:Ki},disabled:{}}},dirty:{on:{SAVE:"#cps.busy.saving"},initial:"unknown",states:{unknown:{always:[{target:"created",cond:"isCreated"},{target:"deleted",cond:"isDeleted"},{target:"updated"}]},created:C({on:Ki},Qi),updated:C({on:Ki},Qi),deleted:{}}}}}},on:{SET_HREF:{actions:"setHref",target:"unknown"}}},{guards:{isClean:e=>M(e.newResource,e.oldResource),isLoaded:e=>null!==e.store,isInvalid:e=>e.invalid.length>0,isEnabled:e=>null!==e.oldResource,isCreated:e=>null===e.oldResource&&null!==e.newResource,isDeleted:e=>null!==e.oldResource&&null===e.newResource,isSetupNeeded:e=>null===e.href},actions:{setFrequencyModification:Li,setNextDateModification:Wi,setOrigins:Yi,setSession:Hi,setSecret:Ui,setHref:Xi,handleLoadingSuccess:Ri,handleSavingSuccess:Pi,handleError:Fi,create:Bi,reset:Ni,remove:zi,requireSetup:qi}});let Ji,Zi,ea,ta,sa=e=>e;function ia(e){if(!e.ok)throw new Y(401===e.status?"unauthorized":"unknown")}class aa extends CustomEvent{constructor(){super("ready")}}class na extends CustomEvent{constructor(){super("update")}}class ra extends W{constructor(){super("customer-portal-settings"),this.rel="customer_portal_settings",this.__machine=Gi.withConfig({services:{load:()=>this.__load(),save:()=>this.__save()}}),this.__service=De(this.__machine).onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}static get scopedElements(){return{"iron-icon":customElements.get("iron-icon"),"vaadin-button":customElements.get("vaadin-button"),"x-frequency-modification":As,"x-next-date-modification":Ii,"x-session-duration":Jt,"x-session-secret":ss,"x-loading-screen":Mt,"x-error-screen":q,"x-origins-list":ji,"x-skeleton":G,"x-section":Nt,"x-switch":Yt,"x-i18n":X,"x-page":jt}}static get properties(){return C(C({},super.properties),{},{href:{type:String,noAccessor:!0}})}get href(){return this.__service.state.context.href}set href(e){this.__service.send({type:"SET_HREF",data:e})}render(){var e,t,s,i,a;if(this.__service.state.matches("error"))return E(Ji||(Ji=sa` <x-error-screen data-testid="error" lang="${0}" type="${0}" reload @reload="${0}"> </x-error-screen> `),this.lang,this.__service.state.context.error,this.__reload);const{newResource:n}=this.__service.state.context,r=this.__service.state.matches("idle.dirty.created"),o=this.__service.state.matches("idle.dirty.deleted"),l=this.__service.state.matches("idle.dirty.updated"),d=this.__service.state.matches("idle.clean.enabled"),h=this.__service.state.matches("idle.dirty.updated.invalid")||this.__service.state.matches("idle.dirty.created.invalid");return E(Zi||(Zi=sa` <x-page class="relative"> <x-switch slot="title" data-testid="switch" .disabled="${0}" .checked="${0}" @change="${0}"> <x-i18n key="title" class="text-xxl" .ns="${0}" .lang="${0}"> <sup class="text-tertiary"> <x-i18n key="beta" .ns="${0}" .lang="${0}"> </x-i18n> </sup> </x-i18n> </x-switch> <x-i18n class="block mr-xl" slot="subtitle" key="subtitle" .ns="${0}" .lang="${0}"> </x-i18n> <x-section> <x-i18n slot="title" key="origins.title" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="subtitle" key="origins.subtitle" .ns="${0}" .lang="${0}"></x-i18n> <x-origins-list data-testid="origins" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-origins-list> </x-section> <x-frequency-modification data-testid="fmod" .lang="${0}" .ns="${0}" .value="${0}" ?disabled="${0}" @change="${0}"> </x-frequency-modification> <x-next-date-modification data-testid="ndmod" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-next-date-modification> <x-section> <x-i18n slot="title" key="advanced.title" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="subtitle" key="advanced.subtitle" .ns="${0}" .lang="${0}"> </x-i18n> <x-session-duration data-testid="session" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @change="${0}"> </x-session-duration> <x-session-secret data-testid="secret" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @change="${0}"> </x-session-secret> </x-section> ${0} </x-page> `),!this.__service.state.matches("idle")||!this._isI18nReady,d||r||l,(e=>{this.__service.send(e.detail?"ENABLE":"DISABLE")}),this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.lang,this.ns,null!==(e=null==n?void 0:n.allowedOrigins)&&void 0!==e?e:[],!n,(e=>{this.__service.send({type:"SET_ORIGINS",value:e.detail})}),this.lang,this.ns,null!==(t=null==n?void 0:n.subscriptions.allowFrequencyModification)&&void 0!==t?t:[],!n,(e=>{this.__service.send({type:"SET_FREQUENCY_MODIFICATION",value:e.detail})}),this.lang,this.ns,null!==(s=null==n?void 0:n.subscriptions.allowNextDateModification)&&void 0!==s&&s,!n,(e=>{this.__service.send({type:"SET_NEXT_DATE_MODIFICATION",value:e.detail})}),this.ns,this.lang,this.ns,this.lang,!n||!this._isI18nReady,null!==(i=null==n?void 0:n.sessionLifespanInMinutes)&&void 0!==i?i:1,this.lang,this.ns,(({detail:e})=>{this.__service.send(C({type:"SET_SESSION"},e))}),!n||!this._isI18nReady,null!==(a=null==n?void 0:n.jwtSharedSecret)&&void 0!==a?a:"",this.lang,this.ns,(({detail:e})=>{this.__service.send(C({type:"SET_SECRET"},e))}),this.__service.state.matches("idle.dirty")?E(ea||(ea=sa` <div class="sticky flex justify-between rounded-t-l rounded-b-l shadow-m -mx-s p-s bg-contrast" style="bottom:var(--lumo-space-m)"> <vaadin-button data-testid="save" theme="primary ${0}" .disabled="${0}" @click="${0}"> <x-i18n lang="${0}" ns="${0}" key="save_${0}"> </x-i18n> </vaadin-button> <vaadin-button style="--lumo-contrast:var(--lumo-base-color)" data-testid="reset" theme="contrast tertiary" @click="${0}"> <x-i18n lang="${0}" key="undo_all"></x-i18n> <iron-icon icon="lumo:reload" slot="suffix"></iron-icon> </vaadin-button> </div> `),o?"error":"success",h,(()=>this.__service.send("SAVE")),this.lang,this.ns,r?"create":o?"delete":"update",(()=>this.__service.send("RESET")),this.lang):this.__service.state.matches("busy")?E(ta||(ta=sa`<x-loading-screen data-testid="loading" class="mt-0"></x-loading-screen>`)):"")}async __reload(){this.__service.stop(),this.__service.onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}async __load(){if(null===this.href)throw new Y("setup_needed");try{await this.updateComplete;const e=await Wt.emit({source:this,init:[this.href]});let t,s;if(e.status.toString().startsWith("4")){t=null;const e=await Wt.emit({source:this,init:["/"]});ia(e);const i=(await e.json())._links["fx:store"].href,a=await Wt.emit({source:this,init:[i]});ia(a),s=await a.json()}else{ia(e),t=await e.json();const i=t._links["fx:store"].href,a=await Wt.emit({source:this,init:[i]});ia(a),s=await a.json()}return{store:s,resource:t}}catch(e){if(e instanceof Y)throw e;if(e instanceof Lt)throw new Y("setup_needed");throw new Y("unknown")}finally{await this.updateComplete,this.dispatchEvent(new aa)}}async __save(){try{const e=this.__service.state.context,t=ht(e.newResource,5),s=t?"PUT":"DELETE";t&&(delete t._links,delete t.date_created,delete t.date_modified);const i={method:s,body:t?JSON.stringify(t):void 0};ia(await Wt.emit({source:this,init:[this.href,i]}))}catch(e){if(e instanceof Y)throw e;if(e instanceof Lt)throw new Y("setup_needed");throw new Y("unknown")}finally{await this.updateComplete,this.dispatchEvent(new na)}}}customElements.define("foxy-customer-portal-settings",ra);export{ra as CustomerPortalSettings};
|
|
972
|
+
`}static get is(){return"vaadin-date-picker"}static get version(){return"4.4.1"}static get properties(){return{clearButtonVisible:{type:Boolean,value:!1},disabled:{type:Boolean,value:!1,reflectToAttribute:!0},errorMessage:String,placeholder:String,helperText:{type:String,value:""},readonly:{type:Boolean,value:!1,reflectToAttribute:!0},invalid:{type:Boolean,reflectToAttribute:!0,notify:!0,value:!1},_userInputValue:String}}static get observers(){return["_userInputValueChanged(_userInputValue)","_setClearButtonLabel(i18n.clear)"]}ready(){super.ready(),re(this,(()=>this._inputElement.validate=()=>{})),this._inputElement.addEventListener("change",(e=>{""!==this._inputElement.value||e.__fromClearButton||(this.__dispatchChange=!0)}))}_onVaadinOverlayClose(e){this._openedWithFocusRing&&this.hasAttribute("focused")?this.focusElement.setAttribute("focus-ring",""):this.hasAttribute("focused")||this.focusElement.blur(),e.detail.sourceEvent&&-1!==e.detail.sourceEvent.composedPath().indexOf(this)&&e.preventDefault()}_toggle(e){e.stopPropagation(),this[this._overlayInitialized&&this.$.overlay.opened?"close":"open"]()}_input(){return this.$.input}set _inputValue(e){this._inputElement.value=e}get _inputValue(){return this._inputElement.value}_getAriaExpanded(e){return Boolean(e).toString()}get focusElement(){return this._input()||this}_setClearButtonLabel(e){this._inputElement.shadowRoot.querySelector('[part="clear-button"]').setAttribute("aria-label",e)}}customElements.define(Js.is,Js);class Zs extends $t{}let ei,ti,si,ii,ai=e=>e;class ni extends W{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.__startValue="",this.__endValue=""}static get scopedElements(){return{"vaadin-date-picker":Js,"vaadin-button":N,"x-skeleton":G,"iron-icon":customElements.get("iron-icon"),"x-i18n":X,"x-list":Ct}}static get properties(){return C(C({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const e=this.value.length>=20||this.disabled||!this._isI18nReady;return E(ei||(ei=ai` <x-list data-testid="list" .value="${0}" .disabled="${0}" @change="${0}"> ${0} <div class="sm-flex sm-items-end"> <div class="grid grid-cols-2 gap-s"> <vaadin-date-picker data-testid="start" .label="${0}" .value="${0}" .disabled="${0}" .placeholder="${0}" @change="${0}"> </vaadin-date-picker> <vaadin-date-picker data-testid="end" .min="${0}" .label="${0}" .value="${0}" .disabled="${0}" .placeholder="${0}" clear-button-visible @change="${0}"> </vaadin-date-picker> </div> <vaadin-button .disabled="${0}" data-testid="submit" class="w-full mt-s sm-mt-0 sm-w-auto sm-ml-s" @click="${0}"> <x-i18n .lang="${0}" .key="ndmod.add_${0}" .ns="${0}"> </x-i18n> <iron-icon icon="icons:add" slot="suffix"></iron-icon> </vaadin-button> </div> ${0} </x-list> `),this.value,this.disabled||!this._isI18nReady,this.__handleListChange,this.value.map(((e,t)=>this._isI18nReady?E(ti||(ti=ai`<span slot="${0}" class="truncate">${0}</span>`),t,Ms(e,this.lang)):E(si||(si=ai`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this._t("ndmod.range_start").toString(),this.__startValue,e,this._isI18nReady?this._t("ndmod.select").toString():"",this.__handleStartValueChange,this.__startValue,this._t("ndmod.range_end").toString(),this.__endValue,e||!this.__startValue,this._isI18nReady?this._t("ndmod.select").toString():"",this.__handleEndValueChange,e||!this.__startValue,this.__submit,this.lang,this.__endValue?"range":"single",this.ns,this.value.length>0?E(ii||(ii=ai` <x-i18n .ns="${0}" .lang="${0}" key="ndmod.add_range_hint" class="${0}"> </x-i18n> `),this.ns,this.lang,ue({"block text-xs mt-xs text-center sm-text-left":!0,"text-tertiary":this.value.length<20,"text-primary":this.value.length>=20})):"")}updated(){const e=this.constructor.getScopedTagName("vaadin-date-picker"),t=this.shadowRoot.querySelectorAll(e);Array.from(t).forEach((e=>e.validate()))}__handleStartValueChange(e){e.stopPropagation(),this.__startValue=e.target.value;const t=$e(this.__endValue),s=$e(this.__startValue);t&&t.getTime()<s.getTime()&&(this.__endValue=""),this.requestUpdate()}__handleEndValueChange(e){e.stopPropagation(),this.__endValue=e.target.value,this.requestUpdate()}__submit(){this.__startValue&&this.__endValue?this.value=[...this.value,[this.__startValue,this.__endValue].join("..")]:this.value=[...this.value,this.__startValue],this.__sendChange(),this.__startValue="",this.__endValue=""}__handleListChange(e){this.value=e.detail,this.__sendChange()}__sendChange(){this.dispatchEvent(new Zs(this.value))}}class ri extends CustomEvent{constructor(e){super("change",{detail:e})}}let oi,li,di=e=>e;class hi extends W{constructor(){super("customer-portal-settings"),this.disabled=!1,this.type="min",this.__items=["none","custom"]}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"x-frequency-input":os,"x-choice":Z,"x-group":be,"x-i18n":X}}static get properties(){return C(C({},super.properties),{},{disabled:{type:Boolean},value:{type:String},type:{type:String}})}render(){return E(oi||(oi=di` <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="${0}"> </x-i18n> <x-choice data-testid="choice" .disabled="${0}" .value="${0}" .items="${0}" @change="${0}"> <x-i18n slot="none-label" .ns="${0}" .lang="${0}" key="ndmod.none"></x-i18n> <x-i18n slot="custom-label" .ns="${0}" .lang="${0}" key="ndmod.custom"></x-i18n> ${0} </x-choice> </x-group> `),this.ns,this.lang,`ndmod.${this.type}`,this.disabled,this.__choice,this.__items,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.__choice===this.__items[1]?E(li||(li=di` <div slot="${0}" class="space-y-s"> <x-frequency-input data-testid="input" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-input> <p class="text-s text-tertiary leading-s">${0}</p> </div> `),this.__items[1],this.value,this.disabled,this.__handleNewValueChange,this.__hint):"")}get __choice(){return this.__items[this.value?1:0]}get __hint(){var e;if(!this._isI18nReady)return"";const{count:t,units:s}=xe(null!==(e=this.value)&&void 0!==e?e:"");return this._t(`ndmod.${this.type}Hint`,{duration:this._t("duration",{count:t,units:this._t(null!=s?s:"",{count:t})})})}__handleNewValueChange(e){this.value=e.detail,this.__sendChange()}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?void 0:"1w",this.__sendChange()}__sendChange(){this.dispatchEvent(new ri(this.value))}}class ui extends CustomEvent{constructor(e){super("change",{detail:e})}}class ci extends CustomEvent{constructor(){super("remove")}}let pi,_i,mi,vi,gi,fi,yi,bi,xi,wi=e=>e;class $i extends W{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value={jsonataQuery:"*"},this.open=!1}static get scopedElements(){return{"x-disallowed-dates":ni,"x-jsonata-input":ys,"x-offset-input":hi,"x-allowed-days":Rs,"iron-icon":customElements.get("iron-icon"),"x-warning":ke,"x-group":be,"x-i18n":X}}static get properties(){return C(C({},super.properties),{},{disabled:{type:Boolean},value:{type:Object},open:{type:Boolean}})}render(){const{min:e,max:t,allowedDays:s,jsonataQuery:i,disallowedDates:a}=this.value,n=e||t,r=s&&s.days.length>0,o=a&&a.length>0,l=this.open?"":"rounded-b-l";return E(pi||(pi=wi` <x-group frame> <details data-testid="details" class="${0}" ?open="${0}" @toggle="${0}"> <summary class="${0} cursor-pointer relative leading-s rounded-t-l focus-outline-none focus-shadow-outline"> <div class="p-m mr-xl text-m text-header font-medium space-y-s"> <div> <x-i18n .ns="${0}" .lang="${0}" key="${0}"> ${0} </x-i18n> </div> ${0} </div> <button data-testid="remove" .disabled="${0}" class="flex items-center justify-center rounded absolute top-0 right-0 text-tertiary hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" style="width:54px;height:54px" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </summary> <article class="space-y-l"> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.match"> </x-i18n> <x-jsonata-input data-testid="jsonata" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-jsonata-input> </x-group> <div class="flex flex-col md-flex-row"> <div class="mb-l md-mb-0 md-w-1-2 md-border-r md-border-contrast-10"> <x-offset-input data-testid="min" type="min" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-offset-input> </div> <div class="md-w-1-2"> <x-offset-input data-testid="max" type="max" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-offset-input> </div> </div> ${0} <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.allowed"> </x-i18n> <x-allowed-days data-testid="allowed" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-allowed-days> </x-group> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.excluded"> </x-i18n> <x-disallowed-dates data-testid="disallowed" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-disallowed-dates> </x-group> </article> </details> </x-group> `),ue({"font-lumo":!0,"pointer-events-none":!this._isI18nReady}),this.open,(()=>this.open=!this.open),l,this.ns,this.lang,`ndmod.${"*"===i?"all":"some"}Title`,"*"!==i?this.__renderJSONataSummary(i):"",n||r||o?E(_i||(_i=wi` <div> ${0} </div> `),se(n&&this.__renderMinMaxSummary(e,t),r&&this.__renderAllowedSummary(s),o&&this.__renderDisallowedSummary(a))):"",this.disabled||!this._isI18nReady,is((()=>this.dispatchEvent(new ci))),this.ns,this.lang,this.ns,this.lang,i,this.disabled||!this._isI18nReady,(e=>{this.value=C(C({},this.value),{},{jsonataQuery:e.detail}),this.__sendUpdate()}),this.lang,e,this.disabled||!this._isI18nReady,(e=>{this.value=C(C({},this.value),{},{min:e.detail}),this.__sendUpdate()}),this.lang,t,this.disabled||!this._isI18nReady,(e=>{this.value=C(C({},this.value),{},{max:e.detail}),this.__sendUpdate()}),-1===this.__compareDurations(e,t)?E(mi||(mi=wi` <x-warning class="mx-m" data-testid="warning"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.minWarning"> </x-i18n> </x-warning> `),this.ns,this.lang):"",this.ns,this.lang,this.lang,s,this.disabled||!this._isI18nReady,(e=>{this.value=C(C({},this.value),{},{allowedDays:e.detail}),this.__sendUpdate()}),this.ns,this.lang,this.ns,this.lang,null!=a?a:[],this.disabled||!this._isI18nReady,(e=>{this.value=C(C({},this.value),{},{disallowedDates:e.detail}),this.__sendUpdate()}))}__sendUpdate(){this.dispatchEvent(new ui(this.value))}__getEstimatedDaysFrom(e){const{count:t,units:s}=xe(e);return t*{y:365,m:31,w:7,d:1}[s]}__compareDurations(e,t){return e===t?0:e&&t?this.__getEstimatedDaysFrom(e)<this.__getEstimatedDaysFrom(t)?1:-1:1}__renderJSONataSummary(e){return E(vi||(vi=wi` <code class="inline-block rounded bg-success-10 text-success px-xs text-xs leading-s"> ${0} </code> `),e)}__renderMinMaxContent(e){if(e){const{count:t,units:s}=e;return E(gi||(gi=wi` ${0} <x-i18n .ns="${0}" .lang="${0}" key="${0}" .opts="${0}"></x-i18n> `),t,this.ns,this.lang,s,{count:t})}return E(fi||(fi=wi`<x-i18n .ns="${0}" .lang="${0}" key="ndmod.any"></x-i18n>`),this.ns,this.lang)}__renderMinMaxSummary(e,t){return E(yi||(yi=wi` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.range"> <span>:</span> <span class="text-secondary"> ${0} — ${0} </span> </x-i18n> </div> `),this.ns,this.lang,this.__renderMinMaxContent(e?xe(e):void 0),this.__renderMinMaxContent(t?xe(t):void 0))}__renderAllowedSummary({type:e,days:t}){return E(bi||(bi=wi` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.allowed"> <span>:</span> <span class="text-secondary"> ${0} ${0} </span> </x-i18n> </div> `),this.ns,this.lang,"month"===e?t.join(", "):"","day"===e?t.map((e=>ie(e,this.lang,"short"))).join(", "):"")}__renderDisallowedSummary(e){return E(xi||(xi=wi` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.excluded"> <span>:</span> <span class="text-secondary"> ${0} </span> </x-i18n> </div> `),this.ns,this.lang,e.map((e=>Ms(e,this.lang))).join("; "))}}class ki extends CustomEvent{constructor(e){super("change",{detail:e})}}let Di,Si,Ci,Ei=e=>e;class Ii extends W{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=!1}static get scopedElements(){return{"x-next-date-modification-rule":$i,"vaadin-button":customElements.get("vaadin-button"),"x-section":Nt,"iron-icon":customElements.get("iron-icon"),"x-switch":Yt,"x-i18n":X}}static get properties(){return C(C({},super.properties),{},{disabled:{type:Boolean},value:{type:Array}})}render(){const e=!this._isI18nReady||this.disabled||!this.value||Array.isArray(this.value)&&this.value.length>=10;return E(Di||(Di=Ei` <x-section> <x-switch slot="title" class="-my-xs" data-testid="toggle" .checked="${0}" .disabled="${0}" @change="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.title" class="text-l"></x-i18n> </x-switch> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.subtitle" slot="subtitle" class="mr-xl"> </x-i18n> ${0} <div class="mt-m sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="add" theme="primary" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.add"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="ndmod.add_hint" class="${0}"> </x-i18n> </div> </x-section> `),Boolean(this.value),this.disabled||!this._isI18nReady,this.__toggleValue,this.ns,this.lang,this.ns,this.lang,this.value?E(Si||(Si=Ei` ${0} `),this.__normalizedValue.map(((e,t,s)=>E(Ci||(Ci=Ei` <x-next-date-modification-rule data-testid="rule" .disabled="${0}" .value="${0}" .lang="${0}" @remove="${0}" @change="${0}"> </x-next-date-modification-rule> `),this.disabled||!this._isI18nReady,e,this.lang,(()=>{this.value=s.filter(((e,s)=>s!==t)),this.__sendChange()}),(e=>{this.value=s.map(((s,i)=>i===t?e.detail:s)),this.__sendChange()}))))):"",e,this.__addRule,this.ns,this.lang,this.lang,this.ns,ue({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":Array.isArray(this.value)&&this.value.length<10,"text-primary":Array.isArray(this.value)&&this.value.length>=10,hidden:!Array.isArray(this.value)||0===this.value.length}))}get __normalizedValue(){return"boolean"==typeof this.value?[]:this.value}__addRule(){this.value=[...this.__normalizedValue,{jsonataQuery:"*"}],this.__sendChange()}__toggleValue(){this.value=!this.value,this.__sendChange()}__sendChange(){this.dispatchEvent(new ki(this.value))}}class Ai extends $t{}let Mi,Ti,Oi,Vi=e=>e;class ji extends W{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.__errorCode="invalid",this.__invalid=!1,this.__newValue=""}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-button":customElements.get("vaadin-button"),"x-skeleton":G,"iron-icon":customElements.get("iron-icon"),"x-group":be,"x-list":Ct,"x-i18n":X}}static get properties(){return C(C({},super.properties),{},{value:{type:Array},invalid:{type:Boolean},disabled:{type:Boolean}})}render(){return E(Mi||(Mi=Vi` <x-group frame> <x-list data-testid="list" .disabled="${0}" .value="${0}" @change="${0}"> ${0} <div class="flex flex-col sm-flex-row sm-items-start"> <vaadin-text-field data-testid="input" class="mb-s sm-mb-0 sm-mr-s" .placeholder="${0}" .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" @keypress="${0}" @change="${0}" @input="${0}"> </vaadin-text-field> <div class="sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="button" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="origins.add"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="origins.add_hint" class="${0}"> </x-i18n> </div> </div> </x-list> </x-group> `),this.disabled||!this._isI18nReady,this.value,this.__handleChange,this.value.map(((e,t)=>this._isI18nReady?E(Ti||(Ti=Vi` <div class="flex items-center" slot="${0}"> <img height="16" width="16" class="mr-m" src="https://www.google.com/s2/favicons?domain=${0}"> ${0} </div> `),t,e,e):E(Oi||(Oi=Vi`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this._isI18nReady?"https://foxy.io":"",this._t(`origins.${this.__errorCode}`).toString(),this.disabled||!this._isI18nReady,this.__invalid,this.__newValue,(e=>"Enter"===e.key&&this.__submit()),(e=>e.stopPropagation()),this.__handleInput,!this._isI18nReady||this.disabled||this.__invalid||this.value.length>=10,this.__submit,this.ns,this.lang,this.lang,this.ns,ue({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":this.value.length<10,"text-primary":this.value.length>=10,hidden:0===this.value.length}))}__sendChange(){this.dispatchEvent(new Ai(this.value))}__handleInput(e){this.__newValue=e.target.value;try{const e=new URL(this.__newValue),t="https:"===e.protocol,s="localhost"===e.hostname;this.__invalid=!s&&!t,this.__errorCode="https_only"}catch(e){this.__invalid=this.__newValue.length>0,this.__errorCode="invalid"}this.requestUpdate()}__submit(){this.__newValue.length>0&&(this.value=[...this.value,new URL(this.__newValue).origin],this.__newValue="",this.__invalid=!1,this.__sendChange()),this.requestUpdate()}__handleChange(e){this.value=e.detail,this.__sendChange()}}const Fi=ae.assign({error:(e,t)=>t.data.type}),Ri=ae.assign({oldResource:(e,t)=>t.data.resource,newResource:(e,t)=>t.data.resource,store:(e,t)=>t.data.store}),Pi=ae.assign({oldResource:e=>e.newResource}),Ni=ae.assign({invalid:[],newResource:({oldResource:e})=>e}),Bi=ae.assign({invalid:[],newResource:e=>({allowedOrigins:[],subscriptions:{allowFrequencyModification:[],allowNextDateModification:!1},jwtSharedSecret:wt(72,(()=>bt(35).toString(36))).join(""),sessionLifespanInMinutes:40320,sso:!1,date_created:(new Date).toISOString(),date_modified:(new Date).toISOString(),_links:{"fx:store":e.store._links.self,curies:e.store._links.curies,self:e.store._links["fx:customer_portal_settings"]}})}),zi=ae.assign({newResource:null}),qi=ae.assign({error:"setup_needed"}),Yi=ae.assign({newResource:({newResource:e},t)=>{const s=t.value;return C(C({},e),{},{allowedOrigins:s})}}),Li=ae.assign({newResource:({newResource:e},t)=>{const s=t.value;return C(C({},e),{},{subscriptions:C(C({},e.subscriptions),{},{allowFrequencyModification:s})})}}),Wi=ae.assign({newResource:({newResource:e},t)=>{const s=t.value;return C(C({},e),{},{subscriptions:C(C({},e.subscriptions),{},{allowNextDateModification:s})})}}),Hi=ae.assign({invalid:(e,t)=>{const s="sessionLifespanInMinutes",i=t.invalid;return e.invalid.filter((e=>e!==s)).concat(...i?[s]:[])},newResource:({newResource:e},t)=>{const s=t.value;return C(C({},e),{},{sessionLifespanInMinutes:s})}}),Ui=ae.assign({invalid:(e,t)=>{const s="jwtSharedSecret",i=t.invalid;return e.invalid.filter((e=>e!==s)).concat(...i?[s]:[])},newResource:({newResource:e},t)=>{const s=t.value;return C(C({},e),{},{jwtSharedSecret:s})}}),Xi=ae.assign({oldResource:null,newResource:null,store:null,error:null,href:(e,t)=>t.data}),Ki={SET_SECRET:{target:"#cps.idle",actions:"setSecret"},SET_ORIGINS:{target:"#cps.idle",actions:"setOrigins"},SET_SESSION:{target:"#cps.idle",actions:"setSession"},SET_FREQUENCY_MODIFICATION:{target:"#cps.idle",actions:"setFrequencyModification"},SET_NEXT_DATE_MODIFICATION:{target:"#cps.idle",actions:"setNextDateModification"}},Qi={initial:"unknown",states:{unknown:{always:[{target:"invalid",cond:"isInvalid"},{target:"valid"}]},invalid:{},valid:{}}},Gi=A({id:"cps",initial:"unknown",context:{oldResource:null,newResource:null,invalid:[],store:null,error:null,href:null},states:{unknown:{always:[{target:"error",cond:"isSetupNeeded",actions:"requireSetup"},{target:"idle",cond:"isLoaded"},{target:"busy"}]},error:{on:{RELOAD:{target:"busy.loading"}}},busy:{initial:"loading",states:{loading:{invoke:{src:"load",onDone:{target:"#cps.idle.clean",actions:"handleLoadingSuccess"},onError:{target:"#cps.error",actions:"handleError"}}},saving:{invoke:{src:"save",onDone:{target:"#cps.idle.clean",actions:"handleSavingSuccess"},onError:{target:"#cps.error",actions:"handleError"}}}}},idle:{initial:"unknown",on:{DISABLE:{target:"#cps.idle",actions:"remove"},ENABLE:{target:"#cps.idle",actions:"create"},RESET:{target:"#cps.idle",actions:"reset"}},states:{unknown:{always:[{target:"clean",cond:"isClean"},{target:"dirty"}]},clean:{initial:"unknown",states:{unknown:{always:[{target:"enabled",cond:"isEnabled"},{target:"disabled"}]},enabled:{on:Ki},disabled:{}}},dirty:{on:{SAVE:"#cps.busy.saving"},initial:"unknown",states:{unknown:{always:[{target:"created",cond:"isCreated"},{target:"deleted",cond:"isDeleted"},{target:"updated"}]},created:C({on:Ki},Qi),updated:C({on:Ki},Qi),deleted:{}}}}}},on:{SET_HREF:{actions:"setHref",target:"unknown"}}},{guards:{isClean:e=>M(e.newResource,e.oldResource),isLoaded:e=>null!==e.store,isInvalid:e=>e.invalid.length>0,isEnabled:e=>null!==e.oldResource,isCreated:e=>null===e.oldResource&&null!==e.newResource,isDeleted:e=>null!==e.oldResource&&null===e.newResource,isSetupNeeded:e=>null===e.href},actions:{setFrequencyModification:Li,setNextDateModification:Wi,setOrigins:Yi,setSession:Hi,setSecret:Ui,setHref:Xi,handleLoadingSuccess:Ri,handleSavingSuccess:Pi,handleError:Fi,create:Bi,reset:Ni,remove:zi,requireSetup:qi}});let Ji,Zi,ea,ta,sa=e=>e;function ia(e){if(!e.ok)throw new Y(401===e.status?"unauthorized":"unknown")}class aa extends CustomEvent{constructor(){super("ready")}}class na extends CustomEvent{constructor(){super("update")}}class ra extends W{constructor(){super("customer-portal-settings"),this.rel="customer_portal_settings",this.__machine=Gi.withConfig({services:{load:()=>this.__load(),save:()=>this.__save()}}),this.__service=De(this.__machine).onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}static get scopedElements(){return{"iron-icon":customElements.get("iron-icon"),"vaadin-button":customElements.get("vaadin-button"),"x-frequency-modification":As,"x-next-date-modification":Ii,"x-session-duration":Jt,"x-session-secret":ss,"x-loading-screen":Mt,"x-error-screen":q,"x-origins-list":ji,"x-skeleton":G,"x-section":Nt,"x-switch":Yt,"x-i18n":X,"x-page":jt}}static get properties(){return C(C({},super.properties),{},{href:{type:String,noAccessor:!0}})}get href(){return this.__service.state.context.href}set href(e){this.__service.send({type:"SET_HREF",data:e})}render(){var e,t,s,i,a;if(this.__service.state.matches("error"))return E(Ji||(Ji=sa` <x-error-screen data-testid="error" lang="${0}" type="${0}" reload @reload="${0}"> </x-error-screen> `),this.lang,this.__service.state.context.error,this.__reload);const{newResource:n}=this.__service.state.context,r=this.__service.state.matches("idle.dirty.created"),o=this.__service.state.matches("idle.dirty.deleted"),l=this.__service.state.matches("idle.dirty.updated"),d=this.__service.state.matches("idle.clean.enabled"),h=this.__service.state.matches("idle.dirty.updated.invalid")||this.__service.state.matches("idle.dirty.created.invalid");return E(Zi||(Zi=sa` <x-page class="relative"> <x-switch slot="title" data-testid="switch" .disabled="${0}" .checked="${0}" @change="${0}"> <x-i18n key="title" class="text-xxl" .ns="${0}" .lang="${0}"> <sup class="text-tertiary"> <x-i18n key="beta" .ns="${0}" .lang="${0}"> </x-i18n> </sup> </x-i18n> </x-switch> <x-i18n class="block mr-xl" slot="subtitle" key="subtitle" .ns="${0}" .lang="${0}"> </x-i18n> <x-section> <x-i18n slot="title" key="origins.title" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="subtitle" key="origins.subtitle" .ns="${0}" .lang="${0}"></x-i18n> <x-origins-list data-testid="origins" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-origins-list> </x-section> <x-frequency-modification data-testid="fmod" .lang="${0}" .ns="${0}" .value="${0}" ?disabled="${0}" @change="${0}"> </x-frequency-modification> <x-next-date-modification data-testid="ndmod" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-next-date-modification> <x-section> <x-i18n slot="title" key="advanced.title" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="subtitle" key="advanced.subtitle" .ns="${0}" .lang="${0}"> </x-i18n> <x-session-duration data-testid="session" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @change="${0}"> </x-session-duration> <x-session-secret data-testid="secret" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @change="${0}"> </x-session-secret> </x-section> ${0} </x-page> `),!this.__service.state.matches("idle")||!this._isI18nReady,d||r||l,(e=>{this.__service.send(e.detail?"ENABLE":"DISABLE")}),this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.lang,this.ns,null!==(e=null==n?void 0:n.allowedOrigins)&&void 0!==e?e:[],!n,(e=>{this.__service.send({type:"SET_ORIGINS",value:e.detail})}),this.lang,this.ns,null!==(t=null==n?void 0:n.subscriptions.allowFrequencyModification)&&void 0!==t?t:[],!n,(e=>{this.__service.send({type:"SET_FREQUENCY_MODIFICATION",value:e.detail})}),this.lang,this.ns,null!==(s=null==n?void 0:n.subscriptions.allowNextDateModification)&&void 0!==s&&s,!n,(e=>{this.__service.send({type:"SET_NEXT_DATE_MODIFICATION",value:e.detail})}),this.ns,this.lang,this.ns,this.lang,!n||!this._isI18nReady,null!==(i=null==n?void 0:n.sessionLifespanInMinutes)&&void 0!==i?i:1,this.lang,this.ns,(({detail:e})=>{this.__service.send(C({type:"SET_SESSION"},e))}),!n||!this._isI18nReady,null!==(a=null==n?void 0:n.jwtSharedSecret)&&void 0!==a?a:"",this.lang,this.ns,(({detail:e})=>{this.__service.send(C({type:"SET_SECRET"},e))}),this.__service.state.matches("idle.dirty")?E(ea||(ea=sa` <div class="sticky flex justify-between rounded-t-l rounded-b-l shadow-m -mx-s p-s bg-contrast" style="bottom:var(--lumo-space-m)"> <vaadin-button data-testid="save" theme="primary ${0}" .disabled="${0}" @click="${0}"> <x-i18n lang="${0}" ns="${0}" key="save_${0}"> </x-i18n> </vaadin-button> <vaadin-button style="--lumo-contrast:var(--lumo-base-color)" data-testid="reset" theme="contrast tertiary" @click="${0}"> <x-i18n lang="${0}" key="undo_all"></x-i18n> <iron-icon icon="lumo:reload" slot="suffix"></iron-icon> </vaadin-button> </div> `),o?"error":"success",h,(()=>this.__service.send("SAVE")),this.lang,this.ns,r?"create":o?"delete":"update",(()=>this.__service.send("RESET")),this.lang):this.__service.state.matches("busy")?E(ta||(ta=sa`<x-loading-screen data-testid="loading" class="mt-0"></x-loading-screen>`)):"")}async __reload(){this.__service.stop(),this.__service.onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}async __load(){if(null===this.href)throw new Y("setup_needed");try{await this.updateComplete;const e=await Wt.emit({source:this,init:[this.href]});let t,s;if(e.status.toString().startsWith("4")){t=null;const e=await Wt.emit({source:this,init:["/"]});ia(e);const i=(await e.json())._links["fx:store"].href,a=await Wt.emit({source:this,init:[i]});ia(a),s=await a.json()}else{ia(e),t=await e.json();const i=t._links["fx:store"].href,a=await Wt.emit({source:this,init:[i]});ia(a),s=await a.json()}return{store:s,resource:t}}catch(e){if(e instanceof Y)throw e;if(e instanceof Lt)throw new Y("setup_needed");throw new Y("unknown")}finally{await this.updateComplete,this.dispatchEvent(new aa)}}async __save(){try{const e=this.__service.state.context,t=ht(e.newResource,5),s=t?"PUT":"DELETE";t&&(delete t._links,delete t.date_created,delete t.date_modified);const i={method:s,body:t?JSON.stringify(t):void 0};ia(await Wt.emit({source:this,init:[this.href,i]}))}catch(e){if(e instanceof Y)throw e;if(e instanceof Lt)throw new Y("setup_needed");throw new Y("unknown")}finally{await this.updateComplete,this.dispatchEvent(new na)}}}customElements.define("foxy-customer-portal-settings",ra);export{ra as CustomerPortalSettings};
|