{"version":3,"sources":["webpack:///player-30fc5ffa7ea8b6b69481.js","webpack:///webpack/bootstrap 3cbe0e4cda69decce2c4","webpack:///./app/javascript/packs/player.js","webpack:///./app/javascript/player/index.js","webpack:///./app/javascript/player/player.js"],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","55","__webpack_exports__","56","loadPlayer","player","Player","window","PLAYER_METADATA","photo","imageUrl","replace","downloadingImage","Image","profileImage","document","querySelector","onload","e","src","alt","onerror","dataset","fallbackImage","readyState","addEventListener","57","playerData","this","attributes","attribute","set","value"],"mappings":"CAAS,SAAUA,GCIjB,QAASC,GAAoBC,GAG5B,GAAGC,EAAiBD,GACnB,MAAOC,GAAiBD,GAAUE,OAGnC,IAAIC,GAASF,EAAiBD,IAC7BI,EAAGJ,EACHK,GAAG,EACHH,WAUD,OANAJ,GAAQE,GAAUM,KAAKH,EAAOD,QAASC,EAAQA,EAAOD,QAASH,GAG/DI,EAAOE,GAAI,EAGJF,EAAOD,QAvBf,GAAID,KA4BJF,GAAoBQ,EAAIT,EAGxBC,EAAoBS,EAAIP,EAGxBF,EAAoBU,EAAI,SAASP,EAASQ,EAAMC,GAC3CZ,EAAoBa,EAAEV,EAASQ,IAClCG,OAAOC,eAAeZ,EAASQ,GAC9BK,cAAc,EACdC,YAAY,EACZC,IAAKN,KAMRZ,EAAoBmB,EAAI,SAASf,GAChC,GAAIQ,GAASR,GAAUA,EAAOgB,WAC7B,WAAwB,MAAOhB,GAAgB,SAC/C,WAA8B,MAAOA,GAEtC,OADAJ,GAAoBU,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRZ,EAAoBa,EAAI,SAASQ,EAAQC,GAAY,MAAOR,QAAOS,UAAUC,eAAejB,KAAKc,EAAQC,IAGzGtB,EAAoByB,EAAI,UAGjBzB,EAAoBA,EAAoB0B,EAAI,MDM/CC,GACA,SAAUvB,EAAQwB,EAAqB5B,GAE7C,YEtEA,yDF6EM6B,GACA,SAAUzB,EAAQwB,EAAqB5B,GAE7C,YG9EA,SAAS8B,KACP,GAAMC,GAAS,GAAIC,KAAOC,OAAOC,iBAC3BC,EAAQJ,EAAOb,IAAI,gBACzB,IAAKiB,EAAQ,CACX,GAAMC,GAAWD,EAAME,QAAQ,cAAe,eACxCC,EAAmB,GAAIC,OACvBC,EAAeC,SAASC,cAAc,2BAE5CJ,GAAiBK,OAAS,SAASC,GACjCJ,EAAaK,IAAMT,EACnBI,EAAaM,IAASf,EAAOpB,KAA7B,qBAGF2B,EAAiBS,QAAU,SAASH,GAClCJ,EAAaK,IAAML,EAAaQ,QAAQC,eAG1CX,EAAiBO,IAAMT,GAnB3B,WAuB6B,aAAxBK,SAASS,WACZT,SAASU,iBAAiB,mBAAoBrB,GAE9CA,KHuFIsB,GACA,SAAUhD,EAAQwB,EAAqB5B,GAE7C,YIpHA,SAASgC,KAAwB,WAAjBqB,EAAiB,yDAC/BC,MAAKC,WAAaF,EAElBC,KAAKpC,IAAM,SAACsC,GACV,MAAO,GAAKD,WAAWC,IAGzBF,KAAKG,IAAM,SAACD,EAAWE,GACrB,EAAKH,WAAWC,GAAaE,GAIlB1B","file":"player-30fc5ffa7ea8b6b69481.js","sourcesContent":["/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"/packs/\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 55);\n/******/ })\n/************************************************************************/\n/******/ ({\n\n/***/ 55:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__player__ = __webpack_require__(56);\n\n\n/***/ }),\n\n/***/ 56:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__player__ = __webpack_require__(57);\n\n\nfunction loadPlayer() {\n var player = new __WEBPACK_IMPORTED_MODULE_0__player__[\"a\" /* default */](window.PLAYER_METADATA);\n var photo = player.get('twitter_photo');\n if (photo) {\n var imageUrl = photo.replace(/_normal\\.jp/, '_200x200.jp');\n var downloadingImage = new Image();\n var profileImage = document.querySelector('.js-player-twitter-photo');\n\n downloadingImage.onload = function (e) {\n profileImage.src = imageUrl;\n profileImage.alt = player.name + '\\'s twitter avatar';\n };\n\n downloadingImage.onerror = function (e) {\n profileImage.src = profileImage.dataset.fallbackImage;\n };\n\n downloadingImage.src = imageUrl;\n }\n}\n\nif (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', loadPlayer);\n} else {\n loadPlayer();\n}\n\n/***/ }),\n\n/***/ 57:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nfunction Player() {\n var _this = this;\n\n var playerData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n this.attributes = playerData;\n\n this.get = function (attribute) {\n return _this.attributes[attribute];\n };\n\n this.set = function (attribute, value) {\n _this.attributes[attribute] = value;\n };\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (Player);\n\n/***/ })\n\n/******/ });\n\n\n// WEBPACK FOOTER //\n// player-30fc5ffa7ea8b6b69481.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/packs/\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 55);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 3cbe0e4cda69decce2c4","import '../player'\n\n\n// WEBPACK FOOTER //\n// ./app/javascript/packs/player.js","import Player from './player'\n\nfunction loadPlayer() {\n const player = new Player(window.PLAYER_METADATA)\n const photo = player.get('twitter_photo')\n if ( photo ) {\n const imageUrl = photo.replace(/_normal\\.jp/, '_200x200.jp')\n const downloadingImage = new Image()\n const profileImage = document.querySelector('.js-player-twitter-photo')\n \n downloadingImage.onload = function(e) {\n profileImage.src = imageUrl\n profileImage.alt = `${player.name}'s twitter avatar`\n }\n\n downloadingImage.onerror = function(e) {\n profileImage.src = profileImage.dataset.fallbackImage\n }\n \n downloadingImage.src = imageUrl\n }\n}\n\nif ( document.readyState === 'loading' ) {\n document.addEventListener('DOMContentLoaded', loadPlayer)\n} else {\n loadPlayer()\n}\n\n\n\n// WEBPACK FOOTER //\n// ./app/javascript/player/index.js","function Player(playerData = {}) {\n this.attributes = playerData\n \n this.get = (attribute) => {\n return this.attributes[attribute]\n }\n \n this.set = (attribute, value) => {\n this.attributes[attribute] = value\n }\n}\n\nexport default Player\n\n\n// WEBPACK FOOTER //\n// ./app/javascript/player/player.js"],"sourceRoot":""}