materio-d9/web/themes/custom/materiotheme/assets/dist/module-pricing.bundle.js

1 line
8.2 KiB
JavaScript
Raw Normal View History

2021-06-01 22:46:15 +02:00
(self.webpackChunkmaterio_com=self.webpackChunkmaterio_com||[]).push([[665],{489:e=>{e.exports=e=>{if(!e)throw new Error("Password is empty.");const t="(?=.*[!@#$%^&*])";let s={id:null,value:null,length:null,contains:[]},r=[];new RegExp("^(?=.*[a-z])").test(e)&&(r=[...r,{message:"lowercase"}]),new RegExp("^(?=.*[A-Z])").test(e)&&(r=[...r,{message:"uppercase"}]),new RegExp(`^${t}`).test(e)&&(r=[...r,{message:"symbol"}]),new RegExp("^(?=.*[0-9])").test(e)&&(r=[...r,{message:"number"}]);const o=new RegExp(`^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])${t}(?=.{8,})`),i=new RegExp(`^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9]))|((?=.*[A-Z])${t})|((?=.*[a-z])${t})|((?=.*[0-9])${t}))(?=.{6,})`);return s=o.test(e)?{id:2,value:"Strong"}:i.test(e)?{id:1,value:"Medium"}:{id:0,value:"Weak"},s.length=e.length,s.contains=r,s}},2516:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>I});var r=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{attrs:{id:"pricing"}},[e.products.length?e._l(e.products,(function(e){return s("Product",{key:e.uuid,attrs:{product:e}})})):s("div",{staticClass:"loading"},[s("span",[e._v(e._s(e.$t("default.Loading…")))])])],2)};r._withStripped=!0;var o=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("article",{staticClass:"product"},[s("header",[s("h1",{domProps:{innerHTML:e._s(e.product.title)}})]),e._v(" "),s("section",{staticClass:"content"},[s("div",{staticClass:"description",domProps:{innerHTML:e._s(e.product.body)}})]),e._v(" "),e.isAdherent?e._e():s("aside",e._l(e.product.variations,(function(t){return s("div",{key:t.id,staticClass:"variation"},[s("div",{staticClass:"variation-description",domProps:{innerHTML:e._s(t.description)}}),e._v(" "),s("button",{attrs:{type:"button",name:"addtocart"},on:{click:function(s){return s.stopPropagation(),e.checkaddtocart(s,t.id)}}},[e._v("\n "+e._s(e.$t("default.Add to cart"))+"\n ")])])})),0),e._v(" "),e.showLoginModal?s("Modal",{attrs:{styles:{width:"500px",height:"350px"}},on:{close:e.closeModal}},[s("section",{attrs:{id:"pricing-modal-login-register"}},[s("h2",[e._v(e._s(e.$t("materio.Please login or create a new account")))]),e._v(" "),s("LoginRegister",{attrs:{callbackargs:e.showLoginModal},on:{onLogedIn:e.onLogedIn,onRegistered:e.onRegistered}})],1)]):e._e()],1)};o._withStripped=!0;var i=s(2141),n=s(4408),a=s(629),c=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"overlay",on:{click:function(t){return t.target!==t.currentTarget?null:e.close(t)}}},[s("div",{staticClass:"modal",style:e.styles},[e._t("default")],2)])};c._withStripped=!0;const l={name:"",props:{styles:{default:function(){return{width:"500px",height:"350px"}},type:Object}},data:()=>({}),methods:{close(){this.$emit("close")}}};var d=s(1900),u=(0,d.Z)(l,c,[],!1,null,"b98ce164",null);u.options.__file="web/themes/custom/materiotheme/vuejs/components/Helper/Modal.vue";const h=u.exports;var m=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{attrs:{id:"login-register"}},[s("section",{staticClass:"login"},[s("h3",[e._v(e._s(e.$t("default.Login"))+" ")]),e._v(" "),s("LoginForm",{on:{onLogedIn:e.onLogedIn}})],1),e._v(" "),s("section",{staticClass:"register"},[s("h3",[e._v(e._s(e.$t("default.Register a new account")))]),e._v(" "),s("RegisterForm",{on:{onRegistered:e.onRegistered}})],1)])};m._withStripped=!0;var g=s(1094),p=s.n(g),f=s(9032);const _={name:"LoginForm",data:()=>({form:null,mail:null,password:null}),computed:{...(0,a.rn)({loginMessage:e=>e.User.loginMessage})},methods:{...(0,a.nv)({userLogin:"User/userLogin"}),getLoginForm(){f.MA.get("/materio_user/login_form").then((({data:e})=>{this.form=p().compile(e.rendered),this.$options.staticRenderFns=[],this._staticTrees=[],this.form.staticRenderFns.map((e=>this.$options.staticRenderFns.push(e)))})).catch((e=>{console.warn("Issue with getLoginForm",e)}))},login(){this.userLogin({mail:this.mail,pass:this.password}).then((()=>{this.$emit("onLogedIn")})).catch((e=>{console.warn("Issue with login from login component",e),Promise.re