{"version":3,"file":"js/application-110da23303b26ff888f7.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/cocoon/app/assets/javascripts/cocoon.js","webpack:///./node_modules/jquery-ui-dist/jquery-ui.js","webpack:///./node_modules/jquery/dist/jquery.js","webpack:///./node_modules/jquery/external/sizzle/dist/sizzle.js","webpack:///./node_modules/jquery/src/ajax.js","webpack:///./node_modules/jquery/src/ajax/jsonp.js","webpack:///./node_modules/jquery/src/ajax/load.js","webpack:///./node_modules/jquery/src/ajax/script.js","webpack:///./node_modules/jquery/src/ajax/var/location.js","webpack:///./node_modules/jquery/src/ajax/var/nonce.js","webpack:///./node_modules/jquery/src/ajax/var/rquery.js","webpack:///./node_modules/jquery/src/ajax/xhr.js","webpack:///./node_modules/jquery/src/attributes.js","webpack:///./node_modules/jquery/src/attributes/attr.js","webpack:///./node_modules/jquery/src/attributes/classes.js","webpack:///./node_modules/jquery/src/attributes/prop.js","webpack:///./node_modules/jquery/src/attributes/support.js","webpack:///./node_modules/jquery/src/attributes/val.js","webpack:///./node_modules/jquery/src/callbacks.js","webpack:///./node_modules/jquery/src/core.js","webpack:///./node_modules/jquery/src/core/DOMEval.js","webpack:///./node_modules/jquery/src/core/access.js","webpack:///./node_modules/jquery/src/core/camelCase.js","webpack:///./node_modules/jquery/src/core/init.js","webpack:///./node_modules/jquery/src/core/isAttached.js","webpack:///./node_modules/jquery/src/core/nodeName.js","webpack:///./node_modules/jquery/src/core/parseHTML.js","webpack:///./node_modules/jquery/src/core/parseXML.js","webpack:///./node_modules/jquery/src/core/ready.js","webpack:///./node_modules/jquery/src/core/readyException.js","webpack:///./node_modules/jquery/src/core/stripAndCollapse.js","webpack:///./node_modules/jquery/src/core/support.js","webpack:///./node_modules/jquery/src/core/toType.js","webpack:///./node_modules/jquery/src/core/var/rsingleTag.js","webpack:///./node_modules/jquery/src/css.js","webpack:///./node_modules/jquery/src/css/addGetHookIf.js","webpack:///./node_modules/jquery/src/css/adjustCSS.js","webpack:///./node_modules/jquery/src/css/curCSS.js","webpack:///./node_modules/jquery/src/css/finalPropName.js","webpack:///./node_modules/jquery/src/css/hiddenVisibleSelectors.js","webpack:///./node_modules/jquery/src/css/showHide.js","webpack:///./node_modules/jquery/src/css/support.js","webpack:///./node_modules/jquery/src/css/var/cssExpand.js","webpack:///./node_modules/jquery/src/css/var/getStyles.js","webpack:///./node_modules/jquery/src/css/var/isHiddenWithinTree.js","webpack:///./node_modules/jquery/src/css/var/rboxStyle.js","webpack:///./node_modules/jquery/src/css/var/rnumnonpx.js","webpack:///./node_modules/jquery/src/css/var/swap.js","webpack:///./node_modules/jquery/src/data.js","webpack:///./node_modules/jquery/src/data/Data.js","webpack:///./node_modules/jquery/src/data/var/acceptData.js","webpack:///./node_modules/jquery/src/data/var/dataPriv.js","webpack:///./node_modules/jquery/src/data/var/dataUser.js","webpack:///./node_modules/jquery/src/deferred.js","webpack:///./node_modules/jquery/src/deferred/exceptionHook.js","webpack:///./node_modules/jquery/src/deprecated.js","webpack:///./node_modules/jquery/src/deprecated/ajax-event-alias.js","webpack:///./node_modules/jquery/src/deprecated/event.js","webpack:///./node_modules/jquery/src/dimensions.js","webpack:///./node_modules/jquery/src/effects.js","webpack:///./node_modules/jquery/src/effects/Tween.js","webpack:///./node_modules/jquery/src/effects/animatedSelector.js","webpack:///./node_modules/jquery/src/event.js","webpack:///./node_modules/jquery/src/event/focusin.js","webpack:///./node_modules/jquery/src/event/support.js","webpack:///./node_modules/jquery/src/event/trigger.js","webpack:///./node_modules/jquery/src/exports/amd.js","webpack:///./node_modules/jquery/src/exports/global.js","webpack:///./node_modules/jquery/src/jquery.js","webpack:///./node_modules/jquery/src/manipulation.js","webpack:///./node_modules/jquery/src/manipulation/_evalUrl.js","webpack:///./node_modules/jquery/src/manipulation/buildFragment.js","webpack:///./node_modules/jquery/src/manipulation/getAll.js","webpack:///./node_modules/jquery/src/manipulation/setGlobalEval.js","webpack:///./node_modules/jquery/src/manipulation/support.js","webpack:///./node_modules/jquery/src/manipulation/var/rscriptType.js","webpack:///./node_modules/jquery/src/manipulation/var/rtagName.js","webpack:///./node_modules/jquery/src/manipulation/wrapMap.js","webpack:///./node_modules/jquery/src/offset.js","webpack:///./node_modules/jquery/src/queue.js","webpack:///./node_modules/jquery/src/queue/delay.js","webpack:///./node_modules/jquery/src/selector-sizzle.js","webpack:///./node_modules/jquery/src/selector.js","webpack:///./node_modules/jquery/src/serialize.js","webpack:///./node_modules/jquery/src/traversing.js","webpack:///./node_modules/jquery/src/traversing/findFilter.js","webpack:///./node_modules/jquery/src/traversing/var/dir.js","webpack:///./node_modules/jquery/src/traversing/var/rneedsContext.js","webpack:///./node_modules/jquery/src/traversing/var/siblings.js","webpack:///./node_modules/jquery/src/var/ObjectFunctionString.js","webpack:///./node_modules/jquery/src/var/arr.js","webpack:///./node_modules/jquery/src/var/class2type.js","webpack:///./node_modules/jquery/src/var/document.js","webpack:///./node_modules/jquery/src/var/documentElement.js","webpack:///./node_modules/jquery/src/var/flat.js","webpack:///./node_modules/jquery/src/var/fnToString.js","webpack:///./node_modules/jquery/src/var/getProto.js","webpack:///./node_modules/jquery/src/var/hasOwn.js","webpack:///./node_modules/jquery/src/var/indexOf.js","webpack:///./node_modules/jquery/src/var/isFunction.js","webpack:///./node_modules/jquery/src/var/isWindow.js","webpack:///./node_modules/jquery/src/var/pnum.js","webpack:///./node_modules/jquery/src/var/push.js","webpack:///./node_modules/jquery/src/var/rcheckableType.js","webpack:///./node_modules/jquery/src/var/rcssNum.js","webpack:///./node_modules/jquery/src/var/rnothtmlwhite.js","webpack:///./node_modules/jquery/src/var/slice.js","webpack:///./node_modules/jquery/src/var/support.js","webpack:///./node_modules/jquery/src/var/toString.js","webpack:///./node_modules/jquery/src/wrap.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","require(\"@rails/ujs\").start()\nrequire(\"turbolinks\").start()\nrequire(\"@rails/activestorage\").start()\nrequire(\"channels\")\nrequire('jquery')\nrequire( \"jquery-ui-dist/jquery-ui\")\n\nimport \"cocoon\";\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\n","function _typeof(obj) { \"@babel/helpers - typeof\"; 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 || \"application/octet-stream\",\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) { \"@babel/helpers - typeof\"; 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;\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 (matches(input, '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 ($) {\n var cocoon_element_counter = 0;\n\n var create_new_id = function create_new_id() {\n return new Date().getTime() + cocoon_element_counter++;\n };\n\n var newcontent_braced = function newcontent_braced(id) {\n return '[' + id + ']$1';\n };\n\n var newcontent_underscord = function newcontent_underscord(id) {\n return '_' + id + '_$1';\n };\n\n var getInsertionNodeElem = function getInsertionNodeElem(insertionNode, insertionTraversal, $this) {\n if (!insertionNode) {\n return $this.parent();\n }\n\n if (typeof insertionNode == 'function') {\n if (insertionTraversal) {\n console.warn('association-insertion-traversal is ignored, because association-insertion-node is given as a function.');\n }\n\n return insertionNode($this);\n }\n\n if (typeof insertionNode == 'string') {\n if (insertionTraversal) {\n return $this[insertionTraversal](insertionNode);\n } else {\n return insertionNode == \"this\" ? $this : $(insertionNode);\n }\n }\n };\n\n $(document).on('click', '.add_fields', function (e) {\n e.preventDefault();\n var $this = $(this),\n assoc = $this.data('association'),\n assocs = $this.data('associations'),\n content = $this.data('association-insertion-template'),\n insertionMethod = $this.data('association-insertion-method') || $this.data('association-insertion-position') || 'before',\n insertionNode = $this.data('association-insertion-node'),\n insertionTraversal = $this.data('association-insertion-traversal'),\n count = parseInt($this.data('count'), 10),\n regexp_braced = new RegExp('\\\\[new_' + assoc + '\\\\](.*?\\\\s)', 'g'),\n regexp_underscord = new RegExp('_new_' + assoc + '_(\\\\w*)', 'g'),\n new_id = create_new_id(),\n new_content = content.replace(regexp_braced, newcontent_braced(new_id)),\n new_contents = [];\n\n if (new_content == content) {\n regexp_braced = new RegExp('\\\\[new_' + assocs + '\\\\](.*?\\\\s)', 'g');\n regexp_underscord = new RegExp('_new_' + assocs + '_(\\\\w*)', 'g');\n new_content = content.replace(regexp_braced, newcontent_braced(new_id));\n }\n\n new_content = new_content.replace(regexp_underscord, newcontent_underscord(new_id));\n new_contents = [new_content];\n count = isNaN(count) ? 1 : Math.max(count, 1);\n count -= 1;\n\n while (count) {\n new_id = create_new_id();\n new_content = content.replace(regexp_braced, newcontent_braced(new_id));\n new_content = new_content.replace(regexp_underscord, newcontent_underscord(new_id));\n new_contents.push(new_content);\n count -= 1;\n }\n\n var insertionNodeElem = getInsertionNodeElem(insertionNode, insertionTraversal, $this);\n\n if (!insertionNodeElem || insertionNodeElem.length == 0) {\n console.warn(\"Couldn't find the element to insert the template. Make sure your `data-association-insertion-*` on `link_to_add_association` is correct.\");\n }\n\n $.each(new_contents, function (i, node) {\n var contentNode = $(node);\n insertionNodeElem.trigger('cocoon:before-insert', [contentNode]); // allow any of the jquery dom manipulation methods (after, before, append, prepend, etc)\n // to be called on the node. allows the insertion node to be the parent of the inserted\n // code and doesn't force it to be a sibling like after/before does. default: 'before'\n\n var addedContent = insertionNodeElem[insertionMethod](contentNode);\n insertionNodeElem.trigger('cocoon:after-insert', [contentNode]);\n });\n });\n $(document).on('click', '.remove_fields.dynamic, .remove_fields.existing', function (e) {\n var $this = $(this),\n wrapper_class = $this.data('wrapper-class') || 'nested-fields',\n node_to_delete = $this.closest('.' + wrapper_class),\n trigger_node = node_to_delete.parent();\n e.preventDefault();\n trigger_node.trigger('cocoon:before-remove', [node_to_delete]);\n var timeout = trigger_node.data('remove-timeout') || 0;\n setTimeout(function () {\n if ($this.hasClass('dynamic')) {\n node_to_delete.remove();\n } else {\n $this.prev(\"input[type=hidden]\").val(\"1\");\n node_to_delete.hide();\n }\n\n trigger_node.trigger('cocoon:after-remove', [node_to_delete]);\n }, timeout);\n });\n $(document).on(\"ready page:load turbolinks:load\", function () {\n $('.remove_fields.existing.destroyed').each(function (i, obj) {\n var $this = $(this),\n wrapper_class = $this.data('wrapper-class') || 'nested-fields';\n $this.closest('.' + wrapper_class).hide();\n });\n });\n})(jQuery);","function _typeof(obj) { \"@babel/helpers - typeof\"; 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/*! jQuery UI - v1.12.1 - 2016-09-14\n* http://jqueryui.com\n* Includes: widget.js, position.js, data.js, disable-selection.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js, focusable.js, form-reset-mixin.js, jquery-1-7.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/draggable.js, widgets/droppable.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/resizable.js, widgets/selectable.js, widgets/selectmenu.js, widgets/slider.js, widgets/sortable.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.js\n* Copyright jQuery Foundation and other contributors; Licensed MIT */\n(function (factory) {\n if (typeof define === \"function\" && define.amd) {\n // AMD. Register as an anonymous module.\n define([\"jquery\"], factory);\n } else {\n // Browser globals\n factory(jQuery);\n }\n})(function ($) {\n $.ui = $.ui || {};\n var version = $.ui.version = \"1.12.1\";\n /*!\n * jQuery UI Widget 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Widget\n //>>group: Core\n //>>description: Provides a factory for creating stateful widgets with a common API.\n //>>docs: http://api.jqueryui.com/jQuery.widget/\n //>>demos: http://jqueryui.com/widget/\n\n var widgetUuid = 0;\n var widgetSlice = Array.prototype.slice;\n\n $.cleanData = function (orig) {\n return function (elems) {\n var events, elem, i;\n\n for (i = 0; (elem = elems[i]) != null; i++) {\n try {\n // Only trigger remove when necessary to save time\n events = $._data(elem, \"events\");\n\n if (events && events.remove) {\n $(elem).triggerHandler(\"remove\");\n } // Http://bugs.jquery.com/ticket/8235\n\n } catch (e) {}\n }\n\n orig(elems);\n };\n }($.cleanData);\n\n $.widget = function (name, base, prototype) {\n var existingConstructor, constructor, basePrototype; // ProxiedPrototype allows the provided prototype to remain unmodified\n // so that it can be used as a mixin for multiple widgets (#8876)\n\n var proxiedPrototype = {};\n var namespace = name.split(\".\")[0];\n name = name.split(\".\")[1];\n var fullName = namespace + \"-\" + name;\n\n if (!prototype) {\n prototype = base;\n base = $.Widget;\n }\n\n if ($.isArray(prototype)) {\n prototype = $.extend.apply(null, [{}].concat(prototype));\n } // Create selector for plugin\n\n\n $.expr[\":\"][fullName.toLowerCase()] = function (elem) {\n return !!$.data(elem, fullName);\n };\n\n $[namespace] = $[namespace] || {};\n existingConstructor = $[namespace][name];\n\n constructor = $[namespace][name] = function (options, element) {\n // Allow instantiation without \"new\" keyword\n if (!this._createWidget) {\n return new constructor(options, element);\n } // Allow instantiation without initializing for simple inheritance\n // must use \"new\" keyword (the code above always passes args)\n\n\n if (arguments.length) {\n this._createWidget(options, element);\n }\n }; // Extend with the existing constructor to carry over any static properties\n\n\n $.extend(constructor, existingConstructor, {\n version: prototype.version,\n // Copy the object used to create the prototype in case we need to\n // redefine the widget later\n _proto: $.extend({}, prototype),\n // Track widgets that inherit from this widget in case this widget is\n // redefined after a widget inherits from it\n _childConstructors: []\n });\n basePrototype = new base(); // We need to make the options hash a property directly on the new instance\n // otherwise we'll modify the options hash on the prototype that we're\n // inheriting from\n\n basePrototype.options = $.widget.extend({}, basePrototype.options);\n $.each(prototype, function (prop, value) {\n if (!$.isFunction(value)) {\n proxiedPrototype[prop] = value;\n return;\n }\n\n proxiedPrototype[prop] = function () {\n function _super() {\n return base.prototype[prop].apply(this, arguments);\n }\n\n function _superApply(args) {\n return base.prototype[prop].apply(this, args);\n }\n\n return function () {\n var __super = this._super;\n var __superApply = this._superApply;\n var returnValue;\n this._super = _super;\n this._superApply = _superApply;\n returnValue = value.apply(this, arguments);\n this._super = __super;\n this._superApply = __superApply;\n return returnValue;\n };\n }();\n });\n constructor.prototype = $.widget.extend(basePrototype, {\n // TODO: remove support for widgetEventPrefix\n // always use the name + a colon as the prefix, e.g., draggable:start\n // don't prefix for widgets that aren't DOM-based\n widgetEventPrefix: existingConstructor ? basePrototype.widgetEventPrefix || name : name\n }, proxiedPrototype, {\n constructor: constructor,\n namespace: namespace,\n widgetName: name,\n widgetFullName: fullName\n }); // If this widget is being redefined then we need to find all widgets that\n // are inheriting from it and redefine all of them so that they inherit from\n // the new version of this widget. We're essentially trying to replace one\n // level in the prototype chain.\n\n if (existingConstructor) {\n $.each(existingConstructor._childConstructors, function (i, child) {\n var childPrototype = child.prototype; // Redefine the child widget using the same prototype that was\n // originally used, but inherit from the new version of the base\n\n $.widget(childPrototype.namespace + \".\" + childPrototype.widgetName, constructor, child._proto);\n }); // Remove the list of existing child constructors from the old constructor\n // so the old child constructors can be garbage collected\n\n delete existingConstructor._childConstructors;\n } else {\n base._childConstructors.push(constructor);\n }\n\n $.widget.bridge(name, constructor);\n return constructor;\n };\n\n $.widget.extend = function (target) {\n var input = widgetSlice.call(arguments, 1);\n var inputIndex = 0;\n var inputLength = input.length;\n var key;\n var value;\n\n for (; inputIndex < inputLength; inputIndex++) {\n for (key in input[inputIndex]) {\n value = input[inputIndex][key];\n\n if (input[inputIndex].hasOwnProperty(key) && value !== undefined) {\n // Clone objects\n if ($.isPlainObject(value)) {\n target[key] = $.isPlainObject(target[key]) ? $.widget.extend({}, target[key], value) : // Don't extend strings, arrays, etc. with objects\n $.widget.extend({}, value); // Copy everything else by reference\n } else {\n target[key] = value;\n }\n }\n }\n }\n\n return target;\n };\n\n $.widget.bridge = function (name, object) {\n var fullName = object.prototype.widgetFullName || name;\n\n $.fn[name] = function (options) {\n var isMethodCall = typeof options === \"string\";\n var args = widgetSlice.call(arguments, 1);\n var returnValue = this;\n\n if (isMethodCall) {\n // If this is an empty collection, we need to have the instance method\n // return undefined instead of the jQuery instance\n if (!this.length && options === \"instance\") {\n returnValue = undefined;\n } else {\n this.each(function () {\n var methodValue;\n var instance = $.data(this, fullName);\n\n if (options === \"instance\") {\n returnValue = instance;\n return false;\n }\n\n if (!instance) {\n return $.error(\"cannot call methods on \" + name + \" prior to initialization; \" + \"attempted to call method '\" + options + \"'\");\n }\n\n if (!$.isFunction(instance[options]) || options.charAt(0) === \"_\") {\n return $.error(\"no such method '\" + options + \"' for \" + name + \" widget instance\");\n }\n\n methodValue = instance[options].apply(instance, args);\n\n if (methodValue !== instance && methodValue !== undefined) {\n returnValue = methodValue && methodValue.jquery ? returnValue.pushStack(methodValue.get()) : methodValue;\n return false;\n }\n });\n }\n } else {\n // Allow multiple hashes to be passed on init\n if (args.length) {\n options = $.widget.extend.apply(null, [options].concat(args));\n }\n\n this.each(function () {\n var instance = $.data(this, fullName);\n\n if (instance) {\n instance.option(options || {});\n\n if (instance._init) {\n instance._init();\n }\n } else {\n $.data(this, fullName, new object(options, this));\n }\n });\n }\n\n return returnValue;\n };\n };\n\n $.Widget = function ()\n /* options, element */\n {};\n\n $.Widget._childConstructors = [];\n $.Widget.prototype = {\n widgetName: \"widget\",\n widgetEventPrefix: \"\",\n defaultElement: \"
\")[0],\n // Colors = jQuery.Color.names\n colors,\n // Local aliases of functions called often\n each = jQuery.each; // Determine rgba support immediately\n\n\n supportElem.style.cssText = \"background-color:rgba(1,1,1,.5)\";\n support.rgba = supportElem.style.backgroundColor.indexOf(\"rgba\") > -1; // Define cache name and alpha properties\n // for rgba and hsla spaces\n\n each(spaces, function (spaceName, space) {\n space.cache = \"_\" + spaceName;\n space.props.alpha = {\n idx: 3,\n type: \"percent\",\n def: 1\n };\n });\n\n function clamp(value, prop, allowEmpty) {\n var type = propTypes[prop.type] || {};\n\n if (value == null) {\n return allowEmpty || !prop.def ? null : prop.def;\n } // ~~ is an short way of doing floor for positive numbers\n\n\n value = type.floor ? ~~value : parseFloat(value); // IE will pass in empty strings as value for alpha,\n // which will hit this case\n\n if (isNaN(value)) {\n return prop.def;\n }\n\n if (type.mod) {\n // We add mod before modding to make sure that negatives values\n // get converted properly: -10 -> 350\n return (value + type.mod) % type.mod;\n } // For now all property types without mod have min and max\n\n\n return 0 > value ? 0 : type.max < value ? type.max : value;\n }\n\n function stringParse(string) {\n var inst = color(),\n rgba = inst._rgba = [];\n string = string.toLowerCase();\n each(stringParsers, function (i, parser) {\n var parsed,\n match = parser.re.exec(string),\n values = match && parser.parse(match),\n spaceName = parser.space || \"rgba\";\n\n if (values) {\n parsed = inst[spaceName](values); // If this was an rgba parse the assignment might happen twice\n // oh well....\n\n inst[spaces[spaceName].cache] = parsed[spaces[spaceName].cache];\n rgba = inst._rgba = parsed._rgba; // Exit each( stringParsers ) here because we matched\n\n return false;\n }\n }); // Found a stringParser that handled it\n\n if (rgba.length) {\n // If this came from a parsed string, force \"transparent\" when alpha is 0\n // chrome, (and maybe others) return \"transparent\" as rgba(0,0,0,0)\n if (rgba.join() === \"0,0,0,0\") {\n jQuery.extend(rgba, colors.transparent);\n }\n\n return inst;\n } // Named colors\n\n\n return colors[string];\n }\n\n color.fn = jQuery.extend(color.prototype, {\n parse: function parse(red, green, blue, alpha) {\n if (red === undefined) {\n this._rgba = [null, null, null, null];\n return this;\n }\n\n if (red.jquery || red.nodeType) {\n red = jQuery(red).css(green);\n green = undefined;\n }\n\n var inst = this,\n type = jQuery.type(red),\n rgba = this._rgba = []; // More than 1 argument specified - assume ( red, green, blue, alpha )\n\n if (green !== undefined) {\n red = [red, green, blue, alpha];\n type = \"array\";\n }\n\n if (type === \"string\") {\n return this.parse(stringParse(red) || colors._default);\n }\n\n if (type === \"array\") {\n each(spaces.rgba.props, function (key, prop) {\n rgba[prop.idx] = clamp(red[prop.idx], prop);\n });\n return this;\n }\n\n if (type === \"object\") {\n if (red instanceof color) {\n each(spaces, function (spaceName, space) {\n if (red[space.cache]) {\n inst[space.cache] = red[space.cache].slice();\n }\n });\n } else {\n each(spaces, function (spaceName, space) {\n var cache = space.cache;\n each(space.props, function (key, prop) {\n // If the cache doesn't exist, and we know how to convert\n if (!inst[cache] && space.to) {\n // If the value was null, we don't need to copy it\n // if the key was alpha, we don't need to copy it either\n if (key === \"alpha\" || red[key] == null) {\n return;\n }\n\n inst[cache] = space.to(inst._rgba);\n } // This is the only case where we allow nulls for ALL properties.\n // call clamp with alwaysAllowEmpty\n\n\n inst[cache][prop.idx] = clamp(red[key], prop, true);\n }); // Everything defined but alpha?\n\n if (inst[cache] && jQuery.inArray(null, inst[cache].slice(0, 3)) < 0) {\n // Use the default of 1\n inst[cache][3] = 1;\n\n if (space.from) {\n inst._rgba = space.from(inst[cache]);\n }\n }\n });\n }\n\n return this;\n }\n },\n is: function is(compare) {\n var is = color(compare),\n same = true,\n inst = this;\n each(spaces, function (_, space) {\n var localCache,\n isCache = is[space.cache];\n\n if (isCache) {\n localCache = inst[space.cache] || space.to && space.to(inst._rgba) || [];\n each(space.props, function (_, prop) {\n if (isCache[prop.idx] != null) {\n same = isCache[prop.idx] === localCache[prop.idx];\n return same;\n }\n });\n }\n\n return same;\n });\n return same;\n },\n _space: function _space() {\n var used = [],\n inst = this;\n each(spaces, function (spaceName, space) {\n if (inst[space.cache]) {\n used.push(spaceName);\n }\n });\n return used.pop();\n },\n transition: function transition(other, distance) {\n var end = color(other),\n spaceName = end._space(),\n space = spaces[spaceName],\n startColor = this.alpha() === 0 ? color(\"transparent\") : this,\n start = startColor[space.cache] || space.to(startColor._rgba),\n result = start.slice();\n\n end = end[space.cache];\n each(space.props, function (key, prop) {\n var index = prop.idx,\n startValue = start[index],\n endValue = end[index],\n type = propTypes[prop.type] || {}; // If null, don't override start value\n\n if (endValue === null) {\n return;\n } // If null - use end\n\n\n if (startValue === null) {\n result[index] = endValue;\n } else {\n if (type.mod) {\n if (endValue - startValue > type.mod / 2) {\n startValue += type.mod;\n } else if (startValue - endValue > type.mod / 2) {\n startValue -= type.mod;\n }\n }\n\n result[index] = clamp((endValue - startValue) * distance + startValue, prop);\n }\n });\n return this[spaceName](result);\n },\n blend: function blend(opaque) {\n // If we are already opaque - return ourself\n if (this._rgba[3] === 1) {\n return this;\n }\n\n var rgb = this._rgba.slice(),\n a = rgb.pop(),\n blend = color(opaque)._rgba;\n\n return color(jQuery.map(rgb, function (v, i) {\n return (1 - a) * blend[i] + a * v;\n }));\n },\n toRgbaString: function toRgbaString() {\n var prefix = \"rgba(\",\n rgba = jQuery.map(this._rgba, function (v, i) {\n return v == null ? i > 2 ? 1 : 0 : v;\n });\n\n if (rgba[3] === 1) {\n rgba.pop();\n prefix = \"rgb(\";\n }\n\n return prefix + rgba.join() + \")\";\n },\n toHslaString: function toHslaString() {\n var prefix = \"hsla(\",\n hsla = jQuery.map(this.hsla(), function (v, i) {\n if (v == null) {\n v = i > 2 ? 1 : 0;\n } // Catch 1 and 2\n\n\n if (i && i < 3) {\n v = Math.round(v * 100) + \"%\";\n }\n\n return v;\n });\n\n if (hsla[3] === 1) {\n hsla.pop();\n prefix = \"hsl(\";\n }\n\n return prefix + hsla.join() + \")\";\n },\n toHexString: function toHexString(includeAlpha) {\n var rgba = this._rgba.slice(),\n alpha = rgba.pop();\n\n if (includeAlpha) {\n rgba.push(~~(alpha * 255));\n }\n\n return \"#\" + jQuery.map(rgba, function (v) {\n // Default to 0 when nulls exist\n v = (v || 0).toString(16);\n return v.length === 1 ? \"0\" + v : v;\n }).join(\"\");\n },\n toString: function toString() {\n return this._rgba[3] === 0 ? \"transparent\" : this.toRgbaString();\n }\n });\n color.fn.parse.prototype = color.fn; // Hsla conversions adapted from:\n // https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021\n\n function hue2rgb(p, q, h) {\n h = (h + 1) % 1;\n\n if (h * 6 < 1) {\n return p + (q - p) * h * 6;\n }\n\n if (h * 2 < 1) {\n return q;\n }\n\n if (h * 3 < 2) {\n return p + (q - p) * (2 / 3 - h) * 6;\n }\n\n return p;\n }\n\n spaces.hsla.to = function (rgba) {\n if (rgba[0] == null || rgba[1] == null || rgba[2] == null) {\n return [null, null, null, rgba[3]];\n }\n\n var r = rgba[0] / 255,\n g = rgba[1] / 255,\n b = rgba[2] / 255,\n a = rgba[3],\n max = Math.max(r, g, b),\n min = Math.min(r, g, b),\n diff = max - min,\n add = max + min,\n l = add * 0.5,\n h,\n s;\n\n if (min === max) {\n h = 0;\n } else if (r === max) {\n h = 60 * (g - b) / diff + 360;\n } else if (g === max) {\n h = 60 * (b - r) / diff + 120;\n } else {\n h = 60 * (r - g) / diff + 240;\n } // Chroma (diff) == 0 means greyscale which, by definition, saturation = 0%\n // otherwise, saturation is based on the ratio of chroma (diff) to lightness (add)\n\n\n if (diff === 0) {\n s = 0;\n } else if (l <= 0.5) {\n s = diff / add;\n } else {\n s = diff / (2 - add);\n }\n\n return [Math.round(h) % 360, s, l, a == null ? 1 : a];\n };\n\n spaces.hsla.from = function (hsla) {\n if (hsla[0] == null || hsla[1] == null || hsla[2] == null) {\n return [null, null, null, hsla[3]];\n }\n\n var h = hsla[0] / 360,\n s = hsla[1],\n l = hsla[2],\n a = hsla[3],\n q = l <= 0.5 ? l * (1 + s) : l + s - l * s,\n p = 2 * l - q;\n return [Math.round(hue2rgb(p, q, h + 1 / 3) * 255), Math.round(hue2rgb(p, q, h) * 255), Math.round(hue2rgb(p, q, h - 1 / 3) * 255), a];\n };\n\n each(spaces, function (spaceName, space) {\n var props = space.props,\n cache = space.cache,\n to = space.to,\n from = space.from; // Makes rgba() and hsla()\n\n color.fn[spaceName] = function (value) {\n // Generate a cache for this space if it doesn't exist\n if (to && !this[cache]) {\n this[cache] = to(this._rgba);\n }\n\n if (value === undefined) {\n return this[cache].slice();\n }\n\n var ret,\n type = jQuery.type(value),\n arr = type === \"array\" || type === \"object\" ? value : arguments,\n local = this[cache].slice();\n each(props, function (key, prop) {\n var val = arr[type === \"object\" ? key : prop.idx];\n\n if (val == null) {\n val = local[prop.idx];\n }\n\n local[prop.idx] = clamp(val, prop);\n });\n\n if (from) {\n ret = color(from(local));\n ret[cache] = local;\n return ret;\n } else {\n return color(local);\n }\n }; // Makes red() green() blue() alpha() hue() saturation() lightness()\n\n\n each(props, function (key, prop) {\n // Alpha is included in more than one space\n if (color.fn[key]) {\n return;\n }\n\n color.fn[key] = function (value) {\n var vtype = jQuery.type(value),\n fn = key === \"alpha\" ? this._hsla ? \"hsla\" : \"rgba\" : spaceName,\n local = this[fn](),\n cur = local[prop.idx],\n match;\n\n if (vtype === \"undefined\") {\n return cur;\n }\n\n if (vtype === \"function\") {\n value = value.call(this, cur);\n vtype = jQuery.type(value);\n }\n\n if (value == null && prop.empty) {\n return this;\n }\n\n if (vtype === \"string\") {\n match = rplusequals.exec(value);\n\n if (match) {\n value = cur + parseFloat(match[2]) * (match[1] === \"+\" ? 1 : -1);\n }\n }\n\n local[prop.idx] = value;\n return this[fn](local);\n };\n });\n }); // Add cssHook and .fx.step function for each named hook.\n // accept a space separated string of properties\n\n color.hook = function (hook) {\n var hooks = hook.split(\" \");\n each(hooks, function (i, hook) {\n jQuery.cssHooks[hook] = {\n set: function set(elem, value) {\n var parsed,\n curElem,\n backgroundColor = \"\";\n\n if (value !== \"transparent\" && (jQuery.type(value) !== \"string\" || (parsed = stringParse(value)))) {\n value = color(parsed || value);\n\n if (!support.rgba && value._rgba[3] !== 1) {\n curElem = hook === \"backgroundColor\" ? elem.parentNode : elem;\n\n while ((backgroundColor === \"\" || backgroundColor === \"transparent\") && curElem && curElem.style) {\n try {\n backgroundColor = jQuery.css(curElem, \"backgroundColor\");\n curElem = curElem.parentNode;\n } catch (e) {}\n }\n\n value = value.blend(backgroundColor && backgroundColor !== \"transparent\" ? backgroundColor : \"_default\");\n }\n\n value = value.toRgbaString();\n }\n\n try {\n elem.style[hook] = value;\n } catch (e) {// Wrapped to prevent IE from throwing errors on \"invalid\" values like\n // 'auto' or 'inherit'\n }\n }\n };\n\n jQuery.fx.step[hook] = function (fx) {\n if (!fx.colorInit) {\n fx.start = color(fx.elem, hook);\n fx.end = color(fx.end);\n fx.colorInit = true;\n }\n\n jQuery.cssHooks[hook].set(fx.elem, fx.start.transition(fx.end, fx.pos));\n };\n });\n };\n\n color.hook(stepHooks);\n jQuery.cssHooks.borderColor = {\n expand: function expand(value) {\n var expanded = {};\n each([\"Top\", \"Right\", \"Bottom\", \"Left\"], function (i, part) {\n expanded[\"border\" + part + \"Color\"] = value;\n });\n return expanded;\n }\n }; // Basic color names only.\n // Usage of any of the other color names requires adding yourself or including\n // jquery.color.svg-names.js.\n\n colors = jQuery.Color.names = {\n // 4.1. Basic color keywords\n aqua: \"#00ffff\",\n black: \"#000000\",\n blue: \"#0000ff\",\n fuchsia: \"#ff00ff\",\n gray: \"#808080\",\n green: \"#008000\",\n lime: \"#00ff00\",\n maroon: \"#800000\",\n navy: \"#000080\",\n olive: \"#808000\",\n purple: \"#800080\",\n red: \"#ff0000\",\n silver: \"#c0c0c0\",\n teal: \"#008080\",\n white: \"#ffffff\",\n yellow: \"#ffff00\",\n // 4.2.3. \"transparent\" color keyword\n transparent: [null, null, null, 0],\n _default: \"#ffffff\"\n };\n })(jQuery);\n /******************************************************************************/\n\n /****************************** CLASS ANIMATIONS ******************************/\n\n /******************************************************************************/\n\n\n (function () {\n var classAnimationActions = [\"add\", \"remove\", \"toggle\"],\n shorthandStyles = {\n border: 1,\n borderBottom: 1,\n borderColor: 1,\n borderLeft: 1,\n borderRight: 1,\n borderTop: 1,\n borderWidth: 1,\n margin: 1,\n padding: 1\n };\n $.each([\"borderLeftStyle\", \"borderRightStyle\", \"borderBottomStyle\", \"borderTopStyle\"], function (_, prop) {\n $.fx.step[prop] = function (fx) {\n if (fx.end !== \"none\" && !fx.setAttr || fx.pos === 1 && !fx.setAttr) {\n jQuery.style(fx.elem, prop, fx.end);\n fx.setAttr = true;\n }\n };\n });\n\n function getElementStyles(elem) {\n var key,\n len,\n style = elem.ownerDocument.defaultView ? elem.ownerDocument.defaultView.getComputedStyle(elem, null) : elem.currentStyle,\n styles = {};\n\n if (style && style.length && style[0] && style[style[0]]) {\n len = style.length;\n\n while (len--) {\n key = style[len];\n\n if (typeof style[key] === \"string\") {\n styles[$.camelCase(key)] = style[key];\n }\n } // Support: Opera, IE <9\n\n } else {\n for (key in style) {\n if (typeof style[key] === \"string\") {\n styles[key] = style[key];\n }\n }\n }\n\n return styles;\n }\n\n function styleDifference(oldStyle, newStyle) {\n var diff = {},\n name,\n value;\n\n for (name in newStyle) {\n value = newStyle[name];\n\n if (oldStyle[name] !== value) {\n if (!shorthandStyles[name]) {\n if ($.fx.step[name] || !isNaN(parseFloat(value))) {\n diff[name] = value;\n }\n }\n }\n }\n\n return diff;\n } // Support: jQuery <1.8\n\n\n if (!$.fn.addBack) {\n $.fn.addBack = function (selector) {\n return this.add(selector == null ? this.prevObject : this.prevObject.filter(selector));\n };\n }\n\n $.effects.animateClass = function (value, duration, easing, callback) {\n var o = $.speed(duration, easing, callback);\n return this.queue(function () {\n var animated = $(this),\n baseClass = animated.attr(\"class\") || \"\",\n applyClassChange,\n allAnimations = o.children ? animated.find(\"*\").addBack() : animated; // Map the animated objects to store the original styles.\n\n allAnimations = allAnimations.map(function () {\n var el = $(this);\n return {\n el: el,\n start: getElementStyles(this)\n };\n }); // Apply class change\n\n applyClassChange = function applyClassChange() {\n $.each(classAnimationActions, function (i, action) {\n if (value[action]) {\n animated[action + \"Class\"](value[action]);\n }\n });\n };\n\n applyClassChange(); // Map all animated objects again - calculate new styles and diff\n\n allAnimations = allAnimations.map(function () {\n this.end = getElementStyles(this.el[0]);\n this.diff = styleDifference(this.start, this.end);\n return this;\n }); // Apply original class\n\n animated.attr(\"class\", baseClass); // Map all animated objects again - this time collecting a promise\n\n allAnimations = allAnimations.map(function () {\n var styleInfo = this,\n dfd = $.Deferred(),\n opts = $.extend({}, o, {\n queue: false,\n complete: function complete() {\n dfd.resolve(styleInfo);\n }\n });\n this.el.animate(this.diff, opts);\n return dfd.promise();\n }); // Once all animations have completed:\n\n $.when.apply($, allAnimations.get()).done(function () {\n // Set the final class\n applyClassChange(); // For each animated element,\n // clear all css properties that were animated\n\n $.each(arguments, function () {\n var el = this.el;\n $.each(this.diff, function (key) {\n el.css(key, \"\");\n });\n }); // This is guarnteed to be there if you use jQuery.speed()\n // it also handles dequeuing the next anim...\n\n o.complete.call(animated[0]);\n });\n });\n };\n\n $.fn.extend({\n addClass: function (orig) {\n return function (classNames, speed, easing, callback) {\n return speed ? $.effects.animateClass.call(this, {\n add: classNames\n }, speed, easing, callback) : orig.apply(this, arguments);\n };\n }($.fn.addClass),\n removeClass: function (orig) {\n return function (classNames, speed, easing, callback) {\n return arguments.length > 1 ? $.effects.animateClass.call(this, {\n remove: classNames\n }, speed, easing, callback) : orig.apply(this, arguments);\n };\n }($.fn.removeClass),\n toggleClass: function (orig) {\n return function (classNames, force, speed, easing, callback) {\n if (typeof force === \"boolean\" || force === undefined) {\n if (!speed) {\n // Without speed parameter\n return orig.apply(this, arguments);\n } else {\n return $.effects.animateClass.call(this, force ? {\n add: classNames\n } : {\n remove: classNames\n }, speed, easing, callback);\n }\n } else {\n // Without force parameter\n return $.effects.animateClass.call(this, {\n toggle: classNames\n }, force, speed, easing);\n }\n };\n }($.fn.toggleClass),\n switchClass: function switchClass(remove, add, speed, easing, callback) {\n return $.effects.animateClass.call(this, {\n add: add,\n remove: remove\n }, speed, easing, callback);\n }\n });\n })();\n /******************************************************************************/\n\n /*********************************** EFFECTS **********************************/\n\n /******************************************************************************/\n\n\n (function () {\n if ($.expr && $.expr.filters && $.expr.filters.animated) {\n $.expr.filters.animated = function (orig) {\n return function (elem) {\n return !!$(elem).data(dataSpaceAnimated) || orig(elem);\n };\n }($.expr.filters.animated);\n }\n\n if ($.uiBackCompat !== false) {\n $.extend($.effects, {\n // Saves a set of properties in a data storage\n save: function save(element, set) {\n var i = 0,\n length = set.length;\n\n for (; i < length; i++) {\n if (set[i] !== null) {\n element.data(dataSpace + set[i], element[0].style[set[i]]);\n }\n }\n },\n // Restores a set of previously saved properties from a data storage\n restore: function restore(element, set) {\n var val,\n i = 0,\n length = set.length;\n\n for (; i < length; i++) {\n if (set[i] !== null) {\n val = element.data(dataSpace + set[i]);\n element.css(set[i], val);\n }\n }\n },\n setMode: function setMode(el, mode) {\n if (mode === \"toggle\") {\n mode = el.is(\":hidden\") ? \"show\" : \"hide\";\n }\n\n return mode;\n },\n // Wraps the element around a wrapper that copies position properties\n createWrapper: function createWrapper(element) {\n // If the element is already wrapped, return it\n if (element.parent().is(\".ui-effects-wrapper\")) {\n return element.parent();\n } // Wrap the element\n\n\n var props = {\n width: element.outerWidth(true),\n height: element.outerHeight(true),\n \"float\": element.css(\"float\")\n },\n wrapper = $(\"
\").addClass(\"ui-effects-wrapper\").css({\n fontSize: \"100%\",\n background: \"transparent\",\n border: \"none\",\n margin: 0,\n padding: 0\n }),\n // Store the size in case width/height are defined in % - Fixes #5245\n size = {\n width: element.width(),\n height: element.height()\n },\n active = document.activeElement; // Support: Firefox\n // Firefox incorrectly exposes anonymous content\n // https://bugzilla.mozilla.org/show_bug.cgi?id=561664\n\n try {\n active.id;\n } catch (e) {\n active = document.body;\n }\n\n element.wrap(wrapper); // Fixes #7595 - Elements lose focus when wrapped.\n\n if (element[0] === active || $.contains(element[0], active)) {\n $(active).trigger(\"focus\");\n } // Hotfix for jQuery 1.4 since some change in wrap() seems to actually\n // lose the reference to the wrapped element\n\n\n wrapper = element.parent(); // Transfer positioning properties to the wrapper\n\n if (element.css(\"position\") === \"static\") {\n wrapper.css({\n position: \"relative\"\n });\n element.css({\n position: \"relative\"\n });\n } else {\n $.extend(props, {\n position: element.css(\"position\"),\n zIndex: element.css(\"z-index\")\n });\n $.each([\"top\", \"left\", \"bottom\", \"right\"], function (i, pos) {\n props[pos] = element.css(pos);\n\n if (isNaN(parseInt(props[pos], 10))) {\n props[pos] = \"auto\";\n }\n });\n element.css({\n position: \"relative\",\n top: 0,\n left: 0,\n right: \"auto\",\n bottom: \"auto\"\n });\n }\n\n element.css(size);\n return wrapper.css(props).show();\n },\n removeWrapper: function removeWrapper(element) {\n var active = document.activeElement;\n\n if (element.parent().is(\".ui-effects-wrapper\")) {\n element.parent().replaceWith(element); // Fixes #7595 - Elements lose focus when wrapped.\n\n if (element[0] === active || $.contains(element[0], active)) {\n $(active).trigger(\"focus\");\n }\n }\n\n return element;\n }\n });\n }\n\n $.extend($.effects, {\n version: \"1.12.1\",\n define: function define(name, mode, effect) {\n if (!effect) {\n effect = mode;\n mode = \"effect\";\n }\n\n $.effects.effect[name] = effect;\n $.effects.effect[name].mode = mode;\n return effect;\n },\n scaledDimensions: function scaledDimensions(element, percent, direction) {\n if (percent === 0) {\n return {\n height: 0,\n width: 0,\n outerHeight: 0,\n outerWidth: 0\n };\n }\n\n var x = direction !== \"horizontal\" ? (percent || 100) / 100 : 1,\n y = direction !== \"vertical\" ? (percent || 100) / 100 : 1;\n return {\n height: element.height() * y,\n width: element.width() * x,\n outerHeight: element.outerHeight() * y,\n outerWidth: element.outerWidth() * x\n };\n },\n clipToBox: function clipToBox(animation) {\n return {\n width: animation.clip.right - animation.clip.left,\n height: animation.clip.bottom - animation.clip.top,\n left: animation.clip.left,\n top: animation.clip.top\n };\n },\n // Injects recently queued functions to be first in line (after \"inprogress\")\n unshift: function unshift(element, queueLength, count) {\n var queue = element.queue();\n\n if (queueLength > 1) {\n queue.splice.apply(queue, [1, 0].concat(queue.splice(queueLength, count)));\n }\n\n element.dequeue();\n },\n saveStyle: function saveStyle(element) {\n element.data(dataSpaceStyle, element[0].style.cssText);\n },\n restoreStyle: function restoreStyle(element) {\n element[0].style.cssText = element.data(dataSpaceStyle) || \"\";\n element.removeData(dataSpaceStyle);\n },\n mode: function mode(element, _mode) {\n var hidden = element.is(\":hidden\");\n\n if (_mode === \"toggle\") {\n _mode = hidden ? \"show\" : \"hide\";\n }\n\n if (hidden ? _mode === \"hide\" : _mode === \"show\") {\n _mode = \"none\";\n }\n\n return _mode;\n },\n // Translates a [top,left] array into a baseline value\n getBaseline: function getBaseline(origin, original) {\n var y, x;\n\n switch (origin[0]) {\n case \"top\":\n y = 0;\n break;\n\n case \"middle\":\n y = 0.5;\n break;\n\n case \"bottom\":\n y = 1;\n break;\n\n default:\n y = origin[0] / original.height;\n }\n\n switch (origin[1]) {\n case \"left\":\n x = 0;\n break;\n\n case \"center\":\n x = 0.5;\n break;\n\n case \"right\":\n x = 1;\n break;\n\n default:\n x = origin[1] / original.width;\n }\n\n return {\n x: x,\n y: y\n };\n },\n // Creates a placeholder element so that the original element can be made absolute\n createPlaceholder: function createPlaceholder(element) {\n var placeholder,\n cssPosition = element.css(\"position\"),\n position = element.position(); // Lock in margins first to account for form elements, which\n // will change margin if you explicitly set height\n // see: http://jsfiddle.net/JZSMt/3/ https://bugs.webkit.org/show_bug.cgi?id=107380\n // Support: Safari\n\n element.css({\n marginTop: element.css(\"marginTop\"),\n marginBottom: element.css(\"marginBottom\"),\n marginLeft: element.css(\"marginLeft\"),\n marginRight: element.css(\"marginRight\")\n }).outerWidth(element.outerWidth()).outerHeight(element.outerHeight());\n\n if (/^(static|relative)/.test(cssPosition)) {\n cssPosition = \"absolute\";\n placeholder = $(\"<\" + element[0].nodeName + \">\").insertAfter(element).css({\n // Convert inline to inline block to account for inline elements\n // that turn to inline block based on content (like img)\n display: /^(inline|ruby)/.test(element.css(\"display\")) ? \"inline-block\" : \"block\",\n visibility: \"hidden\",\n // Margins need to be set to account for margin collapse\n marginTop: element.css(\"marginTop\"),\n marginBottom: element.css(\"marginBottom\"),\n marginLeft: element.css(\"marginLeft\"),\n marginRight: element.css(\"marginRight\"),\n \"float\": element.css(\"float\")\n }).outerWidth(element.outerWidth()).outerHeight(element.outerHeight()).addClass(\"ui-effects-placeholder\");\n element.data(dataSpace + \"placeholder\", placeholder);\n }\n\n element.css({\n position: cssPosition,\n left: position.left,\n top: position.top\n });\n return placeholder;\n },\n removePlaceholder: function removePlaceholder(element) {\n var dataKey = dataSpace + \"placeholder\",\n placeholder = element.data(dataKey);\n\n if (placeholder) {\n placeholder.remove();\n element.removeData(dataKey);\n }\n },\n // Removes a placeholder if it exists and restores\n // properties that were modified during placeholder creation\n cleanUp: function cleanUp(element) {\n $.effects.restoreStyle(element);\n $.effects.removePlaceholder(element);\n },\n setTransition: function setTransition(element, list, factor, value) {\n value = value || {};\n $.each(list, function (i, x) {\n var unit = element.cssUnit(x);\n\n if (unit[0] > 0) {\n value[x] = unit[0] * factor + unit[1];\n }\n });\n return value;\n }\n }); // Return an effect options object for the given parameters:\n\n function _normalizeArguments(effect, options, speed, callback) {\n // Allow passing all options as the first parameter\n if ($.isPlainObject(effect)) {\n options = effect;\n effect = effect.effect;\n } // Convert to an object\n\n\n effect = {\n effect: effect\n }; // Catch (effect, null, ...)\n\n if (options == null) {\n options = {};\n } // Catch (effect, callback)\n\n\n if ($.isFunction(options)) {\n callback = options;\n speed = null;\n options = {};\n } // Catch (effect, speed, ?)\n\n\n if (typeof options === \"number\" || $.fx.speeds[options]) {\n callback = speed;\n speed = options;\n options = {};\n } // Catch (effect, options, callback)\n\n\n if ($.isFunction(speed)) {\n callback = speed;\n speed = null;\n } // Add options to effect\n\n\n if (options) {\n $.extend(effect, options);\n }\n\n speed = speed || options.duration;\n effect.duration = $.fx.off ? 0 : typeof speed === \"number\" ? speed : speed in $.fx.speeds ? $.fx.speeds[speed] : $.fx.speeds._default;\n effect.complete = callback || options.complete;\n return effect;\n }\n\n function standardAnimationOption(option) {\n // Valid standard speeds (nothing, number, named speed)\n if (!option || typeof option === \"number\" || $.fx.speeds[option]) {\n return true;\n } // Invalid strings - treat as \"normal\" speed\n\n\n if (typeof option === \"string\" && !$.effects.effect[option]) {\n return true;\n } // Complete callback\n\n\n if ($.isFunction(option)) {\n return true;\n } // Options hash (but not naming an effect)\n\n\n if (_typeof(option) === \"object\" && !option.effect) {\n return true;\n } // Didn't match any standard API\n\n\n return false;\n }\n\n $.fn.extend({\n effect: function effect()\n /* effect, options, speed, callback */\n {\n var args = _normalizeArguments.apply(this, arguments),\n effectMethod = $.effects.effect[args.effect],\n defaultMode = effectMethod.mode,\n queue = args.queue,\n queueName = queue || \"fx\",\n complete = args.complete,\n mode = args.mode,\n modes = [],\n prefilter = function prefilter(next) {\n var el = $(this),\n normalizedMode = $.effects.mode(el, mode) || defaultMode; // Sentinel for duck-punching the :animated psuedo-selector\n\n el.data(dataSpaceAnimated, true); // Save effect mode for later use,\n // we can't just call $.effects.mode again later,\n // as the .show() below destroys the initial state\n\n modes.push(normalizedMode); // See $.uiBackCompat inside of run() for removal of defaultMode in 1.13\n\n if (defaultMode && (normalizedMode === \"show\" || normalizedMode === defaultMode && normalizedMode === \"hide\")) {\n el.show();\n }\n\n if (!defaultMode || normalizedMode !== \"none\") {\n $.effects.saveStyle(el);\n }\n\n if ($.isFunction(next)) {\n next();\n }\n };\n\n if ($.fx.off || !effectMethod) {\n // Delegate to the original method (e.g., .show()) if possible\n if (mode) {\n return this[mode](args.duration, complete);\n } else {\n return this.each(function () {\n if (complete) {\n complete.call(this);\n }\n });\n }\n }\n\n function run(next) {\n var elem = $(this);\n\n function cleanup() {\n elem.removeData(dataSpaceAnimated);\n $.effects.cleanUp(elem);\n\n if (args.mode === \"hide\") {\n elem.hide();\n }\n\n done();\n }\n\n function done() {\n if ($.isFunction(complete)) {\n complete.call(elem[0]);\n }\n\n if ($.isFunction(next)) {\n next();\n }\n } // Override mode option on a per element basis,\n // as toggle can be either show or hide depending on element state\n\n\n args.mode = modes.shift();\n\n if ($.uiBackCompat !== false && !defaultMode) {\n if (elem.is(\":hidden\") ? mode === \"hide\" : mode === \"show\") {\n // Call the core method to track \"olddisplay\" properly\n elem[mode]();\n done();\n } else {\n effectMethod.call(elem[0], args, done);\n }\n } else {\n if (args.mode === \"none\") {\n // Call the core method to track \"olddisplay\" properly\n elem[mode]();\n done();\n } else {\n effectMethod.call(elem[0], args, cleanup);\n }\n }\n } // Run prefilter on all elements first to ensure that\n // any showing or hiding happens before placeholder creation,\n // which ensures that any layout changes are correctly captured.\n\n\n return queue === false ? this.each(prefilter).each(run) : this.queue(queueName, prefilter).queue(queueName, run);\n },\n show: function (orig) {\n return function (option) {\n if (standardAnimationOption(option)) {\n return orig.apply(this, arguments);\n } else {\n var args = _normalizeArguments.apply(this, arguments);\n\n args.mode = \"show\";\n return this.effect.call(this, args);\n }\n };\n }($.fn.show),\n hide: function (orig) {\n return function (option) {\n if (standardAnimationOption(option)) {\n return orig.apply(this, arguments);\n } else {\n var args = _normalizeArguments.apply(this, arguments);\n\n args.mode = \"hide\";\n return this.effect.call(this, args);\n }\n };\n }($.fn.hide),\n toggle: function (orig) {\n return function (option) {\n if (standardAnimationOption(option) || typeof option === \"boolean\") {\n return orig.apply(this, arguments);\n } else {\n var args = _normalizeArguments.apply(this, arguments);\n\n args.mode = \"toggle\";\n return this.effect.call(this, args);\n }\n };\n }($.fn.toggle),\n cssUnit: function cssUnit(key) {\n var style = this.css(key),\n val = [];\n $.each([\"em\", \"px\", \"%\", \"pt\"], function (i, unit) {\n if (style.indexOf(unit) > 0) {\n val = [parseFloat(style), unit];\n }\n });\n return val;\n },\n cssClip: function cssClip(clipObj) {\n if (clipObj) {\n return this.css(\"clip\", \"rect(\" + clipObj.top + \"px \" + clipObj.right + \"px \" + clipObj.bottom + \"px \" + clipObj.left + \"px)\");\n }\n\n return parseClip(this.css(\"clip\"), this);\n },\n transfer: function transfer(options, done) {\n var element = $(this),\n target = $(options.to),\n targetFixed = target.css(\"position\") === \"fixed\",\n body = $(\"body\"),\n fixTop = targetFixed ? body.scrollTop() : 0,\n fixLeft = targetFixed ? body.scrollLeft() : 0,\n endPosition = target.offset(),\n animation = {\n top: endPosition.top - fixTop,\n left: endPosition.left - fixLeft,\n height: target.innerHeight(),\n width: target.innerWidth()\n },\n startPosition = element.offset(),\n transfer = $(\"\").appendTo(\"body\").addClass(options.className).css({\n top: startPosition.top - fixTop,\n left: startPosition.left - fixLeft,\n height: element.innerHeight(),\n width: element.innerWidth(),\n position: targetFixed ? \"fixed\" : \"absolute\"\n }).animate(animation, options.duration, options.easing, function () {\n transfer.remove();\n\n if ($.isFunction(done)) {\n done();\n }\n });\n }\n });\n\n function parseClip(str, element) {\n var outerWidth = element.outerWidth(),\n outerHeight = element.outerHeight(),\n clipRegex = /^rect\\((-?\\d*\\.?\\d*px|-?\\d+%|auto),?\\s*(-?\\d*\\.?\\d*px|-?\\d+%|auto),?\\s*(-?\\d*\\.?\\d*px|-?\\d+%|auto),?\\s*(-?\\d*\\.?\\d*px|-?\\d+%|auto)\\)$/,\n values = clipRegex.exec(str) || [\"\", 0, outerWidth, outerHeight, 0];\n return {\n top: parseFloat(values[1]) || 0,\n right: values[2] === \"auto\" ? outerWidth : parseFloat(values[2]),\n bottom: values[3] === \"auto\" ? outerHeight : parseFloat(values[3]),\n left: parseFloat(values[4]) || 0\n };\n }\n\n $.fx.step.clip = function (fx) {\n if (!fx.clipInit) {\n fx.start = $(fx.elem).cssClip();\n\n if (typeof fx.end === \"string\") {\n fx.end = parseClip(fx.end, fx.elem);\n }\n\n fx.clipInit = true;\n }\n\n $(fx.elem).cssClip({\n top: fx.pos * (fx.end.top - fx.start.top) + fx.start.top,\n right: fx.pos * (fx.end.right - fx.start.right) + fx.start.right,\n bottom: fx.pos * (fx.end.bottom - fx.start.bottom) + fx.start.bottom,\n left: fx.pos * (fx.end.left - fx.start.left) + fx.start.left\n });\n };\n })();\n /******************************************************************************/\n\n /*********************************** EASING ***********************************/\n\n /******************************************************************************/\n\n\n (function () {\n // Based on easing equations from Robert Penner (http://www.robertpenner.com/easing)\n var baseEasings = {};\n $.each([\"Quad\", \"Cubic\", \"Quart\", \"Quint\", \"Expo\"], function (i, name) {\n baseEasings[name] = function (p) {\n return Math.pow(p, i + 2);\n };\n });\n $.extend(baseEasings, {\n Sine: function Sine(p) {\n return 1 - Math.cos(p * Math.PI / 2);\n },\n Circ: function Circ(p) {\n return 1 - Math.sqrt(1 - p * p);\n },\n Elastic: function Elastic(p) {\n return p === 0 || p === 1 ? p : -Math.pow(2, 8 * (p - 1)) * Math.sin(((p - 1) * 80 - 7.5) * Math.PI / 15);\n },\n Back: function Back(p) {\n return p * p * (3 * p - 2);\n },\n Bounce: function Bounce(p) {\n var pow2,\n bounce = 4;\n\n while (p < ((pow2 = Math.pow(2, --bounce)) - 1) / 11) {}\n\n return 1 / Math.pow(4, 3 - bounce) - 7.5625 * Math.pow((pow2 * 3 - 2) / 22 - p, 2);\n }\n });\n $.each(baseEasings, function (name, easeIn) {\n $.easing[\"easeIn\" + name] = easeIn;\n\n $.easing[\"easeOut\" + name] = function (p) {\n return 1 - easeIn(1 - p);\n };\n\n $.easing[\"easeInOut\" + name] = function (p) {\n return p < 0.5 ? easeIn(p * 2) / 2 : 1 - easeIn(p * -2 + 2) / 2;\n };\n });\n })();\n\n var effect = $.effects;\n /*!\n * jQuery UI Effects Blind 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Blind Effect\n //>>group: Effects\n //>>description: Blinds the element.\n //>>docs: http://api.jqueryui.com/blind-effect/\n //>>demos: http://jqueryui.com/effect/\n\n var effectsEffectBlind = $.effects.define(\"blind\", \"hide\", function (options, done) {\n var map = {\n up: [\"bottom\", \"top\"],\n vertical: [\"bottom\", \"top\"],\n down: [\"top\", \"bottom\"],\n left: [\"right\", \"left\"],\n horizontal: [\"right\", \"left\"],\n right: [\"left\", \"right\"]\n },\n element = $(this),\n direction = options.direction || \"up\",\n start = element.cssClip(),\n animate = {\n clip: $.extend({}, start)\n },\n placeholder = $.effects.createPlaceholder(element);\n animate.clip[map[direction][0]] = animate.clip[map[direction][1]];\n\n if (options.mode === \"show\") {\n element.cssClip(animate.clip);\n\n if (placeholder) {\n placeholder.css($.effects.clipToBox(animate));\n }\n\n animate.clip = start;\n }\n\n if (placeholder) {\n placeholder.animate($.effects.clipToBox(animate), options.duration, options.easing);\n }\n\n element.animate(animate, {\n queue: false,\n duration: options.duration,\n easing: options.easing,\n complete: done\n });\n });\n /*!\n * jQuery UI Effects Bounce 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Bounce Effect\n //>>group: Effects\n //>>description: Bounces an element horizontally or vertically n times.\n //>>docs: http://api.jqueryui.com/bounce-effect/\n //>>demos: http://jqueryui.com/effect/\n\n var effectsEffectBounce = $.effects.define(\"bounce\", function (options, done) {\n var upAnim,\n downAnim,\n refValue,\n element = $(this),\n // Defaults:\n mode = options.mode,\n hide = mode === \"hide\",\n show = mode === \"show\",\n direction = options.direction || \"up\",\n distance = options.distance,\n times = options.times || 5,\n // Number of internal animations\n anims = times * 2 + (show || hide ? 1 : 0),\n speed = options.duration / anims,\n easing = options.easing,\n // Utility:\n ref = direction === \"up\" || direction === \"down\" ? \"top\" : \"left\",\n motion = direction === \"up\" || direction === \"left\",\n i = 0,\n queuelen = element.queue().length;\n $.effects.createPlaceholder(element);\n refValue = element.css(ref); // Default distance for the BIGGEST bounce is the outer Distance / 3\n\n if (!distance) {\n distance = element[ref === \"top\" ? \"outerHeight\" : \"outerWidth\"]() / 3;\n }\n\n if (show) {\n downAnim = {\n opacity: 1\n };\n downAnim[ref] = refValue; // If we are showing, force opacity 0 and set the initial position\n // then do the \"first\" animation\n\n element.css(\"opacity\", 0).css(ref, motion ? -distance * 2 : distance * 2).animate(downAnim, speed, easing);\n } // Start at the smallest distance if we are hiding\n\n\n if (hide) {\n distance = distance / Math.pow(2, times - 1);\n }\n\n downAnim = {};\n downAnim[ref] = refValue; // Bounces up/down/left/right then back to 0 -- times * 2 animations happen here\n\n for (; i < times; i++) {\n upAnim = {};\n upAnim[ref] = (motion ? \"-=\" : \"+=\") + distance;\n element.animate(upAnim, speed, easing).animate(downAnim, speed, easing);\n distance = hide ? distance * 2 : distance / 2;\n } // Last Bounce when Hiding\n\n\n if (hide) {\n upAnim = {\n opacity: 0\n };\n upAnim[ref] = (motion ? \"-=\" : \"+=\") + distance;\n element.animate(upAnim, speed, easing);\n }\n\n element.queue(done);\n $.effects.unshift(element, queuelen, anims + 1);\n });\n /*!\n * jQuery UI Effects Clip 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Clip Effect\n //>>group: Effects\n //>>description: Clips the element on and off like an old TV.\n //>>docs: http://api.jqueryui.com/clip-effect/\n //>>demos: http://jqueryui.com/effect/\n\n var effectsEffectClip = $.effects.define(\"clip\", \"hide\", function (options, done) {\n var start,\n animate = {},\n element = $(this),\n direction = options.direction || \"vertical\",\n both = direction === \"both\",\n horizontal = both || direction === \"horizontal\",\n vertical = both || direction === \"vertical\";\n start = element.cssClip();\n animate.clip = {\n top: vertical ? (start.bottom - start.top) / 2 : start.top,\n right: horizontal ? (start.right - start.left) / 2 : start.right,\n bottom: vertical ? (start.bottom - start.top) / 2 : start.bottom,\n left: horizontal ? (start.right - start.left) / 2 : start.left\n };\n $.effects.createPlaceholder(element);\n\n if (options.mode === \"show\") {\n element.cssClip(animate.clip);\n animate.clip = start;\n }\n\n element.animate(animate, {\n queue: false,\n duration: options.duration,\n easing: options.easing,\n complete: done\n });\n });\n /*!\n * jQuery UI Effects Drop 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Drop Effect\n //>>group: Effects\n //>>description: Moves an element in one direction and hides it at the same time.\n //>>docs: http://api.jqueryui.com/drop-effect/\n //>>demos: http://jqueryui.com/effect/\n\n var effectsEffectDrop = $.effects.define(\"drop\", \"hide\", function (options, done) {\n var distance,\n element = $(this),\n mode = options.mode,\n show = mode === \"show\",\n direction = options.direction || \"left\",\n ref = direction === \"up\" || direction === \"down\" ? \"top\" : \"left\",\n motion = direction === \"up\" || direction === \"left\" ? \"-=\" : \"+=\",\n oppositeMotion = motion === \"+=\" ? \"-=\" : \"+=\",\n animation = {\n opacity: 0\n };\n $.effects.createPlaceholder(element);\n distance = options.distance || element[ref === \"top\" ? \"outerHeight\" : \"outerWidth\"](true) / 2;\n animation[ref] = motion + distance;\n\n if (show) {\n element.css(animation);\n animation[ref] = oppositeMotion + distance;\n animation.opacity = 1;\n } // Animate\n\n\n element.animate(animation, {\n queue: false,\n duration: options.duration,\n easing: options.easing,\n complete: done\n });\n });\n /*!\n * jQuery UI Effects Explode 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Explode Effect\n //>>group: Effects\n // jscs:disable maximumLineLength\n //>>description: Explodes an element in all directions into n pieces. Implodes an element to its original wholeness.\n // jscs:enable maximumLineLength\n //>>docs: http://api.jqueryui.com/explode-effect/\n //>>demos: http://jqueryui.com/effect/\n\n var effectsEffectExplode = $.effects.define(\"explode\", \"hide\", function (options, done) {\n var i,\n j,\n left,\n top,\n mx,\n my,\n rows = options.pieces ? Math.round(Math.sqrt(options.pieces)) : 3,\n cells = rows,\n element = $(this),\n mode = options.mode,\n show = mode === \"show\",\n // Show and then visibility:hidden the element before calculating offset\n offset = element.show().css(\"visibility\", \"hidden\").offset(),\n // Width and height of a piece\n width = Math.ceil(element.outerWidth() / cells),\n height = Math.ceil(element.outerHeight() / rows),\n pieces = []; // Children animate complete:\n\n function childComplete() {\n pieces.push(this);\n\n if (pieces.length === rows * cells) {\n animComplete();\n }\n } // Clone the element for each row and cell.\n\n\n for (i = 0; i < rows; i++) {\n // ===>\n top = offset.top + i * height;\n my = i - (rows - 1) / 2;\n\n for (j = 0; j < cells; j++) {\n // |||\n left = offset.left + j * width;\n mx = j - (cells - 1) / 2; // Create a clone of the now hidden main element that will be absolute positioned\n // within a wrapper div off the -left and -top equal to size of our pieces\n\n element.clone().appendTo(\"body\").wrap(\"\").css({\n position: \"absolute\",\n visibility: \"visible\",\n left: -j * width,\n top: -i * height\n }) // Select the wrapper - make it overflow: hidden and absolute positioned based on\n // where the original was located +left and +top equal to the size of pieces\n .parent().addClass(\"ui-effects-explode\").css({\n position: \"absolute\",\n overflow: \"hidden\",\n width: width,\n height: height,\n left: left + (show ? mx * width : 0),\n top: top + (show ? my * height : 0),\n opacity: show ? 0 : 1\n }).animate({\n left: left + (show ? 0 : mx * width),\n top: top + (show ? 0 : my * height),\n opacity: show ? 1 : 0\n }, options.duration || 500, options.easing, childComplete);\n }\n }\n\n function animComplete() {\n element.css({\n visibility: \"visible\"\n });\n $(pieces).remove();\n done();\n }\n });\n /*!\n * jQuery UI Effects Fade 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Fade Effect\n //>>group: Effects\n //>>description: Fades the element.\n //>>docs: http://api.jqueryui.com/fade-effect/\n //>>demos: http://jqueryui.com/effect/\n\n var effectsEffectFade = $.effects.define(\"fade\", \"toggle\", function (options, done) {\n var show = options.mode === \"show\";\n $(this).css(\"opacity\", show ? 0 : 1).animate({\n opacity: show ? 1 : 0\n }, {\n queue: false,\n duration: options.duration,\n easing: options.easing,\n complete: done\n });\n });\n /*!\n * jQuery UI Effects Fold 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Fold Effect\n //>>group: Effects\n //>>description: Folds an element first horizontally and then vertically.\n //>>docs: http://api.jqueryui.com/fold-effect/\n //>>demos: http://jqueryui.com/effect/\n\n var effectsEffectFold = $.effects.define(\"fold\", \"hide\", function (options, done) {\n // Create element\n var element = $(this),\n mode = options.mode,\n show = mode === \"show\",\n hide = mode === \"hide\",\n size = options.size || 15,\n percent = /([0-9]+)%/.exec(size),\n horizFirst = !!options.horizFirst,\n ref = horizFirst ? [\"right\", \"bottom\"] : [\"bottom\", \"right\"],\n duration = options.duration / 2,\n placeholder = $.effects.createPlaceholder(element),\n start = element.cssClip(),\n animation1 = {\n clip: $.extend({}, start)\n },\n animation2 = {\n clip: $.extend({}, start)\n },\n distance = [start[ref[0]], start[ref[1]]],\n queuelen = element.queue().length;\n\n if (percent) {\n size = parseInt(percent[1], 10) / 100 * distance[hide ? 0 : 1];\n }\n\n animation1.clip[ref[0]] = size;\n animation2.clip[ref[0]] = size;\n animation2.clip[ref[1]] = 0;\n\n if (show) {\n element.cssClip(animation2.clip);\n\n if (placeholder) {\n placeholder.css($.effects.clipToBox(animation2));\n }\n\n animation2.clip = start;\n } // Animate\n\n\n element.queue(function (next) {\n if (placeholder) {\n placeholder.animate($.effects.clipToBox(animation1), duration, options.easing).animate($.effects.clipToBox(animation2), duration, options.easing);\n }\n\n next();\n }).animate(animation1, duration, options.easing).animate(animation2, duration, options.easing).queue(done);\n $.effects.unshift(element, queuelen, 4);\n });\n /*!\n * jQuery UI Effects Highlight 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Highlight Effect\n //>>group: Effects\n //>>description: Highlights the background of an element in a defined color for a custom duration.\n //>>docs: http://api.jqueryui.com/highlight-effect/\n //>>demos: http://jqueryui.com/effect/\n\n var effectsEffectHighlight = $.effects.define(\"highlight\", \"show\", function (options, done) {\n var element = $(this),\n animation = {\n backgroundColor: element.css(\"backgroundColor\")\n };\n\n if (options.mode === \"hide\") {\n animation.opacity = 0;\n }\n\n $.effects.saveStyle(element);\n element.css({\n backgroundImage: \"none\",\n backgroundColor: options.color || \"#ffff99\"\n }).animate(animation, {\n queue: false,\n duration: options.duration,\n easing: options.easing,\n complete: done\n });\n });\n /*!\n * jQuery UI Effects Size 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Size Effect\n //>>group: Effects\n //>>description: Resize an element to a specified width and height.\n //>>docs: http://api.jqueryui.com/size-effect/\n //>>demos: http://jqueryui.com/effect/\n\n var effectsEffectSize = $.effects.define(\"size\", function (options, done) {\n // Create element\n var baseline,\n factor,\n temp,\n element = $(this),\n // Copy for children\n cProps = [\"fontSize\"],\n vProps = [\"borderTopWidth\", \"borderBottomWidth\", \"paddingTop\", \"paddingBottom\"],\n hProps = [\"borderLeftWidth\", \"borderRightWidth\", \"paddingLeft\", \"paddingRight\"],\n // Set options\n mode = options.mode,\n restore = mode !== \"effect\",\n scale = options.scale || \"both\",\n origin = options.origin || [\"middle\", \"center\"],\n position = element.css(\"position\"),\n pos = element.position(),\n original = $.effects.scaledDimensions(element),\n from = options.from || original,\n to = options.to || $.effects.scaledDimensions(element, 0);\n $.effects.createPlaceholder(element);\n\n if (mode === \"show\") {\n temp = from;\n from = to;\n to = temp;\n } // Set scaling factor\n\n\n factor = {\n from: {\n y: from.height / original.height,\n x: from.width / original.width\n },\n to: {\n y: to.height / original.height,\n x: to.width / original.width\n }\n }; // Scale the css box\n\n if (scale === \"box\" || scale === \"both\") {\n // Vertical props scaling\n if (factor.from.y !== factor.to.y) {\n from = $.effects.setTransition(element, vProps, factor.from.y, from);\n to = $.effects.setTransition(element, vProps, factor.to.y, to);\n } // Horizontal props scaling\n\n\n if (factor.from.x !== factor.to.x) {\n from = $.effects.setTransition(element, hProps, factor.from.x, from);\n to = $.effects.setTransition(element, hProps, factor.to.x, to);\n }\n } // Scale the content\n\n\n if (scale === \"content\" || scale === \"both\") {\n // Vertical props scaling\n if (factor.from.y !== factor.to.y) {\n from = $.effects.setTransition(element, cProps, factor.from.y, from);\n to = $.effects.setTransition(element, cProps, factor.to.y, to);\n }\n } // Adjust the position properties based on the provided origin points\n\n\n if (origin) {\n baseline = $.effects.getBaseline(origin, original);\n from.top = (original.outerHeight - from.outerHeight) * baseline.y + pos.top;\n from.left = (original.outerWidth - from.outerWidth) * baseline.x + pos.left;\n to.top = (original.outerHeight - to.outerHeight) * baseline.y + pos.top;\n to.left = (original.outerWidth - to.outerWidth) * baseline.x + pos.left;\n }\n\n element.css(from); // Animate the children if desired\n\n if (scale === \"content\" || scale === \"both\") {\n vProps = vProps.concat([\"marginTop\", \"marginBottom\"]).concat(cProps);\n hProps = hProps.concat([\"marginLeft\", \"marginRight\"]); // Only animate children with width attributes specified\n // TODO: is this right? should we include anything with css width specified as well\n\n element.find(\"*[width]\").each(function () {\n var child = $(this),\n childOriginal = $.effects.scaledDimensions(child),\n childFrom = {\n height: childOriginal.height * factor.from.y,\n width: childOriginal.width * factor.from.x,\n outerHeight: childOriginal.outerHeight * factor.from.y,\n outerWidth: childOriginal.outerWidth * factor.from.x\n },\n childTo = {\n height: childOriginal.height * factor.to.y,\n width: childOriginal.width * factor.to.x,\n outerHeight: childOriginal.height * factor.to.y,\n outerWidth: childOriginal.width * factor.to.x\n }; // Vertical props scaling\n\n if (factor.from.y !== factor.to.y) {\n childFrom = $.effects.setTransition(child, vProps, factor.from.y, childFrom);\n childTo = $.effects.setTransition(child, vProps, factor.to.y, childTo);\n } // Horizontal props scaling\n\n\n if (factor.from.x !== factor.to.x) {\n childFrom = $.effects.setTransition(child, hProps, factor.from.x, childFrom);\n childTo = $.effects.setTransition(child, hProps, factor.to.x, childTo);\n }\n\n if (restore) {\n $.effects.saveStyle(child);\n } // Animate children\n\n\n child.css(childFrom);\n child.animate(childTo, options.duration, options.easing, function () {\n // Restore children\n if (restore) {\n $.effects.restoreStyle(child);\n }\n });\n });\n } // Animate\n\n\n element.animate(to, {\n queue: false,\n duration: options.duration,\n easing: options.easing,\n complete: function complete() {\n var offset = element.offset();\n\n if (to.opacity === 0) {\n element.css(\"opacity\", from.opacity);\n }\n\n if (!restore) {\n element.css(\"position\", position === \"static\" ? \"relative\" : position).offset(offset); // Need to save style here so that automatic style restoration\n // doesn't restore to the original styles from before the animation.\n\n $.effects.saveStyle(element);\n }\n\n done();\n }\n });\n });\n /*!\n * jQuery UI Effects Scale 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Scale Effect\n //>>group: Effects\n //>>description: Grows or shrinks an element and its content.\n //>>docs: http://api.jqueryui.com/scale-effect/\n //>>demos: http://jqueryui.com/effect/\n\n var effectsEffectScale = $.effects.define(\"scale\", function (options, done) {\n // Create element\n var el = $(this),\n mode = options.mode,\n percent = parseInt(options.percent, 10) || (parseInt(options.percent, 10) === 0 ? 0 : mode !== \"effect\" ? 0 : 100),\n newOptions = $.extend(true, {\n from: $.effects.scaledDimensions(el),\n to: $.effects.scaledDimensions(el, percent, options.direction || \"both\"),\n origin: options.origin || [\"middle\", \"center\"]\n }, options); // Fade option to support puff\n\n if (options.fade) {\n newOptions.from.opacity = 1;\n newOptions.to.opacity = 0;\n }\n\n $.effects.effect.size.call(this, newOptions, done);\n });\n /*!\n * jQuery UI Effects Puff 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Puff Effect\n //>>group: Effects\n //>>description: Creates a puff effect by scaling the element up and hiding it at the same time.\n //>>docs: http://api.jqueryui.com/puff-effect/\n //>>demos: http://jqueryui.com/effect/\n\n var effectsEffectPuff = $.effects.define(\"puff\", \"hide\", function (options, done) {\n var newOptions = $.extend(true, {}, options, {\n fade: true,\n percent: parseInt(options.percent, 10) || 150\n });\n $.effects.effect.scale.call(this, newOptions, done);\n });\n /*!\n * jQuery UI Effects Pulsate 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Pulsate Effect\n //>>group: Effects\n //>>description: Pulsates an element n times by changing the opacity to zero and back.\n //>>docs: http://api.jqueryui.com/pulsate-effect/\n //>>demos: http://jqueryui.com/effect/\n\n var effectsEffectPulsate = $.effects.define(\"pulsate\", \"show\", function (options, done) {\n var element = $(this),\n mode = options.mode,\n show = mode === \"show\",\n hide = mode === \"hide\",\n showhide = show || hide,\n // Showing or hiding leaves off the \"last\" animation\n anims = (options.times || 5) * 2 + (showhide ? 1 : 0),\n duration = options.duration / anims,\n animateTo = 0,\n i = 1,\n queuelen = element.queue().length;\n\n if (show || !element.is(\":visible\")) {\n element.css(\"opacity\", 0).show();\n animateTo = 1;\n } // Anims - 1 opacity \"toggles\"\n\n\n for (; i < anims; i++) {\n element.animate({\n opacity: animateTo\n }, duration, options.easing);\n animateTo = 1 - animateTo;\n }\n\n element.animate({\n opacity: animateTo\n }, duration, options.easing);\n element.queue(done);\n $.effects.unshift(element, queuelen, anims + 1);\n });\n /*!\n * jQuery UI Effects Shake 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Shake Effect\n //>>group: Effects\n //>>description: Shakes an element horizontally or vertically n times.\n //>>docs: http://api.jqueryui.com/shake-effect/\n //>>demos: http://jqueryui.com/effect/\n\n var effectsEffectShake = $.effects.define(\"shake\", function (options, done) {\n var i = 1,\n element = $(this),\n direction = options.direction || \"left\",\n distance = options.distance || 20,\n times = options.times || 3,\n anims = times * 2 + 1,\n speed = Math.round(options.duration / anims),\n ref = direction === \"up\" || direction === \"down\" ? \"top\" : \"left\",\n positiveMotion = direction === \"up\" || direction === \"left\",\n animation = {},\n animation1 = {},\n animation2 = {},\n queuelen = element.queue().length;\n $.effects.createPlaceholder(element); // Animation\n\n animation[ref] = (positiveMotion ? \"-=\" : \"+=\") + distance;\n animation1[ref] = (positiveMotion ? \"+=\" : \"-=\") + distance * 2;\n animation2[ref] = (positiveMotion ? \"-=\" : \"+=\") + distance * 2; // Animate\n\n element.animate(animation, speed, options.easing); // Shakes\n\n for (; i < times; i++) {\n element.animate(animation1, speed, options.easing).animate(animation2, speed, options.easing);\n }\n\n element.animate(animation1, speed, options.easing).animate(animation, speed / 2, options.easing).queue(done);\n $.effects.unshift(element, queuelen, anims + 1);\n });\n /*!\n * jQuery UI Effects Slide 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Slide Effect\n //>>group: Effects\n //>>description: Slides an element in and out of the viewport.\n //>>docs: http://api.jqueryui.com/slide-effect/\n //>>demos: http://jqueryui.com/effect/\n\n var effectsEffectSlide = $.effects.define(\"slide\", \"show\", function (options, done) {\n var startClip,\n startRef,\n element = $(this),\n map = {\n up: [\"bottom\", \"top\"],\n down: [\"top\", \"bottom\"],\n left: [\"right\", \"left\"],\n right: [\"left\", \"right\"]\n },\n mode = options.mode,\n direction = options.direction || \"left\",\n ref = direction === \"up\" || direction === \"down\" ? \"top\" : \"left\",\n positiveMotion = direction === \"up\" || direction === \"left\",\n distance = options.distance || element[ref === \"top\" ? \"outerHeight\" : \"outerWidth\"](true),\n animation = {};\n $.effects.createPlaceholder(element);\n startClip = element.cssClip();\n startRef = element.position()[ref]; // Define hide animation\n\n animation[ref] = (positiveMotion ? -1 : 1) * distance + startRef;\n animation.clip = element.cssClip();\n animation.clip[map[direction][1]] = animation.clip[map[direction][0]]; // Reverse the animation if we're showing\n\n if (mode === \"show\") {\n element.cssClip(animation.clip);\n element.css(ref, animation[ref]);\n animation.clip = startClip;\n animation[ref] = startRef;\n } // Actually animate\n\n\n element.animate(animation, {\n queue: false,\n duration: options.duration,\n easing: options.easing,\n complete: done\n });\n });\n /*!\n * jQuery UI Effects Transfer 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Transfer Effect\n //>>group: Effects\n //>>description: Displays a transfer effect from one element to another.\n //>>docs: http://api.jqueryui.com/transfer-effect/\n //>>demos: http://jqueryui.com/effect/\n\n var effect;\n\n if ($.uiBackCompat !== false) {\n effect = $.effects.define(\"transfer\", function (options, done) {\n $(this).transfer(options, done);\n });\n }\n\n var effectsEffectTransfer = effect;\n /*!\n * jQuery UI Focusable 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: :focusable Selector\n //>>group: Core\n //>>description: Selects elements which can be focused.\n //>>docs: http://api.jqueryui.com/focusable-selector/\n // Selectors\n\n $.ui.focusable = function (element, hasTabindex) {\n var map,\n mapName,\n img,\n focusableIfVisible,\n fieldset,\n nodeName = element.nodeName.toLowerCase();\n\n if (\"area\" === nodeName) {\n map = element.parentNode;\n mapName = map.name;\n\n if (!element.href || !mapName || map.nodeName.toLowerCase() !== \"map\") {\n return false;\n }\n\n img = $(\"img[usemap='#\" + mapName + \"']\");\n return img.length > 0 && img.is(\":visible\");\n }\n\n if (/^(input|select|textarea|button|object)$/.test(nodeName)) {\n focusableIfVisible = !element.disabled;\n\n if (focusableIfVisible) {\n // Form controls within a disabled fieldset are disabled.\n // However, controls within the fieldset's legend do not get disabled.\n // Since controls generally aren't placed inside legends, we skip\n // this portion of the check.\n fieldset = $(element).closest(\"fieldset\")[0];\n\n if (fieldset) {\n focusableIfVisible = !fieldset.disabled;\n }\n }\n } else if (\"a\" === nodeName) {\n focusableIfVisible = element.href || hasTabindex;\n } else {\n focusableIfVisible = hasTabindex;\n }\n\n return focusableIfVisible && $(element).is(\":visible\") && visible($(element));\n }; // Support: IE 8 only\n // IE 8 doesn't resolve inherit to visible/hidden for computed values\n\n\n function visible(element) {\n var visibility = element.css(\"visibility\");\n\n while (visibility === \"inherit\") {\n element = element.parent();\n visibility = element.css(\"visibility\");\n }\n\n return visibility !== \"hidden\";\n }\n\n $.extend($.expr[\":\"], {\n focusable: function focusable(element) {\n return $.ui.focusable(element, $.attr(element, \"tabindex\") != null);\n }\n });\n var focusable = $.ui.focusable; // Support: IE8 Only\n // IE8 does not support the form attribute and when it is supplied. It overwrites the form prop\n // with a string, so we need to find the proper form.\n\n var form = $.fn.form = function () {\n return typeof this[0].form === \"string\" ? this.closest(\"form\") : $(this[0].form);\n };\n /*!\n * jQuery UI Form Reset Mixin 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Form Reset Mixin\n //>>group: Core\n //>>description: Refresh input widgets when their form is reset\n //>>docs: http://api.jqueryui.com/form-reset-mixin/\n\n\n var formResetMixin = $.ui.formResetMixin = {\n _formResetHandler: function _formResetHandler() {\n var form = $(this); // Wait for the form reset to actually happen before refreshing\n\n setTimeout(function () {\n var instances = form.data(\"ui-form-reset-instances\");\n $.each(instances, function () {\n this.refresh();\n });\n });\n },\n _bindFormResetHandler: function _bindFormResetHandler() {\n this.form = this.element.form();\n\n if (!this.form.length) {\n return;\n }\n\n var instances = this.form.data(\"ui-form-reset-instances\") || [];\n\n if (!instances.length) {\n // We don't use _on() here because we use a single event handler per form\n this.form.on(\"reset.ui-form-reset\", this._formResetHandler);\n }\n\n instances.push(this);\n this.form.data(\"ui-form-reset-instances\", instances);\n },\n _unbindFormResetHandler: function _unbindFormResetHandler() {\n if (!this.form.length) {\n return;\n }\n\n var instances = this.form.data(\"ui-form-reset-instances\");\n instances.splice($.inArray(this, instances), 1);\n\n if (instances.length) {\n this.form.data(\"ui-form-reset-instances\", instances);\n } else {\n this.form.removeData(\"ui-form-reset-instances\").off(\"reset.ui-form-reset\");\n }\n }\n };\n /*!\n * jQuery UI Support for jQuery core 1.7.x 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n *\n */\n //>>label: jQuery 1.7 Support\n //>>group: Core\n //>>description: Support version 1.7.x of jQuery core\n // Support: jQuery 1.7 only\n // Not a great way to check versions, but since we only support 1.7+ and only\n // need to detect <1.8, this is a simple check that should suffice. Checking\n // for \"1.7.\" would be a bit safer, but the version string is 1.7, not 1.7.0\n // and we'll never reach 1.70.0 (if we do, we certainly won't be supporting\n // 1.7 anymore). See #11197 for why we're not using feature detection.\n\n if ($.fn.jquery.substring(0, 3) === \"1.7\") {\n // Setters for .innerWidth(), .innerHeight(), .outerWidth(), .outerHeight()\n // Unlike jQuery Core 1.8+, these only support numeric values to set the\n // dimensions in pixels\n $.each([\"Width\", \"Height\"], function (i, name) {\n var side = name === \"Width\" ? [\"Left\", \"Right\"] : [\"Top\", \"Bottom\"],\n type = name.toLowerCase(),\n orig = {\n innerWidth: $.fn.innerWidth,\n innerHeight: $.fn.innerHeight,\n outerWidth: $.fn.outerWidth,\n outerHeight: $.fn.outerHeight\n };\n\n function reduce(elem, size, border, margin) {\n $.each(side, function () {\n size -= parseFloat($.css(elem, \"padding\" + this)) || 0;\n\n if (border) {\n size -= parseFloat($.css(elem, \"border\" + this + \"Width\")) || 0;\n }\n\n if (margin) {\n size -= parseFloat($.css(elem, \"margin\" + this)) || 0;\n }\n });\n return size;\n }\n\n $.fn[\"inner\" + name] = function (size) {\n if (size === undefined) {\n return orig[\"inner\" + name].call(this);\n }\n\n return this.each(function () {\n $(this).css(type, reduce(this, size) + \"px\");\n });\n };\n\n $.fn[\"outer\" + name] = function (size, margin) {\n if (typeof size !== \"number\") {\n return orig[\"outer\" + name].call(this, size);\n }\n\n return this.each(function () {\n $(this).css(type, reduce(this, size, true, margin) + \"px\");\n });\n };\n });\n\n $.fn.addBack = function (selector) {\n return this.add(selector == null ? this.prevObject : this.prevObject.filter(selector));\n };\n }\n\n ;\n /*!\n * jQuery UI Keycode 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Keycode\n //>>group: Core\n //>>description: Provide keycodes as keynames\n //>>docs: http://api.jqueryui.com/jQuery.ui.keyCode/\n\n var keycode = $.ui.keyCode = {\n BACKSPACE: 8,\n COMMA: 188,\n DELETE: 46,\n DOWN: 40,\n END: 35,\n ENTER: 13,\n ESCAPE: 27,\n HOME: 36,\n LEFT: 37,\n PAGE_DOWN: 34,\n PAGE_UP: 33,\n PERIOD: 190,\n RIGHT: 39,\n SPACE: 32,\n TAB: 9,\n UP: 38\n }; // Internal use only\n\n var escapeSelector = $.ui.escapeSelector = function () {\n var selectorEscape = /([!\"#$%&'()*+,./:;<=>?@[\\]^`{|}~])/g;\n return function (selector) {\n return selector.replace(selectorEscape, \"\\\\$1\");\n };\n }();\n /*!\n * jQuery UI Labels 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: labels\n //>>group: Core\n //>>description: Find all the labels associated with a given input\n //>>docs: http://api.jqueryui.com/labels/\n\n\n var labels = $.fn.labels = function () {\n var ancestor, selector, id, labels, ancestors; // Check control.labels first\n\n if (this[0].labels && this[0].labels.length) {\n return this.pushStack(this[0].labels);\n } // Support: IE <= 11, FF <= 37, Android <= 2.3 only\n // Above browsers do not support control.labels. Everything below is to support them\n // as well as document fragments. control.labels does not work on document fragments\n\n\n labels = this.eq(0).parents(\"label\"); // Look for the label based on the id\n\n id = this.attr(\"id\");\n\n if (id) {\n // We don't search against the document in case the element\n // is disconnected from the DOM\n ancestor = this.eq(0).parents().last(); // Get a full set of top level ancestors\n\n ancestors = ancestor.add(ancestor.length ? ancestor.siblings() : this.siblings()); // Create a selector for the label based on the id\n\n selector = \"label[for='\" + $.ui.escapeSelector(id) + \"']\";\n labels = labels.add(ancestors.find(selector).addBack(selector));\n } // Return whatever we have found for labels\n\n\n return this.pushStack(labels);\n };\n /*!\n * jQuery UI Scroll Parent 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: scrollParent\n //>>group: Core\n //>>description: Get the closest ancestor element that is scrollable.\n //>>docs: http://api.jqueryui.com/scrollParent/\n\n\n var scrollParent = $.fn.scrollParent = function (includeHidden) {\n var position = this.css(\"position\"),\n excludeStaticParent = position === \"absolute\",\n overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,\n scrollParent = this.parents().filter(function () {\n var parent = $(this);\n\n if (excludeStaticParent && parent.css(\"position\") === \"static\") {\n return false;\n }\n\n return overflowRegex.test(parent.css(\"overflow\") + parent.css(\"overflow-y\") + parent.css(\"overflow-x\"));\n }).eq(0);\n return position === \"fixed\" || !scrollParent.length ? $(this[0].ownerDocument || document) : scrollParent;\n };\n /*!\n * jQuery UI Tabbable 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: :tabbable Selector\n //>>group: Core\n //>>description: Selects elements which can be tabbed to.\n //>>docs: http://api.jqueryui.com/tabbable-selector/\n\n\n var tabbable = $.extend($.expr[\":\"], {\n tabbable: function tabbable(element) {\n var tabIndex = $.attr(element, \"tabindex\"),\n hasTabindex = tabIndex != null;\n return (!hasTabindex || tabIndex >= 0) && $.ui.focusable(element, hasTabindex);\n }\n });\n /*!\n * jQuery UI Unique ID 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: uniqueId\n //>>group: Core\n //>>description: Functions to generate and remove uniqueId's\n //>>docs: http://api.jqueryui.com/uniqueId/\n\n var uniqueId = $.fn.extend({\n uniqueId: function () {\n var uuid = 0;\n return function () {\n return this.each(function () {\n if (!this.id) {\n this.id = \"ui-id-\" + ++uuid;\n }\n });\n };\n }(),\n removeUniqueId: function removeUniqueId() {\n return this.each(function () {\n if (/^ui-id-\\d+$/.test(this.id)) {\n $(this).removeAttr(\"id\");\n }\n });\n }\n });\n /*!\n * jQuery UI Accordion 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Accordion\n //>>group: Widgets\n // jscs:disable maximumLineLength\n //>>description: Displays collapsible content panels for presenting information in a limited amount of space.\n // jscs:enable maximumLineLength\n //>>docs: http://api.jqueryui.com/accordion/\n //>>demos: http://jqueryui.com/accordion/\n //>>css.structure: ../../themes/base/core.css\n //>>css.structure: ../../themes/base/accordion.css\n //>>css.theme: ../../themes/base/theme.css\n\n var widgetsAccordion = $.widget(\"ui.accordion\", {\n version: \"1.12.1\",\n options: {\n active: 0,\n animate: {},\n classes: {\n \"ui-accordion-header\": \"ui-corner-top\",\n \"ui-accordion-header-collapsed\": \"ui-corner-all\",\n \"ui-accordion-content\": \"ui-corner-bottom\"\n },\n collapsible: false,\n event: \"click\",\n header: \"> li > :first-child, > :not(li):even\",\n heightStyle: \"auto\",\n icons: {\n activeHeader: \"ui-icon-triangle-1-s\",\n header: \"ui-icon-triangle-1-e\"\n },\n // Callbacks\n activate: null,\n beforeActivate: null\n },\n hideProps: {\n borderTopWidth: \"hide\",\n borderBottomWidth: \"hide\",\n paddingTop: \"hide\",\n paddingBottom: \"hide\",\n height: \"hide\"\n },\n showProps: {\n borderTopWidth: \"show\",\n borderBottomWidth: \"show\",\n paddingTop: \"show\",\n paddingBottom: \"show\",\n height: \"show\"\n },\n _create: function _create() {\n var options = this.options;\n this.prevShow = this.prevHide = $();\n\n this._addClass(\"ui-accordion\", \"ui-widget ui-helper-reset\");\n\n this.element.attr(\"role\", \"tablist\"); // Don't allow collapsible: false and active: false / null\n\n if (!options.collapsible && (options.active === false || options.active == null)) {\n options.active = 0;\n }\n\n this._processPanels(); // handle negative values\n\n\n if (options.active < 0) {\n options.active += this.headers.length;\n }\n\n this._refresh();\n },\n _getCreateEventData: function _getCreateEventData() {\n return {\n header: this.active,\n panel: !this.active.length ? $() : this.active.next()\n };\n },\n _createIcons: function _createIcons() {\n var icon,\n children,\n icons = this.options.icons;\n\n if (icons) {\n icon = $(\"\");\n\n this._addClass(icon, \"ui-accordion-header-icon\", \"ui-icon \" + icons.header);\n\n icon.prependTo(this.headers);\n children = this.active.children(\".ui-accordion-header-icon\");\n\n this._removeClass(children, icons.header)._addClass(children, null, icons.activeHeader)._addClass(this.headers, \"ui-accordion-icons\");\n }\n },\n _destroyIcons: function _destroyIcons() {\n this._removeClass(this.headers, \"ui-accordion-icons\");\n\n this.headers.children(\".ui-accordion-header-icon\").remove();\n },\n _destroy: function _destroy() {\n var contents; // Clean up main element\n\n this.element.removeAttr(\"role\"); // Clean up headers\n\n this.headers.removeAttr(\"role aria-expanded aria-selected aria-controls tabIndex\").removeUniqueId();\n\n this._destroyIcons(); // Clean up content panels\n\n\n contents = this.headers.next().css(\"display\", \"\").removeAttr(\"role aria-hidden aria-labelledby\").removeUniqueId();\n\n if (this.options.heightStyle !== \"content\") {\n contents.css(\"height\", \"\");\n }\n },\n _setOption: function _setOption(key, value) {\n if (key === \"active\") {\n // _activate() will handle invalid values and update this.options\n this._activate(value);\n\n return;\n }\n\n if (key === \"event\") {\n if (this.options.event) {\n this._off(this.headers, this.options.event);\n }\n\n this._setupEvents(value);\n }\n\n this._super(key, value); // Setting collapsible: false while collapsed; open first panel\n\n\n if (key === \"collapsible\" && !value && this.options.active === false) {\n this._activate(0);\n }\n\n if (key === \"icons\") {\n this._destroyIcons();\n\n if (value) {\n this._createIcons();\n }\n }\n },\n _setOptionDisabled: function _setOptionDisabled(value) {\n this._super(value);\n\n this.element.attr(\"aria-disabled\", value); // Support: IE8 Only\n // #5332 / #6059 - opacity doesn't cascade to positioned elements in IE\n // so we need to add the disabled class to the headers and panels\n\n this._toggleClass(null, \"ui-state-disabled\", !!value);\n\n this._toggleClass(this.headers.add(this.headers.next()), null, \"ui-state-disabled\", !!value);\n },\n _keydown: function _keydown(event) {\n if (event.altKey || event.ctrlKey) {\n return;\n }\n\n var keyCode = $.ui.keyCode,\n length = this.headers.length,\n currentIndex = this.headers.index(event.target),\n toFocus = false;\n\n switch (event.keyCode) {\n case keyCode.RIGHT:\n case keyCode.DOWN:\n toFocus = this.headers[(currentIndex + 1) % length];\n break;\n\n case keyCode.LEFT:\n case keyCode.UP:\n toFocus = this.headers[(currentIndex - 1 + length) % length];\n break;\n\n case keyCode.SPACE:\n case keyCode.ENTER:\n this._eventHandler(event);\n\n break;\n\n case keyCode.HOME:\n toFocus = this.headers[0];\n break;\n\n case keyCode.END:\n toFocus = this.headers[length - 1];\n break;\n }\n\n if (toFocus) {\n $(event.target).attr(\"tabIndex\", -1);\n $(toFocus).attr(\"tabIndex\", 0);\n $(toFocus).trigger(\"focus\");\n event.preventDefault();\n }\n },\n _panelKeyDown: function _panelKeyDown(event) {\n if (event.keyCode === $.ui.keyCode.UP && event.ctrlKey) {\n $(event.currentTarget).prev().trigger(\"focus\");\n }\n },\n refresh: function refresh() {\n var options = this.options;\n\n this._processPanels(); // Was collapsed or no panel\n\n\n if (options.active === false && options.collapsible === true || !this.headers.length) {\n options.active = false;\n this.active = $(); // active false only when collapsible is true\n } else if (options.active === false) {\n this._activate(0); // was active, but active panel is gone\n\n } else if (this.active.length && !$.contains(this.element[0], this.active[0])) {\n // all remaining panel are disabled\n if (this.headers.length === this.headers.find(\".ui-state-disabled\").length) {\n options.active = false;\n this.active = $(); // activate previous panel\n } else {\n this._activate(Math.max(0, options.active - 1));\n } // was active, active panel still exists\n\n } else {\n // make sure active index is correct\n options.active = this.headers.index(this.active);\n }\n\n this._destroyIcons();\n\n this._refresh();\n },\n _processPanels: function _processPanels() {\n var prevHeaders = this.headers,\n prevPanels = this.panels;\n this.headers = this.element.find(this.options.header);\n\n this._addClass(this.headers, \"ui-accordion-header ui-accordion-header-collapsed\", \"ui-state-default\");\n\n this.panels = this.headers.next().filter(\":not(.ui-accordion-content-active)\").hide();\n\n this._addClass(this.panels, \"ui-accordion-content\", \"ui-helper-reset ui-widget-content\"); // Avoid memory leaks (#10056)\n\n\n if (prevPanels) {\n this._off(prevHeaders.not(this.headers));\n\n this._off(prevPanels.not(this.panels));\n }\n },\n _refresh: function _refresh() {\n var maxHeight,\n options = this.options,\n heightStyle = options.heightStyle,\n parent = this.element.parent();\n this.active = this._findActive(options.active);\n\n this._addClass(this.active, \"ui-accordion-header-active\", \"ui-state-active\")._removeClass(this.active, \"ui-accordion-header-collapsed\");\n\n this._addClass(this.active.next(), \"ui-accordion-content-active\");\n\n this.active.next().show();\n this.headers.attr(\"role\", \"tab\").each(function () {\n var header = $(this),\n headerId = header.uniqueId().attr(\"id\"),\n panel = header.next(),\n panelId = panel.uniqueId().attr(\"id\");\n header.attr(\"aria-controls\", panelId);\n panel.attr(\"aria-labelledby\", headerId);\n }).next().attr(\"role\", \"tabpanel\");\n this.headers.not(this.active).attr({\n \"aria-selected\": \"false\",\n \"aria-expanded\": \"false\",\n tabIndex: -1\n }).next().attr({\n \"aria-hidden\": \"true\"\n }).hide(); // Make sure at least one header is in the tab order\n\n if (!this.active.length) {\n this.headers.eq(0).attr(\"tabIndex\", 0);\n } else {\n this.active.attr({\n \"aria-selected\": \"true\",\n \"aria-expanded\": \"true\",\n tabIndex: 0\n }).next().attr({\n \"aria-hidden\": \"false\"\n });\n }\n\n this._createIcons();\n\n this._setupEvents(options.event);\n\n if (heightStyle === \"fill\") {\n maxHeight = parent.height();\n this.element.siblings(\":visible\").each(function () {\n var elem = $(this),\n position = elem.css(\"position\");\n\n if (position === \"absolute\" || position === \"fixed\") {\n return;\n }\n\n maxHeight -= elem.outerHeight(true);\n });\n this.headers.each(function () {\n maxHeight -= $(this).outerHeight(true);\n });\n this.headers.next().each(function () {\n $(this).height(Math.max(0, maxHeight - $(this).innerHeight() + $(this).height()));\n }).css(\"overflow\", \"auto\");\n } else if (heightStyle === \"auto\") {\n maxHeight = 0;\n this.headers.next().each(function () {\n var isVisible = $(this).is(\":visible\");\n\n if (!isVisible) {\n $(this).show();\n }\n\n maxHeight = Math.max(maxHeight, $(this).css(\"height\", \"\").height());\n\n if (!isVisible) {\n $(this).hide();\n }\n }).height(maxHeight);\n }\n },\n _activate: function _activate(index) {\n var active = this._findActive(index)[0]; // Trying to activate the already active panel\n\n\n if (active === this.active[0]) {\n return;\n } // Trying to collapse, simulate a click on the currently active header\n\n\n active = active || this.active[0];\n\n this._eventHandler({\n target: active,\n currentTarget: active,\n preventDefault: $.noop\n });\n },\n _findActive: function _findActive(selector) {\n return typeof selector === \"number\" ? this.headers.eq(selector) : $();\n },\n _setupEvents: function _setupEvents(event) {\n var events = {\n keydown: \"_keydown\"\n };\n\n if (event) {\n $.each(event.split(\" \"), function (index, eventName) {\n events[eventName] = \"_eventHandler\";\n });\n }\n\n this._off(this.headers.add(this.headers.next()));\n\n this._on(this.headers, events);\n\n this._on(this.headers.next(), {\n keydown: \"_panelKeyDown\"\n });\n\n this._hoverable(this.headers);\n\n this._focusable(this.headers);\n },\n _eventHandler: function _eventHandler(event) {\n var activeChildren,\n clickedChildren,\n options = this.options,\n active = this.active,\n clicked = $(event.currentTarget),\n clickedIsActive = clicked[0] === active[0],\n collapsing = clickedIsActive && options.collapsible,\n toShow = collapsing ? $() : clicked.next(),\n toHide = active.next(),\n eventData = {\n oldHeader: active,\n oldPanel: toHide,\n newHeader: collapsing ? $() : clicked,\n newPanel: toShow\n };\n event.preventDefault();\n\n if ( // click on active header, but not collapsible\n clickedIsActive && !options.collapsible || // allow canceling activation\n this._trigger(\"beforeActivate\", event, eventData) === false) {\n return;\n }\n\n options.active = collapsing ? false : this.headers.index(clicked); // When the call to ._toggle() comes after the class changes\n // it causes a very odd bug in IE 8 (see #6720)\n\n this.active = clickedIsActive ? $() : clicked;\n\n this._toggle(eventData); // Switch classes\n // corner classes on the previously active header stay after the animation\n\n\n this._removeClass(active, \"ui-accordion-header-active\", \"ui-state-active\");\n\n if (options.icons) {\n activeChildren = active.children(\".ui-accordion-header-icon\");\n\n this._removeClass(activeChildren, null, options.icons.activeHeader)._addClass(activeChildren, null, options.icons.header);\n }\n\n if (!clickedIsActive) {\n this._removeClass(clicked, \"ui-accordion-header-collapsed\")._addClass(clicked, \"ui-accordion-header-active\", \"ui-state-active\");\n\n if (options.icons) {\n clickedChildren = clicked.children(\".ui-accordion-header-icon\");\n\n this._removeClass(clickedChildren, null, options.icons.header)._addClass(clickedChildren, null, options.icons.activeHeader);\n }\n\n this._addClass(clicked.next(), \"ui-accordion-content-active\");\n }\n },\n _toggle: function _toggle(data) {\n var toShow = data.newPanel,\n toHide = this.prevShow.length ? this.prevShow : data.oldPanel; // Handle activating a panel during the animation for another activation\n\n this.prevShow.add(this.prevHide).stop(true, true);\n this.prevShow = toShow;\n this.prevHide = toHide;\n\n if (this.options.animate) {\n this._animate(toShow, toHide, data);\n } else {\n toHide.hide();\n toShow.show();\n\n this._toggleComplete(data);\n }\n\n toHide.attr({\n \"aria-hidden\": \"true\"\n });\n toHide.prev().attr({\n \"aria-selected\": \"false\",\n \"aria-expanded\": \"false\"\n }); // if we're switching panels, remove the old header from the tab order\n // if we're opening from collapsed state, remove the previous header from the tab order\n // if we're collapsing, then keep the collapsing header in the tab order\n\n if (toShow.length && toHide.length) {\n toHide.prev().attr({\n \"tabIndex\": -1,\n \"aria-expanded\": \"false\"\n });\n } else if (toShow.length) {\n this.headers.filter(function () {\n return parseInt($(this).attr(\"tabIndex\"), 10) === 0;\n }).attr(\"tabIndex\", -1);\n }\n\n toShow.attr(\"aria-hidden\", \"false\").prev().attr({\n \"aria-selected\": \"true\",\n \"aria-expanded\": \"true\",\n tabIndex: 0\n });\n },\n _animate: function _animate(toShow, toHide, data) {\n var total,\n easing,\n duration,\n that = this,\n adjust = 0,\n boxSizing = toShow.css(\"box-sizing\"),\n down = toShow.length && (!toHide.length || toShow.index() < toHide.index()),\n animate = this.options.animate || {},\n options = down && animate.down || animate,\n complete = function complete() {\n that._toggleComplete(data);\n };\n\n if (typeof options === \"number\") {\n duration = options;\n }\n\n if (typeof options === \"string\") {\n easing = options;\n } // fall back from options to animation in case of partial down settings\n\n\n easing = easing || options.easing || animate.easing;\n duration = duration || options.duration || animate.duration;\n\n if (!toHide.length) {\n return toShow.animate(this.showProps, duration, easing, complete);\n }\n\n if (!toShow.length) {\n return toHide.animate(this.hideProps, duration, easing, complete);\n }\n\n total = toShow.show().outerHeight();\n toHide.animate(this.hideProps, {\n duration: duration,\n easing: easing,\n step: function step(now, fx) {\n fx.now = Math.round(now);\n }\n });\n toShow.hide().animate(this.showProps, {\n duration: duration,\n easing: easing,\n complete: complete,\n step: function step(now, fx) {\n fx.now = Math.round(now);\n\n if (fx.prop !== \"height\") {\n if (boxSizing === \"content-box\") {\n adjust += fx.now;\n }\n } else if (that.options.heightStyle !== \"content\") {\n fx.now = Math.round(total - toHide.outerHeight() - adjust);\n adjust = 0;\n }\n }\n });\n },\n _toggleComplete: function _toggleComplete(data) {\n var toHide = data.oldPanel,\n prev = toHide.prev();\n\n this._removeClass(toHide, \"ui-accordion-content-active\");\n\n this._removeClass(prev, \"ui-accordion-header-active\")._addClass(prev, \"ui-accordion-header-collapsed\"); // Work around for rendering bug in IE (#5421)\n\n\n if (toHide.length) {\n toHide.parent()[0].className = toHide.parent()[0].className;\n }\n\n this._trigger(\"activate\", null, data);\n }\n });\n\n var safeActiveElement = $.ui.safeActiveElement = function (document) {\n var activeElement; // Support: IE 9 only\n // IE9 throws an \"Unspecified error\" accessing document.activeElement from an