PageSourceSearch

https://www.homedepot.com.mx/_next/static/chunks/19546.4cb6fe5dc1867ed1.js

js homedepot.com.mx collected 2026-09-24 17:16:29 UTC 13,573 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[19546],{46518:function(e,t,r){r.d(t,{QL:function(){return A},Yn:function(){return f},ai:function(){return d},ps:function(){return v},yv:function(){return c}});var n=r(50516),o=r(56913),l=r(71843),i=r.n(l),a=r(24350),u=r.n(a);let d=e=>async(t,r,n)=>{try{return await (0,o.Z)(e).cartGetUsableShippingInfo(t,r,n)}catch(e){throw console.log(e),e}},s={},c=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s,n=arguments.length>3?arguments[3]:void 0;return await (0,o.Z)(!0).shippingInfoUpdateOrderShippingInfo(e,t,r,n)},v=(e,t)=>{var r,o;let l=u()(null!=t?t:[],"orderItemId"),a=null!==(o=null==e?void 0:null===(r=e.orderItem)||void 0===r?void 0:r.filter(e=>{let{orderItemId:r}=e;return!t||l[r]}).map(e=>{let{usableShippingMode:t}=e;return null!=t?t:[]}))&&void 0!==o?o:[];return i()(...a,"shipModeId").filter(e=>e.shipModeCode!==n.Do)},f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=u()(r,"orderItemId"),o=u()(t,"addressId"),{orderItem:l=[]}=e,a=l.filter(e=>{let{orderItemId:t}=e;return n[t]}).map(e=>{let{usableShippingAddress:t=[]}=e;return t});return i()(...a,"addressId").filter(e=>{let{addressId:t}=e;return!!o[t]}).map(e=>({...e,...o[e.addressId]}))},A=(e,t)=>{var r,o;let l=null==t?void 0:t[e.orderItemId],i=null!==(r=null==l?void 0:l.usableShippingAddress)&&void 0!==r?r:[],a=null!==(o=null==l?void 0:l.usableShippingMode)&&void 0!==o?o:[];return i.some(t=>{let{addressId:r}=t;return r===e.addressId})&&a.some(t=>{let{shipModeId:r,shipModeCode:o}=t;return o!==n.Do&&r===e.shipModeId})}},86316:function(e,t,r){r.d(t,{$:function(){return i}});var n=r(85239),o=r(433);let l={[n.fq]:!0},i=(0,o.b)(l)},92131:function(e,t,r){r.d(t,{E:function(){return i}});var n=r(54294),o=r(59573),l=r(82995);let i=function(e){var t,r,i;let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n._C;return(null==e?void 0:null===(i=e.error)||void 0===i?void 0:null===(r=i.errors)||void 0===r?void 0:null===(t=r.at(0))||void 0===t?void 0:t.errorKey)===o.Zl?{type:o.QS.shippingInfo,messageKey:a===n._C?o.NK:o.ph}:(0,l.wY)(e)}},13277:function(e,t,r){r.d(t,{k:function(){return C}});var n=r(54141),o=r(47898),l=r(63625),i=r(61305),a=r(5953),u=r(91154),d=r(50383),s=r(90099),c=r(42452),v=r(30448),f=r(40703),A=r(79384),p=r(81354),E=r(67294),h=r(50877),m=r(4361),S=r(34253);let T=[/^\/$/,/^\/p\/.*/,/^\/g\/.*/,/^\/HDM-B2C-Store\/p\/.*/,/^\/login(?:\/.*)?$/,/^\/signup(?:\/.*)?$/,/^\/cart(?:\/.*)?$/,/^\/checkout(?:\/.*)?$/,/^\/thank-you(?:\/.+)?$/,/^\/account(?:\/.*)?$/,/^\/b(?:\/.*)?$/,/^\/s(?:\/.*)?$/,/^\/compare-products(?:\/.*)?$/,/^\/folleto-promociones(?:\/.*)?$/,/^\/ayuda(?:\/.*)?$/,/^\/promociones(?:\/.*)?$/],g=[/^\/folleto-promociones(?:\/.*)?$/,/^\/ayuda(?:\/.*)?$/,/^\/promociones(?:\/.*)?$/],I={[m.Sd]:S.M,[m.mo]:S.Gi,[n.$L]:S.YK},y=new Set([S.Bp.PRODUCT_PAGE,S.Bp.KIT_PAGE]),_=new Set([S.Bp.CATEGORY_LAND_PAGE,S.Bp.PLP]),C=()=>{var e,t;let{state:r,dispatch:n}=(0,u.oH)(),C=r.isFetching,D=r.emarsysSearchTagData,R=r.emarsysCategoryTagData,M=r.emarsysPDPTagData,P=r.emarsysTYPTagData,L=r.emarsysWidgetType,b=r.hdmEmarsysBundleItemsReady,{settings:x}=(0,c.Wq)(),{orderItems:w}=(0,a.jD)(),{storeLocator:G}=(0,v.m)(),{user:N,loading:U}=(0,f.aF)(),O=null==N?void 0:N.userId,k=G.selectedStore.id,{stLocId:Y}=(0,A.d5)(k),$=null!==(t=null==N?void 0:N.isLoggedIn)&&void 0!==t&&t,Q=null==N?void 0:N.email,[F,Z]=(0,E.useState)([]),[H,B]=(0,E.useState)(!1),[q,K]=(0,E.useState)(!1),[W,j]=(0,E.useState)(!1),[V,z]=(0,E.useState)(!1),J=(0,s.ql)("Routes"),X=(0,i.Ms)(),{data:ee}=(0,d.$)(),et=(0,E.useMemo)(()=>{try{let e=X.asPath;if(e.startsWith(S.Z.PRODUCT_PAGE))return decodeURI(e.split(S.Z.PRODUCT_PAGE)[1]);if(e.startsWith(S.Z.BUNDLE_PAGE))return decodeURI(e.split(S.Z.BUNDLE_PAGE)[1]);if(e.startsWith(S.Z.CATALOG_PAGE))return decodeURI(e.split(S.Z.CATALOG_PAGE)[1]);if(e&&e.split(h.xH).length>0)return decodeURI(e.split(h.xH)[1]);return""}catch(e){return console.error("[EmarsysTag] error decoding URI",e),""}},[X.asPath]),er=(0,E.useMemo)(()=>{let e=[];return Object.entries(J).forEach(t=>{let[r,n]=t;try{let t=decodeURI(n.route.t());t!==o.v6&&e.push(t)}catch(e){console.error("[EmarsysTag] error decoding URI",e)}}),e},[J]),en=(null===(e=x.userData)||void 0===e?void 0:e[h.Ml])==="true",eo=void 0!==x.userData,el=(0,E.useMemo)(()=>en?[S.xA.AVL_ZONE,S.xA.CART,S.xA.SET_CUSTOMERID]:[S.xA.AVL_ZONE,S.xA.CART,S.xA.SET_EMAIL],[en]),ei=(0,E.useMemo)(()=>en?[S.xA.AVL_ZONE,S.xA.CART,S.xA.SET_CUSTOMERID,S.xA.PURCHASE]:[S.xA.AVL_ZONE,S.xA.CART,S.xA.SET_EMAIL,S.xA.PURCHASE],[en]),ea=(e,t)=>{if(!e)return!1;try{let r=new URL(e,window.location.origin).pathname;return t.some(e=>e.test(r))}catch(e){return!1}},eu=e=>p.SHA256(e).toString(p.enc.Hex),ed=(0,E.useCallback)(e=>{if(I[e]){Z(I[e]);return}if(e===m.iK){Z(el);return}if(e===m.dW&&P){Z(ei);return}et!==l.tI.Search&&(er.includes(et)||ea(window.location.pathname,g))&&Z(S.M)},[er,et,P]),es=(0,E.useCallback)(e=>{if(y.has(e)&&!M)return!0;let t=et===l.tI.Search;return!!(e===S.Bp.PLP&&t&&!D||_.has(e)&&!t&&!R)||e===S.Bp.THANK_U_PAGE&&!P},[M,D,R,P,et]),ec=(0,E.useCallback)(e=>es(e)?null:P?ei:(0,S.l6)(e,et),[es,P,ei,et]),ev=(0,E.useCallback)(()=>
1({availabilityZone:Y?[S.xA.AVL_ZONE,Y]:void 0,setEmail:!$&&Q?[S.xA.SET_EMAIL,Q]:void 0,setCustomerId:en&&O&&!$?[S.xA.SET_CUSTOMERID,eu(O)]:void 0}),[Y,$,Q,en,O]),ef=(0,E.useCallback)(e=>{var t;return null!==(t=({searchTerm:null==D?void 0:D.searchTerm,tagSearch:null==D?void 0:D.tag,tagCategory:null==R?void 0:R.tag,category:null==R?void 0:R.category,view:null==M?void 0:M.view,exclude:null==M?void 0:M.exclude,purchase:null==P?void 0:P.purchase})[e])&&void 0!==t?t:ev()[e]},[D,R,M,P,ev]),eA=(0,E.useCallback)(e=>{if(!C&&(e[S.xA.CART]=[S.xA.CART,[]],(null==w?void 0:w.length)>0)){let t=[];w.forEach(e=>{var r,n;let o={item:null==e?void 0:e.partNumber,price:parseFloat(e.orderItemPrice),quantity:parseInt(e.quantity)};(null==e?void 0:null===(r=e.partNumber)||void 0===r?void 0:r.includes(h.jF.SERVICE_INSTALLATION))||(null==e?void 0:null===(n=e.partNumber)||void 0===n?void 0:n.includes(h.jF.TECHNICAL_VISIT))||t.push(o)}),e[S.xA.CART]=[S.xA.CART,t]}return e},[w,C]),ep=(0,E.useCallback)(e=>{var t;return(null==x?void 0:null===(t=x.userData)||void 0===t?void 0:t[h.Ml])==="true"?$&&!e[S.xA.SET_CUSTOMERID]&&O&&(e[S.xA.SET_CUSTOMERID]=[S.xA.SET_CUSTOMERID,eu(O)]):$&&!e[S.xA.SET_EMAIL]&&(Q&&Q!==o.v6||void 0!==Q)&&(e[S.xA.SET_EMAIL]=[S.xA.SET_EMAIL,Q]),eA(e)},[x.userData,$,Q,O,eA]),eE=(0,E.useMemo)(()=>{let e={};return(null==F?void 0:F.length)>0&&H&&F.forEach(t=>{t&&void 0!==ef(t)&&(e[t]=ef(t))}),ep(e)},[ef,F,H,ep]),eh=(0,E.useCallback)(function(e){var t,r,o,l;let i=!(arguments.length>1)||void 0===arguments[1]||arguments[1];null!==e&&((null==x?void 0:null===(t=x.userData)||void 0===t?void 0:t[h.Ml])==="true"&&(null==x?void 0:null===(r=x.userData)||void 0===r?void 0:r[h.dQ])==="true"&&window.ScarabQueue.push(["testMode"]),window.ScarabQueue.push(e)),i&&(B(!1),j(!0),ee&&""!==et&&((null===(o=ee.layout)||void 0===o?void 0:o.containerName)===S.Bp.PRODUCT_PAGE||(null===(l=ee.layout)||void 0===l?void 0:l.containerName)===S.Bp.KIT_PAGE)&&n({type:"EMARSYS_PDP_TAG_FINISHED",payload:S.Bp.PRODUCT_PAGE}))},[null==x?void 0:x.userData,et,ee,n]),em=(0,E.useCallback)(()=>{var e;let t=!0;(null==F?void 0:F.length)>
10&&(F.forEach(e=>{eE[e]||(t=!1)}),$&&(null==x?void 0:null===(e=x.userData)||void 0===e?void 0:e[h.Ml])==="true"?eE[S.xA.SET_CUSTOMERID]||(t=!1):$&&!eE[S.xA.SET_EMAIL]&&(t=!1),t&&(Object.keys(eE).forEach(e=>{e!==S.xA.CART&&eh(eE[e],!1)}),eh(null,!0)))},[eh,$,x.userData,eE,F]);(0,E.useEffect)(()=>{(ea(window.location.pathname,T)||L&&L.executed&&L.count>=0)&&K(!0)},[L]),(0,E.useEffect)(()=>{Z([]),B(!0),ed(location.pathname),z(!1),j(!1)},[X.pathname,ed]),(0,E.useEffect)(()=>{location.pathname===m.iK&&Z(el)},[el]),(0,E.useEffect)(()=>{location.pathname===m.dW&&P&&Z(ei)},[ei,P]),(0,E.useEffect)(()=>{var e;if(!(null==ee?void 0:null===(e=ee.layout)||void 0===e?void 0:e.containerName))return;let t=ec(ee.layout.containerName);null!==t&&Z(t)},[ee,ec]),(0,E.useEffect)(()=>{(null==F?void 0:F.length)>0&&H&&q&&!V&&!U&&eo&&(z(!0),setTimeout(()=>{em()},2e3))},[U,eE,H,q,b]),(0,E.useEffect)(()=>{if(!W)return;let e=[];null==w||w.forEach(t=>{var r;let n=parseFloat(t.orderItemPrice).toFixed(2),o={item:null==t?void 0:t.partNumber,price:parseFloat(n),quantity:parseInt(t.quantity)};(null==t?void 0:null===(r=t.partNumber)||void 0===r?void 0:r.includes(h.jF.SERVICE_INSTALLATION))||e.push(o)});let t=[S.xA.CART,e];window.ScarabQueue.push(t),window.ScarabQueue.push(["go"])},[null==w?void 0:w.length,W]);let eS=(0,E.useCallback)(()=>{["EMARSYS_CATEGORY_TAG_DATA","EMARSYS_PDP_TAG_DATA","EMARSYS_TYP_TAG_DATA","EMARSYSCARRUSEL_ADDITIONAL_READY","EMARSYSCARRUSEL_REGULAR_READY","EMARSYSBUNDLE_ITEMS_READY","EMARSYS_SEARCH_TAG_DATA"].forEach(e=>{n({type:e,payload:null})})},[n]);(0,E.useEffect)(()=>{!1===H&&eS()},[H,eS])}},25169:function(e,t,r){r.d(t,{Ln:function(){return f},iM:function(){return p},mo:function(){return A}}),r(79287);var n=r(53019),o=r(9282),l=r(61305),i=r(42452);r(88870);var a=r(2069);r(42501),r(30123);var u=r(23605),d=r(21163);r(85508);var s=r(63477),c=r(95591);let v=(e,t)=>({storeId:e,orderId:t}),f=e=>async(t,r,n,o)=>await (0,s.N4)(e).deliveryDetails(t,r,n,o),A=(e,t)=>{let{settings:r}=(0,i.Wq)(),s=(0,l.Ms)(),{storeId:A}=(0,a.H)(r,s),p=(0,o.G)(),E=v(A,e),{data:h,error:m,isLoading:S}=(0,c.ZP)(A?[(0,u.F)(E),n.u6]:null,()=>f(!0)(A,e,t,p),{use:[d.k]});return{orderDeliveryDetails:h,error:m,isLoading:S}},p=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return f(!0)(e,t,r,n)}},22303:function(e,t,r){r.d(t,{n:function(){return a},v:function(){return i}});var n=r(38722),o=r(41063),l=r(51199);let i=e=>{let t=e.items,r=t.filter(e=>{var t;let r=null===(t=e.promotionDetails)||void 0===t?void 0:t.promotionData;return(null==r?void 0:r.field1)===o.LY});if(0===r.length)return e;let i=new Set,a=new Set,u=new Map,d=new Map;r.forEach(t=>{var r,o,s;let c=null===(r=t.promotionDetails)||void 0===r?void 0:r.promotionData;if(!c||!0!==c.active||(null===(o=c.physicalStores)||void 0===o?void 0:o.find(t=>t===e.physicalStoreId))===void 0||!c.giftCatentries||!c.PromotionName)return;c.giftCatentries.forEach(e=>i.add(e)),a.add(c.PromotionName);let v=(0,n.i)(null===(s=t.promotionDetails)||void 0===s?void 0:s.combinablePromotions);v&&(d.set((0,l.Lg)(t.product),v),c.giftCatentries.forEach(e=>u.set(e,v)))});let s=new Set,c=new Map;t.forEach(e=>{let t=(0,l.Lg)(e.product);if(!e.product.adjustments||!i.has(e.product.id))return;let r=e.product.adjustments.map(e=>e.code).filter(e=>!!e&&a.has(e));0!==r.length&&(s.add(t),c.set(t,new Set(r)))});let v=t.map(e=>{var t;let r=(0,l.Lg)(e.product),n=s.has(r),o=null!==(t=n?u.get(e.product.id):void 0)&&void 0!==t?t:d.get(r);if(!n&&!o)return e;let i=e.product,a=n?c.get(r):void 0,v={...i,...n?{isGift:!0}:{},...a?{freeGiftPromotionCodes:[...a]}:{},...o?{promoThdCode:o}:{}};return{...e,product:v}});return{...e,items:v}},a=e=>{let{productCatentryId:t,removeQuantity:r,cartItems:l,cartItemsPromotionDetails:i,physicalStoreId:a}=e,u=new Set,{bestFreeQty:d,bestTotalGiftQty:s,bestPromoDetails:c}=Array.from(i.values()).reduce((e,r)=>{var n;if(!r.promotionData)return e;let i=r.promotionData.PromotionName;if(i&&u.has(i))return e;i&&u.add(i);let d=r.promotionData;if(d.field1!==o.LY||!0!==d.active||!(null===(n=d.physicalStores)||void 0===n?void 0:n.includes(a)))return e;let s=d.giftCatentries;if(!(null==s?void 0:s.includes(t)))return e;let c=d.baseQty,v=d.giftQty;if(!c||!v)return e;let f=d.relatedCatentries,A=new Set(null!=f?f:[]),p=Math.floor(l.filter(e=>A.has(e.productId)).reduce((e,t)=>
1e+parseFloat(t.quantity),0)/c);if(p<=0)return e;let E=new Set(s),h=l.filter(e=>E.has(e.productId)).reduce((e,t)=>e+parseFloat(t.quantity),0),m=Math.min(Math.floor(h/v),p)*v;return m>e.bestFreeQty?{bestFreeQty:m,bestTotalGiftQty:h,bestPromoDetails:r}:e},{bestFreeQty:0,bestTotalGiftQty:0});if(d<=0)return{isGift:!1,freeQty:void 0};let v=Math.max(0,r-(s-d));if(v<=0)return{isGift:!1,freeQty:void 0};let f=(0,n.i)(null==c?void 0:c.combinablePromotions);return{isGift:!0,freeQty:String(v),promoThdCode:f}}},58182:function(e,t,r){r.d(t,{e:function(){return l}});var n=r(81240),o=r(50877);let l=e=>{var t,r,l;let[i]=(0,n.fP)([o.Mg]),a=null==i?void 0:null===(t=i.geoLocationHDP)||void 0===t?void 0:t.stLocId;return(null==i?void 0:null===(r=i.geoLocationHDP)||void 0===r?void 0:r.hasPreviousAnswer)&&a?{physicalStoreId:a}:{physicalStoreId:null!==(l=null==e?void 0:e.defaultPhysicalStoreId)&&void 0!==l?l:null}}},35701:function(e,t,r){r.d(t,{g:function(){return i}});var n=r(67294),o=r(50877);let l=[o.oS,o.yr],i=()=>{let[e,t]=(0,n.useState)(!0),[r,o]=(0,n.useState)(!0),i=(0,n.useCallback)(()=>{var e;if(!(null===(e=navigator)||void 0===e?void 0:e.permissions)){o(!1);return}navigator.permissions.query({name:"geolocation"}).then(e=>{t(l.includes(e.state))}).finally(()=>{o(!1)})},[]);return(0,n.useEffect)(()=>{i()},[i]),{enableGeolocButton:e,isLoadingGeoLocResponse:r,validateGeolocationStatus:i,setEnableGeolocButton:t}}},4361:function(e,t,r){r.d(t,{$L:function(){return l},DT:function(){return u},Sd:function(){return n},dW:function(){return a},iK:function(){return i},mo:function(){return o}});let n="/",o="/s",l="/cart",i="/checkout",a="/thank-you",u="".concat("/account","/orders")}}]);
2//# sourceMappingURL=19546.4cb6fe5dc1867ed1.js.map

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.