{“ast”:null,“code”:“function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }nn/*nUnobtrusive JavaScriptngithub.com/rails/rails/blob/master/actionview/app/assets/javascriptsnReleased under the MIT licensen */n(function () {n var context = this;n (function () {n (function () {n this.Rails = {n linkClickSelector: 'a, a, a:not(), a, a',n buttonClickSelector: {n selector: 'button:not(), button:not()',n exclude: 'form button'n },n inputChangeSelector: 'select, input, textarea',n formSubmitSelector: 'form',n formInputClickSelector: 'form input, form input, form button, form button:not(), input[form], input[form], button[form], button:not()',n formDisableSelector: 'input:enabled, button:enabled, textarea:enabled, input:enabled, button:enabled, textarea:enabled',n formEnableSelector: 'input:disabled, button:disabled, textarea:disabled, input:disabled, button:disabled, textarea:disabled',n fileInputSelector: 'input[type=file]:not()',n linkDisableSelector: 'a, a',n buttonDisableSelector: 'button[data-disable-with], button[data-disable]'n };n }).call(this);n }).call(context);n var Rails = context.Rails;n (function () {n (function () {n var nonce;n nonce = null;nn Rails.loadCSPNonce = function () {n var ref;n return nonce = (ref = document.querySelector("meta")) != null ? ref.content : void 0;n };nn 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;nn 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 };nn expando = '_ujsData';nn Rails.getData = function (element, key) {n var ref;n return (ref = element) != null ? ref : void 0;n };nn Rails.setData = function (element, key, value) {n if (element == null) {n element = {};n }nn return element[key] = value;n };nn Rails.$ = function (selector) {n return Array.prototype.slice.call(document.querySelectorAll(selector));n };n }).call(this);n (function () {n var $, csrfParam, csrfToken;n $ = Rails.$;nn csrfToken = Rails.csrfToken = function () {n var meta;n meta = document.querySelector(‘meta');n return meta && meta.content;n };nn csrfParam = Rails.csrfParam = function () {n var meta;n meta = document.querySelector(’meta');n return meta && meta.content;n };nn Rails.CSRFProtection = function (xhr) {n var token;n token = csrfToken();nn if (token != null) {n return xhr.setRequestHeader('X-CSRF-Token', token);n }n };nn Rails.refreshCSRFTokens = function () {n var param, token;n token = csrfToken();n param = csrfParam();nn 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;nn 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 };nn CustomEvent.prototype = window.Event.prototype;n preventDefault = CustomEvent.prototype.preventDefault;nn CustomEvent.prototype.preventDefault = function () {n var result;n result = preventDefault.call(this);nn if (this.cancelable && !this.defaultPrevented) {n Object.defineProperty(this, 'defaultPrevented', {n get: function get() {n return true;n }n });n }nn return result;n };n }nn fire = Rails.fire = function (obj, name, data) {n var event;n event = new CustomEvent(name, {n bubbles: true,n cancelable: true,n detail: datan });n obj.dispatchEvent(event);n return !event.defaultPrevented;n };nn Rails.stopEverything = function (e) {n fire(e.target, 'ujs:everythingStopped');n e.preventDefault();n e.stopPropagation();n return e.stopImmediatePropagation();n };nn Rails.delegate = function (element, selector, eventType, handler) {n return element.addEventListener(eventType, function (e) {n var target;n target = e.target;nn while (!(!(target instanceof Element) || matches(target, selector))) {n target = target.parentNode;n }nn 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 };nn 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'));nn 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 }nn return typeof options.complete === "function" ? options.complete(xhr, xhr.statusText) : void 0;n });nn if (options.beforeSend != null && !options.beforeSend(xhr, options)) {n return false;n }nn if (xhr.readyState === XMLHttpRequest.OPENED) {n return xhr.send(options.data);n }n };nn prepareOptions = function prepareOptions(options) {n options.url = options.url || location.href;n options.type = options.type.toUpperCase();nn 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 }nn if (AcceptHeaders == null) {n options.dataType = '*';n }nn options.accept = AcceptHeaders;nn if (options.dataType !== '*') {n options.accept += ', /; q=0.01';n }nn return options;n };nn 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);nn if (typeof options.data === 'string') {n xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');n }nn if (!options.crossDomain) {n xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');n }nn CSRFProtection(xhr);n xhr.withCredentials = !!options.withCredentials;nn xhr.onreadystatechange = function () {n if (xhr.readyState === XMLHttpRequest.DONE) {n return done(xhr);n }n };nn return xhr;n };nn processResponse = function processResponse(response, type) {n var parser, script;nn 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(/;.+/, '');nn try {n response = parser.parseFromString(response, type);n } catch (error) {}n }n }nn return response;n };nn Rails.href = function (element) {n return element.href;n };nn Rails.isCrossDomain = function (url) {n var e, originAnchor, urlAnchor;n originAnchor = document.createElement('a');n originAnchor.href = location.href;n urlAnchor = document.createElement('a');nn 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;nn toArray = function toArray(e) {n return Array.prototype.slice.call(e);n };nn Rails.serializeElement = function (element, additionalParam) {n var inputs, params;n inputs = [element];nn if (matches(element, 'form')) {n inputs = toArray(element.elements);n }nn params = [];n inputs.forEach(function (input) {n if (!input.name || input.disabled) {n return;n }nn if (input.closest(‘fieldset')) {n return;n }nn 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.valuen });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.valuen });n }n });nn if (additionalParam) {n params.push(additionalParam);n }nn 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 };nn 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;nn Rails.handleConfirm = function (e) {n if (!allowAction(this)) {n return stopEverything(e);n }n };nn Rails.confirm = function (message, element) {n return confirm(message);n };nn allowAction = function allowAction(element) {n var answer, callback, message;n message = element.getAttribute('data-confirm');nn if (!message) {n return true;n }nn answer = false;nn if (fire(element, 'confirm')) {n try {n answer = Rails.confirm(message, element);n } catch (error) {}nn callback = fire(element, 'confirm:complete', [answer]);n }nn 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;nn Rails.handleDisabledElement = function (e) {n var element;n element = this;nn if (element.disabled) {n return stopEverything(e);n }n };nn Rails.enableElement = function (e) {n var element;nn if (e instanceof Event) {n if (isXhrRedirect(e)) {n return;n }nn element = e.target;n } else {n element = e;n }nn 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 };nn Rails.disableElement = function (e) {n var element;n element = e instanceof Event ? e.target : e;nn 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 };nn disableLinkElement = function disableLinkElement(element) {n var replacement;nn if (getData(element, 'ujs:disabled')) {n return;n }nn replacement = element.getAttribute('data-disable-with');nn if (replacement != null) {n setData(element, 'ujs:enable-with', element.innerHTML);n element.innerHTML = replacement;n }nn element.addEventListener('click', stopEverything);n return setData(element, 'ujs:disabled', true);n };nn enableLinkElement = function enableLinkElement(element) {n var originalText;n originalText = getData(element, 'ujs:enable-with');nn if (originalText != null) {n element.innerHTML = originalText;n setData(element, 'ujs:enable-with', null);n }nn element.removeEventListener('click', stopEverything);n return setData(element, 'ujs:disabled', null);n };nn disableFormElements = function disableFormElements(form) {n return formElements(form, Rails.formDisableSelector).forEach(disableFormElement);n };nn disableFormElement = function disableFormElement(element) {n var replacement;nn if (getData(element, 'ujs:disabled')) {n return;n }nn replacement = element.getAttribute('data-disable-with');nn 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 }nn element.disabled = true;n return setData(element, 'ujs:disabled', true);n };nn enableFormElements = function enableFormElements(form) {n return formElements(form, Rails.formEnableSelector).forEach(enableFormElement);n };nn enableFormElement = function enableFormElement(element) {n var originalText;n originalText = getData(element, 'ujs:enable-with');nn if (originalText != null) {n if (matches(element, 'button')) {n element.innerHTML = originalText;n } else {n element.value = originalText;n }nn setData(element, 'ujs:enable-with', null);n }nn element.disabled = false;n return setData(element, 'ujs:disabled', null);n };nn isXhrRedirect = function isXhrRedirect(event) {n var ref, xhr;n xhr = (ref = event.detail) != null ? ref : 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;nn Rails.handleMethod = function (e) {n var csrfParam, csrfToken, form, formContent, href, link, method;n link = this;n method = link.getAttribute('data-method');nn if (!method) {n return;n }nn href = Rails.href(link);n csrfToken = Rails.csrfToken();n csrfParam = Rails.csrfParam();n form = document.createElement('form');n formContent = "<input name='_method' value='" + method + "' type='hidden' />";nn if (csrfParam != null && csrfToken != null && !Rails.isCrossDomain(href)) {n formContent += "<input name='" + csrfParam + "' value='" + csrfToken + "' type='hidden' />";n }nn formContent += '<input type="submit" />';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(’').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;nn isRemote = function isRemote(element) {n var value;n value = element.getAttribute('data-remote');n return value != null && value !== 'false';n };nn Rails.handleRemote = function (e) {n var button, data, dataType, element, method, url, withCredentials;n element = this;nn if (!isRemote(element)) {n return true;n }nn if (!fire(element, 'ajax:before')) {n fire(element, 'ajax:stopped');n return false;n }nn withCredentials = element.getAttribute('data-with-credentials');n dataType = element.getAttribute('data-type') || 'script';nn 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;nn if (method.toUpperCase() === 'GET') {n url = url.replace(/\?.*$/, '');n }nn if (element.enctype === 'multipart/form-data') {n data = new FormData(element);nn if (button != null) {n data.append(button.name, button.value);n }n } else {n data = serializeElement(element, button);n }nn 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 }nn 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 };nn Rails.formSubmitButtonClick = function (e) {n var button, form;n button = this;n form = button.form;nn if (!form) {n return;n }nn if (button.name) {n setData(form, 'ujs:submit-button', {n name: button.name,n value: button.valuen });n }nn 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 };nn 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;nn 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;nn 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 }nn jQuery.rails = Rails;n jQuery.ajaxPrefilter(function (options, originalOptions, xhr) {n if (!options.crossDomain) {n return CSRFProtection(xhr);n }n });n }nn Rails.start = function () {n if (window._rails_loaded) {n throw new Error('rails-ujs has already been loaded!');n }nn 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 };nn if (window.Rails === Rails && fire(document, 'rails:attachBindings')) {n Rails.start();n }n }).call(this);n }).call(this);nn 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);”,“map”:null,“metadata”:{},“sourceType”:“module”}