{"version":3,"sources":["webpack:///./node_modules/aurelia-bootstrapper/dist/native-modules/aurelia-bootstrapper.js"],"names":["bootstrapPromises","Symbol","iterator","startResolve","startPromise","Promise","resolve","host","global","isNodeLike","process","browser","createLoader","Loader","reject","preparePlatform","loader","map","moduleId","relativeTo","normalize","then","normalized","type","isRenderer","versions","window","self","Error","loadModule","palModule","globalize","initialize","initializePal","bootstrapperName","frameworkPromise","all","frameworkName","_ref","fx","Aurelia","config","appHost","configModuleId","aurelia","customConfig","configure","use","standardConfiguration","developmentLogging","start","setRoot","bootstrap","p","factory","push","starting","document","readyState","completed","removeEventListener","addEventListener","appHosts","querySelectorAll","i","ii","length","getAttribute","bind","toConsole","console","error","bootstraps","catch"],"mappings":"yFAAA,oHAKIA,GAL4B,mBAAXC,QAAgCA,OAAOC,SAKpC,IACpBC,OAAe,EAEfC,EAAe,IAAIC,QAAQ,SAAUC,GACvC,OAAOH,EAAeG,IAEpBC,EAAO,WAASC,OAChBC,OAAgC,IAAZC,IAA4BA,EAAQC,QAmB5D,SAASC,IACP,OAAI,WAASC,OACJR,QAAQC,QAAQ,IAAI,WAASO,QAiC/BR,QAAQS,OAAO,qIAyBxB,SAASC,EAAgBC,GACvB,IAAIC,EAAM,SAAaC,EAAUC,GAC/B,OAAOH,EAAOI,UAAUF,EAAUC,GAAYE,KAAK,SAAUC,GAE3D,OADAN,EAAOC,IAAIC,EAAUI,GACdA,KAIX,OA9BF,SAAuBN,GACrB,GAAI,gBAAe,OAAOX,QAAQC,UAElC,IAAIiB,OAAO,EAEPC,EAAaf,IAAgC,aAAjBC,EAAQa,MAAuBb,EAAQe,SAAS,gBAEhF,GAAIhB,IAAee,EACjBD,EAAO,cACF,GAAsB,oBAAXG,OAChBH,EAAO,cACF,IAAoB,oBAATI,KAGhB,MAAM,IAAIC,MAAM,wDAFhBL,EAAO,SAKT,OAAOP,EAAOa,WAAW,eAAiBN,GAAMF,KAAK,SAAUS,GAC7D,MAAgB,WAATP,IAAsB,iBAAiBO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AAiBM,KAAK,WAE3D,IADA,IAAIyC,EAAWvD,EAAKkD,SAASM,iBAAiB,oCACrCC,EAAI,EAAGC,EAAKH,EAASI,OAAQF,EAAIC,IAAMD,EAAG,CACjD,IAAItB,EAAUoB,EAASE,GACnB9C,EAAWwB,EAAQyB,aAAa,gBAAkBzB,EAAQyB,aAAa,oBAC3Ef,EAAUX,EAAO2B,KAAK,KAAM1B,EAASxB,IAGvC,IAAImD,EAAYC,QAAQC,MAAMH,KAAKE,SAC/BE,EAAaxE,EAAkBiB,IAAI,SAAUoC,GAC/C,OAAOA,EAAEoB,MAAMJ,KAGjB,OADArE,EAAoB,KACbK,QAAQ+B,IAAIoC,M","file":"npm.aurelia-bootstrapper.14283f27c596cb67e2bd.js","sourcesContent":["var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nimport 'aurelia-polyfills';\nimport { PLATFORM, isInitialized } from 'aurelia-pal';\n\nvar bootstrapPromises = [];\nvar startResolve = void 0;\n\nvar startPromise = new Promise(function (resolve) {\n return startResolve = resolve;\n});\nvar host = PLATFORM.global;\nvar isNodeLike = typeof process !== 'undefined' && !process.browser;\n\nfunction ready() {\n if (!host.document || host.document.readyState === 'complete') {\n return Promise.resolve();\n }\n\n return new Promise(function (resolve) {\n host.document.addEventListener('DOMContentLoaded', completed);\n host.addEventListener('load', completed);\n\n function completed() {\n host.document.removeEventListener('DOMContentLoaded', completed);\n host.removeEventListener('load', completed);\n resolve();\n }\n });\n}\n\nfunction createLoader() {\n if (PLATFORM.Loader) {\n return Promise.resolve(new PLATFORM.Loader());\n }\n\n if (typeof AURELIA_WEBPACK_2_0 === 'undefined') {\n if (typeof __webpack_require__ !== 'undefined') {\n var m = __webpack_require__(require.resolve('aurelia-loader-webpack'));\n return Promise.resolve(new m.WebpackLoader());\n }\n\n if (host.System && typeof host.System.config === 'function') {\n return host.System.normalize('aurelia-bootstrapper').then(function (bsn) {\n return host.System.normalize('aurelia-loader-default', bsn);\n }).then(function (loaderName) {\n return host.System.import(loaderName).then(function (m) {\n return new m.DefaultLoader();\n });\n });\n }\n\n if (typeof host.require === 'function' && typeof host.define === 'function' && _typeof(host.define.amd) === 'object') {\n return new Promise(function (resolve, reject) {\n return host.require(['aurelia-loader-default'], function (m) {\n return resolve(new m.DefaultLoader());\n }, reject);\n });\n }\n\n if (isNodeLike && typeof module !== 'undefined' && typeof module.require !== 'undefined') {\n var _m = module.require('aurelia-loader-nodejs');\n return Promise.resolve(new _m.NodeJsLoader());\n }\n }\n\n return Promise.reject('No PLATFORM.Loader is defined and there is neither a System API (ES6) or a Require API (AMD) globally available to load your app.');\n}\n\nfunction initializePal(loader) {\n if (isInitialized) return Promise.resolve();\n\n var type = void 0;\n\n var isRenderer = isNodeLike && (process.type === 'renderer' || process.versions['node-webkit']);\n\n if (isNodeLike && !isRenderer) {\n type = 'nodejs';\n } else if (typeof window !== 'undefined') {\n type = 'browser';\n } else if (typeof self !== 'undefined') {\n type = 'worker';\n } else {\n throw new Error('Could not determine platform implementation to load.');\n }\n\n return loader.loadModule('aurelia-pal-' + type).then(function (palModule) {\n return type === 'nodejs' && !isInitialized && palModule.globalize() || palModule.initialize();\n });\n}\n\nfunction preparePlatform(loader) {\n var map = function map(moduleId, relativeTo) {\n return loader.normalize(moduleId, relativeTo).then(function (normalized) {\n loader.map(moduleId, normalized);\n return normalized;\n });\n };\n\n return initializePal(loader).then(function () {\n return loader.normalize('aurelia-bootstrapper');\n }).then(function (bootstrapperName) {\n var frameworkPromise = map(PLATFORM.moduleName('aurelia-framework', { exports: ['Aurelia'] }), bootstrapperName);\n\n return Promise.all([frameworkPromise, frameworkPromise.then(function (frameworkName) {\n return map('aurelia-dependency-injection', frameworkName);\n }), map('aurelia-router', bootstrapperName), map('aurelia-logging-console', bootstrapperName)]);\n }).then(function (_ref) {\n var frameworkName = _ref[0];\n return loader.loadModule(frameworkName);\n }).then(function (fx) {\n return startResolve(function () {\n return new fx.Aurelia(loader);\n });\n });\n}\n\nfunction config(appHost, configModuleId, aurelia) {\n aurelia.host = appHost;\n aurelia.configModuleId = configModuleId || null;\n\n if (configModuleId) {\n return aurelia.loader.loadModule(configModuleId).then(function (customConfig) {\n if (!customConfig.configure) {\n throw new Error('Cannot initialize module \\'' + configModuleId + '\\' without a configure function.');\n }\n\n return customConfig.configure(aurelia);\n });\n }\n\n aurelia.use.standardConfiguration().developmentLogging();\n\n return aurelia.start().then(function () {\n return aurelia.setRoot();\n });\n}\n\nfunction run() {\n return ready().then(createLoader).then(preparePlatform).then(function () {\n var appHosts = host.document.querySelectorAll('[aurelia-app],[data-aurelia-app]');\n for (var i = 0, ii = appHosts.length; i < ii; ++i) {\n var appHost = appHosts[i];\n var moduleId = appHost.getAttribute('aurelia-app') || appHost.getAttribute('data-aurelia-app');\n bootstrap(config.bind(null, appHost, moduleId));\n }\n\n var toConsole = console.error.bind(console);\n var bootstraps = bootstrapPromises.map(function (p) {\n return p.catch(toConsole);\n });\n bootstrapPromises = null;\n return Promise.all(bootstraps);\n });\n}\n\nexport function bootstrap(configure) {\n var p = startPromise.then(function (factory) {\n return configure(factory());\n });\n if (bootstrapPromises) bootstrapPromises.push(p);\n return p;\n}\n\nexport var starting = run();"],"sourceRoot":""}