PageSourceSearch

https://tul.com.co/_next/static/chunks/8646-6f87e98cdb4e6845.js

js tul.com.co collected 2026-09-24 12:39:38 UTC 54,428 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8646],{8052:(e,l,t)=>{"use strict";t.d(l,{default:()=>x});var s=t(50003),a=t(34683),n=t(55751),r=t(75922),i=t(59382),c=t(57746),o=t.n(c),d=t(90963),u=t(70581);function x(){var e;let{getTotalItems:l,totalItems:t}=(0,d.useContext)(a.M),{data:c}=(0,i.useSession)(),x=null==c||null==(e=c.user)?void 0:e.login,m=(0,u.A)();return(0,d.useEffect)(()=>{x=(0,r.CV)(c)},[c]),(0,d.useEffect)(()=>{l()},[l]),(0,s.jsx)(s.Fragment,{children:"CO"!==n.r.BR&&"CO"!==n.r.MX&&(0,s.jsxs)(o(),{href:x?"/checkout/cart":"/login?redirect_to=/checkout/cart",className:"avatar indicator cursor-pointer","aria-label":"".concat(m.formatMessage({id:"cart"})," ").concat(t>0?"con ".concat(t," productos"):"vac\xedo"),children:[t>0&&(0,s.jsx)("span",{className:"indicator-item badge badge-secondary !rounded-full bg-red_1 border-tul_white w-[20px] h-[20px] bigScreen:w-[24px] bigScreen:h-[24px] text-tul_white text-[12px] smallScreen:top-[5px] top-[2px] bigScreen:right-1",children:t<=9?t:"+9"}),(0,s.jsxs)("button",{id:"product-cart",name:"product-cart","aria-label":"product-cart",className:"w-[36px] bigScreen:w-[54px] h-[36px] bigScreen:h-[54px] rounded-[50%] bg-complementary_4  !flex items-center justify-center",children:[(0,s.jsx)("i",{className:"flex text-[32px] smallScreen:text-[22px] soytul soytul-cart_outline text-tul_white"}),(0,s.jsx)("span",{className:"sr-only",children:m.formatMessage({id:"cart"})})]})]})})}},21099:(e,l,t)=>{"use strict";t.d(l,{CreditAvailable:()=>x});var s=t(50003),a=t(58872),n=t(5950),r=t(59382),i=t(4648),c=t(50771),o=t(58648),d=t(90963),u=t(75922);let x=()=>{var e,l;let{data:t,update:x}=(0,r.useSession)(),m=(0,u.CV)(t),{data:p}=(0,o.A)((null==t||null==(e=t.user)?void 0:e.uuid)&&(null==t||null==(l=t.user)?void 0:l.login)?"plt/v1/clnt/crdt/chck":null,e=>new i.G(t,"https://api.one.tul.io/").request({url:e,method:c.s.GET}).then(e=>e.json()));return(0,d.useEffect)(()=>{x({...t,user:{...null==t?void 0:t.user,cupotul_available:null==p?void 0:p.available_balance,cupotul_balance:null==p?void 0:p.amount_credit}})},[p]),m&&p&&(null==p?void 0:p.available_balance)>0&&(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("div",{className:"gap-1 flex",children:[(0,s.jsx)("i",{className:"text-[16px] flex soytul soytul-card_outline text-green_2 relative mt-[2px]"}),(0,s.jsxs)("span",{className:"flex bigScreen:flex-col smallScreen:flex-row smallScreen:gap-1 text-left text-primary_2 text-[12px] bigScreen:text-[14px]",children:[(0,s.jsx)(n.A,{id:"quotaAvailable"})," ",(0,s.jsx)("b",{children:(0,a.y)(null==p?void 0:p.available_balance)})]})]})})}},22626:(e,l,t)=>{"use strict";t.d(l,{WidgetCollapse:()=>f});var s=t(50003),a=t(90963),n=t(57746),r=t.n(n),i=t(14415),c=t(65426),o=t(74364),d=t(59430),u=t(59382),x=t(75922),m=t(4648),p=t(50771),h=t(58648);let f=e=>{var l,t;let{origin:n,children:f}=e,[g,j]=(0,a.useState)(!1),[b,y]=(0,a.useState)(),v=(0,d.N)("(max-width: 768px)"),{data:_}=(0,u.useSession)(),w=!((null==_||null==(l=_.user)?void 0:l.login)&&!(null==_||null==(t=_.user)?void 0:t.addresses)),N=(0,x.WB)(_),{data:S,isLoading:k}=(0,h.A)(v&&N&&w?"plt/v1/catlg/agg/ctgrs":null,e=>new m.G(_).request({url:e,method:p.s.GET}).then(e=>e.json())),A=(e,l)=>{if(e){let e=document.getElementById(c.H);e&&e.click(),y(void 0)}y(l),j(e)},C=()=>{let e=document.getElementById(c.Z);e&&e.click(),y(void 0)};return(0,s.jsxs)("div",{className:"collapse w-[100%] rounded-none border-b-[1px] bigScreen:hidden",children:[(0,s.jsx)("input",{className:"h-[60px] min-h-[60px]",type:"checkbox","aria-label":"".concat(c.H,"-").concat(n),id:"".concat(c.H,"-").concat(n)}),(0,s.jsx)("div",{className:"collapse-title p-0 text-xl flex items-center",children:f}),g,!b&&(0,s.jsx)("div",{className:"collapse-content p-0",children:(null==S?void 0:S.categories)&&S.categories.length>0?S.categories.map(e=>(0,s.jsx)("li",{onClick:()=>A(!0,e),className:"text-[black] flex font-regular bg-transparent min-w-56 h-[45px] px-2 smallScreen:p-0",children:(0,s.jsx)(o.Z,{categorySelected:b,isMobile:v,origin:n,category:e.category,hasChildren:e.children.length>0})},"".concat(n,"-").concat(e.category.uuid,"-").concat(e.category.name))):(0,s.jsx)("li",{className:"px-4 py-3 text-sm text-gray_scale_3",children:"Cargando categor\xedas..."})}),g&&b?(0,s.jsxs)("div",{className:"fixed w-full left-0 top-[140px] bottom-0 z-30 bg-tul_white h-[calc(100vh-140px)]",children:[(0,s.jsxs)("div",{className:"bg-primary_4 flex items-center px-4 py-4",children:[(0,s.jsx)("i",{onClick:()=>A(!1,void 0),className:"soytul soytul-arrow_left_filled text-tul_white flex"}),(0,s.jsx)(i.default,{width:36,height:36,uuid:b.category.uuid,style:{borderRadius:"50%",marginLeft:"6px",marginRight:"6px",minWidth:"36px",minHeight:"36px"}}),(0,s.jsx)("h1",{className:"text-tul_white text-[14px]",children:b.category.name})]}),b.children.map(e=>{let{category:l}=e;return(0,s.jsx)(r(),{onClick:()=>C(),href:"/categories/".concat(b.category.slug,"/").concat(l.slug,"/products"),className:"font-bold text-tul_black text-[14px] hover:text-secondary block border-b border-gray_scale_6 py-4 mx-4 z-[9999]",children:l.name},"".concat(n,"-").concat(l.uuid))})]}):""]})}},28094:(e,l,t)=>{"use strict";t.d(l,{a:()=>s});let s={BR:{significantDigits:2,thousandsSeparator:".",decimalSeparator:",",symbol
1:"R$",cellphoneDigits:10,currencyCode:"BRL"},MX:{significantDigits:2,thousandsSeparator:",",decimalSeparator:".",symbol:"$",cellphoneDigits:11,currencyCode:"MXN"},CO:{significantDigits:0,thousandsSeparator:".",decimalSeparator:",",symbol:"$",cellphoneDigits:10,currencyCode:"COP"}}},40523:(e,l,t)=>{"use strict";t.d(l,{default:()=>U});var s=t(50003),a=t(89199),n=t(40159),r=t(562),i=t(59382),c=t(90963),o=t(5950),d=t(58425),u=t(24389);function x(e){let{onSave:l,loading:t,addressToEdit:a,onUpdateAddress:n}=e;return(0,s.jsx)("dialog",{id:"modal_select_address_form",className:"modal modal-middle bigscreem:max-w-[calc(100vw-32px)]",children:(0,s.jsx)(u.X,{isFromRegister:!1,onSubmit:e=>{l(e)},addressToEdit:a,isLoading:t,onUpdateAddress:e=>{void 0!==a&&n(e)}})})}var m=t(74811),p=t(52347),h=t(82016),f=t(58508),g=t(37081),j=t(4648),b=t(50771),y=t(75922),v=t(58648),_=t(66186),w=t(38334),N=t(70581);function S(e){let l,t,{className:a,draggable:n=!1,inputLoader:r,changeDraggable:i,location:o,description:d=""}=e,u=(0,c.useRef)(null),[x,m]=(0,c.useState)(!0),p=(0,N.A)();return(0,c.useEffect)(()=>{let e={center:o,streetViewControl:!1,fullscreenControl:!1,zoomControl:!0,disableDefaultUI:!0,mapTypeControl:!1,zoom:15,mapId:"MAP"};(async()=>{let s=r||null,{Map:a}=await (null==s?void 0:s.importLibrary("maps")),{AdvancedMarkerElement:c}=await (null==s?void 0:s.importLibrary("marker"));l=new a(u.current,e);let d=document.createElement("img"),h=document.createElement("p");h.className='bg-primary text-white text-center p-4 rounded-lg shadow-lg text-base absolute -top-20 left-1/2 transform -translate-x-1/2 w-[250px]\n         after:content-[""] after:absolute after:-bottom-4 after:left-1/2 after:-bottom-2 after:-translate-x-1/2 after:border-8 after:border-transparent after:border-t-primary',h.textContent=p.formatMessage({id:"placeThePinOverTheAddress"}),h.style.zIndex="1000",h.style.display=x?"block":"none",d.className="w-[34px] h-[34px] relative",d.alt="Tul",d.title="Tul",d.style.cursor="pointer",d.src="/assets/icons/pin-location.svg";let f=()=>{m(!1),h.style.display="none"},g=document.createElement("div");g.className="relative text-center flex flex-col justify-center items-center",g.appendChild(h),g.appendChild(d),g.addEventListener("mousedown",f),l.addListener("dragstart",f),t=new c({map:l,position:o,gmpDraggable:n,content:g,title:"Tul"}),window.google.maps.event.addListener(t,"dragend",e=>{l.setCenter({lat:e.latLng.lat(),lng:e.latLng.lng()}),t.position={lat:e.latLng.lat(),lng:e.latLng.lng()},i&&i({lat:e.latLng.lat(),lng:e.latLng.lng()})})})()},[o]),(0,s.jsxs)("div",{className:"flex flex-col",children:[d&&(0,s.jsx)("p",{className:"m-0 text-[12px] font-semibold text-gray_scale_2",children:d}),(0,s.jsx)("div",{ref:u,className:a,children:"GoogleMap"})]})}function k(e){let{latitude:l,longitude:t,confirmAddressForm:a,isLoading:n,loadLoader:r}=e,[i,d]=(0,c.useState)(void 0),[u,x]=(0,c.useState)(l),[m,p]=(0,c.useState)(t);return(0,c.useEffect)(()=>{x(l),p(t)},[l,t]),(0,c.useEffect)(()=>{!i&&r&&d(new w.aH({apiKey:"AIzaSyD_bDvuYMGOGwNr8CudYV8Zu9UU4akp6JM",version:"quarterly",libraries:["places"]})),null==i||i.importLibrary("geocoding").then(e=>{new e.Geocoder})},[r]),(0,s.jsx)("dialog",{id:_.x.MAP_DIALOG,className:"modal",children:(0,s.jsxs)("div",{className:"modal-box",children:[(0,s.jsx)("form",{method:"dialog",className:"hidden",children:(0,s.jsx)("button",{id:"modal_map_address_close",name:"modal_map_address_close","aria-label":"modal_map_address_close",className:"flex justify-end text-tul_black relative top-9 right-5 z-10",children:(0,s.jsx)("i",{className:"text-[15px] soytul soytul-close_outline"})})}),(0,s.jsxs)("div",{className:"w-full h-full",children:[(0,s.jsx)("h3",{className:"text-center text-primary_1 text-[16px] font-bold my-4",children:(0,s.jsx)(o.A,{id:"confirmThePinIsInTheCorrectLocation"})}),i&&(0,s.jsx)(S,{location:{lat:u,lng:m},draggable:!n,className:"h-[400px] w-full rounded-xl",inputLoader:i,changeDraggable:e=>{x(e.lat),p(e.lng)}}),(0,s.jsx)("button",{disabled:n,onClick:()=>a({lat:u,lng:m}),className:"btn btn-primary w-full mt-4",children:(0,s.jsx)(o.A,{id:"confirmAddress"})})]})]})})}let A=(0,f.default)(()=>t.e(5751).then(t.bind(t,65751)),{loadableGenerated:{webpack:()=>[65751]},ssr:!1});function C(e){let{openModal:l,closeModal:t,changeUserAddress:a,reloadAddress:r}=e,{data:u,update:f}=(0,i.useSession)(),{segmentService:w}=(0,g.s)(),[N,S]=(0,c.useState)([]),[C,E]=(0,c.useState)(0),[I,L]=(0,c.useState)(0),[M,T]=(0,c.useState)(!1),[O,R]=(0,c.useState)(!1),[D,U]=(0,c.useState)(),[G,P]=(0,c.useState)(),[F,B]=(0,c.useState)(void 0),[W,z]=(0,c.useState)({title:"savedAddress",description:"nowYouCanSelectThisAddress",btnName:"back"}),H=(0,y.WB)(u),{data:X,mutate:Y}=(0,v.A)(H?"plt/v2/clnt/addrs/my":null,e=>new j.G(u).request({url:e,method:b.s.GET}).then(e=>e.json()));(0,c.useEffect)(()=>{let e=null!=X?X:[];S([...e]);let l=[...e].find(e=>e.current);P(l),U(l);let t=[...e].find(e=>e.current);t&&a({uuid:t.uuid,name:t.name},!1),T(!1)},[X]);let q=e=>{(null==e?void 0:e.status)!==d.$.NOCOVERAGE&&(S(null==N?void 0:N.map(l=>(l.uuid===e.uuid?l.current=!0:l.current=!1,l))),U(e),(null==G?void 0:G.uuid)===(null==e?void 0:e.uuid)?w.track("delivery_address_select",u,{}):w.track("change_delivery_address",u,{}))},V=e=>{T(!0),(0,m.QL)(e,u).then(e=>e.json()).then(e=>{R(!0),E(e.latitude),L(e.longitude),T(!1),t("modal_select_address_form-close"),"disabled"!==e.status&&Z({latitude:e.latitude,longitude:e.longitude}),Y()})},Z=e=>{let{latitude:s,longitude:a}=e;E(s),L(a),t("modal-close-address"),l(_.x.MAP_DIALOG)},$=e=>{T(!0);let l={...e,current:!0};(0,m.O6)(l,u).then(e=>e.json()).then(e=>{T(!1),R(!0),t("modal_select_address_form-close"),B(e),E(e.latitude),L(e.longitude),Z({latitude:e.latitude,longitude:e.longitude})})},J=e=>{w.track("delivery_address_edit",u,{}),B(e),l(_.x.FORM_SELECT_ADDRESS)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(k,{latitude:C,longitude:I,loadLoader:O,confirmAddressForm:e=>{T(!0),Y(),(0,m.fE)({uuid:null==F?void 0:F.uuid,latitude:e.lat,longitude:e.lng,current:null==F?void 0:F.current},u).then(e=>e.json()).then(e=>{B(void 0),t("modal_map_address_close"),"no_coverage"===e.status?(z({title:"savedAddress",description:"weWillNotifyYouWhenWeHaveCoverageAtThisAddress",btnName:"back"}),T(!1),l(_.x.MODAL_COVERAGE_ADDRESS)):(z({title:"savedAddress",description:"nowYouCanSelectThisAddress",btnName:"back"}),T(!1),l(_.x.MODAL_ADDRESS_DIALOG_SUCCESS)),T(!1),Y()})},isLoading:M}
1),(0,s.jsx)(h.A,{closeModal:t,openModal:l,title:W.title,description:W.description,btnName:W.btnName}),(0,s.jsx)(p.A,{closeModal:t,openModal:l,loading:M||!H}),(0,s.jsx)(x,{addressToEdit:F,onUpdateAddress:V,onSave:e=>{w.track("delivery_address_confirm",u,{}),$({address:e.address,business_uuid:e.business_uuid,latitude:e.latitude,longitude:e.longitude,name:e.name,original_latitude:e.latitude,original_longitude:e.longitude,reference:e.reference,status:e.status,type:e.type,details:e.details})},loading:M||!H}),(0,s.jsxs)("dialog",{id:"modal_select_address",className:"modal bigscreem:max-w-[calc(100vw-32px)]",children:[M||!H&&(0,s.jsx)("span",{className:"loading z-10 bg-primary_1 text loading-spinner loading-lg absolute left-[50%] top-[50%]"}),(0,s.jsx)("div",{className:"modal-box p-[54px] pb-[8px] max-w-[calc(100vw-32px)] smallScreen:w-full  bigScreen:w-[858px]",children:(0,s.jsxs)("div",{className:"bg-tul_white ".concat(M||!H&&"pointer-events-none opacity-50 select-none"),children:[(0,s.jsx)("form",{method:"dialog",children:(0,s.jsx)("button",{id:"modal-close-address",name:"modal-close-address","aria-label":"modal-close-address",className:"btn btn-sm btn-circle btn-ghost absolute right-2 top-2 text-tul_black",children:(0,s.jsx)("i",{className:"text-[15px] soytul soytul-close_outline"})})}),(0,s.jsx)("div",{className:"flex bigScreen:flex-row smallScreen:flex-col w-full",children:(0,s.jsxs)("div",{className:"smallScreen:w-full bigScreen:w-full flex flex-col smallScreen:text-center",children:[(0,s.jsx)("h3",{className:"text-tul_black leading-5 font-bold text-[24px] m-0",children:(0,s.jsx)(o.A,{id:"myAddresses"})}),(0,s.jsx)("p",{className:"smallScreen:my-1 smallScreen:text-[12px] bigScreen:text-[18px] break-words m-0 text-primary_4",children:(0,s.jsx)(o.A,{id:"selectTheAddressWhereYouWantToReceiveYourOrder"})})]})}),(0,s.jsx)("div",{className:"flex flex-col mt-2 w-full",children:(0,s.jsx)("div",{className:"smallScreen:w-full bigScreen:grid bigScreen:grid-cols-2 flex flex-col bigScreen:mr-[24px] bigScreen:gap-2 smallScreen:text-center",children:null==N?void 0:N.map(e=>(0,s.jsx)(A,{goEditAddress:J,onUpdateAddress:V,changeAddress:q,address:e},null==e?void 0:e.uuid))})}),(0,s.jsxs)("div",{className:"flex smallScreen:flex-col bigScreen:flex-row bigScreen:gap-4 smallScreen:gap-2 my-2 justify-center items-center w-full",children:[(0,s.jsx)("button",{onClick:()=>{(null==G?void 0:G.uuid)!==(null==D?void 0:D.uuid)&&D&&(T(!0),w.track("delivery_address_confirm",u,{}),(0,m.QL)({uuid:D.uuid,current:!0},u).then(()=>{T(!1),Y(),z({title:"readyWithExclamation",description:"weHaveSuccessfullyUpdatedYourDeliveryAddress",btnName:"continue"}),l(_.x.MODAL_ADDRESS_DIALOG_SUCCESS);let e={...u};(0,n.WU)(D),a({uuid:D.uuid,name:D.name},!0),e.user.warehouse_uuid=(null==D?void 0:D.uuid)||"",f(e)}))},className:"btn btn-primary font-semibold text-[16px] leading-5  bigScreen:w-[372px] smallScreen:w-full",children:(0,s.jsx)(o.A,{id:"confirmAddress"})}),(0,s.jsxs)("button",{onClick:()=>{t("modal-close-address"),B(void 0),l(_.x.FORM_SELECT_ADDRESS)},className:"btn btn-primary font-semibold text-[16px] leading-5  bg-transparent border border-primary_1 text-primary_1 bigScreen:w-[372px] smallScreen:w-full",children:["+ ",(0,s.jsx)(o.A,{id:"addNewAddress"})]})]})]})})]})]})}var E=t(69656);let I={CO:e=>fetch("https://plt.one.tul.io/web-app-nextjs/cities/".concat("development"===e?"dev":"prod","-CO.json")).then(e=>e.json()),BR:e=>fetch("https://plt.one.tul.io/web-app-nextjs/cities/".concat("development"===e?"dev":"prod","-BR.json")).then(e=>e.json()),MX:e=>fetch("https://plt.one.tul.io/web-app-nextjs/cities/".concat("development"===e?"dev":"prod","-MX.json")).then(e=>e.json())},L=()=>"production",M=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"CO",l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:L();return(I[(e||"CO").toUpperCase()]||I.CO)(l)};var T=t(77741);let O=e=>{let l=document.getElementById(e);l&&l.showModal()},R=e=>{let l=document.getElementById(e);l&&l.click()},D=e=>{let{selectedOption:l,warehouses:t,changeCity:a}=e,[n,r]=(0,c.useState)(l);return(0,c.useEffect)(()=>{((null==l?void 0:l.value)||(null==l?void 0:l.label))&&r(l)},[l]),(0,s.jsxs)("dialog",{id:_.x.MODAL_SELECT_WAREHOUSE,className:"modal modal-middle",children:[(0,s.jsxs)("div",{className:"modal-box flex flex-col gap-6 bigScreen:w-[400px] max-w-[400px] z-10 overflow-y-visible",children:[(0,s.jsx)("form",{method:"dialog",className:"z-10",children:(0,s.jsx)("button",{id:"modal-close-warehouse",name:"modal-close-warehouse","aria-label":"modal-close-warehouse",className:"btn btn-sm btn-circle btn-ghost absolute right-2 top-2 text-tul_black",children:"x"})}),(0,s.jsx)("h2",{className:"font-semibold text-tul_black text-[20px] text-center",children:(0,s.jsx)(o.A,{id:"whereAreYouLocated"})}),(0,s.jsxs)("label",{className:"form-control w-full max-w-xs m-auto text-tul_black",children:[(0,s.jsx)("div",{className:"label p-0 ",children:(0,s.jsx)("span",{className:"label-text text-gray_scale_2 text-[12px]",children:(0,s.jsx)(o.A,{id:"city"})})}),(0,s.jsx)(E.A,{options:t&&t.length>0&&t.map(e=>({label:e.city,value:e.uuid}))||[],valueSelected:n||{label:null==l?void 0:l.label,value:null==l?void 0:l.value},handleOnChange:e=>r(e)})]}),(0,s.jsx)("button",{id:"modal-change-warehouse",name:"modal-change-warehouse","aria-label":"modal-change-warehouse",onClick:()=>a(n),className:"btn btn-primary w-[163px] m-auto",children:(0,s.jsx)(o.A,{id:"continue"})})]}),(0,s.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,s.jsx)("button",{id:"modal-change-warehouse-close",name:"modal-change-warehouse-close","aria-label":"modal-change-warehouse-close",children:"x"})})]})};function U(){var e;let l="production",{data:t,update:o}=(0,i.useSession)(),d=(0,c.useCallback)(async()=>{try{let e=await M("CO",l);if(Array.isArray(e)&&e.length>0)return e;return[]}catch(e){return[]}},["CO",l]),{data:u=[],isLoading:x=!1}=(0,T.Ay)(["warehouses","CO",l],d),[m,p]=(0,c.useState)(""),[h,f]=(0,c.useState)(!0),[g,j]=(0,c.useState)("Selecciona tu ciudad"),b=(0,c.useCallback)(e=>{var l,s,a;let r=null==e?void 0:e.find(e=>{var l,s;return e.city===(null==t||null==(l=t.user)?void 0:l.city)&&e.uuid===(null==t||null==(s=t.user)?void 0:s.warehouse_uuid)}),i=(0,n.EI)(),c=(null==e||null==(l=e[0])?void 0:l.uuid)||"",d=(null==e||null==(s=e[0])?void 0:s.city)||"";r&&(c=r.uuid,d=(null==t||null==(a=t.user)?void 0:a.city)||r.city),i&&(c=i.uuid,d=i.name),p(c),j(d||"Selecciona tu ciudad"),(null==t?void 0:t.user)&&(!t.user.warehouse_uuid||!t.user.city)&&(t.user.warehouse_uuid=c,t.user.city=d,o(t))},[t,o]),y=async e=>{var l;let s=null==u?void 0:u.find(l=>l.uuid===e.value&&l.city===e.label),a=new r.u,n=await a.getTokenAnonimous((null==s?void 0:s.uuid)||(null==e?void 0:e.value));j((null==e?void 0:e.label)||""),o({...t,user:{...null==t?void 0:t.user,warehouse_uuid:(null==s?void 0:s.uuid)||e.value,access_token:(null==n?void 0:n.id_token)||"",id_token:null==n?void 0:n.id_token,uuid:null==n?void 0:n.uuid,refresh_token:null!=(l=null==n?void 0:n.refresh_token)?l:"",city:(null==s?void 0:s.city)||(null==e?void 0:e.label)}}),R("modal-close-warehouse"),setTimeout(()=>{window.location.reload()},1e3)},v=()=>{f(!h),O("modal_select_address")};return(0,c.useEffect)(()=>{var e;(null==t||null==(e=t.user)?void 0:e.login)||!((null==u?void 0:u.length)>0)||b(u)},[u]),(0,s.jsxs)(a.default,{children:[(0,s.jsxs)("div",{onClick:()=>{var e;return(null==t||null==(e=t.user)?void 0:e.login)?v():O(_.x.MODAL_SELECT_WAREHOUSE)},className:"flex flex-row items-center gap-1 cursor-pointer smallScreen:w-full bigScreen:w-[238px]",children:[(0,s.jsx)("i",{className:"text-[16px] flex soytul soytul-location_outline"}),(0,s.jsx)("span",{className:"text-[14px] bigScreen:max-w-[250px] smallScreen:max-w-[100px] w-auto line-clamp-1",children:null==g?void 0:g.toUpperCase()}),(0,s.jsx)("i",{className:"text-[24px] soytul soytul-arrow_chevron_down_micro_outline flex"})]}),(0,s.jsx)(c.Suspense,{children:(null==t||null==(e=t.user)?void 0:e.login)?(0,s.jsx)(C,{reloadAddress:h,changeUserAddress:function(e){let l=!(arguments.length>1)||void 0===arguments[1]||arguments[1];o({...t,user:{...null==t?void 0:t.user,warehouse_uuid:e.uuid,city:e.name}}),p(e.uuid),j(e.name),l&&window.location.reload()},openModal:O,closeModal:R}):(0,s.jsx)(D,{changeCity:y,selectedOption:{label:g,value:m},warehouses:u||[]})})]})}},58291:(e,l,t)=>{"use strict";t.d(l,{default:()=>_});var s=t(50003),a=t(59382),n=t(65426),r=t(34348),i=t(57746),c=t.n(i),o=t(90963),d=t(5950),u=t(14415),x=t(66186),m=t(58872),p=t(4648),h=t(50771),f=t(75922),g=t(82135),j=t(58648);function b(e){var l,t,n,r,i,o,b,y;let{session:v}=e,_=(0,g.usePathname)(),w=(0,f.WB)(v),N=()=>{localStorage.clear(),(0,a.signOut)({callbackUrl:"/",redirect:!0})},{data:S}
1=(0,j.A)(w?"plt/v1/clnt/clnts/".concat(null!=(b=null==v||null==(l=v.user)?void 0:l.uuid)?b:"","/cr-avl"):null,e=>{let l=null;return new p.G(v,"https://api.one.tul.io/").request({url:e,method:h.s.GET}).then(e=>e.json())},{revalidateOnMount:!0}),{data:k}=(0,j.A)(w?"plt/v1/clnt/cr/rf/cfg":null,e=>{let l=null;return new p.G(v).request({url:e,method:h.s.GET}).then(e=>e.json())},{revalidateOnMount:!0});return(0,s.jsx)("dialog",{id:x.x.DIALOG_PROFILE,className:"modal",children:(0,s.jsxs)("div",{className:"modal-box w-full h-full max-h-full",children:[(0,s.jsx)("form",{method:"dialog",children:(0,s.jsx)("button",{className:"btn btn-sm btn-circle btn-ghost absolute right-2 top-2",children:"✕"})}),(0,s.jsxs)("div",{className:"flex flex-row justify-between w-full p-[10px] mt-4 mb-[24px]",children:[(0,s.jsxs)("div",{className:"flex flex-col max-w-[150px]",children:[(0,s.jsx)("h6",{className:"text-[16px] m-0 text-tul_black",children:(0,s.jsx)(d.A,{id:"hello"})}),(0,s.jsx)("h6",{className:"text-[24px] leading-8  m-0 font-bold text-tul_black w-[160px] line-clamp-1",children:null==v||null==(t=v.user)?void 0:t.name})]}),(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsxs)(c(),{className:"text-[12px] leading-4 font-semibold text-primary_4 text-right flex flex-row justify-end my-[5px]",href:"/my-account/information",children:[(0,s.jsx)(u.default,{height:18,width:18,alt:"edit",className:"mr-2",imageUrl:"/assets/icons/edit.svg"}),(0,s.jsx)(d.A,{id:"editProfile"})]}),(0,s.jsx)("p",{className:"text-[14px] leading-5 m-0 text-gray_scale_1 text-right",children:null==v||null==(n=v.user)?void 0:n.cellphone}),(0,s.jsxs)("p",{className:"text-[14px] leading-5 m-0 text-gray_scale_1 text-right",children:["TUL code: ",null==v||null==(r=v.user)?void 0:r.tul_code]})]})]}),(null==v||null==(i=v.user)?void 0:i.subtype)&&(0,s.jsxs)("div",{className:"flex flex-row justify-start items-center shadow-md w-full max-w-[251px] gap-2 rounded-[8px] py-2 px-[10px] mx-auto mb-5",children:[(0,s.jsx)("i",{className:"text-[15px] soytul soytul-circle_check_filled text-light_success"}),(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("p",{className:"text-[10px] leading-3",children:(0,s.jsx)(d.A,{id:"yourProfileIs"})}),(0,s.jsx)("p",{className:"text-[14px] leading-5 font-bold",children:null==v||null==(o=v.user)?void 0:o.subtype})]})]}),(0,s.jsxs)("div",{className:"shadow-lg w-full max-w-[251px] gap-y-[17px] gap-x-[22px] rounded-[14px] p-[18px] mx-auto grid grid-cols-2 justify-center",children:[(0,s.jsxs)("div",{className:"flex flex-col justify-center items-center gap-2 cursor-pointer justify-self-center",children:[(0,s.jsx)(c(),{href:"/my-account/billing",className:"w-[50px] h-[50px] flex justify-center items-center rounded-[26px]  ".concat("/my-account/billing"===_||"/my-account/billing/add"===_?"bg-primary_2":"bg-primary_4"),children:(0,s.jsx)("i",{className:"text-[22px] soytul soytul-datos_filled text-primary_2 relative top-1 ".concat("/my-account/billing"===_||"/my-account/billing/add"===_?"text-tul_white":"text-primary_2")})}),(0,s.jsx)("p",{className:"m-0 text-center text-[14px] leading-5 font-semibold text-gray_scale_1",children:(0,s.jsx)(d.A,{id:"billingInformation"})})]}),(0,s.jsxs)("div",{className:"flex flex-col justify-center items-center gap-2 cursor-pointer justify-self-center",children:[(0,s.jsx)(c(),{href:"/my-account/address/list",className:"w-[50px] h-[50px] flex justify-center items-center rounded-[26px]  ".concat("/my-account/address/list"===_?"bg-primary_2":"bg-primary_4"),children:(0,s.jsx)("i",{className:"text-[22px] soytul soytul-location_filled text-primary_2 relative top-1 ".concat("/my-account/address/list"===_?"text-tul_white":"text-primary_2")})}),(0,s.jsx)("p",{className:"m-0 text-center text-[14px] leading-5 font-semibold text-gray_scale_1",children:(0,s.jsx)(d.A,{id:"deliveriesAddresses"})})]}),(0,s.jsxs)("div",{className:"flex flex-col justify-center items-center gap-2 cursor-pointer justify-self-center",children:[(0,s.jsx)(c(),{href:"/my-account/creditul/home",className:"w-[50px] h-[50px] flex justify-center items-center rounded-[26px]  ".concat("/my-account/creditul/home"===_?"bg-primary_2":"bg-primary_4"),children:(0,s.jsx)("i",{className:"text-[22px] soytul soytul-wallet_filled text-primary_2 relative top-1 ".concat("/my-account/creditul/home"===_?"text-tul_white":"text-primary_2")})}),(0,s.jsx)("p",{className:"m-0 text-center text-[14px] leading-5 font-semibold text-gray_scale_1",children:(0,s.jsx)(d.A,{id:"titleCreditul"})})]}),(0,s.jsxs)("div",{className:"flex flex-col justify-center items-center gap-2 cursor-pointer justify-self-center",children:[(0,s.jsx)(c(),{href:"/my-account/support",className:"w-[50px] h-[50px] flex justify-center items-center rounded-[26px]  ".concat("/my-account/support"===_?"bg-primary_2":"bg-primary_4"),children:(0,s.jsx)("i",{className:"text-[22px] soytul soytul-headphones_filled text-primary_2 relative top-1 ".concat("/my-account/support"===_?"text-tul_white":"text-primary_2")})}),(0,s.jsx)("p",{className:"m-0 text-center text-[14px] leading-5 font-semibold text-gray_scale_1",children:(0,s.jsx)(d.A,{id:"help"})})]})]}),(0,s.jsxs)(c(),{href:"/my-account/referrals",className:"flex flex-row justify-start items-center shadow-md w-full max-w-[251px] rounded-[14px] p-3 my-6 mx-auto cursor-pointer bg-primary_1",children:[(0,s.jsx)(u.default,{height:100,width:120,alt:"edit",className:"mr-[10px]",imageUrl:"/assets/icons/referral-gift.svg"}),(0,s.jsxs)("div",{className:"flex flex-col text-tul_white",children:[(0,s.jsx)("p",{className:"text-[16px] font-bold leading-6",children:(0,s.jsx)(d.A,{id:"earnEvenForInvitingAFriend",values:{earned:(0,m.y)((null==k?void 0:k.register_amount)+(null==k?void 0:k.buy_amount)|0)}})}),(0,s.jsx)("p",{className:"text-[12px] leading-4",children:(0,s.jsx)(d.A,{id:"youHaveManyOpportunitiesToEarnMoneyInTulPointsItsVeryEasy"})})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("h2",{className:"text-[18px] font-semibold leading-6 text-tul_black flex items-center gap-[5px] mb-[9px]",children:[(0,s.jsx)(d.A,{id:"tulPoints"})," ",(0,s.jsx)("div",{className:"tooltip","data-tip":"1 TUL Punto = $1 Peso Colombiano",children:(0,s.jsx)("i",{className:"text-[17px] soytul soytul-warning_filled relative top-[3px]"})})]}),(0,s.jsx)("section",{className:"rounded-[12px] my-[2px] mx-auto py-[16px] px-[19px] w-full bg-tul_white shadow-lg",children:(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsxs)("div",{className:"flex flex-row justify-between",children:[(0,s.jsx)("h2",{className:"text-[16px] font-semibold text-primary_4",children:(0,s.jsx)(d.A,{id:"available"})}),(0,s.jsxs)(c(),{href:"/my-account/tul-credits/help",className:"text-tul_black text-[14px] curs
1or-pointer leading-5 flex flex-row",children:[(0,s.jsx)(d.A,{id:"help"}),(0,s.jsx)(u.default,{height:12,width:12,alt:"info",imageUrl:"/assets/svg/info.svg",className:"relative mb-[4px] ml-1"})]})]}),(0,s.jsx)("span",{className:"mt-[5px] text-[28px] text-primary_4 font-bold",children:(0,m.y)(null!=(y=null==S?void 0:S.credits_available)?y:0)}),(0,s.jsxs)(c(),{href:"/my-account/tul-credits",className:"font-semibold text-primary_4 text-[14px] items-center",children:[(0,s.jsx)(d.A,{id:"seeHistory"})," ",(0,s.jsx)("i",{className:"text-[20px] soytul soytul-arrow_chevron_right_micro_filled relative top-[5px]"})]})]})})]}),(0,s.jsx)("h2",{className:"text-[16px] leading-4 font-semibold text-tul_black my-[24px]",children:(0,s.jsx)(d.A,{id:"moreInformation"})}),(0,s.jsx)("div",{className:"w-full",children:(0,s.jsx)("menu",{className:"",children:(0,s.jsxs)("ul",{className:"w-full",children:[(0,s.jsx)("li",{className:"list-none items-center w-full p-[16px] rounded-[14px] bg-tul_white",children:(0,s.jsxs)(c(),{href:"https://vendedores.co.tul.io/register",className:"flex flex-row justify-between",children:[(0,s.jsxs)("div",{className:"flex flex-row",children:[(0,s.jsx)(u.default,{imageUrl:"/assets/icons/menu-profile/menu_beSupplier.svg",height:15,width:15,alt:"supplier",className:"mr-[10px] mb-1"}),(0,s.jsx)("span",{className:"text-[16px] text-tul_black font-bold",children:(0,s.jsx)(d.A,{id:"beSupplier"})})]}),(0,s.jsx)("i",{className:"text-[20px] soytul soytul-arrow_chevron_right_micro_filled justify-end items-end"})]})}),(0,s.jsx)("li",{className:"list-none items-center w-full p-[16px] rounded-[14px] bg-tul_white",children:(0,s.jsxs)(c(),{href:"/my-account/about-us",className:"flex flex-row justify-between",children:[(0,s.jsxs)("div",{className:"flex flex-row",children:[(0,s.jsx)(u.default,{imageUrl:"/assets/icons/menu-profile/menu_about.svg",height:15,width:15,alt:"about",className:"mr-[10px] mb-1"}),(0,s.jsx)("span",{className:"text-[16px] text-tul_black font-bold",children:(0,s.jsx)(d.A,{id:"aboutTul"})})]}),(0,s.jsx)("i",{className:"text-[20px] soytul soytul-arrow_chevron_right_micro_filled justify-end items-end"})]})}),(0,s.jsx)("li",{className:"list-none items-center w-full p-[16px] rounded-[14px] bg-tul_white",children:(0,s.jsxs)("button",{onClick:()=>N(),className:"flex flex-row justify-between w-full",children:[(0,s.jsxs)("div",{className:"flex flex-row",children:[(0,s.jsx)(u.default,{imageUrl:"/assets/icons/menu-profile/menu_logout.svg",height:15,width:15,alt:"exit",className:"mr-[10px] mb-1"}),(0,s.jsx)("span",{className:"text-[16px] text-tul_black font-bold",children:(0,s.jsx)(d.A,{id:"logOut"})})]}),(0,s.jsx)("i",{className:"text-[20px] soytul soytul-arrow_chevron_right_micro_filled justify-end items-end ml-auto"})]})})]})})})]})})}let y=e=>{let{closeModal:l}=e;return(0,s.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-primary_4 h-[140px] w-[100%]",children:[(0,s.jsx)("i",{onClick:()=>l(),className:"soytul soytul-close_filled flex text-[14px] absolute right-3 top-3 text-tul_white"}),(0,s.jsx)("h4",{className:"text-tul_white font-semibold text-[16px]",children:(0,s.jsx)(d.A,{id:"helloWelcomeToTul"})}),(0,s.jsx)("h5",{className:"text-tul_white font-regular text-[14px]",children:(0,s.jsx)(d.A,{id:"loginOrCreateAnAccount"})}),(0,s.jsx)(c(),{className:"btn btn-secondary btn-sm w-full",href:"/login","aria-label":"Login",children:(0,s.jsx)("h5",{className:"font-regular text-primary_4 text-[16px]",children:(0,s.jsx)(d.A,{id:"enterTUL"})})})]})},v=e=>{let{closeModal:l,openModal:t,name:a,icon:n}=e;return(0,s.jsxs)("div",{className:"flex flex-col justify-center gap-3 p-4 bg-primary_4 h-[73px] w-[100%]",children:[(0,s.jsx)("i",{onClick:()=>l(),className:"soytul soytul-close_filled flex text-[24px] absolute right-[15px] top-[19px] text-tul_white"}),(0,s.jsxs)("div",{className:"text-tul_white leading-4 flex justify-start align-middle items-center gap-2",children:[(0,s.jsx)("div",{className:"h-[36px] w-[36px] bg-tul_white flex items-center justify-center rounded-full",children:(0,s.jsx)("i",{className:"text-[20px] ".concat(n," ")})}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsxs)("span",{className:"text-[16px]",children:[(0,s.jsx)(d.A,{id:"hello"}),", ",a]}),(0,s.jsxs)(c(),{className:"text-primary_3 text-[14px] flex gap-1 item-center bigScreen:block smallScreen:hidden",href:"/my-account/information",children:[(0,s.jsx)(d.A,{id:"seeMyProfile"}),(0,s.jsx)("i",{className:"text-[20px] h-[9px] soytul soytul-arrow_chevron_right_micro_filled text-primary_3 relative top-[-3px]"})]}),(0,s.jsxs)("button",{onClick:()=>t(),className:"text-primary_3 text-[14px] flex gap-1 item-center justify-start align-middle bigScreen:hidden smallScreen:inline-flex",children:[(0,s.jsx)(d.A,{id:"seeMyProfile"}),(0,s.jsx)("i",{className:"text-[20px] h-[9px] soytul soytul-arrow_chevron_right_micro_filled text-primary_3 relative top-[-3px]"})]})]})]})]})};function _(){var e,l,t;let{data:i}=(0,a.useSession)(),c=null==i||null==(e=i.user)?void 0:e.login,d=()=>{let e=document.getElementById(n.Z);e&&e.click()};(0,o.useEffect)(()=>{},[i]);let u=(()=>{var e;switch(null==i||null==(e=i.user)?void 0:e.client_type){case r.D.B2B:return"soytul soytul-store_filled text-primary_3";case r.D.B2P:return"soytul soytul-b2p-user text-green_2";case r.D.B2C:return"soytul soytul soytul-user_filled text-tul_white";default:return"soytul soytul-store_filled"}})();return(0,s.jsx)("div",{suppressHydrationWarning:!0,children:c?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(b,{session:i}),(0,s.jsx)(v,{closeModal:d,openModal:()=>document.getElementById(x.x.DIALOG_PROFILE).showModal(),name:"".concat((null==i||null==(l=i.user)?void 0:l.name)||""," ").concat((null==i||null==(t=i.user)?void 0:t.last_name)||""),icon:u})]}):(0,s.jsx)(y,{closeModal:d})})}},65426:(e,l,t)=>{"use strict";t.d(l,{H:()=>a,Z:()=>s});let s="drawer_menu_hamburger_close",a="checkbox_collapse_categories"},69656:(e,l,t)=>{"use strict";t.d(l,{A:()=>r});var s=t(50003),a=t(90963);let n=e=>{let{isOpen:l}=e;return(0,s.jsx)("svg",{viewBox:"0 0 24 24",width:"18",height:"18",stroke:"#222",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",className:"transition-all ease-in-out ".concat(l?"rotate-180 ":""),children:(0,s.jsx)("polyline",{points:"6 9 12 15 18 9"})})},r=e=>{let{placeHolder:l,disabled:t=!1,options:r,handleOnChange:i,valueSelected:c}=e,[o,d]=(0,a.useState)(!1),[u,x]=(0,a.useState)(null),m=(0,a.useRef)(null);(0,a.useEffect)(()=>{let e=e=>{m.current&&!m.current.contains(e.target)&&d(!1)};return window.addEventListener("click",e),()=>{window.removeEventListener("click",e)}}),(0,a.useEffect)(()=>{c&&x(c)},[c]);let p=()=>{d(!o)},h=e=>{e.value!==(null==u?void 0:u.value)&&(x(e),i(e))},f=e=>!!u&&u.value===e.value&&u.label===e.label;return(0,s.jsxs)("div",{className:"relative rounded-[10px] cursor-pointer border border-gray_scale_4 z-20 ".concat(t&&"bg-gray_scale_10 text-gray_scale_8 cursor-not-allowed"),children:[(0,s.jsxs)("div",{ref:m,onClick:()=>!t&&p(),className:"flex justify-between items-center py-[12px] px-[16px]",children:[(0,s.jsx)("div",{className:"leading-[22px] ".concat(!u||0===u.length?"text-gray_scale_3":"text-tul_black"," ").concat(t&&"text-gray_scale_8"),children:u&&0!==u.length?u.label:l}),(0,s.jsx)(n,{isOpen:o})]}),o&&(0,s.jsx)("div",{className:"absolute translate-y-1 shadow-sm w-full rounded-[10px] overflow-auto max-h-[300px] z-[999] min-h-[50px] bg-tul_white",children:r.length>0?r.map(e=>(0,s.jsx)("div",{onClick:()=>h(e),className:" font-semibold cursor-pointer rounded-[10pxx] py-[12px] px-[16px] ".concat(f(e)?"selected text-primary_1 bg-complementary_6":"text-gray_scale_2 bg hover:bg-gray_scale_4 disabled:cursor-not-allowed"," ").concat(t&&"cursor-not-allowed"),children:e.label},e.value+"-"+e.label)):(0,s.jsx)("div",{className:"py-[12px] px-[16px] text-gray_scale_3 text-center",children:"Cargando ciudades..."})})]})}},73936:()=>{},74364:(e,l,t)=>{"use strict";t.d(l,{Z:()=>d});var s=t(50003),a=t(57746),n=t.n(a),r=t(90963),i=t(14415);let c=e=>{var l;let{origin:t,categorySelected:a}=e;return(0,s.jsxs)("div",{className:"w-[calc(100vw_-_350px)] xl:w-max rounded-xl !fixed top-0 flex !bg-tul_white shadow-lg flex-col left-[310px] p-0 h-[calc(100%_-_8px)] overflow-auto items-start mt-2 smallScreen:hidden",children:[(0,s.jsxs)("div",{className:"flex mr-auto items-center p-2 border-b border-gray_scale_6 w-full",children:[(0,s.jsx)(i.default,{width:34,he
1ight:34,uuid:a.category.uuid,imageUrl:null==(l=a.category.images)?void 0:l.small}),(0,s.jsx)("h3",{className:"mx-2.5 font-bold text-tul_black text-[16px]",children:a.category.name})]}),(0,s.jsx)("div",{className:"flex px-2.5 gap-5 flex-wrap",children:(e=>{let l=[];for(let t=0;t<e.length;t++){let s=t%4;l[s]||(l[s]=[]),l[s].push(e[t])}return l})(a.children).map((e,l)=>(0,s.jsx)("div",{className:"flex flex-col w-auto xl:w-[205px]",children:e.map(e=>{let{category:i,children:c}=e;return(0,s.jsxs)(r.Fragment,{children:[(0,s.jsx)(n(),{href:"/categories/".concat(a.category.slug,"/").concat(i.slug,"/products"),className:"font-bold mt-[10px] text-tul_black text-[16px] hover:text-secondary smallScreen:hidden",children:i.name}),c.map(e=>(0,s.jsx)(n(),{href:"/categories/".concat(a.category.slug,"/").concat(e.category.slug,"/products"),className:"flex my-[10px] text-tul_black hover:text-secondary",children:e.category.name},"".concat(t,"-").concat(e.category.uuid)))]},"".concat(t,"-").concat(i.uuid,"-").concat(l))})},"".concat(t,"-").concat(l)))})]})},o=e=>{var l;let{category:t,hasChildren:a,isMobile:n}=e,r=null==(l=t.images)?void 0:l.small;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsx)("div",{className:"bigScreen:w-[34px] bigScreen:h-[34px] smallScreen:w-[27px] smallScreen:h-[27px]",children:(0,s.jsx)(i.default,{width:34,height:34,imageUrl:r,style:{width:"100%",height:"auto"}})}),(0,s.jsx)("h5",{className:"smallScreen:text-[14px] font-light smallScreen:whitespace-normal line-clamp-2",children:t.name})]}),a?(0,s.jsx)("i",{className:"flex items-center justify-start soytul ".concat(n?"soytul-arrow_right_filled":"soytul-arrow_chevron_right_micro_outline text-[20px]")}):""]})},d=e=>{let{categorySelected:l,isMobile:t,origin:a,category:r,hasChildren:i}=e;return(0,s.jsxs)(s.Fragment,{children:[t?(0,s.jsx)("span",{className:"".concat((null==l?void 0:l.category.uuid)===r.uuid?"!text-secondary":""," px-0 justify-between !bg-transparent smallScreen:flex  smallScreen:items-center w-full"),children:(0,s.jsx)(o,{category:r,hasChildren:i,isMobile:!0})}):(0,s.jsx)(n(),{href:"/categories/".concat(r.slug,"/products"),className:"".concat((null==l?void 0:l.category.uuid)===r.uuid?"!text-secondary":""," px-0 justify-between !bg-transparent smallScreen:flex  smallScreen:items-center"),children:(0,s.jsx)(o,{category:r,hasChildren:i})}),(null==l?void 0:l.children.length)&&l.category.uuid===r.uuid?(0,s.jsx)(c,{categorySelected:l,origin:a}):""]})}},82648:(e,l,t)=>{"use strict";t.d(l,{WrapperDropdown:()=>b});var s=t(50003),a=t(4648),n=t(50771),r=t(75922),i=t(59382),c=t(58648),o=t(90963),d=t(57746),u=t.n(d),x=t(5950),m=t(99655),p=t(74364),h=t(59430),f=t(14415);let g=m.J;function j(e){let{categoriesMenu:l}=e,[t,a]=(0,o.useState)(g),[n,r]=(0,o.useState)(!1),i=(0,h.N)("(max-width: 768px)"),c=i?"mobile":"desktop";(0,o.useEffect)(()=>{l&&l.length>0&&(!t||t===g)&&a(l[0])},[l,t]);let d=e=>{e!==(null==t?void 0:t.category.uuid)&&a((null==l?void 0:l.find(l=>l.category.uuid===e))||{})},m=()=>{a(void 0);let e=document.activeElement;e&&(null==e||e.blur()),j(!0)},j=e=>{r(e),e||a(void 0)},b=(0,s.jsx)(s.Fragment,{children:l&&l.length>0?l.map(e=>{let{category:l,children:a}=e;return(0,s.jsx)("li",{onClick:m,onMouseEnter:()=>d(l.uuid),className:"text-[black] flex font-regular bg-transparent min-w-56 h-[45px] px-2",children:(0,s.jsx)(p.Z,{categorySelected:t,isMobile:i,origin:i?"mobile":"desktop",category:l,hasChildren:a.length>0})},"".concat(c,"-").concat(l.uuid,"-").concat(l.name))}):(0,s.jsx)("li",{className:"px-4 py-3 text-sm text-gray_scale_3",children:"Cargando categor\xedas..."})});return(0,s.jsxs)("div",{tabIndex:0,role:"button",className:"dropdown smallScreen:hidden ".concat(n?"":"dropdown-hover"),children:[(0,s.jsx)("div",{className:"flex gap-2",children:(0,s.jsxs)("div",{onMouseEnter:()=>j(!1),onClick:()=>j(!1),className:"flex gap-2 font-regular text-[14px] justify-center items-center smallScreen:text-[14px] smallScreen:w-[100%] smallScreen:justify-between",children:[(0,s.jsx)("span",{children:(0,s.jsx)(x.A,{id:"categories"})}),(0,s.jsx)("i",{className:"text-[30px] w-[22px] justify-end flex items-center h-[9px] soytul soytul-arrow_chevron_down_micro_outline relative"})]})}),(0,s.jsx)("div",{tabIndex:0,className:"dropdown-content menu w-[310px] max-h-[760px] p-0 pt-2 z-[9999]",children:(0,s.jsxs)("ul",{className:"w-full rounded-md bg-tul_white bigScreen:h-[calc(100vh_-_129px)] bigScreen:shadow-md bigScreen:overflow-y-auto smallScreen:py-2 ",children:[(0,s.jsx)("li",{className:"smallScreen:hidden px-2",children:(0,s.jsxs)(u(),{href:"/categories",className:"px-0 !bg-transparent",children:[(0,s.jsx)(f.default,{width:34,he
1ight:30,alt:"image-categories",imageUrl:"/assets/icons/materials-icon.webp",style:{width:"34px",height:"auto"}}),(0,s.jsx)("h3",{className:"font-semibold text-[black] text-[16px]",children:(0,s.jsx)(x.A,{id:"categories"})})]})}),(0,s.jsx)("div",{className:"divider m-0 smallScreen:hidden"}),b]})})]})}let b=e=>{var l,t;let{}=e,{data:o}=(0,i.useSession)(),d=!((null==o||null==(l=o.user)?void 0:l.login)&&!(null==o||null==(t=o.user)?void 0:t.addresses)),u=(0,r.WB)(o),x=(0,h.N)("(max-width: 768px)"),{data:m,isLoading:p}=(0,c.A)(!x&&u&&d?"plt/v1/catlg/agg/ctgrs":null,e=>new a.G(o).request({url:e,method:n.s.GET}).then(e=>e.json()));return(0,s.jsx)(j,{categoriesMenu:null==m?void 0:m.categories})}},83073:(e,l,t)=>{"use strict";t.r(l),t.d(l,{default:()=>o});var s=t(50003),a=t(5950),n=t(57746),r=t.n(n),i=t(14415),c=t(90963);function o(e){let{hasTicketsToPay:l}=e,[t,n]=(0,c.useState)(l);return t?(0,s.jsxs)("div",{className:"flex max-w-[500px] fixed top-20 right-8 bg-tul_white text-white p-4 px-6 rounded-lg shadow-lg z-50",children:[(0,s.jsx)("button",{className:"absolute top-4 right-4 text-gray_scale_2 text-[14px] font-bold",onClick:()=>n(!1),children:(0,s.jsx)("i",{className:"soytul soytul-close_filled"})}),(0,s.jsx)("div",{className:"flex items-center mr-3",children:(0,s.jsx)(i.default,{imageUrl:"/assets/img/creditul/payment-date.png",alt:"support",width:135,height:135})}),(0,s.jsxs)("div",{className:"items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-[22px] font-bold text-tul_black",children:(0,s.jsx)(a.A,{id:"yoHaveAnExpiredTicket"})}),(0,s.jsxs)("p",{className:"mt-1 text-gray_scale_2 text-[14px]",children:[(0,s.jsx)(a.A,{id:"yourTicketHasExpiredGoToTheTicketsSectionToReviewAndUpdateYourPayment"}),"."]})]}),(0,s.jsx)(r(),{href:"/ticket",className:"flex btn btn-sm btn-primary w-full h-[30px] m-1 pr-3",children:(0,s.jsx)("span",{className:"text-[14px]",children:(0,s.jsx)(a.A,{id:"seeTickets"})})})]})]}):null}},87067:(e,l,t)=>{"use strict";t.d(l,{default:()=>v});var s=t(50003),a=t(82135),n=t(90963),r=t(70581),i=t(5950),c=t(59382),o=t(14415);let d=e=>{let{title:l,words:t,search:a,handleClickElement:n,destination:r}=e,c=t.map(e=>{let l="string"==typeof e?e:e.name;return{title:null==l?void 0:l.replace(RegExp("(".concat(a.toLocaleLowerCase(),")"),"g"),"<strong>$1</strong>"),value:l}});return(0,s.jsxs)("div",{className:"w-full",children:[(0,s.jsx)("h1",{className:"font-bold text-base text-tul_black mb-2.5",children:(0,s.jsx)(i.A,{id:l})}),null==c?void 0:c.map((e,l)=>{var t;return(0,s.jsxs)("div",{className:"flex items-center mb-2.5 cursor-pointer w-full",onMouseDown:()=>{var l,t;return n({name:null!=(l=e.value)?l:"",slug:null!=(t=e.value)?t:"",destination:r})},children:[(0,s.jsx)(o.default,{imageUrl:"/assets/img/svg/search-grey.svg",uuid:"spinner-search-icon",width:15,height:10}),(0,s.jsx)("p",{className:"text-tul_black text-sm overflow-hidden text-nowrap text-ellipsis ml-2",children:(0,s.jsx)("span",{dangerouslySetInnerHTML:{__html:null!=(t=e.title)?t:""}})})]},"search-".concat(e,"-").concat(l,"}"))})]})};var u=t(1665);let x=e=>{var l;let{search:t,searches:a,handleClickElement:n,isLoading:r}=e,o=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h1",{className:"font-bold text-base text-tul_black mt-3 mb-2.5 w-full",children:(0,s.jsx)(i.A,{id:"results"})}),(0,s.jsx)("p",{className:"font-semibold text-center text-tul_black m-0 w-full",children:(0,s.jsx)("span",{className:"loading loading-spinner loading-md"})})]}),{data:x}=(0,c.useSession)();return r?o:(0,s.jsx)("div",{className:"w-full ".concat((null==x||null==(l=x.user)?void 0:l.login)&&"mt-3"),children:t.length<=2?(0,s.jsxs)("p",{className:"font-semibold text-center text-tul_black m-0 w-full",children:[(0,s.jsx)(i.A,{id:"continueTypingToSearch"}),"..."]}):(null==a?void 0:a.length)===0?(0,s.jsxs)("div",{className:"w-full",children:[(0,s.jsx)("h1",{className:"font-bold text-base text-tul_black mb-2.5",children:(0,s.jsx)(i.A,{id:"results"})}),(0,s.jsx)("p",{className:"font-semibold text-center text-tul_black m-0",children:(0,s.jsx)(i.A,{id:"thereAreNoResultsThatMatchTheFiltersYouApplied"})})]}):(0,s.jsx)(d,{words:a,search:t,title:"results",handleClickElement:n,destination:u.D.SEARCH_RESULST})})};var m=t(57746),p=t.n(m);let h=e=>{let{text:l}=e;return(0,s.jsxs)(p(),{href:"/my-favorites",className:"flex items-center bg-green_2 p-2 rounded-lg h-[30px] w-full",children:[(0,s.jsx)("i",{className:"flex text-xl soytul soytul-heart_filled text-primary_5 mr-[5px]"}),(0,s.jsxs)("p",{className:"text-tul_black",children:[" ",l]}),(0,s.jsx)("i",{className:"flex soytul soytul-chevron_right_filled  text-tul_black text-md mr-[5px] ml-auto"})]})};var f=t(89199),g=function(e){return e.SPECIFIC="specific",e.GENERIC="generic",e}({});let j=e=>{var l;let{handleClick:t,searches:a,search:n,isLoading:i,setIsOptionSelected:o,isOptionSelected:d}=e,{data:u}=(0,c.useSession)(),m=(0,r.A)();return(0,s.jsx)(f.default,{children:(0,s.jsxs)("div",{className:"absolute top-[35px] left-0 right-0 bg-tul_white max-h-[612px] z-[999] p-4 shadow-lg rounded-t-lg rounded-b-2xl overflow-auto smallScreen:max-h-[calc(100vh-100px)] customScreenPopupSearch:max-h-[calc(100vh-55px)] w-full overflow-unseen",children:[(0,s.jsxs)("div",{className:"mb-4 align-middle justify-center",children:[(0,s.jsx)("div",{className:"bigScreen:text-sm text-[12px] font-bold text-primary_1 mb-2 text-center",children:m.formatMessage({id:"notSureBrnadOrProductNameYouWantSearch"})}
1),(0,s.jsxs)("div",{className:"flex justify-around gap-2",children:[(0,s.jsxs)("button",{type:"button",className:"w-[50%] gap-2 bigScreen:text-[12px] text-[10px] flex justify-center items-center shadow-[0px_1px_4px_0px_#00000026] p-2 transition-all duration-100 rounded-lg text-gray_scale_1 ".concat(d===g.SPECIFIC&&"border border-light_success bg-background_3"),"aria-pressed":"false",tabIndex:0,onClick:()=>o(g.SPECIFIC),children:[m.formatMessage({id:"specificProducts"}),d===g.SPECIFIC&&(0,s.jsx)("i",{className:"flex bigScreen:text-[17px] text-[15px] soytul soytul-circle_check_filled text-primary_1"})]}),(0,s.jsxs)("button",{type:"button",className:"w-[50%] gap-2 bigScreen:text-[12px] text-[10px] flex justify-center items-center shadow-[0px_1px_4px_0px_#00000026] p-2 transition-all duration-100 rounded-lg text-gray_scale_1 ".concat(d===g.GENERIC&&"border border-light_success bg-background_3"),"aria-pressed":"true",tabIndex:0,onClick:()=>o(g.GENERIC),children:[m.formatMessage({id:"genericProducts"}),d===g.GENERIC&&(0,s.jsx)("i",{className:"flex bigScreen:text-[17px] text-[15px] soytul soytul-circle_check_filled text-primary_1"})]})]})]}),(null==u||null==(l=u.user)?void 0:l.login)&&(0,s.jsx)(h,{text:m.formatMessage({id:"goToMyShoppingList"})}),d===g.SPECIFIC&&(0,s.jsx)(x,{search:n,searches:a,isLoading:i,handleClickElement:e=>t(e)})]})})};var b=t(44349),y=t(2547);function v(){var e;let{data:l}=(0,c.useSession)(),t=(0,n.useRef)(null),i=(0,n.useRef)(null),[o,d]=(0,n.useState)(""),[x,m]=(0,n.use
1State)([]),[p,h]=(0,n.useState)(!1),[f,v]=(0,n.useState)(!1),{isSection:_,section:w,isFilterBySection:N,setIsFilterBySection:S}=(0,n.useContext)(b.o),k=(0,a.useRouter)(),[A,C]=(0,n.useState)(g.SPECIFIC),E=(0,a.useSearchParams)();(0,n.useEffect)(()=>{O(o)},[N]);let I=e=>{var l,t;return A===g.GENERIC?"/generic-search?search=".concat(encodeURI(e)):N?"/search-results?search=".concat(encodeURI(e),"&type=").concat(null==w?void 0:w.type,"&uuid=").concat(null==w?void 0:w.uuid,"&name=").concat(encodeURI(null!=(l=null==w?void 0:w.name)?l:""),"&link=").concat(encodeURI(null!=(t=null==w?void 0:w.link)?t:"")):"/search-results?search=".concat(encodeURI(e))};(0,n.useEffect)(()=>{try{var e,t,s,a,n;(!(null==l||null==(e=l.user)?void 0:e.login)||(null==l||null==(t=l.user)?void 0:t.login)&&(null==l||null==(s=l.user)?void 0:s.addresses))&&(null==l||null==(a=l.user)?void 0:a.id_token)&&d(null!=(n=null==E?void 0:E.get("search"))?n:"")}catch(e){}},[null==l||null==(e=l.user)?void 0:e.id_token]);let L=e=>{("Enter"===e.code||"NumpadEnter"===e.code)&&(e.preventDefault(),v(!1),k.push(I(o)))},M=(0,r.A)(),T=(0,n.useRef)(null),O=e=>{if(A===g.GENERIC){m([]),d(e);return}d(e),T.current&&clearTimeout(T.current),e.length>=3?T.current=setTimeout(()=>{D(e)},300):m([])},R=e=>{var l;if(T.current&&clearTimeout(T.current),D(e.name),d(null!=(l=null==e?void 0:e.name)?l:""),v(!1),e.destination===u.D.DETAIL_PRODUCT)return void k.push("/details-product/".concat(e.slug));k.push(I(e.name))},D=async e=>{h(!0);let l=N&&{facetFilters:["".concat(null==w?void 0:w.type,".uuid:").concat(null==w?void 0:w.uuid)]},t=g.GENERIC===A;(0,y.le)(e,l,t).then(e=>{let{results:s}=e,a=[];if(l&&"object"==typeof l&&"facetFilters"in l||t)a=(null==s?void 0:s[0]).hits;else{var n;a=null==(n=(null==s?void 0:s[0]).hits)?void 0:n.map(e=>e.query)}m(a)}).finally(()=>{h(!1)})};return(0,n.useEffect)(()=>{function e(e){i.current&&!i.current.contains(e.target)&&v(!1)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[i]),(0,s.jsxs)("div",{className:"rounded-[30px] flex items-center bg-accent h-[32px] w-full pl-3 smallScreen:h-[40px] b
1igScreen:w-[600px] relative smallScreen:my-1.5",children:[(0,s.jsx)("i",{className:"flex soytul soytul-search_filled text-[24px] text-primary_2 smallScreen:text-[20px]"}),(0,s.jsx)("input",{autoComplete:"off",id:"search_box_text",ref:t,type:"text",spellCheck:"false",autoCorrect:"off",autoCapitalize:"off",value:o,onClick:()=>v(!0),onFocus:()=>v(!0),onKeyDown:e=>L(e),onChange:e=>O(e.target.value),placeholder:N?M.formatMessage({id:"searchInXXX"},{section:null==w?void 0:w.name}):M.formatMessage({id:"searchInTul"}),className:"input w-full h-[20px] text-[black] text-[14px] focus:outline-none smallScreen:h-[30px] px-1 border-0 pl-[13px] smallScreen:pl-0"}),o&&(0,s.jsx)("button",{className:"mr-2 w-[35px] h-[28px] cursor-pointer rounded-[20px] bg-primary_2 flex items-center justify-center",onClick:()=>{v(!1),k.push(I(o))},children:(0,s.jsx)("i",{className:"soytul soytul-search_filled text-primary_1  smallScreen:text-[21px] relative top-[3px]"})}),_&&(null==w?void 0:w.uuid)&&(0,s.jsxs)("div",{className:"w-max bg-gray_scale_4 flex items-center justify-center h-full rounded-r-[30px] pl-2 pr-5 border-l-[1px] border-gray_scale_3",children:[(0,s.jsx)("input",{type:"checkbox",className:"checkbox mr-2 !h-[16px] !w-[16px]",checked:N,onChange:e=>S(!N)}),(0,s.jsx)("span",{className:"w-max text-tul_black text-[12px] line-clamp-1 overflow-ellipsis max-w-[219px] whitespace-nowrap smallScreen:max-w-[119px] block",children:M.formatMessage({id:"inXXX"},{value:null==w?void 0:w.name})})]}),f&&(0,s.jsx)("div",{ref:i,children:(0,s.jsx)(j,{handleClick:e=>R(e),setIsOptionSelected:C,isOptionSelected:A,searches:x,search:o,isLoading:p})})]})}},95683:(e,l,t)=>{"use strict";t.d(l,{default:()=>m});var s=t(50003),a=t(34348),n=t(57746),r=t.n(n),i=t(21099),c=t(39016),o=t(59382),d=t(5950);function u(){return(0,s.jsxs)("button",{onClick:()=>{localStorage.clear(),c.A.reset(),(0,o.signOut)({callbackUrl:"/",redirect:!0})},className:"rounded-none focus:bg-gray_scale_5 px-[12px] py-[5px] flex items-center gap-2 w-full text-left",children:[(0,s.jsx)("i",{className:"text-[16px] flex soytul soytul-logout_outline relative"}),(0,s.jsx)(d.A,{id:"logout"})]})}var x=t(90963);function m(){var e,l;let{data:t}=(0,o.useSession)(),n=null==t||null==(e=t.user)?void 0:e.login,[c,m]=(0,x.useState)(!1),p=(0,x.useRef)(null),h=(()=>{var e;switch(null==t||null==(e=t.user)?void 0:e.client_type){case a.D.B2B:return"soytul soytul-store_outline text-primary_3";case a.D.B2P:return"soytul soytul-gloves_outline text-green_2";case a.D.B2C:return"soytul soytul soytul-user_check_outline text-tul_white";default:return"soytul soytul-store_filled"}})();return(0,x.useEffect)(()=>{function e(e){p.current&&!p.current.contains(e.target)&&m(!1)}return c&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[c]),(0,s.jsx)(s.Fragment,{children:n?(0,s.jsxs)("div",{ref:p,className:"dropdown smallScreen:hidden min-w-[210px]",children:[(0,s.jsxs)("div",{tabIndex:0,role:"button",className:"text-[12px]  text-tul_white flex flex-col cursor-pointer gap-1 items-start",onClick:()=>m(!c),children:[(0,s.jsxs)("div",{className:"flex flex-row justify-center gap-[5px] text-[12px] bigScreen:text-[14px] font-bold",children:[(0,s.jsx)("i",{className:"text-[16px] flex ".concat(h)}),(0,s.jsxs)("span",{children:[(0,s.jsx)(d.A,{id:"hello"}),", ",null==t||null==(l=t.user)?void 0:l.name]})]}),(0,s.jsx)("div",{className:"smallScreen:hidden bigScreen:block",children:(0,s.jsx)(i.CreditAvailable,{})})]}),c&&(0,s.jsxs)("ul",{tabIndex:0,className:"dropdown-content menu z-[1] bg-tul_white rounded-[4px] w-full p-0 text-gray_scale_1 text-[12px] min-w-[190px] shadow-md",children:[(0,s.jsx)("li",{id:"profile-user",children:(0,s.jsxs)(r(),{href:"/my-account/information",className:"rounded-none focus:bg-gray_scale_5 px-[12px] py-[5px]",children:[(0,s.jsx)("i",{className:"text-[16px] flex soytul soytul-user_outline relative"})," ",(0,s.jsx)(d.A,{id:"profile"})]})}),(0,s.jsx)("li",{id:"help-user",children:(0,s.jsxs)(r(),{href:"/my-account/support",className:"rounded-none focus:bg-gray_scale_5 px-[12px] py-[5px] ",children:[(0,s.jsx)("i",{className:"text-[16px] flex soytul soytul-headphones_outline relative"}),(0,s.jsx)(d.A,{id:"help"})]})}),(0,s.jsx)("li",{id:"coupons",children:(0,s.jsxs)(r(),{href:"/coupons",className:"rounded-none focus:bg-gray_scale_5 px-[12px] py-[5px] ",children:[(0,s.jsx)("i",{className:"text-[16px] flex soytul soytul-coupon_outline relative"}),(0,s.jsx)(d.A,{id:"coupons"})]})}),(0,s.jsx)("li",{id:"logout-user",children:(0,s.jsx)(u,{})})]})]}):(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(r(),{href:"/login","aria-label":"Login",className:"btn btn-sm btn-secondary text-primary_4 !h-[32px] min-w-[172px] smallScreen:min-w-[101px] !p-0 font-medium text-[14px] leading-[19px] smallScreen:mr-2",children:(0,s.jsx)(d.A,{id:"enterTUL"})})})})}}}]);

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.