mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-25 09:55:15 +00:00
1 line
15 KiB
JSON
1 line
15 KiB
JSON
{"ast":null,"code":"/* global __webpack_require__ */\nconst Refresh = require('react-refresh/runtime');\n/**\n * Extracts exports from a webpack module object.\n * @param {string} moduleId A Webpack module ID.\n * @returns {*} An exports object from the module.\n */\n\n\nfunction getModuleExports(moduleId) {\n return __webpack_require__.c[moduleId].exports;\n}\n/**\n * Calculates the signature of a React refresh boundary.\n * If this signature changes, it's unsafe to accept the boundary.\n *\n * This implementation is based on the one in [Metro](https://github.com/facebook/metro/blob/907d6af22ac6ebe58572be418e9253a90665ecbd/packages/metro/src/lib/polyfills/require.js#L795-L816).\n * @param {*} moduleExports A Webpack module exports object.\n * @returns {string[]} A React refresh boundary signature array.\n */\n\n\nfunction getReactRefreshBoundarySignature(moduleExports) {\n const signature = [];\n signature.push(Refresh.getFamilyByType(moduleExports));\n\n if (moduleExports == null || typeof moduleExports !== 'object') {\n // Exit if we can't iterate over exports.\n return signature;\n }\n\n for (let key in moduleExports) {\n if (key === '__esModule') {\n continue;\n }\n\n signature.push(key);\n signature.push(Refresh.getFamilyByType(moduleExports[key]));\n }\n\n return signature;\n}\n/**\n * Creates a helper that performs a delayed React refresh.\n * @returns {enqueueUpdate} A debounced React refresh function.\n */\n\n\nfunction createDebounceUpdate() {\n /**\n * A cached setTimeout handler.\n * @type {number | undefined}\n */\n let refreshTimeout;\n /**\n * Performs react refresh on a delay and clears the error overlay.\n * @param {function(): void} callback\n * @returns {void}\n */\n\n function enqueueUpdate(callback) {\n if (typeof refreshTimeout === 'undefined') {\n refreshTimeout = setTimeout(function () {\n refreshTimeout = undefined;\n Refresh.performReactRefresh();\n callback();\n }, 30);\n }\n }\n\n return enqueueUpdate;\n}\n/**\n * Checks if all exports are likely a React component.\n *\n * This implementation is based on the one in [Metro](https://github.com/facebook/metro/blob/febdba2383113c88296c61e28e4ef6a7f4939fda/packages/metro/src/lib/polyfills/require.js#L748-L774).\n * @param {*} moduleExports A Webpack module exports object.\n * @returns {boolean} Whether the exports are React component like.\n */\n\n\nfunction isReactRefreshBoundary(moduleExports) {\n if (Refresh.isLikelyComponentType(moduleExports)) {\n return true;\n }\n\n if (moduleExports === undefined || moduleExports === null || typeof moduleExports !== 'object') {\n // Exit if we can't iterate over exports.\n return false;\n }\n\n let hasExports = false;\n let areAllExportsComponents = true;\n\n for (let key in moduleExports) {\n hasExports = true; // This is the ES Module indicator flag\n\n if (key === '__esModule') {\n continue;\n } // We can (and have to) safely execute getters here,\n // as Webpack manually assigns harmony exports to getters,\n // without any side-effects attached.\n // Ref: https://github.com/webpack/webpack/blob/b93048643fe74de2a6931755911da1212df55897/lib/MainTemplate.js#L281\n\n\n const exportValue = moduleExports[key];\n\n if (!Refresh.isLikelyComponentType(exportValue)) {\n areAllExportsComponents = false;\n }\n }\n\n return hasExports && areAllExportsComponents;\n}\n/**\n * Checks if exports are likely a React component and registers them.\n *\n * This implementation is based on the one in [Metro](https://github.com/facebook/metro/blob/febdba2383113c88296c61e28e4ef6a7f4939fda/packages/metro/src/lib/polyfills/require.js#L818-L835).\n * @param {*} moduleExports A Webpack module exports object.\n * @param {string} moduleId A Webpack module ID.\n * @returns {void}\n */\n\n\nfunction registerExportsForReactRefresh(moduleExports, moduleId) {\n if (Refresh.isLikelyComponentType(moduleExports)) {\n // Register module.exports if it is likely a component\n Refresh.register(moduleExports, moduleId + ' %exports%');\n }\n\n if (moduleExports === undefined || moduleExports === null || typeof moduleExports !== 'object') {\n // Exit if we can't iterate over the exports.\n return;\n }\n\n for (let key in moduleExports) {\n // Skip registering the ES Module indicator\n if (key === '__esModule') {\n continue;\n }\n\n const exportValue = moduleExports[key];\n\n if (Refresh.isLikelyComponentType(exportValue)) {\n const typeID = moduleId + ' %exports% ' + key;\n Refresh.register(exportValue, typeID);\n }\n }\n}\n/**\n * Compares previous and next module objects to check for mutated boundaries.\n *\n * This implementation is based on the one in [Metro](https://github.com/facebook/metro/blob/907d6af22ac6ebe58572be418e9253a90665ecbd/packages/metro/src/lib/polyfills/require.js#L776-L792).\n * @param {*} prevExports The current Webpack module exports object.\n * @param {*} nextExports The next Webpack module exports object.\n * @returns {boolean} Whether the React refresh boundary should be invalidated.\n */\n\n\nfunction shouldInvalidateReactRefreshBoundary(prevExports, nextExports) {\n const prevSignature = getReactRefreshBoundarySignature(prevExports);\n const nextSignature = getReactRefreshBoundarySignature(nextExports);\n\n if (prevSignature.length !== nextSignature.length) {\n return true;\n }\n\n for (let i = 0; i < nextSignature.length; i += 1) {\n if (prevSignature[i] !== nextSignature[i]) {\n return true;\n }\n }\n\n return false;\n}\n\nmodule.exports = Object.freeze({\n enqueueUpdate: createDebounceUpdate(),\n getModuleExports: getModuleExports,\n isReactRefreshBoundary: isReactRefreshBoundary,\n shouldInvalidateReactRefreshBoundary: shouldInvalidateReactRefreshBoundary,\n registerExportsForReactRefresh: registerExportsForReactRefresh\n});","map":{"version":3,"sources":["/app/node_modules/@pmmmwh/react-refresh-webpack-plugin/lib/runtime/RefreshUtils.js"],"names":["Refresh","require","getModuleExports","moduleId","__webpack_require__","c","exports","getReactRefreshBoundarySignature","moduleExports","signature","push","getFamilyByType","key","createDebounceUpdate","refreshTimeout","enqueueUpdate","callback","setTimeout","undefined","performReactRefresh","isReactRefreshBoundary","isLikelyComponentType","hasExports","areAllExportsComponents","exportValue","registerExportsForReactRefresh","register","typeID","shouldInvalidateReactRefreshBoundary","prevExports","nextExports","prevSignature","nextSignature","length","i","module","Object","freeze"],"mappings":"AAAA;AACA,MAAMA,OAAO,GAAGC,OAAO,CAAC,uBAAD,CAAvB;AAEA;AACA;AACA;AACA;AACA;;;AACA,SAASC,gBAAT,CAA0BC,QAA1B,EAAoC;AAClC,SAAOC,mBAAmB,CAACC,CAApB,CAAsBF,QAAtB,EAAgCG,OAAvC;AACD;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASC,gCAAT,CAA0CC,aAA1C,EAAyD;AACvD,QAAM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A3D,EAAwE;AACtE,QAAMC,aAAa,GAAGxB,gCAAgC,CAACsB,WAAD,CAAtD;AACA,QAAMG,aAAa,GAAGzB,gCAAgC,CAACuB,WAAD,CAAtD;;AAEA,MAAIC,aAAa,CAACE,MAAd,KAAyBD,aAAa,CAACC,MAA3C,EAAmD;AACjD,WAAO,IAAP;AACD;;AAED,OAAK,IAAIC,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGF,aAAa,CAACC,MAAlC,EAA0CC,CAAC,IAAI,CAA/C,EAAkD;AAChD,QAAIH,aAAa,CAACG,CAAD,CAAb,KAAqBF,aAAa,CAACE,CAAD,CAAtC,EAA2C;AACzC,aAAO,IAAP;AACD;AACF;;AAED,SAAO,KAAP;AACD;;AAEDC,MAAM,CAAC7B,OAAP,GAAiB8B,MAAM,CAACC,MAAP,CAAc;AAC7BtB,EAAAA,aAAa,EAAEF,oBAAoB,EADN;AAE7BX,EAAAA,gBAAgB,EAAEA,gBAFW;AAG7BkB,EAAAA,sBAAsB,EAAEA,sBAHK;AAI7BQ,EAAAA,oCAAoC,EAAEA,oCAJT;AAK7BH,EAAAA,8BAA8B,EAAEA;AALH,CAAd,CAAjB","sourcesContent":["/* global __webpack_require__ */\nconst Refresh = require('react-refresh/runtime');\n\n/**\n * Extracts exports from a webpack module object.\n * @param {string} moduleId A Webpack module ID.\n * @returns {*} An exports object from the module.\n */\nfunction getModuleExports(moduleId) {\n return __webpack_require__.c[moduleId].exports;\n}\n\n/**\n * Calculates the signature of a React refresh boundary.\n * If this signature changes, it's unsafe to accept the boundary.\n *\n * This implementation is based on the one in [Metro](https://github.com/facebook/metro/blob/907d6af22ac6ebe58572be418e9253a90665ecbd/packages/metro/src/lib/polyfills/require.js#L795-L816).\n * @param {*} moduleExports A Webpack module exports object.\n * @returns {string[]} A React refresh boundary signature array.\n */\nfunction getReactRefreshBoundarySignature(moduleExports) {\n const signature = [];\n signature.push(Refresh.getFamilyByType(moduleExports));\n\n if (moduleExports == null || typeof moduleExports !== 'object') {\n // Exit if we can't iterate over exports.\n return signature;\n }\n\n for (let key in moduleExports) {\n if (key === '__esModule') {\n continue;\n }\n\n signature.push(key);\n signature.push(Refresh.getFamilyByType(moduleExports[key]));\n }\n\n return signature;\n}\n\n/**\n * Creates a helper that performs a delayed React refresh.\n * @returns {enqueueUpdate} A debounced React refresh function.\n */\nfunction createDebounceUpdate() {\n /**\n * A cached setTimeout handler.\n * @type {number | undefined}\n */\n let refreshTimeout;\n\n /**\n * Performs react refresh on a delay and clears the error overlay.\n * @param {function(): void} callback\n * @returns {void}\n */\n function enqueueUpdate(callback) {\n if (typeof refreshTimeout === 'undefined') {\n refreshTimeout = setTimeout(function () {\n refreshTimeout = undefined;\n Refresh.performReactRefresh();\n callback();\n }, 30);\n }\n }\n\n return enqueueUpdate;\n}\n\n/**\n * Checks if all exports are likely a React component.\n *\n * This implementation is based on the one in [Metro](https://github.com/facebook/metro/blob/febdba2383113c88296c61e28e4ef6a7f4939fda/packages/metro/src/lib/polyfills/require.js#L748-L774).\n * @param {*} moduleExports A Webpack module exports object.\n * @returns {boolean} Whether the exports are React component like.\n */\nfunction isReactRefreshBoundary(moduleExports) {\n if (Refresh.isLikelyComponentType(moduleExports)) {\n return true;\n }\n if (moduleExports === undefined || moduleExports === null || typeof moduleExports !== 'object') {\n // Exit if we can't iterate over exports.\n return false;\n }\n\n let hasExports = false;\n let areAllExportsComponents = true;\n for (let key in moduleExports) {\n hasExports = true;\n\n // This is the ES Module indicator flag\n if (key === '__esModule') {\n continue;\n }\n\n // We can (and have to) safely execute getters here,\n // as Webpack manually assigns harmony exports to getters,\n // without any side-effects attached.\n // Ref: https://github.com/webpack/webpack/blob/b93048643fe74de2a6931755911da1212df55897/lib/MainTemplate.js#L281\n const exportValue = moduleExports[key];\n if (!Refresh.isLikelyComponentType(exportValue)) {\n areAllExportsComponents = false;\n }\n }\n\n return hasExports && areAllExportsComponents;\n}\n\n/**\n * Checks if exports are likely a React component and registers them.\n *\n * This implementation is based on the one in [Metro](https://github.com/facebook/metro/blob/febdba2383113c88296c61e28e4ef6a7f4939fda/packages/metro/src/lib/polyfills/require.js#L818-L835).\n * @param {*} moduleExports A Webpack module exports object.\n * @param {string} moduleId A Webpack module ID.\n * @returns {void}\n */\nfunction registerExportsForReactRefresh(moduleExports, moduleId) {\n if (Refresh.isLikelyComponentType(moduleExports)) {\n // Register module.exports if it is likely a component\n Refresh.register(moduleExports, moduleId + ' %exports%');\n }\n\n if (moduleExports === undefined || moduleExports === null || typeof moduleExports !== 'object') {\n // Exit if we can't iterate over the exports.\n return;\n }\n\n for (let key in moduleExports) {\n // Skip registering the ES Module indicator\n if (key === '__esModule') {\n continue;\n }\n\n const exportValue = moduleExports[key];\n if (Refresh.isLikelyComponentType(exportValue)) {\n const typeID = moduleId + ' %exports% ' + key;\n Refresh.register(exportValue, typeID);\n }\n }\n}\n\n/**\n * Compares previous and next module objects to check for mutated boundaries.\n *\n * This implementation is based on the one in [Metro](https://github.com/facebook/metro/blob/907d6af22ac6ebe58572be418e9253a90665ecbd/packages/metro/src/lib/polyfills/require.js#L776-L792).\n * @param {*} prevExports The current Webpack module exports object.\n * @param {*} nextExports The next Webpack module exports object.\n * @returns {boolean} Whether the React refresh boundary should be invalidated.\n */\nfunction shouldInvalidateReactRefreshBoundary(prevExports, nextExports) {\n const prevSignature = getReactRefreshBoundarySignature(prevExports);\n const nextSignature = getReactRefreshBoundarySignature(nextExports);\n\n if (prevSignature.length !== nextSignature.length) {\n return true;\n }\n\n for (let i = 0; i < nextSignature.length; i += 1) {\n if (prevSignature[i] !== nextSignature[i]) {\n return true;\n }\n }\n\n return false;\n}\n\nmodule.exports = Object.freeze({\n enqueueUpdate: createDebounceUpdate(),\n getModuleExports: getModuleExports,\n isReactRefreshBoundary: isReactRefreshBoundary,\n shouldInvalidateReactRefreshBoundary: shouldInvalidateReactRefreshBoundary,\n registerExportsForReactRefresh: registerExportsForReactRefresh,\n});\n"]},"metadata":{},"sourceType":"script"} |