{"version":3,"file":"js/application-73158a4b3ba893b9a828.js","sources":["webpack:///webpack/bootstrap","webpack:///./app/javascript/channels sync _channel\\.js$","webpack:///./app/javascript/channels/index.js","webpack:///./app/javascript/packs/application.js","webpack:///./node_modules/@rails/activestorage/app/assets/javascripts/activestorage.js","webpack:///./node_modules/@rails/ujs/lib/assets/compiled/rails-ujs.js","webpack:///./node_modules/turbolinks/dist/turbolinks.js","webpack:///(webpack)/buildin/module.js"],"sourcesContent":[" \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, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\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\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./app/javascript/packs/application.js\");\n","function webpackEmptyContext(req) {\n\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\te.code = 'MODULE_NOT_FOUND';\n\tthrow e;\n}\nwebpackEmptyContext.keys = function() { return []; };\nwebpackEmptyContext.resolve = webpackEmptyContext;\nmodule.exports = webpackEmptyContext;\nwebpackEmptyContext.id = \"./app/javascript/channels sync recursive _channel\\\\.js$\";","// Load all the channels within this directory and all subdirectories.\n// Channel files must be named *_channel.js.\n\nconst channels = require.context('.', true, /_channel\\.js$/)\nchannels.keys().forEach(channels)\n","// This file is automatically compiled by Webpack, along with any other files\n// present in this directory. You're encouraged to place your actual application logic in\n// a relevant structure within app/javascript and only use these pack files to reference\n// that code so it'll be compiled.\n\nRails = require(\"@rails/ujs\")\nRails.start()\nrequire(\"turbolinks\").start()\nrequire(\"@rails/activestorage\").start()\nrequire(\"channels\")\n\n\n\ndocument.addEventListener(\"turbolinks:load\", function(){\n var entityValueMarking = document.getElementById('entity-value-marking');\n\n document.querySelectorAll('form[action=\"/wit_ai_parse_model_examples\"]').forEach(function(form) {\n form.addEventListener('ajax:before', function(e) {\n if(form.dataset.isComplete !== 'true') {\n e.preventDefault();\n entityValueMarking.style.display = 'block';\n\n alert('Pls select the text that should be the extracted value for this property.');\n\n document.addEventListener('selectionchange', () => {\n let selection = document.getSelection();\n if(selection.type === 'Caret') {\n return;\n }\n console.log(selection);\n let isConfirmed = confirm('Confirm this property value? ' + document.getSelection());\n\n console.log(isConfirmed);\n\n form.dataset.isComplete = 'true';\n\n // Rails.fire(form, 'submit');\n });\n }\n })\n });\n});\n\n\n\n// Uncomment to copy all static images under ../images to the output folder and reference\n// them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>)\n// or the `imagePath` JavaScript helper below.\n//\n// const images = require.context('../images', true)\n// const imagePath = (name) => images(name, true)\n","function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n(function (global, factory) {\n (typeof exports === \"undefined\" ? \"undefined\" : _typeof(exports)) === \"object\" && typeof module !== \"undefined\" ? factory(exports) : typeof define === \"function\" && define.amd ? define([\"exports\"], factory) : factory(global.ActiveStorage = {});\n})(this, function (exports) {\n \"use strict\";\n\n function createCommonjsModule(fn, module) {\n return module = {\n exports: {}\n }, fn(module, module.exports), module.exports;\n }\n\n var sparkMd5 = createCommonjsModule(function (module, exports) {\n (function (factory) {\n {\n module.exports = factory();\n }\n })(function (undefined) {\n var hex_chr = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\"];\n\n function md5cycle(x, k) {\n var a = x[0],\n b = x[1],\n c = x[2],\n d = x[3];\n a += (b & c | ~b & d) + k[0] - 680876936 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[1] - 389564586 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[2] + 606105819 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[3] - 1044525330 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[4] - 176418897 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[5] + 1200080426 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[6] - 1473231341 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[7] - 45705983 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[8] + 1770035416 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[9] - 1958414417 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[10] - 42063 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[11] - 1990404162 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[12] + 1804603682 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[13] - 40341101 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[14] - 1502002290 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[15] + 1236535329 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & d | c & ~d) + k[1] - 165796510 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[6] - 1069501632 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[11] + 643717713 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[0] - 373897302 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[5] - 701558691 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[10] + 38016083 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[15] - 660478335 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[4] - 405537848 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[9] + 568446438 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[14] - 1019803690 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[3] - 187363961 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[8] + 1163531501 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[13] - 1444681467 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[2] - 51403784 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[7] + 1735328473 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[12] - 1926607734 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b ^ c ^ d) + k[5] - 378558 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[8] - 2022574463 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[11] + 1839030562 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[14] - 35309556 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[1] - 1530992060 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[4] + 1272893353 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[7] - 155497632 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[10] - 1094730640 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[13] + 681279174 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[0] - 358537222 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[3] - 722521979 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[6] + 76029189 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[9] - 640364487 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[12] - 421815835 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[15] + 530742520 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[2] - 995338651 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (c ^ (b | ~d)) + k[0] - 198630844 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[7] + 1126891415 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[14] - 1416354905 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[5] - 57434055 | 0;\n b = (b << 21 | b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[12] + 1700485571 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[3] - 1894986606 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[10] - 1051523 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[1] - 2054922799 | 0;\n b = (b << 21 | b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[8] + 1873313359 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[15] - 30611744 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[6] - 1560198380 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[13] + 1309151649 | 0;\n b = (b << 21 | b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[4] - 145523070 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[11] - 1120210379 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[2] + 718787259 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[9] - 343485551 | 0;\n b = (b << 21 | b >>> 11) + c | 0;\n x[0] = a + x[0] | 0;\n x[1] = b + x[1] | 0;\n x[2] = c + x[2] | 0;\n x[3] = d + x[3] | 0;\n }\n\n function md5blk(s) {\n var md5blks = [],\n i;\n\n for (i = 0; i < 64; i += 4) {\n md5blks[i >> 2] = s.charCodeAt(i) + (s.charCodeAt(i + 1) << 8) + (s.charCodeAt(i + 2) << 16) + (s.charCodeAt(i + 3) << 24);\n }\n\n return md5blks;\n }\n\n function md5blk_array(a) {\n var md5blks = [],\n i;\n\n for (i = 0; i < 64; i += 4) {\n md5blks[i >> 2] = a[i] + (a[i + 1] << 8) + (a[i + 2] << 16) + (a[i + 3] << 24);\n }\n\n return md5blks;\n }\n\n function md51(s) {\n var n = s.length,\n state = [1732584193, -271733879, -1732584194, 271733878],\n i,\n length,\n tail,\n tmp,\n lo,\n hi;\n\n for (i = 64; i <= n; i += 64) {\n md5cycle(state, md5blk(s.substring(i - 64, i)));\n }\n\n s = s.substring(i - 64);\n length = s.length;\n tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= s.charCodeAt(i) << (i % 4 << 3);\n }\n\n tail[i >> 2] |= 128 << (i % 4 << 3);\n\n if (i > 55) {\n md5cycle(state, tail);\n\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n\n tmp = n * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n tail[14] = lo;\n tail[15] = hi;\n md5cycle(state, tail);\n return state;\n }\n\n function md51_array(a) {\n var n = a.length,\n state = [1732584193, -271733879, -1732584194, 271733878],\n i,\n length,\n tail,\n tmp,\n lo,\n hi;\n\n for (i = 64; i <= n; i += 64) {\n md5cycle(state, md5blk_array(a.subarray(i - 64, i)));\n }\n\n a = i - 64 < n ? a.subarray(i - 64) : new Uint8Array(0);\n length = a.length;\n tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= a[i] << (i % 4 << 3);\n }\n\n tail[i >> 2] |= 128 << (i % 4 << 3);\n\n if (i > 55) {\n md5cycle(state, tail);\n\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n\n tmp = n * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n tail[14] = lo;\n tail[15] = hi;\n md5cycle(state, tail);\n return state;\n }\n\n function rhex(n) {\n var s = \"\",\n j;\n\n for (j = 0; j < 4; j += 1) {\n s += hex_chr[n >> j * 8 + 4 & 15] + hex_chr[n >> j * 8 & 15];\n }\n\n return s;\n }\n\n function hex(x) {\n var i;\n\n for (i = 0; i < x.length; i += 1) {\n x[i] = rhex(x[i]);\n }\n\n return x.join(\"\");\n }\n\n if (hex(md51(\"hello\")) !== \"5d41402abc4b2a76b9719d911017c592\") ;\n\n if (typeof ArrayBuffer !== \"undefined\" && !ArrayBuffer.prototype.slice) {\n (function () {\n function clamp(val, length) {\n val = val | 0 || 0;\n\n if (val < 0) {\n return Math.max(val + length, 0);\n }\n\n return Math.min(val, length);\n }\n\n ArrayBuffer.prototype.slice = function (from, to) {\n var length = this.byteLength,\n begin = clamp(from, length),\n end = length,\n num,\n target,\n targetArray,\n sourceArray;\n\n if (to !== undefined) {\n end = clamp(to, length);\n }\n\n if (begin > end) {\n return new ArrayBuffer(0);\n }\n\n num = end - begin;\n target = new ArrayBuffer(num);\n targetArray = new Uint8Array(target);\n sourceArray = new Uint8Array(this, begin, num);\n targetArray.set(sourceArray);\n return target;\n };\n })();\n }\n\n function toUtf8(str) {\n if (/[\\u0080-\\uFFFF]/.test(str)) {\n str = unescape(encodeURIComponent(str));\n }\n\n return str;\n }\n\n function utf8Str2ArrayBuffer(str, returnUInt8Array) {\n var length = str.length,\n buff = new ArrayBuffer(length),\n arr = new Uint8Array(buff),\n i;\n\n for (i = 0; i < length; i += 1) {\n arr[i] = str.charCodeAt(i);\n }\n\n return returnUInt8Array ? arr : buff;\n }\n\n function arrayBuffer2Utf8Str(buff) {\n return String.fromCharCode.apply(null, new Uint8Array(buff));\n }\n\n function concatenateArrayBuffers(first, second, returnUInt8Array) {\n var result = new Uint8Array(first.byteLength + second.byteLength);\n result.set(new Uint8Array(first));\n result.set(new Uint8Array(second), first.byteLength);\n return returnUInt8Array ? result : result.buffer;\n }\n\n function hexToBinaryString(hex) {\n var bytes = [],\n length = hex.length,\n x;\n\n for (x = 0; x < length - 1; x += 2) {\n bytes.push(parseInt(hex.substr(x, 2), 16));\n }\n\n return String.fromCharCode.apply(String, bytes);\n }\n\n function SparkMD5() {\n this.reset();\n }\n\n SparkMD5.prototype.append = function (str) {\n this.appendBinary(toUtf8(str));\n return this;\n };\n\n SparkMD5.prototype.appendBinary = function (contents) {\n this._buff += contents;\n this._length += contents.length;\n var length = this._buff.length,\n i;\n\n for (i = 64; i <= length; i += 64) {\n md5cycle(this._hash, md5blk(this._buff.substring(i - 64, i)));\n }\n\n this._buff = this._buff.substring(i - 64);\n return this;\n };\n\n SparkMD5.prototype.end = function (raw) {\n var buff = this._buff,\n length = buff.length,\n i,\n tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n ret;\n\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= buff.charCodeAt(i) << (i % 4 << 3);\n }\n\n this._finish(tail, length);\n\n ret = hex(this._hash);\n\n if (raw) {\n ret = hexToBinaryString(ret);\n }\n\n this.reset();\n return ret;\n };\n\n SparkMD5.prototype.reset = function () {\n this._buff = \"\";\n this._length = 0;\n this._hash = [1732584193, -271733879, -1732584194, 271733878];\n return this;\n };\n\n SparkMD5.prototype.getState = function () {\n return {\n buff: this._buff,\n length: this._length,\n hash: this._hash\n };\n };\n\n SparkMD5.prototype.setState = function (state) {\n this._buff = state.buff;\n this._length = state.length;\n this._hash = state.hash;\n return this;\n };\n\n SparkMD5.prototype.destroy = function () {\n delete this._hash;\n delete this._buff;\n delete this._length;\n };\n\n SparkMD5.prototype._finish = function (tail, length) {\n var i = length,\n tmp,\n lo,\n hi;\n tail[i >> 2] |= 128 << (i % 4 << 3);\n\n if (i > 55) {\n md5cycle(this._hash, tail);\n\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n\n tmp = this._length * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n tail[14] = lo;\n tail[15] = hi;\n md5cycle(this._hash, tail);\n };\n\n SparkMD5.hash = function (str, raw) {\n return SparkMD5.hashBinary(toUtf8(str), raw);\n };\n\n SparkMD5.hashBinary = function (content, raw) {\n var hash = md51(content),\n ret = hex(hash);\n return raw ? hexToBinaryString(ret) : ret;\n };\n\n SparkMD5.ArrayBuffer = function () {\n this.reset();\n };\n\n SparkMD5.ArrayBuffer.prototype.append = function (arr) {\n var buff = concatenateArrayBuffers(this._buff.buffer, arr, true),\n length = buff.length,\n i;\n this._length += arr.byteLength;\n\n for (i = 64; i <= length; i += 64) {\n md5cycle(this._hash, md5blk_array(buff.subarray(i - 64, i)));\n }\n\n this._buff = i - 64 < length ? new Uint8Array(buff.buffer.slice(i - 64)) : new Uint8Array(0);\n return this;\n };\n\n SparkMD5.ArrayBuffer.prototype.end = function (raw) {\n var buff = this._buff,\n length = buff.length,\n tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n i,\n ret;\n\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= buff[i] << (i % 4 << 3);\n }\n\n this._finish(tail, length);\n\n ret = hex(this._hash);\n\n if (raw) {\n ret = hexToBinaryString(ret);\n }\n\n this.reset();\n return ret;\n };\n\n SparkMD5.ArrayBuffer.prototype.reset = function () {\n this._buff = new Uint8Array(0);\n this._length = 0;\n this._hash = [1732584193, -271733879, -1732584194, 271733878];\n return this;\n };\n\n SparkMD5.ArrayBuffer.prototype.getState = function () {\n var state = SparkMD5.prototype.getState.call(this);\n state.buff = arrayBuffer2Utf8Str(state.buff);\n return state;\n };\n\n SparkMD5.ArrayBuffer.prototype.setState = function (state) {\n state.buff = utf8Str2ArrayBuffer(state.buff, true);\n return SparkMD5.prototype.setState.call(this, state);\n };\n\n SparkMD5.ArrayBuffer.prototype.destroy = SparkMD5.prototype.destroy;\n SparkMD5.ArrayBuffer.prototype._finish = SparkMD5.prototype._finish;\n\n SparkMD5.ArrayBuffer.hash = function (arr, raw) {\n var hash = md51_array(new Uint8Array(arr)),\n ret = hex(hash);\n return raw ? hexToBinaryString(ret) : ret;\n };\n\n return SparkMD5;\n });\n });\n\n var classCallCheck = function classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n };\n\n var createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n }();\n\n var fileSlice = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice;\n\n var FileChecksum = function () {\n createClass(FileChecksum, null, [{\n key: \"create\",\n value: function create(file, callback) {\n var instance = new FileChecksum(file);\n instance.create(callback);\n }\n }]);\n\n function FileChecksum(file) {\n classCallCheck(this, FileChecksum);\n this.file = file;\n this.chunkSize = 2097152;\n this.chunkCount = Math.ceil(this.file.size / this.chunkSize);\n this.chunkIndex = 0;\n }\n\n createClass(FileChecksum, [{\n key: \"create\",\n value: function create(callback) {\n var _this = this;\n\n this.callback = callback;\n this.md5Buffer = new sparkMd5.ArrayBuffer();\n this.fileReader = new FileReader();\n this.fileReader.addEventListener(\"load\", function (event) {\n return _this.fileReaderDidLoad(event);\n });\n this.fileReader.addEventListener(\"error\", function (event) {\n return _this.fileReaderDidError(event);\n });\n this.readNextChunk();\n }\n }, {\n key: \"fileReaderDidLoad\",\n value: function fileReaderDidLoad(event) {\n this.md5Buffer.append(event.target.result);\n\n if (!this.readNextChunk()) {\n var binaryDigest = this.md5Buffer.end(true);\n var base64digest = btoa(binaryDigest);\n this.callback(null, base64digest);\n }\n }\n }, {\n key: \"fileReaderDidError\",\n value: function fileReaderDidError(event) {\n this.callback(\"Error reading \" + this.file.name);\n }\n }, {\n key: \"readNextChunk\",\n value: function readNextChunk() {\n if (this.chunkIndex < this.chunkCount || this.chunkIndex == 0 && this.chunkCount == 0) {\n var start = this.chunkIndex * this.chunkSize;\n var end = Math.min(start + this.chunkSize, this.file.size);\n var bytes = fileSlice.call(this.file, start, end);\n this.fileReader.readAsArrayBuffer(bytes);\n this.chunkIndex++;\n return true;\n } else {\n return false;\n }\n }\n }]);\n return FileChecksum;\n }();\n\n function getMetaValue(name) {\n var element = findElement(document.head, 'meta[name=\"' + name + '\"]');\n\n if (element) {\n return element.getAttribute(\"content\");\n }\n }\n\n function findElements(root, selector) {\n if (typeof root == \"string\") {\n selector = root;\n root = document;\n }\n\n var elements = root.querySelectorAll(selector);\n return toArray$1(elements);\n }\n\n function findElement(root, selector) {\n if (typeof root == \"string\") {\n selector = root;\n root = document;\n }\n\n return root.querySelector(selector);\n }\n\n function dispatchEvent(element, type) {\n var eventInit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var disabled = element.disabled;\n var bubbles = eventInit.bubbles,\n cancelable = eventInit.cancelable,\n detail = eventInit.detail;\n var event = document.createEvent(\"Event\");\n event.initEvent(type, bubbles || true, cancelable || true);\n event.detail = detail || {};\n\n try {\n element.disabled = false;\n element.dispatchEvent(event);\n } finally {\n element.disabled = disabled;\n }\n\n return event;\n }\n\n function toArray$1(value) {\n if (Array.isArray(value)) {\n return value;\n } else if (Array.from) {\n return Array.from(value);\n } else {\n return [].slice.call(value);\n }\n }\n\n var BlobRecord = function () {\n function BlobRecord(file, checksum, url) {\n var _this = this;\n\n classCallCheck(this, BlobRecord);\n this.file = file;\n this.attributes = {\n filename: file.name,\n content_type: file.type,\n byte_size: file.size,\n checksum: checksum\n };\n this.xhr = new XMLHttpRequest();\n this.xhr.open(\"POST\", url, true);\n this.xhr.responseType = \"json\";\n this.xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n this.xhr.setRequestHeader(\"Accept\", \"application/json\");\n this.xhr.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\n var csrfToken = getMetaValue(\"csrf-token\");\n\n if (csrfToken != undefined) {\n this.xhr.setRequestHeader(\"X-CSRF-Token\", csrfToken);\n }\n\n this.xhr.addEventListener(\"load\", function (event) {\n return _this.requestDidLoad(event);\n });\n this.xhr.addEventListener(\"error\", function (event) {\n return _this.requestDidError(event);\n });\n }\n\n createClass(BlobRecord, [{\n key: \"create\",\n value: function create(callback) {\n this.callback = callback;\n this.xhr.send(JSON.stringify({\n blob: this.attributes\n }));\n }\n }, {\n key: \"requestDidLoad\",\n value: function requestDidLoad(event) {\n if (this.status >= 200 && this.status < 300) {\n var response = this.response;\n var direct_upload = response.direct_upload;\n delete response.direct_upload;\n this.attributes = response;\n this.directUploadData = direct_upload;\n this.callback(null, this.toJSON());\n } else {\n this.requestDidError(event);\n }\n }\n }, {\n key: \"requestDidError\",\n value: function requestDidError(event) {\n this.callback('Error creating Blob for \"' + this.file.name + '\". Status: ' + this.status);\n }\n }, {\n key: \"toJSON\",\n value: function toJSON() {\n var result = {};\n\n for (var key in this.attributes) {\n result[key] = this.attributes[key];\n }\n\n return result;\n }\n }, {\n key: \"status\",\n get: function get$$1() {\n return this.xhr.status;\n }\n }, {\n key: \"response\",\n get: function get$$1() {\n var _xhr = this.xhr,\n responseType = _xhr.responseType,\n response = _xhr.response;\n\n if (responseType == \"json\") {\n return response;\n } else {\n return JSON.parse(response);\n }\n }\n }]);\n return BlobRecord;\n }();\n\n var BlobUpload = function () {\n function BlobUpload(blob) {\n var _this = this;\n\n classCallCheck(this, BlobUpload);\n this.blob = blob;\n this.file = blob.file;\n var _blob$directUploadDat = blob.directUploadData,\n url = _blob$directUploadDat.url,\n headers = _blob$directUploadDat.headers;\n this.xhr = new XMLHttpRequest();\n this.xhr.open(\"PUT\", url, true);\n this.xhr.responseType = \"text\";\n\n for (var key in headers) {\n this.xhr.setRequestHeader(key, headers[key]);\n }\n\n this.xhr.addEventListener(\"load\", function (event) {\n return _this.requestDidLoad(event);\n });\n this.xhr.addEventListener(\"error\", function (event) {\n return _this.requestDidError(event);\n });\n }\n\n createClass(BlobUpload, [{\n key: \"create\",\n value: function create(callback) {\n this.callback = callback;\n this.xhr.send(this.file.slice());\n }\n }, {\n key: \"requestDidLoad\",\n value: function requestDidLoad(event) {\n var _xhr = this.xhr,\n status = _xhr.status,\n response = _xhr.response;\n\n if (status >= 200 && status < 300) {\n this.callback(null, response);\n } else {\n this.requestDidError(event);\n }\n }\n }, {\n key: \"requestDidError\",\n value: function requestDidError(event) {\n this.callback('Error storing \"' + this.file.name + '\". Status: ' + this.xhr.status);\n }\n }]);\n return BlobUpload;\n }();\n\n var id = 0;\n\n var DirectUpload = function () {\n function DirectUpload(file, url, delegate) {\n classCallCheck(this, DirectUpload);\n this.id = ++id;\n this.file = file;\n this.url = url;\n this.delegate = delegate;\n }\n\n createClass(DirectUpload, [{\n key: \"create\",\n value: function create(callback) {\n var _this = this;\n\n FileChecksum.create(this.file, function (error, checksum) {\n if (error) {\n callback(error);\n return;\n }\n\n var blob = new BlobRecord(_this.file, checksum, _this.url);\n notify(_this.delegate, \"directUploadWillCreateBlobWithXHR\", blob.xhr);\n blob.create(function (error) {\n if (error) {\n callback(error);\n } else {\n var upload = new BlobUpload(blob);\n notify(_this.delegate, \"directUploadWillStoreFileWithXHR\", upload.xhr);\n upload.create(function (error) {\n if (error) {\n callback(error);\n } else {\n callback(null, blob.toJSON());\n }\n });\n }\n });\n });\n }\n }]);\n return DirectUpload;\n }();\n\n function notify(object, methodName) {\n if (object && typeof object[methodName] == \"function\") {\n for (var _len = arguments.length, messages = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n messages[_key - 2] = arguments[_key];\n }\n\n return object[methodName].apply(object, messages);\n }\n }\n\n var DirectUploadController = function () {\n function DirectUploadController(input, file) {\n classCallCheck(this, DirectUploadController);\n this.input = input;\n this.file = file;\n this.directUpload = new DirectUpload(this.file, this.url, this);\n this.dispatch(\"initialize\");\n }\n\n createClass(DirectUploadController, [{\n key: \"start\",\n value: function start(callback) {\n var _this = this;\n\n var hiddenInput = document.createElement(\"input\");\n hiddenInput.type = \"hidden\";\n hiddenInput.name = this.input.name;\n this.input.insertAdjacentElement(\"beforebegin\", hiddenInput);\n this.dispatch(\"start\");\n this.directUpload.create(function (error, attributes) {\n if (error) {\n hiddenInput.parentNode.removeChild(hiddenInput);\n\n _this.dispatchError(error);\n } else {\n hiddenInput.value = attributes.signed_id;\n }\n\n _this.dispatch(\"end\");\n\n callback(error);\n });\n }\n }, {\n key: \"uploadRequestDidProgress\",\n value: function uploadRequestDidProgress(event) {\n var progress = event.loaded / event.total * 100;\n\n if (progress) {\n this.dispatch(\"progress\", {\n progress: progress\n });\n }\n }\n }, {\n key: \"dispatch\",\n value: function dispatch(name) {\n var detail = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n detail.file = this.file;\n detail.id = this.directUpload.id;\n return dispatchEvent(this.input, \"direct-upload:\" + name, {\n detail: detail\n });\n }\n }, {\n key: \"dispatchError\",\n value: function dispatchError(error) {\n var event = this.dispatch(\"error\", {\n error: error\n });\n\n if (!event.defaultPrevented) {\n alert(error);\n }\n }\n }, {\n key: \"directUploadWillCreateBlobWithXHR\",\n value: function directUploadWillCreateBlobWithXHR(xhr) {\n this.dispatch(\"before-blob-request\", {\n xhr: xhr\n });\n }\n }, {\n key: \"directUploadWillStoreFileWithXHR\",\n value: function directUploadWillStoreFileWithXHR(xhr) {\n var _this2 = this;\n\n this.dispatch(\"before-storage-request\", {\n xhr: xhr\n });\n xhr.upload.addEventListener(\"progress\", function (event) {\n return _this2.uploadRequestDidProgress(event);\n });\n }\n }, {\n key: \"url\",\n get: function get$$1() {\n return this.input.getAttribute(\"data-direct-upload-url\");\n }\n }]);\n return DirectUploadController;\n }();\n\n var inputSelector = \"input[type=file][data-direct-upload-url]:not([disabled])\";\n\n var DirectUploadsController = function () {\n function DirectUploadsController(form) {\n classCallCheck(this, DirectUploadsController);\n this.form = form;\n this.inputs = findElements(form, inputSelector).filter(function (input) {\n return input.files.length;\n });\n }\n\n createClass(DirectUploadsController, [{\n key: \"start\",\n value: function start(callback) {\n var _this = this;\n\n var controllers = this.createDirectUploadControllers();\n\n var startNextController = function startNextController() {\n var controller = controllers.shift();\n\n if (controller) {\n controller.start(function (error) {\n if (error) {\n callback(error);\n\n _this.dispatch(\"end\");\n } else {\n startNextController();\n }\n });\n } else {\n callback();\n\n _this.dispatch(\"end\");\n }\n };\n\n this.dispatch(\"start\");\n startNextController();\n }\n }, {\n key: \"createDirectUploadControllers\",\n value: function createDirectUploadControllers() {\n var controllers = [];\n this.inputs.forEach(function (input) {\n toArray$1(input.files).forEach(function (file) {\n var controller = new DirectUploadController(input, file);\n controllers.push(controller);\n });\n });\n return controllers;\n }\n }, {\n key: \"dispatch\",\n value: function dispatch(name) {\n var detail = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return dispatchEvent(this.form, \"direct-uploads:\" + name, {\n detail: detail\n });\n }\n }]);\n return DirectUploadsController;\n }();\n\n var processingAttribute = \"data-direct-uploads-processing\";\n var submitButtonsByForm = new WeakMap();\n var started = false;\n\n function start() {\n if (!started) {\n started = true;\n document.addEventListener(\"click\", didClick, true);\n document.addEventListener(\"submit\", didSubmitForm);\n document.addEventListener(\"ajax:before\", didSubmitRemoteElement);\n }\n }\n\n function didClick(event) {\n var target = event.target;\n\n if ((target.tagName == \"INPUT\" || target.tagName == \"BUTTON\") && target.type == \"submit\" && target.form) {\n submitButtonsByForm.set(target.form, target);\n }\n }\n\n function didSubmitForm(event) {\n handleFormSubmissionEvent(event);\n }\n\n function didSubmitRemoteElement(event) {\n if (event.target.tagName == \"FORM\") {\n handleFormSubmissionEvent(event);\n }\n }\n\n function handleFormSubmissionEvent(event) {\n var form = event.target;\n\n if (form.hasAttribute(processingAttribute)) {\n event.preventDefault();\n return;\n }\n\n var controller = new DirectUploadsController(form);\n var inputs = controller.inputs;\n\n if (inputs.length) {\n event.preventDefault();\n form.setAttribute(processingAttribute, \"\");\n inputs.forEach(disable);\n controller.start(function (error) {\n form.removeAttribute(processingAttribute);\n\n if (error) {\n inputs.forEach(enable);\n } else {\n submitForm(form);\n }\n });\n }\n }\n\n function submitForm(form) {\n var button = submitButtonsByForm.get(form) || findElement(form, \"input[type=submit], button[type=submit]\");\n\n if (button) {\n var _button = button,\n disabled = _button.disabled;\n button.disabled = false;\n button.focus();\n button.click();\n button.disabled = disabled;\n } else {\n button = document.createElement(\"input\");\n button.type = \"submit\";\n button.style.display = \"none\";\n form.appendChild(button);\n button.click();\n form.removeChild(button);\n }\n\n submitButtonsByForm[\"delete\"](form);\n }\n\n function disable(input) {\n input.disabled = true;\n }\n\n function enable(input) {\n input.disabled = false;\n }\n\n function autostart() {\n if (window.ActiveStorage) {\n start();\n }\n }\n\n setTimeout(autostart, 1);\n exports.start = start;\n exports.DirectUpload = DirectUpload;\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n});","function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/*\nUnobtrusive JavaScript\nhttps://github.com/rails/rails/blob/master/actionview/app/assets/javascripts\nReleased under the MIT license\n */\n(function () {\n var context = this;\n (function () {\n (function () {\n this.Rails = {\n linkClickSelector: 'a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]',\n buttonClickSelector: {\n selector: 'button[data-remote]:not([form]), button[data-confirm]:not([form])',\n exclude: 'form button'\n },\n inputChangeSelector: 'select[data-remote], input[data-remote], textarea[data-remote]',\n formSubmitSelector: 'form',\n formInputClickSelector: 'form input[type=submit], form input[type=image], form button[type=submit], form button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])',\n formDisableSelector: 'input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled',\n formEnableSelector: 'input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled',\n fileInputSelector: 'input[name][type=file]:not([disabled])',\n linkDisableSelector: 'a[data-disable-with], a[data-disable]',\n buttonDisableSelector: 'button[data-remote][data-disable-with], button[data-remote][data-disable]'\n };\n }).call(this);\n }).call(context);\n var Rails = context.Rails;\n (function () {\n (function () {\n var nonce;\n nonce = null;\n\n Rails.loadCSPNonce = function () {\n var ref;\n return nonce = (ref = document.querySelector(\"meta[name=csp-nonce]\")) != null ? ref.content : void 0;\n };\n\n Rails.cspNonce = function () {\n return nonce != null ? nonce : Rails.loadCSPNonce();\n };\n }).call(this);\n (function () {\n var expando, m;\n m = Element.prototype.matches || Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector;\n\n Rails.matches = function (element, selector) {\n if (selector.exclude != null) {\n return m.call(element, selector.selector) && !m.call(element, selector.exclude);\n } else {\n return m.call(element, selector);\n }\n };\n\n expando = '_ujsData';\n\n Rails.getData = function (element, key) {\n var ref;\n return (ref = element[expando]) != null ? ref[key] : void 0;\n };\n\n Rails.setData = function (element, key, value) {\n if (element[expando] == null) {\n element[expando] = {};\n }\n\n return element[expando][key] = value;\n };\n\n Rails.$ = function (selector) {\n return Array.prototype.slice.call(document.querySelectorAll(selector));\n };\n }).call(this);\n (function () {\n var $, csrfParam, csrfToken;\n $ = Rails.$;\n\n csrfToken = Rails.csrfToken = function () {\n var meta;\n meta = document.querySelector('meta[name=csrf-token]');\n return meta && meta.content;\n };\n\n csrfParam = Rails.csrfParam = function () {\n var meta;\n meta = document.querySelector('meta[name=csrf-param]');\n return meta && meta.content;\n };\n\n Rails.CSRFProtection = function (xhr) {\n var token;\n token = csrfToken();\n\n if (token != null) {\n return xhr.setRequestHeader('X-CSRF-Token', token);\n }\n };\n\n Rails.refreshCSRFTokens = function () {\n var param, token;\n token = csrfToken();\n param = csrfParam();\n\n if (token != null && param != null) {\n return $('form input[name=\"' + param + '\"]').forEach(function (input) {\n return input.value = token;\n });\n }\n };\n }).call(this);\n (function () {\n var CustomEvent, fire, matches, preventDefault;\n matches = Rails.matches;\n CustomEvent = window.CustomEvent;\n\n if (typeof CustomEvent !== 'function') {\n CustomEvent = function CustomEvent(event, params) {\n var evt;\n evt = document.createEvent('CustomEvent');\n evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\n return evt;\n };\n\n CustomEvent.prototype = window.Event.prototype;\n preventDefault = CustomEvent.prototype.preventDefault;\n\n CustomEvent.prototype.preventDefault = function () {\n var result;\n result = preventDefault.call(this);\n\n if (this.cancelable && !this.defaultPrevented) {\n Object.defineProperty(this, 'defaultPrevented', {\n get: function get() {\n return true;\n }\n });\n }\n\n return result;\n };\n }\n\n fire = Rails.fire = function (obj, name, data) {\n var event;\n event = new CustomEvent(name, {\n bubbles: true,\n cancelable: true,\n detail: data\n });\n obj.dispatchEvent(event);\n return !event.defaultPrevented;\n };\n\n Rails.stopEverything = function (e) {\n fire(e.target, 'ujs:everythingStopped');\n e.preventDefault();\n e.stopPropagation();\n return e.stopImmediatePropagation();\n };\n\n Rails.delegate = function (element, selector, eventType, handler) {\n return element.addEventListener(eventType, function (e) {\n var target;\n target = e.target;\n\n while (!(!(target instanceof Element) || matches(target, selector))) {\n target = target.parentNode;\n }\n\n if (target instanceof Element && handler.call(target, e) === false) {\n e.preventDefault();\n return e.stopPropagation();\n }\n });\n };\n }).call(this);\n (function () {\n var AcceptHeaders, CSRFProtection, createXHR, cspNonce, fire, prepareOptions, processResponse;\n cspNonce = Rails.cspNonce, CSRFProtection = Rails.CSRFProtection, fire = Rails.fire;\n AcceptHeaders = {\n '*': '*/*',\n text: 'text/plain',\n html: 'text/html',\n xml: 'application/xml, text/xml',\n json: 'application/json, text/javascript',\n script: 'text/javascript, application/javascript, application/ecmascript, application/x-ecmascript'\n };\n\n Rails.ajax = function (options) {\n var xhr;\n options = prepareOptions(options);\n xhr = createXHR(options, function () {\n var ref, response;\n response = processResponse((ref = xhr.response) != null ? ref : xhr.responseText, xhr.getResponseHeader('Content-Type'));\n\n if (Math.floor(xhr.status / 100) === 2) {\n if (typeof options.success === \"function\") {\n options.success(response, xhr.statusText, xhr);\n }\n } else {\n if (typeof options.error === \"function\") {\n options.error(response, xhr.statusText, xhr);\n }\n }\n\n return typeof options.complete === \"function\" ? options.complete(xhr, xhr.statusText) : void 0;\n });\n\n if (options.beforeSend != null && !options.beforeSend(xhr, options)) {\n return false;\n }\n\n if (xhr.readyState === XMLHttpRequest.OPENED) {\n return xhr.send(options.data);\n }\n };\n\n prepareOptions = function prepareOptions(options) {\n options.url = options.url || location.href;\n options.type = options.type.toUpperCase();\n\n if (options.type === 'GET' && options.data) {\n if (options.url.indexOf('?') < 0) {\n options.url += '?' + options.data;\n } else {\n options.url += '&' + options.data;\n }\n }\n\n if (AcceptHeaders[options.dataType] == null) {\n options.dataType = '*';\n }\n\n options.accept = AcceptHeaders[options.dataType];\n\n if (options.dataType !== '*') {\n options.accept += ', */*; q=0.01';\n }\n\n return options;\n };\n\n createXHR = function createXHR(options, done) {\n var xhr;\n xhr = new XMLHttpRequest();\n xhr.open(options.type, options.url, true);\n xhr.setRequestHeader('Accept', options.accept);\n\n if (typeof options.data === 'string') {\n xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');\n }\n\n if (!options.crossDomain) {\n xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n }\n\n CSRFProtection(xhr);\n xhr.withCredentials = !!options.withCredentials;\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState === XMLHttpRequest.DONE) {\n return done(xhr);\n }\n };\n\n return xhr;\n };\n\n processResponse = function processResponse(response, type) {\n var parser, script;\n\n if (typeof response === 'string' && typeof type === 'string') {\n if (type.match(/\\bjson\\b/)) {\n try {\n response = JSON.parse(response);\n } catch (error) {}\n } else if (type.match(/\\b(?:java|ecma)script\\b/)) {\n script = document.createElement('script');\n script.setAttribute('nonce', cspNonce());\n script.text = response;\n document.head.appendChild(script).parentNode.removeChild(script);\n } else if (type.match(/\\b(xml|html|svg)\\b/)) {\n parser = new DOMParser();\n type = type.replace(/;.+/, '');\n\n try {\n response = parser.parseFromString(response, type);\n } catch (error) {}\n }\n }\n\n return response;\n };\n\n Rails.href = function (element) {\n return element.href;\n };\n\n Rails.isCrossDomain = function (url) {\n var e, originAnchor, urlAnchor;\n originAnchor = document.createElement('a');\n originAnchor.href = location.href;\n urlAnchor = document.createElement('a');\n\n try {\n urlAnchor.href = url;\n return !((!urlAnchor.protocol || urlAnchor.protocol === ':') && !urlAnchor.host || originAnchor.protocol + '//' + originAnchor.host === urlAnchor.protocol + '//' + urlAnchor.host);\n } catch (error) {\n e = error;\n return true;\n }\n };\n }).call(this);\n (function () {\n var matches, toArray;\n matches = Rails.matches;\n\n toArray = function toArray(e) {\n return Array.prototype.slice.call(e);\n };\n\n Rails.serializeElement = function (element, additionalParam) {\n var inputs, params;\n inputs = [element];\n\n if (matches(element, 'form')) {\n inputs = toArray(element.elements);\n }\n\n params = [];\n inputs.forEach(function (input) {\n if (!input.name || input.disabled) {\n return;\n }\n\n if (input.closest('fieldset[disabled]')) {\n return;\n }\n\n if (matches(input, 'select')) {\n return toArray(input.options).forEach(function (option) {\n if (option.selected) {\n return params.push({\n name: input.name,\n value: option.value\n });\n }\n });\n } else if (input.checked || ['radio', 'checkbox', 'submit'].indexOf(input.type) === -1) {\n return params.push({\n name: input.name,\n value: input.value\n });\n }\n });\n\n if (additionalParam) {\n params.push(additionalParam);\n }\n\n return params.map(function (param) {\n if (param.name != null) {\n return encodeURIComponent(param.name) + \"=\" + encodeURIComponent(param.value);\n } else {\n return param;\n }\n }).join('&');\n };\n\n Rails.formElements = function (form, selector) {\n if (matches(form, 'form')) {\n return toArray(form.elements).filter(function (el) {\n return matches(el, selector);\n });\n } else {\n return toArray(form.querySelectorAll(selector));\n }\n };\n }).call(this);\n (function () {\n var allowAction, fire, stopEverything;\n fire = Rails.fire, stopEverything = Rails.stopEverything;\n\n Rails.handleConfirm = function (e) {\n if (!allowAction(this)) {\n return stopEverything(e);\n }\n };\n\n Rails.confirm = function (message, element) {\n return confirm(message);\n };\n\n allowAction = function allowAction(element) {\n var answer, callback, message;\n message = element.getAttribute('data-confirm');\n\n if (!message) {\n return true;\n }\n\n answer = false;\n\n if (fire(element, 'confirm')) {\n try {\n answer = Rails.confirm(message, element);\n } catch (error) {}\n\n callback = fire(element, 'confirm:complete', [answer]);\n }\n\n return answer && callback;\n };\n }).call(this);\n (function () {\n var disableFormElement, disableFormElements, disableLinkElement, enableFormElement, enableFormElements, enableLinkElement, formElements, getData, isXhrRedirect, matches, setData, stopEverything;\n matches = Rails.matches, getData = Rails.getData, setData = Rails.setData, stopEverything = Rails.stopEverything, formElements = Rails.formElements;\n\n Rails.handleDisabledElement = function (e) {\n var element;\n element = this;\n\n if (element.disabled) {\n return stopEverything(e);\n }\n };\n\n Rails.enableElement = function (e) {\n var element;\n\n if (e instanceof Event) {\n if (isXhrRedirect(e)) {\n return;\n }\n\n element = e.target;\n } else {\n element = e;\n }\n\n if (matches(element, Rails.linkDisableSelector)) {\n return enableLinkElement(element);\n } else if (matches(element, Rails.buttonDisableSelector) || matches(element, Rails.formEnableSelector)) {\n return enableFormElement(element);\n } else if (matches(element, Rails.formSubmitSelector)) {\n return enableFormElements(element);\n }\n };\n\n Rails.disableElement = function (e) {\n var element;\n element = e instanceof Event ? e.target : e;\n\n if (matches(element, Rails.linkDisableSelector)) {\n return disableLinkElement(element);\n } else if (matches(element, Rails.buttonDisableSelector) || matches(element, Rails.formDisableSelector)) {\n return disableFormElement(element);\n } else if (matches(element, Rails.formSubmitSelector)) {\n return disableFormElements(element);\n }\n };\n\n disableLinkElement = function disableLinkElement(element) {\n var replacement;\n\n if (getData(element, 'ujs:disabled')) {\n return;\n }\n\n replacement = element.getAttribute('data-disable-with');\n\n if (replacement != null) {\n setData(element, 'ujs:enable-with', element.innerHTML);\n element.innerHTML = replacement;\n }\n\n element.addEventListener('click', stopEverything);\n return setData(element, 'ujs:disabled', true);\n };\n\n enableLinkElement = function enableLinkElement(element) {\n var originalText;\n originalText = getData(element, 'ujs:enable-with');\n\n if (originalText != null) {\n element.innerHTML = originalText;\n setData(element, 'ujs:enable-with', null);\n }\n\n element.removeEventListener('click', stopEverything);\n return setData(element, 'ujs:disabled', null);\n };\n\n disableFormElements = function disableFormElements(form) {\n return formElements(form, Rails.formDisableSelector).forEach(disableFormElement);\n };\n\n disableFormElement = function disableFormElement(element) {\n var replacement;\n\n if (getData(element, 'ujs:disabled')) {\n return;\n }\n\n replacement = element.getAttribute('data-disable-with');\n\n if (replacement != null) {\n if (matches(element, 'button')) {\n setData(element, 'ujs:enable-with', element.innerHTML);\n element.innerHTML = replacement;\n } else {\n setData(element, 'ujs:enable-with', element.value);\n element.value = replacement;\n }\n }\n\n element.disabled = true;\n return setData(element, 'ujs:disabled', true);\n };\n\n enableFormElements = function enableFormElements(form) {\n return formElements(form, Rails.formEnableSelector).forEach(enableFormElement);\n };\n\n enableFormElement = function enableFormElement(element) {\n var originalText;\n originalText = getData(element, 'ujs:enable-with');\n\n if (originalText != null) {\n if (matches(element, 'button')) {\n element.innerHTML = originalText;\n } else {\n element.value = originalText;\n }\n\n setData(element, 'ujs:enable-with', null);\n }\n\n element.disabled = false;\n return setData(element, 'ujs:disabled', null);\n };\n\n isXhrRedirect = function isXhrRedirect(event) {\n var ref, xhr;\n xhr = (ref = event.detail) != null ? ref[0] : void 0;\n return (xhr != null ? xhr.getResponseHeader(\"X-Xhr-Redirect\") : void 0) != null;\n };\n }).call(this);\n (function () {\n var stopEverything;\n stopEverything = Rails.stopEverything;\n\n Rails.handleMethod = function (e) {\n var csrfParam, csrfToken, form, formContent, href, link, method;\n link = this;\n method = link.getAttribute('data-method');\n\n if (!method) {\n return;\n }\n\n href = Rails.href(link);\n csrfToken = Rails.csrfToken();\n csrfParam = Rails.csrfParam();\n form = document.createElement('form');\n formContent = \"\";\n\n if (csrfParam != null && csrfToken != null && !Rails.isCrossDomain(href)) {\n formContent += \"\";\n }\n\n formContent += '';\n form.method = 'post';\n form.action = href;\n form.target = link.target;\n form.innerHTML = formContent;\n form.style.display = 'none';\n document.body.appendChild(form);\n form.querySelector('[type=\"submit\"]').click();\n return stopEverything(e);\n };\n }).call(this);\n (function () {\n var ajax,\n fire,\n getData,\n isCrossDomain,\n isRemote,\n matches,\n serializeElement,\n setData,\n stopEverything,\n slice = [].slice;\n matches = Rails.matches, getData = Rails.getData, setData = Rails.setData, fire = Rails.fire, stopEverything = Rails.stopEverything, ajax = Rails.ajax, isCrossDomain = Rails.isCrossDomain, serializeElement = Rails.serializeElement;\n\n isRemote = function isRemote(element) {\n var value;\n value = element.getAttribute('data-remote');\n return value != null && value !== 'false';\n };\n\n Rails.handleRemote = function (e) {\n var button, data, dataType, element, method, url, withCredentials;\n element = this;\n\n if (!isRemote(element)) {\n return true;\n }\n\n if (!fire(element, 'ajax:before')) {\n fire(element, 'ajax:stopped');\n return false;\n }\n\n withCredentials = element.getAttribute('data-with-credentials');\n dataType = element.getAttribute('data-type') || 'script';\n\n if (matches(element, Rails.formSubmitSelector)) {\n button = getData(element, 'ujs:submit-button');\n method = getData(element, 'ujs:submit-button-formmethod') || element.method;\n url = getData(element, 'ujs:submit-button-formaction') || element.getAttribute('action') || location.href;\n\n if (method.toUpperCase() === 'GET') {\n url = url.replace(/\\?.*$/, '');\n }\n\n if (element.enctype === 'multipart/form-data') {\n data = new FormData(element);\n\n if (button != null) {\n data.append(button.name, button.value);\n }\n } else {\n data = serializeElement(element, button);\n }\n\n setData(element, 'ujs:submit-button', null);\n setData(element, 'ujs:submit-button-formmethod', null);\n setData(element, 'ujs:submit-button-formaction', null);\n } else if (matches(element, Rails.buttonClickSelector) || matches(element, Rails.inputChangeSelector)) {\n method = element.getAttribute('data-method');\n url = element.getAttribute('data-url');\n data = serializeElement(element, element.getAttribute('data-params'));\n } else {\n method = element.getAttribute('data-method');\n url = Rails.href(element);\n data = element.getAttribute('data-params');\n }\n\n ajax({\n type: method || 'GET',\n url: url,\n data: data,\n dataType: dataType,\n beforeSend: function beforeSend(xhr, options) {\n if (fire(element, 'ajax:beforeSend', [xhr, options])) {\n return fire(element, 'ajax:send', [xhr]);\n } else {\n fire(element, 'ajax:stopped');\n return false;\n }\n },\n success: function success() {\n var args;\n args = 1 <= arguments.length ? slice.call(arguments, 0) : [];\n return fire(element, 'ajax:success', args);\n },\n error: function error() {\n var args;\n args = 1 <= arguments.length ? slice.call(arguments, 0) : [];\n return fire(element, 'ajax:error', args);\n },\n complete: function complete() {\n var args;\n args = 1 <= arguments.length ? slice.call(arguments, 0) : [];\n return fire(element, 'ajax:complete', args);\n },\n crossDomain: isCrossDomain(url),\n withCredentials: withCredentials != null && withCredentials !== 'false'\n });\n return stopEverything(e);\n };\n\n Rails.formSubmitButtonClick = function (e) {\n var button, form;\n button = this;\n form = button.form;\n\n if (!form) {\n return;\n }\n\n if (button.name) {\n setData(form, 'ujs:submit-button', {\n name: button.name,\n value: button.value\n });\n }\n\n setData(form, 'ujs:formnovalidate-button', button.formNoValidate);\n setData(form, 'ujs:submit-button-formaction', button.getAttribute('formaction'));\n return setData(form, 'ujs:submit-button-formmethod', button.getAttribute('formmethod'));\n };\n\n Rails.preventInsignificantClick = function (e) {\n var data, insignificantMetaClick, link, metaClick, method, nonPrimaryMouseClick;\n link = this;\n method = (link.getAttribute('data-method') || 'GET').toUpperCase();\n data = link.getAttribute('data-params');\n metaClick = e.metaKey || e.ctrlKey;\n insignificantMetaClick = metaClick && method === 'GET' && !data;\n nonPrimaryMouseClick = e.button != null && e.button !== 0;\n\n if (nonPrimaryMouseClick || insignificantMetaClick) {\n return e.stopImmediatePropagation();\n }\n };\n }).call(this);\n (function () {\n var $, CSRFProtection, delegate, disableElement, enableElement, fire, formSubmitButtonClick, getData, handleConfirm, handleDisabledElement, handleMethod, handleRemote, loadCSPNonce, preventInsignificantClick, refreshCSRFTokens;\n fire = Rails.fire, delegate = Rails.delegate, getData = Rails.getData, $ = Rails.$, refreshCSRFTokens = Rails.refreshCSRFTokens, CSRFProtection = Rails.CSRFProtection, loadCSPNonce = Rails.loadCSPNonce, enableElement = Rails.enableElement, disableElement = Rails.disableElement, handleDisabledElement = Rails.handleDisabledElement, handleConfirm = Rails.handleConfirm, preventInsignificantClick = Rails.preventInsignificantClick, handleRemote = Rails.handleRemote, formSubmitButtonClick = Rails.formSubmitButtonClick, handleMethod = Rails.handleMethod;\n\n if (typeof jQuery !== \"undefined\" && jQuery !== null && jQuery.ajax != null) {\n if (jQuery.rails) {\n throw new Error('If you load both jquery_ujs and rails-ujs, use rails-ujs only.');\n }\n\n jQuery.rails = Rails;\n jQuery.ajaxPrefilter(function (options, originalOptions, xhr) {\n if (!options.crossDomain) {\n return CSRFProtection(xhr);\n }\n });\n }\n\n Rails.start = function () {\n if (window._rails_loaded) {\n throw new Error('rails-ujs has already been loaded!');\n }\n\n window.addEventListener('pageshow', function () {\n $(Rails.formEnableSelector).forEach(function (el) {\n if (getData(el, 'ujs:disabled')) {\n return enableElement(el);\n }\n });\n return $(Rails.linkDisableSelector).forEach(function (el) {\n if (getData(el, 'ujs:disabled')) {\n return enableElement(el);\n }\n });\n });\n delegate(document, Rails.linkDisableSelector, 'ajax:complete', enableElement);\n delegate(document, Rails.linkDisableSelector, 'ajax:stopped', enableElement);\n delegate(document, Rails.buttonDisableSelector, 'ajax:complete', enableElement);\n delegate(document, Rails.buttonDisableSelector, 'ajax:stopped', enableElement);\n delegate(document, Rails.linkClickSelector, 'click', preventInsignificantClick);\n delegate(document, Rails.linkClickSelector, 'click', handleDisabledElement);\n delegate(document, Rails.linkClickSelector, 'click', handleConfirm);\n delegate(document, Rails.linkClickSelector, 'click', disableElement);\n delegate(document, Rails.linkClickSelector, 'click', handleRemote);\n delegate(document, Rails.linkClickSelector, 'click', handleMethod);\n delegate(document, Rails.buttonClickSelector, 'click', preventInsignificantClick);\n delegate(document, Rails.buttonClickSelector, 'click', handleDisabledElement);\n delegate(document, Rails.buttonClickSelector, 'click', handleConfirm);\n delegate(document, Rails.buttonClickSelector, 'click', disableElement);\n delegate(document, Rails.buttonClickSelector, 'click', handleRemote);\n delegate(document, Rails.inputChangeSelector, 'change', handleDisabledElement);\n delegate(document, Rails.inputChangeSelector, 'change', handleConfirm);\n delegate(document, Rails.inputChangeSelector, 'change', handleRemote);\n delegate(document, Rails.formSubmitSelector, 'submit', handleDisabledElement);\n delegate(document, Rails.formSubmitSelector, 'submit', handleConfirm);\n delegate(document, Rails.formSubmitSelector, 'submit', handleRemote);\n delegate(document, Rails.formSubmitSelector, 'submit', function (e) {\n return setTimeout(function () {\n return disableElement(e);\n }, 13);\n });\n delegate(document, Rails.formSubmitSelector, 'ajax:send', disableElement);\n delegate(document, Rails.formSubmitSelector, 'ajax:complete', enableElement);\n delegate(document, Rails.formInputClickSelector, 'click', preventInsignificantClick);\n delegate(document, Rails.formInputClickSelector, 'click', handleDisabledElement);\n delegate(document, Rails.formInputClickSelector, 'click', handleConfirm);\n delegate(document, Rails.formInputClickSelector, 'click', formSubmitButtonClick);\n document.addEventListener('DOMContentLoaded', refreshCSRFTokens);\n document.addEventListener('DOMContentLoaded', loadCSPNonce);\n return window._rails_loaded = true;\n };\n\n if (window.Rails === Rails && fire(document, 'rails:attachBindings')) {\n Rails.start();\n }\n }).call(this);\n }).call(this);\n\n if ((typeof module === \"undefined\" ? \"undefined\" : _typeof(module)) === \"object\" && module.exports) {\n module.exports = Rails;\n } else if (typeof define === \"function\" && define.amd) {\n define(Rails);\n }\n}).call(this);","function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/*\nTurbolinks 5.2.0\nCopyright © 2018 Basecamp, LLC\n */\n(function () {\n var t = this;\n (function () {\n (function () {\n this.Turbolinks = {\n supported: function () {\n return null != window.history.pushState && null != window.requestAnimationFrame && null != window.addEventListener;\n }(),\n visit: function visit(t, r) {\n return e.controller.visit(t, r);\n },\n clearCache: function clearCache() {\n return e.controller.clearCache();\n },\n setProgressBarDelay: function setProgressBarDelay(t) {\n return e.controller.setProgressBarDelay(t);\n }\n };\n }).call(this);\n }).call(t);\n var e = t.Turbolinks;\n (function () {\n (function () {\n var t,\n r,\n n,\n o = [].slice;\n e.copyObject = function (t) {\n var e, r, n;\n r = {};\n\n for (e in t) {\n n = t[e], r[e] = n;\n }\n\n return r;\n }, e.closest = function (e, r) {\n return t.call(e, r);\n }, t = function () {\n var t, e;\n return t = document.documentElement, null != (e = t.closest) ? e : function (t) {\n var e;\n\n for (e = this; e;) {\n if (e.nodeType === Node.ELEMENT_NODE && r.call(e, t)) return e;\n e = e.parentNode;\n }\n };\n }(), e.defer = function (t) {\n return setTimeout(t, 1);\n }, e.throttle = function (t) {\n var e;\n return e = null, function () {\n var r;\n return r = 1 <= arguments.length ? o.call(arguments, 0) : [], null != e ? e : e = requestAnimationFrame(function (n) {\n return function () {\n return e = null, t.apply(n, r);\n };\n }(this));\n };\n }, e.dispatch = function (t, e) {\n var r, o, i, s, a, u;\n return a = null != e ? e : {}, u = a.target, r = a.cancelable, o = a.data, i = document.createEvent(\"Events\"), i.initEvent(t, !0, r === !0), i.data = null != o ? o : {}, i.cancelable && !n && (s = i.preventDefault, i.preventDefault = function () {\n return this.defaultPrevented || Object.defineProperty(this, \"defaultPrevented\", {\n get: function get() {\n return !0;\n }\n }), s.call(this);\n }), (null != u ? u : document).dispatchEvent(i), i;\n }, n = function () {\n var t;\n return t = document.createEvent(\"Events\"), t.initEvent(\"test\", !0, !0), t.preventDefault(), t.defaultPrevented;\n }(), e.match = function (t, e) {\n return r.call(t, e);\n }, r = function () {\n var t, e, r, n;\n return t = document.documentElement, null != (e = null != (r = null != (n = t.matchesSelector) ? n : t.webkitMatchesSelector) ? r : t.msMatchesSelector) ? e : t.mozMatchesSelector;\n }(), e.uuid = function () {\n var t, e, r;\n\n for (r = \"\", t = e = 1; 36 >= e; t = ++e) {\n r += 9 === t || 14 === t || 19 === t || 24 === t ? \"-\" : 15 === t ? \"4\" : 20 === t ? (Math.floor(4 * Math.random()) + 8).toString(16) : Math.floor(15 * Math.random()).toString(16);\n }\n\n return r;\n };\n }).call(this), function () {\n e.Location = function () {\n function t(t) {\n var e, r;\n null == t && (t = \"\"), r = document.createElement(\"a\"), r.href = t.toString(), this.absoluteURL = r.href, e = r.hash.length, 2 > e ? this.requestURL = this.absoluteURL : (this.requestURL = this.absoluteURL.slice(0, -e), this.anchor = r.hash.slice(1));\n }\n\n var e, r, n, o;\n return t.wrap = function (t) {\n return t instanceof this ? t : new this(t);\n }, t.prototype.getOrigin = function () {\n return this.absoluteURL.split(\"/\", 3).join(\"/\");\n }, t.prototype.getPath = function () {\n var t, e;\n return null != (t = null != (e = this.requestURL.match(/\\/\\/[^\\/]*(\\/[^?;]*)/)) ? e[1] : void 0) ? t : \"/\";\n }, t.prototype.getPathComponents = function () {\n return this.getPath().split(\"/\").slice(1);\n }, t.prototype.getLastPathComponent = function () {\n return this.getPathComponents().slice(-1)[0];\n }, t.prototype.getExtension = function () {\n var t, e;\n return null != (t = null != (e = this.getLastPathComponent().match(/\\.[^.]*$/)) ? e[0] : void 0) ? t : \"\";\n }, t.prototype.isHTML = function () {\n return this.getExtension().match(/^(?:|\\.(?:htm|html|xhtml))$/);\n }, t.prototype.isPrefixedBy = function (t) {\n var e;\n return e = r(t), this.isEqualTo(t) || o(this.absoluteURL, e);\n }, t.prototype.isEqualTo = function (t) {\n return this.absoluteURL === (null != t ? t.absoluteURL : void 0);\n }, t.prototype.toCacheKey = function () {\n return this.requestURL;\n }, t.prototype.toJSON = function () {\n return this.absoluteURL;\n }, t.prototype.toString = function () {\n return this.absoluteURL;\n }, t.prototype.valueOf = function () {\n return this.absoluteURL;\n }, r = function r(t) {\n return e(t.getOrigin() + t.getPath());\n }, e = function e(t) {\n return n(t, \"/\") ? t : t + \"/\";\n }, o = function o(t, e) {\n return t.slice(0, e.length) === e;\n }, n = function n(t, e) {\n return t.slice(-e.length) === e;\n }, t;\n }();\n }.call(this), function () {\n var t = function t(_t, e) {\n return function () {\n return _t.apply(e, arguments);\n };\n };\n\n e.HttpRequest = function () {\n function r(r, n, o) {\n this.delegate = r, this.requestCanceled = t(this.requestCanceled, this), this.requestTimedOut = t(this.requestTimedOut, this), this.requestFailed = t(this.requestFailed, this), this.requestLoaded = t(this.requestLoaded, this), this.requestProgressed = t(this.requestProgressed, this), this.url = e.Location.wrap(n).requestURL, this.referrer = e.Location.wrap(o).absoluteURL, this.createXHR();\n }\n\n return r.NETWORK_FAILURE = 0, r.TIMEOUT_FAILURE = -1, r.timeout = 60, r.prototype.send = function () {\n var t;\n return this.xhr && !this.sent ? (this.notifyApplicationBeforeRequestStart(), this.setProgress(0), this.xhr.send(), this.sent = !0, \"function\" == typeof (t = this.delegate).requestStarted ? t.requestStarted() : void 0) : void 0;\n }, r.prototype.cancel = function () {\n return this.xhr && this.sent ? this.xhr.abort() : void 0;\n }, r.prototype.requestProgressed = function (t) {\n return t.lengthComputable ? this.setProgress(t.loaded / t.total) : void 0;\n }, r.prototype.requestLoaded = function () {\n return this.endRequest(function (t) {\n return function () {\n var e;\n return 200 <= (e = t.xhr.status) && 300 > e ? t.delegate.requestCompletedWithResponse(t.xhr.responseText, t.xhr.getResponseHeader(\"Turbolinks-Location\")) : (t.failed = !0, t.delegate.requestFailedWithStatusCode(t.xhr.status, t.xhr.responseText));\n };\n }(this));\n }, r.prototype.requestFailed = function () {\n return this.endRequest(function (t) {\n return function () {\n return t.failed = !0, t.delegate.requestFailedWithStatusCode(t.constructor.NETWORK_FAILURE);\n };\n }(this));\n }, r.prototype.requestTimedOut = function () {\n return this.endRequest(function (t) {\n return function () {\n return t.failed = !0, t.delegate.requestFailedWithStatusCode(t.constructor.TIMEOUT_FAILURE);\n };\n }(this));\n }, r.prototype.requestCanceled = function () {\n return this.endRequest();\n }, r.prototype.notifyApplicationBeforeRequestStart = function () {\n return e.dispatch(\"turbolinks:request-start\", {\n data: {\n url: this.url,\n xhr: this.xhr\n }\n });\n }, r.prototype.notifyApplicationAfterRequestEnd = function () {\n return e.dispatch(\"turbolinks:request-end\", {\n data: {\n url: this.url,\n xhr: this.xhr\n }\n });\n }, r.prototype.createXHR = function () {\n return this.xhr = new XMLHttpRequest(), this.xhr.open(\"GET\", this.url, !0), this.xhr.timeout = 1e3 * this.constructor.timeout, this.xhr.setRequestHeader(\"Accept\", \"text/html, application/xhtml+xml\"), this.xhr.setRequestHeader(\"Turbolinks-Referrer\", this.referrer), this.xhr.onprogress = this.requestProgressed, this.xhr.onload = this.requestLoaded, this.xhr.onerror = this.requestFailed, this.xhr.ontimeout = this.requestTimedOut, this.xhr.onabort = this.requestCanceled;\n }, r.prototype.endRequest = function (t) {\n return this.xhr ? (this.notifyApplicationAfterRequestEnd(), null != t && t.call(this), this.destroy()) : void 0;\n }, r.prototype.setProgress = function (t) {\n var e;\n return this.progress = t, \"function\" == typeof (e = this.delegate).requestProgressed ? e.requestProgressed(this.progress) : void 0;\n }, r.prototype.destroy = function () {\n var t;\n return this.setProgress(1), \"function\" == typeof (t = this.delegate).requestFinished && t.requestFinished(), this.delegate = null, this.xhr = null;\n }, r;\n }();\n }.call(this), function () {\n var t = function t(_t2, e) {\n return function () {\n return _t2.apply(e, arguments);\n };\n };\n\n e.ProgressBar = function () {\n function e() {\n this.trickle = t(this.trickle, this), this.stylesheetElement = this.createStylesheetElement(), this.progressElement = this.createProgressElement();\n }\n\n var r;\n return r = 300, e.defaultCSS = \".turbolinks-progress-bar {\\n position: fixed;\\n display: block;\\n top: 0;\\n left: 0;\\n height: 3px;\\n background: #0076ff;\\n z-index: 9999;\\n transition: width \" + r + \"ms ease-out, opacity \" + r / 2 + \"ms \" + r / 2 + \"ms ease-in;\\n transform: translate3d(0, 0, 0);\\n}\", e.prototype.show = function () {\n return this.visible ? void 0 : (this.visible = !0, this.installStylesheetElement(), this.installProgressElement(), this.startTrickling());\n }, e.prototype.hide = function () {\n return this.visible && !this.hiding ? (this.hiding = !0, this.fadeProgressElement(function (t) {\n return function () {\n return t.uninstallProgressElement(), t.stopTrickling(), t.visible = !1, t.hiding = !1;\n };\n }(this))) : void 0;\n }, e.prototype.setValue = function (t) {\n return this.value = t, this.refresh();\n }, e.prototype.installStylesheetElement = function () {\n return document.head.insertBefore(this.stylesheetElement, document.head.firstChild);\n }, e.prototype.installProgressElement = function () {\n return this.progressElement.style.width = 0, this.progressElement.style.opacity = 1, document.documentElement.insertBefore(this.progressElement, document.body), this.refresh();\n }, e.prototype.fadeProgressElement = function (t) {\n return this.progressElement.style.opacity = 0, setTimeout(t, 1.5 * r);\n }, e.prototype.uninstallProgressElement = function () {\n return this.progressElement.parentNode ? document.documentElement.removeChild(this.progressElement) : void 0;\n }, e.prototype.startTrickling = function () {\n return null != this.trickleInterval ? this.trickleInterval : this.trickleInterval = setInterval(this.trickle, r);\n }, e.prototype.stopTrickling = function () {\n return clearInterval(this.trickleInterval), this.trickleInterval = null;\n }, e.prototype.trickle = function () {\n return this.setValue(this.value + Math.random() / 100);\n }, e.prototype.refresh = function () {\n return requestAnimationFrame(function (t) {\n return function () {\n return t.progressElement.style.width = 10 + 90 * t.value + \"%\";\n };\n }(this));\n }, e.prototype.createStylesheetElement = function () {\n var t;\n return t = document.createElement(\"style\"), t.type = \"text/css\", t.textContent = this.constructor.defaultCSS, t;\n }, e.prototype.createProgressElement = function () {\n var t;\n return t = document.createElement(\"div\"), t.className = \"turbolinks-progress-bar\", t;\n }, e;\n }();\n }.call(this), function () {\n var t = function t(_t3, e) {\n return function () {\n return _t3.apply(e, arguments);\n };\n };\n\n e.BrowserAdapter = function () {\n function r(r) {\n this.controller = r, this.showProgressBar = t(this.showProgressBar, this), this.progressBar = new e.ProgressBar();\n }\n\n var n, o, i;\n return i = e.HttpRequest, n = i.NETWORK_FAILURE, o = i.TIMEOUT_FAILURE, r.prototype.visitProposedToLocationWithAction = function (t, e) {\n return this.controller.startVisitToLocationWithAction(t, e);\n }, r.prototype.visitStarted = function (t) {\n return t.issueRequest(), t.changeHistory(), t.loadCachedSnapshot();\n }, r.prototype.visitRequestStarted = function (t) {\n return this.progressBar.setValue(0), t.hasCachedSnapshot() || \"restore\" !== t.action ? this.showProgressBarAfterDelay() : this.showProgressBar();\n }, r.prototype.visitRequestProgressed = function (t) {\n return this.progressBar.setValue(t.progress);\n }, r.prototype.visitRequestCompleted = function (t) {\n return t.loadResponse();\n }, r.prototype.visitRequestFailedWithStatusCode = function (t, e) {\n switch (e) {\n case n:\n case o:\n return this.reload();\n\n default:\n return t.loadResponse();\n }\n }, r.prototype.visitRequestFinished = function (t) {\n return this.hideProgressBar();\n }, r.prototype.visitCompleted = function (t) {\n return t.followRedirect();\n }, r.prototype.pageInvalidated = function () {\n return this.reload();\n }, r.prototype.showProgressBarAfterDelay = function () {\n return this.progressBarTimeout = setTimeout(this.showProgressBar, this.controller.progressBarDelay);\n }, r.prototype.showProgressBar = function () {\n return this.progressBar.show();\n }, r.prototype.hideProgressBar = function () {\n return this.progressBar.hide(), clearTimeout(this.progressBarTimeout);\n }, r.prototype.reload = function () {\n return window.location.reload();\n }, r;\n }();\n }.call(this), function () {\n var t = function t(_t4, e) {\n return function () {\n return _t4.apply(e, arguments);\n };\n };\n\n e.History = function () {\n function r(e) {\n this.delegate = e, this.onPageLoad = t(this.onPageLoad, this), this.onPopState = t(this.onPopState, this);\n }\n\n return r.prototype.start = function () {\n return this.started ? void 0 : (addEventListener(\"popstate\", this.onPopState, !1), addEventListener(\"load\", this.onPageLoad, !1), this.started = !0);\n }, r.prototype.stop = function () {\n return this.started ? (removeEventListener(\"popstate\", this.onPopState, !1), removeEventListener(\"load\", this.onPageLoad, !1), this.started = !1) : void 0;\n }, r.prototype.push = function (t, r) {\n return t = e.Location.wrap(t), this.update(\"push\", t, r);\n }, r.prototype.replace = function (t, r) {\n return t = e.Location.wrap(t), this.update(\"replace\", t, r);\n }, r.prototype.onPopState = function (t) {\n var r, n, o, i;\n return this.shouldHandlePopState() && (i = null != (n = t.state) ? n.turbolinks : void 0) ? (r = e.Location.wrap(window.location), o = i.restorationIdentifier, this.delegate.historyPoppedToLocationWithRestorationIdentifier(r, o)) : void 0;\n }, r.prototype.onPageLoad = function (t) {\n return e.defer(function (t) {\n return function () {\n return t.pageLoaded = !0;\n };\n }(this));\n }, r.prototype.shouldHandlePopState = function () {\n return this.pageIsLoaded();\n }, r.prototype.pageIsLoaded = function () {\n return this.pageLoaded || \"complete\" === document.readyState;\n }, r.prototype.update = function (t, e, r) {\n var n;\n return n = {\n turbolinks: {\n restorationIdentifier: r\n }\n }, history[t + \"State\"](n, null, e);\n }, r;\n }();\n }.call(this), function () {\n e.HeadDetails = function () {\n function t(t) {\n var e, r, n, s, a, u;\n\n for (this.elements = {}, n = 0, a = t.length; a > n; n++) {\n u = t[n], u.nodeType === Node.ELEMENT_NODE && (s = u.outerHTML, r = null != (e = this.elements)[s] ? e[s] : e[s] = {\n type: i(u),\n tracked: o(u),\n elements: []\n }, r.elements.push(u));\n }\n }\n\n var e, r, n, o, i;\n return t.fromHeadElement = function (t) {\n var e;\n return new this(null != (e = null != t ? t.childNodes : void 0) ? e : []);\n }, t.prototype.hasElementWithKey = function (t) {\n return t in this.elements;\n }, t.prototype.getTrackedElementSignature = function () {\n var t, e;\n return function () {\n var r, n;\n r = this.elements, n = [];\n\n for (t in r) {\n e = r[t].tracked, e && n.push(t);\n }\n\n return n;\n }.call(this).join(\"\");\n }, t.prototype.getScriptElementsNotInDetails = function (t) {\n return this.getElementsMatchingTypeNotInDetails(\"script\", t);\n }, t.prototype.getStylesheetElementsNotInDetails = function (t) {\n return this.getElementsMatchingTypeNotInDetails(\"stylesheet\", t);\n }, t.prototype.getElementsMatchingTypeNotInDetails = function (t, e) {\n var r, n, o, i, s, a;\n o = this.elements, s = [];\n\n for (n in o) {\n i = o[n], a = i.type, r = i.elements, a !== t || e.hasElementWithKey(n) || s.push(r[0]);\n }\n\n return s;\n }, t.prototype.getProvisionalElements = function () {\n var t, e, r, n, o, i, s;\n r = [], n = this.elements;\n\n for (e in n) {\n o = n[e], s = o.type, i = o.tracked, t = o.elements, null != s || i ? t.length > 1 && r.push.apply(r, t.slice(1)) : r.push.apply(r, t);\n }\n\n return r;\n }, t.prototype.getMetaValue = function (t) {\n var e;\n return null != (e = this.findMetaElementByName(t)) ? e.getAttribute(\"content\") : void 0;\n }, t.prototype.findMetaElementByName = function (t) {\n var r, n, o, i;\n r = void 0, i = this.elements;\n\n for (o in i) {\n n = i[o].elements, e(n[0], t) && (r = n[0]);\n }\n\n return r;\n }, i = function i(t) {\n return r(t) ? \"script\" : n(t) ? \"stylesheet\" : void 0;\n }, o = function o(t) {\n return \"reload\" === t.getAttribute(\"data-turbolinks-track\");\n }, r = function r(t) {\n var e;\n return e = t.tagName.toLowerCase(), \"script\" === e;\n }, n = function n(t) {\n var e;\n return e = t.tagName.toLowerCase(), \"style\" === e || \"link\" === e && \"stylesheet\" === t.getAttribute(\"rel\");\n }, e = function e(t, _e) {\n var r;\n return r = t.tagName.toLowerCase(), \"meta\" === r && t.getAttribute(\"name\") === _e;\n }, t;\n }();\n }.call(this), function () {\n e.Snapshot = function () {\n function t(t, e) {\n this.headDetails = t, this.bodyElement = e;\n }\n\n return t.wrap = function (t) {\n return t instanceof this ? t : \"string\" == typeof t ? this.fromHTMLString(t) : this.fromHTMLElement(t);\n }, t.fromHTMLString = function (t) {\n var e;\n return e = document.createElement(\"html\"), e.innerHTML = t, this.fromHTMLElement(e);\n }, t.fromHTMLElement = function (t) {\n var r, n, o, i;\n return o = t.querySelector(\"head\"), r = null != (i = t.querySelector(\"body\")) ? i : document.createElement(\"body\"), n = e.HeadDetails.fromHeadElement(o), new this(n, r);\n }, t.prototype.clone = function () {\n return new this.constructor(this.headDetails, this.bodyElement.cloneNode(!0));\n }, t.prototype.getRootLocation = function () {\n var t, r;\n return r = null != (t = this.getSetting(\"root\")) ? t : \"/\", new e.Location(r);\n }, t.prototype.getCacheControlValue = function () {\n return this.getSetting(\"cache-control\");\n }, t.prototype.getElementForAnchor = function (t) {\n try {\n return this.bodyElement.querySelector(\"[id='\" + t + \"'], a[name='\" + t + \"']\");\n } catch (e) {}\n }, t.prototype.getPermanentElements = function () {\n return this.bodyElement.querySelectorAll(\"[id][data-turbolinks-permanent]\");\n }, t.prototype.getPermanentElementById = function (t) {\n return this.bodyElement.querySelector(\"#\" + t + \"[data-turbolinks-permanent]\");\n }, t.prototype.getPermanentElementsPresentInSnapshot = function (t) {\n var e, r, n, o, i;\n\n for (o = this.getPermanentElements(), i = [], r = 0, n = o.length; n > r; r++) {\n e = o[r], t.getPermanentElementById(e.id) && i.push(e);\n }\n\n return i;\n }, t.prototype.findFirstAutofocusableElement = function () {\n return this.bodyElement.querySelector(\"[autofocus]\");\n }, t.prototype.hasAnchor = function (t) {\n return null != this.getElementForAnchor(t);\n }, t.prototype.isPreviewable = function () {\n return \"no-preview\" !== this.getCacheControlValue();\n }, t.prototype.isCacheable = function () {\n return \"no-cache\" !== this.getCacheControlValue();\n }, t.prototype.isVisitable = function () {\n return \"reload\" !== this.getSetting(\"visit-control\");\n }, t.prototype.getSetting = function (t) {\n return this.headDetails.getMetaValue(\"turbolinks-\" + t);\n }, t;\n }();\n }.call(this), function () {\n var t = [].slice;\n\n e.Renderer = function () {\n function e() {}\n\n var r;\n return e.render = function () {\n var e, r, n, o;\n return n = arguments[0], r = arguments[1], e = 3 <= arguments.length ? t.call(arguments, 2) : [], o = function (t, e, r) {\n r.prototype = t.prototype;\n var n = new r(),\n o = t.apply(n, e);\n return Object(o) === o ? o : n;\n }(this, e, function () {}), o.delegate = n, o.render(r), o;\n }, e.prototype.renderView = function (t) {\n return this.delegate.viewWillRender(this.newBody), t(), this.delegate.viewRendered(this.newBody);\n }, e.prototype.invalidateView = function () {\n return this.delegate.viewInvalidated();\n }, e.prototype.createScriptElement = function (t) {\n var e;\n return \"false\" === t.getAttribute(\"data-turbolinks-eval\") ? t : (e = document.createElement(\"script\"), e.textContent = t.textContent, e.async = !1, r(e, t), e);\n }, r = function r(t, e) {\n var r, n, o, i, s, a, u;\n\n for (i = e.attributes, a = [], r = 0, n = i.length; n > r; r++) {\n s = i[r], o = s.name, u = s.value, a.push(t.setAttribute(o, u));\n }\n\n return a;\n }, e;\n }();\n }.call(this), function () {\n var t,\n r,\n n = function n(t, e) {\n function r() {\n this.constructor = t;\n }\n\n for (var n in e) {\n o.call(e, n) && (t[n] = e[n]);\n }\n\n return r.prototype = e.prototype, t.prototype = new r(), t.__super__ = e.prototype, t;\n },\n o = {}.hasOwnProperty;\n\n e.SnapshotRenderer = function (e) {\n function o(t, e, r) {\n this.currentSnapshot = t, this.newSnapshot = e, this.isPreview = r, this.currentHeadDetails = this.currentSnapshot.headDetails, this.newHeadDetails = this.newSnapshot.headDetails, this.currentBody = this.currentSnapshot.bodyElement, this.newBody = this.newSnapshot.bodyElement;\n }\n\n return n(o, e), o.prototype.render = function (t) {\n return this.shouldRender() ? (this.mergeHead(), this.renderView(function (e) {\n return function () {\n return e.replaceBody(), e.isPreview || e.focusFirstAutofocusableElement(), t();\n };\n }(this))) : this.invalidateView();\n }, o.prototype.mergeHead = function () {\n return this.copyNewHeadStylesheetElements(), this.copyNewHeadScriptElements(), this.removeCurrentHeadProvisionalElements(), this.copyNewHeadProvisionalElements();\n }, o.prototype.replaceBody = function () {\n var t;\n return t = this.relocateCurrentBodyPermanentElements(), this.activateNewBodyScriptElements(), this.assignNewBody(), this.replacePlaceholderElementsWithClonedPermanentElements(t);\n }, o.prototype.shouldRender = function () {\n return this.newSnapshot.isVisitable() && this.trackedElementsAreIdentical();\n }, o.prototype.trackedElementsAreIdentical = function () {\n return this.currentHeadDetails.getTrackedElementSignature() === this.newHeadDetails.getTrackedElementSignature();\n }, o.prototype.copyNewHeadStylesheetElements = function () {\n var t, e, r, n, o;\n\n for (n = this.getNewHeadStylesheetElements(), o = [], e = 0, r = n.length; r > e; e++) {\n t = n[e], o.push(document.head.appendChild(t));\n }\n\n return o;\n }, o.prototype.copyNewHeadScriptElements = function () {\n var t, e, r, n, o;\n\n for (n = this.getNewHeadScriptElements(), o = [], e = 0, r = n.length; r > e; e++) {\n t = n[e], o.push(document.head.appendChild(this.createScriptElement(t)));\n }\n\n return o;\n }, o.prototype.removeCurrentHeadProvisionalElements = function () {\n var t, e, r, n, o;\n\n for (n = this.getCurrentHeadProvisionalElements(), o = [], e = 0, r = n.length; r > e; e++) {\n t = n[e], o.push(document.head.removeChild(t));\n }\n\n return o;\n }, o.prototype.copyNewHeadProvisionalElements = function () {\n var t, e, r, n, o;\n\n for (n = this.getNewHeadProvisionalElements(), o = [], e = 0, r = n.length; r > e; e++) {\n t = n[e], o.push(document.head.appendChild(t));\n }\n\n return o;\n }, o.prototype.relocateCurrentBodyPermanentElements = function () {\n var e, n, o, i, s, a, u;\n\n for (a = this.getCurrentBodyPermanentElements(), u = [], e = 0, n = a.length; n > e; e++) {\n i = a[e], s = t(i), o = this.newSnapshot.getPermanentElementById(i.id), r(i, s.element), r(o, i), u.push(s);\n }\n\n return u;\n }, o.prototype.replacePlaceholderElementsWithClonedPermanentElements = function (t) {\n var e, n, o, i, s, a, u;\n\n for (u = [], o = 0, i = t.length; i > o; o++) {\n a = t[o], n = a.element, s = a.permanentElement, e = s.cloneNode(!0), u.push(r(n, e));\n }\n\n return u;\n }, o.prototype.activateNewBodyScriptElements = function () {\n var t, e, n, o, i, s;\n\n for (i = this.getNewBodyScriptElements(), s = [], e = 0, o = i.length; o > e; e++) {\n n = i[e], t = this.createScriptElement(n), s.push(r(n, t));\n }\n\n return s;\n }, o.prototype.assignNewBody = function () {\n return document.body = this.newBody;\n }, o.prototype.focusFirstAutofocusableElement = function () {\n var t;\n return null != (t = this.newSnapshot.findFirstAutofocusableElement()) ? t.focus() : void 0;\n }, o.prototype.getNewHeadStylesheetElements = function () {\n return this.newHeadDetails.getStylesheetElementsNotInDetails(this.currentHeadDetails);\n }, o.prototype.getNewHeadScriptElements = function () {\n return this.newHeadDetails.getScriptElementsNotInDetails(this.currentHeadDetails);\n }, o.prototype.getCurrentHeadProvisionalElements = function () {\n return this.currentHeadDetails.getProvisionalElements();\n }, o.prototype.getNewHeadProvisionalElements = function () {\n return this.newHeadDetails.getProvisionalElements();\n }, o.prototype.getCurrentBodyPermanentElements = function () {\n return this.currentSnapshot.getPermanentElementsPresentInSnapshot(this.newSnapshot);\n }, o.prototype.getNewBodyScriptElements = function () {\n return this.newBody.querySelectorAll(\"script\");\n }, o;\n }(e.Renderer), t = function t(_t5) {\n var e;\n return e = document.createElement(\"meta\"), e.setAttribute(\"name\", \"turbolinks-permanent-placeholder\"), e.setAttribute(\"content\", _t5.id), {\n element: e,\n permanentElement: _t5\n };\n }, r = function r(t, e) {\n var r;\n return (r = t.parentNode) ? r.replaceChild(e, t) : void 0;\n };\n }.call(this), function () {\n var t = function t(_t6, e) {\n function n() {\n this.constructor = _t6;\n }\n\n for (var o in e) {\n r.call(e, o) && (_t6[o] = e[o]);\n }\n\n return n.prototype = e.prototype, _t6.prototype = new n(), _t6.__super__ = e.prototype, _t6;\n },\n r = {}.hasOwnProperty;\n\n e.ErrorRenderer = function (e) {\n function r(t) {\n var e;\n e = document.createElement(\"html\"), e.innerHTML = t, this.newHead = e.querySelector(\"head\"), this.newBody = e.querySelector(\"body\");\n }\n\n return t(r, e), r.prototype.render = function (t) {\n return this.renderView(function (e) {\n return function () {\n return e.replaceHeadAndBody(), e.activateBodyScriptElements(), t();\n };\n }(this));\n }, r.prototype.replaceHeadAndBody = function () {\n var t, e;\n return e = document.head, t = document.body, e.parentNode.replaceChild(this.newHead, e), t.parentNode.replaceChild(this.newBody, t);\n }, r.prototype.activateBodyScriptElements = function () {\n var t, e, r, n, o, i;\n\n for (n = this.getScriptElements(), i = [], e = 0, r = n.length; r > e; e++) {\n o = n[e], t = this.createScriptElement(o), i.push(o.parentNode.replaceChild(t, o));\n }\n\n return i;\n }, r.prototype.getScriptElements = function () {\n return document.documentElement.querySelectorAll(\"script\");\n }, r;\n }(e.Renderer);\n }.call(this), function () {\n e.View = function () {\n function t(t) {\n this.delegate = t, this.htmlElement = document.documentElement;\n }\n\n return t.prototype.getRootLocation = function () {\n return this.getSnapshot().getRootLocation();\n }, t.prototype.getElementForAnchor = function (t) {\n return this.getSnapshot().getElementForAnchor(t);\n }, t.prototype.getSnapshot = function () {\n return e.Snapshot.fromHTMLElement(this.htmlElement);\n }, t.prototype.render = function (t, e) {\n var r, n, o;\n return o = t.snapshot, r = t.error, n = t.isPreview, this.markAsPreview(n), null != o ? this.renderSnapshot(o, n, e) : this.renderError(r, e);\n }, t.prototype.markAsPreview = function (t) {\n return t ? this.htmlElement.setAttribute(\"data-turbolinks-preview\", \"\") : this.htmlElement.removeAttribute(\"data-turbolinks-preview\");\n }, t.prototype.renderSnapshot = function (t, r, n) {\n return e.SnapshotRenderer.render(this.delegate, n, this.getSnapshot(), e.Snapshot.wrap(t), r);\n }, t.prototype.renderError = function (t, r) {\n return e.ErrorRenderer.render(this.delegate, r, t);\n }, t;\n }();\n }.call(this), function () {\n var t = function t(_t7, e) {\n return function () {\n return _t7.apply(e, arguments);\n };\n };\n\n e.ScrollManager = function () {\n function r(r) {\n this.delegate = r, this.onScroll = t(this.onScroll, this), this.onScroll = e.throttle(this.onScroll);\n }\n\n return r.prototype.start = function () {\n return this.started ? void 0 : (addEventListener(\"scroll\", this.onScroll, !1), this.onScroll(), this.started = !0);\n }, r.prototype.stop = function () {\n return this.started ? (removeEventListener(\"scroll\", this.onScroll, !1), this.started = !1) : void 0;\n }, r.prototype.scrollToElement = function (t) {\n return t.scrollIntoView();\n }, r.prototype.scrollToPosition = function (t) {\n var e, r;\n return e = t.x, r = t.y, window.scrollTo(e, r);\n }, r.prototype.onScroll = function (t) {\n return this.updatePosition({\n x: window.pageXOffset,\n y: window.pageYOffset\n });\n }, r.prototype.updatePosition = function (t) {\n var e;\n return this.position = t, null != (e = this.delegate) ? e.scrollPositionChanged(this.position) : void 0;\n }, r;\n }();\n }.call(this), function () {\n e.SnapshotCache = function () {\n function t(t) {\n this.size = t, this.keys = [], this.snapshots = {};\n }\n\n var r;\n return t.prototype.has = function (t) {\n var e;\n return e = r(t), e in this.snapshots;\n }, t.prototype.get = function (t) {\n var e;\n if (this.has(t)) return e = this.read(t), this.touch(t), e;\n }, t.prototype.put = function (t, e) {\n return this.write(t, e), this.touch(t), e;\n }, t.prototype.read = function (t) {\n var e;\n return e = r(t), this.snapshots[e];\n }, t.prototype.write = function (t, e) {\n var n;\n return n = r(t), this.snapshots[n] = e;\n }, t.prototype.touch = function (t) {\n var e, n;\n return n = r(t), e = this.keys.indexOf(n), e > -1 && this.keys.splice(e, 1), this.keys.unshift(n), this.trim();\n }, t.prototype.trim = function () {\n var t, e, r, n, o;\n\n for (n = this.keys.splice(this.size), o = [], t = 0, r = n.length; r > t; t++) {\n e = n[t], o.push(delete this.snapshots[e]);\n }\n\n return o;\n }, r = function r(t) {\n return e.Location.wrap(t).toCacheKey();\n }, t;\n }();\n }.call(this), function () {\n var t = function t(_t8, e) {\n return function () {\n return _t8.apply(e, arguments);\n };\n };\n\n e.Visit = function () {\n function r(r, n, o) {\n this.controller = r, this.action = o, this.performScroll = t(this.performScroll, this), this.identifier = e.uuid(), this.location = e.Location.wrap(n), this.adapter = this.controller.adapter, this.state = \"initialized\", this.timingMetrics = {};\n }\n\n var n;\n return r.prototype.start = function () {\n return \"initialized\" === this.state ? (this.recordTimingMetric(\"visitStart\"), this.state = \"started\", this.adapter.visitStarted(this)) : void 0;\n }, r.prototype.cancel = function () {\n var t;\n return \"started\" === this.state ? (null != (t = this.request) && t.cancel(), this.cancelRender(), this.state = \"canceled\") : void 0;\n }, r.prototype.complete = function () {\n var t;\n return \"started\" === this.state ? (this.recordTimingMetric(\"visitEnd\"), this.state = \"completed\", \"function\" == typeof (t = this.adapter).visitCompleted && t.visitCompleted(this), this.controller.visitCompleted(this)) : void 0;\n }, r.prototype.fail = function () {\n var t;\n return \"started\" === this.state ? (this.state = \"failed\", \"function\" == typeof (t = this.adapter).visitFailed ? t.visitFailed(this) : void 0) : void 0;\n }, r.prototype.changeHistory = function () {\n var t, e;\n return this.historyChanged ? void 0 : (t = this.location.isEqualTo(this.referrer) ? \"replace\" : this.action, e = n(t), this.controller[e](this.location, this.restorationIdentifier), this.historyChanged = !0);\n }, r.prototype.issueRequest = function () {\n return this.shouldIssueRequest() && null == this.request ? (this.progress = 0, this.request = new e.HttpRequest(this, this.location, this.referrer), this.request.send()) : void 0;\n }, r.prototype.getCachedSnapshot = function () {\n var t;\n return !(t = this.controller.getCachedSnapshotForLocation(this.location)) || null != this.location.anchor && !t.hasAnchor(this.location.anchor) || \"restore\" !== this.action && !t.isPreviewable() ? void 0 : t;\n }, r.prototype.hasCachedSnapshot = function () {\n return null != this.getCachedSnapshot();\n }, r.prototype.loadCachedSnapshot = function () {\n var t, e;\n return (e = this.getCachedSnapshot()) ? (t = this.shouldIssueRequest(), this.render(function () {\n var r;\n return this.cacheSnapshot(), this.controller.render({\n snapshot: e,\n isPreview: t\n }, this.performScroll), \"function\" == typeof (r = this.adapter).visitRendered && r.visitRendered(this), t ? void 0 : this.complete();\n })) : void 0;\n }, r.prototype.loadResponse = function () {\n return null != this.response ? this.render(function () {\n var t, e;\n return this.cacheSnapshot(), this.request.failed ? (this.controller.render({\n error: this.response\n }, this.performScroll), \"function\" == typeof (t = this.adapter).visitRendered && t.visitRendered(this), this.fail()) : (this.controller.render({\n snapshot: this.response\n }, this.performScroll), \"function\" == typeof (e = this.adapter).visitRendered && e.visitRendered(this), this.complete());\n }) : void 0;\n }, r.prototype.followRedirect = function () {\n return this.redirectedToLocation && !this.followedRedirect ? (this.location = this.redirectedToLocation, this.controller.replaceHistoryWithLocationAndRestorationIdentifier(this.redirectedToLocation, this.restorationIdentifier), this.followedRedirect = !0) : void 0;\n }, r.prototype.requestStarted = function () {\n var t;\n return this.recordTimingMetric(\"requestStart\"), \"function\" == typeof (t = this.adapter).visitRequestStarted ? t.visitRequestStarted(this) : void 0;\n }, r.prototype.requestProgressed = function (t) {\n var e;\n return this.progress = t, \"function\" == typeof (e = this.adapter).visitRequestProgressed ? e.visitRequestProgressed(this) : void 0;\n }, r.prototype.requestCompletedWithResponse = function (t, r) {\n return this.response = t, null != r && (this.redirectedToLocation = e.Location.wrap(r)), this.adapter.visitRequestCompleted(this);\n }, r.prototype.requestFailedWithStatusCode = function (t, e) {\n return this.response = e, this.adapter.visitRequestFailedWithStatusCode(this, t);\n }, r.prototype.requestFinished = function () {\n var t;\n return this.recordTimingMetric(\"requestEnd\"), \"function\" == typeof (t = this.adapter).visitRequestFinished ? t.visitRequestFinished(this) : void 0;\n }, r.prototype.performScroll = function () {\n return this.scrolled ? void 0 : (\"restore\" === this.action ? this.scrollToRestoredPosition() || this.scrollToTop() : this.scrollToAnchor() || this.scrollToTop(), this.scrolled = !0);\n }, r.prototype.scrollToRestoredPosition = function () {\n var t, e;\n return t = null != (e = this.restorationData) ? e.scrollPosition : void 0, null != t ? (this.controller.scrollToPosition(t), !0) : void 0;\n }, r.prototype.scrollToAnchor = function () {\n return null != this.location.anchor ? (this.controller.scrollToAnchor(this.location.anchor), !0) : void 0;\n }, r.prototype.scrollToTop = function () {\n return this.controller.scrollToPosition({\n x: 0,\n y: 0\n });\n }, r.prototype.recordTimingMetric = function (t) {\n var e;\n return null != (e = this.timingMetrics)[t] ? e[t] : e[t] = new Date().getTime();\n }, r.prototype.getTimingMetrics = function () {\n return e.copyObject(this.timingMetrics);\n }, n = function n(t) {\n switch (t) {\n case \"replace\":\n return \"replaceHistoryWithLocationAndRestorationIdentifier\";\n\n case \"advance\":\n case \"restore\":\n return \"pushHistoryWithLocationAndRestorationIdentifier\";\n }\n }, r.prototype.shouldIssueRequest = function () {\n return \"restore\" === this.action ? !this.hasCachedSnapshot() : !0;\n }, r.prototype.cacheSnapshot = function () {\n return this.snapshotCached ? void 0 : (this.controller.cacheSnapshot(), this.snapshotCached = !0);\n }, r.prototype.render = function (t) {\n return this.cancelRender(), this.frame = requestAnimationFrame(function (e) {\n return function () {\n return e.frame = null, t.call(e);\n };\n }(this));\n }, r.prototype.cancelRender = function () {\n return this.frame ? cancelAnimationFrame(this.frame) : void 0;\n }, r;\n }();\n }.call(this), function () {\n var t = function t(_t9, e) {\n return function () {\n return _t9.apply(e, arguments);\n };\n };\n\n e.Controller = function () {\n function r() {\n this.clickBubbled = t(this.clickBubbled, this), this.clickCaptured = t(this.clickCaptured, this), this.pageLoaded = t(this.pageLoaded, this), this.history = new e.History(this), this.view = new e.View(this), this.scrollManager = new e.ScrollManager(this), this.restorationData = {}, this.clearCache(), this.setProgressBarDelay(500);\n }\n\n return r.prototype.start = function () {\n return e.supported && !this.started ? (addEventListener(\"click\", this.clickCaptured, !0), addEventListener(\"DOMContentLoaded\", this.pageLoaded, !1), this.scrollManager.start(), this.startHistory(), this.started = !0, this.enabled = !0) : void 0;\n }, r.prototype.disable = function () {\n return this.enabled = !1;\n }, r.prototype.stop = function () {\n return this.started ? (removeEventListener(\"click\", this.clickCaptured, !0), removeEventListener(\"DOMContentLoaded\", this.pageLoaded, !1), this.scrollManager.stop(), this.stopHistory(), this.started = !1) : void 0;\n }, r.prototype.clearCache = function () {\n return this.cache = new e.SnapshotCache(10);\n }, r.prototype.visit = function (t, r) {\n var n, o;\n return null == r && (r = {}), t = e.Location.wrap(t), this.applicationAllowsVisitingLocation(t) ? this.locationIsVisitable(t) ? (n = null != (o = r.action) ? o : \"advance\", this.adapter.visitProposedToLocationWithAction(t, n)) : window.location = t : void 0;\n }, r.prototype.startVisitToLocationWithAction = function (t, r, n) {\n var o;\n return e.supported ? (o = this.getRestorationDataForIdentifier(n), this.startVisit(t, r, {\n restorationData: o\n })) : window.location = t;\n }, r.prototype.setProgressBarDelay = function (t) {\n return this.progressBarDelay = t;\n }, r.prototype.startHistory = function () {\n return this.location = e.Location.wrap(window.location), this.restorationIdentifier = e.uuid(), this.history.start(), this.history.replace(this.location, this.restorationIdentifier);\n }, r.prototype.stopHistory = function () {\n return this.history.stop();\n }, r.prototype.pushHistoryWithLocationAndRestorationIdentifier = function (t, r) {\n return this.restorationIdentifier = r, this.location = e.Location.wrap(t), this.history.push(this.location, this.restorationIdentifier);\n }, r.prototype.replaceHistoryWithLocationAndRestorationIdentifier = function (t, r) {\n return this.restorationIdentifier = r, this.location = e.Location.wrap(t), this.history.replace(this.location, this.restorationIdentifier);\n }, r.prototype.historyPoppedToLocationWithRestorationIdentifier = function (t, r) {\n var n;\n return this.restorationIdentifier = r, this.enabled ? (n = this.getRestorationDataForIdentifier(this.restorationIdentifier), this.startVisit(t, \"restore\", {\n restorationIdentifier: this.restorationIdentifier,\n restorationData: n,\n historyChanged: !0\n }), this.location = e.Location.wrap(t)) : this.adapter.pageInvalidated();\n }, r.prototype.getCachedSnapshotForLocation = function (t) {\n var e;\n return null != (e = this.cache.get(t)) ? e.clone() : void 0;\n }, r.prototype.shouldCacheSnapshot = function () {\n return this.view.getSnapshot().isCacheable();\n }, r.prototype.cacheSnapshot = function () {\n var t, r;\n return this.shouldCacheSnapshot() ? (this.notifyApplicationBeforeCachingSnapshot(), r = this.view.getSnapshot(), t = this.lastRenderedLocation, e.defer(function (e) {\n return function () {\n return e.cache.put(t, r.clone());\n };\n }(this))) : void 0;\n }, r.prototype.scrollToAnchor = function (t) {\n var e;\n return (e = this.view.getElementForAnchor(t)) ? this.scrollToElement(e) : this.scrollToPosition({\n x: 0,\n y: 0\n });\n }, r.prototype.scrollToElement = function (t) {\n return this.scrollManager.scrollToElement(t);\n }, r.prototype.scrollToPosition = function (t) {\n return this.scrollManager.scrollToPosition(t);\n }, r.prototype.scrollPositionChanged = function (t) {\n var e;\n return e = this.getCurrentRestorationData(), e.scrollPosition = t;\n }, r.prototype.render = function (t, e) {\n return this.view.render(t, e);\n }, r.prototype.viewInvalidated = function () {\n return this.adapter.pageInvalidated();\n }, r.prototype.viewWillRender = function (t) {\n return this.notifyApplicationBeforeRender(t);\n }, r.prototype.viewRendered = function () {\n return this.lastRenderedLocation = this.currentVisit.location, this.notifyApplicationAfterRender();\n }, r.prototype.pageLoaded = function () {\n return this.lastRenderedLocation = this.location, this.notifyApplicationAfterPageLoad();\n }, r.prototype.clickCaptured = function () {\n return removeEventListener(\"click\", this.clickBubbled, !1), addEventListener(\"click\", this.clickBubbled, !1);\n }, r.prototype.clickBubbled = function (t) {\n var e, r, n;\n return this.enabled && this.clickEventIsSignificant(t) && (r = this.getVisitableLinkForNode(t.target)) && (n = this.getVisitableLocationForLink(r)) && this.applicationAllowsFollowingLinkToLocation(r, n) ? (t.preventDefault(), e = this.getActionForLink(r), this.visit(n, {\n action: e\n })) : void 0;\n }, r.prototype.applicationAllowsFollowingLinkToLocation = function (t, e) {\n var r;\n return r = this.notifyApplicationAfterClickingLinkToLocation(t, e), !r.defaultPrevented;\n }, r.prototype.applicationAllowsVisitingLocation = function (t) {\n var e;\n return e = this.notifyApplicationBeforeVisitingLocation(t), !e.defaultPrevented;\n }, r.prototype.notifyApplicationAfterClickingLinkToLocation = function (t, r) {\n return e.dispatch(\"turbolinks:click\", {\n target: t,\n data: {\n url: r.absoluteURL\n },\n cancelable: !0\n });\n }, r.prototype.notifyApplicationBeforeVisitingLocation = function (t) {\n return e.dispatch(\"turbolinks:before-visit\", {\n data: {\n url: t.absoluteURL\n },\n cancelable: !0\n });\n }, r.prototype.notifyApplicationAfterVisitingLocation = function (t) {\n return e.dispatch(\"turbolinks:visit\", {\n data: {\n url: t.absoluteURL\n }\n });\n }, r.prototype.notifyApplicationBeforeCachingSnapshot = function () {\n return e.dispatch(\"turbolinks:before-cache\");\n }, r.prototype.notifyApplicationBeforeRender = function (t) {\n return e.dispatch(\"turbolinks:before-render\", {\n data: {\n newBody: t\n }\n });\n }, r.prototype.notifyApplicationAfterRender = function () {\n return e.dispatch(\"turbolinks:render\");\n }, r.prototype.notifyApplicationAfterPageLoad = function (t) {\n return null == t && (t = {}), e.dispatch(\"turbolinks:load\", {\n data: {\n url: this.location.absoluteURL,\n timing: t\n }\n });\n }, r.prototype.startVisit = function (t, e, r) {\n var n;\n return null != (n = this.currentVisit) && n.cancel(), this.currentVisit = this.createVisit(t, e, r), this.currentVisit.start(), this.notifyApplicationAfterVisitingLocation(t);\n }, r.prototype.createVisit = function (t, r, n) {\n var o, i, s, a, u;\n return i = null != n ? n : {}, a = i.restorationIdentifier, s = i.restorationData, o = i.historyChanged, u = new e.Visit(this, t, r), u.restorationIdentifier = null != a ? a : e.uuid(), u.restorationData = e.copyObject(s), u.historyChanged = o, u.referrer = this.location, u;\n }, r.prototype.visitCompleted = function (t) {\n return this.notifyApplicationAfterPageLoad(t.getTimingMetrics());\n }, r.prototype.clickEventIsSignificant = function (t) {\n return !(t.defaultPrevented || t.target.isContentEditable || t.which > 1 || t.altKey || t.ctrlKey || t.metaKey || t.shiftKey);\n }, r.prototype.getVisitableLinkForNode = function (t) {\n return this.nodeIsVisitable(t) ? e.closest(t, \"a[href]:not([target]):not([download])\") : void 0;\n }, r.prototype.getVisitableLocationForLink = function (t) {\n var r;\n return r = new e.Location(t.getAttribute(\"href\")), this.locationIsVisitable(r) ? r : void 0;\n }, r.prototype.getActionForLink = function (t) {\n var e;\n return null != (e = t.getAttribute(\"data-turbolinks-action\")) ? e : \"advance\";\n }, r.prototype.nodeIsVisitable = function (t) {\n var r;\n return (r = e.closest(t, \"[data-turbolinks]\")) ? \"false\" !== r.getAttribute(\"data-turbolinks\") : !0;\n }, r.prototype.locationIsVisitable = function (t) {\n return t.isPrefixedBy(this.view.getRootLocation()) && t.isHTML();\n }, r.prototype.getCurrentRestorationData = function () {\n return this.getRestorationDataForIdentifier(this.restorationIdentifier);\n }, r.prototype.getRestorationDataForIdentifier = function (t) {\n var e;\n return null != (e = this.restorationData)[t] ? e[t] : e[t] = {};\n }, r;\n }();\n }.call(this), function () {\n !function () {\n var t, e;\n if ((t = e = document.currentScript) && !e.hasAttribute(\"data-turbolinks-suppress-warning\")) for (; t = t.parentNode;) {\n if (t === document.body) return console.warn(\"You are loading Turbolinks from a