You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
21 KiB
1 lines
21 KiB
{"ast":null,"code":"import \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/web.dom-collections.for-each.js\";\nimport \"core-js/modules/es.array.concat.js\";\nimport \"core-js/modules/es.regexp.exec.js\";\nimport \"core-js/modules/es.string.replace.js\";\n// The error overlay is inspired (and mostly copied) from Create React App (https://github.com/facebookincubator/create-react-app)\n// They, in turn, got inspired by webpack-hot-middleware (https://github.com/glenjamin/webpack-hot-middleware).\nimport ansiHTML from \"ansi-html-community\";\nimport { encode } from \"html-entities\";\nvar colors = {\n reset: [\"transparent\", \"transparent\"],\n black: \"181818\",\n red: \"E36049\",\n green: \"B3CB74\",\n yellow: \"FFD080\",\n blue: \"7CAFC2\",\n magenta: \"7FACCA\",\n cyan: \"C3C2EF\",\n lightgrey: \"EBE7E3\",\n darkgrey: \"6D7891\"\n};\n/** @type {HTMLIFrameElement | null | undefined} */\n\nvar iframeContainerElement;\n/** @type {HTMLDivElement | null | undefined} */\n\nvar containerElement;\n/** @type {Array<(element: HTMLDivElement) => void>} */\n\nvar onLoadQueue = [];\nansiHTML.setColors(colors);\n\nfunction createContainer() {\n iframeContainerElement = document.createElement(\"iframe\");\n iframeContainerElement.id = \"webpack-dev-server-client-overlay\";\n iframeContainerElement.src = \"about:blank\";\n iframeContainerElement.style.position = \"fixed\";\n iframeContainerElement.style.left = 0;\n iframeContainerElement.style.top = 0;\n iframeContainerElement.style.right = 0;\n iframeContainerElement.style.bottom = 0;\n iframeContainerElement.style.width = \"100vw\";\n iframeContainerElement.style.height = \"100vh\";\n iframeContainerElement.style.border = \"none\";\n iframeContainerElement.style.zIndex = 9999999999;\n\n iframeContainerElement.onload = function () {\n containerElement =\n /** @type {Document} */\n\n /** @type {HTMLIFrameElement} */\n iframeContainerElement.contentDocument.createElement(\"div\");\n containerElement.id = \"webpack-dev-server-client-overlay-div\";\n containerElement.style.position = \"fixed\";\n containerElement.style.boxSizing = \"border-box\";\n containerElement.style.left = 0;\n containerElement.style.top = 0;\n containerElement.style.right = 0;\n containerElement.style.bottom = 0;\n containerElement.style.width = \"100vw\";\n containerElement.style.height = \"100vh\";\n containerElement.style.backgroundColor = \"rgba(0, 0, 0, 0.85)\";\n containerElement.style.color = \"#E8E8E8\";\n containerElement.style.fontFamily = \"Menlo, Consolas, monospace\";\n containerElement.style.fontSize = \"large\";\n containerElement.style.padding = \"2rem\";\n containerElement.style.lineHeight = \"1.2\";\n containerElement.style.whiteSpace = \"pre-wrap\";\n containerElement.style.overflow = \"auto\";\n var headerElement = document.createElement(\"span\");\n headerElement.innerText = \"Compiled with problems:\";\n var closeButtonElement = document.createElement(\"button\");\n closeButtonElement.innerText = \"X\";\n closeButtonElement.style.background = \"transparent\";\n closeButtonElement.style.border = \"none\";\n closeButtonElement.style.fontSize = \"20px\";\n closeButtonElement.style.fontWeight = \"bold\";\n closeButtonElement.style.color = \"white\";\n closeButtonElement.style.cursor = \"pointer\";\n closeButtonElement.style.cssFloat = \"right\"; // @ts-ignore\n\n closeButtonElement.style.styleFloat = \"right\";\n closeButtonElement.addEventListener(\"click\", function () {\n hide();\n });\n containerElement.appendChild(headerElement);\n containerElement.appendChild(closeButtonElement);\n containerElement.appendChild(document.createElement(\"br\"));\n containerElement.appendChild(document.createElement(\"br\"));\n /** @type {Document} */\n\n /** @type {HTMLIFrameElement} */\n\n iframeContainerElement.contentDocument.body.appendChild(containerElement);\n onLoadQueue.forEach(function (onLoad) {\n onLoad(\n /** @type {HTMLDivElement} */\n containerElement);\n });\n onLoadQueue = [];\n /** @type {HTMLIFrameElement} */\n\n iframeContainerElement.onload = null;\n };\n\n document.body.appendChild(iframeContainerElement);\n}\n/**\n * @param {(element: HTMLDivElement) => void} callback\n */\n\n\nfunction ensureOverlayExists(callback) {\n if (containerElement) {\n // Everything is ready, call the callback right away.\n callback(containerElement);\n return;\n }\n\n onLoadQueue.push(callback);\n\n if (iframeContainerElement) {\n return;\n }\n\n createContainer();\n} // Successful compilation.\n\n\nfunction hide() {\n if (!iframeContainerElement) {\n return;\n } // Clean up and reset internal state.\n\n\n document.body.removeChild(iframeContainerElement);\n iframeContainerElement = null;\n containerElement = null;\n}\n/**\n * @param {string} type\n * @param {string | { file?: string, moduleName?: string, loc?: string, message?: string }} item\n * @returns {{ header: string, body: string }}\n */\n\n\nfunction formatProblem(type, item) {\n var header = type === \"warning\" ? \"WARNING\" : \"ERROR\";\n var body = \"\";\n\n if (typeof item === \"string\") {\n body += item;\n } else {\n var file = item.file || \"\"; // eslint-disable-next-line no-nested-ternary\n\n var moduleName = item.moduleName ? item.moduleName.indexOf(\"!\") !== -1 ? \"\".concat(item.moduleName.replace(/^(\\s|\\S)*!/, \"\"), \" (\").concat(item.moduleName, \")\") : \"\".concat(item.moduleName) : \"\";\n var loc = item.loc;\n header += \"\".concat(moduleName || file ? \" in \".concat(moduleName ? \"\".concat(moduleName).concat(file ? \" (\".concat(file, \")\") : \"\") : file).concat(loc ? \" \".concat(loc) : \"\") : \"\");\n body += item.message || \"\";\n }\n\n return {\n header: header,\n body: body\n };\n} // Compilation with errors (e.g. syntax error or missing modules).\n\n/**\n * @param {string} type\n * @param {Array<string | { file?: string, moduleName?: string, loc?: string, message?: string }>} messages\n */\n\n\nfunction show(type, messages) {\n ensureOverlayExists(function () {\n messages.forEach(function (message) {\n var entryElement = document.createElement(\"div\");\n var typeElement = document.createElement(\"span\");\n\n var _formatProblem = formatProblem(type, message),\n header = _formatProblem.header,\n body = _formatProblem.body;\n\n typeElement.innerText = header;\n typeElement.style.color = \"#\".concat(colors.red); // Make it look similar to our terminal.\n\n var text = ansiHTML(encode(body));\n var messageTextNode = document.createElement(\"div\");\n messageTextNode.innerHTML = text;\n entryElement.appendChild(typeElement);\n entryElement.appendChild(document.createElement(\"br\"));\n entryElement.appendChild(document.createElement(\"br\"));\n entryElement.appendChild(messageTextNode);\n entryElement.appendChild(document.createElement(\"br\"));\n entryElement.appendChild(document.createElement(\"br\"));\n /** @type {HTMLDivElement} */\n\n containerElement.appendChild(entryElement);\n });\n });\n}\n\nexport { formatProblem, show, hide };","map":{"version":3,"sources":["/tmp/vue-hello/node_modules/webpack-dev-server/client/overlay.js"],"names":["ansiHTML","encode","colors","reset","black","red","green","yellow","blue","magenta","cyan","lightgrey","darkgrey","iframeContainerElement","containerElement","onLoadQueue","setColors","createContainer","document","createElement","id","src","style","position","left","top","right","bottom","width","height","border","zIndex","onload","contentDocument","boxSizing","backgroundColor","color","fontFamily","fontSize","padding","lineHeight","whiteSpace","overflow","headerElement","innerText","closeButtonElement","background","fontWeight","cursor","cssFloat","styleFloat","addEventListener","hide","appendChild","body","forEach","onLoad","ensureOverlayExists","callback","push","removeChild","formatProblem","type","item","header","file","moduleName","indexOf","concat","replace","loc","message","show","messages","entryElement","typeElement","_formatProblem","text","messageTextNode","innerHTML"],"mappings":";;;;;AAAA;AACA;AACA,OAAOA,QAAP,MAAqB,qBAArB;AACA,SAASC,MAAT,QAAuB,eAAvB;AACA,IAAIC,MAAM,GAAG;AACXC,EAAAA,KAAK,EAAE,CAAC,aAAD,EAAgB,aAAhB,CADI;AAEXC,EAAAA,KAAK,EAAE,QAFI;AAGXC,EAAAA,GAAG,EAAE,QAHM;AAIXC,EAAAA,KAAK,EAAE,QAJI;AAKXC,EAAAA,MAAM,EAAE,QALG;AAMXC,EAAAA,IAAI,EAAE,QANK;AAOXC,EAAAA,OAAO,EAAE,QAPE;AAQXC,EAAAA,IAAI,EAAE,QARK;AASXC,EAAAA,SAAS,EAAE,QATA;AAUXC,EAAAA,QAAQ,EAAE;AAVC,CAAb;AAYA;;AAEA,IAAIC,sBAAJ;AACA;;AAEA,IAAIC,gBAAJ;AACA;;AAEA,IAAIC,WAAW,GAAG,EAAlB;AACAf,QAAQ,CAACgB,SAAT,CAAmBd,MAAnB;;AAEA,SAASe,eAAT,GAA2B;AACzBJ,EAAAA,sBAAsB,GAAGK,QAAQ,CAACC,aAAT,CAAuB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AAAA,eAAe,CAACC,SAAhB,GAA4BF,IAA5B;AACAH,MAAAA,YAAY,CAACrB,WAAb,CAAyBsB,WAAzB;AACAD,MAAAA,YAAY,CAACrB,WAAb,CAAyBnC,QAAQ,CAACC,aAAT,CAAuB,IAAvB,CAAzB;AACAuD,MAAAA,YAAY,CAACrB,WAAb,CAAyBnC,QAAQ,CAACC,aAAT,CAAuB,IAAvB,CAAzB;AACAuD,MAAAA,YAAY,CAACrB,WAAb,CAAyByB,eAAzB;AACAJ,MAAAA,YAAY,CAACrB,WAAb,CAAyBnC,QAAQ,CAACC,aAAT,CAAuB,IAAvB,CAAzB;AACAuD,MAAAA,YAAY,CAACrB,WAAb,CAAyBnC,QAAQ,CAACC,aAAT,CAAuB,IAAvB,CAAzB;AACA;;AAEAL,MAAAA,gBAAgB,CAACuC,WAAjB,CAA6BqB,YAA7B;AACD,KAvBD;AAwBD,GAzBkB,CAAnB;AA0BD;;AAED,SAASb,aAAT,EAAwBW,IAAxB,EAA8BpB,IAA9B","sourcesContent":["// The error overlay is inspired (and mostly copied) from Create React App (https://github.com/facebookincubator/create-react-app)\n// They, in turn, got inspired by webpack-hot-middleware (https://github.com/glenjamin/webpack-hot-middleware).\nimport ansiHTML from \"ansi-html-community\";\nimport { encode } from \"html-entities\";\nvar colors = {\n reset: [\"transparent\", \"transparent\"],\n black: \"181818\",\n red: \"E36049\",\n green: \"B3CB74\",\n yellow: \"FFD080\",\n blue: \"7CAFC2\",\n magenta: \"7FACCA\",\n cyan: \"C3C2EF\",\n lightgrey: \"EBE7E3\",\n darkgrey: \"6D7891\"\n};\n/** @type {HTMLIFrameElement | null | undefined} */\n\nvar iframeContainerElement;\n/** @type {HTMLDivElement | null | undefined} */\n\nvar containerElement;\n/** @type {Array<(element: HTMLDivElement) => void>} */\n\nvar onLoadQueue = [];\nansiHTML.setColors(colors);\n\nfunction createContainer() {\n iframeContainerElement = document.createElement(\"iframe\");\n iframeContainerElement.id = \"webpack-dev-server-client-overlay\";\n iframeContainerElement.src = \"about:blank\";\n iframeContainerElement.style.position = \"fixed\";\n iframeContainerElement.style.left = 0;\n iframeContainerElement.style.top = 0;\n iframeContainerElement.style.right = 0;\n iframeContainerElement.style.bottom = 0;\n iframeContainerElement.style.width = \"100vw\";\n iframeContainerElement.style.height = \"100vh\";\n iframeContainerElement.style.border = \"none\";\n iframeContainerElement.style.zIndex = 9999999999;\n\n iframeContainerElement.onload = function () {\n containerElement =\n /** @type {Document} */\n\n /** @type {HTMLIFrameElement} */\n iframeContainerElement.contentDocument.createElement(\"div\");\n containerElement.id = \"webpack-dev-server-client-overlay-div\";\n containerElement.style.position = \"fixed\";\n containerElement.style.boxSizing = \"border-box\";\n containerElement.style.left = 0;\n containerElement.style.top = 0;\n containerElement.style.right = 0;\n containerElement.style.bottom = 0;\n containerElement.style.width = \"100vw\";\n containerElement.style.height = \"100vh\";\n containerElement.style.backgroundColor = \"rgba(0, 0, 0, 0.85)\";\n containerElement.style.color = \"#E8E8E8\";\n containerElement.style.fontFamily = \"Menlo, Consolas, monospace\";\n containerElement.style.fontSize = \"large\";\n containerElement.style.padding = \"2rem\";\n containerElement.style.lineHeight = \"1.2\";\n containerElement.style.whiteSpace = \"pre-wrap\";\n containerElement.style.overflow = \"auto\";\n var headerElement = document.createElement(\"span\");\n headerElement.innerText = \"Compiled with problems:\";\n var closeButtonElement = document.createElement(\"button\");\n closeButtonElement.innerText = \"X\";\n closeButtonElement.style.background = \"transparent\";\n closeButtonElement.style.border = \"none\";\n closeButtonElement.style.fontSize = \"20px\";\n closeButtonElement.style.fontWeight = \"bold\";\n closeButtonElement.style.color = \"white\";\n closeButtonElement.style.cursor = \"pointer\";\n closeButtonElement.style.cssFloat = \"right\"; // @ts-ignore\n\n closeButtonElement.style.styleFloat = \"right\";\n closeButtonElement.addEventListener(\"click\", function () {\n hide();\n });\n containerElement.appendChild(headerElement);\n containerElement.appendChild(closeButtonElement);\n containerElement.appendChild(document.createElement(\"br\"));\n containerElement.appendChild(document.createElement(\"br\"));\n /** @type {Document} */\n\n /** @type {HTMLIFrameElement} */\n iframeContainerElement.contentDocument.body.appendChild(containerElement);\n onLoadQueue.forEach(function (onLoad) {\n onLoad(\n /** @type {HTMLDivElement} */\n containerElement);\n });\n onLoadQueue = [];\n /** @type {HTMLIFrameElement} */\n\n iframeContainerElement.onload = null;\n };\n\n document.body.appendChild(iframeContainerElement);\n}\n/**\n * @param {(element: HTMLDivElement) => void} callback\n */\n\n\nfunction ensureOverlayExists(callback) {\n if (containerElement) {\n // Everything is ready, call the callback right away.\n callback(containerElement);\n return;\n }\n\n onLoadQueue.push(callback);\n\n if (iframeContainerElement) {\n return;\n }\n\n createContainer();\n} // Successful compilation.\n\n\nfunction hide() {\n if (!iframeContainerElement) {\n return;\n } // Clean up and reset internal state.\n\n\n document.body.removeChild(iframeContainerElement);\n iframeContainerElement = null;\n containerElement = null;\n}\n/**\n * @param {string} type\n * @param {string | { file?: string, moduleName?: string, loc?: string, message?: string }} item\n * @returns {{ header: string, body: string }}\n */\n\n\nfunction formatProblem(type, item) {\n var header = type === \"warning\" ? \"WARNING\" : \"ERROR\";\n var body = \"\";\n\n if (typeof item === \"string\") {\n body += item;\n } else {\n var file = item.file || \"\"; // eslint-disable-next-line no-nested-ternary\n\n var moduleName = item.moduleName ? item.moduleName.indexOf(\"!\") !== -1 ? \"\".concat(item.moduleName.replace(/^(\\s|\\S)*!/, \"\"), \" (\").concat(item.moduleName, \")\") : \"\".concat(item.moduleName) : \"\";\n var loc = item.loc;\n header += \"\".concat(moduleName || file ? \" in \".concat(moduleName ? \"\".concat(moduleName).concat(file ? \" (\".concat(file, \")\") : \"\") : file).concat(loc ? \" \".concat(loc) : \"\") : \"\");\n body += item.message || \"\";\n }\n\n return {\n header: header,\n body: body\n };\n} // Compilation with errors (e.g. syntax error or missing modules).\n\n/**\n * @param {string} type\n * @param {Array<string | { file?: string, moduleName?: string, loc?: string, message?: string }>} messages\n */\n\n\nfunction show(type, messages) {\n ensureOverlayExists(function () {\n messages.forEach(function (message) {\n var entryElement = document.createElement(\"div\");\n var typeElement = document.createElement(\"span\");\n\n var _formatProblem = formatProblem(type, message),\n header = _formatProblem.header,\n body = _formatProblem.body;\n\n typeElement.innerText = header;\n typeElement.style.color = \"#\".concat(colors.red); // Make it look similar to our terminal.\n\n var text = ansiHTML(encode(body));\n var messageTextNode = document.createElement(\"div\");\n messageTextNode.innerHTML = text;\n entryElement.appendChild(typeElement);\n entryElement.appendChild(document.createElement(\"br\"));\n entryElement.appendChild(document.createElement(\"br\"));\n entryElement.appendChild(messageTextNode);\n entryElement.appendChild(document.createElement(\"br\"));\n entryElement.appendChild(document.createElement(\"br\"));\n /** @type {HTMLDivElement} */\n\n containerElement.appendChild(entryElement);\n });\n });\n}\n\nexport { formatProblem, show, hide };"]},"metadata":{},"sourceType":"module"} |