/*!
 * BookiFlex Onboarding Extension
 * License: GPL-2.0-or-later
 * © 2026 BookiFlex
 *
 * Uses external libraries: Vue.js (MIT)
 * Uses WordPress-provided libraries: @wordpress/i18n (GPL-2.0-or-later)
 *
 * This bundle includes third-party code:
 * - vue-currency-input (MIT)
 *   https://github.com/dm4t2/vue-currency-input
 */
!function(e){"use strict";const t={WELCOME:1,COMPANY_INFO:2,ACCOMMODATION:3,BOOKING_PRESET:4,CONFIRMATION:5,NEXT_STEPS:6},o={[t.WELCOME]:window.wp.i18n.__("Let’s get you set up","bookiflex"),[t.COMPANY_INFO]:window.wp.i18n.__("Your Company","bookiflex"),[t.ACCOMMODATION]:window.wp.i18n.__("Rental Units","bookiflex"),[t.BOOKING_PRESET]:window.wp.i18n.__("Booking Terms","bookiflex"),[t.CONFIRMATION]:window.wp.i18n.__("Confirmation","bookiflex"),[t.NEXT_STEPS]:window.wp.i18n.__("Next Steps","bookiflex")},a=Object.keys(t).length,n={QUICK_SETUP:"quick_setup",TEST_DATA:"test_data",MANUAL:"manual"},i=[{value:n.QUICK_SETUP,label:window.wp.i18n.__("Quick setup","bookiflex"),description:window.wp.i18n.__("Complete a short survey for basic setup","bookiflex"),recommended:!0},{value:n.TEST_DATA,label:window.wp.i18n.__("Load test data","bookiflex"),description:window.wp.i18n.__("Try the plugin with demo data","bookiflex"),recommended:!1},{value:n.MANUAL,label:window.wp.i18n.__("Manual setup","bookiflex"),description:window.wp.i18n.__("Configure all settings later manually","bookiflex"),recommended:!1}],l="bed",r=[{key:"monday",label:window.wp.i18n.__("Mo","bookiflex"),fullLabel:"Monday"},{key:"tuesday",label:window.wp.i18n.__("Tu","bookiflex"),fullLabel:"Tuesday"},{key:"wednesday",label:window.wp.i18n.__("We","bookiflex"),fullLabel:"Wednesday"},{key:"thursday",label:window.wp.i18n.__("Th","bookiflex"),fullLabel:"Thursday"},{key:"friday",label:window.wp.i18n.__("Fr","bookiflex"),fullLabel:"Friday"},{key:"saturday",label:window.wp.i18n.__("Sa","bookiflex"),fullLabel:"Saturday"},{key:"sunday",label:window.wp.i18n.__("Su","bookiflex"),fullLabel:"Sunday"}],s=e=>"string"==typeof e?e.trim().length>0:"number"==typeof e||(Array.isArray(e)?e.length>0:null!=e),c=e=>"number"==typeof e&&e>0,d=e=>{const t={};if(e.type="unit",e.units=1,s(e.name)||(t.name=window.wp.i18n.__("Property name is required","bookiflex")),s(e.address)||(t.address=window.wp.i18n.__("Address is required","bookiflex")),e.type!==l&&(c(e.beds)||(t.beds=window.wp.i18n.__("Main sleeping capacity is required","bookiflex"))),e.pricing){["monday","tuesday","wednesday","thursday","friday","saturday","sunday"].filter(t=>{return o=e.pricing[t],!(c(o)&&Number.isFinite(o));var o}).length>0&&(t.pricing=window.wp.i18n.__("All prices must be greater than 0","bookiflex"))}else t.pricing=window.wp.i18n.__("Specify prices for all days of the week","bookiflex");return{canProceed:0===Object.keys(t).length,errors:t}},u=(e,t="USD")=>{const o=((e="USD")=>{try{return new Intl.NumberFormat("en-US",{style:"currency",currency:e}).resolvedOptions().maximumFractionDigits}catch(E){return console.warn(`Could not determine precision for currency ${e}, defaulting to 2`),2}})(t),a=Math.pow(10,o),n="string"==typeof e?parseFloat(e):e;return isNaN(n)?0:Math.round(n*a)},m=(e,t="USD")=>{try{return new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e)}catch(E){return`${{USD:"$",EUR:"€",GBP:"£",UAH:"₴",PLN:"zł",CZK:"Kč"}[t]||t}${e}`}},p=["USD","EUR","GBP","PLN","JPY","CNY","AUD","CAD","CHF","SEK","NZD","RUB"],y={BASE_URL:"undefined"!=typeof window&&window.BookiFlex?.extensions?.onboarding?.restUrl?window.BookiFlex.extensions.onboarding.restUrl:"http://localhost:3000",NONCE:"undefined"!=typeof window&&window.BookiFlex?.extensions?.onboarding?.nonce?window.BookiFlex.extensions.onboarding.nonce:null,SETTINGS_URL:"undefined"!=typeof window&&window.BookiFlex?.extensions?.onboarding?.settingsUrl?window.BookiFlex.extensions.onboarding.settingsUrl:"/wp-admin/admin.php?page=bookiflex",ENDPOINTS:{ONBOARDING_INIT:"/init",ONBOARDING_COMPLETE:"/complete"},TIMEOUT:6e4};class _{constructor(){this.baseURL=y.BASE_URL,this.timeout=y.TIMEOUT}async fetchWithTimeout(e,t={}){const o=new AbortController,a=setTimeout(()=>o.abort(),this.timeout);try{const n=await fetch(e,{...t,signal:o.signal});return clearTimeout(a),n}catch(E){if(clearTimeout(a),"AbortError"===E.name)throw new Error("Request timeout");throw E}}async post(e,t){try{const o=`${this.baseURL}${e}`,a={"Content-Type":"application/json"};y.NONCE&&(a["X-WP-Nonce"]=y.NONCE);const n=await this.fetchWithTimeout(o,{method:"POST",headers:a,credentials:"include",body:JSON.stringify(t)}),i=await n.json();if(!n.ok)throw new Error(i.result?.message||`HTTP error! status: ${n.status}`);return i}catch(E){throw console.error("API Error:",E),E}}async fetchInitData(){return this.post(y.ENDPOINTS.ONBOARDING_INIT,{})}async submitOnboarding(e){return this.post(y.ENDPOINTS.ONBOARDING_COMPLETE,e)}}const g=new _,h=e.ref([]),f=e.ref([]),v=e.ref([]),w=e.ref([]),b=e.ref([]),k=e.ref(!1),N=e.ref(!1),E=e.ref(null);function V(){return{currencies:h,cancellationPolicies:f,paymentTypes:v,bookingPresets:w,accommodationTypes:b,isLoading:k,isInitialized:N,error:E,fetchInitData:async()=>{if(!N.value){k.value=!0,E.value=null;try{const e=await g.fetchInitData();if("success"!==e.status||!e.result)throw new Error(e.result?.message||"Failed to fetch initial data");{const t=e.result.currencies||[];h.value=(e=>{if(!Array.isArray(e)||0===e.length)return e;const t=[...e];return t.sort((e,t)=>{const o=p.indexOf(e.value),a=p.indexOf(t.value);return-1!==o&&-1!==a?o-a:-1!==o?-1:-1!==a?1:e.value.localeCompare(t.value)}),t})(t),f.value=e.result.cancellationPolicies||[],v.value=e.result.paymentTypes||[],w.value=e.result.bookingPresets||[],b.value=e.result.accommodationTypes||[],N.value=!0}}catch(e){E.value=e.message||window.wp.i18n.__("An error occurred while loading data","bookiflex"),console.error("Init data error:",e)}finally{k.value=!1}}},reset:()=>{h.value=[],f.value=[],v.value=[],w.value=[],b.value=[],N.value=!1,E.value=null}}}function S(){const o=e.ref(t.WELCOME),i=e.ref(!1),l=e.ref(null),r=e.reactive(new Set),c=e.reactive({mode:"",companyName:"",companyAddress:"",companyPhone:"",companyEmail:"",currency:"USD",accommodationTypes:[],bookingPreset:"",nextSteps:[]}),d=()=>{switch(o.value){case t.WELCOME:return(e=>{const t={};return s(e.mode)||(t.mode=window.wp.i18n.__("Choose setup mode","bookiflex")),{canProceed:0===Object.keys(t).length,errors:t}})(c);case t.COMPANY_INFO:return(e=>{const t={};var o;return s(e.companyName)||(t.companyName=window.wp.i18n.__("Company name is required","bookiflex")),s(e.companyAddress)||(t.companyAddress=window.wp.i18n.__("Company address is required","bookiflex")),s(e.companyEmail)?"string"==typeof(o=e.companyEmail)&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(o.trim())||(t.companyEmail=window.wp.i18n.__("Enter a valid email address","bookiflex")):t.companyEmail=window.wp.i18n.__("Contact email is required","bookiflex"),s(e.currency)||(t.currency=window.wp.i18n.__("Choose currency","bookiflex")),{canProceed:0===Object.keys(t).length,errors:t}})(c);case t.ACCOMMODATION:return(e=>{const t={};return Array.isArray(e.accommodationTypes)&&0!==e.accommodationTypes.length||(t.accommodationTypes=window.wp.i18n.__("Add at least one accommodation type","bookiflex")),{canProceed:0===Object.keys(t).length,errors:t}})(c);case t.BOOKING_PRESET:return(e=>{const t={};return s(e.bookingPreset)||(t.bookingPreset=window.wp.i18n.__("Choose booking terms","bookiflex")),{canProceed:0===Object.keys(t).length,errors:t}})(c);case t.CONFIRMATION:case t.NEXT_STEPS:return{canProceed:!0,errors:{}};default:return{canProceed:!1,errors:{}}}},m=e.computed(()=>d().canProceed),p=e=>r.has(e),y=e=>e===o.value||!!(e<o.value&&p(e));return{currentStep:o,totalSteps:a,isLoading:i,error:l,data:c,completedSteps:r,canProceed:m,nextStep:()=>{m.value?(r.add(o.value),o.value!==t.WELCOME||c.mode!==n.TEST_DATA&&c.mode!==n.MANUAL?o.value<a&&o.value++:o.value=t.CONFIRMATION):console.warn("Cannot proceed: validation failed")},prevStep:()=>{o.value>t.WELCOME&&o.value--},goToStep:e=>{e<t.WELCOME||e>a?console.warn("Invalid step number"):y(e)?o.value=e:console.warn("Step is not accessible")},updateStepData:(e,t)=>{Object.assign(c,t)},isStepCompleted:p,isStepAccessible:y,validateCurrentStep:d,reset:()=>{o.value=t.WELCOME,i.value=!1,l.value=null,r.clear(),c.mode="",c.companyName="",c.companyAddress="",c.companyPhone="",c.companyEmail="",c.currency="",c.accommodationTypes=[],c.bookingPreset="",c.nextSteps=[]},getFinalData:()=>{const e={mode:c.mode};if(c.mode===n.QUICK_SETUP){e.companyName=c.companyName,e.companyAddress=c.companyAddress,e.companyPhone=c.companyPhone,e.companyEmail=c.companyEmail,e.currency=c.currency,e.accommodationTypes=c.accommodationTypes.map(e=>({name:e.name,address:e.address,unitType:"unit",mainPlaces:e.beds||1,availableUnits:1,weeklyPricing:{mon:u(e.pricing.monday,c.currency),tue:u(e.pricing.tuesday,c.currency),wed:u(e.pricing.wednesday,c.currency),thu:u(e.pricing.thursday,c.currency),fri:u(e.pricing.friday,c.currency),sat:u(e.pricing.saturday,c.currency),sun:u(e.pricing.sunday,c.currency)}}));const{bookingPresets:t}=V(),o=t.value.find(e=>e.id===c.bookingPreset);o&&(e.cancellationPolicyId=o.cancellationPolicyId,e.paymentTypeIds=[o.paymentTypeId])}return e}}}const x=(e,t)=>{const o=e.__vccOpts||e;for(const[a,n]of t)o[a]=n;return o},C={class:"progress-indicator"},D={class:"progress-indicator__track"},B={class:"progress-indicator__steps"},T=["onClick"],F={class:"progress-indicator__circle"},A={key:0,class:"progress-indicator__check"},O={key:1,class:"progress-indicator__number"},P={class:"progress-indicator__label"},I=x({__name:"ProgressIndicator",props:{currentStep:{type:Number,required:!0},totalSteps:{type:Number,required:!0},completedSteps:{type:Array,default:()=>[]}},emits:["step-click"],setup(a,{emit:n}){const i=a,l=n,r=e=>i.completedSteps.includes(e)?"completed":e===i.currentStep?"current":"upcoming",s=e=>i.completedSteps.includes(e)&&e!==i.currentStep,c=e.computed(()=>Array.from({length:i.totalSteps},(e,t)=>t+1).filter(e=>e!==t.NEXT_STEPS)),d=e.computed(()=>{const e=c.value.length,t=c.value.indexOf(i.currentStep);return-1===t?100:t/(e-1)*100});return(t,a)=>(e.openBlock(),e.createElementBlock("div",C,[e.createElementVNode("div",D,[e.createElementVNode("div",{class:"progress-indicator__fill",style:e.normalizeStyle({width:`${d.value}%`})},null,4)]),e.createElementVNode("div",B,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,t=>(e.openBlock(),e.createElementBlock("div",{key:t,class:e.normalizeClass(["progress-indicator__step",`progress-indicator__step--${r(t)}`,{"progress-indicator__step--clickable":s(t)}]),onClick:e=>(e=>{s(e)&&l("step-click",e)})(t)},[e.createElementVNode("div",F,["completed"===r(t)?(e.openBlock(),e.createElementBlock("span",A," ✓ ")):(e.openBlock(),e.createElementBlock("span",O,e.toDisplayString(t),1))]),e.createElementVNode("span",P,e.toDisplayString(e.unref(o)[t]),1)],10,T))),128))])]))}},[["__scopeId","data-v-2db801cd"]]),M=["type","disabled"],L={key:0,class:"base-button__spinner"},U=x({__name:"BaseButton",props:{variant:{type:String,default:"primary",validator:e=>["primary","secondary","outline","text"].includes(e)},size:{type:String,default:"md",validator:e=>["sm","md","lg"].includes(e)},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},block:{type:Boolean,default:!1},type:{type:String,default:"button"}},emits:["click"],setup(t,{emit:o}){const a=t,n=o,i=e=>{a.disabled||a.loading||n("click",e)};return(o,a)=>(e.openBlock(),e.createElementBlock("button",{type:t.type,class:e.normalizeClass(["base-button",`base-button--${t.variant}`,`base-button--${t.size}`,{"base-button--block":t.block,"base-button--loading":t.loading,"base-button--disabled":t.disabled}]),disabled:t.disabled||t.loading,onClick:i},[t.loading?(e.openBlock(),e.createElementBlock("span",L)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass({"base-button__content--loading":t.loading})},[e.renderSlot(o.$slots,"default",{},void 0,!0)],2)],10,M))}},[["__scopeId","data-v-b73e5047"]]),z={class:"step-wrapper"},R={class:"step-wrapper__content"},$={class:"step-wrapper__navigation"},q={key:1},j={key:0,class:"step-wrapper__overlay"},G=x({__name:"StepWrapper",props:{currentStep:{type:Number,required:!0},canProceed:{type:Boolean,default:!1},isLoading:{type:Boolean,default:!1},isFirstStep:{type:Boolean,default:!1},isLastStep:{type:Boolean,default:!1},nextButtonText:{type:String,default:null}},emits:["next","back"],setup(t,{emit:o}){const a={next:window.wp.i18n.__("Next","bookiflex"),back:window.wp.i18n.__("Back","bookiflex"),confirmAndComplete:window.wp.i18n.__("Confirm and complete","bookiflex")},n=t,i=o,l=e.computed(()=>n.nextButtonText?n.nextButtonText:n.isLastStep?a.confirmAndComplete:a.next),r=()=>{n.canProceed&&!n.isLoading&&i("next")},s=()=>{n.isLoading||i("back")};return(o,n)=>(e.openBlock(),e.createElementBlock("div",z,[e.createElementVNode("div",{class:e.normalizeClass(["step-wrapper__card",{"step-wrapper__card--loading":t.isLoading}])},[e.createElementVNode("div",R,[e.renderSlot(o.$slots,"default",{},void 0,!0)]),e.createElementVNode("div",$,[t.isFirstStep?(e.openBlock(),e.createElementBlock("div",q)):(e.openBlock(),e.createBlock(U,{key:0,variant:"outline",size:"lg",disabled:t.isLoading,onClick:s},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.back),1)]),_:1},8,["disabled"])),e.createVNode(U,{variant:"primary",size:"lg",disabled:!t.canProceed,loading:t.isLoading,onClick:r},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1},8,["disabled","loading"])]),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[t.isLoading?(e.openBlock(),e.createElementBlock("div",j,[...n[0]||(n[0]=[e.createElementVNode("div",{class:"step-wrapper__spinner"},[e.createElementVNode("svg",{viewBox:"0 0 50 50"},[e.createElementVNode("circle",{cx:"25",cy:"25",r:"20",fill:"none",stroke:"currentColor","stroke-width":"4"})])],-1)])])):e.createCommentVNode("",!0)]),_:1})],2)]))}},[["__scopeId","data-v-75824ef9"]]),W={class:"onboarding-container"},Y={class:"onboarding-content"},X={class:"modal-content modal-content--success"},K={class:"modal-title"},H={class:"modal-message"},Q={class:"modal-content modal-content--error"},Z={class:"modal-title"},J={class:"modal-message"},ee={class:"modal-actions"},te=x({__name:"OnboardingContainer",setup(o){const a={iUnderstandContinue:window.wp.i18n.__("I understand, continue","bookiflex"),setupComplete:window.wp.i18n.__("Setup complete!","bookiflex"),settingsSaved:window.wp.i18n.__("Your settings have been successfully saved. You can now start using BookiFlex.","bookiflex"),continue:window.wp.i18n.__("Continue","bookiflex"),submissionError:window.wp.i18n.__("Submission error","bookiflex"),cancel:window.wp.i18n.__("Cancel","bookiflex"),tryAgain:window.wp.i18n.__("Try again","bookiflex")},n=S(),i=e.ref(!1),l=e.ref(null),r=async()=>{n.currentStep.value===t.CONFIRMATION?await s():n.currentStep.value===t.NEXT_STEPS?m():n.nextStep()},s=async()=>{n.isLoading.value=!0,l.value=null;try{const e=n.getFinalData(),t=await g.submitOnboarding(e);if("success"!==t.status)throw new Error(t.result?.message||"Submission failed");t.result?.nextSteps&&(n.data.nextSteps=t.result.nextSteps),n.nextStep()}catch(e){l.value=e.message||"An error occurred while submitting data",console.error("Submission error:",e)}finally{n.isLoading.value=!1}},c=()=>{const e=n.currentStep.value-1;e>=1&&n.goToStep(e)},d=e.computed(()=>{const e=n.data.mode,o=n.currentStep.value;return o!==t.NEXT_STEPS&&("quick_setup"===e?o>t.WELCOME:"test_data"===e||"manual"===e?o===t.WELCOME:o>t.WELCOME)}),u=e=>{n.goToStep(e)},m=()=>{window.location.href=y.SETTINGS_URL};return(o,p)=>(e.openBlock(),e.createElementBlock("div",W,[e.createElementVNode("div",Y,[e.unref(n).currentStep.value!==e.unref(t).NEXT_STEPS?(e.openBlock(),e.createBlock(I,{key:0,"current-step":e.unref(n).currentStep.value,"total-steps":e.unref(n).totalSteps,"completed-steps":Array.from(e.unref(n).completedSteps),onStepClick:u},null,8,["current-step","total-steps","completed-steps"])):e.createCommentVNode("",!0),e.createVNode(G,{"current-step":e.unref(n).currentStep.value,"can-proceed":e.unref(n).canProceed.value,"is-loading":e.unref(n).isLoading.value,"is-first-step":!d.value,"is-last-step":e.unref(n).currentStep.value===e.unref(t).CONFIRMATION,"next-button-text":e.unref(n).currentStep.value===e.unref(t).NEXT_STEPS?a.iUnderstandContinue:void 0,onNext:r,onBack:c},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default",{state:e.unref(n)},void 0,!0)]),_:3},8,["current-step","can-proceed","is-loading","is-first-step","is-last-step","next-button-text"])]),e.createVNode(e.Transition,{name:"modal"},{default:e.withCtx(()=>[i.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"modal-overlay",onClick:e.withModifiers(m,["self"])},[e.createElementVNode("div",X,[p[2]||(p[2]=e.createElementVNode("div",{class:"modal-icon modal-icon--success"},[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9 12L11 14L15 10M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),e.createElementVNode("h2",K,e.toDisplayString(a.setupComplete),1),e.createElementVNode("p",H,e.toDisplayString(a.settingsSaved),1),e.createVNode(U,{variant:"primary",size:"lg",block:"",onClick:m},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.continue),1)]),_:1})])])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"modal"},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"modal-overlay",onClick:p[1]||(p[1]=e.withModifiers(e=>l.value=null,["self"]))},[e.createElementVNode("div",Q,[p[3]||(p[3]=e.createElementVNode("div",{class:"modal-icon modal-icon--error"},[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M12 8V12M12 16H12.01M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),e.createElementVNode("h2",Z,e.toDisplayString(a.submissionError),1),e.createElementVNode("p",J,e.toDisplayString(l.value),1),e.createElementVNode("div",ee,[e.createVNode(U,{variant:"outline",size:"lg",onClick:p[0]||(p[0]=e=>l.value=null)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.cancel),1)]),_:1}),e.createVNode(U,{variant:"primary",size:"lg",onClick:s},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.tryAgain),1)]),_:1})])])])):e.createCommentVNode("",!0)]),_:1})]))}},[["__scopeId","data-v-0b4a88fb"]]),oe={key:0,class:"base-card__header"},ae={class:"base-card__title"},ne={class:"base-card__body"},ie={key:1,class:"base-card__footer"},le=x({__name:"BaseCard",props:{title:{type:String,default:""},padding:{type:String,default:"md",validator:e=>["none","sm","md","lg"].includes(e)},hoverable:{type:Boolean,default:!1},bordered:{type:Boolean,default:!0},shadow:{type:Boolean,default:!0}},setup:t=>(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["base-card",`base-card--padding-${t.padding}`,{"base-card--hoverable":t.hoverable,"base-card--bordered":t.bordered,"base-card--shadow":t.shadow}])},[t.title||o.$slots.header?(e.openBlock(),e.createElementBlock("div",oe,[e.renderSlot(o.$slots,"header",{},()=>[e.createElementVNode("h3",ae,e.toDisplayString(t.title),1)],!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",ne,[e.renderSlot(o.$slots,"default",{},void 0,!0)]),o.$slots.footer?(e.openBlock(),e.createElementBlock("div",ie,[e.renderSlot(o.$slots,"footer",{},void 0,!0)])):e.createCommentVNode("",!0)],2))},[["__scopeId","data-v-30ef12cc"]]),re={class:"welcome-step"},se={class:"welcome-step__header"},ce={class:"welcome-step__title"},de={class:"welcome-step__description"},ue={class:"welcome-step__section"},me={class:"welcome-step__section-title"},pe={class:"welcome-step__modes"},ye={class:"mode-card__content"},_e={class:"mode-card__radio"},ge={class:"mode-card__info"},he={class:"mode-card__header"},fe={class:"mode-card__title"},ve={key:0,class:"mode-card__badge"},we={class:"mode-card__description"},be={class:"welcome-step__info"},ke={class:"welcome-step__info-content"},Ne={key:0},Ee={key:1},Ve={key:2},Se={key:3},xe=x({__name:"WelcomeStep",props:{state:{type:Object,required:!0}},setup(t){const o={welcomeTitle:window.wp.i18n.__("How would you like to get started?","bookiflex"),welcomeDescription:window.wp.i18n.__("In just a few minutes, guests will be able to check availability and book online through your website.","bookiflex"),welcomeDescription2:window.wp.i18n.__("","bookiflex"),chooseSetupMethod:window.wp.i18n.__("Choose setup method","bookiflex"),recommended:window.wp.i18n.__("Recommended","bookiflex"),important:window.wp.i18n.__("Important:","bookiflex"),quickSetupInfo:window.wp.i18n.__("You will go through a short survey to set up basic parameters. This will only take a few minutes.","bookiflex"),testDataInfo:window.wp.i18n.__("Demo data will be loaded. You can change it later in settings.","bookiflex"),manualSetupInfo:window.wp.i18n.__("You can configure all parameters manually later through the control panel.","bookiflex"),chooseOptionInfo:window.wp.i18n.__("Choose one of the options above to continue.","bookiflex")},a=t,l=e.ref(a.state.data.mode||n.QUICK_SETUP);return e.watch(l,()=>{a.state.updateStepData(1,{mode:l.value})},{immediate:!0}),a.state.data.mode&&(l.value=a.state.data.mode),(t,a)=>(e.openBlock(),e.createElementBlock("div",re,[e.createElementVNode("div",se,[e.createElementVNode("h2",ce,e.toDisplayString(o.welcomeTitle),1),e.createElementVNode("p",de,e.toDisplayString(o.welcomeDescription),1)]),e.createElementVNode("div",ue,[e.createElementVNode("h2",me,e.toDisplayString(o.chooseSetupMethod),1),e.createElementVNode("div",pe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(i),t=>(e.openBlock(),e.createBlock(le,{key:t.value,class:e.normalizeClass(["mode-card",{"mode-card--selected":l.value===t.value}]),padding:"md",hoverable:"",onClick:e=>{return o=t.value,void(l.value=o);var o}},{default:e.withCtx(()=>[e.createElementVNode("div",ye,[e.createElementVNode("div",_e,[e.createElementVNode("span",{class:e.normalizeClass(["mode-card__radio-circle",{"mode-card__radio-circle--active":l.value===t.value}])},[...a[0]||(a[0]=[e.createElementVNode("span",{class:"mode-card__radio-dot"},null,-1)])],2)]),e.createElementVNode("div",ge,[e.createElementVNode("div",he,[e.createElementVNode("h3",fe,e.toDisplayString(t.label),1),t.recommended?(e.openBlock(),e.createElementBlock("span",ve,e.toDisplayString(o.recommended),1)):e.createCommentVNode("",!0)]),e.createElementVNode("p",we,e.toDisplayString(t.description),1)])])]),_:2},1032,["class","onClick"]))),128))])]),a[2]||(a[2]=e.createElementVNode("div",{class:"separator-line"},null,-1)),e.createElementVNode("div",be,[a[1]||(a[1]=e.createElementVNode("div",{class:"welcome-step__info-icon"},[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"2"}),e.createElementVNode("path",{d:"M12 16V12M12 8H12.01",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"})])],-1)),e.createElementVNode("div",ke,[e.createElementVNode("strong",null,e.toDisplayString(o.important),1),l.value===e.unref(n).QUICK_SETUP?(e.openBlock(),e.createElementBlock("span",Ne,e.toDisplayString(o.quickSetupInfo),1)):l.value===e.unref(n).TEST_DATA?(e.openBlock(),e.createElementBlock("span",Ee,e.toDisplayString(o.testDataInfo),1)):l.value===e.unref(n).MANUAL?(e.openBlock(),e.createElementBlock("span",Ve,e.toDisplayString(o.manualSetupInfo),1)):(e.openBlock(),e.createElementBlock("span",Se,e.toDisplayString(o.chooseOptionInfo),1))])])]))}},[["__scopeId","data-v-9008fdec"]]),Ce={class:"base-input"},De={key:0,class:"base-input__label"},Be={key:0,class:"base-input__required"},Te=["type","value","placeholder","disabled"],Fe={key:1,class:"base-input__help"},Ae={key:2,class:"base-input__error"},Oe=x({__name:"BaseInput",props:{modelValue:{type:[String,Number],default:""},type:{type:String,default:"text"},label:{type:String,default:""},placeholder:{type:String,default:""},error:{type:String,default:""},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},helpText:{type:String,default:""},size:{type:String,default:"md",validator:e=>["sm","md","lg"].includes(e)}},emits:["update:modelValue","blur","focus"],setup(t,{emit:o}){const a=o,n=e=>{a("update:modelValue",e.target.value)},i=e=>{a("blur",e)},l=e=>{a("focus",e)};return(o,a)=>(e.openBlock(),e.createElementBlock("div",Ce,[t.label?(e.openBlock(),e.createElementBlock("label",De,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",Be,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("input",{type:t.type,value:t.modelValue,placeholder:t.placeholder,disabled:t.disabled,class:e.normalizeClass(["base-input__field",`base-input__field--${t.size}`,{"base-input__field--error":t.error,"base-input__field--disabled":t.disabled}]),onInput:n,onBlur:i,onFocus:l},null,42,Te),t.helpText&&!t.error?(e.openBlock(),e.createElementBlock("span",Fe,e.toDisplayString(t.helpText),1)):e.createCommentVNode("",!0),t.error?(e.openBlock(),e.createElementBlock("span",Ae,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)]))}},[["__scopeId","data-v-c7353a5f"]]),Pe={class:"base-select"},Ie={key:0,class:"base-select__label"},Me={key:0,class:"base-select__required"},Le={class:"base-select__wrapper"},Ue=["value","disabled"],ze={value:"",disabled:""},Re=["value"],$e={key:1,class:"base-select__error"},qe=x({__name:"BaseSelect",props:{modelValue:{type:[String,Number],default:""},label:{type:String,default:""},options:{type:Array,required:!0,default:()=>[]},placeholder:{type:String,default:"Select..."},error:{type:String,default:""},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},size:{type:String,default:"md",validator:e=>["sm","md","lg"].includes(e)}},emits:["update:modelValue","change"],setup(t,{emit:o}){const a=o,n=e=>{const t=e.target.value;a("update:modelValue",t),a("change",t)};return(o,a)=>(e.openBlock(),e.createElementBlock("div",Pe,[t.label?(e.openBlock(),e.createElementBlock("label",Ie,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",Me,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Le,[e.createElementVNode("select",{value:t.modelValue,disabled:t.disabled,class:e.normalizeClass(["base-select__field",`base-select__field--${t.size}`,{"base-select__field--error":t.error,"base-select__field--disabled":t.disabled}]),onChange:n},[e.createElementVNode("option",ze,e.toDisplayString(t.placeholder),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,t=>(e.openBlock(),e.createElementBlock("option",{key:t.value,value:t.value},e.toDisplayString(t.label),9,Re))),128))],42,Ue),a[0]||(a[0]=e.createElementVNode("svg",{class:"base-select__icon",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1))]),t.error?(e.openBlock(),e.createElementBlock("span",$e,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)]))}},[["__scopeId","data-v-791b5fd4"]]),je={class:"company-info-step"},Ge={class:"company-info-step__header"},We={class:"company-info-step__title"},Ye={class:"company-info-step__description"},Xe={class:"company-info-step__form"},Ke={class:"company-info-step__currency"},He={class:"company-info-step__currency-description"},Qe={__name:"CompanyInfoStep",props:{state:{type:Object,required:!0}},setup(t){const o={title:window.wp.i18n.__("Company Information","bookiflex"),description:window.wp.i18n.__("Enter the details of the company or person operating the rental properties. This information will be used in booking confirmations, invoices, and guest communication.","bookiflex"),companyName:window.wp.i18n.__("Company name","bookiflex"),companyNamePlaceholder:window.wp.i18n.__("Legal or trading name...","bookiflex"),companyAddress:window.wp.i18n.__("Address","bookiflex"),companyAddressPlaceholder:window.wp.i18n.__("Office or registered address...","bookiflex"),companyPhone:window.wp.i18n.__("Phone","bookiflex"),companyPhonePlaceholder:window.wp.i18n.__("Contact phone number...","bookiflex"),companyEmail:window.wp.i18n.__("Email","bookiflex"),companyEmailPlaceholder:window.wp.i18n.__("Contact email address...","bookiflex"),currency:window.wp.i18n.__("Currency","bookiflex"),currencyPlaceholder:window.wp.i18n.__("Select currency...","bookiflex"),currencyDescription:window.wp.i18n.__("Select the currency to be used for prices and calculations","bookiflex")},a=t,{currencies:n}=V(),i=e.ref(a.state.data.companyName||""),l=e.ref(a.state.data.companyAddress||""),r=e.ref(a.state.data.companyPhone||""),s=e.ref(a.state.data.companyEmail||""),c=e.ref(a.state.data.currency||""),d=e.reactive({companyName:!1,companyAddress:!1,companyEmail:!1,currency:!1}),u=e=>{d[e]=!0},m=e.computed(()=>{const e=a.state.validateCurrentStep().errors,t={};for(const o of Object.keys(e))d[o]&&(t[o]=e[o]);return t});return e.watch([i,l,r,s,c],()=>{a.state.updateStepData(2,{companyName:i.value,companyAddress:l.value,companyPhone:r.value,companyEmail:s.value,currency:c.value})},{immediate:!0}),(t,a)=>(e.openBlock(),e.createElementBlock("div",je,[e.createElementVNode("div",Ge,[e.createElementVNode("h2",We,e.toDisplayString(o.title),1),e.createElementVNode("p",Ye,e.toDisplayString(o.description),1)]),e.createVNode(le,{padding:"lg"},{default:e.withCtx(()=>[e.createElementVNode("div",Xe,[e.createVNode(Oe,{modelValue:i.value,"onUpdate:modelValue":a[0]||(a[0]=e=>i.value=e),label:o.companyName,placeholder:o.companyNamePlaceholder,error:m.value.companyName,required:"",size:"lg",onBlur:a[1]||(a[1]=e=>u("companyName"))},null,8,["modelValue","label","placeholder","error"]),e.createVNode(Oe,{modelValue:l.value,"onUpdate:modelValue":a[2]||(a[2]=e=>l.value=e),label:o.companyAddress,placeholder:o.companyAddressPlaceholder,error:m.value.companyAddress,required:"",size:"lg",onBlur:a[3]||(a[3]=e=>u("companyAddress"))},null,8,["modelValue","label","placeholder","error"]),e.createVNode(Oe,{modelValue:r.value,"onUpdate:modelValue":a[4]||(a[4]=e=>r.value=e),label:o.companyPhone,placeholder:o.companyPhonePlaceholder,type:"tel",size:"lg"},null,8,["modelValue","label","placeholder"]),e.createVNode(Oe,{modelValue:s.value,"onUpdate:modelValue":a[5]||(a[5]=e=>s.value=e),label:o.companyEmail,placeholder:o.companyEmailPlaceholder,error:m.value.companyEmail,type:"email",required:"",size:"lg",onBlur:a[6]||(a[6]=e=>u("companyEmail"))},null,8,["modelValue","label","placeholder","error"]),e.createElementVNode("div",Ke,[e.createElementVNode("p",He,e.toDisplayString(o.currencyDescription),1),e.createVNode(qe,{modelValue:c.value,"onUpdate:modelValue":a[7]||(a[7]=e=>c.value=e),options:e.unref(n),label:o.currency,placeholder:o.currencyPlaceholder,error:m.value.currency,required:"",size:"lg"},null,8,["modelValue","options","label","placeholder","error"])])])]),_:1})]))}},Ze=x(Qe,[["__scopeId","data-v-760138f2"]]);var Je,et;!function(e){e.symbol="symbol",e.narrowSymbol="narrowSymbol",e.code="code",e.name="name",e.hidden="hidden"}(Je||(Je={})),function(e){e.precision="precision",e.thousands="thousands",e.tenThousands="tenThousands",e.millions="millions",e.billions="billions"}(et||(et={}));const tt=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),ot=e=>e.replace(/^0+(0$|[^0])/,"$1"),at=(e,t)=>(e.match(new RegExp(tt(t),"g"))||[]).length,nt=[",",".","٫","。"],it="(0|[1-9]\\d*)";class lt{constructor(e){var t,o,a,n,i,l;const{currency:r,currencyDisplay:s,locale:c,precision:d,accountingSign:u,useGrouping:m}=e;this.locale=c,this.options={currency:r,useGrouping:m,style:"currency",currencySign:u?"accounting":void 0,currencyDisplay:s!==Je.hidden?s:void 0};const p=new Intl.NumberFormat(c,this.options),y=p.formatToParts(123456);this.currency=null===(t=y.find(({type:e})=>"currency"===e))||void 0===t?void 0:t.value,this.digits=[0,1,2,3,4,5,6,7,8,9].map(e=>e.toLocaleString(c)),this.decimalSymbol=null===(o=y.find(({type:e})=>"decimal"===e))||void 0===o?void 0:o.value,this.groupingSymbol=null===(a=y.find(({type:e})=>"group"===e))||void 0===a?void 0:a.value,this.minusSign=null===(n=p.formatToParts(-1).find(({type:e})=>"minusSign"===e))||void 0===n?void 0:n.value,void 0===this.decimalSymbol?this.minimumFractionDigits=this.maximumFractionDigits=0:"number"==typeof d?this.minimumFractionDigits=this.maximumFractionDigits=d:(this.minimumFractionDigits=null!==(i=null==d?void 0:d.min)&&void 0!==i?i:p.resolvedOptions().minimumFractionDigits,this.maximumFractionDigits=null!==(l=null==d?void 0:d.max)&&void 0!==l?l:p.resolvedOptions().maximumFractionDigits);const _=e=>((e,t)=>e.substring(0,e.indexOf(t)))(e,this.digits[1]),g=e=>e.substring(e.lastIndexOf(this.decimalSymbol?this.digits[0]:this.digits[1])+1);this.prefix=_(p.format(1)),this.suffix=g(p.format(1)),this.negativePrefix=_(p.format(-1)),this.negativeSuffix=g(p.format(-1))}parse(e){if(e){const t=this.isNegative(e);e=this.normalizeDigits(e),e=this.stripCurrency(e,t),e=this.stripSignLiterals(e);const o=this.decimalSymbol?`(?:${tt(this.decimalSymbol)}(\\d*))?`:"",a=this.stripGroupingSeparator(e).match(new RegExp(`^${it}${o}$`));if(a&&this.isValidIntegerFormat(this.decimalSymbol?e.split(this.decimalSymbol)[0]:e,Number(a[1])))return Number(`${t?"-":""}${this.onlyDigits(a[1])}.${this.onlyDigits(a[2]||"")}`)}return null}isValidIntegerFormat(e,t){const o={...this.options,minimumFractionDigits:0};return[this.stripCurrency(this.normalizeDigits(t.toLocaleString(this.locale,{...o,useGrouping:!0})),!1),this.stripCurrency(this.normalizeDigits(t.toLocaleString(this.locale,{...o,useGrouping:!1})),!1)].includes(e)}format(e,t={minimumFractionDigits:this.minimumFractionDigits,maximumFractionDigits:this.maximumFractionDigits}){return null!=e?e.toLocaleString(this.locale,{...this.options,...t}):""}toFraction(e){return`${this.digits[0]}${this.decimalSymbol}${this.onlyLocaleDigits(e.substring(1)).substring(0,this.maximumFractionDigits)}`}isFractionIncomplete(e){return!!this.normalizeDigits(this.stripGroupingSeparator(e)).match(new RegExp(`^${it}${tt(this.decimalSymbol)}$`))}isNegative(e){return e.startsWith(this.negativePrefix)||void 0===this.minusSign&&(e.startsWith("(")||e.startsWith("-"))||void 0!==this.minusSign&&e.replace("-",this.minusSign).startsWith(this.minusSign)}insertCurrency(e,t){return`${t?this.negativePrefix:this.prefix}${e}${t?this.negativeSuffix:this.suffix}`}stripGroupingSeparator(e){return void 0!==this.groupingSymbol?e.replace(new RegExp(tt(this.groupingSymbol),"g"),""):e}stripSignLiterals(e){return void 0!==this.minusSign?e.replace("-",this.minusSign).replace(this.minusSign,""):e.replace(/[-()]/g,"")}stripCurrency(e,t){return e.replace(t?this.negativePrefix:this.prefix,"").replace(t?this.negativeSuffix:this.suffix,"")}normalizeDecimalSeparator(e,t){return nt.forEach(o=>{e=e.substring(0,t)+e.substring(t).replace(o,this.decimalSymbol)}),e}normalizeDigits(e){return"0"!==this.digits[0]&&this.digits.forEach((t,o)=>{e=e.replace(new RegExp(t,"g"),String(o))}),e}onlyDigits(e){return this.normalizeDigits(e).replace(/\D+/g,"")}onlyLocaleDigits(e){return e.replace(new RegExp(`[^${this.digits.join("")}]*`,"g"),"")}}class rt{constructor(e){this.currencyFormat=e}}class st extends rt{conformToMask(e,t=""){const o=this.currencyFormat.isNegative(e),a=e=>""===e&&o&&!(void 0===this.currencyFormat.minusSign?t===this.currencyFormat.negativePrefix+this.currencyFormat.negativeSuffix:t===this.currencyFormat.negativePrefix);let n=e;n=this.currencyFormat.stripCurrency(n,o),n=this.currencyFormat.stripSignLiterals(n);const i=(e=>{if(a(e))return"";if(this.currencyFormat.maximumFractionDigits>0){if(this.currencyFormat.isFractionIncomplete(e))return e;if(e.startsWith(this.currencyFormat.decimalSymbol))return this.currencyFormat.toFraction(e)}return null})(n);if(null!=i)return this.currencyFormat.insertCurrency(i,o);const[l,...r]=n.split(this.currencyFormat.decimalSymbol),s=ot(this.currencyFormat.onlyDigits(l)),c=this.currencyFormat.onlyDigits(r.join("")).substring(0,this.currencyFormat.maximumFractionDigits),d=r.length>0&&0===c.length,u=""===s&&o&&(void 0===this.currencyFormat.minusSign?t===e.slice(0,-2)+this.currencyFormat.negativeSuffix:t===e.slice(0,-1));return d||u||a(s)?t:s.match(/\d+/)?{numberValue:Number(`${o?"-":""}${s}.${c}`),fractionDigits:c}:""}}class ct extends rt{conformToMask(e,t=""){if(""===e||e===this.currencyFormat.decimalSymbol||0===this.currencyFormat.parse(t)&&this.currencyFormat.stripCurrency(t,!0).slice(0,-1)===this.currencyFormat.stripCurrency(e,!0))return"";const o=this.currencyFormat.isNegative(e),a=""===this.currencyFormat.stripSignLiterals(e)?-0:Number(`${o?"-":""}${ot(this.currencyFormat.onlyDigits(e))}`)/Math.pow(10,this.currencyFormat.maximumFractionDigits);return{numberValue:a,fractionDigits:a.toFixed(this.currencyFormat.maximumFractionDigits).slice(-this.currencyFormat.maximumFractionDigits)}}}const dt={locale:void 0,currency:void 0,currencyDisplay:void 0,hideGroupingSeparatorOnFocus:!0,hideCurrencySymbolOnFocus:!0,hideNegligibleDecimalDigitsOnFocus:!0,precision:void 0,autoDecimalDigits:!1,valueRange:void 0,useGrouping:void 0,valueScaling:void 0};let ut=class{constructor(e){this.el=e.el,this.onInput=e.onInput,this.onChange=e.onChange,this.addEventListener(),this.init(e.options)}setOptions(e){this.init(e),this.format(this.currencyFormat.format(this.validateValueRange(this.numberValue))),this.onChange(this.getValue())}getValue(){return{number:this.valueScaling&&null!=this.numberValue?this.toInteger(this.numberValue,this.valueScaling):this.numberValue,formatted:this.formattedValue}}setValue(e){const t=void 0!==this.valueScaling&&null!=e?this.toFloat(e,this.valueScaling):e;t!==this.numberValue&&(this.format(this.currencyFormat.format(this.validateValueRange(t))),this.onChange(this.getValue()))}init(e){this.options={...dt,...e},this.options.autoDecimalDigits&&(this.options.hideNegligibleDecimalDigitsOnFocus=!1),this.el.getAttribute("inputmode")||this.el.setAttribute("inputmode",this.options.autoDecimalDigits?"numeric":"decimal"),this.currencyFormat=new lt(this.options),this.numberMask=this.options.autoDecimalDigits?new ct(this.currencyFormat):new st(this.currencyFormat);const t={[et.precision]:this.currencyFormat.maximumFractionDigits,[et.thousands]:3,[et.tenThousands]:4,[et.millions]:6,[et.billions]:9};this.valueScaling=this.options.valueScaling?t[this.options.valueScaling]:void 0,this.valueScalingFractionDigits=void 0!==this.valueScaling&&this.options.valueScaling!==et.precision?this.valueScaling+this.currencyFormat.maximumFractionDigits:this.currencyFormat.maximumFractionDigits,this.minValue=this.getMinValue(),this.maxValue=this.getMaxValue()}getMinValue(){var e,t;let o=this.toFloat(-Number.MAX_SAFE_INTEGER);return void 0!==(null===(e=this.options.valueRange)||void 0===e?void 0:e.min)&&(o=Math.max(null===(t=this.options.valueRange)||void 0===t?void 0:t.min,this.toFloat(-Number.MAX_SAFE_INTEGER))),o}getMaxValue(){var e,t;let o=this.toFloat(Number.MAX_SAFE_INTEGER);return void 0!==(null===(e=this.options.valueRange)||void 0===e?void 0:e.max)&&(o=Math.min(null===(t=this.options.valueRange)||void 0===t?void 0:t.max,this.toFloat(Number.MAX_SAFE_INTEGER))),o}toFloat(e,t){return e/Math.pow(10,null!=t?t:this.valueScalingFractionDigits)}toInteger(e,t){return Number(e.toFixed(null!=t?t:this.valueScalingFractionDigits).split(".").join(""))}validateValueRange(e){return null!=e?Math.min(Math.max(e,this.minValue),this.maxValue):e}format(e,t=!1){if(null!=e){void 0!==this.decimalSymbolInsertedAt&&(e=this.currencyFormat.normalizeDecimalSeparator(e,this.decimalSymbolInsertedAt),this.decimalSymbolInsertedAt=void 0);const o=this.numberMask.conformToMask(e,this.formattedValue);let a;if("object"==typeof o){const{numberValue:e,fractionDigits:n}=o;let{maximumFractionDigits:i,minimumFractionDigits:l}=this.currencyFormat;this.focus?l=t?n.replace(/0+$/,"").length:Math.min(i,n.length):!Number.isInteger(e)||this.options.autoDecimalDigits||void 0!==this.options.precision&&0!==l||(l=i=0),a=this.toInteger(Math.abs(e))>Number.MAX_SAFE_INTEGER?this.formattedValue:this.currencyFormat.format(e,{useGrouping:!1!==this.options.useGrouping&&!(this.focus&&this.options.hideGroupingSeparatorOnFocus),minimumFractionDigits:l,maximumFractionDigits:i})}else a=o;this.maxValue<=0&&!this.currencyFormat.isNegative(a)&&0!==this.currencyFormat.parse(a)&&(a=a.replace(this.currencyFormat.prefix,this.currencyFormat.negativePrefix)),this.minValue>=0&&(a=a.replace(this.currencyFormat.negativePrefix,this.currencyFormat.prefix)),(this.options.currencyDisplay===Je.hidden||this.focus&&this.options.hideCurrencySymbolOnFocus)&&(a=a.replace(this.currencyFormat.negativePrefix,void 0!==this.currencyFormat.minusSign?this.currencyFormat.minusSign:"(").replace(this.currencyFormat.negativeSuffix,void 0!==this.currencyFormat.minusSign?"":")").replace(this.currencyFormat.prefix,"").replace(this.currencyFormat.suffix,"")),this.el.value=a,this.numberValue=this.currencyFormat.parse(a)}else this.el.value="",this.numberValue=null;this.formattedValue=this.el.value,this.onInput(this.getValue())}addEventListener(){this.el.addEventListener("input",e=>{const{value:t,selectionStart:o}=this.el,a=e;if(o&&a.data&&nt.includes(a.data)&&(this.decimalSymbolInsertedAt=o-1),this.format(t),this.focus&&null!=o){const e=()=>{const{prefix:e,suffix:a,decimalSymbol:n,maximumFractionDigits:i,groupingSymbol:l}=this.currencyFormat;let r=t.length-o;const s=this.formattedValue.length;if(void 0===this.currencyFormat.minusSign&&(t.startsWith("(")||t.startsWith("-"))&&!t.endsWith(")"))return s-this.currencyFormat.negativeSuffix.length>1?this.formattedValue.substring(o).length:1;if(this.formattedValue.substring(o,1)===l&&at(this.formattedValue,l)===at(t,l)+1)return s-r-1;if(s<r)return o;if(void 0!==n&&-1!==t.indexOf(n)){const e=t.indexOf(n)+1;if(Math.abs(s-t.length)>1&&o<=e)return this.formattedValue.indexOf(n)+1;!this.options.autoDecimalDigits&&o>e&&this.currencyFormat.onlyDigits(t.substring(e)).length-1===i&&(r-=1)}return this.options.hideCurrencySymbolOnFocus||this.options.currencyDisplay===Je.hidden?s-r:Math.max(s-Math.max(r,a.length),e.length)};this.setCaretPosition(e())}}),this.el.addEventListener("focus",()=>{this.focus=!0,this.numberValueOnFocus=this.numberValue,setTimeout(()=>{const{value:e,selectionStart:t,selectionEnd:o}=this.el;if(this.format(e,this.options.hideNegligibleDecimalDigitsOnFocus),null!=t&&null!=o&&Math.abs(t-o)>0)this.setCaretPosition(0,this.el.value.length);else if(null!=t){const o=this.getCaretPositionOnFocus(e,t);this.setCaretPosition(o)}})}),this.el.addEventListener("blur",()=>{this.focus=!1,this.format(this.currencyFormat.format(this.validateValueRange(this.numberValue))),this.numberValueOnFocus!==this.numberValue&&this.onChange(this.getValue())})}getCaretPositionOnFocus(e,t){if(null==this.numberValue)return t;const{prefix:o,negativePrefix:a,suffix:n,negativeSuffix:i,groupingSymbol:l,currency:r}=this.currencyFormat,s=this.numberValue<0,c=s?a:o,d=c.length;if(this.options.hideCurrencySymbolOnFocus||this.options.currencyDisplay===Je.hidden){if(s){if(t<=1)return 1;if(e.endsWith(")")&&t>e.indexOf(")"))return this.formattedValue.length-1}}else{const o=s?i.length:n.length;if(t>=e.length-o)return this.formattedValue.length-o;if(t<d)return d}let u=t;return this.options.hideCurrencySymbolOnFocus&&this.options.currencyDisplay!==Je.hidden&&t>=d&&void 0!==r&&c.includes(r)&&(u-=d,s&&(u+=1)),this.options.hideGroupingSeparatorOnFocus&&void 0!==l&&(u-=at(e.substring(0,t),l)),u}setCaretPosition(e,t=e){this.el.setSelectionRange(e,t)}};const mt={class:"currency-input"},pt={key:0,class:"currency-input__label"},yt={key:0,class:"currency-input__required"},_t=["placeholder","disabled"],gt={key:1,class:"currency-input__error"},ht=x({__name:"CurrencyInput",props:{modelValue:{type:[String,Number],default:""},currency:{type:String,default:"USD"},label:{type:String,default:""},placeholder:{type:String,default:"0"},error:{type:String,default:""},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},size:{type:String,default:"md",validator:e=>["sm","md","lg"].includes(e)}},emits:["update:modelValue","blur","focus"],setup(t,{emit:o}){const a=t,n=o,{inputRef:i,numberValue:l,setValue:r}=function(t,o){var a,n,i,l;let r;const s=e.ref(null),c=e.ref(null),d=e.ref(null),u=e.getCurrentInstance(),m=(null==u?void 0:u.emit)||(null===(n=null===(a=null==u?void 0:u.proxy)||void 0===a?void 0:a.$emit)||void 0===n?void 0:n.bind(null==u?void 0:u.proxy)),p=(null==u?void 0:u.props)||(null===(i=null==u?void 0:u.proxy)||void 0===i?void 0:i.$props),y=e.version.startsWith("3"),_=y&&(null===(l=null==u?void 0:u.attrs.modelModifiers)||void 0===l?void 0:l.lazy),g=e.computed(()=>null==p?void 0:p[y?"modelValue":"value"]),h=y?"update:modelValue":"input",f=_?"update:modelValue":"change";return e.watch(s,e=>{var a;if(e){const n=(e=>(null==e?void 0:e.matches("input"))?e:null==e?void 0:e.querySelector("input"))(null!==(a=null==e?void 0:e.$el)&&void 0!==a?a:e);n?(r=new ut({el:n,options:t,onInput:e=>{_||!1===o||g.value===e.number||null==m||m(h,e.number),d.value=e.number,c.value=e.formatted},onChange:e=>{null==m||m(f,e.number)}}),r.setValue(g.value)):console.error('No input element found. Please make sure that the "inputRef" template ref is properly assigned.')}else r=null}),{inputRef:s,numberValue:d,formattedValue:c,setValue:e=>null==r?void 0:r.setValue(e),setOptions:e=>null==r?void 0:r.setOptions(e)}}({currency:a.currency,locale:"en-US",currencyDisplay:"hidden",precision:void 0,valueRange:{min:0},autoDecimalDigits:!1,hideCurrencySymbolOnFocus:!0,hideGroupingSeparatorOnFocus:!0,hideNegligibleDecimalDigitsOnFocus:!1});e.watch(l,e=>{n("update:modelValue",e)}),e.watch(()=>a.modelValue,e=>{e!==l.value&&r(e)},{immediate:!0}),e.watch(()=>a.currency,e=>{});const s=e=>{n("blur",e)},c=e=>{n("focus",e)};return(o,a)=>(e.openBlock(),e.createElementBlock("div",mt,[t.label?(e.openBlock(),e.createElementBlock("label",pt,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",yt,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("input",{ref_key:"inputRef",ref:i,type:"text",placeholder:t.placeholder,disabled:t.disabled,class:e.normalizeClass(["currency-input__field",`currency-input__field--${t.size}`,{"currency-input__field--error":t.error,"currency-input__field--disabled":t.disabled}]),onBlur:s,onFocus:c},null,42,_t),t.error?(e.openBlock(),e.createElementBlock("span",gt,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)]))}},[["__scopeId","data-v-115aa416"]]),ft=["checked","disabled","value"],vt={key:0,class:"base-checkbox__content"},wt={key:0,class:"base-checkbox__label"},bt={key:1,class:"base-checkbox__description"},kt=x({__name:"BaseCheckbox",props:{modelValue:{type:[Boolean,Array],default:!1},label:{type:String,default:""},value:{type:[String,Number,Boolean],default:null},disabled:{type:Boolean,default:!1},description:{type:String,default:""}},emits:["update:modelValue","change"],setup(t,{emit:o}){const a=t,n=o,i=e=>{const t=e.target.checked;if(Array.isArray(a.modelValue)){const e=[...a.modelValue];if(t)e.push(a.value);else{const t=e.indexOf(a.value);t>-1&&e.splice(t,1)}n("update:modelValue",e),n("change",e)}else n("update:modelValue",t),n("change",t)};return(o,n)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["base-checkbox",{"base-checkbox--disabled":t.disabled}])},[e.createElementVNode("input",{type:"checkbox",checked:Array.isArray(a.modelValue)?a.modelValue.includes(a.value):a.modelValue,disabled:t.disabled,value:t.value,class:"base-checkbox__input",onChange:i},null,40,ft),n[0]||(n[0]=e.createElementVNode("span",{class:"base-checkbox__box"},[e.createElementVNode("svg",{class:"base-checkbox__icon",viewBox:"0 0 16 16",fill:"none"},[e.createElementVNode("path",{d:"M13.5 4L6 11.5L2.5 8",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),t.label||t.description?(e.openBlock(),e.createElementBlock("span",vt,[t.label?(e.openBlock(),e.createElementBlock("span",wt,e.toDisplayString(t.label),1)):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createElementBlock("span",bt,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))}},[["__scopeId","data-v-b5d59d26"]]),Nt={class:"week-pricing"},Et={class:"week-pricing__header"},Vt={class:"week-pricing__label"},St={key:0,class:"week-pricing__same"},xt={key:1,class:"week-pricing__grid"},Ct={key:2,class:"week-pricing__error"},Dt=x({__name:"WeekPricing",props:{modelValue:{type:Object,default:()=>({})},currency:{type:String,default:"USD"},error:{type:String,default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:o}){const a={pricing:window.wp.i18n.__("Pricing","bookiflex"),samePriceAllDays:window.wp.i18n.__("Same price for all days","bookiflex"),pricePerNight:window.wp.i18n.__("Price per night","bookiflex"),differentPrices:window.wp.i18n.__("Different prices for days of the week","bookiflex")},n=t,i=o,l=e.ref(!1),s=e.ref(""),c=e.ref({monday:n.modelValue.monday||"",tuesday:n.modelValue.tuesday||"",wednesday:n.modelValue.wednesday||"",thursday:n.modelValue.thursday||"",friday:n.modelValue.friday||"",saturday:n.modelValue.saturday||"",sunday:n.modelValue.sunday||""});e.watch(l,e=>{e&&s.value&&(r.forEach(e=>{c.value[e.key]=s.value}),d())}),e.watch(s,e=>{l.value&&(r.forEach(t=>{c.value[t.key]=e}),d())}),e.watch(c,()=>{l.value||d()},{deep:!0});const d=()=>{const e={};r.forEach(t=>{e[t.key]=c.value[t.key]?Number(c.value[t.key]):0}),i("update:modelValue",e)};return n.modelValue&&Object.keys(n.modelValue).length>0&&(c.value={...n.modelValue}),(o,n)=>(e.openBlock(),e.createElementBlock("div",Nt,[e.createElementVNode("div",Et,[e.createElementVNode("label",Vt,[e.createTextVNode(e.toDisplayString(a.pricing)+" ",1),n[2]||(n[2]=e.createElementVNode("span",{class:"week-pricing__required"},"*",-1))]),e.createVNode(kt,{modelValue:l.value,"onUpdate:modelValue":n[0]||(n[0]=e=>l.value=e),label:a.samePriceAllDays,disabled:t.disabled},null,8,["modelValue","label","disabled"])]),l.value?(e.openBlock(),e.createElementBlock("div",St,[e.createVNode(ht,{modelValue:s.value,"onUpdate:modelValue":n[1]||(n[1]=e=>s.value=e),currency:t.currency,label:a.pricePerNight,placeholder:"0",disabled:t.disabled,size:"lg",required:""},null,8,["modelValue","currency","label","disabled"])])):(e.openBlock(),e.createElementBlock("div",xt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r),o=>(e.openBlock(),e.createBlock(ht,{key:o.key,modelValue:c.value[o.key],"onUpdate:modelValue":e=>c.value[o.key]=e,currency:t.currency,label:o.label,placeholder:"0",disabled:t.disabled,size:"md"},null,8,["modelValue","onUpdate:modelValue","currency","label","disabled"]))),128))])),t.error?(e.openBlock(),e.createElementBlock("span",Ct,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)]))}},[["__scopeId","data-v-6114deda"]]),Bt={class:"accommodation-form"},Tt={class:"accommodation-form__fields"},Ft={class:"accommodation-form__actions"},At=x({__name:"AccommodationForm",props:{accommodation:{type:Object,default:null},currency:{type:String,default:"USD"},isEditing:{type:Boolean,default:!1}},emits:["save","cancel"],setup(t,{emit:o}){const a={name:window.wp.i18n.__("Property name","bookiflex"),enterAccommodationName:window.wp.i18n.__("Enter property name","bookiflex"),type:window.wp.i18n.__("Type","bookiflex"),selectType:window.wp.i18n.__("Select type...","bookiflex"),numberOfUnits:window.wp.i18n.__("Number of units","bookiflex"),sleepingCapacity:window.wp.i18n.__("Main sleeping capacity","bookiflex"),sleepingCapacityHint:window.wp.i18n.__("Enter the total number of main sleeping places (e.g., 1 double bed = 2 places).","bookiflex"),address:window.wp.i18n.__("Address","bookiflex"),enterAddress:window.wp.i18n.__("Enter property address","bookiflex"),cancel:window.wp.i18n.__("Cancel","bookiflex"),saveChanges:window.wp.i18n.__("Save changes","bookiflex"),add:window.wp.i18n.__("Add","bookiflex")},n=t,i=o,r=e.ref({id:n.accommodation?.id||`${Date.now()}-${Math.random().toString(36).substr(2,9)}`,name:n.accommodation?.name||"",address:n.accommodation?.address||"",type:"unit",units:1,beds:n.accommodation?.beds||"",pricing:n.accommodation?.pricing||{}}),s=e.ref({}),c=e.computed(()=>r.value.type&&r.value.type!==l);e.watch(()=>r.value.type,e=>{e===l&&(r.value.beds="",delete s.value.beds)});const u=()=>{(()=>{const e={...r.value,units:r.value.units?Number(r.value.units):r.value.units,beds:r.value.beds?Number(r.value.beds):r.value.beds},t=d(e);return s.value=t.errors,t.canProceed})()&&i("save",{...r.value,units:Number(r.value.units),beds:r.value.beds?Number(r.value.beds):void 0,address:r.value.address})},m=()=>{i("cancel")};return e.watch(()=>r.value.name,()=>delete s.value.name),e.watch(()=>r.value.address,()=>delete s.value.address),e.watch(()=>r.value.type,()=>delete s.value.type),e.watch(()=>r.value.units,()=>delete s.value.units),e.watch(()=>r.value.beds,()=>delete s.value.beds),e.watch(()=>r.value.pricing,()=>delete s.value.pricing,{deep:!0}),(o,n)=>(e.openBlock(),e.createElementBlock("div",Bt,[e.createElementVNode("div",Tt,[e.createVNode(Oe,{modelValue:r.value.name,"onUpdate:modelValue":n[0]||(n[0]=e=>r.value.name=e),label:a.name,placeholder:a.enterAccommodationName,error:s.value.name,required:"",size:"lg"},null,8,["modelValue","label","placeholder","error"]),e.createVNode(Oe,{modelValue:r.value.address,"onUpdate:modelValue":n[1]||(n[1]=e=>r.value.address=e),label:a.address,placeholder:a.enterAddress,error:s.value.address,required:"",size:"lg"},null,8,["modelValue","label","placeholder","error"]),c.value?(e.openBlock(),e.createBlock(Oe,{key:0,modelValue:r.value.beds,"onUpdate:modelValue":n[2]||(n[2]=e=>r.value.beds=e),type:"number",label:a.sleepingCapacity,placeholder:a.sleepingCapacity,"help-text":a.sleepingCapacityHint,error:s.value.beds,required:"",size:"lg"},null,8,["modelValue","label","placeholder","help-text","error"])):e.createCommentVNode("",!0),e.createVNode(Dt,{modelValue:r.value.pricing,"onUpdate:modelValue":n[3]||(n[3]=e=>r.value.pricing=e),currency:t.currency,error:s.value.pricing},null,8,["modelValue","currency","error"])]),e.createElementVNode("div",Ft,[t.isEditing?(e.openBlock(),e.createBlock(U,{key:0,variant:"outline",onClick:m},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.cancel),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(U,{variant:"primary",onClick:u},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.isEditing?a.saveChanges:a.add),1)]),_:1})])]))}},[["__scopeId","data-v-8308ca0a"]]),Ot={class:"accommodation-card"},Pt={class:"accommodation-card__header"},It={class:"accommodation-card__title-section"},Mt={class:"accommodation-card__title"},Lt={key:0,class:"accommodation-card__type"},Ut={class:"accommodation-card__actions"},zt={class:"accommodation-card__details"},Rt={class:"accommodation-card__detail"},$t={class:"accommodation-card__detail-label"},qt={class:"accommodation-card__detail-value"},jt={key:0,class:"accommodation-card__detail"},Gt={class:"accommodation-card__detail-label"},Wt={class:"accommodation-card__detail-value"},Yt={class:"accommodation-card__pricing"},Xt={class:"accommodation-card__pricing-title"},Kt={class:"accommodation-card__pricing-grid"},Ht={class:"accommodation-card__price-label"},Qt={class:"accommodation-card__price-value"},Zt={__name:"AccommodationCard",props:{accommodation:{type:Object,required:!0},currency:{type:String,default:"USD"}},emits:["edit","delete"],setup(t,{emit:o}){const a={edit:window.wp.i18n.__("Edit","bookiflex"),remove:window.wp.i18n.__("Remove","bookiflex"),address:window.wp.i18n.__("Address","bookiflex"),quantity:window.wp.i18n.__("Quantity","bookiflex"),sleepingPlaces:window.wp.i18n.__("Main sleeping capacity","bookiflex"),pricing:window.wp.i18n.__("Pricing","bookiflex")},{accommodationTypes:n}=V(),i=t,l=o;e.computed(()=>{const e=n.value.find(e=>e.value===i.accommodation.type);return e?.label||i.accommodation.type});const s=e.computed(()=>{if(!i.accommodation.pricing)return[];const e=Object.values(i.accommodation.pricing);return e.every(t=>t===e[0])?[{label:window.wp.i18n.__("All days","bookiflex"),price:m(e[0],i.currency)}]:r.map(e=>({label:e.label,price:m(i.accommodation.pricing[e.key]||0,i.currency)}))}),c=()=>{l("edit",i.accommodation)},d=()=>{l("delete",i.accommodation.id)};return(o,n)=>(e.openBlock(),e.createBlock(le,{padding:"md",bordered:"",shadow:""},{default:e.withCtx(()=>[e.createElementVNode("div",Ot,[e.createElementVNode("div",Pt,[e.createElementVNode("div",It,[e.createElementVNode("h3",Mt,e.toDisplayString(t.accommodation.name),1),t.accommodation.address?(e.openBlock(),e.createElementBlock("span",Lt,e.toDisplayString(t.accommodation.address),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ut,[e.createVNode(U,{variant:"text",size:"sm",onClick:c},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.edit),1)]),_:1}),e.createVNode(U,{variant:"text",size:"sm",onClick:d},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.remove),1)]),_:1})])]),e.createElementVNode("div",zt,[e.createElementVNode("div",Rt,[e.createElementVNode("span",$t,e.toDisplayString(a.quantity)+":",1),e.createElementVNode("span",qt,e.toDisplayString(t.accommodation.units),1)]),t.accommodation.beds?(e.openBlock(),e.createElementBlock("div",jt,[e.createElementVNode("span",Gt,e.toDisplayString(a.sleepingPlaces)+":",1),e.createElementVNode("span",Wt,e.toDisplayString(t.accommodation.beds),1)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Yt,[e.createElementVNode("h4",Xt,e.toDisplayString(a.pricing)+":",1),e.createElementVNode("div",Kt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,t=>(e.openBlock(),e.createElementBlock("div",{key:t.label,class:"accommodation-card__price-item"},[e.createElementVNode("span",Ht,e.toDisplayString(t.label),1),e.createElementVNode("span",Qt,e.toDisplayString(t.price),1)]))),128))])])])]),_:1}))}},Jt=x(Zt,[["__scopeId","data-v-ba2d04b8"]]),eo={class:"accommodation-step"},to={class:"accommodation-step__header"},oo={class:"accommodation-step__title"},ao={class:"accommodation-step__description"},no={key:0,class:"accommodation-step__list"},io={key:1,class:"accommodation-step__form"},lo={class:"accommodation-step__form-title"},ro={key:2,class:"accommodation-step__add"},so={key:3,class:"accommodation-step__empty"},co={class:"accommodation-step__empty-text"},uo={key:4,class:"accommodation-step__info"},mo={class:"accommodation-step__info-text"},po=x({__name:"AccommodationStep",props:{state:{type:Object,required:!0}},setup(t){const o={accommodationTypes:window.wp.i18n.__("Rental Units","bookiflex"),addAllTypes:window.wp.i18n.__("Add all rental units you offer. For each unit, specify capacity and pricing. This will be your default rate plan. You can create additional rates later for promotions or special conditions.","bookiflex"),editAccommodationType:window.wp.i18n.__("Edit rental unit","bookiflex"),addAccommodationType:window.wp.i18n.__("Add unit","bookiflex"),addMore:window.wp.i18n.__("Add more","bookiflex"),noTypesYet:window.wp.i18n.__("You have not added any rental units yet. Click the button below to get started.","bookiflex"),addFirstType:window.wp.i18n.__("Add first rental unit","bookiflex"),typesAdded:window.wp.i18n.__("Added:","bookiflex"),canAddMultiple:window.wp.i18n.__("You can add multiple properties — from apartments and cabins to unique stays.","bookiflex")},a=t,n=e.ref([...a.state.data.accommodationTypes]),i=e.ref(0===n.value.length),l=e.ref(null),r=e.computed(()=>a.state.data.currency||"USD"),s=e.computed(()=>!!l.value),c=e=>{if(s.value){const t=n.value.findIndex(t=>t.id===e.id);-1!==t&&(n.value[t]=e),l.value=null}else n.value.push(e);i.value=!1,y()},d=()=>{l.value=null,i.value=!1},u=e=>{l.value=e,i.value=!0},m=e=>{n.value=n.value.filter(t=>t.id!==e),y()},p=()=>{l.value=null,i.value=!0},y=()=>{a.state.updateStepData(2,{accommodationTypes:[...n.value]})};return e.watch(n,()=>{y()},{deep:!0}),a.state.data.accommodationTypes?.length>0&&(n.value=[...a.state.data.accommodationTypes]),(t,a)=>(e.openBlock(),e.createElementBlock("div",eo,[e.createElementVNode("div",to,[e.createElementVNode("h2",oo,e.toDisplayString(o.accommodationTypes),1),e.createElementVNode("p",ao,e.toDisplayString(o.addAllTypes),1)]),n.value.length>0&&!i.value?(e.openBlock(),e.createElementBlock("div",no,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,t=>(e.openBlock(),e.createBlock(Jt,{key:t.id,accommodation:t,currency:r.value,onEdit:u,onDelete:m},null,8,["accommodation","currency"]))),128))])):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("div",io,[e.createElementVNode("h3",lo,e.toDisplayString(s.value?o.editAccommodationType:o.addAccommodationType),1),e.createVNode(At,{accommodation:l.value,currency:r.value,"is-editing":s.value,onSave:c,onCancel:d},null,8,["accommodation","currency","is-editing"])])):e.createCommentVNode("",!0),i.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ro,[e.createVNode(U,{variant:"outline",size:"lg",onClick:p},{default:e.withCtx(()=>[e.createTextVNode(" + "+e.toDisplayString(o.addMore),1)]),_:1})])),0!==n.value.length||i.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",so,[e.createElementVNode("p",co,e.toDisplayString(o.noTypesYet),1),e.createVNode(U,{variant:"primary",size:"lg",onClick:p},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.addFirstType),1)]),_:1})])),n.value.length>0?(e.openBlock(),e.createElementBlock("div",uo,[a[0]||(a[0]=e.createElementVNode("div",{class:"accommodation-step__info-icon"},[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9 12L11 14L15 10M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),e.createElementVNode("span",mo,[e.createTextVNode(e.toDisplayString(o.typesAdded)+" ",1),e.createElementVNode("strong",null,e.toDisplayString(n.value.length),1),e.createTextVNode(". "+e.toDisplayString(o.canAddMultiple),1)])])):e.createCommentVNode("",!0)]))}},[["__scopeId","data-v-0ad2cf8f"]]),yo={class:"booking-preset-step"},_o={class:"booking-preset-step__header"},go={class:"booking-preset-step__title"},ho={class:"booking-preset-step__description"},fo={class:"booking-preset-step__options"},vo={class:"preset-card__content"},wo={class:"preset-card__radio"},bo={class:"preset-card__info"},ko={class:"preset-card__header"},No={class:"preset-card__title"},Eo={key:0,class:"preset-card__badge"},Vo={class:"preset-card__description"},So={key:0,class:"preset-card__recommendation"},xo={class:"booking-preset-step__info"},Co={class:"booking-preset-step__info-text"},Do={__name:"BookingPresetStep",props:{state:{type:Object,required:!0}},setup(t){const o={bookingTerms:window.wp.i18n.__("Booking Terms","bookiflex"),chooseBookingTerms:window.wp.i18n.__("Define the payment and cancellation rules your guests will see when booking.","bookiflex"),mostPopular:window.wp.i18n.__("Most Popular","bookiflex"),tip:window.wp.i18n.__("Tip:","bookiflex"),customizeNote:window.wp.i18n.__("You can fully customize cancellation and payment settings later in Rate plan settings.","bookiflex")},a=t,{bookingPresets:n}=V(),i=e.ref(a.state.data.bookingPreset||"");return e.watch(i,e=>{a.state.updateStepData(3,{bookingPreset:e})}),a.state.data.bookingPreset&&(i.value=a.state.data.bookingPreset),(t,a)=>(e.openBlock(),e.createElementBlock("div",yo,[e.createElementVNode("div",_o,[e.createElementVNode("h2",go,e.toDisplayString(o.bookingTerms),1),e.createElementVNode("p",ho,e.toDisplayString(o.chooseBookingTerms),1)]),e.createElementVNode("div",fo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(n),t=>(e.openBlock(),e.createBlock(le,{key:t.id,class:e.normalizeClass(["preset-card",{"preset-card--selected":i.value===t.id}]),padding:"md",hoverable:"",onClick:e=>{return o=t.id,void(i.value=o);var o}},{default:e.withCtx(()=>[e.createElementVNode("div",vo,[e.createElementVNode("div",wo,[e.createElementVNode("span",{class:e.normalizeClass(["preset-card__radio-circle",{"preset-card__radio-circle--active":i.value===t.id}])},[...a[0]||(a[0]=[e.createElementVNode("span",{class:"preset-card__radio-dot"},null,-1)])],2)]),e.createElementVNode("div",bo,[e.createElementVNode("div",ko,[e.createElementVNode("h3",No,e.toDisplayString(t.title),1),t.popular?(e.openBlock(),e.createElementBlock("span",Eo,e.toDisplayString(o.mostPopular),1)):e.createCommentVNode("",!0)]),e.createElementVNode("p",Vo,e.toDisplayString(t.shortDescription),1),t.recommendation?(e.openBlock(),e.createElementBlock("p",So,e.toDisplayString(t.recommendation),1)):e.createCommentVNode("",!0)])])]),_:2},1032,["class","onClick"]))),128))]),e.createElementVNode("div",xo,[a[1]||(a[1]=e.createElementVNode("div",{class:"booking-preset-step__info-icon"},[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M12 9V13M12 17H12.01M3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12Z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),e.createElementVNode("span",Co,[e.createElementVNode("strong",null,e.toDisplayString(o.tip),1),e.createTextVNode(" "+e.toDisplayString(o.customizeNote),1)])])]))}},Bo=x(Do,[["__scopeId","data-v-755d83fa"]]),To={class:"confirmation-step"},Fo={key:0,class:"confirmation-step__simple"},Ao={class:"confirmation-step__simple-title"},Oo={class:"confirmation-step__simple-description"},Po={class:"confirmation-step__simple-note"},Io={class:"confirmation-step__simple-note-text"},Mo={class:"confirmation-step__header"},Lo={class:"confirmation-step__title"},Uo={class:"confirmation-step__description"},zo={class:"confirmation-step__sections"},Ro={class:"summary-section"},$o={class:"summary-section__header"},qo={class:"summary-section__title"},jo={class:"summary-section__content"},Go={class:"summary-section__row"},Wo={class:"summary-section__label"},Yo={class:"summary-section__value"},Xo={class:"summary-section__row"},Ko={class:"summary-section__label"},Ho={class:"summary-section__value"},Qo={key:0,class:"summary-section__row"},Zo={class:"summary-section__label"},Jo={class:"summary-section__value"},ea={class:"summary-section__row"},ta={class:"summary-section__label"},oa={class:"summary-section__value"},aa={class:"summary-section__row"},na={class:"summary-section__label"},ia={class:"summary-section__value"},la={class:"summary-section"},ra={class:"summary-section__header"},sa={class:"summary-section__title"},ca={class:"summary-section__content"},da={class:"accommodation-list"},ua={class:"accommodation-item__header"},ma={class:"accommodation-item__name"},pa={class:"accommodation-item__type"},ya={class:"accommodation-item__details"},_a={key:0},ga={class:"accommodation-item__pricing"},ha={class:"summary-section"},fa={class:"summary-section__header"},va={class:"summary-section__title"},wa={class:"summary-section__content"},ba={class:"summary-section__value"},ka={class:"summary-section__description"},Na={class:"confirmation-step__note"},Ea={class:"confirmation-step__note-text"},Va={__name:"ConfirmationStep",props:{state:{type:Object,required:!0}},setup(o){const a={checkSettings:window.wp.i18n.__("Check settings","bookiflex"),pleaseCheckData:window.wp.i18n.__("Please check all entered data before completing. You can return to any step to edit.","bookiflex"),companyInfo:window.wp.i18n.__("Company Information","bookiflex"),companyName:window.wp.i18n.__("Company name","bookiflex"),companyAddress:window.wp.i18n.__("Address","bookiflex"),companyPhone:window.wp.i18n.__("Phone","bookiflex"),companyEmail:window.wp.i18n.__("Email","bookiflex"),currency:window.wp.i18n.__("Currency","bookiflex"),edit:window.wp.i18n.__("Edit","bookiflex"),accommodationTypes:window.wp.i18n.__("Rental units","bookiflex"),quantity:window.wp.i18n.__("Quantity","bookiflex"),sleepingPlaces:window.wp.i18n.__("Main sleeping capacity","bookiflex"),bookingTerms:window.wp.i18n.__("Booking Terms","bookiflex"),clickToComplete:window.wp.i18n.__('Click "Confirm and complete" to finish installation.',"bookiflex"),afterClicking:window.wp.i18n.__('After clicking the "Confirm and complete" button, your settings will be saved and you can start using BookiFlex.',"bookiflex"),testDataSetup:window.wp.i18n.__("Test data setup","bookiflex"),testDataDescription:window.wp.i18n.__("Demo data will be loaded for quick testing of functionality.","bookiflex"),manualSetup:window.wp.i18n.__("Manual setup","bookiflex"),manualSetupDescription:window.wp.i18n.__("You can configure all parameters later through the control panel at your convenience.","bookiflex")},i=o,{currencies:l,bookingPresets:s,accommodationTypes:c}=V(),d=e.computed(()=>i.state.data.mode===n.QUICK_SETUP),u=e.computed(()=>i.state.data.mode===n.TEST_DATA?{title:a.testDataSetup,description:a.testDataDescription}:i.state.data.mode===n.MANUAL?{title:a.manualSetup,description:a.manualSetupDescription}:null),p=e.computed(()=>{const e=l.value.find(e=>e.value===i.state.data.currency);return e?.label||i.state.data.currency}),y=e.computed(()=>s.value.find(e=>e.id===i.state.data.bookingPreset)),_=e=>{const t=c.value.find(t=>t.value===e);return t?.label||e},g=(e,t)=>{if(!e)return"";const o=Object.values(e);return o.every(e=>e===o[0])?m(o[0],t):r.map(o=>`${o.label}: ${m(e[o.key]||0,t)}`).join(", ")},h=e=>{i.state.goToStep(e)};return(n,i)=>(e.openBlock(),e.createElementBlock("div",To,[!d.value&&u.value?(e.openBlock(),e.createElementBlock("div",Fo,[i[4]||(i[4]=e.createElementVNode("div",{class:"confirmation-step__simple-icon"},"✓",-1)),e.createElementVNode("h2",Ao,e.toDisplayString(u.value.title),1),e.createElementVNode("p",Oo,e.toDisplayString(u.value.description),1),e.createElementVNode("div",Po,[i[3]||(i[3]=e.createElementVNode("div",{class:"confirmation-step__simple-note-icon"},[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"2"}),e.createElementVNode("path",{d:"M12 16V12M12 8H12.01",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"})])],-1)),e.createElementVNode("span",Io,e.toDisplayString(a.clickToComplete),1)])])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Mo,[e.createElementVNode("h2",Lo,e.toDisplayString(a.checkSettings),1),e.createElementVNode("p",Uo,e.toDisplayString(a.pleaseCheckData),1)]),e.createElementVNode("div",zo,[e.createVNode(le,{padding:"md"},{default:e.withCtx(()=>[e.createElementVNode("div",Ro,[e.createElementVNode("div",$o,[e.createElementVNode("h3",qo,e.toDisplayString(a.companyInfo),1),e.createVNode(U,{variant:"text",size:"sm",onClick:i[0]||(i[0]=o=>h(e.unref(t).COMPANY_INFO))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.edit),1)]),_:1})]),e.createElementVNode("div",jo,[e.createElementVNode("div",Go,[e.createElementVNode("span",Wo,e.toDisplayString(a.companyName)+":",1),e.createElementVNode("span",Yo,e.toDisplayString(o.state.data.companyName),1)]),e.createElementVNode("div",Xo,[e.createElementVNode("span",Ko,e.toDisplayString(a.companyAddress)+":",1),e.createElementVNode("span",Ho,e.toDisplayString(o.state.data.companyAddress),1)]),o.state.data.companyPhone?(e.openBlock(),e.createElementBlock("div",Qo,[e.createElementVNode("span",Zo,e.toDisplayString(a.companyPhone)+":",1),e.createElementVNode("span",Jo,e.toDisplayString(o.state.data.companyPhone),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",ea,[e.createElementVNode("span",ta,e.toDisplayString(a.companyEmail)+":",1),e.createElementVNode("span",oa,e.toDisplayString(o.state.data.companyEmail),1)]),e.createElementVNode("div",aa,[e.createElementVNode("span",na,e.toDisplayString(a.currency)+":",1),e.createElementVNode("span",ia,e.toDisplayString(p.value),1)])])])]),_:1}),e.createVNode(le,{padding:"md"},{default:e.withCtx(()=>[e.createElementVNode("div",la,[e.createElementVNode("div",ra,[e.createElementVNode("h3",sa,e.toDisplayString(a.accommodationTypes)+" ("+e.toDisplayString(o.state.data.accommodationTypes.length)+") ",1),e.createVNode(U,{variant:"text",size:"sm",onClick:i[1]||(i[1]=o=>h(e.unref(t).ACCOMMODATION))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.edit),1)]),_:1})]),e.createElementVNode("div",ca,[e.createElementVNode("div",da,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.state.data.accommodationTypes,t=>(e.openBlock(),e.createElementBlock("div",{key:t.id,class:"accommodation-item"},[e.createElementVNode("div",ua,[e.createElementVNode("strong",ma,e.toDisplayString(t.name),1),e.createElementVNode("span",pa,e.toDisplayString(_(t.type)),1)]),e.createElementVNode("div",ya,[e.createElementVNode("span",null,e.toDisplayString(a.quantity)+": "+e.toDisplayString(t.units),1),t.beds?(e.openBlock(),e.createElementBlock("span",_a,e.toDisplayString(a.sleepingPlaces)+": "+e.toDisplayString(t.beds),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",ga,e.toDisplayString(g(t.pricing,o.state.data.currency)),1)]))),128))])])])]),_:1}),e.createVNode(le,{padding:"md"},{default:e.withCtx(()=>[e.createElementVNode("div",ha,[e.createElementVNode("div",fa,[e.createElementVNode("h3",va,e.toDisplayString(a.bookingTerms),1),e.createVNode(U,{variant:"text",size:"sm",onClick:i[2]||(i[2]=o=>h(e.unref(t).BOOKING_PRESET))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.edit),1)]),_:1})]),e.createElementVNode("div",wa,[e.createElementVNode("p",ba,e.toDisplayString(y.value?.title),1),e.createElementVNode("p",ka,e.toDisplayString(y.value?.shortDescription),1)])])]),_:1})]),e.createElementVNode("div",Na,[i[5]||(i[5]=e.createElementVNode("span",{class:"confirmation-step__note-icon"},"✓",-1)),e.createElementVNode("span",Ea,e.toDisplayString(a.afterClicking),1)])],64))]))}},Sa=x(Va,[["__scopeId","data-v-918f5922"]]),xa={class:"next-steps"},Ca={class:"next-steps__header"},Da={class:"next-steps__title"},Ba={class:"next-steps__description"},Ta={class:"next-steps__list"},Fa={class:"next-step-card__content"},Aa={class:"next-step-card__number"},Oa={class:"next-step-card__info"},Pa={class:"next-step-card__title"},Ia={class:"next-step-card__description"},Ma={class:"next-steps__info"},La={class:"next-steps__info-text"},Ua=x({__name:"NextStepsStep",props:{state:{type:Object,required:!0}},setup(t){const o={greatJob:window.wp.i18n.__("Great job!","bookiflex"),setupComplete:window.wp.i18n.__("Basic setup is complete. Now complete the following steps to start accepting bookings.","bookiflex"),important:window.wp.i18n.__("Important:","bookiflex"),completeAnytime:window.wp.i18n.__("You can complete these steps at any time convenient for you through the BookiFlex control panel.","bookiflex")},a=t,n=e.computed(()=>a.state.data.nextSteps||[]);return(t,a)=>(e.openBlock(),e.createElementBlock("div",xa,[e.createElementVNode("div",Ca,[a[0]||(a[0]=e.createElementVNode("div",{class:"next-steps__success-icon"},[e.createElementVNode("svg",{viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("circle",{cx:"32",cy:"32",r:"32",fill:"#009e59","fill-opacity":"0.1"}),e.createElementVNode("path",{d:"M20 32L28 40L44 24",stroke:"#009e59","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),e.createElementVNode("h2",Da,e.toDisplayString(o.greatJob),1),e.createElementVNode("p",Ba,e.toDisplayString(o.setupComplete),1)]),e.createElementVNode("div",Ta,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(t,o)=>(e.openBlock(),e.createBlock(le,{key:o,class:"next-step-card",padding:"md"},{default:e.withCtx(()=>[e.createElementVNode("div",Fa,[e.createElementVNode("div",Aa,e.toDisplayString(o+1),1),e.createElementVNode("div",Oa,[e.createElementVNode("h3",Pa,e.toDisplayString(t.title),1),e.createElementVNode("p",Ia,e.toDisplayString(t.description),1)])])]),_:2},1024))),128))]),e.createElementVNode("div",Ma,[a[1]||(a[1]=e.createElementVNode("div",{class:"next-steps__info-icon"},[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M12 9V13M12 17H12.01M3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12Z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),e.createElementVNode("span",La,[e.createElementVNode("strong",null,e.toDisplayString(o.important),1),e.createTextVNode(" "+e.toDisplayString(o.completeAnytime),1)])])]))}},[["__scopeId","data-v-62896b45"]]),za={key:0,class:"app-loading"},Ra={class:"app-loading__text"},$a={key:1,class:"app-error"},qa={class:"app-error__title"},ja={class:"app-error__message"},Ga={__name:"App",setup(o){const a={loadingData:window.wp.i18n.__("Loading data...","bookiflex"),loadingError:window.wp.i18n.__("Loading error","bookiflex"),tryAgain:window.wp.i18n.__("Try again","bookiflex")},{fetchInitData:n,isLoading:i,error:l}=V();return e.onMounted(()=>{n()}),(o,r)=>e.unref(i)?(e.openBlock(),e.createElementBlock("div",za,[r[1]||(r[1]=e.createElementVNode("div",{class:"app-loading__spinner"},[e.createElementVNode("svg",{viewBox:"0 0 50 50"},[e.createElementVNode("circle",{cx:"25",cy:"25",r:"20",fill:"none",stroke:"currentColor","stroke-width":"4"})])],-1)),e.createElementVNode("p",Ra,e.toDisplayString(a.loadingData),1)])):e.unref(l)?(e.openBlock(),e.createElementBlock("div",$a,[r[2]||(r[2]=e.createElementVNode("div",{class:"app-error__icon"},[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M12 8V12M12 16H12.01M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),e.createElementVNode("h2",qa,e.toDisplayString(a.loadingError),1),e.createElementVNode("p",ja,e.toDisplayString(e.unref(l)),1),e.createElementVNode("button",{class:"app-error__button",onClick:r[0]||(r[0]=(...t)=>e.unref(n)&&e.unref(n)(...t))},e.toDisplayString(a.tryAgain),1)])):(e.openBlock(),e.createBlock(te,{key:2},{default:e.withCtx(({state:o})=>[o.currentStep.value===e.unref(t).WELCOME?(e.openBlock(),e.createBlock(xe,{key:0,state:o},null,8,["state"])):o.currentStep.value===e.unref(t).COMPANY_INFO?(e.openBlock(),e.createBlock(Ze,{key:1,state:o},null,8,["state"])):o.currentStep.value===e.unref(t).ACCOMMODATION?(e.openBlock(),e.createBlock(po,{key:2,state:o},null,8,["state"])):o.currentStep.value===e.unref(t).BOOKING_PRESET?(e.openBlock(),e.createBlock(Bo,{key:3,state:o},null,8,["state"])):o.currentStep.value===e.unref(t).CONFIRMATION?(e.openBlock(),e.createBlock(Sa,{key:4,state:o},null,8,["state"])):o.currentStep.value===e.unref(t).NEXT_STEPS?(e.openBlock(),e.createBlock(Ua,{key:5,state:o},null,8,["state"])):e.createCommentVNode("",!0)]),_:1}))}};e.createApp(Ga).mount("#bookiflex-onboarding-app")}(Vue);
