PageSourceSearch

https://www.app.aisensy.com/static/js/5439.5c47b223.chunk.js

js aisensy.com collected 2026-09-24 18:22:28 UTC 14,732 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkwhatsapp_dashboard=self.webpackChunkwhatsapp_dashboard||[]).push([[5439],{44193:(e,t,a)=>{a.d(t,{z:()=>s});const s=[{name:"Commerce",vertical:"commerce"},{name:"Adoptable Pets",vertical:"adoptable_pets"},{name:"Automotive Models",vertical:"automotive_models"},{name:"Avatar",vertical:"avatar"},{name:"Bookable",vertical:"bookable"},{name:"Flights",vertical:"flights"},{name:"Hotels",vertical:"hotels"},{name:"Jobs",vertical:"jobs"},{name:"Local Delivery Shipping Profiles",vertical:"local_delivery_shipping_profiles"},{name:"Location Based Items",vertical:"location_based_items"},{name:"Media Titles",vertical:"media_titles"},{name:"Offer Items",vertical:"offer_items"},{name:"Offline Commerce",vertical:"offline_commerce"},{name:"Test Vertical",vertical:"test_vertical"},{name:"Ticketed Experiences",vertical:"ticketed_experiences"},{name:"Transactable Items",vertical:"transactable_items"},{name:"Vehicle Offers",vertical:"vehicle_offers"},{name:"Vehicles",vertical:"vehicles"},{name:"Local Service Businesses"},{name:"Home Listings",vertical:"home_listings"},{name:"Destinations",vertical:"destinations"}]},85439:(e,t,a)=>{a.r(t),a.d(t,{default:()=>D});var s=a(47313),i=a(45788),o=a(70089),n=a(23614),l=a(21144),r=a(73908),c=a(57009),d=a(72728),h=a(34882),g=a(20337),u=a(3873),p=a(54070),m=a(16761),x=a(52376),C=a(79880),f=a(82162),v=a(91136),y=a(58821),j=a(82602),b=a(39399),I=a(81766),Z=a(81369),k=a(1805),S=a(91529),w=a(19942),N=a(46417);const L=[{field:"Name",size:4,key:"catalogueName",placing:"start"},{field:"Catalogue Id",size:2,key:"catalogueId",placing:"start"},{field:"Type",size:2,key:"vertical",placing:"start"}
1,{field:"Product Count",size:2,key:"productCount",placing:"center"},{field:"Status",size:2,key:"status",placing:"center"}];L.map((e=>e.key));class A extends s.Component{constructor(e){super(e),this.selectCatalogue=async e=>{let{removeCatalogue:t,catalogueId:a}=e;const{assistantDetails:s,fetchCatalgoues:i,updateAssistantStore:n,fetchCatalgoueProducts:l}=this.props,{selectedMetaCatalogueId:r}=s;this.setState({isLoading:!0,selectedActionCatalogueId:a});const c=r?"update":"add",d=t?{assistantId:s.assistantId,status:"remove",catalogId:a,updateCatalogId:""}:{assistantId:s.assistantId,status:c,catalogId:"add"===c?a:r,updateCatalogId:"update"===c?a:""};if("update"===c&&d.catalogId===d.updateCatalogId)return this.setState({isLoading:!1,selectedActionCatalogueId:""}),void alert("Please select a different catalogue");await o.Z.post("".concat(k.URL,"/meta-catalogue/connect-disconnect-meta-catalog"),d).then((async e=>{await i(s.assistantId),await l(s.assistantId),await n({selectedMetaCatalogueId:t?"":"add"===c?a:d.updateCatalogId}),this.setState({alertMessage:"Catalogue connected successfully",alert:"success",isLoading:!1,selectedActionCatalogueId:""})})).catch((e=>{var t,a,s,i,o;this.setState({alertMessage:"".concat(null!==(t=null===e||void 0===e||null===(a=e.response)||void 0===a||null===(s=a.data)||void 0===s||null===(i=s.error)||void 0===i||null===(o=i.error)||void 0===o?void 0:o.error_user_msg)&&void 0!==t?t:"Unable to connect. Because it is already connected to other account."),alert:"error",isLoading:!1,selectedActionCatalogueId:""})}))},this.onConfirmationDialogClose=()=>{this.setState({confirmTask:""})},this.confirmDelete=(e,t)=>{this.setState({confirmTask:'Deleting catalogue "'.concat(t,'"'),confirmId:e,confirmName:t})},this.onDelete=e=>{const t=this.props.match.params.projectId;o.Z.post(k.URL+"/meta-catalogue/delete-catalogue",{catalogueId:e,assistantId:t}).then((e=>{this.props.fetchCatalgoues(t),this.setState({alert:"success",alertMessage:"Successfully deleted catalogue",confirmTask:""},this.loadData)})).catch((e=>{console.error(e),this.setState({alert:"error",alertMessage:"Network error! Could't delete catalogue",confirmTask:""})}))},this.setAlert=(e,t)=>{this.setState({alert:e,alertMessage:t})},this.onClose=()=>{this.setState({dialogOpen:!1})},this.onChange=e=>{const t=e.target.value,a=this.fuse.search(t).map((e=>e.item));this.setState({[e.target.name]:e.target.value,searchResults:a,page:0})},this.handleChangePage=(e,t)=>{this.setState({page:t})},this.state={page:0,query:"",confirmTask:"",confirmId:"",confirmName:"",selectedActionCatalogueId:"",alert:"",alertMessage:"",dialogOpen:!1,isLoading:!1,searchResults:[],fbcatalogue:[],fbConnectedCatalog:{}},this.fuse=new n.Z(Object.values(this.props.catalogues||{}),{keys:["catalogueName"],minMatchCharLength:0})}componentDidMount(){const{isCollapse:e,switchCollapse:t}=this.props;e&&t(!1)}sync(){this.setState({isLoading:!0});const{assistantDetails:e,fetchCatalgoues:t,catalogues:a,updateAssistantStore:s}=this.props,{assistantId:i}=e||{};i?o.Z.post("".concat(k.URL,"/meta-catalogue/sync-meta-catalogue"),{assistantId:i}).then((async e=>{var o,n,l,r;(await t(i),null!==(o=e.data)&&void 0!==o&&null!==(n=o.syncedData)&&void 0!==n&&n.connectedCatalog)&&(this.setState({catalogueValue:a.find((t=>{var a,s;return t.catalogueId===(null===(a=e.data)||void 0===a||null===(s=a.syncedData)||void 0===s?void 0:s.connectedCatalog.id)}))}),s({selectedMetaCatalogueId:null===(l=e.data)||void 0===l||null===(r=l.syncedData)||void 0===r?void 0:r.connectedCatalog.id}));this.setState({isLoading:!1})})).catch((e=>{console.log(e),this.setState({isLoading:!1})})):console.log("assistant id not found")}render(){const{classes:e,match:t,catalogues:a,fetchCatalgoues:s,assistantDetails:i}=this.props,{selectedMetaUserId:o,selectedMetaBusinessAccessToken:n,partnerId:x}=i,{page:b,query:I,searchResults:k,dialogOpen:A,isLoading:z}=this.state,{projectId:D}=t.params,M=(I?k:Object.values(a||{})).sort(((e,t)=>e.createdAt<t.createdAt?1:-1)).slice(10*b,10*(b+1));return(0,N.jsxs)("div",{className:"".concat(e.root," ginger-page-root"),onScroll:this.listScrolled,children:[(0,N.jsxs)(l.Z,{container:!0,justify:"center",alignItems:"center",className:"".concat(e.pageTitleContainer," ").concat(e.fullWidth," ginger-page-header"),children:[(0,N.jsx)(l.Z,{item:!0,xs:!0,children:(0,N.jsx)(r.Z,{pl:{xs:2,md:3},children:(0,N.jsx)(c.Z,{variant:"h3",children:"Manage Catalogues"})})}),(0,N.jsx)(r.Z,{pr:{xs:2,md:3},display:"flex",alignItems:"center",children:(0,N.jsx)(S.default,{})})]}),(0,N.jsx)(r.Z,{my:3}),(0,N.jsx)(l.Z,{container:!0,justify:"center",alignItems:"center",style:{background:"#f9f9f9"},children:(0,N.jsxs)(l.Z,{item:!0,xs:12,md:11,lg:10,children:[(0,N.jsx)(y.Z,{title:"Quick Guide",description:(0,N.jsxs)(N.Fragment,{children:["You can connect with facebook to fetch catalogue and manage it from our platform.",(0,N.jsx)("br",{}),"Here we show only those catalogues who have more than one product."]}),section:"catalogue",guideLinks:j.Z,prospectId:null===i||void 0===i?void 0:i.prospectId,showTutorial:!x}),(0,N.jsxs)(l.Z,{item:!0,container:!0,className:e.searchboxContainer,alignItems:"flex-end",children:[(0,N.jsx)(l.Z,{item:!0,xs:!0,children:(0,N.jsx)(d.Z,{placeholder:"Search by catalogue name",color:"primary",value:I,name:"query",onFocus:()=>{this.setState({inputFocused:!0})},onBlur:()=>{this.setState({inputFocused:!1})},className:e.textFieldRoot,onChange:this.onChange,onKeyDown:this.handleSearch})}),(0,N.jsx)(l.Z,{item:!0,children:(0,N.jsx)(h.ZP,{placement:"top",title:"Create catalgoue",children:(0,N.jsx)(r.Z,{children:(0,N.jsx)(g.Z,{variant:"contained",color:"primary",startIcon:(0,N.jsx)(C.Z,{className:z?e.rotationIcon:""}),className:e.syncDesktop,onClick:()=>this.sync(),disabled:z,children:"Sync"})})})})]})]})}),(0,N.jsx)(l.Z,{container:!0,justify:"center",className:e.tableContainer,children:(0,N.jsxs)(l.Z,{item:!0,xs:12,md:11,lg:10,style:{width:"100%"},children:[(0,N.jsx)(r.Z,{style:{background:"white",padding:"16px"},borderRadius:"8px",overflow:"auto hidden",mb:{xs:20,md:12},children:(0,N.jsx)(r.Z,{minWidth:"850px",children:(0,N.jsxs)(l.Z,{item:!0,xs:12,container:!0,children:[L.map((e=>(0,N.jsx)(l.Z,{item:!0,xs:e.size,style:{display:"flex",alignItems:"center",justifyContent:e.placing},children:(0,N.jsx)(r.Z,{py:2,px:2,children:(0,N.jsx)(c.Z,{variant:"h5",align:"center",children:e.field})})}))),M.length>0?M.map((e=>(0,N.jsx)(l.Z,{item:!0,container:!0,xs:12,children:L.map((t=>(0,N.jsx)(l.Z,{style:{display:"flex",alignItems:"center",justifyContent:t.placing},item:!0,xs:t.size,children:"status"===t.key?(0,N.jsxs)(g.Z,{variant:"outlined",onClick:()=>{this.selectCatalogue({removeCatalogue:e.status,catalogueId:e.catalogueId})},style:{...e.status?{color:"red",borderColor:"red"}:{color:"darkgreen",borderColor:"darkgreen"},opacity:this.state.isLoading?.7:1},size:"small",disabled:this.state.isLoading,children:[e.status?"Disconnect":"Connect",this.state.isLoading&&this.state.selectedActionCatalogueId===e.catalogueId&&(0,N.jsx)(u.Z,{style:{marginLeft:"8px"},size:15})]}):(0,N.jsx)(r.Z,{py:2,px:2,children:(0,N.jsx)(c.Z,{variant:"h5",align:"center",style:{},children:"".concat(e[t.key])})})})))}))):o&&n?(0,N.jsx)(r.Z,{width:"100%",height:200,display:"flex",alignItems:"center",justifyContent:"center",children:(0,N.jsx)(c.Z,{variant:"h5",color:"textSecondary",children:"No catalgoue found!"})}):(0,N.jsxs)(l.Z,{container:!0,justify:"center",alignItems:"center",style:{height:"200px"},children:[(0,N.jsx)("div",{className:e.overlay}),(0,N.jsx)(r.Z,{mt:"12px",display:"flex",className:e.higherzIndex,children:(0,N.jsx)("div",{onClick:()=>this.props.history.push("/projects/"+D+"/flows/connect-catalgue"),style:{cursor:"pointer"},children:(0,N.jsxs)(c.Z,{variant:"h4",color:"primary",align:"center",className:e.message,children:["Connect and Setup Meta Catologue Account to continue!",(0,N.jsx)(p.Z,{children:(0,N.jsx)(f.Z,{})})]})})})]})]})})}),(0,N.jsx)("div",{className:"".concat(e.fixedBottomContainer," ginger-page-footer"),children:(0,N.jsx)(m.Z,{component:"div",count:a.length,page:b,onChangePage:this.handleChangePage,rowsPerPage:10,rowsPerPageOptions:[10]})})]})}),(0,N.jsx)(w.A9,{open:!!this.state.alert,anchorOrigin:{vertical:"top",horizontal:"center"},onClose:()=>{this.setState({alert:"",alertMessage:""})},severity:this.state.alert,message:this.state.alertMessage}),(0,N.jsx)(Z.Z,{open:!!this.state.confirmTask,taskMessage:this.state.confirmTask,onClose:this.onConfirmationDialogClose,onConfirm:()=>this.onDelete(this.state.confirmId)}),(0,N.jsx)(v.Z,{dialogOpen:A,onClose:this.onClose,loadData:()=>s(D),assistantId:D,setAlert:this.setAlert})]})}}const z=(0,i.connect)((e=>({catalogues:e.cartPlus.catalogues,assistantDetails:e.assistantDetails.data,isCollapse:e.cartPlus.isCollapse})),{fetchCatalgoues:b.Bg,updateAssistantStore:I.sJ,fetchCatalgoueProducts:b.VQ,switchCollapse:b.Px})(A),D=(0,x.Z)((e=>({root:{width:"100%",height:"100%",background:"rgb(249,249,249)",boxSizing:"border-box",overflowX:"hidden",position:"relative"},guideContainer:{background:"white",borderRadius:"8px"},pageTitleContainer:{height:60,boxSizing:"border-box"},fullWidth:{width:"100%",background:"white"},toolbar:{transition:"all 0.2s",position:"sticky",top:0,left:0,height:"60px",zIndex:"100",[e.breakpoints.down("sm")]:{height:"60px"}},rotationIcon:{animation:"$rotation 2s infinite linear"},"@keyframes rotation":{from:{transform:"rotate(0deg)"},to:{transform:"rotate(359deg)"}},searchboxContainer:{marginTop:20},fixedBottomContainer:{position:"fixed",height:"60px",borderTop:"1px solid lightgrey",background:"white",bottom:"0",left:"calc(71px + 260px)",right:"0",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",[e.breakpoints.down("sm")]:{left:"0px",height:"50px"}},tableContainer:{width:"100%",overflow:"hidden",boxSizing:"border-box",marginTop:"24px",[e.breakpoints.down("sm")]:{paddingLeft:e.spacing(1),paddingRight:e.spacing(1),boxSizing:"border-box"}},textFieldRoot:{backgroundColor:"white",outline:"none",border:"none",borderRadius:"8px",width:"380px",marginRight:12,height:"40px",padding:"6px 12px",boxShadow:"none",boxSizing:"border-box",fontFamily:"Roboto, sans-serif",fontSize:"15px",fontWeight:500},rowPadding:{paddingTop:1.5*e.spacing(1),paddingBottom:1.5*e.spacing(1)}})))(z)},91136:(e,t,a)=>{a.d(t,{Z:()=>b});var s=a(47313),i=a(70089),o=a(61809),n=a(95939),l=a(57009),r=a(78371),c=a(21144),d=a(72728),h=a(35154),g=a(20337),u=a(52376),p=a(44193),m=a(1805),x=a(39399),C=a(45788),f=
1a(46417);const v=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,10})+$/;class y extends s.Component{constructor(){super(...arguments),this.state={catalogueName:"",vertical:"Commerce"},this.onChange=e=>{this.setState({[e.target.name]:e.target.value}),""===e.target.value?this.setState({[e.target.name+"Error"]:!0}):"name"===e.target.name?v.test(e.target.value)?this.setState({[e.target.name+"Error"]:!0}):this.setState({[e.target.name+"Error"]:!1}):"email"===e.target.name?v.test(e.target.value)?this.setState({[e.target.name+"Error"]:!1}):this.setState({[e.target.name+"Error"]:!0}):this.setState({[e.target.name+"Error"]:!1})},this.onCancel=()=>{this.setState({catalogueName:""},this.props.onClose())},this.handleAutoComplete=(e,t,a)=>{"select-option"==a&&this.setState({vertical:t})},this.onSubmit=()=>{const{catalogueName:e}=this.state,{assistantId:t,addCreatedCatalogue:a}=this.props;i.Z.post(m.URL+"/meta-catalogue/create-catalogue",{catalogueName:e,assistantId:t}).then((async e=>{this.props.setAlert("success","Catalogue Created Succesfully"),a(e.data.catalogue),this.onCancel()})).catch((e=>{if(e.response){e.response.data;this.props.setAlert("error","some error occured")}}))},this.getVertical=()=>p.z.filter((e=>e.name==this.state.vertical))[0].vertical}render(){const{classes:e,dialogOpen:t,onClose:a}=this.props,{vertical:s,catalogueName:i}=this.state;return(0,f.jsxs)(o.Z,{open:t,onClose:a,disableBackdropClick:!0,children:[(0,f.jsx)(n.Z,{style:{padding:"28px 32px 8px"},children:(0,f.jsx)(l.Z,{variant:"h3",children:"Create Catalogue"})}),(0,f.jsx)(r.Z,{children:(0,f.jsx)(c.Z,{container:!0,direction:"column",className:e.content,children:(0,f.jsx)(d.Z,{type:"text",variant:"outlined",placeholder:"Catalogue Name",onChange:this.onChange,className:e.input,margin:"dense",name:"catalogueName"})})}),(0,f.jsxs)(h.Z,{style:{padding:"8px 32px 16px"},children:[(0,f.jsx)(g.Z,{variant:"outlined",onClick:this.onCancel,children:"Cancel"}),(0,f.jsx)(g.Z,{color:"primary",variant:"contained",onClick:this.onSubmit,disabled:!i||!s,children:"Create"})]})]})}}const j=(0,C.connect)((e=>({})),{addCreatedCatalogue:x.IK})(y),b=(0,u.Z)((e=>({input:{margin:"0.5em"},content:{width:"70vw",maxWidth:"500px"}})))(j)},79880:(e,t,a)=>{a.d(t,{Z:()=>i});var s=a(47313);const i=(0,a(14214).Z)(s.createElement("path",{d:"M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8c-.45-.83-.7-1.79-.7-2.8 0-3.31 2.69-6 6-6zm6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26z"}),"Autorenew")}}]);

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.