1(self.webpackChunkclient_panel=self.webpackChunkclient_panel||[]).push([[6421,7207],{95508:(V,D,l)=>{"use strict";l.d(D,{P:()=>h});var p=l(2727);const h=()=>{setTimeout(()=>{p.Zu.reinitialization(),p.ai.reinitialization(),p.X4.reinitialization()},50)}},36139:(V,D,l)=>{"use strict";l.d(D,{w:()=>b});const p=JSON.parse('{"free-version-categories":["general","abstract","devices","location","users","it-newtwork","design","archive","typography","technologies","social-media","weather"],"categories":{"abstract":["abstract-33","abstract-27","abstract-26","abstract-32","abstract-18","abstract-24","abstract-30","abstract-8","abstract-9","abstract-31","abstract-25","abstract-19","abstract-21","abstract-35","abstract-34","abstract-20","abstract-36","abstract-22","abstract-23","abstract-37","abstract-44","abstract","abstract-45","abstract-47","abstract-46","abstract-42","abstract-43","abstract-41","abstract-40","abstract-48","abstract-49","abstract-12","abstract-2","abstract-3","abstract-13","abstract-39","abstract-11","abstract-1","abstract-10","abstract-38","abstract-14","abstract-28","abstract-4","abstract-5","abstract-29","abstract-15","abstract-17","abstract-7","abstract-6","abstract-16"],"settings":["toggle-on","toggle-on-circle","toggle-off","category","setting","toggle-off-circle","more-2","setting-4","setting-2","setting-3"],"design":["eraser","paintbucket","add-item","design-2","brush","size","design","copy","text","design-frame","bucket","glass","feather","pencil","colors-square","design-mask","bucket-square","copy-success","color-swatch"],"social-media":["instagram","snapchat","classmates","facebook","whatsapp","social-media","youtube","dribbble","twitter","tiktok","behance"],"it-network":["underlining","disconnect","code","gear","loading","scroll","wrench","square-brackets","frame","message-programming","data","fasten","click"],"technologies":["tech-wifi","joystick","faceid","technology-3","technology-2","electricity","fingerprint-scanning","technology-4","artificial-intelligence","technology"],"ecommerce":["basket-ok","cheque","handcart","shop","tag","purchase","discount","package","percentage","barcode","lots-shopping","basket"],"archive":["book-square","receipt-square","save-2","archive-tick"],"security":["shield-search","password-check","shield-tick","lock","key","shield","shield-cross","key-square","eye-slash","security-check","lock-3","scan-barcode","lock-2","eye","shield-slash","security-user"],"general":["triangle","subtitle","ghost","information","milk","home","happy-emoji","mouse-square","filter-tick","filter-search","wifi-home","trash-square","paper-clip","archive","pin","wifi-square","auto-brightness","coffee","icon","emoji-happy","general-mouse","ranking","slider","crown-2","rescue","flash-circle","safe-home","cloud-change","crown","filter-edit","picture","verify","send","tag-cross","cloud-add","home-3","disk","trash","star","cd","home-2","mouse-circle","home-1","call","gift","share","sort","magnifier","filter-square","tree","filter","switch","cloud","cup","diamonds","status","rocket","cloud-download","menu","chrome"],"location":["geolocation-home","map","telephone-geolocation","satellite","flag","focus","pointers","compass","route","geolocation"],"education":["brifecase-timer","briefcase","clipboard","bookmark-2","note","note-2","book-open","book","teacher","award","brifecase-tick","brifecase-cros","bookmark"],"business":["chart-line","chart","graph-3","chart-pie-3","graph-2","chart-line-down","chart-pie-too","chart-pie-4","chart-line-down-2","graph-4","chart-line-up-2","badge","chart-line-up","chart-simple-3","chart-pie-simple","chart-simple-2","graph-up","chart-line-star","graph","chart-simple"],"files-folders":["tablet-delete","file-added","file-up","minus-folder","file","delete-files","add-folder","file-left","file-deleted","some-files","file-right","notepad","notepad-bookmark","document","like-folder","folder-up","folder-added","file-down","filter-tablet","tablet-book","update-file","add-notepad","questionnaire-tablet","tablet-up","tablet-ok","update-folder","files-tablet","folder-down","notepad-edit","tablet-text-up","search-list","tablet-text-down","add-files","tablet-down","delete-folder","folder","file-sheet"],"software":["bootstrap","figma","dropbox","xaomi","microsoft","android","vue","js","
1spring-framework","github","dj","google-play","angular","soft-3","python","soft-2","ts","xd","spotify","js-2","laravel","css","google","photoshop","twitch","illustrator","pails","react","html","slack","soft","yii","apple","vuesax"],"time":["calendar-add","calendar-search","calendar-2","calendar-tick","time","watch","calendar-edit","calendar","calendar-8","timer","calendar-remove"],"support":["heart-circle","like","information-4","information-5","information-2","information-3","question","dislike","message-question","medal-star","like-tag","like-2","support-24","question-2","lovely","like-shapes","heart"],"users":["user","user-square","user-tick","people","user-edit","profile-user","profile-circle"],"medicine":["capsule","virus","bandage","thermometer","flask","test-tubes","syringe","mask","pill","pulse"],"burger-menu":["burger-menu","burger-menu-6","burger-menu-5","burger-menu-4","burger-menu-1","burger-menu-3","burger-menu-2"],"typography":["text-align-center","text-italic","text-bold","text-strikethrough","text-underline","text-number","text-align-left","text-align-right","text-circle","text-align-justify-center"],"finance":["theta","dollar","binance","nexo","euro","avalanche","bitcoin","wallet","price-tag","finance-calculator","dash","lts","vibe","credit-cart","paypal","bill","ocean","celsius","educare","enjin-coin","two-credit-cart","bank","binance-usd","wanchain","trello","save-deposit","xmr","financial-schedule","office-bag"],"weather":["night-day","sun","drop","moon"],"arrows":["exit-right-corner","dots-circle-vertical","check-square","right-left","arrow-down","dots-horizontal","arrow-right-left","up-down","double-check","arrow-up-left","down","exit-up","up-square","down-square","plus-square","dots-circle","arrow-down-left","double-check-circle","up","entrance-right","arrow-right","arrow-two-diagonals","minus-square","arrow-diagonal","black-left","arrow-down-refraction","black-right","double-left","arrow-circle-left","arrow-zigzag","plus","check","exit-left","arrow-circle-right","cross-square","entrance-left","left-square","arrows-loop","black-left-line","double-left-arrow","check-circle","right","dots-square-vertical","arrow-up-right","exit-down","dots-square","to-left","double-down","plus-circle","black-down","double-up","black-up","double-right-arrow","arrow-up","black-right-line","arrow-up-refraction","arrow-left","cross","minus-circle","arrow-down-right","exit-right","to-right","double-right","arrow-mix","right-square","arrows-circle","cross-circle","left","minus","dots-vertical","arrow-up-down"],"communication":["message-text-2","message-notif","message-add","sms","directbox-default","message-text","messages","address-book","message-edit","message-minus"],"notifications":["notification-circle","notification-favorite","notification-2","notification","notification-bing","notification-status","notification-on"],"delivery-and-logistics":["scooter-2","parcel","delivery-time","delivery","delivery-24","ship","courier","logistic","trailer","car-2","car-3","airplane-square","scooter","truck","cube-3","bus","cube-2","delivery-door","delivery-3","delivery-2","car","courier-express","airplane","delivery-geolocation","parcel-tracking"],"devices":["monitor-mobile","devices","keyboard","devices-2","bluetooth","wifi","airpod","simcard-2","speaker","printer","simcard","router","phone","electronic-clock","external-drive","laptop","tablet","screen","calculator","mouse"],"grid":["grid","slider-vertical-2","maximize","slider-vertical","row-horizontal","kanban","row-vertical","fat-rows","grid-2","element-8","element-9","element-12","element-4","element-5","grid-frame","element-11","element-7","element-6","element-10","element-2","element-3","element-equal","element-1","slider-horizontal-2","slider-horizontal","element-plus"]},"duotone-paths":{"abstract-33":2,"abstract-27":2,"abstract-26":2,"abstract-32":2,"abstract-18":2,"abstract-24":2,"abstract-30":2,"abstract-8":2,"abstract-9":2,"abstract-31":2,"abstract-25":2,"abstract-19":2,"abstract-21":2,"abstract-35":2,"abstract-34":2,"abstract-20":2,"abstract-36":2,"abstract-22":2,"abstract-23":2,"abstract-37":2,"abstract-44":2,"abstract":2,"abstract-45":2,"abstract-47":2,"abstract-46":2,"abstract-42":2,"abstract-43":2,"abstract-41":2,"abstract-40":2,"abstract-48":3,"abstract-49":3,"abstract-12":2,"abstract-2":2,"abstract-3":2,"abstract-13":2,"abstract-39":2,"abstract-11":2,"abstract-1":2,"abstract-10":2,"abstract-38":2,"abstract-14":2,"abstract-28":2,"abstract-4":2,"abstract-5":2,"abstract-29":2,"abstract-15":2,"abstract-17":2,"abstract-7":2,"abstract-6":0,"abstract-16":2,"toggle-on":2,"toggle-on-circle":2,"toggle-off":2,"category":4,"setting":2,"toggle-off-circle":2,"more-2":4,"setting-4":0,"setting-2":2,"setting-3":5,"eraser":3,"paintbucket":3,"add-item":3,"design-2":2,"brush":2,"size":2,"design":2,"copy":0,"text":0,"design-frame":2,"bu
1cket":4,"glass":3,"feather":2,"pencil":2,"colors-square":4,"design-mask":2,"bucket-square":3,"copy-success":2,"color-swatch":21,"instagram":2,"snapchat":2,"classmates":2,"facebook":2,"whatsapp":2,"social-media":2,"youtube":2,"dribbble":6,"twitter":2,"tiktok":2,"behance":2,"underlining":3,"disconnect":5,"code":4,"gear":2,"loading":2,"scroll":3,"wrench":2,"square-brackets":4,"frame":4,"message-programming":4,"data":5,"fasten":2,"click":5,"tech-wifi":2,"joystick":4,"faceid":6,"technology-3":4,"technology-2":2,"electricity":10,"fingerprint-scanning":5,"technology-4":7,"artificial-intelligence":8,"technology":9,"basket-ok":4,"cheque":7,"handcart":0,"shop":5,"tag":3,"purchase":2,"discount":2,"package":3,"percentage":2,"barcode":8,"lots-shopping":8,"basket":4,"book-square":3,"receipt-square":2,"save-2":2,"archive-tick":2,"shield-search":3,"password-check":5,"shield-tick":2,"lock":3,"key":2,"shield":2,"shield-cross":3,"key-square":2,"eye-slash":4,"security-check":4,"lock-3":3,"scan-barcode":8,"lock-2":5,"eye":3,"shield-slash":3,"security-user":2,"triangle":3,"subtitle":5,"ghost":3,"information":3,"milk":3,"home":0,"happy-emoji":2,"mouse-square":2,"filter-tick":2,"filter-search":3,"wifi-home":4,"trash-square":4,"paper-clip":0,"archive":3,"pin":2,"wifi-square":4,"auto-brightness":3,"coffee":6,"icon":3,"emoji-happy":4,"general-mouse":2,"ranking":4,"slider":4,"crown-2":3,"rescue":2,"flash-circle":2,"safe-home":2,"cloud-change":3,"crown":2,"filter-edit":2,"picture":2,"verify":2,"send":2,"tag-cross":3,"cloud-add":2,"home-3":2,"disk":2,"trash":5,"star":0,"cd":2,"home-2":2,"mouse-circle":2,"home-1":2,"call":8,"gift":4,"share":6,"sort":4,"magnifier":2,"filter-square":2,"tree":3,"filter":2,"switch":2,"cloud":0,"cup":2,"diamonds":2,"status":3,"rocket":2,"cloud-download":2,"menu":4,"chrome":2,"geolocation-home":2,"map":3,"telephone-geolocation":3,"satellite":6,"flag":2,"focus":2,"pointers":3,"compass":2,"route":4,"geolocation":2,"brifecase-timer":3,"briefcase":2,"clipboard":3,"bookmark-2":2,"note":2,"note-2":4,"book-open":4,"book":4,"teacher":2,"award":3,"brifecase-tick":3,"brifecase-cros":3,"bookmark":2,"chart-line":2,"chart":2,"graph-3":2,"chart-pie-3":3,"graph-2":3,"chart-line-down":2,"chart-pie-too":2,"chart-pie-4":3,"chart-line-down-2":3,"graph-4":2,"chart-line-up-2":2,"badge":5,"chart-line-up":2,"chart-simple-3":4,"chart-pie-simple":2,"chart-simple-2":4,"graph-up":6,"chart-line-star":3,"graph":4,"chart-simple":4,"tablet-delete":3,"file-added":2,"file-up":2,"minus-folder":2,"file":2,"delete-files":2,"add-folder":2,"file-left":2,"file-deleted":2,"some-files":2,"file-right":2,"notepad":5,"notepad-bookmark":6,"document":2,"like-folder":2,"folder-up":2,"folder-added":2,"file-down":2,"filter-tablet":2,"tablet-book":2,"update-file":4,"add-notepad":4,"questionnaire-tablet":2,"tablet-up":3,"tablet-ok":3,"update-folder":2,"files-tablet":2,"folder-down":2,"notepad-edit":2,"tablet-text-up":2,"search-list":3,"tablet-text-down":4,"add-files":3,"tablet-down":3,"delete-folder":2,"folder":2,"file-sheet":2,"bootstrap":3,"figma":5,"dropbox":5,"xaomi":2,"microsoft":4,"android":6,"vue":2,"js":2,"spring-framework":0,"github":2,"dj":0,"google-play":2,"angular":3,"soft-3":2,"python":2,"soft-2":2,"ts":3,"xd":3,"spotify":2,"js-2":2,"laravel":7,"css":2,"google":2,"photoshop":2,"twitch":3,"illustrator":4,"pails":9,"react":2,"html":2,"slack":8,"soft":6,"yii":3,"apple":2,"vuesax":3,"calendar-add":6,"calendar-search":4,"calendar-2":5,"calendar-tick":6,"time":2,"watch":2,"calendar-edit":3,"calendar":2,"calendar-8":6,"timer":3,"calendar-remove":6,"heart-circle":2,"like"
1:2,"information-4":3,"information-5":3,"information-2":3,"information-3":3,"question":3,"dislike":2,"message-question":3,"medal-star":4,"like-tag":2,"like-2":2,"support-24":3,"question-2":3,"lovely":2,"like-shapes":2,"heart":2,"user":2,"user-square":3,"user-tick":3,"people":5,"user-edit":3,"profile-user":4,"profile-circle":3,"capsule":2,"virus":3,"bandage":2,"thermometer":2,"flask":2,"test-tubes":2,"syringe":3,"mask":3,"pill":0,"pulse":2,"burger-menu":4,"burger-menu-6":0,"burger-menu-5":0,"burger-menu-4":0,"burger-menu-1":4,"burger-menu-3":9,"burger-menu-2":10,"text-align-center":4,"text-italic":4,"text-bold":3,"text-strikethrough":3,"text-underline":3,"text-number":6,"text-align-left":4,"text-align-right":4,"text-circle":6,"text-align-justify-center":4,"theta":2,"dollar":3,"binance":5,"nexo":2,"euro":3,"avalanche":2,"bitcoin":2,"wallet":4,"price-tag":3,"finance-calculator":7,"dash":2,"lts":2,"vibe":2,"credit-cart":2,"paypal":2,"bill":6,"ocean":19,"celsius":2,"educare":4,"enjin-coin":2,"two-credit-cart":5,"bank":2,"binance-usd":4,"wanchain":2,"trello":3,"save-deposit":4,"xmr":2,"financial-schedule":4,"office-bag":4,"night-day":10,"sun":9,"drop":2,"moon":2,"exit-right-corner":2,"dots-circle-vertical":4,"check-square":2,"right-left":3,"arrow-down":2,"dots-horizontal":3,"arrow-right-left":2,"up-down":3,"double-check":2,"arrow-up-left":2,"down":0,"exit-up":2,"up-square":2,"down-square":2,"plus-square":3,"dots-circle":4,"arrow-down-left":2,"double-check-circle":3,"up":0,"entrance-right":2,"arrow-right":2,"arrow-two-diagonals":5,"minus-square":2,"arrow-diagonal":3,"black-left":0,"arrow-down-refraction":2,"black-right":0,"double-left":2,"arrow-circle-left":2,"arrow-zigzag":2,"plus":0,"check":0,"exit-left":2,"arrow-circle-right":2,"cross-square":2,"entrance-left":2,"left-square":2,"arrows-loop":2,"black-left-line":2,"double-left-arrow":2,"check-circle":2,"right":0,"dots-square-vertical":4,"arrow-up-right":2,"exit-down":2,"dots-square":4,"to-left":0,"double-down":3,"plus-circle":2,"black-down":0,"double-up":3,"black-up":0,"double-right-arrow":2,"arrow-up":2,"black-right-line":2,"arrow-up-refraction":2,"arrow-left":2,"cross":2,"minus-circle":2,"arrow-down-right":2,"exit-right":2,"to-right":0,"double-right":2,"arrow-mix":2,"right-square":2,"arrows-circle":2,"cross-circle":2,"left":0,"minus":0,"dots-vertical":3,"arrow-up-down":2,"message-text-2":3,"message-notif":5,"message-add":3,"sms":2,"directbox-default":4,"message-text":3,"messages":5,"address-book":3,"message-edit":2,"message-minus":2,"notification-circle":2,"notification-favorite":3,"notification-2":2,"notification":3,"notification-bing":3,"notification-status":4,"notification-on":5,"scooter-2":0,"parcel":5,"delivery-time":5,"delivery":5,"delivery-24":4,"ship":3,"courier":3,"logistic":7,"trailer":5,"car-2":6,"car-3":3,"airplane-square":2,"scooter":7,"truck":5,"cube-3":2,"bus":5,"cube-2":3,"delivery-door":4,"delivery-3":3,"delivery-2":9,"car":5,"courier-express":7,"airplane":2,"delivery-geolocation":5,"parcel-tracking":3,"monitor-mobile":2,"devices":5,"keyboard":2,"devices-2":3,"bluetooth":2,"wifi":4,"airpod":3,"simcard-2":2,"speaker":3,"printer":5,"simcard":5,"router":2,"phone":2,"electronic-clock":4,"external-drive":5,"laptop":2,"tablet":3,"screen":4,"calculator":6,"mouse":2,"grid":2,"slider-vertical-2":3,"maximize":5,"slider-vertical":3,"row-horizontal":2,"kanban":2,"row-vertical":2,"fat-rows":2,"grid-2":2,"element-8":2,"element-9":2,"element-12":3,"element-4":2,"element-5":2,"grid-frame":3,"element-11":4,"element-7":2,"element-6":2,"element-10":3,"element-2":2,"element-3":2,"element-equal":5,"element-1":4,"slider-horizontal-2":3,"slider-horizontal":3,"element-plus":5},"number":573}');var h=l(54438),w=l(60177);function e(g,u){1&g&&h.nrm(0,"span"),2&g&&h.ZvI("path",u.index+1,"")}const E=()=>[];function _(g,u){if(1&g&&(h.j41(0,"i"),h.DNE(1,e,1,3,"span",1),h.k0s()),2&g){const c=h.XpG();h.ZWY("ki-",c.type," ki-",c.name,"",c.class?" "+c.class:"",""),h.R7$(),h.Y8G("ngForOf",h.lJ4(6,E).constructor(c.pathsNumber))}}function f(g,u){if(1&g&&h.nrm(0,"span"),2&g){const c=h.XpG();h.ZWY("ki-",c.type," ki-",c.name,"",c.class?" "+c.class:"","")}}let b=(()=>{class g{name;class;type="duotone";pathsNumber=0;constructor(){}ngOnInit(){"duotone"===this.type&&(this.pathsNumber=p[this.type+"-paths"][this.name]??0)}get styleDisplay(){return"contents"}static \u0275fac=function(x){return new(x||g)};static \u0275cmp=h.VBU({type:g,selectors:[["app-keenicon"]],hostVars:2,hostBindings:function(x,d){2&x&&h.xc7("display",d.styleDisplay)},inputs:{name:"name",class:"class",type:"type"},decls:2,vars:2,consts:[[3,"class",4,"ngIf"],[3,"class",4,"ngFor","ngForOf"]],template:function(x,d){1&x&&h.DNE(0,_,2,7,"i",0)(1,f,1,5,"span",0),2&x&&(h.Y8G("ngIf","duotone"===d.type),h.R7$(),h.Y8G("ngIf","duotone"!==d.type))},dependencies:[w.Sq,w.bT]})}return g})()}
1,77207:(V,D,l)=>{"use strict";l.d(D,{R:()=>u});var p=l(97586),w=l(51653),f=(l(87580),l(84412)),b=l(97801),g=l(54438);let u=(()=>{class c{dateRangeSelected$;dateRangeSelectedSubject;dateFormat="";defaultDateRange={projectStartDate:this.getProjectStartDateFromLocalStorage(),endDate:p().endOf("day").toISOString()};constructor(){this.dateRangeSelectedSubject=new f.t(void 0),this.dateRangeSelected$=this.dateRangeSelectedSubject.asObservable(),this.dateFormat=b.A.DATE_FORMAT,console.log("Default Date Range:",this.defaultDateRange),this.refreshDateRange()}getProjectStartDateFromLocalStorage(){const d=localStorage.getItem("teamCreatedAt");if(console.log("Retrieved projectStartDate from localStorage:",d),d){const o=p(d,p.ISO_8601,!0);if(o.isValid())return console.log("Parsed projectStartDate:",o.startOf("day").toISOString()),o.startOf("day").toISOString();console.error("Invalid Date format for projectStartDate:",d)}else console.error("projectStartDate is null or undefined");return p("02-05-2022","DD-MM-YYYY").startOf("day").toISOString()}initializeDateRangePicker(d,o,M,j="left"){this.refreshDateRange();const I=w(`#${d}`);I.daterangepicker("remove");let v=p(this.defaultDateRange.projectStartDate).startOf("day"),y=p().endOf("day");o&&M&&(o=p(o).startOf("day"),M=p(M).endOf("day")),I.daterangepicker({opens:j,showDropdowns:!0,minYear:2e3,linkedCalendars:!1,locale:{format:this.dateFormat},startDate:o||v,endDate:M||y,maxDate:"closeDateRangePicker"===d?null:p(),ranges:{"All Time":[v,y],Today:[p(),p()],Yesterday:[p().subtract(1,"days"),p().subtract(1,"days")],"Last 7 Days":[p().subtract(6,"days"),p()],"Last 30 Days":[p().subtract(29,"days"),p()],"This Month":[p().startOf("month"),p().endOf("month")],"Last Month":[p().subtract(1,"month").startOf("month"),p().subtract(1,"month").endOf("month")]}}),I.on("show.daterangepicker",()=>{const P=document.getElementById("kt_app_wrapper");P&&(P.style.overflow="hidden");const N=I.data("daterangepicker");N&&(N.drops="down",N.updateView())}),I.on("hide.daterangepicker apply.daterangepicker",()=>{const P=document.getElementById("kt_app_wrapper");P&&(P.style.overflow="")}),I.on("apply.daterangepicker",(P,N)=>{if(N&&N.startDate&&N.endDate){const L=N.startDate.format(this.dateFormat),Z=N.endDate.format(this.dateFormat);this.dateRangeSelectedSubject.next({dateRange:`${L} - ${Z}`,elementId:d})}})}initializeSingleDatePicker(d,o,M="left"){const j=w(`#${d}`);j.daterangepicker("remove");const I=o?p(o):p();j.daterangepicker({singleDatePicker:!0,opens:M,showDropdowns:!0,minYear:2e3,linkedCalendars:!1,locale:{format:this.dateFormat},startDate:I,endDate:I,maxDate:p(),autoApply:!0}),j.on("apply.daterangepicker",(v,y)=>{if(y&&y.startDate){const F=y.startDate.format(this.dateFormat);this.dateRangeSelectedSubject.next({dateRange:F,elementId:d,isSingleDate:!0})}})}refreshDateRange(){this.defaultDateRange.projectStartDate=this.getProjectStartDateFromLocalStorage(),this.defaultDateRange.endDate=p().endOf("day").toISOString(),console.log("Refreshed Date Range:",this.defaultDateRange)}checkDateRangeMatch(d){const[o,M]=d.split(" - "),{projectStartDate:j,endDate:I}=this.defaultDateRange,v=p(o,"DD/MM/YYYY"),y=p(M,"DD/MM/YYYY"),F=p(j),P=p(I);return v.isSame(F,"day")&&y.isSame(P,"day")}static \u0275fac=function(o){return new(o||c)};static \u0275prov=g.jDH({token:c,factory:c.\u0275fac,providedIn:"root"})}return c})()},99980:(V,D,l)=>{"use strict";l.r(D),l.d(D,{ImportsModule:()=>wi});var p=l(60177),h=l(29599),w=l(12791),e=l(54438);let E=(()=>{class i{static \u0275fac=function(a){return new(a||i)};static \u0275cmp=e.VBU({type:i,selectors:[["app-imports"]],decls:2,vars:0,consts:[[1,"container-fluid","p-0"]],template:function(a,n){1&a&&(e.j41(0,"div",0),e.nrm(1,"router-outlet"),e.k0s())},dependencies:[w.n3]})}return i})();var _=l(21413),f=l(70152),b=l(40668),g=l(97088),u=l(54288),c=l(29968),x=l(58677),d=l(62796),o=l(89417),M=l(97586),j=l.n(M),I=l(97801),v=l(77207),y=l(72510);function F(i,r){if(1&i&&(e.j41(0,"ng-option",17),e.EFF(1),e.k0s()),2&i){const t=r.$implicit;e.Y8G("value",t._id),e.R7$(),e.JRh(t.name)}}function P(i,r){1&i&&(e.j41(0,"ng-option",18),e.EFF(1,"No Data Found"),e.k0s())}function N(i,r){if(1&i&&(e.j41(0,"ng-option",17),e.EFF(1),e.k0s()),2&i){const t=r.$implicit;e.Y8G("value",t),e.R7$(),e.JRh(t)}}let L=(()=>{class i{formbuilder;dateRangePickerService;importsService;randomId;importsFilterForm;dateRangeSelected$;filterResetBool;dateFormat="";appliedFiltersCount$=new _.B;filterApplied=new e.bkB;filterReset=new e.bkB;defaultDateRange={projectStartDate:"",endDate:""};selectedFilterData={userId:[],objectType:[],dateRange:"",status:[]};subscriptions=[];users=[];objectTypes=["accounts","contacts","deals"];importsStatus=["processing","completed"];constructor(t,a,n){this.formbuilder=t,this.dateRangePickerService=a,this.importsService=n,this.dateRangeSelected$=this.dateRangePickerService.dateRangeSelected$,this.defaultDateRange=this.importsService.defaultDateRange,this.dateFormat=I.A.DATE_FORMAT}ngOnInit(){this.randomId=this.random(),this.initFilterForm(),this.fetchUsers()}initFilterForm(){const t=this.importsService.importsListPayloadValue;this.importsFilterForm=this.formbuilder.group({userId:[t.userId],objectType:[t.objectType],dateRange:t.dateRange,status:[t.status]});const a=this.importsFilterForm.valueChanges.subscribe(n=>{this.appliedFiltersCount$.next(this.getAppliedFiltersCount())});this.subscriptions.push(a)}ngAfterViewInit(){this.initializeDateRangePicker();const t=this.dateRangeSelected$.subscribe(a=>{a&&a.elementId==`createdDateRangePicker-${this.randomId}`&&this.importsFilterForm.get("dateRange")?.setValue(a.dateRange)});this.subscriptions.push(t)}formatSelectedDateRange(t){const[a,n]=t.split(" - ");return`${j()(a,this.dateFormat).startOf("day").toISOString()}--${j()(n,this.dateFormat).endOf("day").toISOString()}`}applyFilter(){this.filterResetBool=!1;let t={...this.importsFilterForm.value,appliedFiltersCount:this.getAppliedFiltersCount()};t.dateRange=t.dateRange&&!this.dateRangePickerService.checkDateRangeMatch(t.dateRange)?this.formatSelectedDateRange(t.dateRange):"",this.filterApplied.emit(t)}initializeDateRangePicker(){if(this.dateRangePickerService.initializeDateRangePicker){const[t,a]=this.importsService.importsListPayloadValue.dateRange.split("--");this.dateRangePickerService.initializeDateRangePicker(`createdDateRangePicker-${this.randomId}`,t,a)}else console.error("Datepicker component not found.")}resetForm(){this.filterResetBool=!0,this.importsFilterForm.reset(this.selectedFilterData),this.dateRangePickerService.initializeDateRangePicker(`createdDateRangePicker-${this.randomId}`,this.defaultDateRange.projectStartDate,this.defaultDateRange.endDate),this.filterReset.emit(),this.appliedFiltersCount$.next(0)}fetchUsers(){this.importsService.getUsers().subscribe({next:t=>{t&&(this.users=t.data)},error:t=>{console.error("Error fetching users:",t)}})}getAppliedFiltersCount(){let t=Object.values(this.importsFilterForm.controls).filter(n=>{const s=n.value;return s&&(!Array.isArray(s)||s.length>0)}).length;const a=this.importsFilterForm.controls.dateRange.value;if(a){const[n,s]=a.split(" - "),[m,k]=[j()(this.importsService.defaultDateRange.projectStartDate).format(this.dateFormat),j()(this.importsService.defaultDateRange.endDate).format(this.dateFormat)];n===m&&s===k&&(t-=1)}return console.log(t,"count"),t}random(){return Math.random().toString(36).substring(2,15)}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}static \u0275fac=function(a){return new(a||i)(e.rXU(o.ok),e.rXU(v.R),e.rXU(g.s))};static \u0275cmp=e.VBU({type:i,selectors:[["app-imports-list-filter"]],outputs:{filterApplied:"filterApplied",filterReset:"filterReset"},decls:33,vars:17,consts:[[1,"py-6","px-8","border-0","border-top-1","border-bottom-1","border-dashed","border-gray-300"],[3,"formGroup"],[1,"row","g-8"],[1,"col-12","col-sm-6","col-lg-4"],[1,"fv-row"],[1,"form-label","text-gray-900","fw-bold","fs-lg","mb-3"],["formControlName","userId","placeholder","Select User",1,"ng-select__customStyles",3,"multiple","clearable","hideSelected","virtualScroll","closeOnSelect"],[3,"value",4,"ngFor","ngForOf"],["disabled","!users.length",4,"ngIf"],["formControlName","objectType","placeholder","Select Type",1,"ng-select__customStyles","text-capitalize",3,"multiple","clearable","hideSelected","virtualScroll","closeOnSelect"],[1,"position-relative"],["readonly","","placeholder","Pick date range","formControlName","dateRange",1,"form-control","form-control-solid","rounded-pill","fs-lg","mh-38px","border-0","px-4","py-2",3,"id"],["src","./assets/media/recotap-assets/icons/calendar-duotone.svg","alt","calendar-icon",1,"position-absolute","end-0","top-0","bottom-0","m-auto","me-4"],["bindLabel","status","bindValue","status","formControlName","status","placeholder","Select Status",1,"ng-select__customStyles","text-capitalize",3,"items","clearable"],[1,"mt-6","d-flex","align-items-center","gap-3"],["type","button","data-bs-toggle","collapse","data-bs-target","#kt-accordion-imports-filter",1,"btn","btn-lg","btn-active-primary","border","border-gray-900","px-4","py-3","fs-lg","lh-sm",3,"click"],["type","button",1,"btn-outline-primary","px-4","py-3","fs-lg","lh-sm",3,"click"],[3,"value"],["disabled","!users.length"]],template:function(a,n){1&a&&(e.j41(0,"div",0)(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"label",5),e.EFF(6,"User"),e.k0s(),e.j41(7,"ng-select",6),e.DNE(8,F,2,2,"ng-option",7)(9,P,2,0,"ng-option",8),e.k0s()()(),e.j41(10,"div",3)(11,"div",4)(12,"label",5),e.EFF(13,"Object Type"),e.k0s(),e.j41(14,"ng-select",9),e.DNE(15,N,2,2,"ng-option",7),e.k0s()()(),e.j41(16,"div",3)(17,"div",4)(18,"label",5),e.EFF(19,"Created Date"),e.k0s(),e.j41(20,"div",10),e.nrm(21,"input",11)(22,"img",12),e.k0s()()(),e.j41(23,"div",3)(24,"div",4)(25,"label",5),e.EFF(26,"Status"),e.k0s(),e.nrm(27,"ng-select",13),e.k0s()()(),e.j41(28,"div",14)(29,"button",15),e.bIt("click",function(){return n.applyFilter()}),e.EFF(30," Apply filter "),e.k0s(),e.j41(31,"button",16),e.bIt("click",function(){return n.resetForm()}),e.EFF(32," Reset "),e.k0s()()()()),2&a&&(e.R7$(),e.Y8G("formGroup",n.importsFilterForm),e.R7$(6),e.Y8G("multiple",!0)("clearable",!0)("hideSelected",!0)("virtualScroll",!0)("closeOnSelect",!1),e.R7$(),e.Y8G("ngForOf",n.users),e.R7$(),e.Y8G("ngIf",!n.users.length),e.R7$(5),e.Y8G("multiple",!0)("clearable",!0)("hideSelected",!0)("virtualScroll",!0)("closeOnSelect",!1),e.R7$(),e.Y8G("ngForOf",n.objectTypes),e.R7$(6),e.Y8G("id","createdDateRangePicker-"+n.randomId),e.R7$(6),e.Y8G("items",n.importsStatus)("clearable",!0))},dependencies:[p.Sq,p.bT,y.vr,y.xt,o.qT,o.me,o.BC,o.cb,o.j4,o.JD],encapsulation:2})}return i})();function Z(i,r){1&i&&(e.j41(0,"div",10)(1,"a",11)(2,"button",12),e.nrm(3,"i",13),e.j41(4,"span",14),e.EFF(5,"Import"),e.k0s()()()())}function ce(i,r){1&i&&(e.j41(0,"i",42),e.nrm(1,"span",43)(2,"span",44),e.k0s())}function de(i,r){if(1&i&&(e.j41(0,"span",45),e.EFF(1),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.JRh(t.filterData.appliedFiltersCount)}}function me(i,r){1&i&&e.nrm(0,"img",46)}function ue(i,r){if(1&i&&(e.j41(0,"div",71),e.EFF(1),e.nI1(2,"number"),e.k0s()),2&i){const t=e.XpG().$implicit;e.R7$(),e.SpI(" ",e.bMT(2,1,t.insertedRecords)," ")}}function ge(i,r){1&i&&(e.j41(0,"div",71),e.EFF(1," - "),e.k0s())}function fe(i,r){if(1&i&&(e.j41(0,"div",72),e.EFF(1),e.nI1(2,"number"),e.k0s()),2&i){const t=e.XpG().$implicit;e.R7$(),e.SpI(" ",e.bMT(2,1,t.updatedRecords)," ")}}function he(i,r){1&i&&(e.j41(0,"div",72),e.EFF(1," - "),e.k0s())}function be(i,r){1&i&&(e.j41(0,"div",73)(1,"span",74),e.EFF(2," - "),e.k0s()())}function _e(i,r){if(1&i){const t=e.RV6();e.j41(0,"div",73)(1,"span",75),e.EFF(2),e.j41(3,"img",76),e.bIt("click",function(){e.eBV(t);const n=e.XpG().$implicit,s=e.XpG(3);return e.Njj(s.onFileClick(n.errorFilePath))}),e.k0s()()()}if(2&i){const t=e.XpG().$implicit;e.R7$(2),e.SpI(" ",t.errorRecords," ")}}const ve=(i,r)=>({"badge-outline-semantic-green":i,"badge-outline-semantic-purple":r});function ye(i,r){if(1&i){const t=e.RV6();e.j41(0,"tr")(1,"td",48)(2,"div",49)(3,"div",50),e.bIt("click",function(){const s=e.eBV(t).$implicit,m=e.XpG(3);return e.Njj(m.onFileClick(s.originalFilePath))}),e.EFF(4),e.k0s(),e.j41(5,"div",51),e.EFF(6),e.k0s()()(),e.j41(7,"td",52),e.DNE(8,ue,3,3,"div",53)(9,ge,2,0,"div",53),e.k0s(),e.j41(10,"td",54),e.DNE(11,fe,3,3,"div",55)(12,he,2,0,"div",55),e.k0s(),e.j41(13,"td",54),e.DNE(14,be,3,0,"div",56)(15,_e,4,1,"div",57),e.k0s(),e.j41(16,"td",58)(17,"div",59)(18,"span",60),e.EFF(19),e.nI1(20,"date"),e.k0s(),e.j41(21,"span",61),e.EFF(22),e.nI1(23,"date"),e.k0s()()(),e.j41(24,"td",58)(25,"div",62)(26,"div",63)(27,"span",64),e.nrm(28,"img",65),e.k0s()(),e.j41(29,"div",66)(30,"a",67),e.EFF(31),e.k0s(),e.j41(32,"span",68),e.EFF(33),e.k0s()()()(),e.j41(34,"td",69)(35,"span",70),e.EFF(36),e.k0s()()()}if(2&i){const t=r.$implicit;e.R7$(3),e.Y8G("title",t.name),e.R7$(),e.JRh(t.name),e.R7$(2),e.JRh(t.objectType),e.R7$(2),e.Y8G("ngIf",void 0!==t.insertedRecords),e.R7$(),e.Y8G("ngIf",void 0===t.insertedRecords),e.R7$(2),e.Y8G("ngIf",void 0!==t.updatedRecords),e.R7$(),e.Y8G("ngIf",void 0===t.updatedRecords),e.R7$(2),e.Y8G("ngIf",!t.errorRecords),e.R7$(),e.Y8G("ngIf",t.errorRecords),e.R7$(4),e.JRh(e.i5U(20,16,t.created_at,"dd MMM, yyyy")),e.R7$(3),e.JRh(e.i5U(23,19,t.created_at,"hh:mm a")),e.R7$(9),e.JRh(t.userId.name),e.R7$(),e.Y8G("title",t.userId.email),e.R7$(),e.JRh(t.userId.email),e.R7$(2),e.Y8G("ngClass",e.l_i(22,ve,"processing"==t.status,"completed"==t.status)),e.R7$(),e.SpI("",t.status," ")}}const we=(i,r,t)=>({itemsPerPage:i,currentPage:r,totalItems:t});function Ie(i,r){if(1&i&&(e.j41(0,"tbody"),e.DNE(1,ye,37,25,"tr",47),e.nI1(2,"paginate"),e.nI1(3,"async"),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.Y8G("ngForOf",e.i5U(2,1,e.bMT(3,4,t.importsData$),e.sMw(6,we,t.pageSize,t.currentPage,t.totalItems)))}}function xe(i,r){1&i&&(e.j41(0,"div",77),e.EFF(1," Loading... "),e.k0s())}function je(i,r){1&i&&(e.j41(0,"div",77),e.EFF(1," No Data To Show "),e.k0s())}function Fe(i,r){if(1&i&&(e.j41(0,"option",85),e.EFF(1),e.k0s()),2&i){const t=r.$implicit;e.Y8G("value",t),e.R7$(),e.SpI(" ",t," ")}}function Me(i,r){if(1&i){const t=e.RV6();e.j41(0,"div",81)(1,"select",82),e.mxI("ngModelChange",function(n){e.eBV(t);const s=e.XpG(3);return e.DH7(s.pageSize,n)||(s.pageSize=n),e.Njj(n)}),e.bIt("change",function(n){e.eBV(t);const s=e.XpG(3);return e.Njj(s.onPageSizeChange(n))}),e.DNE(2,Fe,2,2,"option",83),e.k0s(),e.j41(3,"span",84),e.EFF(4),e.k0s()()}if(2&i){const t=e.XpG(3);e.R7$(),e.R50("ngModel",t.pageSize),e.R7$(),e.Y8G("ngForOf",t.pageSizeOptions),e.R7$(2),e.E5c(" ",t.totalItems>0?t.pageSize*(t.currentPage-1)+1:t.totalItems,"-",t.currentPage*t.pageSize<t.totalItems?t.currentPage*t.pageSize:t.totalItems," of ",t.totalItems," showing ")}}function ke(i,r){if(1&i){const t=e.RV6();e.j41(0,"div",78),e.DNE(1,Me,5,5,"div",79),e.j41(2,"pagination-controls",80),e.bIt("pageChange",function(n){e.eBV(t);const s=e.XpG(2);return e.Njj(s.pageChanged(n))}),e.k0s()()}if(2&i){const t=e.XpG(2);e.R7$(),e.Y8G("ngIf",t.totalItems),e.R7$(),e.Y8G("maxSize",5)("autoHide",!0)("responsive",!1)}}const Se=(i,r)=>({"btn-solid-secondary pe-4 pt-3 pb-3 ps-3":i,"btn-solid-primary ps-4 p-3":r});function Ce(i,r){if(1&i){const t=e.RV6();e.j41(0,"div",15)(1,"div",16)(2,"div",17)(3,"div",18),e.nrm(4,"img",19),e.j41(5,"input",20),e.bIt("input",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.onSearchQueryChange())}),e.mxI("ngModelChange",function(n){e.eBV(t);const s=e.XpG();return e.DH7(s.searchQuery,n)||(s.searchQuery=n),e.Njj(n)}),e.k0s()()(),e.j41(6,"div",21)(7,"div",22)(8,"button",23),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.filterActivated=!n.filterActivated)}),e.DNE(9,ce,3,0,"i",24)(10,de,2,1,"span",25),e.EFF(11,"Filter "),e.DNE(12,me,1,0,"img",26),e.k0s()()()(),e.j41(13,"div",27),e.bIt("shown.bs.collapse",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.filterActivated=!0)})("hidden.bs.collapse",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.filterActivated=!1)}),e.j41(14,"app-imports-list-filter",28),e.bIt("filterApplied",function(n){e.eBV(t);const s=e.XpG();return e.Njj(s.applyFilter(n))})("filterReset",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.handleResetFilter())}),e.k0s()(),e.j41(15,"div",29)(16,"div",30)(17,"table",31)(18,"thead")(19,"tr",32)(20,"th",33),e.EFF(21,"File & Type"),e.k0s(),e.j41(2
12,"th",34),e.EFF(23,"New Records"),e.k0s(),e.j41(24,"th",35),e.EFF(25,"Updated Records"),e.k0s(),e.j41(26,"th",34),e.EFF(27,"Errors"),e.k0s(),e.j41(28,"th",36),e.EFF(29,"Created"),e.k0s(),e.j41(30,"th",37),e.EFF(31,"Uploaded by"),e.k0s(),e.j41(32,"th",38),e.EFF(33,"Status"),e.k0s()()(),e.DNE(34,Ie,4,10,"tbody",39),e.nI1(35,"async"),e.nI1(36,"async"),e.k0s(),e.DNE(37,xe,2,0,"div",40),e.nI1(38,"async"),e.DNE(39,je,2,0,"div",40),e.nI1(40,"async"),e.nI1(41,"async"),e.k0s(),e.DNE(42,ke,3,4,"div",41),e.nI1(43,"async"),e.k0s()()}if(2&i){const t=e.XpG();let a;e.R7$(5),e.R50("ngModel",t.searchQuery),e.R7$(3),e.Y8G("ngClass",e.l_i(23,Se,!t.filterActivated&&0==t.filterData.appliedFiltersCount,t.filterActivated||t.filterData.appliedFiltersCount>0)),e.R7$(),e.Y8G("ngIf",!t.filterActivated),e.R7$(),e.Y8G("ngIf",t.filterData.appliedFiltersCount>0),e.R7$(2),e.Y8G("ngIf",t.filterActivated),e.R7$(5),e.Y8G("dtTrigger",t.dtTrigger)("dtOptions",t.dtOptions),e.R7$(17),e.Y8G("ngIf",e.bMT(35,11,t.importsData$)&&!e.bMT(36,13,t.isLoading$)),e.R7$(3),e.Y8G("ngIf",e.bMT(38,15,t.isLoading$)),e.R7$(2),e.Y8G("ngIf",!(e.bMT(40,17,t.isLoading$)||t.importsData$&&0!==(null==(a=e.bMT(41,19,t.importsData$))?null:a.length))),e.R7$(3),e.Y8G("ngIf",!e.bMT(43,21,t.isLoading$))}}function Te(i,r){1&i&&(e.j41(0,"a",11)(1,"button",91),e.nrm(2,"i",13),e.EFF(3,"Import Records "),e.k0s()())}function Oe(i,r){if(1&i&&(e.j41(0,"div",15)(1,"div",86),e.nrm(2,"img",87),e.j41(3,"h2",88),e.EFF(4,"No Imports Here!"),e.k0s(),e.j41(5,"p",89),e.EFF(6,"Track your File Import requests here."),e.k0s(),e.DNE(7,Te,4,0,"a",90),e.k0s()()),2&i){const t=e.XpG();e.R7$(7),e.Y8G("ngIf",t.isContactsEnabled)}}function De(i,r){1&i&&(e.j41(0,"div",15)(1,"div",86)(2,"h5",92),e.EFF(3,"Loading..."),e.k0s()()())}let Pe=(()=>{class i{importsService;fileService;cdr;webSocketService;freeTrialService;pageSize;currentPage;totalItems;pageSizeOptions=[10,20,50,100,200];searchQuery="";filterResetBool=!1;firstTimeLoad=!0;showIllustration=!1;filterActivated=!1;dtTrigger=new _.B;dtOptions={};datatableElement;isLoading$;importsData$;dataExists$=new _.B;subscriptions=[];searchQueryChanged=new _.B;dataTablesParams;filterData={userId:[],objectType:[],dateRange:"",status:[],appliedFiltersCount:0};isContactsEnabled=!1;constructor(t,a,n,s,m){this.importsService=t,this.fileService=a,this.cdr=n,this.webSocketService=s,this.freeTrialService=m,this.isContactsEnabled=this.freeTrialService.isContactsEnabled(),this.isLoading$=this.importsService.isLoading$,this.importsData$=this.importsService.importsData$,this.searchQueryChanged.pipe((0,f.B)(300)).subscribe(O=>{this.updateSearch(O)});for(const O in this.filterData)this.filterData.hasOwnProperty(O)&&this.importsService.importsListPayloadValue.hasOwnProperty(O)&&(this.filterData[O]=this.importsService.importsListPayloadValue[O]);const k=this.importsService.importsListPayload.value;this.pageSize=k.limit,this.currentPage=k.page,this.searchQuery=k.search}ngOnInit(){this.dataTableInitialization(),this.listenToWebSocketMessages()}resetFilters(){this.filterActivated=!1,this.filterData.appliedFiltersCount=0}handleResetFilter(){this.filterResetBool=!0}fetchImports(){const t=this.importsService.getImportList().subscribe({next:a=>{this.firstTimeLoad=!1,a&&(this.totalItems=a.data.totalCount,this.dataExists$.next(this.totalItems>0),!this.searchQuery&&0==this.filterData.appliedFiltersCount&&0===this.totalItems&&(this.showIllustration=!0,console.log(this.showIllustration,139,"&*JHOEHJFIEHFEIHFDEJDIWJ((@))))))))))))))UEU@(E)U@D#ODHJ#WJD#OFJ#OJEODHEWODMEODJ/owj")),this.cdr.detectChanges())},error:a=>{console.log(a,"error---")}});this.subscriptions.push(t)}pageChanged(t){this.currentPage=t,this.importsService.updateImportsListPayload({page:this.currentPage}),this.fetchImports()}onPageSizeChange(t){const a=t.target.value;this.currentPage=1,this.importsService.updateImportsListPayload({limit:a,page:this.currentPage}),this.fetchImports()}onSearchQueryChange(){this.searchQueryChanged.next(this.searchQuery)}updateSearch(t){this.filterActivated=!1,this.currentPage=1,this.importsService.updateImportsListPayload({search:t,page:this.currentPage}),this.fetchImports()}dataTableInitialization(){this.dtOptions={dom:"<'row'<'col-sm-12'tr>><'row'<'col-sm-12 col-md-5 d-flex align-items-center'li><'col-sm-12 col-md-7'p>>",paging:!1,searching:!1,info:!1,ordering:!1,processing:!1,responsive:!0,retrieve:!0,language:{emptyTable:" "}},this.fetchImports()}onFileClick(t){t&&this.downloadFile(t)}applyFilter(t){this.dataExists$.next(!0),console.log(t),this.filterData=t,this.currentPage=1,this.importsService.updateImportsListPayload({...t,page:this.currentPage}),this.fetchImports()}downloadFile(t){this.fileService.downloadErrorFile(t)}listenToWebSocketMessages(){console.log("listenToWebSocketMessages"),this.webSocketService.n
1otification$.subscribe(t=>{console.log(t," outside websocket notification"),console.log(t?.source," outside websocket notification"),console.log(t?.status," outside websocket notification"),t&&"importFile"==t?.source&&"200"==t?.status?(console.log("Inside websocket notification",t),this.fetchImports()):console.log("Failed to receive imports WebSocket response.")})}ngOnDestroy(){this.subscriptions.forEach(t=>{t.unsubscribe()}),this.dtTrigger.unsubscribe()}static \u0275fac=function(a){return new(a||i)(e.rXU(g.s),e.rXU(u.E),e.rXU(e.gRc),e.rXU(c.V),e.rXU(x.O))};static \u0275cmp=e.VBU({type:i,selectors:[["app-imports-list"]],viewQuery:function(a,n){if(1&a&&e.GBs(b._,5),2&a){let s;e.mGM(s=e.lsd())&&(n.datatableElement=s.first)}},decls:13,vars:4,consts:[["id","kt_app_main",1,"app-main","flex-column","flex-row-fluid"],[1,"d-flex","flex-column","flex-column-fluid"],["id","kt_app_toolbar",1,"app-toolbar","d-flex","flex-stack","flex-row-fluid"],[1,"d-flex","flex-column","flex-row-fluid","justify-content-center"],[1,"page-title","d-flex","align-items-center","me-3"],[1,"page-heading","d-flex","text-gray-900","fw-bold","flex-column","justify-content-center","my-0"],[1,"d-flex","align-items-center","gap-3","gap-lg-5"],["class","m-0",4,"ngIf"],["id","kt_app_content",1,"app-content","pt-8"],["class","card shadow-none",4,"ngIf"],[1,"m-0"],["routerLink","/data-hub/import-export/imports/new-import"],["type","button",1,"btn-solid-primary","fw-semibold","p-3","pe-4"],[1,"ki-duotone","ki-plus","fs-4"],[1,"fs-lg"],[1,"card","shadow-none"],[1,"card-header","p-4","p-md-8","p-xl-8","pb-2","pb-md-4","pb-xl-4","border-0"],[1,"card-title","my-0","mw-325px","w-100"],[1,"d-flex","align-items-center","position-relative","my-0","w-100"],["src","./assets/media/recotap-assets/icons/magnifier-duotone.svg","alt","",1,"position-absolute","ms-4","w-16px"],["type","text","placeholder","Search by file name",1,"bg-gray-50","shadow-none","border-0","ps-10","py-2","pe-4","rounded-pill","h-44px","w-100","fs-lg","fw-semibold","placeholder-gray-400","outline-none",3,"ngModel","input","ngModelChange"],[1,"card-toolbar","my-0"],["data-kt-user-table-toolbar","base",1,"d-flex","justify-content-end","my-0"],["type","button","data-bs-toggle","collapse","data-bs-target","#kt-accordion-imports-filter","aria-expanded","true","aria-controls","kt-accordion-imports-filter",1,"me-3","h-44px","d-flex","align-items-center","fs-lg","fw-semibold","lh-sm",3,"ngClass","click"],["class","ki-duotone ki-filter fs-4 pe-2",4,"ngIf"],["class","me-2",4,"ngIf"],["src","./assets/media/recotap-assets/icons/cross-circle-solid.svg","alt","","class","ms-2 w-16px h-16px",4,"ngIf"],["id","kt-accordion-imports-filter","aria-labelledby","kt-accordion-imports-filter-options",1,"accordion-collapse","collapse",3,"shown.bs.collapse","hidden.bs.collapse"],[3,"filterApplied","filterReset"],[1,"card-body","p-4","p-md-8","p-xl-8","pt-0","pt-md-0","pt-xl-0"],[1,"table-responsive","table-scrollbar"],["datatable","",1,"table","table-row-dashed","fs-6","gy-4","dataTable","no-footer",3,"dtTrigger","dtOptions"],[1,"fw-semibold","fs-6","text-gray-400","mt-4","mb-3"],[1,"px-0","pt-4","pb-3","lh-sm","mw-160px","min-w-160px"],[1,"text-center","px-0","pt-4","pb-3","lh-sm","mw-120px","min-w-120px"],[1,"text-center","px-0","pt-4","pb-3","lh-sm","mw-150px","min-w-150px"],[1,"px-0","pt-4","pb-3","lh-sm","mw-150px","min-w-150px"],[1,"px-0","pt-4","pb-3","lh-sm","mw-200px","min-w-200px"],[1,"px-0","pt-4","pb-3","lh-sm","mw-120px","min-w-120px"],[4,"ngIf"],["class","h-45vh d-flex align-items-center justify-content-center text-muted",4,"ngIf"],["class","d-flex justify-content-between align-items-center pt-4",4,"ngIf"],[1,"ki-duotone","ki-filter","fs-4","pe-2"],[1,"path1"],[1,"path2"],[1,"me-2"],["src","./assets/media/recotap-assets/icons/cross-circle-solid.svg","alt","",1,"ms-2","w-16px","h-16px"],[4,"ngFor","ngForOf"],[1,"p-0","py-3","min-w-160px","mw-160px"],[1,""],[1,"clickable","cursor-pointer","text-gray-700","text-truncate","fw-bold","text-hover-primary","mb-1","fs-6","lh-sm",3,"title","click"],[1,"text-gray-500","fs-lg","lh-sm","fw-normal","text-capitalize"],[1,"p-0","py-3","align-content-center","min-w-120px"],["class","fw-bold text-center text-gray-700",4,"ngIf"],[1,"p-0","py-3","align-content-center"],["class","fw-bold min-w-150px text-center text-gray-700",4,"ngIf"],["class","d-flex align-items-center justify-content-center min-w-120px",4,"ngIf"],["class"," d-flex align-items-center justify-content-center min-w-120px",4,"ngIf"],[1,"p-0","py-3"],[1,"min-w-150px"],[1,"text-gray-700","fw-bold","text-hover-primary","d-block","mb-1","fs-6"],[1,"text-gray-500","fw-semibold","text-muted","d-block","fs-6"],[1,"d-flex","align-items-center","mw-200px","min-w-200px"],[1,"symbol","symbol-circle","symbol-32px","me-3"],[1,"symbol-label","bg-light"],["src","assets/media/svg/avatars/001-boy.svg","alt","",1,"h-75","align-self-end"],[1,"d-flex","justify-content-start","flex-column","min-w-120px","mw-120px","text-truncate"],["href","#",1,"text-gray-700","fw-bold","text-hover-primary","text-capitalize","mb-1","fs-6","text-gray-700"],[1,"text-gray-500","text-truncate","d-block","fs-lg","lh-sm","fw-normal","w-100",3,"title"],[1,"p-0","py-3","min-w-120px","align-content-center"],[1,"text-capitalize","text-center","badge","fs-sm","lh-sm","px-3","py-1","rounded-pill",3,"ngClass"],[1,"fw-bold","text-center","text-gray-700"],[1,"fw-bold","min-w-150px","text-center","text-gray-700"],[1,"d-flex","align-items-center","justify-content-center","min-w-120px"],[1,"fw-bold","me-3","fs-6","text-gray-700"],["title","Click to download the file",1,"clickable","cursor-pointer","text-semantic-red","fw-bold","text-hover-primary","d-flex","align-items-center","mb-1","fs-6","lh-sm"],["src","assets/media/icons/duotune/file-down.svg","alt","",1,"clickable","h-
175","align-self-end","ms-2",3,"click"],[1,"h-45vh","d-flex","align-items-center","justify-content-center","text-muted"],[1,"d-flex","justify-content-between","align-items-center","pt-4"],["class","d-flex align-items-center w-100",4,"ngIf"],["previousLabel","","nextLabel","",1,"flex-shrink-0",3,"maxSize","autoHide","responsive","pageChange"],[1,"d-flex","align-items-center","w-100"],["data-control","select2",1,"form-select","bg-gray-50","bg-hover-gray-100","w-80px","h-30px","me-5","rounded-pill","px-3","py-1",3,"ngModel","ngModelChange","change"],[3,"value",4,"ngFor","ngForOf"],[1,"fs-lg","text-gray-700"],[3,"value"],[1,"d-flex","flex-column","align-items-center","justify-content-center","py-20","h-72vh"],["src","./assets/media/recotap-assets/illustrations/illustration-no-result.svg","alt","No ICP Created"],[1,"text-gray-700","mb-2"],[1,"text-muted","fs-6","mb-5"],["routerLink","/data-hub/import-export/imports/new-import",4,"ngIf"],["type","button",1,"btn-solid-primary","fw-semibold","fs-sm","h-32px","p-3","pe-4","d-flex","align-items-center"],[1,"text-gray-700"]],template:function(a,n){1&a&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"h1",5),e.EFF(6," Imports "),e.k0s()()(),e.j41(7,"div",6),e.DNE(8,Z,6,0,"div",7),e.k0s()()()(),e.j41(9,"div",8),e.DNE(10,Ce,44,26,"div",9)(11,Oe,8,1,"div",9)(12,De,4,0,"div",9),e.k0s()),2&a&&(e.R7$(8),e.Y8G("ngIf",n.isContactsEnabled),e.R7$(2),e.Y8G("ngIf",!n.firstTimeLoad&&!n.showIllustration),e.R7$(),e.Y8G("ngIf",n.showIllustration),e.R7$(),e.Y8G("ngIf",n.firstTimeLoad))},dependencies:[p.YU,p.Sq,p.bT,d.ej,w.Wk,b._,o.xH,o.y7,o.me,o.wz,o.BC,o.vS,L,p.Jj,p.QX,p.vh,d.kf],styles:[".clickable-file[_ngcontent-%COMP%]{cursor:pointer}",".h-72vh[_ngcontent-%COMP%] {\n height: 72vh;\n }\n .h-45vh[_ngcontent-%COMP%] {\n height: 45vh;\n }"]})}return i})();var z=l(84412);
1const Re={coloumnName:"",coloumnData:"",isMappingValid:!0,mappedProperty:null,validationErrorMessage:""},Ee={importType:"",uploadedFile:"",uploadedFileName:"",uploadedFileLength:100,selectedImportMethod:"createAndUpdate",uploadedFileFirstObject:{"account name":"gokul",email:"[email protected]","Account Domain":"gokul.com","ACC id":"65c9c409f9413b5584990a38",industry:"marketing",revenue:"1T",location:"india","company size":"10m - 100M",source:"hubspot","source engagement score":1e3},customMapping:[],mandatoryMappingProperties:{accounts:{create:{isWarning:!1,isFullyMapped:!1,mapAllOf:[{label:"Account Name",isMapped:null},{label:"Account Domain",isMapped:null}]},update:{isWarning:!1,isFullyMapped:!1,mapOneOf:[{label:"Account Domain",isMapped:null,isDuplicateAllowed:!0},{label:"Account ID",isMapped:null,isWarning:!1}]}},contacts:{create:{isWarning:!1,isFullyMapped:!1,mapAllOf:[{label:"First Name",isMapped:null},{label:"Account Name",isMapped:null},{label:"Email ID",isMapped:null}],mapOneOf:[{label:"Account Domain",isMapped:null,isDuplicateAllowed:!0},{label:"Account ID",isMapped:null,isWarning:!1}]},update:{isWarning:!1,isFullyMapped:!1,mapOneOf:[{label:"Email ID",isMapped:null,isDuplicateAllowed:!0},{label:"Contact ID",isMapped:null,isWarning:!1}]}},deals:{create:{isWarning:!1,isFullyMapped:!1,mapAllOf:[{label:"Deal Name",isMapped:null},{label:"Deal Stage",isMapped:null}],mapOneOf:[{label:"Account Domain",isMapped:null,isDuplicateAllowed:!0},{label:"Account ID",isMapped:null,isWarning:!1}]},update:{isWarning:!1,isFullyMapped:!1,mapAllOf:[{label:"Deal ID",isMapped:null}]}}},isNewSegment:"",segmentId:void 0,segmentName:"",segmentError:""};var $e=l(23294),ne=l(95508),Ne=l(87119);function Ae(i,r){1&i&&e.nrm(0,"img",20)}function Ge(i,r){1&i&&e.nrm(0,"img",21)}function Le(i,r){1&i&&e.nrm(0,"img",22)}function Ve(i,r){1&i&&e.nrm(0,"img",23)}function Ye(i,r){1&i&&e.nrm(0,"img",24)}function Ue(i,r){1&i&&e.nrm(0,"img",25)}function Be(i,r){1&i&&(e.j41(0,"p",31),e.EFF(1,"*segment name is mandatory"),e.k0s())}function We(i,r){if(1&i){const t=e.RV6();e.j41(0,"div",26)(1,"label",27),e.EFF(2,"Create New Segment"),e.k0s(),e.j41(3,"input",28,29),e.mxI("ngModelChange",function(n){e.eBV(t);const s=e.XpG();return e.DH7(s.segmentsObject.segmentName,n)||(s.segmentsObject.segmentName=n),e.Njj(n)}),e.bIt("ngModelChange",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.checkNewSeg())}),e.k0s(),e.DNE(5,Be,2,0,"p",30),e.k0s()}if(2&i){const t=e.sdS(4),a=e.XpG();e.R7$(3),e.R50("ngModel",a.segmentsObject.segmentName),e.R7$(2),e.Y8G("ngIf",t.invalid&&(t.touched||t.dirty))}}function Xe(i,r){1&i&&(e.j41(0,"p",31),e.EFF(1,"*segment name is mandatory"),e.k0s())}function ze(i,r){if(1&i){const t=e.RV6();e.j41(0,"div",26)(1,"label",27),e.EFF(2,"Choose existing Segments"),e.k0s(),e.j41(3,"ng-select",32,33),e.mxI("ngModelChange",function(n){e.eBV(t);const s=e.XpG();return e.DH7(s.segmentsObject.segmentId,n)||(s.segmentsObject.segmentId=n),e.Njj(n)}),e.bIt("search",function(n){e.eBV(t);const s=e.XpG();return e.Njj(s.onSearch(n))})("change",function(n){e.eBV(t);const s=e.XpG();return e.Njj(s.onSegmentChange(n))}),e.k0s(),e.DNE(5,Xe,2,0,"p",30),e.k0s()}if(2&i){const t=e.sdS(4),a=e.XpG();e.R7$(3),e.R50("ngModel",a.segmentsObject.segmentId),e.Y8G("items",a.segmentList)("clearable",!0)("searchable",!0),e.R7$(2),e.Y8G("ngIf",t.invalid&&(t.touched||t.dirty))}}let se=(()=>{class i{segmentsServices;fb;cdr;searchSubject=new _.B;searchTerm="";segmentList=[];segmentsObject;updateParentModel;segmentForm;newImportTitle="";isHovered={newSegment:!1,existingSegment:!1};unsubscribe=[];importTableData=[];constructor(t,a,n){this.segmentsServices=t,this.fb=a,this.cdr=n,this.searchSubject.pipe((0,f.B)(300),(0,$e.F)()).subscribe(s=>{this.searchTerm=s,this.fetchData()})}ngOnInit(){this.fetchData(),(0,ne.P)(),this.initForm(),this.updateParentModel({},this.checkForm())}fetchData(){let t="";("accounts"==this.segmentsObject.importType||"contacts"==this.segmentsObject.importType)&&(t="static"),this.segmentsServices.getSegementList({start:0,length:10,search:this.searchTerm,status:"active",segmentType:t,memberType:this.segmentsObject.importType}).subscribe(s=>{this.segmentList=s.data.data,this.cdr.detectChanges()})}initForm(){this.segmentsObject.isNewSegment||(this.segmentsObject.isNewSegment="newSegment"),this.segmentForm=this.fb.group({isNewSegment:[this.segmentsObject.isNewSegment,[o.k0.required]]});const t=this.segmentForm.valueChanges.subscribe(a=>{this.updateParentModel({isNewSegment:"",segmentId:void 0,segmentName:"",segmentError:""},this.checkForm()),this.segmentsObject.isNewSegment=a.isNewSegment,this.updateParentModel(a,this.checkForm())});this.unsubscribe.push(t)}onSearch(t){this.searchSubject.next(t.term)}onSegmentChange(t){this.searchSubject.next(t),console.log("Selected Segment Id:",this.segmentsObject.segmentId,this.segmentsObject.segmentName),this.searchTerm="",this.updateParentModel({segmentId:this.segmentsObject.segmentId},this.checkForm())}checkNewSeg(){this.updateParentModel({segmentName:this.segmentsObject.segmentName},this.checkForm())}checkForm(){return!(!("existingSegment"!==this.segmentsObject.isNewSegment||this.segmentsObject.segmentId&&""!==this.segmentsObject.segmentId)||"newSegment"===this.segmentsObject.isNewSegment&&(!this.segmentsObject.segmentName||""===this.segmentsObject.segmentName))}resetSegmentSelection(){this.segmentForm.reset(),this.updateParentModel({segmentId:void 0},this.checkForm())}ngOnDestroy(){this.unsubscribe.forEach(t=>t.unsubscribe())}static \u0275fac=function(a){return new(a||i)(e.rXU(Ne.d),e.rXU(o.ok),e.rXU(e.gRc))};static \u0275cmp=e.VBU({type:i,selectors:[["app-segments"]],inputs:{segmentsObject:"segmentsObject",updateParentModel:"updateParentModel"},decls:31,vars:9,consts:[[1,"pb-4","pb-sm-6","pb-sm-8","text-center"],[1,"fw-bold","text-gray-900","mb-0"],[1,"fv-row",3,"formGroup"],[1,"row","g-4","g-sm-6","g-lg-8"],[1,"col-12","col-sm-6"],["formControlName","isNewSegment","type","radio","name","isNewSegment","value","newSegment","id","kt_create_account_form_newSegment",1,"btn-check"],["for","kt_create_account_form_newSegment",1,"rt-radioButton__card","p-3","p-md-4","text-center","w-100","min-h-150px",3,"mouseover","mouseout"],[1,"d-inline-block","w-24px","h-24px","mb-2"],["alt","Select New Segment","src","/assets/media/recotap-assets/icons/new-segment-outline.svg","class","w-100 h-100 object-fit-contain object-position-center",4,"ngIf"],["alt","Select New Segment","src","/assets/media/recotap-assets/icons/new-segment-hovered.svg","class","w-100 h-100 object-fit-contain object-position-center",4,"ngIf"],["alt","Select New Segment","src","/assets/media/recotap-assets/icons/new-segment-active.svg","class","w-100 h-100 object-fit-contain object-position-center",4,"ngIf"],[1,"d-block","fw-semibold"],[1,"text-gray-900","fw-semibold","d-block","fs-lg","mb-1"],[1,"text-gray-700","fw-normal","fs-sm","lh-sm"],["formControlName","isNewSegment","type","radio","name","isNewSegment","value","existingSegment","id","kt_create_account_form_existingSegment",1,"btn-check"],["for","kt_create_account_form_existingSegment",1,"rt-radioButton__card","p-3","p-md-4","text-center","w-100","min-h-150px",3,"mouseover","mouseout"],["alt","Select Existing Segment","src","/assets/media/recotap-assets/icons/segment-outline.svg","class","w-100 h-100 object-fit-contain object-position-center",4,"ngIf"],["alt","Select Existing Segment","src","/assets/media/recotap-assets/icons/segment-hovered.svg","class","w-100 h-100 object-fit-contain object-position-center",4,"ngIf"],["alt","Select Existing Segment","src","/assets/media/recotap-assets/icons/segment-active.svg","class","w-100 h-100 object-fit-contain object-position-center",4,"ngIf"],["class","fv-row mt-6 mt-md-8 w-md-50",4,"ngIf"],["alt","Select New Segment","src","/assets/media/recotap-assets/icons/new-segment-outline.svg",1,"w-100","h-100","object-fit-contain","object-position-center"],["alt","Select New Segment","src","/assets/media/recotap-assets/icons/new-segment-hovered.svg",1,"w-100","h-100","object-fit-contain","object-position-center"],["alt","Select New Segment","src","/assets/media/recotap-assets/icons/new-segment-active.svg",1,"w-100","h-100","object-fit-contain","object-position-center"],["alt","Select Existing Segment","src","/assets/media/recotap-assets/icons/segment-outline.svg",1,"w-100","h-100","object-fit-contain","object-position-center"],["alt","Select Existing Segment","src","/assets/media/recotap-assets/icons/segment-hovered.svg",1,"w-100","h-100","object-fit-contain","object-position-center"],["alt","Select Existing Segment","src","/assets/media/recotap-assets/icons/segment-active.svg",1,"w-100","h-100","object-fit-contain","object-position-center"],[1,"fv-row","mt-6","mt-md-8","w-md-50"],[1,"form-label","fs-lg","fw-semibold","text-gray-900","required"],["type","text","name","segmentName","placeholder","Segment Name","required","",1,"form-control","mw-400px","fs-lg","form-control-sm","border-0","bg-gray-50","rounded-pill","px-3","py-2","text-gray-900",3,"ngModel","ngModelChange"],["segmentName","ngModel"],["class","mt-2 mb-0 text-semantic-red fs-sm fw-semibold",4,"ngIf"],[1,"mt-2","mb-0","text-semantic-red","fs-sm","fw-semibold"],["bindLabel","name","bindValue","_id","placeholder","Select segment","required","",1,"mw-400px","text-capitalize","ng-select__customStyles",3,"ngModel","items","clearable","searchable","ngModelChange","search","change"],["segmentId","ngModel"]],template:function(a,n){1&a&&(e.j41(0,"div",0)(1,"h2",1),e.EFF(2," Add to Segments "),e.k0s()(),e.j41(3,"div",2)(4,"div",3)(5,"div",4),e.nrm(6,"input",5),e.j41(7,"label",6),e.bIt("mouseover",function(){return n.isHovered.newSegment=!0})("mouseout",function(){return n.isHovered.newSegment=!1}),e.j41(8,"span",7),e.DNE(9,Ae,1,0,"img",8)(10,Ge,1,0,"img",9)(11,Le,1,0,"img",10),e.k0s(),e.j41(12,"span",11)(13,"span",12),e.EFF(14,"New Segment"),e.k0s(),e.j41(15,"span",13),e.EFF(16," The businesses you work with, which are commonly called accounts. "),e.k0s()()()(),e.j41(17,"div",4),e.nrm(18,"input",14),e.j41(19,"label",15),e.bIt("mouseover",function(){return n.isHovered.existingSegment=!0})("mouseout",function(){return n.isHovered.existingSegment=!1}),e.j41(20,"span",7),e.DNE(21,Ve,1,0,"img",16)(22,Ye,1,0,"img",17)(23,Ue,1,0,"img",18),e.k0s(),e.j41(24,"span",11)(25,"span",12),e.EFF(26,"Existing Segments"),e.k0s(),e.j41(27,"span",13),e.EFF(28," The businesses you work with, which are commonly called accounts. "),e.k0s()()()()()(),e.DNE(29,We,6,2,"div",19)(30,ze,6,5,"div",19)),2&a&&(e.R7$(3),e.Y8G("formGroup",n.segmentForm),e.R7$(6),e.Y8G("ngIf",!n.isHovered.newSegment&&"newSegment"!==n.segmentsObject.isNewSegment),e.R7$(),e.Y8G("ngIf",n.isHovered.newSegment&&(""===n.segmentsObject.isNewSegment||"newSegment"!==n.segmentsObject.isNewSegment)),e.R7$(),e.Y8G("ngIf","newSegment"===n.segmentsObject.isNewSegment),e.R7$(10),e.Y8G("ngIf",!n.isHovered.existingSegment&&"existingSegment"!==n.segmentsObject.isNewSegment),e.R7$(),e.Y8G("ngIf",n.isHovered.existingSegment&&(""===n.segmentsObject.isNewSegment||"existingSegment"!==n.segmentsObject.isNewSegment)),e.R7$(),e.Y8G("ngIf","existingSegment"===n.segmentsObject.isNewSegment),e.R7$(6),e.Y8G("ngIf","newSegment"==n.segmentsObject.isNewSegment),e.R7$(),e.Y8G("ngIf","existingSegment"==n.segmentsObject.isNewSegment))},dependencies:[p.bT,y.vr,o.me,o.Fm,o.BC,o.cb,o.YS,o.j4,o.JD,o.vS]})}return i})();var He=l(45794),Ke=l(36139);function Je(i,r){1&i&&e.nrm(0,"img",14)}function qe(i,r){1&i&&e.nrm(0,"img",15)}function Qe(i,r){1&i&&e.nrm(0,"img",16)}function Ze(i,r){1&i&&e.nrm(0,"img",22)}function et(i,r){1&i&&e.nrm(0,"img",23)}function tt(i,r){1&i&&e.nrm(0,"img",24)}function it(i,r){if(1&i){const t=e.RV6();e.j41(0,"div",3)(1,"input",17),e.bIt("click",function(){e.eBV(t);const n=e.XpG();
1return e.Njj(n.handleTitle("Contacts"))}),e.k0s(),e.j41(2,"label",18),e.bIt("mouseover",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.isHovered.contacts=!0)})("mouseout",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.isHovered.contacts=!1)}),e.j41(3,"span",6),e.DNE(4,Ze,1,0,"img",19)(5,et,1,0,"img",20)(6,tt,1,0,"img",21),e.k0s(),e.j41(7,"div",10)(8,"div",11),e.EFF(9,"Contacts"),e.k0s(),e.j41(10,"span",12),e.EFF(11," Individuals in your target accounts "),e.k0s()()()()}if(2&i){const t=e.XpG();e.R7$(4),e.Y8G("ngIf",!t.isHovered.contacts&&"Contacts"!==t.newImportTitle),e.R7$(),e.Y8G("ngIf",t.isHovered.contacts&&(""===t.newImportTitle||"Contacts"!==t.newImportTitle)),e.R7$(),e.Y8G("ngIf","Contacts"===t.newImportTitle)}}let at=(()=>{class i{fb;freeTrialService;defaultValues;updateParentModel;form;newImportTitle="";isHovered={accounts:!1,contacts:!1,deals:!1};updateTitle=new e.bkB;isContactsEnabled=!1;unsubscribe=[];resetObject={uploadedFile:"",uploadedFileName:"",uploadedFileLength:100,selectedImportMethod:"createAndUpdate",uploadedFileFirstObject:{},customMapping:[],mandatoryMappingProperties:{accounts:{create:{isWarning:!1,isFullyMapped:!1,mapAllOf:[{label:"Account Name",isMapped:null},{label:"Account Domain",isMapped:null}]},update:{isWarning:!1,isFullyMapped:!1,mapOneOf:[{label:"Account Domain",isMapped:null,isDuplicateAllowed:!0},{label:"Account ID",isMapped:null,isWarning:!1}]}},contacts:{create:{isWarning:!1,isFullyMapped:!1,mapAllOf:[{label:"First Name",isMapped:null},{label:"Account Name",isMapped:null},{label:"Email ID",isMapped:null}],mapOneOf:[{label:"Account Domain",isMapped:null,isDuplicateAllowed:!0},{label:"Account ID",isMapped:null,isWarning:!1}]},update:{isWarning:!1,isFullyMapped:!1,mapOneOf:[{label:"Email ID",isMapped:null,isDuplicateAllowed:!0},{label:"Contact ID",isMapped:null,isWarning:!1}]}},deals:{create:{isWarning:!1,isFullyMapped:!1,mapAllOf:[{label:"Deal Name",isMapped:null},{label:"Deal Stage",isMapped:null}],mapOneOf:[{label:"Account Domain",isMapped:null,isDuplicateAllowed:!0},{label:"Account ID",isMapped:null,isWarning:!1}]},update:{isWarning:!1,isFullyMapped:!1,mapAllOf:[{label:"Deal ID",isMapped:null}]}}}};constructor(t,a){this.fb=t,this.freeTrialService=a}ngOnInit(){this.isContactsEnabled=this.freeTrialService.isContactsEnabled(),this.initForm()}initForm(){this.form=this.fb.group({importType:[this.defaultValues.importType,[o.k0.required]]}),this.defaultValues.importType&&this.updateParentModel({},!0);const t=this.form.valueChanges.subscribe(a=>{this.updateParentModel({...this.resetObject,...a},!0)});this.unsubscribe.push(t)}handleTitle(t){this.newImportTitle=t,this.updateTitle.emit(t)}ngOnDestroy(){this.unsubscribe.forEach(t=>t.unsubscribe())}static \u0275fac=function(a){return new(a||i)(e.rXU(o.ok),e.rXU(x.O))};static \u0275cmp=e.VBU({type:i,selectors:[["app-import-type"]],inputs:{defaultValues:"defaultValues",updateParentModel:"updateParentModel"},outputs:{updateTitle:"updateTitle"},decls:17,vars:5,consts:[[1,"fw-bold","text-center","text-gray-900","mb-0","pb-4","pb-sm-6","pb-8"],[1,"fv-row",3,"formGroup"],[1,"row","g-4","g-sm-6","g-lg-8","d-flex","justify-content-evenly"],[1,"col-12","col-sm-6","col-lg-4"],["formControlName","importType","type","radio","name","importType","value","accounts","id","kt_create_import_form_account",1,"btn-check",3,"click"],["for","kt_create_import_form_account",1,"rt-radioButton__card","p-3","p-md-4","text-center","w-100","min-h-150px",3,"mouseover","mouseout"],[1,"d-inline-block","w-24px","h-24px","mb-2"],["alt","Select Account","src","/assets/media/recotap-assets/icons/building-default.svg","class","w-100 h-100 object-fit-contain object-position-center",4,"ngIf"],["alt","Select Account","src","/assets/media/recotap-assets/icons/building-hovered.svg","class","w-100 h-100 object-fit-contain object-position-center",4,"ngIf"],["alt","Select Account","src","/assets/media/recotap-assets/icons/building-active.svg","class","w-100 h-100 object-fit-contain object-position-center",4,"ngIf"],[1,"fw-semibold"],[1,"fw-semibold","fs-lg","mb-1"],[1,"text-gray-700","fw-normal","fs-sm"],["class","col-12 col-sm-6 col-lg-4",4,"ngIf"],["alt","Select Account","src","/assets/media/recotap-assets/icons/building-default.svg",1,"w-100","h-100","object-fit-contain","object-position-center"],["alt","Select Account","src","/assets/media/recotap-assets/icons/building-hovered.svg",1,"w-100","h-100","object-fit-contain","object-position-center"],["alt","Select Account","src","/assets/media/recotap-assets/icons/building-active.svg",1,"w-100","h-100","object-fit-contain","object-position-center"],["formControlName","importType","type","radio","name","importType","value","contacts","id","kt_create_import_form_contact",1,"btn-check",3,"click"],["for","kt_create_import_form_contact",1,"rt-radioButton__card","p-3","p-md-4","text-center","w-100","min-h-150px",3,"mouseover","mouseout"],["alt","Select Contacts","src","/assets/media/recotap-assets/icons/user-square-default.svg","class","w-100 h-100 object-fit-contain object-position-center",4,"ngIf"],["alt","Select Contacts","src","/assets/media/recotap-assets/icons/user-square-hovered.svg","class","w-100 h-100 object-fit-contain object-position-center",4,"ngIf"],["alt","Select Contacts","src","/assets/media/recotap-assets/icons/user-square-active.svg","class","w-100 h-100 object-fit-contain object-position-center",4,"ngIf"],["alt","Select Contacts","src","/assets/media/recotap-assets/icons/user-square-default.svg",1,"w-100","h-100","object-fit-contain","object-position-center"],["alt","Select Contacts","src","/assets/media/recotap-assets/icons/user-square-hovered.svg",1,"w-100","h-100","object-fit-contain","object-position-center"],["alt","Select Contacts","src","/assets/media/recotap-assets/icons/user-square-active.svg",1,"w-100","h-100","object-fit-contain","object-position-center"]],template:function(a,n){1&a&&(e.j41(0,"h2",0),e.EFF(1," Choose Object Type\n"),e.k0s(),e.j41(2,"div",1)(3,"div",2)(4,"div",3)(5,"input",4),e.bIt("click",function(){return n.handleTitle("Accounts")}),e.k0s(),e.j41(6,"label",5),e.bIt("mouseover",function(){return n.isHovered.accounts=!0})("mouseout",function(){return n.isHovered.accounts=!1}),e.j41(7,"span",6),e.DNE(8,Je,1,0,"img",7)(9,qe,1,0,"img",8)(10,Qe,1,0,"img",9),e.k0s(),e.j41(11,"div",10)(12,"div",11),e.EFF(13,"Accounts"),e.k0s(),e.j41(14,"span",12),e.EFF(15," Companies that you\u2019d like to target "),e.k0s()()()(),e.DNE(16,it,12,3,"div",13),e.k0s()()),2&a&&(e.R7$(2),e.Y8G("formGroup",n.form),e.R7$(6),e.Y8G("ngIf",!n.isHovered.accounts&&"Accounts"!==n.newImportTitle),e.R7$(),e.Y8G("ngIf",n.isHovered.accounts&&(""===n.newImportTitle||"Accounts"!==n.newImportTitle)),e.R7$(),e.Y8G("ngIf","Accounts"===n.newImportTitle),e.R7$(6),e.Y8G("ngIf",n.isContactsEnabled))},dependencies:[p.bT,o.me,o.Fm,o.BC,o.cb,o.j4,o.JD]})}return i})();var J=l(10467),q=l(62288),nt=l(48032),re=l.n(nt),U=l(51040),st=l(74902);function rt(i,r){if(1&i){const t=e.RV6();e.j41(0,"button",14),e.bIt("click",function(n){e.eBV(t);const s=e.XpG();return e.Njj(s.resetFile(n))}),e.nrm(1,"img",15)(2,"img",16),e.k0s()}}function ot(i,r){if(1&i&&(e.j41(0,"ng-option",21),e.EFF(1),e.k0s()),2&i){const t=r.$implicit,a=e.XpG(2);e.Y8G("value",t.value),e.R7$(),e.JRh(t.label+a.defaultValues.importType)}}function lt(i,r){if(1&i){const t=e.RV6();e.j41(0,"div",17)(1,"label",18),e.EFF(2,"Choose how to import"),e.k0s(),e.j41(3,"ng-select",19),e.bIt("change",function(n){e.eBV(t);const s=e.XpG();return e.Njj(s.setSelectedImportMethod(n))}),e.DNE(4,ot,2,2,"ng-option",20),e.k0s()()}if(2&i){const t=e.XpG();e.R7$(3),e.Y8G("ngModel",t.selectedImportMethod)("clearable",!1)("searchable",!1),e.R7$(),e.Y8G("ngForOf",t.importTypes)}}const pt=(i,r)=>({"p-6 p-md-8 border-dashed":i,"p-3 p-lg-4 border border-1 bg-white border-gray-300":r}),oe=(i,r)=>({"flex-column":i,"flex-row":r}),ct=(i,r)=>({"mt-8 text-center":i,"ms-3 ms-lg-4":r});let dt=(()=>{class i{fb;router;papa;allowedFileTypes="text/csv,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";fileUploadVal="";selectedImportMethod;fileUploadSize$=new z.t(0);updateParentModel;form;defaultValues;unsubscribe=[];
1importTypes=[{label:"Create and Update ",value:"createAndUpdate"},{label:"Create ",value:"create"},{label:"Update ",value:"update"}];constructor(t,a,n){this.fb=t,this.router=a,this.papa=n}newCustomMapping$=new z.t(Re);handleDrop(t){t.preventDefault(),this.handleDroppedFiles(t.dataTransfer?.files)}handleDragOver(t){t.preventDefault()}handleDroppedFiles(t){t&&t.length>0&&this.handleFileChange({target:{files:[t[0]]}})}ngOnInit(){this.initForm(),this.setupDragDropListeners(),console.log("inside of imports this.updateParentModel",this.updateParentModel),this.updateParentModel({},this.checkForm(this.defaultValues.uploadedFileFirstObject))}setupDragDropListeners(){const t=document.getElementById("kt_modal_create_campaign_files_upload");t&&(t.addEventListener("drop",a=>this.handleDrop(a)),t.addEventListener("dragover",a=>this.handleDragOver(a)))}initForm(){this.form=this.fb.group({uploadedFile:[null]}),this.selectedImportMethod=this.defaultValues?.selectedImportMethod,""!==this.defaultValues.importType&&""!==this.defaultValues.uploadedFile&&(this.defaultValues.uploadedFileSize&&this.fileUploadSize$.next(this.defaultValues.uploadedFileSize/1024),this.updateParentModel({},!0));const t=this.form?.valueChanges?.subscribe(a=>{this.defaultValues.importType&&this.defaultValues.uploadedFile&&this.updateParentModel(a,!0)});this.unsubscribe.push(t)}setSelectedImportMethod(t){t&&(this.defaultValues.selectedImportMethod=t),this.resetMappingObject()}triggerFileInput(){const t=document.getElementById("fileInput");t?t.click():console.error("File input element not found")}showCustomAlert(t,a="warning",n,s){re().fire({text:t,icon:a,showCancelButton:!1,confirmButtonText:s,customClass:{confirmButton:"btn btn-lg btn-primary rounded-pill",cancelButton:"btn btn-lg btn-secondary rounded-pill"},cancelButtonText:"Cancel",heightAuto:!1,preConfirm:()=>Promise.resolve()}).then(m=>{m.isConfirmed&&n&&this.router.navigate([n])})}resetMappingObject(){this.updateParentModel({...{importType:this.defaultValues.importType,customMapping:[],mandatoryMappingProperties:{accounts:{create:{isWarning:!1,isFullyMapped:!1,mapAllOf:[{label:"Account Name",isMapped:null},{label:"Account Domain",isMapped:null}]},update:{isWarning:!1,isFullyMapped:!1,mapOneOf:[{label:"Account Domain",isMapped:null,isDuplicateAllowed:!0},{label:"Account ID",isMapped:null,isWarning:!1}]}},contacts:{create:{isWarning:!1,isFullyMapped:!1,mapAllOf:[{label:"First Name",isMapped:null},{label:"Account Name",isMapped:null},{label:"Email ID",isMapped:null}],mapOneOf:[{label:"Account Domain",isMapped:null,isDuplicateAllowed:!0},{label:"Account ID",isMapped:null,isWarning:!1}]},update:{isWarning:!1,isFullyMapped:!1,mapOneOf:[{label:"Email ID",isMapped:null,isDuplicateAllowed:!0},{label:"Contact ID",isMapped:null,isWarning:!1}]}},deals:{create:{isWarning:!1,isFullyMapped:!1,mapAllOf:[{label:"Deal Name",isMapped:null},{label:"Deal Stage",isMapped:null}],mapOneOf:[{label:"Account Domain",isMapped:null,isDuplicateAllowed:!0},{label:"Account ID",isMapped:null,isWarning:!1}]},update:{isWarning:!1,isFullyMapped:!1,mapAllOf:[{label:"Deal ID",isMapped:null}]}}}}},!!(this.defaultValues.importType&&this.defaultValues.selectedImportMethod&&this.defaultValues.uploadedFile))}handleFileChange(t){var a=this;return(0,J.A)(function*(){a.resetMappingObject();const n=t.target;if(n.files&&n.files.length>0){const s=n.files[0],m=Number(s.size),k=m/1024;a.defaultValues.uploadedFileName=s.name,a.defaultValues.uploadedFileSize=m,n?.value&&(n.value="");const O=["csv","xls","xlsx"],T=s.name.split(".").pop()?.toLowerCase();if(void 0===T)return a.updateParentModel({uploadedFile:"",uploadedFileFirstObject:{}},a.checkForm({})),a.fileUploadSize$.next(0),a.fileUploadVal="",console.error("Invalid file name. Please make sure the file has a valid extension."),void(0,U.b1)("The uploaded file format is not supported. Please upload a file in .csv, .xlsx, or .xls format.","error","","Okay",!1,!0,"svgIconHtml",null,"");if(!O.includes(T))return a.updateParentModel({uploadedFile:"",uploadedFileFirstObject:{}},a.checkForm({})),a.fileUploadSize$.next(0),a.fileUploadVal="",console.error("Invalid file type. Please upload a CSV, XLS, or XLSX file."),void(0,U.b1)("The uploaded file format is not supported. Please upload a file in .csv, .xlsx, or .xls format.","error","","Okay",!1,!0,"svgIconHtml",null,"");const S=new FileReader;S.onload=function(){var B=(0,J.A)(function*(G){try{const W=S.result,A={};if(a.defaultValues.uploadedFile=s,"csv"===T){let ie={complete:(H,ae)=>{let X=H.data;if(X.every(C=>/^\s*$/.test(C)))return console.error("The uploaded file cannot be empty or must contain at least two rows of data."),a.fileUploadSize$.next(0),a.fileUploadVal="",a.updateParentModel({uploadedFile:"",uploadedFileFirstObject:{}},a.checkForm({})),void(0,U.b1)("The uploaded file is either empty or does not contain the required minimum of two rows of data. Please upload a valid file.","error","","Okay",!1,!0,"svgIconHtml",null,"");if(X.length<2)return a.updateParentModel({uploadedFile:"",uploadedFileFirstObject:{}},a.checkForm({})),a.fileUploadSize$.next(0),a.fileUploadVal="",console.error("The uploaded file cannot be empty or must contain at least two rows of data."),void(0,U.b1)("The uploaded file is either empty or does not contain the required minimum of two rows of data. Please upload a valid file.","error","","Okay",!1,!0,"svgIconHtml",null,"");if(X.length>10001)return console.error("Exceeded the maximum allowed records (10,000)."),a.updateParentModel({uploadedFile:"",uploadedFileFirstObject:{}},a.checkForm({})),a.fileUploadSize$.next(0),a.fileUploadVal="",void(0,U.b1)("The uploaded file exceeds the maximum limit of 10,000 records. Please upload a file with fewer records.","error","","Okay",!1,!0,"svgIconHtml",a.router,"");const K=X[0].map(C=>C?.trim());console.log({headerRow:K});const Q=X[1].map(C=>{(C=C.trim()).startsWith('"')&&C.endsWith('"')&&(C=C.substring(1,C.length-1)),C.startsWith("'")&&C.endsWith("'")&&(C=C.substring(1,C.length-1));const Y=parseFloat(C);return isNaN(Y)||Y?.toString()?.length!==C?.toString()?.length?C.trim():Y});
1K.forEach((C,Y)=>{A[C]=Q[Y]?Q[Y]:""}),a.fileUploadVal=n.value,a.fileUploadSize$.next(k),a.updateParentModel({uploadedFileFirstObject:A},a.checkForm(A))}};a.papa.parse(W,ie)}else if("xls"===T||"xlsx"===T){let R;if(R=q.LF(W,{type:"binary",cellDates:!0,dateNF:"dd/mm/yyyy",cellNF:!1,cellText:!0}),R.SheetNames.length>1)return a.updateParentModel({uploadedFile:"",uploadedFileFirstObject:{}},a.checkForm({})),a.fileUploadSize$.next(0),a.fileUploadVal="",void(0,U.b1)("The uploaded file contains multiple sheets. Please ensure the file has only one sheet and try again.","error","","Okay",!1,!0,"svgIconHtml",a.router,"");const H=R.Sheets[R.SheetNames[0]],ae=H["!ref"]?q.Wp.decode_range(H["!ref"]).e.r+1:0;if(ae<=1)return a.updateParentModel({uploadedFile:"",uploadedFileFirstObject:{}},a.checkForm({})),a.fileUploadSize$.next(0),a.fileUploadVal="",console.error("The uploaded file cannot be empty or must contain at least two rows of data."),void(0,U.b1)("The uploaded file is either empty or does not contain the required minimum of two rows of data. Please upload a valid file.","error","","Okay",!1,!0,"svgIconHtml",null,"");if(ae>10001)return a.updateParentModel({uploadedFile:"",uploadedFileFirstObject:{}},a.checkForm({})),a.fileUploadSize$.next(0),a.fileUploadVal="",console.error("Exceeded the maximum allowed records (10,000)."),void(0,U.b1)("The uploaded file exceeds the maximum limit of 10,000 records. Please upload a file with fewer records.","error","","Okay",!1,!0,"svgIconHtml",a.router,"");const X=q.Wp.sheet_to_json(H,{header:1,range:0,raw:!1,defval:""})[0],pe=q.Wp.sheet_to_json(H,{header:1,range:1,raw:!1})[0];X.forEach((K,Q)=>{try{let C=pe[Q]||"";const Y=parseFloat(C);A[K]=isNaN(Y)||Y?.toString()?.length!==C?.toString()?.length?C?.trim():Y}catch(C){console.log(C)}}),a.fileUploadVal=n.value,a.fileUploadSize$.next(k),a.updateParentModel({uploadedFileFirstObject:A},a.checkForm(A))}}catch{a.updateParentModel({uploadedFile:"",uploadedFileFirstObject:{}},a.checkForm({})),a.fileUploadSize$.next(0),a.fileUploadVal=""}});return function(G){return B.apply(this,arguments)}}(),"xls"===T||"xlsx"===T?S.readAsBinaryString(s):S.readAsText(s)}})()}arrayBufferToBlob(t){return new Blob([t],{type:"application/octet-stream"})}checkForm(t){return this.defaultValues.uploadedFile&&Object.keys(t).length>0}ngOnDestroy(){this.unsubscribe.forEach(t=>t.unsubscribe())}resetFile(t){t.preventDefault(),this.form.reset(),this.fileUploadSize$.next(0),this.fileUploadVal="",this.updateParentModel({uploadedFileName:"",uploadedFile:"",uploadedFileFirstObject:{}},!1)}static \u0275fac=function(a){return new(a||i)(e.rXU(o.ok),e.rXU(w.Ix),e.rXU(st.F))};static \u0275cmp=e.VBU({type:i,selectors:[["app-upload"]],inputs:{updateParentModel:"updateParentModel",defaultValues:"defaultValues"},decls:17,vars:22,consts:[[1,"fw-bold","text-center","text-gray-900","mb-0","pb-4","pb-sm-6","pb-sm-8"],[1,"fv-row","mb-8",3,"formGroup"],["name","fileInput","id","kt_modal_create_campaign_files_upload",1,"dropzone","w-100",3,"ngClass","drop","dragover"],[1,"dz-message","needsclick","align-items-center","position-relative",3,"ngClass"],["formControlName","uploadedFile","type","file","id","fileInput",1,"btn","btn-primary","my-6","d-none",3,"accept","change"],[1,"d-flex","align-items-center","w-100",3,"ngClass"],[1,"ki-duotone","ki-file-up","fs-3hx","text-primary"],[1,"path1"],[1,"path2"],[3,"ngClass"],[1,"fw-bold","text-gray-700","mb-0","text-break"],[1,"fs-6","fw-normal","text-muted","mt-1","mb-0"],["type","button","class","ms-3 bg-transparent border-0 px-0 icon-hover-state",3,"click",4,"ngIf"],["class","fv-row mb-0",4,"ngIf"],["type","button",1,"ms-3","bg-transparent","border-0","px-0","icon-hover-state",3,"click"],["alt","remove file","src","./assets/media/recotap-assets/icons/cross-solid.svg",1,"w-20px","default"],["alt","remove file","src","./assets/media/recotap-assets/icons/cross-solid-red.svg",1,"w-20px","hovered"],[1,"fv-row","mb-0"],["id","selectImportLabel",1,"form-label","fs-6","fw-semibold","mb-2","required","text-gray-900"],["placeholder","Select Import Method",1,"ng-select__customStyles","text-capitalize","mw-400px",3,"ngModel","clearable","searchable","change"],[3,"value",4,"ngFor","ngForOf"],[3,"value"]],template:function(a,n){1&a&&(e.j41(0,"h2",0),e.EFF(1," Upload\n"),e.k0s(),e.j41(2,"div",1)(3,"label",2),e.bIt("drop",function(m){return n.handleDrop(m)})("dragover",function(m){return n.handleDragOver(m)}),e.j41(4,"div",3)(5,"input",4),e.bIt("change",function(m){return n.handleFileChange(m)}),e.k0s(),e.j41(6,"div",5)(7,"i",6),e.nrm(8,"span",7)(9,"span",8),e.k0s(),e.j41(10,"div",9)(11,"h4",10),e.EFF(12),e.k0s(),e.j41(13,"p",11),e.EFF(14),e.k0s()()(),e.DNE(15,rt,3,0,"button",12),e.k0s()()(),e.DNE(16,lt,5,4,"div",13)),2&a&&(e.R7$(2),e.Y8G("formGroup",n.form),e.R7$(),e.Y8G("ngClass",e.l_i(10,pt,!n.defaultValues.uploadedFileName,n.defaultValues.uploadedFileName)),e.R7$(),e.Y8G("ngClass",e.l_i(13,oe,!n.defaultValues.uploadedFileName,n.defaultValues.uploadedFileName)),e.R7$(),e.Y8G("accept",n.allowedFileTypes),e.R7$(),e.Y8G("ngClass",e.l_i(16,oe,!n.defaultValues.uploadedFileName,n.defaultValues.uploadedFileName)),e.R7$(4),e.Y8G("ngClass",e.l_i(19,ct,!n.defaultValues.uploadedFileName,n.defaultValues.uploadedFileName)),e.R7$(2),e.JRh(n.defaultValues.uploadedFileName?n.defaultValues.uploadedFileName:"Drag and drop or Choose a file to upload"),e.R7$(2),e.SpI("",n.defaultValues.uploadedFileName?"File size "+(n.fileUploadSize$.value.toFixed(2)||n.fileUploadSize$)+"KB":"(All .csv, .xlsx, and .xls file types are supported)"," "),e.R7$(),e.Y8G("ngIf",n.defaultValues.uploadedFileName),e.R7$(),e.Y8G("ngIf",n.importTypes.length))},dependencies:[p.YU,p.Sq,p.bT,y.vr,y.xt,o.me,o.BC,o.cb,o.j4,o.JD,o.vS]})}return i})();var le=l(45629),mt=l(10426);const ut=["modal"];function gt(i,r){1&i&&e.nrm(0,"img",28)}function ft(i,r){1&i&&e.nrm(0,"img",29)}function ht(i,r){1&i&&(e.j41(0,"span",30),e.nrm(1,"img",31),e.k0s())}function bt(i,r){if(1&i&&(e.j41(0,"li",24),e.DNE(1,gt,1,0,"img",25)(2,ft,1,0,"img",26)(3,ht,2,0,"span",27),e.j41(4,"span"),e.EFF(5),e.k0s()()),2&i){const t=r.$implicit;e.R7$(),e.Y8G("ngIf",0==t.isMapped),e.R7$(),e.Y8G("ngIf",1==t.isMapped),e.R7$(),e.Y8G("ngIf",null==t.isMapped),e.R7$(2),e.JRh(t.label)}}function _t(i,r){if(1&i&&(e.j41(0,"div",20)(1,"label",21),e.EFF(2,"Map all of :"),e.k0s(),e.j41(3,"ul",22),e.DNE(4,bt,6,4,"li",23),e.k0s()()),2&i){const t=e.XpG(4);e.R7$(4),e.Y8G("ngForOf",t.newImportsObject.mandatoryMappingProperties[t.importType].create.mapAllOf)}}function vt(i,r){1&i&&e.nrm(0,"img",28)}function yt(i,r){1&i&&e.nrm(0,"img",29)}function wt(i,r){1&i&&e.nrm(0,"img",35)}function It(i,r){1&i&&(e.j41(0,"span",30),e.nrm(1,"img",31),e.k0s())}function xt(i,r){if(1&i&&(e.j41(0,"li",33),e.DNE(1,vt,1,0,"img",25)(2,yt,1,0,"img",26)(3,wt,1,0,"img",34)(4,It,2,0,"span",27),e.j41(5,"span"),e.EFF(6),e.k0s()()),2&i){const t=r.$implicit;e.R7$(),e.Y8G("ngIf",0==t.isMapped),e.R7$(),e.Y8G("ngIf",1==t.isMapped),e.R7$(),e.Y8G("ngIf",1==t.isWarning&&!1!==t.isMapped),e.R7$(),e.Y8G("ngIf",null==t.isMapped&&!t.isWarning),e.R7$(2),e.JRh(t.label)}}function jt(i,r){if(1&i&&(e.j41(0,"div",20)(1,"label",21),e.EFF(2,"Map one of:"),e.k0s(),e.j41(3,"ul",22),e.DNE(4,xt,7,5,"li",32),e.k0s()()),2&i){const t=e.XpG(4);e.R7$(4),e.Y8G("ngForOf",t.newImportsObject.mandatoryMappingProperties[t.importType].create.mapOneOf)}}function Ft(i,r){if(1&i&&(e.j41(0,"div",18),e.DNE(1,_t,5,1,"div",19)(2,jt,5,1,"div",19),e.k0s()),2&i){const t=e.XpG(3);e.Y8G("ngClass",t.createClassList),e.R7$(),e.Y8G("ngIf",t.newImportsObject.mandatoryMappingProperties[t.importType].create.mapAllOf),e.R7$(),e.Y8G("ngIf",t.newImportsObject.mandatoryMappingProperties[t.importType].create.mapOneOf)}}function Mt(i,r){if(1&i&&(e.j41(0,"div")(1,"p",36),e.EFF(2),e.k0s()()),2&i){const t=e.XpG(3);e.R7$(2),e.SpI("* ",t.getCapitalizedImportType()," can't be imported. Required properties not mapped")}}function kt(i,r){1&i&&(e.j41(0,"div")(1,"p",37),e.EFF(2,"* Contacts won't be associated if multiple accounts share the same domain."),e.k0s()())}function St(i,r){if(1&i&&(e.j41(0,"div",13)(1,"div",14)(2,"p",15),e.EFF(3),e.k0s(),e.DNE(4,Ft,3,3,"div",16)(5,Mt,3,1,"div",17)(6,kt,3,0,"div",17),e.k0s()()),2&i){const t=e.XpG(2);e.R7$(3),e.SpI("Properties required to Create ",t.getCapitalizedImportType(),"*"),e.R7$(),e.Y8G("ngIf",t.newImportsObject.mandatoryMappingProperties[t.importType]&&t.newImportsObject.mandatoryMappingProperties[t.importType].create),e.R7$(),e.Y8G("ngIf",!(null!=t.newImportsObject.mandatoryMappingProperties[t.importType]&&null!=t.newImportsObject.mandatoryMappingProperties[t.importType].create&&t.newImportsObject.mandatoryMappingProperties[t.importType].create.isFullyMapped)),e.R7$(),e.Y8G("ngIf",(null==t.newImportsObject.mandatoryMappingProperties[t.importType]||null==t.newImportsObject.mandatoryMappingProperties[t.importType].create?null:t.newImportsObject.mandatoryMappingProperties[t.importType].create.isWarning)&&(null==t.newImportsObject.mandatoryMappingProperties[t.importType]||null==t.newImportsObject.mandatoryMappingProperties[t.importType].create?null:t.newImportsObject.mandatoryMappingProperties[t.importType].create.isFullyMapped)&&"contacts"==t.importType)}}function Ct(i,r){1&i&&e.nrm(0,"img",28)}function Tt(i,r){1&i&&e.nrm(0,"img",29)}function Ot(i,r){1&i&&(e.j41(0,"span",30),e.nrm(1,"img",31),e.k0s())}function Dt(i,r){if(1&i&&(e.j41(0,"div")(1,"li",33),e.DNE(2,Ct,1,0,"img",25)(3,Tt,1,0,"img",26)(4,Ot,2,0,"span",27),e.j41(5,"span"),e.EFF(6),e.k0s()()()),2&i){const t=r.$implicit;e.R7$(2),e.Y8G("ngIf",0==t.isMapped),e.R7$(),e.Y8G("ngIf",1==t.isMapped),e.R7$(),e.Y8G("ngIf",null==t.isMapped),e.R7$(2),e.JRh(t.label)}}function Pt(i,r){if(1&i&&(e.j41(0,"div",20)(1,"label",21),e.EFF(2,"Map all of:"),e.k0s(),e.j41(3,"ul",22),e.DNE(4,Dt,7,4,"div",7),e.k0s()()),2&i){const t=e.XpG(4);e.R7$(4),e.Y8G("ngForOf",t.newImportsObject.mandatoryMappingProperties[t.importType].update.mapAllOf)}}function Rt(i,r){1&i&&e.nrm(0,"img",28)}function Et(i,r){1&i&&e.nrm(0,"img",29)}function $t(i,r){1&i&&e.nrm(0,"img",35)}function Nt(i,r){1&i&&(e.j41(0,"span",30),e.nrm(1,"img",31),e.k0s())}function At(i,r){if(1&i&&(e.j41(0,"div")(1,"li",33),e.DNE(2,Rt,1,0,"img",25)(3,Et,1,0,"img",26)(4,$t,1,0,"img",34)(5,Nt,2,0,"span",27),e.j41(6,"span"),e.EFF(7),e.k0s()()()),2&i){const t=r.$implicit;e.R7$(2),e.Y8G("ngIf",0==t.isMapped),e.R7$(),e.Y8G("ngIf",1==t.isMapped),e.R7$(),e.Y8G("ngIf",1==t.isWarning&&!1!==t.isMapped),e.R7$(),e.Y8G("ngIf",null==t.isMapped&&!t.isWarning),e.R7$(2),e.JRh(t.label)}}function Gt(i,r){if(1&i&&(e.j41(0,"div",20)(1,"label",21),e.EFF(2,"Map one of:"),e.k0s(),e.j41(3,"ul",22),e.DNE(4,At,8,5,"div",7),e.k0s()()),2&i){const t=e.XpG(4);e.R7$(4),e.Y8G("ngForOf",t.newImportsObject.mandatoryMappingProperties[t.importType].update.mapOneOf)}}function Lt(i,r){if(1&i&&(e.j41(0,"div",18),e.DNE(1,Pt,5,1,"div",19)(2,Gt,5,1,"div",19),e.k0s()),2&i){const t=e.XpG(3);e.Y8G("ngClass",t.classList),e.R7$(),e.Y8G("ngIf",t.newImportsObject.mandatoryMappingProperties[t.importType].update.mapAllOf),e.R7$(),e.Y8G("ngIf",t.newImportsObject.mandatoryMappingProperties[t.importType].update.mapOneOf)}}function Vt(i,r){if(1&i&&(e.j41(0,"div")(1,"p",36),e.EFF(2),e.k0s()()),2&i){const t=e.XpG(3);e.R7$(2),e.SpI("* ",t.getCapitalizedImportType()," can't be imported. Required properties not mapped")}}function Yt(i,r){1&i&&(e.j41(0,"div")(1,"p",37),e.EFF(2,"* Contacts won't be associated if multiple accounts share the same domain."),e.k0s()())}function Ut(i,r){1&i&&(e.j41(0,"div")(1,"p",37),e.EFF(2,"* Account updates will not occur if multiple accounts share the same domain."),e.k0s()())}function Bt(i,r){1&i&&(e.j41(0,"div")(1,"p",37),e.EFF(2,"* Deals updates will not occur if multiple accounts share the same domain."),e.k0s()())}function Wt(i,r){if(1&i&&(e.j41(0,"div",13)(1,"div",14)(2,"p",38),e.EFF(3),e.k0s(),e.DNE(4,Lt,3,3,"div",16)(5,Vt,3,1,"div",17)(6,Yt,3,0,"div",17)(7,Ut,3,0,"div",17)(8,Bt,3,0,"div",17),e.k0s()()),2&i){const t=e.XpG(2);e.R7$(3),e.SpI("Properties required to Update ",t.getCapitalizedImportType(),"*"),e.R7$(),e.Y8G("ngIf",t.newImportsObject.mandatoryMappingProperties[t.importType]&&t.newImportsObject.mandatoryMappingProperties[t.importType].update),e.R7$(),e.Y8G("ngIf",!(null!=t.newImportsObject.mandatoryMappingProperties[t.importType]&&null!=t.newImportsObject.mandatoryMappingProperties[t.importType].update&&t.newImportsObject.mandatoryMappingProperties[t.importType].update.isFullyMapped||null!=t.newImportsObject.mandatoryMappingProperties[t.importType]&&null!=t.newImportsObject.mandatoryMappingProperties[t.importType].update&&t.newImportsObject.mandatoryMappingProperties[t.importType].update.isWarning)),e.R7$(),e.Y8G("ngIf",(null==t.newImportsObject.mandatoryMappingProperties[t.importType]||null==t.newImportsObject.mandatoryMappingProperties[t.importType].update?null:t.newImportsObject.mandatoryMappingProperties[t.importType].update.isWarning)&&"contacts"==t.importType),e.R7$(),e.Y8G("ngIf",(null==t.newImportsObject.mandatoryMappingProperties[t.importType]||null==t.newImportsObject.mandatoryMappingProperties[t.importType].update?null:t.newImportsObject.mandatoryMappingProperties[t.importType].update.isWarning)&&"accounts"==t.importType),e.R7$(),e.Y8G("ngIf",(null==t.newImportsObject.mandatoryMappingProperties[t.importType]||null==t.newImportsObject.mandatoryMappingProperties[t.importType].update?null:t.newImportsObject.mandatoryMappingProperties[t.importType].update.isWarning)&&"deals"==t.importType)}}const Xt=()=>["create","createAndUpdate"],zt=()=>["update","createAndUpdate"];function Ht(i,r){if(1&i&&(e.j41(0,"div",11),e.DNE(1,St,7,4,"div",12)(2,Wt,9,6,"div",12),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.Y8G("ngIf",e.lJ4(2,Xt).includes(t.newImportsObject.selectedImportMethod)),e.R7$(),e.Y8G("ngIf",e.lJ4(3,zt).includes(t.newImportsObject.selectedImportMethod))}}function Kt(i,r){1&i&&(e.j41(0,"div",40),e.nrm(1,"img",31),e.k0s())}function Jt(i,r){1&i&&e.nrm(0,"img",31)}function qt(i,r){1&i&&e.nrm(0,"img",29)}function Qt(i,r){if(1&i){const t=e.RV6();e.j41(0,"img",66),e.bIt("click",function(){e.eBV(t);const n=e.XpG(2).$implicit,s=e.XpG();return e.Njj(s.showAlert(n.validationErrorMessage))}),e.k0s()}}function Zt(i,r){if(1&i){const t=e.RV6();e.j41(0,"span",67),e.bIt("click",function(){e.eBV(t);const n=e.XpG(2).$implicit,s=e.XpG();return e.Njj(s.showAlert(n.validationErrorMessage))}),e.EFF(1,"error"),e.k0s()}}function ei(i,r){if(1&i&&(e.j41(0,"div",46),e.DNE(1,Jt,1,0,"img",63)(2,qt,1,0,"img",26)(3,Qt,1,0,"img",64)(4,Zt,2,0,"span",65),e.k0s()),2&i){const t=e.XpG().$implicit;e.R7$(),e.Y8G("ngIf","unMapped"==t.recotapProperty),e.R7$(),e.Y8G("ngIf",t.isMappingValid&&"unMapped"!=t.recotapProperty),e.R7$(),e.Y8G("ngIf",0==t.isMappingValid),e.R7$(),e.Y8G("ngIf",0==t.isMappingValid)}}function ti(i,r){if(1&i){const t=e.RV6();e.j41(0,"div",68)(1,"span",69),e.bIt("click",function(){const s=e.eBV(t).$implicit,m=e.XpG().index,k=e.sdS(13),O=e.XpG();return e.Njj(O.handleCustomPropertySelectionChange(s,m,k))}),e.EFF(2),e.k0s()()}if(2&i){const t=r.$implicit;e.R7$(2),e.SpI(" ",t.label," ")}}function ii(i,r){if(1&i){const t=e.RV6();e.j41(0,"tr")(1,"td",39)(2,"div",40),e.EFF(3),e.k0s()(),e.j41(4,"td",39)(5,"div",41),e.EFF(6),e.k0s()(),e.j41(7,"td",42),e.DNE(8,Kt,2,0,"div",43)(9,ei,5,4,"div",44),e.k0s(),e.j41(10,"td",45)(11,"div",46)(12,"div",47,48)(14,"button",49),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.clearSearch())}),e.j41(15,"span",50),e.EFF(16),e.k0s()(),e.j41(17,"div",51)(18,"div",52)(19,"div",53)(20,"i",54),e.nrm(21,"span",55)(22,"span",56),e.k0s(),e.j41(23,"input",57),e.mxI("ngModelChange",function(n){e.eBV(t);const s=e.XpG();return e.DH7(s.searchTerm,n)||(s.searchTerm=n),e.Njj(n)}),e.k0s()()(),e.j41(24,"div",58),e.DNE(25,ti,3,1,"div",59),e.k0s(),e.j41(26,"div",60)(27,"div",61)(28,"button",62),e.bIt("click",function(){const s=e.eBV(t).index,m=e.XpG();return e.Njj(m.openModal(s))}),e.EFF(29," + Add Custom Property "),e.k0s()()()()()()()()}if(2&i){const t=r.$implicit,a=e.XpG();e.R7$(3),e.SpI(" ",t.columnName," "),e.R7$(3),e.SpI(" ",t.columnValue," "),e.R7$(2),e.Y8G("ngIf",!t.mappedProperty),e.R7$(),e.Y8G("ngIf",t.mappedProperty),e.R7$(7),e.JRh(t.mappedProperty||"Choose or create a property"),e.R7$(7),e.R50("ngModel",a.searchTerm),e.R7$(2),e.Y8G("ngForOf",a.FinalModifiedCustomProperties)}}let ai=(()=>{class i{modalServ
1ice;importsServices;cdr;router;createCustomFieldsComponent;modalConfig={modalTitle:"Add New Property",centered:!0,size:"sm"};modalComponent;recotapProperties;newImportsObject;newImportsObject$=new z.t(null);customProperties;modifiedCustomProperties;originalCustomProperties;importType;importMethod;searchTerm="";unsubscribe=[];selectedDropdownIndex;importTypeFilters={accounts:["Account ID"],contacts:["Contact ID"],deals:["Deal ID"]};duplicateAllowedFields=["Account Domain","Email ID"];updateParentModel;get FinalModifiedCustomProperties(){return this.modifiedCustomProperties?.filter(t=>t.label.toLowerCase().includes(this.searchTerm.toLowerCase()))}get classList(){const t=this.newImportsObject.mandatoryMappingProperties[this.importType]?.update;return t?.mapOneOf?.every(a=>a.isMapped)?{"border-semantic-green bg-light-semantic-green":!0}:t?.mapOneOf?.some(a=>!1===a.isMapped)?{"bg-light-semantic-red border-semantic-red":!0}:t?.isWarning?{"border-semantic-yellow bg-light-semantic-yellow":!0}:{"border-semantic-green bg-light-semantic-green":t?.isFullyMapped,"bg-light-semantic-red border-semantic-red":!t?.isFullyMapped}}get createClassList(){const t=this.newImportsObject.mandatoryMappingProperties[this.importType]?.create;let a=t?.mapOneOf,n=t?.mapAllOf,s={};return a?.length&&!n?.length?(a?.every(m=>m.isMapped)?s={...s,"border-semantic-green bg-light-semantic-green":!0}:a?.some(m=>!1===m.isMapped)&&(s={...s,"bg-light-semantic-red border-semantic-red":!0}),t?.isWarning&&(s={...s,"border-semantic-yellow bg-light-semantic-yellow":!0}),s={...s,"border-semantic-green bg-light-semantic-green":t?.isFullyMapped,"bg-light-semantic-red border-semantic-red":!t?.isFullyMapped}):a?.length&&n?.length?s=a.some(m=>m.isMapped)&&n.every(m=>m.isMapped)?t?.isWarning?{"border-semantic-yellow bg-light-semantic-yellow":!0}:{"border-semantic-green bg-light-semantic-green":!0}:a.some(m=>!1===m.isMapped)||n.some(m=>!1===m.isMapped)?{"bg-light-semantic-red border-semantic-red":!0}:t?.isWarning&&t?.isFullyMapped?{"border-semantic-yellow bg-light-semantic-yellow":!0}:{"border-semantic-green bg-light-semantic-green":t?.isFullyMapped,"bg-light-semantic-red border-semantic-red":!t?.isFullyMapped}:n&&!a?(n?.every(m=>m.isMapped)?s={"border-semantic-green bg-light-semantic-green":!0}:n?.some(m=>!1===m.isMapped)&&(s={"bg-light-semantic-red border-semantic-red":!0}),t?.isWarning&&(s={"border-semantic-yellow bg-light-semantic-yellow":!0}),s={"border-semantic-green bg-light-semantic-green":t?.isFullyMapped,"bg-light-semantic-red border-semantic-red":!t?.isFullyMapped}):s={"border-semantic-green bg-light-semantic-green":t?.isFullyMapped,"bg-light-semantic-red border-semantic-red":!t?.isFullyMapped},s}constructor(t,a,n,s){this.modalService=t,this.importsServices=a,this.cdr=n,this.router=s}ngOnInit(){console.log("this.newImportsObject>>>>",this.newImportsObject),this.updateParentModel({},!1),this.importType=this.newImportsObject.importType,this.importMethod=this.newImportsObject.selectedImportMethod,this.fetchCustomFields()}generateCustomMapping(t){const a=t.uploadedFileFirstObject;this.newImportsObject.customMapping=Object.keys(a).map(n=>({columnName:n,columnValue:a[n],isMappingValid:!0,mappedProperty:"Don't import this column",recotapProperty:"unMapped",validationErrorMessage:""}))}fetchCustomFields(){this.importsServices.getCustomFields().subscribe(t=>{this.customProperties=t.data||[],this.recotapProperties=I.A.RECOTAP_PROPERTIES[this.importType];const a=this.importTypeFilters[this.importType];a&&"create"===this.importMethod&&(this.recotapProperties=this.recotapProperties.filter(n=>!a.includes(n.label))),this.modifiedCustomProperties=[...this.recotapProperties,...this.customProperties],this.originalCustomProperties=[...this.recotapProperties,...this.customProperties],Object.keys(this.newImportsObject.uploadedFileFirstObject).length&&!this.newImportsObject.customMapping?.length&&this.generateCustomMapping(this.newImportsObject),this.newImportsObject.customMapping.length&&this.cleanupAndReturn(),(0,ne.P)(),this.cdr.detectChanges(),this.updateParentModel({customMapping:this.newImportsObject.customMapping},this.checkForm())})}handleCustomPropertySelectionChange(t,a,n){console.log("dropdown>1>>",n),this.newImportsObject.customMapping[a].mappedProperty=t.label,this.newImportsObject.customMapping[a].recotapProperty=t.key,console.log("this.newImportsObject[customMapping][index]>>after>>",this.newImportsObject.customMapping),console.log("this.newImportsObject[customMapping][index]>>>>",this.newImportsObject.customMapping[a]);const{recotapProperty:m,columnValue:k}=this.newImportsObject.customMapping[a],O=this.originalCustomProperties.find(T=>T.key===m);O?this.importsServices.validateFieldMapping({columnValue:k,mappedField:O.key,importType:this.importType}).subscribe(({data:T})=>{T?(this.newImportsObject.customMapping[a].isMappingValid=T.isMappingValid,this.newImportsObject.customMapping[a].validationErrorMessage=T.validationErrorMessage):(this.newImportsObject.customMapping[a].isMappingValid=!0,this.newImportsObject.customMapping[a].validationErrorMessage=""),this.cleanupAndReturn(),this.isAllMappedTrue(this.importType,this.importMethod),this.update(),this.cdr.detectChanges(),console.log("dropdown>>>",n),n?.close()}):this.cleanupAndReturn()}update(){this.updateParentModel({customMapping:this.newImportsObject.customMapping},this.checkForm())}fetchMappedPropertyValues(t){return t.filter(a=>null!=a?.recotapProperty).map(a=>a.recotapProperty)}getCapitalizedImportType(){const t=this.newImportsObject.importType;return t.charAt(0).toUpperCase()+t.slice(1)}isAllMappedTrue(t,a){const n=(s,m)=>{if(!this.newImportsObject.mandatoryMappingProperties[s][m])return;const k=S=>{S?.forEach((G,W)=>{const A=this.newImportsObject.customMapping.find(R=>R.mappedProperty===G.label);
1G.isDuplicateAllowed&&A?.isMappingValid&&S.forEach(R=>{R.isWarning=R.label!==A.mappedProperty,R.isMapped&&(R.isWarning=!1)}),G.isMapped=!!A?.isMappingValid||!A?.validationErrorMessage&&null});const B=this.newImportsObject.mandatoryMappingProperties[s][m].mapOneOf;B?.forEach((G,W)=>{G.isDuplicateAllowed&&G.isMapped?B.forEach((A,R)=>{R!==W&&(A.isWarning=!0)}):G.isDuplicateAllowed&&!G.isMapped?B.forEach((A,R)=>{R!==W&&(A.isWarning=!1)}):G.isMapped&&(G.isWarning=!1),!1===G.isMapped&&(G.isWarning=!1)})},O=this.newImportsObject.mandatoryMappingProperties[s][m].mapAllOf,T=this.newImportsObject.mandatoryMappingProperties[s][m].mapOneOf;O&&T?(k(this.newImportsObject.mandatoryMappingProperties[s][m].mapAllOf),k(this.newImportsObject.mandatoryMappingProperties[s][m].mapOneOf),this.newImportsObject.mandatoryMappingProperties[s][m].isFullyMapped=O.every(S=>!0===S.isMapped)&&T.some(S=>!0===S.isMapped),this.newImportsObject.mandatoryMappingProperties[s][m].isWarning=T.some(S=>!0===S.isWarning)):O?(k(this.newImportsObject.mandatoryMappingProperties[s][m].mapAllOf),this.newImportsObject.mandatoryMappingProperties[s][m].isFullyMapped=O.every(S=>!0===S.isMapped)):T&&(k(this.newImportsObject.mandatoryMappingProperties[s][m].mapOneOf),this.newImportsObject.mandatoryMappingProperties[s][m].isFullyMapped=T.some(S=>!0===S.isMapped)&&T.every(S=>!1!==S.isMapped),this.newImportsObject.mandatoryMappingProperties[s][m].isWarning=T.some(S=>!0===S.isWarning))};"create"===a||"update"===a?n(t,a):(n(t,"create"),n(t,"update"))}cleanupAndReturn(){const t=this.fetchMappedPropertyValues(this.newImportsObject.customMapping);this.modifiedCustomProperties=this.originalCustomProperties?.filter(a=>"unMapped"===a.key||!t?.includes(a.key))}finalSelectionMapping(){let t=[];this.newImportsObject.customMapping.forEach(a=>{t.push({column:a.columnName,recotapProperty:a.mappedProperty})})}checkForm(){const t=m=>{const k=this.newImportsObject.mandatoryMappingProperties[this.importType][m].mapAllOf,O=this.newImportsObject.mandatoryMappingProperties[this.importType][m].mapOneOf;if(k&&O){const T=k.every(B=>!0===B.isMapped),S=O.some(B=>!0===B.isMapped);return T&&S}return k?(k.every(S=>1==S.isMapped),k.every(S=>!0===S.isMapped)):!!O&&O.some(T=>!0===T.isMapped)};let a=!1;if("create"===this.importMethod||"update"===this.importMethod)a=t(this.importMethod);else if("createAndUpdate"===this.importMethod){let m=t("update");a=t("create")&&m}let n=this.newImportsObject.customMapping?.every(m=>!0===m.isMappingValid),s=this.newImportsObject.customMapping?.some(m=>m.validationErrorMessage);return a&&!s&&n}clearSearch(){this.searchTerm=""}openModal(t){var a=this;return(0,J.A)(function*(){return a.selectedDropdownIndex=t,a.createCustomFieldsComponent.reset(),yield a.modalComponent.open()})()}dismissModal(t){var a=this;return(0,J.A)(function*(){t?.length&&(a.originalCustomProperties=[...a.originalCustomProperties,...t],a.modifiedCustomProperties=[...a.modifiedCustomProperties,...t],"number"==typeof a.selectedDropdownIndex&&a.selectedDropdownIndex>-1&&a.handleCustomPropertySelectionChange(t[0],a.selectedDropdownIndex),a.selectedDropdownIndex=void 0),a.modalComponent?yield a.modalComponent.dismiss():console.error("modalComponent is not initialized!")})()}showAlert=t=>{(0,U.b1)(t.heading,"error","","Okay",!1,!0,"svgIconHtml",null,t.message)};showCustomAlert(t,a,n="warning",s){const m=`\n <div>\n <h3>${t||"invalid"}</h3>\n <p>${a}</p>\n </div>\n `;re().fire({html:m,icon:n,showCancelButton:!1,confirmButtonText:s,customClass:{confirmButton:"btn btn-lg btn-primary rounded-pill",cancelButton:"btn btn-lg btn-secondary rounded-pill"},cancelButtonText:"Cancel",heightAuto:!1,preConfirm:()=>Promise.resolve()}).then(k=>{})}ngOnDestroy(){this.unsubscribe.forEach(t=>t.unsubscribe())}static \u0275fac=function(a){return new(a||i)(e.rXU(h.Bq),e.rXU(g.s),e.rXU(e.gRc),e.rXU(w.Ix))};static \u0275cmp=e.VBU({type:i,selectors:[["app-property-mapping"]],viewQuery:function(a,n){if(1&a&&(e.GBs(le.W,5),e.GBs(ut,5)),2&a){let s;e.mGM(s=e.lsd())&&(n.createCustomFieldsComponent=s.first),e.mGM(s=e.lsd())&&(n.modalComponent=s.first)}},inputs:{newImportsObject:"newImportsObject",updateParentModel:"updateParentModel"},decls:21,vars:3,consts:[[1,"fw-bold","d-flex","align-items-center","justify-content-center","text-gray-900","mb-0","pb-4","pb-sm-6","pb-sm-8"],["class","row g-8",4,"ngIf"],[1,"card-body","border","border-gray-100","mt-6","mt-lg-8","p-6","pb-3","rounded-6"],[1,"table-responsive"],[1,"table","table-row-dashed","table-row-gray-300","align-middle","gs-0","gy-4","mb-0"],[1,"min-w-150px","fs-6","fw-bold","text-muted","pe-1","pt-0","ps-0","pb-4"],[1,"min-w-300px","w-300px","fs-6","fw-bold","text-muted","pe-1","pt-0","ps-0","pb-4"],[4,"ngFor","ngForOf"],[3,"modalConfig"],["modal",""],[3,"dismissModal"],[1,"row","g-8"],["class","col-12 col-md-6",4,"ngIf"],[1,"col-12","col-md-6"],[1,"d-flex","flex-column","justify-content-between","h-100"],[1,"text-gray-900","mb-3","fs-xl","fw-semibold"],["class","row h-100 m-0 g-0 rounded border p-6",3,"ngClass",4,"ngIf"],[4,"ngIf"],[1,"row","h-100","m-0","g-0","rounded","border","p-6",3,"ngClass"],["class","col-sm-6 pe-3",4,"ngIf"],[1,"col-sm-6","pe-3"],[1,"mb-3","fs-xl","fw-bold","text-gray-700"],[1,"ps-0","mb-0"],["class","d-flex align-items-center gap-3 mb-2 text-break fs-lg",4,"ngFor","ngForOf"],[1,"d-flex","align-items-center","gap-3","mb-2","text-break","fs-lg"],["src","./assets/media/recotap-assets/icons/error-cross.svg","alt","cancel","class","w-16px w-lg-24px",4,"ngIf"],["src","./assets/media/recotap-assets/icons/success-icon.svg","alt","success","class","w-16px w-lg-24px",4,"ngIf"],["class","flex-shrink-0",4,"ngIf"],["src","./assets/media/recotap-assets/icons/error-cross.svg","alt","cancel",1,"w-16px","w-lg-24px"],["src","./assets/media/recotap-assets/icons/success-icon.svg","alt","success",1,"w-16px","w-lg-24px"],[1,"flex-shrink-0"],["src","./assets/media/recotap-assets/icons/hyphen-icon.svg","alt","",1,"w-16px","w-lg-24px"],["class","d-flex align-items-center gap-3 mb-2 text-break",4,"ngFor","ngForOf"],[1,"d-flex","align-items-center","gap-3","mb-2","text-break"],["src","./assets/media/recotap-assets/icons/warning.svg","alt","warning","class","w-16px w-lg-24px",4,"ngIf"],["src","./assets/media/recotap-assets/icons/warning.svg","alt","warning",1,"w-16px","w-lg-24px"],[1,"mt-2","mb-0","text-semantic-red","fs-sm","fw-semibold"],[1,"mt-2","mb-0","text-semantic-yellow","fs-sm","fw-semibold"],[1,"mb-3","fw-bold","fs-5"],[1,"py-3","px-0"],[1,"d-flex","align-items-center","py-2","fw-bold","fs-lg","text-gray-700"],[1,"py-2","fw-bold","fs-lg","text-gray-700","w-90","mw-250px","text-truncate"],[1,"text-capitalize","py-3","px-0","text-muted","fw-semibold","text-end"],["class","d-flex align-items-center py-2 fw-bold fs-lg text-gray-700",4,"ngIf"],["class","d-flex align-items-center",4,"ngIf"],[1,"text-capitalize","py-4","px-0","text-start"],[1,"d-flex","align-items-center"],["ngbDropdown","",1,"card-toolbar","w-100","position-static"],["myDropdown","ngbDropdown"],["type","button","ngbDropdownToggle","",1,"btn","btn-icon","btn-color-gray-500","btn-active-color-primary","justify-content-start","w-100","h-100","no-caret",3,"click"],["id","first_name",1,"form-select","bg-gray-50","d-flex","justify-content-start","text-gray-700","py-2","px-3","rounded-pill","fw-bold"],["ngbDropdownMenu","",1,"rounded-3","fw-semibold","w-300px","overflow-hidden","my-2","py-0","border","border-gray-100"],[1,"card-title","bg-white"],[1,"d-flex","align-items-center","position-relative","py-2","px-3","border-bottom","border-gray-100"],[1,"ki-duotone","ki-magnifier","fs-3","position-absolute","ms-5"],[1,"path1"],[1,"path2"],["type","text","data-kt-user-table-filter","search","placeholder","Search Property",1,"form-control","form-control-solid","w-100","ps-13","rounded-pill","text-gray-700",3,"ngModel","ngModelChange"],[1,"overflow-y-auto","mh-40vh"],["class","menu-item py-0",4,"ngFor","ngForOf"],[1,"menu-item","bg-white","border-top","border-gray-100","py-0"],[1,"menu-content","px-3","py-3"],["type","button",1,"btn-sm","bg-transparent","border-0","fw-bold","fs-6","p-0","menu-link",3,"click"],["src","./assets/media/recotap-assets/icons/hyphen-icon.svg","alt","","class","w-16px w-lg-24px",4,"ngIf"],["src","./assets/media/recotap-assets/icons/error-icon.svg","alt","error","class","w-16px w-lg-24px curs
1or-pointer",3,"click",4,"ngIf"],["class","text-danger ms-3 cursor-pointer",3,"click",4,"ngIf"],["src","./assets/media/recotap-assets/icons/error-icon.svg","alt","error",1,"w-16px","w-lg-24px","cursor-pointer",3,"click"],[1,"text-danger","ms-3","cursor-pointer",3,"click"],[1,"menu-item","py-0"],[1,"menu-link","px-3",3,"click"]],template:function(a,n){1&a&&(e.j41(0,"h2",0),e.EFF(1," Review the Mapping of your files\n"),e.k0s(),e.DNE(2,Ht,3,4,"div",1),e.j41(3,"div",2)(4,"div",3)(5,"table",4)(6,"thead")(7,"tr")(8,"th",5),e.EFF(9,"Column Name"),e.k0s(),e.j41(10,"th",5),e.EFF(11,"Preview"),e.k0s(),e.j41(12,"th",5),e.EFF(13,"Mapped"),e.k0s(),e.j41(14,"th",6),e.EFF(15,"Recotap Property"),e.k0s()()(),e.j41(16,"tbody"),e.DNE(17,ii,30,7,"tr",7),e.k0s()()()(),e.j41(18,"app-modal",8,9)(20,"app-create-custom-fields",10),e.bIt("dismissModal",function(m){return n.dismissModal(m)}),e.k0s()()),2&a&&(e.R7$(2),e.Y8G("ngIf",n.newImportsObject.selectedImportMethod),e.R7$(15),e.Y8G("ngForOf",n.newImportsObject.customMapping),e.R7$(),e.Y8G("modalConfig",n.modalConfig))},dependencies:[p.YU,p.Sq,p.bT,o.me,o.BC,o.vS,le.W,mt.z,h.tg,h.do,h.U0]})}return i})();const ee=(i,r)=>({current:i,completed:r}),te=(i,r)=>({"border-gray-900":i,"border-gray-400":r});function ni(i,r){if(1&i&&(e.j41(0,"div",21)(1,"div",22)(2,"div",23),e.nrm(3,"span",24),e.k0s(),e.j41(4,"h6",25),e.EFF(5,"Segments"),e.k0s()(),e.nrm(6,"div",26),e.k0s()),2&i){const t=e.XpG(2);e.Y8G("ngClass",e.l_i(2,ee,4===t.currentStep$.value,t.currentStep$.value>4)),e.R7$(2),e.Y8G("ngClass",e.l_i(5,te,4===t.currentStep$.value,4!==t.currentStep$.value))}}function si(i,r){if(1&i&&(e.j41(0,"div",20)(1,"div",21)(2,"div",22)(3,"div",23),e.nrm(4,"span",24),e.k0s(),e.j41(5,"h6",25),e.EFF(6,"Upload"),e.k0s()()(),e.j41(7,"div",21)(8,"div",22)(9,"div",23),e.nrm(10,"span",24),e.k0s(),e.j41(11,"h6",25),e.EFF(12,"Map"),e.k0s()(),e.nrm(13,"div",26),e.k0s(),e.DNE(14,ni,7,8,"div",27),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.Y8G("ngClass",e.l_i(5,ee,2===t.currentStep$.value,t.currentStep$.value>2)),e.R7$(2),e.Y8G("ngClass",e.l_i(8,te,2===t.currentStep$.value,2!==t.currentStep$.value)),e.R7$(4),e.Y8G("ngClass",e.l_i(11,ee,3===t.currentStep$.value,t.currentStep$.value>3)),e.R7$(2),e.Y8G("ngClass",e.l_i(14,te,3===t.currentStep$.value,3!==t.currentStep$.value)),e.R7$(5),e.Y8G("ngIf","accounts"===t.newImport$.value.importType)}}function ri(i,r){if(1&i&&(e.qex(0),e.nrm(1,"app-import-type",28),e.bVm()),2&i){const t=e.XpG();e.R7$(),e.Y8G("updateParentModel",t.updateImport)("defaultValues",t.newImport$.value)}}function oi(i,r){if(1&i&&(e.qex(0),e.nrm(1,"app-upload",28),e.bVm()),2&i){const t=e.XpG();e.R7$(),e.Y8G("updateParentModel",t.updateImport)("defaultValues",t.newImport$.value)}}function li(i,r){if(1&i&&(e.qex(0),e.nrm(1,"app-property-mapping",29),e.bVm()),2&i){const t=e.XpG();e.R7$(),e.Y8G("updateParentModel",t.updateImport)("newImportsObject",t.newImport$.value)}}function pi(i,r){if(1&i&&(e.qex(0),e.nrm(1,"app-segments",30),e.bVm()),2&i){const t=e.XpG();e.R7$(),e.Y8G("updateParentModel",t.updateImport)("segmentsObject",t.newImport$.value)}}function ci(i,r){if(1&i){const t=e.RV6();e.qex(0),e.j41(1,"button",31),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.prevStep())}),e.EFF(2," Back "),e.k0s(),e.bVm()}}function di(i,r){1&i&&(e.qex(0),e.j41(1,"a",32),e.EFF(2," Cancel "),e.k0s(),e.bVm())}function mi(i,r){if(1&i){const t=e.RV6();e.j41(0,"button",33),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.resetSegmentSelection())}),e.EFF(1," Clear "),e.k0s()}}function ui(i,r){1&i&&(e.qex(0),e.j41(1,"span",34),e.EFF(2," Please wait... "),e.nrm(3,"span",35),e.k0s(),e.bVm()),2&i&&(e.R7$(),e.xc7("display","block"))}function gi(i,r){1&i&&(e.qex(0),e.EFF(1),e.nrm(2,"app-keenicon",36),e.bVm()),2&i&&(e.R7$(),e.SpI(" Continue "," "," "))}function fi(i,r){1&i&&(e.qex(0),e.j41(1,"span",37),e.EFF(2,"Finish Import"),e.k0s(),e.bVm())}const hi=[{path:"",component:E,children:[{path:"",component:Pe},{path:"new-import",component:(()=>{class i{importsServices;cdr;_router;toastr;route;newImportTitle="New Imports";newImport$=new z.t(Ee);isLoading$;currentStep$=new z.t(1);isCurrentFormValid$=new z.t(!1);segmentsComponent;unsubscribe=[];router;constructor(t,a,n,s,m){this.importsServices=t,this.cdr=a,this._router=n,this.toastr=s,this.route=m,this.router=n,this.isLoading$=this.importsServices.isLoading$,this.route.queryParams.subscribe(k=>{this.currentStep$.next(+k.step||1),this.newImport$.value.importType=k.importType})}ngOnInit(){}get importFormCount(){return"accounts"===this.newImport$.value.importType?4:3}updateImport=(t,a)=>{const s={...this.newImport$.value,...t};this.newImport$.next(s),this.isCurrentFormValid$.next(a),this.cdr&&this.cdr.detectChanges()};extractKeys(t){return Object.keys(t)}createArrayOfObjects(t,a){let n=[];return t.forEach(s=>{s.recotapProperty||(s.recotapProperty="unMapped"),n.push({column:s.columnName,recotapProperty:s.recotapProperty})}),n}nextStep(){const t=this.currentStep$.value+1;if(t-1!==this.importFormCount&&this.currentStep$.next(t),t-1===this.importFormCount){const a=this.extractKeys(this.newImport$.value.uploadedFileFirstObject),n=this.createArrayOfObjects(this.newImport$.value.customMapping,a);let s={objectType:this.newImport$.value.importType,importType:this.newImport$.value.selectedImportMethod,fieldMapping:JSON.stringify(n),importHeaders:a,segmentName:"newSegment"===this.newImport$.value.isNewSegment?this.newImport$.value.segmentName:"",segmentId:"existingSegment"===this.newImport$.value.isNewSegment?this.newImport$.value.segmentId:"",segmentType:"static"};this.importsServices.createImport(s,this.newImport$.value.uploadedFile).subscribe(m=>{this.router.navigate(["/data-hub/import-export/imports"]),this.toastr.success("Please wait while we process the data.","File Upload Successful")})}}clearSelection(){this.newImport$.value.isNewSegment="",this.newImport$.value.segmentId&&(this.newImport$.value.segmentId=""),this.newImport$.value.segmentName&&(this.newImport$.value.segmentName=""),this.isCurrentFormValid$.next(!0)}resetSegmentSelection(){this.newImport$.value.isNewSegment="",this.newImport$.value.segmentId&&(this.newImport$.value.segmentId=""),this.newImport$.value.segmentName&&(this.newImport$.value.segmentName=""),this.isCurrentFormValid$.next(!0),this.segmentsComponent.resetSegmentSelection()}prevStep(){const t=this.currentStep$.value-1;
1if(0!==t){if(1===t)return void this.router.navigate(["/targets/accounts/list/active"]);this.currentStep$.next(t)}}ngOnDestroy(){this.unsubscribe.forEach(t=>t.unsubscribe())}static \u0275fac=function(a){return new(a||i)(e.rXU(g.s),e.rXU(e.gRc),e.rXU(w.Ix),e.rXU(He.tw),e.rXU(w.nX))};static \u0275cmp=e.VBU({type:i,selectors:[["app-new-import"]],viewQuery:function(a,n){if(1&a&&e.GBs(se,5),2&a){let s;e.mGM(s=e.lsd())&&(n.segmentsComponent=s.first)}},decls:33,vars:19,consts:[["id","kt_app_main",1,"app-main","flex-column","flex-row-fluid"],[1,"d-flex","flex-column","flex-column-fluid"],["id","kt_app_toolbar",1,"app-toolbar","d-flex","flex-stack","flex-row-fluid"],[1,"d-flex","flex-column","flex-row-fluid"],[1,"page-title","d-flex","align-items-center","me-3"],[1,"page-heading","d-flex","text-gray-900","fw-bold","flex-column","justify-content-center","my-0","text-capitalize"],["id","kt_app_content",1,"app-content","line-stepper","pt-0"],["id","kt_create_account_stepper",1,"stepper","stepper-pills","stepper-column","d-flex","flex-column"],[1,"d-flex","flex-column","flex-row-fluid","flex-center","bg-body"],[1,"card-body","w-100"],["class","row pt-8",4,"ngIf"],["noValidate","","id","kt_create_account_form",1,"pt-8","w-100"],[1,"current"],[4,"ngIf"],[1,"d-flex","flex-stack","pt-8"],[1,"mr-2"],[1,"d-flex","align-items-center","gap-1"],["type","button","class","btn btn-lg text-danger bg-transparent border-0",3,"click",4,"ngIf"],["type","button",1,"btn-solid-primary","fw-semibold","fs-lg","px-4","py-3",3,"disabled","click"],[1,"indicator-label","d-flex","align-items-center"],[1,"row","pt-8"],[1,"stepper-item","position-relative","col",3,"ngClass"],[1,"stepper-wrapper","flex-column","gap-2"],[1,"stepper-icon","me-0","bg-white","w-32px","h-32px","border","border-1","rounded-8",3,"ngClass"],[1,"w-10px","h-10px","rounded-pill","stepper-check"],[1,"text-center","text-gray-700","fs-sm","mb-0"],[1,"position-absolute","border","border-primary-light","stepper-progressBar"],["class","stepper-item position-relative col",3,"ngClass",4,"ngIf"],[1,"p-4","p-sm-6","p-lg-8","card","w-100","shadow-none",3,"updateParentModel","defaultValues"],[1,"p-4","p-sm-6","p-lg-8","card","w-100","shadow-none",3,"updateParentModel","newImportsObject"],[1,"p-4","p-sm-6","p-lg-8","card","w-100","shadow-none",3,"updateParentModel","segmentsObject"],["type","button",1,"btn","btn-lg","btn-active-primary","me-3","border","border-primary","px-4","py-3","lh-sm",3,"click"],["routerLink","/data-hub/import-export/imports",1,"btn-outline-primary","fw-semibold","me-3","px-4","py-3","fs-lg"],["type","button",1,"btn","btn-lg","text-danger","bg-transparent","border-0",3,"click"],[1,"indicator-progress"],[1,"spinner-border","spinner-border-sm","align-middle","ms-2"],["name","arrow-right",1,"fs-3","ms-2","me-0"],[1,"indicator-label"]],template:function(a,n){1&a&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"h1",5),e.EFF(6),e.k0s()()()(),e.j41(7,"div",6)(8,"div",7)(9,"div",8)(10,"div",9),e.DNE(11,si,15,17,"div",10),e.k0s(),e.j41(12,"form",11)(13,"div",12),e.DNE(14,ri,2,2,"ng-container",13)(15,oi,2,2,"ng-container",13)(16,li,2,2,"ng-container",13)(17,pi,2,2,"ng-container",13),e.k0s(),e.j41(18,"div",14)(19,"div",15),e.DNE(20,ci,3,0,"ng-container",13)(21,di,3,0,"ng-container",13),e.k0s(),e.qex(22),e.j41(23,"div",16),e.DNE(24,mi,2,0,"button",17),e.j41(25,"button",18),e.bIt("click",function(){return n.nextStep()}),e.nI1(26,"async"),e.j41(27,"span",19),e.DNE(28,ui,4,2,"ng-container",13),e.nI1(29,"async"),e.DNE(30,gi,3,1,"ng-container",13)(31,fi,3,0,"ng-container",13),e.nI1(32,"async"),e.k0s()()(),e.bVm(),e.k0s()()()()()()()),2&a&&(e.R7$(6),e.SpI(" ",n.newImport$.value.importType?"Import "+n.newImport$.value.importType.charAt(0).toUpperCase()+n.newImport$.value.importType.slice(1):"New Imports",""),e.R7$(5),e.Y8G("ngIf",n.currentStep$.value>1),e.R7$(3),e.Y8G("ngIf",1===n.currentStep$.value),e.R7$(),e.Y8G("ngIf",2===n.currentStep$.value),e.R7$(),e.Y8G("ngIf",3===n.currentStep$.value),e.R7$(),e.Y8G("ngIf",4===n.currentStep$.value&&"accounts"===n.newImport$.value.importType),e.R7$(3),e.Y8G("ngIf",1!==n.currentStep$.value),e.R7$(),e.Y8G("ngIf",1===n.currentStep$.value),e.R7$(3),e.Y8G("ngIf",n.currentStep$.value===n.importFormCount&&n.newImport$.value.isNewSegment),e.R7$(),e.Y8G("disabled",!n.isCurrentFormValid$.value||e.bMT(26,13,n.isLoading$)),e.R7$(3),e.Y8G("ngIf",e.bMT(29,15,n.isLoading$)),e.R7$(2),e.Y8G("ngIf",n.currentStep$.value<n.importFormCount),e.R7$(),e.Y8G("ngIf",n.currentStep$.value===n.importFormCount&&!1===e.bMT(32,17,n.isLoading$)))}
1,dependencies:[p.YU,p.bT,w.Wk,Ke.w,o.qT,o.cb,o.cV,at,dt,ai,se,p.Jj]})}return i})()}]}];let bi=(()=>{class i{static \u0275fac=function(a){return new(a||i)};static \u0275mod=e.$C({type:i});static \u0275inj=e.G2t({imports:[w.iI.forChild(hi),w.iI]})}return i})();var _i=l(71224),vi=l(72242),yi=l(84362);let wi=(()=>{class i{static \u0275fac=function(a){return new(a||i)};static \u0275mod=e.$C({type:i});static \u0275inj=e.G2t({imports:[p.MD,d.ed,bi,b.H,_i.G,h.n8,y.MQ,o.X1,o.YN,vi.r,yi.Dk,h.zH]})}return i})()},97088:(V,D,l)=>{"use strict";l.d(D,{s:()=>M});var p=l(21626),h=l(84412),w=l(7673),e=l(96354),E=l(99437),_=l(70980),f=l(51989),b=l(97586),g=l.n(b),u=l(54438),c=l(71289),x=l(35212),d=l(62523);const o=`${f.c.apiUrl}`;let M=(()=>{class j{http;authService;localStoragePersistService;gettingStartedService;importsData$;isLoading$;importsDataSubject;isLoadingSubject;pageName="importsList";defaultDateRange={projectStartDate:"",endDate:g()().endOf("day").toISOString()};teamId;token;importsListPayload=new h.t({teamId:"",page:1,limit:10,search:"",userId:[],objectType:[],status:[],dateRange:""});get importsListPayloadValue(){return this.importsListPayload.value}updateImportsListPayload(v){this.importsListPayload.next({...this.importsListPayloadValue,...v})}constructor(v,y,F,P){this.http=v,this.authService=y,this.localStoragePersistService=F,this.gettingStartedService=P,this.authService.currentUser$.subscribe(()=>{const N=this.authService.getAuthFromLocalStorage();this.token=N?.token,this.teamId=this.extractTeamId(N?.userDetails?.clientAccounts[0]?.teams[0]?.teamId),this.defaultDateRange.projectStartDate=this.localStoragePersistService.getProjectStartDateFromLocalStorage(),this.updateImportsListPayload({teamId:this.teamId}),this.importsListPayloadInit()}
1),this.importsDataSubject=new h.t(void 0),this.importsData$=this.importsDataSubject.asObservable(),this.isLoadingSubject=new h.t(!1),this.isLoading$=this.isLoadingSubject.asObservable()}extractTeamId(v){return"string"==typeof v?v:v._id}importsListPayloadInit(){const v=this.localStoragePersistService.getPersistedData();this.updateImportsListPayload(v&&v[this.pageName]?{...v[this.pageName].filters}:{dateRange:""})}getImportList(){if(this.localStoragePersistService.setPageData(this.pageName,{columns:[],filters:this.importsListPayloadValue}),!this.teamId||!this.token)return(0,w.of)(void 0);const v=new p.Lr({Authorization:`Bearer ${this.token}`}),y={...this.importsListPayloadValue,user:this.importsListPayloadValue.userId};return y.status||delete y.status,delete y.appliedFiltersCount,delete y.userId,this.isLoadingSubject.next(!0),this.http.get(`${o}/imports`,{headers:v,params:y}).pipe((0,e.T)(F=>(F&&this.importsDataSubject.next(F.data.data),F)),(0,E.W)(F=>(console.error("err",F),(0,w.of)(void 0))),(0,_.j)(()=>this.isLoadingSubject.next(!1)))}createImport(v,y){if(this.isLoadingSubject.next(!0),!this.token||!this.teamId)return(0,w.of)(void 0);v.teamId=this.teamId;const F=new p.Lr({Authorization:`Bearer ${this.token}`}),P=new FormData;P.append("file",y);for(const L in v)Object.prototype.hasOwnProperty.call(v,L)&&P.append(L,v[L]);return this.http.post(`${o}/imports`,P,{headers:F}).pipe((0,e.T)(L=>(console.log("API Response:",L.data),L&&L.data&&this.gettingStartedService.updateGettingStartedKeyValue("uploadAccount","completed"),L)),(0,E.W)(L=>(0,w.of)(void 0)),(0,_.j)(()=>this.isLoadingSubject.next(!1)))}getCustomFields(){if(!this.token||!this.teamId)return(0,w.of)(void 0);const v=new p.Lr({Authorization:`Bearer ${this.token}`});return this.http.get(`${o}/custom-fields`,{headers:v,params:{teamId:this.teamId,objectType:"accounts"}})}getUsers(){if(!this.token||!this.teamId)return(0,w.of)(void 0);const v=new p.Lr({Authorization:`Bearer ${this.token}`});return this.http.get(`${o}/app-users`,{headers:v,params:{teamId:this.teamId}})}validateFieldMapping({columnValue:v,mappedField:y,importType:F}){if(!this.token||!this.teamId)return(0,w.of)(void 0);let P={teamId:this.teamId,columnValue:v,mappedField:y,importType:F};const N=new p.Lr({Authorization:`Bearer ${this.token}`});return this.http.get(`${o}/custom-fields/validate-property-mapping`,{headers:N,params:P})}getProjectStartDateFromLocalStorage(){const v=localStorage.getItem("teamCreatedAt");if(console.log("Retrieved projectStartDate from localStorage:",v),v){const y=g()(v,g().ISO_8601,!0);if(y.isValid())return console.log("Parsed projectStartDate:",y.startOf("day").toISOString()),y.startOf("day").toISOString();console.error("Invalid Date format for projectStartDate:",v)}else console.error("projectStartDate is null or undefined");return g()("02-05-2022","DD-MM-YYYY").startOf("day").toISOString()}static \u0275fac=function(y){return new(y||j)(u.KVO(p.Qq),u.KVO(c.uR),u.KVO(x.m),u.KVO(d.r))};static \u0275prov=u.jDH({token:j,factory:j.\u0275fac,providedIn:"root"})}return j})()},87119:(V,D,l)=>{"use strict";l.d(D,{d:()=>u});var p=l(21626),h=l(7673),w=l(96354),e=l(99437),E=l(51989),_=l(21846),f=l(54438),b=l(71289);const g=`${E.c.apiUrl}`;let u=(()=>{class c{http;authService;token;constructor(d,o){this.http=d,this.authService=o}getSegmentById(d){const o=this.authService.getAuthFromLocalStorage();if(!o?.token)return(0,h.of)(null);const M=new p.Lr({Authorization:`Bearer ${o.token}`});return this.http.get(`${g}/segments/getSegment/${d}`,{headers:M}).pipe((0,w.T)(j=>j?.data??null),(0,e.W)(()=>(0,h.of)(null)))}getSegementList(d){console.log("entered service..........................");const o=this.authService.getAuthFromLocalStorage();if(!o||!o.token)return(0,h.of)(void 0);this.token=o.token;const M=o?.userDetails?.clientAccounts[0]?.teams[0]?.teamId?._id;if(M){const I=d.start/d.length+1;d.teamId=M,d.page=I,d.limit=d.length}const j=new p.Lr({Authorization:`Bearer ${this.token}`});return this.http.get(`${g}/segments`,{headers:j,params:d}).pipe((0,w.T)(I=>I?.data?.data&&Array.isArray(I.data.data)?{...I,data:{...I.data,data:(0,_.g)(I.data.data,"name")}}:I))}static \u0275fac=function(o){return new(o||c)(f.KVO(p.Qq),f.KVO(b.uR))};static \u0275prov=f.jDH({token:c,factory:c.\u0275fac,providedIn:"root"})}return c})()},21846:(V,D,l)=>{"use strict";function p(w,e="name"){return w?.length?[...w].sort((E,_)=>{const f=String(E?.[e]??"").trim(),b=String(_?.[e]??"").trim();return f.localeCompare(b,void 0,{sensitivity:"base"})}):w??[]}function h(w){return!!w&&w.includes("/segments")}l.d(D,{Y:()=>h,g:()=>p})},40668:(V,D,l)=>{"use strict";l.d(D,{_:()=>w,H:()=>E}
1);var p=l(54438),w=function(){function _(f,b,g){this.el=f,this.vcr=b,this.renderer=g,this.dtOptions={}}return _.prototype.ngOnInit=function(){var f=this;this.dtTrigger?this.dtTrigger.subscribe(function(b){f.displayTable(b)}):this.displayTable(null)},_.prototype.ngOnDestroy=function(){this.dtTrigger&&this.dtTrigger.unsubscribe(),this.dt&&this.dt.destroy(!0)},_.prototype.displayTable=function(f){var b=this;f&&(this.dtOptions=f),this.dtInstance=new Promise(function(g,u){Promise.resolve(b.dtOptions).then(function(c){0===Object.keys(c).length&&0===$("tbody tr",b.el.nativeElement).length?u("Both the table and dtOptions cannot be empty"):(c.columns&&c.columns.forEach(function(d){var o;""===(null!==(o=d.id)&&void 0!==o?o:"").trim()&&(d.id=b.getColumnUniqueId())}),setTimeout(function(){var d={rowCallback:function(o,M,j){if(c.columns){var I=c.columns;b.applyNgPipeTransform(o,I),b.applyNgRefTemplate(o,I,M)}c.rowCallback&&c.rowCallback(o,M,j)}};d=Object.assign({},c,d),b.dt=$(b.el.nativeElement).DataTable(d),g(b.dt)}))})})},_.prototype.applyNgPipeTransform=function(f,b){b.filter(function(u){return u.ngPipeInstance&&!u.ngTemplateRef}).forEach(function(u){var c=u.ngPipeInstance,x=u.ngPipeArgs||[],d=b.filter(function(I){return!1!==I.visible}).findIndex(function(I){return I.id===u.id}),o=f.childNodes.item(d),M=$(o).text(),j=c.transform.apply(c,function(_,f,b){if(b||2===arguments.length)for(var c,g=0,u=f.length;g<u;g++)(c||!(g in f))&&(c||(c=Array.prototype.slice.call(f,0,g)),c[g]=f[g]);return _.concat(c||Array.prototype.slice.call(f))}([M],x,!1));$(o).text(j)})},_.prototype.applyNgRefTemplate=function(f,b,g){var u=this;b.filter(function(x){return x.ngTemplateRef&&!x.ngPipeInstance}).forEach(function(x){var d=x.ngTemplateRef,o=d.ref,M=d.context,j=b.filter(function(F){return!1!==F.visible}).findIndex(function(F){return F.id===x.id}),I=f.childNodes.item(j);$(I).html("");var v=Object.assign({},M,M?.userData,{adtData:g}),y=u.vcr.createEmbeddedView(o,v);u.renderer.appendChild(I,y.rootNodes[0])})},_.prototype.getColumnUniqueId=function(){for(var f="",g=0;g<6;g++){var u=Math.floor(62*Math.random());f+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(u)}return f.trim()},_.\u0275fac=function(b){return new(b||_)(p.rXU(p.aKT),p.rXU(p.c1b),p.rXU(p.sFG))},_.\u0275dir=p.FsC({type:_,selectors:[["","datatable",""]],inputs:{dtOptions:"dtOptions",dtTrigger:"dtTrigger"}}),_}(),e=l(60177),E=function(){function _(){}return _.forRoot=function(){return{ngModule:_}},_.\u0275fac=function(b){return new(b||_)},_.\u0275mod=p.$C({type:_}),_.\u0275inj=p.G2t({imports:[e.MD]}),_}()},2578:function(V,D){var l,h;void 0!==(h="function"==typeof(l=function(){"use strict";function e(u,c,x){var d=new XMLHttpRequest;d.open("GET",u),d.responseType="blob",d.onload=function(){g(d.response,c,x)},d.onerror=function(){console.error("could not download file")},d.send()}function E(u){var c=new XMLHttpRequest;c.open("HEAD",u,!1);try{c.send()}catch{}return 200<=c.status&&299>=c.status}function _(u){try{u.dispatchEvent(new MouseEvent("click"))}catch{var c=document.createEvent("MouseEvents");
1c.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),u.dispatchEvent(c)}}var f="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:void 0,b=f.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),g=f.saveAs||("object"!=typeof window||window!==f?function(){}:"download"in HTMLAnchorElement.prototype&&!b?function(u,c,x){var d=f.URL||f.webkitURL,o=document.createElement("a");o.download=c=c||u.name||"download",o.rel="noopener","string"==typeof u?(o.href=u,o.origin===location.origin?_(o):E(o.href)?e(u,c,x):_(o,o.target="_blank")):(o.href=d.createObjectURL(u),setTimeout(function(){d.revokeObjectURL(o.href)},4e4),setTimeout(function(){_(o)},0))}:"msSaveOrOpenBlob"in navigator?function(u,c,x){if(c=c||u.name||"download","string"!=typeof u)navigator.msSaveOrOpenBlob(function w(u,c){return typeof c>"u"?c={autoBom:!1}:"object"!=typeof c&&(console.warn("Deprecated: Expected third argument to be a object"),c={autoBom:!c}),c.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(u.type)?new Blob(["\ufeff",u],{type:u.type}):u}(u,x),c);else if(E(u))e(u,c,x);else{var d=document.createElement("a");d.href=u,d.target="_blank",setTimeout(function(){_(d)})}}:function(u,c,x,d){if((d=d||open("","_blank"))&&(d.document.title=d.document.body.innerText="downloading..."),"string"==typeof u)return e(u,c,x);var o="application/octet-stream"===u.type,M=/constructor/i.test(f.HTMLElement)||f.safari,j=/CriOS\/[\d]+/.test(navigator.userAgent);if((j||o&&M||b)&&typeof FileReader<"u"){var I=new FileReader;I.onloadend=function(){var F=I.result;F=j?F:F.replace(/^data:[^;]*;/,"data:attachment/file;"),d?d.location.href=F:location=F,d=null},I.readAsDataURL(u)}else{var v=f.URL||f.webkitURL,y=v.createObjectURL(u);d?d.location=y:location.href=y,d=null,setTimeout(function(){v.revokeObjectURL(y)},4e4)}});f.saveAs=g.saveAs=g,V.exports=g})?l.apply(D,[]):l)&&(V.exports=h)}}]);
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.