1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2849],{45079:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/[lang]/app/cluster",function(){return s(90111)}])},90111:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return k}});var i=s(47568),r=s(51438),a=s(52951),n=s(88029),l=s(5950),d=s(97582),o=s(85893),c=s(67294),h=s(14364),u=s(37742),m=s(29473),g=s(9008),p=s.n(g),v=s(41664),x=s.n(v),k=function(e){(0,n.Z)(s,e);var t=(0,l.Z)(s);function s(e){var i;return(0,r.Z)(this,s),(i=t.call(this,e)).state={loadingBk:!0,loadingSF:!0,loading:!0,bookmark:{},clusters:{},productGroup:{},savedTrends:null},i.filterList=["order","brand","group","dosage","discarded","perfumer","industrial","groupbrand","notes","notesgroup","franchise","gender","yearc","popmin","popmax","likemin","likemax","silmin","silmax","longmin","longmax","marketcountry","marketyear","marketmin","marketmax","sentmin","sentmax","claim","distribution","marketing_angle","ownership","positioning","mood","color","firmmain","firmsub","firmspe","groupsplit","groupsplitgroup","pillier","image_color","image_color_firm","tags_firm","prname","notetype"],i}return(0,a.Z)(s,[{key:"componentDidMount",value:function(){var e=this;return(0,i.Z)((function(){var t;return(0,d.__generator)(this,(function(s){switch(s.label){case 0:return e.mountPage=!0,[4,(0,h.ih)(e.props.lang)];case 1:return t=s.sent(),e.setState({typeAcc:t.type,userInfoCheck:t,dev:t.dev}),e.mountPage&&(e.getBookmarkIn(),e.getSavedTrends(),(0,u.S)("visit_listing_bookmark",{account:t.type})),[2]}}))}))()}},{key:"getSavedTrends",value:function(){var e=this,t={Authorization:"Bearer "+localStorage.getItem("auth_identifier_token")};m.h.get("/get_saved_trend_selections",{headers:t}).then((function(t){return e.setState({savedTrends:t.data.data||[]})})).catch((function(){return e.setState({savedTrends:[]})}))}},{key:"deleteSavedTrend",value:function(e){var t=this,s=this.state.savedTrends;this.setState({savedTrends:(this.state.savedTrends||[]).filter((function(t){return t.id!==e}))});var i={Authorization:"Bearer "+localStorage.getItem("auth_identifier_token"),id:e};m.h.get("/delete_trend_selection",{headers:i}).catch((function(){return t.setState({savedTrends:s})}))}},{key:"deleteInfo",value:function(e,t){var s=this,i=this.state.bookmark,r=this.state.clusters;if("cluster"===e||"product_group"===e){var a=JSON.parse(JSON.stringify(this.state.clusters||{}));Array.isArray(a[e])&&(a[e]=a[e].filter((function(s){return("cluster"===e?s.id_cluster:s.id)!==t})),this.setState({clusters:a}))}else{var n=JSON.parse(JSON.stringify(this.state.bookmark||{}));Array.isArray(n[e])&&(n[e]=n[e].filter((function(e){return e.id_!==t})),this.setState({bookmark:n}))}m.h.get("/delete_user_save_item",{headers:{Authorization:"Bearer "+localStorage.getItem("auth_identifier_token"),type:e,id:t}}).catch((function(e){console.log(e),s.setState({bookmark:i,clusters:r})}))}},{key:"getBookmarkIn",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;!1===e&&this.setState({loadingBk:!0}),m.h.get("/get_bookmark",{headers:{Authorization:"Bearer "+localStorage.getItem("auth_identifier_token"),type:"bookmark"}}).then((function(e){t.setState({bookmark:e.data.data,loadingBk:!1}),t.getBookmark()})).catch((function(e){console.log(e)}))}},{key:"getBookmark",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;!1===e&&this.setState({loading:!0}),m.h.get("/get_bookmark",{headers:{Authorization:"Bearer "+localStorage.getItem("auth_identifier_token"),type:"cluster"}}).then((function(e){t.setState({clusters:e.data.data,loading:!1})})).catch((function(e){console.log(e)}))}},{key:"getQuery",value:function(e){var t=this,s="?page=1";return Object.keys(e).forEach((function(i,r){-1!==t.filterList.indexOf(i)&&-1===[null,"null",void 0,""].indexOf(e[i])&&("?"!==s&&(s+="&"),s=s+i+"="+e[i])})),s}},{key:"getListIds",value:function(e){return"?page=1&order=market_share_desc&marketcountry=all&marketyear=all&manualcluster=".concat(e.id,"%-").concat(e.product_ids.length)}},{key:"renderBookmarkSkeleton",value:function(){return(0,o.jsxs)("div",{children:[(0,o.jsx)("div",{className:"skeleton-block",style:{height:18,width:130,borderRadius:4,margin:"35px 0 4px 0"}}),(0,o.jsx)("div",{className:"list-filter-listing",style:{minWidth:450,paddingTop:6},children:(0,o.jsx)("div",{style:{display:"flex",flexWrap:"wrap"},children:[0,1,2,3,4].map((function(e){return(0,o.jsx)("div",{className:"box-white-area-list",children:(0,o.jsx)("div",{className:"tr-list",style:{cursor:"default"},children:(0,o.jsxs)("div",{className:"tr-list-name tr-list-content",style:{width:"100%",paddingRight:20},children:[(0,o.jsx)("div",{className:"skeleton-block",style:{width:56,height:56,borderRadius:4,flexShrink:0}}),(0,o.jsxs)("div",{style:{paddingLeft:12},children:[(0,o.jsx)("div",{className:"skeleton-block",style:{height:14,width:130,borderRadius:4}}),(0,o.jsx)("div",{className:"skeleton-block",style:{height:11,width:80,borderRadius:3,marginTop:8}})]})]})})},"bk_skel_"+e)}))})})]})}},{key:"renderClusterSkeleton",value:function(){return(0,o.jsxs)("div",{children:[(0,o.jsx)("div",{className:"skeleton-block",style:{height:18,width:140,borderRadius:4,margin:"35px 0 4px 0"}}),(0,o.jsx)("div",{className:"list-filter-listing",style:{minWidth:450,paddingTop:6},children:(0,o.jsx)("div",{style:{display:"flex",flexWrap:"wrap"},children:[0,1,2].map((function(e){return(0,o.jsx)("div",{className:"box-white-area-list",children:(0,o.jsx)("div",{className:"tr-list",style:{borderBottom:0,cursor:"default"},children:(0,o.jsxs)("div",{className:"tr-list-name tr-list-content",style:{width:"100%",paddingRight:20,minWidth:"unset"}
1,children:[(0,o.jsx)("div",{className:"skeleton-block",style:{height:98,width:98,borderRadius:4,flexShrink:0}}),(0,o.jsxs)("div",{style:{paddingLeft:16,paddingRight:20,width:240},children:[(0,o.jsx)("div",{className:"skeleton-block",style:{height:15,width:150,borderRadius:4}}),(0,o.jsx)("div",{className:"skeleton-block",style:{height:12,width:200,borderRadius:3,marginTop:8}})]})]})})},"cl_skel_"+e)}))})})]})}},{key:"renderTrendsSkeleton",value:function(){return(0,o.jsxs)("div",{children:[(0,o.jsx)("div",{className:"skeleton-block",style:{height:18,width:130,borderRadius:4,margin:"35px 0 8px 0"}}),(0,o.jsx)("div",{className:"sa-trend-grid",children:[0,1,2].map((function(e){return(0,o.jsx)("div",{className:"sa-trend-card",children:(0,o.jsxs)("div",{className:"sa-trend-card__inner",children:[(0,o.jsx)("div",{className:"sa-trend-card__icon",children:(0,o.jsx)("div",{className:"skeleton-block",style:{width:18,height:18,borderRadius:4}})}),(0,o.jsxs)("div",{className:"sa-trend-card__info",children:[(0,o.jsx)("div",{className:"skeleton-block",style:{height:13,width:150,borderRadius:4}}),(0,o.jsx)("div",{className:"skeleton-block",style:{height:10,width:210,borderRadius:3,marginTop:5}})]}),(0,o.jsx)("div",{className:"skeleton-block",style:{height:13,width:18,borderRadius:3}})]})},"tr_skel_"+e)}))})]})}},{key:"render",value:function(){var e=this,t=this.state.bookmark,s=this.state.clusters,i={cluster:"My saved filters",product_group:"My clusters",product:"Products",brand:"Brands",group:"Groups",franchise:"Franchises",composition_house:"Perfume houses",perfumer:"Perfumers"},r=!1;s&&(s.cluster&&s.cluster.length>0&&(r=!0),s.product_group&&s.product_group.length>0&&(r=!0));var a=!1;Object.keys(t).forEach((function(e){"cluster"!==e&&"product_group"!==e&&t[e].length>0&&(a=!0)}));var n=98;return(0,o.jsxs)("div",{className:"container-withbg-list",children:[(0,o.jsx)(p(),{children:(0,o.jsx)("title",{children:"Your Saved assets"})}),(0,o.jsx)("div",{className:"title-top-list",children:"Your Saved Assets"}),this.state.loadingBk?this.renderBookmarkSkeleton():a?Object.keys(t).map((function(s,r){return"cluster"===s||"product_group"===s?null:(0,o.jsxs)("div",{children:[(0,o.jsxs)("div",{className:"title-bookmark noselect",style:{display:"flex",alignItems:"center"},children:[i[s],(0,o.jsx)("div",{className:"bubble-nbr-item",children:t[s].length})]}),(0,o.jsx)("div",{className:"list-filter-listing",style:{minWidth:450,paddingTop:6},children:(0,o.jsx)("div",{className:"",style:{display:"flex",flexWrap:"wrap"},children:t[s].map((function(t,i){return"product_group"===s||"cluster"===s?null:(0,o.jsxs)("div",{style:{position:"relative"},className:"div-del-hover box-white-area-list",children:[(0,o.jsx)(x(),{href:t.industrial_brand?(0,h.DW)(e.props.lang,"app/brand/"+t.industrial_brand):(0,h.DW)(e.props.lang,"app/"+t.type+"/"+t.path),children:(0,o.jsx)("a",{className:"clean-a",children:(0,o.jsx)("div",{className:"tr-list transition-200",children:(0,o.jsxs)("div",{className:"tr-list-name tr-list-content",style:{width:"100%",paddingRight:20},children:[null===t.img?(0,o.jsx)("div",{className:"tr-list-img noselect",style:{position:"relative"},children:(0,o.jsx)("div",{className:"center-absolute big-letter",children:t.name.substring(0,1)})}):(0,o.jsx)("img",{alt:"img",className:"tr-list-img noselect",style:"product"===t.type?{padding:8}:{},src:t.img}),(0,o.jsxs)("div",{className:"",children:[(0,o.jsx)("div",{className:"tr-list-content-name",children:t.name}),"product"===t.type?(0,o.jsx)("div",{className:"tr-list-content-subname",children:t.brand}):null]})]})})})}),(0,o.jsx)("img",{alt:"cancel",onClick:function(){return e.deleteInfo(t.type,t.id_)},className:"img-del-hover",src:"/cancel.png",style:{position:"absolute",zIndex:2,right:10,cursor:"pointer",height:26,top:"50%",transform:"translateY(-50%)"}})]},"unique_product_list_"+i+"_"+r)}))})})]},"list_bk_"+r)})):(0,o.jsxs)("div",{className:"onboard-book-div noselect",children:[(0,o.jsx)("div",{children:(0,o.jsx)("div",{className:"onboard-book-div-img",children:(0,o.jsx)("img",{alt:"",src:"/bookmark_ico.png"})})}),(0,o.jsx)("div",{className:"onboard-book-div-title",children:"You don\u2019t have any bookmark yet"}),(0,o.jsx)("div",{className:"onboard-book-div-desc",children:"Hit the bookmark button from any product, brand, group or perfumer page to access it more quickly."})]}),this.state.loading?this.renderClusterSkeleton():r?Object.keys(s).map((function(t,r){return"product_group"!==t&&"cluster"!==t||"cluster"===t&&0===s[t].length||"product_group"===t&&0===s[t].length?null:(0,o.jsxs)("div",{children:[(0,o.jsxs)("div",{className:"title-bookmark noselect",style:{display:"flex",alignItems:"center"},children:[i[t],(0,o.jsx)("div",{className:"bubble-nbr-item",children:s[t].length})]}),(0,o.jsx)("div",{className:"list-filter-listing",style:{minWidth:450,paddingTop:6},children:(0,o.jsxs)("div",{className:"",style:{display:"flex",flexWrap:"wrap"},children:[s[t].map((function(s,i){return"product_group"===t?(0,o.jsxs)("div",{style:{position:"relative"},className:"div-del-hover box-white-area-list",children:[(0,o.jsx)(x(),{href:(0,h.DW)(e.props.lang,"app/product"+e.getListIds(s)),children:(0,o.jsx)("a",{className:"clean-a",children:(0,o.jsx)("div",{className:"tr-list transition-200",style:{borderBottom:0},children:(0,o.jsxs)("div",{className:"tr-list-name tr-list-content",style:{width:"100%",paddingRight:20,minWidth:"unset"}
1,children:[s.imgs?(0,o.jsx)("div",{className:"tr-list-img noselect",style:{position:"relative",display:"flex",flexWrap:"wrap",minHeight:n,minWidth:n,height:n,width:n,maxHeight:n,maxWidth:n},children:[0,"split",1,"big_split",2,"split",3].map((function(e,t){return"big_split"===e?(0,o.jsx)("div",{style:{height:1,width:96,backgroundColor:"rgba(0, 3, 10, 0.10)"}},r+"_"+i+"_"+t):(0,o.jsxs)("div",{style:{width:"split"===e?1:47,height:47,display:"flex",padding:"split"===e?0:4},children:["split"===e?null:s.imgs[e]?(0,o.jsx)("img",{alt:"img",style:{width:39,height:39},src:s.imgs[e]},s.imgs[e]):(0,o.jsx)("div",{style:{width:47,height:47}}),"split"===e?(0,o.jsx)("div",{style:{height:47,width:1,backgroundColor:"rgba(0, 3, 10, 0.10)"}}):null]},r+"_"+i+"_"+t)}))}):(0,o.jsx)("div",{className:"tr-list-img noselect",style:{position:"relative",height:96,width:96},children:(0,o.jsx)("div",{className:"center-absolute big-letter",children:s.name.substring(0,1)})}),(0,o.jsxs)("div",{style:{paddingLeft:16,paddingRight:20,width:240},children:[(0,o.jsx)("div",{className:"tr-list-content-name",style:{paddingLeft:0,textTransform:"capitalize"},children:s.name}),s.desc?(0,o.jsx)("div",{className:"tr-list-content-subname",style:{paddingLeft:0,color:"rgba(0, 8, 28, 0.60)",fontSize:13},children:s.desc}):null]})]})})})}),(0,o.jsx)("img",{alt:"cancel",onClick:function(){return e.deleteInfo("product_group",s.id)},className:"img-del-hover",src:"/cancel.png",style:{position:"absolute",zIndex:2,right:10,cursor:"pointer",height:26,top:"50%",transform:"translateY(-50%)"}})]},"unique_clsuter_list_"+i+"_"+r):null})),s[t].map((function(s,i){return"cluster"===t?(0,o.jsxs)("div",{style:{position:"relative"},className:"div-del-hover box-white-area-list",children:[(0,o.jsx)(x(),{href:(0,h.DW)(e.props.lang,"app/product"+e.getQuery(s.filter)),children:(0,o.jsx)("a",{className:"clean-a",children:(0,o.jsx)("div",{className:"tr-list transition-200",style:{borderBottom:0},children:(0,o.jsxs)("div",{className:"tr-list-name tr-list-content",style:{width:"100%",paddingRight:20,minWidth:"unset"}
1,children:[s.imgs?(0,o.jsx)("div",{className:"tr-list-img noselect",style:{position:"relative",display:"flex",flexWrap:"wrap",minHeight:n,minWidth:n,height:n,width:n,maxHeight:n,maxWidth:n},children:[0,"split",1,"big_split",2,"split",3].map((function(e,t){return"big_split"===e?(0,o.jsx)("div",{style:{height:1,width:96,backgroundColor:"rgba(0, 3, 10, 0.10)"}},r+"_"+i+"_"+t):(0,o.jsxs)("div",{style:{width:"split"===e?1:47,height:47,display:"flex",padding:"split"===e?0:4},children:["split"===e?null:s.imgs[e]?(0,o.jsx)("img",{alt:"img",style:{width:39,height:39},src:s.imgs[e]},s.imgs[e]):(0,o.jsx)("div",{style:{width:47,height:47}}),"split"===e?(0,o.jsx)("div",{style:{height:47,width:1,backgroundColor:"rgba(0, 3, 10, 0.10)"}}):null]},r+"_"+i+"_"+t)}))}):(0,o.jsx)("div",{className:"tr-list-img noselect",style:{position:"relative",height:96,width:96},children:(0,o.jsx)("div",{className:"center-absolute big-letter",children:s.name_cluster.substring(0,1)})}),(0,o.jsxs)("div",{style:{paddingLeft:16,paddingRight:20,width:240},children:[(0,o.jsx)("div",{className:"tr-list-content-name",style:{paddingLeft:0,textTransform:"capitalize"},children:s.name_cluster}),s.desc?(0,o.jsx)("div",{className:"tr-list-content-subname",style:{paddingLeft:0,color:"rgba(0, 8, 28, 0.60)",fontSize:13},children:s.desc}):null]})]})})})}),(0,o.jsx)("img",{alt:"cancel",onClick:function(){return e.deleteInfo("cluster",s.id_cluster)},className:"img-del-hover",src:"/cancel.png",style:{position:"absolute",zIndex:2,right:10,cursor:"pointer",height:26,top:"50%",transform:"translateY(-50%)"}})]},"unique_clsuter_list_"+i+"_"+r):null}))]})})]},"list_bk_"+r)})):(0,o.jsxs)("div",{className:"onboard-book-div noselect",children:[(0,o.jsx)("div",{children:(0,o.jsx)("div",{className:"onboard-book-div-img",children:(0,o.jsx)("img",{alt:"",src:"/cluster_ico_selected.png"})})}),(0,o.jsx)("div",{className:"onboard-book-div-title",children:"You don\u2019t have any saved assets"}),(0,o.jsx)("div",{className:"onboard-book-div-desc",children:"To create your first saved filter, select one or more filters from the product list and click \u201cSave Filter\u201d."}),(0,o.jsx)("div",{className:"onboard-book-div-desc",style:{marginTop:0},children:"You can also create cluster from product page directly or from product cards in the main search."})]}),null===this.state.savedTrends?this.renderTrendsSkeleton():this.state.savedTrends.length>0?(0,o.jsxs)("div",{children:[(0,o.jsxs)("div",{className:"title-bookmark noselect",style:{display:"flex",alignItems:"center"},children:["My saved trends",(0,o.jsx)("div",{className:"bubble-nbr-item",children:this.state.savedTrends.length})]}),(0,o.jsx)("div",{className:"sa-trend-grid",children:this.state.savedTrends.map((function(t,s){return(0,o.jsxs)("div",{className:"sa-trend-card div-del-hover",style:{position:"relative"},children:[(0,o.jsx)(x(),{href:"/".concat(e.props.lang||"en","/app/trends/comparator?saved_id=").concat(t.id),children:(0,o.jsx)("a",{className:"clean-a",children:(0,o.jsxs)("div",{className:"sa-trend-card__inner",children:[(0,o.jsx)("div",{className:"sa-trend-card__icon",children:(0,o.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"rgba(47,113,232,0.7)",strokeWidth:"2",strokeLinecap:"round",children:[(0,o.jsx)("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),(0,o.jsx)("line",{x1:"7",y1:"12",x2:"20",y2:"12"}),(0,o.jsx)("line",{x1:"10",y1:"18",x2:"20",y2:"18"})]})}),(0,o.jsxs)("div",{className:"sa-trend-card__info",children:[(0,o.jsx)("div",{className:"sa-trend-card__name",children:t.name}),t.smart_search&&(0,o.jsxs)("div",{className:"sa-trend-card__smart",children:["\u2726 ",t.smart_search]}),(0,o.jsx)("div",{className:"sa-trend-card__entities",children:(t.entities||[]).map((function(e){return e.name})).join(", ")||"".concat(t.entity_count," entities")})]}),(0,o.jsx)("div",{className:"sa-trend-card__count",children:t.entity_count})]})})}),(0,o.jsx)("img",{alt:"delete",onClick:function(){return e.deleteSavedTrend(t.id)},className:"img-del-hover",src:"/cancel.png",style:{position:"absolute",zIndex:2,right:10,cursor:"pointer",height:26,top:"50%",transform:"translateY(-50%)"}})]},t.id)}))})]}):null]})}}]),s}(c.Component)}},function(e){e.O(0,[9774,2888,179],(function(){return t=45079,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
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.