Liferay.Loader.define("layout-reports-web@1.0.55/js/context/StoreContext",["module","exports","require","liferay!frontend-js-react-web$react","../constants/actionTypes"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.StoreContextProvider=function StoreContextProvider({children:t,value:r}){const[o,d]=(0,a.useReducer)(reducer,_objectSpread(_objectSpread({},e),r));return a.default.createElement(n.Provider,{value:d},a.default.createElement(c.Provider,{value:o},t))},t.StoreStateContext=t.StoreDispatchContext=void 0;var a=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var n=a?Object.getOwnPropertyDescriptor(e,o):null;n&&(n.get||n.set)?Object.defineProperty(r,o,n):r[o]=e[o]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),o=r("../constants/actionTypes");function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const e={data:null,error:null,languageId:null,loading:!1,selectedIssue:null},noop=()=>{},n=(0,a.createContext)(noop);t.StoreDispatchContext=n;const c=(0,a.createContext)([e,noop]);function reducer(t=e,r){var a,n;let c=t;switch(r.type){case o.LOAD_DATA:c=_objectSpread(_objectSpread({},t),{},{error:!1,loading:!0});break;case o.SET_ERROR:c=_objectSpread(_objectSpread({},t),{},{error:r.error,loading:!1});break;case o.SET_DATA:c={data:r.data,error:null===(a=r.data)||void 0===a?void 0:a.error,languageId:t.languageId||(null===(n=r.data)||void 0===n?void 0:n.defaultLanguageId),loading:r.loading||!1};break;case o.SET_ISSUES:c=_objectSpread(_objectSpread({},t),{},{data:_objectSpread(_objectSpread({},t.data),{},{layoutReportsIssues:_objectSpread(_objectSpread({},t.data.layoutReportsIssues),{},{[r.languageId]:r.layoutReportsIssues})}),loading:!1});break;case o.SET_LANGUAGE_ID:c=_objectSpread(_objectSpread({},t),{},{languageId:r.languageId});break;case o.SET_SELECTED_ISSUE:c=_objectSpread(_objectSpread({},t),{},{selectedIssue:r.issue});break;default:return t}return c}t.StoreStateContext=c}}));
//# sourceMappingURL=StoreContext.js.map