babylon.uiControls.max.js 89 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650
  1. (function webpackUniversalModuleDefinition(root, factory) {
  2. if(typeof exports === 'object' && typeof module === 'object')
  3. module.exports = factory();
  4. else if(typeof define === 'function' && define.amd)
  5. define("babylonjs-ui-controls", [], factory);
  6. else if(typeof exports === 'object')
  7. exports["babylonjs-ui-controls"] = factory();
  8. else
  9. root["UICONTROLS"] = factory();
  10. })((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function() {
  11. return /******/ (function(modules) { // webpackBootstrap
  12. /******/ // The module cache
  13. /******/ var installedModules = {};
  14. /******/
  15. /******/ // The require function
  16. /******/ function __webpack_require__(moduleId) {
  17. /******/
  18. /******/ // Check if module is in cache
  19. /******/ if(installedModules[moduleId]) {
  20. /******/ return installedModules[moduleId].exports;
  21. /******/ }
  22. /******/ // Create a new module (and put it into the cache)
  23. /******/ var module = installedModules[moduleId] = {
  24. /******/ i: moduleId,
  25. /******/ l: false,
  26. /******/ exports: {}
  27. /******/ };
  28. /******/
  29. /******/ // Execute the module function
  30. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  31. /******/
  32. /******/ // Flag the module as loaded
  33. /******/ module.l = true;
  34. /******/
  35. /******/ // Return the exports of the module
  36. /******/ return module.exports;
  37. /******/ }
  38. /******/
  39. /******/
  40. /******/ // expose the modules object (__webpack_modules__)
  41. /******/ __webpack_require__.m = modules;
  42. /******/
  43. /******/ // expose the module cache
  44. /******/ __webpack_require__.c = installedModules;
  45. /******/
  46. /******/ // define getter function for harmony exports
  47. /******/ __webpack_require__.d = function(exports, name, getter) {
  48. /******/ if(!__webpack_require__.o(exports, name)) {
  49. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  50. /******/ }
  51. /******/ };
  52. /******/
  53. /******/ // define __esModule on exports
  54. /******/ __webpack_require__.r = function(exports) {
  55. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  56. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  57. /******/ }
  58. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  59. /******/ };
  60. /******/
  61. /******/ // create a fake namespace object
  62. /******/ // mode & 1: value is a module id, require it
  63. /******/ // mode & 2: merge all properties of value into the ns
  64. /******/ // mode & 4: return value when already ns object
  65. /******/ // mode & 8|1: behave like require
  66. /******/ __webpack_require__.t = function(value, mode) {
  67. /******/ if(mode & 1) value = __webpack_require__(value);
  68. /******/ if(mode & 8) return value;
  69. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  70. /******/ var ns = Object.create(null);
  71. /******/ __webpack_require__.r(ns);
  72. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  73. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  74. /******/ return ns;
  75. /******/ };
  76. /******/
  77. /******/ // getDefaultExport function for compatibility with non-harmony modules
  78. /******/ __webpack_require__.n = function(module) {
  79. /******/ var getter = module && module.__esModule ?
  80. /******/ function getDefault() { return module['default']; } :
  81. /******/ function getModuleExports() { return module; };
  82. /******/ __webpack_require__.d(getter, 'a', getter);
  83. /******/ return getter;
  84. /******/ };
  85. /******/
  86. /******/ // Object.prototype.hasOwnProperty.call
  87. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  88. /******/
  89. /******/ // __webpack_public_path__
  90. /******/ __webpack_require__.p = "";
  91. /******/
  92. /******/
  93. /******/ // Load entry module and return exports
  94. /******/ return __webpack_require__(__webpack_require__.s = "./legacy/legacy.ts");
  95. /******/ })
  96. /************************************************************************/
  97. /******/ ({
  98. /***/ "../../node_modules/object-assign/index.js":
  99. /*!*********************************************************************!*\
  100. !*** C:/Dev/Babylon/Babylon.js/node_modules/object-assign/index.js ***!
  101. \*********************************************************************/
  102. /*! no static exports found */
  103. /***/ (function(module, exports, __webpack_require__) {
  104. "use strict";
  105. /*
  106. object-assign
  107. (c) Sindre Sorhus
  108. @license MIT
  109. */
  110. /* eslint-disable no-unused-vars */
  111. var getOwnPropertySymbols = Object.getOwnPropertySymbols;
  112. var hasOwnProperty = Object.prototype.hasOwnProperty;
  113. var propIsEnumerable = Object.prototype.propertyIsEnumerable;
  114. function toObject(val) {
  115. if (val === null || val === undefined) {
  116. throw new TypeError('Object.assign cannot be called with null or undefined');
  117. }
  118. return Object(val);
  119. }
  120. function shouldUseNative() {
  121. try {
  122. if (!Object.assign) {
  123. return false;
  124. }
  125. // Detect buggy property enumeration order in older V8 versions.
  126. // https://bugs.chromium.org/p/v8/issues/detail?id=4118
  127. var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
  128. test1[5] = 'de';
  129. if (Object.getOwnPropertyNames(test1)[0] === '5') {
  130. return false;
  131. }
  132. // https://bugs.chromium.org/p/v8/issues/detail?id=3056
  133. var test2 = {};
  134. for (var i = 0; i < 10; i++) {
  135. test2['_' + String.fromCharCode(i)] = i;
  136. }
  137. var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
  138. return test2[n];
  139. });
  140. if (order2.join('') !== '0123456789') {
  141. return false;
  142. }
  143. // https://bugs.chromium.org/p/v8/issues/detail?id=3056
  144. var test3 = {};
  145. 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
  146. test3[letter] = letter;
  147. });
  148. if (Object.keys(Object.assign({}, test3)).join('') !==
  149. 'abcdefghijklmnopqrst') {
  150. return false;
  151. }
  152. return true;
  153. } catch (err) {
  154. // We don't expect any of the above to throw, but better to be safe.
  155. return false;
  156. }
  157. }
  158. module.exports = shouldUseNative() ? Object.assign : function (target, source) {
  159. var from;
  160. var to = toObject(target);
  161. var symbols;
  162. for (var s = 1; s < arguments.length; s++) {
  163. from = Object(arguments[s]);
  164. for (var key in from) {
  165. if (hasOwnProperty.call(from, key)) {
  166. to[key] = from[key];
  167. }
  168. }
  169. if (getOwnPropertySymbols) {
  170. symbols = getOwnPropertySymbols(from);
  171. for (var i = 0; i < symbols.length; i++) {
  172. if (propIsEnumerable.call(from, symbols[i])) {
  173. to[symbols[i]] = from[symbols[i]];
  174. }
  175. }
  176. }
  177. }
  178. return to;
  179. };
  180. /***/ }),
  181. /***/ "../../node_modules/prop-types/checkPropTypes.js":
  182. /*!***************************************************************************!*\
  183. !*** C:/Dev/Babylon/Babylon.js/node_modules/prop-types/checkPropTypes.js ***!
  184. \***************************************************************************/
  185. /*! no static exports found */
  186. /***/ (function(module, exports, __webpack_require__) {
  187. "use strict";
  188. /**
  189. * Copyright (c) 2013-present, Facebook, Inc.
  190. *
  191. * This source code is licensed under the MIT license found in the
  192. * LICENSE file in the root directory of this source tree.
  193. */
  194. var printWarning = function() {};
  195. if (true) {
  196. var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "../../node_modules/prop-types/lib/ReactPropTypesSecret.js");
  197. var loggedTypeFailures = {};
  198. var has = Function.call.bind(Object.prototype.hasOwnProperty);
  199. printWarning = function(text) {
  200. var message = 'Warning: ' + text;
  201. if (typeof console !== 'undefined') {
  202. console.error(message);
  203. }
  204. try {
  205. // --- Welcome to debugging React ---
  206. // This error was thrown as a convenience so that you can use this stack
  207. // to find the callsite that caused this warning to fire.
  208. throw new Error(message);
  209. } catch (x) {}
  210. };
  211. }
  212. /**
  213. * Assert that the values match with the type specs.
  214. * Error messages are memorized and will only be shown once.
  215. *
  216. * @param {object} typeSpecs Map of name to a ReactPropType
  217. * @param {object} values Runtime values that need to be type-checked
  218. * @param {string} location e.g. "prop", "context", "child context"
  219. * @param {string} componentName Name of the component for error messages.
  220. * @param {?Function} getStack Returns the component stack.
  221. * @private
  222. */
  223. function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
  224. if (true) {
  225. for (var typeSpecName in typeSpecs) {
  226. if (has(typeSpecs, typeSpecName)) {
  227. var error;
  228. // Prop type validation may throw. In case they do, we don't want to
  229. // fail the render phase where it didn't fail before. So we log it.
  230. // After these have been cleaned up, we'll let them throw.
  231. try {
  232. // This is intentionally an invariant that gets caught. It's the same
  233. // behavior as without this statement except with a better message.
  234. if (typeof typeSpecs[typeSpecName] !== 'function') {
  235. var err = Error(
  236. (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
  237. 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
  238. );
  239. err.name = 'Invariant Violation';
  240. throw err;
  241. }
  242. error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
  243. } catch (ex) {
  244. error = ex;
  245. }
  246. if (error && !(error instanceof Error)) {
  247. printWarning(
  248. (componentName || 'React class') + ': type specification of ' +
  249. location + ' `' + typeSpecName + '` is invalid; the type checker ' +
  250. 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
  251. 'You may have forgotten to pass an argument to the type checker ' +
  252. 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
  253. 'shape all require an argument).'
  254. );
  255. }
  256. if (error instanceof Error && !(error.message in loggedTypeFailures)) {
  257. // Only monitor this failure once because there tends to be a lot of the
  258. // same error.
  259. loggedTypeFailures[error.message] = true;
  260. var stack = getStack ? getStack() : '';
  261. printWarning(
  262. 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
  263. );
  264. }
  265. }
  266. }
  267. }
  268. }
  269. /**
  270. * Resets warning cache when testing.
  271. *
  272. * @private
  273. */
  274. checkPropTypes.resetWarningCache = function() {
  275. if (true) {
  276. loggedTypeFailures = {};
  277. }
  278. }
  279. module.exports = checkPropTypes;
  280. /***/ }),
  281. /***/ "../../node_modules/prop-types/lib/ReactPropTypesSecret.js":
  282. /*!*************************************************************************************!*\
  283. !*** C:/Dev/Babylon/Babylon.js/node_modules/prop-types/lib/ReactPropTypesSecret.js ***!
  284. \*************************************************************************************/
  285. /*! no static exports found */
  286. /***/ (function(module, exports, __webpack_require__) {
  287. "use strict";
  288. /**
  289. * Copyright (c) 2013-present, Facebook, Inc.
  290. *
  291. * This source code is licensed under the MIT license found in the
  292. * LICENSE file in the root directory of this source tree.
  293. */
  294. var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
  295. module.exports = ReactPropTypesSecret;
  296. /***/ }),
  297. /***/ "../../node_modules/react/cjs/react.development.js":
  298. /*!*****************************************************************************!*\
  299. !*** C:/Dev/Babylon/Babylon.js/node_modules/react/cjs/react.development.js ***!
  300. \*****************************************************************************/
  301. /*! no static exports found */
  302. /***/ (function(module, exports, __webpack_require__) {
  303. "use strict";
  304. /** @license React v16.13.1
  305. * react.development.js
  306. *
  307. * Copyright (c) Facebook, Inc. and its affiliates.
  308. *
  309. * This source code is licensed under the MIT license found in the
  310. * LICENSE file in the root directory of this source tree.
  311. */
  312. if (true) {
  313. (function() {
  314. 'use strict';
  315. var _assign = __webpack_require__(/*! object-assign */ "../../node_modules/object-assign/index.js");
  316. var checkPropTypes = __webpack_require__(/*! prop-types/checkPropTypes */ "../../node_modules/prop-types/checkPropTypes.js");
  317. var ReactVersion = '16.13.1';
  318. // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
  319. // nor polyfill, then a plain number is used for performance.
  320. var hasSymbol = typeof Symbol === 'function' && Symbol.for;
  321. var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
  322. var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
  323. var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
  324. var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
  325. var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
  326. var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
  327. var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
  328. var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
  329. var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
  330. var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
  331. var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
  332. var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
  333. var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
  334. var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
  335. var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
  336. var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
  337. var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
  338. var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
  339. var FAUX_ITERATOR_SYMBOL = '@@iterator';
  340. function getIteratorFn(maybeIterable) {
  341. if (maybeIterable === null || typeof maybeIterable !== 'object') {
  342. return null;
  343. }
  344. var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
  345. if (typeof maybeIterator === 'function') {
  346. return maybeIterator;
  347. }
  348. return null;
  349. }
  350. /**
  351. * Keeps track of the current dispatcher.
  352. */
  353. var ReactCurrentDispatcher = {
  354. /**
  355. * @internal
  356. * @type {ReactComponent}
  357. */
  358. current: null
  359. };
  360. /**
  361. * Keeps track of the current batch's configuration such as how long an update
  362. * should suspend for if it needs to.
  363. */
  364. var ReactCurrentBatchConfig = {
  365. suspense: null
  366. };
  367. /**
  368. * Keeps track of the current owner.
  369. *
  370. * The current owner is the component who should own any components that are
  371. * currently being constructed.
  372. */
  373. var ReactCurrentOwner = {
  374. /**
  375. * @internal
  376. * @type {ReactComponent}
  377. */
  378. current: null
  379. };
  380. var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
  381. function describeComponentFrame (name, source, ownerName) {
  382. var sourceInfo = '';
  383. if (source) {
  384. var path = source.fileName;
  385. var fileName = path.replace(BEFORE_SLASH_RE, '');
  386. {
  387. // In DEV, include code for a common special case:
  388. // prefer "folder/index.js" instead of just "index.js".
  389. if (/^index\./.test(fileName)) {
  390. var match = path.match(BEFORE_SLASH_RE);
  391. if (match) {
  392. var pathBeforeSlash = match[1];
  393. if (pathBeforeSlash) {
  394. var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
  395. fileName = folderName + '/' + fileName;
  396. }
  397. }
  398. }
  399. }
  400. sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
  401. } else if (ownerName) {
  402. sourceInfo = ' (created by ' + ownerName + ')';
  403. }
  404. return '\n in ' + (name || 'Unknown') + sourceInfo;
  405. }
  406. var Resolved = 1;
  407. function refineResolvedLazyComponent(lazyComponent) {
  408. return lazyComponent._status === Resolved ? lazyComponent._result : null;
  409. }
  410. function getWrappedName(outerType, innerType, wrapperName) {
  411. var functionName = innerType.displayName || innerType.name || '';
  412. return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
  413. }
  414. function getComponentName(type) {
  415. if (type == null) {
  416. // Host root, text node or just invalid type.
  417. return null;
  418. }
  419. {
  420. if (typeof type.tag === 'number') {
  421. error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
  422. }
  423. }
  424. if (typeof type === 'function') {
  425. return type.displayName || type.name || null;
  426. }
  427. if (typeof type === 'string') {
  428. return type;
  429. }
  430. switch (type) {
  431. case REACT_FRAGMENT_TYPE:
  432. return 'Fragment';
  433. case REACT_PORTAL_TYPE:
  434. return 'Portal';
  435. case REACT_PROFILER_TYPE:
  436. return "Profiler";
  437. case REACT_STRICT_MODE_TYPE:
  438. return 'StrictMode';
  439. case REACT_SUSPENSE_TYPE:
  440. return 'Suspense';
  441. case REACT_SUSPENSE_LIST_TYPE:
  442. return 'SuspenseList';
  443. }
  444. if (typeof type === 'object') {
  445. switch (type.$$typeof) {
  446. case REACT_CONTEXT_TYPE:
  447. return 'Context.Consumer';
  448. case REACT_PROVIDER_TYPE:
  449. return 'Context.Provider';
  450. case REACT_FORWARD_REF_TYPE:
  451. return getWrappedName(type, type.render, 'ForwardRef');
  452. case REACT_MEMO_TYPE:
  453. return getComponentName(type.type);
  454. case REACT_BLOCK_TYPE:
  455. return getComponentName(type.render);
  456. case REACT_LAZY_TYPE:
  457. {
  458. var thenable = type;
  459. var resolvedThenable = refineResolvedLazyComponent(thenable);
  460. if (resolvedThenable) {
  461. return getComponentName(resolvedThenable);
  462. }
  463. break;
  464. }
  465. }
  466. }
  467. return null;
  468. }
  469. var ReactDebugCurrentFrame = {};
  470. var currentlyValidatingElement = null;
  471. function setCurrentlyValidatingElement(element) {
  472. {
  473. currentlyValidatingElement = element;
  474. }
  475. }
  476. {
  477. // Stack implementation injected by the current renderer.
  478. ReactDebugCurrentFrame.getCurrentStack = null;
  479. ReactDebugCurrentFrame.getStackAddendum = function () {
  480. var stack = ''; // Add an extra top frame while an element is being validated
  481. if (currentlyValidatingElement) {
  482. var name = getComponentName(currentlyValidatingElement.type);
  483. var owner = currentlyValidatingElement._owner;
  484. stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type));
  485. } // Delegate to the injected renderer-specific implementation
  486. var impl = ReactDebugCurrentFrame.getCurrentStack;
  487. if (impl) {
  488. stack += impl() || '';
  489. }
  490. return stack;
  491. };
  492. }
  493. /**
  494. * Used by act() to track whether you're inside an act() scope.
  495. */
  496. var IsSomeRendererActing = {
  497. current: false
  498. };
  499. var ReactSharedInternals = {
  500. ReactCurrentDispatcher: ReactCurrentDispatcher,
  501. ReactCurrentBatchConfig: ReactCurrentBatchConfig,
  502. ReactCurrentOwner: ReactCurrentOwner,
  503. IsSomeRendererActing: IsSomeRendererActing,
  504. // Used by renderers to avoid bundling object-assign twice in UMD bundles:
  505. assign: _assign
  506. };
  507. {
  508. _assign(ReactSharedInternals, {
  509. // These should not be included in production.
  510. ReactDebugCurrentFrame: ReactDebugCurrentFrame,
  511. // Shim for React DOM 16.0.0 which still destructured (but not used) this.
  512. // TODO: remove in React 17.0.
  513. ReactComponentTreeHook: {}
  514. });
  515. }
  516. // by calls to these methods by a Babel plugin.
  517. //
  518. // In PROD (or in packages without access to React internals),
  519. // they are left as they are instead.
  520. function warn(format) {
  521. {
  522. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  523. args[_key - 1] = arguments[_key];
  524. }
  525. printWarning('warn', format, args);
  526. }
  527. }
  528. function error(format) {
  529. {
  530. for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  531. args[_key2 - 1] = arguments[_key2];
  532. }
  533. printWarning('error', format, args);
  534. }
  535. }
  536. function printWarning(level, format, args) {
  537. // When changing this logic, you might want to also
  538. // update consoleWithStackDev.www.js as well.
  539. {
  540. var hasExistingStack = args.length > 0 && typeof args[args.length - 1] === 'string' && args[args.length - 1].indexOf('\n in') === 0;
  541. if (!hasExistingStack) {
  542. var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
  543. var stack = ReactDebugCurrentFrame.getStackAddendum();
  544. if (stack !== '') {
  545. format += '%s';
  546. args = args.concat([stack]);
  547. }
  548. }
  549. var argsWithFormat = args.map(function (item) {
  550. return '' + item;
  551. }); // Careful: RN currently depends on this prefix
  552. argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
  553. // breaks IE9: https://github.com/facebook/react/issues/13610
  554. // eslint-disable-next-line react-internal/no-production-logging
  555. Function.prototype.apply.call(console[level], console, argsWithFormat);
  556. try {
  557. // --- Welcome to debugging React ---
  558. // This error was thrown as a convenience so that you can use this stack
  559. // to find the callsite that caused this warning to fire.
  560. var argIndex = 0;
  561. var message = 'Warning: ' + format.replace(/%s/g, function () {
  562. return args[argIndex++];
  563. });
  564. throw new Error(message);
  565. } catch (x) {}
  566. }
  567. }
  568. var didWarnStateUpdateForUnmountedComponent = {};
  569. function warnNoop(publicInstance, callerName) {
  570. {
  571. var _constructor = publicInstance.constructor;
  572. var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
  573. var warningKey = componentName + "." + callerName;
  574. if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
  575. return;
  576. }
  577. error("Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);
  578. didWarnStateUpdateForUnmountedComponent[warningKey] = true;
  579. }
  580. }
  581. /**
  582. * This is the abstract API for an update queue.
  583. */
  584. var ReactNoopUpdateQueue = {
  585. /**
  586. * Checks whether or not this composite component is mounted.
  587. * @param {ReactClass} publicInstance The instance we want to test.
  588. * @return {boolean} True if mounted, false otherwise.
  589. * @protected
  590. * @final
  591. */
  592. isMounted: function (publicInstance) {
  593. return false;
  594. },
  595. /**
  596. * Forces an update. This should only be invoked when it is known with
  597. * certainty that we are **not** in a DOM transaction.
  598. *
  599. * You may want to call this when you know that some deeper aspect of the
  600. * component's state has changed but `setState` was not called.
  601. *
  602. * This will not invoke `shouldComponentUpdate`, but it will invoke
  603. * `componentWillUpdate` and `componentDidUpdate`.
  604. *
  605. * @param {ReactClass} publicInstance The instance that should rerender.
  606. * @param {?function} callback Called after component is updated.
  607. * @param {?string} callerName name of the calling function in the public API.
  608. * @internal
  609. */
  610. enqueueForceUpdate: function (publicInstance, callback, callerName) {
  611. warnNoop(publicInstance, 'forceUpdate');
  612. },
  613. /**
  614. * Replaces all of the state. Always use this or `setState` to mutate state.
  615. * You should treat `this.state` as immutable.
  616. *
  617. * There is no guarantee that `this.state` will be immediately updated, so
  618. * accessing `this.state` after calling this method may return the old value.
  619. *
  620. * @param {ReactClass} publicInstance The instance that should rerender.
  621. * @param {object} completeState Next state.
  622. * @param {?function} callback Called after component is updated.
  623. * @param {?string} callerName name of the calling function in the public API.
  624. * @internal
  625. */
  626. enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
  627. warnNoop(publicInstance, 'replaceState');
  628. },
  629. /**
  630. * Sets a subset of the state. This only exists because _pendingState is
  631. * internal. This provides a merging strategy that is not available to deep
  632. * properties which is confusing. TODO: Expose pendingState or don't use it
  633. * during the merge.
  634. *
  635. * @param {ReactClass} publicInstance The instance that should rerender.
  636. * @param {object} partialState Next partial state to be merged with state.
  637. * @param {?function} callback Called after component is updated.
  638. * @param {?string} Name of the calling function in the public API.
  639. * @internal
  640. */
  641. enqueueSetState: function (publicInstance, partialState, callback, callerName) {
  642. warnNoop(publicInstance, 'setState');
  643. }
  644. };
  645. var emptyObject = {};
  646. {
  647. Object.freeze(emptyObject);
  648. }
  649. /**
  650. * Base class helpers for the updating state of a component.
  651. */
  652. function Component(props, context, updater) {
  653. this.props = props;
  654. this.context = context; // If a component has string refs, we will assign a different object later.
  655. this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the
  656. // renderer.
  657. this.updater = updater || ReactNoopUpdateQueue;
  658. }
  659. Component.prototype.isReactComponent = {};
  660. /**
  661. * Sets a subset of the state. Always use this to mutate
  662. * state. You should treat `this.state` as immutable.
  663. *
  664. * There is no guarantee that `this.state` will be immediately updated, so
  665. * accessing `this.state` after calling this method may return the old value.
  666. *
  667. * There is no guarantee that calls to `setState` will run synchronously,
  668. * as they may eventually be batched together. You can provide an optional
  669. * callback that will be executed when the call to setState is actually
  670. * completed.
  671. *
  672. * When a function is provided to setState, it will be called at some point in
  673. * the future (not synchronously). It will be called with the up to date
  674. * component arguments (state, props, context). These values can be different
  675. * from this.* because your function may be called after receiveProps but before
  676. * shouldComponentUpdate, and this new state, props, and context will not yet be
  677. * assigned to this.
  678. *
  679. * @param {object|function} partialState Next partial state or function to
  680. * produce next partial state to be merged with current state.
  681. * @param {?function} callback Called after state is updated.
  682. * @final
  683. * @protected
  684. */
  685. Component.prototype.setState = function (partialState, callback) {
  686. if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) {
  687. {
  688. throw Error( "setState(...): takes an object of state variables to update or a function which returns an object of state variables." );
  689. }
  690. }
  691. this.updater.enqueueSetState(this, partialState, callback, 'setState');
  692. };
  693. /**
  694. * Forces an update. This should only be invoked when it is known with
  695. * certainty that we are **not** in a DOM transaction.
  696. *
  697. * You may want to call this when you know that some deeper aspect of the
  698. * component's state has changed but `setState` was not called.
  699. *
  700. * This will not invoke `shouldComponentUpdate`, but it will invoke
  701. * `componentWillUpdate` and `componentDidUpdate`.
  702. *
  703. * @param {?function} callback Called after update is complete.
  704. * @final
  705. * @protected
  706. */
  707. Component.prototype.forceUpdate = function (callback) {
  708. this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
  709. };
  710. /**
  711. * Deprecated APIs. These APIs used to exist on classic React classes but since
  712. * we would like to deprecate them, we're not going to move them over to this
  713. * modern base class. Instead, we define a getter that warns if it's accessed.
  714. */
  715. {
  716. var deprecatedAPIs = {
  717. isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
  718. replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
  719. };
  720. var defineDeprecationWarning = function (methodName, info) {
  721. Object.defineProperty(Component.prototype, methodName, {
  722. get: function () {
  723. warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
  724. return undefined;
  725. }
  726. });
  727. };
  728. for (var fnName in deprecatedAPIs) {
  729. if (deprecatedAPIs.hasOwnProperty(fnName)) {
  730. defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
  731. }
  732. }
  733. }
  734. function ComponentDummy() {}
  735. ComponentDummy.prototype = Component.prototype;
  736. /**
  737. * Convenience component with default shallow equality check for sCU.
  738. */
  739. function PureComponent(props, context, updater) {
  740. this.props = props;
  741. this.context = context; // If a component has string refs, we will assign a different object later.
  742. this.refs = emptyObject;
  743. this.updater = updater || ReactNoopUpdateQueue;
  744. }
  745. var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
  746. pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.
  747. _assign(pureComponentPrototype, Component.prototype);
  748. pureComponentPrototype.isPureReactComponent = true;
  749. // an immutable object with a single mutable value
  750. function createRef() {
  751. var refObject = {
  752. current: null
  753. };
  754. {
  755. Object.seal(refObject);
  756. }
  757. return refObject;
  758. }
  759. var hasOwnProperty = Object.prototype.hasOwnProperty;
  760. var RESERVED_PROPS = {
  761. key: true,
  762. ref: true,
  763. __self: true,
  764. __source: true
  765. };
  766. var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
  767. {
  768. didWarnAboutStringRefs = {};
  769. }
  770. function hasValidRef(config) {
  771. {
  772. if (hasOwnProperty.call(config, 'ref')) {
  773. var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
  774. if (getter && getter.isReactWarning) {
  775. return false;
  776. }
  777. }
  778. }
  779. return config.ref !== undefined;
  780. }
  781. function hasValidKey(config) {
  782. {
  783. if (hasOwnProperty.call(config, 'key')) {
  784. var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
  785. if (getter && getter.isReactWarning) {
  786. return false;
  787. }
  788. }
  789. }
  790. return config.key !== undefined;
  791. }
  792. function defineKeyPropWarningGetter(props, displayName) {
  793. var warnAboutAccessingKey = function () {
  794. {
  795. if (!specialPropKeyWarningShown) {
  796. specialPropKeyWarningShown = true;
  797. error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
  798. }
  799. }
  800. };
  801. warnAboutAccessingKey.isReactWarning = true;
  802. Object.defineProperty(props, 'key', {
  803. get: warnAboutAccessingKey,
  804. configurable: true
  805. });
  806. }
  807. function defineRefPropWarningGetter(props, displayName) {
  808. var warnAboutAccessingRef = function () {
  809. {
  810. if (!specialPropRefWarningShown) {
  811. specialPropRefWarningShown = true;
  812. error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
  813. }
  814. }
  815. };
  816. warnAboutAccessingRef.isReactWarning = true;
  817. Object.defineProperty(props, 'ref', {
  818. get: warnAboutAccessingRef,
  819. configurable: true
  820. });
  821. }
  822. function warnIfStringRefCannotBeAutoConverted(config) {
  823. {
  824. if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
  825. var componentName = getComponentName(ReactCurrentOwner.current.type);
  826. if (!didWarnAboutStringRefs[componentName]) {
  827. error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref);
  828. didWarnAboutStringRefs[componentName] = true;
  829. }
  830. }
  831. }
  832. }
  833. /**
  834. * Factory method to create a new React element. This no longer adheres to
  835. * the class pattern, so do not use new to call it. Also, instanceof check
  836. * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
  837. * if something is a React Element.
  838. *
  839. * @param {*} type
  840. * @param {*} props
  841. * @param {*} key
  842. * @param {string|object} ref
  843. * @param {*} owner
  844. * @param {*} self A *temporary* helper to detect places where `this` is
  845. * different from the `owner` when React.createElement is called, so that we
  846. * can warn. We want to get rid of owner and replace string `ref`s with arrow
  847. * functions, and as long as `this` and owner are the same, there will be no
  848. * change in behavior.
  849. * @param {*} source An annotation object (added by a transpiler or otherwise)
  850. * indicating filename, line number, and/or other information.
  851. * @internal
  852. */
  853. var ReactElement = function (type, key, ref, self, source, owner, props) {
  854. var element = {
  855. // This tag allows us to uniquely identify this as a React Element
  856. $$typeof: REACT_ELEMENT_TYPE,
  857. // Built-in properties that belong on the element
  858. type: type,
  859. key: key,
  860. ref: ref,
  861. props: props,
  862. // Record the component responsible for creating this element.
  863. _owner: owner
  864. };
  865. {
  866. // The validation flag is currently mutative. We put it on
  867. // an external backing store so that we can freeze the whole object.
  868. // This can be replaced with a WeakMap once they are implemented in
  869. // commonly used development environments.
  870. element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
  871. // the validation flag non-enumerable (where possible, which should
  872. // include every environment we run tests in), so the test framework
  873. // ignores it.
  874. Object.defineProperty(element._store, 'validated', {
  875. configurable: false,
  876. enumerable: false,
  877. writable: true,
  878. value: false
  879. }); // self and source are DEV only properties.
  880. Object.defineProperty(element, '_self', {
  881. configurable: false,
  882. enumerable: false,
  883. writable: false,
  884. value: self
  885. }); // Two elements created in two different places should be considered
  886. // equal for testing purposes and therefore we hide it from enumeration.
  887. Object.defineProperty(element, '_source', {
  888. configurable: false,
  889. enumerable: false,
  890. writable: false,
  891. value: source
  892. });
  893. if (Object.freeze) {
  894. Object.freeze(element.props);
  895. Object.freeze(element);
  896. }
  897. }
  898. return element;
  899. };
  900. /**
  901. * Create and return a new ReactElement of the given type.
  902. * See https://reactjs.org/docs/react-api.html#createelement
  903. */
  904. function createElement(type, config, children) {
  905. var propName; // Reserved names are extracted
  906. var props = {};
  907. var key = null;
  908. var ref = null;
  909. var self = null;
  910. var source = null;
  911. if (config != null) {
  912. if (hasValidRef(config)) {
  913. ref = config.ref;
  914. {
  915. warnIfStringRefCannotBeAutoConverted(config);
  916. }
  917. }
  918. if (hasValidKey(config)) {
  919. key = '' + config.key;
  920. }
  921. self = config.__self === undefined ? null : config.__self;
  922. source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object
  923. for (propName in config) {
  924. if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
  925. props[propName] = config[propName];
  926. }
  927. }
  928. } // Children can be more than one argument, and those are transferred onto
  929. // the newly allocated props object.
  930. var childrenLength = arguments.length - 2;
  931. if (childrenLength === 1) {
  932. props.children = children;
  933. } else if (childrenLength > 1) {
  934. var childArray = Array(childrenLength);
  935. for (var i = 0; i < childrenLength; i++) {
  936. childArray[i] = arguments[i + 2];
  937. }
  938. {
  939. if (Object.freeze) {
  940. Object.freeze(childArray);
  941. }
  942. }
  943. props.children = childArray;
  944. } // Resolve default props
  945. if (type && type.defaultProps) {
  946. var defaultProps = type.defaultProps;
  947. for (propName in defaultProps) {
  948. if (props[propName] === undefined) {
  949. props[propName] = defaultProps[propName];
  950. }
  951. }
  952. }
  953. {
  954. if (key || ref) {
  955. var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
  956. if (key) {
  957. defineKeyPropWarningGetter(props, displayName);
  958. }
  959. if (ref) {
  960. defineRefPropWarningGetter(props, displayName);
  961. }
  962. }
  963. }
  964. return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
  965. }
  966. function cloneAndReplaceKey(oldElement, newKey) {
  967. var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
  968. return newElement;
  969. }
  970. /**
  971. * Clone and return a new ReactElement using element as the starting point.
  972. * See https://reactjs.org/docs/react-api.html#cloneelement
  973. */
  974. function cloneElement(element, config, children) {
  975. if (!!(element === null || element === undefined)) {
  976. {
  977. throw Error( "React.cloneElement(...): The argument must be a React element, but you passed " + element + "." );
  978. }
  979. }
  980. var propName; // Original props are copied
  981. var props = _assign({}, element.props); // Reserved names are extracted
  982. var key = element.key;
  983. var ref = element.ref; // Self is preserved since the owner is preserved.
  984. var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a
  985. // transpiler, and the original source is probably a better indicator of the
  986. // true owner.
  987. var source = element._source; // Owner will be preserved, unless ref is overridden
  988. var owner = element._owner;
  989. if (config != null) {
  990. if (hasValidRef(config)) {
  991. // Silently steal the ref from the parent.
  992. ref = config.ref;
  993. owner = ReactCurrentOwner.current;
  994. }
  995. if (hasValidKey(config)) {
  996. key = '' + config.key;
  997. } // Remaining properties override existing props
  998. var defaultProps;
  999. if (element.type && element.type.defaultProps) {
  1000. defaultProps = element.type.defaultProps;
  1001. }
  1002. for (propName in config) {
  1003. if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
  1004. if (config[propName] === undefined && defaultProps !== undefined) {
  1005. // Resolve default props
  1006. props[propName] = defaultProps[propName];
  1007. } else {
  1008. props[propName] = config[propName];
  1009. }
  1010. }
  1011. }
  1012. } // Children can be more than one argument, and those are transferred onto
  1013. // the newly allocated props object.
  1014. var childrenLength = arguments.length - 2;
  1015. if (childrenLength === 1) {
  1016. props.children = children;
  1017. } else if (childrenLength > 1) {
  1018. var childArray = Array(childrenLength);
  1019. for (var i = 0; i < childrenLength; i++) {
  1020. childArray[i] = arguments[i + 2];
  1021. }
  1022. props.children = childArray;
  1023. }
  1024. return ReactElement(element.type, key, ref, self, source, owner, props);
  1025. }
  1026. /**
  1027. * Verifies the object is a ReactElement.
  1028. * See https://reactjs.org/docs/react-api.html#isvalidelement
  1029. * @param {?object} object
  1030. * @return {boolean} True if `object` is a ReactElement.
  1031. * @final
  1032. */
  1033. function isValidElement(object) {
  1034. return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
  1035. }
  1036. var SEPARATOR = '.';
  1037. var SUBSEPARATOR = ':';
  1038. /**
  1039. * Escape and wrap key so it is safe to use as a reactid
  1040. *
  1041. * @param {string} key to be escaped.
  1042. * @return {string} the escaped key.
  1043. */
  1044. function escape(key) {
  1045. var escapeRegex = /[=:]/g;
  1046. var escaperLookup = {
  1047. '=': '=0',
  1048. ':': '=2'
  1049. };
  1050. var escapedString = ('' + key).replace(escapeRegex, function (match) {
  1051. return escaperLookup[match];
  1052. });
  1053. return '$' + escapedString;
  1054. }
  1055. /**
  1056. * TODO: Test that a single child and an array with one item have the same key
  1057. * pattern.
  1058. */
  1059. var didWarnAboutMaps = false;
  1060. var userProvidedKeyEscapeRegex = /\/+/g;
  1061. function escapeUserProvidedKey(text) {
  1062. return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
  1063. }
  1064. var POOL_SIZE = 10;
  1065. var traverseContextPool = [];
  1066. function getPooledTraverseContext(mapResult, keyPrefix, mapFunction, mapContext) {
  1067. if (traverseContextPool.length) {
  1068. var traverseContext = traverseContextPool.pop();
  1069. traverseContext.result = mapResult;
  1070. traverseContext.keyPrefix = keyPrefix;
  1071. traverseContext.func = mapFunction;
  1072. traverseContext.context = mapContext;
  1073. traverseContext.count = 0;
  1074. return traverseContext;
  1075. } else {
  1076. return {
  1077. result: mapResult,
  1078. keyPrefix: keyPrefix,
  1079. func: mapFunction,
  1080. context: mapContext,
  1081. count: 0
  1082. };
  1083. }
  1084. }
  1085. function releaseTraverseContext(traverseContext) {
  1086. traverseContext.result = null;
  1087. traverseContext.keyPrefix = null;
  1088. traverseContext.func = null;
  1089. traverseContext.context = null;
  1090. traverseContext.count = 0;
  1091. if (traverseContextPool.length < POOL_SIZE) {
  1092. traverseContextPool.push(traverseContext);
  1093. }
  1094. }
  1095. /**
  1096. * @param {?*} children Children tree container.
  1097. * @param {!string} nameSoFar Name of the key path so far.
  1098. * @param {!function} callback Callback to invoke with each child found.
  1099. * @param {?*} traverseContext Used to pass information throughout the traversal
  1100. * process.
  1101. * @return {!number} The number of children in this subtree.
  1102. */
  1103. function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
  1104. var type = typeof children;
  1105. if (type === 'undefined' || type === 'boolean') {
  1106. // All of the above are perceived as null.
  1107. children = null;
  1108. }
  1109. var invokeCallback = false;
  1110. if (children === null) {
  1111. invokeCallback = true;
  1112. } else {
  1113. switch (type) {
  1114. case 'string':
  1115. case 'number':
  1116. invokeCallback = true;
  1117. break;
  1118. case 'object':
  1119. switch (children.$$typeof) {
  1120. case REACT_ELEMENT_TYPE:
  1121. case REACT_PORTAL_TYPE:
  1122. invokeCallback = true;
  1123. }
  1124. }
  1125. }
  1126. if (invokeCallback) {
  1127. callback(traverseContext, children, // If it's the only child, treat the name as if it was wrapped in an array
  1128. // so that it's consistent if the number of children grows.
  1129. nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
  1130. return 1;
  1131. }
  1132. var child;
  1133. var nextName;
  1134. var subtreeCount = 0; // Count of children found in the current subtree.
  1135. var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
  1136. if (Array.isArray(children)) {
  1137. for (var i = 0; i < children.length; i++) {
  1138. child = children[i];
  1139. nextName = nextNamePrefix + getComponentKey(child, i);
  1140. subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
  1141. }
  1142. } else {
  1143. var iteratorFn = getIteratorFn(children);
  1144. if (typeof iteratorFn === 'function') {
  1145. {
  1146. // Warn about using Maps as children
  1147. if (iteratorFn === children.entries) {
  1148. if (!didWarnAboutMaps) {
  1149. warn('Using Maps as children is deprecated and will be removed in ' + 'a future major release. Consider converting children to ' + 'an array of keyed ReactElements instead.');
  1150. }
  1151. didWarnAboutMaps = true;
  1152. }
  1153. }
  1154. var iterator = iteratorFn.call(children);
  1155. var step;
  1156. var ii = 0;
  1157. while (!(step = iterator.next()).done) {
  1158. child = step.value;
  1159. nextName = nextNamePrefix + getComponentKey(child, ii++);
  1160. subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
  1161. }
  1162. } else if (type === 'object') {
  1163. var addendum = '';
  1164. {
  1165. addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum();
  1166. }
  1167. var childrenString = '' + children;
  1168. {
  1169. {
  1170. throw Error( "Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + ")." + addendum );
  1171. }
  1172. }
  1173. }
  1174. }
  1175. return subtreeCount;
  1176. }
  1177. /**
  1178. * Traverses children that are typically specified as `props.children`, but
  1179. * might also be specified through attributes:
  1180. *
  1181. * - `traverseAllChildren(this.props.children, ...)`
  1182. * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
  1183. *
  1184. * The `traverseContext` is an optional argument that is passed through the
  1185. * entire traversal. It can be used to store accumulations or anything else that
  1186. * the callback might find relevant.
  1187. *
  1188. * @param {?*} children Children tree object.
  1189. * @param {!function} callback To invoke upon traversing each child.
  1190. * @param {?*} traverseContext Context for traversal.
  1191. * @return {!number} The number of children in this subtree.
  1192. */
  1193. function traverseAllChildren(children, callback, traverseContext) {
  1194. if (children == null) {
  1195. return 0;
  1196. }
  1197. return traverseAllChildrenImpl(children, '', callback, traverseContext);
  1198. }
  1199. /**
  1200. * Generate a key string that identifies a component within a set.
  1201. *
  1202. * @param {*} component A component that could contain a manual key.
  1203. * @param {number} index Index that is used if a manual key is not provided.
  1204. * @return {string}
  1205. */
  1206. function getComponentKey(component, index) {
  1207. // Do some typechecking here since we call this blindly. We want to ensure
  1208. // that we don't block potential future ES APIs.
  1209. if (typeof component === 'object' && component !== null && component.key != null) {
  1210. // Explicit key
  1211. return escape(component.key);
  1212. } // Implicit key determined by the index in the set
  1213. return index.toString(36);
  1214. }
  1215. function forEachSingleChild(bookKeeping, child, name) {
  1216. var func = bookKeeping.func,
  1217. context = bookKeeping.context;
  1218. func.call(context, child, bookKeeping.count++);
  1219. }
  1220. /**
  1221. * Iterates through children that are typically specified as `props.children`.
  1222. *
  1223. * See https://reactjs.org/docs/react-api.html#reactchildrenforeach
  1224. *
  1225. * The provided forEachFunc(child, index) will be called for each
  1226. * leaf child.
  1227. *
  1228. * @param {?*} children Children tree container.
  1229. * @param {function(*, int)} forEachFunc
  1230. * @param {*} forEachContext Context for forEachContext.
  1231. */
  1232. function forEachChildren(children, forEachFunc, forEachContext) {
  1233. if (children == null) {
  1234. return children;
  1235. }
  1236. var traverseContext = getPooledTraverseContext(null, null, forEachFunc, forEachContext);
  1237. traverseAllChildren(children, forEachSingleChild, traverseContext);
  1238. releaseTraverseContext(traverseContext);
  1239. }
  1240. function mapSingleChildIntoContext(bookKeeping, child, childKey) {
  1241. var result = bookKeeping.result,
  1242. keyPrefix = bookKeeping.keyPrefix,
  1243. func = bookKeeping.func,
  1244. context = bookKeeping.context;
  1245. var mappedChild = func.call(context, child, bookKeeping.count++);
  1246. if (Array.isArray(mappedChild)) {
  1247. mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, function (c) {
  1248. return c;
  1249. });
  1250. } else if (mappedChild != null) {
  1251. if (isValidElement(mappedChild)) {
  1252. mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as
  1253. // traverseAllChildren used to do for objects as children
  1254. keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
  1255. }
  1256. result.push(mappedChild);
  1257. }
  1258. }
  1259. function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
  1260. var escapedPrefix = '';
  1261. if (prefix != null) {
  1262. escapedPrefix = escapeUserProvidedKey(prefix) + '/';
  1263. }
  1264. var traverseContext = getPooledTraverseContext(array, escapedPrefix, func, context);
  1265. traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
  1266. releaseTraverseContext(traverseContext);
  1267. }
  1268. /**
  1269. * Maps children that are typically specified as `props.children`.
  1270. *
  1271. * See https://reactjs.org/docs/react-api.html#reactchildrenmap
  1272. *
  1273. * The provided mapFunction(child, key, index) will be called for each
  1274. * leaf child.
  1275. *
  1276. * @param {?*} children Children tree container.
  1277. * @param {function(*, int)} func The map function.
  1278. * @param {*} context Context for mapFunction.
  1279. * @return {object} Object containing the ordered map of results.
  1280. */
  1281. function mapChildren(children, func, context) {
  1282. if (children == null) {
  1283. return children;
  1284. }
  1285. var result = [];
  1286. mapIntoWithKeyPrefixInternal(children, result, null, func, context);
  1287. return result;
  1288. }
  1289. /**
  1290. * Count the number of children that are typically specified as
  1291. * `props.children`.
  1292. *
  1293. * See https://reactjs.org/docs/react-api.html#reactchildrencount
  1294. *
  1295. * @param {?*} children Children tree container.
  1296. * @return {number} The number of children.
  1297. */
  1298. function countChildren(children) {
  1299. return traverseAllChildren(children, function () {
  1300. return null;
  1301. }, null);
  1302. }
  1303. /**
  1304. * Flatten a children object (typically specified as `props.children`) and
  1305. * return an array with appropriately re-keyed children.
  1306. *
  1307. * See https://reactjs.org/docs/react-api.html#reactchildrentoarray
  1308. */
  1309. function toArray(children) {
  1310. var result = [];
  1311. mapIntoWithKeyPrefixInternal(children, result, null, function (child) {
  1312. return child;
  1313. });
  1314. return result;
  1315. }
  1316. /**
  1317. * Returns the first child in a collection of children and verifies that there
  1318. * is only one child in the collection.
  1319. *
  1320. * See https://reactjs.org/docs/react-api.html#reactchildrenonly
  1321. *
  1322. * The current implementation of this function assumes that a single child gets
  1323. * passed without a wrapper, but the purpose of this helper function is to
  1324. * abstract away the particular structure of children.
  1325. *
  1326. * @param {?object} children Child collection structure.
  1327. * @return {ReactElement} The first and only `ReactElement` contained in the
  1328. * structure.
  1329. */
  1330. function onlyChild(children) {
  1331. if (!isValidElement(children)) {
  1332. {
  1333. throw Error( "React.Children.only expected to receive a single React element child." );
  1334. }
  1335. }
  1336. return children;
  1337. }
  1338. function createContext(defaultValue, calculateChangedBits) {
  1339. if (calculateChangedBits === undefined) {
  1340. calculateChangedBits = null;
  1341. } else {
  1342. {
  1343. if (calculateChangedBits !== null && typeof calculateChangedBits !== 'function') {
  1344. error('createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits);
  1345. }
  1346. }
  1347. }
  1348. var context = {
  1349. $$typeof: REACT_CONTEXT_TYPE,
  1350. _calculateChangedBits: calculateChangedBits,
  1351. // As a workaround to support multiple concurrent renderers, we categorize
  1352. // some renderers as primary and others as secondary. We only expect
  1353. // there to be two concurrent renderers at most: React Native (primary) and
  1354. // Fabric (secondary); React DOM (primary) and React ART (secondary).
  1355. // Secondary renderers store their context values on separate fields.
  1356. _currentValue: defaultValue,
  1357. _currentValue2: defaultValue,
  1358. // Used to track how many concurrent renderers this context currently
  1359. // supports within in a single renderer. Such as parallel server rendering.
  1360. _threadCount: 0,
  1361. // These are circular
  1362. Provider: null,
  1363. Consumer: null
  1364. };
  1365. context.Provider = {
  1366. $$typeof: REACT_PROVIDER_TYPE,
  1367. _context: context
  1368. };
  1369. var hasWarnedAboutUsingNestedContextConsumers = false;
  1370. var hasWarnedAboutUsingConsumerProvider = false;
  1371. {
  1372. // A separate object, but proxies back to the original context object for
  1373. // backwards compatibility. It has a different $$typeof, so we can properly
  1374. // warn for the incorrect usage of Context as a Consumer.
  1375. var Consumer = {
  1376. $$typeof: REACT_CONTEXT_TYPE,
  1377. _context: context,
  1378. _calculateChangedBits: context._calculateChangedBits
  1379. }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here
  1380. Object.defineProperties(Consumer, {
  1381. Provider: {
  1382. get: function () {
  1383. if (!hasWarnedAboutUsingConsumerProvider) {
  1384. hasWarnedAboutUsingConsumerProvider = true;
  1385. error('Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');
  1386. }
  1387. return context.Provider;
  1388. },
  1389. set: function (_Provider) {
  1390. context.Provider = _Provider;
  1391. }
  1392. },
  1393. _currentValue: {
  1394. get: function () {
  1395. return context._currentValue;
  1396. },
  1397. set: function (_currentValue) {
  1398. context._currentValue = _currentValue;
  1399. }
  1400. },
  1401. _currentValue2: {
  1402. get: function () {
  1403. return context._currentValue2;
  1404. },
  1405. set: function (_currentValue2) {
  1406. context._currentValue2 = _currentValue2;
  1407. }
  1408. },
  1409. _threadCount: {
  1410. get: function () {
  1411. return context._threadCount;
  1412. },
  1413. set: function (_threadCount) {
  1414. context._threadCount = _threadCount;
  1415. }
  1416. },
  1417. Consumer: {
  1418. get: function () {
  1419. if (!hasWarnedAboutUsingNestedContextConsumers) {
  1420. hasWarnedAboutUsingNestedContextConsumers = true;
  1421. error('Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
  1422. }
  1423. return context.Consumer;
  1424. }
  1425. }
  1426. }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty
  1427. context.Consumer = Consumer;
  1428. }
  1429. {
  1430. context._currentRenderer = null;
  1431. context._currentRenderer2 = null;
  1432. }
  1433. return context;
  1434. }
  1435. function lazy(ctor) {
  1436. var lazyType = {
  1437. $$typeof: REACT_LAZY_TYPE,
  1438. _ctor: ctor,
  1439. // React uses these fields to store the result.
  1440. _status: -1,
  1441. _result: null
  1442. };
  1443. {
  1444. // In production, this would just set it on the object.
  1445. var defaultProps;
  1446. var propTypes;
  1447. Object.defineProperties(lazyType, {
  1448. defaultProps: {
  1449. configurable: true,
  1450. get: function () {
  1451. return defaultProps;
  1452. },
  1453. set: function (newDefaultProps) {
  1454. error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
  1455. defaultProps = newDefaultProps; // Match production behavior more closely:
  1456. Object.defineProperty(lazyType, 'defaultProps', {
  1457. enumerable: true
  1458. });
  1459. }
  1460. },
  1461. propTypes: {
  1462. configurable: true,
  1463. get: function () {
  1464. return propTypes;
  1465. },
  1466. set: function (newPropTypes) {
  1467. error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
  1468. propTypes = newPropTypes; // Match production behavior more closely:
  1469. Object.defineProperty(lazyType, 'propTypes', {
  1470. enumerable: true
  1471. });
  1472. }
  1473. }
  1474. });
  1475. }
  1476. return lazyType;
  1477. }
  1478. function forwardRef(render) {
  1479. {
  1480. if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
  1481. error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
  1482. } else if (typeof render !== 'function') {
  1483. error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
  1484. } else {
  1485. if (render.length !== 0 && render.length !== 2) {
  1486. error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.');
  1487. }
  1488. }
  1489. if (render != null) {
  1490. if (render.defaultProps != null || render.propTypes != null) {
  1491. error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?');
  1492. }
  1493. }
  1494. }
  1495. return {
  1496. $$typeof: REACT_FORWARD_REF_TYPE,
  1497. render: render
  1498. };
  1499. }
  1500. function isValidElementType(type) {
  1501. return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
  1502. type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
  1503. }
  1504. function memo(type, compare) {
  1505. {
  1506. if (!isValidElementType(type)) {
  1507. error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
  1508. }
  1509. }
  1510. return {
  1511. $$typeof: REACT_MEMO_TYPE,
  1512. type: type,
  1513. compare: compare === undefined ? null : compare
  1514. };
  1515. }
  1516. function resolveDispatcher() {
  1517. var dispatcher = ReactCurrentDispatcher.current;
  1518. if (!(dispatcher !== null)) {
  1519. {
  1520. throw Error( "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem." );
  1521. }
  1522. }
  1523. return dispatcher;
  1524. }
  1525. function useContext(Context, unstable_observedBits) {
  1526. var dispatcher = resolveDispatcher();
  1527. {
  1528. if (unstable_observedBits !== undefined) {
  1529. error('useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\n\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://fb.me/rules-of-hooks' : '');
  1530. } // TODO: add a more generic warning for invalid values.
  1531. if (Context._context !== undefined) {
  1532. var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs
  1533. // and nobody should be using this in existing code.
  1534. if (realContext.Consumer === Context) {
  1535. error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');
  1536. } else if (realContext.Provider === Context) {
  1537. error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');
  1538. }
  1539. }
  1540. }
  1541. return dispatcher.useContext(Context, unstable_observedBits);
  1542. }
  1543. function useState(initialState) {
  1544. var dispatcher = resolveDispatcher();
  1545. return dispatcher.useState(initialState);
  1546. }
  1547. function useReducer(reducer, initialArg, init) {
  1548. var dispatcher = resolveDispatcher();
  1549. return dispatcher.useReducer(reducer, initialArg, init);
  1550. }
  1551. function useRef(initialValue) {
  1552. var dispatcher = resolveDispatcher();
  1553. return dispatcher.useRef(initialValue);
  1554. }
  1555. function useEffect(create, deps) {
  1556. var dispatcher = resolveDispatcher();
  1557. return dispatcher.useEffect(create, deps);
  1558. }
  1559. function useLayoutEffect(create, deps) {
  1560. var dispatcher = resolveDispatcher();
  1561. return dispatcher.useLayoutEffect(create, deps);
  1562. }
  1563. function useCallback(callback, deps) {
  1564. var dispatcher = resolveDispatcher();
  1565. return dispatcher.useCallback(callback, deps);
  1566. }
  1567. function useMemo(create, deps) {
  1568. var dispatcher = resolveDispatcher();
  1569. return dispatcher.useMemo(create, deps);
  1570. }
  1571. function useImperativeHandle(ref, create, deps) {
  1572. var dispatcher = resolveDispatcher();
  1573. return dispatcher.useImperativeHandle(ref, create, deps);
  1574. }
  1575. function useDebugValue(value, formatterFn) {
  1576. {
  1577. var dispatcher = resolveDispatcher();
  1578. return dispatcher.useDebugValue(value, formatterFn);
  1579. }
  1580. }
  1581. var propTypesMisspellWarningShown;
  1582. {
  1583. propTypesMisspellWarningShown = false;
  1584. }
  1585. function getDeclarationErrorAddendum() {
  1586. if (ReactCurrentOwner.current) {
  1587. var name = getComponentName(ReactCurrentOwner.current.type);
  1588. if (name) {
  1589. return '\n\nCheck the render method of `' + name + '`.';
  1590. }
  1591. }
  1592. return '';
  1593. }
  1594. function getSourceInfoErrorAddendum(source) {
  1595. if (source !== undefined) {
  1596. var fileName = source.fileName.replace(/^.*[\\\/]/, '');
  1597. var lineNumber = source.lineNumber;
  1598. return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
  1599. }
  1600. return '';
  1601. }
  1602. function getSourceInfoErrorAddendumForProps(elementProps) {
  1603. if (elementProps !== null && elementProps !== undefined) {
  1604. return getSourceInfoErrorAddendum(elementProps.__source);
  1605. }
  1606. return '';
  1607. }
  1608. /**
  1609. * Warn if there's no key explicitly set on dynamic arrays of children or
  1610. * object keys are not valid. This allows us to keep track of children between
  1611. * updates.
  1612. */
  1613. var ownerHasKeyUseWarning = {};
  1614. function getCurrentComponentErrorInfo(parentType) {
  1615. var info = getDeclarationErrorAddendum();
  1616. if (!info) {
  1617. var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
  1618. if (parentName) {
  1619. info = "\n\nCheck the top-level render call using <" + parentName + ">.";
  1620. }
  1621. }
  1622. return info;
  1623. }
  1624. /**
  1625. * Warn if the element doesn't have an explicit key assigned to it.
  1626. * This element is in an array. The array could grow and shrink or be
  1627. * reordered. All children that haven't already been validated are required to
  1628. * have a "key" property assigned to it. Error statuses are cached so a warning
  1629. * will only be shown once.
  1630. *
  1631. * @internal
  1632. * @param {ReactElement} element Element that requires a key.
  1633. * @param {*} parentType element's parent's type.
  1634. */
  1635. function validateExplicitKey(element, parentType) {
  1636. if (!element._store || element._store.validated || element.key != null) {
  1637. return;
  1638. }
  1639. element._store.validated = true;
  1640. var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
  1641. if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
  1642. return;
  1643. }
  1644. ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
  1645. // property, it may be the creator of the child that's responsible for
  1646. // assigning it a key.
  1647. var childOwner = '';
  1648. if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
  1649. // Give the component that originally created this child.
  1650. childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
  1651. }
  1652. setCurrentlyValidatingElement(element);
  1653. {
  1654. error('Each child in a list should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.', currentComponentErrorInfo, childOwner);
  1655. }
  1656. setCurrentlyValidatingElement(null);
  1657. }
  1658. /**
  1659. * Ensure that every element either is passed in a static location, in an
  1660. * array with an explicit keys property defined, or in an object literal
  1661. * with valid key property.
  1662. *
  1663. * @internal
  1664. * @param {ReactNode} node Statically passed child of any type.
  1665. * @param {*} parentType node's parent's type.
  1666. */
  1667. function validateChildKeys(node, parentType) {
  1668. if (typeof node !== 'object') {
  1669. return;
  1670. }
  1671. if (Array.isArray(node)) {
  1672. for (var i = 0; i < node.length; i++) {
  1673. var child = node[i];
  1674. if (isValidElement(child)) {
  1675. validateExplicitKey(child, parentType);
  1676. }
  1677. }
  1678. } else if (isValidElement(node)) {
  1679. // This element was passed in a valid location.
  1680. if (node._store) {
  1681. node._store.validated = true;
  1682. }
  1683. } else if (node) {
  1684. var iteratorFn = getIteratorFn(node);
  1685. if (typeof iteratorFn === 'function') {
  1686. // Entry iterators used to provide implicit keys,
  1687. // but now we print a separate warning for them later.
  1688. if (iteratorFn !== node.entries) {
  1689. var iterator = iteratorFn.call(node);
  1690. var step;
  1691. while (!(step = iterator.next()).done) {
  1692. if (isValidElement(step.value)) {
  1693. validateExplicitKey(step.value, parentType);
  1694. }
  1695. }
  1696. }
  1697. }
  1698. }
  1699. }
  1700. /**
  1701. * Given an element, validate that its props follow the propTypes definition,
  1702. * provided by the type.
  1703. *
  1704. * @param {ReactElement} element
  1705. */
  1706. function validatePropTypes(element) {
  1707. {
  1708. var type = element.type;
  1709. if (type === null || type === undefined || typeof type === 'string') {
  1710. return;
  1711. }
  1712. var name = getComponentName(type);
  1713. var propTypes;
  1714. if (typeof type === 'function') {
  1715. propTypes = type.propTypes;
  1716. } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
  1717. // Inner props are checked in the reconciler.
  1718. type.$$typeof === REACT_MEMO_TYPE)) {
  1719. propTypes = type.propTypes;
  1720. } else {
  1721. return;
  1722. }
  1723. if (propTypes) {
  1724. setCurrentlyValidatingElement(element);
  1725. checkPropTypes(propTypes, element.props, 'prop', name, ReactDebugCurrentFrame.getStackAddendum);
  1726. setCurrentlyValidatingElement(null);
  1727. } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
  1728. propTypesMisspellWarningShown = true;
  1729. error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown');
  1730. }
  1731. if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
  1732. error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
  1733. }
  1734. }
  1735. }
  1736. /**
  1737. * Given a fragment, validate that it can only be provided with fragment props
  1738. * @param {ReactElement} fragment
  1739. */
  1740. function validateFragmentProps(fragment) {
  1741. {
  1742. setCurrentlyValidatingElement(fragment);
  1743. var keys = Object.keys(fragment.props);
  1744. for (var i = 0; i < keys.length; i++) {
  1745. var key = keys[i];
  1746. if (key !== 'children' && key !== 'key') {
  1747. error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
  1748. break;
  1749. }
  1750. }
  1751. if (fragment.ref !== null) {
  1752. error('Invalid attribute `ref` supplied to `React.Fragment`.');
  1753. }
  1754. setCurrentlyValidatingElement(null);
  1755. }
  1756. }
  1757. function createElementWithValidation(type, props, children) {
  1758. var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
  1759. // succeed and there will likely be errors in render.
  1760. if (!validType) {
  1761. var info = '';
  1762. if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
  1763. info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
  1764. }
  1765. var sourceInfo = getSourceInfoErrorAddendumForProps(props);
  1766. if (sourceInfo) {
  1767. info += sourceInfo;
  1768. } else {
  1769. info += getDeclarationErrorAddendum();
  1770. }
  1771. var typeString;
  1772. if (type === null) {
  1773. typeString = 'null';
  1774. } else if (Array.isArray(type)) {
  1775. typeString = 'array';
  1776. } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
  1777. typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
  1778. info = ' Did you accidentally export a JSX literal instead of a component?';
  1779. } else {
  1780. typeString = typeof type;
  1781. }
  1782. {
  1783. error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
  1784. }
  1785. }
  1786. var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.
  1787. // TODO: Drop this when these are no longer allowed as the type argument.
  1788. if (element == null) {
  1789. return element;
  1790. } // Skip key warning if the type isn't valid since our key validation logic
  1791. // doesn't expect a non-string/function type and can throw confusing errors.
  1792. // We don't want exception behavior to differ between dev and prod.
  1793. // (Rendering will throw with a helpful message and as soon as the type is
  1794. // fixed, the key warnings will appear.)
  1795. if (validType) {
  1796. for (var i = 2; i < arguments.length; i++) {
  1797. validateChildKeys(arguments[i], type);
  1798. }
  1799. }
  1800. if (type === REACT_FRAGMENT_TYPE) {
  1801. validateFragmentProps(element);
  1802. } else {
  1803. validatePropTypes(element);
  1804. }
  1805. return element;
  1806. }
  1807. var didWarnAboutDeprecatedCreateFactory = false;
  1808. function createFactoryWithValidation(type) {
  1809. var validatedFactory = createElementWithValidation.bind(null, type);
  1810. validatedFactory.type = type;
  1811. {
  1812. if (!didWarnAboutDeprecatedCreateFactory) {
  1813. didWarnAboutDeprecatedCreateFactory = true;
  1814. warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.');
  1815. } // Legacy hook: remove it
  1816. Object.defineProperty(validatedFactory, 'type', {
  1817. enumerable: false,
  1818. get: function () {
  1819. warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
  1820. Object.defineProperty(this, 'type', {
  1821. value: type
  1822. });
  1823. return type;
  1824. }
  1825. });
  1826. }
  1827. return validatedFactory;
  1828. }
  1829. function cloneElementWithValidation(element, props, children) {
  1830. var newElement = cloneElement.apply(this, arguments);
  1831. for (var i = 2; i < arguments.length; i++) {
  1832. validateChildKeys(arguments[i], newElement.type);
  1833. }
  1834. validatePropTypes(newElement);
  1835. return newElement;
  1836. }
  1837. {
  1838. try {
  1839. var frozenObject = Object.freeze({});
  1840. var testMap = new Map([[frozenObject, null]]);
  1841. var testSet = new Set([frozenObject]); // This is necessary for Rollup to not consider these unused.
  1842. // https://github.com/rollup/rollup/issues/1771
  1843. // TODO: we can remove these if Rollup fixes the bug.
  1844. testMap.set(0, 0);
  1845. testSet.add(0);
  1846. } catch (e) {
  1847. }
  1848. }
  1849. var createElement$1 = createElementWithValidation ;
  1850. var cloneElement$1 = cloneElementWithValidation ;
  1851. var createFactory = createFactoryWithValidation ;
  1852. var Children = {
  1853. map: mapChildren,
  1854. forEach: forEachChildren,
  1855. count: countChildren,
  1856. toArray: toArray,
  1857. only: onlyChild
  1858. };
  1859. exports.Children = Children;
  1860. exports.Component = Component;
  1861. exports.Fragment = REACT_FRAGMENT_TYPE;
  1862. exports.Profiler = REACT_PROFILER_TYPE;
  1863. exports.PureComponent = PureComponent;
  1864. exports.StrictMode = REACT_STRICT_MODE_TYPE;
  1865. exports.Suspense = REACT_SUSPENSE_TYPE;
  1866. exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
  1867. exports.cloneElement = cloneElement$1;
  1868. exports.createContext = createContext;
  1869. exports.createElement = createElement$1;
  1870. exports.createFactory = createFactory;
  1871. exports.createRef = createRef;
  1872. exports.forwardRef = forwardRef;
  1873. exports.isValidElement = isValidElement;
  1874. exports.lazy = lazy;
  1875. exports.memo = memo;
  1876. exports.useCallback = useCallback;
  1877. exports.useContext = useContext;
  1878. exports.useDebugValue = useDebugValue;
  1879. exports.useEffect = useEffect;
  1880. exports.useImperativeHandle = useImperativeHandle;
  1881. exports.useLayoutEffect = useLayoutEffect;
  1882. exports.useMemo = useMemo;
  1883. exports.useReducer = useReducer;
  1884. exports.useRef = useRef;
  1885. exports.useState = useState;
  1886. exports.version = ReactVersion;
  1887. })();
  1888. }
  1889. /***/ }),
  1890. /***/ "../../node_modules/react/index.js":
  1891. /*!*************************************************************!*\
  1892. !*** C:/Dev/Babylon/Babylon.js/node_modules/react/index.js ***!
  1893. \*************************************************************/
  1894. /*! no static exports found */
  1895. /***/ (function(module, exports, __webpack_require__) {
  1896. "use strict";
  1897. if (false) {} else {
  1898. module.exports = __webpack_require__(/*! ./cjs/react.development.js */ "../../node_modules/react/cjs/react.development.js");
  1899. }
  1900. /***/ }),
  1901. /***/ "../../node_modules/tslib/tslib.es6.js":
  1902. /*!*****************************************************************!*\
  1903. !*** C:/Dev/Babylon/Babylon.js/node_modules/tslib/tslib.es6.js ***!
  1904. \*****************************************************************/
  1905. /*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet */
  1906. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1907. "use strict";
  1908. __webpack_require__.r(__webpack_exports__);
  1909. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__extends", function() { return __extends; });
  1910. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__assign", function() { return __assign; });
  1911. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__rest", function() { return __rest; });
  1912. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__decorate", function() { return __decorate; });
  1913. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__param", function() { return __param; });
  1914. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__metadata", function() { return __metadata; });
  1915. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__awaiter", function() { return __awaiter; });
  1916. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__generator", function() { return __generator; });
  1917. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__createBinding", function() { return __createBinding; });
  1918. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__exportStar", function() { return __exportStar; });
  1919. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; });
  1920. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; });
  1921. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; });
  1922. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spreadArrays", function() { return __spreadArrays; });
  1923. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; });
  1924. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; });
  1925. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; });
  1926. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncValues", function() { return __asyncValues; });
  1927. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__makeTemplateObject", function() { return __makeTemplateObject; });
  1928. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importStar", function() { return __importStar; });
  1929. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importDefault", function() { return __importDefault; });
  1930. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldGet", function() { return __classPrivateFieldGet; });
  1931. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldSet", function() { return __classPrivateFieldSet; });
  1932. /*! *****************************************************************************
  1933. Copyright (c) Microsoft Corporation.
  1934. Permission to use, copy, modify, and/or distribute this software for any
  1935. purpose with or without fee is hereby granted.
  1936. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  1937. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  1938. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  1939. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  1940. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  1941. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  1942. PERFORMANCE OF THIS SOFTWARE.
  1943. ***************************************************************************** */
  1944. /* global Reflect, Promise */
  1945. var extendStatics = function(d, b) {
  1946. extendStatics = Object.setPrototypeOf ||
  1947. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  1948. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  1949. return extendStatics(d, b);
  1950. };
  1951. function __extends(d, b) {
  1952. extendStatics(d, b);
  1953. function __() { this.constructor = d; }
  1954. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  1955. }
  1956. var __assign = function() {
  1957. __assign = Object.assign || function __assign(t) {
  1958. for (var s, i = 1, n = arguments.length; i < n; i++) {
  1959. s = arguments[i];
  1960. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  1961. }
  1962. return t;
  1963. }
  1964. return __assign.apply(this, arguments);
  1965. }
  1966. function __rest(s, e) {
  1967. var t = {};
  1968. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  1969. t[p] = s[p];
  1970. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  1971. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
  1972. if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
  1973. t[p[i]] = s[p[i]];
  1974. }
  1975. return t;
  1976. }
  1977. function __decorate(decorators, target, key, desc) {
  1978. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  1979. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  1980. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  1981. return c > 3 && r && Object.defineProperty(target, key, r), r;
  1982. }
  1983. function __param(paramIndex, decorator) {
  1984. return function (target, key) { decorator(target, key, paramIndex); }
  1985. }
  1986. function __metadata(metadataKey, metadataValue) {
  1987. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  1988. }
  1989. function __awaiter(thisArg, _arguments, P, generator) {
  1990. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1991. return new (P || (P = Promise))(function (resolve, reject) {
  1992. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1993. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1994. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1995. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1996. });
  1997. }
  1998. function __generator(thisArg, body) {
  1999. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  2000. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  2001. function verb(n) { return function (v) { return step([n, v]); }; }
  2002. function step(op) {
  2003. if (f) throw new TypeError("Generator is already executing.");
  2004. while (_) try {
  2005. if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
  2006. if (y = 0, t) op = [op[0] & 2, t.value];
  2007. switch (op[0]) {
  2008. case 0: case 1: t = op; break;
  2009. case 4: _.label++; return { value: op[1], done: false };
  2010. case 5: _.label++; y = op[1]; op = [0]; continue;
  2011. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  2012. default:
  2013. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  2014. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  2015. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  2016. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  2017. if (t[2]) _.ops.pop();
  2018. _.trys.pop(); continue;
  2019. }
  2020. op = body.call(thisArg, _);
  2021. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  2022. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  2023. }
  2024. }
  2025. var __createBinding = Object.create ? (function(o, m, k, k2) {
  2026. if (k2 === undefined) k2 = k;
  2027. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  2028. }) : (function(o, m, k, k2) {
  2029. if (k2 === undefined) k2 = k;
  2030. o[k2] = m[k];
  2031. });
  2032. function __exportStar(m, exports) {
  2033. for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
  2034. }
  2035. function __values(o) {
  2036. var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
  2037. if (m) return m.call(o);
  2038. if (o && typeof o.length === "number") return {
  2039. next: function () {
  2040. if (o && i >= o.length) o = void 0;
  2041. return { value: o && o[i++], done: !o };
  2042. }
  2043. };
  2044. throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
  2045. }
  2046. function __read(o, n) {
  2047. var m = typeof Symbol === "function" && o[Symbol.iterator];
  2048. if (!m) return o;
  2049. var i = m.call(o), r, ar = [], e;
  2050. try {
  2051. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  2052. }
  2053. catch (error) { e = { error: error }; }
  2054. finally {
  2055. try {
  2056. if (r && !r.done && (m = i["return"])) m.call(i);
  2057. }
  2058. finally { if (e) throw e.error; }
  2059. }
  2060. return ar;
  2061. }
  2062. function __spread() {
  2063. for (var ar = [], i = 0; i < arguments.length; i++)
  2064. ar = ar.concat(__read(arguments[i]));
  2065. return ar;
  2066. }
  2067. function __spreadArrays() {
  2068. for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
  2069. for (var r = Array(s), k = 0, i = 0; i < il; i++)
  2070. for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
  2071. r[k] = a[j];
  2072. return r;
  2073. };
  2074. function __await(v) {
  2075. return this instanceof __await ? (this.v = v, this) : new __await(v);
  2076. }
  2077. function __asyncGenerator(thisArg, _arguments, generator) {
  2078. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  2079. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  2080. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  2081. function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
  2082. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  2083. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  2084. function fulfill(value) { resume("next", value); }
  2085. function reject(value) { resume("throw", value); }
  2086. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  2087. }
  2088. function __asyncDelegator(o) {
  2089. var i, p;
  2090. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  2091. function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
  2092. }
  2093. function __asyncValues(o) {
  2094. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  2095. var m = o[Symbol.asyncIterator], i;
  2096. return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
  2097. function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
  2098. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  2099. }
  2100. function __makeTemplateObject(cooked, raw) {
  2101. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  2102. return cooked;
  2103. };
  2104. var __setModuleDefault = Object.create ? (function(o, v) {
  2105. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2106. }) : function(o, v) {
  2107. o["default"] = v;
  2108. };
  2109. function __importStar(mod) {
  2110. if (mod && mod.__esModule) return mod;
  2111. var result = {};
  2112. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2113. __setModuleDefault(result, mod);
  2114. return result;
  2115. }
  2116. function __importDefault(mod) {
  2117. return (mod && mod.__esModule) ? mod : { default: mod };
  2118. }
  2119. function __classPrivateFieldGet(receiver, privateMap) {
  2120. if (!privateMap.has(receiver)) {
  2121. throw new TypeError("attempted to get private field on non-instance");
  2122. }
  2123. return privateMap.get(receiver);
  2124. }
  2125. function __classPrivateFieldSet(receiver, privateMap, value) {
  2126. if (!privateMap.has(receiver)) {
  2127. throw new TypeError("attempted to set private field on non-instance");
  2128. }
  2129. privateMap.set(receiver, value);
  2130. return value;
  2131. }
  2132. /***/ }),
  2133. /***/ "../../node_modules/webpack/buildin/global.js":
  2134. /*!***********************************!*\
  2135. !*** (webpack)/buildin/global.js ***!
  2136. \***********************************/
  2137. /*! no static exports found */
  2138. /***/ (function(module, exports) {
  2139. var g;
  2140. // This works in non-strict mode
  2141. g = (function() {
  2142. return this;
  2143. })();
  2144. try {
  2145. // This works if eval is allowed (see CSP)
  2146. g = g || new Function("return this")();
  2147. } catch (e) {
  2148. // This works if the window reference is available
  2149. if (typeof window === "object") g = window;
  2150. }
  2151. // g can still be undefined, but nothing to do about it...
  2152. // We return undefined, instead of nothing here, so it's
  2153. // easier to handle this case. if(!global) { ...}
  2154. module.exports = g;
  2155. /***/ }),
  2156. /***/ "./colorPicker.tsx":
  2157. /*!*************************!*\
  2158. !*** ./colorPicker.tsx ***!
  2159. \*************************/
  2160. /*! exports provided: ColorPicker */
  2161. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2162. "use strict";
  2163. __webpack_require__.r(__webpack_exports__);
  2164. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorPicker", function() { return ColorPicker; });
  2165. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
  2166. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "../../node_modules/react/index.js");
  2167. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  2168. /**
  2169. * Class used to create a color picker
  2170. */
  2171. var ColorPicker = /** @class */ (function (_super) {
  2172. Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ColorPicker, _super);
  2173. function ColorPicker(props) {
  2174. return _super.call(this, props) || this;
  2175. }
  2176. ColorPicker.prototype.render = function () {
  2177. return (react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", null));
  2178. };
  2179. return ColorPicker;
  2180. }(react__WEBPACK_IMPORTED_MODULE_1__["Component"]));
  2181. /***/ }),
  2182. /***/ "./index.ts":
  2183. /*!******************!*\
  2184. !*** ./index.ts ***!
  2185. \******************/
  2186. /*! exports provided: ColorPicker */
  2187. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2188. "use strict";
  2189. __webpack_require__.r(__webpack_exports__);
  2190. /* harmony import */ var _colorPicker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./colorPicker */ "./colorPicker.tsx");
  2191. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorPicker", function() { return _colorPicker__WEBPACK_IMPORTED_MODULE_0__["ColorPicker"]; });
  2192. /***/ }),
  2193. /***/ "./legacy/legacy.ts":
  2194. /*!**************************!*\
  2195. !*** ./legacy/legacy.ts ***!
  2196. \**************************/
  2197. /*! exports provided: ColorPicker */
  2198. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2199. "use strict";
  2200. __webpack_require__.r(__webpack_exports__);
  2201. /* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../index */ "./index.ts");
  2202. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorPicker", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["ColorPicker"]; });
  2203. var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : undefined);
  2204. if (typeof globalObject !== "undefined") {
  2205. globalObject.BABYLON = globalObject.BABYLON || {};
  2206. globalObject.BABYLON.UIControls = _index__WEBPACK_IMPORTED_MODULE_0__;
  2207. }
  2208. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node_modules/webpack/buildin/global.js */ "../../node_modules/webpack/buildin/global.js")))
  2209. /***/ })
  2210. /******/ });
  2211. });
  2212. //# sourceMappingURL=babylon.uiControls.max.js.map