1import{_ as k,m as U,k as L,s as g,r as h,o as n,c as d,a as p,w as _,b as a,t as r,F as l,j as R,e as u,d as i,n as C,l as D,g as f,h as b,T as B}from"./index-Bb2ZKNhF.js";import{B as M}from"./Breadcrumbs-Crdycub-.js";import{C as F}from"./Carousel-DZCUhIlv.js";import{N as H,s as A}from"./stripHtml-B_hXDP7k.js";import{T as V}from"./TextInput-NnywQG9L.js";import{T as q}from"./TextAreaInput-D70m9tCV.js";import{f as $}from"./formater-DTCZAuwV.js";import{A as O}from"./Alert-DotJyCd4.js";import{u as w}from"./index-C8BGHItI.js";import"./ImageC-DgPCtrSk.js";const Y={name:"ProductComponent",data(){return{navName:""}},components:{Alert:O,Breadcrumbs:M,Carousel:F,NumberInputWithButtons:H,TextInput:V,TextAreaInput:q},computed:{...U({language:t=>t.language,products:t=>t.products,navTranslations:t=>t.app.navTranslations,publicURL:t=>t.app.API_PUBLIC_URL,currency:t=>t.app.currencySymbol,isLoggedIn:t=>t.user.isLoggedIn}),isSNM(){return!!["snm","devsnm"].includes("hlmd")},jsonld(){if(typeof this.product>"u")return{};const t=[];this.product.images.forEach(c=>{t.push(`${this.publicURL}/600/${c}`)});let e="InStock";return parseInt(this.product.stock,10)<=0&&(e="OutOfStock"),{"@context":"https://schema.org/","@type":"Product",name:this.product.name,image:t,description:A(this.product.description_long),offers:{"@type":"Offer",url:window.location,priceCurrency:this.currency,price:(parseInt(this.product.price,10)/100).toFixed(2),itemCondition:"https://schema.org/NewCondition",availability:`https://schema.org/${e}`}}},names:{get(){return this.$store.state.products.form.names},set({index:t,value:e}){this.$store.dispatch("products/setName",{index:t,value:e})}},hasCustomAddresses:{get(){return this.$store.state.products.form.hasCustomAddresses},set({index:t}){const e=!this.$store.state.products.form.hasCustomAddresses[t].value;this.$store.dispatch("products/setHasCustomAddress",{index:t,value:e})}},sendToCustomAddresses:{get(){return this.$store.state.products.form.sendToCustomAddresses},set({index:t}){const e=!this.$store.state.products.form.sendToCustomAddresses[t].value;this.$store.dispatch("products/setSendToCustomAddress",{index:t,value:e})}},addresses:{get(){return this.$store.state.products.form.addresses},set({index:t,value:e}){this.$store.dispatch("products/setAddress",{index:t,value:e})}},isProduct(){return this.$route.name==="product"},isValidAnnualPass(){if(!this.isAnnualPass)return!0;if(this.names[0].value.trim()===""||(this.hasCustomAddresses[0].value||this.isSNM)&&this.addresses[0].value.trim()==="")return!1;for(let t=1;t<this.quantity;t++)if(this.names[t].value.trim()===""||(this.hasCustomAddresses[t].value||this.isSNM)&&this.addresses[t].value.trim()==="")return!1;return!0},product(){const t=parseInt(this.$route.params.id,10);let e;return t&&(e=this.$store.state.products.data.find(c=>parseInt(c.id,10)===t)),e},shippingNotSameAsBilling(){return!this.$store.state.shipping.sameAsBilling},isAnnualPass(){return this.product.product_kind_ref==="13"},quantity:{get(){return this.products.form.quantity},set(t){this.setQuantity(t)}},totalPrice(){return this.hasDiscount(this.product)?this.discountPrice(this.product)*this.quantity:this.product.price*this.quantity}},methods:{...L({getSingle:"products/getSingle",resetForm:"products/resetForm",addToCart:"products/addToCart",setQuantity:"products/setQuantity"}),formatPrice(t){return $.currency(t)},hasDiscount(t){return t.discount!==null},discountPrice(t){if(typeof t.discount<"u"&&t.discount!=="null"){if(t.discount.units==="0")return parseInt(t.price,10)*(1-parseInt(t.discount.amount,10)/100);if(t.discount.units==="1")return t.price-t.discount.amount}},add(){const t=parseInt(this.$route.params.id,10);this.addToCart({id:t}).then(()=>{this.$toasted.show(this.$t("MERCHANDISE_ADDED_TO_CART")).goAway(2e3),this.$router.push({name:"checkout"})})},getNavName(t){return typeof this.navTranslations<"u"&&typeof this.navTranslations[t]<"u"&&typeof this.navTranslations[t][this.language]<"u"&&this.navTranslations[t][this.language]!==""?this.navTranslations[t][this.language]:this.$t(t)},setDataFromBillingInfo(t){const e=this.$store.state.customer.data.addrBilling.name,c=this.$store.state.customer.data.addrBilling.street+` 2`+this.$store.state.customer.data.addrBilling.city+` 3`+this.$store.state.customer.data.addrBilling.zip+` 4`+this.$store.state.customer.data.addrBilling.country;this.names={index:t,value:e},this.addresses={index:t,value:c}},setDataFromShippingInfo(t){const e=this.$store.state.customer.data.addrShipping.name,c=this.$store.state.customer.data.addrShipping.street+` 5`+this.$store.state.customer.data.addrShipping.city+` 6`+this.$store.state.customer.data.addrShipping.zip+` 7`+this.$store.state.customer.data.addrShipping.country;this.names={index:t,value:e},this.addresses={index:t,value:c}}},mounted(){this.navName=this.getNavName("NAV_MERCHANDISE"),this.$route.name==="pass"&&(this.navName=this.getNavName("NAV_MEMCARD")),typeof this.$route.params.id<"u"&&this.get
7Single(this.$route.params.id).then(()=>{if(typeof this.product>"u")this.$router.replace({name:"pageNotFound"});else{this.resetForm();let t=null;this.product.images.length>0&&(t=`${this.$store.state.app.API_PUBLIC_URL}/1600/${this.product.images[0]}`);let e=A(this.product.description_long);this.product.metadata&&(e=A(this.product.metadata)),w({title:g(this.product.name),description:e,ogDescription:e,ogTitle:g(this.product.name),ogImage:t})}})}},K={class:"ProductPage"},G={key:0},X={key:0,class:"contents pageBlock"},j={class:"goBack"},Q={class:"productHeader"},W={class:"description"},z={class:"text"},x=["innerHTML"],J={class:"quantity"},Z={key:0,class:"annualPass"},tt={key:0,class:"setDetailsActions"},st={key:2,class:"checkboxInput"},et=["id","checked","onInput"],at=["for"],rt={key:4,class:"checkboxInput"},nt=["id","checked","onInput"],ot=["for"],dt={class:"price"},it={class:"label"},ut={key:0,class:"priceWithDiscount"},ct={key:0,class:"oldPrice"},lt={class:"discountedPrice"},mt={class:"priceTotal"},ht={class:"label"},pt={class:"value"},_t={class:"actions"},ft=["disabled"],At={class:"quantity"},It={class:"suffix"},gt={class:"images"};function Ct(t,e,c,vt,v,s){const I=h("router-link"),N=h("Breadcrumbs"),S=h("Alert"),T=h("NumberInputWithButtons"),y=h("TextInput"),E=h("TextAreaInput"),P=h("Carousel");return n(),d("div",K,[p(N,null,{default:_(()=>[p(I,{to:{name:"merchandise"},class:C({"router-link-active":s.isProduct,active:s.isProduct})},{default:_(()=>[i(r(s.getNavName(v.navName)),1)]),_:1},8,["class"]),s.product?(n(),d("span",G,r(s.product.name),1)):u("",!0)]),_:1}),s.product?(n(),d("div",X,[a("div",j,[a("button",{class:"backButton",type:"button",onClick:e[0]||(e[0]=o=>this.$router.go(-1))},r(t.$t("NAV_BACK")),1)]),a("div",Q,[a("h1",null,r(s.product.name),1)]),a("div",W,[a("div",z,[a("div",{class:"content",innerHTML:s.product.description_long},null,8,x),a("form",null,[p(S,{condition:parseInt(s.product.stock)<=0},{default:_(()=>[i(r(t.$t("MERCHANDISE_OUT_OF_STOCK")),1)]),_:1},8,["condition"]),a("div",J,[p(T,{modelValue:s.quantity,"onUpdate:modelValue":e[1]||(e[1]=o=>s.quantity=o),disabled:parseInt(s.product.stock,10)===0,label:"MERCHANDISE_QUANTITY",min:"0",max:parseInt(s.product.stock)},null,8,["modelValue","disabled","max"])]),s.isAnnualPass?(n(),d("div",Z,[(n(!0),d(l,null,R(s.quantity,o=>(n(),d("fieldset",{key:o},[a("legend",null,r(t.$t("ANNUAL_TICKETS_CARD"))+" "+r(o),1),t.isLoggedIn?(n(),d("div",tt)):u("",!0),typeof s.names[o-1].value<"u"?(n(),f(y,{key:1,label:t.$t("ANNUAL_TICKETS_NAME"),"model-value":s.names[o-1].value,onInput:m=>{s.names={index:o-1,value:m}}},null,8,["label","model-value","onInput"])):u("",!0),s.isSNM?u("",!0):(n(),d("div",st,[a("input",{type:"checkbox",id:"hasCustomAddress-"+(o-1),checked:s.hasCustomAddresses[o-1].value,onInput:m=>s.hasCustomAddresses={index:o-1,event:m}},null,40,et),a("label",{for:"hasCustomAddress-"+(o-1)},r(t.$t("ANNUAL_TICKETS_SENT_TO_CUSTOM_ADDRESS")),9,at)])),s.hasCustomAddresses[o-1].value||s.isSNM?(n(),f(E,{key:3,class:"productAddress",label:t.$t("ANNUAL_TICKETS_ADDRESS"),fname:"address-"+o-1,"model-value":s.addresses[o-1].value,"onUpdate:modelValue":m=>{s.addresses={index:o-1,value:m}}},null,8,["label","fname","model-value","onUpdate:modelValue"])):u("",!0),s.isSNM?(n(),d("div",rt,[a("input",{type:"checkbox",id:"sendToCustomAddress-"+(o-1),checked:s.sendToCustomAddresses[o-1].value,onInput:m=>s.sendToCustomAddresses={index:o-1,event:m}},null,40,nt),a("label",{for:"sendToCustomAddress-"+(o-1)},r(t.$t("ANNUAL_TICKETS_SENT_TO_CUSTOM_ADDRESS")),9,ot)])):u("",!0)]))),128))])):u("",!0),a("div",dt,[a("span",it,r(t.$t("MERCHANDISE_UNIT_PRICE"))+": ",1),s.hasDiscount(s.product)?(n(),d(l,{key:1},[s.product.discount?(n(),d("div",ut,[s.product.price!==s.product.discount.new_price?(n(),d("span",ct,r(s.formatPrice(s.product.price)),1)):u("",!0),a("span",lt,r(s.formatPrice(s.product.discount.new_price)),1)])):u("",!0)],64)):(n(),d(l,{key:0},[i(r(s.formatPrice(s.product.price)),1)],64))]),a("div",mt,[a("div",ht,[i(r(t.$t("MERCHANDISE_TOTAL"))+" ",1),t.$te("ALL_PRICES_INCLUDE_VAT_PLUS_SHIPPING_PART1")?(n(),d(l,{key:0},[i(" ("+r(t.$t("ALL_PRICES_INCLUDE_VAT_PLUS_SHIPPING_PART1"))+" ",1),p(I,{to:{name:"shippingInfo"},target:"_blank"},{default:_(()=>
7[i(r(t.$t("ALL_PRICES_INCLUDE_VAT_PLUS_SHIPPING_PART2")),1)]),_:1}),e[3]||(e[3]=i(") "))],64)):(n(),d(l,{key:1},[i(" ("+r(t.$t("ALL_PRICES_INCLUDE_VAT"))+") ",1)],64))]),a("div",pt,r(s.formatPrice(s.totalPrice)),1)]),a("div",_t,[a("button",{class:C(["buyBtn mainAction",{hasItems:s.quantity>0}]),onClick:e[2]||(e[2]=D(o=>s.add(),["stop","prevent"])),disabled:s.quantity===0||parseInt(s.product.stock,10)<=0||!s.isValidAnnualPass},[i(r(t.$t("MERCHANDISE_BUY"))+" ",1),t.$t("MERCHANDISE_BUY_SUFFIX_SINGULAR")!=="MERCHANDISE_BUY_SUFFIX_SINGULAR"&&t.$t("MERCHANDISE_BUY_SUFFIX_PLURAL")!=="MERCHANDISE_BUY_SUFFIX_PLURAL"?(n(),d(l,{key:0},[a("span",At,r(s.quantity),1),a("span",It,[s.quantity===1?(n(),d(l,{key:0},[i(r(t.$t("MERCHANDISE_BUY_SUFFIX_SINGULAR")),1)],64)):(n(),d(l,{key:1},[i(r(t.$t("MERCHANDISE_BUY_SUFFIX_PLURAL")),1)],64))])],64)):u("",!0)],10,ft)])])]),a("div",gt,[p(P,{class:"carousel",images:s.product.images},null,8,["images"])])])])):u("",!0),(n(),f(B,{to:"head"},[(n(),f(b("script"),{type:"application/ld+json"},{default:_(()=>[i(r(s.jsonld),1)]),_:1}))]))])}const Dt=k(Y,[["render",Ct],["__scopeId","data-v-614b6288"]]);export{Dt as default}; 8//# sourceMappingURL=Product-B_XbE_Q5.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.