1"use strict";(self.webpackChunklightx=self.webpackChunklightx||[]).push([[1376],{66518:(Y,M,p)=>{p.d(M,{k:()=>C});var g=p(16471),h=p(54438);let C=(()=>{var t;class y{constructor(){}setIconName(b){return g._Y.AIPhoto==b.editorType?b.iconName="aitoolsgrey":g._Y.Photo==b.editorType||g._Y.BatchEditor==b.editorType?b.iconName="photoeditor":g._Y.DesignTemplate==b.editorType?b.iconName="uploadimage":g._Y.VideoTemplate==b.editorType?b.iconName="videotemplates":g._Y.VideoEditor==b.editorType&&(b.iconName="videoeditor"),b}resetHistory(){localStorage.removeItem("toolHistory")}addToHistory(b){if(b?.toolName&&b?.title){let T=JSON.parse(localStorage.getItem("toolHistory")||"[]");const k=T.findIndex(G=>G.toolName==b.toolName&&G.editorType==b.editorType&&G.title==b.title);-1!==k&&T.splice(k,1),b=this.setIconName(b),T.unshift(b),T.length>10&&(T=T.slice(0,10)),localStorage.setItem("toolHistory",JSON.stringify(T))}}getHistory(){return JSON.parse(localStorage.getItem("toolHistory")||"[]")}}return(t=y).\u0275fac=function(b){return new(b||t)},t.\u0275prov=h.jDH({token:t,factory:t.\u0275fac,providedIn:"root"}),y})()},54321:(Y,M,p)=>{p.d(M,{ZR:()=>C,f_:()=>h,w7:()=>t});const g={apiKey:"quality",default:"auto",options:[{id:"auto",label:"Auto",value:null},{id:"1:1",label:"1:1",value:"1:1",width:1024,height:1024,qType:1},{id:"3:4",label:"3:4",value:"3:4",width:768,height:1024,qType:2},{id:"4:3",label:"4:3",value:"4:3",width:1024,height:768,qType:3},{id:"16:9",label:"16:9",value:"16:9",width:1920,height:1080,qType:10},{id:"9:16",label:"9:16",value:"9:16",width:1080,height:1920,qType:9}]},h=[{id:1,featureName:"Ghost Mannequin",featureType:"aighostmannequin",squareVideoUrl:"https://static.lightxeditor.com/assets/AI-tools-videos/Ghost-Manequin-Thumb.mp4",landscapeVideoUrl:"https://static.lightxeditor.com/assets/AI-tools-videos/Ghost-Manequin-Thumb-In.mp4",icon:"ghostmanequin",isNew:1,slots:["prompt","aspect"],prompt:{o
1ptional:!0,label:"Enter Prompt (Optional)",placeholder:"e.g. \u201cshow left\u201d or \u201cshow back\u201d",apiKey:"textPrompt"},aspect:g},{id:2,featureName:"AI Flat Lay",featureType:"aiflatlaygenerator",squareVideoUrl:"https://static.lightxeditor.com/assets/AI-tools-videos/Flatlay-Thumb.mp4",landscapeVideoUrl:"https://static.lightxeditor.com/assets/AI-tools-videos/Flatlay-Thumb-In.mp4",icon:"flatlay",isNew:1,slots:["prompt","aspect"],prompt:{optional:!0,label:"Enter Prompt (Optional)",placeholder:"e.g. \u201cOn wooden surface\u201d",apiKey:"textPrompt"},aspect:g},{id:3,featureName:"AI Recolor",featureType:"airecolor",squareVideoUrl:"https://static.lightxeditor.com/assets/AI-tools-videos/Recolor-Thumb.mp4",landscapeVideoUrl:"https://static.lightxeditor.com/assets/AI-tools-videos/Recolor-Thumb-In.mp4",icon:"recolor",isNew:1,slots:["color","prompt","aspect"],prompt:{optional:!0,label:"Enter Prompt (Optional)",placeholder:"Describe the part to recolor",apiKey:"textPrompt"},aspect:g,color:{required:!0,label:"Color",apiKey:"hexColor"}}];function C(y){return!!y&&h.some(x=>x.featureType===y)}function t(y){return y?h.find(x=>x.featureType===y)?.featureName??null:null}},65290:(Y,M,p)=>{p.d(M,{P:()=>t});var g=p(45312),h=p(54438),C=p(95301);let t=(()=>{var y;class x{constructor(T){this.dataService=T,this.baseUrl=g.c.baseUrl,this.centralStoreUrl=g.c.centralStoreUrl,this.centralStoreUrlPart=g.c.centralStoreUrlPart+"central/",this.webcentralStoreUrlPart=g.c.centralStoreUrlPart+"webcentral/",this.quickEditTools=[]}getQuickEditsLists(T,k,G){this.dataService.get(this.centralStoreUrl+this.centralStoreUrlPart+"getDynamicFeatureTypes?categoryId=&start=0&rows=99",!0).subscribe(f=>{f&&2e3===f.statusCode?(this.quickEditTools=f?.body?.dynamicFeatureTypes||[],k(f)):G(f.description)},f=>{G()})}}return(y=x).\u0275fac=function(T){return new(T||y)(h.KVO(C.u))},y.\u0275prov=h.jDH({token:y,factory:y.\u0275fac,providedIn:"root"}),x})()},81376:(Y,M,p)=>{p.r(M),p.d(M,{UserDashboardModule:()=>yn});var g=p(60177),h=p(74710),C=p(75668),t=p(54438),y=p(34183),x=p(33391),b=p(39441),T=p(95301);let k=(()=>{var o;class r{constructor(e){this.dataService=e,this.dashboardSectionsCache=new Map}setDashboardSectionsCache(e,i){this.dashboardSectionsCache.set(e,i)}clearDashboardSectionsCache(){this.dashboardSectionsCache.clear()}getDashboardSectionsCache(e){return this.dashboardSectionsCache.get(e)||[]}}return(o=r).\u0275fac=function(e){return new(e||o)(t.KVO(T.u))},o.\u0275prov=t.jDH({token:o,factory:o.\u0275fac}),r})();var G=p(94223),w=p(68010);let D=(()=>{var o;class r{}return(o=r).\u0275fac=function(e){return new(e||o)},o.\u0275cmp=t.VBU({type:o,selectors:[["dashborad-header"]],decls:0,vars:0,template:function(e,i){}}),r})();var f=p(16478),j=p(80006),E=p(630),O=p(11497),I=p(6755),F=p(45975),S=p(74983),U=p(32764),R=p(41300),N=p(55756),A=p(38968),ot=p(3110);const at=["file"];function st(o,r){1&o&&(t.qex(0),t.nrm(1,"dashboard-placeholder",5),t.bVm()),2&o&&(t.R
17$(),t.Y8G("cardCount",8))}function rt(o,r){if(1&o){const n=t.RV6();t.j41(0,"magic-tools-grid",6),t.bIt("toolClick",function(i){t.eBV(n);const a=t.XpG(2),l=t.sdS(2);return t.Njj(a.getStoryPage(i,l))}),t.k0s()}if(2&o){const n=t.XpG(2);t.Y8G("tools",n.tools)("title",n.sectionTitle)}}function lt(o,r){if(1&o&&(t.qex(0),t.DNE(1,st,2,1,"ng-container",4)(2,rt,1,2,"ng-template",null,1,t.C5r),t.bVm()),2&o){const n=t.sdS(3),e=t.XpG();t.R7$(),t.Y8G("ngIf",e.showPlaceholder)("ngIfElse",n)}}let ct=(()=>{var o;class r extends C.Y{constructor(e,i,a,l,s,c,d,m,_,u,v){super(e,a,l,s,c,d,m,_,u,v),this.aiUploadImageService=e,this.storyPageService=i,this.inProgress=!1,this.storeProducts=[],this.isdilog=!1,this.catogaryId=0,this.allowedImagetoolsMimeTypes=f.b.allowedImagetoolsMimeTypes,this.allowedCompressImageTypes=f.b.allowedCompressImageTypes,this.isLoaded=!1,this.sectionTitle="",this.tools=[]}ngOnChanges(){this.isdilog||(this.sectionTitle=this.sectionObj?.title,this.tools=this.sectionObj?.links||[])}get showPlaceholder(){return!this.isLoaded}getStoryPage(e,i){if(this.inProgress)return;this.inProgress=!0;const a=e?.img?.item||e;if(a&&a.subType==f.b.slug.toolWithoutStory)return super.openTool(a,i,this.sectionTitle),void setTimeout(()=>{this.inProgress=!1},100);this.storyPageService.getStoryPageContent(a.type,"story",a.subType,l=>{const s=l.body.storyPage;if(s){const c=s.sections[0];let d=null;if("mixed-banner-header"==c.type&&c.links.length){d=c.links[0].metadata;let v=this.aiUploadImageService.getParams(d.queryString);d=Object.assign({},d,v),d.mediaType="IMG",d.tab=d.toolName}const m=s.sections[0].metadata&&s.sections[0].metadata.queryString?this.aiUploadImageService.getParams(s.sections[0].metadata.queryString):{},_=Object.assign({},s.sections[0].metadata,s.metadata,m,d);_.subType=a.subType,_.text=a.text,_.title=this.sectionTitle,_.tab=_.tab||_.toolName,_.from="user-dashboard";const u={...a,metadata:_};super.openTool(u,i,this.sectionTitle)}setTimeout(()=>{this.inProgress=!1},100)},l=>{setTimeout(()=>{this.inProgress=!1},100),this.toastService.showError(l?.description)})}}return(o=r).\u0275fac=function(e){return new(e||o)(t.rXU(j.M),t.rXU(y.K),t.rXU(E.A),t.rXU(h.Ix),t.rXU(O.k),t.rXU(I.A),t.rXU(F.B),t.rXU(S.f),t.rXU(U.I),t.rXU(R.g),t.rXU(N.y))},o.\u0275cmp=t.VBU({type:o,selectors:[["popular-tools"]],viewQuery:function(e,i){if(1&e&&t.GBs(at,5),2&e){let a;t.mGM(a=t.lsd())&&(i.fileInput=a.first)}},inputs:{storeProducts:"storeProducts",isdilog:"isdilog",sectionObj:"sectionObj",isLoaded:"isLoaded"},features:[t.Vt3,t.OA$],decls:3,vars:3,consts:[["file",""],["toolsContent",""],[4,"ngIf"],["id","fileInputId","name","fileInputId","type","file",1,"custom-file-input","d-none",3,"change","click","accept","multiple"],[4,"ngIf","ngIfElse"],["type","popular-tools",3,"cardCount"],[3,"toolClick","tools","title"]],template:function(e,i){if(1&e){const a=t.RV6();t.DNE(0,lt,4,2,"ng-container",2),t.j41(1,"input",3,0),t.bIt("change",function(s){return t.eBV(a),t.Njj(i.onFileUploaded(s.srcElement.files))})("click",function(){t.eBV(a);const s=t.sdS(2);return t.Njj(s.value="")}),t.k0s()}2&e&&(t.Y8G("ngIf",!i.isdilog),t.R7$(),t.Y8G("accept",i.fileUploadAccept)("multiple",i.multiple))},dependencies:[g.bT,A.t,ot.w]}),r})();var z=p(10467),dt=p(28662),P=p(16471),V=p(24886),q=p(79774),K=p(45312);class L{static getSliderImageHeight(r,n=228,e=12,i=100){let l;return l=n,1===r?l=16*n/9:2===r?l=n:3===r?l=9*n/16:14===r?n=228:l=n,{width:l,height:n,space:e,extraSpace:i}}static getNewImageSizeL(r,n=0,e=228,i=12,a=100){let c;return 1===n?c=16*e/9:2===n?c=e:3===n?c=9*e/16:4===n?c=4*e/3:5===n?c=3*e/4:6===n?c=3*e/2:7===n?c=2*e/3:8===n?c=4*e/5:9===n?c=1080*e/566:10===n?c=1200*e/628:11===n?c=11*e/17:12===n?c=5*e/7:13===n?c=17*e/22:15===n?c=1200*e/630:16===n?c=820*e/312:17===n?c=1640*e/856:18===n?c=3*e/1:19===n?c=4*e/1:20===n?c=2*e/1:32===n?c=62*e/13:35===n&&(c=2.84*e/1),{width:c,height:e,space:i,extraSpace:a}}}var pt=p(55697),W=p(54321),mt=p(22154),gt=p(53428),_t=p(68887),J=p(25939),X=p(68064);const ut=["aiScrollContainer"],ht=o=>({active:o});function ft(o,r){if(1&o){const n=t.RV6();t.j41(0,"div",10),t.bIt("click",function(){const i=t.eBV(n).$implicit,a=t.XpG();return t.Njj(a.onTabSelect(i.id))}),t.EFF(1),t.k0s()}if(2&o){const n=r.$implicit,e=t.XpG();t.Y8G("ngClass",t.eq3(2,ht,e.activeTabId===n.id)),t.R7$(),t.SpI(" ",n.label," ")}}function bt(o,r){1&o&&(t.qex(0),t.nrm(1,"dashboard-placeholder",11),t.bVm()),2&o&&(t.R
17$(),t.Y8G("cardCount",6)("showTitle",!1))}function vt(o,r){if(1&o){const n=t.RV6();t.j41(0,"div",23)(1,"button",24),t.bIt("click",function(){t.eBV(n);const i=t.XpG(4);return t.Njj(i.scrollAiPrev())}),t.nrm(2,"span",25),t.k0s()()}}function yt(o,r){1&o&&(t.j41(0,"span",30),t.nrm(1,"pi",31),t.k0s())}function xt(o,r){if(1&o&&(t.nrm(0,"img",27),t.j41(1,"span",28),t.EFF(2),t.k0s(),t.DNE(3,yt,2,0,"span",29)),2&o){const n=t.XpG().$implicit,e=t.XpG(4);t.Y8G("src",(null==n?null:n.posterImage)||(null==n?null:n.thumbUrl)||(null==n||null==n.urls?null:n.urls[0]),t.B4B)("alt",(null==n?null:n.name)||(null==n?null:n.displayName)||"AI generation"),t.R7$(2),t.JRh(e.getDisplayToolName(n)),t.R7$(),t.Y8G("ngIf",null==n?null:n.isVideo)}}function Ct(o,r){if(1&o){const n=t.RV6();t.j41(0,"div",26),t.bIt("click",function(){const i=t.eBV(n),a=i.$implicit,l=i.index,s=t.XpG(4);return t.Njj(s.openAiProject(a,l))}),t.DNE(1,xt,4,4),t.k0s()}if(2&o){const n=r.$implicit;t.AVh("is-loading","init"==(null==n?null:n.status)),t.R7$(),t.vxM("active"==(null==n?null:n.status)?1:-1)}}function Tt(o,r){if(1&o){const n=t.RV6();t.j41(0,"button",32),t.bIt("click",function(){t.eBV(n);const i=t.XpG(4);return t.Njj(i.viewAll())}),t.j41(1,"span",33),t.nrm(2,"span",34),t.k0s(),t.j41(3,"span",35),t.EFF(4,"See all"),t.k0s()()}}function Pt(o,r){if(1&o){const n=t.RV6();t.j41(0,"div",36)(1,"button",37),t.bIt("click",function(){t.eBV(n);const i=t.XpG(4);return t.Njj(i.scrollAiNext())}),t.nrm(2,"span",34),t.k0s()()}}function jt(o,r){if(1&o){const n=t.RV6();t.j41(0,"div",15)(1,"div",17),t.DNE(2,vt,3,0,"div",18),t.j41(3,"div",19,1),t.bIt("scroll",function(){t.eBV(n);const i=t.XpG(3);return t.Njj(i.onAiScroll())}),t.DNE(5,Ct,2,3,"div",20)(6,Tt,5,0,"button",21),t.k0s(),t.DNE(7,Pt,3,0,"div",22),t.k0s()()}if(2&o){const n=t.XpG(3);t.R7$(2),t.Y8G("ngIf",n.canScrollAiPrev),t.R7$(3),t.Y8G("ngForOf",n.aiProjectCards),t.R7$(),t.Y8G("ngIf",(null==n.aiProjectCards?null:n.aiProjectCards.length)>=8),t.R7$(),t.Y8G("ngIf",n.canScrollAiNext)}}function wt(o,r){if(1&o){const n=t.RV6();t.j41(0,"ng-image-slider",38,2),t.bIt("imageClick",function(i){t.eBV(n);const a=t.XpG(3);return t.Njj(a.openTool(i))})("sliderNextDisableEvent",function(i){t.eBV(n);const a=t.XpG(3);return t.Njj(a.sliderNextDisable(i))})("seeAllEvent",function(){t.eBV(n);const i=t.XpG(3);return t.Njj(i.viewAll())}),t.k0s()}if(2&o){const n=t.XpG(3);t.Y8G("images",n.selectedProductObj.imageObjects)("imageSize",n.selectedProductObj.imageSizel)("imagePopup",!1)("footerShow",!0)("projectNameShow",!0)("recentProject",!0)("isSubscribed",n.user&&n.user.subscribed)}}function Ot(o,r){if(1&o&&(t.j41(0,"div",14),t.DNE(1,jt,8,4,"div",15)(2,wt,2,7,"ng-image-slider",16),t.k0s()),2&o){const n=t.XpG(2);t.AVh("mb-0","ai"==n.activeTabId),t.R7$(),t.vxM("ai"==n.activeTabId?1:2)}}function It(o,r){1&o&&t.nrm(0,"img",46)}function St(o,r){1&o&&t.nrm(0,"img",47)}function Mt(o,r){if(1&o){const n=t.RV6();t.j41(0,"div",39)(1,"div",40),t.DNE(2,It,1,0,"img",41)(3,St,1,0,"img",42),t.k0s(),t.j41(4,"div",43)(5,"p",44),t.EFF(6),t.k0s(),t.j41(7,"button",45),t.bIt("click",function(){t.eBV(n);const i=t.XpG(2);return t.Njj(i.editPhoto())}),t.EFF(8),t.k0s()()()}if(2&o){const n=t.XpG(2);t.R7$(2),t.Y8G("ngIf","ai"!==n.activeTabId),t.R7$(),t.Y8G("ngIf","ai"===n.activeTabId),t.R7$(3),t.JRh(n.ctaText.text),t.R7$(2),t.JRh(n.ctaText.buttonText)}}function kt(o,r){if(1&o&&t.DNE(0,Ot,3,3,"div",12)(1,Mt,9,4,"div",13),2&o){const n=t.XpG();t.Y8G("ngIf",n.selectedProductObj),t.R7$(),t.Y8G("ngIf",!n.loadingTab&&!n.selectedProductObj)}}let Gt=(()=>{var o;class r{constructor(e,i,a,l,s,c,d,m,_){this.uploadImageService=e,this.aiUploadImageService=i,this.configService=a,this.router=l,this.uploadVideoService=s,this.projectsService=c,this.authService=d,this.projectSyncService=m,this.modalService=_,this.isLoaded=!1,this.sectionTitle="",this.tools=[],this.viewAllDisable=!1,this.loadingTab=!1,this.loadingInitialProjects=!0,this.activeTabId="ai",this.canScrollAiPrev=!1,this.canScrollAiNext=!1,this.tabProjectsCache=new Map,this.aiCardStep=172,this.projectTabs=[{id:"ai",label:"AI Generations",templateType:5}
1,{id:"photo",label:"Photo Edits",templateType:3},{id:"video",label:"Video Edits",templateType:4},{id:"design",label:"Design Templates",templateType:1}],this.imgQueryParams={imageUrl:"",tabName:"",from:"",editorType:""},this.ctaText={text:"",buttonText:""},this.user=this.authService.currentUser()}getHeightWidth(e){if(!e?.properties?.width&&e?.properties?.socialPlatformId){const i=this.configService.settings?.[P.jn.SocialFormat]?.[e.properties.socialPlatformId];i&&(e.properties.width=i.width,e.properties.height=i.height)}return!e.metadata&&e.properties&&(e.metadata={height:200,width:200},e.metadata.height=e.properties.height?e.properties.height:200,e.metadata.width=e.properties.width?e.properties.width:200),e}getFormattedProduct(e,i,a){let s,l=[];for(let d=0;d<e.length;d++){s=e[d];let _=s.name?s.name:"Untitled";s=this.getDisplayModulName(s,s.featureType?s.featureType:""),s=this.getHeightWidth(s),s.pro=s?.properties?.pro,l.push({posterImage:s.thumbUrl?s.thumbUrl:s.urls?s.urls[0]:null,item:s,format:a,imageSizel:L.getSliderImageHeight(2,172,8,85),isplay:i,name:_})}return{imageSizel:L.getSliderImageHeight(2,172,8,85),imageObjects:l}}get showContentPlaceholder(){return!this.isLoaded||this.loadingInitialProjects||this.loadingTab}get aiProjectCards(){return"ai"===this.activeTabId&&this.selectedProductObj||[]}onTabSelect(e){this.activeTabId!==e&&(this.activeTabId=e,this.viewAllDisable=!1,this.ctaText=this.getCtaText(),this.loadTabData(e))}ngAfterViewInit(){setTimeout(()=>this.updateAiScrollState(),0)}loadTabData(e){if(this.selectedProductObj=null,this.tabProjectsCache.has(e))return void this.updateSelectedProduct();const i=this.projectTabs.find(a=>a.id===e);i&&(this.loadingTab=!0,this.loadProjectsByTemplateType(i.templateType).then(a=>{this.tabProjectsCache.set(e,a),this.updateSelectedProduct(),this.loadingTab=!1}))}loadProjectsByTemplateType(e){return 3===e?this.fetchPhotoEditAssets():5===e?this.fetchAiGenerations():this.fetchDesignsByTemplateType(e)}fetchDesignsByTemplateType(e){var i=this;return new Promise(a=>{if(!this.user?.systemRefKey)return void a([]);const l={systemRefKey:this.user.systemRefKey,time:"lt",fromTime:(new Date).getTime(),templateType:e};this.projectsService.getAllProjects(l,function(){var s=(0,z.A)(function*(c){yield i.configService.waitForSettings();let d=c.body?.designs||[];d=i.prepareProjectList(d),a(i.limitProjects(d))});return function(c){return s.apply(this,arguments)}}(),()=>a([]))})}fetchPhotoEditAssets(){return new Promise(e=>{this.user?.systemRefKey?this.projectSyncService.getUploadedAssets(this.user,[q.P.IMG_EDITS],(new Date).getTime(),i=>{let a=i.body?.projectAssets||[];a=this.normalizeAssetProjects(a,"img_edits"),e(this.limitProjects(a))},()=>e([])):e([])})}fetchAiGenerations(){return new Promise(e=>{this.user?.systemRefKey?this.projectSyncService.getAiAssets(this.user,[q.P.IMG_EDITS],(new Date).getTime(),i=>{let a=i.body?.projectAssets||[];a=this.normalizeAssetProjects(a),e(this.limitProjects(a))},()=>e([])):e([])})}normalizeAssetProjects(e,i){return e.map(a=>(i&&(a.assetType=a.assetType||i),null==a.templateType&&(a.templateType=0),a.updatedDate&&!a.updatedTimestamp&&(a.updatedTimestamp=a.updatedDate),a.urls&&a.urls[0].includes("mp4")&&(a.isVideo=!0),a.urls&&a.urls.length&&(a.url=a.urls[0]||"",a.thumbUrl=a.thumbUrl||"",a.imgUrl=a.urls[0]||""),a))}prepareProjectList(e){return e.forEach(i=>{if(!i.properties?.width&&i.properties?.socialPlatformId){const a=this.configService.settings?.[P.jn.SocialFormat]?.[i.properties.socialPlatformId];a&&(i.properties.width=a.width,i.properties.height=a.height)}}),e}limitProjects(e){return e.length>f.b.DASHBOARD_IMAGE_SLIDER_ELEMENT_NUMBER_LIMIT?e.slice(0,f.b.DASHBOARD_IMAGE_SLIDER_ELEMENT_NUMBER_LIMIT):e}getTemplateTypeForTab(e){return this.projectTabs.find(i=>i.id===e)?.templateType??5}updateSelectedProduct(){const e=this.tabProjectsCache.get(this.activeTabId)||[];if("ai"==this.activeTabId)return e.length>0&&(this.selectedProductObj=e),void this.scheduleAiScrollStateUpdate();this.selectedProductObj=e.length>0?this.getFormattedProduct(e,!1,0):null,this.canScrollAiPrev=!1,this.canScrollAiNext=!1}scheduleAiScrollStateUpdate(){"ai"===this.activeTabId&&(setTimeout(()=>this.updateAiScrollState(),0),setTimeout(()=>this.updateAiScrollState(),100),requestAnimationFrame(()=>this.updateAiScrollState()))}ngOnInit(){var e=this;return(0,z.A)(function*(){e.user=e.authService.currentUser(),e.sectionTitle=e.sectionObj?.title||"",e.loadingInitialProjects=!0,yield e.configService.waitForSettings();const i=yield e.loadProjectsByTemplateType(5);e.tabProjectsCache.set("ai",i),e.updateSelectedProduct(),e.loadingInitialProjects=!1,e.scheduleAiScrollStateUpdate(),e.ctaText=e.getCtaText()})()}openAiProject(e,i=0){"ai"==this.activeTabId?this.openThumbPreview(e.urls[0],i):this.openTool({img:e})}onAiScroll(){this.updateAiScrollState()}scrollAiPrev(){const e=this.aiScrollContainer?.nativeElement;e&&e.scrollBy({left:3*-this.aiCardStep,behavior:"smooth"})}scrollAiNext(){const e=this.aiScrollContainer?.nativeElement;e&&e.scrollBy({left:3*this.aiCardStep,behavior:"smooth"})}updateAiScrollState(){const e=this.aiScrollContainer?.nativeElement;if(!e||"ai"!==this.activeTabId)return this.canScrollAiPrev=!1,void(this.canScrollAiNext=!1);const i=e.scrollWidth-e.clientWidth;this.canScrollAiPrev=e.scrollLeft>4,this.canScrollAiNext=i>4&&e.scrollLeft<i-4}getAiProjectBadge(e){const i=e?.upscale||e?.metadata?.upscale;return i&&Number(i)>1?`${i}X`:null}loadAIVideo(e){this.uploadVideoService.loadInputVideoToNewTab(e)}loadBgInputImage1(e){var i=this;return(0,z.A)(function*(){const a=new Image;yield new Promise(l=>{a.onload=l,a.src=e}).then(()=>{const c=i.router.createUrlTree(["edit-tools/edit"],{queryParams:{tab:"remove_bg",subTool:"",img:a.src,w:a.width,h:a.height,action:"default_project",social_platform_id:0,targetPage:"",edType:"3"}});let d=K.c.siteUrl+i.router.serializeUrl(c);window.open(d,"_blank")})})()}loadProject(e){if(e.templateType==V.If.VIDEO||e.templateType==V.If.OTHERS){const i={project_id:e.assetId,product_id:e.properties.productId};e.properties.editorType==P._Y.VideoEditor?(i.tab="project",this.router.navigate(["/video-editor/edit"],{queryParams:i}
1)):(e.properties.projectType==dt.gM.VideoEditor&&(i.project_type=e.properties.projectType,i.tab="text"),this.router.navigate(["/video-template-editor/edit"],{queryParams:i}))}else e.templateType==V.If.DESIGN||e.templateType==V.If.PHOTO?this.router.navigate(["/design-editor/edit"],{queryParams:{project_id:e.assetId,product_id:e.properties.productId}}):"img_edits"==e.assetType&&(this.imgQueryParams.imageUrl=e.metadata.contentUrl,this.imgQueryParams.editorType=P._Y.Photo,this.imgQueryParams.name=e.name,this.imgQueryParams.tabName=e.metadata.tool,this.imgQueryParams.subTool=e.metadata.subTool,this.uploadImageService.loadInputImage(this.imgQueryParams,()=>{}))}openTool(e){0===(this.selectedTool=e,e.img.item.templateType)?"image2video"==e.img.item.featureType||"text2video"==e.img.item.featureType?this.loadAIVideo(e.img.item.urls[0]):"image2image"==e.img.item.featureType||"text2image"==e.img.item.featureType||e.img.item.urls?this.loadBgInputImage1(e.img.item.urls[0]):e.img.item.metadata?this.loadProject(e.img.item):e.img.item.thumbUrl&&this.loadBgInputImage1(e.img.item.thumbUrl):this.loadProject(e.img.item)}updatefeatureType(e){switch(e){case"selfie":return"AI Portrait";case"avatar":case"avatarify":return"AI Avatar";case"photoshoot":return"AI Product Photoshoot";case"modelphotoshoot":return"AI Person Photoshoot";case"inpaint":return"Cleanup Picture";case"aifilter":return"AI Filter";case"sticker":return"AI Sticker";case"text2image":case"image2image":return"AI Image Generator";case"text2video":case"image2video":return"AI Video Generator";default:return"Photo Editor"}}getDisplayToolName(e){return e&&((0,W.w7)(e.featureType)||(0,W.w7)(e.toolName)||(0,W.w7)(e?.metadata?.subTool)||e.toolName)||""}getDisplayModulName(e,i=""){switch(e.templateType){case 0:return"image2video"==i||"text2video"==i?(e.displayName=this.updatefeatureType(i),e.isplayIcon=!0,e):(e.displayName=this.updatefeatureType(i),e.isplayIcon=!1,e);case 1:return e.displayName="Design template",e.isplayIcon=!1,e;case 2:return e.displayName="Video template",e.isplayIcon=!0,e;case 4:return e.displayName="Video editor",e.isplayIcon=!0,e;default:return e.displayName="",e.isplayIcon=!1,e}}onFileUploaded(e){e.length&&this.aiUploadImageService.aiUploadImage(e[0],{tab:this.selectedTool.metadata.toolName,subTool:this.selectedTool.metadata.subTool,from:f.b.AFTER_LOGIN_REDIRATION_URI}).then(a=>{})}viewAll(){const e=this.getTemplateTypeForTab(this.activeTabId);this.router.navigate(["/my/projects/"],5!==e?{queryParams:{type:e}}:{queryParams:{type:5}})}sliderNextDisable(e){this.viewAllDisable=e}editPhoto(){const e=this.projectTabs.find(i=>i.id===this.activeTabId);e.templateType==V.If.VIDEO||e.templateType==V.If.OTHERS?this.router.navigate(["/video-editor/edit"],{queryParams:{action:"blank_project",tab:"project",project_id:"",h:1080,w:1920,format:26,project_type:3,duration:6e4}}):e.templateType==V.If.DESIGN?this.router.navigate(["/design-editor/edit"],{queryParams:{action:"default_project",social_platform_id:8,format:2,w:1080,h:1080,tab:"template"}}):e.templateType==V.If.PHOTO?this.router.navigate(["/edit-tools/edit"],{queryParams:{action:"default_project",img:"",tab:"remove_bg"}}):this.router.navigate(["/ai-photo-editor/edit"],{queryParams:{tab:"image-tools",toolName:P.Fs.TextToImage,from:"dashboard"}})}openThumbPreview(e,i){this.openThumbnailPreview(e,i,this.aiProjectCards,!0).result.then(l=>{"2"==l.value?this.loadBgInputImage(l.img.urls[0]):"6"==l.value||("7"==l.value?this.loadBgInputImage(l.img.url,7):"8"==l.value?this.loadBgInputImage(l.img.url,8):"9"==l.value?this.loadBgInputImage(l.img.url,9):"10"==l.value?this.loadBgInputImage(l.img.url,10):"11"==l.value?this.loadBgInputImage(l.img.url,11):"12"==l.value&&this.loadBgInputImage(l.img.url,12))})}openThumbnailPreview(e,i,a,l=!1){const s=this.modalService.open(pt.g,{centered:!0,size:"lg",backdrop:!0,windowClass:"ai-thumb-dialog"});return s.componentInstance.url=e,s.componentInstance.index=i,s.componentInstance.aiImages1=a,s.componentInstance.isMyProject=l,s.componentInstance.aiPhotoService=this.aiPhotoService,s}loadBgInputImage(e){var i=this;return(0,z.A)(function*(a,l=0){const s=new Image;yield new Promise(c=>{s.onload=c,s.src=a}).then(()=>{let c,d=s.width,m=s.height;c=6==l?i.router.createUrlTree(["edit-tools/edit"],{queryParams:{tab:"remove_bg",subTool:"",img:s.src,w:d,h:m,action:"default_project",social_platform_id:0,targetPage:"",edType:"3"}}):7==l?i.router.createUrlTree(["design-editor/edit"],{queryParams:{tab:"text",subTool:"",img:s.src,w:d,h:m,action:"default_project",social_platform_id:26,targetPage:"",edType:"1"}}):8==l?i.router.createUrlTree(["edit-tools/edit"],{queryParams:{tab:"aitools",subTool:"eraser",img:s.src,w:d,h:m,action:"default_project",social_platform_id:0,targetPage:"",edType:"3"}}):9==l?i.router.createUrlTree(["edit-tools/edit"],{queryParams:{tab:"aitools",subTool:"exp
1and",img:s.src,w:d,h:m,action:"default_project",social_platform_id:0,targetPage:"",edType:"3"}}):10==l?i.router.createUrlTree(["ai-photo-editor/edit"],{queryParams:{tab:"video-tools",toolName:"image2video",subTool:"image",imgUrl:s.src,o_img:s.src,w:d,h:m,action:"default_project",social_platform_id:0,targetPage:"",edType:"4"}}):i.router.createUrlTree(["edit-tools/edit"],11==l?{queryParams:{tab:"aitools",subTool:"changecameraangle",img:s.src,w:d,h:m,action:"default_project",social_platform_id:0,targetPage:"",edType:"3"}}:12==l?{queryParams:{tab:"aitools",subTool:"changelighting",img:s.src,w:d,h:m,action:"default_project",social_platform_id:0,targetPage:"",edType:"3"}}:{queryParams:{tab:"remove_bg",subTool:"",img:s.src,w:d,h:m,action:"default_project",social_platform_id:0,targetPage:"",edType:"3"}});let _=K.c.siteUrl+i.router.serializeUrl(c);window.open(_,"_blank")})}).apply(this,arguments)}getCtaText(){switch(this.activeTabId){case"ai":return{text:"No AI generations yet. Try your first AI creation.",buttonText:"Start Generating"};case"photo":return{text:"No photo edits yet. Upload a photo to get started.",buttonText:"Edit your first photo"};case"video":return{text:"No video edits yet. Upload a video to get started.",buttonText:"Edit your first video"};case"design":return{text:"No templates tried yet. Pick one to get started.",buttonText:"Start Creating"};default:return{text:"Your folder is empty. Add your project to get started.",buttonText:"Edit your first project"}}}}return(o=r).\u0275fac=function(e){return new(e||o)(t.rXU(I.A),t.rXU(j.M),t.rXU(mt.w),t.rXU(h.Ix),t.rXU(O.k),t.rXU(gt.i),t.rXU(w.u),t.rXU(_t.A),t.rXU(x.Bq))},o.\u0275cmp=t.VBU({type:o,selectors:[["my-recent-projects"]],viewQuery:function(e,i){if(1&e&&t.GBs(ut,5),2&e){let a;t.mGM(a=t.lsd())&&(i.aiScrollContainer=a.first)}},inputs:{sectionObj:"sectionObj",aiPhotoService:"aiPhotoService",isLoaded:"isLoaded"},decls:10,vars:4,consts:[["projectsBody",""],["aiScrollContainer",""],["nav",""],[1,"recent-projects"],[1,"d-flex","align-items-center","justify-content-start","h-40","mb-9"],[1,"text-24","text-bold","grey-800","m-0","lh-125","text-nowrap","ml-13"],[1,"d-flex","justify-content-between","w-100","ml-9","position-relative"],[1,"new-scroll-behave","category-col"],["class","badge badge-temp me-2 h-32 ps-3 pe-3 grey-800 text-medium text-13 border-radius-8",3,"ngClass","click",4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],[1,"badge","badge-temp","me-2","h-32","ps-3","pe-3","grey-800","text-medium","text-13","border-radius-8",3,"click","ngClass"],["type","recent-projects",3,"cardCount","showTitle"],["class","templates-thumbs hometemplate p-0 design-template recentProjects recent-slider","style","margin-bottom: -30px;",3,"mb-0",4,"ngIf"],["class","recent-no-project d-flex align-items-center justify-content-center border-radius-20 ml-13 mr-13",4,"ngIf"],[1,"templates-thumbs","hometemplate","p-0","design-template","recentProjects","recent-slider",2,"margin-bottom","-30px"],[1,"position-relative"],[3,"images","imageSize","imagePopup","footerShow","projectNameShow","recentProject","isSubscribed"],[1,"ai-projects-carousel","position-relative"],["class","ai-projects-nav ai-projects-nav--prev",4,"ngIf"],[1,"ai-projects-track","new-scroll-behave",3,"scroll"],["class","ai-projects-card border-radius-lg",3,"is-loading","click",4,"ngFor","ngForOf"],["type","button","class","ai-projects-see-all","aria-label","See all AI generations",3,"click",4,"ngIf"],["class","ai-projects-nav ai-projects-nav--next",4,"ngIf"],[1,"ai-projects-nav","ai-projects-nav--prev"],["type","button","aria-label","Scroll left",1,"ai-projects-arrow",3,"click"],[1,"arrow-prev"],[1,"ai-projects-card","border-radius-lg",3,"click"],[1,"ai-projects-image",3,"src","alt"],[1,"ai-projects-label","text-13","text-semi","text-white","text-truncate","align-items-center","ps-2","pe-2","justify-content-center"],["class","ai-projects-play",4,"ngIf"],[1,"ai-projects-play"],["name","playvideo",1,"f-32"],["type","button","aria-label","See all AI generations",1,"ai-projects-see-all",3,"click"],[1,"ai-projects-see-all-arrow"],[1,"arrow-next"],[1,"ai-projects-see-all-text"],[1,"ai-projects-nav","ai-projects-nav--next"],["type","button","aria-label","Scroll right",1,"ai-projects-arrow",3,"click"],[3,"imageClick","
1sliderNextDisableEvent","seeAllEvent","images","imageSize","imagePopup","footerShow","projectNameShow","recentProject","isSubscribed"],[1,"recent-no-project","d-flex","align-items-center","justify-content-center","border-radius-20","ml-13","mr-13"],[1,"d-inline-flex","align-items-center","justify-content-center","mr-10"],["src","https://static.lightxeditor.com/assets/images/empty-folder.png","width","120","height","120",4,"ngIf"],["src","https://static.lightxeditor.com/assets/images/no-project-graphics.png","width","120","height","120",4,"ngIf"],[1,"d-inline-flex","align-items-start","justify-content-center","flex-column"],[1,"grey-800","text-14","mb-3"],[1,"btn-all","btn-outline-primary","btn-h40","text-13",3,"click"],["src","https://static.lightxeditor.com/assets/images/empty-folder.png","width","120","height","120"],["src","https://static.lightxeditor.com/assets/images/no-project-graphics.png","width","120","height","120"]],template:function(e,i){if(1&e&&(t.j41(0,"div",3)(1,"div",4)(2,"h2",5),t.EFF(3),t.k0s(),t.j41(4,"div",6)(5,"div",7),t.DNE(6,ft,2,4,"div",8),t.k0s()()(),t.DNE(7,bt,2,2,"ng-container",9)(8,kt,2,2,"ng-template",null,0,t.C5r),t.k0s()),2&e){const a=t.sdS(9);t.R7$(3),t.JRh(null==i.sectionObj?null:i.sectionObj.title),t.R7$(3),t.Y8G("ngForOf",i.projectTabs),t.R7$(),t.Y8G("ngIf",i.showContentPlaceholder)("ngIfElse",a)}},dependencies:[g.YU,g.Sq,g.bT,J.h,X.b,A.t],styles:['.badge-temp[_ngcontent-%COMP%]{color:#4a4f5e;transition:all .3s ease}.badge-temp[_ngcontent-%COMP%]:hover{background:#e2e3e966!important;border:1px solid #E2E3E9!important}.badge-temp[_ngcontent-%COMP%]:first-child{margin-left:0!important}.badge-temp[_ngcontent-%COMP%]:last-child{margin-right:36px!important}.active[_ngcontent-%COMP%]{background:#626adf;color:#fff!important;border:1px solid #626ADF}.active[_ngcontent-%COMP%]:hover, .active[_ngcontent-%COMP%]:focus{background:#626adf!important;color:#fff!important;border:1px solid #626ADF!important}.active.grey-800[_ngcontent-%COMP%]{color:#fff!important}.show-all[_ngcontent-%COMP%]{position:absolute;right:20px;top:-18px}.category-col[_ngcontent-%COMP%]{min-width:300px;white-space:nowrap;width:calc(100% - 103px)!important;overflow:auto;position:absolute;top:-16px}.recent-no-project[_ngcontent-%COMP%]{background:#e2e3e966;height:205.6px}.ai-projects-carousel[_ngcontent-%COMP%]{position:relative}.ai-projects-track[_ngcontent-%COMP%]{display:flex;align-items:stretch;gap:16px;overflow-x:auto;overflow-y:hidden;scroll-behavior:smooth;scrollbar-width:none}.ai-projects-track[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}.ai-projects-nav[_ngcontent-%COMP%]{position:absolute;top:0;width:60px;height:100%;display:flex;align-items:center;z-index:2;pointer-events:none}.ai-projects-nav--prev[_ngcontent-%COMP%]{left:0;justify-content:flex-end;background:linear-gradient(90deg,#f8f9f9,#f8f9f9e6 34%,#f8f9f999 69%,#fff0)}.ai-projects-nav--next[_ngcontent-%COMP%]{right:0;justify-content:flex-start;background:linear-gradient(90deg,#fff0,#f8f9f999 31%,#f8f9f9e6 66%,#f8f9f9)}.ai-projects-arrow[_ngcontent-%COMP%]{pointer-events:auto;display:flex;align-items:center;justify-content:center;width:36px;height:36px;border:0;border-radius:50%;background:#fff;box-shadow:0 4px 16px #00000014;cursor:pointer;transition:all .3s ease}.ai-projects-arrow[_ngcontent-%COMP%]:hover{background:#eff0fc}.ai-projects-card[_ngcontent-%COMP%]{position:relative;flex:0 0 172px;width:172px;height:172px;border-radius:16px;overflow:hidden;padding:0;background:#f2f3f7;cursor:pointer}.ai-projects-card[_ngcontent-%COMP%] .ai-projects-label[_ngcontent-%COMP%], .ai-projects-card[_ngcontent-%COMP%] .ai-projects-badge[_ngcontent-%COMP%]{opacity:0;visibility:hidden;transition:opacity .1s ease-in-out,visibility .1s ease-in-out}.ai-projects-card[_ngcontent-%COMP%]:first-child{margin-left:40px}.ai-projects-card[_ngcontent-%COMP%]:last-child{margin-right:0}.ai-projects-card[_ngcontent-%COMP%]:hover .ai-projects-label[_ngcontent-%COMP%], .ai-projects-card[_ngcontent-%COMP%]:hover .ai-projects-badge[_ngcontent-%COMP%]{opacity:1;visibility:visible;transition:opacity .1s ease-in-out,visibility .1s ease-in-out}.ai-projects-card[_ngcontent-%COMP%]:hover .ai-projects-play[_ngcontent-%COMP%]{display:none!important}.ai-projects-card[_ngcontent-%COMP%]:hover:after{position:absolute;content:"";height:44px;border-radius:0 0 16px 16px;background:linear-gradient(0deg,#000000a1,#6660);bottom:0;left:0;width:100%;z-index:1}.ai-projects-image[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:cover;display:block}.ai-projects-label[_ngcontent-%COMP%], .ai-projects-badge[_ngcontent-%COMP%]{position:absolute;bottom:8px;z-index:2;border-radius:999px;color:#fff;font-size:12px;font-weight:600;line-height:1}.ai-projects-label[_ngcontent-%COMP%]{width:auto;max-width:calc(100% - 16px);line-height:28px;height:28px;left:8px;border-radius:50px;background:linear-gradient(273deg,#626adfcc,#a64dffcc)}.ai-projects-badge[_ngcontent-%COMP%]{right:8px;min-width:28px;padding:7px 8px;text-align:center;background:#454a5ed1}.ai-projects-play[_ngcontent-%COMP%]{position:absolute;display:flex;align-items:center;justify-content:center;color:#fff;background:linear-gradient(180deg,#00000005,#0000002e);left:8px;bottom:8px;height:28px;width:28px}
1.ai-projects-see-all[_ngcontent-%COMP%]{flex:0 0 76px;width:76px;min-height:172px;margin-right:40px;border:0;background:linear-gradient(90deg,#fff0,#f8f9f9 34% 100%);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:0;cursor:pointer}.ai-projects-see-all-arrow[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:48px;background:linear-gradient(90deg,#df61ff1a -4%,#3ad0ff1a),#fff;box-shadow:0 2px 4px #00000029;display:inline-flex;align-items:center;justify-content:center;position:relative}.ai-projects-see-all-arrow[_ngcontent-%COMP%]:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:48px;padding:1.3px;background:linear-gradient(to right,#df61ff,#3ad0ff);-webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.ai-projects-see-all-text[_ngcontent-%COMP%]{color:#4a4f5e;font-size:14px;font-weight:600;line-height:1.2;white-space:nowrap}']}),r})();var Q=p(67294),Z=p(20999);const Et=["scrollContainer"],Ft=["toolVideo"],Ut=o=>({"marker-left":o}),Rt=o=>({active:o});function Nt(o,r){if(1&o&&(t.qex(0),t.nrm(1,"dashboard-placeholder",6),t.bVm()),2&o){const n=t.XpG();t.R7$(),t.Y8G("type","create-new-design"===(null==n.sectionObj?null:n.sectionObj.type)?"create-new-design":"icon-grid")}}function At(o,r){if(1&o){const n=t.RV6();t.j41(0,"div",20),t.bIt("click",function(){const i=t.eBV(n).$implicit,a=t.XpG(3);return t.Njj(a.onLayoutClick(i))}),t.EFF(1),t.k0s()}if(2&o){const n=r.$implicit,e=t.XpG(3);t.Y8G("ngClass",t.eq3(2,Rt,e.isActiveLayout(n))),t.R7$(),t.SpI(" ",e.getLayoutLabel(n),"")}}function Vt(o,r){if(1&o){const n=t.RV6();t.j41(0,"div",26)(1,"button",27),t.bIt("click",function(){t.eBV(n);const i=t.XpG(4);return t.Njj(i.scrollPrev())}),t.nrm(2,"span",28),t.k0s()()}}function Xt(o,r){1&o&&t.nrm(0,"span",36)}function Bt(o,r){if(1&o){const n=t.RV6();t.j41(0,"div",29),t.bIt("click",function(){const i=t.eBV(n).$implicit,a=t.XpG(4);return t.Njj(a.onFormatClick(i))}),t.j41(1,"div",30),t.DNE(2,Xt,1,0,"span",31),t.nrm(3,"img",32),t.k0s(),t.j41(4,"div",33)(5,"div",34),t.EFF(6),t.k0s(),t.j41(7,"div",35),t.EFF(8),t.k0s()()()}if(2&o){const n=r.$implicit,e=t.XpG(4);t.R7$(2),t.Y8G("ngIf",e.hasNewBadge(n)),t.R7$(),t.Y8G("src",n.thumbUrl,t.B4B)("alt",e.getFormatLabel(n)),t.R7$(3),t.JRh(e.getFormatLabel(n)),t.R7$(2),t.JRh(e.getDimensionText(n))}}function Dt(o,r){if(1&o){const n=t.RV6();t.j41(0,"div",37)(1,"button",38),t.bIt("click",function(){t.eBV(n);const i=t.XpG(4);return t.Njj(i.scrollNext())}),t.nrm(2,"span",39),t.k0s()()}}function Lt(o,r){if(1&o){const n=t.RV6();t.j41(0,"div",21),t.DNE(1,Vt,3,0,"div",22),t.j41(2,"div",23,3),t.bIt("scroll",function(){t.eBV(n);const i=t.XpG(3);return t.Njj(i.onScroll())}),t.DNE(4,Bt,9,5,"div",24),t.k0s(),t.DNE(5,Dt,3,0,"div",25),t.k0s()}if(2&o){const n=t.XpG(3);t.R7$(),t.Y8G("ngIf",n.canScrollPrev),t.R7$(3),t.Y8G("ngForOf",n.visibleFormats)("ngForTrackBy",n.trackByFormat),t.R7$(),t.Y8G("ngIf",n.canScrollNext)}}function $t(o,r){if(1&o){const n=t.RV6();t.j41(0,"div",9)(1,"div",10)(2,"h3",11),t.EFF(3),t.k0s(),t.j41(4,"div",12)(5,"div",13),t.bIt("scroll",function(i){t.eBV(n);const a=t.XpG(2);return t.Njj(a.onScrollTop(i))}),t.DNE(6,At,2,4,"div",14),t.k0s(),t.j41(7,"div",15)(8,"button",16),t.bIt("click",function(){t.eBV(n);const i=t.XpG(2);return t.Njj(i.onSeeAll())}),t.j41(9,"span",17),t.EFF(10,"See All "),t.nrm(11,"pi",18),t.k0s()()()()(),t.DNE(12,Lt,6,4,"div",19),t.k0s()}if(2&o){const n=t.XpG(2);t.R7$(2),t.Y8G("ngClass",t.eq3(5,Ut,n.scrollPosition>1)),t.R7$(),t.JRh(n.sectionTitle),t.R7$(3),t.Y8G("ngForOf",n.scratchLayouts)("ngForTrackBy",n.trackByLayout),t.R7$(6),t.Y8G("ngIf",n.visibleFormats.length)}}function Yt(o,r){if(1&o&&t.nrm(0,"img",53,4),2&o){const n=t.XpG().$implicit;t.Y8G("src",n.url,t.B4B)("alt",n.text)}}function zt(o,r){if(1&o&&(t.j41(0,"video",54,4),t.nrm(2,"source",55),t.k0s()),2&o){const n=t.XpG().$implicit;t.Y8G("muted",!0),t.R7$(2),t.Y8G("src",n.url,t.B4B)}}function Ht(o,r){1&o&&t.nrm(0,"div",56)}function qt(o,r){if(1&o&&t.nrm(0,"img",57),2&o){const n=t.XpG().$implicit;t.Y8G("src",null==n||null==n.metadata?null:n.metadata.iconUrl,t.B4B)}}function Wt(o,r){if(1&o){const n=t.RV6();t.j41(0,"div",45),t.bIt("click",function(){const i=t.eBV(n).$implicit;t.XpG(2);const a=t.sdS(4),l=t.XpG();return t.Njj(l.openTool(i,a))})("mouseenter",function(){const i=t.eBV(n),a=i.$implicit,l=i.index,s=t.XpG(3);return t.Njj(s.playVideo(l,a))})("mouseleave",function(){const i=t.eBV(n),a=i.$implicit,l=i.index,s=t.XpG(3);return t.Njj(s.pauseVideo(l,a))}),t.j41(1,"div",46),t.DNE(2,Yt,2,2,"img",47)(3,zt,3,2,"video",48)(4,Ht,1,0,"div",49),t.k0s(),t.j41(5,"div",50),t.DNE(6,qt,1,1,"img",51),t.j41(7,"span",52),t.EFF(8),t.k0s()()()}if(2&o){const n=r.$implicit;t.R7$(2),t.Y8G("ngIf",!(null!=n&&null!=n.metadata&&n.metadata.isVideo)),t.R7$(),t.Y8G("ngIf",null==n||null==n.metadata?null:n.metadata.isVideo),t.R7$(),t.Y8G("ngIf",null==n||null==n.metadata?null:n.metadata.isNew),t.R7$(2),t.Y8G("ngIf",null==n||null==n.metadata?null:n.metadata.iconUrl),t.R7$(2),t.JRh(n.text)}}function Jt(o,r){if(1&o&&(t.j41(0,"div",40)(1,"div",41)(2,"h2",42),t.EFF(3),t.k0s()(),t.j41(4,"div",43),t.DNE(5,Wt,9,5,"div",44),t.k0s()()),2&o){const n=t.XpG(2);t.R7$(3),t.JRh(n.sectionTitle),t.R7$(2),t.Y8G("ngForOf",n.tools)("ngForTrackBy",n.trackByTool)}}function Kt(o,r){if(1&o){const n=t.RV6();t.DNE(0,$t,13,7,"div",7)(1,Jt,6,3,"ng-template",null,1,t.C5r),t.j41(3,"input",8,2),t.bIt("change",function(i){t.eBV(n);const a=t.XpG();return t.Njj(a.onFileUploaded(i.srcElement.files))})("click",function(){t.eBV(n);const i=t.sdS(4);return t.Njj(i.value="")}
1),t.k0s()}if(2&o){const n=t.sdS(2),e=t.XpG();t.Y8G("ngIf","create-new-design"===(null==e.sectionObj?null:e.sectionObj.type))("ngIfElse",n),t.R7$(3),t.Y8G("accept",e.fileUploadAccept)("multiple",e.multiple)}}let Qt=(()=>{var o;class r extends C.Y{constructor(e,i,a,l,s,c,d,m,_,u,v,B){super(e,a,l,s,c,d,m,_,u,v),this.aiUploadImageService=e,this.storyPageService=i,this.router=l,this.templateService=_,this.createProjectService=B,this.isLoaded=!1,this.scrollPosition=0,this.sectionTitle="",this.tools=[],this.inProgress=!1,this.scratchLayouts=[],this.activeLayoutId=null,this.loadingScratchLayouts=!1,this.canScrollPrev=!1,this.canScrollNext=!1,this.previewMax=120,this.cardStep=188}ngOnChanges(){this.sectionTitle=this.sectionObj?.title||"",this.tools=this.sectionObj?.links||[],this.isScratchFormatsType()&&!this.scratchLayouts.length&&!this.loadingScratchLayouts&&this.loadScratchLayouts()}ngAfterViewInit(){setTimeout(()=>this.updateScrollState(),0)}get showPlaceholder(){return this.isScratchFormatsType()?!this.isLoaded||this.loadingScratchLayouts||!this.activeLayout:!this.isLoaded}trackByTool(e,i){return i?.metadata?.productId||i?.text||e}trackByLayout(e,i){return i?.parentId||i?.socialParentType||e}trackByFormat(e,i){return i?.socialPlatformId||`${i?.socialPlatform}-${e}`}showPlayIcon(e){const i=e?.metadata||{};return 1==i.isplayIcon||!!i.videoUrl||!!i.videoThumbUrl}openTool(e,i){if(this.inProgress)return;this.inProgress=!0;const a=e?.img?.item||e;if(a&&a.subType==f.b.slug.toolWithoutStory)try{super.openTool(a,i,this.sectionTitle)}catch{return void setTimeout(()=>{this.inProgress=!1},100)}finally{return void setTimeout(()=>{this.inProgress=!1},100)}this.storyPageService.getStoryPageContent(a.type,"story",a.subType,l=>{const s=l.body.storyPage;if(s){const c=s.sections[0];let d=null;if("mixed-banner-header"==c.type&&c.links.length){d=c.links[0].metadata;let v=this.aiUploadImageService.getParams(d.queryString);d=Object.assign({},d,v),d.mediaType="IMG",d.tab=d.toolName}const m=s.sections[0].metadata&&s.sections[0].metadata.queryString?this.aiUploadImageService.getParams(s.sections[0].metadata.queryString):{},_=Object.assign({},s.sections[0].metadata,s.metadata,m,d);_.subType=a.subType,_.text=a.text,_.title=this.sectionTitle,_.tab=_.tab||_.toolName,_.from="user-dashboard";const u={...a,metadata:_};super.openTool(u,i,this.sectionTitle)}setTimeout(()=>{this.inProgress=!1},100)},l=>{setTimeout(()=>{this.inProgress=!1},100),this.toastService.showError(l?.description)})}onLayoutClick(e){this.activeLayoutId=e?.parentId??null;const i=this.scrollContainer?.nativeElement;i&&(i.scrollLeft=0),setTimeout(()=>this.updateScrollState(),0)}onFormatClick(e){this.router.navigate(["/design-editor/edit"],{queryParams:{action:"default_project",tab:Q.sv.TEMPLATE,social_platform_id:e.socialPlatformId,format:e.format,h:e.height,w:e.width}}),this.pushDefaultGtmTag(e.socialPlatform)}onSeeAll(){this.createProjectService.createProjectFromScratch(V.If.DESIGN),this.pushDefaultGtmTag("See All")}pushDefaultGtmTag(e){const i={eventName:f.b.gtm.eventname.userDashboard,itemName:e,itemType:this.sectionTitle+" - "+e};i.itemName&&this.gtmService.pushTag(i)}scrollPrev(){const e=this.scrollContainer?.nativeElement;e&&e.scrollBy({left:3*-this.cardStep,behavior:"smooth"})}scrollNext(){const e=this.scrollContainer?.nativeElement;e&&e.scrollBy({left:3*this.cardStep,behavior:"smooth"})}onScroll(){this.updateScrollState()}get activeLayout(){return this.scratchLayouts.find(e=>e.parentId===this.activeLayoutId)||null}get visibleFormats(){return this.activeLayout?.socialPlatformFormats||[]}getLayoutLabel(e){return e?.socialParentType||""}getFormatLabel(e){return e?.socialPlatform||""}isActiveLayout(e){return e?.parentId===this.activeLayoutId}getDimensionText(e){return`${e.width} x ${e.height} px`}getCardStyle(e){const i=Math.min(176,Math.max(132,(e.previewWidth||this.previewMax)+28));return{width:`${i}px`,minWidth:`${i}px`,maxWidth:`${i}px`}}getFrameStyle(e){return{width:`${(e.previewWidth||this.previewMax)+20}px`,height:`${(e.previewHeight||this.previewMax)+20}px`}}getThumbStyle(e){return{width:`${e.previewWidth||this.previewMax}px`,height:`${e.previewHeight||this.previewMax}px`}}hasNewBadge(e){return!0===e?.isNew||1===e?.isNew}isScratchFormatsType(){return"create-new-design"===this.sectionObj?.type}loadScratchLayouts(){this.loadingScratchLayouts=!0,this.templateService.getCreateFromScratchData(1,!1,e=>{this.scratchLayouts=(e?.body?.socialPlatformsList||[]).filter(a=>a?.socialParentType?.toLowerCase()!==P.zu.Popular).map(a=>({...a,socialPlatformFormats:(a?.socialPlatformFormats||[]).map(l
1=>{const s=this.getPreviewSize(l?.width,l?.height);return{...l,previewWidth:s.width,previewHeight:s.height}})})).filter(a=>a.socialPlatformFormats.length>0),this.activeLayoutId=this.scratchLayouts[0]?.parentId??null,this.loadingScratchLayouts=!1,setTimeout(()=>this.updateScrollState(),0)},()=>{this.scratchLayouts=[],this.activeLayoutId=null,this.loadingScratchLayouts=!1})}getPreviewSize(e,i){return e&&i?e>=i?{width:this.previewMax,height:Math.max(72,Math.round(i*this.previewMax/e))}:{width:Math.max(72,Math.round(e*this.previewMax/i)),height:this.previewMax}:{width:this.previewMax,height:this.previewMax}}updateScrollState(){const e=this.scrollContainer?.nativeElement;if(!e)return this.canScrollPrev=!1,void(this.canScrollNext=!1);const i=e.scrollWidth-e.clientWidth;this.canScrollPrev=e.scrollLeft>4,this.canScrollNext=i>4&&e.scrollLeft<i-4}onScrollTop(e){this.scrollPosition=e.target.scrollLeft}playVideo(e,i){const a=this.toolVideos.toArray()[e]?.nativeElement;a&&i.metadata.isVideo&&(a.currentTime=0,a.play().catch(()=>{}))}pauseVideo(e,i){const a=this.toolVideos.toArray()[e]?.nativeElement;a&&i.metadata.isVideo&&(a.pause(),a.currentTime=0)}}return(o=r).\u0275fac=function(e){return new(e||o)(t.rXU(j.M),t.rXU(y.K),t.rXU(E.A),t.rXU(h.Ix),t.rXU(O.k),t.rXU(I.A),t.rXU(F.B),t.rXU(S.f),t.rXU(U.I),t.rXU(R.g),t.rXU(N.y),t.rXU(Z.Zg))},o.\u0275cmp=t.VBU({type:o,selectors:[["start-from-scratch"]],viewQuery:function(e,i){if(1&e&&(t.GBs(Et,5),t.GBs(Ft,5)),2&e){let a;t.mGM(a=t.lsd())&&(i.scrollContainer=a.first),t.mGM(a=t.lsd())&&(i.toolVideos=a)}},inputs:{sectionObj:"sectionObj",isLoaded:"isLoaded"},features:[t.Vt3,t.OA$],decls:3,vars:2,consts:[["bannerContent",""],["defaultStartFromScratch",""],["file",""],["scrollContainer",""],["toolVideo",""],[4,"ngIf","ngIfElse"],[3,"type"],["class","scratch-layouts",4,"ngIf","ngIfElse"],["id","fileInputId","name","fileInputId","type","file",1,"custom-file-input","d-none",3,"change","click","accept","multiple"],[1,"scratch-layouts"],[1,"d-flex","align-items-center","h-40","mb-9","ml-13"],[1,"text-24","text-bold","grey-800","mb-0","text-nowrap","new_item","pe-0",3,"ngClass"],[1,"d-flex","justify-content-between","w-100","ml-10","position-relative"],[1,"new-scroll-behave","category-col",3,"scroll"],["class","badge badge-temp me-2 h-32 ps-3 pe-3 grey-800 text-medium text-13 border-radius-8",3,"ngClass","click",4,"ngFor","ngForOf","ngForTrackBy"],[1,"show-all","marker-right"],[1,"btn","btn-grey","btn-h36","text-13","text-semi","grey-600","d-flex","align-items-center","pl-9","pe-1","border-0","border-radius-12",2,"transition","opacity 0.3s ease","opacity","1",3,"click"],[1,"d-flex","align-items-center"],["name","arrowdashbaord",1,"grey-600"],["class","position-relative",4,"ngIf"],[1,"badge","badge-temp","me-2","h-32","ps-3","pe-3","grey-800","text-medium","text-13","border-radius-8",3,"click","ngClass"],[1,"position-relative"],["class","scratch-layouts-nav scratch-layouts-nav--prev",4,"ngIf"],[1,"scratch-layouts-track","new-scroll-behave",3,"scroll"],["class","scratch-layouts-card bg-white",3,"click",4,"ngFor","ngForOf","ngForTrackBy"],["class","scratch-layouts-nav scratch-layouts-nav--next",4,"ngIf"],[1,"scratch-layouts-nav","scratch-layouts-nav--prev"],["type","button","aria-label","Scroll left",1,"scratch-layouts-arrow",3,"click"],[1,"arrow-prev"],[1,"scratch-layouts-card","bg-white",3,"click"],[2,"max-width","205px","max-height","205px"],["class","new_item scratch-layouts__new","aria-label","New",4,"ngIf"],["loading","lazy",2,"max-width","205px","max-height","205px",3,"src","alt"],[1,"ps-1","pe-1","mt-9"],[1,"text-14","text-semi","grey-800","text-truncate",2,"width","99.9%"],[1,"text-12","grey-500","text-medium","lh-140","mt-1"],["aria-label","New",1,"new_item","scratch-layouts__new"],[1,"scratch-layouts-nav","scratch-layouts-nav--next"],["type","button","aria-label","Scroll right",1,"scratch-layouts-arrow",3,"click"],[1,"arrow-next"],[1,"editing-tools",2,"padding-right","40px"],[1,"d-flex","align-items-center","justify-content-start","h-40","mb-9"],[1,"text-24","text-bold","grey-800","m-0","lh-125"],[1,"editing-tools-container"],["class","editing-tool-card text-center d-flex align-items-center justify-content-center overflow-hidden pointer flex-column bg-white border-radius-lg",3,"click","mouseenter","mouseleave",4,"ngFor","ngForOf","ngForTrackBy"],[1,"editing-tool-card","text-center","d-flex","align-items-center","justify-content-center","overflow-hidden","pointer","flex-column","bg-white","border-radius-lg",3,"click","mouseenter","mouseleave"],[1,"image-thumb-col","d-flex","align-items-center","justify-content-center","border-radius-12","overflow-hidden","position-relative"],["preload","metadata","loading","lazy",3,"src","alt",4,"ngIf"],["loop","","playsinline","","style","width: 100%; height: auto;",3,"muted",4,"ngIf"],["class","new_item p-0 position-absolute new_item_new",4,"ngIf"],[1,"d-flex","align-items-center","justify-content-center","mt-9"],["class","me-2",3,"src",4,"ngIf"],[1,"text-14","lh-160","grey-800","text-semi"],["preload","metadata","loading","lazy",3,"src","alt"],["loop","","playsinline","",2,"width","100%","height","auto",3,"muted"],["type","video/mp4",3,"src"],[1,"new_item","p-0","position-absolute","new_item_new"],[1,"me-2",3,"src"]],template:function(e,i){if(1&e&&t.DNE(0,Nt,2,1,"ng-container",5)(1,Kt,5,4,"ng-template",null,0,t.C5r),2&e){const a=t.sdS(2);t.Y8G("ngIf",i.showPlaceholder)("ngIfElse",a)}},dependencies:[g.YU,g.Sq,g.bT,X.b,A.t],styles:['.editing-tools[_ngcontent-%COMP%] .editing-tools-container[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fit,minmax(235px,1fr));gap:16px;width:100%}.editing-tools[_ngcontent-%COMP%] .editing-tools-container[_ngcontent-%COMP%] .editing-tool-card[_ngcontent-%COMP%]{width:100%;height:180px;max-width:440px;min-width:235px;border:1px solid #E2E3E9;padding:4px 4px 8px;transition:all .5s cubic-bezier(.22,1,.36,1)}.editing-tools[_ngcontent-%COMP%] .editing-tools-container[_ngcontent-%COMP%] .editing-tool-card[_ngcontent-%COMP%] .image-thumb-col[_ngcontent-%COMP%]{width:100%;height:132px}.editing-tools[_ngcontent-%COMP%] .editing-tools-container[_ngcontent-%COMP%] .editing-tool-card[_ngcontent-%COMP%] .image-thumb-col[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:cover}.editing-tools[_ngcontent-%COMP%] .editing-tools-container[_ngcontent-%COMP%] .editing-tool-card[_ngcontent-%COMP%]:hover{box-shadow:0 8px 24px #00000026}.editing-tools[_ngcontent-%COMP%] .editing-tools-container[_ngcontent-%COMP%] .editing-tool-card[_ngcontent-%COMP%] .new_item[_ngcontent-%COMP%]{width:28px;height:16px;top:8px;right:8px}.editing-tools[_ngcontent-%COMP%] .editing-tools-container[_ngcontent-%COMP%] .editing-tool-card[_ngcontent-%COMP%] .new_item[_ngcontent-%COMP%]:after{top:0!important;padding:0}.scratch-layouts-track[_ngcontent-%COMP%]{display:flex;align-items:flex-end;
1gap:16px;overflow-x:auto;overflow-y:hidden;padding:0 0 30px;scroll-behavior:smooth;scrollbar-width:none;min-height:274px;margin-bottom:-30px}.scratch-layouts-track[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}.scratch-layouts-card[_ngcontent-%COMP%]{flex:0 0 auto;border-radius:16px;padding:4px 4px 8px;text-align:left;cursor:pointer;transition:all .5s cubic-bezier(.22,1,.36,1)}.scratch-layouts-card[_ngcontent-%COMP%]:first-child{margin-left:40px}.scratch-layouts-card[_ngcontent-%COMP%]:last-child{margin-right:40px}.scratch-layouts-card[_ngcontent-%COMP%]:hover{box-shadow:0 8px 24px #00000026}.scratch-layouts__new[_ngcontent-%COMP%]{position:absolute;top:8px;right:8px;z-index:1}.scratch-layouts-nav[_ngcontent-%COMP%]{position:absolute;top:0;width:60px;height:100%;display:flex;align-items:center;z-index:2;pointer-events:none}.scratch-layouts-nav--prev[_ngcontent-%COMP%]{left:0;justify-content:flex-end;background:linear-gradient(90deg,#f8f9f9,#f8f9f9e6 34%,#f8f9f999 69%,#fff0)}.scratch-layouts-nav--next[_ngcontent-%COMP%]{right:0;justify-content:flex-start;background:linear-gradient(90deg,#fff0,#f8f9f999 31%,#f8f9f9e6 66%,#f8f9f9)}.scratch-layouts-arrow[_ngcontent-%COMP%]{pointer-events:auto;display:flex;align-items:center;justify-content:center;width:36px;height:36px;border:0;border-radius:50%;background:#fff;box-shadow:0 4px 16px #00000014;cursor:pointer;transition:all .3s ease;margin-top:-30px}.scratch-layouts-arrow[_ngcontent-%COMP%] .arrow-prev[_ngcontent-%COMP%]{transform:rotate(180deg);display:block;content:url(https://static.lightxeditor.com/assets/icons/arrow-grey.svg)}.scratch-layouts-arrow[_ngcontent-%COMP%] .arrow-next[_ngcontent-%COMP%]{display:block;content:url(https://static.lightxeditor.com/assets/icons/arrow-grey.svg)}.scratch-layouts-arrow[_ngcontent-%COMP%]:hover{background:#eff0fc}.badge-temp[_ngcontent-%COMP%]{color:#4a4f5e;transition:all .3s ease}.badge-temp[_ngcontent-%COMP%]:hover{background:#e2e3e966!important;border:1px solid #E2E3E9!important}.badge-temp[_ngcontent-%COMP%]:first-child{margin-left:0!important}.badge-temp[_ngcontent-%COMP%]:last-child{margin-right:36px!important}.active[_ngcontent-%COMP%]{background:#626adf;color:#fff!important;border:1px solid #626ADF}.active[_ngcontent-%COMP%]:hover, .active[_ngcontent-%COMP%]:focus{background:#626adf!important;color:#fff!important;border:1px solid #626ADF!important}.active.grey-800[_ngcontent-%COMP%]{color:#fff!important}.show-all[_ngcontent-%COMP%]{position:absolute;right:20px;top:-18px}.category-col[_ngcontent-%COMP%]{min-width:300px;white-space:nowrap;width:calc(100% - 103px)!important;overflow:auto;position:absolute;top:-16px}.new-scroll-behave[_ngcontent-%COMP%]{-ms-overflow-style:none;scrollbar-width:none}.new-scroll-behave[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}.marker-left[_ngcontent-%COMP%]{position:relative}.marker-left[_ngcontent-%COMP%]:before{position:absolute;content:"";width:36px;height:42px;background:linear-gradient(90deg,#f8f9f900,#f8f9f9);transform:rotate(-180deg);right:-55px;top:-5px;z-index:9}.marker-right[_ngcontent-%COMP%]{position:absolute}.marker-right[_ngcontent-%COMP%]:before{position:absolute;content:"";width:36px;height:42px;background:linear-gradient(90deg,#f8f9f900,#f8f9f9);left:-36px;top:-1px}.text-marker.marker-left[_ngcontent-%COMP%]:before{display:none!important}.new_item[_ngcontent-%COMP%]:after{top:calc(50% - 20px)!important}']}),r})();var H=p(3726);function Zt(o,r){1&o&&(t.qex(0),t.nrm(1,"dashboard-placeholder",3),t.bVm()),2&o&&(t.R
17$(),t.Y8G("cardCount",10))}function te(o,r){if(1&o&&t.nrm(0,"img",17),2&o){const n=t.XpG().$implicit;t.Y8G("src",n.url||(null==n||null==n.metadata?null:n.metadata.iconUrl),t.B4B)("alt",n.text)}}function ee(o,r){if(1&o){const n=t.RV6();t.j41(0,"div",11)(1,"magic-card",12)(2,"div",13),t.bIt("click",function(){const i=t.eBV(n).$implicit;t.XpG(2);const a=t.sdS(2),l=t.XpG();return t.Njj(l.openTool(i,a))}),t.DNE(3,te,1,2,"img",14),t.k0s()(),t.j41(4,"div",15)(5,"span",16),t.bIt("click",function(){const i=t.eBV(n).$implicit;t.XpG(2);const a=t.sdS(2),l=t.XpG();return t.Njj(l.openTool(i,a))}),t.EFF(6),t.k0s()()()}if(2&o){const n=r.$implicit;t.R7$(),t.AVh("new_item",null==n||null==n.metadata?null:n.metadata.isNew),t.R7$(2),t.Y8G("ngIf",n.url),t.R7$(3),t.JRh(n.text)}}function ie(o,r){if(1&o&&(t.j41(0,"div",6)(1,"div",7)(2,"h2",8),t.EFF(3),t.k0s()(),t.j41(4,"div",9),t.DNE(5,ee,7,4,"div",10),t.k0s()()),2&o){const n=t.XpG(2);t.R7$(3),t.JRh(n.sectionTitle),t.R7$(2),t.Y8G("ngForOf",n.tools)("ngForTrackBy",n.trackByTool)}}function ne(o,r){if(1&o){const n=t.RV6();t.DNE(0,ie,6,3,"div",4),t.j41(1,"input",5,1),t.bIt("change",function(i){t.eBV(n);const a=t.XpG();return t.Njj(a.onFileUploaded(i.srcElement.files))})("click",function(){t.eBV(n);const i=t.sdS(2);return t.Njj(i.value="")}),t.k0s()}if(2&o){const n=t.XpG();t.Y8G("ngIf",n.tools.length),t.R7$(),t.Y8G("accept",n.aiUploadImageService.fileImageAccept)}}let oe=(()=>{var o;class r extends C.Y{constructor(e,i,a,l,s,c,d,m,_,u,v){super(e,a,l,s,c,d,m,_,u,v),this.aiUploadImageService=e,this.storyPageService=i,this.isLoaded=!1,this.sectionTitle="",this.tools=[]}ngOnChanges(){this.sectionTitle=this.sectionObj?.title,this.tools=this.sectionObj?.links||[]}get showPlaceholder(){return!this.isLoaded}openTool(e,i){this.getStoryPage({img:{item:e}},i)}trackByTool(e,i){return i?.metadata?.productId||i?.text||e}getStoryPage(e,i){const a=e.img.item;a&&a.subType==f.b.slug.toolWithoutStory?super.openTool(a,i,this.sectionTitle):this.storyPageService.getStoryPageContent(a.type,"story",a.subType,l=>{const s=l.body.storyPage;if(s){const c=super.getMetadata(s,a);this.sectionObj?.title&&(c.title=this.sectionObj.title),c.tab=c.tab||c.toolName,c.from="user-dashboard";const d={...a,metadata:c};super.openTool(d,i,this.sectionTitle)}},l=>{this.toastService.showError(l?.description)})}}return(o=r).\u0275fac=function(e){return new(e||o)(t.rXU(j.M),t.rXU(y.K),t.rXU(E.A),t.rXU(h.Ix),t.rXU(O.k),t.rXU(I.A),t.rXU(F.B),t.rXU(S.f),t.rXU(U.I),t.rXU(R.g),t.rXU(N.y))},o.\u0275cmp=t.VBU({type:o,selectors:[["ai-tools"]],inputs:{sectionObj:"sectionObj",isLoaded:"isLoaded"},features:[t.Vt3,t.OA$],decls:3,vars:2,consts:[["toolsContent",""],["file",""],[4,"ngIf","ngIfElse"],["type","ai-tools",3,"cardCount"],["class","editing-tools","style","padding-left: 40px; padding-right: 40px;",4,"ngIf"],["id","fileInputId","name","fileInputId","type","file",1,"custom-file-input","d-none",3,"change","click","accept"],[1,"editing-tools",2,"padding-left","40px","padding-right","40px"],[1,"d-flex","align-items-center","justify-content-start","h-40","mb-9"],[1,"text-24","text-bold","grey-800","m-0","lh-125"],[1,"editing-tools-container"],["class","editing-tool-card text-center d-flex align-items-center justify-content-center flex-column",4,"ngFor","ngForOf","ngForTrackBy"],[1,"editing-tool-card","text-center","d-flex","align-items-center","justify-content-center","flex-column"],[1,"position-relative"],[1,"icon-box","d-flex","align-items-center","justify-content-center","mx-auto","border-radius-lg","position-relative","pointer",3,"click"],["class","ai-tools-grid__icon","loading","lazy",3,"src","alt",4,"ngIf"],[1,"d-flex","align-items-start","justify-content-center","text-14","grey-800","lh-125","text-medium","w-100","mt-2",2,"min-height","36px"],[1,"pointer",3,"click"],["loading","lazy",1,"ai-tools-grid__icon",3,"src","alt"]],template:function(e,i){if(1&e&&t.DNE(0,Zt,2,1,"ng-container",2)(1,ne,3,2,"ng-template",null,0,t.C5r),2&e){const a=t.sdS(2);t.Y8G("ngIf",i.showPlaceholder)("ngIfElse",a)}},dependencies:[g.Sq,g.bT,A.t,H.z],styles:[".editing-tools[_ngcontent-%COMP%] .editing-tools-container[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(8,minmax(127px,1fr));gap:16px;width:100%}.editing-tools[_ngcontent-%COMP%] .editing-tools-container[_ngcontent-%COMP%] .editing-tool-card[_ngcontent-%COMP%]{width:100%;height:104px;min-width:127px}.editing-tools[_ngcontent-%COMP%] .editing-tools-container[_ngcontent-%COMP%] .editing-tool-card[_ngcontent-%COMP%] .icon-box[_ngcontent-%COMP%]{height:60px;width:60px}.editing-tools[_ngcontent-%COMP%] .editing-tools-container[_ngcontent-%COMP%] .editing-tool-card[_ngcontent-%COMP%] .new_item[_ngcontent-%COMP%]{padding:0!important}.editing-tools[_ngcontent-%COMP%] .editing-tools-container[_ngcontent-%COMP%] .editing-tool-card[_ngcontent-%COMP%] .new_item[_ngcontent-%COMP%]:after{top:-4px;padding:0;position:absolute;z-index:9;right:-4px;
1height:16px}@media only screen and (min-width: 2600px) and (max-width: 4000px){.editing-tools-container[_ngcontent-%COMP%]{grid-template-columns:repeat(12,minmax(127px,1fr))!important}}@media only screen and (min-width: 1920px) and (max-width: 2400px){.editing-tools-container[_ngcontent-%COMP%]{grid-template-columns:repeat(9,minmax(127px,1fr))!important}}@media only screen and (min-width: 1340px) and (max-width: 1600px){.editing-tools-container[_ngcontent-%COMP%]{grid-template-columns:repeat(7,minmax(127px,1fr))!important}}@media only screen and (min-width: 1100px) and (max-width: 1339px){.editing-tools-container[_ngcontent-%COMP%]{grid-template-columns:repeat(6,minmax(127px,1fr))!important}}@media only screen and (min-width: 800px) and (max-width: 1080px){.editing-tools-container[_ngcontent-%COMP%]{grid-template-columns:repeat(4,minmax(127px,1fr))!important}}@media (max-width: 768px){.editing-tools-container[_ngcontent-%COMP%]{grid-template-columns:repeat(4,minmax(127px,1fr))!important}}@media (max-width: 576px){.editing-tools-container[_ngcontent-%COMP%]{grid-template-columns:1fr!important}}"]}),r})();var ae=p(65290);const se=o=>({"card-below-align":o});function re(o,r){1&o&&(t.qex(0),t.nrm(1,"dashboard-placeholder",3),t.bVm()),2&o&&(t.R
17$(),t.Y8G("cardCount",8))}function le(o,r){if(1&o&&t.nrm(0,"img",16),2&o){const n=t.XpG().$implicit;t.Y8G("src",n.url,t.B4B)("alt",n.text)}}function ce(o,r){if(1&o){const n=t.RV6();t.j41(0,"magic-card",11),t.bIt("click",function(){const i=t.eBV(n).$implicit;t.XpG(2);const a=t.sdS(2),l=t.XpG();return t.Njj(l.openToolDirect(i,a))}),t.j41(1,"div",12)(2,"span",13),t.EFF(3),t.k0s(),t.j41(4,"span",14),t.DNE(5,le,1,2,"img",15),t.k0s()()()}if(2&o){const n=r.$implicit;t.AVh("new_item",null==n||null==n.metadata?null:n.metadata.isNew),t.R7$(3),t.JRh(n.text),t.R7$(2),t.Y8G("ngIf",n.url)}}function de(o,r){if(1&o&&(t.j41(0,"div",6)(1,"div",7)(2,"h2",8),t.EFF(3),t.k0s()(),t.j41(4,"div",9),t.DNE(5,ce,6,4,"magic-card",10),t.k0s()()),2&o){const n=t.XpG(2);t.R7$(3),t.JRh(n.sectionTitle),t.R7$(),t.Y8G("ngClass",t.eq3(4,se,n.tools.length<=3)),t.R7$(),t.Y8G("ngForOf",n.tools)("ngForTrackBy",n.trackByTool)}}function pe(o,r){if(1&o){const n=t.RV6();t.DNE(0,de,6,6,"div",4),t.j41(1,"input",5,1),t.bIt("change",function(i){t.eBV(n);const a=t.XpG();return t.Njj(a.onFileUploaded(i.srcElement.files))})("click",function(){t.eBV(n);const i=t.sdS(2);return t.Njj(i.value="")}),t.k0s()}if(2&o){const n=t.XpG();t.Y8G("ngIf",n.tools.length),t.R7$(),t.Y8G("accept",n.fileUploadAccept)("multiple",n.multiple)}}let me=(()=>{var o;class r extends C.Y{constructor(e,i,a,l,s,c,d,m,_,u,v,B){super(e,i,a,l,s,c,d,m,_,u),this.aiUploadImageService=e,this.router=a,this.templateService=m,this.storyPageService=v,this.quickEditService=B,this.inProgress=!1,this.isLoaded=!1,this.sectionTitle="",this.tools=[],this.loadingTools=!1}ngOnChanges(){this.sectionTitle=this.sectionObj?.title,"quick-edit-tools"!==this.sectionObj?.type?(this.loadingTools=!1,this.tools=this.sectionObj?.links||[]):this.loadQuickEditTools()}get showPlaceholder(){return!this.isLoaded||this.loadingTools}loadQuickEditTools(){this.loadingTools=!0,this.tools=[],this.quickEditService.getQuickEditsLists(0,e=>{this.tools=(e?.body?.dynamicFeatureTypes||[]).map(a=>this.mapQuickEditTool(a)),this.loadingTools=!1},()=>{this.tools=[],this.loadingTools=!1})}mapQuickEditTool(e){return{id:e.id,text:e.featureName,url:e?.thumbLandscapeUrl||e?.thumbSquareUrl||e?.mobileAppFeatureIcon||e?.squareVideoUrl,metadata:{featureType:e.featureType,mediaType:"IMG",iconUrl:e.mobileResponsiveWebFeatureIcon,isNew:e.isNew,isQuickEdit:!0,tab:Q.sv.AITOOLS,tabName:"aitools",toolName:"aitools",subTool:e.featureType,editorType:P._Y.Photo,from:"user-dashboard"}}}trackByTool(e,i){return i?.id||i?.metadata?.productId||i?.text||e}openToolDirect(e,i){e?.metadata?.isQuickEdit?super.openTool(e,i,this.sectionTitle):this.openTool({img:{item:e}},i)}openTool(e,i){if(this.inProgress)return;this.inProgress=!0;const a=e.img.item;if(a&&a.subType==f.b.slug.toolWithoutStory)return super.openTool(a,i,this.sectionTitle),void setTimeout(()=>{this.inProgress=!1},100);this.storyPageService.getStoryPageContent(a.type,"story",a.subType,l=>{const s=l.body.storyPage;if(s){const c=super.getMetadata(s,a);this.sectionObj?.title&&(c.title=this.sectionObj.title);const d={...a,metadata:c};super.openTool(d,i,this.sectionTitle)}setTimeout(()=>{this.inProgress=!1},100)},l=>{setTimeout(()=>{this.inProgress=!1},100),this.toastService.showError(l?.description)})}}return(o=r).\u0275fac=function(e){return new(e||o)(t.rXU(j.M),t.rXU(E.A),t.rXU(h.Ix),t.rXU(O.k),t.rXU(I.A),t.rXU(F.B),t.rXU(S.f),t.rXU(U.I),t.rXU(R.g),t.rXU(N.y),t.rXU(y.K),t.rXU(ae.P))},o.\u0275cmp=t.VBU({type:o,selectors:[["editing-tools"]],inputs:{sectionObj:"sectionObj",isLoaded:"isLoaded"},features:[t.Vt3,t.OA$],decls:3,vars:2,consts:[["toolsContent",""],["file",""],[4,"ngIf","ngIfElse"],["type","editing-tools",3,"cardCount"],["class","editing-tools","style","padding-left: 40px; padding-right: 40px;",4,"ngIf"],["id","fileInputId","name","fileInputId","type","file",1,"custom-file-input","d-none",3,"change","click","accept","multiple"],[1,"editing-tools",2,"padding-left","40px","padding-right","40px"],[1,"d-flex","align-items-center","justify-content-start","h-40","mb-9"],[1,"text-24","text-bold","grey-800","m-0","lh-125"],[1,"editing-tools-container",3,"ngClass"],["class","position-relative",3,"new_item","click",4,"ngFor","ngForOf","ngForTrackBy"],[1,"position-relative",3,"click"],[1,"editing-tool-card","d-flex","align-items-center","pointer","w-100","h-100"],[1,"d-inline-flex","align-items-center","justify-content-start","text-heading","text-14","grey-800","lh-140","text-semi","ps-3","pe-2"],[1,"d-inline-flex","image-column"],["loading","lazy",3,"src","alt",4,"ngIf"],["loading","lazy",3,"src","alt"]],template:function(e,i){if(1&e&&t.DNE(0,re,2,1,"ng-container",2)(1,pe,3,3,"ng-template",null,0,t.C5r),2&e){const a=t.sdS(2);t.Y8G("ngIf",i.showPlaceholder)("ngIfElse",a)}},dependencies:[g.YU,g.Sq,g.bT,A.t,H.z],styles:[".editing-tools[_ngcontent-%COMP%] .editing-tools-container[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:16px;width:100%}.editing-tools[_ngcontent-%COMP%] .editing-tools-container[_ngcontent-%COMP%] .editing-tool-card[_ngcontent-%COMP%]{width:100%;height:100px;min-width:234.5px;position:relative;overflow:hidden}.editing-tools[_ngcontent-%COMP%] .editing-tools-container[_ngcontent-%COMP%] .editing-tool-card[_ngcontent-%COMP%] .text-heading[_ngcontent-%COMP%]{width:calc(100% - 100px)}.editing-tools[_ngcontent-%COMP%] .editing-tools-container[_ngcontent-%COMP%] .editing-tool-card[_ngcontent-%COMP%] .image-column[_ngcontent-%COMP%]{height:100px;width:100px}.editing-tools[_ngcontent-%COMP%] .editing-tools-container[_ngcontent-%COMP%] .new_item[_ngcontent-%COMP%]{padding:0!important}.editing-tools[_ngcontent-%COMP%] .editing-tools-container[_ngcontent-%COMP%] .new_item[_ngcontent-%COMP%]:after{top:-4px;padding:0;position:absolute;z-index:99;right:-4px;
1height:16px}@media only screen and (min-width: 2600px) and (max-width: 4000px){.editing-tools-container[_ngcontent-%COMP%]{grid-template-columns:repeat(7,1fr)!important}}@media (max-width: 1920px){.editing-tools-container[_ngcontent-%COMP%]{grid-template-columns:repeat(5,1fr)!important}}@media only screen and (min-width: 1340px) and (max-width: 1600px){.editing-tools-container[_ngcontent-%COMP%]{grid-template-columns:repeat(4,1fr)!important}}@media only screen and (min-width: 1100px) and (max-width: 1339px){.editing-tools-container[_ngcontent-%COMP%]{grid-template-columns:repeat(3,1fr)!important}}@media only screen and (min-width: 800px) and (max-width: 1080px){.editing-tools-container[_ngcontent-%COMP%]{grid-template-columns:repeat(2,1fr)!important}}@media (max-width: 768px){.editing-tools-container[_ngcontent-%COMP%]{grid-template-columns:repeat(2,1fr)!important}}@media (max-width: 576px){.editing-tools-container[_ngcontent-%COMP%]{grid-template-columns:1fr!important}}"]}),r})();function ge(o,r){if(1&o&&t.nrm(0,"img",12),2&o){const n=t.XpG().$implicit;t.Y8G("src",n.url,t.B4B)("alt",n.text)}}function _e(o,r){if(1&o){const n=t.RV6();t.j41(0,"magic-card",7),t.bIt("click",function(){const i=t.eBV(n).$implicit,a=t.XpG(),l=t.sdS(7);return t.Njj(a.openTool(i,l))}),t.j41(1,"div",8)(2,"span",9),t.EFF(3),t.k0s(),t.j41(4,"span",10),t.DNE(5,ge,1,2,"img",11),t.k0s()()()}if(2&o){const n=r.$implicit;t.R7$(3),t.JRh(n.text),t.R7$(2),t.Y8G("ngIf",n.url)}}let ue=(()=>{var o;class r extends C.Y{ngOnChanges(){this.sectionTitle=this.sectionObj.title,this.tools=this.sectionObj.links}constructor(e,i,a,l,s,c,d,m,_,u){super(e,i,a,l,s,c,d,m,_,u),this.aiUploadImageService=e,this.router=a,this.templateService=m,this.sectionTitle="",this.tools=[]}openTool(e,i){const a=e.metadata;a.editorType=P._Y.Photo,super.openTool({metadata:a},i,this.sectionObj?.title)}}return(o=r).\u0275fac=function(e){return new(e||o)(t.rXU(j.M),t.rXU(E.A),t.rXU(h.Ix),t.rXU(O.k),t.rXU(I.A),t.rXU(F.B),t.rXU(S.f),t.rXU(U.I),t.rXU(R.g),t.rXU(N.y))},o.\u0275cmp=t.VBU({type:o,selectors:[["instant-design"]],inputs:{sectionObj:"sectionObj"},features:[t.Vt3,t.OA$],decls:8,vars:3,consts:[["file",""],[1,"editing-tools",2,"padding-left","40px","padding-right","40px"],[1,"d-flex","align-items-center","justify-content-start","h-40","mb-9"],[1,"text-24","text-bold","grey-800","m-0","lh-125"],[1,"editing-tools-container"],[3,"click",4,"ngFor","ngForOf"],["id","fileInputId","name","fileInputId","type","file",1,"custom-file-input","d-none",3,"change","click","accept"],[3,"click"],[1,"editing-tool-card","border-radius-lg","d-flex","align-items-center","overflow-hidden","pointer"],[1,"d-inline-flex","align-items-center","justify-content-start","text-heading","text-14","grey-800","lh-160","text-semi","ps-3","pe-2"],[1,"d-inline-flex","image-column"],["loading","lazy",3,"src","alt",4,"ngIf"],["loading","lazy",3,"src","alt"]],template:function(e,i){if(1&e){const a=t.RV6();t.j41(0,"div",1)(1,"div",2)(2,"h2",3),t.EFF(3),t.k0s()(),t.j41(4,"div",4),t.DNE(5,_e,6,2,"magic-card",5),t.k0s()(),t.j41(6,"input",6,0),t.bIt("change",function(s){return t.eBV(a),t.Njj(i.onFileUploaded(s.srcElement.files))})("click",function(){t.eBV(a);const s=t.sdS(7);return t.Njj(s.value="")}),t.k0s()}2&e&&(t.R7$(3),t.JRh(i.sectionTitle),t.R7$(2),t.Y8G("ngForOf",i.tools),t.R7$(),t.Y8G("accept",i.fileUploadAccept))},dependencies:[g.Sq,g.bT,H.z],styles:[".editing-tools[_ngcontent-%COMP%] .editing-tools-container[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:16px;width:100%}.editing-tools[_ngcontent-%COMP%] .editing-tools-container[_ngcontent-%COMP%] .editing-tool-card[_ngcontent-%COMP%]{width:100%;height:100px;min-width:234.5px;border:1px solid #E2E3E9}.editing-tools[_ngcontent-%COMP%] .editing-tools-container[_ngcontent-%COMP%] .editing-tool-card[_ngcontent-%COMP%] .text-heading[_ngcontent-%COMP%]{width:calc(100% - 100px)}.editing-tools[_ngcontent-%COMP%] .editing-tools-container[_ngcontent-%COMP%] .editing-tool-card[_ngcontent-%COMP%] .image-column[_ngcontent-%COMP%]{height:100px;width:100px}@media only screen and (min-width: 2600px) and (max-width: 4000px){.editing-tools-container[_ngcontent-%COMP%]{grid-template-columns:repeat(7,1fr)!important}}@media (max-width: 1920px){.editing-tools-container[_ngcontent-%COMP%]{grid-template-columns:repeat(5,1fr)!important}}@media only screen and (min-width: 1340px) and (max-width: 1600px){.editing-tools-container[_ngcontent-%COMP%]{grid-template-columns:repeat(4,1fr)!important}}@media only screen and (min-width: 1100px) and (max-width: 1339px){.editing-tools-container[_ngcontent-%COMP%]{grid-template-columns:repeat(3,1fr)!important}}@media only screen and (min-width: 800px) and (max-width: 1080px){.editing-tools-container[_ngcontent-%COMP%]{grid-template-columns:repeat(2,1fr)!important}}@media (max-width: 768px){.editing-tools-container[_ngcontent-%COMP%]{grid-template-columns:repeat(2,1fr)!important}}@media (max-width: 576px){.editing-tools-container[_ngcontent-%COMP%]{grid-template-columns:1fr!important}}"]}),r})();var tt=p(92452),et=p(83609),he=p(1026),fe=p(98140),be=p(83311);let it=(()=>{var o;
1class r{constructor(e,i){this.modalService=e,this.toastService=i}openDesignTemplatePage(e,i,a,l=null){if(e.imageAlias){const s=this.modalService.open(fe.S,{size:"xl modal-dialog-centered",windowClass:"template-dialog"});a&&(s.componentInstance.productAlias=a),s.componentInstance.imageAlias=e.imageAlias,s.componentInstance.isDialog=!0,s.componentInstance.productId=i||e.productId,s.result.then(c=>{l&&l(c)}).catch(c=>{})}else this.toastService.showErrorSingle(f.b.message.templateUrlNotFound)}openVideoTemplatePage(e,i,a,l=null,s){if(e.imageAlias){const c=this.modalService.open(be.d,{size:"xl modal-dialog-centered",windowClass:"template-dialog"});a&&(c.componentInstance.productAlias=a),c.componentInstance.imageAlias=e.imageAlias,c.componentInstance.isDialog=!0,c.componentInstance.productId=i||e.productId,c.componentInstance.sceneParser=s,c.result.then(d=>{l&&l(d)}).catch(d=>{})}else this.toastService.showErrorSingle(f.b.message.templateUrlNotFound)}showPreview(e,i,a=""){const l=this.modalService.open(et.R,{size:"lg",backdrop:"static",windowClass:"preview-dialog"});l.componentInstance.template=e,l.componentInstance.productId=a,l.componentInstance.isSubscribed=i,l.result.then(s=>{}).catch(s=>{})}}return(o=r).\u0275fac=function(e){return new(e||o)(t.KVO(x.Bq),t.KVO(S.f))},o.\u0275prov=t.jDH({token:o,factory:o.\u0275fac}),r})();var ve=p(84301);const ye=["scrollableDiv"],xe=(o,r,n)=>({"marker-left":o,"text-marker":r,new_item:n}),Ce=o=>({"marker-left":o}),Te=o=>({active:o}),Pe=o=>({transition:o}),je=o=>({graphicsAssests:o});function we(o,r){if(1&o&&(t.j41(0,"div",12),t.nrm(1,"pi",13),t.k0s()),2&o){const n=t.XpG();t.Y8G("ngClass",t.eq3(1,Ce,n.scrollPosition>1))}}function Oe(o,r){if(1&o){const n=t.RV6();t.j41(0,"div",15),t.bIt("click",function(){const i=t.eBV(n).$implicit,a=t.XpG(2);return t.Njj(a.selectProduct(i))}),t.EFF(1),t.k0s()}if(2&o){const n=r.$implicit,e=t.XpG(2);t.Y8G("ngClass",t.eq3(2,Te,e.activeId==(null==n||null==n.metadata?null:n.metadata.productId))),t.R7$(),t.SpI(" ",null==n||null==n.metadata?null:n.metadata.displayName,"")}}function Ie(o,r){if(1&o&&(t.j41(0,"div"),t.DNE(1,Oe,2,4,"div",14),t.k0s()),2&o){const n=t.XpG();t.R7$(),t.Y8G("ngForOf",n.products)}}function Se(o,r){if(1&o){const n=t.RV6();t.j41(0,"div",16)(1,"button",17),t.bIt("click",function(){t.eBV(n);const i=t.XpG();return t.Njj(i.showAllproduct())}),t.j41(2,"span",18),t.EFF(3,"See All "),t.nrm(4,"pi",19),t.k0s()()()}if(2&o){const n=t.XpG();t.Y8G("ngClass",t.eq3(1,Pe,n.viewAllDisable))}}function Me(o,r){if(1&o&&(t.qex(0),t.nrm(1,"dashboard-placeholder",20),t.bVm()),2&o){const n=t.XpG();t.R7$(),t.Y8G("sliderCardCount",(null==n.selectedProductObj||null==n.selectedProductObj.imageObjects?null:n.selectedProductObj.imageObjects.length)||8)}}function ke(o,r){if(1&o){const n=t.RV6();t.j41(0,"div",22)(1,"ng-image-slider",23,2),t.bIt("imageClick",function(i){t.eBV(n);const a=t.XpG(2);return t.Njj(a.templateClick(i))})("previewClick",function(i){t.eBV(n);const a=t.XpG(2);return t.Njj(a.showPreview(i))})("sliderNextDisableEvent",function(i){t.eBV(n);const a=t.XpG(2);return t.Njj(a.sliderNextDisable(i))})("seeAllEvent",function(){t.eBV(n);const i=t.XpG(2);return t.Njj(i.showAllproduct())}),t.k0s()()}if(2&o){const n=t.XpG(2);t.Y8G("ngClass",t.eq3(7,je,n.isGraphics)),t.R7$(),t.Y8G("images",n.selectedProductObj.imageObjects)("isSubscribed",n.user&&n.user.subscribed)("imageSize",n.selectedProductObj.imageSizel)("imagePopup",!1)("graphic",n.isGraphics)("footerShow",!0)}}function Ge(o,r){if(1&o&&t.DNE(0,ke,3,9,"div",21),2&o){const n=t.XpG();t.Y8G("ngIf",n.selectedProductObj)}}let Ee=(()=>{var o;class r extends C.Y{constructor(e,i,a,l,s,c,d,m,_,u,v,B,xn,Cn,Tn){super(d,m,c,_,u,v,B,xn,Cn,Tn),this.activeModal=e,this.authService=i,this.openTemplatePage=a,this.modalService=l,this.sceneParser=s,this.router=c,this.aiUploadImageService=d,this.isGraphics=!1,this.stepTitle="",this.products=[],this.imagesOfProductMap=new Map,this.selectedProductObj=null,this.activeId=0,this.viewAllDisable=!1,this.scrollPosition=0,this.isTemplatesLoading=!0,this.user=this.authService.currentUser()}ngOnChanges(){this.isTemplatesLoading=!0,this.stepTitle=this.stepObj.title,this.products=this.stepObj.links,this.categoryId=this.stepObj.metadata.categoryId,this.activeId=this.products[0].metadata.productId,this.displayName=this.products[0].metadata?.displayName,setTimeout(()=>{this.getTemplateByProductId(this.products[0].metadata.productId)},this.delay)}onScroll(e){this.scrollPosition=e.target.scrollLeft}selectProduct(e){e.metadata&&e.metadata.productId&&(this.activeId=e.metadata.productId,this.getTemplateByProductId(e.metadata.productId),this.displayName=e?.text)}getTemplateByProductId(e){if(this.isTemplatesLoading=!0,this.imagesOfProductMap.has(e))this.selectedProductObj=this.imagesOfProductMap.get(e),this.isTemplatesLoading=!1;else{const l=0;this.templateService.getTemplateByProductId(e,0,s=>{let d,c=s.storeProductImages;c.length>f.b.DASHBOARD_IMAGE_SLIDER_ELEMENT_NUMBER_LIMIT&&(c=c.slice(0,f.b.DASHBOARD_IMAGE_SLIDER_ELEMENT_NUMBER_LIMIT)),d=this.isGraphics?149==this.categoryId:this.isVideo,this.productAlias=s?.productAlias||s?.storyPageUrl;const m=this.getFormattedProduct(e,c,d,l);this.imagesOfProductMap.set(e,m),this.selectedProductObj=m,this.isTemplatesLoading=!1},s=>{this.isTemplatesLoading=!1},l,tt.i.LighxHome,10)}}getFormattedProduct(e,i,a,l){let c,s=[];for(let m=0;m<i.length;m++)c=i[m],c.productId=e,c.format=c.format?c.format:2,s.push({video:c.videoThumbUrl,posterImage:c.thumbUrl,item:c,format:c.format,imageSizel:L.getNewImageSizeL(l,c.format,172,8),isplay:a});return{imageSizel:L.getSliderImageHeight(l,172,8),imageObjects:s}}templateClick(e){this.onCategoryClick(e.img.item)}graphicTemplateClick(e){e.img.item.primaryCategoryId=this.categoryId,149===this.categoryId||25===this.categoryId?this.router.navigate(["/video-template-editor/edit"],{queryParams:{action:"default_elements",tab:"animated",project_type:1,aspect:149==this.categoryId?"1":"16-9",format:1,url:e.img.item?.imgUrl?e.img.item.imgUrl:"",pro:e.img.item?.pro?e.img.item.pro:0,tool:149==this.categoryId?"animated-illustration":"animated-sticker",pcid:this.categoryId,pid:e.img.item?.productId?e.img.item.productId:0}}):this.openGraphicAssestsPage(e.img.item)}openGraphicAssestsPage(e,i=null){e.assetType=1,this.modalService.open(he.S,{size:"xl modal-dialog-centered",centered:!0,windowClass:"template-dialog"}).componentInstance.imgObj=e}showPreview(e){const i=this.modalService.open(et.R,{size:"lg",backdrop:"static",windowClass:"preview-dialog"});i.componentInstance.template=e.img,i.componentInstance.isSubscribed=this.user&&this.user.subscribed,i.result.then(a=>{}).catch(a=>{})}showAllproduct(){const e=this.products.filter(i=>i.metadata.productId===this.activeId)[0];this.onCategoryClick(e,null,!0)}sliderNextDisable(e){this.viewAllDisable=e}onCategoryClick(e,i=null,a=!1){this.sectionObj.steps.forEach(l=>{if(l){const s=JSON.parse(JSON.stringify(l.metadata));s.catId=s?.categoryId,i||(s.mediaType=null),s.productId=e.productId||e?.metadata?.productId,s.prodImageId=e.productImageId;const c={...e,metadata:s};c.text=c?.displayName,a&&s.tab==P.z6.DesignTools?this.router.navigate([s.toolName==P.Fs.Design?"ai-design/templates/"+this.productAlias:"/ai-mockup-generator/"+this.productAlias]):this.openTool(c,i,this.sectionObj?.title)}})}}return(o=r).\u0275fac=function(e){return new(e||o)(t.rXU(x.Lw),t.rXU(w.u),t.rXU(it),t.rXU(x.Bq),t.rXU(ve.q),t.rXU(h.Ix),t.rXU(j.M),t.rXU(E.A),t.rXU(O.k),t.rXU(I.A),t.rXU(F.B),t.rXU(S.f),t.rXU(U.I),t.rXU(R.g),t.rXU(N.y))},o.\u0275cmp=t.VBU({type:o,selectors:[["templates-listing"]],viewQuery:function(e,i){if(1&e&&t.GBs(ye,5),2&e){let a;t.mGM(a=t.lsd())&&(i.scrollableDiv=a.first)}},inputs:{stepObj:"stepObj",isVideo:"isVideo",sectionObj:"sectionObj",delay:"delay"},features:[t.Vt3,t.OA$],decls:13,vars:13,consts:[["templatesSliderContent",""],["file",""],["nav",""],[1,"d-flex","align-items-center","h-40",2,"margin-left","40px"],[1,"text-24","text-bold","text-black","mb-0","text-nowrap",3,"ngClass"],["class","ms-2",3,"ngClass",4,"ngIf"],[1,"d-flex","justify-content-between","w-100","ml-10","position-relative"],["id","scrollableDiv",1,"new-scroll-behave","category-col",3,"scroll"],[4,"ngIf"],["class","show-all marker-right",3,"ngClass",4,"ngIf"],[4,"ngIf","ngIfElse"],["type","file",1,"custom-file-input","d-none",3,"click","change","accept","multiple"],[1,"ms-2",3,"ngClass"],["name","playvideo",1,"f-32"],["class","badge badge-temp me-2 h-32 ps-3 pe-3 grey-800 text-medium text-13 border-radius-8",3,"ngClass","click",4,"ngFor","ngForOf"],[1,"badge","badge-temp","me-2","h-32","ps-3","pe-3","grey-800","text-medium","text-13","border-radius-8",3,"click","ngClass"],[1,"show-all","marker-right",3,"ngClass"],[1,"btn","btn-grey","btn-h36","text-13","text-semi","grey-600","d-flex","align-items-center","pl-9","pe-1","border-0","border-radius-12",2,"transition","opacity 0.3s ease","opacity","1",3,"click"],[1,"d-flex","align-items-center"],["name","arrowdashbaord",1,"grey-600"],["type","image-slider",3,"sliderCardCount"],["class","templates-thumbs hometemplate mb-2 p-0 design-template mt-1 format-related",3,"ngClass",4,"ngIf"],[1,"templates-thumbs","hometemplate","mb-2","p-0","design-template","mt-1","format-related",3,"ngClass"],[3,"imageClick","previewClick","sliderNextDisableEvent","seeAllEvent","images","isSubscribed","imageSize","imagePopup","graphic","footerShow"]],template:function(e,i){if(1&e){const a=t.RV6();t.j41(0,"div",3)(1,"h3",4),t.EFF(2),t.k0s(),t.DNE(3,we,2,3,"div",5),t.j41(4,"div",6)(5,"div",7),t.bIt("scroll",function(s){return t.eBV(a),t.Njj(i.onScroll(s))}),t.DNE(6,Ie,2,1,"div",8),t.k0s(),t.DNE(7,Se,5,3,"div",9),t.k0s()(),t.DNE(8,Me,2,1,"ng-container",10)(9,Ge,1,1,"ng-template",null,0,t.C5r),t.j41(11,"input",11,1),t.bIt("click",function(){t.eBV(a);const s=t.sdS(12);return t.Njj(s.value="")}
1)("change",function(s){return t.eBV(a),t.Njj(i.onFileUploaded(s.srcElement.files))}),t.k0s()}if(2&e){const a=t.sdS(10);t.R7$(),t.Y8G("ngClass",t.sMw(9,xe,i.scrollPosition>10,i.isVideo,null==i.sectionObj||null==i.sectionObj.metadata?null:i.sectionObj.metadata.isNew)),t.R7$(),t.JRh(null==i.sectionObj?null:i.sectionObj.title),t.R7$(),t.Y8G("ngIf",i.isVideo),t.R7$(3),t.Y8G("ngIf",i.products.length>1),t.R7$(),t.Y8G("ngIf",(null==i.selectedProductObj||null==i.selectedProductObj.imageObjects?null:i.selectedProductObj.imageObjects.length)>=8),t.R7$(),t.Y8G("ngIf",i.isTemplatesLoading)("ngIfElse",a),t.R7$(3),t.Y8G("accept",i.fileUploadAccept)("multiple",i.multiple)}},dependencies:[g.YU,g.Sq,g.bT,J.h,X.b,A.t],styles:['.f-14[_ngcontent-%COMP%]{font-size:14px!important}.badge-temp[_ngcontent-%COMP%]{color:#4a4f5e;transition:all .3s ease;line-height:1.4}.badge-temp[_ngcontent-%COMP%]:hover{background:#e2e3e966!important;border:1px solid #E2E3E9!important}.badge-temp[_ngcontent-%COMP%]:first-child{margin-left:0!important}.badge-temp[_ngcontent-%COMP%]:last-child{margin-right:36px!important}.active[_ngcontent-%COMP%]{background:#626adf;color:#fff!important;border:1px solid #626ADF}.active[_ngcontent-%COMP%]:hover, .active[_ngcontent-%COMP%]:focus{background:#626adf!important;color:#fff!important;border:1px solid #626ADF!important}.active.grey-800[_ngcontent-%COMP%]{color:#fff!important}.show-all[_ngcontent-%COMP%]{position:absolute;right:20px;top:-18px}.category-col[_ngcontent-%COMP%]{min-width:300px;white-space:nowrap;width:calc(100% - 103px)!important;overflow:auto;position:absolute;top:-16px}.marker-left[_ngcontent-%COMP%]{position:relative}.marker-left[_ngcontent-%COMP%]:before{position:absolute;content:"";width:36px;height:42px;background:linear-gradient(90deg,#f8f9f900,#f8f9f9);transform:rotate(-180deg);right:-56px;top:-4px;z-index:9}.marker-right[_ngcontent-%COMP%]{position:absolute}.marker-right[_ngcontent-%COMP%]:before{position:absolute;content:"";width:36px;height:42px;background:linear-gradient(90deg,#f8f9f900,#f8f9f9);left:-36px;top:-1px}.text-marker.marker-left[_ngcontent-%COMP%]:before{display:none!important}']}),r})();function Fe(o,r){if(1&o&&(t.j41(0,"div",1),t.nrm(1,"templates-listing",2),t.k0s()),2&o){const n=r.$implicit,e=t.XpG();t.R7$(),t.Y8G("stepObj",n)("delay",e.delay)("isVideo",e.isVideo)("sectionObj",e.sectionObj)}}let Ue=(()=>{var o;class r{constructor(e){this.router=e,this.sectionTitle="",this.steps=[],this.pageUrl=""}ngOnChanges(){this.sectionTitle=this.sectionObj.title,this.steps=this.sectionObj.steps,this.pageUrl=this.sectionObj.metadata.pageUrl}learnMore(){this.router.navigate([this.pageUrl])}}return(o=r).\u0275fac=function(e){return new(e||o)(t.rXU(h.Ix))},o.\u0275cmp=t.VBU({type:o,selectors:[["product-listing"]],inputs:{sectionObj:"sectionObj",isVideo:"isVideo",isGraphics:"isGraphics",delay:"delay"},features:[t.OA$],decls:1,vars:1,consts:[["class","recent-slider mb-40",4,"ngFor","ngForOf"],[1,"recent-slider","mb-40"],[3,"stepObj","delay","isVideo","sectionObj"]],template:function(e,i){1&e&&t.DNE(0,Fe,2,4,"div",0),2&e&&t.Y8G("ngForOf",i.steps)},dependencies:[g.Sq,Ee],styles:['.btn-gradiant-learn[_ngcontent-%COMP%]{position:relative;background:#626adf0d;color:#4a4f5e;border-radius:12px;padding:0 24px!important;font-size:13px!important;border:0px!important}.btn-gradiant-learn[_ngcontent-%COMP%]:hover{background:#626adf1a}.btn-gradiant-learn[_ngcontent-%COMP%]:focus-visible{outline:none}.btn-gradiant-learn[_ngcontent-%COMP%]:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:1.3px;border:none;background:linear-gradient(to right,#df61ff,#3ad0ff);-webkit-mask:linear-gradient(to right,#df61ff 0%,#3ad0ff 100%) content-box,linear-gradient(to right,#df61ff 0%,#3ad0ff 100%);-webkit-mask-composite:xor;mask-composite:exclude}.mb-60[_ngcontent-%COMP%]{margin-bottom:60px}.mb-28[_ngcontent-%COMP%]{margin-bottom:28px}']}),r})();const Re=["scrollContainer"],Ne=o=>({new_item:o});function Ae(o,r){1&o&&(t.qex(0),t.nrm(1,"dashboard-placeholder",5),t.bVm()),2&o&&(t.R
17$(),t.Y8G("cardCount",7))}function Ve(o,r){if(1&o){const n=t.RV6();t.j41(0,"div",16)(1,"button",17),t.bIt("click",function(){t.eBV(n);const i=t.XpG(3);return t.Njj(i.seeAll())}),t.j41(2,"span",18),t.EFF(3,"See All "),t.nrm(4,"pi",19),t.k0s()()()}}function Xe(o,r){if(1&o){const n=t.RV6();t.j41(0,"div",20)(1,"button",21),t.bIt("click",function(){t.eBV(n);const i=t.XpG(3);return t.Njj(i.scrollPrev())}),t.nrm(2,"span",22),t.k0s()()}}function Be(o,r){if(1&o&&t.nrm(0,"img",33),2&o){const n=t.XpG().$implicit;t.Y8G("src",n.thumbUrl,t.B4B)("alt",n.displayName)}}function De(o,r){if(1&o&&(t.j41(0,"video",34),t.nrm(1,"source",35),t.k0s()),2&o){const n=t.XpG().$implicit;t.Y8G("muted",!0)("poster",n.thumbUrl,t.B4B),t.R7$(),t.Y8G("src",n.thumbUrl,t.B4B)}}function Le(o,r){1&o&&(t.j41(0,"span",36),t.nrm(1,"i",37),t.k0s())}function $e(o,r){1&o&&t.nrm(0,"span",38)}function Ye(o,r){if(1&o){const n=t.RV6();t.j41(0,"div",23),t.bIt("click",function(){const i=t.eBV(n).$implicit,a=t.XpG(3),l=t.sdS(4);return t.Njj(a.onCategoryClick(i,l))}),t.j41(1,"span",24),t.DNE(2,Be,1,2,"img",25)(3,De,2,3,"video",26)(4,Le,2,0,"span",27)(5,$e,1,0,"span",28),t.k0s(),t.j41(6,"div",29)(7,"span",30),t.EFF(8),t.k0s(),t.j41(9,"span",31),t.nrm(10,"pi",32),t.k0s()()()}if(2&o){const n=r.$implicit;t.R7$(2),t.Y8G("ngIf",!n.isVideo),t.R7$(),t.Y8G("ngIf",n.isVideo),t.R7$(),t.Y8G("ngIf",n.isVideo),t.R7$(),t.Y8G("ngIf",n.isNew),t.R7$(3),t.JRh((null==n||null==n.link?null:n.link.text)||(null==n?null:n.displayName))}}function ze(o,r){if(1&o){const n=t.RV6();t.j41(0,"div",39)(1,"button",40),t.bIt("click",function(){t.eBV(n);const i=t.XpG(3);return t.Njj(i.scrollNext())}),t.nrm(2,"span",41),t.k0s()()}}function He(o,r){if(1&o){const n=t.RV6();t.j41(0,"div",7)(1,"div",8)(2,"h2",9),t.EFF(3),t.k0s(),t.DNE(4,Ve,5,0,"div",10),t.k0s(),t.j41(5,"div",11),t.DNE(6,Xe,3,0,"div",12),t.j41(7,"div",13,2),t.bIt("scroll",function(){t.eBV(n);const i=t.XpG(2);return t.Njj(i.onScroll())}),t.DNE(9,Ye,11,5,"div",14),t.k0s(),t.DNE(10,ze,3,0,"div",15),t.k0s()()}if(2&o){const n=t.XpG(2);t.R7$(2),t.Y8G("ngClass",t.eq3(7,Ne,null==n.sectionObj||null==n.sectionObj.metadata?null:n.sectionObj.metadata.isNew)),t.R7$(),t.JRh(n.sectionTitle),t.R7$(),t.Y8G("ngIf",n.categories.length>=8),t.R7$(2),t.Y8G("ngIf",n.canScrollPrev),t.R7$(3),t.Y8G("ngForOf",n.categories)("ngForTrackBy",n.trackByCategory),t.R7$(),t.Y8G("ngIf",n.canScrollNext)}}function qe(o,r){if(1&o&&t.DNE(0,He,11,9,"div",6),2&o){const n=t.XpG();t.Y8G("ngIf",n.categories.length)}}let We=(()=>{var o;class r extends C.Y{constructor(e,i,a,l,s,c,d,m,_,u,v){super(i,a,l,s,c,d,m,_,u,v),this.activeModal=e,this.aiUploadImageService=i,this.isLoaded=!1,this.sectionTitle="",this.pageUrl="",this.categories=[],this.canScrollPrev=!1,this.canScrollNext=!1,this.cardStep=180}ngOnChanges(){this.sectionTitle=this.sectionObj?.title||"",this.pageUrl=this.sectionObj?.metadata?.pageUrl||"","category-products"==this.sectionObj?.type?(this.categories=this.buildCategories(this.sectionObj?.steps?.[0]?.links||[]),setTimeout(()=>this.updateScrollState(),0)):(this.categories=this.buildCategories(this.sectionObj?.links||[]),setTimeout(()=>this.updateScrollState(),0))}ngAfterViewInit(){setTimeout(()=>this.updateScrollState(),0)}buildCategories(e){return(e.length>f.b.DASHBOARD_IMAGE_SLIDER_ELEMENT_NUMBER_LIMIT?e.slice(0,f.b.DASHBOARD_IMAGE_SLIDER_ELEMENT_NUMBER_LIMIT):e).map(a=>{const l=a.metadata||{};return{link:a,displayName:l.displayName||a.text||"",thumbUrl:l.thumbUrl||a.url||"",videoUrl:l.videoUrl||a.url||"",isVideo:1==l.isVideo||!0===l.isVideo,isNew:1==l.isNew}})}onScroll(){this.updateScrollState()}scrollPrev(){const e=this.scrollContainer?.nativeElement;e&&e.scrollBy({left:3*-this.cardStep,behavior:"smooth"})}scrollNext(){const e=this.scrollContainer?.nativeElement;e&&e.scrollBy({left:3*this.cardStep,behavior:"smooth"})}updateScrollState(){const e=this.scrollContainer?.nativeElement;if(!e)return this.canScrollPrev=!1,void(this.canScrollNext=!1);const i=e.scrollWidth-e.clientWidth;this.canScrollPrev=e.scrollLeft>4,this.canScrollNext=i>4&&e.scrollLeft<i-4}seeAll(){this.categories.length>0&&this.onCategoryClick(this.categories[0],null,!0)}onCategoryClick(e,i=null,a=!1){if("category-products"==this.sectionObj?.type)this.sectionObj.steps.forEach(l=>{if(l){const s=JSON.parse(JSON.stringify(l.metadata));s.catId=e?.link?.metadata?.categoryId||s?.categoryId,i||(s.mediaType=null),s.productId=e?.link?.metadata?.productId;const c={...e?.link,metadata:s};a&&c.metadata.tab==P.z6.DesignTools?this.router.navigate([c.metadata.toolName==P.Fs.Design?"ai-design/templates/logos":"ai-mockup-generator/banner-mockups"]):this.openTool(c,i,this.sectionTitle)}});else{const l=JSON.parse(JSON.stringify(e.link.metadata));l.catId=l.categoryId||l.catId,i||(l.mediaType=null),l.productId=e?.link?.metadata?.productId;const s={...e.link,metadata:l};a&&s.metadata.tab==P.z6.DesignTools?this.router.navigate([s.metadata.toolName==P.Fs.Design?"ai-design/templates/logos":"ai-mockup-generator/banner-mockups"]):this.openTool(s,i,this.sectionTitle)}}trackByCategory(e,i){return i.link?.metadata?.productId??e}}return(o=r).\u0275fac=function(e){return new(e||o)(t.rXU(x.Lw),t.rXU(j.M),t.rXU(E.A),t.rXU(h.Ix),t.rXU(O.k),t.rXU(I.A),t.rXU(F.B),t.rXU(S.f),t.rXU(U.I),t.rXU(R.g),t.rXU(N.y))},o.\u0275cmp=t.VBU({type:o,selectors:[["category-products-listing"]],viewQuery:function(e,i){if(1&e&&t.GBs(Re,5),2&e){let a;t.mGM(a=t.lsd())&&(i.scrollContainer=a.first)}},inputs:{sectionObj:"sectionObj",isLoaded:"isLoaded"},features:[t.Vt3,t.OA$],decls:5,vars:4,consts:[["categoryContent",""],["file",""],["scrollC
1ontainer",""],[4,"ngIf","ngIfElse"],["type","file",1,"custom-file-input","d-none",3,"click","change","accept","multiple"],["type","category-products",3,"cardCount"],["class","category-products",4,"ngIf"],[1,"category-products"],[1,"d-flex","align-items-center","justify-content-start","h-40","mb-9","position-relative"],[1,"text-24","text-bold","grey-800","m-0","lh-125","ml-13",3,"ngClass"],["class","show-all marker-right",4,"ngIf"],[1,"category-products__carousel","position-relative"],["class","category-products__nav category-products__nav--prev",4,"ngIf"],[1,"category-products-track","new-scroll-behave",3,"scroll"],["class","category-products-card p-1 pb-0 border-radius-lg bg-white",3,"click",4,"ngFor","ngForOf","ngForTrackBy"],["class","category-products__nav category-products__nav--next",4,"ngIf"],[1,"show-all","marker-right"],[1,"btn","btn-grey","btn-h36","text-13","text-semi","grey-600","d-flex","align-items-center","pl-9","pe-1","border-0","border-radius-12",2,"transition","opacity 0.3s ease","opacity","1",3,"click"],[1,"d-flex","align-items-center"],["name","arrowdashbaord",1,"grey-600"],[1,"category-products__nav","category-products__nav--prev"],["type","button","aria-label","Scroll left",1,"category-products__arrow",3,"click"],[1,"arrow-prev"],[1,"category-products-card","p-1","pb-0","border-radius-lg","bg-white",3,"click"],[1,"category-products-thumb","border-radius-12"],["loading","lazy","width","170","height","170",3,"src","alt",4,"ngIf"],["autoplay","","loop","","playsinline","",3,"muted","poster",4,"ngIf"],["class","category-products__play",4,"ngIf"],["class","new_item","aria-label","New",4,"ngIf"],[1,"d-flex","align-items-center","justify-content-between","ps-2","mt-9","mb-2","pe-1","w-100"],[1,"text-semi","text-14","grey-800","lh-125","d-inline-flex","align-items-center","justify-content-start","overflow-hidden"],[1,"d-inline-flex","align-items-center","justify-content-center","hw-24","ms-2",2,"min-width","24px"],["name","arrowblack",1,"f-24","arrow-item"],["loading","lazy","width","170","height","170",3,"src","alt"],["autoplay","","loop","","playsinline","",3,"muted","poster"],["type","video/mp4",3,"src"],[1,"category-products__play"],[1,"playGraphics"],["aria-label","New",1,"new_item"],[1,"category-products__nav","category-products__nav--next"],["type","button","aria-label","Scroll right",1,"category-products__arrow",3,"click"],[1,"arrow-next"]],template:function(e,i){if(1&e){const a=t.RV6();t.DNE(0,Ae,2,1,"ng-container",3)(1,qe,1,1,"ng-template",null,0,t.C5r),t.j41(3,"input",4,1),t.bIt("click",function(){t.eBV(a);const s=t.sdS(4);return t.Njj(s.value="")})("change",function(s){return t.eBV(a),t.Njj(i.onFileUploaded(s.srcElement.files))}),t.k0s()}if(2&e){const a=t.sdS(2);t.Y8G("ngIf",!i.isLoaded)("ngIfElse",a),t.R7$(3),t.Y8G("accept",i.fileUploadAccept)("multiple",i.multiple)}},dependencies:[g.YU,g.Sq,g.bT,X.b,A.t],styles:['.category-products-track[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:16px;overflow-x:auto;overflow-y:hidden;padding:0 40px 30px;scroll-behavior:smooth;scrollbar-width:none;margin-bottom:-30px}.category-products-track[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}.category-products-card[_ngcontent-%COMP%]{flex:0 0 180px;width:180px;text-align:left;cursor:pointer;border:1px solid #E2E3E9;padding:4px;transition:all .5s cubic-bezier(.22,1,.36,1)}.category-products-card[_ngcontent-%COMP%] .arrow-item[_ngcontent-%COMP%]{opacity:0;visibility:hidden;transform:translate(-8px);transition:opacity .3s ease,transform .3s ease,visibility 0s linear .3s}.category-products-card[_ngcontent-%COMP%]:hover{box-shadow:0 8px 24px #00000026}.category-products-card[_ngcontent-%COMP%]:hover .arrow-item[_ngcontent-%COMP%]{opacity:1;visibility:visible;transform:translate(0);transition:opacity .3s ease .15s,transform .3s ease .15s,visibility 0s}.category-products-thumb[_ngcontent-%COMP%]{position:relative;display:block;width:170px;height:170px;overflow:hidden}.category-products-thumb[_ngcontent-%COMP%] img[_ngcontent-%COMP%], .category-products-thumb[_ngcontent-%COMP%] video[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:cover;border-radius:12px;transition:transform .2s ease}.category-products__play[_ngcontent-%COMP%]{position:absolute;
1left:8px;bottom:8px;width:24px;height:24px;display:flex;align-items:center;justify-content:center;pointer-events:none}.category-products__thumb[_ngcontent-%COMP%] .new_item[_ngcontent-%COMP%]{position:absolute;top:8px;right:8px;padding:0;pointer-events:none}.category-products__thumb[_ngcontent-%COMP%] .new_item[_ngcontent-%COMP%]:after{top:0;right:0;padding:0}.category-products__nav[_ngcontent-%COMP%]{position:absolute;top:0;width:60px;height:calc(100% - 30px);display:flex;align-items:center;z-index:2;pointer-events:none}.category-products__nav--prev[_ngcontent-%COMP%]{left:0;justify-content:flex-end;background:linear-gradient(90deg,#f8f9f9,#f8f9f9e6 34%,#f8f9f999 69%,#fff0)}.category-products__nav--next[_ngcontent-%COMP%]{right:0;justify-content:flex-start;background:linear-gradient(90deg,#fff0,#f8f9f999 31%,#f8f9f9e6 66%,#f8f9f9)}.category-products__arrow[_ngcontent-%COMP%]{pointer-events:auto;display:flex;align-items:center;justify-content:center;width:36px;height:36px;border:0;border-radius:50%;background:#fff;box-shadow:0 4px 16px #00000014;cursor:pointer;transition:all .3s ease;margin-top:-30px}.category-products__arrow[_ngcontent-%COMP%] .arrow-prev[_ngcontent-%COMP%]{transform:rotate(180deg);display:block}.category-products__arrow[_ngcontent-%COMP%] .arrow-next[_ngcontent-%COMP%]{display:block}.category-products__arrow[_ngcontent-%COMP%]:hover{background:#eff0fc}.show-all[_ngcontent-%COMP%]{position:absolute;right:20px}.category-col[_ngcontent-%COMP%]{min-width:300px;white-space:nowrap;width:calc(100% - 103px)!important;overflow:auto;position:absolute;top:-16px}.new-scroll-behave[_ngcontent-%COMP%]{-ms-overflow-style:none;scrollbar-width:none}.new-scroll-behave[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}.marker-left[_ngcontent-%COMP%]{position:relative}.marker-left[_ngcontent-%COMP%]:before{position:absolute;content:"";width:36px;height:42px;background:linear-gradient(90deg,#f8f9f900,#f8f9f9);transform:rotate(-180deg);right:-55px;top:-5px;z-index:9}.marker-right[_ngcontent-%COMP%]{position:absolute}.marker-right[_ngcontent-%COMP%]:before{position:absolute;content:"";width:36px;height:42px;background:linear-gradient(90deg,#f8f9f900,#f8f9f9);left:-36px;top:-1px}.text-marker.marker-left[_ngcontent-%COMP%]:before{display:none!important}.new_item[_ngcontent-%COMP%]:after{top:calc(50% - 20px)!important}']}),r})();var nt=p(22392),Je=p(41845),Ke=p(33645);const $=o=>({liActive:o}),Qe=()=>["/my/projects"],Ze=()=>["/api"];let ti=(()=>{var o;class r{constructor(e,i,a){this.router=e,this.activatedRoute=i,this.modalService=a,this.type="",this.subscriptions=[]}selectTool(e=""){this.type=e,e?this.router.navigate(["/user-dashboard"],{queryParams:{type:e}}):this.router.navigate(["/user-dashboard"])}ngOnInit(){this.type="",this.subscriptions.push(this.activatedRoute.queryParamMap.subscribe(e=>{const i=e.get("type");this.type=i||""}))}getTheApp(){this.modalService.open(nt.V,{centered:!0,size:"lg",backdrop:"static",windowClass:"gettheapp-dialog"}).componentInstance.sectionObj={title:"Get the App"}}ngOnDestroy(){this.subscriptions.forEach(e=>e?.unsubscribe()),this.subscriptions=[]}}return(o=r).\u0275fac=function(e){return new(e||o)(t.rXU(h.Ix),t.rXU(h.nX),t.rXU(x.Bq))},o.\u0275cmp=t.VBU({type:o,selectors:[["left-pannel"]],decls:34,vars:19,consts:[["id","#sidebar1",2,"height","calc(100%)"],[1,"pane-section","box-right-wrapper","overflow-hidden"],[1,"scroll-content"],["customScrollDir","",1,"scroll-container",2,"height","calc(100% - 150px)"],[1,"list-unstyled","pt-3","pb-3","mb-0"],["id","top-banner",1,"liActive","mt-0","lh-normal",3,"click","ngClass"],["name","dashboardhome",1,"f-24","mr-8"],["id","ai-image-tools",1,"lh-normal",3,"click","ngClass"],["name","aiimage",1,"f-24","mr-8"],["id","ai-video-tools",1,"new_item","lh-normal",3,"click","ngClass"],["name","aivideo",1,"f-24","mr-8"],["id","photo-editing-tools",1,"lh-normal",3,"click","ngClass"],["name","photoeditor",1,"f-24","mr-8"],["id","aidesign-tools",1,"new_item","lh-normal",3,"click","ngClass"],["name","aibusiness",1,"f-24","mr-8"],["id","ai-tools",1,"lh-normal","mt-0",3,"routerLink"],["name","projects",1,"f-24","mr-8"],[1,"list-unstyled","p-3","pt-0","pb-0","mb-0"],["
1id","ai-footer-area",1,"mb-0","lh-normal",2,"margin-top","4px","height","36px",3,"routerLink"],["name","apikey",1,"f-24","mr-8"],["id","ai-footer-area",1,"mb-0","lh-normal",2,"margin-top","4px","height","36px",3,"click"],["name","mobileapp",1,"f-24","mr-8"]],template:function(e,i){1&e&&(t.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"ul",4)(5,"li",5),t.bIt("click",function(){return i.selectTool()}),t.nrm(6,"pi",6),t.EFF(7,"Home"),t.k0s(),t.j41(8,"li",7),t.bIt("click",function(){return i.selectTool("ai-image")}),t.nrm(9,"pi",8),t.EFF(10,"AI Image"),t.k0s(),t.j41(11,"li",9),t.bIt("click",function(){return i.selectTool("ai-video")}),t.nrm(12,"pi",10),t.EFF(13,"AI Video"),t.k0s(),t.j41(14,"li",11),t.bIt("click",function(){return i.selectTool("photo-editing")}),t.nrm(15,"pi",12),t.EFF(16,"AI Photo Editor"),t.k0s(),t.j41(17,"li",13),t.bIt("click",function(){return i.selectTool("ai-business")}),t.nrm(18,"pi",14),t.EFF(19,"AI For Business"),t.k0s(),t.nrm(20,"hr"),t.j41(21,"li",15),t.nrm(22,"pi",16),t.EFF(23,"My Projects"),t.k0s()()(),t.j41(24,"div")(25,"ul",17),t.nrm(26,"hr"),t.j41(27,"li",18),t.nrm(28,"pi",19),t.EFF(29,"API "),t.k0s(),t.nrm(30,"space-utilized"),t.j41(31,"li",20),t.bIt("click",function(){return i.getTheApp()}),t.nrm(32,"pi",21),t.EFF(33,"Get the App "),t.k0s()()()()()()),2&e&&(t.R7$(5),t.Y8G("ngClass",t.eq3(7,$,!i.type)),t.R7$(3),t.Y8G("ngClass",t.eq3(9,$,"ai-image"==i.type)),t.R7$(3),t.Y8G("ngClass",t.eq3(11,$,"ai-video"==i.type)),t.R7$(3),t.Y8G("ngClass",t.eq3(13,$,"photo-editing"==i.type)),t.R7$(3),t.Y8G("ngClass",t.eq3(15,$,"ai-business"==i.type)),t.R7$(4),t.Y8G("routerLink",t.lJ4(17,Qe)),t.R7$(6),t.Y8G("routerLink",t.lJ4(18,Ze)))},dependencies:[g.YU,h.Wk,Je.q,Ke.q,X.b],styles:["li[_ngcontent-%COMP%]{height:44px;border-radius:12px;scroll-margin:16px;cursor:pointer;display:flex;align-items:center;border:1px solid transparent;font-size:14px;color:#272b34;padding:0 12px;margin-top:4px}li[_ngcontent-%COMP%] pi[_ngcontent-%COMP%], li[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{color:#606576}li[_ngcontent-%COMP%]:hover{background:#626adf0d;border:1px solid transparent}.liActive[_ngcontent-%COMP%]{border:1px solid #eeebff!important;background:linear-gradient(90deg,#df61ff26 -4%,#3ad0ff26)!important;font-weight:600}.liActive[_ngcontent-%COMP%] pi[_ngcontent-%COMP%], .liActive[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{color:#4a4f5e}hr[_ngcontent-%COMP%]{margin-top:8px;margin-bottom:8px;border:0;border-top:2px solid rgba(98,106,223,.1)}"]}),r})();const ei=["scrollContainer"],ii=["bannerVideo"];function ni(o,r){if(1&o&&(t.qex(0),t.nrm(1,"dashboard-placeholder",7),t.bVm()),2&o){const n=t.XpG();t.R7$(),t.Y8G("type",n.isSquareBanner?"banner-square":"banner")("cardCount",n.isSquareBanner?8:4)}}function oi(o,r){if(1&o&&(t.j41(0,"div",15)(1,"h2",16),t.EFF(2),t.k0s()()),2&o){const n=t.XpG(2);t.R7$(2),t.JRh(null==n.sectionObj?null:n.sectionObj.title)}}function ai(o,r){if(1&o){const n=t.RV6();t.j41(0,"div",17)(1,"button",18),t.bIt("click",function(){t.eBV(n);const i=t.XpG(2);return t.Njj(i.scrollPrev())}),t.nrm(2,"span",19),t.k0s()()}}function si(o,r){if(1&o&&t.nrm(0,"img",26),2&o){const n=t.XpG().$implicit;t.Y8G("src",n.url,t.B4B)("alt",n.text)}}function ri(o,r){if(1&o&&(t.j41(0,"video",27,3),t.nrm(2,"source",28),t.k0s()),2&o){const n=t.XpG().$implicit,e=t.XpG(2);t.Y8G("poster",e.getPoster(n),t.B4B),t.BMQ("data-src",null==n?null:n.url),t.R7$(2),t.BMQ("data-src",null==n?null:n.url)}}function li(o,r){if(1&o&&(t.j41(0,"div",29,4),t.EFF(2),t.k0s()),2&o){const n=t.sdS(1),e=t.XpG().$implicit,i=t.XpG(2);t.Y8G("ngbTooltip",i.isTextTruncated(n)?e.text:null),t.R7$(2),t.JRh(e.text)}}function ci(o,r){1&o&&t.nrm(0,"div",30)}function di(o,r){if(1&o){const n=t.RV6();t.j41(0,"div",20),t.bIt("click",function(){const i=t.eBV(n).$implicit,a=t.XpG(2),l=t.sdS(4);return t.Njj(a.getStoryPage(i,l))}),t.j41(1,"div",21),t.DNE(2,si,1,2,"img",22)(3,ri,3,3,"video",23),t.k0s(),t.DNE(4,li,3,2,"div",24)(5,ci,1,0,"div",25),t.k0s()}if(2&o){const n=r.$implicit;t.AVh("when-format-2",2===(null==n||null==n.metadata?null:n.metadata.format)),t.R7$(2),t.Y8G("ngIf",!(null!=n&&null!=n.metadata&&n.metadata.isVideo)),t.R7$(),t.Y8G("ngIf",null==n||null==n.metadata?null:n.metadata.isVideo),t.R7$(),t.Y8G("ngIf",n.text&&n.text.length>2),t.R7$(),t.Y8G("ngIf",null==n||null==n.metadata?null:n.metadata.isNew)}}function pi(o,r){if(1&o){const n=t.RV6();t.j41(0,"div",31)(1,"button",32),t.bIt("click",function(){t.eBV(n);const i=t.XpG(2);return t.Njj(i.scrollNext())}),t.nrm(2,"span",33),t.k0s()()}}function mi(o,r){if(1&o){const n=t.RV6();t.j41(0,"div",8),t.DNE(1,oi,3,1,"div",9),t.j41(2,"div",10),t.DNE(3,ai,3,0,"div",11),t.j41(4,"div",12,2),t.bIt("scroll",function(){t.eBV(n);const i=t.XpG();return t.Njj(i.onScroll())}),t.DNE(6,di,6,6,"div",13),t.k0s(),t.DNE(7,pi,3,0,"div",14),t.k0s()()}if(2&o){const n=t.XpG();t.R7$(),t.Y8G("ngIf",(null==n.sectionObj?null:n.sectionObj.title)&&(null==n.sectionObj?null:n.sectionObj.title.length)>2),t.R7$(),t.AVh("has-card-text",n.hasCardText),t.R7$(),t.Y8G("ngIf",n.canScrollPrev),t.R7$(3),t.Y8G("ngForOf",n.sectionObj.links)("ngForTrackBy",n.trackByLink),t.R7$(),t.Y8G("ngIf",n.canScrollNext)}}let gi=(()=>{var o;class r extends C.Y{constructor(e,i,a,l,s,c,d,m,_,u,v,B){super(e,l,s,c,d,m,_,u,v,B),this.aiUploadImageService=e,this.storyPageService=i,this.authService=a,this.isSquareBanner=!1,this.isLoaded=!1,this.isActive=!0,this.canScrollPrev=!1,this.canScrollNext=!1,this.cardStep=312,this.videoObserver=null,this.videosSub=null,this.visibleVideos=new Set,this.setupTimer=null,this.user=this.authService.currentUser()}ngOnChanges(e){if(this.sectionObj?.title&&(this.sectionObj.title=this.sectionObj.title.replace("\n","")),setTimeout(()=>this.updateScrollState(),0),e.isActive&&!this.isActive)return this.setupTimer&&(clearTimeout(this.setupTimer),this.setupTimer=null),void this.teardownVideoObserver(!1);(e.isLoaded||e.sectionObj||e.isActive)&&this.scheduleVideoObserverSetup()}ngAfterViewInit(){setTimeout(()=>this.updateScrollState(),0),this.scheduleVideoObserverSetup(),this.videosSub=this.bannerVideos?.changes?.subscribe(()=>{this.scheduleVideoObserverSetup()})||null}ngOnDestroy(){this.setupTimer&&(clearTimeout(this.setupTimer),this.setupTimer=null),this.teardownVideoObserver(!0),this.videosSub?.unsubscribe(),this.videosSub=null}onScroll(){this.updateScrollState()}scrollPrev(){const e=this.scrollContainer?.nativeElement;e&&e.scrollBy({left:2*-this.cardStep,behavior:"smooth"})}scrollNext(){const e=this.scrollContainer?.nativeElement;e&&e.scrollBy({left:2*this.cardStep,behavior:"smooth"})}updateScrollState(){const e=this.scrollContainer?.nativeElement;if(!e)return this.canScrollPrev=!1,void(this.canScrollNext=!1);const i=e.scrollWidth-e.clientWidth;this.canScrollPrev=e.scrollLeft>4,this.canScrollNext=i>4&&e.scrollLeft<i-4}scheduleVideoObserverSetup(){!this.isActive||!this.isLoaded||(this.setupTimer&&clearTimeout(this.setupTimer),this.setupTimer=setTimeout(()=>{this.setupTimer=null,this.setupVideoObserver()},0))}setupVideoObserver(){this.teardownVideoObserver(!1),this.isActive&&this.isLoaded&&!(typeof IntersectionObserver>"u")&&this.bannerVideos?.length&&(this.videoObserver=new IntersectionObserver(e=>{this.isActive&&(e.forEach(i=>
1{const a=i.target;i.isIntersecting&&i.intersectionRatio>0||this.isVideoLayoutVisible(a)?this.visibleVideos.add(a):(this.visibleVideos.delete(a),this.pauseBannerVideo(a,!0))}),this.syncPlayingVideos())},{root:this.scrollContainer?.nativeElement||null,rootMargin:"0px 48px 0px 0px",threshold:[0,.1,.25,.5,.75,1]}),this.bannerVideos.forEach(e=>{const i=e?.nativeElement;i&&this.videoObserver?.observe(i)}),requestAnimationFrame(()=>this.syncVisibleVideosFromLayout()))}teardownVideoObserver(e){this.videoObserver&&(this.videoObserver.disconnect(),this.videoObserver=null),this.visibleVideos.clear(),this.bannerVideos?.forEach(i=>this.pauseBannerVideo(i?.nativeElement,e))}syncVisibleVideosFromLayout(e=0){const i=this.scrollContainer?.nativeElement;if(!i||!this.bannerVideos?.length||!this.isActive)return;const a=i.getBoundingClientRect();a.width<=0||a.height<=0?e<10&&requestAnimationFrame(()=>this.syncVisibleVideosFromLayout(e+1)):(this.bannerVideos.forEach(l=>{const s=l?.nativeElement;s&&this.isVideoLayoutVisible(s,a)&&this.visibleVideos.add(s)}),this.syncPlayingVideos())}isVideoLayoutVisible(e,i){const a=this.scrollContainer?.nativeElement;if(!a||!this.isActive)return!1;const l=i||a.getBoundingClientRect();if(l.width<=0||l.height<=0)return!1;const s=e.getBoundingClientRect();return s.right>l.left-48&&s.left<l.right+48&&s.bottom>l.top&&s.top<l.bottom&&s.width>0&&s.height>0}syncPlayingVideos(){this.visibleVideos.forEach(e=>this.playBannerVideo(e))}playBannerVideo(e){if(!e||!this.isActive)return;const i=e.dataset.src,a=e.querySelector("source");if(i&&a&&a.getAttribute("src")!==i&&(a.setAttribute("src",i),e.load()),e.muted=!0,!e.paused&&!e.ended)return;const l=e.play();l?.catch&&l.catch(()=>{})}pauseBannerVideo(e,i=!1){if(e&&(e.pause(),i))try{const a=e.querySelector("source");a?.hasAttribute("src")&&a.removeAttribute("src"),e.removeAttribute("src"),e.load()}catch{}}trackByLink(e,i){return i?.id||i?.text||e}getPoster(e){return e?.metadata?.thumbUrl||e?.metadata?.poster||e?.metadata?.posterImage||null}onFileUploaded(e){e?.length&&this.stopBannerVideoActivityForNavigation(),super.onFileUploaded(e)}getStoryPage(e,i){const a=e.metadata?.queryString,l=this.aiUploadImageService.getParams(a);if("design-templates"==e.type||"video-design"==e.type||"graphics-design"==e.type)return void window.open("./"+e?.metadata?.storyPageUrl,"_blank");if(l?.storyPageUrl)return void this.router.navigate([l?.storyPageUrl]);const s=e?.img?.item||e;s&&s.subType==f.b.slug.toolWithoutStory?super.openTool(s,i,this.sectionObj?.title):this.storyPageService.getStoryPageContent(e.type,"story",e.subType,c=>{const d=c.body.storyPage;if(d){const m=super.getMetadata(d,e);this.sectionObj?.title&&(m.title=this.sectionObj.title);const _={...s,metadata:m};super.openTool(_,i,this.sectionObj?.title||"Top Banner")}},c=>{this.toastService.showError(c?.description)})}isTextTruncated(e){return e.scrollWidth>e.clientWidth}get hasCardText(){return!!this.sectionObj?.links?.some(e=>e?.text&&e.text.length>2)}stopBannerVideoActivityForNavigation(){this.setupTimer&&(clearTimeout(this.setupTimer),this.setupTimer=null),this.teardownVideoObserver(!0)}}return(o=r).\u0275fac=function(e){return new(e||o)(t.rXU(j.M),t.rXU(y.K),t.rXU(w.u),t.rXU(E.A),t.rXU(h.Ix),t.rXU(O.k),t.rXU(I.A),t.rXU(F.B),t.rXU(S.f),t.rXU(U.I),t.rXU(R.g),t.rXU(N.y))},o.\u0275cmp=t.VBU({type:o,selectors:[["new-tools-banner"]],viewQuery:function(e,i){if(1&e&&(t.GBs(ei,5),t.GBs(ii,5)),2&e){let a;t.mGM(a=t.lsd())&&(i.scrollContainer=a.first),t.mGM(a=t.lsd())&&(i.bannerVideos=a)}},inputs:{sectionObj:"sectionObj",isSquareBanner:"isSquareBanner",isLoaded:"isLoaded",isActive:"isActive"},features:[t.Vt3,t.OA$],decls:5,vars:4,consts:[["bannerContent",""],["file",""],["scrollContainer",""],["bannerVideo",""],["textElement",""],[4,"ngIf","ngIfElse"],["type","file",1,"custom-file-input","d-none",3,"click","change","accept","multiple"],[3,"type","cardCount"],[1,"new-tools-banner"],["class","d-flex align-items-center justify-content-start h-40 mb-9",4,"ngIf"],[1,"new-tools-banner__carousel"],["class","new-tools-banner__nav new-tools-banner__nav--prev",4,"ngIf"],[1,"new-tools-banner__track","new-scroll-behave",3,"scroll"],["class","new-tools-banner-card pointer position-relative",3,"when-format-2","click",4,"ngFor","ngForOf","ngForTrackBy"],["class","new-tools-banner__nav new-tools-banner__nav--next",4,"ngIf"],[1,"d-flex","align-items-center","justify-content-start","h-40","mb-9"],[1,"text-24","text-bold","grey-800","m-0","lh-125","ml-13"],[1,"new-tools-banner__nav","new-tools-banner__nav--prev"],["type","button","aria-label","Scroll left",1,"new-tools-banner__arrow",3,"click"],[1,"arrow-prev"],[1,"new-tools-banner-card","pointer","position-relative",3,"click"],[1,"new-tools-banner-media","d-block","w-100","border-radius-lg","overflow-hidden"],["loading","lazy","decoding","async",3,"src","alt",4,"ngIf"],["muted","","loop","","playsinline","","preload","none","disablePictureInPicture","",3,"poster",4,"ngIf"],["class","d-block text-semi text-14 grey-800 lh-160 text-truncate mt-2 suqare-center","style","min-height: 23px;","tooltipClass","tooltip-custom-all full-width-mob","container","body",3,"ngbTooltip",4,"ngIf"],["class","new_item p-0 position-absolute new_item_new",4,"ngIf"],["loading","lazy","decoding","async",3,"src","alt"],["muted","","loop","","playsinline","","preload","none","disablePictureInPicture","",3,"poster"],["type","video/mp4"],["tooltipClass","tooltip-custom-all full-width-mob","container","body",1,"d-block","text-semi","text-14","grey-800","lh-160","text-truncate","mt-2","suqare-center",2,"min-height","23px",3,"ngbTooltip"],[1,"new_item","p-0","position-absolute","new_item_new"],[1,"new-tools-banner__nav","new-tools-banner__nav--next"],["type","button","aria-label","Scroll right",1,"new-tools-banner__arrow",3,"click"],[1,"arrow-next"]],template:function(e,i){if(1&e){const a=t.RV6();t.DNE(0,ni,2,2,"ng-container",5)(1,mi,8,7,"ng-template",null,0,t.C5r),t.j41(3,"input",6,1),t.bIt("click",function(){t.eBV(a);const s=t.sdS(4);return t.Njj(s.value="")}
1)("change",function(s){return t.eBV(a),t.Njj(i.onFileUploaded(s.srcElement.files))}),t.k0s()}if(2&e){const a=t.sdS(2);t.Y8G("ngIf",!i.isLoaded)("ngIfElse",a),t.R7$(3),t.Y8G("accept",i.fileUploadAccept)("multiple",i.multiple)}},dependencies:[g.Sq,g.bT,x.md,A.t],styles:[".new-tools-banner[_ngcontent-%COMP%]{min-height:0}.new-tools-banner__carousel[_ngcontent-%COMP%]{position:relative}.new-tools-banner__track[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:16px;overflow-x:auto;overflow-y:hidden;padding:0 40px;scroll-behavior:smooth;scrollbar-width:none}.new-tools-banner__track[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}.new-tools-banner-card[_ngcontent-%COMP%]{flex:0 0 318px;width:318px}.new-tools-banner-card[_ngcontent-%COMP%] .new-tools-banner-media[_ngcontent-%COMP%]{height:180px;background:#f3f4f7}.new-tools-banner-card[_ngcontent-%COMP%] .new-tools-banner-media[_ngcontent-%COMP%] img[_ngcontent-%COMP%], .new-tools-banner-card[_ngcontent-%COMP%] .new-tools-banner-media[_ngcontent-%COMP%] video[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:cover;display:block;border-radius:16px;transform:scale(1.05);transition:transform .5s cubic-bezier(.22,1,.36,1)}.new-tools-banner-card[_ngcontent-%COMP%]:hover .new-tools-banner-media[_ngcontent-%COMP%] img[_ngcontent-%COMP%], .new-tools-banner-card[_ngcontent-%COMP%]:hover .new-tools-banner-media[_ngcontent-%COMP%] video[_ngcontent-%COMP%]{transform:scale(1)}.new-tools-banner__nav[_ngcontent-%COMP%]{position:absolute;top:0;width:36px;height:100%;display:flex;align-items:center;z-index:2;pointer-events:none}.new-tools-banner__nav--prev[_ngcontent-%COMP%]{left:16px}.new-tools-banner__nav--next[_ngcontent-%COMP%]{right:16px}.new-tools-banner__arrow[_ngcontent-%COMP%]{pointer-events:auto;display:flex;align-items:center;justify-content:center;width:36px;height:36px;border:0;border-radius:50%;background:#fff;box-shadow:0 4px 16px #00000014;cursor:pointer;transition:all .3s ease}.new-tools-banner__arrow[_ngcontent-%COMP%] .arrow-prev[_ngcontent-%COMP%]{transform:rotate(180deg);display:block}.new-tools-banner__arrow[_ngcontent-%COMP%] .arrow-next[_ngcontent-%COMP%]{display:block}.new-tools-banner__arrow[_ngcontent-%COMP%]:hover{background:#eff0fc}.new-tools-banner__carousel.has-card-text[_ngcontent-%COMP%] .new-tools-banner__arrow[_ngcontent-%COMP%]{margin-top:-30px}.when-format-2.new-tools-banner-card[_ngcontent-%COMP%]{flex:0 0 180px;width:180px}.when-format-2.new-tools-banner-card[_ngcontent-%COMP%] .new-tools-banner-media[_ngcontent-%COMP%]{height:180px;background:#f3f4f7}.when-format-2.new-tools-banner-card[_ngcontent-%COMP%] .suqare-center[_ngcontent-%COMP%]{text-align:center!important}.arrow-next[_ngcontent-%COMP%]{content:url(https://static.lightxeditor.com/assets/icons/arrow-grey.svg)!important}.arrow-prev[_ngcontent-%COMP%]{content:url(https://static.lightxeditor.com/assets/icons/arrow-grey.svg)!important;transform:rotate(180deg)}@media (min-width: 1200px) and (max-width: 1600px){.new-tools-banner-card[_ngcontent-%COMP%]{flex:0 0 32.5%!important;width:32.5%!important}.new-tools-banner-card[_ngcontent-%COMP%] .new-tools-banner-media[_ngcontent-%COMP%]{width:100%;height:auto;aspect-ratio:53/30}.when-format-2.new-tools-banner-card[_ngcontent-%COMP%]{flex:0 0 180px!important;width:180px!important}.when-format-2.new-tools-banner-card[_ngcontent-%COMP%] .new-tools-banner-media[_ngcontent-%COMP%]{height:180px!important}}"]}),r})();var _i=p(23334),ui=p(66518);const hi=["sliderContainer"];function fi(o,r){if(1&o){const n=t.RV6();t.j41(0,"button",14),t.bIt("click",function(){t.eBV(n);const i=t.XpG(3);return t.Njj(i.scrollLeft())}),t.nrm(1,"div",15),t.k0s()}}function bi(o,r){if(1&o&&(t.j41(0,"div",12),t.DNE(1,fi,2,0,"button",13),t.k0s()),2&o){const n=t.XpG(2);t.R7$(),t.Y8G("ngIf",!n.isAtStart)}}function vi(o,r){if(1&o){const n=t.RV6();t.j41(0,"img",21),t.bIt("error",function(){t.eBV(n);const i=t.XpG().$implicit,a=t.XpG(2);return t.Njj(a.onIconError(i))}),t.k0s()}if(2&o){const n=t.XpG().$implicit,e=t.XpG(2);t.Y8G("src",e.iconUrl+n.subTool+".svg",t.B4B)("alt",n.toolName)}}function yi(o,r){if(1&o){const n=t.RV6();t.j41(0,"img",21),t.bIt("error",function(){t.eBV(n);const i=t.XpG().$implicit,a=t.XpG(2);return t.Njj(a.onIconError(i))}),t.k0s()}if(2&o){const n=t.XpG().$implicit,e=t.XpG(2);t.Y8G("src",e.iconUrl+n.toolName+".svg",t.B4B)("alt",n.toolName)}}function xi(o,r){if(1&o&&t.nrm(0,"pi",22),2&o){const n=t.XpG().$implicit;t.FS9("name",n.iconName)}}function Ci(o,r){if(1&o){const n=t.RV6();t.j41(0,"magic-card",16),t.bIt("click",function(){const i=t.eBV(n).$implicit;t.XpG();const a=t.sdS(11),l=t.XpG();return t.Njj(l.goToEditorPage(i,a))}),t.j41(1,"div",17),t.DNE(2,vi,1,2,"img",18)(3,yi,1,2,"img",18)(4,xi,1,1,"pi",19),t.j41(5,"div",20),t.EFF(6),t.k0s()()()}if(2&o){const n=r.$implicit;t.R7$(2),t.vxM(n.toolName&&null!=n&&n.subTool&&!n.imgError?2:n.toolName&&!n.imgError?3:-1),t.R7$(2),t.Y8G("ngIf",n.imgError),t.R7$(2),t.JRh(null==n?null:n.title)}}function Ti(o,r){if(1&o){const n=t.RV6();t.j41(0,"button",25),t.bIt("click",function(){t.eBV(n);const i=t.XpG(3);return t.Njj(i.scrollRight())}),t.nrm(1,"div",26),t.k0s()}}function Pi(o,r){if(1&o&&(t.j41(0,"div",23),t.DNE(1,Ti,2,0,"button",24),t.k0s()),2&o){const n=t.XpG(2);t.R7$(),t.Y8G("ngIf",!n.isAtEnd)}}function ji(o,r){if(1&o){const n=t.RV6();t.j41(0,"div",3)(1,"div",4)(2,"h2",5),t.EFF(3),t.k0s()(),t.j41(4,"div",6),t.DNE(5,bi,2,1,"div",7),t.j41(6,"div",8,0),t.bIt("scroll",function(){t.eBV(n);const i=t.XpG();return t.Njj(i.onScroll())}),t.DNE(8,Ci,7,3,"magic-card",9),t.k0s(),t.DNE(9,Pi,2,1,"div",10),t.k0s(),t.j41(10,"input",11,1),t.bIt("change",function(i){t.eBV(n);const a=t.XpG();return t.Njj(a.onFileUploaded(i.srcElement.files))})("click",function(){t.eBV(n);const i=t.sdS(11);return t.Njj(i.value="")}
1),t.k0s()()}if(2&o){const n=t.XpG();t.R7$(3),t.JRh((null==n.sectionObj?null:n.sectionObj.title)||"Recently Used Tools"),t.R7$(2),t.Y8G("ngIf",!n.isAtStart),t.R7$(3),t.Y8G("ngForOf",n.toolHistory),t.R7$(),t.Y8G("ngIf",!n.isAtEnd),t.R7$(),t.Y8G("accept",n.fileUploadAccept)("multiple",n.multiple)}}let wi=(()=>{var o;class r extends C.Y{ngOnChanges(){}constructor(e,i,a,l,s,c,d,m,_,u,v){super(i,a,l,s,c,d,m,_,u,v),this.toolhistoryservice=e,this.aiUploadImageService=i,this.isLoaded=!1,this.sectionObj=null,this.isAtStart=!0,this.isAtEnd=!1,this.showArrows=!1,this.iconUrl="https://static.lightxeditor.com/assets/Tool-Icons/",this.toolHistory=[]}ngOnInit(){const e=this.toolhistoryservice.getHistory();this.toolHistory=e?.length?e:""}ngAfterViewInit(){this.updateArrowVisibility()}onScroll(){this.updateArrowVisibility()}goToEditorPage(e,i){e.mediaType=q.P.Image,e.mediaType="";const a={...e,metadata:e};a.text=e.title,super.openTool(a,i,this.sectionObj?.title)}updateArrowVisibility(){if(this.slider?.nativeElement){const e=this.slider.nativeElement;this.isAtStart=0===e.scrollLeft,this.isAtEnd=e.scrollLeft+e.clientWidth>=e.scrollWidth-1}}scrollLeft(){this.slider.nativeElement.scrollBy({left:-300,behavior:"smooth"})}scrollRight(){this.slider.nativeElement.scrollBy({left:300,behavior:"smooth"})}onIconError(e){e.imgError=!0}}return(o=r).\u0275fac=function(e){return new(e||o)(t.rXU(ui.k),t.rXU(j.M),t.rXU(E.A),t.rXU(h.Ix),t.rXU(O.k),t.rXU(I.A),t.rXU(F.B),t.rXU(S.f),t.rXU(U.I),t.rXU(R.g),t.rXU(N.y))},o.\u0275cmp=t.VBU({type:o,selectors:[["my-recent-tools"]],viewQuery:function(e,i){if(1&e&&t.GBs(hi,5),2&e){let a;t.mGM(a=t.lsd())&&(i.slider=a.first)}},inputs:{isLoaded:"isLoaded",sectionObj:"sectionObj"},features:[t.Vt3,t.OA$],decls:1,vars:1,consts:[["sliderContainer",""],["file",""],["class","d-flex flex-column mb-40",4,"ngIf"],[1,"d-flex","flex-column","mb-40"],[1,"d-flex","align-items-center","justify-content-start","h-40","mb-9"],[1,"text-24","text-bold","grey-800","m-0","lh-125","ml-13"],[1,"slider-wrapper"],["class","prev-bg-col",4,"ngIf"],[1,"slider",3,"scroll"],[3,"click",4,"ngFor","ngForOf"],["class","next-bg-col",4,"ngIf"],["id","fileInputId","name","fileInputId","type","file",1,"custom-file-input","d-none",3,"change","click","accept","multiple"],[1,"prev-bg-col"],["class","arrow left",3,"click",4,"ngIf"],[1,"arrow","left",3,"click"],[1,"arrow-prev"],[3,"click"],[1,"item","border-radius-lg","d-flex","align-items-center","pl-9","pr-9","pointer"],["loading","lazy",1,"ai-tools-grid__icon",3,"src","alt"],["class","grey-600 f-24",3,"name",4,"ngIf"],[1,"text-14","text-medium","grey-800","ml-8","lh-125"],["loading","lazy",1,"ai-tools-grid__icon",3,"error","src","alt"],[1,"grey-600","f-24",3,"name"],[1,"next-bg-col"],["class","arrow right",3,"click",4,"ngIf"],[1,"arrow","right",3,"click"],[1,"arrow-next"]],template:function(e,i){1&e&&t.DNE(0,ji,12,6,"div",2),2&e&&t.Y8G("ngIf",i.toolHistory.length>0)},dependencies:[g.Sq,g.bT,X.b,H.z],styles:[".slider-wrapper[_ngcontent-%COMP%]{position:relative;width:100%}.slider[_ngcontent-%COMP%]{display:flex;gap:16px;overflow-x:auto;scroll-behavior:smooth;scrollbar-width:none;padding-left:40px;padding-right:40px}.item[_ngcontent-%COMP%]{flex-shrink:0;border:1px solid #E2E3E9;background:#f8f9f9;width:220px;height:64px}.arrow[_ngcontent-%COMP%]{position:absolute;top:50%;transform:translateY(-50%);padding:8px 12px;border-radius:50%;cursor:pointer;width:36px;height:36px;font-size:40px;line-height:35px;z-index:6;transition:all .3s ease;text-align:center;border:2px solid #fff;background:#fff;box-shadow:0 4px 16px #00000014;display:flex;align-items:center;justify-content:center}.arrow[_ngcontent-%COMP%]:hover{border:2px solid #eff0fc;background-position:-192px -415px;background:#eff0fc;box-shadow:0 2px 4px #00000029}.arrow.left[_ngcontent-%COMP%]{left:24px}.arrow.right[_ngcontent-%COMP%]{right:24px}.arrow-next[_ngcontent-%COMP%]{content:url(https://static.lightxeditor.com/assets/icons/arrow-grey.svg)!important}.next-bg-col[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fff0,#f8f9f999 31%,#f8f9f9e6 66%,#f8f9f9);right:0;top:0;width:60px;height:100%;position:absolute}.prev-bg-col[_ngcontent-%COMP%]{background:linear-gradient(90deg,#f8f9f9,#f8f9f9e6 34%,#f8f9f999 69%,#fff0);left:0;top:0;width:60px;height:100%;position:absolute;z-index:6}.mb-60[_ngcontent-%COMP%]{margin-bottom:60px}"]}),r})();var Oi=p(99754);const Ii=(o,r)=>
1({"marker-left":o,new_item:r}),Si=o=>({active:o}),Mi=o=>({transition:o}),ki=(o,r,n)=>({"format-related":!0,"format-signle-row":!0,"landscape-format":o,"portrait-format":r,"square-format":n});function Gi(o,r){if(1&o){const n=t.RV6();t.j41(0,"div",10),t.bIt("click",function(){const i=t.eBV(n).$implicit,a=t.XpG(2);return t.Njj(a.selectProduct(i))}),t.EFF(1),t.k0s()}if(2&o){const n=r.$implicit,e=t.XpG(2);t.Y8G("ngClass",t.eq3(2,Si,e.activeId==(null==n||null==n.metadata?null:n.metadata.productId))),t.R7$(),t.SpI(" ",null==n||null==n.metadata?null:n.metadata.displayName,"")}}function Ei(o,r){if(1&o&&(t.j41(0,"div"),t.DNE(1,Gi,2,4,"div",9),t.k0s()),2&o){const n=t.XpG();t.R7$(),t.Y8G("ngForOf",n.products)}}function Fi(o,r){if(1&o){const n=t.RV6();t.j41(0,"div",11)(1,"button",12),t.bIt("click",function(){t.eBV(n);const i=t.XpG();return t.Njj(i.showAllproduct())}),t.j41(2,"span",13),t.EFF(3,"See All "),t.nrm(4,"pi",14),t.k0s()()()}if(2&o){const n=t.XpG();t.Y8G("ngClass",t.eq3(1,Mi,n.viewAllDisable))}}function Ui(o,r){if(1&o&&(t.qex(0),t.nrm(1,"dashboard-placeholder",15),t.bVm()),2&o){const n=t.XpG();t.R7$(),t.Y8G("sliderCardCount",(null==n.selectedProductObj||null==n.selectedProductObj.imageObjects?null:n.selectedProductObj.imageObjects.length)||8)("currentFormat",n.currentFormat)}}function Ri(o,r){if(1&o){const n=t.RV6();t.j41(0,"div",17)(1,"ng-image-slider",18,1),t.bIt("imageClick",function(i){t.eBV(n);const a=t.XpG(2);return t.Njj(a.templateClick(i))})("previewClick",function(i){t.eBV(n);const a=t.XpG(2);return t.Njj(a.showPreview(i))})("sliderNextDisableEvent",function(i){t.eBV(n);const a=t.XpG(2);return t.Njj(a.sliderNextDisable(i))})("seeAllEvent",function(){t.eBV(n);const i=t.XpG(2);return t.Njj(i.showAllproduct())}),t.k0s()()}if(2&o){const n=t.XpG(2);t.Y8G("ngClass",t.sMw(8,ki,1===n.currentFormat,3===n.currentFormat,1!==n.currentFormat&&3!==n.currentFormat)),t.R7$(),t.Y8G("images",n.selectedProductObj.imageObjects)("imageSize",n.selectedProductObj.imageSizel)("imagePopup",!1)("type","mp4Video")("graphic",!1)("footerShow",!0)("videoAutoPlay",!1)}}function Ni(o,r){if(1&o&&t.DNE(0,Ri,3,12,"div",16),2&o){const n=t.XpG();t.Y8G("ngIf",n.selectedProductObj)}}let Ai=(()=>{var o;class r extends C.Y{constructor(e,i,a,l,s,c,d,m,_,u,v){super(m,_,i,l,s,c,d,e,u,v),this.modalService=a,this.aiUploadImageService=m,this.sectionTitle="",this.steps=[],this.pageUrl="",this.products=[],this.scrollPosition=0,this.activeId=0,this.imagesOfProductMap=new Map,this.selectedProductObj=null,this.viewAllDisable=!1,this.currentFormat=0,this.isTemplatesLoading=!0,this.productFormatMap=new Map,this.formatCacheKey="ai_video_template_format_cache_v1"}ngOnInit(){this.restoreFormatCache(),this.sectionTitle=this.sectionObj.title,this.steps=this.sectionObj.steps,this.pageUrl=this.sectionObj.metadata.pageUrl,this.steps&&this.steps.length>0&&(this.products=this.steps[0].links,this.seedFormatCacheFromMetadata(),this.activeId=this.products[0].metadata.productId,this.currentFormat=this.getSavedProductFormat(this.activeId),this.getTemplateByProductId(this.products[0].metadata.productId))}onScroll(e){this.scrollPosition=e.target.scrollLeft}selectProduct(e){e.metadata&&e.metadata.productId&&(this.activeId=e.metadata.productId,this.isTemplatesLoading=!0,this.currentFormat=this.getSavedProductFormat(this.activeId),this.getTemplateByProductId(e.metadata.productId))}getTemplateByProductId(e){if(this.isTemplatesLoading=!0,this.currentFormat=this.getSavedProductFormat(e),this.imagesOfProductMap.has(e))this.selectedProductObj=this.imagesOfProductMap.get(e),this.currentFormat=this.selectedProductObj.format,this.isTemplatesLoading=!1;else{const l=0;this.templateService.getTemplateByProductId(e,0,s=>{const c=this.normalizeFormatValue(s?.format||s?.storeProductImages?.[0]?.format);c&&(this.currentFormat=c,this.setProductFormat(e,c));let d=s.storeProductImages;const m=this.products.filter(v=>v.metadata.productId===e)[0];m.metadata.storyPageUr=s.storyPageUrl,m.metadata.modelTypeId=s.modelTypeId,m.metadata.productCreditConfig=s.productCreditConfig||null,d.length>f.b.DASHBOARD_IMAGE_SLIDER_ELEMENT_NUMBER_LIMIT&&(d=d.slice(0,f.b.DASHBOARD_IMAGE_SLIDER_ELEMENT_NUMBER_LIMIT));const u=this.getFormattedProduct(e,d,!0,l);this.currentFormat=this.normalizeFormatValue(u.format),this.setProductFormat(e,this.currentFormat),this.imagesOfProductMap.set(e,u),this.selectedProductObj=u,this.isTemplatesLoading=!1},s=>{this.isTemplatesLoading=!1},l,tt.i.LighxHome)}}getFormattedProduct(e,i,a,l){let c,s=[];for(let _=0;_<i.length;_++){c=i[_];const u=this.normalizeFormatValue(c?.format),v=this.getTileHeightByFormat(u);c.productId=e,s.push({video:c.imgUrl,posterImage:c.thumbUrl,item:c,format:u,imageSizel:L.getNewImageSizeL(l,u,v,8),isplay:a})}const d=this.normalizeFormatValue(i?.[0]?.format);return{imageSizel:L.getSliderImageHeight(d,this.getTileHeightByFormat(d),8),imageObjects:s,format:d}}getTileHeightByFormat(e){return 1===e?124:3===e?306:172}getSavedProductFormat(e){if(!e)return 0;if(this.imagesOfProductMap.has(e))return this.normalizeFormatValue(this.imagesOfProductMap.get(e)?.format);if(this.productFormatMap.has(e))return this.normalizeFormatValue(this.productFormatMap.get(e)||0);const i=this.products?.find(a=>a?.metadata?.productId===e);return this.normalizeFormatValue(i?.metadata?.format||i?.metadata?.productFormat||i?.format||i?.productFormat||i?.storeProductImages?.[0]?.format||i?.metadata?.storeProductImages?.[0]?.format)}setProductFormat(e,i){const a=this.normalizeFormatValue(i);!e||!a||(this.productFormatMap.set(e,a),this.persistFormatCache())}
1seedFormatCacheFromMetadata(){(this.products||[]).forEach(e=>{const i=Number(e?.metadata?.productId||0);if(!i||this.productFormatMap.has(i))return;const a=this.normalizeFormatValue(e?.metadata?.format||e?.metadata?.productFormat||e?.format||e?.productFormat);a&&this.productFormatMap.set(i,a)})}restoreFormatCache(){try{const e=sessionStorage.getItem(this.formatCacheKey);if(!e)return;const i=JSON.parse(e);Object.keys(i||{}).forEach(a=>{const l=Number(a),s=this.normalizeFormatValue(i[a]);l&&s&&this.productFormatMap.set(l,s)})}catch{}}persistFormatCache(){try{const e={};this.productFormatMap.forEach((i,a)=>{e[a]=i}),sessionStorage.setItem(this.formatCacheKey,JSON.stringify(e))}catch{}}normalizeFormatValue(e){if(null==e||""===e)return 0;const i=Number(e);if(Number.isFinite(i)&&i>0)return i;const a=String(e).trim().toLowerCase();return a?a.includes("portrait")||"9:16"===a||"4:5"===a?3:a.includes("landscape")||"16:9"===a?1:a.includes("square")||"1:1"===a?2:0:0}showAllproduct(){if(this.sectionObj.steps.length>0){const a=this.sectionObj.steps[0].metadata;if(a.editorType&&a.toolName)return void this.openTool({metadata:a},null,this.sectionTitle)}const i=this.products.filter(a=>a.metadata.productId===this.activeId)[0].metadata.storyPageUr;this.router.navigate(["/"+f.b.aiVideoTemplate.urlPart+"/"+i+"/"])}sliderNextDisable(e){this.viewAllDisable=e}showPreview(e){console.log(e)}templateClick(e){const i=e?.img?.item||e?.img||e;if(!i)return;this.pushGtmTag(i?.displayName);const a=this.modalService.open(Oi.f,{centered:!0,size:"lg",backdrop:"static",windowClass:"ai-video-templates-dialog dynamic-field-case"});a.componentInstance.activeImgObj=i;const l=this.products.filter(s=>s.metadata.productId===this.activeId)[0];return a.componentInstance.productId=l.metadata.productId,a.componentInstance.modelTypeId=l.metadata.modelTypeId,a.componentInstance.productCreditConfig=l?.metadata?.productCreditConfig||null,a}pushGtmTag(e){const i={eventName:f.b.gtm.eventname.userDashboard,itemName:this.sectionTitle,itemType:this.leftPanelTab,itemValue:e};i.itemName&&this.gtmService.pushTag(i)}}return(o=r).\u0275fac=function(e){return new(e||o)(t.rXU(U.I),t.rXU(h.Ix),t.rXU(x.Bq),t.rXU(O.k),t.rXU(I.A),t.rXU(F.B),t.rXU(S.f),t.rXU(j.M),t.rXU(E.A),t.rXU(R.g),t.rXU(N.y))},o.\u0275cmp=t.VBU({type:o,selectors:[["ai-video-template"]],inputs:{sectionObj:"sectionObj"},features:[t.Vt3],decls:10,vars:9,consts:[["templatesSliderContent",""],["nav",""],[1,"d-flex","align-items-center","h-40",2,"margin-left","40px"],[1,"text-24","text-bold","grey-800","mb-0","text-nowrap","pe-0",3,"ngClass"],[1,"d-flex","justify-content-between","w-100","ml-10","position-relative"],["id","scrollableDiv",1,"new-scroll-behave","category-col",3,"scroll"],[4,"ngIf"],["class","show-all marker-right",3,"ngClass",4,"ngIf"],[4,"ngIf","ngIfElse"],["class","badge badge-temp me-2 h-32 ps-3 pe-3 grey-800 text-medium text-13 border-radius-8",3,"ngClass","click",4,"ngFor","ngForOf"],[1,"badge","badge-temp","me-2","h-32","ps-3","pe-3","grey-800","text-medium","text-13","border-radius-8",3,"click","ngClass"],[1,"show-all","marker-right",3,"ngClass"],[1,"btn","btn-grey","btn-h36","text-13","text-semi","grey-600","d-flex","align-items-center","pl-9","pe-1","border-0","border-radius-12",2,"transition","opacity 0.3s ease","opacity","1",3,"click"],[1,"d-flex","align-items-center"],["name","arrowdashbaord",1,"grey-600"],["type","video-template",3,"sliderCardCount","currentFormat"],["class","templates-thumbs hometemplate p-0 design-template mt-9",3,"ngClass",4,"ngIf"],[1,"templates-thumbs","hometemplate","p-0","design-template","mt-9",3,"ngClass"],[3,"imageClick","previewClick","sliderNextDisableEvent","seeAllEvent","images","imageSize","imagePopup","type","graphic","footerShow","videoAutoPlay"]],template:function(e,i){if(1&e){const a=t.RV6();t.j41(0,"div",2)(1,"h3",3),t.EFF(2),t.k0s(),t.j41(3,"div",4)(4,"div",5),t.bIt("scroll",function(s){return t.eBV(a),t.Njj(i.onScroll(s))}),t.DNE(5,Ei,2,1,"div",6),t.k0s(),t.DNE(6,Fi,5,3,"div",7),t.k0s()(),t.DNE(7,Ui,2,2,"ng-container",8)(8,Ni,1,1,"ng-template",null,0,t.C5r)}if(2&e){const a=t.sdS(9);t.R7$(),t.Y8G("ngClass",t.l_i(6,Ii,i.scrollPosition>1,null==i.sectionObj||null==i.sectionObj.metadata?null:i.sectionObj.metadata.isNew)),t.R7$(),t.JRh(i.sectionTitle),t.R7$(3),t.Y8G("ngIf",i.products.length>1),t.R7$(),t.Y8G("ngIf",(null==i.selectedProductObj||null==i.selectedProductObj.imageObjects?null:i.selectedProductObj.imageObjects.length)>=8),t.R7$(),t.Y8G("ngIf",i.isTemplatesLoading)("ngIfElse",a)}}
1,dependencies:[g.YU,g.Sq,g.bT,J.h,X.b,A.t],styles:['.f-14[_ngcontent-%COMP%]{font-size:14px!important}.badge-temp[_ngcontent-%COMP%]{color:#4a4f5e;transition:all .3s ease}.badge-temp[_ngcontent-%COMP%]:hover{background:#e2e3e966!important;border:1px solid #E2E3E9!important}.badge-temp[_ngcontent-%COMP%]:first-child{margin-left:0!important}.badge-temp[_ngcontent-%COMP%]:last-child{margin-right:36px!important}.active[_ngcontent-%COMP%]{background:#626adf;color:#fff!important;border:1px solid #626ADF}.active[_ngcontent-%COMP%]:hover, .active[_ngcontent-%COMP%]:focus{background:#626adf!important;color:#fff!important;border:1px solid #626ADF!important}.active.grey-800[_ngcontent-%COMP%]{color:#fff!important}.show-all[_ngcontent-%COMP%]{position:absolute;right:20px;top:-18px}.category-col[_ngcontent-%COMP%]{min-width:300px;white-space:nowrap;width:calc(100% - 103px)!important;overflow:auto;position:absolute;top:-16px}.marker-left[_ngcontent-%COMP%]{position:relative}.marker-left[_ngcontent-%COMP%]:before{position:absolute;content:"";width:36px;height:42px;background:linear-gradient(90deg,#f8f9f900,#f8f9f9);transform:rotate(-180deg);right:-55px;top:-5px;z-index:9}.marker-right[_ngcontent-%COMP%]{position:absolute}.marker-right[_ngcontent-%COMP%]:before{position:absolute;content:"";width:36px;height:42px;background:linear-gradient(90deg,#f8f9f900,#f8f9f9);left:-36px;top:-1px}.text-marker.marker-left[_ngcontent-%COMP%]:before{display:none!important}.new_item[_ngcontent-%COMP%]:after{top:calc(50% - 20px)!important}']}),r})();const Vi=(o,r)=>r.type+"-"+o;function Xi(o,r){1&o&&t.nrm(0,"dashboard-placeholder",19),2&o&&t.Y8G("showTitle",!1)}function Bi(o,r){if(1&o&&(t.j41(0,"div",20)(1,"h2",21),t.EFF(2),t.k0s()()),2&o){const n=t.XpG(2).$implicit;t.R7$(2),t.JRh(null==n?null:n.title)}}function Di(o,r){if(1&o&&t.DNE(0,Xi,1,1,"dashboard-placeholder",19)(1,Bi,3,1,"div",20),2&o){const n=t.XpG(2).$implicit,e=t.XpG();t.vxM(e.isTabLoaded(n)?1:0)}}function Li(o,r){if(1&o&&t.nrm(0,"new-tools-banner",22),2&o){const n=t.XpG().$implicit,e=t.XpG().$implicit,i=t.XpG();t.Y8G("sectionObj",n)("isLoaded",i.isTabLoaded(e))("isActive",i.activeSubType===e)("isSquareBanner",i.isSquareBanner())}}function $i(o,r){if(1&o&&t.nrm(0,"popular-tools",23),2&o){const n=t.XpG().$implicit,e=t.XpG().$implicit,i=t.XpG();t.Y8G("sectionObj",n)("isLoaded",i.isTabLoaded(e))}}function Yi(o,r){if(1&o&&t.nrm(0,"my-recent-projects",24),2&o){const n=t.XpG().$implicit,e=t.XpG().$implicit,i=t.XpG();t.Y8G("sectionObj",n)("isLoaded",i.isTabLoaded(e))("aiPhotoService",i.aiPhotoService)}}function zi(o,r){if(1&o&&t.nrm(0,"start-from-scratch",25),2&o){const n=t.XpG().$implicit,e=t.XpG().$implicit,i=t.XpG();t.Y8G("sectionObj",n)("isLoaded",i.isTabLoaded(e))}}function Hi(o,r){if(1&o&&t.nrm(0,"start-from-scratch",23),2&o){const n=t.XpG().$implicit,e=t.XpG().$implicit,i=t.XpG();t.Y8G("sectionObj",n)("isLoaded",i.isTabLoaded(e))}}function qi(o,r){if(1&o&&t.nrm(0,"ai-tools",26),2&o){const n=t.XpG().$implicit,e=t.XpG().$implicit,i=t.XpG();t.Y8G("sectionObj",n)("isLoaded",i.isTabLoaded(e))}}function Wi(o,r){if(1&o&&t.nrm(0,"ai-tools",26),2&o){const n=t.XpG().$implicit,e=t.XpG().$implicit,i=t.XpG();t.Y8G("sectionObj",n)("isLoaded",i.isTabLoaded(e))}}function Ji(o,r){if(1&o&&t.nrm(0,"aidesign-tools",27),2&o){const n=t.XpG().$implicit,e=t.XpG().$implicit,i=t.XpG();t.Y8G("sectionObj",n)("isLoaded",i.isTabLoaded(e))("leftPanelTab",i.tab)}}function Ki(o,r){if(1&o&&t.nrm(0,"instant-design",28),2&o){const n=t.XpG().$implicit;t.Y8G("sectionObj",n)}}function Qi(o,r){if(1&o&&t.nrm(0,"editing-tools",26),2&o){const n=t.XpG().$implicit,e=t.XpG().$implicit,i=t.XpG();t.Y8G("sectionObj",n)("isLoaded",i.isTabLoaded(e))}}function Zi(o,r){if(1&o&&t.nrm(0,"editing-tools",26),2&o){const n=t.XpG().$implicit,e=t.XpG().$implicit,i=t.XpG();t.Y8G("sectionObj",n)("isLoaded",i.isTabLoaded(e))}}function tn(o,r){if(1&o&&t.nrm(0,"editing-tools",26),2&o){const n=t.XpG().$implicit,e=t.XpG().$implicit,i=t.XpG();t.Y8G("sectionObj",n)("isLoaded",i.isTabLoaded(e))}}function en(o,r){if(1&o&&t.nrm(0,"editing-tools",26),2&o){const n=t.XpG().$implicit,e=t.XpG().$implicit,i=t.XpG();t.Y8G("sectionObj",n)("isLoaded",i.isTabLoaded(e))}}function nn(o,r){if(1&o&&t.nrm(0,"category-products-listing",26),2&o){const n=t.XpG().$implicit,e=t.XpG().$implicit,i=t.XpG();t.Y8G("sectionObj",n)("isLoaded",i.isTabLoaded(e))}}function on(o,r){if(1&o&&t.nrm(0,"category-products-listing",26),2&o){const n=t.XpG().$implicit,e=t.XpG().$implicit,i=t.XpG();t.Y8G("sectionObj",n)("isLoaded",i.isTabLoaded(e))}}function an(o,r){if(1&o&&t.nrm(0,"product-listing",29),2&o){const n=t.XpG().$implicit;t.Y8G("sectionObj",n)("isVideo",!0)("isGraphics",!1)}}function sn(o,r){if(1&o&&t.nrm(0,"product-listing",30),2&o){const n=t.XpG().$implicit;t.Y8G("sectionObj",n)("isVideo",!1)}}function rn(o,r){if(1&o&&t.nrm(0,"ai-bottom-banner",31),2&o){const n=t.XpG().$implicit;t.Y8G("sectionObj",n)}}function ln(o,r){if(1&o&&t.nrm(0,"ai-video-template",32),2&o){const n=t.XpG().$implicit;t.Y8G("sectionObj",n)}}function cn(o,r){if(1&o&&t.nrm(0,"my-recent-tools",26),2&o){const n=t.XpG().$implicit,e=t.XpG().$implicit,i=t.XpG();t.Y8G("sectionObj",n)("isLoaded",i.isTabLoaded(e))}}function dn(o,r){if(1&o&&(t.j41(0,"div",7),t.DNE(1,Di,2,1)(2,Li,1,4,"new-tools-banner",8)(3,$i,1,2,"popular-tools",9)(4,Yi,1,3,"my-recent-projects",10)(5,zi,1,2,"start-from-scratch",11)(6,Hi,1,2,"start-from-scratch",9)(7,qi,1,2,"ai-tools",12)(8,Wi,1,2,"ai-tools",12)(9,Ji,1,3,"aidesign-tools",13)(10,Ki,1,1,"instant-design",14)(11,Qi,1,2,"editing-tools",12)(12,Zi,1,2,"editing-tools",12)(13,tn,1,2,"editing-tools",12)(14,en,1,2,"editing-tools",12)(15,nn,1,2,"category-products-listing",12)(16,on,1,2,"category-products-listing",12)(17,an,1,3,"product-listing",15)(18,sn,1,2,"product-listing",16)(19,rn,1,1,"ai-bottom-banner",17)(20,ln,1,1,"ai-video-template",18)(21,cn,1,2,"my-recent-tools",12),t.k0s()),2&o){const n=r.$implicit,e=r.$index,i=t.XpG().$implicit;t.Y8G("ngSwitch",n.type)("id",i+"-"+e+"-"+n.type),t.R7$(),t.vxM("heading"==n.type?1:-1),t.R7$(),t.Y8G("ngSwitchCase","top-banner"),t.R7$(),t.Y8G("ngSwitchCase","popular-tools"),t.R7$(),t.Y8G("ngSwitchCase","recent-projects"),t.R7$(),t.Y8G("ngSwitchCase","start-from-scratch"),t.R7$(),t.Y8G("ngSwitchCase","create-new-design"),t.R7$(),t.Y8G("ngSwitchCase","ai-tools"),t.R7$(),t.Y8G("ngSwitchCase","ai-video-tools"),t.R7$(),t.Y8G("ngSwitchCase","aidesign-tools"),t.R7$(),t.Y8G("ngSwitchCase","instant-design"),t.R7$(),t.Y8G("ngSwitchCase","photo-editing-tools"),t.R7$(),t.Y8G("ngSwitchCase","batch-editor"),t.R7$(),t.Y8G("ngSwitchCase","quick-edit-tools"),t.R7$(),t.Y8G("ngSwitchCase","video-editing-tools"),t.R7$(),t.Y8G("ngSwitchCase","category-products"),t.R7$(),t.Y8G("ngSwitchCase","ai-image-tools"),t.R7$(),t.Y8G("ngSwitchCase","video-templates"),t.R7$(),t.Y8G("ngSwitchCase","ai-image-templates"),t.R7$(),t.Y8G("ngSwitchCase","ai-footer-area"),t.R7$(),t.Y8G("ngSwitchCase","ai-video-templates"),t.R7$(),t.Y8G("ngSwitchCase","my-recent-tools")}}function pn(o,r){if(1&o&&(t.j41(0,"div",5),t.Z7z(1,dn,22,23,"div",7,Vi),t.k0s()),2&o){const n=r.$implicit,e=t.XpG();t.Y8G("hidden",e.activeSubType!==n),t.R7$(),t.Dyx(e.getTabSections(n))}}const mn=[{path:"",component:(()=>{var o;class r extends C.Y{constructor(e,i,a,l,s,c,d,m){super(null,null,null,null,null,null,null,null,null,null),this.storyPageService=e,this.activatedRoute=i,this.modalService=a,this.apiMarketing=l,this.viewportScroller=s,this.dashboardService=c,this.aiPhotoService=d,this.authService=m,this.activeSubType="",this.visitedSubTypes=[],this.tab="Home",this.type="",this.tabsData=new Map,this.subscriptions=[]}ngOnInit(){this.subscriptions.push(this.activatedRoute.queryParamMap.subscribe(i=>{const a=i.get("m")||sessionStorage.getItem("m");a&&this.apiMarketing.handleApiMarketing(a),this.switchDashboardTab(i.get("type")||"")})),this.authService.currentUser()&&this.authService.updateUserAiConis()}ngAfterViewInit(){this.scrollToTop()}ngOnDestroy(){this.dashboardContentSub?.unsubscribe(),this.subscriptions.forEach(e
1=>e?.unsubscribe()),this.subscriptions=[],this.aiPhotoService.aiImages=[]}getTabSections(e){return this.tabsData.get(e)?.sections??[]}isTabLoaded(e){return this.tabsData.get(e)?.isLoaded??!1}trackBySection(e,i){return`${e}-${i?.type||""}`}switchDashboardTab(e){this.type=e;const i=this.resolveSubType(e);if(this.activeSubType=i,super.setLeftPanelTab(this.tab),this.tabsData.has(i))return;const a=this.dashboardService.getDashboardSectionsCache(i),l=a.length>0;this.tabsData.set(i,{sections:l?[...a]:[...this.getPlaceholderSections(e)],isLoaded:l}),this.visitedSubTypes.includes(i)||(this.visitedSubTypes=[...this.visitedSubTypes,i]),l||this.loadDashboardContent(i)}loadDashboardContent(e){this.dashboardContentSub?.unsubscribe(),this.dashboardContentSub=this.storyPageService.getStoryPageContentCancellable("dashboard","dashboard",e,i=>{if(this.activeSubType!==e)return;const a=this.tabsData.get(e);if(!a)return;const l=i?.body?.storyPage?.sections||[],s=i?.body?.storyPage||{};l.length&&s?.subType===e&&(a.sections=[...l],this.dashboardService.setDashboardSectionsCache(e,a.sections)),a.isLoaded=!0},()=>{const i=this.tabsData.get(e);i&&(i.isLoaded=!0)},"en",!1)}scrollToTop(){const e=()=>{this.viewportScroller.scrollToPosition([0,0]),window.scrollTo(0,0),document.documentElement.scrollTop=0,document.body.scrollTop=0};e(),requestAnimationFrame(e),setTimeout(e,0),setTimeout(e,100)}resolveSubType(e){switch(e){case"ai-image":return this.tab="AI Image","user-dashboard-image";case"ai-video":return this.tab="AI Video","user-dashboard-video";case"photo-editing":return this.tab="AI Photo Editor","user-dashboard-photo-editor";case"ai-business":return this.tab="AI For Business","user-dashboard-business";default:return this.tab="Home","user-dashboard-home"}}getPlaceholderSections(e){switch(e){case"ai-image":return[{type:"top-banner"},{type:"ai-tools"},{type:"ai-image-tools"}];case"ai-video":return[{type:"top-banner"},{type:"ai-tools"},{type:"ai-video-tools"}];case"photo-editing":return[{type:"editing-tools"},{type:"editing-tools"},{type:"editing-tools"},{type:"quick-edit-tools"}];case"ai-business":return[{type:"top-banner"},{type:"ai-tools"}];default:return[{type:"heading"},{type:"top-banner"},{type:"start-from-scratch"},{type:"ai-tools"},{type:"popular-tools"},{type:"recent-projects"}]}}onBrowserBack(){this.modalService.hasOpenModals()&&this.modalService.dismissAll()}isSquareBanner(){return"ai-image"===this.type}}return(o=r).\u0275fac=function(e){return new(e||o)(t.rXU(y.K),t.rXU(h.nX),t.rXU(x.Bq),t.rXU(b.W),t.rXU(g.Xr),t.rXU(k),t.rXU(G.s),t.rXU(w.u))},o.\u0275cmp=t.VBU({type:o,selectors:[["app-user-dashboard"]],hostBindings:function(e,i){1&e&&t.bIt("popstate",function(){return i.onBrowserBack()},!1,t.tSv)},features:[t.Vt3],decls:10,vars:0,consts:[["content",""],[1,"pt-8"],[1,"row","g-0",2,"padding-top","56px"],[1,"col-i","navs-drawer","h-100","bg-transparent",2,"position","sticky","top","66px","height","calc(100vh - 79px) !important","z-index","9"],[1,"col-i","wrapper-for-timeline","right-section",2,"margin-left","40px","min-height","550px"],[1,"dashboard-tab-panel",3,"hidden"],[1,"d-none","overlay-window"],[1,"dashboard","mt-5",2,"margin-left","-40px",3,"ngSwitch","id"],[3,"sectionObj","isLoaded","isActive","isSquareBanner",4,"ngSwitchCase"],["class","d-flex flex-column",3,"sectionObj","isLoaded",4,"ngSwitchCase"],["class","d-flex flex-column",3,"sectionObj","isLoaded","aiPhotoService",4,"ngSwitchCase"],["class","d-flex flex-column","style","margin-left:40px;",3,"sectionObj","isLoaded",4,"ngSwitchCase"],[3,"sectionObj","isLoaded",4,"ngSwitchCase"],["class","d-flex flex-column",3,"sectionObj","isLoaded","leftPanelTab",4,"ngSwitchCase"],["class","d-flex flex-column",3,"sectionObj",4,"ngSwitchCase"],[3,"sectionObj","isVideo","isGraphics",4,"ngSwitchCase"],[3,"sectionObj","isVideo",4,"ngSwitchCase"],["class","d-flex flex-column","style","margin-left:40px;",3,"sectionObj",4,"ngSwitchCase"],["class","recent-slider",3,"sectionObj",4,"ngSwitchCase"],["type","heading",3,"showTitle"],[1,"d-flex","align-items-center","justify-content-center",2,"margin-bottom","-36px","min-height","67px"],[1,"text-28","text-bold","grey-800","m-0","lh-125","m-0"],[3,"sectionObj","isLoaded","isActive","
1isSquareBanner"],[1,"d-flex","flex-column",3,"sectionObj","isLoaded"],[1,"d-flex","flex-column",3,"sectionObj","isLoaded","aiPhotoService"],[1,"d-flex","flex-column",2,"margin-left","40px",3,"sectionObj","isLoaded"],[3,"sectionObj","isLoaded"],[1,"d-flex","flex-column",3,"sectionObj","isLoaded","leftPanelTab"],[1,"d-flex","flex-column",3,"sectionObj"],[3,"sectionObj","isVideo","isGraphics"],[3,"sectionObj","isVideo"],[1,"d-flex","flex-column",2,"margin-left","40px",3,"sectionObj"],[1,"recent-slider",3,"sectionObj"]],template:function(e,i){1&e&&(t.nrm(0,"dashborad-header"),t.j41(1,"div",1)(2,"div",2)(3,"div",3),t.nrm(4,"left-pannel"),t.k0s(),t.j41(5,"div",4,0),t.Z7z(7,pn,3,1,"div",5,t.fX1),t.k0s(),t.nrm(9,"div",6),t.k0s()()),2&e&&(t.R7$(7),t.Dyx(i.visitedSubTypes))},dependencies:[g.ux,g.e1,D,ct,Gt,Qt,oe,me,ue,Ue,We,ti,nt.V,gi,A.t,_i.d,wi,Ai],styles:[".mt-60[_ngcontent-%COMP%]{margin-top:60px}.mb-60[_ngcontent-%COMP%]{margin-bottom:60px}.wrapper-for-timeline[_ngcontent-%COMP%] [_ngcontent-%COMP%]:first-child{margin-top:0!important;padding-top:0!important}#ai-footer-area[_ngcontent-%COMP%]{margin-top:20px!important}.right-section[_ngcontent-%COMP%]{width:calc(100% - 24rem + 44px)!important}.dashboard-tab-panel[hidden][_ngcontent-%COMP%]{display:none!important}.banner-margin[_ngcontent-%COMP%]{margin-bottom:-60px}"]}),r})()}];let gn=(()=>{var o;class r{}return(o=r).\u0275fac=function(e){return new(e||o)},o.\u0275mod=t.$C({type:o}),o.\u0275inj=t.G2t({imports:[h.iI.forChild(mn),h.iI]}),r})();var _n=p(84387),un=p(83339),hn=p(79421),fn=p(77183),bn=p(4651),vn=p(23639);let yn=(()=>{var o;class r{}return(o=r).\u0275fac=function(e){return new(e||o)},o.\u0275mod=t.$C({type:o}),o.\u0275inj=t.G2t({providers:[k,it,Z.Zg],imports:[g.MD,gn,_n.W,un.G,hn.r,fn.f,bn.Rl,vn.I]}),r})()},23639:(Y,M,p)=>{p.d(M,{I:()=>G});var g=p(60177),h=p(33391),C=p(79421),t=p(23679),y=p(89818),x=p(84341),b=p(67381),T=p(4091),k=p(54438);let G=(()=>{var w;class D{}return(w=D).\u0275fac=function(j){return new(j||w)},w.\u0275mod=k.$C({type:w}),w.\u0275inj=k.G2t({imports:[g.MD,h.UN,h.n8,C.r,t.Y,y.MQ,x.YN,x.X1,b.G,T.S]}),D})()}}]);
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.