"use strict";var b=d(require("react"));function a(b){"@babel/helpers - typeof";return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},a(b)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.useApi=exports["default"]=exports.ApiContext=void 0;function c(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,d=new WeakMap;return(c=function(a){return a?d:b})(a)}function d(b,d){if(!d&&b&&b.__esModule)return b;if(null===b||"object"!==a(b)&&"function"!=typeof b)return{default:b};var e=c(d);if(e&&e.has(b))return e.get(b);var f={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var h in b)if("default"!=h&&Object.prototype.hasOwnProperty.call(b,h)){var i=g?Object.getOwnPropertyDescriptor(b,h):null;i&&(i.get||i.set)?Object.defineProperty(f,h,i):f[h]=b[h]}return f["default"]=b,e&&e.set(b,f),f}var e=b["default"].createContext({});exports.ApiContext=e;var f=function(a){var c=a.children,d=a.api,f=a.handler,g=a.loading,h=a.error;return b["default"].createElement(e.Provider,{value:{api:d,apiHandler:f,loading:g,error:h}},c)},g=function(){return(0,b.useContext)(e)};exports.useApi=g;var h=f;exports["default"]=h;