text: "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),n=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,r=require("@keg-hub/jsutils"),i=require("./useTheme-dfd3b7b4.js");function emptyFunction(){}function emptyFunctionWithReset(){}emptyFunctionWithReset.resetWarningCache=emptyFunction;var s=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){e.exports=function(){function shim(e,t,n,r,i,s){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==s){var o=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw o.name="Invariant Violation",o}}function getShim(){return shim}shim.isRequired=shim;var e={array:shim,bool:shim,func:shim,number:shim,object:shim,string:shim,symbol:shim,any:shim,arrayOf:getShim,element:shim,elementType:shim,instanceOf:getShim,node:shim,objectOf:getShim,oneOf:getShim,oneOfType:getShim,shape:getShim,exact:getShim,checkPropTypes:emptyFunctionWithReset,resetWarningCache:emptyFunction};return e.PropTypes=e,e}()})),ReThemeProvider=function(e){var s=e.children,o=e.theme,u=e.merge,a=e.platforms,h=Boolean(u||!u&&!1!==u)||!1,m=t.useState(i.Dimensions.get("window")),c=i._slicedToArray(m,2),p=c[0],l=c[1],onChange=function(e){var t=e.window,n=t.width,s=t.height,o=t.scale,u=t.fontScale,a=i.getSize(n);if(a){var h=a[0],m=i.getCurrentTheme();h!==r.get(m,["RTMeta","key"])&&l({width:n,height:s,scale:o,fontScale:u})}};t.useEffect((function(){return i.Dimensions.addEventListener("change",onChange),function(){i.Dimensions.removeEventListener("change",onChange)}}),[]);var f=t.useMemo((function(){return i.buildTheme(o,p.width,p.height,h&&i.getDefaultTheme(),a)}),[o,p.width,p.height,h,a]);return n.createElement(i.ReThemeContext.Provider,{value:f},s)};ReThemeProvider.propTypes={theme:s.object.isRequired,merge:s.bool,platforms:s.array,children:s.node};var nativeThemeHook=function(e,n,s){var o=r.get(s,"ref",t.useRef()),u=t.useState(e),a=i._slicedToArray(u,2),h=a[0],m=a[1];return t.useLayoutEffect((function(){var t,n;(t=e)!==(n=h)&&!r.shallowEqual(t,n)&&m(h)}),[e,n]),[o,e,m]};exports.ReThemeContext=i.ReThemeContext,exports.addThemeEvent=i.addThemeEvent,exports.fireThemeEvent=i.fireThemeEvent,exports.getDefaultTheme=i.getDefaultTheme,exports.getMergeSizes=i.getMergeSizes,exports.getSize=i.getSize,exports.getSizeMap=i.getSizeMap,exports.removeThemeEvent=i.removeThemeEvent,exports.setDefaultTheme=i.setDefaultTheme,exports.setRNPlatform=i.setRNPlatform,exports.setSizes=i.setSizes,exports.useTheme=i.useTheme,exports.ReThemeProvider=ReThemeProvider,exports.setRNDimensions=function(e){return e},exports.useDimensions=function(){var e=t.useState(i.Dimensions.get("window")),n=i._slicedToArray(e,2),r=n[0],s=n[1],onChange=function(e){var t=e.window,n=t.width,r=t.height,i=t.scale,o=t.fontScale;s({width:n,height:r,scale:i,fontScale:o})};return t.useEffect((function(){return i.Dimensions.addEventListener("change",onChange),function(){return onChange.shouldUnmount=!0,i.Dimensions.removeEventListener("change",onChange)}}),[]),r},exports.useStylesCallback=function(e,n,s){var o=t.useCallback(e,n||[]),u=!(!s||!r.isObj(s)||r.isEmptyColl(s))&&s,a=i.useTheme();return t.useMemo((function(){return r.checkCall.apply(void 0,[o,a,u].concat(i._toConsumableArray(n)))||{}}),[a,o,u])},exports.useThemeActive=nativeThemeHook,exports.useThemeFocus=nativeThemeHook,exports.useThemeHover=nativeThemeHook,exports.withTheme=function(e){return function(t){return n.createElement(i.ReThemeContext.Consumer,null,(function(r){return n.createElement(e,i._extends({theme:r},t))}))}};
  //# sourceMappingURL=index.js.map
  