{ "version": 3, "sources": ["../../../node_modules/@rails/ujs/lib/assets/compiled/rails-ujs.js", "../../../node_modules/@rails/activestorage/app/assets/javascripts/activestorage.js", "../../../node_modules/jquery/dist/jquery.js", "../../javascript/external/jquery.tablesorter.combined.js", "../../javascript/external/bootstrap_datepicker.js", "../../javascript/application.js", "../../javascript/jquery.js", "../../../node_modules/bootstrap-sass/assets/javascripts/bootstrap.js", "../../javascript/external/formValidation.js", "../../javascript/external/formValidation-bootstrap.js", "../../javascript/external/redactor.js", "../../javascript/external/redactor_fontsize.js", "../../javascript/external/redactor_table.js", "../../javascript/external/redactor_imagemanager.js", "../../javascript/external/redactor_video.js", "../../javascript/external/bootstrap-editable.js", "../../../node_modules/@yaireo/tagify/dist/src/parts/constants.js", "../../../node_modules/@yaireo/tagify/dist/src/parts/helpers.js", "../../../node_modules/@yaireo/tagify/dist/src/parts/defaults.js", "../../../node_modules/@yaireo/tagify/dist/src/parts/dropdown.js", "../../../node_modules/@yaireo/tagify/dist/src/parts/suggestions.js", "../../../node_modules/@yaireo/tagify/dist/src/parts/persist.js", "../../../node_modules/@yaireo/tagify/dist/src/parts/texts.js", "../../../node_modules/@yaireo/tagify/dist/src/parts/templates.js", "../../../node_modules/@yaireo/tagify/dist/src/parts/events.js", "../../../node_modules/@yaireo/tagify/dist/src/tagify.js", "../../../node_modules/@yaireo/tagify/dist/src/parts/EventDispatcher.js", "../../javascript/tags.js", "../../../node_modules/@googlemaps/js-api-loader/node_modules/tslib/tslib.es6.js", "../../../node_modules/@googlemaps/js-api-loader/node_modules/fast-deep-equal/index.js", "../../../node_modules/@googlemaps/js-api-loader/src/index.ts", "../../javascript/packs/address_autocomplete.js"], "sourcesContent": ["/*\nUnobtrusive JavaScript\nhttps://github.com/rails/rails/blob/main/actionview/app/assets/javascripts\nReleased under the MIT license\n */;\n\n(function() {\n var context = this;\n\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:not([data-turbo=true])',\n formInputClickSelector: 'form:not([data-turbo=true]) input[type=submit], form:not([data-turbo=true]) input[type=image], form:not([data-turbo=true]) button[type=submit], form:not([data-turbo=true]) 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\n }).call(this);\n }).call(context);\n\n var Rails = context.Rails;\n\n (function() {\n (function() {\n var nonce;\n\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\n }).call(this);\n (function() {\n var expando, m;\n\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 return element[expando][key] = value;\n };\n\n Rails.isContentEditable = function(element) {\n var isEditable;\n isEditable = false;\n while (true) {\n if (element.isContentEditable) {\n isEditable = true;\n break;\n }\n element = element.parentElement;\n if (!element) {\n break;\n }\n }\n return isEditable;\n };\n\n Rails.$ = function(selector) {\n return Array.prototype.slice.call(document.querySelectorAll(selector));\n };\n\n }).call(this);\n (function() {\n var $, csrfParam, csrfToken;\n\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 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 if ((token != null) && (param != null)) {\n return $('form input[name=\"' + param + '\"]').forEach(function(input) {\n return input.value = token;\n });\n }\n };\n\n }).call(this);\n (function() {\n var CustomEvent, fire, matches, preventDefault;\n\n matches = Rails.matches;\n\n CustomEvent = window.CustomEvent;\n\n if (typeof CustomEvent !== 'function') {\n CustomEvent = function(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 CustomEvent.prototype = window.Event.prototype;\n preventDefault = CustomEvent.prototype.preventDefault;\n CustomEvent.prototype.preventDefault = function() {\n var result;\n result = preventDefault.call(this);\n if (this.cancelable && !this.defaultPrevented) {\n Object.defineProperty(this, 'defaultPrevented', {\n get: function() {\n return true;\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 while (!(!(target instanceof Element) || matches(target, selector))) {\n target = target.parentNode;\n }\n if (target instanceof Element && handler.call(target, e) === false) {\n e.preventDefault();\n return e.stopPropagation();\n }\n });\n };\n\n }).call(this);\n (function() {\n var AcceptHeaders, CSRFProtection, createXHR, cspNonce, fire, prepareOptions, processResponse;\n\n cspNonce = Rails.cspNonce, CSRFProtection = Rails.CSRFProtection, fire = Rails.fire;\n\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 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 return typeof options.complete === \"function\" ? options.complete(xhr, xhr.statusText) : void 0;\n });\n if ((options.beforeSend != null) && !options.beforeSend(xhr, options)) {\n return false;\n }\n if (xhr.readyState === XMLHttpRequest.OPENED) {\n return xhr.send(options.data);\n }\n };\n\n prepareOptions = function(options) {\n options.url = options.url || location.href;\n options.type = options.type.toUpperCase();\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 if (AcceptHeaders[options.dataType] == null) {\n options.dataType = '*';\n }\n options.accept = AcceptHeaders[options.dataType];\n if (options.dataType !== '*') {\n options.accept += ', */*; q=0.01';\n }\n return options;\n };\n\n createXHR = function(options, done) {\n var xhr;\n xhr = new XMLHttpRequest();\n xhr.open(options.type, options.url, true);\n xhr.setRequestHeader('Accept', options.accept);\n if (typeof options.data === 'string') {\n xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');\n }\n if (!options.crossDomain) {\n xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n CSRFProtection(xhr);\n }\n xhr.withCredentials = !!options.withCredentials;\n xhr.onreadystatechange = function() {\n if (xhr.readyState === XMLHttpRequest.DONE) {\n return done(xhr);\n }\n };\n return xhr;\n };\n\n processResponse = function(response, type) {\n var parser, script;\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 try {\n response = parser.parseFromString(response, type);\n } catch (error) {}\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 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\n }).call(this);\n (function() {\n var matches, toArray;\n\n matches = Rails.matches;\n\n toArray = function(e) {\n return Array.prototype.slice.call(e);\n };\n\n Rails.serializeElement = function(element, additionalParam) {\n var inputs, params;\n inputs = [element];\n if (matches(element, 'form')) {\n inputs = toArray(element.elements);\n }\n params = [];\n inputs.forEach(function(input) {\n if (!input.name || input.disabled) {\n return;\n }\n if (matches(input, 'fieldset[disabled] *')) {\n return;\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 if (additionalParam) {\n params.push(additionalParam);\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\n }).call(this);\n (function() {\n var allowAction, fire, stopEverything;\n\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(element) {\n var answer, callback, message;\n message = element.getAttribute('data-confirm');\n if (!message) {\n return true;\n }\n answer = false;\n if (fire(element, 'confirm')) {\n try {\n answer = Rails.confirm(message, element);\n } catch (error) {}\n callback = fire(element, 'confirm:complete', [answer]);\n }\n return answer && callback;\n };\n\n }).call(this);\n (function() {\n var disableFormElement, disableFormElements, disableLinkElement, enableFormElement, enableFormElements, enableLinkElement, formElements, getData, isContentEditable, isXhrRedirect, matches, setData, stopEverything;\n\n matches = Rails.matches, getData = Rails.getData, setData = Rails.setData, stopEverything = Rails.stopEverything, formElements = Rails.formElements, isContentEditable = Rails.isContentEditable;\n\n Rails.handleDisabledElement = function(e) {\n var element;\n element = this;\n if (element.disabled) {\n return stopEverything(e);\n }\n };\n\n Rails.enableElement = function(e) {\n var element;\n if (e instanceof Event) {\n if (isXhrRedirect(e)) {\n return;\n }\n element = e.target;\n } else {\n element = e;\n }\n if (isContentEditable(element)) {\n return;\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 if (isContentEditable(element)) {\n return;\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(element) {\n var replacement;\n if (getData(element, 'ujs:disabled')) {\n return;\n }\n replacement = element.getAttribute('data-disable-with');\n if (replacement != null) {\n setData(element, 'ujs:enable-with', element.innerHTML);\n element.innerHTML = replacement;\n }\n element.addEventListener('click', stopEverything);\n return setData(element, 'ujs:disabled', true);\n };\n\n enableLinkElement = function(element) {\n var originalText;\n originalText = getData(element, 'ujs:enable-with');\n if (originalText != null) {\n element.innerHTML = originalText;\n setData(element, 'ujs:enable-with', null);\n }\n element.removeEventListener('click', stopEverything);\n return setData(element, 'ujs:disabled', null);\n };\n\n disableFormElements = function(form) {\n return formElements(form, Rails.formDisableSelector).forEach(disableFormElement);\n };\n\n disableFormElement = function(element) {\n var replacement;\n if (getData(element, 'ujs:disabled')) {\n return;\n }\n replacement = element.getAttribute('data-disable-with');\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 element.disabled = true;\n return setData(element, 'ujs:disabled', true);\n };\n\n enableFormElements = function(form) {\n return formElements(form, Rails.formEnableSelector).forEach(enableFormElement);\n };\n\n enableFormElement = function(element) {\n var originalText;\n originalText = getData(element, 'ujs:enable-with');\n if (originalText != null) {\n if (matches(element, 'button')) {\n element.innerHTML = originalText;\n } else {\n element.value = originalText;\n }\n setData(element, 'ujs:enable-with', null);\n }\n element.disabled = false;\n return setData(element, 'ujs:disabled', null);\n };\n\n isXhrRedirect = function(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\n }).call(this);\n (function() {\n var isContentEditable, stopEverything;\n\n stopEverything = Rails.stopEverything;\n\n isContentEditable = Rails.isContentEditable;\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 if (!method) {\n return;\n }\n if (isContentEditable(this)) {\n return;\n }\n href = Rails.href(link);\n csrfToken = Rails.csrfToken();\n csrfParam = Rails.csrfParam();\n form = document.createElement('form');\n formContent = \"\";\n if ((csrfParam != null) && (csrfToken != null) && !Rails.isCrossDomain(href)) {\n formContent += \"\";\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\n }).call(this);\n (function() {\n var ajax, fire, getData, isContentEditable, isCrossDomain, isRemote, matches, serializeElement, setData, stopEverything,\n slice = [].slice;\n\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, isContentEditable = Rails.isContentEditable;\n\n isRemote = function(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 if (!isRemote(element)) {\n return true;\n }\n if (!fire(element, 'ajax:before')) {\n fire(element, 'ajax:stopped');\n return false;\n }\n if (isContentEditable(element)) {\n fire(element, 'ajax:stopped');\n return false;\n }\n withCredentials = element.getAttribute('data-with-credentials');\n dataType = element.getAttribute('data-type') || 'script';\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 if (method.toUpperCase() === 'GET') {\n url = url.replace(/\\?.*$/, '');\n }\n if (element.enctype === 'multipart/form-data') {\n data = new FormData(element);\n if (button != null) {\n data.append(button.name, button.value);\n }\n } else {\n data = serializeElement(element, button);\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 ajax({\n type: method || 'GET',\n url: url,\n data: data,\n dataType: dataType,\n beforeSend: function(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() {\n var args;\n args = 1 <= arguments.length ? slice.call(arguments, 0) : [];\n return fire(element, 'ajax:success', args);\n },\n error: function() {\n var args;\n args = 1 <= arguments.length ? slice.call(arguments, 0) : [];\n return fire(element, 'ajax:error', args);\n },\n complete: function() {\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 if (!form) {\n return;\n }\n if (button.name) {\n setData(form, 'ujs:submit-button', {\n name: button.name,\n value: button.value\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 if (nonPrimaryMouseClick || insignificantMetaClick) {\n return e.stopImmediatePropagation();\n }\n };\n\n }).call(this);\n (function() {\n var $, CSRFProtection, delegate, disableElement, enableElement, fire, formSubmitButtonClick, getData, handleConfirm, handleDisabledElement, handleMethod, handleRemote, loadCSPNonce, preventInsignificantClick, refreshCSRFTokens;\n\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 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 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\n }).call(this);\n }).call(this);\n\n if (typeof module === \"object\" && module.exports) {\n module.exports = Rails;\n } else if (typeof define === \"function\" && define.amd) {\n define(Rails);\n }\n}).call(this);\n", "(function(global, factory) {\n 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 function createCommonjsModule(fn, module) {\n return module = {\n exports: {}\n }, fn(module, module.exports), module.exports;\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 function md5cycle(x, k) {\n var a = x[0], b = x[1], c = x[2], 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 function md5blk(s) {\n var md5blks = [], i;\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 return md5blks;\n }\n function md5blk_array(a) {\n var md5blks = [], i;\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 return md5blks;\n }\n function md51(s) {\n var n = s.length, state = [ 1732584193, -271733879, -1732584194, 271733878 ], i, length, tail, tmp, lo, hi;\n for (i = 64; i <= n; i += 64) {\n md5cycle(state, md5blk(s.substring(i - 64, i)));\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 for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= s.charCodeAt(i) << (i % 4 << 3);\n }\n tail[i >> 2] |= 128 << (i % 4 << 3);\n if (i > 55) {\n md5cycle(state, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\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 function md51_array(a) {\n var n = a.length, state = [ 1732584193, -271733879, -1732584194, 271733878 ], i, length, tail, tmp, lo, hi;\n for (i = 64; i <= n; i += 64) {\n md5cycle(state, md5blk_array(a.subarray(i - 64, i)));\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 for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= a[i] << (i % 4 << 3);\n }\n tail[i >> 2] |= 128 << (i % 4 << 3);\n if (i > 55) {\n md5cycle(state, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\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 function rhex(n) {\n var s = \"\", j;\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 return s;\n }\n function hex(x) {\n var i;\n for (i = 0; i < x.length; i += 1) {\n x[i] = rhex(x[i]);\n }\n return x.join(\"\");\n }\n if (hex(md51(\"hello\")) !== \"5d41402abc4b2a76b9719d911017c592\") ;\n if (typeof ArrayBuffer !== \"undefined\" && !ArrayBuffer.prototype.slice) {\n (function() {\n function clamp(val, length) {\n val = val | 0 || 0;\n if (val < 0) {\n return Math.max(val + length, 0);\n }\n return Math.min(val, length);\n }\n ArrayBuffer.prototype.slice = function(from, to) {\n var length = this.byteLength, begin = clamp(from, length), end = length, num, target, targetArray, sourceArray;\n if (to !== undefined) {\n end = clamp(to, length);\n }\n if (begin > end) {\n return new ArrayBuffer(0);\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 function toUtf8(str) {\n if (/[\\u0080-\\uFFFF]/.test(str)) {\n str = unescape(encodeURIComponent(str));\n }\n return str;\n }\n function utf8Str2ArrayBuffer(str, returnUInt8Array) {\n var length = str.length, buff = new ArrayBuffer(length), arr = new Uint8Array(buff), i;\n for (i = 0; i < length; i += 1) {\n arr[i] = str.charCodeAt(i);\n }\n return returnUInt8Array ? arr : buff;\n }\n function arrayBuffer2Utf8Str(buff) {\n return String.fromCharCode.apply(null, new Uint8Array(buff));\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 function hexToBinaryString(hex) {\n var bytes = [], length = hex.length, x;\n for (x = 0; x < length - 1; x += 2) {\n bytes.push(parseInt(hex.substr(x, 2), 16));\n }\n return String.fromCharCode.apply(String, bytes);\n }\n function SparkMD5() {\n this.reset();\n }\n SparkMD5.prototype.append = function(str) {\n this.appendBinary(toUtf8(str));\n return this;\n };\n SparkMD5.prototype.appendBinary = function(contents) {\n this._buff += contents;\n this._length += contents.length;\n var length = this._buff.length, i;\n for (i = 64; i <= length; i += 64) {\n md5cycle(this._hash, md5blk(this._buff.substring(i - 64, i)));\n }\n this._buff = this._buff.substring(i - 64);\n return this;\n };\n SparkMD5.prototype.end = function(raw) {\n var buff = this._buff, length = buff.length, i, tail = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], ret;\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= buff.charCodeAt(i) << (i % 4 << 3);\n }\n this._finish(tail, length);\n ret = hex(this._hash);\n if (raw) {\n ret = hexToBinaryString(ret);\n }\n this.reset();\n return ret;\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 SparkMD5.prototype.getState = function() {\n return {\n buff: this._buff,\n length: this._length,\n hash: this._hash\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 SparkMD5.prototype.destroy = function() {\n delete this._hash;\n delete this._buff;\n delete this._length;\n };\n SparkMD5.prototype._finish = function(tail, length) {\n var i = length, tmp, lo, hi;\n tail[i >> 2] |= 128 << (i % 4 << 3);\n if (i > 55) {\n md5cycle(this._hash, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\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 SparkMD5.hash = function(str, raw) {\n return SparkMD5.hashBinary(toUtf8(str), raw);\n };\n SparkMD5.hashBinary = function(content, raw) {\n var hash = md51(content), ret = hex(hash);\n return raw ? hexToBinaryString(ret) : ret;\n };\n SparkMD5.ArrayBuffer = function() {\n this.reset();\n };\n SparkMD5.ArrayBuffer.prototype.append = function(arr) {\n var buff = concatenateArrayBuffers(this._buff.buffer, arr, true), length = buff.length, i;\n this._length += arr.byteLength;\n for (i = 64; i <= length; i += 64) {\n md5cycle(this._hash, md5blk_array(buff.subarray(i - 64, i)));\n }\n this._buff = i - 64 < length ? new Uint8Array(buff.buffer.slice(i - 64)) : new Uint8Array(0);\n return this;\n };\n SparkMD5.ArrayBuffer.prototype.end = function(raw) {\n var buff = this._buff, length = buff.length, tail = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], i, ret;\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= buff[i] << (i % 4 << 3);\n }\n this._finish(tail, length);\n ret = hex(this._hash);\n if (raw) {\n ret = hexToBinaryString(ret);\n }\n this.reset();\n return ret;\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 SparkMD5.ArrayBuffer.prototype.getState = function() {\n var state = SparkMD5.prototype.getState.call(this);\n state.buff = arrayBuffer2Utf8Str(state.buff);\n return state;\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 SparkMD5.ArrayBuffer.prototype.destroy = SparkMD5.prototype.destroy;\n SparkMD5.ArrayBuffer.prototype._finish = SparkMD5.prototype._finish;\n SparkMD5.ArrayBuffer.hash = function(arr, raw) {\n var hash = md51_array(new Uint8Array(arr)), ret = hex(hash);\n return raw ? hexToBinaryString(ret) : ret;\n };\n return SparkMD5;\n });\n });\n var classCallCheck = function(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\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 return function(Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n }();\n var fileSlice = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice;\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 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 createClass(FileChecksum, [ {\n key: \"create\",\n value: function create(callback) {\n var _this = this;\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 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 function getMetaValue(name) {\n var element = findElement(document.head, 'meta[name=\"' + name + '\"]');\n if (element) {\n return element.getAttribute(\"content\");\n }\n }\n function findElements(root, selector) {\n if (typeof root == \"string\") {\n selector = root;\n root = document;\n }\n var elements = root.querySelectorAll(selector);\n return toArray$1(elements);\n }\n function findElement(root, selector) {\n if (typeof root == \"string\") {\n selector = root;\n root = document;\n }\n return root.querySelector(selector);\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, cancelable = eventInit.cancelable, detail = eventInit.detail;\n var event = document.createEvent(\"Event\");\n event.initEvent(type, bubbles || true, cancelable || true);\n event.detail = detail || {};\n try {\n element.disabled = false;\n element.dispatchEvent(event);\n } finally {\n element.disabled = disabled;\n }\n return event;\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 var BlobRecord = function() {\n function BlobRecord(file, checksum, url) {\n var _this = this;\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 if (csrfToken != undefined) {\n this.xhr.setRequestHeader(\"X-CSRF-Token\", csrfToken);\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 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 for (var key in this.attributes) {\n result[key] = this.attributes[key];\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, responseType = _xhr.responseType, response = _xhr.response;\n if (responseType == \"json\") {\n return response;\n } else {\n return JSON.parse(response);\n }\n }\n } ]);\n return BlobRecord;\n }();\n var BlobUpload = function() {\n function BlobUpload(blob) {\n var _this = this;\n classCallCheck(this, BlobUpload);\n this.blob = blob;\n this.file = blob.file;\n var _blob$directUploadDat = blob.directUploadData, url = _blob$directUploadDat.url, headers = _blob$directUploadDat.headers;\n this.xhr = new XMLHttpRequest();\n this.xhr.open(\"PUT\", url, true);\n this.xhr.responseType = \"text\";\n for (var key in headers) {\n this.xhr.setRequestHeader(key, headers[key]);\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 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, status = _xhr.status, response = _xhr.response;\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 var id = 0;\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 createClass(DirectUpload, [ {\n key: \"create\",\n value: function create(callback) {\n var _this = this;\n FileChecksum.create(this.file, function(error, checksum) {\n if (error) {\n callback(error);\n return;\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 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 return object[methodName].apply(object, messages);\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 createClass(DirectUploadController, [ {\n key: \"start\",\n value: function start(callback) {\n var _this = this;\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 _this.dispatchError(error);\n } else {\n hiddenInput.value = attributes.signed_id;\n }\n _this.dispatch(\"end\");\n callback(error);\n });\n }\n }, {\n key: \"uploadRequestDidProgress\",\n value: function uploadRequestDidProgress(event) {\n var progress = event.loaded / event.total * 100;\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 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 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 var inputSelector = \"input[type=file][data-direct-upload-url]:not([disabled])\";\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 createClass(DirectUploadsController, [ {\n key: \"start\",\n value: function start(callback) {\n var _this = this;\n var controllers = this.createDirectUploadControllers();\n var startNextController = function startNextController() {\n var controller = controllers.shift();\n if (controller) {\n controller.start(function(error) {\n if (error) {\n callback(error);\n _this.dispatch(\"end\");\n } else {\n startNextController();\n }\n });\n } else {\n callback();\n _this.dispatch(\"end\");\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 var processingAttribute = \"data-direct-uploads-processing\";\n var submitButtonsByForm = new WeakMap();\n var started = false;\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 function didClick(event) {\n var target = event.target;\n if ((target.tagName == \"INPUT\" || target.tagName == \"BUTTON\") && target.type == \"submit\" && target.form) {\n submitButtonsByForm.set(target.form, target);\n }\n }\n function didSubmitForm(event) {\n handleFormSubmissionEvent(event);\n }\n function didSubmitRemoteElement(event) {\n if (event.target.tagName == \"FORM\") {\n handleFormSubmissionEvent(event);\n }\n }\n function handleFormSubmissionEvent(event) {\n var form = event.target;\n if (form.hasAttribute(processingAttribute)) {\n event.preventDefault();\n return;\n }\n var controller = new DirectUploadsController(form);\n var inputs = controller.inputs;\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 if (error) {\n inputs.forEach(enable);\n } else {\n submitForm(form);\n }\n });\n }\n }\n function submitForm(form) {\n var button = submitButtonsByForm.get(form) || findElement(form, \"input[type=submit], button[type=submit]\");\n if (button) {\n var _button = button, 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 submitButtonsByForm.delete(form);\n }\n function disable(input) {\n input.disabled = true;\n }\n function enable(input) {\n input.disabled = false;\n }\n function autostart() {\n if (window.ActiveStorage) {\n start();\n }\n }\n setTimeout(autostart, 1);\n exports.start = start;\n exports.DirectUpload = DirectUpload;\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n});\n", "/*!\n * jQuery JavaScript Library v3.7.1\n * https://jquery.com/\n *\n * Copyright OpenJS Foundation and other contributors\n * Released under the MIT license\n * https://jquery.org/license\n *\n * Date: 2023-08-28T13:37Z\n */\n( function( global, factory ) {\n\n\t\"use strict\";\n\n\tif ( typeof module === \"object\" && typeof module.exports === \"object\" ) {\n\n\t\t// For CommonJS and CommonJS-like environments where a proper `window`\n\t\t// is present, execute the factory and get jQuery.\n\t\t// For environments that do not have a `window` with a `document`\n\t\t// (such as Node.js), expose a factory as module.exports.\n\t\t// This accentuates the need for the creation of a real `window`.\n\t\t// e.g. var jQuery = require(\"jquery\")(window);\n\t\t// See ticket trac-14549 for more info.\n\t\tmodule.exports = global.document ?\n\t\t\tfactory( global, true ) :\n\t\t\tfunction( w ) {\n\t\t\t\tif ( !w.document ) {\n\t\t\t\t\tthrow new Error( \"jQuery requires a window with a document\" );\n\t\t\t\t}\n\t\t\t\treturn factory( w );\n\t\t\t};\n\t} else {\n\t\tfactory( global );\n\t}\n\n// Pass this if window is not defined yet\n} )( typeof window !== \"undefined\" ? window : this, function( window, noGlobal ) {\n\n// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1\n// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode\n// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common\n// enough that all such attempts are guarded in a try block.\n\"use strict\";\n\nvar arr = [];\n\nvar getProto = Object.getPrototypeOf;\n\nvar slice = arr.slice;\n\nvar flat = arr.flat ? function( array ) {\n\treturn arr.flat.call( array );\n} : function( array ) {\n\treturn arr.concat.apply( [], array );\n};\n\n\nvar push = arr.push;\n\nvar indexOf = arr.indexOf;\n\nvar class2type = {};\n\nvar toString = class2type.toString;\n\nvar hasOwn = class2type.hasOwnProperty;\n\nvar fnToString = hasOwn.toString;\n\nvar ObjectFunctionString = fnToString.call( Object );\n\nvar support = {};\n\nvar isFunction = function isFunction( obj ) {\n\n\t\t// Support: Chrome <=57, Firefox <=52\n\t\t// In some browsers, typeof returns \"function\" for HTML elements\n\t\t// (i.e., `typeof document.createElement( \"object\" ) === \"function\"`).\n\t\t// We don't want to classify *any* DOM node as a function.\n\t\t// Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5\n\t\t// Plus for old WebKit, typeof returns \"function\" for HTML collections\n\t\t// (e.g., `typeof document.getElementsByTagName(\"div\") === \"function\"`). (gh-4756)\n\t\treturn typeof obj === \"function\" && typeof obj.nodeType !== \"number\" &&\n\t\t\ttypeof obj.item !== \"function\";\n\t};\n\n\nvar isWindow = function isWindow( obj ) {\n\t\treturn obj != null && obj === obj.window;\n\t};\n\n\nvar document = window.document;\n\n\n\n\tvar preservedScriptAttributes = {\n\t\ttype: true,\n\t\tsrc: true,\n\t\tnonce: true,\n\t\tnoModule: true\n\t};\n\n\tfunction DOMEval( code, node, doc ) {\n\t\tdoc = doc || document;\n\n\t\tvar i, val,\n\t\t\tscript = doc.createElement( \"script\" );\n\n\t\tscript.text = code;\n\t\tif ( node ) {\n\t\t\tfor ( i in preservedScriptAttributes ) {\n\n\t\t\t\t// Support: Firefox 64+, Edge 18+\n\t\t\t\t// Some browsers don't support the \"nonce\" property on scripts.\n\t\t\t\t// On the other hand, just using `getAttribute` is not enough as\n\t\t\t\t// the `nonce` attribute is reset to an empty string whenever it\n\t\t\t\t// becomes browsing-context connected.\n\t\t\t\t// See https://github.com/whatwg/html/issues/2369\n\t\t\t\t// See https://html.spec.whatwg.org/#nonce-attributes\n\t\t\t\t// The `node.getAttribute` check was added for the sake of\n\t\t\t\t// `jQuery.globalEval` so that it can fake a nonce-containing node\n\t\t\t\t// via an object.\n\t\t\t\tval = node[ i ] || node.getAttribute && node.getAttribute( i );\n\t\t\t\tif ( val ) {\n\t\t\t\t\tscript.setAttribute( i, val );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdoc.head.appendChild( script ).parentNode.removeChild( script );\n\t}\n\n\nfunction toType( obj ) {\n\tif ( obj == null ) {\n\t\treturn obj + \"\";\n\t}\n\n\t// Support: Android <=2.3 only (functionish RegExp)\n\treturn typeof obj === \"object\" || typeof obj === \"function\" ?\n\t\tclass2type[ toString.call( obj ) ] || \"object\" :\n\t\ttypeof obj;\n}\n/* global Symbol */\n// Defining this global in .eslintrc.json would create a danger of using the global\n// unguarded in another place, it seems safer to define global only for this module\n\n\n\nvar version = \"3.7.1\",\n\n\trhtmlSuffix = /HTML$/i,\n\n\t// Define a local copy of jQuery\n\tjQuery = function( selector, context ) {\n\n\t\t// The jQuery object is actually just the init constructor 'enhanced'\n\t\t// Need init if jQuery is called (just allow error to be thrown if not included)\n\t\treturn new jQuery.fn.init( selector, context );\n\t};\n\njQuery.fn = jQuery.prototype = {\n\n\t// The current version of jQuery being used\n\tjquery: version,\n\n\tconstructor: jQuery,\n\n\t// The default length of a jQuery object is 0\n\tlength: 0,\n\n\ttoArray: function() {\n\t\treturn slice.call( this );\n\t},\n\n\t// Get the Nth element in the matched element set OR\n\t// Get the whole matched element set as a clean array\n\tget: function( num ) {\n\n\t\t// Return all the elements in a clean array\n\t\tif ( num == null ) {\n\t\t\treturn slice.call( this );\n\t\t}\n\n\t\t// Return just the one element from the set\n\t\treturn num < 0 ? this[ num + this.length ] : this[ num ];\n\t},\n\n\t// Take an array of elements and push it onto the stack\n\t// (returning the new matched element set)\n\tpushStack: function( elems ) {\n\n\t\t// Build a new jQuery matched element set\n\t\tvar ret = jQuery.merge( this.constructor(), elems );\n\n\t\t// Add the old object onto the stack (as a reference)\n\t\tret.prevObject = this;\n\n\t\t// Return the newly-formed element set\n\t\treturn ret;\n\t},\n\n\t// Execute a callback for every element in the matched set.\n\teach: function( callback ) {\n\t\treturn jQuery.each( this, callback );\n\t},\n\n\tmap: function( callback ) {\n\t\treturn this.pushStack( jQuery.map( this, function( elem, i ) {\n\t\t\treturn callback.call( elem, i, elem );\n\t\t} ) );\n\t},\n\n\tslice: function() {\n\t\treturn this.pushStack( slice.apply( this, arguments ) );\n\t},\n\n\tfirst: function() {\n\t\treturn this.eq( 0 );\n\t},\n\n\tlast: function() {\n\t\treturn this.eq( -1 );\n\t},\n\n\teven: function() {\n\t\treturn this.pushStack( jQuery.grep( this, function( _elem, i ) {\n\t\t\treturn ( i + 1 ) % 2;\n\t\t} ) );\n\t},\n\n\todd: function() {\n\t\treturn this.pushStack( jQuery.grep( this, function( _elem, i ) {\n\t\t\treturn i % 2;\n\t\t} ) );\n\t},\n\n\teq: function( i ) {\n\t\tvar len = this.length,\n\t\t\tj = +i + ( i < 0 ? len : 0 );\n\t\treturn this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );\n\t},\n\n\tend: function() {\n\t\treturn this.prevObject || this.constructor();\n\t},\n\n\t// For internal use only.\n\t// Behaves like an Array's method, not like a jQuery method.\n\tpush: push,\n\tsort: arr.sort,\n\tsplice: arr.splice\n};\n\njQuery.extend = jQuery.fn.extend = function() {\n\tvar options, name, src, copy, copyIsArray, clone,\n\t\ttarget = arguments[ 0 ] || {},\n\t\ti = 1,\n\t\tlength = arguments.length,\n\t\tdeep = false;\n\n\t// Handle a deep copy situation\n\tif ( typeof target === \"boolean\" ) {\n\t\tdeep = target;\n\n\t\t// Skip the boolean and the target\n\t\ttarget = arguments[ i ] || {};\n\t\ti++;\n\t}\n\n\t// Handle case when target is a string or something (possible in deep copy)\n\tif ( typeof target !== \"object\" && !isFunction( target ) ) {\n\t\ttarget = {};\n\t}\n\n\t// Extend jQuery itself if only one argument is passed\n\tif ( i === length ) {\n\t\ttarget = this;\n\t\ti--;\n\t}\n\n\tfor ( ; i < length; i++ ) {\n\n\t\t// Only deal with non-null/undefined values\n\t\tif ( ( options = arguments[ i ] ) != null ) {\n\n\t\t\t// Extend the base object\n\t\t\tfor ( name in options ) {\n\t\t\t\tcopy = options[ name ];\n\n\t\t\t\t// Prevent Object.prototype pollution\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif ( name === \"__proto__\" || target === copy ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\tif ( deep && copy && ( jQuery.isPlainObject( copy ) ||\n\t\t\t\t\t( copyIsArray = Array.isArray( copy ) ) ) ) {\n\t\t\t\t\tsrc = target[ name ];\n\n\t\t\t\t\t// Ensure proper type for the source value\n\t\t\t\t\tif ( copyIsArray && !Array.isArray( src ) ) {\n\t\t\t\t\t\tclone = [];\n\t\t\t\t\t} else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {\n\t\t\t\t\t\tclone = {};\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclone = src;\n\t\t\t\t\t}\n\t\t\t\t\tcopyIsArray = false;\n\n\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\ttarget[ name ] = jQuery.extend( deep, clone, copy );\n\n\t\t\t\t// Don't bring in undefined values\n\t\t\t\t} else if ( copy !== undefined ) {\n\t\t\t\t\ttarget[ name ] = copy;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\njQuery.extend( {\n\n\t// Unique for each copy of jQuery on the page\n\texpando: \"jQuery\" + ( version + Math.random() ).replace( /\\D/g, \"\" ),\n\n\t// Assume jQuery is ready without the ready module\n\tisReady: true,\n\n\terror: function( msg ) {\n\t\tthrow new Error( msg );\n\t},\n\n\tnoop: function() {},\n\n\tisPlainObject: function( obj ) {\n\t\tvar proto, Ctor;\n\n\t\t// Detect obvious negatives\n\t\t// Use toString instead of jQuery.type to catch host objects\n\t\tif ( !obj || toString.call( obj ) !== \"[object Object]\" ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tproto = getProto( obj );\n\n\t\t// Objects with no prototype (e.g., `Object.create( null )`) are plain\n\t\tif ( !proto ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Objects with prototype are plain iff they were constructed by a global Object function\n\t\tCtor = hasOwn.call( proto, \"constructor\" ) && proto.constructor;\n\t\treturn typeof Ctor === \"function\" && fnToString.call( Ctor ) === ObjectFunctionString;\n\t},\n\n\tisEmptyObject: function( obj ) {\n\t\tvar name;\n\n\t\tfor ( name in obj ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t},\n\n\t// Evaluates a script in a provided context; falls back to the global one\n\t// if not specified.\n\tglobalEval: function( code, options, doc ) {\n\t\tDOMEval( code, { nonce: options && options.nonce }, doc );\n\t},\n\n\teach: function( obj, callback ) {\n\t\tvar length, i = 0;\n\n\t\tif ( isArrayLike( obj ) ) {\n\t\t\tlength = obj.length;\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tif ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor ( i in obj ) {\n\t\t\t\tif ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn obj;\n\t},\n\n\n\t// Retrieve the text value of an array of DOM nodes\n\ttext: function( elem ) {\n\t\tvar node,\n\t\t\tret = \"\",\n\t\t\ti = 0,\n\t\t\tnodeType = elem.nodeType;\n\n\t\tif ( !nodeType ) {\n\n\t\t\t// If no nodeType, this is expected to be an array\n\t\t\twhile ( ( node = elem[ i++ ] ) ) {\n\n\t\t\t\t// Do not traverse comment nodes\n\t\t\t\tret += jQuery.text( node );\n\t\t\t}\n\t\t}\n\t\tif ( nodeType === 1 || nodeType === 11 ) {\n\t\t\treturn elem.textContent;\n\t\t}\n\t\tif ( nodeType === 9 ) {\n\t\t\treturn elem.documentElement.textContent;\n\t\t}\n\t\tif ( nodeType === 3 || nodeType === 4 ) {\n\t\t\treturn elem.nodeValue;\n\t\t}\n\n\t\t// Do not include comment or processing instruction nodes\n\n\t\treturn ret;\n\t},\n\n\t// results is for internal usage only\n\tmakeArray: function( arr, results ) {\n\t\tvar ret = results || [];\n\n\t\tif ( arr != null ) {\n\t\t\tif ( isArrayLike( Object( arr ) ) ) {\n\t\t\t\tjQuery.merge( ret,\n\t\t\t\t\ttypeof arr === \"string\" ?\n\t\t\t\t\t\t[ arr ] : arr\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tpush.call( ret, arr );\n\t\t\t}\n\t\t}\n\n\t\treturn ret;\n\t},\n\n\tinArray: function( elem, arr, i ) {\n\t\treturn arr == null ? -1 : indexOf.call( arr, elem, i );\n\t},\n\n\tisXMLDoc: function( elem ) {\n\t\tvar namespace = elem && elem.namespaceURI,\n\t\t\tdocElem = elem && ( elem.ownerDocument || elem ).documentElement;\n\n\t\t// Assume HTML when documentElement doesn't yet exist, such as inside\n\t\t// document fragments.\n\t\treturn !rhtmlSuffix.test( namespace || docElem && docElem.nodeName || \"HTML\" );\n\t},\n\n\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t// push.apply(_, arraylike) throws on ancient WebKit\n\tmerge: function( first, second ) {\n\t\tvar len = +second.length,\n\t\t\tj = 0,\n\t\t\ti = first.length;\n\n\t\tfor ( ; j < len; j++ ) {\n\t\t\tfirst[ i++ ] = second[ j ];\n\t\t}\n\n\t\tfirst.length = i;\n\n\t\treturn first;\n\t},\n\n\tgrep: function( elems, callback, invert ) {\n\t\tvar callbackInverse,\n\t\t\tmatches = [],\n\t\t\ti = 0,\n\t\t\tlength = elems.length,\n\t\t\tcallbackExpect = !invert;\n\n\t\t// Go through the array, only saving the items\n\t\t// that pass the validator function\n\t\tfor ( ; i < length; i++ ) {\n\t\t\tcallbackInverse = !callback( elems[ i ], i );\n\t\t\tif ( callbackInverse !== callbackExpect ) {\n\t\t\t\tmatches.push( elems[ i ] );\n\t\t\t}\n\t\t}\n\n\t\treturn matches;\n\t},\n\n\t// arg is for internal usage only\n\tmap: function( elems, callback, arg ) {\n\t\tvar length, value,\n\t\t\ti = 0,\n\t\t\tret = [];\n\n\t\t// Go through the array, translating each of the items to their new values\n\t\tif ( isArrayLike( elems ) ) {\n\t\t\tlength = elems.length;\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tvalue = callback( elems[ i ], i, arg );\n\n\t\t\t\tif ( value != null ) {\n\t\t\t\t\tret.push( value );\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Go through every key on the object,\n\t\t} else {\n\t\t\tfor ( i in elems ) {\n\t\t\t\tvalue = callback( elems[ i ], i, arg );\n\n\t\t\t\tif ( value != null ) {\n\t\t\t\t\tret.push( value );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Flatten any nested arrays\n\t\treturn flat( ret );\n\t},\n\n\t// A global GUID counter for objects\n\tguid: 1,\n\n\t// jQuery.support is not used in Core but other projects attach their\n\t// properties to it so it needs to exist.\n\tsupport: support\n} );\n\nif ( typeof Symbol === \"function\" ) {\n\tjQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];\n}\n\n// Populate the class2type map\njQuery.each( \"Boolean Number String Function Array Date RegExp Object Error Symbol\".split( \" \" ),\n\tfunction( _i, name ) {\n\t\tclass2type[ \"[object \" + name + \"]\" ] = name.toLowerCase();\n\t} );\n\nfunction isArrayLike( obj ) {\n\n\t// Support: real iOS 8.2 only (not reproducible in simulator)\n\t// `in` check used to prevent JIT error (gh-2145)\n\t// hasOwn isn't used here due to false negatives\n\t// regarding Nodelist length in IE\n\tvar length = !!obj && \"length\" in obj && obj.length,\n\t\ttype = toType( obj );\n\n\tif ( isFunction( obj ) || isWindow( obj ) ) {\n\t\treturn false;\n\t}\n\n\treturn type === \"array\" || length === 0 ||\n\t\ttypeof length === \"number\" && length > 0 && ( length - 1 ) in obj;\n}\n\n\nfunction nodeName( elem, name ) {\n\n\treturn elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();\n\n}\nvar pop = arr.pop;\n\n\nvar sort = arr.sort;\n\n\nvar splice = arr.splice;\n\n\nvar whitespace = \"[\\\\x20\\\\t\\\\r\\\\n\\\\f]\";\n\n\nvar rtrimCSS = new RegExp(\n\t\"^\" + whitespace + \"+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)\" + whitespace + \"+$\",\n\t\"g\"\n);\n\n\n\n\n// Note: an element does not contain itself\njQuery.contains = function( a, b ) {\n\tvar bup = b && b.parentNode;\n\n\treturn a === bup || !!( bup && bup.nodeType === 1 && (\n\n\t\t// Support: IE 9 - 11+\n\t\t// IE doesn't have `contains` on SVG.\n\t\ta.contains ?\n\t\t\ta.contains( bup ) :\n\t\t\ta.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16\n\t) );\n};\n\n\n\n\n// CSS string/identifier serialization\n// https://drafts.csswg.org/cssom/#common-serializing-idioms\nvar rcssescape = /([\\0-\\x1f\\x7f]|^-?\\d)|^-$|[^\\x80-\\uFFFF\\w-]/g;\n\nfunction fcssescape( ch, asCodePoint ) {\n\tif ( asCodePoint ) {\n\n\t\t// U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER\n\t\tif ( ch === \"\\0\" ) {\n\t\t\treturn \"\\uFFFD\";\n\t\t}\n\n\t\t// Control characters and (dependent upon position) numbers get escaped as code points\n\t\treturn ch.slice( 0, -1 ) + \"\\\\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + \" \";\n\t}\n\n\t// Other potentially-special ASCII characters get backslash-escaped\n\treturn \"\\\\\" + ch;\n}\n\njQuery.escapeSelector = function( sel ) {\n\treturn ( sel + \"\" ).replace( rcssescape, fcssescape );\n};\n\n\n\n\nvar preferredDoc = document,\n\tpushNative = push;\n\n( function() {\n\nvar i,\n\tExpr,\n\toutermostContext,\n\tsortInput,\n\thasDuplicate,\n\tpush = pushNative,\n\n\t// Local document vars\n\tdocument,\n\tdocumentElement,\n\tdocumentIsHTML,\n\trbuggyQSA,\n\tmatches,\n\n\t// Instance-specific data\n\texpando = jQuery.expando,\n\tdirruns = 0,\n\tdone = 0,\n\tclassCache = createCache(),\n\ttokenCache = createCache(),\n\tcompilerCache = createCache(),\n\tnonnativeSelectorCache = createCache(),\n\tsortOrder = function( a, b ) {\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t}\n\t\treturn 0;\n\t},\n\n\tbooleans = \"checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|\" +\n\t\t\"loop|multiple|open|readonly|required|scoped\",\n\n\t// Regular expressions\n\n\t// https://www.w3.org/TR/css-syntax-3/#ident-token-diagram\n\tidentifier = \"(?:\\\\\\\\[\\\\da-fA-F]{1,6}\" + whitespace +\n\t\t\"?|\\\\\\\\[^\\\\r\\\\n\\\\f]|[\\\\w-]|[^\\0-\\\\x7f])+\",\n\n\t// Attribute selectors: https://www.w3.org/TR/selectors/#attribute-selectors\n\tattributes = \"\\\\[\" + whitespace + \"*(\" + identifier + \")(?:\" + whitespace +\n\n\t\t// Operator (capture 2)\n\t\t\"*([*^$|!~]?=)\" + whitespace +\n\n\t\t// \"Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]\"\n\t\t\"*(?:'((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\"|(\" + identifier + \"))|)\" +\n\t\twhitespace + \"*\\\\]\",\n\n\tpseudos = \":(\" + identifier + \")(?:\\\\((\" +\n\n\t\t// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:\n\t\t// 1. quoted (capture 3; capture 4 or capture 5)\n\t\t\"('((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\")|\" +\n\n\t\t// 2. simple (capture 6)\n\t\t\"((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\" + attributes + \")*)|\" +\n\n\t\t// 3. anything else (capture 2)\n\t\t\".*\" +\n\t\t\")\\\\)|)\",\n\n\t// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter\n\trwhitespace = new RegExp( whitespace + \"+\", \"g\" ),\n\n\trcomma = new RegExp( \"^\" + whitespace + \"*,\" + whitespace + \"*\" ),\n\trleadingCombinator = new RegExp( \"^\" + whitespace + \"*([>+~]|\" + whitespace + \")\" +\n\t\twhitespace + \"*\" ),\n\trdescend = new RegExp( whitespace + \"|>\" ),\n\n\trpseudo = new RegExp( pseudos ),\n\tridentifier = new RegExp( \"^\" + identifier + \"$\" ),\n\n\tmatchExpr = {\n\t\tID: new RegExp( \"^#(\" + identifier + \")\" ),\n\t\tCLASS: new RegExp( \"^\\\\.(\" + identifier + \")\" ),\n\t\tTAG: new RegExp( \"^(\" + identifier + \"|[*])\" ),\n\t\tATTR: new RegExp( \"^\" + attributes ),\n\t\tPSEUDO: new RegExp( \"^\" + pseudos ),\n\t\tCHILD: new RegExp(\n\t\t\t\"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\\\(\" +\n\t\t\t\twhitespace + \"*(even|odd|(([+-]|)(\\\\d*)n|)\" + whitespace + \"*(?:([+-]|)\" +\n\t\t\t\twhitespace + \"*(\\\\d+)|))\" + whitespace + \"*\\\\)|)\", \"i\" ),\n\t\tbool: new RegExp( \"^(?:\" + booleans + \")$\", \"i\" ),\n\n\t\t// For use in libraries implementing .is()\n\t\t// We use this for POS matching in `select`\n\t\tneedsContext: new RegExp( \"^\" + whitespace +\n\t\t\t\"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(\" + whitespace +\n\t\t\t\"*((?:-\\\\d)?\\\\d*)\" + whitespace + \"*\\\\)|)(?=[^-]|$)\", \"i\" )\n\t},\n\n\trinputs = /^(?:input|select|textarea|button)$/i,\n\trheader = /^h\\d$/i,\n\n\t// Easily-parseable/retrievable ID or TAG or CLASS selectors\n\trquickExpr = /^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,\n\n\trsibling = /[+~]/,\n\n\t// CSS escapes\n\t// https://www.w3.org/TR/CSS21/syndata.html#escaped-characters\n\trunescape = new RegExp( \"\\\\\\\\[\\\\da-fA-F]{1,6}\" + whitespace +\n\t\t\"?|\\\\\\\\([^\\\\r\\\\n\\\\f])\", \"g\" ),\n\tfunescape = function( escape, nonHex ) {\n\t\tvar high = \"0x\" + escape.slice( 1 ) - 0x10000;\n\n\t\tif ( nonHex ) {\n\n\t\t\t// Strip the backslash prefix from a non-hex escape sequence\n\t\t\treturn nonHex;\n\t\t}\n\n\t\t// Replace a hexadecimal escape sequence with the encoded Unicode code point\n\t\t// Support: IE <=11+\n\t\t// For values outside the Basic Multilingual Plane (BMP), manually construct a\n\t\t// surrogate pair\n\t\treturn high < 0 ?\n\t\t\tString.fromCharCode( high + 0x10000 ) :\n\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n\t},\n\n\t// Used for iframes; see `setDocument`.\n\t// Support: IE 9 - 11+, Edge 12 - 18+\n\t// Removing the function wrapper causes a \"Permission Denied\"\n\t// error in IE/Edge.\n\tunloadHandler = function() {\n\t\tsetDocument();\n\t},\n\n\tinDisabledFieldset = addCombinator(\n\t\tfunction( elem ) {\n\t\t\treturn elem.disabled === true && nodeName( elem, \"fieldset\" );\n\t\t},\n\t\t{ dir: \"parentNode\", next: \"legend\" }\n\t);\n\n// Support: IE <=9 only\n// Accessing document.activeElement can throw unexpectedly\n// https://bugs.jquery.com/ticket/13393\nfunction safeActiveElement() {\n\ttry {\n\t\treturn document.activeElement;\n\t} catch ( err ) { }\n}\n\n// Optimize for push.apply( _, NodeList )\ntry {\n\tpush.apply(\n\t\t( arr = slice.call( preferredDoc.childNodes ) ),\n\t\tpreferredDoc.childNodes\n\t);\n\n\t// Support: Android <=4.0\n\t// Detect silently failing push.apply\n\t// eslint-disable-next-line no-unused-expressions\n\tarr[ preferredDoc.childNodes.length ].nodeType;\n} catch ( e ) {\n\tpush = {\n\t\tapply: function( target, els ) {\n\t\t\tpushNative.apply( target, slice.call( els ) );\n\t\t},\n\t\tcall: function( target ) {\n\t\t\tpushNative.apply( target, slice.call( arguments, 1 ) );\n\t\t}\n\t};\n}\n\nfunction find( selector, context, results, seed ) {\n\tvar m, i, elem, nid, match, groups, newSelector,\n\t\tnewContext = context && context.ownerDocument,\n\n\t\t// nodeType defaults to 9, since context defaults to document\n\t\tnodeType = context ? context.nodeType : 9;\n\n\tresults = results || [];\n\n\t// Return early from calls with invalid selector or context\n\tif ( typeof selector !== \"string\" || !selector ||\n\t\tnodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {\n\n\t\treturn results;\n\t}\n\n\t// Try to shortcut find operations (as opposed to filters) in HTML documents\n\tif ( !seed ) {\n\t\tsetDocument( context );\n\t\tcontext = context || document;\n\n\t\tif ( documentIsHTML ) {\n\n\t\t\t// If the selector is sufficiently simple, try using a \"get*By*\" DOM method\n\t\t\t// (excepting DocumentFragment context, where the methods don't exist)\n\t\t\tif ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) {\n\n\t\t\t\t// ID selector\n\t\t\t\tif ( ( m = match[ 1 ] ) ) {\n\n\t\t\t\t\t// Document context\n\t\t\t\t\tif ( nodeType === 9 ) {\n\t\t\t\t\t\tif ( ( elem = context.getElementById( m ) ) ) {\n\n\t\t\t\t\t\t\t// Support: IE 9 only\n\t\t\t\t\t\t\t// getElementById can match elements by name instead of ID\n\t\t\t\t\t\t\tif ( elem.id === m ) {\n\t\t\t\t\t\t\t\tpush.call( results, elem );\n\t\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t// Element context\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// Support: IE 9 only\n\t\t\t\t\t\t// getElementById can match elements by name instead of ID\n\t\t\t\t\t\tif ( newContext && ( elem = newContext.getElementById( m ) ) &&\n\t\t\t\t\t\t\tfind.contains( context, elem ) &&\n\t\t\t\t\t\t\telem.id === m ) {\n\n\t\t\t\t\t\t\tpush.call( results, elem );\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t// Type selector\n\t\t\t\t} else if ( match[ 2 ] ) {\n\t\t\t\t\tpush.apply( results, context.getElementsByTagName( selector ) );\n\t\t\t\t\treturn results;\n\n\t\t\t\t// Class selector\n\t\t\t\t} else if ( ( m = match[ 3 ] ) && context.getElementsByClassName ) {\n\t\t\t\t\tpush.apply( results, context.getElementsByClassName( m ) );\n\t\t\t\t\treturn results;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Take advantage of querySelectorAll\n\t\t\tif ( !nonnativeSelectorCache[ selector + \" \" ] &&\n\t\t\t\t( !rbuggyQSA || !rbuggyQSA.test( selector ) ) ) {\n\n\t\t\t\tnewSelector = selector;\n\t\t\t\tnewContext = context;\n\n\t\t\t\t// qSA considers elements outside a scoping root when evaluating child or\n\t\t\t\t// descendant combinators, which is not what we want.\n\t\t\t\t// In such cases, we work around the behavior by prefixing every selector in the\n\t\t\t\t// list with an ID selector referencing the scope context.\n\t\t\t\t// The technique has to be used as well when a leading combinator is used\n\t\t\t\t// as such selectors are not recognized by querySelectorAll.\n\t\t\t\t// Thanks to Andrew Dupont for this technique.\n\t\t\t\tif ( nodeType === 1 &&\n\t\t\t\t\t( rdescend.test( selector ) || rleadingCombinator.test( selector ) ) ) {\n\n\t\t\t\t\t// Expand context for sibling selectors\n\t\t\t\t\tnewContext = rsibling.test( selector ) && testContext( context.parentNode ) ||\n\t\t\t\t\t\tcontext;\n\n\t\t\t\t\t// We can use :scope instead of the ID hack if the browser\n\t\t\t\t\t// supports it & if we're not changing the context.\n\t\t\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when\n\t\t\t\t\t// strict-comparing two documents; shallow comparisons work.\n\t\t\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\t\t\tif ( newContext != context || !support.scope ) {\n\n\t\t\t\t\t\t// Capture the context ID, setting it first if necessary\n\t\t\t\t\t\tif ( ( nid = context.getAttribute( \"id\" ) ) ) {\n\t\t\t\t\t\t\tnid = jQuery.escapeSelector( nid );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcontext.setAttribute( \"id\", ( nid = expando ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prefix every selector in the list\n\t\t\t\t\tgroups = tokenize( selector );\n\t\t\t\t\ti = groups.length;\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tgroups[ i ] = ( nid ? \"#\" + nid : \":scope\" ) + \" \" +\n\t\t\t\t\t\t\ttoSelector( groups[ i ] );\n\t\t\t\t\t}\n\t\t\t\t\tnewSelector = groups.join( \",\" );\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tpush.apply( results,\n\t\t\t\t\t\tnewContext.querySelectorAll( newSelector )\n\t\t\t\t\t);\n\t\t\t\t\treturn results;\n\t\t\t\t} catch ( qsaError ) {\n\t\t\t\t\tnonnativeSelectorCache( selector, true );\n\t\t\t\t} finally {\n\t\t\t\t\tif ( nid === expando ) {\n\t\t\t\t\t\tcontext.removeAttribute( \"id\" );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// All others\n\treturn select( selector.replace( rtrimCSS, \"$1\" ), context, results, seed );\n}\n\n/**\n * Create key-value caches of limited size\n * @returns {function(string, object)} Returns the Object data after storing it on itself with\n *\tproperty name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)\n *\tdeleting the oldest entry\n */\nfunction createCache() {\n\tvar keys = [];\n\n\tfunction cache( key, value ) {\n\n\t\t// Use (key + \" \") to avoid collision with native prototype properties\n\t\t// (see https://github.com/jquery/sizzle/issues/157)\n\t\tif ( keys.push( key + \" \" ) > Expr.cacheLength ) {\n\n\t\t\t// Only keep the most recent entries\n\t\t\tdelete cache[ keys.shift() ];\n\t\t}\n\t\treturn ( cache[ key + \" \" ] = value );\n\t}\n\treturn cache;\n}\n\n/**\n * Mark a function for special use by jQuery selector module\n * @param {Function} fn The function to mark\n */\nfunction markFunction( fn ) {\n\tfn[ expando ] = true;\n\treturn fn;\n}\n\n/**\n * Support testing using an element\n * @param {Function} fn Passed the created element and returns a boolean result\n */\nfunction assert( fn ) {\n\tvar el = document.createElement( \"fieldset\" );\n\n\ttry {\n\t\treturn !!fn( el );\n\t} catch ( e ) {\n\t\treturn false;\n\t} finally {\n\n\t\t// Remove from its parent by default\n\t\tif ( el.parentNode ) {\n\t\t\tel.parentNode.removeChild( el );\n\t\t}\n\n\t\t// release memory in IE\n\t\tel = null;\n\t}\n}\n\n/**\n * Returns a function to use in pseudos for input types\n * @param {String} type\n */\nfunction createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\treturn nodeName( elem, \"input\" ) && elem.type === type;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for buttons\n * @param {String} type\n */\nfunction createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\treturn ( nodeName( elem, \"input\" ) || nodeName( elem, \"button\" ) ) &&\n\t\t\telem.type === type;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for :enabled/:disabled\n * @param {Boolean} disabled true for :disabled; false for :enabled\n */\nfunction createDisabledPseudo( disabled ) {\n\n\t// Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable\n\treturn function( elem ) {\n\n\t\t// Only certain elements can match :enabled or :disabled\n\t\t// https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled\n\t\t// https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled\n\t\tif ( \"form\" in elem ) {\n\n\t\t\t// Check for inherited disabledness on relevant non-disabled elements:\n\t\t\t// * listed form-associated elements in a disabled fieldset\n\t\t\t// https://html.spec.whatwg.org/multipage/forms.html#category-listed\n\t\t\t// https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled\n\t\t\t// * option elements in a disabled optgroup\n\t\t\t// https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled\n\t\t\t// All such elements have a \"form\" property.\n\t\t\tif ( elem.parentNode && elem.disabled === false ) {\n\n\t\t\t\t// Option elements defer to a parent optgroup if present\n\t\t\t\tif ( \"label\" in elem ) {\n\t\t\t\t\tif ( \"label\" in elem.parentNode ) {\n\t\t\t\t\t\treturn elem.parentNode.disabled === disabled;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn elem.disabled === disabled;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Support: IE 6 - 11+\n\t\t\t\t// Use the isDisabled shortcut property to check for disabled fieldset ancestors\n\t\t\t\treturn elem.isDisabled === disabled ||\n\n\t\t\t\t\t// Where there is no isDisabled, check manually\n\t\t\t\t\telem.isDisabled !== !disabled &&\n\t\t\t\t\t\tinDisabledFieldset( elem ) === disabled;\n\t\t\t}\n\n\t\t\treturn elem.disabled === disabled;\n\n\t\t// Try to winnow out elements that can't be disabled before trusting the disabled property.\n\t\t// Some victims get caught in our net (label, legend, menu, track), but it shouldn't\n\t\t// even exist on them, let alone have a boolean value.\n\t\t} else if ( \"label\" in elem ) {\n\t\t\treturn elem.disabled === disabled;\n\t\t}\n\n\t\t// Remaining elements are neither :enabled nor :disabled\n\t\treturn false;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for positionals\n * @param {Function} fn\n */\nfunction createPositionalPseudo( fn ) {\n\treturn markFunction( function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction( function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ ( j = matchIndexes[ i ] ) ] ) {\n\t\t\t\t\tseed[ j ] = !( matches[ j ] = seed[ j ] );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t} );\n}\n\n/**\n * Checks a node for validity as a jQuery selector context\n * @param {Element|Object=} context\n * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value\n */\nfunction testContext( context ) {\n\treturn context && typeof context.getElementsByTagName !== \"undefined\" && context;\n}\n\n/**\n * Sets document-related variables once based on the current document\n * @param {Element|Object} [node] An element or document object to use to set the document\n * @returns {Object} Returns the current document\n */\nfunction setDocument( node ) {\n\tvar subWindow,\n\t\tdoc = node ? node.ownerDocument || node : preferredDoc;\n\n\t// Return early if doc is invalid or already selected\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) {\n\t\treturn document;\n\t}\n\n\t// Update global variables\n\tdocument = doc;\n\tdocumentElement = document.documentElement;\n\tdocumentIsHTML = !jQuery.isXMLDoc( document );\n\n\t// Support: iOS 7 only, IE 9 - 11+\n\t// Older browsers didn't support unprefixed `matches`.\n\tmatches = documentElement.matches ||\n\t\tdocumentElement.webkitMatchesSelector ||\n\t\tdocumentElement.msMatchesSelector;\n\n\t// Support: IE 9 - 11+, Edge 12 - 18+\n\t// Accessing iframe documents after unload throws \"permission denied\" errors\n\t// (see trac-13936).\n\t// Limit the fix to IE & Edge Legacy; despite Edge 15+ implementing `matches`,\n\t// all IE 9+ and Edge Legacy versions implement `msMatchesSelector` as well.\n\tif ( documentElement.msMatchesSelector &&\n\n\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t// two documents; shallow comparisons work.\n\t\t// eslint-disable-next-line eqeqeq\n\t\tpreferredDoc != document &&\n\t\t( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {\n\n\t\t// Support: IE 9 - 11+, Edge 12 - 18+\n\t\tsubWindow.addEventListener( \"unload\", unloadHandler );\n\t}\n\n\t// Support: IE <10\n\t// Check if getElementById returns elements by name\n\t// The broken getElementById methods don't pick up programmatically-set names,\n\t// so use a roundabout getElementsByName test\n\tsupport.getById = assert( function( el ) {\n\t\tdocumentElement.appendChild( el ).id = jQuery.expando;\n\t\treturn !document.getElementsByName ||\n\t\t\t!document.getElementsByName( jQuery.expando ).length;\n\t} );\n\n\t// Support: IE 9 only\n\t// Check to see if it's possible to do matchesSelector\n\t// on a disconnected node.\n\tsupport.disconnectedMatch = assert( function( el ) {\n\t\treturn matches.call( el, \"*\" );\n\t} );\n\n\t// Support: IE 9 - 11+, Edge 12 - 18+\n\t// IE/Edge don't support the :scope pseudo-class.\n\tsupport.scope = assert( function() {\n\t\treturn document.querySelectorAll( \":scope\" );\n\t} );\n\n\t// Support: Chrome 105 - 111 only, Safari 15.4 - 16.3 only\n\t// Make sure the `:has()` argument is parsed unforgivingly.\n\t// We include `*` in the test to detect buggy implementations that are\n\t// _selectively_ forgiving (specifically when the list includes at least\n\t// one valid selector).\n\t// Note that we treat complete lack of support for `:has()` as if it were\n\t// spec-compliant support, which is fine because use of `:has()` in such\n\t// environments will fail in the qSA path and fall back to jQuery traversal\n\t// anyway.\n\tsupport.cssHas = assert( function() {\n\t\ttry {\n\t\t\tdocument.querySelector( \":has(*,:jqfake)\" );\n\t\t\treturn false;\n\t\t} catch ( e ) {\n\t\t\treturn true;\n\t\t}\n\t} );\n\n\t// ID filter and find\n\tif ( support.getById ) {\n\t\tExpr.filter.ID = function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\treturn elem.getAttribute( \"id\" ) === attrId;\n\t\t\t};\n\t\t};\n\t\tExpr.find.ID = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== \"undefined\" && documentIsHTML ) {\n\t\t\t\tvar elem = context.getElementById( id );\n\t\t\t\treturn elem ? [ elem ] : [];\n\t\t\t}\n\t\t};\n\t} else {\n\t\tExpr.filter.ID = function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\tvar node = typeof elem.getAttributeNode !== \"undefined\" &&\n\t\t\t\t\telem.getAttributeNode( \"id\" );\n\t\t\t\treturn node && node.value === attrId;\n\t\t\t};\n\t\t};\n\n\t\t// Support: IE 6 - 7 only\n\t\t// getElementById is not reliable as a find shortcut\n\t\tExpr.find.ID = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== \"undefined\" && documentIsHTML ) {\n\t\t\t\tvar node, i, elems,\n\t\t\t\t\telem = context.getElementById( id );\n\n\t\t\t\tif ( elem ) {\n\n\t\t\t\t\t// Verify the id attribute\n\t\t\t\t\tnode = elem.getAttributeNode( \"id\" );\n\t\t\t\t\tif ( node && node.value === id ) {\n\t\t\t\t\t\treturn [ elem ];\n\t\t\t\t\t}\n\n\t\t\t\t\t// Fall back on getElementsByName\n\t\t\t\t\telems = context.getElementsByName( id );\n\t\t\t\t\ti = 0;\n\t\t\t\t\twhile ( ( elem = elems[ i++ ] ) ) {\n\t\t\t\t\t\tnode = elem.getAttributeNode( \"id\" );\n\t\t\t\t\t\tif ( node && node.value === id ) {\n\t\t\t\t\t\t\treturn [ elem ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn [];\n\t\t\t}\n\t\t};\n\t}\n\n\t// Tag\n\tExpr.find.TAG = function( tag, context ) {\n\t\tif ( typeof context.getElementsByTagName !== \"undefined\" ) {\n\t\t\treturn context.getElementsByTagName( tag );\n\n\t\t// DocumentFragment nodes don't have gEBTN\n\t\t} else {\n\t\t\treturn context.querySelectorAll( tag );\n\t\t}\n\t};\n\n\t// Class\n\tExpr.find.CLASS = function( className, context ) {\n\t\tif ( typeof context.getElementsByClassName !== \"undefined\" && documentIsHTML ) {\n\t\t\treturn context.getElementsByClassName( className );\n\t\t}\n\t};\n\n\t/* QSA/matchesSelector\n\t---------------------------------------------------------------------- */\n\n\t// QSA and matchesSelector support\n\n\trbuggyQSA = [];\n\n\t// Build QSA regex\n\t// Regex strategy adopted from Diego Perini\n\tassert( function( el ) {\n\n\t\tvar input;\n\n\t\tdocumentElement.appendChild( el ).innerHTML =\n\t\t\t\"\" +\n\t\t\t\"\";\n\n\t\t// Support: iOS <=7 - 8 only\n\t\t// Boolean attributes and \"value\" are not treated correctly in some XML documents\n\t\tif ( !el.querySelectorAll( \"[selected]\" ).length ) {\n\t\t\trbuggyQSA.push( \"\\\\[\" + whitespace + \"*(?:value|\" + booleans + \")\" );\n\t\t}\n\n\t\t// Support: iOS <=7 - 8 only\n\t\tif ( !el.querySelectorAll( \"[id~=\" + expando + \"-]\" ).length ) {\n\t\t\trbuggyQSA.push( \"~=\" );\n\t\t}\n\n\t\t// Support: iOS 8 only\n\t\t// https://bugs.webkit.org/show_bug.cgi?id=136851\n\t\t// In-page `selector#id sibling-combinator selector` fails\n\t\tif ( !el.querySelectorAll( \"a#\" + expando + \"+*\" ).length ) {\n\t\t\trbuggyQSA.push( \".#.+[+~]\" );\n\t\t}\n\n\t\t// Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+\n\t\t// In some of the document kinds, these selectors wouldn't work natively.\n\t\t// This is probably OK but for backwards compatibility we want to maintain\n\t\t// handling them through jQuery traversal in jQuery 3.x.\n\t\tif ( !el.querySelectorAll( \":checked\" ).length ) {\n\t\t\trbuggyQSA.push( \":checked\" );\n\t\t}\n\n\t\t// Support: Windows 8 Native Apps\n\t\t// The type and name attributes are restricted during .innerHTML assignment\n\t\tinput = document.createElement( \"input\" );\n\t\tinput.setAttribute( \"type\", \"hidden\" );\n\t\tel.appendChild( input ).setAttribute( \"name\", \"D\" );\n\n\t\t// Support: IE 9 - 11+\n\t\t// IE's :disabled selector does not pick up the children of disabled fieldsets\n\t\t// Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+\n\t\t// In some of the document kinds, these selectors wouldn't work natively.\n\t\t// This is probably OK but for backwards compatibility we want to maintain\n\t\t// handling them through jQuery traversal in jQuery 3.x.\n\t\tdocumentElement.appendChild( el ).disabled = true;\n\t\tif ( el.querySelectorAll( \":disabled\" ).length !== 2 ) {\n\t\t\trbuggyQSA.push( \":enabled\", \":disabled\" );\n\t\t}\n\n\t\t// Support: IE 11+, Edge 15 - 18+\n\t\t// IE 11/Edge don't find elements on a `[name='']` query in some cases.\n\t\t// Adding a temporary attribute to the document before the selection works\n\t\t// around the issue.\n\t\t// Interestingly, IE 10 & older don't seem to have the issue.\n\t\tinput = document.createElement( \"input\" );\n\t\tinput.setAttribute( \"name\", \"\" );\n\t\tel.appendChild( input );\n\t\tif ( !el.querySelectorAll( \"[name='']\" ).length ) {\n\t\t\trbuggyQSA.push( \"\\\\[\" + whitespace + \"*name\" + whitespace + \"*=\" +\n\t\t\t\twhitespace + \"*(?:''|\\\"\\\")\" );\n\t\t}\n\t} );\n\n\tif ( !support.cssHas ) {\n\n\t\t// Support: Chrome 105 - 110+, Safari 15.4 - 16.3+\n\t\t// Our regular `try-catch` mechanism fails to detect natively-unsupported\n\t\t// pseudo-classes inside `:has()` (such as `:has(:contains(\"Foo\"))`)\n\t\t// in browsers that parse the `:has()` argument as a forgiving selector list.\n\t\t// https://drafts.csswg.org/selectors/#relational now requires the argument\n\t\t// to be parsed unforgivingly, but browsers have not yet fully adjusted.\n\t\trbuggyQSA.push( \":has\" );\n\t}\n\n\trbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( \"|\" ) );\n\n\t/* Sorting\n\t---------------------------------------------------------------------- */\n\n\t// Document order sorting\n\tsortOrder = function( a, b ) {\n\n\t\t// Flag for duplicate removal\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\t\t}\n\n\t\t// Sort on method existence if only one input has compareDocumentPosition\n\t\tvar compare = !a.compareDocumentPosition - !b.compareDocumentPosition;\n\t\tif ( compare ) {\n\t\t\treturn compare;\n\t\t}\n\n\t\t// Calculate position if both inputs belong to the same document\n\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t// two documents; shallow comparisons work.\n\t\t// eslint-disable-next-line eqeqeq\n\t\tcompare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ?\n\t\t\ta.compareDocumentPosition( b ) :\n\n\t\t\t// Otherwise we know they are disconnected\n\t\t\t1;\n\n\t\t// Disconnected nodes\n\t\tif ( compare & 1 ||\n\t\t\t( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) {\n\n\t\t\t// Choose the first element that is related to our preferred document\n\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t// two documents; shallow comparisons work.\n\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\tif ( a === document || a.ownerDocument == preferredDoc &&\n\t\t\t\tfind.contains( preferredDoc, a ) ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t// two documents; shallow comparisons work.\n\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\tif ( b === document || b.ownerDocument == preferredDoc &&\n\t\t\t\tfind.contains( preferredDoc, b ) ) {\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\t// Maintain original order\n\t\t\treturn sortInput ?\n\t\t\t\t( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :\n\t\t\t\t0;\n\t\t}\n\n\t\treturn compare & 4 ? -1 : 1;\n\t};\n\n\treturn document;\n}\n\nfind.matches = function( expr, elements ) {\n\treturn find( expr, null, null, elements );\n};\n\nfind.matchesSelector = function( elem, expr ) {\n\tsetDocument( elem );\n\n\tif ( documentIsHTML &&\n\t\t!nonnativeSelectorCache[ expr + \" \" ] &&\n\t\t( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {\n\n\t\ttry {\n\t\t\tvar ret = matches.call( elem, expr );\n\n\t\t\t// IE 9's matchesSelector returns false on disconnected nodes\n\t\t\tif ( ret || support.disconnectedMatch ||\n\n\t\t\t\t\t// As well, disconnected nodes are said to be in a document\n\t\t\t\t\t// fragment in IE 9\n\t\t\t\t\telem.document && elem.document.nodeType !== 11 ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t} catch ( e ) {\n\t\t\tnonnativeSelectorCache( expr, true );\n\t\t}\n\t}\n\n\treturn find( expr, document, null, [ elem ] ).length > 0;\n};\n\nfind.contains = function( context, elem ) {\n\n\t// Set document vars if needed\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( ( context.ownerDocument || context ) != document ) {\n\t\tsetDocument( context );\n\t}\n\treturn jQuery.contains( context, elem );\n};\n\n\nfind.attr = function( elem, name ) {\n\n\t// Set document vars if needed\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( ( elem.ownerDocument || elem ) != document ) {\n\t\tsetDocument( elem );\n\t}\n\n\tvar fn = Expr.attrHandle[ name.toLowerCase() ],\n\n\t\t// Don't get fooled by Object.prototype properties (see trac-13807)\n\t\tval = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?\n\t\t\tfn( elem, name, !documentIsHTML ) :\n\t\t\tundefined;\n\n\tif ( val !== undefined ) {\n\t\treturn val;\n\t}\n\n\treturn elem.getAttribute( name );\n};\n\nfind.error = function( msg ) {\n\tthrow new Error( \"Syntax error, unrecognized expression: \" + msg );\n};\n\n/**\n * Document sorting and removing duplicates\n * @param {ArrayLike} results\n */\njQuery.uniqueSort = function( results ) {\n\tvar elem,\n\t\tduplicates = [],\n\t\tj = 0,\n\t\ti = 0;\n\n\t// Unless we *know* we can detect duplicates, assume their presence\n\t//\n\t// Support: Android <=4.0+\n\t// Testing for detecting duplicates is unpredictable so instead assume we can't\n\t// depend on duplicate detection in all browsers without a stable sort.\n\thasDuplicate = !support.sortStable;\n\tsortInput = !support.sortStable && slice.call( results, 0 );\n\tsort.call( results, sortOrder );\n\n\tif ( hasDuplicate ) {\n\t\twhile ( ( elem = results[ i++ ] ) ) {\n\t\t\tif ( elem === results[ i ] ) {\n\t\t\t\tj = duplicates.push( i );\n\t\t\t}\n\t\t}\n\t\twhile ( j-- ) {\n\t\t\tsplice.call( results, duplicates[ j ], 1 );\n\t\t}\n\t}\n\n\t// Clear input after sorting to release objects\n\t// See https://github.com/jquery/sizzle/pull/225\n\tsortInput = null;\n\n\treturn results;\n};\n\njQuery.fn.uniqueSort = function() {\n\treturn this.pushStack( jQuery.uniqueSort( slice.apply( this ) ) );\n};\n\nExpr = jQuery.expr = {\n\n\t// Can be adjusted by the user\n\tcacheLength: 50,\n\n\tcreatePseudo: markFunction,\n\n\tmatch: matchExpr,\n\n\tattrHandle: {},\n\n\tfind: {},\n\n\trelative: {\n\t\t\">\": { dir: \"parentNode\", first: true },\n\t\t\" \": { dir: \"parentNode\" },\n\t\t\"+\": { dir: \"previousSibling\", first: true },\n\t\t\"~\": { dir: \"previousSibling\" }\n\t},\n\n\tpreFilter: {\n\t\tATTR: function( match ) {\n\t\t\tmatch[ 1 ] = match[ 1 ].replace( runescape, funescape );\n\n\t\t\t// Move the given value to match[3] whether quoted or unquoted\n\t\t\tmatch[ 3 ] = ( match[ 3 ] || match[ 4 ] || match[ 5 ] || \"\" )\n\t\t\t\t.replace( runescape, funescape );\n\n\t\t\tif ( match[ 2 ] === \"~=\" ) {\n\t\t\t\tmatch[ 3 ] = \" \" + match[ 3 ] + \" \";\n\t\t\t}\n\n\t\t\treturn match.slice( 0, 4 );\n\t\t},\n\n\t\tCHILD: function( match ) {\n\n\t\t\t/* matches from matchExpr[\"CHILD\"]\n\t\t\t\t1 type (only|nth|...)\n\t\t\t\t2 what (child|of-type)\n\t\t\t\t3 argument (even|odd|\\d*|\\d*n([+-]\\d+)?|...)\n\t\t\t\t4 xn-component of xn+y argument ([+-]?\\d*n|)\n\t\t\t\t5 sign of xn-component\n\t\t\t\t6 x of xn-component\n\t\t\t\t7 sign of y-component\n\t\t\t\t8 y of y-component\n\t\t\t*/\n\t\t\tmatch[ 1 ] = match[ 1 ].toLowerCase();\n\n\t\t\tif ( match[ 1 ].slice( 0, 3 ) === \"nth\" ) {\n\n\t\t\t\t// nth-* requires argument\n\t\t\t\tif ( !match[ 3 ] ) {\n\t\t\t\t\tfind.error( match[ 0 ] );\n\t\t\t\t}\n\n\t\t\t\t// numeric x and y parameters for Expr.filter.CHILD\n\t\t\t\t// remember that false/true cast respectively to 0/1\n\t\t\t\tmatch[ 4 ] = +( match[ 4 ] ?\n\t\t\t\t\tmatch[ 5 ] + ( match[ 6 ] || 1 ) :\n\t\t\t\t\t2 * ( match[ 3 ] === \"even\" || match[ 3 ] === \"odd\" )\n\t\t\t\t);\n\t\t\t\tmatch[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === \"odd\" );\n\n\t\t\t// other types prohibit arguments\n\t\t\t} else if ( match[ 3 ] ) {\n\t\t\t\tfind.error( match[ 0 ] );\n\t\t\t}\n\n\t\t\treturn match;\n\t\t},\n\n\t\tPSEUDO: function( match ) {\n\t\t\tvar excess,\n\t\t\t\tunquoted = !match[ 6 ] && match[ 2 ];\n\n\t\t\tif ( matchExpr.CHILD.test( match[ 0 ] ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Accept quoted arguments as-is\n\t\t\tif ( match[ 3 ] ) {\n\t\t\t\tmatch[ 2 ] = match[ 4 ] || match[ 5 ] || \"\";\n\n\t\t\t// Strip excess characters from unquoted arguments\n\t\t\t} else if ( unquoted && rpseudo.test( unquoted ) &&\n\n\t\t\t\t// Get excess from tokenize (recursively)\n\t\t\t\t( excess = tokenize( unquoted, true ) ) &&\n\n\t\t\t\t// advance to the next closing parenthesis\n\t\t\t\t( excess = unquoted.indexOf( \")\", unquoted.length - excess ) - unquoted.length ) ) {\n\n\t\t\t\t// excess is a negative index\n\t\t\t\tmatch[ 0 ] = match[ 0 ].slice( 0, excess );\n\t\t\t\tmatch[ 2 ] = unquoted.slice( 0, excess );\n\t\t\t}\n\n\t\t\t// Return only captures needed by the pseudo filter method (type and argument)\n\t\t\treturn match.slice( 0, 3 );\n\t\t}\n\t},\n\n\tfilter: {\n\n\t\tTAG: function( nodeNameSelector ) {\n\t\t\tvar expectedNodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn nodeNameSelector === \"*\" ?\n\t\t\t\tfunction() {\n\t\t\t\t\treturn true;\n\t\t\t\t} :\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn nodeName( elem, expectedNodeName );\n\t\t\t\t};\n\t\t},\n\n\t\tCLASS: function( className ) {\n\t\t\tvar pattern = classCache[ className + \" \" ];\n\n\t\t\treturn pattern ||\n\t\t\t\t( pattern = new RegExp( \"(^|\" + whitespace + \")\" + className +\n\t\t\t\t\t\"(\" + whitespace + \"|$)\" ) ) &&\n\t\t\t\tclassCache( className, function( elem ) {\n\t\t\t\t\treturn pattern.test(\n\t\t\t\t\t\ttypeof elem.className === \"string\" && elem.className ||\n\t\t\t\t\t\t\ttypeof elem.getAttribute !== \"undefined\" &&\n\t\t\t\t\t\t\t\telem.getAttribute( \"class\" ) ||\n\t\t\t\t\t\t\t\"\"\n\t\t\t\t\t);\n\t\t\t\t} );\n\t\t},\n\n\t\tATTR: function( name, operator, check ) {\n\t\t\treturn function( elem ) {\n\t\t\t\tvar result = find.attr( elem, name );\n\n\t\t\t\tif ( result == null ) {\n\t\t\t\t\treturn operator === \"!=\";\n\t\t\t\t}\n\t\t\t\tif ( !operator ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tresult += \"\";\n\n\t\t\t\tif ( operator === \"=\" ) {\n\t\t\t\t\treturn result === check;\n\t\t\t\t}\n\t\t\t\tif ( operator === \"!=\" ) {\n\t\t\t\t\treturn result !== check;\n\t\t\t\t}\n\t\t\t\tif ( operator === \"^=\" ) {\n\t\t\t\t\treturn check && result.indexOf( check ) === 0;\n\t\t\t\t}\n\t\t\t\tif ( operator === \"*=\" ) {\n\t\t\t\t\treturn check && result.indexOf( check ) > -1;\n\t\t\t\t}\n\t\t\t\tif ( operator === \"$=\" ) {\n\t\t\t\t\treturn check && result.slice( -check.length ) === check;\n\t\t\t\t}\n\t\t\t\tif ( operator === \"~=\" ) {\n\t\t\t\t\treturn ( \" \" + result.replace( rwhitespace, \" \" ) + \" \" )\n\t\t\t\t\t\t.indexOf( check ) > -1;\n\t\t\t\t}\n\t\t\t\tif ( operator === \"|=\" ) {\n\t\t\t\t\treturn result === check || result.slice( 0, check.length + 1 ) === check + \"-\";\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t};\n\t\t},\n\n\t\tCHILD: function( type, what, _argument, first, last ) {\n\t\t\tvar simple = type.slice( 0, 3 ) !== \"nth\",\n\t\t\t\tforward = type.slice( -4 ) !== \"last\",\n\t\t\t\tofType = what === \"of-type\";\n\n\t\t\treturn first === 1 && last === 0 ?\n\n\t\t\t\t// Shortcut for :nth-*(n)\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn !!elem.parentNode;\n\t\t\t\t} :\n\n\t\t\t\tfunction( elem, _context, xml ) {\n\t\t\t\t\tvar cache, outerCache, node, nodeIndex, start,\n\t\t\t\t\t\tdir = simple !== forward ? \"nextSibling\" : \"previousSibling\",\n\t\t\t\t\t\tparent = elem.parentNode,\n\t\t\t\t\t\tname = ofType && elem.nodeName.toLowerCase(),\n\t\t\t\t\t\tuseCache = !xml && !ofType,\n\t\t\t\t\t\tdiff = false;\n\n\t\t\t\t\tif ( parent ) {\n\n\t\t\t\t\t\t// :(first|last|only)-(child|of-type)\n\t\t\t\t\t\tif ( simple ) {\n\t\t\t\t\t\t\twhile ( dir ) {\n\t\t\t\t\t\t\t\tnode = elem;\n\t\t\t\t\t\t\t\twhile ( ( node = node[ dir ] ) ) {\n\t\t\t\t\t\t\t\t\tif ( ofType ?\n\t\t\t\t\t\t\t\t\t\tnodeName( node, name ) :\n\t\t\t\t\t\t\t\t\t\tnode.nodeType === 1 ) {\n\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Reverse direction for :only-* (if we haven't yet done so)\n\t\t\t\t\t\t\t\tstart = dir = type === \"only\" && !start && \"nextSibling\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstart = [ forward ? parent.firstChild : parent.lastChild ];\n\n\t\t\t\t\t\t// non-xml :nth-child(...) stores cache data on `parent`\n\t\t\t\t\t\tif ( forward && useCache ) {\n\n\t\t\t\t\t\t\t// Seek `elem` from a previously-cached index\n\t\t\t\t\t\t\touterCache = parent[ expando ] || ( parent[ expando ] = {} );\n\t\t\t\t\t\t\tcache = outerCache[ type ] || [];\n\t\t\t\t\t\t\tnodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];\n\t\t\t\t\t\t\tdiff = nodeIndex && cache[ 2 ];\n\t\t\t\t\t\t\tnode = nodeIndex && parent.childNodes[ nodeIndex ];\n\n\t\t\t\t\t\t\twhile ( ( node = ++nodeIndex && node && node[ dir ] ||\n\n\t\t\t\t\t\t\t\t// Fallback to seeking `elem` from the start\n\t\t\t\t\t\t\t\t( diff = nodeIndex = 0 ) || start.pop() ) ) {\n\n\t\t\t\t\t\t\t\t// When found, cache indexes on `parent` and break\n\t\t\t\t\t\t\t\tif ( node.nodeType === 1 && ++diff && node === elem ) {\n\t\t\t\t\t\t\t\t\touterCache[ type ] = [ dirruns, nodeIndex, diff ];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Use previously-cached element index if available\n\t\t\t\t\t\t\tif ( useCache ) {\n\t\t\t\t\t\t\t\touterCache = elem[ expando ] || ( elem[ expando ] = {} );\n\t\t\t\t\t\t\t\tcache = outerCache[ type ] || [];\n\t\t\t\t\t\t\t\tnodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];\n\t\t\t\t\t\t\t\tdiff = nodeIndex;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// xml :nth-child(...)\n\t\t\t\t\t\t\t// or :nth-last-child(...) or :nth(-last)?-of-type(...)\n\t\t\t\t\t\t\tif ( diff === false ) {\n\n\t\t\t\t\t\t\t\t// Use the same loop as above to seek `elem` from the start\n\t\t\t\t\t\t\t\twhile ( ( node = ++nodeIndex && node && node[ dir ] ||\n\t\t\t\t\t\t\t\t\t( diff = nodeIndex = 0 ) || start.pop() ) ) {\n\n\t\t\t\t\t\t\t\t\tif ( ( ofType ?\n\t\t\t\t\t\t\t\t\t\tnodeName( node, name ) :\n\t\t\t\t\t\t\t\t\t\tnode.nodeType === 1 ) &&\n\t\t\t\t\t\t\t\t\t\t++diff ) {\n\n\t\t\t\t\t\t\t\t\t\t// Cache the index of each encountered element\n\t\t\t\t\t\t\t\t\t\tif ( useCache ) {\n\t\t\t\t\t\t\t\t\t\t\touterCache = node[ expando ] ||\n\t\t\t\t\t\t\t\t\t\t\t\t( node[ expando ] = {} );\n\t\t\t\t\t\t\t\t\t\t\touterCache[ type ] = [ dirruns, diff ];\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tif ( node === elem ) {\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Incorporate the offset, then check against cycle size\n\t\t\t\t\t\tdiff -= last;\n\t\t\t\t\t\treturn diff === first || ( diff % first === 0 && diff / first >= 0 );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t},\n\n\t\tPSEUDO: function( pseudo, argument ) {\n\n\t\t\t// pseudo-class names are case-insensitive\n\t\t\t// https://www.w3.org/TR/selectors/#pseudo-classes\n\t\t\t// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters\n\t\t\t// Remember that setFilters inherits from pseudos\n\t\t\tvar args,\n\t\t\t\tfn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||\n\t\t\t\t\tfind.error( \"unsupported pseudo: \" + pseudo );\n\n\t\t\t// The user may use createPseudo to indicate that\n\t\t\t// arguments are needed to create the filter function\n\t\t\t// just as jQuery does\n\t\t\tif ( fn[ expando ] ) {\n\t\t\t\treturn fn( argument );\n\t\t\t}\n\n\t\t\t// But maintain support for old signatures\n\t\t\tif ( fn.length > 1 ) {\n\t\t\t\targs = [ pseudo, pseudo, \"\", argument ];\n\t\t\t\treturn Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?\n\t\t\t\t\tmarkFunction( function( seed, matches ) {\n\t\t\t\t\t\tvar idx,\n\t\t\t\t\t\t\tmatched = fn( seed, argument ),\n\t\t\t\t\t\t\ti = matched.length;\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tidx = indexOf.call( seed, matched[ i ] );\n\t\t\t\t\t\t\tseed[ idx ] = !( matches[ idx ] = matched[ i ] );\n\t\t\t\t\t\t}\n\t\t\t\t\t} ) :\n\t\t\t\t\tfunction( elem ) {\n\t\t\t\t\t\treturn fn( elem, 0, args );\n\t\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn fn;\n\t\t}\n\t},\n\n\tpseudos: {\n\n\t\t// Potentially complex pseudos\n\t\tnot: markFunction( function( selector ) {\n\n\t\t\t// Trim the selector passed to compile\n\t\t\t// to avoid treating leading and trailing\n\t\t\t// spaces as combinators\n\t\t\tvar input = [],\n\t\t\t\tresults = [],\n\t\t\t\tmatcher = compile( selector.replace( rtrimCSS, \"$1\" ) );\n\n\t\t\treturn matcher[ expando ] ?\n\t\t\t\tmarkFunction( function( seed, matches, _context, xml ) {\n\t\t\t\t\tvar elem,\n\t\t\t\t\t\tunmatched = matcher( seed, null, xml, [] ),\n\t\t\t\t\t\ti = seed.length;\n\n\t\t\t\t\t// Match elements unmatched by `matcher`\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( ( elem = unmatched[ i ] ) ) {\n\t\t\t\t\t\t\tseed[ i ] = !( matches[ i ] = elem );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} ) :\n\t\t\t\tfunction( elem, _context, xml ) {\n\t\t\t\t\tinput[ 0 ] = elem;\n\t\t\t\t\tmatcher( input, null, xml, results );\n\n\t\t\t\t\t// Don't keep the element\n\t\t\t\t\t// (see https://github.com/jquery/sizzle/issues/299)\n\t\t\t\t\tinput[ 0 ] = null;\n\t\t\t\t\treturn !results.pop();\n\t\t\t\t};\n\t\t} ),\n\n\t\thas: markFunction( function( selector ) {\n\t\t\treturn function( elem ) {\n\t\t\t\treturn find( selector, elem ).length > 0;\n\t\t\t};\n\t\t} ),\n\n\t\tcontains: markFunction( function( text ) {\n\t\t\ttext = text.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\treturn ( elem.textContent || jQuery.text( elem ) ).indexOf( text ) > -1;\n\t\t\t};\n\t\t} ),\n\n\t\t// \"Whether an element is represented by a :lang() selector\n\t\t// is based solely on the element's language value\n\t\t// being equal to the identifier C,\n\t\t// or beginning with the identifier C immediately followed by \"-\".\n\t\t// The matching of C against the element's language value is performed case-insensitively.\n\t\t// The identifier C does not have to be a valid language name.\"\n\t\t// https://www.w3.org/TR/selectors/#lang-pseudo\n\t\tlang: markFunction( function( lang ) {\n\n\t\t\t// lang value must be a valid identifier\n\t\t\tif ( !ridentifier.test( lang || \"\" ) ) {\n\t\t\t\tfind.error( \"unsupported lang: \" + lang );\n\t\t\t}\n\t\t\tlang = lang.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn function( elem ) {\n\t\t\t\tvar elemLang;\n\t\t\t\tdo {\n\t\t\t\t\tif ( ( elemLang = documentIsHTML ?\n\t\t\t\t\t\telem.lang :\n\t\t\t\t\t\telem.getAttribute( \"xml:lang\" ) || elem.getAttribute( \"lang\" ) ) ) {\n\n\t\t\t\t\t\telemLang = elemLang.toLowerCase();\n\t\t\t\t\t\treturn elemLang === lang || elemLang.indexOf( lang + \"-\" ) === 0;\n\t\t\t\t\t}\n\t\t\t\t} while ( ( elem = elem.parentNode ) && elem.nodeType === 1 );\n\t\t\t\treturn false;\n\t\t\t};\n\t\t} ),\n\n\t\t// Miscellaneous\n\t\ttarget: function( elem ) {\n\t\t\tvar hash = window.location && window.location.hash;\n\t\t\treturn hash && hash.slice( 1 ) === elem.id;\n\t\t},\n\n\t\troot: function( elem ) {\n\t\t\treturn elem === documentElement;\n\t\t},\n\n\t\tfocus: function( elem ) {\n\t\t\treturn elem === safeActiveElement() &&\n\t\t\t\tdocument.hasFocus() &&\n\t\t\t\t!!( elem.type || elem.href || ~elem.tabIndex );\n\t\t},\n\n\t\t// Boolean properties\n\t\tenabled: createDisabledPseudo( false ),\n\t\tdisabled: createDisabledPseudo( true ),\n\n\t\tchecked: function( elem ) {\n\n\t\t\t// In CSS3, :checked should return both checked and selected elements\n\t\t\t// https://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\treturn ( nodeName( elem, \"input\" ) && !!elem.checked ) ||\n\t\t\t\t( nodeName( elem, \"option\" ) && !!elem.selected );\n\t\t},\n\n\t\tselected: function( elem ) {\n\n\t\t\t// Support: IE <=11+\n\t\t\t// Accessing the selectedIndex property\n\t\t\t// forces the browser to treat the default option as\n\t\t\t// selected when in an optgroup.\n\t\t\tif ( elem.parentNode ) {\n\t\t\t\t// eslint-disable-next-line no-unused-expressions\n\t\t\t\telem.parentNode.selectedIndex;\n\t\t\t}\n\n\t\t\treturn elem.selected === true;\n\t\t},\n\n\t\t// Contents\n\t\tempty: function( elem ) {\n\n\t\t\t// https://www.w3.org/TR/selectors/#empty-pseudo\n\t\t\t// :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),\n\t\t\t// but not by others (comment: 8; processing instruction: 7; etc.)\n\t\t\t// nodeType < 6 works because attributes (2) do not appear as children\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tif ( elem.nodeType < 6 ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\n\t\tparent: function( elem ) {\n\t\t\treturn !Expr.pseudos.empty( elem );\n\t\t},\n\n\t\t// Element/input types\n\t\theader: function( elem ) {\n\t\t\treturn rheader.test( elem.nodeName );\n\t\t},\n\n\t\tinput: function( elem ) {\n\t\t\treturn rinputs.test( elem.nodeName );\n\t\t},\n\n\t\tbutton: function( elem ) {\n\t\t\treturn nodeName( elem, \"input\" ) && elem.type === \"button\" ||\n\t\t\t\tnodeName( elem, \"button\" );\n\t\t},\n\n\t\ttext: function( elem ) {\n\t\t\tvar attr;\n\t\t\treturn nodeName( elem, \"input\" ) && elem.type === \"text\" &&\n\n\t\t\t\t// Support: IE <10 only\n\t\t\t\t// New HTML5 attribute values (e.g., \"search\") appear\n\t\t\t\t// with elem.type === \"text\"\n\t\t\t\t( ( attr = elem.getAttribute( \"type\" ) ) == null ||\n\t\t\t\t\tattr.toLowerCase() === \"text\" );\n\t\t},\n\n\t\t// Position-in-collection\n\t\tfirst: createPositionalPseudo( function() {\n\t\t\treturn [ 0 ];\n\t\t} ),\n\n\t\tlast: createPositionalPseudo( function( _matchIndexes, length ) {\n\t\t\treturn [ length - 1 ];\n\t\t} ),\n\n\t\teq: createPositionalPseudo( function( _matchIndexes, length, argument ) {\n\t\t\treturn [ argument < 0 ? argument + length : argument ];\n\t\t} ),\n\n\t\teven: createPositionalPseudo( function( matchIndexes, length ) {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} ),\n\n\t\todd: createPositionalPseudo( function( matchIndexes, length ) {\n\t\t\tvar i = 1;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} ),\n\n\t\tlt: createPositionalPseudo( function( matchIndexes, length, argument ) {\n\t\t\tvar i;\n\n\t\t\tif ( argument < 0 ) {\n\t\t\t\ti = argument + length;\n\t\t\t} else if ( argument > length ) {\n\t\t\t\ti = length;\n\t\t\t} else {\n\t\t\t\ti = argument;\n\t\t\t}\n\n\t\t\tfor ( ; --i >= 0; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} ),\n\n\t\tgt: createPositionalPseudo( function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ? argument + length : argument;\n\t\t\tfor ( ; ++i < length; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} )\n\t}\n};\n\nExpr.pseudos.nth = Expr.pseudos.eq;\n\n// Add button/input type pseudos\nfor ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {\n\tExpr.pseudos[ i ] = createInputPseudo( i );\n}\nfor ( i in { submit: true, reset: true } ) {\n\tExpr.pseudos[ i ] = createButtonPseudo( i );\n}\n\n// Easy API for creating new setFilters\nfunction setFilters() {}\nsetFilters.prototype = Expr.filters = Expr.pseudos;\nExpr.setFilters = new setFilters();\n\nfunction tokenize( selector, parseOnly ) {\n\tvar matched, match, tokens, type,\n\t\tsoFar, groups, preFilters,\n\t\tcached = tokenCache[ selector + \" \" ];\n\n\tif ( cached ) {\n\t\treturn parseOnly ? 0 : cached.slice( 0 );\n\t}\n\n\tsoFar = selector;\n\tgroups = [];\n\tpreFilters = Expr.preFilter;\n\n\twhile ( soFar ) {\n\n\t\t// Comma and first run\n\t\tif ( !matched || ( match = rcomma.exec( soFar ) ) ) {\n\t\t\tif ( match ) {\n\n\t\t\t\t// Don't consume trailing commas as valid\n\t\t\t\tsoFar = soFar.slice( match[ 0 ].length ) || soFar;\n\t\t\t}\n\t\t\tgroups.push( ( tokens = [] ) );\n\t\t}\n\n\t\tmatched = false;\n\n\t\t// Combinators\n\t\tif ( ( match = rleadingCombinator.exec( soFar ) ) ) {\n\t\t\tmatched = match.shift();\n\t\t\ttokens.push( {\n\t\t\t\tvalue: matched,\n\n\t\t\t\t// Cast descendant combinators to space\n\t\t\t\ttype: match[ 0 ].replace( rtrimCSS, \" \" )\n\t\t\t} );\n\t\t\tsoFar = soFar.slice( matched.length );\n\t\t}\n\n\t\t// Filters\n\t\tfor ( type in Expr.filter ) {\n\t\t\tif ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] ||\n\t\t\t\t( match = preFilters[ type ]( match ) ) ) ) {\n\t\t\t\tmatched = match.shift();\n\t\t\t\ttokens.push( {\n\t\t\t\t\tvalue: matched,\n\t\t\t\t\ttype: type,\n\t\t\t\t\tmatches: match\n\t\t\t\t} );\n\t\t\t\tsoFar = soFar.slice( matched.length );\n\t\t\t}\n\t\t}\n\n\t\tif ( !matched ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Return the length of the invalid excess\n\t// if we're just parsing\n\t// Otherwise, throw an error or return tokens\n\tif ( parseOnly ) {\n\t\treturn soFar.length;\n\t}\n\n\treturn soFar ?\n\t\tfind.error( selector ) :\n\n\t\t// Cache the tokens\n\t\ttokenCache( selector, groups ).slice( 0 );\n}\n\nfunction toSelector( tokens ) {\n\tvar i = 0,\n\t\tlen = tokens.length,\n\t\tselector = \"\";\n\tfor ( ; i < len; i++ ) {\n\t\tselector += tokens[ i ].value;\n\t}\n\treturn selector;\n}\n\nfunction addCombinator( matcher, combinator, base ) {\n\tvar dir = combinator.dir,\n\t\tskip = combinator.next,\n\t\tkey = skip || dir,\n\t\tcheckNonElements = base && key === \"parentNode\",\n\t\tdoneName = done++;\n\n\treturn combinator.first ?\n\n\t\t// Check against closest ancestor/preceding element\n\t\tfunction( elem, context, xml ) {\n\t\t\twhile ( ( elem = elem[ dir ] ) ) {\n\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\treturn matcher( elem, context, xml );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t} :\n\n\t\t// Check against all ancestor/preceding elements\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar oldCache, outerCache,\n\t\t\t\tnewCache = [ dirruns, doneName ];\n\n\t\t\t// We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching\n\t\t\tif ( xml ) {\n\t\t\t\twhile ( ( elem = elem[ dir ] ) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\tif ( matcher( elem, context, xml ) ) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\twhile ( ( elem = elem[ dir ] ) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\touterCache = elem[ expando ] || ( elem[ expando ] = {} );\n\n\t\t\t\t\t\tif ( skip && nodeName( elem, skip ) ) {\n\t\t\t\t\t\t\telem = elem[ dir ] || elem;\n\t\t\t\t\t\t} else if ( ( oldCache = outerCache[ key ] ) &&\n\t\t\t\t\t\t\toldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {\n\n\t\t\t\t\t\t\t// Assign to newCache so results back-propagate to previous elements\n\t\t\t\t\t\t\treturn ( newCache[ 2 ] = oldCache[ 2 ] );\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Reuse newcache so results back-propagate to previous elements\n\t\t\t\t\t\t\touterCache[ key ] = newCache;\n\n\t\t\t\t\t\t\t// A match means we're done; a fail means we have to keep checking\n\t\t\t\t\t\t\tif ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) {\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n}\n\nfunction elementMatcher( matchers ) {\n\treturn matchers.length > 1 ?\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar i = matchers.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( !matchers[ i ]( elem, context, xml ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} :\n\t\tmatchers[ 0 ];\n}\n\nfunction multipleContexts( selector, contexts, results ) {\n\tvar i = 0,\n\t\tlen = contexts.length;\n\tfor ( ; i < len; i++ ) {\n\t\tfind( selector, contexts[ i ], results );\n\t}\n\treturn results;\n}\n\nfunction condense( unmatched, map, filter, context, xml ) {\n\tvar elem,\n\t\tnewUnmatched = [],\n\t\ti = 0,\n\t\tlen = unmatched.length,\n\t\tmapped = map != null;\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( ( elem = unmatched[ i ] ) ) {\n\t\t\tif ( !filter || filter( elem, context, xml ) ) {\n\t\t\t\tnewUnmatched.push( elem );\n\t\t\t\tif ( mapped ) {\n\t\t\t\t\tmap.push( i );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn newUnmatched;\n}\n\nfunction setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {\n\tif ( postFilter && !postFilter[ expando ] ) {\n\t\tpostFilter = setMatcher( postFilter );\n\t}\n\tif ( postFinder && !postFinder[ expando ] ) {\n\t\tpostFinder = setMatcher( postFinder, postSelector );\n\t}\n\treturn markFunction( function( seed, results, context, xml ) {\n\t\tvar temp, i, elem, matcherOut,\n\t\t\tpreMap = [],\n\t\t\tpostMap = [],\n\t\t\tpreexisting = results.length,\n\n\t\t\t// Get initial elements from seed or context\n\t\t\telems = seed ||\n\t\t\t\tmultipleContexts( selector || \"*\",\n\t\t\t\t\tcontext.nodeType ? [ context ] : context, [] ),\n\n\t\t\t// Prefilter to get matcher input, preserving a map for seed-results synchronization\n\t\t\tmatcherIn = preFilter && ( seed || !selector ) ?\n\t\t\t\tcondense( elems, preMap, preFilter, context, xml ) :\n\t\t\t\telems;\n\n\t\tif ( matcher ) {\n\n\t\t\t// If we have a postFinder, or filtered seed, or non-seed postFilter\n\t\t\t// or preexisting results,\n\t\t\tmatcherOut = postFinder || ( seed ? preFilter : preexisting || postFilter ) ?\n\n\t\t\t\t// ...intermediate processing is necessary\n\t\t\t\t[] :\n\n\t\t\t\t// ...otherwise use results directly\n\t\t\t\tresults;\n\n\t\t\t// Find primary matches\n\t\t\tmatcher( matcherIn, matcherOut, context, xml );\n\t\t} else {\n\t\t\tmatcherOut = matcherIn;\n\t\t}\n\n\t\t// Apply postFilter\n\t\tif ( postFilter ) {\n\t\t\ttemp = condense( matcherOut, postMap );\n\t\t\tpostFilter( temp, [], context, xml );\n\n\t\t\t// Un-match failing elements by moving them back to matcherIn\n\t\t\ti = temp.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( ( elem = temp[ i ] ) ) {\n\t\t\t\t\tmatcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( seed ) {\n\t\t\tif ( postFinder || preFilter ) {\n\t\t\t\tif ( postFinder ) {\n\n\t\t\t\t\t// Get the final matcherOut by condensing this intermediate into postFinder contexts\n\t\t\t\t\ttemp = [];\n\t\t\t\t\ti = matcherOut.length;\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( ( elem = matcherOut[ i ] ) ) {\n\n\t\t\t\t\t\t\t// Restore matcherIn since elem is not yet a final match\n\t\t\t\t\t\t\ttemp.push( ( matcherIn[ i ] = elem ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpostFinder( null, ( matcherOut = [] ), temp, xml );\n\t\t\t\t}\n\n\t\t\t\t// Move matched elements from seed to results to keep them synchronized\n\t\t\t\ti = matcherOut.length;\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\tif ( ( elem = matcherOut[ i ] ) &&\n\t\t\t\t\t\t( temp = postFinder ? indexOf.call( seed, elem ) : preMap[ i ] ) > -1 ) {\n\n\t\t\t\t\t\tseed[ temp ] = !( results[ temp ] = elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Add elements to results, through postFinder if defined\n\t\t} else {\n\t\t\tmatcherOut = condense(\n\t\t\t\tmatcherOut === results ?\n\t\t\t\t\tmatcherOut.splice( preexisting, matcherOut.length ) :\n\t\t\t\t\tmatcherOut\n\t\t\t);\n\t\t\tif ( postFinder ) {\n\t\t\t\tpostFinder( null, results, matcherOut, xml );\n\t\t\t} else {\n\t\t\t\tpush.apply( results, matcherOut );\n\t\t\t}\n\t\t}\n\t} );\n}\n\nfunction matcherFromTokens( tokens ) {\n\tvar checkContext, matcher, j,\n\t\tlen = tokens.length,\n\t\tleadingRelative = Expr.relative[ tokens[ 0 ].type ],\n\t\timplicitRelative = leadingRelative || Expr.relative[ \" \" ],\n\t\ti = leadingRelative ? 1 : 0,\n\n\t\t// The foundational matcher ensures that elements are reachable from top-level context(s)\n\t\tmatchContext = addCombinator( function( elem ) {\n\t\t\treturn elem === checkContext;\n\t\t}, implicitRelative, true ),\n\t\tmatchAnyContext = addCombinator( function( elem ) {\n\t\t\treturn indexOf.call( checkContext, elem ) > -1;\n\t\t}, implicitRelative, true ),\n\t\tmatchers = [ function( elem, context, xml ) {\n\n\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t// two documents; shallow comparisons work.\n\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\tvar ret = ( !leadingRelative && ( xml || context != outermostContext ) ) || (\n\t\t\t\t( checkContext = context ).nodeType ?\n\t\t\t\t\tmatchContext( elem, context, xml ) :\n\t\t\t\t\tmatchAnyContext( elem, context, xml ) );\n\n\t\t\t// Avoid hanging onto element\n\t\t\t// (see https://github.com/jquery/sizzle/issues/299)\n\t\t\tcheckContext = null;\n\t\t\treturn ret;\n\t\t} ];\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) {\n\t\t\tmatchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];\n\t\t} else {\n\t\t\tmatcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches );\n\n\t\t\t// Return special upon seeing a positional matcher\n\t\t\tif ( matcher[ expando ] ) {\n\n\t\t\t\t// Find the next relative operator (if any) for proper handling\n\t\t\t\tj = ++i;\n\t\t\t\tfor ( ; j < len; j++ ) {\n\t\t\t\t\tif ( Expr.relative[ tokens[ j ].type ] ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn setMatcher(\n\t\t\t\t\ti > 1 && elementMatcher( matchers ),\n\t\t\t\t\ti > 1 && toSelector(\n\n\t\t\t\t\t\t// If the preceding token was a descendant combinator, insert an implicit any-element `*`\n\t\t\t\t\t\ttokens.slice( 0, i - 1 )\n\t\t\t\t\t\t\t.concat( { value: tokens[ i - 2 ].type === \" \" ? \"*\" : \"\" } )\n\t\t\t\t\t).replace( rtrimCSS, \"$1\" ),\n\t\t\t\t\tmatcher,\n\t\t\t\t\ti < j && matcherFromTokens( tokens.slice( i, j ) ),\n\t\t\t\t\tj < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ),\n\t\t\t\t\tj < len && toSelector( tokens )\n\t\t\t\t);\n\t\t\t}\n\t\t\tmatchers.push( matcher );\n\t\t}\n\t}\n\n\treturn elementMatcher( matchers );\n}\n\nfunction matcherFromGroupMatchers( elementMatchers, setMatchers ) {\n\tvar bySet = setMatchers.length > 0,\n\t\tbyElement = elementMatchers.length > 0,\n\t\tsuperMatcher = function( seed, context, xml, results, outermost ) {\n\t\t\tvar elem, j, matcher,\n\t\t\t\tmatchedCount = 0,\n\t\t\t\ti = \"0\",\n\t\t\t\tunmatched = seed && [],\n\t\t\t\tsetMatched = [],\n\t\t\t\tcontextBackup = outermostContext,\n\n\t\t\t\t// We must always have either seed elements or outermost context\n\t\t\t\telems = seed || byElement && Expr.find.TAG( \"*\", outermost ),\n\n\t\t\t\t// Use integer dirruns iff this is the outermost matcher\n\t\t\t\tdirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ),\n\t\t\t\tlen = elems.length;\n\n\t\t\tif ( outermost ) {\n\n\t\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t\t// two documents; shallow comparisons work.\n\t\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\t\toutermostContext = context == document || context || outermost;\n\t\t\t}\n\n\t\t\t// Add elements passing elementMatchers directly to results\n\t\t\t// Support: iOS <=7 - 9 only\n\t\t\t// Tolerate NodeList properties (IE: \"length\"; Safari: ) matching\n\t\t\t// elements by id. (see trac-14142)\n\t\t\tfor ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) {\n\t\t\t\tif ( byElement && elem ) {\n\t\t\t\t\tj = 0;\n\n\t\t\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t\t\t// two documents; shallow comparisons work.\n\t\t\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\t\t\tif ( !context && elem.ownerDocument != document ) {\n\t\t\t\t\t\tsetDocument( elem );\n\t\t\t\t\t\txml = !documentIsHTML;\n\t\t\t\t\t}\n\t\t\t\t\twhile ( ( matcher = elementMatchers[ j++ ] ) ) {\n\t\t\t\t\t\tif ( matcher( elem, context || document, xml ) ) {\n\t\t\t\t\t\t\tpush.call( results, elem );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( outermost ) {\n\t\t\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Track unmatched elements for set filters\n\t\t\t\tif ( bySet ) {\n\n\t\t\t\t\t// They will have gone through all possible matchers\n\t\t\t\t\tif ( ( elem = !matcher && elem ) ) {\n\t\t\t\t\t\tmatchedCount--;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Lengthen the array for every element, matched or not\n\t\t\t\t\tif ( seed ) {\n\t\t\t\t\t\tunmatched.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// `i` is now the count of elements visited above, and adding it to `matchedCount`\n\t\t\t// makes the latter nonnegative.\n\t\t\tmatchedCount += i;\n\n\t\t\t// Apply set filters to unmatched elements\n\t\t\t// NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`\n\t\t\t// equals `i`), unless we didn't visit _any_ elements in the above loop because we have\n\t\t\t// no element matchers and no seed.\n\t\t\t// Incrementing an initially-string \"0\" `i` allows `i` to remain a string only in that\n\t\t\t// case, which will result in a \"00\" `matchedCount` that differs from `i` but is also\n\t\t\t// numerically zero.\n\t\t\tif ( bySet && i !== matchedCount ) {\n\t\t\t\tj = 0;\n\t\t\t\twhile ( ( matcher = setMatchers[ j++ ] ) ) {\n\t\t\t\t\tmatcher( unmatched, setMatched, context, xml );\n\t\t\t\t}\n\n\t\t\t\tif ( seed ) {\n\n\t\t\t\t\t// Reintegrate element matches to eliminate the need for sorting\n\t\t\t\t\tif ( matchedCount > 0 ) {\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tif ( !( unmatched[ i ] || setMatched[ i ] ) ) {\n\t\t\t\t\t\t\t\tsetMatched[ i ] = pop.call( results );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Discard index placeholder values to get only actual matches\n\t\t\t\t\tsetMatched = condense( setMatched );\n\t\t\t\t}\n\n\t\t\t\t// Add matches to results\n\t\t\t\tpush.apply( results, setMatched );\n\n\t\t\t\t// Seedless set matches succeeding multiple successful matchers stipulate sorting\n\t\t\t\tif ( outermost && !seed && setMatched.length > 0 &&\n\t\t\t\t\t( matchedCount + setMatchers.length ) > 1 ) {\n\n\t\t\t\t\tjQuery.uniqueSort( results );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Override manipulation of globals by nested matchers\n\t\t\tif ( outermost ) {\n\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\toutermostContext = contextBackup;\n\t\t\t}\n\n\t\t\treturn unmatched;\n\t\t};\n\n\treturn bySet ?\n\t\tmarkFunction( superMatcher ) :\n\t\tsuperMatcher;\n}\n\nfunction compile( selector, match /* Internal Use Only */ ) {\n\tvar i,\n\t\tsetMatchers = [],\n\t\telementMatchers = [],\n\t\tcached = compilerCache[ selector + \" \" ];\n\n\tif ( !cached ) {\n\n\t\t// Generate a function of recursive functions that can be used to check each element\n\t\tif ( !match ) {\n\t\t\tmatch = tokenize( selector );\n\t\t}\n\t\ti = match.length;\n\t\twhile ( i-- ) {\n\t\t\tcached = matcherFromTokens( match[ i ] );\n\t\t\tif ( cached[ expando ] ) {\n\t\t\t\tsetMatchers.push( cached );\n\t\t\t} else {\n\t\t\t\telementMatchers.push( cached );\n\t\t\t}\n\t\t}\n\n\t\t// Cache the compiled function\n\t\tcached = compilerCache( selector,\n\t\t\tmatcherFromGroupMatchers( elementMatchers, setMatchers ) );\n\n\t\t// Save selector and tokenization\n\t\tcached.selector = selector;\n\t}\n\treturn cached;\n}\n\n/**\n * A low-level selection function that works with jQuery's compiled\n * selector functions\n * @param {String|Function} selector A selector or a pre-compiled\n * selector function built with jQuery selector compile\n * @param {Element} context\n * @param {Array} [results]\n * @param {Array} [seed] A set of elements to match against\n */\nfunction select( selector, context, results, seed ) {\n\tvar i, tokens, token, type, find,\n\t\tcompiled = typeof selector === \"function\" && selector,\n\t\tmatch = !seed && tokenize( ( selector = compiled.selector || selector ) );\n\n\tresults = results || [];\n\n\t// Try to minimize operations if there is only one selector in the list and no seed\n\t// (the latter of which guarantees us context)\n\tif ( match.length === 1 ) {\n\n\t\t// Reduce context if the leading compound selector is an ID\n\t\ttokens = match[ 0 ] = match[ 0 ].slice( 0 );\n\t\tif ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === \"ID\" &&\n\t\t\t\tcontext.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) {\n\n\t\t\tcontext = ( Expr.find.ID(\n\t\t\t\ttoken.matches[ 0 ].replace( runescape, funescape ),\n\t\t\t\tcontext\n\t\t\t) || [] )[ 0 ];\n\t\t\tif ( !context ) {\n\t\t\t\treturn results;\n\n\t\t\t// Precompiled matchers will still verify ancestry, so step up a level\n\t\t\t} else if ( compiled ) {\n\t\t\t\tcontext = context.parentNode;\n\t\t\t}\n\n\t\t\tselector = selector.slice( tokens.shift().value.length );\n\t\t}\n\n\t\t// Fetch a seed set for right-to-left matching\n\t\ti = matchExpr.needsContext.test( selector ) ? 0 : tokens.length;\n\t\twhile ( i-- ) {\n\t\t\ttoken = tokens[ i ];\n\n\t\t\t// Abort if we hit a combinator\n\t\t\tif ( Expr.relative[ ( type = token.type ) ] ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( ( find = Expr.find[ type ] ) ) {\n\n\t\t\t\t// Search, expanding context for leading sibling combinators\n\t\t\t\tif ( ( seed = find(\n\t\t\t\t\ttoken.matches[ 0 ].replace( runescape, funescape ),\n\t\t\t\t\trsibling.test( tokens[ 0 ].type ) &&\n\t\t\t\t\t\ttestContext( context.parentNode ) || context\n\t\t\t\t) ) ) {\n\n\t\t\t\t\t// If seed is empty or no tokens remain, we can return early\n\t\t\t\t\ttokens.splice( i, 1 );\n\t\t\t\t\tselector = seed.length && toSelector( tokens );\n\t\t\t\t\tif ( !selector ) {\n\t\t\t\t\t\tpush.apply( results, seed );\n\t\t\t\t\t\treturn results;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Compile and execute a filtering function if one is not provided\n\t// Provide `match` to avoid retokenization if we modified the selector above\n\t( compiled || compile( selector, match ) )(\n\t\tseed,\n\t\tcontext,\n\t\t!documentIsHTML,\n\t\tresults,\n\t\t!context || rsibling.test( selector ) && testContext( context.parentNode ) || context\n\t);\n\treturn results;\n}\n\n// One-time assignments\n\n// Support: Android <=4.0 - 4.1+\n// Sort stability\nsupport.sortStable = expando.split( \"\" ).sort( sortOrder ).join( \"\" ) === expando;\n\n// Initialize against the default document\nsetDocument();\n\n// Support: Android <=4.0 - 4.1+\n// Detached nodes confoundingly follow *each other*\nsupport.sortDetached = assert( function( el ) {\n\n\t// Should return 1, but returns 4 (following)\n\treturn el.compareDocumentPosition( document.createElement( \"fieldset\" ) ) & 1;\n} );\n\njQuery.find = find;\n\n// Deprecated\njQuery.expr[ \":\" ] = jQuery.expr.pseudos;\njQuery.unique = jQuery.uniqueSort;\n\n// These have always been private, but they used to be documented as part of\n// Sizzle so let's maintain them for now for backwards compatibility purposes.\nfind.compile = compile;\nfind.select = select;\nfind.setDocument = setDocument;\nfind.tokenize = tokenize;\n\nfind.escape = jQuery.escapeSelector;\nfind.getText = jQuery.text;\nfind.isXML = jQuery.isXMLDoc;\nfind.selectors = jQuery.expr;\nfind.support = jQuery.support;\nfind.uniqueSort = jQuery.uniqueSort;\n\n\t/* eslint-enable */\n\n} )();\n\n\nvar dir = function( elem, dir, until ) {\n\tvar matched = [],\n\t\ttruncate = until !== undefined;\n\n\twhile ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {\n\t\tif ( elem.nodeType === 1 ) {\n\t\t\tif ( truncate && jQuery( elem ).is( until ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tmatched.push( elem );\n\t\t}\n\t}\n\treturn matched;\n};\n\n\nvar siblings = function( n, elem ) {\n\tvar matched = [];\n\n\tfor ( ; n; n = n.nextSibling ) {\n\t\tif ( n.nodeType === 1 && n !== elem ) {\n\t\t\tmatched.push( n );\n\t\t}\n\t}\n\n\treturn matched;\n};\n\n\nvar rneedsContext = jQuery.expr.match.needsContext;\n\nvar rsingleTag = ( /^<([a-z][^\\/\\0>:\\x20\\t\\r\\n\\f]*)[\\x20\\t\\r\\n\\f]*\\/?>(?:<\\/\\1>|)$/i );\n\n\n\n// Implement the identical functionality for filter and not\nfunction winnow( elements, qualifier, not ) {\n\tif ( isFunction( qualifier ) ) {\n\t\treturn jQuery.grep( elements, function( elem, i ) {\n\t\t\treturn !!qualifier.call( elem, i, elem ) !== not;\n\t\t} );\n\t}\n\n\t// Single element\n\tif ( qualifier.nodeType ) {\n\t\treturn jQuery.grep( elements, function( elem ) {\n\t\t\treturn ( elem === qualifier ) !== not;\n\t\t} );\n\t}\n\n\t// Arraylike of elements (jQuery, arguments, Array)\n\tif ( typeof qualifier !== \"string\" ) {\n\t\treturn jQuery.grep( elements, function( elem ) {\n\t\t\treturn ( indexOf.call( qualifier, elem ) > -1 ) !== not;\n\t\t} );\n\t}\n\n\t// Filtered directly for both simple and complex selectors\n\treturn jQuery.filter( qualifier, elements, not );\n}\n\njQuery.filter = function( expr, elems, not ) {\n\tvar elem = elems[ 0 ];\n\n\tif ( not ) {\n\t\texpr = \":not(\" + expr + \")\";\n\t}\n\n\tif ( elems.length === 1 && elem.nodeType === 1 ) {\n\t\treturn jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];\n\t}\n\n\treturn jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {\n\t\treturn elem.nodeType === 1;\n\t} ) );\n};\n\njQuery.fn.extend( {\n\tfind: function( selector ) {\n\t\tvar i, ret,\n\t\t\tlen = this.length,\n\t\t\tself = this;\n\n\t\tif ( typeof selector !== \"string\" ) {\n\t\t\treturn this.pushStack( jQuery( selector ).filter( function() {\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tif ( jQuery.contains( self[ i ], this ) ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} ) );\n\t\t}\n\n\t\tret = this.pushStack( [] );\n\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tjQuery.find( selector, self[ i ], ret );\n\t\t}\n\n\t\treturn len > 1 ? jQuery.uniqueSort( ret ) : ret;\n\t},\n\tfilter: function( selector ) {\n\t\treturn this.pushStack( winnow( this, selector || [], false ) );\n\t},\n\tnot: function( selector ) {\n\t\treturn this.pushStack( winnow( this, selector || [], true ) );\n\t},\n\tis: function( selector ) {\n\t\treturn !!winnow(\n\t\t\tthis,\n\n\t\t\t// If this is a positional/relative selector, check membership in the returned set\n\t\t\t// so $(\"p:first\").is(\"p:last\") won't return true for a doc with two \"p\".\n\t\t\ttypeof selector === \"string\" && rneedsContext.test( selector ) ?\n\t\t\t\tjQuery( selector ) :\n\t\t\t\tselector || [],\n\t\t\tfalse\n\t\t).length;\n\t}\n} );\n\n\n// Initialize a jQuery object\n\n\n// A central reference to the root jQuery(document)\nvar rootjQuery,\n\n\t// A simple way to check for HTML strings\n\t// Prioritize #id over to avoid XSS via location.hash (trac-9521)\n\t// Strict HTML recognition (trac-11290: must start with <)\n\t// Shortcut simple #id case for speed\n\trquickExpr = /^(?:\\s*(<[\\w\\W]+>)[^>]*|#([\\w-]+))$/,\n\n\tinit = jQuery.fn.init = function( selector, context, root ) {\n\t\tvar match, elem;\n\n\t\t// HANDLE: $(\"\"), $(null), $(undefined), $(false)\n\t\tif ( !selector ) {\n\t\t\treturn this;\n\t\t}\n\n\t\t// Method init() accepts an alternate rootjQuery\n\t\t// so migrate can support jQuery.sub (gh-2101)\n\t\troot = root || rootjQuery;\n\n\t\t// Handle HTML strings\n\t\tif ( typeof selector === \"string\" ) {\n\t\t\tif ( selector[ 0 ] === \"<\" &&\n\t\t\t\tselector[ selector.length - 1 ] === \">\" &&\n\t\t\t\tselector.length >= 3 ) {\n\n\t\t\t\t// Assume that strings that start and end with <> are HTML and skip the regex check\n\t\t\t\tmatch = [ null, selector, null ];\n\n\t\t\t} else {\n\t\t\t\tmatch = rquickExpr.exec( selector );\n\t\t\t}\n\n\t\t\t// Match html or make sure no context is specified for #id\n\t\t\tif ( match && ( match[ 1 ] || !context ) ) {\n\n\t\t\t\t// HANDLE: $(html) -> $(array)\n\t\t\t\tif ( match[ 1 ] ) {\n\t\t\t\t\tcontext = context instanceof jQuery ? context[ 0 ] : context;\n\n\t\t\t\t\t// Option to run scripts is true for back-compat\n\t\t\t\t\t// Intentionally let the error be thrown if parseHTML is not present\n\t\t\t\t\tjQuery.merge( this, jQuery.parseHTML(\n\t\t\t\t\t\tmatch[ 1 ],\n\t\t\t\t\t\tcontext && context.nodeType ? context.ownerDocument || context : document,\n\t\t\t\t\t\ttrue\n\t\t\t\t\t) );\n\n\t\t\t\t\t// HANDLE: $(html, props)\n\t\t\t\t\tif ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {\n\t\t\t\t\t\tfor ( match in context ) {\n\n\t\t\t\t\t\t\t// Properties of context are called as methods if possible\n\t\t\t\t\t\t\tif ( isFunction( this[ match ] ) ) {\n\t\t\t\t\t\t\t\tthis[ match ]( context[ match ] );\n\n\t\t\t\t\t\t\t// ...and otherwise set as attributes\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.attr( match, context[ match ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this;\n\n\t\t\t\t// HANDLE: $(#id)\n\t\t\t\t} else {\n\t\t\t\t\telem = document.getElementById( match[ 2 ] );\n\n\t\t\t\t\tif ( elem ) {\n\n\t\t\t\t\t\t// Inject the element directly into the jQuery object\n\t\t\t\t\t\tthis[ 0 ] = elem;\n\t\t\t\t\t\tthis.length = 1;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\n\t\t\t// HANDLE: $(expr, $(...))\n\t\t\t} else if ( !context || context.jquery ) {\n\t\t\t\treturn ( context || root ).find( selector );\n\n\t\t\t// HANDLE: $(expr, context)\n\t\t\t// (which is just equivalent to: $(context).find(expr)\n\t\t\t} else {\n\t\t\t\treturn this.constructor( context ).find( selector );\n\t\t\t}\n\n\t\t// HANDLE: $(DOMElement)\n\t\t} else if ( selector.nodeType ) {\n\t\t\tthis[ 0 ] = selector;\n\t\t\tthis.length = 1;\n\t\t\treturn this;\n\n\t\t// HANDLE: $(function)\n\t\t// Shortcut for document ready\n\t\t} else if ( isFunction( selector ) ) {\n\t\t\treturn root.ready !== undefined ?\n\t\t\t\troot.ready( selector ) :\n\n\t\t\t\t// Execute immediately if ready is not present\n\t\t\t\tselector( jQuery );\n\t\t}\n\n\t\treturn jQuery.makeArray( selector, this );\n\t};\n\n// Give the init function the jQuery prototype for later instantiation\ninit.prototype = jQuery.fn;\n\n// Initialize central reference\nrootjQuery = jQuery( document );\n\n\nvar rparentsprev = /^(?:parents|prev(?:Until|All))/,\n\n\t// Methods guaranteed to produce a unique set when starting from a unique set\n\tguaranteedUnique = {\n\t\tchildren: true,\n\t\tcontents: true,\n\t\tnext: true,\n\t\tprev: true\n\t};\n\njQuery.fn.extend( {\n\thas: function( target ) {\n\t\tvar targets = jQuery( target, this ),\n\t\t\tl = targets.length;\n\n\t\treturn this.filter( function() {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tif ( jQuery.contains( this, targets[ i ] ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t},\n\n\tclosest: function( selectors, context ) {\n\t\tvar cur,\n\t\t\ti = 0,\n\t\t\tl = this.length,\n\t\t\tmatched = [],\n\t\t\ttargets = typeof selectors !== \"string\" && jQuery( selectors );\n\n\t\t// Positional selectors never match, since there's no _selection_ context\n\t\tif ( !rneedsContext.test( selectors ) ) {\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tfor ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {\n\n\t\t\t\t\t// Always skip document fragments\n\t\t\t\t\tif ( cur.nodeType < 11 && ( targets ?\n\t\t\t\t\t\ttargets.index( cur ) > -1 :\n\n\t\t\t\t\t\t// Don't pass non-elements to jQuery#find\n\t\t\t\t\t\tcur.nodeType === 1 &&\n\t\t\t\t\t\t\tjQuery.find.matchesSelector( cur, selectors ) ) ) {\n\n\t\t\t\t\t\tmatched.push( cur );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );\n\t},\n\n\t// Determine the position of an element within the set\n\tindex: function( elem ) {\n\n\t\t// No argument, return index in parent\n\t\tif ( !elem ) {\n\t\t\treturn ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;\n\t\t}\n\n\t\t// Index in selector\n\t\tif ( typeof elem === \"string\" ) {\n\t\t\treturn indexOf.call( jQuery( elem ), this[ 0 ] );\n\t\t}\n\n\t\t// Locate the position of the desired element\n\t\treturn indexOf.call( this,\n\n\t\t\t// If it receives a jQuery object, the first element is used\n\t\t\telem.jquery ? elem[ 0 ] : elem\n\t\t);\n\t},\n\n\tadd: function( selector, context ) {\n\t\treturn this.pushStack(\n\t\t\tjQuery.uniqueSort(\n\t\t\t\tjQuery.merge( this.get(), jQuery( selector, context ) )\n\t\t\t)\n\t\t);\n\t},\n\n\taddBack: function( selector ) {\n\t\treturn this.add( selector == null ?\n\t\t\tthis.prevObject : this.prevObject.filter( selector )\n\t\t);\n\t}\n} );\n\nfunction sibling( cur, dir ) {\n\twhile ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}\n\treturn cur;\n}\n\njQuery.each( {\n\tparent: function( elem ) {\n\t\tvar parent = elem.parentNode;\n\t\treturn parent && parent.nodeType !== 11 ? parent : null;\n\t},\n\tparents: function( elem ) {\n\t\treturn dir( elem, \"parentNode\" );\n\t},\n\tparentsUntil: function( elem, _i, until ) {\n\t\treturn dir( elem, \"parentNode\", until );\n\t},\n\tnext: function( elem ) {\n\t\treturn sibling( elem, \"nextSibling\" );\n\t},\n\tprev: function( elem ) {\n\t\treturn sibling( elem, \"previousSibling\" );\n\t},\n\tnextAll: function( elem ) {\n\t\treturn dir( elem, \"nextSibling\" );\n\t},\n\tprevAll: function( elem ) {\n\t\treturn dir( elem, \"previousSibling\" );\n\t},\n\tnextUntil: function( elem, _i, until ) {\n\t\treturn dir( elem, \"nextSibling\", until );\n\t},\n\tprevUntil: function( elem, _i, until ) {\n\t\treturn dir( elem, \"previousSibling\", until );\n\t},\n\tsiblings: function( elem ) {\n\t\treturn siblings( ( elem.parentNode || {} ).firstChild, elem );\n\t},\n\tchildren: function( elem ) {\n\t\treturn siblings( elem.firstChild );\n\t},\n\tcontents: function( elem ) {\n\t\tif ( elem.contentDocument != null &&\n\n\t\t\t// Support: IE 11+\n\t\t\t// elements with no `data` attribute has an object\n\t\t\t// `contentDocument` with a `null` prototype.\n\t\t\tgetProto( elem.contentDocument ) ) {\n\n\t\t\treturn elem.contentDocument;\n\t\t}\n\n\t\t// Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only\n\t\t// Treat the template element as a regular one in browsers that\n\t\t// don't support it.\n\t\tif ( nodeName( elem, \"template\" ) ) {\n\t\t\telem = elem.content || elem;\n\t\t}\n\n\t\treturn jQuery.merge( [], elem.childNodes );\n\t}\n}, function( name, fn ) {\n\tjQuery.fn[ name ] = function( until, selector ) {\n\t\tvar matched = jQuery.map( this, fn, until );\n\n\t\tif ( name.slice( -5 ) !== \"Until\" ) {\n\t\t\tselector = until;\n\t\t}\n\n\t\tif ( selector && typeof selector === \"string\" ) {\n\t\t\tmatched = jQuery.filter( selector, matched );\n\t\t}\n\n\t\tif ( this.length > 1 ) {\n\n\t\t\t// Remove duplicates\n\t\t\tif ( !guaranteedUnique[ name ] ) {\n\t\t\t\tjQuery.uniqueSort( matched );\n\t\t\t}\n\n\t\t\t// Reverse order for parents* and prev-derivatives\n\t\t\tif ( rparentsprev.test( name ) ) {\n\t\t\t\tmatched.reverse();\n\t\t\t}\n\t\t}\n\n\t\treturn this.pushStack( matched );\n\t};\n} );\nvar rnothtmlwhite = ( /[^\\x20\\t\\r\\n\\f]+/g );\n\n\n\n// Convert String-formatted options into Object-formatted ones\nfunction createOptions( options ) {\n\tvar object = {};\n\tjQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t} );\n\treturn object;\n}\n\n/*\n * Create a callback list using the following parameters:\n *\n *\toptions: an optional list of space-separated options that will change how\n *\t\t\tthe callback list behaves or a more traditional option object\n *\n * By default a callback list will act like an event callback list and can be\n * \"fired\" multiple times.\n *\n * Possible options:\n *\n *\tonce:\t\t\twill ensure the callback list can only be fired once (like a Deferred)\n *\n *\tmemory:\t\t\twill keep track of previous values and will call any callback added\n *\t\t\t\t\tafter the list has been fired right away with the latest \"memorized\"\n *\t\t\t\t\tvalues (like a Deferred)\n *\n *\tunique:\t\t\twill ensure a callback can only be added once (no duplicate in the list)\n *\n *\tstopOnFalse:\tinterrupt callings when a callback returns false\n *\n */\njQuery.Callbacks = function( options ) {\n\n\t// Convert options from String-formatted to Object-formatted if needed\n\t// (we check in cache first)\n\toptions = typeof options === \"string\" ?\n\t\tcreateOptions( options ) :\n\t\tjQuery.extend( {}, options );\n\n\tvar // Flag to know if list is currently firing\n\t\tfiring,\n\n\t\t// Last fire value for non-forgettable lists\n\t\tmemory,\n\n\t\t// Flag to know if list was already fired\n\t\tfired,\n\n\t\t// Flag to prevent firing\n\t\tlocked,\n\n\t\t// Actual callback list\n\t\tlist = [],\n\n\t\t// Queue of execution data for repeatable lists\n\t\tqueue = [],\n\n\t\t// Index of currently firing callback (modified by add/remove as needed)\n\t\tfiringIndex = -1,\n\n\t\t// Fire callbacks\n\t\tfire = function() {\n\n\t\t\t// Enforce single-firing\n\t\t\tlocked = locked || options.once;\n\n\t\t\t// Execute callbacks for all pending executions,\n\t\t\t// respecting firingIndex overrides and runtime changes\n\t\t\tfired = firing = true;\n\t\t\tfor ( ; queue.length; firingIndex = -1 ) {\n\t\t\t\tmemory = queue.shift();\n\t\t\t\twhile ( ++firingIndex < list.length ) {\n\n\t\t\t\t\t// Run callback and check for early termination\n\t\t\t\t\tif ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&\n\t\t\t\t\t\toptions.stopOnFalse ) {\n\n\t\t\t\t\t\t// Jump to end and forget the data so .add doesn't re-fire\n\t\t\t\t\t\tfiringIndex = list.length;\n\t\t\t\t\t\tmemory = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Forget the data if we're done with it\n\t\t\tif ( !options.memory ) {\n\t\t\t\tmemory = false;\n\t\t\t}\n\n\t\t\tfiring = false;\n\n\t\t\t// Clean up if we're done firing for good\n\t\t\tif ( locked ) {\n\n\t\t\t\t// Keep an empty list if we have data for future add calls\n\t\t\t\tif ( memory ) {\n\t\t\t\t\tlist = [];\n\n\t\t\t\t// Otherwise, this object is spent\n\t\t\t\t} else {\n\t\t\t\t\tlist = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t// Actual Callbacks object\n\t\tself = {\n\n\t\t\t// Add a callback or a collection of callbacks to the list\n\t\t\tadd: function() {\n\t\t\t\tif ( list ) {\n\n\t\t\t\t\t// If we have memory from a past run, we should fire after adding\n\t\t\t\t\tif ( memory && !firing ) {\n\t\t\t\t\t\tfiringIndex = list.length - 1;\n\t\t\t\t\t\tqueue.push( memory );\n\t\t\t\t\t}\n\n\t\t\t\t\t( function add( args ) {\n\t\t\t\t\t\tjQuery.each( args, function( _, arg ) {\n\t\t\t\t\t\t\tif ( isFunction( arg ) ) {\n\t\t\t\t\t\t\t\tif ( !options.unique || !self.has( arg ) ) {\n\t\t\t\t\t\t\t\t\tlist.push( arg );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if ( arg && arg.length && toType( arg ) !== \"string\" ) {\n\n\t\t\t\t\t\t\t\t// Inspect recursively\n\t\t\t\t\t\t\t\tadd( arg );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\t\t\t\t\t} )( arguments );\n\n\t\t\t\t\tif ( memory && !firing ) {\n\t\t\t\t\t\tfire();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Remove a callback from the list\n\t\t\tremove: function() {\n\t\t\t\tjQuery.each( arguments, function( _, arg ) {\n\t\t\t\t\tvar index;\n\t\t\t\t\twhile ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {\n\t\t\t\t\t\tlist.splice( index, 1 );\n\n\t\t\t\t\t\t// Handle firing indexes\n\t\t\t\t\t\tif ( index <= firingIndex ) {\n\t\t\t\t\t\t\tfiringIndex--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Check if a given callback is in the list.\n\t\t\t// If no argument is given, return whether or not list has callbacks attached.\n\t\t\thas: function( fn ) {\n\t\t\t\treturn fn ?\n\t\t\t\t\tjQuery.inArray( fn, list ) > -1 :\n\t\t\t\t\tlist.length > 0;\n\t\t\t},\n\n\t\t\t// Remove all callbacks from the list\n\t\t\tempty: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\tlist = [];\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Disable .fire and .add\n\t\t\t// Abort any current/pending executions\n\t\t\t// Clear all callbacks and values\n\t\t\tdisable: function() {\n\t\t\t\tlocked = queue = [];\n\t\t\t\tlist = memory = \"\";\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\tdisabled: function() {\n\t\t\t\treturn !list;\n\t\t\t},\n\n\t\t\t// Disable .fire\n\t\t\t// Also disable .add unless we have memory (since it would have no effect)\n\t\t\t// Abort any pending executions\n\t\t\tlock: function() {\n\t\t\t\tlocked = queue = [];\n\t\t\t\tif ( !memory && !firing ) {\n\t\t\t\t\tlist = memory = \"\";\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\tlocked: function() {\n\t\t\t\treturn !!locked;\n\t\t\t},\n\n\t\t\t// Call all callbacks with the given context and arguments\n\t\t\tfireWith: function( context, args ) {\n\t\t\t\tif ( !locked ) {\n\t\t\t\t\targs = args || [];\n\t\t\t\t\targs = [ context, args.slice ? args.slice() : args ];\n\t\t\t\t\tqueue.push( args );\n\t\t\t\t\tif ( !firing ) {\n\t\t\t\t\t\tfire();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Call all the callbacks with the given arguments\n\t\t\tfire: function() {\n\t\t\t\tself.fireWith( this, arguments );\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// To know if the callbacks have already been called at least once\n\t\t\tfired: function() {\n\t\t\t\treturn !!fired;\n\t\t\t}\n\t\t};\n\n\treturn self;\n};\n\n\nfunction Identity( v ) {\n\treturn v;\n}\nfunction Thrower( ex ) {\n\tthrow ex;\n}\n\nfunction adoptValue( value, resolve, reject, noValue ) {\n\tvar method;\n\n\ttry {\n\n\t\t// Check for promise aspect first to privilege synchronous behavior\n\t\tif ( value && isFunction( ( method = value.promise ) ) ) {\n\t\t\tmethod.call( value ).done( resolve ).fail( reject );\n\n\t\t// Other thenables\n\t\t} else if ( value && isFunction( ( method = value.then ) ) ) {\n\t\t\tmethod.call( value, resolve, reject );\n\n\t\t// Other non-thenables\n\t\t} else {\n\n\t\t\t// Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:\n\t\t\t// * false: [ value ].slice( 0 ) => resolve( value )\n\t\t\t// * true: [ value ].slice( 1 ) => resolve()\n\t\t\tresolve.apply( undefined, [ value ].slice( noValue ) );\n\t\t}\n\n\t// For Promises/A+, convert exceptions into rejections\n\t// Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in\n\t// Deferred#then to conditionally suppress rejection.\n\t} catch ( value ) {\n\n\t\t// Support: Android 4.0 only\n\t\t// Strict mode functions invoked without .call/.apply get global-object context\n\t\treject.apply( undefined, [ value ] );\n\t}\n}\n\njQuery.extend( {\n\n\tDeferred: function( func ) {\n\t\tvar tuples = [\n\n\t\t\t\t// action, add listener, callbacks,\n\t\t\t\t// ... .then handlers, argument index, [final state]\n\t\t\t\t[ \"notify\", \"progress\", jQuery.Callbacks( \"memory\" ),\n\t\t\t\t\tjQuery.Callbacks( \"memory\" ), 2 ],\n\t\t\t\t[ \"resolve\", \"done\", jQuery.Callbacks( \"once memory\" ),\n\t\t\t\t\tjQuery.Callbacks( \"once memory\" ), 0, \"resolved\" ],\n\t\t\t\t[ \"reject\", \"fail\", jQuery.Callbacks( \"once memory\" ),\n\t\t\t\t\tjQuery.Callbacks( \"once memory\" ), 1, \"rejected\" ]\n\t\t\t],\n\t\t\tstate = \"pending\",\n\t\t\tpromise = {\n\t\t\t\tstate: function() {\n\t\t\t\t\treturn state;\n\t\t\t\t},\n\t\t\t\talways: function() {\n\t\t\t\t\tdeferred.done( arguments ).fail( arguments );\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\t\t\t\t\"catch\": function( fn ) {\n\t\t\t\t\treturn promise.then( null, fn );\n\t\t\t\t},\n\n\t\t\t\t// Keep pipe for back-compat\n\t\t\t\tpipe: function( /* fnDone, fnFail, fnProgress */ ) {\n\t\t\t\t\tvar fns = arguments;\n\n\t\t\t\t\treturn jQuery.Deferred( function( newDefer ) {\n\t\t\t\t\t\tjQuery.each( tuples, function( _i, tuple ) {\n\n\t\t\t\t\t\t\t// Map tuples (progress, done, fail) to arguments (done, fail, progress)\n\t\t\t\t\t\t\tvar fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];\n\n\t\t\t\t\t\t\t// deferred.progress(function() { bind to newDefer or newDefer.notify })\n\t\t\t\t\t\t\t// deferred.done(function() { bind to newDefer or newDefer.resolve })\n\t\t\t\t\t\t\t// deferred.fail(function() { bind to newDefer or newDefer.reject })\n\t\t\t\t\t\t\tdeferred[ tuple[ 1 ] ]( function() {\n\t\t\t\t\t\t\t\tvar returned = fn && fn.apply( this, arguments );\n\t\t\t\t\t\t\t\tif ( returned && isFunction( returned.promise ) ) {\n\t\t\t\t\t\t\t\t\treturned.promise()\n\t\t\t\t\t\t\t\t\t\t.progress( newDefer.notify )\n\t\t\t\t\t\t\t\t\t\t.done( newDefer.resolve )\n\t\t\t\t\t\t\t\t\t\t.fail( newDefer.reject );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tnewDefer[ tuple[ 0 ] + \"With\" ](\n\t\t\t\t\t\t\t\t\t\tthis,\n\t\t\t\t\t\t\t\t\t\tfn ? [ returned ] : arguments\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tfns = null;\n\t\t\t\t\t} ).promise();\n\t\t\t\t},\n\t\t\t\tthen: function( onFulfilled, onRejected, onProgress ) {\n\t\t\t\t\tvar maxDepth = 0;\n\t\t\t\t\tfunction resolve( depth, deferred, handler, special ) {\n\t\t\t\t\t\treturn function() {\n\t\t\t\t\t\t\tvar that = this,\n\t\t\t\t\t\t\t\targs = arguments,\n\t\t\t\t\t\t\t\tmightThrow = function() {\n\t\t\t\t\t\t\t\t\tvar returned, then;\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.3\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-59\n\t\t\t\t\t\t\t\t\t// Ignore double-resolution attempts\n\t\t\t\t\t\t\t\t\tif ( depth < maxDepth ) {\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\treturned = handler.apply( that, args );\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.1\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-48\n\t\t\t\t\t\t\t\t\tif ( returned === deferred.promise() ) {\n\t\t\t\t\t\t\t\t\t\tthrow new TypeError( \"Thenable self-resolution\" );\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ sections 2.3.3.1, 3.5\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-54\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-75\n\t\t\t\t\t\t\t\t\t// Retrieve `then` only once\n\t\t\t\t\t\t\t\t\tthen = returned &&\n\n\t\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.4\n\t\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-64\n\t\t\t\t\t\t\t\t\t\t// Only check objects and functions for thenability\n\t\t\t\t\t\t\t\t\t\t( typeof returned === \"object\" ||\n\t\t\t\t\t\t\t\t\t\t\ttypeof returned === \"function\" ) &&\n\t\t\t\t\t\t\t\t\t\treturned.then;\n\n\t\t\t\t\t\t\t\t\t// Handle a returned thenable\n\t\t\t\t\t\t\t\t\tif ( isFunction( then ) ) {\n\n\t\t\t\t\t\t\t\t\t\t// Special processors (notify) just wait for resolution\n\t\t\t\t\t\t\t\t\t\tif ( special ) {\n\t\t\t\t\t\t\t\t\t\t\tthen.call(\n\t\t\t\t\t\t\t\t\t\t\t\treturned,\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Thrower, special )\n\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t// Normal processors (resolve) also hook into progress\n\t\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t\t// ...and disregard older resolution values\n\t\t\t\t\t\t\t\t\t\t\tmaxDepth++;\n\n\t\t\t\t\t\t\t\t\t\t\tthen.call(\n\t\t\t\t\t\t\t\t\t\t\t\treturned,\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Thrower, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity,\n\t\t\t\t\t\t\t\t\t\t\t\t\tdeferred.notifyWith )\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Handle all other returned values\n\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t// Only substitute handlers pass on context\n\t\t\t\t\t\t\t\t\t\t// and multiple values (non-spec behavior)\n\t\t\t\t\t\t\t\t\t\tif ( handler !== Identity ) {\n\t\t\t\t\t\t\t\t\t\t\tthat = undefined;\n\t\t\t\t\t\t\t\t\t\t\targs = [ returned ];\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t// Process the value(s)\n\t\t\t\t\t\t\t\t\t\t// Default process is resolve\n\t\t\t\t\t\t\t\t\t\t( special || deferred.resolveWith )( that, args );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t// Only normal processors (resolve) catch and reject exceptions\n\t\t\t\t\t\t\t\tprocess = special ?\n\t\t\t\t\t\t\t\t\tmightThrow :\n\t\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\tmightThrow();\n\t\t\t\t\t\t\t\t\t\t} catch ( e ) {\n\n\t\t\t\t\t\t\t\t\t\t\tif ( jQuery.Deferred.exceptionHook ) {\n\t\t\t\t\t\t\t\t\t\t\t\tjQuery.Deferred.exceptionHook( e,\n\t\t\t\t\t\t\t\t\t\t\t\t\tprocess.error );\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.4.1\n\t\t\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-61\n\t\t\t\t\t\t\t\t\t\t\t// Ignore post-resolution exceptions\n\t\t\t\t\t\t\t\t\t\t\tif ( depth + 1 >= maxDepth ) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t// Only substitute handlers pass on context\n\t\t\t\t\t\t\t\t\t\t\t\t// and multiple values (non-spec behavior)\n\t\t\t\t\t\t\t\t\t\t\t\tif ( handler !== Thrower ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tthat = undefined;\n\t\t\t\t\t\t\t\t\t\t\t\t\targs = [ e ];\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\tdeferred.rejectWith( that, args );\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.1\n\t\t\t\t\t\t\t// https://promisesaplus.com/#point-57\n\t\t\t\t\t\t\t// Re-resolve promises immediately to dodge false rejection from\n\t\t\t\t\t\t\t// subsequent errors\n\t\t\t\t\t\t\tif ( depth ) {\n\t\t\t\t\t\t\t\tprocess();\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t// Call an optional hook to record the error, in case of exception\n\t\t\t\t\t\t\t\t// since it's otherwise lost when execution goes async\n\t\t\t\t\t\t\t\tif ( jQuery.Deferred.getErrorHook ) {\n\t\t\t\t\t\t\t\t\tprocess.error = jQuery.Deferred.getErrorHook();\n\n\t\t\t\t\t\t\t\t// The deprecated alias of the above. While the name suggests\n\t\t\t\t\t\t\t\t// returning the stack, not an error instance, jQuery just passes\n\t\t\t\t\t\t\t\t// it directly to `console.warn` so both will work; an instance\n\t\t\t\t\t\t\t\t// just better cooperates with source maps.\n\t\t\t\t\t\t\t\t} else if ( jQuery.Deferred.getStackHook ) {\n\t\t\t\t\t\t\t\t\tprocess.error = jQuery.Deferred.getStackHook();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\twindow.setTimeout( process );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\treturn jQuery.Deferred( function( newDefer ) {\n\n\t\t\t\t\t\t// progress_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 0 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onProgress ) ?\n\t\t\t\t\t\t\t\t\tonProgress :\n\t\t\t\t\t\t\t\t\tIdentity,\n\t\t\t\t\t\t\t\tnewDefer.notifyWith\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// fulfilled_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 1 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onFulfilled ) ?\n\t\t\t\t\t\t\t\t\tonFulfilled :\n\t\t\t\t\t\t\t\t\tIdentity\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// rejected_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 2 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onRejected ) ?\n\t\t\t\t\t\t\t\t\tonRejected :\n\t\t\t\t\t\t\t\t\tThrower\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t} ).promise();\n\t\t\t\t},\n\n\t\t\t\t// Get a promise for this deferred\n\t\t\t\t// If obj is provided, the promise aspect is added to the object\n\t\t\t\tpromise: function( obj ) {\n\t\t\t\t\treturn obj != null ? jQuery.extend( obj, promise ) : promise;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdeferred = {};\n\n\t\t// Add list-specific methods\n\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\tvar list = tuple[ 2 ],\n\t\t\t\tstateString = tuple[ 5 ];\n\n\t\t\t// promise.progress = list.add\n\t\t\t// promise.done = list.add\n\t\t\t// promise.fail = list.add\n\t\t\tpromise[ tuple[ 1 ] ] = list.add;\n\n\t\t\t// Handle state\n\t\t\tif ( stateString ) {\n\t\t\t\tlist.add(\n\t\t\t\t\tfunction() {\n\n\t\t\t\t\t\t// state = \"resolved\" (i.e., fulfilled)\n\t\t\t\t\t\t// state = \"rejected\"\n\t\t\t\t\t\tstate = stateString;\n\t\t\t\t\t},\n\n\t\t\t\t\t// rejected_callbacks.disable\n\t\t\t\t\t// fulfilled_callbacks.disable\n\t\t\t\t\ttuples[ 3 - i ][ 2 ].disable,\n\n\t\t\t\t\t// rejected_handlers.disable\n\t\t\t\t\t// fulfilled_handlers.disable\n\t\t\t\t\ttuples[ 3 - i ][ 3 ].disable,\n\n\t\t\t\t\t// progress_callbacks.lock\n\t\t\t\t\ttuples[ 0 ][ 2 ].lock,\n\n\t\t\t\t\t// progress_handlers.lock\n\t\t\t\t\ttuples[ 0 ][ 3 ].lock\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// progress_handlers.fire\n\t\t\t// fulfilled_handlers.fire\n\t\t\t// rejected_handlers.fire\n\t\t\tlist.add( tuple[ 3 ].fire );\n\n\t\t\t// deferred.notify = function() { deferred.notifyWith(...) }\n\t\t\t// deferred.resolve = function() { deferred.resolveWith(...) }\n\t\t\t// deferred.reject = function() { deferred.rejectWith(...) }\n\t\t\tdeferred[ tuple[ 0 ] ] = function() {\n\t\t\t\tdeferred[ tuple[ 0 ] + \"With\" ]( this === deferred ? undefined : this, arguments );\n\t\t\t\treturn this;\n\t\t\t};\n\n\t\t\t// deferred.notifyWith = list.fireWith\n\t\t\t// deferred.resolveWith = list.fireWith\n\t\t\t// deferred.rejectWith = list.fireWith\n\t\t\tdeferred[ tuple[ 0 ] + \"With\" ] = list.fireWith;\n\t\t} );\n\n\t\t// Make the deferred a promise\n\t\tpromise.promise( deferred );\n\n\t\t// Call given func if any\n\t\tif ( func ) {\n\t\t\tfunc.call( deferred, deferred );\n\t\t}\n\n\t\t// All done!\n\t\treturn deferred;\n\t},\n\n\t// Deferred helper\n\twhen: function( singleValue ) {\n\t\tvar\n\n\t\t\t// count of uncompleted subordinates\n\t\t\tremaining = arguments.length,\n\n\t\t\t// count of unprocessed arguments\n\t\t\ti = remaining,\n\n\t\t\t// subordinate fulfillment data\n\t\t\tresolveContexts = Array( i ),\n\t\t\tresolveValues = slice.call( arguments ),\n\n\t\t\t// the primary Deferred\n\t\t\tprimary = jQuery.Deferred(),\n\n\t\t\t// subordinate callback factory\n\t\t\tupdateFunc = function( i ) {\n\t\t\t\treturn function( value ) {\n\t\t\t\t\tresolveContexts[ i ] = this;\n\t\t\t\t\tresolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;\n\t\t\t\t\tif ( !( --remaining ) ) {\n\t\t\t\t\t\tprimary.resolveWith( resolveContexts, resolveValues );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t};\n\n\t\t// Single- and empty arguments are adopted like Promise.resolve\n\t\tif ( remaining <= 1 ) {\n\t\t\tadoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject,\n\t\t\t\t!remaining );\n\n\t\t\t// Use .then() to unwrap secondary thenables (cf. gh-3000)\n\t\t\tif ( primary.state() === \"pending\" ||\n\t\t\t\tisFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {\n\n\t\t\t\treturn primary.then();\n\t\t\t}\n\t\t}\n\n\t\t// Multiple arguments are aggregated like Promise.all array elements\n\t\twhile ( i-- ) {\n\t\t\tadoptValue( resolveValues[ i ], updateFunc( i ), primary.reject );\n\t\t}\n\n\t\treturn primary.promise();\n\t}\n} );\n\n\n// These usually indicate a programmer mistake during development,\n// warn about them ASAP rather than swallowing them by default.\nvar rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;\n\n// If `jQuery.Deferred.getErrorHook` is defined, `asyncError` is an error\n// captured before the async barrier to get the original error cause\n// which may otherwise be hidden.\njQuery.Deferred.exceptionHook = function( error, asyncError ) {\n\n\t// Support: IE 8 - 9 only\n\t// Console exists when dev tools are open, which can happen at any time\n\tif ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {\n\t\twindow.console.warn( \"jQuery.Deferred exception: \" + error.message,\n\t\t\terror.stack, asyncError );\n\t}\n};\n\n\n\n\njQuery.readyException = function( error ) {\n\twindow.setTimeout( function() {\n\t\tthrow error;\n\t} );\n};\n\n\n\n\n// The deferred used on DOM ready\nvar readyList = jQuery.Deferred();\n\njQuery.fn.ready = function( fn ) {\n\n\treadyList\n\t\t.then( fn )\n\n\t\t// Wrap jQuery.readyException in a function so that the lookup\n\t\t// happens at the time of error handling instead of callback\n\t\t// registration.\n\t\t.catch( function( error ) {\n\t\t\tjQuery.readyException( error );\n\t\t} );\n\n\treturn this;\n};\n\njQuery.extend( {\n\n\t// Is the DOM ready to be used? Set to true once it occurs.\n\tisReady: false,\n\n\t// A counter to track how many items to wait for before\n\t// the ready event fires. See trac-6781\n\treadyWait: 1,\n\n\t// Handle when the DOM is ready\n\tready: function( wait ) {\n\n\t\t// Abort if there are pending holds or we're already ready\n\t\tif ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Remember that the DOM is ready\n\t\tjQuery.isReady = true;\n\n\t\t// If a normal DOM Ready event fired, decrement, and wait if need be\n\t\tif ( wait !== true && --jQuery.readyWait > 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If there are functions bound, to execute\n\t\treadyList.resolveWith( document, [ jQuery ] );\n\t}\n} );\n\njQuery.ready.then = readyList.then;\n\n// The ready event handler and self cleanup method\nfunction completed() {\n\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\twindow.removeEventListener( \"load\", completed );\n\tjQuery.ready();\n}\n\n// Catch cases where $(document).ready() is called\n// after the browser event has already occurred.\n// Support: IE <=9 - 10 only\n// Older IE sometimes signals \"interactive\" too soon\nif ( document.readyState === \"complete\" ||\n\t( document.readyState !== \"loading\" && !document.documentElement.doScroll ) ) {\n\n\t// Handle it asynchronously to allow scripts the opportunity to delay ready\n\twindow.setTimeout( jQuery.ready );\n\n} else {\n\n\t// Use the handy event callback\n\tdocument.addEventListener( \"DOMContentLoaded\", completed );\n\n\t// A fallback to window.onload, that will always work\n\twindow.addEventListener( \"load\", completed );\n}\n\n\n\n\n// Multifunctional method to get and set values of a collection\n// The value/s can optionally be executed if it's a function\nvar access = function( elems, fn, key, value, chainable, emptyGet, raw ) {\n\tvar i = 0,\n\t\tlen = elems.length,\n\t\tbulk = key == null;\n\n\t// Sets many values\n\tif ( toType( key ) === \"object\" ) {\n\t\tchainable = true;\n\t\tfor ( i in key ) {\n\t\t\taccess( elems, fn, i, key[ i ], true, emptyGet, raw );\n\t\t}\n\n\t// Sets one value\n\t} else if ( value !== undefined ) {\n\t\tchainable = true;\n\n\t\tif ( !isFunction( value ) ) {\n\t\t\traw = true;\n\t\t}\n\n\t\tif ( bulk ) {\n\n\t\t\t// Bulk operations run against the entire set\n\t\t\tif ( raw ) {\n\t\t\t\tfn.call( elems, value );\n\t\t\t\tfn = null;\n\n\t\t\t// ...except when executing function values\n\t\t\t} else {\n\t\t\t\tbulk = fn;\n\t\t\t\tfn = function( elem, _key, value ) {\n\t\t\t\t\treturn bulk.call( jQuery( elem ), value );\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tif ( fn ) {\n\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\tfn(\n\t\t\t\t\telems[ i ], key, raw ?\n\t\t\t\t\t\tvalue :\n\t\t\t\t\t\tvalue.call( elems[ i ], i, fn( elems[ i ], key ) )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( chainable ) {\n\t\treturn elems;\n\t}\n\n\t// Gets\n\tif ( bulk ) {\n\t\treturn fn.call( elems );\n\t}\n\n\treturn len ? fn( elems[ 0 ], key ) : emptyGet;\n};\n\n\n// Matches dashed string for camelizing\nvar rmsPrefix = /^-ms-/,\n\trdashAlpha = /-([a-z])/g;\n\n// Used by camelCase as callback to replace()\nfunction fcamelCase( _all, letter ) {\n\treturn letter.toUpperCase();\n}\n\n// Convert dashed to camelCase; used by the css and data modules\n// Support: IE <=9 - 11, Edge 12 - 15\n// Microsoft forgot to hump their vendor prefix (trac-9572)\nfunction camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}\nvar acceptData = function( owner ) {\n\n\t// Accepts only:\n\t// - Node\n\t// - Node.ELEMENT_NODE\n\t// - Node.DOCUMENT_NODE\n\t// - Object\n\t// - Any\n\treturn owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );\n};\n\n\n\n\nfunction Data() {\n\tthis.expando = jQuery.expando + Data.uid++;\n}\n\nData.uid = 1;\n\nData.prototype = {\n\n\tcache: function( owner ) {\n\n\t\t// Check if the owner object already has a cache\n\t\tvar value = owner[ this.expando ];\n\n\t\t// If not, create one\n\t\tif ( !value ) {\n\t\t\tvalue = {};\n\n\t\t\t// We can accept data for non-element nodes in modern browsers,\n\t\t\t// but we should not, see trac-8335.\n\t\t\t// Always return an empty object.\n\t\t\tif ( acceptData( owner ) ) {\n\n\t\t\t\t// If it is a node unlikely to be stringify-ed or looped over\n\t\t\t\t// use plain assignment\n\t\t\t\tif ( owner.nodeType ) {\n\t\t\t\t\towner[ this.expando ] = value;\n\n\t\t\t\t// Otherwise secure it in a non-enumerable property\n\t\t\t\t// configurable must be true to allow the property to be\n\t\t\t\t// deleted when data is removed\n\t\t\t\t} else {\n\t\t\t\t\tObject.defineProperty( owner, this.expando, {\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tconfigurable: true\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn value;\n\t},\n\tset: function( owner, data, value ) {\n\t\tvar prop,\n\t\t\tcache = this.cache( owner );\n\n\t\t// Handle: [ owner, key, value ] args\n\t\t// Always use camelCase key (gh-2257)\n\t\tif ( typeof data === \"string\" ) {\n\t\t\tcache[ camelCase( data ) ] = value;\n\n\t\t// Handle: [ owner, { properties } ] args\n\t\t} else {\n\n\t\t\t// Copy the properties one-by-one to the cache object\n\t\t\tfor ( prop in data ) {\n\t\t\t\tcache[ camelCase( prop ) ] = data[ prop ];\n\t\t\t}\n\t\t}\n\t\treturn cache;\n\t},\n\tget: function( owner, key ) {\n\t\treturn key === undefined ?\n\t\t\tthis.cache( owner ) :\n\n\t\t\t// Always use camelCase key (gh-2257)\n\t\t\towner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];\n\t},\n\taccess: function( owner, key, value ) {\n\n\t\t// In cases where either:\n\t\t//\n\t\t// 1. No key was specified\n\t\t// 2. A string key was specified, but no value provided\n\t\t//\n\t\t// Take the \"read\" path and allow the get method to determine\n\t\t// which value to return, respectively either:\n\t\t//\n\t\t// 1. The entire cache object\n\t\t// 2. The data stored at the key\n\t\t//\n\t\tif ( key === undefined ||\n\t\t\t\t( ( key && typeof key === \"string\" ) && value === undefined ) ) {\n\n\t\t\treturn this.get( owner, key );\n\t\t}\n\n\t\t// When the key is not a string, or both a key and value\n\t\t// are specified, set or extend (existing objects) with either:\n\t\t//\n\t\t// 1. An object of properties\n\t\t// 2. A key and value\n\t\t//\n\t\tthis.set( owner, key, value );\n\n\t\t// Since the \"set\" path can have two possible entry points\n\t\t// return the expected data based on which path was taken[*]\n\t\treturn value !== undefined ? value : key;\n\t},\n\tremove: function( owner, key ) {\n\t\tvar i,\n\t\t\tcache = owner[ this.expando ];\n\n\t\tif ( cache === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( key !== undefined ) {\n\n\t\t\t// Support array or space separated string of keys\n\t\t\tif ( Array.isArray( key ) ) {\n\n\t\t\t\t// If key is an array of keys...\n\t\t\t\t// We always set camelCase keys, so remove that.\n\t\t\t\tkey = key.map( camelCase );\n\t\t\t} else {\n\t\t\t\tkey = camelCase( key );\n\n\t\t\t\t// If a key with the spaces exists, use it.\n\t\t\t\t// Otherwise, create an array by matching non-whitespace\n\t\t\t\tkey = key in cache ?\n\t\t\t\t\t[ key ] :\n\t\t\t\t\t( key.match( rnothtmlwhite ) || [] );\n\t\t\t}\n\n\t\t\ti = key.length;\n\n\t\t\twhile ( i-- ) {\n\t\t\t\tdelete cache[ key[ i ] ];\n\t\t\t}\n\t\t}\n\n\t\t// Remove the expando if there's no more data\n\t\tif ( key === undefined || jQuery.isEmptyObject( cache ) ) {\n\n\t\t\t// Support: Chrome <=35 - 45\n\t\t\t// Webkit & Blink performance suffers when deleting properties\n\t\t\t// from DOM nodes, so set to undefined instead\n\t\t\t// https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)\n\t\t\tif ( owner.nodeType ) {\n\t\t\t\towner[ this.expando ] = undefined;\n\t\t\t} else {\n\t\t\t\tdelete owner[ this.expando ];\n\t\t\t}\n\t\t}\n\t},\n\thasData: function( owner ) {\n\t\tvar cache = owner[ this.expando ];\n\t\treturn cache !== undefined && !jQuery.isEmptyObject( cache );\n\t}\n};\nvar dataPriv = new Data();\n\nvar dataUser = new Data();\n\n\n\n//\tImplementation Summary\n//\n//\t1. Enforce API surface and semantic compatibility with 1.9.x branch\n//\t2. Improve the module's maintainability by reducing the storage\n//\t\tpaths to a single mechanism.\n//\t3. Use the same single mechanism to support \"private\" and \"user\" data.\n//\t4. _Never_ expose \"private\" data to user code (TODO: Drop _data, _removeData)\n//\t5. Avoid exposing implementation details on user objects (eg. expando properties)\n//\t6. Provide a clear path for implementation upgrade to WeakMap in 2014\n\nvar rbrace = /^(?:\\{[\\w\\W]*\\}|\\[[\\w\\W]*\\])$/,\n\trmultiDash = /[A-Z]/g;\n\nfunction getData( data ) {\n\tif ( data === \"true\" ) {\n\t\treturn true;\n\t}\n\n\tif ( data === \"false\" ) {\n\t\treturn false;\n\t}\n\n\tif ( data === \"null\" ) {\n\t\treturn null;\n\t}\n\n\t// Only convert to a number if it doesn't change the string\n\tif ( data === +data + \"\" ) {\n\t\treturn +data;\n\t}\n\n\tif ( rbrace.test( data ) ) {\n\t\treturn JSON.parse( data );\n\t}\n\n\treturn data;\n}\n\nfunction dataAttr( elem, key, data ) {\n\tvar name;\n\n\t// If nothing was found internally, try to fetch any\n\t// data from the HTML5 data-* attribute\n\tif ( data === undefined && elem.nodeType === 1 ) {\n\t\tname = \"data-\" + key.replace( rmultiDash, \"-$&\" ).toLowerCase();\n\t\tdata = elem.getAttribute( name );\n\n\t\tif ( typeof data === \"string\" ) {\n\t\t\ttry {\n\t\t\t\tdata = getData( data );\n\t\t\t} catch ( e ) {}\n\n\t\t\t// Make sure we set the data so it isn't changed later\n\t\t\tdataUser.set( elem, key, data );\n\t\t} else {\n\t\t\tdata = undefined;\n\t\t}\n\t}\n\treturn data;\n}\n\njQuery.extend( {\n\thasData: function( elem ) {\n\t\treturn dataUser.hasData( elem ) || dataPriv.hasData( elem );\n\t},\n\n\tdata: function( elem, name, data ) {\n\t\treturn dataUser.access( elem, name, data );\n\t},\n\n\tremoveData: function( elem, name ) {\n\t\tdataUser.remove( elem, name );\n\t},\n\n\t// TODO: Now that all calls to _data and _removeData have been replaced\n\t// with direct calls to dataPriv methods, these can be deprecated.\n\t_data: function( elem, name, data ) {\n\t\treturn dataPriv.access( elem, name, data );\n\t},\n\n\t_removeData: function( elem, name ) {\n\t\tdataPriv.remove( elem, name );\n\t}\n} );\n\njQuery.fn.extend( {\n\tdata: function( key, value ) {\n\t\tvar i, name, data,\n\t\t\telem = this[ 0 ],\n\t\t\tattrs = elem && elem.attributes;\n\n\t\t// Gets all values\n\t\tif ( key === undefined ) {\n\t\t\tif ( this.length ) {\n\t\t\t\tdata = dataUser.get( elem );\n\n\t\t\t\tif ( elem.nodeType === 1 && !dataPriv.get( elem, \"hasDataAttrs\" ) ) {\n\t\t\t\t\ti = attrs.length;\n\t\t\t\t\twhile ( i-- ) {\n\n\t\t\t\t\t\t// Support: IE 11 only\n\t\t\t\t\t\t// The attrs elements can be null (trac-14894)\n\t\t\t\t\t\tif ( attrs[ i ] ) {\n\t\t\t\t\t\t\tname = attrs[ i ].name;\n\t\t\t\t\t\t\tif ( name.indexOf( \"data-\" ) === 0 ) {\n\t\t\t\t\t\t\t\tname = camelCase( name.slice( 5 ) );\n\t\t\t\t\t\t\t\tdataAttr( elem, name, data[ name ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdataPriv.set( elem, \"hasDataAttrs\", true );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn data;\n\t\t}\n\n\t\t// Sets multiple values\n\t\tif ( typeof key === \"object\" ) {\n\t\t\treturn this.each( function() {\n\t\t\t\tdataUser.set( this, key );\n\t\t\t} );\n\t\t}\n\n\t\treturn access( this, function( value ) {\n\t\t\tvar data;\n\n\t\t\t// The calling jQuery object (element matches) is not empty\n\t\t\t// (and therefore has an element appears at this[ 0 ]) and the\n\t\t\t// `value` parameter was not undefined. An empty jQuery object\n\t\t\t// will result in `undefined` for elem = this[ 0 ] which will\n\t\t\t// throw an exception if an attempt to read a data cache is made.\n\t\t\tif ( elem && value === undefined ) {\n\n\t\t\t\t// Attempt to get data from the cache\n\t\t\t\t// The key will always be camelCased in Data\n\t\t\t\tdata = dataUser.get( elem, key );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// Attempt to \"discover\" the data in\n\t\t\t\t// HTML5 custom data-* attrs\n\t\t\t\tdata = dataAttr( elem, key );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// We tried really hard, but the data doesn't exist.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Set the data...\n\t\t\tthis.each( function() {\n\n\t\t\t\t// We always store the camelCased key\n\t\t\t\tdataUser.set( this, key, value );\n\t\t\t} );\n\t\t}, null, value, arguments.length > 1, null, true );\n\t},\n\n\tremoveData: function( key ) {\n\t\treturn this.each( function() {\n\t\t\tdataUser.remove( this, key );\n\t\t} );\n\t}\n} );\n\n\njQuery.extend( {\n\tqueue: function( elem, type, data ) {\n\t\tvar queue;\n\n\t\tif ( elem ) {\n\t\t\ttype = ( type || \"fx\" ) + \"queue\";\n\t\t\tqueue = dataPriv.get( elem, type );\n\n\t\t\t// Speed up dequeue by getting out quickly if this is just a lookup\n\t\t\tif ( data ) {\n\t\t\t\tif ( !queue || Array.isArray( data ) ) {\n\t\t\t\t\tqueue = dataPriv.access( elem, type, jQuery.makeArray( data ) );\n\t\t\t\t} else {\n\t\t\t\t\tqueue.push( data );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn queue || [];\n\t\t}\n\t},\n\n\tdequeue: function( elem, type ) {\n\t\ttype = type || \"fx\";\n\n\t\tvar queue = jQuery.queue( elem, type ),\n\t\t\tstartLength = queue.length,\n\t\t\tfn = queue.shift(),\n\t\t\thooks = jQuery._queueHooks( elem, type ),\n\t\t\tnext = function() {\n\t\t\t\tjQuery.dequeue( elem, type );\n\t\t\t};\n\n\t\t// If the fx queue is dequeued, always remove the progress sentinel\n\t\tif ( fn === \"inprogress\" ) {\n\t\t\tfn = queue.shift();\n\t\t\tstartLength--;\n\t\t}\n\n\t\tif ( fn ) {\n\n\t\t\t// Add a progress sentinel to prevent the fx queue from being\n\t\t\t// automatically dequeued\n\t\t\tif ( type === \"fx\" ) {\n\t\t\t\tqueue.unshift( \"inprogress\" );\n\t\t\t}\n\n\t\t\t// Clear up the last queue stop function\n\t\t\tdelete hooks.stop;\n\t\t\tfn.call( elem, next, hooks );\n\t\t}\n\n\t\tif ( !startLength && hooks ) {\n\t\t\thooks.empty.fire();\n\t\t}\n\t},\n\n\t// Not public - generate a queueHooks object, or return the current one\n\t_queueHooks: function( elem, type ) {\n\t\tvar key = type + \"queueHooks\";\n\t\treturn dataPriv.get( elem, key ) || dataPriv.access( elem, key, {\n\t\t\tempty: jQuery.Callbacks( \"once memory\" ).add( function() {\n\t\t\t\tdataPriv.remove( elem, [ type + \"queue\", key ] );\n\t\t\t} )\n\t\t} );\n\t}\n} );\n\njQuery.fn.extend( {\n\tqueue: function( type, data ) {\n\t\tvar setter = 2;\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tdata = type;\n\t\t\ttype = \"fx\";\n\t\t\tsetter--;\n\t\t}\n\n\t\tif ( arguments.length < setter ) {\n\t\t\treturn jQuery.queue( this[ 0 ], type );\n\t\t}\n\n\t\treturn data === undefined ?\n\t\t\tthis :\n\t\t\tthis.each( function() {\n\t\t\t\tvar queue = jQuery.queue( this, type, data );\n\n\t\t\t\t// Ensure a hooks for this queue\n\t\t\t\tjQuery._queueHooks( this, type );\n\n\t\t\t\tif ( type === \"fx\" && queue[ 0 ] !== \"inprogress\" ) {\n\t\t\t\t\tjQuery.dequeue( this, type );\n\t\t\t\t}\n\t\t\t} );\n\t},\n\tdequeue: function( type ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.dequeue( this, type );\n\t\t} );\n\t},\n\tclearQueue: function( type ) {\n\t\treturn this.queue( type || \"fx\", [] );\n\t},\n\n\t// Get a promise resolved when queues of a certain type\n\t// are emptied (fx is the type by default)\n\tpromise: function( type, obj ) {\n\t\tvar tmp,\n\t\t\tcount = 1,\n\t\t\tdefer = jQuery.Deferred(),\n\t\t\telements = this,\n\t\t\ti = this.length,\n\t\t\tresolve = function() {\n\t\t\t\tif ( !( --count ) ) {\n\t\t\t\t\tdefer.resolveWith( elements, [ elements ] );\n\t\t\t\t}\n\t\t\t};\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tobj = type;\n\t\t\ttype = undefined;\n\t\t}\n\t\ttype = type || \"fx\";\n\n\t\twhile ( i-- ) {\n\t\t\ttmp = dataPriv.get( elements[ i ], type + \"queueHooks\" );\n\t\t\tif ( tmp && tmp.empty ) {\n\t\t\t\tcount++;\n\t\t\t\ttmp.empty.add( resolve );\n\t\t\t}\n\t\t}\n\t\tresolve();\n\t\treturn defer.promise( obj );\n\t}\n} );\nvar pnum = ( /[+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|)/ ).source;\n\nvar rcssNum = new RegExp( \"^(?:([+-])=|)(\" + pnum + \")([a-z%]*)$\", \"i\" );\n\n\nvar cssExpand = [ \"Top\", \"Right\", \"Bottom\", \"Left\" ];\n\nvar documentElement = document.documentElement;\n\n\n\n\tvar isAttached = function( elem ) {\n\t\t\treturn jQuery.contains( elem.ownerDocument, elem );\n\t\t},\n\t\tcomposed = { composed: true };\n\n\t// Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only\n\t// Check attachment across shadow DOM boundaries when possible (gh-3504)\n\t// Support: iOS 10.0-10.2 only\n\t// Early iOS 10 versions support `attachShadow` but not `getRootNode`,\n\t// leading to errors. We need to check for `getRootNode`.\n\tif ( documentElement.getRootNode ) {\n\t\tisAttached = function( elem ) {\n\t\t\treturn jQuery.contains( elem.ownerDocument, elem ) ||\n\t\t\t\telem.getRootNode( composed ) === elem.ownerDocument;\n\t\t};\n\t}\nvar isHiddenWithinTree = function( elem, el ) {\n\n\t\t// isHiddenWithinTree might be called from jQuery#filter function;\n\t\t// in that case, element will be second argument\n\t\telem = el || elem;\n\n\t\t// Inline style trumps all\n\t\treturn elem.style.display === \"none\" ||\n\t\t\telem.style.display === \"\" &&\n\n\t\t\t// Otherwise, check computed style\n\t\t\t// Support: Firefox <=43 - 45\n\t\t\t// Disconnected elements can have computed display: none, so first confirm that elem is\n\t\t\t// in the document.\n\t\t\tisAttached( elem ) &&\n\n\t\t\tjQuery.css( elem, \"display\" ) === \"none\";\n\t};\n\n\n\nfunction adjustCSS( elem, prop, valueParts, tween ) {\n\tvar adjusted, scale,\n\t\tmaxIterations = 20,\n\t\tcurrentValue = tween ?\n\t\t\tfunction() {\n\t\t\t\treturn tween.cur();\n\t\t\t} :\n\t\t\tfunction() {\n\t\t\t\treturn jQuery.css( elem, prop, \"\" );\n\t\t\t},\n\t\tinitial = currentValue(),\n\t\tunit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" ),\n\n\t\t// Starting value computation is required for potential unit mismatches\n\t\tinitialInUnit = elem.nodeType &&\n\t\t\t( jQuery.cssNumber[ prop ] || unit !== \"px\" && +initial ) &&\n\t\t\trcssNum.exec( jQuery.css( elem, prop ) );\n\n\tif ( initialInUnit && initialInUnit[ 3 ] !== unit ) {\n\n\t\t// Support: Firefox <=54\n\t\t// Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)\n\t\tinitial = initial / 2;\n\n\t\t// Trust units reported by jQuery.css\n\t\tunit = unit || initialInUnit[ 3 ];\n\n\t\t// Iteratively approximate from a nonzero starting point\n\t\tinitialInUnit = +initial || 1;\n\n\t\twhile ( maxIterations-- ) {\n\n\t\t\t// Evaluate and update our best guess (doubling guesses that zero out).\n\t\t\t// Finish if the scale equals or crosses 1 (making the old*new product non-positive).\n\t\t\tjQuery.style( elem, prop, initialInUnit + unit );\n\t\t\tif ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {\n\t\t\t\tmaxIterations = 0;\n\t\t\t}\n\t\t\tinitialInUnit = initialInUnit / scale;\n\n\t\t}\n\n\t\tinitialInUnit = initialInUnit * 2;\n\t\tjQuery.style( elem, prop, initialInUnit + unit );\n\n\t\t// Make sure we update the tween properties later on\n\t\tvalueParts = valueParts || [];\n\t}\n\n\tif ( valueParts ) {\n\t\tinitialInUnit = +initialInUnit || +initial || 0;\n\n\t\t// Apply relative offset (+=/-=) if specified\n\t\tadjusted = valueParts[ 1 ] ?\n\t\t\tinitialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :\n\t\t\t+valueParts[ 2 ];\n\t\tif ( tween ) {\n\t\t\ttween.unit = unit;\n\t\t\ttween.start = initialInUnit;\n\t\t\ttween.end = adjusted;\n\t\t}\n\t}\n\treturn adjusted;\n}\n\n\nvar defaultDisplayMap = {};\n\nfunction getDefaultDisplay( elem ) {\n\tvar temp,\n\t\tdoc = elem.ownerDocument,\n\t\tnodeName = elem.nodeName,\n\t\tdisplay = defaultDisplayMap[ nodeName ];\n\n\tif ( display ) {\n\t\treturn display;\n\t}\n\n\ttemp = doc.body.appendChild( doc.createElement( nodeName ) );\n\tdisplay = jQuery.css( temp, \"display\" );\n\n\ttemp.parentNode.removeChild( temp );\n\n\tif ( display === \"none\" ) {\n\t\tdisplay = \"block\";\n\t}\n\tdefaultDisplayMap[ nodeName ] = display;\n\n\treturn display;\n}\n\nfunction showHide( elements, show ) {\n\tvar display, elem,\n\t\tvalues = [],\n\t\tindex = 0,\n\t\tlength = elements.length;\n\n\t// Determine new display value for elements that need to change\n\tfor ( ; index < length; index++ ) {\n\t\telem = elements[ index ];\n\t\tif ( !elem.style ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tdisplay = elem.style.display;\n\t\tif ( show ) {\n\n\t\t\t// Since we force visibility upon cascade-hidden elements, an immediate (and slow)\n\t\t\t// check is required in this first loop unless we have a nonempty display value (either\n\t\t\t// inline or about-to-be-restored)\n\t\t\tif ( display === \"none\" ) {\n\t\t\t\tvalues[ index ] = dataPriv.get( elem, \"display\" ) || null;\n\t\t\t\tif ( !values[ index ] ) {\n\t\t\t\t\telem.style.display = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( elem.style.display === \"\" && isHiddenWithinTree( elem ) ) {\n\t\t\t\tvalues[ index ] = getDefaultDisplay( elem );\n\t\t\t}\n\t\t} else {\n\t\t\tif ( display !== \"none\" ) {\n\t\t\t\tvalues[ index ] = \"none\";\n\n\t\t\t\t// Remember what we're overwriting\n\t\t\t\tdataPriv.set( elem, \"display\", display );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Set the display of the elements in a second loop to avoid constant reflow\n\tfor ( index = 0; index < length; index++ ) {\n\t\tif ( values[ index ] != null ) {\n\t\t\telements[ index ].style.display = values[ index ];\n\t\t}\n\t}\n\n\treturn elements;\n}\n\njQuery.fn.extend( {\n\tshow: function() {\n\t\treturn showHide( this, true );\n\t},\n\thide: function() {\n\t\treturn showHide( this );\n\t},\n\ttoggle: function( state ) {\n\t\tif ( typeof state === \"boolean\" ) {\n\t\t\treturn state ? this.show() : this.hide();\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tif ( isHiddenWithinTree( this ) ) {\n\t\t\t\tjQuery( this ).show();\n\t\t\t} else {\n\t\t\t\tjQuery( this ).hide();\n\t\t\t}\n\t\t} );\n\t}\n} );\nvar rcheckableType = ( /^(?:checkbox|radio)$/i );\n\nvar rtagName = ( /<([a-z][^\\/\\0>\\x20\\t\\r\\n\\f]*)/i );\n\nvar rscriptType = ( /^$|^module$|\\/(?:java|ecma)script/i );\n\n\n\n( function() {\n\tvar fragment = document.createDocumentFragment(),\n\t\tdiv = fragment.appendChild( document.createElement( \"div\" ) ),\n\t\tinput = document.createElement( \"input\" );\n\n\t// Support: Android 4.0 - 4.3 only\n\t// Check state lost if the name is set (trac-11217)\n\t// Support: Windows Web Apps (WWA)\n\t// `name` and `type` must use .setAttribute for WWA (trac-14901)\n\tinput.setAttribute( \"type\", \"radio\" );\n\tinput.setAttribute( \"checked\", \"checked\" );\n\tinput.setAttribute( \"name\", \"t\" );\n\n\tdiv.appendChild( input );\n\n\t// Support: Android <=4.1 only\n\t// Older WebKit doesn't clone checked state correctly in fragments\n\tsupport.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;\n\n\t// Support: IE <=11 only\n\t// Make sure textarea (and checkbox) defaultValue is properly cloned\n\tdiv.innerHTML = \"\";\n\tsupport.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;\n\n\t// Support: IE <=9 only\n\t// IE <=9 replaces \";\n\tsupport.option = !!div.lastChild;\n} )();\n\n\n// We have to close these tags to support XHTML (trac-13200)\nvar wrapMap = {\n\n\t// XHTML parsers do not magically insert elements in the\n\t// same way that tag soup parsers do. So we cannot shorten\n\t// this by omitting or other required elements.\n\tthead: [ 1, \"\", \"
\" ],\n\tcol: [ 2, \"\", \"
\" ],\n\ttr: [ 2, \"\", \"
\" ],\n\ttd: [ 3, \"\", \"
\" ],\n\n\t_default: [ 0, \"\", \"\" ]\n};\n\nwrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;\nwrapMap.th = wrapMap.td;\n\n// Support: IE <=9 only\nif ( !support.option ) {\n\twrapMap.optgroup = wrapMap.option = [ 1, \"\" ];\n}\n\n\nfunction getAll( context, tag ) {\n\n\t// Support: IE <=9 - 11 only\n\t// Use typeof to avoid zero-argument method invocation on host objects (trac-15151)\n\tvar ret;\n\n\tif ( typeof context.getElementsByTagName !== \"undefined\" ) {\n\t\tret = context.getElementsByTagName( tag || \"*\" );\n\n\t} else if ( typeof context.querySelectorAll !== \"undefined\" ) {\n\t\tret = context.querySelectorAll( tag || \"*\" );\n\n\t} else {\n\t\tret = [];\n\t}\n\n\tif ( tag === undefined || tag && nodeName( context, tag ) ) {\n\t\treturn jQuery.merge( [ context ], ret );\n\t}\n\n\treturn ret;\n}\n\n\n// Mark scripts as having already been evaluated\nfunction setGlobalEval( elems, refElements ) {\n\tvar i = 0,\n\t\tl = elems.length;\n\n\tfor ( ; i < l; i++ ) {\n\t\tdataPriv.set(\n\t\t\telems[ i ],\n\t\t\t\"globalEval\",\n\t\t\t!refElements || dataPriv.get( refElements[ i ], \"globalEval\" )\n\t\t);\n\t}\n}\n\n\nvar rhtml = /<|&#?\\w+;/;\n\nfunction buildFragment( elems, context, scripts, selection, ignored ) {\n\tvar elem, tmp, tag, wrap, attached, j,\n\t\tfragment = context.createDocumentFragment(),\n\t\tnodes = [],\n\t\ti = 0,\n\t\tl = elems.length;\n\n\tfor ( ; i < l; i++ ) {\n\t\telem = elems[ i ];\n\n\t\tif ( elem || elem === 0 ) {\n\n\t\t\t// Add nodes directly\n\t\t\tif ( toType( elem ) === \"object\" ) {\n\n\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\tjQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );\n\n\t\t\t// Convert non-html into a text node\n\t\t\t} else if ( !rhtml.test( elem ) ) {\n\t\t\t\tnodes.push( context.createTextNode( elem ) );\n\n\t\t\t// Convert html into DOM nodes\n\t\t\t} else {\n\t\t\t\ttmp = tmp || fragment.appendChild( context.createElement( \"div\" ) );\n\n\t\t\t\t// Deserialize a standard representation\n\t\t\t\ttag = ( rtagName.exec( elem ) || [ \"\", \"\" ] )[ 1 ].toLowerCase();\n\t\t\t\twrap = wrapMap[ tag ] || wrapMap._default;\n\t\t\t\ttmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];\n\n\t\t\t\t// Descend through wrappers to the right content\n\t\t\t\tj = wrap[ 0 ];\n\t\t\t\twhile ( j-- ) {\n\t\t\t\t\ttmp = tmp.lastChild;\n\t\t\t\t}\n\n\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\tjQuery.merge( nodes, tmp.childNodes );\n\n\t\t\t\t// Remember the top-level container\n\t\t\t\ttmp = fragment.firstChild;\n\n\t\t\t\t// Ensure the created nodes are orphaned (trac-12392)\n\t\t\t\ttmp.textContent = \"\";\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove wrapper from fragment\n\tfragment.textContent = \"\";\n\n\ti = 0;\n\twhile ( ( elem = nodes[ i++ ] ) ) {\n\n\t\t// Skip elements already in the context collection (trac-4087)\n\t\tif ( selection && jQuery.inArray( elem, selection ) > -1 ) {\n\t\t\tif ( ignored ) {\n\t\t\t\tignored.push( elem );\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tattached = isAttached( elem );\n\n\t\t// Append to fragment\n\t\ttmp = getAll( fragment.appendChild( elem ), \"script\" );\n\n\t\t// Preserve script evaluation history\n\t\tif ( attached ) {\n\t\t\tsetGlobalEval( tmp );\n\t\t}\n\n\t\t// Capture executables\n\t\tif ( scripts ) {\n\t\t\tj = 0;\n\t\t\twhile ( ( elem = tmp[ j++ ] ) ) {\n\t\t\t\tif ( rscriptType.test( elem.type || \"\" ) ) {\n\t\t\t\t\tscripts.push( elem );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn fragment;\n}\n\n\nvar rtypenamespace = /^([^.]*)(?:\\.(.+)|)/;\n\nfunction returnTrue() {\n\treturn true;\n}\n\nfunction returnFalse() {\n\treturn false;\n}\n\nfunction on( elem, types, selector, data, fn, one ) {\n\tvar origFn, type;\n\n\t// Types can be a map of types/handlers\n\tif ( typeof types === \"object\" ) {\n\n\t\t// ( types-Object, selector, data )\n\t\tif ( typeof selector !== \"string\" ) {\n\n\t\t\t// ( types-Object, data )\n\t\t\tdata = data || selector;\n\t\t\tselector = undefined;\n\t\t}\n\t\tfor ( type in types ) {\n\t\t\ton( elem, type, selector, data, types[ type ], one );\n\t\t}\n\t\treturn elem;\n\t}\n\n\tif ( data == null && fn == null ) {\n\n\t\t// ( types, fn )\n\t\tfn = selector;\n\t\tdata = selector = undefined;\n\t} else if ( fn == null ) {\n\t\tif ( typeof selector === \"string\" ) {\n\n\t\t\t// ( types, selector, fn )\n\t\t\tfn = data;\n\t\t\tdata = undefined;\n\t\t} else {\n\n\t\t\t// ( types, data, fn )\n\t\t\tfn = data;\n\t\t\tdata = selector;\n\t\t\tselector = undefined;\n\t\t}\n\t}\n\tif ( fn === false ) {\n\t\tfn = returnFalse;\n\t} else if ( !fn ) {\n\t\treturn elem;\n\t}\n\n\tif ( one === 1 ) {\n\t\torigFn = fn;\n\t\tfn = function( event ) {\n\n\t\t\t// Can use an empty set, since event contains the info\n\t\t\tjQuery().off( event );\n\t\t\treturn origFn.apply( this, arguments );\n\t\t};\n\n\t\t// Use same guid so caller can remove using origFn\n\t\tfn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );\n\t}\n\treturn elem.each( function() {\n\t\tjQuery.event.add( this, types, fn, data, selector );\n\t} );\n}\n\n/*\n * Helper functions for managing events -- not part of the public interface.\n * Props to Dean Edwards' addEvent library for many of the ideas.\n */\njQuery.event = {\n\n\tglobal: {},\n\n\tadd: function( elem, types, handler, data, selector ) {\n\n\t\tvar handleObjIn, eventHandle, tmp,\n\t\t\tevents, t, handleObj,\n\t\t\tspecial, handlers, type, namespaces, origType,\n\t\t\telemData = dataPriv.get( elem );\n\n\t\t// Only attach events to objects that accept data\n\t\tif ( !acceptData( elem ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Caller can pass in an object of custom data in lieu of the handler\n\t\tif ( handler.handler ) {\n\t\t\thandleObjIn = handler;\n\t\t\thandler = handleObjIn.handler;\n\t\t\tselector = handleObjIn.selector;\n\t\t}\n\n\t\t// Ensure that invalid selectors throw exceptions at attach time\n\t\t// Evaluate against documentElement in case elem is a non-element node (e.g., document)\n\t\tif ( selector ) {\n\t\t\tjQuery.find.matchesSelector( documentElement, selector );\n\t\t}\n\n\t\t// Make sure that the handler has a unique ID, used to find/remove it later\n\t\tif ( !handler.guid ) {\n\t\t\thandler.guid = jQuery.guid++;\n\t\t}\n\n\t\t// Init the element's event structure and main handler, if this is the first\n\t\tif ( !( events = elemData.events ) ) {\n\t\t\tevents = elemData.events = Object.create( null );\n\t\t}\n\t\tif ( !( eventHandle = elemData.handle ) ) {\n\t\t\teventHandle = elemData.handle = function( e ) {\n\n\t\t\t\t// Discard the second event of a jQuery.event.trigger() and\n\t\t\t\t// when an event is called after a page has unloaded\n\t\t\t\treturn typeof jQuery !== \"undefined\" && jQuery.event.triggered !== e.type ?\n\t\t\t\t\tjQuery.event.dispatch.apply( elem, arguments ) : undefined;\n\t\t\t};\n\t\t}\n\n\t\t// Handle multiple events separated by a space\n\t\ttypes = ( types || \"\" ).match( rnothtmlwhite ) || [ \"\" ];\n\t\tt = types.length;\n\t\twhile ( t-- ) {\n\t\t\ttmp = rtypenamespace.exec( types[ t ] ) || [];\n\t\t\ttype = origType = tmp[ 1 ];\n\t\t\tnamespaces = ( tmp[ 2 ] || \"\" ).split( \".\" ).sort();\n\n\t\t\t// There *must* be a type, no attaching namespace-only handlers\n\t\t\tif ( !type ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If event changes its type, use the special event handlers for the changed type\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\n\t\t\t// If selector defined, determine special event api type, otherwise given type\n\t\t\ttype = ( selector ? special.delegateType : special.bindType ) || type;\n\n\t\t\t// Update special based on newly reset type\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\n\t\t\t// handleObj is passed to all event handlers\n\t\t\thandleObj = jQuery.extend( {\n\t\t\t\ttype: type,\n\t\t\t\torigType: origType,\n\t\t\t\tdata: data,\n\t\t\t\thandler: handler,\n\t\t\t\tguid: handler.guid,\n\t\t\t\tselector: selector,\n\t\t\t\tneedsContext: selector && jQuery.expr.match.needsContext.test( selector ),\n\t\t\t\tnamespace: namespaces.join( \".\" )\n\t\t\t}, handleObjIn );\n\n\t\t\t// Init the event handler queue if we're the first\n\t\t\tif ( !( handlers = events[ type ] ) ) {\n\t\t\t\thandlers = events[ type ] = [];\n\t\t\t\thandlers.delegateCount = 0;\n\n\t\t\t\t// Only use addEventListener if the special events handler returns false\n\t\t\t\tif ( !special.setup ||\n\t\t\t\t\tspecial.setup.call( elem, data, namespaces, eventHandle ) === false ) {\n\n\t\t\t\t\tif ( elem.addEventListener ) {\n\t\t\t\t\t\telem.addEventListener( type, eventHandle );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( special.add ) {\n\t\t\t\tspecial.add.call( elem, handleObj );\n\n\t\t\t\tif ( !handleObj.handler.guid ) {\n\t\t\t\t\thandleObj.handler.guid = handler.guid;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add to the element's handler list, delegates in front\n\t\t\tif ( selector ) {\n\t\t\t\thandlers.splice( handlers.delegateCount++, 0, handleObj );\n\t\t\t} else {\n\t\t\t\thandlers.push( handleObj );\n\t\t\t}\n\n\t\t\t// Keep track of which events have ever been used, for event optimization\n\t\t\tjQuery.event.global[ type ] = true;\n\t\t}\n\n\t},\n\n\t// Detach an event or set of events from an element\n\tremove: function( elem, types, handler, selector, mappedTypes ) {\n\n\t\tvar j, origCount, tmp,\n\t\t\tevents, t, handleObj,\n\t\t\tspecial, handlers, type, namespaces, origType,\n\t\t\telemData = dataPriv.hasData( elem ) && dataPriv.get( elem );\n\n\t\tif ( !elemData || !( events = elemData.events ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Once for each type.namespace in types; type may be omitted\n\t\ttypes = ( types || \"\" ).match( rnothtmlwhite ) || [ \"\" ];\n\t\tt = types.length;\n\t\twhile ( t-- ) {\n\t\t\ttmp = rtypenamespace.exec( types[ t ] ) || [];\n\t\t\ttype = origType = tmp[ 1 ];\n\t\t\tnamespaces = ( tmp[ 2 ] || \"\" ).split( \".\" ).sort();\n\n\t\t\t// Unbind all events (on this namespace, if provided) for the element\n\t\t\tif ( !type ) {\n\t\t\t\tfor ( type in events ) {\n\t\t\t\t\tjQuery.event.remove( elem, type + types[ t ], handler, selector, true );\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\t\t\ttype = ( selector ? special.delegateType : special.bindType ) || type;\n\t\t\thandlers = events[ type ] || [];\n\t\t\ttmp = tmp[ 2 ] &&\n\t\t\t\tnew RegExp( \"(^|\\\\.)\" + namespaces.join( \"\\\\.(?:.*\\\\.|)\" ) + \"(\\\\.|$)\" );\n\n\t\t\t// Remove matching events\n\t\t\torigCount = j = handlers.length;\n\t\t\twhile ( j-- ) {\n\t\t\t\thandleObj = handlers[ j ];\n\n\t\t\t\tif ( ( mappedTypes || origType === handleObj.origType ) &&\n\t\t\t\t\t( !handler || handler.guid === handleObj.guid ) &&\n\t\t\t\t\t( !tmp || tmp.test( handleObj.namespace ) ) &&\n\t\t\t\t\t( !selector || selector === handleObj.selector ||\n\t\t\t\t\t\tselector === \"**\" && handleObj.selector ) ) {\n\t\t\t\t\thandlers.splice( j, 1 );\n\n\t\t\t\t\tif ( handleObj.selector ) {\n\t\t\t\t\t\thandlers.delegateCount--;\n\t\t\t\t\t}\n\t\t\t\t\tif ( special.remove ) {\n\t\t\t\t\t\tspecial.remove.call( elem, handleObj );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Remove generic event handler if we removed something and no more handlers exist\n\t\t\t// (avoids potential for endless recursion during removal of special event handlers)\n\t\t\tif ( origCount && !handlers.length ) {\n\t\t\t\tif ( !special.teardown ||\n\t\t\t\t\tspecial.teardown.call( elem, namespaces, elemData.handle ) === false ) {\n\n\t\t\t\t\tjQuery.removeEvent( elem, type, elemData.handle );\n\t\t\t\t}\n\n\t\t\t\tdelete events[ type ];\n\t\t\t}\n\t\t}\n\n\t\t// Remove data and the expando if it's no longer used\n\t\tif ( jQuery.isEmptyObject( events ) ) {\n\t\t\tdataPriv.remove( elem, \"handle events\" );\n\t\t}\n\t},\n\n\tdispatch: function( nativeEvent ) {\n\n\t\tvar i, j, ret, matched, handleObj, handlerQueue,\n\t\t\targs = new Array( arguments.length ),\n\n\t\t\t// Make a writable jQuery.Event from the native event object\n\t\t\tevent = jQuery.event.fix( nativeEvent ),\n\n\t\t\thandlers = (\n\t\t\t\tdataPriv.get( this, \"events\" ) || Object.create( null )\n\t\t\t)[ event.type ] || [],\n\t\t\tspecial = jQuery.event.special[ event.type ] || {};\n\n\t\t// Use the fix-ed jQuery.Event rather than the (read-only) native event\n\t\targs[ 0 ] = event;\n\n\t\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\n\t\tevent.delegateTarget = this;\n\n\t\t// Call the preDispatch hook for the mapped type, and let it bail if desired\n\t\tif ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine handlers\n\t\thandlerQueue = jQuery.event.handlers.call( this, event, handlers );\n\n\t\t// Run delegates first; they may want to stop propagation beneath us\n\t\ti = 0;\n\t\twhile ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {\n\t\t\tevent.currentTarget = matched.elem;\n\n\t\t\tj = 0;\n\t\t\twhile ( ( handleObj = matched.handlers[ j++ ] ) &&\n\t\t\t\t!event.isImmediatePropagationStopped() ) {\n\n\t\t\t\t// If the event is namespaced, then each handler is only invoked if it is\n\t\t\t\t// specially universal or its namespaces are a superset of the event's.\n\t\t\t\tif ( !event.rnamespace || handleObj.namespace === false ||\n\t\t\t\t\tevent.rnamespace.test( handleObj.namespace ) ) {\n\n\t\t\t\t\tevent.handleObj = handleObj;\n\t\t\t\t\tevent.data = handleObj.data;\n\n\t\t\t\t\tret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||\n\t\t\t\t\t\thandleObj.handler ).apply( matched.elem, args );\n\n\t\t\t\t\tif ( ret !== undefined ) {\n\t\t\t\t\t\tif ( ( event.result = ret ) === false ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Call the postDispatch hook for the mapped type\n\t\tif ( special.postDispatch ) {\n\t\t\tspecial.postDispatch.call( this, event );\n\t\t}\n\n\t\treturn event.result;\n\t},\n\n\thandlers: function( event, handlers ) {\n\t\tvar i, handleObj, sel, matchedHandlers, matchedSelectors,\n\t\t\thandlerQueue = [],\n\t\t\tdelegateCount = handlers.delegateCount,\n\t\t\tcur = event.target;\n\n\t\t// Find delegate handlers\n\t\tif ( delegateCount &&\n\n\t\t\t// Support: IE <=9\n\t\t\t// Black-hole SVG instance trees (trac-13180)\n\t\t\tcur.nodeType &&\n\n\t\t\t// Support: Firefox <=42\n\t\t\t// Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)\n\t\t\t// https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click\n\t\t\t// Support: IE 11 only\n\t\t\t// ...but not arrow key \"clicks\" of radio inputs, which can have `button` -1 (gh-2343)\n\t\t\t!( event.type === \"click\" && event.button >= 1 ) ) {\n\n\t\t\tfor ( ; cur !== this; cur = cur.parentNode || this ) {\n\n\t\t\t\t// Don't check non-elements (trac-13208)\n\t\t\t\t// Don't process clicks on disabled elements (trac-6911, trac-8165, trac-11382, trac-11764)\n\t\t\t\tif ( cur.nodeType === 1 && !( event.type === \"click\" && cur.disabled === true ) ) {\n\t\t\t\t\tmatchedHandlers = [];\n\t\t\t\t\tmatchedSelectors = {};\n\t\t\t\t\tfor ( i = 0; i < delegateCount; i++ ) {\n\t\t\t\t\t\thandleObj = handlers[ i ];\n\n\t\t\t\t\t\t// Don't conflict with Object.prototype properties (trac-13203)\n\t\t\t\t\t\tsel = handleObj.selector + \" \";\n\n\t\t\t\t\t\tif ( matchedSelectors[ sel ] === undefined ) {\n\t\t\t\t\t\t\tmatchedSelectors[ sel ] = handleObj.needsContext ?\n\t\t\t\t\t\t\t\tjQuery( sel, this ).index( cur ) > -1 :\n\t\t\t\t\t\t\t\tjQuery.find( sel, this, null, [ cur ] ).length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( matchedSelectors[ sel ] ) {\n\t\t\t\t\t\t\tmatchedHandlers.push( handleObj );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( matchedHandlers.length ) {\n\t\t\t\t\t\thandlerQueue.push( { elem: cur, handlers: matchedHandlers } );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Add the remaining (directly-bound) handlers\n\t\tcur = this;\n\t\tif ( delegateCount < handlers.length ) {\n\t\t\thandlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );\n\t\t}\n\n\t\treturn handlerQueue;\n\t},\n\n\taddProp: function( name, hook ) {\n\t\tObject.defineProperty( jQuery.Event.prototype, name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\n\t\t\tget: isFunction( hook ) ?\n\t\t\t\tfunction() {\n\t\t\t\t\tif ( this.originalEvent ) {\n\t\t\t\t\t\treturn hook( this.originalEvent );\n\t\t\t\t\t}\n\t\t\t\t} :\n\t\t\t\tfunction() {\n\t\t\t\t\tif ( this.originalEvent ) {\n\t\t\t\t\t\treturn this.originalEvent[ name ];\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\tset: function( value ) {\n\t\t\t\tObject.defineProperty( this, name, {\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\twritable: true,\n\t\t\t\t\tvalue: value\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t},\n\n\tfix: function( originalEvent ) {\n\t\treturn originalEvent[ jQuery.expando ] ?\n\t\t\toriginalEvent :\n\t\t\tnew jQuery.Event( originalEvent );\n\t},\n\n\tspecial: {\n\t\tload: {\n\n\t\t\t// Prevent triggered image.load events from bubbling to window.load\n\t\t\tnoBubble: true\n\t\t},\n\t\tclick: {\n\n\t\t\t// Utilize native event to ensure correct state for checkable inputs\n\t\t\tsetup: function( data ) {\n\n\t\t\t\t// For mutual compressibility with _default, replace `this` access with a local var.\n\t\t\t\t// `|| data` is dead code meant only to preserve the variable through minification.\n\t\t\t\tvar el = this || data;\n\n\t\t\t\t// Claim the first handler\n\t\t\t\tif ( rcheckableType.test( el.type ) &&\n\t\t\t\t\tel.click && nodeName( el, \"input\" ) ) {\n\n\t\t\t\t\t// dataPriv.set( el, \"click\", ... )\n\t\t\t\t\tleverageNative( el, \"click\", true );\n\t\t\t\t}\n\n\t\t\t\t// Return false to allow normal processing in the caller\n\t\t\t\treturn false;\n\t\t\t},\n\t\t\ttrigger: function( data ) {\n\n\t\t\t\t// For mutual compressibility with _default, replace `this` access with a local var.\n\t\t\t\t// `|| data` is dead code meant only to preserve the variable through minification.\n\t\t\t\tvar el = this || data;\n\n\t\t\t\t// Force setup before triggering a click\n\t\t\t\tif ( rcheckableType.test( el.type ) &&\n\t\t\t\t\tel.click && nodeName( el, \"input\" ) ) {\n\n\t\t\t\t\tleverageNative( el, \"click\" );\n\t\t\t\t}\n\n\t\t\t\t// Return non-false to allow normal event-path propagation\n\t\t\t\treturn true;\n\t\t\t},\n\n\t\t\t// For cross-browser consistency, suppress native .click() on links\n\t\t\t// Also prevent it if we're currently inside a leveraged native-event stack\n\t\t\t_default: function( event ) {\n\t\t\t\tvar target = event.target;\n\t\t\t\treturn rcheckableType.test( target.type ) &&\n\t\t\t\t\ttarget.click && nodeName( target, \"input\" ) &&\n\t\t\t\t\tdataPriv.get( target, \"click\" ) ||\n\t\t\t\t\tnodeName( target, \"a\" );\n\t\t\t}\n\t\t},\n\n\t\tbeforeunload: {\n\t\t\tpostDispatch: function( event ) {\n\n\t\t\t\t// Support: Firefox 20+\n\t\t\t\t// Firefox doesn't alert if the returnValue field is not set.\n\t\t\t\tif ( event.result !== undefined && event.originalEvent ) {\n\t\t\t\t\tevent.originalEvent.returnValue = event.result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Ensure the presence of an event listener that handles manually-triggered\n// synthetic events by interrupting progress until reinvoked in response to\n// *native* events that it fires directly, ensuring that state changes have\n// already occurred before other listeners are invoked.\nfunction leverageNative( el, type, isSetup ) {\n\n\t// Missing `isSetup` indicates a trigger call, which must force setup through jQuery.event.add\n\tif ( !isSetup ) {\n\t\tif ( dataPriv.get( el, type ) === undefined ) {\n\t\t\tjQuery.event.add( el, type, returnTrue );\n\t\t}\n\t\treturn;\n\t}\n\n\t// Register the controller as a special universal handler for all event namespaces\n\tdataPriv.set( el, type, false );\n\tjQuery.event.add( el, type, {\n\t\tnamespace: false,\n\t\thandler: function( event ) {\n\t\t\tvar result,\n\t\t\t\tsaved = dataPriv.get( this, type );\n\n\t\t\tif ( ( event.isTrigger & 1 ) && this[ type ] ) {\n\n\t\t\t\t// Interrupt processing of the outer synthetic .trigger()ed event\n\t\t\t\tif ( !saved ) {\n\n\t\t\t\t\t// Store arguments for use when handling the inner native event\n\t\t\t\t\t// There will always be at least one argument (an event object), so this array\n\t\t\t\t\t// will not be confused with a leftover capture object.\n\t\t\t\t\tsaved = slice.call( arguments );\n\t\t\t\t\tdataPriv.set( this, type, saved );\n\n\t\t\t\t\t// Trigger the native event and capture its result\n\t\t\t\t\tthis[ type ]();\n\t\t\t\t\tresult = dataPriv.get( this, type );\n\t\t\t\t\tdataPriv.set( this, type, false );\n\n\t\t\t\t\tif ( saved !== result ) {\n\n\t\t\t\t\t\t// Cancel the outer synthetic event\n\t\t\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t}\n\n\t\t\t\t// If this is an inner synthetic event for an event with a bubbling surrogate\n\t\t\t\t// (focus or blur), assume that the surrogate already propagated from triggering\n\t\t\t\t// the native event and prevent that from happening again here.\n\t\t\t\t// This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the\n\t\t\t\t// bubbling surrogate propagates *after* the non-bubbling base), but that seems\n\t\t\t\t// less bad than duplication.\n\t\t\t\t} else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t}\n\n\t\t\t// If this is a native event triggered above, everything is now in order\n\t\t\t// Fire an inner synthetic event with the original arguments\n\t\t\t} else if ( saved ) {\n\n\t\t\t\t// ...and capture the result\n\t\t\t\tdataPriv.set( this, type, jQuery.event.trigger(\n\t\t\t\t\tsaved[ 0 ],\n\t\t\t\t\tsaved.slice( 1 ),\n\t\t\t\t\tthis\n\t\t\t\t) );\n\n\t\t\t\t// Abort handling of the native event by all jQuery handlers while allowing\n\t\t\t\t// native handlers on the same element to run. On target, this is achieved\n\t\t\t\t// by stopping immediate propagation just on the jQuery event. However,\n\t\t\t\t// the native event is re-wrapped by a jQuery one on each level of the\n\t\t\t\t// propagation so the only way to stop it for jQuery is to stop it for\n\t\t\t\t// everyone via native `stopPropagation()`. This is not a problem for\n\t\t\t\t// focus/blur which don't bubble, but it does also stop click on checkboxes\n\t\t\t\t// and radios. We accept this limitation.\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tevent.isImmediatePropagationStopped = returnTrue;\n\t\t\t}\n\t\t}\n\t} );\n}\n\njQuery.removeEvent = function( elem, type, handle ) {\n\n\t// This \"if\" is needed for plain objects\n\tif ( elem.removeEventListener ) {\n\t\telem.removeEventListener( type, handle );\n\t}\n};\n\njQuery.Event = function( src, props ) {\n\n\t// Allow instantiation without the 'new' keyword\n\tif ( !( this instanceof jQuery.Event ) ) {\n\t\treturn new jQuery.Event( src, props );\n\t}\n\n\t// Event object\n\tif ( src && src.type ) {\n\t\tthis.originalEvent = src;\n\t\tthis.type = src.type;\n\n\t\t// Events bubbling up the document may have been marked as prevented\n\t\t// by a handler lower down the tree; reflect the correct value.\n\t\tthis.isDefaultPrevented = src.defaultPrevented ||\n\t\t\t\tsrc.defaultPrevented === undefined &&\n\n\t\t\t\t// Support: Android <=2.3 only\n\t\t\t\tsrc.returnValue === false ?\n\t\t\treturnTrue :\n\t\t\treturnFalse;\n\n\t\t// Create target properties\n\t\t// Support: Safari <=6 - 7 only\n\t\t// Target should not be a text node (trac-504, trac-13143)\n\t\tthis.target = ( src.target && src.target.nodeType === 3 ) ?\n\t\t\tsrc.target.parentNode :\n\t\t\tsrc.target;\n\n\t\tthis.currentTarget = src.currentTarget;\n\t\tthis.relatedTarget = src.relatedTarget;\n\n\t// Event type\n\t} else {\n\t\tthis.type = src;\n\t}\n\n\t// Put explicitly provided properties onto the event object\n\tif ( props ) {\n\t\tjQuery.extend( this, props );\n\t}\n\n\t// Create a timestamp if incoming event doesn't have one\n\tthis.timeStamp = src && src.timeStamp || Date.now();\n\n\t// Mark it as fixed\n\tthis[ jQuery.expando ] = true;\n};\n\n// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding\n// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html\njQuery.Event.prototype = {\n\tconstructor: jQuery.Event,\n\tisDefaultPrevented: returnFalse,\n\tisPropagationStopped: returnFalse,\n\tisImmediatePropagationStopped: returnFalse,\n\tisSimulated: false,\n\n\tpreventDefault: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isDefaultPrevented = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.preventDefault();\n\t\t}\n\t},\n\tstopPropagation: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isPropagationStopped = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.stopPropagation();\n\t\t}\n\t},\n\tstopImmediatePropagation: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isImmediatePropagationStopped = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.stopImmediatePropagation();\n\t\t}\n\n\t\tthis.stopPropagation();\n\t}\n};\n\n// Includes all common event props including KeyEvent and MouseEvent specific props\njQuery.each( {\n\taltKey: true,\n\tbubbles: true,\n\tcancelable: true,\n\tchangedTouches: true,\n\tctrlKey: true,\n\tdetail: true,\n\teventPhase: true,\n\tmetaKey: true,\n\tpageX: true,\n\tpageY: true,\n\tshiftKey: true,\n\tview: true,\n\t\"char\": true,\n\tcode: true,\n\tcharCode: true,\n\tkey: true,\n\tkeyCode: true,\n\tbutton: true,\n\tbuttons: true,\n\tclientX: true,\n\tclientY: true,\n\toffsetX: true,\n\toffsetY: true,\n\tpointerId: true,\n\tpointerType: true,\n\tscreenX: true,\n\tscreenY: true,\n\ttargetTouches: true,\n\ttoElement: true,\n\ttouches: true,\n\twhich: true\n}, jQuery.event.addProp );\n\njQuery.each( { focus: \"focusin\", blur: \"focusout\" }, function( type, delegateType ) {\n\n\tfunction focusMappedHandler( nativeEvent ) {\n\t\tif ( document.documentMode ) {\n\n\t\t\t// Support: IE 11+\n\t\t\t// Attach a single focusin/focusout handler on the document while someone wants\n\t\t\t// focus/blur. This is because the former are synchronous in IE while the latter\n\t\t\t// are async. In other browsers, all those handlers are invoked synchronously.\n\n\t\t\t// `handle` from private data would already wrap the event, but we need\n\t\t\t// to change the `type` here.\n\t\t\tvar handle = dataPriv.get( this, \"handle\" ),\n\t\t\t\tevent = jQuery.event.fix( nativeEvent );\n\t\t\tevent.type = nativeEvent.type === \"focusin\" ? \"focus\" : \"blur\";\n\t\t\tevent.isSimulated = true;\n\n\t\t\t// First, handle focusin/focusout\n\t\t\thandle( nativeEvent );\n\n\t\t\t// ...then, handle focus/blur\n\t\t\t//\n\t\t\t// focus/blur don't bubble while focusin/focusout do; simulate the former by only\n\t\t\t// invoking the handler at the lower level.\n\t\t\tif ( event.target === event.currentTarget ) {\n\n\t\t\t\t// The setup part calls `leverageNative`, which, in turn, calls\n\t\t\t\t// `jQuery.event.add`, so event handle will already have been set\n\t\t\t\t// by this point.\n\t\t\t\thandle( event );\n\t\t\t}\n\t\t} else {\n\n\t\t\t// For non-IE browsers, attach a single capturing handler on the document\n\t\t\t// while someone wants focusin/focusout.\n\t\t\tjQuery.event.simulate( delegateType, nativeEvent.target,\n\t\t\t\tjQuery.event.fix( nativeEvent ) );\n\t\t}\n\t}\n\n\tjQuery.event.special[ type ] = {\n\n\t\t// Utilize native event if possible so blur/focus sequence is correct\n\t\tsetup: function() {\n\n\t\t\tvar attaches;\n\n\t\t\t// Claim the first handler\n\t\t\t// dataPriv.set( this, \"focus\", ... )\n\t\t\t// dataPriv.set( this, \"blur\", ... )\n\t\t\tleverageNative( this, type, true );\n\n\t\t\tif ( document.documentMode ) {\n\n\t\t\t\t// Support: IE 9 - 11+\n\t\t\t\t// We use the same native handler for focusin & focus (and focusout & blur)\n\t\t\t\t// so we need to coordinate setup & teardown parts between those events.\n\t\t\t\t// Use `delegateType` as the key as `type` is already used by `leverageNative`.\n\t\t\t\tattaches = dataPriv.get( this, delegateType );\n\t\t\t\tif ( !attaches ) {\n\t\t\t\t\tthis.addEventListener( delegateType, focusMappedHandler );\n\t\t\t\t}\n\t\t\t\tdataPriv.set( this, delegateType, ( attaches || 0 ) + 1 );\n\t\t\t} else {\n\n\t\t\t\t// Return false to allow normal processing in the caller\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\n\t\ttrigger: function() {\n\n\t\t\t// Force setup before trigger\n\t\t\tleverageNative( this, type );\n\n\t\t\t// Return non-false to allow normal event-path propagation\n\t\t\treturn true;\n\t\t},\n\n\t\tteardown: function() {\n\t\t\tvar attaches;\n\n\t\t\tif ( document.documentMode ) {\n\t\t\t\tattaches = dataPriv.get( this, delegateType ) - 1;\n\t\t\t\tif ( !attaches ) {\n\t\t\t\t\tthis.removeEventListener( delegateType, focusMappedHandler );\n\t\t\t\t\tdataPriv.remove( this, delegateType );\n\t\t\t\t} else {\n\t\t\t\t\tdataPriv.set( this, delegateType, attaches );\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t// Return false to indicate standard teardown should be applied\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\n\n\t\t// Suppress native focus or blur if we're currently inside\n\t\t// a leveraged native-event stack\n\t\t_default: function( event ) {\n\t\t\treturn dataPriv.get( event.target, type );\n\t\t},\n\n\t\tdelegateType: delegateType\n\t};\n\n\t// Support: Firefox <=44\n\t// Firefox doesn't have focus(in | out) events\n\t// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787\n\t//\n\t// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1\n\t// focus(in | out) events fire after focus & blur events,\n\t// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order\n\t// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857\n\t//\n\t// Support: IE 9 - 11+\n\t// To preserve relative focusin/focus & focusout/blur event order guaranteed on the 3.x branch,\n\t// attach a single handler for both events in IE.\n\tjQuery.event.special[ delegateType ] = {\n\t\tsetup: function() {\n\n\t\t\t// Handle: regular nodes (via `this.ownerDocument`), window\n\t\t\t// (via `this.document`) & document (via `this`).\n\t\t\tvar doc = this.ownerDocument || this.document || this,\n\t\t\t\tdataHolder = document.documentMode ? this : doc,\n\t\t\t\tattaches = dataPriv.get( dataHolder, delegateType );\n\n\t\t\t// Support: IE 9 - 11+\n\t\t\t// We use the same native handler for focusin & focus (and focusout & blur)\n\t\t\t// so we need to coordinate setup & teardown parts between those events.\n\t\t\t// Use `delegateType` as the key as `type` is already used by `leverageNative`.\n\t\t\tif ( !attaches ) {\n\t\t\t\tif ( document.documentMode ) {\n\t\t\t\t\tthis.addEventListener( delegateType, focusMappedHandler );\n\t\t\t\t} else {\n\t\t\t\t\tdoc.addEventListener( type, focusMappedHandler, true );\n\t\t\t\t}\n\t\t\t}\n\t\t\tdataPriv.set( dataHolder, delegateType, ( attaches || 0 ) + 1 );\n\t\t},\n\t\tteardown: function() {\n\t\t\tvar doc = this.ownerDocument || this.document || this,\n\t\t\t\tdataHolder = document.documentMode ? this : doc,\n\t\t\t\tattaches = dataPriv.get( dataHolder, delegateType ) - 1;\n\n\t\t\tif ( !attaches ) {\n\t\t\t\tif ( document.documentMode ) {\n\t\t\t\t\tthis.removeEventListener( delegateType, focusMappedHandler );\n\t\t\t\t} else {\n\t\t\t\t\tdoc.removeEventListener( type, focusMappedHandler, true );\n\t\t\t\t}\n\t\t\t\tdataPriv.remove( dataHolder, delegateType );\n\t\t\t} else {\n\t\t\t\tdataPriv.set( dataHolder, delegateType, attaches );\n\t\t\t}\n\t\t}\n\t};\n} );\n\n// Create mouseenter/leave events using mouseover/out and event-time checks\n// so that event delegation works in jQuery.\n// Do the same for pointerenter/pointerleave and pointerover/pointerout\n//\n// Support: Safari 7 only\n// Safari sends mouseenter too often; see:\n// https://bugs.chromium.org/p/chromium/issues/detail?id=470258\n// for the description of the bug (it existed in older Chrome versions as well).\njQuery.each( {\n\tmouseenter: \"mouseover\",\n\tmouseleave: \"mouseout\",\n\tpointerenter: \"pointerover\",\n\tpointerleave: \"pointerout\"\n}, function( orig, fix ) {\n\tjQuery.event.special[ orig ] = {\n\t\tdelegateType: fix,\n\t\tbindType: fix,\n\n\t\thandle: function( event ) {\n\t\t\tvar ret,\n\t\t\t\ttarget = this,\n\t\t\t\trelated = event.relatedTarget,\n\t\t\t\thandleObj = event.handleObj;\n\n\t\t\t// For mouseenter/leave call the handler if related is outside the target.\n\t\t\t// NB: No relatedTarget if the mouse left/entered the browser window\n\t\t\tif ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {\n\t\t\t\tevent.type = handleObj.origType;\n\t\t\t\tret = handleObj.handler.apply( this, arguments );\n\t\t\t\tevent.type = fix;\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\t};\n} );\n\njQuery.fn.extend( {\n\n\ton: function( types, selector, data, fn ) {\n\t\treturn on( this, types, selector, data, fn );\n\t},\n\tone: function( types, selector, data, fn ) {\n\t\treturn on( this, types, selector, data, fn, 1 );\n\t},\n\toff: function( types, selector, fn ) {\n\t\tvar handleObj, type;\n\t\tif ( types && types.preventDefault && types.handleObj ) {\n\n\t\t\t// ( event ) dispatched jQuery.Event\n\t\t\thandleObj = types.handleObj;\n\t\t\tjQuery( types.delegateTarget ).off(\n\t\t\t\thandleObj.namespace ?\n\t\t\t\t\thandleObj.origType + \".\" + handleObj.namespace :\n\t\t\t\t\thandleObj.origType,\n\t\t\t\thandleObj.selector,\n\t\t\t\thandleObj.handler\n\t\t\t);\n\t\t\treturn this;\n\t\t}\n\t\tif ( typeof types === \"object\" ) {\n\n\t\t\t// ( types-object [, selector] )\n\t\t\tfor ( type in types ) {\n\t\t\t\tthis.off( type, selector, types[ type ] );\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\tif ( selector === false || typeof selector === \"function\" ) {\n\n\t\t\t// ( types [, fn] )\n\t\t\tfn = selector;\n\t\t\tselector = undefined;\n\t\t}\n\t\tif ( fn === false ) {\n\t\t\tfn = returnFalse;\n\t\t}\n\t\treturn this.each( function() {\n\t\t\tjQuery.event.remove( this, types, fn, selector );\n\t\t} );\n\t}\n} );\n\n\nvar\n\n\t// Support: IE <=10 - 11, Edge 12 - 13 only\n\t// In IE/Edge using regex groups here causes severe slowdowns.\n\t// See https://connect.microsoft.com/IE/feedback/details/1736512/\n\trnoInnerhtml = /\\s*$/g;\n\n// Prefer a tbody over its parent table for containing new rows\nfunction manipulationTarget( elem, content ) {\n\tif ( nodeName( elem, \"table\" ) &&\n\t\tnodeName( content.nodeType !== 11 ? content : content.firstChild, \"tr\" ) ) {\n\n\t\treturn jQuery( elem ).children( \"tbody\" )[ 0 ] || elem;\n\t}\n\n\treturn elem;\n}\n\n// Replace/restore the type attribute of script elements for safe DOM manipulation\nfunction disableScript( elem ) {\n\telem.type = ( elem.getAttribute( \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}\nfunction restoreScript( elem ) {\n\tif ( ( elem.type || \"\" ).slice( 0, 5 ) === \"true/\" ) {\n\t\telem.type = elem.type.slice( 5 );\n\t} else {\n\t\telem.removeAttribute( \"type\" );\n\t}\n\n\treturn elem;\n}\n\nfunction cloneCopyEvent( src, dest ) {\n\tvar i, l, type, pdataOld, udataOld, udataCur, events;\n\n\tif ( dest.nodeType !== 1 ) {\n\t\treturn;\n\t}\n\n\t// 1. Copy private data: events, handlers, etc.\n\tif ( dataPriv.hasData( src ) ) {\n\t\tpdataOld = dataPriv.get( src );\n\t\tevents = pdataOld.events;\n\n\t\tif ( events ) {\n\t\t\tdataPriv.remove( dest, \"handle events\" );\n\n\t\t\tfor ( type in events ) {\n\t\t\t\tfor ( i = 0, l = events[ type ].length; i < l; i++ ) {\n\t\t\t\t\tjQuery.event.add( dest, type, events[ type ][ i ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// 2. Copy user data\n\tif ( dataUser.hasData( src ) ) {\n\t\tudataOld = dataUser.access( src );\n\t\tudataCur = jQuery.extend( {}, udataOld );\n\n\t\tdataUser.set( dest, udataCur );\n\t}\n}\n\n// Fix IE bugs, see support tests\nfunction fixInput( src, dest ) {\n\tvar nodeName = dest.nodeName.toLowerCase();\n\n\t// Fails to persist the checked state of a cloned checkbox or radio button.\n\tif ( nodeName === \"input\" && rcheckableType.test( src.type ) ) {\n\t\tdest.checked = src.checked;\n\n\t// Fails to return the selected option to the default selected state when cloning options\n\t} else if ( nodeName === \"input\" || nodeName === \"textarea\" ) {\n\t\tdest.defaultValue = src.defaultValue;\n\t}\n}\n\nfunction domManip( collection, args, callback, ignored ) {\n\n\t// Flatten any nested arrays\n\targs = flat( args );\n\n\tvar fragment, first, scripts, hasScripts, node, doc,\n\t\ti = 0,\n\t\tl = collection.length,\n\t\tiNoClone = l - 1,\n\t\tvalue = args[ 0 ],\n\t\tvalueIsFunction = isFunction( value );\n\n\t// We can't cloneNode fragments that contain checked, in WebKit\n\tif ( valueIsFunction ||\n\t\t\t( l > 1 && typeof value === \"string\" &&\n\t\t\t\t!support.checkClone && rchecked.test( value ) ) ) {\n\t\treturn collection.each( function( index ) {\n\t\t\tvar self = collection.eq( index );\n\t\t\tif ( valueIsFunction ) {\n\t\t\t\targs[ 0 ] = value.call( this, index, self.html() );\n\t\t\t}\n\t\t\tdomManip( self, args, callback, ignored );\n\t\t} );\n\t}\n\n\tif ( l ) {\n\t\tfragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );\n\t\tfirst = fragment.firstChild;\n\n\t\tif ( fragment.childNodes.length === 1 ) {\n\t\t\tfragment = first;\n\t\t}\n\n\t\t// Require either new content or an interest in ignored elements to invoke the callback\n\t\tif ( first || ignored ) {\n\t\t\tscripts = jQuery.map( getAll( fragment, \"script\" ), disableScript );\n\t\t\thasScripts = scripts.length;\n\n\t\t\t// Use the original fragment for the last item\n\t\t\t// instead of the first because it can end up\n\t\t\t// being emptied incorrectly in certain situations (trac-8070).\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tnode = fragment;\n\n\t\t\t\tif ( i !== iNoClone ) {\n\t\t\t\t\tnode = jQuery.clone( node, true, true );\n\n\t\t\t\t\t// Keep references to cloned scripts for later restoration\n\t\t\t\t\tif ( hasScripts ) {\n\n\t\t\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\t\t\tjQuery.merge( scripts, getAll( node, \"script\" ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcallback.call( collection[ i ], node, i );\n\t\t\t}\n\n\t\t\tif ( hasScripts ) {\n\t\t\t\tdoc = scripts[ scripts.length - 1 ].ownerDocument;\n\n\t\t\t\t// Re-enable scripts\n\t\t\t\tjQuery.map( scripts, restoreScript );\n\n\t\t\t\t// Evaluate executable scripts on first document insertion\n\t\t\t\tfor ( i = 0; i < hasScripts; i++ ) {\n\t\t\t\t\tnode = scripts[ i ];\n\t\t\t\t\tif ( rscriptType.test( node.type || \"\" ) &&\n\t\t\t\t\t\t!dataPriv.access( node, \"globalEval\" ) &&\n\t\t\t\t\t\tjQuery.contains( doc, node ) ) {\n\n\t\t\t\t\t\tif ( node.src && ( node.type || \"\" ).toLowerCase() !== \"module\" ) {\n\n\t\t\t\t\t\t\t// Optional AJAX dependency, but won't run scripts if not present\n\t\t\t\t\t\t\tif ( jQuery._evalUrl && !node.noModule ) {\n\t\t\t\t\t\t\t\tjQuery._evalUrl( node.src, {\n\t\t\t\t\t\t\t\t\tnonce: node.nonce || node.getAttribute( \"nonce\" )\n\t\t\t\t\t\t\t\t}, doc );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Unwrap a CDATA section containing script contents. This shouldn't be\n\t\t\t\t\t\t\t// needed as in XML documents they're already not visible when\n\t\t\t\t\t\t\t// inspecting element contents and in HTML documents they have no\n\t\t\t\t\t\t\t// meaning but we're preserving that logic for backwards compatibility.\n\t\t\t\t\t\t\t// This will be removed completely in 4.0. See gh-4904.\n\t\t\t\t\t\t\tDOMEval( node.textContent.replace( rcleanScript, \"\" ), node, doc );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn collection;\n}\n\nfunction remove( elem, selector, keepData ) {\n\tvar node,\n\t\tnodes = selector ? jQuery.filter( selector, elem ) : elem,\n\t\ti = 0;\n\n\tfor ( ; ( node = nodes[ i ] ) != null; i++ ) {\n\t\tif ( !keepData && node.nodeType === 1 ) {\n\t\t\tjQuery.cleanData( getAll( node ) );\n\t\t}\n\n\t\tif ( node.parentNode ) {\n\t\t\tif ( keepData && isAttached( node ) ) {\n\t\t\t\tsetGlobalEval( getAll( node, \"script\" ) );\n\t\t\t}\n\t\t\tnode.parentNode.removeChild( node );\n\t\t}\n\t}\n\n\treturn elem;\n}\n\njQuery.extend( {\n\thtmlPrefilter: function( html ) {\n\t\treturn html;\n\t},\n\n\tclone: function( elem, dataAndEvents, deepDataAndEvents ) {\n\t\tvar i, l, srcElements, destElements,\n\t\t\tclone = elem.cloneNode( true ),\n\t\t\tinPage = isAttached( elem );\n\n\t\t// Fix IE cloning issues\n\t\tif ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&\n\t\t\t\t!jQuery.isXMLDoc( elem ) ) {\n\n\t\t\t// We eschew jQuery#find here for performance reasons:\n\t\t\t// https://jsperf.com/getall-vs-sizzle/2\n\t\t\tdestElements = getAll( clone );\n\t\t\tsrcElements = getAll( elem );\n\n\t\t\tfor ( i = 0, l = srcElements.length; i < l; i++ ) {\n\t\t\t\tfixInput( srcElements[ i ], destElements[ i ] );\n\t\t\t}\n\t\t}\n\n\t\t// Copy the events from the original to the clone\n\t\tif ( dataAndEvents ) {\n\t\t\tif ( deepDataAndEvents ) {\n\t\t\t\tsrcElements = srcElements || getAll( elem );\n\t\t\t\tdestElements = destElements || getAll( clone );\n\n\t\t\t\tfor ( i = 0, l = srcElements.length; i < l; i++ ) {\n\t\t\t\t\tcloneCopyEvent( srcElements[ i ], destElements[ i ] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcloneCopyEvent( elem, clone );\n\t\t\t}\n\t\t}\n\n\t\t// Preserve script evaluation history\n\t\tdestElements = getAll( clone, \"script\" );\n\t\tif ( destElements.length > 0 ) {\n\t\t\tsetGlobalEval( destElements, !inPage && getAll( elem, \"script\" ) );\n\t\t}\n\n\t\t// Return the cloned set\n\t\treturn clone;\n\t},\n\n\tcleanData: function( elems ) {\n\t\tvar data, elem, type,\n\t\t\tspecial = jQuery.event.special,\n\t\t\ti = 0;\n\n\t\tfor ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {\n\t\t\tif ( acceptData( elem ) ) {\n\t\t\t\tif ( ( data = elem[ dataPriv.expando ] ) ) {\n\t\t\t\t\tif ( data.events ) {\n\t\t\t\t\t\tfor ( type in data.events ) {\n\t\t\t\t\t\t\tif ( special[ type ] ) {\n\t\t\t\t\t\t\t\tjQuery.event.remove( elem, type );\n\n\t\t\t\t\t\t\t// This is a shortcut to avoid jQuery.event.remove's overhead\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tjQuery.removeEvent( elem, type, data.handle );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Support: Chrome <=35 - 45+\n\t\t\t\t\t// Assign undefined instead of using delete, see Data#remove\n\t\t\t\t\telem[ dataPriv.expando ] = undefined;\n\t\t\t\t}\n\t\t\t\tif ( elem[ dataUser.expando ] ) {\n\n\t\t\t\t\t// Support: Chrome <=35 - 45+\n\t\t\t\t\t// Assign undefined instead of using delete, see Data#remove\n\t\t\t\t\telem[ dataUser.expando ] = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n} );\n\njQuery.fn.extend( {\n\tdetach: function( selector ) {\n\t\treturn remove( this, selector, true );\n\t},\n\n\tremove: function( selector ) {\n\t\treturn remove( this, selector );\n\t},\n\n\ttext: function( value ) {\n\t\treturn access( this, function( value ) {\n\t\t\treturn value === undefined ?\n\t\t\t\tjQuery.text( this ) :\n\t\t\t\tthis.empty().each( function() {\n\t\t\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\t\t\tthis.textContent = value;\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t}, null, value, arguments.length );\n\t},\n\n\tappend: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\tvar target = manipulationTarget( this, elem );\n\t\t\t\ttarget.appendChild( elem );\n\t\t\t}\n\t\t} );\n\t},\n\n\tprepend: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\tvar target = manipulationTarget( this, elem );\n\t\t\t\ttarget.insertBefore( elem, target.firstChild );\n\t\t\t}\n\t\t} );\n\t},\n\n\tbefore: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.parentNode ) {\n\t\t\t\tthis.parentNode.insertBefore( elem, this );\n\t\t\t}\n\t\t} );\n\t},\n\n\tafter: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.parentNode ) {\n\t\t\t\tthis.parentNode.insertBefore( elem, this.nextSibling );\n\t\t\t}\n\t\t} );\n\t},\n\n\tempty: function() {\n\t\tvar elem,\n\t\t\ti = 0;\n\n\t\tfor ( ; ( elem = this[ i ] ) != null; i++ ) {\n\t\t\tif ( elem.nodeType === 1 ) {\n\n\t\t\t\t// Prevent memory leaks\n\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\n\t\t\t\t// Remove any remaining nodes\n\t\t\t\telem.textContent = \"\";\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tclone: function( dataAndEvents, deepDataAndEvents ) {\n\t\tdataAndEvents = dataAndEvents == null ? false : dataAndEvents;\n\t\tdeepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;\n\n\t\treturn this.map( function() {\n\t\t\treturn jQuery.clone( this, dataAndEvents, deepDataAndEvents );\n\t\t} );\n\t},\n\n\thtml: function( value ) {\n\t\treturn access( this, function( value ) {\n\t\t\tvar elem = this[ 0 ] || {},\n\t\t\t\ti = 0,\n\t\t\t\tl = this.length;\n\n\t\t\tif ( value === undefined && elem.nodeType === 1 ) {\n\t\t\t\treturn elem.innerHTML;\n\t\t\t}\n\n\t\t\t// See if we can take a shortcut and just use innerHTML\n\t\t\tif ( typeof value === \"string\" && !rnoInnerhtml.test( value ) &&\n\t\t\t\t!wrapMap[ ( rtagName.exec( value ) || [ \"\", \"\" ] )[ 1 ].toLowerCase() ] ) {\n\n\t\t\t\tvalue = jQuery.htmlPrefilter( value );\n\n\t\t\t\ttry {\n\t\t\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\t\t\telem = this[ i ] || {};\n\n\t\t\t\t\t\t// Remove element nodes and prevent memory leaks\n\t\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\t\t\t\t\t\t\telem.innerHTML = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\telem = 0;\n\n\t\t\t\t// If using innerHTML throws an exception, use the fallback method\n\t\t\t\t} catch ( e ) {}\n\t\t\t}\n\n\t\t\tif ( elem ) {\n\t\t\t\tthis.empty().append( value );\n\t\t\t}\n\t\t}, null, value, arguments.length );\n\t},\n\n\treplaceWith: function() {\n\t\tvar ignored = [];\n\n\t\t// Make the changes, replacing each non-ignored context element with the new content\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tvar parent = this.parentNode;\n\n\t\t\tif ( jQuery.inArray( this, ignored ) < 0 ) {\n\t\t\t\tjQuery.cleanData( getAll( this ) );\n\t\t\t\tif ( parent ) {\n\t\t\t\t\tparent.replaceChild( elem, this );\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Force callback invocation\n\t\t}, ignored );\n\t}\n} );\n\njQuery.each( {\n\tappendTo: \"append\",\n\tprependTo: \"prepend\",\n\tinsertBefore: \"before\",\n\tinsertAfter: \"after\",\n\treplaceAll: \"replaceWith\"\n}, function( name, original ) {\n\tjQuery.fn[ name ] = function( selector ) {\n\t\tvar elems,\n\t\t\tret = [],\n\t\t\tinsert = jQuery( selector ),\n\t\t\tlast = insert.length - 1,\n\t\t\ti = 0;\n\n\t\tfor ( ; i <= last; i++ ) {\n\t\t\telems = i === last ? this : this.clone( true );\n\t\t\tjQuery( insert[ i ] )[ original ]( elems );\n\n\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t// .get() because push.apply(_, arraylike) throws on ancient WebKit\n\t\t\tpush.apply( ret, elems.get() );\n\t\t}\n\n\t\treturn this.pushStack( ret );\n\t};\n} );\nvar rnumnonpx = new RegExp( \"^(\" + pnum + \")(?!px)[a-z%]+$\", \"i\" );\n\nvar rcustomProp = /^--/;\n\n\nvar getStyles = function( elem ) {\n\n\t\t// Support: IE <=11 only, Firefox <=30 (trac-15098, trac-14150)\n\t\t// IE throws on elements created in popups\n\t\t// FF meanwhile throws on frame elements through \"defaultView.getComputedStyle\"\n\t\tvar view = elem.ownerDocument.defaultView;\n\n\t\tif ( !view || !view.opener ) {\n\t\t\tview = window;\n\t\t}\n\n\t\treturn view.getComputedStyle( elem );\n\t};\n\nvar swap = function( elem, options, callback ) {\n\tvar ret, name,\n\t\told = {};\n\n\t// Remember the old values, and insert the new ones\n\tfor ( name in options ) {\n\t\told[ name ] = elem.style[ name ];\n\t\telem.style[ name ] = options[ name ];\n\t}\n\n\tret = callback.call( elem );\n\n\t// Revert the old values\n\tfor ( name in options ) {\n\t\telem.style[ name ] = old[ name ];\n\t}\n\n\treturn ret;\n};\n\n\nvar rboxStyle = new RegExp( cssExpand.join( \"|\" ), \"i\" );\n\n\n\n( function() {\n\n\t// Executing both pixelPosition & boxSizingReliable tests require only one layout\n\t// so they're executed at the same time to save the second computation.\n\tfunction computeStyleTests() {\n\n\t\t// This is a singleton, we need to execute it only once\n\t\tif ( !div ) {\n\t\t\treturn;\n\t\t}\n\n\t\tcontainer.style.cssText = \"position:absolute;left:-11111px;width:60px;\" +\n\t\t\t\"margin-top:1px;padding:0;border:0\";\n\t\tdiv.style.cssText =\n\t\t\t\"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" +\n\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\"width:60%;top:1%\";\n\t\tdocumentElement.appendChild( container ).appendChild( div );\n\n\t\tvar divStyle = window.getComputedStyle( div );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\treliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;\n\n\t\t// Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\tdiv.style.right = \"60%\";\n\t\tpixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;\n\n\t\t// Support: IE 9 - 11 only\n\t\t// Detect misreporting of content dimensions for box-sizing:border-box elements\n\t\tboxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;\n\n\t\t// Support: IE 9 only\n\t\t// Detect overflow:scroll screwiness (gh-3699)\n\t\t// Support: Chrome <=64\n\t\t// Don't get tricked when zoom affects offsetWidth (gh-4029)\n\t\tdiv.style.position = \"absolute\";\n\t\tscrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;\n\n\t\tdocumentElement.removeChild( container );\n\n\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t// it will also be a sign that checks already performed\n\t\tdiv = null;\n\t}\n\n\tfunction roundPixelMeasures( measure ) {\n\t\treturn Math.round( parseFloat( measure ) );\n\t}\n\n\tvar pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,\n\t\treliableTrDimensionsVal, reliableMarginLeftVal,\n\t\tcontainer = document.createElement( \"div\" ),\n\t\tdiv = document.createElement( \"div\" );\n\n\t// Finish early in limited (non-browser) environments\n\tif ( !div.style ) {\n\t\treturn;\n\t}\n\n\t// Support: IE <=9 - 11 only\n\t// Style of cloned element affects source element cloned (trac-8908)\n\tdiv.style.backgroundClip = \"content-box\";\n\tdiv.cloneNode( true ).style.backgroundClip = \"\";\n\tsupport.clearCloneStyle = div.style.backgroundClip === \"content-box\";\n\n\tjQuery.extend( support, {\n\t\tboxSizingReliable: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn boxSizingReliableVal;\n\t\t},\n\t\tpixelBoxStyles: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn pixelBoxStylesVal;\n\t\t},\n\t\tpixelPosition: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn pixelPositionVal;\n\t\t},\n\t\treliableMarginLeft: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn reliableMarginLeftVal;\n\t\t},\n\t\tscrollboxSize: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn scrollboxSizeVal;\n\t\t},\n\n\t\t// Support: IE 9 - 11+, Edge 15 - 18+\n\t\t// IE/Edge misreport `getComputedStyle` of table rows with width/height\n\t\t// set in CSS while `offset*` properties report correct values.\n\t\t// Behavior in IE 9 is more subtle than in newer versions & it passes\n\t\t// some versions of this test; make sure not to make it pass there!\n\t\t//\n\t\t// Support: Firefox 70+\n\t\t// Only Firefox includes border widths\n\t\t// in computed dimensions. (gh-4529)\n\t\treliableTrDimensions: function() {\n\t\t\tvar table, tr, trChild, trStyle;\n\t\t\tif ( reliableTrDimensionsVal == null ) {\n\t\t\t\ttable = document.createElement( \"table\" );\n\t\t\t\ttr = document.createElement( \"tr\" );\n\t\t\t\ttrChild = document.createElement( \"div\" );\n\n\t\t\t\ttable.style.cssText = \"position:absolute;left:-11111px;border-collapse:separate\";\n\t\t\t\ttr.style.cssText = \"box-sizing:content-box;border:1px solid\";\n\n\t\t\t\t// Support: Chrome 86+\n\t\t\t\t// Height set through cssText does not get applied.\n\t\t\t\t// Computed height then comes back as 0.\n\t\t\t\ttr.style.height = \"1px\";\n\t\t\t\ttrChild.style.height = \"9px\";\n\n\t\t\t\t// Support: Android 8 Chrome 86+\n\t\t\t\t// In our bodyBackground.html iframe,\n\t\t\t\t// display for all div elements is set to \"inline\",\n\t\t\t\t// which causes a problem only in Android 8 Chrome 86.\n\t\t\t\t// Ensuring the div is `display: block`\n\t\t\t\t// gets around this issue.\n\t\t\t\ttrChild.style.display = \"block\";\n\n\t\t\t\tdocumentElement\n\t\t\t\t\t.appendChild( table )\n\t\t\t\t\t.appendChild( tr )\n\t\t\t\t\t.appendChild( trChild );\n\n\t\t\t\ttrStyle = window.getComputedStyle( tr );\n\t\t\t\treliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) +\n\t\t\t\t\tparseInt( trStyle.borderTopWidth, 10 ) +\n\t\t\t\t\tparseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight;\n\n\t\t\t\tdocumentElement.removeChild( table );\n\t\t\t}\n\t\t\treturn reliableTrDimensionsVal;\n\t\t}\n\t} );\n} )();\n\n\nfunction curCSS( elem, name, computed ) {\n\tvar width, minWidth, maxWidth, ret,\n\t\tisCustomProp = rcustomProp.test( name ),\n\n\t\t// Support: Firefox 51+\n\t\t// Retrieving style before computed somehow\n\t\t// fixes an issue with getting wrong values\n\t\t// on detached elements\n\t\tstyle = elem.style;\n\n\tcomputed = computed || getStyles( elem );\n\n\t// getPropertyValue is needed for:\n\t// .css('filter') (IE 9 only, trac-12537)\n\t// .css('--customProperty) (gh-3144)\n\tif ( computed ) {\n\n\t\t// Support: IE <=9 - 11+\n\t\t// IE only supports `\"float\"` in `getPropertyValue`; in computed styles\n\t\t// it's only available as `\"cssFloat\"`. We no longer modify properties\n\t\t// sent to `.css()` apart from camelCasing, so we need to check both.\n\t\t// Normally, this would create difference in behavior: if\n\t\t// `getPropertyValue` returns an empty string, the value returned\n\t\t// by `.css()` would be `undefined`. This is usually the case for\n\t\t// disconnected elements. However, in IE even disconnected elements\n\t\t// with no styles return `\"none\"` for `getPropertyValue( \"float\" )`\n\t\tret = computed.getPropertyValue( name ) || computed[ name ];\n\n\t\tif ( isCustomProp && ret ) {\n\n\t\t\t// Support: Firefox 105+, Chrome <=105+\n\t\t\t// Spec requires trimming whitespace for custom properties (gh-4926).\n\t\t\t// Firefox only trims leading whitespace. Chrome just collapses\n\t\t\t// both leading & trailing whitespace to a single space.\n\t\t\t//\n\t\t\t// Fall back to `undefined` if empty string returned.\n\t\t\t// This collapses a missing definition with property defined\n\t\t\t// and set to an empty string but there's no standard API\n\t\t\t// allowing us to differentiate them without a performance penalty\n\t\t\t// and returning `undefined` aligns with older jQuery.\n\t\t\t//\n\t\t\t// rtrimCSS treats U+000D CARRIAGE RETURN and U+000C FORM FEED\n\t\t\t// as whitespace while CSS does not, but this is not a problem\n\t\t\t// because CSS preprocessing replaces them with U+000A LINE FEED\n\t\t\t// (which *is* CSS whitespace)\n\t\t\t// https://www.w3.org/TR/css-syntax-3/#input-preprocessing\n\t\t\tret = ret.replace( rtrimCSS, \"$1\" ) || undefined;\n\t\t}\n\n\t\tif ( ret === \"\" && !isAttached( elem ) ) {\n\t\t\tret = jQuery.style( elem, name );\n\t\t}\n\n\t\t// A tribute to the \"awesome hack by Dean Edwards\"\n\t\t// Android Browser returns percentage for some values,\n\t\t// but width seems to be reliably pixels.\n\t\t// This is against the CSSOM draft spec:\n\t\t// https://drafts.csswg.org/cssom/#resolved-values\n\t\tif ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {\n\n\t\t\t// Remember the original values\n\t\t\twidth = style.width;\n\t\t\tminWidth = style.minWidth;\n\t\t\tmaxWidth = style.maxWidth;\n\n\t\t\t// Put in the new values to get a computed value out\n\t\t\tstyle.minWidth = style.maxWidth = style.width = ret;\n\t\t\tret = computed.width;\n\n\t\t\t// Revert the changed values\n\t\t\tstyle.width = width;\n\t\t\tstyle.minWidth = minWidth;\n\t\t\tstyle.maxWidth = maxWidth;\n\t\t}\n\t}\n\n\treturn ret !== undefined ?\n\n\t\t// Support: IE <=9 - 11 only\n\t\t// IE returns zIndex value as an integer.\n\t\tret + \"\" :\n\t\tret;\n}\n\n\nfunction addGetHookIf( conditionFn, hookFn ) {\n\n\t// Define the hook, we'll check on the first run if it's really needed.\n\treturn {\n\t\tget: function() {\n\t\t\tif ( conditionFn() ) {\n\n\t\t\t\t// Hook not needed (or it's not possible to use it due\n\t\t\t\t// to missing dependency), remove it.\n\t\t\t\tdelete this.get;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Hook needed; redefine it so that the support test is not executed again.\n\t\t\treturn ( this.get = hookFn ).apply( this, arguments );\n\t\t}\n\t};\n}\n\n\nvar cssPrefixes = [ \"Webkit\", \"Moz\", \"ms\" ],\n\temptyStyle = document.createElement( \"div\" ).style,\n\tvendorProps = {};\n\n// Return a vendor-prefixed property or undefined\nfunction vendorPropName( name ) {\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}\n\n// Return a potentially-mapped jQuery.cssProps or vendor prefixed property\nfunction finalPropName( name ) {\n\tvar final = jQuery.cssProps[ name ] || vendorProps[ name ];\n\n\tif ( final ) {\n\t\treturn final;\n\t}\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\treturn vendorProps[ name ] = vendorPropName( name ) || name;\n}\n\n\nvar\n\n\t// Swappable if display is none or starts with table\n\t// except \"table\", \"table-cell\", or \"table-caption\"\n\t// See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display\n\trdisplayswap = /^(none|table(?!-c[ea]).+)/,\n\tcssShow = { position: \"absolute\", visibility: \"hidden\", display: \"block\" },\n\tcssNormalTransform = {\n\t\tletterSpacing: \"0\",\n\t\tfontWeight: \"400\"\n\t};\n\nfunction setPositiveNumber( _elem, value, subtract ) {\n\n\t// Any relative (+/-) values have already been\n\t// normalized at this point\n\tvar matches = rcssNum.exec( value );\n\treturn matches ?\n\n\t\t// Guard against undefined \"subtract\", e.g., when used as in cssHooks\n\t\tMath.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || \"px\" ) :\n\t\tvalue;\n}\n\nfunction boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {\n\tvar i = dimension === \"width\" ? 1 : 0,\n\t\textra = 0,\n\t\tdelta = 0,\n\t\tmarginDelta = 0;\n\n\t// Adjustment may not be necessary\n\tif ( box === ( isBorderBox ? \"border\" : \"content\" ) ) {\n\t\treturn 0;\n\t}\n\n\tfor ( ; i < 4; i += 2 ) {\n\n\t\t// Both box models exclude margin\n\t\t// Count margin delta separately to only add it after scroll gutter adjustment.\n\t\t// This is needed to make negative margins work with `outerHeight( true )` (gh-3982).\n\t\tif ( box === \"margin\" ) {\n\t\t\tmarginDelta += jQuery.css( elem, box + cssExpand[ i ], true, styles );\n\t\t}\n\n\t\t// If we get here with a content-box, we're seeking \"padding\" or \"border\" or \"margin\"\n\t\tif ( !isBorderBox ) {\n\n\t\t\t// Add padding\n\t\t\tdelta += jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n\n\t\t\t// For \"border\" or \"margin\", add border\n\t\t\tif ( box !== \"padding\" ) {\n\t\t\t\tdelta += jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\n\t\t\t// But still keep track of it otherwise\n\t\t\t} else {\n\t\t\t\textra += jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\t\t\t}\n\n\t\t// If we get here with a border-box (content + padding + border), we're seeking \"content\" or\n\t\t// \"padding\" or \"margin\"\n\t\t} else {\n\n\t\t\t// For \"content\", subtract padding\n\t\t\tif ( box === \"content\" ) {\n\t\t\t\tdelta -= jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n\t\t\t}\n\n\t\t\t// For \"content\" or \"padding\", subtract border\n\t\t\tif ( box !== \"margin\" ) {\n\t\t\t\tdelta -= jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Account for positive content-box scroll gutter when requested by providing computedVal\n\tif ( !isBorderBox && computedVal >= 0 ) {\n\n\t\t// offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border\n\t\t// Assuming integer scroll gutter, subtract the rest and round down\n\t\tdelta += Math.max( 0, Math.ceil(\n\t\t\telem[ \"offset\" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -\n\t\t\tcomputedVal -\n\t\t\tdelta -\n\t\t\textra -\n\t\t\t0.5\n\n\t\t// If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter\n\t\t// Use an explicit zero to avoid NaN (gh-3964)\n\t\t) ) || 0;\n\t}\n\n\treturn delta + marginDelta;\n}\n\nfunction getWidthOrHeight( elem, dimension, extra ) {\n\n\t// Start with computed style\n\tvar styles = getStyles( elem ),\n\n\t\t// To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).\n\t\t// Fake content-box until we know it's needed to know the true value.\n\t\tboxSizingNeeded = !support.boxSizingReliable() || extra,\n\t\tisBorderBox = boxSizingNeeded &&\n\t\t\tjQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\",\n\t\tvalueIsBorderBox = isBorderBox,\n\n\t\tval = curCSS( elem, dimension, styles ),\n\t\toffsetProp = \"offset\" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 );\n\n\t// Support: Firefox <=54\n\t// Return a confounding non-pixel value or feign ignorance, as appropriate.\n\tif ( rnumnonpx.test( val ) ) {\n\t\tif ( !extra ) {\n\t\t\treturn val;\n\t\t}\n\t\tval = \"auto\";\n\t}\n\n\n\t// Support: IE 9 - 11 only\n\t// Use offsetWidth/offsetHeight for when box sizing is unreliable.\n\t// In those cases, the computed value can be trusted to be border-box.\n\tif ( ( !support.boxSizingReliable() && isBorderBox ||\n\n\t\t// Support: IE 10 - 11+, Edge 15 - 18+\n\t\t// IE/Edge misreport `getComputedStyle` of table rows with width/height\n\t\t// set in CSS while `offset*` properties report correct values.\n\t\t// Interestingly, in some cases IE 9 doesn't suffer from this issue.\n\t\t!support.reliableTrDimensions() && nodeName( elem, \"tr\" ) ||\n\n\t\t// Fall back to offsetWidth/offsetHeight when value is \"auto\"\n\t\t// This happens for inline elements with no explicit setting (gh-3571)\n\t\tval === \"auto\" ||\n\n\t\t// Support: Android <=4.1 - 4.3 only\n\t\t// Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)\n\t\t!parseFloat( val ) && jQuery.css( elem, \"display\", false, styles ) === \"inline\" ) &&\n\n\t\t// Make sure the element is visible & connected\n\t\telem.getClientRects().length ) {\n\n\t\tisBorderBox = jQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\";\n\n\t\t// Where available, offsetWidth/offsetHeight approximate border box dimensions.\n\t\t// Where not available (e.g., SVG), assume unreliable box-sizing and interpret the\n\t\t// retrieved value as a content box dimension.\n\t\tvalueIsBorderBox = offsetProp in elem;\n\t\tif ( valueIsBorderBox ) {\n\t\t\tval = elem[ offsetProp ];\n\t\t}\n\t}\n\n\t// Normalize \"\" and auto\n\tval = parseFloat( val ) || 0;\n\n\t// Adjust for the element's box model\n\treturn ( val +\n\t\tboxModelAdjustment(\n\t\t\telem,\n\t\t\tdimension,\n\t\t\textra || ( isBorderBox ? \"border\" : \"content\" ),\n\t\t\tvalueIsBorderBox,\n\t\t\tstyles,\n\n\t\t\t// Provide the current computed size to request scroll gutter calculation (gh-3589)\n\t\t\tval\n\t\t)\n\t) + \"px\";\n}\n\njQuery.extend( {\n\n\t// Add in style property hooks for overriding the default\n\t// behavior of getting and setting a style property\n\tcssHooks: {\n\t\topacity: {\n\t\t\tget: function( elem, computed ) {\n\t\t\t\tif ( computed ) {\n\n\t\t\t\t\t// We should always get a number back from opacity\n\t\t\t\t\tvar ret = curCSS( elem, \"opacity\" );\n\t\t\t\t\treturn ret === \"\" ? \"1\" : ret;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\t// Don't automatically add \"px\" to these possibly-unitless properties\n\tcssNumber: {\n\t\tanimationIterationCount: true,\n\t\taspectRatio: true,\n\t\tborderImageSlice: true,\n\t\tcolumnCount: true,\n\t\tflexGrow: true,\n\t\tflexShrink: true,\n\t\tfontWeight: true,\n\t\tgridArea: true,\n\t\tgridColumn: true,\n\t\tgridColumnEnd: true,\n\t\tgridColumnStart: true,\n\t\tgridRow: true,\n\t\tgridRowEnd: true,\n\t\tgridRowStart: true,\n\t\tlineHeight: true,\n\t\topacity: true,\n\t\torder: true,\n\t\torphans: true,\n\t\tscale: true,\n\t\twidows: true,\n\t\tzIndex: true,\n\t\tzoom: true,\n\n\t\t// SVG-related\n\t\tfillOpacity: true,\n\t\tfloodOpacity: true,\n\t\tstopOpacity: true,\n\t\tstrokeMiterlimit: true,\n\t\tstrokeOpacity: true\n\t},\n\n\t// Add in properties whose names you wish to fix before\n\t// setting or getting the value\n\tcssProps: {},\n\n\t// Get and set the style property on a DOM Node\n\tstyle: function( elem, name, value, extra ) {\n\n\t\t// Don't set styles on text and comment nodes\n\t\tif ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make sure that we're working with the right name\n\t\tvar ret, type, hooks,\n\t\t\torigName = camelCase( name ),\n\t\t\tisCustomProp = rcustomProp.test( name ),\n\t\t\tstyle = elem.style;\n\n\t\t// Make sure that we're working with the right name. We don't\n\t\t// want to query the value if it is a CSS custom property\n\t\t// since they are user-defined.\n\t\tif ( !isCustomProp ) {\n\t\t\tname = finalPropName( origName );\n\t\t}\n\n\t\t// Gets hook for the prefixed version, then unprefixed version\n\t\thooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n\t\t// Check if we're setting a value\n\t\tif ( value !== undefined ) {\n\t\t\ttype = typeof value;\n\n\t\t\t// Convert \"+=\" or \"-=\" to relative numbers (trac-7345)\n\t\t\tif ( type === \"string\" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {\n\t\t\t\tvalue = adjustCSS( elem, name, ret );\n\n\t\t\t\t// Fixes bug trac-9237\n\t\t\t\ttype = \"number\";\n\t\t\t}\n\n\t\t\t// Make sure that null and NaN values aren't set (trac-7116)\n\t\t\tif ( value == null || value !== value ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If a number was passed in, add the unit (except for certain CSS properties)\n\t\t\t// The isCustomProp check can be removed in jQuery 4.0 when we only auto-append\n\t\t\t// \"px\" to a few hardcoded values.\n\t\t\tif ( type === \"number\" && !isCustomProp ) {\n\t\t\t\tvalue += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? \"\" : \"px\" );\n\t\t\t}\n\n\t\t\t// background-* props affect original clone's values\n\t\t\tif ( !support.clearCloneStyle && value === \"\" && name.indexOf( \"background\" ) === 0 ) {\n\t\t\t\tstyle[ name ] = \"inherit\";\n\t\t\t}\n\n\t\t\t// If a hook was provided, use that value, otherwise just set the specified value\n\t\t\tif ( !hooks || !( \"set\" in hooks ) ||\n\t\t\t\t( value = hooks.set( elem, value, extra ) ) !== undefined ) {\n\n\t\t\t\tif ( isCustomProp ) {\n\t\t\t\t\tstyle.setProperty( name, value );\n\t\t\t\t} else {\n\t\t\t\t\tstyle[ name ] = value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// If a hook was provided get the non-computed value from there\n\t\t\tif ( hooks && \"get\" in hooks &&\n\t\t\t\t( ret = hooks.get( elem, false, extra ) ) !== undefined ) {\n\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\t// Otherwise just get the value from the style object\n\t\t\treturn style[ name ];\n\t\t}\n\t},\n\n\tcss: function( elem, name, extra, styles ) {\n\t\tvar val, num, hooks,\n\t\t\torigName = camelCase( name ),\n\t\t\tisCustomProp = rcustomProp.test( name );\n\n\t\t// Make sure that we're working with the right name. We don't\n\t\t// want to modify the value if it is a CSS custom property\n\t\t// since they are user-defined.\n\t\tif ( !isCustomProp ) {\n\t\t\tname = finalPropName( origName );\n\t\t}\n\n\t\t// Try prefixed name followed by the unprefixed name\n\t\thooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n\t\t// If a hook was provided get the computed value from there\n\t\tif ( hooks && \"get\" in hooks ) {\n\t\t\tval = hooks.get( elem, true, extra );\n\t\t}\n\n\t\t// Otherwise, if a way to get the computed value exists, use that\n\t\tif ( val === undefined ) {\n\t\t\tval = curCSS( elem, name, styles );\n\t\t}\n\n\t\t// Convert \"normal\" to computed value\n\t\tif ( val === \"normal\" && name in cssNormalTransform ) {\n\t\t\tval = cssNormalTransform[ name ];\n\t\t}\n\n\t\t// Make numeric if forced or a qualifier was provided and val looks numeric\n\t\tif ( extra === \"\" || extra ) {\n\t\t\tnum = parseFloat( val );\n\t\t\treturn extra === true || isFinite( num ) ? num || 0 : val;\n\t\t}\n\n\t\treturn val;\n\t}\n} );\n\njQuery.each( [ \"height\", \"width\" ], function( _i, dimension ) {\n\tjQuery.cssHooks[ dimension ] = {\n\t\tget: function( elem, computed, extra ) {\n\t\t\tif ( computed ) {\n\n\t\t\t\t// Certain elements can have dimension info if we invisibly show them\n\t\t\t\t// but it must have a current display style that would benefit\n\t\t\t\treturn rdisplayswap.test( jQuery.css( elem, \"display\" ) ) &&\n\n\t\t\t\t\t// Support: Safari 8+\n\t\t\t\t\t// Table columns in Safari have non-zero offsetWidth & zero\n\t\t\t\t\t// getBoundingClientRect().width unless display is changed.\n\t\t\t\t\t// Support: IE <=11 only\n\t\t\t\t\t// Running getBoundingClientRect on a disconnected node\n\t\t\t\t\t// in IE throws an error.\n\t\t\t\t\t( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?\n\t\t\t\t\tswap( elem, cssShow, function() {\n\t\t\t\t\t\treturn getWidthOrHeight( elem, dimension, extra );\n\t\t\t\t\t} ) :\n\t\t\t\t\tgetWidthOrHeight( elem, dimension, extra );\n\t\t\t}\n\t\t},\n\n\t\tset: function( elem, value, extra ) {\n\t\t\tvar matches,\n\t\t\t\tstyles = getStyles( elem ),\n\n\t\t\t\t// Only read styles.position if the test has a chance to fail\n\t\t\t\t// to avoid forcing a reflow.\n\t\t\t\tscrollboxSizeBuggy = !support.scrollboxSize() &&\n\t\t\t\t\tstyles.position === \"absolute\",\n\n\t\t\t\t// To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)\n\t\t\t\tboxSizingNeeded = scrollboxSizeBuggy || extra,\n\t\t\t\tisBorderBox = boxSizingNeeded &&\n\t\t\t\t\tjQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\",\n\t\t\t\tsubtract = extra ?\n\t\t\t\t\tboxModelAdjustment(\n\t\t\t\t\t\telem,\n\t\t\t\t\t\tdimension,\n\t\t\t\t\t\textra,\n\t\t\t\t\t\tisBorderBox,\n\t\t\t\t\t\tstyles\n\t\t\t\t\t) :\n\t\t\t\t\t0;\n\n\t\t\t// Account for unreliable border-box dimensions by comparing offset* to computed and\n\t\t\t// faking a content-box to get border and padding (gh-3699)\n\t\t\tif ( isBorderBox && scrollboxSizeBuggy ) {\n\t\t\t\tsubtract -= Math.ceil(\n\t\t\t\t\telem[ \"offset\" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -\n\t\t\t\t\tparseFloat( styles[ dimension ] ) -\n\t\t\t\t\tboxModelAdjustment( elem, dimension, \"border\", false, styles ) -\n\t\t\t\t\t0.5\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Convert to pixels if value adjustment is needed\n\t\t\tif ( subtract && ( matches = rcssNum.exec( value ) ) &&\n\t\t\t\t( matches[ 3 ] || \"px\" ) !== \"px\" ) {\n\n\t\t\t\telem.style[ dimension ] = value;\n\t\t\t\tvalue = jQuery.css( elem, dimension );\n\t\t\t}\n\n\t\t\treturn setPositiveNumber( elem, value, subtract );\n\t\t}\n\t};\n} );\n\njQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,\n\tfunction( elem, computed ) {\n\t\tif ( computed ) {\n\t\t\treturn ( parseFloat( curCSS( elem, \"marginLeft\" ) ) ||\n\t\t\t\telem.getBoundingClientRect().left -\n\t\t\t\t\tswap( elem, { marginLeft: 0 }, function() {\n\t\t\t\t\t\treturn elem.getBoundingClientRect().left;\n\t\t\t\t\t} )\n\t\t\t) + \"px\";\n\t\t}\n\t}\n);\n\n// These hooks are used by animate to expand properties\njQuery.each( {\n\tmargin: \"\",\n\tpadding: \"\",\n\tborder: \"Width\"\n}, function( prefix, suffix ) {\n\tjQuery.cssHooks[ prefix + suffix ] = {\n\t\texpand: function( value ) {\n\t\t\tvar i = 0,\n\t\t\t\texpanded = {},\n\n\t\t\t\t// Assumes a single number if not a string\n\t\t\t\tparts = typeof value === \"string\" ? value.split( \" \" ) : [ value ];\n\n\t\t\tfor ( ; i < 4; i++ ) {\n\t\t\t\texpanded[ prefix + cssExpand[ i ] + suffix ] =\n\t\t\t\t\tparts[ i ] || parts[ i - 2 ] || parts[ 0 ];\n\t\t\t}\n\n\t\t\treturn expanded;\n\t\t}\n\t};\n\n\tif ( prefix !== \"margin\" ) {\n\t\tjQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;\n\t}\n} );\n\njQuery.fn.extend( {\n\tcss: function( name, value ) {\n\t\treturn access( this, function( elem, name, value ) {\n\t\t\tvar styles, len,\n\t\t\t\tmap = {},\n\t\t\t\ti = 0;\n\n\t\t\tif ( Array.isArray( name ) ) {\n\t\t\t\tstyles = getStyles( elem );\n\t\t\t\tlen = name.length;\n\n\t\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\t\tmap[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );\n\t\t\t\t}\n\n\t\t\t\treturn map;\n\t\t\t}\n\n\t\t\treturn value !== undefined ?\n\t\t\t\tjQuery.style( elem, name, value ) :\n\t\t\t\tjQuery.css( elem, name );\n\t\t}, name, value, arguments.length > 1 );\n\t}\n} );\n\n\nfunction Tween( elem, options, prop, end, easing ) {\n\treturn new Tween.prototype.init( elem, options, prop, end, easing );\n}\njQuery.Tween = Tween;\n\nTween.prototype = {\n\tconstructor: Tween,\n\tinit: function( elem, options, prop, end, easing, unit ) {\n\t\tthis.elem = elem;\n\t\tthis.prop = prop;\n\t\tthis.easing = easing || jQuery.easing._default;\n\t\tthis.options = options;\n\t\tthis.start = this.now = this.cur();\n\t\tthis.end = end;\n\t\tthis.unit = unit || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" );\n\t},\n\tcur: function() {\n\t\tvar hooks = Tween.propHooks[ this.prop ];\n\n\t\treturn hooks && hooks.get ?\n\t\t\thooks.get( this ) :\n\t\t\tTween.propHooks._default.get( this );\n\t},\n\trun: function( percent ) {\n\t\tvar eased,\n\t\t\thooks = Tween.propHooks[ this.prop ];\n\n\t\tif ( this.options.duration ) {\n\t\t\tthis.pos = eased = jQuery.easing[ this.easing ](\n\t\t\t\tpercent, this.options.duration * percent, 0, 1, this.options.duration\n\t\t\t);\n\t\t} else {\n\t\t\tthis.pos = eased = percent;\n\t\t}\n\t\tthis.now = ( this.end - this.start ) * eased + this.start;\n\n\t\tif ( this.options.step ) {\n\t\t\tthis.options.step.call( this.elem, this.now, this );\n\t\t}\n\n\t\tif ( hooks && hooks.set ) {\n\t\t\thooks.set( this );\n\t\t} else {\n\t\t\tTween.propHooks._default.set( this );\n\t\t}\n\t\treturn this;\n\t}\n};\n\nTween.prototype.init.prototype = Tween.prototype;\n\nTween.propHooks = {\n\t_default: {\n\t\tget: function( tween ) {\n\t\t\tvar result;\n\n\t\t\t// Use a property on the element directly when it is not a DOM element,\n\t\t\t// or when there is no matching style property that exists.\n\t\t\tif ( tween.elem.nodeType !== 1 ||\n\t\t\t\ttween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {\n\t\t\t\treturn tween.elem[ tween.prop ];\n\t\t\t}\n\n\t\t\t// Passing an empty string as a 3rd parameter to .css will automatically\n\t\t\t// attempt a parseFloat and fallback to a string if the parse fails.\n\t\t\t// Simple values such as \"10px\" are parsed to Float;\n\t\t\t// complex values such as \"rotate(1rad)\" are returned as-is.\n\t\t\tresult = jQuery.css( tween.elem, tween.prop, \"\" );\n\n\t\t\t// Empty strings, null, undefined and \"auto\" are converted to 0.\n\t\t\treturn !result || result === \"auto\" ? 0 : result;\n\t\t},\n\t\tset: function( tween ) {\n\n\t\t\t// Use step hook for back compat.\n\t\t\t// Use cssHook if its there.\n\t\t\t// Use .style if available and use plain properties where available.\n\t\t\tif ( jQuery.fx.step[ tween.prop ] ) {\n\t\t\t\tjQuery.fx.step[ tween.prop ]( tween );\n\t\t\t} else if ( tween.elem.nodeType === 1 && (\n\t\t\t\tjQuery.cssHooks[ tween.prop ] ||\n\t\t\t\t\ttween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {\n\t\t\t\tjQuery.style( tween.elem, tween.prop, tween.now + tween.unit );\n\t\t\t} else {\n\t\t\t\ttween.elem[ tween.prop ] = tween.now;\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Support: IE <=9 only\n// Panic based approach to setting things on disconnected nodes\nTween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {\n\tset: function( tween ) {\n\t\tif ( tween.elem.nodeType && tween.elem.parentNode ) {\n\t\t\ttween.elem[ tween.prop ] = tween.now;\n\t\t}\n\t}\n};\n\njQuery.easing = {\n\tlinear: function( p ) {\n\t\treturn p;\n\t},\n\tswing: function( p ) {\n\t\treturn 0.5 - Math.cos( p * Math.PI ) / 2;\n\t},\n\t_default: \"swing\"\n};\n\njQuery.fx = Tween.prototype.init;\n\n// Back compat <1.8 extension point\njQuery.fx.step = {};\n\n\n\n\nvar\n\tfxNow, inProgress,\n\trfxtypes = /^(?:toggle|show|hide)$/,\n\trrun = /queueHooks$/;\n\nfunction schedule() {\n\tif ( inProgress ) {\n\t\tif ( document.hidden === false && window.requestAnimationFrame ) {\n\t\t\twindow.requestAnimationFrame( schedule );\n\t\t} else {\n\t\t\twindow.setTimeout( schedule, jQuery.fx.interval );\n\t\t}\n\n\t\tjQuery.fx.tick();\n\t}\n}\n\n// Animations created synchronously will run synchronously\nfunction createFxNow() {\n\twindow.setTimeout( function() {\n\t\tfxNow = undefined;\n\t} );\n\treturn ( fxNow = Date.now() );\n}\n\n// Generate parameters to create a standard animation\nfunction genFx( type, includeWidth ) {\n\tvar which,\n\t\ti = 0,\n\t\tattrs = { height: type };\n\n\t// If we include width, step value is 1 to do all cssExpand values,\n\t// otherwise step value is 2 to skip over Left and Right\n\tincludeWidth = includeWidth ? 1 : 0;\n\tfor ( ; i < 4; i += 2 - includeWidth ) {\n\t\twhich = cssExpand[ i ];\n\t\tattrs[ \"margin\" + which ] = attrs[ \"padding\" + which ] = type;\n\t}\n\n\tif ( includeWidth ) {\n\t\tattrs.opacity = attrs.width = type;\n\t}\n\n\treturn attrs;\n}\n\nfunction createTween( value, prop, animation ) {\n\tvar tween,\n\t\tcollection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ \"*\" ] ),\n\t\tindex = 0,\n\t\tlength = collection.length;\n\tfor ( ; index < length; index++ ) {\n\t\tif ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {\n\n\t\t\t// We're done with this property\n\t\t\treturn tween;\n\t\t}\n\t}\n}\n\nfunction defaultPrefilter( elem, props, opts ) {\n\tvar prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,\n\t\tisBox = \"width\" in props || \"height\" in props,\n\t\tanim = this,\n\t\torig = {},\n\t\tstyle = elem.style,\n\t\thidden = elem.nodeType && isHiddenWithinTree( elem ),\n\t\tdataShow = dataPriv.get( elem, \"fxshow\" );\n\n\t// Queue-skipping animations hijack the fx hooks\n\tif ( !opts.queue ) {\n\t\thooks = jQuery._queueHooks( elem, \"fx\" );\n\t\tif ( hooks.unqueued == null ) {\n\t\t\thooks.unqueued = 0;\n\t\t\toldfire = hooks.empty.fire;\n\t\t\thooks.empty.fire = function() {\n\t\t\t\tif ( !hooks.unqueued ) {\n\t\t\t\t\toldfire();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\thooks.unqueued++;\n\n\t\tanim.always( function() {\n\n\t\t\t// Ensure the complete handler is called before this completes\n\t\t\tanim.always( function() {\n\t\t\t\thooks.unqueued--;\n\t\t\t\tif ( !jQuery.queue( elem, \"fx\" ).length ) {\n\t\t\t\t\thooks.empty.fire();\n\t\t\t\t}\n\t\t\t} );\n\t\t} );\n\t}\n\n\t// Detect show/hide animations\n\tfor ( prop in props ) {\n\t\tvalue = props[ prop ];\n\t\tif ( rfxtypes.test( value ) ) {\n\t\t\tdelete props[ prop ];\n\t\t\ttoggle = toggle || value === \"toggle\";\n\t\t\tif ( value === ( hidden ? \"hide\" : \"show\" ) ) {\n\n\t\t\t\t// Pretend to be hidden if this is a \"show\" and\n\t\t\t\t// there is still data from a stopped show/hide\n\t\t\t\tif ( value === \"show\" && dataShow && dataShow[ prop ] !== undefined ) {\n\t\t\t\t\thidden = true;\n\n\t\t\t\t// Ignore all other no-op show/hide data\n\t\t\t\t} else {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\torig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );\n\t\t}\n\t}\n\n\t// Bail out if this is a no-op like .hide().hide()\n\tpropTween = !jQuery.isEmptyObject( props );\n\tif ( !propTween && jQuery.isEmptyObject( orig ) ) {\n\t\treturn;\n\t}\n\n\t// Restrict \"overflow\" and \"display\" styles during box animations\n\tif ( isBox && elem.nodeType === 1 ) {\n\n\t\t// Support: IE <=9 - 11, Edge 12 - 15\n\t\t// Record all 3 overflow attributes because IE does not infer the shorthand\n\t\t// from identically-valued overflowX and overflowY and Edge just mirrors\n\t\t// the overflowX value there.\n\t\topts.overflow = [ style.overflow, style.overflowX, style.overflowY ];\n\n\t\t// Identify a display type, preferring old show/hide data over the CSS cascade\n\t\trestoreDisplay = dataShow && dataShow.display;\n\t\tif ( restoreDisplay == null ) {\n\t\t\trestoreDisplay = dataPriv.get( elem, \"display\" );\n\t\t}\n\t\tdisplay = jQuery.css( elem, \"display\" );\n\t\tif ( display === \"none\" ) {\n\t\t\tif ( restoreDisplay ) {\n\t\t\t\tdisplay = restoreDisplay;\n\t\t\t} else {\n\n\t\t\t\t// Get nonempty value(s) by temporarily forcing visibility\n\t\t\t\tshowHide( [ elem ], true );\n\t\t\t\trestoreDisplay = elem.style.display || restoreDisplay;\n\t\t\t\tdisplay = jQuery.css( elem, \"display\" );\n\t\t\t\tshowHide( [ elem ] );\n\t\t\t}\n\t\t}\n\n\t\t// Animate inline elements as inline-block\n\t\tif ( display === \"inline\" || display === \"inline-block\" && restoreDisplay != null ) {\n\t\t\tif ( jQuery.css( elem, \"float\" ) === \"none\" ) {\n\n\t\t\t\t// Restore the original display value at the end of pure show/hide animations\n\t\t\t\tif ( !propTween ) {\n\t\t\t\t\tanim.done( function() {\n\t\t\t\t\t\tstyle.display = restoreDisplay;\n\t\t\t\t\t} );\n\t\t\t\t\tif ( restoreDisplay == null ) {\n\t\t\t\t\t\tdisplay = style.display;\n\t\t\t\t\t\trestoreDisplay = display === \"none\" ? \"\" : display;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstyle.display = \"inline-block\";\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( opts.overflow ) {\n\t\tstyle.overflow = \"hidden\";\n\t\tanim.always( function() {\n\t\t\tstyle.overflow = opts.overflow[ 0 ];\n\t\t\tstyle.overflowX = opts.overflow[ 1 ];\n\t\t\tstyle.overflowY = opts.overflow[ 2 ];\n\t\t} );\n\t}\n\n\t// Implement show/hide animations\n\tpropTween = false;\n\tfor ( prop in orig ) {\n\n\t\t// General show/hide setup for this element animation\n\t\tif ( !propTween ) {\n\t\t\tif ( dataShow ) {\n\t\t\t\tif ( \"hidden\" in dataShow ) {\n\t\t\t\t\thidden = dataShow.hidden;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdataShow = dataPriv.access( elem, \"fxshow\", { display: restoreDisplay } );\n\t\t\t}\n\n\t\t\t// Store hidden/visible for toggle so `.stop().toggle()` \"reverses\"\n\t\t\tif ( toggle ) {\n\t\t\t\tdataShow.hidden = !hidden;\n\t\t\t}\n\n\t\t\t// Show elements before animating them\n\t\t\tif ( hidden ) {\n\t\t\t\tshowHide( [ elem ], true );\n\t\t\t}\n\n\t\t\t/* eslint-disable no-loop-func */\n\n\t\t\tanim.done( function() {\n\n\t\t\t\t/* eslint-enable no-loop-func */\n\n\t\t\t\t// The final step of a \"hide\" animation is actually hiding the element\n\t\t\t\tif ( !hidden ) {\n\t\t\t\t\tshowHide( [ elem ] );\n\t\t\t\t}\n\t\t\t\tdataPriv.remove( elem, \"fxshow\" );\n\t\t\t\tfor ( prop in orig ) {\n\t\t\t\t\tjQuery.style( elem, prop, orig[ prop ] );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t// Per-property setup\n\t\tpropTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );\n\t\tif ( !( prop in dataShow ) ) {\n\t\t\tdataShow[ prop ] = propTween.start;\n\t\t\tif ( hidden ) {\n\t\t\t\tpropTween.end = propTween.start;\n\t\t\t\tpropTween.start = 0;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction propFilter( props, specialEasing ) {\n\tvar index, name, easing, value, hooks;\n\n\t// camelCase, specialEasing and expand cssHook pass\n\tfor ( index in props ) {\n\t\tname = camelCase( index );\n\t\teasing = specialEasing[ name ];\n\t\tvalue = props[ index ];\n\t\tif ( Array.isArray( value ) ) {\n\t\t\teasing = value[ 1 ];\n\t\t\tvalue = props[ index ] = value[ 0 ];\n\t\t}\n\n\t\tif ( index !== name ) {\n\t\t\tprops[ name ] = value;\n\t\t\tdelete props[ index ];\n\t\t}\n\n\t\thooks = jQuery.cssHooks[ name ];\n\t\tif ( hooks && \"expand\" in hooks ) {\n\t\t\tvalue = hooks.expand( value );\n\t\t\tdelete props[ name ];\n\n\t\t\t// Not quite $.extend, this won't overwrite existing keys.\n\t\t\t// Reusing 'index' because we have the correct \"name\"\n\t\t\tfor ( index in value ) {\n\t\t\t\tif ( !( index in props ) ) {\n\t\t\t\t\tprops[ index ] = value[ index ];\n\t\t\t\t\tspecialEasing[ index ] = easing;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tspecialEasing[ name ] = easing;\n\t\t}\n\t}\n}\n\nfunction Animation( elem, properties, options ) {\n\tvar result,\n\t\tstopped,\n\t\tindex = 0,\n\t\tlength = Animation.prefilters.length,\n\t\tdeferred = jQuery.Deferred().always( function() {\n\n\t\t\t// Don't match elem in the :animated selector\n\t\t\tdelete tick.elem;\n\t\t} ),\n\t\ttick = function() {\n\t\t\tif ( stopped ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar currentTime = fxNow || createFxNow(),\n\t\t\t\tremaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),\n\n\t\t\t\t// Support: Android 2.3 only\n\t\t\t\t// Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (trac-12497)\n\t\t\t\ttemp = remaining / animation.duration || 0,\n\t\t\t\tpercent = 1 - temp,\n\t\t\t\tindex = 0,\n\t\t\t\tlength = animation.tweens.length;\n\n\t\t\tfor ( ; index < length; index++ ) {\n\t\t\t\tanimation.tweens[ index ].run( percent );\n\t\t\t}\n\n\t\t\tdeferred.notifyWith( elem, [ animation, percent, remaining ] );\n\n\t\t\t// If there's more to do, yield\n\t\t\tif ( percent < 1 && length ) {\n\t\t\t\treturn remaining;\n\t\t\t}\n\n\t\t\t// If this was an empty animation, synthesize a final progress notification\n\t\t\tif ( !length ) {\n\t\t\t\tdeferred.notifyWith( elem, [ animation, 1, 0 ] );\n\t\t\t}\n\n\t\t\t// Resolve the animation and report its conclusion\n\t\t\tdeferred.resolveWith( elem, [ animation ] );\n\t\t\treturn false;\n\t\t},\n\t\tanimation = deferred.promise( {\n\t\t\telem: elem,\n\t\t\tprops: jQuery.extend( {}, properties ),\n\t\t\topts: jQuery.extend( true, {\n\t\t\t\tspecialEasing: {},\n\t\t\t\teasing: jQuery.easing._default\n\t\t\t}, options ),\n\t\t\toriginalProperties: properties,\n\t\t\toriginalOptions: options,\n\t\t\tstartTime: fxNow || createFxNow(),\n\t\t\tduration: options.duration,\n\t\t\ttweens: [],\n\t\t\tcreateTween: function( prop, end ) {\n\t\t\t\tvar tween = jQuery.Tween( elem, animation.opts, prop, end,\n\t\t\t\t\tanimation.opts.specialEasing[ prop ] || animation.opts.easing );\n\t\t\t\tanimation.tweens.push( tween );\n\t\t\t\treturn tween;\n\t\t\t},\n\t\t\tstop: function( gotoEnd ) {\n\t\t\t\tvar index = 0,\n\n\t\t\t\t\t// If we are going to the end, we want to run all the tweens\n\t\t\t\t\t// otherwise we skip this part\n\t\t\t\t\tlength = gotoEnd ? animation.tweens.length : 0;\n\t\t\t\tif ( stopped ) {\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t\tstopped = true;\n\t\t\t\tfor ( ; index < length; index++ ) {\n\t\t\t\t\tanimation.tweens[ index ].run( 1 );\n\t\t\t\t}\n\n\t\t\t\t// Resolve when we played the last frame; otherwise, reject\n\t\t\t\tif ( gotoEnd ) {\n\t\t\t\t\tdeferred.notifyWith( elem, [ animation, 1, 0 ] );\n\t\t\t\t\tdeferred.resolveWith( elem, [ animation, gotoEnd ] );\n\t\t\t\t} else {\n\t\t\t\t\tdeferred.rejectWith( elem, [ animation, gotoEnd ] );\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t}\n\t\t} ),\n\t\tprops = animation.props;\n\n\tpropFilter( props, animation.opts.specialEasing );\n\n\tfor ( ; index < length; index++ ) {\n\t\tresult = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );\n\t\tif ( result ) {\n\t\t\tif ( isFunction( result.stop ) ) {\n\t\t\t\tjQuery._queueHooks( animation.elem, animation.opts.queue ).stop =\n\t\t\t\t\tresult.stop.bind( result );\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}\n\n\tjQuery.map( props, createTween, animation );\n\n\tif ( isFunction( animation.opts.start ) ) {\n\t\tanimation.opts.start.call( elem, animation );\n\t}\n\n\t// Attach callbacks from options\n\tanimation\n\t\t.progress( animation.opts.progress )\n\t\t.done( animation.opts.done, animation.opts.complete )\n\t\t.fail( animation.opts.fail )\n\t\t.always( animation.opts.always );\n\n\tjQuery.fx.timer(\n\t\tjQuery.extend( tick, {\n\t\t\telem: elem,\n\t\t\tanim: animation,\n\t\t\tqueue: animation.opts.queue\n\t\t} )\n\t);\n\n\treturn animation;\n}\n\njQuery.Animation = jQuery.extend( Animation, {\n\n\ttweeners: {\n\t\t\"*\": [ function( prop, value ) {\n\t\t\tvar tween = this.createTween( prop, value );\n\t\t\tadjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );\n\t\t\treturn tween;\n\t\t} ]\n\t},\n\n\ttweener: function( props, callback ) {\n\t\tif ( isFunction( props ) ) {\n\t\t\tcallback = props;\n\t\t\tprops = [ \"*\" ];\n\t\t} else {\n\t\t\tprops = props.match( rnothtmlwhite );\n\t\t}\n\n\t\tvar prop,\n\t\t\tindex = 0,\n\t\t\tlength = props.length;\n\n\t\tfor ( ; index < length; index++ ) {\n\t\t\tprop = props[ index ];\n\t\t\tAnimation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];\n\t\t\tAnimation.tweeners[ prop ].unshift( callback );\n\t\t}\n\t},\n\n\tprefilters: [ defaultPrefilter ],\n\n\tprefilter: function( callback, prepend ) {\n\t\tif ( prepend ) {\n\t\t\tAnimation.prefilters.unshift( callback );\n\t\t} else {\n\t\t\tAnimation.prefilters.push( callback );\n\t\t}\n\t}\n} );\n\njQuery.speed = function( speed, easing, fn ) {\n\tvar opt = speed && typeof speed === \"object\" ? jQuery.extend( {}, speed ) : {\n\t\tcomplete: fn || !fn && easing ||\n\t\t\tisFunction( speed ) && speed,\n\t\tduration: speed,\n\t\teasing: fn && easing || easing && !isFunction( easing ) && easing\n\t};\n\n\t// Go to the end state if fx are off\n\tif ( jQuery.fx.off ) {\n\t\topt.duration = 0;\n\n\t} else {\n\t\tif ( typeof opt.duration !== \"number\" ) {\n\t\t\tif ( opt.duration in jQuery.fx.speeds ) {\n\t\t\t\topt.duration = jQuery.fx.speeds[ opt.duration ];\n\n\t\t\t} else {\n\t\t\t\topt.duration = jQuery.fx.speeds._default;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Normalize opt.queue - true/undefined/null -> \"fx\"\n\tif ( opt.queue == null || opt.queue === true ) {\n\t\topt.queue = \"fx\";\n\t}\n\n\t// Queueing\n\topt.old = opt.complete;\n\n\topt.complete = function() {\n\t\tif ( isFunction( opt.old ) ) {\n\t\t\topt.old.call( this );\n\t\t}\n\n\t\tif ( opt.queue ) {\n\t\t\tjQuery.dequeue( this, opt.queue );\n\t\t}\n\t};\n\n\treturn opt;\n};\n\njQuery.fn.extend( {\n\tfadeTo: function( speed, to, easing, callback ) {\n\n\t\t// Show any hidden elements after setting opacity to 0\n\t\treturn this.filter( isHiddenWithinTree ).css( \"opacity\", 0 ).show()\n\n\t\t\t// Animate to the value specified\n\t\t\t.end().animate( { opacity: to }, speed, easing, callback );\n\t},\n\tanimate: function( prop, speed, easing, callback ) {\n\t\tvar empty = jQuery.isEmptyObject( prop ),\n\t\t\toptall = jQuery.speed( speed, easing, callback ),\n\t\t\tdoAnimation = function() {\n\n\t\t\t\t// Operate on a copy of prop so per-property easing won't be lost\n\t\t\t\tvar anim = Animation( this, jQuery.extend( {}, prop ), optall );\n\n\t\t\t\t// Empty animations, or finishing resolves immediately\n\t\t\t\tif ( empty || dataPriv.get( this, \"finish\" ) ) {\n\t\t\t\t\tanim.stop( true );\n\t\t\t\t}\n\t\t\t};\n\n\t\tdoAnimation.finish = doAnimation;\n\n\t\treturn empty || optall.queue === false ?\n\t\t\tthis.each( doAnimation ) :\n\t\t\tthis.queue( optall.queue, doAnimation );\n\t},\n\tstop: function( type, clearQueue, gotoEnd ) {\n\t\tvar stopQueue = function( hooks ) {\n\t\t\tvar stop = hooks.stop;\n\t\t\tdelete hooks.stop;\n\t\t\tstop( gotoEnd );\n\t\t};\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tgotoEnd = clearQueue;\n\t\t\tclearQueue = type;\n\t\t\ttype = undefined;\n\t\t}\n\t\tif ( clearQueue ) {\n\t\t\tthis.queue( type || \"fx\", [] );\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tvar dequeue = true,\n\t\t\t\tindex = type != null && type + \"queueHooks\",\n\t\t\t\ttimers = jQuery.timers,\n\t\t\t\tdata = dataPriv.get( this );\n\n\t\t\tif ( index ) {\n\t\t\t\tif ( data[ index ] && data[ index ].stop ) {\n\t\t\t\t\tstopQueue( data[ index ] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor ( index in data ) {\n\t\t\t\t\tif ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {\n\t\t\t\t\t\tstopQueue( data[ index ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor ( index = timers.length; index--; ) {\n\t\t\t\tif ( timers[ index ].elem === this &&\n\t\t\t\t\t( type == null || timers[ index ].queue === type ) ) {\n\n\t\t\t\t\ttimers[ index ].anim.stop( gotoEnd );\n\t\t\t\t\tdequeue = false;\n\t\t\t\t\ttimers.splice( index, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Start the next in the queue if the last step wasn't forced.\n\t\t\t// Timers currently will call their complete callbacks, which\n\t\t\t// will dequeue but only if they were gotoEnd.\n\t\t\tif ( dequeue || !gotoEnd ) {\n\t\t\t\tjQuery.dequeue( this, type );\n\t\t\t}\n\t\t} );\n\t},\n\tfinish: function( type ) {\n\t\tif ( type !== false ) {\n\t\t\ttype = type || \"fx\";\n\t\t}\n\t\treturn this.each( function() {\n\t\t\tvar index,\n\t\t\t\tdata = dataPriv.get( this ),\n\t\t\t\tqueue = data[ type + \"queue\" ],\n\t\t\t\thooks = data[ type + \"queueHooks\" ],\n\t\t\t\ttimers = jQuery.timers,\n\t\t\t\tlength = queue ? queue.length : 0;\n\n\t\t\t// Enable finishing flag on private data\n\t\t\tdata.finish = true;\n\n\t\t\t// Empty the queue first\n\t\t\tjQuery.queue( this, type, [] );\n\n\t\t\tif ( hooks && hooks.stop ) {\n\t\t\t\thooks.stop.call( this, true );\n\t\t\t}\n\n\t\t\t// Look for any active animations, and finish them\n\t\t\tfor ( index = timers.length; index--; ) {\n\t\t\t\tif ( timers[ index ].elem === this && timers[ index ].queue === type ) {\n\t\t\t\t\ttimers[ index ].anim.stop( true );\n\t\t\t\t\ttimers.splice( index, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Look for any animations in the old queue and finish them\n\t\t\tfor ( index = 0; index < length; index++ ) {\n\t\t\t\tif ( queue[ index ] && queue[ index ].finish ) {\n\t\t\t\t\tqueue[ index ].finish.call( this );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Turn off finishing flag\n\t\t\tdelete data.finish;\n\t\t} );\n\t}\n} );\n\njQuery.each( [ \"toggle\", \"show\", \"hide\" ], function( _i, name ) {\n\tvar cssFn = jQuery.fn[ name ];\n\tjQuery.fn[ name ] = function( speed, easing, callback ) {\n\t\treturn speed == null || typeof speed === \"boolean\" ?\n\t\t\tcssFn.apply( this, arguments ) :\n\t\t\tthis.animate( genFx( name, true ), speed, easing, callback );\n\t};\n} );\n\n// Generate shortcuts for custom animations\njQuery.each( {\n\tslideDown: genFx( \"show\" ),\n\tslideUp: genFx( \"hide\" ),\n\tslideToggle: genFx( \"toggle\" ),\n\tfadeIn: { opacity: \"show\" },\n\tfadeOut: { opacity: \"hide\" },\n\tfadeToggle: { opacity: \"toggle\" }\n}, function( name, props ) {\n\tjQuery.fn[ name ] = function( speed, easing, callback ) {\n\t\treturn this.animate( props, speed, easing, callback );\n\t};\n} );\n\njQuery.timers = [];\njQuery.fx.tick = function() {\n\tvar timer,\n\t\ti = 0,\n\t\ttimers = jQuery.timers;\n\n\tfxNow = Date.now();\n\n\tfor ( ; i < timers.length; i++ ) {\n\t\ttimer = timers[ i ];\n\n\t\t// Run the timer and safely remove it when done (allowing for external removal)\n\t\tif ( !timer() && timers[ i ] === timer ) {\n\t\t\ttimers.splice( i--, 1 );\n\t\t}\n\t}\n\n\tif ( !timers.length ) {\n\t\tjQuery.fx.stop();\n\t}\n\tfxNow = undefined;\n};\n\njQuery.fx.timer = function( timer ) {\n\tjQuery.timers.push( timer );\n\tjQuery.fx.start();\n};\n\njQuery.fx.interval = 13;\njQuery.fx.start = function() {\n\tif ( inProgress ) {\n\t\treturn;\n\t}\n\n\tinProgress = true;\n\tschedule();\n};\n\njQuery.fx.stop = function() {\n\tinProgress = null;\n};\n\njQuery.fx.speeds = {\n\tslow: 600,\n\tfast: 200,\n\n\t// Default speed\n\t_default: 400\n};\n\n\n// Based off of the plugin by Clint Helfers, with permission.\njQuery.fn.delay = function( time, type ) {\n\ttime = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;\n\ttype = type || \"fx\";\n\n\treturn this.queue( type, function( next, hooks ) {\n\t\tvar timeout = window.setTimeout( next, time );\n\t\thooks.stop = function() {\n\t\t\twindow.clearTimeout( timeout );\n\t\t};\n\t} );\n};\n\n\n( function() {\n\tvar input = document.createElement( \"input\" ),\n\t\tselect = document.createElement( \"select\" ),\n\t\topt = select.appendChild( document.createElement( \"option\" ) );\n\n\tinput.type = \"checkbox\";\n\n\t// Support: Android <=4.3 only\n\t// Default value for a checkbox should be \"on\"\n\tsupport.checkOn = input.value !== \"\";\n\n\t// Support: IE <=11 only\n\t// Must access selectedIndex to make default options select\n\tsupport.optSelected = opt.selected;\n\n\t// Support: IE <=11 only\n\t// An input loses its value after becoming a radio\n\tinput = document.createElement( \"input\" );\n\tinput.value = \"t\";\n\tinput.type = \"radio\";\n\tsupport.radioValue = input.value === \"t\";\n} )();\n\n\nvar boolHook,\n\tattrHandle = jQuery.expr.attrHandle;\n\njQuery.fn.extend( {\n\tattr: function( name, value ) {\n\t\treturn access( this, jQuery.attr, name, value, arguments.length > 1 );\n\t},\n\n\tremoveAttr: function( name ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.removeAttr( this, name );\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tattr: function( elem, name, value ) {\n\t\tvar ret, hooks,\n\t\t\tnType = elem.nodeType;\n\n\t\t// Don't get/set attributes on text, comment and attribute nodes\n\t\tif ( nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Fallback to prop when attributes are not supported\n\t\tif ( typeof elem.getAttribute === \"undefined\" ) {\n\t\t\treturn jQuery.prop( elem, name, value );\n\t\t}\n\n\t\t// Attribute hooks are determined by the lowercase version\n\t\t// Grab necessary hook if one is defined\n\t\tif ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\n\t\t\thooks = jQuery.attrHooks[ name.toLowerCase() ] ||\n\t\t\t\t( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\t\t\tif ( value === null ) {\n\t\t\t\tjQuery.removeAttr( elem, name );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( hooks && \"set\" in hooks &&\n\t\t\t\t( ret = hooks.set( elem, value, name ) ) !== undefined ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\telem.setAttribute( name, value + \"\" );\n\t\t\treturn value;\n\t\t}\n\n\t\tif ( hooks && \"get\" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {\n\t\t\treturn ret;\n\t\t}\n\n\t\tret = jQuery.find.attr( elem, name );\n\n\t\t// Non-existent attributes return null, we normalize to undefined\n\t\treturn ret == null ? undefined : ret;\n\t},\n\n\tattrHooks: {\n\t\ttype: {\n\t\t\tset: function( elem, value ) {\n\t\t\t\tif ( !support.radioValue && value === \"radio\" &&\n\t\t\t\t\tnodeName( elem, \"input\" ) ) {\n\t\t\t\t\tvar val = elem.value;\n\t\t\t\t\telem.setAttribute( \"type\", value );\n\t\t\t\t\tif ( val ) {\n\t\t\t\t\t\telem.value = val;\n\t\t\t\t\t}\n\t\t\t\t\treturn value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\tremoveAttr: function( elem, value ) {\n\t\tvar name,\n\t\t\ti = 0,\n\n\t\t\t// Attribute names can contain non-HTML whitespace characters\n\t\t\t// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2\n\t\t\tattrNames = value && value.match( rnothtmlwhite );\n\n\t\tif ( attrNames && elem.nodeType === 1 ) {\n\t\t\twhile ( ( name = attrNames[ i++ ] ) ) {\n\t\t\t\telem.removeAttribute( name );\n\t\t\t}\n\t\t}\n\t}\n} );\n\n// Hooks for boolean attributes\nboolHook = {\n\tset: function( elem, value, name ) {\n\t\tif ( value === false ) {\n\n\t\t\t// Remove boolean attributes when set to false\n\t\t\tjQuery.removeAttr( elem, name );\n\t\t} else {\n\t\t\telem.setAttribute( name, name );\n\t\t}\n\t\treturn name;\n\t}\n};\n\njQuery.each( jQuery.expr.match.bool.source.match( /\\w+/g ), function( _i, name ) {\n\tvar getter = attrHandle[ name ] || jQuery.find.attr;\n\n\tattrHandle[ name ] = function( elem, name, isXML ) {\n\t\tvar ret, handle,\n\t\t\tlowercaseName = name.toLowerCase();\n\n\t\tif ( !isXML ) {\n\n\t\t\t// Avoid an infinite loop by temporarily removing this function from the getter\n\t\t\thandle = attrHandle[ lowercaseName ];\n\t\t\tattrHandle[ lowercaseName ] = ret;\n\t\t\tret = getter( elem, name, isXML ) != null ?\n\t\t\t\tlowercaseName :\n\t\t\t\tnull;\n\t\t\tattrHandle[ lowercaseName ] = handle;\n\t\t}\n\t\treturn ret;\n\t};\n} );\n\n\n\n\nvar rfocusable = /^(?:input|select|textarea|button)$/i,\n\trclickable = /^(?:a|area)$/i;\n\njQuery.fn.extend( {\n\tprop: function( name, value ) {\n\t\treturn access( this, jQuery.prop, name, value, arguments.length > 1 );\n\t},\n\n\tremoveProp: function( name ) {\n\t\treturn this.each( function() {\n\t\t\tdelete this[ jQuery.propFix[ name ] || name ];\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tprop: function( elem, name, value ) {\n\t\tvar ret, hooks,\n\t\t\tnType = elem.nodeType;\n\n\t\t// Don't get/set properties on text, comment and attribute nodes\n\t\tif ( nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\n\n\t\t\t// Fix name and attach hooks\n\t\t\tname = jQuery.propFix[ name ] || name;\n\t\t\thooks = jQuery.propHooks[ name ];\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\t\t\tif ( hooks && \"set\" in hooks &&\n\t\t\t\t( ret = hooks.set( elem, value, name ) ) !== undefined ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\treturn ( elem[ name ] = value );\n\t\t}\n\n\t\tif ( hooks && \"get\" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {\n\t\t\treturn ret;\n\t\t}\n\n\t\treturn elem[ name ];\n\t},\n\n\tpropHooks: {\n\t\ttabIndex: {\n\t\t\tget: function( elem ) {\n\n\t\t\t\t// Support: IE <=9 - 11 only\n\t\t\t\t// elem.tabIndex doesn't always return the\n\t\t\t\t// correct value when it hasn't been explicitly set\n\t\t\t\t// Use proper attribute retrieval (trac-12072)\n\t\t\t\tvar tabindex = jQuery.find.attr( elem, \"tabindex\" );\n\n\t\t\t\tif ( tabindex ) {\n\t\t\t\t\treturn parseInt( tabindex, 10 );\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\trfocusable.test( elem.nodeName ) ||\n\t\t\t\t\trclickable.test( elem.nodeName ) &&\n\t\t\t\t\telem.href\n\t\t\t\t) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t},\n\n\tpropFix: {\n\t\t\"for\": \"htmlFor\",\n\t\t\"class\": \"className\"\n\t}\n} );\n\n// Support: IE <=11 only\n// Accessing the selectedIndex property\n// forces the browser to respect setting selected\n// on the option\n// The getter ensures a default option is selected\n// when in an optgroup\n// eslint rule \"no-unused-expressions\" is disabled for this code\n// since it considers such accessions noop\nif ( !support.optSelected ) {\n\tjQuery.propHooks.selected = {\n\t\tget: function( elem ) {\n\n\t\t\t/* eslint no-unused-expressions: \"off\" */\n\n\t\t\tvar parent = elem.parentNode;\n\t\t\tif ( parent && parent.parentNode ) {\n\t\t\t\tparent.parentNode.selectedIndex;\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t\tset: function( elem ) {\n\n\t\t\t/* eslint no-unused-expressions: \"off\" */\n\n\t\t\tvar parent = elem.parentNode;\n\t\t\tif ( parent ) {\n\t\t\t\tparent.selectedIndex;\n\n\t\t\t\tif ( parent.parentNode ) {\n\t\t\t\t\tparent.parentNode.selectedIndex;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\njQuery.each( [\n\t\"tabIndex\",\n\t\"readOnly\",\n\t\"maxLength\",\n\t\"cellSpacing\",\n\t\"cellPadding\",\n\t\"rowSpan\",\n\t\"colSpan\",\n\t\"useMap\",\n\t\"frameBorder\",\n\t\"contentEditable\"\n], function() {\n\tjQuery.propFix[ this.toLowerCase() ] = this;\n} );\n\n\n\n\n\t// Strip and collapse whitespace according to HTML spec\n\t// https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace\n\tfunction stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}\n\n\nfunction getClass( elem ) {\n\treturn elem.getAttribute && elem.getAttribute( \"class\" ) || \"\";\n}\n\nfunction classesToArray( value ) {\n\tif ( Array.isArray( value ) ) {\n\t\treturn value;\n\t}\n\tif ( typeof value === \"string\" ) {\n\t\treturn value.match( rnothtmlwhite ) || [];\n\t}\n\treturn [];\n}\n\njQuery.fn.extend( {\n\taddClass: function( value ) {\n\t\tvar classNames, cur, curValue, className, i, finalValue;\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( j ) {\n\t\t\t\tjQuery( this ).addClass( value.call( this, j, getClass( this ) ) );\n\t\t\t} );\n\t\t}\n\n\t\tclassNames = classesToArray( value );\n\n\t\tif ( classNames.length ) {\n\t\t\treturn this.each( function() {\n\t\t\t\tcurValue = getClass( this );\n\t\t\t\tcur = this.nodeType === 1 && ( \" \" + stripAndCollapse( curValue ) + \" \" );\n\n\t\t\t\tif ( cur ) {\n\t\t\t\t\tfor ( i = 0; i < classNames.length; i++ ) {\n\t\t\t\t\t\tclassName = classNames[ i ];\n\t\t\t\t\t\tif ( cur.indexOf( \" \" + className + \" \" ) < 0 ) {\n\t\t\t\t\t\t\tcur += className + \" \";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Only assign if different to avoid unneeded rendering.\n\t\t\t\t\tfinalValue = stripAndCollapse( cur );\n\t\t\t\t\tif ( curValue !== finalValue ) {\n\t\t\t\t\t\tthis.setAttribute( \"class\", finalValue );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tremoveClass: function( value ) {\n\t\tvar classNames, cur, curValue, className, i, finalValue;\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( j ) {\n\t\t\t\tjQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );\n\t\t\t} );\n\t\t}\n\n\t\tif ( !arguments.length ) {\n\t\t\treturn this.attr( \"class\", \"\" );\n\t\t}\n\n\t\tclassNames = classesToArray( value );\n\n\t\tif ( classNames.length ) {\n\t\t\treturn this.each( function() {\n\t\t\t\tcurValue = getClass( this );\n\n\t\t\t\t// This expression is here for better compressibility (see addClass)\n\t\t\t\tcur = this.nodeType === 1 && ( \" \" + stripAndCollapse( curValue ) + \" \" );\n\n\t\t\t\tif ( cur ) {\n\t\t\t\t\tfor ( i = 0; i < classNames.length; i++ ) {\n\t\t\t\t\t\tclassName = classNames[ i ];\n\n\t\t\t\t\t\t// Remove *all* instances\n\t\t\t\t\t\twhile ( cur.indexOf( \" \" + className + \" \" ) > -1 ) {\n\t\t\t\t\t\t\tcur = cur.replace( \" \" + className + \" \", \" \" );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Only assign if different to avoid unneeded rendering.\n\t\t\t\t\tfinalValue = stripAndCollapse( cur );\n\t\t\t\t\tif ( curValue !== finalValue ) {\n\t\t\t\t\t\tthis.setAttribute( \"class\", finalValue );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\ttoggleClass: function( value, stateVal ) {\n\t\tvar classNames, className, i, self,\n\t\t\ttype = typeof value,\n\t\t\tisValidValue = type === \"string\" || Array.isArray( value );\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( i ) {\n\t\t\t\tjQuery( this ).toggleClass(\n\t\t\t\t\tvalue.call( this, i, getClass( this ), stateVal ),\n\t\t\t\t\tstateVal\n\t\t\t\t);\n\t\t\t} );\n\t\t}\n\n\t\tif ( typeof stateVal === \"boolean\" && isValidValue ) {\n\t\t\treturn stateVal ? this.addClass( value ) : this.removeClass( value );\n\t\t}\n\n\t\tclassNames = classesToArray( value );\n\n\t\treturn this.each( function() {\n\t\t\tif ( isValidValue ) {\n\n\t\t\t\t// Toggle individual class names\n\t\t\t\tself = jQuery( this );\n\n\t\t\t\tfor ( i = 0; i < classNames.length; i++ ) {\n\t\t\t\t\tclassName = classNames[ i ];\n\n\t\t\t\t\t// Check each className given, space separated list\n\t\t\t\t\tif ( self.hasClass( className ) ) {\n\t\t\t\t\t\tself.removeClass( className );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tself.addClass( className );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// Toggle whole class name\n\t\t\t} else if ( value === undefined || type === \"boolean\" ) {\n\t\t\t\tclassName = getClass( this );\n\t\t\t\tif ( className ) {\n\n\t\t\t\t\t// Store className if set\n\t\t\t\t\tdataPriv.set( this, \"__className__\", className );\n\t\t\t\t}\n\n\t\t\t\t// If the element has a class name or if we're passed `false`,\n\t\t\t\t// then remove the whole classname (if there was one, the above saved it).\n\t\t\t\t// Otherwise bring back whatever was previously saved (if anything),\n\t\t\t\t// falling back to the empty string if nothing was stored.\n\t\t\t\tif ( this.setAttribute ) {\n\t\t\t\t\tthis.setAttribute( \"class\",\n\t\t\t\t\t\tclassName || value === false ?\n\t\t\t\t\t\t\t\"\" :\n\t\t\t\t\t\t\tdataPriv.get( this, \"__className__\" ) || \"\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t},\n\n\thasClass: function( selector ) {\n\t\tvar className, elem,\n\t\t\ti = 0;\n\n\t\tclassName = \" \" + selector + \" \";\n\t\twhile ( ( elem = this[ i++ ] ) ) {\n\t\t\tif ( elem.nodeType === 1 &&\n\t\t\t\t( \" \" + stripAndCollapse( getClass( elem ) ) + \" \" ).indexOf( className ) > -1 ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n} );\n\n\n\n\nvar rreturn = /\\r/g;\n\njQuery.fn.extend( {\n\tval: function( value ) {\n\t\tvar hooks, ret, valueIsFunction,\n\t\t\telem = this[ 0 ];\n\n\t\tif ( !arguments.length ) {\n\t\t\tif ( elem ) {\n\t\t\t\thooks = jQuery.valHooks[ elem.type ] ||\n\t\t\t\t\tjQuery.valHooks[ elem.nodeName.toLowerCase() ];\n\n\t\t\t\tif ( hooks &&\n\t\t\t\t\t\"get\" in hooks &&\n\t\t\t\t\t( ret = hooks.get( elem, \"value\" ) ) !== undefined\n\t\t\t\t) {\n\t\t\t\t\treturn ret;\n\t\t\t\t}\n\n\t\t\t\tret = elem.value;\n\n\t\t\t\t// Handle most common string cases\n\t\t\t\tif ( typeof ret === \"string\" ) {\n\t\t\t\t\treturn ret.replace( rreturn, \"\" );\n\t\t\t\t}\n\n\t\t\t\t// Handle cases where value is null/undef or number\n\t\t\t\treturn ret == null ? \"\" : ret;\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tvalueIsFunction = isFunction( value );\n\n\t\treturn this.each( function( i ) {\n\t\t\tvar val;\n\n\t\t\tif ( this.nodeType !== 1 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( valueIsFunction ) {\n\t\t\t\tval = value.call( this, i, jQuery( this ).val() );\n\t\t\t} else {\n\t\t\t\tval = value;\n\t\t\t}\n\n\t\t\t// Treat null/undefined as \"\"; convert numbers to string\n\t\t\tif ( val == null ) {\n\t\t\t\tval = \"\";\n\n\t\t\t} else if ( typeof val === \"number\" ) {\n\t\t\t\tval += \"\";\n\n\t\t\t} else if ( Array.isArray( val ) ) {\n\t\t\t\tval = jQuery.map( val, function( value ) {\n\t\t\t\t\treturn value == null ? \"\" : value + \"\";\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\thooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];\n\n\t\t\t// If set returns undefined, fall back to normal setting\n\t\t\tif ( !hooks || !( \"set\" in hooks ) || hooks.set( this, val, \"value\" ) === undefined ) {\n\t\t\t\tthis.value = val;\n\t\t\t}\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tvalHooks: {\n\t\toption: {\n\t\t\tget: function( elem ) {\n\n\t\t\t\tvar val = jQuery.find.attr( elem, \"value\" );\n\t\t\t\treturn val != null ?\n\t\t\t\t\tval :\n\n\t\t\t\t\t// Support: IE <=10 - 11 only\n\t\t\t\t\t// option.text throws exceptions (trac-14686, trac-14858)\n\t\t\t\t\t// Strip and collapse whitespace\n\t\t\t\t\t// https://html.spec.whatwg.org/#strip-and-collapse-whitespace\n\t\t\t\t\tstripAndCollapse( jQuery.text( elem ) );\n\t\t\t}\n\t\t},\n\t\tselect: {\n\t\t\tget: function( elem ) {\n\t\t\t\tvar value, option, i,\n\t\t\t\t\toptions = elem.options,\n\t\t\t\t\tindex = elem.selectedIndex,\n\t\t\t\t\tone = elem.type === \"select-one\",\n\t\t\t\t\tvalues = one ? null : [],\n\t\t\t\t\tmax = one ? index + 1 : options.length;\n\n\t\t\t\tif ( index < 0 ) {\n\t\t\t\t\ti = max;\n\n\t\t\t\t} else {\n\t\t\t\t\ti = one ? index : 0;\n\t\t\t\t}\n\n\t\t\t\t// Loop through all the selected options\n\t\t\t\tfor ( ; i < max; i++ ) {\n\t\t\t\t\toption = options[ i ];\n\n\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t// IE8-9 doesn't update selected after form reset (trac-2551)\n\t\t\t\t\tif ( ( option.selected || i === index ) &&\n\n\t\t\t\t\t\t\t// Don't return options that are disabled or in a disabled optgroup\n\t\t\t\t\t\t\t!option.disabled &&\n\t\t\t\t\t\t\t( !option.parentNode.disabled ||\n\t\t\t\t\t\t\t\t!nodeName( option.parentNode, \"optgroup\" ) ) ) {\n\n\t\t\t\t\t\t// Get the specific value for the option\n\t\t\t\t\t\tvalue = jQuery( option ).val();\n\n\t\t\t\t\t\t// We don't need an array for one selects\n\t\t\t\t\t\tif ( one ) {\n\t\t\t\t\t\t\treturn value;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Multi-Selects return an array\n\t\t\t\t\t\tvalues.push( value );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn values;\n\t\t\t},\n\n\t\t\tset: function( elem, value ) {\n\t\t\t\tvar optionSet, option,\n\t\t\t\t\toptions = elem.options,\n\t\t\t\t\tvalues = jQuery.makeArray( value ),\n\t\t\t\t\ti = options.length;\n\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\toption = options[ i ];\n\n\t\t\t\t\t/* eslint-disable no-cond-assign */\n\n\t\t\t\t\tif ( option.selected =\n\t\t\t\t\t\tjQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1\n\t\t\t\t\t) {\n\t\t\t\t\t\toptionSet = true;\n\t\t\t\t\t}\n\n\t\t\t\t\t/* eslint-enable no-cond-assign */\n\t\t\t\t}\n\n\t\t\t\t// Force browsers to behave consistently when non-matching value is set\n\t\t\t\tif ( !optionSet ) {\n\t\t\t\t\telem.selectedIndex = -1;\n\t\t\t\t}\n\t\t\t\treturn values;\n\t\t\t}\n\t\t}\n\t}\n} );\n\n// Radios and checkboxes getter/setter\njQuery.each( [ \"radio\", \"checkbox\" ], function() {\n\tjQuery.valHooks[ this ] = {\n\t\tset: function( elem, value ) {\n\t\t\tif ( Array.isArray( value ) ) {\n\t\t\t\treturn ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );\n\t\t\t}\n\t\t}\n\t};\n\tif ( !support.checkOn ) {\n\t\tjQuery.valHooks[ this ].get = function( elem ) {\n\t\t\treturn elem.getAttribute( \"value\" ) === null ? \"on\" : elem.value;\n\t\t};\n\t}\n} );\n\n\n\n\n// Return jQuery for attributes-only inclusion\nvar location = window.location;\n\nvar nonce = { guid: Date.now() };\n\nvar rquery = ( /\\?/ );\n\n\n\n// Cross-browser xml parsing\njQuery.parseXML = function( data ) {\n\tvar xml, parserErrorElem;\n\tif ( !data || typeof data !== \"string\" ) {\n\t\treturn null;\n\t}\n\n\t// Support: IE 9 - 11 only\n\t// IE throws on parseFromString with invalid input.\n\ttry {\n\t\txml = ( new window.DOMParser() ).parseFromString( data, \"text/xml\" );\n\t} catch ( e ) {}\n\n\tparserErrorElem = xml && xml.getElementsByTagName( \"parsererror\" )[ 0 ];\n\tif ( !xml || parserErrorElem ) {\n\t\tjQuery.error( \"Invalid XML: \" + (\n\t\t\tparserErrorElem ?\n\t\t\t\tjQuery.map( parserErrorElem.childNodes, function( el ) {\n\t\t\t\t\treturn el.textContent;\n\t\t\t\t} ).join( \"\\n\" ) :\n\t\t\t\tdata\n\t\t) );\n\t}\n\treturn xml;\n};\n\n\nvar rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,\n\tstopPropagationCallback = function( e ) {\n\t\te.stopPropagation();\n\t};\n\njQuery.extend( jQuery.event, {\n\n\ttrigger: function( event, data, elem, onlyHandlers ) {\n\n\t\tvar i, cur, tmp, bubbleType, ontype, handle, special, lastElement,\n\t\t\teventPath = [ elem || document ],\n\t\t\ttype = hasOwn.call( event, \"type\" ) ? event.type : event,\n\t\t\tnamespaces = hasOwn.call( event, \"namespace\" ) ? event.namespace.split( \".\" ) : [];\n\n\t\tcur = lastElement = tmp = elem = elem || document;\n\n\t\t// Don't do events on text and comment nodes\n\t\tif ( elem.nodeType === 3 || elem.nodeType === 8 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// focus/blur morphs to focusin/out; ensure we're not firing them right now\n\t\tif ( rfocusMorph.test( type + jQuery.event.triggered ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( type.indexOf( \".\" ) > -1 ) {\n\n\t\t\t// Namespaced trigger; create a regexp to match event type in handle()\n\t\t\tnamespaces = type.split( \".\" );\n\t\t\ttype = namespaces.shift();\n\t\t\tnamespaces.sort();\n\t\t}\n\t\tontype = type.indexOf( \":\" ) < 0 && \"on\" + type;\n\n\t\t// Caller can pass in a jQuery.Event object, Object, or just an event type string\n\t\tevent = event[ jQuery.expando ] ?\n\t\t\tevent :\n\t\t\tnew jQuery.Event( type, typeof event === \"object\" && event );\n\n\t\t// Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)\n\t\tevent.isTrigger = onlyHandlers ? 2 : 3;\n\t\tevent.namespace = namespaces.join( \".\" );\n\t\tevent.rnamespace = event.namespace ?\n\t\t\tnew RegExp( \"(^|\\\\.)\" + namespaces.join( \"\\\\.(?:.*\\\\.|)\" ) + \"(\\\\.|$)\" ) :\n\t\t\tnull;\n\n\t\t// Clean up the event in case it is being reused\n\t\tevent.result = undefined;\n\t\tif ( !event.target ) {\n\t\t\tevent.target = elem;\n\t\t}\n\n\t\t// Clone any incoming data and prepend the event, creating the handler arg list\n\t\tdata = data == null ?\n\t\t\t[ event ] :\n\t\t\tjQuery.makeArray( data, [ event ] );\n\n\t\t// Allow special events to draw outside the lines\n\t\tspecial = jQuery.event.special[ type ] || {};\n\t\tif ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine event propagation path in advance, per W3C events spec (trac-9951)\n\t\t// Bubble up to document, then to window; watch for a global ownerDocument var (trac-9724)\n\t\tif ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {\n\n\t\t\tbubbleType = special.delegateType || type;\n\t\t\tif ( !rfocusMorph.test( bubbleType + type ) ) {\n\t\t\t\tcur = cur.parentNode;\n\t\t\t}\n\t\t\tfor ( ; cur; cur = cur.parentNode ) {\n\t\t\t\teventPath.push( cur );\n\t\t\t\ttmp = cur;\n\t\t\t}\n\n\t\t\t// Only add window if we got to document (e.g., not plain obj or detached DOM)\n\t\t\tif ( tmp === ( elem.ownerDocument || document ) ) {\n\t\t\t\teventPath.push( tmp.defaultView || tmp.parentWindow || window );\n\t\t\t}\n\t\t}\n\n\t\t// Fire handlers on the event path\n\t\ti = 0;\n\t\twhile ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {\n\t\t\tlastElement = cur;\n\t\t\tevent.type = i > 1 ?\n\t\t\t\tbubbleType :\n\t\t\t\tspecial.bindType || type;\n\n\t\t\t// jQuery handler\n\t\t\thandle = ( dataPriv.get( cur, \"events\" ) || Object.create( null ) )[ event.type ] &&\n\t\t\t\tdataPriv.get( cur, \"handle\" );\n\t\t\tif ( handle ) {\n\t\t\t\thandle.apply( cur, data );\n\t\t\t}\n\n\t\t\t// Native handler\n\t\t\thandle = ontype && cur[ ontype ];\n\t\t\tif ( handle && handle.apply && acceptData( cur ) ) {\n\t\t\t\tevent.result = handle.apply( cur, data );\n\t\t\t\tif ( event.result === false ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tevent.type = type;\n\n\t\t// If nobody prevented the default action, do it now\n\t\tif ( !onlyHandlers && !event.isDefaultPrevented() ) {\n\n\t\t\tif ( ( !special._default ||\n\t\t\t\tspecial._default.apply( eventPath.pop(), data ) === false ) &&\n\t\t\t\tacceptData( elem ) ) {\n\n\t\t\t\t// Call a native DOM method on the target with the same name as the event.\n\t\t\t\t// Don't do default actions on window, that's where global variables be (trac-6170)\n\t\t\t\tif ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {\n\n\t\t\t\t\t// Don't re-trigger an onFOO event when we call its FOO() method\n\t\t\t\t\ttmp = elem[ ontype ];\n\n\t\t\t\t\tif ( tmp ) {\n\t\t\t\t\t\telem[ ontype ] = null;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prevent re-triggering of the same event, since we already bubbled it above\n\t\t\t\t\tjQuery.event.triggered = type;\n\n\t\t\t\t\tif ( event.isPropagationStopped() ) {\n\t\t\t\t\t\tlastElement.addEventListener( type, stopPropagationCallback );\n\t\t\t\t\t}\n\n\t\t\t\t\telem[ type ]();\n\n\t\t\t\t\tif ( event.isPropagationStopped() ) {\n\t\t\t\t\t\tlastElement.removeEventListener( type, stopPropagationCallback );\n\t\t\t\t\t}\n\n\t\t\t\t\tjQuery.event.triggered = undefined;\n\n\t\t\t\t\tif ( tmp ) {\n\t\t\t\t\t\telem[ ontype ] = tmp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn event.result;\n\t},\n\n\t// Piggyback on a donor event to simulate a different one\n\t// Used only for `focus(in | out)` events\n\tsimulate: function( type, elem, event ) {\n\t\tvar e = jQuery.extend(\n\t\t\tnew jQuery.Event(),\n\t\t\tevent,\n\t\t\t{\n\t\t\t\ttype: type,\n\t\t\t\tisSimulated: true\n\t\t\t}\n\t\t);\n\n\t\tjQuery.event.trigger( e, null, elem );\n\t}\n\n} );\n\njQuery.fn.extend( {\n\n\ttrigger: function( type, data ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.event.trigger( type, data, this );\n\t\t} );\n\t},\n\ttriggerHandler: function( type, data ) {\n\t\tvar elem = this[ 0 ];\n\t\tif ( elem ) {\n\t\t\treturn jQuery.event.trigger( type, data, elem, true );\n\t\t}\n\t}\n} );\n\n\nvar\n\trbracket = /\\[\\]$/,\n\trCRLF = /\\r?\\n/g,\n\trsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,\n\trsubmittable = /^(?:input|select|textarea|keygen)/i;\n\nfunction buildParams( prefix, obj, traditional, add ) {\n\tvar name;\n\n\tif ( Array.isArray( obj ) ) {\n\n\t\t// Serialize array item.\n\t\tjQuery.each( obj, function( i, v ) {\n\t\t\tif ( traditional || rbracket.test( prefix ) ) {\n\n\t\t\t\t// Treat each array item as a scalar.\n\t\t\t\tadd( prefix, v );\n\n\t\t\t} else {\n\n\t\t\t\t// Item is non-scalar (array or object), encode its numeric index.\n\t\t\t\tbuildParams(\n\t\t\t\t\tprefix + \"[\" + ( typeof v === \"object\" && v != null ? i : \"\" ) + \"]\",\n\t\t\t\t\tv,\n\t\t\t\t\ttraditional,\n\t\t\t\t\tadd\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\n\t} else if ( !traditional && toType( obj ) === \"object\" ) {\n\n\t\t// Serialize object item.\n\t\tfor ( name in obj ) {\n\t\t\tbuildParams( prefix + \"[\" + name + \"]\", obj[ name ], traditional, add );\n\t\t}\n\n\t} else {\n\n\t\t// Serialize scalar item.\n\t\tadd( prefix, obj );\n\t}\n}\n\n// Serialize an array of form elements or a set of\n// key/values into a query string\njQuery.param = function( a, traditional ) {\n\tvar prefix,\n\t\ts = [],\n\t\tadd = function( key, valueOrFunction ) {\n\n\t\t\t// If value is a function, invoke it and use its return value\n\t\t\tvar value = isFunction( valueOrFunction ) ?\n\t\t\t\tvalueOrFunction() :\n\t\t\t\tvalueOrFunction;\n\n\t\t\ts[ s.length ] = encodeURIComponent( key ) + \"=\" +\n\t\t\t\tencodeURIComponent( value == null ? \"\" : value );\n\t\t};\n\n\tif ( a == null ) {\n\t\treturn \"\";\n\t}\n\n\t// If an array was passed in, assume that it is an array of form elements.\n\tif ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {\n\n\t\t// Serialize the form elements\n\t\tjQuery.each( a, function() {\n\t\t\tadd( this.name, this.value );\n\t\t} );\n\n\t} else {\n\n\t\t// If traditional, encode the \"old\" way (the way 1.3.2 or older\n\t\t// did it), otherwise encode params recursively.\n\t\tfor ( prefix in a ) {\n\t\t\tbuildParams( prefix, a[ prefix ], traditional, add );\n\t\t}\n\t}\n\n\t// Return the resulting serialization\n\treturn s.join( \"&\" );\n};\n\njQuery.fn.extend( {\n\tserialize: function() {\n\t\treturn jQuery.param( this.serializeArray() );\n\t},\n\tserializeArray: function() {\n\t\treturn this.map( function() {\n\n\t\t\t// Can add propHook for \"elements\" to filter or add form elements\n\t\t\tvar elements = jQuery.prop( this, \"elements\" );\n\t\t\treturn elements ? jQuery.makeArray( elements ) : this;\n\t\t} ).filter( function() {\n\t\t\tvar type = this.type;\n\n\t\t\t// Use .is( \":disabled\" ) so that fieldset[disabled] works\n\t\t\treturn this.name && !jQuery( this ).is( \":disabled\" ) &&\n\t\t\t\trsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&\n\t\t\t\t( this.checked || !rcheckableType.test( type ) );\n\t\t} ).map( function( _i, elem ) {\n\t\t\tvar val = jQuery( this ).val();\n\n\t\t\tif ( val == null ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif ( Array.isArray( val ) ) {\n\t\t\t\treturn jQuery.map( val, function( val ) {\n\t\t\t\t\treturn { name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\treturn { name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n\t\t} ).get();\n\t}\n} );\n\n\nvar\n\tr20 = /%20/g,\n\trhash = /#.*$/,\n\trantiCache = /([?&])_=[^&]*/,\n\trheaders = /^(.*?):[ \\t]*([^\\r\\n]*)$/mg,\n\n\t// trac-7653, trac-8125, trac-8152: local protocol detection\n\trlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,\n\trnoContent = /^(?:GET|HEAD)$/,\n\trprotocol = /^\\/\\//,\n\n\t/* Prefilters\n\t * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)\n\t * 2) These are called:\n\t * - BEFORE asking for a transport\n\t * - AFTER param serialization (s.data is a string if s.processData is true)\n\t * 3) key is the dataType\n\t * 4) the catchall symbol \"*\" can be used\n\t * 5) execution will start with transport dataType and THEN continue down to \"*\" if needed\n\t */\n\tprefilters = {},\n\n\t/* Transports bindings\n\t * 1) key is the dataType\n\t * 2) the catchall symbol \"*\" can be used\n\t * 3) selection will start with transport dataType and THEN go to \"*\" if needed\n\t */\n\ttransports = {},\n\n\t// Avoid comment-prolog char sequence (trac-10098); must appease lint and evade compression\n\tallTypes = \"*/\".concat( \"*\" ),\n\n\t// Anchor tag for parsing the document origin\n\toriginAnchor = document.createElement( \"a\" );\n\noriginAnchor.href = location.href;\n\n// Base \"constructor\" for jQuery.ajaxPrefilter and jQuery.ajaxTransport\nfunction addToPrefiltersOrTransports( structure ) {\n\n\t// dataTypeExpression is optional and defaults to \"*\"\n\treturn function( dataTypeExpression, func ) {\n\n\t\tif ( typeof dataTypeExpression !== \"string\" ) {\n\t\t\tfunc = dataTypeExpression;\n\t\t\tdataTypeExpression = \"*\";\n\t\t}\n\n\t\tvar dataType,\n\t\t\ti = 0,\n\t\t\tdataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];\n\n\t\tif ( isFunction( func ) ) {\n\n\t\t\t// For each dataType in the dataTypeExpression\n\t\t\twhile ( ( dataType = dataTypes[ i++ ] ) ) {\n\n\t\t\t\t// Prepend if requested\n\t\t\t\tif ( dataType[ 0 ] === \"+\" ) {\n\t\t\t\t\tdataType = dataType.slice( 1 ) || \"*\";\n\t\t\t\t\t( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );\n\n\t\t\t\t// Otherwise append\n\t\t\t\t} else {\n\t\t\t\t\t( structure[ dataType ] = structure[ dataType ] || [] ).push( func );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\n// Base inspection function for prefilters and transports\nfunction inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t} );\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}\n\n// A special extend for ajax options\n// that takes \"flat\" options (not to be deep extended)\n// Fixes trac-9887\nfunction ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}\n\n/* Handles responses to an ajax request:\n * - finds the right dataType (mediates between content-type and expected dataType)\n * - returns the corresponding response\n */\nfunction ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}\n\n/* Chain conversions given the request and the original response\n * Also sets the responseXXX fields on the jqXHR instance\n */\nfunction ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s.throws ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}\n\njQuery.extend( {\n\n\t// Counter for holding the number of active queries\n\tactive: 0,\n\n\t// Last-Modified header cache for next request\n\tlastModified: {},\n\tetag: {},\n\n\tajaxSettings: {\n\t\turl: location.href,\n\t\ttype: \"GET\",\n\t\tisLocal: rlocalProtocol.test( location.protocol ),\n\t\tglobal: true,\n\t\tprocessData: true,\n\t\tasync: true,\n\t\tcontentType: \"application/x-www-form-urlencoded; charset=UTF-8\",\n\n\t\t/*\n\t\ttimeout: 0,\n\t\tdata: null,\n\t\tdataType: null,\n\t\tusername: null,\n\t\tpassword: null,\n\t\tcache: null,\n\t\tthrows: false,\n\t\ttraditional: false,\n\t\theaders: {},\n\t\t*/\n\n\t\taccepts: {\n\t\t\t\"*\": allTypes,\n\t\t\ttext: \"text/plain\",\n\t\t\thtml: \"text/html\",\n\t\t\txml: \"application/xml, text/xml\",\n\t\t\tjson: \"application/json, text/javascript\"\n\t\t},\n\n\t\tcontents: {\n\t\t\txml: /\\bxml\\b/,\n\t\t\thtml: /\\bhtml/,\n\t\t\tjson: /\\bjson\\b/\n\t\t},\n\n\t\tresponseFields: {\n\t\t\txml: \"responseXML\",\n\t\t\ttext: \"responseText\",\n\t\t\tjson: \"responseJSON\"\n\t\t},\n\n\t\t// Data converters\n\t\t// Keys separate source (or catchall \"*\") and destination types with a single space\n\t\tconverters: {\n\n\t\t\t// Convert anything to text\n\t\t\t\"* text\": String,\n\n\t\t\t// Text to html (true = no transformation)\n\t\t\t\"text html\": true,\n\n\t\t\t// Evaluate text as a json expression\n\t\t\t\"text json\": JSON.parse,\n\n\t\t\t// Parse text as xml\n\t\t\t\"text xml\": jQuery.parseXML\n\t\t},\n\n\t\t// For options that shouldn't be deep extended:\n\t\t// you can add your own custom options here if\n\t\t// and when you create one that shouldn't be\n\t\t// deep extended (see ajaxExtend)\n\t\tflatOptions: {\n\t\t\turl: true,\n\t\t\tcontext: true\n\t\t}\n\t},\n\n\t// Creates a full fledged settings object into target\n\t// with both ajaxSettings and settings fields.\n\t// If target is omitted, writes into ajaxSettings.\n\tajaxSetup: function( target, settings ) {\n\t\treturn settings ?\n\n\t\t\t// Building a settings object\n\t\t\tajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :\n\n\t\t\t// Extending ajaxSettings\n\t\t\tajaxExtend( jQuery.ajaxSettings, target );\n\t},\n\n\tajaxPrefilter: addToPrefiltersOrTransports( prefilters ),\n\tajaxTransport: addToPrefiltersOrTransports( transports ),\n\n\t// Main method\n\tajax: function( url, options ) {\n\n\t\t// If url is an object, simulate pre-1.5 signature\n\t\tif ( typeof url === \"object\" ) {\n\t\t\toptions = url;\n\t\t\turl = undefined;\n\t\t}\n\n\t\t// Force options to be an object\n\t\toptions = options || {};\n\n\t\tvar transport,\n\n\t\t\t// URL without anti-cache param\n\t\t\tcacheURL,\n\n\t\t\t// Response headers\n\t\t\tresponseHeadersString,\n\t\t\tresponseHeaders,\n\n\t\t\t// timeout handle\n\t\t\ttimeoutTimer,\n\n\t\t\t// Url cleanup var\n\t\t\turlAnchor,\n\n\t\t\t// Request state (becomes false upon send and true upon completion)\n\t\t\tcompleted,\n\n\t\t\t// To know if global events are to be dispatched\n\t\t\tfireGlobals,\n\n\t\t\t// Loop variable\n\t\t\ti,\n\n\t\t\t// uncached part of the url\n\t\t\tuncached,\n\n\t\t\t// Create the final options object\n\t\t\ts = jQuery.ajaxSetup( {}, options ),\n\n\t\t\t// Callbacks context\n\t\t\tcallbackContext = s.context || s,\n\n\t\t\t// Context for global events is callbackContext if it is a DOM node or jQuery collection\n\t\t\tglobalEventContext = s.context &&\n\t\t\t\t( callbackContext.nodeType || callbackContext.jquery ) ?\n\t\t\t\tjQuery( callbackContext ) :\n\t\t\t\tjQuery.event,\n\n\t\t\t// Deferreds\n\t\t\tdeferred = jQuery.Deferred(),\n\t\t\tcompleteDeferred = jQuery.Callbacks( \"once memory\" ),\n\n\t\t\t// Status-dependent callbacks\n\t\t\tstatusCode = s.statusCode || {},\n\n\t\t\t// Headers (they are sent all at once)\n\t\t\trequestHeaders = {},\n\t\t\trequestHeadersNames = {},\n\n\t\t\t// Default abort message\n\t\t\tstrAbort = \"canceled\",\n\n\t\t\t// Fake xhr\n\t\t\tjqXHR = {\n\t\t\t\treadyState: 0,\n\n\t\t\t\t// Builds headers hashtable if needed\n\t\t\t\tgetResponseHeader: function( key ) {\n\t\t\t\t\tvar match;\n\t\t\t\t\tif ( completed ) {\n\t\t\t\t\t\tif ( !responseHeaders ) {\n\t\t\t\t\t\t\tresponseHeaders = {};\n\t\t\t\t\t\t\twhile ( ( match = rheaders.exec( responseHeadersString ) ) ) {\n\t\t\t\t\t\t\t\tresponseHeaders[ match[ 1 ].toLowerCase() + \" \" ] =\n\t\t\t\t\t\t\t\t\t( responseHeaders[ match[ 1 ].toLowerCase() + \" \" ] || [] )\n\t\t\t\t\t\t\t\t\t\t.concat( match[ 2 ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmatch = responseHeaders[ key.toLowerCase() + \" \" ];\n\t\t\t\t\t}\n\t\t\t\t\treturn match == null ? null : match.join( \", \" );\n\t\t\t\t},\n\n\t\t\t\t// Raw string\n\t\t\t\tgetAllResponseHeaders: function() {\n\t\t\t\t\treturn completed ? responseHeadersString : null;\n\t\t\t\t},\n\n\t\t\t\t// Caches the header\n\t\t\t\tsetRequestHeader: function( name, value ) {\n\t\t\t\t\tif ( completed == null ) {\n\t\t\t\t\t\tname = requestHeadersNames[ name.toLowerCase() ] =\n\t\t\t\t\t\t\trequestHeadersNames[ name.toLowerCase() ] || name;\n\t\t\t\t\t\trequestHeaders[ name ] = value;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Overrides response content-type header\n\t\t\t\toverrideMimeType: function( type ) {\n\t\t\t\t\tif ( completed == null ) {\n\t\t\t\t\t\ts.mimeType = type;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Status-dependent callbacks\n\t\t\t\tstatusCode: function( map ) {\n\t\t\t\t\tvar code;\n\t\t\t\t\tif ( map ) {\n\t\t\t\t\t\tif ( completed ) {\n\n\t\t\t\t\t\t\t// Execute the appropriate callbacks\n\t\t\t\t\t\t\tjqXHR.always( map[ jqXHR.status ] );\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Lazy-add the new callbacks in a way that preserves old ones\n\t\t\t\t\t\t\tfor ( code in map ) {\n\t\t\t\t\t\t\t\tstatusCode[ code ] = [ statusCode[ code ], map[ code ] ];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Cancel the request\n\t\t\t\tabort: function( statusText ) {\n\t\t\t\t\tvar finalText = statusText || strAbort;\n\t\t\t\t\tif ( transport ) {\n\t\t\t\t\t\ttransport.abort( finalText );\n\t\t\t\t\t}\n\t\t\t\t\tdone( 0, finalText );\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t};\n\n\t\t// Attach deferreds\n\t\tdeferred.promise( jqXHR );\n\n\t\t// Add protocol if not provided (prefilters might expect it)\n\t\t// Handle falsy url in the settings object (trac-10093: consistency with old signature)\n\t\t// We also use the url parameter if available\n\t\ts.url = ( ( url || s.url || location.href ) + \"\" )\n\t\t\t.replace( rprotocol, location.protocol + \"//\" );\n\n\t\t// Alias method option to type as per ticket trac-12004\n\t\ts.type = options.method || options.type || s.method || s.type;\n\n\t\t// Extract dataTypes list\n\t\ts.dataTypes = ( s.dataType || \"*\" ).toLowerCase().match( rnothtmlwhite ) || [ \"\" ];\n\n\t\t// A cross-domain request is in order when the origin doesn't match the current origin.\n\t\tif ( s.crossDomain == null ) {\n\t\t\turlAnchor = document.createElement( \"a\" );\n\n\t\t\t// Support: IE <=8 - 11, Edge 12 - 15\n\t\t\t// IE throws exception on accessing the href property if url is malformed,\n\t\t\t// e.g. http://example.com:80x/\n\t\t\ttry {\n\t\t\t\turlAnchor.href = s.url;\n\n\t\t\t\t// Support: IE <=8 - 11 only\n\t\t\t\t// Anchor's host property isn't correctly set when s.url is relative\n\t\t\t\turlAnchor.href = urlAnchor.href;\n\t\t\t\ts.crossDomain = originAnchor.protocol + \"//\" + originAnchor.host !==\n\t\t\t\t\turlAnchor.protocol + \"//\" + urlAnchor.host;\n\t\t\t} catch ( e ) {\n\n\t\t\t\t// If there is an error parsing the URL, assume it is crossDomain,\n\t\t\t\t// it can be rejected by the transport if it is invalid\n\t\t\t\ts.crossDomain = true;\n\t\t\t}\n\t\t}\n\n\t\t// Convert data if not already a string\n\t\tif ( s.data && s.processData && typeof s.data !== \"string\" ) {\n\t\t\ts.data = jQuery.param( s.data, s.traditional );\n\t\t}\n\n\t\t// Apply prefilters\n\t\tinspectPrefiltersOrTransports( prefilters, s, options, jqXHR );\n\n\t\t// If request was aborted inside a prefilter, stop there\n\t\tif ( completed ) {\n\t\t\treturn jqXHR;\n\t\t}\n\n\t\t// We can fire global events as of now if asked to\n\t\t// Don't fire events if jQuery.event is undefined in an AMD-usage scenario (trac-15118)\n\t\tfireGlobals = jQuery.event && s.global;\n\n\t\t// Watch for a new set of requests\n\t\tif ( fireGlobals && jQuery.active++ === 0 ) {\n\t\t\tjQuery.event.trigger( \"ajaxStart\" );\n\t\t}\n\n\t\t// Uppercase the type\n\t\ts.type = s.type.toUpperCase();\n\n\t\t// Determine if request has content\n\t\ts.hasContent = !rnoContent.test( s.type );\n\n\t\t// Save the URL in case we're toying with the If-Modified-Since\n\t\t// and/or If-None-Match header later on\n\t\t// Remove hash to simplify url manipulation\n\t\tcacheURL = s.url.replace( rhash, \"\" );\n\n\t\t// More options handling for requests with no content\n\t\tif ( !s.hasContent ) {\n\n\t\t\t// Remember the hash so we can put it back\n\t\t\tuncached = s.url.slice( cacheURL.length );\n\n\t\t\t// If data is available and should be processed, append data to url\n\t\t\tif ( s.data && ( s.processData || typeof s.data === \"string\" ) ) {\n\t\t\t\tcacheURL += ( rquery.test( cacheURL ) ? \"&\" : \"?\" ) + s.data;\n\n\t\t\t\t// trac-9682: remove data so that it's not used in an eventual retry\n\t\t\t\tdelete s.data;\n\t\t\t}\n\n\t\t\t// Add or update anti-cache param if needed\n\t\t\tif ( s.cache === false ) {\n\t\t\t\tcacheURL = cacheURL.replace( rantiCache, \"$1\" );\n\t\t\t\tuncached = ( rquery.test( cacheURL ) ? \"&\" : \"?\" ) + \"_=\" + ( nonce.guid++ ) +\n\t\t\t\t\tuncached;\n\t\t\t}\n\n\t\t\t// Put hash and anti-cache on the URL that will be requested (gh-1732)\n\t\t\ts.url = cacheURL + uncached;\n\n\t\t// Change '%20' to '+' if this is encoded form body content (gh-2658)\n\t\t} else if ( s.data && s.processData &&\n\t\t\t( s.contentType || \"\" ).indexOf( \"application/x-www-form-urlencoded\" ) === 0 ) {\n\t\t\ts.data = s.data.replace( r20, \"+\" );\n\t\t}\n\n\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\tif ( s.ifModified ) {\n\t\t\tif ( jQuery.lastModified[ cacheURL ] ) {\n\t\t\t\tjqXHR.setRequestHeader( \"If-Modified-Since\", jQuery.lastModified[ cacheURL ] );\n\t\t\t}\n\t\t\tif ( jQuery.etag[ cacheURL ] ) {\n\t\t\t\tjqXHR.setRequestHeader( \"If-None-Match\", jQuery.etag[ cacheURL ] );\n\t\t\t}\n\t\t}\n\n\t\t// Set the correct header, if data is being sent\n\t\tif ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {\n\t\t\tjqXHR.setRequestHeader( \"Content-Type\", s.contentType );\n\t\t}\n\n\t\t// Set the Accepts header for the server, depending on the dataType\n\t\tjqXHR.setRequestHeader(\n\t\t\t\"Accept\",\n\t\t\ts.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?\n\t\t\t\ts.accepts[ s.dataTypes[ 0 ] ] +\n\t\t\t\t\t( s.dataTypes[ 0 ] !== \"*\" ? \", \" + allTypes + \"; q=0.01\" : \"\" ) :\n\t\t\t\ts.accepts[ \"*\" ]\n\t\t);\n\n\t\t// Check for headers option\n\t\tfor ( i in s.headers ) {\n\t\t\tjqXHR.setRequestHeader( i, s.headers[ i ] );\n\t\t}\n\n\t\t// Allow custom headers/mimetypes and early abort\n\t\tif ( s.beforeSend &&\n\t\t\t( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {\n\n\t\t\t// Abort if not done already and return\n\t\t\treturn jqXHR.abort();\n\t\t}\n\n\t\t// Aborting is no longer a cancellation\n\t\tstrAbort = \"abort\";\n\n\t\t// Install callbacks on deferreds\n\t\tcompleteDeferred.add( s.complete );\n\t\tjqXHR.done( s.success );\n\t\tjqXHR.fail( s.error );\n\n\t\t// Get transport\n\t\ttransport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );\n\n\t\t// If no transport, we auto-abort\n\t\tif ( !transport ) {\n\t\t\tdone( -1, \"No Transport\" );\n\t\t} else {\n\t\t\tjqXHR.readyState = 1;\n\n\t\t\t// Send global event\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxSend\", [ jqXHR, s ] );\n\t\t\t}\n\n\t\t\t// If request was aborted inside ajaxSend, stop there\n\t\t\tif ( completed ) {\n\t\t\t\treturn jqXHR;\n\t\t\t}\n\n\t\t\t// Timeout\n\t\t\tif ( s.async && s.timeout > 0 ) {\n\t\t\t\ttimeoutTimer = window.setTimeout( function() {\n\t\t\t\t\tjqXHR.abort( \"timeout\" );\n\t\t\t\t}, s.timeout );\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tcompleted = false;\n\t\t\t\ttransport.send( requestHeaders, done );\n\t\t\t} catch ( e ) {\n\n\t\t\t\t// Rethrow post-completion exceptions\n\t\t\t\tif ( completed ) {\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\n\t\t\t\t// Propagate others as results\n\t\t\t\tdone( -1, e );\n\t\t\t}\n\t\t}\n\n\t\t// Callback for when everything is done\n\t\tfunction done( status, nativeStatusText, responses, headers ) {\n\t\t\tvar isSuccess, success, error, response, modified,\n\t\t\t\tstatusText = nativeStatusText;\n\n\t\t\t// Ignore repeat invocations\n\t\t\tif ( completed ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcompleted = true;\n\n\t\t\t// Clear timeout if it exists\n\t\t\tif ( timeoutTimer ) {\n\t\t\t\twindow.clearTimeout( timeoutTimer );\n\t\t\t}\n\n\t\t\t// Dereference transport for early garbage collection\n\t\t\t// (no matter how long the jqXHR object will be used)\n\t\t\ttransport = undefined;\n\n\t\t\t// Cache response headers\n\t\t\tresponseHeadersString = headers || \"\";\n\n\t\t\t// Set readyState\n\t\t\tjqXHR.readyState = status > 0 ? 4 : 0;\n\n\t\t\t// Determine if successful\n\t\t\tisSuccess = status >= 200 && status < 300 || status === 304;\n\n\t\t\t// Get response data\n\t\t\tif ( responses ) {\n\t\t\t\tresponse = ajaxHandleResponses( s, jqXHR, responses );\n\t\t\t}\n\n\t\t\t// Use a noop converter for missing script but not if jsonp\n\t\t\tif ( !isSuccess &&\n\t\t\t\tjQuery.inArray( \"script\", s.dataTypes ) > -1 &&\n\t\t\t\tjQuery.inArray( \"json\", s.dataTypes ) < 0 ) {\n\t\t\t\ts.converters[ \"text script\" ] = function() {};\n\t\t\t}\n\n\t\t\t// Convert no matter what (that way responseXXX fields are always set)\n\t\t\tresponse = ajaxConvert( s, response, jqXHR, isSuccess );\n\n\t\t\t// If successful, handle type chaining\n\t\t\tif ( isSuccess ) {\n\n\t\t\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\t\t\tif ( s.ifModified ) {\n\t\t\t\t\tmodified = jqXHR.getResponseHeader( \"Last-Modified\" );\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.lastModified[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t\tmodified = jqXHR.getResponseHeader( \"etag\" );\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.etag[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// if no content\n\t\t\t\tif ( status === 204 || s.type === \"HEAD\" ) {\n\t\t\t\t\tstatusText = \"nocontent\";\n\n\t\t\t\t// if not modified\n\t\t\t\t} else if ( status === 304 ) {\n\t\t\t\t\tstatusText = \"notmodified\";\n\n\t\t\t\t// If we have data, let's convert it\n\t\t\t\t} else {\n\t\t\t\t\tstatusText = response.state;\n\t\t\t\t\tsuccess = response.data;\n\t\t\t\t\terror = response.error;\n\t\t\t\t\tisSuccess = !error;\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t// Extract error from statusText and normalize for non-aborts\n\t\t\t\terror = statusText;\n\t\t\t\tif ( status || !statusText ) {\n\t\t\t\t\tstatusText = \"error\";\n\t\t\t\t\tif ( status < 0 ) {\n\t\t\t\t\t\tstatus = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set data for the fake xhr object\n\t\t\tjqXHR.status = status;\n\t\t\tjqXHR.statusText = ( nativeStatusText || statusText ) + \"\";\n\n\t\t\t// Success/Error\n\t\t\tif ( isSuccess ) {\n\t\t\t\tdeferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );\n\t\t\t} else {\n\t\t\t\tdeferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );\n\t\t\t}\n\n\t\t\t// Status-dependent callbacks\n\t\t\tjqXHR.statusCode( statusCode );\n\t\t\tstatusCode = undefined;\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( isSuccess ? \"ajaxSuccess\" : \"ajaxError\",\n\t\t\t\t\t[ jqXHR, s, isSuccess ? success : error ] );\n\t\t\t}\n\n\t\t\t// Complete\n\t\t\tcompleteDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxComplete\", [ jqXHR, s ] );\n\n\t\t\t\t// Handle the global AJAX counter\n\t\t\t\tif ( !( --jQuery.active ) ) {\n\t\t\t\t\tjQuery.event.trigger( \"ajaxStop\" );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn jqXHR;\n\t},\n\n\tgetJSON: function( url, data, callback ) {\n\t\treturn jQuery.get( url, data, callback, \"json\" );\n\t},\n\n\tgetScript: function( url, callback ) {\n\t\treturn jQuery.get( url, undefined, callback, \"script\" );\n\t}\n} );\n\njQuery.each( [ \"get\", \"post\" ], function( _i, method ) {\n\tjQuery[ method ] = function( url, data, callback, type ) {\n\n\t\t// Shift arguments if data argument was omitted\n\t\tif ( isFunction( data ) ) {\n\t\t\ttype = type || callback;\n\t\t\tcallback = data;\n\t\t\tdata = undefined;\n\t\t}\n\n\t\t// The url can be an options object (which then must have .url)\n\t\treturn jQuery.ajax( jQuery.extend( {\n\t\t\turl: url,\n\t\t\ttype: method,\n\t\t\tdataType: type,\n\t\t\tdata: data,\n\t\t\tsuccess: callback\n\t\t}, jQuery.isPlainObject( url ) && url ) );\n\t};\n} );\n\njQuery.ajaxPrefilter( function( s ) {\n\tvar i;\n\tfor ( i in s.headers ) {\n\t\tif ( i.toLowerCase() === \"content-type\" ) {\n\t\t\ts.contentType = s.headers[ i ] || \"\";\n\t\t}\n\t}\n} );\n\n\njQuery._evalUrl = function( url, options, doc ) {\n\treturn jQuery.ajax( {\n\t\turl: url,\n\n\t\t// Make this explicit, since user can override this through ajaxSetup (trac-11264)\n\t\ttype: \"GET\",\n\t\tdataType: \"script\",\n\t\tcache: true,\n\t\tasync: false,\n\t\tglobal: false,\n\n\t\t// Only evaluate the response if it is successful (gh-4126)\n\t\t// dataFilter is not invoked for failure responses, so using it instead\n\t\t// of the default converter is kludgy but it works.\n\t\tconverters: {\n\t\t\t\"text script\": function() {}\n\t\t},\n\t\tdataFilter: function( response ) {\n\t\t\tjQuery.globalEval( response, options, doc );\n\t\t}\n\t} );\n};\n\n\njQuery.fn.extend( {\n\twrapAll: function( html ) {\n\t\tvar wrap;\n\n\t\tif ( this[ 0 ] ) {\n\t\t\tif ( isFunction( html ) ) {\n\t\t\t\thtml = html.call( this[ 0 ] );\n\t\t\t}\n\n\t\t\t// The elements to wrap the target around\n\t\t\twrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );\n\n\t\t\tif ( this[ 0 ].parentNode ) {\n\t\t\t\twrap.insertBefore( this[ 0 ] );\n\t\t\t}\n\n\t\t\twrap.map( function() {\n\t\t\t\tvar elem = this;\n\n\t\t\t\twhile ( elem.firstElementChild ) {\n\t\t\t\t\telem = elem.firstElementChild;\n\t\t\t\t}\n\n\t\t\t\treturn elem;\n\t\t\t} ).append( this );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\twrapInner: function( html ) {\n\t\tif ( isFunction( html ) ) {\n\t\t\treturn this.each( function( i ) {\n\t\t\t\tjQuery( this ).wrapInner( html.call( this, i ) );\n\t\t\t} );\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tvar self = jQuery( this ),\n\t\t\t\tcontents = self.contents();\n\n\t\t\tif ( contents.length ) {\n\t\t\t\tcontents.wrapAll( html );\n\n\t\t\t} else {\n\t\t\t\tself.append( html );\n\t\t\t}\n\t\t} );\n\t},\n\n\twrap: function( html ) {\n\t\tvar htmlIsFunction = isFunction( html );\n\n\t\treturn this.each( function( i ) {\n\t\t\tjQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html );\n\t\t} );\n\t},\n\n\tunwrap: function( selector ) {\n\t\tthis.parent( selector ).not( \"body\" ).each( function() {\n\t\t\tjQuery( this ).replaceWith( this.childNodes );\n\t\t} );\n\t\treturn this;\n\t}\n} );\n\n\njQuery.expr.pseudos.hidden = function( elem ) {\n\treturn !jQuery.expr.pseudos.visible( elem );\n};\njQuery.expr.pseudos.visible = function( elem ) {\n\treturn !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );\n};\n\n\n\n\njQuery.ajaxSettings.xhr = function() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n};\n\nvar xhrSuccessStatus = {\n\n\t\t// File protocol always yields status code 0, assume 200\n\t\t0: 200,\n\n\t\t// Support: IE <=9 only\n\t\t// trac-1450: sometimes IE returns 1223 when it should be 204\n\t\t1223: 204\n\t},\n\txhrSupported = jQuery.ajaxSettings.xhr();\n\nsupport.cors = !!xhrSupported && ( \"withCredentials\" in xhrSupported );\nsupport.ajax = xhrSupported = !!xhrSupported;\n\njQuery.ajaxTransport( function( options ) {\n\tvar callback, errorCallback;\n\n\t// Cross domain only allowed if supported through XMLHttpRequest\n\tif ( support.cors || xhrSupported && !options.crossDomain ) {\n\t\treturn {\n\t\t\tsend: function( headers, complete ) {\n\t\t\t\tvar i,\n\t\t\t\t\txhr = options.xhr();\n\n\t\t\t\txhr.open(\n\t\t\t\t\toptions.type,\n\t\t\t\t\toptions.url,\n\t\t\t\t\toptions.async,\n\t\t\t\t\toptions.username,\n\t\t\t\t\toptions.password\n\t\t\t\t);\n\n\t\t\t\t// Apply custom fields if provided\n\t\t\t\tif ( options.xhrFields ) {\n\t\t\t\t\tfor ( i in options.xhrFields ) {\n\t\t\t\t\t\txhr[ i ] = options.xhrFields[ i ];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Override mime type if needed\n\t\t\t\tif ( options.mimeType && xhr.overrideMimeType ) {\n\t\t\t\t\txhr.overrideMimeType( options.mimeType );\n\t\t\t\t}\n\n\t\t\t\t// X-Requested-With header\n\t\t\t\t// For cross-domain requests, seeing as conditions for a preflight are\n\t\t\t\t// akin to a jigsaw puzzle, we simply never set it to be sure.\n\t\t\t\t// (it can always be set on a per-request basis or even using ajaxSetup)\n\t\t\t\t// For same-domain requests, won't change header if already provided.\n\t\t\t\tif ( !options.crossDomain && !headers[ \"X-Requested-With\" ] ) {\n\t\t\t\t\theaders[ \"X-Requested-With\" ] = \"XMLHttpRequest\";\n\t\t\t\t}\n\n\t\t\t\t// Set headers\n\t\t\t\tfor ( i in headers ) {\n\t\t\t\t\txhr.setRequestHeader( i, headers[ i ] );\n\t\t\t\t}\n\n\t\t\t\t// Callback\n\t\t\t\tcallback = function( type ) {\n\t\t\t\t\treturn function() {\n\t\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\t\tcallback = errorCallback = xhr.onload =\n\t\t\t\t\t\t\t\txhr.onerror = xhr.onabort = xhr.ontimeout =\n\t\t\t\t\t\t\t\t\txhr.onreadystatechange = null;\n\n\t\t\t\t\t\t\tif ( type === \"abort\" ) {\n\t\t\t\t\t\t\t\txhr.abort();\n\t\t\t\t\t\t\t} else if ( type === \"error\" ) {\n\n\t\t\t\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t\t\t\t// On a manual native abort, IE9 throws\n\t\t\t\t\t\t\t\t// errors on any property access that is not readyState\n\t\t\t\t\t\t\t\tif ( typeof xhr.status !== \"number\" ) {\n\t\t\t\t\t\t\t\t\tcomplete( 0, \"error\" );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tcomplete(\n\n\t\t\t\t\t\t\t\t\t\t// File: protocol always yields status 0; see trac-8605, trac-14207\n\t\t\t\t\t\t\t\t\t\txhr.status,\n\t\t\t\t\t\t\t\t\t\txhr.statusText\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcomplete(\n\t\t\t\t\t\t\t\t\txhrSuccessStatus[ xhr.status ] || xhr.status,\n\t\t\t\t\t\t\t\t\txhr.statusText,\n\n\t\t\t\t\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t\t\t\t\t// IE9 has no XHR2 but throws on binary (trac-11426)\n\t\t\t\t\t\t\t\t\t// For XHR2 non-text, let the caller handle it (gh-2498)\n\t\t\t\t\t\t\t\t\t( xhr.responseType || \"text\" ) !== \"text\" ||\n\t\t\t\t\t\t\t\t\ttypeof xhr.responseText !== \"string\" ?\n\t\t\t\t\t\t\t\t\t\t{ binary: xhr.response } :\n\t\t\t\t\t\t\t\t\t\t{ text: xhr.responseText },\n\t\t\t\t\t\t\t\t\txhr.getAllResponseHeaders()\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// Listen to events\n\t\t\t\txhr.onload = callback();\n\t\t\t\terrorCallback = xhr.onerror = xhr.ontimeout = callback( \"error\" );\n\n\t\t\t\t// Support: IE 9 only\n\t\t\t\t// Use onreadystatechange to replace onabort\n\t\t\t\t// to handle uncaught aborts\n\t\t\t\tif ( xhr.onabort !== undefined ) {\n\t\t\t\t\txhr.onabort = errorCallback;\n\t\t\t\t} else {\n\t\t\t\t\txhr.onreadystatechange = function() {\n\n\t\t\t\t\t\t// Check readyState before timeout as it changes\n\t\t\t\t\t\tif ( xhr.readyState === 4 ) {\n\n\t\t\t\t\t\t\t// Allow onerror to be called first,\n\t\t\t\t\t\t\t// but that will not handle a native abort\n\t\t\t\t\t\t\t// Also, save errorCallback to a variable\n\t\t\t\t\t\t\t// as xhr.onerror cannot be accessed\n\t\t\t\t\t\t\twindow.setTimeout( function() {\n\t\t\t\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\t\t\t\terrorCallback();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Create the abort callback\n\t\t\t\tcallback = callback( \"abort\" );\n\n\t\t\t\ttry {\n\n\t\t\t\t\t// Do send the request (this may raise an exception)\n\t\t\t\t\txhr.send( options.hasContent && options.data || null );\n\t\t\t\t} catch ( e ) {\n\n\t\t\t\t\t// trac-14683: Only rethrow if this hasn't been notified as an error yet\n\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tabort: function() {\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n} );\n\n\n\n\n// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)\njQuery.ajaxPrefilter( function( s ) {\n\tif ( s.crossDomain ) {\n\t\ts.contents.script = false;\n\t}\n} );\n\n// Install script dataType\njQuery.ajaxSetup( {\n\taccepts: {\n\t\tscript: \"text/javascript, application/javascript, \" +\n\t\t\t\"application/ecmascript, application/x-ecmascript\"\n\t},\n\tcontents: {\n\t\tscript: /\\b(?:java|ecma)script\\b/\n\t},\n\tconverters: {\n\t\t\"text script\": function( text ) {\n\t\t\tjQuery.globalEval( text );\n\t\t\treturn text;\n\t\t}\n\t}\n} );\n\n// Handle cache's special case and crossDomain\njQuery.ajaxPrefilter( \"script\", function( s ) {\n\tif ( s.cache === undefined ) {\n\t\ts.cache = false;\n\t}\n\tif ( s.crossDomain ) {\n\t\ts.type = \"GET\";\n\t}\n} );\n\n// Bind script tag hack transport\njQuery.ajaxTransport( \"script\", function( s ) {\n\n\t// This transport only deals with cross domain or forced-by-attrs requests\n\tif ( s.crossDomain || s.scriptAttrs ) {\n\t\tvar script, callback;\n\t\treturn {\n\t\t\tsend: function( _, complete ) {\n\t\t\t\tscript = jQuery( \"');\n\n\t\t\t\t\t// restore form tag\n\t\t\t\t\thtml = this.clean.restoreFormTags(html);\n\n\t\t\t\t\tvar chars = {\n\t\t\t\t\t\t'\\u2122': '™',\n\t\t\t\t\t\t'\\u00a9': '©',\n\t\t\t\t\t\t'\\u2026': '…',\n\t\t\t\t\t\t'\\u2014': '—',\n\t\t\t\t\t\t'\\u2010': '‐'\n\t\t\t\t\t};\n\t\t\t\t\t// replace special characters\n\t\t\t\t\t$.each(chars, function(i,s)\n\t\t\t\t\t{\n\t\t\t\t\t\thtml = html.replace(new RegExp(i, 'g'), s);\n\t\t\t\t\t});\n\n\t\t\t\t\t// remove br in the of li\n\t\t\t\t\thtml = html.replace(new RegExp('', 'gi'), '');\n\t\t\t\t\thtml = html.replace(new RegExp('', 'gi'), '');\n\t\t\t\t\t// remove verified\n\t\t\t\t\thtml = html.replace(new RegExp(']) data-tagblock=\"redactor\"(.*?[^>])>', 'gi'), '');\n\t\t\t\t\thtml = html.replace(new RegExp('<(.*?) data-verified=\"redactor\"(.*?[^>])>', 'gi'), '<$1$2>');\n\t\t\t\t\thtml = html.replace(new RegExp('])\\srel=\"(.*?[^>])\"(.*?[^>])>', 'gi'), '');\n\t\t\t\t\thtml = html.replace(new RegExp('])\\srel=\"(.*?[^>])\"(.*?[^>])>', 'gi'), '');\n\t\t\t\t\thtml = html.replace(new RegExp('])\\sstyle=\"\" (.*?[^>])>', 'gi'), '');\n\t\t\t\t\thtml = html.replace(new RegExp('])\\sstyle (.*?[^>])>', 'gi'), '');\n\t\t\t\t\thtml = html.replace(new RegExp('(.*?)', 'gi'), '$1');\n\t\t\t\t\thtml = html.replace(/ data-save-url=\"(.*?[^>])\"/gi, '');\n\n\t\t\t\t\t// remove image resize\n\t\t\t\t\thtml = html.replace(/])>([\\w\\W]*?)<\\/span>/gi, '$3');\n\t\t\t\t\thtml = html.replace(/])>(.*?)<\\/span>/gi, '');\n\t\t\t\t\thtml = html.replace(/])>(.*?)<\\/span>/gi, '');\n\n\t\t\t\t\t// remove font tag\n\t\t\t\t\thtml = html.replace(//gi, '');\n\t\t\t\t\thtml = html.replace(/<\\/font>/gi, '');\n\n\t\t\t\t\t// tidy html\n\t\t\t\t\thtml = this.tidy.load(html);\n\n\t\t\t\t\t// link nofollow\n\t\t\t\t\tif (this.opts.linkNofollow)\n\t\t\t\t\t{\n\t\t\t\t\t\thtml = html.replace(/])>/gi, '');\n\t\t\t\t\t\thtml = html.replace(/])>/gi, '');\n\t\t\t\t\t}\n\n\t\t\t\t\t// reconvert inline\n\t\t\t\t\thtml = html.replace(/\\sdata-redactor-(tag|class|style)=\"(.*?[^>])\"/gi, '');\n\t\t\t\t\thtml = html.replace(new RegExp('<(.*?) data-verified=\"redactor\"(.*?[^>])>', 'gi'), '<$1$2>');\n\t\t\t\t\thtml = html.replace(new RegExp('<(.*?) data-verified=\"redactor\">', 'gi'), '<$1>');\n\n\t\t\t\t\treturn html;\n\t\t\t\t},\n\t\t\t\tonPaste: function(html, setMode)\n\t\t\t\t{\n\t\t\t\t\thtml = $.trim(html);\n\n\t\t\t\t\thtml = html.replace(/\\$/g, '$');\n\n\t\t\t\t\t// convert dirty spaces\n\t\t\t\t\thtml = html.replace(//gi, '');\n\t\t\t\t\thtml = html.replace(/ <\\/span>/gi, ' ');\n\t\t\t\t\thtml = html.replace(/]*>\\t<\\/span>/gi, '\\t');\n\t\t\t\t\thtml = html.replace(/]*>(\\s| )<\\/span>/gi, ' ');\n\n\t\t\t\t\tif (this.opts.pastePlainText)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn this.clean.getPlainText(html);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!this.utils.isSelectAll() && typeof setMode == 'undefined')\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.utils.isCurrentOrParent(['FIGCAPTION', 'A']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn this.clean.getPlainText(html, false);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (this.utils.isCurrentOrParent('PRE'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\thtml = html.replace(/\u201D/g, '\"');\n\t\t\t\t\t\t\thtml = html.replace(/\u201C/g, '\"');\n\t\t\t\t\t\t\thtml = html.replace(/\u2018/g, '\\'');\n\t\t\t\t\t\t\thtml = html.replace(/\u2019/g, '\\'');\n\n\t\t\t\t\t\t\treturn this.clean.getPreCode(html);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (this.utils.isCurrentOrParent(['BLOCKQUOTE', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\thtml = this.clean.getOnlyImages(html);\n\n\t\t\t\t\t\t\tif (!this.utils.browser('msie'))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar block = this.selection.getBlock();\n\t\t\t\t\t\t\t\tif (block && block.tagName == 'P')\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\thtml = html.replace(//gi, '

');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn html;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (this.utils.isCurrentOrParent(['TD']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\thtml = this.clean.onPasteTidy(html, 'td');\n\n\t\t\t\t\t\t\tif (this.opts.linebreaks) html = this.clean.replaceParagraphsToBr(html);\n\n\t\t\t\t\t\t\thtml = this.clean.replaceDivsToBr(html);\n\n\t\t\t\t\t\t\treturn html;\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\tif (this.utils.isCurrentOrParent(['LI']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn this.clean.onPasteTidy(html, 'li');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\n\t\t\t\t\thtml = this.clean.isSingleLine(html, setMode);\n\n\t\t\t\t\tif (!this.clean.singleLine)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.opts.linebreaks) html = this.clean.replaceParagraphsToBr(html);\n\t\t\t\t\t\tif (this.opts.replaceDivs) html = this.clean.replaceDivs(html);\n\n\t\t\t\t\t\thtml = this.clean.saveFormTags(html);\n\t\t\t\t\t}\n\n\n\t\t\t\t\thtml = this.clean.onPasteWord(html);\n\t\t\t\t\thtml = this.clean.onPasteExtra(html);\n\n\t\t\t\t\thtml = this.clean.onPasteTidy(html, 'all');\n\n\n\t\t\t\t\t// paragraphize\n\t\t\t\t\tif (!this.clean.singleLine && this.opts.paragraphize)\n\t\t\t\t\t{\n\t\t\t\t\t\thtml = this.paragraphize.load(html);\n\t\t\t\t\t}\n\n\t\t\t\t\thtml = this.clean.removeDirtyStyles(html);\n\t\t\t\t\thtml = this.clean.onPasteRemoveSpans(html);\n\t\t\t\t\thtml = this.clean.onPasteRemoveEmpty(html);\n\n\n\t\t\t\t\thtml = this.clean.convertInline(html);\n\n\t\t\t\t\treturn html;\n\t\t\t\t},\n\t\t\t\tonPasteWord: function(html)\n\t\t\t\t{\n\t\t\t\t\t// comments\n\t\t\t\t\thtml = html.replace(//gi, '');\n\n\t\t\t\t\t// style\n\t\t\t\t\thtml = html.replace(/]*>[\\s\\S]*?<\\/style>/gi, '');\n\n\t\t\t\t\tif (/(class=\\\"?Mso|style=\\\"[^\\\"]*\\bmso\\-|w:WordDocument)/.test(html))\n\t\t\t\t\t{\n\t\t\t\t\t\thtml = this.clean.onPasteIeFixLinks(html);\n\n\t\t\t\t\t\t// shapes\n\t\t\t\t\t\thtml = html.replace(//gi, '');\n\t\t\t\t\t\thtml = html.replace(/src=\"file\\:\\/\\/(.*?)\"/, 'src=\"\"');\n\n\t\t\t\t\t\t// list\n\t\t\t\t\t\thtml = html.replace(//gi, '
    ');\n\t\t\t\t\t\thtml = html.replace(//gi, '');\n\t\t\t\t\t\thtml = html.replace(//gi, '
');\n\t\t\t\t\t\t// one line\n\t\t\t\t\t\thtml = html.replace(//gi, '
');\n\t\t\t\t\t\t// remove ms word's bullet\n\t\t\t\t\t\thtml = html.replace(/\u00B7/g, '');\n\t\t\t\t\t\thtml = html.replace(/

([\\w\\W]*?)<\\/o:p>/gi, '$2');\n\n\t\t\t\t\t\t// ms word break lines\n\t\t\t\t\t\thtml = html.replace(/\\n/g, ' ');\n\n\t\t\t\t\t\t// ms word lists break lines\n\t\t\t\t\t\thtml = html.replace(/

\\n?

  • /gi, '
  • ');\n\t\t\t\t\t}\n\n\t\t\t\t\t// remove nbsp\n\t\t\t\t\tif (this.opts.cleanSpaces)\n\t\t\t\t\t{\n\t\t\t\t\t\thtml = html.replace(/(\\s| )+/g, ' ');\n\t\t\t\t\t}\n\n\t\t\t\t\treturn html;\n\t\t\t\t},\n\t\t\t\tonPasteExtra: function(html)\n\t\t\t\t{\n\t\t\t\t\t// remove google docs markers\n\t\t\t\t\thtml = html.replace(/([\\w\\W]*?)<\\/b>/gi, \"$2\");\n\t\t\t\t\thtml = html.replace(/([\\w\\W]*?)<\\/b>/gi, \"$3\");\n\n\t\t\t\t\t// google docs styles\n\t\t\t \t\thtml = html.replace(/]*(font-style: italic; font-weight: bold|font-weight: bold; font-style: italic)[^>]*>/gi, '');\n\t\t\t \t\thtml = html.replace(/]*font-style: italic[^>]*>/gi, '');\n\t\t\t\t\thtml = html.replace(/]*font-weight: bold[^>]*>/gi, '');\n\t\t\t\t\thtml = html.replace(/]*text-decoration: underline[^>]*>/gi, '');\n\n\t\t\t\t\thtml = html.replace(//gi, '');\n\t\t\t\t\thtml = html.replace(/\\n{3,}/gi, '\\n');\n\t\t\t\t\thtml = html.replace(/([\\w\\W]*?)<\\/font>/gi, '$2');\n\n\t\t\t\t\t// remove dirty p\n\t\t\t\t\thtml = html.replace(/

    /gi, '

    ');\n\t\t\t\t\thtml = html.replace(/<\\/p><\\/p>/gi, '

    ');\n\t\t\t\t\thtml = html.replace(/
  • (\\s*|\\t*|\\n*)

    /gi, '

  • ');\n\t\t\t\t\thtml = html.replace(/<\\/p>(\\s*|\\t*|\\n*)<\\/li>/gi, '
  • ');\n\n\t\t\t\t\t// remove space between paragraphs\n\t\t\t\t\thtml = html.replace(/<\\/p>\\s

    /gi, '');\n\n\t\t\t\t\t// bullets\n\t\t\t\t\thtml = html.replace(/

    \u2022([\\w\\W]*?)<\\/p>/gi, '

  • $1
  • ');\n\n\t\t\t\t\t// FF fix\n\t\t\t\t\tif (this.utils.browser('mozilla'))\n\t\t\t\t\t{\n\t\t\t\t\t\thtml = html.replace(/$/gi, '');\n\t\t\t\t\t}\n\n\t\t\t\t\treturn html;\n\t\t\t\t},\n\t\t\t\tonPasteTidy: function(html, type)\n\t\t\t\t{\n\t\t\t\t\t// remove all tags except these\n\t\t\t\t\tvar tags = ['span', 'a', 'pre', 'blockquote', 'small', 'em', 'strong', 'code', 'kbd', 'mark', 'address', 'cite', 'var', 'samp', 'dfn', 'sup', 'sub', 'b', 'i', 'u', 'del',\n\t\t\t\t\t\t\t\t'ol', 'ul', 'li', 'dl', 'dt', 'dd', 'p', 'br', 'video', 'audio', 'iframe', 'embed', 'param', 'object', 'img', 'table',\n\t\t\t\t\t\t\t\t'td', 'th', 'tr', 'tbody', 'tfoot', 'thead', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'];\n\t\t\t\t\tvar tagsEmpty = false;\n\t\t\t\t\tvar attrAllowed = [\n\t\t\t\t\t\t\t['a', '*'],\n\t\t\t\t\t\t\t['img', ['src', 'alt']],\n\t\t\t\t\t\t\t['span', ['class', 'rel', 'data-verified']],\n\t\t\t\t\t\t\t['iframe', '*'],\n\t\t\t\t\t\t\t['video', '*'],\n\t\t\t\t\t\t\t['audio', '*'],\n\t\t\t\t\t\t\t['embed', '*'],\n\t\t\t\t\t\t\t['object', '*'],\n\t\t\t\t\t\t\t['param', '*'],\n\t\t\t\t\t\t\t['source', '*']\n\t\t\t\t\t\t];\n\n\t\t\t\t\tif (type == 'all')\n\t\t\t\t\t{\n\t\t\t\t\t\ttagsEmpty = ['p', 'span', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'];\n\t\t\t\t\t\tattrAllowed = [\n\t\t\t\t\t\t\t['table', 'class'],\n\t\t\t\t\t\t\t['td', ['colspan', 'rowspan']],\n\t\t\t\t\t\t\t['a', '*'],\n\t\t\t\t\t\t\t['img', ['src', 'alt', 'data-redactor-inserted-image']],\n\t\t\t\t\t\t\t['span', ['class', 'rel', 'data-verified']],\n\t\t\t\t\t\t\t['iframe', '*'],\n\t\t\t\t\t\t\t['video', '*'],\n\t\t\t\t\t\t\t['audio', '*'],\n\t\t\t\t\t\t\t['embed', '*'],\n\t\t\t\t\t\t\t['object', '*'],\n\t\t\t\t\t\t\t['param', '*'],\n\t\t\t\t\t\t\t['source', '*']\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t\telse if (type == 'td')\n\t\t\t\t\t{\n\t\t\t\t\t\t// remove all tags except these and remove all table tags: tr, td etc\n\t\t\t\t\t\ttags = ['ul', 'ol', 'li', 'span', 'a', 'small', 'em', 'strong', 'code', 'kbd', 'mark', 'cite', 'var', 'samp', 'dfn', 'sup', 'sub', 'b', 'i', 'u', 'del',\n\t\t\t\t\t\t\t\t'ol', 'ul', 'li', 'dl', 'dt', 'dd', 'br', 'iframe', 'video', 'audio', 'embed', 'param', 'object', 'img', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'];\n\n\t\t\t\t\t}\n\t\t\t\t\telse if (type == 'li')\n\t\t\t\t\t{\n\t\t\t\t\t\t// only inline tags and ul, ol, li\n\t\t\t\t\t\ttags = ['ul', 'ol', 'li', 'span', 'a', 'small', 'em', 'strong', 'code', 'kbd', 'mark', 'cite', 'var', 'samp', 'dfn', 'sup', 'sub', 'b', 'i', 'u', 'del', 'br',\n\t\t\t\t\t\t\t\t'iframe', 'video', 'audio', 'embed', 'param', 'object', 'img'];\n\t\t\t\t\t}\n\n\t\t\t\t\tvar options = {\n\t\t\t\t\t\tdeniedTags: false,\n\t\t\t\t\t\tallowedTags: tags,\n\t\t\t\t\t\tremoveComments: true,\n\t\t\t\t\t\tremovePhp: true,\n\t\t\t\t\t\tremoveAttr: false,\n\t\t\t\t\t\tallowedAttr: attrAllowed,\n\t\t\t\t\t\tremoveEmpty: tagsEmpty\n\t\t\t\t\t};\n\n\t\t\t\t\t// denied tags\n\t\t\t\t\tif (this.opts.deniedTags)\n\t\t\t\t\t{\n\t\t\t\t\t\toptions.deniedTags = this.opts.deniedTags;\n\t\t\t\t\t}\n\n\t\t\t\t\t// allowed tags\n\t\t\t\t\tif (this.opts.allowedTags)\n\t\t\t\t\t{\n\t\t\t\t\t\toptions.allowedTags = this.opts.allowedTags;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this.tidy.load(html, options);\n\n\t\t\t\t},\n\t\t\t\tonPasteRemoveEmpty: function(html)\n\t\t\t\t{\n\t\t\t\t\thtml = html.replace(/<(p|h[1-6])>(|\\s|\\n|\\t|)<\\/(p|h[1-6])>/gi, '');\n\n\t\t\t\t\t// remove br in the end\n\t\t\t\t\tif (!this.opts.linebreaks) html = html.replace(/
    $/i, '');\n\n\t\t\t\t\treturn html;\n\t\t\t\t},\n\t\t\t\tonPasteRemoveSpans: function(html)\n\t\t\t\t{\n\t\t\t\t\thtml = html.replace(/(.*?)<\\/span>/gi, '$1');\n\t\t\t\t\thtml = html.replace(/]*>\\s| <\\/span>/gi, ' ');\n\n\t\t\t\t\treturn html;\n\t\t\t\t},\n\t\t\t\tonPasteIeFixLinks: function(html)\n\t\t\t\t{\n\t\t\t\t\tif (!this.utils.browser('msie')) return html;\n\n\t\t\t\t\tvar tmp = $.trim(html);\n\t\t\t\t\tif (tmp.search(/^(.*?)<\\/a>$/i) === 0)\n\t\t\t\t\t{\n\t\t\t\t\t\thtml = html.replace(/^(.*?)<\\/a>$/i, \"$2\");\n\t\t\t\t\t}\n\n\t\t\t\t\treturn html;\n\t\t\t\t},\n\t\t\t\tisSingleLine: function(html, setMode)\n\t\t\t\t{\n\t\t\t\t\tthis.clean.singleLine = false;\n\n\t\t\t\t\tif (!this.utils.isSelectAll() && typeof setMode == 'undefined')\n\t\t\t\t\t{\n\t\t\t\t\t\tvar blocks = this.opts.blockLevelElements.join('|').replace('P|', '').replace('DIV|', '');\n\n\t\t\t\t\t\tvar matchBlocks = html.match(new RegExp('', 'gi'));\n\t\t\t\t\t\tvar matchContainers = html.match(/<\\/(p|div)>/gi);\n\n\t\t\t\t\t\tif (!matchBlocks && (matchContainers === null || (matchContainers && matchContainers.length <= 1)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar matchBR = html.match(//gi);\n\t\t\t\t\t\t\tvar matchIMG = html.match(/])>/gi);\n\t\t\t\t\t\t\tif (!matchBR && !matchIMG)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.clean.singleLine = true;\n\t\t\t\t\t\t\t\thtml = html.replace(/<\\/?(p|div)(.*?)>/gi, '');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn html;\n\t\t\t\t},\n\t\t\t\tstripTags: function(input, allowed)\n\t\t\t\t{\n\t\t\t\t allowed = (((allowed || '') + '').toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []).join('');\n\t\t\t\t var tags = /<\\/?([a-z][a-z0-9]*)\\b[^>]*>/gi;\n\n\t\t\t\t return input.replace(tags, function ($0, $1) {\n\t\t\t\t return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : '';\n\t\t\t\t });\n\t\t\t\t},\n\t\t\t\tsavePreCode: function(html)\n\t\t\t\t{\n\t\t\t\t\thtml = this.clean.savePreFormatting(html);\n\t\t\t\t\thtml = this.clean.saveCodeFormatting(html);\n\n\t\t\t\t\treturn html;\n\t\t\t\t},\n\t\t\t\tsavePreFormatting: function(html)\n\t\t\t\t{\n\t\t\t\t\tvar pre = html.match(/([\\w\\W]*?)<\\/pre>/gi);\n\t\t\t\t\tif (pre !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\t$.each(pre, $.proxy(function(i,s)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar arr = s.match(/([\\w\\W]*?)<\\/pre>/i);\n\n\t\t\t\t\t\t\tarr[2] = arr[2].replace(//g, '\\n');\n\t\t\t\t\t\t\tarr[2] = arr[2].replace(/ /g, ' ');\n\n\t\t\t\t\t\t\tif (this.opts.preSpaces)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tarr[2] = arr[2].replace(/\\t/g, Array(this.opts.preSpaces + 1).join(' '));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tarr[2] = this.clean.encodeEntities(arr[2]);\n\n\t\t\t\t\t\t\t// $ fix\n\t\t\t\t\t\t\tarr[2] = arr[2].replace(/\\$/g, '$');\n\n\t\t\t\t\t\t\thtml = html.replace(s, '' + arr[2] + '');\n\n\t\t\t\t\t\t}, this));\n\t\t\t\t\t}\n\n\t\t\t\t\treturn html;\n\t\t\t\t},\n\t\t\t\tsaveCodeFormatting: function(html)\n\t\t\t\t{\n\t\t\t\t\tvar code = html.match(/])>(.*?)<\\/code>/gi);\n\t\t\t\t\tif (code !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\t$.each(code, $.proxy(function(i,s)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar arr = s.match(/])>(.*?)<\\/code>/i);\n\n\t\t\t\t\t\t\tarr[2] = arr[2].replace(/ /g, ' ');\n\t\t\t\t\t\t\tarr[2] = this.clean.encodeEntities(arr[2]);\n\n\t\t\t\t\t\t\t// $ fix\n\t\t\t\t\t\t\tarr[2] = arr[2].replace(/\\$/g, '$');\n\n\t\t\t\t\t\t\thtml = html.replace(s, '' + arr[2] + '');\n\n\t\t\t\t\t\t}, this));\n\t\t\t\t\t}\n\n\t\t\t\t\treturn html;\n\t\t\t\t},\n\t\t\t\tgetTextFromHtml: function(html)\n\t\t\t\t{\n\t\t\t\t\thtml = html.replace(/|<\\/H[1-6]>|<\\/p>|<\\/div>|<\\/li>|<\\/td>/gi, '\\n');\n\n\t\t\t\t\tvar tmp = document.createElement('div');\n\t\t\t\t\ttmp.innerHTML = html;\n\t\t\t\t\thtml = tmp.textContent || tmp.innerText;\n\n\t\t\t\t\treturn $.trim(html);\n\t\t\t\t},\n\t\t\t\tgetPlainText: function(html, paragraphize)\n\t\t\t\t{\n\t\t\t\t\thtml = this.clean.getTextFromHtml(html);\n\t\t\t\t\thtml = html.replace(/\\n/g, '
    ');\n\n\t\t\t\t\tif (this.opts.paragraphize && typeof paragraphize == 'undefined' && !this.utils.browser('mozilla'))\n\t\t\t\t\t{\n\t\t\t\t\t\thtml = this.paragraphize.load(html);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn html;\n\t\t\t\t},\n\t\t\t\tgetPreCode: function(html)\n\t\t\t\t{\n\t\t\t\t\thtml = html.replace(/])>/gi, '');\n\t\t\t\t\thtml = html.replace(//gi, '<img$1>');\n\t\t\t\t\thtml = this.clean.getTextFromHtml(html);\n\n\t\t\t\t\tif (this.opts.preSpaces)\n\t\t\t\t\t{\n\t\t\t\t\t\thtml = html.replace(/\\t/g, Array(this.opts.preSpaces + 1).join(' '));\n\t\t\t\t\t}\n\n\t\t\t\t\thtml = this.clean.encodeEntities(html);\n\n\t\t\t\t\treturn html;\n\t\t\t\t},\n\t\t\t\tgetOnlyImages: function(html)\n\t\t\t\t{\n\t\t\t\t\thtml = html.replace(//gi, '[img$1]');\n\n\t\t\t\t\t// remove all tags\n\t\t\t\t\thtml = html.replace(/<([Ss]*?)>/gi, '');\n\n\t\t\t\t\thtml = html.replace(/\\[img(.*?)\\]/gi, '');\n\n\t\t\t\t\treturn html;\n\t\t\t\t},\n\t\t\t\tgetOnlyLinksAndImages: function(html)\n\t\t\t\t{\n\t\t\t\t\thtml = html.replace(/([\\w\\W]*?)<\\/a>/gi, '[a href=\"$2\"]$4[/a]');\n\t\t\t\t\thtml = html.replace(//gi, '[img$1]');\n\n\t\t\t\t\t// remove all tags\n\t\t\t\t\thtml = html.replace(/<(.*?)>/gi, '');\n\n\t\t\t\t\thtml = html.replace(/\\[a href=\"(.*?)\"\\]([\\w\\W]*?)\\[\\/a\\]/gi, '$2');\n\t\t\t\t\thtml = html.replace(/\\[img(.*?)\\]/gi, '');\n\n\t\t\t\t\treturn html;\n\t\t\t\t},\n\t\t\t\tencodeEntities: function(str)\n\t\t\t\t{\n\t\t\t\t\tstr = String(str).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '\"');\n\t\t\t\t\treturn str.replace(/&/g, '&').replace(//g, '>').replace(/\"/g, '"');\n\t\t\t\t},\n\t\t\t\tremoveDirtyStyles: function(html)\n\t\t\t\t{\n\t\t\t\t\tif (this.utils.browser('msie')) return html;\n\n\t\t\t\t\tvar div = document.createElement('div');\n\t\t\t\t\tdiv.innerHTML = html;\n\n\t\t\t\t\tthis.clean.clearUnverifiedRemove($(div));\n\n\t\t\t\t\thtml = div.innerHTML;\n\t\t\t\t\t$(div).remove();\n\n\t\t\t\t\treturn html;\n\t\t\t\t},\n\t\t\t\tclearUnverified: function()\n\t\t\t\t{\n\t\t\t\t\tif (this.utils.browser('msie')) return;\n\n\t\t\t\t\tthis.clean.clearUnverifiedRemove(this.$editor);\n\n\t\t\t\t\tvar headers = this.$editor.find('h1, h2, h3, h4, h5, h6');\n\t\t\t\t\theaders.find('span').removeAttr('style');\n\t\t\t\t\theaders.find(this.opts.verifiedTags.join(', ')).removeAttr('style');\n\n\t\t\t\t\tthis.code.sync();\n\t\t\t\t},\n\t\t\t\tclearUnverifiedRemove: function($editor)\n\t\t\t\t{\n\t\t\t\t\t$editor.find(this.opts.verifiedTags.join(', ')).removeAttr('style');\n\t\t\t\t\t$editor.find('span').not('[data-verified=\"redactor\"]').removeAttr('style');\n\n\t\t\t\t\t$editor.find('span[data-verified=\"redactor\"], img[data-verified=\"redactor\"]').each(function(i, s)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar $s = $(s);\n\t\t\t\t\t\t$s.attr('style', $s.attr('rel'));\n\t\t\t\t\t});\n\n\t\t\t\t},\n\t\t\t\tsetVerified: function(html)\n\t\t\t\t{\n\t\t\t\t\tif (this.utils.browser('msie')) return html;\n\n\t\t\t\t\thtml = html.replace(new RegExp('])>', 'gi'), '');\n\t\t\t\t\thtml = html.replace(new RegExp('])>', 'gi'), '');\n\n\t\t\t\t\tvar matches = html.match(new RegExp('<(span|img)(.*?)style=\"(.*?)\"(.*?[^>])>', 'gi'));\n\n\t\t\t\t\tif (matches)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar len = matches.length;\n\t\t\t\t\t\tfor (var i = 0; i < len; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttry {\n\n\t\t\t\t\t\t\t\tvar newTag = matches[i].replace(/style=\"(.*?)\"/i, 'style=\"$1\" rel=\"$1\"');\n\t\t\t\t\t\t\t\thtml = html.replace(matches[i], newTag);\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcatch (e) {}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn html;\n\t\t\t\t},\n\t\t\t\tconvertInline: function(html)\n\t\t\t\t{\n\t\t\t\t\tvar $div = $('
    ').html(html);\n\n\t\t\t\t\tvar tags = this.opts.inlineTags;\n\t\t\t\t\ttags.push('span');\n\n\t\t\t\t\t$div.find(tags.join(',')).each(function()\n\t\t\t\t\t{\n\t\t\t\t\t\tvar $el = $(this);\n\t\t\t\t\t\tvar tag = this.tagName.toLowerCase();\n\t\t\t\t\t\t$el.attr('data-redactor-tag', tag);\n\n\t\t\t\t\t\tif (tag == 'span')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($el.attr('style')) $el.attr('data-redactor-style', $el.attr('style'));\n\t\t\t\t\t\t\telse if ($el.attr('class')) $el.attr('data-redactor-class', $el.attr('class'));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\n\t\t\t\t\thtml = $div.html();\n\t\t\t\t\t$div.remove();\n\n\t\t\t\t\treturn html;\n\t\t\t\t},\n\t\t\t\tnormalizeLists: function()\n\t\t\t\t{\n\t\t\t\t\tthis.$editor.find('li').each(function(i,s)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar $next = $(s).next();\n\t\t\t\t\t\tif ($next.length !== 0 && ($next[0].tagName == 'UL' || $next[0].tagName == 'OL'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$(s).append($next);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tremoveSpaces: function(html)\n\t\t\t\t{\n\t\t\t\t\thtml = html.replace(/\\n/g, '');\n\t\t\t\t\thtml = html.replace(/[\\t]*/g, '');\n\t\t\t\t\thtml = html.replace(/\\n\\s*\\n/g, \"\\n\");\n\t\t\t\t\thtml = html.replace(/^[\\s\\n]*/g, ' ');\n\t\t\t\t\thtml = html.replace(/[\\s\\n]*$/g, ' ');\n\t\t\t\t\thtml = html.replace( />\\s{2,} <'); // between inline tags can be only one space\n\t\t\t\t\thtml = html.replace(/\\n\\n/g, \"\\n\");\n\t\t\t\t\thtml = html.replace(/[\\u200B-\\u200D\\uFEFF]/g, '');\n\n\t\t\t\t\treturn html;\n\t\t\t\t},\n\t\t\t\treplaceDivs: function(html)\n\t\t\t\t{\n\t\t\t\t\tif (this.opts.linebreaks)\n\t\t\t\t\t{\n\t\t\t\t\t\thtml = html.replace(/
    <\\/div>/gi, '
    ');\n\t\t\t\t\t\thtml = html.replace(/([\\w\\W]*?)<\\/div>/gi, '$2
    ');\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\thtml = html.replace(/([\\w\\W]*?)<\\/div>/gi, '$2

    ');\n\t\t\t\t\t}\n\n\t\t\t\t\thtml = html.replace(/])>/gi, '');\n\t\t\t\t\thtml = html.replace(/<\\/div>/gi, '');\n\n\t\t\t\t\treturn html;\n\t\t\t\t},\n\t\t\t\treplaceDivsToBr: function(html)\n\t\t\t\t{\n\t\t\t\t\thtml = html.replace(//gi, '

    ');\n\t\t\t\t\thtml = html.replace(/

    <\\/div>/gi, '

    ');\n\t\t\t\t\thtml = html.replace(/
    ([\\w\\W]*?)<\\/div>/gi, '$1

    ');\n\n\t\t\t\t\treturn html;\n\t\t\t\t},\n\t\t\t\treplaceParagraphsToBr: function(html)\n\t\t\t\t{\n\t\t\t\t\thtml = html.replace(//gi, '

    ');\n\t\t\t\t\thtml = html.replace(/

    <\\/p>/gi, '
    ');\n\t\t\t\t\thtml = html.replace(/

    ([\\w\\W]*?)<\\/p>/gi, '$1

    ');\n\t\t\t\t\thtml = html.replace(/(){1,}\\n?<\\/blockquote>/gi, '');\n\n\t\t\t\t\treturn html;\n\t\t\t\t},\n\t\t\t\tsaveFormTags: function(html)\n\t\t\t\t{\n\t\t\t\t\treturn html.replace(/([\\w\\W]*?)<\\/form>/gi, '$2');\n\t\t\t\t},\n\t\t\t\trestoreFormTags: function(html)\n\t\t\t\t{\n\t\t\t\t\treturn html.replace(/([\\w\\W]*?)<\\/section>/gi, '$3');\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\tcode: function()\n\t\t{\n\t\t\treturn {\n\t\t\t\tset: function(html)\n\t\t\t\t{\n\t\t\t\t\thtml = $.trim(html.toString());\n\n\t\t\t\t\t// clean\n\t\t\t\t\thtml = this.clean.onSet(html);\n\n\t\t\t\t\tthis.$editor.html(html);\n\t\t\t\t\tthis.code.sync();\n\n\t\t\t\t\tif (html !== '') this.placeholder.remove();\n\n\t\t\t\t\tsetTimeout($.proxy(this.buffer.add, this), 15);\n\t\t\t\t\tif (this.start === false) this.observe.load();\n\n\t\t\t\t},\n\t\t\t\tget: function()\n\t\t\t\t{\n\t\t\t\t\tvar code = this.$textarea.val();\n\n\t\t\t\t\t// indent code\n\t\t\t\t\tcode = this.tabifier.get(code);\n\n\t\t\t\t\treturn code;\n\t\t\t\t},\n\t\t\t\tsync: function()\n\t\t\t\t{\n\t\t\t\t\tsetTimeout($.proxy(this.code.startSync, this), 10);\n\t\t\t\t},\n\t\t\t\tstartSync: function()\n\t\t\t\t{\n\t\t\t\t\tvar html = this.$editor.html();\n\n\t\t\t\t\t// is there a need to synchronize\n\t\t\t\t\tif (this.code.syncCode && this.code.syncCode == html)\n\t\t\t\t\t{\n\t\t\t\t\t\t// do not sync\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// save code\n\t\t\t\t\tthis.code.syncCode = html;\n\n\t\t\t\t\t// before clean callback\n\t\t\t\t\thtml = this.core.setCallback('syncBefore', html);\n\n\t\t\t\t\t// clean\n\t\t\t\t\thtml = this.clean.onSync(html);\n\n\t\t\t\t\t// set code\n\t\t\t\t\tthis.$textarea.val(html);\n\n\t\t\t\t\t// after sync callback\n\t\t\t\t\tthis.core.setCallback('sync', html);\n\n\t\t\t\t\tif (this.start === false)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.core.setCallback('change', html);\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.start = false;\n\n\t\t\t\t\t// autosave on change\n\t\t\t\t\tthis.autosave.onChange();\n\t\t\t\t},\n\t\t\t\ttoggle: function()\n\t\t\t\t{\n\t\t\t\t\tif (this.opts.visual)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.code.showCode();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.code.showVisual();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tshowCode: function()\n\t\t\t\t{\n\t\t\t\t\tthis.code.offset = this.caret.getOffset();\n\t\t\t\t\tvar scroll = $(window).scrollTop();\n\n\t\t\t\t\tvar height = this.$editor.innerHeight();\n\n\t\t\t\t\tthis.$editor.hide();\n\n\t\t\t\t\tvar html = this.$textarea.val();\n\t\t\t\t\tthis.modified = this.clean.removeSpaces(html);\n\n\t\t\t\t\t// indent code\n\t\t\t\t\thtml = this.tabifier.get(html);\n\n\t\t\t\t\tthis.$textarea.val(html).height(height).show().focus();\n\t\t\t\t\tthis.$textarea.on('keydown.redactor-textarea-indenting', this.code.textareaIndenting);\n\n\t\t\t\t\t$(window).scrollTop(scroll);\n\n\t\t\t\t\tif (this.$textarea[0].setSelectionRange)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.$textarea[0].setSelectionRange(0, 0);\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.$textarea[0].scrollTop = 0;\n\n\t\t\t\t\tthis.opts.visual = false;\n\n\t\t\t\t\tthis.button.setInactiveInCode();\n\t\t\t\t\tthis.button.setActive('html');\n\t\t\t\t\tthis.core.setCallback('source', html);\n\t\t\t\t},\n\t\t\t\tshowVisual: function()\n\t\t\t\t{\n\t\t\t\t\tif (this.opts.visual) return;\n\n\t\t\t\t\tvar html = this.$textarea.hide().val();\n\n\t\t\t\t\tif (this.modified !== this.clean.removeSpaces(html))\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.code.set(html);\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.$editor.show();\n\n\t\t\t\t\tif (!this.utils.isEmpty(html))\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.placeholder.remove();\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.caret.setOffset(this.code.offset);\n\n\t\t\t\t\tthis.$textarea.off('keydown.redactor-textarea-indenting');\n\n\t\t\t\t\tthis.button.setActiveInVisual();\n\t\t\t\t\tthis.button.setInactive('html');\n\n\t\t\t\t\tthis.observe.load();\n\t\t\t\t\tthis.opts.visual = true;\n\t\t\t\t\tthis.core.setCallback('visual', html);\n\t\t\t\t},\n\t\t\t\ttextareaIndenting: function(e)\n\t\t\t\t{\n\t\t\t\t\tif (e.keyCode !== 9) return true;\n\n\t\t\t\t\tvar $el = this.$textarea;\n\t\t\t\t\tvar start = $el.get(0).selectionStart;\n\t\t\t\t\t$el.val($el.val().substring(0, start) + \"\\t\" + $el.val().substring($el.get(0).selectionEnd));\n\t\t\t\t\t$el.get(0).selectionStart = $el.get(0).selectionEnd = start + 1;\n\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\tcore: function()\n\t\t{\n\t\t\treturn {\n\t\t\t\tgetObject: function()\n\t\t\t\t{\n\t\t\t\t\treturn $.extend({}, this);\n\t\t\t\t},\n\t\t\t\tgetEditor: function()\n\t\t\t\t{\n\t\t\t\t\treturn this.$editor;\n\t\t\t\t},\n\t\t\t\tgetBox: function()\n\t\t\t\t{\n\t\t\t\t\treturn this.$box;\n\t\t\t\t},\n\t\t\t\tgetElement: function()\n\t\t\t\t{\n\t\t\t\t\treturn this.$element;\n\t\t\t\t},\n\t\t\t\tgetTextarea: function()\n\t\t\t\t{\n\t\t\t\t\treturn this.$textarea;\n\t\t\t\t},\n\t\t\t\tgetToolbar: function()\n\t\t\t\t{\n\t\t\t\t\treturn (this.$toolbar) ? this.$toolbar : false;\n\t\t\t\t},\n\t\t\t\taddEvent: function(name)\n\t\t\t\t{\n\t\t\t\t\tthis.core.event = name;\n\t\t\t\t},\n\t\t\t\tgetEvent: function()\n\t\t\t\t{\n\t\t\t\t\treturn this.core.event;\n\t\t\t\t},\n\t\t\t\tsetCallback: function(type, e, data)\n\t\t\t\t{\n\t\t\t\t\tvar callback = this.opts[type + 'Callback'];\n\t\t\t\t\tif ($.isFunction(callback))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn (typeof data == 'undefined') ? callback.call(this, e) : callback.call(this, e, data);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\treturn (typeof data == 'undefined') ? e : data;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tdestroy: function()\n\t\t\t\t{\n\t\t\t\t\tthis.core.setCallback('destroy');\n\n\t\t\t\t\t// off events and remove data\n\t\t\t\t\tthis.$element.off('.redactor').removeData('redactor');\n\t\t\t\t\tthis.$editor.off('.redactor');\n\n\t\t\t\t\t$(document).off('click.redactor-image-delete.' + this.uuid);\n\t\t\t\t\t$(document).off('click.redactor-image-resize-hide.' + this.uuid);\n\t\t\t\t\t$(document).off('touchstart.redactor.' + this.uuid + ' click.redactor.' + this.uuid);\n\t\t\t\t\t$(\"body\").off('scroll.redactor.' + this.uuid);\n\t\t\t\t\t$(this.opts.toolbarFixedTarget).off('scroll.redactor.' + this.uuid);\n\n\t\t\t\t\t// common\n\t\t\t\t\tthis.$editor.removeClass('redactor-editor redactor-linebreaks redactor-placeholder');\n\t\t\t\t\tthis.$editor.removeAttr('contenteditable');\n\n\t\t\t\t\tvar html = this.code.get();\n\n\t\t\t\t\t// dropdowns off\n\t\t\t\t\tthis.$toolbar.find('a').each(function()\n\t\t\t\t\t{\n\t\t\t\t\t\tvar $el = $(this);\n\t\t\t\t\t\tif ($el.data('dropdown'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$el.data('dropdown').remove();\n\t\t\t\t\t\t\t$el.data('dropdown', {});\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\n\t\t\t\t\tif (this.build.isTextarea())\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.$box.after(this.$element);\n\t\t\t\t\t\tthis.$box.remove();\n\t\t\t\t\t\tthis.$element.val(html).show();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.$box.after(this.$editor);\n\t\t\t\t\t\tthis.$box.remove();\n\t\t\t\t\t\tthis.$element.html(html).show();\n\t\t\t\t\t}\n\n\t\t\t\t\t// paste box\n\t\t\t\t\tif (this.$pasteBox) this.$pasteBox.remove();\n\n\t\t\t\t\t// modal\n\t\t\t\t\tif (this.$modalBox) this.$modalBox.remove();\n\t\t\t\t\tif (this.$modalOverlay) this.$modalOverlay.remove();\n\n\t\t\t\t\t// buttons tooltip\n\t\t\t\t\t$('.redactor-toolbar-tooltip').remove();\n\n\t\t\t\t\t// autosave\n\t\t\t\t\tclearInterval(this.autosaveInterval);\n\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\tdropdown: function()\n\t\t{\n\t\t\treturn {\n\t\t\t\tbuild: function(name, $dropdown, dropdownObject)\n\t\t\t\t{\n\t\t\t\t\tif (name == 'formatting' && this.opts.formattingAdd)\n\t\t\t\t\t{\n\t\t\t\t\t\t$.each(this.opts.formattingAdd, $.proxy(function(i,s)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar name = s.tag;\n\t\t\t\t\t\t\tif (typeof s['class'] != 'undefined')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname = name + '-' + s['class'];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\ts.type = (this.utils.isBlockTag(s.tag)) ? 'block' : 'inline';\n\t\t\t\t\t\t\tvar func = (s.type == 'inline') ? 'inline.formatting' : 'block.formatting';\n\n\t\t\t\t\t\t\tif (this.opts.linebreaks && s.type == 'block' && s.tag == 'p') return;\n\n\t\t\t\t\t\t\tthis.formatting[name] = {\n\t\t\t\t\t\t\t\ttag: s.tag,\n\t\t\t\t\t\t\t\tstyle: s.style,\n\t\t\t\t\t\t\t\t'class': s['class'],\n\t\t\t\t\t\t\t\tattr: s.attr,\n\t\t\t\t\t\t\t\tdata: s.data,\n\t\t\t\t\t\t\t\tclear: s.clear\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\tdropdownObject[name] = {\n\t\t\t\t\t\t\t\tfunc: func,\n\t\t\t\t\t\t\t\ttitle: s.title\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t}, this));\n\n\t\t\t\t\t}\n\n\t\t\t\t\t$.each(dropdownObject, $.proxy(function(btnName, btnObject)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar $item = $('' + btnObject.title + '');\n\t\t\t\t\t\tif (name == 'formatting') $item.addClass('redactor-formatting-' + btnName);\n\n\t\t\t\t\t\t$item.on('click', $.proxy(function(e)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\t\t\tvar type = 'func';\n\t\t\t\t\t\t\tvar callback = btnObject.func;\n\t\t\t\t\t\t\tif (btnObject.command)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype = 'command';\n\t\t\t\t\t\t\t\tcallback = btnObject.command;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (btnObject.dropdown)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype = 'dropdown';\n\t\t\t\t\t\t\t\tcallback = btnObject.dropdown;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tthis.button.onClick(e, btnName, type, callback);\n\t\t\t\t\t\t\tthis.dropdown.hideAll();\n\n\t\t\t\t\t\t}, this));\n\n\t\t\t\t\t\t$dropdown.append($item);\n\n\t\t\t\t\t}, this));\n\t\t\t\t},\n\t\t\t\tshow: function(e, key)\n\t\t\t\t{\n\t\t\t\t\tif (!this.opts.visual)\n\t\t\t\t\t{\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar $button = this.button.get(key);\n\n\t\t\t\t\t// Always re-append it to the end of so it always has the highest sub-z-index.\n\t\t\t\t\tvar $dropdown = $button.data('dropdown').appendTo(document.body);\n\n\t\t\t\t\t// ios keyboard hide\n\t\t\t\t\tif (this.utils.isMobile() && !this.utils.browser('msie'))\n\t\t\t\t\t{\n\t\t\t\t\t\tdocument.activeElement.blur();\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($button.hasClass('dropact'))\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.dropdown.hideAll();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.dropdown.hideAll();\n\t\t\t\t\t\tthis.core.setCallback('dropdownShow', { dropdown: $dropdown, key: key, button: $button });\n\n\t\t\t\t\t\tthis.button.setActive(key);\n\n\t\t\t\t\t\t$button.addClass('dropact');\n\n\t\t\t\t\t\tvar keyPosition = $button.offset();\n\n\t\t\t\t\t\t// fix right placement\n\t\t\t\t\t\tvar dropdownWidth = $dropdown.width();\n\t\t\t\t\t\tif ((keyPosition.left + dropdownWidth) > $(document).width())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tkeyPosition.left = Math.max(0, keyPosition.left - dropdownWidth);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar left = keyPosition.left + 'px';\n\t\t\t\t\t\tif (this.$toolbar.hasClass('toolbar-fixed-box'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar top = this.$toolbar.innerHeight() + this.opts.toolbarFixedTopOffset;\n\t\t\t\t\t\t\tvar position = 'fixed';\n\t\t\t\t\t\t\tif (this.opts.toolbarFixedTarget !== document)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttop = (this.$toolbar.innerHeight() + this.$toolbar.offset().top) + this.opts.toolbarFixedTopOffset;\n\t\t\t\t\t\t\t\tposition = 'absolute';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$dropdown.css({ position: position, left: left, top: top + 'px' }).show();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar top = ($button.innerHeight() + keyPosition.top) + 'px';\n\n\t\t\t\t\t\t\t$dropdown.css({ position: 'absolute', left: left, top: top }).show();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis.core.setCallback('dropdownShown', { dropdown: $dropdown, key: key, button: $button });\n\t\t\t\t\t}\n\n\t\t\t\t\t$(document).one('click', $.proxy(this.dropdown.hide, this));\n\t\t\t\t\tthis.$editor.one('click', $.proxy(this.dropdown.hide, this));\n\n\t\t\t\t\t// disable scroll whan dropdown scroll\n\t\t\t\t\tvar $body = $(document.body);\n\t\t\t\t\tvar width = $body.width();\n\n\t\t\t\t\t$dropdown.on('mouseover', function() {\n\n\t\t\t\t\t\t$body.addClass('body-redactor-hidden');\n\t\t\t\t\t\t$body.css('margin-right', ($body.width() - width) + 'px');\n\n\t\t\t\t\t });\n\n\t\t\t\t\t$dropdown.on('mouseout', function() {\n\n\t\t\t\t\t\t$body.removeClass('body-redactor-hidden').css('margin-right', 0);\n\n\t\t\t\t\t});\n\n\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t},\n\t\t\t\thideAll: function()\n\t\t\t\t{\n\t\t\t\t\tthis.$toolbar.find('a.dropact').removeClass('redactor-act').removeClass('dropact');\n\n\t\t\t\t\t$(document.body).removeClass('body-redactor-hidden').css('margin-right', 0);\n\t\t\t\t\t$('.redactor-dropdown-' + this.uuid).hide();\n\t\t\t\t\tthis.core.setCallback('dropdownHide');\n\t\t\t\t},\n\t\t\t\thide: function (e)\n\t\t\t\t{\n\t\t\t\t\tvar $dropdown = $(e.target);\n\t\t\t\t\tif (!$dropdown.hasClass('dropact'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$dropdown.removeClass('dropact');\n\t\t\t\t\t\tthis.dropdown.hideAll();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\tfile: function()\n\t\t{\n\t\t\treturn {\n\t\t\t\tshow: function()\n\t\t\t\t{\n\t\t\t\t\tthis.modal.load('file', this.lang.get('file'), 700);\n\t\t\t\t\tthis.upload.init('#redactor-modal-file-upload', this.opts.fileUpload, this.file.insert);\n\n\t\t\t\t\tthis.selection.save();\n\n\t\t\t\t\tthis.selection.get();\n\t\t\t\t\tvar text = this.sel.toString();\n\n\t\t\t\t\t$('#redactor-filename').val(text);\n\n\t\t\t\t\tthis.modal.show();\n\t\t\t\t},\n\t\t\t\tinsert: function(json, direct, e)\n\t\t\t\t{\n\t\t\t\t\t// error callback\n\t\t\t\t\tif (typeof json.error != 'undefined')\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.modal.close();\n\t\t\t\t\t\tthis.selection.restore();\n\t\t\t\t\t\tthis.core.setCallback('fileUploadError', json);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar link;\n\t\t\t\t\tif (typeof json == 'string')\n\t\t\t\t\t{\n\t\t\t\t\t\tlink = json;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tvar text = $('#redactor-filename').val();\n\t\t\t\t\t\tif (typeof text == 'undefined' || text === '') text = json.filename;\n\n\t\t\t\t\t\tlink = '' + text + '';\n\t\t\t\t\t}\n\n\t\t\t\t\tif (direct)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.selection.removeMarkers();\n\t\t\t\t\t\tvar marker = this.selection.getMarker();\n\t\t\t\t\t\tthis.insert.nodeToCaretPositionFromPoint(e, marker);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.modal.close();\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.selection.restore();\n\t\t\t\t\tthis.buffer.set();\n\n\t\t\t\t\tthis.insert.htmlWithoutClean(link);\n\n\t\t\t\t\tif (typeof json == 'string') return;\n\n\t\t\t\t\tvar linkmarker = $(this.$editor.find('a#filelink-marker'));\n\t\t\t\t\tif (linkmarker.length !== 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tlinkmarker.removeAttr('id').removeAttr('style');\n\t\t\t\t\t}\n\t\t\t\t\telse linkmarker = false;\n\n\t\t\t\t\tthis.core.setCallback('fileUpload', linkmarker, json);\n\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\tfocus: function()\n\t\t{\n\t\t\treturn {\n\t\t\t\tsetStart: function()\n\t\t\t\t{\n\t\t\t\t\tthis.$editor.focus();\n\n\t\t\t\t\tvar first = this.$editor.children().first();\n\n\t\t\t\t\tif (first.length === 0) return;\n\t\t\t\t\tif (first[0].length === 0 || first[0].tagName == 'BR' || first[0].nodeType == 3)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (first[0].tagName == 'UL' || first[0].tagName == 'OL')\n\t\t\t\t\t{\n\t\t\t\t\t\tvar child = first.find('li').first();\n\t\t\t\t\t\tif (!this.utils.isBlock(child) && child.text() === '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// empty inline tag in li\n\t\t\t\t\t\t\tthis.caret.setStart(child);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (this.opts.linebreaks && !this.utils.isBlockTag(first[0].tagName))\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.selection.get();\n\t\t\t\t\t\tthis.range.setStart(this.$editor[0], 0);\n\t\t\t\t\t\tthis.range.setEnd(this.$editor[0], 0);\n\t\t\t\t\t\tthis.selection.addRange();\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// if node is tag\n\t\t\t\t\tthis.caret.setStart(first);\n\t\t\t\t},\n\t\t\t\tsetEnd: function()\n\t\t\t\t{\n\t\t\t\t\tif (this.utils.browser('mozilla') || this.utils.browser('msie'))\n\t\t\t\t\t{\n\t\t\t\t\t\tvar last = this.$editor.children().last();\n\n\t\t\t\t\t\tthis.$editor.focus();\n\t\t\t\t\t\tthis.caret.setEnd(last);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.selection.get();\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tthis.range.selectNodeContents(this.$editor[0]);\n\t\t\t\t\t\t\tthis.range.collapse(false);\n\n\t\t\t\t\t\t\tthis.selection.addRange();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (e) {}\n\t\t\t\t\t}\n\n\t\t\t\t},\n\t\t\t\tisFocused: function()\n\t\t\t\t{\n\t\t\t\t\tvar focusNode = document.getSelection().focusNode;\n\t\t\t\t\tif (focusNode === null) return false;\n\n\t\t\t\t\tif (this.opts.linebreaks && $(focusNode.parentNode).hasClass('redactor-linebreaks')) return true;\n\t\t\t\t\telse if (!this.utils.isRedactorParent(focusNode.parentNode)) return false;\n\n\t\t\t\t\treturn this.$editor.is(':focus');\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\timage: function()\n\t\t{\n\t\t\treturn {\n\t\t\t\tshow: function()\n\t\t\t\t{\n\t\t\t\t\tthis.modal.load('image', this.lang.get('image'), 700);\n\t\t\t\t\tthis.upload.init('#redactor-modal-image-droparea', this.opts.imageUpload, this.image.insert);\n\n\t\t\t\t\tthis.selection.save();\n\t\t\t\t\tthis.modal.show();\n\n\t\t\t\t},\n\t\t\t\tshowEdit: function($image)\n\t\t\t\t{\n\t\t\t\t\tvar $link = $image.closest('a');\n\n\t\t\t\t\tthis.modal.load('imageEdit', this.lang.get('edit'), 705);\n\n\t\t\t\t\tthis.modal.createCancelButton();\n\t\t\t\t\tthis.image.buttonDelete = this.modal.createDeleteButton(this.lang.get('_delete'));\n\t\t\t\t\tthis.image.buttonSave = this.modal.createActionButton(this.lang.get('save'));\n\n\t\t\t\t\tthis.image.buttonDelete.on('click', $.proxy(function()\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.image.remove($image);\n\n\t\t\t\t\t}, this));\n\n\t\t\t\t\tthis.image.buttonSave.on('click', $.proxy(function()\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.image.update($image);\n\n\t\t\t\t\t}, this));\n\n\t\t\t\t\t$('#redactor-image-title').val($image.attr('alt'));\n\n\t\t\t\t\tif (!this.opts.imageLink) $('.redactor-image-link-option').hide();\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tvar $redactorImageLink = $('#redactor-image-link');\n\n\t\t\t\t\t\t$redactorImageLink.attr('href', $image.attr('src'));\n\t\t\t\t\t\tif ($link.length !== 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$redactorImageLink.val($link.attr('href'));\n\t\t\t\t\t\t\tif ($link.attr('target') == '_blank') $('#redactor-image-link-blank').prop('checked', true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!this.opts.imagePosition) $('.redactor-image-position-option').hide();\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tvar floatValue = ($image.css('display') == 'block' && $image.css('float') == 'none') ? 'center' : $image.css('float');\n\t\t\t\t\t\t$('#redactor-image-align').val(floatValue);\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.modal.show();\n\n\t\t\t\t},\n\t\t\t\tsetFloating: function($image)\n\t\t\t\t{\n\t\t\t\t\tvar floating = $('#redactor-image-align').val();\n\n\t\t\t\t\tvar imageFloat = '';\n\t\t\t\t\tvar imageDisplay = '';\n\t\t\t\t\tvar imageMargin = '';\n\n\t\t\t\t\tswitch (floating)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 'left':\n\t\t\t\t\t\t\timageFloat = 'left';\n\t\t\t\t\t\t\timageMargin = '0 ' + this.opts.imageFloatMargin + ' ' + this.opts.imageFloatMargin + ' 0';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'right':\n\t\t\t\t\t\t\timageFloat = 'right';\n\t\t\t\t\t\t\timageMargin = '0 0 ' + this.opts.imageFloatMargin + ' ' + this.opts.imageFloatMargin;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'center':\n\t\t\t\t\t\t\timageDisplay = 'block';\n\t\t\t\t\t\t\timageMargin = 'auto';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t$image.css({ 'float': imageFloat, display: imageDisplay, margin: imageMargin });\n\t\t\t\t\t$image.attr('rel', $image.attr('style'));\n\t\t\t\t},\n\t\t\t\tupdate: function($image)\n\t\t\t\t{\n\t\t\t\t\tthis.image.hideResize();\n\t\t\t\t\tthis.buffer.set();\n\n\t\t\t\t\tvar $link = $image.closest('a');\n\n\t\t\t\t\t$image.attr('alt', $('#redactor-image-title').val());\n\n\t\t\t\t\tthis.image.setFloating($image);\n\n\t\t\t\t\t// as link\n\t\t\t\t\tvar link = $.trim($('#redactor-image-link').val());\n\t\t\t\t\tif (link !== '')\n\t\t\t\t\t{\n\t\t\t\t\t\t// test url (add protocol)\n\t\t\t\t\t\tvar pattern = '((xn--)?[a-z0-9]+(-[a-z0-9]+)*\\\\.)+[a-z]{2,}';\n\t\t\t\t\t\tvar re = new RegExp('^(http|ftp|https)://' + pattern, 'i');\n\t\t\t\t\t\tvar re2 = new RegExp('^' + pattern, 'i');\n\n\t\t\t\t\t\tif (link.search(re) == -1 && link.search(re2) === 0 && this.opts.linkProtocol)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlink = this.opts.linkProtocol + '://' + link;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar target = ($('#redactor-image-link-blank').prop('checked')) ? true : false;\n\n\t\t\t\t\t\tif ($link.length === 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar a = $('' + this.utils.getOuterHtml($image) + '');\n\t\t\t\t\t\t\tif (target) a.attr('target', '_blank');\n\n\t\t\t\t\t\t\t$image.replaceWith(a);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$link.attr('href', link);\n\t\t\t\t\t\t\tif (target)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$link.attr('target', '_blank');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$link.removeAttr('target');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if ($link.length !== 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$link.replaceWith(this.utils.getOuterHtml($image));\n\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.modal.close();\n\t\t\t\t\tthis.observe.images();\n\t\t\t\t\tthis.code.sync();\n\n\n\t\t\t\t},\n\t\t\t\tsetEditable: function($image)\n\t\t\t\t{\n\t\t\t\t\tif (this.opts.imageEditable)\n\t\t\t\t\t{\n\t\t\t\t\t\t$image.on('dragstart', $.proxy(this.image.onDrag, this));\n\t\t\t\t\t}\n\n\t\t\t\t\t$image.on('mousedown', $.proxy(this.image.hideResize, this));\n\t\t\t\t\t$image.on('click.redactor touchstart', $.proxy(function(e)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.observe.image = $image;\n\n\t\t\t\t\t\tif (this.$editor.find('#redactor-image-box').length !== 0) return false;\n\n\t\t\t\t\t\tthis.image.resizer = this.image.loadEditableControls($image);\n\n\t\t\t\t\t\t$(document).on('click.redactor-image-resize-hide.' + this.uuid, $.proxy(this.image.hideResize, this));\n\t\t\t\t\t\tthis.$editor.on('click.redactor-image-resize-hide.' + this.uuid, $.proxy(this.image.hideResize, this));\n\n\t\t\t\t\t\t// resize\n\t\t\t\t\t\tif (!this.opts.imageResizable) return;\n\n\t\t\t\t\t\tthis.image.resizer.on('mousedown.redactor touchstart.redactor', $.proxy(function(e)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.image.setResizable(e, $image);\n\t\t\t\t\t\t}, this));\n\n\n\t\t\t\t\t}, this));\n\t\t\t\t},\n\t\t\t\tsetResizable: function(e, $image)\n\t\t\t\t{\n\t\t\t\t\te.preventDefault();\n\n\t\t\t\t this.image.resizeHandle = {\n\t\t\t\t x : e.pageX,\n\t\t\t\t y : e.pageY,\n\t\t\t\t el : $image,\n\t\t\t\t ratio: $image.width() / $image.height(),\n\t\t\t\t h: $image.height()\n\t\t\t\t };\n\n\t\t\t\t e = e.originalEvent || e;\n\n\t\t\t\t if (e.targetTouches)\n\t\t\t\t {\n\t\t\t\t this.image.resizeHandle.x = e.targetTouches[0].pageX;\n\t\t\t\t this.image.resizeHandle.y = e.targetTouches[0].pageY;\n\t\t\t\t }\n\n\t\t\t\t\tthis.image.startResize();\n\n\n\t\t\t\t},\n\t\t\t\tstartResize: function()\n\t\t\t\t{\n\t\t\t\t\t$(document).on('mousemove.redactor-image-resize touchmove.redactor-image-resize', $.proxy(this.image.moveResize, this));\n\t\t\t\t\t$(document).on('mouseup.redactor-image-resize touchend.redactor-image-resize', $.proxy(this.image.stopResize, this));\n\t\t\t\t},\n\t\t\t\tmoveResize: function(e)\n\t\t\t\t{\n\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\te = e.originalEvent || e;\n\n\t\t\t\t\tvar height = this.image.resizeHandle.h;\n\n\t\t if (e.targetTouches) height += (e.targetTouches[0].pageY - this.image.resizeHandle.y);\n\t\t else height += (e.pageY - this.image.resizeHandle.y);\n\n\t\t\t\t\tvar width = Math.round(height * this.image.resizeHandle.ratio);\n\n\t\t\t\t\tif (height < 50 || width < 100) return;\n\n\t\t this.image.resizeHandle.el.width(width);\n\t\t this.image.resizeHandle.el.height(this.image.resizeHandle.el.width()/this.image.resizeHandle.ratio);\n\n\t\t this.code.sync();\n\t\t\t\t},\n\t\t\t\tstopResize: function()\n\t\t\t\t{\n\t\t\t\t\tthis.handle = false;\n\t\t\t\t\t$(document).off('.redactor-image-resize');\n\n\t\t\t\t\tthis.image.hideResize();\n\t\t\t\t},\n\t\t\t\tonDrag: function(e)\n\t\t\t\t{\n\t\t\t\t\tif (this.$editor.find('#redactor-image-box').length !== 0)\n\t\t\t\t\t{\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.$editor.on('drop.redactor-image-inside-drop', $.proxy(function()\n\t\t\t\t\t{\n\t\t\t\t\t\tsetTimeout($.proxy(this.image.onDrop, this), 1);\n\n\t\t\t\t\t}, this));\n\t\t\t\t},\n\t\t\t\tonDrop: function()\n\t\t\t\t{\n\t\t\t\t\tthis.image.fixImageSourceAfterDrop();\n\t\t\t\t\tthis.observe.images();\n\t\t\t\t\tthis.$editor.off('drop.redactor-image-inside-drop');\n\t\t\t\t\tthis.clean.clearUnverified();\n\t\t\t\t\tthis.code.sync();\n\t\t\t\t},\n\t\t\t\tfixImageSourceAfterDrop: function()\n\t\t\t\t{\n\t\t\t\t\tthis.$editor.find('img[data-save-url]').each(function()\n\t\t\t\t\t{\n\t\t\t\t\t\tvar $el = $(this);\n\t\t\t\t\t\t$el.attr('src', $el.attr('data-save-url'));\n\t\t\t\t\t\t$el.removeAttr('data-save-url');\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\thideResize: function(e)\n\t\t\t\t{\n\t\t\t\t\tif (e && $(e.target).closest('#redactor-image-box').length !== 0) return;\n\t\t\t\t\tif (e && e.target.tagName == 'IMG')\n\t\t\t\t\t{\n\t\t\t\t\t\tvar $image = $(e.target);\n\t\t\t\t\t\t$image.attr('data-save-url', $image.attr('src'));\n\t\t\t\t\t}\n\n\t\t\t\t\tvar imageBox = this.$editor.find('#redactor-image-box');\n\t\t\t\t\tif (imageBox.length === 0) return;\n\n\t\t\t\t\tif (this.opts.imageEditable)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.image.editter.remove();\n\t\t\t\t\t}\n\n\t\t\t\t\t$(this.image.resizer).remove();\n\n\t\t\t\t\timageBox.find('img').css({\n\t\t\t\t\t\tmarginTop: imageBox[0].style.marginTop,\n\t\t\t\t\t\tmarginBottom: imageBox[0].style.marginBottom,\n\t\t\t\t\t\tmarginLeft: imageBox[0].style.marginLeft,\n\t\t\t\t\t\tmarginRight: imageBox[0].style.marginRight\n\t\t\t\t\t});\n\n\t\t\t\t\timageBox.css('margin', '');\n\t\t\t\t\timageBox.find('img').css('opacity', '');\n\t\t\t\t\timageBox.replaceWith(function()\n\t\t\t\t\t{\n\t\t\t\t\t\treturn $(this).contents();\n\t\t\t\t\t});\n\n\t\t\t\t\t$(document).off('click.redactor-image-resize-hide.' + this.uuid);\n\t\t\t\t\tthis.$editor.off('click.redactor-image-resize-hide.' + this.uuid);\n\n\t\t\t\t\tif (typeof this.image.resizeHandle !== 'undefined')\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.image.resizeHandle.el.attr('rel', this.image.resizeHandle.el.attr('style'));\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.code.sync();\n\n\t\t\t\t},\n\t\t\t\tloadResizableControls: function($image, imageBox)\n\t\t\t\t{\n\t\t\t\t\tif (this.opts.imageResizable && !this.utils.isMobile())\n\t\t\t\t\t{\n\t\t\t\t\t\tvar imageResizer = $('');\n\n\t\t\t\t\t\tif (!this.utils.isDesktop())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\timageResizer.css({ width: '15px', height: '15px' });\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\timageResizer.attr('contenteditable', false);\n\t\t\t\t\t\timageBox.append(imageResizer);\n\t\t\t\t\t\timageBox.append($image);\n\n\t\t\t\t\t\treturn imageResizer;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\timageBox.append($image);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tloadEditableControls: function($image)\n\t\t\t\t{\n\t\t\t\t\tvar imageBox = $('');\n\t\t\t\t\timageBox.css('float', $image.css('float')).attr('contenteditable', false);\n\n\t\t\t\t\tif ($image[0].style.margin != 'auto')\n\t\t\t\t\t{\n\t\t\t\t\t\timageBox.css({\n\t\t\t\t\t\t\tmarginTop: $image[0].style.marginTop,\n\t\t\t\t\t\t\tmarginBottom: $image[0].style.marginBottom,\n\t\t\t\t\t\t\tmarginLeft: $image[0].style.marginLeft,\n\t\t\t\t\t\t\tmarginRight: $image[0].style.marginRight\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t$image.css('margin', '');\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\timageBox.css({ 'display': 'block', 'margin': 'auto' });\n\t\t\t\t\t}\n\n\t\t\t\t\t$image.css('opacity', '.5').after(imageBox);\n\n\n\t\t\t\t\tif (this.opts.imageEditable)\n\t\t\t\t\t{\n\t\t\t\t\t\t// editter\n\t\t\t\t\t\tthis.image.editter = $('' + this.lang.get('edit') + '');\n\t\t\t\t\t\tthis.image.editter.attr('contenteditable', false);\n\t\t\t\t\t\tthis.image.editter.on('click', $.proxy(function()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.image.showEdit($image);\n\t\t\t\t\t\t}, this));\n\n\t\t\t\t\t\timageBox.append(this.image.editter);\n\n\t\t\t\t\t\t// position correction\n\t\t\t\t\t\tvar editerWidth = this.image.editter.innerWidth();\n\t\t\t\t\t\tthis.image.editter.css('margin-left', '-' + editerWidth/2 + 'px');\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this.image.loadResizableControls($image, imageBox);\n\n\t\t\t\t},\n\t\t\t\tremove: function(image)\n\t\t\t\t{\n\t\t\t\t\tvar $image = $(image);\n\t\t\t\t\tvar $link = $image.closest('a');\n\t\t\t\t\tvar $figure = $image.closest('figure');\n\t\t\t\t\tvar $parent = $image.parent();\n\t\t\t\t\tif ($('#redactor-image-box').length !== 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$parent = $('#redactor-image-box').parent();\n\t\t\t\t\t}\n\n\t\t\t\t\tvar $next;\n\t\t\t\t\tif ($figure.length !== 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$next = $figure.next();\n\t\t\t\t\t\t$figure.remove();\n\t\t\t\t\t}\n\t\t\t\t\telse if ($link.length !== 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$parent = $link.parent();\n\t\t\t\t\t\t$link.remove();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$image.remove();\n\t\t\t\t\t}\n\n\t\t\t\t\t$('#redactor-image-box').remove();\n\n\t\t\t\t\tif ($figure.length !== 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.caret.setStart($next);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.caret.setStart($parent);\n\t\t\t\t\t}\n\n\t\t\t\t\t// delete callback\n\t\t\t\t\tthis.core.setCallback('imageDelete', $image[0].src, $image);\n\n\t\t\t\t\tthis.modal.close();\n\t\t\t\t\tthis.code.sync();\n\t\t\t\t},\n\t\t\t\tinsert: function(json, direct, e)\n\t\t\t\t{\n\t\t\t\t\t// error callback\n\t\t\t\t\tif (typeof json.error != 'undefined')\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.modal.close();\n\t\t\t\t\t\tthis.selection.restore();\n\t\t\t\t\t\tthis.core.setCallback('imageUploadError', json);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar $img;\n\t\t\t\t\tif (typeof json == 'string')\n\t\t\t\t\t{\n\t\t\t\t\t\t$img = $(json).attr('data-redactor-inserted-image', 'true');\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$img = $('');\n\t\t\t\t\t\t$img.attr('src', json.filelink).attr('data-redactor-inserted-image', 'true');\n\t\t\t\t\t}\n\n\n\t\t\t\t\tvar node = $img;\n\t\t\t\t\tvar isP = this.utils.isCurrentOrParent('P');\n\t\t\t\t\tif (isP)\n\t\t\t\t\t{\n\t\t\t\t\t\t// will replace\n\t\t\t\t\t\tnode = $('

    ').append($img);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (direct)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.selection.removeMarkers();\n\t\t\t\t\t\tvar marker = this.selection.getMarker();\n\t\t\t\t\t\tthis.insert.nodeToCaretPositionFromPoint(e, marker);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.modal.close();\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.selection.restore();\n\t\t\t\t\tthis.buffer.set();\n\n\t\t\t\t\tthis.insert.html(this.utils.getOuterHtml(node), false);\n\n\t\t\t\t\tvar $image = this.$editor.find('img[data-redactor-inserted-image=true]').removeAttr('data-redactor-inserted-image');\n\n\t\t\t\t\tif (isP)\n\t\t\t\t\t{\n\t\t\t\t\t\t$image.parent().contents().unwrap().wrap('

    ');\n\t\t\t\t\t}\n\t\t\t\t\telse if (this.opts.linebreaks)\n\t\t\t\t\t{\n\t\t\t\t\t\t$image.before('
    ').after('
    ');\n\t\t\t\t\t}\n\n\t\t\t\t\tif (typeof json == 'string') return;\n\n\t\t\t\t\tthis.core.setCallback('imageUpload', $image, json);\n\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\tindent: function()\n\t\t{\n\t\t\treturn {\n\t\t\t\tincrease: function()\n\t\t\t\t{\n\t\t\t\t\t// focus\n\t\t\t\t\tif (!this.utils.browser('msie')) this.$editor.focus();\n\n\t\t\t\t\tthis.buffer.set();\n\t\t\t\t\tthis.selection.save();\n\n\t\t\t\t\tvar block = this.selection.getBlock();\n\n\t\t\t\t\tif (block && block.tagName == 'LI')\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.indent.increaseLists();\n\t\t\t\t\t}\n\t\t\t\t\telse if (block === false && this.opts.linebreaks)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.indent.increaseText();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.indent.increaseBlocks();\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.selection.restore();\n\t\t\t\t\tthis.code.sync();\n\t\t\t\t},\n\t\t\t\tincreaseLists: function()\n\t\t\t\t{\n\t\t\t\t\tdocument.execCommand('indent');\n\n\t\t\t\t\tthis.indent.fixEmptyIndent();\n\t\t\t\t\tthis.clean.normalizeLists();\n\t\t\t\t\tthis.clean.clearUnverified();\n\t\t\t\t},\n\t\t\t\tincreaseBlocks: function()\n\t\t\t\t{\n\t\t\t\t\t$.each(this.selection.getBlocks(), $.proxy(function(i, elem)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (elem.tagName === 'TD' || elem.tagName === 'TH') return;\n\n\t\t\t\t\t\tvar $el = this.utils.getAlignmentElement(elem);\n\n\t\t\t\t\t\tvar left = this.utils.normalize($el.css('margin-left')) + this.opts.indentValue;\n\t\t\t\t\t\t$el.css('margin-left', left + 'px');\n\n\t\t\t\t\t}, this));\n\t\t\t\t},\n\t\t\t\tincreaseText: function()\n\t\t\t\t{\n\t\t\t\t\tvar wrapper = this.selection.wrap('div');\n\t\t\t\t\t$(wrapper).attr('data-tagblock', 'redactor');\n\t\t\t\t\t$(wrapper).css('margin-left', this.opts.indentValue + 'px');\n\t\t\t\t},\n\t\t\t\tdecrease: function()\n\t\t\t\t{\n\t\t\t\t\tthis.buffer.set();\n\t\t\t\t\tthis.selection.save();\n\n\t\t\t\t\tvar block = this.selection.getBlock();\n\t\t\t\t\tif (block && block.tagName == 'LI')\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.indent.decreaseLists();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.indent.decreaseBlocks();\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.selection.restore();\n\t\t\t\t\tthis.code.sync();\n\t\t\t\t},\n\t\t\t\tdecreaseLists: function ()\n\t\t\t\t{\n\t\t\t\t\tdocument.execCommand('outdent');\n\n\t\t\t\t\tvar current = this.selection.getCurrent();\n\n\t\t\t\t\tvar $item = $(current).closest('li');\n\t\t\t\t\tvar $parent = $item.parent();\n\t\t\t\t\tif ($item.length !== 0 && $parent.length !== 0 && $parent[0].tagName == 'LI')\n\t\t\t\t\t{\n\t\t\t\t\t\t$parent.after($item);\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.indent.fixEmptyIndent();\n\n\t\t\t\t\tif (!this.opts.linebreaks && $item.length === 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tdocument.execCommand('formatblock', false, 'p');\n\t\t\t\t\t\tthis.$editor.find('ul, ol, blockquote, p').each($.proxy(this.utils.removeEmpty, this));\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.clean.clearUnverified();\n\t\t\t\t},\n\t\t\t\tdecreaseBlocks: function()\n\t\t\t\t{\n\t\t\t\t\t$.each(this.selection.getBlocks(), $.proxy(function(i, elem)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar $el = this.utils.getAlignmentElement(elem);\n\t\t\t\t\t\tvar left = this.utils.normalize($el.css('margin-left')) - this.opts.indentValue;\n\n\t\t\t\t\t\tif (left <= 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (this.opts.linebreaks && typeof($el.data('tagblock')) !== 'undefined')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$el.replaceWith($el.html() + '
    ');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$el.css('margin-left', '');\n\t\t\t\t\t\t\t\tthis.utils.removeEmptyAttr($el, 'style');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$el.css('margin-left', left + 'px');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}, this));\n\t\t\t\t},\n\t\t\t\tfixEmptyIndent: function()\n\t\t\t\t{\n\t\t\t\t\tvar block = this.selection.getBlock();\n\n\t\t\t\t\tif (this.range.collapsed && block && block.tagName == 'LI' && this.utils.isEmpty($(block).text()))\n\t\t\t\t\t{\n\t\t\t\t\t\tvar $block = $(block);\n\t\t\t\t\t\t$block.find('span').not('.redactor-selection-marker').contents().unwrap();\n\t\t\t\t\t\t$block.append('
    ');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\tinline: function()\n\t\t{\n\t\t\treturn {\n\t\t\t\tformatting: function(name)\n\t\t\t\t{\n\t\t\t\t\tvar type, value;\n\n\t\t\t\t\tif (typeof this.formatting[name].style != 'undefined') type = 'style';\n\t\t\t\t\telse if (typeof this.formatting[name]['class'] != 'undefined') type = 'class';\n\n\t\t\t\t\tif (type) value = this.formatting[name][type];\n\n\t\t\t\t\tthis.inline.format(this.formatting[name].tag, type, value);\n\n\t\t\t\t},\n\t\t\t\tformat: function(tag, type, value)\n\t\t\t\t{\n\t\t\t\t\t// Stop formatting pre and headers\n\t\t\t\t\tif (this.utils.isCurrentOrParent('PRE') || this.utils.isCurrentOrParentHeader()) return;\n\n\t\t\t\t\tvar tags = ['b', 'bold', 'i', 'italic', 'underline', 'strikethrough', 'deleted', 'superscript', 'subscript'];\n\t\t\t\t\tvar replaced = ['strong', 'strong', 'em', 'em', 'u', 'del', 'del', 'sup', 'sub'];\n\n\t\t\t\t\tfor (var i = 0; i < tags.length; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (tag == tags[i]) tag = replaced[i];\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.inline.type = type || false;\n\t\t\t\t\tthis.inline.value = value || false;\n\n\t\t\t\t\tthis.buffer.set();\n\n\t\t\t\t\tif (!this.utils.browser('msie'))\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.$editor.focus();\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.selection.get();\n\n\t\t\t\t\tif (this.range.collapsed)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.inline.formatCollapsed(tag);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.inline.formatMultiple(tag);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tformatCollapsed: function(tag)\n\t\t\t\t{\n\t\t\t\t\tvar current = this.selection.getCurrent();\n\t\t\t\t\tvar $parent = $(current).closest(tag + '[data-redactor-tag=' + tag + ']');\n\n\t\t\t\t\t// inline there is\n\t\t\t\t\tif ($parent.length !== 0 && (this.inline.type != 'style' && $parent[0].tagName != 'SPAN'))\n\t\t\t\t\t{\n\t\t\t\t\t\t// remove empty\n\t\t\t\t\t\tif (this.utils.isEmpty($parent.text()))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.caret.setAfter($parent[0]);\n\n\t\t\t\t\t\t\t$parent.remove();\n\t\t\t\t\t\t\tthis.code.sync();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (this.utils.isEndOfElement($parent))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.caret.setAfter($parent[0]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// create empty inline\n\t\t\t\t\tvar node = $('<' + tag + '>').attr('data-verified', 'redactor').attr('data-redactor-tag', tag);\n\t\t\t\t\tnode.html(this.opts.invisibleSpace);\n\n\t\t\t\t\tnode = this.inline.setFormat(node);\n\n\t\t\t\t\tvar node = this.insert.node(node);\n\t\t\t\t\tthis.caret.setEnd(node);\n\n\t\t\t\t\tthis.code.sync();\n\t\t\t\t},\n\t\t\t\tformatMultiple: function(tag)\n\t\t\t\t{\n\t\t\t\t\tthis.inline.formatConvert(tag);\n\n\t\t\t\t\tthis.selection.save();\n\t\t\t\t\tdocument.execCommand('strikethrough');\n\n\t\t\t\t\tthis.$editor.find('strike').each($.proxy(function(i,s)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar $el = $(s);\n\n\t\t\t\t\t\tthis.inline.formatRemoveSameChildren($el, tag);\n\n\t\t\t\t\t\tvar $span;\n\t\t\t\t\t\tif (this.inline.type)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$span = $('').attr('data-redactor-tag', tag).attr('data-verified', 'redactor');\n\t\t\t\t\t\t\t$span = this.inline.setFormat($span);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$span = $('<' + tag + '>').attr('data-redactor-tag', tag).attr('data-verified', 'redactor');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$el.replaceWith($span.html($el.contents()));\n\n\t\t\t\t\t\tif (tag == 'span')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar $parent = $span.parent();\n\t\t\t\t\t\t\tif ($parent && $parent[0].tagName == 'SPAN' && this.inline.type == 'style')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar arr = this.inline.value.split(';');\n\n\t\t\t\t\t\t\t\tfor (var z = 0; z < arr.length; z++)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (arr[z] === '') return;\n\t\t\t\t\t\t\t\t\tvar style = arr[z].split(':');\n\t\t\t\t\t\t\t\t\t$parent.css(style[0], '');\n\n\t\t\t\t\t\t\t\t\tif (this.utils.removeEmptyAttr($parent, 'style'))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$parent.replaceWith($parent.contents());\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}, this));\n\n\t\t\t\t\t// clear text decoration\n\t\t\t\t\tif (tag != 'span')\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.$editor.find(this.opts.inlineTags.join(', ')).each($.proxy(function(i,s)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar $el = $(s);\n\t\t\t\t\t\t\tvar property = $el.css('text-decoration');\n\t\t\t\t\t\t\tif (property == 'line-through')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$el.css('text-decoration', '');\n\t\t\t\t\t\t\t\tthis.utils.removeEmptyAttr($el, 'style');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, this));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (tag != 'del')\n\t\t\t\t\t{\n\t\t\t\t\t\tvar _this = this;\n\t\t\t\t\t\tthis.$editor.find('inline').each(function(i,s)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_this.utils.replaceToTag(s, 'del');\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.selection.restore();\n\t\t\t\t\tthis.code.sync();\n\n\t\t\t\t},\n\t\t\t\tformatRemoveSameChildren: function($el, tag)\n\t\t\t\t{\n\t\t\t\t\tvar self = this;\n\t\t\t\t\t$el.children(tag).each(function()\n\t\t\t\t\t{\n\t\t\t\t\t\tvar $child = $(this);\n\n\t\t\t\t\t\tif (!$child.hasClass('redactor-selection-marker'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (self.inline.type == 'style')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar arr = self.inline.value.split(';');\n\n\t\t\t\t\t\t\t\tfor (var z = 0; z < arr.length; z++)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (arr[z] === '') return;\n\n\t\t\t\t\t\t\t\t\tvar style = arr[z].split(':');\n\t\t\t\t\t\t\t\t\t$child.css(style[0], '');\n\n\t\t\t\t\t\t\t\t\tif (self.utils.removeEmptyAttr($child , 'style'))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$child.replaceWith($child.contents());\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$child.contents().unwrap();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tformatConvert: function(tag)\n\t\t\t\t{\n\t\t\t\t\tthis.selection.save();\n\n\t\t\t\t\tvar find = '';\n\t\t\t\t\tif (this.inline.type == 'class') find = '[data-redactor-class=' + this.inline.value + ']';\n\t\t\t\t\telse if (this.inline.type == 'style')\n\t\t\t\t\t{\n\t\t\t\t\t\tfind = '[data-redactor-style=\"' + this.inline.value + '\"]';\n\t\t\t\t\t}\n\n\t\t\t\t\tvar self = this;\n\t\t\t\t\tif (tag != 'del')\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.$editor.find('del').each(function(i,s)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tself.utils.replaceToTag(s, 'inline');\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tif (tag != 'span')\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.$editor.find(tag).each(function()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar $el = $(this);\n\t\t\t\t\t\t\t$el.replaceWith($('').html($el.contents()));\n\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.$editor.find('[data-redactor-tag=\"' + tag + '\"]' + find).each(function()\n\t\t\t\t\t{\n\t\t\t\t\t\tif (find === '' && tag == 'span' && this.tagName.toLowerCase() == tag) return;\n\n\t\t\t\t\t\tvar $el = $(this);\n\t\t\t\t\t\t$el.replaceWith($('').html($el.contents()));\n\n\t\t\t\t\t});\n\n\t\t\t\t\tthis.selection.restore();\n\t\t\t\t},\n\t\t\t\tsetFormat: function(node)\n\t\t\t\t{\n\t\t\t\t\tswitch (this.inline.type)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 'class':\n\n\t\t\t\t\t\t\tif (node.hasClass(this.inline.value))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tnode.removeClass(this.inline.value);\n\t\t\t\t\t\t\t\tnode.removeAttr('data-redactor-class');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tnode.addClass(this.inline.value);\n\t\t\t\t\t\t\t\tnode.attr('data-redactor-class', this.inline.value);\n\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'style':\n\n\t\t\t\t\t\t\tnode[0].style.cssText = this.inline.value;\n\t\t\t\t\t\t\tnode.attr('data-redactor-style', this.inline.value);\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn node;\n\t\t\t\t},\n\t\t\t\tremoveStyle: function()\n\t\t\t\t{\n\t\t\t\t\tthis.buffer.set();\n\t\t\t\t\tvar current = this.selection.getCurrent();\n\t\t\t\t\tvar nodes = this.selection.getInlines();\n\n\t\t\t\t\tthis.selection.save();\n\n\t\t\t\t\tif (current && current.tagName === 'SPAN')\n\t\t\t\t\t{\n\t\t\t\t\t\tvar $s = $(current);\n\n\t\t\t\t\t\t$s.removeAttr('style');\n\t\t\t\t\t\tif ($s[0].attributes.length === 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$s.replaceWith($s.contents());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$.each(nodes, $.proxy(function(i,s)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar $s = $(s);\n\t\t\t\t\t\tif ($.inArray(s.tagName.toLowerCase(), this.opts.inlineTags) != -1 && !$s.hasClass('redactor-selection-marker'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$s.removeAttr('style');\n\t\t\t\t\t\t\tif ($s[0].attributes.length === 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$s.replaceWith($s.contents());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}, this));\n\n\t\t\t\t\tthis.selection.restore();\n\t\t\t\t\tthis.code.sync();\n\n\t\t\t\t},\n\t\t\t\tremoveStyleRule: function(name)\n\t\t\t\t{\n\t\t\t\t\tthis.buffer.set();\n\t\t\t\t\tvar parent = this.selection.getParent();\n\t\t\t\t\tvar nodes = this.selection.getInlines();\n\n\t\t\t\t\tthis.selection.save();\n\n\t\t\t\t\tif (parent && parent.tagName === 'SPAN')\n\t\t\t\t\t{\n\t\t\t\t\t\tvar $s = $(parent);\n\n\t\t\t\t\t\t$s.css(name, '');\n\t\t\t\t\t\tthis.utils.removeEmptyAttr($s, 'style');\n\t\t\t\t\t\tif ($s[0].attributes.length === 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$s.replaceWith($s.contents());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$.each(nodes, $.proxy(function(i,s)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar $s = $(s);\n\t\t\t\t\t\tif ($.inArray(s.tagName.toLowerCase(), this.opts.inlineTags) != -1 && !$s.hasClass('redactor-selection-marker'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$s.css(name, '');\n\t\t\t\t\t\t\tthis.utils.removeEmptyAttr($s, 'style');\n\t\t\t\t\t\t\tif ($s[0].attributes.length === 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$s.replaceWith($s.contents());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}, this));\n\n\t\t\t\t\tthis.selection.restore();\n\t\t\t\t\tthis.code.sync();\n\t\t\t\t},\n\t\t\t\tremoveFormat: function()\n\t\t\t\t{\n\t\t\t\t\tthis.buffer.set();\n\t\t\t\t\tvar current = this.selection.getCurrent();\n\n\t\t\t\t\tthis.selection.save();\n\n\t\t\t\t\tdocument.execCommand('removeFormat');\n\n\t\t\t\t\tif (current && current.tagName === 'SPAN')\n\t\t\t\t\t{\n\t\t\t\t\t\t$(current).replaceWith($(current).contents());\n\t\t\t\t\t}\n\n\n\t\t\t\t\t$.each(this.selection.getNodes(), $.proxy(function(i,s)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar $s = $(s);\n\t\t\t\t\t\tif ($.inArray(s.tagName.toLowerCase(), this.opts.inlineTags) != -1 && !$s.hasClass('redactor-selection-marker'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$s.replaceWith($s.contents());\n\t\t\t\t\t\t}\n\t\t\t\t\t}, this));\n\n\t\t\t\t\tthis.selection.restore();\n\t\t\t\t\tthis.code.sync();\n\n\t\t\t\t},\n\t\t\t\ttoggleClass: function(className)\n\t\t\t\t{\n\t\t\t\t\tthis.inline.format('span', 'class', className);\n\t\t\t\t},\n\t\t\t\ttoggleStyle: function(value)\n\t\t\t\t{\n\t\t\t\t\tthis.inline.format('span', 'style', value);\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\tinsert: function()\n\t\t{\n\t\t\treturn {\n\t\t\t\tset: function(html, clean)\n\t\t\t\t{\n\t\t\t\t\tthis.placeholder.remove();\n\n\t\t\t\t\thtml = this.clean.setVerified(html);\n\n\t\t\t\t\tif (typeof clean == 'undefined')\n\t\t\t\t\t{\n\t\t\t\t\t\thtml = this.clean.onPaste(html, false);\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.$editor.html(html);\n\t\t\t\t\tthis.selection.remove();\n\t\t\t\t\tthis.focus.setEnd();\n\t\t\t\t\tthis.clean.normalizeLists();\n\t\t\t\t\tthis.code.sync();\n\t\t\t\t\tthis.observe.load();\n\n\t\t\t\t\tif (typeof clean == 'undefined')\n\t\t\t\t\t{\n\t\t\t\t\t\tsetTimeout($.proxy(this.clean.clearUnverified, this), 10);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\ttext: function(text)\n\t\t\t\t{\n\t\t\t\t\tthis.placeholder.remove();\n\n\t\t\t\t\ttext = text.toString();\n\t\t\t\t\ttext = $.trim(text);\n\t\t\t\t\ttext = this.clean.getPlainText(text, false);\n\n\t\t\t\t\tthis.$editor.focus();\n\n\t\t\t\t\tif (this.utils.browser('msie'))\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.insert.htmlIe(text);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.selection.get();\n\n\t\t\t\t\t\tthis.range.deleteContents();\n\t\t\t\t\t\tvar el = document.createElement(\"div\");\n\t\t\t\t\t\tel.innerHTML = text;\n\t\t\t\t\t\tvar frag = document.createDocumentFragment(), node, lastNode;\n\t\t\t\t\t\twhile ((node = el.firstChild))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlastNode = frag.appendChild(node);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis.range.insertNode(frag);\n\n\t\t\t\t\t\tif (lastNode)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar range = this.range.cloneRange();\n\t\t\t\t\t\t\trange.setStartAfter(lastNode);\n\t\t\t\t\t\t\trange.collapse(true);\n\t\t\t\t\t\t\tthis.sel.removeAllRanges();\n\t\t\t\t\t\t\tthis.sel.addRange(range);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.code.sync();\n\t\t\t\t\tthis.clean.clearUnverified();\n\t\t\t\t},\n\t\t\t\thtmlWithoutClean: function(html)\n\t\t\t\t{\n\t\t\t\t\tthis.insert.html(html, false);\n\t\t\t\t},\n\t\t\t\thtml: function(html, clean)\n\t\t\t\t{\n\t\t\t\t\tthis.placeholder.remove();\n\n\t\t\t\t\tif (typeof clean == 'undefined') clean = true;\n\n\t\t\t\t\tthis.$editor.focus();\n\n\t\t\t\t\thtml = this.clean.setVerified(html);\n\n\t\t\t\t\tif (clean)\n\t\t\t\t\t{\n\t\t\t\t\t\thtml = this.clean.onPaste(html);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (this.utils.browser('msie'))\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.insert.htmlIe(html);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.clean.singleLine) this.insert.execHtml(html);\n\t\t\t\t\t\telse document.execCommand('insertHTML', false, html);\n\n\t\t\t\t\t\tthis.insert.htmlFixMozilla();\n\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.clean.normalizeLists();\n\n\t\t\t\t\t// remove empty paragraphs finaly\n\t\t\t\t\tif (!this.opts.linebreaks)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.$editor.find('p').each($.proxy(this.utils.removeEmpty, this));\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.code.sync();\n\t\t\t\t\tthis.observe.load();\n\n\t\t\t\t\tif (clean)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.clean.clearUnverified();\n\t\t\t\t\t}\n\n\t\t\t\t},\n\t\t\t\thtmlFixMozilla: function()\n\t\t\t\t{\n\t\t\t\t\t// FF inserts empty p when content was selected dblclick\n\t\t\t\t\tif (!this.utils.browser('mozilla')) return;\n\n\t\t\t\t\tvar $next = $(this.selection.getBlock()).next();\n\t\t\t\t\tif ($next.length > 0 && $next[0].tagName == 'P' && $next.html() === '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$next.remove();\n\t\t\t\t\t}\n\n\t\t\t\t},\n\t\t\t\thtmlIe: function(html)\n\t\t\t\t{\n\t\t\t\t\tif (this.utils.isIe11())\n\t\t\t\t\t{\n\t\t\t\t\t\tvar parent = this.utils.isCurrentOrParent('P');\n\t\t\t\t\t\tvar $html = $('

    ').append(html);\n\t\t\t\t\t\tvar blocksMatch = $html.contents().is('p, :header, dl, ul, ol, div, table, td, blockquote, pre, address, section, header, footer, aside, article');\n\n\t\t\t\t\t\tif (parent && blocksMatch) this.insert.ie11FixInserting(parent, html);\n\t\t\t\t\t\telse this.insert.ie11PasteFrag(html);\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tdocument.selection.createRange().pasteHTML(html);\n\n\t\t\t\t},\n\t\t\t\texecHtml: function(html)\n\t\t\t\t{\n\t\t\t\t\thtml = this.clean.setVerified(html);\n\n\t\t\t\t\tthis.selection.get();\n\n\t\t\t\t\tthis.range.deleteContents();\n\n\t\t\t\t\tvar el = document.createElement('div');\n\t\t\t\t\tel.innerHTML = html;\n\n\t\t\t\t\tvar frag = document.createDocumentFragment(), node, lastNode;\n\t\t\t\t\twhile ((node = el.firstChild))\n\t\t\t\t\t{\n\t\t\t\t\t\tlastNode = frag.appendChild(node);\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.range.insertNode(frag);\n\n\t\t\t\t\tthis.range.collapse(true);\n\t\t\t\t\tthis.caret.setAfter(lastNode);\n\n\t\t\t\t},\n\t\t\t\tnode: function(node, deleteContents)\n\t\t\t\t{\n\t\t\t\t\tnode = node[0] || node;\n\n\t\t\t\t\tvar html = this.utils.getOuterHtml(node);\n\t\t\t\t\thtml = this.clean.setVerified(html);\n\n\t\t\t\t\tif (html.match(/' + parHtml.replace(/<\\/span>/gi, '

    ' + html + '

    ') + '

    ';\n\t\t\t\t\t$(parent).replaceWith(parHtml);\n\t\t\t\t},\n\t\t\t\tie11PasteFrag: function(html)\n\t\t\t\t{\n\t\t\t\t\tthis.selection.get();\n\t\t\t\t\tthis.range.deleteContents();\n\n\t\t\t\t\tvar el = document.createElement(\"div\");\n\t\t\t\t\tel.innerHTML = html;\n\n\t\t\t\t\tvar frag = document.createDocumentFragment(), node, lastNode;\n\t\t\t\t\twhile ((node = el.firstChild))\n\t\t\t\t\t{\n\t\t\t\t\t\tlastNode = frag.appendChild(node);\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.range.insertNode(frag);\n\t\t\t\t\tthis.range.collapse(false);\n\t\t\t\t\tthis.selection.addRange();\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\tkeydown: function()\n\t\t{\n\t\t\treturn {\n\t\t\t\tinit: function(e)\n\t\t\t\t{\n\t\t\t\t\tif (this.rtePaste) return;\n\n\t\t\t\t\tvar key = e.which;\n\t\t\t\t\tvar arrow = (key >= 37 && key <= 40);\n\n\t\t\t\t\tthis.keydown.ctrl = e.ctrlKey || e.metaKey;\n\t\t\t\t\tthis.keydown.current = this.selection.getCurrent();\n\t\t\t\t\tthis.keydown.parent = this.selection.getParent();\n\t\t\t\t\tthis.keydown.block = this.selection.getBlock();\n\n\t\t\t // detect tags\n\t\t\t\t\tthis.keydown.pre = this.utils.isTag(this.keydown.current, 'pre');\n\t\t\t\t\tthis.keydown.blockquote = this.utils.isTag(this.keydown.current, 'blockquote');\n\t\t\t\t\tthis.keydown.figcaption = this.utils.isTag(this.keydown.current, 'figcaption');\n\n\t\t\t\t\t// shortcuts setup\n\t\t\t\t\tthis.shortcuts.init(e, key);\n\n\t\t\t\t\tthis.keydown.checkEvents(arrow, key);\n\t\t\t\t\tthis.keydown.setupBuffer(e, key);\n\t\t\t\t\tthis.keydown.addArrowsEvent(arrow);\n\t\t\t\t\tthis.keydown.setupSelectAll(e, key);\n\n\t\t\t\t\t// callback\n\t\t\t\t\tvar keydownStop = this.core.setCallback('keydown', e);\n\t\t\t\t\tif (keydownStop === false)\n\t\t\t\t\t{\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\t// ie and ff exit from table\n\t\t\t\t\tif (this.opts.enterKey && (this.utils.browser('msie') || this.utils.browser('mozilla')) && (key === this.keyCode.DOWN || key === this.keyCode.RIGHT))\n\t\t\t\t\t{\n\t\t\t\t\t\tvar isEndOfTable = false;\n\t\t\t\t\t\tvar $table = false;\n\t\t\t\t\t\tif (this.keydown.block && this.keydown.block.tagName === 'TD')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$table = $(this.keydown.block).closest('table');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($table && $table.find('td').last()[0] === this.keydown.block)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tisEndOfTable = true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (this.utils.isEndOfElement() && isEndOfTable)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar node = $(this.opts.emptyHtml);\n\t\t\t\t\t\t\t$table.after(node);\n\t\t\t\t\t\t\tthis.caret.setStart(node);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// down\n\t\t\t\t\tif (this.opts.enterKey && key === this.keyCode.DOWN)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.keydown.onArrowDown();\n\t\t\t\t\t}\n\n\t\t\t\t\t// turn off enter key\n\t\t\t\t\tif (!this.opts.enterKey && key === this.keyCode.ENTER)\n\t\t\t\t\t{\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t// remove selected\n\t\t\t\t\t\tif (!this.range.collapsed) this.range.deleteContents();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// on enter\n\t\t\t\t\tif (key == this.keyCode.ENTER && !e.shiftKey && !e.ctrlKey && !e.metaKey)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar stop = this.core.setCallback('enter', e);\n\t\t\t\t\t\tif (stop === false)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (this.keydown.blockquote && this.keydown.exitFromBlockquote(e) === true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar current, $next;\n\t\t\t\t\t\tif (this.keydown.pre)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn this.keydown.insertNewLine(e);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (this.keydown.blockquote || this.keydown.figcaption)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcurrent = this.selection.getCurrent();\n\t\t\t\t\t\t\t$next = $(current).next();\n\n\t\t\t\t\t\t\tif ($next.length !== 0 && $next[0].tagName == 'BR')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn this.keydown.insertBreakLine(e);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (this.utils.isEndOfElement() && (current && current != 'SPAN'))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn this.keydown.insertDblBreakLine(e);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn this.keydown.insertBreakLine(e);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (this.opts.linebreaks && !this.keydown.block)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcurrent = this.selection.getCurrent();\n\t\t\t\t\t\t\t$next = $(this.keydown.current).next();\n\n\n\n\t\t\t\t\t\t\tif ($next.length !== 0 && $next[0].tagName == 'BR')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn this.keydown.insertBreakLine(e);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (current !== false && $(current).hasClass('redactor-invisible-space'))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.caret.setAfter(current);\n\t\t\t\t\t\t\t\t$(current).contents().unwrap();\n\n\t\t\t\t\t\t\t\treturn this.keydown.insertDblBreakLine(e);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (this.utils.isEndOfEditor())\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\treturn this.keydown.insertDblBreakLine(e);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if ($next.length === 0 && current === false && typeof $next.context != 'undefined')\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\treturn this.keydown.insertBreakLine(e);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn this.keydown.insertBreakLine(e);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (this.opts.linebreaks && this.keydown.block)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsetTimeout($.proxy(this.keydown.replaceDivToBreakLine, this), 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// paragraphs\n\t\t\t\t\t\telse if (!this.opts.linebreaks && this.keydown.block)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (this.keydown.block.tagName !== 'LI')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tsetTimeout($.proxy(this.keydown.replaceDivToParagraph, this), 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcurrent = this.selection.getCurrent();\n\t\t\t\t\t\t\t\tvar $parent = $(current).closest('li');\n\t\t\t\t\t\t\t\tvar $list = $parent.closest('ul,ol');\n\n\t\t\t\t\t\t\t\tif ($parent.length !== 0 && this.utils.isEmpty($parent.html()) && $list.next().length === 0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar node = $(this.opts.emptyHtml);\n\t\t\t\t\t\t\t\t\t$list.after(node);\n\t\t\t\t\t\t\t\t\tthis.caret.setStart(node);\n\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (!this.opts.linebreaks && !this.keydown.block)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn this.keydown.insertParagraph(e);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Shift+Enter or Ctrl+Enter\n\t\t\t\t\tif (key === this.keyCode.ENTER && (e.ctrlKey || e.shiftKey))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn this.keydown.onShiftEnter(e);\n\t\t\t\t\t}\n\n\n\t\t\t\t\t// tab or cmd + [\n\t\t\t\t\tif (key === this.keyCode.TAB || e.metaKey && key === 221 || e.metaKey && key === 219)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn this.keydown.onTab(e, key);\n\t\t\t\t\t}\n\n\t\t\t\t\t// image delete and backspace\n\t\t\t\t\tif (key === this.keyCode.BACKSPACE || key === this.keyCode.DELETE)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.utils.browser('mozilla') && this.keydown.current && this.keydown.current.tagName === 'TD')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar nodes = this.selection.getNodes();\n\t\t\t\t\t\tif (nodes)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar len = nodes.length;\n\t\t\t\t\t\t\tvar last;\n\t\t\t\t\t\t\tfor (var i = 0; i < len; i++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar children = $(nodes[i]).children('img');\n\t\t\t\t\t\t\t\tif (children.length !== 0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar self = this;\n\t\t\t\t\t\t\t\t\t$.each(children, function(z,s)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar $s = $(s);\n\t\t\t\t\t\t\t\t\t\tif ($s.css('float') != 'none') return;\n\n\t\t\t\t\t\t\t\t\t\t// image delete callback\n\t\t\t\t\t\t\t\t\t\tself.core.setCallback('imageDelete', s.src, $s);\n\t\t\t\t\t\t\t\t\t\tlast = s;\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (nodes[i].tagName == 'IMG')\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (last != nodes[i])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t// image delete callback\n\t\t\t\t\t\t\t\t\t\tthis.core.setCallback('imageDelete', nodes[i].src, $(nodes[i]));\n\t\t\t\t\t\t\t\t\t\tlast = nodes[i];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// backspace\n\t\t\t\t\tif (key === this.keyCode.BACKSPACE)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.keydown.removeInvisibleSpace();\n\t\t\t\t\t\tthis.keydown.removeEmptyListInTable(e);\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.code.sync();\n\t\t\t\t},\n\t\t\t\tcheckEvents: function(arrow, key)\n\t\t\t\t{\n\t\t\t\t\tif (!arrow && (this.core.getEvent() == 'click' || this.core.getEvent() == 'arrow'))\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.core.addEvent(false);\n\n\t\t\t\t\t\tif (this.keydown.checkKeyEvents(key))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.buffer.set();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tcheckKeyEvents: function(key)\n\t\t\t\t{\n\t\t\t\t\tvar k = this.keyCode;\n\t\t\t\t\tvar keys = [k.BACKSPACE, k.DELETE, k.ENTER, k.SPACE, k.ESC, k.TAB, k.CTRL, k.META, k.ALT, k.SHIFT];\n\n\t\t\t\t\treturn ($.inArray(key, keys) == -1) ? true : false;\n\n\t\t\t\t},\n\t\t\t\taddArrowsEvent: function(arrow)\n\t\t\t\t{\n\t\t\t\t\tif (!arrow) return;\n\n\t\t\t\t\tif ((this.core.getEvent() == 'click' || this.core.getEvent() == 'arrow'))\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.core.addEvent(false);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t this.core.addEvent('arrow');\n\t\t\t\t},\n\t\t\t\tsetupBuffer: function(e, key)\n\t\t\t\t{\n\t\t\t\t\tif (this.keydown.ctrl && key === 90 && !e.shiftKey && !e.altKey && this.opts.buffer.length) // z key\n\t\t\t\t\t{\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\tthis.buffer.undo();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t// undo\n\t\t\t\t\telse if (this.keydown.ctrl && key === 90 && e.shiftKey && !e.altKey && this.opts.rebuffer.length !== 0)\n\t\t\t\t\t{\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\tthis.buffer.redo();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\telse if (!this.keydown.ctrl)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (key == this.keyCode.BACKSPACE || key == this.keyCode.DELETE || (key == this.keyCode.ENTER && !e.ctrlKey && !e.shiftKey) || key == this.keyCode.SPACE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.buffer.set();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tsetupSelectAll: function(e, key)\n\t\t\t\t{\n\t\t\t\t\tif (this.keydown.ctrl && key === 65)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.utils.enableSelectAll();\n\t\t\t\t\t}\n\t\t\t\t\telse if (key != this.keyCode.LEFT_WIN && !this.keydown.ctrl)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.utils.disableSelectAll();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonArrowDown: function()\n\t\t\t\t{\n\t\t\t\t\tvar tags = [this.keydown.blockquote, this.keydown.pre, this.keydown.figcaption];\n\n\t\t\t\t\tfor (var i = 0; i < tags.length; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (tags[i])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.keydown.insertAfterLastElement(tags[i]);\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonShiftEnter: function(e)\n\t\t\t\t{\n\t\t\t\t\tthis.buffer.set();\n\n\t\t\t\t\tif (this.utils.isEndOfElement())\n\t\t\t\t\t{\n\t\t\t\t\t\treturn this.keydown.insertDblBreakLine(e);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this.keydown.insertBreakLine(e);\n\t\t\t\t},\n\t\t\t\tonTab: function(e, key)\n\t\t\t\t{\n\t\t\t\t\tif (!this.opts.tabKey) return true;\n\t\t\t\t\tif (this.utils.isEmpty(this.code.get()) && this.opts.tabAsSpaces === false) return true;\n\n\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\tvar node;\n\t\t\t\t\tif (this.keydown.pre && !e.shiftKey)\n\t\t\t\t\t{\n\t\t\t\t\t\tnode = (this.opts.preSpaces) ? document.createTextNode(Array(this.opts.preSpaces + 1).join('\\u00a0')) : document.createTextNode('\\t');\n\t\t\t\t\t\tthis.insert.node(node);\n\t\t\t\t\t\tthis.code.sync();\n\t\t\t\t\t}\n\t\t\t\t\telse if (this.opts.tabAsSpaces !== false)\n\t\t\t\t\t{\n\t\t\t\t\t\tnode = document.createTextNode(Array(this.opts.tabAsSpaces + 1).join('\\u00a0'));\n\t\t\t\t\t\tthis.insert.node(node);\n\t\t\t\t\t\tthis.code.sync();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif (e.metaKey && key === 219) this.indent.decrease();\n\t\t\t\t\t\telse if (e.metaKey && key === 221) this.indent.increase();\n\t\t\t\t\t\telse if (!e.shiftKey) this.indent.increase();\n\t\t\t\t\t\telse this.indent.decrease();\n\t\t\t\t\t}\n\n\t\t\t\t\treturn false;\n\t\t\t\t},\n\t\t\t\treplaceDivToBreakLine: function()\n\t\t\t\t{\n\t\t\t\t\tvar blockElem = this.selection.getBlock();\n\t\t\t\t\tvar blockHtml = blockElem.innerHTML.replace(//gi, '');\n\t\t\t\t\tif ((blockElem.tagName === 'DIV' || blockElem.tagName === 'P') && blockHtml === '' && !$(blockElem).hasClass('redactor-editor'))\n\t\t\t\t\t{\n\t\t\t\t\t\tvar br = document.createElement('br');\n\n\t\t\t\t\t\t$(blockElem).replaceWith(br);\n\t\t\t\t\t\tthis.caret.setBefore(br);\n\n\t\t\t\t\t\tthis.code.sync();\n\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\treplaceDivToParagraph: function()\n\t\t\t\t{\n\t\t\t\t\tvar blockElem = this.selection.getBlock();\n\t\t\t\t\tvar blockHtml = blockElem.innerHTML.replace(//gi, '');\n\t\t\t\t\tif (blockElem.tagName === 'DIV' && blockHtml === '' && !$(blockElem).hasClass('redactor-editor'))\n\t\t\t\t\t{\n\t\t\t\t\t\tvar p = document.createElement('p');\n\t\t\t\t\t\tp.innerHTML = this.opts.invisibleSpace;\n\n\t\t\t\t\t\t$(blockElem).replaceWith(p);\n\t\t\t\t\t\tthis.caret.setStart(p);\n\n\t\t\t\t\t\tthis.code.sync();\n\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\telse if (this.opts.cleanStyleOnEnter && blockElem.tagName == 'P')\n\t\t\t\t\t{\n\t\t\t\t\t\t$(blockElem).removeAttr('class').removeAttr('style');\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tinsertParagraph: function(e)\n\t\t\t\t{\n\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\tthis.selection.get();\n\n\t\t\t\t\tvar p = document.createElement('p');\n\t\t\t\t\tp.innerHTML = this.opts.invisibleSpace;\n\n\t\t\t\t\tthis.range.deleteContents();\n\t\t\t\t\tthis.range.insertNode(p);\n\n\t\t\t\t\tthis.caret.setStart(p);\n\n\t\t\t\t\tthis.code.sync();\n\n\t\t\t\t\treturn false;\n\t\t\t\t},\n\t\t\t\texitFromBlockquote: function(e)\n\t\t\t\t{\n\t\t\t\t\tif (!this.utils.isEndOfElement()) return;\n\n\t\t\t\t\tvar tmp = $.trim($(this.keydown.block).html());\n\t\t\t\t\tif (tmp.search(/(){2}$/i) != -1)\n\t\t\t\t\t{\n\t\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\t\tif (this.opts.linebreaks)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar br = document.createElement('br');\n\t\t\t\t\t\t\t$(this.keydown.blockquote).after(br);\n\n\t\t\t\t\t\t\tthis.caret.setBefore(br);\n\t\t\t\t\t\t\t$(this.keydown.block).html(tmp.replace(/$/i, ''));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar node = $(this.opts.emptyHtml);\n\t\t\t\t\t\t\t$(this.keydown.blockquote).after(node);\n\t\t\t\t\t\t\tthis.caret.setStart(node);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn true;\n\n\t\t\t\t\t}\n\n\t\t\t\t\treturn;\n\n\t\t\t\t},\n\t\t\t\tinsertAfterLastElement: function(element)\n\t\t\t\t{\n\t\t\t\t\tif (!this.utils.isEndOfElement()) return;\n\n\t\t\t\t\tthis.buffer.set();\n\n\t\t\t\t\tif (this.opts.linebreaks)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar contents = $('
    ').append($.trim(this.$editor.html())).contents();\n\t\t\t\t\t\tvar last = contents.last()[0];\n\t\t\t\t\t\tif (last.tagName == 'SPAN' && last.innerHTML === '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlast = contents.prev()[0];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (this.utils.getOuterHtml(last) != this.utils.getOuterHtml(element)) return;\n\n\t\t\t\t\t\tvar br = document.createElement('br');\n\t\t\t\t\t\t$(element).after(br);\n\t\t\t\t\t\tthis.caret.setAfter(br);\n\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.$editor.contents().last()[0] !== element) return;\n\n\t\t\t\t\t\tvar node = $(this.opts.emptyHtml);\n\t\t\t\t\t\t$(element).after(node);\n\t\t\t\t\t\tthis.caret.setStart(node);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tinsertNewLine: function(e)\n\t\t\t\t{\n\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\tvar node = document.createTextNode('\\n');\n\n\t\t\t\t\tthis.selection.get();\n\n\t\t\t\t\tthis.range.deleteContents();\n\t\t\t\t\tthis.range.insertNode(node);\n\n\t\t\t\t\tthis.caret.setAfter(node);\n\n\t\t\t\t\tthis.code.sync();\n\n\t\t\t\t\treturn false;\n\t\t\t\t},\n\t\t\t\tinsertBreakLine: function(e)\n\t\t\t\t{\n\t\t\t\t\treturn this.keydown.insertBreakLineProcessing(e);\n\t\t\t\t},\n\t\t\t\tinsertDblBreakLine: function(e)\n\t\t\t\t{\n\t\t\t\t\treturn this.keydown.insertBreakLineProcessing(e, true);\n\t\t\t\t},\n\t\t\t\tinsertBreakLineProcessing: function(e, dbl)\n\t\t\t\t{\n\t\t\t\t\te.stopPropagation();\n\n\t\t\t\t\tthis.selection.get();\n\t\t\t\t\tvar br1 = document.createElement('br');\n\n\t\t\t\t\tif (this.utils.browser('msie'))\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.range.collapse(false);\n\t\t\t\t\t\tthis.range.setEnd(this.range.endContainer, this.range.endOffset);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.range.deleteContents();\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.range.insertNode(br1);\n\n\t\t\t\t\tif (dbl === true)\n\t\t\t\t\t{\n\n\t\t\t\t\t\tvar $next = $(br1).next();\n\t\t\t\t\t\tif ($next.length !== 0 && $next[0].tagName === 'BR' && this.utils.isEndOfEditor())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.caret.setAfter(br1);\n\t\t\t\t\t\t\tthis.code.sync();\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar br2 = document.createElement('br');\n\t\t\t\t\t\tthis.range.insertNode(br2);\n\t\t\t\t\t\tthis.caret.setAfter(br2);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.keydown.insertBreakLineProcessingAfter(br1);\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.code.sync();\n\t\t\t\t\treturn false;\n\t\t\t\t},\n\t\t\t\tinsertBreakLineProcessingAfter: function(node)\n\t\t\t\t{\n\t\t\t\t\tvar space = this.utils.createSpaceElement();\n\t\t\t\t\t$(node).after(space);\n\t\t\t\t\tthis.selection.selectElement(space);\n\n\t\t\t\t\t$(space).replaceWith(function()\n\t\t\t\t\t{\n\t\t\t\t\t\treturn $(this).contents();\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tremoveInvisibleSpace: function()\n\t\t\t\t{\n\t\t\t\t\tvar $current = $(this.keydown.current);\n\t\t\t\t\tif ($current.text().search(/^\\u200B$/g) === 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$current.remove();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tremoveEmptyListInTable: function(e)\n\t\t\t\t{\n\t\t\t\t\tvar $current = $(this.keydown.current);\n\t\t\t\t\tvar $parent = $(this.keydown.parent);\n\t\t\t\t\tvar td = $current.closest('td');\n\n\t\t\t\t\tif (td.length !== 0 && $current.closest('li') && $parent.children('li').length === 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!this.utils.isEmpty($current.text())) return;\n\n\t\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\t\t$current.remove();\n\t\t\t\t\t\t$parent.remove();\n\n\t\t\t\t\t\tthis.caret.setStart(td);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\tkeyup: function()\n\t\t{\n\t\t\treturn {\n\t\t\t\tinit: function(e)\n\t\t\t\t{\n\t\t\t\t\tif (this.rtePaste) return;\n\n\t\t\t\t\tvar key = e.which;\n\n\t\t\t\t\tthis.keyup.current = this.selection.getCurrent();\n\t\t\t\t\tthis.keyup.parent = this.selection.getParent();\n\t\t\t\t\tvar $parent = this.utils.isRedactorParent($(this.keyup.parent).parent());\n\n\t\t\t\t\t// callback\n\t\t\t\t\tvar keyupStop = this.core.setCallback('keyup', e);\n\t\t\t\t\tif (keyupStop === false)\n\t\t\t\t\t{\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\t// replace to p before / after the table or body\n\t\t\t\t\tif (!this.opts.linebreaks && this.keyup.current.nodeType == 3 && this.keyup.current.length <= 1 && (this.keyup.parent === false || this.keyup.parent.tagName == 'BODY'))\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.keyup.replaceToParagraph();\n\t\t\t\t\t}\n\n\t\t\t\t\t// replace div after lists\n\t\t\t\t\tif (!this.opts.linebreaks && this.utils.isRedactorParent(this.keyup.current) && this.keyup.current.tagName === 'DIV')\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.keyup.replaceToParagraph(false);\n\t\t\t\t\t}\n\n\n\t\t\t\t\tif (!this.opts.linebreaks && $(this.keyup.parent).hasClass('redactor-invisible-space') && ($parent === false || $parent[0].tagName == 'BODY'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$(this.keyup.parent).contents().unwrap();\n\t\t\t\t\t\tthis.keyup.replaceToParagraph();\n\t\t\t\t\t}\n\n\t\t\t\t\t// linkify\n\t\t\t\t\tif (this.keyup.isLinkify(key))\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.formatLinkify(this.opts.linkProtocol, this.opts.convertLinks, this.opts.convertUrlLinks, this.opts.convertImageLinks, this.opts.convertVideoLinks, this.opts.linkSize);\n\n\t\t\t\t\t\tthis.observe.load();\n\t\t\t\t\t\tthis.code.sync();\n\t\t\t\t\t}\n\n\t\t\t\t\tif (key === this.keyCode.DELETE || key === this.keyCode.BACKSPACE)\n\t\t\t\t\t{\n\t\t\t\t\t\t// clear unverified\n\t\t\t\t\t\tthis.clean.clearUnverified();\n\n\t\t\t\t\t\tif (this.observe.image)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\t\t\tthis.image.hideResize();\n\n\t\t\t\t\t\t\tthis.buffer.set();\n\t\t\t\t\t\t\tthis.image.remove(this.observe.image);\n\t\t\t\t\t\t\tthis.observe.image = false;\n\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// remove empty paragraphs\n\t\t\t\t\t\tthis.$editor.find('p').each($.proxy(this.utils.removeEmpty, this));\n\n\t\t\t\t\t\t// remove invisible space\n\t\t\t\t\t\tif (this.opts.linebreaks && this.keyup.current && this.keyup.current.tagName == 'DIV' && this.utils.isEmpty(this.keyup.current.innerHTML))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$(this.keyup.current).after(this.selection.getMarkerAsHtml());\n\t\t\t\t\t\t\tthis.selection.restore();\n\t\t\t\t\t\t\t$(this.keyup.current).remove();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// if empty\n\t\t\t\t\t\treturn this.keyup.formatEmpty(e);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tisLinkify: function(key)\n\t\t\t\t{\n\t\t\t\t\treturn this.opts.convertLinks && (this.opts.convertUrlLinks || this.opts.convertImageLinks || this.opts.convertVideoLinks) && key === this.keyCode.ENTER && !this.utils.isCurrentOrParent('PRE');\n\t\t\t\t},\n\t\t\t\treplaceToParagraph: function(clone)\n\t\t\t\t{\n\t\t\t\t\tvar $current = $(this.keyup.current);\n\n\t\t\t\t\tvar node;\n\t\t\t\t\tif (clone === false)\n\t\t\t\t\t{\n\t\t\t\t\t\tnode = $('

    ').append($current.html());\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnode = $('

    ').append($current.clone());\n\t\t\t\t\t}\n\n\t\t\t\t\t$current.replaceWith(node);\n\t\t\t\t\tvar next = $(node).next();\n\t\t\t\t\tif (typeof(next[0]) !== 'undefined' && next[0].tagName == 'BR')\n\t\t\t\t\t{\n\t\t\t\t\t\tnext.remove();\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.caret.setEnd(node);\n\t\t\t\t},\n\t\t\t\tformatEmpty: function(e)\n\t\t\t\t{\n\t\t\t\t\tvar html = $.trim(this.$editor.html());\n\n\t\t\t\t\tif (!this.utils.isEmpty(html)) return;\n\n\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\tif (this.opts.linebreaks)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.$editor.html(this.selection.getMarkerAsHtml());\n\t\t\t\t\t\tthis.selection.restore();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\thtml = '


    ';\n\n\t\t\t\t\t\tthis.$editor.html(html);\n\t\t\t\t\t\tthis.focus.setStart();\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.code.sync();\n\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\tlang: function()\n\t\t{\n\t\t\treturn {\n\t\t\t\tload: function()\n\t\t\t\t{\n\t\t\t\t\tthis.opts.curLang = this.opts.langs[this.opts.lang];\n\t\t\t\t},\n\t\t\t\tget: function(name)\n\t\t\t\t{\n\t\t\t\t\treturn (typeof this.opts.curLang[name] != 'undefined') ? this.opts.curLang[name] : '';\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\tline: function()\n\t\t{\n\t\t\treturn {\n\t\t\t\tinsert: function()\n\t\t\t\t{\n\t\t\t\t\tthis.buffer.set();\n\n\t\t\t\t\tvar blocks = this.selection.getBlocks();\n \t\t\t\t\tif (blocks[0] !== false && this.line.isExceptLastOrFirst(blocks))\n\t \t\t\t\t{\n\t \t\t\t\t\tif (!this.utils.browser('msie')) this.$editor.focus();\n\t \t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (this.utils.browser('msie'))\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.line.insertInIe();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.line.insertInOthersBrowsers();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tisExceptLastOrFirst: function(blocks)\n\t\t\t\t{\n\t\t\t\t\tvar exceptTags = ['li', 'td', 'th', 'blockquote', 'figcaption', 'pre', 'dl', 'dt', 'dd'];\n\n\t\t\t\t\tvar first = blocks[0].tagName.toLowerCase();\n\t\t\t\t\tvar last = this.selection.getLastBlock();\n\n\t\t\t\t\tlast = (typeof last == 'undefined') ? first : last.tagName.toLowerCase();\n\n\t\t\t\t\tvar firstFound = $.inArray(first, exceptTags) != -1;\n\t\t\t\t\tvar lastFound = $.inArray(last, exceptTags) != -1;\n\n\t\t\t\t\tif ((firstFound && lastFound) || firstFound)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tinsertInIe: function()\n\t\t\t\t{\n\t\t\t\t\tthis.utils.saveScroll();\n\t\t\t\t\tthis.buffer.set();\n\n\t\t\t\t\tthis.insert.node(document.createElement('hr'));\n\n\t\t\t\t\tthis.utils.restoreScroll();\n\t\t\t\t\tthis.code.sync();\n\t\t\t\t},\n\t\t\t\tinsertInOthersBrowsers: function()\n\t\t\t\t{\n\t\t\t\t\tthis.buffer.set();\n\n\t\t\t\t\tvar extra = '


    ';\n\t\t\t\t\tif (this.opts.linebreaks) extra = '
    ';\n\n\t\t\t\t\tdocument.execCommand('insertHTML', false, '
    ' + extra);\n\n\t\t\t\t\tthis.line.setFocus();\n\t\t\t\t\tthis.code.sync();\n\t\t\t\t},\n\t\t\t\tsetFocus: function()\n\t\t\t\t{\n\t\t\t\t\tvar node = this.$editor.find('#redactor-insert-line');\n\t\t\t\t\tvar next = $(node).next()[0];\n\n\t\t\t\t\tif (next)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.caret.setAfter(node);\n\t\t\t\t\t\tnode.remove();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnode.removeAttr('id');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\tlink: function()\n\t\t{\n\t\t\treturn {\n\t\t\t\tshow: function(e)\n\t\t\t\t{\n\t\t\t\t\tif (typeof e != 'undefined' && e.preventDefault) e.preventDefault();\n\n\t\t\t\t\tthis.modal.load('link', this.lang.get('link_insert'), 600);\n\n\t\t\t\t\tthis.modal.createCancelButton();\n\t\t\t\t\tthis.link.buttonInsert = this.modal.createActionButton(this.lang.get('insert'));\n\n\t\t\t\t\tthis.selection.get();\n\n\t\t\t\t\tthis.link.getData();\n\t\t\t\t\tthis.link.cleanUrl();\n\n\t\t\t\t\tif (this.link.target == '_blank') $('#redactor-link-blank').prop('checked', true);\n\n\t\t\t\t\tthis.link.$inputUrl = $('#redactor-link-url');\n\t\t\t\t\tthis.link.$inputText = $('#redactor-link-url-text');\n\n\t\t\t\t\tthis.link.$inputText.val(this.link.text);\n\t\t\t\t\tthis.link.$inputUrl.val(this.link.url);\n\n\t\t\t\t\tthis.link.buttonInsert.on('click', $.proxy(this.link.insert, this));\n\n\t\t\t\t\t// hide link's tooltip\n\t\t\t\t\t$('.redactor-link-tooltip').remove();\n\n\t\t\t\t\t// show modal\n\t\t\t\t\tthis.selection.save();\n\t\t\t\t\tthis.modal.show();\n\t\t\t\t\tthis.link.$inputUrl.focus();\n\t\t\t\t},\n\t\t\t\tcleanUrl: function()\n\t\t\t\t{\n\t\t\t\t\tvar thref = self.location.href.replace(/\\/$/i, '');\n\t\t\t\t\tthis.link.url = this.link.url.replace(thref, '');\n\t\t\t\t\tthis.link.url = this.link.url.replace(/^\\/#/, '#');\n\t\t\t\t\tthis.link.url = this.link.url.replace('mailto:', '');\n\n\t\t\t\t\t// remove host from href\n\t\t\t\t\tif (!this.opts.linkProtocol)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar re = new RegExp('^(http|ftp|https)://' + self.location.host, 'i');\n\t\t\t\t\t\tthis.link.url = this.link.url.replace(re, '');\n\t\t\t\t\t}\n\n\t\t\t\t},\n\t\t\t\tgetData: function()\n\t\t\t\t{\n\t\t\t\t\tthis.link.$node = false;\n\n\t\t\t\t\tvar $el = $(this.selection.getCurrent()).closest('a');\n\t\t\t\t\tif ($el.length !== 0 && $el[0].tagName === 'A')\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.link.$node = $el;\n\n\t\t\t\t\t\tthis.link.url = $el.attr('href');\n\t\t\t\t\t\tthis.link.text = $el.text();\n\t\t\t\t\t\tthis.link.target = $el.attr('target');\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.link.text = this.sel.toString();\n\t\t\t\t\t\tthis.link.url = '';\n\t\t\t\t\t\tthis.link.target = '';\n\t\t\t\t\t}\n\n\t\t\t\t},\n\t\t\t\tinsert: function()\n\t\t\t\t{\n\t\t\t\t\tvar target = '';\n\t\t\t\t\tvar link = this.link.$inputUrl.val();\n\t\t\t\t\tvar text = this.link.$inputText.val();\n\n\t\t\t\t\tif ($.trim(link) === '')\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.link.$inputUrl.addClass('redactor-input-error').on('keyup', function()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$(this).removeClass('redactor-input-error');\n\t\t\t\t\t\t\t$(this).off('keyup');\n\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// mailto\n\t\t\t\t\tif (link.search('@') != -1 && /(http|ftp|https):\\/\\//i.test(link) === false)\n\t\t\t\t\t{\n\t\t\t\t\t\tlink = 'mailto:' + link;\n\t\t\t\t\t}\n\t\t\t\t\t// url, not anchor\n\t\t\t\t\telse if (link.search('#') !== 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($('#redactor-link-blank').prop('checked'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttarget = '_blank';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// test url (add protocol)\n\t\t\t\t\t\tvar pattern = '((xn--)?[a-z0-9]+(-[a-z0-9]+)*\\\\.)+[a-z]{2,}';\n\t\t\t\t\t\tvar re = new RegExp('^(http|ftp|https)://' + pattern, 'i');\n\t\t\t\t\t\tvar re2 = new RegExp('^' + pattern, 'i');\n\t\t\t\t\t\tvar re3 = new RegExp('\\.(html|php)$', 'i');\n\t\t\t\t\t\tif (link.search(re) == -1 && link.search(re3) == -1 && link.search(re2) === 0 && this.opts.linkProtocol)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlink = this.opts.linkProtocol + '://' + link;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.link.set(text, link, target);\n\t\t\t\t\tthis.modal.close();\n\t\t\t\t},\n\t\t\t\tset: function(text, link, target)\n\t\t\t\t{\n\t\t\t\t\ttext = $.trim(text.replace(/<|>/g, ''));\n\n\t\t\t\t\tthis.selection.restore();\n\n\t\t\t\t\tif (text === '' && link === '') return;\n\t\t\t\t\tif (text === '' && link !== '') text = link;\n\n\t\t\t\t\tif (this.link.$node)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.buffer.set();\n\n\t\t\t\t\t\tthis.link.$node.text(text).attr('href', link);\n\t\t\t\t\t\tif (target !== '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.link.$node.attr('target', target);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.link.$node.removeAttr('target');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis.code.sync();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.utils.browser('mozilla') && this.link.text === '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar $a = $('').attr('href', link).text(text);\n\t\t\t\t\t\t\tif (target !== '') $a.attr('target', target);\n\n\t\t\t\t\t\t\tthis.insert.node($a);\n\t\t\t\t\t\t\tthis.selection.selectElement($a);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar $a;\n\t\t\t\t\t\t\tif (this.utils.browser('msie'))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$a = $('').text(text);\n\t\t\t\t\t\t\t\tif (target !== '') $a.attr('target', target);\n\n\t\t\t\t\t\t\t\t$a = $(this.insert.node($a));\n\t\t\t\t\t\t\t\tthis.selection.selectElement($a);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdocument.execCommand('createLink', false, link);\n\n\t\t\t\t\t\t\t\t$a = $(this.selection.getCurrent()).closest('a');\n\t\t\t\t\t\t\t\tif (this.utils.browser('mozilla'))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$a = $('a[_moz_dirty=\"\"]');\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (target !== '') $a.attr('target', target);\n\t\t\t\t\t\t\t\t$a.removeAttr('style').removeAttr('_moz_dirty');\n\n\t\t\t\t\t\t\t\tif (this.link.text !== '' || this.link.text != text)\n\t\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t\t$a.text(text);\n\t\t\t\t\t\t\t\t\tthis.selection.selectElement($a);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis.code.sync();\n\t\t\t\t\t\tthis.core.setCallback('insertedLink', $a);\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// link tooltip\n\t\t\t\t\tsetTimeout($.proxy(function()\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.observe.links();\n\n\t\t\t\t\t}, this), 5);\n\t\t\t\t},\n\t\t\t\tunlink: function(e)\n\t\t\t\t{\n\t\t\t\t\tif (typeof e != 'undefined' && e.preventDefault)\n\t\t\t\t\t{\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t}\n\n\t\t\t\t\tvar nodes = this.selection.getNodes();\n\t\t\t\t\tif (!nodes) return;\n\n\t\t\t\t\tthis.buffer.set();\n\n\t\t\t\t\tvar len = nodes.length;\n\t\t\t\t\tfor (var i = 0; i < len; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar $node = $(nodes[i]).closest('a');\n\t\t\t\t\t\t$node.replaceWith($node.contents());\n\t\t\t\t\t}\n\n\t\t\t\t\t// hide link's tooltip\n\t\t\t\t\t$('.redactor-link-tooltip').remove();\n\n\t\t\t\t\tthis.code.sync();\n\n\t\t\t\t},\n\t\t\t\ttoggleClass: function(className)\n\t\t\t\t{\n\t\t\t\t\tthis.link.setClass(className, 'toggleClass');\n\t\t\t\t},\n\t\t\t\taddClass: function(className)\n\t\t\t\t{\n\t\t\t\t\tthis.link.setClass(className, 'addClass');\n\t\t\t\t},\n\t\t\t\tremoveClass: function(className)\n\t\t\t\t{\n\t\t\t\t\tthis.link.setClass(className, 'removeClass');\n\t\t\t\t},\n\t\t\t\tsetClass: function(className, func)\n\t\t\t\t{\n\t\t\t\t\tvar links = this.selection.getInlinesTags(['a']);\n\t\t\t\t\tif (links === false) return;\n\n\t\t\t\t\t$.each(links, function()\n\t\t\t\t\t{\n\t\t\t\t\t\t$(this)[func](className);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\tlist: function()\n\t\t{\n\t\t\treturn {\n\t\t\t\ttoggle: function(cmd)\n\t\t\t\t{\n\t\t\t\t\tthis.placeholder.remove();\n\t\t\t\t\tif (!this.utils.browser('msie')) this.$editor.focus();\n\n\t\t\t\t\tthis.buffer.set();\n\t\t\t\t\tthis.selection.save();\n\n\t\t\t\t\tvar parent = this.selection.getParent();\n\t\t\t\t\tvar $list = $(parent).closest('ol, ul');\n\n\t\t\t\t\tif (!this.utils.isRedactorParent($list) && $list.length !== 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$list = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar isUnorderedCmdOrdered, isOrderedCmdUnordered;\n\t\t\t\t\tvar remove = false;\n\t\t\t\t\tif ($list && $list.length)\n\t\t\t\t\t{\n\t\t\t\t\t\tremove = true;\n\t\t\t\t\t\tvar listTag = $list[0].tagName;\n\n\t\t\t\t\t\tisUnorderedCmdOrdered = (cmd === 'orderedlist' && listTag === 'UL');\n\t\t\t\t\t\tisOrderedCmdUnordered = (cmd === 'unorderedlist' && listTag === 'OL');\n\t\t\t\t\t}\n\n\t\t\t\t\tif (isUnorderedCmdOrdered)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.utils.replaceToTag($list, 'ol');\n\t\t\t\t\t}\n\t\t\t\t\telse if (isOrderedCmdUnordered)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.utils.replaceToTag($list, 'ul');\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif (remove)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.list.remove(cmd);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.list.insert(cmd);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\n\t\t\t\t\tthis.selection.restore();\n\t\t\t\t\tthis.code.sync();\n\t\t\t\t},\n\t\t\t\tinsert: function(cmd)\n\t\t\t\t{\n\t\t\t\t\tvar parent = this.selection.getParent();\n\t\t\t\t\tvar current = this.selection.getCurrent();\n\t\t\t\t\tvar $td = $(current).closest('td, th');\n\n\t\t\t\t\tif (this.utils.browser('msie') && this.opts.linebreaks)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.list.insertInIe(cmd);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tdocument.execCommand('insert' + cmd);\n\t\t\t\t\t}\n\n\t\t\t\t\tvar $list = $(this.selection.getParent()).closest('ol, ul');\n\n\t\t\t\t\tif ($td.length !== 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar prev = $td.prev();\n\t\t\t\t\t\tvar html = $td.html();\n\t\t\t\t\t\t$td.html('');\n\t\t\t\t\t\tif (prev && prev.length === 1 && (prev[0].tagName === 'TD' || prev[0].tagName === 'TH'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$(prev).after($td);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$(parent).prepend($td);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$td.html(html);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (this.utils.isEmpty($list.find('li').text()))\n\t\t\t\t\t{\n\t\t\t\t\t\tvar $children = $list.children('li');\n\t\t\t\t\t\t$children.find('br').remove();\n\t\t\t\t\t\t$children.append(this.selection.getMarkerAsHtml());\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($list.length)\n\t\t\t\t\t{\n\t\t\t\t\t\t// remove block-element list wrapper\n\t\t\t\t\t\tvar $listParent = $list.parent();\n\t\t\t\t\t\tif (this.utils.isRedactorParent($listParent) && $listParent[0].tagName != 'LI' && this.utils.isBlock($listParent[0]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$listParent.replaceWith($listParent.contents());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!this.utils.browser('msie'))\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.$editor.focus();\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.clean.clearUnverified();\n\t\t\t\t},\n\t\t\t\tinsertInIe: function(cmd)\n\t\t\t\t{\n\t\t\t\t\tvar wrapper = this.selection.wrap('div');\n\t\t\t\t\tvar wrapperHtml = $(wrapper).html();\n\n\t\t\t\t\tvar tmpList = (cmd == 'orderedlist') ? $('
      ') : $('
    ');\n\n\t\t\t\t\thtml = this.paragraphize.getSafes(html);\n\t\t\t\t\thtml = this.paragraphize.getSafesComments(html);\n\t\t\t\t\thtml = this.paragraphize.replaceBreaksToNewLines(html);\n\t\t\t\t\thtml = this.paragraphize.replaceBreaksToParagraphs(html);\n\t\t\t\t\thtml = this.paragraphize.clear(html);\n\t\t\t\t\thtml = this.paragraphize.restoreSafes(html);\n\n\t\t\t\t\thtml = html.replace(new RegExp('\\n?<(' + this.paragraphize.blocks.join('|') + ')(.*?[^>])>', 'gi'), '


    \\n<$1$2>');\n\n\t\t\t\t\treturn $.trim(html);\n\t\t\t\t},\n\t\t\t\tgetSafes: function(html)\n\t\t\t\t{\n\t\t\t\t\tvar $div = $('
    ').append(html);\n\n\t\t\t\t\t// remove paragraphs in blockquotes\n\t\t\t\t\t$div.find('blockquote p').replaceWith(function()\n\t\t\t\t\t{\n\t\t\t\t\t\treturn $(this).append('
    ').contents();\n\t\t\t\t\t});\n\n\t\t\t\t\thtml = $div.html();\n\n\t\t\t\t\t$div.find(this.paragraphize.blocks.join(', ')).each($.proxy(function(i,s)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.paragraphize.z++;\n\t\t\t\t\t\tthis.paragraphize.safes[this.paragraphize.z] = s.outerHTML;\n\t\t\t\t\t\thtml = html.replace(s.outerHTML, '\\n{replace' + this.paragraphize.z + '}');\n\n\t\t\t\t\t}, this));\n\n\t\t\t\t\treturn html;\n\t\t\t\t},\n\t\t\t\tgetSafesComments: function(html)\n\t\t\t\t{\n\t\t\t\t\tvar commentsMatches = html.match(//gi);\n\n\t\t\t\t\tif (!commentsMatches) return html;\n\n\t\t\t\t\t$.each(commentsMatches, $.proxy(function(i,s)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.paragraphize.z++;\n\t\t\t\t\t\tthis.paragraphize.safes[this.paragraphize.z] = s;\n\t\t\t\t\t\thtml = html.replace(s, '\\n{replace' + this.paragraphize.z + '}');\n\t\t\t\t\t}, this));\n\n\t\t\t\t\treturn html;\n\t\t\t\t},\n\t\t\t\trestoreSafes: function(html)\n\t\t\t\t{\n\t\t\t\t\t$.each(this.paragraphize.safes, function(i,s)\n\t\t\t\t\t{\n\t\t\t\t\t\ts = (typeof s !== 'undefined') ? s.replace(/\\$/g, '$') : s;\n\t\t\t\t\t\thtml = html.replace('{replace' + i + '}', s);\n\n\t\t\t\t\t});\n\n\t\t\t\t\treturn html;\n\t\t\t\t},\n\t\t\t\treplaceBreaksToParagraphs: function(html)\n\t\t\t\t{\n\t\t\t\t\tvar htmls = html.split(new RegExp('\\n', 'g'), -1);\n\n\t\t\t\t\thtml = '';\n\t\t\t\t\tif (htmls)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar len = htmls.length;\n\t\t\t\t\t\tfor (var i = 0; i < len; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (!htmls.hasOwnProperty(i)) return;\n\n\t\t\t\t\t\t\tif (htmls[i].search('{replace') == -1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\thtmls[i] = htmls[i].replace(/

    \\n\\t?<\\/p>/gi, '');\n\t\t\t\t\t\t\t\thtmls[i] = htmls[i].replace(/

    <\\/p>/gi, '');\n\n\t\t\t\t\t\t\t\tif (htmls[i] !== '')\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\thtml += '

    ' + htmls[i].replace(/^\\n+|\\n+$/g, \"\") + \"

    \";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse html += htmls[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn html;\n\t\t\t\t},\n\t\t\t\treplaceBreaksToNewLines: function(html)\n\t\t\t\t{\n\t\t\t\t\thtml = html.replace(/
    \\s*
    /gi, \"\\n\\n\");\n\t\t\t\t\thtml = html.replace(/\\n?/gi, \"\\n

    \");\n\n\t\t\t\t\thtml = html.replace(new RegExp(\"\\r\\n\", 'g'), \"\\n\");\n\t\t\t\t\thtml = html.replace(new RegExp(\"\\r\", 'g'), \"\\n\");\n\t\t\t\t\thtml = html.replace(new RegExp(\"/\\n\\n+/\"), 'g', \"\\n\\n\");\n\n\t\t\t\t\treturn html;\n\t\t\t\t},\n\t\t\t\tclear: function(html)\n\t\t\t\t{\n\t\t\t\t\thtml = html.replace(new RegExp('

    ', 'gi'), '');\n\t\t\t\t\thtml = html.replace(new RegExp('

    ', 'gi'), '');\n\t\t\t\t\thtml = html.replace(new RegExp('

    ', 'gi'), '
    ');\n\t\t\t\t\thtml = html.replace(new RegExp('

    ', 'gi'), '
    ');\n\n\t\t\t\t\thtml = html.replace(new RegExp('

    ', 'gi'), '

    ');\n\t\t\t\t\thtml = html.replace(new RegExp('

    ', 'gi'), '

    ');\n\t\t\t\t\thtml = html.replace(new RegExp('

    \\\\s?

    ', 'gi'), '');\n\t\t\t\t\thtml = html.replace(new RegExp(\"\\n

    \", 'gi'), '

    ');\n\t\t\t\t\thtml = html.replace(new RegExp('

    \\t?\\t?\\n?

    ', 'gi'), '

    ');\n\t\t\t\t\thtml = html.replace(new RegExp('

    \\t*

    ', 'gi'), '');\n\n\t\t\t\t\treturn html;\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\tpaste: function()\n\t\t{\n\t\t\treturn {\n\t\t\t\tinit: function(e)\n\t\t\t\t{\n\t\t\t\t\tif (!this.opts.cleanOnPaste)\n\t\t\t\t\t{\n\t\t\t\t\t\tsetTimeout($.proxy(this.code.sync, this), 1);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.rtePaste = true;\n\n\t\t\t\t\tthis.buffer.set();\n\t\t\t\t\tthis.selection.save();\n\t\t\t\t\tthis.utils.saveScroll();\n\n\t\t\t\t\tthis.paste.createPasteBox();\n\n\t\t\t\t\t$(window).on('scroll.redactor-freeze', $.proxy(function()\n\t\t\t\t\t{\n\t\t\t\t\t\t$(window).scrollTop(this.saveBodyScroll);\n\n\t\t\t\t\t}, this));\n\n\t\t\t\t\tsetTimeout($.proxy(function()\n\t\t\t\t\t{\n\t\t\t\t\t\tvar html = this.$pasteBox.html();\n\n\t\t\t\t\t\tthis.$pasteBox.remove();\n\n\t\t\t\t\t\tthis.selection.restore();\n\t\t\t\t\t\tthis.utils.restoreScroll();\n\n\t\t\t\t\t\tthis.paste.insert(html);\n\n\t\t\t\t\t\t$(window).off('scroll.redactor-freeze');\n\n\t\t\t\t\t}, this), 1);\n\n\t\t\t\t},\n\t\t\t\tcreatePasteBox: function()\n\t\t\t\t{\n\t\t\t\t\tthis.$pasteBox = $('
    ').html('').attr('contenteditable', 'true').css({ position: 'fixed', width: 0, top: 0, left: '-9999px' });\n\n\t\t\t\t\tif (this.utils.browser('msie'))\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.$box.append(this.$pasteBox);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$('body').append(this.$pasteBox);\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.$pasteBox.focus();\n\t\t\t\t},\n\t\t\t\tinsert: function(html)\n\t\t\t\t{\n\t\t\t\t\thtml = this.core.setCallback('pasteBefore', html);\n\n\t\t\t\t\t// clean\n\t\t\t\t\thtml = (this.utils.isSelectAll()) ? this.clean.onPaste(html, false) : this.clean.onPaste(html);\n\n\t\t\t\t\thtml = this.core.setCallback('paste', html);\n\n\t\t\t\t\tif (this.utils.isSelectAll())\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.insert.set(html, false);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.insert.html(html, false);\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.utils.disableSelectAll();\n\t\t\t\t\tthis.rtePaste = false;\n\n\t\t\t\t\tsetTimeout($.proxy(this.clean.clearUnverified, this), 10);\n\n\t\t\t\t\t// clean empty spans\n\t\t\t\t\tsetTimeout($.proxy(function()\n\t\t\t\t\t{\n\t\t\t\t\t\tvar spans = this.$editor.find('span');\n\t\t\t\t\t\t$.each(spans, function(i,s)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar html = s.innerHTML.replace(/[\\u200B-\\u200D\\uFEFF]/, '');\n\t\t\t\t\t\t\tif (html === '' && s.attributes.length === 0) $(s).remove();\n\n\t\t\t\t\t\t});\n\n\t\t\t\t\t}, this), 10);\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\tplaceholder: function()\n\t\t{\n\t\t\treturn {\n\t\t\t\tenable: function()\n\t\t\t\t{\n\t\t\t\t\tif (!this.placeholder.is()) return;\n\n\t\t\t\t\tthis.$editor.attr('placeholder', this.$element.attr('placeholder'));\n\n\t\t\t\t\tthis.placeholder.toggle();\n\t\t\t\t\tthis.$editor.on('keyup.redactor-placeholder', $.proxy(this.placeholder.toggle, this));\n\n\t\t\t\t},\n\t\t\t\ttoggle: function()\n\t\t\t\t{\n\t\t\t\t\tvar func = 'removeClass';\n\t\t\t\t\tif (this.utils.isEmpty(this.$editor.html(), false)) func = 'addClass';\n\t\t\t\t\tthis.$editor[func]('redactor-placeholder');\n\t\t\t\t},\n\t\t\t\tremove: function()\n\t\t\t\t{\n\t\t\t\t\tthis.$editor.removeClass('redactor-placeholder');\n\t\t\t\t},\n\t\t\t\tis: function()\n\t\t\t\t{\n\t\t\t\t\tif (this.opts.placeholder)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn this.$element.attr('placeholder', this.opts.placeholder);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\treturn !(typeof this.$element.attr('placeholder') == 'undefined' || this.$element.attr('placeholder') === '');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\tprogress: function()\n\t\t{\n\t\t\treturn {\n\t\t\t\tshow: function()\n\t\t\t\t{\n\t\t\t\t\t$(document.body).append($('
    '));\n\t\t\t\t\t$('#redactor-progress').fadeIn();\n\t\t\t\t},\n\t\t\t\thide: function()\n\t\t\t\t{\n\t\t\t\t\t$('#redactor-progress').fadeOut(1500, function()\n\t\t\t\t\t{\n\t\t\t\t\t\t$(this).remove();\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t};\n\t\t},\n\t\tselection: function()\n\t\t{\n\t\t\treturn {\n\t\t\t\tget: function()\n\t\t\t\t{\n\t\t\t\t\tthis.sel = document.getSelection();\n\n\t\t\t\t\tif (document.getSelection && this.sel.getRangeAt && this.sel.rangeCount)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.range = this.sel.getRangeAt(0);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.range = document.createRange();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\taddRange: function()\n\t\t\t\t{\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthis.sel.removeAllRanges();\n\t\t\t\t\t} catch (e) {}\n\n\t\t\t\t\tthis.sel.addRange(this.range);\n\t\t\t\t},\n\t\t\t\tgetCurrent: function()\n\t\t\t\t{\n\t\t\t\t\tvar el = false;\n\t\t\t\t\tthis.selection.get();\n\n\t\t\t\t\tif (this.sel && this.sel.rangeCount > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tel = this.sel.getRangeAt(0).startContainer;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this.utils.isRedactorParent(el);\n\t\t\t\t},\n\t\t\t\tgetParent: function(elem)\n\t\t\t\t{\n\t\t\t\t\telem = elem || this.selection.getCurrent();\n\t\t\t\t\tif (elem)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn this.utils.isRedactorParent($(elem).parent()[0]);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn false;\n\t\t\t\t},\n\t\t\t\tgetBlock: function(node)\n\t\t\t\t{\n\t\t\t\t\tnode = node || this.selection.getCurrent();\n\n\t\t\t\t\twhile (node)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.utils.isBlockTag(node.tagName))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn ($(node).hasClass('redactor-editor')) ? false : node;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tnode = node.parentNode;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn false;\n\t\t\t\t},\n\t\t\t\tgetInlines: function(nodes, tags)\n\t\t\t\t{\n\t\t\t\t\tthis.selection.get();\n\n\t\t\t\t\tif (this.range && this.range.collapsed)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar inlines = [];\n\t\t\t\t\tnodes = (typeof nodes == 'undefined' || nodes === false) ? this.selection.getNodes() : nodes;\n\t\t\t\t\tvar inlineTags = this.opts.inlineTags;\n\t\t\t\t\tinlineTags.push('span');\n\n\t\t\t\t\tif (typeof tags !== 'undefined')\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (var i = 0; i < tags.length; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinlineTags.push(tags[i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$.each(nodes, $.proxy(function(i,node)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($.inArray(node.tagName.toLowerCase(), inlineTags) != -1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinlines.push(node);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}, this));\n\n\t\t\t\t\treturn (inlines.length === 0) ? false : inlines;\n\t\t\t\t},\n\t\t\t\tgetInlinesTags: function(tags)\n\t\t\t\t{\n\t\t\t\t\tthis.selection.get();\n\n\t\t\t\t\tif (this.range && this.range.collapsed)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar inlines = [];\n\t\t\t\t\tvar nodes = this.selection.getNodes();\n\t\t\t\t\t$.each(nodes, $.proxy(function(i,node)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($.inArray(node.tagName.toLowerCase(), tags) != -1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinlines.push(node);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}, this));\n\n\t\t\t\t\treturn (inlines.length === 0) ? false : inlines;\n\t\t\t\t},\n\t\t\t\tgetBlocks: function(nodes)\n\t\t\t\t{\n\t\t\t\t\tthis.selection.get();\n\n\t\t\t\t\tif (this.range && this.range.collapsed)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn [this.selection.getBlock()];\n\t\t\t\t\t}\n\n\t\t\t\t\tvar blocks = [];\n\t\t\t\t\tnodes = (typeof nodes == 'undefined') ? this.selection.getNodes() : nodes;\n\t\t\t\t\t$.each(nodes, $.proxy(function(i,node)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.utils.isBlock(node))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.selection.lastBlock = node;\n\t\t\t\t\t\t\tblocks.push(node);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}, this));\n\n\t\t\t\t\treturn (blocks.length === 0) ? [this.selection.getBlock()] : blocks;\n\t\t\t\t},\n\t\t\t\tgetLastBlock: function()\n\t\t\t\t{\n\t\t\t\t\treturn this.selection.lastBlock;\n\t\t\t\t},\n\t\t\t\tgetNodes: function()\n\t\t\t\t{\n\t\t\t\t\tthis.selection.get();\n\n\t\t\t\t\tvar startNode = this.selection.getNodesMarker(1);\n\t\t\t\t\tvar endNode = this.selection.getNodesMarker(2);\n\t\t\t\t\tvar range = this.range.cloneRange();\n\n\t\t\t\t\tif (this.range.collapsed === false)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar startContainer = range.startContainer;\n\t\t\t\t\t\tvar startOffset = range.startOffset;\n\n\t\t\t\t\t\t// end marker\n\t\t\t\t\t\tthis.selection.setNodesMarker(range, endNode, false);\n\n\t\t\t\t\t\t// start marker\n\t\t\t\t\t\trange.setStart(startContainer, startOffset);\n\t\t\t\t\t\tthis.selection.setNodesMarker(range, startNode, true);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.selection.setNodesMarker(range, startNode, true);\n\t\t\t\t\t\tendNode = startNode;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar nodes = [];\n\t\t\t\t\tvar counter = 0;\n\n\t\t\t\t\tvar self = this;\n\t\t\t\t\tthis.$editor.find('*').each(function()\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this == startNode)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar parent = $(this).parent();\n\t\t\t\t\t\t\tif (parent.length !== 0 && parent[0].tagName != 'BODY' && self.utils.isRedactorParent(parent[0]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tnodes.push(parent[0]);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tnodes.push(this);\n\t\t\t\t\t\t\tcounter = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (counter > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tnodes.push(this);\n\t\t\t\t\t\t\t\tcounter = counter + 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (this == endNode)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\n\t\t\t\t\tvar finalNodes = [];\n\t\t\t\t\tvar len = nodes.length;\n\t\t\t\t\tfor (var i = 0; i < len; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (nodes[i].id != 'nodes-marker-1' && nodes[i].id != 'nodes-marker-2')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfinalNodes.push(nodes[i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.selection.removeNodesMarkers();\n\n\t\t\t\t\treturn finalNodes;\n\n\t\t\t\t},\n\t\t\t\tgetNodesMarker: function(num)\n\t\t\t\t{\n\t\t\t\t\treturn $('' + this.opts.invisibleSpace + '')[0];\n\t\t\t\t},\n\t\t\t\tsetNodesMarker: function(range, node, type)\n\t\t\t\t{\n\t\t\t\t\ttry {\n\t\t\t\t\t\trange.collapse(type);\n\t\t\t\t\t\trange.insertNode(node);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (e) {}\n\t\t\t\t},\n\t\t\t\tremoveNodesMarkers: function()\n\t\t\t\t{\n\t\t\t\t\t$(document).find('span.redactor-nodes-marker').remove();\n\t\t\t\t\tthis.$editor.find('span.redactor-nodes-marker').remove();\n\t\t\t\t},\n\t\t\t\tfromPoint: function(start, end)\n\t\t\t\t{\n\t\t\t\t\tthis.caret.setOffset(start, end);\n\t\t\t\t},\n\t\t\t\twrap: function(tag)\n\t\t\t\t{\n\t\t\t\t\tthis.selection.get();\n\n\t\t\t\t\tif (this.range.collapsed) return false;\n\n\t\t\t\t\tvar wrapper = document.createElement(tag);\n\t\t\t\t\twrapper.appendChild(this.range.extractContents());\n\t\t\t\t\tthis.range.insertNode(wrapper);\n\n\t\t\t\t\treturn wrapper;\n\t\t\t\t},\n\t\t\t\tselectElement: function(node)\n\t\t\t\t{\n\t\t\t\t\tthis.caret.set(node, 0, node, 1);\n\t\t\t\t},\n\t\t\t\tselectAll: function()\n\t\t\t\t{\n\t\t\t\t\tthis.selection.get();\n\t\t\t\t\tthis.range.selectNodeContents(this.$editor[0]);\n\t\t\t\t\tthis.selection.addRange();\n\t\t\t\t},\n\t\t\t\tremove: function()\n\t\t\t\t{\n\t\t\t\t\tthis.selection.get();\n\t\t\t\t\tthis.sel.removeAllRanges();\n\t\t\t\t},\n\t\t\t\tsave: function()\n\t\t\t\t{\n\t\t\t\t\tthis.selection.createMarkers();\n\t\t\t\t},\n\t\t\t\tcreateMarkers: function()\n\t\t\t\t{\n\t\t\t\t\tthis.selection.get();\n\n\t\t\t\t\tvar node1 = this.selection.getMarker(1);\n\n\t\t\t\t\tthis.selection.setMarker(this.range, node1, true);\n\n\t\t\t\t\tif (this.range.collapsed === false)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar node2 = this.selection.getMarker(2);\n\t\t\t\t\t\tthis.selection.setMarker(this.range, node2, false);\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.savedSel = this.$editor.html();\n\t\t\t\t},\n\t\t\t\tgetMarker: function(num)\n\t\t\t\t{\n\t\t\t\t\tif (typeof num == 'undefined') num = 1;\n\n\t\t\t\t\treturn $('' + this.opts.invisibleSpace + '')[0];\n\t\t\t\t},\n\t\t\t\tgetMarkerAsHtml: function(num)\n\t\t\t\t{\n\t\t\t\t\treturn this.utils.getOuterHtml(this.selection.getMarker(num));\n\t\t\t\t},\n\t\t\t\tsetMarker: function(range, node, type)\n\t\t\t\t{\n\t\t\t\t\trange = range.cloneRange();\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\trange.collapse(type);\n\t\t\t\t\t\trange.insertNode(node);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (e)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.focus.setStart();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\trestore: function()\n\t\t\t\t{\n\t\t\t\t\tvar node1 = this.$editor.find('span#selection-marker-1');\n\t\t\t\t\tvar node2 = this.$editor.find('span#selection-marker-2');\n\n\t\t\t\t\tif (node1.length !== 0 && node2.length !== 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.caret.set(node1, 0, node2, 0);\n\t\t\t\t\t}\n\t\t\t\t\telse if (node1.length !== 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.caret.set(node1, 0, node1, 0);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.$editor.focus();\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.selection.removeMarkers();\n\t\t\t\t\tthis.savedSel = false;\n\n\t\t\t\t},\n\t\t\t\tremoveMarkers: function()\n\t\t\t\t{\n\t\t\t\t\tthis.$editor.find('span.redactor-selection-marker').each(function(i,s)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar text = $(s).text().replace(/[\\u200B-\\u200D\\uFEFF]/g, '');\n\t\t\t\t\t\tif (text === '') $(s).remove();\n\t\t\t\t\t\telse $(s).replaceWith(function() { return $(this).contents(); });\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tgetText: function()\n\t\t\t\t{\n\t\t\t\t\tthis.selection.get();\n\n\t\t\t\t\treturn this.sel.toString();\n\t\t\t\t},\n\t\t\t\tgetHtml: function()\n\t\t\t\t{\n\t\t\t\t\tvar html = '';\n\n\t\t\t\t\tthis.selection.get();\n\t\t\t\t\tif (this.sel.rangeCount)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar container = document.createElement('div');\n\t\t\t\t\t\tvar len = this.sel.rangeCount;\n\t\t\t\t\t\tfor (var i = 0; i < len; ++i)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontainer.appendChild(this.sel.getRangeAt(i).cloneContents());\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\thtml = container.innerHTML;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this.clean.onSync(html);\n\t\t\t\t},\n\t\t\t\treplaceWithHtml: function(html)\n\t\t\t\t{\n\t\t\t\t\thtml = this.selection.getMarkerAsHtml(1) + html + this.selection.getMarkerAsHtml(2);\n\n\t\t\t\t\tthis.selection.get();\n\n\t\t\t\t\tif (window.getSelection && window.getSelection().getRangeAt)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.range.deleteContents();\n\t\t\t\t\t\tvar div = document.createElement(\"div\");\n\t\t\t\t\t\tdiv.innerHTML = html;\n\n\t\t\t\t\t\tvar frag = document.createDocumentFragment(), child;\n\t\t\t\t\t\twhile ((child = div.firstChild))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfrag.appendChild(child);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis.range.insertNode(frag);\n\t\t\t\t\t}\n\t\t\t\t\telse if (document.selection && document.selection.createRange)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.range.pasteHTML(html);\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.selection.restore();\n\t\t\t\t\tthis.code.sync();\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\tshortcuts: function()\n\t\t{\n\t\t\treturn {\n\t\t\t\tinit: function(e, key)\n\t\t\t\t{\n\t\t\t\t\t// disable browser's hot keys for bold and italic\n\t\t\t\t\tif (!this.opts.shortcuts)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ((e.ctrlKey || e.metaKey) && (key === 66 || key === 73)) e.preventDefault();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\t$.each(this.opts.shortcuts, $.proxy(function(str, command)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar keys = str.split(',');\n\t\t\t\t\t\tvar len = keys.length;\n\t\t\t\t\t\tfor (var i = 0; i < len; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (typeof keys[i] === 'string')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.shortcuts.handler(e, $.trim(keys[i]), $.proxy(function()\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar func;\n\t\t\t\t\t\t\t\t\tif (command.func.search(/\\./) != '-1')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tfunc = command.func.split('.');\n\t\t\t\t\t\t\t\t\t\tif (typeof this[func[0]] != 'undefined')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tthis[func[0]][func[1]].apply(this, command.params);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tthis[command.func].apply(this, command.params);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}, this));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}, this));\n\t\t\t\t},\n\t\t\t\thandler: function(e, keys, origHandler)\n\t\t\t\t{\n\t\t\t\t\t// based on https://github.com/jeresig/jquery.hotkeys\n\t\t\t\t\tvar hotkeysSpecialKeys =\n\t\t\t\t\t{\n\t\t\t\t\t\t8: \"backspace\", 9: \"tab\", 10: \"return\", 13: \"return\", 16: \"shift\", 17: \"ctrl\", 18: \"alt\", 19: \"pause\",\n\t\t\t\t\t\t20: \"capslock\", 27: \"esc\", 32: \"space\", 33: \"pageup\", 34: \"pagedown\", 35: \"end\", 36: \"home\",\n\t\t\t\t\t\t37: \"left\", 38: \"up\", 39: \"right\", 40: \"down\", 45: \"insert\", 46: \"del\", 59: \";\", 61: \"=\",\n\t\t\t\t\t\t96: \"0\", 97: \"1\", 98: \"2\", 99: \"3\", 100: \"4\", 101: \"5\", 102: \"6\", 103: \"7\",\n\t\t\t\t\t\t104: \"8\", 105: \"9\", 106: \"*\", 107: \"+\", 109: \"-\", 110: \".\", 111 : \"/\",\n\t\t\t\t\t\t112: \"f1\", 113: \"f2\", 114: \"f3\", 115: \"f4\", 116: \"f5\", 117: \"f6\", 118: \"f7\", 119: \"f8\",\n\t\t\t\t\t\t120: \"f9\", 121: \"f10\", 122: \"f11\", 123: \"f12\", 144: \"numlock\", 145: \"scroll\", 173: \"-\", 186: \";\", 187: \"=\",\n\t\t\t\t\t\t188: \",\", 189: \"-\", 190: \".\", 191: \"/\", 192: \"`\", 219: \"[\", 220: \"\\\\\", 221: \"]\", 222: \"'\"\n\t\t\t\t\t};\n\n\n\t\t\t\t\tvar hotkeysShiftNums =\n\t\t\t\t\t{\n\t\t\t\t\t\t\"`\": \"~\", \"1\": \"!\", \"2\": \"@\", \"3\": \"#\", \"4\": \"$\", \"5\": \"%\", \"6\": \"^\", \"7\": \"&\",\n\t\t\t\t\t\t\"8\": \"*\", \"9\": \"(\", \"0\": \")\", \"-\": \"_\", \"=\": \"+\", \";\": \": \", \"'\": \"\\\"\", \",\": \"<\",\n\t\t\t\t\t\t\".\": \">\", \"/\": \"?\", \"\\\\\": \"|\"\n\t\t\t\t\t};\n\n\t\t\t\t\tkeys = keys.toLowerCase().split(\" \");\n\t\t\t\t\tvar special = hotkeysSpecialKeys[e.keyCode],\n\t\t\t\t\t\tcharacter = String.fromCharCode( e.which ).toLowerCase(),\n\t\t\t\t\t\tmodif = \"\", possible = {};\n\n\t\t\t\t\t$.each([ \"alt\", \"ctrl\", \"meta\", \"shift\"], function(index, specialKey)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (e[specialKey + 'Key'] && special !== specialKey)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmodif += specialKey + '+';\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\n\t\t\t\t\tif (special) possible[modif + special] = true;\n\t\t\t\t\tif (character)\n\t\t\t\t\t{\n\t\t\t\t\t\tpossible[modif + character] = true;\n\t\t\t\t\t\tpossible[modif + hotkeysShiftNums[character]] = true;\n\n\t\t\t\t\t\t// \"$\" can be triggered as \"Shift+4\" or \"Shift+$\" or just \"$\"\n\t\t\t\t\t\tif (modif === \"shift+\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpossible[hotkeysShiftNums[character]] = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (var i = 0, len = keys.length; i < len; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (possible[keys[i]])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\treturn origHandler.apply(this, arguments);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\ttabifier: function()\n\t\t{\n\t\t\treturn {\n\t\t\t\tget: function(code)\n\t\t\t\t{\n\t\t\t\t\tif (!this.opts.tabifier) return code;\n\n\t\t\t\t\t// clean setup\n\t\t\t\t\tvar ownLine = ['area', 'body', 'head', 'hr', 'i?frame', 'link', 'meta', 'noscript', 'style', 'script', 'table', 'tbody', 'thead', 'tfoot'];\n\t\t\t\t\tvar contOwnLine = ['li', 'dt', 'dt', 'h[1-6]', 'option', 'script'];\n\t\t\t\t\tvar newLevel = ['p', 'blockquote', 'div', 'dl', 'fieldset', 'form', 'frameset', 'map', 'ol', 'pre', 'select', 'td', 'th', 'tr', 'ul'];\n\n\t\t\t\t\tthis.tabifier.lineBefore = new RegExp('^<(/?' + ownLine.join('|/?' ) + '|' + contOwnLine.join('|') + ')[ >]');\n\t\t\t\t\tthis.tabifier.lineAfter = new RegExp('^<(br|/?' + ownLine.join('|/?' ) + '|/' + contOwnLine.join('|/') + ')[ >]');\n\t\t\t\t\tthis.tabifier.newLevel = new RegExp('^]');\n\n\t\t\t\t\tvar i = 0,\n\t\t\t\t\tcodeLength = code.length,\n\t\t\t\t\tpoint = 0,\n\t\t\t\t\tstart = null,\n\t\t\t\t\tend = null,\n\t\t\t\t\ttag = '',\n\t\t\t\t\tout = '',\n\t\t\t\t\tcont = '';\n\n\t\t\t\t\tthis.tabifier.cleanlevel = 0;\n\n\t\t\t\t\tfor (; i < codeLength; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tpoint = i;\n\n\t\t\t\t\t\t// if no more tags, copy and exit\n\t\t\t\t\t\tif (-1 == code.substr(i).indexOf( '<' ))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tout += code.substr(i);\n\n\t\t\t\t\t\t\treturn this.tabifier.finish(out);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// copy verbatim until a tag\n\t\t\t\t\t\twhile (point < codeLength && code.charAt(point) != '<')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpoint++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (i != point)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcont = code.substr(i, point - i);\n\t\t\t\t\t\t\tif (!cont.match(/^\\s{2,}$/g))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif ('\\n' == out.charAt(out.length - 1)) out += this.tabifier.getTabs();\n\t\t\t\t\t\t\t\telse if ('\\n' == cont.charAt(0))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tout += '\\n' + this.tabifier.getTabs();\n\t\t\t\t\t\t\t\t\tcont = cont.replace(/^\\s+/, '');\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tout += cont;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (cont.match(/\\n/)) out += '\\n' + this.tabifier.getTabs();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstart = point;\n\n\t\t\t\t\t\t// find the end of the tag\n\t\t\t\t\t\twhile (point < codeLength && '>' != code.charAt(point))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpoint++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttag = code.substr(start, point - start);\n\t\t\t\t\t\ti = point;\n\n\t\t\t\t\t\tvar t;\n\n\t\t\t\t\t\tif ('!--' == tag.substr(1, 3))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (!tag.match(/--$/))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\twhile ('-->' != code.substr(point, 3))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tpoint++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tpoint += 2;\n\t\t\t\t\t\t\t\ttag = code.substr(start, point - start);\n\t\t\t\t\t\t\t\ti = point;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ('\\n' != out.charAt(out.length - 1)) out += '\\n';\n\n\t\t\t\t\t\t\tout += this.tabifier.getTabs();\n\t\t\t\t\t\t\tout += tag + '>\\n';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if ('!' == tag[1])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tout = this.tabifier.placeTag(tag + '>', out);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if ('?' == tag[1])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tout += tag + '>\\n';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (t = tag.match(/^<(script|style|pre)/i))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tt[1] = t[1].toLowerCase();\n\t\t\t\t\t\t\ttag = this.tabifier.cleanTag(tag);\n\t\t\t\t\t\t\tout = this.tabifier.placeTag(tag, out);\n\t\t\t\t\t\t\tend = String(code.substr(i + 1)).toLowerCase().indexOf('\\n<\\/script>/gi, '');\n\n\t\t\t\t\tthis.tabifier.cleanlevel = 0;\n\n\t\t\t\t\treturn code;\n\t\t\t\t},\n\t\t\t\tcleanTag: function (tag)\n\t\t\t\t{\n\t\t\t\t\tvar tagout = '';\n\t\t\t\t\ttag = tag.replace(/\\n/g, ' ');\n\t\t\t\t\ttag = tag.replace(/\\s{2,}/g, ' ');\n\t\t\t\t\ttag = tag.replace(/^\\s+|\\s+$/g, ' ');\n\n\t\t\t\t\tvar suffix = '';\n\t\t\t\t\tif (tag.match(/\\/$/))\n\t\t\t\t\t{\n\t\t\t\t\t\tsuffix = '/';\n\t\t\t\t\t\ttag = tag.replace(/\\/+$/, '');\n\t\t\t\t\t}\n\n\t\t\t\t\tvar m;\n\t\t\t\t\twhile (m = /\\s*([^= ]+)(?:=((['\"']).*?\\3|[^ ]+))?/.exec(tag))\n\t\t\t\t\t{\n\t\t\t\t\t\tif (m[2]) tagout += m[1].toLowerCase() + '=' + m[2];\n\t\t\t\t\t\telse if (m[1]) tagout += m[1].toLowerCase();\n\n\t\t\t\t\t\ttagout += ' ';\n\t\t\t\t\t\ttag = tag.substr(m[0].length);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn tagout.replace(/\\s*$/, '') + suffix + '>';\n\t\t\t\t},\n\t\t\t\tplaceTag: function (tag, out)\n\t\t\t\t{\n\t\t\t\t\tvar nl = tag.match(this.tabifier.newLevel);\n\n\t\t\t\t\tif (tag.match(this.tabifier.lineBefore) || nl)\n\t\t\t\t\t{\n\t\t\t\t\t\tout = out.replace(/\\s*$/, '');\n\t\t\t\t\t\tout += '\\n';\n\t\t\t\t\t}\n\n\t\t\t\t\tif (nl && '/' == tag.charAt(1)) this.tabifier.cleanlevel--;\n\t\t\t\t\tif ('\\n' == out.charAt(out.length - 1)) out += this.tabifier.getTabs();\n\t\t\t\t\tif (nl && '/' != tag.charAt(1)) this.tabifier.cleanlevel++;\n\n\t\t\t\t\tout += tag;\n\n\t\t\t\t\tif (tag.match(this.tabifier.lineAfter) || tag.match(this.tabifier.newLevel))\n\t\t\t\t\t{\n\t\t\t\t\t\tout = out.replace(/ *$/, '');\n\t\t\t\t\t\t//out += '\\n';\n\t\t\t\t\t}\n\n\t\t\t\t\treturn out;\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\ttidy: function()\n\t\t{\n\t\t\treturn {\n\t\t\t\tsetupAllowed: function()\n\t\t\t\t{\n\t\t\t\t\tif (this.opts.allowedTags) this.opts.deniedTags = false;\n\t\t\t\t\tif (this.opts.allowedAttr) this.opts.removeAttr = false;\n\n\t\t\t\t\tif (this.opts.linebreaks) return;\n\n\t\t\t\t\tvar tags = ['p', 'section'];\n\t\t\t\t\tif (this.opts.allowedTags) this.tidy.addToAllowed(tags);\n\t\t\t\t\tif (this.opts.deniedTags) this.tidy.removeFromDenied(tags);\n\n\t\t\t\t},\n\t\t\t\taddToAllowed: function(tags)\n\t\t\t\t{\n\t\t\t\t\tvar len = tags.length;\n\t\t\t\t\tfor (var i = 0; i < len; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($.inArray(tags[i], this.opts.allowedTags) == -1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.opts.allowedTags.push(tags[i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tremoveFromDenied: function(tags)\n\t\t\t\t{\n\t\t\t\t\tvar len = tags.length;\n\t\t\t\t\tfor (var i = 0; i < len; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar pos = $.inArray(tags[i], this.opts.deniedTags);\n\t\t\t\t\t\tif (pos != -1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.opts.deniedTags.splice(pos, 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tload: function(html, options)\n\t\t\t\t{\n\t\t\t\t\tthis.tidy.settings = {\n\t\t\t\t\t\tdeniedTags: this.opts.deniedTags,\n\t\t\t\t\t\tallowedTags: this.opts.allowedTags,\n\t\t\t\t\t\tremoveComments: this.opts.removeComments,\n\t\t\t\t\t\treplaceTags: this.opts.replaceTags,\n\t\t\t\t\t\treplaceStyles: this.opts.replaceStyles,\n\t\t\t\t\t\tremoveDataAttr: this.opts.removeDataAttr,\n\t\t\t\t\t\tremoveAttr: this.opts.removeAttr,\n\t\t\t\t\t\tallowedAttr: this.opts.allowedAttr,\n\t\t\t\t\t\tremoveWithoutAttr: this.opts.removeWithoutAttr,\n\t\t\t\t\t\tremoveEmpty: this.opts.removeEmpty\n\t\t\t\t\t};\n\n\t\t\t\t\t$.extend(this.tidy.settings, options);\n\n\t\t\t\t\thtml = this.tidy.removeComments(html);\n\n\t\t\t\t\t// create container\n\t\t\t\t\tthis.tidy.$div = $('
    ').append(html);\n\n\t\t\t\t\t// clean\n\t\t\t\t\tthis.tidy.replaceTags();\n\t\t\t\t\tthis.tidy.replaceStyles();\n\t\t\t\t\tthis.tidy.removeTags();\n\n\t\t\t\t\tthis.tidy.removeAttr();\n\t\t\t\t\tthis.tidy.removeEmpty();\n\t\t\t\t\tthis.tidy.removeParagraphsInLists();\n\t\t\t\t\tthis.tidy.removeDataAttr();\n\t\t\t\t\tthis.tidy.removeWithoutAttr();\n\n\t\t\t\t\thtml = this.tidy.$div.html();\n\t\t\t\t\tthis.tidy.$div.remove();\n\n\t\t\t\t\treturn html;\n\t\t\t\t},\n\t\t\t\tremoveComments: function(html)\n\t\t\t\t{\n\t\t\t\t\tif (!this.tidy.settings.removeComments) return html;\n\n\t\t\t\t\treturn html.replace(//gi, '');\n\t\t\t\t},\n\t\t\t\treplaceTags: function(html)\n\t\t\t\t{\n\t\t\t\t\tif (!this.tidy.settings.replaceTags) return html;\n\n\t\t\t\t\tvar len = this.tidy.settings.replaceTags.length;\n\t\t\t\t\tvar replacement = [], rTags = [];\n\t\t\t\t\tfor (var i = 0; i < len; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\trTags.push(this.tidy.settings.replaceTags[i][1]);\n\t\t\t\t\t\treplacement.push(this.tidy.settings.replaceTags[i][0]);\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.tidy.$div.find(replacement.join(',')).each($.proxy(function(n,s)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar tag = rTags[n];\n\t\t\t\t\t\t$(s).replaceWith(function()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar replaced = $('<' + tag + ' />').append($(this).contents());\n\n\t\t\t\t\t\t\tfor (var i = 0; i < this.attributes.length; i++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treplaced.attr(this.attributes[i].name, this.attributes[i].value);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn replaced;\n\t\t\t\t\t\t});\n\n\t\t\t\t\t}, this));\n\n\t\t\t\t\treturn html;\n\t\t\t\t},\n\t\t\t\treplaceStyles: function()\n\t\t\t\t{\n\t\t\t\t\tif (!this.tidy.settings.replaceStyles) return;\n\n\t\t\t\t\tvar len = this.tidy.settings.replaceStyles.length;\n\t\t\t\t\tthis.tidy.$div.find('span').each($.proxy(function(n,s)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar $el = $(s);\n\t\t\t\t\t\tvar style = $el.attr('style');\n\t\t\t\t\t\tfor (var i = 0; i < len; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (style && style.match(new RegExp('^' + this.tidy.settings.replaceStyles[i][0], 'i')))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar tagName = this.tidy.settings.replaceStyles[i][1];\n\t\t\t\t\t\t\t\t$el.replaceWith(function()\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar tag = document.createElement(tagName);\n\t\t\t\t\t\t\t\t\treturn $(tag).append($(this).contents());\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}, this));\n\n\t\t\t\t},\n\t\t\t\tremoveTags: function()\n\t\t\t\t{\n\t\t\t\t\tif (!this.tidy.settings.deniedTags && this.tidy.settings.allowedTags)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.tidy.$div.find('*').not(this.tidy.settings.allowedTags.join(',')).each(function(i, s)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (s.innerHTML === '') $(s).remove();\n\t\t\t\t\t\t\telse $(s).contents().unwrap();\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tif (this.tidy.settings.deniedTags)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.tidy.$div.find(this.tidy.settings.deniedTags.join(',')).each(function(i, s)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (s.innerHTML === '') $(s).remove();\n\t\t\t\t\t\t\telse $(s).contents().unwrap();\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tremoveAttr: function()\n\t\t\t\t{\n\t\t\t\t\tvar len;\n\t\t\t\t\tif (!this.tidy.settings.removeAttr && this.tidy.settings.allowedAttr)\n\t\t\t\t\t{\n\n\t\t\t\t\t\tvar allowedAttrTags = [], allowedAttrData = [];\n\t\t\t\t\t\tlen = this.tidy.settings.allowedAttr.length;\n\t\t\t\t\t\tfor (var i = 0; i < len; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tallowedAttrTags.push(this.tidy.settings.allowedAttr[i][0]);\n\t\t\t\t\t\t\tallowedAttrData.push(this.tidy.settings.allowedAttr[i][1]);\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\tthis.tidy.$div.find('*').each($.proxy(function(n,s)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar $el = $(s);\n\t\t\t\t\t\t\tvar pos = $.inArray($el[0].tagName.toLowerCase(), allowedAttrTags);\n\t\t\t\t\t\t\tvar attributesRemove = this.tidy.removeAttrGetRemoves(pos, allowedAttrData, $el);\n\n\t\t\t\t\t\t\tif (attributesRemove)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$.each(attributesRemove, function(z,f) {\n\t\t\t\t\t\t\t\t\t$el.removeAttr(f);\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, this));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (this.tidy.settings.removeAttr)\n\t\t\t\t\t{\n\t\t\t\t\t\tlen = this.tidy.settings.removeAttr.length;\n\t\t\t\t\t\tfor (var i = 0; i < len; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar attrs = this.tidy.settings.removeAttr[i][1];\n\t\t\t\t\t\t\tif ($.isArray(attrs)) attrs = attrs.join(' ');\n\n\t\t\t\t\t\t\tthis.tidy.$div.find(this.tidy.settings.removeAttr[i][0]).removeAttr(attrs);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t},\n\t\t\t\tremoveAttrGetRemoves: function(pos, allowed, $el)\n\t\t\t\t{\n\t\t\t\t\tvar attributesRemove = [];\n\n\t\t\t\t\t// remove all attrs\n\t\t\t\t\tif (pos == -1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$.each($el[0].attributes, function(i, item)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tattributesRemove.push(item.name);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t}\n\t\t\t\t\t// allow all attrs\n\t\t\t\t\telse if (allowed[pos] == '*')\n\t\t\t\t\t{\n\t\t\t\t\t\tattributesRemove = [];\n\t\t\t\t\t}\n\t\t\t\t\t// allow specific attrs\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$.each($el[0].attributes, function(i, item)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($.isArray(allowed[pos]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif ($.inArray(item.name, allowed[pos]) == -1)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tattributesRemove.push(item.name);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (allowed[pos] != item.name)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tattributesRemove.push(item.name);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\treturn attributesRemove;\n\t\t\t\t},\n\t\t\t\tremoveAttrs: function (el, regex)\n\t\t\t\t{\n\t\t\t\t\tregex = new RegExp(regex, \"g\");\n\t\t\t\t\treturn el.each(function()\n\t\t\t\t\t{\n\t\t\t\t\t\tvar self = $(this);\n\t\t\t\t\t\tvar len = this.attributes.length - 1;\n\t\t\t\t\t\tfor (var i = len; i >= 0; i--)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar item = this.attributes[i];\n\t\t\t\t\t\t\tif (item && item.specified && item.name.search(regex)>=0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tself.removeAttr(item.name);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tremoveEmpty: function()\n\t\t\t\t{\n\t\t\t\t\tif (!this.tidy.settings.removeEmpty) return;\n\n\t\t\t\t\tthis.tidy.$div.find(this.tidy.settings.removeEmpty.join(',')).each(function()\n\t\t\t\t\t{\n\t\t\t\t\t\tvar $el = $(this);\n\t\t\t\t\t\tvar text = $el.text();\n\t\t\t\t\t\ttext = text.replace(/[\\u200B-\\u200D\\uFEFF]/g, '');\n\t\t\t\t\t\ttext = text.replace(/ /gi, '');\n\t\t\t\t\t\ttext = text.replace(/\\s/g, '');\n\n\t\t \t \tif (text === '' && $el.children().length === 0)\n\t\t \t \t{\n\t\t\t \t \t$el.remove();\n\t\t \t \t}\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tremoveParagraphsInLists: function()\n\t\t\t\t{\n\t\t\t\t\tthis.tidy.$div.find('li p').contents().unwrap();\n\t\t\t\t},\n\t\t\t\tremoveDataAttr: function()\n\t\t\t\t{\n\t\t\t\t\tif (!this.tidy.settings.removeDataAttr) return;\n\n\t\t\t\t\tvar tags = this.tidy.settings.removeDataAttr;\n\t\t\t\t\tif ($.isArray(this.tidy.settings.removeDataAttr)) tags = this.tidy.settings.removeDataAttr.join(',');\n\n\t\t\t\t\tthis.tidy.removeAttrs(this.tidy.$div.find(tags), '^(data-)');\n\n\t\t\t\t},\n\t\t\t\tremoveWithoutAttr: function()\n\t\t\t\t{\n\t\t\t\t\tif (!this.tidy.settings.removeWithoutAttr) return;\n\n\t\t\t\t\tthis.tidy.$div.find(this.tidy.settings.removeWithoutAttr.join(',')).each(function()\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.attributes.length === 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$(this).contents().unwrap();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\ttoolbar: function()\n\t\t{\n\t\t\treturn {\n\t\t\t\tinit: function()\n\t\t\t\t{\n\t\t\t\t\treturn {\n\t\t\t\t\t\thtml:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: this.lang.get('html'),\n\t\t\t\t\t\t\tfunc: 'code.toggle'\n\t\t\t\t\t\t},\n\t\t\t\t\t\tformatting:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: this.lang.get('formatting'),\n\t\t\t\t\t\t\tdropdown:\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tp:\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttitle: this.lang.get('paragraph'),\n\t\t\t\t\t\t\t\t\tfunc: 'block.format'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tblockquote:\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttitle: this.lang.get('quote'),\n\t\t\t\t\t\t\t\t\tfunc: 'block.format'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tpre:\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttitle: this.lang.get('code'),\n\t\t\t\t\t\t\t\t\tfunc: 'block.format'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\th1:\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttitle: this.lang.get('header1'),\n\t\t\t\t\t\t\t\t\tfunc: 'block.format'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\th2:\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttitle: this.lang.get('header2'),\n\t\t\t\t\t\t\t\t\tfunc: 'block.format'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\th3:\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttitle: this.lang.get('header3'),\n\t\t\t\t\t\t\t\t\tfunc: 'block.format'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\th4:\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttitle: this.lang.get('header4'),\n\t\t\t\t\t\t\t\t\tfunc: 'block.format'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\th5:\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttitle: this.lang.get('header5'),\n\t\t\t\t\t\t\t\t\tfunc: 'block.format'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbold:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: this.lang.get('bold'),\n\t\t\t\t\t\t\tfunc: 'inline.format'\n\t\t\t\t\t\t},\n\t\t\t\t\t\titalic:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: this.lang.get('italic'),\n\t\t\t\t\t\t\tfunc: 'inline.format'\n\t\t\t\t\t\t},\n\t\t\t\t\t\tdeleted:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: this.lang.get('deleted'),\n\t\t\t\t\t\t\tfunc: 'inline.format'\n\t\t\t\t\t\t},\n\t\t\t\t\t\tunderline:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: this.lang.get('underline'),\n\t\t\t\t\t\t\tfunc: 'inline.format'\n\t\t\t\t\t\t},\n\t\t\t\t\t\tunorderedlist:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: '• ' + this.lang.get('unorderedlist'),\n\t\t\t\t\t\t\tfunc: 'list.toggle'\n\t\t\t\t\t\t},\n\t\t\t\t\t\torderedlist:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: '1. ' + this.lang.get('orderedlist'),\n\t\t\t\t\t\t\tfunc: 'list.toggle'\n\t\t\t\t\t\t},\n\t\t\t\t\t\toutdent:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: '< ' + this.lang.get('outdent'),\n\t\t\t\t\t\t\tfunc: 'indent.decrease'\n\t\t\t\t\t\t},\n\t\t\t\t\t\tindent:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: '> ' + this.lang.get('indent'),\n\t\t\t\t\t\t\tfunc: 'indent.increase'\n\t\t\t\t\t\t},\n\t\t\t\t\t\timage:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: this.lang.get('image'),\n\t\t\t\t\t\t\tfunc: 'image.show'\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfile:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: this.lang.get('file'),\n\t\t\t\t\t\t\tfunc: 'file.show'\n\t\t\t\t\t\t},\n\t\t\t\t\t\tlink:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: this.lang.get('link'),\n\t\t\t\t\t\t\tdropdown:\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlink:\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttitle: this.lang.get('link_insert'),\n\t\t\t\t\t\t\t\t\tfunc: 'link.show'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tunlink:\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttitle: this.lang.get('unlink'),\n\t\t\t\t\t\t\t\t\tfunc: 'link.unlink'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\talignment:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: this.lang.get('alignment'),\n\t\t\t\t\t\t\tdropdown:\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tleft:\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttitle: this.lang.get('align_left'),\n\t\t\t\t\t\t\t\t\tfunc: 'alignment.left'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tcenter:\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttitle: this.lang.get('align_center'),\n\t\t\t\t\t\t\t\t\tfunc: 'alignment.center'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tright:\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttitle: this.lang.get('align_right'),\n\t\t\t\t\t\t\t\t\tfunc: 'alignment.right'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tjustify:\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttitle: this.lang.get('align_justify'),\n\t\t\t\t\t\t\t\t\tfunc: 'alignment.justify'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\thorizontalrule:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: this.lang.get('horizontalrule'),\n\t\t\t\t\t\t\tfunc: 'line.insert'\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\tbuild: function()\n\t\t\t\t{\n\t\t\t\t\tthis.toolbar.hideButtons();\n\t\t\t\t\tthis.toolbar.hideButtonsOnMobile();\n\t\t\t\t\tthis.toolbar.isButtonSourceNeeded();\n\n\t\t\t\t\tif (this.opts.buttons.length === 0) return;\n\n\t\t\t\t\tthis.$toolbar = this.toolbar.createContainer();\n\n\t\t\t\t\tthis.toolbar.setOverflow();\n\t\t\t\t\tthis.toolbar.append();\n\t\t\t\t\tthis.toolbar.setFormattingTags();\n\t\t\t\t\tthis.toolbar.loadButtons();\n\t\t\t\t\tthis.toolbar.setFixed();\n\n\t\t\t\t\t// buttons response\n\t\t\t\t\tif (this.opts.activeButtons)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.$editor.on('mouseup.redactor keyup.redactor focus.redactor', $.proxy(this.observe.buttons, this));\n\t\t\t\t\t}\n\n\t\t\t\t},\n\t\t\t\tcreateContainer: function()\n\t\t\t\t{\n\t\t\t\t\treturn $('
      ').addClass('redactor-toolbar').attr('id', 'redactor-toolbar-' + this.uuid);\n\t\t\t\t},\n\t\t\t\tsetFormattingTags: function()\n\t\t\t\t{\n\t\t\t\t\t$.each(this.opts.toolbar.formatting.dropdown, $.proxy(function (i, s)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($.inArray(i, this.opts.formatting) == -1) delete this.opts.toolbar.formatting.dropdown[i];\n\t\t\t\t\t}, this));\n\n\t\t\t\t},\n\t\t\t\tloadButtons: function()\n\t\t\t\t{\n\t\t\t\t\t$.each(this.opts.buttons, $.proxy(function(i, btnName)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!this.opts.toolbar[btnName]) return;\n\n\t\t\t\t\t\tif (btnName === 'file')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t if (this.opts.fileUpload === false) return;\n\t\t\t\t\t\t\t else if (!this.opts.fileUpload && this.opts.s3 === false) return;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (btnName === 'image')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t if (this.opts.imageUpload === false) return;\n\t\t\t\t\t\t\t else if (!this.opts.imageUpload && this.opts.s3 === false) return;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar btnObject = this.opts.toolbar[btnName];\n\t\t\t\t\t\tthis.$toolbar.append($('
    • ').append(this.button.build(btnName, btnObject)));\n\n\t\t\t\t\t}, this));\n\t\t\t\t},\n\t\t\t\tappend: function()\n\t\t\t\t{\n\t\t\t\t\tif (this.opts.toolbarExternal)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.$toolbar.addClass('redactor-toolbar-external');\n\t\t\t\t\t\t$(this.opts.toolbarExternal).html(this.$toolbar);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.$box.prepend(this.$toolbar);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tsetFixed: function()\n\t\t\t\t{\n\t\t\t\t\tif (!this.utils.isDesktop()) return;\n\t\t\t\t\tif (this.opts.toolbarExternal) return;\n\t\t\t\t\tif (!this.opts.toolbarFixed) return;\n\n\t\t\t\t\tthis.toolbar.observeScroll();\n\t\t\t\t\t$(this.opts.toolbarFixedTarget).on('scroll.redactor.' + this.uuid, $.proxy(this.toolbar.observeScroll, this));\n\n\t\t\t\t},\n\t\t\t\tsetOverflow: function()\n\t\t\t\t{\n\t\t\t\t\tif (this.utils.isMobile() && this.opts.toolbarOverflow)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.$toolbar.addClass('redactor-toolbar-overflow');\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tisButtonSourceNeeded: function()\n\t\t\t\t{\n\t\t\t\t\tif (this.opts.source) return;\n\n\t\t\t\t\tvar index = this.opts.buttons.indexOf('html');\n\t\t\t\t\tif (index !== -1)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.opts.buttons.splice(index, 1);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\thideButtons: function()\n\t\t\t\t{\n\t\t\t\t\tif (this.opts.buttonsHide.length === 0) return;\n\n\t\t\t\t\t$.each(this.opts.buttonsHide, $.proxy(function(i, s)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar index = this.opts.buttons.indexOf(s);\n\t\t\t\t\t\tthis.opts.buttons.splice(index, 1);\n\n\t\t\t\t\t}, this));\n\t\t\t\t},\n\t\t\t\thideButtonsOnMobile: function()\n\t\t\t\t{\n\t\t\t\t\tif (!this.utils.isMobile() || this.opts.buttonsHideOnMobile.length === 0) return;\n\n\t\t\t\t\t$.each(this.opts.buttonsHideOnMobile, $.proxy(function(i, s)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar index = this.opts.buttons.indexOf(s);\n\t\t\t\t\t\tthis.opts.buttons.splice(index, 1);\n\n\t\t\t\t\t}, this));\n\t\t\t\t},\n\t\t\t\tobserveScroll: function()\n\t\t\t\t{\n\t\t\t\t\tvar scrollTop = $(this.opts.toolbarFixedTarget).scrollTop();\n\t\t\t\t\tvar boxTop = 1;\n\n\t\t\t\t\tif (this.opts.toolbarFixedTarget === document)\n\t\t\t\t\t{\n\t\t\t\t\t\tboxTop = this.$box.offset().top;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (scrollTop > boxTop)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.toolbar.observeScrollEnable(scrollTop, boxTop);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.toolbar.observeScrollDisable();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tobserveScrollEnable: function(scrollTop, boxTop)\n\t\t\t\t{\n\t\t\t\t\tvar top = this.opts.toolbarFixedTopOffset + scrollTop - boxTop;\n\t\t\t\t\tvar left = 0;\n\t\t\t\t\tvar end = boxTop + this.$box.height() - 32;\n\t\t\t\t\tvar width = this.$box.innerWidth();\n\n\t\t\t\t\tthis.$toolbar.addClass('toolbar-fixed-box');\n\t\t\t\t\tthis.$toolbar.css({\n\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\twidth: width,\n\t\t\t\t\t\ttop: top + 'px',\n\t\t\t\t\t\tleft: left\n\t\t\t\t\t});\n\n\t\t\t\t\tthis.toolbar.setDropdownsFixed();\n\t\t\t\t\tthis.$toolbar.css('visibility', (scrollTop < end) ? 'visible' : 'hidden');\n\t\t\t\t},\n\t\t\t\tobserveScrollDisable: function()\n\t\t\t\t{\n\t\t\t\t\tthis.$toolbar.css({\n\t\t\t\t\t\tposition: 'relative',\n\t\t\t\t\t\twidth: 'auto',\n\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t\tvisibility: 'visible'\n\t\t\t\t\t});\n\n\t\t\t\t\tthis.toolbar.unsetDropdownsFixed();\n\t\t\t\t\tthis.$toolbar.removeClass('toolbar-fixed-box');\n\n\n\t\t\t\t},\n\t\t\t\tsetDropdownsFixed: function()\n\t\t\t\t{\n\t\t\t\t\tvar top = this.$toolbar.innerHeight() + this.opts.toolbarFixedTopOffset;\n\t\t\t\t\tvar position = 'fixed';\n\t\t\t\t\tif (this.opts.toolbarFixedTarget !== document)\n\t\t\t\t\t{\n\t\t\t\t\t\ttop = (this.$toolbar.innerHeight() + this.$toolbar.offset().top) + this.opts.toolbarFixedTopOffset;\n\t\t\t\t\t\tposition = 'absolute';\n\t\t\t\t\t}\n\n\t\t\t\t\t$('.redactor-dropdown-' + this.uuid).each(function()\n\t\t\t\t\t{\n\t\t\t\t\t\t$(this).css({ position: position, top: top + 'px' });\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tunsetDropdownsFixed: function()\n\t\t\t\t{\n\t\t\t\t\tvar top = (this.$toolbar.innerHeight() + this.$toolbar.offset().top);\n\t\t\t\t\t$('.redactor-dropdown-' + this.uuid).each(function()\n\t\t\t\t\t{\n\t\t\t\t\t\t$(this).css({ position: 'absolute', top: top + 'px' });\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\tupload: function()\n\t\t{\n\t\t\treturn {\n\t\t\t\tinit: function(id, url, callback)\n\t\t\t\t{\n\t\t\t\t\tthis.upload.direct = false;\n\t\t\t\t\tthis.upload.callback = callback;\n\t\t\t\t\tthis.upload.url = url;\n\t\t\t\t\tthis.upload.$el = $(id);\n\t\t\t\t\tthis.upload.$droparea = $('
      ');\n\n\t\t\t\t\tthis.upload.$placeholdler = $('
      ').text(this.lang.get('upload_label'));\n\t\t\t\t\tthis.upload.$input = $('');\n\n\t\t\t\t\tthis.upload.$placeholdler.append(this.upload.$input);\n\t\t\t\t\tthis.upload.$droparea.append(this.upload.$placeholdler);\n\t\t\t\t\tthis.upload.$el.append(this.upload.$droparea);\n\n\t\t\t\t\tthis.upload.$droparea.off('redactor.upload');\n\t\t\t\t\tthis.upload.$input.off('redactor.upload');\n\n\t\t\t\t\tthis.upload.$droparea.on('dragover.redactor.upload', $.proxy(this.upload.onDrag, this));\n\t\t\t\t\tthis.upload.$droparea.on('dragleave.redactor.upload', $.proxy(this.upload.onDragLeave, this));\n\n\t\t\t\t\t// change\n\t\t\t\t\tthis.upload.$input.on('change.redactor.upload', $.proxy(function(e)\n\t\t\t\t\t{\n\t\t\t\t\t\te = e.originalEvent || e;\n\t\t\t\t\t\tthis.upload.traverseFile(this.upload.$input[0].files[0], e);\n\t\t\t\t\t}, this));\n\n\t\t\t\t\t// drop\n\t\t\t\t\tthis.upload.$droparea.on('drop.redactor.upload', $.proxy(function(e)\n\t\t\t\t\t{\n\t\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\t\tthis.upload.$droparea.removeClass('drag-hover').addClass('drag-drop');\n\t\t\t\t\t\tthis.upload.onDrop(e);\n\n\t\t\t\t\t}, this));\n\t\t\t\t},\n\t\t\t\tdirectUpload: function(file, e)\n\t\t\t\t{\n\t\t\t\t\tthis.upload.direct = true;\n\t\t\t\t\tthis.upload.traverseFile(file, e);\n\t\t\t\t},\n\t\t\t\tonDrop: function(e)\n\t\t\t\t{\n\t\t\t\t\te = e.originalEvent || e;\n\t\t\t\t\tvar files = e.dataTransfer.files;\n\n\t\t\t\t\tthis.upload.traverseFile(files[0], e);\n\t\t\t\t},\n\t\t\t\ttraverseFile: function(file, e)\n\t\t\t\t{\n\t\t\t\t\tif (this.opts.s3)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.upload.setConfig(file);\n\t\t\t\t\t\tthis.upload.s3uploadFile(file);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar formData = !!window.FormData ? new FormData() : null;\n\t\t\t\t\tif (window.FormData)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.upload.setConfig(file);\n\n\t\t\t\t\t\tvar name = (this.upload.type == 'image') ? this.opts.imageUploadParam : this.opts.fileUploadParam;\n\t\t\t\t\t\tformData.append(name, file);\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.progress.show();\n\t\t\t\t\tthis.core.setCallback('uploadStart', e, formData);\n\t\t\t\t\tthis.upload.sendData(formData, e);\n\t\t\t\t},\n\t\t\t\tsetConfig: function(file)\n\t\t\t\t{\n\t\t\t\t\tthis.upload.getType(file);\n\n\t\t\t\t\tif (this.upload.direct)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.upload.url = (this.upload.type == 'image') ? this.opts.imageUpload : this.opts.fileUpload;\n\t\t\t\t\t\tthis.upload.callback = (this.upload.type == 'image') ? this.image.insert : this.file.insert;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgetType: function(file)\n\t\t\t\t{\n\t\t\t\t\tthis.upload.type = 'image';\n\t\t\t\t\tif (this.opts.imageTypes.indexOf(file.type) == -1)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.upload.type = 'file';\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgetHiddenFields: function(obj, fd)\n\t\t\t\t{\n\t\t\t\t\tif (obj === false || typeof obj !== 'object') return fd;\n\n\t\t\t\t\t$.each(obj, $.proxy(function(k, v)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (v !== null && v.toString().indexOf('#') === 0) v = $(v).val();\n\t\t\t\t\t\tfd.append(k, v);\n\n\t\t\t\t\t}, this));\n\n\t\t\t\t\treturn fd;\n\n\t\t\t\t},\n\t\t\t\tsendData: function(formData, e)\n\t\t\t\t{\n\t\t\t\t\t// append hidden fields\n\t\t\t\t\tif (this.upload.type == 'image')\n\t\t\t\t\t{\n\t\t\t\t\t\tformData = this.upload.getHiddenFields(this.opts.uploadImageFields, formData);\n\t\t\t\t\t\tformData = this.upload.getHiddenFields(this.upload.imageFields, formData);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tformData = this.upload.getHiddenFields(this.opts.uploadFileFields, formData);\n\t\t\t\t\t\tformData = this.upload.getHiddenFields(this.upload.fileFields, formData);\n\t\t\t\t\t}\n\n\t\t\t\t\tvar xhr = new XMLHttpRequest();\n\t\t\t\t\txhr.open('POST', this.upload.url);\n\n\t\t\t\t\t// complete\n\t\t\t\t\txhr.onreadystatechange = $.proxy(function()\n\t\t\t\t\t{\n\t\t\t\t\t if (xhr.readyState == 4)\n\t\t\t\t\t {\n\t\t\t\t\t var data = xhr.responseText;\n\n\t\t\t\t\t\t\tdata = data.replace(/^\\[/, '');\n\t\t\t\t\t\t\tdata = data.replace(/\\]$/, '');\n\n\t\t\t\t\t\t\tvar json;\n\t\t\t\t\t\t\ttry\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tjson = (typeof data === 'string' ? $.parseJSON(data) : data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcatch(err)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tjson = {\n\t\t\t\t\t\t\t\t\terror: true\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\tthis.progress.hide();\n\n\t\t\t\t\t\t\tif (!this.upload.direct)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.upload.$droparea.removeClass('drag-drop');\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tthis.upload.callback(json, this.upload.direct, e);\n\t\t\t\t\t }\n\t\t\t\t\t}, this);\n\n\n\t\t\t\t\t/*\n\t\t\t\t\txhr.upload.onprogress = $.proxy(function(e)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (e.lengthComputable)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar complete = (e.loaded / e.total * 100 | 0);\n\t\t\t\t\t\t\t//progress.value = progress.innerHTML = complete;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}, this);\n\t\t\t\t\t*/\n\n\n\t\t\t\t\txhr.send(formData);\n\t\t\t\t},\n\t\t\t\tonDrag: function(e)\n\t\t\t\t{\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tthis.upload.$droparea.addClass('drag-hover');\n\t\t\t\t},\n\t\t\t\tonDragLeave: function(e)\n\t\t\t\t{\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tthis.upload.$droparea.removeClass('drag-hover');\n\t\t\t\t},\n\t\t\t\tclearImageFields: function()\n\t\t\t\t{\n\t\t\t\t\tthis.upload.imageFields = {};\n\t\t\t\t},\n\t\t\t\taddImageFields: function(name, value)\n\t\t\t\t{\n\t\t\t\t\tthis.upload.imageFields[name] = value;\n\t\t\t\t},\n\t\t\t\tremoveImageFields: function(name)\n\t\t\t\t{\n\t\t\t\t\tdelete this.upload.imageFields[name];\n\t\t\t\t},\n\t\t\t\tclearFileFields: function()\n\t\t\t\t{\n\t\t\t\t\tthis.upload.fileFields = {};\n\t\t\t\t},\n\t\t\t\taddFileFields: function(name, value)\n\t\t\t\t{\n\t\t\t\t\tthis.upload.fileFields[name] = value;\n\t\t\t\t},\n\t\t\t\tremoveFileFields: function(name)\n\t\t\t\t{\n\t\t\t\t\tdelete this.upload.fileFields[name];\n\t\t\t\t},\n\n\n\t\t\t\t// S3\n\t\t\t\ts3uploadFile: function(file)\n\t\t\t\t{\n\t\t\t\t\tthis.upload.s3executeOnSignedUrl(file, $.proxy(function(signedURL)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.upload.s3uploadToS3(file, signedURL);\n\t\t\t\t\t}, this));\n\t\t\t\t},\n\t\t\t\ts3executeOnSignedUrl: function(file, callback)\n\t\t\t\t{\n\t\t\t\t\tvar xhr = new XMLHttpRequest();\n\n\t\t\t\t\tvar mark = '?';\n\t\t\t\t\tif (this.opts.s3.search(/\\?/) != '-1') mark = '&';\n\n\t\t\t\t\txhr.open('GET', this.opts.s3 + mark + 'name=' + file.name + '&type=' + file.type, true);\n\n\t\t\t\t\t// Hack to pass bytes through unprocessed.\n\t\t\t\t\tif (xhr.overrideMimeType) xhr.overrideMimeType('text/plain; charset=x-user-defined');\n\n\t\t\t\t\tvar that = this;\n\t\t\t\t\txhr.onreadystatechange = function(e)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.readyState == 4 && this.status == 200)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthat.progress.show();\n\t\t\t\t\t\t\tcallback(decodeURIComponent(this.responseText));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (this.readyState == 4 && this.status != 200)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//setProgress(0, 'Could not contact signing script. Status = ' + this.status);\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\txhr.send();\n\t\t\t\t},\n\t\t\t\ts3createCORSRequest: function(method, url)\n\t\t\t\t{\n\t\t\t\t\tvar xhr = new XMLHttpRequest();\n\t\t\t\t\tif (\"withCredentials\" in xhr)\n\t\t\t\t\t{\n\t\t\t\t\t\txhr.open(method, url, true);\n\t\t\t\t\t}\n\t\t\t\t\telse if (typeof XDomainRequest != \"undefined\")\n\t\t\t\t\t{\n\t\t\t\t\t\txhr = new XDomainRequest();\n\t\t\t\t\t\txhr.open(method, url);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\txhr = null;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn xhr;\n\t\t\t\t},\n\t\t\t\ts3uploadToS3: function(file, url)\n\t\t\t\t{\n\t\t\t\t\tvar xhr = this.upload.s3createCORSRequest('PUT', url);\n\t\t\t\t\tif (!xhr)\n\t\t\t\t\t{\n\t\t\t\t\t\t//setProgress(0, 'CORS not supported');\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\txhr.onload = $.proxy(function()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (xhr.status == 200)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//setProgress(100, 'Upload completed.');\n\n\t\t\t\t\t\t\t\tthis.progress.hide();\n\n\t\t\t\t\t\t\t\tvar s3file = url.split('?');\n\n\t\t\t\t\t\t\t\tif (!s3file[0])\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t // url parsing is fail\n\t\t\t\t\t\t\t\t\t return false;\n\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\tif (!this.upload.direct)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tthis.upload.$droparea.removeClass('drag-drop');\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tvar json = { filelink: s3file[0] };\n\t\t\t\t\t\t\t\tif (this.upload.type == 'file')\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar arr = s3file[0].split('/');\n\t\t\t\t\t\t\t\t\tjson.filename = arr[arr.length-1];\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tthis.upload.callback(json, this.upload.direct, false);\n\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//setProgress(0, 'Upload error: ' + xhr.status);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, this);\n\n\t\t\t\t\t\txhr.onerror = function()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//setProgress(0, 'XHR error.');\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\txhr.upload.onprogress = function(e)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\tif (e.lengthComputable)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar percentLoaded = Math.round((e.loaded / e.total) * 100);\n\t\t\t\t\t\t\t\tsetProgress(percentLoaded, percentLoaded == 100 ? 'Finalizing.' : 'Uploading.');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\txhr.setRequestHeader('Content-Type', file.type);\n\t\t\t\t\t\txhr.setRequestHeader('x-amz-acl', 'public-read');\n\n\t\t\t\t\t\txhr.send(file);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\tutils: function()\n\t\t{\n\t\t\treturn {\n\t\t\t\tisMobile: function()\n\t\t\t\t{\n\t\t\t\t\treturn /(iPhone|iPod|BlackBerry|Android)/.test(navigator.userAgent);\n\t\t\t\t},\n\t\t\t\tisDesktop: function()\n\t\t\t\t{\n\t\t\t\t\treturn !/(iPhone|iPod|iPad|BlackBerry|Android)/.test(navigator.userAgent);\n\t\t\t\t},\n\t\t\t\tisString: function(obj)\n\t\t\t\t{\n\t\t\t\t\treturn Object.prototype.toString.call(obj) == '[object String]';\n\t\t\t\t},\n\t\t\t\tisEmpty: function(html, removeEmptyTags)\n\t\t\t\t{\n\t\t\t\t\thtml = html.replace(/[\\u200B-\\u200D\\uFEFF]/g, '');\n\t\t\t\t\thtml = html.replace(/ /gi, '');\n\t\t\t\t\thtml = html.replace(/<\\/?br\\s?\\/?>/g, '');\n\t\t\t\t\thtml = html.replace(/\\s/g, '');\n\t\t\t\t\thtml = html.replace(/^

      [^\\W\\w\\D\\d]*?<\\/p>$/i, '');\n\t\t\t\t\thtml = html.replace(/])>$/i, 'iframe');\n\t\t\t\t\thtml = html.replace(/])>$/i, 'source');\n\n\t\t\t\t\t// remove empty tags\n\t\t\t\t\tif (removeEmptyTags !== false)\n\t\t\t\t\t{\n\t\t\t\t\t\thtml = html.replace(/<[^\\/>][^>]*><\\/[^>]+>/gi, '');\n\t\t\t\t\t\thtml = html.replace(/<[^\\/>][^>]*><\\/[^>]+>/gi, '');\n\t\t\t\t\t}\n\n\t\t\t\t\thtml = $.trim(html);\n\n\t\t\t\t\treturn html === '';\n\t\t\t\t},\n\t\t\t\tnormalize: function(str)\n\t\t\t\t{\n\t\t\t\t\tif (typeof(str) === 'undefined') return 0;\n\t\t\t\t\treturn parseInt(str.replace('px',''), 10);\n\t\t\t\t},\n\t\t\t\thexToRgb: function(hex)\n\t\t\t\t{\n\t\t\t\t\tif (typeof hex == 'undefined') return;\n\t\t\t\t\tif (hex.search(/^#/) == -1) return hex;\n\n\t\t\t\t\tvar shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n\t\t\t\t\thex = hex.replace(shorthandRegex, function(m, r, g, b)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn r + r + g + g + b + b;\n\t\t\t\t\t});\n\n\t\t\t\t\tvar result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n\t\t\t\t\treturn 'rgb(' + parseInt(result[1], 16) + ', ' + parseInt(result[2], 16) + ', ' + parseInt(result[3], 16) + ')';\n\t\t\t\t},\n\t\t\t\tgetOuterHtml: function(el)\n\t\t\t\t{\n\t\t\t\t\treturn $('

      ').append($(el).eq(0).clone()).html();\n\t\t\t\t},\n\t\t\t\tgetAlignmentElement: function(el)\n\t\t\t\t{\n\t\t\t\t\tif ($.inArray(el.tagName, this.opts.alignmentTags) !== -1)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn $(el);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\treturn $(el).closest(this.opts.alignmentTags.toString().toLowerCase(), this.$editor[0]);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tremoveEmptyAttr: function(el, attr)\n\t\t\t\t{\n\t\t\t\t\tvar $el = $(el);\n\t\t\t\t\tif (typeof $el.attr(attr) == 'undefined')\n\t\t\t\t\t{\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($el.attr(attr) === '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$el.removeAttr(attr);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn false;\n\t\t\t\t},\n\t\t\t\tremoveEmpty: function(i, s)\n\t\t\t\t{\n\t\t\t\t\tvar $s = $(s);\n\n\t\t\t\t\t$s.find('.redactor-invisible-space').removeAttr('style').removeAttr('class');\n\n\t\t\t\t\tif ($s.find('hr, br, img, iframe, source').length !== 0) return;\n\t\t\t\t\tvar text = $.trim($s.text());\n\t\t\t\t\tif (this.utils.isEmpty(text, false))\n\t\t\t\t\t{\n\t\t\t\t\t\t$s.remove();\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\t// save and restore scroll\n\t\t\t\tsaveScroll: function()\n\t\t\t\t{\n\t\t\t\t\tthis.saveEditorScroll = this.$editor.scrollTop();\n\t\t\t\t\tthis.saveBodyScroll = $(window).scrollTop();\n\n\t\t\t\t\tif (this.opts.scrollTarget) this.saveTargetScroll = $(this.opts.scrollTarget).scrollTop();\n\t\t\t\t},\n\t\t\t\trestoreScroll: function()\n\t\t\t\t{\n\t\t\t\t\tif (typeof this.saveScroll === 'undefined' && typeof this.saveBodyScroll === 'undefined') return;\n\n\t\t\t\t\t$(window).scrollTop(this.saveBodyScroll);\n\t\t\t\t\tthis.$editor.scrollTop(this.saveEditorScroll);\n\n\t\t\t\t\tif (this.opts.scrollTarget) $(this.opts.scrollTarget).scrollTop(this.saveTargetScroll);\n\t\t\t\t},\n\n\t\t\t\t// get invisible space element\n\t\t\t\tcreateSpaceElement: function()\n\t\t\t\t{\n\t\t\t\t\tvar space = document.createElement('span');\n\t\t\t\t\tspace.className = 'redactor-invisible-space';\n\t\t\t\t\tspace.innerHTML = this.opts.invisibleSpace;\n\n\t\t\t\t\treturn space;\n\t\t\t\t},\n\n\t\t\t\t// replace\n\t\t\t\tremoveInlineTags: function(node)\n\t\t\t\t{\n\t\t\t\t\tvar tags = this.opts.inlineTags;\n\t\t\t\t\ttags.push('span');\n\n\t\t\t\t\tif (node.tagName == 'PRE') tags.push('a');\n\n\t\t\t\t\t$(node).find(tags.join(',')).not('span.redactor-selection-marker').contents().unwrap();\n\t\t\t\t},\n\t\t\t\treplaceWithContents: function(node, removeInlineTags)\n\t\t\t\t{\n\t\t\t\t\tvar self = this;\n\t\t\t\t\t$(node).replaceWith(function()\n\t\t\t\t\t{\n\t\t\t\t\t\tif (removeInlineTags === true) self.utils.removeInlineTags(this);\n\n\t\t\t\t\t\treturn $(this).contents();\n\t\t\t\t\t});\n\n\t\t\t\t\treturn $(node);\n\t\t\t\t},\n\t\t\t\treplaceToTag: function(node, tag, removeInlineTags)\n\t\t\t\t{\n\t\t\t\t\tvar replacement;\n\t\t\t\t\tvar self = this;\n\t\t\t\t\t$(node).replaceWith(function()\n\t\t\t\t\t{\n\t\t\t\t\t\treplacement = $('<' + tag + ' />').append($(this).contents());\n\n\t\t\t\t\t\tfor (var i = 0; i < this.attributes.length; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treplacement.attr(this.attributes[i].name, this.attributes[i].value);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (removeInlineTags === true) self.utils.removeInlineTags(replacement);\n\n\t\t\t\t\t\treturn replacement;\n\t\t\t\t\t});\n\n\t\t\t\t\treturn replacement;\n\t\t\t\t},\n\n\t\t\t\t// start and end of element\n\t\t\t\tisStartOfElement: function()\n\t\t\t\t{\n\t\t\t\t\tvar block = this.selection.getBlock();\n\t\t\t\t\tif (!block) return false;\n\n\t\t\t\t\tvar offset = this.caret.getOffsetOfElement(block);\n\n\t\t\t\t\treturn (offset === 0) ? true : false;\n\t\t\t\t},\n\t\t\t\tisEndOfElement: function(element)\n\t\t\t\t{\n\t\t\t\t\tif (typeof element == 'undefined')\n\t\t\t\t\t{\n\t\t\t\t\t\tvar element = this.selection.getBlock();\n\t\t\t\t\t\tif (!element) return false;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar offset = this.caret.getOffsetOfElement(element);\n\t\t\t\t\tvar text = $.trim($(element).text()).replace(/\\n\\r\\n/g, '');\n\n\t\t\t\t\treturn (offset == text.length) ? true : false;\n\t\t\t\t},\n\t\t\t\tisEndOfEditor: function()\n\t\t\t\t{\n\t\t\t\t\tvar block = this.$editor[0];\n\n\t\t\t\t\tvar offset = this.caret.getOffsetOfElement(block);\n\t\t\t\t\tvar text = $.trim($(block).html().replace(/(<([^>]+)>)/gi,''));\n\n\t\t\t\t\treturn (offset == text.length) ? true : false;\n\t\t\t\t},\n\n\t\t\t\t// test blocks\n\t\t\t\tisBlock: function(block)\n\t\t\t\t{\n\t\t\t\t\tblock = block[0] || block;\n\n\t\t\t\t\treturn block && this.utils.isBlockTag(block.tagName);\n\t\t\t\t},\n\t\t\t\tisBlockTag: function(tag)\n\t\t\t\t{\n\t\t\t\t\tif (typeof tag == 'undefined') return false;\n\n\t\t\t\t\treturn this.reIsBlock.test(tag);\n\t\t\t\t},\n\n\t\t\t\t// tag detection\n\t\t\t\tisTag: function(current, tag)\n\t\t\t\t{\n\t\t\t\t\tvar element = $(current).closest(tag);\n\t\t\t\t\tif (element.length == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn element[0];\n\t\t\t\t\t}\n\n\t\t\t\t\treturn false;\n\t\t\t\t},\n\n\t\t\t\t// select all\n\t\t\t\tisSelectAll: function()\n\t\t\t\t{\n\t\t\t\t\treturn this.selectAll;\n\t\t\t\t},\n\t\t\t\tenableSelectAll: function()\n\t\t\t\t{\n\t\t\t\t\tthis.selectAll = true;\n\t\t\t\t},\n\t\t\t\tdisableSelectAll: function()\n\t\t\t\t{\n\t\t\t\t\tthis.selectAll = false;\n\t\t\t\t},\n\n\t\t\t\t// parents detection\n\t\t\t\tisRedactorParent: function(el)\n\t\t\t\t{\n\t\t\t\t\tif (!el)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($(el).parents('.redactor-editor').length === 0 || $(el).hasClass('redactor-editor'))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn el;\n\t\t\t\t},\n\t\t\t\tisCurrentOrParentHeader: function()\n\t\t\t\t{\n\t\t\t\t\treturn this.utils.isCurrentOrParent(['H1', 'H2', 'H3', 'H4', 'H5', 'H6']);\n\t\t\t\t},\n\t\t\t\tisCurrentOrParent: function(tagName)\n\t\t\t\t{\n\t\t\t\t\tvar parent = this.selection.getParent();\n\t\t\t\t\tvar current = this.selection.getCurrent();\n\n\t\t\t\t\tif ($.isArray(tagName))\n\t\t\t\t\t{\n\t\t\t\t\t\tvar matched = 0;\n\t\t\t\t\t\t$.each(tagName, $.proxy(function(i, s)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (this.utils.isCurrentOrParentOne(current, parent, s))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmatched++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, this));\n\n\t\t\t\t\t\treturn (matched === 0) ? false : true;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\treturn this.utils.isCurrentOrParentOne(current, parent, tagName);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tisCurrentOrParentOne: function(current, parent, tagName)\n\t\t\t\t{\n\t\t\t\t\ttagName = tagName.toUpperCase();\n\n\t\t\t\t\treturn parent && parent.tagName === tagName ? parent : current && current.tagName === tagName ? current : false;\n\t\t\t\t},\n\n\n\t\t\t\t// browsers detection\n\t\t\t\tisOldIe: function()\n\t\t\t\t{\n\t\t\t\t\treturn (this.utils.browser('msie') && parseInt(this.utils.browser('version'), 10) < 9) ? true : false;\n\t\t\t\t},\n\t\t\t\tisLessIe10: function()\n\t\t\t\t{\n\t\t\t\t\treturn (this.utils.browser('msie') && parseInt(this.utils.browser('version'), 10) < 10) ? true : false;\n\t\t\t\t},\n\t\t\t\tisIe11: function()\n\t\t\t\t{\n\t\t\t\t\treturn !!navigator.userAgent.match(/Trident\\/7\\./);\n\t\t\t\t},\n\t\t\t\tbrowser: function(browser)\n\t\t\t\t{\n\t\t\t\t\tvar ua = navigator.userAgent.toLowerCase();\n\t\t\t\t\tvar match = /(opr)[\\/]([\\w.]+)/.exec( ua ) ||\n\t\t /(chrome)[ \\/]([\\w.]+)/.exec( ua ) ||\n\t\t /(webkit)[ \\/]([\\w.]+).*(safari)[ \\/]([\\w.]+)/.exec(ua) ||\n\t\t /(webkit)[ \\/]([\\w.]+)/.exec( ua ) ||\n\t\t /(opera)(?:.*version|)[ \\/]([\\w.]+)/.exec( ua ) ||\n\t\t /(msie) ([\\w.]+)/.exec( ua ) ||\n\t\t ua.indexOf(\"trident\") >= 0 && /(rv)(?::| )([\\w.]+)/.exec( ua ) ||\n\t\t ua.indexOf(\"compatible\") < 0 && /(mozilla)(?:.*? rv:([\\w.]+)|)/.exec( ua ) ||\n\t\t [];\n\n\t\t\t\t\tif (browser == 'safari') return (typeof match[3] != 'undefined') ? match[3] == 'safari' : false;\n\t\t\t\t\tif (browser == 'version') return match[2];\n\t\t\t\t\tif (browser == 'webkit') return (match[1] == 'chrome' || match[1] == 'opr' || match[1] == 'webkit');\n\t\t\t\t\tif (match[1] == 'rv') return browser == 'msie';\n\t\t\t\t\tif (match[1] == 'opr') return browser == 'webkit';\n\n\t\t\t\t\treturn browser == match[1];\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t};\n\n\t$(window).on('load.tools.redactor', function()\n\t{\n\t\t$('[data-tools=\"redactor\"]').redactor();\n\t});\n\n\t// constructor\n\tRedactor.prototype.init.prototype = Redactor.prototype;\n\n\t// LINKIFY\n\t$.Redactor.fn.formatLinkify = function(protocol, convertLinks, convertUrlLinks, convertImageLinks, convertVideoLinks, linkSize)\n\t{\n\t\tvar urlCheck = '((?:http[s]?:\\\\/\\\\/(?:www\\\\.)?|www\\\\.){1}(?:[0-9A-Za-z\\\\-%_]+\\\\.)+[a-zA-Z]{2,}(?::[0-9]+)?(?:(?:/[0-9A-Za-z\\\\-#\\\\.%\\+_]*)+)?(?:\\\\?(?:[0-9A-Za-z\\\\-\\\\.%_]+(?:=[0-9A-Za-z\\\\-\\\\.%_\\\\+]*)?)?(?:&(?:[0-9A-Za-z\\\\-\\\\.%_]+(?:=[0-9A-Za-z\\\\-\\\\.%_\\\\+]*)?)?)*)?(?:#[0-9A-Za-z\\\\-\\\\.%_\\\\+=\\\\?&;]*)?)';\n\t\tvar regex = new RegExp(urlCheck, 'gi');\n\t\tvar rProtocol = /(https?|ftp):\\/\\//i;\n\t\tvar urlImage = new RegExp('(?:([^:/?#]+):)?(?:\\/\\/([^/?#]*))?([^?#]*\\\\.(?:jpg|gif|png))(?:\\\\?([^#]*))?(?:#(.*))?', 'gi');\n\n\t\tvar childNodes = (this.$editor ? this.$editor[0] : this).childNodes, i = childNodes.length;\n\t\twhile (i--)\n\t\t{\n\t\t\tvar n = childNodes[i];\n\n\t\t\tif (n.nodeType === 3 && n.parentNode !== 'PRE')\n\t\t\t{\n\t\t\t\tvar html = n.nodeValue;\n\n\t\t\t\t// youtube & vimeo\n\t\t\t\tif (convertVideoLinks && html)\n\t\t\t\t{\n\t\t\t\t\tvar iframeStart = '';\n\n\t\t\t\t\tif (html.match(reUrlYoutube))\n\t\t\t\t\t{\n\t\t\t\t\t\thtml = html.replace(reUrlYoutube, iframeStart + '//www.youtube.com/embed/$1' + iframeEnd);\n\t\t\t\t\t\t$(n).after(html).remove();\n\t\t\t\t\t}\n\t\t\t\t\telse if (html.match(reUrlVimeo))\n\t\t\t\t\t{\n\t\t\t\t\t\thtml = html.replace(reUrlVimeo, iframeStart + '//player.vimeo.com/video/$2' + iframeEnd);\n\t\t\t\t\t\t$(n).after(html).remove();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// image\n\t\t\t\tif (convertImageLinks && html && html.match(urlImage))\n\t\t\t\t{\n\t\t\t\t\tvar matches = html.match(urlImage);\n\t\t\t\t\thtml = html.replace(urlImage, '');\n\n\t\t\t\t\t$(n).after(html).remove();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// link\n\t\t\t\tif (html.search(/\\$/g) != -1) html = html.replace(/\\$/g, '$');\n\n\t\t\t\tvar matches = html.match(regex);\n\t\t\t\tif (convertUrlLinks && html && matches)\n\t\t\t\t{\n\t\t\t\t\tvar len = matches.length;\n\t\t\t\t\tfor (var z = 0; z < len; z++)\n\t\t\t\t\t{\n\t\t\t\t\t\t// remove dot in the end\n\t\t\t\t\t\tif (matches[z].match(/\\.$/) !== null) matches[z] = matches[z].replace(/\\.$/, '');\n\n\t\t\t\t\t\tvar href = matches[z];\n\t\t\t\t\t\tvar text = href;\n\n\t\t\t\t\t\tvar space = '';\n\t\t\t\t\t\tif (href.match(/\\s$/) !== null) space = ' ';\n\n\t\t\t\t\t\tvar addProtocol = protocol + '://';\n\t\t\t\t\t\tif (href.match(rProtocol) !== null) addProtocol = '';\n\n\t\t\t\t\t\tif (text.length > linkSize) text = text.substring(0, linkSize) + '...';\n\t\t\t\t\t\ttext = text.replace(/$/g, '$').replace(/&/g, '&').replace(//g, '>');\n\n\t\t\t\t\t\t// buffer\n\t\t\t\t\t\tvar buffer = [];\n\t\t\t\t\t\tvar links = html.match('');\n\t\t\t\t\t\tif (links !== null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar len = links.length;\n\t\t\t\t\t\t\tfor (i = 0; i < len; i++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbuffer[i] = links[i];\n\t\t\t\t\t\t\t\thtml = html.replace(links[i], '{abuffer' + i + '}');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\thtml = html.replace(href, '' + $.trim(text) + '' + space);\n\n\t\t\t\t\t\t// rebuffer\n\t\t\t\t\t\t$.each(buffer, function(i,s)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\thtml = html.replace('{abuffer' + i + '}', s);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\t$(n).after(html).remove();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (n.nodeType === 1 && !/^(pre|a|button|textarea)$/i.test(n.tagName))\n\t\t\t{\n\t\t\t\t$.Redactor.fn.formatLinkify.call(n, protocol, convertLinks, convertUrlLinks, convertImageLinks, convertVideoLinks, linkSize);\n\t\t\t}\n\t\t}\n\t};\n\n})(jQuery);", "if (!RedactorPlugins) var RedactorPlugins = {};\n\n(function($)\n{\n\tRedactorPlugins.fontsize = function()\n\t{\n\t\treturn {\n\t\t\tinit: function()\n\t\t\t{\n\t\t\t\tvar fonts = [10, 11, 12, 14, 16, 18, 20, 24, 28, 30];\n\t\t\t\tvar that = this;\n\t\t\t\tvar dropdown = {};\n\n\t\t\t\t$.each(fonts, function(i, s)\n\t\t\t\t{\n\t\t\t\t\tdropdown['s' + i] = { title: s + 'px', func: function() { that.fontsize.set(s); } };\n\t\t\t\t});\n\n\t\t\t\tdropdown.remove = { title: 'Remove Font Size', func: that.fontsize.reset };\n\n\t\t\t\tvar button = this.button.add('fontsize', 'Change Font Size');\n\t\t\t\tthis.button.addDropdown(button, dropdown);\n\t\t\t},\n\t\t\tset: function(size)\n\t\t\t{\n\t\t\t\tthis.inline.format('span', 'style', 'font-size: ' + size + 'px;');\n\t\t\t},\n\t\t\treset: function()\n\t\t\t{\n\t\t\t\tthis.inline.removeStyleRule('font-size');\n\t\t\t}\n\t\t};\n\t};\n})(jQuery);", "if (!RedactorPlugins) var RedactorPlugins = {};\n\n(function($)\n{\n\tRedactorPlugins.table = function()\n\t{\n\t\treturn {\n\t\t\tgetTemplate: function()\n\t\t\t{\n\t\t\t\treturn String()\n\t\t\t\t+ '
      '\n\t\t\t\t\t+ ''\n\t\t\t\t\t+ ''\n\t\t\t\t\t+ ''\n\t\t\t\t\t+ ''\n\t\t\t\t+ '
      ';\n\t\t\t},\n\t\t\tinit: function()\n\t\t\t{\n\n\t\t\t\tvar dropdown = {};\n\n\t\t\t\tdropdown.insert_table = { title: this.lang.get('insert_table'), func: this.table.show };\n\t\t\t\tdropdown.insert_row_above = { title: this.lang.get('insert_row_above'), func: this.table.addRowAbove };\n\t\t\t\tdropdown.insert_row_below = { title: this.lang.get('insert_row_below'), func: this.table.addRowBelow };\n\t\t\t\tdropdown.insert_column_left = { title: this.lang.get('insert_column_left'), func: this.table.addColumnLeft };\n\t\t\t\tdropdown.insert_column_right = { title: this.lang.get('insert_column_right'), func: this.table.addColumnRight };\n\t\t\t\tdropdown.add_head = { title: this.lang.get('add_head'), func: this.table.addHead };\n\t\t\t\tdropdown.delete_head = { title: this.lang.get('delete_head'), func: this.table.deleteHead };\n\t\t\t\tdropdown.delete_column = { title: this.lang.get('delete_column'), func: this.table.deleteColumn };\n\t\t\t\tdropdown.delete_row = { title: this.lang.get('delete_row'), func: this.table.deleteRow };\n\t\t\t\tdropdown.delete_table = { title: this.lang.get('delete_table'), func: this.table.deleteTable };\n\n\t\t\t\tthis.observe.addButton('td', 'table');\n\t\t\t\tthis.observe.addButton('th', 'table');\n\n\t\t\t\tvar button = this.button.addBefore('link', 'table', this.lang.get('table'));\n\t\t\t\tthis.button.addDropdown(button, dropdown);\n\t\t\t},\n\t\t\tshow: function()\n\t\t\t{\n\t\t\t\tthis.modal.addTemplate('table', this.table.getTemplate());\n\n\t\t\t\tthis.modal.load('table', this.lang.get('insert_table'), 300);\n\t\t\t\tthis.modal.createCancelButton();\n\n\t\t\t\tvar button = this.modal.createActionButton(this.lang.get('insert'));\n\t\t\t\tbutton.on('click', this.table.insert);\n\n\t\t\t\tthis.selection.save();\n\t\t\t\tthis.modal.show();\n\n\t\t\t\t$('#redactor-table-rows').focus();\n\n\t\t\t},\n\t\t\tinsert: function()\n\t\t\t{\n\n\t\t\t\tvar rows = $('#redactor-table-rows').val(),\n\t\t\t\t\tcolumns = $('#redactor-table-columns').val(),\n\t\t\t\t\t$tableBox = $('
      '),\n\t\t\t\t\ttableId = Math.floor(Math.random() * 99999),\n\t\t\t\t\t$table = $('
      '),\n\t\t\t\t\ti, $row, z, $column;\n\n\t\t\t\tfor (i = 0; i < rows; i++)\n\t\t\t\t{\n\t\t\t\t\t$row = $('');\n\n\t\t\t\t\tfor (z = 0; z < columns; z++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$column = $('' + this.opts.invisibleSpace + '');\n\n\t\t\t\t\t\t// set the focus to the first td\n\t\t\t\t\t\tif (i === 0 && z === 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$column.append(this.selection.getMarker());\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$($row).append($column);\n\t\t\t\t\t}\n\n\t\t\t\t\t$table.append($row);\n\t\t\t\t}\n\n\t\t\t\t$tableBox.append($table);\n\t\t\t\tvar html = $tableBox.html();\n\n\n\t\t\t\tthis.modal.close();\n\t\t\t\tthis.selection.restore();\n\n\t\t\t\tif (this.table.getTable()) return;\n\n\t\t\t\tthis.buffer.set();\n\n\t\t\t\tvar current = this.selection.getBlock() || this.selection.getCurrent();\n\t\t\t\tif (current && current.tagName != 'BODY')\n\t\t\t\t{\n\t\t\t\t\tif (current.tagName == 'LI') current = $(current).closest('ul, ol');\n\t\t\t\t\t$(current).after(html);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.insert.html(html);\n\t\t\t\t}\n\n\t\t\t\tthis.selection.restore();\n\n\t\t\t\tvar table = this.$editor.find('#table' + tableId);\n\n\t\t\t\tif (!this.opts.linebreaks && (this.utils.browser('mozilla') || this.utils.browser('msie')))\n\t\t\t\t{\n\t\t\t\t\tvar $next = table.next();\n\t\t\t\t\tif ($next.length === 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t table.after(this.opts.emptyHtml);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.observe.buttons();\n\n\t\t\t\ttable.find('span.redactor-selection-marker').remove();\n\t\t\t\ttable.removeAttr('id');\n\n\t\t\t\tthis.code.sync();\n\t\t\t\tthis.core.setCallback('insertedTable', table);\n\t\t\t},\n\t\t\tgetTable: function()\n\t\t\t{\n\t\t\t\tvar $table = $(this.selection.getParent()).closest('table');\n\n\t\t\t\tif (!this.utils.isRedactorParent($table)) return false;\n\t\t\t\tif ($table.size() === 0) return false;\n\n\t\t\t\treturn $table;\n\t\t\t},\n\t\t\trestoreAfterDelete: function($table)\n\t\t\t{\n\t\t\t\tthis.selection.restore();\n\t\t\t\t$table.find('span.redactor-selection-marker').remove();\n\t\t\t\tthis.code.sync();\n\t\t\t},\n\t\t\tdeleteTable: function()\n\t\t\t{\n\t\t\t\tvar $table = this.table.getTable();\n\t\t\t\tif (!$table) return;\n\n\t\t\t\tthis.buffer.set();\n\n\n\t\t\t\tvar $next = $table.next();\n\t\t\t\tif (!this.opts.linebreaks && $next.length !== 0)\n\t\t\t\t{\n\t\t\t\t\tthis.caret.setStart($next);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.caret.setAfter($table);\n\t\t\t\t}\n\n\n\t\t\t\t$table.remove();\n\n\t\t\t\tthis.code.sync();\n\t\t\t},\n\t\t\tdeleteRow: function()\n\t\t\t{\n\t\t\tvar $table = this.table.getTable();\n\t\t\tif (!$table) return;\n\n\t\t\tvar $current = $(this.selection.getCurrent());\n\n\t\t\tthis.buffer.set();\n\n\t\t\tvar $current_tr = $current.closest('tr');\n\t\t\tvar $focus_tr = $current_tr.prev().length ? $current_tr.prev() : $current_tr.next();\n\t\t\tif ($focus_tr.length)\n\t\t\t{\n\t\t\t\tvar $focus_td = $focus_tr.children('td, th').first();\n\t\t\t\tif ($focus_td.length) $focus_td.prepend(this.selection.getMarker());\n\t\t\t}\n\n\t\t\t$current_tr.remove();\n\t\t\tthis.table.restoreAfterDelete($table);\n\t\t},\n\t\t\tdeleteColumn: function()\n\t\t\t{\n\t\t\tvar $table = this.table.getTable();\n\t\t\tif (!$table) return;\n\n\t\t\tthis.buffer.set();\n\n\t\t\tvar $current = $(this.selection.getCurrent());\n\t\t\tvar $current_td = $current.closest('td, th');\n\t\t\tvar index = $current_td[0].cellIndex;\n\n\t\t\t$table.find('tr').each($.proxy(function(i, elem)\n\t\t\t{\n\t\t\t\tvar $elem = $(elem);\n\t\t\t\tvar focusIndex = index - 1 < 0 ? index + 1 : index - 1;\n\t\t\t\tif (i === 0) $elem.find('td, th').eq(focusIndex).prepend(this.selection.getMarker());\n\n\t\t\t\t$elem.find('td, th').eq(index).remove();\n\n\t\t\t}, this));\n\n\t\t\tthis.table.restoreAfterDelete($table);\n\t\t},\n\t\t\taddHead: function()\n\t\t\t{\n\t\t\t\tvar $table = this.table.getTable();\n\t\t\t\tif (!$table) return;\n\n\t\t\t\tthis.buffer.set();\n\n\t\t\t\tif ($table.find('thead').size() !== 0)\n\t\t\t\t{\n\t\t\t\t\tthis.table.deleteHead();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar tr = $table.find('tr').first().clone();\n\t\t\t\ttr.find('td').replaceWith($.proxy(function()\n\t\t\t\t{\n\t\t\t\t\treturn $('').html(this.opts.invisibleSpace);\n\t\t\t\t}, this));\n\n\t\t\t\t$thead = $('').append(tr);\n\t\t\t\t$table.prepend($thead);\n\n\t\t\t\tthis.code.sync();\n\n\t\t\t},\n\t\t\tdeleteHead: function()\n\t\t\t{\n\t\t\t\tvar $table = this.table.getTable();\n\t\t\t\tif (!$table) return;\n\n\t\t\t\tvar $thead = $table.find('thead');\n\t\t\t\tif ($thead.size() === 0) return;\n\n\t\t\t\tthis.buffer.set();\n\n\t\t\t\t$thead.remove();\n\t\t\t\tthis.code.sync();\n\t\t\t},\n\t\t\taddRowAbove: function()\n\t\t\t{\n\t\t\t\tthis.table.addRow('before');\n\t\t\t},\n\t\t\taddRowBelow: function()\n\t\t\t{\n\t\t\t\tthis.table.addRow('after');\n\t\t\t},\n\t\t\taddColumnLeft: function()\n\t\t\t{\n\t\t\t\tthis.table.addColumn('before');\n\t\t\t},\n\t\t\taddColumnRight: function()\n\t\t\t{\n\t\t\t\tthis.table.addColumn('after');\n\t\t\t},\n\t\t\taddRow: function(type)\n\t\t\t{\n\t\t\t\tvar $table = this.table.getTable();\n\t\t\t\tif (!$table) return;\n\n\t\t\t\tthis.buffer.set();\n\n\t\t\t\tvar $current = $(this.selection.getCurrent());\n\t\t\t\tvar $current_tr = $current.closest('tr');\n\t\t\t\tvar new_tr = $current_tr.clone();\n\n\t\t\t\tnew_tr.find('th').replaceWith(function()\n\t\t\t\t{\n\t\t\t\t\tvar $td = $('');\n\t\t\t\t\t$td[0].attributes = this.attributes;\n\n\t\t\t\t\treturn $td.append($(this).contents());\n\t\t\t\t});\n\n\t\t\t\tnew_tr.find('td').html(this.opts.invisibleSpace);\n\n\t\t\t\tif (type == 'after')\n\t\t\t\t{\n\t\t\t\t\t$current_tr.after(new_tr);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$current_tr.before(new_tr);\n\t\t\t\t}\n\n\t\t\t\tthis.code.sync();\n\t\t\t},\n\t\t\taddColumn: function (type)\n\t\t\t{\n\t\t\t\tvar $table = this.table.getTable();\n\t\t\t\tif (!$table) return;\n\n\t\t\t\tvar index = 0;\n\t\t\t\tvar current = $(this.selection.getCurrent());\n\n\t\t\t\tthis.buffer.set();\n\n\t\t\t\tvar $current_tr = current.closest('tr');\n\t\t\t\tvar $current_td = current.closest('td, th');\n\n\t\t\t\t$current_tr.find('td, th').each($.proxy(function(i, elem)\n\t\t\t\t{\n\t\t\t\t\tif ($(elem)[0] === $current_td[0]) index = i;\n\n\t\t\t\t}, this));\n\n\t\t\t\t$table.find('tr').each($.proxy(function(i, elem)\n\t\t\t\t{\n\t\t\t\t\tvar $current = $(elem).find('td, th').eq(index);\n\n\t\t\t\t\tvar td = $current.clone();\n\t\t\t\t\ttd.html(this.opts.invisibleSpace);\n\n\t\t\t\t\tif (type == 'after')\n\t\t\t\t\t{\n\t\t\t\t\t\t$current.after(td);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$current.before(td);\n\t\t\t\t\t}\n\n\t\t\t\t}, this));\n\n\t\t\t\tthis.code.sync();\n\t\t\t}\n\t\t};\n\t};\n})(jQuery);", "if (!RedactorPlugins) var RedactorPlugins = {};\n\n(function($)\n{\n\tRedactorPlugins.imagemanager = function()\n\t{\n\t\treturn {\n\t\t\tinit: function()\n\t\t\t{\n\t\t\t\tif (!this.opts.imageManagerJson) return;\n\n\t\t\t\tthis.modal.addCallback('image', this.imagemanager.load);\n\t\t\t},\n\t\t\tload: function()\n\t\t\t{\n\t\t\t\tvar $modal = this.modal.getModal();\n\n\t\t\t\tthis.modal.createTabber($modal);\n\t\t\t\tthis.modal.addTab(1, 'Upload', 'active');\n\t\t\t\tthis.modal.addTab(2, 'Choose');\n\n\t\t\t\t$('#redactor-modal-image-droparea').addClass('redactor-tab redactor-tab1');\n\n\t\t\t\tvar $box = $('
      ').hide();\n\t\t\t\t$modal.append($box);\n\n\t\t\t\t$.ajax({\n\t\t\t\t dataType: \"json\",\n\t\t\t\t cache: false,\n\t\t\t\t url: this.opts.imageManagerJson,\n\t\t\t\t success: $.proxy(function(data)\n\t\t\t\t\t{\n\t\t\t\t\t\t$.each(data, $.proxy(function(key, val)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// title\n\t\t\t\t\t\t\tvar thumbtitle = '';\n\t\t\t\t\t\t\tif (typeof val.title !== 'undefined') thumbtitle = val.title;\n\n\t\t\t\t\t\t\tvar img = $('');\n\t\t\t\t\t\t\t$('#redactor-image-manager-box').append(img);\n\t\t\t\t\t\t\t$(img).click($.proxy(this.imagemanager.insert, this));\n\n\t\t\t\t\t\t}, this));\n\n\n\t\t\t\t\t}, this)\n\t\t\t\t});\n\n\n\t\t\t},\n\t\t\tinsert: function(e)\n\t\t\t{\n\t\t\t\tthis.image.insert('\"'');\n\t\t\t}\n\t\t};\n\t};\n})(jQuery);", "if (!RedactorPlugins) var RedactorPlugins = {};\n\n(function($)\n{\n\tRedactorPlugins.video = function()\n\t{\n\t\treturn {\n\t\t\treUrlYoutube: /https?:\\/\\/(?:[0-9A-Z-]+\\.)?(?:youtu\\.be\\/|youtube\\.com\\S*[^\\w\\-\\s])([\\w\\-]{11})(?=[^\\w\\-]|$)(?![?=&+%\\w.-]*(?:['\"][^<>]*>|<\\/a>))[?=&+%\\w.-]*/ig,\n\t\t\treUrlVimeo: /https?:\\/\\/(www\\.)?vimeo.com\\/(\\d+)($|\\/)/,\n\t\t\tgetTemplate: function()\n\t\t\t{\n\t\t\t\treturn String()\n\t\t\t\t+ '
      '\n\t\t\t\t\t+ ''\n\t\t\t\t\t+ ''\n\t\t\t\t+ '
      ';\n\t\t\t},\n\t\t\tinit: function()\n\t\t\t{\n\t\t\t\tvar button = this.button.addAfter('image', 'video', this.lang.get('video'));\n\t\t\t\tthis.button.addCallback(button, this.video.show);\n\t\t\t},\n\t\t\tshow: function()\n\t\t\t{\n\t\t\t\tthis.modal.addTemplate('video', this.video.getTemplate());\n\n\t\t\t\tthis.modal.load('video', this.lang.get('video'), 700);\n\t\t\t\tthis.modal.createCancelButton();\n\n\t\t\t\tvar button = this.modal.createActionButton(this.lang.get('insert'));\n\t\t\t\tbutton.on('click', this.video.insert);\n\n\t\t\t\tthis.selection.save();\n\t\t\t\tthis.modal.show();\n\n\t\t\t\t$('#redactor-insert-video-area').focus();\n\n\t\t\t},\n\t\t\tinsert: function()\n\t\t\t{\n\t\t\t\tvar data = $('#redactor-insert-video-area').val();\n\n\t\t\t\tif (!data.match(/ for more pretty error display\n if(msg) {\n lines = (''+msg).split('\\n');\n for (var i = 0; i < lines.length; i++) {\n lines[i] = $('
      ').text(lines[i]).html();\n }\n msg = lines.join('
      ');\n }\n $group.addClass($.fn.editableform.errorGroupClass);\n $block.addClass($.fn.editableform.errorBlockClass).html(msg).show();\n }\n },\n\n submit: function(e) {\n e.stopPropagation();\n e.preventDefault();\n \n //get new value from input\n var newValue = this.input.input2value(); \n\n //validation: if validate returns string or truthy value - means error\n //if returns object like {newValue: '...'} => submitted value is reassigned to it\n var error = this.validate(newValue);\n if ($.type(error) === 'object' && error.newValue !== undefined) {\n newValue = error.newValue;\n this.input.value2input(newValue);\n if(typeof error.msg === 'string') {\n this.error(error.msg);\n this.showForm();\n return;\n }\n } else if (error) {\n this.error(error);\n this.showForm();\n return;\n } \n \n //if value not changed --> trigger 'nochange' event and return\n /*jslint eqeq: true*/\n if (!this.options.savenochange && this.input.value2str(newValue) == this.input.value2str(this.value)) {\n /*jslint eqeq: false*/ \n /** \n Fired when value not changed but form is submitted. Requires savenochange = false.\n @event nochange \n @param {Object} event event object\n **/ \n this.$div.triggerHandler('nochange'); \n return;\n } \n\n //convert value for submitting to server\n var submitValue = this.input.value2submit(newValue);\n \n this.isSaving = true;\n \n //sending data to server\n $.when(this.save(submitValue))\n .done($.proxy(function(response) {\n this.isSaving = false;\n\n //run success callback\n var res = typeof this.options.success === 'function' ? this.options.success.call(this.options.scope, response, newValue) : null;\n\n //if success callback returns false --> keep form open and do not activate input\n if(res === false) {\n this.error(false);\n this.showForm(false);\n return;\n }\n\n //if success callback returns string --> keep form open, show error and activate input \n if(typeof res === 'string') {\n this.error(res);\n this.showForm();\n return;\n }\n\n //if success callback returns object like {newValue: } --> use that value instead of submitted\n //it is usefull if you want to chnage value in url-function\n if(res && typeof res === 'object' && res.hasOwnProperty('newValue')) {\n newValue = res.newValue;\n }\n\n //clear error message\n this.error(false); \n this.value = newValue;\n /** \n Fired when form is submitted\n @event save \n @param {Object} event event object\n @param {Object} params additional params\n @param {mixed} params.newValue raw new value\n @param {mixed} params.submitValue submitted value as string\n @param {Object} params.response ajax response\n\n @example\n $('#form-div').on('save'), function(e, params){\n if(params.newValue === 'username') {...}\n });\n **/\n this.$div.triggerHandler('save', {newValue: newValue, submitValue: submitValue, response: response});\n }, this))\n .fail($.proxy(function(xhr) {\n this.isSaving = false;\n\n var msg;\n if(typeof this.options.error === 'function') {\n msg = this.options.error.call(this.options.scope, xhr, newValue);\n } else {\n msg = typeof xhr === 'string' ? xhr : xhr.responseText || xhr.statusText || 'Unknown error!';\n }\n\n this.error(msg);\n this.showForm();\n }, this));\n },\n\n save: function(submitValue) {\n //try parse composite pk defined as json string in data-pk \n this.options.pk = $.fn.editableutils.tryParseJson(this.options.pk, true); \n \n var pk = (typeof this.options.pk === 'function') ? this.options.pk.call(this.options.scope) : this.options.pk,\n /*\n send on server in following cases:\n 1. url is function\n 2. url is string AND (pk defined OR send option = always) \n */\n send = !!(typeof this.options.url === 'function' || (this.options.url && ((this.options.send === 'always') || (this.options.send === 'auto' && pk !== null && pk !== undefined)))),\n params;\n\n if (send) { //send to server\n this.showLoading();\n\n //standard params\n params = {\n name: this.options.name || '',\n value: submitValue,\n pk: pk \n };\n\n //additional params\n if(typeof this.options.params === 'function') {\n params = this.options.params.call(this.options.scope, params); \n } else {\n //try parse json in single quotes (from data-params attribute)\n this.options.params = $.fn.editableutils.tryParseJson(this.options.params, true); \n $.extend(params, this.options.params);\n }\n\n if(typeof this.options.url === 'function') { //user's function\n return this.options.url.call(this.options.scope, params);\n } else { \n //send ajax to server and return deferred object\n return $.ajax($.extend({\n url : this.options.url,\n data : params,\n type : 'POST'\n }, this.options.ajaxOptions));\n }\n }\n }, \n\n validate: function (value) {\n if (value === undefined) {\n value = this.value;\n }\n if (typeof this.options.validate === 'function') {\n return this.options.validate.call(this.options.scope, value);\n }\n },\n\n option: function(key, value) {\n if(key in this.options) {\n this.options[key] = value;\n }\n \n if(key === 'value') {\n this.setValue(value);\n }\n \n //do not pass option to input as it is passed in editable-element\n },\n\n setValue: function(value, convertStr) {\n if(convertStr) {\n this.value = this.input.str2value(value);\n } else {\n this.value = value;\n }\n \n //if form is visible, update input\n if(this.$form && this.$form.is(':visible')) {\n this.input.value2input(this.value);\n } \n } \n };\n\n /*\n Initialize editableform. Applied to jQuery object.\n\n @method $().editableform(options)\n @params {Object} options\n @example\n var $form = $('<div>').editableform({\n type: 'text',\n name: 'username',\n url: '/post',\n value: 'vitaliy'\n });\n\n //to display form you should call 'render' method\n $form.editableform('render'); \n */\n $.fn.editableform = function (option) {\n var args = arguments;\n return this.each(function () {\n var $this = $(this), \n data = $this.data('editableform'), \n options = typeof option === 'object' && option; \n if (!data) {\n $this.data('editableform', (data = new EditableForm(this, options)));\n }\n\n if (typeof option === 'string') { //call method \n data[option].apply(data, Array.prototype.slice.call(args, 1));\n } \n });\n };\n\n //keep link to constructor to allow inheritance\n $.fn.editableform.Constructor = EditableForm; \n\n //defaults\n $.fn.editableform.defaults = {\n /* see also defaults for input */\n\n /**\n Type of input. Can be text|textarea|select|date|checklist\n\n @property type \n @type string\n @default 'text'\n **/\n type: 'text',\n /**\n Url for submit, e.g. '/post' \n If function - it will be called instead of ajax. Function should return deferred object to run fail/done callbacks.\n\n @property url \n @type string|function\n @default null\n @example\n url: function(params) {\n var d = new $.Deferred;\n if(params.value === 'abc') {\n return d.reject('error message'); //returning error via deferred object\n } else {\n //async saving data in js model\n someModel.asyncSaveMethod({\n ..., \n success: function(){\n d.resolve();\n }\n }); \n return d.promise();\n }\n } \n **/ \n url:null,\n /**\n Additional params for submit. If defined as object - it is **appended** to original ajax data (pk, name and value). \n If defined as function - returned object **overwrites** original ajax data.\n @example\n params: function(params) {\n //originally params contain pk, name and value\n params.a = 1;\n return params;\n }\n\n @property params \n @type object|function\n @default null\n **/ \n params:null,\n /**\n Name of field. Will be submitted on server. Can be taken from id attribute\n\n @property name \n @type string\n @default null\n **/ \n name: null,\n /**\n Primary key of editable object (e.g. record id in database). For composite keys use object, e.g. {id: 1, lang: 'en'}.\n Can be calculated dynamically via function.\n\n @property pk \n @type string|object|function\n @default null\n **/ \n pk: null,\n /**\n Initial value. If not defined - will be taken from element's content.\n For __select__ type should be defined (as it is ID of shown text).\n\n @property value \n @type string|object\n @default null\n **/ \n value: null,\n /**\n Value that will be displayed in input if original field value is empty (`null|undefined|''`).\n\n @property defaultValue \n @type string|object\n @default null\n @since 1.4.6\n **/ \n defaultValue: null,\n /**\n Strategy for sending data on server. Can be `auto|always|never`.\n When 'auto' data will be sent on server **only if pk and url defined**, otherwise new value will be stored locally.\n\n @property send \n @type string\n @default 'auto'\n **/ \n send: 'auto', \n /**\n Function for client-side validation. If returns string - means validation not passed and string showed as error.\n Since 1.5.1 you can modify submitted value by returning object from `validate`: \n `{newValue: '...'}` or `{newValue: '...', msg: '...'}`\n\n @property validate \n @type function\n @default null\n @example\n validate: function(value) {\n if($.trim(value) == '') {\n return 'This field is required';\n }\n }\n **/ \n validate: null,\n /**\n Success callback. Called when value successfully sent on server and **response status = 200**. \n Usefull to work with json response. For example, if your backend response can be {success: true}\n or {success: false, msg: \"server error\"} you can check it inside this callback. \n If it returns **string** - means error occured and string is shown as error message. \n If it returns **object like** {newValue: <something>} - it overwrites value, submitted by user. \n Otherwise newValue simply rendered into element.\n \n @property success \n @type function\n @default null\n @example\n success: function(response, newValue) {\n if(!response.success) return response.msg;\n }\n **/ \n success: null,\n /**\n Error callback. Called when request failed (response status != 200). \n Usefull when you want to parse error response and display a custom message.\n Must return **string** - the message to be displayed in the error block.\n \n @property error \n @type function\n @default null\n @since 1.4.4\n @example\n error: function(response, newValue) {\n if(response.status === 500) {\n return 'Service unavailable. Please try later.';\n } else {\n return response.responseText;\n }\n }\n **/ \n error: null,\n /**\n Additional options for submit ajax request.\n List of values: http://api.jquery.com/jQuery.ajax\n \n @property ajaxOptions \n @type object\n @default null\n @since 1.1.1 \n @example \n ajaxOptions: {\n type: 'put',\n dataType: 'json'\n } \n **/ \n ajaxOptions: null,\n /**\n Where to show buttons: left(true)|bottom|false \n Form without buttons is auto-submitted.\n\n @property showbuttons \n @type boolean|string\n @default true\n @since 1.1.1\n **/ \n showbuttons: true,\n /**\n Scope for callback methods (success, validate). \n If null means editableform instance itself. \n\n @property scope \n @type DOMElement|object\n @default null\n @since 1.2.0\n @private\n **/ \n scope: null,\n /**\n Whether to save or cancel value when it was not changed but form was submitted\n\n @property savenochange \n @type boolean\n @default false\n @since 1.2.0\n **/\n savenochange: false\n }; \n\n /*\n Note: following params could redefined in engine: bootstrap or jqueryui:\n Classes 'control-group' and 'editable-error-block' must always present!\n */ \n $.fn.editableform.template = '
      '+\n '
      ' + \n '
      '+\n '
      ' + \n '
      ' + \n '
      ';\n\n //loading div\n $.fn.editableform.loading = '
      ';\n\n //buttons\n $.fn.editableform.buttons = ''+\n ''; \n\n //error class attached to control-group\n $.fn.editableform.errorGroupClass = null; \n\n //error class attached to editable-error-block\n $.fn.editableform.errorBlockClass = 'editable-error';\n \n //engine\n $.fn.editableform.engine = 'jquery';\n}(window.jQuery));\n\n/**\n* EditableForm utilites\n*/\n(function ($) {\n \"use strict\";\n \n //utils\n $.fn.editableutils = {\n /**\n * classic JS inheritance function\n */ \n inherit: function (Child, Parent) {\n var F = function() { };\n F.prototype = Parent.prototype;\n Child.prototype = new F();\n Child.prototype.constructor = Child;\n Child.superclass = Parent.prototype;\n },\n\n /**\n * set caret position in input\n * see http://stackoverflow.com/questions/499126/jquery-set-cursor-position-in-text-area\n */ \n setCursorPosition: function(elem, pos) {\n if (elem.setSelectionRange) {\n elem.setSelectionRange(pos, pos);\n } else if (elem.createTextRange) {\n var range = elem.createTextRange();\n range.collapse(true);\n range.moveEnd('character', pos);\n range.moveStart('character', pos);\n range.select();\n }\n },\n\n /**\n * function to parse JSON in *single* quotes. (jquery automatically parse only double quotes)\n * That allows such code as:
      \n * safe = true --> means no exception will be thrown\n * for details see http://stackoverflow.com/questions/7410348/how-to-set-json-format-to-html5-data-attributes-in-the-jquery\n */\n tryParseJson: function(s, safe) {\n if (typeof s === 'string' && s.length && s.match(/^[\\{\\[].*[\\}\\]]$/)) {\n if (safe) {\n try {\n /*jslint evil: true*/\n s = (new Function('return ' + s))();\n /*jslint evil: false*/\n } catch (e) {} finally {\n return s;\n }\n } else {\n /*jslint evil: true*/\n s = (new Function('return ' + s))();\n /*jslint evil: false*/\n }\n }\n return s;\n },\n\n /**\n * slice object by specified keys\n */\n sliceObj: function(obj, keys, caseSensitive /* default: false */) {\n var key, keyLower, newObj = {};\n\n if (!$.isArray(keys) || !keys.length) {\n return newObj;\n }\n\n for (var i = 0; i < keys.length; i++) {\n key = keys[i];\n if (obj.hasOwnProperty(key)) {\n newObj[key] = obj[key];\n }\n\n if(caseSensitive === true) {\n continue;\n }\n\n //when getting data-* attributes via $.data() it's converted to lowercase.\n //details: http://stackoverflow.com/questions/7602565/using-data-attributes-with-jquery\n //workaround is code below.\n keyLower = key.toLowerCase();\n if (obj.hasOwnProperty(keyLower)) {\n newObj[key] = obj[keyLower];\n }\n }\n\n return newObj;\n },\n\n /*\n exclude complex objects from $.data() before pass to config\n */\n getConfigData: function($element) {\n var data = {};\n $.each($element.data(), function(k, v) {\n if(typeof v !== 'object' || (v && typeof v === 'object' && (v.constructor === Object || v.constructor === Array))) {\n data[k] = v;\n }\n });\n return data;\n },\n\n /*\n returns keys of object\n */\n objectKeys: function(o) {\n if (Object.keys) {\n return Object.keys(o); \n } else {\n if (o !== Object(o)) {\n throw new TypeError('Object.keys called on a non-object');\n }\n var k=[], p;\n for (p in o) {\n if (Object.prototype.hasOwnProperty.call(o,p)) {\n k.push(p);\n }\n }\n return k;\n }\n\n },\n \n /**\n method to escape html.\n **/\n escape: function(str) {\n return $('
      ').text(str).html();\n },\n \n /*\n returns array items from sourceData having value property equal or inArray of 'value'\n */\n itemsByValue: function(value, sourceData, valueProp) {\n if(!sourceData || value === null) {\n return [];\n }\n \n if (typeof(valueProp) !== \"function\") {\n var idKey = valueProp || 'value';\n valueProp = function (e) { return e[idKey]; };\n }\n \n var isValArray = $.isArray(value),\n result = [], \n that = this;\n\n $.each(sourceData, function(i, o) {\n if(o.children) {\n result = result.concat(that.itemsByValue(value, o.children, valueProp));\n } else {\n /*jslint eqeq: true*/\n if(isValArray) {\n if($.grep(value, function(v){ return v == (o && typeof o === 'object' ? valueProp(o) : o); }).length) {\n result.push(o); \n }\n } else {\n var itemValue = (o && (typeof o === 'object')) ? valueProp(o) : o;\n if(value == itemValue) {\n result.push(o); \n }\n }\n /*jslint eqeq: false*/\n }\n });\n \n return result;\n },\n \n /*\n Returns input by options: type, mode. \n */\n createInput: function(options) {\n var TypeConstructor, typeOptions, input,\n type = options.type;\n\n //`date` is some kind of virtual type that is transformed to one of exact types\n //depending on mode and core lib\n if(type === 'date') {\n //inline\n if(options.mode === 'inline') {\n if($.fn.editabletypes.datefield) {\n type = 'datefield';\n } else if($.fn.editabletypes.dateuifield) {\n type = 'dateuifield';\n }\n //popup\n } else {\n if($.fn.editabletypes.date) {\n type = 'date';\n } else if($.fn.editabletypes.dateui) {\n type = 'dateui';\n }\n }\n \n //if type still `date` and not exist in types, replace with `combodate` that is base input\n if(type === 'date' && !$.fn.editabletypes.date) {\n type = 'combodate';\n } \n }\n \n //`datetime` should be datetimefield in 'inline' mode\n if(type === 'datetime' && options.mode === 'inline') {\n type = 'datetimefield'; \n } \n\n //change wysihtml5 to textarea for jquery UI and plain versions\n if(type === 'wysihtml5' && !$.fn.editabletypes[type]) {\n type = 'textarea';\n }\n\n //create input of specified type. Input will be used for converting value, not in form\n if(typeof $.fn.editabletypes[type] === 'function') {\n TypeConstructor = $.fn.editabletypes[type];\n typeOptions = this.sliceObj(options, this.objectKeys(TypeConstructor.defaults));\n input = new TypeConstructor(typeOptions);\n return input;\n } else {\n $.error('Unknown type: '+ type);\n return false; \n } \n },\n \n //see http://stackoverflow.com/questions/7264899/detect-css-transitions-using-javascript-and-without-modernizr\n supportsTransitions: function () {\n var b = document.body || document.documentElement,\n s = b.style,\n p = 'transition',\n v = ['Moz', 'Webkit', 'Khtml', 'O', 'ms'];\n \n if(typeof s[p] === 'string') {\n return true; \n }\n\n // Tests for vendor specific prop\n p = p.charAt(0).toUpperCase() + p.substr(1);\n for(var i=0; i\nThis method applied internally in $().editable(). You should subscribe on it's events (save / cancel) to get profit of it.
      \nFinal realization can be different: bootstrap-popover, jqueryui-tooltip, poshytip, inline-div. It depends on which js file you include.
      \nApplied as jQuery method.\n\n@class editableContainer\n@uses editableform\n**/\n(function ($) {\n \"use strict\";\n\n var Popup = function (element, options) {\n this.init(element, options);\n };\n \n var Inline = function (element, options) {\n this.init(element, options);\n }; \n\n //methods\n Popup.prototype = {\n containerName: null, //method to call container on element\n containerDataName: null, //object name in element's .data()\n innerCss: null, //tbd in child class\n containerClass: 'editable-container editable-popup', //css class applied to container element\n defaults: {}, //container itself defaults\n \n init: function(element, options) {\n this.$element = $(element);\n //since 1.4.1 container do not use data-* directly as they already merged into options.\n this.options = $.extend({}, $.fn.editableContainer.defaults, options); \n this.splitOptions();\n \n //set scope of form callbacks to element\n this.formOptions.scope = this.$element[0]; \n \n this.initContainer();\n \n //flag to hide container, when saving value will finish\n this.delayedHide = false;\n\n //bind 'destroyed' listener to destroy container when element is removed from dom\n this.$element.on('destroyed', $.proxy(function(){\n this.destroy();\n }, this)); \n \n //attach document handler to close containers on click / escape\n if(!$(document).data('editable-handlers-attached')) {\n //close all on escape\n $(document).on('keyup.editable', function (e) {\n if (e.which === 27) {\n $('.editable-open').editableContainer('hide');\n //todo: return focus on element \n }\n });\n\n //close containers when click outside \n //(mousedown could be better than click, it closes everything also on drag drop)\n $(document).on('click.editable', function(e) {\n var $target = $(e.target), i,\n exclude_classes = ['.editable-container', \n '.ui-datepicker-header', \n '.datepicker', //in inline mode datepicker is rendered into body\n '.modal-backdrop', \n '.bootstrap-wysihtml5-insert-image-modal', \n '.bootstrap-wysihtml5-insert-link-modal'\n ];\n \n //check if element is detached. It occurs when clicking in bootstrap datepicker\n if (!$.contains(document.documentElement, e.target)) {\n return;\n }\n\n //for some reason FF 20 generates extra event (click) in select2 widget with e.target = document\n //we need to filter it via construction below. See https://github.com/vitalets/x-editable/issues/199\n //Possibly related to http://stackoverflow.com/questions/10119793/why-does-firefox-react-differently-from-webkit-and-ie-to-click-event-on-selec\n if($target.is(document)) {\n return; \n }\n \n //if click inside one of exclude classes --> no nothing\n for(i=0; i container changes size before hide. \n */ \n \n //if form already exist - delete previous data \n if(this.$form) {\n //todo: destroy prev data!\n //this.$form.destroy();\n }\n\n this.$form = $('
      ');\n \n //insert form into container body\n if(this.tip().is(this.innerCss)) {\n //for inline container\n this.tip().append(this.$form); \n } else {\n this.tip().find(this.innerCss).append(this.$form);\n } \n \n //render form\n this.renderForm();\n },\n\n /**\n Hides container with form\n @method hide()\n @param {string} reason Reason caused hiding. Can be save|cancel|onblur|nochange|undefined (=manual)\n **/ \n hide: function(reason) { \n if(!this.tip() || !this.tip().is(':visible') || !this.$element.hasClass('editable-open')) {\n return;\n }\n \n //if form is saving value, schedule hide\n if(this.$form.data('editableform').isSaving) {\n this.delayedHide = {reason: reason};\n return; \n } else {\n this.delayedHide = false;\n }\n\n this.$element.removeClass('editable-open'); \n this.innerHide();\n\n /**\n Fired when container was hidden. It occurs on both save or cancel. \n **Note:** Bootstrap popover has own `hidden` event that now cannot be separated from x-editable's one.\n The workaround is to check `arguments.length` that is always `2` for x-editable. \n\n @event hidden \n @param {object} event event object\n @param {string} reason Reason caused hiding. Can be save|cancel|onblur|nochange|manual\n @example\n $('#username').on('hidden', function(e, reason) {\n if(reason === 'save' || reason === 'cancel') {\n //auto-open next editable\n $(this).closest('tr').next().find('.editable').editable('show');\n } \n });\n **/\n this.$element.triggerHandler('hidden', reason || 'manual'); \n },\n\n /* internal show method. To be overwritten in child classes */\n innerShow: function () {\n \n }, \n\n /* internal hide method. To be overwritten in child classes */\n innerHide: function () {\n\n },\n \n /**\n Toggles container visibility (show / hide)\n @method toggle()\n @param {boolean} closeAll Whether to close all other editable containers when showing this one. Default true.\n **/ \n toggle: function(closeAll) {\n if(this.container() && this.tip() && this.tip().is(':visible')) {\n this.hide();\n } else {\n this.show(closeAll);\n } \n },\n\n /*\n Updates the position of container when content changed.\n @method setPosition()\n */ \n setPosition: function() {\n //tbd in child class\n },\n\n save: function(e, params) {\n /** \n Fired when new value was submitted. You can use $(this).data('editableContainer') inside handler to access to editableContainer instance\n \n @event save \n @param {Object} event event object\n @param {Object} params additional params\n @param {mixed} params.newValue submitted value\n @param {Object} params.response ajax response\n @example\n $('#username').on('save', function(e, params) {\n //assuming server response: '{success: true}'\n var pk = $(this).data('editableContainer').options.pk;\n if(params.response && params.response.success) {\n alert('value: ' + params.newValue + ' with pk: ' + pk + ' saved!');\n } else {\n alert('error!'); \n } \n });\n **/ \n this.$element.triggerHandler('save', params);\n \n //hide must be after trigger, as saving value may require methods of plugin, applied to input\n this.hide('save');\n },\n\n /**\n Sets new option\n \n @method option(key, value)\n @param {string} key \n @param {mixed} value \n **/ \n option: function(key, value) {\n this.options[key] = value;\n if(key in this.containerOptions) {\n this.containerOptions[key] = value;\n this.setContainerOption(key, value); \n } else {\n this.formOptions[key] = value;\n if(this.$form) {\n this.$form.editableform('option', key, value); \n }\n }\n },\n \n setContainerOption: function(key, value) {\n this.call('option', key, value);\n },\n\n /**\n Destroys the container instance\n @method destroy()\n **/ \n destroy: function() {\n this.hide();\n this.innerDestroy();\n this.$element.off('destroyed');\n this.$element.removeData('editableContainer');\n },\n \n /* to be overwritten in child classes */\n innerDestroy: function() {\n \n }, \n \n /*\n Closes other containers except one related to passed element. \n Other containers can be cancelled or submitted (depends on onblur option)\n */\n closeOthers: function(element) {\n $('.editable-open').each(function(i, el){\n //do nothing with passed element and it's children\n if(el === element || $(el).find(element).length) {\n return;\n }\n\n //otherwise cancel or submit all open containers \n var $el = $(el),\n ec = $el.data('editableContainer');\n\n if(!ec) {\n return; \n }\n \n if(ec.options.onblur === 'cancel') {\n $el.data('editableContainer').hide('onblur');\n } else if(ec.options.onblur === 'submit') {\n $el.data('editableContainer').tip().find('form').submit();\n }\n });\n\n },\n \n /**\n Activates input of visible container (e.g. set focus)\n @method activate()\n **/ \n activate: function() {\n if(this.tip && this.tip().is(':visible') && this.$form) {\n this.$form.data('editableform').input.activate(); \n }\n } \n\n };\n\n /**\n jQuery method to initialize editableContainer.\n \n @method $().editableContainer(options)\n @params {Object} options\n @example\n $('#edit').editableContainer({\n type: 'text',\n url: '/post',\n pk: 1,\n value: 'hello'\n });\n **/ \n $.fn.editableContainer = function (option) {\n var args = arguments;\n return this.each(function () {\n var $this = $(this),\n dataKey = 'editableContainer', \n data = $this.data(dataKey),\n options = typeof option === 'object' && option,\n Constructor = (options.mode === 'inline') ? Inline : Popup; \n\n if (!data) {\n $this.data(dataKey, (data = new Constructor(this, options)));\n }\n\n if (typeof option === 'string') { //call method \n data[option].apply(data, Array.prototype.slice.call(args, 1));\n } \n });\n }; \n\n //store constructors\n $.fn.editableContainer.Popup = Popup;\n $.fn.editableContainer.Inline = Inline;\n\n //defaults\n $.fn.editableContainer.defaults = {\n /**\n Initial value of form input\n\n @property value \n @type mixed\n @default null\n @private\n **/ \n value: null,\n /**\n Placement of container relative to element. Can be top|right|bottom|left. Not used for inline container.\n\n @property placement \n @type string\n @default 'top'\n **/ \n placement: 'top',\n /**\n Whether to hide container on save/cancel.\n\n @property autohide \n @type boolean\n @default true\n @private \n **/ \n autohide: true,\n /**\n Action when user clicks outside the container. Can be cancel|submit|ignore. \n Setting ignore allows to have several containers open. \n\n @property onblur \n @type string\n @default 'cancel'\n @since 1.1.1\n **/ \n onblur: 'cancel',\n \n /**\n Animation speed (inline mode only)\n @property anim \n @type string\n @default false\n **/ \n anim: false,\n \n /**\n Mode of editable, can be `popup` or `inline` \n \n @property mode \n @type string \n @default 'popup'\n @since 1.4.0 \n **/ \n mode: 'popup' \n };\n\n /* \n * workaround to have 'destroyed' event to destroy popover when element is destroyed\n * see http://stackoverflow.com/questions/2200494/jquery-trigger-event-when-an-element-is-removed-from-the-dom\n */\n jQuery.event.special.destroyed = {\n remove: function(o) {\n if (o.handler) {\n o.handler();\n }\n }\n }; \n\n}(window.jQuery));\n\n/**\n* Editable Inline \n* ---------------------\n*/\n(function ($) {\n \"use strict\";\n \n //copy prototype from EditableContainer\n //extend methods\n $.extend($.fn.editableContainer.Inline.prototype, $.fn.editableContainer.Popup.prototype, {\n containerName: 'editableform',\n innerCss: '.editable-inline',\n containerClass: 'editable-container editable-inline', //css class applied to container element\n \n initContainer: function(){\n //container is element\n this.$tip = $('');\n \n //convert anim to miliseconds (int)\n if(!this.options.anim) {\n this.options.anim = 0;\n } \n },\n \n splitOptions: function() {\n //all options are passed to form\n this.containerOptions = {};\n this.formOptions = this.options;\n },\n \n tip: function() {\n return this.$tip; \n },\n \n innerShow: function () {\n this.$element.hide();\n this.tip().insertAfter(this.$element).show();\n }, \n \n innerHide: function () {\n this.$tip.hide(this.options.anim, $.proxy(function() {\n this.$element.show();\n this.innerDestroy();\n }, this)); \n },\n \n innerDestroy: function() {\n if(this.tip()) {\n this.tip().empty().remove();\n }\n } \n });\n\n}(window.jQuery));\n/**\nMakes editable any HTML element on the page. Applied as jQuery method.\n\n@class editable\n@uses editableContainer\n**/\n(function ($) {\n \"use strict\";\n\n var Editable = function (element, options) {\n this.$element = $(element);\n //data-* has more priority over js options: because dynamically created elements may change data-* \n this.options = $.extend({}, $.fn.editable.defaults, options, $.fn.editableutils.getConfigData(this.$element)); \n if(this.options.selector) {\n this.initLive();\n } else {\n this.init();\n }\n \n //check for transition support\n if(this.options.highlight && !$.fn.editableutils.supportsTransitions()) {\n this.options.highlight = false;\n }\n };\n\n Editable.prototype = {\n constructor: Editable, \n init: function () {\n var isValueByText = false, \n doAutotext, finalize;\n\n //name\n this.options.name = this.options.name || this.$element.attr('id');\n \n //create input of specified type. Input needed already here to convert value for initial display (e.g. show text by id for select)\n //also we set scope option to have access to element inside input specific callbacks (e. g. source as function)\n this.options.scope = this.$element[0]; \n this.input = $.fn.editableutils.createInput(this.options);\n if(!this.input) {\n return; \n } \n\n //set value from settings or by element's text\n if (this.options.value === undefined || this.options.value === null) {\n this.value = this.input.html2value($.trim(this.$element.html()));\n isValueByText = true;\n } else {\n /*\n value can be string when received from 'data-value' attribute\n for complext objects value can be set as json string in data-value attribute, \n e.g. data-value=\"{city: 'Moscow', street: 'Lenina'}\"\n */\n this.options.value = $.fn.editableutils.tryParseJson(this.options.value, true); \n if(typeof this.options.value === 'string') {\n this.value = this.input.str2value(this.options.value);\n } else {\n this.value = this.options.value;\n }\n }\n \n //add 'editable' class to every editable element\n this.$element.addClass('editable');\n \n //specifically for \"textarea\" add class .editable-pre-wrapped to keep linebreaks\n if(this.input.type === 'textarea') {\n this.$element.addClass('editable-pre-wrapped');\n }\n \n //attach handler activating editable. In disabled mode it just prevent default action (useful for links)\n if(this.options.toggle !== 'manual') {\n this.$element.addClass('editable-click');\n this.$element.on(this.options.toggle + '.editable', $.proxy(function(e){\n //prevent following link if editable enabled\n if(!this.options.disabled) {\n e.preventDefault();\n }\n \n //stop propagation not required because in document click handler it checks event target\n //e.stopPropagation();\n \n if(this.options.toggle === 'mouseenter') {\n //for hover only show container\n this.show();\n } else {\n //when toggle='click' we should not close all other containers as they will be closed automatically in document click listener\n var closeAll = (this.options.toggle !== 'click');\n this.toggle(closeAll);\n }\n }, this));\n } else {\n this.$element.attr('tabindex', -1); //do not stop focus on element when toggled manually\n }\n \n //if display is function it's far more convinient to have autotext = always to render correctly on init\n //see https://github.com/vitalets/x-editable-yii/issues/34\n if(typeof this.options.display === 'function') {\n this.options.autotext = 'always';\n }\n \n //check conditions for autotext:\n switch(this.options.autotext) {\n case 'always':\n doAutotext = true;\n break;\n case 'auto':\n //if element text is empty and value is defined and value not generated by text --> run autotext\n doAutotext = !$.trim(this.$element.text()).length && this.value !== null && this.value !== undefined && !isValueByText;\n break;\n default:\n doAutotext = false;\n }\n\n //depending on autotext run render() or just finilize init\n $.when(doAutotext ? this.render() : true).then($.proxy(function() {\n if(this.options.disabled) {\n this.disable();\n } else {\n this.enable(); \n }\n /** \n Fired when element was initialized by `$().editable()` method. \n Please note that you should setup `init` handler **before** applying `editable`. \n \n @event init \n @param {Object} event event object\n @param {Object} editable editable instance (as here it cannot accessed via data('editable'))\n @since 1.2.0\n @example\n $('#username').on('init', function(e, editable) {\n alert('initialized ' + editable.options.name);\n });\n $('#username').editable();\n **/ \n this.$element.triggerHandler('init', this);\n }, this));\n },\n\n /*\n Initializes parent element for live editables \n */\n initLive: function() {\n //store selector \n var selector = this.options.selector;\n //modify options for child elements\n this.options.selector = false; \n this.options.autotext = 'never';\n //listen toggle events\n this.$element.on(this.options.toggle + '.editable', selector, $.proxy(function(e){\n var $target = $(e.target);\n if(!$target.data('editable')) {\n //if delegated element initially empty, we need to clear it's text (that was manually set to `empty` by user)\n //see https://github.com/vitalets/x-editable/issues/137 \n if($target.hasClass(this.options.emptyclass)) {\n $target.empty();\n }\n $target.editable(this.options).trigger(e);\n }\n }, this)); \n },\n \n /*\n Renders value into element's text.\n Can call custom display method from options.\n Can return deferred object.\n @method render()\n @param {mixed} response server response (if exist) to pass into display function\n */ \n render: function(response) {\n //do not display anything\n if(this.options.display === false) {\n return;\n }\n \n //if input has `value2htmlFinal` method, we pass callback in third param to be called when source is loaded\n if(this.input.value2htmlFinal) {\n return this.input.value2html(this.value, this.$element[0], this.options.display, response); \n //if display method defined --> use it \n } else if(typeof this.options.display === 'function') {\n return this.options.display.call(this.$element[0], this.value, response);\n //else use input's original value2html() method \n } else {\n return this.input.value2html(this.value, this.$element[0]); \n }\n },\n \n /**\n Enables editable\n @method enable()\n **/ \n enable: function() {\n this.options.disabled = false;\n this.$element.removeClass('editable-disabled');\n this.handleEmpty(this.isEmpty);\n if(this.options.toggle !== 'manual') {\n if(this.$element.attr('tabindex') === '-1') { \n this.$element.removeAttr('tabindex'); \n }\n }\n },\n \n /**\n Disables editable\n @method disable()\n **/ \n disable: function() {\n this.options.disabled = true; \n this.hide(); \n this.$element.addClass('editable-disabled');\n this.handleEmpty(this.isEmpty);\n //do not stop focus on this element\n this.$element.attr('tabindex', -1); \n },\n \n /**\n Toggles enabled / disabled state of editable element\n @method toggleDisabled()\n **/ \n toggleDisabled: function() {\n if(this.options.disabled) {\n this.enable();\n } else { \n this.disable(); \n }\n }, \n \n /**\n Sets new option\n \n @method option(key, value)\n @param {string|object} key option name or object with several options\n @param {mixed} value option new value\n @example\n $('.editable').editable('option', 'pk', 2);\n **/ \n option: function(key, value) {\n //set option(s) by object\n if(key && typeof key === 'object') {\n $.each(key, $.proxy(function(k, v){\n this.option($.trim(k), v); \n }, this)); \n return;\n }\n\n //set option by string \n this.options[key] = value; \n \n //disabled\n if(key === 'disabled') {\n return value ? this.disable() : this.enable();\n } \n \n //value\n if(key === 'value') {\n this.setValue(value);\n }\n \n //transfer new option to container! \n if(this.container) {\n this.container.option(key, value); \n }\n \n //pass option to input directly (as it points to the same in form)\n if(this.input.option) {\n this.input.option(key, value);\n }\n \n }, \n \n /*\n * set emptytext if element is empty\n */\n handleEmpty: function (isEmpty) {\n //do not handle empty if we do not display anything\n if(this.options.display === false) {\n return;\n }\n\n /* \n isEmpty may be set directly as param of method.\n It is required when we enable/disable field and can't rely on content \n as node content is text: \"Empty\" that is not empty %)\n */\n if(isEmpty !== undefined) { \n this.isEmpty = isEmpty;\n } else {\n //detect empty\n //for some inputs we need more smart check\n //e.g. wysihtml5 may have
      ,

      , \n if(typeof(this.input.isEmpty) === 'function') {\n this.isEmpty = this.input.isEmpty(this.$element); \n } else {\n this.isEmpty = $.trim(this.$element.html()) === '';\n }\n } \n \n //emptytext shown only for enabled\n if(!this.options.disabled) {\n if (this.isEmpty) {\n this.$element.html(this.options.emptytext);\n if(this.options.emptyclass) {\n this.$element.addClass(this.options.emptyclass);\n }\n } else if(this.options.emptyclass) {\n this.$element.removeClass(this.options.emptyclass);\n }\n } else {\n //below required if element disable property was changed\n if(this.isEmpty) {\n this.$element.empty();\n if(this.options.emptyclass) {\n this.$element.removeClass(this.options.emptyclass);\n }\n }\n }\n }, \n \n /**\n Shows container with form\n @method show()\n @param {boolean} closeAll Whether to close all other editable containers when showing this one. Default true.\n **/ \n show: function (closeAll) {\n if(this.options.disabled) {\n return;\n }\n \n //init editableContainer: popover, tooltip, inline, etc..\n if(!this.container) {\n var containerOptions = $.extend({}, this.options, {\n value: this.value,\n input: this.input //pass input to form (as it is already created)\n });\n this.$element.editableContainer(containerOptions);\n //listen `save` event \n this.$element.on(\"save.internal\", $.proxy(this.save, this));\n this.container = this.$element.data('editableContainer'); \n } else if(this.container.tip().is(':visible')) {\n return;\n } \n \n //show container\n this.container.show(closeAll);\n },\n \n /**\n Hides container with form\n @method hide()\n **/ \n hide: function () { \n if(this.container) { \n this.container.hide();\n }\n },\n \n /**\n Toggles container visibility (show / hide)\n @method toggle()\n @param {boolean} closeAll Whether to close all other editable containers when showing this one. Default true.\n **/ \n toggle: function(closeAll) {\n if(this.container && this.container.tip().is(':visible')) {\n this.hide();\n } else {\n this.show(closeAll);\n }\n },\n \n /*\n * called when form was submitted\n */ \n save: function(e, params) {\n //mark element with unsaved class if needed\n if(this.options.unsavedclass) {\n /*\n Add unsaved css to element if:\n - url is not user's function \n - value was not sent to server\n - params.response === undefined, that means data was not sent\n - value changed \n */\n var sent = false;\n sent = sent || typeof this.options.url === 'function';\n sent = sent || this.options.display === false; \n sent = sent || params.response !== undefined; \n sent = sent || (this.options.savenochange && this.input.value2str(this.value) !== this.input.value2str(params.newValue)); \n \n if(sent) {\n this.$element.removeClass(this.options.unsavedclass); \n } else {\n this.$element.addClass(this.options.unsavedclass); \n }\n }\n \n //highlight when saving\n if(this.options.highlight) {\n var $e = this.$element,\n bgColor = $e.css('background-color');\n \n $e.css('background-color', this.options.highlight);\n setTimeout(function(){\n if(bgColor === 'transparent') {\n bgColor = ''; \n }\n $e.css('background-color', bgColor);\n $e.addClass('editable-bg-transition');\n setTimeout(function(){\n $e.removeClass('editable-bg-transition'); \n }, 1700);\n }, 10);\n }\n \n //set new value\n this.setValue(params.newValue, false, params.response);\n \n /** \n Fired when new value was submitted. You can use $(this).data('editable') to access to editable instance\n \n @event save \n @param {Object} event event object\n @param {Object} params additional params\n @param {mixed} params.newValue submitted value\n @param {Object} params.response ajax response\n @example\n $('#username').on('save', function(e, params) {\n alert('Saved value: ' + params.newValue);\n });\n **/\n //event itself is triggered by editableContainer. Description here is only for documentation \n },\n\n validate: function () {\n if (typeof this.options.validate === 'function') {\n return this.options.validate.call(this, this.value);\n }\n },\n \n /**\n Sets new value of editable\n @method setValue(value, convertStr)\n @param {mixed} value new value \n @param {boolean} convertStr whether to convert value from string to internal format\n **/ \n setValue: function(value, convertStr, response) {\n if(convertStr) {\n this.value = this.input.str2value(value);\n } else {\n this.value = value;\n }\n if(this.container) {\n this.container.option('value', this.value);\n }\n $.when(this.render(response))\n .then($.proxy(function() {\n this.handleEmpty();\n }, this));\n },\n \n /**\n Activates input of visible container (e.g. set focus)\n @method activate()\n **/ \n activate: function() {\n if(this.container) {\n this.container.activate(); \n }\n },\n \n /**\n Removes editable feature from element\n @method destroy()\n **/ \n destroy: function() {\n this.disable();\n \n if(this.container) {\n this.container.destroy(); \n }\n \n this.input.destroy();\n\n if(this.options.toggle !== 'manual') {\n this.$element.removeClass('editable-click');\n this.$element.off(this.options.toggle + '.editable');\n } \n \n this.$element.off(\"save.internal\");\n \n this.$element.removeClass('editable editable-open editable-disabled');\n this.$element.removeData('editable');\n } \n };\n\n /* EDITABLE PLUGIN DEFINITION\n * ======================= */\n\n /**\n jQuery method to initialize editable element.\n \n @method $().editable(options)\n @params {Object} options\n @example\n $('#username').editable({\n type: 'text',\n url: '/post',\n pk: 1\n });\n **/\n $.fn.editable = function (option) {\n //special API methods returning non-jquery object\n var result = {}, args = arguments, datakey = 'editable';\n switch (option) {\n /**\n Runs client-side validation for all matched editables\n \n @method validate()\n @returns {Object} validation errors map\n @example\n $('#username, #fullname').editable('validate');\n // possible result:\n {\n username: \"username is required\",\n fullname: \"fullname should be minimum 3 letters length\"\n }\n **/\n case 'validate':\n this.each(function () {\n var $this = $(this), data = $this.data(datakey), error;\n if (data && (error = data.validate())) {\n result[data.options.name] = error;\n }\n });\n return result;\n\n /**\n Returns current values of editable elements. \n Note that it returns an **object** with name-value pairs, not a value itself. It allows to get data from several elements. \n If value of some editable is `null` or `undefined` it is excluded from result object.\n When param `isSingle` is set to **true** - it is supposed you have single element and will return value of editable instead of object. \n \n @method getValue()\n @param {bool} isSingle whether to return just value of single element\n @returns {Object} object of element names and values\n @example\n $('#username, #fullname').editable('getValue');\n //result:\n {\n username: \"superuser\",\n fullname: \"John\"\n }\n //isSingle = true\n $('#username').editable('getValue', true);\n //result \"superuser\" \n **/\n case 'getValue':\n if(arguments.length === 2 && arguments[1] === true) { //isSingle = true\n result = this.eq(0).data(datakey).value;\n } else {\n this.each(function () {\n var $this = $(this), data = $this.data(datakey);\n if (data && data.value !== undefined && data.value !== null) {\n result[data.options.name] = data.input.value2submit(data.value);\n }\n });\n }\n return result;\n\n /**\n This method collects values from several editable elements and submit them all to server. \n Internally it runs client-side validation for all fields and submits only in case of success. \n See
      creating new records for details. \n Since 1.5.1 `submit` can be applied to single element to send data programmatically. In that case\n `url`, `success` and `error` is taken from initial options and you can just call `$('#username').editable('submit')`. \n \n @method submit(options)\n @param {object} options \n @param {object} options.url url to submit data \n @param {object} options.data additional data to submit\n @param {object} options.ajaxOptions additional ajax options\n @param {function} options.error(obj) error handler \n @param {function} options.success(obj,config) success handler\n @returns {Object} jQuery object\n **/\n case 'submit': //collects value, validate and submit to server for creating new record\n var config = arguments[1] || {},\n $elems = this,\n errors = this.editable('validate');\n\n // validation ok\n if($.isEmptyObject(errors)) {\n var ajaxOptions = {};\n \n // for single element use url, success etc from options\n if($elems.length === 1) {\n var editable = $elems.data('editable');\n //standard params\n var params = {\n name: editable.options.name || '',\n value: editable.input.value2submit(editable.value),\n pk: (typeof editable.options.pk === 'function') ? \n editable.options.pk.call(editable.options.scope) : \n editable.options.pk \n };\n\n //additional params\n if(typeof editable.options.params === 'function') {\n params = editable.options.params.call(editable.options.scope, params); \n } else {\n //try parse json in single quotes (from data-params attribute)\n editable.options.params = $.fn.editableutils.tryParseJson(editable.options.params, true); \n $.extend(params, editable.options.params);\n }\n\n ajaxOptions = {\n url: editable.options.url,\n data: params,\n type: 'POST' \n };\n \n // use success / error from options \n config.success = config.success || editable.options.success;\n config.error = config.error || editable.options.error;\n \n // multiple elements\n } else {\n var values = this.editable('getValue'); \n \n ajaxOptions = {\n url: config.url,\n data: values, \n type: 'POST'\n }; \n } \n\n // ajax success callabck (response 200 OK)\n ajaxOptions.success = typeof config.success === 'function' ? function(response) {\n config.success.call($elems, response, config);\n } : $.noop;\n \n // ajax error callabck\n ajaxOptions.error = typeof config.error === 'function' ? function() {\n config.error.apply($elems, arguments);\n } : $.noop;\n \n // extend ajaxOptions \n if(config.ajaxOptions) { \n $.extend(ajaxOptions, config.ajaxOptions);\n }\n \n // extra data \n if(config.data) {\n $.extend(ajaxOptions.data, config.data);\n } \n \n // perform ajax request\n $.ajax(ajaxOptions);\n } else { //client-side validation error\n if(typeof config.error === 'function') {\n config.error.call($elems, errors);\n }\n }\n return this;\n }\n\n //return jquery object\n return this.each(function () {\n var $this = $(this), \n data = $this.data(datakey), \n options = typeof option === 'object' && option;\n\n //for delegated targets do not store `editable` object for element\n //it's allows several different selectors.\n //see: https://github.com/vitalets/x-editable/issues/312 \n if(options && options.selector) {\n data = new Editable(this, options);\n return; \n } \n \n if (!data) {\n $this.data(datakey, (data = new Editable(this, options)));\n }\n\n if (typeof option === 'string') { //call method \n data[option].apply(data, Array.prototype.slice.call(args, 1));\n } \n });\n }; \n \n\n $.fn.editable.defaults = {\n /**\n Type of input. Can be text|textarea|select|date|checklist and more\n\n @property type \n @type string\n @default 'text'\n **/\n type: 'text', \n /**\n Sets disabled state of editable\n\n @property disabled \n @type boolean\n @default false\n **/ \n disabled: false,\n /**\n How to toggle editable. Can be click|dblclick|mouseenter|manual. \n When set to manual you should manually call show/hide methods of editable. \n **Note**: if you call show or toggle inside **click** handler of some DOM element, \n you need to apply e.stopPropagation() because containers are being closed on any click on document.\n \n @example\n $('#edit-button').click(function(e) {\n e.stopPropagation();\n $('#username').editable('toggle');\n });\n\n @property toggle \n @type string\n @default 'click'\n **/ \n toggle: 'click',\n /**\n Text shown when element is empty.\n\n @property emptytext \n @type string\n @default 'Empty'\n **/ \n emptytext: 'Empty',\n /**\n Allows to automatically set element's text based on it's value. Can be auto|always|never. Useful for select and date.\n For example, if dropdown list is {1: 'a', 2: 'b'} and element's value set to 1, it's html will be automatically set to 'a'. \n auto - text will be automatically set only if element is empty. \n always|never - always(never) try to set element's text.\n\n @property autotext \n @type string\n @default 'auto'\n **/ \n autotext: 'auto', \n /**\n Initial value of input. If not set, taken from element's text. \n Note, that if element's text is empty - text is automatically generated from value and can be customized (see `autotext` option). \n For example, to display currency sign:\n @example\n \n \n \n @property value \n @type mixed\n @default element's text\n **/\n value: null,\n /**\n Callback to perform custom displaying of value in element's text. \n If `null`, default input's display used. \n If `false`, no displaying methods will be called, element's text will never change. \n Runs under element's scope. \n _**Parameters:**_ \n \n * `value` current value to be displayed\n * `response` server response (if display called after ajax submit), since 1.4.0\n \n For _inputs with source_ (select, checklist) parameters are different: \n \n * `value` current value to be displayed\n * `sourceData` array of items for current input (e.g. dropdown items) \n * `response` server response (if display called after ajax submit), since 1.4.0\n \n To get currently selected items use `$.fn.editableutils.itemsByValue(value, sourceData)`.\n \n @property display \n @type function|boolean\n @default null\n @since 1.2.0\n @example\n display: function(value, sourceData) {\n //display checklist as comma-separated values\n var html = [],\n checked = $.fn.editableutils.itemsByValue(value, sourceData);\n \n if(checked.length) {\n $.each(checked, function(i, v) { html.push($.fn.editableutils.escape(v.text)); });\n $(this).html(html.join(', '));\n } else {\n $(this).empty(); \n }\n }\n **/ \n display: null,\n /**\n Css class applied when editable text is empty.\n\n @property emptyclass \n @type string\n @since 1.4.1 \n @default editable-empty\n **/ \n emptyclass: 'editable-empty',\n /**\n Css class applied when value was stored but not sent to server (`pk` is empty or `send = 'never'`). \n You may set it to `null` if you work with editables locally and submit them together. \n\n @property unsavedclass \n @type string\n @since 1.4.1 \n @default editable-unsaved\n **/ \n unsavedclass: 'editable-unsaved',\n /**\n If selector is provided, editable will be delegated to the specified targets. \n Usefull for dynamically generated DOM elements. \n **Please note**, that delegated targets can't be initialized with `emptytext` and `autotext` options, \n as they actually become editable only after first click. \n You should manually set class `editable-click` to these elements. \n Also, if element originally empty you should add class `editable-empty`, set `data-value=\"\"` and write emptytext into element:\n\n @property selector \n @type string\n @since 1.4.1 \n @default null\n @example\n
      \n \n Empty\n \n Operator\n
      \n \n \n **/ \n selector: null,\n /**\n Color used to highlight element after update. Implemented via CSS3 transition, works in modern browsers.\n \n @property highlight \n @type string|boolean\n @since 1.4.5 \n @default #FFFF80 \n **/\n highlight: '#FFFF80'\n };\n \n}(window.jQuery));\n\n/**\nAbstractInput - base class for all editable inputs.\nIt defines interface to be implemented by any input type.\nTo create your own input you can inherit from this class.\n\n@class abstractinput\n**/\n(function ($) {\n \"use strict\";\n\n //types\n $.fn.editabletypes = {};\n\n var AbstractInput = function () { };\n\n AbstractInput.prototype = {\n /**\n Initializes input\n\n @method init() \n **/\n init: function(type, options, defaults) {\n this.type = type;\n this.options = $.extend({}, defaults, options);\n },\n\n /*\n this method called before render to init $tpl that is inserted in DOM\n */\n prerender: function() {\n this.$tpl = $(this.options.tpl); //whole tpl as jquery object \n this.$input = this.$tpl; //control itself, can be changed in render method\n this.$clear = null; //clear button\n this.error = null; //error message, if input cannot be rendered \n },\n \n /**\n Renders input from tpl. Can return jQuery deferred object.\n Can be overwritten in child objects\n\n @method render()\n **/\n render: function() {\n\n }, \n\n /**\n Sets element's html by value. \n\n @method value2html(value, element)\n @param {mixed} value\n @param {DOMElement} element\n **/\n value2html: function(value, element) {\n $(element)[this.options.escape ? 'text' : 'html']($.trim(value));\n },\n\n /**\n Converts element's html to value\n\n @method html2value(html)\n @param {string} html\n @returns {mixed}\n **/\n html2value: function(html) {\n return $('
      ').html(html).text();\n },\n\n /**\n Converts value to string (for internal compare). For submitting to server used value2submit().\n\n @method value2str(value) \n @param {mixed} value\n @returns {string}\n **/\n value2str: function(value) {\n return value;\n }, \n\n /**\n Converts string received from server into value. Usually from `data-value` attribute.\n\n @method str2value(str)\n @param {string} str\n @returns {mixed}\n **/\n str2value: function(str) {\n return str;\n }, \n \n /**\n Converts value for submitting to server. Result can be string or object.\n\n @method value2submit(value) \n @param {mixed} value\n @returns {mixed}\n **/\n value2submit: function(value) {\n return value;\n },\n\n /**\n Sets value of input.\n\n @method value2input(value) \n @param {mixed} value\n **/\n value2input: function(value) {\n this.$input.val(value);\n },\n\n /**\n Returns value of input. Value can be object (e.g. datepicker)\n\n @method input2value() \n **/\n input2value: function() { \n return this.$input.val();\n }, \n\n /**\n Activates input. For text it sets focus.\n\n @method activate() \n **/\n activate: function() {\n if(this.$input.is(':visible')) {\n this.$input.focus();\n }\n },\n\n /**\n Creates input.\n\n @method clear() \n **/ \n clear: function() {\n this.$input.val(null);\n },\n\n /**\n method to escape html.\n **/\n escape: function(str) {\n return $('
      ').text(str).html();\n },\n \n /**\n attach handler to automatically submit form when value changed (useful when buttons not shown)\n **/\n autosubmit: function() {\n \n },\n \n /**\n Additional actions when destroying element \n **/\n destroy: function() {\n },\n\n // -------- helper functions --------\n setClass: function() { \n if(this.options.inputclass) {\n this.$input.addClass(this.options.inputclass); \n } \n },\n\n setAttr: function(attr) {\n if (this.options[attr] !== undefined && this.options[attr] !== null) {\n this.$input.attr(attr, this.options[attr]);\n } \n },\n \n option: function(key, value) {\n this.options[key] = value;\n }\n \n };\n \n AbstractInput.defaults = { \n /**\n HTML template of input. Normally you should not change it.\n\n @property tpl \n @type string\n @default ''\n **/ \n tpl: '',\n /**\n CSS class automatically applied to input\n \n @property inputclass \n @type string\n @default null\n **/ \n inputclass: null,\n \n /**\n If `true` - html will be escaped in content of element via $.text() method. \n If `false` - html will not be escaped, $.html() used. \n When you use own `display` function, this option obviosly has no effect.\n \n @property escape \n @type boolean\n @since 1.5.0\n @default true\n **/ \n escape: true,\n \n //scope for external methods (e.g. source defined as function)\n //for internal use only\n scope: null,\n \n //need to re-declare showbuttons here to get it's value from common config (passed only options existing in defaults)\n showbuttons: true \n };\n \n $.extend($.fn.editabletypes, {abstractinput: AbstractInput});\n \n}(window.jQuery));\n\n/**\nList - abstract class for inputs that have source option loaded from js array or via ajax\n\n@class list\n@extends abstractinput\n**/\n(function ($) {\n \"use strict\";\n \n var List = function (options) {\n \n };\n\n $.fn.editableutils.inherit(List, $.fn.editabletypes.abstractinput);\n\n $.extend(List.prototype, {\n render: function () {\n var deferred = $.Deferred();\n\n this.error = null;\n this.onSourceReady(function () {\n this.renderList();\n deferred.resolve();\n }, function () {\n this.error = this.options.sourceError;\n deferred.resolve();\n });\n\n return deferred.promise();\n },\n\n html2value: function (html) {\n return null; //can't set value by text\n },\n \n value2html: function (value, element, display, response) {\n var deferred = $.Deferred(),\n success = function () {\n if(typeof display === 'function') {\n //custom display method\n display.call(element, value, this.sourceData, response); \n } else {\n this.value2htmlFinal(value, element);\n }\n deferred.resolve();\n };\n \n //for null value just call success without loading source\n if(value === null) {\n success.call(this); \n } else {\n this.onSourceReady(success, function () { deferred.resolve(); });\n }\n\n return deferred.promise();\n }, \n\n // ------------- additional functions ------------\n\n onSourceReady: function (success, error) {\n //run source if it function\n var source;\n if ($.isFunction(this.options.source)) {\n source = this.options.source.call(this.options.scope);\n this.sourceData = null;\n //note: if function returns the same source as URL - sourceData will be taken from cahce and no extra request performed\n } else {\n source = this.options.source;\n } \n \n //if allready loaded just call success\n if(this.options.sourceCache && $.isArray(this.sourceData)) {\n success.call(this);\n return; \n }\n\n //try parse json in single quotes (for double quotes jquery does automatically)\n try {\n source = $.fn.editableutils.tryParseJson(source, false);\n } catch (e) {\n error.call(this);\n return;\n }\n\n //loading from url\n if (typeof source === 'string') {\n //try to get sourceData from cache\n if(this.options.sourceCache) {\n var cacheID = source,\n cache;\n\n if (!$(document).data(cacheID)) {\n $(document).data(cacheID, {});\n }\n cache = $(document).data(cacheID);\n\n //check for cached data\n if (cache.loading === false && cache.sourceData) { //take source from cache\n this.sourceData = cache.sourceData;\n this.doPrepend();\n success.call(this);\n return;\n } else if (cache.loading === true) { //cache is loading, put callback in stack to be called later\n cache.callbacks.push($.proxy(function () {\n this.sourceData = cache.sourceData;\n this.doPrepend();\n success.call(this);\n }, this));\n\n //also collecting error callbacks\n cache.err_callbacks.push($.proxy(error, this));\n return;\n } else { //no cache yet, activate it\n cache.loading = true;\n cache.callbacks = [];\n cache.err_callbacks = [];\n }\n }\n \n //ajaxOptions for source. Can be overwritten bt options.sourceOptions\n var ajaxOptions = $.extend({\n url: source,\n type: 'get',\n cache: false,\n dataType: 'json',\n success: $.proxy(function (data) {\n if(cache) {\n cache.loading = false;\n }\n this.sourceData = this.makeArray(data);\n if($.isArray(this.sourceData)) {\n if(cache) {\n //store result in cache\n cache.sourceData = this.sourceData;\n //run success callbacks for other fields waiting for this source\n $.each(cache.callbacks, function () { this.call(); }); \n }\n this.doPrepend();\n success.call(this);\n } else {\n error.call(this);\n if(cache) {\n //run error callbacks for other fields waiting for this source\n $.each(cache.err_callbacks, function () { this.call(); }); \n }\n }\n }, this),\n error: $.proxy(function () {\n error.call(this);\n if(cache) {\n cache.loading = false;\n //run error callbacks for other fields\n $.each(cache.err_callbacks, function () { this.call(); }); \n }\n }, this)\n }, this.options.sourceOptions);\n \n //loading sourceData from server\n $.ajax(ajaxOptions);\n \n } else { //options as json/array\n this.sourceData = this.makeArray(source);\n \n if($.isArray(this.sourceData)) {\n this.doPrepend();\n success.call(this); \n } else {\n error.call(this);\n }\n }\n },\n\n doPrepend: function () {\n if(this.options.prepend === null || this.options.prepend === undefined) {\n return; \n }\n \n if(!$.isArray(this.prependData)) {\n //run prepend if it is function (once)\n if ($.isFunction(this.options.prepend)) {\n this.options.prepend = this.options.prepend.call(this.options.scope);\n }\n \n //try parse json in single quotes\n this.options.prepend = $.fn.editableutils.tryParseJson(this.options.prepend, true);\n \n //convert prepend from string to object\n if (typeof this.options.prepend === 'string') {\n this.options.prepend = {'': this.options.prepend};\n }\n \n this.prependData = this.makeArray(this.options.prepend);\n }\n\n if($.isArray(this.prependData) && $.isArray(this.sourceData)) {\n this.sourceData = this.prependData.concat(this.sourceData);\n }\n },\n\n /*\n renders input list\n */\n renderList: function() {\n // this method should be overwritten in child class\n },\n \n /*\n set element's html by value\n */\n value2htmlFinal: function(value, element) {\n // this method should be overwritten in child class\n }, \n\n /**\n * convert data to array suitable for sourceData, e.g. [{value: 1, text: 'abc'}, {...}]\n */\n makeArray: function(data) {\n var count, obj, result = [], item, iterateItem;\n if(!data || typeof data === 'string') {\n return null; \n }\n\n if($.isArray(data)) { //array\n /* \n function to iterate inside item of array if item is object.\n Caclulates count of keys in item and store in obj. \n */\n iterateItem = function (k, v) {\n obj = {value: k, text: v};\n if(count++ >= 2) {\n return false;// exit from `each` if item has more than one key.\n }\n };\n \n for(var i = 0; i < data.length; i++) {\n item = data[i]; \n if(typeof item === 'object') {\n count = 0; //count of keys inside item\n $.each(item, iterateItem);\n //case: [{val1: 'text1'}, {val2: 'text2} ...]\n if(count === 1) { \n result.push(obj); \n //case: [{value: 1, text: 'text1'}, {value: 2, text: 'text2'}, ...]\n } else if(count > 1) {\n //removed check of existance: item.hasOwnProperty('value') && item.hasOwnProperty('text')\n if(item.children) {\n item.children = this.makeArray(item.children); \n }\n result.push(item);\n }\n } else {\n //case: ['text1', 'text2' ...]\n result.push({value: item, text: item}); \n }\n }\n } else { //case: {val1: 'text1', val2: 'text2, ...}\n $.each(data, function (k, v) {\n result.push({value: k, text: v});\n }); \n }\n return result;\n },\n \n option: function(key, value) {\n this.options[key] = value;\n if(key === 'source') {\n this.sourceData = null;\n }\n if(key === 'prepend') {\n this.prependData = null;\n } \n } \n\n }); \n\n List.defaults = $.extend({}, $.fn.editabletypes.abstractinput.defaults, {\n /**\n Source data for list. \n If **array** - it should be in format: `[{value: 1, text: \"text1\"}, {value: 2, text: \"text2\"}, ...]` \n For compability, object format is also supported: `{\"1\": \"text1\", \"2\": \"text2\" ...}` but it does not guarantee elements order.\n \n If **string** - considered ajax url to load items. In that case results will be cached for fields with the same source and name. See also `sourceCache` option.\n \n If **function**, it should return data in format above (since 1.4.0).\n \n Since 1.4.1 key `children` supported to render OPTGROUP (for **select** input only). \n `[{text: \"group1\", children: [{value: 1, text: \"text1\"}, {value: 2, text: \"text2\"}]}, ...]` \n\n\t\t\n @property source \n @type string | array | object | function\n @default null\n **/ \n source: null, \n /**\n Data automatically prepended to the beginning of dropdown list.\n \n @property prepend \n @type string | array | object | function\n @default false\n **/ \n prepend: false,\n /**\n Error message when list cannot be loaded (e.g. ajax error)\n \n @property sourceError \n @type string\n @default Error when loading list\n **/ \n sourceError: 'Error when loading list',\n /**\n if true and source is **string url** - results will be cached for fields with the same source. \n Usefull for editable column in grid to prevent extra requests.\n \n @property sourceCache \n @type boolean\n @default true\n @since 1.2.0\n **/ \n sourceCache: true,\n /**\n Additional ajax options to be used in $.ajax() when loading list from server.\n Useful to send extra parameters (`data` key) or change request method (`type` key).\n \n @property sourceOptions \n @type object|function\n @default null\n @since 1.5.0\n **/ \n sourceOptions: null\n });\n\n $.fn.editabletypes.list = List; \n\n}(window.jQuery));\n\n/**\nText input\n\n@class text\n@extends abstractinput\n@final\n@example\nawesome\n\n**/\n(function ($) {\n \"use strict\";\n \n var Text = function (options) {\n this.init('text', options, Text.defaults);\n };\n\n $.fn.editableutils.inherit(Text, $.fn.editabletypes.abstractinput);\n\n $.extend(Text.prototype, {\n render: function() {\n this.renderClear();\n this.setClass();\n this.setAttr('placeholder');\n },\n \n activate: function() {\n if(this.$input.is(':visible')) {\n this.$input.focus();\n $.fn.editableutils.setCursorPosition(this.$input.get(0), this.$input.val().length);\n if(this.toggleClear) {\n this.toggleClear();\n }\n }\n },\n \n //render clear button\n renderClear: function() {\n if (this.options.clear) {\n this.$clear = $('');\n this.$input.after(this.$clear)\n .css('padding-right', 24)\n .keyup($.proxy(function(e) {\n //arrows, enter, tab, etc\n if(~$.inArray(e.keyCode, [40,38,9,13,27])) {\n return;\n } \n\n clearTimeout(this.t);\n var that = this;\n this.t = setTimeout(function() {\n that.toggleClear(e);\n }, 100);\n \n }, this))\n .parent().css('position', 'relative');\n \n this.$clear.click($.proxy(this.clear, this)); \n } \n },\n \n postrender: function() {\n /*\n //now `clear` is positioned via css\n if(this.$clear) {\n //can position clear button only here, when form is shown and height can be calculated\n// var h = this.$input.outerHeight(true) || 20,\n var h = this.$clear.parent().height(),\n delta = (h - this.$clear.height()) / 2;\n \n //this.$clear.css({bottom: delta, right: delta});\n }\n */ \n },\n \n //show / hide clear button\n toggleClear: function(e) {\n if(!this.$clear) {\n return;\n }\n \n var len = this.$input.val().length,\n visible = this.$clear.is(':visible');\n \n if(len && !visible) {\n this.$clear.show();\n } \n \n if(!len && visible) {\n this.$clear.hide();\n } \n },\n \n clear: function() {\n this.$clear.hide();\n this.$input.val('').focus();\n } \n });\n\n Text.defaults = $.extend({}, $.fn.editabletypes.abstractinput.defaults, {\n /**\n @property tpl \n @default \n **/ \n tpl: '',\n /**\n Placeholder attribute of input. Shown when input is empty.\n\n @property placeholder \n @type string\n @default null\n **/ \n placeholder: null,\n \n /**\n Whether to show `clear` button \n \n @property clear \n @type boolean\n @default true \n **/\n clear: true\n });\n\n $.fn.editabletypes.text = Text;\n\n}(window.jQuery));\n\n/**\nTextarea input\n\n@class textarea\n@extends abstractinput\n@final\n@example\nawesome comment!\n\n**/\n(function ($) {\n \"use strict\";\n \n var Textarea = function (options) {\n this.init('textarea', options, Textarea.defaults);\n };\n\n $.fn.editableutils.inherit(Textarea, $.fn.editabletypes.abstractinput);\n\n $.extend(Textarea.prototype, {\n render: function () {\n this.setClass();\n this.setAttr('placeholder');\n this.setAttr('rows'); \n \n //ctrl + enter\n this.$input.keydown(function (e) {\n if (e.ctrlKey && e.which === 13) {\n $(this).closest('form').submit();\n }\n });\n },\n \n //using `white-space: pre-wrap` solves \\n <--> BR conversion very elegant!\n /* \n value2html: function(value, element) {\n var html = '', lines;\n if(value) {\n lines = value.split(\"\\n\");\n for (var i = 0; i < lines.length; i++) {\n lines[i] = $('
      ').text(lines[i]).html();\n }\n html = lines.join('
      ');\n }\n $(element).html(html);\n },\n \n html2value: function(html) {\n if(!html) {\n return '';\n }\n\n var regex = new RegExp(String.fromCharCode(10), 'g');\n var lines = html.split(//i);\n for (var i = 0; i < lines.length; i++) {\n var text = $('
      ').html(lines[i]).text();\n\n // Remove newline characters (\\n) to avoid them being converted by value2html() method\n // thus adding extra
      tags\n text = text.replace(regex, '');\n\n lines[i] = text;\n }\n return lines.join(\"\\n\");\n },\n */\n activate: function() {\n $.fn.editabletypes.text.prototype.activate.call(this);\n }\n });\n\n Textarea.defaults = $.extend({}, $.fn.editabletypes.abstractinput.defaults, {\n /**\n @property tpl\n @default \n **/\n tpl:'',\n /**\n @property inputclass\n @default input-large\n **/\n inputclass: 'input-large',\n /**\n Placeholder attribute of input. Shown when input is empty.\n\n @property placeholder\n @type string\n @default null\n **/\n placeholder: null,\n /**\n Number of rows in textarea\n\n @property rows\n @type integer\n @default 7\n **/ \n rows: 7 \n });\n\n $.fn.editabletypes.textarea = Textarea;\n\n}(window.jQuery));\n\n/**\nSelect (dropdown)\n\n@class select\n@extends list\n@final\n@example\n\n\n**/\n(function ($) {\n \"use strict\";\n \n var Select = function (options) {\n this.init('select', options, Select.defaults);\n };\n\n $.fn.editableutils.inherit(Select, $.fn.editabletypes.list);\n\n $.extend(Select.prototype, {\n renderList: function() {\n this.$input.empty();\n\n var fillItems = function($el, data) {\n var attr;\n if($.isArray(data)) {\n for(var i=0; i', attr), data[i].children)); \n } else {\n attr.value = data[i].value;\n if(data[i].disabled) {\n attr.disabled = true;\n }\n $el.append($('