f35e4f293bfcef23d890e7e98a148b52.json 13.7 KB
{"ast":null,"code":"var _interopRequireWildcard=require(\"@babel/runtime/helpers/interopRequireWildcard\");var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");Object.defineProperty(exports,\"__esModule\",{value:true});exports.default=void 0;var _invariant=_interopRequireDefault(require(\"fbjs/lib/invariant\"));var _unmountComponentAtNode=_interopRequireDefault(require(\"../unmountComponentAtNode\"));var _renderApplication=_interopRequireWildcard(require(\"./renderApplication\"));function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==='function'){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable;}));}ownKeys.forEach(function(key){_defineProperty(target,key,source[key]);});}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}var emptyObject={};var runnables={};var componentProviderInstrumentationHook=function componentProviderInstrumentationHook(component){return component();};var wrapperComponentProvider;var AppRegistry=function(){function AppRegistry(){}AppRegistry.getAppKeys=function getAppKeys(){return Object.keys(runnables);};AppRegistry.getApplication=function getApplication(appKey,appParameters){(0,_invariant.default)(runnables[appKey]&&runnables[appKey].getApplication,\"Application \"+appKey+\" has not been registered. \"+'This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.');return runnables[appKey].getApplication(appParameters);};AppRegistry.registerComponent=function registerComponent(appKey,componentProvider){runnables[appKey]={getApplication:function getApplication(appParameters){return(0,_renderApplication.getApplication)(componentProviderInstrumentationHook(componentProvider),appParameters?appParameters.initialProps:emptyObject,wrapperComponentProvider&&wrapperComponentProvider(appParameters));},run:function run(appParameters){return(0,_renderApplication.default)(componentProviderInstrumentationHook(componentProvider),appParameters.initialProps||emptyObject,appParameters.rootTag,wrapperComponentProvider&&wrapperComponentProvider(appParameters),appParameters.callback);}};return appKey;};AppRegistry.registerConfig=function registerConfig(config){config.forEach(function(_ref){var appKey=_ref.appKey,component=_ref.component,run=_ref.run;if(run){AppRegistry.registerRunnable(appKey,run);}else{(0,_invariant.default)(component,'No component provider passed in');AppRegistry.registerComponent(appKey,component);}});};AppRegistry.registerRunnable=function registerRunnable(appKey,run){runnables[appKey]={run:run};return appKey;};AppRegistry.runApplication=function runApplication(appKey,appParameters){var isDevelopment=process.env.NODE_ENV!=='production'&&process.env.NODE_ENV!=='test';if(isDevelopment){var params=_objectSpread({},appParameters);params.rootTag=\"#\"+params.rootTag.id;console.log(\"Running application \\\"\"+appKey+\"\\\" with appParams:\\n\",params,\"\\nDevelopment-level warnings: \"+(isDevelopment?'ON':'OFF')+\".\"+(\"\\nPerformance optimizations: \"+(isDevelopment?'OFF':'ON')+\".\"));}(0,_invariant.default)(runnables[appKey]&&runnables[appKey].run,\"Application \\\"\"+appKey+\"\\\" has not been registered. \"+'This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.');runnables[appKey].run(appParameters);};AppRegistry.setComponentProviderInstrumentationHook=function setComponentProviderInstrumentationHook(hook){componentProviderInstrumentationHook=hook;};AppRegistry.setWrapperComponentProvider=function setWrapperComponentProvider(provider){wrapperComponentProvider=provider;};AppRegistry.unmountApplicationComponentAtRootTag=function unmountApplicationComponentAtRootTag(rootTag){(0,_unmountComponentAtNode.default)(rootTag);};return AppRegistry;}();exports.default=AppRegistry;","map":{"version":3,"sources":["C:/Users/bluej/Desktop/2_2/searchGuide/searchGuide/node_modules/react-native-web/dist/exports/AppRegistry/index.js"],"names":["_objectSpread","target","i","arguments","length","source","ownKeys","Object","keys","getOwnPropertySymbols","concat","filter","sym","getOwnPropertyDescriptor","enumerable","forEach","key","_defineProperty","obj","value","defineProperty","configurable","writable","emptyObject","runnables","componentProviderInstrumentationHook","component","wrapperComponentProvider","AppRegistry","getAppKeys","getApplication","appKey","appParameters","registerComponent","componentProvider","initialProps","run","rootTag","callback","registerConfig","config","_ref","registerRunnable","runApplication","isDevelopment","process","env","NODE_ENV","params","id","console","log","setComponentProviderInstrumentationHook","hook","setWrapperComponentProvider","provider","unmountApplicationComponentAtRootTag"],"mappings":"wPAaA,qEACA,yFACA,+EAfA,QAASA,CAAAA,aAAT,CAAuBC,MAAvB,CAA+B,CAAE,IAAK,GAAIC,CAAAA,CAAC,CAAG,CAAb,CAAgBA,CAAC,CAAGC,SAAS,CAACC,MAA9B,CAAsCF,CAAC,EAAvC,CAA2C,CAAE,GAAIG,CAAAA,MAAM,CAAGF,SAAS,CAACD,CAAD,CAAT,EAAgB,IAAhB,CAAuBC,SAAS,CAACD,CAAD,CAAhC,CAAsC,EAAnD,CAAuD,GAAII,CAAAA,OAAO,CAAGC,MAAM,CAACC,IAAP,CAAYH,MAAZ,CAAd,CAAmC,GAAI,MAAOE,CAAAA,MAAM,CAACE,qBAAd,GAAwC,UAA5C,CAAwD,CAAEH,OAAO,CAAGA,OAAO,CAACI,MAAR,CAAeH,MAAM,CAACE,qBAAP,CAA6BJ,MAA7B,EAAqCM,MAArC,CAA4C,SAAUC,GAAV,CAAe,CAAE,MAAOL,CAAAA,MAAM,CAACM,wBAAP,CAAgCR,MAAhC,CAAwCO,GAAxC,EAA6CE,UAApD,CAAiE,CAA9H,CAAf,CAAV,CAA4J,CAACR,OAAO,CAACS,OAAR,CAAgB,SAAUC,GAAV,CAAe,CAAEC,eAAe,CAAChB,MAAD,CAASe,GAAT,CAAcX,MAAM,CAACW,GAAD,CAApB,CAAf,CAA4C,CAA7E,EAAiF,CAAC,MAAOf,CAAAA,MAAP,CAAgB,CAEje,QAASgB,CAAAA,eAAT,CAAyBC,GAAzB,CAA8BF,GAA9B,CAAmCG,KAAnC,CAA0C,CAAE,GAAIH,GAAG,GAAIE,CAAAA,GAAX,CAAgB,CAAEX,MAAM,CAACa,cAAP,CAAsBF,GAAtB,CAA2BF,GAA3B,CAAgC,CAAEG,KAAK,CAAEA,KAAT,CAAgBL,UAAU,CAAE,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R,CAAYC,QAAZ,GAAyB,YAAzB,EAAyCF,OAAO,CAACC,GAAR,CAAYC,QAAZ,GAAyB,MAAtF,CAEA,GAAIH,aAAJ,CAAmB,CACjB,GAAII,CAAAA,MAAM,CAAGhD,aAAa,CAAC,EAAD,CAAKgC,aAAL,CAA1B,CAEAgB,MAAM,CAACX,OAAP,CAAiB,IAAMW,MAAM,CAACX,OAAP,CAAeY,EAAtC,CACAC,OAAO,CAACC,GAAR,CAAY,yBAA2BpB,MAA3B,CAAoC,sBAAhD,CAAwEiB,MAAxE,CAAgF,kCAAoCJ,aAAa,CAAG,IAAH,CAAU,KAA3D,EAAoE,GAApE,EAA2E,iCAAmCA,aAAa,CAAG,KAAH,CAAW,IAA3D,EAAmE,GAA9I,CAAhF,EACD,CAED,uBAAUpB,SAAS,CAACO,MAAD,CAAT,EAAqBP,SAAS,CAACO,MAAD,CAAT,CAAkBK,GAAjD,CAAsD,iBAAmBL,MAAnB,CAA4B,8BAA5B,CAA6D,+GAAnH,EACAP,SAAS,CAACO,MAAD,CAAT,CAAkBK,GAAlB,CAAsBJ,aAAtB,EACD,CAZD,CAcAJ,WAAW,CAACwB,uCAAZ,CAAsD,QAASA,CAAAA,uCAAT,CAAiDC,IAAjD,CAAuD,CAC3G5B,oCAAoC,CAAG4B,IAAvC,CACD,CAFD,CAIAzB,WAAW,CAAC0B,2BAAZ,CAA0C,QAASA,CAAAA,2BAAT,CAAqCC,QAArC,CAA+C,CACvF5B,wBAAwB,CAAG4B,QAA3B,CACD,CAFD,CAIA3B,WAAW,CAAC4B,oCAAZ,CAAmD,QAASA,CAAAA,oCAAT,CAA8CnB,OAA9C,CAAuD,CACxG,oCAAuBA,OAAvB,EACD,CAFD,CAIA,MAAOT,CAAAA,WAAP,CACD,CA1ED,EAFA,C","sourcesContent":["function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport invariant from 'fbjs/lib/invariant';\nimport unmountComponentAtNode from '../unmountComponentAtNode';\nimport renderApplication, { getApplication as _getApplication } from './renderApplication';\nvar emptyObject = {};\nvar runnables = {};\n\nvar componentProviderInstrumentationHook = function componentProviderInstrumentationHook(component) {\n  return component();\n};\n\nvar wrapperComponentProvider;\n\n/**\n * `AppRegistry` is the JS entry point to running all React Native apps.\n */\nvar AppRegistry =\n/*#__PURE__*/\nfunction () {\n  function AppRegistry() {}\n\n  AppRegistry.getAppKeys = function getAppKeys() {\n    return Object.keys(runnables);\n  };\n\n  AppRegistry.getApplication = function getApplication(appKey, appParameters) {\n    invariant(runnables[appKey] && runnables[appKey].getApplication, \"Application \" + appKey + \" has not been registered. \" + 'This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.');\n    return runnables[appKey].getApplication(appParameters);\n  };\n\n  AppRegistry.registerComponent = function registerComponent(appKey, componentProvider) {\n    runnables[appKey] = {\n      getApplication: function getApplication(appParameters) {\n        return _getApplication(componentProviderInstrumentationHook(componentProvider), appParameters ? appParameters.initialProps : emptyObject, wrapperComponentProvider && wrapperComponentProvider(appParameters));\n      },\n      run: function run(appParameters) {\n        return renderApplication(componentProviderInstrumentationHook(componentProvider), appParameters.initialProps || emptyObject, appParameters.rootTag, wrapperComponentProvider && wrapperComponentProvider(appParameters), appParameters.callback);\n      }\n    };\n    return appKey;\n  };\n\n  AppRegistry.registerConfig = function registerConfig(config) {\n    config.forEach(function (_ref) {\n      var appKey = _ref.appKey,\n          component = _ref.component,\n          run = _ref.run;\n\n      if (run) {\n        AppRegistry.registerRunnable(appKey, run);\n      } else {\n        invariant(component, 'No component provider passed in');\n        AppRegistry.registerComponent(appKey, component);\n      }\n    });\n  } // TODO: fix style sheet creation when using this method\n  ;\n\n  AppRegistry.registerRunnable = function registerRunnable(appKey, run) {\n    runnables[appKey] = {\n      run: run\n    };\n    return appKey;\n  };\n\n  AppRegistry.runApplication = function runApplication(appKey, appParameters) {\n    var isDevelopment = process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test';\n\n    if (isDevelopment) {\n      var params = _objectSpread({}, appParameters);\n\n      params.rootTag = \"#\" + params.rootTag.id;\n      console.log(\"Running application \\\"\" + appKey + \"\\\" with appParams:\\n\", params, \"\\nDevelopment-level warnings: \" + (isDevelopment ? 'ON' : 'OFF') + \".\" + (\"\\nPerformance optimizations: \" + (isDevelopment ? 'OFF' : 'ON') + \".\"));\n    }\n\n    invariant(runnables[appKey] && runnables[appKey].run, \"Application \\\"\" + appKey + \"\\\" has not been registered. \" + 'This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.');\n    runnables[appKey].run(appParameters);\n  };\n\n  AppRegistry.setComponentProviderInstrumentationHook = function setComponentProviderInstrumentationHook(hook) {\n    componentProviderInstrumentationHook = hook;\n  };\n\n  AppRegistry.setWrapperComponentProvider = function setWrapperComponentProvider(provider) {\n    wrapperComponentProvider = provider;\n  };\n\n  AppRegistry.unmountApplicationComponentAtRootTag = function unmountApplicationComponentAtRootTag(rootTag) {\n    unmountComponentAtNode(rootTag);\n  };\n\n  return AppRegistry;\n}();\n\nexport { AppRegistry as default };"]},"metadata":{},"sourceType":"script"}