import{T as x,i as w}from"./chunk-ZDRK4JHR.js";import{Hb as b,J as d,M as p,b as h}from"./chunk-VEXJN5D7.js";var f=class{constructor(t,c,s,e,i,o,a){this.id="",this.type=v.Image,this.title="",this.id=t,this.source=c,this.source_Url=s,this.thumb=e,this.thumb_Url=i,this.type=o,this.title=a}},v=(function(r){return r.Image="Image",r.Video="Video",r.Url="Url",r.Pdf="Pdf",r})(v||{}),l=class{constructor(t,c){this.number=1,this.new=!1,this.active=!1,this.selected=!1,this.new=!0,this.content=new f(t.id,t.source,t.source_Url,t.thumb,t.thumb_Url,t.type,t.title),this.number=c,setTimeout(()=>{this.new=!1},250)}},m=class{constructor(t,c){this.id=w(),this.userId=c,this.name=t,this.created_Utc=new Date,this.lastUpdated_Utc=new Date,this.pageCollection=new g}},g=class{constructor(){this.pages=[]}};var j=(()=>{let t=class t{constructor(s,e){this.http=s,this.storageService=e}getTagsWithContent(){return this.http.get("{{api}}/presentations/tags/content")}getDefaultPresentation(s){return new h(e=>{this.getTagsWithContent().subscribe({next:i=>{let o=new m(s,"Default");for(var a=0,U=i.length;a<U;a++){let u=i[a];if(u.name=="Presentation Booklet"){for(var n=1,I=u.content.length+1;n<I;n++){let y=u.content[n-1],D=new l(y,n);o.pageCollection.pages.push(D)}break}}e.next(o),e.complete()},error:()=>{e.error(),e.complete()}})})}getPresentationByName(s,e){return new h(i=>{this.storageService.getPresentationByName(s,e).then(o=>{o!=null?(i.next(o),i.complete()):(i.next(null),i.complete())}).catch(()=>{i.error(),i.complete()})})}storePresentation(s){return new h(e=>{this.storageService.storePresentation(s).then(()=>{e.next(),e.complete()}).catch(()=>{e.error(),e.complete()})})}};t.\u0275fac=function(e){return new(e||t)(p(b),p(x))},t.\u0275prov=d({token:t,factory:t.\u0275fac,providedIn:"root"});let r=t;return r})();export{v as a,l as b,m as c,j as d};
