1import{n as o,s as n,d as l}from"./TinyLoader-e1334c42.js";import{P as d,S as _,R as f}from"./RadioSelectors-d9e36163.js";import{A as m}from"./Alert-0972d99a.js";import{F as b}from"./ApiHelpers-0ece215d.js";import{t as v}from"./LangHelper-893cda51.js";import{P as y}from"./PaymentMethods-8706c4f3.js";import"./RadioSelect-be6fe729.js";import"./SetupPayMethodModal-e34e4a7e.js";import"./FormButton-7119406c.js";import"./mitt-f7ef348c.js";import"./Stripe-733ad9aa.js";import"./CheckBoxIcon-09a6c1d2.js";import"./FormRow-22703e7d.js";import"./TieredLoadingMixin-c5086e62.js";import"./ValidationErrorMixin-e2725d53.js";import"./EventBus-a3b92820.js";const g=n({name:"HostingBasics",components:{PanelInfo:d}});var h=function(){var t=this,e=t._self._c;return t._self._setupProxy,e("panel-info",{attrs:{"bg-color":"bg-platform-panel-color"},scopedSlots:t._u([{key:"closed",fn:function(){return[e("div",{staticClass:"mr-3"},[e("i",{staticClass:"fas fa-check text-labels-yellow"})]),e("div",[e("ul",{staticClass:"text-platform-text-color"},[e("li",{staticClass:"font-bold",domProps:{innerHTML:t._s(t.translate("components/server/basket/package.storm-basics"))}})])])]},proxy:!0},{key:"open",fn:function(){return[e("div",{staticClass:"mr-3"},[e("i",{staticClass:"fas fa-check text-labels-yellow"})]),e("div",[e("ul",{staticClass:"text-platform-text-color"},[e("li",{staticClass:"font-bold",domProps:{innerHTML:t._s(t.translate("components/server/basket/package.storm-basics"))}}),e("li",{staticClass:"block"},[e("ul",[e("li",[t._v(t._s(t._f("trans")("components/server/basket/package.storm-basics-features.li-one")))]),e("li",[t._v(t._s(t._f("trans")("components/server/basket/package.storm-basics-features.li-two")))]),e("li",[t._v(t._s(t._f("trans")("components/server/basket/package.storm-basics-features.li-three")))]),e("li",[t._v(t._s(t._f("trans")("components/server/basket/package.storm-basics-features.li-four")))]),e("li",[t._v(t._s(t._f("trans")("components/server/basket/package.storm-basics-features.li-five")))])])])])])]},proxy:!0}])})},x=[],k=o(g,h,x,!1,null,"08d48536",null,null);const C=k.exports;const w=n({name:"ProductCard",components:{HostingBasics:C,PanelInfo:d},props:{product:{type:Object,required:!0},frequency:{type:String,required:!0},selected:{type:Boolean,required:!1,default:!1},isUpgradePage:{type:Boolean,required:!1,default:!1},currentProduct:{type:Object,required:!1,default:null}},data(){return{inFocus:!1}},computed:{isDisabled(){return!1}},methods:{getAnnualPricePerMonth(){return this.product.price.cycle.amount/12},isCurrent(s){return!!(this.isUpgradePage&&this.currentProduct&&this.currentProduct.id===s.id)},isBuyable(s){return this.isUpgradePage?this.currentProduct?!!this.currentProduct.available_upgrade_product_ids.includes(s.id):!1:!0},isNotAvailableToUpgrade(s){return this.isUpgradePage?!this.currentProduct||!this.currentProduct.available_upgrade_product_ids.includes(s.id)&&this.currentProduct.id!==s.id:!1},contactRequired(){return!!(this.isUpgradePage&&this.currentProduct===null)}}});var P=function(){var t=this,e=t._self._c;return t._self._setupProxy,e("div",{staticClass:"swiper-slide relative bg-platform-panel-color overflow-hidden rounded-md shadow-nimbus cursor-pointer",class:[t.isCurrent||t.isDisabled?"border-platform-border-color border-4 shadow-none":t.inFocus?"border-primary-100 border-2 shadow-none":""],staticStyle:{width:"250px","margin-right":"12px"},on:{mouseenter:function(r){t.inFocus=!0},mouseleave:function(r){t.inFocus=!1}}},[e("div",{staticClass:"p-2 leading-5 text-sm",staticStyle:{"white-space":"nowrap"}},[e("div",{staticClass:"flex justify-between"},[e("h2",{staticClass:"text-2xl text-platform-text-color font-bold"},[t._v(" "+t._s(t.product.name.replace("-"," ").replace("plus","+"))+" ")]),e("div",[t.frequency==="annually"?e("span",{staticClass:"block text-xl text-right text-platform-text-color font-bold"},[t._v(t._s(t._f("currency")(t.getAnnualPricePerMonth())))]):t.frequency==="monthly"?e("span",{staticClass:"block text-xl text-right text-platform-text-color font-bold"},[t._v("£"+t._s(t.product.price.monthly.amount))]):t._e()])]),e("div",{staticClass:"block text-xs mb-3 text-platform-text-color text-right"},[t._v(" "+t._s(t._f("trans")("components/server/basket/package.per-month"))+" "),e("span",{domProps:{innerHTML:t._s(t.translate("components/server/basket/package.billed",{frequency:t.frequency}))}})]),e("panel-info",{staticClass:"mb-3",staticStyle:{"white-space":"pre-wrap"},attrs:{"bg-color":"bg-labels-yellow"},scopedSlots:t._u([{key:"open",fn:function(){return[t._v(" "+t._s(t.product.long_description)+" ")]},proxy:!0},{key:"closed",fn:function(){return[t._v(" "+t._s(t.product.short_description)+" ")]},proxy:!0}])}),e("div",{staticClass:"mb-3"},[e("ul",{staticClass:"ml-8 text-platform-text-color w-3/4"},[e("li",{staticClass:"relative"},[t._m(0),t._v(" "+t._s(t.product.meta.cores)+" cores ")]),e("li",[t._m(1),t._v(" "+t._s(t.product.meta.disk_space)+"GB disk space ")]),e("li",[t._m(2),t._v(" "+t._s(t.product.meta.memory)+"GB memory ")])])]),e("div",{staticClass:"mb-3"},[e("hosting-basics")],1),e("div",{staticClass:"mb-20"},[e("ul",{staticClass:"mx-2"},t._l(t.product.features,function(r,a){return e("li",{key:a,staticClass:"leading-5 flex items-baseline text-platform-text-color"},[e("i",{staticClass:"fas fa-check text-labels-yellow mr-3"}),e("span",[t._v(t._s(r))])])}),0)])],1),t.inFocus?[t.isNotAvailableToUpgrade(t.product)?e("button",{staticClass:"absolute left-0 right-0 bottom-0 w-full py-4 rounded-b bg-platform-icon text-color cursor-not-allowed",attrs:{type:"button",disabled:"disabled"}},[t._v(" "+t._s(t._f("trans")("components/server/basket/package.buttons.not-enough-space"))+" ")]):t.isCurrent(t.product)?e("button",{staticClass:"absolute left-0 right-0 bottom-0 w-full py-4 rounded-b bg-platform-icon text-color cursor-not-allowed",attrs:{type:"button"}},[t._v(" "+t._s(t._f("trans")("components/server/basket/package.buttons.current-package"))+" ")]):t.contactRequired()?e("button",{staticClass:"absolute left-0 right-0 bottom-0 w-full py-4 rounded-b bg-labels-yellow text-color",attrs:{type:"button"}},[t._v(" "+t._s(t._f("trans")("components/server/basket/package.buttons.contact"))+" ")]):t.isBuyable(t.product)?e("button",{staticClass:"absolute left-0 right-0 bottom-0 w-full py-4 rounded-b bg-labels-yellow text-color",attrs:{type:"button"},on:{click:function(r){return r.preventDefault(),r.stopPropagation(),t.$emit("set-product",t.product)}}},[t._v(" "+t._s(t._f("trans")("components/server/basket/package.buttons.select-package"))+" ")]):t._e()]:t._e()],2)},q=[function(){var s=this,t=s._self._c;return s._self._setupProxy,t("span",{staticClass:"absolute -left-6"},[t("i",{staticClass:"fas fa-microchip text-labels-yellow"})])},function(){var s=this,t=s._self._c;return s._self._setupProxy,t("span",{staticClass:"absolute -left-6"},[t("i",{staticClass:"fas fa-hdd text-labels-yellow"})])},function(){var s=this,t=s._self._c;return s._self._setupProxy,t("span",{staticClass:"absolute -left-6"},[t("i",{staticClass:"fas fa-memory text-labels-yellow"})])}],S=o(w,P,q,!1,null,"fca41b6e",null,null);const T=S.exports;const $=n({name:"ProductsCarousel",components:{ProductCard:T,Slider:_},props:{products:{type:Array,required:!0},productTypes:{type:Array,required:!0},frequency:{type:String,required:!0},indexes:{type:Object,required:!0},isUpgradePage:{type:Boolean,required:!1,default:!1},currentProductId:{type:Number,required:!1,default:null}},data(){return{selectedProducts:[],windowWidth:window.innerWidth,update:!1,options:{slidesPerView:1.25,spaceBetween:15,allowTouchMove:!0,slideToClickedSlide:this.shouldSlideToClickedSlide(),initialSlide:this.initialSlide(),centeredSlides:!0,centeredSlidesB
1ounds:!0,navigation:{nextEl:".slides__next-button",prevEl:".slides__prev-button",disabledClass:"slides__buttons--disabled"},breakpoints:{640:{slidesPerView:2.2,centeredSlides:!1,centeredSlidesBounds:!1},768:{slidesPerView:3.2,centeredSlides:!1,centeredSlidesBounds:!1},1024:{slidesPerView:3.2,spaceBetween:12.5,centeredSlides:!1,centeredSlidesBounds:!1,allowTouchMove:!1}}}}},computed:{alert(){return m},isMobileViewport(){return this.windowWidth<1023},currentProduct(){return this.products.find(s=>s.id===this.currentProductId)},visibleProducts(){return this.products.filter(s=>this.productTypes.includes(s.type))}},methods:{shouldSlideToClickedSlide(){return!!(this.isMobileViewport&&this.platform==="mobile")},isVisible(s){return!!this.productTypes.includes(s.type)},initialSlide(){return this.indexes.active!==void 0?this.indexes.active:this.indexes.product!==void 0?this.indexes.product:0},setProduct(s){this.$emit("set-product",s)},removeProduct(s){return this.selectedProducts=this.selectedProducts.filter(function(t){return t!==s})},productIsSelected(s){return this.selectedProducts.includes(s)}}});var j=function(){var t=this,e=t._self._c;return t._self._setupProxy,e("div",{staticClass:"container py-0 px-5 sm:px-0 mb-5 max-w-full"},[e("slider",{staticClass:"mb-5",attrs:{options:t.options},scopedSlots:t._u([{key:"navigation",fn:function(){return[e("button",{staticClass:"hidden lg:block absolute top-8 left-0 slides__prev-button",attrs:{type:"button"}},[e("i",{staticClass:"fas fa-angle-left text-3xl lg:text-5xl text-platform-icon"})]),e("button",{staticClass:"hidden lg:block absolute top-8 right-0 slides__next-button",attrs:{type:"button"}},[e("i",{staticClass:"fas fa-angle-right text-3xl lg:text-5xl text-platform-icon"})])]},proxy:!0}])},t._l(t.visibleProducts,function(r,a){return e("product-card",{key:a,attrs:{"current-product":t.currentProduct,"is-upgrade-page":t.isUpgradePage,product:r,frequency:t.frequency,selected:t.productIsSelected(r)},on:{"set-product":t.setProduct,"remove-product":t.removeProduct}})}),1)],1)},B=[],M=o($,j,B,!1,null,null,null,null);const I=M.exports;const O=n({name:"ItemOverview",props:{item:{type:Object,required:!0}},computed:{getDomainTerm(){if(this.item.billing==="annually")return"1 Year";let s=this.item.billing.split("_");return s[1]+" "+s[0]}},methods:{async removeItem(){await this.$http.delete(Storm.apiUrl+"/product-cart/items/"+this.item.id),l.Inertia.reload()}}});var A=function(){var t=this,e=t._self._c;return t._self._setupProxy,e("div",{staticClass:"bg-white p-4 my-2 rounded"},[e("div",{staticClass:"flex justify-between"},[e("div",{staticClass:"font-semibold text-lg"},[t._v(" "+t._s(t.item.name)+" ")]),e("button",{on:{click:function(r){return r.preventDefault(),t.removeItem()}}},[e("i",{staticClass:"fa-solid fa-xmark text-platform-text-color hover:text-platform-link-hover"})])]),t.item.buyable_type==="product"?[t.item.billing==="annually"?e("div",{staticClass:"flex mt-2"},[t._v(" "+t._s(t.item.price.cycle.formatted)+" "+t._s(t._f("trans")("components/basket/basket-preview.per_year"))+" ")]):e("div",{staticClass:"flex mt-2"},[t._v(" "+t._s(t.item.price.monthly.formatted)+" "+t._s(t._f("trans")("components/basket/basket-preview.per_month"))+" ")])]:t.item.buyable_type==="domain"?[e("div",{staticClass:"flex mt-4 justify-between"},[e("div",{staticClass:"my-auto"},[t._v(" "+t._s(t.item.price.cycle.formatted)+" - "),e("span",{staticClass:"capitalize"},[t._v(" "+t._s(t.getDomainTerm)+" ")])]),e("div",{staticClass:"rounded-full bg-labels-yellow py-1 px-3 text-sm font-semibold capitalize my-auto"},[t._v(" "+t._s(t.item.type)+" ")])])]:t._e()],2)},U=[],F=o(O,A,U,!1,null,"2308a307",null,null);const V=F.exports;const R=n({name:"BasketPreview",components:{PaymentMethods:y,ItemOverview:V},props:{items:{type:Object,required:!0},organisation:{type:String,required:!1,default:null},total:{type:Object,required:!0,default:null},totalWithTax:{type:Object,required:!0,default:null},paymentMethods:{type:Array,required:!0},currentPaymentMethod:{type:Number,required:!1,default:null}},data(){return{incVat:!1,agreeTocs:!1}},methods:{checkout(){l.Inertia.visit("/basket")},paymentMethodChanged(){this.$emit("payment-method-changed")}}});var W=function(){var t=this,e=t._self._c;return t._self._setupProxy,e("div",[e("div",{staticClass:"border-b-2 border-platform-icon text-2xl pb-6"},[t._v(" "+t._s(t.translate("components/basket/basket-preview.title"))+" ")]),t.items.data.length>0?e("div",t._l(t.items.data,function(r,a){return e("ItemOverview",{key:a,attrs:{item:r}})}),1):e("div",{staticClass:"pt-8 pb-2 text-center"},[t._v(" "+t._s(t.translate("components/basket/basket-preview.empty-basket"))+" ")]),t.organisation?e("div",{staticClass:"bg-white p-4 my-6 rounded"},[e("div",{staticClass:"flex justify-between mt-2 mb-4"},[e("span",{staticClass:"font-semibold"},[t._v(t._s(t.translate("components/basket/basket-preview.billing")))]),e("span",[t._v(t._s(t.organisation.name))])]),t.paymentMethods.length>0?e("div",{staticClass:"flex justify-between mb-2 mt-4"},[e("span",{staticClass:"font-semibold"},[t._v(t._s(t._f("trans")("components/basket/basket-preview.payment")))]),e("span",[e("PaymentMethods",{attrs:{"payment-methods":t.paymentMethods,"current-payment-method":t.currentPaymentMethod,organisation:t.organisation},on:{"payment-method-changed":t.paymentMethodChanged}})],1)]):t._e()]):t._e(),e("div",{staticClass:"bg-white p-4 my-6 rounded"},[e("div",{staticClass:"flex justify-between mb-4"},[e("span",{staticClass:"font-semibold my-auto"},[t._v(t._s(t.translate("components/basket/basket-preview.total")))]),e("div",[e("div",{staticClass:"flex flex-col justify-end"},[e("div",[t.incVat?[t._v(" "+t._s(t._f("currency")(t.totalWithTax.data.amount))+" ")]:[t._v(" "+t._s(t._f("currency")(t.total.data.amount))+" ")]],2),t.incVat?e("button",{staticClass:"text-platform-link font-normal mr-0 ml-auto mt-1",attrs:{type:"button"},on:{click:function(r){t.incVat=!1}}},[t._v(" "+t._s(t.translate("components/basket/basket-preview.inc_vat"))+" ")]):e("button",{staticClass:"text-platform-link font-normal mr-0 ml-auto mt-1",attrs:{type:"button"},on:{click:function(r){t.incVat=!0}}},[t._v(" "+t._s(t.translate("components/basket/basket-preview.ex_vat"))+" ")])])])]),e("hr"),e("div",{staticClass:"mt-4"},[e("div",{staticClass:"my-6 flex justify-center"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.agreeTocs,expression:"agreeTocs"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.agreeTocs)?t._i(t.agreeTocs,null)>-1:t.agreeTocs},on:{change:function(r){var a=t.agreeTocs,c=r.target,p=!!c.checked;if(Array.isArray(a)){var u=null,i=t._i(a,u);c.checked?i<0&&(t.agreeTocs=a.concat([u])):i>-1&&(t.agreeTocs=a.slice(0,i).concat(a.slice(i+1)))}else t.agreeTocs=p}}}),e("span",{staticClass:"pl-2"},[t._v(" "+t._s(t.translate("components/basket/basket-preview.tos_agree"))+" "),e("a",{staticClass:"text-platform-link hover:text-platform-link-hover",attrs:{href:t.translate("components/basket/basket-preview.tos_url"),target:"_blank"}},[t._v(" "+t._s(t.translate("components/basket/basket-preview.tos"))+" ")])])]),e("div",{staticClass:"flex justify-center my-6"},[e("button",{staticClass:"button text-xl",attrs:{disabled:!t.agreeTocs||t.items.data.length<=0},on:{click:t.checkout}},[t._v(" "+t._s(t.translate("components/basket/basket-preview.checkout"))+" ")])])])])])},D=[],H=o(R,W,D,!1,null,"d2c92853",null,null);const N=H.exports;const z=n({name:"UpgradePackagesPage",components:{BasketPreview:N,RadioSelectors:f,ProductsCarousel:I},props:{currentProductId:{type:Number,required:!1,default:null},server:{type:Object,required:!1,default:null},items:{type:Object,required:!0},organisation:{type:String,required:!1,default:null},total:{type:Object,required:!0,default:null},totalWithTax:{type:Object,required:!0,default:null}},data(){return{indexes:{active:0},products:[],frequencies:["annually","monthly"],frequency:"annually",error:null}},created(){this.getProducts()},methods:{async getProducts(){this.products=await b("product-cart/products")},async selectProduct(s){var t,e;try{await this.$http.post(Storm.apiUrl+"/product-cart/items/upgrade",{product_id:s.id,billing_cycle:this.frequency,server_id:this.server.data.id}),l.Inertia.visit("/basket"),this.error=null}catch(r){(e=(t=r.response)==null?void 0:t.data)!=null&&e.message?this.error=r.response.data.message:this.error=v("components/basket/upgrades.error")}}}});var L=function(){var t=this,e=t._self._c;return t._self._setupProxy,e("master-layout",{attrs:{title:t.translate("components/basket/upgrades.title")}},[e("div",{staticClass:"w-full max-w-full"},[e("div",{staticClass:"lg:w-3/4 mx-auto mt-12 lg:mt-16"},[e("div",{staticClass:"grid grid-cols-5 w-full gap-12 lg:gap-20"},[e("div",{staticClass:"col-span-3 lg:col-span-3"},[e("div",{staticClass:"flex"},[e("radio-selectors",{staticClass:"text-platform-text-color",attrs:{options:t.frequencies,name:"billed",inline:"","label-prefix":"Billed",default:t.frequency},model:{value:t.frequency,callback:function(r){t.frequency=r},expression:"frequency"}})],1),e("div",[e("products-carousel",{attrs:{products:t.products,"product-types":["server"],frequency:t.frequency,indexes:t.indexes,"is-upgrade-page":!0,"current-product-id":t.currentProductId},on:{"set-product":t.selectProduct}})],1)]),e("div",{staticClass:"col-span-3 lg:col-span-2"},[e("BasketPreview",{attrs:{items:t.items,organisation:t.organisation,total:t.total,"total-with-tax":t.totalWithTax}}
1)],1)])]),t.error?e("div",{staticClass:"container mx-auto flex justify-center text-labels-warning"},[e("i",{staticClass:"fa fa-warning text-labels-warning mr-2"}),t._v(t._s(t.error)+" ")]):t._e()])])},E=[],G=o(z,L,E,!1,null,"a163f6b8",null,null);const ut=G.exports;export{ut as default};
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.