1"use strict";(globalThis.webpackChunkwp_cafe||=[]).push([[4999],{69084(e,t,n){n.r(t),n.d(t,{MenuSectionCard:()=>i});var r=n(74848),o=n(62468),a=n(38802),i=function(e){var t=e.section,n=e.disabled;return(0,r.jsx)(a.mS,{children:(0,r.jsx)(o.Card,{className:"w-full mb-6 py-3 px-4 sm:px-6",children:(0,r.jsx)(o.CardContent,{className:"p-0",children:(0,r.jsxs)("div",{className:"block sm:flex items-center justify-between flex-wrap gap-2 sm:gap-5",children:[(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2 ".concat(n?"text-black/40!":"text-black!"),children:t.title}),(0,r.jsx)("p",{className:"text-sm ".concat(n?"text-black/40!":"text-black/70!"),children:t.description})]}),(0,r.jsx)(o.Button,{variant:"outlinePrimary",onClick:function(){n||(window.location.href=t.action_url||"#")},disabled:n,className:"px-4 py-2 text-sm font-medium ".concat(n?"cursor-not-allowed opacity-50":"hover:bg-primary hover:text-white"),children:t.buttonText})]})})})})}},1949(e,t,n){n.r(t),n.d(t,{FOOD_MENU_INSTRUCTIONS:()=>i,FOOD_MENU_SECTIONS:()=>a});var r=n(27723),o=null===window||void 0===window?void 0:window.wpCafe,a=[{id:"food-menus",title:(0,r.__)("Food Menu's","wp-cafe"),description:(0,r.__)("Add and manage your restaurant items directly from WooCommerce products. Every food item you upload will automatically appear inside all our food menu shortcodes.","wp-cafe"),buttonText:(0,r.__)("Add & Manage Products","wp-cafe"),action:"add_item",action_url:(null==o?void 0:o.has_woo_products)?"".concat(null==o?void 0:o.admin_url,"edit.php?post_type=product&wpcafe=true"):"".concat(null==o?void 0:o.admin_url,"post-new.php?post_type=product&wpcafe=true")},{id:"food-category",title:(0,r.__)("Food Category","wp-cafe"),description:(0,r.__)("Organize your menu with categories like Burgers, Pizza, Drinks, Desserts, etc. Categories help filter and display menus via shortcodes on your website.","wp-cafe"),buttonText:(0,r.__)("Add & Manage Category","wp-cafe"),action:"add_category",action_url:"".concat(null==o?void 0:o.admin_url,"edit-tags.php?taxonomy=product_cat&post_type=product&wpcafe=true")},{id:"menus-labels",title:(0,r.__)("Menu's Brands","wp-cafe"),description:(0,r.__)("Add brand labels using WooCommerceâs product attributes. Brands appear in filters and menu layouts.","wp-cafe"),buttonText:(0,r.__)("Add & Manage Brands","wp-cafe"),action:"add_labels",action_url:"".concat(null==o?void 0:o.admin_url,"edit-tags.php?taxonomy=product_brand&post_type=product&wpcafe=true")},{id:"menus-product-labels",title:(0,r.__)("Product Labels","wp-cafe"),description:(0,r.__)("Tag products with rich, colored badges (Vegan, Spicy, Gluten-Free, etc.). Pick a color, add an icon, and labels render on every shortcode product card.","wp-cafe"),buttonText:(0,r.__)("Manage Product Labels","wp-cafe"),action:"add_product_labels",action_url:"".concat(null==o?void 0:o.admin_url,"edit-tags.php?taxonomy=wpcafe_product_label&post_type=product&wpcafe=true")},{id:"menus-product-nutritional-info",title:(0,r.__)("Product Nutritional and Allergen Info","wp-cafe"),description:(0,r.__)("Add detailed nutritional and allergen information to your products to help customers make informed decisions. Edit any product and scroll to the 'Nutritional & Allergen Info' section â it renders on the product card and details popup on the frontend.","wp-cafe"),buttonText:(0,r.__)("Add Nutritional Info","wp-cafe"),action:"view_nutritional_info_guide",action_url:"".concat(null==o?void 0:o.admin_url,"edit.php?post_type=product&wpcafe=true"),external:!0}],i={title:(0,r.__)("Food Menu Instructions","wp-cafe"),content:[{title:(0,r.__)("Create food menu items using WooCommerce products. Add price, description, and images, then display them anywhere using shortcodes.","wp-cafe"),action:{label:"",link:""},links:{video:"https://www.youtube.com/watch?v=zORxmnxVJd8&list=PLW54c-mt4ObB2k9t8A5ALlwKGjeWxB8zQ",doc:"https://support.themewinter.com/docs/plugins/plugin-docs/food-ordering/add-new-food-item/"}},{title:(0,r.__)("Create special menus that show only during lunch hours, weekends, or festive events. Use our timed product feature to set menus based on various conditions.","wp-cafe"),action:{label:"",link:""},links:{video:"https://www.youtube.com/watch?v=zORxmnxVJd8&list=PLW54c-mt4ObB2k9t8A5ALlwKGjeWxB8zQ",doc:"https://support.themewinter.com/docs/plugins/plugin-docs/food-ordering/how-to-use-time-based-products-in-wpcafe/"}},{title:(0,r.__)("Run multiple branches? Assign food items to specific locations or stores and show different menus per branch.","wp-cafe"),action:{label:"",link:""},links:{video:"https://www.youtube.com/watch?v=zORxmnxVJd8&list=PLW54c-mt4ObB2k9t8A5ALlwKGjeWxB8zQ",doc:"https://support.themewinter.com/docs/plugins/plugin-docs/food-ordering/general-sett
1ings-5/"}},{title:(0,r.__)("Add nutritional and allergen info to any product. Open the product edit screen and scroll to the 'Nutritional & Allergen Info' metabox â values render on the frontend product card and details popup.","wp-cafe"),action:{label:"",link:""},links:{video:"https://www.youtube.com/watch?v=zORxmnxVJd8&list=PLW54c-mt4ObB2k9t8A5ALlwKGjeWxB8zQ",doc:"https://support.themewinter.com/docs/plugins/plugin-docs/food-ordering/how-to-show-nutrition-and-allergen-info-using-wpcafe/"}}]}},98904(e,t,n){n.r(t);var r=n(74848),o=n(27723),a=n(47143);if(945==n.j)var i=n(48697);var l=n(1949),s=n(69084),c=n(38802),u=n(62468),d=n(19402),p=n(17639);function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const v=945==n.j?function(){var e,t,n=(e=(0,p.M)("wpcafe_food_menu_banner_dismissed",!1),t=2,function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return f(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),v=n[0],m=n[1],_="active"===((0,a.useSelect)(function(e){return e(null===d.zQ||void 0===d.zQ?void 0:d.zQ.settings).getSettingsState()},[]).data||{}).wc_status;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.CI,{title:(0,o.__)("Food Menu","wp-cafe")}),(0,r.jsx)(c.mc,{children:(0,r.jsx)(u.Card,{className:"max-w-[95%] sm:max-w-[90%] mx-auto p-6",children:(0,r.jsxs)("div",{className:"flex flex-col lg:flex-row gap-6",children:[(0,r.jsxs)("div",{className:"flex-1 lg:flex-2 space-y-4",children:[!v&&(0,r.jsx)("div",{className:"mb-4 relative",children:(0,r.jsxs)("div",{className:"relative bg-visual-100 dark:bg-visual-200 border-l-4 border-primary rounded-lg p-5 pr-12",children:[(0,r.jsx)("p",{children:(0,o.__)("WPCafe Online Ordering is completely powered by WooCommerce. You can add and manage all your products, categories, and brands directly from WooCommerce.","wp-cafe")}),(0,r.jsx)(u.Button,{variant:"ghost",size:"icon",onClick:function(){m(!0)},className:"absolute top-2 right-2 h-8 w-8 hover:bg-black/5","aria-label":(0,o.__)("Dismiss banner","wp-cafe"),children:(0,r.jsx)(i.A,{className:"h-4 w-4 text-black/60"})})]})}),(0,r.jsx)(c.LP,{}),l.FOOD_MENU_SECTIONS.map(function(e){return(0,r.jsx)(s.MenuSectionCard,{section:e,disabled:!_},e.id)})]}),(0,r.jsx)("div",{className:"w-full lg:w-96 lg:flex-shrink-0",children:(0,r.jsx)(c.vH,{instructionData:l.FOOD_MENU_INSTRUCTIONS})})]})})})]})}:null;n.d(t,["default",0,v])},1961(e,t,n){n.r(t);var r=n(74848),o=n(27723),a=n(47143),i=n(10404),l=n(38802),s=n(68602),c=n(19402);const u=945==n.j?function(){var e,t,n,u,d,p,f,v,m,_,h=(0,a.useSelect)(function(e){return e(null===c.zQ||void 0===c.zQ?void 0:c.zQ.modules).getModulesState()},[]),w=h.data,g=h.updatingModules,b=(0,i.useFormContext)().control,y=(0,s.Z)().handleModuleToggle,x=function(e,t){y(e,t?"on":"off")};return(0,r.jsx)(l.X,{title:(0,o.__)("Online Ordering","wp-cafe"),description:(0,o.__)("Provides food ordering services like pickup, delivery for your restaurant.","wp-cafe"),children:(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)(l.X,{title:(0,o.__)("Tipping","wp-cafe"),description:(0,o.__)("Enables tipping during checkout for customers to appreciate your service by giving tips.","wp-cafe"),switchable:!0,defaultEnabled:"on"===(null===(e=null==w?void 0:w.tipping)||void 0===e?void 0:e.status),onToggle:function(e){return x("tipping",e)},loading:null==g?void 0:g.includes("tipping")}),(0,r.jsx)(l.X,{title:(0,o.__)("Mini-cart Settings","wp-cafe"),description:(0,o.__)("Enables a floating mini-cart for quicker checkout.","wp-cafe"),switchable:!0,defaultEnabled:"on"===(null===(t=null==w?void 0:w.mini_cart)||void 0===t?void 0:t.status),onToggle:function(e){return x("mini_cart",e)},loading:null==g?void 0:g.includes("mini_cart")}),null===(d=null===(u=null===(n=null===window||void 0===window?void 0:window.wp)||void 0===n?void 0:n.hooks)||void 0===u?void 0:u.applyFilters)||void 0===d?void 0:d.call(u,"
1wpcafe_pickup_onboarding",(0,r.jsx)(l.q5,{title:(0,o.__)("Pickup","wp-cafe"),description:(0,o.__)("Enable pickup orders for your restaurant.","wp-cafe"),name:"pickup",isPro:!0}),{control:b,InputWithAddonInput:l.bz,defaultEnabled:"on"===(null===(p=null==w?void 0:w.pickup)||void 0===p?void 0:p.status),onToggle:function(e){return null==x?void 0:x("pickup",e)}}),null===(m=null===(v=null===(f=null===window||void 0===window?void 0:window.wp)||void 0===f?void 0:f.hooks)||void 0===v?void 0:v.applyFilters)||void 0===m?void 0:m.call(v,"wpcafe_delivery_onboarding",(0,r.jsx)(l.q5,{title:(0,o.__)("Delivery","wp-cafe"),description:(0,o.__)("Enable delivery orders for your restaurant.","wp-cafe"),name:"delivery",isPro:!0}),{control:b,InputWithAddonInput:l.bz,defaultEnabled:"on"===(null===(_=null==w?void 0:w.delivery)||void 0===_?void 0:_.status),onToggle:function(e){return null==x?void 0:x("delivery",e)}})]})})}:null;n.d(t,["default",0,u])},92375(e,t,n){n.r(t);var r=n(74848),o=n(27723),a=n(47143),i=n(19402),l=n(4242),s=n(38802);const c=945==n.j?function(e){var t=(0,a.useSelect)(function(e){return e(null===i.zQ||void 0===i.zQ?void 0:i.zQ.wooCom).getWooComState()},[]).categories;return(0,l.default)(),(0,r.jsx)(s.pp,Object.assign({},e,{options:t,valueType:"number",placeholder:(0,o.__)("Select categories","wp-cafe"),label:(0,o.__)("Select categories","wp-cafe")}))}:null;n.d(t,["default",0,c])},4242(e,t,n){n.r(t);var r=n(47143),o=n(86087),a=n(93428),i=n(19402);function l(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function a(n,r,o,a){var l=r&&r.prototype instanceof c?r:c,u=Object.create(l.prototype);return s(u,"_invoke",function(n,r,o){var a,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return a=t,l=0,s=e,p.n=n,i}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,a=u[t],f=p.p,v=a[2];n>3?(o=v===r)&&(s=a[(l=a[4])?5:(l=3,3)],a[4]=a[5]=e):a[0]<=f&&((o=n<2&&f<a[1])?(l=0,p.v=r,p.n=a[1]):f<v&&(o=n<3||a[0]>r||r>v)&&(a[4]=n,a[5]=r,p.n=v,l=0))}if(o||n>1)return i;throw d=!0,r}return function(o,u,v){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,v),l=u,s=v;(t=l<2?e:s)||!d;){a||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,a){if(l||(o="next"),t=a[o]){if(!(t=t.call(a,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=a.return)&&t.call(a),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);a=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==i)break}catch(t){a=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,a),!0),u}var i={};function c(){}function u(){}function d(){}t=Object.getPrototypeOf;var p=[][r]?t(t([][r]())):(s(t={},r,function(){return this}),t),f=d.prototype=c.prototype=Object.create(p);function v(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,s(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=d,s(f,"constructor",d),s(d,"constructor",u),u.displayName="GeneratorFunction",s(d,o,"GeneratorFunction"),s(f),s(f,o,"Generator"),s(f,r,function(){return this}),s(f,"toString",function(){return"[object Generator]"}),(l=function(){return{w:a,m:v}})()}function s(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}s=function(e,t,n,r){function a(t,n){s(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a("next",0),a("throw",1),a("return",2))},s(e,t,n,r)}const c=945==n.j?function(){var e=(0,r.useDispatch)(null===i.zQ||void 0===i.zQ?void 0:i.zQ.wooCom).setWooComState,t=(0,r.useSelect)(function(e){return e(null===i.zQ||void 0===i.zQ?void 0:i.zQ.wooCom).getWooComState()},[]).categories,n=function(e){return e.map(function(e){return{value:e.id,label:e.name}})};(0,o.useEffect)(function(){var r,o,i,s;r=void 0,o=void 0,i=void 0,s=l().m(function r(){var o,i;return l().w(function(r){for(;;)switch(r.p=r.n){case 0:if(!t){r.n=1;break}return r.a(2);case 1:return r.p=1,r.n=2,a.A.products.getCategories();case 2:(o=r.v).success&&e({categories:n(null==o?void 0:o.data)}),r.n=4;break;case 3:r.p=3,i=r.v,console.log(i),e({categories:[]});case 4:return r.a(2)}},r,null,[[1,3]])}
1),new(i||(i=Promise))(function(e,t){function n(e){try{l(s.next(e))}catch(e){t(e)}}function a(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i(function(e){e(r)})).then(n,a)}l((s=s.apply(r,o||[])).next())})},[])}:null;n.d(t,["default",0,c])},87777(e,t,n){n.r(t);var r=n(47143),o=n(19402),a={products:null,categories:null},i="UPDATE_STATE",l=(0,r.createReduxStore)(null===o.zQ||void 0===o.zQ?void 0:o.zQ.wooCom,{reducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,t=arguments.length>1?arguments[1]:void 0;return t.type===i?Object.assign(Object.assign({},e),t.payload):e},actions:{setWooComState:function(e){return{type:i,payload:e}}},selectors:{getWooComState:function(e,t){return t?e[t]:e}}});(0,r.register)(l)},99490(e,t,n){n.r(t);var r=n(74848),o=n(27723),a=n(38802),i=n(35656);const l=945==n.j?function(){return(0,r.jsx)(a.bg,{title:(0,o.__)("Layout Settings","wp-cafe"),description:(0,o.__)("Customize default WooCommerce product and variable products pages layouts design for a tailored user experience.","wp-cafe"),children:(0,r.jsx)("div",{className:"space-y-4",children:i.layoutSwitches.map(function(e){return(0,r.jsx)(a.q5,{title:e.title,description:e.description,name:e.name},e.name)})})})}:null;n.d(t,["default",0,l])},35656(e,t,n){n.r(t),n.d(t,{layoutSwitches:()=>o});var r=n(27723),o=[{title:(0,r.__)("Product Variation List Layout Override?","wp-cafe"),description:(0,r.__)("Override the default WooCommerce product variation layout in the quick-view popups and on the single product page.","wp-cafe"),name:"override_product_variation_list_layout"},{title:(0,r.__)("Override WooCommerce Default Layout?","wp-cafe"),description:(0,r.__)("Overrides the default WooCommerce layouts for the Product Details, Cart, Checkout, and Thank You pages.","wp-cafe"),name:"override_woocommerce_default_layout"}]},37460(e,t,n){n.r(t);var r=n(74848),o=n(27723),a=n(10404),i=n(64239),l=n(62468),s=n(63939),c=n(80746),u=n(70655);const d=945==n.j?function(){var e=(0,s.default)(),t=e.selectedShortcode,n=e.generateShortcode,d=(t||{}).defaultValues,p=void 0===d?{}:d,f=(0,a.useForm)({resolver:(0,i.zodResolver)(c.foodOrderShortcodeSchema),mode:"onChange",defaultValues:p}),v=f.handleSubmit,m=f.formState.dirtyFields;return(0,r.jsx)(a.FormProvider,Object.assign({},f,{children:(0,r.jsxs)("form",{onSubmit:v(function(e){n(e,m)}),children:[(0,r.jsx)("div",{className:"max-h-[50vh] md:max-h-[55vh] xxl:max-h-[75vh] overflow-y-auto pr-1","data-testid":"shortcode-modal-scroller",children:(0,r.jsx)(u.default,{})}),(0,r.jsx)("div",{className:"mt-5 flex justify-end",children:(0,r.jsx)(l.Button,{type:"submit",children:(0,o.__)("Generate","wp-cafe")})})]})}))}:null;n.d(t,["default",0,d])},70655(e,t,n){n.r(t);var r=n(74848),o=n(27723),a=n(86087),i=n(10404),l=n(38802),s=n(63939),c=n(65683),u=n(92375),d=n(25380),p=n(19402),f=n(39992);const v=945==n.j?function(){var e,t,n,v=(0,f.X_)(),m=(0,a.useMemo)(function(){return(0,p.pw)()},[v]),_=(0,a.useMemo)(function(){return(0,p.J)()},[v]),h=(0,a.useMemo)(function(){return(0,p.K5)()},[v]),w=(0,a.useMemo)(function(){return(0,c.getNavPositionOptions)()},[v]),g=(0,i.useFormContext)(),b=g.control,y=g.setValue,x=(0,s.default)().selectedShortcode||{},j=x.template_options,S=x.style_option,O=x.style_options_by_template,k=x.field_conditions,N=x.fields,C=(0,i.useWatch)({control:b,name:"template"}),A=(0,i.useWatch)({control:b,name:"style"}),F=(0,a.useMemo)(function(){var e=null==O?void 0:O[C];return(null==e?void 0:e.length)?e:Array.from({length:S||1},function(e,t){return{label:(0,o.__)("Style","wp-cafe")+" ".concat(t+1),value:"style-".concat(t+1)}})},[O,C,S,v]);(0,a.useEffect)(function(){F.length&&A&&(F.some(function(e){return e.value===A})||y("style",F[0].value,{shouldDirty:!0}))},[F,A]);var T=(0,d.A)().getLocations,z=null===(n=null===(t=null===(e=null===window||void 0===window?void 0:window.wp)||void 0===e?void 0:e.hooks)||void 0===t?void 0:t.applyFilters)||void 0===n?void 0:n.call(t,"wpcafe_pro_food_order_shortcode_fields",{template:(0,r.jsx)(l.pp,{control:b,name:"template",options:j,label:(0,o.__)("Select Template","wp-cafe"),placeholder:(0,o.__)("Select a template","wp-cafe"),tooltip:(0,o.__)("Select the display template for this shortcode.","wp-cafe")}),style:(0,r.jsx)(l.pp,{control:b,name:"style",options:F,label:(0,o.__)("Style","wp-cafe"),placeholder:(0,o.__)("Select a style","wp-cafe"),tooltip:(0,o.__)("Visual style variant for the selected template.","wp-cafe")}),wpc_menu_order:(0,r.jsx)(l.pp,{control:b,name:"wpc_menu_order",options:m,label:(0,o.__)("Menu Order","wp-cafe"),placeholder:(0,o.__)("Select order","wp-cafe"),tooltip:(0,o.__)("Sort items ascending or descending.","wp-cafe")}),no_of_product:(0,r.jsx)(l.Q7,{control:b,name:"no_of_product",label:(0,o.__)("Number of Products","wp-cafe"),placeholder:(0,o.__)("Enter number of products","wp-cafe"),tooltip:(0,o.__)("Total number of products to display.","wp-cafe")}),wpc_food_categories:(0,r.jsx)(u.default,{control:b,name:"wpc_food_categories",tooltip:(0,o.__)("Filter the menu by specific categories. Leave empty to show all.","wp-cafe"),isMulti:!0}),wpc_show_desc:(0,r.jsx)(l.pp,{control:b,name:"wpc_show_desc",options:_,label:(0,o.__)("Show Description","wp-cafe"),placeholder:(0,o.__)("Show description?","wp-cafe"),tooltip:(0,o.__)("Display the product short description under each item.","wp-cafe")}
1),wpc_desc_limit:(0,r.jsx)(l.Q7,{control:b,name:"wpc_desc_limit",label:(0,o.__)("Description Limit","wp-cafe"),placeholder:(0,o.__)("Enter description limit","wp-cafe"),tooltip:(0,o.__)("Maximum description length (varies by theme integration).","wp-cafe")}),title_link_show:(0,r.jsx)(l.pp,{control:b,name:"title_link_show",options:_,label:(0,o.__)("Show Title Link","wp-cafe"),placeholder:(0,o.__)("Link title to product?","wp-cafe"),tooltip:(0,o.__)("Make item titles clickable and link to the single product page.","wp-cafe")}),show_item_status:(0,r.jsx)(l.pp,{control:b,name:"show_item_status",options:_,label:(0,o.__)("Show Item Status","wp-cafe"),placeholder:(0,o.__)("Show item status?","wp-cafe"),tooltip:(0,o.__)("Display in-stock or availability status.","wp-cafe")}),show_item_label:(0,r.jsx)(l.pp,{control:b,name:"show_item_label",options:_,label:(0,o.__)("Show Product Labels","wp-cafe"),placeholder:(0,o.__)("Show product labels?","wp-cafe"),tooltip:(0,o.__)("Display product label badges (Vegan, Spicy, etc.) on each item.","wp-cafe")}),wpc_show_vendor:(0,r.jsx)(l.pp,{control:b,name:"wpc_show_vendor",options:_,label:(0,o.__)("Show Vendor","wp-cafe"),placeholder:(0,o.__)("Show vendor name?","wp-cafe"),tooltip:(0,o.__)("Display the vendor/store name on each product card. Needs an active multivendor addon.","wp-cafe")}),show_thumbnail:(0,r.jsx)(l.pp,{control:b,name:"show_thumbnail",options:_,label:(0,o.__)("Show Product Thumbnail","wp-cafe"),placeholder:(0,o.__)("Show thumbnail?","wp-cafe"),tooltip:(0,o.__)("Display featured image for each product.","wp-cafe")}),wpc_cart_button:(0,r.jsx)(l.pp,{control:b,name:"wpc_cart_button",options:_,label:(0,o.__)("Show Cart Button","wp-cafe"),placeholder:(0,o.__)("Show cart button?","wp-cafe"),tooltip:(0,o.__)("Display Add to Cart button for each product.","wp-cafe")}),wpc_price_show:(0,r.jsx)(l.pp,{control:b,name:"wpc_price_show",options:_,label:(0,o.__)("Show Price","wp-cafe"),placeholder:(0,o.__)("Show price?","wp-cafe"),tooltip:(0,o.__)("Display product price.","wp-cafe")}),show_pagination:(0,r.jsx)(l.pp,{control:b,name:"show_pagination",options:_,label:(0,o.__)("Show Pagination","wp-cafe"),placeholder:(0,o.__)("Show pagination?","wp-cafe"),tooltip:(0,o.__)("Display numbered pagination beneath the menu when products exceed the per-page count.","wp-cafe")}),grid_columns:(0,r.jsx)(l.Q7,{control:b,name:"grid_columns",label:(0,o.__)("Grid Columns","wp-cafe"),placeholder:(0,o.__)("Enter number of columns","wp-cafe"),tooltip:(0,o.__)("Number of cards per row on desktop. The grid drops to fewer columns on smaller screens.","wp-cafe")}),location_alignment:(0,r.jsx)(l.pp,{control:b,name:"location_alignment",options:h,label:(0,o.__)("Location Alignment","wp-cafe"),placeholder:(0,o.__)("Select alignment","wp-cafe"),tooltip:(0,o.__)("Align the location filter/navigation.","wp-cafe")}),location_limit:(0,r.jsx)(l.Q7,{control:b,name:"location_limit",label:(0,o.__)("Location Limit","wp-cafe"),placeholder:(0,o.__)("Enter location limit","wp-cafe"),tooltip:(0,o.__)("Maximum number of locations to show.","wp-cafe")}),live_search:(0,r.jsx)(l.pp,{control:b,name:"live_search",options:_,label:(0,o.__)("Live Search","wp-cafe"),placeholder:(0,o.__)("Enable live search?","wp-cafe"),tooltip:(0,o.__)("Allow users to search products instantly without page reload.","wp-cafe")}),wpc_slider_count:(0,r.jsx)(l.Q7,{control:b,name:"wpc_slider_count",label:(0,o.__)("Slider Count","wp-cafe"),placeholder:(0,o.__)("Enter slider item count","wp-cafe"),tooltip:(0,o.__)("Number of items visible per slide.","wp-cafe")}),wpc_auto_play:(0,r.jsx)(l.pp,{control:b,name:"wpc_auto_play",options:_,label:(0,o.__)("Auto Play","wp-cafe"),placeholder:(0,o.__)("Enable auto play?","wp-cafe"),tooltip:(0,o.__)("Automatically rotate slider items.","wp-cafe")}),wpc_slider_nav_show:(0,r.jsx)(l.pp,{control:b,name:"wpc_slider_nav_show",options:_,label:(0,o.__)("Show Slider Navigation","wp-cafe"),placeholder:(0,o.__)("Show navigation arrows?","wp-cafe"),tooltip:(0,o.__)("Display previous/next arrows on the slider.","wp-cafe")}),wpc_slider_dot_show:(0,r.jsx)(l.pp,{control:b,name:"wpc_slider_dot_show",options:_,label:(0,o.__)("Show Slider Dots","wp-cafe"),placeholder:(0,o.__)("Show pagination dots?","wp-cafe"),tooltip:(0,o.__)("Display dot indicators for the slider.","wp-cafe")}),wpc_delivery_time_show:(0,r.jsx)(l.pp,{control:b,name:"wpc_delivery_time_show",options:_,label:(0,o.__)("Show Delivery Time","wp-cafe"),placeholder:(0,o.__)("Show delivery time?","wp-cafe"),tooltip:(0,o.__)("Display estimated delivery time for items.","wp-cafe")}),wpc_nav_position:(0,r.jsx)(l.pp,{control:b,name:"wpc_nav_position",options:w,label:(0,o.__)("Navigation Position","wp-cafe"),placeholder:(0,o.__)("Select navigation position","wp-cafe"),tooltip:(0,o.__)("Position of the tab navigation.","wp-cafe")})},{SelectInput:l.pp,NumberInput:l.Q7,TextInput:l.ks,getLocations:T,yesNoOptions:_,control:b}),D=null==N?void 0:N.filter(function(e){return(0,c.isFieldVisible)(k,e,C,A)});return(0,r.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:null==D?void 0:D.map(function(e){return(0,r.jsx)("div",{className:"pb-4",children:z[e]},String(e))})})}:null;n.d(t,["default",0,v])},65683(e,t,n){n.r(t),n.d(t,{foodMenuFieldConditions:()=>l,getFoodMenuStyleOptions:()=>i,getNavPositionOptions:()=>u,getShortcodes:()=>c,isFieldVisible:()=>s});var r=n(27723),o=n(19402);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var i=function(){return{wpc_food_menu_list:[{label:(0,r.__)("Style 1","wp-cafe"),value:"style-1"},{label:(0,r.__)("Style 2","wp-cafe"),value:"style-2"},{label:(0,r.__)("Style 3","wp-cafe"),value:"style-3"},{label:(0,r.__)("Style 4","wp-cafe"),value:"style-4"}],wpc_food_menu_tab:[{label:(0,r.__)("Style 1","wp-cafe"),value:"style-1"},{label:(0,r.__)("Style 2","wp-cafe"),value:"style-2"},{label:(0,r.__)("Style 3","wp-cafe"),value:"style-6"}]}},l=945==n.j?{grid_columns:{wpc_food_menu_tab:["style-6"]}}:null,s=function(e,t,n,r){var o=null==e?void 0:e[t];if(!o)return!0;var a=o[n];return!!a&&a.includes(r)},c=function(){var e,t,n,s,c=(0,o.ze)();
1return[{id:"wpc_food_menu_list",label:(0,r.__)("Food Menu","wp-cafe"),description:(0,r.__)("Displays your core food items in a customizable list or grid format with pricing and direct ordering buttons.","wp-cafe"),fields:["template","style","wpc_menu_order","no_of_product","wpc_food_categories","wpc_show_desc","wpc_desc_limit","title_link_show","show_item_status","show_item_label","wpc_show_vendor","show_thumbnail","wpc_cart_button","wpc_price_show","show_pagination","grid_columns"],template_options:c,style_options_by_template:i(),field_conditions:l,fieldMapping:{show_thumbnail:"product_thumbnail"},defaultValues:{template:"wpc_food_menu_list",style:"style-1",wpc_menu_order:"ASC",no_of_product:20,wpc_food_categories:[],wpc_show_desc:"yes",wpc_desc_limit:20,title_link_show:"yes",show_item_status:"yes",show_item_label:"no",wpc_show_vendor:"no",show_thumbnail:"yes",wpc_cart_button:"yes",wpc_price_show:"yes",show_pagination:"yes",grid_columns:3}},{id:"wpc_food_location_menu",label:(0,r.__)("Filter Food Menu By Location","wp-cafe"),description:(0,r.__)("Displays the food menu specifically filtered by a selected restaurant branch or delivery area.","wp-cafe"),fields:["template","style","wpc_menu_order","no_of_product","wpc_show_desc","wpc_desc_limit","title_link_show","show_item_status","show_item_label","wpc_show_vendor","show_thumbnail","wpc_cart_button","wpc_price_show","show_pagination"],template_options:[{label:(0,r.__)("Food Menu List","wp-cafe"),value:"wpc_food_menu_list"}],style_option:1,defaultValues:{template:"wpc_food_menu_list",style:"style-1",wpc_menu_order:"ASC",no_of_product:20,wpc_show_desc:"yes",wpc_desc_limit:20,title_link_show:"yes",show_item_status:"yes",show_item_label:"no",wpc_show_vendor:"no",show_thumbnail:"yes",wpc_cart_button:"yes",wpc_price_show:"yes",show_pagination:"yes"}},{id:"wpc_restaurant_management_dashboard",label:(0,r.__)("Restaurant Management Panel","wp-cafe"),description:(0,r.__)("Embeds the role-based restaurant panel where logged-in users view their orders, reservations, and profile.","wp-cafe"),fields:[],defaultValues:{}},{id:"food_location_filter",label:(0,r.__)("Location Filter","wp-cafe"),description:(0,r.__)("Renders a simple filter interface allowing customers to select their preferred restaurant location before browsing the menu.","wp-cafe"),fields:["template","location_alignment"],template_options:[{label:(0,r.__)("Location Filter","wp-cafe"),value:"food_location_filter"}],defaultValues:{template:"food_location_filter",location_alignment:"center"}}].concat(function(e){if(Array.isArray(e))return a(e)}(s=null===(n=null===(t=null===(e=null===window||void 0===window?void 0:window.wp)||void 0===e?void 0:e.hooks)||void 0===t?void 0:t.applyFilters)||void 0===n?void 0:n.call(t,"wpcafe_pro_food_order_shortcodes",[{id:"wpc_pro_menu_category_list",label:(0,r.__)("Category List (Pro)","wp-cafe"),description:(0,r.__)("Showcases a list or grid of food categories (e.g., breakfast, drinks) to help customers browse items by type.","wp-cafe"),isPro:!0},{id:"wpc_pro_menu_location_list",label:(0,r.__)("Location List (Pro)","wp-cafe"),description:(0,r.__)("Displays a list of all your restaurant branches or locations for customers to view and select their preferred store.","wp-cafe"),isPro:!0},{id:"wpc_pro_food_menu_list",label:(0,r.__)("Food Menu List and Tab (Pro)","wp-cafe"),description:(0,r.__)("Organizes the food menu into stylish, navigable category tabs for easy, clutter-free browsing and quick ordering.","wp-cafe"),isPro:!0},{id:"wpc_pro_menu_tab_with_slider",label:(0,r.__)("Food Menu Slider (Pro)","wp-cafe"),description:(0,r.__)("Presents your featured dishes, specials, or menu items in an engaging, rotating carousel or slider layout.","wp-cafe"),isPro:!0},{id:"wpc_pro_food_menu_loadmore",label:(0,r.__)("Food Menu Loadmore (Pro)","wp-cafe"),description:(0,r.__)('Implements an AJAX "Load More" button to dynamically load additional menu items onto the page without a full reload, improving user experience.',"wp-cafe"),isPro:!0},{id:"wpc_pickup_delivery_widget",label:(0,r.__)("Pickup Delivery Widget (Pro)","wp-cafe"),description:(0,r.__)("Displays a
1search input with pickup and delivery button","wp-cafe"),isPro:!0},{id:"wpc_product_filter",label:(0,r.__)("Product Filter Widget (Pro)","wp-cafe"),description:(0,r.__)("Displays filters for food items based on categories, price range, ratings, and more.","wp-cafe"),isPro:!0},{id:"wpc_one_page_checkout",label:(0,r.__)("One Page Checkout (Pro)","wp-cafe"),description:(0,r.__)("Displays a streamlined single-page checkout experience allowing customers to browse, select, and complete their order on one page.","wp-cafe"),isPro:!0}]))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(s)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(s)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())},u=function(){return[{label:(0,r.__)("Top","wp-cafe"),value:"top"},{label:(0,r.__)("Bottom","wp-cafe"),value:"bottom"}]}},80746(e,t,n){n.r(t),n.d(t,{foodOrderShortcodeSchema:()=>a});var r=n(27723),o=n(57937),a=o.z.object({template:o.z.string(),style:o.z.string(),wpc_menu_order:o.z.string(),no_of_product:o.z.number(),wpc_food_categories:o.z.array(o.z.number()),wpc_show_desc:o.z.string(),wpc_desc_limit:o.z.number(),title_link_show:o.z.string(),show_item_status:o.z.string(),show_item_label:o.z.string(),show_thumbnail:o.z.string(),wpc_show_vendor:o.z.string(),wpc_cart_button:o.z.string(),wpc_price_show:o.z.string(),show_pagination:o.z.string(),location_alignment:o.z.string(),grid_columns:o.z.number(),hide_empty:o.z.string(),category_limit:o.z.number(),show_count:o.z.string(),grid_column:o.z.number(),location_ids:o.z.array(o.z.number()),location_limit:o.z.number(),live_search:o.z.string(),wpc_delivery_time_show:o.z.string(),wpc_nav_position:o.z.string(),wpc_slider_count:o.z.number(),wpc_auto_play:o.z.string(),wpc_slider_nav_show:o.z.string(),wpc_slider_dot_show:o.z.string(),pickup_btn_text:o.z.string(),delivery_btn_text:o.z.string(),search_page:o.z.string().min(1,(0,r.__)("Search page is required","wp-cafe")),show_search:o.z.string(),show_pickup_delivery:o.z.string(),show_location:o.z.string(),show_perpage:o.z.string(),show_price_range:o.z.string(),show_categories:o.z.string()}).partial()},63939(e,t,n){n.r(t);var r=n(47143),o=n(19402),a=n(27820),i=n(65683);function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const c=945==n.j?function(){var e=(0,r.useDispatch)(null===o.zQ||void 0===o.zQ?void 0:o.zQ.shortcodes).setShortcodeState,t=(0,r.useSelect)(function(e){return e(null===o.zQ||void 0===o.zQ?void 0:o.zQ.shortcodes).getShortcodeState()},[]);return Object.assign(Object.assign({},t),{generateShortcode:function(n,r){var o,s,c,u=n.template,d=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(n,["template"]),p=(null==r?void 0:r.template)&&u?u:null===(o=null==t?void 0:t.selectedShortcode)||void 0===o?void 0:o.id,f=(null===(s=null==t?void 0:t.selectedShortcode)||void 0===s?void 0:s.fieldMapping)||{},v=null===(c=null==t?void 0:t.selectedShortcode)||void 0===c?void 0:c.field_conditions,m=Object.entries(d).filter(function(e){var t,n=l(e,1)[0];return(0,i.isFieldVisible)(v,n,String(p),String(null!==(t=d.style)&&void 0!==t?t:""))}).map(function(e){var t=l(e,2),n=t[0],r=t[1],o=f[n]||n,a=function(e){if(null==e)return null;if(Array.isArray(e)){var t=e.map(function(e){return String(e).trim()}
1).filter(Boolean).join(",");return t.length?t:null}if("string"==typeof e){var n=e.trim();return n.length?n:null}return"number"==typeof e||"boolean"==typeof e?String(e):null}(r);return a?"".concat(o,'="').concat(a,'"'):null}).filter(Boolean).join(" "),_=m?"[".concat(p," ").concat(m,"]"):"[".concat(p,"]");e({generatedShortcode:_}),(0,a.pl)()}})}:null;n.d(t,["default",0,c])},13516(e,t,n){n.r(t);var r=n(74848),o=n(86087),a=n(55634),i=n(65683),l=n(39992);const s=945==n.j?function(){var e=(0,l.X_)(),t=(0,o.useMemo)(function(){return(0,i.getShortcodes)()},[e]);return(0,r.jsx)(r.Fragment,{children:t.map(function(e){return(0,r.jsx)(a.A,{shortcode:e},e.id)})})}:null;n.d(t,["default",0,s])},39053(e,t,n){n.r(t);var r=n(74848),o=n(86087);if(945==n.j)var a=n(24701);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var l=(0,o.lazy)(function(){return Promise.all([n.e(997),n.e(1721),n.e(1657),n.e(3322),n.e(7803),n.e(3076),n.e(8375),n.e(5508),n.e(8472),n.e(2032),n.e(4078),n.e(9765),n.e(1871),n.e(1962),n.e(9936),n.e(9912),n.e(4999),n.e(1733),n.e(2400),n.e(886),n.e(4698),n.e(1563)]).then(n.bind(n,98904))});const s=945==n.j?function(e,t){var n,o,s,c,u=function(e){if(Array.isArray(e))return i(e)}(c=e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(c)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(c)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();return window.wpCafe=Object.assign(null!==(n=window.wpCafe)&&void 0!==n?n:{},{router:t}),null===(s=null===(o=null==u?void 0:u[0])||void 0===o?void 0:o.children)||void 0===s||s.unshift({path:a.FOOD_MENU_PATH,element:(0,r.jsx)(l,{}),errorElement:(0,r.jsx)(t.ErrorPage,{})}),u}:null;n.d(t,["default",0,s])},24701(e,t,n){n.r(t),n.d(t,{FOOD_MENU_PATH:()=>r});var r="/food-menu"},12234(e,t,n){n.r(t),n(87777)},92266(e,t,n){n.r(t),n(55080),n(34061)},69552(e,t,n){n.r(t);var r=n(74848),o=n(27723),a=n(86087),i=n(38802),l=n(62468),s=n(71112);if(945==n.j)var c=n(29696);if(945==n.j)var u=n(1839);var d=n(31400),p=n(88388);function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return v(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const m=945==n.j?function(e){var t=e.control,n=e.name,v=e.label,m=e.tooltip,_=e.required,h=void 0!==_&&_,w=f((0,a.useState)(!1),2),g=w[0],b=w[1],y=function(e,t){var n=t.onChange,r=t.value;n({type:"predefined",value:e===(null==r?void 0:r.value)?"":e}),b(!1)},x=function(e){if(!e)return(0,r.jsx)(c.A,{className:"w-6 h-6 text-muted-foreground"});if("custom"===e.type&&e.value)return(0,r.jsx)("img",{src:e.value,alt:e.name||"Custom icon",className:"w-6 h-6 dark:invert"});if("predefined"===e.type){var t=p.defaultIcons[e.value];return t?(0,r.jsx)("img",{src:t,alt:e.name||"Custom icon",className:"w-6 h-6 dark:invert"}):(0,r.jsx)(c.A,{className:"w-6 h-6 text-gray-400"})}return(0,r.jsx)(c.A,{className:"w-6 h-6 text-muted-foreground"})};return(0,r.jsx)(i.ZQ,{control:t,name:n,label:v,tooltip:m,required:h,inputField:function(e){var t;return(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("div",{className:"w-full flex items-center",children:[(0,r.jsxs)(l.Dialog,{open:g,onOpenChange:b,children:[(0,r.jsx)(l.DialogTrigger,{asChild:!0,children:(0,r.jsx)(l.Button,{type:"button",variant:"lightOutline",className:"shrink-0 w-11 h-11 p-0! border border-input justify-center rounded-md",children:x(e.value)})}),(0,r.jsxs)(l.DialogContent,{className:"max-w-lg max-h-[90vh] overflow-hidden",children:[(0,r.jsxs)(l.DialogHeader,{children:[(0,r.jsx)(l.DialogTitle,{children:(0,o.__)("Select Icon","wp-cafe")}),(0,r.jsx)(l.DialogDescription,{className:"sr-only",children:(0,o.__)("Choose an icon from the grid or upload a custom SVG icon.","wp-cafe")})]}),(0,r.jsx)("div",{className:"max-h-[calc(90vh-120px)] overflow-y-auto",children:(0,r.jsx)("div",{className:"space-y-6",children:(0,r.jsx)("div",{className:"grid grid-cols-5 ga
1p-4",role:"radiogroup","aria-label":(0,o.__)("Select predefined icon","wp-cafe"),children:Object.entries(p.defaultIcons).map(function(t){var n,o,a=f(t,2),i=a[0],u=a[1];return(0,r.jsx)(l.Button,{variant:"lightOutline",role:"radio","aria-checked":(null===(n=e.value)||void 0===n?void 0:n.value)===i,onClick:function(){return y(i,e)},className:(0,s.cn)("p-2! sm:px-4! h-auto dark:border-slate-700 hover:border-primary transition-colors",(null===(o=e.value)||void 0===o?void 0:o.value)===i&&"border-primary"),size:"lg",children:i?(0,r.jsx)("img",{src:u,alt:i||"Custom icon",className:"w-6 h-6 dark:invert"}):(0,r.jsx)(c.A,{className:"w-6 h-6 text-foreground"})},i)})})})})]})]}),(0,r.jsx)(d.default,{setFileUrl:function(t){e.onChange({type:"custom",value:t})},setFileId:function(){}})]}),(null===(t=null==e?void 0:e.value)||void 0===t?void 0:t.value)&&(0,r.jsx)(i.uW,{onConfirm:function(){var t;return y(null===(t=null==e?void 0:e.value)||void 0===t?void 0:t.value,e)},trigger:(0,r.jsx)(l.Button,{type:"button",variant:"danger",className:"bg-danger/10",children:(0,r.jsx)(u.A,{className:"text-muted-foreground"})})})]})}})}:null;n.d(t,["default",0,m])},36288(e,t,n){n.r(t);var r=n(74848),o=n(10404);if(945==n.j)var a=n(79804);var i=n(62468),l=n(38802);const s=945==n.j?function(e){var t=e.control,n=e.name,s=e.label,c=e.options,u=e.defaultValue;return(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)(i.FormLabel,{htmlFor:n,className:"text-neutral-500 text-[18px] font-semibold mb-4",children:s}),(0,r.jsx)(o.Controller,{control:t,name:n,defaultValue:u,render:function(e){var t=e.field;return(0,r.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:c.map(function(e){return(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("input",{type:"radio",id:"".concat(n,"-").concat(e.value),value:e.value,checked:t.value===e.value,onChange:function(){return t.onChange(e.value)},className:"sr-only peer"}),(0,r.jsxs)("label",{htmlFor:"".concat(n,"-").concat(e.value),className:"flex flex-col rounded-lg cursor-pointer peer-checked:border-primary peer-checked:shadow-md transition-all border border-black/20 h-full",children:[t.value===e.value&&(0,r.jsx)("span",{className:"absolute top-2 right-2 animate-in zoom-in-50 duration-200",children:(0,r.jsx)(a.A,{className:"w-8 h-8 fill-primary stroke-white"})}),(0,r.jsx)("div",{className:"p-3 rounded-t-lg bg-visual-100/40 ",children:(0,r.jsx)(l._V,{src:e.previewImg,alt:e.label,className:"rounded-lg shadow!",objectFit:"contain"})}),(0,r.jsxs)("div",{className:"p-3 space-y-1",children:[(0,r.jsx)("div",{className:"text-sm font-medium transition-colors ".concat(t.value===e.value?"text-primary font-medium":"text-neutral-500"),children:e.label}),(0,r.jsx)("div",{className:"text-xs text-gray-400",children:e.description})]})]})]},e.value)})})}})]})}:null;n.d(t,["default",0,s])},31400(e,t,n){n.r(t);var r=n(74848),o=n(27723),a=n(38802),i=n(27820);const l=945==n.j?function(e){var t=e.setFileUrl,n=e.setFileId,l=void 0===n?function(){}:n,s=e.cacheKey,c=void 0===s?"svgMediaUploader":s;return(0,r.jsx)(a.VY,{onClick:function(e){(0,i.OW)(e,t,{title:(0,o.__)("Choose SVG Icon","wp-cafe"),libraryType:["image"],mimeCheck:function(e){return"image/svg+xml"===e},cacheKey:c,allowedMime:"image/svg+xml"},l)},className:"flex w-full border border-l-0 border-input items-center h-11 rounded-r-md justify-center -ml-2 cursor-pointer hover:text-neutral-600",children:(0,o.__)("Upload svg icon","wp-cafe")})}:null;n.d(t,["default",0,l])},88388(e,t,n){n.r(t),n.d(t,{defaultIcons:()=>h,miniCartStyleOptions:()=>_});var r=n(27723),o=n(80352),a=n(95797),i=n(58822),l=n(72009),s=n(71734),c=n(58392),u=n(68238),d=n(62223),p=n(29954),f=n(97183),v=n(99225),m=n(85399),_=[{value:"style-1",label:(0,r.__)("Style 1","wp-cafe"),description:(0,r.__)("Alternative layout focused on checkout and summary.","wp-cafe"),previewImg:a},{value:"style-2",label:(0,r.__)("Style 2","wp-cafe"),description:(0,r.__)("Standard layout with items, quantities, and totals.","wp-cafe"),previewImg:o}],h=945==n.j?{"basket-outline":i.A,"shopping-bag-outline":l.A,"cart-outline":s.A,"bag-outline":c.A,"trolly-outline":u.A,"basket-fill":d.A,"shopping-bag-fill":p.A,"cart-fill":f.A,"bag-fill":v.A,"trolly-fill":m.A}:null},65687(e,t,n){n.r(t);var r=n(74848),o=n(27723),a=n(10404),i=n(38802),l=n(62468),s=n(36288),
1c=n(69552),u=n(88388);const d=945==n.j?function(){var e=(0,a.useFormContext)(),t=e.control,n=e.getValues;return(0,r.jsx)(i.bg,{title:(0,o.__)("Minicart Icons Settings","wp-cafe"),description:(0,o.__)("Choose your preferred icons for the cart and menu pop-up to match your design style.","wp-cafe"),className:"rounded-md",children:(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)(l.Card,{className:"shadow-none rounded-md",children:(0,r.jsx)(s.default,{control:t,name:"mini_cart_style",label:(0,o.__)("Mini Cart Style","wp-cafe"),options:u.miniCartStyleOptions,defaultValue:n("mini_cart_style")})}),(0,r.jsx)(l.Card,{children:(0,r.jsxs)("div",{className:"grid gap-5 sm:grid-cols-2",children:[(0,r.jsx)(c.default,{control:t,label:(0,o.__)("Mini-cart Icon","wp-cafe"),name:"mini_cart_icon",tooltip:(0,o.__)("Select an icon for your mini cart or upload custom svg icon.","wp-cafe")}),(0,r.jsx)(i.Z3,{control:t,label:(0,o.__)("Mini Cart Empty Button Link","wp-cafe"),name:"mini_cart_empty_button_link",tooltip:(0,o.__)("Enter a link for the mini cart empty button","wp-cafe"),placeholder:(0,o.__)("URL","wp-cafe")})]})})]})}),(0,r.jsx)(l.Card,{children:(0,r.jsxs)("div",{className:"grid gap-5 sm:grid-cols-2",children:[(0,r.jsx)(c.default,{control:t,label:(0,o.__)("Cart Icon","wp-cafe"),name:"cart_icon",tooltip:(0,o.__)("Select an icon for your cart or upload custom svg icon.","wp-cafe")}),(0,r.jsx)(c.default,{control:t,label:(0,o.__)("Menu PopUp Icon","wp-cafe"),name:"menu_popup_icon",tooltip:(0,o.__)("Select an icon for your menu pop-up or upload custom svg icon.","wp-cafe")})]})}),(0,r.jsx)(i.q5,{title:(0,o.__)("Show per-item tax","wp-cafe"),name:"mini_cart_show_per_item_tax",description:(0,o.__)("Display the tax amount for each line item below its subtotal in the mini-cart. The totals tax breakdown is always shown when taxes apply.","wp-cafe")})]})})}:null;n.d(t,["default",0,d])},55080(e,t,n){n.r(t);var r,o,a,i=n(74848),l=n(65687);null===(a=null===(o=null===(r=null===window||void 0===window?void 0:window.wp)||void 0===r?void 0:r.hooks)||void 0===o?void 0:o.addFilter)||void 0===a||a.call(o,"wpcafe_mini_cart_settings","wp-cafe",function(){return(0,i.jsx)(l.default,{})},10)},48267(e,t,n){n.r(t);var r=n(74848),o=n(27723),a=n(10404),i=n(38802);const l=945==n.j?function(){var e=(0,a.useFormContext)(),t=e.getValues,n=e.setValue,l=e.control,s=null==t?void 0:t("enable_custom_tipping");return(0,r.jsx)(i.X,{title:(0,o.__)("Allow Custom Tipping Amount","wp-cafe"),description:(0,o.__)("Provide customers the option to enter a custom tip amount during checkout.","wp-cafe"),switchable:!0,defaultEnabled:s,onToggle:function(e){return null==n?void 0:n("enable_custom_tipping",e)},children:(0,r.jsx)(i.ks,{type:"text",placeholder:(0,o.__)("Custom tip","wp-cafe"),label:(0,o.__)("Custom tipping label","wp-cafe"),control:l,name:"custom_tipping_label"})})}:null;n.d(t,["default",0,l])},2612(e,t,n){n.r(t);var r=n(74848),o=n(27723);if(945==n.j)var a=n(97213);if(945==n.j)var i=n(80697);if(945==n.j)var l=n(1839);var s=n(45277),c=n(38802),u=n(62468);const d=945==n.j?function(){var e=(0,s.default)(),t=e.tipOptions,n=e.addTipOption,d=e.removeTipOption,p=e.tippingCalculationMethod,f=e.control;return(0,r.jsxs)("div",{className:"space-y-3 bg-card p-4 rounded-md",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("h4",{className:"text-[15px]! font-medium text-black/80 my-0!",children:(0,o.__)("Set Tip Options","wp-cafe")}),(0,r.jsx)(u.TooltipProvider,{children:(0,r.jsxs)(u.Tooltip,{children:[(0,r.jsx)(u.TooltipTrigger,{children:(0,r.jsx)(a.A,{className:"h-4 w-4 text-black/40"})}),(0,r.jsx)(u.TooltipContent,{children:(0,r.jsx)("p",{className:"max-w-xs text-sm",children:(0,o.__)("Provides different tipping options for customers to choose from. Options can be fixed amounts or percentages based on the total order value.","wp-cafe")})})]})})]}),(0,r.jsx)("div",{className:"space-y-5 max-w-1/2",children:t.map(function(e,t){return(0,r.jsxs)("div",{className:"flex items-center gap-3 group",children:[(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsx)(c.bz,{control:f,name:"tip_options.".concat(t),placeholder:"fixed_amount"===p?(0,o.__)("10.00","wp-cafe"):(0,o.__)("15","wp-cafe"),prefix:"percentage_amount"===p?"%":(0,r.jsx)(c.vi,{}),type:"number"})}),(0,r.jsx)(c.uW,{onConfirm:function(){return d(t)},trigger:(0,r.jsx)(u.Button,{variant:"ghost",size:"icon",className:"h-8 w-8 text-danger hover:bg-danger/5",title:(0,o.__)("Delete tip option","wp-cafe"),children:(0,r.jsx)(l.A,{className:"w-4 h-4"})})})]},t)})}),(0,r.jsx)("div",{className:"mt-4",children:(0,r.jsxs)(u.Button,{type:"button",variant:"outlinePrimary",size:"sm",onClick:n,className:"flex items-center gap-2",children:[(0,r.jsx)(i.A,{className:"w-4 h-4"}),(0,o.__)("Add new","wp-cafe")]})})]})}:null;n.d(t,["default",0,d])},27541(e,t,n){n.r(t);var r=n(74848),o=n(10404),a=n(48267),i=n(19363),l=n(2612);const s=945==n.j?function(){var e=(0,o.useFormContext)().watch,t=null==e?void 0:e("tipping_calculation_method");return(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)(i.default,{}),t&&(0,r.jsx)(l.default,{}),(0,r.jsx)(a.default,{})]})}:null;n.d(t,["default",0,s])},81012(e,t,n){n.r(t);var r=n(74848),o=n(27723),a=n(27541),i=n(38802);const l=945==n.j?function(){return(0,r.jsx)(i.bg,{title:(0,o.__)("Tipping Settings","wp-cafe"),description:(0,o.__)("Allow customers to add a tip during checkout to supp
1ort your staff or service team.","wp-cafe"),className:"rounded-md",children:(0,r.jsx)(i.X,{title:(0,o.__)("Tipping","wp-cafe"),description:(0,o.__)("Allow customers to leave a tip during checkout.","wp-cafe"),children:(0,r.jsx)(a.default,{})})})}:null;n.d(t,["default",0,l])},19363(e,t,n){n.r(t);var r=n(74848),o=n(27723),a=n(10404),i=n(49347),l=n(38802);const s=945==n.j?function(){var e=(0,a.useFormContext)().control;return(0,r.jsx)(l.LL,{control:e,name:"tipping_calculation_method",options:i.tippingOptions,required:!1,label:(0,o.__)("Tipping Type","wp-cafe")})}:null;n.d(t,["default",0,s])},49347(e,t,n){n.r(t),n.d(t,{tippingOptions:()=>i});var r=n(74848),o=n(27723),a=n(38802),i=[{label:(0,r.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,o.__)("Fixed Amount","wp-cafe")," ",(0,r.jsx)(a.vi,{})]}),value:"fixed_amount",description:(0,o.__)("Set specific amounts like 5, 10, 15 in your active currency","wp-cafe")},{label:(0,r.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,o.__)("Percentage Amount","wp-cafe")," (%)"]}),value:"percentage_amount",description:(0,o.__)("Set percentage values like 10%, 15%, 20%","wp-cafe")}]},45277(e,t,n){n.r(t),n.d(t,{useTipOptions:()=>a});var r=n(10404);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var a=function(){var e=(0,r.useFormContext)(),t=e.control,n=e.watch,a=e.setValue,i=e.getValues,l=null==n?void 0:n("tipping_calculation_method"),s=function(e,t){a(e,t,{shouldDirty:!0,shouldTouch:!0})};return{tipOptions:(null==n?void 0:n("tip_options"))||[],addTipOption:function(){var e,t=(null==i?void 0:i("tip_options"))||[],n=[].concat(function(e){if(Array.isArray(e))return o(e)}(e=t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[0]);s("tip_options",n)},removeTipOption:function(e){var t=((null==i?void 0:i("tip_options"))||[]).filter(function(t,n){return n!==e});s("tip_options",t)},tippingCalculationMethod:l,control:t}};const i=945==n.j?a:null;n.d(t,["default",0,i])},34061(e,t,n){n.r(t);var r,o,a,i=n(74848),l=n(81012);null===(a=null===(o=null===(r=null===window||void 0===window?void 0:window.wp)||void 0===r?void 0:r.hooks)||void 0===o?void 0:o.addFilter)||void 0===a||a.call(o,"wpcafe_tipping_settings","wp-cafe",function(e,t){return(0,i.jsx)(l.default,Object.assign({},t))},10)},77036(e,t,n){n.r(t);var r,o,a,i=n(39053);null===(a=null===(o=null===(r=null===window||void 0===window?void 0:window.wp)||void 0===r?void 0:r.hooks)||void 0===o?void 0:o.addFilter)||void 0===a||a.call(o,"wp_cafe_router","wp-cafe",i.default,10)},38383(e,t,n){n.r(t);var r,o,a,i,l,s,c=n(74848),u=n(42594);null===(a=null===(o=null===(r=null===window||void 0===window?void 0:window.wp)||void 0===r?void 0:r.hooks)||void 0===o?void 0:o.removeFilter)||void 0===a||a.call(o,"wpcafe_search_input","wpcafe"),null===(s=null===(l=null===(i=null===window||void 0===window?void 0:window.wp)||void 0===i?void 0:i.hooks)||void 0===l?void 0:l.addFilter)||void 0===s||s.call(l,"wpcafe_search_input","wpcafe",function(e,t){return(0,c.jsx)(u.A,Object.assign({},t))},10)},81094(e,t,n){n.r(t);var r,o,a,i=n(74848),l=n(1961);null===(a=null===(o=null===(r=null===window||void 0===window?void 0:window.wp)||void 0===r?void 0:r.hooks)||void 0===o?void 0:o.addFilter)||void 0===a||a.call(o,"wpcafe_food_order_onboard","wp-cafe",function(e,t){return(0,i.jsx)(l.default,Object.assign({},t))},10)},49889(e,t,n){n.r(t);var r,o,a,i,l,s,c,u,d,p,f,v,m,_,h,w=n(74848),g=n(27723),b=n(38802),y=n(99490);null===(a=null===(o=null===(r=null===window||void 0===window?void 0:window.wp)||void 0===r?void 0:r.hooks)||void 0===o?void 0:o.addFilter)||void 0===a||a.call(o,"wpcafe_food_order_pickup_settings","wp-cafe",function(e,t){var n,r,o;return(null==t?void 0:t.enabled)?null===(o=null===(r=null===(n=null===window||void 0===window?void 0:window.wp)||void 0===n?void 0:n.hooks)||void 0===r?void 0:r.applyFilters)||void 0===o?void 0:o.call(r,"wpcafe_pickup_settings",(0,w.jsx)(b.Yg,{title:(0,g.__)("Enable Pickup","wp-cafe"),description:(0,g.__)("This will allow you to offer an in-store pickup option, letting customers place orders online and collect them on time.","wp-cafe"),isPro:!0,onAddButtonClick:function(){return null==t?void 0:t.handleNavigate("food_ordering")},learnMoreUrl:"https://support.themewinter.com/docs/plugins/plugin-docs/wpcafe-version-3/restaurant-pickup-setup-in-wpcafe/"}),t):(0,w.jsx)(b.Yg,{title:(0,g.__)("Enable Pickup","wp-cafe"),description:(0,g.__)("This will allow you to offer an in-store pickup option, letting customers place orders online and collect them on time.","wp-cafe"),isPro:!0,onAddButtonClick:function(){return null==t?void 0:t.handleNavigate("food_ordering")},learnMoreUrl:"https://support.themewinter.com/docs/plugins/plugin-docs/wpcafe-version-3/restaurant-pickup-setup-in-wpcafe/"})},10),null===(s=null===(l=null===(i=null===window||void 0===window?void 0:window.wp)||void 0===i?void 0:i.hooks)||void 0===l?void 0:l.addFilter)||void 0===s||s.call(l,"wpcafe_food_order_delivery_settings","wp-cafe",function(e,t){var n,r,o;return(null==t?void 0:t.enabled)?null===(o=null===(r=null===(n=null===window||void 0===window?void 0:window.wp)||void 0===n?void 0:n.hooks)||void 0===r?void 0:r.applyFilters)||void 0===o?void 0:o.call(r,"wpcafe_delivery_settings",(0,w.jsx)(b.Yg,{title:(0,g.__)("Enable Delivery","wp-cafe"),description:(0,g.__)("This allows you to provide customers a simple option to get their products by offering home delivery with adjustable dates, times, and costs.","wp-cafe"),isPro:!0,onAddButtonClick:function(){return null==t?void 0:t.handleNavigate("food_ordering")},learnMoreUrl:"https://support.themewinter.com/docs/plugins/plugin-docs/wpcafe-version-3/restaurant-delivery-setup-in-wpcafe/"}),t):(0,w.jsx)(b.Yg,{title:(0,g.__)("Enable Delivery","wp-cafe"),description:(0,g.__)("This allows you to provide customers a simple option to get their products by offering home delivery with adjustable dates, times, and costs.","wp-cafe"),isPro:!0,onAddButtonClick:function(){return null==t?void 0:t.handleNavigate("food_ordering")},learnMoreUrl:"https://support.themewinter.com/docs/plugins/plugin-docs/wpcafe-version-3/restaurant-delivery-setup-in-wpcafe/"})},10),null===(d=null===(u=null===(c=null===window||void 0===window?void 0:window.wp)||void 0===c?void 0:c.hooks)||void 0===u?void 0:u.addFilter)||void 0===d||d.call(u,"
1wpcafe_food_order_tipping_settings","wp-cafe",function(e,t){var n,r,o;return(null==t?void 0:t.enabled)?null===(o=null===(r=null===(n=null===window||void 0===window?void 0:window.wp)||void 0===n?void 0:n.hooks)||void 0===r?void 0:r.applyFilters)||void 0===o?void 0:o.call(r,"wpcafe_tipping_settings",(0,w.jsx)(b.Yg,{title:(0,g.__)("Enable Tipping","wp-cafe"),description:(0,g.__)("This will allow admin provide options for customers to add a tip during checkout.","wp-cafe"),onAddButtonClick:function(){return null==t?void 0:t.handleNavigate("food_ordering")},learnMoreUrl:"https://support.themewinter.com/docs/plugins/plugin-docs/wpcafe-version-3/how-to-set-up-tipping-using-wpcafe/"}),t):(0,w.jsx)(b.Yg,{title:(0,g.__)("Enable Tipping","wp-cafe"),description:(0,g.__)("This will allows admin provide options for customers to add a tip during checkout.","wp-cafe"),onAddButtonClick:function(){return null==t?void 0:t.handleNavigate("food_ordering")},learnMoreUrl:"https://support.themewinter.com/docs/plugins/plugin-docs/wpcafe-version-3/how-to-set-up-tipping-using-wpcafe/"})},10),null===(v=null===(f=null===(p=null===window||void 0===window?void 0:window.wp)||void 0===p?void 0:p.hooks)||void 0===f?void 0:f.addFilter)||void 0===v||v.call(f,"wpcafe_food_order_food_menu_settings","wp-cafe",function(){return(0,w.jsx)(y.default,{})},10),null===(h=null===(_=null===(m=null===window||void 0===window?void 0:window.wp)||void 0===m?void 0:m.hooks)||void 0===_?void 0:_.addFilter)||void 0===h||h.call(_,"wpcafe_food_order_mini_cart_settings","wp-cafe",function(e,t){var n,r,o;return(null==t?void 0:t.enabled)?null===(o=null===(r=null===(n=null===window||void 0===window?void 0:window.wp)||void 0===n?void 0:n.hooks)||void 0===r?void 0:r.applyFilters)||void 0===o?void 0:o.call(r,"wpcafe_mini_cart_settings",(0,w.jsx)(b.Yg,{title:(0,g.__)("Enable Mini Cart","wp-cafe"),description:(0,g.__)("This will allow the customer to view their selected items in a mini cart.","wp-cafe"),onAddButtonClick:function(){return null==t?void 0:t.handleNavigate("food_ordering")},learnMoreUrl:"https://support.themewinter.com/docs/plugins/plugin-docs/wpcafe-version-3/mini-cart-settings/"})):(0,w.jsx)(b.Yg,{title:(0,g.__)("Enable Mini Cart","wp-cafe"),description:(0,g.__)("This will allow the customer to view their selected items in a mini cart.","wp-cafe"),onAddButtonClick:function(){return null==t?void 0:t.handleNavigate("food_ordering")},learnMoreUrl:"https://support.themewinter.com/docs/plugins/plugin-docs/wpcafe-version-3/mini-cart-settings/"})},10)},23277(e,t,n){n.r(t);var r,o,a,i,l,s,c=n(74848),u=n(13516),d=n(37460);null===(a=null===(o=null===(r=null===window||void 0===window?void 0:window.wp)||void 0===r?void 0:r.hooks)||void 0===o?void 0:o.addFilter)||void 0===a||a.call(o,"wpcafe_food_ordering_shortcode","wp-cafe",function(){return(0,c.jsx)(u.default,{})},10),null===(s=null===(l=null===(i=null===window||void 0===window?void 0:window.wp)||void 0===i?void 0:i.hooks)||void 0===l?void 0:l.addFilter)||void 0===s||s.call(l,"wpcafe_food_ordering_shortcode_form","wp-cafe",function(){return(0,c.jsx)(d.default,{})},10)},18750(e,t,n){n.r(t),n(77036),n(49889),n(81094),n(23277),n(38383)},52847(e,t,n){n.r(t),n.d(t,{numericfields:()=>i,unitSelectorFields:()=>l});var r=n(74848),o=n(27723),a=n(38802),i=[{label:(0,o.__)("Minimum guests","wp-cafe"),tooltip:(0,o.__)("Lowest number of guests allowed per reservation","wp-cafe"),suffix:(0,o.__)("People","wp-cafe"),name:"reservation_minimum_guest",placeholder:(0,o.__)("10","wp-cafe")},{label:(0,o.__)("Maximum guests","wp-cafe"),tooltip:(0,o.__)("Highest number of guests allowed per reservation","wp-cafe"),suffix:(0,o.__)("People","wp-cafe"),name:"reservation_maximum_guest",placeholder:(0,o.__)("10","wp-cafe")},{label:(0,o.__)("Booking Amount","wp-cafe"),tooltip:(0,o.__)("Set the base amount charged per reservation. Enable the checkbox below to multiply this amount by the number of guests","wp-cafe"),prefix:(0,r.jsx)(a.vi,{}),name:"reservation_booking_amount",placeholder:(0,o.__)("e.g. 10.00","wp-cafe")},{label:(0,o.__)("Total seat capacity","wp-cafe"),tooltip:(0,o.__)("Total number of seats available for reservation of a time slot","wp-cafe"),suffix:(0,o.__)("People","wp-cafe"),name:"reservation_total_seat_capacity",placeholder:(0,o.__)("30","wp-cafe")}],l=[{label:(0,o.__)("Advance Reservation","wp-cafe"),tooltip:(0,o.__)("Set how early customers must book before their reservation date. Example: If you set 2 Days, customers canât book for today or tomorrow â bookings start from the day after tomorrow.","wp-cafe"),name:"reservation_advanced",placeholder:(0,o.__)("e.g. 2","wp-cafe"),unitOptions:[{value:"minutes",label:(0,o.__)("Minutes","wp-cafe")},{value:"hours",label:(0,o.__)("Hours","wp-cafe")},{value:"days",label:(0,o.__)("Days","wp-cafe")}]},{label:(0,o.__)("Maximum Future Reservation","wp-cafe"),tooltip:(0,o.__)("Set how far ahead customers can book in advance.Example: If you set 5 Days, users can only book within the next 5 days from today â later dates will be disabled on the calendar.","wp-cafe"),name:"reservation_early_booking_time",placeholder:(0,o.__)("e.g. 2","wp-cafe"),unitOptions:[{value:"any_time",label:(0,o.__)("Any Time","wp-cafe")},{value:"days",label:(0,o.__)("Days","wp-cafe")},{value:"weeks",label:(0,o.__)("Weeks","wp-cafe")},{value:"months",label:(0,o.__)("Months","wp-cafe")}],hideInputForUnits:["any_time"]}]},37624(e,t,n){n.r(t),n.d(t,{ReservationFields:()=>b});var r=n(74848),o=n(27723),a=n(47143),i=n(10404);if(945==n.j)var l=n(47767);if(945==n.j)var s=n(47392);var c=n(38802),u=n(62468),d=n(19402),p=n(92060),f=n(52847),v=n(33779),m=n(61252),_=n(84244),h=n(97190);function w(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function a(n,r,o,a){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return g(c,"_invoke",function(n,r,o){var a,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return a=t,l=0,s=e,p.n=n,i}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,a=u[t],f=p.p,v=a[2];n>3?(o=v===r)&&(s=a[(l=a[4])?5:(l=3,3)],a[4]=a[5]=e):a[0]<=f&&((o=n<2&&f<a[1])?(l=0,p.v=r,p.n=a[1]):f<v&&(o=n<3||a[0]>r||r>v)&&(a[4]=n,a[5]=r,p.n=v,l=0))}if(o||n>1)return i;throw d=!0,r}return function(o,u,v){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,v),l=u,s=v;(t=l<2?e:s)||!d;){a||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,a){if(l||(o="next"),t=a[o]){if(!(t=t.call(a,s)))throw TypeError("iterator result is not an object");
1if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=a.return)&&t.call(a),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);a=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==i)break}catch(t){a=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,a),!0),c}var i={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(g(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,g(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,g(d,"constructor",c),g(c,"constructor",s),s.displayName="GeneratorFunction",g(c,o,"GeneratorFunction"),g(d),g(d,o,"Generator"),g(d,r,function(){return this}),g(d,"toString",function(){return"[object Generator]"}),(w=function(){return{w:a,m:p}})()}function g(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}g=function(e,t,n,r){function a(t,n){g(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a("next",0),a("throw",1),a("return",2))},g(e,t,n,r)}var b=function(){var e,t,n,g=(0,i.useFormContext)(),b=g.control,y=g.getValues,x=g.formState.isDirty,j=(0,l.zy)(),S=j.pathname.includes("location"),O=Boolean(null===(e=null===window||void 0===window?void 0:window.wpCafe)||void 0===e?void 0:e.deposet),k=null!==(n=null===(t=null===window||void 0===window?void 0:window.wpCafe)||void 0===t?void 0:t.admin_url)&&void 0!==n?n:"/wp-admin/",N="".concat(k,"admin.php?page=deposet-settings"),C="".concat(k,"admin.php?page=wpcafe#/modules?tab=addons"),A=(0,p.A)().editSettings,F=(0,a.useSelect)(function(e){return e(null===d.zQ||void 0===d.zQ?void 0:d.zQ.settings).getSettingsState()},[]).editLoading,T=function(e){return t=void 0,n=void 0,r=void 0,o=w().m(function t(){return w().w(function(t){for(;;)switch(t.n){case 0:if(!x){t.n=2;break}return t.n=1,A(y());case 1:if(t.v){t.n=2;break}return t.a(2);case 2:window.location.href=e;case 3:return t.a(2)}},t)}),new(r||(r=Promise))(function(e,a){function i(e){try{s(o.next(e))}catch(e){a(e)}}function l(e){try{s(o.throw(e))}catch(e){a(e)}}function s(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r(function(e){e(n)})).then(i,l)}s((o=o.apply(t,n||[])).next())});var t,n,r,o},z=S?(0,o.__)("Reservations follow this locationâs schedule. If not set here, the global reservation schedule or restaurant schedule is followed.","wp-cafe"):(0,o.__)("Reservations time works based on the global schedule by default.","wp-cafe");return(0,r.jsxs)("div",{className:"space-y-5",children:[(0,r.jsxs)("div",{className:"grid gap-5 sm:grid-cols-2 items-start",children:[null===f.unitSelectorFields||void 0===f.unitSelectorFields?void 0:f.unitSelectorFields.map(function(e){return(0,r.jsx)(c.YV,Object.assign({control:b,type:"number"},e),e.name)}),(0,r.jsx)(c.pp,{label:(0,o.__)("Reservation Status","wp-cafe"),tooltip:(0,o.__)("Select the default status for new reservations.","wp-cafe"),name:"reservation_status",options:h.ReservationStatus,control:b}),(0,r.jsx)(c.pp,{label:(0,o.__)("Statuses That Block Time Slots","wp-cafe"),tooltip:(0,o.__)("Select the reservation statuses that should block a time slot. When a reservation with any of these statuses exists, its guest count will reduce available seats for that time slot. If total capacity is reached, the slot becomes unavailable.","wp-cafe"),name:"block_timeslot_statuses",options:h.ReservationStatus,control:b,isMulti:!0}),null===f.numericfields||void 0===f.numericfields?void 0:f.numericfields.map(function(e){return(0,r.jsx)(c.bz,Object.assign({control:b,type:"number"},e),e.name)})]}),(0,r.jsx)(c.Oc,{inlineLabel:(0,o.__)("Multiply booking amount by the total number of guests","wp-cafe"),control:b,name:"multiply_booking_amount_with_guests",required:!1}),(0,r.jsx)(i.Controller,{control:b,name:"reservation_partial_payment",render:function(e){var t=e.field,n=Boolean(t.value),a=O?n?{text:(0,o.__)("On","wp-cafe"),className:"bg-green-100 text-green-700"}:{text:(0,o.__)("Off","wp-cafe"),className:"bg-muted text-muted-foreground"}:{text:(0,o.__)("Requires Deposet","wp-cafe"),className:"bg-muted text-muted-foreground"};return(0,r.jsxs)("div",{className:"rounded-lg border border-border p-4 space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-primary/10 text-primary",children:(0,r.jsx)(s.A,{className:"h-5 w-5"})}),(0,r.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"font-medium",children:(0,o.__)("Deposit at Booking","wp-cafe")}),(0,r.jsx)("span",{className:"rounded-full px-2 py-0.5 text-xs font-medium ".concat(a.className),children:a.text})]}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:(0,o.__)("Collect a partial payment (deposit) when a guest books, using your Deposet deposit settings.","wp-cafe")})]}),(0,r.jsx)(c.QY,{showTooltip:!O,tooltipContent:(0,o.__)("Install and activate the Deposet plugin to enable partial payments.","
1wp-cafe"),children:(0,r.jsx)(u.Switch,{id:"reservation_partial_payment",checked:n,onCheckedChange:t.onChange,disabled:!O})})]}),O?n&&(0,r.jsx)("div",{className:"flex justify-end",children:(0,r.jsx)(u.Button,{type:"button",variant:"outlinePrimary",size:"sm",loading:F,onClick:function(){return T(N)},children:(0,o.__)("Configure deposit amount","wp-cafe")})}):null,!O&&(0,r.jsx)("div",{className:"flex justify-end",children:(0,r.jsx)(u.Button,{type:"button",variant:"outlinePrimary",size:"sm",loading:F,onClick:function(){return T(C)},children:(0,o.__)("Activate Deposet","wp-cafe")})})]})}}),j.pathname===v.S5?(0,r.jsx)(_.OnboardVisualTable,{}):(0,r.jsx)(c.H,{moduleName:"table_layout",children:(0,r.jsx)(m.LocationVisualTable,{})}),(0,r.jsx)(c.KB,{description:(0,o.__)(z,"wp-cafe")})]})}},61252(e,t,n){n.r(t),n.d(t,{LocationVisualTable:()=>f});var r=n(74848),o=n(27723),a=n(10404);if(945==n.j)var i=n(47767);var l=n(38802),s=n(62468),c=n(33779),u=n(25380);function d(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function a(n,r,o,a){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return p(c,"_invoke",function(n,r,o){var a,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return a=t,l=0,s=e,p.n=n,i}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,a=u[t],f=p.p,v=a[2];n>3?(o=v===r)&&(s=a[(l=a[4])?5:(l=3,3)],a[4]=a[5]=e):a[0]<=f&&((o=n<2&&f<a[1])?(l=0,p.v=r,p.n=a[1]):f<v&&(o=n<3||a[0]>r||r>v)&&(a[4]=n,a[5]=r,p.n=v,l=0))}if(o||n>1)return i;throw d=!0,r}return function(o,u,v){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,v),l=u,s=v;(t=l<2?e:s)||!d;){a||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,a){if(l||(o="next"),t=a[o]){if(!(t=t.call(a,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=a.return)&&t.call(a),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);a=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==i)break}catch(t){a=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,a),!0),c}var i={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(p(t={},r,function(){return this}),t),f=c.prototype=l.prototype=Object.create(u);function v(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,p(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return s.prototype=c,p(f,"constructor",c),p(c,"constructor",s),s.displayName="GeneratorFunction",p(c,o,"GeneratorFunction"),p(f),p(f,o,"Generator"),p(f,r,function(){return this}),p(f,"toString",function(){return"[object Generator]"}),(d=function(){return{w:a,m:v}})()}function p(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}p=function(e,t,n,r){function a(t,n){p(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a("next",0),a("throw",1),a("return",2))},p(e,t,n,r)}var f=function(){var e=(0,a.useFormContext)(),t=e.watch,n=e.setValue,p=e.formState.isDirty,f=(0,i.g)().id,v=(0,i.zy)().pathname,m=(0,u.A)().updateLocation;return(0,r.jsx)(l.X,Object.assign({title:(0,o.__)("Visual Table Layout","wp-cafe"),description:(0,o.__)("Enable visual layout to design your restaurant's table arrangement visually for ".concat(f?"this location.":"your restaurant."),"wp-cafe"),isPro:!0},v!==c.aJ&&{switchable:!0,defaultEnabled:"1"===t("reservation_enable_table_layout"),onToggle:function(e){return n("reservation_enable_table_layout",e?"1":"0",{shouldDirty:!0,shouldTouch:!0})}},{children:f||v===c.aJ?(0,r.jsx)(s.Button,{variant:"softSecondary",asChild:!0,children:(0,r.jsx)("span",{onClick:function(){return a=f||"",e=void 0,n=void 0,r=void 0,o=d().m(function e(){var n,r;return d().w(function(e){for(;;)switch(e.n){case 0:if(!p||!a){e.n=1;break}return e.n=1,m(Number(a),t());case 1:window.location.href=v===c.aJ?"".concat(null===(n=null===window||void 0===window?void 0:window.wpCafe)||void 0===n?void 0:n.admin_url,"admin.php?page=wpcafe#").concat(c.TE):"".concat(null===(r=null===window||void 0===window?void 0:window.wpCafe)||void 0===r?void 0:r.admin_url,"admin.php?page=wpcafe#/table-layout?location_id=").concat(f);case 2:return e.a(2)}},e)}),new(r||(r=Promise))(function(t,a){function i(e){try{s(o.next(e))}catch(e){a(e)}}function l(e){try{s(o.throw(e))}catch(e){a(e)}}function s(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r(function(e){e(n)})).then(i,l)}s((o=o.apply(e,n||[])).next())});var e,n,r,o,a},children:(0,o.__)("Configure","wp-cafe")})}):(0,r.jsx)("div",{className:"text-sm text-black/95 mt-2 bg-[#FFF7EB] p-2 rounded-md",children:(0,o.__)("Create the location first to configure visual table layout for this location","wp-cafe")})}))}},84244(e,t,n){n.r(t),n.d(t,{OnboardVisualTable:()=>c});var r=n(74848),o=n(27723),a=n(47143),i=n(38802),l=n(68602),s=n(19402),c=function(){var e,t=(0,l.Z)().handleModuleToggle,n=(0,a.useSelect)(function(e){return e(null===s.zQ||void 0===s.zQ?void 0:s.zQ.modules).getModulesState()},[]),c=n.data,u=n.updatingModules;return(0,r.jsx)(i.X,{title:(0,o.__)("Visual Table Layout","wp-cafe"),description:(0,o.__)("Enable visual layout to design your restaurant's table arrangement visually for your restaurant.","wp-cafe"),switchable:!0,onToggle:function(e){return t("table_layout",e?"on":"off")},defaultEnabled:"on"===(null===(e=null==c?void 0:c.table_layout)||void 0===e?void 0:e.status),isPro:!0,loading:null==u?void 0:u.includes("table_layout")})}},95120(e,t,n){n.r(t);var r=n(74848),o=n(27723),a=n(38802),i=n(37624);const l=945==n.j?function(e){return(0,r.jsx)(a.X,Object.assign({title:(0,o.__)("Reservations","wp-cafe"),description:(0,o.__)("Configure reservation settings and fields for your booking flow.","wp-cafe")},e,{children:(0,r.jsx)(i.ReservationFields,{})}))}:null;n.d(t,["default",0,l])},72142(e,t,n){n.r(t);var r=n(47143),o=n(86087),a=n(61375),i=n(19402),l=n(40189),s=n(942),c=n(42092);const u=(0,a.q)(l.A,function(){var e=(0,c.useReservationFormConfig)(),t=(0,r.useDispatch)(null===i.zQ||void 0===i.zQ?void 0:i.zQ.reservation).updateSingleReservation,n=(0,s.default)().createReservation;return(0,o.useMemo)(function(){return Object.assign(Object.assign({},e),{updateReservationState:t,handleSubmit:n})},[e,t,n])});n.d(t,["default",0,u])},19034(e,t,n){n.r(t);var r=n(74848),o=n(47143),a=n(86087),i=n(47767),l=n(61375),s=n(19402),c=n(40189),u=n(942),d=n(8722),p=n(34819),f=n(42092),v=n(27820);const m=(0,l.q)(function(){return(0,p.X)().reservationData?(0,r.jsx)(c.A,{}):(0,r.jsx)("div",{className:"p-2 md:p-4 lg:p-6",children:(0,r.jsx)(d.default,{})})},function(){var e=(0,i.g)().id,t=(0,f.useReservationFormConfig)(),n=(0,o.useDispatch)(null===s.zQ||void 0===s.zQ?void 0:s.zQ.reservation),r=n.updateSingleReservation,l=n.setReservationState,c=(0,u.default)(),d=c.updateReservation,p=c.getSingleReservation;(0,a.useEffect)(function(){return p(),function(){var e=(0,v.jd)(),t=e.startDate,n=e.endDate;l({singleReservation:{startDate:t,endDate:n}})}},[]);var m=(0,a.useMemo)(function(){return parseInt(e,10)},[e]),_=(0,a.useMemo)(function(){return function(e){var n;return d(m,Object.assign(Object.assign({},e),{status:(null===(n=null==t?void 0:t.reservationData)||void 0===n?void 0:n.status)||(null===s.L6||void 0===s.L6?void 0:s.L6.reservation_status)}))}},[m,d]),h=!t.reservationData;return(0,a.useMemo)(function(){return Object.assign(Object.assign({},t),{updateReservationState:r,isEditMode:!0,handleSubmit:_,isLoading:h})},[t,r,_,h])});n.d(t,["default",0,m])},35749(e,t,n){n.r(t),n.d(t,{FoodOrdersTable:()=>l});var r=n(74848),o=n(27723),a=n(65571),i=n(38802),l=function(e){var t,n=e.foodItems,l=e.bookingAmou
1nt,s=n.reduce(function(e,t){return e+parseFloat(t.price)*parseInt(t.quantity||"1")},0);return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-base text-black font-semibold pb-2 mb-2 border-b border-black/10",children:(0,o.__)("Food Orders","wp-cafe")}),(0,r.jsx)("div",{className:"border border-black/10 rounded-md",children:(0,r.jsxs)(a.U2,{children:[(0,r.jsx)(a.A0,{children:(0,r.jsxs)(a.Hj,{className:"bg-white",children:[(0,r.jsx)(a.nd,{className:"w-12 text-center font-semibold text-black/70",children:(0,o.__)("No","wp-cafe")}),(0,r.jsx)(a.nd,{className:"font-semibold text-black/70",children:(0,o.__)("Item's","wp-cafe")}),(0,r.jsx)(a.nd,{className:"w-16 text-center font-semibold text-black/70",children:(0,o.__)("Qnt","wp-cafe")}),(0,r.jsx)(a.nd,{className:"w-24 text-right font-semibold text-black/70",children:(0,o.__)("Amount","wp-cafe")})]})}),(0,r.jsxs)(a.BF,{children:[n.map(function(e,t){var n=parseFloat(e.price)*parseInt(e.quantity||"1");return(0,r.jsxs)(a.Hj,{className:"border-black/10",children:[(0,r.jsx)(a.nA,{className:"text-center text-sm",children:t+1}),(0,r.jsx)(a.nA,{className:"text-sm",children:e.product_name||"-"}),(0,r.jsx)(a.nA,{className:"text-center text-sm",children:e.quantity||"1"}),(0,r.jsx)(a.nA,{className:"text-right text-sm",children:(0,r.jsx)(i.Vo,{price:n.toFixed(2)})})]},t)}),(0,r.jsxs)(a.Hj,{className:"border-t-2 border-neutral-300 bg-white font-semibold",children:[(0,r.jsx)(a.nA,{colSpan:3,className:"text-right",children:(0,o.__)("Food Subtotal:","wp-cafe")}),(0,r.jsx)(a.nA,{className:"text-right",children:(0,r.jsx)(i.Vo,{price:s.toFixed(2)})})]})]})]})}),(0,r.jsxs)("div",{className:"mt-4 items-end flex font-medium flex-col gap-2.5",children:[(0,r.jsxs)("div",{className:"flex items-center text-[15px] text-black/90",children:[(0,o.__)("Reservation Amount:","wp-cafe"),(0,r.jsx)("span",{className:"ml-2 font-semibold",children:(0,r.jsx)(i.Vo,{price:null===(t=Number(l))||void 0===t?void 0:t.toFixed(2)})})]}),(0,r.jsxs)("div",{className:"flex items-center text-[15px] text-black/90",children:[(0,o.__)("Grand Total:","wp-cafe"),(0,r.jsx)("span",{className:"ml-2 font-semibold",children:(0,r.jsx)(i.Vo,{price:(Number(l)+s).toFixed(2)})})]})]})]})}},31530(e,t,n){n.r(t),n.d(t,{OrderPreview:()=>m});var r=n(74848),o=n(27723),a=n(47143),i=n(86087),l=n(39271),s=n(27820);if(2343!=n.j)var c=n(44854);var u=n(35749),d=n(38802),p=n(53977),f=n(19402);function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var m=function(e){var t,n=e.open,m=e.onOpenChange,_=e.reservation,h=(0,p.Sk)().canManageReservations,w="".concat(null===(t=null===window||void 0===window?void 0:window.wpCafe)||void 0===t?void 0:t.admin_url,"admin.php?page=wc-orders&wpcafe=true&action=edit&id=").concat(null==_?void 0:_.woo_order_id),g=(0,a.useSelect)(function(e){return e(null===f.zQ||void 0===f.zQ?void 0:f.zQ.settings).getSettingsState()},[]).data,b=(0,i.useMemo)(function(){var e={},t=null==g?void 0:g.reservation_form_customization;return Array.isArray(t)&&t.forEach(function(t){((null==t?void 0:t.fields)||[]).forEach(function(t){(null==t?void 0:t.id)&&(null==t?void 0:t.label)&&(e[t.id]=t.label)})}),e},[null==g?void 0:g.reservation_form_customization]);return(0,r.jsx)(l.lG,{open:n,onOpenChange:m,children:(0,r.jsxs)(l.Cf,{className:"max-w-[580px] p-0","aria-describedby":(0,o.__)("Order Details","wp-cafe"),children:[(0,r.jsx)(l.c7,{className:"flex-row justify-between items-center border-b border-border",children:(0,r.jsxs)(l.L3,{className:"flex gap-2 my-0! p-4 text-black!",children:[(0,o.__)("Order","wp-cafe")," - ",null==_?void 0:_.invoice," ","cash"===(null==_?void 0:_.payment_method)&&(0,r.jsx)("span",{className:"inline-flex items-center rounded-md bg-green-50 px-2 py-1 text-xs font-medium text-green-700 ring-1 ring-inset ring-green-600/20",children:(0,o.__)("Cash on delivery","wp-cafe")})]})}),(0,r.jsxs)("div",{className:"space-y-6 px-5 pb-5 pt-0",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-base font-semibold pb-2 mb-2 border-b border-border text-black!",children:(0,o.__)("Customer details","wp-cafe")}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"font-medium text-sm text-black/95 mb-1",children:(0,o.__)("Customer Info","wp-cafe")}),(0,r.jsxs)("div",{className:"space-y-1 text-black/95",children:[_.name&&(0,r.jsxs)("div",{children:[(0,r.jsxs)("span",{className:"font-medium",children:[(0,o.__)("Name","wp-cafe"),":"]})," ",_.name]}),_.phone&&(0,r.jsxs)("div",{children:[(0,r.jsxs)("span",{className:"font-medium",children:[(0,o.__)("Phone","wp-cafe"),":"]})," ",_.phone]}
1),_.email&&(0,r.jsxs)("div",{children:[(0,r.jsxs)("span",{className:"font-medium",children:[(0,o.__)("Email","wp-cafe"),":"]})," ",_.email]})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"font-medium text-sm text-black/95 mb-1",children:(0,o.__)("Date & Time","wp-cafe")}),(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)("div",{className:"text-black/95",children:(0,s.NC)(new Date(null==_?void 0:_.date))}),(0,r.jsxs)("div",{className:"text-sm text-black/95",children:[(0,s.Ej)(_.start_time)," -"," ",(0,s.Ej)(_.end_time)]})]})]})]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[_.branch_name&&(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"font-medium text-sm text-black/95 mb-1",children:(0,o.__)("Branch","wp-cafe")}),(0,r.jsx)("div",{className:"text-black/95",children:_.branch_name})]}),(null==_?void 0:_.total_price)&&(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"font-medium text-sm text-black/95 mb-1",children:(0,o.__)("Total Amount","wp-cafe")}),(0,r.jsx)("div",{children:(0,r.jsx)(d.Vo,{price:null==_?void 0:_.total_price})})]}),(null==_?void 0:_.notes)&&(0,r.jsxs)("div",{className:"my-1",children:[(0,r.jsx)("div",{className:"font-medium text-sm text-black/95 mb-1",children:(0,o.__)("Notes","wp-cafe")}),(0,r.jsx)("div",{className:"text-black/95",children:null==_?void 0:_.notes})]}),(null==_?void 0:_.table_name)&&(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"font-medium text-sm text-black/95 mb-1",children:(0,o.__)("Table Name","wp-cafe")}),(0,r.jsx)("div",{children:null==_?void 0:_.table_name})]}),(null==_?void 0:_.custom_fields)&&Object.keys(_.custom_fields).length>0&&(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"font-medium text-sm text-black/95 mb-1",children:(0,o.__)("Custom fields","wp-cafe")}),(0,r.jsx)("div",{className:"space-y-1",children:Object.entries(_.custom_fields).map(function(e){var t,n,o=(n=2,function(e){if(Array.isArray(e))return e}(t=e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(t,n)||function(e,t){if(e){if("string"==typeof e)return v(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=o[0],i=o[1];return(0,r.jsxs)("div",{children:[(0,r.jsxs)("span",{className:"font-medium capitalize",children:[b[a]||a.replace(/-/g," ").replace(/_/g," "),":"]})," ",String(i)]},a)})})]}),(null==_?void 0:_.seats)&&_.seats.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"font-medium text-sm text-black/95 mb-1",children:(0,o.__)("Booked seats","wp-cafe")}),(0,r.jsx)("div",{children:_.seats.join(", ")})]}),h&&(null==_?void 0:_.woo_order_id)&&(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"font-medium text-sm text-black/95 mb-1",children:(0,o.__)("Order Details","wp-cafe")}),(0,r.jsxs)("div",{className:"truncate text-primary/85 hover:text-primary cursor-pointer flex items-center gap-2",onClick:function(){return window.open(w,"_blank")},children:[(0,r.jsx)(c.A,{className:"w-4 h-4 text-primary"}),"#".concat(null==_?void 0:_.woo_order_id)]})]})]}),(null==_?void 0:_.food_items)&&_.food_items.length>0&&(0,r.jsx)(u.FoodOrdersTable,{foodItems:_.food_items,bookingAmount:null==_?void 0:_.total_price})]})]})})}},89148(e,t,n){n.r(t),n.d(t,{ReservationFilter:()=>_});var r=n(74848),o=n(27723),a=n(47143);if(2343!=n.j)var i=n(80697);if(2343!=n.j)var l=n(47767);var s=n(62468),c=n(38802),u=n(14714),d=n(70085),p=n(36584),f=n(82878),v=n(19402),m=n(53977),_=function(e){var t=e.onSearchChange,n=e.selectedCount,_=void 0===n?0:n,h=e.onBulkDelete,w=e.disabled,g=void 0!==w&&w,b=e.searchValue,y=(0,m.Sk)().canManageReservations,x=null===v.zQ||void 0===v.zQ?void 0:v.zQ.reservation,j=(0,a.useSelect)(function(e){return e(x).getReservationState()},[]).isFiltering,S=(0,f.useReservationFilter)(),O=S.isFilterApplied,k=S.handleClearFilters,N=(0,l.Zp)();return(0,r.jsx)(c.S,{onSearchChange:t,searchValue:b,searchDisabled:g,searchPlaceholder:(0,o.__)("Search by customer name, email...","wp-cafe"),filterActions:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.FilterByStatus,{}),(0,r.jsx)(d.FilterByLocation,{}),(0,r.jsx)(p.FilterByDate,{})]}),isFilterApplied:O,onClearFilters:k,rightActions:(0,r.jsxs)(r.Fragment,{children:[y&&_>0&&h&&(0,r.jsx)(c.Po,{onConfirm:h,title:(0,o.__)("Delete Selected Reservations","wp-cafe"),description:(0,o.__)("Are you sure you want to delete ".concat(_," selected reservation").concat(_>1?"s":"","? This action cannot be undone."),"wp-cafe"),trigger:(0,r.jsxs)(s.Button,{variant:"outlineDark",className:"text-danger hover:danger",disabled:j,children:[(0,o.__)("Delete Selected","wp-cafe")," (",_,")"]})}),y&&(0,r.jsxs)(s.Button,{onClick:function(){null==N||N("/reservations/create")},children:[(0,r.jsx)(i.A,{className:"h-4 w-4"}),(0,o.__)("Create New Reservation","wp-cafe")]})]})})}}
1,97190(e,t,n){n.r(t),n.d(t,{ReservationStatus:()=>w,formatDateForDisplay:()=>u,getGroupSelectionState:()=>f,getMasterSelectionState:()=>h,getRowKey:()=>p,getStatusConfig:()=>g,groupReservationsByDate:()=>d,handleGroupSelection:()=>m,handleMasterSelection:()=>_,handleRowSelection:()=>v,parseDateString:()=>b});var r=n(27723);if(2343!=n.j)var o=n(32370);if(2343!=n.j)var a=n(57172);var i=n(27820);function l(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||s(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){if(e){if("string"==typeof e)return c(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var u=function(e){try{var t=(0,a.qg)(e,"yyyy-MM-dd",new Date);return(0,o.f)(t)?(0,i.NC)(t):e}catch(t){return e}},d=function(e,t){if(!e||0===e.length)return[];var n={};return e.forEach(function(e){var t=e.date;n[t]||(n[t]=[]),n[t].push(e)}),Object.entries(n).map(function(e){var t,n,r=(n=2,function(e){if(Array.isArray(e))return e}(t=e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(t,n)||s(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=r[0],a=r[1];return{date:o,reservations:a,count:a.length}}).sort(function(e,n){try{var r=(0,a.qg)(e.date,"dd-MM-yyyy",new Date),i=(0,a.qg)(n.date,"dd-MM-yyyy",new Date);if((0,o.f)(r)&&(0,o.f)(i)){var l=i.getTime()-r.getTime();return"desc"===t?l:-l}return"desc"===t?n.date.localeCompare(e.date):e.date.localeCompare(n.date)}catch(r){return"desc"===t?n.date.localeCompare(e.date):e.date.localeCompare(n.date)}})},p=function(e,t){var n;return(null===(n=e.id)||void 0===n?void 0:n.toString())||t.toString()},f=function(e,t){var n=e.reservations.map(function(e){return e.id}),r=n.filter(function(e){return t.includes(e)}).length,o=n.length;return{selectedCount:r,isAllSelected:o>0&&r===o}},v=function(e,t,n,r){var o=n||[];r(t?[].concat(l(o),[e.id]):o.filter(function(t){return t!==e.id}))},m=function(e,t,n,r){var o,a=e.reservations.map(function(e){return e.id}),i=n||[];if(t){var s=a.filter(function(e){return!i.includes(e)});o=[].concat(l(i),l(s))}else o=i.filter(function(e){return!a.includes(e)});r(o)},_=function(e,t,n){n(e?t.map(function(e){return e.id}):[])},h=function(e,t){return e.length>0&&e.length===t.length},w=[{label:(0,r.__)("Pending","wp-cafe"),value:"pending",color:"bg-yellow-500"},{label:(0,r.__)("Confirmed","wp-cafe"),value:"confirmed",color:"bg-green-500"},{label:(0,r.__)("Cancelled","wp-cafe"),value:"cancelled",color:"bg-red-500"}],g=function(e){return{"on-hold":{label:(0,r.__)("Pending","wp-cafe"),color:"bg-yellow-500"},"pending-payment":{label:(0,r.__)("Pending","wp-cafe"),color:"bg-yellow-500"},pending:{label:(0,r.__)("Pending","wp-cafe"),color:"bg-yellow-500"},processing:{label:(0,r.__)("Pending","wp-cafe"),color:"bg-yellow-500"},"checkout-draft":{label:(0,r.__)("Pending","wp-cafe"),color:"bg-yellow-500"},confirmed:{label:(0,r.__)("Confirmed","wp-cafe"),color:"bg-green-500"},completed:{label:(0,r.__)("Confirmed","wp-cafe"),color:"bg-green-500"},cancelled:{label:(0,r.__)("Cancelled","wp-cafe"),color:"bg-red-500"},failed:{label:(0,r.__)("Cancelled","wp-cafe"),color:"bg-red-500"},refunded:{label:(0,r.__)("Cancelled","wp-cafe"),color:"bg-red-500"},rejected:{label:(0,r.__)("Cancelled","wp-cafe"),color:"bg-red-500"}}[e]||{label:(0,r.__)("Pending","wp-cafe"),color:"bg-yellow-500"}},b=function(e){var t=(0,a.qg)(e,"yyyy-MM-dd",new Date);return(0,o.f)(t)?t:void 0}},36584(e,t,n){n.r(t),n.d(t,{FilterByDate:()=>l});var r=n(74848),o=n(31248),a=n(82878),i=n(97190),l=function(){var e=(0,a.useReservationFilter)(),t=e.searchQuery,n=e.isFiltering,l=e.handleDateFilter,s=t&&{from:(null==t?void 0:t["date_range[0]"])?(0,i.parseDateString)(null==t?void 0:t["date_range[0]"]):void 0,to:(null==t?void 0:t["date_range[1]"])?(0,i.parseDateString)(null==t?void 0:t["date_range[1]"]):void 0},c=(null==s?void 0:s.from)&&(null==s?void 0:s.to)?s:{from:void 0,to:void 0};return(0,r.jsx)("div",{className:"w-[280px] cursor-pointer",children:(0,r.jsx)(o.U,{value:c,onChange:function(e){return l(e)},disabled:n})})}},70085(e,t,n){n.r(t),n.d(t,{FilterByLocation:()=>p});var r=n(74848),o=n(47143),a=n(86087),i=n(27723),l=n(92863),s=n(25380),c=n(39992),u=n(19402),d=n(82878),p=function(){var e=(0,d.useReservationFilter)(),t=e.searchQuery,n=e.isFiltering,p=e.handleLocationFilter,f=(0,s.A)().getLocations,v=(0,o.useSelect)(function(e){return e(null===u.zQ||void 0===u.zQ?void 0:u.zQ.location).getLocationState()},[]).locationList,m=(0,c.q7)("location").isEnabled;(0,a.useEffect)(function(){m&&(v||f())},[]);var _=(null==v?void 0:v.map(function(e){return{value:e.term_id.toString(),label:e.restaurant_name}}))||[],h=(null==t?void 0:t.branch)||"";return(0,r.jsxs)(l.l6,{value:h,onValueChange:function(e){return p(e||null)},disabled:n,children:[(0,r.jsx)(l.bq,{className:"w-[180px] cursor-pointer",disabled:!v||0===v.length,loading:!v,children:(0,r.jsx)(l.yv,{placeholder:(0,i.__)("Filter by Location","wp-cafe")})}),(0,r.jsx)(l.gC,{children:null==_?void 0:_.map(function(e){return(0,r.jsx)(l.eb,{value:e.value,children:e.label},e.value)})})]})}},14714(e,t,n){n.r(t),n.d(t,{FilterByStatus:()=>s});var r=n(74848),o=n(27723),a=n(92863),i=n(97190),l=n(82878),s=function(){var e=(0,l.useReservationFilter)(),t=e.searchQuery,n=e.isFiltering,
1s=e.handleStatusFilter,c=(null==t?void 0:t.status)||"";return(0,r.jsxs)(a.l6,{value:c,onValueChange:function(e){return s(e||null)},disabled:n,children:[(0,r.jsx)(a.bq,{className:"w-[148px] cursor-pointer",children:(0,r.jsx)(a.yv,{placeholder:(0,o.__)("Select Status","wp-cafe")})}),(0,r.jsx)(a.gC,{children:i.ReservationStatus.map(function(e){return(0,r.jsx)(a.eb,{value:e.value,children:e.label},e.value)})})]})}},90782(e,t,n){n.r(t),n.d(t,{useGroupedReservationTable:()=>u});var r=n(86087),o=n(47143),a=n(19402),i=n(97190),l=n(942);function s(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function a(n,r,o,a){var s=r&&r.prototype instanceof l?r:l,u=Object.create(s.prototype);return c(u,"_invoke",function(n,r,o){var a,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return a=t,l=0,s=e,p.n=n,i}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,a=u[t],f=p.p,v=a[2];n>3?(o=v===r)&&(s=a[(l=a[4])?5:(l=3,3)],a[4]=a[5]=e):a[0]<=f&&((o=n<2&&f<a[1])?(l=0,p.v=r,p.n=a[1]):f<v&&(o=n<3||a[0]>r||r>v)&&(a[4]=n,a[5]=r,p.n=v,l=0))}if(o||n>1)return i;throw d=!0,r}return function(o,u,v){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,v),l=u,s=v;(t=l<2?e:s)||!d;){a||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,a){if(l||(o="next"),t=a[o]){if(!(t=t.call(a,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=a.return)&&t.call(a),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);a=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==i)break}catch(t){a=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,a),!0),u}var i={};function l(){}function u(){}function d(){}t=Object.getPrototypeOf;var p=[][r]?t(t([][r]())):(c(t={},r,function(){return this}),t),f=d.prototype=l.prototype=Object.create(p);function v(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,c(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=d,c(f,"constructor",d),c(d,"constructor",u),u.displayName="GeneratorFunction",c(d,o,"GeneratorFunction"),c(f),c(f,o,"Generator"),c(f,r,function(){return this}),c(f,"toString",function(){return"[object Generator]"}),(s=function(){return{w:a,m:v}})()}function c(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}c=function(e,t,n,r){function a(t,n){c(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a("next",0),a("throw",1),a("return",2))},c(e,t,n,r)}var u=function(e){var t=e.selectedRows,n=(0,l.default)(),c=n.deleteReservation,u=n.onPaginationChange,d=null===a.zQ||void 0===a.zQ?void 0:a.zQ.reservation,p=(0,o.useSelect)(function(e){return e(d).getReservationState()},[]),f=p.reservationList,v=p.searchQuery,m=p.total,_=p.dateSortOrder,h={currentPage:(null==v?void 0:v.paged)||1,totalItems:m||0,perPage:(null==v?void 0:v.per_page)||10},w=(0,r.useMemo)(function(){return(0,i.groupReservationsByDate)(f,_)},[f,_]),g=(0,r.useCallback)(function(e){return t=void 0,n=void 0,r=void 0,o=s().m(function t(){return s().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,c(e);case 1:return t.a(2)}},t)}),new(r||(r=Promise))(function(e,a){function i(e){try{s(o.next(e))}catch(e){a(e)}}function l(e){try{s(o.throw(e))}catch(e){a(e)}}function s(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r(function(e){e(n)})).then(i,l)}s((o=o.apply(t,n||[])).next())});var t,n,r,o},[c]),b=(0,r.useCallback)(function(e){return(0,i.getGroupSelectionState)(e,t)},[t]);return{reservationList:f,groupedReservations:w,pagination:h,handleDeleteReservation:g,getGroupSelection:b,onPaginationChange:u}}},942(e,t,n){n.r(t);var r=n(47143);if(2343!=n.j)var o=n(47767);var a=n(93428),i=n(19402);function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function s(e,t,n){return(t=function(e){var t=function(e){if("object"!=l(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==l(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function a(n,r,o,a){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return u(c,"_invoke",function(n,r,o){var a,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return a=t,l=0,s=e,p.n=n,i}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,a=u[t],f=p.p,v=a[2];n>3?(o=v===r)&&(s=a[(l=a[4])?5:(l=3,3)],a[4]=a[5]=e):a[0]<=f&&((o=n<2&&f<a[1])?(l=0,p.v=r,p.n=a[1]):f<v&&(o=n<3||a[0]>r||r>v)&&(a[4]=n,a[5]=r,p.n=v,l=0))}if(o||n>1)return i;throw d=!0,r}return function(o,u,v){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,v),l=u,s=v;(t=l<2?e:s)||!d;){a||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,a){if(l||(o="next"),t=a[o]){if(!(t=t.call(a,s)))throw TypeError("iterator result is not an object");
1if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=a.return)&&t.call(a),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);a=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==i)break}catch(t){a=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,a),!0),c}var i={};function l(){}function s(){}function d(){}t=Object.getPrototypeOf;var p=[][r]?t(t([][r]())):(u(t={},r,function(){return this}),t),f=d.prototype=l.prototype=Object.create(p);function v(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,u(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return s.prototype=d,u(f,"constructor",d),u(d,"constructor",s),s.displayName="GeneratorFunction",u(d,o,"GeneratorFunction"),u(f),u(f,o,"Generator"),u(f,r,function(){return this}),u(f,"toString",function(){return"[object Generator]"}),(c=function(){return{w:a,m:v}})()}function u(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}u=function(e,t,n,r){function a(t,n){u(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a("next",0),a("throw",1),a("return",2))},u(e,t,n,r)}var d=function(e,t,n,r){return new(n||(n=Promise))(function(o,a){function i(e){try{s(r.next(e))}catch(e){a(e)}}function l(e){try{s(r.throw(e))}catch(e){a(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,l)}s((r=r.apply(e,t||[])).next())})};const p=2343!=n.j?function(){var e=this,t=null===i.zQ||void 0===i.zQ?void 0:i.zQ.reservation,n=(0,r.useSelect)(function(e){return e(t).getReservationState()},[]),l=(0,r.useDispatch)(t),u=l.setReservationState,p=l.updateSingleReservation,f=n.searchQuery,v=n.reservationList,m=n.singleReservation,_=(0,o.g)().id,h=(0,o.Zp)(),w=(0,o.zy)(),g=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return d(e,[].concat(n),void 0,function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return c().m(function t(){var n,r,o,l,s,d,p;return c().w(function(t){for(;;)switch(t.p=t.n){case 0:return s=(null==e?void 0:e.resetFilter)?{paged:1,per_page:(null===i.X$||void 0===i.X$?void 0:i.X$.per_page)||10}:Object.assign(Object.assign({},f),e),u({isFiltering:!0,error:null}),t.p=1,t.n=2,null===(n=null===a.A||void 0===a.A?void 0:a.A.reservations)||void 0===n?void 0:n.getReservations(s);case 2:(null==(d=t.v)?void 0:d.success)&&u({reservationList:(null===(r=null==d?void 0:d.data)||void 0===r?void 0:r.items)||[],total:(null===(o=null==d?void 0:d.data)||void 0===o?void 0:o.total)||0,searchQuery:Object.assign(Object.assign({},s),{paged:(null===(l=null==d?void 0:d.data)||void 0===l?void 0:l.current_page)||s.paged||1})}),t.n=4;break;case 3:t.p=3,p=t.v,console.error("Error fetching reservations:",p);case 4:return t.p=4,u({isFiltering:!1}),t.f(4);case 5:return t.a(2)}},t,null,[[1,3,4,5]])})()})},b=function(t,n){return d(e,void 0,void 0,c().m(function e(){var o,l,s,d,p,f,v;return c().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,u({isFiltering:!0,error:null}),e.n=1,null===(o=null===a.A||void 0===a.A?void 0:a.A.reservations)||void 0===o?void 0:o.updateReservation(t,n);
1case 1:if(!(null==(l=e.v)?void 0:l.success)){e.n=2;break}return s=(0,r.select)(null===i.zQ||void 0===i.zQ?void 0:i.zQ.reservation).getReservationState(),d=s.reservationList,p=s.total,f=null==d?void 0:d.map(function(e){var t;return e.id===(null===(t=null==l?void 0:l.data)||void 0===t?void 0:t.id)?null==l?void 0:l.data:e}),u({reservationList:f,total:p}),e.a(2,l);case 2:return e.a(2,l);case 3:e.p=3,v=e.v,console.error("Error updating reservation:",v),u({error:"Failed to update reservation",isFiltering:!1});case 4:return e.p=4,u({isFiltering:!1}),e.f(4);case 5:return e.a(2)}},e,null,[[0,3,4,5]])}))},y=function(e){var t=e.custom_fields,n=void 0===t?{}:t,r=e.seats,o=void 0===r?[]:r;return{reservationData:Object.assign(Object.assign({},e),n),seats:o,selectedSeats:o}},x=function(e){p(y(e))};return{getReservations:g,updateReservation:b,updateReservationStatus:function(n,o){return d(e,void 0,void 0,c().m(function e(){var a;return c().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,u({loadingStatuses:Object.assign(Object.assign({},(0,r.select)(t).getReservationState().loadingStatuses),s({},n,!0))}),e.n=1,b(n,{status:o});case 1:return a=e.v,e.a(2,a);case 2:return e.p=2,u({loadingStatuses:Object.assign(Object.assign({},(0,r.select)(t).getReservationState().loadingStatuses),s({},n,!1))}),e.f(2);case 3:return e.a(2)}},e,null,[[0,,2,3]])}))},deleteReservation:function(t){return d(e,void 0,void 0,c().m(function e(){var n,o,l,s,d,p;return c().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,null===(n=null===a.A||void 0===a.A?void 0:a.A.reservations)||void 0===n?void 0:n.deleteReservation(t);case 1:return(null==(o=e.v)?void 0:o.success)&&(l=(0,r.select)(null===i.zQ||void 0===i.zQ?void 0:i.zQ.reservation).getReservationState(),s=l.reservationList,d=null==s?void 0:s.filter(function(e){return e.id!==t}),u({reservationList:d,total:(null==s?void 0:s.length)-1})),e.a(2,o);case 2:throw e.p=2,p=e.v,console.error("Error deleting reservation:",p),u({error:"Failed to delete reservation"}),p;case 3:return e.a(2)}},e,null,[[0,2]])}))},bulkDeleteReservations:function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return d(e,[].concat(n),void 0,function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return c().m(function t(){var n,o,l,s,d,p,f;return c().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,null===(n=null===a.A||void 0===a.A?void 0:a.A.reservations)||void 0===n?void 0:n.bulkDeleteReservations(e);case 1:return(null==(o=t.v)?void 0:o.success)&&(l=(0,r.select)(null===i.zQ||void 0===i.zQ?void 0:i.zQ.reservation).getReservationState(),s=l.reservationList,d=l.total,p=s.filter(function(t){return!e.includes(t.id)}),u({reservationList:p,total:d-(e.length||0)})),t.a(2,o);case 2:throw t.p=2,f=t.v,console.error("Error bulk deleting reservations:",f),u({error:"Failed to delete reservations"}),f;case 3:return t.a(2)}},t,null,[[0,2]])})()})},onPaginationChange:function(e,t){u({searchQuery:Object.assign(Object.assign({},f),{paged:e,per_page:t})}),g({paged:e,per_page:t})},createReservation:function(t){return d(e,void 0,void 0,c().m(function e(){var n,r,o,i,l,s;return c().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t){e.n=1;break}return e.a(2);case 1:return e.p=1,u({isFiltering:!0}),e.n=2,a.A.reservations.createReservation(t);case 2:(null==(i=e.v)?void 0:i.success)&&(l={reservationData:Object.assign(Object.assign({},null==i?void 0:i.data),null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.custom_fields),seats:(null===(r=null==i?void 0:i.data)||void 0===r?void 0:r.seats)||[],selectedSeats:(null===(o=null==i?void 0:i.data)||void 0===o?void 0:o.seats)||[]},p(l),h("/reservations/update/".concat(i.data.id),{state:Object.assign(Object.assign({},m),y(l))})),e.n=4;break;case 3:e.p=3,s=e.v,console.error(s);case 4:return e.p=4,u({isFiltering:!1}),e.f(4);case 5:return e.a(2)}},e,null,[[1,3,4,5]])}))},getSingleReservation:function(){return d(e,void 0,void 0,c().m(function e(){var t,n,r,o;return c().w(function(e){for(;;)switch(e.p=e.n){case 0:if(_){e.n=1;break}return e.a(2);case 1:if(e.p=1,n=null==v?void 0:v.find(function(e){return e.id===parseInt(_,10)}),!(null===(t=w.state)||void 0===t?void 0:t.reservationData)){e.
1n=2;break}return p(w.state),e.a(2);case 2:if(!n){e.n=3;break}return x(n),e.a(2);case 3:return e.n=4,a.A.reservations.getSingleReservation(_);case 4:(null==(r=e.v)?void 0:r.success)&&(null==r?void 0:r.data)&&x(r.data),e.n=6;break;case 5:e.p=5,o=e.v,console.error("Error fetching single reservation:",o);case 6:return e.a(2)}},e,null,[[1,5]])}))}}}:null;n.d(t,["default",0,p])},82878(e,t,n){n.r(t),n.d(t,{useReservationFilter:()=>p});var r=n(47143);if(2343!=n.j)var o=n(12541);if(2343!=n.j)var a=n(32370);var i=n(19402),l=n(942),s=n(39992);function c(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function a(n,r,o,a){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return u(c,"_invoke",function(n,r,o){var a,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return a=t,l=0,s=e,p.n=n,i}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,a=u[t],f=p.p,v=a[2];n>3?(o=v===r)&&(s=a[(l=a[4])?5:(l=3,3)],a[4]=a[5]=e):a[0]<=f&&((o=n<2&&f<a[1])?(l=0,p.v=r,p.n=a[1]):f<v&&(o=n<3||a[0]>r||r>v)&&(a[4]=n,a[5]=r,p.n=v,l=0))}if(o||n>1)return i;throw d=!0,r}return function(o,u,v){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,v),l=u,s=v;(t=l<2?e:s)||!d;){a||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,a){if(l||(o="next"),t=a[o]){if(!(t=t.call(a,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=a.return)&&t.call(a),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);a=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==i)break}catch(t){a=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,a),!0),c}var i={};function l(){}function s(){}function d(){}t=Object.getPrototypeOf;var p=[][r]?t(t([][r]())):(u(t={},r,function(){return this}),t),f=d.prototype=l.prototype=Object.create(p);function v(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,u(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return s.prototype=d,u(f,"constructor",d),u(d,"constructor",s),s.displayName="GeneratorFunction",u(d,o,"GeneratorFunction"),u(f),u(f,o,"Generator"),u(f,r,function(){return this}),u(f,"toString",function(){return"[object Generator]"}),(c=function(){return{w:a,m:v}})()}function u(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}u=function(e,t,n,r){function a(t,n){u(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a("next",0),a("throw",1),a("return",2))},u(e,t,n,r)}var d=function(e,t,n,r){return new(n||(n=Promise))(function(o,a){function i(e){try{s(r.next(e))}catch(e){a(e)}}function l(e){try{s(r.throw(e))}catch(e){a(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,l)}s((r=r.apply(e,t||[])).next())})},p=function(){var e=null===i.zQ||void 0===i.zQ?void 0:i.zQ.reservation,t=(0,l.default)().getReservations,n=(0,r.useDispatch)(e),u=n.setReservationState,p=n.resetReservationState,f=(0,r.useSelect)(function(t){return t(e).getReservationState()},[]),v=f.searchQuery,m=f.isFiltering,_=(0,s.Qw)(v||{}).isQueried,h=function(){return d(void 0,void 0,void 0,c().m(function e(){return c().w(function(e){for(;;)switch(e.n){case 0:return p(),e.n=1,t({resetFilter:!0});case 1:return e.a(2)}},e)}))};return{searchQuery:v,isFiltering:m,isFilterApplied:_,handleSearchChange:function(e){return d(void 0,void 0,void 0,c().m(function n(){var r,o;return c().w(function(n){for(;;)switch(n.n){case 0:if(r=e.search.trim(),(null==v?void 0:v.search)!==r){n.n=1;break}return n.a(2,{complete:!0});case 1:return o=Object.assign(Object.assign({},v),{search:r,paged:1}),u({searchQuery:o,reservationList:null}),n.n=2,t(o);case 2:return n.a(2,{complete:!0})}},n)}))},handleStatusFilter:function(e){return d(void 0,void 0,void 0,c().m(function n(){var r;return c().w(function(n){for(;;)switch(n.n){case 0:if(e){n.n=1;break}return n.a(2,h());case 1:return r=Object.assign(Object.assign({},v),{status:e,paged:1}),u({searchQuery:r,reservationList:null}),n.n=2,t(r);case 2:return n.a(2)}},n)}))},handleFoodOrderFilter:function(e){return d(void 0,void 0,void 0,c().m(function n(){var r;return c().w(function(n){for(;;)switch(n.n){case 0:if(e){n.n=1;break}return n.a(2,h());case 1:return r=Object.assign(Object.assign({},v),{food_order:e,paged:1}),u({searchQuery:r,reservationList:null}),n.n=2,t(r);case 2:return n.a(2)}},n)}))},handleLocationFilter:function(e){return d(void 0,void 0,void 0,c().m(function n(){var r;return c().w(function(n){for(;;)switch(n.n){case 0:if(e){n.n=1;break}return n.a(2,h());case 1:return r=Object.assign(Object.assign({},v),{branch:e,paged:1}),u({searchQuery:r,reservationList:null}),n.n=2,t(r);case 2:return n.a(2)}},n)}))},handleDateFilter:function(e){return d(void 0,void 0,void 0,c().m(function n(){var r,i,l;return c().w(function(n){for(;;)switch(n.n){case 0:if((null==e?void 0:e.from)&&(0,a.f)(e.from)){n.n=1;break}return n.a(2,h());case 1:return r=(0,o.GP)(e.from,"yyyy-MM-dd"),i=e.to&&(0,a.f)(e.to)?(0,o.GP)(e.to,"yyyy-MM-dd"):r,l=Object.assign(Object.assign({},v),{"date_range[0]":r,"date_range[1]":i,paged:1}),u({searchQuery:l,reservationList:null}),n.n=2,t(l);case 2:return n.a(2)}},n)}))},handleClearFilters:h}}},42092(e,t,n){n.r(t),n.d(t,{useReservationFormConfig:()=>l});
1var r=n(47143),o=n(86087),a=n(19402),i=2343!=n.j?{isAdmin:!0,dateSelector:"date_picker",reservationStyle:"style-1",formDisplayType:"single"}:null;function l(){var e=(0,r.useSelect)(function(e){return e(null===a.zQ||void 0===a.zQ?void 0:a.zQ.settings).getSettingsState()},[]).data,t=(0,r.useSelect)(function(e){return e(null===a.zQ||void 0===a.zQ?void 0:a.zQ.reservation).getReservationState()},[]),n=t.singleReservation,l=t.isFiltering;return(0,o.useMemo)(function(){return Object.assign(Object.assign(Object.assign(Object.assign({},n),{settings:e}),i),{submitLoading:l})},[n,e,l])}},66314(e,t,n){n.r(t);var r=n(86087);if(2343!=n.j)var o=n(47767);var a=n(942),i=n(53977);function l(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function a(n,r,o,a){var l=r&&r.prototype instanceof c?r:c,u=Object.create(l.prototype);return s(u,"_invoke",function(n,r,o){var a,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return a=t,l=0,s=e,p.n=n,i}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,a=u[t],f=p.p,v=a[2];n>3?(o=v===r)&&(s=a[(l=a[4])?5:(l=3,3)],a[4]=a[5]=e):a[0]<=f&&((o=n<2&&f<a[1])?(l=0,p.v=r,p.n=a[1]):f<v&&(o=n<3||a[0]>r||r>v)&&(a[4]=n,a[5]=r,p.n=v,l=0))}if(o||n>1)return i;throw d=!0,r}return function(o,u,v){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,v),l=u,s=v;(t=l<2?e:s)||!d;){a||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,a){if(l||(o="next"),t=a[o]){if(!(t=t.call(a,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=a.return)&&t.call(a),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);a=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==i)break}catch(t){a=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,a),!0),u}var i={};function c(){}function u(){}function d(){}t=Object.getPrototypeOf;var p=[][r]?t(t([][r]())):(s(t={},r,function(){return this}),t),f=d.prototype=c.prototype=Object.create(p);function v(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,s(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=d,s(f,"constructor",d),s(d,"constructor",u),u.displayName="GeneratorFunction",s(d,o,"GeneratorFunction"),s(f),s(f,o,"Generator"),s(f,r,function(){return this}),s(f,"toString",function(){return"[object Generator]"}),(l=function(){return{w:a,m:v}})()}function s(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}s=function(e,t,n,r){function a(t,n){s(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a("next",0),a("throw",1),a("return",2))},s(e,t,n,r)}const c=2343!=n.j?function(e){var t=e.selectedRows,n=e.setSelectedRows,s=(0,i.Sk)().canManageReservations,c=(0,a.default)().bulkDeleteReservations,u=(0,o.Zp)();return{handleEditReservation:(0,r.useCallback)(function(e){s&&u("/reservations/update/".concat(e.id))},[s,u]),handleBulkDelete:(0,r.useCallback)(function(){return e=void 0,r=void 0,o=void 0,a=l().m(function e(){return l().w(function(e){for(;;)switch(e.n){case 0:if(s&&0!==t.length){e.n=1;break}return e.a(2);case 1:return e.n=2,c(t);case 2:n([]);case 3:return e.a(2)}},e)}),new(o||(o=Promise))(function(t,n){function i(e){try{s(a.next(e))}catch(e){n(e)}}function l(e){try{s(a.throw(e))}catch(e){n(e)}}function s(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o(function(e){e(n)})).then(i,l)}s((a=a.apply(e,r||[])).next())});var e,r,o,a},[s,t,c,n])}}:null;n.d(t,["default",0,c])},88128(e,t,n){n.r(t);var r=n(74848),o=n(47143),a=n(86087),i=n(27723);if(2343!=n.j)var l=n(47767);var s=n(38802),c=n(39992),u=n(53977),d=n(19402),p=n(942),f=n(82878),v=n(66314),m=n(89148),_=n(59505);function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const w=2343!=n.j?function(){var e,t,n=(0,u.Sk)().canManageReservations,w=(e=(0,a.useState)([]),t=2,function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}
1finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return h(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),g=w[0],b=w[1],y=(0,l.Zp)(),x=(0,p.default)().getReservations,j=(0,f.useReservationFilter)(),S=j.handleClearFilters,O=j.handleSearchChange,k=null===d.zQ||void 0===d.zQ?void 0:d.zQ.reservation,N=(0,o.useSelect)(function(e){return e(k).getReservationState()},[]),C=N.reservationList,A=N.searchQuery,F=(0,c.Qw)(A||{}).isQueried,T=(0,v.default)({selectedRows:g,setSelectedRows:b}),z=T.handleEditReservation,D=T.handleBulkDelete;return(0,a.useEffect)(function(){x()},[]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.CI,{title:(0,i.__)("Reservations","wp-cafe")}),(0,r.jsx)(s.mc,{children:F||0!==(null==C?void 0:C.length)?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.ReservationFilter,{onSearchChange:O,selectedCount:g.length,onBulkDelete:D,searchValue:(null==A?void 0:A.search)||""}),(0,r.jsx)(_.GroupedReservationTable,{onEditReservation:z,onSelectionChange:b,selectedRows:g,onResetFilters:S})]}):(0,r.jsx)(s.Yg,{title:(0,i.__)("No reservations found","wp-cafe"),description:(0,i.__)("You don't have any reservations yet. Reservations will appear here once customers start booking tables. You can customize the reservation form in the settings.","wp-cafe"),learnMoreText:(0,i.__)("Read Documentation","wp-cafe"),learnMoreUrl:"https://support.themewinter.com/docs/plugins/plugin-docs/reservation/form-customization/",videoTooltip:(0,i.__)("How to manage reservations in Wp Cafe?","wp-cafe"),addButtonText:n?(0,i.__)("Create New Reservation","wp-cafe"):"",onAddButtonClick:function(){return y("/reservations/create")}})})]})}:null;n.d(t,["default",0,w])},33285(e,t,n){n.r(t);var r=n(19402),o=n(47143),a=(0,n(27820).jd)(),i={reservationList:null,singleReservation:{startDate:a.startDate,endDate:a.endDate},total:0,searchQuery:{paged:(null===r.X$||void 0===r.X$?void 0:r.X$.paged)||1,per_page:(null===r.X$||void 0===r.X$?void 0:r.X$.per_page)||10,search:""},isFiltering:!1,error:null,loadingStatuses:{},dateSortOrder:"desc"},l="UPDATE_STATE",s="RESET_STATE",c="RESET_SINGLE_RESERVATION_STATE",u="UPDATE_SINGLE_RESERVATION",d=(0,o.createReduxStore)((null===r.zQ||void 0===r.zQ?void 0:r.zQ.reservation)||"wpcafe/reservation",{reducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case l:return Object.assign(Object.assign({},e),t.payload);case s:return i;case c:return Object.assign(Object.assign({},e),{singleReservation:null});case u:return Object.assign(Object.assign({},e),{singleReservation:Object.assign(Object.assign({},e.singleReservation),t.payload)});default:return e}},actions:{setReservationState:function(e){return{type:l,payload:e}},resetReservationState:function(){return{type:s}},resetSingleReservationState:function(){return{type:c,payload:{singleReservation:null}}},updateSingleReservation:function(e){return{type:u,payload:e}}},selectors:{getReservationState:function(e,t){return t?e[t]:e}}});(0,o.register)(d)},92633(e,t,n){n.r(t),n.d(t,{ReservationGroupHeader:()=>s});var r=n(74848),o=n(27723);if(2343!=n.j)var a=n(97213);var i=n(62468),l=n(97190),s=function(e){var t=e.group,n=e.groupSelectionState,s=e.selectedRows,c=e.onSelectionChange,u=e.colSpan,d=e.selectionDisabled,p=void 0!==d&&d;return(0,r.jsx)(i.TableRow,{className:"bg-white/40 border-border",children:(0,r.jsx)(i.TableCell,{colSpan:u,className:"px-4 py-3",children:(0,r.jsx)("div",{className:"flex items-center justify-between",children:(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(i.Checkbox,{className:"cursor-pointer",checked:n.isAllSelected,disabled:p,onCheckedChange:function(e){return(0,l.handleGroupSelection)(t,!!e,s,c)}}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("div",{className:"font-semibold text-black/90",children:[(0,l.formatDateForDisplay)(t.date)," (",t.count,")"]}),(0,r.jsxs)(i.Tooltip,{children:[(0,r.jsx)(i.TooltipTrigger,{className:"inline-flex items-center",children:(0,r.jsx)(a.A,{className:"h-4 w-4 text-black/40 hover:text-black/60 transition-colors"})}),(0,r.jsx)(i.TooltipContent,{side:"right",sideOffset:5,children:(0,o.__)("Reservation booking date","
1wp-cafe")})]})]})]})})})},"group-".concat(t.date))}},18951(e,t,n){n.r(t),n.d(t,{ReservationRow:()=>l});var r=n(74848),o=n(24748),a=n(65571),i=n(97190),l=function(e){var t=e.reservation,n=e.index,l=e.isSelected,s=e.selectedRows,c=e.onSelectionChange,u=e.tableColumns,d=e.onRowClick,p=e.selectionDisabled,f=void 0!==p&&p,v=(0,i.getRowKey)(t,n);return(0,r.jsxs)(a.Hj,{className:"border-border transition-colors ".concat(d?"cursor-pointer hover:bg-muted":""," ").concat(l?"bg-[#fd6cad03]":""),onClick:function(e){var n=e.target;e.currentTarget.contains(n)&&(n.closest('[role="checkbox"]')||n.closest("button")||n.closest("a")||null==d||d(t))},children:[(0,r.jsx)(a.nA,{className:"px-4",children:(0,r.jsx)(o.S,{className:"cursor-pointer",checked:l,disabled:f,onCheckedChange:function(e){return(0,i.handleRowSelection)(t,!!e,s,c)}})}),u.map(function(e){return(0,r.jsx)(a.nA,{className:"px-4",style:{textAlign:e.align||"left"},children:e.render?e.render(e.dataIndex?t[e.dataIndex]:void 0,t):e.dataIndex?t[e.dataIndex]:null},e.key)})]},v)}},52496(e,t,n){n.r(t),n.d(t,{ReservationTableHeader:()=>c});var r=n(74848),o=n(24748),a=n(65571);if(2343!=n.j)var i=n(43241);if(2343!=n.j)var l=n(6632);var s=n(97190),c=function(e){var t=e.tableColumns,n=e.selectedRows,c=e.reservationList,u=e.onSelectionChange,d=e.dateSortOrder,p=e.onDateSort,f=e.selectionDisabled,v=void 0!==f&&f,m=(0,s.getMasterSelectionState)(n,c);return(0,r.jsx)(a.A0,{children:(0,r.jsxs)(a.Hj,{className:"border-border",children:[(0,r.jsx)(a.nd,{className:"w-12 px-4",children:(0,r.jsx)(o.S,{className:"cursor-pointer",checked:m,disabled:v,onCheckedChange:function(e){return(0,s.handleMasterSelection)(!!e,c,u)}})}),t.map(function(e){var t="date"===e.key;return(0,r.jsx)(a.nd,{className:"text-black/60 font-medium px-4 whitespace-nowrap ".concat(t?"cursor-pointer select-none":""),style:{width:e.width},onClick:t?p:void 0,children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[e.title,t&&(0,r.jsx)("span",{className:"text-black/40",children:"desc"===d?(0,r.jsx)(i.A,{className:"h-4 w-4"}):(0,r.jsx)(l.A,{className:"h-4 w-4"})})]})},e.key)})]})})}},15134(e,t,n){n.r(t),n.d(t,{ReservationActions:()=>m});var r=n(74848),o=n(27723),a=n(86087);if(2343!=n.j)var i=n(54718);if(2343!=n.j)var l=n(98188);if(2343!=n.j)var s=n(3160);if(2343!=n.j)var c=n(32708);var u=n(38802),d=n(43054),p=n(31530),f=n(53977);function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var m=function(e){var t,n,m=e.record,_=e.onDeleteReservation,h=e.onEditReservation,w=(0,f.Sk)().canManageReservations,g=(t=(0,a.useState)(!1),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(t,n)||function(e,t){if(e){if("string"==typeof e)return v(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),b=g[0],y=g[1];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)(u.W5,{icon:function(){return(0,r.jsx)(s.A,{className:"h-4 w-4"})},tooltip:(0,o.__)("View Order","wp-cafe"),onClick:function(){return y(!0)},variant:"icon",size:"iconCircle",tooltipAppendPos:"top",buttonClassName:"!text-sm font-normal rounded-sm"}),w&&(0,r.jsxs)(d.rI,{children:[(0,r.jsx)(d.ty,{asChild:!0,children:(0,r.jsx)(u.W5,{icon:function(){return(0,r.jsx)(i.A,{className:"h-4 w-4"})},tooltip:(0,o.__)("More Options","wp-cafe"),variant:"icon",size:"iconCircle",tooltipAppendPos:"top",buttonClassName:"!text-sm font-normal rounded-sm"})}),(0,r.jsxs)(d.SQ,{align:"end",className:"w-40",children:[(0,r.jsxs)(d._2,{className:"flex items-center gap-2 cursor-pointer",onClick:function(){return h(m)},children:[(0,r.jsx)(l.A,{className:"h-4 w-4"}),(0,r.jsx)("span",{children:(0,o.__)("Edit Reservation","wp-cafe")})]}),(0,r.jsx)(u.Po,{onConfirm:function(){return _(m.id)},title:(0,o.__)("Delete Reservation","wp-cafe"),description:(0,o.__)("Are you sure you want to delete this reservation? This action cannot be undone.","wp-cafe"),trigger:(0,r.jsxs)(d._2,{className:"flex items-center gap-2 cursor-pointer text-danger hover:danger! hover:bg-danger/15",onSelect:function(e){return e.preventDefault()},children:[(0,r.jsx)(c.A,{className:"h-4 w-4 text-danger"}),(0,r.jsx)("span",{children:(0,o.__)("Delete","wp-cafe")})]})},m.id)]})]})]}),(0,r.jsx)(p.OrderPreview,{open:b,onOpenChange:y,reservation:m})]})}},43939(e,t,n){n.r(t),n.d(t,{StatusDropdown:()=>d});var r=n(74848),o=n(47143),a=n(19402),i=n(942),l=n(92863),s=n(38802),c=n(97190),u=n(53977),d=function(e){var t=e.reservation,n=(0,u.Sk)().canManageReservations,d=t.status,p=null===a.zQ||void 0===a.zQ?void 0:a.zQ.reservation,f=(0,i.default)().updateReservationStatus,v=(0,o.useSelect)(function(e){var n;return{isLoading:(null===(n=e(p).getReservationState("loadingStatuses"))||void 0===n?void 0:n[t.id])||!1}},[t.id]).isLoading,m=(0,c.getStatusConfig)(d);return n?(0,r.jsxs)(l.l6,{value:d,onValueChange:function(e){e!==d&&f(t.id,e)},children:[(0,r.jsx)(l.bq,{className:"w-36 h-8 border border-neutral-300 p-0 pr-3",disabled:v,loading:v,children:(0,r.jsx)(s.Wh,{label:m.label,color:m.color,className:"border-none"})}),(0,r.jsx)(l.gC,{children:c.ReservationStatus.map(function(e){return(0,r.jsx)(l.eb,{value:e.value,children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("div",{className:"w-2 h-2 rounded-full ".concat(e.color)}),e.label]})},e.value)})})]}):(0,r.jsx)(s.Wh,{label:m.label,color:m.color})}},9089(e,t,n){n.r(t),n.d(t,{useReservationTableColumns:()=>d});var r=n(74848),o=n(27723);if(2343!=n.j)var a=n(43954);if(2343!=n.j)var i=n(93893);if(2343!=n.j)var l=n(48686);var s=n(43939),c=n(15134),u=n(27820),d=function(e){var t=e.onDeleteReservation,n=e.onEditReservation;return[{title:(0,o.__)("Date & Time","wp-cafe"),dataIndex:"date",key:"date",width:150,render:function(e,t){return(0,r.jsxs)("div",{className:"text-sm text-neutral-400",children:[(0,u.Ej)(t.start_time)," -"," ",(0,u.Ej)(t.end_time)]})}},{title:(0,o.__)("Invoice","wp-cafe"),dataIndex:"invoice",key:"invoice",width:100,render:function(e){return(0,r.jsx)("span",{className:"text-sm font-mono",children:e})}},{title:(0,o.__)("Customer Info","wp-cafe"),dataIndex:"name",key:"name",width:200,render:function(e,t){return(0,r.jsxs)("div",{className:"flex flex-col gap-1.5 text-sm",children:[t.name&&(0,r.jsxs)("div",{className:" text-neutral-400 flex items-center gap-1",children:[(0,r.jsx)(l.A,{className:"h-3 w-3"}),t.name]}),t.email&&(0,r.jsxs)("div",{className:" text-neutral-400 flex items-center gap-1",children:[(0,r.jsx)(a.A,{className:"h-3 w-3"}),t.email]})]})}},{title:(0,o.__)("Food Order","wp-cafe"),dataIndex:"food_items",key:"food_items",width:80,render:function(e){var t=e&&(null==e?void 0:e.length)>0;return(0,r.jsx)("div",{className:"font-medium text-sm ".concat(t?"text-green-400":"text-red-400"),children:t?(0,o.__)("Yes","wp-cafe"):(0,o.__)("No","wp-cafe")})}},{title:(0,o.__)("Guests","wp-cafe"),dataIndex:"total_guest",key:"total_guest",width:80,render:function(e){return(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)(i.A,{className:"h-3 w-3"}),(0,r.jsx)("span",{className:"text-sm",children:e})]})}},{title:(0,o.__)("Payment Method","wp-cafe"),dataIndex:"payment_method",key:"payment_method",
1width:80,render:function(e){return(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)(i.A,{className:"h-3 w-3"}),(0,r.jsx)("span",{className:"text-sm",children:e||(0,o.__)("N/A","wp-cafe")})]})}},{title:(0,o.__)("Status","wp-cafe"),dataIndex:"status",key:"status",width:120,render:function(e,t){return(0,r.jsx)(s.StatusDropdown,{reservation:t})}},{title:(0,o.__)("Actions","wp-cafe"),key:"actions",width:120,render:function(e,o){return(0,r.jsx)(c.ReservationActions,{record:o,onDeleteReservation:t,onEditReservation:n})}}]}},59505(e,t,n){n.r(t),n.d(t,{GroupedReservationTable:()=>y});var r=n(74848),o=n(27723),a=n(86087),i=n(47143);if(2343!=n.j)var l=n(32307);if(2343!=n.j)var s=n(59492);var c=n(65571),u=n(8641),d=n(98232),p=n(38802),f=n(9089),v=n(90782),m=n(52496),_=n(92633),h=n(18951),w=n(62468),g=n(19402),b=n(53977),y=function(e){var t=e.onEditReservation,n=e.onSelectionChange,y=e.selectedRows,x=e.onResetFilters,j=(0,b.Sk)().canManageReservations,S=null===g.zQ||void 0===g.zQ?void 0:g.zQ.reservation,O=(0,i.useSelect)(function(e){return e(S).getReservationState()},[]).dateSortOrder,k=(0,i.useDispatch)(S).setReservationState,N=(0,v.useGroupedReservationTable)({selectedRows:y,onSelectionChange:n}),C=N.reservationList,A=N.groupedReservations,F=N.pagination,T=N.handleDeleteReservation,z=N.getGroupSelection,D=N.onPaginationChange,R=(0,f.useReservationTableColumns)({onDeleteReservation:T,onEditReservation:t});if(!C)return(0,r.jsx)("div",{className:"bg-card rounded-lg border border-border border-t-0 rounded-t-none overflow-x-auto wcf-table-scrollbar",children:(0,r.jsx)(d.Q,{rows:5,columns:R.length})});if(0===C.length){var E={title:(0,o.__)("No reservations found!","wp-cafe"),description:(0,o.__)("Try adjusting your search terms or filters to find what you're looking for.","wp-cafe"),icon:(0,r.jsx)(l.A,{className:"w-10 h-10 text-gray-500 dark:text-gray-400"}),action:x?(0,r.jsxs)(w.Button,{variant:"outlinePrimary",onClick:x,className:"mt-4",children:[(0,r.jsx)(s.A,{className:"mr-2 h-4 w-4"}),(0,o.__)("Clear Filters","wp-cafe")]}):void 0,className:"bg-card p-6 rounded-b-lg border border-border"};return(0,r.jsx)(p.uM,Object.assign({},E))}return(0,r.jsxs)("div",{className:"bg-card rounded-lg border border-border border-t-0 rounded-t-none overflow-x-auto wcf-table-scrollbar",children:[(0,r.jsxs)(c.U2,{children:[(0,r.jsx)(m.ReservationTableHeader,{tableColumns:R,selectedRows:y,reservationList:C,onSelectionChange:n,dateSortOrder:O,onDateSort:function(){k({dateSortOrder:"desc"===O?"asc":"desc"})},selectionDisabled:!j}),(0,r.jsx)(c.BF,{children:null==A?void 0:A.map(function(e,o){var i=z(e);return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(_.ReservationGroupHeader,{group:e,groupSelectionState:i,selectedRows:y,onSelectionChange:n,colSpan:R.length+1,selectionDisabled:!j}),e.reservations.map(function(e,o){var a=y.includes(e.id);return(0,r.jsx)(h.ReservationRow,{reservation:e,index:o,isSelected:a,selectedRows:y,onSelectionChange:n,tableColumns:R,onRowClick:j?t:void 0,selectionDisabled:!j},e.id)})]},"group-".concat(e.date,"-").concat(o))})})]}),(0,r.jsx)(u.w,{current:F.currentPage,total:F.totalItems,pageSize:F.perPage,onChange:D})]})}},5962(e,t,n){n.r(t);var r=n(74848),o=n(27723),a=n(38802),i=n(79244);const l=945==n.j?function(){return(0,r.jsx)(a.bg,{title:(0,o.__)("Reservation Message Settings","wp-cafe"),description:(0,o.__)("Set the message displayed to customers on thank you page based on reservation status.","wp-cafe"),children:(0,r.jsxs)("div",{className:"space-y-5",children:[(0,r.jsx)(a.pu,{title:(0,o.__)("Pending Message","wp-cafe"),description:(0,o.__)("This message will be shown to customers when their reservation request is received but not yet confirmed.","wp-cafe"),toggleName:"enable_reservation_pending_message",messageName:"reservation_pending_message"}),(0,r.jsx)(a.pu,{title:(0,o.__)("Confirmed Message","wp-cafe"),description:(0,o.__)("This message will be shown if the reservation is a confirmed reservation.","wp-cafe"),toggleName:"enable_reservation_confirmed_message",messageName:"reservation_confirmed_message"}),(0,r.jsx)(i.default,{})]})})}:null;n.d(t,["default",0,l])},48542(e,t,n){n.r(t);var r=n(74848),o=n(27723),a=n(86087),i=n(47143),l=n(62468),s=n(38802),c=n(88687),u=n(1158),d=n(68612),p=n(1701),f=n(19402);function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const m=945==n.j?function(e){var t,n,m,_,h,w=e.onCreate,g=e.editingField,b=e.onUpdate,y=e.openExternal,x=e.onOpenChangeExternal,j=(0,i.useSelect)(function(e){return e(null===f.zQ||void 0===f.zQ?void 0:f.zQ.settings).getSettingsState()},[]),S=j.data,O=j.activeStep,k=(null==S?void 0:S.reservation_form_customization)||[],N=(_=(0,a.useState)(O),h=2,function(e){if(Array.isArray(e))return e}(_)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}
1finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(_,h)||function(e,t){if(e){if("string"==typeof e)return v(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,t):void 0}}(_,h)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),C=N[0],A=N[1],F=(0,p.default)({editingField:g,onCreate:w,onUpdate:b,openExternal:y,onOpenChangeExternal:x}),T=F.open,z=F.setOpen,D=F.fieldDraft,R=F.setFieldDraft,E=F.isOptionType,P=F.isNumericOnlyLabel,M=F.canSubmit,I=F.handleOptionsChange,Q=F.showPlaceholder,L=F.reset,G=(k||[]).map(function(e){return{label:e.label||e.id,value:e.id}}),B=function(){L(),z(!1),A(O)};return(0,r.jsxs)(l.Dialog,{open:T,onOpenChange:function(e){e||(L(),A(O)),z(e)},children:[!g&&(0,r.jsxs)(l.Button,{type:"button",variant:"icon",className:"rounded-md text-neutral-light text-sm!",onClick:function(){return z(!0)},children:[(0,r.jsx)(c.Ze,{}),(0,o.__)("Add New Custom Field","wp-cafe")]}),(0,r.jsxs)(l.DialogContent,{className:"sm:max-w-xl md:max-w-3xl",children:[(0,r.jsx)(l.DialogTitle,{className:"font-semibold text-[22px] border-b border-black/20 m-0! pb-4",children:g?(0,o.__)("Edit Field","wp-cafe"):(0,o.__)("Create A New Field","wp-cafe")}),(0,r.jsx)(l.DialogDescription,{className:"sr-only",children:(0,o.__)("Configure the properties of a reservation form field.","wp-cafe")}),(0,r.jsxs)("div",{className:"max-h-[50vh] md:max-h-[55vh] xxl:max-h-[75vh] overflow-y-auto pr-1 space-y-5","data-testid":"shortcode-modal-scroller",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(l.Label,{className:"text-sm font-medium text-black",children:(0,o.__)("Field Type","wp-cafe")}),(0,r.jsx)(s.aL,{options:u.fieldTypeOptions,defaultValue:D.type,onChange:function(e){return R(function(t){return Object.assign(Object.assign({},t),{type:e})})},disabled:(null==g?void 0:g.inGroup)||(null==g?void 0:g.notDeletable),placeholder:(0,o.__)("Select field type","wp-cafe")})]}),E&&(0,r.jsx)(d.FieldOptionsEditor,{type:D.type,options:D.options,onChange:I}),!(null==g?void 0:g.inGroup)&&(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(l.Label,{className:"text-sm font-medium text-black",children:(0,o.__)("Move to step","wp-cafe")}),(0,r.jsx)(s.aL,{options:G,defaultValue:C||O,onChange:function(e){return A(e)},placeholder:(0,o.__)("Select step","wp-cafe")})]}),!(null==g?void 0:g.neverHide)&&"food_menu"!==(null==g?void 0:g.id)&&(0,r.jsxs)("div",{className:"flex items-center gap-2 pt-1",children:[(0,r.jsx)(l.Checkbox,{checked:D.required,onCheckedChange:function(e){return R(function(t){return Object.assign(Object.assign({},t),{required:!!e})})},id:"required-field"}),(0,r.jsx)(l.Label,{htmlFor:"required-field",className:"cursor-pointer text-black",children:(0,o.__)("Required this field","wp-cafe")})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-4 ".concat(Q?"md:grid-cols-2":"md:grid-cols-1"),children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(l.Label,{className:"text-sm font-medium text-black",children:(0,o.__)("Field Label","wp-cafe")}),(0,r.jsx)(l.Input,{value:D.label,onChange:function(e){return R(function(t){return Object.assign(Object.assign({},t),{label:e.currentTarget.value})})},placeholder:(0,o.__)("field label","wp-cafe")}),P&&(0,r.jsx)("p",{className:"text-red-500 text-xs mt-1",children:(0,o.__)("Field label cannot be numbers only.","wp-cafe")})]}),Q&&(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(l.Label,{className:"text-sm font-medium text-black",children:(0,o.__)("Placeholder Text","wp-cafe")}),(0,r.jsx)(l.Input,{value:D.placeholder,onChange:function(e){return R(function(t){return Object.assign(Object.assign({},t),{placeholder:e.currentTarget.value})})},placeholder:(0,o.__)("Placeholder","wp-cafe")})]})]}),"food_menu"===(null==g?void 0:g.id)&&(null===(m=null===(n=null===(t=null===window||void 0===window?void 0:window.wp)||void 0===t?void 0:t.hooks)||void 0===n?void 0:n.applyFilters)||void 0===m?void 0:m.call(n,"wpcafe_food_menu_fields",null,{fieldDraft:D,setFieldDraft:R,SelectBox:s.aL}))]}),(0,r.jsxs)(l.DialogFooter,{className:"mt-4 gap-4 md:gap-2",children:[(0,r.jsx)(l.Button,{type:"button",variant:"outline",onClick:B,children:(0,o.__)("Cancel","wp-cafe")}),(0,r.jsx)(l.Button,{type:"button",onClick:function(){var e=Object.assign(Object.assign({},D),{targetStepId:C||O});g&&b?b(g.id,e):w(e),B()},disabled:!M,children:g?(0,o.__)("Save Changes","wp-cafe"):(0,o.__)("Create Field","wp-cafe")})]})]})]})}:null;n.d(t,["default",0,m])},68612(e,t,n){n.r(t),n.d(t,{FieldOptionsEditor:()=>c});var r=n(74848),o=n(27723),a=n(86087);if(945==n.j)var i=n(1839);var l=n(62468);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}
1var c=function(e){var t=e.type,n=e.options,c=e.onChange;if(!["select","radio","checkbox"].includes(t))return null;var u=(0,a.useCallback)(function(){var e;c([].concat(function(e){if(Array.isArray(e))return s(e)}(e=n)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[{label:"",value:""}]))},[n,c]),d=(0,a.useCallback)(function(e){c(n.filter(function(t,n){return n!==e}))},[n,c]),p=(0,a.useCallback)(function(e,t){var r=n.map(function(r,o){if(o!==e)return r;var a="";if(t.trim()){for(var i=n.map(function(t,n){return n!==e?t.label:""}).filter(Boolean),l=t,s=1;i.includes(l);)l="".concat(t," ").concat(s),s++;a=l}return Object.assign(Object.assign({},r),{label:t,value:a})});c(r)},[n,c]),f="select"===t?(0,o.__)("Dropdown Options","wp-cafe"):"radio"===t?(0,o.__)("Radio Choices","wp-cafe"):"checkbox"===t?(0,o.__)("Checkbox Choices","wp-cafe"):(0,o.__)("Options","wp-cafe");return(0,r.jsxs)("div",{className:"space-y-2 max-h-50 md:max-h-60 lg:max-h-80 overflow-y-auto pr-1",children:[(0,r.jsx)(l.Label,{className:"text-sm font-medium",children:f}),(0,r.jsxs)(l.Card,{className:"space-y-4 rounded-md p-4",children:[(0,r.jsx)("div",{className:"space-y-2",children:n.map(function(e,t){return(0,r.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,r.jsx)(l.Input,{value:e.label,onChange:function(e){return p(t,e.currentTarget.value)},placeholder:(0,o.__)("Option label","wp-cafe")}),(0,r.jsx)(l.Button,{type:"button",variant:"danger",className:"shrink-0",onClick:function(){return d(t)},size:"sm",children:(0,r.jsx)(i.A,{className:"size-3 text-danger"})})]},t)})}),(0,r.jsxs)(l.Button,{type:"button",variant:"softSecondary",className:"text-primary",onClick:u,children:["+ ",(0,o.__)("New Option","wp-cafe")]})]})]})}},29186(e,t,n){n.r(t);var r=n(74848),o=n(27723),a=n(86087),i=n(62468),l=n(64994),s=n(98140),c=n(10358),u=n(88687);const d=945==n.j?function(){var e,t,n,d=(0,s.useFormCustomization)(),p=d.steps,f=d.activeStep,v=d.setActiveStep,m=d.reorderStep,_=(0,a.useRef)(null),h=function(e,t){_.current=e,t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",String(e))},w=function(e){},g=function(e,t){t.preventDefault();var n=null!==_.current?_.current:Number(t.dataTransfer.getData("text/plain"));Number.isFinite(n)&&n!==e&&m(n,e),_.current=null};return(0,r.jsxs)(i.Tabs,{value:f,onValueChange:v,className:"space-y-4",children:[(0,r.jsx)(i.Card,{className:"rounded-md bg-neutral-100 p-4",children:(0,r.jsxs)(i.TabsList,{className:"inline-flex justify-start gap-3 bg-transparent p-0 flex-wrap h-auto",children:[p.map(function(e,t){return(0,r.jsx)(l.default,{step:e,index:t,onDragStart:h,onDragOver:w,onDrop:g},e.id)}),null===(n=null===(t=null===(e=null===window||void 0===window?void 0:window.wp)||void 0===e?void 0:e.hooks)||void 0===t?void 0:t.applyFilters)||void 0===n?void 0:n.call(t,"wpcafe_reservation_add_new_step",(0,r.jsx)("div",{title:(0,o.__)("Upgrade to Pro","wp-cafe"),children:(0,r.jsxs)(i.Button,{type:"button",className:"rounded-[20px] flex items-center shrink-0 bg-white border border-white px-3 sm:px-3 text-sm!","aria-label":(0,o.__)("Add new step","wp-cafe"),variant:"ghost",disabled:!0,children:[(0,r.jsx)(u.uJ,{height:16,width:16}),(0,r.jsx)("span",{children:(0,o.__)("Add step","wp-cafe")})]})}))]})}),p.map(function(e){return(0,r.jsx)(i.TabsContent,{value:e.id,children:(0,r.jsx)(c.default,{stepId:e.id,fields:e.fields||[]})},e.id)})]})}:null;n.d(t,["default",0,d])},28498(e,t,n){n.r(t);var r=n(74848),o=n(1158),a=n(38802),i=n(88687),l=n(62468);const s=945==n.j?function(e){var t=e.field;return(0,r.jsxs)(l.Card,{className:"flex flex-row justify-between flex-wrap items-center gap-2 px-2 sm:px-4 py-4 border border-neutral-300 rounded-sm shadow-none bg-white cursor-not-allowed",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4 min-w-0",children:[(0,r.jsx)("div",{"aria-hidden":"true",children:(0,r.jsx)(i.uJ,{height:20,width:20})}),(0,r.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,r.jsx)("div",{className:"truncate font-medium text-xs sm:text-sm",children:t.label}),(0,r.jsx)(a.VY,{className:"text-[10px] sm:text-xs text-neutral-500",children:(0,o.typeToSubtitle)(t.type)})]})]}),(0,r.jsx)(a.s9,{})]})}:null;n.d(t,["default",0,s])},45785(e,t,n){n.r(t);var r=n(74848),o=n(27723);if(945==n.j)var a=n(98188);if(945==n.j)var i=n(21436);if(945==n.j)var l=n(67378);if(945==n.j)var s=n(1839);var c=n(62468),u=n(38802),d=n(1158),p=n(98140),f=n(39992),v=n(28498);const m=945==n.j?function(e){var t,n=e.stepId,m=e.field,_=e.handleDragStart,h=e.handleDragOver,w=e.handleDrop,g=e.index,b=e.editField,y=(0,p.default)(),x=y.toggleFieldVisible,j=y.deleteField,S=(0,f.Mm)(),O=(0,f.q7)().modulesData;return m.module&&"on"!==(null===(t=null==O?void 0:O[m.module])||void 0===t?void 0:t.status)?null:(null==m?void 0:m.isPro)&&!S?(0,r.jsx)(v.default,{field:m}):(0,r.jsxs)(c.Card,{className:"grid grid-cols-[1fr_auto_auto] sm:grid-cols-[1fr_120px_120px] items-center gap-2 sm:gap-0 px-2 sm:px-4 py-4 border border-neutral-300 rounded-sm shadow-none bg-white transition-all duration-200 hover:shadow-md cursor-default",draggable:!m.inGroup,onDragStart:function(e){return!m.inGroup&&_(g,e)},onDragOver:h,onDrop:function(e){return w(g,e)},children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 sm:gap-4 min-w-0",children:[m.inGroup?(0,r.jsx)("div",{className:"cursor-not-allowed","aria-hidden":"true",children:(0,r.jsx)(l.A,{className:"size-4 sm:size-6"})}):(0,r.jsx)("div",{className:"cursor-grab active:cursor-grabbing","aria-hidden":"true",children:(0,r.jsx)(i.A,{className:"size-4 sm:size-6"})}),(0,r.jsxs)("div",{className:"min-w-0 space-y-0.5 sm:space-y-1",children:[(0,r.jsx)("div",{className:"truncate font-medium text-xs sm:text-sm",children:m.label}),(0,r.jsx)(u.VY,{className:"text-[10px] sm:text-xs",children:(0,d.typeToSubtitle)(m.type)}),("visual_table"===m.id||"total_guest"===m.id)&&(0,r.jsx)(u.VY,{className:"text-[10px] sm:text-xs text-neutral-500",children:"visual_table"===m.id?(0,o.__)("When this field is visible, 'Total Guest' will be hidden automatically.","wp-cafe"):(0,o.__)("When this field is visible, 'Visual Table' will be hidden automatically.","wp-cafe")})]})]}),(0,r.jsx)("div",{className:"flex justify-center",children:(0,r.jsx)(c.Switch,{disabled:m.inGroup&&m.neverHide,checked:!1!==m.visible,onCheckedChange:function(e){return x(n,m.id,e)},className:"scale-75 sm:scale-100"})}),(0,r.jsxs)("div",{className:"flex justify-end gap-1 sm:gap-2",children:[(0,r.jsx)(u.W5,{variant:"ghost",size:"icon",onClick:function(){return null==b?void 0:b(n,m.id)},buttonClassName:"size-7 sm:size-8 border border-neutral-300",tooltip:(0,o.__)("Edit field","wp-cafe"),icon:(0,r.jsx)(a.A,{className:"size-3 sm:size-4"})}),!m.inGroup&&!m.notDeletable&&(0,r.jsx)(u.uW,{onConfirm:function(){return j(n,m.id)},trigger:(0,r.jsx)(u.W5,{variant:"ghost",size:"icon",buttonClassName:"size-7 sm:size-8 border border-neutral-300",tooltip:(0,o.__)("Delete field","wp-cafe"),icon:(0,r.jsx)(s.A,{className:"size-3 sm:size-4 text-danger"})})})]})]})}:null;n.d(t,["default",0,m])},64994(e,t,n){n.r(t);var r=n(74848),o=n(27723),a=n(86087);if(945==n.j)var i=n(3213);if(945==n.j)var l=n(98188);if(945==n.j)var s=n(48635);if(945==n.j)var c=n(32708);
1var u=n(38802),d=n(62468),p=n(71112),f=n(98140);function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return m(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const _=945==n.j?function(e){var t=e.step,n=e.index,m=e.onDragStart,_=e.onDragOver,h=e.onDrop,w=(0,f.default)(),g=w.steps,b=w.activeStep,y=w.renameStep,x=w.deleteStep,j=v((0,a.useState)(!1),2),S=j[0],O=j[1],k=v((0,a.useState)(!1),2),N=k[0],C=k[1],A=v((0,a.useState)(t.label),2),F=A[0],T=A[1],z=(0,a.useRef)(null);(0,a.useEffect)(function(){var e,t;N&&(null===(e=z.current)||void 0===e||e.focus(),null===(t=z.current)||void 0===t||t.select())},[N]),(0,a.useEffect)(function(){T(t.label)},[t.label]);var D=function(){y(t.id,F),C(!1)};return(0,r.jsxs)("div",{className:"flex items-center gap-2",draggable:!0,onDragStart:function(e){return null==m?void 0:m(n,e)},onDragOver:function(e){e.preventDefault(),null==_||_(e)},onDrop:function(e){return null==h?void 0:h(n,e)},children:[(0,r.jsxs)("div",{className:(0,p.cn)("rounded-[20px] flex items-center shrink-0 text-sm pr-3 bg-white border h-9 sm:h-11",b===t.id?"border-primary":"border-white"),children:[(0,r.jsx)(d.TabsTrigger,{value:t.id,className:"bg-transparent pl-3 py-1.5 data-[state=active]:bg-transparent cursor-pointer text-neutral-500 data-[state=active]:text-neutral-500 data-[state=active]:shadow-none font-medium!",children:N?(0,r.jsx)(d.Input,{ref:z,value:F,onChange:function(e){return T(e.target.value)},onBlur:D,onKeyDown:function(e){"Enter"===e.key?(e.preventDefault(),D()):"Escape"===e.key&&(e.preventDefault(),T(t.label),C(!1))},className:"h-7 w-35 bg-transparent px-2 py-0 "}):(0,r.jsx)("span",{children:t.label})}),(0,r.jsxs)(d.DropdownMenu,{open:S,onOpenChange:O,children:[(0,r.jsx)(d.DropdownMenuTrigger,{asChild:!0,children:(0,r.jsx)(u.W5,{type:"button","aria-label":(0,o.__)("Manage Step","wp-cafe"),tooltip:(0,o.__)("Manage Step","wp-cafe"),icon:(0,r.jsx)(i.A,{className:"size-4"}),buttonClassName:"size-6 sm:size-6 bg-transparent hover:bg-neutral-200"})}),(0,r.jsxs)(d.DropdownMenuContent,{align:"end",className:"border border-neutral-300 rounded-sm",children:[(0,r.jsxs)(d.DropdownMenuItem,{onClick:function(){O(!1),C(!0)},className:"px-3 h-auto text-sm! font-normal gap-2 rounded-sm ",children:[(0,r.jsx)(l.A,{className:"mr-2 h-4 w-4 text-black"}),(0,o.__)("Rename","wp-cafe")]}),!(null==t?void 0:t.isDefault)&&(0,r.jsx)(u.Po,{onConfirm:function(){return null==x?void 0:x(t.id)},title:(0,o.__)("Delete Step","wp-cafe"),description:(0,o.__)("Are you sure you want to delete this step? This action cannot be undone.","wp-cafe"),trigger:(0,r.jsxs)(d.DropdownMenuItem,{className:"px-2.5 flex items-center gap-2 cursor-pointer text-red-600 hover:text-red-700! hover:bg-red-50",onSelect:function(e){return e.preventDefault()},children:[(0,r.jsx)(c.A,{className:"mr-2 h-4 w-4 text-red-600"}),(0,o.__)("Delete","wp-cafe")]})})]})]})]}),g.length!==n+1&&(0,r.jsx)(s.A,{className:"size-4 md:size-5 text-foreground/70"})]})}:null;n.d(t,["default",0,_])},10358(e,t,n){n.r(t);var r=n(74848),o=n(27723),a=n(62468),i=n(45785),l=n(38802),s=n(48542),c=n(98140),u=n(86087);function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}
1finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const f=945==n.j?function(e){var t=e.stepId,n=e.fields,p=(0,c.default)(),f=p.reorderField,v=p.addField,m=p.editField,_=d((0,u.useState)(null),2),h=_[0],w=_[1],g=d((0,u.useState)(!1),2),b=g[0],y=g[1],x=h&&(n||[]).find(function(e){return e.id===h})||null,j=function(e,t){w(t),y(!0)},S=-1,O=function(e,t){S=e,t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",String(e))},k=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"}
1,N=function(e,n){n.preventDefault();var r=S>=0?S:Number(n.dataTransfer.getData("text/plain"));Number.isFinite(r)&&"function"==typeof f&&f(t,r,e),S=-1};return(0,r.jsxs)(a.Card,{className:"rounded-md p-4 space-y-4",children:[(0,r.jsxs)("div",{className:"grid grid-cols-[1fr_auto_auto] sm:grid-cols-[1fr_120px_120px] items-center gap-2 sm:gap-0 px-2 sm:px-4 pb-3 border-b border-neutral-300 font-semibold text-neutral-400 text-xs sm:text-sm",children:[(0,r.jsx)("span",{children:(0,o.__)("Field name","wp-cafe")}),(0,r.jsx)("span",{className:"text-center",children:(0,o.__)("Visible","wp-cafe")}),(0,r.jsx)("span",{className:"text-right",children:(0,o.__)("Action","wp-cafe")})]}),(0,r.jsx)("div",{className:"space-y-2",children:n.map(function(e,n){return(0,r.jsx)(i.default,{stepId:t,field:e,index:n,handleDragStart:O,handleDragOver:k,handleDrop:N,editField:j},e.id)})}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(l.VY,{children:(0,o.__)("These reservation fields allow you to customize the booking process.","wp-cafe")}),(0,r.jsx)(s.default,{onCreate:function(e){return v(t,e)},editingField:x,onUpdate:function(e,n){m(t,e,n),w(null)},openExternal:b,onOpenChangeExternal:function(e){y(e),e||w(null)}})]})]})}:null;n.d(t,["default",0,f])},1158(e,t,n){n.r(t),n.d(t,{fieldTypeOptions:()=>a,generateUniqueOptionValue:()=>i,typeToSubtitle:()=>o});var r=n(27723),o=function(e){switch((e||"").toLowerCase()){case"select":return(0,r.__)("Select text box","wp-cafe");case"time":return(0,r.__)("Time input","wp-cafe");case"date":return(0,r.__)("Date input","wp-cafe");case"textarea":return(0,r.__)("Textarea","wp-cafe");case"number":return(0,r.__)("Number input","wp-cafe");case"location":return(0,r.__)("Select location","wp-cafe");case"visual_table":return(0,r.__)("Visual table selector","wp-cafe");case"food_menu":return(0,r.__)("Food menu block","wp-cafe");case"radio":return(0,r.__)("Radio input","wp-cafe");case"checkbox":return(0,r.__)("Checkbox input","wp-cafe");default:return(0,r.__)("Text input","wp-cafe")}},a=[{value:"text",label:(0,r.__)("Input box","wp-cafe")},{value:"select",label:(0,r.__)("Dropdown","wp-cafe")},{value:"textarea",label:(0,r.__)("Textarea","wp-cafe")},{value:"radio",label:(0,r.__)("Radio group","wp-cafe")},{value:"checkbox",label:(0,r.__)("Checkbox group","wp-cafe")}],i=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,""),o=0===n?r:"".concat(r,"-").concat(n);return t.includes(o)?i(e,t,n+1):o}},1701(e,t,n){n.r(t),n.d(t,{useCustomFieldModal:()=>i});var r=n(86087);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var i=function(e){var t=e.editingField,n=e.onCreate,a=e.onUpdate,i=e.openExternal,l=e.onOpenChangeExternal,s=o((0,r.useState)(!1),2),c=s[0],u=s[1],d="boolean"==typeof i?i:c,p=function(e){l?l(e):u(e)},f=o((0,r.useState)(function(){var e,n;return Object.assign({type:(null==t?void 0:t.type)||"text",required:null===(e=null==t?void 0:t.required)||void 0===e||e,label:(null==t?void 0:t.label)||"",placeholder:(null==t?void 0:t.placeholder)||"",options:(null===(n=null==t?void 0:t.options)||void 0===n?void 0:n.length)&&["select","radio","checkbox"].includes(t.type)?t.options:[{label:"",value:""}]},(null==t?void 0:t.food_menu_fields)&&{food_menu_fields:t.food_menu_fields})}),2),v=f[0],m=f[1];(0,r.useEffect)(function(){var e,n;t&&m(Object.assign({type:t.type,required:null===(e=t.required)||void 0===e||e,label:t.label,placeholder:t.placeholder||"",options:(null===(n=t.options)||void 0===n?void 0:n.length)&&["select","radio","checkbox"].includes(t.type)?t.options:[{label:"",value:""}]},(null==t?void 0:t.food_menu_fields)&&{food_menu_fields:t.food_menu_fields}))},[t]);var _=(0,r.useCallback)(function(){m({type:"text",required:!0,label:"",placeholder:"",options:[{label:"",value:""}]})},[]),h=["select","radio","checkbox"].includes(v.type),w=v.label.trim(),g=/^\d+$/.test(w),b=w.length>0&&!g&&(!h||v.options.some(function(e){return e.label.trim()})),y=!["visual_table","food_menu"].includes(v.type);return{open:d,setOpen:p,fieldDraft:v,setFieldDraft:m,isOptionType:h,isNumericOnlyLabel:g,canSubmit:b,submit:function(){if(b){var e={type:v.type,required:v.required,label:v.label.trim(),placeholder:v.placeholder.trim(),options:h?v.options.filter(function(e){return e.label.trim()}).map(function(e){return Object.assign(Object.assign({},e),{label:e.label.trim()})}):void 0};t&&a?a(t.id,e):n(e),p(!1),t||_()}},handleOptionsChange:function(e){return m(function(t){return Object.assign(Object.assign({},t),{options:e})})},showPlaceholder:y,reset:_}};const l=945==n.j?i:null;n.d(t,["default",0,l])},98140(e,t,n){n.r(t),n.d(t,{useFormCustomization:()=>u});var r=n(27723),o=n(47143),a=n(19402);function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}
1finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||s(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||s(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){if(e){if("string"==typeof e)return c(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var u=function(){var e=(0,o.useSelect)(function(e){return e(null===a.zQ||void 0===a.zQ?void 0:a.zQ.settings).getSettingsState()},[]),t=e.data,n=e.activeStep,s=(0,o.useDispatch)(null===a.zQ||void 0===a.zQ?void 0:a.zQ.settings).setSettingsState,c=(null==t?void 0:t.reservation_form_customization)||[];return{steps:c,activeStep:n,setActiveStep:function(e){s({activeStep:e})},renameStep:function(e,n){var o=c.map(function(t){return t.id===e?Object.assign(Object.assign({},t),{label:n.trim()||(0,r.__)("Untitled","wp-cafe")}):t});s({data:Object.assign(Object.assign({},t),{reservation_form_customization:o})})},deleteStep:function(e){var r,o=c.findIndex(function(t){return t.id===e}),a=c.find(function(t){return t.id===e});if(a){var i=(a.fields||[]).filter(function(e){return!0===e.notDeletable}),u=l(c);if(i.length>0){var d=u.find(function(e){return!0===e.isDefault}),p=null==d?void 0:d.id;u=u.map(function(e){if(e.id===p){var t=i.map(function(e){return Object.assign(Object.assign({},e),{visible:!1})});return Object.assign(Object.assign({},e),{fields:[].concat(l(e.fields||[]),l(t))})}return e})}u=u.filter(function(t){return t.id!==e});var f=n;n===e&&(f=(null===(r=u[Math.min(o,Math.max(u.length-1,0))])||void 0===r?void 0:r.id)||""),s({data:Object.assign(Object.assign({},t),{reservation_form_customization:u}),activeStep:f})}},reorderStep:function(e,r){if(e!==r){var o=l(c);if(!(e<0||r<0||e>=o.length||r>=o.length)){var a=i(o.splice(e,1),1)[0];a&&(o.splice(r,0,a),s({data:Object.assign(Object.assign({},t),{reservation_form_customization:o}),activeStep:n}))}}},toggleFieldVisible:function(e,n,r){var o=c.map(function(t){if(t.id!==e)return t;var o=(t.fields||[]).map(function(e){return e.id===n?Object.assign(Object.assign({},e),{visible:"boolean"==typeof r?r:!e.visible}):"visual_table"===n&&"total_guest"===e.id||"total_guest"===n&&"visual_table"===e.id?Object.assign(Object.assign({},e),{visible:!1}):e});return"boolean"==typeof r&&!0===r&&("visual_table"===n?o=o.map(function(e){return"total_guest"===e.id?Object.assign(Object.assign({},e),{visible:!1}):e}):"total_guest"===n&&(o=o.map(function(e){return"visual_table"===e.id?Object.assign(Object.assign({},e),{visible:!1}):e}))),Object.assign(Object.assign({},t),{fields:o})});s({data:Object.assign(Object.assign({},t),{reservation_form_customization:o})})},deleteField:function(e,n){var r=c.map(function(t){if(t.id!==e)return t;var r=(t.fields||[]).find(function(e){return e.id===n});return r&&r.inGroup?t:Object.assign(Object.assign({},t),{fields:(t.fields||[]).filter(function(e){return e.id!==n})})});s({data:Object.assign(Object.assign({},t),{reservation_form_customization:r})})},addField:function(e,r){for(var o=r.targetStepId||e||n,a=(r.label||r.type||"field").toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||r.type||"field",i=c.find(function(e){return e.id===o}),u=((null==i?void 0:i.fields)||[]).map(function(e){return e.id}),d=a,p=1;u.includes(d);)d="".concat(a,"-").concat(p++);var f={id:d,type:r.type,label:r.label,placeholder:r.placeholder||"",required:!!r.required,visible:!0};["select","radio","checkbox"].includes(r.type)&&(f.options=r.options||[]);var v=c.map(function(e){return e.id===o?Object.assign(Object.assign({},e),{fields:[].concat(l(e.fields||[]),[f])}):e});s({data:Object.assign(Object.assign({},t),{reservation_form_customization:v})})},reorderField:function(e,n,r){if(n!==r){var o=c.map(function(t){if(t.id!==e)return t;var o=l(t.fields||[]),a=o.length-1;if(n<0||r<0||n>a||r>a)return t;var s=o[n];if(null==s?void 0:s.inGroup)return t;var c=i(o.splice(n,1),1)[0],u=r,d=o.map(function(e,t){return(null==e?void 0:e.inGroup)?t:-1}).filter(function(e){return-1!==e});if(d.length){var p=Math.min.apply(Math,l(d)),f=Math.max.apply(Math,l(d));u>=p&&u<=f&&(u=u<=p?p:f+1)}if(c){var v=Math.max(0,Math.min(o.length,u));o.splice(v,0,c)}return Object.assign(Object.assign({},t),{fields:o})});s({data:Object.assign(Object.assign({},t),{reservation_form_customization:o})})}},editField:function(e,n,r){var o=r.targetStepId||e,a=c.find(function(t){return t.id===e});if(a){var i=(a.fields||[]).find(function(e){return e.id===n});if(i){var u=function(e,t){var n=e.inGroup?e.type:r.type,o="select"===n||"radio"===n||"checkbox"===n;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},e),t&&{id:t}),{type:n,label:r.label,placeholder:r.placeholder||"",required:!!r.required}),(null==r?void 0:r.food_menu_fields)&&{food_menu_fields:r.food_menu_fields}),o?{options:r.options||[]}:{options:void 0})};if(o===e||i.inGroup){var d=c.map(function(t){if(t.id!==e)return t;var r=(t.fields||[]).map(function(e){return e.id===n?u(e):e});return Object.assign(Object.assign({},t),{fields:r})});s({data:Object.assign(Object.assign({},t),{reservation_form_customization:d})})}else{var p=c.find(function(e){return e.id===o});if(!p)return;var f=(p.fields||[]).map(function(e){return e.id}),v=f.includes(i.id)?function(e,t){for(var n=(t||i.label||i.type||"field").toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"field",r=n,o=1;e.includes(r);)r="".concat(n,"-").concat(o++);return r}(f,r.label):i.id,m=u(i,v),_=c.map(function(t){return t.id===e?Object.assign(Object.assign({},t),{fields:(t.fields||[]).filter(function(e){return e.id!==n})}):t.id===o?Object.assign(Object.assign({},t),{fields:[].concat(l(t.fields||[]),[m])}):t});s({data:Object.assign(Object.assign({},t),{reservation_form_customization:_})})}}}}}};const d=945==n.j?u:null;n.d(t,["default",0,d])}
1,45865(e,t,n){n.r(t);var r=n(74848),o=n(27723);if(945==n.j)var a=n(84976);var i=n(38802),l=n(33779),s=n(29186);const c=945==n.j?function(){return(0,r.jsx)(i.bg,{title:(0,o.__)("Form Customization","wp-cafe"),description:(0,r.jsxs)(r.Fragment,{children:[(0,o.__)("Customize the reservation form fields to better suit your restaurant's needs.","wp-cafe")," ",(0,r.jsx)(a.N_,{className:"text-primary!",to:l.HD+"?tab=reservation",children:(0,o.__)("Get shortcode ","wp-cafe")}),(0,o.__)(" to display reservation form","wp-cafe")]}),children:(0,r.jsx)(s.default,{})})}:null;n.d(t,["default",0,c])},54258(e,t,n){n.r(t);var r=n(74848),o=n(27723),a=n(38802);const i=945==n.j?function(){return(0,r.jsx)(a.bg,{title:(0,o.__)("Payment Settings","wp-cafe"),className:"mb-10",children:(0,r.jsxs)("div",{className:"space-y-5",children:[(0,r.jsx)(a.q5,{title:(0,o.__)("Enable Local Payment","wp-cafe"),name:"enable_local_payment",description:(0,o.__)("Enable this option to allow customers to pay at the restaurant locally instead of online.","wp-cafe")}),(0,r.jsx)(a.q5,{title:(0,o.__)("Enable Woocommerce Payments","wp-cafe"),name:"enable_woocommerce_payments",description:(0,o.__)("Enable this option to allow customers to pay using Woocommerce payment gateways.","wp-cafe")})]})})}:null;n.d(t,["default",0,i])},79244(e,t,n){n.r(t);var r=n(74848),o=n(27723),a=n(10404),i=n(38802);const l=945==n.j?function(){var e=(0,a.useFormContext)().control;return(0,r.jsx)(i.X,{title:(0,o.__)("Reservation Button Text","wp-cafe"),description:(0,o.__)("Set the label for the reservation button shown into the reservation form, confirmation, and cancellation actions.","wp-cafe"),children:(0,r.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,r.jsx)(i.ks,{control:e,name:"reservation_form_button_text",label:(0,o.__)("Form Button","wp-cafe"),placeholder:(0,o.__)("Book a table","wp-cafe")}),(0,r.jsx)(i.ks,{control:e,name:"reservation_confirmation_button_text",label:(0,o.__)("Confirmation Button","wp-cafe"),placeholder:(0,o.__)("Confirm Booking","wp-cafe")}),(0,r.jsx)(i.ks,{control:e,name:"reservation_cancellation_button_text",label:(0,o.__)("Cancellation Button","wp-cafe"),placeholder:(0,o.__)("Request Cancellation","wp-cafe")})]})})}:null;n.d(t,["default",0,l])},83823(e,t,n){n.r(t);var r=n(74848),o=n(27723);if(945==n.j)var a=n(84976);var i=n(38802),l=n(95120),s=n(33779);const c=945==n.j?function(){return(0,r.jsx)(i.bg,{title:(0,o.__)("Reservation Settings","wp-cafe"),description:(0,r.jsxs)(r.Fragment,{children:[(0,o.__)("Manage the core settings that control how your reservation system behaves â including calendar availability, time slots, default status, booking charges, guest limits, and table layout options. ","wp-cafe")," ",(0,r.jsx)(a.N_,{to:s.HD+"?tab=reservation",className:"text-primary! hover:text-primary!",children:(0,o.__)("Get shortcode ","wp-cafe")}),(0,o.__)(" to display reservation form","wp-cafe")]}),children:(0,r.jsx)(l.default,{})})}:null;n.d(t,["default",0,c])},30095(e,t,n){n.r(t);var r=n(74848),o=n(27723),a=n(86087),i=n(10404),l=n(64239),s=n(38802),c=n(88184),u=n(62468),d=n(12483),p=n(4152),f=n(39992);const v=945==n.j?function(){var e=(0,f.X_)(),t=(0,a.useMemo)(function(){return(0,c.getDateSelectionOptions)()},[e]),n=(0,a.useMemo)(function(){return(0,c.getFormDisplayOptions)()},[e]),v=(0,a.useMemo)(function(){return(0,c.getReservationStyleOptions)()},[e]),m=(0,i.useForm)({resolver:(0,l.zodResolver)(d.reservationShortcodeSchema),mode:"onChange",defaultValues:{date_selector:"date_picker",reservation_style:"style-1",form_display_type:"wizard",image_link:void 0}}),_=m.handleSubmit,h=m.control,w=(0,p.default)().generateShortcode;return(0,r.jsx)(i.FormProvider,Object.assign({},m,{children:(0,r.jsxs)("form",{onSubmit:_(w),children:[(0,r.jsxs)("div",{className:"max-h-[50vh] md:max-h-[55vh] xxl:max-h-[75vh] overflow-y-auto pr-1 space-y-5","data-testid":"shortcode-modal-scroller",children:[(0,r.jsx)(s.LL,{control:h,name:"date_selector",options:t,label:(0,o.__)("Date Selection Method","wp-cafe"),tooltip:(0,o.__)("Choose how youâd like to select your date","
1wp-cafe")}),(0,r.jsx)(s.LL,{control:h,name:"form_display_type",options:n,label:(0,o.__)("Form Display Type","wp-cafe"),tooltip:(0,o.__)("Choose how the booking form should be displayed to customers.","wp-cafe")}),(0,r.jsx)(s.pp,{control:h,name:"reservation_style",options:v,label:(0,o.__)("Select style","wp-cafe")}),(0,r.jsx)(s.tu,{control:h,name:"image_link",label:(0,o.__)("Summary Image","wp-cafe"),tooltip:(0,o.__)("This image will be displayed at the reservation summary.","wp-cafe")})]}),(0,r.jsx)("div",{className:"mt-5 flex justify-end",children:(0,r.jsx)(u.Button,{type:"submit",children:(0,o.__)("Generate","wp-cafe")})})]})}))}:null;n.d(t,["default",0,v])},88184(e,t,n){n.r(t),n.d(t,{getDateSelectionOptions:()=>a,getFormDisplayOptions:()=>s,getReservationStyleOptions:()=>i,getShortcodes:()=>o,getTemplateOptions:()=>l});var r=n(27723),o=function(){return[{id:"wpc_reservation_form",label:(0,r.__)("Reservation Form","wp-cafe"),description:(0,r.__)("Provides a customizable form for customers to make reservations at your restaurant.","wp-cafe")}]},a=function(){return[{label:(0,r.__)("Calendar View","wp-cafe"),value:"calendar",description:(0,r.__)("Browse and click a date on a calendar","wp-cafe")},{label:(0,r.__)("Datepicker Input","wp-cafe"),value:"date_picker",description:(0,r.__)("Type or select a date from a dropdown input field","wp-cafe")}]},i=function(){return[{label:(0,r.__)("Style 1","wp-cafe"),value:"style-1"},{label:(0,r.__)("Style 2","wp-cafe"),value:"style-2"}]},l=function(){return[{label:(0,r.__)("Vertical","wp-cafe"),value:"vertical"},{label:(0,r.__)("Horizontal","wp-cafe"),value:"horizontal"}]},s=function(){return[{value:"wizard",label:(0,r.__)("Step by Step (Wizard)","wp-cafe"),description:(0,r.__)("Display the form in multiple horizontal steps with a Next button for navigation.","wp-cafe")},{value:"single",label:(0,r.__)("Single Page (All Steps at Once)","wp-cafe"),description:(0,r.__)("Show all sections in one vertical form with a single Submit button.","wp-cafe")}]}},4152(e,t,n){n.r(t);var r=n(47143),o=n(19402),a=n(27820);function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return l(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const s=945==n.j?function(){var e=(0,r.useDispatch)(null===o.zQ||void 0===o.zQ?void 0:o.zQ.shortcodes).setShortcodeState,t=(0,r.useSelect)(function(e){return e(null===o.zQ||void 0===o.zQ?void 0:o.zQ.shortcodes).getShortcodeState()},[]);return{generateShortcode:function(n){var r,o=(null===(r=null==t?void 0:t.selectedShortcode)||void 0===r?void 0:r.id)||"shortcode",l=Object.entries(n).filter(function(e){var t=i(e,2)[1];return"string"==typeof t&&t.trim().length}).map(function(e){var t,n=i(e,2),r=n[0],o=n[1];return"".concat((t=r,t.replace(/([a-z])([A-Z])/g,"$1_$2").toLowerCase()),'="').concat(String(o).trim(),'"')}).join(" "),s=l?"[".concat(o," ").concat(l,"]"):"[".concat(o,"]");e({generatedShortcode:s}),(0,a.pl)()}}}:null;n.d(t,["default",0,s])},55075(e,t,n){n.r(t);var r=n(74848),o=n(86087),a=n(55634),i=n(88184),l=n(39992);const s=945==n.j?function(){var e=(0,l.X_)(),t=(0,o.useMemo)(function(){return(0,i.getShortcodes)()},[e]);return(0,r.jsx)(r.Fragment,{children:t.map(function(e){return(0,r.jsx)(a.A,{shortcode:e},e.id)})})}:null;n.d(t,["default",0,s])},12483(e,t,n){n.r(t),n.d(t,{reservationShortcodeSchema:()=>o});var r=n(57937),o=r.z.object({date_selector:r.z.string(),reservation_style:r.z.string(),form_display_type:r.z.string(),image_link:r.z.string()}).partial()},35891(e,t,n){n.r(t),n(33285)},30726(e,t,n){n.r(t);var r=n(74848),o=n(27723),a=n(86087),i=n(47143);if(2343!=n.j)var l=n(84976);if(2343!=n.j)var s=n(47767);var c=n(25380),u=n(92060),d=n(38802),p=n(19402),f=n(99693);function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const m=2343!=n.j?function(){var e,t,n,m,_,h=(m=(0,l.ok)(),_=1,function(e){if(Array.isArray(e))return e}(m)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}
1finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(m,_)||function(e,t){if(e){if("string"==typeof e)return v(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,t):void 0}}(m,_)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],w=(0,f.D)().theme,g=null==h?void 0:h.get("location_id"),b=(0,s.Zp)(),y=(0,c.A)(),x=y.updateLocation,j=y.getSingleLocation,S=(0,u.A)().editSettings,O=(0,i.useSelect)(function(e){return e(null===p.zQ||void 0===p.zQ?void 0:p.zQ.settings).getSettingsState()},[]).data,k=(0,i.useSelect)(function(e){return e(null===p.zQ||void 0===p.zQ?void 0:p.zQ.location).getLocationState()},[]),N=k.singleLocation,C=k.isFiltering,A=g?null==N?void 0:N.visual_table_layout:null==O?void 0:O.visual_table_layout,F=!(O&&(!g||N));(0,a.useEffect)(function(){g&&j(parseInt(g))},[g]);var T=g?null==N?void 0:N.reservation_total_seat_capacity:null==O?void 0:O.reservation_total_seat_capacity;return null===(n=null===(t=null===(e=null===window||void 0===window?void 0:window.wp)||void 0===e?void 0:e.hooks)||void 0===t?void 0:t.applyFilters)||void 0===n?void 0:n.call(t,"wpcafe_visual_table_reservation_settings",(0,r.jsx)(d.Yg,{title:(0,o.__)("Enable Visual Table Layout","wp-cafe"),description:(0,o.__)("Enable Wp Cafe Pro to use Visual Table Layout. THis will allow you to design table layout plan for reservations of your restaurant.","wp-cafe"),isPro:!0}),Object.assign({theme:w,editSettings:S,totalSeatCapacity:T,layoutData:A,isLoadingData:F,isUpdating:C},g?{locationId:g,handleBackToLocation:function(){b("/location/update/".concat(g))},updateLocation:x,locationName:null==N?void 0:N.restaurant_name}:{}))}:null;n.d(t,["default",0,m])},71133(e,t,n){n.r(t),n(16518),n(5860),n(55356),n(91099)},5860(e,t,n){n.r(t);var r,o,a,i=n(74848),l=n(95120);null===(a=null===(o=null===(r=null===window||void 0===window?void 0:window.wp)||void 0===r?void 0:r.hooks)||void 0===o?void 0:o.addFilter)||void 0===a||a.call(o,"wpcafe_reservation_onboard","wp-cafe",function(e,t){return(0,i.jsx)(l.default,Object.assign({},t))},10)},16518(e,t,n){n.r(t);var r,o,a,i,l,s,c,u,d,p,f,v,m=n(74848),_=n(45865),h=n(5962),w=n(83823),g=n(54258);null===(a=null===(o=null===(r=null===window||void 0===window?void 0:window.wp)||void 0===r?void 0:r.hooks)||void 0===o?void 0:o.addFilter)||void 0===a||a.call(o,"wpcafe_reservation_rules_settings","wp-cafe",function(){return(0,m.jsx)(w.default,{})},10),null===(s=null===(l=null===(i=null===window||void 0===window?void 0:window.wp)||void 0===i?void 0:i.hooks)||void 0===l?void 0:l.addFilter)||void 0===s||s.call(l,"wpcafe_reservation_customization_settings","wp-cafe",function(){return(0,m.jsx)(_.default,{})},10),null===(d=null===(u=null===(c=null===window||void 0===window?void 0:window.wp)||void 0===c?void 0:c.hooks)||void 0===u?void 0:u.addFilter)||void 0===d||d.call(u,"wpcafe_reservation_message_settings","wp-cafe",function(){return(0,m.jsx)(h.default,{})},10),null===(v=null===(f=null===(p=null===window||void 0===window?void 0:window.wp)||void 0===p?void 0:p.hooks)||void 0===f?void 0:f.addFilter)||void 0===v||v.call(f,"wpcafe_payment_settings","wp-cafe",function(){return(0,m.jsx)(g.default,{})},10)},91099(e,t,n){n.r(t);var r,o,a,i,l,s,c=n(74848),u=n(46229);null===(a=null===(o=null===(r=null===window||void 0===window?void 0:window.wp)||void 0===r?void 0:r.hooks)||void 0===o?void 0:o.removeFilter)||void 0===a||a.call(o,"wpcafe_reservation_slot_picker","wpcafe"),null===(s=null===(l=null===(i=null===window||void 0===window?void 0:window.wp)||void 0===i?void 0:i.hooks)||void 0===l?void 0:l.addFilter)||void 0===s||s.call(l,"wpcafe_reservation_slot_picker","wpcafe",function(e,t){return(0,c.jsx)(u.A,Object.assign({},t))},10)},55356(e,t,n){n.r(t);var r,o,a,i,l,s,c=n(74848),u=n(55075),d=n(30095);null===(a=null===(o=null===(r=null===window||void 0===window?void 0:window.wp)||void 0===r?void 0:r.hooks)||void 0===o?void 0:o.addFilter)||void 0===a||a.call(o,"wpcafe_reservation_shortcode","wp-cafe",function(){return(0,c.jsx)(u.default,{})},10),null===(s=null===(l=null===(i=null===window||void 0===window?void 0:window.wp)||void 0===i?void 0:i.hooks)||void 0===l?void 0:l.addFilter)||void 0===s||s.call(l,"wpcafe_reservation_shortcode_form","wp-cafe",function(e,t){return(0,c.jsx)(d.default,Object.assign({},t))},10)},33779(e,t,n){n.d(t,{AU:()=>v,FC:()=>f,HD:()=>l,QY:()=>
1_,S:()=>u,S5:()=>o,TE:()=>m,TQ:()=>w,To:()=>r,VF:()=>d,VQ:()=>p,a8:()=>i,aI:()=>h,aJ:()=>a,hT:()=>g,oj:()=>c,vx:()=>s});var r="/",o="/onboard",a="/settings",i="/modules",l="/shortcodes",s="/food-menu",c="/location",u="/reservations",d="/about-us",p="/ask-ai",f="create",v="update/:id",m="/table-layout",_="".concat(m,"?location_id="),h="/qr-code",w="create",g="update/:id"}}]);
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.