(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{ZD0A:function(t,e,r){"use strict";r.d(e,"a",function(){return g});var o=r("mrSG"),a=r("AcyG");function s(t){return"function"==typeof t}var i=r("LRne"),c=r("z6cu"),n=r("vkgz"),d=r("JIr8"),u=r("/z64"),p=r("rhm1"),l=r("fXoL"),h=r("4dCh"),b=r("Qosb"),S=r("EP1h"),L=r("K8J1");let g=(()=>{let t=class{constructor(t,e,r,o){this.shopListService=t,this.shopListDetailService=e,this.localStorage=r,this.shopInfoService=o}static getLoader(t){return t.loading}static getShopList(t){return t.data}static getNumberOfPages(t){return t.numberOfPages}static getShopListCurrentAction(t){return t.action}fetchShopList(t,e){const r=t.getState();return this.startLoader(t),this.shopListService.getShopList(e.payload,e.currentPage).pipe(Object(n.a)(e=>{t.setState(Object.assign(Object.assign({},r),{loading:!1,data:[...r.data,...e],numberOfPages:e&&e.length?e[0].numberOfPages:0}))}),Object(d.a)(e=>(this.logError(t,e),Object(i.a)())))}clearShopList(t){const e=t.getState();t.setState(Object.assign(Object.assign({},e),{loading:!1,data:[],error:null,action:null,numberOfPages:0}))}fetchShopListById(t,{shopListId:e}){return this.startLoader(t),this.shopListDetailService.fetchShopListById(e).pipe(Object(n.a)(r=>{var o,a,i;t.getState(),t.setState((o={loading:!1,data:(a=t=>t.uid===e,i=r,function(t){let e=-1;if(function(t){return"function"==typeof t}(a)?e=t.findIndex(a):function(t){return"number"==typeof t}(a)&&(e=a),function(t){return Number.isNaN(t)||-1===t}(e))return t;let r=null;if(r=s(i)?i(t[e]):i,r===t[e])return t;const o=t.slice();return o[e]=r,o})},function(t){let e=null;for(const r in o){const a=o[r],i=t[r],c=s(a)?a(i):a;c!==i&&(e||(e=Object.assign({},t)),e[r]=c)}return e||t}))}),Object(d.a)(e=>(this.logError(t,e),Object(c.a)(e))))}addShopList(t,e){return this.startLoader(t),this.shopListService.addShopList(e.payload.shopList).pipe(Object(n.a)(r=>{if(null!=e.payload.productList&&e.payload.productList.length>0)t.dispatch(new p.d(r.uid,e.payload.productList)).subscribe(e=>{t.dispatch(new p.j);const o=t.getState();t.patchState({loading:!1,data:[...o.data,r],action:"newListCreated"})});else{const e=t.getState();t.patchState({loading:!1,data:[...e.data,r]})}}),Object(d.a)(e=>(this.logError(t,e),Object(c.a)(e))))}addShopProductList(t,{shopListId:e,productList:r}){return this.startLoader(t),this.shopListDetailService.addProductList(e,r).pipe(Object(n.a)(r=>{t.dispatch(new p.i(e))}),Object(d.a)(e=>(this.logError(t,e),Object(c.a)(e))))}addShopListWithBundle(t,e){return this.startLoader(t),this.shopListService.addShopList(e.payload.shopList).pipe(Object(n.a)(r=>{const o=this.shopInfoService.getShopInfoFromSession(),a=this.localStorage.getItem(u.k);t.dispatch(new p.b({accountId:null==a?void 0:a.aboid,shopId:o.shopUid,shoplistUid:r.uid},e.payload.bundle)).subscribe(e=>{t.dispatch(new p.j);const o=t.getState();t.patchState({loading:!1,data:[...o.data,r],action:"newListCreated"})})}))}addBundleProduct(t,e){return this.startLoader(t),this.shopListDetailService.addBundleProduct(e.params,e.productSelection).pipe(Object(n.a)(r=>{t.dispatch(new p.i(e.params.shoplistUid))}),Object(d.a)(e=>(this.logError(t,e),Object(c.a)(e))))}addBundleProductList(t,e){return this.startLoader(t),this.shopListDetailService.addBundleProductList(e.params,e.bundleList).pipe(Object(d.a)(e=>(this.logError(t,e),Object(c.a)(e))))}addMultipleNonBundleProductsToShopLists(t,{shopListIds:e,productList:r}){return this.startLoader(t),this.shopListDetailService.addMultipleNonBundleProductsToShopLists(e,r).pipe(Object(n.a)(r=>{t.dispatch(new p.j),t.patchState({action:"productAddedToLists"}),t.dispatch(new p.i(e[0]))}),Object(d.a)(e=>(this.logError(t,e),Object(c.a)(e))))}resetShopListCurrentAction(t){t.patchState({action:null})}startLoader(t){t.patchState({loading:!0})}logError(t,e){t.patchState({loading:!1,error:e})}};return t.\u0275fac=function(e){return new(e||t)(l.Xb(h.a),l.Xb(b.a),l.Xb(S.a),l.Xb(L.a))},t.\u0275prov=l.Jb({token:t,factory:t.\u0275fac}),Object(o.a)([Object(a.a)(p.h)],t.prototype,"fetchShopList",null),Object(o.a)([Object(a.a)(p.g)],t.prototype,"clearShopList",null),Object(o.a)([Object(a.a)(p.i)],t.prototype,"fetchShopListById",null),Object(o.a)([Object(a.a)(p.e)],t.prototype,"addShopList",null),Object(o.a)([Object(a.a)(p.d)],t.prototype,"addShopProductList",null),Object(o.a)([Object(a.a)(p.f)],t.prototype,"addShopListWithBundle",null),Object(o.a)([Object(a.a)(p.b)],t.prototype,"addBundleProduct",null),Object(o.a)([Object(a.a)(p.a)],t.prototype,"addBundleProductList",null),Object(o.a)([Object(a.a)(p.c)],t.prototype,"addMultipleNonBundleProductsToShopLists",null),Object(o.a)([Object(a.a)(p.j)],t.prototype,"resetShopListCurrentAction",null),Object(o.a)([Object(a.d)()],t,"getLoader",null),Object(o.a)([Object(a.d)()],t,"getShopList",null),Object(o.a)([Object(a.d)()],t,"getNumberOfPages",null),Object(o.a)([Object(a.d)()],t,"getShopListCurrentAction",null),t=Object(o.a)([Object(a.e)({name:"ShopList",defaults:{loading:!1,data:[],error:null,action:null,numberOfPages:0}})],t),t})()},k6lK:function(t,e,r){"use strict";r.d(e,"a",function(){return a});var o=function(t){return t.GET_SHOP_FOA_PRODUCTS="[ShopFoa] getShopFoaProducts",t}({});let a=(()=>{class t{constructor(t=null){this.payload=t}}return t.type=o.GET_SHOP_FOA_PRODUCTS,t})()},r6SO:function(t,e,r){"use strict";r.d(e,"a",function(){return O});var o=r("mrSG"),a=r("AcyG"),s=r("z6cu"),i=r("vkgz"),c=r("JIr8"),n=r("k6lK"),d=r("fXoL"),u=r("tk/3"),p=r("HDdC"),l=r("d1QB"),h=r("1ylV"),b=r("1g50"),S=r("XIVI"),L=r("3Yxx");let g=(()=>{class t{constructor(t,e,r){this.httpHandlerService=t,this.apiConfigService=e,this.uiHelperService=r}getShopFoaProducts(){return new p.a(t=>{const e=this.apiConfigService.getAPIPath(l.mb);let r=new u.e;r=r.set("fields","FULL"),r=r.set("lang",this.uiHelperService.getSelectedLanguage()).set("currentPage","0").set("pageSize","50"),this.httpHandlerService.callServerGET(e,r).subscribe(e=>{const r=[];e&&e.products&&e.products.length&&e.products.forEach(t=>{r.push(new h.a(t))}),t.next(r),t.complete()},e=>{t.error(e),t.complete()})})}getProductRegionAvailability(t){return new p.a(e=>{const r=this.apiConfigService.getAPIPath(l.eb);r.path=r.path.replace(l.db,t),this.httpHandlerService.callServerGET(r).subscribe(t=>{e.next(t),e.complete()},t=>{e.error(t),e.complete()})})}}return t.\u0275fac=function(e){return new(e||t)(d.Xb(b.a),d.Xb(S.a),d.Xb(L.a))},t.\u0275prov=d.Jb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),O=(()=>{let t=class{constructor(t){this.shopFoaService=t}static getLoader(t){return t.loading}static getShopFoaProductList(t){return t.data}getShopFoaProducts(t,e){return this.startLoader(t),this.shopFoaService.getShopFoaProducts().pipe(Object(i.a)(e=>{const r=t.getState();t.setState(Object.assign(Object.assign({},r),{loading:!1,data:e.filter(t=>t.isEligibleForMyList)}))}),Object(c.a)(e=>(this.logError(t,e),Object(s.a)(e))))}startLoader(t){t.patchState({loading:!0})}logError(t,e){t.patchState({loading:!1,error:e})}};return t.\u0275fac=function(e){return new(e||t)(d.Xb(g))},t.\u0275prov=d.Jb({token:t,factory:t.\u0275fac}),Object(o.a)([Object(a.a)(n.a)],t.prototype,"getShopFoaProducts",null),Object(o.a)([Object(a.d)()],t,"getLoader",null),Object(o.a)([Object(a.d)()],t,"getShopFoaProductList",null),t=Object(o.a)([Object(a.e)({name:"ShopFoa",defaults:{loading:!1,data:[],error:null}})],t),t})()},rhm1:function(t,e,r){"use strict";r.d(e,"h",function(){return o}),r.d(e,"g",function(){return a}),r.d(e,"i",function(){return s}),r.d(e,"e",function(){return i}),r.d(e,"d",function(){return c}),r.d(e,"b",function(){return n}),r.d(e,"a",function(){return d}),r.d(e,"f",function(){return u}),r.d(e,"c",function(){return p}),r.d(e,"j",function(){return l});let o=(()=>{class t{constructor(t,e){this.payload=t,this.currentPage=e}}return t.type="[ShopList] fetchShopList",t})(),a=(()=>{class t{constructor(){}}return t.type="[ShopList] clearShopList",t})(),s=(()=>{class t{constructor(t){this.shopListId=t}}return t.type="[ShopList] fetchShopListById",t})(),i=(()=>{class t{constructor(t=null){this.payload=t}}return t.type="[ShopList] AddShopList",t})(),c=(()=>{class t{constructor(t,e){this.shopListId=t,this.productList=e}}return t.type="[ProductList] Add",t})(),n=(()=>{class t{constructor(t,e){this.params=t,this.productSelection=e}}return t.type="[ProductList] AddBundle",t})(),d=(()=>{class t{constructor(t,e){this.params=t,this.bundleList=e}}return t.type="[ProductList] AddBundleList",t})(),u=(()=>{class t{constructor(t=null){this.payload=t}}return t.type="[ShopList] AddShopListWithBundle",t})(),p=(()=>{class t{constructor(t,e){this.shopListIds=t,this.productList=e}}return t.type="[ProductList] AddMultipleNonBundleProductsToShoplists",t})(),l=(()=>{class t{constructor(){}}return t.type="[ProductList] ResetShopListCurrentAction",t})()}}]);