1"use strict";(self.webpackChunkclient_panel=self.webpackChunkclient_panel||[]).push([[3332],{83332:(I,v,o)=>{o.r(v),o.d(v,{JourneyStageModelModule:()=>T});var l=o(60177),i=o(12791),h=o(88470),p=o(51040),x=o(84412),e=o(54438),j=o(60845),b=o(45794),g=o(29599),C=o(33923);const y=["createNewStageComponent"],_=["modal"];function c(r,m){1&r&&(e.j41(0,"div",10)(1,"div",11),e.EFF(2," Loading... "),e.k0s()())}function a(r,m){1&r&&(e.j41(0,"div",14)(1,"div",15),e.nrm(2,"img",16),e.j41(3,"h2",17),e.EFF(4,"No Journey Stages Created Yet!"),e.k0s(),e.j41(5,"p",18),e.EFF(6,"Create your first journey stage."),e.k0s()()())}function u(r,m){if(1&r&&(e.j41(0,"span",24),e.nrm(1,"img",25),e.EFF(2),e.nI1(3,"date"),e.k0s()),2&r){const t=e.XpG(3);e.R7$(2),e.SpI("Synced on ",t.lastSyncedAt?e.i5U(3,1,t.lastSyncedAt,"dd MMM yyyy, h:mm a"):"N/A"," ")}}function f(r,m){if(1&r){const t=e.RV6();e.j41(0,"button",27),e.bIt("click",function(){e.eBV(t);const s=e.XpG(4);return e.Njj(s.toggleReOrdering())}),e.nrm(1,"img",28),e.j41(2,"span",29),e.EFF(3,"Re-order"),e.k0s()()}}function D(r,m){if(1&r&&(e.qex(0),e.DNE(1,f,4,0,"button",26),e.bVm()),2&r){e.XpG();const t=e.sdS(6),n=e.XpG(2);e.R7$(),e.Y8G("ngIf",!n.reOrdering)("ngIfElse",t)}}function M(r,m){if(1&r){const t=e.RV6();e.j41(0,"button",30),e.bIt("click",function(){e.eBV(t);const s=e.XpG(3);return e.Njj(s.toggleReOrdering())}),e.j41(1,"span",31),e.EFF(2,"Re-order"),e.k0s(),e.nrm(3,"img",32),e.k0s()}}function k(r,m){1&r&&e.nrm(0,"img",53)}function R(r,m){if(1&r){const t=e.RV6();e.j41(0,"div",33)(1,"div",34)(2,"div",11),e.DNE(3,k,1,0,"img",35),e.j41(4,"div",36)(5,"span",37),e.EFF(6),e.k0s(),e.j41(7,"div",38),e.EFF(8),e.nI1(9,"numberSuffix"),e.k0s()(),e.j41(10,"div",39)(11,"div",40),e.EFF(12),e.k0s()()(),e.j41(13,"div",41,42)(15,"button",43),e.nrm(16,"img",44),e.k0s(),e.j41(17,"div",45)(18,"div",46)(19,"div",47)(20,"a",3)(21,"button",48),e.nrm(22,"img",49),e.j41(23,"span",50),e.EFF(24,"Edit"),e.k0s()()()(),e.j41(25,"div",47)(26,"button",51),e.bIt("click",function(){const d=e.eBV(t).$implicit,S=e.XpG(3);return e.Njj(S.deleteStage(d._id))}),e.nrm(27,"img",52),e.j41(28,"span",50),e.EFF(29,"Delete"),e.k0s()()()()()()()()}if(2&r){const t=m.$implicit,n=e.XpG(3);e.Y8G("cdkDragDisabled",!n.reOrdering)("cdkDragData",t),e.R7$(3),e.Y8G("ngIf",n.reOrdering),e.R7$(2),e.HbH("fw-semibold fs-5 "+t.colorClass),e.FS9("title",t.name),e.R7$(),e.JRh(t.name),e.R7$(),e.FS9("title",t.accountCount),e.R7$(),e.SpI("",t.accountCount?e.bMT(9,15,t.accountCount):0," Accounts"),e.R7$(3),e.FS9("title",t.description),e.R7$(),e.JRh(t.description),e.R7$(3),e.Y8G("disabled",n.reOrdering),e.R7$(5),e.Y8G("routerLink",n.getBasePath()+"/edit-stage/"+t._id),e.R7$(),e.Y8G("disabled",n.reOrdering),e.R7$(5),e.Y8G("disabled",n.reOrdering)}}function $(r,m){if(1&r){const t=e.RV6();e.j41(0,"div")(1,"div",19)(2,"div",11),e.DNE(3,u,4,4,"span",20),e.k0s(),e.DNE(4,D,2,2,"ng-container",13)(5,M,4,0,"ng-template",null,21,e.C5r),e.k0s(),e.j41(7,"div",22),e.bIt("cdkDropListDropped",function(s){e.eBV(t);const d=e.XpG(2);return e.Njj(d.onDrop(s))}),e.DNE(8,R,30,17,"div",23),e.k0s()()}if(2&r){const t=e.XpG(2);e.R7$(3),e.Y8G("ngIf",t.lastSyncedAt),e.R7$(),e.Y8G("ngIf",t.journeyStages.length>1),e.R7$(3),e.Y8G("cdkDropListData",t.journeyStages),e.R7$(),e.Y8G("ngForOf",t.journeyStages)}}function w(r,m){if(1&r&&e.DNE(0,a,7,0,"div",12)(1,$,9,4,"div",13),2&r){const t=e.XpG();e.Y8G("ngIf",0===t.journeyStages.length),e.R7$(),e.Y8G("ngIf",t.journeyStages.length>0)}}const A=[{path:"",component:(()=>{class r{createNewStageService;cdr;toastr;router;reOrdering=!1;journeyStages=[];dataExists;loadingSubscription=new x.t(!0);loading$=this.loadingSubscription.asObservable();lastSyncedAt;modalConfig={modalTitle:"Create New Stage",centered:!1,size:"xl"};createNewStageComponent;modalComponent;constructor(t,n,s,d){this.createNewStageService=t,this.cdr=n,this.toastr=s,this.router=d}getBasePath(){return this.router.url.includes("/ad-radar/abm-settings")?"/ad-radar/abm-settings/journey-stage-model":"/settings/abm-settings/journey-stage-model"}getColorClass(t,n){switch(t.toLowerCase()){case"unaware":return"text-semantic-red";case"aware":return"text-semantic-orange";case"consideration":return"text-semantic-yellow";case"opportunity":return"text-semantic-green";case"customer":return"text-semantic-blue";default:const s=["text-color-1","text-color-2","text-color-3","text-color-4","text-color-5"];return s[n%s.length]}}ngOnInit(){this.loadJourneyStages()}loadJourneyStages(){this.loadingSubscription.next(!0),this.createNewStageService.getJourneyStages().subscribe(t=>
1{if(console.log("stages",t),t.data&&t.data.length>0){const n=new Map;t.data.forEach((s,d)=>{n.set(s._id,{...s,colorClass:this.getColorClass(s.name.toLowerCase(),d),accountCount:0})}),this.getJourneyStageAccountsCount(n),this.journeyStages=Array.from(n.values()),this.dataExists=!0}else this.journeyStages=[],this.dataExists=!1,console.warn("No journey stages found.");this.loadingSubscription.next(!1),this.cdr.detectChanges()},t=>{console.error("Error loading journey stages:",t),this.loadingSubscription.next(!1)})}getJourneyStageAccountsCount(t){this.createNewStageService.getJourneyStageAccountsCount().subscribe(n=>{console.log("Journey stage accounts count:",n),(Array.isArray(n?.data)?n.data:n?.data?.stages||[]).forEach(d=>{const S=t.get(d._id);S&&(S.accountCount=d.count)}),this.lastSyncedAt=n?.data?.lastSyncedAt?.journeyStage??null,this.journeyStages=Array.from(t.values()),this.cdr.detectChanges()},n=>{console.error("Error fetching journey stage accounts count:",n)})}openModal(){this.modalComponent.open()}dismissModal(t){this.modalComponent.dismiss()}toggleReOrdering(){this.reOrdering=!this.reOrdering}deleteStage(t){(0,p.b1)("Deleting this stage will impact all associated accounts. Accounts will be re-evaluated, and this action cannot be undone.","error",null,"Delete",!0,!0,"trushIcon",null,"",()=>{console.log("Deleting stage with ID:",t),this.createNewStageService.updateJourneyStage(t,{status:"deleted"}).subscribe(s=>{console.log("Stage deleted successfully:",s),this.toastr.success("Stage deleted successfully","Success"),this.loadJourneyStages()},s=>{console.error("Error deleting stage:",s)})})}onDrop(t){(0,h.HD)(this.journeyStages,t.previousIndex,t.currentIndex);const n=this.journeyStages.map(s=>s._id);this.createNewStageService.reorderJourneyStages(n).subscribe({next:s=>{this.toastr.success("Stages reordered successfully","Success"),console.log("Stages reordered successfully")},error:s=>{console.error("Error reordering stages:",s),(0,h.HD)(this.journeyStages,t.currentIndex,t.previousIndex)}})}static \u0275fac=function(n){return new(n||r)(e.rXU(j.s),e.rXU(e.gRc),e.rXU(b.tw),e.rXU(i.Ix))};static \u0275cmp=e.VBU({type:r,selectors:[["app-journey-stage-model"]],viewQuery:function(n,s){if(1&n&&(e.GBs(y,5),e.GBs(_,5)),2&n){let d;e.mGM(d=e.lsd())&&(s.createNewStageComponent=d.first),e.mGM(d=e.lsd())&&(s.modalComponent=d.first)}},decls:14,vars:5,consts:[["id","kt_app_toolbar",1,"app-toolbar","pt-0"],[1,"d-flex","flex-stack","flex-row-fluid","h-44px"],[1,"page-heading","text-gray-900","fw-bold","text-center","my-0"],[3,"routerLink"],["type","button",1,"btn-solid-primary","fw-semibold","p-3","ps-2"],[1,"ki-duotone","ki-plus","fs-4","p-0","me-1"],[1,"fs-7"],[1,"mt-8"],["class","d-flex card-body justify-content-center align-content-center h-50vh pt-0 pt-md-0 pt-xl-0 pb-0",4,"ngIf","ngIfElse"],["content",""],[1,"d-flex","card-body","justify-content-center","align-content-center","h-50vh","pt-0","pt-md-0","pt-xl-0","pb-0"],[1,"d-flex","align-items-center"],["class"," no-records-container-min-height d-flex align-items-center justify-content-center",4,"ngIf"],[4,"ngIf"],[1,"no-records-container-min-height","d-flex","align-items-center","justify-content-center"],[1,"d-flex","flex-column","align-items-center","justify-content-center","py-20"],["src","./assets/media/recotap-assets/illustrations/illustration-no-result.svg","alt","No ICP Created"],[1,"text-gray-700"],[1,"text-muted"],[1,"d-flex","justify-content-between","align-items-center","flex-grow-1"],["class"," border border-gray-100 bg-gray-50 p-2 fs-7 px-3 lh-sm text-gray-700 rounded-pill no-hover-cursor",4,"ngIf"],["reorderActiveButton",""],["cdkDropList","",1,"d-flex","flex-column","gap-4","mt-4",3,"cdkDropListData","cdkDropListDropped"],["class","py-3 px-6 card shadow-none rounded-5 d-flex flex-column gap-3","cdkDrag","","cdkDragLockAxis","y",3,"cdkDragDisabled","cdkDragData",4,"ngFor","ngForOf"],[1,"border","border-gray-100","bg-gray-50","p-2","fs-7","px-3","lh-sm","text-gray-700","rounded-pill","no-hover-cursor"],["src","./assets/media/recotap-assets/icons/arrows-circle-dark.svg","alt","Import CSV file",1,"me-2"],["class","btn-solid-secondary p-2 pe-3 h-44px fw-medium d-flex align-items-center text-center",3,"click",4,"ngIf","ngIfElse"],[1,"btn-solid-secondary","p-2","pe-3","h-44px","fw-medium","d-flex","align-items-center","text-center",3,"click"],["src","./assets/media/recotap-assets/icons/reorder-duotone.svg","alt","",1,"w-16px","h-16px","object-fit-contain","object-position-center"],[1,"fw-semibold","fs-lg","ms-2"],[1,"h-44px","d-flex","align-items-center","fs-lg","fw-semibold","lh-sm","btn-solid-primary","ps-3","p-2",3,"click"],[1,"fw-semibold","fs-lg","me-1"],["src","./assets/media/recotap-assets/icons/cross-solid-1.svg","alt","",1,"w-16px","h-16px"],["cdkDrag","","cdkDragLockAxis","y",1,"py-3","px-6","card","shadow-none","rounded-5","d-flex","flex-column","gap-3",3,"cdkDragDisabled","cdkDragData"],[1,"d-flex","align-items-center","justify-content-between","w-100"],["src","./assets/media/recotap-assets/icons/drag.svg","alt","Drag Icon","cdkDragHandle","","class","cursor-move me-3",4,"ngIf"],[1,"text-truncate","min-w-110px","mw-110px"],[3,"title"],[1,"text-gray-400","fw-normal","fs-7",3,"title"],[1,"border-start","w-500px","border-1","ms-4","h-44px","d-flex","align-items-center"],[1,"text-gray-700","fw-normal","text-truncate","fs-7","ms-4",3,"title"],["ngbDropdown","",1,"position-static","ps-3"],["editDropdown","ngbDropdown"],["type","button","ngbDropdownToggle","",1,"btn","p-0","justify-content-end","h-24px","w-24px","no-caret","bg-gray-50","border","border-gray-100","rounded-5",3,"disabled"],["src","./assets/media/recotap-assets/icons/dots-horizontal.svg","alt","more options",1,"rounded-5","w-100","h-100"],["ngbDropdownMenu","",1,"border","border-gray-100","bg-white","rounded-3","w-175px","mt-2","p-3","pe-2"],[1,"d-flex","flex-column","gap-0"],[1,"menu-item","bg-hover-gray-50","p-2"],["type","button",1,"menu-link","d-flex","bg-transparent","border-0","p-0",3,"disabled"],["src","./assets/media/recotap-assets/icons/edit-duotone.svg","alt","Archive"],[1,"py-0","fs-lg","lh-sm","ps-3","text-gray-700"],["type","button",1,"menu-link","d-flex","bg-transparent","border-0","p-0",3,"disabled","click"],["src","./assets/media/recotap-assets/icons/delete.svg","alt","Archive",1,"w-16px","h-16px"],["src","./assets/media/recotap-assets/icons/drag.svg","alt","Drag Icon","cdkDragHandle","",1,"curs
1or-move","me-3"]],template:function(n,s){if(1&n&&(e.j41(0,"div",0)(1,"div",1)(2,"h2",2),e.EFF(3," Journey Stage Model "),e.k0s(),e.j41(4,"a",3)(5,"button",4),e.nrm(6,"i",5),e.j41(7,"span",6),e.EFF(8,"Create New Stage"),e.k0s()()()()(),e.j41(9,"div",7),e.DNE(10,c,3,0,"div",8),e.nI1(11,"async"),e.DNE(12,w,2,2,"ng-template",null,9,e.C5r),e.k0s()),2&n){const d=e.sdS(13);e.R7$(4),e.Y8G("routerLink",s.getBasePath()+"/create-new-stage"),e.R7$(6),e.Y8G("ngIf",e.bMT(11,3,s.loading$))("ngIfElse",d)}},dependencies:[l.Sq,l.bT,i.Wk,g.tg,g.do,g.U0,h.O7,h.T1,h.Fb,l.Jj,l.vh,C.V]})}return r})()},{path:"create-new-stage",loadChildren:()=>Promise.all([o.e(7580),o.e(8002),o.e(462),o.e(8624)]).then(o.bind(o,46243)).then(r=>r.CreateNewStageModule)},{path:"edit-stage/:id",loadChildren:()=>Promise.all([o.e(7580),o.e(8002),o.e(462),o.e(8624)]).then(o.bind(o,46243)).then(r=>r.CreateNewStageModule)}];let J=(()=>{class r{static \u0275fac=function(n){return new(n||r)};static \u0275mod=e.$C({type:r});static \u0275inj=e.G2t({imports:[i.iI.forChild(A),i.iI]})}return r})();var F=o(72242),O=o(71224),L=o(84362),E=o(89417),G=o(34058),N=o(72510);let T=(()=>{class r{static \u0275fac=function(n){return new(n||r)};static \u0275mod=e.$C({type:r});static \u0275inj=e.G2t({imports:[l.MD,J,F.r,O.G,L.Dk,g.n8,g.zH,N.MQ,E.X1,E.YN,G.RZ,h.ad]})}return r})()},60845:(I,v,o)=>{o.d(v,{s:()=>C});var l=o(21626),i=o(7673),h=o(96354),p=o(99437),x=o(51989),e=o(54438),j=o(35212),b=o(71289);const g=`${x.c.apiUrl}`;let C=(()=>{class y{http;localStoragePersistService;authService;token;teamId;constructor(c,a,u){this.http=c,this.localStoragePersistService=a,this.authService=u,this.authService.currentUser$.subscribe(()=>{const f=this.authService.getAuthFromLocalStorage();this.token=f?.token,this.teamId=f?.userDetails?.clientAccounts[0]?.teams[0]?.teamId?._id})}getPageUrls(){if(!this.token)return(0,i.of)(null);const c=new l.Lr({Authorization:`Bearer ${this.token}`});return this.http.get(`${g}/page-urls`,{headers:c}).pipe((0,h.T)(a=>a?.data?.map(u=>({label:u?.url,key:u?.url}))),(0,p.W)(a=>(console.error("Error fetching page URLs:",a),(0,i.of)([]))))}createJourneyStage(c){if(!this.token)return(0,i.of)([]);const a=new l.Lr({Authorization:`Bearer ${this.token}`});return this.http.post(`${g}/journey-stage`,c,{headers:a}).pipe((0,p.W)(u=>(console.error("Error creating journey stage:",u),(0,i.of)([]))))}reorderJourneyStages(c){if(!this.token||!this.teamId)return(0,i.of)([]);const a=new l.Lr({Authorization:`Bearer ${this.token}`});return this.http.post(`${g}/journey-stage/reorder`,c,{headers:a}).pipe((0,p.W)(f=>(console.error("Error reordering journey stages:",f),(0,i.of)([]))))}updateJourneyStage(c,a){if(!this.token||!this.teamId)return(0,i.of)([]);const u=new l.Lr({Authorization:`Bearer ${this.token}`});return this.http.put(`${g}/journey-stage/${c}`,a,{headers:u}).pipe((0,p.W)(D=>(console.error("Error updating journey stage:",D),(0,i.of)([]))))}getJourneyStagesNames(){if(!this.token)return(0,i.of)([]);const c=new l.Lr({Authorization:`Bearer ${this.token}`});return this.http.get(`${g}/journey-stage/getStagesNames`,{headers:c}).pipe((0,h.T)(a=>a?.data||[]),(0,p.W)(a=>(console.error("Error fetching journey stages list:",a),(0,i.of)([]))))}getJourneyStageById(c){if(!this.token)return(0,i.of)(null);const a=new l.Lr({Authorization:`Bearer ${this.token}`});return this.http.get(`${g}/journey-stage/${c}`,{headers:a}).pipe((0,p.W)(u=>(console.error("Error fetching journey stage by ID:",u),(0,i.of)(null))))}getJourneyStages(){if(!this.token||!this.teamId)return(0,i.of)([]);const c=new l.Lr({Authorization:`Bearer ${this.token}`});return this.http.get(`${g}/journey-stage`,{headers:c}).pipe((0,p.W)(a=>(console.error("Error fetching journey stages:",a),(0,i.of)([]))))}getJourneyStageAccountsCount(){if(!this.token||!this.teamId)return(0,i.of)([]);const c=new l.Lr({Authorization:`Bearer ${this.token}`});return this.http.get(`${g}/accounts/journey-stages/count`,{headers:c}).pipe((0,p.W)(a=>(console.error("Error fetching journey stage accounts count:",a),(0,i.of)([]))))}static \u0275fac=function(a){return new(a||y)(e.KVO(l.Qq),e.KVO(j.m),e.KVO(b.uR))};static \u0275prov=e.jDH({token:y,factory:y.\u0275fac,providedIn:"root"})}return y})()}}]);
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.