{"version":3,"sources":["webpack:///app/javascript/home/mastodon/mastodon/app/javascript/flavours/glitch/ready.js","webpack:///app/javascript/home/mastodon/mastodon/app/javascript/flavours/glitch/packs/error.js","webpack:///app/javascript/home/mastodon/mastodon/app/javascript/packs/public-path.js"],"names":["ready","callback","Promise","resolve","reject","loaded","_result","result","err","then","catch","includes","document","readyState","addEventListener","image","querySelector","src","removeOuterSlashes","string","replace","cdnHost","__webpack_public_path__","path","arguments","length","undefined","formattedHost","test","formatPublicPath","content","process"],"mappings":"4FAMe,SAASA,EAAMC,GAC5B,OAAO,IAAIC,SAAQ,CAACC,EAASC,KAC3B,SAASC,IAAU,IAADC,EAChB,IAAIC,EACJ,IACEA,EAASN,GACX,CAAE,MAAOO,GAGP,YAFAJ,EAAOI,EAGT,CAE4B,mBAAX,QAAbF,EAAOC,SAAM,IAAAD,OAAA,EAANA,EAAQG,MACjBF,EAAOE,KAAKN,GAASO,MAAMN,GAE3BD,GAEJ,CAEI,CAAC,cAAe,YAAYQ,SAASC,SAASC,YAChDR,IAEAO,SAASE,iBAAiB,mBAAoBT,EAChD,GAEJ,CA/BA,iC,4ECAA,0BAGAL,aAAM,KACJ,MAAMe,EAAQH,SAASI,cAAc,OAErCD,EAAMD,iBAAiB,cAAc,KACnCC,EAAME,IAAM,WAAW,IAGzBF,EAAMD,iBAAiB,cAAc,KACnCC,EAAME,IAAM,WAAW,GACvB,G,qBCRJ,SAASC,EAAmBC,GAC1B,OAAOA,EAAOC,QAAQ,OAAQ,IAAIA,QAAQ,OAAQ,GACpD,CAWA,MAAMC,EAAUT,SAASI,cAAc,uBAGvCM,IAZA,WAAiD,IAAZC,EAAIC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,GACtCG,EAAgBT,EADQM,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,IAM/B,OAJIG,IAAkB,SAASC,KAAKD,KAClCA,EAAiB,KAAIA,KAGf,GAAEA,KADYT,EAAmBK,KAE3C,CAK0BM,CAAiBR,EAAUA,EAAQS,QAAU,GAAIC,Q","file":"js/flavours/glitch/error-8c2c2df357e21797262f.chunk.js","sourcesContent":["// @ts-check\n\n/**\n * @param {(() => void) | (() => Promise)} callback\n * @returns {Promise}\n */\nexport default function ready(callback) {\n return new Promise((resolve, reject) => {\n function loaded() {\n let result;\n try {\n result = callback();\n } catch (err) {\n reject(err);\n\n return;\n }\n\n if (typeof result?.then === 'function') {\n result.then(resolve).catch(reject);\n } else {\n resolve();\n }\n }\n\n if (['interactive', 'complete'].includes(document.readyState)) {\n loaded();\n } else {\n document.addEventListener('DOMContentLoaded', loaded);\n }\n });\n}\n","import 'packs/public-path';\nimport ready from 'flavours/glitch/ready';\n\nready(() => {\n const image = document.querySelector('img');\n\n image.addEventListener('mouseenter', () => {\n image.src = '/oops.gif';\n });\n\n image.addEventListener('mouseleave', () => {\n image.src = '/oops.png';\n });\n});\n","// Dynamically set webpack's loading path depending on a meta header, in order\n// to share the same assets regardless of instance configuration.\n// See https://webpack.js.org/guides/public-path/#on-the-fly\n\nfunction removeOuterSlashes(string) {\n return string.replace(/^\\/*/, '').replace(/\\/*$/, '');\n}\n\nfunction formatPublicPath(host = '', path = '') {\n let formattedHost = removeOuterSlashes(host);\n if (formattedHost && !/^http/i.test(formattedHost)) {\n formattedHost = `//${formattedHost}`;\n }\n const formattedPath = removeOuterSlashes(path);\n return `${formattedHost}/${formattedPath}/`;\n}\n\nconst cdnHost = document.querySelector('meta[name=cdn-host]');\n\n// eslint-disable-next-line no-undef\n__webpack_public_path__ = formatPublicPath(cdnHost ? cdnHost.content : '', process.env.PUBLIC_OUTPUT_PATH);\n"],"sourceRoot":""}