PromoCursed/node_modules/.cache/babel-loader/863a0e2ad8efff327dc92f3fa337edd047f17fbae91df7a317fe5462c34285e1.json

1 line
11 KiB
JSON
Raw Normal View History

2024-08-20 23:25:37 +04:00
{"ast":null,"code":"import _regeneratorRuntime from \"@babel/runtime/helpers/esm/regeneratorRuntime\";\nimport _asyncToGenerator from \"@babel/runtime/helpers/esm/asyncToGenerator\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport * as ReactDOM from 'react-dom';\n// Let compiler not to search module usage\nvar fullClone = _objectSpread({}, ReactDOM);\nvar version = fullClone.version,\n reactRender = fullClone.render,\n unmountComponentAtNode = fullClone.unmountComponentAtNode;\nvar createRoot;\ntry {\n var mainVersion = Number((version || '').split('.')[0]);\n if (mainVersion >= 18) {\n createRoot = fullClone.createRoot;\n }\n} catch (e) {\n // Do nothing;\n}\nfunction toggleWarning(skip) {\n var __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = fullClone.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n if (__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED && _typeof(__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === 'object') {\n __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.usingClientEntryPoint = skip;\n }\n}\nvar MARK = '__rc_react_root__';\n\n// ========================== Render ==========================\n\nfunction modernRender(node, container) {\n toggleWarning(true);\n var root = container[MARK] || createRoot(container);\n toggleWarning(false);\n root.render(node);\n container[MARK] = root;\n}\nfunction legacyRender(node, container) {\n reactRender(node, container);\n}\n\n/** @private Test usage. Not work in prod */\nexport function _r(node, container) {\n if (process.env.NODE_ENV !== 'production') {\n return legacyRender(node, container);\n }\n}\nexport function render(node, container) {\n if (createRoot) {\n modernRender(node, container);\n return;\n }\n legacyRender(node, container);\n}\n\n// ========================= Unmount ==========================\nfunction modernUnmount(_x) {\n return _modernUnmount.apply(this, arguments);\n}\nfunction _modernUnmount() {\n _modernUnmount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(container) {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", Promise.resolve().then(function () {\n var _container$MARK;\n (_container$MARK = container[MARK]) === null || _container$MARK === void 0 || _container$MARK.unmount();\n delete container[MARK];\n }));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _modernUnmount.apply(this, arguments);\n}\nfunction legacyUnmount(container) {\n unmountComponentAtNode(container);\n}\n\n/** @private Test usage. Not work in prod */\nexport function _u(container) {\n if (process.env.NODE_ENV !== 'production') {\n return legacyUnmount(container);\n }\n}\nexport function unmount(_x2) {\n return _unmount.apply(this, arguments);\n}\nfunction _unmount() {\n _unmount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(container) {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n if (!(createRoot !== undefined)) {\n _context2.next = 2;\n break;\n }\n return _context2.abrupt(\"return\", modernUnmount(container));\n case 2:\n legacyUnmount(container);\n case 3:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return _unmount.apply(this, arguments);\n}","map":{"version":3,"names":["_regeneratorRuntime","_asyncToGenerator","_typeof","_objectSpread","ReactDOM","fullClone","version","reactRender","render","unmountComponentAtNode","createRoot","mainVersion","Number","split","e","toggleWarning","skip","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","usingClientEntryPoint","MARK","m