1"use strict";(self.webpackChunklightx=self.webpackChunklightx||[]).push([[2263],{82263:(_,p,c)=>{c.r(p),c.d(p,{AiPhotoEditorUiModule:()=>Ac});var s=c(60177),P=c(21626),u=c(84341),f=c(33391),S=c(34870),D=c(83339),y=c(74710),ie=c(94329),$=c(92838),h=c(16471),k=c(1408),R=c(54843),T=c(41584),W=c(27707),ne=c(27222),Z=c(43695),F=c(93552),e=c(54438);let ee=(()=>{var r;class l{constructor(t){this.modalService=t}refineMask(t,n=null){F.fabric.util.loadImage(t,i=>{let a=this.removeBgResult.mask,d=a.width,g=a.height,m=document.createElement("canvas");m.width=d,m.height=g,m.getContext("2d").putImageData(a,0,0);let O=m.toDataURL();F.fabric.util.loadImage(O,E=>{const Y=this.modalService.open(ne.f,{centered:!0,size:"semi-xxl photoshoot-refine",backdrop:"static",windowClass:"removeBg"});Y.componentInstance.isDialog=!0;const ge={img:t,bgType:2,mask:Z.k.getScaledImageInImageDataBySize(E,i.width,i.height),tab:"remove_bg",w:this.removeBgResult.width,h:this.removeBgResult.height,action:"default_project",isDialog:!0};Y.componentInstance.photoEditorOptions=ge,Y.result.then(z=>{z&&n&&n(z)}).catch(()=>{n&&n(null)})},null,"Anonymous")},null,"Anonymous")}}return(r=l).\u0275fac=function(t){return new(t||r)(e.KVO(f.Bq))},r.\u0275prov=e.jDH({token:r,factory:r.\u0275fac}),l})();var J=c(67294),x=c(16478),G=c(80006),U=c(94223),N=c(68010),K=c(10634),fe=c(65356),se=c(49449),ye=c(91367),Be=c(22154),ve=c(68287),Ge=c(66518),Ie=c(34183),we=c(82853),L=c(68064),je=c(64141),le=c(10467),me=c(45312),Fe=c(24886),Ne=c(95301),Le=c(6755),I=c(41300),j=c(55349),v=c(55756),C=c(74983),M=c(94375),w=c(33645),V=c(55445);const de=r=>[r],We=r=>({new_item:r}),ht=r=>({"no-credit-item":r});function ut(r,l){if(1&r){const o=e.RV6();e.qex(0),e.j41(1,"div",52)(2,"div",53),e.bIt("click",function(){const n=e.eBV(o).$implicit,i=e.XpG().index,a=e.XpG(5);return a.menuClick(n),e.Njj(a.hideMenubar("menu-"+(i+1)))}),e.j41(3,"div",54),e.nrm(4,"img",55),e.k0s(),e.j41(5,"div",56)(6,"h3",57),e.EFF(7),e.k0s()()()(),e.bVm()}if(2&r){const o=l.$implicit;e.R7$(4),e.FS9("src",o.url,e.B4B),e.FS9("alt",o.text),e.R7$(2),e.Y8G("ngClass",e.eq3(4,We,1==(null==o||null==o.metadata?null:o.metadata.isNew))),e.R7$(),e.JRh(o.text)}}function Pt(r,l){if(1&r&&(e.j41(0,"div",48)(1,"div",49)(2,"h3",50),e.EFF(3),e.k0s()(),e.DNE(4,ut,8,6,"ng-container",51),e.k0s()),2&r){const o=l.$implicit;e.R7$(3),e.JRh(o.title),e.R7$(),e.Y8G("ngForOf",o.links)}}function ft(r,l){if(1&r&&(e.j41(0,"div",41)(1,"div",42)(2,"div",43)(3,"div",44)(4,"div",45)(5,"div",46),e.DNE(6,Pt,5,2,"div",47),e.k0s()()()()()()),2&r){const o=e.XpG(2).index,t=e.XpG(2);e.Mz_("id","mg-menu-panel-",o+1,""),e.R7$(6),e.Y8G("ngForOf",t.storyPage.sections)}}function bt(r,l){if(1&r&&(e.qex(0),e.j41(1,"a",36)(2,"div",37)(3,"span",38),e.EFF(4,"All Tools"),e.k0s(),e.nrm(5,"pi",39),e.k0s()(),e.DNE(6,ft,7,3,"div",40),e.bVm()),2&r){const o=e.XpG(3);e.R7$(6),e.Y8G("ngIf",null==o.storyPage?null:o.storyPage.sections)}}function Ct(r,l){if(1&r){const o=e.RV6();e.j41(0,"li",34),e.bIt("mouseenter",function(){const n=e.eBV(o).$implicit,i=e.XpG(2);return e.Njj(i.resetMenu(n))}),e.DNE(1,bt,7,1,"ng-container",35),e.k0s()}if(2&r){const o=l.$implicit,t=l.index;e.FS9("tabindex",5+t),e.Mz_("id","menu-",t+1,""),e.R7$(),e.Y8G("ngIf",o.type)}}function vt(r,l){if(1&r&&(e.j41(0,"div",31)(1,"ul",32),e.DNE(2,Ct,2,4,"li",33),e.k0s()()),2&r){const o=e.XpG();e.R7$(2),e.Y8G("ngForOf",o.mainSection)}}function It(r,l){1&r&&e.nrm(0,"div",58)}function xt(r,l){1&r&&(e.j41(0,"span",59),e.EFF(1,"Select all"),e.k0s())}function Mt(r,l){1&r&&(e.j41(0,"span",59),e.EFF(1,"Deselect all"),e.k0s())}function Ot(r,l){if(1&r&&(e.j41(0,"span",64),e.EFF(1),e.k0s()),2&r){const o=e.XpG(2);e.R7$(),e.JRh(o.user.remainingCoins)}}function yt(r,l){1&r&&(e.j41(0,"span",64),e.EFF(1,"00"),e.k0s())}function wt(r,l){if(1&r){const o=e.RV6();e.j41(0,"button",65),e.bIt("click",function(){e.eBV(o);const n=e.XpG(2);return e.Njj(n.upgradePlanDirectPayment())}),e.EFF(1,"Unlock Full Credits"),e.k0s()}}function Et(r,l){if(1&r){const o=e.RV6();e.j41(0,"button",65),e.bIt("click",function(){e.eBV(o);const n=e.XpG(2);return e.Njj(n.addCredits())}),e.EFF(1,"Add Credits"),e.k0s()}}function St(r,l){if(1&r&&(e.j41(0,"div",60),e.nrm(1,"img",61),e.DNE(2,Ot,2,1,"span",62)(3,yt,2,0,"span",62)(4,wt,2,0,"button",63)(5,Et,2,0,"button",63),e.k0s()),2&r){const o=e.XpG();e.Y8G("ngClass",e.eq3(4,ht,!o.user.remainingCoins)),e.R7$(2),e.Y8G("ngIf",o.user.remainingCoins>0),e.R7$(),e.Y8G("ngIf",!o.user.remainingCoins||o.user.remainingCoins<0),e.R7$(),e.vxM(o.isInTrialPeriod&&o.isTrialCredit
1Cap?4:5)}}function Tt(r,l){if(1&r){const o=e.RV6();e.j41(0,"button",66),e.bIt("click",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.getCredits())}),e.nrm(1,"img",61),e.EFF(2," Get Credits "),e.k0s()}}let Dt=(()=>{var r;class l{constructor(t,n,i,a,d,g,m,b,O,E,Y,q,_e,ge,z,ze,qe,He,H,Ae,Je){this._router=t,this.loginService=n,this.authService=i,this.aiPhotoService=a,this.subsService=d,this.route=g,this.router=m,this.paymentService=b,this.dataService=O,this.envService=E,this.storyPageService=Y,this.uploadImageService=q,this.aiUploadImageService=_e,this.dialogService=ge,this.editorService=z,this.modalService=ze,this.editorUiService=qe,this.gtmService=He,this.document=H,this.toastService=Ae,this.menuService=Je,this.homeURL="/",this.inProgress=!1,this.isSelectAll=!1,this.isDownloadDisabled=!0,this.storyPagesUrls=[],this.selectAllChanged=new e.bkB,this.megaMenuItem=!1,this.toolType="ai-all-tools",this.mainSection=[],this.templateTypeForSearch=Fe.If.NONE,this.searchPlaceholder="Search tools",this.ngOpenValue=!1,this.imgQueryParams={imageUrl:"",tabName:"",from:"",editorType:"",openNewTab:!1},this.isTrialCreditCap=!1,this.isInTrialPeriod=!1,this.body=this.document.getElementsByTagName("body"),this.queryParams=this.route.snapshot.queryParams,this.slug=this.route.snapshot.paramMap.get("slug"),this.user=this.authService.currentUser(),this.setHomeUrl(),this.refreshTrialAndPaymentFlags(),this.loggedInObserver=this.authService.loggedIn.subscribe(pe=>{this.user=this.authService.currentUser(),this.setHomeUrl(),this.refreshTrialAndPaymentFlags()}),this.dataService.get(me.c.staticAssetsPath+"assets/json/menuv3.json?v="+me.c.cacheControlVersion,!0).subscribe(pe=>{this.JsonMegaMenuList=pe,this.isLoaded=!1}),this.getAllToolContent(),this.usrPropChangedObserver=this.authService.usrPropChanged.subscribe(pe=>{this.user=this.authService.currentUser(),this.setHomeUrl(),this.refreshTrialAndPaymentFlags()}),this.updateConfigObserver=this.paymentService.updateConfig.subscribe(pe=>{pe&&this.refreshTrialAndPaymentFlags()})}getAllToolContent(){this.storyPageService.getStoryPageContent("all-tools","all-tools","all-tools",t=>{if(this.storyPage=t.body.storyPage,this.storyPage){const n=this.storyPage?.sections.filter(i=>i.type==this.toolType);this.mainSection=n&&n.length>0?n:[],this.mainSection.length>0&&(this.mainSection[0].pageTitle="All tools"),this.storyPage?.sections.forEach(i=>{i.links?.sort((a,d)=>a?.metadata?.order-d?.metadata?.order)})}this.isLoaded=!0},t=>{t&&1e3===t.statusCode&&this.router.navigate(["/404"])})}setHomeUrl(){this.homeURL=this.user?x.b.AFTER_LOGIN_REDIRATION_URI:"/"}refreshTrialAndPaymentFlags(){this.isTrialCreditCap=!0,this.isInTrialPeriod=this.authService.getSubscription()?.upgrade}ngOnDestroy(){this.loggedInObserver&&this.loggedInObserver.unsubscribe(),this.usrPropChangedObserver&&this.usrPropChangedObserver.unsubscribe(),this.updateConfigObserver&&this.updateConfigObserver.unsubscribe()}ngOnInit(){}template(t){this.aiPhotoService.getAllowedTypesSearch().includes(t.type)?this.menuClick(t):window.open(me.c.siteUrl+"/"+t.type.replace(/ai-design-templates$/,"ai-design")+"/"+(t.intermediateSlug?t.intermediateSlug+"/":"")+t.subType,"_blank")}onDashboardSearchOpenChange(t){this.ngOpenValue=t}downloadAll(){if(this.isDownloadDisabled)return;let t=[],n=0;this.aiPhotoService.aiImages.forEach(i=>{n++,i.checked&&t.push(i),t.length>0&&n===this.aiPhotoService.aiImages.length&&(this.isDownloadDisabled=1!==t.length,this.aiPhotoService.downloadAll(t,()=>{this.isDownloadDisabled=!1}))})}getCredits(){let t=this.paymentService?.config?.aiVideoCredits>0?this.paymentService?.config?.aiVideoCredits:this.paymentService.aiVideoCredits;this.queryParams?.tab==h.Fs.TextToVideo||this.queryParams?.tab==h.Fs.ImageToVideo?this.aiPhotoService.openAICreditPopup(null,t,"video"):this.aiPhotoService.openAICreditPopup()}addCredits(){this.subsService.upgradeAiPlanCheckout("","",this.activeTool)}upgradePlanDirectPayment(){let t=this.paymentService?.config?.aiSubscriptionCredits;this.subsService.upgradePlanDirectPayment({plan_type:"yearly",isDirectPayment:!0,aiSubscriptionCredits:t})}markProject(t){t?(this.isSelectAll=!1,this.isDownloadDisabled=!0):(this.isSelectAll=!0,this.isDownloadDisabled=!1),this.aiPhotoService.aiImages?.forEach(n=>
1{n.checked=this.isSelectAll,n.showcheck=!!this.isSelectAll}),this.selectAllChanged.emit(this.isSelectAll)}goToGenerations(){this.user?this._router.navigate(["/my/projects"],{queryParams:{type:5}}):this.loginService.openLoginDialog(t=>{this.user=this.authService.currentUser(),this.user&&(this.user=this.authService.currentUser(),this._router.navigate(["/my/projects"],{queryParams:{type:5}}))})}resetMenu(t){this.megaMenuItem=!0,this.designItem=JSON.parse(JSON.stringify(t))}onMenuMouseEnter(t,n){this.menuService.showMenuPanel(t),this.resetMenu(n)}menuClick(t){let n=this.dialogService.showProgress();this.getStoryPage(t,i=>{if(i){if(this.storyPage){const m=JSON.parse(JSON.stringify(this.storyPage.sections));this.storyPage.sections=null,setTimeout(()=>{this.storyPage.sections=m,this.storyPage?.sections.forEach(b=>{b.links?.sort((O,E)=>O?.metadata?.order-E?.metadata?.order)})},50)}let a=Object.assign({},i.sections[0].metadata,i.metadata);if(a?.queryString){const m=this.aiUploadImageService.getParams(a?.queryString);a=Object.assign({},a,m)}const d=i.sections[0];if("mixed-banner-header"==d.type&&d.links?.length){const m=d.links[0].metadata;let b=this.aiUploadImageService.getParams(m?.queryString);a=Object.assign({},a,m,b),a.editorType!=h._Y.AIPhoto&&(a.tab=a.toolName)}if(a.editorType==h._Y.BatchEditor)return this.aiUploadImageService.navigateToBatchEditor(a),void setTimeout(()=>{n.close()},200);if(a.editorType==h._Y.AIPhoto){this.uploadImageService.storyMetaData={...a},this.aiPhotoService.queryParams={...this.aiPhotoService.queryParams||{},...a?.productId&&{productId:a.productId||0},...a?.prodImageId&&{prodImageId:a.prodImageId||0},...a?.catId&&{catId:a.catId||0},...a?.gender&&{gender:a.gender||0},...a?.attr&&{attr:a.attr||""}};const m=this.aiUploadImageService.getAiEditorParams(a);return this.editorService.setActiveToolPanel({panel:m?.tab,toolName:m?.toolName,from:"nav",changeTool:!0}),this.gtmService.pushTag({eventName:x.b.gtm.eventname.allToolsClick,itemName:t.text,itemType:a.toolName,itemValue:"AI Editor"}),void setTimeout(()=>{n.close()},200)}if(a.editorType==h._Y.Photo){let m=!1;this.imgQueryParams.openNewTab=!0,this.imgQueryParams.imageUrl=this.aiPhotoService.imgUrl?this.aiPhotoService.imgUrl:this.aiPhotoService.originalImgUrl?this.aiPhotoService.originalImgUrl:this.queryParams?.imgUrl?this.queryParams?.imgUrl:this.queryParams?.img||"",this.imgQueryParams.from=this.slug,this.imgQueryParams.tabName=a.toolName||a?.tab,this.imgQueryParams.targetPage=h._Y.Photo==a.editorType?"/edit-tools/edit":a.editorType==h._Y.AIPhoto?"/ai-photo-editor/edit":a?.targetPage?a.targetPage:"",this.imgQueryParams.editorType=a.editorType,this.imgQueryParams.subTool=a?.subTool,this.imgQueryParams.pid=this.uploadImageService.storyMetaData?.productId||"0",this.imgQueryParams.stagid=this.uploadImageService.storyMetaData?.storeAddtlTagId||"0",a.toolName==h.z6.ProfileMaker?(this.imgQueryParams.targetPage=x.b.targetPage.profilePicture,this.imgQueryParams.pid=a?.id||a?.productId,this.imgQueryParams.stagid=a?.subId||a?.tagId,m=!0):a.toolName==h.z6.ProductShowcase?(this.imgQueryParams.targetPage=x.b.targetPage.productShowcase,this.imgQueryParams.pid=a?.id||a?.productId,this.imgQueryParams.stagid=a?.subId||a?.tagId,m=!0):(a.toolName==h.z6.PhotoResizer||a.toolName==h.z6.Tools&&a.subTool==h.z6.Resize)&&(this.imgQueryParams.targetPage=x.b.targetPage.photoResizer,this.imgQueryParams.pid=a?.id||a?.productId,a.toolName==h.z6.Tools&&a.subTool==h.z6.Resize&&(this.imgQueryParams.subTool=a?.subTool,this.imgQueryParams.from=i?.subType?i?.subType:"photo-resizer"),m=!0),this.isBlobUrl(this.imgQueryParams.imageUrl)?this.validateImageBlobUrl(this.imgQueryParams.imageUrl).then(b=>{b?(this.uploadImageService.loadInputImage(this.imgQueryParams,()=>{}),setTimeout(()=>{n.close()},200)):!b&&m?this.uploadOpenImageModal():!b&&this.imgQueryParams?.openNewTab&&(this.imgQueryParams.imageUrl="",this.uploadImageService.loadWithoutImage(this.imgQueryParams,()=>{})),setTimeout(()=>{n.close()},200)}):this.isValidImageDataUrl(this.imgQueryParams.imageUrl)?(this.uploadImageService.loadInputImage(this.imgQueryParams,()=>{}),setTimeout(()=>{n.close()},200)):m?(this.imgQueryParams.imageUrl?this.uploadImageService.loadInputImage(this.imgQueryParams,b=>{b&&"ERROR"==b&&this.uploadOpenImageModal()}):this.uploadOpenImageModal(),setTimeout(()=>{n.close()},200)):m||(this.imgQueryParams.imageUrl&&!this.isBlobUrl(this.imgQueryParams.imageUrl)?this.uploadImageService.loadInputImage(this.imgQueryParams,b=>{b&&"ERROR"==b&&(this.imgQueryParams.imageUrl="",this.uploadImageService.loadWithoutImage(this.imgQueryParams,()=>{}))}):(this.imgQueryParams.imageUrl="",this.uploadImageService.loadWithoutImage(this.imgQueryParams,()=>{})),setTimeout(()=>{n.close()},200))}else(a.editorType==h._Y.ImageTool||a.editorType==h._Y.VideoTemplate||a.editorType==h._Y.DesignTemplate)&&(window.open(me.c.siteUrl+"/"+t.type+"/"+t.subType,"_blank"),setTimeout(()=>{n.close()},200));this.gtmService.pushTag({eventName:x.b.gtm.eventname.allToolsClick,itemName:t.text,itemType:a.toolName,itemValue:"AI Editor"})}else this.toastService.showError("Story Page Not Found"),setTimeout(()=>{n.close()},200)})}hideMenubar(t){const n=this.document.getElementById(t);n&&(n?.classList?.remove("show"),this.body[0]?.classList?.remove("scroll-stop"))}dataURLtoFile(t,n){const i=t.split(","),a=i[0].match(/:(.*?);/)[1],d=atob(i[1]);let g=d.length;const m=new Uint8Array(g);for(;g--;
1)m[g]=d.charCodeAt(g);return new File([m],n,{type:a})}validateImageBlobUrl(t){return new Promise(n=>{if(!t||!t.startsWith("blob:"))return void n(!1);const i=new Image;i.src=t,i.onload=()=>n(!0),i.onerror=()=>n(!1)})}isValidImageDataUrl(t){return/^data:image\/(png|jpeg|jpg|gif|bmp|webp);base64,[A-Za-z0-9+/=]+$/.test(t)}isBlobUrl(t){try{return"blob:"===new URL(t).protocol}catch{return!1}}blobImageUrlToFile(t,n){return(0,le.A)(function*(){const a=yield(yield fetch(t)).blob();return new File([a],n,{type:a.type||"image/png"})})()}onFileUploadedOnLoad(t){t&&this.aiUploadImageService.aiUploadImage(t,{tab:this.imgQueryParams.tabName,toolName:this.imgQueryParams.toolName,from:this.queryParams.from,subTool:this.imgQueryParams.subTool,productId:this.queryString?.productId,prodImageId:this.queryString?.prodImageId,openNewTab:this.imgQueryParams.openNewTab}).then(a=>{this.imgQueryParams.imageUrl=a.imgUrl})}uploadOpenImageModal(){this.editorUiService.uploadOpenImageModal(this.imgQueryParams.tabName,"header",this.imgQueryParams)}getStoryPage(t,n=null){this.storyPageService.getStoryPageContent(t.type,x.b.pageType,t.subType,i=>{const a=i.body.storyPage;a?n&&n(a):n(null)},()=>{},"en")}}return(r=l).\u0275fac=function(t){return new(t||r)(e.rXU(y.Ix),e.rXU(ye.H),e.rXU(N.u),e.rXU(U.s),e.rXU(se.n),e.rXU(y.nX),e.rXU(y.Ix),e.rXU(K.W),e.rXU(Ne.u),e.rXU(ve.L),e.rXU(Ie.K),e.rXU(Le.A),e.rXU(G.M),e.rXU(I.g),e.rXU(k.x),e.rXU(f.Bq),e.rXU(j.f),e.rXU(v.y),e.rXU(s.qQ),e.rXU(C.f),e.rXU(M.$))},r.\u0275cmp=e.VBU({type:r,selectors:[["editor-header"]],inputs:{activeTool:"activeTool",imgUrl:"imgUrl"},outputs:{selectAllChanged:"selectAllChanged"},decls:36,vars:18,consts:[[1,"header","navbar-fixed-top","position-relative",2,"z-index","1054"],["role","banner",1,"editor-header","d-flex","align-items-center","justify-content-between","w-100","position-relative","bg-white","pl-10","pr-10",2,"height","56px"],[1,"navbar-brand-box","text-start","p-0","align-items-center",2,"display","inline-flex"],[1,"logo","link",3,"routerLink"],[1,"logo-sm"],["src","https://static.lightxeditor.com/assets/images/new-logo-editor.png","alt","Lightxeditor Logo","width","40px","height","40px"],[1,"logo-lg"],[1,"ml-10"],[1,"btn","btnGenerations","text-13","btn-h40","text-dark",3,"click"],[1,"ms-2","me-2"],["name","sapraterline"],[1,"editor-megamenu","d-flex","align-items-center","justify-content-center"],[1,"topnav"],[1,"navbar","navbar-light","navbar-expand-lg","topnav-menu","d-flex","mx-auto",2,"flex-wrap","nowrap"],["class","mx-auto",4,"ngIf"],[1,"d-block","w-100",3,"ngClass"],[1,"row","g-0"],[1,"col-12","text-center","p-0"],[1,"me-lg-0","template-search-bar-wrap","w-100","mw-100","position-relative","bg-white","border-radius-12"],[1,"template-search-main","editor-search-bar","position-relative",3,"ngOpenChange","template","isheader","searchReset","templateType","placeholder"],["class","search-div",4,"ngIf"],[1,"navbar-brand-box","text-start","p-0","align-items-center","d-flex","justify-content-center","ai-check"],[1,"ai-check-btn","d-flex","align-items-center","justify-content-center","p-2","btn-h40"],[1,"checkboxc","align-items-center","justify-content-center",3,"ngClass"],["type","checkbox",1,"marked-check","mr-9",3,"click","checked","ngClass"],["class","text-13 text-semi",4,"ngIf"],[1,"d-flex","pe-0"],["class","credit-btn-outer d-flex align-items-center justify-content-center me-2",3,"ngClass",4,"ngIf"],["class","btn btn-outline-primary btn-h40 pl-9 pr-9 d-flex align-items-center text-13 text-semi me-2","style","border: 1px solid;",3,"click",4,"ngIf"],["id","createZipButton","color","primary",1,"gtm-ai-editor-download-all","btn","btn-primary","btn-h40","pl-9","pr-9","d-flex","align-items-center","text-13","text-semi",3,"click","disabled"],["name","downloadwhite",1,"icon","f-22","me-2","pe-none"],[1,"mx-auto"],[1,"navbar-nav","w-100"],["class","dropdown-toggle nav-item text-semi dropdown mg-nav-item h-40","onmouseenter","showMenuPanel(event)","onmouseleave","hideMenuPanel(event,'leave')","routerLinkActive","activenew",3,"tabindex","id","mouseenter",4,"ngFor","ngForOf"],["onmouseenter","showMenuPanel(event)","onmouseleave","hideMenuPanel(event,'leave')","routerLinkActive","activenew",1,"dropdown-toggle","nav-item","text-semi","dropdown","mg-nav-item","h-40",3,"mouseenter","tabindex","id"],[4,"ngIf"],["id","","role","button",1,"nav-link","arrow-none"],[1,"d-flex","align-items-center","justify-content-center","grey-800"],[1,"me-1"],["name","dropdownArrowUp",1,"f-24","align-middle","arrowUp"],["class","mx-auto p-0 menu-panel dropdown-menu",3,"id",4,"ngIf"],[1,"mx-auto","p-0","menu-panel","dropdown-menu",3,"id"],[1,"inner"],[1,"navigation-right-column","p-0","d-inline-flex","m-0"],["customScrollDir","",1,"is-popover-tb","pt-3","pb-3","pe-1","scroll-container"],[1,"row","g-0","w-100"],[1,"mx-auto","swap-page","d-flex","w-100","flex-column"],["class","d-flex scroll-items w-100 order-lg-1","style","flex-wrap: wrap;",4,"ngFor","ngForOf"],[1,"d-flex","scroll-items","w-100","order-lg-1",2,"flex-wrap","wrap"],[1,"d-flex","align-items-center","justify-content-start","w-100","mb-3"],[1,"text-13","grey-800","text-semi","m-0","lh-125","mt-2"],[4,"ngFor","ngForOf"],[1,"col-12","col-md-4","col-lg-4","col-xl-3","col-xxl-3","p-0","mb-2","border-radius-lg","lh-normal"],[1,"d-inline-flex","align-items-center","justify-content-start","thumb-menu-item","pointer","p-1","me-2","border-radius-12",3,"click"],[1,"d-inline-flex","align-items-center","justify-content-center","border-radius-8","thumb-image"],[1,"border-radius-8",3,"src","alt"],[1,"d-inline-flex","align-items-start","justify-content-start","flex-column","ml-9","overflow-hidden",2,"white-space","break-spaces"],[1,"text-14","text-semi","grey-600","mb-0","lh-p3","pe-0",3,"ngClass"],[1,"search-div"],[1,"text-13","text-semi"],[1,"credit-btn-outer","d-flex","align-items-center","justify-content-center","me-2",3,"ngClass"],["src","https://static.lightxeditor.com/assets/images/coin-lottie-s-anim.gif","alt","Credit Coin","width","24px","height","24px",1,"me-2"],["class","text-semi mr-9",4,"ngIf"],["id","gtm-add-credits",1,"btn-all","border-btn-gradiant","text-13","btn-h32","border-0","border-radius-8","text-semi","pl-9","pr-9"],[1,"text-semi","mr-9"],["id","gtm-add-credits",1,"btn-all","border-btn-gradiant","text-13","btn-h32","border-0","border-radius-8","text-semi","pl-9","pr-9",3,"click"],[1,"btn","btn-outline-primary","btn-h40","pl-9","pr-9","d-flex","align-items-center","text-13","text-semi","me-2",2,"border","1p
1x solid",3,"click"]],template:function(t,n){1&t&&(e.j41(0,"nav",0)(1,"div",1)(2,"div",2)(3,"a",3)(4,"span",4),e.nrm(5,"img",5),e.k0s(),e.j41(6,"span",6),e.nrm(7,"img",5),e.k0s()(),e.j41(8,"div",7)(9,"button",8),e.bIt("click",function(){return n.goToGenerations()}),e.EFF(10,"AI Generations"),e.k0s()(),e.j41(11,"div",9),e.nrm(12,"pi",10),e.k0s(),e.j41(13,"div",11),e.qex(14),e.j41(15,"div",12)(16,"nav",13),e.DNE(17,vt,3,1,"div",14),e.k0s()(),e.bVm(),e.k0s(),e.j41(18,"div",15)(19,"div",16)(20,"div",17)(21,"div",18)(22,"app-dashboard-search",19),e.bIt("ngOpenChange",function(a){return n.onDashboardSearchOpenChange(a)})("template",function(a){return n.template(a)}),e.k0s()()()()(),e.DNE(23,It,1,0,"div",20),e.k0s(),e.j41(24,"div",21)(25,"div",22)(26,"div",23)(27,"input",24),e.bIt("click",function(){return n.markProject(n.isSelectAll)}),e.k0s(),e.DNE(28,xt,2,0,"span",25)(29,Mt,2,0,"span",25),e.k0s()()(),e.j41(30,"div",26),e.DNE(31,St,6,6,"div",27)(32,Tt,3,0,"button",28),e.j41(33,"button",29),e.bIt("click",function(){return n.downloadAll()}),e.nrm(34,"pi",30),e.EFF(35,"Download "),e.k0s()()()()),2&t&&(e.R7$(3),e.Y8G("routerLink",e.eq3(16,de,n.homeURL)),e.R7$(14),e.Y8G("ngIf",n.storyPage&&(null==n.storyPage||null==n.storyPage.sections?null:n.storyPage.sections.length)>0),e.R7$(),e.Y8G("ngClass",n.ngOpenValue?"position-absolute template-search-bar-container-active border-radius-12 bg-white":"position-relative template-search-bar-container"),e.R7$(4),e.Y8G("isheader",!0)("searchReset",n.searchReset)("templateType",n.templateTypeForSearch)("placeholder",n.searchPlaceholder),e.R7$(),e.Y8G("ngIf",n.ngOpenValue),e.R7$(3),e.Y8G("ngClass",(null==n.aiPhotoService.aiImages?null:n.aiPhotoService.aiImages.length)>1?"d-flex":"hide"),e.R7$(),e.Y8G("checked",n.isSelectAll)("ngClass",n.isDownloadDisabled||n.isSelectAll?"":"multiple-check"),e.R7$(),e.Y8G("ngIf",!n.isSelectAll),e.R7$(),e.Y8G("ngIf",n.isSelectAll),e.R7$(2),e.Y8G("ngIf",n.user),e.R7$(),e.Y8G("ngIf",!n.user),e.R7$(),e.Y8G("disabled",n.isDownloadDisabled))},dependencies:[s.YU,s.Sq,s.bT,w.q,y.Wk,y.wQ,L.b,V.G],styles:[".template-search-bar-wrap[_ngcontent-%COMP%]{min-width:240px;z-index:1;transition:width .25s ease,z-index 0s}.template-search-bar-wrap[_ngcontent-%COMP%]:focus-within{width:400px;z-index:1050;transition:width .25s ease,z-index 0s 0s}.search-div[_ngcontent-%COMP%]{min-width:240px}@media (max-width: 1099px){.template-search-bar-wrap[_ngcontent-%COMP%], .search-div[_ngcontent-%COMP%]{min-width:159px}}.project-heading[_ngcontent-%COMP%]{font-family:Inter;font-size:1.375rem;color:#111113}.btn-edit-icon[_ngcontent-%COMP%]{color:#959aa7;cursor:pointer}.btn-edit-icon[_ngcontent-%COMP%]:hover{color:#475ae7}.editMenuLinks[_ngcontent-%COMP%]{color:#626adf;display:inline-flex;cursor:pointer;align-items:center;white-space:nowrap}.projectTitle[_ngcontent-%COMP%]{margin:auto;position:relative}.projectTitle[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{height:40px;border:1px solid transparent;background:none;margin-right:6px;text-align:right;border-radius:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:5px;font-size:14px;outline:none;font-weight:600}.projectTitle[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:active, .projectTitle[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus, .projectTitle[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:hover{border:1px solid #626ADF}.header[_ngcontent-%COMP%]{background:linear-gradient(90deg,#eea8ff -4%,#83e1ff) bottom/100% 1px no-repeat;height:57px}.header[_ngcontent-%COMP%] .btnHeight[_ngcontent-%COMP%]{height:40px;align-self:center;white-space:nowrap}.btn-download[_ngcontent-%COMP%]{min-width:149px;font-size:14px!important;display:flex;align-items:center}.btn-small[_ngcontent-%COMP%]{width:40px;height:40px;padding:0;border-radius:8px;line-height:0}.complete-bg[_ngcontent-%COMP%]{background:#626adf0d;height:48px;border-radius:10px}.error-bg[_ngcontent-%COMP%]{background:#fcc;height:48px;border-radius:10px}.bg-error[_ngcontent-%COMP%]{background:#f25555!important}.complete-download[_ngcontent-%COMP%]{z-index:999;width:359px;right:20px;box-shadow:0 -2px 12px #00000026;border-radius:16px}.credit-btn-outer[_ngcontent-%COMP%]{height:40px;padding:0 4px 0 8px;border-radius:12px;background:linear-gradient(90deg,#fc5cff1a,#2520f61a)}.credit-btn-outer[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:16px;color:#626adf;line-height:24px}.credit-btn-outer[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:before{border-radius:8px!important}.btn-h32[_ngcontent-%COMP%]{height:32px;padding:0 12px}.border-btn-gradiant[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff0d,#2520f60d)!important}.border-btn-gradiant[_ngcontent-%COMP%]:hover{background:linear-gradient(90deg,#fc5cff1a,#2520f61a)!important}.show[_ngcontent-%COMP%]{display:block}.hide[_ngcontent-%COMP%]{display:none}.ai-check[_ngcontent-%COMP%] .ai-check-btn[_ngcontent-%COMP%]{border-radius:12px}.ai-check[_ngcontent-%COMP%] .ai-check-btn[_ngcontent-%COMP%]:hover{background:#626adf0d}.ai-check[_ngcontent-%COMP%] .ai-check-btn[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#606576;width:75px}.ai-check[_ngcontent-%COMP%] .ai-check-btn[_ngcontent-%COMP%] .checkboxc[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{cursor:pointer;-webkit-appearance:none;appearance:none;background-color:transparent!important;position:relative;width:24px;height:24px;border:0px solid transparent;border-radius:0!important;background:url(https://static.lightxeditor.com/assets/images/checkbox-grey.svg) no-repeat;background-size:cover!important}.ai-check[_ngcontent-%COMP%] .ai-check-btn[_ngcontent-%COMP%] .checkboxc[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:checked{background:url(https://static.lightxeditor.com/assets/images/checkbox-grey-active.svg) no-repeat!important;border:0px!important;background-size:cover!important}.ai-check[_ngcontent-%COMP%] .ai-check-btn[_ngcontent-%COMP%] .multiple-check[_ngcontent-%COMP%]{background:url(https://static.lightxeditor.com/assets/images/checkbox-grey-all.svg) no-repeat!important;background-size:cover!important}.btnGenerations[_ngcontent-%COMP%]{border-radius:12px;background:#626adf0d;border:none!important}.btnGenerations[_ngcontent-%COMP%]:hover{background:#626adf1a}
1.editor-megamenu[_ngcontent-%COMP%] .topnav[_ngcontent-%COMP%] .navbar-nav[_ngcontent-%COMP%]{width:110px!important;flex-direction:row!important}.editor-megamenu[_ngcontent-%COMP%] .topnav[_ngcontent-%COMP%] .navbar-nav[_ngcontent-%COMP%] .nav-item[_ngcontent-%COMP%]{height:40px;border-bottom:0px solid transparent;border-radius:12px 0 0 12px;background:#626adf0d;padding:8px 12px 8px 16px}.editor-megamenu[_ngcontent-%COMP%] .topnav[_ngcontent-%COMP%] .navbar-nav[_ngcontent-%COMP%] .nav-item[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{padding:0!important}.editor-megamenu[_ngcontent-%COMP%] .topnav[_ngcontent-%COMP%] .navbar-nav[_ngcontent-%COMP%] .nav-item[_ngcontent-%COMP%]:hover{background:#626adf1a}.editor-megamenu[_ngcontent-%COMP%] .dropdown-menu[_ngcontent-%COMP%] .inner[_ngcontent-%COMP%]{margin-top:16px;min-width:calc(100vw - 160px)!important}.editor-megamenu[_ngcontent-%COMP%] .dropdown-menu[_ngcontent-%COMP%] .inner[_ngcontent-%COMP%] .navigation-right-column[_ngcontent-%COMP%]{padding:16px 0 16px 16px;width:100%!important;max-height:530px;overflow:auto}.editor-megamenu[_ngcontent-%COMP%] .dropdown-menu[_ngcontent-%COMP%] .inner[_ngcontent-%COMP%] .navigation-right-column[_ngcontent-%COMP%] .thumb-menu-item[_ngcontent-%COMP%]{background:#626adf00;min-width:280px;width:calc(100% - 8px)}.editor-megamenu[_ngcontent-%COMP%] .dropdown-menu[_ngcontent-%COMP%] .inner[_ngcontent-%COMP%] .navigation-right-column[_ngcontent-%COMP%] .thumb-menu-item[_ngcontent-%COMP%] .thumb-image[_ngcontent-%COMP%]{width:60px;height:45px}.editor-megamenu[_ngcontent-%COMP%] .dropdown-menu[_ngcontent-%COMP%] .inner[_ngcontent-%COMP%] .navigation-right-column[_ngcontent-%COMP%] .thumb-menu-item[_ngcontent-%COMP%] .thumb-image[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{object-fit:cover;max-height:45px;height:100%;width:100%}.editor-megamenu[_ngcontent-%COMP%] .dropdown-menu[_ngcontent-%COMP%] .inner[_ngcontent-%COMP%] .navigation-right-column[_ngcontent-%COMP%] .thumb-menu-item[_ngcontent-%COMP%]:hover{background:#626adf0d}.editor-megamenu[_ngcontent-%COMP%] .dropdown-menu[_ngcontent-%COMP%]{left:-170px!important;min-width:auto!important}@media (min-width: 768px) and (max-width: 1280px){.editor-megamenu[_ngcontent-%COMP%] .dropdown-menu[_ngcontent-%COMP%]{left:-210px!important;min-width:auto!important}.editor-megamenu[_ngcontent-%COMP%] .dropdown-menu[_ngcontent-%COMP%] .inner[_ngcontent-%COMP%]{min-width:calc(100vw - 80px)!important}}@media (min-width: 990px) and (max-width: 1368px){.editor-megamenu[_ngcontent-%COMP%] .dropdown-menu[_ngcontent-%COMP%] .inner[_ngcontent-%COMP%] .navigation-right-column[_ngcontent-%COMP%]{overflow:auto!important;padding-left:0;padding-right:0}.editor-megamenu[_ngcontent-%COMP%] .dropdown-menu[_ngcontent-%COMP%] .inner[_ngcontent-%COMP%] .navigation-right-column[_ngcontent-%COMP%] .scroll-items[_ngcontent-%COMP%]{padding-bottom:0!important;overflow-x:hidden!important}}.new_item[_ngcontent-%COMP%]:after{top:5px!important}.swap-page[_ngcontent-%COMP%] .order-lg-1[_ngcontent-%COMP%]:nth-child(2){order:0!important}.swap-page[_ngcontent-%COMP%] .order-lg-1[_ngcontent-%COMP%]:nth-child(2) h3.mt-2[_ngcontent-%COMP%]{margin-top:0!important}.swap-page[_ngcontent-%COMP%] .order-lg-1[_ngcontent-%COMP%]:nth-child(1){order:1!important}.template-search-bar-container-active[_ngcontent-%COMP%]{max-width:400px;left:364px!important}.template-search-bar-container[_ngcontent-%COMP%]{left:1px}"]}),l})();var Qe=c(97410),Ze=c(99152),kt=c(94896),Rt=c(45975),Ut=c(11497),At=c(45944),Q=c(630),Bt=c(55697);let et=(()=>{var r;class l{constructor(t,n){this.modalService=t,this.aiPhotoService=n}openThumbPreview(t,n,i,a=!1){const d=this.modalService.open(Bt.g,{centered:!0,size:"lg",backdrop:!0,windowClass:"ai-thumb-dialog"});return d.componentInstance.url=t,d.componentInstance.index=n,d.componentInstance.aiImages1=i,d.componentInstance.aiPhotoService=this.aiPhotoService,d.componentInstance.isMyProject=a,d}}return(r=l).\u0275fac=function(t){return new(t||r)(e.KVO(f.Bq),e.KVO(U.s))},r.\u0275prov=e.jDH({token:r,factory:r.\u0275fac}),l})();var Ve=c(60004),Gt=c(31079),Ee=c(23486);const jt=r=>({showcheck:r}),tt=(r,l)=>({"image-popup":r,"dropdown-hover active-index-thumb":l}),xe=r=>({"d-none":r}),nt=r=>({show:r});function Ft(r,l){if(1&r&&(e.j41(0,"div",13)(1,"div",14)(2,"div",15),e.nrm(3,"app-ai-processing-bar",16),e.k0s()(),e.j41(4,"div",17)(5,"div",18),e.nrm(6,"div",19)(7,"div",20)(8,"div",21),e.k0s()()()),2&r){const o=e.XpG(3);e.xc7("margin",12,"px"),e.R7$(2),e.xc7("top","calc(50% - 39px)"),e.R7$(),e.Y8G("progress",o.processingProgress.progressPercent)("message",o.processingProgress.isActive?o.processingProgress.progressMessage:o.GlobalConstants.label.generatingImage)("indeterminate",!o.processingProgress.isActive||o.processingProgress.indeterminate)}}function Nt(r,l){if(1&r&&(e.j41(0,"div",13)(1,"div",14)(2,"div",15),e.nrm(3,"app-ai-processing-bar",16),e.k0s()(),e.j41(4,"div",17)(5,"div",18),e.nrm(6,"div",19)(7,"div",20)(8,"div",21),e.k0s()()()),2&r){const o=e.XpG(3);e.xc7("margin",12,"px"),e.R7$(2),e.xc7("top","calc(50% - 39px)"),e.R7$(),e.Y8G("progress",o.processingProgress.progressPercent)("message",o.processingProgress.isActive?o.processingProgress.progressMessage:o.GlobalConstants.label.generatingVideo)("indeterminate",!o.processingProgress.isActive||o.processingProgress.indeterminate)}}function Lt(r,l){if(1&r&&(e.qex(0),e.DNE(1,Ft,9,7,"div",12)(2,Nt,9,7,"div",12),e.bVm()),2&r){const o=e.XpG(2);e.R7$(),e.Y8G("ngIf",o.aiPhotoService.inProgress&&!o.processingProgress.fullscreen),e.R7$(),e.Y8G("ngIf",o.aiPhotoService.inVideoProgress)}}function Wt(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",38)(1,"input",39),e.bIt("click",function(){e.eBV(o);const n=e.XpG(3),i=n.$implicit,a=n.index,d=e.XpG(2);return e.Njj(d.markProject(i,a))}),e.k0s()()}if(2&r){const o=e.XpG(3).$implicit;e.Y8G("ngClass",e.eq3(2,nt,null==o?null:o.checked)),e.R7$(),e.Y8G("checked",null==o?null:o.checked)}}function Vt(r,l){1&r&&(e.j41(0,"button",62),e.nrm(1,"pi",63),e.k0s())}function Xt(r,l){if(1&r){const o=e.RV6();e.j41(0,"a",58),e.bIt("click",function(){e.eBV(o);const n=e.XpG(4).$implicit,i=e.XpG(2);return e.Njj(i.download(n))}),e.nrm(1,"pi",64),e.EFF(2,"Download "),e.k0s()}}function Kt(r,l){if(1&r){const o=e.RV6();e.j41(0,"a",58),e.bIt("click",function(){e.eBV(o);const n=e.XpG(4).$implicit,i=e.XpG(2);return e.Njj(i.resetAsInputImage(n))}),e.nrm(1,"pi",65),e.EFF(2,"Use as Input Image "),e.k0s()}}function $t(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",40)(1,"div",41,3),e.bIt("openChange",function(n){e.eBV(o);const i=e.sdS(2),a=e.XpG(3).index,d=e.XpG(2);return e.Njj(d.openChange1(n,i,a))}),e.j41(3,"div",42)(4,"button",43),e.nrm(5,"pi",44),e.k0s(),e.j41(6,"div",45)(7,"ul")(8,"li")(9,"ai-upscale-image",46),e.bIt("UpscaleImage",function(n){e.eBV(o);const i=e.sdS(2),a=e.XpG(5);return e.Njj(a.selectUpscaleImage(n,i))}),e.k0s()()()()(),e.j41(10,"div",47)(11,"button",48),e.bIt("click",function(){e.eBV(o);const n=e.XpG(3).$implicit,i=e.XpG(2);return e.Njj(i.animateImage(n))}),e.nrm(12,"pi",29),e.k0s()()(),e.j41(13,"div",49)(14,"button",50),e.bIt("click",function(){e.eBV(o);const n=e.XpG(3).$implicit,i=e.XpG(2);return e.Njj(i.openInsprrationsEditDialog(n))}),e.nrm(15,"pi",51),e.k0s()(),e.j41(16,"div",52,4),e.bIt("openChange",function(n){e.eBV(o);const i=e.sdS(17),a=e.XpG(3).index,d=e.XpG(2);return e.Njj(d.openChange(n,i,a))}),e.DNE(18,Vt,2,0,"button",53),e.j41(19,"div",54)(20,"ul",55)(21,"li",56),e.DNE(22,Xt,3,0,"a",57),e.k0s(),e.j41(23,"li"),e.DNE(24,Kt,3,0,"a",57),e.k0s(),e.j41(25,"li")(26,"a",58),e.bIt("click",function(n){e.eBV(o);const i=e.XpG(3),a=i.$implicit,d=i.index,g=e.XpG(2);return e.Njj(g.openThumbPreview(a.url,d,n))}),e.nrm(27,"ei",59),e.EFF(28,"More Tools "),e.k0s()(),e.j41(29,"li")(30,"a",58),e.bIt("click",function(){e.eBV(o);const n=e.XpG(3),i=n.$implicit,a=n.index,d=e.XpG(2);return e.Njj(d.reportabuse(i,a))}),e.nrm(31,"pi",60),e.EFF(32,"Report "),e.k0s()(),e.j41(33,"li")(34,"a",58),e.bIt("click",function(){e.eBV(o);const n=e.XpG(3).index,i=e.XpG(2);return e.Njj(i.delete(n))}),e.nrm(35,"ei",61),e.EFF(36,"Delete "),e.k0s()()()()()()}if(2&r){const o=e.XpG(3).$implicit,t=e.XpG(2);e.R7$(3),e.Y8G("ngClass",e.eq3(6,xe,!(null!=o&&o.upscale))),e.R7$(6),e.Y8G("activeUpcaleImage",t.activeUpcaleImage),e.R7$(4),e.Y8G("ngClass",e.eq3(8,xe,o.upscale)),e.R7$(5),e.Y8G("ngIf",!o.checked),e.R7$(4),e.Y8G("ngIf",!o.checked),e.R7$(2),e.Y8G("ngIf",!o.checked)}}function Yt(r,l){if(1&r&&(e.j41(0,"div",66)(1,"div",67),e.EFF(2),e.k0s()()),2&r){const o=e.XpG(3).$implicit;e.R7$(2),e.SpI(" ",o.upscale,"X ")}}function zt(r,l){if(1&r&&(e.j41(0,"p",68),e.EFF(1),e.k0s()),2&r){const o=e.XpG(3).$implicit;e.R7$(),e.JRh(null==o?null:o.prompt)}}function qt(r,l){if(1&r&&(e.j41(0,"div",69)(1,"div",67),e.EFF(2),e.k0s()()),2&r){const o=e.XpG(3).$implicit;e.R7$(2),e.SpI(" ",o.upscale,"X ")}}function Ht(r,l){if(1&r){const o=e.RV6();e.qex(0),e.j41(1,"div",22,2),e.bIt("mouseleave",function(){e.eBV(o);const n=e.XpG(4);return e.Njj(n.onHover())})("click",function(){e.eBV(o);const n=e.XpG(2).index,i=e.XpG(2);return e.Njj(i.imageOnClick(n))}),e.DNE(3,Wt,2,4,"div",23),e.j41(4,"div",24),e.bIt("click",function(){e.eBV(o);const n=e.XpG(2),i=n.$implicit,a=n.index,d=e.XpG(2);return e.Njj(d.openThumbPreview(i.url,a))}),e.j41(5,"div",25),e.nrm(6,"img",26),e.k0s()(),e.j41(7,"div",27)(8,"button",28),e.nrm(9,"pi",29),e.k0s()(),e.DNE(10,$t,37,10,"div",30),e.j41(11,"div",31)(12,"div",32)(13,"div",33)(14,"span",34),e.EFF(15),e.k0s(),e.DNE(16,Yt,3,1,"div",35),e.k0s(),e.DNE(17,zt,2,1,"p",36),e.k0s()(),e.DNE(18,qt,3,1,"div",37),e.k0s(),e.bVm()}if(2&r){const o=e.XpG(2),t=o.$implicit,n=o.index,i=e.XpG(2);e.R7$(),e.xc7("margin",12,"px"),e.Y8G("ngClass",e.l_i(11,tt,1==i.isDropDownOpen,1==i.isDropDownOpen&&i.activeImageIndex==n||1==i.isDropDownOpen1&&i.activeImageIndex==n)),e.R7$(2),e.Y8G("ngIf",i.aiPhotoService.aiImages.length>1),e.R7$(3),e.Y8G("src",t.url,e.B4B),e.R7$(),e.Y8G("ngClass",e.eq3(14,xe,t.upscale)),e.R7$(3),e.Y8G("ngIf",!t.checked),e.R7$(5),e.JRh(null==t?null:t.toolName),e.R7$(),e.Y8G("ngIf",t.upscale&&t.upscale>1),e.R7$(),e.Y8G("ngIf",null==t?null:t.prompt),e.R7$(),e.Y8G("ngIf",t.upscale&&t.upscale>1)}}function Jt(r,l){if(1&r&&(e.qex(0),e.DNE(1,Ht,19,16,"ng-container",10),e.bVm()),2&r){const o=e.XpG().$implicit;e.R7$(),e.Y8G("ngIf",o)}}function Qt(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",38)(1,"input",39),e.bIt("click",function(){e.eBV(o);const n=e.XpG(3),i=n.$implicit,a=n.index,d=e.XpG(2);return e.Njj(d.markProject(i,a))}),e.k0s()()}if(2&r){const o=e.XpG(3).$implicit;e.Y8G("ngClass",e.eq3(2,nt,null==o?null:o.checked)),e.R7$(),e.Y8G("checked",null==o?null:o.checked)}}function Zt(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",87),e.bIt("click",function(n){e.eBV(o);const i=e.XpG(3),a=i.$implicit,d=i.index,g=e.XpG(2);return e.Njj(g.openThumbPreview(a.url,d,n))}),e.j41(1,"video",88),e.bIt("ended",function(){e.eBV(o);const n=e.XpG(3).$implicit,i=e.XpG(2);return e.Njj(i.endVideo(n))}),e.nrm(2,"source",89),e.k0s()()}if(2&r){const o=e.XpG(3).$implicit;e.R7$(),e.FS9("id",o.assetId),e.Y8G("muted","muted"),e.R7$(),e.Y8G("src",o.url,e.B4B)}}function en(r,l){if(1&r){const o=e.RV6();e.j41(0,"a",90),e.bIt("click",function(n){e.eBV(o);const i=e.XpG(3).$implicit,a=e.XpG(2);return e.Njj(a.playVideo(i,n))}),e.nrm(1,"pi",91),e.k0s()}}function tn(r,l){if(1&r&&(e.j41(0,"span",92),e.EFF(1),e.k0s()),2&r){const o=e.XpG(3).$implicit;e.R7$(),e.SpI("",(null==o?null:o.duration)||("aifaceanimate"===(null==o?null:o.featureType)?4:(null==o?null:o.videoDuration)||5),"s")}}function nn(r,l){if(1&r){const o=e.RV6();e.j41(0,"button",93),e.bIt("click",function(){e.eBV(o);const n=e.XpG(3).$implicit,i=e.XpG(2);return e.Njj(i.download(n))}),e.nrm(1,"pi",94),e.k0s()}}function on(r,l){1&r&&(e.j41(0,"button",95),e.nrm(1,"pi",63),e.k0s())}function rn(r,l){if(1&r){const o=e.RV6();e.qex(0),e.j41(1,"div",70,2),e.bIt("mouseleave",function(){e.eBV(o);const n=e.XpG(4);return e.Njj(n.onHover())})("mouseenter",function(n){e.eBV(o);const i=e.XpG(2).$implicit,a=e.XpG(2);return e.Njj(a.playVideo(i,n))})("click",function(){e.eBV(o);const n=e.XpG(2).index,i=e.XpG(2);return e.Njj(i.imageOnClick(n))}),e.DNE(3,Qt,2,4,"div",23),e.j41(4,"div",24),e.bIt("click",function(n){e.eBV(o);const i=e.XpG(2),a=i.$implicit,d=i.index,g=e.XpG(2);return e.Njj(g.openThumbPreview(a.url,d,n))}),e.j41(5,"div",25),e.nrm(6,"img",26),e.k0s()(),e.DNE(7,Zt,3,3,"div",71),e.j41(8,"div",72)(9,"div",73),e.DNE(10,en,2,0,"a",74),e.k0s()(),e.j41(11,"div",75),e.DNE(12,tn,2,1,"span",76),e.k0s(),e.j41(13,"div",77,4),e.bIt("openChange",function(n){e.eBV(o);const i=e.sdS(14),a=e.XpG(2).index,d=e.XpG(2);return e.Njj(d.openChange(n,i,a))}),e.j41(15,"div",78),e.nrm(16,"div",79),e.k0s(),e.DNE(17,nn,2,0,"button",8
10)(18,on,2,0,"button",81),e.j41(19,"div",82)(20,"ul",55)(21,"li")(22,"a",58),e.bIt("click",function(){e.eBV(o);const n=e.XpG(2).$implicit,i=e.XpG(2);return e.Njj(i.loadInputVideo(n.url))}),e.nrm(23,"pi",83),e.EFF(24,"Open in Video Editor "),e.k0s()(),e.j41(25,"li")(26,"a",58),e.bIt("click",function(){e.eBV(o);const n=e.XpG(2),i=n.$implicit,a=n.index,d=e.XpG(2);return e.Njj(d.reportabuse(i,a))}),e.nrm(27,"pi",84),e.EFF(28,"Report "),e.k0s()(),e.j41(29,"li")(30,"a",58),e.bIt("click",function(){e.eBV(o);const n=e.XpG(2).index,i=e.XpG(2);return e.Njj(i.delete(n))}),e.nrm(31,"pi",85),e.EFF(32,"Delete "),e.k0s()()()()(),e.j41(33,"div",31)(34,"div",32)(35,"span",86),e.EFF(36),e.k0s(),e.j41(37,"p",68),e.EFF(38),e.k0s()()()(),e.bVm()}if(2&r){const o=e.XpG(2),t=o.$implicit,n=o.index,i=e.XpG(2);e.R7$(),e.xc7("margin",12,"px"),e.Y8G("ngClass",e.l_i(14,tt,1==i.isDropDownOpen,1==i.isDropDownOpen&&i.activeImageIndex==n)),e.R7$(2),e.Y8G("ngIf",i.aiPhotoService.aiImages.length>1),e.R7$(3),e.Y8G("src",t.thumbUrl,e.B4B),e.R7$(),e.Y8G("ngIf",t.isPlay),e.R7$(),e.Y8G("ngClass",e.eq3(17,xe,i.showcheckAiImages)),e.R7$(2),e.Y8G("ngIf",!t.isPlay),e.R7$(),e.Y8G("ngClass",e.eq3(19,xe,i.showcheckAiImages)),e.R7$(),e.Y8G("ngIf",!t.isPlay),e.R7$(5),e.Y8G("ngIf",!t.checked),e.R7$(),e.Y8G("ngIf",!t.checked),e.R7$(18),e.JRh(null==t?null:t.toolName),e.R7$(2),e.JRh(null==t?null:t.prompt)}}function sn(r,l){if(1&r&&(e.qex(0),e.DNE(1,rn,39,21,"ng-container",10),e.bVm()),2&r){const o=e.XpG().$implicit;e.R7$(),e.Y8G("ngIf",o)}}function an(r,l){if(1&r&&(e.qex(0),e.DNE(1,Jt,2,1,"ng-container",10)(2,sn,2,1,"ng-container",10),e.bVm()),2&r){const o=l.$implicit;e.R7$(),e.Y8G("ngIf",!(null!=o&&o.isVideo)),e.R7$(),e.Y8G("ngIf",null==o?null:o.isVideo)}}function cn(r,l){if(1&r&&(e.j41(0,"div",6,1),e.nrm(2,"input",7),e.j41(3,"div",8)(4,"div",9),e.DNE(5,Lt,3,2,"ng-container",10)(6,an,3,2,"ng-container",11),e.k0s()()()),2&r){let o;const t=e.XpG();e.R7$(2),e.FS9("value",null!=(o=t.getCheckedItems())&&o.length?(null==(o=t.getCheckedItems())?null:o.length)+"_Images":"1_Images"),e.R7$(),e.Y8G("ngClass",e.eq3(6,jt,t.showcheckAiImages)),e.R7$(),e.xc7("--row-height",t.minThumbHeight,"px"),e.R7$(),e.Y8G("ngIf",t.activeToolPanel),e.R7$(),e.Y8G("ngForOf",t.aiPhotoService.aiImages)}}function ln(r,l){if(1&r){const o=e.RV6();e.j41(0,"ai-upscale-image",46),e.bIt("UpscaleImage",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.selectUpscaleImage(n))}),e.k0s()}if(2&r){const o=e.XpG();e.Y8G("activeUpcaleImage",o.activeUpcaleImage)}}let dn=(()=>{var r;class l{constructor(t,n,i,a,d,g,m,b,O,E,Y,q,_e,ge,z){this.activeModal=t,this.aiPhotoService=n,this.processingProgress=i,this.router=a,this.uploadService=d,this.uploadVideoService=g,this.videoRepository=m,this.toast=b,this.createPopupService=O,this.gtmService=E,this.authService=Y,this.modalService=q,this.aiPhotoCommonService=_e,this.aiUpscaleService=ge,this.toastService=z,this.GlobalConstants=x.b,this.oImgWidth=512,this.oImgHeight=512,this.selectAllChanged=new e.bkB,this.downloadAllDisabled=new e.bkB,this.genAsInputImageEvent=new e.bkB,this.changeToolName=new e.bkB,this.minThumbHeight=250,this.activeImageIndex=-1,this.isDropDownOpen=!1,this.isDropDownOpen1=!1,this.isSubmenuOpen=!1,this.user=this.authService.currentUser(),this.user&&this.authService.updateUserAiConis("loggedIn")}ngOnInit(){var t=this;this.aiPhotoService.generateImageFn=function(){var i=(0,le.A)(function*(a,d){d&&d?.width&&d?.height&&(t.oImgWidth=d.width,t.oImgHeight=d.height)});return function(a,d){return i.apply(this,arguments)}}(),window.innerWidth<1340&&(this.minThumbHeight=200)}resetAsInputImage(t){this.genAsInputImageEvent.emit(t),this.aiPhotoService.selectedTool==h.Fs.SketchToImage&&this.aiPhotoService.uploadImageFn(t)}openThumbPreview(t,n,i=null){i&&i.preventDefault(),this.stopVideoPlay(),0==this.aiPhotoService.aiImages.filter(d=>1==d?.checked).length&&this.aiPhotoCommonService.openThumbPreview(t,n,this.aiPhotoService.aiImages).result.then(g=>{"1"==g.value?this.resetAsInputImage(g.img):"2"==g.value?this.loadBgInputImage(g.img.imgUrl):"3"==g.value?g?.img?.isVideo?this.saveToUploadVideo(g.img.url):this.saveToUpload(g.img.url):"4"==g.value?this.loadBgInputImage(g.img.imgUrl,6):"6"==g.value?this.loadInputVideo(g.img.url):"7"==g.value?this.loadBgInputImage(g.img.url,7):"8"==g.value?this.loadBgInputImage(g.img.url,8):"9"==g.value?this.loadBgInputImage(g.img.url,9):"10"==g.value?this.loadBgInputImage(g.img.url,10):"11"==g.value?this.loadBgInputImage(g.img.url,11):"12"==g.value?this.loadBgInputImage(g.img.url,12):g?.scaleValue>0&&g?.activeImage&&(this.activeUpcaleImage=JSON.parse(JSON.stringify(g?.activeImage)),this.selectUpscaleImage(g?.scaleValue))})}saveToUpload(t){var n=this;return(0,le.A)(function*(){const i=new Image;yield new Promise(a=>{i.onload=a,i.src=t,i.crossOrigin="anonymous"}).then(()=>{n.convertImageToFile(i,"imageuplod").then(a=>{n.uploadService.addImageFile(a,i,d=>{d.status&&n.activeModal.close()})})})})()}saveToUploadVideo(t){var n=this;return(0,le.A)(function*(){n.videoRepository.getVideoBlobUrl(t).promise.then(i=>{const a=n.videoRepository.getVideoURLFile(t),d=new File([a],"untiled.mp4",{type:"video/mp4"});n.uploadService.addVideoFile(d,g=>{g.status&&n.activeModal.close()})})})()}convertImageToFile(t,n){return new Promise(i=>{const a=document.createElement("canvas"),d=a.getContext("2d");a.width=t.width,a.height=t.height,d&&(d.drawImage(t,0,0,t.width,t.height),a.toBlob(g=>
1{if(g){const m=new File([g],n,{type:g.type});i(m)}}))})}loadBgInputImage(t){var n=this;return(0,le.A)(function*(i,a=0){let d;const g=new Image;yield new Promise(m=>{g.onload=m,g.src=i}).then(()=>{let m=g.width,b=g.height;d=6==a?n.router.createUrlTree(["edit-tools/edit"],{queryParams:{tab:"remove_bg",subTool:"",img:g.src,w:m,h:b,action:"default_project",social_platform_id:0,targetPage:"",edType:"3"}}):7==a?n.router.createUrlTree(["design-editor/edit"],{queryParams:{tab:"text",subTool:"",img:g.src,w:m,h:b,action:"default_project",social_platform_id:26,targetPage:"",edType:"1"}}):8==a?n.router.createUrlTree(["edit-tools/edit"],{queryParams:{tab:"aitools",subTool:"eraser",img:g.src,w:m,h:b,action:"default_project",social_platform_id:0,targetPage:"",edType:"3"}}):9==a?n.router.createUrlTree(["edit-tools/edit"],{queryParams:{tab:"aitools",subTool:"expand",img:g.src,w:m,h:b,action:"default_project",social_platform_id:0,targetPage:"",edType:"3"}}):10==a?n.router.createUrlTree(["ai-photo-editor/edit"],{queryParams:{tab:"video-tools",toolName:"image2video",subTool:"image",imgUrl:g.src,o_img:g.src,w:m,h:b,action:"default_project",social_platform_id:0,targetPage:"",edType:"4"}}):n.router.createUrlTree(["edit-tools/edit"],11==a?{queryParams:{tab:"aitools",subTool:"changecameraangle",img:g.src,w:m,h:b,action:"default_project",social_platform_id:0,targetPage:"",edType:"3"}}:12==a?{queryParams:{tab:"aitools",subTool:"changelighting",img:g.src,w:m,h:b,action:"default_project",social_platform_id:0,targetPage:"",edType:"3"}}:{queryParams:{tab:"adjustment",subTool:"",img:g.src,w:m,h:b,action:"default_project",social_platform_id:0,targetPage:"",edType:"3"}});let O=me.c.siteUrl+n.router.serializeUrl(d);window.open(O,"_blank")})}).apply(this,arguments)}delete(t){t>-1&&this.aiPhotoService.aiImages.splice(t,1),0==this.aiPhotoService.aiImages.length&&(this.aiPhotoService.isDirty=!1)}download(t){this.aiPhotoService.download(t)}onHover(){this.stopVideoPlay()}openChange(t,n,i){n.isOpen()?this.isDropDownOpen=!0:i==this.activeImageIndex&&(this.isDropDownOpen=!1)}openChange1(t,n,i){n.isOpen()?(this.checkPopover(i),this.isDropDownOpen1=!0):i==this.activeImageIndex&&(this.isDropDownOpen1=!1)}imageOnClick(t){this.activeImageIndex=t}markProject(t,n){this.activeImageIndex=-1,this.stopVideoPlay(),t&&t.checked?this.aiPhotoService.aiImages[n].checked=!1:(this.aiPhotoService.aiImages[n].checked=!0,this.aiPhotoService.aiImages.length>1&&this.downloadAllDisabled.emit(!1)),this.showcheckAiImages=this.aiPhotoService.aiImages.filter(d=>1==d?.checked).length>0;var a=this.aiPhotoService.aiImages.filter(d=>!0!==d?.checked);a.length>0?(this.selectAllChanged.emit(!1),a.length===this.aiPhotoService.aiImages.length&&this.downloadAllDisabled.emit(!0)):(this.selectAllChanged.emit(!0),this.aiPhotoService.aiImages.length>1&&this.downloadAllDisabled.emit(!1))}copyTextToClipboard(t){const n=document.createRange(),i=window.getSelection(),a=document.createElement("span");a.textContent=t,document.body.appendChild(a),n.selectNode(a),i?.removeAllRanges(),i?.addRange(n),document.execCommand("copy"),document.body.removeChild(a),i?.removeAllRanges()}playVideo(t,n){n.preventDefault(),t.isPlay?(t.isPlay=!1,t.currentTime=0,this.lastPlayedVideo&&(this.lastPlayedVideo.isPlay=!1)):(this.lastPlayedVideo&&(this.lastPlayedVideo.isPlay=!1),t.isPlay=!0,this.lastPlayedVideo=t,t.currentTime=0)}endVideo(t){t.isPlay=!1,t.currentTime=0}loadInputVideo(t){this.uploadVideoService.loadInputVideoToNewTab(t)}stopVideoPlay(){this.lastPlayedVideo&&(this.lastPlayedVideo.isPlay=!1,this.lastPlayedVideo.currentTime=0)}checkPopover(t){this.activeUpcaleImage=JSON.parse(JSON.stringify(this.aiPhotoService.aiImages[t]))}selectUpscaleImage(t,n=null){n&&n.isOpen()&&(n.close(),this.isDropDownOpen1=!1,this.isDropDownOpen=!1),this.activeImageIndex=-1,this.activeUpcaleImage&&(this.activeUpcaleImage.upscale=this.activeUpcaleImage.upscale?this.activeUpcaleImage.upscale+t:0+t,this.generateUpscale(t))}generateUpscale(t){if(this.user=this.authService.currentUser(),this.aiPhotoService.isCancel)this.toast.showErrorSingle(x.b.message.uploadNewImage);else if(this.activeUpcaleImage){if(this.aiPhotoService.inProgress)return;const n=this.getUpscaleOptionId(t),i=Number(this.activeUpcaleImage?.
1width)||0,a=Number(this.activeUpcaleImage?.height)||0;if(i>0&&a>0){const g=this.aiUpscaleService.validateDimensions(i,a,n);if(!g.isValid)return void this.displayErrorMsg({description:g.errorMsg})}const d=this.aiUpscaleService.getRequiredCredits(n);if(this.user&&this.aiUpscaleService.hasEnoughCredits(this.user.remainingCoins,n)){const g=this.aiUpscaleService.buildGeneratePayload(this.activeUpcaleImage.imgUrl,n);if(!g)return void(this.aiPhotoService.inProgress=!1);this.aiPhotoService.inProgress=!0,this.aiPhotoService.generateImage(g,m=>{m&&m.assetId?(this.activeUpcaleImage.assetId=m.assetId,this.aiPhotoService.checkStatus(m=this.activeUpcaleImage,0,O=>{O&&O.urls&&O.urls.length>0&&(this.user.remainingCoins=O.remainingCalls,this.aiPhotoService.isDirty=!0),this.aiPhotoService.inProgress=!1},O=>{this.displayErrorMsg(O)})):this.displayErrorMsg(m)},m=>{this.displayErrorMsg(m)})}else this.aiPhotoService.openAICreditPopup(()=>{this.user=this.authService.currentUser(),this.generateUpscale(t)},d)}}displayErrorMsg(t=null){this.aiPhotoService.inProgress=!1;let n=t?.description;this.createPopupService.openWarningDialog("Error",n)}getUpscaleOptionId(t){return t>=4?"4x":"2x"}getCheckedItems(){return this.aiPhotoService.aiImages.filter(t=>1==t?.checked)}openInsprrationsEditDialog(t){this.gtmService.pushTag({eventName:x.b.gtm.eventname.aiRemixClick,itemName:"Generated Images",itemType:t?.toolName});const i=this.modalService.open(Qe.h,{centered:!0,size:"xxl",backdrop:"static",windowClass:"ai-design-editor-dialog"});this.aiPhotoService.isCompareEnable=!1,this.aiPhotoService.inspirationImgUrl=t.imgUrl,this.aiPhotoService.compareImageUrl=t.imgUrl,i.componentInstance.activeImgObj=t,i.componentInstance.activeTool=h.Fs.AiDesign,i.componentInstance.aiPhotoService=this.aiPhotoService,i.result.then(a=>{})}toggleSubmenu(t,n){t.stopPropagation(),this.isSubmenuOpen=!this.isSubmenuOpen,this.checkPopover(n)}onDocumentClick(t){t.target.closest(".dropdown-submenu")||(this.isSubmenuOpen=!1)}animateImage(t){const n=t?.url;n&&this.loadBgInputImage(n,10)}reportabuse(t,n){const i=this.modalService.open(kt.e,{centered:!0,size:"lg",backdrop:"static",windowClass:"report-abuse-dialog"});i.componentInstance.item=t,i.result.then(a=>{if(a){const d=this.aiPhotoService.aiImages;n>-1&&d.splice(n,1),0==d.length&&(this.aiPhotoService.isDirty=!1),this.toastService.showSuccess("Report submitted successfully")}},()=>{})}}return(r=l).\u0275fac=function(t){return new(t||r)(e.rXU(f.Lw),e.rXU(U.s),e.rXU(fe.M),e.rXU(y.Ix),e.rXU(Rt.B),e.rXU(Ut.k),e.rXU(At.I),e.rXU(C.f),e.rXU(Q.A),e.rXU(v.y),e.rXU(N.u),e.rXU(f.Bq),e.rXU(et),e.rXU(Ze.D),e.rXU(C.f))},r.\u0275cmp=e.VBU({type:r,selectors:[["portrait-gen-image"]],hostBindings:function(t,n){1&t&&e.bIt("click",function(a){return n.onDocumentClick(a)},!1,e.EBC)},inputs:{aiImages:"aiImages",activeToolPanel:"activeToolPanel"},outputs:{selectAllChanged:"selectAllChanged",downloadAllDisabled:"downloadAllDisabled",genAsInputImageEvent:"genAsInputImageEvent",changeToolName:"changeToolName"},features:[e.Jv_([Ze.D])],decls:3,vars:1,consts:[["popContentUpscaleImage",""],["page",""],["imageDiv",""],["myDrop1","ngbDropdown"],["myDrop","ngbDropdown"],["style","display: inline-block;","class","ai-thumb-genrated-col justify-content-center w-100","disableRC","",4,"ngIf"],["disableRC","",1,"ai-thumb-genrated-col","justify-content-center","w-100",2,"display","inline-block"],["type","hidden","id","gtm-ai-checked-images",1,"d-none",3,"value"],[1,"ai-thumb-genrated-list","justify-content-start",3,"ngClass"],[1,"templates-thumbs-list","ai-thumb-genrated-list","d-flex","justify-content-start",2,"margin","0px"],[4,"ngIf"],[4,"ngFor","ngForOf"],["class","img-div ai-thumb-genrated-item progress-col-item d-flex justify-content-center align-items-center flex-column img-format-2 not-hov circle-animation",3,"margin",4,"ngIf"],[1,"img-div","ai-thumb-genrated-item","progress-col-item","d-flex","justify-content-center","align-items-center","flex-column","img-format-2","not-hov","circle-animation"],[1,"c-img","d-flex","justify-content-center","align-items-center",2,"height","var(--row-height)"],[1,"progress-col","text-center","custom-image-main","position-absolute","ps-2","pe-2"],["size","sm",3,"progress","message","indeterminate"],[1,"canvas"],[1,"aurora-bg"],[1,"blob","blob-1"],[1,"blob","blob-2"],[1,"blob","blob-3"],[1,"img-div","thumb-options","img-format-2",3,"mouseleave","click","ngClass"],["class","checkboxc","style","left: 12px; top: 12px;",3,"ngClass",4,"ngIf"],[1,"c-img",2,"height","var(--row-height)",3,"click"],[1,"custom-image-main"],["loading","lazy",1,"image","template__img",2,"opacity","1","height","100%","object-fit","contain","overflow","hidden",3,"src"],[1,"hw-32","position-absolute",2,"top","12px","right","12px",3,"ngClass"],["placement","top","ngbTooltip","Animate","id","animatebtn",1,"btn-icon-remix","outer","d-flex","align-items-center","justify-content-center"],["name","animate",1,"f-24"],["class","cta-action-top d-flex",4,"ngIf"],[1,"cta-action-bottom"],[1,"gen-item-description","w-100","pt-9","pl-9","pr-9","pb-2"],[1,"d-flex","align-items-center","justify-content-start","mb-2"],[1,"tool-name","text-semi"],["class","upsacle-badge d-inline-flex ms-2",4,"ngIf"],["class","prompt-text",4,"ngIf"],["class","upsacle-badge position-absolute d-flex align-items-center justify-content-center",4,"ngIf"],[1,"checkboxc",2,"left","12px","top","12px",3,"ngClass"],["type","checkbox",1,"marked-check",3,"click","checked"],[1,"cta-action-top","d-flex"],["ngbDropdown","",1,"position-relative","me-2","d-flex","flex-row-reverse",3,"openChange"],[1,"hw-32","ms-2",3,"ngClass"],["ngbDropdownToggle","","id","dropdownBasic1010","placement","top","ngbTooltip","Upscale","tooltipClass","custom-tooltip",1,"btn-icon-grey","d-flex","align-items-center","justify-content-center"],["name","upscale",1,"f-24"],["ngbDropdownMenu","","aria-labelledby","dropdownBasic1010",1,"nav-small-device","upscale-drop","upscale-drop-1"],[3,"UpscaleImage","activeUpcaleImage"],[1,"hw-32"],["placement","top","ngbTooltip","Animate","tooltipClass","custom-tooltip",1,"btn-icon-remix","d-flex","align-items-center","justify-content-center",3,"click"],[3,"ngClass"],["placement","top","ngbTooltip","Change with AI","id","remixbtn","tooltipClass","custom-tooltip",1,"btn-icon-grey","me-2","d-flex","align-items-center","justify-content-center",3,"click"],["name","remixbutton",1,"f-24"],["ngbDropdown","",3,"openChange"],["class","btn-icon-grey d-flex align-items-center justify-content-center","placement","top","ngbTooltip","More options","i
1d","dropdownBasic111","tooltipClass","custom-tooltip","ngbDropdownToggle","",4,"ngIf"],["ngbDropdownMenu","","aria-labelledby","dropdownBasic111",1,"nav-small-device","upscale-drop"],[1,"list-unstyled"],["id","gtm-ai-single-download"],["ngbDropdownItem","",3,"click",4,"ngIf"],["ngbDropdownItem","",3,"click"],["name","addplus",1,"mr-9","f-16"],["name","reportabuse",1,"mr-9","f-16"],["name","delete16",1,"mr-9","f-16"],["placement","top","ngbTooltip","More options","id","dropdownBasic111","tooltipClass","custom-tooltip","ngbDropdownToggle","",1,"btn-icon-grey","d-flex","align-items-center","justify-content-center"],["name","dotverticalwhite",1,"f-24"],["name","downloadblack",1,"mr-9","f-16"],["name","imageshuffle",1,"mr-9","f-16"],[1,"upsacle-badge","d-inline-flex","ms-2"],[1,"scale-badge","d-flex","align-items-center","justify-content-center","text-semi"],[1,"prompt-text"],[1,"upsacle-badge","position-absolute","d-flex","align-items-center","justify-content-center"],[1,"img-div","thumb-options","img-format-2",3,"mouseleave","mouseenter","click","ngClass"],["class","border-radius-lg","style","position: absolute;width: 100%;height: 100%; top: 0;",3,"click",4,"ngIf"],[1,"meta","justify-content-center","align-items-center","v-thumb-ico","position-absolute",2,"bottom","12px","left","12px",3,"ngClass"],[2,"cursor","pointer"],[3,"click",4,"ngIf"],[1,"meta","justify-content-center","align-items-center","v-thumb-ico","position-absolute",2,"bottom","12px","right","12px",3,"ngClass"],["class","duration-text f-13 text-white",4,"ngIf"],["ngbDropdown","",1,"cta-action-top","d-flex",3,"openChange"],[1,"position-relative"],[1,"hw-40"],["class","btn-icon-grey me-2 d-flex align-items-center justify-content-center","placement","top","ngbTooltip","Download",3,"click",4,"ngIf"],["class","btn-icon-grey d-flex align-items-center justify-content-center","placement","top","ngbTooltip","More options","id","dropdownBasic111","ngbDropdownToggle","",4,"ngIf"],["ngbDropdownMenu","","aria-labelledby","dropdownBasic111",1,"nav-small-device"],["name","videoedit",1,"me-2","f-20"],["name","reportabuse",1,"mr-8","f-20"],["name","deleteoth",1,"me-2","f-20"],[1,"tool-name","text-semi","mb-2"],[1,"border-radius-lg",2,"position","absolute","width","100%","height","100%","top","0",3,"click"],["width","100%","height","100%","autoplay","autoplay","disableRC","",1,"video-box","p-0",2,"border-radius","16px",3,"ended","muted","id"],[3,"src"],[3,"click"],["name","play32"],[1,"duration-text","f-13","text-white"],["placement","top","ngbTooltip","Download",1,"btn-icon-grey","me-2","d-flex","align-items-center","justify-content-center",3,"click"],["name","downloadwhite",1,"f-24"],["placement","top","ngbTooltip","More options","id","dropdownBasic111","ngbDropdownToggle","",1,"btn-icon-grey","d-flex","align-items-center","justify-content-center"]],template:function(t,n){1&t&&e.DNE(0,cn,7,8,"div",5)(1,ln,1,1,"ng-template",null,0,e.C5r),2&t&&e.Y8G("ngIf",n.aiPhotoService.aiImages&&n.aiPhotoService.aiImages.length>0||n.aiPhotoService.inVideoProgress||n.aiPhotoService.inProgress)},dependencies:[s.YU,s.Sq,s.bT,Ve.G,we.g,f.tg,f.do,f.U0,f._H,f.md,L.b,Gt.E,Ee.KK],styles:['.ai-thumb-genrated-col[_ngcontent-%COMP%]{position:relative;height:100%;margin:0;padding:28px 0}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-list[_ngcontent-%COMP%]{flex-wrap:wrap;margin:0 48px;padding-bottom:0}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%]{border-radius:16px;background:#626adf0d;position:relative;margin:0 20px 40px;display:inline-flex;justify-content:center;align-items:center;flex-grow:10}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%] .watermark[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%] .watermark[_ngcontent-%COMP%]{left:0;bottom:0;border-radius:24px}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%] .watermark[_ngcontent-%COMP%] img[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%] .watermark[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:144px;height:70px;border-radius:24px}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%] .cta-action-top[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%] .cta-action-top[_ngcontent-%COMP%]{position:absolute;top:-50px;right:12px;display:none!important;transition:top .2s ease-out;width:auto}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%] .cta-action-top[_ngcontent-%COMP%] .btn-icon-grey[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%] .cta-action-top[_ngcontent-%COMP%] .btn-icon-grey[_ngcontent-%COMP%]{height:32px;width:32px;border-radius:8px;border:0px;background:#4a4f5e66;color:#fff;padding:4px;outline:none;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%] .cta-action-top[_ngcontent-%COMP%] .btn-icon-grey[_ngcontent-%COMP%]:hover, .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%] .cta-action-top[_ngcontent-%COMP%] .btn-icon-grey[_ngcontent-%COMP%]:hover{background:#959aa766}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%] .cta-action-top[_ngcontent-%COMP%] .btn-icon-grey[_ngcontent-%COMP%]:focus, .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%] .cta-action-top[_ngcontent-%COMP%] .btn-icon-grey[_ngcontent-%COMP%]:focus{background:#4a4f5eb3}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%] .cta-action-top[_ngcontent-%COMP%] .icon-disabled[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%] .cta-action-top[_ngcontent-%COMP%] .icon-disabled[_ngcontent-%COMP%]{pointer-events:none!important}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%] .cta-action-top[_ngcontent-%COMP%] .icon-disabled[_ngcontent-%COMP%] pi[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%] .cta-action-top[_ngcontent-%COMP%] .icon-disabled[_ngcontent-%COMP%] pi[_ngcontent-%COMP%]{color:#ffffff4d}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%] .cta-action-top[_ngcontent-%COMP%] .bs-tooltip-top[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%] .cta-action-top[_ngcontent-%COMP%] .bs-tooltip-top[_ngcontent-%COMP%]{background:#4a4f5e!important;border-radius:6px!important}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%] .cta-action-top[_ngcontent-%COMP%] .bs-tooltip-top[_ngcontent-%COMP%] .tooltip-inner[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%] .cta-action-top[_ngcontent-%COMP%] .bs-tooltip-top[_ngcontent-%COMP%] .tooltip-inner[_ngcontent-%COMP%]{background:#4a4f5e!important;padding:3px 6px!important;font-size:12px!important;font-weight:600}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%] .cta-action[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%] .cta-action-bottom[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%] .cta-action[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%] .cta-action-bottom[_ngcontent-%COMP%]{position:absolute;bottom:-90px;right:0;display:none;transition:bottom .2s ease-out}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%] .cta-action[_ngcontent-%COMP%] .btn-icon-white[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%] .cta-action-bottom[_ngcontent-%COMP%] .btn-icon-white[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%] .cta-action[_ngcontent-%COMP%] .btn-icon-white[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%] .cta-action-bottom[_ngcontent-%COMP%] .btn-icon-white[_ngcontent-%COMP%]{height:40px;width:40px;border-radius:50%;border:0px;background:#ffffffb3;color:#272b34}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%] .cta-action[_ngcontent-%COMP%] .btn-icon-white[_ngcontent-%COMP%]:hover, .ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%] .cta-action-bottom[_ngcontent-%COMP%] .btn-icon-white[_ngcontent-%COMP%]:hover, .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%] .cta-action[_ngcontent-%COMP%] .btn-icon-white[_ngcontent-%COMP%]:hover, .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%] .cta-action-bottom[_ngcontent-%COMP%] .btn-icon-white[_ngcontent-%COMP%]:hover{background:#fff}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%] .cta-action[_ngcontent-%COMP%] .gen-item-description[_ngcontent-%COMP%] .tool-name[_ng
1content-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%] .cta-action-bottom[_ngcontent-%COMP%] .gen-item-description[_ngcontent-%COMP%] .tool-name[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%] .cta-action[_ngcontent-%COMP%] .gen-item-description[_ngcontent-%COMP%] .tool-name[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%] .cta-action-bottom[_ngcontent-%COMP%] .gen-item-description[_ngcontent-%COMP%] .tool-name[_ngcontent-%COMP%]{display:flex;width:max-content;font-size:13px;color:#fff;height:28px;padding:8px 12px;justify-content:center;align-items:center;border-radius:16px;border:0px solid #606576;background:linear-gradient(273deg,#626adfcc,#a64dffcc)}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%] .cta-action[_ngcontent-%COMP%] .gen-item-description[_ngcontent-%COMP%] .prompt-text[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%] .cta-action-bottom[_ngcontent-%COMP%] .gen-item-description[_ngcontent-%COMP%] .prompt-text[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%] .cta-action[_ngcontent-%COMP%] .gen-item-description[_ngcontent-%COMP%] .prompt-text[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%] .cta-action-bottom[_ngcontent-%COMP%] .gen-item-description[_ngcontent-%COMP%] .prompt-text[_ngcontent-%COMP%]{font-size:13px;color:#fff;text-align:left;line-height:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%] .c-img[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%] .c-img[_ngcontent-%COMP%]{position:relative}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%]:hover .cta-action[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%]:hover .cta-action-bottom[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%]:hover .cta-action[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%]:hover .cta-action-bottom[_ngcontent-%COMP%]{width:100%;position:absolute;bottom:0;display:flex!important;transition:bottom .2s ease-out;border-radius:0 0 16px 16px;max-height:76px;background:linear-gradient(0deg,#000000a1,#6660)}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%]:hover .cta-action[_ngcontent-%COMP%] .upsacle-badge[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%]:hover .cta-action-bottom[_ngcontent-%COMP%] .upsacle-badge[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%]:hover .cta-action[_ngcontent-%COMP%] .upsacle-badge[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%]:hover .cta-action-bottom[_ngcontent-%COMP%] .upsacle-badge[_ngcontent-%COMP%]{display:inline-flex!important}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%]:hover .cta-action-top[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%]:hover .cta-action-top[_ngcontent-%COMP%]{position:absolute;top:12px;display:flex!important;transition:top .2s ease-out}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%]:hover .cta-action-top[_ngcontent-%COMP%] .input-image[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%]:hover .cta-action-top[_ngcontent-%COMP%] .input-image[_ngcontent-%COMP%]{height:24px;width:24px;background:transparent;border-radius:0;object-fit:initial;position:inherit;margin:0}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%]:hover .btn-icon-remix.outer[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%]:hover .btn-icon-remix.outer[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%]:hover .upsacle-badge[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%]:hover .upsacle-badge[_ngcontent-%COMP%]{display:none!important}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%] .progress-col[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%] .progress-col[_ngcontent-%COMP%]{flex-wrap:wrap}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%] .progress-col[_ngcontent-%COMP%] img[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%] .progress-col[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:77px!important;height:58px!important}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%] .progress-col[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%] .progress-col[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#181a20;display:inline-block}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%] img[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{object-fit:cover;border-radius:16px;background:transparent!important}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%] video[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%] video[_ngcontent-%COMP%]{background:transparent!important}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%] .checkboxc[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%] .checkboxc[_ngcontent-%COMP%]{transition:none!important}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%] .checkboxc[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%] .checkboxc[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{cursor:pointer;-webkit-appearance:none;appearance:none;background-color:#ffffff0d;position:relative;width:32px;height:32px;border:1px solid #E2E3E9;border-radius:8px;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);background-size:32px 32px!important}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%] .checkboxc[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:hover, .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%] .checkboxc[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:hover{background-color:#fff3}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%] .upsacle-badge[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%] .upsacle-badge[_ngcontent-%COMP%]{right:12px;bottom:12px}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-item[_ngcontent-%COMP%] .upsacle-badge[_ngcontent-%COMP%] .scale-badge[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%] .upsacle-badge[_ngcontent-%COMP%] .scale-badge[_ngcontent-%COMP%]{height:22px;width:22px;border-radius:6px;border:1px solid #FFF;background:#181a2033;font-size:10px;color:#fff;line-height:normal}.ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div.dropdown-hover[_ngcontent-%COMP%] .btn-icon-remix.outer[_ngcontent-%COMP%]{display:none!important}.ai-thumb-genrated-col[_ngcontent-%COMP%] .progress-col-item[_ngcontent-%COMP%]{background:#fffc!important;-webkit-backdrop-filter:blur(40px)!important;backdrop-filter:blur(40px)!important;border:1px solid #E2E3E9!important}.ai-thumb-genrated-col[_ngcontent-%COMP%] .not-hov[_ngcontent-%COMP%]:hover .c-img[_ngcontent-%COMP%]:before{background:transparent!important}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-list.showcheck[_ngcontent-%COMP%] .checkboxc[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div.showcheck[_ngcontent-%COMP%] .checkboxc[_ngcontent-%COMP%]{visibility:visible;opacity:1}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-list.showcheck[_ngcontent-%COMP%] .cta-action[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-list.showcheck[_ngcontent-%COMP%] .cta-action-bottom[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div.showcheck[_ngcontent-%COMP%] .cta-action[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div.showcheck[_ngcontent-%COMP%] .cta-action-bottom[_ngcontent-%COMP%]{display:none}.ai-thumb-genrated-col[_ngcontent-%COMP%] .ai-thumb-genrated-list.showcheck[_ngcontent-%COMP%] .cta-action-top[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div.showcheck[_ngcontent-%COMP%] .cta-action-top[_ngcontent-%COMP%]{display:none!important}.show[_ngcontent-%COMP%]{visibility:visible!important;opacity:1!important;width:32px;height:32px;border-radius:8px}.nav-small-device.dropdown-menu.show[_ngcontent-%COMP%]{height:auto!important;width:auto!important;right:80px!important;left:auto!important;padding:12px 8px!important;border-radius:12px;border:1px solid #E2E3E9;background:#fff;box-shadow:0 8px 24px #00000026}.nav-small-device.dropdown-menu.show[_ngcontent-%COMP%] li[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{font-size:13px;font-weight:400;border-radius:12px;padding:0 8px;color:#4a4f5e}.nav-small-device.dropdown-menu.show[_ngcontent-%COMP%] li[_ngcontent-%COMP%] a[_ngcontent-%COMP%] pi[_ngcontent-%COMP%]{color:#4a4f5e}.meta[_ngcontent-%COMP%] .duration-text[_ngcontent-%COMP%]{border-radius:6px;background:#0006;padding:2px 6px}.ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div.active-index-thumb[_ngcontent-%COMP%] .cta-action[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div.active-index-thumb[_ngcontent-%COMP%] .cta-action-bottom[_ngcontent-%COMP%]{width:100%;position:absolute;bottom:0;display:flex!important;transition:bottom .2s ease-out;border-radius:0 0 16px 16px;max-height:76px;background:linear-gradient(0deg,#000000a1,#6660)}.ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div.active-index-thumb[_ngcontent-%COMP%] .cta-action[_ngcontent-%COMP%] .upsacle-badge[_ngcontent-%COMP%], .ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div.active-index-thumb[_ngcontent-%COMP%] .cta-action-bottom[_ngcontent-%COMP%] .upsacle-badge[_ngcontent-%COMP%]{display:inline-flex!important}.ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div.active-index-thumb[_ngcontent-%COMP%] .cta-action-top[_ngcontent-%COMP%]{position:absolute;top:12px;display:flex!important;transition:top .2s ease-out}.ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div.active-index-thumb[_ngcontent-%COMP%] .cta-action-top[_ngcontent-%COMP%] .input-image[_ngcontent-%COMP%]{height:24px;width:24px;background:transparent;border-radius:0;object-fit:initial;position:inherit;margin:0}.ai-thumb-genrated-col[_ngcontent-%COMP%] .img-div.active-index-thumb[_ngcontent-%COMP%] .upsacle-badge[_ngcontent-%COMP%]{display:none!important}.nav-small-device.dropdown-menu.show.upscale-drop[_ngcontent-%COMP%]{transform:none!important;position:absolute!important;inset:inherit!important;right:0!important;top:36px!important;min-width:174px}.nav-small-device.dropdown-menu.show.upscale-drop-1[_ngcontent-%COMP%]{right:calc(100% - 116px)!important}.nav-small-device.dropdown-menu.show.upscale-drop-1.upscale-drop-inner[_ngcontent-%COMP%]{right:-200px!important;top:32px!important}.dropdown-submenu[_ngcontent-%COMP%]{position:relative}.dropdown-submenu[_ngcontent-%COMP%] > .dropdown-menu[_ngcontent-%COMP%]{top:0;left:100%;margin-left:.1rem}.btn-icon-remix[_ngcontent-%COMP%]{height:32px;width:32px;border-radius:8px;border:0px;background:linear-gradient(90deg,#fc5cff -4%,#2520f6);color:#fff;padding:4px;outline:none;transition:all .3s ease-in-out;position:relative;overflow:hidden}.btn-icon-remix[_ngcontent-%COMP%]:before{content:"";position:absolute;width:100px;height:100%;background-image:linear-gradient(120deg,#fff0 30%,#fffc,#fff0 70%);top:0;left:-100px;opacity:.6;animation:_ngcontent-%COMP%_shine 1.5s ease-out infinite}.btn-icon-remix[_ngcontent-%COMP%]:hover{background:linear-gradient(90deg,#f270ff -4%,#413bf7)!important}.btn-icon-remix[_ngcontent-%COMP%]:focus{background:linear-gradient(90deg,#fc5cff -4%,#2520f6)}@keyframes _ngcontent-%COMP%_shine{0%{left:-50px}60%{left:50%}to{left:50%}}.img-div[_ngcontent-%COMP%]:nth-child(3n) .nav-small-device.dropdown-menu.show.upscale-drop-1.upscale-drop-inner[_ngcontent-%COMP%]{right:165px!important;top:32px!important}@media only screen and (min-width: 1800px) and (max-width: 1920px){.img-div[_ngcontent-%COMP%]:nth-child(5n) .nav-small-device.dropdown-menu.show.upscale-drop-1.upscale-drop-inner[_ngcontent-%COMP%]{right:165px!important;top:32px!important}}@media only screen and (min-width: 1600px) and (max-width: 1800px){.img-div[_ngcontent-%COMP%]:nth-child(4n) .nav-small-device.dropdown-menu.show.upscale-drop-1.upscale-drop-inner[_ngcontent-%COMP%]{right:165px!important;top:32px!important}}']}),l})();var he=c(49969);const _n=r=>({"is-active-tool":r}),gn=r=>({new_item:r});function pn(r,l){if(1&r&&(e.j41(0,"a",9)(1,"div",10),e.nrm(2,"pi",11),e.k0s(),e.j41(3,"span",12),e.EFF(4),e.k0s()()),2&r){const o=e.XpG(2).$implicit;e.R7$(),e.Y8G("ngClass",e.eq3(3,gn,"video-tools"==o.name||""==o.name)),e.R7$(),e.Y8G("name",o.icon),e.R7$(2),e.JRh(o.title)}}function mn(r,l){if(1&r&&(e.j41(0,"div"),e.DNE(1,pn,5,5,"a",8),e.k0s()),2&r){const o=e.XpG().$implicit;
1e.R7$(),e.Y8G("ngIf",0==o.subNavs.length&&o.enable)}}function hn(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",4),e.bIt("click",function(){const n=e.eBV(o).$implicit,i=e.XpG();return e.Njj(i.executeAction(n))}),e.DNE(1,mn,2,1,"div",5),e.nrm(2,"span",6)(3,"span",7),e.k0s()}if(2&r){const o=l.$implicit,t=e.XpG();e.Y8G("ngClass",e.eq3(2,_n,t.activeTool==o.name)),e.R7$(),e.Y8G("ngIf",o.visible)}}let un=(()=>{var r;class l{constructor(t,n,i){this.editorService=t,this.aiPhotoService=n,this.subsService=i,this.tools=W.po.toolbar.nav.items,this.editorService.activeToolPanel.subscribe(a=>{this.activeTool=a.panel})}ngOnInit(){}executeAction(t){this.activeTool=t.panel,setTimeout(()=>{this.subsService.openPromotionPopup()},500),t.name!=this.activeTool&&this.editorService.setActiveToolPanel({panel:t.action,from:"nav"})}}return(r=l).\u0275fac=function(t){return new(t||r)(e.rXU(k.x),e.rXU(U.s),e.rXU(se.n))},r.\u0275cmp=e.VBU({type:r,selectors:[["toolbar-navigation"]],inputs:{activeTool:"activeTool"},decls:4,vars:2,consts:[[1,"menu","left-panel-bgcolor","photo-left-panel",2,"height","100%"],["type","hidden","id","gtm-ai-selected-tool",1,"d-none",3,"value"],["customScrollDir","",1,"navigation-item","is-popover-tb-n","ps-0","m-0","pb-3","scroll-container"],["class","inner-nav text-center","style","margin-top:15px;",3,"ngClass","click",4,"ngFor","ngForOf"],[1,"inner-nav","text-center",2,"margin-top","15px",3,"click","ngClass"],[4,"ngIf"],[1,"curve-before","curve"],[1,"curve-after","curve"],["class","nav d-block",4,"ngIf"],[1,"nav","d-block"],[1,"hw-40","icon","m-auto","photoEditor","d-flex","align-items-center","justify-content-center",3,"ngClass"],[1,"f-24",3,"name"],[1,"nav-title","text-semi"]],template:function(t,n){1&t&&(e.j41(0,"div",0),e.nrm(1,"input",1),e.j41(2,"div",2),e.DNE(3,hn,4,4,"div",3),e.k0s()()),2&t&&(e.R7$(),e.FS9("value",n.activeTool),e.R7$(2),e.Y8G("ngForOf",n.tools))},dependencies:[s.YU,s.Sq,s.bT,w.q,L.b],styles:[".menu[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%]:hover .icon[_ngcontent-%COMP%]{background:#626adf0d;color:#606576}.menu[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] .nav-title[_ngcontent-%COMP%]{visibility:visible;position:relative;color:#606576;top:3px;user-select:none;-webkit-user-select:none}.menu[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%]:hover .nav-title[_ngcontent-%COMP%]{visibility:visible;color:#606576}.menu[_ngcontent-%COMP%] .is-active-tool[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] .nav-title[_ngcontent-%COMP%]{visibility:visible;position:relative;top:3px;color:#626adf!important}.left-panel-bgcolor[_ngcontent-%COMP%]{border-radius:0 16px 0 0;background:#f8f9f9}.new_item[_ngcontent-%COMP%]{position:relative;padding-right:13px}.new_item[_ngcontent-%COMP%]:after{content:url(https://static.lightxeditor.com/assets/icons/newbadge.svg);position:absolute;top:1px;padding-left:47px}.navigation-item[_ngcontent-%COMP%]{padding-right:2px!important}"],data:{animation:[(0,he.hZ)("controlsAnimation",[(0,he.kY)(":enter",[(0,he.iF)({opacity:0}),(0,he.i0)("225ms cubic-bezier(.4,0,.2,1)",(0,he.iF)({opacity:1}))]),(0,he.kY)(":leave",[(0,he.i0)("0ms cubic-bezier(.4,0,.2,1)",(0,he.iF)({opacity:0}))])])]}}),l})();var Pn=c(94449),Me=c(79279),A=c(68465),te=c(62261),Se=c(42494),ae=c(48039),Oe=c(20753),Ce=c(19338),ue=c(69711),fn=c(345),bn=c(8708);const Cn=["videoPlayer"];function vn(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",3)(1,"div",4)(2,"div",5)(3,"youtube-player",6),e.bIt("stateChange",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.onPlayerStateChange(n))}),e.k0s()()(),e.j41(4,"div",7)(5,"div",8)(6,"div",9)(7,"p",10),e.EFF(8),e.k0s()(),e.j41(9,"div",11)(10,"p",12),e.EFF(11),e.k0s()()()()()}if(2&r){const o=e.XpG();e.R7$(3),e.Y8G("videoId",null==o.activestyleItem?null:o.activestyleItem.videoId)("height","180")("width","100%"),e.R7$(5),e.SpI(" ",null==o.activestyleItem?null:o.activestyleItem.heading,""),e.R7$(3),e.JRh(null==o.activestyleItem?null:o.activestyleItem.desc)}}let Te=(()=>{var r;class l{constructor(t,n,i,a,d){this.elem=t,this.sanitizer=n,this.aiUploadImageService=i,this.aiPhotoService=a,this.document=d,this.styleReferenceItems=[{videoId:"CiUBjOwBP-8",editorType:h.Fs.Avatar,editorSubTool:"",heading:"Style Reference",desc:"Upload a reference image for the AI to incorporate its style into your newly generated image! This feature allows the AI to mimic elements such as color, aesthetics, and artistic composition from your reference image."},{videoId:"OvytqWXQIvc",editorType:h.Fs.ImageToImage,editorSubTool:h.do.ImageToImage,heading:"Enter Prompt",desc:"Upload a reference image for the AI to incorporate its style into your newly generated image! This feature allows the AI to mimic elements such as color, aesthetics, and artistic composition from your reference image."},{videoId:"Iw9ne5_OmE8",editorType:h.Fs.ImageToImage,editorSubTool:h.do.ImageToSkatch,heading:"Enter Prompt",desc:"Upload a reference image for the AI to incorporate its style into your newly generated image! This feature allows the AI to mimic elements such as color, aesthetics, and artistic composition from your reference image."},{videoId:"qf7AGfY0SFI",editorType:h.Fs.PhotoShoot,editorSubTool:h.do.Product_Photoshoot,heading:"Style Reference",desc:"Upload a reference image for the AI to incorporate its style into your newly generated image! This feature allows the AI to mimic elements such as color, aesthetics, and artistic composition from your reference image."},{videoId:"gbfhd13TDf4",editorType:h.Fs.Portrait,editorSubTool:"",heading:"Style Reference",desc:"Upload a reference image for the AI to incorporate its style into your newly generated image! This feature allows the AI to mimic elements such as color, aesthetics, and artistic composition from your reference image."},{videoId:"Iw9ne5_OmE8",editorType:h.Fs.AiDesign,editorSubTool:h.do.ImageToImage,heading:"Style Reference",desc:"Upload a reference image for the AI to incorporate its style into your newly generated image! This feature allows the AI to mimic elements such as color, aesthetics, and artistic composition from your reference image."}],this.selectstyleRef=new e.bkB,this.videoId="Vr8KlZu-vr0",this.closevedio=new e.bkB,this.isLoaded=!1,this.videoUrl="https://www.youtube.com/watch?v=k5549RA1zSE",this.styleclick=!1}ngOnInit(){if(this.editorType){let t=this.styleReferenceItems.filter(n=>n.editorType==this.editorType&&n.editorSubTool==this.editorSubTool);this.activestyleItem=t?t[0]:this.styleReferenceItems[0]}if(!this.isLoaded){const t=this.document.createElement("script");t.setAttribute("id","youtube-script"),this.document.getElementById("youtube-script")||(t.src="https://www.youtube.com/iframe_api",this.document.body.appendChild(t)),this.isLoaded=!0}}replaceImage(t){this.aiPhotoService.inProgress||t.click()}changeDrop(t){this.aiPhotoService.selectedGuidance.guidanceId=t}onMouseOut(){this.styleclick||this.selectstyleRef.emit({close:!0})}MouseClick(){this.styleclick=!0,this.selectstyleRef.emit({close:!1})}onPlayerStateChange(t){this.styleclick=!0,this.selectstyleRef.emit({close:!1})}}return(r=l).\u0275fac=function(t){return new(t||r)(e.rXU(e.aKT),e.rXU(fn.up),e.rXU(G.M),e.rXU(U.s),e.rXU(s.qQ))},r.\u0275cmp=e.VBU({type:r,selectors:[["ai-style-reference-popover"]],viewQuery:function(t,n){if(1&t&&e.GBs(Cn,5),2&t){let i;e.mGM(i=e.lsd())&&(n.videoplayer=i.first)}},inputs:{editorType:"editorType",editorSubTool:"editorSubTool",videoId:"videoId"},outputs:{selectstyleRef:"selectstyleRef",closevedio:"closevedio"},decls:3,vars:1,consts:[[1,"d-flex","w-100","flex-column","imageGuidancePopUp",3,"mouseleave","click"],[1,"d-flex","w-100","prompt-list","flex-column"],["class","card-body",4,"ngIf"],[1,"card-body"],[1,""],[1,"text-center","youtubePlayer"],[2,"max-height","180px",3,"stateChange","videoId","height","width"],[1,"popContentBox"],[1,"ps-3","pe-2","mt-3"],[1,"d-flex"],[1,"text-14","text-dark","text-semi","lh-125"],[1,"d-flex","mt-2"],[1,"text-sm","text-dark","lh-160"]],template:function(t,n){1&t&&(e.j41(0,"div",0),e.bIt("mouseleave",function(){return n.onMouseOut()})("click",function(){return n.MouseClick()}),e.j41(1,"div",1),e.DNE(2,vn,12,5,"div",2),e.k0s()()),2&t&&(e.R7$(2),e.Y8G("ngIf",n.activestyleItem))},dependencies:[s.bT,bn.x9],styles:[".ai-thumb-view[_ngcontent-%COMP%]{background:url(https://static.lightxeditor.com/assets/images/tranparent.png);height:134px;position:relative;overflow:hidden;-webkit-user-select:none;user-select:none}.ai-thumb-view[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:100%;width:auto;object-fit:contain;overflow:hidden}.ai-thumb-view[_ngcontent-%COMP%]:hover .replace-btn[_ngcontent-%COMP%]{display:flex;z-index:99;position:absolute;background:#0006;align-items:center;justify-content:center;height:100%;width:100%;flex-direction:column}.ai-thumb-view[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%]{display:none}.ai-thumb-view[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{background:#fff!important;border:0px!important;color:#272b34!important;min-width:124px}.ai-thumb-view[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{background:linear-gradient(0deg,#626adf0d 0% 100%),#fff!important;color:#272b34}.ai-thumb-view[_ngcontent-%COMP%] .add-on-404[_ngcontent-%COMP%]{display:flex;z-index:99;position:absolute;background:#0000001a;align-items:center;justify-content:center;height:100%;width:100%;flex-direction:column}.deleteBtn[_ngcontent-%COMP%]{background:none;border-radius:12px;width:40px;height:40px;cursor:pointer;display:flex;align-items:center;justify-content:center}.deleteBtn[_ngcontent-%COMP%]:hover{background:#626adf0d}.form-control[_ngcontent-%COMP%]:disabled{color:#b0b3bf!important;border:1px solid #E2E3E9!important}.opacity-3[_ngcontent-%COMP%]{opacity:.3}.popContentBox[_ngcontent-%COMP%]{max-height:349px;overflow:auto;height:100%;border-right:4px solid #fff}@media (min-height: 500px){.popContentBox[_ngcontent-%COMP%]{max-height:200px}}[_ngcontent-%COMP%]::-webkit-scrollbar{width:4px}[_ngcontent-%COMP%]::-webkit-scrollbar-track{box-shadow:inset 0 0 5px #b0b3bf0d;border-radius:12px;margin-top:5px;margin-bottom:5px}[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#b0b3bfbf;border-radius:12px}[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:#b0b3bfbf}"]}),l})();
1var oe=c(14845),De=c(19567),re=c(90811),be=c(35975);const In=["popoverOpen"],xn=["popStylesReferenc1"],Mn=["p"],On=(r,l,o)=>({"info-up":r,"info-blue":l,"info-red":o});function yn(r,l){if(1&r&&(e.j41(0,"span",51),e.EFF(1),e.k0s()),2&r){const o=e.XpG(3);e.R7$(),e.SpI("",o.customPrompt.length,"/450")}}function wn(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",52)(1,"div",53)(2,"div",37),e.EFF(3,"Style Reference"),e.j41(4,"pi",54,3),e.bIt("mouseenter",function(){e.eBV(o);const n=e.XpG(3);return e.Njj(n.showStyleRefPopover())})("mouseleave",function(){e.eBV(o);const n=e.XpG(3);return e.Njj(n.showStyleRefPopover())}),e.k0s()()(),e.j41(6,"div",55)(7,"pi",56),e.bIt("click",function(){e.eBV(o);const n=e.sdS(9),i=e.XpG(3);return e.Njj(i.addStyleImage(n))}),e.k0s(),e.j41(8,"input",57,4),e.bIt("change",function(n){e.eBV(o);const i=e.XpG(3);return e.Njj(i.onFileUploaded(n.srcElement.files))})("click",function(){e.eBV(o);const n=e.sdS(9);return e.Njj(n.value="")}),e.k0s()()()}if(2&r){const o=e.XpG(3),t=e.sdS(20);e.R7$(4),e.Y8G("ngbPopover",t),e.R7$(2),e.Y8G("hidden",null==o.aiPhotoService||null==o.aiPhotoService.selectedGuidance?null:o.aiPhotoService.selectedGuidance.guidanceId),e.R7$(2),e.Y8G("accept",o.aiUploadImageService.fileImageAccept)}}function En(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",58)(1,"div",59),e.EFF(2," Style Reference"),e.j41(3,"pi",54,3),e.bIt("mouseenter",function(){e.eBV(o);const n=e.XpG(3);return e.Njj(n.showStyleRefPopover())})("mouseleave",function(){e.eBV(o);const n=e.XpG(3);return e.Njj(n.showStyleRefPopover())}),e.k0s()(),e.j41(5,"div",60)(6,"div"),e.nrm(7,"img",61),e.j41(8,"span",62),e.EFF(9,"Image"),e.k0s()(),e.j41(10,"div",63)(11,"div",64),e.bIt("click",function(){e.eBV(o);const n=e.sdS(16),i=e.XpG(3);return e.Njj(i.addStyleImage(n))}),e.nrm(12,"pi",65),e.k0s(),e.j41(13,"div",66),e.bIt("click",function(){e.eBV(o);const n=e.XpG(3);return e.Njj(n.deleteStyleImage())}),e.nrm(14,"pi",67),e.k0s()(),e.j41(15,"input",57,4),e.bIt("change",function(n){e.eBV(o);const i=e.XpG(3);return e.Njj(i.onFileUploaded(n.srcElement.files))})("click",function(){e.eBV(o);const n=e.sdS(16);return e.Njj(n.value="")}),e.k0s()(),e.j41(17,"div",68)(18,"div",69)(19,"span",37),e.EFF(20,"Style Strength"),e.nrm(21,"pi",70),e.k0s()(),e.j41(22,"div",71)(23,"div",72)(24,"mv-slider",73),e.bIt("change",function(n){e.eBV(o);const i=e.XpG(3);return e.Njj(i.inputStrength(n,!1))})("slideStop",function(n){e.eBV(o);const i=e.XpG(3);return e.Njj(i.inputStrength(n,!0))}),e.k0s()(),e.j41(25,"div",74)(26,"input",75),e.bIt("ngModelChange",function(n){e.eBV(o);const i=e.XpG(3);return e.Njj(i.inputStrength(n,!0))}),e.k0s()()()()()}if(2&r){const o=e.XpG(3),t=e.sdS(20);e.R7$(3),e.Y8G("ngbPopover",t),e.R7$(4),e.FS9("src",o.styleImageUrl,e.B4B),e.R7$(8),e.Y8G("accept",o.aiUploadImageService.fileImageAccept),e.R7$(9),e.Y8G("value",o.imgStrength)("min",0)("max",100)("step",1),e.R7$(2),e.Y8G("min",0)("max",100)("ngModel",o.imgStrength)}}function Sn(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",36)(1,"div",37),e.EFF(2,"Enter Prompt"),e.j41(3,"pi",38),e.bIt("mouseenter",function(){e.eBV(o);const n=e.XpG(2);return e.Njj(n.hideStyleRefPopover())}),e.k0s()(),e.j41(4,"div",39),e.nrm(5,"pi",40,2),e.k0s()(),e.j41(7,"div",41)(8,"div",42)(9,"div",43)(10,"div",44)(11,"div",45)(12,"div",46)(13,"text-prompt-animation",47),e.bIt("changePrompt",function(n){e.eBV(o);const i=e.XpG(2);return e.Njj(i.changePrompt(n))})("focusOut",function(n){e.eBV(o);const i=e.XpG(2);return e.Njj(i.onFocusOut(n))}),e.k0s(),e.DNE(14,yn,2,1,"span",48),e.k0s(),e.DNE(15,wn,10,3,"div",49)(16,En,27,10,"div",50),e.k0s()()()()()}if(2&r){const o=e.XpG(2),t=e.sdS(18);e.R7$(5),e.Y8G("autoClose",!0)("ngbPopover",t),e.R7$(7),e.Y8G("ngClass",e.sMw(8,On,o.customPrompt.length,o.isFocused,o.customPrompt.length>449)),e.R7$(),e.Y8G("prompts",o.prompts)("textPrompt",o.customPrompt),e.R7$(),e.Y8G("ngIf",o.customPrompt.length),e.R7$(),e.Y8G("ngIf",!o.styleImageUrl),e.R7$(),e.Y8G("ngIf",o.styleImageUrl)}}function Tn(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",41)(1,"div",77)(2,"div",43)(3,"div",44)(4,"div",43)(5,"workflow-ui",78),e.mxI("productC
1onfigChange",function(n){e.eBV(o);const i=e.XpG(3);return e.DH7(i.productConfig,n)||(i.productConfig=n),e.Njj(n)}),e.bIt("productConfigChange",function(n){e.eBV(o);const i=e.XpG(3);return e.Njj(i.productConfigChange(n))}),e.k0s()()()()()()}if(2&r){const o=e.XpG(3);e.R7$(5),e.R50("productConfig",o.productConfig),e.Y8G("workflowList",o.workflowList)("inProgress",o.aiPhotoService.inProgress)}}function Dn(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",76),e.bIt("shown",function(){e.eBV(o);const n=e.XpG(2);return e.Njj(n.onAccItemToggle("panel-3",!0))})("hidden",function(){e.eBV(o);const n=e.XpG(2);return e.Njj(n.onAccItemToggle("panel-3",!1))}),e.j41(1,"div",22)(2,"div",23)(3,"button",24)(4,"div",25),e.EFF(5,"Workflow "),e.k0s()(),e.j41(6,"button",26)(7,"span",27),e.nrm(8,"pi",28),e.k0s(),e.j41(9,"span",29),e.nrm(10,"pi",30),e.k0s()()()(),e.j41(11,"div",31)(12,"div",32),e.DNE(13,Tn,6,3,"ng-template"),e.k0s()()()}if(2&r){const o=e.XpG(2);e.Y8G("collapsed","panel-3"!==o.activeAccPanelId)}}function kn(r,l){if(1&r){const o=e.RV6();e.qex(0),e.j41(1,"preset-style",79),e.bIt("selectStyleEvent",function(n){e.eBV(o);const i=e.XpG(3);return e.Njj(i.selectImage(n))}),e.k0s(),e.bVm()}if(2&r){const o=e.XpG(3);e.R7$(),e.Y8G("type","category")("storeProducts",o.storeProducts)("productId",o.productId)("productImageId",o.productImageId)}}function Rn(r,l){1&r&&(e.qex(0),e.j41(1,"div",80),e.nrm(2,"element-placeholder",81),e.k0s(),e.bVm()),2&r&&(e.R7$(2),e.Y8G("view","AiPatterns"))}function Un(r,l){if(1&r&&e.DNE(0,kn,2,4,"ng-container",8)(1,Rn,3,1,"ng-container",8),2&r){const o=e.XpG(2);e.Y8G("ngIf",(null==o.storeProducts?null:o.storeProducts.length)>0),e.R7$(),e.Y8G("ngIf",!o.isLoaded)}}function An(r,l){if(1&r){const o=e.RV6();e.qex(0),e.j41(1,"div",18)(2,"div",19)(3,"div",20)(4,"div",21),e.bIt("shown",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.onAccItemToggle("panel-1",!0))})("hidden",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.onAccItemToggle("panel-1",!1))}),e.j41(5,"div",22)(6,"div",23)(7,"button",24)(8,"div",25),e.EFF(9,"Prompt"),e.k0s()(),e.j41(10,"button",26)(11,"span",27),e.nrm(12,"pi",28),e.k0s(),e.j41(13,"span",29),e.nrm(14,"pi",30),e.k0s()()()(),e.j41(15,"div",31)(16,"div",32),e.DNE(17,Sn,17,12,"ng-template"),e.k0s()()(),e.DNE(18,Dn,14,1,"div",33),e.j41(19,"div",34),e.bIt("shown",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.onAccItemToggle("panel-2",!0))})("hidden",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.onAccItemToggle("panel-2",!1))}),e.j41(20,"div",22)(21,"div",23)(22,"button",24)(23,"div",25),e.EFF(24,"Presets"),e.j41(25,"pi",35),e.bIt("mouseenter",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.hideStyleRefPopover())}),e.k0s()()(),e.j41(26,"button",26)(27,"span",27),e.nrm(28,"pi",28),e.k0s(),e.j41(29,"span",29),e.nrm(30,"pi",30),e.k0s()()()(),e.j41(31,"div",31)(32,"div",32),e.DNE(33,Un,2,2,"ng-template"),e.k0s()()()()()(),e.bVm()}if(2&r){const o=e.XpG();e.R7$(3),e.Y8G("closeOthers",!0),e.R7$(),e.Y8G("collapsed","panel-1"!==o.activeAccPanelId),e.R7$(14),e.Y8G("ngIf",o.productConfig),e.R7$(),e.Y8G("collapsed","panel-2"!==o.activeAccPanelId)}}function Bn(r,l){1&r&&(e.j41(0,"div",82)(1,"span",83),e.EFF(2,"Loading..."),e.k0s()())}function Gn(r,l){if(1&r){const o=e.RV6();e.j41(0,"ai-prompts-popover",84),e.bIt("selectPrompt",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.selectPrompt(n))}),e.k0s()}if(2&r){const o=e.XpG();e.Y8G("items",o.prompts)}}function jn(r,l){if(1&r){const o=e.RV6();e.j41(0,"ai-style-reference-popover",85),e.bIt("selectstyleRef",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.selectstyleRef(n))}),e.k0s()}2&r&&e.Y8G("editorType","photoshoot")("editorSubTool","product")}let Fn=(()=>{var r;class l{constructor(t,n,i,a,d,g,m,b,O,E){this.mediaContentService=t,this.authService=n,this.aiPhotoService=i,this.aiWrapperRemoveBgService=a,this.createPopupService=d,this.route=g,this.aiUploadImageService=m,this.workflowUIService=b,this.toast=O,this.paymentService=E,this.toolName=h.Fs.PhotoShoot,this.tempStyles=[],this.selfie=!1,this.styleImageUrl="",this.imgStrength=100,this.aiPatterns=[],this.storeProducts=[],this.prompts=[],this.pageNumber=0,this.activeAccPanelId="panel-2",this.customPrompt="",this.isFocused=!1,this.genImageEvent=ne
1w e.bkB,this.btnText="Generate",this.disabled=!1,this.productId=0,this.isClick=!1,this.styleclick=!1,this.modelTypeId=0,this.user=this.authService.currentUser(),this.loggedInObserver=this.authService.loggedIn.subscribe(Y=>{this.user=this.authService.currentUser(),this.isProUser=this.aiPhotoService.isProUser()}),this.usrPropChangedObserver=this.authService.usrPropChanged.subscribe(Y=>{this.user=this.authService.currentUser(),this.isProUser=this.aiPhotoService.isProUser()}),this.changeWorkflowObserver=this.workflowUIService.changeWorkflowSubject.subscribe(Y=>{this.disabled=this.workflowUIService.isDisabled(this.productConfig,this.disabled)}),this.configSubs=this.paymentService.configUpdated.subscribe(()=>{this.config=this.paymentService?.config?.creditInfo})}ngOnInit(){[this.productId,this.productImageId]=this.aiPhotoService.getQueryParams(h.Fs.PhotoShoot),this.getCategoryDetails(),this.getPrompts(),this.getWorkflows()}onAccItemToggle(t,n){this.accPanelChanged({panelId:t,nextState:n}),n&&setTimeout(()=>{document.getElementById(t)?.scrollIntoView({behavior:"smooth",block:"center"})},100)}selectImage(t){if(t.productData){const n=t.productData;this.productId=n.productId,this.modelTypeId=n?.modelTypeId}this.productImageId=t.productImageId,this.selectedStyle.item=t,this.selectedStyle.isPrompt=!1,this.selectedStyle.isStyle=!0,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}selectPrompt(t){this.customPrompt=t.prompt,this.selectedStyle.item=t,this.selectedStyle.isPrompt=!0,this.selectedStyle.isStyle=!1,this.selectedStyle.item.imageJson=t.prompt,this.disabled=!this.customPrompt,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),setTimeout(()=>{this.isFocused=!1})}changePrompt(t){this.customPrompt=t,this.selectedStyle.item={imageJson:this.customPrompt},this.selectedStyle.item.customPrompt=this.customPrompt,this.disabled=!this.customPrompt.trim(),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}accPanelChanged(t){this.disabled=!1,this.selectedStyle=null,t.panelId&&(t.nextState&&"panel-1"==t.panelId?(t.isPrompt=!0,t.isStyle=!1,t.isWorkflow=!1,this.disabled=!this.customPrompt,this.activeAccPanelId=t.panelId):t.nextState&&"panel-2"==t.panelId?(this.disabled=!1,t.isStyle=!0,t.isPrompt=!1,t.isWorkflow=!1,this.activeAccPanelId=t.panelId):t.nextState&&"panel-3"==t.panelId?(this.disabled=!1,t.isStyle=!1,t.isPrompt=!1,t.isWorkflow=!0,this.activeAccPanelId=t.panelId,this.disabled=this.workflowUIService.isDisabled(this.productConfig,this.disabled)):(t.isPrompt=!1,t.isStyle=!1,this.activeAccPanelId="null",this.disabled=!0),this.selectedStyle||(this.selectedStyle=t),t.isStyle?(this.customPrompt=this.customPrompt,this.selectedStyle.item=this.storeProducts[0].storeProductImages[0],this.selectedStyle.displayName=this.storeProducts[0].displayName,this.productImageId=this.storeProducts[0].storeProductImages[0].productImageId,this.productId=this.storeProducts[0].productId,this.modelTypeId=this.storeProducts[0]?.modelTypeId?this.storeProducts[0]?.modelTypeId:0):t.isPrompt&&(this.selectedStyle.item={imageJson:this.customPrompt,customPrompt:this.customPrompt},this.productImageId=0,this.productId=0,this.selectedStyle.displayName=""),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle))}getCategoryDetails(){this.mediaContentService.getCategoryProductDetails(A.KK.AIPhotoShoot,this.pageNumber,t=>{if(t&&t.body){if(this.storeProducts=t.body.storeProducts,this.storeProducts&&this.storeProducts.length){if(this.productId){const a=this.storeProducts.findIndex(d=>d.productId==this.productId);if(-1!=a){let d=this.storeProducts[a];this.storeProducts.splice(a,1),this.storeProducts.splice(0,0,d)}}let n;const i=this.storeProducts[0].storeProductImages;if(this.productId=this.storeProducts[0].productId,this.modelTypeId=this.storeProducts[0]?.modelTypeId?this.storeProducts[0]?.modelTypeId:0,i?.length)if(this.productImageId){const a=i.findIndex(g=>g.productImageId==this.productImageId);n=i.find(g=>g.productImageId==this.productImageId)||i[0],this.productImageId=n.productImageId,n&&-1!=a&&(i.splice(a,1),i.splice(0,0,n))}else n=i[0],this.productImageId=n.productImageId;this.selectedStyle?(this.selectedStyle.item=n,this.selectedStyle.displayName=this.storeProducts[0].displayName?this.storeProducts[0].displayName:""):this.selectedStyle={item:n,isStyle:!0,isPrompt:!1,displayName:this.storeProducts[0].displayName?this.storeProducts[0].displayName:""}}this.selectedStyle&&(this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle))}this.isLoaded=!0,this.config=this.paymentService?.config?.creditInfo},t=>{this.isLoaded=!0})}getPrompts(){this.mediaContentService.getPrompts(A.Jl.Photoshoot,t=>{t&&(this.prompts=t.prompts)},t=>{})}focusIn(){this.isFocused=!0}onFocusOut(t){this.isFocused=t}focusOut(){this.isFocused=!1}generate(){if(this.aiPhotoService.isCancel)this.toast.showErrorSingle(x.b.message.uploadNewImage);else if(this.aiPhotoService.imgUrl){if(this.aiPhotoService.inProgress||!this.selectedStyle||this.aiPhotoService?.queryParams?.tab==h.Fs.PhotoShoot&&!this.selectedStyle.item)return;if(this.user&&this.user.remainingCoins>=this.config?.photoshoot){const t={imageUrl:this.aiPhotoService.imgUrl,featureType:h.Fs.PhotoShoot,...("panel-1"==this.activeAccPanelId||"panel-2"==this.activeAccPanelId)&&{...this.selectedStyle&&this.selectedStyle.item&&this.selectedStyle.item.imageJson&&{textPrompt:this.selectedStyle.item.imageJson},isCustomPrompt:this.selectedStyle&&this.selectedStyle.isPrompt?1:0,...this.aiWrapperRemoveBgService.removeBgResult&&this.aiWrapperRemoveBgService.removeBgResult.blobFile&&{maskContentType:this.aiWrapperRemoveBgService.removeBgResult.blobFile.type},...this.aiPhotoService.maskUrl&&{maskUrl:this.aiPhotoService.maskUrl},seed:this.selectedStyle.item?.seed?this.selectedStyle.item.seed.toString():"310980465",...this.productId&&{productId:this.productId},...this.productImageId&&{productImageId:this.productImageId},..."panel-1"==this.activeAccPanelId&&this.styleImageUrl&&{styleImageUrl:this.styleImageUrl},..."panel-1"==this.activeAccPanelId&&{styleStrength:this.styleImageUrl?this.imgStrength/100:0},..."panel-2"==this.activeAccPanelId&&this.modelTypeId&&{model:this.modelTypeId}}
1,..."panel-3"==this.activeAccPanelId&&{...this.productConfig?.modelTypeId&&{model:this.productConfig.modelTypeId},worksFlow:{...this.workflowUIService.getInputWorkflowData(this.productConfig),...this.productConfig?.workflowId&&{workflowId:this.productConfig.workflowId}}}},n=new FormData;!this.aiPhotoService.maskUrl&&this.aiWrapperRemoveBgService.removeBgResult&&this.aiWrapperRemoveBgService.removeBgResult.blob&&n.append("file",this.aiWrapperRemoveBgService.removeBgResult.blobFile),n.append("generateImageRequest",JSON.stringify(t)),this.aiPhotoService.inProgress=!0,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),this.aiPhotoService.generateImageWithMask(n,i=>{if(i&&i.assetId){i.maskUrl&&!this.aiPhotoService.maskUrl&&(this.aiPhotoService.maskUrl=i.maskUrl);const a=0;i.toolPrompt=this.aiPhotoService.textPrompt||this.selectedStyle?.item?.imageJson||"",i.featureType=h.Fs.PhotoShoot,i.toolName=x.b.label.aiPhotoshoot,i.width=Number(this.aiPhotoService.queryParams?._w),i.height=Number(this.aiPhotoService.queryParams?._h),i.activeSubTool=h.do.Product_Photoshoot,this.selectedStyle?.displayName?i.selectedStyle=this.selectedStyle.displayName:this.selectedStyle?.item?.displayName&&(i.selectedStyle=this.selectedStyle.item.displayName),this.aiPhotoService.checkStatus(i,a,d=>{d.urls&&d.urls.length>0&&(this.user.remainingCoins=d.remainingCalls,this.aiPhotoService.isDirty=!0,this.selectedStyle&&this.selectedStyle.item?this.selectedStyle.item.isGenerated=!0:"panel-3"==this.activeAccPanelId&&this.productConfig&&(this.productConfig.isGenerated=!0,this.btnText="Generate More"),d.maskUrl&&!i.maskUrl&&(this.aiPhotoService.maskUrl=d.maskUrl)),this.aiPhotoService.inProgress=!1,this.aiPhotoService.isRefined=!0,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)},d=>{this.displayErrorMsg(d)})}else this.displayErrorMsg(i)},i=>{this.displayErrorMsg(i)})}else this.aiPhotoService.openAICreditPopup(()=>{this.user=this.authService.currentUser(),this.isProUser=this.aiPhotoService.isProUser(),this.generate()},this.config?.photoshoot)}else this.aiPhotoService.inProgress=!0,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),this.aiPhotoService.updateImageUrl(this.aiPhotoService.originalImgUrl,h.Fs.PhotoShoot,h.do.Product_Photoshoot).then(t=>{this.aiPhotoService.queryParams=this.route.snapshot.queryParams,this.aiPhotoService.imgUrl=t?.imgUrl,this.generate()}).catch(()=>{this.aiPhotoService.inProgress=!1,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),this.toast.showErrorSingle(x.b.message.uploadNewImage)})}displayErrorMsg(t=null){this.aiPhotoService.inProgress=!1;let n=t?.description;this.createPopupService.openWarningDialog("Error",n),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}ngOnDestroy(){this.configSubs&&this.configSubs.unsubscribe(),this.loggedInObserver&&this.loggedInObserver.unsubscribe(),this.usrPropChangedObserver&&this.usrPropChangedObserver.unsubscribe(),this.changeWorkflowObserver&&this.changeWorkflowObserver.unsubscribe()}onFileUploaded(t){t&&(this.aiPhotoService.inProgress=!1,this.aiUploadImageService.aiUploadImage(t[0],{tab:"photoshoot",subTool:"product"}).then(a=>{a&&(this.styleImageUrl=a?.imgUrl)}))}addStyleImage(t){this.aiPhotoService.inProgress||t.click()}deleteStyleImage(){this.styleImageUrl="",this.imgStrength=100,this.disabled=!this.customPrompt}inputStrength(t,n){let i;i=t.newValue||0===t.newValue?t.newValue:t,this.imgStrength=i}popOvermouseleave(t){this.isClick||t.close()}hideStyleRefPopover(){this.popStylesReferenc1.isOpen&&this.popStylesReferenc1.close()}selectstyleRef(t){t.close?this.styleclick||(this.styleclick=!1,this.hideStyleRefPopover()):(this.styleclick=!0,this.popStylesReferenc1.open())}showStyleRefPopover(){this.popStylesReferenc1.close?(this.styleclick=!1,this.popStylesReferenc1.open()):this.popoverOpen&&(this.popStylesReferenc1.close(),this.styleclick=!1)}getWorkflows(){this.mediaContentService.getWorkflows(A.KK.ProductPhotoshootWorkflow,t=>{t&&(this.workflowList=t?.productConfig||[],this.workflowList?.length&&(this.productConfig=JSON.parse(JSON.stringify(this.workflowList[0])),this.workflowUIService.setFieldsValue(this.productC
1onfig)))},t=>{})}productConfigChange(t){this.productConfig=t}}return(r=l).\u0275fac=function(t){return new(t||r)(e.rXU(te.Z),e.rXU(N.u),e.rXU(U.s),e.rXU(ee),e.rXU(Q.A),e.rXU(y.nX),e.rXU(G.M),e.rXU(Se.b),e.rXU(C.f),e.rXU(K.W))},r.\u0275cmp=e.VBU({type:r,selectors:[["product-photoshoot-drawer"]],viewQuery:function(t,n){if(1&t&&(e.GBs(In,5),e.GBs(xn,5),e.GBs(Mn,5)),2&t){let i;e.mGM(i=e.lsd())&&(n.popoverOpen=i.first),e.mGM(i=e.lsd())&&(n.popStylesReferenc1=i.first),e.mGM(i=e.lsd())&&(n.p=i.first)}},inputs:{toolName:"toolName",aiPhotoheader:"aiPhotoheader"},outputs:{genImageEvent:"genImageEvent"},decls:21,vars:6,consts:[["popContent",""],["popStylesReferenc",""],["popOver","ngbPopover"],["popStylesReferenc1","ngbPopover"],["file",""],[3,"toolName"],[1,"position-relative","mt-3"],[1,"scroll-content","drawer-elements","ai-drawer-elements"],[4,"ngIf"],[1,"position-absolute","fixed-bottom","pb-1","pt-2","ps-3","pe-3","bg-white"],[1,"d-flex","align-items-center","justify-content-center","w-100","mb-1"],["id","gtm-generate",1,"btn","btn-primary-gradient","text-13","btn-h40","w-100","d-flex","align-items-center","justify-content-center",3,"click","disabled"],["class","spinner-border spinner-border-lg me-2 hw-24","role","status",4,"ngIf"],[1,"text-13"],[1,"credit-description","d-flex","align-items-center","justify-content-center","w-100"],[1,"f-12"],[1,"ms-2","me-2"],["src","https://static.lightxeditor.com/assets/images/coin-lottie-s-anim.gif","width","24px","height","24px","alt","Coin Lottie"],[1,"common-container","m-0","p-0","editor-tool-panel"],[1,"d-flex","w-100","flex-column","ngb-btn"],["ngbAccordion","",3,"closeOthers"],["ngbAccordionItem","panel-1",1,"tab-div",3,"shown","hidden","collapsed"],["ngbAccordionHeader",""],[1,"d-flex","align-items-center","wp-100"],["type","button","ngbAccordionButton","",1,"btn-acc-title"],[1,"m-0","btn","btn-link","card-title","ms-3"],["type","button","ngbAccordionButton","",1,"btn-collapse","p-0"],[1,"collapse-text","btn-link"],["name","collapseAcc",1,"f-24"],[1,"expand-text"],["name","expandAcc",1,"f-24"],["ngbAccordionCollapse",""],["ngbAccordionBody",""],["ngbAccordionItem","panel-3","class","tab-div",3,"collapsed","shown","hidden",4,"ngIf"],["ngbAccordionItem","panel-2",1,"tab-div",3,"shown","hidden","collapsed"],["name","helpicon","placement","right","popoverClass","pop-for-tooltip","ngbPopover","Choose from a collection of predefined artistic effects and aesthetics that can be applied to your generated image.","triggers","mouseenter:mouseleave","popoverTitle","Presets","container","body",1,"ms-1","hw-24","help-icon",3,"mouseenter"],[1,"wp-100","d-flex","align-items-center","justify-content-between","ps-3","pe-2"],[1,"text-13","text-dark","text-semi","text-semi"],["name","helpicon","placement","right","popoverClass","pop-for-tooltip","ngbPopover","Provide a text description about the subject, style, setting and any other specific element guiding the AI to understand the exact image you want generated.","triggers","mouseenter:mouseleave","popoverTitle","Enter Prompt","container","body",1,"ms-1","hw-24","help-icon",3,"mouseenter"],["placement","right","ngbTooltip","Suggested Prompt","tooltipClass","tooltip-custom-all","container","body",1,"lampIcon","hw-40",2,"margin-right","5px"],["name","lampicon","placement","right","container","body","popoverClass","background-prompt",1,"pointer","f-24","lampicon",3,"autoClose","ngbPopover"],[1,"common-container"],[1,"card","drawer-card","mb-2"],[1,"card-body"],[1,"btn-panel"],[1,"card-body","prompt-view"],[1,"textarea-col","position-relative",3,"ngClass"],[1,"text-animation",3,"changePrompt","focusOut","prompts","textPrompt"],["class","prompt-info text-regular position-absolute d-flex align-items-center justify-content-start",4,"ngIf"],["class","d-flex align-items-center h-40 mb-1 mt-8",4,"ngIf"],["class","mt-8 mb-1",4,"ngIf"],[1,"prompt-info","text-regular","position-absolute","d-flex","align-items-center","justify-content-start"],[1,"d-flex","align-items-center","h-40","mb-1","mt-8"],[1,"w-100"],["name","helpicon","placement","right","container","body","popoverClass","background-style pt-0 pb-3 style-ref-pop-height h-auto background-prompt-popover","autoClose","outside",1,"ms-1","help-icon",3,"mouseenter","mouseleave","ngbPopover"],["id","guidance",1,"editor-toggle","deleteBtn",3,"hidden"],["name","addguide","id","guidance","placement","right","container","body","popoverClass","background-prompt guideance-popover p-0 h-auto",1,"pointer","f-24","grey-600",2,"margin-right","5px",3,"click"],["id","fileInputId","name","fileInputId","type","file",1,"custom-file-input","d-none",3,"change","click","accept"],[1,"mt-8","mb-1"],[1,"text-13","text-dark","text-semi","text-semi","p-2","ps-0","pe-0"],[1,"d-flex","align-items-center","justify-content-between"],["width","52px","height","52px",1,"thumbBoxBg","border-radius-8",3,"src"],[1,"text-sm","text-semi","text-dark","ms-2"],[1,"d-flex",2,"margin-right","1px"],[1,"styleIconBg","hw-32","d-flex","align-items-center","justify-content-center",3,"click"],["name","replace",1,"f-20"],[1,"styleIconBg","hw-32","d-flex","align-items-center","justify-content-center","ms-2",3,"click"],["name","deletecommon",1,"f-20"],[1,"d-flex","w-100","flex-column","prompt-view","mt-9","mb-1"],[1,"d-flex","align-items-center","justify-content-between","wp-100","mb-1","h-40"],["name","helpicon","placement","right","popoverClass","pop-for-tooltip","ngbPopover","Higher style strength makes the generated image look more like your reference, while lower strength makes it look less similar.","triggers","mouseenter:mouseleave","popoverTitle","Style Strength","container","body",1,"ms-1","hw-24","help-icon"],[1,"d-inline-flex","align-items-center","justify-content-between"],[1,"col-sm-9","p-0"],[1,"opacity-slider",2,"width","100%",3,"change","slideStop","value","min","max","step"],[1,"col-sm-2","p-0"],["type","text","numberSettings","","separatorLimit","100",1,"form-control","form-input-sm","text-normal","text-black","float-end",3,"ngModelChange","min","max","ngModel"],["ngbAccordionItem","panel-3",1,"tab-div",3,"shown","hidden","collapsed"],[1,"card","drawer-card","mb-0","mt-2"],[3,"productC
1onfigChange","productConfig","workflowList","inProgress"],[3,"selectStyleEvent","type","storeProducts","productId","productImageId"],[1,"d-flex","backgound-content","portrait-content","mt-1",2,"padding","0px 7px"],[2,"padding","0px 5px",3,"view"],["role","status",1,"spinner-border","spinner-border-lg","me-2","hw-24"],[1,"sr-only","text-nowrap","border-0","position-absolute","overflow-hidden"],[3,"selectPrompt","items"],[3,"selectstyleRef","editorType","editorSubTool"]],template:function(t,n){if(1&t){const i=e.RV6();e.nrm(0,"app-file-upload",5),e.j41(1,"div",6)(2,"div",7),e.DNE(3,An,34,4,"ng-container",8),e.k0s(),e.j41(4,"div",9)(5,"div",10)(6,"button",11),e.bIt("click",function(){return e.eBV(i),e.Njj(n.generate())}),e.DNE(7,Bn,3,0,"div",12),e.j41(8,"span",13),e.EFF(9),e.k0s()()(),e.j41(10,"div",14)(11,"span",15),e.EFF(12,"1 generation ="),e.k0s(),e.j41(13,"span",16),e.nrm(14,"img",17),e.k0s(),e.j41(15,"span",15),e.EFF(16),e.k0s()()()(),e.DNE(17,Gn,1,1,"ng-template",null,0,e.C5r)(19,jn,1,2,"ng-template",null,1,e.C5r)}2&t&&(e.Y8G("toolName",n.toolName),e.R7$(3),e.Y8G("ngIf",n.isLoaded),e.R7$(3),e.Y8G("disabled",n.disabled),e.R7$(),e.Y8G("ngIf",n.aiPhotoService.inProgress),e.R7$(2),e.JRh(n.aiPhotoService.inProgress?"Processing":n.btnText),e.R7$(7),e.SpI("",null==n.config?null:n.config.photoshoot," credit"))},dependencies:[s.YU,s.bT,ae.n,Oe.I,f.WP,f.r6,f.tW,f.x7,f.UA,f.$R,f.ZM,f.md,u.me,u.BC,u.vS,L.b,Ce.d1,ue.k,Te,oe.t,De.d,re.P,be.e],styles:['.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]{width:100%;height:110px;border-radius:12px;background:linear-gradient(90deg,#fc5cff05 -4%,#2520f605);padding:.9px 4px 4px}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#c9cad4 -4% 100%);-webkit-mask:linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%) content-box,linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%);-webkit-mask-composite:xor;mask-composite:exclude;z-index:1}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]:hover:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#606576 -4% 100%);-webkit-mask:linear-gradient(90deg,#606576 -4%,#606576 100%) content-box,linear-gradient(90deg,#606576 -4%,#606576 100%);-webkit-mask-composite:xor;mask-composite:exclude;z-index:1}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{resize:none;outline:none;width:100%;height:82px;padding:8px 8px 0;font-size:12px;color:#b0b3bf;border:0px;background:transparent;line-height:18px;position:relative;z-index:2}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar{width:4px;height:4px;border-radius:12px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#e3e3e3;border-radius:12px;margin-top:8px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#9a9a9a;border-radius:12px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:#555}.prompt-view[_ngcontent-%COMP%] .prompt-info[_ngcontent-%COMP%]{font-size:11px;color:#959aa7;margin-top:0;padding-left:8px;height:24px;line-height:normal;width:calc(100% - 8px);bottom:4px;z-index:99}.info-up[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#c9cad4 -4% 100%)!important;-webkit-mask:linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%) content-box,linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-blue[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff0d -4%,#2520f60d)!important}.info-blue[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#fc5cff -4%,#2520f6)!important;-webkit-mask:linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%) content-box,linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-blue[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#626adf!important}.info-red[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff0d -4%,#2520f60d)!important}.info-red[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#f25555 -4% 100%)!important;-webkit-mask:linear-gradient(90deg,#F25555 -4%,#F25555 100%) content-box,linear-gradient(90deg,#F25555 -4%,#F25555 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-red[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#f25555!important}.fixed-bottom[_ngcontent-%COMP%]{position:fixed!important;width:300px!important;right:auto!important;left:5rem;z-index:99}.thumbBoxBg[_ngcontent-%COMP%]{object-fit:contain;background:#e2e3e9}.styleIconBg[_ngcontent-%COMP%]{border-radius:8px;background:transparent;cursor:pointer}.styleIconBg[_ngcontent-%COMP%]:hover{background:#626adf0d}']}),l})();var Pe=c(36561);const Nn=["p"],Ln=(r,l,o)=>({"info-up":r,"info-blue":l,"info-red":o});function Wn(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",13)(1,"div",14)(2,"buttons-scroll-menu",15),e.bIt("selectLayout",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.selectFilterProd(n))}),e.k0s()()()}if(2&r){const o=e.XpG();e.R7$(2),e.Y8G("items",o.categories)("type","aiFilter")("categoryId",o.categoryId)}}function Vn(r,l){if(1&r){const o=e.RV6();e.j41(0,"text-prompt-animation",45),e.bIt("changePrompt",function(n){e.eBV(o);const i=e.XpG(3);return e.Njj(i.changePrompt(n))})("focusOut",function(n){e.eBV(o);const i=e.XpG(3);return e.Njj(i.onFocusOut(n))}),e.k0s()}if(2&r){const o=e.XpG(3);e.Y8G("prompts",o.prompts)("textPrompt",o.customPrompt)}}function Xn(r,l){if(1&r&&(e.j41(0,"span",46),e.EFF(1),e.k0s()),2&r){const o=e.XpG(3);e.R7$(),e.SpI("",o.customPrompt.length,"/450")}}function Kn(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",47)(1,"buttons-scroll-menu",48),e.bIt("selectLayout",function(n){e.eBV(o);const i=e.XpG(3);return e.Njj(i.selectPrompt(n))}),e.k0s()()}if(2&r){const o=e.XpG(3);e.R7$(),e.Y8G("items",o.prompts)("type","prompt")}}function $n(r,l){if(1&r&&(e.j41(0,"div",35)(1,"div",36)(2,"div",37)(3,"div",38)(4,"div",39)(5,"div",40),e.DNE(6,Vn,1,2,"text-prompt-animation",41)(7,Xn,2,1,"span",42),e.k0s(),e.j41(8,"div",43),e.DNE(9,Kn,2,2,"div",44),e.k0s()()()()()()),2&r){const o=e.XpG(2);e.R7$(5),e.Y8G("ngClass",e.sMw(4,Ln,o.customPrompt.length,o.isFocused,o.customPrompt.length>449)),e.R7$(),e.Y8G("ngIf",o.isPromptLoaded),e.R7$(),e.Y8G("ngIf",o.customPrompt.length),e.R7$(2),e.Y8G("ngIf",o.isPromptLoaded)}}function Yn(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",35)(1,"div",50)(2,"div",37)(3,"div",38)(4,"div",37)(5,"workflow-ui",51),e.mxI("productC
1onfigChange",function(n){e.eBV(o);const i=e.XpG(3);return e.DH7(i.productConfig,n)||(i.productConfig=n),e.Njj(n)}),e.bIt("productConfigChange",function(n){e.eBV(o);const i=e.XpG(3);return e.Njj(i.productConfigChange(n))}),e.k0s()()()()()()}if(2&r){const o=e.XpG(3);e.R7$(5),e.R50("productConfig",o.productConfig),e.Y8G("workflowList",o.workflowList)("inProgress",o.aiPhotoService.inProgress)}}function zn(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",49),e.bIt("shown",function(){e.eBV(o);const n=e.XpG(2);return e.Njj(n.onAccItemToggle("panel-3",!0))})("hidden",function(){e.eBV(o);const n=e.XpG(2);return e.Njj(n.onAccItemToggle("panel-3",!1))}),e.j41(1,"div",20)(2,"div",21)(3,"button",22)(4,"div",23),e.EFF(5,"Workflow "),e.k0s()(),e.j41(6,"button",25)(7,"span",26),e.nrm(8,"pi",27),e.k0s(),e.j41(9,"span",28),e.nrm(10,"pi",29),e.k0s()()()(),e.j41(11,"div",30)(12,"div",31),e.DNE(13,Yn,6,3,"ng-template"),e.k0s()()()}if(2&r){const o=e.XpG(2);e.Y8G("collapsed","panel-3"!==o.activeAccPanelId)}}function qn(r,l){if(1&r){const o=e.RV6();e.qex(0),e.j41(1,"preset-style",52),e.bIt("selectStyleEvent",function(n){e.eBV(o);const i=e.XpG(3);return e.Njj(i.selectImage(n))}),e.k0s(),e.bVm()}if(2&r){const o=e.XpG(3);e.R7$(),e.Y8G("type","category")("storeProducts",o.storeProducts)("productImageId",o.productImageId)}}function Hn(r,l){1&r&&(e.qex(0),e.j41(1,"div",53),e.nrm(2,"element-placeholder",54),e.k0s(),e.bVm()),2&r&&(e.R7$(2),e.Y8G("view","AiPatterns"))}function Jn(r,l){if(1&r&&e.DNE(0,qn,2,3,"ng-container",3)(1,Hn,3,1,"ng-container",3),2&r){const o=e.XpG(2);e.Y8G("ngIf",o.storeProducts.length),e.R7$(),e.Y8G("ngIf",!o.isLoaded)}}function Qn(r,l){if(1&r){const o=e.RV6();e.qex(0),e.j41(1,"div",16)(2,"div",17)(3,"div",18)(4,"div",19),e.bIt("shown",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.onAccItemToggle("panel-1",!0))})("hidden",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.onAccItemToggle("panel-1",!1))}),e.j41(5,"div",20)(6,"div",21)(7,"button",22)(8,"div",23),e.EFF(9,"Enter Prompt"),e.nrm(10,"pi",24),e.k0s()(),e.j41(11,"button",25)(12,"span",26),e.nrm(13,"pi",27),e.k0s(),e.j41(14,"span",28),e.nrm(15,"pi",29),e.k0s()()()(),e.j41(16,"div",30)(17,"div",31),e.DNE(18,$n,10,8,"ng-template"),e.k0s()()(),e.DNE(19,zn,14,1,"div",32),e.j41(20,"div",33),e.bIt("shown",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.onAccItemToggle("panel-2",!0))})("hidden",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.onAccItemToggle("panel-2",!1))}),e.j41(21,"div",20)(22,"div",21)(23,"button",22)(24,"div",23),e.EFF(25,"Presets"),e.nrm(26,"pi",34),e.k0s()(),e.j41(27,"button",25)(28,"span",26),e.nrm(29,"pi",27),e.k0s(),e.j41(30,"span",28),e.nrm(31,"pi",29),e.k0s()()()(),e.j41(32,"div",30)(33,"div",31),e.DNE(34,Jn,2,2,"ng-template"),e.k0s()()()()()(),e.bVm()}if(2&r){const o=e.XpG();e.R7$(3),e.Y8G("closeOthers",!0),e.R7$(),e.Y8G("collapsed","panel-1"!==o.activeAccPanelId),e.R7$(15),e.Y8G("ngIf",o.productConfig&&283==o.categoryId),e.R7$(),e.Y8G("collapsed","panel-2"!==o.activeAccPanelId)}}function Zn(r,l){1&r&&(e.j41(0,"div",55)(1,"span",56),e.EFF(2,"Loading..."),e.k0s()())}function eo(r,l){if(1&r){const o=e.RV6();e.j41(0,"ai-prompts-popover",57),e.bIt("selectPrompt",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.selectPrompt(n))}),e.k0s()}if(2&r){const o=e.XpG();e.Y8G("items",o.prompts)}}let to=(()=>{var r;class l{constructor(t,n,i,a,d,g,m,b,O){this.mediaContentService=t,this.authService=n,this.aiPhotoService=i,this.createPopupService=a,this.route=d,this.aiUploadImageService=g,this.workflowUIService=m,this.paymentService=b,this.toast=O,this.toolName=h.Fs.PersonPhotoshoot,this.aiPatterns=[],this.categoryId=A.KK.AIMixPer
1sonPhotoshoot,this.categories=[{id:1,displayName:"Mixed",categoryId:A.KK.AIMixPersonPhotoshoot,aiType:33,modelTypeId:66},{id:2,displayName:"Background",categoryId:A.KK.AIBackground,aiType:6,modelTypeId:44},{id:3,displayName:"Outfit",categoryId:A.KK.AIOutFit,aiType:8,modelTypeId:47},{id:4,displayName:"Face",categoryId:A.KK.AIFace,aiType:10,modelTypeId:46},{id:5,displayName:"Hair",categoryId:A.KK.AIHair,aiType:7,modelTypeId:45}],this.storeProducts=[],this.prompts=[],this.pageNumber=0,this.activeAccPanelId="panel-2",this.customPrompt="",this.isFocused=!1,this.genImageEvent=new e.bkB,this.btnText="Generate",this.disabled=!1,this.productId=0,this.modelTypeId=66,this.isPromptLoaded=!1,this.workflowList=[],this.user=this.authService.currentUser(),this.loggedInObserver=this.authService.loggedIn.subscribe(E=>{this.user=this.authService.currentUser(),this.isProUser=this.aiPhotoService.isProUser()}),this.usrPropChangedObserver=this.authService.usrPropChanged.subscribe(E=>{this.user=this.authService.currentUser(),this.isProUser=this.aiPhotoService.isProUser()}),this.changeWorkflowObserver=this.workflowUIService.changeWorkflowSubject.subscribe(E=>{this.disabled=this.workflowUIService.isDisabled(this.productConfig,this.disabled)}),this.configSubs=this.paymentService.configUpdated.subscribe(()=>{this.config=this.paymentService?.config?.creditInfo})}ngOnInit(){let t=A.Jl.Mixed,n=0;if([this.productId,this.productImageId,n]=this.aiPhotoService.getQueryParams(h.Fs.PhotoShoot),n){this.categoryId=n;const i=this.categories.find(a=>a.categoryId===this.categoryId);i&&(t=i.aiType)}this.getCategoryDetails(this.categoryId,t,()=>{this.isPromptLoaded=!0,this.config=this.paymentService?.config?.creditInfo}),this.getWorkflows()}onAccItemToggle(t,n){this.accPanelChanged({panelId:t,nextState:n}),n&&setTimeout(()=>{document.getElementById(t)},100)}selectImage(t){if(t.productData){const n=t.productData;this.productId=n.productId,this.modelTypeId=n?.modelTypeId}this.productImageId=t.productImageId,this.selectedStyle.item=t,this.selectedStyle.isPrompt=!1,this.selectedStyle.isStyle=!0,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}selectPrompt(t){this.customPrompt=t.prompt,this.selectedStyle.item=t,this.selectedStyle.isPrompt=!0,this.selectedStyle.isStyle=!1,this.selectedStyle.item.imageJson=t.prompt,this.disabled=!this.customPrompt,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),setTimeout(()=>{this.isFocused=!1})}selectFilterProd(t){t&&(this.categoryId=t.categoryId,this.activeAccPanelId||(this.activeAccPanelId="panel-2"),"panel-2"==this.activeAccPanelId?this.disabled=!1:(this.customPrompt="",this.selectedStyle.item={imageJson:this.customPrompt,customPrompt:this.customPrompt},this.productImageId=0,this.disabled=!0,this.productId=0),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),this.isPromptLoaded=!1,this.prompts=[],this.getCategoryDetails(this.categoryId,t.aiType,()=>{this.isPromptLoaded=!0,setTimeout(()=>{document.getElementById("personphotoshoot")},0)}))}smoothScrollTo(t,n,i){const a=t.scrollTop,d=n-a,g=performance.now(),m=b=>{const E=Math.min((b-g)/i,1);t.scrollTop=a+d*(E*(2-E)),E<1&&requestAnimationFrame(m)};requestAnimationFrame(m)}changePrompt(t){this.customPrompt=t,this.selectedStyle.item={imageJson:this.customPrompt},this.selectedStyle.item.customPrompt=this.customPrompt,this.disabled=!this.customPrompt.trim(),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}accPanelChanged(t){this.disabled=!1,this.selectedStyle=null,t.panelId&&(t.nextState&&"panel-1"==t.panelId?(t.isPrompt=!0,t.isStyle=!1,t.isWorkflow=!1,this.disabled=!this.customPrompt,this.activeAccPanelId=t.panelId):t.nextState&&"panel-2"==t.panelId?(this.disabled=!1,t.isStyle=!0,t.isPrompt=!1,t.isWorkflow=!1,this.activeAccPanelId=t.panelId):t.nextState&&"panel-3"==t.panelId?(this.disabled=!1,t.isStyle=!1,t.isPrompt=!1,t.isWorkflow=!0,this.activeAccPanelId=t.panelId,this.disabled=this.workflowUIService.isDisabled(this.productConfig,this.disabled)):(t.isPrompt=!1,t.isStyle=!1,t.isWorkflow=!1,this.activeAccPanelId="",this.disabled=!0),this.selectedStyle||(this.selectedStyle=t),t.isStyle?(this.customPrompt=this.customPrompt,this.selectedFilters&&
1(this.selectedStyle.item=this.selectedFilters.storeProductImages[0],this.selectedStyle.displayName=this.storeProducts[0].displayName?this.storeProducts[0].displayName:"",this.productImageId=this.selectedFilters.storeProductImages[0].productImageId,this.productId=this.selectedFilters.productId,this.modelTypeId=this.selectedFilters?.modelTypeId)):t.isPrompt&&(this.selectedStyle.item={imageJson:this.customPrompt,customPrompt:this.customPrompt},this.productImageId=0,this.productId=0,this.selectedStyle.displayName=""),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle))}getCategoryDetails(t,n,i=null){this.mediaContentService.getCategoryProductDetails(t,this.pageNumber,a=>{if(a&&a.body)if(this.storeProducts=a.body.storeProducts,this.storeProducts.length){this.selectedFilters=this.productId&&this.storeProducts.filter(m=>m.productId==this.productId).length>0?this.storeProducts.filter(m=>m.productId==this.productId)[0]:this.storeProducts[0],this.productImageId=this.productImageId&&this.selectedFilters?.storeProductImages.find(m=>m.productImageId==this.productImageId)?.productImageId?this.selectedFilters?.storeProductImages.find(m=>m.productImageId==this.productImageId)?.productImageId:this.selectedFilters?.storeProductImages[0]?.productImageId,this.productId=this.selectedFilters.productId,this.modelTypeId=this.selectedFilters?.modelTypeId,this.aiType=n,this.getPrompts(n,i);const d=this.selectedFilters?.storeProductImages.findIndex(m=>m.productImageId==this.productImageId)||-1;if(-1!=d){const m=this.selectedFilters?.storeProductImages[d]||this.selectedFilters?.storeProductImages[0];this.selectedFilters?.storeProductImages.splice(d,1),this.selectedFilters?.storeProductImages.splice(0,0,m)}const g=this.selectedFilters?.storeProductImages[0]?this.selectedFilters?.storeProductImages[0]:this.storeProducts[0].storeProductImages[0];this.selectedStyle?(this.selectedStyle.item=g,this.selectedStyle.displayName=g.displayName?g.displayName:this.storeProducts[0].displayName?this.storeProducts[0].displayName:""):this.selectedStyle={item:g,isStyle:!0,isPrompt:!1,displayName:this.storeProducts[0].displayName?this.storeProducts[0].displayName:""},this.selectedStyle&&(this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle))}else i&&i();setTimeout(()=>{this.isLoaded=!0,this.onPanelScroll()},200)},a=>{this.isLoaded=!0})}onPanelScroll(){setTimeout(()=>{document.getElementById(this.productId.toString())},100)}getPrompts(t,n){this.mediaContentService.getPrompts(t,i=>{i&&(this.prompts=i.prompts,n&&n())},i=>{n&&n()})}focusIn(){this.isFocused=!0}onFocusOut(t){this.isFocused=t}focusOut(){this.isFocused=!1}generate(){if(this.aiPhotoService.isCancel)this.toast.showErrorSingle(x.b.message.uploadNewImage);else if(this.aiPhotoService.imgUrl){if(this.aiPhotoService.inProgress||!this.selectedStyle)return;if(this.user&&this.user.remainingCoins>=this.config?.modelphotoshoot){const t={imageUrl:this.aiPhotoService.imgUrl,featureType:h.Fs.PersonPhotoshoot,...("panel-1"==this.activeAccPanelId||"panel-2"==this.activeAccPanelId)&&{...this.selectedStyle&&this.selectedStyle.item&&this.selectedStyle.item.imageJson&&{textPrompt:this.selectedStyle.item.imageJson},isCustomPrompt:this.selectedStyle&&this.selectedStyle.isPrompt?1:0,model:"panel-1"==this.activeAccPanelId&&this.categoryId==A.KK.AIMixPer
1sonPhotoshoot?A.e3.CustomPromptMixed:this.modelTypeId,faceImageUrl:this.aiPhotoService.imgUrl,...this.productId&&{productId:this.productId},...this.productImageId&&{productImageId:this.productImageId}},..."panel-3"==this.activeAccPanelId&&{...this.productConfig?.modelTypeId&&{model:this.productConfig.modelTypeId},worksFlow:{...this.workflowUIService.getInputWorkflowData(this.productConfig),...this.productConfig?.workflowId&&{workflowId:this.productConfig.workflowId}}}};this.aiPhotoService.inProgress=!0,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),this.aiPhotoService.generateImage(t,n=>{n&&n.assetId?(n.toolPrompt=this.aiPhotoService.textPrompt||this.selectedStyle?.item?.imageJson||"",n.featureType=h.Fs.PhotoShoot,n.toolName=x.b.label.aiPhotoshoot,n.width=Number(this.aiPhotoService.queryParams?._w),n.height=Number(this.aiPhotoService.queryParams?._h),n.activeSubTool=h.do.Person_Photoshoot,this.selectedStyle?.displayName?n.selectedStyle=this.selectedStyle.displayName:this.selectedStyle?.item?.displayName&&(n.selectedStyle=this.selectedStyle.item.displayName),this.aiPhotoService.checkStatus(n,0,a=>{a.urls&&a.urls.length>0&&(a.toolPrompt=a?.prompt,this.user.remainingCoins=a.remainingCalls,this.aiPhotoService.isDirty=!0,this.selectedStyle&&this.selectedStyle?.item?this.selectedStyle.item.isGenerated=!0:"panel-3"==this.activeAccPanelId&&this.productConfig&&(this.productConfig.isGenerated=!0,this.btnText="Generate More")),this.aiPhotoService.inProgress=!1,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)},a=>{this.displayErrorMsg(a)})):this.displayErrorMsg(n)},n=>{this.displayErrorMsg(n)})}else this.aiPhotoService.openAICreditPopup(()=>{this.user=this.authService.currentUser(),this.isProUser=this.aiPhotoService.isProUser(),this.generate()},this.config?.modelphotoshoot)}else this.aiPhotoService.inProgress=!0,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),this.aiPhotoService.updateImageUrl(this.aiPhotoService.originalImgUrl,h.Fs.PhotoShoot,h.do.Person_Photoshoot).then(t=>{this.aiPhotoService.queryParams=this.route.snapshot.queryParams,this.aiPhotoService.imgUrl=t.imgUrl,this.generate()}).catch(()=>{this.aiPhotoService.inProgress=!1,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),this.toast.showErrorSingle(x.b.message.uploadNewImage)})}displayErrorMsg(t=null){this.aiPhotoService.inProgress=!1;let n=t?.description;this.createPopupService.openWarningDialog("Error",n),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}ngOnDestroy(){this.configSubs&&this.configSubs.unsubscribe(),this.loggedInObserver&&this.loggedInObserver.unsubscribe(),this.usrPropChangedObserver&&this.usrPropChangedObserver.unsubscribe(),this.changeWorkflowObserver&&this.changeWorkflowObserver.unsubscribe()}getWorkflows(){this.mediaContentService.getWorkflows(this.categoryId,t=>{t&&(this.workflowList=t?.productConfig||[],this.workflowList?.length&&(this.productConfig=JSON.parse(JSON.stringify(this.workflowList[0])),this.workflowUIService.setFieldsValue(this.productConfig)))},t=>{})}productConfigChange(t){this.productConfig=t}}return(r=l).\u0275fac=function(t){return new(t||r)(e.rXU(te.Z),e.rXU(N.u),e.rXU(U.s),e.rXU(Q.A),e.rXU(y.nX),e.rXU(G.M),e.rXU(Se.b),e.rXU(K.W),e.rXU(C.f))},r.\u0275cmp=e.VBU({type:r,selectors:[["person-photoshoot-drawer"]],viewQuery:function(t,n){if(1&t&&e.GBs(Nn,5),2&t){let i;e.mGM(i=e.lsd())&&(n.p=i.first)}},inputs:{toolName:"toolName",imgUrl:"imgUrl",aiPhotoheader:"aiPhotoheader"},outputs:{genImageEvent:"genImageEvent"},decls:18,vars:7,consts:[["popContent",""],[3,"toolName"],["class","d-flex align-items-center justify-content-center bg-white filter-category",4,"ngIf"],[4,"ngIf"],[1,"position-absolute","fixed-bottom","pb-1","pt-2","ps-3","pe-3","bg-white"],[1,"d-flex","align-items-center","justify-content-center","w-100","mb-1"],["id","gtm-generate",1,"btn","btn-primary-gradient","text-13","btn-h40","w-100","d-flex","align-items-center","justify-content-center",3,"click","disabled"],["class","spinner-border spinner-border-lg me-2 hw-24","role","status",4,"ngIf"],[1,"text-13"],[1,"credit-description","d-flex","align-items-center","justify-content-center","w-100"],[1,"f-12"],[1,"ms-2","me-2"],["src","https://static.lightxeditor.com/assets/images/coin-lottie-s-anim.gif","width","24px","height","24px","alt","Coin Lottie"],[1,"d-flex","align-items-center","justify-content-center","bg-white","filter-category"],[1,"colors-bg","sticker-buttons-scroll","scrollWidth-300"],[3,"selectLayout","items","type","categoryId"],[1,"common-container","m-0","p-0","editor-tool-panel","mt-3"],[1,"d-flex","w-100","flex-column","ngb-btn"],["ngbAccordion","",3,"closeOthers"],["ngbAccordionItem","panel-1",1,"tab-div",3,"shown","hidden","collapsed"],["ngbAccordionHeader",""],[1,"d-flex","align-items-center","wp-100"],["type","button","ngbAccordionButton","",1,"btn-acc-title"],[1,"m-0","btn","btn-link","card-title","ms-3"],["name","helpicon","placement","right","popoverClass","pop-for-tooltip","ngbPopover","Provide a text description about the subject, style, setting and any other specific element guiding the AI to understand the exact image you want generated.","triggers","mouseenter:mouseleave","popoverTitle","Enter Prompt","container","body",1,"ms-1","hw-24","help-icon"],["type","button","ngbAccordionButton","",1,"btn-collapse","p-0"],[1,"collapse-text","btn-link"],["name","collapseAcc",1,"f-24"],[1,"expand-text"],["name","expandAcc",1,"f-24"],["ngbAccordionCollapse",""],["ngbAccordionBody",""],["ngbAccordionItem","panel-3","class","tab-div",3,"collapsed","shown","hidden",4,"ngIf"],["ngbAccordionItem","panel-2",1,"tab-div",3,"shown","hidden","collapsed"],["name","helpicon","placement","right","popoverClass","pop-for-tooltip","ngbPopover","Choose from a collection of predefined artistic effects and aesthetics that can be applied to your generated image.","triggers","mouseenter:mouseleave","popoverTitle","Presets","container","body",1,"ms-1","hw-24","help-icon"],[1,"common-container"],[1,"card","drawer-card","mb-2"],[1,"card-body"],[1,"btn-panel"],[1,"card-body","prompt-view"],[1,"textarea-col","position-relative",3,"ngClass"],["class","text-animation",3,"prompts","textPrompt","changePrompt","focusOut",4,"ngIf"],["class","prompt-info text-regular position-absolute d-flex align-items-center justify-content-start",4,"ngIf"],[1,"d-flex","document-color","mt-2"],["class","colors-bg sticker-buttons-scroll inner-buttons-scroll",4,"ngIf"],[1,"text-animation",3,"changePrompt","focusOut","prompts","textPrompt"],[1,"prompt-info","text-regular","position-absolute","d-flex","align-items-center","justify-content-start"],[1,"colors-bg","sticker-buttons-scroll","inner-buttons-scroll"],[3,"selectLayout","items","type"],["ngbAccordionItem","panel-3",1,"tab-div",3,"shown","hidden","collapsed"],[1,"card","drawer-card","mb-0"],[3,"productC
1onfigChange","productConfig","workflowList","inProgress"],[3,"selectStyleEvent","type","storeProducts","productImageId"],[1,"d-flex","backgound-content","portrait-content","mt-1",2,"padding","0px 7px"],[2,"padding","0px 5px",3,"view"],["role","status",1,"spinner-border","spinner-border-lg","me-2","hw-24"],[1,"sr-only","text-nowrap","border-0","position-absolute","overflow-hidden"],[3,"selectPrompt","items"]],template:function(t,n){if(1&t){const i=e.RV6();e.nrm(0,"app-file-upload",1),e.DNE(1,Wn,3,3,"div",2)(2,Qn,35,4,"ng-container",3),e.j41(3,"div",4)(4,"div",5)(5,"button",6),e.bIt("click",function(){return e.eBV(i),e.Njj(n.generate())}),e.DNE(6,Zn,3,0,"div",7),e.j41(7,"span",8),e.EFF(8),e.k0s()()(),e.j41(9,"div",9)(10,"span",10),e.EFF(11,"1 generation ="),e.k0s(),e.j41(12,"span",11),e.nrm(13,"img",12),e.k0s(),e.j41(14,"span",10),e.EFF(15),e.k0s()()(),e.DNE(16,eo,1,1,"ng-template",null,0,e.C5r)}2&t&&(e.Y8G("toolName",n.toolName),e.R7$(),e.Y8G("ngIf",n.isLoaded),e.R7$(),e.Y8G("ngIf",n.isLoaded),e.R7$(3),e.Y8G("disabled",n.disabled),e.R7$(),e.Y8G("ngIf",n.aiPhotoService.inProgress),e.R7$(2),e.JRh(n.aiPhotoService.inProgress?"Processing":n.btnText),e.R7$(7),e.SpI("",null==n.config?null:n.config.modelphotoshoot," credit"))},dependencies:[s.YU,s.bT,ae.n,f.WP,f.r6,f.tW,f.x7,f.UA,f.$R,f.ZM,L.b,ue.k,oe.t,Pe.B,De.d,re.P,be.e],styles:['.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]{width:100%;height:110px;border-radius:12px;background:linear-gradient(90deg,#fc5cff05 -4%,#2520f605);padding:.9px 4px 4px}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#c9cad4 -4% 100%);-webkit-mask:linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%) content-box,linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%);-webkit-mask-composite:xor;mask-composite:exclude;z-index:1}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]:hover:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#606576 -4% 100%);-webkit-mask:linear-gradient(90deg,#606576 -4%,#606576 100%) content-box,linear-gradient(90deg,#606576 -4%,#606576 100%);-webkit-mask-composite:xor;mask-composite:exclude;z-index:1}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{resize:none;outline:none;width:100%;height:82px;padding:8px 8px 0;font-size:12px;color:#b0b3bf;border:0px;background:transparent;line-height:18px;position:relative;z-index:2}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar{width:4px;height:4px;border-radius:12px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#e3e3e3;border-radius:12px;margin-top:8px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#9a9a9a;border-radius:12px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:#555}.prompt-view[_ngcontent-%COMP%] .prompt-info[_ngcontent-%COMP%]{font-size:11px;color:#959aa7;margin-top:0;padding-left:8px;height:24px;line-height:normal;width:calc(100% - 8px);bottom:4px;z-index:99}.info-up[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#c9cad4 -4% 100%)!important;-webkit-mask:linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%) content-box,linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-blue[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff0d -4%,#2520f60d)!important}.info-blue[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#fc5cff -4%,#2520f6)!important;-webkit-mask:linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%) content-box,linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-blue[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#626adf!important}.info-red[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff0d -4%,#2520f60d)!important}.info-red[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#f25555 -4% 100%)!important;-webkit-mask:linear-gradient(90deg,#F25555 -4%,#F25555 100%) content-box,linear-gradient(90deg,#F25555 -4%,#F25555 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-red[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#f25555!important}.fixed-bottom[_ngcontent-%COMP%]{position:fixed!important;width:300px!important;right:auto!important;left:5rem;-webkit-user-select:none;user-select:none;z-index:99}.filter-category[_ngcontent-%COMP%]{position:fixed;top:auto;z-index:99;
1margin-top:-186px;height:40px}']}),l})();const no=(r,l,o)=>({"info-up":r,"info-blue":l,"info-red":o});function oo(r,l){if(1&r&&(e.j41(0,"span",41),e.EFF(1),e.k0s()),2&r){const o=e.XpG(2);e.R7$(),e.SpI("",o.customPrompt.length,"/450")}}function io(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",42)(1,"buttons-scroll-menu",43),e.bIt("selectLayout",function(n){e.eBV(o);const i=e.XpG(2);return e.Njj(i.selectPrompt(n))}),e.k0s()()}if(2&r){const o=e.XpG(2);e.R7$(),e.Y8G("items",o.prompts)("type","prompt")}}function ro(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",31)(1,"div",32)(2,"div",33)(3,"div",34)(4,"div",35)(5,"div",36)(6,"text-prompt-animation",37),e.bIt("changePrompt",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.changePrompt(n))})("focusOut",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.onFocusOut(n))}),e.k0s(),e.DNE(7,oo,2,1,"span",38),e.k0s(),e.j41(8,"div",39),e.DNE(9,io,2,2,"div",40),e.k0s()()()()()()}if(2&r){const o=e.XpG();e.R7$(5),e.Y8G("ngClass",e.sMw(5,no,o.customPrompt.length,o.isFocused,o.customPrompt.length>449)),e.R7$(),e.Y8G("prompts",o.prompts)("textPrompt",o.customPrompt),e.R7$(),e.Y8G("ngIf",o.customPrompt.length),e.R7$(2),e.Y8G("ngIf",o.isPromptLoaded)}}function so(r,l){if(1&r&&(e.j41(0,"div",31)(1,"div",45)(2,"div",33)(3,"div",34)(4,"div",33),e.nrm(5,"workflow-ui",46),e.k0s()()()()()),2&r){const o=e.XpG(2);e.R7$(5),e.Y8G("productConfig",o.productConfig)("inProgress",o.aiPhotoService.inProgress)}}function ao(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",44),e.bIt("shown",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.accPanelChanged({panelId:"panel-1",nextState:!0}))})("hidden",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.accPanelChanged({panelId:"panel-1",nextState:!1}))}),e.j41(1,"div",7)(2,"div",8)(3,"button",9)(4,"div",10),e.EFF(5,"Workflow "),e.k0s()(),e.j41(6,"button",12)(7,"span",13),e.nrm(8,"pi",14),e.k0s(),e.j41(9,"span",15),e.nrm(10,"pi",16),e.k0s()()()(),e.j41(11,"div",17)(12,"div",18),e.DNE(13,so,6,2,"ng-template"),e.k0s()()()}if(2&r){const o=e.XpG();e.Y8G("collapsed","panel-1"!==o.activeAccPanelId)}}function co(r,l){if(1&r){const o=e.RV6();e.qex(0),e.j41(1,"preset-style",48),e.bIt("selectStyleEvent",function(n){e.eBV(o);const i=e.XpG(2);return e.Njj(i.selectImage(n))}),e.k0s(),e.bVm()}if(2&r){const o=e.XpG(2);e.R7$(),e.Y8G("type","category")("storeProducts",o.storeProducts)("productImageId",o.productImageId)}}function lo(r,l){1&r&&(e.qex(0),e.j41(1,"div",49),e.nrm(2,"element-placeholder",50),e.k0s(),e.bVm()),2&r&&(e.R7$(2),e.Y8G("view","AiPatterns"))}function _o(r,l){if(1&r&&e.DNE(0,co,2,3,"ng-container",47)(1,lo,3,1,"ng-container",47),2&r){const o=e.XpG();e.Y8G("ngIf",null==o.storeProducts?null:o.storeProducts.length),e.R7$(),e.Y8G("ngIf",!o.isLoaded)}}function go(r,l){1&r&&(e.j41(0,"div",51)(1,"span",52),e.EFF(2,"Loading..."),e.k0s()())}let po=(()=>{var r;class l{constructor(t,n,i,a,d,g,m,b,O){this.mediaContentService=t,this.authService=n,this.aiPhotoService=i,this.createPopupService=a,this.route=d,this.aiUploadImageService=g,this.paymentService=m,this.toast=b,this.workflowUIService=O,this.toolName=h.Fs.Headshot,this.prompts=[],this.pageNumber=0,this.activeAccPanelId="panel-2",this.btnText="Generate",this.disabled=!1,this.productId=0,this.pageNumberproduct=0,this.isWorksFlow=!1,this.customPrompt="",this.isFocused=!1,this.isPromptLoaded=!1,this.user=this.authService.currentUser(),this.loggedInObserver=this.authService.loggedIn.subscribe(E=>{this.user=this.authService.currentUser()}),this.usrPropChangedObserver=this.authService.usrPropChanged.subscribe(E=>{this.user=this.authService.currentUser()}),this.changeWorkflowObserver=this.workflowUIService.changeWorkflowSubject.subscribe(E=>{this.isDisabled()}),this.configSubs=this.paymentService.configUpdated.subscribe(()=>{this.config=this.paymentService?.config?.creditInfo})}ngOnInit(){[this.productId,this.productImageId]=this.aiPhotoService.getQueryParams(h.Fs.PhotoShoot),this.getCategoryDetails(()=>{const t=document.querySelector(".photoshoot-replace-none.photoshoot-replace-active");t&&t.parentElement&&t.parentElement.scrollTo({top:0,behavior:"smooth"}),(0,R._)((0,T.O)(500)).then(()=>{this.isLoaded=!0,this.config=this.paymentService?.config?.creditInfo})}),this.getWorkflows()}selectImage(t){if(t.productData){const n=t.productData;this.selectedProduct=n,this.productId=n.productId,this.modelTypeId=n?.modelTypeId}this.selectedStyle=t,this.productImageId=t.productImageId,this.selectedStyle.isPrompt=!1,this.selectedStyle.isStyle=!0,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}selectPrompt(t){this.customPrompt=t.prompt,this.selectedStyle.item=t,this.selectedStyle.isPrompt=!0,this.selectedStyle.isStyle=!1,this.selectedStyle.imageJson=t.prompt,this.disabled=!this.customPrompt,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),setTimeout(()=>{this.isFocused=!1})}getProductimage(t,n){this.pageNumberproduct=n,this.mediaContentService.getTemplateByProductId(t,n,i=>{if(i&&i.storeProductImages&&i.storeProductImages.length>0){let a=this.storeProducts.filter(d=>d.productId==this.productId)[0];a.storeProductImages.length>=20&&a.storeProductImages.length<=39&&1==this.pageNumberproduct?(a.storeProductImages=a.storeProductImages.concat(i.storeProductImages),a.storeProductImages.length>39&&this.getProductimage(this.productId,2)):a.storeProductImages.length>=40&&a.storeProductImages.length<=59&&2==this.pageNumberproduct&&(a.storeProductImages=a.storeProductImages.concat(i.storeProductImages)),this.selectedProduct=a}},i=>{this.pageNumberproduct=0})}changePrompt(t){this.customPrompt=t,this.selectedStyle.imageJson=this.customPrompt,this.selectedStyle.customPrompt=this.customPrompt,this.disabled=!this.customPrompt.trim(),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}accPanelChanged(t){this.disabled=!1,this.isWorksFlow=!1,this.selectedStyle=null,t.panelId&&(t.nextState&&"panel-1"==t.panelId?(this.activeAccPanelId=t.panelId,t.isStyle=!1,t.isPrompt=!1,this.isWorksFlow=!0,this.isDisabled()):t.nextState&&"panel-2"==t.panelId?(this.activeAccPanelId=t.panelId,t.isPrompt=!1,t.isStyle=!0,t.isWorkflow=!1):t.nextState&&"panel-3"==t.panelId?(t.isPrompt=!0,t.isStyle=!1,t.isWorkflow=!1,this.disabled=!this.customPrompt,this.activeAccPanelId=t.panelId,setTimeout(()=>{this.isPromptLoaded=!0},200)):(t.isPrompt=!1,t.isStyle=!1,t.isWorkflow=!1,this.activeAccPanelId="",this.disabled=!0),this.selectedStyle||(this.selectedStyle=t),t.isStyle?(this.modelTypeId=this.selectedProduct.modelTypeId,this.customPrompt=this.customPrompt,this.selectedStyle=this.storeProducts[0].storeProductImages[0],this.selectedStyle.displayName=this.storeProducts[0].displayName,this.productImageId=this.storeProducts[0].storeProductImages[0].productImageId,this.productId=this.storeProducts[0].productId,this.selectedStyle.isPrompt=!1,this.selectedStyle.isStyle=!0):t.isPrompt&&(this.selectedStyle={imageJson:this.customPrompt,customPrompt:this.customPrompt},this.productImageId=0,this.productId=0,this.selectedStyle.displayName="",this.selectedStyle.isPrompt=!0,this.selectedStyle.isStyle=!1),this.btnText=this.selectedStyle.isGenerated&&!this.isWorksFlow||this.isWorksFlow&&this.productC
1onfig?.isGenerated?"Generate More":this.aiPhotoService.changeBtnText(this.selectedStyle))}getCategoryDetails(t=null){this.mediaContentService.getCategoryProductDetails(A.KK.AIHeadshot,this.pageNumber,n=>{if(n&&n.body&&(this.storeProducts=n.body.storeProducts,this.storeProducts&&this.storeProducts.length)){if(this.productId){const d=this.storeProducts.findIndex(g=>g.productId==this.productId);if(-1!=d){let g=this.storeProducts[d];this.storeProducts.splice(d,1),this.storeProducts.splice(0,0,g),this.modelTypeId=g.modelTypeId}}else this.productId=this.storeProducts[0].productId,this.modelTypeId=this.storeProducts[0].modelTypeId;let i;this.storeProducts.filter(d=>d.productId==this.productId)[0]?.storeProductImages?.length>19?this.getProductimage(this.productId,1):this.selectedProduct=this.storeProducts.filter(d=>d.productId==this.productId)[0],this.getPrompts();const a=this.storeProducts[0].storeProductImages;if(a?.length)if(this.productImageId){const d=a.findIndex(m=>m.productImageId==this.productImageId);i=a.find(m=>m.productImageId==this.productImageId)||a[0],this.productImageId=i.productImageId,i&&-1!=d&&(a.splice(d,1),a.splice(0,0,i))}else i=a[0],this.productImageId=i.productImageId;this.selectedStyle?(this.selectedStyle.item=i,this.selectedStyle.imageJson=i?.imageJson,this.selectedStyle.displayName=i.displayName?i.displayName:this.storeProducts[0].displayName?this.storeProducts[0].displayName:""):(this.selectedStyle={item:i,isStyle:!0,isPrompt:!1,displayName:this.storeProducts[0].displayName?this.storeProducts[0].displayName:""},this.selectedStyle.imageJson=i?.imageJson),this.selectedStyle&&(this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle))}t&&t()},n=>{this.isLoaded=!0})}getWorkflows(){this.mediaContentService.getWorkflows(A.KK.AIHeadshot,t=>{if(t){const n=t?.productConfig||[];n?.length&&(this.productConfig=JSON.parse(JSON.stringify(n[0])),this.workflowUIService.setFieldsValue(this.productConfig))}},t=>{})}generate(){if(this.aiPhotoService.isCancel)this.toast.showErrorSingle(x.b.message.uploadNewImage);else if(this.aiPhotoService.imgUrl){if(this.aiPhotoService.inProgress||!this.selectedStyle||!this.isWorksFlow&&this.selectedStyle&&(!this.selectedStyle.imageJson||!this.selectedStyle.imageJson.trim()))return;if(this.user&&this.user.remainingCoins>=this.config?.headshot){const t={imageUrl:this.aiPhotoService.imgUrl,featureType:h.Fs.Headshot,...!this.isWorksFlow&&{...this.selectedStyle&&this.selectedStyle.imageJson&&{textPrompt:this.selectedStyle.imageJson},...this.modelTypeId&&{model:this.modelTypeId},...this.productId&&{productId:this.productId},...this.productImageId&&{productImageId:this.productImageId}},"aiApiVersion ":1,...this.isWorksFlow&&{...this.productConfig?.modelTypeId&&{model:this.productConfig.modelTypeId},worksFlow:{...this.workflowUIService.getInputWorkflowData(this.productConfig),...this.productConfig?.workflowId&&{workflowId:this.productConfig.workflowId}}}};this.aiPhotoService.inProgress=!0,this.aiPhotoService.generateImage(t,n=>{n&&n.assetId?(n.featureType=h.do.ai_headshot,n.toolName=x.b.label.aiHeadShoot,this.aiPhotoService.checkStatus(n,0,a=>{a&&a.urls&&a.urls.length>0&&(this.user.remainingCoins=a.remainingCalls,this.aiPhotoheader.isSelectAll=!1,this.aiPhotoService.isDirty=!0,this.selectedStyle&&!this.isWorksFlow?(this.selectedStyle.isGenerated=!0,this.btnText="Generate More"):this.isWorksFlow&&this.productConfig&&(this.productConfig.isGenerated=!0,this.btnText="Generate More")),this.aiPhotoService.inProgress=!1},a=>{this.displayErrorMsg(a)})):this.displayErrorMsg(n)},n=>{this.displayErrorMsg(n)})}else this.aiPhotoService.openAICreditPopup(()=>{this.user=this.authService.currentUser(),this.generate()},this.config?.headshot)}else this.aiPhotoService.inProgress=!0,this.aiPhotoService.updateImageUrl(this.aiPhotoService.originalImgUrl,h.Fs.Filter).then(t=>{this.aiPhotoService.queryParams=this.route.snapshot.queryParams,this.aiPhotoService.imgUrl=t.imgUrl,this.generate()}).catch(()=>{this.aiPhotoService.inProgress=!1,this.toast.showErrorSingle(x.b.message.uploadNewImage)})}displayErrorMsg(t=null){this.aiPhotoService.inProgress=!1;let n=t?.description;this.createPopupService.openWarningDialog("Error",n)}ngOnDestroy(){this.configSubs&&this.configSubs.unsubscribe(),this.loggedInObserver&&this.loggedInObserver.unsubscribe(),this.usrPropChangedObserver&&this.usrPropChangedObserver.unsubscribe(),this.changeWorkflowObserver&&this.changeWorkflowObserver.unsubscribe()}isProUser(){return!this.aiPhotoService.isProUser()}
1isDisabled(){return this.isWorksFlow&&this.productConfig&&this.productConfig.fields&&this.productConfig.fields.length>0?(this.disabled=!this.productConfig.fields.some(t=>t.value),this.disabled):this.disabled}focusIn(){this.isFocused=!0}onFocusOut(t){this.isFocused=t}focusOut(){this.isFocused=!1}getPrompts(t=null){this.mediaContentService.getPrompts(A.Jl.headshot,n=>{n&&(this.prompts=n.prompts),t&&t()},n=>{},null)}}return(r=l).\u0275fac=function(t){return new(t||r)(e.rXU(te.Z),e.rXU(N.u),e.rXU(U.s),e.rXU(Q.A),e.rXU(y.nX),e.rXU(G.M),e.rXU(K.W),e.rXU(C.f),e.rXU(Se.b))},r.\u0275cmp=e.VBU({type:r,selectors:[["headshot-drawer"]],inputs:{toolName:"toolName",imgUrl:"imgUrl",aiPhotoheader:"aiPhotoheader"},decls:50,vars:9,consts:[[3,"toolName"],[1,"position-relative","mt-3"],[1,"scroll-content","drawer-elements","ai-drawer-elements"],[1,"common-container","m-0","p-0","editor-tool-panel"],[1,"d-flex","w-100","flex-column","ngb-btn"],["ngbAccordion","",3,"closeOthers"],["ngbAccordionItem","panel-3",1,"tab-div",3,"shown","hidden","collapsed"],["ngbAccordionHeader",""],[1,"d-flex","align-items-center","wp-100"],["type","button","ngbAccordionButton","",1,"btn-acc-title"],[1,"m-0","btn","btn-link","card-title","ms-3"],["name","helpicon","placement","right","popoverClass","pop-for-tooltip","ngbPopover","Provide a text description about the subject, style, setting and any other specific element guiding the AI to understand the exact image you want generated.","triggers","mouseenter:mouseleave","popoverTitle","Enter Prompt","container","body",1,"ms-1","hw-24","help-icon"],["type","button","ngbAccordionButton","",1,"btn-collapse","p-0"],[1,"collapse-text","btn-link"],["name","collapseAcc",1,"f-24"],[1,"expand-text"],["name","expandAcc",1,"f-24"],["ngbAccordionCollapse",""],["ngbAccordionBody",""],["ngbAccordionItem","panel-1","class","tab-div",3,"collapsed","shown","hidden",4,"ngIf"],["ngbAccordionItem","panel-2",1,"tab-div",3,"shown","hidden","collapsed"],["name","helpicon","placement","right","popoverClass","pop-for-tooltip","ngbPopover","Choose from a collection of predefined artistic effects and aesthetics that can be applied to your generated image.","triggers","mouseenter:mouseleave","popoverTitle","Presets","container","body",1,"ms-1","hw-24","help-icon"],[1,"position-absolute","fixed-bottom","pb-1","pt-2","ps-3","pe-3","bg-white"],[1,"d-flex","align-items-center","justify-content-center","w-100","mb-1"],["id","gtm-generate",1,"btn","btn-primary-gradient","text-13","btn-h40","w-100","d-flex","align-items-center","justify-content-center",3,"click","disabled"],["class","spinner-border spinner-border-lg me-2 hw-24","role","status",4,"ngIf"],[1,"text-13"],[1,"credit-description","d-flex","align-items-center","justify-content-center","w-100"],[1,"f-12"],[1,"ms-2","me-2"],["src","https://static.lightxeditor.com/assets/images/coin-lottie-s-anim.gif","width","24px","height","24px","alt","Coin Lottie"],[1,"common-container"],[1,"card","drawer-card","mb-2"],[1,"card-body"],[1,"btn-panel"],[1,"card-body","prompt-view"],[1,"textarea-col","position-relative",3,"ngClass"],[1,"text-animation",3,"changePrompt","focusOut","prompts","textPrompt"],["class","prompt-info text-regular position-absolute d-flex align-items-center justify-content-start",4,"ngIf"],[1,"d-flex","document-color","mt-2"],["class","colors-bg sticker-buttons-scroll inner-buttons-scroll",4,"ngIf"],[1,"prompt-info","text-regular","position-absolute","d-flex","align-items-center","justify-content-start"],[1,"colors-bg","sticker-buttons-scroll","inner-buttons-scroll"],[3,"selectLayout","items","type"],["ngbAccordionItem","panel-1",1,"tab-div",3,"shown","hidden","collapsed"],[1,"card","drawer-card","mb-0","mt-2"],[3,"productConfig","inProgress"],[4,"ngIf"],[3,"selectStyleEvent","type","storeProducts","productImageId"],[1,"d-flex","backgound-content","portrait-content","mt-1",2,"padding","0px 7px"],[2,"padding","0px 5px",3,"view"],["role","status",1,"spinner-border","spinner-border-lg","me-2","hw-24"],[1,"sr-only","text-nowrap","border-0","position-absolute","overflow-hidden"]],template:function(t,n){1&t&&(e.nrm(0,"app-file-upload",0),e.j41(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5)(6,"div",6),e.bIt("shown",function(){return n.accPanelChanged({panelId:"panel-3",nextState:!0})})("hidden",function(){return n.accPanelChanged({panelId:"panel-3",nextState:!1})}),e.j41(7,"div",7)(8,"div",8)(9,"button",9)(10,"div",10),e.EFF(11,"Enter Prompt"),e.nrm(12,"pi",11),e.k0s()(),e.j41(13,"button",12)(14,"span",13),e.nrm(15,"pi",14),e.k0s(),e.j41(16,"span",15),e.nrm(17,"pi",16),e.k0s()()()(),e.j41(18,"div",17)(19,"div",18),e.DNE(20,ro,10,9,"ng-template"),e.k0s()()(),e.DNE(21,ao,14,1,"div",19),e.j41(22,"div",20),e.bIt("shown",function(){return n.accPanelChanged({panelId:"panel-2",nextState:!0})})("hidden",function(){return n.accPanelChanged({panelId:"panel-2",nextState:!1})}),e.j41(23,"div",7)(24,"div",8)(25,"button",9)(26,"div",10),e.EFF(27,"Presets"),e.nrm(28,"pi",21),e.k0s()(),e.j41(29,"button",12)(30,"span",13),e.nrm(31,"pi",14),e.k0s(),e.j41(32,"span",15),e.nrm(33,"pi",16),e.k0s()()()(),e.j41(34,"div",17)(35,"div",18),e.DNE(36,_o,2,2,"ng-template"),e.k0s()()()()()()(),e.j41(37,"div",22)(38,"div",23)(39,"button",24),e.bIt("click",function(){return n.generate()}),e.DNE(40,go,3,0,"div",25),e.j41(41,"span",26),e.EFF(42),e.k0s()()(),e.j41(43,"div",27)(44,"span",28),e.EFF(45,"1 generation ="),e.k0s(),e.j41(46,"span",29),e.nrm(47,"img",30),e.k0s(),e.j41(48,"span",28),e.EFF(49),e.k0s()()()()),2&t&&(e.Y8G("toolName",n.toolName),e.R7$(5),e.Y8G("closeOthers",!0),e.R7$(),e.Y8G("collapsed","panel-3"!==n.activeAccPanelId),e.R7$(15),e.Y8G("ngIf",n.productC
1onfig),e.R7$(),e.Y8G("collapsed","panel-2"!==n.activeAccPanelId),e.R7$(17),e.Y8G("disabled",n.disabled),e.R7$(),e.Y8G("ngIf",n.aiPhotoService.inProgress),e.R7$(2),e.JRh(n.aiPhotoService.inProgress?"Processing":n.btnText),e.R7$(7),e.SpI("",null==n.config?null:n.config.headshot," credit"))},dependencies:[s.YU,s.bT,ae.n,f.WP,f.r6,f.tW,f.x7,f.UA,f.$R,f.ZM,L.b,oe.t,Pe.B,De.d,re.P,be.e],styles:['.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]{width:100%;height:110px;border-radius:12px;background:linear-gradient(90deg,#fc5cff05 -4%,#2520f605);padding:.9px 4px 4px}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#c9cad4 -4% 100%);-webkit-mask:linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%) content-box,linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%);-webkit-mask-composite:xor;mask-composite:exclude;z-index:1}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]:hover:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#606576 -4% 100%);-webkit-mask:linear-gradient(90deg,#606576 -4%,#606576 100%) content-box,linear-gradient(90deg,#606576 -4%,#606576 100%);-webkit-mask-composite:xor;mask-composite:exclude;z-index:1}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{resize:none;outline:none;width:100%;height:82px;padding:8px 8px 0;font-size:12px;color:#b0b3bf;border:0px;background:transparent;line-height:18px;position:relative;z-index:2}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar{width:4px;height:4px;border-radius:12px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#e3e3e3;border-radius:12px;margin-top:8px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#9a9a9a;border-radius:12px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:#555}.prompt-view[_ngcontent-%COMP%] .prompt-info[_ngcontent-%COMP%]{font-size:11px;color:#959aa7;margin-top:0;padding-left:8px;height:24px;line-height:normal;width:calc(100% - 8px);bottom:4px;z-index:99}.info-up[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#c9cad4 -4% 100%)!important;-webkit-mask:linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%) content-box,linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-blue[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff0d -4%,#2520f60d)!important}.info-blue[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#fc5cff -4%,#2520f6)!important;-webkit-mask:linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%) content-box,linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-blue[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#626adf!important}.info-red[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff0d -4%,#2520f60d)!important}.info-red[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#f25555 -4% 100%)!important;-webkit-mask:linear-gradient(90deg,#F25555 -4%,#F25555 100%) content-box,linear-gradient(90deg,#F25555 -4%,#F25555 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-red[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#f25555!important}.fixed-bottom[_ngcontent-%COMP%]{position:fixed!important;width:300px!important;right:auto!important;left:5rem;-webkit-user-select:none;user-select:none;z-index:99}']}),l})();var mo=c(96427),B=c(14398),X=c(89818);function ho(r,l){1&r&&(e.j41(0,"div",9)(1,"span",10),e.EFF(2,"Loa
1ding..."),e.k0s()())}let ce=(()=>{var r;class l{constructor(t){this.aiPhotoService=t,this.isVideo=!1,this.disabled=!1,this.btnText="Generate",this.credit=0,this.btnClick=new e.bkB}generate(){this.btnClick.emit()}}return(r=l).\u0275fac=function(t){return new(t||r)(e.rXU(U.s))},r.\u0275cmp=e.VBU({type:r,selectors:[["generate-button"]],inputs:{isVideo:"isVideo",disabled:"disabled",btnText:"btnText",credit:"credit"},outputs:{btnClick:"btnClick"},decls:13,vars:5,consts:[[1,"position-absolute","fixed-bottom","pb-1","pt-2","ps-3","pe-3","bg-white"],[1,"d-flex","align-items-center","justify-content-center","w-100","mb-1"],["id","gtm-generate",1,"btn","btn-primary-gradient","text-13","btn-h40","w-100","d-flex","align-items-center","justify-content-center",3,"click","disabled"],["class","spinner-border spinner-border-lg me-2 hw-24","role","status",4,"ngIf"],[1,"text-13"],[1,"credit-description","d-flex","align-items-center","justify-content-center","w-100"],[1,"f-12"],[1,"ms-2","me-2"],["src","https://static.lightxeditor.com/assets/images/coin-lottie-s-anim.gif","width","24px","height","24px","alt","Coin Lottie"],["role","status",1,"spinner-border","spinner-border-lg","me-2","hw-24"],[1,"sr-only","text-nowrap","border-0","position-absolute","overflow-hidden"]],template:function(t,n){1&t&&(e.j41(0,"div",0)(1,"div",1)(2,"button",2),e.bIt("click",function(){return n.generate()}),e.DNE(3,ho,3,0,"div",3),e.j41(4,"span",4),e.EFF(5),e.k0s()()(),e.j41(6,"div",5)(7,"span",6),e.EFF(8,"1 generation ="),e.k0s(),e.j41(9,"span",7),e.nrm(10,"img",8),e.k0s(),e.j41(11,"span",6),e.EFF(12),e.k0s()()()),2&t&&(e.R7$(2),e.Y8G("disabled",n.disabled),e.R7$(),e.Y8G("ngIf",n.aiPhotoService.inProgress||n.isVideo&&n.aiPhotoService.inVideoProgress),e.R7$(2),e.JRh(n.aiPhotoService.inProgress||n.isVideo&&n.aiPhotoService.inVideoProgress?"Processing":n.btnText),e.R7$(7),e.Lme("",n.credit," ",n.credit>1?"credits":"credit",""))},dependencies:[s.bT]}),l})();const ot=r=>({"active-btn-tab":r});let Xe=(()=>{var r;class l{constructor(){this.selectedMode="presets",this.modeChange=new e.bkB}onModeButtonClick(t){this.selectedMode=t,this.modeChange.emit(t)}}return(r=l).\u0275fac=function(t){return new(t||r)},r.\u0275cmp=e.VBU({type:r,selectors:[["tab-button"]],inputs:{selectedMode:"selectedMode"},outputs:{modeChange:"modeChange"},decls:5,vars:6,consts:[[1,"d-flex","align-items-center","justify-content-center","preset-button","wp-100","btn-tabs-editor","border-radius-12","mb-2"],[1,"btn","btn-tab-inner",2,"margin-right","1px",3,"click","ngClass"],[1,"btn","btn-tab-inner",2,"margin-left","1px",3,"click","ngClass"]],template:function(t,n){1&t&&(e.j41(0,"div",0)(1,"button",1),e.bIt("click",function(){return n.onModeButtonClick("presets")}),e.EFF(2," Presets "),e.k0s(),e.j41(3,"button",2),e.bIt("click",function(){return n.onModeButtonClick("custom")}),e.EFF(4," Custom "),e.k0s()()),2&t&&(e.R7$(),e.Y8G("ngClass",e.eq3(2,ot,"presets"===n.selectedMode)),e.R7$(2),e.Y8G("ngClass",e.eq3(4,ot,"custom"===n.selectedMode)))},dependencies:[s.YU],styles:[".btn-tabs-editor[_ngcontent-%COMP%]{background:#626adf0d;height:40px;border:0px;padding:2px}.btn-tabs-editor[_ngcontent-%COMP%] .btn-tab-inner[_ngcontent-%COMP%]{height:36px;border-radius:10px;color:#272b34}.btn-tabs-editor[_ngcontent-%COMP%] .btn-tab-inner[_ngcontent-%COMP%]:hover{background-color:#626adf0d!important;color:#272b34!important}.btn-tabs-editor[_ngcontent-%COMP%] .active-btn-tab[_ngcontent-%COMP%], .btn-tabs-editor[_ngcontent-%COMP%] .active-btn-tab[_ngcontent-%COMP%]:hover{background:#626adf!important;color:#fff!important}"]}),l})();const uo=["p"];function Po(r,l){1&r&&(e.j41(0,"div",20),e.EFF(1," Drop image here "),e.k0s())}function fo(r,l){if(1&r&&(e.qex(0),e.nrm(1,"img",21),e.bVm()),2&r){const o=e.XpG(3);e.R7$(),e.Y8G("src",o.isCustomimage,e.B4B)}}function bo(r,l){1&r&&e.nrm(0,"pi",22)}function Co(r,l){1&r&&(e.j41(0,"div",23),e.EFF(1,"Click to upload"),e.k0s())}function vo(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",24)(1,"button",25),e.bIt("click",function(){e.eBV(o),e.XpG();const n=e.sdS(15),i=e.XpG(2);return e.Njj(i.addStyleImage(n))}),e.EFF(2,"Replace"),e.k0s(),e.j41(3,"button",26),e.bIt("click",function(){e.eBV(o);const n=e.XpG(3);return e.Njj(n.removeStyleImage())}),e.EFF(4,"Delete"),e.k0s()()}}function Io(r,l){if(1&r){const o=e.RV6();e.qex(0),e.j41(1,"div",8)(2,"div",9)(3,"div",10),e.bIt("click",function(){e.eBV(o);const n=e.sdS(15),i=e.XpG(2);return e.Njj(!i.isCustomimage&&i.addStyleImage(n))}),e.j41(4,"div",11),e.EFF(5," Custom Outfit "),e.nrm(6,"pi",12),e.k0s(),e.j41(7,"div",13),e.bIt("dragover",function(n){e.eBV(o);const i=e.XpG(2);return e.Njj(i.onCustomOutfitDragOver(n))})("dragleave",function(n){e.eBV(o);const i=e.XpG(2);return e.Njj(i.onCustomOutfitDragLeave(n))})("drop",function(n){e.eBV(o);const i=e.XpG(2);return e.Njj(i.onCustomOutfitDrop(n))}),e.DNE(8,Po,2,0,"div",14),e.j41(9,"div",15),e.DNE(10,fo,2,1,"ng-container",1)(11,bo,1,0,"pi",16),e.k0s(),e.DNE(12,Co,2,0,"div",17)(13,vo,5,0,"div",18),e.k0s()(),e.j41(14,"input",19,0),e.bIt("change",function(n){e.eBV(o);const i=e.XpG(2);return e.Njj(i.onFileUploaded(n.target.files))})("click",function(){e.eBV(o);const n=e.sdS(15);return e.Njj(n.value="")}
1),e.k0s()()(),e.bVm()}if(2&r){const o=e.XpG(2);e.R7$(7),e.AVh("custom-AI-modal--has-image",!o.isCustomimage),e.R7$(),e.Y8G("ngIf",o.isCustomOutfitDragActive),e.R7$(2),e.Y8G("ngIf",o.isCustomimage),e.R7$(),e.Y8G("ngIf",!o.isCustomimage),e.R7$(),e.Y8G("ngIf",!o.isCustomimage),e.R7$(),e.Y8G("ngIf",o.isCustomimage),e.R7$(),e.Y8G("accept",o.aiUploadImageService.fileImageAccept)}}function xo(r,l){if(1&r&&(e.j41(0,"ul",33)(1,"li")(2,"div",34)(3,"div",35),e.nrm(4,"pi",36),e.k0s(),e.j41(5,"div",37)(6,"div",38),e.EFF(7),e.k0s()()()()()),2&r){const o=l.item;e.R7$(4),e.FS9("name",o.iconName),e.R7$(3),e.JRh(o.text)}}function Mo(r,l){if(1&r&&(e.j41(0,"ul",33)(1,"li")(2,"div",39)(3,"div",37)(4,"div",40),e.EFF(5),e.k0s()()()()()),2&r){const o=l.item;e.R7$(5),e.JRh(o.text)}}function Oo(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",41)(1,"preset-style",42),e.bIt("selectStyleEvent",function(n){e.eBV(o);const i=e.XpG(3);return e.Njj(i.selectImage(n))})("expandProduct",function(n){e.eBV(o);const i=e.XpG(3);return e.Njj(i.onCategoryExpandProduct(n))})("listEndReached",function(n){e.eBV(o);const i=e.XpG(3);return e.Njj(i.onPresetListEnd(n))})("categoryProductImagesEnd",function(n){e.eBV(o);const i=e.XpG(3);return e.Njj(i.onCategoryProductImagesEnd(n))}),e.k0s()()}if(2&r){const o=e.XpG(3);e.R7$(),e.Y8G("storeProducts",o.storeProducts)("productId",o.productId)("productImageId",o.productImageId)("isCategoryProductsLoading",o.isLoadingMoreCategoryProducts)("isCategoryProductsEnd",o.isCategoryProductsEnd)("categoryExpandedImagePagination",o.categoryExpandedImagePagination)}}function yo(r,l){1&r&&(e.qex(0),e.nrm(1,"element-placeholder",43),e.bVm()),2&r&&(e.R7$(),e.Y8G("view","AiPatterns"))}function wo(r,l){if(1&r){const o=e.RV6();e.qex(0),e.j41(1,"div",27)(2,"ng-select",28),e.mxI("ngModelChange",function(n){e.eBV(o);const i=e.XpG(2);return e.DH7(i.selectedGenderCatId,n)||(i.selectedGenderCatId=n),e.Njj(n)}),e.bIt("change",function(n){e.eBV(o);const i=e.XpG(2);return e.Njj(i.changeGender(n))}),e.DNE(3,xo,8,2,"ng-template",29)(4,Mo,6,1,"ng-template",30),e.k0s()(),e.j41(5,"div",31),e.DNE(6,Oo,2,6,"div",32)(7,yo,2,1,"ng-container",1),e.k0s(),e.bVm()}if(2&r){const o=e.XpG(2);e.R7$(2),e.Y8G("items",o.genders),e.R50("ngModel",o.selectedGenderCatId),e.Y8G("searchable",!1)("clearable",!1),e.R7$(4),e.Y8G("ngIf",o.storeProducts.length),e.R7$(),e.Y8G("ngIf",!o.isLoaded)}}function Eo(r,l){if(1&r){const o=e.RV6();e.qex(0),e.nrm(1,"app-file-upload",3),e.j41(2,"div",4)(3,"tab-button",5),e.bIt("modeChange",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.onModeButtonClick(n))}),e.k0s(),e.j41(4,"div",6)(5,"div",7),e.DNE(6,Io,16,8,"ng-container",1)(7,wo,8,6,"ng-container",1),e.k0s()()(),e.bVm()}if(2&r){const o=e.XpG();e.R7$(),e.Y8G("toolName",o.toolName),e.R7$(2),e.Y8G("selectedMode",o.selectedMode),e.R7$(3),e.Y8G("ngIf","custom"===o.selectedMode),e.R7$(),e.Y8G("ngIf","presets"===o.selectedMode)}}let So=(()=>{var r;class l{constructor(t,n,i,a,d,g,m,b,O){this.mediaContentService=t,this.modalService=n,this.authService=i,this.aiPhotoService=a,this.createPopupService=d,this.route=g,this.aiUploadImageService=m,this.toast=b,this.paymentService=O,this.selectedMode="presets",this.selectCustomImage=new e.bkB,this.isCustomimage="",this.toolName=h.Fs.AIVirtualTryOn,this.tempStylesHistory=[],this.selfie=!1,this.styleImageUrl="",this.imgStrength=30,this.aiPatterns=[],this.categoryId=A.KK.AITryOn,this.storeProducts=[],this.prompts=[],this.pageNumber=0,this.categoryProductPageNumber=0,this.isLoadingMoreCategoryProducts=!1,this.isCategoryProductsEnd=!1,this.categoryExpandedImagePagination={},this.activeAccPanelId="panel-2",this.customPrompt="",this.isFocused=!1,this.genImageEvent=new e.bkB,this.btnText="Generate",this.disabled=!1,this.productId=A.KK.AIBackground,this.modelTypeId=44,this.isPromptLoaded=!1,this.prodId=0,this.genders=[{categoryId:265,text:"Male",iconName:"male"},{categoryId:262,text:"Female",iconName:"female"}],this.selectedGenderCatId=265,this.selectedGenderName="Male",this.categoryProductsRequestSeq=0,this.isCustomOutfitDragActive=!1,this.isClick=!1,this.user=this.authService.currentUser(),this.loggedInObserver=this.authService.loggedIn.subscribe(E=>{this.user=this.authService.currentUser()}),this.usrPropChangedObserver=this.authService.usrPropChanged.subscribe(E=>{this.user=this.authService.currentUser()}),this.configSubs=this.paymentService.configUpdated.subscribe(()=>{this.config=this.paymentService?.config?.creditInfo})}ngOnInit(){let t;[this.productId,this.productImageId,t]=this.aiPhotoService.getQueryParams(h.Fs.AIVirtualTryOn),t&&(this.categoryId=t,this.selectedGenderCatId=t),this.getCategoryDetails(this.categoryId,A.Jl.Backgroun
1d,()=>{this.isPromptLoaded=!0,this.config=this.paymentService?.config?.creditInfo})}onPanelChange(t){t.nextState&&setTimeout(()=>{document.getElementById(t.panelId)?.scrollIntoView({behavior:"smooth",block:"center"})},100)}selectImage(t){t&&(this.productId=t.productData.productId,this.productImageId=t.productImageId,this.selectedStyle.item=t,this.styleImageUrl=t.imgUrl,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle))}getCategoryDetails(t,n,i=null){this.categoryProductsRequestSeq++,this.resetCategoryProductPagination(),this.categoryExpandedImagePagination={},this.storeProducts=[],this.selectedFilters=null,this.loadCategoryProducts({categoryId:t,reset:!0,cb:i})}focusIn(){this.isFocused=!0}onFocusOut(t){this.isFocused=t}focusOut(){this.isFocused=!1}generate(){if(!this.aiPhotoService.isCancel||this.aiPhotoService.imgUrl)if(this.aiPhotoService.imgUrl){if(this.aiPhotoService.inProgress||!this.selectedStyle)return;if(this.user&&this.user.remainingCoins>=this.config?.aivirtualtryon){const t={imageUrl:this.aiPhotoService.imgUrl,featureType:h.Fs.AIVirtualTryOn,segmentationType:0,...this.isCustomimage&&this.selectedMode==h.y9.Custom&&{imageUrlSecond:this.isCustomimage},...this.selectedMode==h.y9.Presets&&{...this.styleImageUrl&&{imageUrlSecond:this.styleImageUrl},...this.productImageId&&{productImageId:this.productImageId}}};this.aiPhotoService.startGenerationProgress({featureType:h.Fs.AIVirtualTryOn}),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),this.aiPhotoService.generateImage(t,n=>{n&&n.assetId?(n.featureType=h.Fs.AIVirtualTryOn,n.toolName=x.b.label.tryon,this.aiPhotoService.checkStatus(n,0,a=>{a.urls&&a.urls.length>0?(this.user.remainingCoins=a.remainingCalls,this.aiPhotoService.isDirty=!0,this.selectedStyle&&this.selectedStyle.item&&(this.selectedStyle.item.isGenerated=!0)):this.aiPhotoService.clearGenerationProgress(),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)},a=>{this.displayErrorMsg(a)})):this.displayErrorMsg(n)},n=>{this.displayErrorMsg(n)})}else this.aiPhotoService.openAICreditPopup(()=>{this.user=this.authService.currentUser(),this.generate()},this.config?.aivirtualtryon)}else this.aiPhotoService.inProgress=!0,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),this.aiPhotoService.updateImageUrl(this.aiPhotoService.originalImgUrl,h.Fs.PhotoShoot,h.do.Person_Photoshoot).then(t=>{this.aiPhotoService.queryParams=this.route.snapshot.queryParams,this.aiPhotoService.imgUrl=t.imgUrl,this.generate()}).catch(()=>{this.aiPhotoService.inProgress=!1,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),this.toast.showErrorSingle(x.b.message.uploadNewImage)});else this.toast.showErrorSingle(x.b.message.uploadNewImage)}displayErrorMsg(t=null){this.aiPhotoService.clearGenerationProgress(),this.createPopupService.openWarningDialog("Error",t&&"object"==typeof t&&"description"in t?t.description:"An unexpected error occurred."),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}ngOnDestroy(){this.configSubs&&this.configSubs.unsubscribe(),this.loggedInObserver&&this.loggedInObserver.unsubscribe(),this.usrPropChangedObserver&&this.usrPropChangedObserver.unsubscribe()}deleteStyleImage(){this.styleImageUrl="",this.imgStrength=30,this.disabled=!this.customPrompt}popOvermouseleave(t){this.isClick||t.close()}removeStyleImage(){event.stopPropagation(),this.isCustomimage="",this.disabled=!0}onFileUploaded(t){t&&(this.aiPhotoService.inProgress=!1,this.aiUploadImageService.aiUploadImage(t[0],{tab:h.Fs.AIVirtualTryOn,isStyleRefImage:!0}).then(a=>{a&&"cancel"!=a&&(this.modalService.dismissAll(),this.isCustomimage=a?.imgUrl,this.disabled=!1)}))}resetImage(){localStorage.removeItem("doNotShowTryOn")}addStyleImage(t){this.showTryOnUploadPopupIfNeeded(()=>t.click())}onCustomOutfitDragOver(t){!this.isFileDrag(t)||this.aiPhotoService.inProgress||(t.preventDefault(),t.stopPropagation(),t.dataTransfer.dropEffect="copy",this.isCustomOutfitDragActive=!0)}onCustomOutfitDragLeave(t){const i=t.relatedTarget;i&&t.currentTarget.contains(i)||(this.isCustomOutfitDragActive=!1)}onCustomOutfitDrop(t){if(!this.isFileDrag(t))return;
1t.preventDefault(),t.stopPropagation(),this.isCustomOutfitDragActive=!1;const n=t.dataTransfer?.files;n?.length&&this.onFileUploaded(n)}isFileDrag(t){const n=t.dataTransfer?.types;return!!n&&Array.from(n).includes("Files")}showTryOnUploadPopupIfNeeded(t){if(!this.aiPhotoService.inProgress)if("true"==localStorage.getItem("doNotShowTryOn")||this.isCustomimage)t();else{const i=this.modalService.open(mo.I,{centered:!0,size:"md",backdrop:"static",windowClass:"tryon-custom-popup"});i.componentInstance.PopUpType="tryon-upload-popup",i.result.then(a=>{a&&t()})}}changeGender(t){t&&(this.selectedGenderCatId=t.categoryId,this.selectedGenderName=t.text,this.getCategoryDetails(this.selectedGenderCatId,this.aiType),this.selectedAiPatterns&&(this.selectedStyle=this.selectedAiPatterns.storeProducts[0],this.productImageId=this.selectedStyle.productId),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle))}onPresetListEnd(t){if(t&&"category"===t.viewType){if(!this.isCategoryProductsEnd)return void this.loadCategoryProducts({categoryId:this.selectedGenderCatId,reset:!1});t.productId&&this.loadExpandedCategoryProductImages({productId:t.productId})}}onCategoryExpandProduct(t){if(!t?.productId)return;const n=this.storeProducts.find(d=>d.productId==t.productId);if(!n)return;this.categoryExpandedImagePagination[t.productId]||(this.categoryExpandedImagePagination[t.productId]=(0,B.gi)());const i=this.categoryExpandedImagePagination[t.productId],a=n.storeProductImages||[];if(0===a.length)return i.pageNumber=-1,i.isEnd=!1,void this.loadExpandedCategoryProductImages({productId:t.productId});i.pageNumber=(0,B.vR)(a.length,B.$t.CATEGORY_IMAGE_PAGE_SIZE),i.isEnd=a.length<B.$t.CATEGORY_EMBEDDED_IMAGE_COUNT}onCategoryProductImagesEnd(t){t?.productId&&this.loadExpandedCategoryProductImages({productId:t.productId})}resetCategoryProductPagination(){this.categoryProductPageNumber=0,this.isLoadingMoreCategoryProducts=!1,this.isCategoryProductsEnd=!1}loadCategoryProducts({categoryId:t,reset:n,cb:i=null}){(0,B.uH)({request:{categoryId:t,reset:n,cb:i},requestSeq:this.categoryProductsRequestSeq,pageSize:B.$t.CATEGORY_PRODUCT_PAGE_SIZE,pagination:{getState:()=>({pageNumber:this.categoryProductPageNumber,isLoading:this.isLoadingMoreCategoryProducts,isEnd:this.isCategoryProductsEnd}),setState:d=>{"number"==typeof d.pageNumber&&(this.categoryProductPageNumber=d.pageNumber),"boolean"==typeof d.isLoading&&(this.isLoadingMoreCategoryProducts=d.isLoading),"boolean"==typeof d.isEnd&&(this.isCategoryProductsEnd=d.isEnd)}},isCurrentRequest:d=>d===this.categoryProductsRequestSeq,fetchProducts:(0,B.a6)(this.mediaContentService,B.$t.CATEGORY_PRODUCT_PAGE_SIZE),onProductsLoaded:({fetchedProducts:d,reset:g})=>{if(this.isLoaded=!0,g?this.storeProducts=d:d.length&&(this.storeProducts=(0,B.cb)(this.storeProducts,d,"productId")),g&&this.storeProducts.length){this.selectedFilters=this.storeProducts[0],this.prodId=this.selectedFilters.productId;const m=this.selectedFilters?.storeProductImages?.[0];this.productImageId=m?.productImageId||0,this.styleImageUrl=m?.imgUrl||"",this.selectedStyle?(this.selectedStyle.item=m,this.selectedStyle.displayName=this.storeProducts[0].displayName||""):this.selectedStyle={item:m,isStyle:!0,isPrompt:!1,displayName:this.storeProducts[0].displayName||""},this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}},onError:()=>{this.isLoaded=!0}})}loadExpandedCategoryProductImages({productId:t}){(0,B.hu)({storeProducts:this.storeProducts,paginationMap:this.categoryExpandedImagePagination,request:{productId:t},embeddedImageCount:B.$t.CATEGORY_EMBEDDED_IMAGE_COUNT,pageSize:B.$t.CATEGORY_IMAGE_PAGE_SIZE,fetchImages:(0,B.$B)(this.mediaContentService,B.$t.CATEGORY_IMAGE_PAGE_SIZE)})}filterByGender(){this.selectedAiPatterns=this.aiPatterns.filter(t=>t.categoryId==this.selectedGenderCatId)[0]}onModeButtonClick(t){if(this.selectedMode=t,this.disabled=!1,"custom"===t)this.selectedStyle||(this.selectedStyle={}),this.selectedStyle.isPrompt=!0,this.selectedStyle.isStyle=!1,this.disabled=!this.isCustomimage,this.selectedStyle.item={imageJson:this.customPrompt,customPrompt:this.customPrompt},this.productImageId=0,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle);else if("presets"===t){if(this.disabled=!1,this.selectedStyle||(this.selectedStyle={}),this.selectedStyle.isStyle=!0,this.selectedStyle.isPrompt=!1,this.selectedFilters&&this.selectedFilters.storeProductImages&&this.selectedFilters.storeProductImages.length)if(this.productImageId){const n=this.selectedFilters.storeProductImages.find(i=>i.productImageId===this.productImageId)||this.selectedFilters.storeProductImages[0];this.selectedStyle.item=n,this.productImageId=n.productImageId,this.modelTypeId=this.selectedFilters.modelTypeId}else this.modelTypeId=this.selectedFilters.modelTypeId,this.selectedStyle.item=this.selectedFilters.storeProductImages[0],this.productImageId=this.selectedFilters.storeProductImages[0].productImageId;this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}}}return(r=l).\u0275fac=function(t){return new(t||r)(e.rXU(te.Z),e.rXU(f.Bq),e.rXU(N.u),e.rXU(U.s),e.rXU(Q.A),e.rXU(y.nX),e.rXU(G.M),e.rXU(C.f),e.rXU(K.W))},r.\u0275cmp=e.VBU({type:r,selectors:[["tryon-drawer"]],viewQuery:function(t,n){if(1&t&&e.GBs(uo,5),2&t){let i;e.mGM(i=e.lsd())&&(n.p=i.first)}}
1,inputs:{isCustomimage:"isCustomimage",toolName:"toolName",imgUrl:"imgUrl",aiPhotoheader:"aiPhotoheader"},outputs:{selectCustomImage:"selectCustomImage",genImageEvent:"genImageEvent"},decls:2,vars:4,consts:[["file",""],[4,"ngIf"],[3,"btnClick","disabled","btnText","credit"],[3,"toolName"],[1,"position-relative"],[3,"modeChange","selectedMode"],[1,"common-container","m-0","p-0","editor-tool-panel","card","border-0","pt-2"],[1,"d-flex","w-100","flex-column","ngb-btn"],[1,"common-container"],[1,"card","drawer-card","mb-3"],[1,"d-flex","align-items-center","justify-content-center","flex-column","w-100",3,"click"],[1,"text-normal","text-dark","text-semi","lh-125","grey-800","h-32","mb-1","d-flex","align-items-center","w-100"],["name","helpicon","placement","right","popoverClass","pop-for-tooltip","ngbPopover","Upload an upper outfit image (flat lay, mannequin, or worn by someone).","triggers","mouseenter:mouseleave","popoverTitle","Custom Outfit","container","body",1,"ms-1","hw-24","help-icon"],[1,"d-flex","align-items-center","w-100","custom-AI-modal","border-radius-12","pointer","ps-1","pe-2","ai-thumb-view-button","position-relative",3,"dragover","dragleave","drop"],["class","drag-active text-semi d-flex flex-column align-items-center justify-content-center w-100 h-100 position-absolute",4,"ngIf"],[1,"ai-thumb-view-small","d-flex","align-items-center","justify-content-center"],["name","uploadimage","class","f-24 grey-600",4,"ngIf"],["class","text-13 text-regular grey-800 lh-125 ms-2",4,"ngIf"],["class","d-flex align-items-center ms-2",4,"ngIf"],["id","fileInputId","name","fileInputId","type","file",1,"custom-file-input","d-none",3,"change","click","accept"],[1,"drag-active","text-semi","d-flex","flex-column","align-items-center","justify-content-center","w-100","h-100","position-absolute"],[1,"responsive","border-radius-8","add-border",3,"src"],["name","uploadimage",1,"f-24","grey-600"],[1,"text-13","text-regular","grey-800","lh-125","ms-2"],[1,"d-flex","align-items-center","ms-2"],[1,"btn","btnWorkFlowRD","text-12","text-semi","grey-600","h-32","me-2",3,"click"],[1,"btn","btnWorkFlowRD","text-12","text-semi","grey-600","h-32",3,"click"],[1,"d-flex","backgound-content","portrait-content","ps-3","pe-3","pt-1"],["bindLabel","text","bindValue","categoryId",1,"w-100","c-ng-select","mb-2","genderSelect",3,"ngModelChange","change","items","ngModel","searchable","clearable"],["ng-label-tmp",""],["ng-option-tmp",""],[1,"d-flex","backgound-content","portrait-content"],["class","d-flex w-100 pane-section flex-column ps-0 pe-3",4,"ngIf"],[1,"list-unstyled","w-100","mb-0","text-black"],[1,"row","g-0","align-items-center"],[1,"col-1","me-2","text-center"],[1,"grey-600","f-16",3,"name"],[1,"col-10"],[1,"text-13","grey-800","text-semi","lh-125"],[1,"row","g-0","align-items-center","h-48"],[1,"text-13","grey-800","text-semi"],[1,"d-flex","w-100","pane-section","flex-column","ps-0","pe-3"],[3,"selectStyleEvent","expandProduct","listEndReached","categoryProductImagesEnd","storeProducts","productId","productImageId","isCategoryProductsLoading","isCategoryProductsEnd","categoryExpandedImagePagination"],[2,"padding","0px 5px",3,"view"]],template:function(t,n){1&t&&(e.DNE(0,Eo,8,4,"ng-container",1),e.j41(1,"generate-button",2),e.bIt("btnClick",function(){return n.generate()}),e.k0s()),2&t&&(e.Y8G("ngIf",n.isLoaded),e.R7$(),e.Y8G("disabled",n.disabled)("btnText",n.btnText)("credit",null==n.config?null:n.config.aivirtualtryon))},dependencies:[s.bT,ae.n,f.ZM,u.BC,u.vS,L.b,X.vr,X.Uq,X.ZZ,re.P,be.e,ce,Xe],styles:[".custom-AI-modal[_ngcontent-%COMP%]{border:1px solid #E2E3E9;background:#626adf0d;height:60px;transition:background-color .2s ease,border-color .2s ease}.custom-AI-modal.drag-active[_ngcontent-%COMP%]{border-color:#626adf;background:#626adf26}.custom-AI-modal.custom-AI-modal--has-image[_ngcontent-%COMP%]:hover{background:#626adf1a}.custom-AI-modal[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:48px;height:48px;border:1px solid transparent;border-radius:8px;object-fit:cover}.ai-thumb-view-small[_ngcontent-%COMP%]{border-radius:8px;background:#e2e3e9;height:48px;width:48px;position:relative;overflow:hidden;-webkit-user-select:none;user-select:none}.btnWorkFlowRD[_ngcontent-%COMP%]{border-radius:8px;background:#e2e3e9b3;width:79px}.btnWorkFlowRD[_ngcontent-%COMP%]:hover{background:#e2e3e9}.btnWorkFlowRD[_ngcontent-%COMP%]:active{background:#e2e3e9b3;border:1px solid rgba(226,227,233,.7)}.ai-thumb-view-button[_ngcontent-%COMP%] .drag-active[_ngcontent-%COMP%]{border-radius:12px;border:1px solid #626ADF;background:#626adf1a;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);-webkit-text-stroke:1px #FFFFFF;paint-order:stroke fill;z-index:1;margin-left:-4px}"]}),l})();var ke=c(79745);const To=["popoverOpen"],Do=["popStylesReferenc1"],ko=["p"],Ro=(r,l,o)=>({"info-up":r,"info-blue":l,"info-red":o});function Uo(r,l){if(1&r&&(e.j41(0,"span",42),e.EFF(1),e.k0s()),2&r){const o=e.XpG(3);e.R7$(),e.SpI("",o.customPrompt.length,"/450")}}function Ao(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",31)(1,"div",32),e.EFF(2,"Enter Prompt"),e.j41(3,"pi",33),e.bIt("mouseenter",function(){e.eBV(o);const n=e.XpG(2);return e.Njj(n.hideStyleRefPopover())}),e.k0s()()(),e.j41(4,"div",34)(5,"div",35)(6,"div",36)(7,"div",37)(8,"div",38)(9,"div",39)(10,"text-prompt-animation",40),e.bIt("changePrompt",function(n){e.eBV(o);const i=e.XpG(2);return e.Njj(i.changePrompt(n))})("focusOut",function(n){e.eBV(o);const i=e.XpG(2);return e.Njj(i.onFocusOut(n))}),e.k0s(),e.DNE(11,Uo,2,1,"span",41),e.k0s()()()()()()}if(2&r){const o=e.XpG(2);e.R7$(9),e.Y8G("ngClass",e.sMw(4,Ro,o.customPrompt.length,o.isFocused,o.customPrompt.length>449)),e.R7$(),e.Y8G("prompts",o.prompts)("textPrompt",o.customPrompt),e.R7$(),e.Y8G("ngIf",o.customPrompt.length)}}function Bo(r,l){if(1&r){const o=e.RV6();e.j41(0,"div")(1,"preset-style",44),e.bIt("selectStyleEvent",function(n){e.eBV(o);const i=e.XpG(3);return e.Njj(i.selectImage(n))}),e.k0s()()}if(2&r){const o=e.XpG(3);e.R7$(),e.Y8G("type","category")("storeProducts",o.storeProducts)("productImageId",o.productImageId)}}function Go(r,l){1&r&&(e.qex(0),e.nrm(1,"element-placeholder",45),e.bVm()),2&r&&(e.R7$(),e.Y8G("view","AiPatterns"))}function jo(r,l){if(1&r&&(e.j41(0,"div",43),e.DNE(1,Bo,2,3,"div",4)(2,Go,2,1,"ng-container",4),e.k0s()),2&r){const o=e.XpG(2);e.R7$(),e.Y8G("ngIf",null==o.storeProducts?null:o.storeProducts.length),e.R7$(),e.Y8G("ngIf",!o.isLoaded)}}function Fo(r,l){if(1&r){const o=e.RV6();e.qex(0),e.j41(1,"div",14)(2,"div",15)(3,"div",16)(4,"div",17),e.bIt("shown",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.accPanelChanged({panelId:"panel-1",nextState:!0}))})("hidden",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.accPanelChanged({panelId:"panel-1",nextState:!1}))}),e.j41(5,"div",18)(6,"div",19)(7,"button",20)(8,"div",21),e.EFF(9,"Prompt"),e.k0s()(),e.j41(10,"button",22)(11,"span",23),e.nrm(12,"pi",24),e.k0s(),e.j41(13,"span",25),e.nrm(14,"pi",26),e.k0s()()()(),e.j41(15,"div",27)(16,"div",28),e.DNE(17,Ao,12,8,"ng-template"),e.k0s()()(),e.j41(18,"div",29),e.bIt("shown",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.accPanelChanged({panelId:"panel-2",nextState:!0}))})("hidden",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.accPanelChanged({panelId:"panel-2",nextState:!1}))}),e.j41(19,"div",18)(20,"div",19)(21,"button",20)(22,"div",21),e.EFF(23,"Presets"),e.j41(24,"pi",30),e.bIt("mouseenter",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.hideStyleRefPopover())}),e.k0s()()(),e.j41(25,"button",22)(26,"span",23),e.nrm(27,"pi",24),e.k0s(),e.j41(28,"span",25),e.nrm(29,"pi",26),e.k0s()()()(),e.j41(30,"div",27)(31,"div",28),e.DNE(32,jo,3,2,"ng-template"),e.k0s()()()()()(),e.bVm()}if(2&r){const o=e.XpG();e.R7$(3),e.Y8G("closeOthers",!0),e.R7$(),e.Y8G("collapsed","panel-1"!==o.activeAccPanelId),e.R7$(14),e.Y8G("collapsed","panel-2"!==o.activeAccPanelId)}}function No(r,l){1&r&&(e.j41(0,"div",46)(1,"span",47),e.EFF(2,"Loa
1ding..."),e.k0s()())}function Lo(r,l){if(1&r){const o=e.RV6();e.j41(0,"ai-style-reference-popover",48),e.bIt("selectstyleRef",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.selectstyleRef(n))}),e.k0s()}2&r&&e.Y8G("editorType","photoshoot")("editorSubTool","duo-product")}let Wo=(()=>{var r;class l{constructor(t,n,i,a,d,g,m,b,O){this.mediaContentService=t,this.authService=n,this.aiPhotoService=i,this.aiWrapperRemoveBgService=a,this.createPopupService=d,this.route=g,this.aiUploadImageService=m,this.toast=b,this.paymentService=O,this.toolName=h.Fs.Duo_Photoshoot,this.tempStyles=[],this.selfie=!1,this.styleImageUrl="",this.imgStrength=100,this.aiPatterns=[],this.storeProducts=[],this.prompts=[{prompt:"Imagine anything, type it"}],this.pageNumber=0,this.activeAccPanelId="panel-2",this.customPrompt="",this.isFocused=!1,this.genImageEvent=new e.bkB,this.btnText="Generate",this.disabled=!1,this.productId=0,this.quality=1,this.isClick=!1,this.styleclick=!1,this.user=this.authService.currentUser(),this.loggedInObserver=this.authService.loggedIn.subscribe(E=>{this.user=this.authService.currentUser()}),this.usrPropChangedObserver=this.authService.usrPropChanged.subscribe(E=>{this.user=this.authService.currentUser()})}ngOnInit(){[this.productId,this.productImageId]=this.aiPhotoService.getQueryParams(h.Fs.PhotoShoot),this.getCategoryDetails(),setTimeout(()=>{this.getModels()},500)}getModels(){const t=this.paymentService.config;
1t&&(this.quality=t.creditInfo?.aiduoshoot?t.creditInfo?.aiduoshoot:1)}onPanelChange(t){t.nextState&&setTimeout(()=>{document.getElementById(t.panelId)?.scrollIntoView({behavior:"smooth",block:"center"})},100)}selectImage(t){this.productImageId=t.productImageId,this.selectedStyle.item=t,this.selectedStyle.item=t,this.selectedStyle.isPrompt=!1,this.selectedStyle.isStyle=!0,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}getCategoryDetails(){this.mediaContentService.getCategoryProductDetails(A.KK.AIDuoShoot,this.pageNumber,t=>{if(t&&t.body){if(this.storeProducts=t.body.storeProducts,this.storeProducts&&this.storeProducts.length){if(this.productId){const a=this.storeProducts.findIndex(d=>d.productId==this.productId);if(-1!=a){let d=this.storeProducts[a];this.storeProducts.splice(a,1),this.storeProducts.splice(0,0,d)}}let n;const i=this.storeProducts[0].storeProductImages;if(this.productId=this.storeProducts[0].productId,i?.length)if(this.productImageId){const a=i.findIndex(g=>g.productImageId==this.productImageId);n=i.find(g=>g.productImageId==this.productImageId)||i[0],this.productImageId=n.productImageId,n&&-1!=a&&(i.splice(a,1),i.splice(0,0,n))}else n=i[0],this.productImageId=n.productImageId;this.selectedStyle?(this.selectedStyle.item=n,this.selectedStyle.displayName=this.storeProducts[0].displayName?this.storeProducts[0].displayName:""):this.selectedStyle={item:n,isStyle:!1,isPrompt:!0,displayName:this.storeProducts[0].displayName?this.storeProducts[0].displayName:""}}this.selectedStyle&&(this.selectedStyle.isPrompt=!1,this.selectedStyle.isStyle=!0,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle))}this.isLoaded=!0},t=>{this.isLoaded=!0})}getPrompts(){this.mediaContentService.getPrompts(A.Jl.Photoshoot,t=>{t&&(this.prompts=t.prompts)},t=>{})}focusIn(){this.isFocused=!0}onFocusOut(t){this.isFocused=t}focusOut(){this.isFocused=!1}generate(){if(!this.aiPhotoService.inProgress){if(this.aiPhotoService.isCancel)return void this.toast.showErrorSingle(x.b.message.uploadNewImage);if(this.aiPhotoService.imgUrl&&this.aiPhotoService.originalImageUrlDuo){if(this.selectedStyle.item&&(!this.selectedStyle.item.imageJson||!this.selectedStyle.item.imageJson.trim()))return;if(this.user&&this.user.remainingCoins>=this.quality){const t={imageUrl:this.aiPhotoService.imgUrl,featureType:h.do.Duo_Photoshoot,isCustomPrompt:"panel-1"==this.activeAccPanelId?1:0,...this.selectedStyle&&this.selectedStyle.item&&this.selectedStyle.item.imageJson&&{textPrompt:this.selectedStyle.item.imageJson},...this.aiPhotoService.originalImageUrlDuo&&{data:{person_url:this.aiPhotoService.originalImageUrlDuo}}};this.aiPhotoService.inProgress=!0,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),this.aiPhotoService.generateImage(t,n=>{if(n&&n.assetId){n.maskUrl&&!this.aiPhotoService.maskUrl&&(this.aiPhotoService.maskUrl=n.maskUrl);const i=0;n.toolPrompt=this.selectedStyle?.item?.imageJson?this.selectedStyle?.item?.imageJson:this.customPrompt||"",n.featureType=h.Fs.PhotoShoot,n.toolName=x.b.label.duoPhotoshoot,n.width=Number(this.aiPhotoService.queryParams?._w),n.height=Number(this.aiPhotoService.queryParams?._h),n.activeSubTool=h.do.Duo_Photoshoot,this.selectedStyle.displayName?n.selectedStyle=this.selectedStyle.displayName:this.selectedStyle.item.displayName&&(n.selectedStyle=this.selectedStyle.item.displayName),this.aiPhotoService.checkStatus(n,i,a=>{a.urls&&a.urls.length>0&&(this.user.remainingCoins=a.remainingCalls,this.aiPhotoService.isDirty=!0,this.selectedStyle&&this.selectedStyle.item&&(this.selectedStyle.item.isGenerated=!0),a.maskUrl&&!n.maskUrl&&(this.aiPhotoService.maskUrl=a.maskUrl)),this.aiPhotoService.inProgress=!1,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)},a=>{this.displayErrorMsg(a)})}else this.displayErrorMsg(n)},n=>{this.displayErrorMsg(n)})}else this.aiPhotoService.openAICreditPopup(()=>{this.user=this.authService.currentUser(),this.generate()},this.quality)}else this.aiPhotoService.inProgress=!0,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),this.aiPhotoService.updateImageUrl(this.aiPhotoService.originalImgUrl,h.Fs.PhotoShoot,h.do.Duo_Photoshoot).then(t=>
1{this.aiPhotoService.queryParams=this.route.snapshot.queryParams,this.aiPhotoService.imgUrl=t?.imgUrl,this.generate()}).catch(()=>{this.aiPhotoService.inProgress=!1,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),this.toast.showErrorSingle(x.b.message.uploadNewImage)})}}displayErrorMsg(t=null){this.aiPhotoService.inProgress=!1;let n=t?.description;this.createPopupService.openWarningDialog("Error",n),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}ngOnDestroy(){this.loggedInObserver&&this.loggedInObserver.unsubscribe(),this.usrPropChangedObserver&&this.usrPropChangedObserver.unsubscribe()}onFileUploaded(t){t&&(this.aiPhotoService.inProgress=!1,this.aiUploadImageService.aiUploadImage(t[0],{tab:"photoshoot",subTool:"duo-product"}).then(a=>{a&&(this.styleImageUrl=a?.imgUrl)}))}addStyleImage(t){this.aiPhotoService.inProgress||t.click()}deleteStyleImage(){this.styleImageUrl="",this.imgStrength=100,this.disabled=!this.customPrompt}inputStrength(t,n){let i;i=t.newValue||0===t.newValue?t.newValue:t,this.imgStrength=i}popOvermouseleave(t){this.isClick||t.close()}hideStyleRefPopover(){this.popStylesReferenc1.isOpen&&this.popStylesReferenc1.close()}selectstyleRef(t){t.close?this.styleclick||(this.styleclick=!1,this.hideStyleRefPopover()):(this.styleclick=!0,this.popStylesReferenc1.open())}showStyleRefPopover(){this.popStylesReferenc1.close?(this.styleclick=!1,this.popStylesReferenc1.open()):this.popoverOpen&&(this.popStylesReferenc1.close(),this.styleclick=!1)}changePromptvalue(t){this.changePrompt(t.target.value)}changePrompt(t){this.customPrompt=t,this.selectedStyle.item={imageJson:this.customPrompt},this.selectedStyle.item.customPrompt=this.customPrompt,this.disabled=!this.customPrompt.trim()}onPaste(t){setTimeout(()=>{const i=t.target.value;this.customPrompt=i,this.changePrompt(i)},100)}accPanelChanged(t){this.disabled=!1,this.selectedStyle=null,t.panelId&&(t.nextState&&"panel-1"==t.panelId?(t.isPrompt=!0,t.isStyle=!1,t.isWorkflow=!1,this.disabled=!this.customPrompt,this.activeAccPanelId=t.panelId):t.nextState&&"panel-2"==t.panelId?(this.disabled=!1,t.isStyle=!0,t.isPrompt=!1,t.isWorkflow=!1,this.activeAccPanelId=t.panelId):(t.isPrompt=!1,t.isStyle=!1,this.activeAccPanelId="null",this.disabled=!0),this.selectedStyle||(this.selectedStyle=t),t.isStyle?(this.customPrompt=this.customPrompt,this.selectedStyle.item=this.storeProducts[0].storeProductImages[0],this.selectedStyle.displayName=this.storeProducts[0].displayName,this.productImageId=this.storeProducts[0].storeProductImages[0].productImageId,this.productId=this.storeProducts[0].productId):t.isPrompt&&(this.selectedStyle.item={imageJson:this.customPrompt,customPrompt:this.customPrompt},this.productImageId=0,this.productId=0,this.selectedStyle.displayName=""),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle))}}return(r=l).\u0275fac=function(t){return new(t||r)(e.rXU(te.Z),e.rXU(N.u),e.rXU(U.s),e.rXU(ee),e.rXU(Q.A),e.rXU(y.nX),e.rXU(G.M),e.rXU(C.f),e.rXU(K.W))},r.\u0275cmp=e.VBU({type:r,selectors:[["duo-product-photoshoot-drawer"]],viewQuery:function(t,n){if(1&t&&(e.GBs(To,5),e.GBs(Do,5),e.GBs(ko,5)),2&t){let i;e.mGM(i=e.lsd())&&(n.popoverOpen=i.first),e.mGM(i=e.lsd())&&(n.popStylesReferenc1=i.first),e.mGM(i=e.lsd())&&(n.p=i.first)}},inputs:{toolName:"toolName"},outputs:{genImageEvent:"genImageEvent"},decls:19,vars:7,consts:[["popStylesReferenc",""],[3,"toolName","version"],[1,"position-relative"],[1,"scroll-content","drawer-elements","ai-drawer-elements"],[4,"ngIf"],[1,"position-absolute","fixed-bottom","pb-1","pt-2","ps-3","pe-3","bg-white"],[1,"d-flex","align-items-center","justify-content-center","w-100","mb-1"],["id","gtm-generate",1,"btn","btn-primary-gradient","text-13","btn-h40","w-100","d-flex","align-items-center","justify-content-center",3,"click","disabled"],["class","spinner-border spinner-border-lg me-2 hw-24","role","status",4,"ngIf"],[1,"text-13"],[1,"credit-description","d-flex","align-items-center","justify-content-center","w-100"],[1,"f-12"],[1,"ms-2","me-2"],["src","https://static.lightxeditor.com/assets/images/coin-lottie-s-anim.gif","width","24px","height","24px","alt","Coin Lottie"],[1,"common-container","m-0","p-0","editor-tool-panel"],[1,"d-flex","w-100","flex-column","ngb-btn"],["ngbAccordion","",3,"closeOthers"],["ngbAccordionItem","panel-1",1,"tab-div",3,"shown","hidden","collapsed"],["ngbAccordionHeader",""],[1,"d-flex","align-items-center","wp-100"],["type","button","ngbAccordionButton","",1,"btn-acc-title"],[1,"m-0","btn","btn-link","card-title","ms-3"],["type","button","ngbAccordionButton","",1,"btn-collapse","p-0"],[1,"collapse-text","btn-link"],["name","collapseAcc",1,"f-24"],[1,"expand-text"],["name","expandAcc",1,"f-24"],["ngbAccordionCollapse",""],["ngbAccordionBody",""],["ngbAccordionItem","panel-2",1,"tab-div",3,"shown","hidden","collapsed"],["name","helpicon","placement","right","popoverClass","pop-for-tooltip","ngbPopover","Choose from a collection of predefined artistic effects and aesthetics that can be applied to your generated image.","triggers","mouseenter:mouseleave","popoverTitle","Presets","container","body",1,"ms-1","hw-24","help-icon",3,"mouseenter"],[1,"wp-100","d-flex","align-items-center","justify-content-between","ps-3","pe-2","mt-1"],[1,"text-13","text-dark","text-semi","text-semi"],["name","helpicon","placement","right","popoverClass","pop-for-tooltip","ngbPopover","Provide a text description about the subject, style, setting and any other specific element guiding the AI to understand the exact image you want generated.","triggers","mouseenter:mouseleave","popoverTitle","Enter Prompt","container","body",1,"ms-1","hw-24","help-icon",3,"mouseenter"],[1,"common-container"],[1,"card","drawer-card","mb-2"],[1,"card-body"],[1,"btn-panel"],[1,"card-body","prompt-view"],[1,"textarea-col","position-relative",3,"ngClass"],[1,"text-animation",3,"changePrompt","focusOut","prompts","textPrompt"],["class","prompt-info text-regular position-absolute d-flex align-items-center justify-content-start",4,"ngIf"],[1,"prompt-info","text-regular","position-absolute","d-flex","align-items-center","justify-content-start"],[1,"d-flex","backgound-content","portrait-content","mt-1",2,"padding","0p
1x 7px"],[3,"selectStyleEvent","type","storeProducts","productImageId"],[2,"padding","0px 5px",3,"view"],["role","status",1,"spinner-border","spinner-border-lg","me-2","hw-24"],[1,"sr-only","text-nowrap","border-0","position-absolute","overflow-hidden"],[3,"selectstyleRef","editorType","editorSubTool"]],template:function(t,n){if(1&t){const i=e.RV6();e.nrm(0,"app-file-upload",1),e.j41(1,"div",2)(2,"div",3),e.DNE(3,Fo,33,3,"ng-container",4),e.k0s(),e.j41(4,"div",5)(5,"div",6)(6,"button",7),e.bIt("click",function(){return e.eBV(i),e.Njj(n.generate())}),e.DNE(7,No,3,0,"div",8),e.j41(8,"span",9),e.EFF(9),e.k0s()()(),e.j41(10,"div",10)(11,"span",11),e.EFF(12,"1 generation ="),e.k0s(),e.j41(13,"span",12),e.nrm(14,"img",13),e.k0s(),e.j41(15,"span",11),e.EFF(16),e.k0s()()()(),e.DNE(17,Lo,1,2,"ng-template",null,0,e.C5r)}2&t&&(e.Y8G("toolName",n.toolName)("version","v2"),e.R7$(3),e.Y8G("ngIf",n.isLoaded),e.R7$(3),e.Y8G("disabled",n.disabled||!n.aiPhotoService.originalImageUrlDuo||!n.aiPhotoService.ps_imgUrl),e.R7$(),e.Y8G("ngIf",n.aiPhotoService.inProgress),e.R7$(2),e.JRh(n.aiPhotoService.inProgress?"Processing":n.btnText),e.R7$(7),e.SpI("",n.quality," credit"))},dependencies:[s.YU,s.bT,ae.n,f.WP,f.r6,f.tW,f.x7,f.UA,f.$R,f.ZM,L.b,Te,oe.t,re.P,be.e],styles:['.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]{width:100%;height:110px;border-radius:12px;background:linear-gradient(90deg,#fc5cff05 -4%,#2520f605);padding:.9px 4px 4px}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#c9cad4 -4% 100%);-webkit-mask:linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%) content-box,linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%);-webkit-mask-composite:xor;mask-composite:exclude;z-index:1}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]:hover:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#606576 -4% 100%);-webkit-mask:linear-gradient(90deg,#606576 -4%,#606576 100%) content-box,linear-gradient(90deg,#606576 -4%,#606576 100%);-webkit-mask-composite:xor;mask-composite:exclude;z-index:1}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{resize:none;outline:none;width:100%;height:82px;padding:8px 8px 0;font-size:12px;color:#b0b3bf;border:0px;background:transparent;line-height:18px;position:relative;z-index:2}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar{width:4px;height:4px;border-radius:12px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#e3e3e3;border-radius:12px;margin-top:8px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#9a9a9a;border-radius:12px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:#555}.prompt-view[_ngcontent-%COMP%] .prompt-info[_ngcontent-%COMP%]{font-size:11px;color:#959aa7;margin-top:0;padding-left:8px;height:24px;line-height:normal;width:calc(100% - 8px);bottom:4px;z-index:99}.ai-thumb-list[_ngcontent-%COMP%]{flex-flow:wrap}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%]{height:100%;width:112.5px!important;margin-bottom:16px;cursor:pointer;min-height:112.5px!important;min-width:112.5px!important;-webkit-user-select:none;user-select:none}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%]{transition:transform .2s;min-height:112.5px;min-width:112.5px}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%;height:100%;border-radius:12px!important;max-height:112.5px;min-height:112.5px}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%]:hover{transform:scale(1.03)}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#272b34;font-size:12px;min-height:18px}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%]{min-height:112.5px!important;min-width:112.5px!important}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%]{transition:transform .2s}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%]:hover{transform:none}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{border-radius:12px;border:2px solid #626ADF;padding:3px;transition:transform .2s}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] img[_ngcontent-%COMP%]:hover{transform:scale(1.03)}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#626adf}.info-up[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#c9cad4 -4% 100%)!important;-webkit-mask:linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%) content-box,linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-blue[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff0d -4%,#2520f60d)!important}.info-blue[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#fc5cff -4%,#2520f6)!important;-webkit-mask:linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%) content-box,linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-blue[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#626adf!important}.info-red[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff0d -4%,#2520f60d)!important}.info-red[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#f25555 -4% 100%)!important;-webkit-mask:linear-gradient(90deg,#F25555 -4%,#F25555 100%) content-box,linear-gradient(90deg,#F25555 -4%,#F25555 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-red[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#f25555!important}.fixed-bottom[_ngcontent-%COMP%]{position:fixed!important;width:300px!important;right:auto!important;left:5rem;z-index:99}
1.inner-collapse[_ngcontent-%COMP%] .btn-collapse[_ngcontent-%COMP%]:hover{background:#626adf0d}']}),l})();const Vo=r=>({"justify-content-between":r});function Xo(r,l){if(1&r&&(e.qex(0),e.nrm(1,"ai-shoot",10),e.bVm()),2&r){const o=e.XpG(2);e.R7$(),e.Y8G("featureType",o.toolName)("toolDisplayName",o.toolDisplayName)}}function Ko(r,l){if(1&r&&e.nrm(0,"product-photoshoot-drawer",13),2&r){const o=e.XpG(3);e.Y8G("toolName",o.toolName)}}function $o(r,l){if(1&r&&e.nrm(0,"person-photoshoot-drawer",13),2&r){const o=e.XpG(3);e.Y8G("toolName",o.toolName)}}function Yo(r,l){if(1&r&&e.nrm(0,"headshot-drawer",13),2&r){const o=e.XpG(3);e.Y8G("toolName",o.toolName)}}function zo(r,l){if(1&r&&e.nrm(0,"tryon-drawer",14),2&r){const o=e.XpG(3);e.Y8G("toolName",o.toolName)}}function qo(r,l){if(1&r&&e.nrm(0,"duo-product-photoshoot-drawer",13),2&r){const o=e.XpG(3);e.Y8G("toolName",o.toolName)}}function Ho(r,l){1&r&&(e.qex(0),e.DNE(1,Ko,1,1,"product-photoshoot-drawer",11)(2,$o,1,1,"person-photoshoot-drawer",11)(3,Yo,1,1,"headshot-drawer",11)(4,zo,1,1,"tryon-drawer",12)(5,qo,1,1,"duo-product-photoshoot-drawer",11),e.bVm()),2&r&&(e.R7$(),e.Y8G("ngSwitchCase","photoshoot"),e.R7$(),e.Y8G("ngSwitchCase","modelphotoshoot"),e.R7$(),e.Y8G("ngSwitchCase","headshot"),e.R7$(),e.Y8G("ngSwitchCase","aivirtualtryon"),e.R7$(),e.Y8G("ngSwitchCase","aiduoshoot"))}function Jo(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",3)(1,"div",4)(2,"pi",5),e.bIt("click",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.back())}),e.k0s(),e.j41(3,"span",6),e.EFF(4),e.k0s()(),e.j41(5,"div")(6,"div",7),e.qex(7,8),e.DNE(8,Xo,2,2,"ng-container",9)(9,Ho,6,5,"ng-container",9),e.bVm(),e.k0s()()()}if(2&r){const o=e.XpG();e.R7$(),e.Y8G("ngClass",e.eq3(8,Vo,"aidesign"==o.toolName)),e.R7$(3),e.JRh(o.toolDisplayName),e.R7$(),e.ZvI("middle-drawer ",o.toolName,""),e.R7$(2),e.Y8G("ngSwitch",o.toolName),e.R7$(),e.Y8G("ngIf",1==o.isDynamicTool&&o.isLoaded),e.R7$(),e.Y8G("ngIf",0==o.isDynamicTool&&o.isLoaded)}}let Qo=(()=>{var r;class l{constructor(t,n,i,a,d,g,m,b){this.aiPhotoService=t,this.aiUploadImageService=n,this.toast=i,this.route=a,this.modalService=d,this.removeBgService=g,this.aiWrapperRemoveBgService=m,this.editorService=b,this.toolDisplayName=null,this.toolName=null,this.isLoaded=!0,this.isDynamicTool=0}ngOnInit(){this.isLoaded=!0,this.checkStatusSub=this.aiPhotoService.checkStatusSub.subscribe(t=>{t&&(t.isVideo&&(this.aiPhotoService.inVideoProgress=!1),this.aiPhotoService.inProgress=!1,t.activeSubTool==h.do.Product_Photoshoot&&this.generatedImage(t))}),this.activeToolPanelSubscription=this.editorService.activeToolPanel.subscribe(t=>{if(t?.toolName&&(t?.toolName!=this.toolName&&!t?.changeTool||t?.changeTool)){const n=this.aiPhotoService.getToolByName(t?.toolName,J.sv.PHOTOSHOOT)||{metadata:{featureType:t?.toolName}};n&&(this.isLoaded=!1,setTimeout(()=>{this.selectTool(n)},200))}})}ngAfterViewInit(){if(this.toolName=this.aiPhotoService?.queryParams?.toolName||null,this.toolName){const t=this.aiPhotoService.getToolByName(this.toolName,J.sv.PHOTOSHOOT)||{metadata:{featureType:this.toolName}};t&&this.selectTool(t)}}selectTool(t){this.isDynamicTool=t?.metadata?.isDynamic||0,this.toolName=t?.metadata?.featureType,this.aiPhotoService.selectedTool=this.toolName,this.toolDisplayName=t?.text||"AI "+this.toolName,this.aiPhotoService.sampleImageUrl=t?.metadata?.sampleImageUrl||"",this.isLoaded=!0}reset(){this.toolName=null,this.toolDisplayName=null,this.aiPhotoService.sampleImageUrl="",this.isLoaded=!1}back(){this.reset()}generatedImage(t){t?.activeSubTool==h.do.Product_Photoshoot&&this.aiPhotoService.maskUrl&&!this.aiPhotoService.isRefined&&this.removeBgService.getRemoveBGImageFromMaskUrlForPhotoshoot(this.aiPhotoService.maskUrl,this.aiPhotoService.ps_imgUrl).then(n=>{this.aiWrapperRemoveBgService.removeBgResult=n,this.aiPhotoService.ps_imgUrl=n.url,this.aiWrapperRemoveBgService.originalRemoteMaskDetails={w:n.width,h:n.height},Z.k.checkAndResizeImage(n.inputImage,i=>{this.aiWrapperRemoveBgService.scaledImgUrl=i.src})}).catch(n=>{})}ngOnDestroy(){this.aiPhotoService.deleteQueryParam("toolName"),this.activeToolPanelSubscription&&this.activeToolPanelSubscription.unsubscribe()}}return(r=l).\u0275fac=function(t){return new(t||r)(e.rXU(U.s),e.rXU(G.M),e.rXU(C.f),e.rXU(y.nX),e.rXU(f.Bq),e.rXU(Pn.r),e.rXU(ee),e.rXU(k.x))},r.\u0275cmp=e.VBU({type:r,selectors:[["ai-photo-shoot-drawer"]],decls:3,vars:2,consts:[[1,"drawer-content",3,"hidden"],[3,"selectToolEvent"],["class","tools-container-drawer workFlow-dropdown-panel",4,"ngIf"],[1,"tools-container-drawer","workFlow-dropdown-panel"],[1,"top-section","d-flex","align-items-center","bg-white","ps-3","pe-3",3,"ngClass"],["name","leftarrow",1,"back-icon","me-2","f-24","d-flex","align-items-center","justify-content-center","pointer","border-radius-8",3,"click"],[1,"text-lg","text-dark","text-semi","lh-125"],["customScrollDir","",1,"drawer-scroll","scroll-container"],[3,"ngSwitch"],[4,"ngIf"],[3,"featureType","toolDisplayName"],[3,"toolName",4,"ngSwitchCase"],["class","drawer-elements ai-drawer-elements",3,"toolName",4,"ngSwitchCase"],[3,"toolName"],[1,"drawer-elements","ai-drawer-elements",3,"toolName"]],template:function(t,n){1&t&&(e.j41(0,"div",0)(1,"tool-list-drawer",1),e.bIt("selectToolEvent",function(a){return n.selectTool(a)}),e.k0s()(),e.DNE(2,Jo,10,10,"div",2)),2&t&&(e.Y8G("hidden",n.toolName),e.R7$(2),e.Y8G("ngIf",n.toolName))},dependencies:[s.YU,s.bT,s.ux,s.e1,w.q,L.b,Me.F,Fn,to,po,So,ke.x,Wo],styles:[".tools-container-drawer[_ngcontent-%COMP%]{height:100%}
1.tools-container-drawer[_ngcontent-%COMP%] .top-section[_ngcontent-%COMP%]{height:56px;z-index:99;-webkit-user-select:none;user-select:none;min-height:56px}.tools-container-drawer[_ngcontent-%COMP%] .top-section[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{font-size:14px!important;color:#272b34;line-height:19.07px}.tools-container-drawer[_ngcontent-%COMP%] .person[_ngcontent-%COMP%]{padding-top:56px}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%]{user-select:none;-webkit-user-select:none;height:calc(100vh - 193px - var(--sales-height))}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .scroll-container[_ngcontent-%COMP%]::-webkit-scrollbar-track{margin-top:0}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .ai-thumb-view[_ngcontent-%COMP%]{border-radius:12px;background:#eeedf3;height:134px;position:relative;overflow:hidden;-webkit-user-select:none;user-select:none}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .ai-thumb-view[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:100%;width:auto;object-fit:contain;overflow:hidden}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .ai-thumb-view[_ngcontent-%COMP%]:hover .replace-btn[_ngcontent-%COMP%]{display:flex;z-index:99;position:absolute;background:#0006;align-items:center;justify-content:center;height:100%;width:100%;border-radius:12px;flex-direction:column}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .ai-thumb-view[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%]{display:none}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .ai-thumb-view[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{background:#fff!important;border:0px!important;color:#272b34!important;min-width:124px}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .ai-thumb-view[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{background:linear-gradient(0deg,#626adf0d 0% 100%),#fff!important;color:#272b34}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .ai-thumb-view[_ngcontent-%COMP%] .add-on-404[_ngcontent-%COMP%]{display:flex;z-index:99;position:absolute;background:#0000001a;align-items:center;justify-content:center;height:100%;width:100%;border-radius:12px;flex-direction:column}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%]{border-radius:12px;background:#efeef2;height:134px;position:relative;overflow:hidden;-webkit-user-select:none;user-select:none}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-left[_ngcontent-%COMP%], .tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-right[_ngcontent-%COMP%]{width:132px;height:134px;overflow:hidden;cursor:pointer}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-left[_ngcontent-%COMP%] img[_ngcontent-%COMP%], .tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-right[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:contain}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-left[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%], .tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-right[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%]{display:none}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-left[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%], .tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-right[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{background:#fff!important;border:0px!important;color:#272b34!important;min-width:120px}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-left[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover, .tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-right[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{background:linear-gradient(0deg,#626adf0d 0% 100%),#fff!important;color:#272b34}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-left[_ngcontent-%COMP%] .add-on-404[_ngcontent-%COMP%], .tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-right[_ngcontent-%COMP%] .add-on-404[_ngcontent-%COMP%]{display:flex;z-index:99;position:absolute;background:#0000001a;align-items:center;justify-content:center;height:100%;width:100%;flex-direction:column}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-left[_ngcontent-%COMP%]:hover pi[_ngcontent-%COMP%], .tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-left[_ngcontent-%COMP%]:hover span[_ngcontent-%COMP%], .tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-right[_ngcontent-%COMP%]:hover pi[_ngcontent-%COMP%], .tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-right[_ngcontent-%COMP%]:hover span[_ngcontent-%COMP%]{color:#272b34!important}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-left[_ngcontent-%COMP%]:hover .replace-btn[_ngcontent-%COMP%], .tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-right[_ngcontent-%COMP%]:hover .replace-btn[_ngcontent-%COMP%]{display:flex;z-index:99;position:absolute;background:#0006;align-items:center;justify-content:center;height:100%;width:100%;flex-direction:column}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-left[_ngcontent-%COMP%]{width:131px;border-radius:12px 0 0 12px}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-left[_ngcontent-%COMP%]:hover{background:linear-gradient(90deg,#626adf00,#626adf1a),#efeef2}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-right[_ngcontent-%COMP%]{width:131px;border-radius:0 12px 12px 0}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-right[_ngcontent-%COMP%]:hover{background:linear-gradient(270deg,#626adf00,#626adf1a),#efeef2}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .bg-white[_ngcontent-%COMP%]{background:#fff!important}.tools-container-drawer[_ngcontent-%COMP%] .invisible.visible[_ngcontent-%COMP%]{visibility:visible!important}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer.top-section-p[_ngcontent-%COMP%]{height:calc(100vh - 193px - var(--sales-height))}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer.isresolution-add[_ngcontent-%COMP%]{height:calc(100vh - 235px - var(--sales-height))}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer.top-section-p[_ngcontent-%COMP%]{padding-top:52px}.tools-container-drawer[_ngcontent-%COMP%] .credit-description[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:inline-flex;color:#272b34;font-size:12px}"]}),l})();var it=c(92452),Ke=c(58377);const Zo=["popoverOpen"],ei=["popStylesReferenc1"],ti=["popOver"],ni=["popOver1"],oi=["p"],rt=r=>({"ai-thumb-active":r}),ii=(r,l,o)=>({"info-up":r,"info-blue":l,"info-red":o}),ri=r=>({"avatarify-col":r});function si(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",11)(1,"div",12)(2,"buttons-scroll-menu",13),e.bIt("selectLayout",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.selectFilterProd(n))})("scrollEnd",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.onProductListScrollEnd())}),e.k0s()()()}if(2&r){const o=e.XpG();e.R7$(2),e.Y8G("items",o.storeProducts)("leftscrollMrg",70)("type","aiFilter")("aiPhotoService",o.aiPhotoService)("categoryId",o.productId)}}function ai(r,l){if(1&r&&(e.j41(0,"ul",25)(1,"li")(2,"div",26)(3,"div",27),e.nrm(4,"pi",28),e.k0s(),e.j41(5,"div",29)(6,"div",30),e.EFF(7),e.k0s()()()()()),2&r){const o=l.item;e.R7$(4),e.FS9("name",o.iconName),e.R7$(3),e.JRh(o.text)}}function ci(r,l){if(1&r&&(e.j41(0,"ul",25)(1,"li")(2,"div",31)(3,"div",29)(4,"div",30),e.EFF(5),e.k0s()()()()()),2&r){const o=l.item;e.R7$(5),e.JRh(o.text)}}function li(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",34)(1,"div",35)(2,"img",36),e.bIt("click",function(){const n=e.eBV(o).$implicit,i=e.XpG(3);return e.Njj(i.selectImage(n))}),e.k0s()(),e.j41(3,"span",37),e.EFF(4),e.k0s()()}if(2&r){const o=l.$implicit,t=e.XpG(3);e.Y8G("ngClass",e.eq3(3,rt,o.productId==t.productImageId)),e.R7$(2),e.Y8G("src",o.thumbUrl,e.B4B),e.R7$(2),e.JRh(o.displayName)}}function di(r,l){if(1&r&&(e.j41(0,"div",16)(1,"div",32),e.DNE(2,li,5,5,"div",33),e.k0s()()),2&r){const o=e.XpG(2);e.R7$(2),e.Y8G("ngForOf",o.selectedAiPatterns.storeProducts)}}function _i(r,l){1&r&&(e.qex(0),e.nrm(1,"element-placeholder",38),e.bVm()),2&r&&(e.R7$(),e.Y8G("view","AiPatterns"))}function gi(r,l){if(1&r){const o=e.RV6();e.qex(0),e.j41(1,"div",14)(2,"div",15)(3,"div",16)(4,"div",17)(5,"div",18),e.EFF(6,"Presets"),e.k0s()(),e.j41(7,"div",19)(8,"ng-select",20),e.mxI("ngModelChange",function(n){e.eBV(o);const i=e.XpG();return e.DH7(i.selectedGenderCatId,n)||(i.selectedGenderCatId=n),e.Njj(n)}),e.bIt("change",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.changeGender(n))}),e.DNE(9,ai,8,2,"ng-template",21)(10,ci,6,1,"ng-template",22),e.k0s()()()(),e.j41(11,"div",23),e.DNE(12,di,3,1,"div",24)(13,_i,2,1,"ng-container",9),e.k0s()(),e.bVm()}if(2&r){const o=e.XpG();e.R7$(8),e.Y8G("items",o.genders),e.R50("ngModel",o.selectedGenderCatId),e.Y8G("searchable",!1)("clearable",!1),e.R7$(4),e.Y8G("ngIf",o.selectedAiPatterns),e.R7$(),e.Y8G("ngIf",!o.selectedAiPatterns)}}function pi(r,l){if(1&r){const o=e.RV6();e.j41(0,"text-prompt-animation",61),e.bIt("changePrompt",function(n){e.eBV(o);const i=e.XpG(3);return e.Njj(i.changePrompt(n))})("focusOut",function(n){e.eBV(o);const i=e.XpG(3);return e.Njj(i.onFocusOut(n))}),e.k0s()}if(2&r){const o=e.XpG(3);e.Y8G("prompts",o.prompts)("textPrompt",o.customPrompt)("promptResetHeight",o.promptResetHeight)}}function mi(r,l){if(1&r&&(e.j41(0,"span",62),e.EFF(1),e.k0s()),2&r){const o=e.XpG(3);e.R7$(),e.SpI("",o.customPrompt.length,"/450")}}function hi(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",63)(1,"div",64)(2,"span",18),e.EFF(3,"Style Strength"),e.nrm(4,"pi",65),e.k0s()(),e.j41(5,"div",66)(6,"div",67)(7,"mv-sl
1ider",68),e.bIt("change",function(n){e.eBV(o);const i=e.XpG(3);return e.Njj(i.inputStrength(n,!1))})("slideStop",function(n){e.eBV(o);const i=e.XpG(3);return e.Njj(i.inputStrength(n,!0))}),e.k0s()(),e.j41(8,"div",69)(9,"input",70),e.bIt("ngModelChange",function(n){e.eBV(o);const i=e.XpG(3);return e.Njj(i.inputStrength(n,!0))}),e.k0s()()()()}if(2&r){const o=e.XpG(3);e.R7$(7),e.Y8G("value",o.imgStrength)("min",0)("max",100)("step",1),e.R7$(2),e.Y8G("ngModel",o.imgStrength)}}function ui(r,l){if(1&r){const o=e.RV6();e.qex(0,42),e.j41(1,"div",43)(2,"div",18),e.EFF(3,"Enter Prompt"),e.j41(4,"pi",44),e.bIt("mouseenter",function(){e.eBV(o);const n=e.XpG(2);return e.Njj(n.hideStyleRefPopover())}),e.k0s()(),e.j41(5,"div",45),e.nrm(6,"pi",46,3),e.k0s()(),e.j41(8,"div",47)(9,"div",48)(10,"div",49)(11,"div",50)(12,"div",51)(13,"div",52),e.DNE(14,pi,1,3,"text-prompt-animation",53)(15,mi,2,1,"span",54),e.k0s(),e.j41(16,"div",55)(17,"div",56)(18,"div",57)(19,"span",18),e.EFF(20,"Style Reference"),e.j41(21,"pi",58,4),e.bIt("mouseenter",function(){e.eBV(o);const n=e.XpG(2);return e.Njj(n.showStyleRefPopover())})("mouseleave",function(){e.eBV(o);const n=e.XpG(2);return e.Njj(n.showStyleRefPopover())}),e.k0s()()()(),e.j41(23,"div",56)(24,"app-file-upload",59),e.bIt("styleImageUrlChange",function(n){e.eBV(o);const i=e.XpG(2);return e.Njj(i.styleImageUrl=n)}),e.k0s()()(),e.DNE(25,hi,10,5,"div",60),e.nrm(26,"div"),e.k0s()()()()(),e.bVm()}if(2&r){const o=e.XpG(2),t=e.sdS(10),n=e.sdS(12);e.R7$(6),e.Y8G("autoClose",!0)("ngbPopover",t),e.R7$(7),e.Y8G("ngClass",e.sMw(9,ii,o.customPrompt.length,o.isFocused,o.customPrompt.length>449)),e.R7$(),e.Y8G("ngIf",o.promptLoaded),e.R7$(),e.Y8G("ngIf",o.customPrompt.length),e.R7$(6),e.Y8G("ngbPopover",n),e.R7$(3),e.Y8G("version","v5")("styleImageUrl",o.styleImageUrl),e.R7$(),e.Y8G("ngIf",o.styleImageUrl)}}function Pi(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",77)(1,"div",35)(2,"img",78),e.bIt("click",function(){const n=e.eBV(o).$implicit,i=e.XpG(4);return e.Njj(i.selectAvatarifyImage(n))}),e.k0s()(),e.j41(3,"span",37),e.EFF(4),e.k0s()()}if(2&r){const o=l.$implicit,t=e.XpG(4);e.Y8G("ngClass",e.eq3(3,rt,o.productImageId==t.productImageId)),e.R7$(2),e.Y8G("src",o.thumbUrl,e.B4B),e.R7$(2),e.JRh(o.displayName)}}function fi(r,l){1&r&&(e.j41(0,"div",80),e.nrm(1,"div",81)(2,"span",82),e.k0s())}function bi(r,l){if(1&r&&(e.qex(0),e.DNE(1,fi,3,0,"div",79),e.bVm()),2&r){const o=e.XpG(4);e.R7$(),e.Y8G("ngForOf",o.paginationPlaceholders)}}function Ci(r,l){if(1&r&&(e.j41(0,"div",73)(1,"div",74)(2,"div",75),e.DNE(3,Pi,5,5,"div",76)(4,bi,2,1,"ng-container",9),e.k0s()()()),2&r){const o=e.XpG(3);e.R7$(2),e.Y8G("ngClass",e.eq3(3,ri,o.isavatarify)),e.R7$(),e.Y8G("ngForOf",o.selectedFilters.storeProductImages),e.R7$(),e.Y8G("ngIf",o.isLoadingMoreProductImages&&!o.isProductImagesEnd)}}function vi(r,l){1&r&&(e.qex(0),e.nrm(1,"element-placeholder",83),e.bVm()),2&r&&(e.R7$(),e.Y8G("view","AiPatterns"))}function Ii(r,l){if(1&r&&(e.qex(0),e.j41(1,"div",71),e.DNE(2,Ci,5,5,"div",72)(3,vi,2,1,"ng-container",9),e.k0s(),e.bVm()),2&r){const o=e.XpG(2);e.R7$(2),e.Y8G("ngIf",o.selectedFilters),e.R7$(),e.Y8G("ngIf",!o.storeProducts.length)}}function xi(r,l){if(1&r){const o=e.RV6();e.qex(0),e.j41(1,"tab-button",39),e.bIt("modeChange",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.onModeButtonClick(n))}),e.k0s(),e.j41(2,"div",40)(3,"div",15),e.DNE(4,ui,27,13,"ng-container",41)(5,Ii,4,2,"ng-container",9),e.k0s()(),e.bVm()}if(2&r){const o=e.XpG();e.R7$(),e.Y8G("selectedMode",o.selectedMode),e.R7$(3),e.Y8G("ngIf","custom"===o.selectedMode),e.R7$(),e.Y8G("ngIf","presets"===o.selectedMode)}}function Mi(r,l){if(1&r){const o=e.RV6();e.j41(0,"ai-choose-styles",84),e.bIt("Gendervalue",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.changeGender(n))})("selectImage",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.selectImage(n))}),e.k0s()}if(2&r){const o=e.XpG();e.Y8G("selectedGenderCatId",o.selectedGenderCatId)("productImageId",o.productImageId)("editorType","avatar")("products",o.selectedAiPatterns)}}function Oi(r,l){if(1&r){const o=e.RV6();e.j41(0,"ai-prompts-popover",85),e.bIt("selectPrompt",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.selectPrompt(n))}),e.k0s()}if(2&r){const o=e.XpG();e.Y8G("items",o.prompts)}}function yi(r,l){if(1&r){const o=e.RV6();e.j41(0,"ai-style-reference-popover",86),e.bIt("selectstyleRef",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.selectstyleRef(n))}),e.k0s()}2&r&&e.Y8G("editorType","avatar")("editorSubTool","")}let wi=(()=>{var r;class l{constructor(t,n,i,a,d,g,m,b,O){this.mediaContentService=t,this.aiPhotoService=n,this.route=i,this.authService=a,this.createPopupService=d,this.aiUploadImageService=g,this.paymentService=m,this.toast=b,this.hostRef=O,this.selectedMode="presets",this.toolName=h.Fs.Avatar,this.tempStylesHistory=[],this.genders=[{categoryId:"203",text:"Male",iconName:"male"},{categoryId:"204",text:"Female",iconName:"female"}],this.selectedGenderCatId="203",this.selectedGenderName="Male",this.aiPatterns=[],this.productId=0,this.genImageEvent=ne
1w e.bkB,this.btnText="Generate",this.disabled=!1,this.storeProducts=[],this.prompts=[],this.activeAccPanelId="panel-2",this.customPrompt="",this.isFocused=!1,this.pageNumber=0,this.pageNumberproduct=0,this.productListPageNumber=0,this.isLoadingMoreProductImages=!1,this.isLoadingMoreProducts=!1,this.isProductImagesEnd=!1,this.isProductsEnd=!1,this.isavatarify=!1,this.styleImageUrl="",this.imgStrength=100,this.promptLoaded=!0,this.styleclick=!1,this.paginationPlaceholders=[0,1],this.drawerScrollEl=null,this.drawerScrollHandler=E=>this.onDrawerScroll(E),this.promptResetHeight=!1,this.user=this.authService.currentUser(),this.loggedInObserver=this.authService.loggedIn.subscribe(E=>{this.user=this.authService.currentUser()}),this.usrPropChangedObserver=this.authService.usrPropChanged.subscribe(E=>{this.user=this.authService.currentUser()}),this.configSubs=this.paymentService.configUpdated.subscribe(()=>{this.config=this.paymentService?.config?.creditInfo})}ngOnInit(){let t,n,i;this.isavatarify=!1,[t,n,i]=this.aiPhotoService.getQueryParams(h.Fs.Avatar),Promise.all([this.getCategoryDetails(),this.getCategoryAvatarifyDetails()]).then(([a,d])=>{this.selectAvatarify(i,t,n)})}ngAfterViewInit(){this.drawerScrollEl=this.getDrawerScroll(),this.drawerScrollEl&&this.drawerScrollEl.addEventListener("scroll",this.drawerScrollHandler,{passive:!0})}changeGender(t){t&&(this.selectedGenderCatId=t.categoryId,this.selectedGenderName=t.text,this.filterByGender(),this.selectedAiPatterns&&(this.selectImage(this.selectedAiPatterns.storeProducts[0]),this.productImageId=this.selectedStyle.productId))}filterByGender(){this.selectedAiPatterns=this.aiPatterns.filter(t=>t.categoryId==this.selectedGenderCatId)[0]}selectImage(t){this.productImageId=t.productId,this.selectedStyle=t,t.productImageIds&&!this.selectedStyle.originalProdImageIds&&(this.selectedStyle.originalProdImageIds=JSON.parse(JSON.stringify(this.selectedStyle.productImageIds))),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),this.popover?.close()}selectAvatarifyImage(t){this.promptResetHeight=!0,setTimeout(()=>{this.promptResetHeight=!1}),t&&(this.productImageId=t.productImageId,this.selectedStyle||(this.selectedStyle={}),this.selectedStyle&&(this.selectedProduct=t,this.selectedStyle=t,this.selectedStyle.mode=this.selectedMode,this.selectedStyle.item=t),this.selectedStyle.displayName=this.selectedProduct?.displayName?this.selectedProduct.displayName:"",this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle))}onDrawerScroll(t){const n=t?.target;n&&n.scrollHeight-(n.scrollTop+n.clientHeight)<=24&&this.loadMoreSelectedProductImages()}getCategoryAvatarifyDetails(){return new Promise((t,n)=>{this.loadAvatarifyProducts(!0,i=>t(i),i=>n(i))})}onProductListScrollEnd(){this.loadAvatarifyProducts(!1)}selectAvatarify(t,n,i){const a=this.storeProducts.filter(g=>g.productId==n);if(n&&a?.length>0){this.isavatarify=!0,this.productId=n,this.productImageId=i;const g=this.storeProducts.findIndex(m=>m.productId==this.productId);if(-1!=g){let m=this.storeProducts[g];this.storeProducts.splice(g,1),this.storeProducts.splice(1,0,m)}this.selectedFilters=this.storeProducts.filter(m=>m.productId==this.productId)[0],this.resetSelectedProductPagination(this.selectedFilters),this.getPrompts(this.productId),this.modelTypeId=this.selectedFilters?.modelTypeId,this.selectedStyle={mode:this.selectedMode},this.loadSelectedProductImages(!0,this.productImageId),this.selectedStyle?.item&&(this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle))}const d=this.genders.find(g=>g.categoryId==String(t));if(this.selectedGenderCatId=d?.categoryId||this.genders[0].categoryId,this.selectedGenderName=d?.text||this.genders[0].text,this.filterByGender(),!this.isavatarify&&this.selectedAiPatterns){if(this.isavatarify=!1,this.productId=0,n){const m=this.selectedAiPatterns.storeProducts.findIndex(b=>b.productId==n);if(-1!=m){let b=this.selectedAiPatterns.storeProducts[m];this.selectedAiPatterns.storeProducts.splice(m,1),this.selectedAiPatterns.storeProducts.splice(0,0,b)}}const g=this.selectedAiPatterns.storeProducts.filter(m=>m.productId==n);g?.length>0?this.selectImage(g[0]):this.selectedAiPatterns.storeProducts?.length&&this.selectImage(this.selectedAiPatterns.storeProducts[0])}}getCategoryDetails(){return new Promise((t,n)=>{this.mediaContentService.getCategoryDetails(A.KK.AIAvatar,it.i.Main,i=>{this.config=this.paymentService?.config?.creditInfo,this.isLoaded=!0,i&&i.storeCategory&&(this.aiPatterns=i.storeCategory.subCategoryList,this.filterByGender()),t(i)},i=>{n(i)})})}generate(){if(!this.aiPhotoService.isCancel||this.aiPhotoService.imgUrl){if(!this.aiPhotoService.inProgress)if(this.aiPhotoService.imgUrl){let t=0;if(this.user&&this.user.remainingCoins>=this.config?.avatarify){if(this.selectedStyle?.productImageIds&&(t=this.aiPhotoService.getRandomItem(this.selectedStyle.productImageIds),!t))return;const n={imageUrl:this.aiPhotoService.imgUrl,featureType:this.isavatarify?"avatarify":this.aiPhotoService.selectedTool,...!this.isavatarify&&t&&{productImageId:t},...!this.isavatarify&&this.selectedStyle&&this.selectedStyle.item&&this.selectedStyle.item.imageJson&&{textPrompt:this.selectedStyle.item.imageJson},...this.isavatarify&&"custom"==this.selectedMode&&this.customPrompt.trim()&&{textPrompt:this.customPrompt.trim()},isCustomPrompt:this.isavatarify&&this.selectedMode==h.y9.Custom?1:0,...this.isavatarify&&this.modelTypeId&&{model:this.modelTypeId},quality:1,..."presets"==this.selectedMode&&this.isavatarify&&this.selectedStyle&&this.selectedStyle.item&&this.selectedStyle.item.imageJson&&{referenceImageUrl:this.selectedStyle.item.imgUrl?this.selectedStyle.item.imgUrl:""},...this.isavatarify&&this.selectedStyle?.item?.productImageId&&{productImageId:this.selectedStyle.item.productImageId},productId:this.productId?this.productId:this.selectedStyle.productId,..."custom"==this.selectedMode&&this.isavatarify&&this.styleImageUrl&&{styleImageUrl:this.styleImageUrl},..."custom"==this.selectedMode&&this.isavatarify&&{styleStrength:this.styleImageUrl?this.imgStrength/100:0}};this.aiPhotoService.startGenerationProgress({featureType:this.isavatarify?"avatarify":this.aiPhotoService.selectedTool||h.Fs.Avatar}),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),this.aiPhotoService.generateImage(n,i=>{i&&i.assetId?(i.featureType=h.Fs.Avatar,i.toolName=x.b.label.aiAvatar,this.selectedStyle.displayName?i.selectedStyle=this.selectedStyle.displayName:this.selectedStyle.item.displayName&&(i.selectedStyle=this.selectedStyle.item.displayName),this.aiPhotoService.checkStatus(i,0,d=>{d&&d.urls&&d.urls.length>0?(this.user.remainingCoins=d.remainingCalls,this.selectedStyle.mode==h.y9.Presets?this.selectedStyle.presetGen=!0:this.selectedStyle.mode==h.y9.Custom&&(this.selectedStyle.customGen=!0),this.aiPhotoService.isDirty=!0,this.selectedStyle.productImageIds?(this.selectedStyle.isGenerated=!0,this.aiPhotoService.deleteItem(this.selectedStyle.productImageIds,t),0===this.selectedStyle.productImageIds.length&&this.selectedStyle.originalProdImageIds.length>0&&(this.selectedStyle.productImageIds=JSON.parse(JSON.stringify(this.selectedStyle.originalProdImageIds)))):this.selectedStyle&&this.selectedStyle.item&&(this.selectedStyle.item.isGenerated=!0),d.isAvtarify=this.isavatarify):this.aiPhotoService.clearGenerationProgress(),this.btnText=(this.isavatarify&&this.aiPhotoService.changeBtnText(this.selectedStyle),this.aiPhotoService.changeBtnText(this.selectedStyle))},d=>{this.displayErrorMsg(d)})):this.displayErrorMsg(i)},i=>{this.displayErrorMsg(i)})}else this.aiPhotoService.openAICreditPopup(()=>{this.user=this.authService.currentUser(),this.generate()},this.config?.avatarify)}else this.aiPhotoService.inProgress=!0,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),this.aiPhotoService.updateImageUrl(this.aiPhotoService.originalImgUrl,h.Fs.Avatar).then(t=>
1{this.aiPhotoService.queryParams=this.route.snapshot.queryParams,this.aiPhotoService.imgUrl=t?.imgUrl,this.generate()}).catch(()=>{this.aiPhotoService.inProgress=!1,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),this.toast.showErrorSingle(x.b.message.uploadNewImage)})}else this.toast.showErrorSingle(x.b.message.uploadNewImage)}displayErrorMsg(t=null){this.aiPhotoService.clearGenerationProgress();let n=t?.description;this.createPopupService.openWarningDialog("Error",n),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}ngOnDestroy(){this.drawerScrollEl&&(this.drawerScrollEl.removeEventListener("scroll",this.drawerScrollHandler),this.drawerScrollEl=null),this.configSubs&&this.configSubs.unsubscribe(),this.loggedInObserver&&this.loggedInObserver.unsubscribe(),this.usrPropChangedObserver&&this.usrPropChangedObserver.unsubscribe()}selectFilterProd(t){if(!(t?.productId&&t.productId>0&&t.productId===this.productId&&this.selectedFilters?.productId===t.productId)&&(t?.productId&&!(t.productId<=0)||this.isavatarify||0!==this.productId)){if(this.scrollDrawerToTop(),this.disabled=!1,t.productId&&t.productId>0){if(this.productId=t.productId,this.productId&&this.tempStylesHistory?.length){const n=this.tempStylesHistory.findIndex(i=>i.productId==this.productId);-1!=n?(this.styleImageUrl=this.tempStylesHistory[n].styleImageUrl,this.customPrompt=this.tempStylesHistory[n].customPrompt):(this.styleImageUrl="",this.customPrompt="")}this.isavatarify=!0,this.modelTypeId=t.modelTypeId,this.selectedFilters=this.storeProducts.filter(n=>n.productId==this.productId)[0],this.resetSelectedProductPagination(this.selectedFilters),this.productImageId=0,this.promptLoaded=!1,this.loadSelectedProductImages(!0),this.getPrompts(this.productId,()=>{setTimeout(()=>{this.promptLoaded=!0,this.customPrompt="",this.selectedMode==h.y9.Custom&&(this.disabled=!0)})})}else this.isavatarify=!1,this.isProductImagesEnd=!0,this.selectedAiPatterns&&(this.productId=0,this.selectImage(this.selectedAiPatterns.storeProducts[0]));this.selectedMode==h.y9.Custom&&this.isavatarify&&(this.disabled=!this.customPrompt.trim())}}resetSelectedProductPagination(t){this.pageNumberproduct=0,this.isLoadingMoreProductImages=!1,this.isProductImagesEnd=!t||!t.productId}loadAvatarifyProducts(t,n,i){if(this.isLoadingMoreProducts||!t&&this.isProductsEnd)return void(n&&n());const a=(0,B.vt)(t,this.productListPageNumber);this.isLoadingMoreProducts=!0,this.mediaContentService.getProductListing(A.KK.AIAvatarify,a,d=>{const g=d?.storeProducts||[];t?this.storeProducts=[{productId:0,displayName:"Presets",storeProductImages:[]},...g]:g.length&&(this.storeProducts=(0,B.cb)(this.storeProducts,g,"productId")),this.productListPageNumber=a,this.isProductsEnd=(0,B.HC)(g.length,l.PRODUCT_LIST_PAGE_SIZE),this.isLoadingMoreProducts=!1,this.isLoaded=!0,n&&n(d)},d=>{this.isLoadingMoreProducts=!1,this.isLoaded=!0,i&&i(d)},null,it.i.Main,l.PRODUCT_LIST_PAGE_SIZE)}loadMoreSelectedProductImages(){this.selectedMode!==h.y9.Presets||!this.selectedFilters?.productId||this.selectedFilters.productId<=0||this.isLoadingMoreProductImages||this.isProductImagesEnd||this.loadSelectedProductImages(!1)}loadSelectedProductImages(t,n=0){const i=this.selectedFilters?.productId;if(!i||i<=0)return void(this.isProductImagesEnd=!0);if(this.isLoadingMoreProductImages)return;const a=(0,B.vt)(t,this.pageNumberproduct);this.isLoadingMoreProductImages=!0,t&&(this.pageNumberproduct=0,this.isProductImagesEnd=!1),this.mediaContentService.getTemplateByProductId(i,a,d=>{const g=this.storeProducts.find(b=>b.productId===i),m=d?.storeProductImages||[];if(!g)return this.isLoadingMoreProductImages=!1,void(this.isProductImagesEnd=!0);if(t?g.storeProductImages=[]:g.storeProductImages||(g.storeProductImages=[]),m.length){const b=g.storeProductImages.length;g.storeProductImages=(0,B.cb)(g.storeProductImages,m,"productImageId"),this.isProductImagesEnd=(0,B.HC)(m.length,l.PRODUCT_IMAGE_PAGE_SIZE,g.storeProductImages.length-b)}else this.isProductImagesEnd=!0;this.selectedFilters=g,this.pageNumberproduct=a,this.isLoadingMoreProductImages=!1,t&&this.selectDefaultProductImage(n)},()=>{this.isLoadingMoreProductImages=!1},null,l.PRODUCT_IMAGE_PAGE_SIZE)}selectDefaultProductImage(t=0){const n=this.selectedFilters?.storeProductImages||[];if(!n.length)return void(this.productImageId=0);if(t){const a=n.findIndex(d=>d.productImageId==t);if(a>0){const d=n[a];n.splice(a,1),n.splice(0,0,d)}}const i=n[0];this.selectedStyle||(this.selectedStyle={}),this.selectAvatarifyImage(i),this.selectedStyle.mode=this.selectedMode}getPrompts(t,n=null){this.mediaContentService.getPrompts(A.Jl.avatarify,i=>
1{i&&(this.prompts=i.prompts),n&&n()},i=>{n&&n()},t)}focusIn(){this.isFocused=!0}onFocusOut(t){this.isFocused=t}focusOut(){this.isFocused=!1}selectPrompt(t){this.customPrompt=t.prompt,this.selectedStyle.item=t,this.selectedStyle.isPrompt=!0,this.selectedStyle.isStyle=!1,this.selectedStyle.item.imageJson=t.prompt,this.disabled=!this.customPrompt,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),setTimeout(()=>{this.isFocused=!1})}changePrompt(t){this.customPrompt=t,this.selectedStyle.item={imageJson:this.customPrompt},this.selectedStyle.item.customPrompt=this.customPrompt,this.disabled=!this.customPrompt.trim(),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}onFileUploaded(t){t&&(this.aiPhotoService.inProgress=!1,this.aiUploadImageService.aiUploadImage(t[0],{fromEditor:"header",toolName:this.toolName}).then(a=>{if(a&&(this.styleImageUrl=a?.imgUrl,this.productId)){const d=this.tempStylesHistory.findIndex(g=>g.productId==this.productId);-1==d?this.tempStylesHistory.push({productId:this.productId,styleImageUrl:this.styleImageUrl,customPrompt:this.customPrompt}):(this.tempStylesHistory[d].styleImageUrl=this.styleImageUrl,this.tempStylesHistory[d].customPrompt=this.customPrompt)}}))}addStyleImage(t){this.aiPhotoService.inProgress||t.click()}deleteStyleImage(){this.styleImageUrl="",this.imgStrength=100,this.disabled=!this.customPrompt}inputStrength(t,n){let i;i=t.newValue||0===t.newValue?t.newValue:t,this.imgStrength=i}hideStyleRefPopover(){this.popStylesReferenc1.isOpen&&this.popStylesReferenc1.close()}selectstyleRef(t){t.close?this.styleclick||(this.styleclick=!1,this.hideStyleRefPopover()):(this.styleclick=!0,this.popStylesReferenc1.open())}showStyleRefPopover(){this.popStylesReferenc1.close?(this.styleclick=!1,this.popStylesReferenc1.open()):this.popoverOpen&&(this.popStylesReferenc1.close(),this.styleclick=!1)}onModeButtonClick(t){if(this.promptResetHeight=!0,setTimeout(()=>{this.promptResetHeight=!1}),this.selectedMode=t,this.disabled=!1,"custom"===t)this.selectedStyle||(this.selectedStyle={}),this.disabled=!this.customPrompt,this.selectedStyle.item={imageJson:this.customPrompt,customPrompt:this.customPrompt},this.selectedStyle.mode=this.selectedMode,this.productImageId=0,this.modelTypeId=0,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle);else if("presets"===t){if(this.disabled=!1,this.btnText="Generate via Presets",this.selectedStyle||(this.selectedStyle={}),this.selectedStyle.mode=this.selectedMode,this.selectedFilters&&this.selectedFilters.storeProductImages&&this.selectedFilters.storeProductImages.length)if(this.productImageId){const n=this.selectedFilters.storeProductImages.find(i=>i.productImageId===this.productImageId)||this.selectedFilters.storeProductImages[0];this.selectedStyle.item=n,this.productImageId=n.productImageId,this.modelTypeId=this.selectedFilters.modelTypeId}else this.modelTypeId=this.selectedFilters.modelTypeId,this.selectedStyle.item=this.selectedFilters.storeProductImages[0],this.productImageId=this.selectedFilters.storeProductImages[0].productImageId;this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}}getDrawerScroll(){return this.hostRef.nativeElement.closest(".drawer-scroll")||this.hostRef.nativeElement.querySelector(".scroll-content")}scrollDrawerToTop(){setTimeout(()=>{const t=this.getDrawerScroll();t&&t.scrollTop>0&&t.scrollTo({top:0,behavior:"auto"})},0)}}return(r=l).PRODUCT_IMAGE_PAGE_SIZE=20,r.PRODUCT_LIST_PAGE_SIZE=50,r.\u0275fac=function(t){return new(t||r)(e.rXU(te.Z),e.rXU(U.s),e.rXU(y.nX),e.rXU(N.u),e.rXU(Q.A),e.rXU(G.M),e.rXU(K.W),e.rXU(C.f),e.rXU(e.aKT))},r.\u0275cmp=e.VBU({type:r,selectors:[["avatar-drawer"]],viewQuery:function(t,n){if(1&t&&(e.GBs(Zo,5),e.GBs(ei,5),e.GBs(ti,5),e.GBs(ni,5),e.GBs(oi,5)),2&t){let i;e.mGM(i=e.lsd())&&(n.popoverOpen=i.first),e.mGM(i=e.lsd())&&(n.popStylesReferenc1=i.first),e.mGM(i=e.lsd())&&(n.popover=i.first),e.mGM(i=e.lsd())&&(n.popOver1=i.first),e.mGM(i=e.lsd())&&(n.p=i.first)}},inputs:{toolName:"toolName"},outputs:{genImageEvent:"genImageEvent"},decls:13,vars:7,consts:[["popContentChooseStyles",""],["popContent",""],["popStylesReferenc",""],["popOver","ngbPopover"],["popStylesReferenc1","ngbPopover"],[3,"toolName"],[1,"position-relative",2,"height","max-content"],[1,"scroll-content","drawer-elements","ai-drawer-elements",3,"scroll"],["class","d-flex align-items-center justify-content-center bg-white filter-category",4,"ngIf"],[4,"ngIf"],[3,"btnClick","disabled","btnText","credit"],[1,"d-flex","align-items-center","justify-content-center","bg-white","filter-category"],[1,"colors-bg","sticker-buttons-scroll","scrollWidth-300"],[3,"selectLayout","scrollEnd","items","leftscrollMrg","type","aiPhotoService","categoryId"],[1,"common-container","m-0","p-0","editor-tool-panel","card","ps-3","pe-3","pt-2","border-0"],[1,"d-flex","w-100","flex-column","ngb-btn"],[1,"d-flex","w-100","flex-column"],[1,"d-flex","align-items-center","wp-100","h-32"],[1,"text-normal","text-dark","text-semi","lh-125"],[1,"d-flex","wp-100"],["bindLabel","text","bindValue","categoryId",1,"w-100","c-ng-select","mt-1","mb-2",3,"ngModelChange","change","items","ngModel","searchable","clearable"],["ng-label-tmp",""],["ng-option-tmp",""],[1,"d-flex","w-100","flex-column","mt-2"],["class","d-flex w-100 flex-column",4,"ngIf"],[1,"list-unstyled","w-100","mb-0","text-black"],[1,"row","g-0","align-items-center"],[1,"col-1","me-2","text-center"],[1,"grey-600","f-16",3,"name"],[1,"col-10"],[1,"text-13","grey-800","text-semi"],[1,"row","g-0","align-items-center","h-48"],[1,"ai-thumb-list","d-flex","align-items-center","justify-content-between"],["class","ai-thumb-col d-flex align-items-center flex-column",3,"ngClass",4,"ngFor","ngForOf"],[1,"ai-thumb-col","d-flex","align-items-center","flex-column",3,"ngClass"],[1,"img-col","d-flex","align-items-center","border-radius-12","mb-1"],["width","115px","height","115px",3,"click","
1src"],[1,"text-semi","w-100","text-center"],[3,"view"],[3,"modeChange","selectedMode"],[1,"common-container","m-0","p-0","editor-tool-panel","card","border-0"],["class","drawer-card",4,"ngIf"],[1,"drawer-card"],[1,"wp-100","d-flex","align-items-center","justify-content-between","ps-3","pe-3","pt-2"],["name","helpicon","placement","right","popoverClass","pop-for-tooltip","ngbPopover","Provide a text description about the subject, style, setting and any other specific element guiding the AI to understand the exact image you want generated.","triggers","mouseenter:mouseleave","popoverTitle","Enter Prompt","container","body",1,"ms-1","hw-24","help-icon",3,"mouseenter"],["placement","right","ngbTooltip","Suggested Prompt","tooltipClass","tooltip-custom-all","container","body",1,"lampIcon","hw-32"],["name","lampicon","placement","right","container","body","popoverClass","background-prompt",1,"pointer","f-32","lampicon",3,"autoClose","ngbPopover"],[1,"common-container"],[1,"card","drawer-card","mb-0"],[1,"card-body"],[1,"btn-panel"],[1,"card-body","prompt-view"],[1,"textarea-col","position-relative",3,"ngClass"],["class","text-animation",3,"prompts","textPrompt","promptResetHeight","changePrompt","focusOut",4,"ngIf"],["class","prompt-info text-regular position-absolute d-flex align-items-center justify-content-start",4,"ngIf"],[1,"d-flex","flex-column","align-items-center","mt-3"],[1,"w-100"],[1,"h-32","mb-1"],["name","helpicon","placement","right","container","body","popoverClass","background-style pt-0 pb-3 style-ref-pop-height h-auto background-prompt-popover","autoClose","outside",1,"ms-1","help-icon",3,"mouseenter","mouseleave","ngbPopover"],[1,"w-100",3,"styleImageUrlChange","version","styleImageUrl"],["class","d-flex w-100 flex-column prompt-view mb-1",4,"ngIf"],[1,"text-animation",3,"changePrompt","focusOut","prompts","textPrompt","promptResetHeight"],[1,"prompt-info","text-regular","position-absolute","d-flex","align-items-center","justify-content-start"],[1,"d-flex","w-100","flex-column","prompt-view","mb-1"],[1,"d-flex","align-items-center","justify-content-between","wp-100","mb-1","h-32"],["name","helpicon","placement","right","popoverClass","pop-for-tooltip","ngbPopover","Higher style strength makes the generated image look more like your reference, while lower strength makes it look less similar.","triggers","mouseenter:mouseleave","popoverTitle","Style Strength","container","body",1,"ms-1","hw-24","help-icon"],[1,"d-inline-flex","align-items-center","justify-content-between"],[1,"col-sm-9","p-0"],[1,"opacity-slider",2,"width","100%",3,"change","slideStop","value","min","max","step"],[1,"col-sm-2","p-0"],["type","text","numberSettings","","min","0","max","100","separatorLimit","100",1,"form-control","form-input-sm","text-normal","text-black","float-end",3,"ngModelChange","ngModel"],[1,"d-flex","backgound-content","portrait-content","ps-3","pe-3","pt-3"],["class","d-flex w-100 pane-section flex-column",4,"ngIf"],[1,"d-flex","w-100","pane-section","flex-column"],[1,"content"],[1,"ai-thumb-list","d-flex","align-items-center","justify-content-between",3,"ngClass"],["class","ai-thumb-col d-flex align-items-center justify-content-center flex-column",3,"ngClass",4,"ngFor","ngForOf"],[1,"ai-thumb-col","d-flex","align-items-center","justify-content-center","flex-column",3,"ngClass"],["disableRC","","width","112px","height","112px",3,"click","src"],["class","ai-thumb-col d-flex align-items-center justify-content-center flex-column placeholder-thumb",4,"ngFor","ngForOf"],[1,"ai-thumb-col","d-flex","align-items-center","justify-content-center","flex-column","placeholder-thumb"],[1,"img-col","d-flex","align-items-center","border-radius-12","mb-1","skeleton-box"],[1,"skeleton-line"],[2,"padding","0px 5px",3,"view"],[3,"Gendervalue","selectImage","selectedGenderCatId","productImageId","editorType","products"],[3,"selectPrompt","items"],[3,"selectstyleRef","editorType","editorSubTool"]],template:function(t,n){if(1&t){const i=e.RV6();e.nrm(0,"app-file-upload",5),e.j41(1,"div",6)(2,"div",7),e.bIt("scroll",function(d){return e.eBV(i),e.Njj(n.onDrawerScroll(d))}),e.DNE(3,si,3,5,"div",8)(4,gi,14,6,"ng-container",9)(5,xi,6,3,"ng-container",9),e.k0s()(),e.j41(6,"generate-button",10),e.bIt("btnClick",function(){return e.eBV(i),e.Njj(n.generate())}),e.k0s(),e.DNE(7,Mi,1,4,"ng-template",null,0,e.C5r)(9,Oi,1,1,"ng-template",null,1,e.C5r)(11,yi,
11,2,"ng-template",null,2,e.C5r)}2&t&&(e.Y8G("toolName",n.toolName),e.R7$(3),e.Y8G("ngIf",n.isLoaded),e.R7$(),e.Y8G("ngIf",n.isLoaded&&!n.isavatarify),e.R7$(),e.Y8G("ngIf",n.isLoaded&&n.isavatarify),e.R7$(),e.Y8G("disabled",n.disabled||!(null!=n.aiPhotoService&&n.aiPhotoService.imgUrl))("btnText",n.btnText)("credit",null==n.config?null:n.config.avatarify))},dependencies:[s.YU,s.Sq,s.bT,ae.n,Ve.G,Oe.I,f.ZM,f.md,u.me,u.BC,u.vS,L.b,X.vr,X.Uq,X.ZZ,Ce.d1,Ke.V,ue.k,Te,oe.t,Pe.B,re.P,ce,Xe],styles:['.top-list-placeholders[_ngcontent-%COMP%]{gap:8px;flex-wrap:nowrap;white-space:nowrap;overflow:hidden}.top-placeholder-pill[_ngcontent-%COMP%]{flex:0 0 80px;width:80px;height:24px;border-radius:14px;background:linear-gradient(90deg,#f1f2f6 25%,#e5e7ef 37%,#f1f2f6 63%);background-size:400% 100%;animation:_ngcontent-%COMP%_drawer-skeleton-shimmer 1.2s ease-in-out infinite}.placeholder-thumb[_ngcontent-%COMP%] .skeleton-box[_ngcontent-%COMP%]{width:112px;height:112px;border-radius:12px;background:linear-gradient(90deg,#f1f2f6 25%,#e5e7ef 37%,#f1f2f6 63%);background-size:400% 100%;animation:_ngcontent-%COMP%_drawer-skeleton-shimmer 1.2s ease-in-out infinite}.placeholder-thumb[_ngcontent-%COMP%] .skeleton-line[_ngcontent-%COMP%]{width:72px;height:12px;border-radius:8px;background:linear-gradient(90deg,#f1f2f6 25%,#e5e7ef 37%,#f1f2f6 63%);background-size:400% 100%;animation:_ngcontent-%COMP%_drawer-skeleton-shimmer 1.2s ease-in-out infinite}@keyframes _ngcontent-%COMP%_drawer-skeleton-shimmer{0%{background-position:100% 0}to{background-position:0 0}}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]{width:100%;height:110px;border-radius:12px;background:linear-gradient(90deg,#fc5cff05 -4%,#2520f605);padding:.9px 4px 4px}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#c9cad4 -4% 100%);-webkit-mask:linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%) content-box,linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%);-webkit-mask-composite:xor;mask-composite:exclude;z-index:1}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]:hover:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#606576 -4% 100%);-webkit-mask:linear-gradient(90deg,#606576 -4%,#606576 100%) content-box,linear-gradient(90deg,#606576 -4%,#606576 100%);-webkit-mask-composite:xor;mask-composite:exclude;z-index:1}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{resize:none;outline:none;width:100%;height:82px;padding:8px 8px 0;font-size:12px;color:#b0b3bf;border:0px;background:transparent;line-height:18px;position:relative;z-index:2}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar{width:4px;height:4px;border-radius:12px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#e3e3e3;border-radius:12px;margin-top:8px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#9a9a9a;border-radius:12px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:#555}.prompt-view[_ngcontent-%COMP%] .prompt-info[_ngcontent-%COMP%]{font-size:11px;color:#959aa7;margin-top:0;padding-left:8px;height:24px;line-height:normal;width:calc(100% - 8px);bottom:4px;z-index:99}.ai-thumb-list[_ngcontent-%COMP%]{flex-flow:wrap}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%]{height:100%;width:112px;border-radius:12px;margin-bottom:16px;cursor:pointer;min-height:112px;min-width:112px;-webkit-user-select:none;user-select:none}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%]{transition:transform .2s;min-height:112px;min-width:112px}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%;height:100%;border-radius:12px!important}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%]:hover{transform:scale(1.03)}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#272b34;font-size:12px;min-height:18px}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%]{min-height:112px;min-width:112px}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%]{transition:transform .2s}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%]:hover{transform:none}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{border-radius:12px;border:2px solid #626ADF;padding:3px;transition:transform .2s}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] img[_ngcontent-%COMP%]:hover{transform:scale(1.03)}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#626adf}.ai-thumb-list.avatarify-col[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%]{width:112px!important;min-height:112px!important;min-width:112px!important}.ai-thumb-list.avatarify-col[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%]{min-height:112px;min-width:112px}.ai-thumb-list.avatarify-col[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{border-radius:12px!important;max-height:112px;min-height:112px}.ai-thumb-list.avatarify-col[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%]{min-height:112px!important;min-width:112px!important}.ai-thumb-list.avatarify-col[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%]{transition:transform .2s}.ai-thumb-list.avatarify-col[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%]:hover{transform:none}.info-up[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#c9cad4 -4% 100%)!important;-webkit-mask:linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%) content-box,linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-blue[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff0d -4%,#2520f60d)!important}.info-blue[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#fc5cff -4%,#2520f6)!important;-webkit-mask:linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%) content-box,linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-blue[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#626adf!important}.info-red[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff0d -4%,#2520f60d)!important}.info-red[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#f25555 -4% 100%)!important;-webkit-mask:linear-gradient(90deg,#F25555 -4%,#F25555 100%) content-box,linear-gradient(90deg,#F25555 -4%,#F25555 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-red[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#f25555!important}.prompt-text[_ngcontent-%COMP%]{color:#272b34!important}.filter-category[_ngcontent-%COMP%]{position:fixed;top:auto;z-index:99;margin-top:-202px;height:40px}.btn[_ngcontent-%COMP%]:disabled{background:#d9d9d9;border:1px solid #d9d9d9}']}),l})();const Ei=["popoverOpen"],Si=["popStylesReferenc1"],Ti=["p"],Di=(r,l,o)=>({"info-up":r,"info-blue":l,"info-red":o});function ki(r,l){if(1&r&&(e.j41(0,"span",34),e.EFF(1),e.k0s()),2&r){const o=e.XpG(3);e.R7$(),e.SpI("",o.customPrompt.length,"/450")}}function Ri(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",35)(1,"div",36)(2,"span",30),e.EFF(3,"Style Strength"),e.nrm(4,"pi",37),e.k0s()(),e.j41(5,"div",38)(6,"div",39)(7,"mv-sl
1ider",40),e.bIt("change",function(n){e.eBV(o);const i=e.XpG(3);return e.Njj(i.inputStrength(n,!1))})("slideStop",function(n){e.eBV(o);const i=e.XpG(3);return e.Njj(i.inputStrength(n,!0))}),e.k0s()(),e.j41(8,"div",41)(9,"input",42),e.bIt("ngModelChange",function(n){e.eBV(o);const i=e.XpG(3);return e.Njj(i.inputStrength(n,!0))}),e.k0s()()()()}if(2&r){const o=e.XpG(3);e.R7$(7),e.Y8G("value",o.imgStrength)("min",0)("max",100)("step",1),e.R7$(2),e.Y8G("ngModel",o.imgStrength)}}function Ui(r,l){if(1&r){const o=e.RV6();e.qex(0,13),e.j41(1,"div",14)(2,"div",15),e.EFF(3,"Enter Prompt"),e.j41(4,"pi",16),e.bIt("mouseenter",function(){e.eBV(o);const n=e.XpG(2);return e.Njj(n.hideStyleRefPopover())}),e.k0s()(),e.j41(5,"div",17),e.nrm(6,"pi",18,2),e.k0s()(),e.j41(8,"div",19)(9,"div",20)(10,"div",21)(11,"div",22)(12,"div",23)(13,"div",24)(14,"text-prompt-animation",25),e.bIt("changePrompt",function(n){e.eBV(o);const i=e.XpG(2);return e.Njj(i.changePrompt(n))})("focusOut",function(n){e.eBV(o);const i=e.XpG(2);return e.Njj(i.onFocusOut(n))}),e.k0s(),e.DNE(15,ki,2,1,"span",26),e.k0s(),e.j41(16,"div",27)(17,"div",28)(18,"div",29)(19,"span",30),e.EFF(20,"Style Reference"),e.j41(21,"pi",31,3),e.bIt("mouseenter",function(){e.eBV(o);const n=e.XpG(2);return e.Njj(n.showStyleRefPopover())})("mouseleave",function(){e.eBV(o);const n=e.XpG(2);return e.Njj(n.showStyleRefPopover())}),e.k0s()()()(),e.j41(23,"div",28)(24,"app-file-upload",32),e.bIt("styleImageUrlChange",function(n){e.eBV(o);const i=e.XpG(2);return e.Njj(i.styleImageUrl=n)}),e.k0s()()(),e.DNE(25,Ri,10,5,"div",33),e.k0s()()()()(),e.bVm()}if(2&r){const o=e.XpG(2),t=e.sdS(6),n=e.sdS(8);e.R7$(6),e.Y8G("autoClose",!0)("ngbPopover",t),e.R7$(7),e.Y8G("ngClass",e.sMw(11,Di,o.customPrompt.length,o.isFocused,o.customPrompt.length>449)),e.R7$(),e.Y8G("prompts",o.prompts)("textPrompt",o.customPrompt)("promptResetHeight",o.promptResetHeight),e.R7$(),e.Y8G("ngIf",o.customPrompt.length),e.R7$(6),e.Y8G("ngbPopover",n),e.R7$(3),e.Y8G("version","v5")("styleImageUrl",o.styleImageUrl),e.R7$(),e.Y8G("ngIf",o.styleImageUrl)}}function Ai(r,l){if(1&r&&(e.j41(0,"ul",51)(1,"li")(2,"div",52)(3,"div",53),e.nrm(4,"pi",54),e.k0s(),e.j41(5,"div",55)(6,"div",56),e.EFF(7),e.k0s()()()()()),2&r){const o=l.item;e.R7$(4),e.FS9("name",o.iconName),e.R7$(3),e.JRh(o.text)}}function Bi(r,l){if(1&r&&(e.j41(0,"ul",51)(1,"li")(2,"div",57)(3,"div",55)(4,"div",56),e.EFF(5),e.k0s()()()()()),2&r){const o=l.item;e.R7$(5),e.JRh(o.text)}}function Gi(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",58)(1,"preset-style",59),e.bIt("selectStyleEvent",function(n){e.eBV(o);const i=e.XpG(3);return e.Njj(i.selectImage(n))})("expandProduct",function(n){e.eBV(o);const i=e.XpG(3);return e.Njj(i.onCategoryExpandProduct(n))})("listEndReached",function(n){e.eBV(o);const i=e.XpG(3);return e.Njj(i.onPresetListEnd(n))})("categoryProductImagesEnd",function(n){e.eBV(o);const i=e.XpG(3);return e.Njj(i.onCategoryProductImagesEnd(n))}),e.k0s()()}if(2&r){const o=e.XpG(3);e.R7$(),e.Y8G("storeProducts",o.storeProducts)("productId",o.productId)("productImageId",o.productImageId)("isCategoryProductsLoading",o.isLoadingMoreCategoryProducts)("isCategoryProductsEnd",o.isCategoryProductsEnd)("categoryExpandedImagePagination",o.categoryExpandedImagePagination)}}function ji(r,l){1&r&&(e.qex(0),e.nrm(1,"element-placeholder",60),e.bVm()),2&r&&(e.R7$(),e.Y8G("view","AiPatterns"))}function Fi(r,l){if(1&r){const o=e.RV6();e.qex(0,13),e.j41(1,"div",43)(2,"div",44)(3,"div",21)(4,"div",22)(5,"div",21)(6,"div",45)(7,"ng-select",46),e.mxI("ngModelChange",function(n){e.eBV(o);const i=e.XpG(2);return e.DH7(i.selectedGenderCatId,n)||(i.selectedGenderCatId=n),e.Njj(n)}),e.bIt("change",function(n){e.eBV(o);const i=e.XpG(2);return e.Njj(i.changeGender(n))}),e.DNE(8,Ai,8,2,"ng-template",47)(9,Bi,6,1,"ng-template",48),e.k0s()()()()()()(),e.j41(10,"div",49),e.DNE(11,Gi,2,6,"div",50)(12,ji,2,1,"ng-container",7),e.k0s(),e.bVm()}if(2&r){const o=e.XpG(2);e.R7$(7),e.Y8G("items",o.genders),e.R50("ngModel",o.selectedGenderCatId),e.Y8G("searchable",!1)("clearable",!1),e.R7$(4),e.Y8G("ngIf",null==o.storeProducts?null:o.storeProducts.length),e.R7$(),e.Y8G("ngIf",!(null!=o.storeProducts&&o.storeProducts.length))}}function Ni(r,l){if(1&r){const o=e.RV6();e.qex(0),e.j41(1,"tab-button",9),e.bIt("modeChange",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.onModeButtonClick(n))}),e.k0s(),e.j41(2,"div",10)(3,"div",11),e.DNE(4,Ui,26,15,"ng-container",12)(5,Fi,13,6,"ng-container",12),e.k0s()(),e.bVm()}if(2&r){const o=e.XpG();e.R7$(),e.Y8G("selectedMode",o.selectedMode),e.R7$(3),e.Y8G("ngIf","custom"===o.selectedMode),e.R7$(),e.Y8G("ngIf","presets"===o.selectedMode)}}function Li(r,l){if(1&r){const o=e.RV6();e.j41(0,"ai-prompts-popover",61),e.bIt("selectPrompt",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.selectPrompt(n))}),e.k0s()}if(2&r){const o=e.XpG();e.Y8G("items",o.prompts)}}function Wi(r,l){if(1&r){const o=e.RV6();e.j41(0,"ai-style-reference-popover",62),e.bIt("selectstyleRef",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.selectstyleRef(n))}),e.k0s()}2&r&&e.Y8G("editorType","portrait")("editorSubTool","")}let Vi=(()=>{var r;class l{constructor(t,n,i,a,d,g,m,b){this.mediaContentService=t,this.aiPhotoService=n,this.route=i,this.authService=a,this.createPopupService=d,this.aiUploadImageService=g,this.toast=m,this.paymentService=b,this.selectedMode="presets",this.promptResetHeight=!1,this.toolName=h.Fs.Selfie,this.styleImageUrl="",this.imgStrength=100,this.genders=[{categoryId:A.KK.AISelfieMale,text:"Male",iconName:"male"},{categoryId:A.KK.AISelfieFeMale,text:"Female",iconName:"female"}],this.selectedGenderCatId=A.KK.AISelfieMale,this.storeProducts=[],this.prompts=[],this.pageNumber=0,this.categoryProductPageNumber=0,this.isLoadingMoreCategoryProducts=!1,this.isCategoryProductsEnd=!1,this.categoryExpandedImagePagination={},this.customPrompt="",this.isFocused=!1,this.btnText=x.b.label.genViaPresets,this.disabled=!1,this.productId=0,this.isClick=!1,this.styleclick=!1,this.categoryProductsRequestSeq=0,this.user=this.authService.currentUser(),this.loggedInObserver=this.authService.loggedIn.subscribe(O=>{this.user=this.authService.currentUser()}),this.usrPropChangedObserver=this.authService.usrPropChanged.subscribe(O=>{this.user=this.authService.currentUser()}),this.configSubs=this.paymentService.configUpdated.subscribe(()=>{this.config=this.paymentService?.config?.creditInfo})}ngOnInit(){this.isLoaded=!0,[this.productId,this.productImageId,this.selectedGenderCatId]=this.aiPhotoService.getQueryParams(h.Fs.Selfie),this.getCategoryDetails(this.selectedGenderCatId),this.getPrompts()}changeGender(t){t&&(this.selectedGenderCatId=t.categoryId,this.productId=0,this.productImageId=0,this.getCategoryDetails(this.selectedGenderCatId,()=>{this.btnText=x.b.label.genViaPresets}))}selectImage(t){this.disabled=!1,t.productData&&(this.selectedProduct=t.productData,this.productId=this.selectedProduct.productId),this.selectedStyle=t,this.productImageId=t.productImageId,this.selectedStyle.mode=this.selectedMode,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}selectPrompt(t){this.customPrompt=t.prompt,this.disabled=!this.customPrompt,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),setTimeout(()=>{this.isFocused=!1})}changePrompt(t){this.customPrompt=t,this.disabled=!this.customPrompt,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}getCategoryDetails(t,n=null){this.categoryProductsRequestSeq++,this.resetCategoryProductPagination(),this.categoryExpandedImagePagination={},this.storeProducts=[],this.selectedProduct=null,this.selectedStyle=null,this.loadCategoryProducts({categoryId:t,reset:!0,cb:n})}onPresetListEnd(t){if(t&&"category"===t.viewType){if(!this.isCategoryProductsEnd)return void this.loadCategoryProducts({categoryId:this.selectedGenderCatId,reset:!1});t.productId&&this.loadExpandedCategoryProductImages({productId:t.productId})}}onCategoryExpandProduct(t){if(!t?.productId)return;const n=this.storeProducts.find(d=>d.productId==t.productId);if(!n)return;this.categoryExpandedImagePagination[t.productId]||(this.categoryExpandedImagePagination[t.productId]=(0,B.gi)());const i=this.categoryExpandedImagePagination[t.productId],a=n.storeProductImages||[];if(0===a.length)return i.pageNumber=-1,i.isEnd=!1,void this.loadExpandedCategoryProductImages({productId:t.productId});i.pageNumber=(0,B.vR)(a.length,B.$t.CATEGORY_IMAGE_PAGE_SIZE),i.isEnd=a.length<B.$t.CATEGORY_EMBEDDED_IMAGE_COUNT}onCategoryProductImagesEnd(t){t?.productId&&this.loadExpandedCategoryProductImages({productId:t.productId})}getPrompts(){this.mediaContentService.getPrompts(A.Jl.Selfie,t=>{t&&(this.prompts=t.prompts)},t=>{})}onFocusOut(t){this.isFocused=t}focusIn(){this.isFocused=!0}focusOut(){this.isFocused=!1}generate(){if(!this.aiPhotoService.isCancel||this.aiPhotoService.imgUrl){if(!this.aiPhotoService.inProgress)if(this.aiPhotoService.imgUrl)if(this.user&&this.user.remainingCoins>=this.config?.selfie){const t={imageUrl:this.aiPhotoService.imgUrl,featureType:h.Fs.Selfie,model:58,isCustomPrompt:this.selectedMode==h.y9.Custom?1:0,...this.selectedMode==h.y9.Presets&&{...this.productId&&{productId:this.productId},...this.productImageId&&{productImageId:this.productImageId}},...this.selectedMode==h.y9.Custom&&{...this.customPrompt?.trim()&&{textPrompt:this.customPrompt},...this.styleImageUrl&&{styleImageUrl:this.styleImageUrl},...this.styleImageUrl&&{styleStrength:this.styleImageUrl?this.imgStrength/100:0}}};this.aiPhotoService.startGenerationProgress({featureType:h.Fs.Selfie}),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),this.aiPhotoService.generateImage(t,n=>{n&&n.assetId?(n.featureType=h.Fs.Selfie,n.toolName=x.b.label.aiPortrait,n.styleName=this.selectedProduct?.displayName,this.aiPhotoService.checkStatus(n,0,a=>{a&&a.urls&&a.urls.length>0?(this.user.remainingCoins=a.remainingCalls,this.aiPhotoService.isDirty=!0,this.selectedStyle.mode==h.y9.Presets?this.selectedStyle.presetGen=!0:this.selectedStyle.mode==h.y9.Custom&&(this.selectedStyle.customGen=!0)):this.aiPhotoService.clearGenerationProgress(),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)},a=>{this.displayErrorMsg(a)})):this.displayErrorMsg(n)},n=>{this.displayErrorMsg(n)})}else this.aiPhotoService.openAICreditPopup(()=>{this.user=this.authService.currentUser(),this.generate()},this.config?.selfie);else this.aiPhotoService.inProgress=!0,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),this.aiPhotoService.updateImageUrl(this.aiPhotoService.originalImgUrl,h.Fs.Selfie).then(t=>
1{this.aiPhotoService.queryParams=this.route.snapshot.queryParams,this.aiPhotoService.imgUrl=t?.imgUrl,this.generate()}).catch(()=>{this.aiPhotoService.inProgress=!1,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),this.toast.showErrorSingle(x.b.message.uploadNewImage)})}else this.toast.showErrorSingle(x.b.message.uploadNewImage)}displayErrorMsg(t=null){this.aiPhotoService.clearGenerationProgress();let n=t?.description;this.createPopupService.openWarningDialog("Error",n),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}ngOnDestroy(){this.configSubs&&this.configSubs.unsubscribe(),this.loggedInObserver&&this.loggedInObserver.unsubscribe(),this.usrPropChangedObserver&&this.usrPropChangedObserver.unsubscribe()}onFileUploaded(t){t&&(this.aiPhotoService.inProgress=!1,this.aiUploadImageService.aiUploadImage(t[0],{fromEditor:"header",toolName:h.Fs.Selfie}).then(a=>{a&&(this.styleImageUrl=a?.imgUrl)}))}addStyleImage(t){this.aiPhotoService.inProgress||t.click()}deleteStyleImage(){this.styleImageUrl="",this.imgStrength=100,this.disabled=!this.customPrompt}inputStrength(t,n){let i;i=t.newValue||0===t.newValue?t.newValue:t,this.imgStrength=i}popOvermouseleave(t){this.isClick||t.close()}hideStyleRefPopover(){this.popStylesReferenc1.isOpen&&this.popStylesReferenc1.close()}selectstyleRef(t){t.close?this.styleclick||(this.styleclick=!1,this.hideStyleRefPopover()):(this.styleclick=!0,this.popStylesReferenc1.open())}showStyleRefPopover(){this.popStylesReferenc1.close?(this.styleclick=!1,this.popStylesReferenc1.open()):this.popoverOpen&&(this.popStylesReferenc1.close(),this.styleclick=!1)}onModeButtonClick(t){this.promptResetHeight=!0,setTimeout(()=>{this.promptResetHeight=!1}),this.selectedMode=t,t===h.y9.Custom?this.disabled=!this.customPrompt:t===h.y9.Presets&&(this.disabled=!1),this.selectedStyle&&(this.selectedStyle.mode=t),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}onPanelChange(t){t.nextState&&setTimeout(()=>{document.getElementById(t.panelId)?.scrollIntoView({behavior:"smooth",block:"center"})},100)}resetCategoryProductPagination(){this.categoryProductPageNumber=0,this.isLoadingMoreCategoryProducts=!1,this.isCategoryProductsEnd=!1}loadCategoryProducts({categoryId:t,reset:n,cb:i=null}){(0,B.uH)({request:{categoryId:t,reset:n,cb:i},requestSeq:this.categoryProductsRequestSeq,pageSize:B.$t.CATEGORY_PRODUCT_PAGE_SIZE,pagination:{getState:()=>({pageNumber:this.categoryProductPageNumber,isLoading:this.isLoadingMoreCategoryProducts,isEnd:this.isCategoryProductsEnd}),setState:d=>{"number"==typeof d.pageNumber&&(this.categoryProductPageNumber=d.pageNumber),"boolean"==typeof d.isLoading&&(this.isLoadingMoreCategoryProducts=d.isLoading),"boolean"==typeof d.isEnd&&(this.isCategoryProductsEnd=d.isEnd)}},isCurrentRequest:d=>d===this.categoryProductsRequestSeq,fetchProducts:(0,B.a6)(this.mediaContentService,B.$t.CATEGORY_PRODUCT_PAGE_SIZE),onProductsLoaded:({fetchedProducts:d,reset:g})=>{if(this.config=this.paymentService?.config?.creditInfo,g){if(this.storeProducts=d,this.productId){const m=this.storeProducts.findIndex(b=>b.productId==this.productId);if(-1!=m){const b=this.storeProducts[m];this.storeProducts.splice(m,1),this.storeProducts.splice(0,0,b)}}}else d.length&&(this.storeProducts=(0,B.cb)(this.storeProducts,d,"productId"));if(g&&this.storeProducts.length){let m;this.selectedProduct=this.storeProducts[0],this.productId=this.selectedProduct.productId;const b=this.selectedProduct.storeProductImages||[];if(b.length)if(this.productImageId){const O=b.findIndex(E=>E.productImageId==this.productImageId);m=b.find(E=>E.productImageId==this.productImageId)||b[0],this.productImageId=m.productImageId,-1!==O&&(b.splice(O,1),b.splice(0,0,m))}else m=b[0],this.productImageId=m.productImageId;this.selectedStyle=m,this.selectedStyle&&(this.selectedStyle.mode=this.selectedMode,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle))}setTimeout(()=>{this.config=this.paymentService?.config?.creditInfo},500)},onError:()=>{}})}loadExpandedCategoryProductImages({productId:t}){(0,B.hu)({storeProducts:this.storeProducts,paginationMap:this.categoryExpandedImagePagination,request:{productId:t},embeddedImageCount:B.$t.CATEGORY_EMBEDDED_IMAGE_COUNT,pageSize:B.$t.CATEGORY_IMAGE_PAGE_SIZE,fetchImages:(0,B.$B)(this.mediaContentService,B.$t.CATEGORY_IMAGE_PAGE_SIZE)})}}return(r=l).\u0275fac=function(t){return new(t||r)(e.rXU(te.Z),e.rXU(U.s),e.rXU(y.nX),e.rXU(N.u),e.rXU(Q.A),e.rXU(G.M),e.rXU(C.f),e.rXU(K.W))},r.\u0275cmp=e.VBU({type:r,selectors:[["portrait-drawer"]],viewQuery:function(t,n){if(1&t&&(e.GBs(Ei,5),e.GBs(Si,5),e.GBs(Ti,5)),2&t){let i;e.mGM(i=e.lsd())&&(n.popoverOpen=i.first),e.mGM(i=e.lsd())&&(n.popStylesReferenc1=i.first),e.mGM(i=e.lsd())&&(n.p=i.first)}},inputs:{toolName:"toolName",isLoaded:"isLoaded"},decls:9,vars:5,consts:[["popContent",""],["popStylesReferenc",""],["popOver","ngbPopover"],["popStylesReferenc1","ngbPopover"],[3,"toolName"],[1,"position-relative"],[1,"scroll-content","drawer-elements","ai-drawer-elements"],[4,"ngIf"],[3,"btnClick","disabled","btnText","credit"],[3,"modeChange","selectedMode"],[1,"common-container","m-0","p-0","editor-tool-panel","card","border-0","pt-2"],[1,"d-flex","w-100","flex-column","ngb-btn"],["class","drawer-card",4,"ngIf"],[1,"drawer-card"],[1,"wp-100","d-flex","align-items-center","justify-content-between","ps-3","pe-3"],[1,"text-13","text-dark","text-semi","text-semi"],["name","helpicon","placement","right","popoverClass","pop-for-tooltip","ngbPopover","Provide a text description about the subject, style, setting and any other specific element guiding the AI to understand the exact image you want generated.","triggers","mouseenter:mouseleave","popoverTitle","Enter Prompt","container","body",1,"ms-1","hw-24","help-icon",3,"mouseenter"],["placement","right","ngbTooltip","Suggested Prompt","tooltipClass","tooltip-custom-all","container","body",1,"lampIcon","hw-32"],["name","lampicon","placement","right","container","body","popoverClass","background-prompt",1,"pointer","f-32","lampicon",3,"autoClose","ngbPopover"],[1,"common-container"],[1,"card","drawer-card","mb-0"],[1,"card-body"],[1,"btn-panel"],[1,"card-body","prompt-view"],[1,"textarea-col","position-relative",3,"ngClass"],[1,"text-animation",3,"changePrompt","focusOut","prompts","textPrompt","promptResetHeight"],["class","prompt-info text-regular position-absolute d-flex align-items-center justify-content-start",4,"ngIf"],[1,"d-flex","flex-column","align-items-center","mt-3"],[1,"w-100"],[1,"h-32","mb-1"],[1,"text-normal","text-dark","text-semi","lh-125"],["name","helpicon","placement","right","container","body","popoverClass","background-style pt-0 pb-3 style-ref-pop-height h-auto background-prompt-popover","autoClose","outside",1,"ms-1","help-icon",3,"mouseenter","mouseleave","ngbPopover"],[1,"w-100",3,"styleImageUrlChange","ver
1sion","styleImageUrl"],["class","d-flex w-100 flex-column prompt-view mb-1",4,"ngIf"],[1,"prompt-info","text-regular","position-absolute","d-flex","align-items-center","justify-content-start"],[1,"d-flex","w-100","flex-column","prompt-view","mb-1"],[1,"d-flex","align-items-center","justify-content-between","wp-100","mb-1","h-32"],["name","helpicon","placement","right","popoverClass","pop-for-tooltip","ngbPopover","Higher style strength makes the generated image look more like your reference, while lower strength makes it look less similar.","triggers","mouseenter:mouseleave","popoverTitle","Style Strength","container","body",1,"ms-1","hw-24","help-icon"],[1,"d-inline-flex","align-items-center","justify-content-between"],[1,"col-sm-9","p-0"],[1,"opacity-slider",2,"width","100%",3,"change","slideStop","value","min","max","step"],[1,"col-sm-2","p-0"],["type","text","numberSettings","","min","0","max","100","separatorLimit","100",1,"form-control","form-input-sm","text-normal","text-black","float-end",3,"ngModelChange","ngModel"],[1,"common-container","m-0","ps-3","pe-3"],[1,"card","drawer-card","mb-2","mt-0","pt-1"],[1,"d-flex","wp-100"],["bindLabel","text","bindValue","categoryId",1,"w-100","c-ng-select",3,"ngModelChange","change","items","ngModel","searchable","clearable"],["ng-label-tmp",""],["ng-option-tmp",""],[1,"d-flex"],["class","d-flex w-100 pane-section flex-column ps-0 pe-3",4,"ngIf"],[1,"list-unstyled","w-100","mb-0","text-black"],[1,"row","g-0","align-items-center"],[1,"col-1","me-2","text-center"],[1,"grey-600","f-16",3,"name"],[1,"col-10"],[1,"text-13","grey-800","text-semi"],[1,"row","g-0","align-items-center","h-48"],[1,"d-flex","w-100","pane-section","flex-column","ps-0","pe-3"],[3,"selectStyleEvent","expandProduct","listEndReached","categoryProductImagesEnd","storeProducts","productId","productImageId","isCategoryProductsLoading","isCategoryProductsEnd","categoryExpandedImagePagination"],[2,"padding","0px 5px",3,"view"],[3,"selectPrompt","items"],[3,"selectstyleRef","editorType","editorSubTool"]],template:function(t,n){if(1&t){const i=e.RV6();e.nrm(0,"app-file-upload",4),e.j41(1,"div",5)(2,"div",6),e.DNE(3,Ni,6,3,"ng-container",7),e.k0s()(),e.j41(4,"generate-button",8),e.bIt("btnClick",function(){return e.eBV(i),e.Njj(n.generate())}),e.k0s(),e.DNE(5,Li,1,1,"ng-template",null,0,e.C5r)(7,Wi,1,2,"ng-template",null,1,e.C5r)}2&t&&(e.Y8G("toolName",n.toolName),e.R7$(3),e.Y8G("ngIf",n.isLoaded),e.R7$(),e.Y8G("disabled",n.disabled||!(null!=n.aiPhotoService&&n.aiPhotoService.imgUrl))("btnText",n.btnText)("credit",null==n.config?null:n.config.selfie))},dependencies:[s.YU,s.bT,ae.n,Oe.I,f.ZM,f.md,u.me,u.BC,u.vS,L.b,X.vr,X.Uq,X.ZZ,Ce.d1,ue.k,Te,oe.t,re.P,be.e,ce,Xe],styles:['.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]{width:100%;height:110px;border-radius:12px;background:linear-gradient(90deg,#fc5cff05 -4%,#2520f605);padding:.9px 4px 4px}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#c9cad4 -4% 100%);-webkit-mask:linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%) content-box,linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%);-webkit-mask-composite:xor;mask-composite:exclude;z-index:1}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]:hover:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#606576 -4% 100%);-webkit-mask:linear-gradient(90deg,#606576 -4%,#606576 100%) content-box,linear-gradient(90deg,#606576 -4%,#606576 100%);-webkit-mask-composite:xor;mask-composite:exclude;z-index:1}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{resize:none;outline:none;width:100%;height:82px;padding:8px 8px 0;font-size:12px;color:#b0b3bf;border:0px;background:transparent;line-height:18px;position:relative;z-index:2}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar{width:4px;height:4px;border-radius:12px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#e3e3e3;border-radius:12px;margin-top:8px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#9a9a9a;border-radius:12px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:#555}.prompt-view[_ngcontent-%COMP%] .prompt-info[_ngcontent-%COMP%]{font-size:11px;color:#959aa7;margin-top:0;padding-left:8px;height:24px;line-height:normal;width:calc(100% - 8px);bottom:4px;z-index:99}.info-up[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#c9cad4 -4% 100%)!important;-webkit-mask:linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%) content-box,linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-blue[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff0d -4%,#2520f60d)!important}.info-blue[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#fc5cff -4%,#2520f6)!important;-webkit-mask:linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%) content-box,linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-blue[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#626adf!important}.info-red[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff0d -4%,#2520f60d)!important}.info-red[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#f25555 -4% 100%)!important;-webkit-mask:linear-gradient(90deg,#F25555 -4%,#F25555 100%) content-box,linear-gradient(90deg,#F25555 -4%,#F25555 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-red[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#f25555!important}.btn[_ngcontent-%COMP%]:disabled{background:#d9d9d9;border:1px solid #d9d9d9}']}),l})();const st=r=>({"active-btn-tab":r}),Xi=(r,l,o)=>({"info-up":r,"info-blue":l,"info-red":o});function Ki(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",14)(1,"div",15)(2,"buttons-scroll-menu",16),e.bIt("selectLayout",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.selectFilterProd(n))}),e.k0s()()()}if(2&r){const o=e.XpG();e.R7$(2),e.Y8G("items",o.storeProducts)("leftscrollMrg",70)("type","aiFilter")("categoryId",o.productId)}}function $i(r,l){if(1&r){const o=e.RV6();e.j41(0,"text-prompt-animation",35),e.bIt("changePrompt",function(n){e.eBV(o);const i=e.XpG(3);return e.Njj(i.changePrompt(n))})("focusOut",function(n){e.eBV(o);const i=e.XpG(3);return e.Njj(i.onFocusOut(n))}),e.k0s()}if(2&r){const o=e.XpG(3);e.Y8G("prompts",o.prompts)("textPrompt",o.customPrompt)}}function Yi(r,l){if(1&r&&(e.j41(0,"span",36),e.EFF(1),e.k0s()),2&r){const o=e.XpG(3);e.R7$(),e.SpI("",o.customPrompt.length,"/450")}}function zi(r,l){if(1&r){const o=e.RV6();e.qex(0,23),e.j41(1,"div",24)(2,"div",25)(3,"div",26)(4,"div",27)(5,"div",28)(6,"div",29),e.DNE(7,$i,1,2,"text-prompt-animation",30)(8,Yi,2,1,"span",31),e.k0s(),e.j41(9,"div",32)(10,"div",33)(11,"buttons-scroll-menu",34),e.bIt("selectLayout",function(n){e.eBV(o);const i=e.XpG(2);return e.Njj(i.selectPrompt(n))}),e.k0s()()()()()()()(),e.bVm()}if(2&r){const o=e.XpG(2);e.R7$(6),e.Y8G("ngClass",e.sMw(5,Xi,o.customPrompt.length,o.isFocused,o.customPrompt.length>449)),e.R7$(),e.Y8G("ngIf",o.promptLoaded),e.R7$(),e.Y8G("ngIf",o.customPrompt.length),e.R7$(3),e.Y8G("items",o.prompts)("type","prompt")}}function qi(r,l){if(1&r){const o=e.RV6();e.qex(0,23),e.j41(1,"div",37)(2,"preset-style",38),e.bIt("selectStyleEvent",function(n){e.eBV(o);const i=e.XpG(2);return e.Njj(i.selectImage(n))}),e.k0s()(),e.bVm()}if(2&r){const o=e.XpG(2);e.R7$(2),e.Y8G("type","product")("storeProductImages",null==o.selectedFilters?null:o.selectedFilters.storeProductImages)("productImageId",o.productImageId)}}function Hi(r,l){if(1&r){const o=e.RV6();e.qex(0)(1),e.j41(2,"div",17)(3,"button",18),e.bIt("click",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.onModeButtonClick("presets"))}),e.EFF(4," Presets "),e.k0s(),e.j41(5,"button",19),e.bIt("click",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.onModeButtonClick("custom"))}),e.EFF(6," Custom "),e.k0s()(),e.bVm(),e.j41(7,"div",20)(8,"div",21),e.DNE(9,z
1i,12,9,"ng-container",22)(10,qi,3,3,"ng-container",22),e.k0s()(),e.bVm()}if(2&r){const o=e.XpG();e.R7$(3),e.Y8G("ngClass",e.eq3(6,st,"presets"===o.selectedMode))("title","Presets"),e.R7$(2),e.Y8G("ngClass",e.eq3(8,st,"custom"===o.selectedMode))("title","Custom"),e.R7$(4),e.Y8G("ngIf","custom"===o.selectedMode),e.R7$(),e.Y8G("ngIf","presets"===o.selectedMode)}}function Ji(r,l){1&r&&(e.j41(0,"div",39)(1,"span",40),e.EFF(2,"Loading..."),e.k0s()())}let Qi=(()=>{var r;class l{constructor(t,n,i,a,d,g,m,b){this.mediaContentService=t,this.authService=n,this.aiPhotoService=i,this.createPopupService=a,this.route=d,this.aiUploadImageService=g,this.toast=m,this.paymentService=b,this.selectedMode="presets",this.aiPatterns=[],this.storeProducts=[],this.prompts=[],this.pageNumber=0,this.activeAccPanelId="panel-2",this.customPrompt="",this.isFocused=!1,this.genImageEvent=new e.bkB,this.btnText="Generate",this.disabled=!1,this.productId=0,this.promptLoaded=!0,this.pageNumberproduct=0,this.toolName=h.Fs.Filter,this.user=this.authService.currentUser(),this.loggedInObserver=this.authService.loggedIn.subscribe(O=>{this.user=this.authService.currentUser()}),this.usrPropChangedObserver=this.authService.usrPropChanged.subscribe(O=>{this.user=this.authService.currentUser()}),this.configSubs=this.paymentService.configUpdated.subscribe(()=>{this.config=this.paymentService?.config?.creditInfo})}ngOnInit(){[this.productId,this.productImageId]=this.aiPhotoService.getQueryParams(h.Fs.Filter),this.getCategoryDetails()}selectImage(t){this.productImageId=t.productImageId,this.selectedStyle.item=t,this.selectedStyle.isPrompt=!1,this.selectedStyle.isStyle=!0,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}selectPrompt(t){this.customPrompt=t.prompt,this.selectedStyle.item=t,this.selectedStyle.isPrompt=!0,this.selectedStyle.isStyle=!1,this.selectedStyle.item.imageJson=t.prompt,this.disabled=!this.customPrompt,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),setTimeout(()=>{this.isFocused=!1})}getProductimage(t,n){this.pageNumberproduct=n,this.mediaContentService.getTemplateByProductId(t,n,i=>{if(i&&i.storeProductImages&&i.storeProductImages.length>0){let a=this.storeProducts.filter(d=>d.productId==this.productId)[0];a.storeProductImages.length>=20&&a.storeProductImages.length<=39&&1==this.pageNumberproduct?(a.storeProductImages=a.storeProductImages.concat(i.storeProductImages),a.storeProductImages.length>39&&this.getProductimage(this.productId,2)):a.storeProductImages.length>=40&&a.storeProductImages.length<=59&&2==this.pageNumberproduct&&(a.storeProductImages=a.storeProductImages.concat(i.storeProductImages)),this.selectedFilters=a}},i=>{this.pageNumberproduct=0})}selectFilterProd(t){t&&(this.productId=t.productId,this.modelTypeId=t.modelTypeId,20==this.storeProducts.filter(n=>n.productId==this.productId)[0].storeProductImages.length&&this.getProductimage(this.productId,1),40==this.storeProducts.filter(n=>n.productId==this.productId)[0].storeProductImages.length?this.getProductimage(this.productId,2):this.selectedFilters=this.storeProducts.filter(n=>n.productId==this.productId)[0],this.productImageId=this.selectedFilters&&this.selectedFilters.storeProductImages.length?this.selectedFilters.storeProductImages[0].productImageId:0,this.selectedStyle?(this.selectedStyle.isStyle=!0,this.selectedStyle.item=this.selectedFilters?.storeProductImages[0],this.selectedStyle.displayName=this.selectedFilters?.displayName?this.selectedFilters?.displayName:""):this.selectedStyle={item:this.selectedFilters?.storeProductImages[0],isStyle:!0,displayName:this.selectedFilters?.displayName?this.selectedFilters?.displayName:""},this.activeAccPanelId||(this.activeAccPanelId="panel-2"),"panel-2"==this.activeAccPanelId?this.disabled=!1:(this.customPrompt="",this.selectedStyle.item={imageJson:this.customPrompt,customPrompt:this.customPrompt},this.productImageId=0,this.disabled=!0,this.selectedStyle.displayName=""),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),this.promptLoaded=!1,this.getPrompts(this.productId,()=>{setTimeout(()=>{this.promptLoaded=!0})}))}changePrompt(t){this.customPrompt=t,this.selectedStyle.item={imageJson:this.customPrompt},this.selectedStyle.item.customPrompt=this.customPrompt,this.disabled=!this.customPrompt.trim(),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}accPanelChanged(t){this.disabled=!1,this.selectedStyle=null,t.panelId&&(t.nextState&&"panel-1"==t.panelId?(t.isPrompt=!0,t.isStyle=!1,this.disabled=!this.customPrompt,this.activeAccPanelId=t.panelId):t.nextState&&"panel-2"==t.panelId?(this.disabled=!1,t.isStyle=!0,t.isPrompt=!1,this.activeAccPanelId=t.panelId):(t.isPrompt=!1,t.isStyle=!1,this.activeAccPanelId="",this.disabled=!0),this.selectedStyle||(this.selectedStyle=t),t.isStyle?(this.customPrompt=this.customPrompt,!this.productImageId&&this.selectedFilters&&
1(this.modelTypeId=this.selectedFilters.modelTypeId,this.selectedStyle.item=this.selectedFilters.storeProductImages[0],this.productImageId=this.selectedFilters.storeProductImages[0].productImageId)):t.isPrompt&&(this.selectedStyle.item={imageJson:this.customPrompt,customPrompt:this.customPrompt},this.productImageId=0),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle))}getCategoryDetails(){this.mediaContentService.getCategoryProductDetails(A.KK.AIFilter,this.pageNumber,t=>{if(this.config=this.paymentService?.config?.creditInfo,t&&t.body){if(this.storeProducts=t.body.storeProducts,this.storeProducts.length){let n;this.productId&&this.storeProducts.filter(d=>d.productId==this.productId).length>0||(this.productId=this.storeProducts[0].productId),this.storeProducts.filter(a=>a.productId==this.productId)[0].storeProductImages.length>19&&this.getProductimage(this.productId,1),this.selectedFilters=this.storeProducts.filter(a=>a.productId==this.productId)[0],this.getPrompts(this.productId,()=>{this.isLoaded=!0});const i=this.selectedFilters?.storeProductImages;if(i?.length)if(this.productImageId){const a=i.findIndex(g=>g.productImageId==this.productImageId);n=i.find(g=>g.productImageId==this.productImageId)||i[0],this.productImageId=n.productImageId,n&&-1!=a&&(i.splice(a,1),i.splice(0,0,n))}else n=i[0],this.productImageId=n.productImageId;this.modelTypeId=this.selectedFilters?.modelTypeId,this.selectedStyle?(this.selectedStyle.item=n,this.selectedStyle.displayName=this.storeProducts[0].displayName?this.storeProducts[0].displayName:""):this.selectedStyle={item:n,isStyle:!0,isPrompt:!1,displayName:this.storeProducts[0].displayName?this.storeProducts[0].displayName:""},this.selectedStyle&&(this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle))}}else this.isLoaded=!0;setTimeout(()=>{this.config=this.paymentService?.config?.creditInfo},500)},t=>{this.isLoaded=!0})}getPrompts(t,n=null){this.mediaContentService.getPrompts(A.Jl.Filter,i=>{i&&(this.prompts=i.prompts),n&&n()},i=>{n&&n()},t)}focusIn(){this.isFocused=!0}onFocusOut(t){this.isFocused=t}focusOut(){this.isFocused=!1}generate(){if(!this.aiPhotoService.isCancel||this.aiPhotoService.imgUrl){if(!this.aiPhotoService.inProgress&&this.selectedStyle)if(this.aiPhotoService.imgUrl){if(this.selectedStyle.item&&(!this.selectedStyle.item.imageJson||!this.selectedStyle.item.imageJson.trim()))return;if(this.user&&this.user.remainingCoins>=this.config.aifilter){const t={imageUrl:this.aiPhotoService.imgUrl,featureType:h.Fs.Filter,...this.selectedStyle&&this.selectedStyle.item&&this.selectedStyle.item.imageJson&&{textPrompt:this.selectedStyle.item.imageJson},isCustomPrompt:this.selectedStyle&&this.selectedStyle.isPrompt?1:0,...this.modelTypeId&&{model:this.modelTypeId},...this.productId&&{productId:this.productId},...this.productImageId&&"presets"==this.selectedMode&&{productImageId:this.productImageId},"aiApiVersion ":1};this.aiPhotoService.inProgress=!0,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),this.aiPhotoService.generateImage(t,n=>{n&&n.assetId?(n.featureType=h.Fs.Filter,n.toolName=x.b.label.aiFilter,this.aiPhotoService.checkStatus(n,0,a=>{a&&a.urls&&a.urls.length>0&&(this.user.remainingCoins=a.remainingCalls,this.aiPhotoService.isDirty=!0,this.selectedStyle&&this.selectedStyle.item&&(this.selectedStyle.item.isGenerated=!0)),this.aiPhotoService.inProgress=!1,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)},a=>{this.displayErrorMsg(a)})):this.displayErrorMsg(n)},n=>{this.displayErrorMsg(n)})}else this.aiPhotoService.openAICreditPopup(()=>{this.user=this.authService.currentUser(),this.generate()},this.config?.aifilter)}else this.aiPhotoService.inProgress=!0,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),this.aiPhotoService.updateImageUrl(this.aiPhotoService.originalImgUrl,h.Fs.Filter).then(t=>{this.aiPhotoService.queryParams=this.route.snapshot.queryParams,this.aiPhotoService.imgUrl=t.imgUrl,this.generate()}).catch(()=>{this.aiPhotoService.inProgress=!1,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),this.toast.showErrorSingle(x.b.message.uploadNewImage)})}else this.toast.showErrorSingle(x.b.message.uploadNewImage)}displayErrorMsg(t=null){this.aiPhotoService.inProgress=!1;let n=t?.description;this.createPopupService.openWarningDialog("Error",n),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}ngOnDestroy(){this.configSubs&&this.configSubs.unsubscribe(),this.loggedInObserver&&this.loggedInObserver.unsubscribe(),this.usrPropChangedObserver&&this.usrPropChangedObserver.unsubscribe()}onModeButtonClick(t){this.selectedMode=t,this.disabled=!1,"custom"===t?(this.selectedStyle||(this.selectedStyle={}),this.selectedStyle.isPrompt=!0,this.selectedStyle.isStyle=!1,this.disabled=!this.customPrompt,this.selectedStyle.item={imageJson:this.customPrompt,customPrompt:this.customPrompt},this.productImageId=0,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)):"presets"===t&&(this.disabled=!1,this.btnText="Generate via Presets",this.selectedStyle||(this.selectedStyle={}),this.selectedStyle.isStyle=!0,this.selectedStyle.isPrompt=!1)}}return(r=l).\u0275fac=function(t){return new(t||r)(e.rXU(te.Z),e.rXU(N.u),e.rXU(U.s),e.rXU(Q.A),e.rXU(y.nX),e.rXU(G.M),e.rXU(C.f),e.rXU(K.W))},r.\u0275cmp=e.VBU({type:r,selectors:[["filter-drawer"]],inputs:{toolName:"toolName"},outputs:{genImageEvent:"genImageEvent"},decls:18,vars:7,consts:[[3,"toolName"],[1,"position-relative","mt-3"],[1,"scroll-content","drawer-elements","ai-drawer-elements"],["class","d-flex align-items-center justify-content-start bg-white filter-category",4,"ngIf"],[4,"ngIf"],[1,"position-absolute","fixed-bottom","pb-1","pt-2","ps-3","pe-3","bg-white"],[1,"d-flex","align-items-center","justify-content-center","w-100","mb-1"],["
1id","gtm-generate",1,"btn","btn-primary-gradient","text-13","btn-h40","w-100","d-flex","align-items-center","justify-content-center",3,"click","disabled"],["class","spinner-border spinner-border-lg me-2 hw-24","role","status",4,"ngIf"],[1,"text-13"],[1,"credit-description","d-flex","align-items-center","justify-content-center","w-100"],[1,"f-12"],[1,"ms-2","me-2"],["src","https://static.lightxeditor.com/assets/images/coin-lottie-s-anim.gif","width","24px","height","24px","alt","Coin Lottie"],[1,"d-flex","align-items-center","justify-content-start","bg-white","filter-category"],[1,"colors-bg","sticker-buttons-scroll","scrollWidth-300"],[3,"selectLayout","items","leftscrollMrg","type","categoryId"],[1,"d-flex","align-items-center","justify-content-center","preset-button","wp-100","btn-tabs-editor","border-radius-12","mb-2"],[1,"btn","btn-tab-inner",2,"margin-right","1px",3,"click","ngClass","title"],[1,"btn","btn-tab-inner",2,"margin-left","1px",3,"click","ngClass","title"],[1,"common-container","m-0","p-0","editor-tool-panel","card","border-0"],[1,"d-flex","w-100","flex-column","ngb-btn"],["class","drawer-card",4,"ngIf"],[1,"drawer-card"],[1,"common-container"],[1,"card","drawer-card","mb-2"],[1,"card-body"],[1,"btn-panel"],[1,"card-body","prompt-view"],[1,"textarea-col","position-relative",3,"ngClass"],["class","text-animation",3,"prompts","textPrompt","changePrompt","focusOut",4,"ngIf"],["class","prompt-info text-regular position-absolute d-flex align-items-center justify-content-start",4,"ngIf"],[1,"d-flex","document-color","mt-2"],[1,"colors-bg","sticker-buttons-scroll","inner-buttons-scroll"],[3,"selectLayout","items","type"],[1,"text-animation",3,"changePrompt","focusOut","prompts","textPrompt"],[1,"prompt-info","text-regular","position-absolute","d-flex","align-items-center","justify-content-start"],[1,"ps-0","pe-3"],[3,"selectStyleEvent","type","storeProductImages","productImageId"],["role","status",1,"spinner-border","spinner-border-lg","me-2","hw-24"],[1,"sr-only","text-nowrap","border-0","position-absolute","overflow-hidden"]],template:function(t,n){1&t&&(e.nrm(0,"app-file-upload",0),e.j41(1,"div",1)(2,"div",2),e.DNE(3,Ki,3,4,"div",3)(4,Hi,11,10,"ng-container",4),e.k0s(),e.j41(5,"div",5)(6,"div",6)(7,"button",7),e.bIt("click",function(){return n.generate()}),e.DNE(8,Ji,3,0,"div",8),e.j41(9,"span",9),e.EFF(10),e.k0s()()(),e.j41(11,"div",10)(12,"span",11),e.EFF(13,"1 generation ="),e.k0s(),e.j41(14,"span",12),e.nrm(15,"img",13),e.k0s(),e.j41(16,"span",11),e.EFF(17),e.k0s()()()()),2&t&&(e.Y8G("toolName",n.toolName),e.R7$(3),e.Y8G("ngIf",n.isLoaded),e.R7$(),e.Y8G("ngIf",n.isLoaded),e.R7$(3),e.Y8G("disabled",n.disabled),e.R7$(),e.Y8G("ngIf",n.aiPhotoService.inProgress),e.R7$(2),e.JRh(n.aiPhotoService.inProgress?"Processing":n.btnText),e.R7$(7),e.SpI("",null==n.config?null:n.config.aifilter," credit"))},dependencies:[s.YU,s.bT,oe.t,Pe.B,re.P,be.e],styles:['.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]{width:100%;height:110px;border-radius:12px;background:linear-gradient(90deg,#fc5cff05 -4%,#2520f605);padding:.9px 4px 4px}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#c9cad4 -4% 100%);-webkit-mask:linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%) content-box,linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%);-webkit-mask-composite:xor;mask-composite:exclude;z-index:1}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]:hover:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#606576 -4% 100%);-webkit-mask:linear-gradient(90deg,#606576 -4%,#606576 100%) content-box,linear-gradient(90deg,#606576 -4%,#606576 100%);-webkit-mask-composite:xor;mask-composite:exclude;z-index:1}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{resize:none;outline:none;width:100%;height:82px;padding:8px 8px 0;font-size:12px;color:#b0b3bf;border:0px;background:transparent;line-height:18px;position:relative;z-index:2}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar{width:4px;height:4px;border-radius:12px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#e3e3e3;border-radius:12px;margin-top:8px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#9a9a9a;border-radius:12px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:#555}.prompt-view[_ngcontent-%COMP%] .prompt-info[_ngcontent-%COMP%]{font-size:11px;color:#959aa7;margin-top:0;padding-left:8px;height:24px;line-height:normal;width:calc(100% - 8px);bottom:4px;z-index:99}.info-up[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#c9cad4 -4% 100%)!important;-webkit-mask:linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%) content-box,linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-blue[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff0d -4%,#2520f60d)!important}.info-blue[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#fc5cff -4%,#2520f6)!important;-webkit-mask:linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%) content-box,linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-blue[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#626adf!important}.info-red[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff0d -4%,#2520f60d)!important}.info-red[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#f25555 -4% 100%)!important;-webkit-mask:linear-gradient(90deg,#F25555 -4%,#F25555 100%) content-box,linear-gradient(90deg,#F25555 -4%,#F25555 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-red[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#f25555!important}.fixed-bottom[_ngcontent-%COMP%]{position:fixed!important;width:300px!important;right:auto!important;left:5rem;-webkit-user-select:none;user-select:none;z-index:99}.filter-category[_ngcontent-%COMP%]{position:fixed;top:auto;z-index:99;margin-top:-202px;height:40px}.btn[_ngcontent-%COMP%]:disabled{background:#d9d9d9;border:1px solid #d9d9d9}
1.btn-tabs-editor[_ngcontent-%COMP%]{background:#626adf0d;height:40px;border:0px;padding:2px}.btn-tabs-editor[_ngcontent-%COMP%] .btn-tab-inner[_ngcontent-%COMP%]{height:36px;border-radius:10px;color:#272b34}.btn-tabs-editor[_ngcontent-%COMP%] .btn-tab-inner[_ngcontent-%COMP%]:hover{background-color:transparent!important;color:#272b34!important}.btn-tabs-editor[_ngcontent-%COMP%] .active-btn-tab[_ngcontent-%COMP%], .btn-tabs-editor[_ngcontent-%COMP%] .active-btn-tab[_ngcontent-%COMP%]:hover{background:#626adf!important;color:#fff!important}']}),l})();const Zi=(r,l,o)=>({"info-up":r,"info-blue":l,"info-red":o}),er=r=>({"ai-thumb-active":r});function tr(r,l){if(1&r&&(e.j41(0,"span",22),e.EFF(1),e.k0s()),2&r){const o=e.XpG(2);e.R7$(),e.Lme("",o.aiPhotoService.textPrompt.length,"/",o.maxLenght,"")}}function nr(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",26)(1,"div",27)(2,"img",28),e.bIt("click",function(){const n=e.eBV(o).$implicit,i=e.XpG(3);return e.Njj(i.selectImage(n))}),e.k0s()(),e.j41(3,"span",29),e.EFF(4),e.k0s()()}if(2&r){const o=l.$implicit,t=e.XpG(3);e.Y8G("ngClass",e.eq3(3,er,o.productImageId==t.productImageId)),e.R7$(2),e.Y8G("src",o.thumbUrl,e.B4B),e.R7$(2),e.JRh(o.displayName)}}function or(r,l){1&r&&(e.j41(0,"div",31),e.nrm(1,"div",32)(2,"span",33),e.k0s())}function ir(r,l){if(1&r&&(e.qex(0),e.DNE(1,or,3,0,"div",30),e.bVm()),2&r){const o=e.XpG(3);e.R7$(),e.Y8G("ngForOf",o.paginationPlaceholders)}}function rr(r,l){if(1&r&&(e.j41(0,"div",23)(1,"div",24),e.DNE(2,nr,5,5,"div",25)(3,ir,2,1,"ng-container",4),e.k0s()()),2&r){const o=e.XpG(2);e.R7$(2),e.Y8G("ngForOf",o.products.storeProductImages),e.R7$(),e.Y8G("ngIf",o.isLoadingMoreProductImages&&!o.isProductImagesEnd)}}function sr(r,l){1&r&&(e.qex(0),e.nrm(1,"element-placeholder",34),e.bVm()),2&r&&(e.R7$(),e.Y8G("view","AiPatterns"))}function ar(r,l){if(1&r){const o=e.RV6();e.qex(0),e.j41(1,"div",6)(2,"div",7)(3,"div",8)(4,"div",9)(5,"div",10),e.EFF(6,"Enter Prompt"),e.nrm(7,"pi",11),e.k0s(),e.j41(8,"div",12)(9,"div",13),e.nrm(10,"pi",14,1),e.k0s()()(),e.j41(12,"div",15)(13,"text-prompt-animation",16),e.bIt("changePrompt",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.changePrompt(n))})("focusOut",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.onFocusOut(n))}),e.k0s(),e.DNE(14,tr,2,2,"span",17),e.k0s()()(),e.j41(15,"div",18)(16,"div",19),e.EFF(17,"Choose a style"),e.k0s(),e.j41(18,"div",20),e.DNE(19,rr,4,2,"div",21)(20,sr,2,1,"ng-container",4),e.k0s()()(),e.bVm()}if(2&r){const o=e.XpG(),t=e.sdS(5);e.R7$(10),e.Y8G("autoClose",!0)("ngbPopover",t),e.R7$(2),e.Y8G("ngClass",e.sMw(9,Zi,o.aiPhotoService.textPrompt.length,o.isFocused,o.aiPhotoService.textPrompt.length==o.maxLenght)),e.R7$(),e.Y8G("maxLength",o.maxLenght)("prompts",o.prompts)("textPrompt",o.aiPhotoService.textPrompt),e.R7$(),e.Y8G("ngIf",o.aiPhotoService.textPrompt.length),e.R7$(5),e.Y8G("ngIf",o.products),e.R7$(),e.Y8G("ngIf",!o.products)}}function cr(r,l){if(1&r){const o=e.RV6();e.j41(0,"ai-prompts-popover",35),e.bIt("selectPrompt",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.selectPrompt(n))}),e.k0s()}if(2&r){const o=e.XpG();e.Y8G("items",o.prompts)}}let lr=(()=>{var r;class l{constructor(t,n,i,a,d,g,m){this.mediaContentService=t,this.aiPhotoService=n,this.authService=i,this.createPopupService=a,this.aiUploadImageService=d,this.paymentService=g,this.hostRef=m,this.toolName=h.Fs.STICKER,this.productImageId=0,this.genImageEvent=new e.bkB,this.btnText="Generate",this.disabled=!1,this.placeHolder="Imagine anything, type it",this.isFocused=!1,this.pageNumber=0,this.selectedProductImagePageNumber=0,this.isLoadingMoreProductImages=!1,this.isProductImagesEnd=!1,this.quality=1,this.qtText="Normal",this.isNgPrompt=!1,this.isNgPromptFocus=!1,this.negativePrompt="",this.prompts=[],this.productId=0,this.maxLenght=2e3,this.paginationPlaceholders=[0,1],this.drawerScrollEl=null,this.drawerScrollHandler=b=>this.onDrawerScroll(b),this.user=this.authService.currentUser(),this.loggedInObserver=this.authService.loggedIn.subscribe(b=>{this.user=this.authService.currentUser()}),this.usrPropChangedObserver=this.authService.usrPropChanged.subscribe(b=>{this.user=this.authService.currentUser()}),this.configSubs=this.paymentService.configUpdated.subscribe(()=>{this.config=this.paymentService?.config?.creditInfo})}ngOnInit(){this.aiPhotoService.deleteQueryParams(),this.getCategoryDetails(()=>{this.changePrompt(this.aiPhotoService.textPrompt),this.config=this.paymentService?.config?.creditInfo})}ngAfterViewInit(){this.drawerScrollEl=this.getDrawerScroll(),this.drawerScrollEl&&this.drawerScrollEl.addEventListener("scroll",this.drawerScrollHandler,{passive:!0})}selectImage(t){t?(this.productImageId=t.productImageId,this.selectedStyle=t):(this.productImageId=0,this.selectedStyle=this.noneProduct),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}selectPrompt(t){this.aiPhotoService.textPrompt=t.prompt,this.selectedStyle.isPrompt=!0,this.disabled=!this.aiPhotoService.textPrompt,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),setTimeout(()=>{this.isFocused=!1})}getCategoryDetails(t=null){this.mediaContentService.getCategoryProductDetails(A.KK.AISTICKER,this.pageNumber,n=>{if(n&&n.body){if(!this.products&&n.body.storeProducts){if(this.products=n.body.storeProducts[0],this.productId=this.products.productId,this.selectedStyle=this.noneProduct={productImageId:0,imageJson:"",isGenerated:!1,id:1},this.products.storeProductImages&&this.products.storeProductImages.length>0){const i=this.products.storeProductImages[0];this.resetProductImagePagination(this.products.storeProductImages.length),this.getPrompts(()=>{this.isLoaded=!0}),i&&(this.selectedStyle=i,this.productImageId=this.selectedStyle?.productImageId)}if(this.aiPhotoService.queryParams?._sId){const i=this.products.storeProductImages.filter(a=>a.displayName==this.aiPhotoService.queryParams?._sId)[0];i&&(this.selectedStyle=i,this.productImageId=this.selectedStyle?.productImageId)}}else this.resetProductImagePagination(0);t&&t()}},n=>{this.isLoaded=!0},void 0,void 0,void 0,l.CATEGORY_EMBEDDED_IMAGE_COUNT)}getPrompts(t=null){this.mediaContentService.getPrompts(A.Jl.Sticker,n=>{n&&(this.prompts=n.prompts),t&&t()},n=>{})}generate(){if(!this.aiPhotoService.inProgress)if(this.user&&this.user.remainingCoins>=this.config?.sticker){const t={featureType:h.Fs.STICKER,textPrompt:this.aiPhotoService.textPrompt,isCustomPrompt:1,quality:this.qual
1ity,...this.isNgPrompt&&this.negativePrompt&&{negativePrompt:this.negativePrompt},substyle:this.productImageId?this.selectedStyle.imageJson:"",...this.productId&&{productId:this.productId},...this.productImageId&&{productImageId:this.productImageId}};this.aiPhotoService.startGenerationProgress({featureType:h.Fs.STICKER}),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),this.aiPhotoService.generateImage(t,n=>{n&&n.assetId?(n.featureType=h.Fs.STICKER,n.toolName=x.b.label.aiSticker,n.styleName=this.selectedStyle?.displayName,this.aiPhotoService.checkStatus(n,0,a=>{a&&a.urls&&a.urls.length>0?(this.user.remainingCoins=a.remainingCalls,this.aiPhotoService.isDirty=!0,this.selectedStyle.isGenerated=!0):this.aiPhotoService.clearGenerationProgress(),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)},a=>{this.displayErrorMsg(a)})):this.displayErrorMsg(n)},n=>{this.displayErrorMsg(n)})}else this.aiPhotoService.openAICreditPopup(()=>{this.user=this.authService.currentUser(),this.generate()},this.config?.sticker)}displayErrorMsg(t=null){this.aiPhotoService.clearGenerationProgress();let n=t?.description;this.createPopupService.openWarningDialog("Error",n),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}ngOnDestroy(){this.aiPhotoService.textPrompt="",this.drawerScrollEl&&(this.drawerScrollEl.removeEventListener("scroll",this.drawerScrollHandler),this.drawerScrollEl=null),this.loggedInObserver&&this.loggedInObserver.unsubscribe(),this.usrPropChangedObserver&&this.usrPropChangedObserver.unsubscribe()}changePrompt(t=""){this.aiPhotoService.textPrompt=t,this.disabled=!(this.aiPhotoService.textPrompt&&this.aiPhotoService.textPrompt.trim().length>1),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}focusIn(){this.isFocused=!0}onFocusOut(t){this.isFocused=t}focusOut(){this.isFocused=!1}toggleButton(t){this.isNgPrompt=t}onDrawerScroll(t){const n=t?.target;n&&this.products?.productId&&n.scrollHeight-(n.scrollTop+n.clientHeight)<=24&&this.loadMoreProductImages()}resetProductImagePagination(t){this.selectedProductImagePageNumber=0,this.isLoadingMoreProductImages=!1,this.isProductImagesEnd=0===t||t<l.CATEGORY_EMBEDDED_IMAGE_COUNT}loadMoreProductImages(){if(!this.products?.productId||this.isLoadingMoreProductImages||this.isProductImagesEnd)return;const t=(0,B.vt)(!1,this.selectedProductImagePageNumber);this.isLoadingMoreProductImages=!0,this.mediaContentService.getTemplateByProductId(this.products.productId,t,n=>{const i=n?.storeProductImages||[];if(this.products.storeProductImages||(this.products.storeProductImages=[]),i.length){const a=this.products.storeProductImages.length;this.products.storeProductImages=(0,B.cb)(this.products.storeProductImages,i,"productImageId"),this.isProductImagesEnd=(0,B.HC)(i.length,l.PRODUCT_IMAGE_PAGE_SIZE,this.products.storeProductImages.length-a)}else this.isProductImagesEnd=!0;this.selectedProductImagePageNumber=t,this.isLoadingMoreProductImages=!1},()=>{this.isLoadingMoreProductImages=!1},null,l.PRODUCT_IMAGE_PAGE_SIZE)}getDrawerScroll(){return this.hostRef.nativeElement.closest(".drawer-scroll")||this.hostRef.nativeElement.querySelector(".scroll-content")}}return(r=l).PRODUCT_IMAGE_PAGE_SIZE=10,r.CATEGORY_EMBEDDED_IMAGE_COUNT=10,r.\u0275fac=function(t){return new(t||r)(e.rXU(te.Z),e.rXU(U.s),e.rXU(N.u),e.rXU(Q.A),e.rXU(G.M),e.rXU(K.W),e.rXU(e.aKT))},r.\u0275cmp=e.VBU({type:r,selectors:[["sticker-drawer"]],inputs:{toolName:"toolName"},outputs:{genImageEvent:"genImageEvent"},decls:6,vars:4,consts:[["popContent",""],["popOver","ngbPopover"],[1,"pane-section"],[1,"scroll-content","drawer-elements","ai-drawer-elements"],[4,"ngIf"],[3,"btnClick","disabled","btnText","credit"],[1,"common-container","m-0","p-0"],[1,"card","ps-3","pe-3","pt-2","pb-3","border-0"],[1,"d-flex","w-100","flex-column","prompt-view"],[1,"wp-100","mb-1","d-flex","align-items-center","justify-content-between"],[1,"text-normal","text-dark","text-semi","lh-125"],["name","helpicon","placement","right","popoverClass","pop-for-tooltip","ngbPopover","Provide a text description about the subject, style, setting and any other specific element guiding the AI to understand the exact image you want generated.","triggers","mouseenter:mouseleave","popoverTitle","Enter Prompt","container","body",1,"ms-1","hw-24","help-icon"],["placement","right","ngbTooltip","Suggested Prompt","tooltipClass","tooltip-custom-all","container","body"],[1,"lampIcon","hw-32"],["name","lampicon","placement","right","container","body","popoverClass","background-prompt",1,"pointer","f-32","lampicon",3,"autoClose","ngbPopover"],[1,"textarea-col","position-relative",3,"ngClass"],[1,"text-animation",3,"changePrompt","focusOut","maxLength","prompts","textPrompt"],["class","prompt-info text-regular position-absolute d-flex align-items-center justify-content-start",4,"ngIf"],[1,"card","ps-3","pe-3","pt-2","border-0","mt-3"],[1,"text-normal","text-dark","text-semi","lh-125","d-flex","align-items-center","w-100","h-32"],[1,"d-flex","w-100","flex-column","mt-2"],["class","d-flex w-100 flex-column",4,"ngIf"],[1,"prompt-info","text-regular","position-absolute","d-flex","align-items-center","justify-content-start"],[1,"d-flex","w-100","flex-column"],[1,"ai-thumb-list","d-flex","align-items-center","justify-content-between"],["class","ai-thumb-col d-flex align-items-center flex-column",3,"ngClass",4,"ngFor","ngForOf"],[1,"ai-thumb-col","d-flex","align-items-center","flex-column",3,"ngClass"],[1,"img-col","d-flex","align-items-center","border-radius-12","mb-1"],["width","115px","height","115px",3,"click","
1src"],[1,"text-semi","w-100","text-center"],["class","ai-thumb-col d-flex align-items-center justify-content-center flex-column placeholder-thumb",4,"ngFor","ngForOf"],[1,"ai-thumb-col","d-flex","align-items-center","justify-content-center","flex-column","placeholder-thumb"],[1,"img-col","d-flex","align-items-center","border-radius-12","mb-1","skeleton-box"],[1,"skeleton-line"],[3,"view"],[3,"selectPrompt","items"]],template:function(t,n){if(1&t){const i=e.RV6();e.j41(0,"div",2)(1,"div",3),e.DNE(2,ar,21,13,"ng-container",4),e.k0s()(),e.j41(3,"generate-button",5),e.bIt("btnClick",function(){return e.eBV(i),e.Njj(n.generate())}),e.k0s(),e.DNE(4,cr,1,1,"ng-template",null,0,e.C5r)}2&t&&(e.R7$(2),e.Y8G("ngIf",n.isLoaded),e.R7$(),e.Y8G("disabled",n.disabled)("btnText",n.btnText)("credit",null==n.config?null:n.config.sticker))},dependencies:[s.YU,s.Sq,s.bT,ae.n,f.ZM,f.md,L.b,ue.k,oe.t,ce],styles:['.top-list-placeholders[_ngcontent-%COMP%]{gap:8px;flex-wrap:nowrap;white-space:nowrap;overflow:hidden}.top-placeholder-pill[_ngcontent-%COMP%]{flex:0 0 80px;width:80px;height:24px;border-radius:14px;background:linear-gradient(90deg,#f1f2f6 25%,#e5e7ef 37%,#f1f2f6 63%);background-size:400% 100%;animation:_ngcontent-%COMP%_drawer-skeleton-shimmer 1.2s ease-in-out infinite}.placeholder-thumb[_ngcontent-%COMP%] .skeleton-box[_ngcontent-%COMP%]{width:112px;height:112px;border-radius:12px;background:linear-gradient(90deg,#f1f2f6 25%,#e5e7ef 37%,#f1f2f6 63%);background-size:400% 100%;animation:_ngcontent-%COMP%_drawer-skeleton-shimmer 1.2s ease-in-out infinite}.placeholder-thumb[_ngcontent-%COMP%] .skeleton-line[_ngcontent-%COMP%]{width:72px;height:12px;border-radius:8px;background:linear-gradient(90deg,#f1f2f6 25%,#e5e7ef 37%,#f1f2f6 63%);background-size:400% 100%;animation:_ngcontent-%COMP%_drawer-skeleton-shimmer 1.2s ease-in-out infinite}@keyframes _ngcontent-%COMP%_drawer-skeleton-shimmer{0%{background-position:100% 0}to{background-position:0 0}}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]{width:100%;height:110px;border-radius:12px;background:linear-gradient(90deg,#fc5cff05 -4%,#2520f605);padding:.9px 4px 4px}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#c9cad4 -4% 100%);-webkit-mask:linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%) content-box,linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%);-webkit-mask-composite:xor;mask-composite:exclude;z-index:1}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]:hover:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#606576 -4% 100%);-webkit-mask:linear-gradient(90deg,#606576 -4%,#606576 100%) content-box,linear-gradient(90deg,#606576 -4%,#606576 100%);-webkit-mask-composite:xor;mask-composite:exclude;z-index:1}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{resize:none;outline:none;width:100%;height:82px;padding:8px 8px 0;font-size:12px;color:#b0b3bf;border:0px;background:transparent;line-height:18px;position:relative;z-index:2}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar{width:4px;height:4px;border-radius:12px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#e3e3e3;border-radius:12px;margin-top:8px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#9a9a9a;border-radius:12px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:#555}.prompt-view[_ngcontent-%COMP%] .prompt-info[_ngcontent-%COMP%]{font-size:11px;color:#959aa7;margin-top:0;padding-left:8px;height:24px;line-height:normal;width:calc(100% - 8px);bottom:4px;z-index:99}.ai-thumb-list[_ngcontent-%COMP%]{flex-flow:wrap}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%]{height:100%;width:112px;border-radius:8px;margin-bottom:16px;cursor:pointer;min-height:112px;min-width:112px}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%]{transition:transform .2s;min-height:112px;min-width:112px}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%;height:100%;border-radius:12px!important}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%]:hover{transform:scale(1.03)}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#272b34;font-size:12px}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] .none-variation[_ngcontent-%COMP%]{background:linear-gradient(90deg,#f3deffb3 -4%,#e0e2ffb3);width:100%;min-height:112px;border-radius:8px;transition:transform .2s}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] .none-variation[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:40px;height:40px}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] .none-variation[_ngcontent-%COMP%] img[_ngcontent-%COMP%]:hover{transform:none}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] .none-variation[_ngcontent-%COMP%]:hover{transform:scale(1.03)}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%]{min-height:112px;min-width:112px}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%]{transition:transform .2s}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%]:hover{transform:none}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{border-radius:12px;border:2px solid #626ADF;padding:3px;transition:transform .2s}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] img[_ngcontent-%COMP%]:hover{transform:scale(1.03)}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#626adf}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] .none-variation[_ngcontent-%COMP%]{border-radius:12px;border:2px solid #626ADF;padding:3px;transition:transform .2s}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] .none-variation[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:40px;height:40px;border:none!important}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] .none-variation[_ngcontent-%COMP%] img[_ngcontent-%COMP%]:hover{transform:none}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] .none-variation[_ngcontent-%COMP%]:hover{transform:scale(1.03)}.info-up[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#c9cad4 -4% 100%)!important;-webkit-mask:linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%) content-box,linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-blue[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff0d -4%,#2520f60d)!important}.info-blue[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#fc5cff -4%,#2520f6)!important;-webkit-mask:linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%) content-box,linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-blue[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#626adf!important}.info-red[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff0d -4%,#2520f60d)!important}.info-red[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#f25555 -4% 100%)!important;-webkit-mask:linear-gradient(90deg,#F25555 -4%,#F25555 100%) content-box,linear-gradient(90deg,#F25555 -4%,#F25555 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-red[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#f25555!important}']}),l})();var $e=c(93391),Re=c(29615);const dr=["popoverOpen"],at=(r,l,o)=>({"info-up":r,"info-blue":l,"info-red":o}),ct=r=>({"disable-style pe-none":r}),_r=r=>({"magic-disable":r});function gr(r,l){1&r&&e.nrm(0,"ei",39)}function pr(r,l){1&r&&e.nrm(0,"ei",40)}function mr(r,l){if(1&r){const o=e.RV6();e.j41(0,"span",34)(1,"span",35),e.EFF(2),e.k0s(),e.j41(3,"button",36),e.bIt("click",function(){e.eBV(o);const n=e.XpG(2);return e.Njj(n.getMagicPrompt())}),e.DNE(4,gr,1,0,"ei",37)(5,pr,1,0,"ei",38),e.k0s()()}if(2&r){const o=e.XpG(2);e.R7$(2),e.Lme("",o.aiPhotoService.textPrompt.length,"/",o.maxLenght,""),e.R7$(),e.Y8G("ngbTooltip",o.aiPhotoService.textPrompt.length>=10&&o.aiPhotoService.textPrompt.length<=100?"Magic Prompt":null)("ngClass",e.eq3(6,_r,o.aiPhotoService.textPrompt.length<10||o.aiPhotoService.textPrompt.length>100)),e.R7$(),e.Y8G("ngIf",o.aiPhotoService.textPrompt.length>=10&&o.aiPhotoService.textPrompt.length<=100),e.R7$(),e.Y8G("ngIf",o.aiPhotoService.textPrompt.length<10||o.aiPhotoService.textPrompt.length>100)}}function hr(r,l){1&r&&(e.j41(0,"div",41),e.nrm(1,"img",42),e.k0s())}function ur(r,l){if(1&r&&(e.j41(0,"span",47),e.EFF(1),e.k0s()),2&r){const o=e.XpG(3);e.R7$(),e.SpI("",o.negativePrompt.length,"/450")}}function Pr(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",43)(1,"div",44)(2,"textarea",45),e.mxI("ngModelChange",function(n){e.eBV(o);const i=e.XpG(2);return e.DH7(i.negativePrompt,n)||(i.negativePrompt=n),e.Njj(n)}),e.bIt("blur",function(){e.eBV(o);const n=e.XpG(2);return e.Njj(n.focusOut())})("focus",function(){e.eBV(o);const n=e.XpG(2);return e.Njj(n.focusIn())}),e.k0s(),e.DNE(3,ur,2,1,"span",46),e.k0s()()}if(2&r){const o=e.XpG(2);e.Y8G("ngClass",e.eq3(6,ct,"flux"==(null==o.selectedModel?null:o.selectedModel.subFeatureType))),e.R7$(),e.Y8G("ngClass",e.sMw(8,at,o.negativePrompt.length,o.isNgPromptFocus,450==o.negativePrompt.length)),e.R7$(),e.AVh("blue-active",o.isNgPromptFocus),e.R50("ngModel",o.negativePrompt),e.R7$(),e.Y8G("ngIf",o.negativePrompt.length)}}function fr(r,l){if(1&r){const o=e.RV6();e.qex(0),e.j41(1,"div",13)(2,"div",14)(3,"div",15)(4,"div",16)(5,"div",17),e.EFF(6,"Enter Prompt"),e.j41(7,"pi",18),e.bIt("mouseenter",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.hideStyleRefPopover())}),e.k0s()(),e.j41(8,"div",19)(9,"pi",20,2),e.bIt("shown",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.isPopoverOpen=!0)})("hidden",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.isPopoverOpen=!1)}),e.k0s()()(),e.j41(11,"div",21)(12,"text-prompt-animation",22),e.bIt("changePrompt",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.changePrompt(n))})("focusOut",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.onFocusOut(n))}),e.k0s(),e.DNE(13,mr,6,8,"span",23)(14,hr,2,0,"div",24),e.k0s()(),e.j41(15,"div",25)(16,"div",26)(17,"div",27)(18,"div",28),e.EFF(19,"Negative Prompt"),e.j41(20,"pi",29),e.bIt("mouseenter",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.hideStyleRefPopover())}),e.k0s()()(),e.j41(21,"div",30)(22,"toggle-switch",31),e.bIt("changeT",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.toggleButton(n))}),e.k0s()()(),e.DNE(23,Pr,4,12,"div",32),e.k0s(),e.j41(24,"model-selection",33),e.bIt("modelChange",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.onModelChange(n))}),e.k0s()()(),e.bVm()}if(2&r){const o=e.XpG(),t=e.sdS(12);e.R7$(8),e.Y8G("ngbTooltip",o.isPopoverOpen?null:"Suggested Prompt"),e.R7$(),e.Y8G("autoClose",!0)("ngbPopover",t),e.R7$(2),e.Y8G("ngClass",e.sMw(15,at,o.aiPhotoService.textPrompt.length,o.isFocused,o.aiPhotoService.textPrompt.length==o.maxLenght)),e.R7$(),e.Y8G("maxLength",o.maxLenght)("prompts",o.prompts)("textPrompt",o.aiPhotoService.textPrompt),e.R7$(),e.Y8G("ngIf",o.aiPhotoService.textPrompt.length),e.R7$(),e.Y8G("ngIf",o.ismagicPrompt),e.R7$(2),e.Y8G("ngClass",e.eq3(19,ct,"flux"==(null==o.selectedModel?null:o.selectedModel.subFeatureType))),e.R7$(6),e.Y8G("selected",o.isNgPrompt),e.R7$(),e.Y8G("ngIf",o.isNgPrompt),e.R7$(),e.Y8G("type","model-dropdown-image")("featureType","text2image")("selectedModel",o.selectedModel)}}
1function br(r,l){1&r&&(e.j41(0,"div",48),e.EFF(1," Resolution "),e.k0s())}function Cr(r,l){if(1&r&&(e.j41(0,"ng-option",49)(1,"div",50)(2,"div",51),e.nrm(3,"pi",52),e.j41(4,"span",53),e.EFF(5),e.k0s(),e.j41(6,"span",54),e.EFF(7),e.k0s()(),e.j41(8,"span",55),e.EFF(9),e.k0s()()()),2&r){const o=l.$implicit;e.Y8G("value",o),e.R7$(3),e.Y8G("name",o.icon),e.R7$(2),e.JRh(o.name),e.R7$(2),e.JRh(o.ratio),e.R7$(2),e.SpI("",o.size," px")}}function vr(r,l){if(1&r){const o=e.RV6();e.j41(0,"ai-prompts-popover",56),e.bIt("selectPrompt",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.selectPrompt(n))}),e.k0s()}if(2&r){const o=e.XpG();e.Y8G("items",o.prompts)}}let Ir=(()=>{var r;class l{constructor(t,n,i,a,d,g){this.mediaContentService=t,this.renderer=n,this.aiPhotoService=i,this.authService=a,this.createPopupService=d,this.aiUploadImageService=g,this.isPopoverOpen=!1,this.resolutions=[],this.btnText="Generate",this.disabled=!1,this.isFocused=!1,this.isNgPrompt=!1,this.isNgPromptFocus=!1,this.negativePrompt="",this.prompts=[],this.selectedModel=null,this.credit=1,this.ismagicPrompt=!1,this.selectedSize=null,this.quality=1,this.maxLenght=2e3,this.user=this.authService.currentUser(),this.loggedInObserver=this.authService.loggedIn.subscribe(m=>{this.user=this.authService.currentUser()}),this.updateBehaviorUserAiConis=this.authService.updateBehaviorUserAiConis.subscribe(m=>{this.user=this.authService.currentUser()}),this.usrPropChangedObserver=this.authService.usrPropChanged.subscribe(m=>{this.user=this.authService.currentUser(),m&&this.authService.updateUserAiConis(()=>{})}),this.usrAICreditChanged=this.authService.usrAICreditChanged.subscribe(m=>{this.user=this.authService.currentUser(),m&&this.authService.updateUserAiConis(()=>{})})}ngOnInit(){this.getPrompts(),this.changePrompt(this.aiPhotoService.textPrompt),this.aiPhotoService.deleteQueryParams(),this.isLoaded=!0}getMagicPrompt(){this.ismagicPrompt=!0,this.aiPhotoService.getMagicPrompts(this.aiPhotoService.textPrompt,h.Fs.TextToImage,t=>{t?(this.aiPhotoService.textPrompt=t?.textPrompt,setTimeout(()=>{this.ismagicPrompt=!1},200)):this.ismagicPrompt=!1},t=>{this.ismagicPrompt=!1})}generate(){if(!this.aiPhotoService.inProgress&&this.aiPhotoService.textPrompt)if(this.user&&this.user.remainingCoins>=this.credit){this.aiPhotoService.startGenerationProgress({featureType:h.Fs.TextToImage});const t={featureType:h.Fs.TextToImage,textPrompt:this.aiPhotoService.textPrompt,isCustomPrompt:1,...this.aiPhotoService.getImageModelOptions(this.selectedModel,this.selectedSize.qType)};this.aiPhotoService.generateImage(t,n=>{n&&n.assetId?(n.featureType=this.aiPhotoService.selectedGuidance.guidanceId&&"Standard"!=this.selectedModel?.subFeatureType?h.Fs.ImageToImage:h.Fs.TextToImage,n.toolName=x.b.label.text2Image,this.aiPhotoService.checkStatus(n,0,a=>{a&&a.urls&&a.urls.length>0?(this.user.remainingCoins=a.remainingCalls,this.aiPhotoService.isDirty=!0):this.aiPhotoService.clearGenerationProgress()},a=>{this.displayErrorMsg(a)})):this.displayErrorMsg(n)},n=>{this.displayErrorMsg(n)})}else this.aiPhotoService.openAICreditPopup(()=>{this.user=this.authService.currentUser(),this.generate()},this.credit)}displayErrorMsg(t=null){this.aiPhotoService.clearGenerationProgress();let n=t?.description;this.createPopupService.openWarningDialog("Error",n),this.btnText=this.aiPhotoService.changeBtnText({})}ngOnDestroy(){this.aiPhotoService.textPrompt="",this.loggedInObserver&&this.loggedInObserver.unsubscribe(),this.usrPropChangedObserver&&this.usrPropChangedObserver.unsubscribe(),this.usrAICreditChanged&&this.usrAICreditChanged.unsubscribe(),this.updateBehaviorUserAiConis&&this.updateBehaviorUserAiConis.unsubscribe()}changePrompt(t=""){this.aiPhotoService.textPrompt=t,this.disabled=!(this.aiPhotoService.textPrompt&&this.aiPhotoService.textPrompt.trim().length>1||this.aiPhotoService.selectedGuidance.thumbUrl)}onFocusOut(t){this.isFocused=t}focusOut(){this.isNgPromptFocus=!1}focusIn(){this.isNgPromptFocus=!0}toggleButton(t){this.isNgPrompt=t}getPrompts(t=null){this.mediaContentService.getPrompts(A.Jl.TextToImage,n=>{n&&(this.prompts=n.prompts),t&&t()},n=>{t&&t()})}selectPrompt(t){this.aiPhotoService.textPrompt=t.prompt,this.disabled=!this.aiPhotoService.textPrompt,this.btnText=this.aiPhotoService.changeBtnText({}),setTimeout(()=>{this.isFocused=!1})}onDropdownOpen(){this.renderer.addClass(document.body,"drop-open")}onDropdownClose(){this.renderer.removeClass(document.body,"drop-open")}hideStyleRefPopover(){this.isPopoverOpen&&(this.isPopoverOpen=!1)}onModelChange(t){this.updateModelSelection(t)}onModelButtonChange(t){this.updateModelSelection(t)}updateModelSelection(t){t&&(this.selectedModel=t,this.resolutions=t?.raw?.aspectRatios,this.selectedSize=this.resolutions[0],this.onResolutionClick(this.selectedSize))}onResolutionClick(t){this.selectedSize=t,this.credit=this.selectedSize?.credit||1}}return(r=l).\u0275fac=function(t){return new(t||r)(e.rXU(te.Z),e.rXU(e.sFG),e.rXU(U.s),e.rXU(N.u),e.rXU(Q.A),e.rXU(G.M))},r.\u0275cmp=e.VBU({type:r,selectors:[["text-to-image-drawer"]],viewQuery:function(t,n){if(1&t&&e.GBs(dr,5),2&t){let i;e.mGM(i=e.lsd())&&(n.popoverOpen=i.first)}},decls:13,vars:8,consts:[["ngSelect",""],["popContent",""],["popOver","ngbPopover"],[1,"w-100"],[1,"pane-section","aiImageGen","w-100"],[1,"scroll-content","drawer-elements","ai-drawer-elements","w-100"],[4,"ngIf"],[1,"position-absolute","fixed-bottom","pb-1","pt-2","ps-3","pe-3","bg-white","as
1pect-ratio-column"],[1,"d-flex","align-items-center","mb-1"],["appendTo","body",1,"select-menu","fixed-resolution-drop","for-text-image",2,"width","-webkit-fill-available","width","100%",3,"ngModelChange","open","close","change","ngModel","searchable","clearable"],["ng-header-tmp",""],[3,"value",4,"ngFor","ngForOf"],[3,"btnClick","disabled","btnText","credit"],[1,"common-container","m-0","p-0","pb-8"],[1,"card","ps-3","pe-3","pt-2","pb-3","border-0"],[1,"d-flex","w-100","flex-column","prompt-view"],[1,"wp-100","mb-1","d-flex","align-items-center","justify-content-between"],[1,"text-normal","text-dark","text-semi","lh-125"],["name","helpicon","placement","right","popoverClass","pop-for-tooltip","ngbPopover","Provide a text description about the subject, style, setting and any other specific element guiding the AI to understand the exact image you want generated.","triggers","mouseenter:mouseleave","popoverTitle","Enter Prompt","container","body",1,"ms-1","hw-24","help-icon",3,"mouseenter"],["placement","right","tooltipClass","tooltip-custom-all","container","body",1,"hw-32","overflow-hidden","border-radius-8",3,"ngbTooltip"],["name","lampicon","placement","right","container","body","popoverClass","background-prompt",1,"pointer","f-32","lampicon",3,"shown","hidden","autoClose","ngbPopover"],[1,"textarea-col","position-relative","mb-3",3,"ngClass"],[1,"text-animation",3,"changePrompt","focusOut","maxLength","prompts","textPrompt"],["class","prompt-info text-regular position-absolute d-flex align-items-center justify-content-between",4,"ngIf"],["class","magicprompt-overlay position-absolute w-100 h-100 d-flex align-items-center justify-content-center border-radius-12",4,"ngIf"],[1,"mb-0"],[1,"d-flex","align-items-center","h-32",3,"ngClass"],[1,"wp-100"],[1,"name","text-semi"],["name","helpicon","placement","right","popoverClass","pop-for-tooltip","ngbPopover","Specify what to exclude in your results. This refines the output by preventing certain elements. Try- out of frame, deformed, bad proportions, extra limbs etc from appearing in the final image.","triggers","mouseenter:mouseleave","popoverTitle","Negative Prompt","container","body",1,"ms-1","hw-24","help-icon",3,"mouseenter"],[1,"editor-toggle",2,"height","26px"],[1,"d-flex","align-items-center","mb-0",3,"changeT","selected"],["class","d-flex w-100 flex-column prompt-view mt-1",3,"ngClass",4,"ngIf"],[3,"modelChange","type","featureType","selectedModel"],[1,"prompt-info","text-regular","position-absolute","d-flex","align-items-center","justify-content-between"],[1,"d-inline-flex","align-items-center","justify-content-start"],["type","button","placement","top","tooltipClass","tooltip-custom-all","container","body",1,"btn","magic-btn","text-10","border-radius-8","text-semi","d-inline-flex","align-items-center","grey-800","border-0",3,"click","ngbTooltip","ngClass"],["name","magicprompt","class","",4,"ngIf"],["name","magicdisable","class","",4,"ngIf"],["name","magicprompt",1,""],["name","magicdisable",1,""],[1,"magicprompt-overlay","position-absolute","w-100","h-100","d-flex","align-items-center","justify-content-center","border-radius-12"],["src","https://static.lightxeditor.com/assets/images/LoadingBar.png","height","32px","width","32px",1,"rotate-loader"],[1,"d-flex","w-100","flex-column","prompt-view","mt-1",3,"ngClass"],[1,"textarea-col","h-73","position-relative",3,"ngClass"],["id","cprompt1","name","cprompt1","rows","2","cols","50","maxlength","450","placeholder","Type what you want to exclude",1,"prompt-text",2,"height","68%",3,"ngModelChange","blur","focus","ngModel"],["class","prompt-info text-regular position-absolute d-flex align-items-center justify-content-start",4,"ngIf"],[1,"prompt-info","text-regular","position-absolute","d-flex","align-items-center","justify-content-start"],[1,"d-inline-flex","align-items-center","justify-content-start","text-13","grey-800","text-semi","lh-125","mb-1","w-100",2,"min-height","32px"],[3,"value"],[1,"option-with-icon","d-flex","align-items-center","justify-content-between"],[1,"d-flex","align-items-center"],[1,"right-sign","f-16","me-2","d-inline-flex",3,"name"],[1,"d-inline-flex","text-12","lh-140","text-black","text-medium","me-1","item-name"],[1,"d-inline-flex","me-1","grey-600","item-ratio","text-semi"],[1,"text-12","text-black","text-medium","lh-140","d-inline-flex","me-1"],[3,"selectPrompt","items"]],template:function(t,n){if(1&t){const i=e.RV6();e.j41(0,"div",3)(1,"div",4)(2,"div",5),e.DNE(3,fr,25,21,"ng-container",6),e.k0s()(),e.j41(4,"div",7)(5,"div",8)(6,"ng-select",9,0),e.mxI("ngModelChange",function(d){return e.eBV(i),e.DH7(n.selectedSize,d)||(n.selectedSize=d),e.Njj(d)}),e.bIt("open",function(){return e.eBV(i),e.Njj(n.onDropdownOpen())})("close",function(){return e.eBV(i),e.Njj(n.onDropdownClose())})("change",function(d){return e.eBV(i),e.Njj(n.onResolutionClick(d))}),e.DNE(8,br,2,0,"ng-template",10)(9,Cr,10,5,"ng-option",11),e.k0s()(),e.j41(10,"generate-button",12),e.bIt("btnClick",function(){return e.eBV(i),e.Njj(n.generate())}),e.k0s()()(),e.DNE(11,vr,1,1,"ng-template",null,1,e.C5r)}2&t&&(e.R7$(3),e.Y8G("ngIf",n.isLoaded),e.R7$(3),e.R50("ngModel",n.selectedSize),e.Y8G("searchable",!1)("clearable",!1),e.R7$(3),e.Y8G("ngForOf",n.resolutions),e.R7$(),e.Y8G("disabled",n.disabled)("btnText",n.btnText)("credit",n.credit))},dependencies:[s.YU,s.Sq,s.bT,$e.C,f.ZM,f.md,u.me,u.BC,u.tU,u.vS,L.b,X.vr,X.xt,X.Uc,ue.k,oe.t,Ee.KK,Re.x,ce],styles:['.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]{width:100%;height:110px;border-radius:12px;background:linear-gradient(90deg,#fc5cff05 -4%,#2520f605);padding:.9px 4px 4px}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#c9cad4 -4% 100%);-webkit-mask:linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%) content-box,linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%);-webkit-mask-composite:xor;mask-composite:exclude;z-index:1}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]:hover:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#606576 -4% 100%);-webkit-mask:linear-gradient(90deg,#606576 -4%,#606576 100%) content-box,linear-gradient(90deg,#606576 -4%,#606576 100%);-webkit-mask-composite:xor;mask-composite:exclude;z-index:1}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{resize:none;outline:none;width:100%;height:78px;padding:8px 8px 0;font-size:12px;color:#b0b3bf;border:0px;background:transparent;line-height:18px;position:relative;z-index:2}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar{width:4px;height:4px;border-radius:12px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#e3e3e3;border-radius:12px;margin-top:8px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#9a9a9a;border-radius:12px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:#555}.prompt-view[_ngcontent-%COMP%] .prompt-info[_ngcontent-%COMP%]{font-size:11px;color:#959aa7;margin-top:0;padding-left:8px;height:24px;line-height:normal;width:calc(100% - 8px);bottom:4px;z-index:9}.prompt-view[_ngcontent-%COMP%] .lampicon[_ngcontent-%COMP%]{border-radius:8px}.prompt-view[_ngcontent-%COMP%] .lampicon[_ngcontent-%COMP%]:hover{background:#626adf0d}.info-up[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#c9cad4 -4% 100%)!important;-webkit-mask:linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%) content-box,linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-blue[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff0d -4%,#2520f60d)!important}.info-blue[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#fc5cff -4%,#2520f6)!important;-webkit-mask:linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%) content-box,linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-blue[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#626adf!important}.info-red[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff0d -4%,#2520f60d)!important}.info-red[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#f25555 -4% 100%)!important;-webkit-mask:linear-gradient(90deg,#F25555 -4%,#F25555 100%) content-box,linear-gradient(90deg,#F25555 -4%,#F25555 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-red[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#f25555!important}.prompt-text[_ngcontent-%COMP%]{color:#272b34!important}.h-73[_ngcontent-%COMP%]{height:73px!important}.bottom-container[_ngcontent-%COMP%]{border-radius:20px 20px 0 0}
1.bottom-container[_ngcontent-%COMP%] .modal-box[_ngcontent-%COMP%]{background:#626adf0d;position:relative}.bottom-container[_ngcontent-%COMP%] .modal-box[_ngcontent-%COMP%] .icon-box[_ngcontent-%COMP%]{border-radius:6px;background:#626adf1a}.bottom-container[_ngcontent-%COMP%] .modal-box[_ngcontent-%COMP%] .coin-box[_ngcontent-%COMP%]{border:1px solid #C9CAD4;padding:0 6px 0 0;min-height:24px;min-width:42px}.bottom-container[_ngcontent-%COMP%] .resolution-modal[_ngcontent-%COMP%]{min-height:40px}.bottom-container[_ngcontent-%COMP%] .resolution-modal[_ngcontent-%COMP%] .ratio-box[_ngcontent-%COMP%]{border-radius:6px;background:#626adf1a;max-height:23px}.bottom-container[_ngcontent-%COMP%] .active-modal[_ngcontent-%COMP%], .bottom-container[_ngcontent-%COMP%] .active-resolution[_ngcontent-%COMP%]{position:relative}.bottom-container[_ngcontent-%COMP%] .active-modal[_ngcontent-%COMP%] .icon-box[_ngcontent-%COMP%], .bottom-container[_ngcontent-%COMP%] .active-modal[_ngcontent-%COMP%] .ratio-box[_ngcontent-%COMP%], .bottom-container[_ngcontent-%COMP%] .active-resolution[_ngcontent-%COMP%] .icon-box[_ngcontent-%COMP%], .bottom-container[_ngcontent-%COMP%] .active-resolution[_ngcontent-%COMP%] .ratio-box[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff1a -4%,#2520f61a)}.bottom-container[_ngcontent-%COMP%] .active-modal[_ngcontent-%COMP%] .coin-box[_ngcontent-%COMP%], .bottom-container[_ngcontent-%COMP%] .active-resolution[_ngcontent-%COMP%] .coin-box[_ngcontent-%COMP%]{position:relative;border:0px}.bottom-container[_ngcontent-%COMP%] .active-modal[_ngcontent-%COMP%] .coin-box[_ngcontent-%COMP%]:after, .bottom-container[_ngcontent-%COMP%] .active-resolution[_ngcontent-%COMP%] .coin-box[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:0px;background:linear-gradient(90deg,#fc5cff -4%,#2520f6);-webkit-mask:linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%) content-box,linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%);-webkit-mask-composite:xor;mask-composite:exclude}.bottom-container[_ngcontent-%COMP%] .active-modal[_ngcontent-%COMP%]:after, .bottom-container[_ngcontent-%COMP%] .active-resolution[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:1.3px;border:none;background:linear-gradient(90deg,#fc5cff -4%,#2520f6);-webkit-mask:linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%) content-box,linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%);-webkit-mask-composite:xor;mask-composite:exclude}.bottom-container[_ngcontent-%COMP%] .modal-box[_ngcontent-%COMP%]:last-child{margin-bottom:0!important}.bottom-container[_ngcontent-%COMP%] .new_item[_ngcontent-%COMP%] .icon-box[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:24px!important;width:24px!important}.bottom-container[_ngcontent-%COMP%] .new_item[_ngcontent-%COMP%]:after{height:18px;top:0!important}.disable-style[_ngcontent-%COMP%]{cursor:default;opacity:.3}.disable-style[_ngcontent-%COMP%] .editor-toggle[_ngcontent-%COMP%]{opacity:.3}.resolution-custom[_ngcontent-%COMP%]{border:1px solid #E2E3E9;background:#626adf0d;height:52px}.resolution-custom[_ngcontent-%COMP%] .option-with-icon[_ngcontent-%COMP%]{padding-left:4px;justify-content:start}.resolution-custom[_ngcontent-%COMP%] .option-with-icon[_ngcontent-%COMP%] pi[_ngcontent-%COMP%]{color:#c9cad4}.resolution-custom[_ngcontent-%COMP%] .option-with-icon[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{display:none}.resolution-custom[_ngcontent-%COMP%] .option-with-icon[_ngcontent-%COMP%] .item-ratio[_ngcontent-%COMP%]{height:19px;border-radius:6px;background:#f2f3fc;font-size:10px;letter-spacing:.26px;line-height:normal;padding:2.5px}.resolution-custom[_ngcontent-%COMP%] .option-with-icon[_ngcontent-%COMP%] .arrow-img[_ngcontent-%COMP%] pi[_ngcontent-%COMP%]{color:#272b34}.resolution-custom[_ngcontent-%COMP%]:hover{background:#626adf1a}.custom-AI-modal[_ngcontent-%COMP%]{border:1px solid #E2E3E9;background:#626adf0d;height:52px}.custom-AI-modal[_ngcontent-%COMP%] .thumb-box[_ngcontent-%COMP%]{height:24px;width:24px;border-radius:6px;background:#626adf1a}.custom-AI-modal[_ngcontent-%COMP%] .thumb-box.new_item[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:24px!important;width:24px!important}.custom-AI-modal[_ngcontent-%COMP%] .thumb-box.new_item[_ngcontent-%COMP%]:after{display:none!important}.custom-AI-modal[_ngcontent-%COMP%] .coin-box[_ngcontent-%COMP%]{position:relative;border:0px;padding:0 6px 0 0;min-height:24px;min-width:42px}.custom-AI-modal[_ngcontent-%COMP%] .coin-box[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:0px;background:linear-gradient(90deg,#fc5cff -4%,#2520f6);-webkit-mask:linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%) content-box,linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%);-webkit-mask-composite:xor;mask-composite:exclude}.custom-AI-modal[_ngcontent-%COMP%]:hover{background:#626adf1a}.magic-btn[_ngcontent-%COMP%]{background:#9f42fb1a;padding:0 6.5px 0 4.5px;height:24px;line-height:normal}.magic-btn[_ngcontent-%COMP%]:hover, .magic-btn[_ngcontent-%COMP%]:focus{background:#9f42fb1a;outline:none}.magic-btn.magic-disable[_ngcontent-%COMP%]{background:#9f42fb0a;pointer-events:none;color:#d9d9d9!important}.magic-btn.magic-disable[_ngcontent-%COMP%]:hover, .magic-btn.magic-disable[_ngcontent-%COMP%]:focus{background:#9f42fb0a;outline:none}.magicprompt-overlay[_ngcontent-%COMP%]{background:#ffffffb3;left:0;top:0;z-index:99}.magicprompt-overlay[_ngcontent-%COMP%] .rotate-loader[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_rotation 1.5s infinite linear}@keyframes _ngcontent-%COMP%_rotation{0%{transform:rotate(0)}to{transform:rotate(359deg)}}.icon-rotate[_ngcontent-%COMP%] pi[_ngcontent-%COMP%]{transform:rotate(-90deg)}']}),l})();var lt=c(28567),xr=c(3781),Mr=c(94475);
1const Or=["canvasBackground"],yr=["drawCanvas"],wr=["cursorCanvas"],Er=["ngSelect"],Sr=["freehand-drawing-dialog",""],Tr=r=>({"active-state":r}),Dr=(r,l)=>({"active-state":r,"disabled-btn":l}),Ue=r=>({"disabled-btn":r});function kr(r,l){1&r&&(e.j41(0,"span",41),e.nrm(1,"pi",42),e.k0s())}function Rr(r,l){if(1&r&&(e.j41(0,"ng-option",35)(1,"div",36),e.nrm(2,"pi",37),e.j41(3,"span",38),e.EFF(4),e.k0s(),e.j41(5,"span",39),e.EFF(6),e.k0s(),e.j41(7,"span",39),e.EFF(8),e.k0s(),e.DNE(9,kr,2,0,"span",40),e.k0s()()),2&r){const o=l.$implicit,t=e.XpG();e.Y8G("value",o.Qtype),e.R7$(2),e.Y8G("name",o.icon),e.R7$(2),e.JRh(o.name),e.R7$(2),e.JRh(o.ratio),e.R7$(2),e.JRh(o.size),e.R7$(),e.Y8G("ngIf",o.ispro&&!(t.user&&t.user.subscribed&&t.user.creditPurchased))}}let Ur=(()=>{var r;class l{constructor(t,n,i,a,d,g,m){this.modalService=t,this.activeModal=n,this.authService=i,this.aiUploadImageService=a,this.zoomService=d,this.subsService=g,this.confirmDialogService=m,this.pencilModeActive=!0,this.eraserModeActive=!1,this.controlWeight=30,this.history=[],this.historyIndex=-1,this.brushType=2,this.resolutionItemsJsion=[{name:"Square",ratio:"1:1",w:512,h:512,size:"512 x 512",Qtype:4,ispro:!1,icon:"squareicon",orderBy:1},{name:"Square",ratio:"1:1",w:1024,h:1024,size:"1024 x 1024",Qtype:1,ispro:!1,icon:"squareicon",orderBy:2},{name:"Portrait",ratio:"3:4",w:768,h:1024,size:"768 x 1024",Qtype:2,ispro:!1,icon:"portraiticon3_4",orderBy:3},{name:"Landscape",ratio:"4:3",w:1024,h:768,size:"1024 x 768",Qtype:3,ispro:!1,icon:"landscapeicon4_3",orderBy:6},{name:"Portrait",ratio:"2:3",w:680,h:1024,size:"680 x 1024",Qtype:7,ispro:!1,icon:"portraiticon2_3",orderBy:4},{name:"Landscape",ratio:"3:2",w:1024,h:680,size:"1024 x 680",Qtype:8,ispro:!1,icon:"landscapeicon3_2",orderBy:7},{name:"Portrait",ratio:"9:16",w:576,h:1024,size:"576 x 1024",Qtype:9,ispro:!1,icon:"portraiticon9_16",orderBy:5},{name:"Landscape",ratio:"16:9",w:1024,h:576,size:"1024 x 576",Qtype:10,ispro:!1,icon:"landscapeicon16_9",orderBy:8}],this.resolutionItems=[],this.selectedResoluction=null,this.selectSizeVal=4,this.activeSubTool="image2image",this.screenWidth=window.innerWidth,this.screenHeight=window.innerHeight,this.isReset=!1,this.brushSliderValue=50,this.scaleFactor=1,this.previousValue=null,this.inProgress=!1,this.extraWidth=200,this.user=this.authService.currentUser(),this.loggedInObserver=this.authService.loggedIn.subscribe(b=>{this.user=this.authService.currentUser()})}ngOnDestroy(){this.loggedInObserver&&this.loggedInObserver.unsubscribe()}setBruceIcon(t,n,i=!1){if(t>0&&this.selectedResoluction){let a=this.brushSliderValue=t>5?t:5;a/=2;let b=a-2/this.zoomService.currentZoom;if(this.hoverCursor)if(this.hoverCursor.radius!==a){let O=this.getAbsTopAndLeft();this.hoverCursor.set({top:O.top,left:O.left}).canvas.renderAll();let E=this.hoverCursor._objects;if(b>0)for(let Y=0;Y<E.length;Y++){let q=E[Y];"circle"===q.type&&"white"===q.stroke&&(q.set({radius:a,strokeWidth:2/this.zoomService.currentZoom}),this.hoverCursor.radius=a),"circle"===q.type&&"black"===q.stroke&&q.set({radius:a-2/this.zoomService.currentZoom,strokeWidth:2/this.zoomService.currentZoom}),"text"===q.type&&q.set({fontSize:a}),this.hoverCursor.addWithUpdate()}}else this.removeCursor();this.addCursor(a)}else this.removeCursor(),this.fabricMainCanvas.hoverCursor="move"}addCursor(t){if(!this.hoverCursor&&t>0){let i="+";this.eraserModeActive&&(i="-"),this.fabricCursorCanvas.clear();let a=new F.fabric.Circle({radius:t,fill:"transparent",stroke:"white",strokeWidth:2/this.zoomService.currentZoom,originX:"center",originY:"center"}),d=t-2/this.zoomService.currentZoom,g=new F.fabric.Circle({radius:d>0?d:0,fill:"transparent",stroke:"black",strokeWidth:2/this.zoomService.currentZoom,originX:"center",originY:"center"}),m=1;t<20&&(m=.2);var n=new F.fabric.Text(i,{fontFamily:"sans-serif",fontSize:t,stroke:"white",textAlign:"center",originX:"center",originY:"center",left:0,top:0,strokeUniform:!0,strokeWidth:m});this.hoverCursor=new F.fabric.Group([a,g,n],{left:-100,top:-100,originX:"center",originY:"center",selectable:!1}),this.hoverCursor.radius=t,this.fabricCursorCanvas.add(this.hoverCurs
1or),this.fabricMainCanvas.hoverCursor="none",this.fabricMainCanvas.setCursor("none")}}removeCursor(){this.hoverCursor&&(this.fabricCursorCanvas.remove(this.hoverCursor),this.hoverCursor=null)}getAbsTopAndLeft(){let t=this.maskWrapperEl,n=50,i=50;return t&&(this.fabricMainCanvas.height>t.clientHeight?(n=(this.fabricMainCanvas.height-(this.fabricMainCanvas.height-t.clientHeight))/2,n+=t.scrollTop):n=this.fabricMainCanvas.height/2,this.fabricMainCanvas.width>t.clientWidth?(i=(this.fabricMainCanvas.width-(this.fabricMainCanvas.width-t.clientWidth))/2,i+=t.scrollLeft):i=this.fabricMainCanvas.width/2),{top:n/this.zoomService.currentZoom,left:i/this.zoomService.currentZoom}}configureFabricCanvas(){let t=this;this.fabricMainCanvas.on("mouse:down",n=>{t.onMouseDown(n)}),this.fabricMainCanvas.on("mouse:up",n=>{t.onMouseUp(n)}),this.fabricMainCanvas.on("mouse:move",n=>{t.onMouseMove(n)}),this.fabricMainCanvas.on("mouse:out",n=>{t.onMouseOut(n)})}unconfigureFabricCanvas(){this.fabricMainCanvas.off("mouse:down"),this.fabricMainCanvas.off("mouse:up"),this.fabricMainCanvas.off("mouse:move"),this.fabricMainCanvas.off("mouse:out")}onMouseMove(t){if(this.mouseDown){this.prevX=this.currX,this.prevY=this.currY;let n=this.getPoints(t);this.currX=n.x,this.currY=n.y}if(this.hoverCursor){let n=this.getPoints(t);this.hoverCursor.set({top:n.y,left:n.x}).setCoords(),this.hoverCursor&&this.hoverCursor.bringToFront(),this.fabricCursorCanvas.renderAll()}}onMouseUp(t){this.mouseDown=!1}onMouseDown(t){this.mouseDown=!0;let n=this.getPoints(t);this.currX=n.x,this.currY=n.y,this.prevX=this.currX,this.prevY=this.currY,this.hoverCursor&&this.hoverCursor.bringToFront()}onMouseOut(t){this.hoverCursor&&(this.hoverCursor.set({top:-100,left:-100}).setCoords(),this.fabricCursorCanvas.renderAll())}getPoints(t){let n,i,a;return a=this.scaleFactor,n=t.absolutePointer.x,i=t.absolutePointer.y,{x:n,y:i}}fitToNewCanvas(t,n){this.calcWrapperSize();const g=Math.min((this.screenWidth-.2*this.screenWidth)/t,(this.screenHeight-.2*this.screenHeight)/n);this.fabricMainCanvas.setWidth(t*g),this.fabricMainCanvas.setHeight(n*g),this.fabricMainCanvas.setZoom(g),g>1||this.hoverCursor&&this.fabricCursorCanvas.add(this.hoverCursor),this.fabricMainCanvas.renderAll(),this.zoomService.currentZoom=g,this.scaleFactor=g,this.syncCursorCanvas(t*g,n*g,g)}syncCursorCanvas(t,n,i){this.fabricCursorCanvas.setWidth(t),this.fabricCursorCanvas.setHeight(n),this.fabricCursorCanvas.setZoom(i)}onSizeChange(t,n=!1){if(this.user=this.authService.currentUser(),null==t&&(t=this.selectSizeVal??4),this.history.length>0&&!n)this.confirmDialogService.open({title:x.b.message.warningMessage,okButtonText:"Okay"},()=>{this.clearImage(),this.previousValue=t;let i=this.resolutionItems.find(a=>a.Qtype==t);this.selectedResoluction=i,this.fitToNewCanvas(i.w,i.h)},()=>{this.selectSizeVal=this.previousValue});else{this.previousValue=t,this.isReset&&this.clearImage();let i=this.resolutionItems.find(a=>a.Qtype==t);this.selectedResoluction=i,this.fitToNewCanvas(i.w,i.h)}}reloadOptions(){this.user=this.authService.currentUser();let t=this.resolutionItemsJsion.sort((n,i)=>n.orderBy-i.orderBy);this.resolutionItems=t}calculateMaxHeight(){return.9*this.screenHeight}ngOnInit(){this.screenHeight=window.innerHeight,this.reloadOptions(),window.addEventListener("resize",()=>{this.screenWidth=window.innerWidth,this.screenHeight=window.innerHeight,this.onSizeChange(this.selectSizeVal,!0)})}ngAfterViewInit(){this.controlWeight=this.controlWeight??30,this.selectSizeVal=this.selectSizeVal??4,this.history=this.history??[],this.historyIndex=this.historyIndex??this.history.length-1,this.fabricMainCanvas=new F.fabric.Canvas(this.mainCanvas.nativeElement,{freeDrawingCursor:"none",preserveObjectStacking:!0}),this.fabricCursorCanvas=new F.fabric.StaticCanvas(this.cursorCanvas.nativeElement),this.maskWrapperEl=this.canvasBackground.nativeElement,this.configureFabricCanvas(),this.onSizeChange(this.selectSizeVal,!0),this.pencilMode(),this.history.length>0&&(this.fabricMainCanvas.loadFromJSON(this.history[this.historyIndex],()=>this.fabricMainCanvas.renderAll()),setTimeout(()=>{this.setBruceIcon(this.controlWeight,this.brushType,this.selectedResoluction)},200)),this.fabricMainCanvas.on("path:created",t=>{this.saveHistory()})}
1calcWrapperSize(){const t=this.canvasBackground.nativeElement.getBoundingClientRect();return{width:t.width,height:t.height}}fitToScreen(){const t=this.calcWrapperSize();let n,i,a;this.selectedResoluction.h>t.height?(n=t.width-this.extraWidth,i=t.height-.05*this.selectedResoluction.h):(n=t.width,i=t.height),a=Math.min(i/this.selectedResoluction.h,n/this.selectedResoluction.w),a<1&&this.set(a,!0)}set(t,n=!0){const a=this.mainCanvas.nativeElement.parentElement,d=a.clientWidth*t,g=a.clientHeight*t;this.fabricMainCanvas.setZoom(t),n&&(this.fabricMainCanvas.setWidth(d),this.fabricMainCanvas.setHeight(g)),this.zoomService.currentZoom=t}copyCanvas(t){var n=document.createElement("canvas");return n.width=this.selectedResoluction.w,n.height=this.selectedResoluction.h,n.getContext("2d").drawImage(t,0,0),n}canvasToImageFile(t){const n=this.copyCanvas(t),i=new F.fabric.Canvas(n);i.setBackgroundColor("white",i.renderAll.bind(i)),this.fabricMainCanvas.getObjects().forEach(g=>{const m=F.fabric.util.object.clone(g);i.add(m)}),i.setZoom(1),i.setDimensions({width:this.selectedResoluction.w,height:this.selectedResoluction.h});const a=i.toDataURL({format:"jpg",quality:1}),d=this.dataURItoBlob(a);return new File([d],"image.jpg",{type:"image/jpg"})}dataURItoBlob(t){const n=atob(t.split(",")[1]),i=t.split(",")[0].split(":")[1].split(";")[0],a=new ArrayBuffer(n.length),d=new Uint8Array(a);for(let g=0;g<n.length;g++)d[g]=n.charCodeAt(g);return new Blob([d],{type:i})}resizeCanvasToClientSize(){const t=this.mainCanvas.nativeElement,n=t.parentElement;this.fabricMainCanvas.setWidth(n.clientWidth),this.fabricMainCanvas.setHeight(n.clientHeight),t.width=n.clientWidth,t.height=n.clientHeight,this.fabricMainCanvas.renderAll()}SvaeImage(){var t=this;return(0,le.A)(function*(){const n=t.canvasToImageFile(t.mainCanvas.nativeElement);t.aiUploadImageService.uploadImage(n,{tab:"aifilter"},a=>{a&&a.contentUrl&&t.activeModal.close({imgurl:a.contentUrl,Sketchhistory:t.history,SketchActiveIndex:t.historyIndex,canvassize:t.selectSizeVal,controlWeight:t.controlWeight,width:t.selectedResoluction.w,height:t.selectedResoluction.h})})})()}cencel(){this.configureFabricCanvas(),this.activeModal.close()}clearImage(){this.history=[],this.historyIndex=this.history.length-1,this.controlWeight=30,this.fabricMainCanvas.clear(),this.hoverCursor=null,this.brushType=2;let t=this.resolutionItems.find(n=>n.Qtype==this.selectSizeVal);this.selectedResoluction=t,this.selectedResoluction.width=this.mainCanvas.nativeElement.width&&this.mainCanvas.nativeElement.width>=512?this.mainCanvas.nativeElement.width:512,this.selectedResoluction.height=this.mainCanvas.nativeElement.height&&this.mainCanvas.nativeElement.height>=512?this.mainCanvas.nativeElement.height:512,this.setBruceIcon(this.controlWeight,this.brushType,this.selectedResoluction),this.pencilMode()}changeImage(){}saveHistory(){const t=this.fabricMainCanvas.toJSON();this.history.push(t),this.historyIndex=this.history.length-1}pencilMode(){this.eraserModeActive=!1,this.pencilModeActive=!0,this.fabricMainCanvas.isDrawingMode=!0,this.fabricMainCanvas.freeDrawingBrush=new F.fabric.PencilBrush(this.fabricMainCanvas),this.fabricMainCanvas.freeDrawingBrush.color="black",this.fabricMainCanvas.freeDrawingBrush.width=this.controlWeight,this.setBruceIcon(this.controlWeight,this.brushType,this.selectedResoluction)}eraserMode(){this.historyIndex>=0?(this.fabricMainCanvas.isDrawingMode=!0,this.fabricMainCanvas.freeDrawingBrush=new F.fabric.EraserBrush(this.fabricMainCanvas),this.fabricMainCanvas.freeDrawingBrush.width=this.controlWeight):(this.fabricMainCanvas.freeDrawingBrush=new F.fabric.PencilBrush(this.fabricMainCanvas),this.fabricMainCanvas.freeDrawingBrush.color="black",this.fabricMainCanvas.freeDrawingBrush.width=this.controlWeight,this.fabricMainCanvas.isDrawingMode=!1),this.pencilModeActive=!1,this.eraserModeActive=!0,this.brushType=3,this.setBruceIcon(this.controlWeight,this.brushType,this.selectedResoluction)}undo(){this.historyIndex>-1&&(this.historyIndex--,this.historyIndex>=0?this.fabricMainCanvas.loadFromJSON(this.history[this.historyIndex],()=>this.fabricMainCanvas.renderAll()):(this.fabricMainCanvas.clear(),this.pencilMode()))}redo(){this.historyIndex<this.history.length-1&&(this.historyIndex++,this.fabricMainCanvas.loadFromJSON(this.history[this.historyIndex],()=>this.fabricMainCanvas.renderAll()))}inputWeight(t,n){let i;i=t.newValue||0===t.newValue?t.newValue:t,this.controlWeight=i,this.brushSliderValue=i,this.selectedResoluction.width=this.mainCanvas.nativeElement.width&&this.mainCanvas.nativeElement.width>=512?this.mainCanvas.nativeElement.width:512,this.selectedResoluction.height=this.mainCanvas.nativeElement.height&&this.mainCanvas.nativeElement.height>=512?this.mainCanvas.nativeElement.height:512,this.setBruceIcon(this.controlWeight,this.brushType,this.selectedResoluction),n&&(this.fabricMainCanvas.freeDrawingBrush.width=this.controlWeight)}}return(r=l).\u0275fac=function(t){return new(t||r)(e.rXU(f.Bq),e.rXU(f.Lw),e.rXU(N.u),e.rXU(G.M),e.rXU(lt.n),e.rXU(se.n),e.rXU(I.g))},r.\u0275cmp=e.VBU({type:r,selectors:[["","freehand-drawing-dialog",""]],viewQuery:function(t,n){if(1&t&&(e.GBs(Or,7),e.GBs(yr,5),e.GBs(wr,5),e.GBs(Er,5)),2&t){let i;
1e.mGM(i=e.lsd())&&(n.canvasBackground=i.first),e.mGM(i=e.lsd())&&(n.mainCanvas=i.first),e.mGM(i=e.lsd())&&(n.cursorCanvas=i.first),e.mGM(i=e.lsd())&&(n.ngSelect=i.first)}},inputs:{controlWeight:"controlWeight",history:"history",historyIndex:"historyIndex",selectSizeVal:"selectSizeVal",isReset:"isReset"},features:[e.Jv_([{provide:lt.n,useClass:Mr.C},xr.X])],attrs:Sr,decls:38,vars:32,consts:[["ngSelect",""],["canvasBackground",""],["drawCanvas",""],["cursorCanvas",""],[1,"container-fluid","modal-inner-content","p-0"],[1,"d-flex","align-items-center","justify-content-end","pb-3","pt-3","pe-3","ps-3"],[1,"d-inline-flex","align-items-center","justify-content-center","draw-drop-selection"],["appendTo","body",1,"select-menu","resolution-drop","freehand",2,"width","-webkit-fill-available",3,"ngModelChange","change","ngModel","searchable","clearable"],[3,"value",4,"ngFor","ngForOf"],[1,"d-inline-flex","align-items-center","justify-content-center","undo-redo-all","ms-2"],[1,"d-inline-flex","align-items-center","justify-content-center","edit-erase"],["id","select","type","button",1,"btn-blank","hw-40","me-1",3,"click","ngClass"],["name","dooledraw"],["id","erase","type","button",1,"btn-blank","hw-40",3,"click","ngClass"],["name","dooleerase"],[1,"d-inline-flex","align-items-center","justify-content-between","ms-3",2,"min-width","268px"],[1,"col-sm-9","p-0"],[1,"opacity-slider",2,"width","100%",3,"change","slideStop","value","min","max","step"],[1,"col-sm-2","p-0"],["type","text","numberSettings","","maxlength","3","mask","separator.2","separatorLimit","100",1,"form-control","form-input-sm","text-normal","text-black","float-end",3,"ngModelChange","min","max","ngModel"],[1,"d-inline-flex","undo-redo-btn","ms-2"],["id","undo","type","button",1,"btn-blank","hw-40","me-2",3,"click","ngClass"],["name","undo",1,"f-24"],[1,"btn-blank","hw-40","me-2",3,"click","ngClass"],["name","redo",1,"f-24"],[1,"btn-blank","w-auto","clear-all","text-semi",3,"click","ngClass"],["name","deleteoth",1,"f-24","me-2"],[1,"d-inline-flex","align-items-center","justify-content-center","ml-14"],[1,"btn","btn-editor-primary","text-13","btn-h40","me-2","w-auto",3,"click"],[1,"btn","btn-primary","text-13","btn-h40",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center","canvas-section-area"],[1,"d-flex","align-items-center","justify-content-center","w-auto","h-100"],[1,"canvas-inner-area","border-radius-12"],[1,"drawCanvas",3,"change"],[1,"drawCanvas","position-absolute",2,"pointer-events","none","top","0rem","left","0rem"],[3,"value"],[1,"option-with-icon"],[1,"right-sign","f-24","me-2","grey-600",3,"name"],[1,"d-inline-flex","f-13","text-semi","me-1","item-name"],[1,"d-inline-flex","me-1","item-ratio"],["class","icon","style","margin-left: auto;",4,"ngIf"],[1,"icon",2,"margin-left","auto"],["name","proicon"]],template:function(t,n){if(1&t){const i=e.RV6();e.j41(0,"div",4)(1,"div",5)(2,"div",6)(3,"ng-select",7,0),e.mxI("ngModelChange",function(d){return e.eBV(i),e.DH7(n.selectSizeVal,d)||(n.selectSizeVal=d),e.Njj(d)}),e.bIt("change",function(d){return e.eBV(i),e.Njj(n.onSizeChange(d))}),e.DNE(5,Rr,10,6,"ng-option",8),e.k0s()(),e.j41(6,"div",9)(7,"div",10)(8,"button",11),e.bIt("click",function(){return e.eBV(i),n.pencilMode(),n.eraserModeActive=!1,n.pencilModeActive=!0,e.Njj(n.brushType=2)}),e.nrm(9,"pi",12),e.k0s(),e.j41(10,"button",13),e.bIt("click",function(){return e.eBV(i),e.Njj(n.eraserMode())}),e.nrm(11,"pi",14),e.k0s()(),e.j41(12,"div",15)(13,"div",16)(14,"mv-slider",17),e.bIt("change",function(d){return e.eBV(i),e.Njj(n.inputWeight(d,!1))})("slideStop",function(d){return e.eBV(i),e.Njj(n.inputWeight(d,!0))}),e.k0s()(),e.j41(15,"div",18)(16,"input",19),e.bIt("ngModelChange",function(d){return e.eBV(i),e.Njj(n.inputWeight(d,!0))}),e.k0s()()(),e.j41(17,"div",20)(18,"button",21),e.bIt("click",function(){return e.eBV(i),e.Njj(n.undo())}),e.nrm(19,"pi",22),e.k0s(),e.j41(20,"button",23),e.bIt("click",function(){return e.eBV(i),e.Njj(n.redo())}),e.nrm(21,"pi",24),e.k0s(),e.j41(22,"button",25),e.bIt("click",function(){return e.eBV(i),n.clearImage(),n.pe
1ncilModeActive=!0,e.Njj(n.eraserModeActive=!1)}),e.nrm(23,"pi",26),e.EFF(24,"Clear all "),e.k0s()()(),e.j41(25,"div",27)(26,"button",28),e.bIt("click",function(){return e.eBV(i),e.Njj(n.cencel())}),e.EFF(27,"Cancel"),e.k0s(),e.j41(28,"button",29),e.bIt("click",function(){return e.eBV(i),e.Njj(n.SvaeImage())}),e.EFF(29,"Done"),e.k0s()()(),e.j41(30,"div",30,1)(32,"div",31)(33,"div",32)(34,"canvas",33,2),e.bIt("change",function(){return e.eBV(i),e.Njj(n.changeImage())}),e.k0s(),e.nrm(36,"canvas",34,3),e.k0s()()()()}2&t&&(e.R7$(3),e.R50("ngModel",n.selectSizeVal),e.Y8G("searchable",!1)("clearable",!1),e.R7$(2),e.Y8G("ngForOf",n.resolutionItems),e.R7$(3),e.Y8G("ngClass",e.eq3(19,Tr,n.pencilModeActive)),e.R7$(2),e.Y8G("ngClass",e.l_i(21,Dr,n.eraserModeActive&&n.historyIndex>=0,n.historyIndex<0)),e.R7$(4),e.Y8G("value",n.controlWeight)("min",1)("max",100)("step",2),e.R7$(2),e.Y8G("min",0)("max",100)("ngModel",n.controlWeight),e.R7$(2),e.Y8G("ngClass",e.eq3(24,Ue,n.historyIndex<0)),e.R7$(2),e.Y8G("ngClass",e.eq3(26,Ue,n.history.length-1<=n.historyIndex)),e.R7$(2),e.Y8G("ngClass",e.eq3(28,Ue,n.history.length<=0)),e.R7$(6),e.Y8G("ngClass",e.eq3(30,Ue,n.history.length<=0||-1==n.historyIndex)),e.R7$(2),e.xc7("max-height",n.calculateMaxHeight(),"px"))},dependencies:[s.YU,s.Sq,s.bT,Oe.I,u.me,u.BC,u.tU,u.vS,L.b,X.vr,X.xt,Ce.d1],styles:[".canvas[_ngcontent-%COMP%]{width:100%;height:100%}.canvas-section-area[_ngcontent-%COMP%]{padding:0 175px}.canvas-section-area[_ngcontent-%COMP%] .canvas-inner-area[_ngcontent-%COMP%]{background:#fff url(https://static.lightxeditor.com/assets/images/drawbox.png) repeat;box-shadow:4px 0 24px #0000001a;position:relative;max-height:calc(100% - 100px);overflow:hidden}.disabled-btn[_ngcontent-%COMP%]{opacity:.3;pointer-events:none}.disabled-btn[_ngcontent-%COMP%] pi[_ngcontent-%COMP%]{color:#b0b3bf!important}"],data:{animation:[]}}),l})();var Ar=c(18545);const Br=["promptAnimation"],Gr=(r,l,o)=>({"info-up":r,"info-blue":l,"info-red":o}),dt=r=>({"add-on-404":r});function jr(r,l){1&r&&(e.j41(0,"div",25),e.EFF(1," Drop image here "),e.k0s())}function Fr(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",17)(1,"div",18),e.bIt("click",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.openFreehandDrawing(!0))}),e.nrm(2,"pi",19),e.j41(3,"span",20),e.EFF(4,"Draw"),e.k0s()(),e.j41(5,"div",21),e.bIt("click",function(){e.eBV(o);const n=e.sdS(11),i=e.XpG();return e.Njj(i.replaceImage(n))})("dragover",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.onDropZoneDragOver(n))})("dragleave",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.onDropZoneDragLeave(n))})("drop",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.onDropZoneDrop(n))}),e.DNE(6,jr,2,0,"div",22),e.nrm(7,"pi",23),e.j41(8,"span",20),e.EFF(9,"Upload"),e.k0s(),e.j41(10,"input",24,1),e.bIt("change",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.onFileUploaded(n.srcElement.files))})("click",function(){e.eBV(o);const n=e.sdS(11);return e.Njj(n.value="")}),e.k0s()()()}if(2&r){const o=e.XpG();e.R7$(6),e.Y8G("ngIf",o.isDragActive),e.R7$(4),e.Y8G("accept",o.aiUploadImageService.fileImageAccept)}}function Nr(r,l){1&r&&(e.j41(0,"div",25),e.EFF(1," Drop image here "),e.k0s())}function Lr(r,l){if(1&r&&(e.nrm(0,"img",30),e.nI1(1,"safe")),2&r){const o=e.XpG(2);e.Y8G("src",e.i5U(1,1,o.originalImageUrl,"url"),e.B4B)}}function Wr(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",31)(1,"button",32),e.bIt("click",function(){e.eBV(o);const n=e.XpG(2);return e.Njj(n.openFreehandDrawing(!1))}),e.EFF(2,"Refine"),e.k0s(),e.j41(3,"button",33),e.bIt("click",function(){e.eBV(o);const n=e.sdS(6),i=e.XpG(2);return e.Njj(i.replaceImage(n))}),e.EFF(4,"Upload"),e.k0s(),e.j41(5,"input",24,1),e.bIt("change",function(n){e.eBV(o);const i=e.XpG(2);return e.Njj(i.onFileUploaded(n.srcElement.files))})("click",function(){e.eBV(o);const n=e.sdS(6);return e.Njj(n.value="")}),e.k0s()()}if(2&r){const o=e.XpG(2);e.Y8G("ngClass",e.eq3(2,dt,!o.originalImageUrl)),e.R7$(5),e.Y8G("accept",o.aiUploadImageService.fileImageAccept)}}function Vr(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",31)(1,"button",32),e.bIt("click",function(){e.eBV(o);const n=e.sdS(4),i=e.XpG(2);return e.Njj(i.replaceImage(n))}),e.EFF(2,"Replace"),e.k0s(),e.j41(3,"input",24,1),e.bIt("change",function(n){e.eBV(o);const i=e.XpG(2);return e.Njj(i.onFileUploaded(n.srcElement.files))})("click",function(){e.eBV(o);const n=e.sdS(4);return e.Njj(n.value="")}
1),e.k0s(),e.j41(5,"button",33),e.bIt("click",function(){e.eBV(o);const n=e.XpG(2);return e.Njj(n.openFreehandDrawing())}),e.EFF(6,"Draw"),e.k0s()()}if(2&r){const o=e.XpG(2);e.Y8G("ngClass",e.eq3(2,dt,!o.originalImageUrl)),e.R7$(3),e.Y8G("accept",o.aiUploadImageService.fileImageAccept)}}function Xr(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",26)(1,"div",27),e.bIt("dragover",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.onDropZoneDragOver(n))})("dragleave",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.onDropZoneDragLeave(n))})("drop",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.onDropZoneDrop(n))}),e.DNE(2,Nr,2,0,"div",22)(3,Lr,2,4,"img",28)(4,Wr,7,4,"div",29)(5,Vr,7,4,"div",29),e.k0s()()}if(2&r){const o=e.XpG();e.R7$(2),e.Y8G("ngIf",o.isDragActive),e.R7$(),e.Y8G("ngIf",o.originalImageUrl),e.R7$(),e.Y8G("ngIf",o.aiPhotoService.isSketch),e.R7$(),e.Y8G("ngIf",!o.aiPhotoService.isSketch&&!o.isDragActive)}}function Kr(r,l){if(1&r&&(e.j41(0,"span",34),e.EFF(1),e.k0s()),2&r){const o=e.XpG();e.R7$(),e.Lme("",o.aiPhotoService.textPrompt.length,"/",o.maxLenght,"")}}function $r(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",35)(1,"div",36)(2,"buttons-scroll-menu",37),e.bIt("selectLayout",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.selectPrompt(n))}),e.k0s()()()}if(2&r){const o=e.XpG();e.R7$(2),e.Y8G("items",o.prompts)("type","prompt")}}let Yr=(()=>{var r;class l{constructor(t,n,i,a,d,g,m){var b=this;this.mediaContentService=t,this.authService=n,this.createPopupService=i,this.aiUploadImageService=a,this.aiPhotoService=d,this.paymentService=g,this.modalService=m,this.btnText="Generate",this.disabled=!1,this.placeHolder="Imagine anything, type it",this.isFocused=!1,this.quality=1,this.isNgPrompt=!1,this.isNgPromptFocus=!1,this.prompts=[],this.originalImageUrl="",this.isDragActive=!1,this.toolName=h.Fs.SketchToImage,this.maxLenght=2e3,this.user=this.authService.currentUser(),this.loggedInObserver=this.authService.loggedIn.subscribe(O=>{this.user=this.authService.currentUser()}),this.usrPropChangedObserver=this.authService.usrPropChanged.subscribe(O=>{this.user=this.authService.currentUser()}),this.configSubs=this.paymentService.configUpdated.subscribe(()=>{const O=this.paymentService?.config;this.quality=O?.creditInfo?.image2image_gpt?O.creditInfo?.image2image_gpt:2}),this.aiPhotoService.uploadImageFn=function(){var O=(0,le.A)(function*(E){E?.imgUrl&&(b.originalImageUrl=E?.imgUrl,b.aiPhotoService.isSketch=!1)});return function(E){return O.apply(this,arguments)}}()}ngOnInit(){this.aiPhotoService.textPrompt="",this.aiPhotoService.deleteQueryParams(),this.aiPhotoService.sketchImgUrl&&this.aiPhotoService.isSketch?this.originalImageUrl=this.aiPhotoService.sketchImgUrl:this.aiPhotoService.imgUrl&&!this.aiPhotoService.isSketch&&(this.originalImageUrl=this.aiPhotoService.imgUrl),this.changePrompt(),this.getPrompts()}getPrompts(){this.mediaContentService.getPrompts(A.Jl.SketchToImage,t=>{t&&(this.prompts=t.prompts)},t=>{})}generate(){if(!this.aiPhotoService.inProgress&&this.promptAnimation)if(this.user&&this.user.remainingCoins>=this.quality){const t={featureType:h.Fs.ImageToImage,textPrompt:this.aiPhotoService.textPrompt,imageUrl:this.originalImageUrl,toolName:h.Fs.SketchToImage,subFeatureType:"gpt"};this.aiPhotoService.startGenerationProgress({featureType:h.Fs.SketchToImage}),this.aiPhotoService.generateImage(t,n=>{n&&n.assetId?(n.featureType=h.Fs.SketchToImage,n.toolName=x.b.label.sketch2Image,this.aiPhotoService.checkStatus(n,0,a=>{a&&a.urls&&a.urls.length>0?(this.user.remainingCoins=a.remainingCalls,this.aiPhotoService.isDirty=!0):this.aiPhotoService.clearGenerationProgress()},a=>{this.displayErrorMsg(a)})):this.displayErrorMsg(n)},n=>{this.displayErrorMsg(n)})}else this.aiPhotoService.openAICreditPopup(()=>{this.user=this.authService.currentUser(),this.generate()},this.quality)}displayErrorMsg(t=null){this.aiPhotoService.clearGenerationProgress();let n=t?.description;this.createPopupService.openWarningDialog("Error",n)}ngOnDestroy(){this.aiPhotoService.textPrompt="",this.configSubs&&this.configSubs.unsubscribe(),this.loggedInObserver&&this.loggedInObserver.unsubscribe(),this.usrPropChangedObserver&&this.usrPropChangedObserver.unsubscribe()}changePrompt(t){"string"==typeof t&&(this.aiPhotoService.textPrompt=t),this.disabled=!(this.aiPhotoService.textPrompt&&this.aiPhotoService.textPrompt.trim().length>1&&this.originalImageUrl)}
1onFocusOut(t){this.isFocused=t}toggleButton(t){this.isNgPrompt=t}selectPrompt(t){this.aiPhotoService.textPrompt=t&&t.prompt?t.prompt.replace("....","").replace("...","").replace("..","").replace("\u2026",""):"",this.changePrompt(this.aiPhotoService.textPrompt),this.promptAnimation?.textarea?.nativeElement?.focus()}openFreehandDrawing(t=!1){let n=this.openDrawing();n.componentInstance.history=this.aiPhotoService.Sketchhistory,n.componentInstance.historyIndex=this.aiPhotoService.SketchActiveIndex,n.componentInstance.selectSizeVal=this.aiPhotoService.selectedCanvasSize,n.componentInstance.controlWeight=this.aiPhotoService.selectedCanvasBruceSize,n.componentInstance.isReset=t,n.result.then(i=>{i&&(this.aiPhotoService.Sketchhistory=i.Sketchhistory,this.aiPhotoService.SketchActiveIndex=i.SketchActiveIndex,this.aiPhotoService.sketchImgUrl=i.imgurl,this.originalImageUrl=i.imgurl,this.aiPhotoService.selectedCanvasSize=i.canvassize,this.aiPhotoService.selectedCanvasBruceSize=i.controlWeight,this.aiPhotoService.isSketch=!0,this.disabled=!1,this.changePrompt())})}onFileUploaded(t){t&&(this.aiPhotoService.inProgress=!1,this.aiUploadImageService.aiUploadImage(t[0],{fromEditor:"header",toolName:h.Fs.SketchToImage,from:this.aiPhotoService.queryParams.from}).then(a=>{this.aiPhotoService.isRefined=!1,"cancel"==a?this.aiPhotoService.sketchImgUrl=null:(this.originalImageUrl=a?.imgUrl,this.aiPhotoService.originalImgUrl=a?.imgUrl,this.aiPhotoService.imgUrl=a?.imgUrl,this.aiPhotoService.isSketch=!1)}))}replaceImage(t){this.aiPhotoService.inProgress||t.click()}onDropZoneDragOver(t){!this.isFileDrag(t)||this.aiPhotoService.inProgress||(t.preventDefault(),t.stopPropagation(),t.dataTransfer.dropEffect="copy",this.isDragActive=!0)}onDropZoneDragLeave(t){const i=t.relatedTarget;i&&t.currentTarget.contains(i)||(this.isDragActive=!1)}onDropZoneDrop(t){if(!this.isFileDrag(t))return;t.preventDefault(),t.stopPropagation(),this.isDragActive=!1;const n=t.dataTransfer?.files;n?.length&&this.onFileUploaded(n)}isFileDrag(t){const n=t.dataTransfer?.types;return!!n&&Array.from(n).includes("Files")}openDrawing(){return this.modalService.open(Ur,{centered:!0,windowClass:"sketch-window",fullscreen:!0,backdrop:!1,keyboard:!1})}}return(r=l).\u0275fac=function(t){return new(t||r)(e.rXU(te.Z),e.rXU(N.u),e.rXU(Q.A),e.rXU(G.M),e.rXU(U.s),e.rXU(K.W),e.rXU(f.Bq))},r.\u0275cmp=e.VBU({type:r,selectors:[["sketch-to-image"]],viewQuery:function(t,n){if(1&t&&e.GBs(Br,5),2&t){let i;e.mGM(i=e.lsd())&&(n.promptAnimation=i.first)}},inputs:{toolName:"toolName"},decls:17,vars:15,consts:[["promptAnimation",""],["file",""],[1,"pane-section"],[1,"scroll-content","drawer-elements","ai-drawer-elements"],[1,"common-container","m-0","p-0","pb-8"],[1,"pb-3"],["class","d-flex align-items-center justify-content-center w-100 draw-upload border-radius-12",4,"ngIf"],["class","d-flex w-100 flex-column",4,"ngIf"],[1,"card","ps-3","pe-3","pt-2","pb-3","border-0"],[1,"d-flex","w-100","flex-column","prompt-view"],[1,"d-flex","align-items-center","w-100","h-32","mb-1"],[1,"text-normal","text-dark","text-semi","lh-125"],[1,"textarea-col","position-relative",3,"ngClass"],[1,"text-animation",3,"changePrompt","focusOut","maxLength","prompts","textPrompt"],["class","prompt-info text-regular position-absolute d-flex align-items-center justify-content-start",4,"ngIf"],["class","d-flex document-color mt-2",4,"ngIf"],[3,"btnClick","disabled","btnText","credit"],[1,"d-flex","align-items-center","justify-content-center","w-100","draw-upload","border-radius-12"],[1,"d-inline-flex","draw-column","draw","align-items-center","justify-content-center",3,"click"],["name","draw",1,"me-1"],[1,"text-semi","text-13"],[1,"d-inline-flex","draw-column","upload","align-items-center","justify-content-center","position-relative",3,"click","dragover","dragleave","drop"],["class","drag-active text-semi d-flex flex-column align-items-center justify-content-center w-100 h-100 position-absolute",4,"ngIf"],["name","uploadimage",1,"me-1"],["id","fileInputId","name","fileInputId","type","file",1,"custom-file-input","d-none",3,"change","click","accept"],[1,"drag-active","text-semi","d-flex","flex-column","align-items-center","justify-content-center","w-100","h-100","position-absolute"],[1,"d-flex","w-100","flex-column"],[1,"ai-thumb-view","d-flex","align-items-center","justify-content-center","w-100","position-relative",3,"dragover","dragleave","drop"],[3,"src",4,"ngIf"],["class","replace-btn",3,"ngClass",4,"ngIf"],[3,"src"],[1,"replace-btn",3,"ngClass"],[1,"btn","btn-white","text-13","btn-h40",3,"click"],[1,"btn","btn-white","text-13","btn-h40","mt-2",3,"click"],[1,"prompt-info","text-regular","position-absolute","d-flex","align-items-center","justify-content-start"],[1,"d-flex","document-color","mt-2"],[1,"colors-bg","sticker-buttons-scroll"],[3,"selectLayout","items","type"]],template:function(t,n){if(1&t){const i=e.RV6();e.j41(0,"div",2)(1,"div",3)(2,"div",4)(3,"div",5),e.DNE(4,Fr,12,2,"div",6)(5,Xr,6,4,"div",7),e.k0s(),e.j41(6,"div",8)(7,"div",9)(8,"div",10)(9,"span",11),e.EFF(10,"Enter Prompt "),e.k0s()(),e.j41(11,"div",12)(12,"text-prompt-animation",13,0),e.bIt("changePrompt",function(d){return e.eBV(i),e.Njj(n.changePrompt(d))})("focusOut",function(d){return e.eBV(i),e.Njj(n.onFocusOut(d))}),e.k0s(),e.DNE(14,Kr,2,2,"span",14),e.k0s(),e.DNE(15,$r,3,2,"div",15),e.k0s()()()()(),e.j41(16,"generate-button",16),e.bIt("btnClick",function(){return e.eBV(i),e.Njj(n.generate())}),e.k0s()}2&t&&(e.R7$(4),e.Y8G("ngIf",!n.originalImageUrl),e.R7$(),e.Y8G("ngIf",n.originalImageUrl),e.R7$(6),e.Y8G("ngClass",e.sMw(11,Gr,n.aiPhotoService.textPrompt.length,n.isFocused,n.aiPhotoService.textPrompt.length==n.maxLenght)),e.R7$(),e.Y8G("maxLength",
1n.maxLenght)("prompts",n.prompts)("textPrompt",n.aiPhotoService.textPrompt),e.R7$(2),e.Y8G("ngIf",n.aiPhotoService.textPrompt.length),e.R7$(),e.Y8G("ngIf",n.prompts.length),e.R7$(),e.Y8G("disabled",n.disabled)("btnText",n.btnText)("credit",n.quality))},dependencies:[s.YU,s.bT,L.b,oe.t,Pe.B,ce,Ar.m],styles:['.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]{width:100%;height:110px;border-radius:12px;background:linear-gradient(90deg,#fc5cff05 -4%,#2520f605);padding:.9px 4px 4px}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#c9cad4 -4% 100%);-webkit-mask:linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%) content-box,linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%);-webkit-mask-composite:xor;mask-composite:exclude;z-index:1}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]:hover:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#606576 -4% 100%);-webkit-mask:linear-gradient(90deg,#606576 -4%,#606576 100%) content-box,linear-gradient(90deg,#606576 -4%,#606576 100%);-webkit-mask-composite:xor;mask-composite:exclude;z-index:1}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{resize:none;outline:none;width:100%;height:82px;padding:8px 8px 0;font-size:12px;color:#b0b3bf;border:0px;background:transparent;line-height:18px;position:relative;z-index:2}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar{width:4px;height:4px;border-radius:12px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#e3e3e3;border-radius:12px;margin-top:8px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#9a9a9a;border-radius:12px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:#555}.prompt-view[_ngcontent-%COMP%] .prompt-info[_ngcontent-%COMP%]{font-size:11px;color:#959aa7;margin-top:0;padding-left:8px;height:24px;line-height:normal;width:calc(100% - 8px);bottom:4px;z-index:99}.prompt-view[_ngcontent-%COMP%] .lampicon[_ngcontent-%COMP%]{border-radius:8px}.prompt-view[_ngcontent-%COMP%] .lampicon[_ngcontent-%COMP%]:hover{background:#626adf0d}.info-up[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#c9cad4 -4% 100%)!important;-webkit-mask:linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%) content-box,linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-blue[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff0d -4%,#2520f60d)!important}.info-blue[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#fc5cff -4%,#2520f6)!important;-webkit-mask:linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%) content-box,linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-blue[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#626adf!important}.info-red[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff0d -4%,#2520f60d)!important}.info-red[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#f25555 -4% 100%)!important;-webkit-mask:linear-gradient(90deg,#F25555 -4%,#F25555 100%) content-box,linear-gradient(90deg,#F25555 -4%,#F25555 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-red[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#f25555!important}.prompt-text[_ngcontent-%COMP%]{color:#272b34!important}.draw-upload[_ngcontent-%COMP%]{background:#eeedf3;height:134px;color:#606576}.draw-upload[_ngcontent-%COMP%]:hover{color:#e2e3e9}.draw-upload[_ngcontent-%COMP%] .draw-column[_ngcontent-%COMP%]{width:50%;height:134px;
1cursor:pointer}.draw-upload[_ngcontent-%COMP%] .draw[_ngcontent-%COMP%]:hover{border-radius:12px 0 0 12px;background:linear-gradient(270deg,#626adf1a,#626adf00);color:#606576}.draw-upload[_ngcontent-%COMP%] .upload[_ngcontent-%COMP%]{overflow:hidden}.draw-upload[_ngcontent-%COMP%] .upload[_ngcontent-%COMP%] .drag-active[_ngcontent-%COMP%]{border-radius:0 12px 12px 0;border:1px solid #626ADF;background:#626adf1a;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);-webkit-text-stroke:1px #FFFFFF;paint-order:stroke fill;z-index:10}.draw-upload[_ngcontent-%COMP%] .upload[_ngcontent-%COMP%]:hover{border-radius:0 12px 12px 0;background:linear-gradient(270deg,#626adf00,#626adf1a);color:#606576}.ai-thumb-view[_ngcontent-%COMP%]{border-radius:12px;background:#eeedf3;height:134px;position:relative;overflow:hidden;-webkit-user-select:none;user-select:none}.ai-thumb-view[_ngcontent-%COMP%] .drag-active[_ngcontent-%COMP%]{border-radius:12px;border:1px solid #626ADF;background:#626adf1a;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);-webkit-text-stroke:1px #FFFFFF;paint-order:stroke fill;z-index:10}.ai-thumb-view[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:100%;width:auto;object-fit:contain;overflow:hidden}.ai-thumb-view[_ngcontent-%COMP%]:hover .replace-btn[_ngcontent-%COMP%]{display:flex;z-index:99;position:absolute;background:#0006;align-items:center;justify-content:center;height:100%;width:100%;border-radius:12px;flex-direction:column}.ai-thumb-view[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%]{display:none}.ai-thumb-view[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{background:#fff!important;border:0px!important;color:#272b34!important;min-width:124px}.ai-thumb-view[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{background:linear-gradient(0deg,#626adf0d 0% 100%),#fff!important;color:#272b34}.ai-thumb-view[_ngcontent-%COMP%] .add-on-404[_ngcontent-%COMP%]{display:flex;z-index:99;position:absolute;background:#0000001a;align-items:center;justify-content:center;height:100%;width:100%;border-radius:12px;flex-direction:column}']}),l})();var zr=c(40605);const qr=["promptAnimation"],Hr=["ngSelect"],Jr=(r,l,o)=>({"info-up":r,"info-blue":l,"info-red":o});function Qr(r,l){if(1&r&&(e.j41(0,"span",17),e.EFF(1),e.k0s()),2&r){const o=e.XpG();e.R7$(),e.Lme("",o.aiPhotoService.textPrompt.length,"/",o.maxLenght,"")}}function Zr(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",18)(1,"div",19)(2,"buttons-scroll-menu",20),e.bIt("selectLayout",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.selectPrompt(n))}),e.k0s()()()}if(2&r){const o=e.XpG();e.R7$(2),e.Y8G("items",o.prompts)("type","prompt")}}let es=(()=>{var r;class l{constructor(t,n,i,a,d,g,m){this.mediaContentService=t,this.toast=n,this.renderer=i,this.aiPhotoService=a,this.authService=d,this.createPopupService=g,this.route=m,this.isLoaded=!0,this.selectedModel=null,this.btnText="Generate",this.disabled=!1,this.placeHolder="Imagine anything, type it",this.isFocused=!1,this.quality=1,this.prompts=[],this.toolName=h.Fs.ImageToImage,this.selectedSize=null,this.resolutions=[],this.credit=1,this.maxLenght=2e3,this.user=this.authService.currentUser(),this.loggedInObserver=this.authService.loggedIn.subscribe(b=>{this.user=this.authService.currentUser()}),this.updateBehaviorUserAiConis=this.authService.updateBehaviorUserAiConis.subscribe(b=>{this.user=this.authService.currentUser()}),this.usrPropChangedObserver=this.authService.usrPropChanged.subscribe(b=>{this.user=this.authService.currentUser(),b&&this.authService.updateUserAiConis(()=>{})}),this.usrAICreditChanged=this.authService.usrAICreditChanged.subscribe(b=>{this.user=this.authService.currentUser(),b&&this.authService.updateUserAiConis(()=>{})}),this.imageUploadChnage=this.aiPhotoService.imageUpload.subscribe(b=>{b&&this.changePrompt()})}ngOnInit(){this.getPrompts(),this.aiPhotoService.queryParams?.tp&&(this.aiPhotoService.textPrompt=(this.aiPhotoService.queryParams?.tp).substring(0,this.maxLenght),this.aiPhotoService.deleteQueryParams(),(0,R._)((0,zr.Y)(500)).then(()=>{this.promptAnimation?.textarea?.nativeElement?.focus()})),this.changePrompt()}generate(){if(!this.aiPhotoService.isCancel||this.aiPhotoService.imgUrl){if(!this.aiPhotoService.inProgress)if(this.aiPhotoService.imgUrl)if(this.user&&this.user.remainingCoins>=this.credit){const t={imageUrl:this.aiPhotoService.imgUrl,featureType:h.Fs.ImageToImage,textPrompt:this.aiPhotoService.textPrompt,...this.aiPhotoService.getImageModelOptions(this.selectedModel,this.selectedSize.qType)};this.aiPhotoService.startGenerationProgress({featureType:h.Fs.ImageToImage}),this.btnText=this.aiPhotoService.changeBtnText({}),this.aiPhotoService.generateImage(t,n=>{n&&n.assetId?(n.featureType=h.Fs.ImageToImage,n.toolName=x.b.label.text2Image,this.aiPhotoService.checkStatus(n,0,a=>{a&&a.urls&&a.urls.length>0?(this.user.remainingCoins=a.remainingCalls,this.aiPhotoService.isDirty=!0):this.aiPhotoService.clearGenerationProgress(),this.btnText=this.aiPhotoService.changeBtnText({})},a=>{this.displayErrorMsg(a)})):this.displayErrorMsg(n)},n=>{this.displayErrorMsg(n)})}else this.aiPhotoService.openAICreditPopup(()=>{this.user=this.authService.currentUser(),this.generate()},this.credit);else this.aiPhotoService.inProgress=!0,this.btnText=this.aiPhotoService.changeBtnText({}),this.aiPhotoService.updateImageUrl(this.aiPhotoService.originalImgUrl,h.Fs.TextToImage,"image").then(t=>
1{this.aiPhotoService.queryParams=this.route.snapshot.queryParams,this.aiPhotoService.imgUrl=t.imgUrl,this.generate()}).catch(()=>{this.aiPhotoService.inProgress=!1,this.btnText=this.aiPhotoService.changeBtnText({}),this.toast.showErrorSingle(x.b.message.uploadNewImage)})}else this.toast.showErrorSingle(x.b.message.uploadNewImage)}displayErrorMsg(t=null){this.aiPhotoService.clearGenerationProgress();let n=t?.description;this.createPopupService.openWarningDialog("Error",n),this.btnText=this.aiPhotoService.changeBtnText({})}ngOnDestroy(){this.aiPhotoService.textPrompt="",this.loggedInObserver&&this.loggedInObserver.unsubscribe(),this.usrPropChangedObserver&&this.usrPropChangedObserver.unsubscribe(),this.usrAICreditChanged&&this.usrAICreditChanged.unsubscribe(),this.updateBehaviorUserAiConis&&this.updateBehaviorUserAiConis.unsubscribe(),this.imageUploadChnage&&this.imageUploadChnage.unsubscribe()}changePrompt(t){"string"==typeof t&&(this.aiPhotoService.textPrompt=t),this.disabled=!(this.aiPhotoService.textPrompt&&this.aiPhotoService.textPrompt.trim().length>1&&this.aiPhotoService.imgUrl)}onFocusOut(t){this.isFocused=t}selectPrompt(t){this.aiPhotoService.textPrompt=t&&t.prompt?t.prompt.replace("....","").replace("...","").replace("..","").replace("\u2026",""):"",this.changePrompt(this.aiPhotoService.textPrompt),this.btnText=this.aiPhotoService.changeBtnText({}),this.promptAnimation?.textarea?.nativeElement?.focus()}onDropdownOpen(){this.renderer.addClass(document.body,"drop-open")}onDropdownClose(){this.renderer.removeClass(document.body,"drop-open")}getPrompts(){this.mediaContentService.getPrompts(A.Jl.ImageToImage,t=>{t&&(this.prompts=t.prompts)},t=>{})}onModelChange(t){this.updateModelSelection(t)}onModelButtonChange(t){this.updateModelSelection(t)}updateModelSelection(t){t&&(this.selectedModel=t,this.resolutions=t?.raw?.aspectRatios,this.selectedSize=this.resolutions[0],this.onResolutionClick(this.selectedSize))}onResolutionClick(t){this.selectedSize=t,this.credit=this.selectedSize?.credit||1}}return(r=l).\u0275fac=function(t){return new(t||r)(e.rXU(te.Z),e.rXU(C.f),e.rXU(e.sFG),e.rXU(U.s),e.rXU(N.u),e.rXU(Q.A),e.rXU(y.nX))},r.\u0275cmp=e.VBU({type:r,selectors:[["image-to-image-drawer"]],viewQuery:function(t,n){if(1&t&&(e.GBs(qr,5),e.GBs(Hr,5)),2&t){let i;e.mGM(i=e.lsd())&&(n.promptAnimation=i.first),e.mGM(i=e.lsd())&&(n.ngSelect=i.first)}},inputs:{toolName:"toolName"},decls:19,vars:18,consts:[["promptAnimation",""],[1,"w-100"],[1,"pane-section","w-100"],[1,"scroll-content","drawer-elements","ai-drawer-elements","w-100"],[1,"common-container","m-0","p-0","pb-8"],[3,"toolName","version"],[1,"card","ps-3","pe-3","pt-2","pb-3","border-0"],[1,"d-flex","w-100","flex-column","prompt-view"],[1,"d-flex","align-items-center","w-100","h-32","mb-1"],[1,"text-normal","text-dark","text-semi","lh-125"],[1,"textarea-col","position-relative",3,"ngClass"],[1,"text-animation",3,"changePrompt","focusOut","maxLength","prompts","textPrompt"],["class","prompt-info text-regular position-absolute d-flex align-items-center justify-content-start",4,"ngIf"],["class","d-flex document-color mt-2",4,"ngIf"],[3,"modelChange","type","featureType","selectedModel"],[1,"position-absolute","fixed-bottom","pb-1","pt-2","ps-3","pe-3","bg-white","aspect-ratio-column"],[3,"btnClick","disabled","btnText","credit"],[1,"prompt-info","text-regular","position-absolute","d-flex","align-items-center","justify-content-start"],[1,"d-flex","document-color","mt-2"],[1,"colors-bg","sticker-buttons-scroll"],[3,"selectLayout","items","type"]],template:function(t,n){if(1&t){const i=e.RV6();e.j41(0,"div",1)(1,"div",2)(2,"div",3),e.qex(3),e.j41(4,"div",4),e.nrm(5,"app-file-upload",5),e.j41(6,"div",6)(7,"div",7)(8,"div",8)(9,"span",9),e.EFF(10,"Enter Prompt "),e.k0s()(),e.j41(11,"div",10)(12,"text-prompt-animation",11,0),e.bIt("changePrompt",function(d){return e.eBV(i),e.Njj(n.changePrompt(d))})("focusOut",function(d){return e.eBV(i),e.Njj(n.onFocusOut(d))}),e.k0s(),e.DNE(14,Qr,2,2,"span",12),e.k0s(),e.DNE(15,Zr,3,2,"div",13),e.k0s(),e.j41(16,"model-selection",14),e.bIt("modelChange",function(d){return e.eBV(i),e.Njj(n.onModelChange(d))}),e.k0s()()(),e.bVm(),e.k0s()(),e.j41(17,"div",15)(18,"generate-button",16),e.bIt("btnClick",function(){return e.eBV(i),e.Njj(n.generate())}),e.k0s()()()}2&t&&(e.R7$(5),e.Y8G("toolName",n.toolName)("version","v1"),e.R7$(6),e.Y8G("ngClass",e.sMw(14,Jr,n.aiPhotoService.textPrompt.length,n.isFocused,n.aiPhotoService.textPrompt.length==n.maxLenght)),e.R7$(),e.Y8G("maxLength",
1n.maxLenght)("prompts",n.prompts)("textPrompt",n.aiPhotoService.textPrompt),e.R7$(2),e.Y8G("ngIf",n.aiPhotoService.textPrompt.length),e.R7$(),e.Y8G("ngIf",n.prompts.length),e.R7$(),e.Y8G("type","model-dropdown-image")("featureType",n.toolName)("selectedModel",n.selectedModel),e.R7$(2),e.Y8G("disabled",n.disabled)("btnText",n.btnText)("credit",n.credit))},dependencies:[s.YU,s.bT,oe.t,Pe.B,re.P,Re.x,ce],styles:['.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]{width:100%;height:110px;border-radius:12px;background:linear-gradient(90deg,#fc5cff05 -4%,#2520f605);padding:.9px 4px 4px}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#c9cad4 -4% 100%);-webkit-mask:linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%) content-box,linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%);-webkit-mask-composite:xor;mask-composite:exclude;z-index:1}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]:hover:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#606576 -4% 100%);-webkit-mask:linear-gradient(90deg,#606576 -4%,#606576 100%) content-box,linear-gradient(90deg,#606576 -4%,#606576 100%);-webkit-mask-composite:xor;mask-composite:exclude;z-index:1}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{resize:none;outline:none;width:100%;height:82px;padding:8px 8px 0;font-size:12px;color:#b0b3bf;border:0px;background:transparent;line-height:18px;position:relative;z-index:2}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar{width:4px;height:4px;border-radius:12px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#e3e3e3;border-radius:12px;margin-top:8px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#9a9a9a;border-radius:12px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:#555}.prompt-view[_ngcontent-%COMP%] .prompt-info[_ngcontent-%COMP%]{font-size:11px;color:#959aa7;margin-top:0;padding-left:8px;height:24px;line-height:normal;width:calc(100% - 8px);bottom:4px;z-index:99}.prompt-view[_ngcontent-%COMP%] .lampicon[_ngcontent-%COMP%]{border-radius:8px}.prompt-view[_ngcontent-%COMP%] .lampicon[_ngcontent-%COMP%]:hover{background:#626adf0d}.info-up[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#c9cad4 -4% 100%)!important;-webkit-mask:linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%) content-box,linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-blue[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff0d -4%,#2520f60d)!important}.info-blue[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#fc5cff -4%,#2520f6)!important;-webkit-mask:linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%) content-box,linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-blue[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#626adf!important}.info-red[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff0d -4%,#2520f60d)!important}.info-red[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#f25555 -4% 100%)!important;-webkit-mask:linear-gradient(90deg,#F25555 -4%,#F25555 100%) content-box,linear-gradient(90deg,#F25555 -4%,#F25555 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-red[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#f25555!important}.prompt-text[_ngcontent-%COMP%]{color:#282a3a!important}']}),l})();function ts(r,l){if(1&r&&(e.qex(0),e.nrm(1,"ai-shoot",10),e.bVm()),2&r){const o=e.XpG(3);e.R7$(),e.Y8G("featureType",o.toolName)("toolDisplayName",o.toolDisplayName)}}function ns(r,l){if(1&r&&e.nrm(0,"avatar-drawer",12),2&r){const o=e.XpG(4);e.Y8G("toolName",o.toolName)}}function os(r,l){if(1&r&&e.nrm(0,"filter-drawer",12),2&r){const o=e.XpG(4);e.Y8G("toolName",o.toolName)}}function is(r,l){if(1&r&&e.nrm(0,"portrait-drawer",12),2&r){const o=e.XpG(4);e.Y8G("toolName",o.toolName)}}function rs(r,l){if(1&r&&e.nrm(0,"sticker-drawer",12),2&r){const o=e.XpG(4);e.Y8G("toolName",o.toolName)}}function ss(r,l){if(1&r&&e.nrm(0,"text-to-image-drawer",12),2&r){const o=e.XpG(4);e.Y8G("toolName",o.toolName)}}function as(r,l){if(1&r&&e.nrm(0,"image-to-image-drawer",12),2&r){const o=e.XpG(4);e.Y8G("toolName",o.toolName)}}function cs(r,l){if(1&r&&e.nrm(0,"sketch-to-image",12),2&r){const o=e.XpG(4);e.Y8G("toolName",o.toolName)}}function ls(r,l){1&r&&(e.qex(0),e.DNE(1,ns,1,1,"avatar-drawer",11)(2,os,1,1,"filter-drawer",11)(3,is,1,1,"portrait-drawer",11)(4,rs,1,1,"sticker-drawer",11)(5,ss,1,1,"text-to-image-drawer",11)(6,as,1,1,"image-to-image-drawer",11)(7,cs,1,1,"sketch-to-image",11),e.bVm()),2&r&&(e.R7$(),e.Y8G("ngSwitchCase","avatar"),e.R7$(),e.Y8G("ngSwitchCase","aifilter"),e.R7$(),e.Y8G("ngSwitchCase","selfie"),e.R7$(),e.Y8G("ngSwitchCase","sticker"),e.R7$(),e.Y8G("ngSwitchCase","text2image"),e.R7$(),e.Y8G("ngSwitchCase","image2image"),e.R7$(),e.Y8G("ngSwitchCase","sketch2image"))}function ds(r,l){if(1&r&&(e.qex(0)(1,9),e.DNE(2,ts,2,2,"ng-container",8)(3,ls,8,7,"ng-container",8),e.bVm()()),2&r){const o=e.XpG(2);e.R7$(),e.Y8G("ngSwitch",o.toolName),e.R7$(),e.Y8G("ngIf",1==o.isDynamicTool),e.R7$(),e.Y8G("ngIf",0==o.isDynamicTool)}}function _s(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",3)(1,"div",4)(2,"pi",5),e.bIt("click",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.back())}),e.k0s(),e.j41(3,"span",6),e.EFF(4),e.k0s()(),e.j41(5,"div")(6,"div",7),e.DNE(7,ds,4,3,"ng-container",8),e.k0s()()()}if(2&r){const o=e.XpG();e.R7$(4),e.JRh(o.toolDisplayName),e.R7$(),e.ZvI("middle-drawer ",o.toolName,""),e.R7$(2),e.Y8G("ngIf",o.isLoaded)}}let gs=(()=>{var r;class l{constructor(t,n,i,a,d,g,m){this.aiPhotoService=t,this.aiUploadImageService=n,this.toast=i,this.route=a,this.modalService=d,this.aiWrapperRemoveBgService=g,this.editorService=m,this.toolDisplayName=null,this.isDynamicTool=0,this.toolName=null,this.isLoaded=!1,this.activeToolPanelSubscription=this.editorService.activeToolPanel.subscribe(b=>{if(b?.toolName&&(b?.toolName!=this.toolName&&!b?.changeTool||b?.changeTool)){const O=this.aiPhotoService.getToolByName(b?.toolName,J.sv.AI_IMAGE_TOOLS)||{metadata:{featureType:b?.toolName}};O&&(this.isDynamicTool=this.isDynamicTool?0:1,this.isLoaded=!1,setTimeout(()=>{this.isLoaded=!0,this.selectTool(O)},200))}})}ngOnInit(){if(this.isLoaded=!0,this.toolName=this.aiPhotoService?.queryParams?.toolName||null,this.toolName){const t=this.aiPhotoService.getToolByName(this.toolName,J.sv.AI_IMAGE_TOOLS)||{metadata:{featureType:this.toolName}};t&&this.selectTool(t)}}selectTool(t){this.isLoaded=!0,this.toolName=t?.metadata?.featureType,this.aiPhotoService.selectedTool=this.toolName,this.toolDisplayName=t?.text||"AI "+this.toolName,this.isDynamicTool=this.toolName==h.Fs.Selfie||this.toolName==h.Fs.Avatar?0:t?.metadata?.isDynamic||0,this.aiPhotoService.sampleImageUrl=t?.metadata?.sampleImageUrl||""}reset(){this.toolName=null,this.toolDisplayName=null,this.aiPhotoService.sampleImageUrl="",this.isLoaded=!1}back(){this.reset()}ngOnDestroy(){this.aiPhotoService.deleteQueryParam("toolName"),this.activeToolPanelSubscription&&this.activeToolPanelSubscription.unsubscribe()}}return(r=l).\u0275fac=function(t){return new(t||r)(e.rXU(U.s),e.rXU(G.M),e.rXU(C.f),e.rXU(y.nX),e.rXU(f.Bq),e.rXU(ee),e.rXU(k.x))},r.\u0275cmp=e.VBU({type:r,selectors:[["image-tools-drawer"]],decls:3,vars:2,consts:[[1,"drawer-content",3,"hidden"],[3,"selectToolEvent"],["class","tools-container-drawer workFlow-dropdown-panel",4,"ngIf"],[1,"tools-container-drawer","workFlow-dropdown-panel"],[1,"top-section","d-flex","align-items-center","bg-white","ps-3","pe-3"],["name","leftarrow",1,"back-icon","me-2","f-24","d-flex","align-items-center","justify-content-center","pointer","border-radius-8",3,"click"],[1,"text-lg","text-dark","text-semi","lh-125"],["customScrollDir","",1,"drawer-scroll","scroll-container"],[4,"ngIf"],[3,"ngSwitch"],[3,"featureType","toolDisplayName"],[3,"toolName",4,"ngSwitchCase"],[3,"toolName"]],template:function(t,n){1&t&&(e.j41(0,"div",0)(1,"tool-list-drawer",1),e.bIt("selectToolEvent",function(a){return n.selectTool(a)}),e.k0s()(),e.DNE(2,_s,8,5,"div",2)),2&t&&(e.Y8G("hidden",n.toolName),e.R7$(2),e.Y8G("ngIf",n.toolName))},dependencies:[s.bT,s.ux,s.e1,w.q,L.b,Me.F,wi,Vi,Qi,lr,Ir,Yr,es,ke.x],styles:[".child-drawer[_ngcontent-%COMP%]{position:absolute;top:0;width:100%;height:0px;opacity:0;transform:translateY(-20px);transition:transform .5s ease-in-out,opacity .5s ease-in-out}.drawer-active[_ngcontent-%COMP%]{height:100%;opacity:1;transform:translateY(0)}.tools-container-drawer[_ngcontent-%COMP%]{height:100%}
1.tools-container-drawer[_ngcontent-%COMP%] .top-section[_ngcontent-%COMP%]{height:56px;z-index:99;-webkit-user-select:none;user-select:none}.tools-container-drawer[_ngcontent-%COMP%] .top-section[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{font-size:14px!important;color:#272b34;line-height:19.07px}.tools-container-drawer[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{padding-top:52px}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%]{user-select:none;-webkit-user-select:none;height:calc(100vh - 193px - var(--sales-height))!important}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .scroll-container[_ngcontent-%COMP%]::-webkit-scrollbar-track{margin-top:0}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer.text2image[_ngcontent-%COMP%], .tools-container-drawer[_ngcontent-%COMP%] .middle-drawer.top-section-p.isresolution-add[_ngcontent-%COMP%]{height:calc(100vh - 233px - var(--sales-height))!important}.tools-container-drawer[_ngcontent-%COMP%] .credit-description[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:inline-flex;color:#272b34;font-size:12px}.wrapper-for-timeline[_ngcontent-%COMP%] .main-content[_ngcontent-%COMP%] .blank-section[_ngcontent-%COMP%]{flex-direction:column;-webkit-user-select:none;user-select:none}.wrapper-for-timeline[_ngcontent-%COMP%] .main-content[_ngcontent-%COMP%] .blank-section[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px;color:#272b34}.middle-drawer.top-section-p[_ngcontent-%COMP%]{height:calc(100vh - 193px - var(--sales-height))!important}.middle-drawer.top-section-p[_ngcontent-%COMP%]{padding-top:52px}"]}),l})();const _t=(r,l,o)=>({"info-up":r,"info-blue":l,"info-red":o}),ps=r=>({"icon-rotate":r});function ms(r,l){if(1&r&&(e.j41(0,"span",42),e.EFF(1),e.k0s()),2&r){const o=e.XpG(2);e.R7$(),e.Lme("",o.aiPhotoService.textPrompt.length,"/",o.maxLenght,"")}}function hs(r,l){if(1&r&&(e.j41(0,"span",42),e.EFF(1),e.k0s()),2&r){const o=e.XpG(3);e.R7$(),e.Lme("",o.negativePrompt.length,"/",o.maxLenght,"")}}function us(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",43)(1,"div",44)(2,"textarea",45),e.mxI("ngModelChange",function(n){e.eBV(o);const i=e.XpG(2);return e.DH7(i.negativePrompt,n)||(i.negativePrompt=n),e.Njj(n)}),e.bIt("blur",function(){e.eBV(o);const n=e.XpG(2);return e.Njj(n.focusOut(2))})("focus",function(){e.eBV(o);const n=e.XpG(2);return e.Njj(n.focusIn(2))}),e.k0s(),e.DNE(3,hs,2,2,"span",19),e.k0s()()}if(2&r){const o=e.XpG(2);e.R7$(),e.Y8G("ngClass",e.sMw(6,_t,o.negativePrompt.length,o.isNgPromptFocus,o.negativePrompt.length==o.maxLenght)),e.R7$(),e.AVh("blue-active",o.isNgPromptFocus),e.Y8G("maxlength",o.maxLenght),e.R50("ngModel",o.negativePrompt),e.R7$(),e.Y8G("ngIf",o.negativePrompt.length)}}function Ps(r,l){1&r&&(e.j41(0,"div",46),e.nrm(1,"span",47),e.k0s())}function fs(r,l){if(1&r&&e.nrm(0,"img",48),2&r){const o=e.XpG(2);e.Y8G("src",o.selectedStyle.thumbUrl,e.B4B)}}function bs(r,l){if(1&r){const o=e.RV6();e.qex(0),e.j41(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13),e.EFF(5,"Enter Prompt"),e.nrm(6,"pi",14),e.k0s(),e.j41(7,"div",15),e.nrm(8,"pi",16,2),e.k0s()(),e.j41(10,"div",17)(11,"text-prompt-animation",18),e.bIt("changePrompt",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.changePrompt(n))})("focusOut",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.onFocusOut(n))}),e.k0s(),e.DNE(12,ms,2,2,"span",19),e.k0s()(),e.j41(13,"div",20)(14,"div",21)(15,"div",22)(16,"div",13),e.EFF(17,"Negative Prompt"),e.nrm(18,"pi",23),e.k0s()(),e.j41(19,"div",24)(20,"toggle-switch",25),e.bIt("changeT",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.toggleButton(n))}),e.k0s()()(),e.DNE(21,us,4,10,"div",26),e.k0s(),e.j41(22,"div",27)(23,"span",28),e.EFF(24,"Presets"),e.nrm(25,"pi",29),e.k0s()(),e.j41(26,"div",30,2),e.bIt("mouseenter",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.isselectedStylehover=!0)})("mouseleave",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.isselectedStylehover=!1)})("shown",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.popoverOpen=!0)})("hidden",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.popoverOpen=!1)}),e.j41(28,"div",31),e.DNE(29,Ps,2,0,"div",32),e.j41(30,"div",33),e.bIt("click",function(n){e.eBV(o);const i=e.XpG();return n.stopPropagation(),e.Njj(i.resetStyle())}),e.DNE(31,fs,1,1,"img",34),e.j41(32,"div",35),e.nrm(33,"pi",36),e.k0s()()(),e.j41(34,"div",37),e.EFF(35),e.k0s(),e.j41(36,"div",38),e.nrm(37,"pi",39),e.k0s()(),e.j41(38,"div",40)(39,"model-selection",41),e.bIt("modelChange",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.onModelChange(n))}),e.k0s()()(),e.bVm()}if(2&r){const o=e.XpG(),t=e.sdS(8),n=e.sdS(10);e.R7$(8),e.Y8G("autoClose",!0)("ngbPopover",t),e.R7$(2),e.Y8G("ngClass",e.sMw(20,_t,o.aiPhotoService.textPrompt.length,o.isFocused,o.aiPhotoService.textPrompt.length==o.maxLenght)),e.R7$(),e.Y8G("maxLength",o.maxLenght)("prompts",o.prompts)("textPrompt",o.aiPhotoService.textPrompt),e.R7$(),e.Y8G("ngIf",o.aiPhotoService.textPrompt.length),e.R7$(8),e.Y8G("selected",o.isNgPrompt),e.R7$(),e.Y8G("ngIf",o.isNgPrompt),e.R7$(5),e.Y8G("autoClose","outside")("ngbPopover",n),e.R7$(2),e.Y8G("ngClass",null!=o.selectedStyle&&o.selectedStyle.thumbUrl?"add-border":"remove-border"),e.R7$(),e.Y8G("ngIf",!(o.productImageId&&o.productImageId>-1&&null!=o.selectedStyle&&o.selectedStyle.thumbUrl||null!=o.selectedStyle&&o.selectedStyle.thumbUrl)),e.R7$(2),e.Y8G("ngIf",o.productImageId&&o.productImageId>0),e.R7$(),e.Y8G("ngClass",o.productImageId&&o.productImageId>-1&&null!=o.selectedStyle&&o.selectedStyle.thumbUrl&&o.isselectedStylehover?"d-block":"d-none"),e.R7$(3),e.SpI(" ",null!=o.selectedStyle&&o.selectedStyle.displayName?null==o.selectedStyle?null:o.selectedStyle.displayName:"None"," "),e.R7$(),e.Y8G("ngClass",e.eq3(24,ps,o.popoverOpen)),e.R7$(3),e.Y8G("type","model-dropdown-video")("featureType","text2video")("selectedModel",o.selectedModel)}}function Cs(r,l){if(1&r){const o=e.RV6();e.j41(0,"ai-prompts-popover",49),e.bIt("selectPrompt",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.selectPrompt(n))}),e.k0s()}if(2&r){const o=e.XpG();e.Y8G("items",o.prompts)}}function vs(r,l){if(1&r){const o=e.RV6();e.j41(0,"ai-choose-styles",50),e.bIt("selectImage",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.selectImage(n))}),e.k0s()}if(2&r){const o=e.XpG();e.Y8G("productImageId",o.productImageId)("products",o.products)}}let Is=(()=>{var r;class l{constructor(t,n,i,a,d,g,m,b){this.mediaContentService=t,this.renderer=n,this.aiPhotoService=i,this.authService=a,this.createPopupService=d,this.aiUploadImageService=g,this.paymentService=m,this.toast=b,this.isselectedStylehover=!1,this.popoverOpen=!1,this.productImageId=0,this.btnText="Generate",this.disabled=!1,this.isFocused=!1,this.pageNumber=0,this.qual
1ity=1,this.isNgPrompt=!1,this.isNgPromptFocus=!1,this.negativePrompt="",this.prompts=[],this.inProgress=!1,this.selectedModel=null,this.maxLenght=2e3,this.user=this.authService.currentUser(),this.loggedInObserver=this.authService.loggedIn.subscribe(O=>{this.user=this.authService.currentUser()}),this.updateBehaviorUserAiConis=this.authService.updateBehaviorUserAiConis.subscribe(O=>{this.user=this.authService.currentUser()}),this.usrPropChangedObserver=this.authService.usrPropChanged.subscribe(O=>{this.user=this.authService.currentUser(),O&&this.authService.updateUserAiConis(()=>{})}),this.usrAICreditChanged=this.authService.usrAICreditChanged.subscribe(O=>{this.user=this.authService.currentUser(),O&&this.authService.updateUserAiConis(()=>{})})}ngOnInit(){this.getCategoryDetails(),this.changePrompt(this.aiPhotoService.textPrompt),this.checkVideoStatus(),this.aiPhotoService.deleteQueryParams()}selectImage(t){t?(this.productImageId=t.productImageId,this.selectedStyle=t):(this.productImageId=0,this.selectedStyle=this.noneProduct),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}getCategoryDetails(){this.mediaContentService.getCategoryProductDetails(A.KK.TEXTTOVIDEO,this.pageNumber,t=>{if(t&&t.body){if(!this.products&&t.body.storeProducts&&(this.products=t.body.storeProducts[0],this.getPrompts(()=>{this.isLoaded=!0}),this.selectedStyle=this.noneProduct={productImageId:0,imageJson:"",isGenerated:!1,id:1},this.aiPhotoService.queryParams?._sId)){const n=this.products.storeProductImages.filter(i=>i.displayName==this.aiPhotoService.queryParams?._sId)[0];n&&(this.selectedStyle=n,this.productImageId=this.selectedStyle?.productImageId)}}else this.isLoaded=!0},t=>{this.isLoaded=!0})}generate(){if(!this.inProgress)if(this.user&&this.user.remainingCoins>=this.quality){const t={featureType:h.Fs.TextToVideo,textPrompt:this.aiPhotoService.textPrompt,isCustomPrompt:1,...this.isNgPrompt&&this.negativePrompt&&{negativePrompt:this.negativePrompt},substyle:this.productImageId?this.selectedStyle?.imageJson:"",...this.aiPhotoService.getVideoModelOptions(this.selectedModel)};this.aiPhotoService.startGenerationProgress({featureType:h.Fs.TextToVideo,isVideo:!0}),this.inProgress=!0,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),this.aiPhotoService.generateImage(t,n=>{if(n&&n.assetId){this.toast.showErrorSingle(x.b.message.videoGenMsg,1e4);const i=0;n.featureType=h.Fs.TextToVideo,n.toolName=x.b.label.text2Video,n.styleName=this.selectedStyle?.displayName,this.aiPhotoService.checkStatus(n,i,a=>{this.inProgress=!1,a&&a.urls&&a.urls.length>0?(this.selectedStyle.isGenerated=!0,this.user.remainingCoins=a.remainingCalls):this.aiPhotoService.clearGenerationProgress(),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)},a=>{this.displayErrorMsg(a)},!0)}else this.displayErrorMsg(n)},n=>{this.displayErrorMsg(n)})}else this.aiPhotoService.openAICreditPopup(()=>{this.user=this.authService.currentUser(),this.generate()},this.quality,"video")}displayErrorMsg(t=null){this.aiPhotoService.clearGenerationProgress(),this.inProgress=!1;let n=t?.description;this.createPopupService.openWarningDialog("Error",n),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}ngOnDestroy(){this.aiPhotoService.textPrompt="",this.loggedInObserver&&this.loggedInObserver.unsubscribe(),this.usrPropChangedObserver&&this.usrPropChangedObserver.unsubscribe(),this.usrAICreditChanged&&this.usrAICreditChanged.unsubscribe(),this.updateBehaviorUserAiConis&&this.updateBehaviorUserAiConis.unsubscribe(),this.checkStatusSub&&this.checkStatusSub.unsubscribe(),this.toast.removeAll()}changePrompt(t=""){this.aiPhotoService.textPrompt=t,this.disabled=!(this.aiPhotoService.textPrompt&&this.aiPhotoService.textPrompt.trim().length>1||this.aiPhotoService.selectedGuidance.thumbUrl)}onFocusOut(t){this.isFocused=t}focusOut(t=1){1==t?this.isFocused=!1:this.isNgPromptFocus=!1}focusIn(t=1){1==t?this.isFocused=!0:this.isNgPromptFocus=!0}toggleButton(t){this.isNgPrompt=t}getPrompts(t=null){this.mediaContentService.getPrompts(A.Jl.TextToVideo,n=>{n&&(this.prompts=n.prompts),t&&t()},n=>{t&&t()})}selectPrompt(t){this.aiPhotoService.textPrompt=t.prompt,this.disabled=!this.aiPhotoService.textPrompt,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),setTimeout(()=>{this.isFocused=!1})}onDropdownOpen(){this.renderer.addClass(document.body,"drop-open")}onDropdownClose(){this.renderer.removeClass(document.body,"drop-open")}checkVideoStatus(){const t=JSON.parse(localStorage.getItem("generationDetail
1s"));if(t){const n=new Date(t?.createdDate),i=new Date(n.setMinutes(n.getMinutes()+60));"init"==t.status&&!this.aiPhotoService.inVideoProgress&&i>new Date&&(this.aiPhotoService.startGenerationProgress({featureType:t.featureType||h.Fs.TextToVideo,isVideo:!0}),this.inProgress=!0,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),this.aiPhotoService.checkStatus(t,0,d=>{this.inProgress=!1,d&&d.urls&&d.urls.length>0||this.aiPhotoService.clearGenerationProgress(),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)},d=>{this.displayErrorMsg(d)},!0))}}resetStyle(){this.selectedStyle=this.noneProduct={productImageId:-1,imageJson:"",isGenerated:!1,id:1},this.productImageId=0}onModelChange(t){this.updateModelSelection(t)}onModelButtonChange(t){this.updateModelSelection(t)}updateModelSelection(t){if(!t)return;const n=Number(t?.credits);!Number.isNaN(n)&&n>0&&(this.quality=n),this.selectedModel=t}}return(r=l).\u0275fac=function(t){return new(t||r)(e.rXU(te.Z),e.rXU(e.sFG),e.rXU(U.s),e.rXU(N.u),e.rXU(Q.A),e.rXU(G.M),e.rXU(K.W),e.rXU(C.f))},r.\u0275cmp=e.VBU({type:r,selectors:[["text-to-video-drawer"]],decls:11,vars:8,consts:[["popContent",""],["popContentChooseStyles",""],["popOver","ngbPopover"],[1,"w-100"],[1,"pane-section","aiImageGen","w-100"],[1,"scroll-content","drawer-elements","ai-drawer-elements","w-100"],[4,"ngIf"],[1,"position-absolute","fixed-bottom","pb-1","pt-2","ps-3","pe-3","bg-white","aspect-ratio-column"],[3,"modelButtonChange","type","featureType","selectedModel"],[3,"btnClick","disabled","btnText","credit","isVideo"],[1,"card","ps-3","pe-3","pt-2","pb-3","border-0","mb-3"],[1,"d-flex","w-100","flex-column","prompt-view"],[1,"wp-100","d-flex","align-items-center","justify-content-between","mb-1","h-32"],[1,"name","text-semi"],["name","helpicon","placement","right","popoverClass","pop-for-tooltip","ngbPopover","Provide a text description about the scene, characters involved, and specific actions or events that should occur in your generated video.","triggers","mouseenter:mouseleave","popoverTitle","Enter Prompt","container","body",1,"ms-1","hw-24","help-icon"],["placement","right","ngbTooltip","Suggested Prompt","tooltipClass","tooltip-custom-all","container","body",1,"hw-32","overflow-hidden","border-radius-8"],["name","lampicon","placement","right","container","body","popoverClass","background-prompt",1,"pointer","f-32","lampicon",3,"autoClose","ngbPopover"],[1,"textarea-col","position-relative","mb-3",3,"ngClass"],[1,"text-animation",3,"changePrompt","focusOut","maxLength","prompts","textPrompt"],["class","prompt-info text-regular position-absolute d-flex align-items-center justify-content-start",4,"ngIf"],[1,"mb-3"],[1,"d-flex","align-items-center","h-32"],[1,"wp-100"],["name","helpicon","placement","right","popoverClass","pop-for-tooltip","ngbPopover","Specify elements, themes, actions, or visual styles that you don\u2019t want to see in your generated video.","triggers","mouseenter:mouseleave","popoverTitle","Negative Prompt","container","body",1,"ms-1","hw-24","help-icon"],[1,"editor-toggle",2,"height","26px"],[1,"d-flex","align-items-center","mb-0",3,"changeT","selected"],["class","d-flex w-100 flex-column prompt-view mt-1",4,"ngIf"],[1,"d-flex","align-items-center","w-100","mb-1","h-32"],[1,"text-normal","text-dark","text-semi","lh-125"],["name","helpicon","placement","right","popoverClass","pop-for-tooltip","ngbPopover","Choose from a collection of predefined artistic effects and aesthetics that can be applied to your generated video.","triggers","mouseenter:mouseleave","popoverTitle","Presets","container","body",1,"ms-1","hw-24","help-icon"],["placement","right","container","body","popoverClass","background-prompt background-style pt-2 w-336",1,"d-flex","w-100","selected-style","justify-content-between","align-items-center",3,"mouseenter","mouseleave","shown","hidden","autoClose","ngbPopover"],[1,"thumb-box","d-inline-flex","align-items-center","justify-content-center","overflow-hidden",3,"ngClass"],["class","none-item d-inline-flex align-items-center justify-content-center",4,"ngIf"],[1,"position-relative","d-inline-flex",3,"click"],["width","40px","height","40px","class","border-radius-8",3,"src",4,"ngIf"],[1,"d-inline-flex","align-items-center","justify-content-center","cta-action","position-absolute","border-radius-8",3,"ngClass"],["name","deletesmall",1,"f-24","text-white"],[1,"content","pl-9","pr-9","d-inline-flex","align-items-center"],[1,"arrow-img","d-inline-flex","align-items-center","justify-content-center",3,"ngClass"],["name","chevronaarrow",1,"hw-24"],[1,""],[3,"modelChange","type","featureType","selectedModel"],[1,"prompt-info","text-regular","position-absolute","d-flex","align-items-center","justify-content-start"],[1,"d-flex","w-100","flex-column","prompt-view","mt-1"],[1,"textarea-col","h-73","position-relative",3,"ngClass"],["
1id","cprompt1","name","cprompt1","rows","2","cols","50","placeholder","Type what you want to exclude",1,"prompt-text",2,"height","68%",3,"ngModelChange","blur","focus","maxlength","ngModel"],[1,"none-item","d-inline-flex","align-items-center","justify-content-center"],[1,"blank-icon"],["width","40px","height","40px",1,"border-radius-8",3,"src"],[3,"selectPrompt","items"],[3,"selectImage","productImageId","products"]],template:function(t,n){if(1&t){const i=e.RV6();e.j41(0,"div",3)(1,"div",4)(2,"div",5),e.DNE(3,bs,40,26,"ng-container",6),e.k0s()(),e.j41(4,"div",7)(5,"model-selection",8),e.bIt("modelButtonChange",function(d){return e.eBV(i),e.Njj(n.onModelButtonChange(d))}),e.k0s(),e.j41(6,"generate-button",9),e.bIt("btnClick",function(){return e.eBV(i),e.Njj(n.generate())}),e.k0s()()(),e.DNE(7,Cs,1,1,"ng-template",null,0,e.C5r)(9,vs,1,2,"ng-template",null,1,e.C5r)}2&t&&(e.R7$(3),e.Y8G("ngIf",n.isLoaded),e.R7$(2),e.Y8G("type","model-button-video")("featureType","text2video")("selectedModel",n.selectedModel),e.R7$(),e.Y8G("disabled",n.disabled)("btnText",n.btnText)("credit",n.quality)("isVideo",!0))},dependencies:[s.YU,s.bT,$e.C,f.ZM,f.md,u.me,u.BC,u.tU,u.vS,L.b,Ke.V,ue.k,oe.t,Re.x,ce],styles:['.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]{width:100%;height:110px;border-radius:12px;background:linear-gradient(90deg,#fc5cff05 -4%,#2520f605);padding:.9px 4px 4px}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#c9cad4 -4% 100%);-webkit-mask:linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%) content-box,linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%);-webkit-mask-composite:xor;mask-composite:exclude;z-index:1}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]:hover:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#606576 -4% 100%);-webkit-mask:linear-gradient(90deg,#606576 -4%,#606576 100%) content-box,linear-gradient(90deg,#606576 -4%,#606576 100%);-webkit-mask-composite:xor;mask-composite:exclude;z-index:1}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{resize:none;outline:none;width:100%;height:82px;padding:8px 8px 0;font-size:12px;color:#b0b3bf;border:0px;background:transparent;line-height:18px;position:relative;z-index:2}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar{width:4px;height:4px;border-radius:12px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#e3e3e3;border-radius:12px;margin-top:8px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#9a9a9a;border-radius:12px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:#555}.prompt-view[_ngcontent-%COMP%] .prompt-info[_ngcontent-%COMP%]{font-size:11px;color:#959aa7;margin-top:0;padding-left:8px;height:24px;line-height:normal;width:calc(100% - 8px);bottom:4px;z-index:99}.prompt-view[_ngcontent-%COMP%] .lampicon[_ngcontent-%COMP%]{border-radius:8px}.prompt-view[_ngcontent-%COMP%] .lampicon[_ngcontent-%COMP%]:hover{background:#626adf0d}.info-up[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#c9cad4 -4% 100%)!important;-webkit-mask:linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%) content-box,linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-blue[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff0d -4%,#2520f60d)!important}.info-blue[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#fc5cff -4%,#2520f6)!important;-webkit-mask:linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%) content-box,linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-blue[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#626adf!important}.info-red[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff0d -4%,#2520f60d)!important}.info-red[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#f25555 -4% 100%)!important;-webkit-mask:linear-gradient(90deg,#F25555 -4%,#F25555 100%) content-box,linear-gradient(90deg,#F25555 -4%,#F25555 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-red[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#f25555!important}.prompt-text[_ngcontent-%COMP%]{color:#272b34!important}.h-73[_ngcontent-%COMP%]{height:73px!important}.selected-style[_ngcontent-%COMP%]{padding:4px 12px 4px 4px;border-radius:12px;border:1px solid #E2E3E9;background:#626adf0d;cursor:pointer;height:48px}.selected-style[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{font-size:13px;color:#272b34;width:174px;font-weight:600}.selected-style[_ngcontent-%COMP%] .arrow-img[_ngcontent-%COMP%]{width:24px;height:24px}.selected-style[_ngcontent-%COMP%] .arrow-img[_ngcontent-%COMP%] pi[_ngcontent-%COMP%]{color:#272b34}.selected-style[_ngcontent-%COMP%]:hover{border:1px solid #E2E3E9;background:#626adf1a}.selected-style[_ngcontent-%COMP%]:hover .thumb-box[_ngcontent-%COMP%] pi[_ngcontent-%COMP%]{color:#272b34}.selected-style[_ngcontent-%COMP%]:hover .arrow-img[_ngcontent-%COMP%] pi[_ngcontent-%COMP%]{color:#272b34}.selected-style[aria-describedby=ngb-popover-1][_ngcontent-%COMP%] .arrow-img[_ngcontent-%COMP%] pi[_ngcontent-%COMP%]{transform:rotate(180deg);color:#272b34}.cta-action[_ngcontent-%COMP%]{background:#000000b3;width:100%;height:100%;left:0;top:0}.cta-action[_ngcontent-%COMP%]:hover{background:#000c}.blank-icon[_ngcontent-%COMP%]{border-radius:4px;background:#f25555;width:24px;height:2px;transform:rotate(-45deg)}.thumb-box[_ngcontent-%COMP%]{height:40px;width:40px;border-radius:8px;min-width:40px}.thumb-box[_ngcontent-%COMP%] .none-item[_ngcontent-%COMP%]{width:34px;height:34px;border-radius:8px;border:1px solid #E2E3E9;background:#fff}.thumb-box[_ngcontent-%COMP%] .none-item[_ngcontent-%COMP%] .blank-icon[_ngcontent-%COMP%]{border-radius:4px;background:#f25555;width:24px;height:2px;transform:rotate(-45deg)}.add-border[_ngcontent-%COMP%]{border:1px solid #E2E3E9}.remove-border[_ngcontent-%COMP%]{border:0px solid #E2E3E9}.icon-rotate[_ngcontent-%COMP%] pi[_ngcontent-%COMP%]{transform:rotate(-90deg)}']}),l})();const xs=r=>({"pe-none":r}),Ms=(r,l,o)=>({"info-up":r,"info-blue":l,"info-red":o});function Os(r,l){if(1&r&&(e.j41(0,"span",20),e.EFF(1),e.k0s()),2&r){const o=e.XpG();e.R7$(),e.Lme("",o.aiPhotoService.imgToVideoPrompt.length,"/",o.maxLenght,"")}}let ys=(()=>{var r;class l{constructor(t,n,i,a,d){this.toast=t,this.aiPhotoService=n,this.authService=i,this.createPopupService=a,this.aiUploadImageService=d,this.btnText="Generate",this.disabled=!0,this.placeHolder="Imagine anything, type it",this.isFocused=!1,this.qual
1ity=1,this.isNgPromptFocus=!1,this.secondImageEnabled=!1,this.toolName=h.Fs.ImageToVideo,this.selectedModel=null,this.prompts=[],this.maxLenght=2e3,this.user=this.authService.currentUser(),this.loggedInObserver=this.authService.loggedIn.subscribe(g=>{this.user=this.authService.currentUser()}),this.updateBehaviorUserAiConis=this.authService.updateBehaviorUserAiConis.subscribe(g=>{this.user=this.authService.currentUser()}),this.usrPropChangedObserver=this.authService.usrPropChanged.subscribe(g=>{this.user=this.authService.currentUser(),g&&this.authService.updateUserAiConis(()=>{})}),this.usrAICreditChanged=this.authService.usrAICreditChanged.subscribe(g=>{this.user=this.authService.currentUser(),g&&this.authService.updateUserAiConis(()=>{})}),this.imageUploadChnage=this.aiPhotoService.imageUpload.subscribe(g=>{g&&this.changePrompt()}),this.imageDuoUploadChnage=this.aiPhotoService.imageDuoUpload.subscribe(g=>{g&&this.changePrompt()}),this.aiPhotoService.originalImageUrlDuo&&this.aiPhotoService.secondImageEnabled&&this.togglesecondImage(!0),this.aiPhotoService.secondImageEnabled&&this.togglesecondImage(!0)}togglesecondImage(t){this.secondImageEnabled=t,this.aiPhotoService.secondImageEnabled=t,this.changePrompt()}ngOnInit(){this.changePrompt()}generate(){if(!this.aiPhotoService.isCancel||this.aiPhotoService.imgUrl){if(!this.aiPhotoService.inVideoProgress&&!this.aiPhotoService.inProgress&&this.aiPhotoService.imgUrl)if(this.user&&this.user.remainingCoins>=this.quality){const t={imageUrl:this.aiPhotoService.imgUrl,featureType:h.Fs.ImageToVideo,isCustomPrompt:1,...this.secondImageEnabled&&this.aiPhotoService.originalImageUrlDuo&&{imageUrlSecond:this.aiPhotoService.originalImageUrlDuo},textPrompt:this.aiPhotoService.imgToVideoPrompt,...this.aiPhotoService.getVideoModelOptions(this.selectedModel)};this.aiPhotoService.startGenerationProgress({featureType:this.secondImageEnabled?h.Fs.Frameinterpolation:h.Fs.ImageToVideo,isVideo:!0}),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),this.aiPhotoService.generateImage(t,n=>{if(n&&n.assetId){this.toast.showErrorSingle(x.b.message.videoGenMsg,1e4);const i=0;n.toolPrompt=this.aiPhotoService.imgToVideoPrompt,n.width=Number(this.aiPhotoService.queryParams?._w),n.height=Number(this.aiPhotoService.queryParams?._h),n.featureType=this.secondImageEnabled?h.Fs.Frameinterpolation:h.Fs.ImageToVideo,n.toolName=x.b.label.image2Video,this.aiPhotoService.checkStatus(n,i,a=>{a&&a.urls&&a.urls.length>0?(this.user.remainingCoins=a.remainingCalls,this.aiPhotoService.isDirty=!0):this.aiPhotoService.clearGenerationProgress(),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)},a=>{this.displayErrorMsg(a)},!0)}else this.displayErrorMsg(n)},n=>{this.displayErrorMsg(n)})}else this.aiPhotoService.openAICreditPopup(()=>{this.user=this.authService.currentUser(),this.generate()},this.quality,"video")}else this.toast.showErrorSingle(x.b.message.uploadNewImage)}displayErrorMsg(t=null){this.aiPhotoService.clearGenerationProgress();let n=t?.description;this.createPopupService.openWarningDialog("Error",n),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}ngOnDestroy(){this.loggedInObserver&&this.loggedInObserver.unsubscribe(),this.usrPropChangedObserver&&this.usrPropChangedObserver.unsubscribe(),this.usrAICreditChanged&&this.usrAICreditChanged.unsubscribe(),this.updateBehaviorUserAiConis&&this.updateBehaviorUserAiConis.unsubscribe(),this.imageUploadChnage&&this.imageUploadChnage.unsubscribe()}changePrompt(t){"string"==typeof t&&(this.aiPhotoService.imgToVideoPrompt=t),this.disabled=!(this.aiPhotoService.imgToVideoPrompt&&this.aiPhotoService.imgToVideoPrompt.trim().length>1&&(this.aiPhotoService.originalImgUrl&&!this.secondImageEnabled||this.aiPhotoService.originalImgUrl&&this.aiPhotoService.originalImageUrlDuo&&this.secondImageEnabled)),!this.aiPhotoService.imgUrl&&this.aiPhotoService.originalImgUrl&&(this.aiPhotoService.imgUrl=this.aiPhotoService.originalImgUrl)}onFocusOut(t){this.isFocused=t}focusOut(t=1){1==t?this.isFocused=!1:this.isNgPromptFocus=!1}focusIn(t=1){1==t?this.isFocused=!0:this.isNgPromptFocus=!0}selectPrompt(t){this.aiPhotoService.imgToVideoPrompt=t.prompt,this.changePrompt(t.prompt),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}checkVideoStatus(){const t=JSON.parse(localStorage.getItem("generationDetail
1s"));if(t){const n=new Date(t.createdDate),i=new Date(n.setMinutes(n.getMinutes()+60));"init"==t.status&&!this.aiPhotoService.inVideoProgress&&i>new Date&&(this.aiPhotoService.startGenerationProgress({featureType:t.featureType||h.Fs.ImageToVideo,isVideo:!0}),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),this.aiPhotoService.checkStatus(t,0,d=>{d&&d.urls&&d.urls.length>0||this.aiPhotoService.clearGenerationProgress(),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)},d=>{this.displayErrorMsg(d)},!0))}}onModelChange(t){this.updateModelSelection(t)}onModelButtonChange(t){this.updateModelSelection(t)}updateModelSelection(t){if(!t)return;const n=Number(t?.credits);!Number.isNaN(n)&&n>0&&(this.quality=n),this.selectedModel=t}}return(r=l).\u0275fac=function(t){return new(t||r)(e.rXU(C.f),e.rXU(U.s),e.rXU(N.u),e.rXU(Q.A),e.rXU(G.M))},r.\u0275cmp=e.VBU({type:r,selectors:[["image-to-video-drawer"]],decls:24,vars:24,consts:[[1,"common-container","m-0","p-0","editor-tool-panel",3,"ngClass"],[1,"d-flex","w-100","flex-column","ngb-btn"],[1,"common-container","m-0","p-0"],[1,"card-body"],[3,"toolName","version"],[1,"d-flex","align-items-center","justify-content-end",2,"margin-top","-8px"],[1,"text-13","lh-140","text-black"],[1,"editor-toggle","ms-2"],[1,"d-flex","align-items-center",3,"changeT","selected"],[1,"card","mt-3","mb-0","ps-3","pe-3","pt-2","pb-3","border-0"],[1,"card-body","prompt-view"],[1,"d-flex","align-items-center","wp-100","text-normal","text-semi","text-dark","lh-125","h-32","mb-1"],["name","helpicon","placement","right","popoverClass","pop-for-tooltip","ngbPopover","Provide a text description about how each element of the uploaded photo should be animated. This can include the direction of movement, mood or atmosphere enhancements, and interactions between elements.","triggers","mouseenter:mouseleave","popoverTitle","Enter Prompt","container","body",1,"ms-1","hw-24","help-icon"],[1,"textarea-col","position-relative",3,"ngClass"],[1,"text-animation",3,"changePrompt","focusOut","maxLength","prompts","textPrompt"],["class","prompt-info text-regular position-absolute d-flex align-items-center justify-content-start",4,"ngIf"],[3,"modelChange","type","featureType"],[1,"position-absolute","fixed-bottom","pb-1","pt-2","ps-3","pe-3","bg-white","aspect-ratio-column"],[3,"modelButtonChange","type","featureType","selectedModel"],[3,"btnClick","disabled","btnText","credit","isVideo"],[1,"prompt-info","text-regular","position-absolute","d-flex","align-items-center","justify-content-start"]],template:function(t,n){1&t&&(e.qex(0),e.j41(1,"div",0)(2,"div",1)(3,"div",2)(4,"div",3),e.nrm(5,"app-file-upload",4),e.j41(6,"div",5)(7,"div",6),e.EFF(8,"Enable 2nd Image"),e.k0s(),e.j41(9,"div",7)(10,"toggle-switch",8),e.bIt("changeT",function(a){return n.togglesecondImage(a)}),e.k0s()()()()(),e.j41(11,"div",2)(12,"div",9)(13,"div",10)(14,"div",11),e.EFF(15,"Prompt "),e.nrm(16,"pi",12),e.k0s(),e.j41(17,"div",13)(18,"text-prompt-animation",14),e.bIt("changePrompt",function(a){return n.changePrompt(a)})("focusOut",function(a){return n.onFocusOut(a)}),e.k0s(),e.DNE(19,Os,2,2,"span",15),e.k0s()(),e.j41(20,"model-selection",16),e.bIt("modelChange",function(a){return n.onModelChange(a)}),e.k0s()()()()(),e.bVm(),e.j41(21,"div",17)(22,"model-selection",18),e.bIt("modelButtonChange",function(a){return n.onModelButtonChange(a)}),e.k0s(),e.j41(23,"generate-button",19),e.bIt("btnClick",function(){return n.generate()}),e.k0s()()),2&t&&(e.R7$(),e.Y8G("ngClass",e.eq3(18,xs,n.aiPhotoService.inVideoProgress)),e.R7$(4),e.Y8G("toolName",n.toolName)("version",n.secondImageEnabled?"v3":"v1"),e.R7$(5),e.Y8G("selected",n.secondImageEnabled),e.R7$(7),e.Y8G("ngClass",e.sMw(20,Ms,n.aiPhotoService.imgToVideoPrompt.length,n.isFocused,n.aiPhotoService.imgToVideoPrompt.length==n.maxLenght)),e.R7$(),e.Y8G("maxLength",n.maxLenght)("prompts",n.prompts)("textPrompt",n.aiPhotoService.imgToVideoPrompt),e.R7$(),e.Y8G("ngIf",n.aiPhotoService.imgToVideoPrompt.length),e.R7$(),e.Y8G("type","model-dropdown-video")("featureType",n.toolName),e.R7$(2),e.Y8G("type","model-button-video")("featureType",n.toolName)("selectedModel",n.selectedModel),e.R7$(),e.Y8G("disabled",n.disabled)("btnText",n.btnText)("credit",n.quality)("isVideo",!0))},dependencies:[s.YU,s.bT,$e.C,f.ZM,L.b,oe.t,re.P,Re.x,ce],styles:['.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]{width:100%;height:110px;border-radius:12px;background:linear-gradient(90deg,#fc5cff05 -4%,#2520f605);padding:.9px 4px 4px}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#c9cad4 -4% 100%);-webkit-mask:linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%) content-box,linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%);-webkit-mask-composite:xor;mask-composite:exclude;z-index:1}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]:hover:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#606576 -4% 100%);-webkit-mask:linear-gradient(90deg,#606576 -4%,#606576 100%) content-box,linear-gradient(90deg,#606576 -4%,#606576 100%);-webkit-mask-composite:xor;mask-composite:exclude;z-index:1}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{resize:none;outline:none;width:100%;height:82px;padding:8px 8px 0;font-size:12px;color:#b0b3bf;border:0px;background:transparent;line-height:18px;position:relative;z-index:2}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar{width:4px;height:4px;border-radius:12px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#e3e3e3;border-radius:12px;margin-top:8px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#9a9a9a;border-radius:12px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:#555}.prompt-view[_ngcontent-%COMP%] .prompt-info[_ngcontent-%COMP%]{font-size:11px;color:#959aa7;margin-top:0;padding-left:8px;height:24px;line-height:normal;width:calc(100% - 8px);bottom:4px;z-index:9;pointer-events:none}.info-up[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#c9cad4 -4% 100%)!important;-webkit-mask:linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%) content-box,linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-blue[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff0d -4%,#2520f60d)!important}.info-blue[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#fc5cff -4%,#2520f6)!important;-webkit-mask:linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%) content-box,linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-blue[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#626adf!important}.info-red[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff0d -4%,#2520f60d)!important}.info-red[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#f25555 -4% 100%)!important;-webkit-mask:linear-gradient(90deg,#F25555 -4%,#F25555 100%) content-box,linear-gradient(90deg,#F25555 -4%,#F25555 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-red[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#f25555!important}.prompt-text[_ngcontent-%COMP%]{color:#272b34!important}.fixed-bottom[_ngcontent-%COMP%]{position:fixed!important;width:300px!important;right:auto!important;left:5rem;-webkit-user-select:none;user-select:none;z-index:99}.btn[_ngcontent-%COMP%]:disabled{background:#d9d9d9;border:1px solid #d9d9d9}']}),l})();var ws=c(66035),Es=c(85188);const Ss=r=>({"bg-white":r}),Ts=r=>({"add-on-404":r}),Ds=r=>({"opacity-3":r}),Ye=r=>({"pe-none":r});function ks(r,l){if(1&r){const o=e.RV6();e.j41(0,"span",24),e.bIt("click",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.delete())}),e.nrm(1,"pi",25),e.k0s()}}function Rs(r,l){if(1&r&&e.nrm(0,"img",26),2&r){const o=e.XpG();e.Y8G("src",null==o.aiPhotoService||null==o.aiPhotoService.selectedGuidance?null:o.aiPhotoService.selectedGuidance.thumbUrl,e.B4B)}}function Us(r,l){if(1&r&&(e.j41(0,"ng-option",27)(1,"span",28),e.EFF(2),e.nrm(3,"pi",29),e.EFF(4,"Image"),e.k0s()()),2&r){const o=l.$implicit;e.Y8G("value",o.guidanceId),e.R7$(2),e.JRh(o.text)}}let As=(()=>{var r;class l{constructor(t,n,i,a){this.elem=t,this.aiUploadImageService=n,this.aiPhotoService=i,this.aiWrapperRemoveBgService=a,this.guidanceItems=[{guidanceId:48,text:"Edge"},{guidanceId:49,text:"Depth"},{guidanceId:52,text:"Pose"}],this.selectImageGuide=new e.bkB,this.disabled=!0,this.buttonText="Upload",this.strength=50,this.guidanceId=48,this.controlText="Guides the AI in replicating the shape of edges found in the reference image, ensuring the new image mirrors the structural composition of your reference image."}ngOnInit(){this.aiPhotoService.selectedGuidance.thumbUrl&&(this.disabled=!1,this.buttonText="Replace",this.guidanceId=this.aiPhotoService.selectedGuidance.guidanceId),this.strength=parseInt((100*this.aiPhotoService.selectedGuidance.strength).toFixed())}delete(){this.disabled=!0,this.guidanceId=48,this.buttonText="Upload",this.strength=0,this.aiPhotoService.selectedGuidance.thumbUrl=null,this.aiPhotoService.selectedGuidance.guidanceId=0,this.aiPhotoService.selectedGuidance.text="",this.aiPhotoService.selectedGuidance.width=0,this.aiPhotoService.selectedGuidance.height=0,setTimeout(()=>{this.strength=50,this.aiPhotoService.selectedGuidance.strength=this.strength/100})}onFileUploaded(t){if(!t)return;this.aiPhotoService.inProgress=!1;const n=t[0],i={fromEditor:"header",tab:h.Fs.TextToImage,from:"",subTool:h.do.Text};this.aiWrapperRemoveBgService.removeBgResult=null,this.aiUploadImageService.aiUploadImage(n,i).then(a=>{if("cancel"==a)this.buttonText="Upload";else{this.disabled=!1,this.strength=0,this.buttonText="Replace";const d=this.guidanceItems.filter(g=>g.guidanceId==this.guidanceId)[0].text;this.aiPhotoService.selectedGuidance.guidanceId=this.guidanceId,this.aiPhotoService.selectedGuidance.text=d,this.aiPhotoService.selectedGuidance.thumbUrl=a.imgUrl,this.aiPhotoService.selectedGuidance.width=a.width,this.aiPhotoService.selectedGuidance.height=a.height,setTimeout(()=>{this.strength=50,this.aiPhotoService.selectedGuidance.strength=this.strength/100}),this.selectImageGuide.emit(!1)}})}replaceImage(t){this.aiPhotoService.inProgress||t.click()}inputWeight(t,n){let i;i=t.newValue||0===t.newValue?t.newValue:t,this.strength=i,this.aiPhotoService.selectedGuidance.strength=this.strength/100}changeDrop(t){let n="";48==t?(n="Edge",this.controlText="Guides the AI in replicating the shape of edges found in the reference image, ensuring the new image mirrors the structural composition of your reference image."):49==t?(n="Depth",this.controlText="Guides the AI to maintain the spatial dynamics of the reference image and replicate the depth i.e. foreground-background relationship in the reference image."):52==t&&(n="Pose",this.controlText="Guides the AI to replicate the pose of a person in the reference image. Recommended for use when the reference image includes a human subject."),this.aiPhotoService.selectedGuidance.guidanceId=t,this.aiPhotoService.selectedGuidance.text=n}documentClick(t){this.elem.nativeElement.contains(t.target)||"guidance"!=t.target.parentElement.id&&this.selectImageGuide.emit({close:!0})}}return(r=l).\u0275fac=function(t){return new(t||r)(e.rXU(e.aKT),e.rXU(G.M),e.rXU(U.s),e.rXU(ee))},r.\u0275cmp=e.VBU({type:r,selectors:[["ai-image-guidance-popover"]],hostBindings:function(t,n){1&t&&e.bIt("click",function(a){return n.documentClick(a)},!1,e.EBC)},outputs:{selectImageGuide:"selectImageGuide"},decls:28,vars:35,consts:[["file",""],[1,"d-flex","w-100","flex-column","imageGuidancePopUp"],[1,"d-flex","align-items-center","justify-content-between","w-100","h-40","mt-1","mb-1"],[1,"text-normal","ms-3","text-semi"],["class","deleteBtn me-3",3,"click",4,"ngIf"],[1,"d-flex","w-100","flex-column","ai-editor-view"],[1,"ai-thumb-view","d-flex","align-items-center","justify-content-center","w-100",3,"ngClass"],[3,"src",4,"ngIf"],[1,"replace-btn",3,"ngClass"],[1,"btn","btn-white","text-13","btn-h40",3,"click"],["id","fileInputId","name","fileInputId","type","file",1,"custom-file-input","d-none",3,"change","click","accept"],[1,"d-flex","w-100","prompt-list","flex-column","pe-3","pb-3",3,"ngClass"],[1,"d-flex","align-items-center","mb-3","ps-3","pt-3",3,"ngClass"],[1,"select-menu","seedSectionDropDown",2,"width","-webkit-fill-available",3,"ngModelChange","change","ngModel","searchable","clearable"],[3,"value",4,"ngFor","ngForOf"],[1,"card-body"],[1,"ps-3"],[1,"text-13","text-semi","text-dark"],[1,"text-sm","mt-1"],[1,"d-flex","mt-1","ps-3"],[1,"wp-100","d-flex","align-items-center",3,"ngClass"],[1,"opacity-slider",2,"width","100%",3,"change","slideStop","value","min","max","step"],[1,"ml-9",3,"ngClass"],["type","text","numberSettings","","maxlength","3","mask","separator.2","separatorLimit","100",1,"form-control","form-input-sm","text-normal","text-black","bg-transparent",2,"border","1p
1x solid rgb(226, 227, 233, 0.8)",3,"ngModelChange","min","max","allowNegativeNumbers","ngModel"],[1,"deleteBtn","me-3",3,"click"],["name","deletecommon",1,"f-24"],[3,"src"],[3,"value"],[1,"d-inline-flex","f-13","text-semi","align-items-center"],["name","arrowguidedrop",1,"ms-1","me-1"]],template:function(t,n){if(1&t){const i=e.RV6();e.j41(0,"div",1)(1,"div",2)(2,"span",3),e.EFF(3,"Image Guidance"),e.k0s(),e.DNE(4,ks,2,0,"span",4),e.k0s(),e.j41(5,"div",5)(6,"div",6),e.DNE(7,Rs,1,1,"img",7),e.j41(8,"div",8)(9,"button",9),e.bIt("click",function(){e.eBV(i);const d=e.sdS(12);return e.Njj(n.replaceImage(d))}),e.EFF(10),e.k0s(),e.j41(11,"input",10,0),e.bIt("change",function(d){return e.eBV(i),e.Njj(n.onFileUploaded(d.srcElement.files))})("click",function(){e.eBV(i);const d=e.sdS(12);return e.Njj(d.value="")}),e.k0s()()()(),e.j41(13,"div",11)(14,"div",12)(15,"ng-select",13),e.mxI("ngModelChange",function(d){return e.eBV(i),e.DH7(n.guidanceId,d)||(n.guidanceId=d),e.Njj(d)}),e.bIt("change",function(d){return e.eBV(i),e.Njj(n.changeDrop(d))}),e.DNE(16,Us,5,2,"ng-option",14),e.k0s()(),e.j41(17,"div",15)(18,"div",16)(19,"span",17),e.EFF(20,"Control Weight"),e.k0s(),e.j41(21,"p",18),e.EFF(22),e.k0s()(),e.j41(23,"div",19)(24,"div",20)(25,"mv-slider",21),e.bIt("change",function(d){return e.eBV(i),e.Njj(n.inputWeight(d,!1))})("slideStop",function(d){return e.eBV(i),e.Njj(n.inputWeight(d,!0))}),e.k0s()(),e.j41(26,"div",22)(27,"input",23),e.bIt("ngModelChange",function(d){return e.eBV(i),e.Njj(n.inputWeight(d,!0))}),e.k0s()()()()()()}2&t&&(e.R7$(4),e.Y8G("ngIf",null==n.aiPhotoService||null==n.aiPhotoService.selectedGuidance?null:n.aiPhotoService.selectedGuidance.guidanceId),e.R7$(2),e.Y8G("ngClass",e.eq3(23,Ss,!(null!=n.aiPhotoService&&null!=n.aiPhotoService.selectedGuidance&&n.aiPhotoService.selectedGuidance.thumbUrl))),e.R7$(),e.Y8G("ngIf",null==n.aiPhotoService||null==n.aiPhotoService.selectedGuidance?null:n.aiPhotoService.selectedGuidance.thumbUrl),e.R7$(),e.Y8G("ngClass",e.eq3(25,Ts,!(null!=n.aiPhotoService&&null!=n.aiPhotoService.selectedGuidance&&n.aiPhotoService.selectedGuidance.thumbUrl))),e.R7$(2),e.JRh(n.buttonText),e.R7$(),e.Y8G("accept",n.aiUploadImageService.fileImageAccept),e.R7$(2),e.Y8G("ngClass",e.eq3(27,Ds,""==(null==n.aiPhotoService?null:n.aiPhotoService.selectedGuidance.thumbUrl)||null==(null==n.aiPhotoService?null:n.aiPhotoService.selectedGuidance.thumbUrl))),e.R7$(),e.Y8G("ngClass",e.eq3(29,Ye,""==(null==n.aiPhotoService?null:n.aiPhotoService.selectedGuidance.thumbUrl)||null==(null==n.aiPhotoService?null:n.aiPhotoService.selectedGuidance.thumbUrl))),e.R7$(),e.R50("ngModel",n.guidanceId),e.Y8G("searchable",!1)("clearable",!1),e.R7$(),e.Y8G("ngForOf",n.guidanceItems),e.R7$(6),e.JRh(n.controlText),e.R7$(2),e.Y8G("ngClass",e.eq3(31,Ye,""==(null==n.aiPhotoService?null:n.aiPhotoService.selectedGuidance.thumbUrl)||null==(null==n.aiPhotoService?null:n.aiPhotoService.selectedGuidance.thumbUrl))),e.R7$(),e.Y8G("value",n.strength)("min",0)("max",100)("step",1),e.R7$(),e.Y8G("ngClass",e.eq3(33,Ye,""==(null==n.aiPhotoService?null:n.aiPhotoService.selectedGuidance.thumbUrl)||null==(null==n.aiPhotoService?null:n.aiPhotoService.selectedGuidance.thumbUrl))),e.R7$(),e.Y8G("min",0)("max",100)("allowNegativeNumbers",!1)("ngModel",n.strength))},dependencies:[s.YU,s.Sq,s.bT,Oe.I,u.me,u.BC,u.tU,u.vS,X.vr,X.xt,Ce.d1,Es.Zr,L.b],styles:[".ai-thumb-view[_ngcontent-%COMP%]{background:url(https://static.lightxeditor.com/assets/images/tranparent.png);height:134px;position:relative;overflow:hidden;-webkit-user-select:none;user-select:none}.ai-thumb-view[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:100%;width:auto;object-fit:contain;overflow:hidden}.ai-thumb-view[_ngcontent-%COMP%]:hover .replace-btn[_ngcontent-%COMP%]{display:flex;z-index:99;position:absolute;background:#0006;align-items:center;justify-content:center;height:100%;width:100%;flex-direction:column}.ai-thumb-view[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%]{display:none}.ai-thumb-view[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{background:#fff!important;border:0px!important;color:#272b34!important;min-width:124px}.ai-thumb-view[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{background:linear-gradient(0deg,#626adf0d 0% 100%),#fff!important;color:#272b34}.ai-thumb-view[_ngcontent-%COMP%] .add-on-404[_ngcontent-%COMP%]{display:flex;z-index:99;position:absolute;background:#0000001a;align-items:center;justify-content:center;height:100%;width:100%;flex-direction:column}.deleteBtn[_ngcontent-%COMP%]{background:none;border-radius:12px;width:40px;height:40px;cursor:pointer;display:flex;align-items:center;justify-content:center}.deleteBtn[_ngcontent-%COMP%]:hover{background:#626adf0d}.form-control[_ngcontent-%COMP%]:disabled{color:#b0b3bf!important;border:1px solid #E2E3E9!important}.opacity-3[_ngcontent-%COMP%]{opacity:.3}"]}),l})();var Bs=c(87757);const Gs=["customPromptTextArea"],js=["ngSelect"],gt=r=>({"ai-thumb-active":r});function Fs(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",33)(1,"div",34)(2,"video",35,3),e.bIt("click",function(){const n=e.eBV(o).$implicit,i=e.sdS(3),a=e.XpG().$implicit,d=e.XpG(3);return e.Njj(d.selectImage(n,a.productId,i))}),e.k0s()(),e.j41(4,"span",36),e.EFF(5),e.k0s()()}if(2&r){const o=l.$implicit,t=e.XpG(4),n=e.sdS(10);e.Y8G("ngClass",e.eq3(5,gt,o.productImageId==t.productImageId)),e.R7$(2),e.Y8G("src",o.videoThumbUrl,e.B4B)("ngbPopover",n)("muted","muted"),e.R7$(3),e.JRh(o.displayName)}}function Ns(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",33)(1,"div",34)(2,"video",35,3),e.bIt("click",function(){const n=e.eBV(o).$implicit,i=e.sdS(3),a=e.XpG(2).$implicit,d=e.XpG(3);return e.Njj(d.selectImage(n,a.productId,i))}),e.k0s()(),e.j41(4,"span",36),e.EFF(5),e.k0s()()}if(2&r){const o=l.$implicit,t=e.XpG(5),n=e.sdS(10);e.Y8G("ngClass",e.eq3(5,gt,o.productImageId==t.productImageId)),e.R7$(2),e.Y8G("src",o.videoThumbUrl,e.B4B)("ngbPopover",n)("muted","muted"),e.R7$(3),e.JRh(o.displayName)}}function Ls(r,l){if(1&r&&(e.j41(0,"div",28)(1,"div",29),e.DNE(2,Ns,6,7,"div",30),e.k0s()()),2&r){const o=e.XpG().$implicit;e.R7$(2),e.Y8G("ngForOf",o.storeProductImages.slice(2))}}function Ws(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",20),e.bIt("shown",function(){const n=e.eBV(o).index,i=e.XpG(3);return e.Njj(i.onAccItemToggle("illus-panel-"+n,!0))}),e.j41(1,"div",21)(2,"div",22)(3,"button",23)(4,"h5",24),e.EFF(5),e.k0s()(),e.j41(6,"button",25)(7,"span",26),e.EFF(8,"See less"),e.k0s(),e.j41(9,"span",27),e.EFF(10,"See all"),e.k0s()()(),e.j41(11,"div",28)(12,"div",29),e.DNE(13,Fs,6,7,"div",30),e.k0s()()(),e.j41(14,"div",31)(15,"div",32),e.DNE(16,Ls,3,1,"ng-template"),e.k0s()()()}if(2&r){const o=l.$implicit;
1e.Mz_("ngbAccordionItem","illus-panel-",l.index,""),e.R7$(5),e.JRh(o.displayName),e.R7$(8),e.Y8G("ngForOf",o.storeProductImages.slice(0,2))}}function Vs(r,l){if(1&r&&(e.j41(0,"div",17)(1,"div",18),e.DNE(2,Ws,17,4,"div",19),e.k0s()()),2&r){const o=e.XpG(2);e.R7$(),e.Y8G("closeOthers",!0),e.R7$(),e.Y8G("ngForOf",o.products)}}function Xs(r,l){1&r&&(e.qex(0),e.nrm(1,"element-placeholder",37),e.bVm()),2&r&&(e.R7$(),e.Y8G("view","AiPatterns"))}function Ks(r,l){if(1&r&&(e.qex(0),e.j41(1,"div",9)(2,"div",10),e.nrm(3,"app-file-upload",11),e.k0s(),e.j41(4,"div",12)(5,"div",13),e.EFF(6,"Presets"),e.nrm(7,"pi",14),e.k0s(),e.j41(8,"div",15),e.DNE(9,Vs,3,2,"div",16)(10,Xs,2,1,"ng-container",7),e.k0s()()(),e.bVm()),2&r){const o=e.XpG();e.R7$(3),e.Y8G("toolName",o.toolName),e.R7$(6),e.Y8G("ngIf",null==o.products?null:o.products.length),e.R7$(),e.Y8G("ngIf",!(null!=o.products&&o.products.length))}}function $s(r,l){if(1&r){const o=e.RV6();e.j41(0,"ai-image-guidance-popover",38),e.bIt("selectPrompt",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.selectPrompt(n))}),e.k0s()}}function Ys(r,l){if(1&r){const o=e.RV6();e.j41(0,"ai-prompts-popover",39),e.bIt("selectPrompt",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.selectPrompt(n))}),e.k0s()}if(2&r){const o=e.XpG();e.Y8G("items",o.prompts)}}function zs(r,l){if(1&r){const o=e.RV6();e.j41(0,"ai-video-preview",40),e.mxI("muteChange",function(n){e.eBV(o);const i=e.XpG();return e.DH7(i.mute,n)||(i.mute=n),e.Njj(n)}),e.k0s()}if(2&r){const o=e.XpG();e.Y8G("url",o.videoPreviewUrl),e.R50("mute",o.mute)}}let qs=(()=>{var r;class l{constructor(t,n,i,a,d,g,m,b,O){this.mediaContentService=t,this.toast=n,this.aiPhotoService=i,this.authService=a,this.createPopupService=d,this.aiUploadImageService=g,this.paymentService=m,this.subsService=b,this.route=O,this.productImageId=0,this.tabId=2,this.genImageEvent=new e.bkB,this.FileImageEvent=new e.bkB,this.btnText="Generate",this.disabled=!0,this.placeHolder="Imagine anything, type it",this.isFocused=!1,this.pageNumber=0,this.quality=1,this.qtText="Normal",this.isNgPrompt=!1,this.isNgPromptFocus=!1,this.negativePrompt="",this.prompts=[],this.isSeedEnabled=!1,this.imageproductId=2,this.AiImageProducts=[{productId:1,tabName:"skachtoimage",displayName:"Text"},{productId:2,tabName:"text2image",displayName:"Image"},{productId:3,tabName:"text2text",displayName:"Sketch"}],this.buttonText="Upload Image",this.inProgress=!1,this.mute=!1,this.toolName=h.Fs.FaceAnimate,this.imgStrength=50,this.user=this.authService.currentUser(),this.loggedInObserver=this.authService.loggedIn.subscribe(E=>{this.user=this.authService.currentUser()}),this.updateBehaviorUserAiConis=this.authService.updateBehaviorUserAiConis.subscribe(E=>{this.user=this.authService.currentUser(),E&&setTimeout(()=>{},200)}),this.usrPropChangedObserver=this.authService.usrPropChanged.subscribe(E=>{this.user=this.authService.currentUser(),E&&this.authService.updateUserAiConis(()=>{})}),this.usrAICreditChanged=this.authService.usrAICreditChanged.subscribe(E=>{this.user=this.authService.currentUser(),E&&this.authService.updateUserAiConis(()=>{})})}ngOnInit(){this.getCategoryDetails(),this.checkVideoStatus(),this.configSubs=this.paymentService.configUpdated.subscribe(()=>{this.quality=this.paymentService?.config?.creditInfo?.aifaceanimate||this.paymentService.config?.aiFaceAnimateCredits,this.configSubs&&this.configSubs.unsubscribe()})}onAccItemToggle(t,n){n&&setTimeout(()=>{document.getElementById(t)?.scrollIntoView({behavior:"smooth",block:"center"})},100)}selectImage(t,n,i){this.disabled=!1,t?(this.videoPreviewUrl=t.imgUrl,this.productId=n,this.productImageId=t.productImageId,this.selectedStyle=t,this.manualTrigger(i)):(this.productImageId=0,this.selectedStyle=this.noneProduct),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}getCategoryDetails(){this.mediaContentService.getCategoryProductDetails(A.KK.FACEANIMATION,this.pageNumber,t=>{if(this.isLoaded=!0,t&&t.body&&!this.products&&t.body.storeProducts&&(this.products=t.body.storeProducts,this.selectedStyle=this.noneProduct={productImageId:0,imageJson:"",isGenerated:!1,id:1},this.aiPhotoService.queryParams?._sId)){const n=this.products.storeProductImages.filter(i=>i.displayName==this.aiPhotoService.queryParams?._sId)[0];n&&(this.selectedStyle=n,this.productImageId=this.selectedStyle?.productImageId)}},t=>{this.isLoaded=!0})}inputStrength(t,n){let i;i=t.newValue||0===t.newValue?t.newValue:t,this.imgStrength=i}generate(){if(!this.aiPhotoService.isCancel||this.aiPhotoService.imgUrl)if(this.aiPhotoService.imgUrl){if(this.inProgress||!this.selectedStyle)return;if(this.user&&this.user.remainingCoins>
1=this.quality){const t={imageUrl:this.aiPhotoService.imgUrl,featureType:this.toolName,...this.selectedStyle&&this.selectedStyle.item&&this.selectedStyle.item.imageJson&&{textPrompt:this.selectedStyle.item.imageJson},isCustomPrompt:1,productImageId:this.productImageId,productId:this.productId};this.aiPhotoService.inVideoProgress=this.inProgress=!0,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),this.aiPhotoService.generateImage(t,n=>{if(n&&n.assetId){this.toast.showErrorSingle(x.b.message.videoGenMsg,1e4);const i=0;n.featureType=this.toolName,n.toolName=x.b.label.text2Video,this.aiPhotoService.checkStatus(n,i,a=>{a&&a.urls&&a.urls.length>0?(this.user.remainingCoins=a.remainingCalls,this.aiPhotoService.isDirty=!0,this.aiPhotoService.inVideoProgress=this.inProgress=!1,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),this.selectedStyle&&this.selectedStyle.item&&(this.selectedStyle.item.isGenerated=!0)):(this.inProgress=!1,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle))},a=>{this.displayErrorMsg(a)},!0)}else this.displayErrorMsg(n)},n=>{this.displayErrorMsg(n)})}else this.aiPhotoService.openAICreditPopup(()=>{this.user=this.authService.currentUser(),this.generate()},this.quality,"video")}else this.inProgress=!0,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),this.aiPhotoService.updateImageUrl(this.aiPhotoService.originalTextImgUrl,h.Fs.TextToImage,"image").then(t=>{this.aiPhotoService.queryParams=this.route.snapshot.queryParams,this.aiPhotoService.imgUrl=t.imgUrl,this.generate()}).catch(()=>{this.aiPhotoService.inProgress=!1,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),this.toast.showErrorSingle(x.b.message.uploadNewImage)});else this.toast.showErrorSingle(x.b.message.uploadNewImage)}displayErrorMsg(t=null){this.aiPhotoService.inVideoProgress=!1,this.inProgress=!1;let n=t?.description;this.createPopupService.openWarningDialog("Error",n),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}ngOnDestroy(){this.loggedInObserver&&this.loggedInObserver.unsubscribe(),this.usrPropChangedObserver&&this.usrPropChangedObserver.unsubscribe(),this.usrAICreditChanged&&this.usrAICreditChanged.unsubscribe(),this.updateBehaviorUserAiConis&&this.updateBehaviorUserAiConis.unsubscribe(),this.imageUploadChnage&&this.imageUploadChnage.unsubscribe()}changePrompt(){}focusOut(t=1){1==t?this.isFocused=!1:this.isNgPromptFocus=!1}focusIn(t=1){1==t?this.isFocused=!0:this.isNgPromptFocus=!0}inputQualityChange(t){this.quality=t.newValue||0===t.newValue?t.newValue:t,setTimeout(()=>{this.user.remainingCoins<3&&(3==this.quality&&2==this.user.remainingCoins?this.quality=2:this.user.remainingCoins<=1&&(2==this.quality||3==this.quality)&&(this.quality=1),this.qtText=this.aiPhotoService.getQtText(this.qual
1ity))}),this.qtText=this.aiPhotoService.getQtText(this.quality)}toggleButton(t){this.isNgPrompt=t}toggleSeed(t){this.isSeedEnabled=t}selectPrompt(t){this.aiPhotoService.imgToVideoPrompt=t.prompt,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}generatedSketchImage(t){this.genImageEvent.emit(t)}selectAiImageTab(t){this.tabId=t.productId,this.imageproductId=t.productId}onFileUploaded(t){t&&(this.FileImageEvent.emit(t),this.inProgress=!1)}replaceImage(t){this.inProgress||t.click()}checkVideoStatus(){const t=JSON.parse(localStorage.getItem("generationDetails"));if(t){const n=new Date(t.createdDate),i=new Date(n.setMinutes(n.getMinutes()+60));"init"==t.status&&!this.aiPhotoService.inVideoProgress&&i>new Date&&(this.aiPhotoService.inVideoProgress=this.inProgress=!0,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle),this.aiPhotoService.checkStatus(t,0,()=>{this.aiPhotoService.inVideoProgress=this.inProgress=!1,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)},d=>{this.displayErrorMsg(d)},!0))}}mouseenter(t){this.videoPreviewUrl=t}manualTrigger(t){this.popOver&&this.popOver.close(),this.popOver=t,this.popOver.open()}}return(r=l).\u0275fac=function(t){return new(t||r)(e.rXU(te.Z),e.rXU(C.f),e.rXU(U.s),e.rXU(N.u),e.rXU(Q.A),e.rXU(G.M),e.rXU(K.W),e.rXU(se.n),e.rXU(y.nX))},r.\u0275cmp=e.VBU({type:r,selectors:[["face-animator-drawer"]],viewQuery:function(t,n){if(1&t&&(e.GBs(Gs,5),e.GBs(js,5)),2&t){let i;e.mGM(i=e.lsd())&&(n.customPromptTextArea=i.first),e.mGM(i=e.lsd())&&(n.ngSelect=i.first)}},inputs:{aiPhotoheader:"aiPhotoheader",tabId:"tabId"},outputs:{genImageEvent:"genImageEvent",FileImageEvent:"FileImageEvent"}
1,decls:11,vars:5,consts:[["popImageGuidance",""],["popContent",""],["popVideoPreview",""],["popOver","ngbPopover"],[1,"w-100"],[1,"pane-section","aiImageGen","w-100"],[1,"scroll-content","drawer-elements","ai-drawer-elements","w-100"],[4,"ngIf"],[3,"btnClick","disabled","btnText","credit","isVideo"],[1,"pb-8"],[1,"d-flex","w-100","flex-column"],[3,"toolName"],[1,"card","ps-3","pe-3","pt-2","border-0"],[1,"d-flex","align-items-center","w-100","h-32","text-normal","text-dark","text-semi","lh-125"],["name","helpicon","placement","right","popoverClass","pop-for-tooltip","ngbPopover","Choose from a collection of predefined artistic effects and aesthetics that can be applied to your generated video.","triggers","mouseenter:mouseleave","popoverTitle","Presets","container","body",1,"ms-1","hw-24","help-icon"],[1,"d-flex","backgound-content","mt-2"],["class","d-flex w-100 pane-section flex-column",4,"ngIf"],[1,"d-flex","w-100","pane-section","flex-column"],["ngbAccordion","",3,"closeOthers"],["class","tab-div m-0 p-0 border-radius-0",3,"ngbAccordionItem","shown",4,"ngFor","ngForOf"],[1,"tab-div","m-0","p-0","border-radius-0",3,"shown","ngbAccordionItem"],["ngbAccordionHeader",""],[1,"d-flex","align-items-center","mb-1","space-between"],["type","button",1,"btn-acc-title","pe-none",2,"width","auto !important"],[1,"m-0","btn","btn-link","card-title","text-13","text-dark",2,"margin-left","0px !important"],["type","button","ngbAccordionButton","",1,"btn-collapse-expand","d-flex","align-items-center","border-radius-8","p-1","border-0","h-24"],[1,"collapse-text","text-11","grey-600"],[1,"expand-text","text-11","grey-600"],[1,"content"],[1,"ai-thumb-list","d-flex","align-items-center","justify-content-between"],["class","ai-thumb-col d-flex align-items-center flex-column",3,"ngClass",4,"ngFor","ngForOf"],["ngbAccordionCollapse",""],["ngbAccordionBody",""],[1,"ai-thumb-col","d-flex","align-items-center","flex-column",3,"ngClass"],[1,"img-col","d-flex","align-items-center","border-radius-12","mb-1"],["appPlayOnViewport","","disableRC","","width","115px","height","115px","triggers","manual","placement","right","autoClose","outside","container","body","popoverClass","video-preview-popover","autoplay","","loop","",3,"click","src","ngbPopover","muted"],[1,"w-100","text-center"],[2,"padding","0px 5px",3,"view"],[3,"selectPrompt"],[3,"selectPrompt","items"],[3,"muteChange","url","mute"]],template:function(t,n){if(1&t){const i=e.RV6();e.j41(0,"div",4)(1,"div",5)(2,"div",6),e.DNE(3,Ks,11,3,"ng-container",7),e.k0s()(),e.j41(4,"generate-button",8),e.bIt("btnClick",function(){return e.eBV(i),e.Njj(n.generate())}),e.k0s()(),e.DNE(5,$s,1,0,"ng-template",null,0,e.C5r)(7,Ys,1,1,"ng-template",null,1,e.C5r)(9,zs,1,2,"ng-template",null,2,e.C5r)}2&t&&(e.R7$(3),e.Y8G("ngIf",n.isLoaded),e.R7$(),e.Y8G("disabled",n.disabled)("btnText",n.btnText)("credit",n.quality)("isVideo",!0))},dependencies:[s.YU,s.Sq,s.bT,ae.n,Ve.G,ws.F,f.WP,f.r6,f.tW,f.x7,f.UA,f.$R,f.ZM,L.b,ue.k,As,Bs.n,re.P,ce],styles:[".ai-thumb-list[_ngcontent-%COMP%]{flex-flow:wrap}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%]{height:100%;width:112px;border-radius:8px;margin-bottom:16px;cursor:pointer;min-height:112px;min-width:112px}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%]{transition:transform .2s;min-height:112px;min-width:112px}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%] img[_ngcontent-%COMP%], .ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%] video[_ngcontent-%COMP%]{width:100%;height:100%;border-radius:8px!important}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#606576;font-size:12px;font-weight:400}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] .none-column[_ngcontent-%COMP%]{width:112px;height:112px;transition:transform .2s}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] .none-column[_ngcontent-%COMP%] .none-variation[_ngcontent-%COMP%]{background:linear-gradient(90deg,#f3deffb3 -4%,#e0e2ffb3);width:100%;height:112px;border-radius:12px}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] .none-column[_ngcontent-%COMP%] .none-variation[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:40px;height:40px;padding:0}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] .none-column[_ngcontent-%COMP%] .none-variation[_ngcontent-%COMP%] img[_ngcontent-%COMP%]:hover{transform:none}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] .none-column[_ngcontent-%COMP%]:hover{transform:scale(1.03)}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%]{min-height:112px;min-width:112px}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%]{transition:transform .2s}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%] img[_ngcontent-%COMP%], .ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%] video[_ngcontent-%COMP%]{border-radius:14px!important;border:2px solid #626ADF;padding:3.5px;transition:transform .2s}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%]:hover{transform:none}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#626adf;font-weight:600}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] .none-column[_ngcontent-%COMP%]{width:112px;height:112px;border-radius:12px;border:2px solid #626ADF;padding:3px;transition:transform .2s}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] .none-column[_ngcontent-%COMP%] .none-variation[_ngcontent-%COMP%]{background:linear-gradient(90deg,#f3deffb3 -4%,#e0e2ffb3);width:100%;height:100%;border-radius:8px}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] .none-column[_ngcontent-%COMP%] .none-variation[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:40px;height:40px;border:none!important;padding:0}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] .none-column[_ngcontent-%COMP%] .none-variation[_ngcontent-%COMP%] img[_ngcontent-%COMP%]:hover{transform:none}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] .none-column[_ngcontent-%COMP%]:hover{transform:scale(1.03)}"]}),l})();function Hs(r,l){if(1&r){const o=e.RV6();e.qex(0),e.j41(1,"ai-shoot",10),e.mxI("autoGenerateChange",function(n){e.eBV(o);const i=e.XpG(2);return e.DH7(i.autoGenerate,n)||(i.autoGenerate=n),e.Njj(n)}),e.k0s(),e.bVm()}if(2&r){const o=e.XpG(2);e.R7$(),e.Y8G("featureType",o.toolName)("toolDisplayName",o.toolDisplayName),e.R50("autoGenerate",o.autoGenerate),e.Y8G("isVideo",!0)}}
1function Js(r,l){1&r&&e.nrm(0,"text-to-video-drawer")}function Qs(r,l){1&r&&e.nrm(0,"image-to-video-drawer")}function Zs(r,l){1&r&&e.nrm(0,"face-animator-drawer")}function ea(r,l){1&r&&(e.qex(0),e.DNE(1,Js,1,0,"text-to-video-drawer",11)(2,Qs,1,0,"image-to-video-drawer",11)(3,Zs,1,0,"face-animator-drawer",11),e.bVm()),2&r&&(e.R7$(),e.Y8G("ngSwitchCase","text2video"),e.R7$(),e.Y8G("ngSwitchCase","image2video"),e.R7$(),e.Y8G("ngSwitchCase","aifaceanimate"))}function ta(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",3)(1,"div",4)(2,"pi",5),e.bIt("click",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.back())}),e.k0s(),e.j41(3,"span",6),e.EFF(4),e.k0s()(),e.j41(5,"div")(6,"div",7),e.qex(7,8),e.DNE(8,Hs,2,4,"ng-container",9)(9,ea,4,3,"ng-container",9),e.bVm(),e.k0s()()()}if(2&r){const o=e.XpG();e.R7$(4),e.JRh(o.toolDisplayName),e.R7$(),e.ZvI("middle-drawer ",o.toolName,""),e.R7$(2),e.Y8G("ngSwitch",o.toolName),e.R7$(),e.Y8G("ngIf",1==o.isDynamicTool),e.R7$(),e.Y8G("ngIf",0==o.isDynamicTool)}}let na=(()=>{var r;class l{constructor(t,n,i,a,d,g,m){this.aiPhotoService=t,this.aiUploadImageService=n,this.toast=i,this.route=a,this.modalService=d,this.aiWrapperRemoveBgService=g,this.editorService=m,this.toolDisplayName=null,this.toolName=null,this.isDynamicTool=0,this.isLoaded=!1,this.autoGenerate=!1,this.activeToolPanelSubscription=this.editorService.activeToolPanel.subscribe(b=>{if(b?.toolName&&b?.toolName!=this.toolName){const O=this.aiPhotoService.getToolByName(b?.toolName,J.sv.AI_VIDEO_TOOLS)||{metadata:{featureType:b?.toolName}};O&&setTimeout(()=>{this.selectTool(O)},200)}})}ngOnInit(){if(this.toolName=this.aiPhotoService?.queryParams?.toolName||null,this.aiPhotoService.imgToVideoPrompt=this.aiPhotoService?.queryParams?.tp||"",this.autoGenerate=this.aiPhotoService?.queryParams?.autoGenerate||!1,this.toolName){const t=this.aiPhotoService.getToolByName(this.toolName,J.sv.AI_VIDEO_TOOLS)||{metadata:{featureType:this.toolName}};t&&(this.selectTool(t),this.isLoaded=!0)}}selectTool(t){this.isDynamicTool=t?.metadata?.isDynamic||0,this.toolName=t?.metadata?.featureType,this.aiPhotoService.selectedTool=this.toolName,this.toolDisplayName=t?.text||"AI "+this.toolName,this.aiPhotoService.sampleImageUrl=t?.metadata?.sampleImageUrl||""}reset(){this.toolName=null,this.toolDisplayName=null,this.aiPhotoService.sampleImageUrl="",this.isLoaded=!1}back(){this.reset()}ngOnDestroy(){this.aiPhotoService.deleteQueryParam("toolName"),this.activeToolPanelSubscription&&this.activeToolPanelSubscription.unsubscribe()}}return(r=l).\u0275fac=function(t){return new(t||r)(e.rXU(U.s),e.rXU(G.M),e.rXU(C.f),e.rXU(y.nX),e.rXU(f.Bq),e.rXU(ee),e.rXU(k.x))},r.\u0275cmp=e.VBU({type:r,selectors:[["video-tools-drawer"]],decls:3,vars:2,consts:[[1,"drawer-content",3,"hidden"],[3,"selectToolEvent"],["class","tools-container-drawer",4,"ngIf"],[1,"tools-container-drawer"],[1,"top-section","d-flex","align-items-center","bg-white","ps-3","pe-3"],["name","leftarrow",1,"back-icon","me-2","f-24","d-flex","align-items-center","justify-content-center","pointer","border-radius-8",3,"click"],[1,"text-lg","text-dark","text-semi","lh-125"],["customScrollDir","",1,"drawer-scroll","scroll-container"],[3,"ngSwitch"],[4,"ngIf"],[3,"autoGenerateChange","featureType","toolDisplayName","autoGenerate","isVideo"],[4,"ngSwitchCase"]],template:function(t,n){1&t&&(e.j41(0,"div",0)(1,"tool-list-drawer",1),e.bIt("selectToolEvent",function(a){return n.selectTool(a)}),e.k0s()(),e.DNE(2,ta,10,7,"div",2)),2&t&&(e.Y8G("hidden",n.toolName),e.R7$(2),e.Y8G("ngIf",n.toolName))},dependencies:[s.bT,s.ux,s.e1,w.q,L.b,Me.F,Is,ys,qs,ke.x],styles:[".child-drawer[_ngcontent-%COMP%]{position:absolute;top:0;width:100%;height:0px;opacity:0;transform:translateY(-20px);transition:transform .5s ease-in-out,opacity .5s ease-in-out}.drawer-active[_ngcontent-%COMP%]{height:100%;opacity:1;transform:translateY(0)}.tools-container-drawer[_ngcontent-%COMP%]{height:100%}.tools-container-drawer[_ngcontent-%COMP%] .top-section[_ngcontent-%COMP%]{height:56px;z-index:99;-webkit-user-select:none;user-select:none;min-height:56px}
1.tools-container-drawer[_ngcontent-%COMP%] .top-section[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{font-size:14px!important;color:#272b34;line-height:19.07px}.tools-container-drawer[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%], .tools-container-drawer[_ngcontent-%COMP%] .aifilter[_ngcontent-%COMP%]{padding-top:56px}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%]{user-select:none;-webkit-user-select:none;height:calc(100vh - 193px - var(--sales-height))}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .scroll-container[_ngcontent-%COMP%]::-webkit-scrollbar-track{margin-top:0}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .ai-thumb-view[_ngcontent-%COMP%]{border-radius:12px;background:#eeedf3;height:134px;position:relative;overflow:hidden;-webkit-user-select:none;user-select:none}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .ai-thumb-view[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:100%;width:auto;object-fit:contain;overflow:hidden}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .ai-thumb-view[_ngcontent-%COMP%]:hover .replace-btn[_ngcontent-%COMP%]{display:flex;z-index:99;position:absolute;background:#0006;align-items:center;justify-content:center;height:100%;width:100%;border-radius:12px;flex-direction:column}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .ai-thumb-view[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%]{display:none}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .ai-thumb-view[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{background:#fff!important;border:0px!important;color:#272b34!important;min-width:124px}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .ai-thumb-view[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{background:linear-gradient(0deg,#626adf0d 0% 100%),#fff!important;color:#272b34}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .ai-thumb-view[_ngcontent-%COMP%] .add-on-404[_ngcontent-%COMP%]{display:flex;z-index:99;position:absolute;background:#0000001a;align-items:center;justify-content:center;height:100%;width:100%;border-radius:12px;flex-direction:column}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%]{border-radius:12px;background:#efeef2;height:134px;position:relative;overflow:hidden;-webkit-user-select:none;user-select:none}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-left[_ngcontent-%COMP%], .tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-right[_ngcontent-%COMP%]{width:132px;height:134px;overflow:hidden;cursor:pointer}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-left[_ngcontent-%COMP%] img[_ngcontent-%COMP%], .tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-right[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:contain}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-left[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%], .tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-right[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%]{display:none}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-left[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%], .tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-right[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{background:#fff!important;border:0px!important;color:#272b34!important;min-width:120px}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-left[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover, .tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-right[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{background:linear-gradient(0deg,#626adf0d 0% 100%),#fff!important;color:#272b34}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-left[_ngcontent-%COMP%] .add-on-404[_ngcontent-%COMP%], .tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-right[_ngcontent-%COMP%] .add-on-404[_ngcontent-%COMP%]{display:flex;z-index:99;position:absolute;background:#0000001a;align-items:center;justify-content:center;height:100%;width:100%;flex-direction:column}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-left[_ngcontent-%COMP%]:hover pi[_ngcontent-%COMP%], .tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-left[_ngcontent-%COMP%]:hover span[_ngcontent-%COMP%], .tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-right[_ngcontent-%COMP%]:hover pi[_ngcontent-%COMP%], .tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-right[_ngcontent-%COMP%]:hover span[_ngcontent-%COMP%]{color:#272b34!important}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-left[_ngcontent-%COMP%]:hover .replace-btn[_ngcontent-%COMP%], .tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-right[_ngcontent-%COMP%]:hover .replace-btn[_ngcontent-%COMP%]{display:flex;z-index:99;position:absolute;background:#0006;align-items:center;justify-content:center;height:100%;width:100%;flex-direction:column}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-left[_ngcontent-%COMP%]{width:131px;border-radius:12px 0 0 12px}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-left[_ngcontent-%COMP%]:hover{background:linear-gradient(90deg,#626adf00,#626adf1a),#efeef2}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-right[_ngcontent-%COMP%]{width:131px;border-radius:0 12px 12px 0}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-right[_ngcontent-%COMP%]:hover{background:linear-gradient(270deg,#626adf00,#626adf1a),#efeef2}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .bg-white[_ngcontent-%COMP%]{background:#fff!important}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer.photoshoot-drawer[_ngcontent-%COMP%]{padding-top:112px!important}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer.top-section-p[_ngcontent-%COMP%]{height:calc(100vh - 193px - var(--sales-height))}.tools-container-drawer[_ngcontent-%COMP%] .imageanimate.middle-drawer.top-section-p.isresolution-add[_ngcontent-%COMP%], .tools-container-drawer[_ngcontent-%COMP%] .imageanimate.middle-drawer.top-section-p[_ngcontent-%COMP%]{height:calc(100vh - 120px - var(--sales-height))}.tools-container-drawer[_ngcontent-%COMP%] .credit-description[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:inline-flex;color:#272b34;font-size:12px}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer.top-section-p[_ngcontent-%COMP%]{padding-top:52px!important}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer.isresolution-add[_ngcontent-%COMP%], .tools-container-drawer[_ngcontent-%COMP%] .middle-drawer.text2video[_ngcontent-%COMP%], .tools-container-drawer[_ngcontent-%COMP%] .middle-drawer.image2video[_ngcontent-%COMP%], .tools-container-drawer[_ngcontent-%COMP%] .middle-drawer.top-section-p.isresolution-add[_ngcontent-%COMP%]{height:calc(100vh - 235px - var(--sales-height))}.wrapper-for-timeline[_ngcontent-%COMP%] .main-content[_ngcontent-%COMP%] .blank-section[_ngcontent-%COMP%]{flex-direction:column;-webkit-user-select:none;user-select:none}.wrapper-for-timeline[_ngcontent-%COMP%] .main-content[_ngcontent-%COMP%] .blank-section[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px;color:#272b34}"]}),l})();var pt=c(86820),oa=c(77616);const ia=["masonry"];function ra(r,l){if(1&r&&(e.j41(0,"ng-option",17)(1,"div",18)(2,"span"),e.EFF(3),e.k0s()()()),2&r){const o=l.$implicit;e.Y8G("value",o),e.R7$(3),e.JRh(o.displayName)}}function sa(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",19)(1,"buttons-scroll-menu",20),e.bIt("selectMenu",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.selectProductTag(n))}),e.k0s()()}if(2&r){const o=e.XpG();e.R7$(),e.Y8G("items",o.storeProducts)("type","productshowcase")("aiPhotoService",o.aiPhotoService)("categoryId",o.selectedTagId)}}function aa(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",26),e.bIt("click",function(){e.eBV(o);const n=e.XpG().$implicit;return e.XpG().copyTextToClipboard(n,n.imageJson),e.Njj(n.iscopy=!0)}),e.j41(1,"span",27),e.nrm(2,"pi",28),e.k0s(),e.j41(3,"span",29),e.nrm(4,"pi",30),e.k0s()()}if(2&r){const o=e.XpG().$implicit;e.Y8G("ngClass",null!=o&&o.iscopy?"copyBtn-active":"")}}function ca(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",21)(1,"picture",22),e.nrm(2,"source",23),e.nI1(3,"imgwebp"),e.j41(4,"img",24),e.bIt("click",function(){const n=e.eBV(o).$implicit,i=e.XpG();return e.Njj(i.openInsprrationsEditDialog(n))}),e.k0s()(),e.DNE(5,aa,5,1,"div",25),e.k0s()}if(2&r){const o=l.$implicit,t=l.index,n=e.XpG();e.xc7("width",n.imageWidth,"px")("height",n.calculateHeight(o),"px")("left",null==n.imagePositions[t]?null:n.imagePositions[t].left,"px")("top",null==n.imagePositions[t]?null:n.imagePositions[t].top,"px"),e.R7$(2),e.FS9("srcset",e.bMT(3,11,o.hrThumbUrl||o.imgUrl)),e.R7$(2),e.FS9("srcset",o.hrThumbUrl||o.imgUrl),e.R7$(),e.Y8G("ngIf",o.imageJson)}}function la(r,l){1&r&&(e.j41(0,"div",14),e.nrm(1,"element-placeholder",31),e.k0s()),2&r&&(e.R7$(),e.Y8G("view","massory"))}let da=(()=>{var r;class l{constructor(t,n,i,a,d,g){this.mediaContentService=t,this.authService=n,this.activeModal=i,this.modalService=a,this.gtmService=d,this.toasterService=g,this.iscopy=!1,this.searchTerm="",this.stockImages=[],this.stockImagePageNumber=0,this.stockImagePageEnd=!1,this.isImageProgress=!1,this.pageSize=20,this.inProgress=!1,this.selectedProduct=[],this.ProductType=[],this.trackByIndex=(m,b)=>m,this.imagePositions=[],this.imageWidth=250,this.gap=16,this.columnCount=4,this.columnHeights=[],this.notCloseAfterLogin=!0,this.qual
1ityReso={1:1,2:.75,3:1.3333,7:.6641,8:1.5059,9:.5625,10:1.7778,11:1,12:.7556,13:.6667,14:.5333,15:1.3213,16:1.5,17:1.875,18:.5647,19:1.7708,20:.7534,21:1.3273,22:1.5,23:.6667},this.isLoaded=!1,this.pageNumber=0,this.storeProducts=[],this.productName="",this.selectedTagId=0,this.isDataLoading=!1,this.user=this.authService.currentUser(),this.loggedInObserver=this.authService.loggedIn.subscribe(m=>{this.user=this.authService.currentUser()}),this.usrPropChangedObserver=this.authService.usrPropChanged.subscribe(m=>{this.user=this.authService.currentUser()})}ngOnDestroy(){this.stockImages=[],this.stockImagePageNumber=0,this.stockImagePageEnd=!1,this.imagePositions=[],this.selectedTagId=0,this.loggedInObserver&&this.loggedInObserver.unsubscribe(),this.usrPropChangedObserver&&this.usrPropChangedObserver.unsubscribe()}ngAfterViewInit(){setTimeout(()=>{this.updateColumnCount()},100)}ngOnInit(){if(this.ProductType.length>0){let t=this.ProductType.filter(n=>n.productId==this.selectedProductId)[0];this.selectProduct(t||this.ProductType[0])}}selectProductTag(t){this.stockImagePageNumber=0,this.stockImages=[],this.stockImagePageEnd=!1,this.selectedTagId=t.tagId?t.tagId:0,this.getTemplateByProductId()}selectProduct(t){this.productName=t?.displayName,this.resetImages(),this.selectedProductId=t.productId?t.productId:0,this.getTemplateTagByProductId(this.selectedProductId)}getTemplateTagByProductId(t){this.isDataLoading=!0,this.mediaContentService.getProductTagWithId(t,n=>{if(n.tags&&n.tags.length>0){let i=[];i=Number(this.selectedTagId)?n.tags.filter(a=>a.tagId!=this.selectedTagId):n.tags,this.storeProducts=i,this.storeProducts.length>0&&this.selectedTagId<=0&&(this.selectedTagId=this.storeProducts[0]?.tagId?this.storeProducts[0]?.tagId:0,this.getTemplateByProductId())}this.isDataLoading=!1},n=>{this.storeProducts=[],this.isDataLoading=!1})}onResize(){this.updateColumnCount(),this.layoutImages()}layoutImages(){this.columnHeights=Array(this.columnCount).fill(0),this.imagePositions=[],this.stockImages.forEach(n=>{const i=this.calculateHeight(n),a=this.columnHeights.indexOf(Math.min(...this.columnHeights));this.imagePositions.push({left:a*(this.imageWidth+this.gap),top:this.columnHeights[a]}),this.columnHeights[a]+=i+this.gap});const t=Math.max(...this.columnHeights);this.masonryRef.nativeElement.style.height=`${t}px`}updateColumnCount(){const t=this.masonryRef.nativeElement.clientWidth;this.columnCount=t<=480?2:t<=768?3:t<=1024||t<=1280?4:t<=1600?5:7,this.columnHeights=Array(this.columnCount).fill(0),this.imageWidth=(t-this.columnCount*this.gap)/this.columnCount}resetImages(){this.stockImagePageNumber=0,this.stockImages=[],this.stockImagePageEnd=!1,this.imagePositions=[],this.selectedTagId=0,this.storeProducts=[]}
1calculateHeight(t){return 1/this.qualityReso[Number(t.quality||t.aspect)]*this.imageWidth}getTemplateByProductId(){!this.selectedProductId||this.selectedProductId<=0?this.toasterService.showError("Product ID is not configured."):(this.isImageProgress=!0,this.mediaContentService.getTemplateByProductV2Id(this.selectedProductId,this.stockImagePageNumber,t=>{let n=t.storeProductImages;n&&n.length>0?(n.length<this.pageSize&&(this.stockImagePageEnd=!0),this.stockImages=this.stockImages.concat(n)):this.stockImagePageEnd=!1,setTimeout(()=>{this.isImageProgress=!1},200),this.layoutImages()},t=>{this.isImageProgress=!1},this.selectedTagId))}scrollImageEnd(){!this.stockImagePageEnd&&!this.isImageProgress&&this.stockImages.length>0&&(this.stockImagePageNumber=this.stockImagePageNumber+1,this.getTemplateByProductId())}refreshSearch(){this.searchTerm=""}openInsprrationsEditDialog(t){this.gtmService.pushTag({eventName:x.b.gtm.eventname.aiRemixClick,itemName:"Inspirations Popup",itemType:this.productName}),t.productName=this.productName,t.productId=this.selectedProductId;const i=this.modalService.open(Qe.h,{centered:!0,size:"xxl",backdrop:"static",windowClass:"ai-design-editor-dialog inspiration-dialog"});this.aiPhotoService.isCompareEnable=!1,this.aiPhotoService.inspirationImgUrl=t.imgUrl,this.aiPhotoService.compareImageUrl=t.imgUrl,i.componentInstance.activeTool=h.Fs.AiDesign,i.componentInstance.activeImgObj=t,i.componentInstance.aiPhotoService=this.aiPhotoService,i.result.then(a=>{})}copyTextToClipboard(t,n){const i=document.createRange(),a=window.getSelection(),d=document.createElement("span");d.textContent=n,document.body.appendChild(d),i.selectNode(d),a?.removeAllRanges(),a?.addRange(i),document.execCommand("copy"),document.body.removeChild(d),a?.removeAllRanges(),setTimeout(()=>{t.iscopy=!1},3e3)}}return(r=l).\u0275fac=function(t){return new(t||r)(e.rXU(te.Z),e.rXU(N.u),e.rXU(f.Lw),e.rXU(f.Bq),e.rXU(v.y),e.rXU(C.f))},r.\u0275cmp=e.VBU({type:r,selectors:[["Inspirations-dialog"]],viewQuery:function(t,n){if(1&t&&e.GBs(ia,5),2&t){let i;e.mGM(i=e.lsd())&&(n.masonryRef=i.first)}},hostBindings:function(t,n){1&t&&e.bIt("resize",function(){return n.onResize()},!1,e.tSv)},inputs:{selectedProductId:"selectedProductId",aiPhotoService:"aiPhotoService",ProductType:"ProductType"},decls:17,vars:12,consts:[["masonry",""],[1,"modal-header","border-0"],["type","button","aria-hidden","close",1,"close",3,"click"],["name","close",1,"f-30"],[1,"p-4","pb-0","pt-0","mb-10","d-flex","align-items-center","w-100"],[1,"d-inline-flex","align-items-center","justify-content-center","me-3"],["bindLabel","displayName","bindValue","productId",1,"w-100","c-ng-select","float-select",3,"ngModelChange","change","searchable","clearable","ngModel","virtualScroll"],[3,"value",4,"ngFor","ngForOf"],[1,"d-flex","align-items-center","overflow-hidden","w-100"],[1,"row","justify-content-between","align-items-center","overflow-hidden","cat-right-panel"],[1,"w-100"],["class","top-float-btn tags-listing-col listing-col-design mt-1 mb-1 inspirationDialog","id","top-float-btn",4,"ngIf"],[1,"container-fluid","modal-inner-content","position-absolute","pe-0","ps-3","inspirationDialogScroll",2,"width","calc(100% - 4px)"],["id","scroll-adjuster","customScrollDir","","infiniteScroll","",1,"is-popover-b","scroll-container","pb-3","pt-3",3,"scrolled","scrollWindow","infiniteScrollDistance","infiniteScrollUpDistance","infiniteScrollThrottle"],[1,"masonry"],["class","item pointer d-flex ",3,"width","height","left","top",4,"ngFor","ngForOf"],["class","masonry",4,"ngIf"],[3,"value"],[1,""],["id","top-float-btn",1,"top-float-btn","tags-listing-col","listing-col-design","mt-1","mb-1","inspirationDialog"],[1,"mt-1","mb-1","m-tab-scroll","tags-listing",3,"selectMenu","items","type","aiPhotoService","categoryId"],[1,"item","pointer","d-flex"],["loading","lazy"],["type","image/webp",3,"srcset"],["alt","Thumbnail","onerror","errImage(this)",3,"click","srcset"],["class","position-absolute copyBtn hw-32 d-flex align-items-center justify-content-center","style","right: 8px; bottom: 8px;",3,"ngClass","click",4,"ngIf"],[1,"position-absolute","copyBtn","hw-32","d-flex","align-items-center","justify-content-center",2,"right","8px","bottom","8px",3,"click","ngClass"],[1,"span-1"],["name","copyprompt",1,"f-24","text-white"],[1,"span-2"],["name","tick",1,"f-24","text-white"],[3,"view"]],template:function(t,n){if(1&t){const i=e.RV6();e.j41(0,"div",1)(1,"button",2),e.bIt("click",function(){return e.eBV(i),e.Njj(n.activeModal.dismiss())}),e.nrm(2,"pi",3),e.k0s()(),e.j41(3,"div",4)(4,"div",5)(5,"ng-select",6),e.mxI("ngModelChange",function(d){return e.eBV(i),e.DH7(n.selectedProductId,d)||(n.selectedProductId=d),e.Njj(d)}),e.bIt("change",function(d){return e.eBV(i),e.Njj(n.selectProduct(d))}),e.DNE(6,ra,4,2,"ng-option",7),e.k0s()(),e.j41(7,"div",8)(8,"div",9)(9,"div",10),e.DNE(10,sa,2,4,"div",11),e.k0s()()()(),e.j41(11,"div",12)(12,"div",13),e.bIt("scrolled",function(){return e.eBV(i),e.Njj(n.scrollImageEnd())}),e.j41(13,"div",14,0),e.DNE(15,ca,6,13,"div",15)(16,la,2,1,"div",16),e.k0s()()()}2&t&&(e.R7$(5),e.Y8G("searchable",!1)("clearable",!1),e.R50("ngModel",n.selectedProductId),e.Y8G("virtualScroll",!1),e.R7$(),e.Y8G("ngForOf",n.ProductType),e.R7$(4),e.Y8G("ngIf",!n.isDataLoading),e.R7$(2),e.Y8G("scrollWindow",!1)("infiniteScrollDistance",.5)("infiniteScrollUpDistance",2)("infiniteScrollThrottle",50),e.R7$(3),e.Y8G("ngForOf",n.stockImages),e.R7$(),e.Y8G("ngIf",n.isImageProgress))},dependencies:[s.YU,s.Sq,s.bT,ae.n,w.q,u.BC,u.vS,L.b,X.vr,X.xt,Pe.B,pt.D,oa.m],styles:[".custom-image-main[_ngcontent-%COMP%] img[_ngcontent-%COMP%]:hover{outline:2px solid #475ae7}.powered-by[_ngcontent-%COMP%]{position:absolute;z-index:99;bottom:20px;width:149px;height:32px;border-radius:12px;right:20px}.item[_ngcontent-%COMP%]{break-inside:avoid;margin-bottom:1rem;border-radius:8px;overflow:hidden;box-shadow:0 2px 8px #0000001a}.item[_ngcontent-%COMP%] pi[_ngcontent-%COMP%]{visibility:hidden}.item[_ngcontent-%COMP%]:hover .copyBtn[_ngcontent-%COMP%]{background:#4a4f5e66;border-radius:8px}.item[_ngcontent-%COMP%]:hover .copyBtn[_ngcontent-%COMP%]:hover{background:#959aa766}.item[_ngcontent-%COMP%]:hover .copyBtn[_ngcontent-%COMP%] .span-1[_ngcontent-%COMP%]{display:flex}.item[_ngcontent-%COMP%]:hover .copyBtn[_ngcontent-%COMP%] .span-2[_ngcontent-%COMP%], .item[_ngcontent-%COMP%]:hover .copyBtn-active[_ngcontent-%COMP%] .span-1[_ngcontent-%COMP%]{display:none}.item[_ngcontent-%COMP%]:hover .copyBtn-active[_ngcontent-%COMP%] .span-2[_ngcontent-%COMP%]{display:flex}.item[_ngcontent-%COMP%]:hover pi[_ngcontent-%COMP%]{visibility:visible}.item[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%;height:auto;display:block;border-radius:8px}.placeholder[_ngcontent-%COMP%]{margin-bottom:1rem;border-radius:8px;background:#a09faf;max-height:300px;width:100%;height:100%;
1min-width:200px;min-height:200px}.masonry[_ngcontent-%COMP%]{width:100%;margin:0 auto;position:relative;padding:16px;box-sizing:border-box;min-height:100px}.item[_ngcontent-%COMP%]{position:absolute!important;overflow:hidden}.item[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%;height:auto;display:block;object-fit:cover}.remixBtnDiv[_ngcontent-%COMP%]{opacity:0;transition:opacity .3s ease;background:#00000080}.item[_ngcontent-%COMP%]:hover .remixBtnDiv[_ngcontent-%COMP%]{opacity:1}.btn[_ngcontent-%COMP%]{padding:8px 16px;font-size:13px;color:#272b34;background:#fff;border:none;cursor:pointer}.btn-primary[_ngcontent-%COMP%]{padding:10px 20px;font-size:14px;color:#fff;background:#007bff;border:none;border-radius:4px;cursor:pointer}.btn-primary[_ngcontent-%COMP%]:disabled{background:#6c757d;cursor:not-allowed}.text-center[_ngcontent-%COMP%]{text-align:center;margin-top:16px}@media (max-width: 1024px){.masonry[_ngcontent-%COMP%]{width:750px}}@media (max-width: 768px){.masonry[_ngcontent-%COMP%]{width:500px}}@media (max-width: 480px){.masonry[_ngcontent-%COMP%]{width:250px}}"]}),l})();var _a=c(32764);const ga=["customPromptTextArea"],pa=(r,l,o)=>({"info-up":r,"info-blue":l,"info-red":o}),ma=r=>({"d-none":r});function ha(r,l){if(1&r&&(e.j41(0,"span",9),e.EFF(1),e.k0s()),2&r){const o=e.XpG();e.R7$(),e.Lme("",o.aiPhotoService.textPrompt.length,"/",o.maxLenght,"")}}function ua(r,l){if(1&r&&(e.j41(0,"div",15)(1,"span",16),e.EFF(2),e.k0s()()),2&r){const o=e.XpG().$implicit;e.FS9("ngbTooltip",o.prompt),e.R7$(2),e.SpI("+ ",o.prompt,"")}}function Pa(r,l){if(1&r&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&r){const o=e.XpG().$implicit;e.R7$(),e.SpI("+ ",o.prompt,"")}}function fa(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",12),e.bIt("click",function(){const n=e.eBV(o).$implicit,i=e.XpG(2);return e.Njj(i.applyPrompt(n.prompt))}),e.DNE(1,ua,3,2,"div",13)(2,Pa,2,1,"span",14),e.k0s()}if(2&r){const o=l.$implicit,t=e.XpG(2);e.R7$(),e.Y8G("ngIf",t.getLengthWithoutSpaces(o.prompt)>=36),e.R7$(),e.Y8G("ngIf",!(t.getLengthWithoutSpaces(o.prompt)>=36))}}function ba(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",10),e.bIt("click",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.applyPrompt(""))}),e.DNE(1,fa,3,2,"div",11),e.nI1(2,"slice"),e.k0s()}if(2&r){const o=e.XpG();e.Y8G("ngClass",e.eq3(6,ma,o.aiPhotoService.textPrompt.length>0&&!o.isFocused||o.isFocused)),e.R7$(),e.Y8G("ngForOf",e.brH(2,2,o.prompts,0,3))}}let Ca=(()=>{var r;class l{constructor(t){this.aiPhotoService=t,this.selectedFont="",this.showPromptList=!0,this.lean=!1,this.disabled=!1,this.isFocused=!1,this.isNgPromptFocus=!1,this.textareaHeight=96,this.minHeight=96,this.maxHeight=280,this.startY=0,this.startHeight=96,this.onResizeMove=n=>{const i=n instanceof TouchEvent?n.touches[0]?.clientY??0:n.clientY;this.textareaHeight=Math.min(this.maxHeight,Math.max(this.minHeight,this.startHeight+(i-this.startY)));const a=this.customPromptTextArea?.nativeElement.closest(".textarea-col");a&&(a.style.height=`${this.textareaHeight+28}px`)},this.onResizeEnd=()=>{document.removeEventListener("mousemove",this.onResizeMove),document.removeEventListener("touchmove",this.onResizeMove),document.removeEventListener("mouseup",this.onResizeEnd),document.removeEventListener("touchend",this.onResizeEnd)},this.prompts=[{prompt:"A cute Persian cat"},{prompt:"A furry Dog"},{prompt:"A girl with Noodle hair"}],this.maxLenght=2e3,this.isFontAvailable=!0,this.genBtn=new e.bkB}ngOnChanges(t){this.changePrompt()}changePrompt(){this.disabled=!(this.aiPhotoService.textPrompt&&this.aiPhotoService.textPrompt.trim().length>1||this.aiPhotoService.selectedGuidance.thumbUrl),this.genBtn.emit(this.disabled)}hidePrompts(){this.showPromptList=!1}showPromptsWithDelay(){setTimeout(()=>{this.showPromptList=!0},200)}applyPrompt(t){""!=t&&(this.aiPhotoService.textPrompt=t),setTimeout(()=>{this.customPromptTextArea.nativeElement.focus(),this.customPromptTextArea.nativeElement.setSelectionRange(this.customPromptTextArea.nativeElement.value.length,this.customPromptTextArea.nativeElement.value.length)}),this.changePrompt()}startResize(t){t.preventDefault(),t.stopPropagation(),this.startY=t instanceof TouchEvent?t.touches[0]?.clientY??0:t.clientY,this.startHeight=this.textareaHeight,document.addEventListener("mousemove",this.onResizeMove),document.addEventListener("touchmove",this.onResizeMove,{passive:!1}),document.addEventListener("mouseup",this.onResizeEnd),document.addEventListener("touchend",this.onResizeEnd)}focusOut(t=1){this.isFocused=!1}focusIn(t=1){this.isFocused=!0}getLengthWithoutSpaces(t){return t?t.replace(/\s/g,"").length:0}ngOnDestroy(){this.onResizeEnd()}}return(r=l).\u0275fac=function(t){return new(t||r)(e.rXU(U.s))},r.\u0275cmp=e.VBU({type:r,selectors:[["prompt-box"]],viewQuery:function(t,n){if(1&t&&e.GBs(ga,5),2&t){let i;e.mGM(i=e.lsd())&&(n.customPromptTextArea=i.first)}},inputs:{selectedFont:"selectedFont",prompts:"prompts"},outputs:{genBtn:"genBtn"},features:[e.OA$],decls:9,vars:13,consts:[["customPromptTextArea",""],[1,"prompt-view"],[1,"textarea-col","position-relative",3,"ngClass"],[1,"prompt-animation-wrap"],["id","cprompt","name","cprompt","rows","4","cols","50","placeholder","Imagine anything, type it",1,"prompt-text",3,"ngModelChange","blur","focus","maxlength","ngModel"],["class","prompt-info text-regular position-absolute d-flex align-items-center justify-content-start",4,"ngIf"],["title","Drag to resize",1,"prompt-resize-handle",3,"mousedown","touchstart"],["aria-hidden","true",1,"prompt-resize-grip"],["class","suggestion-prompt position-absolute d-inline-flex flex-column",3,"ngClass","click",4,"ngIf"],[1,"prompt-info","text-regular","position-absolute","d-flex","align-items-center","justify-content-start"],[1,"suggestion-prompt","position-absolute","d-inline-flex","flex-column",3,"click","ngClass"],["class","ps-2 pe-2 text-12 border-radius-12 text-truncate pointer mb-1 inner-div",3,"click",4,"ngFor","ngForOf"],[1,"ps-2","pe-2","text-12","border-radius-12","text-truncate","pointer","mb-1","inner-div",3,"click"],["class","overflow-hidden text-truncate","tooltipClass","tooltip-custom-all for-prompt-tip","placement","right","container","body",3,"ngbTooltip",4,"ngIf"],[4,"ngIf"],["tooltipClass","tooltip-custom-all for-prompt-tip","placement","right","container","body",1,"overflow-hidden","text-truncate",3,"ngbTooltip"],[1,""]],template:function(t,n){if(1&t){const i=e.RV6();e.j41(0,"div",1)(1,"div",2)(2,"div",3)(3,"textarea",4,0),e.mxI("ngModelChange",function(d){return e.eBV(i),e.DH7(n.aiPhotoService.textPrompt,d)||(n.aiPhotoService.textPrompt=d),e.Njj(d)}),e.bIt("ngModelChange",function(){return e.eBV(i),e.Njj(n.changePrompt())})("blur",function(){return e.eBV(i),e.Njj(n.focusOut())})("focus",function(){return e.eBV(i),e.Njj(n.focusIn())}),e.k0s()(),e.DNE(5,ha,2,2,"span",5),e.j41(6,"div",6),e.bIt("mousedown",function(d){return e.eBV(i),e.Njj(n.startResize(d))})("touchstart",function(d){return e.eBV(i),e.Njj(n.startResize(d))}),e.nrm(7,"span",7),e.k0s(),e.DNE(8,ba,3,8,"div",8),e.k0s()()}2&t&&(e.R7$(),e.Y8G("ngClass",e.sMw(9,pa,n.aiPhotoService.textPrompt.length,n.isFocused,n.aiPhotoService.textPrompt.length==n.maxLenght)),e.R7$(2),e.xc7("height",n.textareaHeight,"px"),e.AVh("blue-active",n.isFocused),e.Y8G("maxlength",n.maxLenght),e.R50("ngModel",n.aiPhotoService.textPrompt),e.R7$(2),e.Y8G("ngIf",n.aiPhotoService.textPrompt.length),e.R7$(3),e.Y8G("ngIf",n.showPromptList))},dependencies:[s.YU,s.Sq,s.bT,u.me,u.BC,u.tU,u.vS,f.md,s.P9],styles:['.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]{width:100%;height:124px;border-radius:12px;background:linear-gradient(90deg,#fc5cff05 -4%,#2520f605);padding:.9px 4px 4px}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#c9cad4 -4% 100%);-webkit-mask:linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%) content-box,linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%);-webkit-mask-composite:xor;mask-composite:exclude;z-index:1}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]:hover:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#606576 -4% 100%);-webkit-mask:linear-gradient(90deg,#606576 -4%,#606576 100%) content-box,linear-gradient(90deg,#606576 -4%,#606576 100%);-webkit-mask-composite:xor;mask-composite:exclude;z-index:1}.prompt-view[_ngcontent-%COMP%] .prompt-animation-wrap[_ngcontent-%COMP%]{position:relative;width:100%;height:calc(100% - 18px)}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{resize:none;outline:none;width:100%;min-height:96px;max-height:320px;padding:8px;font-size:12px;color:#b0b3bf;border:0px;background:transparent;line-height:18px;position:relative;z-index:2;box-sizing:border-box}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar{width:4px;height:4px;border-radius:12px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-track{border-radius:12px;margin-top:8px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#d5d7dd;border-radius:12px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:#afb4c2}.prompt-view[_ngcontent-%COMP%] .prompt-info[_ngcontent-%COMP%]{font-size:11px;color:#959aa7;margin-top:0;padding-left:8px;height:24px;line-height:normal;width:calc(100% - 8px);bottom:4px;z-index:99;pointer-events:none}.info-up[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#c9cad4 -4% 100%)!important;-webkit-mask:linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%) content-box,linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-blue[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff0d -4%,#2520f60d)!important}.info-blue[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#fc5cff -4%,#2520f6)!important;-webkit-mask:linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%) content-box,linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-blue[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#626adf!important}.info-red[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff0d -4%,#2520f60d)!important}.info-red[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#f25555 -4% 100%)!important;-webkit-mask:linear-gradient(90deg,#F25555 -4%,#F25555 100%) content-box,linear-gradient(90deg,#F25555 -4%,#F25555 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-red[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#f25555!important}.prompt-text[_ngcontent-%COMP%]{color:#272b34!important}.prompt-text[_ngcontent-%COMP%]::placeholder{color:#606576!important}.prompt-resize-handle[_ngcontent-%COMP%]{position:absolute;
1left:50%;bottom:0;transform:translate(-50%);width:40px;height:8px;display:flex;align-items:center;justify-content:center;cursor:ns-resize;z-index:100;-webkit-user-select:none;user-select:none;touch-action:none}.prompt-resize-grip[_ngcontent-%COMP%]{position:relative;width:24px;height:2px;border-radius:1px;background:#b0b3bf;pointer-events:none}.prompt-resize-handle[_ngcontent-%COMP%]:hover .prompt-resize-grip[_ngcontent-%COMP%], .prompt-resize-handle[_ngcontent-%COMP%]:active .prompt-resize-grip[_ngcontent-%COMP%]{background:#4a4f5e}.suggestion-prompt[_ngcontent-%COMP%]{left:4px;bottom:8px;width:-webkit-fill-available;z-index:2}.suggestion-prompt[_ngcontent-%COMP%] div.inner-div[_ngcontent-%COMP%]{height:22px;background:#626adf0d;color:#4d55d2;width:fit-content;display:inline-block!important;line-height:22px;max-width:calc(100% - 4px)}.suggestion-prompt[_ngcontent-%COMP%] div.inner-div[_ngcontent-%COMP%]:hover{background:#626adf1a}.suggestion-prompt[_ngcontent-%COMP%] div.inner-div[_ngcontent-%COMP%]:last-child{margin-bottom:0!important}']}),l})();const va=["popoverOpen"],Ia=["popStylesReferenc1"],xa=["customPromptTextArea"],Ma=["ngSelect"],Oa=["popOver1"],ya=["popOver2"],mt=r=>({"icon-rotate":r}),wa=r=>({"active-modal":r}),Ea=r=>({"active-resolution":r});function Sa(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",32)(1,"div",33)(2,"buttons-scroll-menu",34),e.bIt("selectLayout",function(n){e.eBV(o);const i=e.XpG(2);return e.Njj(i.selectFilterProd(n))}),e.k0s()()()}if(2&r){const o=e.XpG(2);e.R7$(2),e.Y8G("items",o.storeProducts)("leftscrollMrg",70)("type","aiFilter")("aiPhotoService",o.aiPhotoService)("categoryId",o.productId)}}function Ta(r,l){1&r&&(e.j41(0,"div",55),e.nrm(1,"span",56),e.k0s())}function Da(r,l){if(1&r&&e.nrm(0,"img",57),2&r){const o=e.XpG(3);e.Y8G("src",null==o.selectedStyle?null:o.selectedStyle.thumbUrl,e.B4B)}}function ka(r,l){if(1&r){const o=e.RV6();e.qex(0),e.j41(1,"div",35)(2,"div",36)(3,"div",37)(4,"div",38)(5,"div",39),e.EFF(6,"Enter Prompt"),e.j41(7,"pi",40),e.bIt("mouseenter",function(){e.eBV(o);const n=e.XpG(2);return e.Njj(n.hideStyleRefPopover())}),e.k0s()()(),e.nrm(8,"div"),e.j41(9,"prompt-box",41),e.bIt("genBtn",function(n){e.eBV(o);const i=e.XpG(2);return e.Njj(i.changePrompt(n))}),e.k0s()(),e.j41(10,"div",42)(11,"span",39),e.EFF(12,"Presets"),e.nrm(13,"pi",43),e.k0s()(),e.j41(14,"div",44)(15,"div",45,4),e.bIt("shown",function(){e.eBV(o);const n=e.XpG(2);return e.Njj(n.popoverOpen2=!0)})("hidden",function(){e.eBV(o);const n=e.XpG(2);return e.Njj(n.popoverOpen2=!1)})("mouseenter",function(){e.eBV(o);const n=e.XpG(2);return e.Njj(n.isselectedStylehover=!0)})("mouseleave",function(){e.eBV(o);const n=e.XpG(2);return e.Njj(n.isselectedStylehover=!1)}),e.j41(17,"div",46),e.DNE(18,Ta,2,0,"div",47),e.j41(19,"div",48),e.bIt("click",function(n){e.eBV(o);const i=e.XpG(2);return n.stopPropagation(),e.Njj(i.resetStyle())}),e.DNE(20,Da,1,1,"img",49),e.j41(21,"div",50),e.nrm(22,"pi",51),e.k0s()()(),e.j41(23,"div",52),e.EFF(24),e.k0s(),e.j41(25,"div",53),e.nrm(26,"pi",54),e.k0s()()()()(),e.bVm()}if(2&r){const o=e.XpG(2),t=e.sdS(22);e.R7$(9),e.Y8G("prompts",o.prompts),e.R7$(6),e.Y8G("autoClose","outside")("ngbPopover",t),e.R7$(2),e.Y8G("ngClass",null!=o.selectedStyle&&o.selectedStyle.thumbUrl?"add-border":"remove-border"),e.R7$(),e.Y8G("ngIf",!(o.productImageId&&o.productImageId>-1&&null!=o.selectedStyle&&o.selectedStyle.thumbUrl||null!=o.selectedStyle&&o.selectedStyle.thumbUrl)),e.R7$(2),e.Y8G("ngIf",o.productImageId&&o.productImageId>-1&&(null==o.selectedStyle?null:o.selectedStyle.thumbUrl)),e.R7$(),e.Y8G("ngClass",o.productImageId&&o.productImageId>-1&&null!=o.selectedStyle&&o.selectedStyle.thumbUrl&&o.isselectedStylehover?"d-block":"d-none"),e.R7$(3),e.SpI(" ",null!=o.selectedStyle&&o.selectedStyle.displayName?null==o.selectedStyle?null:o.selectedStyle.displayName:"None"," "),e.R7$(),e.Y8G("ngClass",e.eq3(9,mt,1==o.popoverOpen2))}}function Ra(r,l){1&r&&(e.j41(0,"div",55),e.nrm(1,"span",56),e.k0s())}function Ua(r,l){if(1&r&&e.nrm(0,"img",57),2&r){const o=e.XpG(4);e.Y8G("src",null==o.selectedStyle?null:o.selectedStyle.thumbUrl,e.B4B)}}function Aa(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",75)(1,"div",76)(2,"div",77)(3,"div",78)(4,"div",79)(5,"prompt-box",41),e.bIt("genBtn",function(n){e.eBV(o);const i=e.XpG(3);return e.Njj(i.changePrompt(n))}),e.k0s(),e.j41(6,"div",42)(7,"span",39),e.EFF(8,"Presets"),e.nrm(9,"pi",43),e.k0s()(),e.j41(10,"div",80)(11,"div",45,4),e.bIt("shown",function(){e.eBV(o);const n=e.XpG(3);return e.Njj(n.popoverOpen2=!0)})("hidden",function(){e.eBV(o);const n=e.XpG(3);return e.Njj(n.popoverOpen2=!1)})("mouseenter",function(){e.eBV(o);const n=e.XpG(3);return e.Njj(n.isselectedStylehover=!0)})("mouseleave",function(){e.eBV(o);const n=e.XpG(3);return e.Njj(n.isselectedStylehover=!1)}),e.j41(13,"div",46),e.DNE(14,Ra,2,0,"div",47),e.j41(15,"div",48),e.bIt("click",function(n){e.eBV(o);const i=e.XpG(3);return n.stopPropagation(),e.Njj(i.resetStyle())}),e.DNE(16,Ua,1,1,"img",49),e.j41(17,"div",50),e.nrm(18,"pi",51),e.k0s()()(),e.j41(19,"div",52),e.EFF(20),e.k0s(),e.j41(21,"div",53),e.nrm(22,"pi",54),e.k0s()()()()()()()()}if(2&r){const o=e.XpG(3),t=e.sdS(22);e.R7$(5),e.Y8G("prompts",o.prompts),e.R7$(6),e.Y8G("autoClose","outside")("ngbPopover",t),e.R7$(2),e.Y8G("ngClass",null!=o.selectedStyle&&o.selectedStyle.thumbUrl?"add-border":"remove-border"),e.R7$(),e.Y8G("ngIf",!(o.productImageId&&o.productImageId>-1&&null!=o.selectedStyle&&o.selectedStyle.thumbUrl||null!=o.selectedStyle&&o.selectedStyle.thumbUrl)),e.R7$(2),e.Y8G("ngIf",o.productImageId&&o.productImageId>-1&&(null==o.selectedStyle?null:o.selectedStyle.thumbUrl)),e.R7$(),e.Y8G("ngClass",o.productImageId&&o.productImageId>-1&&null!=o.selectedStyle&&o.selectedStyle.thumbUrl&&o.isselectedStylehover?"d-block":"d-none"),e.R7$(3),e.SpI(" ",null!=o.selectedStyle&&o.selectedStyle.displayName?null==o.selectedStyle?null:o.selectedStyle.displayName:"None"," "),e.R7$(),e.Y8G("ngClass",e.eq3(9,mt,1==o.popoverOpen2))}}function Ba(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",75)(1,"div",82)(2,"div",77)(3,"div",78)(4,"div",77)(5,"workflow-ui",83),e.mxI("productC
1onfigChange",function(n){e.eBV(o);const i=e.XpG(4);return e.DH7(i.productConfig,n)||(i.productConfig=n),e.Njj(n)}),e.bIt("productConfigChange",function(n){e.eBV(o);const i=e.XpG(4);return e.Njj(i.productConfigChange(n))}),e.k0s()()()()()()}if(2&r){const o=e.XpG(4);e.R7$(5),e.R50("productConfig",o.productConfig),e.Y8G("workflowList",o.workflowList)("inProgress",o.aiPhotoService.inProgress)}}function Ga(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",81),e.bIt("shown",function(){e.eBV(o);const n=e.XpG(3);return e.Njj(n.accPanelChanged({panelId:"panel-3",nextState:!0}))})("hidden",function(){e.eBV(o);const n=e.XpG(3);return e.Njj(n.accPanelChanged({panelId:"panel-3",nextState:!1}))}),e.j41(1,"div",62)(2,"div",63)(3,"button",64)(4,"div",65),e.EFF(5,"Workflow "),e.k0s()(),e.j41(6,"button",67)(7,"span",68),e.nrm(8,"pi",69),e.k0s(),e.j41(9,"span",70),e.nrm(10,"pi",71),e.k0s()()()(),e.j41(11,"div",72)(12,"div",73),e.DNE(13,Ba,6,3,"ng-template"),e.k0s()()()}if(2&r){const o=e.XpG(3);e.Y8G("collapsed","panel-3"!==o.activeAccPanelId)}}function ja(r,l){if(1&r){const o=e.RV6();e.qex(0),e.j41(1,"div",58)(2,"div",59)(3,"div",60)(4,"div",61),e.bIt("show",function(){e.eBV(o);const n=e.XpG(2);return e.Njj(n.accPanelChanged({panelId:"panel-1",nextState:!0}))})("hide",function(){e.eBV(o);const n=e.XpG(2);return e.Njj(n.accPanelChanged({panelId:"panel-1",nextState:!1}))}),e.j41(5,"div",62)(6,"div",63)(7,"button",64)(8,"div",65),e.EFF(9,"Enter Prompt"),e.nrm(10,"pi",66),e.k0s()(),e.j41(11,"button",67)(12,"span",68),e.nrm(13,"pi",69),e.k0s(),e.j41(14,"span",70),e.nrm(15,"pi",71),e.k0s()()()(),e.j41(16,"div",72)(17,"div",73),e.DNE(18,Aa,23,11,"ng-template"),e.k0s()()(),e.DNE(19,Ga,14,1,"div",74),e.k0s()()(),e.bVm()}if(2&r){const o=e.XpG(2);e.R7$(3),e.Y8G("closeOthers",!0),e.R7$(),e.Y8G("collapsed","panel-1"!==o.activeAccPanelId),e.R7$(15),e.Y8G("ngIf",o.productConfig)}}function Fa(r,l){if(1&r){const o=e.RV6();e.qex(0),e.j41(1,"div",20)(2,"div",21)(3,"div",22)(4,"div",23)(5,"pi",24),e.bIt("click",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.back())}),e.k0s(),e.j41(6,"span",25),e.EFF(7),e.k0s()(),e.j41(8,"button",26),e.bIt("click",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.openInsprrations())}),e.j41(9,"div",27),e.nrm(10,"div",28),e.j41(11,"div",29),e.nrm(12,"ei",30),e.EFF(13," Inspirations "),e.k0s()()()()(),e.DNE(14,Sa,3,5,"div",31),e.k0s(),e.DNE(15,ka,27,11,"ng-container",7)(16,ja,20,3,"ng-container",7),e.bVm()}if(2&r){const o=e.XpG();e.R7$(7),e.JRh(o.toolDisplayName),e.R7$(7),e.Y8G("ngIf",o.isLoaded),e.R7$(),e.Y8G("ngIf",!o.productConfig),e.R7$(),e.Y8G("ngIf",o.productConfig)}}function Na(r,l){1&r&&(e.j41(0,"div",84),e.EFF(1," Resolution "),e.k0s())}function La(r,l){if(1&r&&(e.j41(0,"ng-option",85)(1,"div",86)(2,"div",87),e.nrm(3,"pi",88),e.j41(4,"span",89),e.EFF(5),e.k0s(),e.j41(6,"span",90),e.EFF(7),e.k0s()(),e.j41(8,"span",91),e.EFF(9),e.k0s()()()),2&r){const o=l.$implicit;e.Y8G("value",o),e.R7$(3),e.Y8G("name",o.icon),e.R7$(2),e.JRh(o.name),e.R7$(2),e.JRh(o.ratio),e.R7$(2),e.SpI("",o.size," px")}}function Wa(r,l){1&r&&(e.j41(0,"div",92)(1,"span",93),e.EFF(2,"Loading..."),e.k0s()())}function Va(r,l){if(1&r){const o=e.RV6();e.j41(0,"ai-choose-styles",94),e.bIt("selectCustomImage",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.selectCustomImage(n))})("selectImage",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.selectImage(n))}),e.k0s()}if(2&r){const o=e.XpG();e.Y8G("productImageId",o.productImageId)("editorType","aidesign")("products",o.products)}}function Xa(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",100),e.bIt("click",function(){const n=e.eBV(o).$implicit,i=e.XpG(2);return e.Njj(i.selectModel(n))}),e.j41(1,"div",101)(2,"div",102)(3,"div",103),e.nrm(4,"img",104),e.k0s(),e.j41(5,"span",105),e.EFF(6),e.k0s()(),e.j41(7,"div",106)(8,"span",107),e.EFF(9),e.k0s()()(),e.j41(10,"div",108),e.nrm(11,"img",109),e.j41(12,"span",110),e.EFF(13),e.k0s()()()}if(2&r){const o=l.$implicit,t=e.XpG(2);e.Y8G("ngClass",e.eq3(5,wa,o.id==(null==t.selectedModel?null:t.selectedModel.id))),e.R7$(4),e.FS9("src",o.icon,e.B4B),e.R7$(2),e.JRh(o.displayName),e.R7$(3),e.JRh(o.desc),e.R7$(4),e.JRh(o.dCoin)}}function Ka(r,l){if(1&r&&(e.j41(0,"div",95)(1,"div",96)(2,"h3",97),e.EFF(3," Choose Model"),e.k0s(),e.j41(4,"span",98),e.EFF(5,"Select an AI image generation model that suit your results."),e.k0s()(),e.DNE(6,
1Xa,14,7,"div",99),e.k0s()),2&r){const o=e.XpG();e.R7$(6),e.Y8G("ngForOf",o.models)}}function $a(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",112),e.bIt("click",function(){const n=e.eBV(o).$implicit,i=e.XpG(2);return e.Njj(i.selectSize(n))}),e.j41(1,"div",113),e.nrm(2,"pi",114),e.j41(3,"span",115),e.EFF(4),e.k0s(),e.j41(5,"span",116),e.EFF(6),e.k0s()(),e.j41(7,"div",113)(8,"span",117),e.EFF(9),e.k0s()()()}if(2&r){const o=l.$implicit,t=e.XpG(2);e.Y8G("ngClass",e.eq3(5,Ea,o.qType==(null==t.selectedSize?null:t.selectedSize.qType))),e.R7$(2),e.FS9("name",o.icon),e.R7$(2),e.JRh(o.name),e.R7$(2),e.JRh(o.ratio),e.R7$(3),e.SpI("",o.size," px")}}function Ya(r,l){if(1&r&&(e.j41(0,"div",95)(1,"div",96)(2,"h3",97),e.EFF(3," Image Resolution"),e.k0s(),e.j41(4,"span",98),e.EFF(5,"Select the resolution."),e.k0s()(),e.DNE(6,$a,10,7,"div",111),e.k0s()),2&r){const o=e.XpG();e.R7$(6),e.Y8G("ngForOf",o.resolutions)}}let za=(()=>{var r;class l{constructor(t,n,i,a,d,g,m,b,O,E,Y,q,_e,ge){this.mediaContentService=t,this.renderer=n,this.aiPhotoService=i,this.authService=a,this.createPopupService=d,this.aiUploadImageService=g,this.paymentService=m,this.location=b,this.modalService=O,this.templateService=E,this.router=Y,this.route=q,this.workflowUIService=_e,this.editorService=ge,this.activeAccPanelId="panel-1",this.workflowList=[],this.categoryId=A.KK.AIDesign,this.popoverOpen1=!1,this.popoverOpen2=!1,this.productImageId=-1,this.AiImageProducts=[{productId:1,tabName:"skachtoimage",displayName:"Sketch"},{productId:2,tabName:"text2image",displayName:"Image"},{productId:3,tabName:"text2text",displayName:"Text"}],this.originalImageUrl="",this.buttonText="Upload Image",this.isCustomimage="",this.isCustom=!1,this.styleImageUrl="",this.tabId=2,this.genImageEvent=new e.bkB,this.btnText="Generate",this.disabled=!1,this.placeHolder="Imagine anything, type it",this.isFocused=!1,this.pageNumber=0,this.quality=1,this.qtText="Normal",this.isNgPrompt=!1,this.isNgPromptFocus=!1,this.negativePrompt="",this.prompts=[],this.isselectedStylehover=!1,this.isSeedEnabled=!1,this.isResolution=!1,this.productId=0,this.resolutions=[],this.models=[],this.expanded=!1,this.styleProductId=0,this.backEvent=new e.bkB,this.isWorksFlow=!1,this.styleclick=!1,this.storeProducts=[],this.productType=[],this.ProductRow=99,this.productName="",this.user=this.authService.currentUser(),this.loggedInObserver=this.authService.loggedIn.subscribe(z=>{this.user=this.authService.currentUser()}),this.updateBehaviorUserAiConis=this.authService.updateBehaviorUserAiConis.subscribe(z=>{this.user=this.authService.currentUser()}),this.usrPropChangedObserver=this.authService.usrPropChanged.subscribe(z=>{this.user=this.authService.currentUser(),z&&this.authService.updateUserAiConis(()=>{})}),this.usrAICreditChanged=this.authService.usrAICreditChanged.subscribe(z=>{this.user=this.authService.currentUser(),z&&this.authService.updateUserAiConis(()=>{})}),this.changeWorkflowObserver=this.workflowUIService.changeWorkflowSubject.subscribe(z=>{this.isDisabled()}),this.imageCustomUpload=this.aiPhotoService.imageCustomUpload.subscribe(z=>{this.syncWorkflowUploadImageUrl(),this.isDisabled()}),this.paymentServiceSubs=this.paymentService.configUpdated.subscribe(z=>{z&&this.getModels()}),this.activeToolPanelSubscription=this.editorService.activeToolPanel.subscribe(z=>{}),this.updateQueryString({dt:"aidesign"})}updateQueryString(t){"aidesign"==t.dt?this.router.navigate([],{relativeTo:this.route,queryParams:t,queryParamsHandling:"merge",replaceUrl:!0}):""!=t.dt&&this.router.navigate([],{relativeTo:this.route,queryParamsHandling:"merge",replaceUrl:!0})}ngOnInit(){const t=this.aiPhotoService.queryParams;t?.productId&&(this.productId=Number(t.productId)),t?.prodImageId&&(this.productImageId=Number(t.prodImageId)),[this.productId,this.productImageId]=this.aiPhotoService.getQueryParams(h.Fs.AiDesign),this.selectedStyle?.displayName&&"custom"==this.selectedStyle?.displayName.toLowerCase()&&(this.isCustomimage=this.selectedStyle?.thumbUrl,this.isCustom=!0),this.changePrompt(!0),this.getCategoryDesignDetails(),setTimeout(()=>{this.expanded=!0},1e3)}selectImage(t){t?(this.productImageId=t.productImageId,this.styleImageUrl=t.imgUrl?t.imgUrl:"",this.selectedStyle=t,this.isCu
1stom=!1):(this.selectedStyle=this.noneProduct?this.noneProduct:this.noneProduct={productImageId:-1,imageJson:"",isGenerated:!1,id:1},this.productImageId=-1,this.isCustom=!1,this.styleImageUrl=""),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}generate(){if(this.aiPhotoService.inProgress)return;const t="panel-3"===this.activeAccPanelId&&!!this.productConfig;if(this.aiPhotoService.textPrompt.length>0||t)if(this.user&&this.user.remainingCoins>=this.selectedModel.dCoin){let n=this.aiPhotoService.selectedGuidance.height,i=this.aiPhotoService.selectedGuidance.width;if(!this.isResolution){let d=this.resolutions.find(g=>g.qType==this.selectedSize.qType);d&&(i=d.w,n=d.h)}this.aiPhotoService.generateImageFn({aiImageResult:null},{width:i,height:n}),this.aiPhotoService.startGenerationProgress({featureType:h.Fs.Design}),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle);const a={featureType:h.Fs.Design,...!this.isResolution&&{quality:this.selectedSize.qType},...!t&&{textPrompt:this.aiPhotoService.textPrompt,...this.selectedStyle.productImageId&&this.selectedStyle.productImageId>0&&{productImageId:this.selectedStyle.productImageId},productId:this.productId?this.productId:this.selectedStyle.productId},...t&&{...this.productConfig?.modelTypeId&&{model:this.productConfig.modelTypeId},worksFlow:{...this.workflowUIService.getInputWorkflowData(this.productConfig,this.aiPhotoService.originalImageUrlCustom),...this.productConfig?.workflowId&&{workflowId:this.productConfig.workflowId},...this.productConfig?.enhancePrompt&&{enhancePrompt:this.productConfig.enhancePrompt}}}};this.aiPhotoService.generateImage(a,d=>{d&&d.assetId?(d.toolPrompt=t?"":this.aiPhotoService.textPrompt||"",d.width=i,d.height=n,d.featureType=h.Fs.Design,d.toolName=x.b.label.aiDesign,d.activeSubTool=h.do.aidesign,d.selectedStyle=this.productName,this.aiPhotoService.checkStatus(d,0,m=>{m&&m.urls&&m.urls.length>0?(this.aiPhotoService.seed=m.seed,this.user.remainingCoins=m.remainingCalls,this.aiPhotoService.isDirty=!0,this.selectedStyle.isGenerated=!0):this.aiPhotoService.clearGenerationProgress(),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)},m=>{this.displayErrorMsg(m)})):this.displayErrorMsg(d)},d=>{this.displayErrorMsg(d)})}else this.aiPhotoService.openAICreditPopup(()=>{this.user=this.authService.currentUser(),this.generate()},this.selectedModel.dCoin)}displayErrorMsg(t=null){this.aiPhotoService.clearGenerationProgress();let n=t?.description;this.createPopupService.openWarningDialog("Error",n),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}ngOnDestroy(){this.aiPhotoService.TextStyleId="",this.aiPhotoService.textPrompt="",this.changeWorkflowObserver&&this.changeWorkflowObserver.unsubscribe(),this.imageCustomUpload&&this.imageCustomUpload.unsubscribe(),this.loggedInObserver&&this.loggedInObserver.unsubscribe(),this.usrPropChangedObserver&&this.usrPropChangedObserver.unsubscribe(),this.usrAICreditChanged&&this.usrAICreditChanged.unsubscribe(),this.updateBehaviorUserAiConis&&this.updateBehaviorUserAiConis.unsubscribe(),this.activeToolPanelSubscription&&this.activeToolPanelSubscription.unsubscribe(),this.aiPhotoService.originalImageUrlCustom=null,this.updateQueryString({dt:""}),this.selectedStyle=this.noneProduct={productImageId:-1,imageJson:"",isGenerated:!1,id:1}}changePrompt(t=!1){this.disabled=t}focusOut(t=1){1==t?this.isFocused=!1:this.isNgPromptFocus=!1}focusIn(t=1){1==t?this.isFocused=!0:this.isNgPromptFocus=!0}inputQualityChange(t){this.quality=t.newValue||0===t.newValue?t.newValue:t,setTimeout(()=>{this.user.remainingCoins<3&&(3==this.quality&&2==this.user.remainingCoins?this.quality=2:this.user.remainingCoins<=1&&(2==this.quality||3==this.quality)&&(this.quality=1),this.qtText=this.aiPhotoService.getQtText(this.qual
1ity))}),this.qtText=this.aiPhotoService.getQtText(this.quality)}toggleButton(t){this.isNgPrompt=t}getRandomValues(t,n){return[...t].sort(()=>Math.random()-.5).slice(0,n)}getPrompts(t=null){this.mediaContentService.getPrompts(A.Jl.AiDesign,n=>{if(n){const i=n.prompts;this.prompts=i&&i.length>=3?this.getRandomValues(i,3):i}t&&t()},n=>{},this.productId)}selectPrompt(t){this.aiPhotoService.textPrompt=t.prompt,this.disabled=!this.aiPhotoService.textPrompt,this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}onDropdownOpen(){this.renderer.addClass(document.body,"drop-open")}onDropdownClose(){this.renderer.removeClass(document.body,"drop-open")}selectImageGuide(t){this.isResolution=!!this.aiPhotoService.selectedGuidance.thumbUrl,this.disabled=!this.aiPhotoService.textPrompt&&!this.aiPhotoService.selectedGuidance.thumbUrl}selectCustomImage(t){t&&1!=t.removed?(this.productImageId=t.productImageId,this.styleImageUrl=t.imgUrl?t.imgUrl:"",this.selectedStyle=t,this.isCustom=!0,this.isCustomimage=t.thumbUrl):(this.selectedStyle.imgUrl==t.imgUrl&&(this.selectedStyle=this.noneProduct={productImageId:-1,imageJson:"",isGenerated:!1,id:1}),this.isCustom=!1,this.isCustomimage="",this.styleImageUrl=""),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}getModels(){const t=this.paymentService.config;this.models=this.aiPhotoService.getModels(t);const n=this.aiPhotoService?.queryParams?.model;if(n){const i=this.models.filter(d=>d.subFeatureType==n);i&&i.length&&(this.selectedModel=i[0],this.selectedModel.dCoin=t.creditInfo?.design?t.creditInfo?.design:this.selectedModel.dCoin);const a=new URL(this.location.path(),window.location.origin);a&&a.searchParams.delete("model"),this.location.replaceState(a.pathname+a.search)}else this.selectedModel=this.models[0],this.selectedModel.dCoin=t.creditInfo?.design?t.creditInfo?.design:this.selectedModel.dCoin;this.resolutions=this.aiPhotoService.getResolutionDesignEditor(this.selectedModel.subFeatureType),this.selectedSize=this.resolutions[0]}selectModel(t){this.selectedModel=t,this.resolutions=this.aiPhotoService.getResolutionDesignEditor(this.selectedModel.subFeatureType),this.selectedSize=this.resolutions[0]}selectSize(t){this.selectedSize=t}hideStyleRefPopover(){}selectstyleRef(t){t.close?this.styleclick||(this.styleclick=!1,this.hideStyleRefPopover()):(this.styleclick=!0,this.popStylesReferenc1.open())}showStyleRefPopover(){this.popStylesReferenc1.close?(this.styleclick=!1,this.popStylesReferenc1.open()):this.popoverOpen&&(this.popStylesReferenc1.close(),this.styleclick=!1)}openInsprrations(){const t=this.modalService.open(da,{centered:!0,size:"xxl",backdrop:"static",windowClass:"ai-design-editor"});t.componentInstance.aiPhotoService=this.aiPhotoService,t.componentInstance.selectedProductId=this.productId,t.componentInstance.ProductType=this.productType}syncWorkflowUploadImageUrl(){const t=this.storeProducts.find(i=>i.productId==this.productId),n=this.aiPhotoService.originalImageUrlCustom||null;this.productConfig&&(this.productConfig.uploadImageUrl=n),t?.productConfig&&(t.productConfig.uploadImageUrl=n),this.selectedFilters?.productConfig&&(this.selectedFilters.productConfig.uploadImageUrl=n)}getGenericCategoryDesignDetails(t=null){this.mediaContentService.getProductListing(A.KK.AIDesignGeneric,this.pageNumber,n=>{if(n){let i=n.storeProducts;if(i.length>0){let a=i[0];this.productId<=0&&(this.productId=a.productId?a.productId:0,this.productName=a.displayName?a.displayName:"",this.styleProductId=a&&a.styleProduct&&a.styleProduct.styleProductId?a.styleProduct.styleProductId:this.productId,this.getPrompts(),this.getStyleCategoryDetails(),this.productConfig=a?.productConfig&&a.productConfig?.workflowId?a.productConfig:null,this.aiPhotoService.originalImageUrlCustom=this.productConfig?.uploadImageUrl||null),this.storeProducts.unshift(JSON.parse(JSON.stringify(a)))}t&&t()}},n=>{this.isLoaded=!0,t&&t()},null)}getStyleCategoryDetails(){this.templateService.getTemplateByProductIdCenter(this.styleProductId,this.pageNumber,t=>{if(this.isLoaded=!0,t&&t.storeProductImages)if(this.products=t,this.selectedStyle?.productImageId)this.productImageId=this.selectedStyle?.productImageId,this.styleImageUrl=this.selectedStyle?.imgUrl?this.selectedStyle?.imgUrl:"";else if(this.selectedStyle=this.noneProduct={productImageId:-1,imageJson:"",isGenerated:!1,id:1},this.aiPhotoService.queryParams?.productId&&"aidesign"==this.aiPhotoService.queryParams?.tab){let n=Array.isArray(this.products)?this.products.filter(i=>i.productId==this.aiPhotoService.queryParams?.productId)[0]:null;if(n){this.productId=n.productId;const i=n.storeProductImages.filter(a=>a.productImageId==this.aiPhotoService.queryParams?.productImageId)[0];i&&(this.selectedStyle=i,this.productImageId=this.selectedStyle?.productImageId)}else if(this.products&&this.products.storeProductImages){const i=this.products.storeProductImages.filter(a=>a.productImageId==this.aiPhotoService.queryParams?.productImageId)[0];i&&(this.selectedStyle=i,this.productImageId=this.selectedStyle?.productImageId)}}},t=>{this.isLoaded=!0},null)}getCategoryDesignDetails(){this.mediaContentService.getProductListing(A.KK.AIDesign,this.pageNumber,t=>{this.isProUser=this.aiPhotoService.isProUser(),this.isLoaded=!0,t&&(this.storeProducts=JSON.parse(JSON.stringify(t.storeProducts||[])),this.productType=JSON.parse(JSON.stringify(t.storeProducts)),this.storeProducts.length&&this.getGenericCategoryDesignDetails(()=>
1{if(this.productId||(this.productId=this.storeProducts[0].productId),this.productId){let n;this.selectedFilters=this.storeProducts.filter(a=>a.productId==this.productId)[0],this.getPrompts(),this.productConfig=this.selectedFilters?.productConfig&&this.selectedFilters.productConfig?.workflowId?this.selectedFilters.productConfig:null,this.aiPhotoService.originalImageUrlCustom=this.productConfig?.uploadImageUrl||null,this.styleProductId=this.selectedFilters&&this.selectedFilters.styleProduct&&this.selectedFilters.styleProduct.styleProductId?this.selectedFilters.styleProduct.styleProductId:this.productId,this.getStyleCategoryDetails();const i=this.selectedFilters&&this.selectedFilters.storeProductImages&&this.selectedFilters.storeProductImages.length>0?this.selectedFilters.storeProductImages:[];if(i&&i.length>0)if(this.productImageId){const a=i.findIndex(g=>g.productImageId==this.productImageId);n=i.find(g=>g.productImageId==this.productImageId)||i[0],this.productImageId=n.productImageId,n&&-1!=a&&(i.splice(a,1),i.splice(0,0,n))}else n=this.selectedFilters&&this.selectedFilters.storeProductImages&&this.selectedFilters.storeProductImages.length>0?this.selectedFilters.storeProductImages[0]:null,this.productImageId=n&&n.productImageId?n.productImageId:-1;this.selectedStyle?(this.selectedStyle.item=n,this.selectedStyle.isStyle=!(!n||!n.isStyle),this.selectedStyle.isPrompt=!1):this.selectedStyle={item:n,isStyle:!1,isPrompt:!1},this.selectedStyle&&(this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle))}})),this.aiPhotoService.deleteQueryParams()},t=>{this.isLoaded=!0},null,null,this.ProductRow)}selectFilterProd(t){if(this.productConfig=null,this.activeAccPanelId="panel-1",this.selectedFilters=t,t.productId&&t.productId>0){this.productId!=t.productId&&this.storeProducts.find(i=>i.productId===this.productId)&&(this.storeProducts.find(i=>i.productId===this.productId).textPrompt=this.aiPhotoService.textPrompt),this.productId=t.productId;const n=this.storeProducts.find(i=>i.productId===t.productId).textPrompt;this.aiPhotoService.textPrompt=n||"",this.productName=t?.displayName,this.styleProductId=t?.styleProduct?.styleProductId?t.styleProduct.styleProductId:this.productId,this.selectedStyle=this.noneProduct={productImageId:-1,imageJson:"",isGenerated:!1,id:1},this.getPrompts(""),this.getStyleCategoryDetails(),t?.productConfig&&t.productConfig?.workflowId?setTimeout(()=>{this.productConfig=t.productConfig,this.aiPhotoService.originalImageUrlCustom=this.productConfig?.uploadImageUrl||null,"panel-3"===this.activeAccPanelId&&this.isDisabled()},0):(this.productConfig=null,this.aiPhotoService.originalImageUrlCustom=null,"panel-3"===this.activeAccPanelId&&(this.disabled=!0)),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)}}back(){this.backEvent.emit()}resetStyle(){this.selectedStyle=this.noneProduct={productImageId:-1,imageJson:"",isGenerated:!1,id:1},this.productImageId=0}isDisabled(){return"panel-3"===this.activeAccPanelId&&this.productConfig?.fields?.length>0?(this.disabled=!this.aiPhotoService.originalImageUrlCustom&&!this.productConfig?.uploadImageUrl&&!this.productConfig.fields.some(t=>t.value),this.disabled):this.disabled}accPanelChanged(t){t||(t={panelId:this.activeAccPanelId,nextState:!0}),t.nextState&&(this.disabled=!1,this.selectedStyle=null,this.isWorksFlow=!1,t.panelId&&("panel-1"==t.panelId?(t.isPrompt=!0,t.isStyle=!1,t.isWorkflow=!1,this.activeAccPanelId=t.panelId,this.disabled=!(this.aiPhotoService.textPrompt&&this.aiPhotoService.textPrompt.trim().length>0)):"panel-2"==t.panelId?(this.disabled=!1,t.isStyle=!0,t.isPrompt=!1,t.isWorkflow=!1,this.activeAccPanelId=t.panelId):"panel-3"==t.panelId&&(this.disabled=!1,t.isStyle=!1,t.isPrompt=!1,t.isWorkflow=!0,this.isWorksFlow=!0,this.activeAccPanelId=t.panelId,this.isDisabled()),this.selectedStyle||(this.selectedStyle=t),t.isStyle&&this.selectedFilters&&(this.selectedStyle.item=this.selectedFilters.storeProductImages[0],this.selectedStyle.displayName=this.storeProducts[0].displayName?this.storeProducts[0].displayName:"",this.productImageId=this.selectedFilters.storeProductImages[0].productImageId,this.productId=this.selectedFilters.productId),this.btnText=this.aiPhotoService.changeBtnText(this.selectedStyle)))}getWorkflows(t){this.mediaContentService.getWorkflows(t,n=>
1{n&&(this.workflowList=n?.productConfig||[],this.workflowList?.length&&(this.productConfig=JSON.parse(JSON.stringify(this.workflowList[0])),this.workflowUIService.setFieldsValue(this.productConfig)))},n=>{})}productConfigChange(t){this.productConfig=t,this.productConfig.uploadImageUrl=this.aiPhotoService.originalImageUrlCustom||null;const n=this.storeProducts.find(i=>i.productId==this.productId);n&&(n.productConfig=t),this.selectedFilters?.productId==this.productId&&(this.selectedFilters.productConfig=t)}}return(r=l).\u0275fac=function(t){return new(t||r)(e.rXU(te.Z),e.rXU(e.sFG),e.rXU(U.s),e.rXU(N.u),e.rXU(Q.A),e.rXU(G.M),e.rXU(K.W),e.rXU(s.aZ),e.rXU(f.Bq),e.rXU(_a.I),e.rXU(y.Ix),e.rXU(y.nX),e.rXU(Se.b),e.rXU(k.x))},r.\u0275cmp=e.VBU({type:r,selectors:[["design-generator-drawer"]],viewQuery:function(t,n){if(1&t&&(e.GBs(va,5),e.GBs(Ia,5),e.GBs(xa,5),e.GBs(Ma,5),e.GBs(Oa,5),e.GBs(ya,5)),2&t){let i;e.mGM(i=e.lsd())&&(n.popoverOpen=i.first),e.mGM(i=e.lsd())&&(n.popStylesReferenc1=i.first),e.mGM(i=e.lsd())&&(n.customPromptTextArea=i.first),e.mGM(i=e.lsd())&&(n.ngSelect=i.first),e.mGM(i=e.lsd())&&(n.popOver1=i.first),e.mGM(i=e.lsd())&&(n.popOver2=i.first)}},inputs:{toolDisplayName:"toolDisplayName",aiPhotoheader:"aiPhotoheader",tabId:"tabId"},outputs:{genImageEvent:"genImageEvent",backEvent:"backEvent"},decls:27,vars:9,consts:[["ngSelect",""],["popContentChooseStyles",""],["modelSelection",""],["modelResolution",""],["popOver","ngbPopover"],[1,"w-100"],[1,"drawer-elements","ai-drawer-elements","w-100"],[4,"ngIf"],[1,"position-fixed","fixed-bottom","pb-1","pt-8","bg-white",2,"z-index","2"],[1,"d-flex","align-items-center","mb-1"],["appendTo","body",1,"select-menu","fixed-resolution-drop",2,"width","-webkit-fill-available","width","100%",3,"ngModelChange","open","close","ngModel","searchable","clearable"],["ng-header-tmp",""],[3,"value",4,"ngFor","ngForOf"],[1,"d-flex","align-items-center","justify-content-center","w-100","mb-1"],["id","gtm-generate",1,"btn","btn-primary-gradient","text-13","btn-h40","w-100","d-flex","align-items-center","justify-content-center",3,"click","disabled"],["class","spinner-border spinner-border-lg me-2 hw-24","role","status",4,"ngIf"],[1,"text-13"],[1,"credit-description","d-flex","align-items-center","justify-content-center","w-100"],[1,"ms-2","me-2"],["src","https://static.lightxeditor.com/assets/images/coin-lottie-s-anim.gif","width","24px","height","24px","alt","Coin Lottie"],[1,"position-fixed","bg-white",2,"z-index","3"],[1,"d-flex","align-items-center","justify-content-between","bg-white","ps-3","pe-3",2,"margin","0 -16px"],[1,"d-flex","align-items-center","justify-content-between","w-100","top-section"],[1,"d-flex","align-items-center","bg-white","h-32"],["name","leftarrow",1,"back-icon","me-2","f-24","d-flex","align-items-center","justify-content-center","pointer","border-radius-8",3,"click"],[1,"text-lg","text-dark","text-semi","lh-125"],[1,"buttonInspiration","p-0",3,"click"],[1,"wrap"],[1,"outline"],[1,"btn-content"],["name","inspiration",1,"ms-1","me-1"],["class","d-flex align-items-center justify-content-center bg-white h-auto",4,"ngIf"],[1,"d-flex","align-items-center","justify-content-center","bg-white","h-auto"],[1,"colors-bg","sticker-buttons-scroll","scrollWidth-300","bg-white","pb-2"],[3,"selectLayout","items","leftscrollMrg","type","aiPhotoService","categoryId"],[1,"common-container","p-0","m-0","pt-1","pb-8",2,"padding-top","108px !important"],[1,"card","ps-3","pe-3","pb-3","border-0"],[1,"d-flex","w-100","flex-column","prompt-view"],[1,"wp-100","mb-1","d-flex","align-items-center","justify-content-between",2,"min-height","40px"],[1,"text-normal","text-dark","text-semi","lh-125"],["name","helpicon","placement","right","popoverClass","pop-for-tooltip","ngbPopover","Provide a text description about the subject, style, setting and any other specific element guiding the AI to understand the exact image you want generated.","triggers","mouseenter:mouseleave","popoverTitle","Enter Prompt","container","body",1,"ms-1","hw-24","help-icon",3,"mouseenter"],[3,"genBtn","prompts"],[1,"d-flex","align-items-center","w-100","mb-1","mt-3","h-40"],["name","helpicon","placement","right","popoverClass","pop-for-tooltip","ngbPopover","Choose from a collection of predefined artistic effects and aesthetics that can be applied to your generated design.","triggers","mouseenter:mouseleave","popoverTitle","Presets","container","body",1,"ms-1","hw-24","help-icon"],[1,""],["placement","right","container","body","popoverClass","background-prompt background-style pt-2 w-33
16",1,"d-flex","w-100","selected-style","justify-content-between","align-items-center",3,"shown","hidden","mouseenter","mouseleave","autoClose","ngbPopover"],[1,"thumb-box","d-inline-flex","align-items-center","justify-content-center","overflow-hidden",3,"ngClass"],["class","none-item d-inline-flex align-items-center justify-content-center",4,"ngIf"],[2,"position","relative","display","inline-block",3,"click"],["width","40px","height","40px","class","border-radius-8",3,"src",4,"ngIf"],[1,"d-inline-flex","align-items-center","justify-content-center","cta-action","position-absolute","border-radius-8",3,"ngClass"],["name","deletesmall",1,"f-24","text-white"],[1,"content","ms-2","me-2","d-inline-flex","align-items-center","text-truncate"],[1,"arrow-img","d-inline-flex","align-items-center","justify-content-center",3,"ngClass"],["name","chevronaarrow",1,"hw-24"],[1,"none-item","d-inline-flex","align-items-center","justify-content-center"],[1,"blank-icon"],["width","40px","height","40px",1,"border-radius-8",3,"src"],[1,"common-container","editor-tool-panel","pt-1","m-0","p-0",2,"height","calc(100vh - 193px - var(--sales-height))","padding-top","108px !important"],[1,"d-flex","w-100","flex-column","ngb-btn"],["ngbAccordion","",3,"closeOthers"],["ngbAccordionItem","panel-1",1,"tab-div","mb-2",3,"show","hide","collapsed"],["ngbAccordionHeader",""],[1,"d-flex","align-items-center","wp-100"],["type","button","ngbAccordionButton","",1,"btn-acc-title"],[1,"m-0","btn","btn-link","card-title","ms-3"],["name","helpicon","placement","right","popoverClass","pop-for-tooltip","ngbPopover","Provide a text description about the subject, style, setting and any other specific element guiding the AI to understand the exact image you want generated.","triggers","mouseenter:mouseleave","popoverTitle","Enter Prompt","container","body",1,"ms-1","hw-24","help-icon"],["type","button","ngbAccordionButton","",1,"btn-collapse","p-0"],[1,"collapse-text","btn-link"],["name","collapseAcc",1,"f-24"],[1,"expand-text"],["name","expandAcc",1,"f-24"],["ngbAccordionCollapse",""],["ngbAccordionBody",""],["ngbAccordionItem","panel-3","class","tab-div",3,"collapsed","shown","hidden",4,"ngIf"],[1,"common-container"],[1,"card","drawer-card","mb-3"],[1,"card-body"],[1,"btn-panel"],[1,"card-body","prompt-view"],[1,"mb-3"],["ngbAccordionItem","panel-3",1,"tab-div",3,"shown","hidden","collapsed"],[1,"card","drawer-card","mb-0"],[3,"productConfigChange","productConfig","workflowList","inProgress"],[1,"d-inline-flex","align-items-center","justify-content-start","text-13","grey-800","text-semi","lh-125","mb-1","w-100",2,"min-height","32px"],[3,"value"],[1,"option-with-icon","d-flex","align-items-center","justify-content-between"],[1,"d-flex","align-items-center"],[1,"right-sign","f-16","me-2","d-inline-flex",3,"name"],[1,"d-inline-flex","text-12","lh-140","text-black","text-medium","me-1","item-name"],[1,"d-inline-flex","me-1","grey-600","item-ratio","text-semi"],[1,"text-12","text-black","text-medium","lh-140","d-inline-flex","me-1"],["role","status",1,"spinner-border","spinner-border-lg","me-2","hw-24"],[1,"sr-only","text-nowrap","border-0","position-absolute","overflow-hidden"],[3,"selectCustomImage","selectImage","productImageId","editorType","products"],[1,"d-flex","justify-content-start","align-items-center","bottom-container","flex-column","w-100"],[1,"top-header","d-flex","justify-content-start","align-items-center","w-100","flex-column",2,"margin-top","6px"],[1,"text-14","text-semi","grey-800","m-0","w-100","lh-125","w-100","d-flex","align-items-center","justify-content-between"],[1,"grey-500","w-100","mt-1","mb-8","lh-160",2,"font-size","12px"],["class","modal-box d-flex justify-content-between align-items-center w-100 border-radius-12 p-9 mb-2 pointer",3,"ngClass","click",4,"ngFor","ngForOf"],[1,"modal-box","d-flex","justify-content-between","align-items-center","w-100","border-radius-12","p-9","mb-2","pointer",3,"click","ngClass"],[1,"d-inline-flex","align-items-center","justify-content-start","flex-column"],[1,"d-flex","align-items-center","justify-content-start","w-100","mb-1"],[1,"icon-box","hw-24","d-inline-flex","align-items-center","justify-content-center","me-2"],["height","16px","width","16px",3,"src"],[1,"grey-800","text-13","text-semi","d-inline-flex"],[1,"w-100","pe-2"],[1,"grey-500",2,"line-height","19px","font-size","12px"],[1,"d-inline-flex","align-items-center","justify-content-center","coin-box","border-radius-12"],["src","https://static.lightxeditor.com/assets/images/coin-new.png","height","20px","width","20px"],[1,"grey-600","text-12","text-semi",2,"padding-left","2px","font-size","12px"],["class","modal-box resolution-modal d-flex justify-content-between align-items-center w-100 border-radius-12 pl-9 pr-9 mb-2 pointer",3,"ngClass","click",4,"ngFor","ngForOf"],[1,"modal-box","resolution-modal","d-flex","justify-content-between","align-items-center","w-100","border-radius-12","pl-9","pr-9","mb-2","pointer",3,"click","ngClass"],[1,"d-flex","justify-content-center","align-items-center"],[1,"f-24","grey-600","me-2",3,"name"],[1,"grey-800","text-13","text-semi"],[1,"grey-600","text-11","text-semi","ms-1","p-1","ratio-box","d-inline-flex","align-items-center","justify-content-center"],[1,"grey-600","text-semi",2,"font-size","12px"]],template:function(t,n){if(1&t){const i=e.RV6();e.j41(0,"div",5)(1,"div",6),e.DNE(2,Fa,17,4,"ng-container",7),e.k0s(),e.j41(3,"div",8)(4,"div",9)(5,"ng-select",10,0),e.mxI("ngModelChange",function(d){return e.eBV(i),e.DH7(n.selectedSize,d)||(n.selectedSize=d),e.Njj(d)}),e.bIt("open",function(){return e.eBV(i),e.Njj(n.onDropdownOpen())})("close",function(){return e.eBV(i),e.Njj(n.onDropdownClose())}),e.DNE(7,Na,2,0,"ng-template",11)(8,La,10,5,"ng-option",12),e.k0s()(),e.j41(9,"div",13)(10,"button",14),e.bIt("click",function(){return e.eBV(i),e.Njj(n.generate())}),e.DNE(11,Wa,3,0,"div",15),e.j41(12,"span",16),e.EFF(13),e.k0s()()(),e.j41(14,"div",17)(15,"span"),e.EFF(16,"1 generation ="),e.k0s(),e.j41(17,"span",18),e.nrm(18,"img",19),e.k0s(),e.j41(19,"span"),e.EFF(20),e.k0s()()()(),e.DNE(21,Va,1,3,"ng-template",null,1,e.C5r)(23,Ka,7,1,"ng-template",null,2,e.C5r)(25,Ya,7,1,"ng-template",null,3,e.C5r)}2&t&&(e.R7$(2),e.Y8G("ngIf",n.isLoaded),e.R7$(3),e.R50("ngModel",n.selectedSize),e.Y8G("searchable",!1)("clearable",!1),e.R7$(3),e.Y8G("ngForOf",n.resolutions),e.R7$(2),e.Y8G("disabled",n.disabled),e.R7$(),e.Y8G("ngIf",n.aiPhotoService.inProgress),e.R7$(2),e.JRh(n.aiPhotoService.inProgress?"Processing":n.btnText),e.R7$(7),e.SpI("",null==n.selectedModel?null:n.selectedModel.dCoin," credits"))},dependencies:[s.YU,s.Sq,s.bT,Ca,f.WP,f.r6,f.tW,f.x7,f.UA,f.$R,f.ZM,u.BC,u.vS,L.b,X.vr,X.xt,X.Uc,Ke.V,Pe.B,Ee.KK,De.d],styles:['.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]{width:100%;height:124px;border-radius:12px;border:1px solid #E2E3E9;background:#eeedf3;padding:.9px 4px 4px}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]:hover{border:1px solid #B0B3BF}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{resize:none;outline:none;width:100%;height:96px;padding:8px 8px 0;font-size:12px;color:#b0b3bf;border:0px;background:transparent;line-height:18px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar{width:4px;height:4px;border-radius:12px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#e3e3e3;border-radius:12px;margin-top:8px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#9a9a9a;border-radius:12px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:#555}.prompt-view[_ngcontent-%COMP%] .prompt-info[_ngcontent-%COMP%]{font-size:11px;color:#959aa7;margin-top:0;padding-left:8px;height:24px;line-height:normal;width:calc(100% - 8px);bottom:4px;z-index:99}.prompt-view[_ngcontent-%COMP%] .lampicon[_ngcontent-%COMP%]{border-radius:8px}.prompt-view[_ngcontent-%COMP%] .lampicon[_ngcontent-%COMP%]:hover{background:#626adf0d}.fixed-bottom[_ngcontent-%COMP%]{position:fixed!important;width:300px!important;right:auto!important;left:5rem;z-index:0;padding:0 12px}.selected-style[_ngcontent-%COMP%]{padding:4px 12px 4px 4px;border-radius:12px;border:1px solid #E2E3E9;background:#626adf0d;cursor:pointer;height:48px}.selected-style[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{font-size:13px;color:#272b34;width:100%}.selected-style[_ngcontent-%COMP%]:hover{border:1px solid #E2E3E9;background:#626adf1a}.selected-style[_ngcontent-%COMP%]:hover .thumb-box[_ngcontent-%COMP%] pi[_ngcontent-%COMP%]{color:#272b34}input[_ngcontent-%COMP%]{border-radius:12px;border:1px solid #E2E3E9;height:40px;width:100%;font-size:13px}input[_ngcontent-%COMP%]:hover{border:1px solid #C9CAD4;background:#626adf0d}input[_ngcontent-%COMP%]:focus-visible{outline:none}.bottom-container[_ngcontent-%COMP%]{border-radius:20px 20px 0 0}
1.bottom-container[_ngcontent-%COMP%] .modal-box[_ngcontent-%COMP%]{background:#626adf0d;position:relative}.bottom-container[_ngcontent-%COMP%] .modal-box[_ngcontent-%COMP%] .icon-box[_ngcontent-%COMP%]{border-radius:6px;background:#626adf1a}.bottom-container[_ngcontent-%COMP%] .modal-box[_ngcontent-%COMP%] .coin-box[_ngcontent-%COMP%]{border:1px solid #C9CAD4;padding:0 6px 0 4px;min-height:24px;min-width:42px}.bottom-container[_ngcontent-%COMP%] .resolution-modal[_ngcontent-%COMP%]{min-height:40px}.bottom-container[_ngcontent-%COMP%] .resolution-modal[_ngcontent-%COMP%] .ratio-box[_ngcontent-%COMP%]{border-radius:6px;background:#626adf1a;max-height:23px}.bottom-container[_ngcontent-%COMP%] .active-modal[_ngcontent-%COMP%], .bottom-container[_ngcontent-%COMP%] .active-resolution[_ngcontent-%COMP%]{position:relative}.bottom-container[_ngcontent-%COMP%] .active-modal[_ngcontent-%COMP%] .icon-box[_ngcontent-%COMP%], .bottom-container[_ngcontent-%COMP%] .active-modal[_ngcontent-%COMP%] .ratio-box[_ngcontent-%COMP%], .bottom-container[_ngcontent-%COMP%] .active-resolution[_ngcontent-%COMP%] .icon-box[_ngcontent-%COMP%], .bottom-container[_ngcontent-%COMP%] .active-resolution[_ngcontent-%COMP%] .ratio-box[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff1a -4%,#2520f61a)}.bottom-container[_ngcontent-%COMP%] .active-modal[_ngcontent-%COMP%] .coin-box[_ngcontent-%COMP%], .bottom-container[_ngcontent-%COMP%] .active-resolution[_ngcontent-%COMP%] .coin-box[_ngcontent-%COMP%]{position:relative;border:0px}.bottom-container[_ngcontent-%COMP%] .active-modal[_ngcontent-%COMP%] .coin-box[_ngcontent-%COMP%]:after, .bottom-container[_ngcontent-%COMP%] .active-resolution[_ngcontent-%COMP%] .coin-box[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:0px;background:linear-gradient(90deg,#fc5cff -4%,#2520f6);-webkit-mask:linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%) content-box,linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%);-webkit-mask-composite:xor;mask-composite:exclude}.bottom-container[_ngcontent-%COMP%] .active-modal[_ngcontent-%COMP%]:after, .bottom-container[_ngcontent-%COMP%] .active-resolution[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:1.3px;border:none;background:linear-gradient(90deg,#fc5cff -4%,#2520f6);-webkit-mask:linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%) content-box,linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%);-webkit-mask-composite:xor;mask-composite:exclude}.bottom-container[_ngcontent-%COMP%] .modal-box[_ngcontent-%COMP%]:last-child{margin-bottom:0!important}.buttonInspiration[_ngcontent-%COMP%]{outline:none;cursor:pointer;background:transparent;border:0;position:relative;height:28px}.wrap[_ngcontent-%COMP%]{border-radius:8px;overflow:hidden;height:100%;padding:1px;background:linear-gradient(90deg,#fc5cff1a -4%,#2520f61a),#fff;position:relative;transition:all .3s ease;display:flex;align-items:center;justify-content:center}.outline[_ngcontent-%COMP%]{position:absolute;overflow:hidden;opacity:1;outline:none;border-radius:inherit;transition:all .4s ease;animation:_ngcontent-ng-c935961668_spin 1.5s linear infinite;animation-play-state:running;height:150px;width:150px}.outline[_ngcontent-%COMP%]:before{content:"";position:absolute;top:2px;right:2px;bottom:2px;left:2px;background:linear-gradient(90deg,#2520f6 -4%,#fc5cff4d 79.8%),#d9d9d9}.btn-content[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;position:relative;height:100%;border-radius:7px;transition:all .3s ease;background:#fff;font-size:11px;padding-right:8px;color:#4a4f5e;line-height:140%;font-weight:600!important}.path[_ngcontent-%COMP%]{position:absolute;z-index:12;bottom:0;left:0;right:0;stroke-dasharray:150 480;stroke-dashoffset:150;pointer-events:none}.splash[_ngcontent-%COMP%]{position:absolute;top:0;left:0;pointer-events:none;stroke-dasharray:60 60;stroke-dashoffset:60;transform:translate(-17%,-31%);stroke:#734b9b0d}.buttonInspiration[_ngcontent-%COMP%]:hover .outline[_ngcontent-%COMP%]{opacity:1;animation-play-state:paused;background:linear-gradient(90deg,#2520f6 -4%,#fc5cff4d 79.8%),#d9d9d9}.buttonInspiration[_ngcontent-%COMP%]:hover .btn-content[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff1a -4%,#2520f61a),#fff}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.cta-action[_ngcontent-%COMP%]{background:#000000b3;width:100%;height:100%;left:0;top:0}.cta-action[_ngcontent-%COMP%]:hover{background:#000c}.thumb-box[_ngcontent-%COMP%]{width:40px;height:40px;border-radius:8px;min-width:40px}.thumb-box[_ngcontent-%COMP%] .none-item[_ngcontent-%COMP%]{width:34px;height:34px;border-radius:8px;border:1px solid #E2E3E9;background:#fff}.thumb-box[_ngcontent-%COMP%] .none-item[_ngcontent-%COMP%] .blank-icon[_ngcontent-%COMP%]{border-radius:4px;background:#f25555;width:24px;height:2px;transform:rotate(-45deg)}.add-border[_ngcontent-%COMP%]{border:1px solid #E2E3E9}.remove-border[_ngcontent-%COMP%]{border:0px solid #E2E3E9}.top-section[_ngcontent-%COMP%]{height:56px;z-index:99;-webkit-user-select:none;user-select:none}.icon-rotate[_ngcontent-%COMP%] pi[_ngcontent-%COMP%]{transform:rotate(-90deg)}']}),l})();const qa=r=>({"d-none":r});function Ha(r,l){if(1&r&&(e.qex(0),e.nrm(1,"ai-shoot",10),e.bVm()),2&r){const o=e.XpG(3);e.R7$(),e.Y8G("featureType",o.toolName)("toolDisplayName",o.toolDisplayName)}}function Ja(r,l){if(1&r){const o=e.RV6();e.j41(0,"design-generator-drawer",12),e.bIt("backEvent",function(){e.eBV(o);const n=e.XpG(4);return e.Njj(n.back())}),e.k0s()}if(2&r){const o=e.XpG(4);e.Y8G("toolDisplayName",o.toolDisplayName)}}function Qa(r,l){1&r&&(e.qex(0),e.DNE(1,Ja,1,1,"design-generator-drawer",11),e.bVm()),2&r&&(e.R7$(),e.Y8G("ngSwitchCase","design"))}function Za(r,l){if(1&r&&(e.qex(0)(1,9),e.DNE(2,Ha,2,2,"ng-container",8)(3,Qa,2,1,"ng-container",8),e.bVm()()),2&r){const o=e.XpG(2);e.R7$(),e.Y8G("ngSwitch",o.toolName),e.R7$(),e.Y8G("ngIf",1==o.isDynamicTool),e.R7$(),e.Y8G("ngIf",0==o.isDynamicTool)}}function ec(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",3)(1,"div",4)(2,"pi",5),e.bIt("click",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.back())}),e.k0s(),e.j41(3,"span",6),e.EFF(4),e.k0s()(),e.j41(5,"div")(6,"div",7),e.DNE(7,Za,4,3,"ng-container",8),e.k0s()()()}if(2&r){const o=e.XpG();e.R7$(),e.Y8G("ngClass",e.eq3(6,qa,"design"==o.toolName)),e.R7$(3),e.JRh(o.toolDisplayName),e.R7$(),e.ZvI("middle-drawer ",o.toolName,""),e.R7$(2),e.Y8G("ngIf",o.isLoaded)}}let tc=(()=>{var r;class l{constructor(t,n){this.aiPhotoService=t,this.editorService=n,this.toolDisplayName=null,this.toolName=null,this.isDynamicTool=0,this.isLoaded=!1,this.activeToolPanelSubscription=this.editorService.activeToolPanel.subscribe(i=>{if(i?.toolName&&(i?.toolName!=this.toolName&&!i?.changeTool||i?.changeTool)){const a=this.aiPhotoService.getToolByName(i?.toolName,J.sv.AI_DESIGN_TOOLS)||{metadata:{featureType:i?.toolName}};a&&(this.isLoaded=!1,setTimeout(()=>{this.isLoaded=!0,this.selectTool(a)},200))}})}ngOnInit(){if(this.toolName=this.aiPhotoService?.queryParams?.toolName||null,this.toolName){const t=this.aiPhotoService.getToolByName(this.toolName,J.sv.AI_DESIGN_TOOLS)||{metadata:{featureType:this.toolName}};t&&this.selectTool(t)}}selectTool(t){this.isDynamicTool=t?.metadata?.isDynamic||0,this.toolName=t?.metadata?.featureType,this.aiPhotoService.selectedTool=this.toolName,this.toolDisplayName=t?.text||"AI "+this.toolName,this.aiPhotoService.sampleImageUrl=t?.metadata?.sampleImageUrl||"",this.isLoaded=!0}reset(){this.toolName=null,this.toolDisplayName=null,this.aiPhotoService.sampleImageUrl="",this.isLoaded=!1}back(){this.reset()}ngOnDestroy(){this.aiPhotoService.deleteQueryParam("toolName"),this.activeToolPanelSubscription&&this.activeToolPanelSubscription.unsubscribe()}}return(r=l).\u0275fac=function(t){return new(t||r)(e.rXU(U.s),e.rXU(k.x))},r.\u0275cmp=e.VBU({type:r,selectors:[["design-tools-drawer"]],decls:3,vars:2,consts:[[1,"drawer-content",3,"hidden"],[3,"selectToolEvent"],["class","tools-container-drawer workFlow-dropdown-panel",4,"ngIf"],[1,"tools-container-drawer","workFlow-dropdown-panel"],[1,"top-section","d-flex","align-items-center","bg-white","ps-3","pe-3",3,"ngClass"],["name","leftarrow",1,"back-icon","me-2","f-24","d-flex","align-items-center","justify-content-center","pointer","border-radius-8",3,"click"],[1,"text-lg","text-semi","text-dark","lh-125"],["customScrollDir","",1,"is-popover-tb-n","drawer-scroll","scroll-container"],[4,"ngIf"],[3,"ngSwitch"],[3,"featureType","toolDisplayName"],[3,"toolDisplayName","backEvent",4,"ngSwitchCase"],[3,"backEvent","toolDisplayName"]],template:function(t,n){1&t&&(e.j41(0,"div",0)(1,"tool-list-drawer",1),e.bIt("selectToolEvent",function(a){return n.selectTool(a)}),e.k0s()(),e.DNE(2,ec,8,8,"div",2)),2&t&&(e.Y8G("hidden",n.toolName),e.R7$(2),e.Y8G("ngIf",n.toolName))},dependencies:[s.YU,s.bT,s.ux,s.e1,w.q,L.b,Me.F,za,ke.x],styles:[".child-drawer[_ngcontent-%COMP%]{position:absolute;top:0;width:100%;height:0px;opacity:0;transform:translateY(-20px);transition:transform .5s ease-in-out,opacity .5s ease-in-out}.drawer-active[_ngcontent-%COMP%]{height:100%;opacity:1;transform:translateY(0)}.tools-container-drawer[_ngcontent-%COMP%]{height:100%}
1.tools-container-drawer[_ngcontent-%COMP%] .top-section[_ngcontent-%COMP%]{height:56px;z-index:99;-webkit-user-select:none;user-select:none;min-height:56px}.tools-container-drawer[_ngcontent-%COMP%] .top-section[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{font-size:14px!important;color:#272b34;line-height:19.07px}.tools-container-drawer[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%], .tools-container-drawer[_ngcontent-%COMP%] .aifilter[_ngcontent-%COMP%]{padding-top:56px}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%]{user-select:none;-webkit-user-select:none;height:calc(100vh - 180px - var(--sales-height))}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .ai-thumb-view[_ngcontent-%COMP%]{border-radius:12px;background:#eeedf3;height:134px;position:relative;overflow:hidden;-webkit-user-select:none;user-select:none}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .ai-thumb-view[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:100%;width:auto;object-fit:contain;overflow:hidden}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .ai-thumb-view[_ngcontent-%COMP%]:hover .replace-btn[_ngcontent-%COMP%]{display:flex;z-index:99;position:absolute;background:#0006;align-items:center;justify-content:center;height:100%;width:100%;border-radius:12px;flex-direction:column}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .ai-thumb-view[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%]{display:none}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .ai-thumb-view[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{background:#fff!important;border:0px!important;color:#272b34!important;min-width:124px}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .ai-thumb-view[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{background:linear-gradient(0deg,#626adf0d 0% 100%),#fff!important;color:#272b34}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .ai-thumb-view[_ngcontent-%COMP%] .add-on-404[_ngcontent-%COMP%]{display:flex;z-index:99;position:absolute;background:#0000001a;align-items:center;justify-content:center;height:100%;width:100%;border-radius:12px;flex-direction:column}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%]{border-radius:12px;background:#efeef2;height:134px;position:relative;overflow:hidden;-webkit-user-select:none;user-select:none}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-left[_ngcontent-%COMP%], .tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-right[_ngcontent-%COMP%]{width:132px;height:134px;overflow:hidden;cursor:pointer}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-left[_ngcontent-%COMP%] img[_ngcontent-%COMP%], .tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-right[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:contain}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-left[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%], .tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-right[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%]{display:none}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-left[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%], .tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-right[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{background:#fff!important;border:0px!important;color:#272b34!important;min-width:120px}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-left[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover, .tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-right[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{background:linear-gradient(0deg,#626adf0d 0% 100%),#fff!important;color:#272b34}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-left[_ngcontent-%COMP%] .add-on-404[_ngcontent-%COMP%], .tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-right[_ngcontent-%COMP%] .add-on-404[_ngcontent-%COMP%]{display:flex;z-index:99;position:absolute;background:#0000001a;align-items:center;justify-content:center;height:100%;width:100%;flex-direction:column}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-left[_ngcontent-%COMP%]:hover pi[_ngcontent-%COMP%], .tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-left[_ngcontent-%COMP%]:hover span[_ngcontent-%COMP%], .tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-right[_ngcontent-%COMP%]:hover pi[_ngcontent-%COMP%], .tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-right[_ngcontent-%COMP%]:hover span[_ngcontent-%COMP%]{color:#272b34!important}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-left[_ngcontent-%COMP%]:hover .replace-btn[_ngcontent-%COMP%], .tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-right[_ngcontent-%COMP%]:hover .replace-btn[_ngcontent-%COMP%]{display:flex;z-index:99;position:absolute;background:#0006;align-items:center;justify-content:center;height:100%;width:100%;flex-direction:column}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-left[_ngcontent-%COMP%]{width:131px;border-radius:12px 0 0 12px}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-left[_ngcontent-%COMP%]:hover{background:linear-gradient(90deg,#626adf00,#626adf1a),#efeef2}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-right[_ngcontent-%COMP%]{width:131px;border-radius:0 12px 12px 0}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .dual-thumb-view[_ngcontent-%COMP%] .dual-child-right[_ngcontent-%COMP%]:hover{background:linear-gradient(270deg,#626adf00,#626adf1a),#efeef2}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%] .bg-white[_ngcontent-%COMP%]{background:#fff!important}.tools-container-drawer[_ngcontent-%COMP%] .middle-drawer.photoshoot-drawer[_ngcontent-%COMP%]{padding-top:112px!important}.tools-container-drawer[_ngcontent-%COMP%] .credit-description[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:inline-flex;color:#272b34;font-size:12px}.wrapper-for-timeline[_ngcontent-%COMP%] .main-content[_ngcontent-%COMP%] .blank-section[_ngcontent-%COMP%]{flex-direction:column;-webkit-user-select:none;user-select:none}.wrapper-for-timeline[_ngcontent-%COMP%] .main-content[_ngcontent-%COMP%] .blank-section[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px;color:#272b34}.middle-drawer.top-section-p[_ngcontent-%COMP%]{height:calc(100vh - 193px - var(--sales-height))!important}.middle-drawer.top-section-p.isresolution-add[_ngcontent-%COMP%]{height:calc(100vh - 235px - var(--sales-height))}.middle-drawer.top-section-p[_ngcontent-%COMP%]{padding-top:52px}"]}),l})(),nc=(()=>{var r;class l{constructor(t,n,i,a,d){this.router=t,this.envService=n,this.aiUploadImageService=i,this.aiPhotoService=a,this.storyPageService=d,this.toolName=null,this.isLoaded=!1,this.subTool=""}ngOnInit(){}getStoryPage(t){if(this.slug=t?.metadata?.subType,t?.metadata?.isQuickEdit||t?.metadata?.isEcommerce)return this.toolName=t?.metadata?.tabName,this.subTool=t?.metadata?.subTool,this.editorType=t?.metadata?.editorType,void this.loadInputImage();this.storyPageService.getStoryPageContent(x.b.photoEditor.type,x.b.pageType,this.slug,n=>{this.storyPage=n.body.storyPage,this.storyPage&&(this.toolName=this.storyPage.sections[0].metadata?this.storyPage.sections[0].metadata.toolName:x.b.defaultPhotoEditTool,this.subTool=this.storyPage.sections[0].metadata?this.storyPage.sections[0].metadata.subTool:this.subTool,this.editorType=this.storyPage.metadata.editorType?this.storyPage.metadata.editorType:x.b.defaultEditorType,this.editorType==h._Y.BatchEditor?this.aiUploadImageService.navigateToBatchEditor({tab:this.toolName,from:this.slug}):this.loadInputImage())},n=>{})}loadInputImage(){const t=this.router.createUrlTree(["/edit-tools/edit"],{queryParams:{from:this.slug,tab:this.toolName,subTool:this.subTool,img:this.aiPhotoService.imgUrl}}),n=me.c.siteUrl+this.router.serializeUrl(t);window.open(n,"_blank")}}return(r=l).\u0275fac=function(t){return new(t||r)(e.rXU(y.Ix),e.rXU(ve.L),e.rXU(G.M),e.rXU(U.s),e.rXU(Ie.K))},r.\u0275cmp=e.VBU({type:r,selectors:[["editor-tools-drawer"]],decls:2,vars:0,consts:[[1,"drawer-content"],[3,"selectToolEvent"]],template:function(t,n){1&t&&(e.j41(0,"div",0)(1,"tool-list-drawer",1),e.bIt("selectToolEvent",function(a){return n.getStoryPage(a)}),e.k0s()())},dependencies:[Me.F],styles:[".child-drawer[_ngcontent-%COMP%]{position:absolute;top:0;width:100%;height:0px;opacity:0;transform:translateY(-20px);transition:transform .5s ease-in-out,opacity .5s ease-in-out}.drawer-active[_ngcontent-%COMP%]{height:100%;opacity:1;transform:translateY(0)}.ai-video-list[_ngcontent-%COMP%]{flex-flow:wrap}.ai-video-list[_ngcontent-%COMP%] .ai-video-thumbs[_ngcontent-%COMP%]{width:80px;flex-direction:column;border-radius:8px;justify-content:flex-end;cursor:pointer}.ai-video-list[_ngcontent-%COMP%] .ai-video-thumbs[_ngcontent-%COMP%]:hover .tool-name[_ng
1content-%COMP%]{color:#000;transition:color .3s ease-in-out}.videoThumb[_ngcontent-%COMP%]{width:84px;height:84px;overflow:hidden;display:flex;align-items:center;justify-content:center;border-radius:8px;transition:opacity .3s ease-in,visibility .3s ease-in!important}.videoThumb[_ngcontent-%COMP%] video[_ngcontent-%COMP%]{transform:scale(1.1);transition:transform .2s ease-in}.videoThumb[_ngcontent-%COMP%]:hover video[_ngcontent-%COMP%]{transform:scale(1);transition:transform .2s ease-in}.tool-name[_ngcontent-%COMP%]{width:100%;position:relative;font-size:12px;color:#959aa7;text-align:center;padding:0 8px;line-height:140%}.new_item[_ngcontent-%COMP%], .new_badge[_ngcontent-%COMP%]{position:absolute;top:4px;right:4px;padding-right:0;z-index:1}.new_item[_ngcontent-%COMP%]:after, .new_badge[_ngcontent-%COMP%]:after{content:url(https://static.lightxeditor.com/assets/icons/newbadge.svg);position:relative;top:0}"]}),l})();const oc=["aiPhotoheader"],ic=["aiPortraitgen"],rc=(r,l)=>({visibleads:r,"hideads-col":l});function sc(r,l){1&r&&e.nrm(0,"image-tools-drawer")}function ac(r,l){1&r&&e.nrm(0,"video-tools-drawer")}function cc(r,l){1&r&&e.nrm(0,"design-tools-drawer")}function lc(r,l){1&r&&e.nrm(0,"ai-photo-shoot-drawer")}function dc(r,l){1&r&&e.nrm(0,"editor-tools-drawer")}function _c(r,l){if(1&r&&(e.qex(0)(1,18),e.DNE(2,sc,1,0,"image-tools-drawer",19)(3,ac,1,0,"video-tools-drawer",19)(4,cc,1,0,"design-tools-drawer",19)(5,lc,1,0,"ai-photo-shoot-drawer",19)(6,dc,1,0,"editor-tools-drawer",19),e.bVm()()),2&r){const o=e.XpG();e.R7$(),e.Y8G("ngSwitch",o.activeToolPanel),e.R7$(),e.Y8G("ngSwitchCase","image-tools"),e.R7$(),e.Y8G("ngSwitchCase","video-tools"),e.R7$(),e.Y8G("ngSwitchCase","design-tools"),e.R7$(),e.Y8G("ngSwitchCase","photoshoot"),e.R7$(),e.Y8G("ngSwitchCase","ai-photo-editor")}}function gc(r,l){if(1&r&&(e.j41(0,"div",23),e.nrm(1,"img",24),e.k0s()),2&r){const o=e.XpG(2);e.R7$(),e.Y8G("src",o.aiPhotoService.sampleImageUrl,e.B4B)}}function pc(r,l){1&r&&(e.j41(0,"div",25),e.nrm(1,"img",26),e.j41(2,"span",27),e.EFF(3,"Your generations will be displayed here"),e.k0s()())}function mc(r,l){if(1&r&&(e.j41(0,"div",20),e.DNE(1,gc,2,1,"div",21)(2,pc,4,0,"div",22),e.k0s()),2&r){const o=e.XpG();e.R7$(),e.Y8G("ngIf",o.isSampleImageUrl(null==o.aiPhotoService?null:o.aiPhotoService.sampleImageUrl)),e.R7$(),e.Y8G("ngIf",!o.isSampleImageUrl(null==o.aiPhotoService?null:o.aiPhotoService.sampleImageUrl)&&o.isLoaded)}}function hc(r,l){if(1&r){const o=e.RV6();e.qex(0),e.j41(1,"portrait-gen-image",28,2),e.bIt("changeToolName",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.changeToolName(n))})("genAsInputImageEvent",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.genInputImage(n,!0))})("selectAllChanged",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.selectAllChanged(n))})("downloadAllDisabled",function(n){e.eBV(o);const i=e.XpG();return e.Njj(i.downloadAllDisabled(n))}),e.k0s(),e.bVm()}if(2&r){const o=e.XpG();e.R7$(),e.Y8G("activeToolPanel",o.activeToolPanel)}}function uc(r,l){if(1&r){const o=e.RV6();e.j41(0,"button",38),e.bIt("click",function(){e.eBV(o);const n=e.XpG(2);return e.Njj(n.processingProgress.cancel())}),e.EFF(1," Cancel "),e.k0s()}}function Pc(r,l){if(1&r&&(e.j41(0,"div",29)(1,"div",30),e.nrm(2,"app-ai-processing-bar",31),e.DNE(3,uc,2,0,"button",32),e.k0s(),e.j41(4,"div",33)(5,"div",34),e.nrm(6,"div",35)(7,"div",36)(8,"div",37),e.k0s()()()),2&r){const o=e.XpG();e.R7$(2),e.Y8G("progress",o.processingProgress.progressPercent)("message",o.processingProgress.progressMessage)("indeterminate",o.processingProgress.indeterminate),e.R7$(),e.Y8G("ngIf",o.processingProgress.canCancel)}}function fc(r,l){if(1&r){const o=e.RV6();e.j41(0,"div",39)(1,"div",40),e.nrm(2,"ins",41),e.k0s(),e.j41(3,"div",42)(4,"button",43),e.bIt("click",function(){e.eBV(o);const n=e.XpG();return e.Njj(n.removeAds())}),e.nrm(5,"pi",44),e.j41(6,"span",45),e.EFF(7,"Remove ads"),e.k0s()()()()}}const bc=[{path:"",redirectTo:"edit",pathMatch:"full"},{path:"edit",component:(()=>{var r;class l{constructor(t,n,i,a,d,g,m,b,O,E,Y,q,_e,ge,z,ze,qe,He){this.aiUploadImageService=t,this.route=n,this.aiPhotoService=i,this.aiWrapperRemoveBgService=a,this.authService=d,this.modalService=m,this.editorService=b,this.paymentService=O,this.processingProgress=E,this.subsService=Y,this.loginService=q,this.config=_e,this.envService=ge,this.location=z,this.toolHistoryService=ze,this.storyPageService=qe,this.renderer=He,this.editorType=h._Y.AIPhoto,this.activeToolPanel=J.sv.AI_IMAGE_TOOLS,this.disabled=!1,this.isLoaded=!1,this.tools=W.po.toolbar.nav.items,this.hideAds=!0,this.showAds=!1,this.enableAds=0,this.callConfig=!1,this.callAiCoins=!1,this.user=this.authService.currentUser(),this.user&&this.authService.updateUserAiConis("loggedIn"),this.loggedInObserver=this.authService.loggedIn.subscribe(H=>{this.user=this.authService.currentUser(),this.user||(this.callAiCoins=!0),this.callConfig&&this.checkAds()}),this.usrPropChangedObserver=this.authService.usrPropChanged.subscribe(H=>{this.user=this.authService.currentUser()}),this.updateBehaviorUserAiConis=this.authService.updateBehaviorUserAiConis.subscribe(H=>{this.user=this.authService.currentUser(),H&&(this.callAiCoins=!0,this.callConfig&&this.checkAds())}),this.settingsUpdateObserver=this.config.updateAds.subscribe(H=>{H&&(this.callConfig=!0,this.enableAds=this.config.showAds,this.callAiCoins&&this.checkAds())}),g.onPopState(()=>{this.modalService.hasOpenModals()&&this.modalService.dismissAll("")}),this.activeToolPanelSubscription=this.editorService.activeToolPanel.subscribe(H=>{this.aiPhotoService.sampleImageUrl="",this.activeToolPanel=H.panel,this.lastSelectedToolPanel=H.panel}),this.checkStatusSub=this.aiPhotoService.checkStatusSub.subscribe(H=>
1{if(H&&(this.processingProgress.isActive||(H.isVideo&&(this.aiPhotoService.inVideoProgress=!1),this.aiPhotoService.inProgress=!1),this.aiPhotoheader&&(this.aiPhotoheader.isSelectAll=!1),H?.featureType)){const Ae=this.aiPhotoService.toolList.filter(pe=>pe?.links?.some(Bc=>Bc?.metadata?.featureType==H?.featureType))[0]?.links?.find(pe=>pe?.metadata?.featureType==H?.featureType);this.toolHistoryService.addToHistory({title:Ae.text||H?.toolName,tab:Ae?.type,toolName:H?.featureType,editorType:h._Y.AIPhoto})}})}isSampleImageUrl(t){if(!t)return!1;const i=t.split("?")[0].split("#")[0].split(".").pop()?.toLowerCase();return["jpg","jpeg","png","webp","bmp","gif"].includes(i||"")}changeToolName(t){"video-tools"!=this.activeToolPanel?(this.isLoaded=!1,setTimeout(()=>{this.activeToolPanel="video-tools",this.aiPhotoService.queryParams.toolName="image2video",this.isLoaded=!0,this.genInputImage(t.aiImg)},0)):this.genInputImage(t.aiImg)}ngAfterViewInit(){this.aiPhotoService.isCancel=!1,this.showAds&&setTimeout(()=>{try{(window.adsbygoogle=window.adsbygoogle||[]).push({})}catch{}},1e3)}checkAds(){this.showAds=!(this.envService.isMobileView||!this.enableAds||this.user&&(this.user.subscribed||this.user.creditPurchased))}ngOnInit(){sessionStorage.getItem("isBack")&&(sessionStorage.removeItem("isBack"),setTimeout(()=>{this.location.back()},0)),this.aiPhotoService.queryParams=this.queryParams={...this.route.snapshot.queryParams},this.getStoryPageContent(()=>{this.queryParams?.tab&&(this.activeToolPanel=this.queryParams?.tab,this.editorService.setActiveToolPanel({panel:this.activeToolPanel,from:this.queryParams?.from})),this.aiPhotoService.queryParams?.tp&&(this.aiPhotoService.textPrompt=this.queryParams?.tp),this.isLoaded=!0});const n=this.queryParams?.o_img;n&&(this.aiPhotoService.imgUrl=this.queryParams?.imgUrl||n,this.aiPhotoService.originalImgUrl=n,this.aiPhotoService.originalImageUrlDuo=this.queryParams?.imgUrl2||null,this.aiPhotoService.isValidBlobUrl(n).then(g=>{!g&&this.aiPhotoService.originalImgUrl===n&&(this.aiPhotoService.imgUrl=this.aiPhotoService.ps_imgUrl=this.imgUrl=null,this.aiPhotoService.originalImgUrl=null)}));let i="false"!==this.queryParams?.checkimg;!this.subsService.handleBlogPromotionCheckout(this.queryParams)&&!this.queryParams?.isApiKey&&!this.queryParams?.autoGenerate&&i&&this.subsService.openPromotionPopup().then(g=>{this.user&&g?this.authService.updateUserAiConis(()=>{this.user=this.authService.currentUser();let m="image",b=1;(this.queryParams?.tab==h.Fs.TextToVideo||this.queryParams?.tab==h.Fs.ImageToVideo)&&(m="video",b=this.paymentService?.config?.aiVideoCredits||1),this.aiPhotoService.openAICreditPopup(()=>{},b,m)}):this.user&&!g&&this.authService.updateUserAiConis(()=>{this.user=this.authService.currentUser()})}),document.body.classList.add("overflow-hidden");const d=navigator.userAgent;d.includes("Mac")&&(d.includes("Safari")||d.includes("Chrome"))&&this.renderer.addClass(document.body,"for-mac-safari-chrome"),d.includes("Mac")&&d.includes("Firefox")&&this.renderer.addClass(document.body,"for-mac-firefox"),(this.queryParams?.autoGenerate||this.aiPhotoService.queryParams.tp||this.aiPhotoService.queryParams?.productId)&&(0,R._)((0,T.O)(2e3)).then(()=>{this.aiPhotoService.deleteQueryParam("autoGenerate",!0),this.aiPhotoService.queryParams.tp=null,this.aiPhotoService.deleteQueryParam("productId",!0)})}download(t){this.aiPhotoService.download(t.url)}genInputImage(t,n=!1){this.aiPhotoService.inProgress||(this.aiPhotoService.originalImgUrl=this.aiPhotoService.imgUrl=t.imgUrl,this.aiWrapperRemoveBgService.removeBgResult=null,this.aiPhotoService.isRefined=!1,this.aiPhotoService.maskUrl=null,(t?.width>1024||t?.height>1024)&&n&&this.aiPhotoService.updateImageUrl(this.aiPhotoService.originalImgUrl,t?.featureType).then(i=>{this.aiPhotoService.originalImgUrl=this.aiPhotoService.imgUrl=i?.imgUrl}).catch(()=>{this.aiPhotoService.inProgress=!1}))}ngOnDestroy(){this.aiPhotoService.sampleImageUrl="",this.aiPhotoService.cleanup(),this.loggedInObserver&&this.loggedInObserver.unsubscribe(),this.usrPropChangedObserver&&this.usrPropChangedObserver.unsubscribe(),this.checkStatusSub&&this.checkStatusSub.unsubscribe(),document.body.classList.remove("overflow-hidden")}unloadNotification(t){this.canDeactivate()||(t.returnValue=!0)}canDeactivate(){return!this.aiPhotoService.isDirty}getEditorType(){return this.editorType}selectAllChanged(t){this.aiPhotoheader.isSelectAll=t}headerselectAllChanged(t){this.aiPortraitgen.showcheckAiImages=t}downloadAllDisabled(t){this.aiPhotoheader.isDownloadDisabled=t}removeAds(){this.user?this.subsService.upgradePlanCheckout("","","Remove_Ads_"+this.activeToolPanel,t=>{this.user=this.authService.currentUser(),this.checkAds()}):this.openLoginDialogWithSubscription()}openLoginDialogWithSubscription(t=null,n=null){this.loginService.openLoginDialog(i=>{this.user=this.authService.currentUser(),this.user&&!this.user.subscribed?this.removeAds():t&&(this.showAds=!1,t())},!0,n)}getStoryPageContent(t=null){this.storyPageService.getStoryPageContent(x.b.slug.aiEditorTools,x.b.slug.aiEditorTools,x.b.slug.aiEditorTools,n=>{const i=n.body.storyPage;i&&i.sections&&i.sections.length>0&&(this.aiPhotoService.toolList=i.sections.find(a=>a.type==x.b.slug.aiEditorTools).steps,this.aiPhotoService.toolList.length>0&&this.aiPhotoService.toolList.forEach(a=>{a.links.forEach((d,g)=>{d.id=`${d.metadata.featureType}-${g+1}`})})),t&&t()},n=>{this.isLoaded=!0,console.log(n),t&&t()},"en")}}return(r=l).\u0275fac=function(t){return new(t||r)(e.rXU(G.M),e.rXU(y.nX),e.rXU(U.s),e.rXU(ee),e.rXU(N.u),e.rXU(s.Vw),e.rXU(f.Bq),e.rXU(k.x),e.rXU(K.W),e.rXU(fe.M),e.rXU(se.n),e.rXU(ye.H),e.rXU(Be.w),e.rXU(ve.L),e.rXU(s.aZ),e.rXU(Ge.k),e.rXU(Ie.K),e.rXU(e.sFG))},r.\u0275cmp=e.VBU({type:r,selectors:[["app-ai-photo-editor-ui"]],viewQuery:function(t,n){if(1&t&&(e.GBs(oc,7),e.GBs(ic,5)),2&t){let i;e.mGM(i=e.lsd())&&(n.aiPhotoheader=i.first),e.mGM(i=e.lsd())&&(n.aiPortraitgen=i.first)}},hostBindings:function(t,n){1&t&&e.bIt("beforeunload",function(a){return n.unloadNotification(a)},!1,e.tSv)},features:[e.Jv_([$.W,k.x,ee])],decls:21,vars:12,consts:[["page",""],["aiPhotoheader",""],["aiPortraitgen",""],[1,"page","video-editor","editor-tool-panel",3,"ngClass"],[1,"position-relative"],[3,"selectAllChanged","imgUrl","activeTool"],["id","editor-view",1,"editor-view","ai-editor-view"],[1,"row","m-0","h-100","g-0"],[1,"col-i","left-panel"],[1,"col-i","navs","h-100","bg-white"],[3,"activeTool"],[1,"col-i","navs-drawer","h-100","bg-white"],[4,"ngIf"],[1,"col-i","wrapper-for-timeline"],[1,"row","no-margin","main-content","g-0",2,"width","100%","overflow","auto"],["class","blank-section d-flex align-items-center justify-content-center flex-column h-100",4,"ngIf"],["class","upload-progress-overlay circle-animation full-bg-animation",4,"ngIf"],["class","d-flex align-items-center display-ads-section position-absolute w-100",4,"ngIf"],[3,"ngSwitch"],[4,"ngSwitchCase"],[1,"blank-section","d-flex","align-items-center","justify-content-center","flex-column","h-100"],["class","d-flex align-items-center justify-content-center w-100",4,"ngIf"],["class","d-flex align-items-center justify-content-center w-100 flex-column",4,"ngIf"],[1,"d-flex","align-items-center","justify-content-center","w-100"],["width","600px","height","400px","alt","No Preview Image",3,"src"],[1,"d-flex","align-items-center","justify-content-center","w-100","flex-column"],["src","https://static.lightxeditor.com/assets/images/no-preview-image.png","width","127px","height","114px","alt","No Preview Image"],[1,"mt-4"],[3,"changeToolName","genAsInputImageEvent","selectAllChanged","downloadAllDisabled","activeToolPanel"],[1,"upload-progress-overlay","circle-animation","full-bg-animation"],[1,"inner"],["size","lg",3,"progress","message","indeterminate"],["type","button","class","btn btn-primary btn-h48 text-semi upload-progress-cancel mt-4",3,"click",4,"ngIf"],[1,"canvas"],[1,"aurora-bg"],[1,"blob","blob-1"],[1,"blob","blob-2"],[1,"blob","blob-3"],["type","button",1,"btn","btn-primary","btn-h48","text-semi","upload-progress-cancel","mt-4",3,"click"],[1,"d-flex","align-items-center","display-ads-section","position-absolute","w-100"],[1,"d-flex","align-items-center","justify-content-center","leaderboard-area"],["data-ad-client","ca-pub-4500187821001787","data-ad-slot","6146054956","data-ad-format","horizontal","data-full-width-responsive","true",1,"adsbygoogle","ad_responsive_1",2,"display","block","height","90px","width","730px"],[1,"button-col","d-flex","align-items-center","justify-content-center"],[1,"btn-all","btn-outline-primary","border-btn-gradiant","text-13","btn-h32","border-0","border-radius-12","text-semi","ps-2","pe-2",3,"click"],["name","prousernew",1,"f-16"],[1,"text-black"]],template:function(t,n){if(1&t){const i=e.RV6();e.j41(0,"div",3,0),e.nrm(2,"app-top-strip",4),e.j41(3,"editor-header",5,1),e.bIt("selectAllChanged",function(d){return e.eBV(i),e.Njj(n.headerselectAllChanged(d))}),e.k0s(),e.j41(5,"div",6)(6,"div",7)(7,"aside",8)(8,"div",7)(9,"div",9),e.nrm(10,"toolbar-navigation",10),e.k0s(),e.j41(11,"div",11)(12,"div",7)(13,"div"),e.DNE(14,_c,7,
16,"ng-container",12),e.k0s()()()()(),e.j41(15,"div",13)(16,"div",14),e.DNE(17,mc,3,2,"div",15)(18,hc,3,1,"ng-container",12),e.k0s()()()(),e.DNE(19,Pc,9,4,"div",16)(20,fc,8,0,"div",17),e.k0s()}2&t&&(e.Y8G("ngClass",e.l_i(9,rc,!n.user||!n.user.subscribed,!n.showAds)),e.R7$(3),e.Y8G("imgUrl",n.imgUrl)("activeTool",n.activeToolPanel),e.R7$(7),e.Y8G("activeTool",n.activeToolPanel),e.R7$(4),e.Y8G("ngIf",n.isLoaded),e.R7$(3),e.Y8G("ngIf",!(n.aiPhotoService.inProgress||n.aiPhotoService.inVideoProgress)&&n.aiPhotoService.aiImages&&0==n.aiPhotoService.aiImages.length),e.R7$(),e.Y8G("ngIf",n.isLoaded),e.R7$(),e.Y8G("ngIf",n.processingProgress.isActive&&n.processingProgress.fullscreen),e.R7$(),e.Y8G("ngIf",n.showAds))},dependencies:[s.YU,s.bT,s.ux,s.e1,we.g,L.b,je.Z,Dt,dn,un,Qo,gs,na,tc,nc],styles:[".loaded[_ngcontent-%COMP%]{box-shadow:0 0 12px #0000001a}.editor-view[_ngcontent-%COMP%]{min-width:920px}.btn-play[_ngcontent-%COMP%]{border-radius:50%;padding:10px;background:url(https://static.lightxeditor.com/assets/icons/play.svg) no-repeat}.canvas-loader[_ngcontent-%COMP%], .scene-preview-back[_ngcontent-%COMP%]{position:fixed;width:100%;height:100%;top:0;left:0;background:#000c;z-index:10000}.bottom-panel-wrapper[_ngcontent-%COMP%]{background:#fff;border-radius:12px 12px 0 0;box-shadow:0 0 12px #0000001a}.collapse-header[_ngcontent-%COMP%]{padding:1rem;border-bottom:solid 2px #e2e2e6}.timeline-canvas-wrapper[_ngcontent-%COMP%]{width:calc(100% - 51px);height:200px;overflow-x:auto}.timeline[_ngcontent-%COMP%]{width:100%}.bottom-panel[_ngcontent-%COMP%]{width:100%;display:block;background:#fff;overflow:hidden}.time-duration-container[_ngcontent-%COMP%]{border-radius:6px;width:118px;height:40px;background-color:#fff;border:solid 2px #475ae7}.time-duration-container[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{padding:0rem .5rem}.time-duration-container[_ngcontent-%COMP%] .btn.textblue[_ngcontent-%COMP%]{color:#475ae7}.layer-text[_ngcontent-%COMP%]{position:absolute;margin-top:64px}.collapse-header[_ngcontent-%COMP%]{padding:11px;border-bottom:1px solid #E2E3E9}.canvas-mask-wrapper[_ngcontent-%COMP%]{display:inline-flex;overflow:auto}.widthAdded[_ngcontent-%COMP%]{width:5.4rem}.widthRemoved[_ngcontent-%COMP%]{width:calc(100% - 5.4rem)}.widthRemoved.ps-0[_ngcontent-%COMP%]{padding-left:0!important}.layers-on[_ngcontent-%COMP%] .widthRemoved[_ngcontent-%COMP%]{width:calc(100% - 14.5rem)}.active[_ngcontent-%COMP%]{background:#626adf!important;border-radius:16px!important;color:#fff!important}.opacityactive[_ngcontent-%COMP%]{background:#626adf1a!important;color:#626adf!important;border-radius:16px!important}.opacitytext[_ngcontent-%COMP%], .nav-title-text[_ngcontent-%COMP%]{color:#626adf!important}.btn-bottom[_ngcontent-%COMP%]{width:40px;height:40px;padding:0rem;border-radius:12px;background:transparent}.canvas-progress[_ngcontent-%COMP%]{z-index:999;position:absolute;top:0;height:100%;width:100%;background:#fff;opacity:.7}.canvas-progress[_ngcontent-%COMP%] .inner[_ngcontent-%COMP%]{color:#898b8a;position:absolute;top:45%;left:45%}.upload-progress-overlay[_ngcontent-%COMP%]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:10000;display:flex;align-items:center;justify-content:center;background:#f9f9f9b3;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);pointer-events:auto}.upload-progress-overlay[_ngcontent-%COMP%] .inner[_ngcontent-%COMP%]{position:relative;z-index:2;display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100%}.upload-progress-overlay[_ngcontent-%COMP%] .upload-progress-cancel[_ngcontent-%COMP%]{min-width:120px;margin-top:48px}.dl-progress[_ngcontent-%COMP%]{width:320px;margin:auto;position:relative;background:#fff;opacity:.95}.pi-overlay-backdrop[_ngcontent-%COMP%]{position:fixed;height:100%;width:100%;top:0;left:0;background:#000c}.canvas-wrapper[_ngcontent-%COMP%]{position:relative}.audio-des[_ngcontent-%COMP%] .audio-n[_ngcontent-%COMP%]{font-size:16px;line-height:22px}.audio-des[_ngcontent-%COMP%] .audio-t[_ngcontent-%COMP%]{font-size:14px;line-height:19px;color:#000}.ai-editor-view[_ngcontent-%COMP%]{background:#f4f3f9}.ai-editor-view[_ngcontent-%COMP%] .left-panel[_ngcontent-%COMP%]{width:23.75rem;background:#fff;border-radius:0 16px 0 0;padding:0}.ai-editor-view[_ngcontent-%COMP%] .wrapper-for-timeline[_ngcontent-%COMP%] .main-content[_ngcontent-%COMP%] .blank-section[_ngcontent-%COMP%]{flex-direction:column;-webkit-user-select:none;user-select:none}.ai-editor-view[_ngcontent-%COMP%] .wrapper-for-timeline[_ngcontent-%COMP%] .main-content[_ngcontent-%COMP%] .blank-section[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px;color:#272b34}.bottom-btn[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%]{padding-bottom:0!important}.bottom-btn[_ngcontent-%COMP%] .position-absolute.fixed-bottom[_ngcontent-%COMP%]{display:none}.bottom-btn[_ngcontent-%COMP%] .refine-btn[_ngcontent-%COMP%]{display:block!important}.bottom-btn.bottom-fil[_ngcontent-%COMP%] .refine-btn[_ngcontent-%COMP%]{display:none!important}.ai-editor-view[_ngcontent-%COMP%] .left-panel[_ngcontent-%COMP%] .filter-drawer[_ngcontent-%COMP%] .middle-drawer[_ngcontent-%COMP%]{padding-top:112px!important;height:calc(100% - 80px)}@media (max-width: 1599.98px){.ai-editor-view[_ngcontent-%COMP%] .wrapper-for-timeline[_ngcontent-%COMP%]{width:calc(100% - 24rem)}.ai-editor-view[_ngcontent-%COMP%] .wrapper-for-timeline[_ngcontent-%COMP%] .main-content[_ngcontent-%COMP%]{height:100%}}@media (max-width: 2600px){.ai-editor-view[_ngcontent-%COMP%] .wrapper-for-timeline[_ngcontent-%COMP%]{width:calc(100% - 24rem)}.ai-editor-view[_ngcontent-%COMP%] .wrapper-for-timeline[_ngcontent-%COMP%] .main-content[_ngcontent-%COMP%]{height:100%}}.photoshoot-replace-none[_ngcontent-%COMP%]{display:none!important}.photoshoot-replace-active[_ngcontent-%COMP%]{display:block!important}.display-ads-section[_ngcontent-%COMP%]{border-top:1px solid #EEEDF3;background:#fff;padding-top:5px;justify-content:space-evenly}.display-ads-section[_ngcontent-%COMP%] .leaderboard-area[_ngcontent-%COMP%]{width:730px;height:90px;background:#d9d9d9;margin-left:16.5%}.display-ads-section[_ngcontent-%COMP%] .button-col[_ngcontent-%COMP%] .btn-h32[_ngcontent-%COMP%]{height:32px;background:transparent!important}.display-ads-section[_ngcontent-%COMP%] .button-col[_ngcontent-%COMP%] .btn-h32[_ngcontent-%COMP%]:hover{background:#626adf0d!important}"]}),l})(),canDeactivate:[ie.p]}];let Cc=(()=>{var r;class l{}return(r=l).\u0275fac=function(t){return new(t||r)},r.\u0275mod=e.$C({type:r}),r.\u0275inj=e.G2t({imports:[y.iI.forChild(bc),y.iI]}),l})();var vc=c(23679),Ic=c(79421),xc=c(13227),Mc=c(86924),Oc=c(90866),yc=c(7060),wc=c(30832),Ec=c(50173),Sc=c(6093),Tc=c(97858),Dc=c(24269),kc=c(16888),Rc=c(67381),Uc=c(23639);let Ac=(()=>{var r;class l{}return(r=l).\u0275fac=function(t){return new(t||r)},r.\u0275mod=e.$C({type:r}),r.\u0275inj=e.G2t({providers:[{provide:P.a7,useClass:S.z,multi:!0},et],imports:[s.MD,D.G,f.UN,f._f,u.YN,u.X1,Cc,Ic.r,vc.Y,X.MQ,xc.K,Mc.PhotoEditorUiModule,Ce.di,Oc.R,yc.U,wc._,pt.e,Ee.v9,Ec.x,Sc._,Tc.r,Dc.S,kc.T,Rc.G,Uc.I]}),l})()},35975:(_,p,c)=>{c.d(p,{e:()=>Le});var s=c(54438),P=c(16471),u=c(25119),f=c(80006),S=c(60177),D=c(48039),y=c(60004),ie=c(66035),$=c(33645),h=c(33391),k=c(87757),R=c(86820);const T=I=>({"ai-thumb-active":I}),W=()=>[0,1];function ne(I,j){if(1&I&&(s.j41(0,"div",12),s.EFF(1),s.k0s()),2&I){const v=s.XpG(3);s.R7$(),s.JRh(v.title)}}function Z(I,j){if(1&I){const v=s.RV6();s.qex(0),s.j41(1,"video",31,3),s.bIt("click",function(){s.eBV(v);const M=s.sdS(2),w=s.XpG().$implicit,V=s.XpG(2).$implicit,de=s.XpG(3);return s.Njj(de.selectImage(w,V,M))}),s.k0s(),s.bVm()}if(2&I){const v=s.XpG().$implicit,C=s.XpG(2).$implicit,M=s.XpG(3),w=s.sdS(3);s.R7$(),s.Y8G("src",v.videoThumbUrl,s.B4B)("ngbPopover",w)("muted",!0)("autoplay",!0)("popoverClass",M.getFormatClass(C.format)+" image-video-preview-popover"),s.BMQ("muted",!0)}}function F(I,j){if(1&I){const v=s.RV6();s.j41(0,"img",32),s.bIt("click",function(){s.eBV(v);const M=s.XpG().$implicit,w=s.XpG(2).$implicit,V=s.XpG(3);return s.Njj(V.selectImage(M,w,V.popOver))}),s.k0s()}if(2&I){const v=s.XpG().$implicit;s.Y8G("src",v.thumbUrl,s.B4B)}}function e(I,j){if(1&I&&(s.j41(0,"div",27)(1,"div",28),s.DNE(2,Z,3,6,"ng-container",29)(3,F,1,1,"ng-template",null,2,s.C5r),s.k0s(),s.j41(5,"span",30),s.EFF(6),s.k0s()()),2&I){const v=j.$implicit,C=s.sdS(4),M=s.XpG(5);s.Y8G("ngClass",s.eq3(4,T,v.productImageId==M.productImageId)),s.R7$(2),s.Y8G("ngIf",null==v?null:v.videoThumbUrl)("ngIfElse",C),s.R7$(4),s.JRh(v.displayName)}}function ee(I,j){if(1&I&&(s.j41(0,"div",24)(1,"div",25),s.DNE(2,e,7,6,"div",26),s.k0s()()),2&I){const v=s.XpG().$implicit,C=s.XpG(3);s.R7$(),s.Y8G("ngClass",C.getFormatClass(null==v?null:v.format)),s.R7$(),s.Y8G("ngForOf",v.storeProductImages.slice(0,2))}}function J(I,j){if(1&I){const v=s.RV6();s.qex(0),s.j41(1,"video",31,3),s.bIt("click",function(){s.eBV(v);const M=s.sdS(2),w=s.XpG().$implicit,V=s.XpG(2).$implicit,de=s.XpG(3);return s.Njj(de.selectImage(w,V,M))}),s.k0s(),s.bVm()}if(2&I){const v=s.XpG().$implicit,C=s.XpG(2).$implicit,M=s.XpG(3),w=s.sdS(3);s.R7$(),s.Y8G("src",v.videoThumbUrl,s.B4B)("ngbPopover",w)("muted",!0)("autoplay",!0)("popoverClass",M.getFormatClass(C.format)+" image-video-preview-popover"),s.BMQ("muted",!0)}}function x(I,j){if(1&I){const v=s.RV6();s.j41(0,"img",32),s.bIt("click",function(){s.eBV(v);const M=s.XpG().$implicit,w=s.XpG(2).$implicit,V=s.XpG(3);return s.Njj(V.selectImage(M,w,V.popOver))}),s.k0s()}if(2&I){const v=s.XpG().$implicit;s.Y8G("src",v.thumbUrl,s.B4B)}}function G(I,j){if(1&I&&(s.j41(0,"div",36)(1,"div",28),s.DNE(2,J,3,6,"ng-container",29)(3,x,1,1,"ng-template",null,2,s.C5r),s.k0s(),s.j41(5,"span",30),s.EFF(6),s.k0s()()),2&I){const v=j.$implicit,C=s.sdS(4),M=s.XpG(5);s.Y8G("ngClass",s.eq3(4,T,v.productImageId==M.productImageId)),s.R7$(2),s.Y8G("ngIf",null==v?null:v.videoThumbUrl)("ngIfElse",C),s.R7$(4),s.JRh(v.displayName)}}function U(I,j){1&I&&(s.j41(0,"div",38),s.nrm(1,"div",39)(2,"span",40),s.k0s())}function N(I,j){1&I&&(s.qex(0),s.DNE(1,U,3,0,"div",37),s.bVm()),2&I&&(s.R7$(),s.Y8G("ngForOf",s.lJ4(1,W)))}function K(I,j){if(1&I){const v=s.RV6();s.j41(0,"div",33)(1,"div",34),s.bIt("scrolled",function(){s.eBV(v);const M=s.XpG().$implicit,w=s.XpG(3);return s.Njj(w.onCategoryProductImagesScrollEnd(M.productId))}),s.j41(2,"div",25),s.DNE(3,G,7,6,"div",35)(4,N,2,2,"ng-container",4),s.k0s()()()}if(2&I){const v=s.XpG().$implicit,C=s.XpG(3);s.R7$(),s.xc7("max-height",C.getCategoryProductImagesHeight(v.productId),"px"),s.Y8G("scrollWindow",!1)("infiniteScrollDistance",.5)("infiniteScrollThrottle",100),s.BMQ("data-product-scroll",v.productId),s.R7$(),s.Y8G("ngClass",C.getFormatClass(null==v?null:v.format)),s.R7$(),s.Y8G("ngForOf",v.storeProductImages),s.R7$(),s.Y8G("ngIf",C.isCategoryProductImagesLoading(v.productId))}}function fe(I,j){if(1&I&&(s.j41(0,"div",13,1)(2,"div",14)(3,"div",15)(4,"button",16)(5,"h5",17),s.EFF(6),s.k0s()(),s.j41(7,"button",18)(8,"span",19),s.EFF(9,"See less"),s.k0s(),s.j41(10,"span",20),s.EFF(11,"See all"),s.k0s()()(),s.DNE(12,ee,3,2,"div",21),s.k0s(),s.j41(13,"div",22)(14,"div",23),s.DNE(15,K,5,9,"ng-template"),s.k0s()()()),2&I){const v=j.$implicit,C=j.index,M=s.sdS(1);
1s.Mz_("ngbAccordionItem","illus-panel-",C,""),s.R7$(3),s.Y8G("id",v.productId),s.BMQ("data-product-header",v.productId),s.R7$(3),s.SpI(" ",v.displayName,""),s.R7$(6),s.Y8G("ngIf",M.collapsed)}}function se(I,j){1&I&&(s.j41(0,"div",43),s.nrm(1,"div",44)(2,"div",45),s.k0s())}function ye(I,j){1&I&&(s.j41(0,"div",41),s.DNE(1,se,3,0,"div",42),s.k0s()),2&I&&(s.R7$(),s.Y8G("ngForOf",s.lJ4(1,W)))}function Be(I,j){if(1&I){const v=s.RV6();s.j41(0,"div",7),s.DNE(1,ne,2,1,"div",8),s.j41(2,"div",9),s.bIt("shown",function(M){s.eBV(v);const w=s.XpG(2);return s.Njj(w.onAccordionShown(M))}),s.DNE(3,fe,16,6,"div",10),s.k0s(),s.DNE(4,ye,2,2,"div",11),s.k0s()}if(2&I){const v=s.XpG(2);s.R7$(),s.Y8G("ngIf",v.title),s.R7$(),s.Y8G("closeOthers",!0)("animation",!1),s.R7$(),s.Y8G("ngForOf",v.storeProducts),s.R7$(),s.Y8G("ngIf",v.isCategoryProductsLoading&&!v.isCategoryProductsEnd)}}function ve(I,j){1&I&&(s.qex(0),s.nrm(1,"element-placeholder",46),s.bVm()),2&I&&(s.R7$(),s.Y8G("view","AiPatterns"))}function Ge(I,j){if(1&I&&(s.qex(0),s.j41(1,"div",5),s.DNE(2,Be,5,5,"div",6)(3,ve,2,1,"ng-container",4),s.k0s(),s.bVm()),2&I){const v=s.XpG();s.R7$(2),s.Y8G("ngIf",v.storeProducts.length),s.R7$(),s.Y8G("ngIf",!v.isLoaded)}}function Ie(I,j){if(1&I&&(s.j41(0,"div",51),s.EFF(1),s.k0s()),2&I){const v=s.XpG(3);s.R7$(),s.JRh(v.title)}}function we(I,j){if(1&I){const v=s.RV6();s.qex(0),s.j41(1,"video",31,3),s.bIt("click",function(){s.eBV(v);const M=s.sdS(2),w=s.XpG().$implicit,V=s.XpG(3);return s.Njj(V.selectImage(w,null,M))}),s.k0s(),s.bVm()}if(2&I){const v=s.XpG().$implicit,C=s.XpG(3),M=s.sdS(3);s.R7$(),s.Y8G("src",v.videoThumbUrl,s.B4B)("ngbPopover",M)("muted",!0)("autoplay",!0)("popoverClass",C.getFormatClass(C.storeProductImages[0].format)+" image-video-preview-popover"),s.BMQ("muted",!0)}}function L(I,j){if(1&I){const v=s.RV6();s.j41(0,"img",32),s.bIt("click",function(){s.eBV(v);const M=s.XpG().$implicit,w=s.XpG(3);return s.Njj(w.selectImage(M,null,w.popOver))}),s.k0s()}if(2&I){const v=s.XpG().$implicit;s.Y8G("src",v.thumbUrl,s.B4B)}}function je(I,j){if(1&I&&(s.j41(0,"div",36)(1,"div",28),s.DNE(2,we,3,6,"ng-container",29)(3,L,1,1,"ng-template",null,2,s.C5r),s.k0s(),s.j41(5,"span",30),s.EFF(6),s.k0s()()),2&I){const v=j.$implicit,C=s.sdS(4),M=s.XpG(3);s.Y8G("ngClass",s.eq3(4,T,v.productImageId==M.productImageId)),s.R7$(2),s.Y8G("ngIf",v.videoThumbUrl)("ngIfElse",C),s.R7$(4),s.JRh(v.displayName)}}function le(I,j){if(1&I&&(s.j41(0,"div",48),s.DNE(1,Ie,2,1,"div",49),s.j41(2,"div",50)(3,"div",25),s.DNE(4,je,7,6,"div",35),s.k0s()()()),2&I){const v=s.XpG(2);s.R7$(),s.Y8G("ngIf",v.title),s.R7$(2),s.Y8G("ngClass",v.getFormatClass(v.storeProductImages[0].format)),s.R7$(),s.Y8G("ngForOf",v.storeProductImages)}}function me(I,j){1&I&&(s.qex(0),s.nrm(1,"element-placeholder",46),s.bVm()),2&I&&(s.R7$(),s.Y8G("view","AiPatterns"))}function Fe(I,j){if(1&I&&(s.qex(0),s.j41(1,"div",5),s.DNE(2,le,5,3,"div",47)(3,me,2,1,"ng-container",4),s.k0s(),s.bVm()),2&I){const v=s.XpG();s.R7$(2),s.Y8G("ngIf",v.storeProductImages.length),s.R7$(),s.Y8G("ngIf",!v.storeProductImages.length)}}function Ne(I,j){if(1&I){const v=s.RV6();s.j41(0,"ai-video-preview",52),s.mxI("muteChange",function(M){s.eBV(v);const w=s.XpG();return s.DH7(w.mute,M)||(w.mute=M),s.Njj(M)}),s.k0s()}if(2&I){const v=s.XpG();s.Y8G("url",v.videoPreviewUrl),s.R50("mute",v.mute),s.Y8G("soundIconShow",!1)}}let Le=(()=>{var I;class j extends u._{constructor(C,M){super(),this.aiUploadImageService=C,this.hostRef=M,this.title=null,this.type="category",this.categoryId=0,this.productId=0,this.storeProducts=[],this.storeProductImages=[],this.productImageId=-1,this.isCategoryProductsLoading=!1,this.isCategoryProductsEnd=!1,this.categoryExpandedImagePagination={},this.selectStyleEvent=new s.bkB,this.listEndReached=new s.bkB,this.expandProduct=new s.bkB,this.categoryProductImagesEnd=new s.bkB,this.isLoaded=!1,this.mute=!0,this.drawerScroll=null,this.listEndEventEmitted=!1,this.activeCategoryProductId=0,this.expandedCategoryImagesHeight=280,this.scrollThresholdPx=24,this.drawerScrollHandler=w=>this.onDrawerScroll(w),this.windowResizeHandler=()=>this.refreshExpandedProductLayout(),this.featureType="",this.inProgress=!1}ngOnInit(){this.isLoaded=!0}ngAfterViewInit(){this.drawerScroll=this.getDrawerScroll(),this.drawerScroll&&this.drawerScroll.addEventListener("scroll",this.drawerScrollHandler,{passive:!0}),window.addEventListener("resize",this.windowResizeHandler,{passive:!0})}ngOnChanges(C){(C.storeProductImages||C.storeProducts||C.type)&&(this.listEndEventEmitted=!1,"category"!==this.type&&(this.activeCategoryProductId=0))}ngOnDestroy(){this.drawerScroll&&(this.drawerScroll.removeEventListener("scroll",this.drawerScrollHandler),this.drawerScroll=null),window.removeEventListener("resize",this.windowResizeHandler)}selectImage(C,M=null,w){this.featureType==P.Fs.ImageToAnimate&&this.inProgress||C&&(this.productImageId=C?.productImageId,this.videoPreviewUrl=C.imgUrl||
1C.videoThumbUrl,w&&this.manualTrigger(w),M&&(C.productData=M),this.selectStyleEvent.emit(C))}getFormatClass(C){return C?`format-${String(C).toLowerCase()}`:"format-default"}manualTrigger(C){this.popOver&&this.popOver.close(),this.popOver=C,this.popOver.open()}onCategoryAccordionShown(C){this.drawerScroll||(this.drawerScroll=this.getDrawerScroll());const M=this.storeProducts?.[C];M&&M.productId&&(this.activeCategoryProductId=M.productId,this.alignExpandedHeaderToTop(M.productId),this.refreshExpandedProductLayout(),this.expandProduct.emit({productId:M.productId,index:C}))}onAccordionShown(C){const M=this.getAccordionIndex(C);M<0||(this.scrollToAccordionPanel(C),this.onCategoryAccordionShown(M))}onCategoryProductImagesScrollEnd(C){C&&this.categoryProductImagesEnd.emit({productId:C})}isCategoryProductImagesLoading(C){if(!C)return!1;const M=this.categoryExpandedImagePagination?.[C];return!!M?.isLoading&&!M?.isEnd}getCategoryProductImagesHeight(C){return C&&this.activeCategoryProductId===C?this.expandedCategoryImagesHeight:null}onDrawerScroll(C){const M="product"===this.type&&!!this.storeProductImages?.length;if(!(M||"category"===this.type&&this.storeProducts?.length))return;const V=C?.target;V&&(V.scrollHeight-(V.scrollTop+V.clientHeight)<=this.scrollThresholdPx?this.listEndEventEmitted||(this.listEndEventEmitted=!0,this.listEndReached.emit(M?{viewType:"product",productId:this.productId||void 0}:{viewType:"category",productId:this.activeCategoryProductId||void 0})):this.listEndEventEmitted=!1)}getDrawerScroll(){return document.querySelector(".drawer-scroll.scroll-container.is-chrome")||this.hostRef.nativeElement.closest(".drawer-scroll")||this.hostRef.nativeElement.querySelector(".scroll-content")||document.querySelector(".drawer-scroll")||document.querySelector(".drawer-scroll.scroll-container")}refreshExpandedProductLayout(){if(!this.activeCategoryProductId)return;const C=()=>{if(this.drawerScroll||(this.drawerScroll=this.getDrawerScroll()),!this.drawerScroll)return;
1const M=this.hostRef.nativeElement.querySelector(`[data-product-scroll="${this.activeCategoryProductId}"]`);if(!M)return;const w=this.drawerScroll.getBoundingClientRect(),V=M.getBoundingClientRect(),de=Math.floor(w.bottom-V.top-12);this.expandedCategoryImagesHeight=Math.max(220,de)};setTimeout(C,0),setTimeout(C,160)}alignExpandedHeaderToTop(C){const M=()=>{if(this.drawerScroll||(this.drawerScroll=this.getDrawerScroll()),!this.drawerScroll)return;const w=this.hostRef.nativeElement.querySelector(`[data-product-header="${C}"]`);if(!w)return;const V=this.drawerScroll.getBoundingClientRect(),We=w.getBoundingClientRect().top-V.top;this.drawerScroll.scrollTo({top:Math.max(0,this.drawerScroll.scrollTop+We),behavior:"auto"})};setTimeout(M,0),setTimeout(M,120)}scrollToAccordionPanel(C){const M=()=>{if(this.drawerScroll||(this.drawerScroll=this.getDrawerScroll()),!this.drawerScroll||!C)return;const w=document.getElementById(C);w&&this.setActiveScrollPos(this.drawerScroll,w)};setTimeout(M,0),setTimeout(M,120)}getAccordionIndex(C){if(!C)return-1;const M=C.match(/illus-panel-(\d+)$/);if(!M)return-1;const w=Number(M[1]);return Number.isFinite(w)?w:-1}}return(I=j).\u0275fac=function(C){return new(C||I)(s.rXU(f.M),s.rXU(s.aKT))},I.\u0275cmp=s.VBU({type:I,selectors:[["preset-style"]],inputs:{title:"title",type:"type",categoryId:"categoryId",productId:"productId",storeProducts:"storeProducts",storeProductImages:"storeProductImages",productImageId:"productImageId",isCategoryProductsLoading:"isCategoryProductsLoading",isCategoryProductsEnd:"isCategoryProductsEnd",categoryExpandedImagePagination:"categoryExpandedImagePagination",featureType:"featureType",inProgress:"inProgress"},outputs:{selectStyleEvent:"selectStyleEvent",listEndReached:"listEndReached",expandProduct:"expandProduct",categoryProductImagesEnd:"categoryProductImagesEnd"},features:[s.Vt3,s.OA$],decls:4,vars:2,consts:[["popVideoPreview",""],["accItem","ngbAccordionItem"],["imageThumb",""],["popOver","ngbPopover"],[4,"ngIf"],[1,"d-flex","backgound-content","portrait-content"],["class","d-flex w-100 pane-section flex-column","id","scroll-adjuster",4,"ngIf"],["id","scroll-adjuster",1,"d-flex","w-100","pane-section","flex-column"],["class","d-flex align-items-center justify-content-start w-100 text-14 grey-800 text-semi h-32 ps-3",4,"ngIf"],["ngbAccordion","",3,"shown","closeOthers","animation"],["class","tab-div",3,"ngbAccordionItem",4,"ngFor","ngForOf"],["class","category-product-loading-placeholders",4,"ngIf"],[1,"d-flex","align-items-center","justify-content-start","w-100","text-14","grey-800","text-semi","h-32","ps-3"],[1,"tab-div",3,"ngbAccordionItem"],["ngbAccordionHeader",""],[1,"d-flex","align-items-center","mb-0","space-between","inner-collapse","ps-3",2,"min-height","32px",3,"id"],["type","button",1,"btn-acc-title","pe-none",2,"width","auto !important"],[1,"m-0","btn","btn-link","card-title","text-13"],["type","button","ngbAccordionButton","",1,"btn-collapse-expand","d-flex","align-items-center","border-radius-8","p-1","border-0","h-24"],[1,"collapse-text","text-11","grey-600"],[1,"expand-text","text-11","grey-600"],["class","content ps-3 pt-1",4,"ngIf"],["ngbAccordionCollapse",""],["ngbAccordionBody",""],[1,"content","ps-3","pt-1"],[1,"ai-thumb-list","d-flex","justify-content-between",3,"ngClass"],["class","ai-thumb-col d-flex align-items-center flex-column",3,"ngClass",4,"ngFor","ngForOf"],[1,"ai-thumb-col","d-flex","align-items-center","flex-column",3,"ngClass"],[1,"img-col","d-flex","align-items-center","border-radius-12","mb-1"],[4,"ngIf","ngIfElse"],[1,"text-semi","w-100","text-center"],["appPlayOnViewport","","disableRC","","width","115px","height","115px","triggers","manual","placement","right","loop","","playsinline","","autoClose","outside","container","body",3,"click","src","ngbPopover","muted","autoplay","popoverClass"],["disableRC","","width","115px","height","115px",3,"click","src"],[1,"content",2,"margin-right","-16px"],["customScrollDir","","infiniteScroll","",1,"category-product-images-scroll","scroll-container","pr-9","is-popover-tb-n","ps-3","pt-1",3,"scrolled","scrollWindow","infiniteScrollDistance","infiniteScrollThrottle"],["class","ai-thumb-col d-flex align-items-center justify-content-center flex-column",3,"ngClass",4,"ngFor","ngForOf"],[1,"ai-thumb-col","d-flex","align-items-center","justify-content-center","flex-column",3,"ngClass"],["class","ai-thumb-col d-flex align-items-center justify-content-center flex-column placeholder-thumb",4,"ngFor","ngForOf"],[1,"ai-thumb-col","d-flex","align-items-center","justify-content-center","flex-column","placeholder-thumb"],[1,"img-col","d-flex","align-items-center","border-radius-12","mb-1","skeleton-box"],[1,"skeleton-line"],[1,"category-product-loading-placeholders"],["class","category-product-loading-row",4,"ngFor","ngForOf"],[1,"category-product-loading-row"],[1,"category-product-loading-title"],[1,"category-product-loading-chevron"],[2,"padding","0p
1x 5px",3,"view"],["class","d-flex w-100 pane-section flex-column",4,"ngIf"],[1,"d-flex","w-100","pane-section","flex-column"],["class","d-flex align-items-center justify-content-start ps-3 w-100 text-14 grey-800 text-semi h-32",4,"ngIf"],[1,"content","mt-2","ps-3"],[1,"d-flex","align-items-center","justify-content-start","ps-3","w-100","text-14","grey-800","text-semi","h-32"],[3,"muteChange","url","mute","soundIconShow"]],template:function(C,M){1&C&&s.DNE(0,Ge,4,2,"ng-container",4)(1,Fe,4,2,"ng-container",4)(2,Ne,1,3,"ng-template",null,0,s.C5r),2&C&&(s.Y8G("ngIf","category"==M.type),s.R7$(),s.Y8G("ngIf","product"==M.type))},dependencies:[S.YU,S.Sq,S.bT,D.n,y.G,ie.F,$.q,h.WP,h.r6,h.tW,h.x7,h.UA,h.$R,h.ZM,k.n,R.D],styles:[".top-list-placeholders[_ngcontent-%COMP%]{gap:8px;flex-wrap:nowrap;white-space:nowrap;overflow:hidden}.top-placeholder-pill[_ngcontent-%COMP%]{flex:0 0 80px;width:80px;height:24px;border-radius:14px;background:linear-gradient(90deg,#f1f2f6 25%,#e5e7ef 37%,#f1f2f6 63%);background-size:400% 100%;animation:_ngcontent-%COMP%_drawer-skeleton-shimmer 1.2s ease-in-out infinite}.placeholder-thumb[_ngcontent-%COMP%] .skeleton-box[_ngcontent-%COMP%]{width:112px;height:112px;border-radius:12px;background:linear-gradient(90deg,#f1f2f6 25%,#e5e7ef 37%,#f1f2f6 63%);background-size:400% 100%;animation:_ngcontent-%COMP%_drawer-skeleton-shimmer 1.2s ease-in-out infinite}.placeholder-thumb[_ngcontent-%COMP%] .skeleton-line[_ngcontent-%COMP%]{width:72px;height:12px;border-radius:8px;background:linear-gradient(90deg,#f1f2f6 25%,#e5e7ef 37%,#f1f2f6 63%);background-size:400% 100%;animation:_ngcontent-%COMP%_drawer-skeleton-shimmer 1.2s ease-in-out infinite}@keyframes _ngcontent-%COMP%_drawer-skeleton-shimmer{0%{background-position:100% 0}to{background-position:0 0}}.ai-thumb-list[_ngcontent-%COMP%]{flex-flow:wrap}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%]{height:100%;width:112px!important;margin-bottom:16px;cursor:pointer;min-height:112px!important;min-width:112px!important;-webkit-user-select:none;user-select:none}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%]{transition:transform .2s;min-height:112px;min-width:112px}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%] img[_ngcontent-%COMP%], .ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%] video[_ngcontent-%COMP%]{width:100%;height:100%;border-radius:12px!important;max-height:112px;min-height:112px}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%]:hover{transform:scale(1.03)}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#272b34;font-size:12px;min-height:18px}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%]{min-height:112px!important;min-width:112px!important}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%]{transition:transform .2s}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%]:hover{transform:none}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] img[_ngcontent-%COMP%], .ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] video[_ngcontent-%COMP%]{border-radius:12px;border:2px solid #626ADF;padding:3px;transition:transform .2s}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] img[_ngcontent-%COMP%]:hover, .ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] video[_ngcontent-%COMP%]:hover{transform:scale(1.03)}.ai-thumb-list[_ngcontent-%COMP%] .ai-thumb-active[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#626adf}.ai-thumb-list.format-1[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%]{min-height:63px!important}.ai-thumb-list.format-1[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%]{min-height:63px}.ai-thumb-list.format-1[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%] img[_ngcontent-%COMP%], .ai-thumb-list.format-1[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%] video[_ngcontent-%COMP%]{max-height:63px;min-height:63px;object-fit:inherit}.ai-thumb-list.format-3[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%], .ai-thumb-list.format-3[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%]{min-height:200px!important}.ai-thumb-list.format-3[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%] img[_ngcontent-%COMP%], .ai-thumb-list.format-3[_ngcontent-%COMP%] .ai-thumb-col[_ngcontent-%COMP%] .img-col[_ngcontent-%COMP%] video[_ngcontent-%COMP%]{max-height:200px;min-height:200px;object-fit:inherit}.category-product-images-scroll[_ngcontent-%COMP%]{max-height:280px;overflow-y:auto}.category-product-loading-placeholders[_ngcontent-%COMP%]{padding:4px 0 0}.category-product-loading-row[_ngcontent-%COMP%]{min-height:32px;display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.category-product-loading-title[_ngcontent-%COMP%]{width:120px;height:12px;border-radius:8px;background:linear-gradient(90deg,#f1f2f6 25%,#e5e7ef 37%,#f1f2f6 63%);background-size:400% 100%;animation:_ngcontent-%COMP%_drawer-skeleton-shimmer 1.2s ease-in-out infinite}.category-product-loading-chevron[_ngcontent-%COMP%]{width:56px;height:24px;border-radius:8px;background:linear-gradient(90deg,#f1f2f6 25%,#e5e7ef 37%,#f1f2f6 63%);background-size:400% 100%;animation:_ngcontent-%COMP%_drawer-skeleton-shimmer 1.2s ease-in-out infinite}"]}),j})()},79745:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{x:()=>AiShootComponent});
1var C_projects_git_Andor_lightx_web_upgrade_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_22__=__webpack_require__(10467),_angular_core__WEBPACK_IMPORTED_MODULE_21__=__webpack_require__(54438),src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(16471),src_app_shared_constant_config__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(16478),src_app_shared_enums_template_placement_enum__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(92452),rxjs__WEBPACK_IMPORTED_MODULE_23__=__webpack_require__(54843),rxjs__WEBPACK_IMPORTED_MODULE_24__=__webpack_require__(41584),src_app_shared_enums_navigation_action_enum__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(67294),src_app_web_ai_video_template_template_detail_popup_template_detail_popup_component__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(99754),_pagination_utils__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(14398),src_app_core_services_auth_service__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(68010),_services_ai_photo_service__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(94223),src_app_editor_ui_services_media_content_service__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(62261),src_app_shared_services_ai_upload_image_service__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(80006),src_app_shared_services_create_popup_service__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(630),_angular_router__WEBPACK_IMPORTED_MODULE_25__=__webpack_require__(74710),src_app_shared_services_template_service__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(32764),src_app_editor_ui_components_workflow_ui_workflow_ui_service__WEBPACK_IMPORTED_MODULE_26__=__webpack_require__(42494),src_app_core_services_payment_service__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(10634),src_app_shared_toast_toast_service__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(74983),src_app_editor_editor_service__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__(1408),_ng_bootstrap_ng_bootstrap__WEBPACK_IMPORTED_MODULE_27__=__webpack_require__(33391),_angular_common__WEBPACK_IMPORTED_MODULE_28__=__webpack_require__(60177),_shared_ui_toogle_switch_toogle_switch_component__WEBPACK_IMPORTED_MODULE_29__=__webpack_require__(93391),_shared_ui_element_placeholder_element_placeholder_component__WEBPACK_IMPORTED_MODULE_30__=__webpack_require__(48039),_angular_forms__WEBPACK_IMPORTED_MODULE_31__=__webpack_require__(84341),_shared_ui_provideo_icon_provideo_icon_component__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__(68064),_ng_select_ng_select__WEBPACK_IMPORTED_MODULE_32__=__webpack_require__(89818),_shared_editor_ui_components_text_prompt_animation_text_prompt_animation_component__WEBPACK_IMPORTED_MODULE_33__=__webpack_require__(14845),_shared_widget_buttons_scroll_menu_buttons_scroll_menu_component__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__(36561),_components_workflow_ui_workflow_ui_component__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__(19567),_shared_ai_editor_components_file_upload_file_upload_component__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__(90811),_shared_components_video_generation_settings_video_generation_settings_component__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__(67381),_components_preset_style_preset_style_component__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__(35975);const _c0=_=>({"active-btn-tab":_}),_c1=()=>[],_c2=(_,p,c)=>({"info-up":_,"info-blue":p,"info-red":c}),_c3=_=>({"d-none":_});function AiShootComponent_ng_container_0_div_1_ng_container_1_Template(_,p){if(1&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.RV6();_angular_core__WEBPACK_IMPORTED_MODULE_21__.qex(0),_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(1,"div",8)(2,"div",9)(3,"buttons-scroll-menu",10),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bIt("selectLayout",function(P){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);const u=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(3);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(u.selectCategory(P))})("scrollEnd",function(){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);
1const P=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(3);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(P.onTopListScrollEnd())}),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s()()(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bVm()}if(2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(2).$implicit,s=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG();_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(3),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("items",s.categories)("type",null==c?null:c.uiType)("categoryId",s.prodCatId?s.prodCatId:s.categoryId)}}function AiShootComponent_ng_container_0_div_1_ng_container_2_div_2_Template(_,p){if(1&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.RV6();_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(0,"div",13)(1,"div",14),_angular_core__WEBPACK_IMPORTED_MODULE_21__.EFF(2,"Enable 2nd Image"),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(3,"div",15)(4,"toggle-switch",16),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bIt("changeT",function(P){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);const u=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(4);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(u.switchToggle=P)}),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s()()()}if(2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(4);_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(4),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("selected",c.switchToggle)}}function AiShootComponent_ng_container_0_div_1_ng_container_2_Template(_,p){if(1&_&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.qex(0),_angular_core__WEBPACK_IMPORTED_MODULE_21__.nrm(1,"app-file-upload",11),_angular_core__WEBPACK_IMPORTED_MODULE_21__.DNE(2,AiShootComponent_ng_container_0_div_1_ng_container_2_div_2_Template,5,1,"div",12),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bVm()),2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(2).$implicit,s=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG();_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("toolName",s.featureType)("version",s.switchToggle?"v3":(null==c.config?null:c.config.uploadVersion)||"v1"),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf","v1"==(null==c.config?null:c.config.uploadVersion)&&(null==c.config?null:c.config.switchToggle))}}function AiShootComponent_ng_container_0_div_1_ng_container_3_Template(_,p){if(1&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.RV6();_angular_core__WEBPACK_IMPORTED_MODULE_21__.qex(0),_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(1,"div",17)(2,"button",18),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bIt("click",function(){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);const P=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(3);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(P.onModeButtonClick("presets"))}),_angular_core__WEBPACK_IMPORTED_MODULE_21__.EFF(3),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(4,"button",19),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bIt("click",function(){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);const P=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(3);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(P.onModeButtonClick("custom"))}),_angular_core__WEBPACK_IMPORTED_MODULE_21__.EFF(5),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s()(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bVm()}if(2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(2).$implicit,s=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG();_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(2),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngClass",_angular_core__WEBPACK_IMPORTED_MODULE_21__.eq3(4,_c0,"presets"===s.selectedMode)),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.SpI(" ",(null==c.config||null==c.config.labels?null:c.config.labels.preset)||"Presets"," "),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngClass",_angular_core__WEBPACK_IMPORTED_MODULE_21__.eq3(6,_c0,"custom"===s.selectedMode)),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.SpI(" ",(null==c.config||null==c.config.labels?null:c.
1config.labels.custom)||"Custom"," ")}}function AiShootComponent_ng_container_0_div_1_div_4_ng_container_3_Template(_,p){if(1&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.RV6();_angular_core__WEBPACK_IMPORTED_MODULE_21__.qex(0),_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(1,"preset-style",22),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bIt("selectStyleEvent",function(P){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);const u=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(4);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(u.selectImage(P))})("expandProduct",function(P){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);const u=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(4);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(u.onCategoryExpandProduct(P))})("listEndReached",function(P){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);const u=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(4);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(u.onProductImagesListEnd(P))})("categoryProductImagesEnd",function(P){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);const u=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(4);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(u.onCategoryProductImagesEnd(P))}),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bVm()}if(2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(4);_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("type","category")("storeProducts",c.storeProducts)("productImageId",c.productImageId)("isCategoryProductsLoading",c.isLoadingMoreCategoryProducts)("isCategoryProductsEnd",c.isCategoryProductsEnd)("categoryExpandedImagePagination",c.categoryExpandedImagePagination)("title",null==c.layoutConfig?null:c.layoutConfig.presetTitle)("featureType",c.featureType)("inProgress",c.aiPhotoService.inProgress||c.aiPhotoService.inVideoProgress)}}function AiShootComponent_ng_container_0_div_1_div_4_ng_container_4_div_2_div_1_Template(_,p){1&_&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(0,"div",27),_angular_core__WEBPACK_IMPORTED_MODULE_21__.nrm(1,"div",28)(2,"span",29),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s())}function AiShootComponent_ng_container_0_div_1_div_4_ng_container_4_div_2_Template(_,p){if(1&_&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(0,"div",25),_angular_core__WEBPACK_IMPORTED_MODULE_21__.DNE(1,AiShootComponent_ng_container_0_div_1_div_4_ng_container_4_div_2_div_1_Template,3,0,"div",26),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s()),2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(5);_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngForOf",c.paginationPlaceholders)}}function AiShootComponent_ng_container_0_div_1_div_4_ng_container_4_Template(_,p){if(1&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.RV6();_angular_core__WEBPACK_IMPORTED_MODULE_21__.qex(0),_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(1,"preset-style",23),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bIt("selectStyleEvent",function(P){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);const u=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(4);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(u.selectImage(P))})("listEndReached",function(P){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);const u=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(4);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(u.onProductImagesListEnd(P))}),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.DNE(2,AiShootComponent_ng_container_0_div_1_div_4_ng_container_4_div_2_Template,2,1,"div",24),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bVm()}if(2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(4);_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("type","product")("productId",(null==c.selectedProduct?null:c.selectedProduct.productId)||0)("storeProductImages",(null==c.selectedProduct?null:c.selectedProduct.storeProductImages)||_angular_core__WEBPACK_IMPORTED_MODULE_21__.lJ4(8,_c1))("productImageId",c.productImageId)("title",null==c.layoutConfig?null:c.layoutConfig.presetTitle)("featureType",c.featureType)("inProgress",c.aiPhotoService.inProgress||c.aiPhotoService.inVideoProgress),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf",c.isProductFilterMode()&&c.isLoadingMoreSelectedProductImages&&!c.isSelectedProductImagesEnd)}}function AiShootComponent_ng_container_0_div_1_div_4_ng_container_5_Template(_,p){1&_&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.qex(0),_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(1,"div",30),_angular_core__WEBPACK_IMPORTED_MODULE_21__.nrm(2,"element-placeholder",31),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bVm()),2&_&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(2),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("view","AiPatterns"))}function AiShootComponent_ng_container_0_div_1_div_4_Template(_,p){if(1&_&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(0,"div")(1,"div",20)(2,"div",21),_angular_core__WEBPACK_IMPORTED_MODULE_21__.DNE(3,AiShootComponent_ng_container_0_div_1_div_4_ng_container_3_Template,2,9,"ng-container",6)(4,AiShootComponent_ng_container_0_div_1_div_4_ng_container_4_Template,3,9,"ng-container",6)(5,AiShootComponent_ng_container_0_div_1_div_4_ng_container_5_Template,3,1,"ng-container",6),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s()()()),2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG
1(3);_angular_core__WEBPACK_IMPORTED_MODULE_21__.AVh("d-none","presets"!==c.selectedMode),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(3),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf",c.storeProducts.length&&!c.prodCatId),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf",c.selectedProduct&&c.prodCatId),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf",!c.isLoaded)}}function AiShootComponent_ng_container_0_div_1_Template(_,p){if(1&_&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(0,"div",5),_angular_core__WEBPACK_IMPORTED_MODULE_21__.DNE(1,AiShootComponent_ng_container_0_div_1_ng_container_1_Template,4,3,"ng-container",6)(2,AiShootComponent_ng_container_0_div_1_ng_container_2_Template,3,3,"ng-container",6)(3,AiShootComponent_ng_container_0_div_1_ng_container_3_Template,6,8,"ng-container",6)(4,AiShootComponent_ng_container_0_div_1_div_4_Template,6,5,"div",7),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s()),2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG().$implicit,s=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG();_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngClass","row-"+c.id),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf",("filter-product"===c.type||"filter-category"===c.type)&&(null==s.categories?null:s.categories.length)),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf","file-upload"===c.type),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf","preset-button"===c.type),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf","presets-panel"===c.type)}}function AiShootComponent_ng_container_0_Template(_,p){if(1&_&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.qex(0),_angular_core__WEBPACK_IMPORTED_MODULE_21__.DNE(1,AiShootComponent_ng_container_0_div_1_Template,5,5,"div",4),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bVm()),2&_){const c=p.$implicit,s=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG();_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf",s.shouldShowRow(c)&&s.evaluateCondition(c.condition)&&s.isLoaded)}}function AiShootComponent_div_1_ng_container_1_div_1_div_1_pi_2_Template(_,p){if(1&_&&_angular_core__WEBPACK_IMPORTED_MODULE_21__.nrm(0,"pi",38),2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(3).$implicit;_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngbPopover",c.help)("popoverTitle",c.title)}}function AiShootComponent_div_1_ng_container_1_div_1_div_1_Template(_,p){if(1&_&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(0,"div",36),_angular_core__WEBPACK_IMPORTED_MODULE_21__.EFF(1),_angular_core__WEBPACK_IMPORTED_MODULE_21__.DNE(2,AiShootComponent_div_1_ng_container_1_div_1_div_1_pi_2_Template,1,2,"pi",37),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s()),2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(2).$implicit;_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.SpI(" ",c.title," "),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf",c.help)}}function AiShootComponent_div_1_ng_container_1_div_1_Template(_,p){if(1&_&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(0,"div",34),_angular_core__WEBPACK_IMPORTED_MODULE_21__.DNE(1,AiShootComponent_div_1_ng_container_1_div_1_div_1_Template,3,2,"div",35),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s()),2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG().$implicit;_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf",null==c?null:c.title)}}function AiShootComponent_div_1_ng_container_1_ng_container_2_div_6_span_2_Template(_,p){if(1&_&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(0,"span",49),_angular_core__WEBPACK_IMPORTED_MODULE_21__.EFF(1),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s()),2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG
1(3).$implicit,s=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(2);_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Lme("",s.customPrompt.length,"/",(null==c.content?null:c.content.maxLength)||s.maxLenght,"")}}function AiShootComponent_div_1_ng_container_1_ng_container_2_div_6_Template(_,p){if(1&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.RV6();_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(0,"div",46)(1,"text-prompt-animation",47),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bIt("changePrompt",function(P){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);const u=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(4);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(u.changePrompt(P))})("focusOut",function(P){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);const u=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(4);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(u.onFocusOut(P))}),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.DNE(2,AiShootComponent_div_1_ng_container_1_ng_container_2_div_6_span_2_Template,2,2,"span",48),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s()}if(2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(2).$implicit,s=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(2);_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngClass",_angular_core__WEBPACK_IMPORTED_MODULE_21__.sMw(6,_c2,s.customPrompt.length,s.isFocused,s.customPrompt.length>=((null==c.content?null:c.content.maxLength)||s.maxLenght))),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("prompts",s.prompts)("maxLength",(null==c.content?null:c.content.maxLength)||s.maxLenght)("textPrompt",s.customPrompt)("promptResetHeight",s.promptResetHeight),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf",s.customPrompt.length)}}function AiShootComponent_div_1_ng_container_1_ng_container_2_div_7_Template(_,p){if(1&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.RV6();_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(0,"div",50)(1,"div",51)(2,"buttons-scroll-menu",52),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bIt("selectLayout",function(P){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);const u=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(4);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(u.selectPrompt(P))}),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s()()()}if(2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(4);_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(2),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("items",c.prompts)("type","prompt")}}function AiShootComponent_div_1_ng_container_1_ng_container_2_Template(_,p){if(1&_&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.qex(0),_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(1,"div",39)(2,"div",40)(3,"div",41)(4,"div",42)(5,"div",43),_angular_core__WEBPACK_IMPORTED_MODULE_21__.DNE(6,AiShootComponent_div_1_ng_container_1_ng_container_2_div_6_Template,3,10,"div",44)(7,AiShootComponent_div_1_ng_container_1_ng_container_2_div_7_Template,3,2,"div",45),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s()()()()(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bVm()),2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(3);_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(6),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf",c.isPromptLoaded),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf",null==c.prompts?null:c.prompts.length)}}function AiShootComponent_div_1_ng_container_1_ng_container_3_Template(_,p){if(1&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.RV6();_angular_core__WEBPACK_IMPORTED_MODULE_21__.qex(0),_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(1,"div",39)(2,"div",40)(3,"div",41)(4,"div",42)(5,"div",41)(6,"workflow-ui",53),_angular_core__WEBPACK_IMPORTED_MODULE_21__.mxI("productConfigChange",function(P){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);
1const u=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(3);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.DH7(u.productConfig,P)||(u.productConfig=P),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(P)}),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bIt("productConfigChange",function(P){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);const u=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(3);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(u.productConfigChange(P))}),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s()()()()()(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bVm()}if(2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(3);_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(6),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R50("productConfig",c.productConfig),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("workflowList",c.workflowList)("inProgress",c.aiPhotoService.inProgress)}}function AiShootComponent_div_1_ng_container_1_ng_container_4_Template(_,p){1&_&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.qex(0),_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(1,"div",54),_angular_core__WEBPACK_IMPORTED_MODULE_21__.nrm(2,"app-file-upload",55),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bVm()),2&_&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(2),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("version","v4"))}function AiShootComponent_div_1_ng_container_1_ng_container_5_ng_c
1ontainer_2_Template(_,p){if(1&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.RV6();_angular_core__WEBPACK_IMPORTED_MODULE_21__.qex(0),_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(1,"preset-style",56),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bIt("selectStyleEvent",function(P){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);const u=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(4);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(u.selectImage(P))})("expandProduct",function(P){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);const u=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(4);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(u.onCategoryExpandProduct(P))})("listEndReached",function(P){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);const u=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(4);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(u.onProductImagesListEnd(P))})("categoryProductImagesEnd",function(P){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);const u=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(4);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(u.onCategoryProductImagesEnd(P))}),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bVm()}if(2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(4);_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("type","category")("storeProducts",c.storeProducts)("productImageId",c.productImageId)("isCategoryProductsLoading",c.isLoadingMoreCategoryProducts)("isCategoryProductsEnd",c.isCategoryProductsEnd)("categoryExpandedImagePagination",c.categoryExpandedImagePagination)("featureType",c.featureType)("inProgress",c.aiPhotoService.inProgress||c.aiPhotoService.inVideoProgress)}}function AiShootComponent_div_1_ng_container_1_ng_container_5_ng_c
1ontainer_3_Template(_,p){1&_&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.qex(0),_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(1,"div",30),_angular_core__WEBPACK_IMPORTED_MODULE_21__.nrm(2,"element-placeholder",31),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bVm()),2&_&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(2),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("view","AiPatterns"))}function AiShootComponent_div_1_ng_container_1_ng_container_5_Template(_,p){if(1&_&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.qex(0),_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(1,"div",39),_angular_core__WEBPACK_IMPORTED_MODULE_21__.DNE(2,AiShootComponent_div_1_ng_container_1_ng_container_5_ng_container_2_Template,2,8,"ng-container",6)(3,AiShootComponent_div_1_ng_container_1_ng_container_5_ng_container_3_Template,3,1,"ng-container",6),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bVm()),2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(3);_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(2),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf",c.storeProducts.length),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf",!c.isLoaded)}}function AiShootComponent_div_1_ng_container_1_Template(_,p){if(1&_&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.qex(0),_angular_core__WEBPACK_IMPORTED_MODULE_21__.DNE(1,AiShootComponent_div_1_ng_container_1_div_1_Template,2,1,"div",33)(2,AiShootComponent_div_1_ng_container_1_ng_container_2_Template,8,2,"ng-container",6)(3,AiShootComponent_div_1_ng_container_1_ng_container_3_Template,7,3,"ng-container",6)(4,AiShootComponent_div_1_ng_container_1_ng_container_4_Template,3,1,"ng-container",6)(5,AiShootComponent_div_1_ng_container_1_ng_container_5_Template,4,2,"ng-container",6),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bVm()),2&_){const c=p.$implicit,s=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(2);_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf","workflow-panel"!==c.type||"workflow-panel"===c.type&&s.productConfig),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf","prompt-panel"===c.type),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf","workflow-panel"===c.type&&s.productConfig),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf","custom-upload-panel"===c.type),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf","presets-panel"===c.type)}}function AiShootComponent_div_1_Template(_,p){if(1&_&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(0,"div",32),_angular_core__WEBPACK_IMPORTED_MODULE_21__.DNE(1,AiShootComponent_div_1_ng_container_1_Template,6,5,"ng-container",1),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s()),2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG();_angular_core__WEBPACK_IMPORTED_MODULE_21__.AVh("d-none","presets"==c.selectedMode),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngForOf",c.panels)}}function AiShootComponent_div_2_ng_container_2_div_1_div_4_pi_2_Template(_,p){if(1&_&&_angular_core__WEBPACK_IMPORTED_MODULE_21__.nrm(0,"pi",38),2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(3).$implicit;_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngbPopover",c.help)("popoverTitle",c.title)}}function AiShootComponent_div_2_ng_container_2_div_1_div_4_Template(_,p){if(1&_&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(0,"div",71),_angular_core__WEBPACK_IMPORTED_MODULE_21__.EFF(1),_angular_core__WEBPACK_IMPORTED_MODULE_21__.DNE(2,AiShootComponent_div_2_ng_container_2_div_1_div_4_pi_2_Template,1,2,"pi",37),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s()),2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(2).$implicit;_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.SpI(" ",c.title," "),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf",c.help)}}function AiShootComponent_div_2_ng_container_2_div_1_ng_template_12_ng_container_0_span_8_Template(_,p){if(1&_&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(0,"span",49),_angular_core__WEBPACK_IMPORTED_MODULE_21__.EFF(1),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s()),2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG
1(4).$implicit,s=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(2);_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Lme("",s.customPrompt.length,"/",(null==c.content?null:c.content.maxLength)||450,"")}}function AiShootComponent_div_2_ng_container_2_div_1_ng_template_12_ng_container_0_div_9_Template(_,p){if(1&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.RV6();_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(0,"div",50)(1,"div",51)(2,"buttons-scroll-menu",52),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bIt("selectLayout",function(P){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);const u=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(6);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(u.selectPrompt(P))}),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s()()()}if(2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(6);_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(2),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("items",c.prompts)("type","prompt")}}function AiShootComponent_div_2_ng_container_2_div_1_ng_template_12_ng_container_0_Template(_,p){if(1&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.RV6();_angular_core__WEBPACK_IMPORTED_MODULE_21__.qex(0),_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(1,"div",72)(2,"div",40)(3,"div",41)(4,"div",42)(5,"div",43)(6,"div",46)(7,"text-prompt-animation",47),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bIt("changePrompt",function(P){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);const u=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(5);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(u.changePrompt(P))})("focusOut",function(P){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);const u=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(5);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(u.onFocusOut(P))}),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.DNE(8,AiShootComponent_div_2_ng_container_2_div_1_ng_template_12_ng_container_0_span_8_Template,2,2,"span",48),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.DNE(9,AiShootComponent_div_2_ng_container_2_div_1_ng_template_12_ng_container_0_div_9_Template,3,2,"div",45),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s()()()()(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bVm()}if(2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(3).$implicit,s=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(2);_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(6),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngClass",_angular_core__WEBPACK_IMPORTED_MODULE_21__.sMw(7,_c2,s.customPrompt.length,s.isFocused,s.customPrompt.length>=((null==c.content?null:c.content.maxLength)||450))),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("prompts",s.prompts)("maxLength",(null==c.content?null:c.content.maxLength)||450)("textPrompt",s.customPrompt)("promptResetHeight",s.promptResetHeight),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf",s.customPrompt.length),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf",null==s.prompts?null:s.prompts.length)}}function AiShootComponent_div_2_ng_container_2_div_1_ng_template_12_ng_container_1_Template(_,p){if(1&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.RV6();_angular_core__WEBPACK_IMPORTED_MODULE_21__.qex(0),_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(1,"div",39)(2,"div",40)(3,"div",41)(4,"div",42)(5,"div",41)(6,"workflow-ui",53),_angular_core__WEBPACK_IMPORTED_MODULE_21__.mxI("productConfigChange",function(P){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);const u=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(5);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.DH7(u.productConfig,P)||(u.productConfig=P),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(P)}),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bIt("productConfigChange",function(P){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);
1const u=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(5);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(u.productConfigChange(P))}),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s()()()()()(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bVm()}if(2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(5);_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(6),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R50("productConfig",c.productConfig),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("workflowList",c.workflowList)("inProgress",c.aiPhotoService.inProgress)}}function AiShootComponent_div_2_ng_container_2_div_1_ng_template_12_ng_container_2_Template(_,p){1&_&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.qex(0),_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(1,"div",39)(2,"div",40)(3,"div",41)(4,"div",42)(5,"div",41),_angular_core__WEBPACK_IMPORTED_MODULE_21__.nrm(6,"app-file-upload",55),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s()()()()(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bVm()),2&_&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(6),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("version","v4"))}function AiShootComponent_div_2_ng_container_2_div_1_ng_template_12_ng_container_3_ng_container_2_Template(_,p){if(1&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.RV6();_angular_core__WEBPACK_IMPORTED_MODULE_21__.qex(0),_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(1,"preset-style",56),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bIt("selectStyleEvent",function(P){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);const u=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(6);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(u.selectImage(P))})("expandProduct",function(P){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);const u=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(6);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(u.onCategoryExpandProduct(P))})("listEndReached",function(P){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);const u=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(6);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(u.onProductImagesListEnd(P))})("categoryProductImagesEnd",function(P){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);const u=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(6);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(u.onCategoryProductImagesEnd(P))}),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bVm()}if(2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(6);_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("type","category")("storeProducts",c.storeProducts)("productImageId",c.productImageId)("isCategoryProductsLoading",c.isLoadingMoreCategoryProducts)("isCategoryProductsEnd",c.isCategoryProductsEnd)("categoryExpandedImagePagination",c.categoryExpandedImagePagination)("featureType",c.featureType)("inProgress",c.aiPhotoService.inProgress||c.aiPhotoService.inVideoProgress)}}function AiShootComponent_div_2_ng_container_2_div_1_ng_template_12_ng_container_3_ng_container_3_Template(_,p){1&_&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.qex(0),_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(1,"div",30),_angular_core__WEBPACK_IMPORTED_MODULE_21__.nrm(2,"element-placeholder",31),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bVm()),2&_&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(2),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("view","AiPatterns"))}function AiShootComponent_div_2_ng_container_2_div_1_ng_template_12_ng_container_3_Template(_,p){if(1&_&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.qex(0),_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(1,"div",39),_angular_core__WEBPACK_IMPORTED_MODULE_21__.DNE(2,AiShootComponent_div_2_ng_container_2_div_1_ng_template_12_ng_container_3_ng_container_2_Template,2,8,"ng-container",6)(3,AiShootComponent_div_2_ng_container_2_div_1_ng_template_12_ng_container_3_ng_container_3_Template,3,1,"ng-container",6),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bVm()),2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG
1(5);_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(2),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf",c.storeProducts.length),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf",!c.isLoaded)}}function AiShootComponent_div_2_ng_container_2_div_1_ng_template_12_Template(_,p){if(1&_&&_angular_core__WEBPACK_IMPORTED_MODULE_21__.DNE(0,AiShootComponent_div_2_ng_container_2_div_1_ng_template_12_ng_container_0_Template,10,11,"ng-container",6)(1,AiShootComponent_div_2_ng_container_2_div_1_ng_template_12_ng_container_1_Template,7,3,"ng-container",6)(2,AiShootComponent_div_2_ng_container_2_div_1_ng_template_12_ng_container_2_Template,7,1,"ng-container",6)(3,AiShootComponent_div_2_ng_container_2_div_1_ng_template_12_ng_container_3_Template,4,2,"ng-container",6),2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(2).$implicit;_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf","prompt-panel"===c.type),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf","workflow-panel"===c.type),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf","custom-upload-panel"===c.type),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf","presets-panel"===c.type)}}function AiShootComponent_div_2_ng_container_2_div_1_Template(_,p){if(1&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.RV6();_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(0,"div",60),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bIt("show",function(){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);const P=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG().$implicit,u=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(2);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(u.accPanelChanged({panelId:P.id,nextState:!0}))})("hide",function(){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);const P=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG().$implicit,u=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(2);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(u.accPanelChanged({panelId:P.id,nextState:!1}))}),_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(1,"div",61)(2,"div",34)(3,"button",62),_angular_core__WEBPACK_IMPORTED_MODULE_21__.DNE(4,AiShootComponent_div_2_ng_container_2_div_1_div_4_Template,3,2,"div",63),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(5,"button",64)(6,"span",65),_angular_core__WEBPACK_IMPORTED_MODULE_21__.nrm(7,"pi",66),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(8,"span",67),_angular_core__WEBPACK_IMPORTED_MODULE_21__.nrm(9,"pi",68),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s()()()(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(10,"div",69)(11,"div",70),_angular_core__WEBPACK_IMPORTED_MODULE_21__.DNE(12,AiShootComponent_div_2_ng_container_2_div_1_ng_template_12_Template,4,4,"ng-template"),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s()()()}if(2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG().$implicit,s=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(2);_angular_core__WEBPACK_IMPORTED_MODULE_21__.FS9("ngbAccordionItem",c.id),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngClass",_angular_core__WEBPACK_IMPORTED_MODULE_21__.eq3(7,_c3,!s.shouldShowPanel(c)||!s.evaluateCondition(c.condition)))("collapsed",s.activePanelId!==c.id),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(3),_angular_core__WEBPACK_IMPORTED_MODULE_21__.BMQ("aria-label","Toggle "+c.title+" panel"),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf",null==c?null:c.title),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.BMQ("aria-label","Toggle "+c.title+" panel")("title","Toggle "+c.title+" panel")}}function AiShootComponent_div_2_ng_container_2_Template(_,p){if(1&_&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.qex(0),_angular_core__WEBPACK_IMPORTED_MODULE_21__.DNE(1,AiShootComponent_div_2_ng_container_2_div_1_Template,13,9,"div",59),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bVm()),2&_){const c=p.$implicit,s=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG
1(2);_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf","workflow-panel"!==c.type||"workflow-panel"===c.type&&s.productConfig)}}function AiShootComponent_div_2_Template(_,p){if(1&_&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(0,"div",57)(1,"div",58),_angular_core__WEBPACK_IMPORTED_MODULE_21__.DNE(2,AiShootComponent_div_2_ng_container_2_Template,2,1,"ng-container",1),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s()()),2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG();_angular_core__WEBPACK_IMPORTED_MODULE_21__.AVh("d-none","presets"==c.selectedMode),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("closeOthers",!0),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngForOf",c.panels)}}function AiShootComponent_ng_container_3_div_1_ng_container_2_Conditional_2_Template(_,p){if(1&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.RV6();_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(0,"app-video-generation-settings",86),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bIt("selectionChange",function(P){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);const u=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(4);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(u.selectionChange(P))}),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s()}if(2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(4);_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("productCreditConfig",c.productCreditConfig)("selection",c.videoSettings)}}function AiShootComponent_ng_container_3_div_1_ng_container_2_Conditional_3_ng_template_2_Template(_,p){if(1&_&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(0,"div",90),_angular_core__WEBPACK_IMPORTED_MODULE_21__.EFF(1),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s()),2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(5);_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.SpI(" ",c.isVideo?"Aspect Ratio":"Resolution"," ")}}function AiShootComponent_ng_container_3_div_1_ng_container_2_Conditional_3_ng_option_3_span_8_Template(_,p){if(1&_&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(0,"span",98),_angular_core__WEBPACK_IMPORTED_MODULE_21__.EFF(1),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s()),2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG().$implicit;_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.SpI("",c.size," px")}}function AiShootComponent_ng_container_3_div_1_ng_container_2_Conditional_3_ng_option_3_Template(_,p){if(1&_&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(0,"ng-option",91)(1,"div",92)(2,"div",93),_angular_core__WEBPACK_IMPORTED_MODULE_21__.nrm(3,"pi",94),_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(4,"span",95),_angular_core__WEBPACK_IMPORTED_MODULE_21__.EFF(5),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(6,"span",96),_angular_core__WEBPACK_IMPORTED_MODULE_21__.EFF(7),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s()(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.DNE(8,AiShootComponent_ng_container_3_div_1_ng_container_2_Conditional_3_ng_option_3_span_8_Template,2,1,"span",97),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s()()),2&_){const c=p.$implicit,s=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(5);_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("value",c),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(3),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("name",c.icon),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(2),_angular_core__WEBPACK_IMPORTED_MODULE_21__.JRh(c.name),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(2),_angular_core__WEBPACK_IMPORTED_MODULE_21__.JRh(c.ratio),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf",!s.isVideo)}}function AiShootComponent_ng_container_3_div_1_ng_container_2_Conditional_3_Template(_,p){if(1&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.RV6();_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(0,"ng-select",87,0),_angular_core__WEBPACK_IMPORTED_MODULE_21__.mxI("ngModelChange",function(P){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);
1const u=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(4);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.DH7(u.selectedSize,P)||(u.selectedSize=P),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(P)}),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bIt("open",function(){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);const P=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(4);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(P.onDropdownOpen())})("close",function(){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);const P=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(4);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(P.onDropdownClose())}),_angular_core__WEBPACK_IMPORTED_MODULE_21__.DNE(2,AiShootComponent_ng_container_3_div_1_ng_container_2_Conditional_3_ng_template_2_Template,2,1,"ng-template",88)(3,AiShootComponent_ng_container_3_div_1_ng_container_2_Conditional_3_ng_option_3_Template,9,5,"ng-option",89),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s()}if(2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(4);_angular_core__WEBPACK_IMPORTED_MODULE_21__.R50("ngModel",c.selectedSize),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("searchable",!1)("clearable",!1),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(3),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngForOf",c.resolutions)}}function AiShootComponent_ng_container_3_div_1_ng_container_2_Template(_,p){if(1&_&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.qex(0),_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(1,"div",83),_angular_core__WEBPACK_IMPORTED_MODULE_21__.DNE(2,AiShootComponent_ng_container_3_div_1_ng_container_2_Conditional_2_Template,1,2,"app-video-generation-settings",84)(3,AiShootComponent_ng_container_3_div_1_ng_container_2_Conditional_3_Template,4,4,"ng-select",85),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bVm()),2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(3);_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(2),_angular_core__WEBPACK_IMPORTED_MODULE_21__.vxM(c.productCreditConfig&&c.isVideo?2:3)}}function AiShootComponent_ng_container_3_div_1_div_5_Template(_,p){1&_&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(0,"div",99)(1,"span",100),_angular_core__WEBPACK_IMPORTED_MODULE_21__.EFF(2,"Loading..."),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s()())}function AiShootComponent_ng_container_3_div_1_Template(_,p){if(1&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.RV6();_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(0,"div",5)(1,"div",74),_angular_core__WEBPACK_IMPORTED_MODULE_21__.DNE(2,AiShootComponent_ng_container_3_div_1_ng_container_2_Template,4,1,"ng-container",6),_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(3,"div",75)(4,"button",76),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bIt("click",function(){_angular_core__WEBPACK_IMPORTED_MODULE_21__.eBV(c);const P=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG(2);return _angular_core__WEBPACK_IMPORTED_MODULE_21__.Njj(P.generate())}),_angular_core__WEBPACK_IMPORTED_MODULE_21__.DNE(5,AiShootComponent_ng_container_3_div_1_div_5_Template,3,0,"div",77),_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(6,"span",78),_angular_core__WEBPACK_IMPORTED_MODULE_21__.EFF(7),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s()()(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(8,"div",79)(9,"span",80),_angular_core__WEBPACK_IMPORTED_MODULE_21__.EFF(10),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(11,"span",81),_angular_core__WEBPACK_IMPORTED_MODULE_21__.nrm(12,"img",82),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.j41(13,"span",80),_angular_core__WEBPACK_IMPORTED_MODULE_21__.EFF(14),_angular_core__WEBPACK_IMPORTED_MODULE_21__.k0s()()()()}if(2&_){const c=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG().$implicit,s=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG();_angular_core__WEBPACK_IMPORTED_MODULE_21__.AVh("d-none","imageanimate"==s.featureType),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngClass","row-"+c.id),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(2),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf",s.layoutConfig.isResolution),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(2),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("id",(null==c.config.button?null:c.
1config.button.id)||"gtm-generate")("disabled",s.disabled||s.layoutConfig.isFileUpload&&!(null!=s.aiPhotoService&&s.aiPhotoService.imgUrl)||s.isUploaded()&&!(null!=s.aiPhotoService&&s.aiPhotoService.originalImageUrlDuo)),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf",s.aiPhotoService.inProgress||s.isVideo&&s.aiPhotoService.inVideoProgress),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(2),_angular_core__WEBPACK_IMPORTED_MODULE_21__.JRh(s.aiPhotoService.inProgress||s.isVideo&&s.aiPhotoService.inVideoProgress?"Processing":s.btnText),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(3),_angular_core__WEBPACK_IMPORTED_MODULE_21__.JRh((null==c.config.credit?null:c.config.credit.text)||"1 generation ="),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(2),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("src",(null==c.config.credit?null:c.config.credit.coinImage)||"https://static.lightxeditor.com/assets/images/coin-lottie-s-anim.gif",_angular_core__WEBPACK_IMPORTED_MODULE_21__.B4B),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(2),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Lme("",s.credit," ",s.credit>1?"credits":"credit","")}}function AiShootComponent_ng_container_3_Template(_,p){if(1&_&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.qex(0),_angular_core__WEBPACK_IMPORTED_MODULE_21__.DNE(1,AiShootComponent_ng_container_3_div_1_Template,15,12,"div",73),_angular_core__WEBPACK_IMPORTED_MODULE_21__.bVm()),2&_){const c=p.$implicit,s=_angular_core__WEBPACK_IMPORTED_MODULE_21__.XpG();_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf","fixed-footer"===c.type&&s.shouldShowRow(c)&&s.evaluateCondition(c.condition))}}let AiShootComponent=(()=>{var _AiShootComponent;class AiShootComponent{constructor(_,p,c,s,P,u,f,S,D,y,ie,$,h,k){var R=this;this.authService=_,this.aiPhotoService=p,this.mediaContentService=c,this.aiUploadImageService=s,this.createPopupService=P,this.route=u,this.templateService=f,this.workflowUIService=S,this.paymentService=D,this.toast=y,this.renderer=ie,this.editorService=$,this.hostRef=h,this.modalService=k,this.autoGenerate=!1,this.isVideo=!1,this.autoGenerateChange=new _angular_core__WEBPACK_IMPORTED_MODULE_21__.bkB,this.categoryId=0,this.prodCatId=0,this.categories=[],this.storeProducts=[],this.prompts=[],this.pageNumber=0,this.productListPageNumber=0,this.isLoadingMoreProducts=!1,this.isProductsEnd=!1,this.categoryProductPageNumber=0,this.isLoadingMoreCategoryProducts=!1,this.isCategoryProductsEnd=!1,this.selectedProductImagePageNumber=0,this.isLoadingMoreSelectedProductImages=!1,this.isSelectedProductImagesEnd=!1,this.categoryExpandedImagePagination={},this.activePanelId="",this.PANEL_ID={prompt:"prompt-panel",presets:"presets-panel",workflow:"workflow-panel",customUpload:"custom-upload-panel"},this.customPrompt="",this.isFocused=!1,this.isLoaded=!1,this.btnText="Generate",this.disabled=!0,this.productId=0,this.modelTypeId=0,this.workflowList=[],this.layoutConfig=null,this.rows=[],this.panels=[],this.selectedMode="presets",this.imageJson="",this.credit=1,this.selectedPreset=null,this.switchToggle=!1,this.resolutions=[],this.isPromptLoaded=!1,this.paginationPlaceholders=[0,1],this.catId=0,this.isWorkflowLoading=!1,this.workflowRequestSeq=0,this.productDetailsRequestSeq=0,this.maxLenght=2e3,this.promptResetHeight=!1,this.productCreditConfig=null,this.videoSettings=null,this.dynamicFields=null,this.Promptchange=!1,this.user=this.authService.currentUser(),this.loggedInObserver=this.authService.loggedIn.subscribe(T=>{this.user=this.authService.currentUser(),this.isProUser=this.aiPhotoService.isProUser()}),this.usrPropChangedObserver=this.authService.usrPropChanged.subscribe(T=>{this.user=this.authService.currentUser(),this.isProUser=this.aiPhotoService.isProUser()}),this.changeWorkflowObserver=this.workflowUIService.changeWorkflowSubject.subscribe(T=>{this.genBtnDisable()}),this.activeToolPanelSubscription=this.editorService.activeToolPanel.subscribe(T=>{T?.panel&&(this.isVideo=T?.panel==src_app_shared_enums_navigation_action_enum__WEBPACK_IMPORTED_MODULE_3__.sv.AI_VIDEO_TOOLS)}),this.aiPhotoService.uploadImageFn=function(){var T=(0,C_projects_git_Andor_lightx_web_upgrade_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_22__.A)(function*(W){W?.uploadVerson==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.up.Version4&&R.genBtnDisable()});return function(W){return T.apply(this,arguments)}}(),this.resolutions=this.aiPhotoService.getResolutionDesignEditor(this.isVideo?"Video":"Standard"),this.selectedSize=this.resolutions[0]}ngOnInit(){this.loadLayoutConfig(()=>{const _=this.paymentService?.config?.creditInfo;this.credit=_?.[this.featureType]||1,this.getCategories(()=>{this.isLoaded=!0;const p=this.panels.find(P=>P.id===this.PANEL_ID.prompt)?.prompts;!this.prompts?.length&&p?.length&&(this.prompts=p),this.isPromptLoaded=!0,this.categories.length&&this.addClass();const c=this.rows.find(P=>P.type==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.T6.PresetButton);this.layoutConfig?.isResolution&&(this.isVideo&&this.selectedMode==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.y9.Presets||!c)&&document.querySelector(".middle-drawer").classList.add("isresolution-add"),this.autoGenerate&&(this.dynamicFields=JSON.parse(JSON.stringify(this.aiPhotoService.dynamicFields)),this.selectedSize=this.resolutions.find(P=>P.qType==this.aiPhotoService.queryParams?.segType)||this.resolutions[0],this.generate(),this.autoGenerate=!1,this.aiPhotoService.dynamicFields=null,this.autoGenerateChange.emit(!1),this.aiPhotoService.deleteQueryParams()),this.rows.find(P=>P.type==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.T6.Category)&&this.hasWorkflowPanelConfigured()?this.getWorkflows(()=>{this.genBtnDisable()}):this.genBtnDisable()})})}ngAfterViewInit(){this.configSubs=this.paymentService.configUpdated.subscribe(()=>{const _=this.paymentService?.config?.creditInfo;this.credit=_?.[this.featureType]||1})}loadLayoutConfig(_=null){this.getDynamicToolConfig(c=>
1{if(c){this.layoutConfig=c;const s=this.layoutConfig.config,P=this.layoutConfig.rows;!P.find(y=>y.type==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.T6.PresetButton)&&(this.layoutConfig.presetTitle=P.find(y=>y.type==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.T6.PresetsPanel)?.title);const f=P.filter(y=>0===y.isAccordion||void 0===y.isAccordion),S=P.filter(y=>1===y.isAccordion);s&&(this.selectedMode=s.defaultMode||src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.y9.Presets),"false"===this.aiPhotoService?.queryParams?.checkimg&&this.customPrompt&&(this.selectedMode=src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.y9.Custom),f&&(this.rows=f),S&&(this.panels=S),this.panels.length&&(this.activePanelId=this.panels[0]?.id||""),this.layoutConfig.isResolution=!!P.find(y=>y.type==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.T6.ResolutionPanel),this.layoutConfig.isFileUpload=!!P.find(y=>y.type==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.T6.FileUpload),this.getBtnText(),_&&_()}else this.toast.showErrorSingle(src_app_shared_constant_config__WEBPACK_IMPORTED_MODULE_1__.b.message.uiConfigNotFound),this.isLoaded=!0});const p=this.aiPhotoService.queryParams;p?.productId&&(this.productId=Number(p.productId)),p?.prodImageId&&(this.productImageId=Number(p.prodImageId)),p?.catId&&(this.catId=Number(p.catId)),(p?.aspectRatio||p?.resolution||p?.duration)&&(this.videoSettings={aspectRatio:p.aspectRatio||"",resolution:p.resolution||"",duration:Number(p.duration||0),audioEnabled:!1,creditValue:0}),this.aiPhotoService.textPrompt&&(this.customPrompt=this.aiPhotoService.textPrompt),(0,rxjs__WEBPACK_IMPORTED_MODULE_23__._)((0,rxjs__WEBPACK_IMPORTED_MODULE_24__.O)(1e3)).then(()=>{this.aiPhotoService.deleteQueryParams(!1)})}selectImage(_){if(this.featureType!=src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.Fs.ImageToAnimate||!this.aiPhotoService.inProgress&&!this.aiPhotoService.inVideoProgress){if(this.selectedPreset=_,_.productData){if(this.selectedProduct=_.productData,this.productId=this.selectedProduct.productId,this.modelTypeId=this.selectedProduct?.modelTypeId,this.productCreditConfig=this.selectedProduct?.productCreditConfig,this.productCreditConfig)this.productCreditConfig.videoDuration=_.duration?Number(_.duration):0;else{const c=this.paymentService?.config?.creditInfo;this.credit=c?.[this.featureType]||1}this.videoSettings=null}this.productImageId=_.productImageId,this.getBtnText(),this.featureType==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.Fs.ImageToAnimate&&this.openTemplateDetailDialog(_)}}onModeButtonClick(_){this.selectedMode=_,this.promptResetHeight=!0,setTimeout(()=>{this.promptResetHeight=!1}),document.querySelector(".middle-drawer").classList.remove("isresolution-add"),_===src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.y9.Custom&&this.layoutConfig.isResolution&&document.querySelector(".middle-drawer").classList.add("isresolution-add"),this.genBtnDisable(),this.getBtnText()}shouldShowPanel(_){return!(_.visible&&!this.evaluateCondition(_.visible)||_.showWhen&&_.showWhen!==this.selectedMode)}shouldShowRow(_){return!(_.visible&&!this.evaluateCondition(_.visible)||_.showWhen&&_.showWhen!==this.selectedMode)}evaluateCondition(condition){if(!condition)return!0;try{let evaluatedCondition=condition;return evaluatedCondition=evaluatedCondition.replace(/\bisLoaded\b/g,String(this.isLoaded)),evaluatedCondition=evaluatedCondition.replace(/\bproductConfig\b/g,String(!!this.productConfig)),evaluatedCondition=evaluatedCondition.replace(/\bcategoryId\b/g,String(this.categoryId)),eval(evaluatedCondition)}catch(_){return console.error("Error evaluating condition:",_),!0}}selectPrompt(_){this.customPrompt=_.prompt,this.imageJson=_.prompt,this.genBtnDisable(),setTimeout(()=>{this.isFocused=!1})}selectCategory(_){if(this.promptResetHeight=!0,setTimeout(()=>{this.promptResetHeight=!1}),_?.categoryId&&_.categoryId===this.categoryId&&!this.prodCatId&&(this.isLoadingMoreCategoryProducts||this.storeProducts.length>0)||_?.productId&&_.productId===this.prodCatId&&this.selectedProduct?.productId===_.productId)return;this.scrollDrawerToTop();let p=!1;if(_&&_.categoryId){const c=this.categoryId;this.categoryId=_.categoryId,this.prodCatId=0,this.modelTypeId=_.modelTypeId?_.modelTypeId:this.modelTypeId,this.disabled=!0,this.Promptchange=!0,this.customPrompt="",this.imageJson="",p=!0,"custom"==this.selectedMode&&(this.activePanelId=this.resolveFirstVisibleCustomPanel()),c!==this.categoryId&&(this.productDetailsRequestSeq++,this.isLoadingMoreCategoryProducts=!1,this.resetCategoryProductPagination(),this.categoryExpandedImagePagination={},this.storeProducts=[],this.selectedProduct=null,this.selectedPreset=null,this.productImageId=0,this.productId=0),this.hasWorkflowPanelConfigured()?this.getWorkflows(()=>{this.genBtnDisable()}
1):(this.productConfig=null,this.workflowList=[],this.isWorkflowLoading=!1,this.genBtnDisable())}else if(_&&_.productId){this.workflowRequestSeq++,this.isWorkflowLoading=!1,this.selectedProduct=_,this.selectedProduct.storeProductImages||(this.selectedProduct.storeProductImages=[]),this.productId=this.selectedProduct.productId,this.modelTypeId=this.selectedProduct.modelTypeId,this.prodCatId=this.selectedProduct.productId,this.categoryId=0,this.customPrompt=_&&_.Prompt?_.prompt:"";const c=this.productImageId;this.resetSelectedProductImagePagination(),this.productConfig=null,this.selectedProduct.productConfig&&setTimeout(()=>{this.productConfig=JSON.parse(JSON.stringify(this.selectedProduct.productConfig)),this.workflowUIService.setFieldsValue(this.productConfig),this.genBtnDisable(),this.getBtnText()},100),this.getBtnText(),this.getPrompts(this.productId),this.loadSelectedProductImages(!0,c),this.Promptchange=!0,setTimeout(()=>{this.changePrompt(""),this.Promptchange=!1},0),"custom"==this.selectedMode&&(this.activePanelId=this.resolveFirstVisibleCustomPanel()),this.genBtnDisable()}this.categoryId&&this.loadCategoryProductDetails({categoryId:this.categoryId,reset:p,cb:()=>{this.getPrompts(0),this.getBtnText(),this.Promptchange=!1,this.genBtnDisable()},init:p})}smoothScrollTo(_,p,c){const s=_.scrollTop,P=p-s,u=performance.now(),f=S=>{const y=Math.min((S-u)/c,1);_.scrollTop=s+P*(y*(2-y)),y<1&&requestAnimationFrame(f)};requestAnimationFrame(f)}changePrompt(_){this.customPrompt=_,this.genBtnDisable()}accPanelChanged(_){_.panelId&&(this.activePanelId=_.nextState?_.panelId:"",this.disabled=!_.nextState,_.nextState&&this.genBtnDisable(),this.getBtnText())}getProductDetails(_,p=null,c=!1){this.isProductFilterMode()?this.loadProductListing(c,p):this.loadCategoryProductDetails({categoryId:_,reset:c,cb:p,init:c})}loadCategoryProductDetails({categoryId:_,reset:p,cb:c=null,init:s=!1}){if(this.isLoadingMoreCategoryProducts||!p&&this.isCategoryProductsEnd)return void(c&&c());const P=++this.productDetailsRequestSeq;(0,_pagination_utils__WEBPACK_IMPORTED_MODULE_5__.uH)({request:{categoryId:_,reset:p,cb:c,init:s},requestSeq:P,pageSize:_pagination_utils__WEBPACK_IMPORTED_MODULE_5__.$t.CATEGORY_PRODUCT_PAGE_SIZE,pagination:{getState:()=>({pageNumber:this.categoryProductPageNumber,isLoading:this.isLoadingMoreCategoryProducts,isEnd:this.isCategoryProductsEnd}),setState:u=>{"number"==typeof u.pageNumber&&(this.categoryProductPageNumber=u.pageNumber),"boolean"==typeof u.isLoading&&(this.isLoadingMoreCategoryProducts=u.isLoading),"boolean"==typeof u.isEnd&&(this.isCategoryProductsEnd=u.isEnd)}},isCurrentRequest:u=>u===this.productDetailsRequestSeq,fetchProducts:(0,_pagination_utils__WEBPACK_IMPORTED_MODULE_5__.a6)(this.mediaContentService,_pagination_utils__WEBPACK_IMPORTED_MODULE_5__.$t.CATEGORY_PRODUCT_PAGE_SIZE),onProductsLoaded:({fetchedProducts:u,reset:f})=>{if(f?(this.categoryExpandedImagePagination={},this.storeProducts=u):u.length&&(this.storeProducts=(0,_pagination_utils__WEBPACK_IMPORTED_MODULE_5__.cb)(this.storeProducts,u,"productId")),this.storeProducts.length){if(f&&s&&this.productId){const S=this.storeProducts.findIndex(D=>D.productId==this.productId);if(-1!=S){let D=this.storeProducts[S];this.storeProducts.splice(S,1),this.storeProducts.splice(0,0,D)}}if(f&&s&&this.productImageId&&this.storeProducts[0]?.storeProductImages?.length){const S=this.storeProducts[0].storeProductImages.findIndex(D=>D.productImageId==this.productImageId);if(-1!=S){let D=this.storeProducts[0].storeProductImages[S];this.storeProducts[0].storeProductImages.splice(S,1),this.storeProducts[0].storeProductImages.splice(0,0,D)}}f&&this.selectProduct(this.storeProducts)}},onSuccess:()=>{this.isLoaded=!0},onError:()=>{this.isLoaded=!0}})}getCategories(_=null){let c=this.layoutConfig?.config?.parentCategoryId||0;const s=this.getActiveFilterRow(),P=s?.type==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.T6.Product;let u=[];s&&(s.config?.categoryId&&(this.categoryId=s.config?.categoryId),u=s.config?.items||[],u.length&&(this.categories=u,this.catId&&(this.categoryId=this.categories.find(S=>S.categoryId==this.catId)?.categoryId),this.categoryId=this.categories.find(S=>S.categoryId==this.categoryId)?.categoryId||this.categories[0]?.categoryId||0));const f=this.resolveFallbackCategoryId();if(!this.categoryId&&f&&(this.categoryId=f),P)if(u.length){const S=this.categories.find(D=>D.categoryId==this.categoryId)||this.categories[0];S&&this.selectCategory(S),_&&_()}else this.loadProductListing(!0,_);else c&&!u.length?this.templateService.getProductCategoryListing(c,this.pageNumber,S=>{S&&S.storeCategories&&S.storeCategories.length>0?(this.categories=S.storeCategories[0]?.subCategoryList||[],this.categories.forEac
1h(D=>{D?.displayName||(D.displayName=D.gaName)}),this.catId&&(this.categoryId=this.categories.find(D=>D.categoryId==this.catId)?.categoryId),this.categoryId=this.categories.find(D=>D.categoryId==this.categoryId)?.categoryId||this.categories[0]?.categoryId||0,this.getProductDetails(this.categoryId,()=>{_&&_()},!0)):_&&_()},S=>{_&&_()},1,src_app_shared_enums_template_placement_enum__WEBPACK_IMPORTED_MODULE_2__.i.Main):this.categoryId?this.getProductDetails(this.categoryId,()=>{_&&_()},!0):_&&_()}selectProduct(_,p=null){const c=_.find(s=>s.productId==this.productId);if(this.selectedProduct=c||_[0],this.selectedProduct){p==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.T6.Product&&(this.prodCatId=this.selectedProduct.productId,this.productConfig=null,this.selectedProduct.productConfig&&(this.productConfig=JSON.parse(JSON.stringify(this.selectedProduct.productConfig)),this.workflowUIService.setFieldsValue(this.productConfig))),this.productId=this.selectedProduct?.productId,this.modelTypeId=this.selectedProduct?.modelTypeId,this.productCreditConfig=this.selectedProduct?.productCreditConfig||null;let s=this.selectedProduct?.storeProductImages.find(u=>u.productImageId==this.productImageId);if(s||(s=this.selectedProduct?.storeProductImages[0]),s&&(this.productImageId=s.productImageId,this.imageJson=s.imageJson,this.selectedPreset=s),this.autoGenerate||(this.videoSettings=null),this.productCreditConfig)this.productCreditConfig.videoDuration=s.duration?Number(s.duration):0;else{const u=this.paymentService?.config?.creditInfo;this.credit=u?.[this.featureType]||1}this.getPrompts(p==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.T6.Product?this.productId:0),this.genBtnDisable()}}onTopListScrollEnd(){this.isProductFilterMode()&&this.loadProductListing(!1)}onProductImagesListEnd(_){if(_){if("category"===_.viewType&&!this.isProductFilterMode()&&this.categoryId)return void(this.isCategoryProductsEnd?_.productId&&this.loadExpandedCategoryProductImages({productId:_.productId}):this.loadCategoryProductDetails({categoryId:this.categoryId,reset:!1}));"product"!==_.viewType||!this.isProductFilterMode()||_.productId&&this.selectedProduct?.productId&&_.productId!==this.selectedProduct.productId||this.loadSelectedProductImages(!1)}}onCategoryExpandProduct(_){if(this.isProductFilterMode()||!_?.productId)return;const p=this.storeProducts.find(P=>P.productId==_.productId);if(!p)return;this.categoryExpandedImagePagination[_.productId]||(this.categoryExpandedImagePagination[_.productId]=(0,_pagination_utils__WEBPACK_IMPORTED_MODULE_5__.gi)());const c=this.categoryExpandedImagePagination[_.productId],s=p.storeProductImages||[];if(0===s.length)return c.pageNumber=-1,c.isEnd=!1,void this.loadExpandedCategoryProductImages({productId:_.productId});c.pageNumber=(0,_pagination_utils__WEBPACK_IMPORTED_MODULE_5__.vR)(s.length,_pagination_utils__WEBPACK_IMPORTED_MODULE_5__.$t.CATEGORY_IMAGE_PAGE_SIZE),c.isEnd=s.length<_pagination_utils__WEBPACK_IMPORTED_MODULE_5__.$t.CATEGORY_EMBEDDED_IMAGE_COUNT}onCategoryProductImagesEnd(_){this.isProductFilterMode()||!_?.productId||this.loadExpandedCategoryProductImages({productId:_.productId})}focusIn(){this.isFocused=!0}onFocusOut(_){this.isFocused=_}focusOut(){this.isFocused=!1}generate(){if(this.aiPhotoService.inProgress||this.aiPhotoService.inVideoProgress)return;const _=this.isUploaded();if(this.aiPhotoService.isCancel||this.layoutConfig?.isFileUpload&&!this.aiPhotoService.imgUrl||_&&!this.aiPhotoService?.originalImageUrlDuo)this.toast.showErrorSingle(src_app_shared_constant_config__WEBPACK_IMPORTED_MODULE_1__.b.message.uploadNewImage);else if(this.layoutConfig?.isFileUpload&&this.aiPhotoService.imgUrl||!this.layoutConfig?.isFileUpload)if(this.user&&this.user.remainingCoins>=this.credit){let p={...this.layoutConfig?.isFileUpload&&this.aiPhotoService.imgUrl&&{imageUrl:this.aiPhotoService.imgUrl},..._&&this.aiPhotoService?.originalImageUrlDuo&&{imageUrlSecond:this.aiPhotoService.originalImageUrlDuo},featureType:this.featureType,...this.modelTypeId&&{model:this.modelTypeId},...this.productId&&{productId:this.productId},...this.videoSettings&&{duration:this.videoSettings.duration,ratio:this.videoSettings.aspectRatio,resolution:this.videoSettings.resolution,data:{mediaCreditType:2}},...this.layoutConfig?.config?.segmentationType&&!this.videoSettings&&{segmentationType:this.selectedSize.qType},...this.layoutConfig?.isResolution&&this.selectedMode&&!this.videoSettings&&{quality:this.selectedSize.qType},...this.dynamicFields&&this.isVideo&&{data:{...this.dynamicFields,mediaCreditType:2}}};this.selectedMode==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.y9.Presets?p={...p,isCustomPrompt:0,productImageId:this.productImageId}:this.selectedMode==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.y9.Custom&&(this.activePanelId==this.PANEL_ID.prompt&&this.customPrompt?.trim()?p={...p,isCustomPrompt:1,textPrompt:this.customPrompt.trim()}
1:this.activePanelId==this.PANEL_ID.workflow&&this.productConfig?p={...p,...this.productConfig?.modelTypeId&&{model:this.productConfig.modelTypeId},worksFlow:{...this.workflowUIService.getInputWorkflowData(this.productConfig,this.aiPhotoService.originalImageUrlCustom),...this.productConfig?.workflowId&&{workflowId:this.productConfig.workflowId},...this.productConfig?.enhancePrompt&&{enhancePrompt:this.productConfig.enhancePrompt}}}:this.activePanelId==this.PANEL_ID.customUpload&&this.aiPhotoService.originalImageUrlCustom&&(p={...p,imageUrlSecond:this.aiPhotoService.originalImageUrlCustom})),this.aiPhotoService.startGenerationProgress({featureType:this.featureType,isVideo:this.isVideo}),this.aiPhotoService.generateImage(p,c=>{c&&c.assetId?(c.toolName=this.toolDisplayName,c.featureType=this.featureType,c.styleName=this.selectedMode==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.y9.Presets?this.selectedProduct?.displayName:"",this.aiPhotoService.checkStatus(c,0,P=>{P.urls&&P.urls.length>0?(this.user.remainingCoins=P.remainingCalls,this.aiPhotoService.isDirty=!0,this.activePanelId==this.PANEL_ID.prompt&&this.selectedMode==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.y9.Custom&&(this.layoutConfig.isPromptGen=!0),this.activePanelId==this.PANEL_ID.workflow&&this.productConfig&&this.selectedMode==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.y9.Custom&&(this.productConfig.isWorkflowGen=!0),this.selectedMode==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.y9.Presets&&this.selectedPreset&&(this.selectedPreset.isGenerated=!0),this.getBtnText()):this.aiPhotoService.clearGenerationProgress()},P=>{this.displayErrorMsg(P)},this.isVideo)):this.displayErrorMsg(c)},c=>{this.displayErrorMsg(c)},this.isVideo)}else this.aiPhotoService.openAICreditPopup(()=>{this.user=this.authService.currentUser(),this.isProUser=this.aiPhotoService.isProUser(),this.generate()},this.credit,this.isVideo?"video":"image",()=>{});else this.aiPhotoService.inProgress=!0,this.aiPhotoService.updateImageUrl(this.aiPhotoService.originalImgUrl,this.featureType).then(p=>{this.aiPhotoService.queryParams=this.route.snapshot.queryParams,this.aiPhotoService.imgUrl=p.imgUrl,this.generate()}).catch(()=>{this.aiPhotoService.inProgress=!1,this.toast.showErrorSingle(src_app_shared_constant_config__WEBPACK_IMPORTED_MODULE_1__.b.message.uploadNewImage)})}displayErrorMsg(_=null){this.aiPhotoService.clearGenerationProgress();let p=_?.description;this.createPopupService.openWarningDialog("Error",p)}ngOnDestroy(){this.configSubs&&this.configSubs.unsubscribe(),this.loggedInObserver&&this.loggedInObserver.unsubscribe(),this.usrPropChangedObserver&&this.usrPropChangedObserver.unsubscribe(),this.changeWorkflowObserver&&this.changeWorkflowObserver.unsubscribe(),this.activeToolPanelSubscription&&this.activeToolPanelSubscription.unsubscribe(),this.aiPhotoService.textPrompt="",this.aiPhotoService.originalImageUrlCustom="",document.querySelector(".middle-drawer")?.classList.remove("top-section-p","isresolution-add")}getWorkflows(_=null){const p=++this.workflowRequestSeq;this.productConfig=null,this.workflowList=[];const c=this.panels.find(s=>s.type==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.T6.WorkflowPanel);this.categoryId&&c?(this.isWorkflowLoading=!0,this.disabled=!0,this.mediaContentService.getWorkflows(this.categoryId,s=>{p===this.workflowRequestSeq&&(s&&(this.workflowList=s?.productConfig||[],this.workflowList?.length&&(this.productConfig=JSON.parse(JSON.stringify(this.workflowList[0])),this.workflowUIService.setFieldsValue(this.productConfig))),this.isWorkflowLoading=!1,this.selectedMode==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.y9.Custom&&(this.activePanelId=this.resolveFirstVisibleCustomPanel(),this.getBtnText()),_&&_())},s=>{p===this.workflowRequestSeq&&(this.workflowList=[],this.isWorkflowLoading=!1,this.selectedMode==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.y9.Custom&&(this.activePanelId=this.resolveFirstVisibleCustomPanel(),this.getBtnText()),_&&_())})):(this.isWorkflowLoading=!1,_&&_())}
1productConfigChange(_){this.productConfig=_}addClass(){const _=document.querySelector(".middle-drawer");_&&_.classList.add("top-section-p")}getBtnText(){const _=this.rows.find(c=>c.type==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.T6.PresetButton),p=this.rows.find(c=>c.type==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.T6.FixedFooter)?.config?.button;this.btnText=p?.text||src_app_shared_constant_config__WEBPACK_IMPORTED_MODULE_1__.b.label.generate,this.selectedMode==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.y9.Custom&&_?this.activePanelId==this.PANEL_ID.prompt?this.btnText=this.layoutConfig?.isPromptGen?src_app_shared_constant_config__WEBPACK_IMPORTED_MODULE_1__.b.label.generateMore:p?.prompt||this.btnText:this.activePanelId==this.PANEL_ID.workflow&&(this.btnText=this.productConfig?.isWorkflowGen?src_app_shared_constant_config__WEBPACK_IMPORTED_MODULE_1__.b.label.generateMore:p?.workflow||this.btnText):this.selectedMode==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.y9.Presets&&(this.btnText=_?this.selectedPreset?.isGenerated?src_app_shared_constant_config__WEBPACK_IMPORTED_MODULE_1__.b.label.generateMore:p?.presets||this.btnText:this.selectedPreset?.isGenerated?src_app_shared_constant_config__WEBPACK_IMPORTED_MODULE_1__.b.label.generateMore:this.btnText)}getDynamicToolConfig(_=null){this.featureType&&this.aiPhotoService.getDymanicToolConfig(this.featureType,p=>{p&&p.body&&p.body.dynamicToolConfig?_&&_(p.body.dynamicToolConfig):_&&_(null)},p=>{_&&_(null)})}getPrompts(_,p=null){const c=this.rows.find(P=>P.type==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.T6.Product||P.type==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.T6.Category);let s=c?.config?.aiType;c?.config?.items?.length&&(s=c?.config?.items.find(P=>P.categoryId==this.categoryId)?.aiType||s,_=0),s&&this.mediaContentService.getPrompts(s,P=>{P&&(this.prompts=P?.prompts||[]),p&&p()},P=>{p&&p()},_)}isUploaded(){const _=this.rows.find(p=>p.type==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.T6.FileUpload)?.config;return _?.uploadVersion==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.up.Version2||_?.uploadVersion==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.up.Version3||!(!_?.switchToggle||_?.uploadVersion!=src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.up.Version1)&&this.switchToggle}onDropdownOpen(){this.renderer.addClass(document.body,"drop-open")}onDropdownClose(){this.renderer.removeClass(document.body,"drop-open")}hasWorkflowPanelConfigured(){return this.panels.some(_=>_.type==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.T6.WorkflowPanel)}isPanelRendered(_){return!(!_||!this.shouldShowPanel(_)||!this.evaluateCondition(_.condition)||_.type===src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.T6.WorkflowPanel&&!this.productConfig)}isPanelAvailable(_){if(!_)return!1;const p=this.panels.find(c=>c.id===_);return!!p&&this.isPanelRendered(p)}resolveActiveCustomPanel(){return this.isPanelAvailable(this.activePanelId)?this.activePanelId:this.resolveFirstVisibleCustomPanel()}resolveFirstVisibleCustomPanel(){return this.panels.filter(p=>this.isPanelRendered(p))[0]?.id||""}isProductFilterMode(){return this.getActiveFilterRow()?.type===src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.T6.Product||!!this.prodCatId&&!this.categoryId}getActiveFilterRow(){return this.rows.find(p=>(p.type==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.T6.Category||p.type==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.T6.Product)&&this.shouldShowRow(p)&&this.evaluateCondition(p.condition))||this.rows.find(p=>p.type==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.T6.Category||p.type==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.T6.Product)}resolveFallbackCategoryId(){const _=Number(this.layoutConfig?.config?.categoryId||0);if(_)return _;const p=this.rows.find(c=>(c.type==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.T6.Category||c.type==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.T6.Product)&&c?.config?.categoryId);return Number(p?.config?.categoryId||0)}resetCategoryProductPagination(){this.categoryProductPageNumber=0,this.isLoadingMoreCategoryProducts=!1,this.isCategoryProductsEnd=!1}loadProductListing(_,p=null){if(this.isLoadingMoreProducts||!_&&this.isProductsEnd)return void(p&&p());const c=this.resolveProductListingCategoryId();if(!c)return void(p&&p());const s=(0,_pagination_utils__WEBPACK_IMPORTED_MODULE_5__.vt)(_,this.productListPageNumber);this.isLoadingMoreProducts=!0,this.mediaContentService.getProductListing(c,s,P=>{const u=P?.storeProducts||[];
1if(_?this.categories=u:u.length&&(this.categories=(0,_pagination_utils__WEBPACK_IMPORTED_MODULE_5__.cb)(this.categories,u,"productId")),this.productListPageNumber=s,this.isProductsEnd=(0,_pagination_utils__WEBPACK_IMPORTED_MODULE_5__.HC)(u.length,_pagination_utils__WEBPACK_IMPORTED_MODULE_5__.$t.PRODUCT_LIST_PAGE_SIZE),this.isLoadingMoreProducts=!1,this.isLoaded=!0,_){const f=this.categories.find(S=>S.productId==this.productId)||this.categories[0];f&&this.selectCategory(f)}p&&p()},()=>{this.isLoadingMoreProducts=!1,this.isLoaded=!0,p&&p()},null,src_app_shared_enums_template_placement_enum__WEBPACK_IMPORTED_MODULE_2__.i.Main,_pagination_utils__WEBPACK_IMPORTED_MODULE_5__.$t.PRODUCT_LIST_PAGE_SIZE)}resolveProductListingCategoryId(){if(this.categoryId)return this.categoryId;const _=Number(this.selectedProduct?.primaryCategoryId||0);return _||(Number(this.categories?.find(c=>c?.productId==this.prodCatId)?.primaryCategoryId||0)||this.resolveFallbackCategoryId())}resetSelectedProductImagePagination(){this.selectedProductImagePageNumber=0,this.isLoadingMoreSelectedProductImages=!1,this.isSelectedProductImagesEnd=!1}loadSelectedProductImages(_,p=0){const c=this.selectedProduct?.productId;if(!c||this.isLoadingMoreSelectedProductImages||!_&&this.isSelectedProductImagesEnd)return;const s=(0,_pagination_utils__WEBPACK_IMPORTED_MODULE_5__.vt)(_,this.selectedProductImagePageNumber);this.isLoadingMoreSelectedProductImages=!0,this.mediaContentService.getTemplateByProductId(c,s,P=>{const u=P?.storeProductImages||[];if((_||!this.selectedProduct.storeProductImages)&&(this.selectedProduct.storeProductImages=[]),u.length){const f=this.selectedProduct.storeProductImages.length;this.selectedProduct.storeProductImages=(0,_pagination_utils__WEBPACK_IMPORTED_MODULE_5__.cb)(this.selectedProduct.storeProductImages,u,"productImageId"),this.isSelectedProductImagesEnd=(0,_pagination_utils__WEBPACK_IMPORTED_MODULE_5__.HC)(u.length,_pagination_utils__WEBPACK_IMPORTED_MODULE_5__.$t.PRODUCT_IMAGE_PAGE_SIZE,this.selectedProduct.storeProductImages.length-f)}else this.isSelectedProductImagesEnd=!0;if(this.selectedProductImagePageNumber=s,this.isLoadingMoreSelectedProductImages=!1,_){const f=this.selectedProduct.storeProductImages||[],S=p?f.findIndex(y=>y.productImageId==p):-1;if(S>0){const y=f[S];f.splice(S,1),f.unshift(y)}const D=f[0];if(D&&(this.imageJson=D.imageJson,this.selectedPreset=D,this.featureType!==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.Fs.ImageToAnimate&&(this.productImageId=D.productImageId)),this.videoSettings=null,this.productCreditConfig=this.selectedProduct?.productCreditConfig||null,this.productCreditConfig)this.productCreditConfig.videoDuration=D.duration?Number(D.duration):0;else{const y=this.paymentService?.config?.creditInfo;this.credit=y?.[this.featureType]||1}this.genBtnDisable(),this.getBtnText()}},()=>{this.isLoadingMoreSelectedProductImages=!1},null,_pagination_utils__WEBPACK_IMPORTED_MODULE_5__.$t.PRODUCT_IMAGE_PAGE_SIZE)}loadExpandedCategoryProductImages({productId:_}){(0,_pagination_utils__WEBPACK_IMPORTED_MODULE_5__.hu)({storeProducts:this.storeProducts,paginationMap:this.categoryExpandedImagePagination,request:{productId:_},embeddedImageCount:_pagination_utils__WEBPACK_IMPORTED_MODULE_5__.$t.CATEGORY_EMBEDDED_IMAGE_COUNT,pageSize:_pagination_utils__WEBPACK_IMPORTED_MODULE_5__.$t.CATEGORY_IMAGE_PAGE_SIZE,fetchImages:(0,_pagination_utils__WEBPACK_IMPORTED_MODULE_5__.$B)(this.mediaContentService,_pagination_utils__WEBPACK_IMPORTED_MODULE_5__.$t.CATEGORY_IMAGE_PAGE_SIZE)})}getDrawerScroll(){return this.hostRef.nativeElement.closest(".drawer-scroll")||this.hostRef.nativeElement.querySelector(".scroll-content")||document.querySelector(".drawer-scroll.scroll-container")}scrollDrawerToTop(){setTimeout(()=>{const _=this.getDrawerScroll();_&&_.scrollTop>0&&_.scrollTo({top:0,behavior:"auto"})},0)}genBtnDisable(){if(this.selectedMode==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.y9.Custom){const p=this.resolveActiveCustomPanel();p!==this.activePanelId&&(this.activePanelId=p,this.getBtnText())}if(this.selectedMode==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.y9.Custom&&this.activePanelId==this.PANEL_ID.workflow&&this.isWorkflowLoading)this.disabled=!0;else if(this.disabled=!1,this.selectedMode==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.y9.Custom){if(!this.activePanelId)return void(this.disabled=!0);if(this.activePanelId==this.PANEL_ID.workflow){if(!this.productC
1onfig)return void(this.disabled=!0);this.disabled=this.workflowUIService.isDisabled(this.productConfig,this.disabled)}else this.activePanelId==this.PANEL_ID.prompt?this.disabled=!this.customPrompt?.trim():this.activePanelId==this.PANEL_ID.customUpload&&(this.disabled=!this.aiPhotoService?.originalImageUrlCustom)}else this.selectedMode==src_app_enums_editor_enum__WEBPACK_IMPORTED_MODULE_0__.y9.Presets&&(this.disabled=!this.selectedPreset?.productImageId)}selectionChange(_){this.videoSettings={..._},Number.isFinite(_.creditValue)&&(this.credit=_.creditValue)}openTemplateDetailDialog(_){this.aiPhotoService.imgUrl&&(_.originalImgUrl=this.aiPhotoService.imgUrl),this.aiPhotoService.originalImageUrlDuo&&(_.originalImageUrlDuo=this.aiPhotoService.originalImageUrlDuo);const p=this.modalService.open(src_app_web_ai_video_template_template_detail_popup_template_detail_popup_component__WEBPACK_IMPORTED_MODULE_4__.f,{centered:!0,size:"lg",backdrop:"static",windowClass:"ai-video-templates-dialog"});p.componentInstance.activeImgObj=_,p.componentInstance.productId=this.productId,p.componentInstance.modelTypeId=this.modelTypeId,p.componentInstance.productCreditConfig=this.productCreditConfig,p.componentInstance.fromEditor=!0,p.result.then(c=>{c&&(c?.dynamicFields&&(this.dynamicFields=c?.dynamicFields||null),c?.selectedResConfig&&this.selectionChange(c?.selectedResConfig),(c?.segType||0==c?.segType)&&(this.selectedSize=this.resolutions.find(s=>s.qType==c?.segType)||this.resolutions[0]),(c?.imgUrl||c?.imgUrl&&c?.duoImgUrl)&&(this.aiPhotoService.imgUrl=c?.imgUrl,c?.duoImgUrl&&(this.aiPhotoService.originalImageUrlDuo=c?.duoImgUrl),this.generate()))})}}return _AiShootComponent=AiShootComponent,_AiShootComponent.\u0275fac=function _(p){return new(p||_AiShootComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_21__.rXU(src_app_core_services_auth_service__WEBPACK_IMPORTED_MODULE_6__.u),_angular_core__WEBPACK_IMPORTED_MODULE_21__.rXU(_services_ai_photo_service__WEBPACK_IMPORTED_MODULE_7__.s),_angular_core__WEBPACK_IMPORTED_MODULE_21__.rXU(src_app_editor_ui_services_media_content_service__WEBPACK_IMPORTED_MODULE_8__.Z),_angular_core__WEBPACK_IMPORTED_MODULE_21__.rXU(src_app_shared_services_ai_upload_image_service__WEBPACK_IMPORTED_MODULE_9__.M),_angular_core__WEBPACK_IMPORTED_MODULE_21__.rXU(src_app_shared_services_create_popup_service__WEBPACK_IMPORTED_MODULE_10__.A),_angular_core__WEBPACK_IMPORTED_MODULE_21__.rXU(_angular_router__WEBPACK_IMPORTED_MODULE_25__.nX),_angular_core__WEBPACK_IMPORTED_MODULE_21__.rXU(src_app_shared_services_template_service__WEBPACK_IMPORTED_MODULE_11__.I),_angular_core__WEBPACK_IMPORTED_MODULE_21__.rXU(src_app_editor_ui_components_workflow_ui_workflow_ui_service__WEBPACK_IMPORTED_MODULE_26__.b),_angular_core__WEBPACK_IMPORTED_MODULE_21__.rXU(src_app_core_services_payment_service__WEBPACK_IMPORTED_MODULE_12__.W),_angular_core__WEBPACK_IMPORTED_MODULE_21__.rXU(src_app_shared_toast_toast_service__WEBPACK_IMPORTED_MODULE_13__.f),_angular_core__WEBPACK_IMPORTED_MODULE_21__.rXU(_angular_core__WEBPACK_IMPORTED_MODULE_21__.sFG),_angular_core__WEBPACK_IMPORTED_MODULE_21__.rXU(src_app_editor_editor_service__WEBPACK_IMPORTED_MODULE_14__.x),_angular_core__WEBPACK_IMPORTED_MODULE_21__.rXU(_angular_core__WEBPACK_IMPORTED_MODULE_21__.aKT),_angular_core__WEBPACK_IMPORTED_MODULE_21__.rXU(_ng_bootstrap_ng_bootstrap__WEBPACK_IMPORTED_MODULE_27__.Bq))},_AiShootComponent.\u0275cmp=_angular_core__WEBPACK_IMPORTED_MODULE_21__.VBU({type:_AiShootComponent,selectors:[["ai-shoot"]],inputs:{featureType:"featureType",toolDisplayName:"toolDisplayName",autoGenerate:"autoGenerate",isVideo:"isVideo"},outputs:{autoGenerateChange:"autoGenerateChange"},decls:4,vars:4,consts:[["ngSelect",""],[4,"ngFor","ngForOf"],["class","d-flex w-100 flex-column card border-0 pt-2 pb-3",3,"d-none",4,"ngIf"],["class","d-flex w-100 flex-column ngb-btn",3,"d-none",4,"ngIf"],["class","row-container",3,"ngClass",4,"ngIf"],[1,"row-container",3,"ngClass"],[4,"ngIf"],[3,"d-none",4,"ngIf"],[1,"d-flex","align-items-center","justify-content-center","bg-white","filter-category"],[1,"colors-bg","sticker-buttons-scroll","scrollWidth-300","only-for-topcate"],[3,"selectLayout","scrollEnd","items","type","categoryId"],[3,"toolName","version"],["class","d-flex align-items-center justify-content-end mb-3","style","margin-top: -8px;",4,"ngIf"],[1,"d-flex","align-items-center","justify-content-end","mb-3",2,"margin-top","-8px"],[1,"text-13","lh-140","text-black"],[1,"editor-toggle","ms-2"],[1,"d-flex","align-items-center",3,"changeT","selected"],[1,"d-flex","align-items-center","justify-content-center","preset-button","wp-100","btn-tabs-editor","border-radius-12","mb-2"],[1,"btn","btn-tab-inner",2,"margin-right","1px",3,"click","ngClass"],[1,"btn","btn-tab-inner",2,"margin-left","1px",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center","presets-panel","optionDiv"],[1,"common-container","p-0","m-0","w-100","pt-2","pb-2","ps-0","pe-3"],[3,"selectStyleEvent","expandProduct","listEndReached","categoryProductImagesEnd","type","storeProducts","productImageId","isCategoryProductsLoading","isCategoryProductsEnd","categoryExpandedImagePagination","title","featureType","inProgress"],[3,"selectStyleEvent","listEndReached","type","productId","storeProductImages","productImageId","title","featureType","inProgress"],["class","ai-thumb-list d-flex justify-content-between loading-thumb-list",4,"ngIf"],[1,"ai-thumb-list","d-flex","justify-content-between","loading-thumb-list"],["class","ai-thumb-col d-flex align-items-center justify-content-center flex-column placeholder-thumb",4,"ngFor","ngForOf"],[1,"ai-thumb-col","d-flex","align-items-center","justify-content-center","flex-column","placeholder-thumb"],[1,"img-col","d-flex","align-items-center","border-radius-12","mb-1","skeleton-box"],[1,"skeleton-line"],[1,"d-flex","backgound-content","mt-1",2,"padding","0p
1x 7px"],[2,"padding","0px 5px",3,"view"],[1,"d-flex","w-100","flex-column","card","border-0","pt-2","pb-3"],["class","d-flex align-items-center wp-100",4,"ngIf"],[1,"d-flex","align-items-center","wp-100"],["class","text-normal text-dark text-semi lh-125 ms-3 h-32 d-flex align-items-center",4,"ngIf"],[1,"text-normal","text-dark","text-semi","lh-125","ms-3","h-32","d-flex","align-items-center"],["name","helpicon","class","ms-1 hw-24 help-icon","placement","right","popoverClass","pop-for-tooltip","triggers","mouseenter:mouseleave","container","body",3,"ngbPopover","popoverTitle",4,"ngIf"],["name","helpicon","placement","right","popoverClass","pop-for-tooltip","triggers","mouseenter:mouseleave","container","body",1,"ms-1","hw-24","help-icon",3,"ngbPopover","popoverTitle"],[1,"common-container"],[1,"card","drawer-card","mb-0"],[1,"card-body"],[1,"btn-panel"],[1,"card-body","prompt-view"],["class","textarea-col position-relative",3,"ngClass",4,"ngIf"],["class","d-flex document-color mt-2",4,"ngIf"],[1,"textarea-col","position-relative",3,"ngClass"],[1,"text-animation",3,"changePrompt","focusOut","prompts","maxLength","textPrompt","promptResetHeight"],["class","prompt-info text-regular position-absolute d-flex align-items-center justify-content-start",4,"ngIf"],[1,"prompt-info","text-regular","position-absolute","d-flex","align-items-center","justify-content-start"],[1,"d-flex","document-color","mt-2"],[1,"colors-bg","sticker-buttons-scroll"],[3,"selectLayout","items","type"],[3,"productConfigChange","productConfig","workflowList","inProgress"],[1,"d-flex","w-100","ps-3","pe-3","mt-1"],[1,"w-100",3,"version"],[3,"selectStyleEvent","expandProduct","listEndReached","categoryProductImagesEnd","type","storeProducts","productImageId","isCategoryProductsLoading","isCategoryProductsEnd","categoryExpandedImagePagination","featureType","inProgress"],[1,"d-flex","w-100","flex-column","ngb-btn"],["ngbAccordion","",3,"closeOthers"],["class","tab-div",3,"ngbAccordionItem","ngClass","collapsed","show","hide",4,"ngIf"],[1,"tab-div",3,"show","hide","ngbAccordionItem","ngClass","collapsed"],["ngbAccordionHeader",""],["type","button","ngbAccordionButton","",1,"btn-acc-title"],["class","m-0 btn btn-link card-title ms-3",4,"ngIf"],["type","button","ngbAccordionButton","","title","Toggle panel",1,"btn-collapse","p-0"],[1,"collapse-text","btn-link"],["name","collapseAcc",1,"f-24"],[1,"expand-text"],["name","expandAcc",1,"f-24"],["ngbAccordionCollapse",""],["ngbAccordionBody",""],[1,"m-0","btn","btn-link","card-title","ms-3"],[1,"common-container","pb-3"],["class","row-container",3,"ngClass","d-none",4,"ngIf"],[1,"position-fixed","fixed-bottom","pb-1","pt-2","ps-3","pe-3","bg-white",2,"z-index","2"],[1,"d-flex","align-items-center","justify-content-center","w-100","mb-1"],[1,"btn","btn-primary-gradient","text-13","btn-h40","w-100","d-flex","align-items-center","justify-content-center",3,"click","id","disabled"],["class","spinner-border spinner-border-lg me-2 hw-24","role","status",4,"ngIf"],[1,"text-13"],[1,"credit-description","d-flex","align-items-center","justify-content-center","w-100"],[1,"f-12"],[1,"ms-2","me-2"],["width","24px","height","24px","alt","Coin","title","Credit coin",3,"src"],[1,"d-flex","align-items-center","mb-1"],[1,"w-100","generation-settings-panel",3,"productCreditConfig","selection"],["appendTo","body",1,"select-menu","fixed-resolution-drop",2,"width","-webkit-fill-available","width","100%",3,"ngModel","searchable","clearable"],[1,"w-100","generation-settings-panel",3,"selectionChange","productCreditConfig","selection"],["appendTo","body",1,"select-menu","fixed-resolution-drop",2,"width","-webkit-fill-available","width","100%",3,"ngModelChange","open","close","ngModel","searchable","clearable"],["ng-header-tmp",""],[3,"value",4,"ngFor","ngForOf"],[1,"d-inline-flex","align-items-center","justify-content-start","text-13","grey-800","text-semi","lh-125","mb-1","w-100",2,"min-height","32px"],[3,"value"],[1,"option-with-icon","d-flex","align-items-center","justify-content-between"],[1,"d-flex","align-items-center"],[1,"right-sign","f-16","me-2","d-inline-flex",3,"name"],[1,"d-inline-flex","text-12","lh-140","text-black","text-medium","me-1","item-name"],[1,"d-inline-flex","me-1","grey-600","item-ratio","text-semi"],["class","text-12 text-black text-medium lh-140 d-inline-flex me-1",4,"ngIf"],[1,"text-12","text-black","text-medium","lh-140","d-inline-flex","me-1"],["role","status",1,"spinner-border","spinner-border-lg","me-2","hw-24"],[1,"sr-only","text-nowrap","border-0","position-absolute","overflow-hidden"]],template:function _(p,c){1&p&&_angular_core__WEBPACK_IMPORTED_MODULE_21__.DNE(0,AiShootComponent_ng_container_0_Template,2,1,"ng-container",1)(1,AiShootComponent_div_1_Template,2,3,"div",2)(2,AiShootComponent_div_2_Template,3,4,"div",3)(3,AiShootComponent_ng_container_3_Template,2,1,"ng-container",1),2&p&&(_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngForOf",c.rows),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf",1==(null==c.panels?null:c.panels.length)),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngIf",(null==c.panels?null:c.panels.length)>1),_angular_core__WEBPACK_IMPORTED_MODULE_21__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_21__.Y8G("ngForOf",c.rows))},dependencies:[_angular_common__WEBPACK_IMPORTED_MODULE_28__.YU,_angular_common__WEBPACK_IMPORTED_MODULE_28__.Sq,_angular_common__WEBPACK_IMPORTED_MODULE_28__.bT,_shared_ui_toogle_switch_toogle_switch_component__WEBPACK_IMPORTED_MODULE_29__.C,_shared_ui_element_placeholder_element_placeholder_component__WEBPACK_IMPORTED_MODULE_30__.n,_ng_bootstrap_ng_bootstrap__WEBPACK_IMPORTED_MODULE_27__.WP,_ng_bootstrap_ng_bootstrap__WEBPACK_IMPORTED_MODULE_27__.r6,_ng_bootstrap_ng_bootstrap__WEBPACK_IMPORTED_MODULE_27__.tW,_ng_bootstrap_ng_bootstrap__WEBPACK_IMPORTED_MODULE_27__.x7,_ng_bootstrap_ng_bootstrap__WEBPACK_IMPORTED_MODULE_27__.UA,_ng_bootstrap_ng_bootstrap__WEBPACK_IMPORTED_MODULE_27__.$R,_ng_bootstrap_ng_bootstrap__WEBPACK_IMPORTED_MODULE_27__.ZM,_angular_forms__WEBPACK_IMPORTED_MODULE_31__.BC,_angular_forms__WEBPACK_IMPORTED_MODULE_31__.vS,_shared_ui_provideo_icon_provideo_icon_component__WEBPACK_IMPORTED_MODULE_15__.b,_ng_select_ng_select__WEBPACK_IMPORTED_MODULE_32__.vr,_ng_select_ng_select__WEBPACK_IMPORTED_MODULE_32__.xt,_ng_select_ng_select__WEBPACK_IMPORTED_MODULE_32__.Uc,_shared_editor_ui_components_text_prompt_animation_text_prompt_animation_component__WEBPACK_IMPORTED_MODULE_33__.t,_shared_widget_buttons_scroll_menu_buttons_scroll_menu_component__WEBPACK_IMPORTED_MODULE_16__.B,_c
1omponents_workflow_ui_workflow_ui_component__WEBPACK_IMPORTED_MODULE_17__.d,_shared_ai_editor_components_file_upload_file_upload_component__WEBPACK_IMPORTED_MODULE_18__.P,_shared_components_video_generation_settings_video_generation_settings_component__WEBPACK_IMPORTED_MODULE_19__.G,_components_preset_style_preset_style_component__WEBPACK_IMPORTED_MODULE_20__.e],styles:['.top-list-placeholders[_ngcontent-%COMP%]{gap:8px;flex-wrap:nowrap;white-space:nowrap;overflow:hidden}.top-placeholder-pill[_ngcontent-%COMP%]{flex:0 0 80px;width:80px;height:24px;border-radius:14px;background:linear-gradient(90deg,#f1f2f6 25%,#e5e7ef 37%,#f1f2f6 63%);background-size:400% 100%;animation:_ngcontent-%COMP%_drawer-skeleton-shimmer 1.2s ease-in-out infinite}.placeholder-thumb[_ngcontent-%COMP%] .skeleton-box[_ngcontent-%COMP%]{width:112px;height:112px;border-radius:12px;background:linear-gradient(90deg,#f1f2f6 25%,#e5e7ef 37%,#f1f2f6 63%);background-size:400% 100%;animation:_ngcontent-%COMP%_drawer-skeleton-shimmer 1.2s ease-in-out infinite}.placeholder-thumb[_ngcontent-%COMP%] .skeleton-line[_ngcontent-%COMP%]{width:72px;height:12px;border-radius:8px;background:linear-gradient(90deg,#f1f2f6 25%,#e5e7ef 37%,#f1f2f6 63%);background-size:400% 100%;animation:_ngcontent-%COMP%_drawer-skeleton-shimmer 1.2s ease-in-out infinite}@keyframes _ngcontent-%COMP%_drawer-skeleton-shimmer{0%{background-position:100% 0}to{background-position:0 0}}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]{width:100%;height:110px;border-radius:12px;background:linear-gradient(90deg,#fc5cff05 -4%,#2520f605);padding:.9px 4px 4px}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#c9cad4 -4% 100%);-webkit-mask:linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%) content-box,linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%);-webkit-mask-composite:xor;mask-composite:exclude;z-index:1}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]:hover:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#606576 -4% 100%);-webkit-mask:linear-gradient(90deg,#606576 -4%,#606576 100%) content-box,linear-gradient(90deg,#606576 -4%,#606576 100%);-webkit-mask-composite:xor;mask-composite:exclude;z-index:1}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{resize:none;outline:none;width:100%;height:82px;padding:8px 8px 0;font-size:12px;color:#b0b3bf;border:0px;background:transparent;line-height:18px;position:relative;z-index:2}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar{width:4px;height:4px;border-radius:12px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#e3e3e3;border-radius:12px;margin-top:8px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#9a9a9a;border-radius:12px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:#555}.prompt-view[_ngcontent-%COMP%] .prompt-info[_ngcontent-%COMP%]{font-size:11px;color:#959aa7;margin-top:0;padding-left:8px;height:24px;line-height:normal;width:calc(100% - 8px);bottom:4px;z-index:99}.info-up[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#c9cad4 -4% 100%)!important;-webkit-mask:linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%) content-box,linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-blue[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff0d -4%,#2520f60d)!important}.info-blue[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#fc5cff -4%,#2520f6)!important;-webkit-mask:linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%) content-box,linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-blue[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#626adf!important}.info-red[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff0d -4%,#2520f60d)!important}.info-red[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#f25555 -4% 100%)!important;-webkit-mask:linear-gradient(90deg,#F25555 -4%,#F25555 100%) content-box,linear-gradient(90deg,#F25555 -4%,#F25555 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-red[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#f25555!important}.fixed-bottom[_ngcontent-%COMP%]{position:fixed!important;width:300px!important;right:auto!important;left:5rem;-webkit-user-select:none;user-select:none;z-index:99}.filter-category[_ngcontent-%COMP%]{position:fixed;top:calc(56px + 3.57rem + var(--sales-height));z-index:99;height:40px;min-height:40px}.preset-button[_ngcontent-%COMP%]{padding:8px 0;border-bottom:1px solid #E2E3E9}.preset-button[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:#959aa7;font-size:14px;padding:4px 12px;border:none;background:transparent;cursor:pointer;transition:all .2s}.preset-button[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{color:#626adf}.preset-button[_ngcontent-%COMP%] button.active[_ngcontent-%COMP%]{color:#626adf;font-weight:600;border-bottom:2px solid #626ADF}.presets-panel.optionDiv[_ngcontent-%COMP%]{background:#626adf0d;border-radius:12px}
1.btn-tabs-editor[_ngcontent-%COMP%]{background:#626adf0d;height:40px;border:0px;padding:2px}.btn-tabs-editor[_ngcontent-%COMP%] .btn-tab-inner[_ngcontent-%COMP%]{height:36px;border-radius:10px;color:#272b34}.btn-tabs-editor[_ngcontent-%COMP%] .btn-tab-inner[_ngcontent-%COMP%]:hover{background-color:#626adf0d!important;color:#272b34!important}.btn-tabs-editor[_ngcontent-%COMP%] .active-btn-tab[_ngcontent-%COMP%], .btn-tabs-editor[_ngcontent-%COMP%] .active-btn-tab[_ngcontent-%COMP%]:hover{background:#626adf!important;color:#fff!important}.loading-thumb-list[_ngcontent-%COMP%]{flex-flow:wrap}']}),AiShootComponent})()},14398:(_,p,c)=>{c.d(p,{$B:()=>h,$t:()=>s,HC:()=>D,a6:()=>$,cb:()=>S,gi:()=>P,hu:()=>y,uH:()=>ie,vR:()=>f,vt:()=>u});const s={PRODUCT_LIST_PAGE_SIZE:50,PRODUCT_IMAGE_PAGE_SIZE:20,CATEGORY_PRODUCT_PAGE_SIZE:50,CATEGORY_EMBEDDED_IMAGE_COUNT:10,CATEGORY_IMAGE_PAGE_SIZE:10};function P(k={}){return{pageNumber:0,isLoading:!1,isEnd:!1,...k}}function u(k,R){return k?0:R+1}function f(k,R){return k<=0?-1:k/R-1}function S(k=[],R=[],T){if(!R.length)return k;const W=new Set(k.map(Z=>Z[T])),ne=R.filter(Z=>!W.has(Z[T]));return ne.length?k.concat(ne):k}function D(k,R,T){return k<R||"number"==typeof T&&0===T}function y({storeProducts:k,paginationMap:R,request:T,embeddedImageCount:W,pageSize:ne,fetchImages:Z}){const F=k.find(x=>x.productId==T.productId);if(!F)return;R[T.productId]||(R[T.productId]=P());const e=R[T.productId],ee=F.storeProductImages||[];if(0===e.pageNumber&&ee.length>0&&ee.length<W)return void(e.isEnd=!0);if(e.isLoading||e.isEnd)return;const J=e.pageNumber+1;e.isLoading=!0,Z(T.productId,J,x=>{try{const G=x||[];if(F.storeProductImages||(F.storeProductImages=[]),G.length){const U=F.storeProductImages.length;F.storeProductImages=S(F.storeProductImages,G,"productImageId"),e.isEnd=D(G.length,ne,F.storeProductImages.length-U)}else e.isEnd=!0;e.pageNumber=J}finally{e.isLoading=!1}},()=>{e.isLoading=!1})}function ie({request:k,pagination:R,requestSeq:T,isCurrentRequest:W,pageSize:ne,fetchProducts:Z,resolveProducts:F=x=>x?.body?.storeProducts||[],onProductsLoaded:e,onSuccess:ee,onError:J}){const{categoryId:x,reset:G,cb:U=null}=k,N=R.getState();if(N.isLoading||!G&&N.isEnd)return void(U&&U());const K=u(G,N.pageNumber);R.setState({isLoading:!0}),Z(x,K,fe=>{if(W(T))try{const se=F(fe);e({fetchedProducts:se,reset:G,pageToLoad:K,response:fe}),R.setState({pageNumber:K,isEnd:D(se.length,ne)}),ee&&ee()}finally{R.setState({isLoading:!1}),U&&U()}},()=>{W(T)&&(R.setState({isLoading:!1}),J&&J(),U&&U())})}function $(k,R,T=s.CATEGORY_EMBEDDED_IMAGE_COUNT){return(W,ne,Z,F)=>{k.getCategoryProductDetails(W,ne,Z,F,null,null,R,T)}}function h(k,R){return(T,W,ne,Z)=>{k.getTemplateByProductId(T,W,F=>ne(F?.storeProductImages||[]),Z,null,R)}}},87757:(_,p,c)=>{c.d(p,{n:()=>ie});var s=c(54438),P=c(60177),u=c(68064);const f=["video"];function S($,h){1&$&&s.nrm(0,"pi",10)}function D($,h){1&$&&s.nrm(0,"pi",11)}function y($,h){if(1&$){const k=s.RV6();s.j41(0,"div",6),s.bIt("click",function(){s.eBV(k);const T=s.XpG();return s.Njj(T.toggleMute())}),s.j41(1,"div",7),s.DNE(2,S,1,0,"pi",8)(3,D,1,0,"pi",9),s.k0s()()}if(2&$){const k=s.XpG();s.R7$(2),s.Y8G("ngIf",!k.mute),s.R7$(),s.Y8G("ngIf",k.mute)}}let ie=(()=>{var $;class h{constructor(){this.mute=!1,this.soundIconShow=!0,this.muteChange=new s.bkB,this.videoLoaded=!1,this.videoMuted=""}ngOnChanges(R){this.videoMuted=this.mute?"muted":""}ngAfterViewInit(){this.videoElement.nativeElement.addEventListener("loadeddata",()=>{this.videoLoaded=!0})}toggleMute(){this.mute=!this.mute,this.videoMuted=this.mute?"muted":"",this.muteChange.emit(this.mute)}getFormatClass(R){return R?`format-${String(R).toLowerCase()}`:"format-default"}}return($=h).\u0275fac=function(R){return new(R||$)},$.\u0275cmp=s.VBU({type:$,selectors:[["ai-video-preview"]],viewQuery:function(R,T){if(1&R&&s.GBs(f,7),2&R){let W;s.mGM(W=s.lsd())&&(T.videoElement=W.first)}},inputs:{url:"url",mute:"mute",format:"format",soundIconShow:"soundIconShow"},outputs:{muteChange:"muteChange"},features:[s.OA$],decls:7,vars:5,consts:[["video",""],[1,"h-48","text-semi","text-dark","d-flex","align-items-center","image-video-preview",2,"font-size","14px",3,"ngClass"],[1,"position-relative","image-video-preview",2,"max-height","320px",3,"ngClass"],["
1id","video","loop","","width","320px","height","","autoplay","","loop","","playsinline","",1,"",2,"border-radius","8px",3,"muted"],["type","video/mp4",3,"src"],["class","position-absolute mute-unmute",3,"click",4,"ngIf"],[1,"position-absolute","mute-unmute",3,"click"],[1,"icon-column","d-flex","align-items-center","justify-content-center","pointer"],["name","unmute","class","f-24",4,"ngIf"],["name","mute","class","f-24",4,"ngIf"],["name","unmute",1,"f-24"],["name","mute",1,"f-24"]],template:function(R,T){1&R&&(s.j41(0,"div",1),s.EFF(1,"Preview"),s.k0s(),s.j41(2,"div",2)(3,"video",3,0),s.nrm(5,"source",4),s.k0s(),s.DNE(6,y,4,2,"div",5),s.k0s()),2&R&&(s.Y8G("ngClass",T.getFormatClass(T.format)),s.R7$(2),s.Y8G("ngClass",T.getFormatClass(T.format)),s.R7$(),s.Y8G("muted",T.videoMuted),s.R7$(2),s.Y8G("src",T.url,s.B4B),s.R7$(),s.Y8G("ngIf",T.videoLoaded&&T.soundIconShow))},dependencies:[P.YU,P.bT,u.b],styles:[".ai-thumb-view[_ngcontent-%COMP%]{background:url(https://static.lightxeditor.com/assets/images/tranparent.png);height:134px;position:relative;overflow:hidden;-webkit-user-select:none;user-select:none}.ai-thumb-view[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:100%;width:auto;object-fit:contain;overflow:hidden}.ai-thumb-view[_ngcontent-%COMP%]:hover .replace-btn[_ngcontent-%COMP%]{display:flex;z-index:99;position:absolute;background:#0006;align-items:center;justify-content:center;height:100%;width:100%;flex-direction:column}.ai-thumb-view[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%]{display:none}.ai-thumb-view[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{background:#fff!important;border:0px!important;color:#272b34!important;min-width:124px}.ai-thumb-view[_ngcontent-%COMP%] .replace-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{background:linear-gradient(0deg,#626adf0d 0% 100%),#fff!important;color:#272b34}.ai-thumb-view[_ngcontent-%COMP%] .add-on-404[_ngcontent-%COMP%]{display:flex;z-index:99;position:absolute;background:#0000001a;align-items:center;justify-content:center;height:100%;width:100%;flex-direction:column}.deleteBtn[_ngcontent-%COMP%]{background:none;border-radius:12px;width:40px;height:40px;cursor:pointer;display:flex;align-items:center;justify-content:center}.deleteBtn[_ngcontent-%COMP%]:hover{background:#626adf0d}.form-control[_ngcontent-%COMP%]:disabled{color:#b0b3bf!important;border:1px solid #E2E3E9!important}.opacity-3[_ngcontent-%COMP%]{opacity:.3}.format-2[_ngcontent-%COMP%]{max-height:100%!important}"]}),h})()},66035:(_,p,c)=>{c.d(p,{F:()=>P});var s=c(54438);let P=(()=>{var u;class f{constructor(D){this.el=D}ngAfterViewInit(){this.createIntersectionObserver()}createIntersectionObserver(){this.observer=new IntersectionObserver(D=>{D.forEach(y=>{y.isIntersecting?this.el.nativeElement.play():this.el.nativeElement.pause()})},{threshold:.5}),this.observer.observe(this.el.nativeElement)}}return(u=f).\u0275fac=function(D){return new(D||u)(s.rXU(s.aKT))},u.\u0275dir=s.FsC({type:u,selectors:[["","appPlayOnViewport",""]]}),f})()}}]);
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.