Viewing File: /usr/local/cpanel/base/frontend/jupiter/socialbee/main.js
"use strict";(self.webpackChunksocialbee=self.webpackChunksocialbee||[]).push([[179],{3354:(j,Ae,l)=>{var W=l(6593),e=l(5879),a=l(6814),M=l(7368),O=l(5187),Q=l(5861),he=l(7328),re=l(4664),J=l(2096),Ee=l(9397),se=l(6306),it=l(7081),b=l(9862);const u={production:!0,standalone:!1,mockAIData:!1,SERVER_API_URL:"https://api.socialbee.io",SOCIALBEE_APP_URL:"https://app.socialbee.com"},q="access_token",_=u.SERVER_API_URL,Ze={FACEBOOK_GROUP:"Facebook Group",INSTAGRAM:"Instagram Profile",MASTODON:"Mastodon",QUORA:"Quora",TELEGRAM:"Telegram",THREADS:"Threads",WHATSAPP:"WhatsApp",OTHER:"Other"},rt=["Professional","Informational","Friendly","Enthusiastic","Polite","Innovative","Witty"];let ae=(()=>{class n{constructor(t){this.http=t,this.resourceUrl="/cpanel/users"}getUser(){return this.http.get(_+`${this.resourceUrl}`)}createProspectUser(t,o){let i=new b.WM;i=i.set("cPanelCompanyId",""+o);const s=(new b.LE).set("emailAddress",t);return this.http.post(_+`${this.resourceUrl}`,{},{headers:i,params:s})}refreshToken(){return this.http.patch(_+`${this.resourceUrl}`,{})}static{this.\u0275fac=function(o){return new(o||n)(e.LFG(b.eN))}}static{this.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var v=function(n){return n[n.BUSINESS_INFO=1]="BUSINESS_INFO",n[n.SUGGESTED_SOCIAL_NETWORKS=2]="SUGGESTED_SOCIAL_NETWORKS",n[n.GENERATED_POSTS=3]="GENERATED_POSTS",n[n.POSTING_PLAN=4]="POSTING_PLAN",n[n.CONNECT_SOCIAL_ACCOUNTS=5]="CONNECT_SOCIAL_ACCOUNTS",n[n.START_POSTING=6]="START_POSTING",n[n.DASHBOARD=7]="DASHBOARD",n}(v||{}),Y=function(n){return n[n.USER=0]="USER",n[n.SYSTEM=1]="SYSTEM",n[n.ASSISTANT=2]="ASSISTANT",n}(Y||{}),ce=function(n){return n[n.CHAT=0]="CHAT",n[n.SUGGESTED_SOCIAL_NETWORKS=1]="SUGGESTED_SOCIAL_NETWORKS",n[n.CONTENT_CATEGORIES=2]="CONTENT_CATEGORIES",n[n.POSTING_PLAN=3]="POSTING_PLAN",n[n.GENERATED_POSTS=4]="GENERATED_POSTS",n}(ce||{}),fe=l(8656);let Z=(()=>{class n{constructor(t,o,i){this.userService=t,this.localStorage=o,this.client=i,this.userIdentity=null,this.authenticationState=new he.t(1)}authenticate(t){this.userIdentity=t,this.authenticationState.next(this.userIdentity)}identity(t){return(!this.accountCache$||t||!this.isAuthenticated())&&(this.accountCache$=this.fetchUser().pipe((0,re.w)(o=>(0,J.of)(o)),(0,Ee.b)(o=>{this.authenticate(o)}),(0,se.K)(()=>(0,J.of)(null)),(0,it.d)())),this.accountCache$}isAuthenticated(){return null!==this.userIdentity}getAuthToken(){var t=this;return(0,Q.Z)(function*(){return u.standalone?t.localStorage.retrieve(q):(yield t.client.personalStorage.get(q))?.toString()})()}saveUserToken(t){var o=this;return(0,Q.Z)(function*(){u.standalone?o.localStorage.store(q,t.userToken):yield o.client.personalStorage.set(q,t.userToken)})()}getPathByStage(t){switch(t){case v.BUSINESS_INFO:return"/copilot/chat";case v.SUGGESTED_SOCIAL_NETWORKS:return"/copilot/network";case v.GENERATED_POSTS:return"/copilot/posts";case v.POSTING_PLAN:return"/copilot/scheduler";case v.CONNECT_SOCIAL_ACCOUNTS:case v.START_POSTING:return"/"}return"/"}fetchUser(){return this.userService.getUser()}static{this.\u0275fac=function(o){return new(o||n)(e.LFG(ae),e.LFG(fe.n2),e.LFG(M.qr))}}static{this.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var le=l(7398),N=l(1613);let k=(()=>{class n{constructor(t){this.http=t,this.resourceUrl="/cpanel/copilot",this.useMockAiData=u.mockAIData}createBusinessInfo(t){return this.http.post(_+`${this.resourceUrl}/business-info`,{website:t},{headers:this.createHeadersForMockAi()})}generateCopilotSocialAccountsInfo(){return this.http.post(_+`${this.resourceUrl}/social-accounts`,{},{headers:this.createHeadersForMockAi()})}getSocialAccountsInfo(){return this.http.get(_+this.resourceUrl+"/social-accounts")}saveCopilotConversations(t){let o=new b.WM;return o=o.set("Content-Type","application/json"),this.http.post(_+this.resourceUrl+"/conversations",JSON.stringify(t),{headers:o})}getCopilotConversationsByStage(t){return this.http.get(_+this.resourceUrl+`/conversations/${t.toString()}`)}getCategoryItems(){return this.http.get(_+this.resourceUrl+"/posts")}generateCategoryItems(t){let o=this.createHeadersForMockAi();return t&&(o=o.set("Generate-More-Posts","true")),this.http.post(_+this.resourceUrl+"/posts",{},{headers:o})}regenerateCategoryItem(t){return this.http.patch(_+this.resourceUrl+`/posts/${t.id}`,{},{headers:this.createHeadersForMockAi()})}generateCategoryItemImage(t){return this.http.post(_+this.resourceUrl+`/posts/${t.id}/image`,{},{headers:this.createHeadersForMockAi()})}deleteCategoryItem(t){return this.http.delete(_+this.resourceUrl+`/posts/${t.id}`)}getCategoryItemsPreview(t,o,i){const s=(new b.LE).set("start",this.formatDate(t)).set("end",this.formatDate(o)).set("groupBy",i);return this.http.get(_+this.resourceUrl+"/posts-preview",{params:s})}getCopilotStage(){return this.http.get(_+this.resourceUrl+"/state")}setCopilotMockAiData(t){this.useMockAiData=t}generateDataForPrompt(t){let o=new b.WM;return o=o.set("prompt",t),this.http.post(_+this.resourceUrl+"/test-prompts",{},{headers:o})}completeSchedule(){return this.http.post(_+this.resourceUrl+"/schedule-complete",{})}formatDate(t){return(0,N.Z)(t,"yyyy-MM-dd'T'HH:mm:ss")}createHeadersForMockAi(){let t=new b.WM;return t=t.set("X-Mock-AI",this.useMockAiData.toString()),t}static{this.\u0275fac=function(o){return new(o||n)(e.LFG(b.eN))}}static{this.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();class Ue{constructor(r,t,o,i,s,c,p,g,m,C,E,Se,ke,Ie,Zs,Ns,Us){this.id=r,this.login=t,this.firstName=o,this.lastName=i,this.displayName=s,this.emailAddress=c,this.website=p,this.createdDate=g,this.profileImageUrl=m,this.socialAccounts=C,this.availableWorkspaces=E,this.selectedWorkspace=Se,this.impersonated=ke,this.roles=Ie,this.userToken=Zs,this.status=Ns,this.userPreferences=Us}}var De=function(n){return n[n.ACTIVE=0]="ACTIVE",n[n.EMAIL_ADDRESS_NOT_CONFIRMED=1]="EMAIL_ADDRESS_NOT_CONFIRMED",n[n.INACTIVE=2]="INACTIVE",n[n.EMAIL_ADDRESS_MISSING=3]="EMAIL_ADDRESS_MISSING",n[n.ACTIVE_EXTERNAL=4]="ACTIVE_EXTERNAL",n[n.ACTIVE_CONNECT=5]="ACTIVE_CONNECT",n[n.ACTIVE_WEBPROS=6]="ACTIVE_WEBPROS",n[n.PROSPECT_CPANEL=7]="PROSPECT_CPANEL",n}(De||{}),B=l(9515);let P=(()=>{class n{constructor(t,o,i){this.sanitizer=t,this.ngZone=o,this.translateService=i,this.toast=!0,this.i18nEnabled=!0,this.alertId=0,this.alerts=[],this.timeout=5e3}clear(){this.alerts.splice(0,this.alerts.length)}get(){return this.alerts}success(t,o,i,s){return this.addAlert({type:"success",msg:t,params:o,timeout:s||this.timeout,toast:this.isToast(),position:i},[])}error(t,o,i){return this.addAlert({type:"danger",msg:t,params:o,timeout:this.timeout,toast:this.isToast(),position:i},[])}warning(t,o,i){return this.addAlert({type:"warning",msg:t,params:o,timeout:this.timeout,toast:this.isToast(),position:i},[])}info(t,o,i){return this.addAlert({type:"info",msg:t,params:o,timeout:this.timeout,toast:this.isToast(),position:i},[])}addAlert(t,o){t.id=this.alertId++,this.i18nEnabled&&t.msg&&(t.msg=this.translateService.instant(t.msg,t.params));const i=this.factory(t);return t.timeout&&t.timeout>0&&this.ngZone.runOutsideAngular(()=>{setTimeout(()=>{this.ngZone.run(()=>{this.closeAlert(t.id,o)})},t.timeout)}),i}closeAlert(t,o){const i=o&&o.length>0?o:this.alerts;return this.closeAlertByIndex(i.map(s=>s.id).indexOf(t),i)}closeAlertByIndex(t,o){return o.splice(t,1)}isToast(){return this.toast}factory(t){const o={type:t.type,msg:this.sanitizer.sanitize(e.q3G.HTML,t.msg),id:t.id,timeout:t.timeout,toast:t.toast,position:t.position?t.position:"top right",scoped:t.scoped,close:i=>this.closeAlert(t.id,i)};return o.scoped||this.alerts.push(o),o}static{this.\u0275fac=function(o){return new(o||n)(e.LFG(W.H7),e.LFG(e.R0b),e.LFG(B.sK,8))}}static{this.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var I=l(8672);let dt=(()=>{class n{constructor(t){this.spinnerService=t,this.spinnerName="loadingSpinner"}ngOnInit(){}ngOnChanges(){this.showSpinner?this.spinnerService.show(this.spinnerName):this.spinnerService.hide(this.spinnerName,1)}static{this.\u0275fac=function(o){return new(o||n)(e.Y36(I.t2))}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-loading-spinner"]],inputs:{loadingTitle:"loadingTitle",showSpinner:"showSpinner"},features:[e.TTD],decls:5,vars:2,consts:[["type","none","size","small",3,"name"],[1,"d-flex","justify-content-center","align-items-center","flex-column"],["src","assets/images/loading/spinner.svg","alt","Loading img",1,"rotate"],[1,"mt-3","mb-2","loading-spinner-text","fw-normal"]],template:function(o,i){1&o&&(e.TgZ(0,"ngx-spinner",0)(1,"div",1),e._UZ(2,"img",2),e.TgZ(3,"div",3),e._uU(4),e.qZA()()()),2&o&&(e.Q6J("name",i.spinnerName),e.xp6(4),e.Oqu(i.loadingTitle))},dependencies:[I.Ro],styles:[".loading-spinner-text[_ngcontent-%COMP%]{color:var(--cp-sb-background-main-color);font-size:1rem}"]})}}return n})();var _e=l(5619);let G=(()=>{class n{constructor(){this.toasts=new _e.X([]),this.toastsAction=new _e.X(null),this.DEFAULT_DURATION=3e3}getToasts(){return this.toasts.asObservable()}getToastAction(){return this.toastsAction.asObservable()}show(t,o,i=!0,s=this.DEFAULT_DURATION,c=!1,p=!1,g,m){const C={id:m||Date.now().toString(),message:t,type:o,autoClose:i,duration:s,hideClose:c,action:p,actionText:g},E=this.toasts.getValue();this.toasts.next([...E,C]),i&&setTimeout(()=>{this.remove(C.id)},s)}remove(t){const o=this.toasts.getValue();this.toasts.next(o.filter(i=>i.id!==t)),this.toastsAction.next(null)}actionEvent(t){const o=this.toasts.getValue();this.toastsAction.next(o.find(i=>i.id===t))}isToastOpen(t){return this.toasts.getValue().some(o=>o.id===t)}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();function pt(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",4)(1,"button",5),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.actionEvent())}),e._uU(2),e.qZA()()}if(2&n){const t=e.oxw();e.xp6(1),e.Gre("btn btn-link text-decoration-none text-bg-",t.toast.type,""),e.Q6J("disabled",t.disabledActionEvent),e.xp6(1),e.hij(" ",t.toast.actionText," ")}}function gt(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",4)(1,"button",6),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.close())}),e.qZA()()}}let ut=(()=>{class n{constructor(t){this.toastService=t,this.disabledActionEvent=!1}close(){this.disabledActionEvent=!1,this.toastService.remove(this.toast.id)}actionEvent(){this.disabledActionEvent=!0,this.toastService.actionEvent(this.toast.id)}static{this.\u0275fac=function(o){return new(o||n)(e.Y36(G))}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-simple-toast"]],inputs:{toast:"toast"},decls:6,vars:6,consts:[["role","alert","aria-live","assertive","aria-atomic","true"],[1,"d-flex"],[1,"toast-body"],["class","ms-auto me-2 m-auto",4,"ngIf"],[1,"ms-auto","me-2","m-auto"],[3,"disabled","click"],["type","button","aria-label","Close",1,"btn-close",3,"click"]],template:function(o,i){1&o&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2),e._uU(3),e.qZA(),e.YNc(4,pt,3,5,"div",3),e.YNc(5,gt,2,0,"div",3),e.qZA()()),2&o&&(e.Gre("toast show align-items-center text-bg-",i.toast.type," px-1 mb-1 rounded-pill w-100"),e.xp6(3),e.hij(" ",i.toast.message," "),e.xp6(1),e.Q6J("ngIf",i.toast.action),e.xp6(1),e.Q6J("ngIf",!i.toast.hideClose))},dependencies:[a.O5],styles:[".text-bg-gray[_ngcontent-%COMP%]{background-color:var(--cp-sb-chat-message-out-background);color:var(--cp-sb-chat-message-out-color)}"]})}}return n})();function ht(n,r){1&n&&e._UZ(0,"socialbee-simple-toast",2),2&n&&e.Q6J("toast",r.$implicit)}let Fe=(()=>{class n{constructor(t){this.toastService=t,this.toasts$=this.toastService.getToasts()}static{this.\u0275fac=function(o){return new(o||n)(e.Y36(G))}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-simple-toast-container"]],decls:3,vars:3,consts:[[1,"toast-container","position-fixed","bottom-0","start-50","translate-middle-x","mb-4"],[3,"toast",4,"ngFor","ngForOf"],[3,"toast"]],template:function(o,i){1&o&&(e.TgZ(0,"div",0),e.YNc(1,ht,1,1,"socialbee-simple-toast",1),e.ALo(2,"async"),e.qZA()),2&o&&(e.xp6(1),e.Q6J("ngForOf",e.lcZ(2,1,i.toasts$)))},dependencies:[a.sg,ut,a.Ov],styles:[".toast-container[_ngcontent-%COMP%]{z-index:1050;min-width:300px}"]})}}return n})();class ft{constructor(r="",t="",o="",i="",s,c,p,g,m,C,E,Se,ke,Ie){this.postProvider=r,this.postProviderProfileProvider=t,this.type=o,this.timezone=i,this.forceReminders=s,this.locationId=c,this.isAnalyticsNotUpgraded=p,this.connectionType=g,this.scheduleRunning=m,this.customWebhook=C,this.postProviderBusinessProfile=E,this.twitterBasicApp=Se,this.twitterRemindersApp=ke,this.customProvider=Ie}}class Le{constructor(r,t,o,i,s,c,p,g,m,C=new ft){this.id=r,this.providerId=t,this.providerUserId=o,this.providerTargetId=i,this.contentProviderId=s,this.nickname=c,this.fullName=p,this.profileImageUrl=g,this.shouldReauthenticate=m,this.accountProperties=C}}const me={failedPosts:0,pendingPosts:0,publishedPosts:0,scheduledPosts:0,socialInbox:0};var de=l(2181),Qe=l(9189),Ce=l(5134);let _t=(()=>{class n{constructor(t){this.http=t,this.resourceUrl="/cpanel"}getSocialAccountStatsForToday(t){return this.http.get(_+`${this.resourceUrl}/socials/${t}/analytics/today`)}getContentPreview(t,o,i,s){const c=(0,Qe.Z)(o),p=(0,Ce.Z)(i),g=(new b.LE).set("socialAccountIds",t).set("start",this.formatDate(c)).set("end",this.formatDate(p)).set("groupBy",s);return this.http.get(_+`${this.resourceUrl}/schedule`,{params:g})}formatDate(t){return(0,N.Z)(t,"yyyy-MM-dd'T'HH:mm:ss")}static{this.\u0275fac=function(o){return new(o||n)(e.LFG(b.eN))}}static{this.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var pe=function(n){return n.DAY="DAY",n.HOUR="HOUR",n}(pe||{}),U=l(8584),Re=function(n){return n.FACEBOOK_PROFILE="facebook-profile",n.FACEBOOK_PAGE="facebook-page",n.FACEBOOK_GROUP="facebook-group",n.INSTAGRAM_PROFILE="instagram-profile",n.INSTAGRAM_BUSINESS="instagram-business",n.TWITTER_PROFILE="twitter-profile",n.LINKEDIN_PROFILE="linkedin-profile",n.LINKEDIN_PAGE="linkedin-page",n.PINTEREST_PROFILE="pinterest-profile",n.PINTEREST_BUSINESS="pinterest-business",n.GOOGLE_PAGE="google-page",n.YOUTUBE_CHANNEL="youtube-channel",n.TIKTOK_PROFILE="tiktok-profile",n.BLUESKY_PROFILE="bluesky-profile",n.UNIVERSAL_POSTING_PROFILE="universal-posting-profile",n.THREADS_PROFILE="threads-profile",n}(Re||{}),T=function(n){return n.PROFILE="profile",n.GROUP="group",n.PAGE="page",n.BUSINESS="business",n.CHANNEL="channel",n.APP="app",n}(T||{}),d=function(n){return n.FACEBOOK="facebook",n.INSTAGRAM="instagram",n.THREADS="threads",n.TWITTER="twitter",n.LINKEDIN="linkedin",n.PINTEREST="pinterest",n.GOOGLE="google",n.YOUTUBE="youtube",n.TIKTOK="tiktok",n.BLUESKY="bluesky",n.UNIVERSAL_POSTING="universal-posting",n}(d||{}),R=function(n){return n.SOCIALBEE="socialBee",n.SOCIALBEE_REMINDERS="socialBeeReminders",n.ZAPIER="zapier",n.BUFFER="buffer",n.HOOTSUITE="hootsuite",n}(R||{}),ve=function(n){return n.FACEBOOK_GROUP="FACEBOOK_GROUP",n.INSTAGRAM="INSTAGRAM",n.MASTODON="MASTODON",n.QUORA="QUORA",n.TELEGRAM="TELEGRAM",n.THREADS="THREADS",n.WHATSAPP="WHATSAPP",n.OTHER="OTHER",n}(ve||{}),z=l(2051);function vt(n,r){if(1&n&&(e.TgZ(0,"div",11),e._UZ(1,"img",12),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("src",t.imageUrl,e.LSH)("alt",t.imageAlt)}}function bt(n,r){if(1&n&&(e.TgZ(0,"div",13),e._uU(1),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Oqu(t.title)}}function Ot(n,r){if(1&n&&e._UZ(0,"div",14),2&n){const t=e.oxw();e.Q6J("innerHTML",t.message,e.oJD)}}function Pt(n,r){if(1&n&&e._UZ(0,"i",15),2&n){const t=e.oxw();e.Q6J("ngClass",t.buttonIcon)}}let Mt=(()=>{class n{constructor(t){this.modalRef=t,this.title="",this.message="",this.confirmButtonText="Ok",this.buttonIcon="",this.result=new e.vpe}ngOnInit(){}onConfirm(){this.result.emit(!0),this.dismiss()}onCancel(){this.result.emit(!1),this.dismiss()}dismiss(){this.modalRef.hide()}static{this.\u0275fac=function(o){return new(o||n)(e.Y36(z.UZ))}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["jhi-confirmation-modal"]],inputs:{imageUrl:"imageUrl",imageAlt:"imageAlt",title:"title",message:"message",confirmButtonText:"confirmButtonText",buttonIcon:"buttonIcon"},outputs:{result:"result"},decls:12,vars:5,consts:[[1,"modal-header","border-0","align-items-center","justify-content-end","px-4","pt-3","pb-0"],["type","button",1,"btn","m-0","p-0",3,"click"],[1,"fal","fa-times"],[1,"confirmation-modal-body","modal-body","px-4","py-0","justify-content-center","text-center"],["class","mb-3",4,"ngIf"],["class","confirmation-title mt-2",4,"ngIf"],["class","confirmation-message mt-3",3,"innerHTML",4,"ngIf"],[1,"border-0","m-0","px-4","py-3","my-3"],[1,"d-flex","justify-content-center"],[1,"btn","btn-primary-socialbee","m-0",3,"click"],[3,"ngClass",4,"ngIf"],[1,"mb-3"],[1,"img-fluid",3,"src","alt"],[1,"confirmation-title","mt-2"],[1,"confirmation-message","mt-3",3,"innerHTML"],[3,"ngClass"]],template:function(o,i){1&o&&(e.TgZ(0,"div",0)(1,"button",1),e.NdJ("click",function(){return i.onCancel()}),e._UZ(2,"i",2),e.qZA()(),e.TgZ(3,"div",3),e.YNc(4,vt,2,2,"div",4),e.YNc(5,bt,2,1,"div",5),e.YNc(6,Ot,1,1,"div",6),e.qZA(),e.TgZ(7,"div",7)(8,"div",8)(9,"button",9),e.NdJ("click",function(){return i.onConfirm()}),e._uU(10),e.YNc(11,Pt,1,1,"i",10),e.qZA()()()),2&o&&(e.xp6(4),e.Q6J("ngIf",i.imageUrl),e.xp6(1),e.Q6J("ngIf",i.title),e.xp6(1),e.Q6J("ngIf",i.message),e.xp6(4),e.hij(" ",i.confirmButtonText," "),e.xp6(1),e.Q6J("ngIf",i.buttonIcon))},dependencies:[a.mk,a.O5],styles:[".confirmation-modal-body[_ngcontent-%COMP%] .confirmation-title[_ngcontent-%COMP%]{font-size:1.125rem;font-weight:600}.confirmation-modal-body[_ngcontent-%COMP%] .confirmation-disclaimer[_ngcontent-%COMP%]{font-size:.75rem}"]})}}return n})(),D=(()=>{class n{constructor(t){this.client=t}trackEvent(t,o){try{this.client.analytics.track(t,o||{})}catch{}}static{this.\u0275fac=function(o){return new(o||n)(e.LFG(M.qr))}}static{this.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var x=function(n){return n.SMALL="SMALL",n.MEDIUM="MEDIUM",n.LARGE="LARGE",n}(x||{}),y=function(n){return n.HORIZONTAL="HORIZONTAL",n.VERTICAL="VERTICAL",n}(y||{});class A{constructor(r=x.MEDIUM,t=y.HORIZONTAL,o=!1,i=!1,s=!1,c=!1,p=!0,g=!1,m,C){this.size=r,this.layout=t,this.allowUpdateProfileImage=o,this.isInline=i,this.hideDetails=s,this.hideText=c,this.showLink=p,this.ownPopup=g,this.timestamp=m,this.timestampLink=C}}var F=l(2500),H=l(641);let Tt=(()=>{class n{transform(t){if(t.accountProperties.type===T.PROFILE)switch(t.providerId){case d.FACEBOOK:return"Facebook Profile";case d.LINKEDIN:return"LinkedIn Profile";case d.INSTAGRAM:return"Instagram Profile";case d.PINTEREST:return"Pinterest Profile";case d.TWITTER:return"X (Twitter) Profile";case d.TIKTOK:return"TikTok Profile";case d.BLUESKY:return"Bluesky Profile";case d.THREADS:return"Threads Profile";default:return"Profile"}if(t.accountProperties.type===T.PAGE)switch(t.providerId){case d.FACEBOOK:return"Facebook Page";case d.LINKEDIN:return"LinkedIn Company";case d.GOOGLE:return"Google Location";default:return"Page"}if(t.accountProperties.type===T.GROUP&&t.providerId===d.FACEBOOK)return"Facebook Group";if(t.accountProperties.type===T.BUSINESS)switch(t.providerId){case d.INSTAGRAM:return"Instagram Business";case d.PINTEREST:return"Pinterest Business";default:return"Business"}return t.accountProperties.type===T.CHANNEL&&t.providerId===d.YOUTUBE?"YouTube Channel":"hootsuite"===t.accountProperties.type?"Hootsuite profile":t.providerId===d.UNIVERSAL_POSTING&&t.providerUserId?t.providerUserId===ve.OTHER?t.accountProperties?.customProvider:Ze[t.providerUserId]:""}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275pipe=e.Yjl({name:"socialProfileType",type:n,pure:!0,standalone:!0})}}return n})(),xt=(()=>{class n{transform(t){let o;if(null!==t.nickname&&(t.accountProperties&&(t.accountProperties.type===R.BUFFER||t.accountProperties.type===R.HOOTSUITE)&&t.accountProperties.postProviderProfileProvider===d.TWITTER||t.providerId===d.TWITTER)&&(o="https://twitter.com/"+t.nickname),t.providerId===d.FACEBOOK&&t.accountProperties&&(t.accountProperties.type===T.PAGE&&null!==t.nickname?o="https://facebook.com/"+t.providerTargetId:t.accountProperties.type===T.GROUP&&null!==t.providerTargetId&&(o="https://facebook.com/groups/"+t.providerTargetId)),t.providerId===d.LINKEDIN&&t.accountProperties&&t.accountProperties.type===T.PROFILE&&(o="https://linkedin.com/in/"+t.nickname),(t.providerId===d.LINKEDIN&&t.accountProperties&&t.accountProperties.type===T.PAGE||t.accountProperties&&t.accountProperties.type===R.BUFFER&&t.accountProperties.postProviderProfileProvider===d.LINKEDIN&&t.profileImageUrl&&t.profileImageUrl.includes("company"))&&(o="https://linkedin.com/company/"+t.nickname),null!==t.nickname&&(t.accountProperties&&(t.accountProperties.type===R.BUFFER||t.accountProperties.type===R.HOOTSUITE)&&t.accountProperties.postProviderProfileProvider===d.INSTAGRAM||t.providerId===d.INSTAGRAM)&&(o="https://instagram.com/"+t.nickname),t.accountProperties&&t.accountProperties.type===R.HOOTSUITE&&t.accountProperties.postProviderProfileProvider===d.PINTEREST&&(o="https://pinterest.com/"+t.nickname),t.providerId===d.PINTEREST&&(o="https://pinterest.com/"+t.nickname),t.providerId===d.GOOGLE&&t.accountProperties&&(o="https://www.google.com/search?ludocid="+t.accountProperties.locationId+"&q="+t.fullName),t.providerId===d.BLUESKY&&(o="https://bsky.app/profile/"+t.nickname),t.providerId===d.YOUTUBE){if(!t.nickname)return;o="https://youtube.com/"+t.nickname}if(t.providerId===d.TIKTOK){if(!t.nickname&&!t.fullName)return;o="https://tiktok.com/@"+(t.nickname?t.nickname:t.fullName)}return t.providerId===d.BLUESKY&&(o="https://bsky.app/profile/"+t.nickname),t.providerId===d.THREADS&&(o="https://www.threads.net/"+t.nickname),o}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275pipe=e.Yjl({name:"socialProfileUrl",type:n,pure:!0,standalone:!0})}}return n})();function yt(n,r){if(1&n&&(e.TgZ(0,"span")(1,"a",3),e.ALo(2,"socialProfileUrl"),e._uU(3),e.qZA()()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("href",e.lcZ(2,2,t.profile),e.LSH),e.xp6(2),e.Oqu(t.profile.fullName&&""!==t.profile.fullName?t.profile.fullName:t.profile.nickname)}}function wt(n,r){if(1&n&&(e.TgZ(0,"span",4),e._uU(1),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.hij(" ",t.profile.fullName&&""!==t.profile.fullName?t.profile.fullName:t.profile.nickname," ")}}function St(n,r){if(1&n&&(e.ynx(0),e._UZ(1,"br"),e.TgZ(2,"span",5),e._uU(3),e.ALo(4,"socialProfileType"),e.qZA(),e.BQk()),2&n){const t=e.oxw();e.xp6(3),e.Oqu(e.lcZ(4,1,t.profile))}}let kt=(()=>{class n{constructor(){this.timestampClickedEvent=new e.vpe,this.universalPostingName="",this.UNIVERSAL_POSTING_PROVIDER_TYPE_NAMES=Ze,this.accountProviderTypeEnum=d,this.accountUniversalPostingProviderEnum=ve,this.profile=new Le,this.profileOptions=new A}ngOnInit(){this.profileOptions.showLink&&(null!==this.profile.nickname&&(this.profile.accountProperties&&("buffer"===this.profile.accountProperties.type||"hootsuite"===this.profile.accountProperties.type)&&"twitter"===this.profile.accountProperties.postProviderProfileProvider||"twitter"===this.profile.providerId)&&(this.url="https://twitter.com/"+this.profile.nickname),"facebook"===this.profile.providerId&&this.profile.accountProperties&&("page"===this.profile.accountProperties.type&&null!==this.profile.nickname?this.url="https://facebook.com/"+this.profile.providerTargetId:"group"===this.profile.accountProperties.type&&(this.url="https://facebook.com/groups/"+this.profile.providerTargetId)),"linkedin"===this.profile.providerId&&this.profile.accountProperties&&"profile"===this.profile.accountProperties.type&&(this.url="https://linkedin.com/in/"+this.profile.nickname),("linkedin"===this.profile.providerId&&this.profile.accountProperties&&"page"===this.profile.accountProperties.type||this.profile.accountProperties&&"buffer"===this.profile.accountProperties.type&&"linkedin"===this.profile.accountProperties.postProviderProfileProvider&&this.profile.profileImageUrl&&this.profile.profileImageUrl.includes("company"))&&(this.url="https://linkedin.com/company/"+this.profile.nickname),null!==this.profile.nickname&&(this.profile.accountProperties&&("buffer"===this.profile.accountProperties.type||"hootsuite"===this.profile.accountProperties.type)&&"instagram"===this.profile.accountProperties.postProviderProfileProvider||"instagram"===this.profile.providerId)&&(this.url="https://instagram.com/"+this.profile.nickname),this.profile.accountProperties&&"hootsuite"===this.profile.accountProperties.type&&"pinterest"===this.profile.accountProperties.postProviderProfileProvider&&(this.url="https://pinterest.com/"+this.profile.nickname),"pinterest"===this.profile.providerId&&(this.url="https://pinterest.com/"+this.profile.nickname),"google"===this.profile.providerId&&this.profile.accountProperties&&(this.url="https://www.google.com/search?ludocid="+this.profile.accountProperties.locationId+"&q="+this.profile.fullName),"bluesky"===this.profile.providerId&&(this.url="https://bsky.app/profile/"+this.profile.nickname),this.profile.providerId===d.THREADS&&(this.url="https://www.threads.net/"+this.profile.nickname)),this.profile.providerId===this.accountProviderTypeEnum.UNIVERSAL_POSTING&&this.profile.providerUserId&&(this.universalPostingName=this.profile.providerUserId===this.accountUniversalPostingProviderEnum.OTHER?this.profile.accountProperties?.customProvider:this.UNIVERSAL_POSTING_PROVIDER_TYPE_NAMES[this.profile.providerUserId])}timestampClicked(t){t.stopPropagation(),t.preventDefault(),this.timestampClickedEvent.emit(t)}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-social-profile-info"]],inputs:{profile:"profile",profileOptions:"profileOptions"},outputs:{timestampClickedEvent:"timestampClickedEvent"},decls:4,vars:3,consts:[[1,"account-header-content-details"],[4,"ngIf"],["class","account-header-text",4,"ngIf"],["target","_blank",3,"href"],[1,"account-header-text"],[1,"account-description","text-muted","font-weight-normal"]],template:function(o,i){1&o&&(e.TgZ(0,"div",0),e.YNc(1,yt,4,4,"span",1),e.YNc(2,wt,2,1,"span",2),e.YNc(3,St,5,3,"ng-container",1),e.qZA()),2&o&&(e.xp6(1),e.Q6J("ngIf",i.profileOptions.showLink),e.xp6(1),e.Q6J("ngIf",!i.profileOptions.showLink),e.xp6(1),e.Q6J("ngIf",!i.profileOptions.hideDetails))},dependencies:[a.O5,Tt,xt]})}}return n})();function It(n,r){if(1&n&&e._UZ(0,"img",26),2&n){const t=e.oxw(4);e.Q6J("src",t.profileImageUrl,e.LSH)}}function At(n,r){1&n&&e._UZ(0,"img",27)}function Et(n,r){if(1&n&&(e.TgZ(0,"div",23),e.YNc(1,It,1,1,"img",24),e.YNc(2,At,1,0,"img",25),e.qZA()),2&n){const t=e.oxw(3);e.xp6(1),e.Q6J("ngIf",!t.updatingImage),e.xp6(1),e.Q6J("ngIf",t.updatingImage)}}function Zt(n,r){1&n&&e._UZ(0,"i",28)}function Nt(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",18),e.NdJ("click",function(){const s=e.CHM(t).openFileSelector;return e.KtG(s())}),e.TgZ(1,"div",19),e._UZ(2,"i",20),e.qZA(),e.YNc(3,Et,3,2,"div",21),e.YNc(4,Zt,1,0,"i",22),e.qZA()}if(2&n){const t=e.oxw(2);e.xp6(3),e.Q6J("ngIf",t.profile.profileImageUrl),e.xp6(1),e.Q6J("ngIf",!t.profile.profileImageUrl)}}function Ut(n,r){1&n&&(e.TgZ(0,"div",15)(1,"ngx-file-drop",16),e.YNc(2,Nt,5,2,"ng-template",17),e.qZA()())}const Dt=function(n){return{"center-block":n}};function Ft(n,r){if(1&n&&(e.TgZ(0,"div"),e._UZ(1,"img",30),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("src",t.profileImageUrl,e.LSH)("ngClass",e.VKq(2,Dt,t.isVertical()))}}function Lt(n,r){if(1&n&&(e.TgZ(0,"div")(1,"div",31),e._UZ(2,"img",32),e.qZA()()),2&n){const t=e.oxw(2);e.xp6(1),e.s9C("popover",t.profile.fullName),e.xp6(1),e.Q6J("src",t.profileImageUrl,e.LSH)}}function Qt(n,r){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,Ft,2,4,"div",29),e.YNc(2,Lt,3,2,"div",29),e.qZA()),2&n){const t=e.oxw();e.Gre("account-image-wrapper ",t.profile.providerId,""),e.xp6(1),e.Q6J("ngIf",!t.profileOptions.ownPopup),e.xp6(1),e.Q6J("ngIf",t.profileOptions.ownPopup)}}const Rt=function(n){return{preferred:n}};function Jt(n,r){if(1&n&&e._UZ(0,"i",0),2&n){const t=e.oxw();e.IyS("",t.profile.providerId===t.accountProviderTypeEnum.BLUESKY||t.profile.providerId===t.accountProviderTypeEnum.UNIVERSAL_POSTING||t.profile.providerId===t.accountProviderTypeEnum.TWITTER||t.profile.providerId===t.accountProviderTypeEnum.THREADS?"fak":"fa"," mx-auto fa-",t.profile.providerId," account-social-platform ",t.isInlineIcon()?"inline-icon":"",""),e.Q6J("ngClass",e.VKq(6,Rt,"buffer"===(null==t.profile||null==t.profile.accountProperties?null:t.profile.accountProperties.postProvider)))}}function qt(n,r){if(1&n&&e._UZ(0,"i"),2&n){const t=e.oxw();e.MT6("fa fa-",null==t.profile||null==t.profile.accountProperties?null:t.profile.accountProperties.postProviderProfileProvider," account-social-platform ",t.isInlineIcon()?"inline-icon":"","")}}function Yt(n,r){1&n&&e._UZ(0,"i",33)}function Bt(n,r){if(1&n&&e._UZ(0,"i"),2&n){const t=e.oxw();e.Gre("fa fa-buffer small account-external-platform ",t.isInlineIcon()?"inline-icon":"","")}}function Gt(n,r){if(1&n&&e._UZ(0,"i"),2&n){const t=e.oxw();e.Gre("fa fa-hootsuite small account-external-platform ",t.isInlineIcon()?"inline-icon":"","")}}function Ht(n,r){1&n&&e._UZ(0,"i",34)}function Vt(n,r){1&n&&e._UZ(0,"i",35)}function Kt(n,r){1&n&&e._UZ(0,"i",36)}function jt(n,r){1&n&&e._UZ(0,"i",37)}function Wt(n,r){1&n&&e._UZ(0,"i",38)}function zt(n,r){1&n&&e._UZ(0,"i",39)}function $t(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"socialbee-social-profile-info",40),e.NdJ("timestampClickedEvent",function(i){e.CHM(t);const s=e.oxw();return e.KtG(s.timestampClicked(i))}),e.qZA()}if(2&n){const t=e.oxw();e.Q6J("profile",t.profile)("profileOptions",t.profileOptions)}}function Xt(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"socialbee-social-profile-info",41),e.NdJ("timestampClickedEvent",function(i){e.CHM(t);const s=e.oxw();return e.KtG(s.timestampClicked(i))}),e.qZA()}if(2&n){const t=e.oxw();e.Q6J("profile",t.profile)("profileOptions",t.profileOptions)}}const en=function(n,r){return{inline:n,"inline-icon":r}},tn=function(n){return{vertical:n}};let $=(()=>{class n{constructor(t){this.userService=t,this.timestampClickedEvent=new e.vpe,this.profileImageUrl="",this.updatingImage=!1,this.accountProviderTypeEnum=d,this.profile=new Le,this.profileOptions=new A}ngOnInit(){this.profileImageUrl=this.getImageUrl(this.profile.profileImageUrl,!1,!0)}isInlineIcon(){return this.profileOptions?.size===x.SMALL&&!this.profileOptions.hideText}isVertical(){return this.profileOptions?.layout===y.VERTICAL}timestampClicked(t){this.timestampClickedEvent.emit(t)}getImageUrl(t,o,i){return!t||t.startsWith("https")&&!o||"/theme/images/user_placeholder.png"===t?t||"":i?"/api/proxy-image?url="+encodeURIComponent(t):"/proxy-image?url="+encodeURIComponent(t)}dropped(t){}uploadFile(t){this.updatingImage=!0}static{this.\u0275fac=function(o){return new(o||n)(e.Y36(ae))}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-social-profile"]],inputs:{profile:"profile",profileOptions:"profileOptions"},outputs:{timestampClickedEvent:"timestampClickedEvent"},decls:18,vars:25,consts:[[3,"ngClass"],[1,"account-header-content",3,"ngClass"],[1,"account-image-container"],["class","social-profile-image-selector",4,"ngIf"],[3,"class",4,"ngIf"],[3,"class","ngClass",4,"ngIf"],["class","fa fa-gear small account-external-platform",4,"ngIf"],["class","fa fa-mobile small account-external-platform",4,"ngIf"],["class","fa fa-zapier small account-external-platform",4,"ngIf"],["class","fa fa-pabbly small account-external-platform",4,"ngIf"],["class","fa fa-make small account-external-platform",4,"ngIf"],["class","fa fa-boost-space small account-external-platform",4,"ngIf"],["class","fa fa-webhook small account-external-platform",4,"ngIf"],["class","account-name",3,"profile","profileOptions","timestampClickedEvent",4,"ngIf"],["class","account-header-content",3,"profile","profileOptions","timestampClickedEvent",4,"ngIf"],[1,"social-profile-image-selector"],["dropZoneClassName","file-dropper-zone","contentClassName","",1,"border-0","drop-box-item","profile-photo"],["ngx-file-drop-content-tmp","","multiple","false"],[3,"click"],[1,"profile-image-upload","rounded-circle"],["aria-hidden","true",1,"fa","fa-camera"],["class","file-button-wrapper",4,"ngIf"],["aria-hidden","true","class","fa fa-camera text-muted",4,"ngIf"],[1,"file-button-wrapper"],["class","img-fluid rounded-circle center-block account-image",3,"src",4,"ngIf"],["class","img-fluid rounded-circle center-block account-image","src","/theme/images/loader.gif",4,"ngIf"],[1,"img-fluid","rounded-circle","center-block","account-image",3,"src"],["src","/theme/images/loader.gif",1,"img-fluid","rounded-circle","center-block","account-image"],["aria-hidden","true",1,"fa","fa-camera","text-muted"],[4,"ngIf"],[1,"account-image",3,"src","ngClass"],["triggers","mouseenter:mouseleave","containerClass","extended-popover","container","body",1,"one-post-icon",2,"position","relative","display","inline-block",3,"popover"],["ng-class","{'center-block' : isVertical()}",1,"account-image",3,"src"],[1,"fa","fa-gear","small","account-external-platform"],[1,"fa","fa-mobile","small","account-external-platform"],[1,"fa","fa-zapier","small","account-external-platform"],[1,"fa","fa-pabbly","small","account-external-platform"],[1,"fa","fa-make","small","account-external-platform"],[1,"fa","fa-boost-space","small","account-external-platform"],[1,"fa","fa-webhook","small","account-external-platform"],[1,"account-name",3,"profile","profileOptions","timestampClickedEvent"],[1,"account-header-content",3,"profile","profileOptions","timestampClickedEvent"]],template:function(o,i){1&o&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2),e.YNc(3,Ut,3,0,"div",3),e.YNc(4,Qt,3,5,"div",4),e.YNc(5,Jt,1,8,"i",5),e.YNc(6,qt,1,4,"i",4),e.YNc(7,Yt,1,0,"i",6),e.YNc(8,Bt,1,3,"i",4),e.YNc(9,Gt,1,3,"i",4),e.YNc(10,Ht,1,0,"i",7),e.YNc(11,Vt,1,0,"i",8),e.YNc(12,Kt,1,0,"i",9),e.YNc(13,jt,1,0,"i",10),e.YNc(14,Wt,1,0,"i",11),e.YNc(15,zt,1,0,"i",12),e.qZA(),e.YNc(16,$t,1,2,"socialbee-social-profile-info",13),e.qZA(),e.YNc(17,Xt,1,2,"socialbee-social-profile-info",14),e.qZA()),2&o&&(e.Gre("account-header ",i.profileOptions.size.toLowerCase(),""),e.Q6J("ngClass",e.WLB(20,en,i.profileOptions.isInline,i.isInlineIcon())),e.xp6(1),e.Q6J("ngClass",e.VKq(23,tn,i.isVertical())),e.xp6(2),e.Q6J("ngIf",i.profileOptions.allowUpdateProfileImage),e.xp6(1),e.Q6J("ngIf",!i.profileOptions.allowUpdateProfileImage),e.xp6(1),e.Q6J("ngIf",i.profile.providerId&&"socialBee"!==i.profile.providerId),e.xp6(1),e.Q6J("ngIf","socialBee"===i.profile.providerId),e.xp6(1),e.Q6J("ngIf","user"===(null==i.profile||null==i.profile.accountProperties?null:i.profile.accountProperties.connectionType)),e.xp6(1),e.Q6J("ngIf","buffer"===(null==i.profile||null==i.profile.accountProperties||null==i.profile.accountProperties.postProvider?null:i.profile.accountProperties.postProvider.toLowerCase())),e.xp6(1),e.Q6J("ngIf","hootsuite"===(null==i.profile||null==i.profile.accountProperties||null==i.profile.accountProperties.postProvider?null:i.profile.accountProperties.postProvider.toLowerCase())),e.xp6(1),e.Q6J("ngIf","socialBeeReminders"===(null==i.profile||null==i.profile.accountProperties?null:i.profile.accountProperties.postProvider)||(null==i.profile||null==i.profile.accountProperties?null:i.profile.accountProperties.forceReminders)&&"true"===(null==i.profile||null==i.profile.accountProperties?null:i.profile.accountProperties.forceReminders)),e.xp6(1),e.Q6J("ngIf","zapier"===(null==i.profile||null==i.profile.accountProperties?null:i.profile.accountProperties.postProvider)),e.xp6(1),e.Q6J("ngIf","pabbly"===(null==i.profile||null==i.profile.accountProperties?null:i.profile.accountProperties.postProvider)),e.xp6(1),e.Q6J("ngIf","make"===(null==i.profile||null==i.profile.accountProperties?null:i.profile.accountProperties.postProvider)),e.xp6(1),e.Q6J("ngIf","boostSpace"===(null==i.profile||null==i.profile.accountProperties?null:i.profile.accountProperties.postProvider)),e.xp6(1),e.Q6J("ngIf","webhook"===(null==i.profile||null==i.profile.accountProperties?null:i.profile.accountProperties.postProvider)),e.xp6(1),e.Q6J("ngIf",!i.isVertical()&&!i.profileOptions.hideText),e.xp6(1),e.Q6J("ngIf",i.isVertical()&&!i.profileOptions.hideText))},dependencies:[a.mk,a.O5,H.k5,kt]})}}return n})();function nn(n,r){if(1&n&&(e.TgZ(0,"div",5),e._UZ(1,"socialbee-social-profile",6),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("profile",t.selectedProfile)("profileOptions",t.profileOptions)}}function on(n,r){if(1&n){const t=e.EpF();e.ynx(0),e.TgZ(1,"li",9),e.NdJ("click",function(){const s=e.CHM(t).$implicit,c=e.oxw(2);return e.KtG(c.selectProfile(s))}),e._UZ(2,"socialbee-social-profile",6),e.qZA(),e.BQk()}if(2&n){const t=r.$implicit,o=e.oxw(2);e.xp6(2),e.Q6J("profile",t)("profileOptions",o.profileOptions)}}function rn(n,r){if(1&n&&(e.TgZ(0,"ul",7),e.YNc(1,on,3,2,"ng-container",8),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngForOf",t.socialProfiles)}}let sn=(()=>{class n{constructor(){this.profileSelected=new e.vpe,this.socialProfiles=[],this.profileOptions=new A(x.SMALL,y.HORIZONTAL,!1,!1,!0,!1,!1,!0)}ngOnInit(){this.selectedProfile=this.selectedProfile||this.socialProfiles[0]}selectProfile(t){this.selectedProfile=t,this.profileSelected.emit(t)}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-social-profile-dropdown"]],inputs:{socialProfiles:"socialProfiles",selectedProfile:"selectedProfile"},outputs:{profileSelected:"profileSelected"},decls:5,vars:1,consts:[["dropdown","",1,"profile-selector-dropdown","dropdown"],["aria-expanded","false","aria-haspopup","true","dropdownToggle","",1,"d-flex","align-items-center","justify-content-between","rounded-pill","btn-default","border","px-2","py-1","w-100"],["class","d-flex p-2 overflow-hidden",4,"ngIf"],[1,"fa","fa-chevron-down","p-1"],["aria-labelledby","dropdownMenuButton","class","dropdown-menu p-0",4,"dropdownMenu"],[1,"d-flex","p-2","overflow-hidden"],[3,"profile","profileOptions"],["aria-labelledby","dropdownMenuButton",1,"dropdown-menu","p-0"],[4,"ngFor","ngForOf"],[1,"dropdown-item","py-2","px-4",3,"click"]],template:function(o,i){1&o&&(e.TgZ(0,"div",0)(1,"button",1),e.YNc(2,nn,2,2,"div",2),e._UZ(3,"i",3),e.qZA(),e.YNc(4,rn,2,1,"ul",4),e.qZA()),2&o&&(e.xp6(2),e.Q6J("ngIf",i.selectedProfile))},dependencies:[a.sg,a.O5,F.Hz,F.Mq,F.TO,$],styles:[".profile-selector-dropdown[_ngcontent-%COMP%]{max-width:300px}.profile-selector-dropdown[_ngcontent-%COMP%] .dropdown-item[_ngcontent-%COMP%]{cursor:pointer}.profile-selector-dropdown[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{font-size:.875rem}"]})}}return n})();var X=l(8645),w=function(n){return n.FAILED="FAILED",n.PUBLISHED="PUBLISHED",n.SCHEDULED="SCHEDULED",n.DRAFT="DRAFT",n.NO_POSTS="NO_POSTS",n}(w||{}),ee=function(n){return n.CATEGORY="CATEGORY",n.RANDOM="RANDOM",n.NXT_IN_SEQ="NXT_IN_SEQ",n.SPECIFIC_TIME="SPECIFIC_TIME",n}(ee||{}),Je=l(7712);let an=(()=>{class n{constructor(){}initItemsOnResize(t){window.addEventListener("resize",this.calculateProfilesCount.bind(null,t),!0)}calculateProfilesCount(t){const o=document.getElementsByClassName(t.containerName);let i=0;o.length>0&&(i=.9*(o.item(o.length-1)?.clientWidth||0)),i>0&&(t.postsForLimit=Math.floor((i-t.textSize-t.plusSize)/t.profileSize))}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();function cn(n,r){if(1&n&&e._UZ(0,"socialbee-social-profile",4),2&n){const t=e.oxw().$implicit,o=e.oxw();e.Tol(o.displayData.profileSpace?"ms-2":"ms-n1"),e.Q6J("profile",t)("profileOptions",o.profileOptions)}}function ln(n,r){if(1&n&&(e.ynx(0),e.YNc(1,cn,1,5,"socialbee-social-profile",3),e.BQk()),2&n){const t=r.index,o=e.oxw();e.xp6(1),e.Q6J("ngIf",t<o.displayData.postsForLimit)}}function dn(n,r){if(1&n&&(e.TgZ(0,"li",11)(1,"div",12),e._UZ(2,"socialbee-social-profile",4),e.TgZ(3,"h6",13),e._uU(4),e.qZA()()()),2&n){const t=r.$implicit,o=r.index,i=r.count,s=e.oxw(3);e.Tol(o===i?"":"mb-3"),e.xp6(2),e.Q6J("profile",t)("profileOptions",s.profileOptions),e.xp6(2),e.Oqu(t.fullName)}}function pn(n,r){if(1&n&&(e.TgZ(0,"ul",9),e.YNc(1,dn,5,6,"li",10),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",null==t.socialAccounts?null:t.socialAccounts.slice(t.displayData.postsForLimit,null==t.socialAccounts?null:t.socialAccounts.length))}}function gn(n,r){if(1&n&&(e.TgZ(0,"div",5,6)(2,"label",7),e._uU(3),e.qZA(),e.YNc(4,pn,2,1,"ul",8),e.qZA()),2&n){const t=e.oxw();e.Gre("btn-group ",t.displayData.profileSpace?"ml-2":"ml-n1",""),e.Q6J("autoClose",!0),e.xp6(3),e.hij("+",((null==t.socialAccounts?null:t.socialAccounts.length)||0)-t.displayData.postsForLimit,"")}}const un=function(n){return{"social-icons-container":n}};let be=(()=>{class n{constructor(t){this.plusMoreElementCountService=t,this.socialAccounts=[],this.profileOptions=new A(x.SMALL,y.HORIZONTAL,!1,!1,!0,!0,!1,!0),this.displayData={containerName:"social-icons-container",profileSize:28,plusSize:28,textSize:0,postsForLimit:2,profileSpace:!1}}ngOnInit(){this.plusMoreElementCountService.initItemsOnResize(this.displayData)}ngAfterViewInit(){setTimeout(()=>{this.plusMoreElementCountService.calculateProfilesCount(this.displayData)})}static{this.\u0275fac=function(o){return new(o||n)(e.Y36(an))}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-social-account-lists"]],inputs:{socialAccounts:"socialAccounts",profileOptions:"profileOptions",justifyContent:"justifyContent",displayData:"displayData"},decls:3,vars:8,consts:[[3,"ngClass"],[4,"ngFor","ngForOf"],["dropdown","",3,"class","autoClose",4,"ngIf"],[3,"class","profile","profileOptions",4,"ngIf"],[3,"profile","profileOptions"],["dropdown","",3,"autoClose"],["dropdown","bs-dropdown"],["dropdownToggle","","aria-controls","dropdown-basic",1,"rounded-circle","background-color-more-account","label-font-size","m-0"],["id","dropdown-basic","class","dropdown-menu px-4 py-3","role","menu","aria-labelledby","button-basic",4,"dropdownMenu"],["id","dropdown-basic","role","menu","aria-labelledby","button-basic",1,"dropdown-menu","px-4","py-3"],["role","menuitem",3,"class",4,"ngFor","ngForOf"],["role","menuitem"],[1,"d-flex","flex-row","align-items-center"],[1,"font-weight-normal","label-font-size","mx-2","p-0","m-0","text-nowrap"]],template:function(o,i){1&o&&(e.TgZ(0,"div",0),e.YNc(1,ln,2,1,"ng-container",1),e.YNc(2,gn,5,5,"div",2),e.qZA()),2&o&&(e.Gre("d-flex flex-row w-100 align-items-center justify-content-",i.justifyContent," social-icons-container mb-1 me-1"),e.Q6J("ngClass",e.VKq(6,un,i.displayData.profileSpace)),e.xp6(1),e.Q6J("ngForOf",i.socialAccounts),e.xp6(1),e.Q6J("ngIf",((null==i.socialAccounts?null:i.socialAccounts.length)||0)>i.displayData.postsForLimit))},dependencies:[a.mk,a.sg,a.O5,F.Hz,F.Mq,F.TO,$],styles:[".social-icons-container[_ngcontent-%COMP%]{gap:8px}html[dir=ltr][_ngcontent-%COMP%] .ms-n1[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .ms-n1[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .ms-n1[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .ms-n1[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .ms-n1[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .ms-n1[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .ms-n1[_ngcontent-%COMP%]{margin-left:-.5rem!important}html[dir=rtl][_ngcontent-%COMP%] .ms-n1[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .ms-n1[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .ms-n1[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .ms-n1[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .ms-n1[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .ms-n1[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .ms-n1[_ngcontent-%COMP%]{margin-right:-.5rem!important}.background-color-more-account[_ngcontent-%COMP%]{background-color:var(--cp-sb-border-color);padding:3px 7px}.btn-group[_ngcontent-%COMP%] .dropdown-menu[_ngcontent-%COMP%]{background-color:var(--cp-sb-background-main-color)}"]})}}return n})();function hn(n){return!!n.link&&!Oe(n)}function fn(n){return!!n.text&&!Oe(n)&&!n.link}function _n(n){return Pe(n,"video/mp4","video/quicktime")}function mn(n){return Pe(n,"image/png","image/jpeg","image/jpg","image/webp","image/bmp","image/tiff","image/svg+xml")}function Cn(n){return Pe(n,"image/gif")}function Oe(n){return!!n.files&&n.files.length>0}function Pe(n,...r){return(Oe(n)&&n.files?.some(t=>t.type&&r.includes(t.type)))??!1}function vn(n,r){1&n&&e._UZ(0,"i",5)}function bn(n,r){1&n&&e._UZ(0,"i",6)}function On(n,r){1&n&&e._UZ(0,"i",7)}function Pn(n,r){1&n&&e._UZ(0,"i",8)}function Mn(n,r){1&n&&e._UZ(0,"i",9)}let qe=(()=>{class n{constructor(){this.isLink=hn,this.isText=fn,this.hasImage=mn,this.hasGif=Cn,this.hasVideo=_n}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-post-type-icons"]],inputs:{variant:"variant"},decls:5,vars:5,consts:[["class","fa-kit fa-editor-link mr-1",4,"ngIf"],["class","fa-kit fa-post-text-svg mr-1",4,"ngIf"],["class","fa-kit fa-editor-image mr-1",4,"ngIf"],["class","fa-kit fa-editor-gif mr-1",4,"ngIf"],["class","fa-kit fa-editor-video mr-1",4,"ngIf"],[1,"fa-kit","fa-editor-link","mr-1"],[1,"fa-kit","fa-post-text-svg","mr-1"],[1,"fa-kit","fa-editor-image","mr-1"],[1,"fa-kit","fa-editor-gif","mr-1"],[1,"fa-kit","fa-editor-video","mr-1"]],template:function(o,i){1&o&&(e.YNc(0,vn,1,0,"i",0),e.YNc(1,bn,1,0,"i",1),e.YNc(2,On,1,0,"i",2),e.YNc(3,Pn,1,0,"i",3),e.YNc(4,Mn,1,0,"i",4)),2&o&&(e.Q6J("ngIf",i.isLink(i.variant)),e.xp6(1),e.Q6J("ngIf",i.isText(i.variant)),e.xp6(1),e.Q6J("ngIf",i.hasImage(i.variant)),e.xp6(1),e.Q6J("ngIf",i.hasGif(i.variant)),e.xp6(1),e.Q6J("ngIf",i.hasVideo(i.variant)))},dependencies:[a.O5],styles:["i[_ngcontent-%COMP%]{width:1rem;height:1rem;font-size:1rem}"]})}}return n})();function Tn(n,r){1&n&&(e.TgZ(0,"div",2),e._uU(1," ST\n"),e.qZA()),2&n&&e.Q6J("tooltip","Specific time")}function xn(n,r){1&n&&(e.TgZ(0,"div",3),e._uU(1," Specific time\n"),e.qZA())}let Ye=(()=>{class n{constructor(){this.short=!1}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-specific-time-indicator"]],inputs:{short:"short"},decls:2,vars:2,consts:[["class","specific-label d-flex align-items-center justify-content-center short",3,"tooltip",4,"ngIf"],["class","specific-label px-1 text-truncate",4,"ngIf"],[1,"specific-label","d-flex","align-items-center","justify-content-center","short",3,"tooltip"],[1,"specific-label","px-1","text-truncate"]],template:function(o,i){1&o&&(e.YNc(0,Tn,2,1,"div",0),e.YNc(1,xn,2,0,"div",1)),2&o&&(e.Q6J("ngIf",i.short),e.xp6(1),e.Q6J("ngIf",!i.short))},dependencies:[a.O5],styles:[".specific-label[_ngcontent-%COMP%]{cursor:default;color:#fff;background-color:var(--cp-sb-avatar-background);border-radius:8px}.specific-label.short[_ngcontent-%COMP%]{font-size:.625rem;height:1rem;width:1rem}"]})}}return n})(),yn=(()=>{class n{constructor(t){this.el=t,this.categoryIndicatorBackground=""}ngOnInit(){this.setBackground()}setBackground(){const t=this.el.nativeElement;this.categoryIndicatorBackground?this.categoryIndicatorBackground.includes("gradient")?t.style.background=this.categoryIndicatorBackground:t.style.backgroundColor=this.categoryIndicatorBackground:t.style.background=""}static{this.\u0275fac=function(o){return new(o||n)(e.Y36(e.SBq))}}static{this.\u0275dir=e.lG2({type:n,selectors:[["","socialbeeCategoryIndicator",""]],inputs:{categoryIndicatorBackground:"categoryIndicatorBackground"}})}}return n})(),wn=(()=>{class n{constructor(){this.variant="round",this.size="",this.customClass=""}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-category-indicator"]],inputs:{color:"color",variant:"variant",size:"size",customClass:"customClass"},decls:1,vars:6,consts:[["socialbeeCategoryIndicator","",3,"categoryIndicatorBackground"]],template:function(o,i){1&o&&e._UZ(0,"div",0),2&o&&(e.IyS("indicator ",i.variant," ",i.size," ",i.customClass,""),e.Q6J("categoryIndicatorBackground",i.color))},dependencies:[yn],styles:[".indicator.round[_ngcontent-%COMP%]{width:.75rem;height:.75rem;border-radius:50%}.indicator.round.small[_ngcontent-%COMP%]{width:.625rem;height:.625rem}.indicator.pill[_ngcontent-%COMP%]{width:.375rem;height:1rem}html[dir=ltr][_ngcontent-%COMP%] .indicator.pill[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .indicator.pill[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .indicator.pill[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .indicator.pill[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .indicator.pill[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .indicator.pill[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .indicator.pill[_ngcontent-%COMP%]{border-top-right-radius:50px;border-bottom-right-radius:50px}html[dir=rtl][_ngcontent-%COMP%] .indicator.pill[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .indicator.pill[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .indicator.pill[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .indicator.pill[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .indicator.pill[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .indicator.pill[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .indicator.pill[_ngcontent-%COMP%]{border-top-left-radius:50px;border-bottom-left-radius:50px}"]})}}return n})();var Sn=l(7680),Me=l(4307),kn=l(9602),In=l(5421),An=l(2130);function Nn(n){return(0,In.Z)(new Date,new Date((new Date).setHours(n,0,0,0)))}function Be(n){return n.status===w.FAILED}function Un(n){return n.status===w.PUBLISHED}function Ln(n,r){return(0,An.Z)(new Date(n.getFullYear(),n.getMonth(),n.getDate(),r||n.getHours(),59))}function Qn(n){return n.postType===ee.SPECIFIC_TIME}function Rn(n){return n.postType===ee.RANDOM}let Ge=(()=>{class n{transform(t,o="var(--cp-sb-background-secondary-color)"){return Be(t)||!function Dn(n){return!!n.variants?.find(r=>r.selectedVariant)||n.variants?.length>0}(t.item)?"var(--cp-sb-error-background)":o}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275pipe=e.Yjl({name:"scheduleEntryStateColor",type:n,pure:!0,standalone:!0})}}return n})();function Jn(n,r){if(1&n&&(e.TgZ(0,"div",21)(1,"div",22),e._uU(2),e.ALo(3,"date"),e.qZA(),e.TgZ(4,"div",23),e._uU(5),e.ALo(6,"uppercase"),e.ALo(7,"date"),e.qZA()()),2&n){const t=e.oxw(2).$implicit,o=e.oxw(2);e.xp6(1),e.ekj("current-date",o.isToday(t)),e.xp6(1),e.hij(" ",e.xi3(3,4,t,"d")," "),e.xp6(3),e.hij(" ",e.lcZ(6,7,e.xi3(7,9,t,"MMM, EEE")||"")," ")}}function qn(n,r){1&n&&e._UZ(0,"div",24)}function Yn(n,r){1&n&&e._UZ(0,"i",26)}function Bn(n,r){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,Yn,1,0,"i",25),e.qZA()),2&n){const t=e.oxw().$implicit,o=e.oxw(3);e.xp6(1),e.Q6J("ngIf",o.isScheduleEntryFailed(t))}}function Gn(n,r){1&n&&e._UZ(0,"socialbee-specific-time-indicator",27),2&n&&e.Q6J("short",!0)}function Hn(n,r){if(1&n&&(e.ynx(0),e.TgZ(1,"div",28),e._UZ(2,"socialbee-social-account-lists",29),e.qZA(),e.TgZ(3,"div",30),e._UZ(4,"socialbee-post-type-icons",31),e.qZA(),e.TgZ(5,"div",32),e._uU(6),e.qZA(),e.BQk()),2&n){const t=r.ngIf,o=e.oxw().$implicit;e.xp6(2),e.Q6J("justifyContent","start")("socialAccounts",null==o||null==o.item?null:o.item.accounts),e.xp6(2),e.Q6J("variant",t),e.xp6(2),e.Oqu(t.text)}}function Vn(n,r){1&n&&(e._UZ(0,"div",28)(1,"div",30),e.TgZ(2,"div",33),e._UZ(3,"i",34),e._uU(4," No post found "),e.qZA())}const Kn=function(n){return{"border-top pt-2":n}},jn=function(n){return{"background-color":n}};function Wn(n,r){if(1&n&&(e.TgZ(0,"div",11),e.ALo(1,"scheduleEntryStateColor"),e.YNc(2,Jn,8,12,"div",12),e.YNc(3,qn,1,0,"div",13),e.TgZ(4,"div",14),e.YNc(5,Bn,2,1,"div",15),e.YNc(6,Gn,1,1,"socialbee-specific-time-indicator",16),e._uU(7),e.ALo(8,"date"),e.qZA(),e.TgZ(9,"div",17),e._UZ(10,"socialbee-category-indicator",18),e.TgZ(11,"div",19),e._uU(12),e.qZA()(),e.YNc(13,Hn,7,4,"ng-container",7),e.YNc(14,Vn,5,0,"ng-template",null,20,e.W1O),e.qZA()),2&n){const t=r.$implicit,o=r.first,i=e.MAs(15),s=e.oxw(3);e.Q6J("ngClass",e.VKq(16,Kn,o))("ngStyle",e.VKq(18,jn,e.lcZ(1,11,t))),e.xp6(2),e.Q6J("ngIf",o),e.xp6(1),e.Q6J("ngIf",!o),e.xp6(2),e.Q6J("ngIf",s.isScheduleEntryFailed(t)),e.xp6(1),e.Q6J("ngIf",s.isSpecificTime(t)),e.xp6(1),e.hij(" ",e.xi3(8,13,t.item.scheduleDate,"HH:mm")," "),e.xp6(3),e.Q6J("color",s.isRandom(t)?s.DEFAULT_GRADIENT:null==t.item.category?null:t.item.category.color),e.xp6(2),e.Oqu(s.isRandom(t)?"Random Category":null==t.item.category?null:t.item.category.name),e.xp6(1),e.Q6J("ngIf",s.getSelectedVariant(t.item))("ngIfElse",i)}}function zn(n,r){if(1&n&&(e.ynx(0),e.YNc(1,Wn,16,20,"div",10),e.BQk()),2&n){const t=r.$implicit,o=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",o.getPostsForDay(t))}}function $n(n,r){if(1&n&&(e.ynx(0),e.YNc(1,zn,2,1,"ng-container",9),e.BQk()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngForOf",t.days)}}function Xn(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",35),e._UZ(1,"img",36),e.TgZ(2,"div",37),e._uU(3,"No posts are scheduled yet"),e.qZA(),e.TgZ(4,"div",38),e._uU(5,"Open SocialBee to start creating and scheduling posts for this social account."),e.qZA(),e.TgZ(6,"button",39),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.openSocialBeeApp())}),e.TgZ(7,"span",40),e._uU(8,"Schedule posts"),e.qZA(),e._UZ(9,"i",41),e.qZA()()}}let eo=(()=>{class n{constructor(){this.selectedSocialProfile=null,this.scheduledEntriesMap=new Map,this.days=[],this.destroy$=new X.x,this.DEFAULT_GRADIENT="linear-gradient(119deg, #D3FF44 14.03%, #46D7FF 32.28%, #F0A 54.59%, #FF393F 72.44%, #FC0 88.26%)",this.isToday=Je.Z,this.customDisplayData={containerName:"social-icons-container",profileSize:28,plusSize:28,textSize:0,postsForLimit:2,profileSpace:!0},this.customProfileOptions=new A(x.SMALL,y.HORIZONTAL,!1,!1,!0,!0,!1,!0)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}hasScheduledTimeslots(){return Array.from(this.scheduledEntriesMap.values()).some(t=>t.length>0)}getPostsForDay(t){const o=(0,N.Z)(new Date(t),"yyyy-MM-dd");return this.scheduledEntriesMap.get(o)||[]}getSelectedVariant(t){return t.variants?.find(o=>o.selectedVariant)}isScheduleEntryFailed(t){return t.status===w.FAILED}isSpecificTime(t){return t.postType===ee.SPECIFIC_TIME}isRandom(t){return t.postType===ee.RANDOM}openSocialBeeApp(){window.open(`${u.SOCIALBEE_APP_URL}/scheduler`,"_blank")}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-list-view"]],inputs:{selectedSocialProfile:"selectedSocialProfile",scheduledEntriesMap:"scheduledEntriesMap",days:"days"},decls:21,vars:2,consts:[[1,"list-view-wrapper","d-flex","flex-column","border-bottom"],[1,"d-flex","flex-column","border-top"],[1,"list-view-title","px-3"],[1,"p-2","fw-semibold"],[1,"list-view-header","sticky-top","px-3"],[1,"header-cell","p-2"],[1,"header-cell","p-2","text-end"],[4,"ngIf","ngIfElse"],["noEntriesMessage",""],[4,"ngFor","ngForOf"],["class","event-row pb-2 px-3 align-items-center",3,"ngClass","ngStyle",4,"ngFor","ngForOf"],[1,"event-row","pb-2","px-3","align-items-center",3,"ngClass","ngStyle"],["class","event-cell event-date p-2 d-flex align-items-center",4,"ngIf"],["class","event-cell event-date p-2",4,"ngIf"],[1,"event-cell","event-time","p-2","d-flex","justify-content-end","align-items-center"],[4,"ngIf"],["class","me-1",3,"short",4,"ngIf"],[1,"event-cell","event-category","p-2","font-weight-bold","d-flex","flex-nowrap","align-items-center","text-truncate"],["customClass","me-2",3,"color"],[1,"category-name"],["noPostsTemplate",""],[1,"event-cell","event-date","p-2","d-flex","align-items-center"],[1,"date-circle","me-2","d-flex","align-items-center","justify-content-center","border"],[1,"date-text","font-weight-bold"],[1,"event-cell","event-date","p-2"],["class","fa-kit fa-failed me-1",4,"ngIf"],[1,"fa-kit","fa-failed","me-1"],[1,"me-1",3,"short"],[1,"event-cell","event-social-accounts","p-2"],[1,"me-2","d-flex","align-items-center",3,"justifyContent","socialAccounts"],[1,"event-cell","event-post-type","p-2"],[1,"d-flex","justify-content-start","align-items-center",3,"variant"],[1,"event-cell","event-content","p-2"],[1,"event-cell","event-content","p-2","d-flex","align-items-center"],[1,"fas","fa-exclamation-triangle","text-danger","pe-1"],[1,"d-flex","flex-column","justify-content-center","align-items-center","my-5"],["src","assets/images/dashboard/bee_box.png","alt","No posts scheduled",1,"image-card"],[1,"fw-bold","text-center","my-2"],[1,"text-center","mb-3"],["type","button",1,"d-flex","align-items-baseline","btn","btn-primary-socialbee",3,"click"],[1,"m-0"],[1,"fa","fa-external-link-alt","ms-2"]],template:function(o,i){if(1&o&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e._uU(4,"Posts for the next week"),e.qZA()(),e.TgZ(5,"div",4)(6,"div",5),e._uU(7,"Date"),e.qZA(),e.TgZ(8,"div",6),e._uU(9,"Time"),e.qZA(),e.TgZ(10,"div",5),e._uU(11,"Category"),e.qZA(),e.TgZ(12,"div",5),e._uU(13,"Social accounts"),e.qZA(),e.TgZ(14,"div",5),e._uU(15,"Post type"),e.qZA(),e.TgZ(16,"div",5),e._uU(17,"Content"),e.qZA()(),e.YNc(18,$n,2,1,"ng-container",7),e.YNc(19,Xn,10,0,"ng-template",null,8,e.W1O),e.qZA()()),2&o){const s=e.MAs(20);e.xp6(18),e.Q6J("ngIf",i.hasScheduledTimeslots())("ngIfElse",s)}},dependencies:[a.mk,a.sg,a.O5,a.PC,be,qe,Ye,wn,a.gd,a.uU,Ge],styles:[".list-view-wrapper[_ngcontent-%COMP%]{min-height:0}.list-view-wrapper[_ngcontent-%COMP%] .list-view-header[_ngcontent-%COMP%], .list-view-wrapper[_ngcontent-%COMP%] .event-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:7.5rem 4.5rem 12rem 9.625rem 5rem minmax(4.25rem,1fr);gap:2.25rem}.list-view-wrapper[_ngcontent-%COMP%] .list-view-title[_ngcontent-%COMP%]{font-size:.875rem;background:#F5F5F5}.list-view-wrapper[_ngcontent-%COMP%] .list-view-title[_ngcontent-%COMP%], .list-view-wrapper[_ngcontent-%COMP%] .list-view-header[_ngcontent-%COMP%]{background:#F5F5F5;z-index:1}.list-view-wrapper[_ngcontent-%COMP%] .header-cell[_ngcontent-%COMP%], .list-view-wrapper[_ngcontent-%COMP%] .event-cell[_ngcontent-%COMP%]:not(.event-social-accounts){overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.75rem}.list-view-wrapper[_ngcontent-%COMP%] .category-name[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.list-view-wrapper[_ngcontent-%COMP%] .date-circle[_ngcontent-%COMP%]{width:1.875rem;height:1.875rem;border-radius:50%;background-color:#fff}.list-view-wrapper[_ngcontent-%COMP%] .date-circle.current-date[_ngcontent-%COMP%]{background-color:#43495c;color:#fff}.list-view-wrapper[_ngcontent-%COMP%] .action-button[_ngcontent-%COMP%]{background:none;cursor:pointer;line-height:1;font-size:1.185rem}.list-view-wrapper[_ngcontent-%COMP%] .color-dot[_ngcontent-%COMP%]{width:.75rem;height:.75rem;border-radius:50%;flex-shrink:0}.list-view-wrapper[_ngcontent-%COMP%] .fa-failed[_ngcontent-%COMP%]{color:var(--cp-sb-error-icon)}"]})}}return n})(),to=(()=>{class n{constructor(t){this.http=t,this.resourceUrl="/cpanel/socials"}updateScheduleRunning(t,o){return this.http.post(_+`${this.resourceUrl}/update-schedule-running?scheduleRunning=${o}`,null,{headers:new b.WM({"Content-Type":"application/x-www-form-urlencoded",SocialAccountId:t})})}static{this.\u0275fac=function(o){return new(o||n)(e.LFG(b.eN))}}static{this.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();function no(n,r){if(1&n&&e._UZ(0,"i",11),2&n){e.oxw();const t=e.MAs(13);e.Q6J("popover",t)}}function oo(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"button",12),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.openSocialBeeApp())}),e._UZ(1,"i",13),e._uU(2," Create post "),e.qZA()}}function io(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"button",14),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.openSocialBeeApp())}),e._uU(1," Reconnect "),e._UZ(2,"i",15),e.qZA()}}function ro(n,r){1&n&&(e.TgZ(0,"div",16),e._UZ(1,"i",17),e.TgZ(2,"p",18),e._uU(3,"Please reconnect your account."),e.qZA()())}const so=function(n){return{"social-profile-needs-reconnect":n}};let ao=(()=>{class n{constructor(t,o){this.socialAccountService=t,this.toastService=o,this.scheduleRunning=!1,this.profileOptions=new A(x.MEDIUM,y.HORIZONTAL,!1,!1,!1,!1,!0,!0)}ngOnInit(){this.scheduleRunning="true"===this.profile.accountProperties.scheduleRunning}updateScheduleRunning(){this.socialAccountService.updateScheduleRunning(this.profile.id,!this.scheduleRunning).subscribe(()=>{this.scheduleRunning=!this.scheduleRunning,this.profile.accountProperties.scheduleRunning=this.scheduleRunning.toString()},()=>{this.toastService.show("Something went wrong.","danger",!0,5e3)})}openSocialBeeApp(){window.open(u.SOCIALBEE_APP_URL,"_blank")}static{this.\u0275fac=function(o){return new(o||n)(e.Y36(to),e.Y36(G))}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-social-media-account-toggle"]],inputs:{profile:"profile",user:"user"},decls:14,vars:13,consts:[[1,"account-toggle","card","small-text","p-3",3,"ngClass"],[1,"d-flex","align-items-start","justify-content-between"],[1,"fit-name",3,"profile","profileOptions"],[1,"form-check","form-switch","d-flex","flex-row-reverse","align-items-center","p-0"],["type","checkbox",1,"form-check-input","ms-1",3,"id","checked","disabled","change"],[1,"form-check-label",3,"for"],[1,"d-flex","align-items-end","justify-content-between","mt-2"],["class","fa fa-exclamation-triangle ml-1 text-danger","containerClass","dashboard-reconnect-popover","placement","bottom left","triggers","mouseenter:mouseleave",3,"popover",4,"ngIf"],["class","btn small-text btn-default rounded-pill font-weight-bold border",3,"click",4,"ngIf"],["class","btn small-text rounded-pill font-weight-bold border btn-danger",3,"click",4,"ngIf"],["reconnectPopover",""],["containerClass","dashboard-reconnect-popover","placement","bottom left","triggers","mouseenter:mouseleave",1,"fa","fa-exclamation-triangle","ml-1","text-danger",3,"popover"],[1,"btn","small-text","btn-default","rounded-pill","font-weight-bold","border",3,"click"],[1,"fa","fa-plus","font-weight-light"],[1,"btn","small-text","rounded-pill","font-weight-bold","border","btn-danger",3,"click"],[1,"far","fa-external-link","ms-1"],[1,"d-flex","align-items-center"],[1,"fa","fa-exclamation-triangle","fa-lg","text-danger"],[1,"m-0","ms-2"]],template:function(o,i){1&o&&(e.TgZ(0,"div",0)(1,"div",1),e._UZ(2,"socialbee-social-profile",2),e.TgZ(3,"div",3)(4,"input",4),e.NdJ("change",function(){return i.updateScheduleRunning()}),e.qZA(),e.TgZ(5,"label",5),e._uU(6),e.qZA()()(),e.TgZ(7,"div",6)(8,"div"),e.YNc(9,no,1,1,"i",7),e.qZA(),e.YNc(10,oo,3,0,"button",8),e.YNc(11,io,3,0,"button",9),e.qZA()(),e.YNc(12,ro,4,0,"ng-template",null,10,e.W1O)),2&o&&(e.Q6J("ngClass",e.VKq(11,so,i.profile.shouldReauthenticate)),e.xp6(2),e.Q6J("profile",i.profile)("profileOptions",i.profileOptions),e.xp6(2),e.Q6J("id","scheduleSwitch_"+i.profile.id)("checked",i.scheduleRunning)("disabled",i.profile.shouldReauthenticate),e.xp6(1),e.Q6J("for","scheduleSwitch_"+i.profile.id),e.xp6(1),e.Oqu(i.scheduleRunning?"Running":"Paused"),e.xp6(3),e.Q6J("ngIf",i.profile.shouldReauthenticate),e.xp6(1),e.Q6J("ngIf",!i.profile.shouldReauthenticate),e.xp6(1),e.Q6J("ngIf",i.profile.shouldReauthenticate))},dependencies:[a.mk,a.O5,$,H.k5],styles:[".account-toggle[_ngcontent-%COMP%] .form-switch[_ngcontent-%COMP%] .form-check-input[_ngcontent-%COMP%]{width:2.25rem;height:1.25rem;box-shadow:none;background-color:#4a4a4a;border-color:#4a4a4a;background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e\")}.account-toggle[_ngcontent-%COMP%] .form-switch[_ngcontent-%COMP%] .form-check-input[_ngcontent-%COMP%]:checked{background-color:#28a745;border-color:#28a745;background-size:1.25rem 1.25rem}.account-toggle.social-profile-needs-reconnect[_ngcontent-%COMP%]{background:#FFF5F5!important}.account-toggle.social-profile-needs-reconnect[_ngcontent-%COMP%] .form-switch[_ngcontent-%COMP%] .form-check-input[_ngcontent-%COMP%]{background-color:red;border-color:red}"]})}}return n})(),co=(()=>{class n{constructor(){this.profileOptions=new A(x.MEDIUM,y.HORIZONTAL,!1,!1,!1,!1,!1,!0)}openSocialBeeApp(){window.open(`${u.SOCIALBEE_APP_URL}/workspaces/social-accounts`,"_blank")}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-social-media-account-suggest"]],inputs:{profile:"profile"},decls:6,vars:2,consts:[[1,"account-connect","card","small-text","p-3"],[1,"d-flex","align-items-center","justify-content-between"],[1,"fit-name",3,"profile","profileOptions"],[1,"btn","small-text","btn-default","rounded-pill","font-weight-bold","border",3,"click"],[1,"far","fa-external-link","ms-1"]],template:function(o,i){1&o&&(e.TgZ(0,"div",0)(1,"div",1),e._UZ(2,"socialbee-social-profile",2),e.TgZ(3,"button",3),e.NdJ("click",function(){return i.openSocialBeeApp()}),e._uU(4," Connect "),e._UZ(5,"i",4),e.qZA()()()),2&o&&(e.xp6(2),e.Q6J("profile",i.profile)("profileOptions",i.profileOptions))},dependencies:[$]})}}return n})();function lo(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",22)(1,"div",23)(2,"strong"),e._uU(3),e.qZA(),e.TgZ(4,"button",24),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.openSocialBeeAppPricing())}),e.TgZ(5,"span"),e._uU(6),e.qZA()()()()}if(2&n){const t=e.oxw();e.xp6(3),e.Oqu(t.licenceBannerText),e.xp6(3),e.Oqu(t.licenceBannerButtonText)}}function po(n,r){if(1&n&&(e.TgZ(0,"div",32),e._UZ(1,"socialbee-social-media-account-suggest",33),e.qZA()),2&n){const t=r.$implicit;e.xp6(1),e.Q6J("profile",t)}}function go(n,r){if(1&n&&(e.TgZ(0,"div",9)(1,"div",25)(2,"div",26)(3,"div",27)(4,"h5",28),e._uU(5,"Suggested accounts to connect"),e.qZA(),e._UZ(6,"i",29),e.qZA(),e.TgZ(7,"div",30),e.YNc(8,po,2,1,"div",31),e.qZA()()()()),2&n){const t=e.oxw();e.xp6(6),e.Q6J("popover","Suggested accounts need to be connected in SocialBee"),e.xp6(2),e.Q6J("ngForOf",t.suggestedSocialProfiles)}}function uo(n,r){if(1&n&&(e.TgZ(0,"div",35),e._UZ(1,"socialbee-social-media-account-toggle",33),e.qZA()),2&n){const t=r.$implicit;e.xp6(1),e.Q6J("profile",t)}}function ho(n,r){if(1&n&&(e.TgZ(0,"div",9)(1,"div",25)(2,"div",26)(3,"h5",28),e._uU(4,"Connected Social Media Accounts"),e.qZA(),e.TgZ(5,"div",30),e.YNc(6,uo,2,1,"div",34),e.qZA()()()()),2&n){const t=e.oxw();e.xp6(6),e.Q6J("ngForOf",t.socialProfiles)}}function fo(n,r){if(1&n&&(e.TgZ(0,"div"),e._UZ(1,"i",36),e._uU(2," Social inbox "),e.TgZ(3,"b"),e._uU(4),e.qZA()()),2&n){const t=e.oxw();e.xp6(4),e.Oqu((null==t.socialAccountStats?null:t.socialAccountStats.socialInbox)||0)}}function _o(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",26)(1,"socialbee-social-profile-dropdown",37),e.NdJ("profileSelected",function(i){e.CHM(t);const s=e.oxw();return e.KtG(s.getDashboardData(i))}),e.qZA()()}if(2&n){const t=e.oxw();e.xp6(1),e.Q6J("socialProfiles",t.socialProfiles)}}const mo=function(n){return{"mt-4":n}};let Co=(()=>{class n{constructor(t,o,i,s){this.coreService=t,this.dashboardService=o,this.modalService=i,this.analyticsService=s,this.user=new Ue,this.days=[],this.scheduledEntriesMap=new Map,this.socialProfiles=[],this.suggestedSocialProfiles=[],this.currentSelectedProfile=null,this.socialAccountStats=me,this.showSocialInbox=!1,this.currentDate=new Date,this.showLicenceBanner=!1,this.networksWithEngage=["instagram-business","facebook-page","linkedin-page","google-page","twitter-profile","youtube-channel","threads-profile"]}ngOnInit(){this.analyticsService.trackEvent("Loaded Dashboard"),this.coreService.identity().pipe((0,de.h)(t=>!!t),(0,le.U)(t=>{this.checkLicenceStatus(t);const{socialProfiles:o,suggestedSocialProfiles:i}=(t.socialAccounts||[]).reduce((s,c)=>("CRAWLED_ACCOUNT"===c.providerUserId?s.suggestedSocialProfiles.push(c):s.socialProfiles.push(c),s),{socialProfiles:[],suggestedSocialProfiles:[]});return{socialProfiles:o,suggestedSocialProfiles:i}}),(0,Ee.b)(({socialProfiles:t,suggestedSocialProfiles:o})=>{this.socialProfiles=t,this.suggestedSocialProfiles=o,this.socialProfiles.length&&this.getDashboardData(this.socialProfiles[0])})).subscribe()}getDashboardData(t){this.currentSelectedProfile=t,this.currentSelectedProfile?(this.setShowSocialInbox(),this.getTodayInYourSocialData(),this.getSchedule()):(this.showSocialInbox=!1,this.socialAccountStats=me,this.scheduledEntriesMap=new Map)}openSocialBeeApp(){window.open(u.SOCIALBEE_APP_URL,"_blank")}openSocialBeeAppPricing(){window.open(u.SOCIALBEE_APP_URL+"/settings/pricing","_blank")}openLicenceExpiredModal(t){this.modalService.show(Mt,{initialState:{imageUrl:"assets/images/dashboard/alert.svg",imageAlt:"Trial Expired",title:t,message:"Open SocialBee to purchase a plan and keep your hive buzzing by consistently creating and posting content.",confirmButtonText:"Open SocialBee",buttonIcon:"far fa-external-link ms-1"}}).content.result.subscribe(s=>{s&&this.openSocialBeeAppPricing()})}getTodayInYourSocialData(){this.dashboardService.getSocialAccountStatsForToday(this.currentSelectedProfile.id).subscribe(t=>{this.socialAccountStats=t||me})}getSchedule(){this.days=this.getConsecutiveDays(),this.dashboardService.getContentPreview(this.currentSelectedProfile.id,this.days[0],this.days[6],pe.DAY).subscribe(t=>{this.scheduledEntriesMap=new Map(Object.entries(t.groups))})}getConsecutiveDays(){const t=new Date;return Array.from({length:7},(o,i)=>(0,U.Z)(t,i))}setShowSocialInbox(){let t="";if(this.currentSelectedProfile){const o=function mt(n){const r=Object.keys(d),o=Object.values(d).indexOf(n);return-1!==o?r[o]:null}(this.currentSelectedProfile.providerId);if(o){const i=function Ct(n,r){return`${n}_${r.toUpperCase()}`}(o,this.currentSelectedProfile.accountProperties.type);t=Re[i]||""}}this.showSocialInbox=this.networksWithEngage.includes(t)}checkLicenceStatus(t){switch(t.userPreferences.subscriptionStatus){case"EXPIRED":this.licenceBannerText="Your trial license on SocialBee has expired.",this.licenceBannerButtonText="Upgrade now",this.showLicenceBanner=!0,this.openLicenceExpiredModal("Your trial license has expired!");break;case"CANCELED":this.licenceBannerText="Your license on SocialBee has expired.",this.licenceBannerButtonText="Upgrade now",this.openLicenceExpiredModal("Your license has expired!"),this.showLicenceBanner=!0;break;default:this.showLicenceBanner=!1}}static{this.\u0275fac=function(o){return new(o||n)(e.Y36(Z),e.Y36(_t),e.Y36(z.tT),e.Y36(D))}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-dashboard"]],decls:46,vars:18,consts:[["class","sticky-banner position-fixed top-0 start-0 end-0 py-1",4,"ngIf"],[1,"d-flex","flex-column","px-4","py-3","h-100",3,"ngClass"],[1,"row","align-items-center"],[1,"col-md-9"],[1,"m-0"],[1,"col-md-3","d-flex","align-items-end","justify-content-end"],[1,"btn","btn-primary-socialbee","py-2",3,"click"],[1,"far","fa-external-link","ms-1"],["class","row",4,"ngIf"],[1,"row"],[1,"col-md-12","my-3"],[1,"card","p-0"],[1,"card-body","p-0"],[1,"d-flex","justify-content-between","px-4","pt-4","pb-3"],[1,"d-flex","flex-column","flex-shrink-0"],[1,"dashboard-stats","d-flex","column-gap-5"],[1,"far","fa-clock","ms-1"],[1,"far","fa-check-circle"],[1,"far","fa-ban","fa-flip-horizontal"],[4,"ngIf"],["class","d-flex flex-column",4,"ngIf"],[3,"scheduledEntriesMap","days"],[1,"sticky-banner","position-fixed","top-0","start-0","end-0","py-1"],[1,"container-fluid","text-center"],[1,"btn","upgrade-now-button","border-0","py-1","ms-2",3,"click"],[1,"col-md-12","container","mt-3"],[1,"d-flex","flex-column"],[1,"d-flex","align-items-baseline"],[1,"fw-bold"],["containerClass","suggested-accounts-popover","placement","bottom","triggers","mouseenter:mouseleave",1,"fa","fa-info-circle","ms-2",3,"popover"],[1,"d-flex","flex-wrap","gap-2"],["class","account-card flex-shrink-0",4,"ngFor","ngForOf"],[1,"account-card","flex-shrink-0"],[3,"profile"],["class","account-card",4,"ngFor","ngForOf"],[1,"account-card"],[1,"far","fa-inbox"],[3,"socialProfiles","profileSelected"]],template:function(o,i){1&o&&(e.YNc(0,lo,7,2,"div",0),e.TgZ(1,"div",1)(2,"div",2)(3,"div",3)(4,"p",4),e._uU(5,"Keep your community engaged by sharing content regularly. Open SocialBee to plan your next post today!"),e.qZA()(),e.TgZ(6,"div",5)(7,"div")(8,"button",6),e.NdJ("click",function(){return i.openSocialBeeApp()}),e.TgZ(9,"span"),e._uU(10,"Open SocialBee"),e.qZA(),e._UZ(11,"i",7),e.qZA()()()(),e.YNc(12,go,9,2,"div",8),e.YNc(13,ho,7,1,"div",8),e.TgZ(14,"div",9)(15,"div",10)(16,"div",11)(17,"div",12)(18,"div",13)(19,"div",14)(20,"h3"),e._uU(21),e.ALo(22,"date"),e.qZA(),e.TgZ(23,"div",15)(24,"div"),e._UZ(25,"i",16),e._uU(26," Scheduled "),e.TgZ(27,"b"),e._uU(28),e.qZA()(),e.TgZ(29,"div"),e._UZ(30,"i",17),e._uU(31," Published "),e.TgZ(32,"b"),e._uU(33),e.qZA()(),e.TgZ(34,"div"),e._UZ(35,"i",18),e._uU(36," Failed "),e.TgZ(37,"b"),e._uU(38),e.qZA()(),e.TgZ(39,"div"),e._uU(40," Pending "),e.TgZ(41,"b"),e._uU(42),e.qZA()(),e.YNc(43,fo,5,1,"div",19),e.qZA()(),e.YNc(44,_o,2,1,"div",20),e.qZA(),e._UZ(45,"socialbee-list-view",21),e.qZA()()()()()),2&o&&(e.Q6J("ngIf",i.showLicenceBanner),e.xp6(1),e.Q6J("ngClass",e.VKq(16,mo,i.showLicenceBanner)),e.xp6(11),e.Q6J("ngIf",i.suggestedSocialProfiles.length>0),e.xp6(1),e.Q6J("ngIf",i.socialProfiles.length),e.xp6(8),e.hij("Today, ",e.xi3(22,13,i.currentDate,"d MMMM"),""),e.xp6(7),e.Oqu((null==i.socialAccountStats?null:i.socialAccountStats.scheduledPosts)||0),e.xp6(5),e.Oqu((null==i.socialAccountStats?null:i.socialAccountStats.publishedPosts)||0),e.xp6(5),e.Oqu((null==i.socialAccountStats?null:i.socialAccountStats.failedPosts)||0),e.xp6(4),e.Oqu((null==i.socialAccountStats?null:i.socialAccountStats.pendingPosts)||0),e.xp6(1),e.Q6J("ngIf",i.showSocialInbox),e.xp6(1),e.Q6J("ngIf",i.socialProfiles.length),e.xp6(1),e.Q6J("scheduledEntriesMap",i.scheduledEntriesMap)("days",i.days))},dependencies:[a.mk,a.sg,a.O5,sn,H.k5,eo,ao,co,a.uU],styles:[".sticky-banner[_ngcontent-%COMP%]{background-color:var(--cp-sb-background-primary-color);z-index:1000}.upgrade-now-button[_ngcontent-%COMP%]{color:var(--cp-sb-primary-text);background-color:var(--cp-sb-background-main-color);border-radius:32px;font-size:14px;font-weight:600;line-height:22px}.dashboard-stats[_ngcontent-%COMP%] .fa-clock[_ngcontent-%COMP%]{color:#f5c300}.dashboard-stats[_ngcontent-%COMP%] .fa-check-circle[_ngcontent-%COMP%]{color:#1dcc78}.dashboard-stats[_ngcontent-%COMP%] .fa-ban[_ngcontent-%COMP%]{color:#f44e43}.account-card[_ngcontent-%COMP%]{width:300px}"]})}}return n})();var h=l(6223);function vo(n,r){1&n&&(e.TgZ(0,"div",10),e._uU(1," Email is required "),e.qZA())}let bo=(()=>{class n{constructor(t){this.modalService=t,this.event=new e.vpe,this.dismissEvent=new e.vpe,this.email="",this.submitted=!1}ngOnInit(){}dismiss(){this.modalService.hide(),this.dismissEvent.emit()}accept(){this.submitted=!0,""!==this.email&&(this.event.emit(this.email),this.modalService.hide())}static{this.\u0275fac=function(o){return new(o||n)(e.Y36(z.tT))}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-email-modal"]],decls:16,vars:2,consts:[[1,"modal-index"],[1,"modal-header","d-flex","justify-content-end","border-bottom-0","p-3"],["type","button",1,"btn","m-0","p-0",3,"click"],[1,"modal-body","d-flex","flex-column","px-4","py-0","pb-1"],[1,"m-0"],["type","text","placeholder","Enter your email",1,"form-control","mt-3",3,"ngModel","ngModelChange"],["class","d-flex invalid-feedback",4,"ngIf"],[1,"modal-footer","d-flex","flex-row","justify-content-sm-between","border-top-0","px-4","py-2"],["aria-hidden","true","data-dismiss","modal","type","button",1,"btn","border","btn-cancel","m-0",3,"click"],[1,"btn","btn-primary-socialbee",3,"click"],[1,"d-flex","invalid-feedback"]],template:function(o,i){1&o&&(e.TgZ(0,"div",0)(1,"div",1)(2,"button",2),e.NdJ("click",function(){return i.dismiss()}),e._uU(3,"X"),e.qZA()(),e.TgZ(4,"div",3)(5,"h1",4),e._uU(6,"Enter your email address"),e.qZA(),e.TgZ(7,"span"),e._uU(8,"Enter your email address to receive your free social media strategy"),e.qZA(),e.TgZ(9,"input",5),e.NdJ("ngModelChange",function(c){return i.email=c}),e.qZA(),e.YNc(10,vo,2,0,"div",6),e.qZA(),e.TgZ(11,"div",7)(12,"button",8),e.NdJ("click",function(){return i.dismiss()}),e._uU(13,"Cancel "),e.qZA(),e.TgZ(14,"button",9),e.NdJ("click",function(){return i.accept()}),e._uU(15,"Submit"),e.qZA()()()),2&o&&(e.xp6(9),e.Q6J("ngModel",i.email),e.xp6(1),e.Q6J("ngIf",i.submitted&&""===i.email))},dependencies:[a.O5,h.Fj,h.JJ,h.On]})}}return n})(),V=(()=>{class n{constructor(){this.copilotStageChangeSubject=new he.t(1),this.sharedCopilotStageChangeSubject=this.copilotStageChangeSubject.asObservable(),this.useMockAiDataSubject=new he.t(1),this.sharedUseMockAiDataSubject=this.useMockAiDataSubject.asObservable()}nextCopilotStage(t){this.copilotStageChangeSubject.next(t)}nextUseMockAiData(t){this.useMockAiDataSubject.next(t)}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();function Oo(n,r){if(1&n&&(e.O4$(),e.kcU(),e.TgZ(0,"div",8),e._uU(1),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Oqu(t.loadingTitle)}}let te=(()=>{class n{constructor(t){this.spinnerService=t,this.imageSrc="",this.duration=5e3,this.spinnerName="progressSpinner",this.size="medium",this.progress=0,this.radius=70,this.maxProgress=90,this.circumference=2*Math.PI*this.radius,this.dashOffset=this.circumference,this.loadingStarted=!1}ngOnInit(){}startLoading(){this.resetProgress();const o=this.duration/30;let i=0;this.progressInterval=setInterval(()=>{this.progress<this.maxProgress?(i++,this.progress=Math.min(i/o*100,100),this.dashOffset=this.circumference-this.progress/100*this.circumference):clearInterval(this.progressInterval)},30)}ngOnChanges(t){t.showSpinner&&(this.showSpinner&&!this.loadingStarted?(this.loadingStarted=!0,requestAnimationFrame(()=>{this.startLoading()}),this.spinnerService.show(this.spinnerName)):(this.loadingStarted=!1,this.spinnerService.hide(this.spinnerName,1)))}resetProgress(){clearInterval(this.progressInterval),this.progress=0,this.dashOffset=this.circumference}static{this.\u0275fac=function(o){return new(o||n)(e.Y36(I.t2))}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-progress-spinner"]],inputs:{loadingTitle:"loadingTitle",showSpinner:"showSpinner",imageSrc:"imageSrc",duration:"duration",spinnerName:"spinnerName",size:"size"},features:[e.TTD],decls:8,vars:7,consts:[["type","none","size","small",3,"name"],[1,"d-flex","justify-content-center","align-items-center"],[3,"ngClass"],["viewBox","0 0 150 150","width","78","height","78",1,"progress-ring"],["cx","75","cy","75","r","70","stroke","#ccc","stroke-width","10","stroke-opacity","0.2","fill","transparent",1,"bg"],["cx","75","cy","75","r","70","stroke","#F5C300","stroke-width","10","fill","transparent","stroke-linecap","round",1,"fg"],["x","55","y","55","width","40","height","40","clip-path","circle(20px at center)"],["class","mt-3 mb-2 loading-spinner-text fw-normal d-flex justify-content-center align-items-center",4,"ngIf"],[1,"mt-3","mb-2","loading-spinner-text","fw-normal","d-flex","justify-content-center","align-items-center"]],template:function(o,i){1&o&&(e.TgZ(0,"ngx-spinner",0)(1,"div",1)(2,"div",2),e.O4$(),e.TgZ(3,"svg",3),e._UZ(4,"circle",4)(5,"circle",5)(6,"image",6),e.qZA()()(),e.YNc(7,Oo,2,1,"div",7),e.qZA()),2&o&&(e.Q6J("name",i.spinnerName),e.xp6(2),e.Q6J("ngClass","small"===i.size?"small-progress-spinner":"medium-progress-spinner"),e.xp6(3),e.uIk("stroke-dasharray",i.circumference)("stroke-dashoffset",i.dashOffset)("stroke",i.progress>0?"#F5C300":"transparent"),e.xp6(1),e.uIk("href",i.imageSrc),e.xp6(1),e.Q6J("ngIf",i.loadingTitle))},dependencies:[a.mk,a.O5,I.Ro],styles:[".loading-spinner-text[_ngcontent-%COMP%]{color:var(--cp-sb-background-main-color);font-size:1rem}.medium-progress-spinner[_ngcontent-%COMP%]{height:78px}.small-progress-spinner[_ngcontent-%COMP%]{height:60px}.progress-ring[_ngcontent-%COMP%]{width:100%;height:100%}html[dir=ltr][_ngcontent-%COMP%] .progress-ring[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .progress-ring[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .progress-ring[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .progress-ring[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .progress-ring[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .progress-ring[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .progress-ring[_ngcontent-%COMP%]{transform:rotate(-90deg)}html[dir=rtl][_ngcontent-%COMP%] .progress-ring[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .progress-ring[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .progress-ring[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .progress-ring[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .progress-ring[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .progress-ring[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .progress-ring[_ngcontent-%COMP%]{transform:rotate(90deg)}.fg[_ngcontent-%COMP%]{transition:stroke-dashoffset .3s linear}"]})}}return n})();function Po(n,r){if(1&n&&(e.TgZ(0,"span",7),e._uU(1),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Oqu(t.errorTitle)}}function Mo(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",8),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.closeLoading())}),e._uU(1),e.qZA()}if(2&n){const t=e.oxw();e.xp6(1),e.Oqu(t.errorButtonText)}}function To(n,r){if(1&n&&(e.TgZ(0,"span",9),e._uU(1),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Oqu(t.errorDescription)}}function xo(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",10),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.dismissError())}),e._uU(1,"Close"),e.qZA()}}let ge=(()=>{class n{constructor(t,o){this.spinnerService=t,this.analyticsService=o,this.allowDismiss=!1,this.closeLoadingEvent=new e.vpe,this.dismissErrorEvent=new e.vpe,this.spinnerName="errorSpinner"}ngOnInit(){this.errorTitle=this.errorTitle||"We\u2019re having trouble receiving data from the AI.",this.errorButtonText=this.errorButtonText||"Please try again!",this.errorDescription=this.errorDescription||"If the issue persists, reach out to our team at success@socialbee.com"}ngOnChanges(){this.showSpinner?(this.analyticsService.trackEvent("Error generated",{}),this.spinnerService.show(this.spinnerName)):this.spinnerService.hide(this.spinnerName)}closeLoading(){this.spinnerService.hide(this.spinnerName),this.closeLoadingEvent.emit(!1)}dismissError(){this.spinnerService.hide(this.spinnerName),this.dismissErrorEvent.emit(!1)}static{this.\u0275fac=function(o){return new(o||n)(e.Y36(I.t2),e.Y36(D))}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-loading-error"]],inputs:{showSpinner:"showSpinner",errorTitle:"errorTitle",errorButtonText:"errorButtonText",errorDescription:"errorDescription",allowDismiss:"allowDismiss"},outputs:{closeLoadingEvent:"closeLoadingEvent",dismissErrorEvent:"dismissErrorEvent"},features:[e.TTD],decls:7,vars:5,consts:[["type","none","size","small",3,"name"],[1,"d-flex","justify-content-center","align-items-center","flex-column"],["src","assets/images/loading/error.png","alt","Loading img",1,"image-card"],["class","mt-3 loading-error-text",4,"ngIf"],["class","mb-3 button-try-again",3,"click",4,"ngIf"],["class","loading-error-text",4,"ngIf"],["class","mt-3 button-try-again",3,"click",4,"ngIf"],[1,"mt-3","loading-error-text"],[1,"mb-3","button-try-again",3,"click"],[1,"loading-error-text"],[1,"mt-3","button-try-again",3,"click"]],template:function(o,i){1&o&&(e.TgZ(0,"ngx-spinner",0)(1,"div",1),e._UZ(2,"img",2),e.YNc(3,Po,2,1,"span",3),e.YNc(4,Mo,2,1,"span",4),e.YNc(5,To,2,1,"span",5),e.YNc(6,xo,2,0,"span",6),e.qZA()()),2&o&&(e.Q6J("name",i.spinnerName),e.xp6(3),e.Q6J("ngIf",i.errorTitle),e.xp6(1),e.Q6J("ngIf",i.errorButtonText),e.xp6(1),e.Q6J("ngIf",i.errorDescription),e.xp6(1),e.Q6J("ngIf",i.allowDismiss))},dependencies:[a.O5,I.Ro],styles:[".loading-error-text[_ngcontent-%COMP%]{color:var(--cp-sb-background-main-color)}.button-try-again[_ngcontent-%COMP%]{color:var(--cp-sb-avatar-background);cursor:pointer}.image-card[_ngcontent-%COMP%]{height:180px;width:200px}"]})}}return n})();function yo(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",24)(1,"label",25),e._uU(2,"Use mock data for AI"),e.qZA(),e.TgZ(3,"div",26)(4,"input",27),e.NdJ("ngModelChange",function(i){e.CHM(t);const s=e.oxw();return e.KtG(s.useMockAiData=i)})("change",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.changeAiMockData())}),e.qZA(),e._UZ(5,"label",28),e.qZA()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("ngModel",t.useMockAiData)}}function wo(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"input",32),e.NdJ("ngModelChange",function(i){e.CHM(t);const s=e.oxw(2);return e.KtG(s.searchText=i)})("input",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.filterWebsites())})("focus",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.onFocus())})("blur",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.onBlur())}),e.qZA()}if(2&n){const t=e.oxw(2);e.Q6J("ngModel",t.searchText)}}function So(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"input",32),e.NdJ("ngModelChange",function(i){e.CHM(t);const s=e.oxw(2);return e.KtG(s.websiteSelected=i)})("input",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.filterWebsites())})("focus",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.onFocus())})("blur",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.onBlur())}),e.qZA()}if(2&n){const t=e.oxw(2);e.Q6J("ngModel",t.websiteSelected)}}function ko(n,r){if(1&n&&(e.TgZ(0,"div",29),e._UZ(1,"i",30),e.YNc(2,wo,1,1,"input",31),e.YNc(3,So,1,1,"input",31),e.qZA()),2&n){const t=e.oxw();e.xp6(2),e.Q6J("ngIf",!t.websiteSelected),e.xp6(1),e.Q6J("ngIf",t.websiteSelected)}}function Io(n,r){1&n&&e._UZ(0,"i",37)}function Ao(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",35),e.NdJ("mousedown",function(){const s=e.CHM(t).$implicit,c=e.oxw(2);return e.KtG(c.selectWebsite(s))}),e._uU(1),e.YNc(2,Io,1,0,"i",36),e.qZA()}if(2&n){const t=r.$implicit,o=e.oxw(2);e.xp6(1),e.hij(" ",t," "),e.xp6(1),e.Q6J("ngIf",o.websiteSelected===t)}}function Eo(n,r){if(1&n&&(e.TgZ(0,"div",33),e.YNc(1,Ao,3,2,"div",34),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngForOf",t.websiteFiltered)}}function Zo(n,r){1&n&&e._UZ(0,"i",38)}let No=(()=>{class n{constructor(t,o,i,s,c,p,g,m,C,E){this.router=t,this.userService=o,this.client=i,this.toastService=s,this.modalService=c,this.alertService=p,this.coreService=g,this.analyticsService=m,this.copilotService=C,this.eventBusService=E,this.shareLink="https://socialbee.com/?utm_medium=in-app&utm_source=cpanel&utm_campaign=share-button",this.APP_URL_LOGIN=u.SOCIALBEE_APP_URL+"/sso/login/webpros?branding=socialbee&page=login",this.VALIDATION_ERROR_CODE=412,this.disableSelection=!1,this.isInputFocused=!1,this.isStandaloneEnvironment=u.standalone,this.showLoading=!1,this.loadingTitle="",this.userEmailAddress="",this.loading=!1,this.showErrorMessage=!1,this.useMockAiData=u.mockAIData}ngOnInit(){var t=this;return(0,Q.Z)(function*(){t.userEmailAddress=yield t.client.account.getContactEmail(),t.cPanelCompanyId=yield t.client.application.getCompanyId(),t.analyticsService.trackEvent("Loaded Intro Screen"),t.environment=u,t.websiteList=yield t.client.account.getDomains(),t.coreService.identity().subscribe(o=>{o&&o.website&&(t.disableSelection=!0,t.websiteSelected=o.website)}),t.eventBusService.sharedUseMockAiDataSubject.subscribe(o=>{t.copilotService.setCopilotMockAiData(o)}),t.filterWebsites()})()}filterWebsites(){const t=this.searchText||this.websiteSelected;this.websiteFiltered=t?this.websiteList.filter(o=>o.toLowerCase().includes(t.toLowerCase())):this.websiteList}selectWebsite(t){this.disableSelection||(this.websiteSelected=t,this.oldSearchText=this.searchText,this.searchText="",this.filterWebsites(),this.isInputFocused=!1,this.analyticsService.trackEvent("Domain Selection",{Select_Website:t,Num_Websites:this.websiteList.length}))}changeAiMockData(){this.eventBusService.nextUseMockAiData(this.useMockAiData)}letsGo(){this.websiteSelected&&this.websiteList.some(o=>o===this.websiteSelected)?((!this.websiteList.includes(this.searchText||this.websiteSelected)||this.oldSearchText)&&this.analyticsService.trackEvent("Manualled entered domain",{Num_Websites:this.websiteList.length}),this.analyticsService.trackEvent("Get Started Link"),u.standalone?this.modalService.show(bo).content.event.subscribe(i=>{this.userEmailAddress=i,this.createProspectUser()}):this.createProspectUser()):this.alertService.error("Please select a website to continue.")}createProspectUser(){this.loading=!0,(!this.userEmailAddress||0===this.userEmailAddress.length)&&this.generateRandomEmailAddress(),this.userService.createProspectUser(this.userEmailAddress,this.cPanelCompanyId).subscribe(t=>{this.processUserToken(t),this.loading=!1},t=>{this.loading=!1,t&&t.status===this.VALIDATION_ERROR_CODE?this.showErrorMessage=!0:this.alertService.error(t.error.message?t.error.message:"Error creating user, please try again later.")})}copyLink(){this.analyticsService.trackEvent("Copy Sharing Link"),navigator.clipboard?navigator.clipboard.writeText(this.shareLink).then(()=>{this.toastService.show("Website link copied to clipboard")}):this.copyToClipboardFallback(this.shareLink)}loadingErrorEvent(t){this.showErrorMessage=t,window.open(u.SOCIALBEE_APP_URL,"_blank")}dismissError(t){this.showErrorMessage=t,this.loading=!1,this.showLoading=!1}trackEvent(t){this.analyticsService.trackEvent(t,{})}copyToClipboardFallback(t){const o=document.createElement("textarea");o.value=t,o.style.position="fixed",o.style.opacity="0",document.body.appendChild(o),o.select();try{document.execCommand("copy"),this.toastService.show("Website link copied to clipboard")}catch{}document.body.removeChild(o)}processUserToken(t){this.coreService.saveUserToken(t).then(()=>{this.showLoading=!0,this.loadingTitle="Analyzing your website to gather key business insights\u2026",setTimeout(()=>{this.loadingTitle="Reviewing your content to discover what makes your business stand out\u2026"},1600),setTimeout(()=>{this.loadingTitle="Compiling your business details \u2014 almost there!"},3200),this.copilotService.createBusinessInfo(this.websiteSelected).subscribe(()=>{this.analyticsService.trackEvent("Domain Selected"),this.loading=!1,this.showLoading=!1,this.navigateToNextStep()},o=>{this.loading=!1,this.showLoading=!1,this.alertService.error("We couldn\u2019t fetch your website\u2019s data. You can still answer questions manually in the chat."),this.navigateToNextStep()})})}navigateToNextStep(){this.router.navigate(["/copilot/chat"])}generateRandomEmailAddress(){this.userEmailAddress=`user-${this.generateRandomAlphaNumericString(20)}@cpanel.com`}generateRandomAlphaNumericString(t){let i="";for(let s=0;s<t;s++)i+="abcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(36*Math.random()));return i}onBlur(){setTimeout(()=>{this.isInputFocused=!1},200)}onFocus(){this.isInputFocused=!0}static{this.\u0275fac=function(o){return new(o||n)(e.Y36(O.F0),e.Y36(ae),e.Y36(M.qr),e.Y36(G),e.Y36(z.tT),e.Y36(P),e.Y36(Z),e.Y36(D),e.Y36(k),e.Y36(V))}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-welcome"]],decls:44,vars:13,consts:[[3,"showSpinner","errorDescription","errorButtonText","allowDismiss","errorTitle","closeLoadingEvent","dismissErrorEvent"],[3,"showSpinner","loadingTitle"],[1,"d-flex","justify-content-end"],["class","d-flex justify-content-end align-items-center pe-5",4,"ngIf"],[1,"d-flex","flex-column","justify-content-center","align-items-center","container-welcome","align-text-center"],[1,"row","mb-2","mt-2"],["src","assets/images/welcome/socialbee-logo.svg","alt","SocialBee Logo",1,"logo"],[1,"row","mb-2"],["src","assets/images/welcome/variant2/image2.svg","alt",""],[1,"text-content","col-md-5"],["class","border search-input pe-3",4,"ngIf"],["class","website-dropdown border col-md-10",4,"ngIf"],[1,"row","mb-2","mt-1"],[1,"btn","btn-primary-socialbee",3,"disabled","click"],["class","fa fa-spin fa-spinner","aria-hidden","true",4,"ngIf"],[1,"row","mb-2","mt-4"],[1,"col-md-6"],[1,"panel-card","border","image-container-card-background-1","d-flex","flex-column","justify-content-center","p-3","h-100","w-100"],[1,"mb-2","label-content"],["target","_blank",1,"ms-2",3,"href","click"],[1,"panel-card","border","image-container-card-background-2","d-flex","flex-column","justify-content-center","p-3","h-100","w-100"],[1,"label-content"],["href","javascript:void(0)",1,"referral-link",3,"click"],[1,"fa","fa-clone","fa-light","ms-1","copy-link",3,"click"],[1,"d-flex","justify-content-end","align-items-center","pe-5"],[1,"p-0","m-0","me-2","font-weight-lighter"],[1,"toggle-switch","pull-right","align-self-start"],["id","SwitchOptionReQueue","name","SwitchOptionReQueue","type","checkbox",3,"ngModel","ngModelChange","change"],["for","SwitchOptionReQueue"],[1,"border","search-input","pe-3"],["aria-hidden","true",1,"search-icon","fa","fa-search","py-2","ps-3"],["class","col-md-10 border-0 py-2","placeholder","Search for your website",3,"ngModel","ngModelChange","input","focus","blur",4,"ngIf"],["placeholder","Search for your website",1,"col-md-10","border-0","py-2",3,"ngModel","ngModelChange","input","focus","blur"],[1,"website-dropdown","border","col-md-10"],["class","p-2 website-item",3,"mousedown",4,"ngFor","ngForOf"],[1,"p-2","website-item",3,"mousedown"],["class","fa fa-check ms-auto suggestion-check",4,"ngIf"],[1,"fa","fa-check","ms-auto","suggestion-check"],["aria-hidden","true",1,"fa","fa-spin","fa-spinner"]],template:function(o,i){1&o&&(e.TgZ(0,"socialbee-loading-error",0),e.NdJ("closeLoadingEvent",function(c){return i.loadingErrorEvent(c)})("dismissErrorEvent",function(c){return i.dismissError(c)}),e.qZA(),e._UZ(1,"socialbee-progress-spinner",1),e.TgZ(2,"div",2),e.YNc(3,yo,6,1,"div",3),e.qZA(),e.TgZ(4,"div",4)(5,"div",5),e._UZ(6,"img",6),e.qZA(),e.TgZ(7,"div",7),e._uU(8," Share content across all your social networks"),e._UZ(9,"br"),e._uU(10,"from a single platform! "),e.qZA(),e.TgZ(11,"div",7),e._UZ(12,"img",8),e.qZA(),e.TgZ(13,"div",7)(14,"h2"),e._uU(15,"Create a social media campaign for your"),e._UZ(16,"br"),e._uU(17,"profiles in just 5 minutes."),e.qZA()(),e.TgZ(18,"div",7),e._uU(19," Select a website to create the best social media strategy and posts for you. "),e.qZA(),e.TgZ(20,"div",9),e.YNc(21,ko,4,2,"div",10),e.YNc(22,Eo,2,1,"div",11),e.qZA(),e.TgZ(23,"div",12)(24,"button",13),e.NdJ("click",function(){return i.letsGo()}),e.YNc(25,Zo,1,0,"i",14),e._uU(26," Let\u2019s get started "),e.qZA()(),e.TgZ(27,"div",15)(28,"div",16)(29,"div",17)(30,"div",18),e._uU(31,"Already have an account with SocialBee?"),e.qZA(),e.TgZ(32,"a",19),e.NdJ("click",function(){return i.trackEvent("Existing Customer")}),e._uU(33,"Click here to log in"),e.qZA()()(),e.TgZ(34,"div",16)(35,"div",20)(36,"h3",21),e._uU(37,"Not in charge of Social Media?"),e.qZA(),e.TgZ(38,"span",21),e._uU(39,"Share this link with your marketing team!"),e.qZA(),e.TgZ(40,"div")(41,"a",22),e.NdJ("click",function(){return i.copyLink()}),e._uU(42,"socialbee.com"),e.qZA(),e.TgZ(43,"i",23),e.NdJ("click",function(){return i.copyLink()}),e.qZA()()()()()()),2&o&&(e.Q6J("showSpinner",i.showErrorMessage)("errorDescription","")("errorButtonText","Go to SocialBee")("allowDismiss",!0)("errorTitle","Oops! This email is already linked to an existing SocialBee account."),e.xp6(1),e.Q6J("showSpinner",i.showLoading)("loadingTitle",i.loadingTitle),e.xp6(2),e.Q6J("ngIf",i.isStandaloneEnvironment),e.xp6(18),e.Q6J("ngIf",!i.disableSelection),e.xp6(1),e.Q6J("ngIf",i.isInputFocused&&i.websiteFiltered.length>0),e.xp6(2),e.Q6J("disabled",i.loading),e.xp6(1),e.Q6J("ngIf",i.loading),e.xp6(7),e.Q6J("href",i.APP_URL_LOGIN,e.LSH))},dependencies:[a.sg,a.O5,te,ge,h.Fj,h.Wl,h.JJ,h.On],styles:[".container-welcome[_ngcontent-%COMP%]{overflow:auto}.elements[_ngcontent-%COMP%]{max-width:1300px}.border-radius[_ngcontent-%COMP%]{border-radius:8px}.panel-card[_ngcontent-%COMP%]{background-color:var(--cp-sb-background-main-color);border-radius:8px}.image-container[_ngcontent-%COMP%]{background-image:url(background.svg)}.copy-link[_ngcontent-%COMP%]{cursor:pointer}.wrapper-content[_ngcontent-%COMP%]{display:flex;width:100%;gap:2rem;align-items:center}.text-content[_ngcontent-%COMP%]{flex:1;position:relative}.label-content[_ngcontent-%COMP%]{font-family:Inter,sans-serif;color:#1f1f1f;white-space:nowrap}.video-content[_ngcontent-%COMP%]{flex:1;border-radius:12px;overflow:hidden;aspect-ratio:16/9;margin-bottom:auto}.login-text[_ngcontent-%COMP%]{margin-top:1rem}.referral-link[_ngcontent-%COMP%]{color:#2563eb;font-weight:600}.container-card-layer[_ngcontent-%COMP%]{background-image:url(layer1.svg);background-repeat:no-repeat;background-position:center;justify-self:center}.container-card-layer2[_ngcontent-%COMP%]{background-image:url(layer2.svg);background-repeat:no-repeat;justify-self:center}html[dir=ltr][_ngcontent-%COMP%] .container-card-layer2[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .container-card-layer2[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .container-card-layer2[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .container-card-layer2[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .container-card-layer2[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .container-card-layer2[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .container-card-layer2[_ngcontent-%COMP%]{background-position:right}html[dir=rtl][_ngcontent-%COMP%] .container-card-layer2[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .container-card-layer2[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .container-card-layer2[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .container-card-layer2[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .container-card-layer2[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .container-card-layer2[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .container-card-layer2[_ngcontent-%COMP%]{background-position:left}.search-input[_ngcontent-%COMP%]{background-color:var(--cp-sb-background-main-color);border-radius:32px;text-align:start}.search-icon[_ngcontent-%COMP%]{font-weight:100}.align-text-center[_ngcontent-%COMP%]{text-align:center}.image-container-card-background-1[_ngcontent-%COMP%]{background-image:url(image4.svg);background-repeat:no-repeat;background-size:cover;background-attachment:fixed}.image-container-card-background-2[_ngcontent-%COMP%]{background-image:url(image3.svg);background-repeat:no-repeat;background-size:cover;background-attachment:fixed;text-align:start!important}input[_ngcontent-%COMP%]:focus{outline:none;box-shadow:none;border-color:inherit}.website-dropdown[_ngcontent-%COMP%]{max-height:200px;overflow-y:auto;background-color:#fff;position:absolute;width:100%;border-radius:8px;box-shadow:0 4px 6px #0000001a;text-align:start}.website-item[_ngcontent-%COMP%]{padding:8px;cursor:pointer}.website-item[_ngcontent-%COMP%]:hover{background-color:#f0f0f0}.suggestion-check[_ngcontent-%COMP%]{position:relative;transform:translateY(25%)}html[dir=ltr][_ngcontent-%COMP%] .suggestion-check[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .suggestion-check[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .suggestion-check[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .suggestion-check[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .suggestion-check[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .suggestion-check[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .suggestion-check[_ngcontent-%COMP%]{float:right}html[dir=rtl][_ngcontent-%COMP%] .suggestion-check[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .suggestion-check[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .suggestion-check[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .suggestion-check[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .suggestion-check[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .suggestion-check[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .suggestion-check[_ngcontent-%COMP%]{float:left}"]})}}return n})();function Uo(n,r){1&n&&e._UZ(0,"span",14)}function Do(n,r){1&n&&e._UZ(0,"span",14)}function Fo(n,r){1&n&&e._UZ(0,"span",14)}function Lo(n,r){1&n&&e._UZ(0,"span",14)}function Qo(n,r){1&n&&e._UZ(0,"span",14)}function Ro(n,r){1&n&&e._UZ(0,"span",14)}const K=function(n){return{completed:n}};let Jo=(()=>{class n{constructor(t,o,i,s){this.coreService=t,this.client=o,this.alertService=i,this.analyticsService=s,this.COPILOT_STAGE=v,this.stage=v.POSTING_PLAN}ngOnInit(){var t=this;return(0,Q.Z)(function*(){t.analyticsService.trackEvent("Loaded Final Page"),t.coreService.identity().subscribe(o=>{t.user=o},()=>{t.alertService.error("Error fetching user data, please try again later.")}),t.cpanelEmailAddress=yield t.client.account.getContactEmail()})()}openSocialBeeApp(){this.analyticsService.trackEvent("Launch Social Bee App",{});const t=this.encodeToBase64(this.cpanelEmailAddress),o=this.encodeToBase64(this.user.emailAddress);window.open(`${u.SOCIALBEE_APP_URL}?${o===t?`cpe=${o}&cpea=${o}`:`cpe=${o}`}`,"_blank")}encodeToBase64(t){return btoa(t)}static{this.\u0275fac=function(o){return new(o||n)(e.Y36(Z),e.Y36(M.qr),e.Y36(P),e.Y36(D))}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-dashboard-partial"]],inputs:{stage:"stage"},decls:50,vars:24,consts:[[1,"d-flex","flex-row","flex-wrap","align-items-center","justify-content-center","h-100"],[1,"d-flex","flex-column","p-2","container-left"],[1,"title"],[1,"subtitle"],[1,"d-flex","flex-column"],[1,"p-2","stage"],[1,"me-1","rounded-circle","border","circle-stage",3,"ngClass"],["class","fa fa-check fa-sm",4,"ngIf"],[1,"description"],["type","button",1,"d-flex","align-items-baseline","btn","btn-primary-socialbee",3,"click"],[1,"m-0"],[1,"fa","fa-external-link-alt","ms-2"],[1,"p-2"],["src","assets/images/dashboard/home.png","alt","home"],[1,"fa","fa-check","fa-sm"]],template:function(o,i){1&o&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div")(3,"span",2),e._uU(4,"Good job!"),e.qZA(),e._UZ(5,"br"),e.TgZ(6,"span",3),e._uU(7,"You\u2019ve completed the first steps in setting up your social media strategy."),e.qZA()(),e.TgZ(8,"div")(9,"div",4)(10,"div",5)(11,"span",6),e.YNc(12,Uo,1,0,"span",7),e.qZA(),e.TgZ(13,"span"),e._uU(14,"Business info"),e.qZA()(),e.TgZ(15,"div",5)(16,"span",6),e.YNc(17,Do,1,0,"span",7),e.qZA(),e.TgZ(18,"span"),e._uU(19,"Suggested social networks"),e.qZA()(),e.TgZ(20,"div",5)(21,"span",6),e.YNc(22,Fo,1,0,"span",7),e.qZA(),e.TgZ(23,"span"),e._uU(24,"Generated posts"),e.qZA()(),e.TgZ(25,"div",5)(26,"span",6),e.YNc(27,Lo,1,0,"span",7),e.qZA(),e.TgZ(28,"span"),e._uU(29,"Posting plan"),e.qZA()(),e.TgZ(30,"div",5)(31,"span",6),e.YNc(32,Qo,1,0,"span",7),e.qZA(),e.TgZ(33,"span"),e._uU(34,"Connect profiles"),e.qZA()(),e.TgZ(35,"div",5)(36,"span",6),e.YNc(37,Ro,1,0,"span",7),e.qZA(),e.TgZ(38,"span"),e._uU(39,"Start Posting"),e.qZA()()()(),e.TgZ(40,"div")(41,"span",8),e._uU(42,"To unlock your posting plan, start a 14-day free SocialBee trial and connect your social profiles"),e.qZA()(),e.TgZ(43,"div")(44,"button",9),e.NdJ("click",function(){return i.openSocialBeeApp()}),e.TgZ(45,"span",10),e._uU(46,"Open SocialBee"),e.qZA(),e._UZ(47,"i",11),e.qZA()()(),e.TgZ(48,"div",12),e._UZ(49,"img",13),e.qZA()()),2&o&&(e.xp6(11),e.Q6J("ngClass",e.VKq(12,K,i.stage>=i.COPILOT_STAGE.BUSINESS_INFO)),e.xp6(1),e.Q6J("ngIf",i.stage>=i.COPILOT_STAGE.BUSINESS_INFO),e.xp6(4),e.Q6J("ngClass",e.VKq(14,K,i.stage>=i.COPILOT_STAGE.SUGGESTED_SOCIAL_NETWORKS)),e.xp6(1),e.Q6J("ngIf",i.stage>=i.COPILOT_STAGE.SUGGESTED_SOCIAL_NETWORKS),e.xp6(4),e.Q6J("ngClass",e.VKq(16,K,i.stage>=i.COPILOT_STAGE.GENERATED_POSTS)),e.xp6(1),e.Q6J("ngIf",i.stage>=i.COPILOT_STAGE.GENERATED_POSTS),e.xp6(4),e.Q6J("ngClass",e.VKq(18,K,i.stage>=i.COPILOT_STAGE.POSTING_PLAN)),e.xp6(1),e.Q6J("ngIf",i.stage>=i.COPILOT_STAGE.POSTING_PLAN),e.xp6(4),e.Q6J("ngClass",e.VKq(20,K,i.stage>=i.COPILOT_STAGE.CONNECT_SOCIAL_ACCOUNTS)),e.xp6(1),e.Q6J("ngIf",i.stage>=i.COPILOT_STAGE.CONNECT_SOCIAL_ACCOUNTS),e.xp6(4),e.Q6J("ngClass",e.VKq(22,K,i.stage>=i.COPILOT_STAGE.START_POSTING)),e.xp6(1),e.Q6J("ngIf",i.stage>=i.COPILOT_STAGE.START_POSTING))},dependencies:[a.mk,a.O5],styles:[".title[_ngcontent-%COMP%]{font-size:1.25rem;font-weight:600}.subtitle[_ngcontent-%COMP%]{font-size:1rem;font-weight:500}.description[_ngcontent-%COMP%]{font-size:.875rem;font-weight:400}.stage[_ngcontent-%COMP%]{font-size:12px}.stage[_ngcontent-%COMP%] .circle-stage[_ngcontent-%COMP%]{padding:0 8.5px;border:1px solid var(--cp-sb-primary-text)!important}.stage[_ngcontent-%COMP%] .completed[_ngcontent-%COMP%]{background-color:var(--cp-sb-background-main-inverse-color);color:var(--cp-sb-background-main-color);padding:0 3.3px}.container-left[_ngcontent-%COMP%]{gap:24px}"]})}}return n})();function qo(n,r){1&n&&(e.ynx(0),e._UZ(1,"socialbee-dashboard"),e.BQk())}function Yo(n,r){1&n&&e._UZ(0,"socialbee-dashboard-partial")}function Bo(n,r){if(1&n&&(e.ynx(0),e.YNc(1,qo,2,0,"ng-container",4),e.YNc(2,Yo,1,0,"ng-template",null,5,e.W1O),e.BQk()),2&n){const t=e.MAs(3),o=e.oxw(2);e.xp6(1),e.Q6J("ngIf",!o.showFullDashboard)("ngIfElse",t)}}function Go(n,r){1&n&&e._UZ(0,"socialbee-welcome")}function Ho(n,r){if(1&n&&(e.TgZ(0,"div",2),e.YNc(1,Bo,4,2,"ng-container",3),e.YNc(2,Go,1,0,"socialbee-welcome",3),e._UZ(3,"socialbee-simple-toast-container"),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.hasUser),e.xp6(1),e.Q6J("ngIf",!t.hasUser)}}let Vo=(()=>{class n{constructor(t,o,i,s){this.coreService=t,this.alertService=o,this.copilotService=i,this.router=s,this.showFullDashboard=!1,this.loading=!1,this.hasUser=!1}ngOnInit(){var t=this;return(0,Q.Z)(function*(){const o=yield t.coreService.getAuthToken();o&&o.length>0?(t.navigateToLatestStage(),t.coreService.identity(!0).subscribe({next:i=>{t.hasUser=null!==i,t.showFullDashboard=i?.status===De.PROSPECT_CPANEL,t.loading=!1},error:i=>{t.hasUser=!1,t.loading=!1,t.alertService.error(i.error.message?i.error.message:"Error fetching user data, please try again later.")}})):t.loading=!1})()}navigateToLatestStage(){const t=this.router.url;this.copilotService.getCopilotStage().pipe((0,le.U)(o=>{this.navigateToAllowedStage(o,t)}),(0,se.K)(o=>(this.alertService.error(o.error?o.error.message:"Error fetching copilot stage, please try again later."),this.navigateToAllowedStage(-1,t),(0,J.of)(!1)))).subscribe()}navigateToAllowedStage(t,o){const i=this.coreService.getPathByStage(t);i!==o&&this.router.navigate([i])}static{this.\u0275fac=function(o){return new(o||n)(e.Y36(Z),e.Y36(P),e.Y36(k),e.Y36(O.F0))}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-main-home"]],decls:2,vars:3,consts:[[3,"showSpinner","loadingTitle"],["class","main-container w-100",4,"ngIf"],[1,"main-container","w-100"],[4,"ngIf"],[4,"ngIf","ngIfElse"],["partialDashboard",""]],template:function(o,i){1&o&&(e._UZ(0,"socialbee-loading-spinner",0),e.YNc(1,Ho,4,2,"div",1)),2&o&&(e.Q6J("showSpinner",i.loading)("loadingTitle","Hang tight! We're now getting everything ready for you\u2026"),e.xp6(1),e.Q6J("ngIf",!i.loading))},dependencies:[a.O5,dt,Fe,Co,No,Jo],styles:[".main-container[_ngcontent-%COMP%]{background-color:var(--cp-sb-background-main-color);overflow:hidden}"]})}}return n})();var He=l(9666);let Ve=(()=>{class n{constructor(t,o){this.router=t,this.coreService=o}canActivate(t,o){return(0,He.D)(this.coreService.getAuthToken()).pipe((0,re.w)(i=>this.checkStage(i,o.url)))}canActivateChild(t,o){return this.canActivate(t,o)}checkStage(t,o){return t&&0!==t.length?(0,J.of)(!0):this.navigateToHome(o)}navigateToHome(t){return"/"!==t&&this.router.navigate(["/"]),(0,J.of)(!0)}static{this.\u0275fac=function(o){return new(o||n)(e.LFG(O.F0),e.LFG(Z))}}static{this.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();const Ko=[{path:"",component:Vo,canActivate:[Ve]},{path:"test",component:(()=>{class n{constructor(t,o){this.copilotService=t,this.alertService=o,this.stage=v.POSTING_PLAN}ngOnInit(){}fillPrompt(t){this.prompt=t?"My request is: For the content types in this list (that has the content type name and its description): [%s] I want you to give me %s examples of social media posts relevant to the categories, the number of posts must not be greater than %s. Provide the data in JSON format with the following structure: an object with 1 field with exactly the following name: data. That field contains an array of objects with exactly the following properties: 1. The field 'categoryName' which contains the value of the content type. 2. The field 'caption' has the value of the caption of the post. 3. The field 'specificDateTime' has the value of the specific date and time when the post should be published distributed over a month, date and time should be in milliseconds and should be greater than %s. 4. The field 'imageDescription' has the value of a detailed description of an image to accompany the post. The detailed description will be fed into DALL-E to generate an image, so make it as compatible as possible. It is forbidden for the output to include other explanations. No other whitespaces. Output in a single line.":"My request is: From the list of social networks:[%s], choose 4 socials that works with my profile. This are required social networks[%s] you should always include them. Please rate on a scale of 1 to 10, where 10 is the highest, how much I should focus on each. Provide the data in JSON format with the following structure: an object with 1 field with exactly the following name: data. That field contains an array of objects with exactly the following properties: 1. The field 'networkId' has the value of the social network. 2. The field 'percent' has the value of the rating you suggested. 3. The field 'postsPerWeek' has the value of the number of posts I should do each week for this network. It is forbidden for the output to include other explanations. No other whitespaces. Output in a single line."}generateDataForPrompt(){this.copilotService.generateDataForPrompt(this.prompt).subscribe(t=>{this.response=t.website},t=>{this.alertService.error("Error generating data for prompt")})}static{this.\u0275fac=function(o){return new(o||n)(e.Y36(k),e.Y36(P))}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-test-prompt"]],inputs:{stage:"stage"},decls:16,vars:2,consts:[[1,"d-flex","w-100","h-100","flex-column","p-5"],[1,"flex-1","p-2"],["placeholder","Type your prompt here",1,"w-100","text-prompt",3,"ngModel","ngModelChange"],[1,"btn","btn-primary","mx-2",3,"click"],[1,"btn","btn-info","mx-2",3,"click"],[1,"m-2"],[1,"border","p-2"]],template:function(o,i){1&o&&(e.TgZ(0,"div",0)(1,"div"),e._uU(2,"Input:"),e.qZA(),e.TgZ(3,"div",1)(4,"textarea",2),e.NdJ("ngModelChange",function(c){return i.prompt=c}),e.qZA(),e.TgZ(5,"button",3),e.NdJ("click",function(){return i.generateDataForPrompt()}),e._uU(6,"Submit"),e.qZA(),e.TgZ(7,"button",4),e.NdJ("click",function(){return i.fillPrompt(!1)}),e._uU(8,"Fill with socials prompt"),e.qZA(),e.TgZ(9,"button",4),e.NdJ("click",function(){return i.fillPrompt(!0)}),e._uU(10,"Fill with posts prompt"),e.qZA()(),e.TgZ(11,"div",1)(12,"div",5),e._uU(13,"Response:"),e.qZA(),e.TgZ(14,"div",6),e._uU(15),e.qZA()()()),2&o&&(e.xp6(4),e.Q6J("ngModel",i.prompt),e.xp6(11),e.Oqu(i.response))},dependencies:[h.Fj,h.JJ,h.On],styles:[".text-prompt[_ngcontent-%COMP%]{height:130px}"]})}}return n})()}];function jo(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",6)(1,"label",7),e._uU(2,"Use mock data for AI"),e.qZA(),e.TgZ(3,"div",8)(4,"input",9),e.NdJ("ngModelChange",function(i){e.CHM(t);const s=e.oxw();return e.KtG(s.useMockAiData=i)})("change",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.changeAiMockData())}),e.qZA(),e._UZ(5,"label",10),e.qZA()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("ngModel",t.useMockAiData)}}function Wo(n,r){1&n&&e._UZ(0,"hr",16)}function zo(n,r){if(1&n&&(e.TgZ(0,"span",17),e._uU(1),e.qZA()),2&n){const t=e.oxw().stage;e.xp6(1),e.Oqu(t)}}function $o(n,r){1&n&&e._UZ(0,"span",18)}const Xo=function(n){return{completed:n}};function ei(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",11),e.NdJ("click",function(){const s=e.CHM(t).stage,c=e.oxw();return e.KtG(c.navigateToStage(s))}),e.YNc(1,Wo,1,0,"hr",12),e.TgZ(2,"span",13),e.YNc(3,zo,2,1,"span",14),e.YNc(4,$o,1,0,"span",15),e.qZA(),e.TgZ(5,"span"),e._uU(6),e.qZA()()}if(2&n){const t=r.stage,o=r.currentStage,i=r.name,s=r.hasLine;e.Gre("p-2 stage ",o>=t?"stage-active":"stage-inactive",""),e.xp6(1),e.Q6J("ngIf",s),e.xp6(1),e.Q6J("ngClass",e.VKq(8,Xo,o>t)),e.xp6(1),e.Q6J("ngIf",o<=t),e.xp6(1),e.Q6J("ngIf",o>t),e.xp6(2),e.Oqu(i)}}const ti=function(n,r){return{stage:n,currentStage:r,name:"Business info",hasLine:!1}},ni=function(n,r){return{stage:n,currentStage:r,name:"Suggested social networks",hasLine:!0}},oi=function(n,r){return{stage:n,currentStage:r,name:"Generated posts",hasLine:!0}},ii=function(n,r){return{stage:n,currentStage:r,name:"Posting plan",hasLine:!0}};let ri=(()=>{class n{constructor(t,o,i,s){this.eventBusService=t,this.copilotService=o,this.coreService=i,this.router=s,this.COPILOT_STAGE=v,this.stage=v.BUSINESS_INFO,this.useMockAiData=u.mockAIData}ngOnInit(){this.environment=u,this.eventBusService.sharedCopilotStageChangeSubject.subscribe(t=>{this.stage=t}),this.eventBusService.sharedUseMockAiDataSubject.subscribe(t=>{this.copilotService.setCopilotMockAiData(t)}),this.changeAiMockData()}changeAiMockData(){this.eventBusService.nextUseMockAiData(this.useMockAiData)}navigateToStage(t){const o=this.coreService.getPathByStage(t);this.router.url!==o&&t<=this.stage&&this.router.navigateByUrl(o)}static{this.\u0275fac=function(o){return new(o||n)(e.Y36(V),e.Y36(k),e.Y36(Z),e.Y36(O.F0))}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-copilot-main"]],decls:12,vars:21,consts:[[1,"px-4","py-3","container-copilot"],[1,"d-flex","justify-content-end"],["class","d-flex justify-content-end align-items-center pe-5",4,"ngIf"],[1,"d-flex","my-3"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],["stageTmpl",""],[1,"d-flex","justify-content-end","align-items-center","pe-5"],[1,"p-0","m-0","me-2","font-weight-lighter"],[1,"toggle-switch","pull-right","align-self-start"],["id","SwitchOptionReQueue","name","SwitchOptionReQueue","type","checkbox",3,"ngModel","ngModelChange","change"],["for","SwitchOptionReQueue"],[3,"click"],["class","line-stage d-inline-block h-0 my-1 mx-0",4,"ngIf"],[1,"mx-1","rounded-circle","border","circle-stage",3,"ngClass"],["class","stage-number",4,"ngIf"],["class","fa fa-check fa-sm",4,"ngIf"],[1,"line-stage","d-inline-block","h-0","my-1","mx-0"],[1,"stage-number"],[1,"fa","fa-check","fa-sm"]],template:function(o,i){if(1&o&&(e.TgZ(0,"div",0)(1,"div",1),e.YNc(2,jo,6,1,"div",2),e.qZA(),e.TgZ(3,"div",3),e.GkF(4,4)(5,4)(6,4)(7,4),e.qZA(),e._UZ(8,"router-outlet")(9,"socialbee-simple-toast-container"),e.qZA(),e.YNc(10,ei,7,10,"ng-template",null,5,e.W1O)),2&o){const s=e.MAs(11);e.xp6(2),e.Q6J("ngIf",i.environment.standalone),e.xp6(2),e.Q6J("ngTemplateOutlet",s)("ngTemplateOutletContext",e.WLB(9,ti,i.COPILOT_STAGE.BUSINESS_INFO,i.stage)),e.xp6(1),e.Q6J("ngTemplateOutlet",s)("ngTemplateOutletContext",e.WLB(12,ni,i.COPILOT_STAGE.SUGGESTED_SOCIAL_NETWORKS,i.stage)),e.xp6(1),e.Q6J("ngTemplateOutlet",s)("ngTemplateOutletContext",e.WLB(15,oi,i.COPILOT_STAGE.GENERATED_POSTS,i.stage)),e.xp6(1),e.Q6J("ngTemplateOutlet",s)("ngTemplateOutletContext",e.WLB(18,ii,i.COPILOT_STAGE.POSTING_PLAN,i.stage))}},dependencies:[a.mk,a.O5,a.tP,O.lC,h.Wl,h.JJ,h.On,Fe],styles:[".container-copilot[_ngcontent-%COMP%]{background-color:var(--cp-sb-background-main-color)}.stage[_ngcontent-%COMP%]{font-size:12px}.stage[_ngcontent-%COMP%] .circle-stage[_ngcontent-%COMP%]{padding:0 3.2px;border:1px solid var(--cp-sb-primary-text)!important}.stage[_ngcontent-%COMP%] .stage-number[_ngcontent-%COMP%]{padding:0 1.9px}.stage[_ngcontent-%COMP%] .completed[_ngcontent-%COMP%]{background-color:var(--cp-sb-background-main-inverse-color);color:var(--cp-sb-background-main-color);padding:0 3.3px}.line-stage[_ngcontent-%COMP%]{border:1px solid var(--cp-sb-primary-text)!important;width:32px;opacity:1}.stage-active[_ngcontent-%COMP%]{opacity:1;cursor:pointer}.stage-inactive[_ngcontent-%COMP%]{opacity:.5}"]})}}return n})();class Te{constructor(r,t){this.hover=r,this.edit=t,this.edit=!1,this.hover=!1}}class si{constructor(r,t,o,i,s){this.id=r,this.content=t,this.role=o,this.sequence=i,this.stage=s}}const ai=["scrollable"];function ci(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"i",23),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2).index,s=e.oxw();return e.KtG(s.editAnswerClicked(i))}),e.qZA()}}function li(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",18),e.NdJ("mouseover",function(){e.CHM(t);const i=e.oxw().index,s=e.oxw();return e.KtG(s.editAnswer[i].hover=!0)})("mouseout",function(){e.CHM(t);const i=e.oxw().index,s=e.oxw();return e.KtG(s.editAnswer[i].hover=!1)}),e.TgZ(1,"div",19),e.YNc(2,ci,1,0,"i",20),e.qZA(),e.TgZ(3,"label",21),e._uU(4),e.qZA(),e._UZ(5,"img",22),e.qZA()}if(2&n){const t=e.oxw().index,o=e.oxw();e.xp6(1),e.Q6J("hidden",!o.editAnswer[t].hover),e.xp6(1),e.Q6J("ngIf",t>0),e.xp6(2),e.Oqu(o.answersFromQuestions[t]),e.xp6(1),e.s9C("src",null==o.user?null:o.user.profileImageUrl,e.LSH)}}function di(n,r){1&n&&e.GkF(0)}function pi(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",28)(1,"textarea",29),e.NdJ("keydown.enter",function(){e.CHM(t);const i=e.oxw(2).index,s=e.oxw();return e.KtG(s.editAnswer[i].edit=!1)})("ngModelChange",function(i){e.CHM(t);const s=e.oxw(2).index,c=e.oxw();return e.KtG(c.answersFromQuestions[s]=i)}),e.qZA(),e.TgZ(2,"i",30),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2).index,s=e.oxw();return e.KtG(s.editAnswer[i].edit=!1)}),e.qZA()()}if(2&n){const t=e.oxw(2).index,o=e.oxw();e.xp6(1),e.Q6J("ngModel",o.answersFromQuestions[t])}}function gi(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"button",33),e.NdJ("click",function(){const s=e.CHM(t).$implicit,c=e.oxw(3).index,p=e.oxw();return e.KtG(p.sendAnswerForQuestionButtonEdit(s,c))}),e._uU(1),e.qZA()}if(2&n){const t=r.$implicit,o=e.oxw(3).index,i=e.oxw();e.ekj("tone-of-voice-button-active",i.answersFromQuestions[o].toLowerCase()===t.toLowerCase()),e.xp6(1),e.hij(" ",t," ")}}function ui(n,r){if(1&n&&(e.TgZ(0,"div",31),e.YNc(1,gi,2,3,"button",32),e.qZA()),2&n){const t=e.oxw(3);e.xp6(1),e.Q6J("ngForOf",t.COPILOT_TONES_OF_VOICE_LIST)}}function hi(n,r){if(1&n&&(e.TgZ(0,"div",24),e.YNc(1,di,1,0,"ng-container",25),e.YNc(2,pi,3,1,"ng-template",null,26,e.W1O),e.YNc(4,ui,2,1,"ng-template",null,27,e.W1O),e._UZ(6,"img",22),e.qZA()),2&n){const t=e.MAs(3),o=e.MAs(5),i=e.oxw().index,s=e.oxw();e.xp6(1),e.Q6J("ngIf",i===s.TONE_OF_VOICE_QUESTION)("ngIfThen",o)("ngIfElse",t),e.xp6(5),e.s9C("src",null==s.user?null:s.user.profileImageUrl,e.LSH)}}function fi(n,r){if(1&n&&(e.ynx(0),e.TgZ(1,"div",13)(2,"div"),e._UZ(3,"i",14),e.qZA(),e.TgZ(4,"label",15),e._uU(5),e.qZA()(),e.YNc(6,li,6,4,"div",16),e.YNc(7,hi,7,4,"div",17),e.BQk()),2&n){const t=r.index,o=e.oxw();e.xp6(5),e.Oqu(o.socialMediaCopilotQuestions["QUESTION"+(t+1)+".title"]),e.xp6(1),e.Q6J("ngIf",!o.editAnswer[t].edit),e.xp6(1),e.Q6J("ngIf",o.editAnswer[t].edit)}}function _i(n,r){1&n&&e.GkF(0)}function mi(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"button",33),e.NdJ("click",function(){const s=e.CHM(t).$implicit,c=e.oxw(3);return e.KtG(c.sendAnswerForQuestionButton(s))}),e._uU(1),e.qZA()}if(2&n){const t=r.$implicit,o=e.oxw(3);e.ekj("tone-of-voice-button-active",o.answersFromQuestion.toLowerCase()===t.toLowerCase()),e.xp6(1),e.hij(" ",t," ")}}function Ci(n,r){if(1&n&&e.YNc(0,mi,2,3,"button",32),2&n){const t=e.oxw(2);e.Q6J("ngForOf",t.COPILOT_TONES_OF_VOICE_LIST)}}function vi(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"textarea",42),e.NdJ("keydown.enter",function(i){e.CHM(t);const s=e.oxw(2);return e.KtG(s.sendAnswerForQuestion(i))})("ngModelChange",function(i){e.CHM(t);const s=e.oxw(2);return e.KtG(s.answersFromQuestion=i)}),e.qZA()}if(2&n){const t=e.oxw(2);e.Q6J("placeholder",t.socialMediaCopilotQuestions["QUESTION"+t.questionStep+".placeholder"])("ngModel",t.answersFromQuestion)}}const bi=function(n){return{"border-radius border p-2":n}};function Oi(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",34)(1,"h5",35),e._uU(2),e.qZA(),e.TgZ(3,"span",36),e._uU(4),e.qZA(),e.TgZ(5,"div",37),e.YNc(6,_i,1,0,"ng-container",25),e.YNc(7,Ci,1,1,"ng-template",null,38,e.W1O),e.YNc(9,vi,1,2,"ng-template",null,39,e.W1O),e.qZA(),e.TgZ(11,"div",40)(12,"button",41),e.NdJ("click",function(i){e.CHM(t);const s=e.oxw();return e.KtG(s.sendAnswerForQuestion(i))}),e.TgZ(13,"span"),e._uU(14,"Continue"),e.qZA()()()()}if(2&n){const t=e.MAs(8),o=e.MAs(10),i=e.oxw();e.xp6(2),e.Oqu(i.socialMediaCopilotQuestions["QUESTION"+i.questionStep+".title"]),e.xp6(2),e.hij("Here it's what we found about ",null==i.user?null:i.user.website,". Please edit the answers below if needed."),e.xp6(1),e.Q6J("ngClass",e.VKq(7,bi,i.questionStep!==i.TONE_OF_VOICE_QUESTION+1)),e.xp6(1),e.Q6J("ngIf",i.questionStep===i.TONE_OF_VOICE_QUESTION+1)("ngIfThen",t)("ngIfElse",o),e.xp6(6),e.Q6J("disabled",0===i.answersFromQuestion.length)}}function Pi(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",34)(1,"div",43),e._UZ(2,"i",14),e.qZA(),e.TgZ(3,"h5",35),e._uU(4,"Good Job!"),e.qZA(),e.TgZ(5,"span",44),e._uU(6,"Based on the information you\u2019ve provided, we\u2019ll create a social media strategy for your business."),e.qZA(),e.TgZ(7,"div",45)(8,"button",46),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.navigateToPath())}),e._uU(9," Create social media strategy "),e.qZA(),e.TgZ(10,"button",47),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.clearInputs())}),e._uU(11," Clear inputs "),e.qZA()()()}}const Mi=function(){return[]};let Ti=(()=>{class n{constructor(t,o,i,s,c,p){this.router=t,this.eventBusService=o,this.copilotService=i,this.coreService=s,this.alertService=c,this.analyticsService=p,this.answersFromQuestion="",this.answersFromQuestions=[],this.answersFromQuestionsOld=[],this.copilotConversations=[],this.questionStep=1,this.prevQuestionStep=1,this.maxQuestionStep=7,this.editAnswer=[],this.loadingConversations=!1,this.generatingData=!1,this.showErrorMessage=!1,this.errorTitle="",this.errorDescription="",this.user=new Ue,this.loadingTitle="",this.TONE_OF_VOICE_QUESTION=3,this.COPILOT_TONES_OF_VOICE_LIST=rt,this.socialMediaCopilotQuestions={"QUESTION1.title":"What is the name of your company?","QUESTION1.placeholder":"My company name is...","QUESTION2.title":"What is your company motto or tagline?","QUESTION2.placeholder":"e.g. Put people and their wellbeing first","QUESTION3.title":"What services do you offer?","QUESTION3.placeholder":"e.g. Communication services, tips & tricks about traveling, etc.","QUESTION4.title":"What is your brand\u2019s tone of voice?","QUESTION4.placeholder":"e.g. Professional, witty, enthusiastic, friendly, informational","QUESTION5.title":"Who is your target audience?","QUESTION5.placeholder":"e.g. Large sized organizations","QUESTION6.title":"What language should we use for your posts?","QUESTION6.placeholder":"e.g. English, French, German","QUESTION8.title":""}}ngOnInit(){this.analyticsService.trackEvent("Loaded Business Info"),this.editAnswer.push(new Te),this.eventBusService.nextCopilotStage(v.BUSINESS_INFO),this.coreService.identity(!0).subscribe(t=>{this.user=t},()=>{this.alertService.error("Sting! Your user information could not be loaded. Please try again, and if the issue persists, contact our support team.")}),this.loadingConversations=!0,this.copilotService.getCopilotConversationsByStage(ce[ce.CHAT]).subscribe(t=>{this.copilotConversations=t,this.clearInputs(!0),this.copilotConversations.forEach((o,i)=>{o.role?.toString()===Y[Y.USER].toString()&&(this.answersFromQuestions.push(o.content||""),this.answersFromQuestionsOld.push(o.content||""),this.editAnswer.push(new Te))}),this.loadingConversations=!1,this.questionStep=this.answersFromQuestions.length+1,this.autocompleteAnswer()},()=>{this.loadingConversations=!1,this.alertService.error("Sting! Your conversation history could not be loaded. Please try again, and if the issue persists, contact our support team.")})}ngAfterViewChecked(){this.prevQuestionStep<this.questionStep&&(this.prevQuestionStep++,this.scrollToBottom())}sendAnswerForQuestion(t){t.preventDefault(),this.answersFromQuestion.length>1&&(this.answersFromQuestions.push(this.answersFromQuestion),this.answersFromQuestion="",this.editAnswer.push(new Te),this.questionStep++),this.autocompleteAnswer()}sendAnswerForQuestionButton(t){this.answersFromQuestion=t}sendAnswerForQuestionButtonEdit(t,o){this.answersFromQuestions[o]=t,this.editAnswer[o].edit=!1}clearInputs(t){t&&this.analyticsService.trackEvent("Clear Inputs",{}),this.questionStep=1,this.prevQuestionStep=1,this.answersFromQuestions=[],this.answersFromQuestion="",this.editAnswer=[],this.autocompleteAnswer()}scrollToBottom(){try{this.scrollable&&(this.scrollable.nativeElement.scrollTop=this.scrollable?.nativeElement.scrollHeight)}catch(t){console.error(t)}}navigateToPath(){this.analyticsService.trackEvent("Create Social Media Strategy",{}),this.generatingData=!0,this.checkIfConversationIsChanged()?(this.answersFromQuestions.forEach((t,o)=>{this.copilotConversations[o]||(this.copilotConversations[o]=new si),this.copilotConversations[o].content=t,this.copilotConversations[o].sequence=o,this.copilotConversations[o].role=Y.USER,this.copilotConversations[o].stage=ce.CHAT}),this.copilotService.saveCopilotConversations(this.copilotConversations).subscribe(()=>{this.generateCopilotSocialAccountsInfo()},()=>{this.generatingData=!1,this.alertService.error("Your conversation could not be saved. Please try again, and if the issue persists, contact our support team.")})):this.generateCopilotSocialAccountsInfo()}loadingErrorEvent(t){this.showErrorMessage=t}goNextStep(){this.router.navigate(["/copilot/network"])}checkIfConversationIsChanged(){let t=!1;return t=this.answersFromQuestionsOld.length!==this.answersFromQuestions.length,this.answersFromQuestionsOld.forEach((o,i)=>{o!==this.answersFromQuestions[i]&&(t=!0)}),t}autocompleteAnswer(){const t=this.copilotConversations.filter(o=>o.role.toString()===Y[Y.ASSISTANT])[this.questionStep-1];t&&(this.answersFromQuestion=t.content)}generateCopilotSocialAccountsInfo(){this.generatingData=!0,this.loadingTitle="Identifying your target audience and where they spend time online\u2026",setTimeout(()=>{this.loadingTitle="Finding the best social platforms for your business \u2014 hang tight!"},2500),this.copilotService.generateCopilotSocialAccountsInfo().subscribe(()=>{this.generatingData=!1,this.goNextStep()},t=>{t.error.message&&"The chat contains illegal or unethical content"===t.error.message&&(this.errorTitle="We\u2019ve detected content that violates our usage policies.",this.errorDescription="If you believe this is a mistake, or if you need further assistance, please reach out to us at success@socialbee.com."),this.generatingData=!1,this.showErrorMessage=!0})}get userWebsite(){if(this.user&&this.user.website)return this.user.website.startsWith("http://")||this.user.website.startsWith("https://")?this.user.website:"https://"+this.user.website}editAnswerClicked(t){this.editAnswer[t].edit=!0,this.analyticsService.trackEvent("Edit Inputs",{})}static{this.\u0275fac=function(o){return new(o||n)(e.Y36(O.F0),e.Y36(V),e.Y36(k),e.Y36(Z),e.Y36(P),e.Y36(D))}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-copilot-chat"]],viewQuery:function(o,i){if(1&o&&e.Gf(ai,5),2&o){let s;e.iGM(s=e.CRH())&&(i.scrollable=s.first)}},decls:19,vars:11,consts:[[3,"showSpinner","loadingTitle"],[3,"showSpinner","errorTitle","errorDescription","closeLoadingEvent"],[1,"d-flex","flex-column","flex-gap-8"],[1,"text-size","col-md-5"],[1,"d-flex","flex-column","mt-3","overflow-scroll-auto","h-100","align-items-center"],[1,"overflow-scroll-auto","d-flex","flex-column","align-items-center","h-100","border","border-radius","w-100","chat-container"],[1,"d-flex","flex-column","w-100","max-width-500","py-2","overflow-scroll-auto","chat-view"],["scrollable",""],["src","assets/images/copilot/copilot-illustration.svg","alt","Copilot"],[1,"mb-4"],["target","_blank",3,"href"],[4,"ngFor","ngForOf"],["class","d-flex flex-column w-100 max-width-500 my-4",4,"ngIf"],[1,"d-flex","justify-content-start","align-items-start","mb-2"],[1,"fa-kit","fa-social-media-copilot-svg","me-2","rounded-circle","border","p-1","fa-lg"],[1,"border-radius","border-top-left-radius-none","border","px-3","py-2","message-default-color"],["class","d-flex justify-content-end align-items-end mb-4",3,"mouseover","mouseout",4,"ngIf"],["class","d-flex justify-content-end align-items-end mb-4",4,"ngIf"],[1,"d-flex","justify-content-end","align-items-end","mb-4",3,"mouseover","mouseout"],[1,"d-flex","align-items-center","h-100",3,"hidden"],["class","fa-kit fa-ai-edit-svg fa-lg me-2 m-0",3,"click",4,"ngIf"],[1,"border-radius","border-bottom-right-radius-none","px-3","py-2","message-send-color","m-0","label-text","max-width-77"],[1,"img-fluid","rounded-circle","center-block","user-profile-image-small","img-profile","ng-scope","ms-2",3,"src"],[1,"fa-kit","fa-ai-edit-svg","fa-lg","me-2","m-0",3,"click"],[1,"d-flex","justify-content-end","align-items-end","mb-4"],[4,"ngIf","ngIfThen","ngIfElse"],["defaultQuestionEdit",""],["toneOfVoiceQuestionEdit",""],[1,"border-radius","border","p-2","d-flex","flex-row","max-width-77","w-100","message-default-color"],["maxlength","500",1,"resize-none","w-100","hide-border","mb-3",3,"ngModel","keydown.enter","ngModelChange"],[1,"fa-kit","fa-social-media-copilot-send-svg","fa-lg","ms-1",3,"click"],[1,"d-flex","flex-row","justify-content-end","flex-wrap"],["class","btn border btn-default-color me-1 mb-1 tone-of-voice-button",3,"tone-of-voice-button-active","click",4,"ngFor","ngForOf"],[1,"btn","border","btn-default-color","me-1","mb-1","tone-of-voice-button",3,"click"],[1,"d-flex","flex-column","w-100","max-width-500","my-4"],[1,"m-0"],[1,"text-muted","label-font-size"],[1,"d-flex","flex-row","message-default-color","flex-wrap",3,"ngClass"],["toneOfVoiceQuestion",""],["defaultQuestion",""],[1,"mt-2"],[1,"btn","btn-primary-socialbee","py-2",3,"disabled","click"],["maxlength","500",1,"resize-none","w-100","hide-border","mb-3",3,"placeholder","ngModel","keydown.enter","ngModelChange"],[1,"mb-2"],[1,"info-text"],[1,"d-flex","justify-content-start","align-items-end","mt-4"],[1,"btn","btn-primary-socialbee","py-2",3,"click"],[1,"btn","clear-inputs-button","btn-default-color","border","ms-3","py-2",3,"click"]],template:function(o,i){1&o&&(e._UZ(0,"socialbee-progress-spinner",0),e.TgZ(1,"socialbee-loading-error",1),e.NdJ("closeLoadingEvent",function(c){return i.loadingErrorEvent(c)}),e.qZA(),e.TgZ(2,"div",2)(3,"span",3),e._uU(4,"Answer the questions below so we can generate a social media strategy for you."),e.qZA(),e.TgZ(5,"div",4)(6,"div",5)(7,"div",6,7)(9,"div"),e._UZ(10,"img",8),e.qZA(),e.TgZ(11,"span",9),e._uU(12,"Please review the info we've gathered from your website "),e.TgZ(13,"a",10),e._uU(14),e.qZA(),e._uU(15," and edit if needed."),e.qZA(),e.YNc(16,fi,8,3,"ng-container",11),e.qZA()(),e.YNc(17,Oi,15,9,"div",12),e.YNc(18,Pi,12,0,"div",12),e.qZA()()),2&o&&(e.Q6J("showSpinner",i.generatingData)("loadingTitle",i.loadingTitle),e.xp6(1),e.Q6J("showSpinner",i.showErrorMessage)("errorTitle",i.errorTitle)("errorDescription",i.errorDescription),e.xp6(12),e.Q6J("href",i.userWebsite,e.LSH),e.xp6(1),e.Oqu(null==i.user?null:i.user.website),e.xp6(2),e.Q6J("ngForOf",e.DdM(10,Mi).constructor(i.questionStep-1)),e.xp6(1),e.Q6J("ngIf",i.maxQuestionStep!==i.questionStep),e.xp6(1),e.Q6J("ngIf",i.maxQuestionStep===i.questionStep))},dependencies:[a.mk,a.sg,a.O5,h.Fj,h.JJ,h.nD,h.On,te,ge],styles:[".chat-container[_ngcontent-%COMP%]{background-color:var(--cp-sb-background-secondary-color)}.chat-container[_ngcontent-%COMP%] .chat-view[_ngcontent-%COMP%]{height:50vh}.info-text[_ngcontent-%COMP%]{font-size:12px;font-weight:400}.max-width-77[_ngcontent-%COMP%]{max-width:77%}.border-radius[_ngcontent-%COMP%]{border-radius:8px}html[dir=ltr][_ngcontent-%COMP%] .border-top-left-radius-none[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .border-top-left-radius-none[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .border-top-left-radius-none[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .border-top-left-radius-none[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .border-top-left-radius-none[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .border-top-left-radius-none[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .border-top-left-radius-none[_ngcontent-%COMP%]{border-top-left-radius:0}html[dir=rtl][_ngcontent-%COMP%] .border-top-left-radius-none[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .border-top-left-radius-none[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .border-top-left-radius-none[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .border-top-left-radius-none[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .border-top-left-radius-none[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .border-top-left-radius-none[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .border-top-left-radius-none[_ngcontent-%COMP%]{border-top-right-radius:0}html[dir=ltr][_ngcontent-%COMP%] .border-bottom-right-radius-none[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .border-bottom-right-radius-none[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .border-bottom-right-radius-none[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .border-bottom-right-radius-none[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .border-bottom-right-radius-none[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .border-bottom-right-radius-none[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .border-bottom-right-radius-none[_ngcontent-%COMP%]{border-bottom-right-radius:0}html[dir=rtl][_ngcontent-%COMP%] .border-bottom-right-radius-none[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .border-bottom-right-radius-none[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .border-bottom-right-radius-none[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .border-bottom-right-radius-none[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .border-bottom-right-radius-none[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .border-bottom-right-radius-none[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .border-bottom-right-radius-none[_ngcontent-%COMP%]{border-bottom-left-radius:0}.label-font-size[_ngcontent-%COMP%]{font-size:12px}.message-default-color[_ngcontent-%COMP%]{background-color:var(--cp-sb-background-main-color);color:var(--cp-sb-secondary-text)}.message-send-color[_ngcontent-%COMP%]{background-color:var(--cp-sb-secondary-text);color:var(--cp-sb-background-main-color)}.hide-border[_ngcontent-%COMP%], .hide-border[_ngcontent-%COMP%]:focus, .hide-border[_ngcontent-%COMP%]:active{border:none;outline:none}.user-profile-image-small[_ngcontent-%COMP%]{display:inline;width:30px;height:30px}.label-text[_ngcontent-%COMP%]{white-space:pre-wrap}.resize-none[_ngcontent-%COMP%], .resize-none[_ngcontent-%COMP%]:disabled{resize:none;background-color:inherit}.overflow-scroll-auto[_ngcontent-%COMP%]{overflow:auto}.primary-color-yellow[_ngcontent-%COMP%]{color:#f5c400;border-color:#f5c400!important}.background-color-inherit[_ngcontent-%COMP%]{background-color:inherit}.clear-inputs-button[_ngcontent-%COMP%]{border-radius:32px;font-size:14px;font-weight:600}.tone-of-voice-button[_ngcontent-%COMP%]{background-color:var(--cp-sb-background-secondary-color)}.tone-of-voice-button[_ngcontent-%COMP%]:hover, .tone-of-voice-button-active[_ngcontent-%COMP%]{background-color:var(--cp-sb-border-color)}"]})}}return n})(),xi=(()=>{class n{constructor(){}ngOnInit(){}get percent(){return`${this.value}%`}get content(){return`'${this.value}%'`}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-progress-bar-circular"]],inputs:{value:"value"},decls:1,vars:4,consts:[["role","progressbar","aria-valuenow","30","aria-valuemin","0","aria-valuemax","100",1,"progress-bar"]],template:function(o,i){1&o&&e._UZ(0,"div",0),2&o&&e.Udp("--percent",i.percent)("--content",i.content)},styles:[".progress-bar[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;width:70px;height:70px;border-radius:50%;font-size:16px;color:#000;background:radial-gradient(closest-side,white 84%,transparent 90% 100%),conic-gradient(#f5c400 var(--percent),var(--cp-sb-border-color) 0)}.progress-bar[_ngcontent-%COMP%]:before{content:var(--content)}"]})}}return n})();const yi=["dropdown"];function wi(n,r){if(1&n&&(e.ynx(0),e.TgZ(1,"div",23),e._UZ(2,"socialbee-social-profile",24),e.qZA(),e.BQk()),2&n){const t=r.$implicit,o=e.oxw(4);e.xp6(2),e.Q6J("profile",t)("profileOptions",o.profileOptions)}}function Si(n,r){if(1&n&&(e.TgZ(0,"div",17),e.YNc(1,wi,3,2,"ng-container",6),e.qZA()),2&n){const t=e.oxw(2).$implicit;e.xp6(1),e.Q6J("ngForOf",null==t?null:t.socialAccounts)}}function ki(n,r){if(1&n&&(e.ynx(0),e.TgZ(1,"div",13)(2,"div",14),e._UZ(3,"socialbee-progress-bar-circular",15),e.qZA(),e.TgZ(4,"div",16)(5,"div",17),e._UZ(6,"i",18),e.TgZ(7,"h4",19),e._uU(8),e.qZA(),e.TgZ(9,"h6",20),e._uU(10),e.qZA()(),e.TgZ(11,"h5",21),e._uU(12),e.qZA(),e.TgZ(13,"h5",21),e._uU(14),e.qZA(),e.YNc(15,Si,2,1,"div",22),e.qZA()(),e.BQk()),2&n){const t=e.oxw().$implicit,o=e.oxw();e.xp6(3),e.Q6J("value",(null==t?null:t.percent)+"0"),e.xp6(3),e.MT6("",o.translations[(null==t?null:t.networkId)+".icon"]," fa-sm connect-social-",o.translations[(null==t?null:t.networkId)+".color"],"-background rounded-circle social-account-icon\n d-flex align-items-center justify-content-center px-1"),e.xp6(2),e.Oqu(o.translations[(null==t?null:t.networkId)+".title"]),e.xp6(2),e.hij("",null==t?null:t.postsPerWeek," posts/week"),e.xp6(2),e.Oqu(null==t?null:t.description),e.xp6(2),e.Oqu(o.getSocialDescription(t)),e.xp6(1),e.Q6J("ngIf",((null==t||null==t.socialAccounts?null:t.socialAccounts.length)||0)>0&&(null==t?null:t.description))}}function Ii(n,r){1&n&&e._UZ(0,"div",25)}function Ai(n,r){if(1&n&&(e.ynx(0),e.YNc(1,ki,16,10,"ng-container",11),e.YNc(2,Ii,1,0,"div",12),e.BQk()),2&n){const t=r.$implicit,o=r.index,i=r.count;e.xp6(1),e.Q6J("ngIf",!(null!=t&&t.loading)),e.xp6(1),e.Q6J("ngIf",i-1!==o)}}let Ei=(()=>{class n{constructor(t,o,i,s,c){this.copilotService=t,this.eventBusService=o,this.alertService=i,this.router=s,this.analyticsService=c,this.loadingTitle="",this.translations={"FACEBOOK-PROFILE.icon":"fa fa-facebook","FACEBOOK-PROFILE.color":"facebook","FACEBOOK-PROFILE.title":"Facebook Profile","FACEBOOK-PAGE.icon":"fa fa-facebook","FACEBOOK-PAGE.color":"facebook","FACEBOOK-PAGE.title":"Facebook Page","INSTAGRAM-PROFILE.icon":"fa fa-instagram","INSTAGRAM-PROFILE.color":"instagram","INSTAGRAM-PROFILE.title":"Instagram Profile","INSTAGRAM-BUSINESS.icon":"fa fa-instagram","INSTAGRAM-BUSINESS.color":"instagram","INSTAGRAM-BUSINESS.title":"Instagram Business","LINKEDIN-PROFILE.icon":"fa fa-linkedin","LINKEDIN-PROFILE.color":"linkedin","LINKEDIN-PROFILE.title":"LinkedIn Profile","LINKEDIN-PAGE.icon":"fa fa-linkedin","LINKEDIN-PAGE.color":"linkedin","LINKEDIN-PAGE.title":"LinkedIn Company","PINTEREST-PROFILE.icon":"fa fa-pinterest","PINTEREST-PROFILE.color":"pinterest","PINTEREST-PROFILE.title":"Pinterest","TIKTOK-PROFILE.icon":"fa fa-tiktok","TIKTOK-PROFILE.color":"tiktok","TIKTOK-PROFILE.title":"Tiktok Profile","TWITTER-PROFILE.icon":"fak fa-twitter","TWITTER-PROFILE.color":"twitter","TWITTER-PROFILE.title":"X (Twitter) Profile","TWITTER-PROFILE.old-title":"Twitter Profile","GOOGLE-PAGE.icon":"fa fa-google","GOOGLE-PAGE.color":"google","GOOGLE-PAGE.title":"Google Business Profile","YOUTUBE-CHANNEL.icon":"fa fa-youtube","YOUTUBE-CHANNEL.color":"youtube","YOUTUBE-CHANNEL.title":"Youtube Channel","BLUESKY-PROFILE.icon":"fak fa-bluesky","BLUESKY-PROFILE.color":"bluesky","BLUESKY-PROFILE.title":"Bluesky Profile"},this.profileOptions=new A(x.SMALL,y.HORIZONTAL,!1,!1,!0,!1,!1,!0),this.suggestedSocialNetworkLoading=!0,this.generateData=!1,this.showErrorMessage=!1}ngOnInit(){this.analyticsService.trackEvent("Loaded Suggested Social Networks"),this.eventBusService.nextCopilotStage(v.SUGGESTED_SOCIAL_NETWORKS),this.copilotService.getSocialAccountsInfo().subscribe(t=>{this.suggestedSocialNetworkLoading=!1,this.suggestedSocialNetworkOptions=t.map(o=>(o.description=this.formatSocialNetworkDescription(o),o)).sort((o,i)=>Number(o.percent)>Number(i.percent)?-1:1)},()=>{this.alertService.error("An error occurred while fetching social network data. Please try again.")})}moveToNextStep(){this.analyticsService.trackEvent("Generate Post",{}),this.generateCategoryItems()}loadingErrorEvent(t){this.showErrorMessage=t}getSocialDescription(t){const o=this.translations[t?.networkId+".title"];if(t.socialAccounts?.length>0){let i="Awesome! We've identified that you have the following profiles:";return t.socialAccounts.forEach(s=>{s.fullName.toLowerCase()===o.toLowerCase()&&(i="")}),i}return`We couldn't find an ${o}. You can create one later in the process.`}generateCategoryItems(){this.generateData=!0,this.loadingTitle="Creating post ideas tailored to your brand and audience\u2026",setTimeout(()=>{this.loadingTitle="Adding the finishing touches to your content \u2014 just a moment!"},2500),this.copilotService.generateCategoryItems().subscribe(()=>{this.generateData=!1,this.navigateToNextStep()},()=>{this.generateData=!1,this.showErrorMessage=!0})}navigateToNextStep(){this.router.navigate(["/copilot/posts"])}formatSocialNetworkDescription(t){const o=this.translations[t.networkId+".title"],i=10*Number(t.percent);if(i){if(i<25)return`Given that ${i}% of your audience uses ${o}, having a presence on this platform is important for your business.`;if(i>=25&&i<50)return`About ${i}% of your audience is on ${o}, so it\u2019s important for your business to be active on this platform.`;if(i>=50&&i<75)return`Since ${i}% of your audience uses ${o}, make it a priority to connect your account and actively engage with them.`;if(i>=75)return`With ${i}% of your target audience on ${o}, it\u2019s essential for your brand to have a presence there.`}}static{this.\u0275fac=function(o){return new(o||n)(e.Y36(k),e.Y36(V),e.Y36(P),e.Y36(O.F0),e.Y36(D))}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-copilot-social-network"]],viewQuery:function(o,i){if(1&o&&e.Gf(yi,5),2&o){let s;e.iGM(s=e.CRH())&&(i.dropdown=s.first)}},decls:14,vars:5,consts:[[3,"showSpinner","loadingTitle"],[3,"showSpinner","closeLoadingEvent"],[1,"d-flex","flex-column"],[1,"title","mb-3"],[1,"border","border-radius","overflow-scroll-auto","h-100","socials-container"],[1,"d-flex","flex-column","w-100","scrollable-container"],[4,"ngFor","ngForOf"],[1,"d-flex","flex-column","align-items-center","justify-content-center","mt-4","pb-4"],[1,"info-text","mb-2"],["type","button",1,"d-flex","align-items-baseline","btn","btn-primary-socialbee",3,"disabled","click"],[1,"m-0"],[4,"ngIf"],["class","w-100 border-bottom my-3 px-3",4,"ngIf"],[1,"d-flex","flex-row","px-3","py-3","m-0"],[1,"me-4"],[3,"value"],[1,"d-flex","flex-column","flex-gap-8","p-0"],[1,"d-flex","flex-row","justify-content-start","align-items-center"],["aria-hidden","true"],[1,"m-0","ms-2","me-3"],[1,"label-font-size","m-0","font-weight-bold"],[1,"m-0","font-weight-normal"],["class","d-flex flex-row justify-content-start align-items-center",4,"ngIf"],[1,"d-flex","flex-row","border","social-account-card","border-radius","p-1","px-2","align-items-center","justify-content-sm-between","me-1"],[3,"profile","profileOptions"],[1,"w-100","border-bottom","my-3","px-3"]],template:function(o,i){1&o&&(e._UZ(0,"socialbee-progress-spinner",0),e.TgZ(1,"socialbee-loading-error",1),e.NdJ("closeLoadingEvent",function(c){return i.loadingErrorEvent(c)}),e.qZA(),e.TgZ(2,"div",2)(3,"span",3),e._uU(4,"Here are the top suggested social networks and estimated posts for each profile."),e.qZA(),e.TgZ(5,"div",4)(6,"div",5),e.YNc(7,Ai,3,2,"ng-container",6),e.qZA()(),e.TgZ(8,"div",7)(9,"span",8),e._uU(10,"Generate personalized posts for the suggested social networks based on your business data."),e.qZA(),e.TgZ(11,"button",9),e.NdJ("click",function(){return i.moveToNextStep()}),e.TgZ(12,"span",10),e._uU(13,"Generate posts"),e.qZA()()()()),2&o&&(e.Q6J("showSpinner",i.generateData)("loadingTitle",i.loadingTitle),e.xp6(1),e.Q6J("showSpinner",i.showErrorMessage),e.xp6(6),e.Q6J("ngForOf",i.suggestedSocialNetworkOptions),e.xp6(4),e.Q6J("disabled",i.suggestedSocialNetworkLoading))},dependencies:[a.sg,a.O5,te,xi,$,ge],styles:[".title[_ngcontent-%COMP%]{font-size:1rem;font-weight:700}.overflow-scroll-auto[_ngcontent-%COMP%]{overflow:auto}.socials-container[_ngcontent-%COMP%]{background-color:var(--cp-sb-background-accent-color)}.social-account-card[_ngcontent-%COMP%]{background-color:var(--cp-sb-background-main-color)}.border-radius[_ngcontent-%COMP%]{border-radius:8px}.label-font-size[_ngcontent-%COMP%]{font-size:12px}.scrollable-container[_ngcontent-%COMP%]{height:60vh;overflow-y:scroll}.flex-gap-8[_ngcontent-%COMP%]{gap:8px}.connect-social-facebook-background[_ngcontent-%COMP%]{background-color:var(--cp-sb-social-facebook);color:#fff}.connect-social-instagram-background[_ngcontent-%COMP%]{background-color:var(--cp-sb-social-instagram);color:#fff}.connect-social-linkedin-background[_ngcontent-%COMP%]{background-color:var(--cp-sb-social-linkedin);color:#fff}.connect-social-pinterest-background[_ngcontent-%COMP%]{background-color:var(--cp-sb-social-pinterest);color:#fff}.connect-social-twitter-background[_ngcontent-%COMP%]{background-color:var(--cp-sb-social-twitter);color:#fff}.connect-social-google-background[_ngcontent-%COMP%]{background-color:var(--cp-sb-social-google);color:#fff}.connect-social-tiktok-background[_ngcontent-%COMP%]{background-color:var(--cp-sb-social-tiktok);color:#fff}.connect-social-youtube-background[_ngcontent-%COMP%]{background-color:var(--cp-sb-social-youtube);color:#fff}.connect-social-bluesky-background[_ngcontent-%COMP%]{background-color:var(--cp-sb-social-bluesky);color:#fff}.background-dark[_ngcontent-%COMP%]{background-color:var(--cp-sb-background-accent-color)}.social-account-icon[_ngcontent-%COMP%]{height:20px;width:20px}.btn-twitter-add-app[_ngcontent-%COMP%]{font-size:12px;font-weight:600}"]})}}return n})();function Zi(n,r){1&n&&e.Hsn(0,0,["*ngIf","appearance === 'custom-content'"])}function Ni(n,r){if(1&n&&(e.TgZ(0,"div",1),e.YNc(1,Zi,1,0,"ng-content",2),e.qZA()),2&n){const t=e.oxw();e.Q6J("ngClass",t.classOverride)("ngStyle",t.styleOverride),e.uIk("aria-label",t.ariaLabel)("aria-valuetext",t.loadingText),e.xp6(1),e.Q6J("ngIf","custom-content"===t.appearance)}}const Ui=["*"];let Di=(()=>{class n{constructor(){this.center=!1,this.count=1,this.loadingText="Loading...",this.appearance="",this.animation="progress",this.ariaLabel="loading",this.styleOverride=null,this.classOverride={},this.items=[]}ngOnInit(){this.validateInputValues()}validateInputValues(){/^\d+$/.test(`${this.count}`)||((0,e.X6Q)()&&console.error("`SkeletonLoaderComponent` need to receive 'count' a numeric value. Forcing default to \"1\"."),this.count=1),"custom-content"===this.appearance&&(0,e.X6Q)()&&1!==this.count&&(console.error('`SkeletonLoaderComponent` enforces elements with "custom-content" appearance as DOM nodes. Forcing "count" to "1".'),this.count=1),this.items.length=this.count;const t=["progress","progress-dark","pulse","false"];t.includes(String(this.animation))||((0,e.X6Q)()&&console.error(`\`SkeletonLoaderComponent\` need to receive 'animation' as: ${t.join(", ")}. Forcing default to "progress".`),this.animation="progress"),["circle","line","rounded-square","custom-content",""].includes(String(this.appearance))||((0,e.X6Q)()&&console.error("`SkeletonLoaderComponent` need to receive 'appearance' as: circle or line or custom-content or empty string. Forcing default to \"''\"."),this.appearance=""),this.classOverride.customContent="custom-content"===this.appearance,this.classOverride.circle="circle"===this.appearance,this.classOverride["rounded-square"]="rounded-square"===this.appearance,this.classOverride.progress="progress"===this.animation,this.classOverride.progressDark="progress-dark"===this.animation,this.classOverride.pulse="pulse"===this.animation}ngOnChanges(t){["count","animation","appearance"].find(o=>t[o]&&(t[o].isFirstChange()||t[o].previousValue===t[o].currentValue))||this.validateInputValues()}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-skeleton-loader-extended"]],hostVars:4,hostBindings:function(o,i){2&o&&e.ekj("d-flex",i.center)("justify-content-center",i.center)},inputs:{center:"center",count:"count",loadingText:"loadingText",appearance:"appearance",animation:"animation",ariaLabel:"ariaLabel",styleOverride:"styleOverride",classOverride:"classOverride"},features:[e.TTD],ngContentSelectors:Ui,decls:1,vars:1,consts:[["class","skeleton-loader","aria-busy","true","aria-valuemin","0","aria-valuemax","100","role","progressbar","tabindex","-1",3,"ngClass","ngStyle",4,"ngFor","ngForOf"],["aria-busy","true","aria-valuemin","0","aria-valuemax","100","role","progressbar","tabindex","-1",1,"skeleton-loader",3,"ngClass","ngStyle"],[4,"ngIf"]],template:function(o,i){1&o&&(e.F$t(),e.YNc(0,Ni,2,5,"div",0)),2&o&&e.Q6J("ngForOf",i.items)},dependencies:[a.mk,a.sg,a.O5,a.PC],styles:['.skeleton-loader[_ngcontent-%COMP%]{box-sizing:border-box;overflow:hidden;position:relative;background:#eff1f6 no-repeat;border-radius:32px;width:100%;height:20px;display:inline-block;margin-bottom:10px;will-change:transform}.skeleton-loader[_ngcontent-%COMP%]:after, .skeleton-loader[_ngcontent-%COMP%]:before{box-sizing:border-box}.skeleton-loader.circle[_ngcontent-%COMP%]{width:40px;height:40px;margin:5px;border-radius:50%}.skeleton-loader.rounded-square[_ngcontent-%COMP%]{width:116px;height:116px;margin:24px 24px 16px;border-radius:8px}.skeleton-loader.progress[_ngcontent-%COMP%], .skeleton-loader.progress-dark[_ngcontent-%COMP%]{transform:translateZ(0)}.skeleton-loader.progress[_ngcontent-%COMP%]:after, .skeleton-loader.progress[_ngcontent-%COMP%]:before, .skeleton-loader.progress-dark[_ngcontent-%COMP%]:after, .skeleton-loader.progress-dark[_ngcontent-%COMP%]:before{box-sizing:border-box}.skeleton-loader.progress[_ngcontent-%COMP%]:before, .skeleton-loader.progress-dark[_ngcontent-%COMP%]:before{animation:_ngcontent-%COMP%_progress 2s ease-in-out infinite;background-size:200px 100%;position:absolute;z-index:1;top:0;width:200px;height:100%;content:""}html[dir=ltr][_ngcontent-%COMP%] .skeleton-loader.progress[_ngcontent-%COMP%]:before, [dir=ltr][_ngcontent-%COMP%] .skeleton-loader.progress[_ngcontent-%COMP%]:before, [dir=ltr][_nghost-%COMP%] .skeleton-loader.progress[_ngcontent-%COMP%]:before, html[dir=ltr][_nghost-%COMP%] .skeleton-loader.progress[_ngcontent-%COMP%]:before, html[dir=ltr] [_nghost-%COMP%] .skeleton-loader.progress[_ngcontent-%COMP%]:before, [dir=ltr][_nghost-%COMP%] .skeleton-loader.progress[_ngcontent-%COMP%]:before, [dir=ltr] [_nghost-%COMP%] .skeleton-loader.progress[_ngcontent-%COMP%]:before, html[dir=ltr][_ngcontent-%COMP%] .skeleton-loader.progress-dark[_ngcontent-%COMP%]:before, [dir=ltr][_ngcontent-%COMP%] .skeleton-loader.progress-dark[_ngcontent-%COMP%]:before, [dir=ltr][_nghost-%COMP%] .skeleton-loader.progress-dark[_ngcontent-%COMP%]:before, html[dir=ltr][_nghost-%COMP%] .skeleton-loader.progress-dark[_ngcontent-%COMP%]:before, html[dir=ltr] [_nghost-%COMP%] .skeleton-loader.progress-dark[_ngcontent-%COMP%]:before, [dir=ltr][_nghost-%COMP%] .skeleton-loader.progress-dark[_ngcontent-%COMP%]:before, [dir=ltr] [_nghost-%COMP%] .skeleton-loader.progress-dark[_ngcontent-%COMP%]:before{left:0}html[dir=rtl][_ngcontent-%COMP%] .skeleton-loader.progress[_ngcontent-%COMP%]:before, [dir=rtl][_ngcontent-%COMP%] .skeleton-loader.progress[_ngcontent-%COMP%]:before, [dir=rtl][_nghost-%COMP%] .skeleton-loader.progress[_ngcontent-%COMP%]:before, html[dir=rtl][_nghost-%COMP%] .skeleton-loader.progress[_ngcontent-%COMP%]:before, html[dir=rtl] [_nghost-%COMP%] .skeleton-loader.progress[_ngcontent-%COMP%]:before, [dir=rtl][_nghost-%COMP%] .skeleton-loader.progress[_ngcontent-%COMP%]:before, [dir=rtl] [_nghost-%COMP%] .skeleton-loader.progress[_ngcontent-%COMP%]:before, html[dir=rtl][_ngcontent-%COMP%] .skeleton-loader.progress-dark[_ngcontent-%COMP%]:before, [dir=rtl][_ngcontent-%COMP%] .skeleton-loader.progress-dark[_ngcontent-%COMP%]:before, [dir=rtl][_nghost-%COMP%] .skeleton-loader.progress-dark[_ngcontent-%COMP%]:before, html[dir=rtl][_nghost-%COMP%] .skeleton-loader.progress-dark[_ngcontent-%COMP%]:before, html[dir=rtl] [_nghost-%COMP%] .skeleton-loader.progress-dark[_ngcontent-%COMP%]:before, [dir=rtl][_nghost-%COMP%] .skeleton-loader.progress-dark[_ngcontent-%COMP%]:before, [dir=rtl] [_nghost-%COMP%] .skeleton-loader.progress-dark[_ngcontent-%COMP%]:before{right:0}html[dir=ltr][_ngcontent-%COMP%] .skeleton-loader.progress[_ngcontent-%COMP%]:before, [dir=ltr][_ngcontent-%COMP%] .skeleton-loader.progress[_ngcontent-%COMP%]:before, [dir=ltr][_nghost-%COMP%] .skeleton-loader.progress[_ngcontent-%COMP%]:before, html[dir=ltr][_nghost-%COMP%] .skeleton-loader.progress[_ngcontent-%COMP%]:before, html[dir=ltr] [_nghost-%COMP%] .skeleton-loader.progress[_ngcontent-%COMP%]:before, [dir=ltr][_nghost-%COMP%] .skeleton-loader.progress[_ngcontent-%COMP%]:before, [dir=ltr] [_nghost-%COMP%] .skeleton-loader.progress[_ngcontent-%COMP%]:before{background-image:linear-gradient(90deg,rgba(255,255,255,0),rgba(255,255,255,.6),rgba(255,255,255,0))}html[dir=rtl][_ngcontent-%COMP%] .skeleton-loader.progress[_ngcontent-%COMP%]:before, [dir=rtl][_ngcontent-%COMP%] .skeleton-loader.progress[_ngcontent-%COMP%]:before, [dir=rtl][_nghost-%COMP%] .skeleton-loader.progress[_ngcontent-%COMP%]:before, html[dir=rtl][_nghost-%COMP%] .skeleton-loader.progress[_ngcontent-%COMP%]:before, html[dir=rtl] [_nghost-%COMP%] .skeleton-loader.progress[_ngcontent-%COMP%]:before, [dir=rtl][_nghost-%COMP%] .skeleton-loader.progress[_ngcontent-%COMP%]:before, [dir=rtl] [_nghost-%COMP%] .skeleton-loader.progress[_ngcontent-%COMP%]:before{background-image:linear-gradient(-90deg,rgba(255,255,255,0),rgba(255,255,255,.6),rgba(255,255,255,0))}html[dir=ltr][_ngcontent-%COMP%] .skeleton-loader.progress-dark[_ngcontent-%COMP%]:before, [dir=ltr][_ngcontent-%COMP%] .skeleton-loader.progress-dark[_ngcontent-%COMP%]:before, [dir=ltr][_nghost-%COMP%] .skeleton-loader.progress-dark[_ngcontent-%COMP%]:before, html[dir=ltr][_nghost-%COMP%] .skeleton-loader.progress-dark[_ngcontent-%COMP%]:before, html[dir=ltr] [_nghost-%COMP%] .skeleton-loader.progress-dark[_ngcontent-%COMP%]:before, [dir=ltr][_nghost-%COMP%] .skeleton-loader.progress-dark[_ngcontent-%COMP%]:before, [dir=ltr] [_nghost-%COMP%] .skeleton-loader.progress-dark[_ngcontent-%COMP%]:before{background-image:linear-gradient(90deg,transparent,rgba(0,0,0,.2),transparent)}html[dir=rtl][_ngcontent-%COMP%] .skeleton-loader.progress-dark[_ngcontent-%COMP%]:before, [dir=rtl][_ngcontent-%COMP%] .skeleton-loader.progress-dark[_ngcontent-%COMP%]:before, [dir=rtl][_nghost-%COMP%] .skeleton-loader.progress-dark[_ngcontent-%COMP%]:before, html[dir=rtl][_nghost-%COMP%] .skeleton-loader.progress-dark[_ngcontent-%COMP%]:before, html[dir=rtl] [_nghost-%COMP%] .skeleton-loader.progress-dark[_ngcontent-%COMP%]:before, [dir=rtl][_nghost-%COMP%] .skeleton-loader.progress-dark[_ngcontent-%COMP%]:before, [dir=rtl] [_nghost-%COMP%] .skeleton-loader.progress-dark[_ngcontent-%COMP%]:before{background-image:linear-gradient(-90deg,transparent,rgba(0,0,0,.2),transparent)}.skeleton-loader.pulse[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_pulse 1.5s cubic-bezier(.4,0,.2,1) infinite;animation-delay:.5s}.skeleton-loader.custom-content[_ngcontent-%COMP%]{height:100%;background:none}@media (prefers-reduced-motion: reduce){.skeleton-loader.pulse[_ngcontent-%COMP%], .skeleton-loader.progress-dark[_ngcontent-%COMP%], .skeleton-loader.custom-content[_ngcontent-%COMP%], .skeleton-loader.progress[_ngcontent-%COMP%]:before{animation:none}.skeleton-loader.progress[_ngcontent-%COMP%]:before, .skeleton-loader.progress-dark[_ngcontent-%COMP%], .skeleton-loader.custom-content[_ngcontent-%COMP%]{background-image:none}}@media screen and (min-device-width: 1200px){.skeleton-loader[_ngcontent-%COMP%]{-webkit-user-select:none;user-select:none;cursor:wait}}@keyframes _ngcontent-%COMP%_progress{0%{transform:translate3d(-200px,0,0)}to{transform:translate3d(calc(200px + 100vw),0,0)}}@keyframes _ngcontent-%COMP%_pulse{0%{opacity:1}50%{opacity:.4}to{opacity:1}}']})}}return n})();var Fi=l(6990);let Li=(()=>{class n{transform(t,o=!1,i=-1){let s=t&&t.text?t.text:"";return o&&s&&s.length>i&&(s=s.substr(0,s.lastIndexOf(" ",i)),s=Fi.truncate(s,{length:i,separator:/,? +/})),s}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275pipe=e.Yjl({name:"truncate",type:n,pure:!0})}}return n})();function Qi(n,r){1&n&&e.GkF(0)}function Ri(n,r){1&n&&e._UZ(0,"i",34)}const Ji=function(n){return{"border-0":n}};function qi(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div"),e._UZ(1,"label",26),e.TgZ(2,"span",27),e._uU(3),e.qZA()(),e.TgZ(4,"div",28)(5,"button",29),e.NdJ("click",function(){e.CHM(t);const i=e.oxw().$implicit,s=e.oxw();return e.KtG(s.regenerateCategoryItem(i))}),e._UZ(6,"i",30),e.qZA(),e.TgZ(7,"button",31),e.NdJ("click",function(){e.CHM(t);const i=e.oxw().$implicit,s=e.oxw();return e.KtG(s.deleteCategoryItem(i))}),e._UZ(8,"i",32),e.YNc(9,Ri,1,0,"i",33),e.qZA()()}if(2&n){const t=e.oxw().$implicit;e.xp6(1),e.Udp("--background-color",null==t.category?null:t.category.color),e.xp6(2),e.Oqu(t.category.name),e.xp6(4),e.Q6J("ngClass",e.VKq(6,Ji,t.loadingAction))("disabled",t.loadingAction),e.xp6(2),e.Q6J("ngIf",t.loadingAction)}}function Yi(n,r){1&n&&e.GkF(0)}function Bi(n,r){if(1&n&&e._UZ(0,"socialbee-social-account-lists",35),2&n){const t=e.oxw().$implicit,o=e.oxw();e.Q6J("profileOptions",o.profileOptions)("displayData",o.displayData)("justifyContent","start")("socialAccounts",t.accounts)}}function Gi(n,r){1&n&&e.GkF(0)}function Hi(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",39),e.NdJ("click",function(){e.CHM(t);const i=e.oxw().$implicit,s=e.oxw(3);return e.KtG(s.toggleReadMore(i))}),e._uU(1),e.qZA()}if(2&n){const t=e.oxw().$implicit,o=e.oxw(3);e.xp6(1),e.Oqu(o.showReadMore.get(t.id)?" Read Less":"... Read More")}}function Vi(n,r){1&n&&e.GkF(0)}function Ki(n,r){if(1&n&&(e.TgZ(0,"div"),e._UZ(1,"img",40),e.qZA()),2&n){const t=r.$implicit;e.xp6(1),e.Q6J("src",t.baseDataUrl,e.LSH)}}function ji(n,r){if(1&n&&e.YNc(0,Ki,2,1,"div",7),2&n){const t=e.oxw().$implicit;e.Q6J("ngForOf",t.files)}}function Wi(n,r){if(1&n&&(e.ynx(0),e.TgZ(1,"div"),e._UZ(2,"span",36),e.ALo(3,"truncate"),e.YNc(4,Hi,2,1,"span",37),e.qZA(),e.YNc(5,Vi,1,0,"ng-container",20),e.YNc(6,ji,1,1,"ng-template",null,38,e.W1O),e.BQk()),2&n){const t=r.$implicit,o=e.MAs(7),i=e.oxw(2).$implicit,s=e.oxw(),c=e.MAs(23);e.xp6(2),e.Q6J("innerHTML",e.Dn7(3,5,t,!s.showReadMore.get(t.id),s.showReadMoreLength),e.oJD),e.xp6(2),e.Q6J("ngIf",t.text.length>s.showReadMoreLength),e.xp6(1),e.Q6J("ngIf",i.loadingImage)("ngIfThen",c)("ngIfElse",o)}}function zi(n,r){if(1&n&&e.YNc(0,Wi,8,9,"ng-container",7),2&n){const t=e.oxw().$implicit;e.Q6J("ngForOf",t.variants)}}function $i(n,r){if(1&n&&(e.ynx(0),e.TgZ(1,"div",16)(2,"div",17),e._UZ(3,"div",18),e.TgZ(4,"div",19),e.YNc(5,Qi,1,0,"ng-container",20),e.YNc(6,qi,10,8,"ng-template",null,21,e.W1O),e.qZA()(),e.TgZ(8,"div",22),e.YNc(9,Yi,1,0,"ng-container",20),e.YNc(10,Bi,1,4,"ng-template",null,23,e.W1O),e.qZA(),e.TgZ(12,"div",24),e.YNc(13,Gi,1,0,"ng-container",20),e.YNc(14,zi,1,1,"ng-template",null,25,e.W1O),e.qZA()(),e.BQk()),2&n){const t=r.$implicit,o=e.MAs(7),i=e.MAs(11),s=e.MAs(15);e.oxw();const c=e.MAs(17),p=e.MAs(19),g=e.MAs(21);e.xp6(3),e.Udp("--border-color",null==t.category?null:t.category.color),e.xp6(2),e.Q6J("ngIf",t.loadingItem)("ngIfThen",c)("ngIfElse",o),e.xp6(4),e.Q6J("ngIf",t.loadingItem)("ngIfThen",p)("ngIfElse",i),e.xp6(4),e.Q6J("ngIf",t.loadingItem)("ngIfThen",g)("ngIfElse",s)}}const ne=function(){return{"m-2":!0}},Xi=function(){return{width:"10px",height:"10px"}},er=function(){return{height:"10px"}},xe=function(){return{"m-0 my-2":!0}},Ke=function(){return{height:"16px",width:"16px"}};function tr(n,r){1&n&&(e.TgZ(0,"div",41),e._UZ(1,"socialbee-skeleton-loader-extended",42)(2,"socialbee-skeleton-loader-extended",43),e.qZA(),e.TgZ(3,"div",44),e._UZ(4,"socialbee-skeleton-loader-extended",45)(5,"socialbee-skeleton-loader-extended",45),e.qZA()),2&n&&(e.xp6(1),e.Q6J("center",!0)("classOverride",e.DdM(13,ne))("appearance","circle")("styleOverride",e.DdM(14,Xi)),e.xp6(1),e.Q6J("appearance","rounded-square")("styleOverride",e.DdM(15,er))("classOverride",e.DdM(16,xe)),e.xp6(2),e.Q6J("appearance","rounded-square")("classOverride",e.DdM(17,ne))("styleOverride",e.DdM(18,Ke)),e.xp6(1),e.Q6J("appearance","rounded-square")("classOverride",e.DdM(19,xe))("styleOverride",e.DdM(20,Ke)))}const nr=function(){return{"m-1":!0}},or=function(){return{width:"20px",height:"20px"}};function ir(n,r){1&n&&(e.ynx(0),e._UZ(1,"socialbee-skeleton-loader-extended",42),e.BQk()),2&n&&(e.xp6(1),e.Q6J("center",!0)("classOverride",e.DdM(4,nr))("appearance","circle")("styleOverride",e.DdM(5,or)))}const rr=function(){return[]};function sr(n,r){1&n&&(e.TgZ(0,"div",46),e.YNc(1,ir,2,6,"ng-container",7),e.qZA()),2&n&&(e.xp6(1),e.Q6J("ngForOf",e.DdM(1,rr).constructor(3)))}const je=function(){return{height:"10px",width:"100%"}},ar=function(){return{height:"10px",width:"80%"}};function cr(n,r){1&n&&(e._UZ(0,"socialbee-skeleton-loader-extended",45)(1,"socialbee-skeleton-loader-extended",45)(2,"socialbee-skeleton-loader-extended",45),e.GkF(3,null,15)),2&n&&(e.Q6J("appearance","rounded-square")("classOverride",e.DdM(9,ne))("styleOverride",e.DdM(10,je)),e.xp6(1),e.Q6J("appearance","rounded-square")("classOverride",e.DdM(11,ne))("styleOverride",e.DdM(12,je)),e.xp6(1),e.Q6J("appearance","rounded-square")("classOverride",e.DdM(13,ne))("styleOverride",e.DdM(14,ar)))}const lr=function(){return{height:"400px",width:"100%"}};function dr(n,r){1&n&&(e.TgZ(0,"socialbee-skeleton-loader-extended",45),e._UZ(1,"socialbee-progress-spinner",47),e.qZA()),2&n&&(e.Q6J("appearance","custom-content")("classOverride",e.DdM(6,xe))("styleOverride",e.DdM(7,lr)),e.xp6(1),e.Q6J("imageSrc","assets/images/loading/image-loader.svg")("showSpinner",!0)("size","small"))}let pr=(()=>{class n{constructor(t,o,i,s,c,p){this.copilotService=t,this.router=o,this.eventBusService=i,this.toastService=s,this.alertService=c,this.analyticsService=p,this.showReadMore=new Map,this.loadingTitle="",this.showReadMoreLength=150,this.CATEGORY_ITEM_LIMIT=6,this.TOAST_ID="toast_copilot_posts",this.categoryItems=[],this.profileOptions=new A(x.SMALL,y.HORIZONTAL,!1,!1,!0,!0,!1,!0),this.displayData={containerName:"social-icons-container",profileSize:36,plusSize:36,textSize:0,postsForLimit:2,profileSpace:!0},this.generatingData=!1,this.showErrorMessage=!1}ngOnInit(){this.analyticsService.trackEvent("Loaded Generated Posts"),this.eventBusService.nextCopilotStage(v.GENERATED_POSTS),this.fetchCategoryItems()}moveToNextStep(){this.analyticsService.trackEvent("View Posting Plan",{}),this.router.navigate(["/copilot/scheduler"])}deleteCategoryItem(t){this.analyticsService.trackEvent("Delete Post",{}),t.loadingAction=!0,this.copilotService.deleteCategoryItem(t).subscribe(()=>{this.categoryItems=this.categoryItems.filter(o=>o.id!==t.id),this.showToastForGenerateMorePosts()},()=>{this.alertService.error("An error occurred while deleting the post. Please try again."),t.loadingAction=!1})}regenerateCategoryItem(t){this.analyticsService.trackEvent("Regenerate post",{}),t.loadingItem=!0,this.copilotService.regenerateCategoryItem(t).subscribe(o=>{t.loadingItem=!1,this.categoryItems=this.categoryItems.map(i=>i.id===t.id?o:i)},()=>{t.loadingItem=!1,this.alertService.error("An error occurred while regenerating the post. Please try again.")})}loadingErrorEvent(t){this.showErrorMessage=t}toggleReadMore(t){this.showReadMore.get(t.id)?this.showReadMore.delete(t.id):this.showReadMore.set(t.id,!0)}fetchCategoryItems(){this.copilotService.getCategoryItems().subscribe(t=>{this.categoryItems=t,this.showToastForGenerateMorePosts(),this.categoryItems.forEach(o=>{this.generateCategoryItemImage(o)})},()=>{this.alertService.error("An error occurred while fetching the posts. Please try again.")})}showToastForGenerateMorePosts(){this.categoryItems.length<=this.CATEGORY_ITEM_LIMIT?this.toastService.isToastOpen(this.TOAST_ID)||(this.toastService.show(`A strong posting plan requires more than ${this.CATEGORY_ITEM_LIMIT} posts.`,"gray",!1,0,!0,!0,"Generate more posts",this.TOAST_ID),this.toastService.getToastAction().subscribe(t=>{t&&t.id===this.TOAST_ID&&this.generateMorePosts()})):this.toastService.remove(this.TOAST_ID)}generateMorePosts(){this.analyticsService.trackEvent("Generate More Post",{}),this.generatingData=!0,this.loadingTitle="Creating post ideas tailored to your brand and audience\u2026",setTimeout(()=>{this.loadingTitle="Adding the finishing touches to your content \u2014 just a moment!"},2500),this.copilotService.generateCategoryItems(!0).subscribe(()=>{this.fetchCategoryItems(),this.generatingData=!1},()=>{this.generatingData=!1,this.showErrorMessage=!0})}generateCategoryItemImage(t){this.categoryItemHasImage(t)||(t.loadingImage=!0,this.copilotService.generateCategoryItemImage(t).subscribe(o=>{t.loadingImage=!1,this.categoryItems=this.categoryItems.map(i=>i.id===t.id?o:i)},()=>{t.loadingImage=!1,this.alertService.error("An error occurred while generating the image for the post. Please try again.")}))}categoryItemHasImage(t){return t.variants.some(o=>o.files&&o.files.length>0)}static{this.\u0275fac=function(o){return new(o||n)(e.Y36(k),e.Y36(O.F0),e.Y36(V),e.Y36(G),e.Y36(P),e.Y36(D))}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-copilot-posts"]],decls:24,vars:6,consts:[[3,"spinnerName","showSpinner","loadingTitle"],[3,"showSpinner","closeLoadingEvent"],[1,"d-flex","flex-column"],[1,"title"],[1,"mb-3"],[1,"main-posts-container","border"],[1,"posts","p-3","d-flex","flex-wrap"],[4,"ngFor","ngForOf"],[1,"d-flex","flex-column","align-items-center","justify-content-center","mt-4","pb-4"],[1,"info-text","mb-2"],["type","button",1,"d-flex","align-items-baseline","btn","btn-primary-socialbee",3,"disabled","click"],[1,"m-0"],["loadingItemHeader",""],["loadingItemAccounts",""],["loadingItemBody",""],["loadingItemBodyImage",""],[1,"d-flex","flex-column","post-card","mb-3"],[1,"border-bottom"],[1,"custom-border-top"],[1,"px-3","py-2","d-flex","justify-content-sm-between"],[4,"ngIf","ngIfThen","ngIfElse"],["categoryItemHeader",""],[1,"px-4","py-2","border-bottom"],["categoryItemAccounts",""],[1,"px-3","py-2","border-top"],["categoryItemBody",""],[1,"category-color","text-center","rounded-circle","p-1","m-0","text-nowrap"],[1,"ms-1","label-font-size","text-center","m-0","p-0"],[1,"flex-shrink-0"],[1,"btn",3,"click"],[1,"fa-kit","fa-retry","fa-sm"],[1,"btn",3,"ngClass","disabled","click"],[1,"fa-kit","fa-trash-svg","fa-sm","me-2"],["class","fa fa-spin fa-spinner","aria-hidden","true",4,"ngIf"],["aria-hidden","true",1,"fa","fa-spin","fa-spinner"],[3,"profileOptions","displayData","justifyContent","socialAccounts"],[3,"innerHTML"],["class","variant-text-more",3,"click",4,"ngIf"],["categoryItemBodyImage",""],[1,"variant-text-more",3,"click"],["alt","generated",1,"d-block","w-100","image-card",3,"src"],[1,"d-flex","flex-row","align-items-center"],[3,"center","classOverride","appearance","styleOverride"],[3,"appearance","styleOverride","classOverride"],[1,"d-flex","flex-row","justify-content-end","align-items-center"],[3,"appearance","classOverride","styleOverride"],[1,"d-flex","flex-row"],[3,"imageSrc","showSpinner","size"]],template:function(o,i){1&o&&(e._UZ(0,"socialbee-progress-spinner",0),e.TgZ(1,"socialbee-loading-error",1),e.NdJ("closeLoadingEvent",function(c){return i.loadingErrorEvent(c)}),e.qZA(),e.TgZ(2,"div",2)(3,"span",3),e._uU(4,"Here are some social media post ideas to help you engage your audience and boost your online presence."),e.qZA(),e.TgZ(5,"span",4),e._uU(6,"You can edit these examples later in SocialBee."),e.qZA(),e.TgZ(7,"div",5)(8,"div",6),e.YNc(9,$i,16,11,"ng-container",7),e.qZA()(),e.TgZ(10,"div",8)(11,"span",9),e._uU(12,"Get a visual, calendar-like overview of your upcoming social media posts."),e.qZA(),e.TgZ(13,"button",10),e.NdJ("click",function(){return i.moveToNextStep()}),e.TgZ(14,"span",11),e._uU(15,"View posting plan"),e.qZA()()()(),e.YNc(16,tr,6,21,"ng-template",null,12,e.W1O),e.YNc(18,sr,2,2,"ng-template",null,13,e.W1O),e.YNc(20,cr,5,15,"ng-template",null,14,e.W1O),e.YNc(22,dr,2,8,"ng-template",null,15,e.W1O)),2&o&&(e.Q6J("spinnerName","generateMoreSpinner")("showSpinner",i.generatingData)("loadingTitle",i.loadingTitle),e.xp6(1),e.Q6J("showSpinner",i.showErrorMessage),e.xp6(8),e.Q6J("ngForOf",i.categoryItems),e.xp6(4),e.Q6J("disabled",i.categoryItems.length<=i.CATEGORY_ITEM_LIMIT))},dependencies:[a.mk,a.sg,a.O5,te,be,ge,Di,Li],styles:[".title[_ngcontent-%COMP%]{font-size:1rem;font-weight:700}.main-posts-container[_ngcontent-%COMP%]{height:62vh;overflow-y:scroll;background-color:var(--cp-sb-background-accent-color);border-radius:8px}.main-posts-container[_ngcontent-%COMP%] .posts[_ngcontent-%COMP%]{gap:16px}.main-posts-container[_ngcontent-%COMP%] .posts[_ngcontent-%COMP%] .post-card[_ngcontent-%COMP%]{background-color:var(--cp-sb-background-main-color);border-radius:8px;break-inside:avoid;flex:0 0 24%}.main-posts-container[_ngcontent-%COMP%] .posts[_ngcontent-%COMP%] .post-card[_ngcontent-%COMP%] .image-card[_ngcontent-%COMP%]{border-radius:8px;max-height:100%;max-width:100%}.main-posts-container[_ngcontent-%COMP%] .posts[_ngcontent-%COMP%] .post-card[_ngcontent-%COMP%] .variant-text-more[_ngcontent-%COMP%]{font-weight:600;pointer-events:visible;cursor:pointer}.custom-border-top[_ngcontent-%COMP%]{border-top:6px solid var(--border-color)!important;border-top-left-radius:8px;border-top-right-radius:8px}.border-radius-bottom[_ngcontent-%COMP%]{border-bottom-left-radius:8px;border-bottom-right-radius:8px}.category-color[_ngcontent-%COMP%]{background-color:var(--background-color)!important}@media (max-width: 1560px){.main-posts-container[_ngcontent-%COMP%] .posts[_ngcontent-%COMP%] .post-card[_ngcontent-%COMP%]{flex:0 0 32.5%}}@media (max-width: 1150px){.main-posts-container[_ngcontent-%COMP%] .posts[_ngcontent-%COMP%] .post-card[_ngcontent-%COMP%]{flex:0 0 49%}}@media (max-width: 760px){.main-posts-container[_ngcontent-%COMP%] .posts[_ngcontent-%COMP%] .post-card[_ngcontent-%COMP%]{flex:0 0 99%}}"]})}}return n})();var f=function(n){return n[n.Day=1]="Day",n[n.FourDays=4]="FourDays",n[n.Week=7]="Week",n[n.Month=30]="Month",n}(f||{}),oe=l(9773);class gr{constructor(r,t,o,i,s,c,p,g){this.hour=r,this.minute=t,this.days=o,this.day=i,this.type=s,this.timeId=c,this.category=p,this.accounts=g}}let ur=(()=>{class n{constructor(t){this.copilotService=t}openPreviewSidebar(t){}getContentPreview(t,o,i){const s=(0,Qe.Z)(t),c=(0,Ce.Z)(o);return this.copilotService.getCategoryItemsPreview(s,c,i)}validateItem(t){return!(!t.category||!t.id)}createInitialSchedule(t,o,i){const p=new Date,g=((o?.getDay()??p.getDay())+6)%7,m=i??p.getHours(),C=i?0:p.getMinutes();return{schedule:new gr(m,C,[g]),categories:t}}static{this.\u0275fac=function(o){return new(o||n)(e.LFG(k))}}static{this.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var S=function(n){return n.CALENDAR="calendar-view",n.LIST="list-view",n.OVERVIEW="overview",n}(S||{}),hr=l(3997);let We=(()=>{class n{constructor(){this.STORAGE_KEY="schedulerState",this.dataChanged=new X.x,this.user=null,this.accounts=[],this.dataChanged$=this.dataChanged.asObservable(),this.destroy$=new X.x,this.state=new _e.X(this.getInitialState()),this.schedulerViewMode$=this.state.pipe((0,le.U)(t=>t.schedulerViewMode),(0,hr.x)()),this.state.pipe((0,oe.R)(this.destroy$)).subscribe(t=>{this.saveStateToSession(t)})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.state.complete()}get socialAccounts(){return this.accounts}get selectedProfile(){return this.state.getValue().filters.selectedProfile}get selectedCategory(){return this.state.getValue().filters.selectedCategory}updateStateOnViewModeChange(t){const o=this.getProfileForViewMode(t);this.updateState({schedulerViewMode:t,filters:{selectedProfile:o,selectedCategory:void 0}})}setDateMode(t){this.updateState({dateMode:t})}setSelectedProfile(t){this.updateState({filters:{selectedProfile:t}})}setSelectedCategory(t){this.updateState({filters:{selectedCategory:t}})}setDisplayDate(t){this.updateState({filters:{displayDate:t}})}notifyDataChanged(){this.dataChanged.next()}setupState(){return{schedulerViewMode:S.CALENDAR,dateMode:f.Week,filters:{displayDate:new Date,selectedProfile:this.accounts[0]}}}updateState(t){const o=this.state.getValue(),i=this.createNewState(o,t);this.state.next(i)}createNewState(t,o){return{schedulerViewMode:o.schedulerViewMode??t.schedulerViewMode,dateMode:o.dateMode??t.dateMode,filters:o.filters?{...t.filters,...o.filters}:t.filters}}getProfileForViewMode(t,o){const i=this.state?.getValue().filters.selectedProfile||o;return t===S.OVERVIEW?this.accounts.length<10?void 0:this.accounts[0]:i||this.accounts[0]}getInitialState(){const t=this.loadStateFromSession();if(!t)return this.setupState();const o=t.schedulerViewMode??S.CALENDAR,i=t.filters?.displayDate?new Date(t.filters.displayDate):new Date,s=this.getProfileForViewMode(o,t.filters?.selectedProfile);return{schedulerViewMode:o,dateMode:t.dateMode??f.Week,filters:{displayDate:i,selectedProfile:s,selectedCategory:t.filters?.selectedCategory}}}updateSelectedProfileAfterAccountsChange(){const{filters:{selectedProfile:t}}=this.state.getValue();(!t||!this.accounts.some(o=>o.id===t.id))&&this.updateState({filters:{selectedProfile:this.accounts[0]}})}saveStateToSession(t){const o={...t,filters:{...t.filters,displayDate:t.filters.displayDate.toISOString()}};sessionStorage.setItem(this.STORAGE_KEY,JSON.stringify(o))}loadStateFromSession(){const t=sessionStorage.getItem(this.STORAGE_KEY);return t?JSON.parse(t):null}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var L=function(n){return n.DETAILED="detailed",n.COMPACT="compact",n}(L||{});let fr=(()=>{class n{transform(t){if(t.status===w.SCHEDULED&&t.item.isSpecific)return"Specific time";switch(t.status){case w.FAILED:return"Failed";case w.PUBLISHED:return"Published";case w.SCHEDULED:return"Scheduled";case w.DRAFT:return"Draft";default:return"Unknown"}}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275pipe=e.Yjl({name:"scheduleEntryState",type:n,pure:!0})}}return n})();function _r(n,r){1&n&&e._UZ(0,"i",10)}function mr(n,r){if(1&n&&(e.TgZ(0,"div",11),e._uU(1),e.ALo(2,"scheduleEntryState"),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Oqu(e.lcZ(2,1,t.scheduleEntry))}}function Cr(n,r){1&n&&e._UZ(0,"socialbee-specific-time-indicator",11)}function vr(n,r){if(1&n&&(e.ynx(0),e._UZ(1,"socialbee-social-account-lists",12),e.BQk()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("justifyContent","end")("socialAccounts",null==t.scheduleEntry||null==t.scheduleEntry.item?null:t.scheduleEntry.item.accounts)}}function br(n,r){1&n&&(e.TgZ(0,"div",13),e._uU(1," No posts "),e._UZ(2,"i",14),e.qZA())}const Or=function(n){return{"background-color":n}},Pr=function(n){return{"text-muted":n}};let Mr=(()=>{class n{constructor(){this.cardType=L.COMPACT,this.hasVariant=!1,this.SchedulerPostCardType=L,this.isScheduleEntryFailed=Be,this.isScheduleEntryPublished=Un,this.isSpecificTime=Qn}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-scheduler-post-card-header"]],inputs:{cardType:"cardType",scheduleEntry:"scheduleEntry",hasVariant:"hasVariant"},decls:16,vars:22,consts:[[3,"ngStyle"],[1,"col-left","d-flex","flex-column","overflow-hidden"],[1,"text-nowrap","text-truncate","font-weight-bold","mb-0"],[1,"d-flex","align-items-center","text-nowrap","text-truncatep-0","mb-0",3,"ngClass"],["class","fa-kit fa-failed me-1",4,"ngIf"],["class","me-1",4,"ngIf"],[1,"m-0"],[1,"col-right","d-flex","flex-column","align-items-end"],[4,"ngIf","ngIfElse"],["noPostsIndicator",""],[1,"fa-kit","fa-failed","me-1"],[1,"me-1"],[1,"me-2",3,"justifyContent","socialAccounts"],[1,"d-flex","align-items-center","no-posts-indicator"],[1,"fas","fa-exclamation-triangle","ms-1"]],template:function(o,i){if(1&o&&(e.TgZ(0,"div",0),e.ALo(1,"scheduleEntryStateColor"),e.TgZ(2,"div",1)(3,"div",2),e._uU(4),e.qZA(),e.TgZ(5,"div",3),e.YNc(6,_r,1,0,"i",4),e.YNc(7,mr,3,3,"div",5),e.YNc(8,Cr,1,0,"socialbee-specific-time-indicator",5),e.TgZ(9,"div",6),e._uU(10),e.ALo(11,"date"),e.qZA()()(),e.TgZ(12,"div",7),e.YNc(13,vr,2,2,"ng-container",8),e.YNc(14,br,3,0,"ng-template",null,9,e.W1O),e.qZA()()),2&o){const s=e.MAs(15);e.Gre("card-header scheduler-post-card-header ",i.cardType," d-flex justify-content-between py-1 px-2 m-0 border-0 rounded-0"),e.Q6J("ngStyle",e.VKq(18,Or,e.lcZ(1,12,i.scheduleEntry))),e.xp6(4),e.hij(" ",(null==i.scheduleEntry.item.category?null:i.scheduleEntry.item.category.name)||"Random Category"," "),e.xp6(1),e.Q6J("ngClass",e.VKq(20,Pr,i.isScheduleEntryPublished(i.scheduleEntry))),e.xp6(1),e.Q6J("ngIf",i.isScheduleEntryFailed(i.scheduleEntry)),e.xp6(1),e.Q6J("ngIf",i.cardType!==i.SchedulerPostCardType.COMPACT&&!i.isSpecificTime(i.scheduleEntry)),e.xp6(1),e.Q6J("ngIf",i.isSpecificTime(i.scheduleEntry)),e.xp6(2),e.Oqu(e.Dn7(11,14,i.scheduleEntry.item.scheduleDate,"HH:mm",i.timezone)),e.xp6(3),e.Q6J("ngIf",i.hasVariant)("ngIfElse",s)}},dependencies:[a.mk,a.O5,a.PC,be,Ye,a.uU,Ge,fr],styles:[".scheduler-post-card-header{cursor:default}.scheduler-post-card-header .col-left{flex:1}.scheduler-post-card-header .fa-exclamation-triangle,.scheduler-post-card-header .fa-failed{color:var(--cp-sb-error-icon)}.scheduler-post-card-header .social-icons-container{margin-bottom:0!important}.scheduler-post-card-header.compact *{font-size:.625rem}\n"],encapsulation:2})}}return n})();var ze=function(n){return n.RETRY="Retry",n.DELETE="Delete",n.REQUEUE="Requeue",n.EDIT="Edit",n.POST_NOW="Post now",n.PREVIEW="Preview",n.ADD_POST="Add post",n.ADD_NOTE="Add note",n.DUPLICATE="Duplicate",n}(ze||{});function Tr(n,r){1&n&&e.GkF(0)}const xr=function(n){return{url:n,styles:""}};function yr(n,r){if(1&n&&(e.ynx(0),e.YNc(1,Tr,1,0,"ng-container",10),e.BQk()),2&n){const t=r.ngIf;e.oxw(3);const o=e.MAs(5);e.xp6(1),e.Q6J("ngTemplateOutlet",o)("ngTemplateOutletContext",e.VKq(2,xr,t))}}function wr(n,r){1&n&&e.GkF(0)}function Sr(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",7),e.NdJ("click",function(i){e.CHM(t);const s=e.oxw(2);return e.KtG(s.previewPost(i))}),e.YNc(1,yr,2,4,"ng-container",8),e.YNc(2,wr,1,0,"ng-container",9),e.qZA()}if(2&n){const t=e.oxw(2),o=e.MAs(7);e.xp6(1),e.Q6J("ngIf",t.previewImageUrl),e.xp6(1),e.Q6J("ngTemplateOutlet",o)}}function kr(n,r){if(1&n&&(e.ynx(0),e.YNc(1,Sr,3,2,"div",6),e.BQk()),2&n){const t=e.oxw(),o=e.MAs(9);e.xp6(1),e.Q6J("ngIf",t.variant)("ngIfElse",o)}}function Ir(n,r){1&n&&e.GkF(0)}function Ar(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",12),e.NdJ("click",function(i){e.CHM(t);const s=e.oxw(2);return e.KtG(s.previewPost(i))}),e.YNc(1,Ir,1,0,"ng-container",9),e.qZA()}if(2&n){e.oxw(2);const t=e.MAs(7);e.xp6(1),e.Q6J("ngTemplateOutlet",t)}}function Er(n,r){if(1&n&&(e.ynx(0),e.YNc(1,Ar,2,1,"div",11),e.BQk()),2&n){const t=e.oxw(),o=e.MAs(11);e.xp6(1),e.Q6J("ngIf",t.variant)("ngIfElse",o)}}function Zr(n,r){1&n&&e._UZ(0,"i",16)}function Nr(n,r){if(1&n&&(e.TgZ(0,"div",13),e._UZ(1,"img",14),e.YNc(2,Zr,1,0,"i",15),e.qZA()),2&n){const t=r.url,o=e.oxw();e.xp6(1),e.Q6J("src",t,e.LSH),e.xp6(1),e.Q6J("ngIf",o.isVideo)}}function Ur(n,r){if(1&n&&(e.TgZ(0,"div",17),e._uU(1),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Oqu(null==t.variant?null:t.variant.text)}}function Dr(n,r){1&n&&(e.TgZ(0,"div",18),e.NdJ("click",function(o){return o.stopPropagation()}),e._uU(1," This category has no posts. Connect with your audience by adding posts in this category. "),e.qZA())}function Fr(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",19),e.NdJ("click",function(i){e.CHM(t);const s=e.oxw();return e.KtG(s.openAddPostModal(i))}),e._UZ(1,"i",20),e.TgZ(2,"div",21),e._uU(3),e.ALo(4,"translate"),e.qZA()()}2&n&&(e.xp6(3),e.Oqu(e.lcZ(4,1,"scheduler.buttons.add-post")))}let Lr=(()=>{class n{constructor(){this.cardType=L.COMPACT,this.actionClicked=new e.vpe,this.isVideo=!1,this.SchedulerPostCardType=L}get previewImageUrl(){if(this.variant&&this.variant.files&&this.variant.files.length>0){const t=this.variant.files[0];if(t.type?.startsWith("image/"))return t.baseDataUrl||"";if(t.type?.startsWith("video/"))return this.isVideo=!0,t.thumbnail?.baseDataUrl||""}return""}previewPost(t){t.stopPropagation(),this.actionClicked.emit(ze.PREVIEW)}openAddPostModal(t){t.stopPropagation()}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-scheduler-post-card-body"]],inputs:{cardType:"cardType",variant:"variant",category:"category"},outputs:{actionClicked:"actionClicked"},decls:12,vars:6,consts:[[3,"ngSwitch"],[4,"ngSwitchCase"],["imagePreview",""],["textPreview",""],["detailedNoPostsBody",""],["compactNoPostsBody",""],["class","d-flex justify-content-start align-items-center p-2 mt-1 mx-1",3,"click",4,"ngIf","ngIfElse"],[1,"d-flex","justify-content-start","align-items-center","p-2","mt-1","mx-1",3,"click"],[4,"ngIf"],[4,"ngTemplateOutlet"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["class","d-flex justify-content-start align-items-center p-1 mx-1",3,"click",4,"ngIf","ngIfElse"],[1,"d-flex","justify-content-start","align-items-center","p-1","mx-1",3,"click"],[1,"image-container","position-relative","mr-3"],["alt","",1,"rounded",3,"src"],["class","fas fa-play position-absolute",4,"ngIf"],[1,"fas","fa-play","position-absolute"],[1,"mb-0","text-preview-container","w-100"],[1,"px-2","pt-1","my-1","mx-1","text-preview-container","no-posts",3,"click"],[1,"d-flex","flex-row","justify-content-center","align-items-center","py-3","my-1","w-100","add-post",3,"click"],[1,"fas","fa-plus","px-2","font-weight-light"],[1,"font-weight-bold"]],template:function(o,i){1&o&&(e.TgZ(0,"div"),e.ynx(1,0),e.YNc(2,kr,2,2,"ng-container",1),e.YNc(3,Er,2,2,"ng-container",1),e.BQk(),e.qZA(),e.YNc(4,Nr,3,2,"ng-template",null,2,e.W1O),e.YNc(6,Ur,2,1,"ng-template",null,3,e.W1O),e.YNc(8,Dr,2,0,"ng-template",null,4,e.W1O),e.YNc(10,Fr,5,3,"ng-template",null,5,e.W1O)),2&o&&(e.Gre("card-body scheduler-post-card-body ",i.cardType," p-0"),e.xp6(1),e.Q6J("ngSwitch",i.cardType),e.xp6(1),e.Q6J("ngSwitchCase",i.SchedulerPostCardType.DETAILED),e.xp6(1),e.Q6J("ngSwitchCase",i.SchedulerPostCardType.COMPACT))},dependencies:[a.O5,a.tP,a.RF,a.n9,B.X$],styles:[".scheduler-post-card-body.detailed[_ngcontent-%COMP%] .text-preview-container[_ngcontent-%COMP%]{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;height:3.9rem;-webkit-line-clamp:3}.scheduler-post-card-body.detailed[_ngcontent-%COMP%] .no-posts[_ngcontent-%COMP%]{cursor:default}.scheduler-post-card-body.compact[_ngcontent-%COMP%] .text-preview-container[_ngcontent-%COMP%]{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;height:2.6rem;-webkit-line-clamp:2}.scheduler-post-card-body[_ngcontent-%COMP%] .add-post[_ngcontent-%COMP%]{line-height:1.75rem}.scheduler-post-card-body[_ngcontent-%COMP%] .image-container[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:3.125rem;height:3.125rem}.scheduler-post-card-body[_ngcontent-%COMP%] .image-container[_ngcontent-%COMP%] .fa-play[_ngcontent-%COMP%]{top:50%;font-size:1rem;color:#fff}html[dir=ltr][_ngcontent-%COMP%] .scheduler-post-card-body[_ngcontent-%COMP%] .image-container[_ngcontent-%COMP%] .fa-play[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .scheduler-post-card-body[_ngcontent-%COMP%] .image-container[_ngcontent-%COMP%] .fa-play[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .scheduler-post-card-body[_ngcontent-%COMP%] .image-container[_ngcontent-%COMP%] .fa-play[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .scheduler-post-card-body[_ngcontent-%COMP%] .image-container[_ngcontent-%COMP%] .fa-play[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .scheduler-post-card-body[_ngcontent-%COMP%] .image-container[_ngcontent-%COMP%] .fa-play[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .scheduler-post-card-body[_ngcontent-%COMP%] .image-container[_ngcontent-%COMP%] .fa-play[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .scheduler-post-card-body[_ngcontent-%COMP%] .image-container[_ngcontent-%COMP%] .fa-play[_ngcontent-%COMP%]{left:50%;transform:translate(-50%,-50%)}html[dir=rtl][_ngcontent-%COMP%] .scheduler-post-card-body[_ngcontent-%COMP%] .image-container[_ngcontent-%COMP%] .fa-play[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .scheduler-post-card-body[_ngcontent-%COMP%] .image-container[_ngcontent-%COMP%] .fa-play[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .scheduler-post-card-body[_ngcontent-%COMP%] .image-container[_ngcontent-%COMP%] .fa-play[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .scheduler-post-card-body[_ngcontent-%COMP%] .image-container[_ngcontent-%COMP%] .fa-play[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .scheduler-post-card-body[_ngcontent-%COMP%] .image-container[_ngcontent-%COMP%] .fa-play[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .scheduler-post-card-body[_ngcontent-%COMP%] .image-container[_ngcontent-%COMP%] .fa-play[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .scheduler-post-card-body[_ngcontent-%COMP%] .image-container[_ngcontent-%COMP%] .fa-play[_ngcontent-%COMP%]{right:50%;transform:translate(50%,-50%)}"]})}}return n})();function Qr(n,r){if(1&n&&(e.TgZ(0,"div",3),e._UZ(1,"socialbee-post-type-icons",4),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("variant",t.variant)}}function Rr(n,r){if(1&n&&(e.ynx(0),e.YNc(1,Qr,2,1,"div",2),e.BQk()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.variant)}}let Jr=(()=>{class n{constructor(){this.cardType=L.COMPACT,this.scheduleEntryStatus=w.DRAFT,this.SchedulerPostCardType=L}ngOnInit(){}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-scheduler-post-card-footer"]],inputs:{cardType:"cardType",variant:"variant",scheduleEntryStatus:"scheduleEntryStatus",category:"category"},decls:3,vars:5,consts:[[3,"ngSwitch"],[4,"ngSwitchCase"],["class","d-flex justify-content-start pb-1 px-2",4,"ngIf"],[1,"d-flex","justify-content-start","pb-1","px-2"],[1,"d-flex","justify-content-center","align-items-center",3,"variant"]],template:function(o,i){1&o&&(e.TgZ(0,"div"),e.ynx(1,0),e.YNc(2,Rr,2,1,"ng-container",1),e.BQk(),e.qZA()),2&o&&(e.Gre("card-footer scheduler-post-card-footer ",i.cardType," d-flex w-100 border-0 p-0"),e.xp6(1),e.Q6J("ngSwitch",i.cardType),e.xp6(1),e.Q6J("ngSwitchCase",i.SchedulerPostCardType.COMPACT))},dependencies:[a.O5,a.RF,a.n9,qe],styles:[".scheduler-post-card-footer[_ngcontent-%COMP%]{cursor:default}.scheduler-post-card-footer[_ngcontent-%COMP%] .add-post-button[_ngcontent-%COMP%]{line-height:1.5rem;background-color:#f5c400}.scheduler-post-card-footer[_ngcontent-%COMP%] .footer-action[_ngcontent-%COMP%]{cursor:pointer;padding:0 2px}.scheduler-post-card-footer[_ngcontent-%COMP%] .footer-action[_ngcontent-%COMP%]:hover .action-label[_ngcontent-%COMP%]{text-decoration:underline}"]})}}return n})();const qr=function(n){return{"border-color":n}},Yr=function(n){return{random:n}};let Br=(()=>{class n{constructor(){this.containerClass="",this.isRandom=Rn}ngOnInit(){this.variant=function Fn(n){return n.variants?.find(r=>r.selectedVariant)||n.variants?.[0]}(this.scheduleEntry.item)}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-scheduler-post-card"]],inputs:{scheduleEntry:"scheduleEntry",cardType:"cardType",containerClass:"containerClass"},decls:4,vars:20,consts:[[3,"ngStyle","ngClass"],[3,"cardType","hasVariant","scheduleEntry","click"],[3,"cardType","category","variant","ngClass"],[3,"cardType","category","scheduleEntryStatus","variant"]],template:function(o,i){1&o&&(e.TgZ(0,"div",0)(1,"socialbee-scheduler-post-card-header",1),e.NdJ("click",function(c){return c.stopPropagation()}),e.qZA(),e._UZ(2,"socialbee-scheduler-post-card-body",2)(3,"socialbee-scheduler-post-card-footer",3),e.qZA()),2&o&&(e.Gre("scheduler-post-card ",i.containerClass," card w-100"),e.Q6J("ngStyle",e.VKq(16,qr,(null==i.scheduleEntry.item.category?null:i.scheduleEntry.item.category.color)||""))("ngClass",e.VKq(18,Yr,i.isRandom(i.scheduleEntry))),e.xp6(1),e.Q6J("cardType",i.cardType)("hasVariant",void 0!==i.variant)("scheduleEntry",i.scheduleEntry),e.xp6(1),e.Q6J("cardType",i.cardType)("category",i.scheduleEntry.item.category)("variant",i.variant)("ngClass",i.cardType),e.xp6(1),e.Q6J("cardType",i.cardType)("category",i.scheduleEntry.item.category)("scheduleEntryStatus",i.scheduleEntry.status)("variant",i.variant))},dependencies:[a.mk,a.PC,Mr,Lr,Jr],styles:[".scheduler-post-card{border-width:.25rem .0625rem .0625rem .0625rem;border-radius:.25rem}html[dir=ltr] .scheduler-post-card.random,[dir=ltr] .scheduler-post-card.random,:host([dir=ltr]) .scheduler-post-card.random,:host-context(html[dir=ltr]) .scheduler-post-card.random,:host-context([dir=ltr]) .scheduler-post-card.random{background:linear-gradient(119deg,#D3FF44 14.03%,#46D7FF 32.28%,#F0A 54.59%,#FF393F 72.44%,#FC0 88.26%) border-box}html[dir=rtl] .scheduler-post-card.random,[dir=rtl] .scheduler-post-card.random,:host([dir=rtl]) .scheduler-post-card.random,:host-context(html[dir=rtl]) .scheduler-post-card.random,:host-context([dir=rtl]) .scheduler-post-card.random{background:linear-gradient(-119deg,#D3FF44 14.03%,#46D7FF 32.28%,#F0A 54.59%,#FF393F 72.44%,#FC0 88.26%) border-box}.scheduler-post-card .card-footer{background-color:var(--cp-sb-background-main-color)}.scheduler-post-card socialbee-scheduler-post-card-body{background:var(--cp-sb-background-main-color)}.scheduler-post-card socialbee-scheduler-post-card-body.compact{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.scheduler-post-card socialbee-scheduler-post-card-footer{background:var(--cp-sb-background-main-color);border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}\n"],encapsulation:2})}}return n})();function Gr(n,r){if(1&n&&(e.ynx(0),e._UZ(1,"socialbee-scheduler-post-card",3),e.BQk()),2&n){const t=r.$implicit,o=e.oxw(2);e.xp6(1),e.Q6J("containerClass","compact-post-card")("scheduleEntry",t)("cardType",o.SchedulerPostCardType.COMPACT)}}function Hr(n,r){if(1&n&&(e.ynx(0),e.YNc(1,Gr,2,3,"ng-container",2),e.BQk()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngForOf",t.scheduleEntries)}}let Vr=(()=>{class n{constructor(){this.CalendarViewMode=f,this.SchedulerPostCardType=L}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-calendar-hour-cell"]],inputs:{calendarMode:"calendarMode",displayDate:"displayDate",scheduleEntries:"scheduleEntries"},decls:2,vars:2,consts:[[3,"ngSwitch"],[4,"ngSwitchCase"],[4,"ngFor","ngForOf"],[1,"px-2","py-1","w-100",3,"containerClass","scheduleEntry","cardType"]],template:function(o,i){1&o&&(e.ynx(0,0),e.YNc(1,Hr,2,1,"ng-container",1),e.BQk()),2&o&&(e.Q6J("ngSwitch",i.calendarMode),e.xp6(1),e.Q6J("ngSwitchCase",i.CalendarViewMode.Week))},dependencies:[a.sg,a.RF,a.n9,Br],styles:[".day-view-card[_ngcontent-%COMP%]{width:100%}@media (min-width: 610px){.day-view-card[_ngcontent-%COMP%]{width:50%}}@media (min-width: 958px){.day-view-card[_ngcontent-%COMP%]{width:33.33%}}@media (min-width: 1258px){.day-view-card[_ngcontent-%COMP%]{width:25%}}"]})}}return n})(),Kr=(()=>{class n{constructor(t){this.el=t,this.entries=new Map,this.isMonthView=!1}ngAfterViewInit(){this.isMonthView||this.scrollToFirstEntry()}scrollToFirstEntry(){const t=Array.from(this.entries.entries()).filter(([,s])=>s.length>0).map(([s])=>parseInt(s.slice(-2),10));if(0===t.length)return;const o=Math.min(...t),i=this.el.nativeElement.querySelector(`.hour-row:nth-child(${o+1})`);i&&i.scrollIntoView({behavior:"smooth",block:"start"})}static{this.\u0275fac=function(o){return new(o||n)(e.Y36(e.SBq))}}static{this.\u0275dir=e.lG2({type:n,selectors:[["","socialbeeCalendarScroll",""]],inputs:{entries:"entries",isMonthView:"isMonthView"}})}}return n})();var ye=l(1083),jr=l(7278),Wr=l(7636),zr=l(8832),ue=l(3279),$e=l(2389);function $r(n,r){if(1&n){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",7),e.NdJ("bsValueChange",function(i){e.CHM(t);const s=e.oxw(2);return e.KtG(s.onDateChange(i))}),e.TgZ(2,"h3"),e._uU(3),e.qZA()(),e.BQk()}if(2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("bsConfig",t.bsConfig)("bsValue",t.displayDate),e.xp6(2),e.Oqu(t.getFormattedDate())}}function Xr(n,r){if(1&n){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",8),e.NdJ("bsValueChange",function(i){e.CHM(t);const s=e.oxw(2);return e.KtG(s.onDateChange(i))})("onShown",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.onDatepickerShown())}),e.TgZ(2,"h3"),e._uU(3),e.qZA()(),e.BQk()}if(2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("bsConfig",t.bsConfig)("bsValue",t.dateRange),e.xp6(2),e.Oqu(t.getFormattedDate())}}function es(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",2)(1,"div")(2,"button",3),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.previous())}),e._UZ(3,"i",4),e.qZA(),e.YNc(4,$r,4,3,"ng-container",5),e.YNc(5,Xr,4,3,"ng-container",5),e.TgZ(6,"button",3),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.next())}),e._UZ(7,"i",6),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(2),e.Q6J("disabled",t.disablePrevious),e.xp6(2),e.Q6J("ngIf",t.dateMode===t.CalendarViewMode.Day||t.dateMode===t.CalendarViewMode.Month),e.xp6(1),e.Q6J("ngIf",t.dateMode===t.CalendarViewMode.FourDays||t.dateMode===t.CalendarViewMode.Week),e.xp6(1),e.Q6J("disabled",t.disableNext)}}let ts=(()=>{class n{constructor(t){this.schedulerState=t,this.displayDate=new Date,this.dateMode=f.Week,this.schedulerMode=S.CALENDAR,this.hasSchedule=!1,this.deleteScheduleRequested=new e.vpe,this.generateScheduleRequested=new e.vpe,this.dateRange=[],this.bsConfig={containerClass:"theme-scheduler",adaptivePosition:!0,minDate:new Date,maxDate:(0,ye.Z)(new Date,2)},this.overviewConfig={deleteButtonText:"",generateButtonText:""},this.disablePrevious=!1,this.disableNext=!1,this.destroy$=new X.x,this.CalendarViewMode=f,this.SchedulerViewMode=S}ngOnInit(){this.schedulerState.state.pipe((0,oe.R)(this.destroy$)).subscribe(t=>{this.displayDate=t.filters.displayDate,this.dateMode=t.schedulerViewMode===S.LIST?f.Week:t.dateMode,this.updateBsConfig(),this.updateDateRange(),this.updateConfig()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}updateConfig(){this.schedulerMode===S.OVERVIEW&&(this.schedulerState.selectedProfile?.id?(this.overviewConfig.deleteButtonText="Clear timeslots for selected profile",this.overviewConfig.generateButtonText="Generate Schedule for selected profile"):(this.overviewConfig.deleteButtonText="Clear timeslots",this.overviewConfig.generateButtonText="Generate Schedule as per best practices"))}onDatepickerShown(){const t=this.getDatePickerInstance();t.valueChange.pipe((0,de.h)(o=>o&&o[0]&&!o[1])).subscribe(o=>{const[i]=o,s=this.getValidDate(i),c=(0,U.Z)(s,this.dateMode-1);t.value=[s,c]})}onDateChange(t){const o=Array.isArray(t)?t[0]:t;this.dateRange=Array.isArray(t)?t:[t],this.displayDate!==o&&this.schedulerState.setDisplayDate(o)}getFormattedDate(){const t={[f.Day]:{pattern:"EEEE, MMMM d, yyyy"},[f.Month]:{pattern:"MMMM, yyyy"},default:(i,s)=>this.formatDateRange(i,s)},o=t[this.dateMode]||t.default;return"function"==typeof o?o(this.dateRange[0],this.dateRange[this.dateRange.length-1]):(0,N.Z)(this.displayDate,o.pattern)}previous(){this.updateDisplayDate(!1)}next(){this.updateDisplayDate(!0)}updateDateRange(){if(this.disableNext=(0,$e.KC)((0,U.Z)(this.displayDate,this.dateMode-1),this.bsConfig.maxDate),this.disablePrevious=(0,$e.KC)(this.displayDate,this.bsConfig.minDate),this.dateMode===f.FourDays||this.dateMode===f.Week){const t=(0,U.Z)(this.displayDate,this.dateMode-1);this.dateRange=t?[this.displayDate,t]:[this.displayDate]}}updateBsConfig(){this.bsConfig={...this.bsConfig,minMode:this.getMinModeForDateMode(),selectFromOtherMonth:!0,showWeekNumbers:!1,minDate:new Date,maxDate:(0,ye.Z)(new Date,2)}}getMinModeForDateMode(){return this.dateMode===f.Month?"month":"day"}updateDisplayDate(t){let o;o=this.dateMode===f.Month?t?(0,ye.Z)(this.displayDate,1):(0,jr.Z)(this.displayDate,1):t?(0,U.Z)(this.displayDate,this.dateMode):(0,Me.Z)(this.displayDate,this.dateMode),o=this.getValidDate(o),this.displayDate=o,this.updateDateRange(),this.schedulerState.setDisplayDate(this.displayDate)}getValidDate(t){const o=(0,U.Z)(t,this.dateMode);if(t>=this.bsConfig.minDate&&o<=this.bsConfig.maxDate)return t;let i=t;return t<this.bsConfig.minDate?i=this.bsConfig.minDate:o>this.bsConfig.maxDate&&(i=(0,Me.Z)(this.bsConfig.maxDate,this.dateMode-1)),i}getDatePickerInstance(){return this.dateRangePicker?._datepicker?.instance}formatDateRange(t,o){const s=(0,Wr.Z)(t,o)&&(0,zr.Z)(t,o)?"d, yyyy":"MMM d, yyyy";return`${(0,N.Z)(t,"MMM d")} - ${(0,N.Z)(o,s)}`}static{this.\u0275fac=function(o){return new(o||n)(e.Y36(We))}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-scheduler-action-menu"]],viewQuery:function(o,i){if(1&o&&e.Gf(ue.FR,5),2&o){let s;e.iGM(s=e.CRH())&&(i.dateRangePicker=s.first)}},inputs:{displayDate:"displayDate",dateMode:"dateMode",schedulerMode:"schedulerMode",hasSchedule:"hasSchedule"},outputs:{deleteScheduleRequested:"deleteScheduleRequested",generateScheduleRequested:"generateScheduleRequested"},decls:2,vars:1,consts:[[1,"d-flex","scheduler-calendar-header","py-3","px-4","flex-grow-1"],["class","d-flex justify-content-center align-items-center view-date flex-1",4,"ngIf"],[1,"d-flex","justify-content-center","align-items-center","view-date","flex-1"],[1,"py-1",3,"disabled","click"],["aria-hidden","true",1,"fa","fa-chevron-left","fa-lg","font-weight-light","pb-1"],[4,"ngIf"],["aria-hidden","true",1,"fa","fa-chevron-right","fa-lg","font-weight-light","pb-1"],["bsDatepicker","",1,"d-inline-block","mx-2","datepicker",3,"bsConfig","bsValue","bsValueChange"],["bsDaterangepicker","",1,"d-inline-block","mx-2","datepicker",3,"bsConfig","bsValue","bsValueChange","onShown"]],template:function(o,i){1&o&&(e.TgZ(0,"div",0),e.YNc(1,es,8,4,"div",1),e.qZA()),2&o&&(e.xp6(1),e.Q6J("ngIf",i.schedulerMode===i.SchedulerViewMode.CALENDAR||i.schedulerMode===i.SchedulerViewMode.LIST))},dependencies:[a.O5,ue.Np,ue.FR],styles:[".theme-default .bs-datepicker-head{background-color:var(--cp-sb-date-picker-header-background)}html[dir=ltr][_ngcontent-%COMP%] .theme-default .bs-datepicker-head, [dir=ltr][_ngcontent-%COMP%] .theme-default .bs-datepicker-head, [dir=ltr][_nghost-%COMP%] .theme-default .bs-datepicker-head, html[dir=ltr][_nghost-%COMP%] .theme-default .bs-datepicker-head, html[dir=ltr] [_nghost-%COMP%] .theme-default .bs-datepicker-head, [dir=ltr][_nghost-%COMP%] .theme-default .bs-datepicker-head, [dir=ltr] [_nghost-%COMP%] .theme-default .bs-datepicker-head{border-right:1px solid var(--cp-sb-border-post-time-picker)}html[dir=rtl][_ngcontent-%COMP%] .theme-default .bs-datepicker-head, [dir=rtl][_ngcontent-%COMP%] .theme-default .bs-datepicker-head, [dir=rtl][_nghost-%COMP%] .theme-default .bs-datepicker-head, html[dir=rtl][_nghost-%COMP%] .theme-default .bs-datepicker-head, html[dir=rtl] [_nghost-%COMP%] .theme-default .bs-datepicker-head, [dir=rtl][_nghost-%COMP%] .theme-default .bs-datepicker-head, [dir=rtl] [_nghost-%COMP%] .theme-default .bs-datepicker-head{border-left:1px solid var(--cp-sb-border-post-time-picker)} .theme-default .bs-datepicker-head button{color:var(--cp-sb-background-main-inverse-color)} .theme-default .bs-datepicker-body{padding:8px 16px} .theme-scheduler .bs-datepicker-head{background-color:var(--cp-sb-date-picker-header-background);border-bottom:1px solid var(--cp-sb-border-post-time-picker)} .theme-scheduler .bs-datepicker-head button{color:var(--cp-sb-background-main-inverse-color)} .theme-scheduler .bs-datepicker-body table th{color:var(--cp-sb-secondary-faded-text)} .theme-scheduler .bs-datepicker-multiple+.bs-datepicker-multiple{margin:0} .theme-scheduler .bs-datepicker-body{border:none} .theme-scheduler .bs-datepicker-body{padding:8px 16px}.scheduler-calendar-header[_ngcontent-%COMP%]{background-color:var(--cp-sb-background-secondary-color);border-top-left-radius:8px;border-top-right-radius:8px}.scheduler-calendar-header[_ngcontent-%COMP%] .flex-1[_ngcontent-%COMP%]{flex:1}.scheduler-calendar-header[_ngcontent-%COMP%] .view-date[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{background-color:#0000}.scheduler-calendar-header[_ngcontent-%COMP%] button[_ngcontent-%COMP%], .scheduler-calendar-header[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{font-size:1em;line-height:1.5em}.scheduler-calendar-header[_ngcontent-%COMP%] .datepicker[_ngcontent-%COMP%]{cursor:pointer}.scheduler-calendar-header[_ngcontent-%COMP%] .calendar-view-options[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{font-weight:600;color:var(--cp-sb-primary-text);background-color:var(--cp-sb-background-main-color)}.scheduler-calendar-header[_ngcontent-%COMP%] .calendar-view-options[_ngcontent-%COMP%] .btn.active[_ngcontent-%COMP%]{color:#fff;background-color:var(--cp-sb-background-main-inverse-color);border-color:var(--cp-sb- #ffffff)!important}html[dir=ltr][_ngcontent-%COMP%] .scheduler-calendar-header[_ngcontent-%COMP%] .calendar-view-options[_ngcontent-%COMP%] .rounded-pill-left[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .scheduler-calendar-header[_ngcontent-%COMP%] .calendar-view-options[_ngcontent-%COMP%] .rounded-pill-left[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .scheduler-calendar-header[_ngcontent-%COMP%] .calendar-view-options[_ngcontent-%COMP%] .rounded-pill-left[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .scheduler-calendar-header[_ngcontent-%COMP%] .calendar-view-options[_ngcontent-%COMP%] .rounded-pill-left[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .scheduler-calendar-header[_ngcontent-%COMP%] .calendar-view-options[_ngcontent-%COMP%] .rounded-pill-left[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .scheduler-calendar-header[_ngcontent-%COMP%] .calendar-view-options[_ngcontent-%COMP%] .rounded-pill-left[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .scheduler-calendar-header[_ngcontent-%COMP%] .calendar-view-options[_ngcontent-%COMP%] .rounded-pill-left[_ngcontent-%COMP%]{border-radius:50rem 0 0 50rem}html[dir=rtl][_ngcontent-%COMP%] .scheduler-calendar-header[_ngcontent-%COMP%] .calendar-view-options[_ngcontent-%COMP%] .rounded-pill-left[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .scheduler-calendar-header[_ngcontent-%COMP%] .calendar-view-options[_ngcontent-%COMP%] .rounded-pill-left[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .scheduler-calendar-header[_ngcontent-%COMP%] .calendar-view-options[_ngcontent-%COMP%] .rounded-pill-left[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .scheduler-calendar-header[_ngcontent-%COMP%] .calendar-view-options[_ngcontent-%COMP%] .rounded-pill-left[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .scheduler-calendar-header[_ngcontent-%COMP%] .calendar-view-options[_ngcontent-%COMP%] .rounded-pill-left[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .scheduler-calendar-header[_ngcontent-%COMP%] .calendar-view-options[_ngcontent-%COMP%] .rounded-pill-left[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .scheduler-calendar-header[_ngcontent-%COMP%] .calendar-view-options[_ngcontent-%COMP%] .rounded-pill-left[_ngcontent-%COMP%]{border-radius:0 50rem 50rem 0}html[dir=ltr][_ngcontent-%COMP%] .scheduler-calendar-header[_ngcontent-%COMP%] .calendar-view-options[_ngcontent-%COMP%] .rounded-pill-right[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .scheduler-calendar-header[_ngcontent-%COMP%] .calendar-view-options[_ngcontent-%COMP%] .rounded-pill-right[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .scheduler-calendar-header[_ngcontent-%COMP%] .calendar-view-options[_ngcontent-%COMP%] .rounded-pill-right[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .scheduler-calendar-header[_ngcontent-%COMP%] .calendar-view-options[_ngcontent-%COMP%] .rounded-pill-right[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .scheduler-calendar-header[_ngcontent-%COMP%] .calendar-view-options[_ngcontent-%COMP%] .rounded-pill-right[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .scheduler-calendar-header[_ngcontent-%COMP%] .calendar-view-options[_ngcontent-%COMP%] .rounded-pill-right[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .scheduler-calendar-header[_ngcontent-%COMP%] .calendar-view-options[_ngcontent-%COMP%] .rounded-pill-right[_ngcontent-%COMP%]{border-radius:0 50rem 50rem 0}html[dir=rtl][_ngcontent-%COMP%] .scheduler-calendar-header[_ngcontent-%COMP%] .calendar-view-options[_ngcontent-%COMP%] .rounded-pill-right[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .scheduler-calendar-header[_ngcontent-%COMP%] .calendar-view-options[_ngcontent-%COMP%] .rounded-pill-right[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .scheduler-calendar-header[_ngcontent-%COMP%] .calendar-view-options[_ngcontent-%COMP%] .rounded-pill-right[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .scheduler-calendar-header[_ngcontent-%COMP%] .calendar-view-options[_ngcontent-%COMP%] .rounded-pill-right[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .scheduler-calendar-header[_ngcontent-%COMP%] .calendar-view-options[_ngcontent-%COMP%] .rounded-pill-right[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .scheduler-calendar-header[_ngcontent-%COMP%] .calendar-view-options[_ngcontent-%COMP%] .rounded-pill-right[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .scheduler-calendar-header[_ngcontent-%COMP%] .calendar-view-options[_ngcontent-%COMP%] .rounded-pill-right[_ngcontent-%COMP%]{border-radius:50rem 0 0 50rem}.scheduler-calendar-header[_ngcontent-%COMP%] .list-actions[_ngcontent-%COMP%]{cursor:pointer;color:var(--cp-sb-secondary-text)}.scheduler-calendar-header[_ngcontent-%COMP%] .list-actions[_ngcontent-%COMP%]:hover{text-decoration:underline}"]})}}return n})();const Xe=function(n){return{"font-weight-bold":n}};function ns(n,r){if(1&n&&(e.TgZ(0,"div",13),e._uU(1),e.ALo(2,"date"),e.qZA()),2&n){const t=r.$implicit,o=e.oxw(4);e.Q6J("ngClass",e.VKq(5,Xe,o.isToday(t))),e.xp6(1),e.hij(" ",e.xi3(2,2,t,"EEEE d")," ")}}const et=function(n){return{"grid-template-columns":n}};function os(n,r){if(1&n&&(e.TgZ(0,"div",9),e._UZ(1,"div",10),e.TgZ(2,"div",11),e.YNc(3,ns,3,7,"div",12),e.qZA()()),2&n){const t=e.oxw(3);e.xp6(2),e.Q6J("ngStyle",e.VKq(2,et,t.gridTemplateColumns)),e.xp6(1),e.Q6J("ngForOf",t.days)}}const is=function(n){return{"past-time":n}};function rs(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"socialbee-calendar-hour-cell",18),e.NdJ("click",function(){const s=e.CHM(t).$implicit,c=e.oxw().$implicit,p=e.oxw(3);return e.KtG(p.openSchedulePostsModal(s,c))}),e.qZA()}if(2&n){const t=r.$implicit,o=e.oxw().$implicit,i=e.oxw(3);e.Q6J("calendarMode",i.calendarMode)("displayDate",i.displayDate)("scheduleEntries",i.getEntriesForHour(t,o))("ngClass",e.VKq(4,is,i.isPastTime(t,o)))}}function ss(n,r){if(1&n&&(e.TgZ(0,"div",14)(1,"div",15),e._uU(2),e.ALo(3,"slice"),e.qZA(),e.TgZ(4,"div",16),e.YNc(5,rs,1,6,"socialbee-calendar-hour-cell",17),e.qZA()()),2&n){const t=r.$implicit,o=e.oxw(3);e.xp6(1),e.Q6J("ngClass",e.VKq(7,Xe,o.isCurrentHour(t))),e.xp6(1),e.hij(" ",e.xi3(3,4,"0"+t,-2),":00 "),e.xp6(2),e.Q6J("ngStyle",e.VKq(9,et,o.gridTemplateColumns)),e.xp6(1),e.Q6J("ngForOf",o.days)}}function as(n,r){if(1&n&&(e.ynx(0),e.YNc(1,os,4,4,"div",7),e.YNc(2,ss,6,11,"div",8),e.BQk()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",t.calendarMode!==t.CalendarViewMode.Day),e.xp6(1),e.Q6J("ngForOf",t.hours)}}const tt=function(n){return{"h-100":n}};function cs(n,r){if(1&n&&(e.TgZ(0,"div",3)(1,"div",4),e.ynx(2,5),e.YNc(3,as,3,2,"ng-container",6),e.BQk(),e.qZA()()),2&n){const t=e.oxw();e.Q6J("entries",t.scheduledEntriesMap)("isMonthView",t.calendarMode===t.CalendarViewMode.Month)("ngClass",e.VKq(5,tt,t.calendarMode===t.CalendarViewMode.Month)),e.xp6(1),e.Q6J("ngClass",e.VKq(7,tt,t.calendarMode===t.CalendarViewMode.Month)),e.xp6(1),e.Q6J("ngSwitch",t.calendarMode)}}let ls=(()=>{class n{get isMonthView(){return this.calendarMode===f.Month}constructor(t,o,i,s,c){this.router=t,this.cd=o,this.schedulerService=i,this.schedulerState=s,this.alertService=c,this.loadingChange=new e.vpe,this.displayDate=new Date,this.calendarMode=f.Week,this.hours=Array.from({length:24},(p,g)=>g),this.days=[],this.loading=!1,this.gridTemplateColumns="",this.scheduledEntriesMap=new Map,this.destroy$=new X.x,this.gridTemplateColumnsMapping={[f.Day]:"repeat(1, minmax(21.5em, 1fr))",[f.FourDays]:"repeat(4, minmax(21.5em, 1fr))",[f.Week]:"repeat(7, minmax(12em, 1fr))",[f.Month]:"repeat(7, minmax(10.5em, 1fr))"},this.CalendarViewMode=f,this.isCurrentHour=Nn,this.isToday=Je.Z,this.isPastTime=Ln,this.endOfDay=Ce.Z,this.SchedulerViewModeEnum=S}ngOnInit(){this.schedulerState.state.pipe((0,oe.R)(this.destroy$),(0,de.h)(t=>t.schedulerViewMode===S.CALENDAR)).subscribe(t=>{const{filters:o,dateMode:i}=t;this.displayDate=o.displayDate,this.calendarMode=i,this.updateState()}),this.schedulerState.dataChanged$.pipe((0,oe.R)(this.destroy$)).subscribe(()=>{this.getSchedule()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}getEntriesForHour(t,o){const i=(0,N.Z)(new Date(t.setHours(o)),"yyyy-MM-dd-HH");return this.scheduledEntriesMap.get(i)||[]}getEntriesForDay(t){const o=(0,N.Z)(t,"yyyy-MM-dd");return this.scheduledEntriesMap.get(o)||[]}openSchedulePostsModal(t,o){}updateState(){this.setGridTemplateColumns(),this.updateDays(),this.getSchedule(),this.cd.markForCheck()}setGridTemplateColumns(){this.gridTemplateColumns=this.gridTemplateColumnsMapping[this.calendarMode]}updateDays(){this.days=this.calendarMode===f.Month?function Zn(n){const r=(0,Sn.Z)(n),t=(r.getDay()+6)%7,i=(0,Me.Z)(r,t),s=(0,U.Z)(i,41);return(0,kn.Z)({start:i,end:s})}(this.displayDate):function En(n,r){return Array.from({length:r},(t,o)=>(0,U.Z)(n,o))}(this.displayDate,this.calendarMode)}getSchedule(){this.loading=!0,this.loadingChange.emit(this.loading),this.schedulerService.getContentPreview(this.days[0],this.days[this.days.length-1],this.calendarMode===f.Month?pe.DAY:pe.HOUR).pipe((0,oe.R)(this.destroy$)).subscribe({next:s=>{this.scheduledEntriesMap=new Map(Object.entries(s.groups))},error:()=>{this.loadingChange.emit(!1),this.scheduledEntriesMap=new Map,this.alertService.error("Error fetching schedule entries")},complete:()=>{this.loading=!1,this.loadingChange.emit(this.loading),this.cd.detectChanges()}})}static{this.\u0275fac=function(o){return new(o||n)(e.Y36(O.F0),e.Y36(e.sBO),e.Y36(ur),e.Y36(We),e.Y36(P))}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-calendar"]],hostVars:2,hostBindings:function(o,i){2&o&&e.ekj("h-100",i.isMonthView)},outputs:{loadingChange:"loadingChange"},decls:3,vars:2,consts:[[1,"d-flex","flex-column","border","h-100","calendar-view-wrapper"],[1,"d-flex","mx-n3","calendar-action",3,"schedulerMode"],["socialbeeCalendarScroll","","class","calendar-view-wrapperh-100 d-flex flex-column overflow-auto",3,"entries","isMonthView","ngClass",4,"ngIf"],["socialbeeCalendarScroll","",1,"calendar-view-wrapperh-100","d-flex","flex-column","overflow-auto",3,"entries","isMonthView","ngClass"],[1,"calendar-body","d-flex","flex-column",3,"ngClass"],[3,"ngSwitch"],[4,"ngSwitchDefault"],["class","header-row sticky-top border-bottom d-flex",4,"ngIf"],["class","hour-row d-flex",4,"ngFor","ngForOf"],[1,"header-row","sticky-top","border-bottom","d-flex"],[1,"time-cell"],[1,"day-headers","sticky-top","w-100",3,"ngStyle"],["class","day-header d-flex flex-column align-items-center justify-content-center py-1",3,"ngClass",4,"ngFor","ngForOf"],[1,"day-header","d-flex","flex-column","align-items-center","justify-content-center","py-1",3,"ngClass"],[1,"hour-row","d-flex"],[1,"time-cell","d-flex","justify-content-center","pt-2",3,"ngClass"],[1,"day-columns","w-100","border-bottom",3,"ngStyle"],["class","hour-cell border-left d-flex py-1 w-100 flex-column align-items-center",3,"calendarMode","displayDate","scheduleEntries","ngClass","click",4,"ngFor","ngForOf"],[1,"hour-cell","border-left","d-flex","py-1","w-100","flex-column","align-items-center",3,"calendarMode","displayDate","scheduleEntries","ngClass","click"]],template:function(o,i){1&o&&(e.TgZ(0,"div",0),e._UZ(1,"socialbee-scheduler-action-menu",1),e.YNc(2,cs,4,9,"div",2),e.qZA()),2&o&&(e.xp6(1),e.Q6J("schedulerMode",i.SchedulerViewModeEnum.CALENDAR),e.xp6(1),e.Q6J("ngIf",!i.loading))},dependencies:[a.mk,a.sg,a.O5,a.PC,a.RF,a.ED,Vr,Kr,ts,a.OU,a.uU],styles:[".calendar-view-wrapper[_ngcontent-%COMP%]{border-radius:8px}.calendar-body[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{font-size:.75rem;line-height:1.25rem}.hour-cell[_ngcontent-%COMP%]{background-color:var(--cp-sb-background-main-color)}html[dir=ltr][_ngcontent-%COMP%] .hour-cell[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .hour-cell[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .hour-cell[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .hour-cell[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .hour-cell[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .hour-cell[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .hour-cell[_ngcontent-%COMP%]{border-left:1px solid var(--cp-sb-border-color)}html[dir=rtl][_ngcontent-%COMP%] .hour-cell[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .hour-cell[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .hour-cell[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .hour-cell[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .hour-cell[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .hour-cell[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .hour-cell[_ngcontent-%COMP%]{border-right:1px solid var(--cp-sb-border-color)}.day-headers[_ngcontent-%COMP%], .day-columns[_ngcontent-%COMP%]{display:grid}.day-header[_ngcontent-%COMP%], .hour-cell[_ngcontent-%COMP%]{min-width:0}.time-cell[_ngcontent-%COMP%]{min-width:3.55em}.header-row[_ngcontent-%COMP%], .hour-row[_ngcontent-%COMP%], .day-headers[_ngcontent-%COMP%]{background-color:var(--cp-sb-background-secondary-color)}.header-row[_ngcontent-%COMP%], .day-headers[_ngcontent-%COMP%]{z-index:1}.hour-row[_ngcontent-%COMP%]{min-height:2.925em}.month-view[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(7,1fr);grid-template-rows:repeat(6,1fr);min-width:48rem;min-height:48rem}.calendar-view-wrapperh-100[_ngcontent-%COMP%]{flex:1}.calendar-action[_ngcontent-%COMP%]{flex:0}"],changeDetection:0})}}return n})();function ds(n,r){1&n&&e._UZ(0,"i",9)}const ps=[{path:"",component:ri,canActivateChild:[Ve],children:[{path:"chat",component:Ti},{path:"network",component:Ei},{path:"posts",component:pr},{path:"scheduler",component:(()=>{class n{constructor(t,o,i,s,c){this.router=t,this.eventBusService=o,this.copilotService=i,this.alertService=s,this.analyticsService=c,this.loading=!1}ngOnInit(){this.analyticsService.trackEvent("Loaded Posting Plan"),this.eventBusService.nextCopilotStage(v.POSTING_PLAN)}goNextStep(){this.loading=!0,this.copilotService.completeSchedule().subscribe(()=>{this.analyticsService.trackEvent("View Last Page",{}),this.router.navigate(["/"]),this.loading=!1},t=>{this.loading=!1,this.alertService.error(t.error.message?t.error.message:"Error completing schedule, please try again later.")})}onLoadingChanged(t){this.loadingSpinner=t,this.loadingTitle="Designing your personalized social media schedule\u2026",setTimeout(()=>{this.loadingTitle="Setting up your content calendar \u2014 you\u2019re going to love it!"},2500)}static{this.\u0275fac=function(o){return new(o||n)(e.Y36(O.F0),e.Y36(V),e.Y36(k),e.Y36(P),e.Y36(D))}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-copilot-scheduler"]],decls:12,vars:4,consts:[[1,"d-flex","flex-column"],[1,"title"],[1,"d-flex","flex-column","padding-0","mx-n3","overview","calendar-view",3,"loadingChange"],[3,"showSpinner","loadingTitle"],[1,"d-flex","flex-column","align-items-center","justify-content-center","mt-4","pb-4"],[1,"info-text","mb-2"],["type","button",1,"d-flex","align-items-baseline","btn","btn-primary-socialbee","justify-content-center",3,"disabled","click"],["aria-hidden","true","class","fa fa-spin fa-spinner me-1",4,"ngIf"],[1,"m-0"],["aria-hidden","true",1,"fa","fa-spin","fa-spinner","me-1"]],template:function(o,i){1&o&&(e.TgZ(0,"div",0)(1,"span",1),e._uU(2,"Here\u2019s your recommended posting plan for the upcoming week."),e.qZA(),e.TgZ(3,"socialbee-calendar",2),e.NdJ("loadingChange",function(c){return i.onLoadingChanged(c)}),e.qZA(),e._UZ(4,"socialbee-progress-spinner",3),e.TgZ(5,"div",4)(6,"span",5),e._uU(7,"You're so close! See the last steps to launch your social media campaign."),e.qZA(),e.TgZ(8,"button",6),e.NdJ("click",function(){return i.goNextStep()}),e.YNc(9,ds,1,0,"i",7),e.TgZ(10,"span",8),e._uU(11,"Continue"),e.qZA()()()()),2&o&&(e.xp6(4),e.Q6J("showSpinner",i.loadingSpinner)("loadingTitle",i.loadingTitle),e.xp6(4),e.Q6J("disabled",i.loading),e.xp6(1),e.Q6J("ngIf",i.loading))},dependencies:[a.O5,te,ls],styles:["socialbee-scheduler{height:100%;display:flex;flex-direction:column}socialbee-scheduler .scheduler-page-header{min-width:25em}socialbee-scheduler .scheduler-page-header .header-buttons button{font-size:1em;color:var(--cp-sb-primary-text);background-color:var(--cp-sb-background-main-color)}socialbee-scheduler .scheduler-page-header .scheduler-view-dropdown .dropdown-item{cursor:pointer}socialbee-scheduler .calendar-wrapper{flex:1;min-width:25em;min-height:0}socialbee-scheduler .overview,socialbee-scheduler .list-view{min-height:0}.calendar-view{height:65vh}\n"],encapsulation:2})}}return n})()}]}];let gs=(()=>{class n{static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275mod=e.oAB({type:n})}static{this.\u0275inj=e.cJS({imports:[O.Bz.forRoot([{path:"",children:Ko},{path:"copilot",children:ps},{path:"**",redirectTo:""}],{useHash:!0}),O.Bz]})}}return n})();var us=l(3161),we=l(2237);function hs(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"alert",3),e.NdJ("onClosed",function(){e.CHM(t);const i=e.oxw().$implicit,s=e.oxw();return e.KtG(s.close(i))}),e._UZ(1,"pre",4),e.qZA()}if(2&n){const t=e.oxw().$implicit;e.Q6J("dismissible",!0)("type",t.type),e.xp6(1),e.Q6J("innerHTML",t.msg,e.oJD)}}function fs(n,r){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,hs,2,3,"alert",2),e.qZA()),2&n){const t=r.$implicit;e.xp6(1),e.Q6J("ngIf",t&&t.type&&t.msg)}}let _s=(()=>{class n{constructor(t){this.alertService=t,this.alerts=[]}ngOnInit(){this.alerts=this.alertService.get()}setClasses(t){const o={"jhi-toast":!!t.toast};return t.position?{...o,[t.position]:!0}:o}ngOnDestroy(){this.alertService.clear()}close(t){t.close?.(this.alerts)}static{this.\u0275fac=function(o){return new(o||n)(e.Y36(P))}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-toast-alert"]],decls:2,vars:1,consts:[["role","alert",1,"alerts","jhi-toast","right"],[4,"ngFor","ngForOf"],[3,"dismissible","type","onClosed",4,"ngIf"],[3,"dismissible","type","onClosed"],[2,"font-family","sans-serif",3,"innerHTML"]],template:function(o,i){1&o&&(e.TgZ(0,"div",0),e.YNc(1,fs,2,1,"div",1),e.qZA()),2&o&&(e.xp6(1),e.Q6J("ngForOf",i.alerts))},dependencies:[a.sg,a.O5,we.wx],encapsulation:2})}}return n})();var ms=l(5592),Cs=l(3020);let vs=(()=>{class n{constructor(){this.observable=ms.y.create(t=>{this.observer=t}).pipe((0,Cs.B)())}broadcast(t){this.observer&&this.observer.next(t)}subscribe(t,o){return this.observable.pipe((0,de.h)(s=>"string"==typeof s?s===t:s.name===t),(0,le.U)(s=>"string"!=typeof s?s:null)).subscribe(o)}destroy(t){t.unsubscribe()}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();function bs(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"alert",4),e.NdJ("close",function(){e.CHM(t);const i=e.oxw().$implicit,s=e.oxw();return e.KtG(s.close(i))}),e._UZ(1,"pre",5),e.ALo(2,"translate"),e.qZA()}if(2&n){const t=e.oxw().$implicit;e.Q6J("type",t.type),e.xp6(1),e.Q6J("innerHTML",e.lcZ(2,2,t.msg),e.oJD)}}function Os(n,r){if(1&n&&(e.TgZ(0,"div",2),e.YNc(1,bs,3,4,"alert",3),e.qZA()),2&n){const t=r.$implicit,o=e.oxw();e.Q6J("ngClass",o.setClasses(t)),e.xp6(1),e.Q6J("ngIf",t&&t.type&&t.msg)}}let Ps=(()=>{class n{constructor(t,o){this.alertService=t,this.eventManager=o,this.alerts=[],this.errorListener=o.subscribe("gatewayApp.error",i=>{this.addErrorAlert(i.content.message)}),this.httpErrorListener=o.subscribe("gatewayApp.httpError",i=>{const s=i.content;switch(s.status){case 0:this.addErrorAlert("Server not reachable");break;case 400:{const c=s.headers.keys();let p=null;if(c.forEach(g=>{g.toLowerCase().endsWith("app-error")&&(p=s.headers.get(g))}),p)this.addErrorAlert(p);else if(""!==s.error&&s.error.fieldErrors){const g=s.error.fieldErrors;for(const m of g){["Min","Max","DecimalMin","DecimalMax"].includes(m.message)&&(m.message="Size");const C=m.field.replace(/\[\d*\]/g,"[]"),E=C.charAt(0).toUpperCase()+C.slice(1);this.addErrorAlert('Error on field "'+E+'"')}}else this.addErrorAlert(""!==s.error&&s.error.message?s.error.message:s.error);break}case 404:this.addErrorAlert("Not found");break;default:this.addErrorAlert(""!==s.error&&s.error.message?s.error.message:s.error)}})}setClasses(t){const o={"jhi-toast":!!t.toast};return t.position?{...o,[t.position]:!0}:o}ngOnDestroy(){this.errorListener&&this.eventManager.destroy(this.errorListener),this.httpErrorListener&&this.eventManager.destroy(this.httpErrorListener)}addErrorAlert(t){const o={type:"danger",msg:t,timeout:5e3,toast:this.alertService.isToast(),scoped:!0};this.alerts.push(this.alertService.addAlert(o,this.alerts))}close(t){t.close?.(this.alerts)}static{this.\u0275fac=function(o){return new(o||n)(e.Y36(P),e.Y36(vs))}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-toast-alert-error"]],decls:2,vars:1,consts:[["role","alert",1,"alerts","jhi-toast","right"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"],[3,"type","close",4,"ngIf"],[3,"type","close"],[2,"font-family","sans-serif",3,"innerHTML"]],template:function(o,i){1&o&&(e.TgZ(0,"div",0),e.YNc(1,Os,2,2,"div",1),e.qZA()),2&o&&(e.xp6(1),e.Q6J("ngForOf",i.alerts))},dependencies:[a.mk,a.sg,a.O5,we.wx,B.X$],encapsulation:2})}}return n})(),Ms=(()=>{class n{constructor(t,o){this.injector=t,this.client=o,this.title="SocialBee cPanel",this.standalone=u.standalone,(0,us.Dc)("bs5")}ngOnInit(){return(0,Q.Z)(function*(){})()}static{this.\u0275fac=function(o){return new(o||n)(e.Y36(e.zs3),e.Y36(M.qr))}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["socialbee-cp-root"]],decls:4,vars:0,consts:[[1,"container-main","h-100","w-100"]],template:function(o,i){1&o&&(e._UZ(0,"socialbee-toast-alert")(1,"socialbee-toast-alert-error"),e.TgZ(2,"div",0),e._UZ(3,"router-outlet"),e.qZA())},dependencies:[O.lC,_s,Ps],styles:[".container-main[_ngcontent-%COMP%]{background-color:var(--cp-sb-background-main-color)}"]})}}return n})();var Ts=l(349);let ie=(()=>{class n{static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275mod=e.oAB({type:n})}static{this.\u0275inj=e.cJS({providers:[G],imports:[a.ez,Ts.PW,h.u5,I.Ro,H.UU.forRoot(),F.mr.forRoot(),we.nM.forRoot(),B.aw.forRoot()]})}}return n})(),nt=(()=>{class n{static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275mod=e.oAB({type:n})}static{this.\u0275inj=e.cJS({imports:[a.ez,ie,F.mr,h.u5,H.UU]})}}return n})(),xs=(()=>{class n{static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275mod=e.oAB({type:n})}static{this.\u0275inj=e.cJS({imports:[a.ez,ie,nt,h.u5]})}}return n})();var ys=l(332),ws=l(2268);let Ss=(()=>{class n{static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275mod=e.oAB({type:n})}static{this.\u0275inj=e.cJS({imports:[a.ez,B.aw,ie,h.u5,H.UU,ys.A0,ue.kn,I.ef,ws.z8]})}}return n})(),ks=(()=>{class n{static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275mod=e.oAB({type:n})}static{this.\u0275inj=e.cJS({imports:[a.ez,h.u5,I.Ro,ie,B.aw.forRoot(),Ss]})}}return n})();var ot=l(8504);let Is=(()=>{class n{constructor(t,o,i,s,c){this.localStorage=t,this.client=o,this.userService=i,this.alertService=s,this.coreService=c,this.TOKEN_EXPIRED_ERROR_CODE="10"}intercept(t,o){return(0,He.D)(this.getAuthToken()).pipe((0,re.w)(i=>(i&&i.length>0&&(t=t.clone({setHeaders:{Authorization:i}})),o.handle(t).pipe((0,se.K)(s=>401===s.status&&s.error.code===this.TOKEN_EXPIRED_ERROR_CODE?this.userService.refreshToken().pipe((0,re.w)(c=>(this.coreService.saveUserToken(c).then(()=>{}),t=t.clone({setHeaders:{Authorization:c.userToken}}),o.handle(t))),(0,se.K)(c=>(this.alertService.error("There has been an error refreshing your authentication details. Please get in touch with our support team at success@socialbee.com."),(0,ot._)(()=>c)))):(0,ot._)(()=>s))))))}getAuthToken(){var t=this;return(0,Q.Z)(function*(){return u.standalone?t.localStorage.retrieve(q):(yield t.client.personalStorage.get(q))?.toString()||""})()}static{this.\u0275fac=function(o){return new(o||n)(e.LFG(fe.n2),e.LFG(M.qr),e.LFG(ae),e.LFG(P),e.LFG(Z))}}static{this.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac})}}return n})(),As=(()=>{class n{static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275mod=e.oAB({type:n})}static{this.\u0275inj=e.cJS({providers:[{provide:b.TP,useClass:Is,multi:!0}],imports:[a.ez,b.JF]})}}return n})(),Es=(()=>{class n{static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275mod=e.oAB({type:n,bootstrap:[Ms]})}static{this.\u0275inj=e.cJS({providers:[{provide:M.qr,useFactory:()=>{try{return M.eD.getClient({plugin:"socialBeePlugin",panel:u.standalone?M.qG.fake:M.qG.auto})}catch{console.error("Catching error doing something here")}}}],imports:[W.b2,gs,a.ez,xs,ks,ie,As,fe.RP.forRoot(),z.zk.forRoot(),nt]})}}return n})();u.production&&(0,e.G48)(),W.q6().bootstrapModule(Es).catch(n=>console.error(n))}},j=>{j.O(0,[647,534],()=>j(j.s=3354)),j.O()}]);
Back to Directory
File Manager