PageSourceSearch

https://nomophone.com/_next/static/chunks/shared-product-compare-context-76020ab8fbf8aa3a.js

js nomophone.com collected 2026-10-08 09:13:11 UTC 1,550 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunk_N_E=globalThis.webpackChunk_N_E||[]).push([[79966],{59074:(e,t,a)=>{a.d(t,{C:()=>s,G:()=>i});var r=a(95155),l=a(12115);let c=(0,l.createContext)(void 0),o="b2c_compare_products",u="b2c_listing_compare_mode_enabled";function s({children:e}){let[t,a]=(0,l.useState)([]),[i,d]=(0,l.useState)(!1),[n,b]=(0,l.useState)(!1),[p,C]=(0,l.useState)(!1);(0,l.useEffect)(()=>{try{let e=localStorage.getItem(o);if(e){let t=JSON.parse(e);Array.isArray(t)&&a(t.slice(0,2))}let t=localStorage.getItem(u);"true"===t&&C(!0)}catch{}finally{d(!0)}},[]),(0,l.useEffect)(()=>{if(i)try{localStorage.setItem(o,JSON.stringify(t))}catch{}},[t,i]);let f=(0,l.useCallback)(e=>t.some(t=>t.productId===e),[t]),m=(0,l.useCallback)(e=>{a(t=>t.filter(t=>t.productId!==e))},[]),g=(0,l.useCallback)(()=>{a([])},[]),h=(0,l.useCallback)(e=>{a(t=>t.some(t=>t.productId===e.productId)?t.filter(t=>t.productId!==e.productId):t.length>=2?t:[...t,e])},[]),k=(0,l.useCallback)(()=>{b(!0)},[]),S=(0,l.useCallback)(()=>{b(!1)},[]),I=(0,l.useCallback)(e=>{C(e);try{localStorage.setItem(u,String(e))}catch{}},[]),_=(0,l.useMemo)(()=>({compareProducts:t,isInCompare:f,toggleCompare:h,removeCompare:m,clearCompare:g,comparisonModalOpen:n,openComparisonModal:k,closeComparisonModal:S,listingCompareModeEnabled:p,setListingCompareModeEnabled:I}),[t,f,h,m,g,n,k,S,p,I]);return(0,r.jsx)(c.Provider,{value:_,children:e})}function i(){let e=(0,l.useContext)(c);if(void 0===e)throw Error("useProductCompare must be used within a ProductCompareProvider");return e}}}]);

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.