import{A as r,Mc as u,ad as p,w as o}from"./chunk-ZVAMPSQU.js";import{j as c}from"./chunk-FB5LSH2R.js";var a=(function(t){return t.MultipleRecipeSelection="multipleRecipeSelection",t.MultipleLabelSelection="multipleLabelSelection",t.SplitPaneView="splitPaneView",t.PinnedRecipes="pinnedRecipes",t.NativePrintView="nativePrintView",t})(a||{}),g={[a.MultipleRecipeSelection]:{header:"services.quickTutorial.multipleRecipeSelection.header",message:"services.quickTutorial.multipleRecipeSelection.message"},[a.MultipleLabelSelection]:{header:"services.quickTutorial.multipleLabelSelection.header",message:"services.quickTutorial.multipleLabelSelection.message"},[a.SplitPaneView]:{header:"services.quickTutorial.splitPaneView.header",message:"services.quickTutorial.splitPaneView.message"},[a.PinnedRecipes]:{header:"services.quickTutorial.pinnedRecipes.header",message:"services.quickTutorial.pinnedRecipes.message"},[a.NativePrintView]:{header:"services.quickTutorial.nativePrintView.header",message:"services.quickTutorial.nativePrintView.message"}},m="seenQuickTutorialOptions",k=(()=>{let s=class s{constructor(){this.alertCtrl=r(u),this.translate=r(p)}fetchSeenTutorials(){try{let e=localStorage.getItem(m);return e?JSON.parse(e):[]}catch(e){return[]}}saveSeenTutorials(e){try{let i=JSON.stringify(e);localStorage.setItem(m,i)}catch(i){}}markQuickTutorialAsSeen(e){let i=this.fetchSeenTutorials();i.push(e),this.saveSeenTutorials(i)}triggerQuickTutorial(e){return c(this,null,function*(){if(this.fetchSeenTutorials().indexOf(e)<0){let n=g[e],h=yield this.translate.get(n.header).toPromise(),S=yield this.translate.get(n.message).toPromise(),d=yield this.translate.get("generic.okay").toPromise(),l=yield this.alertCtrl.create({header:h,message:S,buttons:[d]});yield l.present(),yield l.onDidDismiss(),this.markQuickTutorialAsSeen(e)}})}};s.\u0275fac=function(i){return new(i||s)},s.\u0275prov=o({token:s,factory:s.\u0275fac,providedIn:"root"});let t=s;return t})();export{a,k as b};
