PageSourceSearch

https://www.customerlift.ai/_next/static/chunks/pages/select-audience/custom/product-313dc878a45f08e0.js

js customerlift.ai collected 2026-10-05 15:31:37 UTC 11,894 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[823],{1271:function(e,t,n){"use strict";var r,l=n(7294);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}t.Z=function(e){return l.createElement("svg",s({width:"1em",height:"1em",viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),r||(r=l.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m.95 10.95.707.707 4.95-4.95 4.95 4.95.706-.707L7.313 6l4.95-4.95-.707-.707-4.95 4.95-4.95-4.95-.706.707L5.9 6 .95 10.95Z",fill:"#000"})))}},7375:function(e,t,n){"use strict";var r,l=n(7294);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}t.Z=function(e){return l.createElement("svg",s({width:"1em",height:"1em",viewBox:"0 0 16 12",xmlns:"http://www.w3.org/2000/svg"},e),r||(r=l.createElement("path",{d:"M5.33 9.23 1.853 5.753.671 6.93l4.658 4.659 10-10L14.154.413 5.33 9.229Z",fill:"inherit"})))}},4414:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/select-audience/custom/product",function(){return n(5223)}])},4428:function(e,t,n){"use strict";n.d(t,{Z:function(){return x}});var r=n(5893),l=n(7294),s=function(e,t){let[n,r]=(0,l.useState)(e),[s,o]=(0,l.useState)(!1),a=(0,l.useRef)(!0);return(0,l.useEffect)(()=>{if(a.current){console.log("First update!"),a.current=!1;return}o(!0);let n=setTimeout(()=>{r(e),o(!1)},t||500);return()=>{clearTimeout(n)}},[e,t]),{debouncedValue:n,isLoading:s}},o=n(9580),a=n(9669),c=n.n(a),i=n(3165),d=n(5007),u=n(7375),m=n(4696),h=n(5187),p=e=>{let{label:t,placeholder:n,options:s,query:o,setQuery:a,selected:c,handleChange:p,isLoading:g,errorMsg:x}=e;return(0,r.jsx)("div",{children:(0,r.jsxs)(i.h,{value:c,onChange:e=>p(e),children:[(0,r.jsx)(i.h.Label,{className:"text-sm",children:t}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsxs)("div",{className:"w-full cursor-default overflow-hidden bg-white text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75 focus-visible:ring-offset-2 focus-visible:ring-offset-teal-300 sm:text-sm mt-2.5",children:[(0,r.jsx)(i.h.Input,{className:"w-full py-2 pl-3 pr-10 text-sm leading-5 focus:ring-0 border border-black",placeholder:n,displayValue:e=>{var t;return null!==(t=null==c?void 0:c.name)&&void 0!==t?t:""},onChange:e=>a(e.target.value),style:{height:50}}),(0,r.jsxs)(i.h.Button,{className:"absolute inset-y-0 right-0 flex flex-col items-center justify-center pr-2 mr-4",children:[(0,r.jsx)(m.Z,{className:"rotate-180"}),(0,r.jsx)(m.Z,{})]})]}),(0,r.jsx)(d.u,{as:l.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>a(""),children:(0,r.jsx)(i.h.Options,{className:"absolute mt-1 max-h-60 w-full overflow-auto rounded bg-white py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm z-20",children:g?(0,r.jsx)("div",{className:"py-2",children:(0,r.jsx)(h.Z,{height:25,width:25})}):x?(0,r.jsx)("p",{className:"text-red-400 text-sm py-2 px-4",children:x}):(null==s?void 0:s.length)===0&&""!==o?(0,r.jsx)("div",{className:"relative cursor-default select-none py-2 px-4 text-gray-700",children:"Nothing found."}):null==s?void 0:s.map(e=>(0,r.jsx)(i.h.Option,{className:e=>{let{active:t}=e;return"relative cursor-pointer select-none py-3 pl-10 pr-4 ".concat(t?"bg-myAvocado text-black":"text-gray-900")},value:e,children:t=>{let{selected:n,active:l}=t;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"block truncate ".concat(n?"font-medium":"font-normal"),children:e.name}),n?(0,r.jsx)("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 ".concat(l?"text-white":"text-teal-600"),children:(0,r.jsx)(u.Z,{})}):null]})}},e.id))})})]})]})})},g=n(5811),x=e=>{let{label:t,placeholder:n,urlPath:a,selected:i,handleChange:d}=e,[u,m]=(0,l.useState)(""),{debouncedValue:h,isLoading:x}=s(u,2e3),[f,y]=(0,l.useState)([]),[v,j]=(0,l.useState)("");return(0,l.useEffect)(()=>{j(""),(async()=>{try{let{data:e}=await c().get("".concat(o.z0,"/api/").concat(a,"?query=").concat(h,"&from_frontend=true"),{withCredentials:!0});console.log(e),y(e)}catch(n){var e,t;console.log(n),(0,g.I)(n)&&(null===(t=n.response)||void 0===t?void 0:null===(e=t.data)||void 0===e?void 0:e.message)?j(n.response.data.message):j("Whoops, something went wrong.")}})()},[h,a]),(0,r.jsx)("div",{children:(0,r.jsx)(p,{label:t,placeholder:n,query:u,setQuery:m,options:f,selected:i,handleChange:d,isLoading:x,errorMsg:v})})}},5223:function(e,t,n){"use strict";let r;n.r(t),n.d(t,{default:function(){return C}});var l=n(5893),s=n(7294),o=n(7508),a=n(7657),c=n(2298),i=n(3074),d=n(6884),u=n(3922),m=n(9580),h=n(4428),p=n(9008),g=n.n(p),x=n(9327),f=n(3675),y=n(8205),v=n(3670),j={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let b=new Uint8Array(16),w=[];for(let e=0;e<256;++e)w.push((e+256).toString(16).slice(1));var N=function(e,t,n){if(j.randomUUID&&!t&&!e)return j.randomUUID();let l=(e=e||{}).random||(e.rng||function(){if(!r&&!(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(b)})();if(l[6]=15&l[6]|64,l[8]=63&l[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=l[e];return t}return function(e,t=0){return(w[e[t+0]]+w[e[t+1]]+w[e[t+2]]+w[e[t+3]]+"-"+w[e[t+4]]+w[e[t+5]]+"-"+w[e[t+6]]+w[e[t+7]]+"-"+w[e[t+8]]+w[e[t+9]]+"-"+w[e[t+10]]+w[e[t+11]]+w[e[t+12]]+w[e[t+13]]+w[e[t+14]]+w[e[t+15]]).toLowerCase()}(l)},_=n(1271);function S(e){let{tags:t,handleDeleteTag:n}=e;return(0,l.jsx)("div",{className:"flex flex-wrap gap-2 justify-center",children:t.map(e=>(0,l.jsxs)("div",{className:"bg-myAqua border border-black py-4 px-6 rounded-full flex items-center gap-3 text-xs md:text-sm text-center",children:[e.text,(0,l.jsx)("button",{type:"button",onClick:n,value:e.id,children:(0,l.jsx)(_.Z,{})})]},e.id))})}var C=()=>{let e;
1let[t,n]=(0,s.useState)(""),{user:r,isLoading:p,errorMsg:j}=(0,u.Z)(m._e),{datePickerStartDate:b,datePickerEndDate:w,renderDatePicker:_,isDatePickerUserInputValid:C}=(0,f.Z)(),[T,Z]=(0,s.useState)(),[O,P]=(0,s.useState)(),[U,E]=(0,s.useState)(),[R,I]=(0,s.useState)([]),[D,k]=(0,s.useState)([]),[F,L]=(0,s.useState)([]),A=(e=[],D.length>0?e=D:F.length>0?e=F:R.length>0&&(e=R),e),[B,V]=(0,s.useState)(!0),H=T||O||U,[J,M]=(0,s.useState)(!1);function q(){return A.map((e,t)=>(console.log(t),0===t?(0,l.jsx)(c.Z,{children:e.name}):(0,l.jsxs)(l.Fragment,{children:[" OR ",(0,l.jsx)(c.Z,{children:e.name})]})))}return(0,s.useEffect)(()=>{0===A.length||(b||w)&&!C()?V(!0):V(!1)},[A,b,w,C]),(0,s.useEffect)(()=>{R.length>0?function(){let e=R.map(e=>e.id),t=R.map(e=>e.name),r=encodeURIComponent(JSON.stringify(e)),l=encodeURIComponent(JSON.stringify(t));n("/dashboard?selection_type=product&product_selection_type=product&values_arr=".concat(r,"&names_arr=").concat(l))}():T?function(){let e=D.map(e=>e.id),t=D.map(e=>e.name),r=encodeURIComponent(JSON.stringify(e)),l=encodeURIComponent(JSON.stringify(t));n("/dashboard?selection_type=product&product_selection_type=product_category&values_arr=".concat(r,"&names_arr=").concat(l))}():O&&n("/dashboard?selection_type=product&product_selection_type=product_type&values_arr="+encodeURIComponent(JSON.stringify(F.map(e=>e.name)))),J&&n(e=>e+"&order_number=1"),b&&w&&n(e=>"".concat(e,"&customer_date_min=").concat(encodeURIComponent((0,y.bm)(b)),"&customer_date_max=").concat(encodeURIComponent((0,y.bm)(w))))}),!r||p?(0,l.jsx)(d.Z,{errorMsg:j}):(console.log("Product: ",U),console.log("Cat: ",T),console.log("Type: ",O),console.log("ARRAYS:"),console.log(R),console.log(D),console.log(F),console.log("THE SELECTED VALS:"),console.log(A),console.log("DASH URL:"),console.log(t),(0,l.jsxs)("div",{className:"mt-14 flex flex-col grow justify-between lg:pb-16",children:[(0,l.jsx)(g(),{children:(0,l.jsx)("title",{children:"Select Audience | CustomerLift"})}),(0,l.jsxs)("div",{className:"container lg:flex lg:flex-col lg:grow lg:justify-between",children:[(0,l.jsx)(o.Z,{backHref:"/select-audience/custom",title:"Product or Product Type",description:"Select a Product or Product Type."}),(0,l.jsxs)("div",{className:"my-12 lg:mt-16 lg:mb-8",children:[(0,l.jsxs)("div",{className:"flex flex-col items-center",children:[(0,l.jsx)("div",{className:"max-w-md lg:max-w-full lg:w-[500px]",children:(0,l.jsx)(h.Z,{label:"PRODUCT CATEGORY",placeholder:"Begin typing a product category...",urlPath:"product/search/category",selected:T,handleChange:e=>{Z(e),P(void 0),E(void 0),k(t=>t.some(t=>t.id===e.id)?(console.log("Product category already selected."),t):[...t,e]),I([]),L([])}})}),(0,l.jsx)("div",{className:"".concat(D.length>0&&"mt-8"),children:(0,l.jsx)(S,{tags:D.map(e=>({id:e.id.toString(),text:e.name})),handleDeleteTag:function(e){let t=e.currentTarget.value;k(e=>e.filter(e=>e.id!==t))}})})]}),(0,l.jsx)("div",{className:"text-center my-6",children:"or"}),(0,l.jsxs)("div",{className:"flex flex-col items-center",children:[(0,l.jsx)("div",{className:"max-w-md lg:max-w-full lg:w-[500px]",children:(0,l.jsx)(h.Z,{label:"PRODUCT TYPE",placeholder:"Begin typing a product type...",urlPath:"product/search/type",selected:O,handleChange:e=>{Z(void 0),P(e),E(void 0),L(t=>t.some(t=>t.name===e.name)?(console.log("Product type already selected"),t):[...t,{id:N(),name:e.name}]),k([]),I([])}})}),(0,l.jsx)("div",{className:"".concat(F.length>0&&"mt-8"),children:(0,l.jsx)(S,{tags:F.map(e=>({id:e.id.toString(),text:e.name})),handleDeleteTag:function(e){let t=e.currentTarget.value;L(e=>e.filter(e=>e.id!==t))}})})]}),(0,l.jsx)("div",{className:"text-center my-6",children:"or"}),(0,l.jsxs)("div",{className:"flex flex-col items-center",children:[(0,l.jsx)("div",{className:"max-w-md lg:max-w-full lg:w-[500px]",children:(0,l.jsx)(h.Z,{label:"PRODUCT NAME",placeholder:"Begin typing a product name...",urlPath:"product/search",selected:U,handleChange:e=>{Z(void 0),P(void 0),E(e),I(t=>t.some(t=>t.id===e.id)?(console.log("Product already selected."),t):[...t,e]),k([]),L([])}})}),(0,l.jsx)("div",{className:"".concat(R.length>0&&"mt-8"),children:(0,l.jsx)(S,{tags:R.map(e=>({id:e.id.toString(),text:e.name})),handleDeleteTag:function(e){let t=e.currentTarget.value;I(e=>e.filter(e=>e.id.toString()!==t))}})})]})]}),(0,l.jsx)("div",{className:"my-10 flex justify-center",children:(0,l.jsx)(v.Z,{title:"Filter customers by date",children:_()})}),(0,l.jsx)(x.Z,{handleCheckboxChange:()=>M(e=>!e),labelText:"Only look at customers whose 1st purchase was this product/type/catagory.",myClasses:"mb-8 mt-8"}),(0,l.jsx)(a.Z,{nextPageHref:t,btnDisabled:B,children:(0,l.jsxs)("span",{children:["I want to build an audie
1nce based on customers who ordered"," ",A.length>0?(0,l.jsxs)(l.Fragment,{children:[q(),"."]}):(0,l.jsx)(l.Fragment,{children:(0,l.jsx)(a.b,{})}),b||w?[" Select only customers that ordered this between ",(0,l.jsxs)(c.Z,{children:[b?(0,y.p6)(b):""," ","and ",w?(0,y.p6)(w):""]},1),"."]:"",J?" Narrow to only First-Time Purchasers who meet this criteria.":""]})})]}),(0,l.jsxs)(i.Z,{nextPageHref:t,btnDisabled:B,children:["I want to build an audience based on customers who ordered"," ",(null==H?void 0:H.name)?(0,l.jsxs)(l.Fragment,{children:[q(),"."]}):"$...",b||w?" Select only customers that ordered this between ".concat(b?(0,y.p6)(b):""," and ").concat(w?(0,y.p6)(w):"","."):"",J?" Narrow to only First-Time Purchasers who meet this criteria.":""]})]}))}}},function(e){e.O(0,[885,869,165,168,888,774,179],function(){return e(e.s=4414)}),_N_E=e.O()}]);

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.