@restaround/react 1.0.59 → 1.0.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/models/index.js.map +1 -1
- package/dist/utils/index.esm.js.map +1 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{isEmpty as i,trackEvent as o,priceFormatter as r,classNames as a}from"@sorocraft/js-utils";import{createContext as d,useContext as l,useState as c,useRef as s,useEffect as u,useMemo as m,memo as _,useCallback as h}from"react";import{Row as g,classNames as p,IconLink as v,Tooltip as f,SVGIcon as y,Flex as I,Column as P,Carousel as A,CarouselItem as b,Chip as C,UIElementType as N,Text as S,IconButton as w,Input as k,InputType as L,Modal as T,Button as O,Drawer as D,Description as R,Container as j,Card as G,DropDown as x,DropDownMenuItem as q,Loading as E,BarChart as V}from"@sorocraft/ui";import{Phone as W,Whatsapp as z,Instagram as H,Telegram as Q,Tiktok as B,Facebook as U,Wifi as M,MarkerPin as Y,Plus as $,Minus as F,Trash as X,ShoppingBag as K,Close as Z,List as J,Grid as ee}from"@sorocraft/ui/icons";function te(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n}function ne(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{l(i.next(e))}catch(e){r(e)}}function d(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,d)}l((i=i.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;var ie="PublicMenu-module_container__QLN6U",oe="PublicMenu-module_categories__Iy6NC",re="PublicMenu-module_footer__6G3DQ";const ae="https://images.restaround.co",de=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${ae}/${e}`:"",le=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${ae}/${e}`:"https://images.restaround.co/no-photo-128.webp",ce=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${ae}/${e}`:"https://images.restaround.co/restaround-doodle.webp",se="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",ue=(e,t,n)=>se.charAt(e>>2)+se.charAt((3&e)<<4|t>>4)+se.charAt((15&t)<<2|n>>6)+se.charAt(63&n),me="restaround.co",_e=[me,"restaround.az","restaround.ee","restaround.nl"],he=d({}),ge=({children:t,value:n})=>{const o=i(n)?{}:n;return o.currency||(o.currency="AZN"),o.language||(o.language="az"),e(he.Provider,{value:i(n)?{}:n,children:t})},pe=()=>l(he),ve="digital_menu",fe=`${ve}_category_select`,ye=`${ve}_category_scroll`,Ie=`${ve}_product_details`,Pe=`${ve}_product_add_cart`,Ae=`${ve}_product_view_changed`,be=[fe,ye,Ie,Pe],Ce=(e,t)=>{var n,i;return(null===(i=null===(n=null==e?void 0:e.translations)||void 0===n?void 0:n.find)||void 0===i?void 0:i.call(n,(e=>e.language===t)))||{}};var Ne="Header-module_container__tenlF",Se="Header-module_cover__BAWZK",we="Header-module_content__Gx4Al",ke="Header-module_logo__4MTCm",Le="Header-module_info__IchYA",Te="Header-module_name__30wyw",Oe="Header-module_address__WOxXc",De="Header-module_addressText__lUszI",Re="Header-module_social__AoP0z",je="Header-module_links__EeQxg",Ge="Header-module_wifiPassword__VWBTa",xe="Header-module_wifiPasswordIcon__Ukn3D";const qe=t=>{const n=te(t,["priority","blurDataURL","quality","placeholder","fetchPriority"]),{imageTag:i}=pe()||{};if(i){return e(i,Object.assign({},t,{quality:t.quality||100,placeholder:"blur",blurDataURL:(o=235,r=59,a=90,`data:image/gif;base64,R0lGODlhAQABAPAA${ue(0,o,r)+ue(a,255,255)}/yH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==`)}))}var o,r,a;return e("img",Object.assign({},n))};var Ee={container:"Languages-module_container__nJeK1",currentLanguage:"Languages-module_currentLanguage__EFw6Q",options:"Languages-module_options__6jLRm",option:"Languages-module_option__QkVQd",isOpen:"Languages-module_isOpen__eUGbg",flexWide:"Languages-module_flexWide__zQ9jN",slidein:"Languages-module_slidein__C4UHU",fadeInOut:"Languages-module_fadeInOut__U-vhH",heightAnimation:"Languages-module_heightAnimation__gIQkF",fadein:"Languages-module_fadein__vPmsX",floatAnimation:"Languages-module_floatAnimation__L-kPH",bottomSheet:"Languages-module_bottomSheet__-t-q8",slideRightToLeft:"Languages-module_slideRightToLeft__y0l-f"};const Ve=()=>{var n;const{language:i,languages:o,onLanguageSelect:r}=pe(),[a,d]=c(!1),l=(null==o?void 0:o.length)>1,s=(null===(n=null==o?void 0:o.filter)||void 0===n?void 0:n.call(o,(({code:e})=>e!==i)))||[],u=e=>`https://images.restaround.co/languages/${e}.svg`;return l?e("div",{className:Ee.container,onClick:()=>d(!a),children:t(g,{alignItems:"center",gap:0,children:[e(g,{alignItems:"center",className:p(Ee,{options:!0,isOpen:a}),children:s.map((({code:t})=>e("img",{src:u(t),className:Ee.option,onClick:()=>(e=>{r&&r(e)})(t),alt:t},t)))}),e("img",{src:u(i),alt:i||"",className:Ee.currentLanguage})]})}):null},We=({branch:n,coverImage:o,logoImage:r,name:a,instagram:d,facebook:l,whatsapp:c,telegram:s,tiktok:u})=>{const{address:m,latitude:_,longitude:h,phone:p,wifiPassword:A}=n||{},b=i(n),C=`https://www.google.com/maps/place/${_},${h}`;return t("div",{className:Ne,children:[e(qe,{src:o,alt:a,className:Se,width:1024,height:400,priority:!0,sizes:"100vw",fetchPriority:"high",loading:"eager"}),e("div",{className:we,children:e(b?()=>t(P,{fullWidth:!0,fullHeight:!0,alignItems:"center",justifyContent:"center",children:[e(qe,{src:r,alt:a,className:ke,width:96,height:96}),e("div",{className:Le,children:e("h1",{className:Te,children:a})})]}):()=>t(I,{direction:"row",gap:1,alignItems:"center",fullWidth:!0,children:[e(I.Item,{children:e(qe,{src:r,alt:a,className:ke,width:96,height:96})}),e(I.Item,{shrink:!0,className:Le,children:t(P,{gap:.25,children:[e("h1",{className:Te,children:a}),e("a",{className:Oe,href:C,target:"_blank",rel:"noopener noreferrer",children:t(g,{alignItems:"center",gap:.5,children:[e(y,{icon:Y,theme:"dark"}),e("span",{className:De,children:m})]})})]})})]}),{})}),e(Ve,{}),!b&&e("div",{className:Re,children:e("div",{className:je,children:e(g,{gap:2,alignItems:"center",children:t(g,{alignItems:"center",justifyContent:"center",gap:.5,children:[!!p&&e(v,{icon:W,href:`tel:+${p}`,size:"sm",shape:"circle",theme:"light"}),!!c&&e(v,{icon:z,href:`https://wa.me/${c}`,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!d&&e(v,{icon:H,href:d,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!s&&e(v,{icon:Q,href:s,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!u&&e(v,{icon:B,href:u,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!l&&e(v,{icon:U,href:l,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!A&&e(f,{hint:A,children:e("div",{className:Ge,children:e(y,{icon:M,size:"sm",className:xe})})})]})})})})]})},ze=({categoryProductMap:t=[],language:n,selectedCategoryId:i,onSelectCategory:r})=>{const a=s({}),d=s(null);return u((()=>{i&&(()=>{var e;const t=null===(e=null==a?void 0:a.current)||void 0===e?void 0:e[i];if(!t||!d.current)return;const n=d.current.clientWidth,o=t.offsetLeft-n/2+t.offsetWidth/2;d.current.scrollTo({left:o,behavior:"smooth"})})()}),[i]),e("div",{className:oe,children:e(A,{gap:1,onGetRef:e=>{(null==e?void 0:e.current)&&(d.current=e.current)},children:(t||[]).map((({id:t,translations:d})=>{const{name:l}=d.find((e=>e.language===n))||{};return e(b,{children:e(C,{onClick:()=>((e,t)=>{e!==i&&(o(fe,{name:t}),r(e))})(t,l),type:N.BORDERED_PRIMARY,active:t===i,children:e("div",{ref:e=>{e&&(a.current[t]=e)},children:l})})},t)}))})})};var He="Products-module_container__bF2LF",Qe="Products-module_view__l857X",Be="Products-module_products__AoDrY",Ue="Products-module_category__Sp7dE",Me="Products-module_list__LH4v5";const Ye=(e=0,t=1,n=0)=>e*t*(1+n/100);var $e;!function(e){e.SINGLE="SINGLE",e.MULTIPLE="MULTIPLE"}($e||($e={}));const Fe=(e,t)=>{var n,i;return(null===(i=null===(n=null==e?void 0:e.translations)||void 0===n?void 0:n.find)||void 0===i?void 0:i.call(n,(e=>e.language===t)))||{}},Xe=(e,t)=>{var n,i;return(null===(i=null===(n=null==e?void 0:e.translations)||void 0===n?void 0:n.find)||void 0===i?void 0:i.call(n,(e=>e.language===t)))||{}},Ke=(e,t)=>{var n;return(null===(n=((null==e?void 0:e.options)||[]).find((({id:e})=>e===t)))||void 0===n?void 0:n.price)||0},Ze=(e,t)=>{var n,i;return(null===(i=null===(n=null==e?void 0:e.translations)||void 0===n?void 0:n.find)||void 0===i?void 0:i.call(n,(e=>e.language===t)))||{}},Je=(e,t=1)=>{const{price:n=0,vat:i=0}=e||{};return Ye(n,t,i)},et=(e,t,n,i=1)=>{const o=Je(e,i);return{totalPrice:o,formattedTotalPrice:r(o,t,n)}},tt=(e,t)=>{var n,i;return(null===(i=null===(n=null==e?void 0:e.variants)||void 0===n?void 0:n.find)||void 0===i?void 0:i.call(n,(e=>e.id===t)))||{}},nt=(e,t,n)=>{const i=tt(t,e),{vat:o}=t||{},{price:r}=i||{};return Ye(r,n,o)},it=(e,t)=>{var n,i;return(null===(i=null===(n=null==e?void 0:e.translations)||void 0===n?void 0:n.find)||void 0===i?void 0:i.call(n,(e=>e.language===t)))||{}},ot=({product:e,variantId:t,quantity:n=1,selectedAddons:o,noVat:r=!1})=>{if(i(e))return{price:0,optionsPrice:0,total:0};const a=Object.assign(Object.assign({},e),{vat:r?0:e.vat}),d=((e,t={},n)=>((null==e?void 0:e.addons)||[]).filter((e=>Object.prototype.hasOwnProperty.call(t,e.id))).reduce(((e,n)=>{const{id:i,selectType:o}=n;if(o===$e.SINGLE){const o=t[i];return e+Ke(n,o)}return e+(t[i]||[]).reduce(((e,t)=>e+Ke(n,t)),0)}),0)*n)(a,o,n),l=t?nt(t,a,n):Je(a,n);return{price:l,optionsPrice:d,total:l+d}};var rt;!function(e){e.LIST="list",e.GRID="grid"}(rt||(rt={}));const at=(e,t="USD",n="en")=>{const{price:i,vat:o,quantity:a,optionsPrice:d}=e||{},l=Ye(i,a,o)+d*a;return{totalPrice:l,formattedTotalPrice:r(l,t,n)}},dt=(e,t,n)=>{if(!e)throw new Error("Product ID is required");let i=`${e}`;t&&(i+=`-${t}`);const o=Object.entries(n||{}).map((([e,t])=>{if(!e||!t)return null;const n=Array.isArray(t)?t.filter(Boolean).join("-"):`${t}`;return n?`${e}-${n}`:null})).filter(Boolean).join("-");return o&&(i+=`-${o}`),i},lt=d({cart:{},isCartOpen:!1,addProduct:()=>{},updateProduct:()=>{},setIsCartOpen:()=>{},removeAllProductVariants:()=>{}}),ct=({children:t})=>{const[n,o]=c({}),[r,a]=c(!1),d=({product:e,quantity:t,isAddOperation:n,variantId:r,selectedAddons:a})=>{if(i(e)||t<0)return;const{id:d,vat:l=0}=e,c=dt(d,r,a),{price:s,optionsPrice:u}=ot({product:e,variantId:r,quantity:1,selectedAddons:a,noVat:!0});o((e=>{const i=e[c],o=n?((null==i?void 0:i.quantity)||0)+t:t;if(o<=0){const t=e,n=c;t[n];return te(t,["symbol"==typeof n?n:n+""])}return Object.assign(Object.assign({},e),{[c]:{productId:d,price:s,optionsPrice:u,quantity:o,vat:l,variantId:r,selectedAddons:a}})}))},l=({product:e,quantity:t=1,variantId:n,selectedAddons:i})=>d({product:e,quantity:t,variantId:n,selectedAddons:i,isAddOperation:!0}),s=({product:e,quantity:t=1,variantId:n,selectedAddons:i})=>d({product:e,quantity:t,variantId:n,selectedAddons:i,isAddOperation:!1}),u=e=>{if(!e||i(n))return;const t=Object.entries(n).reduce(((t,[n,i])=>(i.productId!==e&&(t[n]=i),t)),{});o(t)},_=m((()=>({cart:n,isCartOpen:r,addProduct:l,updateProduct:s,setIsCartOpen:a,removeAllProductVariants:u})),[n,r]);return e(lt.Provider,{value:_,children:t})},st=()=>l(lt);var ut={container:"ProductsListItem-module_container__i9tFs",isClickable:"ProductsListItem-module_isClickable__iHHdI",info:"ProductsListItem-module_info__4s4j2",name:"ProductsListItem-module_name__T1gyJ",description:"ProductsListItem-module_description__oL4CH",price:"ProductsListItem-module_price__V1GRM",image:"ProductsListItem-module_image__h6Wbi",addToCart:"ProductsListItem-module_addToCart__WXrQZ",noImage:"ProductsListItem-module_noImage__G4E-a",flexWide:"ProductsListItem-module_flexWide__Ds6LE",slidein:"ProductsListItem-module_slidein__rEzMI",fadeInOut:"ProductsListItem-module_fadeInOut__i1FNq",heightAnimation:"ProductsListItem-module_heightAnimation__2fk7l",fadein:"ProductsListItem-module_fadein__tPTJ6",floatAnimation:"ProductsListItem-module_floatAnimation__vugAV",bottomSheet:"ProductsListItem-module_bottomSheet__-YAdd",slideRightToLeft:"ProductsListItem-module_slideRightToLeft__oXk26"};const mt=({product:n,currency:i,language:r,onClick:d})=>{var l,c;const{addProduct:s}=st(),{image160:u,volume:_}=n||{},{name:h,description:p}=m((()=>Ze(n,r)),[n,r]),{formattedTotalPrice:v}=m((()=>et(n,i,r)),[n,i,r]),f=(null===(l=null==n?void 0:n.variants)||void 0===l?void 0:l.length)>0,y=(null===(c=null==n?void 0:n.addons)||void 0===c?void 0:c.length)>0,I=!!u;return t("div",{className:a(ut,{container:!0,isClickable:!!d,noImage:!I}),onClick:d,children:[t(g,{justifyContent:"space-between",gap:0,children:[e("div",{className:ut.info,children:t(P,{gap:.25,children:[e("h3",{className:ut.name,children:h}),e("p",{className:ut.description,children:p}),t(g,{className:ut.price,gap:.5,fullWidth:!0,justifyContent:"space-between",children:[e("span",{children:v}),!!_&&e(S,{color:"muted",children:_})]})]})}),I&&e(qe,{src:de(u),alt:h||"menu",className:ut.image,loading:"lazy",width:160,height:90})]}),e("div",{className:ut.addToCart,children:e(w,{onClick:e=>{if(e.preventDefault(),e.stopPropagation(),(f||y)&&d)return d();s({product:n}),o(Pe,{name:h,quantity:1})},icon:$,type:N.DEFAULT})})]})};var _t={container:"ProductsGridItem-module_container__DU5KG",content:"ProductsGridItem-module_content__FXs0Y",isClickable:"ProductsGridItem-module_isClickable__8zhwt",info:"ProductsGridItem-module_info__HkBG-",data:"ProductsGridItem-module_data__Z-N1X",name:"ProductsGridItem-module_name__ZrIx3",description:"ProductsGridItem-module_description__-FQPA",price:"ProductsGridItem-module_price__BFu2H",imageContainer:"ProductsGridItem-module_imageContainer__eHS4Z",image:"ProductsGridItem-module_image__alZWL",addToCart:"ProductsGridItem-module_addToCart__gYVrI",noImage:"ProductsGridItem-module_noImage__78UHW",volume:"ProductsGridItem-module_volume__oxEAr",flexWide:"ProductsGridItem-module_flexWide__qcB5X",slidein:"ProductsGridItem-module_slidein__oKaVb",fadeInOut:"ProductsGridItem-module_fadeInOut__d2zot",heightAnimation:"ProductsGridItem-module_heightAnimation__zgbh9",fadein:"ProductsGridItem-module_fadein__Z067K",floatAnimation:"ProductsGridItem-module_floatAnimation__GXjP-",bottomSheet:"ProductsGridItem-module_bottomSheet__-zrFD",slideRightToLeft:"ProductsGridItem-module_slideRightToLeft__R7hv5"};const ht=({product:n,currency:i,language:r,onClick:d})=>{var l,c;const{addProduct:s}=st(),{volume:u,image580:_,image160:h,image1024:p}=n||{},v=_||p||h,{name:f,description:y}=m((()=>Ze(n,r)),[n,r]),{formattedTotalPrice:I}=m((()=>et(n,i,r)),[n,i,r]),A=(null===(l=null==n?void 0:n.variants)||void 0===l?void 0:l.length)>0,b=(null===(c=null==n?void 0:n.addons)||void 0===c?void 0:c.length)>0;return e("div",{className:_t.container,children:t("div",{className:a(_t,{content:!0,isClickable:!!d,noImage:!v}),onClick:d,children:[v&&e("div",{className:_t.imageContainer,children:e(qe,{src:de(v),alt:f||"menu",className:_t.image,loading:"lazy",width:580,height:326})}),e("div",{className:_t.info,children:e("div",{className:_t.data,children:t(P,{gap:.25,children:[e("h3",{className:_t.name,children:f}),e("p",{className:_t.description,children:y}),t(g,{className:_t.price,gap:.5,fullWidth:!0,justifyContent:"space-between",children:[e("span",{children:I}),!!u&&e(S,{color:"white",className:_t.volume,children:u})]})]})})}),e("div",{className:_t.addToCart,children:e(w,{onClick:e=>{if(e.preventDefault(),e.stopPropagation(),(A||b)&&d)return d();s({product:n}),o(Pe,{name:f,quantity:1})},icon:$,type:N.DEFAULT})})]})})};var gt={container:"ProductDetails-module_container__oa07j",content:"ProductDetails-module_content__Db3NC",image:"ProductDetails-module_image__BlMfl",details:"ProductDetails-module_details__zfnlt",name:"ProductDetails-module_name__ganLM",price:"ProductDetails-module_price__W34k9",volume:"ProductDetails-module_volume__RWG5s",description:"ProductDetails-module_description__HBufi",choices:"ProductDetails-module_choices__4tHaA",close:"ProductDetails-module_close__4cHZ3",addAction:"ProductDetails-module_addAction__o4T5R",actionTitle:"ProductDetails-module_actionTitle__NIJGW",flexWide:"ProductDetails-module_flexWide__w06FX",slidein:"ProductDetails-module_slidein__N8f4g",fadeInOut:"ProductDetails-module_fadeInOut__hYRtK",heightAnimation:"ProductDetails-module_heightAnimation__hLQyz",fadein:"ProductDetails-module_fadein__QN4mI",floatAnimation:"ProductDetails-module_floatAnimation__dTQbc",bottomSheet:"ProductDetails-module_bottomSheet__HO2S-",slideRightToLeft:"ProductDetails-module_slideRightToLeft__hbtJg"};const pt={en:{},az:{"View order":"Şifarişi göstər","Remove from order":"Sifarişdən sil","Update order":"Sifarişi yenilə","Add to order":"Sifarişə əlavə et","Your order":"Sifarişiniz",Subtotal:"Ümumi","Empty order":"Boş sifariş","You don't have any items in your order":"Sifarişinizdə heç bir məhsul yoxdur","Add items":"Məhsul əlavə et",Events:"Hərəkətlər","Scrolled to Category":"Kateqoriyaya sürüşdürdü","Category Selected":"Kateqoriya seçildi","Product Details":"Məhsul detalına baxıldı","Product Added to Cart":"Səbətə əlavə edildi","Product choices":"Seçimlər","In order":"Sifarişdə"},tr:{"View order":"Siparişi Görüntüle","Remove from order":"Siparişten Kaldır","Update order":"Siparişi Güncelle","Add to order":"Siparişe Ekle","Your order":"Siparişiniz","Empty order":"Boş sipariş","You don't have any items in your order":"Siparişinizde hiç bir ürün yok","Add items":"Ürün ekle",Subtotal:"Toplam",Events:"Olaylar","Product choices":"Seçenekler","In order":"Siparişte"},nl:{"View order":"Bestelling bekijken","Remove from order":"Uit bestelling verwijderen","Update order":"Bestelling bijwerken","Add to order":"Aan bestelling toevoegen","Your order":"Uw bestelling","Empty order":"Lege bestelling","You don't have any items in your order":"U heeft geen items in uw bestelling","Add items":"Items toevoegen",Subtotal:"Totaal",Events:"Gebeurtenissen","Product choices":"Productkeuzes","In order":"In bestelling"},et:{"View order":"Vaata tellimust","Remove from order":"Eemalda tellimusest","Update order":"Uuenda tellimust","Add to order":"Lisa tellimusele","Your order":"Teie tellimus","Empty order":"Tühi tellimus","You don't have any items in your order":"Teie tellimuses pole ühtegi eset","Add items":"Lisa esemeid",Subtotal:"Kokku",Events:"Sündmused","Product choices":"Tootevalikud","In order":"Tellimuses"},ru:{"View order":"Посмотреть заказ","Remove from order":"Удалить из заказа","Update order":"Обновить заказ","Add to order":"Добавить в заказ","Your order":"Ваш заказ","Empty order":"Пустой заказ","You don't have any items in your order":"В вашем заказе нет товаров","Add items":"Добавить товары",Subtotal:"Итого",Events:"События","Product choices":"Варианты товара","In order":"В заказе"}},vt=e=>{const{language:t}=pe(),n=e||t;return{t:e=>{var t;return(null===(t=pt[n])||void 0===t?void 0:t[e])||e}}},ft=()=>{const{cart:e}=st();return Object.values(e||{}).reduce(((e,t)=>e+t.quantity),0)};var yt={container:"Quantity-module_container__01ySb",quantityAction:"Quantity-module_quantityAction__wRV2F",quantityValue:"Quantity-module_quantityValue__BBpyw",isDisabled:"Quantity-module_isDisabled__crQCf",sm:"Quantity-module_sm__0Hgp2",md:"Quantity-module_md__hu7a8",lg:"Quantity-module_lg__GA4jn",flexWide:"Quantity-module_flexWide__R95Jw",slidein:"Quantity-module_slidein__5yeWf",fadeInOut:"Quantity-module_fadeInOut__cllco",heightAnimation:"Quantity-module_heightAnimation__dhOgA",fadein:"Quantity-module_fadein__Cof2o",floatAnimation:"Quantity-module_floatAnimation__DSqQr",bottomSheet:"Quantity-module_bottomSheet__5-5iY",slideRightToLeft:"Quantity-module_slideRightToLeft__cjDHk"};const It=({isDecreaseDisabled:n=!1,quantity:i=1,size:o="md",onIncrease:r,onDecrease:d})=>t(g,{className:a(yt,{container:!0},[yt[o]]),justifyContent:"space-between",gap:0,children:[e("div",{className:a(yt,{quantityAction:!0,isDisabled:n}),onClick:d,children:e(y,{icon:F})}),e("div",{className:yt.quantityValue,children:i}),e("div",{className:yt.quantityAction,onClick:r,children:e(y,{icon:$})})]});var Pt="ProductInCart-module_container__oSrwq",At="ProductInCart-module_title__Vnc4l";const bt=({productId:n,onModalClose:o})=>{const{setIsCartOpen:r,removeAllProductVariants:a}=st(),{t:d}=vt(),l=(e=>{const{cart:t}=st();return i(t)||!e?0:Object.values(t).filter((t=>t.productId===e)).reduce(((e,t)=>e+t.quantity),0)})(n);return l<=0?null:t(I,{className:Pt,fullWidth:!0,justifyContent:"space-between",alignItems:"center",children:[t(I.Item,{flex:1,className:At,children:[d("In order")," (",l,")"]}),e(I.Item,{flex:0,children:t(g,{children:[e(w,{icon:X,onClick:()=>{a(n)},type:N.DANGER,tooltip:d("Remove from order")}),e(w,{icon:K,onClick:()=>{r(!0),o&&o()},type:N.SUCCESS,tooltip:d("View order")})]})})]})};var Ct={container:"ProductVariants-module_container__r059N",variantsTitle:"ProductVariants-module_variantsTitle__G3wTr",variant:"ProductVariants-module_variant__Pk6eP",focused:"ProductVariants-module_focused__tdy2R",flexWide:"ProductVariants-module_flexWide__CQO0G",slidein:"ProductVariants-module_slidein__9xYoM",fadeInOut:"ProductVariants-module_fadeInOut__NcGdX",heightAnimation:"ProductVariants-module_heightAnimation__c7ORS",fadein:"ProductVariants-module_fadein__qqdC5",floatAnimation:"ProductVariants-module_floatAnimation__Fy-NX",bottomSheet:"ProductVariants-module_bottomSheet__JVxKH",slideRightToLeft:"ProductVariants-module_slideRightToLeft__lHsqZ"};const Nt=({product:n,selectedVariant:i,focusedSection:o,onSelectVariant:d})=>{const{language:l,currency:c}=pe(),{t:m}=vt(),_=s(null),{variants:h}=n||{},p="variant"===o;return u((()=>{p&&_.current&&_.current.scrollIntoView({behavior:"smooth"})}),[o]),t(P,{className:a(Ct,{container:!0,focused:p}),gap:1,fullWidth:!0,children:[e("div",{className:Ct.variantsTitle,ref:_,children:m("Product choices")}),(h||[]).map((o=>{const{id:a}=o||{},{formattedTotalPrice:s}=(({variantId:e,currency:t="USD",language:n="en",product:i,quantity:o=1})=>{const a=nt(e,i,o);return{totalPrice:a,formattedTotalPrice:r(a,t,n)}})({variantId:a,language:l,currency:c,product:n}),{title:u}=it(o,l);return t(g,{justifyContent:"space-between",onClick:()=>d(a),className:Ct.variant,children:[e(k,{label:u,name:"variant",onChange:()=>d(a),checked:i===a,type:L.RADIO,size:"small"}),e("div",{className:Ct.variantPrice,children:s})]},a)}))]})};var St={container:"ProductAddons-module_container__DRnT7",focused:"ProductAddons-module_focused__KplXf",optionsTitle:"ProductAddons-module_optionsTitle__dE0ee",flexWide:"ProductAddons-module_flexWide__kxcTh",slidein:"ProductAddons-module_slidein__C5osk",fadeInOut:"ProductAddons-module_fadeInOut__Wtu5Z",heightAnimation:"ProductAddons-module_heightAnimation__sA75y",fadein:"ProductAddons-module_fadein__ErDv9",floatAnimation:"ProductAddons-module_floatAnimation__crBUu",bottomSheet:"ProductAddons-module_bottomSheet__Irr5y",slideRightToLeft:"ProductAddons-module_slideRightToLeft__Q-PfS"};const wt=({product:n,selectedAddons:i,onOptionSelect:o})=>{const{language:a,currency:d}=pe(),{addons:l}=n||{};return e(P,{className:St.container,gap:1.5,fullWidth:!0,children:(l||[]).map((n=>{const{id:l,options:c,selectType:s}=n||{},{title:u}=Fe(n,a);return t(P,{children:[e(S,{variant:"bold",children:u}),e(P,{gap:1,fullWidth:!0,children:(c||[]).map((n=>{const{id:c}=n||{},{formattedTotalPrice:u}=(({option:e,currency:t="USD",language:n="en"})=>{const{price:i}=e||{};return{totalPrice:i,formattedTotalPrice:r(i,t,n)}})({option:n,language:a,currency:d}),{title:m}=Xe(n,a),_=s===$e.SINGLE,h=_?i[l]===c:(i[l]||[]).includes(c);return t(g,{justifyContent:"space-between",className:St.option,children:[e(k,{label:m,name:`option-${l}`,onChange:()=>o({addonId:l,optionId:c,isSingle:_,isRemove:!_&&h}),checked:h,type:_?L.RADIO:L.CHECKBOX,size:"small"}),e("div",{className:St.optionPrice,children:u})]},c)}))})]},l)}))})},kt=({product:n,onClose:a})=>{const{language:d,currency:l}=pe(),{addProduct:_,updateProduct:h}=st(),[p,v]=c(1),[f,y]=c(!1),[I,A]=c(null),[b,C]=c(null),[N,S]=c({}),k=s(null),{t:L}=vt(),D=(({productId:e,variantId:t,selectedAddons:n})=>{var o;const{cart:r}=st();return i(r)||!e?0:(null===(o=r[dt(e,t,n)])||void 0===o?void 0:o.quantity)||0})({productId:null==n?void 0:n.id,variantId:I,selectedAddons:N}),{name:R,description:j}=m((()=>Ze(n,d)),[n,d]),{formattedTotalPrice:G}=m((()=>et(n,l,d)),[n,l,d]),{formattedTotalPrice:x}=m((()=>(({product:e,variantId:t,quantity:n=1,currency:i,language:o,selectedAddons:a,noVat:d=!1})=>{const{total:l}=ot({product:e,variantId:t,quantity:n,selectedAddons:a,noVat:d});return{totalPrice:l,formattedTotalPrice:r(l,i,o)}})({product:n,quantity:p,language:d,currency:l,variantId:I,selectedAddons:N})),[n,p,d,l,I,N]),q=f?0===p:1===p,E=m((()=>L(f?0===p?"Remove from order":"Update order":"Add to order")),[f,p]);u((()=>{v(D>0?D:1),y(D>0)}),[D,n]),u((()=>{A(null),S({})}),[n]);const V=e=>{-1===e&&q||v((t=>Math.max(0,t+e)))};if(i(n))return null;const{image1024:W,volume:z,variants:H,addons:Q}=n,B=(null==H?void 0:H.length)>0,U=(null==Q?void 0:Q.length)>0;return e("div",{className:gt.container,onClick:e=>{var t,n;(null===(n=null===(t=null==k?void 0:k.current)||void 0===t?void 0:t.contains)||void 0===n?void 0:n.call(t,null==e?void 0:e.target))||a&&a()},children:e(T,{onClose:a,ref:k,noBodyPadding:!0,size:"small",content:t("div",{className:gt.content,children:[t(P,{gap:0,children:[W&&e(qe,{src:de(W),width:1024,height:400,alt:R||"product",className:gt.image}),t(P,{className:gt.details,gap:1,children:[e("h2",{className:gt.name,children:R}),t(g,{justifyContent:"space-between",children:[e("div",{className:gt.price,children:G}),e("div",{className:gt.volume,children:z})]}),e("div",{className:gt.description,children:j})]}),(B||U)&&t(P,{gap:0,className:gt.choices,children:[B&&e(Nt,{product:n,selectedVariant:I,focusedSection:b,onSelectVariant:A}),U&&e(wt,{product:n,selectedAddons:N,onOptionSelect:({addonId:e,optionId:t,isSingle:n,isRemove:i=!1})=>{S((o=>{if(n)return Object.assign(Object.assign({},o),{[e]:t});const r=o[e]||[],a=i?r.filter((e=>e!==t)):[...new Set([...r,t])];return Object.assign(Object.assign({},o),{[e]:a})}))}})]})]}),e("div",{className:gt.close,children:e(w,{onClick:a,icon:Z})})]}),footer:t(P,{children:[e(bt,{productId:null==n?void 0:n.id,onModalClose:a}),t(g,{className:gt.addToCart,gap:.5,children:[e(It,{isDecreaseDisabled:q,onDecrease:()=>V(-1),onIncrease:()=>V(1),quantity:p}),e(O,{className:gt.addAction,label:t(g,{fullWidth:!0,justifyContent:"space-between",children:[e("span",{className:gt.actionTitle,children:E}),e("span",{children:x})]}),onClick:()=>{var e;if((null===(e=null==n?void 0:n.variants)||void 0===e?void 0:e.length)>0&&!I)return C("variant"),void setTimeout((()=>{C(null)}),200);f?h({product:n,quantity:p,variantId:I,selectedAddons:N}):(_({product:n,quantity:p,variantId:I,selectedAddons:N}),o(Pe,{name:R,quantity:p})),a&&a()},size:"xl",fullWidth:!0})]})]})})})};var Lt="Cart-module_container__3KQtx",Tt="Cart-module_content__rkiZa",Ot={container:"CartStepper-module_container__4CF1L",count:"CartStepper-module_count__E-RBg",actionText:"CartStepper-module_actionText__-rVKA",totalPrice:"CartStepper-module_totalPrice__QboRN",isClickable:"CartStepper-module_isClickable__mDptU",flexWide:"CartStepper-module_flexWide__eXxCr",slidein:"CartStepper-module_slidein__d5JQ-",fadeInOut:"CartStepper-module_fadeInOut__pS8nn",heightAnimation:"CartStepper-module_heightAnimation__7-e5Z",fadein:"CartStepper-module_fadein__-Ba0-",floatAnimation:"CartStepper-module_floatAnimation__rq6zX",bottomSheet:"CartStepper-module_bottomSheet__1wHHD",slideRightToLeft:"CartStepper-module_slideRightToLeft__0KLAo"};const Dt=({actionText:n,onClick:i})=>{const o=ft(),{formattedTotalPrice:d}=(()=>{const{cart:e}=st(),{currency:t,language:n}=pe(),i=Object.values(e||{}).reduce(((e,t)=>{const{totalPrice:n}=at(t);return e+n}),0);return{totalPrice:i,formattedTotalPrice:r(i,t,n)}})();return t(I,{className:a(Ot,{container:!0,isClickable:!!i}),justifyContent:"space-between",alignItems:"center",onClick:i,children:[e(I.Item,{flex:1,children:t(g,{alignItems:"center",children:[e("div",{className:Ot.count,children:o}),e("div",{className:Ot.actionText,children:n})]})}),e(I.Item,{className:Ot.totalPrice,flex:1,children:d})]})},Rt=()=>{const{setIsCartOpen:t}=st(),{t:n}=vt();return ft()<=0?null:e("div",{className:Lt,children:e("div",{className:Tt,children:e(Dt,{onClick:()=>t(!0),actionText:n("View order")})})})};var jt={container:"CartDrawer-module_container__zvapw",content:"CartDrawer-module_content__ELSiG",flexWide:"CartDrawer-module_flexWide__ySgY-",slidein:"CartDrawer-module_slidein__XC9AW",fadeInOut:"CartDrawer-module_fadeInOut__w9h6X",heightAnimation:"CartDrawer-module_heightAnimation__tBgkj",fadein:"CartDrawer-module_fadein__QNPoQ",floatAnimation:"CartDrawer-module_floatAnimation__nZWoY",bottomSheet:"CartDrawer-module_bottomSheet__m0wy7",slideRightToLeft:"CartDrawer-module_slideRightToLeft__gpixh"},Gt="CartItem-module_container__At7lj",xt="CartItem-module_image__D-zzG",qt="CartItem-module_data__Lo3Fb",Et="CartItem-module_name__EksZu",Vt="CartItem-module_price__yJxl6";const Wt=e=>{var t;const{products:n}=pe();return(null===(t=null==n?void 0:n.find)||void 0===t?void 0:t.call(n,(({id:t})=>t===e)))||{}},zt=({productId:t,variantId:n,min:i=1,size:o="md",selectedAddons:r})=>{const a=(({productId:e,variantId:t,selectedAddons:n})=>{const{cart:i}=st(),o=i[dt(e,t,n)];return(null==o?void 0:o.quantity)||1})({productId:t,variantId:n,selectedAddons:r}),d=Wt(t),{updateProduct:l}=st();return e(It,{isDecreaseDisabled:a===i,onDecrease:()=>l({product:d,quantity:a-1,variantId:n,selectedAddons:r}),onIncrease:()=>l({product:d,quantity:a+1,variantId:n,selectedAddons:r}),quantity:a,size:o})},Ht=({item:o,product:r,language:a})=>{const{selectedAddons:d}=o||{};return e(n,{children:Object.entries(d||{}).map((([e,n])=>{const o=((e,t)=>((null==e?void 0:e.addons)||[]).find((({id:e})=>e===t))||{})(r,Number(e));if(i(o)||i(o.options)||!Array.isArray(o.options))return null;let d="";if(Array.isArray(n)){const e=o.options.filter((({id:e})=>n.includes(e)));if(i(e))return null;d=e.map((e=>{const{title:t}=Xe(e,a);return t})).filter(Boolean).join(", ")}else{const e=o.options.find((({id:e})=>e===n));if(i(e))return null;const{title:t}=Xe(e,a);d=t}const{title:l}=Fe(o,a);return t(S,{color:"muted",variant:"small",children:[l,": ",d]},e)})).filter(Boolean)})},Qt=({item:n})=>{const{productId:i,variantId:o,selectedAddons:r}=n||{},a=Wt(i),d=tt(a,o),{language:l,currency:c}=pe(),{image160:s}=a,{title:u}=it(d,l),{name:_}=m((()=>Ze(a,l)),[a,l]),{formattedTotalPrice:h}=m((()=>at(n,c,l)),[n,c,l]);return t(g,{className:Gt,gap:1,alignItems:"flex-start",children:[s&&e(qe,{src:de(s),alt:_||"menu",className:xt,loading:"lazy",width:80,height:45}),t("div",{className:qt,children:[e("div",{className:Et,children:_}),t(P,{gap:0,children:[!!u&&e(S,{color:"muted",variant:"small",children:u}),e(Ht,{item:n,product:a,language:l})]}),e("div",{className:Vt,children:h})]}),e(zt,{productId:i,variantId:o,selectedAddons:r,size:"sm",min:0})]})},Bt=()=>{const{isCartOpen:n,cart:o,setIsCartOpen:r}=st(),a=s(null),{t:d}=vt(),l=i(o),c=()=>r(!1);return n?e("div",{className:jt.container,onClick:e=>{var t,n;(null===(n=null===(t=null==a?void 0:a.current)||void 0===t?void 0:t.contains)||void 0===n?void 0:n.call(t,null==e?void 0:e.target))||c()},children:e(D,{ref:a,onClose:c,isOpen:n,title:d("Your order"),content:e("div",{className:jt.content,children:l?e((()=>t(P,{className:jt.noItems,fullWidth:!0,fullHeight:!0,alignItems:"center",justifyContent:"center",gap:0,children:[e(S,{variant:"h2",children:d("Empty order")}),e(R,{text:d("You don't have any items in your order")})]})),{}):e("div",{className:jt.items,children:Object.keys(o||{}).map((t=>e(Qt,{item:o[t]},t)))})}),footer:l?e(O,{label:d("Add items"),onClick:c,type:N.PRIMARY,size:"xl",fullWidth:!0}):e(Dt,{actionText:d("Subtotal")})})}):null},Ut=_((({categoryProductMap:n=[],currency:i,language:r,productBlocksRef:a,containerRef:d,onCategoryInView:l})=>{const[s,m]=c(null),[_,h]=c(rt.LIST),p=[{icon:J,type:rt.LIST},{icon:ee,type:rt.GRID}],v=e=>{const{name:t}=Ze(e,r);o(Ie,{name:t}),m(e)};return u((()=>{const e=new IntersectionObserver((e=>{var t;const n=((null===(t=null==d?void 0:d.current)||void 0===t?void 0:t.clientHeight)||1e3)/2;let i=null,o=1/0;e.forEach((e=>{if(e.isIntersecting){const t=e.boundingClientRect,r=t.top+t.height/2,a=Math.abs(r-n);a<o&&(o=a,i=e.target.getAttribute("data-category-id"))}})),i&&l(Number(i))}),{threshold:.1});return Object.entries(a.current||{}).forEach((([t,n])=>{n&&(n.setAttribute("data-category-id",t),e.observe(n))})),()=>{e.disconnect()}}),[a,d]),e(ct,{children:t("div",{className:He,children:[e(g,{className:Qe,alignItems:"center",children:p.map((({icon:t,type:n})=>e(w,{icon:t,onClick:()=>(e=>{h(e),o(Ae,{name:e})})(n),type:n===_?N.PRIMARY:N.DEFAULT},n)))}),e(P,{children:(n||[]).map((n=>{const{name:o}=Ce(n,r),{id:d,products:l}=n;return t("div",{className:Be,ref:e=>{e&&(a.current[d]=e)},"data-category-id":d,children:[e("h2",{className:Ue,children:o}),e("div",{className:Me,children:e(P,{gap:0,children:(l||[]).map((t=>_===rt.GRID?e(ht,{product:t,currency:i,language:r,onClick:()=>v(t)},t.id):e(mt,{product:t,currency:i,language:r,onClick:()=>v(t)},t.id)))})})]},d)}))}),e(kt,{product:s,onClose:()=>m(null)}),e(Rt,{}),e(Bt,{})]})})}),((e,t)=>e.categoryProductMap===t.categoryProductMap&&e.currency===t.currency&&e.language===t.language));Ut.displayName="Products";var Mt="Branches-module_branches__sOuoV",Yt="Branches-module_list__vYoT2",$t="Branches-module_name__K0Z-4";const Ft=({branches:t=[],rootPath:n="",onBranchSelect:i})=>{const o=({children:t,id:o})=>i?e("div",{onClick:()=>i(o),children:t}):e("a",{href:`${n}/${o}`,children:t});return e("div",{className:Mt,children:e(j,{className:Yt,children:t.map((({id:t,name:n})=>e(o,{id:t,children:e(G,{noBottomMargin:!0,children:e(I,{justifyContent:"center",alignItems:"center",fullHeight:!0,children:e("h2",{className:$t,children:n})})})},t)))})})},Xt=({data:r})=>{var a;const{name:d,coverImage:l,logoImage:u,branches:m=[],branchId:_,language:h,categories:g,products:p,currency:v,instagram:f,facebook:y,whatsapp:I,telegram:P,tiktok:A,rootPath:b,hostname:C,onBranchSelect:N}=r||{},S=m.length<=1,w=((e,t)=>{const n=t.reduce(((e,t)=>{const n=Number(t.categoryId);return e[n]||(e[n]=[]),e[n].push(t),e}),{});return e.map((e=>Object.assign(Object.assign({},e),{products:n[Number(e.id)]||[]}))).filter((e=>{var t;return(null===(t=null==e?void 0:e.products)||void 0===t?void 0:t.length)>0}))})(g,p),k=(()=>{var e;return S?(null===(e=null==m?void 0:m[0])||void 0===e?void 0:e.id)?m[0]:{}:m.find((e=>e.id===Number(_)))})(),L=S||!(null==k?void 0:k.name)?d:(null==k?void 0:k.name)||"",[T,O]=c(null===(a=null==g?void 0:g[0])||void 0===a?void 0:a.id),D=s({}),R=s(null),j=s(!0),{url:G,domain:x}=((e,t)=>{const n=_e.includes(e)?e:me;return{url:`https://${n}/${t||"en"}`,domain:n}})(C,h);return t("div",{className:ie,ref:R,children:[e(We,{branch:k,name:L,coverImage:ce(l),logoImage:le(u),instagram:f,facebook:y,whatsapp:I,telegram:P,tiktok:A}),S||_?t(n,{children:[e(ze,{categoryProductMap:w,language:h,selectedCategoryId:T,onSelectCategory:e=>ne(void 0,void 0,void 0,(function*(){j.current=!1,O(e),(e=>{var t;const n=null===(t=null==D?void 0:D.current)||void 0===t?void 0:t[e];n&&(setTimeout((()=>{n.scrollIntoView({behavior:"smooth",block:"start"})}),100),setTimeout((()=>{j.current=!0}),1e3))})(e)}))}),e(Ut,{currency:v,language:h,productBlocksRef:D,containerRef:R,categoryProductMap:w,onCategoryInView:e=>{if(!(null==j?void 0:j.current))return;const t=((e,t,n)=>{var o;const r=null===(o=null==t?void 0:t.find)||void 0===o?void 0:o.call(t,(({id:t})=>t===e));if(i(r))return"";const{name:a}=Ce(r,n);return a})(e,g,h);o(ye,{name:t}),O(e)}})]}):e(Ft,{branches:m,onBranchSelect:N,rootPath:b}),!!C&&e("a",{rel:"noopener noreferrer",target:"_blank",href:G,className:re,children:x})]})},Kt=({data:t})=>e(ge,{value:t,children:e(Xt,{data:t})});var Zt={};const Jt=({currentGoal:t,language:n,setGoal:i})=>{const{t:o}=vt(n),r=s({}),a=e=>{switch(e){case ye:return o("Scrolled to Category");case fe:return o("Category Selected");case Ie:return o("Product Details");case Pe:return o("Product Added to Cart");default:return""}},d=h((e=>{var t,n;i(e),null===(n=null===(t=null==r?void 0:r.current)||void 0===t?void 0:t.close)||void 0===n||n.call(t)}),[i]);return e(x,{action:a(t),actionSize:"large",type:N.BORDERED_PRIMARY,closeRef:r,menu:e("div",{className:Zt.toolbarMenu,children:be.map((t=>e(q,{onClick:()=>d(t),children:a(t)},t)))})})},en=({data:t,isLoading:n=!1,loadingImage:i,language:o,goal:r,setGoal:a})=>{const{t:d}=vt(o);return e(G,{title:d("Events"),toolbar:e(Jt,{language:o,currentGoal:r,setGoal:a}),children:n?e(E,{image:i}):e(V,{data:t})})};export{en as Events,Kt as PublicMenu};
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{isEmpty as r,trackEvent as i,priceFormatter as a,classNames as o}from"@sorocraft/js-utils";import{createContext as l,useContext as d,useState as c,useRef as s,useEffect as u,useMemo as m,memo as _,useCallback as h}from"react";import{Row as g,classNames as p,IconLink as v,Tooltip as f,SVGIcon as y,Column as I,Flex as P,Carousel as b,CarouselItem as A,Chip as C,UIElementType as N,Text as S,IconButton as k,Input as w,InputType as L,Modal as T,Button as O,Drawer as D,Description as R,Container as j,Card as G,DropDown as q,DropDownMenuItem as V,Loading as E,BarChart as x}from"@sorocraft/ui";import{Phone as z,Whatsapp as W,Instagram as H,Telegram as B,Tiktok as U,Facebook as Q,Wifi as M,MarkerPin as $,Plus as Y,Minus as F,Trash as K,ShoppingBag as X,Close as Z,List as J,Grid as ee}from"@sorocraft/ui/icons";function te(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 i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function ne(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{d(r.next(e))}catch(e){a(e)}}function l(e){try{d(r.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,l)}d((r=r.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;var re="PublicMenu-module_container__QLN6U",ie="PublicMenu-module_categories__Iy6NC",ae="PublicMenu-module_footer__6G3DQ";const oe="https://images.restaround.co",le=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${oe}/${e}`:"",de=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${oe}/${e}`:"https://images.restaround.co/no-photo-128.webp",ce=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${oe}/${e}`:"https://images.restaround.co/restaround-doodle.webp",se="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",ue=(e,t,n)=>se.charAt(e>>2)+se.charAt((3&e)<<4|t>>4)+se.charAt((15&t)<<2|n>>6)+se.charAt(63&n),me="restaround.co",_e=[me,"restaround.az","restaround.ee","restaround.nl"],he=l({}),ge=({children:t,value:n})=>{const i=r(n)?{}:n;return i.currency||(i.currency="AZN"),i.language||(i.language="az"),e(he.Provider,{value:r(n)?{}:n,children:t})},pe=()=>d(he),ve="digital_menu",fe=`${ve}_category_select`,ye=`${ve}_category_scroll`,Ie=`${ve}_product_details`,Pe=`${ve}_product_add_cart`,be=`${ve}_product_view_changed`,Ae=[fe,ye,Ie,Pe],Ce=(e,t)=>{var n,r;return(null===(r=null===(n=null==e?void 0:e.translations)||void 0===n?void 0:n.find)||void 0===r?void 0:r.call(n,(e=>e.language===t)))||{}};var Ne="Header-module_container__tenlF",Se="Header-module_cover__BAWZK",ke="Header-module_content__Gx4Al",we="Header-module_logo__4MTCm",Le="Header-module_info__IchYA",Te="Header-module_name__30wyw",Oe="Header-module_address__WOxXc",De="Header-module_addressText__lUszI",Re="Header-module_social__AoP0z",je="Header-module_links__EeQxg",Ge="Header-module_wifiPassword__VWBTa",qe="Header-module_wifiPasswordIcon__Ukn3D";const Ve=t=>{const{priority:n,blurDataURL:r,quality:i,placeholder:a,fetchPriority:o}=t,l=te(t,["priority","blurDataURL","quality","placeholder","fetchPriority"]),{imageTag:d}=pe()||{};if(d){return e(d,Object.assign({},t,{quality:t.quality||100,placeholder:"blur",blurDataURL:(c=235,s=59,u=90,`data:image/gif;base64,R0lGODlhAQABAPAA${ue(0,c,s)+ue(u,255,255)}/yH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==`)}))}var c,s,u;return e("img",Object.assign({},l))};var Ee={container:"Languages-module_container__nJeK1",currentLanguage:"Languages-module_currentLanguage__EFw6Q",options:"Languages-module_options__6jLRm",option:"Languages-module_option__QkVQd",isOpen:"Languages-module_isOpen__eUGbg",flexWide:"Languages-module_flexWide__zQ9jN",slidein:"Languages-module_slidein__C4UHU",fadeInOut:"Languages-module_fadeInOut__U-vhH",heightAnimation:"Languages-module_heightAnimation__gIQkF",fadein:"Languages-module_fadein__vPmsX",floatAnimation:"Languages-module_floatAnimation__L-kPH",bottomSheet:"Languages-module_bottomSheet__-t-q8",slideRightToLeft:"Languages-module_slideRightToLeft__y0l-f"};const xe=()=>{var n;const{language:r,languages:i,onLanguageSelect:a}=pe(),[o,l]=c(!1),d=(null==i?void 0:i.length)>1,s=(null===(n=null==i?void 0:i.filter)||void 0===n?void 0:n.call(i,(({code:e})=>e!==r)))||[],u=e=>`https://images.restaround.co/languages/${e}.svg`;return d?e("div",{className:Ee.container,onClick:()=>l(!o),children:t(g,{alignItems:"center",gap:0,children:[e(g,{alignItems:"center",className:p(Ee,{options:!0,isOpen:o}),children:s.map((({code:t})=>e("img",{src:u(t),className:Ee.option,onClick:()=>(e=>{a&&a(e)})(t),alt:t},t)))}),e("img",{src:u(r),alt:r||"",className:Ee.currentLanguage})]})}):null},ze=({branch:n,coverImage:i,logoImage:a,name:o,instagram:l,facebook:d,whatsapp:c,telegram:s,tiktok:u})=>{const{address:m,latitude:_,longitude:h,phone:p,wifiPassword:b}=n||{},A=r(n),C=`https://www.google.com/maps/place/${_},${h}`;return t("div",{className:Ne,children:[e(Ve,{src:i,alt:o,className:Se,width:1024,height:400,priority:!0,sizes:"100vw",fetchPriority:"high",loading:"eager"}),e("div",{className:ke,children:e(A?()=>t(I,{fullWidth:!0,fullHeight:!0,alignItems:"center",justifyContent:"center",children:[e(Ve,{src:a,alt:o,className:we,width:96,height:96}),e("div",{className:Le,children:e("h1",{className:Te,children:o})})]}):()=>t(P,{direction:"row",gap:1,alignItems:"center",fullWidth:!0,children:[e(P.Item,{children:e(Ve,{src:a,alt:o,className:we,width:96,height:96})}),e(P.Item,{shrink:!0,className:Le,children:t(I,{gap:.25,children:[e("h1",{className:Te,children:o}),e("a",{className:Oe,href:C,target:"_blank",rel:"noopener noreferrer",children:t(g,{alignItems:"center",gap:.5,children:[e(y,{icon:$,theme:"dark"}),e("span",{className:De,children:m})]})})]})})]}),{})}),e(xe,{}),!A&&e("div",{className:Re,children:e("div",{className:je,children:e(g,{gap:2,alignItems:"center",children:t(g,{alignItems:"center",justifyContent:"center",gap:.5,children:[!!p&&e(v,{icon:z,href:`tel:+${p}`,size:"sm",shape:"circle",theme:"light"}),!!c&&e(v,{icon:W,href:`https://wa.me/${c}`,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!l&&e(v,{icon:H,href:l,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!s&&e(v,{icon:B,href:s,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!u&&e(v,{icon:U,href:u,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!d&&e(v,{icon:Q,href:d,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!b&&e(f,{hint:b,children:e("div",{className:Ge,children:e(y,{icon:M,size:"sm",className:qe})})})]})})})})]})},We=({categoryProductMap:t=[],language:n,selectedCategoryId:r,onSelectCategory:a})=>{const o=s({}),l=s(null);return u((()=>{r&&(()=>{var e;const t=null===(e=null==o?void 0:o.current)||void 0===e?void 0:e[r];if(!t||!l.current)return;const n=l.current.clientWidth,i=t.offsetLeft-n/2+t.offsetWidth/2;l.current.scrollTo({left:i,behavior:"smooth"})})()}),[r]),e("div",{className:ie,children:e(b,{gap:1,onGetRef:e=>{(null==e?void 0:e.current)&&(l.current=e.current)},children:(t||[]).map((({id:t,translations:l})=>{const{name:d}=l.find((e=>e.language===n))||{};return e(A,{children:e(C,{onClick:()=>((e,t)=>{e!==r&&(i(fe,{name:t}),a(e))})(t,d),type:N.BORDERED_PRIMARY,active:t===r,children:e("div",{ref:e=>{e&&(o.current[t]=e)},children:d})})},t)}))})})};var He="Products-module_container__bF2LF",Be="Products-module_view__l857X",Ue="Products-module_products__AoDrY",Qe="Products-module_category__Sp7dE",Me="Products-module_list__LH4v5";const $e=(e=0,t=1,n=0)=>e*t*(1+n/100);var Ye;!function(e){e.SINGLE="SINGLE",e.MULTIPLE="MULTIPLE"}(Ye||(Ye={}));const Fe=(e,t)=>{var n,r;return(null===(r=null===(n=null==e?void 0:e.translations)||void 0===n?void 0:n.find)||void 0===r?void 0:r.call(n,(e=>e.language===t)))||{}},Ke=(e,t)=>{var n,r;return(null===(r=null===(n=null==e?void 0:e.translations)||void 0===n?void 0:n.find)||void 0===r?void 0:r.call(n,(e=>e.language===t)))||{}},Xe=(e,t)=>{var n;return(null===(n=((null==e?void 0:e.options)||[]).find((({id:e})=>e===t)))||void 0===n?void 0:n.price)||0},Ze=(e,t)=>{var n,r;return(null===(r=null===(n=null==e?void 0:e.translations)||void 0===n?void 0:n.find)||void 0===r?void 0:r.call(n,(e=>e.language===t)))||{}},Je=(e,t=1)=>{const{price:n=0,vat:r=0}=e||{};return $e(n,t,r)},et=(e,t,n,r=1)=>{const i=Je(e,r);return{totalPrice:i,formattedTotalPrice:a(i,t,n)}},tt=(e,t)=>{var n,r;return(null===(r=null===(n=null==e?void 0:e.variants)||void 0===n?void 0:n.find)||void 0===r?void 0:r.call(n,(e=>e.id===t)))||{}},nt=(e,t,n)=>{const r=tt(t,e),{vat:i}=t||{},{price:a}=r||{};return $e(a,n,i)},rt=(e,t)=>{var n,r;return(null===(r=null===(n=null==e?void 0:e.translations)||void 0===n?void 0:n.find)||void 0===r?void 0:r.call(n,(e=>e.language===t)))||{}},it=({product:e,variantId:t,quantity:n=1,selectedAddons:i,noVat:a=!1})=>{if(r(e))return{price:0,optionsPrice:0,total:0};const o=Object.assign(Object.assign({},e),{vat:a?0:e.vat}),l=((e,t={},n)=>((null==e?void 0:e.addons)||[]).filter((e=>Object.prototype.hasOwnProperty.call(t,e.id))).reduce(((e,n)=>{const{id:r,selectType:i}=n;if(i===Ye.SINGLE){const i=t[r];return e+Xe(n,i)}return e+(t[r]||[]).reduce(((e,t)=>e+Xe(n,t)),0)}),0)*n)(o,i,n),d=t?nt(t,o,n):Je(o,n);return{price:d,optionsPrice:l,total:d+l}};var at;!function(e){e.LIST="list",e.GRID="grid"}(at||(at={}));const ot=(e,t="USD",n="en")=>{const{price:r,vat:i,quantity:o,optionsPrice:l}=e||{},d=$e(r,o,i)+l*o;return{totalPrice:d,formattedTotalPrice:a(d,t,n)}},lt=(e,t,n)=>{if(!e)throw new Error("Product ID is required");let r=`${e}`;t&&(r+=`-${t}`);const i=Object.entries(n||{}).map((([e,t])=>{if(!e||!t)return null;const n=Array.isArray(t)?t.filter(Boolean).join("-"):`${t}`;return n?`${e}-${n}`:null})).filter(Boolean).join("-");return i&&(r+=`-${i}`),r},dt=l({cart:{},isCartOpen:!1,addProduct:()=>{},updateProduct:()=>{},setIsCartOpen:()=>{},removeAllProductVariants:()=>{}}),ct=({children:t})=>{const[n,i]=c({}),[a,o]=c(!1),l=({product:e,quantity:t,isAddOperation:n,variantId:a,selectedAddons:o})=>{if(r(e)||t<0)return;const{id:l,vat:d=0}=e,c=lt(l,a,o),{price:s,optionsPrice:u}=it({product:e,variantId:a,quantity:1,selectedAddons:o,noVat:!0});i((e=>{const r=e[c],i=n?((null==r?void 0:r.quantity)||0)+t:t;if(i<=0){const t=e,n=c;t[n];return te(t,["symbol"==typeof n?n:n+""])}return Object.assign(Object.assign({},e),{[c]:{productId:l,price:s,optionsPrice:u,quantity:i,vat:d,variantId:a,selectedAddons:o}})}))},d=({product:e,quantity:t=1,variantId:n,selectedAddons:r})=>l({product:e,quantity:t,variantId:n,selectedAddons:r,isAddOperation:!0}),s=({product:e,quantity:t=1,variantId:n,selectedAddons:r})=>l({product:e,quantity:t,variantId:n,selectedAddons:r,isAddOperation:!1}),u=e=>{if(!e||r(n))return;const t=Object.entries(n).reduce(((t,[n,r])=>(r.productId!==e&&(t[n]=r),t)),{});i(t)},_=m((()=>({cart:n,isCartOpen:a,addProduct:d,updateProduct:s,setIsCartOpen:o,removeAllProductVariants:u})),[n,a]);return e(dt.Provider,{value:_,children:t})},st=()=>d(dt);var ut={container:"ProductsListItem-module_container__i9tFs",isClickable:"ProductsListItem-module_isClickable__iHHdI",info:"ProductsListItem-module_info__4s4j2",name:"ProductsListItem-module_name__T1gyJ",description:"ProductsListItem-module_description__oL4CH",price:"ProductsListItem-module_price__V1GRM",image:"ProductsListItem-module_image__h6Wbi",addToCart:"ProductsListItem-module_addToCart__WXrQZ",noImage:"ProductsListItem-module_noImage__G4E-a",flexWide:"ProductsListItem-module_flexWide__Ds6LE",slidein:"ProductsListItem-module_slidein__rEzMI",fadeInOut:"ProductsListItem-module_fadeInOut__i1FNq",heightAnimation:"ProductsListItem-module_heightAnimation__2fk7l",fadein:"ProductsListItem-module_fadein__tPTJ6",floatAnimation:"ProductsListItem-module_floatAnimation__vugAV",bottomSheet:"ProductsListItem-module_bottomSheet__-YAdd",slideRightToLeft:"ProductsListItem-module_slideRightToLeft__oXk26"};const mt=({product:n,currency:r,language:a,onClick:l})=>{var d,c;const{addProduct:s}=st(),{image160:u,volume:_}=n||{},{name:h,description:p}=m((()=>Ze(n,a)),[n,a]),{formattedTotalPrice:v}=m((()=>et(n,r,a)),[n,r,a]),f=(null===(d=null==n?void 0:n.variants)||void 0===d?void 0:d.length)>0,y=(null===(c=null==n?void 0:n.addons)||void 0===c?void 0:c.length)>0,P=!!u;return t("div",{className:o(ut,{container:!0,isClickable:!!l,noImage:!P}),onClick:l,children:[t(g,{justifyContent:"space-between",gap:0,children:[e("div",{className:ut.info,children:t(I,{gap:.25,children:[e("h3",{className:ut.name,children:h}),e("p",{className:ut.description,children:p}),t(g,{className:ut.price,gap:.5,fullWidth:!0,justifyContent:"space-between",children:[e("span",{children:v}),!!_&&e(S,{color:"muted",children:_})]})]})}),P&&e(Ve,{src:le(u),alt:h||"menu",className:ut.image,loading:"lazy",width:160,height:90})]}),e("div",{className:ut.addToCart,children:e(k,{onClick:e=>{if(e.preventDefault(),e.stopPropagation(),(f||y)&&l)return l();s({product:n}),i(Pe,{name:h,quantity:1})},icon:Y,type:N.DEFAULT})})]})};var _t={container:"ProductsGridItem-module_container__DU5KG",content:"ProductsGridItem-module_content__FXs0Y",isClickable:"ProductsGridItem-module_isClickable__8zhwt",info:"ProductsGridItem-module_info__HkBG-",data:"ProductsGridItem-module_data__Z-N1X",name:"ProductsGridItem-module_name__ZrIx3",description:"ProductsGridItem-module_description__-FQPA",price:"ProductsGridItem-module_price__BFu2H",imageContainer:"ProductsGridItem-module_imageContainer__eHS4Z",image:"ProductsGridItem-module_image__alZWL",addToCart:"ProductsGridItem-module_addToCart__gYVrI",noImage:"ProductsGridItem-module_noImage__78UHW",volume:"ProductsGridItem-module_volume__oxEAr",flexWide:"ProductsGridItem-module_flexWide__qcB5X",slidein:"ProductsGridItem-module_slidein__oKaVb",fadeInOut:"ProductsGridItem-module_fadeInOut__d2zot",heightAnimation:"ProductsGridItem-module_heightAnimation__zgbh9",fadein:"ProductsGridItem-module_fadein__Z067K",floatAnimation:"ProductsGridItem-module_floatAnimation__GXjP-",bottomSheet:"ProductsGridItem-module_bottomSheet__-zrFD",slideRightToLeft:"ProductsGridItem-module_slideRightToLeft__R7hv5"};const ht=({product:n,currency:r,language:a,onClick:l})=>{var d,c;const{addProduct:s}=st(),{volume:u,image580:_,image160:h,image1024:p}=n||{},v=_||p||h,{name:f,description:y}=m((()=>Ze(n,a)),[n,a]),{formattedTotalPrice:P}=m((()=>et(n,r,a)),[n,r,a]),b=(null===(d=null==n?void 0:n.variants)||void 0===d?void 0:d.length)>0,A=(null===(c=null==n?void 0:n.addons)||void 0===c?void 0:c.length)>0;return e("div",{className:_t.container,children:t("div",{className:o(_t,{content:!0,isClickable:!!l,noImage:!v}),onClick:l,children:[v&&e("div",{className:_t.imageContainer,children:e(Ve,{src:le(v),alt:f||"menu",className:_t.image,loading:"lazy",width:580,height:326})}),e("div",{className:_t.info,children:e("div",{className:_t.data,children:t(I,{gap:.25,children:[e("h3",{className:_t.name,children:f}),e("p",{className:_t.description,children:y}),t(g,{className:_t.price,gap:.5,fullWidth:!0,justifyContent:"space-between",children:[e("span",{children:P}),!!u&&e(S,{color:"white",className:_t.volume,children:u})]})]})})}),e("div",{className:_t.addToCart,children:e(k,{onClick:e=>{if(e.preventDefault(),e.stopPropagation(),(b||A)&&l)return l();s({product:n}),i(Pe,{name:f,quantity:1})},icon:Y,type:N.DEFAULT})})]})})};var gt={container:"ProductDetails-module_container__oa07j",content:"ProductDetails-module_content__Db3NC",image:"ProductDetails-module_image__BlMfl",details:"ProductDetails-module_details__zfnlt",name:"ProductDetails-module_name__ganLM",price:"ProductDetails-module_price__W34k9",volume:"ProductDetails-module_volume__RWG5s",description:"ProductDetails-module_description__HBufi",choices:"ProductDetails-module_choices__4tHaA",close:"ProductDetails-module_close__4cHZ3",addAction:"ProductDetails-module_addAction__o4T5R",actionTitle:"ProductDetails-module_actionTitle__NIJGW"};const pt={en:{},az:{"View order":"Şifarişi göstər","Remove from order":"Sifarişdən sil","Update order":"Sifarişi yenilə","Add to order":"Sifarişə əlavə et","Your order":"Sifarişiniz",Subtotal:"Ümumi","Empty order":"Boş sifariş","You don't have any items in your order":"Sifarişinizdə heç bir məhsul yoxdur","Add items":"Məhsul əlavə et",Events:"Hərəkətlər","Scrolled to Category":"Kateqoriyaya sürüşdürdü","Category Selected":"Kateqoriya seçildi","Product Details":"Məhsul detalına baxıldı","Product Added to Cart":"Səbətə əlavə edildi","Product choices":"Seçimlər","In order":"Sifarişdə"},tr:{"View order":"Siparişi Görüntüle","Remove from order":"Siparişten Kaldır","Update order":"Siparişi Güncelle","Add to order":"Siparişe Ekle","Your order":"Siparişiniz","Empty order":"Boş sipariş","You don't have any items in your order":"Siparişinizde hiç bir ürün yok","Add items":"Ürün ekle",Subtotal:"Toplam",Events:"Olaylar","Product choices":"Seçenekler","In order":"Siparişte"},nl:{"View order":"Bestelling bekijken","Remove from order":"Uit bestelling verwijderen","Update order":"Bestelling bijwerken","Add to order":"Aan bestelling toevoegen","Your order":"Uw bestelling","Empty order":"Lege bestelling","You don't have any items in your order":"U heeft geen items in uw bestelling","Add items":"Items toevoegen",Subtotal:"Totaal",Events:"Gebeurtenissen","Product choices":"Productkeuzes","In order":"In bestelling"},et:{"View order":"Vaata tellimust","Remove from order":"Eemalda tellimusest","Update order":"Uuenda tellimust","Add to order":"Lisa tellimusele","Your order":"Teie tellimus","Empty order":"Tühi tellimus","You don't have any items in your order":"Teie tellimuses pole ühtegi eset","Add items":"Lisa esemeid",Subtotal:"Kokku",Events:"Sündmused","Product choices":"Tootevalikud","In order":"Tellimuses"},ru:{"View order":"Посмотреть заказ","Remove from order":"Удалить из заказа","Update order":"Обновить заказ","Add to order":"Добавить в заказ","Your order":"Ваш заказ","Empty order":"Пустой заказ","You don't have any items in your order":"В вашем заказе нет товаров","Add items":"Добавить товары",Subtotal:"Итого",Events:"События","Product choices":"Варианты товара","In order":"В заказе"}},vt=e=>{const{language:t}=pe(),n=e||t;return{t:e=>{var t;return(null===(t=pt[n])||void 0===t?void 0:t[e])||e}}},ft=()=>{const{cart:e}=st();return Object.values(e||{}).reduce(((e,t)=>e+t.quantity),0)};var yt={container:"Quantity-module_container__01ySb",quantityAction:"Quantity-module_quantityAction__wRV2F",quantityValue:"Quantity-module_quantityValue__BBpyw",isDisabled:"Quantity-module_isDisabled__crQCf",sm:"Quantity-module_sm__0Hgp2",md:"Quantity-module_md__hu7a8",lg:"Quantity-module_lg__GA4jn",flexWide:"Quantity-module_flexWide__R95Jw",slidein:"Quantity-module_slidein__5yeWf",fadeInOut:"Quantity-module_fadeInOut__cllco",heightAnimation:"Quantity-module_heightAnimation__dhOgA",fadein:"Quantity-module_fadein__Cof2o",floatAnimation:"Quantity-module_floatAnimation__DSqQr",bottomSheet:"Quantity-module_bottomSheet__5-5iY",slideRightToLeft:"Quantity-module_slideRightToLeft__cjDHk"};const It=({isDecreaseDisabled:n=!1,quantity:r=1,size:i="md",onIncrease:a,onDecrease:l})=>t(g,{className:o(yt,{container:!0},[yt[i]]),justifyContent:"space-between",gap:0,children:[e("div",{className:o(yt,{quantityAction:!0,isDisabled:n}),onClick:l,children:e(y,{icon:F})}),e("div",{className:yt.quantityValue,children:r}),e("div",{className:yt.quantityAction,onClick:a,children:e(y,{icon:Y})})]});var Pt="ProductInCart-module_container__oSrwq",bt="ProductInCart-module_title__Vnc4l";const At=({productId:n,onModalClose:i})=>{const{setIsCartOpen:a,removeAllProductVariants:o}=st(),{t:l}=vt(),d=(e=>{const{cart:t}=st();return r(t)||!e?0:Object.values(t).filter((t=>t.productId===e)).reduce(((e,t)=>e+t.quantity),0)})(n);return d<=0?null:t(P,{className:Pt,fullWidth:!0,justifyContent:"space-between",alignItems:"center",children:[t(P.Item,{flex:1,className:bt,children:[l("In order")," (",d,")"]}),e(P.Item,{flex:0,children:t(g,{children:[e(k,{icon:K,onClick:()=>{o(n)},type:N.DANGER,tooltip:l("Remove from order")}),e(k,{icon:X,onClick:()=>{a(!0),i&&i()},type:N.SUCCESS,tooltip:l("View order")})]})})]})};var Ct={container:"ProductVariants-module_container__r059N",variantsTitle:"ProductVariants-module_variantsTitle__G3wTr",variant:"ProductVariants-module_variant__Pk6eP",focused:"ProductVariants-module_focused__tdy2R",flexWide:"ProductVariants-module_flexWide__CQO0G",slidein:"ProductVariants-module_slidein__9xYoM",fadeInOut:"ProductVariants-module_fadeInOut__NcGdX",heightAnimation:"ProductVariants-module_heightAnimation__c7ORS",fadein:"ProductVariants-module_fadein__qqdC5",floatAnimation:"ProductVariants-module_floatAnimation__Fy-NX",bottomSheet:"ProductVariants-module_bottomSheet__JVxKH",slideRightToLeft:"ProductVariants-module_slideRightToLeft__lHsqZ"};const Nt=({product:n,selectedVariant:r,focusedSection:i,onSelectVariant:l})=>{const{language:d,currency:c}=pe(),{t:m}=vt(),_=s(null),{variants:h}=n||{},p="variant"===i;return u((()=>{p&&_.current&&_.current.scrollIntoView({behavior:"smooth"})}),[i]),t(I,{className:o(Ct,{container:!0,focused:p}),gap:1,fullWidth:!0,children:[e("div",{className:Ct.variantsTitle,ref:_,children:m("Product choices")}),(h||[]).map((i=>{const{id:o}=i||{},{formattedTotalPrice:s}=(({variantId:e,currency:t="USD",language:n="en",product:r,quantity:i=1})=>{const o=nt(e,r,i);return{totalPrice:o,formattedTotalPrice:a(o,t,n)}})({variantId:o,language:d,currency:c,product:n}),{title:u}=rt(i,d);return t(g,{justifyContent:"space-between",onClick:()=>l(o),className:Ct.variant,children:[e(w,{label:u,name:"variant",onChange:()=>l(o),checked:r===o,type:L.RADIO,size:"small"}),e("div",{className:Ct.variantPrice,children:s})]},o)}))]})};var St={container:"ProductAddons-module_container__DRnT7"};const kt=({product:n,selectedAddons:r,onOptionSelect:i})=>{const{language:o,currency:l}=pe(),{addons:d}=n||{};return e(I,{className:St.container,gap:1.5,fullWidth:!0,children:(d||[]).map((n=>{const{id:d,options:c,selectType:s}=n||{},{title:u}=Fe(n,o);return t(I,{children:[e(S,{variant:"bold",children:u}),e(I,{gap:1,fullWidth:!0,children:(c||[]).map((n=>{const{id:c}=n||{},{formattedTotalPrice:u}=(({option:e,currency:t="USD",language:n="en"})=>{const{price:r}=e||{};return{totalPrice:r,formattedTotalPrice:a(r,t,n)}})({option:n,language:o,currency:l}),{title:m}=Ke(n,o),_=s===Ye.SINGLE,h=_?r[d]===c:(r[d]||[]).includes(c);return t(g,{justifyContent:"space-between",className:St.option,children:[e(w,{label:m,name:`option-${d}`,onChange:()=>i({addonId:d,optionId:c,isSingle:_,isRemove:!_&&h}),checked:h,type:_?L.RADIO:L.CHECKBOX,size:"small"}),e("div",{className:St.optionPrice,children:u})]},c)}))})]},d)}))})},wt=({product:n,onClose:o})=>{const{language:l,currency:d}=pe(),{addProduct:_,updateProduct:h}=st(),[p,v]=c(1),[f,y]=c(!1),[P,b]=c(null),[A,C]=c(null),[N,S]=c({}),w=s(null),{t:L}=vt(),D=(({productId:e,variantId:t,selectedAddons:n})=>{var i;const{cart:a}=st();return r(a)||!e?0:(null===(i=a[lt(e,t,n)])||void 0===i?void 0:i.quantity)||0})({productId:null==n?void 0:n.id,variantId:P,selectedAddons:N}),{name:R,description:j}=m((()=>Ze(n,l)),[n,l]),{formattedTotalPrice:G}=m((()=>et(n,d,l)),[n,d,l]),{formattedTotalPrice:q}=m((()=>(({product:e,variantId:t,quantity:n=1,currency:r,language:i,selectedAddons:o,noVat:l=!1})=>{const{total:d}=it({product:e,variantId:t,quantity:n,selectedAddons:o,noVat:l});return{totalPrice:d,formattedTotalPrice:a(d,r,i)}})({product:n,quantity:p,language:l,currency:d,variantId:P,selectedAddons:N})),[n,p,l,d,P,N]),V=f?0===p:1===p,E=m((()=>L(f?0===p?"Remove from order":"Update order":"Add to order")),[f,p]);u((()=>{v(D>0?D:1),y(D>0)}),[D,n]),u((()=>{b(null),S({})}),[n]);const x=e=>{-1===e&&V||v((t=>Math.max(0,t+e)))};if(r(n))return null;const{image1024:z,volume:W,variants:H,addons:B}=n,U=(null==H?void 0:H.length)>0,Q=(null==B?void 0:B.length)>0;return e("div",{className:gt.container,onClick:e=>{var t,n;(null===(n=null===(t=null==w?void 0:w.current)||void 0===t?void 0:t.contains)||void 0===n?void 0:n.call(t,null==e?void 0:e.target))||o&&o()},children:e(T,{onClose:o,ref:w,noBodyPadding:!0,size:"small",content:t("div",{className:gt.content,children:[t(I,{gap:0,children:[z&&e(Ve,{src:le(z),width:1024,height:400,alt:R||"product",className:gt.image}),t(I,{className:gt.details,gap:1,children:[e("h2",{className:gt.name,children:R}),t(g,{justifyContent:"space-between",children:[e("div",{className:gt.price,children:G}),e("div",{className:gt.volume,children:W})]}),e("div",{className:gt.description,children:j})]}),(U||Q)&&t(I,{gap:0,className:gt.choices,children:[U&&e(Nt,{product:n,selectedVariant:P,focusedSection:A,onSelectVariant:b}),Q&&e(kt,{product:n,selectedAddons:N,onOptionSelect:({addonId:e,optionId:t,isSingle:n,isRemove:r=!1})=>{S((i=>{if(n)return Object.assign(Object.assign({},i),{[e]:t});const a=i[e]||[],o=r?a.filter((e=>e!==t)):[...new Set([...a,t])];return Object.assign(Object.assign({},i),{[e]:o})}))}})]})]}),e("div",{className:gt.close,children:e(k,{onClick:o,icon:Z})})]}),footer:t(I,{children:[e(At,{productId:null==n?void 0:n.id,onModalClose:o}),t(g,{className:gt.addToCart,gap:.5,children:[e(It,{isDecreaseDisabled:V,onDecrease:()=>x(-1),onIncrease:()=>x(1),quantity:p}),e(O,{className:gt.addAction,label:t(g,{fullWidth:!0,justifyContent:"space-between",children:[e("span",{className:gt.actionTitle,children:E}),e("span",{children:q})]}),onClick:()=>{var e;if((null===(e=null==n?void 0:n.variants)||void 0===e?void 0:e.length)>0&&!P)return C("variant"),void setTimeout((()=>{C(null)}),200);f?h({product:n,quantity:p,variantId:P,selectedAddons:N}):(_({product:n,quantity:p,variantId:P,selectedAddons:N}),i(Pe,{name:R,quantity:p})),o&&o()},size:"xl",fullWidth:!0})]})]})})})};var Lt="Cart-module_container__3KQtx",Tt="Cart-module_content__rkiZa",Ot={container:"CartStepper-module_container__4CF1L",count:"CartStepper-module_count__E-RBg",actionText:"CartStepper-module_actionText__-rVKA",totalPrice:"CartStepper-module_totalPrice__QboRN",isClickable:"CartStepper-module_isClickable__mDptU",flexWide:"CartStepper-module_flexWide__eXxCr",slidein:"CartStepper-module_slidein__d5JQ-",fadeInOut:"CartStepper-module_fadeInOut__pS8nn",heightAnimation:"CartStepper-module_heightAnimation__7-e5Z",fadein:"CartStepper-module_fadein__-Ba0-",floatAnimation:"CartStepper-module_floatAnimation__rq6zX",bottomSheet:"CartStepper-module_bottomSheet__1wHHD",slideRightToLeft:"CartStepper-module_slideRightToLeft__0KLAo"};const Dt=({actionText:n,onClick:r})=>{const i=ft(),{formattedTotalPrice:l}=(()=>{const{cart:e}=st(),{currency:t,language:n}=pe(),r=Object.values(e||{}).reduce(((e,t)=>{const{totalPrice:n}=ot(t);return e+n}),0);return{totalPrice:r,formattedTotalPrice:a(r,t,n)}})();return t(P,{className:o(Ot,{container:!0,isClickable:!!r}),justifyContent:"space-between",alignItems:"center",onClick:r,children:[e(P.Item,{flex:1,children:t(g,{alignItems:"center",children:[e("div",{className:Ot.count,children:i}),e("div",{className:Ot.actionText,children:n})]})}),e(P.Item,{className:Ot.totalPrice,flex:1,children:l})]})},Rt=()=>{const{setIsCartOpen:t}=st(),{t:n}=vt();return ft()<=0?null:e("div",{className:Lt,children:e("div",{className:Tt,children:e(Dt,{onClick:()=>t(!0),actionText:n("View order")})})})};var jt={container:"CartDrawer-module_container__zvapw",content:"CartDrawer-module_content__ELSiG"},Gt="CartItem-module_container__At7lj",qt="CartItem-module_image__D-zzG",Vt="CartItem-module_data__Lo3Fb",Et="CartItem-module_name__EksZu",xt="CartItem-module_price__yJxl6";const zt=e=>{var t;const{products:n}=pe();return(null===(t=null==n?void 0:n.find)||void 0===t?void 0:t.call(n,(({id:t})=>t===e)))||{}},Wt=({productId:t,variantId:n,min:r=1,size:i="md",selectedAddons:a})=>{const o=(({productId:e,variantId:t,selectedAddons:n})=>{const{cart:r}=st(),i=r[lt(e,t,n)];return(null==i?void 0:i.quantity)||1})({productId:t,variantId:n,selectedAddons:a}),l=zt(t),{updateProduct:d}=st();return e(It,{isDecreaseDisabled:o===r,onDecrease:()=>d({product:l,quantity:o-1,variantId:n,selectedAddons:a}),onIncrease:()=>d({product:l,quantity:o+1,variantId:n,selectedAddons:a}),quantity:o,size:i})},Ht=({item:i,product:a,language:o})=>{const{selectedAddons:l}=i||{};return e(n,{children:Object.entries(l||{}).map((([e,n])=>{const i=((e,t)=>((null==e?void 0:e.addons)||[]).find((({id:e})=>e===t))||{})(a,Number(e));if(r(i)||r(i.options)||!Array.isArray(i.options))return null;let l="";if(Array.isArray(n)){const e=i.options.filter((({id:e})=>n.includes(e)));if(r(e))return null;l=e.map((e=>{const{title:t}=Ke(e,o);return t})).filter(Boolean).join(", ")}else{const e=i.options.find((({id:e})=>e===n));if(r(e))return null;const{title:t}=Ke(e,o);l=t}const{title:d}=Fe(i,o);return t(S,{color:"muted",variant:"small",children:[d,": ",l]},e)})).filter(Boolean)})},Bt=({item:n})=>{const{productId:r,variantId:i,selectedAddons:a}=n||{},o=zt(r),l=tt(o,i),{language:d,currency:c}=pe(),{image160:s}=o,{title:u}=rt(l,d),{name:_}=m((()=>Ze(o,d)),[o,d]),{formattedTotalPrice:h}=m((()=>ot(n,c,d)),[n,c,d]);return t(g,{className:Gt,gap:1,alignItems:"flex-start",children:[s&&e(Ve,{src:le(s),alt:_||"menu",className:qt,loading:"lazy",width:80,height:45}),t("div",{className:Vt,children:[e("div",{className:Et,children:_}),t(I,{gap:0,children:[!!u&&e(S,{color:"muted",variant:"small",children:u}),e(Ht,{item:n,product:o,language:d})]}),e("div",{className:xt,children:h})]}),e(Wt,{productId:r,variantId:i,selectedAddons:a,size:"sm",min:0})]})},Ut=()=>{const{isCartOpen:n,cart:i,setIsCartOpen:a}=st(),o=s(null),{t:l}=vt(),d=r(i),c=()=>a(!1);return n?e("div",{className:jt.container,onClick:e=>{var t,n;(null===(n=null===(t=null==o?void 0:o.current)||void 0===t?void 0:t.contains)||void 0===n?void 0:n.call(t,null==e?void 0:e.target))||c()},children:e(D,{ref:o,onClose:c,isOpen:n,title:l("Your order"),content:e("div",{className:jt.content,children:d?e((()=>t(I,{className:jt.noItems,fullWidth:!0,fullHeight:!0,alignItems:"center",justifyContent:"center",gap:0,children:[e(S,{variant:"h2",children:l("Empty order")}),e(R,{text:l("You don't have any items in your order")})]})),{}):e("div",{className:jt.items,children:Object.keys(i||{}).map((t=>e(Bt,{item:i[t]},t)))})}),footer:d?e(O,{label:l("Add items"),onClick:c,type:N.PRIMARY,size:"xl",fullWidth:!0}):e(Dt,{actionText:l("Subtotal")})})}):null},Qt=_((({categoryProductMap:n=[],currency:r,language:a,productBlocksRef:o,containerRef:l,onCategoryInView:d})=>{const[s,m]=c(null),[_,h]=c(at.LIST),p=[{icon:J,type:at.LIST},{icon:ee,type:at.GRID}],v=e=>{const{name:t}=Ze(e,a);i(Ie,{name:t}),m(e)};return u((()=>{const e=new IntersectionObserver((e=>{var t;const n=((null===(t=null==l?void 0:l.current)||void 0===t?void 0:t.clientHeight)||1e3)/2;let r=null,i=1/0;e.forEach((e=>{if(e.isIntersecting){const t=e.boundingClientRect,a=t.top+t.height/2,o=Math.abs(a-n);o<i&&(i=o,r=e.target.getAttribute("data-category-id"))}})),r&&d(Number(r))}),{threshold:.1});return Object.entries(o.current||{}).forEach((([t,n])=>{n&&(n.setAttribute("data-category-id",t),e.observe(n))})),()=>{e.disconnect()}}),[o,l]),e(ct,{children:t("div",{className:He,children:[e(g,{className:Be,alignItems:"center",children:p.map((({icon:t,type:n})=>e(k,{icon:t,onClick:()=>(e=>{h(e),i(be,{name:e})})(n),type:n===_?N.PRIMARY:N.DEFAULT},n)))}),e(I,{children:(n||[]).map((n=>{const{name:i}=Ce(n,a),{id:l,products:d}=n;return t("div",{className:Ue,ref:e=>{e&&(o.current[l]=e)},"data-category-id":l,children:[e("h2",{className:Qe,children:i}),e("div",{className:Me,children:e(I,{gap:0,children:(d||[]).map((t=>_===at.GRID?e(ht,{product:t,currency:r,language:a,onClick:()=>v(t)},t.id):e(mt,{product:t,currency:r,language:a,onClick:()=>v(t)},t.id)))})})]},l)}))}),e(wt,{product:s,onClose:()=>m(null)}),e(Rt,{}),e(Ut,{})]})})}),((e,t)=>e.categoryProductMap===t.categoryProductMap&&e.currency===t.currency&&e.language===t.language));Qt.displayName="Products";var Mt="Branches-module_branches__sOuoV",$t="Branches-module_list__vYoT2",Yt="Branches-module_name__K0Z-4";const Ft=({branches:t=[],rootPath:n="",onBranchSelect:r})=>{const i=({children:t,id:i})=>r?e("div",{onClick:()=>r(i),children:t}):e("a",{href:`${n}/${i}`,children:t});return e("div",{className:Mt,children:e(j,{className:$t,children:t.map((({id:t,name:n})=>e(i,{id:t,children:e(G,{noBottomMargin:!0,children:e(P,{justifyContent:"center",alignItems:"center",fullHeight:!0,children:e("h2",{className:Yt,children:n})})})},t)))})})},Kt=({data:a})=>{var o;const{name:l,coverImage:d,logoImage:m,branches:_=[],branchId:h,language:g,categories:p,products:v,currency:f,instagram:y,facebook:I,whatsapp:P,telegram:b,tiktok:A,rootPath:C,hostname:N,onBranchSelect:S}=a||{},k=_.length<=1,w=((e,t)=>{const n=t.reduce(((e,t)=>{const n=Number(t.categoryId);return e[n]||(e[n]=[]),e[n].push(t),e}),{});return e.map((e=>Object.assign(Object.assign({},e),{products:n[Number(e.id)]||[]}))).filter((e=>{var t;return(null===(t=null==e?void 0:e.products)||void 0===t?void 0:t.length)>0}))})(p,v),L=(()=>{var e;return k?(null===(e=null==_?void 0:_[0])||void 0===e?void 0:e.id)?_[0]:{}:_.find((e=>e.id===Number(h)))})(),T=k||!(null==L?void 0:L.name)?l:(null==L?void 0:L.name)||"",[O,D]=c(null===(o=null==p?void 0:p[0])||void 0===o?void 0:o.id),R=s({}),j=s(null),G=s(!0),{url:q,domain:V}=((e,t)=>{const n=_e.includes(e)?e:me;return{url:`https://${n}/${t||"en"}`,domain:n}})(N,g),E=e=>ne(void 0,void 0,void 0,(function*(){G.current=!1,D(e),(e=>{var t;const n=null===(t=null==R?void 0:R.current)||void 0===t?void 0:t[e];n&&(setTimeout((()=>{n.scrollIntoView({behavior:"smooth",block:"start"})}),100),setTimeout((()=>{G.current=!0}),1e3))})(e)}));return u((()=>{(()=>{if("undefined"==typeof window)return;const e=new URLSearchParams(window.location.search),t=Number(e.get("category"));if(!t)return;const n=(p||[]).find((({id:e})=>e===t));r(n)||E(t)})()}),[]),t("div",{className:re,ref:j,children:[e(ze,{branch:L,name:T,coverImage:ce(d),logoImage:de(m),instagram:y,facebook:I,whatsapp:P,telegram:b,tiktok:A}),k||h?t(n,{children:[e(We,{categoryProductMap:w,language:g,selectedCategoryId:O,onSelectCategory:E}),e(Qt,{currency:f,language:g,productBlocksRef:R,containerRef:j,categoryProductMap:w,onCategoryInView:e=>{if(!(null==G?void 0:G.current))return;const t=((e,t,n)=>{var i;const a=null===(i=null==t?void 0:t.find)||void 0===i?void 0:i.call(t,(({id:t})=>t===e));if(r(a))return"";const{name:o}=Ce(a,n);return o})(e,p,g);i(ye,{name:t}),D(e)}})]}):e(Ft,{branches:_,onBranchSelect:S,rootPath:C}),!!N&&e("a",{rel:"noopener noreferrer",target:"_blank",href:q,className:ae,children:V})]})},Xt=({data:t})=>e(ge,{value:t,children:e(Kt,{data:t})});var Zt={};const Jt=({currentGoal:t,language:n,setGoal:r})=>{const{t:i}=vt(n),a=s({}),o=e=>{switch(e){case ye:return i("Scrolled to Category");case fe:return i("Category Selected");case Ie:return i("Product Details");case Pe:return i("Product Added to Cart");default:return""}},l=h((e=>{var t,n;r(e),null===(n=null===(t=null==a?void 0:a.current)||void 0===t?void 0:t.close)||void 0===n||n.call(t)}),[r]);return e(q,{action:o(t),actionSize:"large",type:N.BORDERED_PRIMARY,closeRef:a,menu:e("div",{className:Zt.toolbarMenu,children:Ae.map((t=>e(V,{onClick:()=>l(t),children:o(t)},t)))})})},en=({data:t,isLoading:n=!1,loadingImage:r,language:i,goal:a,setGoal:o})=>{const{t:l}=vt(i);return e(G,{title:l("Events"),toolbar:e(Jt,{language:i,currentGoal:a,setGoal:o}),children:n?e(E,{image:r}):e(x,{data:t})})};export{en as Events,Xt as PublicMenu};
|
|
2
2
|
//# sourceMappingURL=index.esm.js.map
|