1import {b as be}from'./chunk-CJdbuWmU.js';import {a as a$1}from'./chunk-FJQJGEUZ.js';import {u}from'./chunk-DWu0T8CW.js';import {s}from'./chunk-C-PyjSCj.js';import {e as ee,Y as Ye,$ as $e,q as qe,Z as Ze,K as Ke}from'./chunk-BYq1E87K.js';import {D,eN as Kt,E,V,v as vr,bK as P,aE as ut,e as f,a as G,bJ as V$1,bI as Gt,X as Xb,T as Tt$1,N as Ng,bt as Lg,bu as Ts,bv as Og,bw as Pg,bQ as Zs,bR as Mc,bM as Ic,bN as Gc,eU as jt$1,eV as M,a4 as XE,q as vD,aO as cD,aP as hD,b0 as _D,aX as mD,j as Xv,z as zg,w as w0,H as H0,Z as Zx,k as dn,b2 as da,cp as xr,da as wr,l as zw,bA as Nw,s as sk,n as nd,r as rC,m as wC,o as mv,aF as ta,aG as _r,aH as cv,p as GC,t as tD,u as al,cz as Wg,x as tM,y as dM,L as Lb,A as r1,P as P1,B as xS,C as Vs,F as zs,I as Fi,J as GS,K as iI,M as RI,Q as us,S as ms,Y as UI,_ as tE,$ as Dn,a0 as ME,a1 as ny,a2 as go,a3 as Kd,av as on,a5 as LT,a6 as mA,a7 as mt,aR as i_,aa as Js,ac as H_,ad as gd,ae as pS,ab as Ey,aS as Vp,bi as D_,aU as Hp,bV as zy,bW as W_,bD as db,a9 as ZT,af as XT,aV as KT,a8 as fy,ag as SC,ak as Ed,al as gS,ba as xy,aD as By,ai as dy,bS as Y_,bX as $y,bE as pb,aj as jy,ah as YT,am as JT,aT as d_,aB as ey,bf as Ny,eI as uy,bl as zg$1}from'./main-4WA6AAHG.js';import {R as Ri}from'./chunk-D46YmFa5.js';function Ot(r,s){if(r&1&&(Js(0,"div",22)(1,"mat-icon",55),H_(2,"cloud_upload"),gd(),Js(3,"p",56),H_(4),pS(5,"translate"),gd()()),r&2){d_();let e=D_(46);dy("matMenuTriggerFor",e),SC(4),jy(gS(5,2,"Click to Attach an Image"));}}function wt(r,s){if(r&1){let e=i_();Js(0,"div",23)(1,"div",57)(2,"mat-icon",10),H_(3,"image"),gd(),Js(4,"span",58),H_(5),gd()(),Js(6,"button",59),Ey("click",function(){Vp(e);let t=d_();return Hp(t.removeSelectedFile())}),Js(7,"mat-icon"),H_(8,"delete"),gd()()();}if(r&2){let e=d_();SC(5),jy(e.selectedFile.name);}}function Tt(r,s){if(r&1){let e=i_();Js(0,"div",24)(1,"div",60),fy(2,"img",61),Js(3,"div",62)(4,"span",63),H_(5),pS(6,"translate"),gd(),Js(7,"span",64),H_(8),pS(9,"translate"),gd()()(),Js(10,"button",59),Ey("click",function(){Vp(e);let t=d_();return t.templateModel.imageURL=void 0,Hp(t.templateModel.fileId=void 0)}),Js(11,"mat-icon"),H_(12,"delete"),gd()()();}if(r&2){let e=d_();SC(2),dy("src",e.templateModel.imageURL,zg$1),SC(3),jy(gS(6,3,"Current Image")),SC(3),jy(gS(9,5,"Click delete to replace"));}}function It(r,s){r&1&&(Js(0,"p",33),H_(1),pS(2,"translate"),gd()),r&2&&(SC(),jy(gS(2,1,"No buttons added. You can add up to 3 buttons.")));}function yt(r,s){if(r&1&&(Js(0,"div",70)(1,"p",71)(2,"strong"),H_(3),pS(4,"translate"),gd(),H_(5),gd()()),r&2){let e=d_().$implicit;SC(3),Ed("",gS(4,2,"Body"),":"),SC(2),Ed(" ",e.body);}}function St(r,s){if(r&1){let e=i_();Js(0,"mat-card",35)(1,"div",65),Ey("click",function(){let t=Vp(e).$index,g=d_();return Hp(g.toggleButton(t))}),Js(2,"div",57)(3,"mat-icon",28),H_(4,"smart_button"),gd(),Js(5,"span",66),H_(6),gd()(),Js(7,"div",67)(8,"span",68),H_(9),pS(10,"translate"),pS(11,"translate"),gd(),Js(12,"button",69),Ey("click",function(t){let g=Vp(e).$index;return d_().removeCard(g),Hp(t.stopPropagation())}),Js(13,"mat-icon"),H_(14,"delete"),gd()()()(),ZT(15,yt,6,4,"div",70),gd();}if(r&2){let e=s.$implicit,l=s.$index,t=d_();SC(6),jy(e.title||"Button "+(l+1)),SC(3),Ed(" ",e.type==1?gS(10,3,"Web URL"):gS(11,5,"Postback")," "),SC(6),YT(t.expandedButtons[l]?15:-1);}}function kt(r,s){if(r&1&&(Js(0,"div",82),fy(1,"div",74),Js(2,"div",75)(3,"p",76),H_(4),gd()()()),r&2){let e=d_().$implicit;SC(),Ny("background-image","url("+(e.imageURL||"assets/images/placeholder.png")+")"),SC(3),jy(e.title);}}function Et(r,s){if(r&1){let e=i_();Js(0,"div",72),Ey("click",function(){let t=Vp(e).$index,g=d_();return Hp(g.toggleCard(t))}),Js(1,"div",73)(2,"mat-icon"),H_(3,"drag_indicator"),gd()(),fy(4,"div",74),Js(5,"div",75)(6,"p",76),H_(7),gd(),Js(8,"p",77),H_(9),gd(),Js(10,"div",78)(11,"button",79),pS(12,"translate"),pS(13,"translate"),Ey("click",function(t){let g=Vp(e).$index,u=d_();return Hp(u.editCard(g,t))}),Js(14,"mat-icon"),H_(15,"edit"),gd()(),Js(16,"button",80),pS(17,"translate"),pS(18,"translate"),Ey("click",function(t){let g=Vp(e).$index;return d_().removeCard(g),Hp(t.stopPropagation())}),Js(19,"mat-icon"),H_(20,"delete"),gd()()()(),ey(21,kt,5,3,"div",81),gd();}if(r&2){let e=s.$implicit,l=d_();xy("active",l.currentElement===e),SC(4),Ny("background-image","url("+(e.imageURL||"assets/images/placeholder.png")+")"),SC(3),jy(e.title),SC(2),jy(e.subt
1itle),SC(2),dy("matTooltip",Y_(gS(12,14,"Edit"))),uy("aria-label",Y_(gS(13,16,"Edit"))),SC(5),dy("matTooltip",Y_(gS(17,18,"Delete"))),uy("aria-label",Y_(gS(18,20,"Delete")));}}function Ut(r,s){r&1&&(Js(0,"div",52)(1,"mat-icon",83),H_(2,"touch_app"),gd(),Js(3,"p",84),H_(4),pS(5,"translate"),gd()()),r&2&&(SC(4),jy(gS(5,1,"Start typing or adding cards to see the live preview here.")));}function Bt(r,s){if(r&1&&fy(0,"img",88),r&2){let e=d_(2);dy("src",e.currentElement==null?null:e.currentElement.imageURL,zg$1);}}function Ft(r,s){r&1&&(Js(0,"div",89)(1,"mat-icon",96),H_(2,"image"),gd()());}function Dt(r,s){r&1&&fy(0,"img",90);}function Lt(r,s){if(r&1&&(Js(0,"button",95),H_(1),gd()),r&2){let e=d_(2);SC(),jy(e.currentElement?.button1Title||e.buttons[0]?.title||"\u0627\u0644\u0632\u0631 \u0627\u0644\u0623\u0648\u0644");}}function Rt(r,s){if(r&1&&(Js(0,"button",95),H_(1),gd()),r&2){let e=d_(2);SC(),jy(e.currentElement?.button2Title||e.buttons[1]?.title||"\u0627\u0644\u0632\u0631 \u0627\u0644\u062B\u0627\u0646\u064A");}}function Vt(r,s){if(r&1&&(Js(0,"button",95),H_(1),gd()),r&2){let e=d_(2);SC(),jy(e.currentElement?.button3Title||e.buttons[2]?.title||"\u0627\u0644\u0632\u0631 \u0627\u0644\u062B\u0627\u0644\u062B");}}function zt(r,s){if(r&1&&(Js(0,"div",53),fy(1,"div",85),Js(2,"div",86)(3,"div",87),ZT(4,Bt,1,1,"img",88)(5,Ft,3,0,"div",89)(6,Dt,1,0,"img",90),gd(),Js(7,"div",91)(8,"h4",92),H_(9),gd(),Js(10,"p",93),H_(11),gd()(),Js(12,"div",94),ZT(13,Lt,2,1,"button",95),ZT(14,Rt,2,1,"button",95),ZT(15,Vt,2,1,"button",95),gd()()()),r&2){let e=d_();SC(4),YT(e.currentElement?.imageURL?4:e.selectedFile?5:6),SC(5),jy(e.currentElement?.title||e.templateModel.title),SC(2),jy(e.currentElement?.subtitle||e.templateModel.subtitle),SC(2),YT(e.currentElement?.button1Title||e.buttons.length>0?13:-1),SC(),YT(e.currentElement?.button2Title||e.buttons.length>1?14:-1),SC(),YT(e.currentElement?.button3Title||e.buttons.length>2?15:-1);}}function jt(r,s){if(r&1&&fy(0,"span",102),r&2){let e=s.$index,l=d_(2);xy("active",e===l.currentIndex);}}function At(r,s){if(r&1){let e=i_();Js(0,"div",54)(1,"div",97)(2,"button",98),Ey("click",function(){Vp(e);let t=d_();return Hp(t.prev())}),Js(3,"mat-icon"),H_(4,"chevron_right"),gd()(),Js(5,"div",99),XT(6,jt,1,2,"span",100,KT),gd(),Js(8,"button",101),Ey("click",function(){Vp(e);let t=d_();return Hp(t.next())}),Js(9,"mat-icon"),H_(10,"chevron_left"),gd()()()();}if(r&2){let e=d_();SC(2),dy("disabled",e.currentIndex===0),SC(4),JT(e.templateModelDto.elements),SC(2),dy("disabled",e.currentIndex===e.templateModelDto.elements.length-1);}}var qi=(()=>{class r{constructor(e,l,t,g,u,f,vt,Pt){this.dialog=e,this.loadingService=l,this.toastr=t,this.instagramService=g,this.dialogConfigService=u,this.router=f,this.route=vt,this.errorService=Pt,this.localFile=[],this.buttons=[],this.templateModelDto={elements:[]},this.templateModel={title:"",subtitle:"",imageURL:"",fileId:void 0,button1Title:"",button1Body:"",button1Type:a$1.web_url,button2Title:"",button2Body:"",button2Type:void 0,button3Title:"",button3Body:"",button3Type:void 0},this.expanded=[],this.expandedButtons=[],this.showAddCardForm=false,this.instgramFileUploadConfig={categories:["image"],multiple:false},this.editingCardIndex=null,this.buttonTypes={[a$1.web_url]:"Web URL",[a$1.Postpack]:"Postback"},this.currentIndex=0;}ngOnInit(){let e=this.route.snapshot.paramMap.get("id");if(e){let l=Number(e);this.loadingService.loadingOn(),this.instagramService.getIGTemplateById(l).subscribe({next:t=>{this.loadingService.loadingOff(),t.succeeded&&t.data?this.templateModelDto=D({},t.data):this.errorService.setError(t,"Failed to load");},error:t=>{this.loadingService.loadingOff(),this.errorService.setError(t,"Failed to load");}});}}saveTemplate(){if(!this.templateModelDto.id){this.toastr.error("Template ID is missing");return}this.loadingService.loadingOn(),this.instagramService.updateIGTemplate(this.templateModelDto).subscribe({next:e=>{this.loadingService.loadingOff(),e.succeeded?(this.toastr.success("Updated Successfully"),this.router.navigate(["/apps/instagram/templates/details",this.templateModelDto.id])):this.errorService.setError(e,"Failed to Update");},error:e=>{this.loadingService.loadingOff(),this.errorService.setError(e,"Failed to Update");}});}openFileDialog(){let e=this.dialogConfigService.getDefaultDialogConfig();this.dialog.open(Kt,D({},e)).afterClosed().subscribe(t=>{t&&this.handleSelectedFile(t);});}handleSelectedFile(e){if(!s.isImage(e.name)){this.toastr.error("\u064A\u0633\u0645\u062D \u0641\u0642\u0637 \u0628\u0627\u0644\u0635\u0648\u0631");return}this.selectedFile=e,this.imageURL=this.getFileUrl(e.fullPath);}getFileUrl(e){return encodeURI(e)}removeSelectedFile(){this.selectedFile=null,this.imageURL="";}addButton(){let e=this.dialogConfigService.getDefaultDialogConfig();this.dialog.open(be,E(D({},e),{width:"400px",data:{title:"",body:"",type:null}})).afterClosed().subscribe(t=>{t&&this.buttons.length<3&&this.buttons.push(t);});}removeButton(e){this.buttons.splice(e,1);}saveCard(e){if(e.valid){let l=this.editingCardIndex!==null;if(!l&&this.templateModelDto.elements.length>=10){this.toastr.warning("Maximum 10 cards allowed");return}this.templateModel.button1Title=this.buttons[0]?.title||"",this.templateModel.button1Body=this.buttons[0]?.body||"",this.templateModel.button1Type=this.buttons[0]?.type||a$1.web_url,this.templateModel.button2Title=this.buttons[1]?.title,this.templateModel.button2Body=this.buttons[1]?.body,this.templateModel.button2Type=this.buttons[1]?.type,this.templateModel.button3Title=this.buttons[2]?.title,this.templateModel.button3Body=this.buttons[2]?.body,this.templateModel.button3Type=this.buttons[2]?.type;let t=this.selectedFile?this.imageURL:this.templateModel.imageURL||"",g=this.selectedFile?this.selectedFile.id:this.templateModel.fileId,u=E(D({},this.templateModel),{imageURL:t,fileId:g});l?this.templateModelDto.elements[this.editingCardIndex]=u:this.templateModelDto.elements.push(u),this.cancelCardForm(),this.toastr.success(l?"Card updated successfully":"Card added successfully");}}cancelCardForm(){this.editingCardIndex=null,this.templateModel={title:"",subtitle:"",imageURL:"",fileId:void 0,button1Title:"",button1Body:"",button1Type:a$1.web_url,button2Title:"",button2Body:"",button2Type:void 0,button3Title:"",button3Body:"",button3Type:void 0},this.imageURL="",this.selectedFile=null,this.buttons=[],this.showAddCardForm=false;}removeCard(e){this.dialog.open(Ri,{data:{confirmed:true}}).afterClosed().subscribe(t=>
1{(t===true||t?.confirmed===true)&&this.confirmDeleteCard(e);});}confirmDeleteCard(e){this.templateModelDto.elements.splice(e,1),this.currentIndex>=this.templateModelDto.elements.length&&(this.currentIndex=this.templateModelDto.elements.length-1);}toggleCard(e){this.expanded[e]=!this.expanded[e];}toggleButton(e){this.expandedButtons[e]=!this.expandedButtons[e];}prev(){this.currentIndex>0&&this.currentIndex--;}next(){this.currentIndex<this.templateModelDto.elements.length-1&&this.currentIndex++;}get currentElement(){return this.templateModelDto.elements[this.currentIndex]||null}onInstgramFileUploaded(e){this.selectedFile=e,this.imageURL=this.getFileUrl(e.fullPath);}closeTemplate(){this.router.navigate(["/apps/instagram/templates"]);}editCard(e,l){l.stopPropagation(),this.editingCardIndex=e;let t=this.templateModelDto.elements[e];this.templateModel=E(D({},t),{subtitle:t.subtitle||""}),this.selectedFile=null,this.imageURL=t.imageURL||"",this.buttons=[],t.button1Title&&this.buttons.push({title:t.button1Title,body:t.button1Body||"",type:t.button1Type}),t.button2Title&&this.buttons.push({title:t.button2Title,body:t.button2Body||"",type:t.button2Type}),t.button3Title&&this.buttons.push({title:t.button3Title,body:t.button3Body||"",type:t.button3Type}),this.showAddCardForm=true,this.currentIndex=e;}drop(e){ee(this.templateModelDto.elements,e.previousIndex,e.currentIndex),this.currentElement&&(this.currentIndex=this.templateModelDto.elements.indexOf(this.currentElement));}static{this.\u0275fac=function(l){return new(l||r)(V(vr),V(P),V(ut),V(u),V(f),V(G),V(V$1),V(Gt))};}static{this.\u0275cmp=Xb({type:r,selectors:[["app-update-ig-template"]],decls:109,vars:66,consts:[["addForm","ngForm"],["title","ngModel"],["subtitle","ngModel"],["fileMenu","matMenu"],["instgramFileUploader",""],[1,"template-builder-container"],[1,"editor-side"],[1,"editor-card","cardWithShadow"],[1,"editor-header","p-b-16","b-b-1"],[1,"m-0","d-flex","align-items-center","gap-2"],["color","primary"],[1,"card-counter"],[1,"p-t-24"],["method","post","novalidate","",1,"form-layout",3,"ngSubmit"],[1,"text-inputs-section","m-b-24"],["color","primary","appearance","outline",1,"w-100","m-b-8"],["matInput","","name","title","required","","minlength","3","maxlength","80",3,"ngModelChange","ngModel","placeholder"],["align","end"],["color","primary","appearance","outline",1,"w-100"],["matInput","","name","subtitle","minlength","3","maxlength","80","required","",3,"ngModelChange","ngModel","placeholder"],[1,"upload-section","m-b-24"],[1,"f-w-600","m-b-8"],[1,"upload-dropzone","d-flex","flex-column","align-items-center","justify-content-center",3,"matMenuTriggerFor"],[1,"selected-file-card","d-flex","align-items-center","justify-content-between","p-3","bg-light","rounded"],[1,"selected-file-card","d-flex","align-items-center","justify-content-between","p-2","bg-light","rounded",2,"border","1px solid #e0e0e0"],["mat-menu-item","","type","button",3,"click"],[3,"uploaded","config"],["type","button","mat-menu-item","",3,"click"],["color","accent"],[1,"buttons-section","m-b-24"],[1,"d-flex","justify-content-between","align-items-center","m-b-16"],[1,"f-w-600","m-0"],["mat-flat-button","","color","primary","type","button",3,"click","disabled"],[1,"text-muted","f-s-14","text-center","p-3","bg-light","rounded","border-dashed"],[1,"buttons-list","d-flex","flex-column","gap-3"],[1,"button-item-card","mat-elevation-z1"],[1,"d-flex","justify-content-end","gap-3","p-t-16","b-t-1"],["mat-stroked-button","","color","warn","type","button",3,"click"],["mat-flat-button","","color","primary","type","submit",3,"disabled"],[1,"m-t-32","m-b-24"],["cdkDropList","","cdkDropListOrientation","horizontal",1,"cards-grid",3,"cdkDropListDropped"],["cdkDrag","",1,"mini-card-preview","shadow-sm",3,"active"],[1,"d-flex","justify-content-between","align-items-center","m-t-32"],["mat-stroked-button","","type","button",3,"click"],["mat-flat-button","","color","accent","type","button",1,"save-template-btn",3,"click","disabled"],[1,"preview-side"],[1,"phone-mockup"],[1,"phone-notch"],[1,"phone-header","d-flex","align-items-center","gap-2"],[1,"preview-icon"],[1,"f-w-600"],[1,"ph
1one-screen-content"],[1,"empty-state","d-flex","flex-column","align-items-center","justify-content-center","h-100","text-muted","p-4","text-center"],[1,"ig-card-wrapper","d-flex","gap-2"],[1,"phone-footer","p-3","bg-white","b-t-1"],[1,"upload-icon","text-muted"],[1,"m-t-8","m-b-0","f-w-500","text-muted"],[1,"d-flex","align-items-center","gap-2"],[1,"f-w-500","f-s-14","text-truncate",2,"max-width","200px"],["type","button","mat-icon-button","","color","warn","aria-label","delete",3,"click"],[1,"d-flex","align-items-center","gap-3"],["alt","Current Image","width","40","height","40",2,"border-radius","4px","object-fit","cover",3,"src"],[1,"d-flex","flex-column"],[1,"f-w-600","f-s-14"],[1,"text-muted","f-s-12"],[1,"p-2","d-flex","justify-content-between","align-items-center","cursor-pointer",3,"click"],[1,"f-w-500"],[1,"d-flex","align-items-center"],[1,"badge-type","m-r-8"],["mat-icon-button","","color","warn","type","button","aria-label","delete",3,"click"],[1,"button-details","p-3","b-t-1","bg-light"],[1,"m-b-4","f-s-14"],["cdkDrag","",1,"mini-card-preview","shadow-sm",3,"click"],["cdkDragHandle","",1,"drag-handle"],[1,"mini-card-img"],[1,"mini-card-content","p-2"],[1,"f-s-14","f-w-600","m-b-0","text-truncate"],[1,"f-s-12","text-muted","m-b-0","text-truncate"],[1,"d-flex","justify-content-between","align-items-center","m-t-8","p-t-8",2,"border-top","1px dashed #e0e0e0"],["mat-icon-button","","color","primary",1,"always-visible-btn",3,"click","matTooltip","aria-label"],["mat-icon-button","","color","warn",1,"always-visible-btn",3,"click","matTooltip","aria-label"],["class","mini-card-preview shadow-lg dragging-preview",4,"cdkDragPreview"],[1,"mini-card-preview","shadow-lg","dragging-preview"],[2,"font-size","48px","height","48px","width","48px","opacity","0.5"],[1,"m-t-16","f-s-14"],[1,"ig-avatar"],[1,"ig-card","shadow-sm"],[1,"ig-card-image"],["alt","Card Image",3,"src"],[1,"placeholder-img","bg-light","d-flex","justify-content-center","align-items-center","h-100"],["src","https://placehold.co/400x400/eeeeee/999999?text=Image","alt","Placeholder"],[1,"ig-card-body","p-3"],[1,"ig-title","m-b-4","f-w-600"],[1,"ig-subtitle","m-b-0","f-s-14","text-muted"],[1,"ig-card-buttons"],[1,"ig-btn"],[1,"text-muted"],[1,"d-flex","justify-content-between","align-items-center"],["mat-icon-button","","aria-label","chevron right",3,"click","disabled"],[1,"dots","d-flex","gap-1"],[1,"dot",3,"active"],["mat-icon-button","","aria-label","chevron left",3,"click","disabled"],[1,"dot"]],template:function(l,t){if(l&1){let g=i_();Js(0,"div",5)(1,"div",6)(2,"mat-card",7)(3,"mat-card-header",8)(4,"mat-card-title",9)(5,"mat-icon",10),H_(6,"add_to_photos"),gd(),H_(7),pS(8,"translate"),gd(),Js(9,"span",11),H_(10),pS(11,"translate"),gd()(),Js(12,"mat-card-content",12)(13,"form",13,0),Ey("ngSubmit",function(){Vp(g);let f=D_(14);return Hp(t.saveCard(f))}),Js(15,"div",14)(16,"mat-form-field",15)(17,"mat-label")(18,"mat-icon"),H_(19,"title"),gd(),H_(20),pS(21,"translate"),gd(),Js(22,"input",16,1),pS(24,"translate"),zy("ngModelChange",function(f){return Vp(g),W_(t.templateModel.title,f)||(t.templateModel.title=f),Hp(f)}),gd(),db(),Js(25,"mat-hint",17),H_(26),gd()(),Js(27,"mat-form-field",18)(28,"mat-label")(29,"mat-icon"),H_(30,"subtitles"),gd(),H_(31),pS(32,"translate"),gd(),Js(33,"input",19,2),pS(35,"translate"),zy("ngModelChange",function(f){return Vp(g),W_(t.templateModel.subtitle,f)||(t.templateModel.subtitle=f),Hp(f)}),gd(),db(),Js(36,"mat-hint",17),H_(37),gd()()(),Js(38,"div",20)(39,"h4",21),H_(40),pS(41,"translate"),gd(),ZT(42,Ot,6,4,"div",22)(43,wt,9,1,"div",23)(44,Tt,13,7,"div",24),Js(45,"mat-menu",null,3)(47,"button",25),Ey("click",function(){return t.openFileDialog()}),Js(48,"mat-icon",10),H_(49,"cloud"),gd(),H_(50),pS(51,"translate"),gd(),Js(52,"app-local-file-upload",26,4),Ey("uploaded",function(f){return t.onInstgramFileUploaded(f)}),Js(54,"button",27),Ey("click",function(){Vp(g);let f=D_(53);return Hp(f.open())}),Js(55,"mat-icon",28),H_(56,"computer"),gd(),Js(57,"span"),H_(58),pS(59,"translate"),gd()()()()(),Js(60,"div",29)(61,"div",30)(62,"h4",31),H_(63),pS(64,"translate"),gd(),Js(65,"button",32),Ey("click",function(){return t.addButton()}),Js(66,"mat-icon"),H_(67,"add"),gd(),H_(68),pS(69,"translate"),gd()(),ZT(70,It,3,3,"p",33),Js(71,"div",34),XT(72,St,16,7,"mat-card",35,KT),gd()(),Js(74,"div",36)(75,"button",37),Ey("click",function(){return t.cancelCardForm()}),H_(76),pS(77,"translate"),gd(),Js(78,"button",38)(79,"mat-icon"),H_(80),gd(),H_(81),pS(82,"translate"),gd()()(),f
1y(83,"mat-divider",39),Js(84,"div",40),Ey("cdkDropListDropped",function(f){return t.drop(f)}),XT(85,Et,22,22,"div",41,KT),gd(),Js(87,"div",42)(88,"button",43),Ey("click",function(){return t.closeTemplate()}),H_(89),pS(90,"translate"),gd(),Js(91,"button",44),Ey("click",function(){return t.saveTemplate()}),Js(92,"mat-icon"),H_(93,"done_all"),gd(),H_(94),pS(95,"translate"),gd()()()()(),Js(96,"div",45)(97,"div",46),fy(98,"div",47),Js(99,"div",48)(100,"mat-icon",49),H_(101,"visibility"),gd(),Js(102,"span",50),H_(103),pS(104,"translate"),gd()(),Js(105,"div",51),ZT(106,Ut,6,3,"div",52)(107,zt,16,6,"div",53),gd(),ZT(108,At,11,2,"div",54),gd()()();}if(l&2){let g=D_(14);SC(7),Ed(" ",gS(8,34,"Add New Template")," "),SC(2),xy("text-warn",t.templateModelDto.elements.length===10),SC(),By(" ",t.templateModelDto.elements.length,"/10 ",gS(11,36,"Cards")," "),SC(10),Ed(" ",gS(21,38,"Title")," *"),SC(2),dy("placeholder",Y_(gS(24,40,"Enter the title"))),$y("ngModel",t.templateModel.title),pb(),SC(4),Ed("",t.templateModel.title.length||0,"/80"),SC(5),Ed(" ",gS(32,42,"Subt
1itle")," *"),SC(2),dy("placeholder",Y_(gS(35,44,"Enter the subtitle"))),$y("ngModel",t.templateModel.subtitle),pb(),SC(4),Ed("",t.templateModel.subtitle?.length||0,"/80"),SC(3),jy(gS(41,46,"Card Image")),SC(2),YT(!t.selectedFile&&!t.templateModel.imageURL?42:t.selectedFile?43:t.templateModel.imageURL?44:-1),SC(8),Ed(" ",gS(51,48,"Server File")," "),SC(2),dy("config",t.instgramFileUploadConfig),SC(6),jy(gS(59,50,"Local File")),SC(5),jy(gS(64,52,"Interactive Buttons")),SC(2),dy("disabled",t.buttons.length>=3),SC(3),Ed(" ",gS(69,54,"Add Button")," "),SC(2),YT(t.buttons.length===0?70:-1),SC(2),JT(t.buttons),SC(4),Ed(" ",gS(77,56,"Clear Form")," "),SC(2),dy("disabled",!g.valid||t.buttons.length>0&&!t.buttons[0].title),SC(2),jy(t.editingCardIndex!==null?"update":"save"),SC(),Ed(" ",gS(82,58,t.editingCardIndex!==null?"Update Card":"Save Card to Template")," "),SC(4),JT(t.templateModelDto.elements),SC(4),Ed(" ",gS(90,60,"Cancel Template")," "),SC(2),dy("disabled",t.templateModelDto.elements.length===0),SC(3),Ed(" ",gS(95,62,"Save Template")," "),SC(9),jy(gS(104,64,"Instagram Preview")),SC(3),YT(!t.currentElement&&!t.templateModel.title&&!t.templateModel.subtitle?106:107),SC(2),YT(t.templateModelDto.elements.length>0?108:-1);}},dependencies:[Tt$1,Ng,Lg,Ts,Og,Pg,Zs,Mc,Ic,Gc,jt$1,M,XE,Ye,$e,qe,Ze,Ke,vD,cD,hD,_D,mD,Xv,zg,w0,H0,Zx,dn,da,xr,wr,zw,Nw,sk,nd,rC,wC,mv,ta,_r,cv,GC,tD,al,Wg,tM,dM,Lb,r1,P1,xS,Vs,zs,Fi,GS,iI,RI,us,ms,UI,tE,Dn,ME,ny,go,Kd,on,LT,mA,mt],styles:[".template-builder-container[_ngcontent-%COMP%]{display:flex;gap:32px;align-items:flex-start;padding:16px;max-width:1400px;margin:0 auto}@media(max-width:992px){.template-builder-container[_ngcontent-%COMP%]{flex-direction:column}}.editor-side[_ngcontent-%COMP%]{flex:1;min-width:0}.editor-side[_ngcontent-%COMP%] .editor-card[_ngcontent-%COMP%]{border-radius:var(--radius-xl)}.editor-side[_ngcontent-%COMP%] .editor-card[_ngcontent-%COMP%] .editor-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.editor-side[_ngcontent-%COMP%] .editor-card[_ngcontent-%COMP%] .editor-header[_ngcontent-%COMP%] .card-counter[_ngcontent-%COMP%]{background:#f0f2f5;padding:4px 12px;border-radius:var(--radius-xl);font-size:var(--font-size-sm);font-weight:600;color:var(--color-text-muted)}.editor-side[_ngcontent-%COMP%] .editor-card[_ngcontent-%COMP%] .upload-dropzone[_ngcontent-%COMP%]{border:2px dashed var(--color-border-form);border-radius:var(--radius-lg);padding:32px;cursor:pointer;transition:background .3s;background-color:var(--color-surface-2)}.editor-side[_ngcontent-%COMP%] .editor-card[_ngcontent-%COMP%] .upload-dropzone[_ngcontent-%COMP%]:hover{background-color:var(--color-border);border-color:#007bff}.editor-side[_ngcontent-%COMP%] .editor-card[_ngcontent-%COMP%] .upload-dropzone[_ngcontent-%COMP%] .upload-icon[_ngcontent-%COMP%]{font-size:40px;width:40px;height:40px}.editor-side[_ngcontent-%COMP%] .editor-card[_ngcontent-%COMP%] .badge-type[_ngcontent-%COMP%]{background:#e3f2fd;color:var(--color-primary);padding:2px 8px;border-radius:var(--radius-lg);font-size:var(--font-size-xs);font-weight:700}.editor-side[_ngcontent-%COMP%] .editor-card[_ngcontent-%COMP%] .border-dashed[_ngcontent-%COMP%]{border:1px dashed var(--color-border-form)}.editor-side[_ngcontent-%COMP%] .editor-card[_ngcontent-%COMP%] .cards-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:16px}.editor-side[_ngcontent-%COMP%] .editor-card[_ngcontent-%COMP%] .cards-grid[_ngcontent-%COMP%] .mini-card-preview[_ngcontent-%COMP%]{border-radius:var(--radius-lg);overflow:hidden;border:2px solid transparent;cursor:pointer;transition:transform .2s;background:#fff}.editor-side[_ngcontent-%COMP%] .editor-card[_ngcontent-%COMP%] .cards-grid[_ngcontent-%COMP%] .mini-card-preview[_ngcontent-%COMP%]:hover{transform:translateY(-3px)}.editor-side[_ngcontent-%COMP%] .editor-card[_ngcontent-%COMP%] .cards-grid[_ngcontent-%COMP%] .mini-card-preview.active[_ngcontent-%COMP%]{border-color:#ff4081}.editor-side[_ngcontent-%COMP%] .editor-card[_ngcontent-%COMP%] .cards-grid[_ngcontent-%COMP%] .mini-card-preview[_ngcontent-%COMP%] .mini-card-img[_ngcontent-%COMP%]{height:90px;background-size:cover;background-position:center;position:relative}.editor-side[_ngcontent-%COMP%] .editor-card[_ngcontent-%COMP%] .save-template-btn[_ngcontent-%COMP%]{padding:0 32px;border-radius:var(--radius-2xl)}.preview-side[_ngcontent-%COMP%]{width:360px;flex-shrink:0;position:sticky;top:30px}.preview-side[_ngcontent-%COMP%] .phone-mockup[_ngcontent-%COMP%]{background-color:#fff;border:12px solid #222;border-radius:40px;height:620px;box-shadow:var(--shadow-float);display:flex;flex-direction:column;position:relative;overflow:hidden}.preview-side[_ngcontent-%COMP%] .phone-mockup[_ngcontent-%COMP%] .phone-notch[_ngcontent-%COMP%]{position:absolute;top:0;left:50%;transform:translate(-50%);width:120px;height:24px;background-color:#222;border-bottom-left-radius:var(--radius-xl);border-bottom-right-radius:var(--radius-xl);z-index:10}.preview-side[_ngcontent-%COMP%] .phone-mockup[_ngcontent-%COMP%] .phone-header[_ngcontent-%COMP%]{padding:28px 16px 12px;border-bottom:1px solid var(--color-border);background:var(--color-surface-2)}.preview-side[_ngcontent-%COMP%] .phone-mockup[_ngcontent-%COMP%] .phone-screen-content[_ngcontent-%COMP%]{flex:1;background-color:var(--color-surface-2);padding:16px;overflow-y:auto}.preview-side[_ngcontent-%COMP%] .phone-mockup[_ngcontent-%COMP%] .phone-screen-content[_ngcontent-%COMP%] .ig-card-wrapper[_ngcontent-%COMP%]{margin-bottom:16px}.preview-side[_ngcontent-%COMP%] .phone-mockup[_ngcontent-%COMP%] .phone-screen-content[_ngcontent-%COMP%] .ig-card-wrapper[_ngcontent-%COMP%] .ig-avatar[_ng
1content-%COMP%]{width:32px;height:32px;border-radius:50%;background:var(--color-border-form);flex-shrink:0;margin-top:auto}.preview-side[_ngcontent-%COMP%] .phone-mockup[_ngcontent-%COMP%] .phone-screen-content[_ngcontent-%COMP%] .ig-card-wrapper[_ngcontent-%COMP%] .ig-card[_ngcontent-%COMP%]{flex:1;background:#fff;border-radius:var(--radius-xl);border-bottom-left-radius:var(--radius-sm);overflow:hidden}.preview-side[_ngcontent-%COMP%] .phone-mockup[_ngcontent-%COMP%] .phone-screen-content[_ngcontent-%COMP%] .ig-card-wrapper[_ngcontent-%COMP%] .ig-card[_ngcontent-%COMP%] .ig-card-image[_ngcontent-%COMP%]{height:180px;width:100%}.preview-side[_ngcontent-%COMP%] .phone-mockup[_ngcontent-%COMP%] .phone-screen-content[_ngcontent-%COMP%] .ig-card-wrapper[_ngcontent-%COMP%] .ig-card[_ngcontent-%COMP%] .ig-card-image[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:cover}.preview-side[_ngcontent-%COMP%] .phone-mockup[_ngcontent-%COMP%] .phone-screen-content[_ngcontent-%COMP%] .ig-card-wrapper[_ngcontent-%COMP%] .ig-card[_ngcontent-%COMP%] .ig-card-body[_ngcontent-%COMP%] .ig-title[_ngcontent-%COMP%]{font-size:var(--font-size-base);color:var(--color-text);line-height:1.3}.preview-side[_ngcontent-%COMP%] .phone-mockup[_ngcontent-%COMP%] .phone-screen-content[_ngcontent-%COMP%] .ig-card-wrapper[_ngcontent-%COMP%] .ig-card[_ngcontent-%COMP%] .ig-card-body[_ngcontent-%COMP%] .ig-subtitle[_ngcontent-%COMP%]{color:var(--color-text-muted);line-height:1.3}.preview-side[_ngcontent-%COMP%] .phone-mockup[_ngcontent-%COMP%] .phone-screen-content[_ngcontent-%COMP%] .ig-card-wrapper[_ngcontent-%COMP%] .ig-card[_ngcontent-%COMP%] .ig-card-buttons[_ngcontent-%COMP%]{display:flex;flex-direction:column}.preview-side[_ngcontent-%COMP%] .phone-mockup[_ngcontent-%COMP%] .phone-screen-content[_ngcontent-%COMP%] .ig-card-wrapper[_ngcontent-%COMP%] .ig-card[_ngcontent-%COMP%] .ig-card-buttons[_ngcontent-%COMP%] .ig-btn[_ngcontent-%COMP%]{background:transparent;border:none;border-top:1px solid var(--color-border);padding:12px;width:100%;color:#0095f6;font-weight:600;font-size:var(--font-size-sm);cursor:pointer;transition:background .2s}.preview-side[_ngcontent-%COMP%] .phone-mockup[_ngcontent-%COMP%] .phone-screen-content[_ngcontent-%COMP%] .ig-card-wrapper[_ngcontent-%COMP%] .ig-card[_ngcontent-%COMP%] .ig-card-buttons[_ngcontent-%COMP%] .ig-btn[_ngcontent-%COMP%]:hover{background:var(--color-surface-2)}.preview-side[_ngcontent-%COMP%] .phone-mockup[_ngcontent-%COMP%] .phone-footer[_ngcontent-%COMP%] .dot[_ngcontent-%COMP%]{width:8px;height:8px;border-radius:50%;background-color:var(--color-border);transition:.3s}.preview-side[_ngcontent-%COMP%] .phone-mockup[_ngcontent-%COMP%] .phone-footer[_ngcontent-%COMP%] .dot.active[_ngcontent-%COMP%]{background-color:#0095f6;transform:scale(1.2)}.cards-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:16px}.cards-grid.cdk-drop-list-dragging[_ngcontent-%COMP%] .mini-card-preview[_ngcontent-%COMP%]:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.cards-grid[_ngcontent-%COMP%] .mini-card-preview[_ngcontent-%COMP%]{border-radius:var(--radius-lg);overflow:hidden;border:2px solid transparent;cursor:pointer;transition:transform .2s;background:#fff;position:relative}.cards-grid[_ngcontent-%COMP%] .mini-card-preview[_ngcontent-%COMP%]:hover{transform:translateY(-3px)}.cards-grid[_ngcontent-%COMP%] .mini-card-preview.active[_ngcontent-%COMP%]{border-color:#ff4081}.cards-grid[_ngcontent-%COMP%] .mini-card-preview[_ngcontent-%COMP%] .drag-handle[_ngcontent-%COMP%]{position:absolute;top:4px;left:4px;z-index:10;color:#fff;background:#0006;border-radius:50%;padding:2px;cursor:grab;display:flex;align-items:center;justify-content:center}.cards-grid[_ngcontent-%COMP%] .mini-card-preview[_ngcontent-%COMP%] .drag-handle[_ngcontent-%COMP%]:active{cursor:grabbing}.cards-grid[_ngcontent-%COMP%] .mini-card-preview[_ngcontent-%COMP%] .drag-handle[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:var(--font-size-lg);width:18px;height:18px}.cards-grid[_ngcontent-%COMP%] .mini-card-preview[_ngcontent-%COMP%] .mini-card-img[_ngcontent-%COMP%]{height:90px;background-size:cover;background-position:center;position:relative}.cdk-drag-placeholder[_ngcontent-%COMP%]{opacity:.3;border:2px dashed var(--color-text-muted)!important}.dragging-preview[_ngcontent-%COMP%]{background:#fff;border-radius:var(--radius-lg);box-shadow:var(--shadow-raised);border:2px solid #0095f6;width:140px}.dragging-preview[_ngcontent-%COMP%] .mini-card-img[_ngcontent-%COMP%]{height:90px;background-size:cover;background-position:center}.always-visible-btn[_ngcontent-%COMP%]{width:32px;height:32px;padding:0;display:flex;align-items:center;justify-content:center}.always-visible-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:var(--font-size-lg);width:18px;height:18px}"],changeDetection:1});}}return r})(); 2export{qi as UpdateIgTemplateComponent};
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.