import{B as g,E as n,Pb as l,Qb as S,Sb as h,a as m,ac as y,b as f,bd as c,h as o,pb as d,y as p}from"./chunk-5ZN6IIP7.js";var P=(()=>{let t=class t{constructor(e){this.payload=e}};t.type="[Page] Get";let r=t;return r})(),v=(()=>{let t=class t{constructor(e){this.slug=e}};t.type="[Page] By Slug";let r=t;return r})(),q=(()=>{let t=class t{};t.type="[Faq] Get";let r=t;return r})(),w=(()=>{let t=class t{constructor(e){this.payload=e}};t.type="[ContactUs] Post";let r=t;return r})();var x=(()=>{let t=class t{constructor(e){this.http=e,this.skeletonLoader=!1}getPages(e){return this.http.get(`${c.URL}/page`,{params:e})}getPageBySlug(e){return this.http.get(`${c.URL}/page/slug/${e}`)}getFaqs(){return this.http.get(`${c.URL}/faq`)}contactUs(e){return this.http.post(`${c.URL}/contact-us`,e)}getStores(e){return this.http.get(`${c.URL}/store`,{params:e})}};t.\u0275fac=function(u){return new(u||t)(n(d))},t.\u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"});let r=t;return r})();var s,i=(s=class{constructor(t,a){this.router=t,this.pageService=a}static page(t){return t.page}static faq(t){return t.faq}static selectedPage(t){return t.selectedPage}getPages(t,a){return this.pageService.getPages(a.payload).pipe(p({next:e=>{t.patchState({page:{data:e.data,total:e?.total?e?.total:e.data?.length}})},error:e=>{throw new Error(e?.error?.message)}}))}getPageBySlug(t,{slug:a}){return this.pageService.skeletonLoader=!0,this.pageService.getPageBySlug(a).pipe(p({next:e=>{let u=t.getState();t.patchState(f(m({},u),{selectedPage:e}))},complete:()=>{this.pageService.skeletonLoader=!1},error:e=>{throw new Error(e?.error?.message)}}))}getFaqs(t){return this.pageService.skeletonLoader=!0,this.pageService.getFaqs().pipe(p({next:a=>{t.patchState({faq:{data:a.data,total:a?.total?a?.total:a.data?.length}})},complete:()=>{this.pageService.skeletonLoader=!1},error:a=>{throw new Error(a?.error?.message)}}))}contactUs(t,{payload:a}){return this.pageService.contactUs(a).pipe(p({error:e=>{throw new Error(e?.error?.message)}}))}},s.\u0275fac=function(a){return new(a||s)(n(y),n(x))},s.\u0275prov=g({token:s,factory:s.\u0275fac}),s);o([l(P)],i.prototype,"getPages",null);o([l(v)],i.prototype,"getPageBySlug",null);o([l(q)],i.prototype,"getFaqs",null);o([l(w)],i.prototype,"contactUs",null);o([h()],i,"page",null);o([h()],i,"faq",null);o([h()],i,"selectedPage",null);i=o([S({name:"page",defaults:{page:{data:[],total:0},faq:{data:[],total:0},selectedPage:null}})],i);export{P as a,v as b,q as c,w as d,x as e,i as f};
