PageSourceSearch

https://app.chatbotxl.com/450.d51a7bf9e262a480.js

js chatbotxl.com collected 2026-09-24 13:46:57 UTC 129,455 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkbotpenguin=self.webpackChunkbotpenguin||[]).push([[450],{72450:(Qt,P,p)=>{p.r(P),p.d(P,{WhitelabelModule:()=>qt});var g=p(60177),m=p(51188),v=p(10467),h=p(67376),O=p(36883),t=p(54438),x=p(83454),u=p(59982),_=p(95684),b=p(42578),M=p(78262),d=p(89417),C=p(82765),f=p(13620);const F=["closeButton"],y=a=>({"drop-down-arrow-active":a}),R=a=>({"add-customer-btn-valid":a});function j(a,r){if(1&a){const e=t.RV6();t.j41(0,"div",53)(1,"div",54),t.bIt("click",function(){t.eBV(e);const n=t.XpG(2);return n.planSnapshot.name="baby",t.Njj(n.planDropDown=!1)}),t.j41(2,"span"),t.EFF(3),t.k0s()(),t.j41(4,"div",54),t.bIt("click",function(){t.eBV(e);const n=t.XpG(2);return n.planSnapshot.name="king",t.Njj(n.planDropDown=!1)}),t.j41(5,"span"),t.EFF(6),t.k0s()()()}if(2&a){const e=t.XpG(2);t.R7$(3),t.JRh(e.staticText.baby),t.R7$(3),t.JRh(e.staticText.king)}}function E(a,r){if(1&a){const e=t.RV6();t.j41(0,"div")(1,"mat-checkbox",56),t.bIt("change",function(){const n=t.eBV(e).$implicit,o=t.XpG(3);return t.Njj(o.changeCurrency(n))}),t.EFF(2),t.k0s()()}if(2&a){const e=r.$implicit,i=t.XpG(3);t.R7$(),t.Y8G("checked",i.selectedCurrencies.includes(e)),t.R7$(),t.JRh(e)}}function D(a,r){if(1&a){const e=t.RV6();t.j41(0,"div",55),t.bIt("click",function(n){return t.eBV(e),t.Njj(n.stopPropagation())}),t.j41(1,"div",53),t.DNE(2,E,3,2,"div",14),t.k0s()()}if(2&a){const e=t.XpG(2);t.R7$(2),t.Y8G("ngForOf",e.availableCurrencies)}}function I(a,r){if(1&a){const e=t.RV6();t.qex(0),t.j41(1,"div",57)(2,"div",36)(3,"label",37),t.EFF(4),t.k0s(),t.j41(5,"input",58),t.mxI("ngModelChange",function(n){const o=t.eBV(e).$implicit;return t.DH7(o.price,n)||(o.price=n),t.Njj(n)}),t.bIt("keypress",function(n){t.eBV(e);const o=t.XpG(2);return t.Njj(o.validateNumber(n))}),t.k0s()(),t.j41(6,"div",36)(7,"label",37),t.EFF(8),t.k0s(),t.nrm(9,"input",59),t.k0s()(),t.bVm()}if(2&a){const e=r.$implicit,i=t.XpG(2);t.R7$(4),t.Lme("",e.currency,"",i.staticText.perMonth,""),t.R7$(),t.R50("ngModel",e.price),t.R7$(3),t.Lme("",e.currency,"",i.staticText.perYear,""),t.R7$(),t.FS9("value",10*e.price)}}function G(a,r){if(1&a){const e=t.RV6();t.j41(0,"div",24)(1,"div",25)(2,"div",26)(3,"div",27)(4,"label",28),t.EFF(5),t.j41(6,"span",29),t.EFF(7,"*"),t.k0s(),t.nrm(8,"app-tooltip",30),t.k0s(),t.j41(9,"div",31)(10,"button",32),t.bIt("click",function(n){t.eBV(e);const o=t.XpG();return o.planDropDown=!o.planDropDown,t.Njj(n.stopPropagation())}),t.EFF(11),t.k0s(),t.nrm(12,"img",33),t.k0s(),t.j41(13,"div",34),t.DNE(14,j,7,2,"div",35),t.k0s()(),t.j41(15,"div",36)(16,"label",37),t.EFF(17),t.j41(18,"span",29),t.EFF(19,"*"),t.k0s(),t.nrm(20,"app-tooltip",38),t.k0s(),t.j41(21,"input",39),t.mxI("ngModelChange",function(n){t.eBV(e);const o=t.XpG();return t.DH7(o.planSnapshot.messagesLimit,n)||(o.planSnapshot.messagesLimit=n),t.Njj(n)}),t.bIt("keypress",function(n){t.eBV(e);const o=t.XpG();return t.Njj(o.validateNumber(n))}),t.k0s(),t.nrm(22,"img",40)(23,"img",41),t.j41(24,"div",42),t.EFF(25),t.k0s()(),t.j41(26,"div",36)(27,"label",37),t.EFF(28),t.nrm(29,"app-tooltip",38),t.k0s(),t.j41(30,"input",43),t.mxI("ngModelChange",function(n){t.eBV(e);const o=t.XpG();return t.DH7(o.planSnapshot.displayName,n)||(o.planSnapshot.displayName=n),t.Njj(n)}),t.k0s(),t.nrm(31,"img",40)(32,"img",41),t.k0s(),t.j41(33,"div",44)(34,"label",28),t.EFF(35),t.j41(36,"span",29),t.EFF(37,"*"),t.k0s(),t.nrm(38,"app-tooltip",30),t.k0s(),t.j41(39,"div",45),t.bIt("click",function(n){t.eBV(e);const o=t.XpG();return o.showDropDown=!o.showDropDown,n.stopPropagation(),t.Njj(n.preventDefault())}),t.j41(40,"button",46),t.EFF(41),t.k0s(),t.nrm(42,"img",47),t.k0s(),t.j41(43,"div",34),t.DNE(44,D,3,1,"div",48),t.k0s()()(),t.DNE(45,I,10,6,"ng-container",14),t.k0s(),t.j41(46,"div",49)(47,"div",50)(48,"button",51),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.showPlanForm=!1)}),t.EFF(49),t.k0s(),t.j41(50,"button",52),t.bIt("change",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.validPlan())})("click",function(){t.eBV(e);const n=t.XpG();return t.Njj("edit"===n.planSnapshot.mode?n.saveExistingPlan():n.addNewPlan())}),t.EFF(51),t.k0s()()()()}if(2&a){const e=t.XpG();t.R7$(5),t.SpI(" ",e.staticText.choosePlan,""),t.R7$(3),t.Y8G("message",e.staticText.appTooltip.chooseYourPlanType),t.R7$(2),t.Y8G("disabled","edit"===e.planSnapshot.mode),t.R7$(),t.SpI(" ","baby"===e.planSnapshot.name?e.staticText.baby:"king"===e.planSnapshot.name?e.staticText.king:e.staticText.selectPlan," "),t.R7$(),t.Y8G("ngClass",t.eq3(24,y,e.planDropDown)),t.R7$(2),t.Y8G("ngIf",e.planDropDown),t.R7$(3),t.JRh(e.staticText.messageLimit),t.R7$(3),t.Y8G("message",e.staticText.appTooltip.typeMe
1ssageLimitForCustomer),t.R7$(),t.R50("ngModel",e.planSnapshot.messagesLimit),t.Y8G("placeholder",e.staticText.placeholders.enterMessageLimit),t.R7$(4),t.JRh(e.staticText.enterAValidMessageLimit),t.R7$(3),t.SpI("",e.staticText.displayName," "),t.R7$(),t.Y8G("message",e.staticText.appTooltip.pleaseInputYourPlanDisplayName),t.R7$(),t.R50("ngModel",e.planSnapshot.displayName),t.Y8G("placeholder",e.staticText.placeholders.enterDisplayName),t.R7$(5),t.SpI(" ",e.staticText.setCurrency,""),t.R7$(3),t.Y8G("message",e.staticText.appTooltip.selectYourPreferredCurrencies),t.R7$(3),t.SpI(" ",e.staticText.select," "),t.R7$(),t.Y8G("ngClass",t.eq3(26,y,e.showDropDown)),t.R7$(2),t.Y8G("ngIf",e.showDropDown),t.R7$(),t.Y8G("ngForOf",e.inputplanSnapshot),t.R7$(4),t.JRh(e.staticText.cancel),t.R7$(),t.Y8G("ngClass",t.eq3(28,R,e.validPlan())),t.R7$(),t.JRh("edit"===e.planSnapshot.mode?e.staticText.upgradePlan:e.staticText.addPlan)}}function N(a,r){if(1&a){const e=t.RV6();t.j41(0,"div",60)(1,"button",61),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return n.showPlanForm=!0,t.Njj(n.setSnapShot())}),t.EFF(2),t.k0s()()}if(2&a){const e=t.XpG();t.R7$(2),t.SpI("+ \xa0\xa0\xa0",e.staticText.addPlan,"")}}function A(a,r){if(1&a){const e=t.RV6();t.qex(0),t.j41(1,"tr")(2,"td"),t.EFF(3),t.k0s(),t.j41(4,"td")(5,"span",62),t.EFF(6),t.k0s()(),t.j41(7,"td"),t.EFF(8),t.k0s(),t.j41(9,"td"),t.EFF(10),t.k0s(),t.j41(11,"td")(12,"span",63),t.bIt("click",function(){const n=t.eBV(e).index,o=t.XpG();return t.Njj(o.selectedIndex=n)}),t.EFF(13," description "),t.k0s()(),t.j41(14,"td",64)(15,"div")(16,"span",65),t.bIt("click",function(){const n=t.eBV(e).$implicit,o=t.XpG();return o.editExistingPlan(n),o.showPlanForm=!0,t.Njj("edit"===o.planSnapshot.mode)}),t.EFF(17," edit "),t.k0s(),t.j41(18,"span",66),t.bIt("click",function(){const n=t.eBV(e).$implicit,o=t.XpG();return o.planData=n,t.Njj(o.initiateDelete())}),t.EFF(19," delete "),t.k0s()()()(),t.bVm()}if(2&a){const e=r.$implicit,i=r.index;t.R7$(3),t.JRh(i+1),t.R7$(3),t.JRh(e.name),t.R7$(2),t.JRh(e.messagesLimit),t.R7$(2),t.JRh(e.displayName)}}function L(a,r){if(1&a&&(t.j41(0,"div")(1,"div",67),t.EFF(2),t.k0s(),t.j41(3,"div",68)(4,"div",69)(5,"label"),t.EFF(6),t.k0s(),t.nrm(7,"input",70),t.k0s(),t.j41(8,"div",71)(9,"label"),t.EFF(10),t.k0s(),t.nrm(11,"input",70),t.k0s()()()),2&a){const e=r.$implicit,i=t.XpG();t.R7$(2),t.JRh(e.currency),t.R7$(4),t.JRh(i.staticText.perMonthText),t.R7$(),t.Y8G("value",e.price),t.R7$(3),t.JRh(i.staticText.perYearText),t.R7$(),t.FS9("value",10*e.price)}}let V=(()=>{class a{onClick(e){this.showDropDown=!1}constructor(e,i,n){this.plansService=e,this.sharedService=i,this.languageService=n,this.price=100,this.groupedPlanList=[],this.showPlanForm=!1,this.showDropDown=!1,this.planDropDown=!1,this.selectedCurrencies=[],this.openDeleteModal=!1,this.availableCurrencies=[],this.allPlanOptions=[],this.priceByyear="",this.staticText=n.getStaticText().whitelabel.planManagement,this.closePopups$=this.sharedService.closePopups.subscribe(()=>{this.planDropDown=!1})}ngOnInit(){this.setSnapShot(),this.getPlans(),this.getCurrencies()}ngOnDestroy(){this.closePopups$?.unsubscribe()}getCurrencies(){fetch("/assets/currency.json").then(e=>e.json()).then(e=>{this.availableCurrencies=Object.keys(e)}).catch(console.log)}setSnapShot(e={mode:"add",name:"king",messagesLimit:2e3,liveAgentLimit:3,pricingOptions:[]}){this.planSnapshot=e,this.planSnapshot.pricingOptions=[{currency:localStorage.getItem("original-default-currency")||"USD",price:100,messagesLimit:e.messagesLimit,liveAgentLimit:e.liveAgentLimit}],this.inputplanSnapshot=this.planSnapshot.pricingOptions,this.selectedCurrencies=[localStorage.getItem("original-default-currency")||"USD"]}changeCurrency(e){let i=!1;this.selectedCurrencies.includes(e)?(this.selectedCurrencies=this.selectedCurrencies.filter(n=>n!==e),i=!1):(this.selectedCurrencies.push(e),i=!0),i?this.inputplanSnapshot.push({currency:e,price:100,messagesLimit:this.planSnapshot.messagesLimit,liveAgentLimit:this.planSnapshot.liveAgentLimit}):this.inputplanSnapshot=this.inputplanSnapshot.filter(n=>n.currency!==e)}getPlans(){var e=this;return(0,v.A)(function*(){e.allPlanOptions=[],e.sharedService.loader("start");try{const i=yield e.plansService.getPlansForAgency();e.groupedPlanList=JSON.parse(JSON.stringify(i.map(o=>({...o,uuid:(0,O.A)()}))));for(const o of e.groupedPlanList)o.pricingOptions&&o.pricingOptions.length>0&&"baby"!==o.name&&e.allPlanOptions.push(...o.pricingOptions.map(s=>({...s,messagesLimit:o.messagesLimit,name:o.name})));let n=1/0;for(const o of i)"king"===o.name&&o.messagesLimit<n&&(n=o.messagesLimit,e.kingPlanWithMinMessagesLimit=o.messagesLimit)}catch{e.sharedService.showToast("error","","Could not get Plans, Please try again later")}
1finally{e.sharedService.loader("stop")}})()}addNewPlan(){if(!this.validPlanFormData())return;const{name:e,messagesLimit:i,displayName:n}=this.planSnapshot;this.planSnapshot.pricingOptions=this.inputplanSnapshot.map(c=>({...c,messagesLimit:i,liveAgentLimit:"baby"===e?1:3,price:"baby"===e?0:Number(c.price)}));const o=[];for(const c of this.groupedPlanList)c.name===this.planSnapshot.name&&o.push(...c.pricingOptions.map(l=>({...l,messagesLimit:c.messagesLimit})));const s={name:e,displayName:(n||"").trim(),status:"ACTIVE",pricingOptions:[...this.planSnapshot.pricingOptions||[],...o]};this.sharedService.loader("start"),this.plansService.updateAgencyPlan(s).then(c=>(this.showPlanForm=!1,this.getPlans(),this.setSnapShot(),this.sharedService.showToast("success","","Plan Created Successfully"))).catch(c=>{this.sharedService.showToast("error","",c||c.message||"Please check all details, and try again.")}).finally(()=>this.sharedService.loader("stop"))}selectedSnapShot(e){"edit"!==this.planSnapshot.mode?(this.planSnapshot.pricingOptions=[{currency:localStorage.getItem("original-default-currency")||"USD",price:100,messagesLimit:2e3,liveAgentLimit:"baby"===this.planSnapshot.name?1:3}],this.inputplanSnapshot=JSON.parse(JSON.stringify(this.planSnapshot.pricingOptions))):this.inputplanSnapshot=JSON.parse(JSON.stringify(e.pricingOptions))}editExistingPlan(e){this.selectedCurrencies=[],e.pricingOptions.map(i=>{this.selectedCurrencies.push(i.currency)}),this.planSnapshot={mode:"edit",name:e.name,displayName:e?.displayName||"",liveAgentLimit:e.liveAgentLimit,pricingOptions:e.pricingOptions,messagesLimit:e.messagesLimit,uuid:e.uuid},this.selectedSnapShot(e),this.showPlanForm=!0,this.planSnapshot.mode="edit",h.sortedUniq(this.selectedCurrencies)}saveExistingPlan(){if(this.planSnapshot.pricingOptions=this.inputplanSnapshot.map(n=>({...n,messagesLimit:this.planSnapshot.messagesLimit,liveAgentLimit:"baby"===this.planSnapshot.name?1:3,price:"baby"===this.planSnapshot.name?0:Number(n.price)})),!this.validPlanFormData(this.planSnapshot.uuid))return;const e=[];for(const n of this.groupedPlanList)n.name===this.planSnapshot.name&&n.uuid!==this.planSnapshot.uuid&&e.push(...n.pricingOptions.map(o=>({...o,messagesLimit:n.messagesLimit})));const i={name:this.planSnapshot.name,displayName:(this.planSnapshot?.displayName||"").trim(),status:"ACTIVE",pricingOptions:[...e,...this.planSnapshot.pricingOptions||[]]};this.sharedService.loader("start"),this.plansService.updateAgencyPlan(i).then(n=>{this.sharedService.showToast("success","","Plan Updated Successfully"),this.getPlans(),this.showPlanForm=!1,this.setSnapShot()}).catch(n=>{this.sharedService.showToast("error","",n)}).finally(()=>this.sharedService.loader("stop"))}initiateDelete(){this.deleteDescription="baby"===this.planData.name?this.staticText.modal.wantToDeleteThisBabyPlan:this.staticText.modal.wantToDeleteThisPlan,this.openDeleteModal=!0}deletePlan(e){if(this.openDeleteModal=!1,e){if(this.groupedPlanList.filter(s=>s.name===this.planData.name).length<=1&&"king"===this.planData.name)return this.sharedService.showToast("error","",`Atleast 1 ${this.planData.name} plan Should Be There`);const n=[];for(const s of this.groupedPlanList)s.name===this.planData.name&&s.uuid!==this.planData.uuid&&n.push(...s.pricingOptions.map(c=>({...c,messagesLimit:s.messagesLimit})));const o={name:this.planData.name,displayName:this.planData?.displayName||"",status:"ACTIVE",pricingOptions:n};this.sharedService.loader("start"),this.plansService.updateAgencyPlan(o).then(s=>{this.sharedService.showToast("success","","Plan Deleted Successfully"),this.getPlans()}).catch(s=>{this.sharedService.showToast("error","",s?.message||"Could not Delete Plan, Please Try Again Later")}).finally(()=>this.sharedService.loader("stop"))}}search(e){const i=e.target.value.toLowerCase();$("table tbody tr").filter(function(){$(this).toggle($(this).text().toLowerCase().indexOf(i)>-1)})}validPlan(){return this.planSnapshot.name&&this.planSnapshot.messagesLimit&&this.planSnapshot.pricingOptions}validPlanFormData(e=""){const{name:i,messagesLimit:n,pricingOptions:o}=this.planSnapshot,s=(this.groupedPlanList||[]).find(l=>"baby"===l.name&&l.uuid!==e),c=(this.groupedPlanList||[]).find(l=>l.messagesLimit===n&&l.uuid!==e);return o&&o.length?"baby"===i&&s?(this.sharedService.showToast("error","","Only 1 baby plan can be added"),!1):"baby"===i&&o.some(l=>l.price&&0!==Number(l.price))?(this.sharedService.showToast("warning","","Baby plan must have 0 price"),!1):"king"===i&&o.some(l=>!l.price||0===Number(l.price))?(this.sharedService.showToast("warning","","King plan must not have 0 price"),!1):n&&0!==Number(n)?s&&"king"===i&&n<=s?.messagesLimit?(this.sharedService.showToast("warning","","Message Limit must be greater than baby plan"),!1):c?(this.sharedService.showToast("error","",`Plan with ${n} messages already exists`),!1):!("baby"===this.planSnapshot.name&&(this.planSnapshot.messagesLimit||0)>=this.kingPlanWithMinMessagesLimit&&(this.sharedService.showToast("warning","","Message limit must be lesser than smallest king plan"),1)):(this.sharedService.showToast("warning","","Message limit can't be empty"),!1):(this.sharedService.showToast("warning","","Atleast add one currency."),!1)}validateNumber(e){const i=e.which?e.which:e.keyCode;return!(i>31&&(i<48||i>57))}static#t=this.\u0275fac=function(i){return new(i||a)(t.rXU(x.U),t.rXU(u.d),t.rXU(_.g))};static#e=this.\u0275cmp=t.VBU({type:a,selectors:[["app-plan-management"]],viewQuery:function(i,n){if(1&i&&t.GBs(F,5),2&i){let o;t.mGM(o=t.lsd())&&(n.closeButton=o.first)}},hostBindings:function(i,n){1&i&&t.bIt("click",function(s){return n.onClick(s)},!1,t.EBC)}
1,decls:44,vars:19,consts:[[3,"userInput","title","description","showModal"],[1,"mt-4"],[1,"sub-heading","text-align-start"],["class","create-customer position-relative",4,"ngIf"],[1,"row","mt-4","mb-4","d-flex","justify-content-between"],[1,"col-6","col-sm-5","col-lg-4","p-start-0","mb-2","mb-sm-0","search-box"],["type","text",1,"bp-input-box","position-relative",3,"keyup","placeholder"],[1,"material-icons"],["appAcl","","permission","agency-plans.write","class","col-auto m-start-auto",4,"ngIf"],[1,"table-div","mt-2","tableFixHead"],["id","customer",1,"table","text-align-start"],[1,"bp-table-row"],["scope","col",1,"col-2"],["appAcl","","permission","agency-plans.write||agency-plans.remove","scope","col",1,"col-3"],[4,"ngFor","ngForOf"],["id","openWhatsAppPricingModal","tabindex","-1","role","dialog","aria-hidden","true",1,"modal","fade"],["role","document",1,"modal-dialog","modal-dialog-centered",2,"min-width","750px","border-radius","10px"],[1,"modal-content"],[1,"modal-header","justify-content-between","mb-2"],["id","exampleModalLongTitle",1,"modal-title"],["type","button","aria-label","Close","data-bs-dismiss","modal",1,"close","border-0","bg-transparent","p-0"],["aria-hidden","true"],["width","40","src","assets/version2/icons/closebutton.svg"],[1,"modal-body"],[1,"create-customer","position-relative"],[1,"col-12","col-md-10"],[1,"row"],[1,"col-12","col-sm-6","col-lg-4","position-relative","mb-3"],["for","monthlyMessages",1,"input-box-label"],[1,"required"],[1,"position-absolute","mt-1",3,"message"],[1,"bp-input-box","position-relative","p-0"],[1,"selected-option-box",3,"click","disabled"],["src","/assets/version2/images/sidebar/arrow_drop_down_black.svg","alt","",1,"drop-down-arrow",3,"ngClass"],[1,"position-relative"],["class","select-box-dropdown",4,"ngIf"],[1,"position-relative","col-12","col-sm-6","col-lg-4"],["for","name",1,"label-text"],[1,"position-absolute",3,"message"],["required","","name","bp-email","name","bp-email","type","text",1,"bp-input-box",3,"ngModelChange","keypress","ngModel","placeholder"],["src","/assets/version2/icons/valid_input_icon.svg","alt","",1,"error-message","position-absolute"],["src","/assets/version2/icons/error_input_icon.svg","alt","",1,"error-message","position-absolute"],[1,"error-text"],["required","","name","bp-email","type","text",1,"bp-input-box",3,"ngModelChange","ngModel","placeholder"],[1,"col-12","col-sm-6","col-lg-4","position-relative"],[1,"bp-input-box","position-relative","p-0",3,"click"],[1,"selected-option-box"],["src","/assets/version2/images/sidebar/arrow_drop_down_black.svg","alt","",1,"drop-down-arrow","cursor-pointer",3,"ngClass"],[3,"click",4,"ngIf"],[1,"add-customer-div"],[1,"add-btn","d-flex"],[1,"bp-disable-btn","m-end-3",3,"click"],[1,"add-customer-btn",3,"change","click","ngClass"],[1,"select-box-dropdown"],[1,"options-box",3,"click"],[3,"click"],[1,"currency-checkbox",3,"change","checked"],[1,"row","mt-3"],["name","price","type","text","required","",1,"bp-input-box",3,"ngModelChange","keypress","ngModel"],["name","price","type","number","disabled","",1,"bp-input-box","disabled",2,"background-color","#DFE1E4","cursor","not-allowed",3,"value"],["appAcl","","permission","agency-plans.write",1,"col-auto","m-start-auto"],[1,"bp-primary-btn","add-member-button",3,"click"],[1,"text-capitalize"],["data-bs-toggle","modal","data-bs-target","#openWhatsAppPricingModal",1,"material-icons","pricing-icon-box",3,"click"],["appAcl","","permission","agency-plans.write||agency-plans.remove",1,"table-style","td-actions-container"],["appAcl","","permission","agency-plans.write",1,"material-icons","edit-member-btn",3,"click"],["appAcl","","permission","agency-plans.remove",1,"material-icons","delete-member-btn",3,"click"],[1,"mb-2","currency-title"],[1,"d-flex","justify-content-between","inputs-container"],[1,"mb-3"],["readonly","","disabled","","type","text",1,"bp-input-box",3,"value"],[1,"m-start-0"]],template:function(i,n){1&i&&(t.j41(0,"app-modal",0),t.bIt("userInput",function(s){return n.deletePlan(s)}),t.k0s(),t.j41(1,"div")(2,"section",1)(3,"h2"),t.EFF(4),t.k0s(),t.j41(5,"p",2),t.EFF(6),t.k0s(),t.DNE(7,G,52,30,"div",3),t.k0s(),t.j41(8,"div",4)(9,"div",5)(10,"input",6),t.bIt("keyup",function(s){return n.search(s)}),t.k0s(),t.j41(11,"span",7),t.EFF(12," search "),t.k0s()(),t.DNE(13,N,3,1,"div",8),t.k0s(),t.j41(14,"div",9)(15,"table",10)(16,"thead")(17,"tr",11)(18,"th",12),t.EFF(19),t.k0s(),t.j41(20,"th",12),t.EFF(21),t.k0s(),t.j41(22,"th",12),t.EFF(23),t.k0s(),t.j41(24,"th",12),t.EFF(25),t.k0s(),t.j41(26,"th",12),t.EFF(27),t.k0s(),t.j41(28,"th",13),t.EFF(29),t.k0s()()(),t.j41(30,"tbody"),t.DNE(31,A,20,4,"ng-container",14),t.k0s()()()(),t.j41(32,"div",15)(33,"div",16)(34,"div",17)(35,"div",18)(36,"h5",19),t.EFF(37),t.nI1(38,"titlecase"),t.k0s(),t.j41(39,"button",20)(40,"span",21),t.nrm(41,"img",22),t.k0s()()(),t.j41(42,"div",23),t.DNE(43,L,12,5,"div",14),t.k0s()()()()),2&i&&(t.FS9("description",n.deleteDescription),t.Y8G("title",n.staticText.modal.deletePlan)("showModal",n.openDeleteModal),t.R7$(4),t.JRh(n.staticText.createNewPlans),t.R7$(2),t.JRh(n.staticText.checkoutYourCurrentPlan),t.R7$(),t.Y8G("ngIf",n.showPlanForm),t.R7$(3),t.Y8G("placeholder",n.staticText.placeholders.searchByPlanName),t.R7$(3),t.Y8G("ngIf",!n.showPlanForm),t.R7$(6),t.JRh(n.staticText.serialNumber),t.R7$(2),t.JRh(n.staticText.plan),t.R7$(2),t.JRh(n.staticText.messages),t.R7$(2),t.JRh(n.staticText.displayName),t.R7$(2),t.JRh(n.staticText.pricing),t.R7$(2),t.SpI(" ",n.staticText.actions,""),t.R7$(2),t.Y8G("ngForOf",n.groupedPlanList),t.R7$(6),t.JRh(t.bMT(38,17,null==n.groupedPlanList[n.selectedIndex]?null:n.groupedPlanList[n.selectedIndex].name)+" Plan"),t.R7$(6),t.Y8G("ngForOf",null==n.groupedPlanList[n.selectedIndex]?null:n.groupedPlanList[n.selectedIndex].pricingOptions))},dependencies:[g.YU,g.Sq,g.bT,b.z,M.b,d.me,d.BC,d.YS,d.vS,C.So,f.Y,g.PV],styles:["h1[_ngcontent-%COMP%]{font-size:1.5rem;font-family:Matter-Bold;margin-bottom:0rem}h2[_ngcontent-%COMP%]{font-size:1.25rem;font-family:Matter-Bold}.sub-heading[_ngcontent-%COMP%]{color:#999;font-size:14px;font-family:Matter-Regular}.hr-section[_ngcontent-%COMP%]{margin:1.5rem 0rem}.tableFixHead[_ngcontent-%COMP%]{overflow:auto;height:70vh}.tableHeight[_ngcontent-%COMP%]{height:39vh}.tableFix[_ngcontent-%COMP%]{height:34vh}.tableFixHead[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{position:sticky;z-index:3;top:-1px}.bp-table-row[_ngcontent-%COMP%]{--bs-table-bg: #F3F4F5;background-color:#f3f4f5;line-height:20px;font-family:Matter-Regular}.table[_ngcontent-%COMP%]{border-inline-start:1px solid #F3F4F5;border-inline-end:1px solid #F3F4F5;font-size:15px}.table[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{background-color:#f3f4f5}.table[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{vertical-align:center}.table[_ngcontent-%COMP%]   td.td-actions-container[_ngcontent-%COMP%]{min-width:100px}.table[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{border-bottom:1px solid #fff;border-top:1px solid #fff;border-inline-start:none;border-inline-end:none}.table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%], .table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{border-bottom:2px solid #F3F4F5}.col-10[_ngcontent-%COMP%]{max-width:80%}.edit-member-btn[_ngcontent-%COMP%]{color:#226cf4;font-size:20px;padding:4px;background-color:#f3f4f5;border-radius:7px;cursor:pointer}.delete-member-btn[_ngcontent-%COMP%]{color:#aa263f;font-size:20px;background-color:#f9d9dc;border-radius:7px;margin-inline-start:5px;cursor:pointer;padding:4px}.create-customer[_ngcontent-%COMP%]{border:1px solid #ccc;padding:30px .5rem;border-radius:5px}.add-customer-div[_ngcontent-%COMP%]{margin-top:1rem}.add-customer-div[_ngcontent-%COMP%]   .add-customer-btn[_ngcontent-%COMP%]{display:flex;background-color:#dfe1e4;color:#999;padding:.35rem .75rem;font-size:14px;border-radius:3px;align-items:center;border:1px solid #ccc}.add-customer-div[_ngcontent-%COMP%]   .add-customer-btn-valid[_ngcontent-%COMP%]{display:flex;background-color:#226cf4;color:#fff;padding:.35rem .75rem;font-size:14px;border-radius:3px;align-items:center;border:1px solid #ccc}.add-customer-div[_ngcontent-%COMP%]   .add-customer-active[_ngcontent-%COMP%]{background-color:#118cfc!important;color:#fff!important;border:none!important}.add-customer-div[_ngcontent-%COMP%]   .add-customer[_ngcontent-%COMP%]{font-size:16px;margin-inline-end:4px}.bp-disable-btn[_ngcontent-%COMP%]{width:100px;margin-inline-start:auto}.pricing-icon-box[_ngcontent-%COMP%]{color:#226cf4;font-size:24px;background:#f3f4f5;cursor:pointer}.search-box[_ngcontent-%COMP%]   .bp-input-box[_ngcontent-%COMP%]{padding-inline-start:30px}.search-box[_ngcontent-%COMP%]   .material-icons[_ngcontent-%COMP%]{position:absolute;inset-inline-start:8px;top:8px;font-size:22px;color:#666}.lead-filter-section[_ngcontent-%COMP%]{margin-top:30px;margin-bottom:20px}.col[_ngcontent-%COMP%]{border:1px solid #DDDEDF}.row[_ngcontent-%COMP%]{margin-inline-start:0px;margin-inline-end:0px}.filter-btn[_ngcontent-%COMP%]{width:120px;
1display:flex;justify-content:center;align-items:center;padding:4px 0!important;background-color:#f3f4f5;color:gray;font-size:14px}.filter-box-btn[_ngcontent-%COMP%]{margin-inline-end:5px;margin-inline-start:5px;position:relative}.filter-box-btn[_ngcontent-%COMP%]   .filter-div-btn[_ngcontent-%COMP%]{padding:5px 13px 5px 30px;height:38px;border:1px solid rgba(204,204,204,.8);font-family:Matter-Regular}.filter-main-box[_ngcontent-%COMP%]{position:absolute;height:300px;width:300px;background-color:#fff;inset-inline-end:0;top:43px;border-radius:5px;padding:11px;z-index:16;box-shadow:0 1px 3px #00000005,1px 1px 2px 2px #0000001a}.filter-main-box[_ngcontent-%COMP%]   .filter-sub-head[_ngcontent-%COMP%]{font-size:16px}.filter-main-box[_ngcontent-%COMP%]   .filter_dropdown[_ngcontent-%COMP%]{position:absolute;background-color:#fff;box-shadow:#32325d40 0 2px 5px -1px,#0000004d 0 1px 3px -1px;top:133px;inset-inline-end:69px;width:280px;z-index:1;border-radius:3px}.filter-main-box[_ngcontent-%COMP%]   .filter-btn-platform[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:space-between;align-items:center;padding:5px 12px!important;background-color:#f3f4f5;color:gray;font-size:14px;border:1px solid gainsboro}.filter-main-box[_ngcontent-%COMP%]   .dropdown-list[_ngcontent-%COMP%]{box-shadow:#32325d40 0 2px 5px -1px,#0000004d 0 1px 3px -1px;z-index:1;position:absolute;width:max-content;margin-inline-end:79px}.filter-main-box[_ngcontent-%COMP%]   .list-bot[_ngcontent-%COMP%]{width:93%!important}.filter-main-box[_ngcontent-%COMP%]   .inner-dropdown-list[_ngcontent-%COMP%]{background-color:#fff;text-align:center}.filter-main-box[_ngcontent-%COMP%]   .innerDropdownList[_ngcontent-%COMP%]{overflow-y:auto;max-height:350px}.filter-main-box[_ngcontent-%COMP%]   .list-item[_ngcontent-%COMP%]{display:flex;justify-content:flex-start;align-items:center;padding:2px 9px;font-size:14px;margin:4px 0}.filter-main-box[_ngcontent-%COMP%]   .list-item[_ngcontent-%COMP%]:hover{background-color:#f3f4f5;cursor:pointer}.filter-main-box[_ngcontent-%COMP%]   .filter-apply-btn[_ngcontent-%COMP%]{margin-top:18px;justify-content:space-between}.filter-main-box[_ngcontent-%COMP%]   .bp-disable-btn[_ngcontent-%COMP%]{width:130px}.filter-main-box[_ngcontent-%COMP%]   .bp-primary-btn[_ngcontent-%COMP%]{width:130px;min-width:130px!important}
1.bot-platform-name[_ngcontent-%COMP%]{position:absolute;inset-inline-start:2px}.bot-platform-text[_ngcontent-%COMP%]{padding:7px;padding-inline-start:20px;padding-inline-end:20px;color:#3da144;background-color:#d0f0d2;border-radius:25px}.active-li[_ngcontent-%COMP%]{border:1px solid #3573F4;background-color:#dae0fd}.active-a[_ngcontent-%COMP%]{color:#3573f4}.inbox-disable-btn[_ngcontent-%COMP%]{padding:5px 25px;font-size:14px;font-family:Matter-Regular;color:#666;background-color:#f3f4f5;border-radius:3px;border:none;resize:none;outline:none}.filter-section-btn[_ngcontent-%COMP%]{margin-inline-end:5px;margin-inline-start:5px}.search-icon[_ngcontent-%COMP%]{top:8px;inset-inline-start:6px;color:#999;direction:inherit}.filter-icon[_ngcontent-%COMP%]{cursor:pointer;position:absolute;top:1px;font-size:21px;color:#999;direction:inherit}.search-bar[_ngcontent-%COMP%]{padding:13px!important;padding-inline-start:35px!important}.div-height[_ngcontent-%COMP%]{height:190px}.load-more[_ngcontent-%COMP%]{background-color:#e2e6ea;border-color:#dae0e5}.customer-name[_ngcontent-%COMP%]{color:#118cfc;cursor:pointer;font-family:Matter-Regular;font-weight:500}.add-customer-button[_ngcontent-%COMP%]{background-color:#fff;color:#226cf4;border:1px solid #226CF4}.label-text[_ngcontent-%COMP%]{font-family:Matter-Regular;color:#333;font-size:14px}.required[_ngcontent-%COMP%]{color:red;font-size:16px}.selected-option-box[_ngcontent-%COMP%]{font-family:Matter-Regular;text-transform:capitalize;color:#333;width:100%;height:100%;border:none;padding:.5rem 1rem;text-align:start;cursor:pointer;border-color:#ccc;background-color:#dfe1e4}.drop-down-arrow[_ngcontent-%COMP%]{position:absolute;inset-inline-end:2%;top:8%;width:30px;transform:rotate(0);transition:.5s}.drop-down-arrow-active[_ngcontent-%COMP%]{transform:rotate(180deg);transition:.5s}.select-box-dropdown[_ngcontent-%COMP%]{max-height:200px;position:absolute;margin-top:3%;padding:3%;width:100%;z-index:13;background-color:#fff;border-radius:5px;font-family:Matter-Regular;overflow-y:scroll;box-shadow:0 0 10px #00000029}.options-box[_ngcontent-%COMP%]{display:flex!important;font-family:Matter-Regular;color:#333;font-size:small;padding:.5rem;cursor:pointer;border-radius:5px}.options-box[_ngcontent-%COMP%]:hover{background-color:#f3f4f5}.currency-checkbox[_ngcontent-%COMP%]{font-family:Matter-Regular;font-size:14px}
1.filter-apply-btn[_ngcontent-%COMP%]{margin-top:18px;justify-content:space-between}.clear-btn[_ngcontent-%COMP%]{width:45%}.apply-btn[_ngcontent-%COMP%]{width:45%;min-width:45%!important}.table-td[_ngcontent-%COMP%]{padding:0rem 1rem 1rem}.modal[_ngcontent-%COMP%]   .modal-header[_ngcontent-%COMP%]{border-bottom:none}.modal[_ngcontent-%COMP%]   .modal-header[_ngcontent-%COMP%]   .close[_ngcontent-%COMP%]{position:absolute;inset-inline-end:-20px;top:-19px;color:#333;opacity:1}.modal[_ngcontent-%COMP%]   .modal-body[_ngcontent-%COMP%]   .currency-title[_ngcontent-%COMP%]{font-family:Matter-SemiBold}.modal[_ngcontent-%COMP%]   .modal-body[_ngcontent-%COMP%]   .bp-input-box[_ngcontent-%COMP%]{min-width:280px}.modal[_ngcontent-%COMP%]   .modal-footer[_ngcontent-%COMP%]{border-top:none}.modal[_ngcontent-%COMP%]   .modal-title[_ngcontent-%COMP%]{font-family:Matter-SemiBold}@media (max-width: 767px){.modal[_ngcontent-%COMP%]   .modal-dialog[_ngcontent-%COMP%]{min-width:95%!important}.modal[_ngcontent-%COMP%]   .modal-dialog[_ngcontent-%COMP%]   .modal-content[_ngcontent-%COMP%]   .modal-header[_ngcontent-%COMP%]   .close[_ngcontent-%COMP%]{inset-inline-end:-6px;top:-8px}.modal[_ngcontent-%COMP%]   .modal-dialog[_ngcontent-%COMP%]   .modal-content[_ngcontent-%COMP%]   .modal-body[_ngcontent-%COMP%]   .inputs-container[_ngcontent-%COMP%]{flex-direction:column}.modal[_ngcontent-%COMP%]   .modal-dialog[_ngcontent-%COMP%]   .modal-content[_ngcontent-%COMP%]   .modal-body[_ngcontent-%COMP%]   .inputs-container[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{display:block}.modal[_ngcontent-%COMP%]   .modal-dialog[_ngcontent-%COMP%]   .modal-content[_ngcontent-%COMP%]   .modal-body[_ngcontent-%COMP%]   .inputs-container[_ngcontent-%COMP%]   .bp-input-box[_ngcontent-%COMP%]{min-width:200
1px}}"]})}return a})();var k=p(30450);const B=()=>[],w=a=>({"drop-down-arrow-active":a});function Y(a,r){if(1&a){const e=t.RV6();t.j41(0,"div",47)(1,"div")(2,"mat-checkbox",48),t.bIt("change",function(){t.eBV(e);const n=t.XpG(2);return t.Njj(n.changeValidity("year"))}),t.EFF(3),t.k0s()(),t.j41(4,"div")(5,"mat-checkbox",48),t.bIt("change",function(){t.eBV(e);const n=t.XpG(2);return t.Njj(n.changeValidity("billing-cycle"))}),t.EFF(6),t.k0s()()()}if(2&a){const e=t.XpG(2);t.R7$(2),t.Y8G("checked",e.selectedValidities.includes("year")),t.R7$(),t.JRh(e.staticText.oneYear),t.R7$(2),t.Y8G("checked",e.selectedValidities.includes("billing-cycle")),t.R7$(),t.JRh(e.staticText.billingCycle)}}function X(a,r){if(1&a){const e=t.RV6();t.j41(0,"div")(1,"mat-checkbox",48),t.bIt("change",function(){const n=t.eBV(e).$implicit,o=t.XpG(4);return t.Njj(o.changeCurrency(n))}),t.EFF(2),t.k0s()()}if(2&a){const e=r.$implicit,i=t.XpG(4);t.R7$(),t.Y8G("checked",i.selectedCurrencies.includes(e)),t.R7$(),t.JRh(e)}}function J(a,r){if(1&a&&(t.j41(0,"div",47)(1,"div"),t.DNE(2,X,3,2,"div",15),t.k0s()()),2&a){const e=t.XpG(3);t.R7$(2),t.Y8G("ngForOf",e.availableCurrencies)}}function z(a,r){if(1&a){const e=t.RV6();t.j41(0,"div",49)(1,"label",29),t.EFF(2),t.j41(3,"span",30),t.EFF(4,"*"),t.k0s()(),t.j41(5,"div",31)(6,"button",32),t.bIt("click",function(n){t.eBV(e);const o=t.XpG(2);return o.showDropDown=!o.showDropDown,t.Njj(n.stopPropagation())}),t.EFF(7),t.k0s(),t.nrm(8,"img",33),t.k0s(),t.j41(9,"div",34),t.DNE(10,J,3,1,"div",35),t.k0s()()}if(2&a){const e=t.XpG(2);t.R7$(2),t.SpI(" ",e.staticText.setCurrency,""),t.R7$(5),t.SpI(" ",e.staticText.select," "),t.R7$(),t.Y8G("ngClass",t.eq3(4,w,e.showDropDown)),t.R7$(2),t.Y8G("ngIf",e.showDropDown)}}function W(a,r){if(1&a){const e=t.RV6();t.j41(0,"div",27)(1,"div",36)(2,"label",37),t.EFF(3),t.j41(4,"span",30),t.EFF(5,"*"),t.k0s()(),t.j41(6,"input",51),t.mxI("ngModelChange",function(n){t.eBV(e);const o=t.XpG().$implicit;return t.DH7(o.currency,n)||(o.currency=n),t.Njj(n)}),t.k0s()(),t.j41(7,"div",36)(8,"label",37),t.EFF(9),t.j41(10,"span",30),t.EFF(11,"*"),t.k0s()(),t.j41(12,"input",52),t.mxI("ngModelChange",function(n){t.eBV(e);const o=t.XpG().$implicit;return t.DH7(o.price.year,n)||(o.price.year=n),t.Njj(n)}),t.k0s()(),t.j41(13,"div",36)(14,"label",37),t.EFF(15),t.j41(16,"span",30),t.EFF(17,"*"),t.k0s()(),t.nrm(18,"input",53),t.k0s()()}if(2&a){const e=t.XpG().$implicit,i=t.XpG(2);t.R7$(3),t.JRh(i.staticText.currency),t.R7$(3),t.R50("ngModel",e.currency),t.Y8G("placeholder",i.staticText.placeholders.enterNumberOfMessages),t.R7$(3),t.JRh(i.staticText.amount),t.R7$(3),t.R50("ngModel",e.price.year),t.Y8G("placeholder",i.staticText.placeholders.enterAmount),t.R7$(3),t.JRh(i.staticText.validity),t.R7$(3),t.Y8G("placeholder",i.staticText.placeholders.enterValidity)}}function U(a,r){if(1&a){const e=t.RV6();t.j41(0,"div",27)(1,"div",36)(2,"label",37),t.EFF(3),t.j41(4,"span",30),t.EFF(5,"*"),t.k0s()(),t.j41(6,"input",51),t.mxI("ngModelChange",function(n){t.eBV(e);const o=t.XpG().$implicit;return t.DH7(o.currency,n)||(o.currency=n),t.Njj(n)}),t.k0s()(),t.j41(7,"div",36)(8,"label",37),t.EFF(9),t.j41(10,"span",30),t.EFF(11,"*"),t.k0s()(),t.j41(12,"input",52),t.mxI("ngModelChange",function(n){t.eBV(e);const o=t.XpG().$implicit;return t.DH7(o.price.billingCycle,n)||(o.price.billingCycle=n),t.Njj(n)}),t.k0s()(),t.j41(13,"div",36)(14,"label",37),t.EFF(15),t.j41(16,"span",30),t.EFF(17,"*"),t.k0s()(),t.nrm(18,"input",54),t.k0s()()}if(2&a){const e=t.XpG().$implicit,i=t.XpG(2);t.R7$(3),t.JRh(i.staticText.currency),t.R7$(3),t.R50("ngModel",e.currency),t.Y8G("placeholder",i.staticText.placeholders.enterNumberOfMessages),t.R7$(3),t.JRh(i.staticText.amount),t.R7$(3),t.R50("ngModel",e.price.billingCycle),t.Y8G("placeholder",i.staticText.placeholders.enterAmount),t.R7$(3),t.JRh(i.staticText.validity),t.R7$(3),t.Y8G("placeholder",i.staticText.placeholders.enterValidity)}}function H(a,r){if(1&a&&(t.j41(0,"div"),t.DNE(1,W,19,8,"div",50)(2,U,19,8,"div",50),t.k0s()),2&a){const e=r.$implicit;t.R7$(),t.Y8G("ngIf",e.validity.includes("year")),t.R7$(),t.Y8G("ngIf",e.validity.includes("billing-cycle"))}}function q(a,r){if(1&a){const e=t.RV6();t.j41(0,"div",25)(1,"div",26)(2,"div",27)(3,"div",28)(4,"label",29),t.EFF(5),t.j41(6,"span",30),t.EFF(7,"*"),t.k0s()(),t.j41(8,"div",31)(9,"button",32),t.bIt("click",function(n){t.eBV(e);const o=t.XpG();return o.validityDropdown=!o.validityDropdown,t.Njj(n.stopPropagation())}),t.EFF(10),t.k0s(),t.nrm(11,"img",33),t.k0s(),t.j41(12,"div",34),t.DNE(13,Y,7,4,"div",35),t.k0s()(),t.j41(14,"div",36)(15,"label",37),t.EFF(16),t.j41(17,"span",30),t.EFF(18,"*"),t.k0s()(),t.j41(19,"input",38),t.mxI("ngModelChange",function(n){t.eBV(e);const o=t.XpG();return t.DH7(o.planSnapshot.messages,n)||(o.planSnapshot.messages=n),t.Njj(n)}),t.k0s(),t.nrm(20,"img",39)(21,"img",40),t.j41(22,"div",41),t.EFF(23),t.k0s()(),t.DNE(24,z,11,6,"div",42),t.k0s(),t.DNE(25,H,3,2,"div",15),t.k0s(),t.j41(26,"div",43)(27,"div",44)(28,"button",45),t.bIt("click",function(){t.eBV(e);const n=t.XpG();
1return n.isAddOnBox=!1,t.Njj(n.setSnapShot())}),t.EFF(29,"Cancel"),t.k0s(),t.j41(30,"button",46),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj("edit"===n.planSnapshot.mode?n.saveModifiedPlan():n.addNewPlan())}),t.EFF(31),t.k0s()()()()}if(2&a){const e=t.XpG();t.R7$(5),t.SpI(" ",e.staticText.choosePlanValidity,""),t.R7$(5),t.SpI(" ",e.selectedValidities?e.selectedValidities:e.staticText.chooseValidity," "),t.R7$(),t.Y8G("ngClass",t.eq3(12,w,e.validityDropdown)),t.R7$(2),t.Y8G("ngIf",e.validityDropdown),t.R7$(3),t.JRh(e.staticText.numberOfMessages),t.R7$(3),t.R50("ngModel",e.planSnapshot.messages),t.Y8G("placeholder",e.staticText.placeholders.enterNumberOfMessages)("disabled","edit"===e.planSnapshot.mode),t.R7$(4),t.JRh(e.staticText.pleaseEnterNumberOfMessages),t.R7$(),t.Y8G("ngIf",e.planSnapshot.messages),t.R7$(),t.Y8G("ngForOf",e.planSnapshot.pricingOptions),t.R7$(6),t.SpI(" ","edit"===e.planSnapshot.mode?e.staticText.upgradePlan:e.staticText.addPlan," ")}}function Q(a,r){if(1&a){const e=t.RV6();t.j41(0,"div",55)(1,"button",56),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.isAddOnBox=!0)}),t.EFF(2),t.k0s()()}if(2&a){const e=t.XpG();t.R7$(2),t.SpI("+ \xa0\xa0\xa0",e.staticText.addPlan,"")}}function K(a,r){1&a&&(t.j41(0,"p"),t.EFF(1," \xa0&\xa0 "),t.k0s())}function Z(a,r){if(1&a&&(t.qex(0),t.DNE(1,K,2,0,"p",65),t.j41(2,"div"),t.EFF(3),t.k0s(),t.bVm()),2&a){const e=r.$implicit,i=r.index;t.R7$(),t.Y8G("ngIf",1===i),t.R7$(2),t.SpI("",e," ")}}function tt(a,r){if(1&a){const e=t.RV6();t.qex(0),t.j41(1,"tr")(2,"td"),t.EFF(3),t.k0s(),t.j41(4,"td")(5,"span",57),t.EFF(6),t.k0s()(),t.j41(7,"td",58),t.DNE(8,Z,4,2,"ng-container",15),t.k0s(),t.j41(9,"td",59)(10,"mat-slide-toggle",60),t.bIt("change",function(){const n=t.eBV(e).$implicit,o=t.XpG();return t.Njj(o.changePlanStatus(n))}),t.k0s()(),t.j41(11,"td")(12,"span",61),t.bIt("click",function(){const n=t.eBV(e).$implicit,o=t.XpG();return t.Njj(o.setPlanDetails(n.data||[]))}),t.EFF(13," description "),t.k0s()(),t.j41(14,"td",62)(15,"div")(16,"span",63),t.bIt("click",function(){const n=t.eBV(e).$implicit,o=t.XpG();return t.Njj(o.editExistingPlan(n))}),t.EFF(17," edit "),t.k0s(),t.j41(18,"span",64),t.bIt("click",function(){const n=t.eBV(e).$implicit,o=t.XpG();return o.openDeleteModal=!0,t.Njj(o.planData=n)}),t.EFF(19," delete "),t.k0s()()()(),t.bVm()}if(2&a){const e=r.$implicit,i=r.index;t.R7$(3),t.JRh(i+1),t.R7$(3),t.JRh(e.messages),t.R7$(2),t.Y8G("ngForOf",e.data[0].validity),t.R7$(2),t.Y8G("checked","ACTIVE"===e.data[0].status)}}function et(a,r){if(1&a&&(t.j41(0,"div",71)(1,"label"),t.EFF(2),t.k0s(),t.nrm(3,"input",69),t.k0s()),2&a){const e=t.XpG(2);t.R7$(2),t.JRh(e.staticText.taxes),t.R7$(),t.Y8G("value",e.totalInrTaxes+"%")}}function nt(a,r){if(1&a&&(t.j41(0,"div",71)(1,"label"),t.EFF(2),t.k0s(),t.nrm(3,"input",69),t.k0s()),2&a){const e=t.XpG(2);t.R7$(2),t.JRh(e.staticText.taxes),t.R7$(),t.Y8G("value",e.totalUsdTaxes+"%")}}function it(a,r){if(1&a&&(t.j41(0,"div",71)(1,"label"),t.EFF(2),t.k0s(),t.nrm(3,"input",69),t.k0s()),2&a){const e=t.XpG(2);t.R7$(2),t.JRh(e.staticText.taxes),t.R7$(),t.Y8G("value",e.totalCadTaxes+"%")}}function ot(a,r){if(1&a&&(t.j41(0,"div")(1,"div",66),t.EFF(2),t.k0s(),t.j41(3,"div",67)(4,"div",68)(5,"label"),t.EFF(6),t.k0s(),t.nrm(7,"input",69),t.k0s(),t.qex(8),t.DNE(9,et,4,2,"div",70)(10,nt,4,2,"div",70)(11,it,4,2,"div",70),t.bVm(),t.k0s()()),2&a){const e=r.$implicit,i=t.XpG();t.R7$(2),t.JRh(e.currency),t.R7$(4),t.JRh(i.staticText.perYear),t.R7$(),t.Y8G("value",e.price.year),t.R7$(2),t.Y8G("ngIf","INR"===e.currency),t.R7$(),t.Y8G("ngIf","USD"===e.currency),t.R7$(),t.Y8G("ngIf","CAD"===e.currency)}}let at=(()=>{class a{constructor(e,i,n){this.plansService=e,this.sharedService=i,this.languageService=n,this.totalInrTaxes=0,this.totalUsdTaxes=0,this.totalCadTaxes=0,this.isAddOnBox=!1,this.plansList=[],this.showDropDown=!1,this.chargesList=[],this.planDetails=[],this.selectedCurrencies=[],this.openDeleteModal=!1,this.validityDropdown=!1,this.selectedValidities=["
1year"],this.availableCurrencies=[],this.staticText=n.getStaticText().whitelabel.addOnPlans,this.closePopups$=this.sharedService.closePopups.subscribe(()=>{})}ngOnInit(){this.setSnapShot(),this.getPlansList(),this.getCurrencies()}ngOnDestroy(){this.closePopups$?.unsubscribe()}getCurrencies(){fetch("/assets/currency.json").then(e=>e.json()).then(e=>{this.availableCurrencies=Object.keys(e)}).catch(console.log)}setSnapShot(e={mode:"add",messages:100,pricingOptions:[{price:{year:0,billingCycle:0},currency:localStorage.getItem("original-default-currency"),validity:this.selectedValidities}]}){this.planSnapshot=e,this.selectedCurrencies=[localStorage.getItem("original-default-currency")]}getPlansList(){this.sharedService.loader("start"),this.plansService.getMessagesAddOnPlans().then(e=>{this.plans=e||[],this.chargesList=e?.charges||[],this.plansList=h.chain(this.plans.pricingOptions||[]).groupBy("messages").map((i,n)=>({messages:n,data:i})).value()}).catch(e=>{this.sharedService.showToast("error","","Could not get Add-on Plans, Please Try Again Later")}).finally(()=>this.sharedService.loader("stop"))}changeValidity(e){this.selectedValidities.includes(e)?this.selectedValidities=this.selectedValidities.filter(i=>i!==e):this.selectedValidities.push(e),this.planSnapshot.pricingOptions=this.planSnapshot.pricingOptions.map(i=>(this.selectedValidities.includes("year")?(i.price.billingCycle=0,i.validity=this.selectedValidities):(i.price.year=0,i.validity=this.selectedValidities),i))}setPlanDetails(e){this.planDetails=e,this.calculateTaxes()}calculateTaxes(){this.chargesList.map(e=>{switch(e.currency){case"INR":this.totalInrTaxes=e.percentage+this.totalInrTaxes;break;case"USD":this.totalUsdTaxes=e.percentage+this.totalUsdTaxes;break;case"CAD":this.totalCadTaxes=e.percentage+this.totalCadTaxes}})}addNewPlan(){if((this.plans.pricingOptions||[]).some(e=>e.messages===this.planSnapshot.messages))this.sharedService.showToast("warning","",`Add-on Plan with ${this.planSnapshot.messages} messages Already Exists`);else{const e=[];this.planSnapshot.pricingOptions.map(n=>{e.push({messages:this.planSnapshot.messages,validity:n.validity,price:n.price,currency:n.currency,status:"ACTIVE"})});const i=[...this.plans.pricingOptions||[],...e];this.sharedService.loader("start"),this.plansService.addMessagesAddOnPlan({pricingOptions:i}).then(n=>{this.sharedService.showToast("success","","Add On Created Successfully"),this.plans.pricingOptions=n.pricingOptions,this.plansList=h.chain(n.pricingOptions).groupBy("messages").map((o,s)=>({messages:s,data:o})).value(),this.setSnapShot(),this.isAddOnBox=!1}).catch(n=>{this.sharedService.showToast("error","",n||"Could not add Plan")}).finally(()=>this.sharedService.loader("stop"))}}changeCurrency(e){const i=h.differenceBy(this.plans.pricingOptions,this.planSnapshot.pricingOptions,"_id");this.plans.pricingOptions=i,this.selectedCurrencies.includes(e)?this.selectedCurrencies=this.selectedCurrencies.filter(s=>s!==e):this.selectedCurrencies.push(e),this.selectedCurrencies.includes(e)?this.planSnapshot.pricingOptions.push({messages:this.planSnapshot.messages,price:{year:0,billingCycle:0},currency:e,validity:this.selectedValidities}):this.planSnapshot.pricingOptions=this.planSnapshot.pricingOptions.filter(s=>s.currency!==e);const n=this.planSnapshot,o=[];this.planSnapshot.pricingOptions.map(s=>{o.push({...s,validity:s.validity,messages:n.messages})}),this.planSnapshot.pricingOptions=o}changePlanStatus(e){let{status:n}=e.data[0];n="ACTIVE"===n?"INACTIVE":"ACTIVE",this.plans.pricingOptions=this.plans.pricingOptions.map(o=>(o.messages===e.data[0].messages&&(o.status=n),o)),this.sharedService.loader("start"),this.plansService.addMessagesAddOnPlan({pricingOptions:this.plans.pricingOptions}).then(o=>{this.sharedService.showToast("success","","Add On Status Updated Successfully"),this.plans.pricingOptions=o.pricingOptions,this.plansList=h.chain(o.pricingOptions).groupBy("messages").map((s,c)=>({messages:c,data:s})).value(),this.setSnapShot()}).catch(o=>{this.sharedService.showToast("error","","Could not update status")}).finally(()=>this.sharedService.loader("stop"))}editExistingPlan(e){this.isAddOnBox=!0;const i=[];this.selectedCurrencies=[],this.selectedValidities=e.data[0].validity,e.data.map(n=>{i.push({price:n.price,currency:n.currency,_id:n._id,status:n.status,validity:n.validity}),this.selectedCurrencies.push(n.currency)}),this.planSnapshot={mode:"edit",messages:e.messages,pricingOptions:i}}saveModifiedPlan(){const e=this.planSnapshot,i=[];this.planSnapshot.pricingOptions.map(s=>{i.push({...s,validity:s.validity,messages:e.messages})});const n=h.differenceBy(this.plans.pricingOptions,this.planSnapshot.pricingOptions,"_id"),o=[...i,...n];this.sharedService.loader("start"),this.plansService.addMessagesAddOnPlan({pricingOptions:o}).then(s=>{this.sharedService.showToast("success","","Add On Updated Successfully"),this.plans.pricingOptions=s.pricingOptions,this.plansList=h.chain(s.pricingOptions).groupBy("messages").map((c,l)=>({messages:l,data:c}
1)).value(),this.setSnapShot(),this.isAddOnBox=!1}).catch(s=>{this.sharedService.showToast("error","",s||s.message||"Could not edit plan, Please try again later")}).finally(()=>this.sharedService.loader("stop"))}deleteExistingPlan(e){if(this.openDeleteModal=!1,e){const i=h.differenceBy(this.plans.pricingOptions,this.planData.data,"_id");this.sharedService.loader("start"),this.plansService.addMessagesAddOnPlan({pricingOptions:i}).then(n=>{this.plans.pricingOptions=i,this.plansList=h.chain(i||[]).groupBy("messages").map((o,s)=>({messages:s,data:o})).value(),this.sharedService.showToast("success","","Add On Deleted Successfully")}).catch(n=>{this.sharedService.showToast("error","",n?.message||"Could not Delete Plan, Please Try Again Later")}).finally(()=>this.sharedService.loader("stop"))}}search(e){const i=e.target.value.toLowerCase();$("table tbody tr").filter(function(){$(this).toggle($(this).text().toLowerCase().indexOf(i)>-1)})}clearAllCurrencies(){this.selectedCurrencies=[]}static#t=this.\u0275fac=function(i){return new(i||a)(t.rXU(x.U),t.rXU(u.d),t.rXU(_.g))};static#e=this.\u0275cmp=t.VBU({type:a,selectors:[["app-addon-plans"]],decls:42,vars:20,consts:[[3,"userInput","title","description","showModal"],[1,"mt-4"],[1,"sub-heading","text-align-start"],["class","create-addson-plan position-relative",4,"ngIf"],[1,"row","mt-4","mb-4","d-flex","justify-content-between","p-start-3","p-end-3"],[1,"col-6","col-sm-5","col-lg-4","p-start-0","mb-2","mb-sm-0","m-end-1","search-box"],["type","text",1,"bp-input-box","position-relative",3,"keyup","placeholder"],[1,"material-icons"],["appAcl","","permission","agency-plans.write","class","col-auto m-start-auto",4,"ngIf"],[1,"table-div","mt-2","tableFixHead"],["id","customer",1,"table","text-align-start"],[1,"bp-table-row"],["scope","col",1,"col-2"],["appAcl","","permission","agency-plans.write","scope","col",1,"col-3"],["appAcl","","permission","agency-plans.write||agency-plans.remove","scope","col",1,"col-3"],[4,"ngFor","ngForOf"],["id","openAddOnModal","tabindex","-1","role","dialog","aria-labelledby","exampleModalCenterTitle","aria-hidden","true",1,"modal","fade"],["role","document",1,"modal-dialog","modal
1-dialog-centered",2,"min-width","750px","border-radius","10px"],[1,"modal-content"],[1,"modal-header","justify-content-between","mb-2"],["id","exampleModalLongTitle",1,"modal-title"],["type","button","aria-label","Close","data-bs-dismiss","modal",1,"close","border-0","bg-transparent","p-0"],["aria-hidden","true"],["width","40","src","assets/version2/icons/closebutton.svg"],[1,"modal-body"],[1,"create-addson-plan","position-relative"],[1,"col-12","col-md-10"],[1,"row"],[1,"col-12","col-sm-6","col-lg-4","position-relative","mb-3"],["for","monthlyMessages",1,"input-box-label"],[1,"required"],[1,"bp-input-box","position-relative","p-0"],[1,"selected-option-box",3,"click"],["src","/assets/version2/images/sidebar/arrow_drop_down_black.svg","alt","",1,"drop-down-arrow",3,"ngClass"],[1,"position-relative"],["class","select-box-dropdown",4,"ngIf"],[1,"position-relative","col-12","col-sm-6","col-lg-4"],["for","name",1,"label-text"],["required","","name","bp-email","type","number",1,"bp-input-box",3,"ngModelChange","ngModel","placeholder","disabled"],["src","/assets/version2/icons/valid_input_icon.svg","alt","",1,"error-message","position-absolute"],["src","/assets/version2/icons/error_input_icon.svg","alt","",1,"error-message","position-absolute"],[1,"error-text"],["class","col-12 col-sm-6 col-lg-4 position-relative",4,"ngIf"],[1,"add-addon-div"],[1,"add-btn","d-flex"],[1,"bp-disable-btn","m-end-3",3,"click"],[1,"bp-primary-btn",3,"click"],[1,"select-box-dropdown"],[1,"currency-checkbox",3,"change","checked"],[1,"col-12","col-sm-6","col-lg-4","position-relative"],["class","row",4,"ngIf"],["disabled","","required","",1,"bp-input-box",3,"ngModelChange","ngModel","placeholder"],["required","","type","number",1,"bp-input-box",3,"ngModelChange","ngModel","placeholder"],["value","One Year","readonly","","required","",1,"bp-input-box",3,"placeholder"],["value","Billing Cycle","readonly","","required","",1,"bp-input-box",3,"placeholder"],["appAcl","","permission","agency-plans.write",1,"col-auto","m-start-auto"],[1,"bp-primary-btn","add-member-button",3,"click"],[1,"text-capitalize"],[1,"d-flex","border-top-0"],["appAcl","","permission","agency-plans.write"],[1,"m-end-2","mt-2",3,"change","checked"],["data-bs-toggle","modal","data-bs-target","#openAddOnModal",1,"material-icons","pricing-icon-box",3,"click"],["appAcl","","permission","agency-plans.write||agency-plans.remove",1,"table-style","td-actions-container"],["appAcl","","permission","agency-plans.write",1,"material-icons","edit-member-btn",3,"click"],["appAcl","","permission","agency-plans.remove",1,"material-icons","delete-member-btn",3,"click"],[4,"ngIf"],[1,"mb-2","currency-title"],[1,"d-flex","justify-content-between","inputs-container"],[1,"mb-3"],["readonly","","type","text",1,"bp-input-box",3,"value"],["class","m-start-0",4,"ngIf"],[1,"m-start-0"]],template:function(i,n){1&i&&(t.j41(0,"app-modal",0),t.bIt("userInput",function(s){return n.deleteExistingPlan(s)}),t.k0s(),t.j41(1,"section",1)(2,"h2"),t.EFF(3),t.k0s(),t.j41(4,"p",2),t.EFF(5),t.k0s(),t.DNE(6,q,32,14,"div",3),t.j41(7,"div",4)(8,"div",5)(9,"input",6),t.bIt("keyup",function(s){return n.search(s)}),t.k0s(),t.j41(10,"span",7),t.EFF(11," search "),t.k0s()(),t.DNE(12,Q,3,1,"div",8),t.k0s(),t.j41(13,"div",9)(14,"table",10)(15,"thead")(16,"tr",11)(17,"th",12),t.EFF(18),t.k0s(),t.j41(19,"th",12),t.EFF(20),t.k0s(),t.j41(21,"th",12),t.EFF(22),t.k0s(),t.j41(23,"th",13),t.EFF(24),t.k0s(),t.j41(25,"th",12),t.EFF(26),t.k0s(),t.j41(27,"th",14),t.EFF(28),t.k0s()()(),t.j41(29,"tbody"),t.DNE(30,tt,20,4,"ng-container",15),t.k0s()()()(),t.j41(31,"div",16)(32,"div",17)(33,"div",18)(34,"div",19)(35,"h5",20),t.EFF(36),t.k0s(),t.j41(37,"button",21)(38,"span",22),t.nrm(39,"img",23),t.k0s()()(),t.j41(40,"div",24),t.DNE(41,ot,12,6,"div",15),t.k0s()()()()),2&i&&(t.Y8G("title",n.staticText.modal.deleteAddOnsPlan)("description",n.staticText.wantToDeleteThisAddOnsPlan)("showModal",n.openDeleteModal),t.R7$(3),t.JRh(n.staticText.createAddOnPlans),t.R7$(2),t.JRh(n.staticText.checkoutYourCurrentMessage),t.R7$(),t.Y8G("ngIf",n.isAddOnBox),t.R7$(3),t.Y8G("placeholder",n.staticText.placeholders.searchByMessages),t.R7$(3),t.Y8G("ngIf",!n.isAddOnBox),t.R7$(6),t.JRh(n.staticText.serialNumber),t.R7$(2),t.JRh(n.staticText.messages),t.R7$(2),t.JRh(n.staticText.validity),t.R7$(2),t.JRh(n.staticText.active),t.R7$(2),t.JRh(n.staticText.priceDetials),t.R7$(2),t.JRh(n.staticText.action),t.R7$(2),t.Y8G("ngForOf",n.plansList||t.lJ4(19,B)),t.R7$(6),t.E5c("",n.staticText.addOnChanges,"",null==n.planDetails[0]?null:n.planDetails[0].messages," ",n.staticText.messages,""),t.R7$(5),t.Y8G("ngForOf",n.planDetails))},dependencies:[g.YU,g.Sq,g.bT,b.z,k.sG,d.me,d.Q0,d.BC,d.YS,d.vS,C.So,f.Y],styles:["h1[_ngcontent-%COMP%]{font-size:1.5rem;font-family:Matter-Bold;margin-bottom:0rem}h2[_ngcontent-%COMP%]{font-size:1.25rem;font-family:Matter-Bold}.sub-heading[_ngcontent-%COMP%]{color:#999;font-size:14px;font-family:Matter-Regular}.create-addson-plan[_ngcontent-%COMP%]{border:1px solid #ccc;padding:30px .5rem;border-radius:5px}.bp-disable-btn[_ngcontent-%COMP%]{width:100px;margin-inline-start:auto}.selected-option-box[_ngcontent-%COMP%]{font-family:Matter-Regular;text-transform:capitalize;color:#333;width:100%;height:100%;border:none;padding:.5rem 1rem;text-align:start;cursor:pointer;border-color:#ccc;background-color:#dfe1e4}.drop-down-arrow[_ngcontent-%COMP%]{position:absolute;inset-inline-end:2%;top:8%;width:30px;transform:rotate(0);transition:.5s}.drop-down-arrow-active[_ngcontent-%COMP%]{transform:rotate(180deg);transition:.5s}.select-box-dropdown[_ngcontent-%COMP%]{max-height:200px;position:absolute;margin-top:3%;padding:3%;width:100%;z-index:13;background-color:#fff;border-radius:5px;font-family:Matter-Regular;overflow-y:scroll;box-shadow:0 0 10px #00000029}.options-box[_ngcontent-%COMP%]{display:flex!important;font-family:Matter-Regular;color:#333;font-size:small;padding:.5rem;cursor:pointer;border-radius:5px}.options-box[_ngcontent-%COMP%]:hover{background-color:#f3f4f5}.currency-checkbox[_ngcontent-%COMP%]{font-family:Matter-Regular;font-size:14px}
1.filter-apply-btn[_ngcontent-%COMP%]{margin-top:18px;justify-content:space-between}.add-addon-div[_ngcontent-%COMP%]{margin-top:1rem}.clear-btn[_ngcontent-%COMP%]{width:45%}.apply-btn[_ngcontent-%COMP%]{width:45%;min-width:45%!important}.table-td[_ngcontent-%COMP%]{padding:0rem 1rem 1rem}.label-text[_ngcontent-%COMP%]{font-family:Matter-Regular;color:#333}.search-box[_ngcontent-%COMP%]{min-width:180px}.search-box[_ngcontent-%COMP%]   .bp-input-box[_ngcontent-%COMP%]{padding-inline-start:30px}.search-box[_ngcontent-%COMP%]   .material-icons[_ngcontent-%COMP%]{position:absolute;inset-inline-start:8px;top:8px;font-size:22px;color:#666}.bp-primary-btn[_ngcontent-%COMP%]{width:115px;min-width:115px}.pricing-icon-box[_ngcontent-%COMP%]{color:#226cf4;font-size:24px;background:#f3f4f5;cursor:pointer}.edit-member-btn[_ngcontent-%COMP%]{color:#226cf4;font-size:20px;padding:4px;background-color:#f3f4f5;border-radius:7px;cursor:pointer}.delete-member-btn[_ngcontent-%COMP%]{color:#aa263f;font-size:20px;background-color:#f9d9dc;border-radius:7px;margin-inline-start:5px;cursor:pointer;padding:4px}.tableFixHead[_ngcontent-%COMP%]{overflow:auto;height:70vh}.tableFixHead[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{position:sticky;z-index:3;top:-1px}.table[_ngcontent-%COMP%]{border-inline-start:1px solid #F3F4F5;border-inline-end:1px solid #F3F4F5;font-size:15px}.table[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{background-color:#f3f4f5}.table[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{vertical-align:center}.table[_ngcontent-%COMP%]   td.td-actions-container[_ngcontent-%COMP%]{min-width:100px}.table[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{border-bottom:1px solid #fff;border-top:1px solid #fff;border-inline-start:none;border-inline-end:none}.table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%], .table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{border-bottom:2px solid #F3F4F5}.modal[_ngcontent-%COMP%]   .modal-header[_ngcontent-%COMP%]{border-bottom:none}.modal[_ngcontent-%COMP%]   .modal-header[_ngcontent-%COMP%]   .close[_ngcontent-%COMP%]{position:absolute;inset-inline-end:-20px;top:-19px;color:#333;opacity:1}.modal[_ngcontent-%COMP%]   .modal-body[_ngcontent-%COMP%]   .currency-title[_ngcontent-%COMP%]{font-family:Matter-SemiBold}.modal[_ngcontent-%COMP%]   .modal-body[_ngcontent-%COMP%]   .bp-input-box[_ngcontent-%COMP%]{min-width:280px}.modal[_ngcontent-%COMP%]   .modal-footer[_ngcontent-%COMP%]{border-top:none}.modal[_ngcontent-%COMP%]   .modal-title[_ngcontent-%COMP%]{font-family:Matter-SemiBold}@media (max-width: 767px){.modal[_ngcontent-%COMP%]   .modal-dialog[_ngcontent-%COMP%]{min-width:95%!important}.modal[_ngcontent-%COMP%]   .modal-dialog[_ngcontent-%COMP%]   .modal-content[_ngcontent-%COMP%]   .modal-header[_ngcontent-%COMP%]   .close[_ngcontent-%COMP%]{inset-inline-end:-6px;top:-8px}.modal[_ngcontent-%COMP%]   .modal-dialog[_ngcontent-%COMP%]   .modal-content[_ngcontent-%COMP%]   .modal-body[_ngcontent-%COMP%]   .inputs-container[_ngcontent-%COMP%]{flex-direction:column}.modal[_ngcontent-%COMP%]   .modal-dialog[_ngcontent-%COMP%]   .modal-content[_ngcontent-%COMP%]   .modal-body[_ngcontent-%COMP%]   .inputs-container[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{display:block}.modal[_ngcontent-%COMP%]   .modal-dialog[_ngcontent-%COMP%]   .modal-content[_ngcontent-%COMP%]   .modal-body[_ngcontent-%COMP%]   .inputs-container[_ngcontent-%COMP%]   .bp-input-box[_ngcontent-%COMP%]{min-width:200
1px}}"]})}return a})();var st=p(45312),rt=p(9846),ct=p(59640),lt=p(30639),pt=p(41413),dt=p(32102);function gt(a,r){if(1&a&&(t.j41(0,"li",20)(1,"span",21),t.EFF(2),t.k0s()()),2&a){const e=t.XpG();t.R7$(2),t.JRh(e.staticText.whitelabelCharges)}}function ht(a,r){if(1&a&&(t.j41(0,"li",20)(1,"span",22),t.EFF(2),t.k0s()()),2&a){const e=t.XpG();t.R7$(2),t.JRh(e.staticText.chargesOrTaxesConfiguration)}}let mt=(()=>{class a{constructor(e,i,n,o,s,c){this.sharedService=e,this.store=i,this.languageService=n,this.commonService=o,this.router=s,this.agencyService=c,this.isNewSubscriptionPreviouslyVisited=!1,this.modal={title:"Switch to Subscription V2",description:"Are you sure you want to switch to subscription V2?",handler:()=>{},show:!1,confirmText:"Ok"},this.staticText=n.getStaticText().whitelabel,this.reInitializeModalText(),this.storeSubscription$=i.select(l=>l).subscribe(l=>{this.agencyDetails=l.agencyDetails,this.agencyId=l.agencyDetails._id,this.agencyType=l.agencyDetails.type})}isRootAgency(){return this.agencyId===st.c.rootAgencyId}isAgency(){return"RESELLER"!==this.agencyType}get isWhiteLabelPaymentEnable(){return!(!this.agencyDetails?.isAgencyConfigurationEnabled?.razorpay&&!this.agencyDetails?.isAgencyConfigurationEnabled?.stripe)}navigateToSubscriptionV2(){this.router.navigate(["/agency/subscriptions-v2/plan"])}updateAgencySubscriptionTypePopUp(){localStorage.getItem("isNewSubscriptionEnabled")&&(this.isNewSubscriptionPreviouslyVisited=JSON.parse(String(localStorage.getItem("isNewSubscriptionEnabled")))),this.agencyDetails.isNewSubscriptionEnable||this.isNewSubscriptionPreviouslyVisited?this.isNewSubscriptionPreviouslyVisited?(this.agencyDetails.isNewSubscriptionEnable=!0,this.updateAgencySubscriptionType()):this.agencyDetails.isNewSubscriptionEnable=!1:(this.modal.show=!0,this.modal.handler=this.handleModal.bind(this))}handleModal(e){if(!e)return this.modal.show=!1,this.agencyDetails.isNewSubscriptionEnable=!1,void localStorage.setItem("isNewSubscriptionEnabled","false");this.updateAgencySubscriptionType(),this.modal.show=!1,this.agencyDetails.isNewSubscriptionEnable=!0,localStorage.setItem("isNewSubscriptionEnabled","true")}updateAgencySubscriptionType(){this.sharedService.loader("start"),this.agencyService.updateAgencySubscriptionType({isNewSubscriptionEnable:!0}).then(e=>{this.router.navigate(["/agency/subscriptions-v2/plan"]),this.store.dispatch((0,rt.nQ)({update:e}))}).catch(e=>{this.sharedService.showToast("error","",e?.message||"Something went wrong, please try again later")}).finally(()=>this.sharedService.loader("stop"))}reInitializeModalText(){this.modal={title:this.staticText.switchToV2,description:this.staticText.switchToV2Description,handler:()=>{},show:!1,confirmText:this.staticText.switchToV2Confirm}}static#t=this.\u0275fac=function(i){return new(i||a)(t.rXU(u.d),t.rXU(ct.il),t.rXU(_.g),t.rXU(lt.h),t.rXU(m.Ix),t.rXU(pt.j))};static#e=this.\u0275cmp=t.VBU({type:a,selectors:[["app-whitelabel"]],decls:28,vars:12,consts:[[1,"content-container","text-align-start"],[1,"pt-0","pt-lg-2"],[1,"d-flex","justify-content-between"],[1,"subscription-heading","text-align-start"],[1,"v2-toggle"],[1,"custom-toggle"],[1,"p-end-2"],[1,"label","position-relative"],[1,"toggle-btn",3,"click"],["disabled","","type","checkbox","name","status",3,"checked"],[1,"slider-toggle","round"],[1,"navbar","navbar-expand","mt-4"],[1,"navbar-nav","p-start-0"],["appAcl","","permission","agency-plans.read",1,"bp-navmenu-box"],["routerLink","/whitelabel/plans","routerLinkActive","bp-tabs-border-color",1,"bp-tabs-text"],["routerLink","/whitelabel/whatsapp-plans","routerLinkActive","bp-tabs-border-color",1,"bp-tabs-text"],[1,"bp-navmenu-box"],["routerLink","/whitelabel/message-addon","routerLinkActive","bp-tabs-border-color",1,"bp-tabs-text"],["appAcl","","permission","agency-charges.read","class","bp-navmenu-box",4,"ngIf"],[3,"userInput","title","description","showModal","face","confirmText"],["appAcl","","permission","agency-charges.read",1,"bp-navmenu-box"],["routerLink","/whitelabel/charges","routerLinkActive","bp-tabs-border-color",1,"bp-tabs-text"],["routerLink","/whitelabel/taxes-configuration","routerLinkActive","bp-tabs-border-color",1,"bp-tabs-text"]],template:function(i,n){1&i&&(t.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"h1",3),t.EFF(4),t.k0s(),t.j41(5,"div",4)(6,"div",5)(7,"div",6)(8,"mat-label",7),t.EFF(9),t.k0s()(),t.j41(10,"label",8),t.bIt("click",function(){return n.updateAgencySubscriptionTypePopUp()}),t.nrm(11,"input",9)(12,"span",10),t.k0s()()()(),t.j41(13,"nav",11)(14,"ul",12)(15,"li",13)(16,"span",14),t.EFF(17),t.k0s()(),t.j41(18,"li",13)(19,"span",15),t.EFF(20),t.k0s()(),t.j41(21,"li",16)(22,"span",17),t.EFF(23,"Message Add-ons"),t.k0s()(),t.DNE(24,gt,3,1,"li",18)(25,ht,3,1,"li",18),t.k0s()(),t.nrm(26,"router-outlet"),t.k0s()(),t.j41(27,"app-modal",19),t.bIt("userInput",function(s){return n.handleModal(s)}),t.k0s()),2&i&&(t.R7$(4),t.JRh(n.staticText.plans),t.R7$(5),t.JRh(n.staticText.switchToSubscriptionV2),t.R7$(2),t.Y8G("checked",(null==n.agencyDetails?null:n.agencyDetails.isNewSubscriptionEnable)||!1),t.R7$(6),t.SpI(" ",n.staticText.websitePlans,""),t.R7$(3),t.SpI(" ",n.staticText.whatsappPlansHeader,""),t.R7$(4),t.Y8G("ngIf",n.isRootAgency()),t.R7$(),t.Y8G("ngIf",n.isAgency()),t.R7$(2),t.Y8G("title",n.modal.title)("description",n.modal.description)("showModal",n.modal.show)("face","happy")("confirmText",n.modal.confirmText))},dependencies:[g.bT,m.n3,m.Wk,m.wQ,b.z,dt.nJ,f.Y],styles:['.subscription-heading[_ngcontent-%COMP%]{font-size:1.75rem;font-family:Matter-Bold}.navbar[_ngcontent-%COMP%]{padding:0;border-bottom:1px solid #f3f4f5}.navbar-nav[_ngcontent-%COMP%]{margin-bottom:10px}.bp-navmenu-box[_ngcontent-%COMP%]{margin-inline-end:50px;cursor:pointer}.bp-tabs-text[_ngcontent-%COMP%]{padding-bottom:12px}.bp-tabs-border-color[_ngcontent-%COMP%]{border-bottom:3px solid #333333;font-family:Matter-SemiBold}@media (max-width: 576px){.wrapper[_ngcontent-%COMP%]   .wrapper-side[_ngcontent-%COMP%]   .all-content-wrapper[_ngcontent-%COMP%]   .content-container[_ngcontent-%COMP%]   .subscription-heading[_ngcontent-%COMP%]{font-size:1.3rem}.wrapper[_ngcontent-%COMP%]   .wrapper-side[_ngcontent-%COMP%]   .all-content-wrapper[_ngcontent-%COMP%]   .content-container[_ngcontent-%COMP%]   .navbar[_ngcontent-%COMP%]{height:40px;overflow-x:auto}.wrapper[_ngcontent-%COMP%]   .wrapper-side[_ngcontent-%COMP%]   .all-content-wrapper[_ngcontent-%COMP%]   .content-container[_ngcontent-%COMP%]   .navbar[_ngcontent-%COMP%]   .navbar-nav[_ngcontent-%COMP%]{min-width:960px}.wrapper[_ngcontent-%COMP%]   .wrapper-side[_ngcontent-%COMP%]   .all-content-wrapper[_ngcontent-%COMP%]   .content-container[_ngcontent-%COMP%]   .navbar[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}}@media (min-width: 577px) and (max-width: 1230px){.wrapper[_ngcontent-%COMP%]   .wrapper-side[_ngcontent-%COMP%]   .all-content-wrapper[_ngcontent-%COMP%]   .content-container[_ngcontent-%COMP%]   .navbar[_ngcontent-%COMP%]{height:40px;overflow-x:auto}.wrapper[_ngcontent-%COMP%]   .wrapper-side[_ngcontent-%COMP%]   .all-content-wrapper[_ngcontent-%COMP%]   .content-container[_ngcontent-%COMP%]   .navbar[_ngcontent-%COMP%]   .navbar-nav[_ngcontent-%COMP%]{min-width:960px}.wrapper[_ngcontent-%COMP%]   .wrapper-side[_ngcontent-%COMP%]   .all-content-wrapper[_ngcontent-%COMP%]   .content-container[_ngcontent-%COMP%]   .navbar[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}}@media (max-width: 992px){.all-content-wrapper[_ngcontent-%COMP%]   .content-container[_ngcontent-%COMP%]{padding:14px 10px 10px}.all-content-wrapper[_ngcontent-%COMP%]   .content-container[_ngcontent-%COMP%]   h1[_ngcontent-%COMP%]{padding-inline-start:30px}}.v2-toggle[_ngcontent-%COMP%]   .custom-toggle[_ngcontent-%COMP%]{display:flex;height:100%;justify-content:space-between;align-items:center}.v2-toggle[_ngcontent-%COMP%]   .custom-toggle[_ngcontent-%COMP%]   .toggle-text[_ngcontent-%COMP%]{font-size:14px}.v2-toggle[_ngcontent-%COMP%]   .custom-toggle[_ngcontent-%COMP%]   .toggle-btn[_ngcontent-%COMP%]{position:relative;min-height:1px;width:40px;text-align:center;margin:0 7px 2px auto}.v2-toggle[_ngcontent-%COMP%]   .custom-toggle[_ngcontent-%COMP%]   .slider-toggle[_ngcontent-%COMP%]:before{position:absolute;content:"";height:16px;width:16px;left:3px;bottom:4px;background-color:#999;transition:.4s}.v2-toggle[_ngcontent-%COMP%]   .custom-toggle[_ngcontent-%COMP%]   .slider-toggle[_ngcontent-%COMP%]{position:absolute;cursor:pointer;top:0;inset-inline-start:0;inset-inline-end:-9px;bottom:0;background-color:#dfe1e4;transition:.4s;padding:12px 0}.v2-toggle[_ngcontent-%COMP%]   .custom-toggle[_ngcontent-%COMP%]   .slider-toggle.round[_ngcontent-%COMP%]{border-radius:34px}.v2-toggle[_ngcontent-%COMP%]   .custom-toggle[_ngcontent-%COMP%]   .slider-toggle.round[_ngcontent-%COMP%]:before, .v2-toggle[_ngcontent-%COMP%]   .custom-toggle[_ngcontent-%COMP%]   .work-txt[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{border-radius:50%}.v2-toggle[_ngcontent-%COMP%]   .custom-toggle[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]:checked + .slider-toggle[_ngcontent-%COMP%]{background-color:#d0f0d2;width:50px}.v2-toggle[_ngcontent-%COMP%]   .custom-toggle[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]:checked + .slider-toggle[_ngcontent-%COMP%]:before{transform:translate(26px);background-color:#3da144}.v2-toggle[_ngcontent-%COMP%]   .custom-toggle[_ngcontent-%COMP%]   .checkbox[_ngcontent-%COMP%]{position:relative;width:60px;height:30px}.v2-toggle[_ngcontent-%COMP%]   .custom-toggle[_ngcontent-%COMP%]   .checkbox[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{position:absolute;top:0;inset-inline-start:0;width:100%;height:100%;border-radius:50px;background:#e9e9eb;cursor:pointer;transition:all .3s ease}.v2-toggle[_ngcontent-%COMP%]   .custom-toggle[_ngcontent-%COMP%]   .checkbox[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]:after{content:"";position:absolute;top:2px;inset-inline-start:2px;width:25px;height:25px;border-radius:50%;background-color:#fff;transition:all .3s ease}.v2-toggle[_ngcontent-%COMP%]   .custom-toggle[_ngcontent-%COMP%]   .checkbox[_ngcontent-%COMP%]   input[type=checkbox][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#34c759}.v2-toggle[_ngcontent-%COMP%]   .custom-toggle[_ngcontent-%COMP%]   .checkbox[_ngcontent-%COMP%]   input[type=checkbox][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]:after{transform:translate(30px)}.v2-toggle[_ngcontent-%COMP%]   .custom-toggle[_ngcontent-%COMP%]   .checkbox-input[_ngcontent-%COMP%]{position:absolute;top:0;inset-inline-start:0;width:100%;height:100%}']})}return a})();const ut=()=>[],_t=a=>({"drop-down-arrow-active":a}),bt=a=>({"add-customer-btn-valid":a});function ft(a,r){if(1&a){const e=t.RV6();t.qex(0),t.j41(1,"div",35),t.bIt("click",function(){const n=t.eBV(e).$implicit,o=t.XpG(3);return o.planSnapshot.pricingOptions.currency=n,t.Njj(o.currencyDropdown=!1)}),t.j41(2,"span"),t.EFF(3),t.k0s()(),t.bVm()}if(2&a){const e=r.$implicit;t.R7$(3),t.JRh(e)}}function xt(a,r){if(1&a&&(t.j41(0,"div",34),t.DNE(1,ft,4,1,"ng-container",15),t.k0s()),2&a){const e=t.XpG(2);t.R7$(),t.Y8G("ngForOf",e.currencies)}}function Ct(a,r){if(1&a){const e=t.RV6();t.j41(0,"div",16)(1,"div",17)(2,"div",18)(3,"div",19)(4,"label",20),t.EFF(5),t.j41(6,"span",21),t.EFF(7,"*"),t.k0s()(),t.j41(8,"div",22)(9,"button",23),t.bIt("click",function(n){t.eBV(e);const o=t.XpG();return o.currencyDropdown=!o.currencyDropdown,t.Njj(n.stopPropagation())}),t.EFF(10),t.k0s(),t.nrm(11,"img",24),t.k0s(),t.j41(12,"div",25),t.DNE(13,xt,2,1,"div",26),t.k0s()(),t.j41(14,"div",27)(15,"label",28),t.EFF(16),t.j41(17,"span",21),t.EFF(18,"*"),t.k0s()(),t.j41(19,"input",29),t.mxI("ngModelChange",function(n){t.eBV(e);const o=t.XpG();
1return t.DH7(o.planSnapshot.pricingOptions.price,n)||(o.planSnapshot.pricingOptions.price=n),t.Njj(n)}),t.k0s()()()(),t.j41(20,"div",30)(21,"div",31)(22,"button",32),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return n.isChargesBox=!1,t.Njj(n.setSnapShot())}),t.EFF(23),t.k0s(),t.j41(24,"button",33),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj("edit"===n.planSnapshot.mode?n.saveExistingPlan():n.addNewPlan())}),t.EFF(25),t.k0s()()()()}if(2&a){const e=t.XpG();t.R7$(5),t.SpI(" ",e.staticText.currency,""),t.R7$(5),t.SpI(" ",null!=e.planSnapshot&&null!=e.planSnapshot.pricingOptions&&e.planSnapshot.pricingOptions.currency?e.planSnapshot.pricingOptions.currency:e.staticText.chooseCurrency," "),t.R7$(),t.Y8G("ngClass",t.eq3(10,_t,e.currencyDropdown)),t.R7$(2),t.Y8G("ngIf",e.currencyDropdown),t.R7$(3),t.JRh(e.staticText.amountPerBotPerMonth),t.R7$(3),t.R50("ngModel",e.planSnapshot.pricingOptions.price),t.Y8G("placeholder",e.staticText.placeholders.enterAmountBotPerMonth),t.R7$(4),t.JRh(e.staticText.cancel),t.R7$(),t.Y8G("ngClass",t.eq3(12,bt,e.validPlan())),t.R7$(),t.JRh("edit"===e.planSnapshot.mode?e.staticText.upgradeChanges:e.staticText.addCharges)}}function Pt(a,r){if(1&a){const e=t.RV6();t.j41(0,"div",36)(1,"button",37),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.isChargesBox=!0)}),t.EFF(2),t.k0s()()}if(2&a){const e=t.XpG();t.R7$(2),t.SpI("+ \xa0\xa0\xa0",e.staticText.addCharges,"")}}function vt(a,r){if(1&a&&(t.j41(0,"div",18),t.EFF(1),t.nI1(2,"titlecase"),t.k0s()),2&a){const e=t.XpG().$implicit;t.R7$(),t.Lme(" ",t.bMT(2,2,e.title),": ",e.percentage,"% ")}}function Ot(a,r){if(1&a&&(t.qex(0),t.DNE(1,vt,3,4,"div",44),t.bVm()),2&a){const e=r.$implicit,i=t.XpG().$implicit;t.R7$(),t.Y8G("ngIf",e.currency===i.currency)}}function Mt(a,r){if(1&a){const e=t.RV6();t.qex(0),t.j41(1,"tr")(2,"td"),t.EFF(3),t.k0s(),t.j41(4,"td")(5,"span",38),t.EFF(6),t.k0s()(),t.j41(7,"td"),t.EFF(8),t.k0s(),t.j41(9,"td",39)(10,"mat-slide-toggle",40),t.bIt("change",function(){const n=t.eBV(e).$implicit,o=t.XpG();return t.Njj(o.changePlanStatus(n))}),t.k0s()(),t.j41(11,"td"),t.DNE(12,Ot,2,1,"ng-container",15),t.k0s(),t.j41(13,"td",41)(14,"div")(15,"span",42),t.bIt("click",function(){const n=t.eBV(e).$implicit,o=t.XpG();return t.Njj(o.editExistingPlan(n))}),t.EFF(16," edit "),t.k0s(),t.j41(17,"span",43),t.bIt("click",function(){const n=t.eBV(e).$implicit,o=t.XpG();return o.openDeleteModal=!0,t.Njj(o.planData=n)}),t.EFF(18," delete "),t.k0s()()()(),t.bVm()}if(2&a){const e=r.$implicit,i=r.index,n=t.XpG();t.R7$(3),t.JRh(i+1),t.R7$(3),t.JRh(e.currency),t.R7$(2),t.JRh(e.price),t.R7$(2),t.Y8G("checked","ACTIVE"===e.status),t.R7$(2),t.Y8G("ngForOf",n.taxes)}}let yt=(()=>{class a{constructor(e,i,n){this.plansService=e,this.sharedService=i,this.languageService=n,this.taxes=[],this.isChargesBox=!1,this.openDeleteModal=!1,this.currencyDropdown=!1,this.currencies=[],this.staticText=n.getStaticText().whitelabel.charges,this.closePopups$=this.sharedService.closePopups.subscribe(()=>{this.currencyDropdown=!1})}ngOnInit(){this.setSnapShot(),this.getPlans(),this.getCurrencies()}ngOnDestroy(){this.closePopups$?.unsubscribe()}getCurrencies(){fetch("/assets/currency.json").then(e=>e.json()).then(e=>{this.currencies=Object.keys(e)}).catch(console.log)}setSnapShot(e={mode:"add",pricingOptions:{price:10,currency:"INR"}}){this.planSnapshot=e}getPlans(){this.sharedService.loader("start"),this.plansService.getWhiteLabelAddOnPlans().then(e=>{this.plans=e||[],this.taxes=e?.charges||[]}).catch(e=>{this.sharedService.showToast("error","",e||"Could not get WhiteLabel Plans, Please try again later")}).finally(()=>this.sharedService.loader("stop"))}addNewPlan(){let e=[];
1if(e=[...this.plans.pricingOptions||[],this.planSnapshot.pricingOptions||[]],(this.plans.pricingOptions||[]).some(i=>i.currency===this.planSnapshot.pricingOptions.currency))return this.sharedService.showToast("error","","WhiteLabel Charge Already Exists For This Currency");this.sharedService.loader("start"),this.plansService.addWhiteLabelAddOnPlan({pricingOptions:e}).then(i=>{this.sharedService.showToast("success","","Add On Created Successfully"),this.plans.pricingOptions=i.pricingOptions,this.taxes=i?.charges||[],this.isChargesBox=!1,this.setSnapShot()}).catch(i=>{this.sharedService.showToast("error","",i||"Could not Add Plan")}).finally(()=>this.sharedService.loader("stop"))}editExistingPlan(e){this.isChargesBox=!0,this.pricingOption=e,this.planSnapshot={mode:"edit",pricingOptions:{price:e.price,currency:e.currency}}}saveExistingPlan(){const{price:e,currency:i}=this.planSnapshot.pricingOptions;this.pricingOption={...this.pricingOption,price:e,currency:i};const n=this.plans.pricingOptions;n.map(o=>{o._id===this.pricingOption._id&&(o.price=this.pricingOption.price,o.currency=this.pricingOption.currency)}),this.sharedService.loader("start"),this.plansService.addWhiteLabelAddOnPlan({pricingOptions:n}).then(o=>{this.plans.pricingOptions=n,this.sharedService.showToast("success","","Add On Updated Successfully"),this.isChargesBox=!1,this.setSnapShot()}).catch(o=>{this.sharedService.showToast("error","",o||o.message||"Could not Update Plan")}).finally(()=>this.sharedService.loader("stop"))}deletePlan(e){if(this.openDeleteModal=!1,e){const i=this.plans.pricingOptions.filter(n=>n._id!==this.planData._id);this.sharedService.loader("start"),this.plansService.addWhiteLabelAddOnPlan({pricingOptions:i}).then(n=>{this.plans.pricingOptions=i,this.sharedService.showToast("success","","Add On Deleted Successfully")}).catch(n=>{this.sharedService.showToast("error","",n||"Could not Delete Add-on")}).finally(()=>this.sharedService.loader("stop"))}}changePlanStatus(e){let i="";i="ACTIVE"===e.status?"INACTIVE":"ACTIVE",this.sharedService.loader("start"),this.plansService.changewhiteLabelAddOnStatus(e._id,i).then(n=>{this.sharedService.showToast("success","","Status updated Successfully")}).catch(n=>{this.sharedService.showToast("error","",n||"Could not update status")}).finally(()=>this.sharedService.loader("stop"))}search(e){const i=e.target.value.toLowerCase();$("table tbody tr").filter(function(){$(this).toggle($(this).text().toLowerCase().indexOf(i)>-1)})}validPlan(){return!(!this.planSnapshot.pricingOptions.currency||!this.planSnapshot.pricingOptions.price)}static#t=this.\u0275fac=function(i){return new(i||a)(t.rXU(x.U),t.rXU(u.d),t.rXU(_.g))};static#e=this.\u0275cmp=t.VBU({type:a,selectors:[["app-charges"]],decls:31,vars:16,consts:[[3,"userInput","title","description","showModal"],[1,"mt-4"],[1,"sub-heading","text-align-start"],["class","create-charges position-relative",4,"ngIf"],[1,"row","mt-4","mb-4","d-flex","justify-content-between","p-start-3","p-end-3"],[1,"col-6","col-sm-5","col-lg-4","p-start-0","mb-2","mb-sm-0","search-box"],["type","text",1,"bp-input-box","position-relative",3,"keyup","placeholder"],[1,"material-icons"],["appAcl","","permission","agency-charges.write","class","col-auto m-start-auto",4,"ngIf"],[1,"table-div","mt-2","tableFixHead"],["id","customer",1,"table","text-align-start"],[1,"bp-table-row"],["scope","col",1,"col-2"],["appAcl","","permission","agency-charges.write","scope","col",1,"col-3"],["appAcl","","permission","agency-charges.write||agency-charges.remove","scope","col",1,"col-3","table-style"],[4,"ngFor","ngForOf"],[1,"create-charges","position-relative"],[1,"col-12","col-md-10"],[1,"row"],[1,"col-12","col-sm-6","col-lg-4","position-relative","mb-3"],["for","monthlyMessages",1,"input-box-label"],[1,"required"],[1,"bp-input-box","position-relative","p-0"],[1,"selected-option-box",3,"click"],["src","/assets/version2/images/sidebar/arrow_drop_down_black.svg","alt","",1,"drop-down-arrow",3,"ngClass"],[1,"position-relative"],["class","select-box-dropdown",4,"ngIf"],[1,"position-relative","col-12","col-sm-6","col-lg-6","bp-input-parent"],["for","name",1,"label-text"],["required","","type","number",1,"bp-input-box",3,"ngModelChange","ngModel","placeholder"],[1,"add-customer-div"],[1,"add-btn","d-flex"],[1,"bp-disable-btn","m-end-3",3,"click"],[1,"add-customer-btn",3,"click","ngClass"],[1,"select-box-dropdown"],[1,"options-box",3,"click"],["appAcl","","permission","agency-charges.write",1,"col-auto","m-start-auto"],[1,"bp-primary-btn","add-member-button",3,"click"],[1,"text-capitalize"],["appAcl","","permission","agency-charges.write"],[1,"m-end-2","mt-2",3,"change","checked"],["appAcl","","permission","agency-charges.write||agency-charges.remove",1,"table-style","td-actions-container"],["appAcl","","permission","agency-charges.write",1,"material-icons","edit-member-btn",3,"click"],["appAcl","","permission","agency-charges.remove",1,"material-icons","delete-member-btn",3,"click"],["class","row",4,"ngIf"]],template:function(i,n){1&i&&(t.j41(0,"app-modal",0),t.bIt("userInput",function(s){return n.deletePlan(s)}),t.k0s(),t.j41(1,"section",1)(2,"h2"),t.EFF(3),t.k0s(),t.j41(4,"p",2),t.EFF(5),t.k0s(),t.DNE(6,Ct,26,14,"div",3),t.j41(7,"div",4)(8,"div",5)(9,"input",6),t.bIt("keyup",function(s){return n.search(s)}),t.k0s(),t.j41(10,"span",7),t.EFF(11," search "),t.k0s()(),t.DNE(12,Pt,3,1,"div",8),t.k0s(),t.j41(13,"div",9)(14,"table",10)(15,"thead")(16,"tr",11)(17,"th",12),t.EFF(18),t.k0s(),t.j41(19,"th",12),t.EFF(20),t.k0s(),t.j41(21,"th",12),t.EFF(22),t.k0s(),t.j41(23,"th",13),t.EFF(24),t.k0s(),t.j41(25,"th",12),t.EFF(26),t.k0s(),t.j41(27,"th",14),t.EFF(28),t.k0s()()(),t.j41(29,"tbody"),t.DNE(30,Mt,19,5,"ng-container",15),t.k0s()()()()),2&i&&(t.Y8G("title",n.staticText.modal.deleteCharges)("description",n.staticText.modal.wantToDeleteThisCharge)("showModal",n.openDeleteModal),t.R7$(3),t.JRh(n.staticText.addWhitelabelCharges),t.R7$(2),t.JRh(n.staticText.checkoutExistingCharges),t.R7$(),t.Y8G("ngIf",n.isChargesBox),t.R7$(3),t.Y8G("placeholder",n.staticText.placeholders.searchByCurrency),t.R7$(3),t.Y8G("ngIf",!n.isChargesBox),t.R7$(6),t.JRh(n.staticText.serialNumber),t.R7$(2),t.JRh(n.staticText.currency),t.R7$(2),t.JRh(n.staticText.amountPerBotPerMonth),t.R7$(2),t.JRh(n.staticText.action),t.R7$(2),t.JRh(n.staticText.taxes),t.R7$(2),t.JRh(n.staticText.action),t.R7$(2),t.Y8G("ngForOf",(null==n.plans?null:n.plans.pricingOptions)||t.lJ4(15,ut)))},dependencies:[g.YU,g.Sq,g.bT,b.z,k.sG,d.me,d.Q0,d.BC,d.YS,d.vS,f.Y,g.PV],styles:["h1[_ngcontent-%COMP%]{font-size:1.5rem;font-family:Matter-Bold;margin-bottom:0rem}h2[_ngcontent-%COMP%]{font-size:1.25rem;font-family:Matter-Bold}.sub-heading[_ngcontent-%COMP%]{color:#999;font-size:14px;font-family:Matter-Regular}.required[_ngcontent-%COMP%]{color:red;font-size:16px}.create-charges[_ngcontent-%COMP%]{border:1px solid #ccc;padding:15px .5rem;border-radius:5px}.selected-option-box[_ngcontent-%COMP%]{font-family:Matter-Regular;text-transform:capitalize;color:#333;width:100%;height:100%;border:none;padding:.5rem 1rem;text-align:start;cursor:pointer;border-color:#ccc;background-color:#dfe1e4}.drop-down-arrow[_ngcontent-%COMP%]{position:absolute;inset-inline-end:2%;top:8%;width:30px;transform:rotate(0);transition:.5s}.drop-down-arrow-active[_ngcontent-%COMP%]{transform:rotate(180deg);transition:.5s}.select-box-dropdown[_ngcontent-%COMP%]{max-height:200px;position:absolute;margin-top:3%;padding:3%;width:100%;z-index:13;background-color:#fff;border-radius:5px;font-family:Matter-Regular;overflow-y:scroll;box-shadow:0 0 10px #00000029}.options-box[_ngcontent-%COMP%]{display:flex!important;font-family:Matter-Regular;color:#333;font-size:small;padding:.5rem;cursor:pointer;border-radius:5px}.options-box[_ngcontent-%COMP%]:hover{background-color:#f3f4f5}.search-box[_ngcontent-%COMP%]   .bp-input-box[_ngcontent-%COMP%]{padding-inline-start:30px}.search-box[_ngcontent-%COMP%]   .material-icons[_ngcontent-%COMP%]{position:absolute;inset-inline-start:8px;top:8px;font-size:22px;color:#666}.edit-member-btn[_ngcontent-%COMP%]{color:#226cf4;font-size:20px;padding:4px;background-color:#f3f4f5;border-radius:7px;cursor:pointer}.delete-member-btn[_ngcontent-%COMP%]{color:#aa263f;font-size:20px;background-color:#f9d9dc;border-radius:7px;margin-inline-start:5px;cursor:pointer;padding:4px}.add-customer-div[_ngcontent-%COMP%]{margin-top:1rem}.add-customer-div[_ngcontent-%COMP%]   .add-customer-btn[_ngcontent-%COMP%]{display:flex;background-color:#dfe1e4;color:#999;padding:.35rem .75rem;font-size:14px;border-radius:3px;align-items:center;border:1px solid #ccc}.add-customer-div[_ngcontent-%COMP%]   .add-customer-btn-valid[_ngcontent-%COMP%]{display:flex;background-color:#226cf4;color:#fff;padding:.35rem .75rem;font-size:14px;border-radius:3px;align-items:center;border:1px solid #ccc}.add-customer-div[_ngcontent-%COMP%]   .add-customer-active[_ngcontent-%COMP%]{background-color:#118cfc!important;color:#fff!important;border:none!important}.add-customer-div[_ngcontent-%COMP%]   .add-customer[_ngcontent-%COMP%]{font-size:16px;margin-inline-end:4px}.bp-disable-btn[_ngcontent-%COMP%]{width:100px;margin-inline-start:auto}.pricing-icon-box[_ngcontent-%COMP%]{color:#226cf4;font-size:24px;background:#f3f4f5;cursor:pointer}.table-style[_ngcontent-%COMP%]{text-align:center}.tableFixHead[_ngcontent-%COMP%]{overflow:auto;height:70vh}.tableFixHead[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{position:sticky;z-index:3;top:-1px}.table[_ngcontent-%COMP%]{border-inline-start:1px solid #F3F4F5;border-inline-end:1px solid #F3F4F5;font-size:15px}.table[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{background-color:#f3f4f5}.table[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{vertical-align:center}.table[_ngcontent-%COMP%]   td.td-actions-container[_ngcontent-%COMP%]{min-width:100px}.table[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{border-bottom:1px solid #fff;border-top:1px solid #fff;border-inline-start:none;border-inline-end:none}.table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%], .table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{border-bottom:2px solid #F3F4F5}"]})}return a})();const kt=()=>[],S=a=>({"drop-down-arrow-active":a}),wt=a=>({"add-customer-btn-valid":a});function St(a,r){if(1&a){const e=t.RV6();t.qex(0),t.j41(1,"div",37),t.bIt("click",function(){const n=t.eBV(e).$implicit,o=t.XpG(3);return o.chargeSnapshot.applicableOn=n,t.Njj(o.applicableDropdown=!1)}),t.j41(2,"span"),t.EFF(3),t.k0s()(),t.bVm()}if(2&a){const e=r.$implicit;t.R7$(3),t.JRh(e)}}function Tt(a,r){if(1&a&&(t.j41(0,"div",36),t.DNE(1,St,4,1,"ng-container",15),t.k0s()),2&a){const e=t.XpG(2);t.R7$(),t.Y8G("ngForOf",e.applicableText)}}function Ft(a,r){if(1&a){const e=t.RV6();t.qex(0),t.j41(1,"div",37),t.bIt("click",function(){const n=t.eBV(e).$implicit,o=t.XpG(3);return o.chargeSnapshot.currency=n,t.Njj(o.currencyDropdown=!1)}),t.j41(2,"span"),t.EFF(3),t.k0s()(),t.bVm()}if(2&a){const e=r.$implicit;t.R7$(3),t.JRh(e)}}function Rt(a,r){if(1&a&&(t.j41(0,"div",36),t.DNE(1,Ft,4,1,"ng-container",15),t.k0s()),2&a){const e=t.XpG(2);t.R7$(),t.Y8G("ngForOf",e.currencies)}}function jt(a,r){if(1&a){const e=t.RV6();t.j41(0,"div",16)(1,"div",17)(2,"div",18)(3,"div",19)(4,"label",20),t.EFF(5),t.j41(6,"span",21),t.EFF(7,"*"),t.k0s()(),t.j41(8,"input",22),t.mxI("ngModelChange",function(n){t.eBV(e);const o=t.XpG();return t.DH7(o.chargeSnapshot.title,n)||(o.chargeSnapshot.title=n),t.Njj(n)}),t.k0s()(),t.j41(9,"div",23)(10,"label",24),t.EFF(11),t.j41(12,"span",21),t.EFF(13,"*"),t.k0s()(),t.j41(14,"div",25)(15,"button",26),t.bIt("click",function(n){t.eBV(e);const o=t.XpG();return o.applicableDropdown=!o.applicableDropdown,t.Njj(n.stopPropagation())}),t.EFF(16),t.k0s(),t.nrm(17,"img",27),t.k0s(),t.j41(18,"div",28),t.DNE(19,Tt,2,1,"div",29),t.k0s()(),t.j41(20,"div",23)(21,"label",24),t.EFF(22," Select Currency"),t.j41(23,"span",21),t.EFF(24,"*"),t.k0s()(),t.j41(25,"div",25)(26,"button",26),t.bIt("click",function(n){t.eBV(e);const o=t.XpG();return o.currencyDropdown=!o.currencyDropdown,t.Njj(n.stopPropagation())}),t.EFF(27),t.k0s(),t.nrm(28,"img",27),t.k0s(),t.j41(29,"div",28),t.DNE(30,Rt,2,1,"div",29),t.k0s()(),t.j41(31,"div",19)(32,"label",30),t.EFF(33),t.j41(34,"span",21),t.EFF(35,"*"),t.k0s()(),t.j41(36,"input",31),t.mxI("ngModelChange",function(n){t.eBV(e);const o=t.XpG();return t.DH7(o.chargeSnapshot.percentage,n)||(o.chargeSnapshot.percentage=n),t.Njj(n)}),t.k0s()()()(),t.j41(37,"div",32)(38,"div",33)(39,"button",34),t.bIt("click",function(){t.eBV(e);const n=t.XpG();
1return n.isTaxesBox=!1,t.Njj(n.setSnapShot())}),t.EFF(40),t.k0s(),t.j41(41,"button",35),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj("edit"===n.chargeSnapshot.mode?n.saveExistingCharge():n.addNewCharge())}),t.EFF(42),t.k0s()()()()}if(2&a){const e=t.XpG();t.R7$(5),t.JRh(e.staticText.taxName),t.R7$(3),t.R50("ngModel",e.chargeSnapshot.title),t.Y8G("placeholder",e.staticText.placeholders.taxName),t.R7$(3),t.SpI(" ",e.staticText.applicableOn,""),t.R7$(5),t.SpI(" ",e.chargeSnapshot.applicableOn?e.chargeSnapshot.applicableOn:e.staticText.choosePlans," "),t.R7$(),t.Y8G("ngClass",t.eq3(16,S,e.applicableDropdown)),t.R7$(2),t.Y8G("ngIf",e.applicableDropdown),t.R7$(8),t.SpI(" ",e.chargeSnapshot.currency?e.chargeSnapshot.currency:e.staticText.chooseCurrency," "),t.R7$(),t.Y8G("ngClass",t.eq3(18,S,e.currencyDropdown)),t.R7$(2),t.Y8G("ngIf",e.currencyDropdown),t.R7$(3),t.JRh(e.staticText.percentage),t.R7$(3),t.R50("ngModel",e.chargeSnapshot.percentage),t.Y8G("placeholder",e.staticText.placeholders.taxPercentage),t.R7$(4),t.JRh(e.staticText.cancel),t.R7$(),t.Y8G("ngClass",t.eq3(20,wt,e.validPlan())),t.R7$(),t.SpI(" ","edit"===e.chargeSnapshot.mode?e.staticText.updateTaxes:e.staticText.addTaxes," ")}}function $t(a,r){if(1&a){const e=t.RV6();t.j41(0,"div",38)(1,"button",39),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.isTaxesBox=!0)}),t.EFF(2),t.k0s()()}if(2&a){const e=t.XpG();t.R7$(2),t.SpI("+ \xa0\xa0\xa0",e.staticText.addTaxes,"")}}function Et(a,r){if(1&a){const e=t.RV6();t.qex(0),t.j41(1,"tr")(2,"td"),t.EFF(3),t.k0s(),t.j41(4,"td")(5,"span",40),t.EFF(6),t.k0s()(),t.j41(7,"td"),t.EFF(8),t.k0s(),t.j41(9,"td"),t.EFF(10),t.k0s(),t.j41(11,"td"),t.EFF(12),t.k0s(),t.j41(13,"td",41)(14,"div")(15,"span",42),t.bIt("click",function(){const n=t.eBV(e).$implicit,o=t.XpG();return o.isTaxesBox=!0,t.Njj(o.modifyExistingCharge(n))}),t.EFF(16," edit "),t.k0s(),t.j41(17,"span",43),t.bIt("click",function(){const n=t.eBV(e).$implicit,o=t.XpG();return o.openDeleteModal=!0,t.Njj(o.taxData=n)}),t.EFF(18," delete "),t.k0s()()()(),t.bVm()}if(2&a){const e=r.$implicit,i=r.index;t.R7$(3),t.JRh(i+1),t.R7$(3),t.JRh(e.title),t.R7$(2),t.JRh(e.percentage),t.R7$(2),t.JRh(e.currency),t.R7$(2),t.JRh(e.applicableOn)}}let Dt=(()=>{class a{constructor(e,i,n){this.plansService=e,this.sharedService=i,this.languageService=n,this.chargesList=[],this.isTaxesBox=!1,this.openDeleteModal=!1,this.currencyDropdown=!1,this.applicableDropdown=!1,this.currencies=[],this.applicableText=["add-ons","whitelabels","whatsapp"],this.staticText=n.getStaticText().whitelabel.taxesConfiguration,this.closePopups$=this.sharedService.closePopups.subscribe(()=>{this.currencyDropdown=!1,this.applicableDropdown=!1})}ngOnInit(){this.setSnapShot(),this.getCharges(),this.getCurrencies()}ngOnDestroy(){this.closePopups$?.unsubscribe()}setSnapShot(e={mode:"add",title:"",applicableOn:"add-ons",percentage:10,currency:"INR"}){this.chargeSnapshot=e}getCurrencies(){fetch("/assets/currency.json").then(e=>e.json()).then(e=>{this.currencies=Object.keys(e)}).catch(console.log)}getCharges(){this.sharedService.loader("start"),this.plansService.getCustomCharges().then(e=>{this.chargesList=e}).catch(e=>{this.sharedService.showToast("error","",e?.message||"Could not get Charges, Please Try Again Later")}).finally(()=>this.sharedService.loader("stop"))}addNewCharge(){const{currency:e,applicableOn:i,title:n,percentage:o}=this.chargeSnapshot;o>100?this.sharedService.showToast("warning","","Percentage should be less than 100"):""===n?this.sharedService.showToast("warning","","Tax Name cannot be empty"):(this.sharedService.loader("start"),this.plansService.addCustomCharges({currency:e,applicableOn:i,title:n,percentage:o}).then(s=>{this.chargesList.push({currency:e,applicableOn:i,title:n,percentage:o,_id:s._id}),this.sharedService.showToast("success","","Charge Created Successfully"),this.isTaxesBox=!1,this.setSnapShot()}).catch(s=>{this.sharedService.showToast("error","",s.message||"Something went wrong, Please try again later")}).finally(()=>this.sharedService.loader("stop")))}modifyExistingCharge(e){this.chargeSnapshot={mode:"edit",...e}}saveExistingCharge(){const{_id:e,title:i,currency:n,percentage:o}=this.chargeSnapshot;this.sharedService.loader("start"),this.plansService.updateCustomCharge(String(e),{title:i,currency:n,percentage:o}).then(s=>{this.chargesList.map(c=>{c._id===e&&(c.title=i,c.currency=n,c.percentage=o)}),this.sharedService.showToast("success","","Charge updated Successfully"),this.isTaxesBox=!1,this.setSnapShot()}).catch(s=>{this.sharedService.showToast("error","",s.message||"Could not Update Charge")}
1).finally(()=>this.sharedService.loader("stop"))}deleteExistingCharge(e){this.openDeleteModal=!1,e&&(this.sharedService.loader("start"),this.plansService.deleteCustomCharge(this.taxData._id).then(i=>{this.chargesList=this.chargesList.filter(n=>n._id!==this.taxData._id),this.sharedService.showToast("success","","Charge Deleted Successfully")}).catch(i=>{this.sharedService.showToast("error","",i||i.message||"Could not Delete Charge")}).finally(()=>this.sharedService.loader("stop")))}search(e){const i=e.target.value.toLowerCase();$("table tbody tr").filter(function(){$(this).toggle($(this).text().toLowerCase().indexOf(i)>-1)})}validPlan(){return!!(this.chargeSnapshot.title&&this.chargeSnapshot.applicableOn&&this.chargeSnapshot.currency&&this.chargeSnapshot.percentage)}static#t=this.\u0275fac=function(i){return new(i||a)(t.rXU(x.U),t.rXU(u.d),t.rXU(_.g))};static#e=this.\u0275cmp=t.VBU({type:a,selectors:[["app-taxes-configuration"]],decls:31,vars:16,consts:[[3,"userInput","title","description","showModal"],[1,"mt-4"],[1,"sub-heading","text-align-start"],["class","create-charges position-relative",4,"ngIf"],[1,"row","mt-4","mb-4","d-flex","justify-content-between","p-start-3","p-end-3"],[1,"col-6","col-sm-5","col-lg-4","p-start-0","mb-2","mb-sm-0","m-end-1","search-box"],["type","text",1,"bp-input-box","position-relative",3,"keyup","placeholder"],[1,"material-icons"],["appAcl","","permission","agency-charges.write","class","col-auto m-start-auto",4,"ngIf"],[1,"table-div","mt-2","tableFixHead"],["id","customer",1,"table","text-align-start"],[1,"bp-table-row"],["scope","col",1,"col-2"],["scope","col",1,"col-3"],["appAcl","","permission","agency-charges.write||agency-charges.remove","scope","col",1,"col-3","table-style"],[4,"ngFor","ngForOf"],[1,"create-charges","position-relative"],[1,"col-12","col-md-10"],[1,"row"],[1,"position-relative","col-12","col-sm-6","col-lg-4","bp-input-parent"],["for","name",1,"label-text"],[1,"required"],["required","","type","text",1,"bp-input-box",3,"ngModelChange","ngModel","placeholder"],[1,"col-12","col-sm-6","col-lg-4","position-relative","mb-3"],["for","monthlyMessages",1,"input-box-label"],[1,"bp-input-box","position-relative","p-0"],[1,"selected-option-box",3,"click"],["src","/assets/version2/images/sidebar/arrow_drop_down_black.svg","alt","",1,"drop-down-arrow",3,"ngClass"],[1,"position-relative"],["class","select-box-dropdown",4,"ngIf"],["for","percentage",1,"label-text"],["required","","name","percentage","maxlength","2","type","text",1,"bp-input-box",3,"ngModelChange","ngModel","placeholder"],[1,"add-customer-div"],[1,"add-btn","d-flex"],[1,"bp-disable-btn","m-end-3",3,"click"],[1,"add-customer-btn",3,"click","ngClass"],[1,"select-box-dropdown"],[1,"options-box",3,"click"],["appAcl","","permission","agency-charges.write",1,"col-auto","m-start-auto"],[1,"bp-primary-btn","add-member-button",3,"click"],[1,"text-capitalize"],["appAcl","","permission","agency-charges.write||agency-charges.remove",1,"table-style","td-actions-container"],["appAcl","","permission","agency-charges.write",1,"material-icons","edit-member-btn",3,"click"],["appAcl","","permission","agency-charges.remove",1,"material-icons","delete-member-btn",3,"click"]],template:function(i,n){1&i&&(t.j41(0,"app-modal",0),t.bIt("userInput",function(s){return n.deleteExistingCharge(s)}),t.k0s(),t.j41(1,"section",1)(2,"h2"),t.EFF(3),t.k0s(),t.j41(4,"p",2),t.EFF(5),t.k0s(),t.DNE(6,jt,43,22,"div",3),t.j41(7,"div",4)(8,"div",5)(9,"input",6),t.bIt("keyup",function(s){return n.search(s)}),t.k0s(),t.j41(10,"span",7),t.EFF(11," search "),t.k0s()(),t.DNE(12,$t,3,1,"div",8),t.k0s(),t.j41(13,"div",9)(14,"table",10)(15,"thead")(16,"tr",11)(17,"th",12),t.EFF(18),t.k0s(),t.j41(19,"th",12),t.EFF(20),t.k0s(),t.j41(21,"th",12),t.EFF(22),t.k0s(),t.j41(23,"th",13),t.EFF(24),t.k0s(),t.j41(25,"th",12),t.EFF(26),t.k0s(),t.j41(27,"th",14),t.EFF(28),t.k0s()()(),t.j41(29,"tbody"),t.DNE(30,Et,19,5,"ng-container",15),t.k0s()()()()),2&i&&(t.Y8G("title",n.staticText.modal.deleteTaxes)("description",n.staticText.wantToDeleteThisTax)("showModal",n.openDeleteModal),t.R7$(3),t.JRh(n.staticText.addTaxes),t.R7$(2),t.JRh(n.staticText.checkoutExistingTaxes),t.R7$(),t.Y8G("ngIf",n.isTaxesBox),t.R7$(3),t.Y8G("placeholder",n.staticText.placeholders.searchByCurrency),t.R7$(3),t.Y8G("ngIf",!n.isTaxesBox),t.R7$(6),t.JRh(n.staticText.serialNumber),t.R7$(2),t.JRh(n.staticText.name),t.R7$(2),t.JRh(n.staticText.percentage),t.R7$(2),t.JRh(n.staticText.currency),t.R7$(2),t.JRh(n.staticText.applicableOn),t.R7$(2),t.JRh(n.staticText.actions),t.R7$(2),t.Y8G("ngForOf",n.chargesList||t.lJ4(15,kt)))},dependencies:[g.YU,g.Sq,g.bT,b.z,d.me,d.BC,d.YS,d.tU,d.vS,f.Y],styles:["h1[_ngcontent-%COMP%]{font-size:1.5rem;font-family:Matter-Bold;margin-bottom:0rem}h2[_ngcontent-%COMP%]{font-size:1.25rem;font-family:Matter-Bold}.sub-heading[_ngcontent-%COMP%]{color:#999;font-size:14px;font-family:Matter-Regular}.required[_ngcontent-%COMP%]{color:red;font-size:16px}.create-charges[_ngcontent-%COMP%]{border:1px solid #ccc;padding:15px .5rem;border-radius:5px}.selected-option-box[_ngcontent-%COMP%]{font-family:Matter-Regular;text-transform:capitalize;color:#333;width:100%;height:100%;border:none;padding:.5rem 1rem;text-align:start;cursor:pointer;border-color:#ccc;background-color:#dfe1e4}.drop-down-arrow[_ngcontent-%COMP%]{position:absolute;inset-inline-end:2%;top:8%;width:30px;transform:rotate(0);transition:.5s}.drop-down-arrow-active[_ngcontent-%COMP%]{transform:rotate(180deg);transition:.5s}.select-box-dropdown[_ngcontent-%COMP%]{position:absolute;margin-top:3%;padding:3%;width:100%;height:150px;z-index:13;background-color:#fff;border-radius:5px;font-family:Matter-Regular;overflow:auto;box-shadow:0 0 10px #00000029}.options-box[_ngcontent-%COMP%]{display:flex!important;font-family:Matter-Regular;color:#333;font-size:small;padding:.5rem;cursor:pointer;border-radius:5px}.options-box[_ngcontent-%COMP%]:hover{background-color:#f3f4f5}.search-box[_ngcontent-%COMP%]   .bp-input-box[_ngcontent-%COMP%]{padding-inline-start:30px}.search-box[_ngcontent-%COMP%]   .material-icons[_ngcontent-%COMP%]{position:absolute;inset-inline-start:8px;top:8px;font-size:22px;color:#666}.bp-disable-btn[_ngcontent-%COMP%]{width:100px;margin-inline-start:auto}.col-10[_ngcontent-%COMP%]{max-width:80%}.edit-member-btn[_ngcontent-%COMP%]{color:#226cf4;font-size:20px;padding:4px;background-color:#f3f4f5;border-radius:7px;cursor:pointer}.delete-member-btn[_ngcontent-%COMP%]{color:#aa263f;font-size:20px;background-color:#f9d9dc;border-radius:7px;margin-inline-start:5px;cursor:pointer;padding:4px}.add-customer-div[_ngcontent-%COMP%]{margin-top:1rem}.add-customer-div[_ngcontent-%COMP%]   .add-customer-btn[_ngcontent-%COMP%]{display:flex;background-color:#dfe1e4;color:#999;padding:.35rem .75rem;font-size:14px;border-radius:3px;align-items:center;border:1px solid #ccc}.add-customer-div[_ngcontent-%COMP%]   .add-customer-btn-valid[_ngcontent-%COMP%]{display:flex;background-color:#226cf4;color:#fff;padding:.35rem .75rem;font-size:14px;border-radius:3px;align-items:center;border:1px solid #ccc}.add-customer-div[_ngcontent-%COMP%]   .add-customer-active[_ngcontent-%COMP%]{background-color:#118cfc!important;color:#fff!important;border:none!important}.add-customer-div[_ngcontent-%COMP%]   .add-customer[_ngcontent-%COMP%]{font-size:16px;margin-inline-end:4px}.pricing-icon-box[_ngcontent-%COMP%]{color:#226cf4;font-size:24px;background:#f3f4f5;cursor:pointer}.table-style[_ngcontent-%COMP%]{text-align:center}.tableFixHead[_ngcontent-%COMP%]{overflow:auto;height:70vh}.tableFixHead[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{position:sticky;z-index:3;top:-1px}.table[_ngcontent-%COMP%]{border-inline-start:1px solid #F3F4F5;border-inline-end:1px solid #F3F4F5;font-size:15px}.table[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{background-color:#f3f4f5}.table[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{vertical-align:center}.table[_ngcontent-%COMP%]   td.td-actions-container[_ngcontent-%COMP%]{min-width:100px}.table[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{border-bottom:1px solid #fff;border-top:1px solid #fff;border-inline-start:none;border-inline-end:none}.table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%], .table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{border-bottom:2px solid #F3F4F5}"]})}return a})();const It=["closeButton"],T=a=>({"drop-down-arrow-active":a}),Gt=a=>({"add-customer-btn-valid":a});function Nt(a,r){if(1&a){const e=t.RV6();t.j41(0,"div",49)(1,"div",50),t.bIt("click",function(){t.eBV(e);const n=t.XpG(2);return n.planSnapshot.name="baby",t.Njj(n.planDropDown=!1)}),t.j41(2,"span"),t.EFF(3),t.k0s()(),t.j41(4,"div",50),t.bIt("click",function(){t.eBV(e);const n=t.XpG(2);return n.planSnapshot.name="king",t.Njj(n.planDropDown=!1)}),t.j41(5,"span"),t.EFF(6),t.k0s()()()}if(2&a){const e=t.XpG(2);t.R7$(3),t.JRh(e.staticText.baby),t.R7$(3),t.JRh(e.staticText.king)}}function At(a,r){if(1&a){const e=t.RV6();t.j41(0,"div")(1,"mat-checkbox",57),t.bIt("change",function(){const n=t.eBV(e).$implicit,o=t.XpG(4);return t.Njj(o.changeCurrency(n))}),t.EFF(2),t.k0s()()}if(2&a){const e=r.$implicit,i=t.XpG(4);t.R7$(),t.Y8G("checked",i.selectedCurrencies.includes(e)),t.R7$(),t.JRh(e)}}function Lt(a,r){if(1&a){const e=t.RV6();t.j41(0,"div",56),t.bIt("click",function(n){return t.eBV(e),t.Njj(n.stopPropagation())}),t.j41(1,"div",49),t.DNE(2,At,3,2,"div",14),t.k0s()()}if(2&a){const e=t.XpG(3);t.R7$(2),t.Y8G("ngForOf",e.availableCurrencies)}}function Vt(a,r){if(1&a){const e=t.RV6();t.j41(0,"div",51)(1,"label",28),t.EFF(2),t.j41(3,"span",29),t.EFF(4,"*"),t.k0s(),t.nrm(5,"app-tooltip",30),t.k0s(),t.j41(6,"div",52),t.bIt("click",function(n){t.eBV(e);const o=t.XpG(2);return o.showDropDown=!o.showDropDown,n.stopPropagation(),t.Njj(n.preventDefault())}),t.j41(7,"button",53),t.EFF(8),t.k0s(),t.nrm(9,"img",54),t.k0s(),t.j41(10,"div",34),t.DNE(11,Lt,3,1,"div",55),t.k0s()()}if(2&a){const e=t.XpG(2);t.R7$(2),t.SpI(" ",e.staticText.setCurrency,""),t.R7$(3),t.Y8G("message",e.staticText.appTooltip.selectYourPreferredCurrencies),t.R7$(3),t.SpI(" ",e.staticText.select," "),t.R7$(),t.Y8G("ngClass",t.eq3(5,T,e.showDropDown)),t.R7$(2),t.Y8G("ngIf",e.showDropDown)}}function Bt(a,r){if(1&a){const e=t.RV6();t.qex(0),t.j41(1,"div",58)(2,"div",59)(3,"label",37),t.EFF(4),t.k0s(),t.j41(5,"input",60),t.mxI("ngModelChange",function(n){const o=t.eBV(e).$implicit;
1return t.DH7(o.price,n)||(o.price=n),t.Njj(n)}),t.bIt("keypress",function(n){t.eBV(e);const o=t.XpG(2);return t.Njj(o.validateNumber(n))}),t.k0s()(),t.j41(6,"div",59)(7,"label",37),t.EFF(8),t.k0s(),t.nrm(9,"input",61),t.k0s()(),t.bVm()}if(2&a){const e=r.$implicit,i=t.XpG(2);t.R7$(4),t.Lme("",e.currency,"",i.staticText.perMonth,""),t.R7$(),t.R50("ngModel",e.price),t.R7$(3),t.Lme("",e.currency,"",i.staticText.perYear,""),t.R7$(),t.FS9("value",10*e.price)}}function Yt(a,r){if(1&a){const e=t.RV6();t.j41(0,"div",24)(1,"div",25)(2,"div",26)(3,"div",27)(4,"label",28),t.EFF(5),t.j41(6,"span",29),t.EFF(7,"*"),t.k0s(),t.nrm(8,"app-tooltip",30),t.k0s(),t.j41(9,"div",31)(10,"button",32),t.bIt("click",function(n){t.eBV(e);const o=t.XpG();return o.planDropDown=!o.planDropDown,t.Njj(n.stopPropagation())}),t.EFF(11),t.k0s(),t.nrm(12,"img",33),t.k0s(),t.j41(13,"div",34),t.DNE(14,Nt,7,2,"div",35),t.k0s()(),t.j41(15,"div",36)(16,"label",37),t.EFF(17),t.j41(18,"span",29),t.EFF(19,"*"),t.k0s(),t.nrm(20,"app-tooltip",38),t.k0s(),t.j41(21,"input",39),t.mxI("ngModelChange",function(n){t.eBV(e);const o=t.XpG();return t.DH7(o.planSnapshot.primaryLimit,n)||(o.planSnapshot.primaryLimit=n),t.Njj(n)}),t.bIt("keypress",function(n){t.eBV(e);const o=t.XpG();return t.Njj(o.validateNumber(n))}),t.k0s(),t.nrm(22,"img",40)(23,"img",41),t.j41(24,"div",42),t.EFF(25),t.k0s()(),t.j41(26,"div",36)(27,"label",37),t.EFF(28),t.nrm(29,"app-tooltip",38),t.k0s(),t.j41(30,"input",43),t.mxI("ngModelChange",function(n){t.eBV(e);const o=t.XpG();return t.DH7(o.planSnapshot.displayName,n)||(o.planSnapshot.displayName=n),t.Njj(n)}),t.k0s(),t.nrm(31,"img",40)(32,"img",41),t.k0s(),t.DNE(33,Vt,12,7,"div",44),t.k0s(),t.DNE(34,Bt,10,6,"ng-container",14),t.k0s(),t.j41(35,"div",45)(36,"div",46)(37,"button",47),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.showCustomer=!1)}),t.EFF(38),t.k0s(),t.j41(39,"button",48),t.bIt("change",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.validPlan())})("click",function(){t.eBV(e);const n=t.XpG();return t.Njj("edit"===n.planSnapshot.mode?n.saveExistingPlan():n.addNewPlan())}),t.EFF(40),t.k0s()()()()}if(2&a){const e=t.XpG();t.R7$(5),t.SpI(" ",e.staticText.choosePlan,""),t.R7$(3),t.Y8G("message",e.staticText.appTooltip.chooseYourPlanType),t.R7$(2),t.Y8G("disabled","edit"===e.planSnapshot.mode),t.R7$(),t.SpI(" ","baby"===e.planSnapshot.name?e.staticText.baby:"king"===e.planSnapshot.name?e.staticText.king:e.staticText.selectPlan," "),t.R7$(),t.Y8G("ngClass",t.eq3(20,T,e.planDropDown)),t.R7$(2),t.Y8G("ngIf",e.planDropDown),t.R7$(3),t.JRh(e.staticText.messageLimit),t.R7$(3),t.Y8G("message",e.staticText.appTooltip.typeMessageLimitForCustomer),t.R7$(),t.R50("ngModel",e.planSnapshot.primaryLimit),t.Y8G("placeholder",e.staticText.placeholders.enterMessageLimit),t.R7$(4),t.JRh(e.staticText.enterAValidMessageLimit),t.R7$(3),t.SpI("",e.staticText.displayName," "),t.R7$(),t.Y8G("message",e.staticText.appTooltip.pleaseInputYourPlanDisplayName),t.R7$(),t.R50("ngModel",e.planSnapshot.displayName),t.Y8G("placeholder",e.staticText.placeholders.enterDisplayName),t.R7$(3),t.Y8G("ngIf",e.planSnapshot.primaryLimit),t.R7$(),t.Y8G("ngForOf",e.inputplanSnapshot),t.R7$(4),t.JRh(e.staticText.cancel),t.R7$(),t.Y8G("ngClass",t.eq3(22,Gt,e.validPlan())),t.R7$(),t.JRh("edit"===e.planSnapshot.mode?e.staticText.updatePlan:e.staticText.addPlan)}}function Xt(a,r){if(1&a){const e=t.RV6();t.j41(0,"div",62)(1,"button",63),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return n.showCustomer=!0,t.Njj(n.setSnapShot())}),t.EFF(2),t.k0s()()}if(2&a){const e=t.XpG();t.R7$(2),t.SpI("+ \xa0\xa0\xa0",e.staticText.addPlan,"")}}function Jt(a,r){if(1&a){const e=t.RV6();t.qex(0),t.j41(1,"tr")(2,"td"),t.EFF(3),t.k0s(),t.j41(4,"td")(5,"span",64),t.EFF(6),t.k0s()(),t.j41(7,"td"),t.EFF(8),t.k0s(),t.j41(9,"td"),t.EFF(10),t.k0s(),t.j41(11,"td")(12,"span",65),t.bIt("click",function(){const n=t.eBV(e).index,o=t.XpG();return t.Njj(o.selectedIndex=n)}),t.EFF(13," description "),t.k0s()(),t.j41(14,"td",66)(15,"div")(16,"span",67),t.bIt("click",function(){const n=t.eBV(e).$implicit,o=t.XpG();return o.editExistingPlan(n),o.showCustomer=!0,t.Njj("edit"===o.planSnapshot.mode)}),t.EFF(17," edit "),t.k0s(),t.j41(18,"span",68),t.bIt("click",function(){const n=t.eBV(e).$implicit,o=t.XpG();return o.planData=n,t.Njj(o.initiateDelete())}),t.EFF(19," delete "),t.k0s()()()(),t.bVm()}if(2&a){const e=r.$implicit,i=r.index;t.R7$(3),t.JRh(i+1),t.R7$(3),t.JRh(e.name),t.R7$(2),t.JRh(e.primaryLimit),t.R7$(2),t.JRh(e.displayName)}}function zt(a,r){if(1&a&&(t.j41(0,"div")(1,"div",69),t.EFF(2),t.k0s(),t.j41(3,"div",70)(4,"div",71)(5,"label"),t.EFF(6),t.k0s(),t.nrm(7,"input",72),t.k0s(),t.j41(8,"div",73)(9,"label"),t.EFF(10),t.k0s(),t.nrm(11,"input",72),t.k0s()()()),2&a){const e=r.$implicit,i=t.XpG();t.R7$(2),t.JRh(e.currency),t.R7$(4),t.JRh(i.staticText.perMonthText),t.R7$(),t.Y8G("value",e.price),t.R7$(3),t.JRh(i.staticText.perYearText),t.R7$(),t.FS9("value",10*e.price)}}const Wt=[{path:"",component:mt,children:[{path:"",redirectTo:"plans",pathMatch:"full"},{path:"plans",component:V},{path:"whatsapp-plans",component:(()=>{class a{onClick(e){this.showDropDown=!1}constructor(e,i,n){this.plansService=e,this.sharedService=i,this.languageService=n,this.price=100,this.groupedPlanList=[],this.showCustomer=!1,this.showDropDown=!1,this.planDropDown=!1,this.selectedCurrencies=[],this.openDeleteModal=!1,this.availableCurrencies=[],this.allPlanOptions=[],this.inputplanSnapshot=[],this.staticText=n.getStaticText().whitelabel.whatsappPlans,this.closePopups$=this.sharedService.closePopups.subscribe(()=>{this.planDropDown=!1})}ngOnInit(){this.setSnapShot(),this.getPlans(),this.getCurrencies()}ngOnDestroy(){this.closePopups$?.unsubscribe()}getCurrencies(){fetch("/assets/currency.json").then(e=>e.json()).then(e=>{this.availableCurrencies=Object.keys(e)}).catch(console.log)}setSnapShot(e={mode:"add",name:"king",primaryLimit:2e3,pricingOptions:[]}){this.planSnapshot=e,this.planSnapshot.pricingOptions=[{currency:localStorage.getItem("original-default-currency")||"USD",price:100,primaryLimit:e.primaryLimit}],this.inputplanSnapshot=this.planSnapshot.pricingOptions,this.selectedCurrencies=[localStorage.getItem("original-default-currency")||"USD"]}changeCurrency(e){let i=!1;this.selectedCurrencies.includes(e)?(this.selectedCurrencies=this.selectedCurrencies.filter(n=>n!==e),i=!1):(this.selectedCurrencies.push(e),i=!0),i?this.inputplanSnapshot.push({currency:e,price:100,primaryLimit:this.planSnapshot.primaryLimit}):this.inputplanSnapshot=this.inputplanSnapshot.filter(n=>n.currency!==e)}getPlans(){var e=this;return(0,v.A)(function*(){e.allPlanOptions=[],e.sharedService.loader("start");try{const i=yield e.plansService.getWhatsappPlansForAgency();e.groupedPlanList=JSON.parse(JSON.stringify(i.map(o=>({...o,uuid:(0,O.A)()}))));for(const o of i)o.pricingOptions&&o.pricingOptions.length>0&&e.allPlanOptions.push(...o.pricingOptions.map(s=>({...s,primaryLimit:o.primaryLimit,name:o.name})));let n=1/0;for(const o of i)"king"===o.name&&o.primaryLimit<n&&(n=o.primaryLimit,e.kingPlanWithMinMessagesLimit=o.primaryLimit)}catch{e.sharedService.showToast("error","","Could not get Plans, Please try again later")}
1finally{e.sharedService.loader("stop")}})()}addNewPlan(){if(!this.validPlanFormData())return;const{name:e,primaryLimit:i,displayName:n}=this.planSnapshot;this.planSnapshot.pricingOptions=this.inputplanSnapshot.map(c=>({...c,primaryLimit:Number(i),price:"baby"===e?0:Number(c.price)}));const o=[];for(const c of this.groupedPlanList)c.name===this.planSnapshot.name&&c.uuid!==this.planSnapshot.uuid&&o.push(...c.pricingOptions.map(l=>({...l,primaryLimit:c.primaryLimit})));const s={name:e,featureAvailability:[],pricing:{whatsapp:{displayName:(n||"").trim(),pricingOptions:[...this.planSnapshot.pricingOptions||[],...o]}}};this.sharedService.loader("start"),this.plansService.updateAgencyWhatsappPricingOptions(s).then(c=>(this.groupedPlanList=c,this.showCustomer=!1,this.getPlans(),this.setSnapShot(),this.sharedService.showToast("success","","Plan Created Successfully"))).catch(c=>{this.sharedService.showToast("error","",c||c.message||"Please check all details, and try again.")}).finally(()=>this.sharedService.loader("stop"))}selectedSnapShot(e){"edit"!==this.planSnapshot.mode?(this.planSnapshot.pricingOptions=[{currency:localStorage.getItem("original-default-currency")||"USD",price:100,primaryLimit:this.planSnapshot.primaryLimit}],this.inputplanSnapshot=JSON.parse(JSON.stringify(this.planSnapshot.pricingOptions))):this.inputplanSnapshot=JSON.parse(JSON.stringify(e.pricingOptions))}editExistingPlan(e){this.selectedCurrencies=[],e.pricingOptions.map(i=>{this.selectedCurrencies.push(i.currency)}),this.planSnapshot={mode:"edit",name:e.name,primaryLimit:e.primaryLimit,pricingOptions:e.pricingOptions,displayName:e?.displayName||"",uuid:e.uuid},this.selectedSnapShot(e),this.showCustomer=!0,this.planSnapshot.mode="edit",h.sortedUniq(this.selectedCurrencies),this.previousLimit=e.primaryLimit}saveExistingPlan(){if(this.planSnapshot.pricingOptions=this.inputplanSnapshot.map(n=>({...n,primaryLimit:Number(this.planSnapshot.primaryLimit),price:"baby"===this.planSnapshot.name?0:Number(n.price)})),!this.validPlanFormData(this.planSnapshot.uuid))return;const e=[];for(const n of this.groupedPlanList)n.name===this.planSnapshot.name&&n.uuid!==this.planSnapshot.uuid&&e.push(...n.pricingOptions.map(o=>({...o,primaryLimit:n.primaryLimit})));const i={name:this.planSnapshot.name,featureAvailability:[],pricing:{whatsapp:{pricingOptions:[...this.planSnapshot.pricingOptions||[],...e],displayName:(this.planSnapshot?.displayName||"").trim()}}};this.sharedService.loader("start"),this.plansService.updateAgencyWhatsappPricingOptions(i).then(n=>{this.sharedService.showToast("success","","Plan Updated Successfully"),this.showCustomer=!1,this.setSnapShot(),this.getPlans()}).catch(n=>{this.sharedService.showToast("error","",n)}).finally(()=>this.sharedService.loader("stop"))}initiateDelete(){this.deleteDescription="baby"===this.planData.name?this.staticText.modal.wantToDeleteThisBabyPlan:this.staticText.modal.areYouSureYouWantToDeleteThisPlan,this.openDeleteModal=!0}deletePlan(e){if(this.openDeleteModal=!1,e){if(this.groupedPlanList.filter(s=>s.name===this.planData.name).length<=1&&"king"===this.planData.name)return this.sharedService.showToast("error","",`Atleast 1 ${this.planData.name} plan Should Be There`);const n=[];for(const s of this.groupedPlanList)s.name===this.planData.name&&s.uuid!==this.planData.uuid&&n.push(...s.pricingOptions.map(c=>({...c,primaryLimit:s.primaryLimit})));const o={name:this.planData.name,featureAvailability:[],pricing:{whatsapp:{displayName:this.planData?.displayName||"",pricingOptions:n}}};this.sharedService.loader("start"),this.plansService.updateAgencyWhatsappPricingOptions(o).then(s=>{this.sharedService.showToast("success","","Plan Deleted Successfully"),this.getPlans()}).catch(s=>{this.sharedService.showToast("error","",s?.message||"Could not Delete Plan, Please Try Again Later")}).finally(()=>this.sharedService.loader("stop"))}}search(e){const i=e.target.value.toLowerCase();$("table tbody tr").filter(function(){$(this).toggle($(this).text().toLowerCase().indexOf(i)>-1)})}validPlan(){return this.planSnapshot.name&&this.planSnapshot.primaryLimit&&this.planSnapshot.pricingOptions}validPlanFormData(e=""){const{name:i,pricingOptions:n,primaryLimit:o}=this.planSnapshot,s=(this.groupedPlanList||[]).find(l=>"baby"===l.name&&l.uuid!==e),c=(this.groupedPlanList||[]).find(l=>l.primaryLimit===o&&l.uuid!==e);return(n||[]).length?s&&"baby"===i?(this.sharedService.showToast("error","","Only 1 baby plan can be added"),!1):"baby"===i&&(n||[]).some(l=>l.price&&0!==Number(l.price))?(this.sharedService.showToast("warning","","Baby plan must have 0 price"),!1):"king"===i&&(n||[]).some(l=>!l.price||0===Number(l.price))?(this.sharedService.showToast("warning","","King plan must be greater than 0 price"),!1):o?Number(o)<=0?(this.sharedService.showToast("warning","","Conversation limit must be greater than 0"),!1):c?(this.sharedService.showToast("error","",`Plan with ${o} conversation already exists`),!1):"baby"===this.planSnapshot.name&&(this.planSnapshot.primaryLimit||0)>=this.kingPlanWithMinMessagesLimit?(this.sharedService.showToast("warning","","Conversation limit must be lesser than smallest king plan"),!1):!(s&&"king"===i&&o<=s?.primaryLimit&&(this.sharedService.showToast("warning","","Conversation Limit must be greater than baby plan"),1)):(this.sharedService.showToast("warning","","Conversation limit can't be empty"),!1):(this.sharedService.showToast("warning","","Atleast add one currency."),!1)}validateNumber(e){const i=e.which?e.which:e.keyCode;return!(i>31&&(i<48||i>57))}static#t=this.\u0275fac=function(i){return new(i||a)(t.rXU(x.U),t.rXU(u.d),t.rXU(_.g))};static#e=this.\u0275cmp=t.VBU({type:a,selectors:[["app-whatsapp-plans"]],viewQuery:function(i,n){if(1&i&&t.GBs(It,5),2&i){let o;t.mGM(o=t.lsd())&&(n.closeButton=o.first)}},hostBindings:function(i,n){1&i&&t.bIt("click",function(s){return n.onClick(s)},!1,t.EBC)}
1,decls:44,vars:19,consts:[[3,"userInput","title","description","showModal"],[1,"mt-4"],[1,"sub-heading","text-align-start"],["class","create-customer position-relative",4,"ngIf"],[1,"row","mt-4","mb-4","d-flex","justify-content-between"],[1,"col-6","col-sm-5","col-lg-4","p-start-0","mb-2","mb-sm-0","search-box"],["type","text",1,"bp-input-box","position-relative",3,"keyup","placeholder"],[1,"material-icons"],["appAcl","","permission","agency-plans.write","class","col-auto m-start-auto",4,"ngIf"],[1,"table-div","mt-2","tableFixHead"],["id","customer",1,"table","text-align-start"],[1,"bp-table-row"],["scope","col",1,"col-2"],["appAcl","","permission","agency-plans.write||agency-plans.remove","scope","col",1,"col-3"],[4,"ngFor","ngForOf"],["id","openWhatsAppPricingModal","tabindex","-1","role","dialog","aria-hidden","true",1,"modal","fade"],["role","document",1,"modal-dialog","modal-dialog-centered",2,"min-width","750px","border-radius","10px"],[1,"modal-content"],[1,"modal-header","justify-content-between","mb-2"],["id","exampleModalLongTitle",1,"modal-title"],["type","button","aria-label","Close","data-bs-dismiss","modal",1,"close","border-0","bg-transparent","p-0"],["aria-hidden","true"],["width","40","src","assets/version2/icons/closebutton.svg"],[1,"modal-body"],[1,"create-customer","position-relative"],[1,"col-12","col-md-10"],[1,"row"],[1,"col-12","col-sm-6","col-lg-4","position-relative","mb-3"],["for","monthlyMessages",1,"input-box-label"],[1,"required"],[1,"position-absolute","mt-1",3,"message"],[1,"bp-input-box","position-relative","p-0"],[1,"selected-option-box",3,"click","disabled"],["src","/assets/version2/images/sidebar/arrow_drop_down_black.svg","alt","",1,"drop-down-arrow",3,"ngClass"],[1,"position-relative"],["class","select-box-dropdown",4,"ngIf"],[1,"position-relative","col-12","col-sm-6","col-lg-4"],["for","name",1,"label-text"],[1,"position-absolute",3,"message"],["required","","name","bp-email","type","text",1,"bp-input-box",3,"ngModelChange","keypress","ngModel","placeholder"],["src","/assets/version2/icons/valid_input_icon.svg","alt","",1,"error-message","position-absolute"],["src","/assets/version2/icons/error_input_icon.svg","alt","",1,"error-message","position-absolute"],[1,"error-text"],["required","","name","bp-email","type","text",1,"bp-input-box",3,"ngModelChange","ngModel","placeholder"],["class","col-12 col-sm-6 col-lg-4 position-relative",4,"ngIf"],[1,"add-customer-div"],[1,"add-btn","d-flex"],[1,"bp-disable-btn","m-end-3",3,"click"],[1,"add-customer-btn",3,"change","click","ngClass"],[1,"select-box-dropdown"],[1,"options-box",3,"click"],[1,"col-12","col-sm-6","col-lg-4","position-relative"],[1,"bp-input-box","position-relative","p-0",3,"click"],[1,"selected-option-box"],["src","/assets/version2/images/sidebar/arrow_drop_down_black.svg","alt","",1,"drop-down-arrow","cursor-pointer",3,"ngClass"],[3,"click",4,"ngIf"],[3,"click"],[1,"currency-checkbox",3,"change","checked"],[1,"row","mt-3"],[1,"position-relative","col-12","col-sm-6","col-lg-4","bp-input-parent"],["name","price","type","text","required","",1,"bp-input-box",3,"ngModelChange","keypress","ngModel"],["name","price","type","number","disabled","",1,"bp-input-box","disabled",2,"background-color","#DFE1E4","cursor","not-allowed",3,"value"],["appAcl","","permission","agency-plans.write",1,"col-auto","m-start-auto"],[1,"bp-primary-btn","add-member-button",3,"click"],[1,"text-capitalize"],["data-bs-toggle","modal","data-bs-target","#openWhatsAppPricingModal",1,"material-icons","pricing-icon-box",3,"click"],["appAcl","","permission","agency-plans.write||agency-plans.remove",1,"table-style","td-actions-container"],["appAcl","","permission","agency-plans.write",1,"material-icons","edit-member-btn",3,"click"],["appAcl","","permission","agency-plans.remove",1,"material-icons","delete-member-btn",3,"click"],[1,"mb-2","currency-title"],[1,"d-flex","justify-content-between","inputs-container"],[1,"mb-3"],["readonly","","disabled","","type","text",1,"bp-input-box",3,"value"],[1,"m-start-0"]],template:function(i,n){1&i&&(t.j41(0,"app-modal",0),t.bIt("userInput",function(s){return n.deletePlan(s)}),t.k0s(),t.j41(1,"div")(2,"section",1)(3,"h2"),t.EFF(4),t.k0s(),t.j41(5,"p",2),t.EFF(6),t.k0s(),t.DNE(7,Yt,41,24,"div",3),t.k0s(),t.j41(8,"div",4)(9,"div",5)(10,"input",6),t.bIt("keyup",function(s){return n.search(s)}),t.k0s(),t.j41(11,"span",7),t.EFF(12," search "),t.k0s()(),t.DNE(13,Xt,3,1,"div",8),t.k0s(),t.j41(14,"div",9)(15,"table",10)(16,"thead")(17,"tr",11)(18,"th",12),t.EFF(19),t.k0s(),t.j41(20,"th",12),t.EFF(21),t.k0s(),t.j41(22,"th",12),t.EFF(23),t.k0s(),t.j41(24,"th",12),t.EFF(25),t.k0s(),t.j41(26,"th",12),t.EFF(27),t.k0s(),t.j41(28,"th",13),t.EFF(29),t.k0s()()(),t.j41(30,"tbody"),t.DNE(31,Jt,20,4,"ng-container",14),t.k0s()()()(),t.j41(32,"div",15)(33,"div",16)(34,"div",17)(35,"div",18)(36,"h5",19),t.EFF(37),t.nI1(38,"titlecase"),t.k0s(),t.j41(39,"button",20)(40,"span",21),t.nrm(41,"img",22),t.k0s()()(),t.j41(42,"div",23),t.DNE(43,zt,12,5,"div",14),t.k0s()()()()),2&i&&(t.FS9("description",n.deleteDescription),t.Y8G("title",n.staticText.modal.deletePlan)("showModal",n.openDeleteModal),t.R7$(4),t.JRh(n.staticText.createNewPlans),t.R7$(2),t.JRh(n.staticText.checkoutYourCurrentAndNe
1wPlans),t.R7$(),t.Y8G("ngIf",n.showCustomer),t.R7$(3),t.Y8G("placeholder",n.staticText.placeholders.searchByPlanName),t.R7$(3),t.Y8G("ngIf",!n.showCustomer),t.R7$(6),t.JRh(n.staticText.serialNumber),t.R7$(2),t.JRh(n.staticText.plan),t.R7$(2),t.JRh(n.staticText.messages),t.R7$(2),t.JRh(n.staticText.displayName),t.R7$(2),t.JRh(n.staticText.pricing),t.R7$(2),t.SpI(" ",n.staticText.actions,""),t.R7$(2),t.Y8G("ngForOf",n.groupedPlanList),t.R7$(6),t.JRh(t.bMT(38,17,null==n.groupedPlanList[n.selectedIndex]?null:n.groupedPlanList[n.selectedIndex].name)+" Plan"),t.R7$(6),t.Y8G("ngForOf",null==n.groupedPlanList[n.selectedIndex]?null:n.groupedPlanList[n.selectedIndex].pricingOptions))},dependencies:[g.YU,g.Sq,g.bT,b.z,M.b,d.me,d.BC,d.YS,d.vS,C.So,f.Y,g.PV],styles:["h1[_ngcontent-%COMP%]{font-size:1.5rem;font-family:Matter-Bold;margin-bottom:0rem}h2[_ngcontent-%COMP%]{font-size:1.25rem;font-family:Matter-Bold}.sub-heading[_ngcontent-%COMP%]{color:#999;font-size:14px;font-family:Matter-Regular}.hr-section[_ngcontent-%COMP%]{margin:1.5rem 0rem}.tableFixHead[_ngcontent-%COMP%]{overflow:auto;height:70vh}.tableHeight[_ngcontent-%COMP%]{height:39vh}.tableFix[_ngcontent-%COMP%]{height:34vh}.tableFixHead[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{position:sticky;z-index:3;top:-1px}.bp-table-row[_ngcontent-%COMP%]{--bs-table-bg: #F3F4F5;background-color:#f3f4f5;line-height:20px;font-family:Matter-Regular}.table[_ngcontent-%COMP%]{border-inline-start:1px solid #F3F4F5;border-inline-end:1px solid #F3F4F5;font-size:15px}.table[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{background-color:#f3f4f5}.table[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{vertical-align:center}.table[_ngcontent-%COMP%]   td.td-actions-container[_ngcontent-%COMP%]{min-width:100px}.table[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{border-bottom:1px solid #fff;border-top:1px solid #fff;border-inline-start:none;border-inline-end:none}.table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%], .table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{border-bottom:2px solid #F3F4F5}.col-10[_ngcontent-%COMP%]{max-width:80%}.edit-member-btn[_ngcontent-%COMP%]{color:#226cf4;font-size:20px;padding:4px;background-color:#f3f4f5;border-radius:7px;cursor:pointer}.delete-member-btn[_ngcontent-%COMP%]{color:#aa263f;font-size:20px;background-color:#f9d9dc;border-radius:7px;margin-inline-start:5px;cursor:pointer;padding:4px}.create-customer[_ngcontent-%COMP%]{border:1px solid #ccc;padding:30px .5rem;border-radius:5px}.add-customer-div[_ngcontent-%COMP%]{margin-top:1rem}.add-customer-div[_ngcontent-%COMP%]   .add-customer-btn[_ngcontent-%COMP%]{display:flex;background-color:#dfe1e4;color:#999;padding:.35rem .75rem;font-size:14px;border-radius:3px;align-items:center;border:1px solid #ccc}.add-customer-div[_ngcontent-%COMP%]   .add-customer-btn-valid[_ngcontent-%COMP%]{display:flex;background-color:#226cf4;color:#fff;padding:.35rem .75rem;font-size:14px;border-radius:3px;align-items:center;border:1px solid #ccc}.add-customer-div[_ngcontent-%COMP%]   .add-customer-active[_ngcontent-%COMP%]{background-color:#118cfc!important;color:#fff!important;border:none!important}.add-customer-div[_ngcontent-%COMP%]   .add-customer[_ngcontent-%COMP%]{font-size:16px;margin-inline-end:4px}.bp-disable-btn[_ngcontent-%COMP%]{width:100px;margin-inline-start:auto}.pricing-icon-box[_ngcontent-%COMP%]{color:#226cf4;font-size:24px;background:#f3f4f5;cursor:pointer}.search-box[_ngcontent-%COMP%]   .bp-input-box[_ngcontent-%COMP%]{padding-inline-start:30px}.search-box[_ngcontent-%COMP%]   .material-icons[_ngcontent-%COMP%]{position:absolute;inset-inline-start:8px;top:8px;font-size:22px;color:#666}.lead-filter-section[_ngcontent-%COMP%]{margin-top:30px;margin-bottom:20px}.col[_ngcontent-%COMP%]{border:1px solid #DDDEDF}.row[_ngcontent-%COMP%]{margin-inline-start:0px;margin-inline-end:0px}.filter-btn[_ngcontent-%COMP%]{width:120px;display:flex;justify-content:center;align-items:center;padding:4px 0!important;background-color:#f3f4f5;color:gray;font-size:14px}.filter-box-btn[_ngcontent-%COMP%]{margin-inline-end:5px;margin-inline-start:5px;position:relative}.filter-box-btn[_ngcontent-%COMP%]   .filter-div-btn[_ngcontent-%COMP%]{padding:5px 13px 5px 30px;height:38px;border:1px solid rgba(204,204,204,.8);font-family:Matter-Regular}.filter-main-box[_ngcontent-%COMP%]{position:absolute;height:300px;width:300px;background-color:#fff;inset-inline-end:0;
1top:43px;border-radius:5px;padding:11px;z-index:16;box-shadow:0 1px 3px #00000005,1px 1px 2px 2px #0000001a}.filter-main-box[_ngcontent-%COMP%]   .filter-sub-head[_ngcontent-%COMP%]{font-size:16px}.filter-main-box[_ngcontent-%COMP%]   .filter_dropdown[_ngcontent-%COMP%]{position:absolute;background-color:#fff;box-shadow:#32325d40 0 2px 5px -1px,#0000004d 0 1px 3px -1px;top:133px;inset-inline-end:69px;width:280px;z-index:1;border-radius:3px}.filter-main-box[_ngcontent-%COMP%]   .filter-btn-platform[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:space-between;align-items:center;padding:5px 12px!important;background-color:#f3f4f5;color:gray;font-size:14px;border:1px solid gainsboro}.filter-main-box[_ngcontent-%COMP%]   .dropdown-list[_ngcontent-%COMP%]{box-shadow:#32325d40 0 2px 5px -1px,#0000004d 0 1px 3px -1px;z-index:1;position:absolute;width:max-content;margin-inline-end:79px}.filter-main-box[_ngcontent-%COMP%]   .list-bot[_ngcontent-%COMP%]{width:93%!important}.filter-main-box[_ngcontent-%COMP%]   .inner-dropdown-list[_ngcontent-%COMP%]{background-color:#fff;text-align:center}.filter-main-box[_ngcontent-%COMP%]   .innerDropdownList[_ngcontent-%COMP%]{overflow-y:auto;max-height:350px}.filter-main-box[_ngcontent-%COMP%]   .list-item[_ngcontent-%COMP%]{display:flex;justify-content:flex-start;align-items:center;padding:2px 9px;font-size:14px;margin:4px 0}.filter-main-box[_ngcontent-%COMP%]   .list-item[_ngcontent-%COMP%]:hover{background-color:#f3f4f5;cursor:pointer}.filter-main-box[_ngcontent-%COMP%]   .filter-apply-btn[_ngcontent-%COMP%]{margin-top:18px;justify-content:space-between}.filter-main-box[_ngcontent-%COMP%]   .bp-disable-btn[_ngcontent-%COMP%]{width:130px}.filter-main-box[_ngcontent-%COMP%]   .bp-primary-btn[_ngcontent-%COMP%]{width:130px;min-width:130px!important}
1.bot-platform-name[_ngcontent-%COMP%]{position:absolute;inset-inline-start:2px}.bot-platform-text[_ngcontent-%COMP%]{padding:7px;padding-inline-start:20px;padding-inline-end:20px;color:#3da144;background-color:#d0f0d2;border-radius:25px}.active-li[_ngcontent-%COMP%]{border:1px solid #3573F4;background-color:#dae0fd}.active-a[_ngcontent-%COMP%]{color:#3573f4}.inbox-disable-btn[_ngcontent-%COMP%]{padding:5px 25px;font-size:14px;font-family:Matter-Regular;color:#666;background-color:#f3f4f5;border-radius:3px;border:none;resize:none;outline:none}.filter-section-btn[_ngcontent-%COMP%]{margin-inline-end:5px;margin-inline-start:5px}.search-icon[_ngcontent-%COMP%]{top:8px;inset-inline-start:6px;color:#999;direction:inherit}.filter-icon[_ngcontent-%COMP%]{cursor:pointer;position:absolute;top:1px;font-size:21px;color:#999;direction:inherit}.search-bar[_ngcontent-%COMP%]{padding:13px!important;padding-inline-start:35px!important}.div-height[_ngcontent-%COMP%]{height:190px}.load-more[_ngcontent-%COMP%]{background-color:#e2e6ea;border-color:#dae0e5}.customer-name[_ngcontent-%COMP%]{color:#118cfc;cursor:pointer;font-family:Matter-Regular;font-weight:500}.add-customer-button[_ngcontent-%COMP%]{background-color:#fff;color:#226cf4;border:1px solid #226CF4}.label-text[_ngcontent-%COMP%]{font-family:Matter-Regular;color:#333;font-size:14px}.required[_ngcontent-%COMP%]{color:red;font-size:16px}.selected-option-box[_ngcontent-%COMP%]{font-family:Matter-Regular;text-transform:capitalize;color:#333;width:100%;height:100%;border:none;padding:.5rem 1rem;text-align:start;cursor:pointer;border-color:#ccc;background-color:#dfe1e4}.drop-down-arrow[_ngcontent-%COMP%]{position:absolute;inset-inline-end:2%;top:8%;width:30px;transform:rotate(0);transition:.5s}.drop-down-arrow-active[_ngcontent-%COMP%]{transform:rotate(180deg);transition:.5s}.select-box-dropdown[_ngcontent-%COMP%]{max-height:200px;position:absolute;margin-top:3%;padding:3%;width:100%;z-index:13;background-color:#fff;border-radius:5px;font-family:Matter-Regular;overflow-y:scroll;box-shadow:0 0 10px #00000029}.options-box[_ngcontent-%COMP%]{display:flex!important;font-family:Matter-Regular;color:#333;font-size:small;padding:.5rem;cursor:pointer;border-radius:5px}.options-box[_ngcontent-%COMP%]:hover{background-color:#f3f4f5}.currency-checkbox[_ngcontent-%COMP%]{font-family:Matter-Regular;font-size:14px}
1.filter-apply-btn[_ngcontent-%COMP%]{margin-top:18px;justify-content:space-between}.clear-btn[_ngcontent-%COMP%]{width:45%}.apply-btn[_ngcontent-%COMP%]{width:45%;min-width:45%!important}.table-td[_ngcontent-%COMP%]{padding:0rem 1rem 1rem}.modal[_ngcontent-%COMP%]   .modal-header[_ngcontent-%COMP%]{border-bottom:none}.modal[_ngcontent-%COMP%]   .modal-header[_ngcontent-%COMP%]   .close[_ngcontent-%COMP%]{position:absolute;inset-inline-end:-20px;top:-19px;color:#333;opacity:1}.modal[_ngcontent-%COMP%]   .modal-body[_ngcontent-%COMP%]   .currency-title[_ngcontent-%COMP%]{font-family:Matter-SemiBold}.modal[_ngcontent-%COMP%]   .modal-body[_ngcontent-%COMP%]   .bp-input-box[_ngcontent-%COMP%]{min-width:280px}.modal[_ngcontent-%COMP%]   .modal-footer[_ngcontent-%COMP%]{border-top:none}.modal[_ngcontent-%COMP%]   .modal-title[_ngcontent-%COMP%]{font-family:Matter-SemiBold}@media (max-width: 767px){.modal[_ngcontent-%COMP%]   .modal-dialog[_ngcontent-%COMP%]{min-width:95%!important}.modal[_ngcontent-%COMP%]   .modal-dialog[_ngcontent-%COMP%]   .modal-content[_ngcontent-%COMP%]   .modal-header[_ngcontent-%COMP%]   .close[_ngcontent-%COMP%]{inset-inline-end:-6px;top:-8px}.modal[_ngcontent-%COMP%]   .modal-dialog[_ngcontent-%COMP%]   .modal-content[_ngcontent-%COMP%]   .modal-body[_ngcontent-%COMP%]   .inputs-container[_ngcontent-%COMP%]{flex-direction:column}.modal[_ngcontent-%COMP%]   .modal-dialog[_ngcontent-%COMP%]   .modal-content[_ngcontent-%COMP%]   .modal-body[_ngcontent-%COMP%]   .inputs-container[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{display:block}.modal[_ngcontent-%COMP%]   .modal-dialog[_ngcontent-%COMP%]   .modal-content[_ngcontent-%COMP%]   .modal-body[_ngcontent-%COMP%]   .inputs-container[_ngcontent-%COMP%]   .bp-input-box[_ngcontent-%COMP%]{min-width:200
1px}}"]})}return a})()},{path:"message-addon",component:at},{path:"charges",component:yt},{path:"taxes-configuration",component:Dt}]}];let Ut=(()=>{class a{static#t=this.\u0275fac=function(i){return new(i||a)};static#e=this.\u0275mod=t.$C({type:a});static#n=this.\u0275inj=t.G2t({imports:[m.iI.forChild(Wt),m.iI]})}return a})();var Ht=p(34813);let qt=(()=>{class a{static#t=this.\u0275fac=function(i){return new(i||a)};static#e=this.\u0275mod=t.$C({type:a});static#n=this.\u0275inj=t.G2t({imports:[g.MD,Ut,Ht.G,d.YN,C.g7]})}return a})()}}]);

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.