JezK
Edit File: turbolinks.js
var Turbolinks;(()=>{var __webpack_modules__={"./src/turbolinks/browser_adapter.js":function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){eval('/* provided dependency */ var Turbolinks = __webpack_require__(/*! ./ */ "./src/turbolinks/index.js");\n// Generated by CoffeeScript 2.7.0\n(function() {\n __webpack_require__(/*! ./http_request */ "./src/turbolinks/http_request.js");\n\n __webpack_require__(/*! ./progress_bar */ "./src/turbolinks/progress_bar.js");\n\n Turbolinks.BrowserAdapter = (function() {\n var NETWORK_FAILURE, TIMEOUT_FAILURE;\n\n class BrowserAdapter {\n constructor(controller) {\n this.showProgressBar = this.showProgressBar.bind(this);\n this.controller = controller;\n this.progressBar = new Turbolinks.ProgressBar();\n }\n\n visitProposedToLocationWithAction(location, action) {\n return this.controller.startVisitToLocationWithAction(location, action);\n }\n\n visitStarted(visit) {\n visit.issueRequest();\n visit.changeHistory();\n return visit.loadCachedSnapshot();\n }\n\n visitRequestStarted(visit) {\n this.progressBar.setValue(0);\n if (visit.hasCachedSnapshot() || visit.action !== "restore") {\n return this.showProgressBarAfterDelay();\n } else {\n return this.showProgressBar();\n }\n }\n\n visitRequestProgressed(visit) {\n return this.progressBar.setValue(visit.progress);\n }\n\n visitRequestCompleted(visit) {\n return visit.loadResponse();\n }\n\n visitRequestFailedWithStatusCode(visit, statusCode) {\n switch (statusCode) {\n case NETWORK_FAILURE:\n case TIMEOUT_FAILURE:\n return this.reload();\n default:\n return visit.loadResponse();\n }\n }\n\n visitRequestFinished(visit) {\n return this.hideProgressBar();\n }\n\n visitCompleted(visit) {\n return visit.followRedirect();\n }\n\n pageInvalidated() {\n return this.reload();\n }\n\n // Private\n showProgressBarAfterDelay() {\n return this.progressBarTimeout = setTimeout(this.showProgressBar, this.controller.progressBarDelay);\n }\n\n showProgressBar() {\n return this.progressBar.show();\n }\n\n hideProgressBar() {\n this.progressBar.hide();\n return clearTimeout(this.progressBarTimeout);\n }\n\n reload() {\n return window.location.reload();\n }\n\n };\n\n ({NETWORK_FAILURE, TIMEOUT_FAILURE} = Turbolinks.HttpRequest);\n\n return BrowserAdapter;\n\n }).call(this);\n\n}).call(this);\n\n\n//# sourceURL=webpack://Turbolinks/./src/turbolinks/browser_adapter.js?')},"./src/turbolinks/controller.js":function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){eval('/* provided dependency */ var Turbolinks = __webpack_require__(/*! ./ */ "./src/turbolinks/index.js");\n// Generated by CoffeeScript 2.7.0\n(function() {\n __webpack_require__(/*! ./location */ "./src/turbolinks/location.js");\n\n __webpack_require__(/*! ./browser_adapter */ "./src/turbolinks/browser_adapter.js");\n\n __webpack_require__(/*! ./history */ "./src/turbolinks/history.js");\n\n __webpack_require__(/*! ./view */ "./src/turbolinks/view.js");\n\n __webpack_require__(/*! ./scroll_manager */ "./src/turbolinks/scroll_manager.js");\n\n __webpack_require__(/*! ./snapshot_cache */ "./src/turbolinks/snapshot_cache.js");\n\n __webpack_require__(/*! ./visit */ "./src/turbolinks/visit.js");\n\n Turbolinks.Controller = class Controller {\n constructor() {\n // Event handlers\n this.pageLoaded = this.pageLoaded.bind(this);\n this.clickCaptured = this.clickCaptured.bind(this);\n this.clickBubbled = this.clickBubbled.bind(this);\n this.history = new Turbolinks.History(this);\n this.view = new Turbolinks.View(this);\n this.scrollManager = new Turbolinks.ScrollManager(this);\n this.restorationData = {};\n this.clearCache();\n this.setProgressBarDelay(500);\n }\n\n start() {\n if (Turbolinks.supported && !this.started) {\n addEventListener("click", this.clickCaptured, true);\n addEventListener("DOMContentLoaded", this.pageLoaded, false);\n this.scrollManager.start();\n this.startHistory();\n this.started = true;\n return this.enabled = true;\n }\n }\n\n disable() {\n return this.enabled = false;\n }\n\n stop() {\n if (this.started) {\n removeEventListener("click", this.clickCaptured, true);\n removeEventListener("DOMContentLoaded", this.pageLoaded, false);\n this.scrollManager.stop();\n this.stopHistory();\n return this.started = false;\n }\n }\n\n clearCache() {\n return this.cache = new Turbolinks.SnapshotCache(10);\n }\n\n visit(location, options = {}) {\n var action, ref;\n location = Turbolinks.Location.wrap(location);\n if (this.applicationAllowsVisitingLocation(location)) {\n if (this.locationIsVisitable(location)) {\n action = (ref = options.action) != null ? ref : "advance";\n return this.adapter.visitProposedToLocationWithAction(location, action);\n } else {\n return window.location = location;\n }\n }\n }\n\n startVisitToLocationWithAction(location, action, restorationIdentifier) {\n var restorationData;\n if (Turbolinks.supported) {\n restorationData = this.getRestorationDataForIdentifier(restorationIdentifier);\n return this.startVisit(location, action, {restorationData});\n } else {\n return window.location = location;\n }\n }\n\n setProgressBarDelay(delay) {\n return this.progressBarDelay = delay;\n }\n\n // History\n startHistory() {\n this.location = Turbolinks.Location.wrap(window.location);\n this.restorationIdentifier = Turbolinks.uuid();\n this.history.start();\n return this.history.replace(this.location, this.restorationIdentifier);\n }\n\n stopHistory() {\n return this.history.stop();\n }\n\n pushHistoryWithLocationAndRestorationIdentifier(location, restorationIdentifier1) {\n this.restorationIdentifier = restorationIdentifier1;\n this.location = Turbolinks.Location.wrap(location);\n return this.history.push(this.location, this.restorationIdentifier);\n }\n\n replaceHistoryWithLocationAndRestorationIdentifier(location, restorationIdentifier1) {\n this.restorationIdentifier = restorationIdentifier1;\n this.location = Turbolinks.Location.wrap(location);\n return this.history.replace(this.location, this.restorationIdentifier);\n }\n\n // History delegate\n historyPoppedToLocationWithRestorationIdentifier(location, restorationIdentifier1) {\n var restorationData;\n this.restorationIdentifier = restorationIdentifier1;\n if (this.enabled) {\n restorationData = this.getRestorationDataForIdentifier(this.restorationIdentifier);\n this.startVisit(location, "restore", {\n restorationIdentifier: this.restorationIdentifier,\n restorationData,\n historyChanged: true\n });\n return this.location = Turbolinks.Location.wrap(location);\n } else {\n return this.adapter.pageInvalidated();\n }\n }\n\n // Snapshot cache\n getCachedSnapshotForLocation(location) {\n var ref;\n return (ref = this.cache.get(location)) != null ? ref.clone() : void 0;\n }\n\n shouldCacheSnapshot() {\n return this.view.getSnapshot().isCacheable();\n }\n\n cacheSnapshot() {\n var location, snapshot;\n if (this.shouldCacheSnapshot()) {\n this.notifyApplicationBeforeCachingSnapshot();\n snapshot = this.view.getSnapshot();\n location = this.lastRenderedLocation;\n return Turbolinks.defer(() => {\n return this.cache.put(location, snapshot.clone());\n });\n }\n }\n\n // Scrolling\n scrollToAnchor(anchor) {\n var element;\n if (element = this.view.getElementForAnchor(anchor)) {\n return this.scrollToElement(element);\n } else {\n return this.scrollToPosition({\n x: 0,\n y: 0\n });\n }\n }\n\n scrollToElement(element) {\n return this.scrollManager.scrollToElement(element);\n }\n\n scrollToPosition(position) {\n return this.scrollManager.scrollToPosition(position);\n }\n\n // Scroll manager delegate\n scrollPositionChanged(scrollPosition) {\n var restorationData;\n restorationData = this.getCurrentRestorationData();\n return restorationData.scrollPosition = scrollPosition;\n }\n\n // View\n render(options, callback) {\n return this.view.render(options, callback);\n }\n\n viewInvalidated() {\n return this.adapter.pageInvalidated();\n }\n\n viewWillRender(newBody) {\n return this.notifyApplicationBeforeRender(newBody);\n }\n\n viewRendered() {\n this.lastRenderedLocation = this.currentVisit.location;\n return this.notifyApplicationAfterRender();\n }\n\n pageLoaded() {\n this.lastRenderedLocation = this.location;\n return this.notifyApplicationAfterPageLoad();\n }\n\n clickCaptured() {\n removeEventListener("click", this.clickBubbled, false);\n return addEventListener("click", this.clickBubbled, false);\n }\n\n clickBubbled(event) {\n var action, link, location;\n if (this.enabled && this.clickEventIsSignificant(event)) {\n if (link = this.getVisitableLinkForNode(event.target)) {\n if (location = this.getVisitableLocationForLink(link)) {\n if (this.applicationAllowsFollowingLinkToLocation(link, location)) {\n event.preventDefault();\n action = this.getActionForLink(link);\n return this.visit(location, {action});\n }\n }\n }\n }\n }\n\n // Application events\n applicationAllowsFollowingLinkToLocation(link, location) {\n var event;\n event = this.notifyApplicationAfterClickingLinkToLocation(link, location);\n return !event.defaultPrevented;\n }\n\n applicationAllowsVisitingLocation(location) {\n var event;\n event = this.notifyApplicationBeforeVisitingLocation(location);\n return !event.defaultPrevented;\n }\n\n notifyApplicationAfterClickingLinkToLocation(link, location) {\n return Turbolinks.dispatch("turbolinks:click", {\n target: link,\n data: {\n url: location.absoluteURL\n },\n cancelable: true\n });\n }\n\n notifyApplicationBeforeVisitingLocation(location) {\n return Turbolinks.dispatch("turbolinks:before-visit", {\n data: {\n url: location.absoluteURL\n },\n cancelable: true\n });\n }\n\n notifyApplicationAfterVisitingLocation(location) {\n return Turbolinks.dispatch("turbolinks:visit", {\n data: {\n url: location.absoluteURL\n }\n });\n }\n\n notifyApplicationBeforeCachingSnapshot() {\n return Turbolinks.dispatch("turbolinks:before-cache");\n }\n\n notifyApplicationBeforeRender(newBody) {\n return Turbolinks.dispatch("turbolinks:before-render", {\n data: {newBody}\n });\n }\n\n notifyApplicationAfterRender() {\n return Turbolinks.dispatch("turbolinks:render");\n }\n\n notifyApplicationAfterPageLoad(timing = {}) {\n return Turbolinks.dispatch("turbolinks:load", {\n data: {\n url: this.location.absoluteURL,\n timing\n }\n });\n }\n\n // Private\n startVisit(location, action, properties) {\n var ref;\n if ((ref = this.currentVisit) != null) {\n ref.cancel();\n }\n this.currentVisit = this.createVisit(location, action, properties);\n this.currentVisit.start();\n return this.notifyApplicationAfterVisitingLocation(location);\n }\n\n createVisit(location, action, {restorationIdentifier, restorationData, historyChanged} = {}) {\n var visit;\n visit = new Turbolinks.Visit(this, location, action);\n visit.restorationIdentifier = restorationIdentifier != null ? restorationIdentifier : Turbolinks.uuid();\n visit.restorationData = Turbolinks.copyObject(restorationData);\n visit.historyChanged = historyChanged;\n visit.referrer = this.location;\n return visit;\n }\n\n visitCompleted(visit) {\n return this.notifyApplicationAfterPageLoad(visit.getTimingMetrics());\n }\n\n clickEventIsSignificant(event) {\n return !(event.defaultPrevented || event.target.isContentEditable || event.which > 1 || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey);\n }\n\n getVisitableLinkForNode(node) {\n if (this.nodeIsVisitable(node)) {\n return Turbolinks.closest(node, "a[href]:not([target]):not([download])");\n }\n }\n\n getVisitableLocationForLink(link) {\n var location;\n location = new Turbolinks.Location(link.getAttribute("href"));\n if (this.locationIsVisitable(location)) {\n return location;\n }\n }\n\n getActionForLink(link) {\n var ref;\n return (ref = link.getAttribute("data-turbolinks-action")) != null ? ref : "advance";\n }\n\n nodeIsVisitable(node) {\n var container;\n if (container = Turbolinks.closest(node, "[data-turbolinks]")) {\n return container.getAttribute("data-turbolinks") !== "false";\n } else {\n return true;\n }\n }\n\n locationIsVisitable(location) {\n return location.isPrefixedBy(this.view.getRootLocation()) && location.isHTML();\n }\n\n getCurrentRestorationData() {\n return this.getRestorationDataForIdentifier(this.restorationIdentifier);\n }\n\n getRestorationDataForIdentifier(identifier) {\n var base;\n return (base = this.restorationData)[identifier] != null ? base[identifier] : base[identifier] = {};\n }\n\n };\n\n}).call(this);\n\n\n//# sourceURL=webpack://Turbolinks/./src/turbolinks/controller.js?')},"./src/turbolinks/error_renderer.js":function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){eval('/* provided dependency */ var Turbolinks = __webpack_require__(/*! ./ */ "./src/turbolinks/index.js");\n// Generated by CoffeeScript 2.7.0\n(function() {\n __webpack_require__(/*! ./renderer */ "./src/turbolinks/renderer.js");\n\n Turbolinks.ErrorRenderer = class ErrorRenderer extends Turbolinks.Renderer {\n constructor(html) {\n var htmlElement;\n htmlElement = document.createElement("html");\n htmlElement.innerHTML = html;\n super(html);\n this.newHead = htmlElement.querySelector("head");\n this.newBody = htmlElement.querySelector("body");\n }\n\n render(callback) {\n return this.renderView(() => {\n this.replaceHeadAndBody();\n this.activateBodyScriptElements();\n return callback();\n });\n }\n\n replaceHeadAndBody() {\n var body, head;\n ({head, body} = document);\n head.parentNode.replaceChild(this.newHead, head);\n return body.parentNode.replaceChild(this.newBody, body);\n }\n\n activateBodyScriptElements() {\n var element, i, len, ref, replaceableElement, results;\n ref = this.getScriptElements();\n results = [];\n for (i = 0, len = ref.length; i < len; i++) {\n replaceableElement = ref[i];\n element = this.createScriptElement(replaceableElement);\n results.push(replaceableElement.parentNode.replaceChild(element, replaceableElement));\n }\n return results;\n }\n\n getScriptElements() {\n return document.documentElement.querySelectorAll("script");\n }\n\n };\n\n}).call(this);\n\n\n//# sourceURL=webpack://Turbolinks/./src/turbolinks/error_renderer.js?')},"./src/turbolinks/head_details.js":function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){eval('/* provided dependency */ var Turbolinks = __webpack_require__(/*! ./ */ "./src/turbolinks/index.js");\n// Generated by CoffeeScript 2.7.0\n(function() {\n Turbolinks.HeadDetails = (function() {\n var elementIsMetaElementWithName, elementIsScript, elementIsStylesheet, elementIsTracked, elementType;\n\n class HeadDetails {\n static fromHeadElement(headElement) {\n var ref;\n return new this((ref = headElement != null ? headElement.childNodes : void 0) != null ? ref : []);\n }\n\n constructor(childNodes) {\n var base, data, i, key, len, node;\n this.elements = {};\n for (i = 0, len = childNodes.length; i < len; i++) {\n node = childNodes[i];\n if (!(node.nodeType === Node.ELEMENT_NODE)) {\n continue;\n }\n key = node.outerHTML;\n data = (base = this.elements)[key] != null ? base[key] : base[key] = {\n type: elementType(node),\n tracked: elementIsTracked(node),\n elements: []\n };\n data.elements.push(node);\n }\n }\n\n hasElementWithKey(key) {\n return key in this.elements;\n }\n\n getTrackedElementSignature() {\n var key, tracked;\n return ((function() {\n var ref, results;\n ref = this.elements;\n results = [];\n for (key in ref) {\n ({tracked} = ref[key]);\n if (tracked) {\n results.push(key);\n }\n }\n return results;\n }).call(this)).join("");\n }\n\n getScriptElementsNotInDetails(headDetails) {\n return this.getElementsMatchingTypeNotInDetails("script", headDetails);\n }\n\n getStylesheetElementsNotInDetails(headDetails) {\n return this.getElementsMatchingTypeNotInDetails("stylesheet", headDetails);\n }\n\n getElementsMatchingTypeNotInDetails(matchedType, headDetails) {\n var elements, key, ref, results, type;\n ref = this.elements;\n results = [];\n for (key in ref) {\n ({type, elements} = ref[key]);\n if (type === matchedType && !headDetails.hasElementWithKey(key)) {\n results.push(elements[0]);\n }\n }\n return results;\n }\n\n getProvisionalElements() {\n var elements, key, provisionalElements, ref, tracked, type;\n provisionalElements = [];\n ref = this.elements;\n for (key in ref) {\n ({type, tracked, elements} = ref[key]);\n if ((type == null) && !tracked) {\n provisionalElements.push(...elements);\n } else if (elements.length > 1) {\n provisionalElements.push(...elements.slice(1));\n }\n }\n return provisionalElements;\n }\n\n getMetaValue(name) {\n var ref;\n return (ref = this.findMetaElementByName(name)) != null ? ref.getAttribute("content") : void 0;\n }\n\n findMetaElementByName(name) {\n var element, elements, key, ref;\n element = void 0;\n ref = this.elements;\n for (key in ref) {\n ({elements} = ref[key]);\n if (elementIsMetaElementWithName(elements[0], name)) {\n element = elements[0];\n }\n }\n return element;\n }\n\n };\n\n elementType = function(element) {\n if (elementIsScript(element)) {\n return "script";\n } else if (elementIsStylesheet(element)) {\n return "stylesheet";\n }\n };\n\n elementIsTracked = function(element) {\n return element.getAttribute("data-turbolinks-track") === "reload";\n };\n\n elementIsScript = function(element) {\n var tagName;\n tagName = element.tagName.toLowerCase();\n return tagName === "script";\n };\n\n elementIsStylesheet = function(element) {\n var tagName;\n tagName = element.tagName.toLowerCase();\n return tagName === "style" || (tagName === "link" && element.getAttribute("rel") === "stylesheet");\n };\n\n elementIsMetaElementWithName = function(element, name) {\n var tagName;\n tagName = element.tagName.toLowerCase();\n return tagName === "meta" && element.getAttribute("name") === name;\n };\n\n return HeadDetails;\n\n }).call(this);\n\n}).call(this);\n\n\n//# sourceURL=webpack://Turbolinks/./src/turbolinks/head_details.js?')},"./src/turbolinks/helpers.js":function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){eval('/* provided dependency */ var Turbolinks = __webpack_require__(/*! ./ */ "./src/turbolinks/index.js");\n// Generated by CoffeeScript 2.7.0\n(function() {\n var closest, match, preventDefaultSupported;\n\n Turbolinks.copyObject = function(object) {\n var key, result, value;\n result = {};\n for (key in object) {\n value = object[key];\n result[key] = value;\n }\n return result;\n };\n\n Turbolinks.closest = function(element, selector) {\n return closest.call(element, selector);\n };\n\n closest = (function() {\n var html, ref;\n html = document.documentElement;\n return (ref = html.closest) != null ? ref : function(selector) {\n var node;\n node = this;\n while (node) {\n if (node.nodeType === Node.ELEMENT_NODE && match.call(node, selector)) {\n return node;\n }\n node = node.parentNode;\n }\n };\n })();\n\n Turbolinks.defer = function(callback) {\n return setTimeout(callback, 1);\n };\n\n Turbolinks.throttle = function(fn) {\n var request;\n request = null;\n return function(...args) {\n return request != null ? request : request = requestAnimationFrame(() => {\n request = null;\n return fn.apply(this, args);\n });\n };\n };\n\n Turbolinks.dispatch = function(eventName, {target, cancelable, data} = {}) {\n var event, preventDefault;\n event = document.createEvent("Events");\n event.initEvent(eventName, true, cancelable === true);\n event.data = data != null ? data : {};\n // Fix setting `defaultPrevented` when `preventDefault()` is called\n // http://stackoverflow.com/questions/23349191/event-preventdefault-is-not-working-in-ie-11-for-custom-events\n if (event.cancelable && !preventDefaultSupported) {\n ({preventDefault} = event);\n event.preventDefault = function() {\n if (!this.defaultPrevented) {\n Object.defineProperty(this, "defaultPrevented", {\n get: function() {\n return true;\n }\n });\n }\n return preventDefault.call(this);\n };\n }\n (target != null ? target : document).dispatchEvent(event);\n return event;\n };\n\n preventDefaultSupported = (function() {\n var event;\n event = document.createEvent("Events");\n event.initEvent("test", true, true);\n event.preventDefault();\n return event.defaultPrevented;\n })();\n\n Turbolinks.match = function(element, selector) {\n return match.call(element, selector);\n };\n\n match = (function() {\n var html, ref, ref1, ref2;\n html = document.documentElement;\n return (ref = (ref1 = (ref2 = html.matchesSelector) != null ? ref2 : html.webkitMatchesSelector) != null ? ref1 : html.msMatchesSelector) != null ? ref : html.mozMatchesSelector;\n })();\n\n Turbolinks.uuid = function() {\n var i, j, result;\n result = "";\n for (i = j = 1; j <= 36; i = ++j) {\n if (i === 9 || i === 14 || i === 19 || i === 24) {\n result += "-";\n } else if (i === 15) {\n result += "4";\n } else if (i === 20) {\n result += (Math.floor(Math.random() * 4) + 8).toString(16);\n } else {\n result += Math.floor(Math.random() * 15).toString(16);\n }\n }\n return result;\n };\n\n}).call(this);\n\n\n//# sourceURL=webpack://Turbolinks/./src/turbolinks/helpers.js?')},"./src/turbolinks/history.js":function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){eval('/* provided dependency */ var Turbolinks = __webpack_require__(/*! ./ */ "./src/turbolinks/index.js");\n// Generated by CoffeeScript 2.7.0\n(function() {\n Turbolinks.History = class History {\n constructor(delegate) {\n // Event handlers\n this.onPopState = this.onPopState.bind(this);\n this.onPageLoad = this.onPageLoad.bind(this);\n this.delegate = delegate;\n }\n\n start() {\n if (!this.started) {\n addEventListener("popstate", this.onPopState, false);\n addEventListener("load", this.onPageLoad, false);\n return this.started = true;\n }\n }\n\n stop() {\n if (this.started) {\n removeEventListener("popstate", this.onPopState, false);\n removeEventListener("load", this.onPageLoad, false);\n return this.started = false;\n }\n }\n\n push(location, restorationIdentifier) {\n location = Turbolinks.Location.wrap(location);\n return this.update("push", location, restorationIdentifier);\n }\n\n replace(location, restorationIdentifier) {\n location = Turbolinks.Location.wrap(location);\n return this.update("replace", location, restorationIdentifier);\n }\n\n onPopState(event) {\n var location, ref, restorationIdentifier, turbolinks;\n if (this.shouldHandlePopState()) {\n if (turbolinks = (ref = event.state) != null ? ref.turbolinks : void 0) {\n location = Turbolinks.Location.wrap(window.location);\n restorationIdentifier = turbolinks.restorationIdentifier;\n return this.delegate.historyPoppedToLocationWithRestorationIdentifier(location, restorationIdentifier);\n }\n }\n }\n\n onPageLoad(event) {\n return Turbolinks.defer(() => {\n return this.pageLoaded = true;\n });\n }\n\n // Private\n shouldHandlePopState() {\n // Safari dispatches a popstate event after window\'s load event, ignore it\n return this.pageIsLoaded();\n }\n\n pageIsLoaded() {\n return this.pageLoaded || document.readyState === "complete";\n }\n\n update(method, location, restorationIdentifier) {\n var state;\n state = {\n turbolinks: {restorationIdentifier}\n };\n return history[method + "State"](state, null, location);\n }\n\n };\n\n}).call(this);\n\n\n//# sourceURL=webpack://Turbolinks/./src/turbolinks/history.js?')},"./src/turbolinks/http_request.js":function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){eval('/* provided dependency */ var Turbolinks = __webpack_require__(/*! ./ */ "./src/turbolinks/index.js");\n// Generated by CoffeeScript 2.7.0\n(function() {\n Turbolinks.HttpRequest = (function() {\n class HttpRequest {\n constructor(delegate, location, referrer) {\n // XMLHttpRequest events\n this.requestProgressed = this.requestProgressed.bind(this);\n this.requestLoaded = this.requestLoaded.bind(this);\n this.requestFailed = this.requestFailed.bind(this);\n this.requestTimedOut = this.requestTimedOut.bind(this);\n this.requestCanceled = this.requestCanceled.bind(this);\n this.delegate = delegate;\n this.url = Turbolinks.Location.wrap(location).requestURL;\n this.referrer = Turbolinks.Location.wrap(referrer).absoluteURL;\n this.createXHR();\n }\n\n send() {\n var base;\n if (this.xhr && !this.sent) {\n this.notifyApplicationBeforeRequestStart();\n this.setProgress(0);\n this.xhr.send();\n this.sent = true;\n return typeof (base = this.delegate).requestStarted === "function" ? base.requestStarted() : void 0;\n }\n }\n\n cancel() {\n if (this.xhr && this.sent) {\n return this.xhr.abort();\n }\n }\n\n requestProgressed(event) {\n if (event.lengthComputable) {\n return this.setProgress(event.loaded / event.total);\n }\n }\n\n requestLoaded() {\n return this.endRequest(() => {\n var ref;\n if ((200 <= (ref = this.xhr.status) && ref < 300)) {\n return this.delegate.requestCompletedWithResponse(this.xhr.responseText, this.xhr.getResponseHeader("Turbolinks-Location"));\n } else {\n this.failed = true;\n return this.delegate.requestFailedWithStatusCode(this.xhr.status, this.xhr.responseText);\n }\n });\n }\n\n requestFailed() {\n return this.endRequest(() => {\n this.failed = true;\n return this.delegate.requestFailedWithStatusCode(this.constructor.NETWORK_FAILURE);\n });\n }\n\n requestTimedOut() {\n return this.endRequest(() => {\n this.failed = true;\n return this.delegate.requestFailedWithStatusCode(this.constructor.TIMEOUT_FAILURE);\n });\n }\n\n requestCanceled() {\n return this.endRequest();\n }\n\n // Application events\n notifyApplicationBeforeRequestStart() {\n return Turbolinks.dispatch("turbolinks:request-start", {\n data: {\n url: this.url,\n xhr: this.xhr\n }\n });\n }\n\n notifyApplicationAfterRequestEnd() {\n return Turbolinks.dispatch("turbolinks:request-end", {\n data: {\n url: this.url,\n xhr: this.xhr\n }\n });\n }\n\n // Private\n createXHR() {\n this.xhr = new XMLHttpRequest();\n this.xhr.open("GET", this.url, true);\n this.xhr.timeout = this.constructor.timeout * 1000;\n this.xhr.setRequestHeader("Accept", "text/html, application/xhtml+xml");\n this.xhr.setRequestHeader("Turbolinks-Referrer", this.referrer);\n this.xhr.onprogress = this.requestProgressed;\n this.xhr.onload = this.requestLoaded;\n this.xhr.onerror = this.requestFailed;\n this.xhr.ontimeout = this.requestTimedOut;\n return this.xhr.onabort = this.requestCanceled;\n }\n\n endRequest(callback) {\n if (this.xhr) {\n this.notifyApplicationAfterRequestEnd();\n if (callback != null) {\n callback.call(this);\n }\n return this.destroy();\n }\n }\n\n setProgress(progress) {\n var base;\n this.progress = progress;\n return typeof (base = this.delegate).requestProgressed === "function" ? base.requestProgressed(this.progress) : void 0;\n }\n\n destroy() {\n var base;\n this.setProgress(1);\n if (typeof (base = this.delegate).requestFinished === "function") {\n base.requestFinished();\n }\n this.delegate = null;\n return this.xhr = null;\n }\n\n };\n\n HttpRequest.NETWORK_FAILURE = 0;\n\n HttpRequest.TIMEOUT_FAILURE = -1;\n\n HttpRequest.timeout = 60;\n\n return HttpRequest;\n\n }).call(this);\n\n}).call(this);\n\n\n//# sourceURL=webpack://Turbolinks/./src/turbolinks/http_request.js?')},"./src/turbolinks/index.js":function(module,__unused_webpack_exports,__webpack_require__){eval('/* provided dependency */ var Turbolinks = __webpack_require__(/*! ./ */ "./src/turbolinks/index.js");\n// Generated by CoffeeScript 2.7.0\n(function() {\n this.Turbolinks = {\n supported: (function() {\n return (window.history.pushState != null) && (window.requestAnimationFrame != null) && (window.addEventListener != null);\n })(),\n visit: function(location, options) {\n return Turbolinks.controller.visit(location, options);\n },\n clearCache: function() {\n return Turbolinks.controller.clearCache();\n },\n setProgressBarDelay: function(delay) {\n return Turbolinks.controller.setProgressBarDelay(delay);\n }\n };\n\n module.exports = this.Turbolinks;\n\n window.Turbolinks = this.Turbolinks;\n\n __webpack_require__(/*! ./helpers */ "./src/turbolinks/helpers.js");\n\n __webpack_require__(/*! ./controller */ "./src/turbolinks/controller.js");\n\n __webpack_require__(/*! ./script_warning */ "./src/turbolinks/script_warning.js");\n\n __webpack_require__(/*! ./start */ "./src/turbolinks/start.js");\n\n}).call(this);\n\n\n//# sourceURL=webpack://Turbolinks/./src/turbolinks/index.js?')},"./src/turbolinks/location.js":function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){eval('/* provided dependency */ var Turbolinks = __webpack_require__(/*! ./ */ "./src/turbolinks/index.js");\n// Generated by CoffeeScript 2.7.0\n(function() {\n Turbolinks.Location = (function() {\n var addTrailingSlash, getPrefixURL, stringEndsWith, stringStartsWith;\n\n class Location {\n static wrap(value) {\n if (value instanceof this) {\n return value;\n } else {\n return new this(value);\n }\n }\n\n constructor(url = "") {\n var anchorLength, linkWithAnchor;\n linkWithAnchor = document.createElement("a");\n linkWithAnchor.href = url.toString();\n this.absoluteURL = linkWithAnchor.href;\n anchorLength = linkWithAnchor.hash.length;\n if (anchorLength < 2) {\n this.requestURL = this.absoluteURL;\n } else {\n this.requestURL = this.absoluteURL.slice(0, -anchorLength);\n this.anchor = linkWithAnchor.hash.slice(1);\n }\n }\n\n getOrigin() {\n return this.absoluteURL.split("/", 3).join("/");\n }\n\n getPath() {\n var ref, ref1;\n return (ref = (ref1 = this.requestURL.match(/\\/\\/[^\\/]*(\\/[^?;]*)/)) != null ? ref1[1] : void 0) != null ? ref : "/";\n }\n\n getPathComponents() {\n return this.getPath().split("/").slice(1);\n }\n\n getLastPathComponent() {\n return this.getPathComponents().slice(-1)[0];\n }\n\n getExtension() {\n var ref, ref1;\n return (ref = (ref1 = this.getLastPathComponent().match(/\\.[^.]*$/)) != null ? ref1[0] : void 0) != null ? ref : "";\n }\n\n isHTML() {\n return this.getExtension().match(/^(?:|\\.(?:htm|html|xhtml))$/);\n }\n\n isPrefixedBy(location) {\n var prefixURL;\n prefixURL = getPrefixURL(location);\n return this.isEqualTo(location) || stringStartsWith(this.absoluteURL, prefixURL);\n }\n\n isEqualTo(location) {\n return this.absoluteURL === (location != null ? location.absoluteURL : void 0);\n }\n\n toCacheKey() {\n return this.requestURL;\n }\n\n toJSON() {\n return this.absoluteURL;\n }\n\n toString() {\n return this.absoluteURL;\n }\n\n valueOf() {\n return this.absoluteURL;\n }\n\n };\n\n // Private\n getPrefixURL = function(location) {\n return addTrailingSlash(location.getOrigin() + location.getPath());\n };\n\n addTrailingSlash = function(url) {\n if (stringEndsWith(url, "/")) {\n return url;\n } else {\n return url + "/";\n }\n };\n\n stringStartsWith = function(string, prefix) {\n return string.slice(0, prefix.length) === prefix;\n };\n\n stringEndsWith = function(string, suffix) {\n return string.slice(-suffix.length) === suffix;\n };\n\n return Location;\n\n }).call(this);\n\n}).call(this);\n\n\n//# sourceURL=webpack://Turbolinks/./src/turbolinks/location.js?')},"./src/turbolinks/progress_bar.js":function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){eval('/* provided dependency */ var Turbolinks = __webpack_require__(/*! ./ */ "./src/turbolinks/index.js");\n// Generated by CoffeeScript 2.7.0\n(function() {\n Turbolinks.ProgressBar = (function() {\n var ANIMATION_DURATION;\n\n class ProgressBar {\n constructor() {\n this.trickle = this.trickle.bind(this);\n this.stylesheetElement = this.createStylesheetElement();\n this.progressElement = this.createProgressElement();\n }\n\n show() {\n if (!this.visible) {\n this.visible = true;\n this.installStylesheetElement();\n this.installProgressElement();\n return this.startTrickling();\n }\n }\n\n hide() {\n if (this.visible && !this.hiding) {\n this.hiding = true;\n return this.fadeProgressElement(() => {\n this.uninstallProgressElement();\n this.stopTrickling();\n this.visible = false;\n return this.hiding = false;\n });\n }\n }\n\n setValue(value) {\n this.value = value;\n return this.refresh();\n }\n\n // Private\n installStylesheetElement() {\n return document.head.insertBefore(this.stylesheetElement, document.head.firstChild);\n }\n\n installProgressElement() {\n this.progressElement.style.width = 0;\n this.progressElement.style.opacity = 1;\n document.documentElement.insertBefore(this.progressElement, document.body);\n return this.refresh();\n }\n\n fadeProgressElement(callback) {\n this.progressElement.style.opacity = 0;\n return setTimeout(callback, ANIMATION_DURATION * 1.5);\n }\n\n uninstallProgressElement() {\n if (this.progressElement.parentNode) {\n return document.documentElement.removeChild(this.progressElement);\n }\n }\n\n startTrickling() {\n return this.trickleInterval != null ? this.trickleInterval : this.trickleInterval = setInterval(this.trickle, ANIMATION_DURATION);\n }\n\n stopTrickling() {\n clearInterval(this.trickleInterval);\n return this.trickleInterval = null;\n }\n\n trickle() {\n return this.setValue(this.value + Math.random() / 100);\n }\n\n refresh() {\n return requestAnimationFrame(() => {\n return this.progressElement.style.width = `${10 + (this.value * 90)}%`;\n });\n }\n\n createStylesheetElement() {\n var element;\n element = document.createElement("style");\n element.type = "text/css";\n element.textContent = this.constructor.defaultCSS;\n return element;\n }\n\n createProgressElement() {\n var element;\n element = document.createElement("div");\n element.className = "turbolinks-progress-bar";\n return element;\n }\n\n };\n\n ANIMATION_DURATION = 300;\n\n ProgressBar.defaultCSS = `.turbolinks-progress-bar {\n position: fixed;\n display: block;\n top: 0;\n left: 0;\n height: 3px;\n background: #0076ff;\n z-index: 9999;\n transition: width ${ANIMATION_DURATION}ms ease-out, opacity ${ANIMATION_DURATION / 2}ms ${ANIMATION_DURATION / 2}ms ease-in;\n transform: translate3d(0, 0, 0);\n}`;\n\n return ProgressBar;\n\n }).call(this);\n\n}).call(this);\n\n\n//# sourceURL=webpack://Turbolinks/./src/turbolinks/progress_bar.js?')},"./src/turbolinks/renderer.js":function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){eval('/* provided dependency */ var Turbolinks = __webpack_require__(/*! ./ */ "./src/turbolinks/index.js");\n// Generated by CoffeeScript 2.7.0\n(function() {\n Turbolinks.Renderer = (function() {\n var copyElementAttributes;\n\n class Renderer {\n static render(delegate, callback, ...args) {\n var renderer;\n renderer = new this(...args);\n renderer.delegate = delegate;\n renderer.render(callback);\n return renderer;\n }\n\n renderView(callback) {\n this.delegate.viewWillRender(this.newBody);\n callback();\n return this.delegate.viewRendered(this.newBody);\n }\n\n invalidateView() {\n return this.delegate.viewInvalidated();\n }\n\n createScriptElement(element) {\n var createdScriptElement;\n if (element.getAttribute("data-turbolinks-eval") === "false") {\n return element;\n } else {\n createdScriptElement = document.createElement("script");\n createdScriptElement.textContent = element.textContent;\n createdScriptElement.async = false;\n copyElementAttributes(createdScriptElement, element);\n return createdScriptElement;\n }\n }\n\n };\n\n copyElementAttributes = function(destinationElement, sourceElement) {\n var i, len, name, ref, results, value;\n ref = sourceElement.attributes;\n results = [];\n for (i = 0, len = ref.length; i < len; i++) {\n ({name, value} = ref[i]);\n results.push(destinationElement.setAttribute(name, value));\n }\n return results;\n };\n\n return Renderer;\n\n }).call(this);\n\n}).call(this);\n\n\n//# sourceURL=webpack://Turbolinks/./src/turbolinks/renderer.js?')},"./src/turbolinks/script_warning.js":function(){eval('// Generated by CoffeeScript 2.7.0\n(function() {\n (function() {\n var element, script;\n if (!(element = script = document.currentScript)) {\n return;\n }\n if (script.hasAttribute("data-turbolinks-suppress-warning")) {\n return;\n }\n while (element = element.parentNode) {\n if (element === document.body) {\n return console.warn(`You are loading Turbolinks from a <script> element inside the <body> element. This is probably not what you meant to do!\n\nLoad your application’s JavaScript bundle inside the <head> element instead. <script> elements in <body> are evaluated with each page change.\n\nFor more information, see: https://github.com/turbolinks/turbolinks#working-with-script-elements\n\n——\nSuppress this warning by adding a \\`data-turbolinks-suppress-warning\\` attribute to: %s`, script.outerHTML);\n }\n }\n })();\n\n}).call(this);\n\n\n//# sourceURL=webpack://Turbolinks/./src/turbolinks/script_warning.js?')},"./src/turbolinks/scroll_manager.js":function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){eval('/* provided dependency */ var Turbolinks = __webpack_require__(/*! ./ */ "./src/turbolinks/index.js");\n// Generated by CoffeeScript 2.7.0\n(function() {\n Turbolinks.ScrollManager = class ScrollManager {\n constructor(delegate) {\n this.onScroll = this.onScroll.bind(this);\n this.delegate = delegate;\n this.onScroll = Turbolinks.throttle(this.onScroll);\n }\n\n start() {\n if (!this.started) {\n addEventListener("scroll", this.onScroll, false);\n this.onScroll();\n return this.started = true;\n }\n }\n\n stop() {\n if (this.started) {\n removeEventListener("scroll", this.onScroll, false);\n return this.started = false;\n }\n }\n\n scrollToElement(element) {\n return element.scrollIntoView();\n }\n\n scrollToPosition({x, y}) {\n return window.scrollTo(x, y);\n }\n\n onScroll(event) {\n return this.updatePosition({\n x: window.pageXOffset,\n y: window.pageYOffset\n });\n }\n\n // Private\n updatePosition(position) {\n var ref;\n this.position = position;\n return (ref = this.delegate) != null ? ref.scrollPositionChanged(this.position) : void 0;\n }\n\n };\n\n}).call(this);\n\n\n//# sourceURL=webpack://Turbolinks/./src/turbolinks/scroll_manager.js?')},"./src/turbolinks/snapshot.js":function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){eval('/* provided dependency */ var Turbolinks = __webpack_require__(/*! ./ */ "./src/turbolinks/index.js");\n// Generated by CoffeeScript 2.7.0\n(function() {\n __webpack_require__(/*! ./head_details */ "./src/turbolinks/head_details.js");\n\n Turbolinks.Snapshot = class Snapshot {\n static wrap(value) {\n if (value instanceof this) {\n return value;\n } else if (typeof value === "string") {\n return this.fromHTMLString(value);\n } else {\n return this.fromHTMLElement(value);\n }\n }\n\n static fromHTMLString(html) {\n var htmlElement;\n htmlElement = document.createElement("html");\n htmlElement.innerHTML = html;\n return this.fromHTMLElement(htmlElement);\n }\n\n static fromHTMLElement(htmlElement) {\n var bodyElement, headDetails, headElement, ref;\n headElement = htmlElement.querySelector("head");\n bodyElement = (ref = htmlElement.querySelector("body")) != null ? ref : document.createElement("body");\n headDetails = Turbolinks.HeadDetails.fromHeadElement(headElement);\n return new this(headDetails, bodyElement);\n }\n\n constructor(headDetails1, bodyElement1) {\n this.headDetails = headDetails1;\n this.bodyElement = bodyElement1;\n }\n\n clone() {\n return new this.constructor(this.headDetails, this.bodyElement.cloneNode(true));\n }\n\n getRootLocation() {\n var ref, root;\n root = (ref = this.getSetting("root")) != null ? ref : "/";\n return new Turbolinks.Location(root);\n }\n\n getCacheControlValue() {\n return this.getSetting("cache-control");\n }\n\n getElementForAnchor(anchor) {\n try {\n return this.bodyElement.querySelector(`[id=\'${anchor}\'], a[name=\'${anchor}\']`);\n } catch (error) {}\n }\n\n getPermanentElements() {\n return this.bodyElement.querySelectorAll("[id][data-turbolinks-permanent]");\n }\n\n getPermanentElementById(id) {\n return this.bodyElement.querySelector(`#${id}[data-turbolinks-permanent]`);\n }\n\n getPermanentElementsPresentInSnapshot(snapshot) {\n var element, i, len, ref, results;\n ref = this.getPermanentElements();\n results = [];\n for (i = 0, len = ref.length; i < len; i++) {\n element = ref[i];\n if (snapshot.getPermanentElementById(element.id)) {\n results.push(element);\n }\n }\n return results;\n }\n\n findFirstAutofocusableElement() {\n return this.bodyElement.querySelector("[autofocus]");\n }\n\n hasAnchor(anchor) {\n return this.getElementForAnchor(anchor) != null;\n }\n\n isPreviewable() {\n return this.getCacheControlValue() !== "no-preview";\n }\n\n isCacheable() {\n return this.getCacheControlValue() !== "no-cache";\n }\n\n isVisitable() {\n return this.getSetting("visit-control") !== "reload";\n }\n\n // Private\n getSetting(name) {\n return this.headDetails.getMetaValue(`turbolinks-${name}`);\n }\n\n };\n\n}).call(this);\n\n\n//# sourceURL=webpack://Turbolinks/./src/turbolinks/snapshot.js?')},"./src/turbolinks/snapshot_cache.js":function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){eval('/* provided dependency */ var Turbolinks = __webpack_require__(/*! ./ */ "./src/turbolinks/index.js");\n// Generated by CoffeeScript 2.7.0\n(function() {\n Turbolinks.SnapshotCache = (function() {\n var keyForLocation;\n\n class SnapshotCache {\n constructor(size) {\n this.size = size;\n this.keys = [];\n this.snapshots = {};\n }\n\n has(location) {\n var key;\n key = keyForLocation(location);\n return key in this.snapshots;\n }\n\n get(location) {\n var snapshot;\n if (!this.has(location)) {\n return;\n }\n snapshot = this.read(location);\n this.touch(location);\n return snapshot;\n }\n\n put(location, snapshot) {\n this.write(location, snapshot);\n this.touch(location);\n return snapshot;\n }\n\n // Private\n read(location) {\n var key;\n key = keyForLocation(location);\n return this.snapshots[key];\n }\n\n write(location, snapshot) {\n var key;\n key = keyForLocation(location);\n return this.snapshots[key] = snapshot;\n }\n\n touch(location) {\n var index, key;\n key = keyForLocation(location);\n index = this.keys.indexOf(key);\n if (index > -1) {\n this.keys.splice(index, 1);\n }\n this.keys.unshift(key);\n return this.trim();\n }\n\n trim() {\n var i, key, len, ref, results;\n ref = this.keys.splice(this.size);\n results = [];\n for (i = 0, len = ref.length; i < len; i++) {\n key = ref[i];\n results.push(delete this.snapshots[key]);\n }\n return results;\n }\n\n };\n\n keyForLocation = function(location) {\n return Turbolinks.Location.wrap(location).toCacheKey();\n };\n\n return SnapshotCache;\n\n }).call(this);\n\n}).call(this);\n\n\n//# sourceURL=webpack://Turbolinks/./src/turbolinks/snapshot_cache.js?')},"./src/turbolinks/snapshot_renderer.js":function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){eval('/* provided dependency */ var Turbolinks = __webpack_require__(/*! ./ */ "./src/turbolinks/index.js");\n// Generated by CoffeeScript 2.7.0\n(function() {\n var createPlaceholderForPermanentElement, replaceElementWithElement;\n\n __webpack_require__(/*! ./renderer */ "./src/turbolinks/renderer.js");\n\n Turbolinks.SnapshotRenderer = class SnapshotRenderer extends Turbolinks.Renderer {\n constructor(currentSnapshot, newSnapshot, isPreview) {\n super(currentSnapshot, newSnapshot, isPreview);\n this.currentSnapshot = currentSnapshot;\n this.newSnapshot = newSnapshot;\n this.isPreview = isPreview;\n this.currentHeadDetails = this.currentSnapshot.headDetails;\n this.newHeadDetails = this.newSnapshot.headDetails;\n this.currentBody = this.currentSnapshot.bodyElement;\n this.newBody = this.newSnapshot.bodyElement;\n }\n\n render(callback) {\n if (this.shouldRender()) {\n this.mergeHead();\n return this.renderView(() => {\n this.replaceBody();\n if (!this.isPreview) {\n this.focusFirstAutofocusableElement();\n }\n return callback();\n });\n } else {\n return this.invalidateView();\n }\n }\n\n mergeHead() {\n this.copyNewHeadStylesheetElements();\n this.copyNewHeadScriptElements();\n this.removeCurrentHeadProvisionalElements();\n return this.copyNewHeadProvisionalElements();\n }\n\n replaceBody() {\n var placeholders;\n placeholders = this.relocateCurrentBodyPermanentElements();\n this.activateNewBodyScriptElements();\n this.assignNewBody();\n return this.replacePlaceholderElementsWithClonedPermanentElements(placeholders);\n }\n\n shouldRender() {\n return this.newSnapshot.isVisitable() && this.trackedElementsAreIdentical();\n }\n\n trackedElementsAreIdentical() {\n return this.currentHeadDetails.getTrackedElementSignature() === this.newHeadDetails.getTrackedElementSignature();\n }\n\n copyNewHeadStylesheetElements() {\n var element, i, len, ref, results;\n ref = this.getNewHeadStylesheetElements();\n results = [];\n for (i = 0, len = ref.length; i < len; i++) {\n element = ref[i];\n results.push(document.head.appendChild(element));\n }\n return results;\n }\n\n copyNewHeadScriptElements() {\n var element, i, len, ref, results;\n ref = this.getNewHeadScriptElements();\n results = [];\n for (i = 0, len = ref.length; i < len; i++) {\n element = ref[i];\n results.push(document.head.appendChild(this.createScriptElement(element)));\n }\n return results;\n }\n\n removeCurrentHeadProvisionalElements() {\n var element, i, len, ref, results;\n ref = this.getCurrentHeadProvisionalElements();\n results = [];\n for (i = 0, len = ref.length; i < len; i++) {\n element = ref[i];\n results.push(document.head.removeChild(element));\n }\n return results;\n }\n\n copyNewHeadProvisionalElements() {\n var element, i, len, ref, results;\n ref = this.getNewHeadProvisionalElements();\n results = [];\n for (i = 0, len = ref.length; i < len; i++) {\n element = ref[i];\n results.push(document.head.appendChild(element));\n }\n return results;\n }\n\n relocateCurrentBodyPermanentElements() {\n var i, len, newElement, permanentElement, placeholder, ref, results;\n ref = this.getCurrentBodyPermanentElements();\n results = [];\n for (i = 0, len = ref.length; i < len; i++) {\n permanentElement = ref[i];\n placeholder = createPlaceholderForPermanentElement(permanentElement);\n newElement = this.newSnapshot.getPermanentElementById(permanentElement.id);\n replaceElementWithElement(permanentElement, placeholder.element);\n replaceElementWithElement(newElement, permanentElement);\n results.push(placeholder);\n }\n return results;\n }\n\n replacePlaceholderElementsWithClonedPermanentElements(placeholders) {\n var clonedElement, element, i, len, permanentElement, results;\n results = [];\n for (i = 0, len = placeholders.length; i < len; i++) {\n ({element, permanentElement} = placeholders[i]);\n clonedElement = permanentElement.cloneNode(true);\n results.push(replaceElementWithElement(element, clonedElement));\n }\n return results;\n }\n\n activateNewBodyScriptElements() {\n var activatedScriptElement, i, inertScriptElement, len, ref, results;\n ref = this.getNewBodyScriptElements();\n results = [];\n for (i = 0, len = ref.length; i < len; i++) {\n inertScriptElement = ref[i];\n activatedScriptElement = this.createScriptElement(inertScriptElement);\n results.push(replaceElementWithElement(inertScriptElement, activatedScriptElement));\n }\n return results;\n }\n\n assignNewBody() {\n return document.body = this.newBody;\n }\n\n focusFirstAutofocusableElement() {\n var ref;\n return (ref = this.newSnapshot.findFirstAutofocusableElement()) != null ? ref.focus() : void 0;\n }\n\n getNewHeadStylesheetElements() {\n return this.newHeadDetails.getStylesheetElementsNotInDetails(this.currentHeadDetails);\n }\n\n getNewHeadScriptElements() {\n return this.newHeadDetails.getScriptElementsNotInDetails(this.currentHeadDetails);\n }\n\n getCurrentHeadProvisionalElements() {\n return this.currentHeadDetails.getProvisionalElements();\n }\n\n getNewHeadProvisionalElements() {\n return this.newHeadDetails.getProvisionalElements();\n }\n\n getCurrentBodyPermanentElements() {\n return this.currentSnapshot.getPermanentElementsPresentInSnapshot(this.newSnapshot);\n }\n\n getNewBodyScriptElements() {\n return this.newBody.querySelectorAll("script");\n }\n\n };\n\n createPlaceholderForPermanentElement = function(permanentElement) {\n var element;\n element = document.createElement("meta");\n element.setAttribute("name", "turbolinks-permanent-placeholder");\n element.setAttribute("content", permanentElement.id);\n return {element, permanentElement};\n };\n\n replaceElementWithElement = function(fromElement, toElement) {\n var parentElement;\n if (parentElement = fromElement.parentNode) {\n return parentElement.replaceChild(toElement, fromElement);\n }\n };\n\n}).call(this);\n\n\n//# sourceURL=webpack://Turbolinks/./src/turbolinks/snapshot_renderer.js?')},"./src/turbolinks/start.js":function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){eval('/* provided dependency */ var Turbolinks = __webpack_require__(/*! ./ */ "./src/turbolinks/index.js");\n// Generated by CoffeeScript 2.7.0\n(function() {\n var createController, installTurbolinks, moduleIsInstalled;\n\n Turbolinks.start = function() {\n if (installTurbolinks()) {\n if (Turbolinks.controller == null) {\n Turbolinks.controller = createController();\n }\n return Turbolinks.controller.start();\n }\n };\n\n installTurbolinks = function() {\n if (window.Turbolinks == null) {\n window.Turbolinks = Turbolinks;\n }\n return moduleIsInstalled();\n };\n\n createController = function() {\n var controller;\n controller = new Turbolinks.Controller();\n controller.adapter = new Turbolinks.BrowserAdapter(controller);\n return controller;\n };\n\n moduleIsInstalled = function() {\n return window.Turbolinks === Turbolinks;\n };\n\n if (moduleIsInstalled()) {\n Turbolinks.start();\n }\n\n}).call(this);\n\n\n//# sourceURL=webpack://Turbolinks/./src/turbolinks/start.js?')},"./src/turbolinks/view.js":function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){eval('/* provided dependency */ var Turbolinks = __webpack_require__(/*! ./ */ "./src/turbolinks/index.js");\n// Generated by CoffeeScript 2.7.0\n(function() {\n __webpack_require__(/*! ./snapshot */ "./src/turbolinks/snapshot.js");\n\n __webpack_require__(/*! ./snapshot_renderer */ "./src/turbolinks/snapshot_renderer.js");\n\n __webpack_require__(/*! ./error_renderer */ "./src/turbolinks/error_renderer.js");\n\n Turbolinks.View = class View {\n constructor(delegate) {\n this.delegate = delegate;\n this.htmlElement = document.documentElement;\n }\n\n getRootLocation() {\n return this.getSnapshot().getRootLocation();\n }\n\n getElementForAnchor(anchor) {\n return this.getSnapshot().getElementForAnchor(anchor);\n }\n\n getSnapshot() {\n return Turbolinks.Snapshot.fromHTMLElement(this.htmlElement);\n }\n\n render({snapshot, error, isPreview}, callback) {\n this.markAsPreview(isPreview);\n if (snapshot != null) {\n return this.renderSnapshot(snapshot, isPreview, callback);\n } else {\n return this.renderError(error, callback);\n }\n }\n\n // Private\n markAsPreview(isPreview) {\n if (isPreview) {\n return this.htmlElement.setAttribute("data-turbolinks-preview", "");\n } else {\n return this.htmlElement.removeAttribute("data-turbolinks-preview");\n }\n }\n\n renderSnapshot(snapshot, isPreview, callback) {\n return Turbolinks.SnapshotRenderer.render(this.delegate, callback, this.getSnapshot(), Turbolinks.Snapshot.wrap(snapshot), isPreview);\n }\n\n renderError(error, callback) {\n return Turbolinks.ErrorRenderer.render(this.delegate, callback, error);\n }\n\n };\n\n}).call(this);\n\n\n//# sourceURL=webpack://Turbolinks/./src/turbolinks/view.js?')},"./src/turbolinks/visit.js":function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){eval('/* provided dependency */ var Turbolinks = __webpack_require__(/*! ./ */ "./src/turbolinks/index.js");\n// Generated by CoffeeScript 2.7.0\n(function() {\n __webpack_require__(/*! ./http_request */ "./src/turbolinks/http_request.js");\n\n Turbolinks.Visit = (function() {\n var getHistoryMethodForAction;\n\n class Visit {\n constructor(controller, location, action1) {\n // Scrolling\n this.performScroll = this.performScroll.bind(this);\n this.controller = controller;\n this.action = action1;\n this.identifier = Turbolinks.uuid();\n this.location = Turbolinks.Location.wrap(location);\n this.adapter = this.controller.adapter;\n this.state = "initialized";\n this.timingMetrics = {};\n }\n\n start() {\n if (this.state === "initialized") {\n this.recordTimingMetric("visitStart");\n this.state = "started";\n return this.adapter.visitStarted(this);\n }\n }\n\n cancel() {\n var ref;\n if (this.state === "started") {\n if ((ref = this.request) != null) {\n ref.cancel();\n }\n this.cancelRender();\n return this.state = "canceled";\n }\n }\n\n complete() {\n var base;\n if (this.state === "started") {\n this.recordTimingMetric("visitEnd");\n this.state = "completed";\n if (typeof (base = this.adapter).visitCompleted === "function") {\n base.visitCompleted(this);\n }\n return this.controller.visitCompleted(this);\n }\n }\n\n fail() {\n var base;\n if (this.state === "started") {\n this.state = "failed";\n return typeof (base = this.adapter).visitFailed === "function" ? base.visitFailed(this) : void 0;\n }\n }\n\n changeHistory() {\n var actionForHistory, method;\n if (!this.historyChanged) {\n actionForHistory = this.location.isEqualTo(this.referrer) ? "replace" : this.action;\n method = getHistoryMethodForAction(actionForHistory);\n this.controller[method](this.location, this.restorationIdentifier);\n return this.historyChanged = true;\n }\n }\n\n issueRequest() {\n if (this.shouldIssueRequest() && (this.request == null)) {\n this.progress = 0;\n this.request = new Turbolinks.HttpRequest(this, this.location, this.referrer);\n return this.request.send();\n }\n }\n\n getCachedSnapshot() {\n var snapshot;\n if (snapshot = this.controller.getCachedSnapshotForLocation(this.location)) {\n if ((this.location.anchor == null) || snapshot.hasAnchor(this.location.anchor)) {\n if (this.action === "restore" || snapshot.isPreviewable()) {\n return snapshot;\n }\n }\n }\n }\n\n hasCachedSnapshot() {\n return this.getCachedSnapshot() != null;\n }\n\n loadCachedSnapshot() {\n var isPreview, snapshot;\n if (snapshot = this.getCachedSnapshot()) {\n isPreview = this.shouldIssueRequest();\n return this.render(function() {\n var base;\n this.cacheSnapshot();\n this.controller.render({snapshot, isPreview}, this.performScroll);\n if (typeof (base = this.adapter).visitRendered === "function") {\n base.visitRendered(this);\n }\n if (!isPreview) {\n return this.complete();\n }\n });\n }\n }\n\n loadResponse() {\n if (this.response != null) {\n return this.render(function() {\n var base, base1;\n this.cacheSnapshot();\n if (this.request.failed) {\n this.controller.render({\n error: this.response\n }, this.performScroll);\n if (typeof (base = this.adapter).visitRendered === "function") {\n base.visitRendered(this);\n }\n return this.fail();\n } else {\n this.controller.render({\n snapshot: this.response\n }, this.performScroll);\n if (typeof (base1 = this.adapter).visitRendered === "function") {\n base1.visitRendered(this);\n }\n return this.complete();\n }\n });\n }\n }\n\n followRedirect() {\n if (this.redirectedToLocation && !this.followedRedirect) {\n this.location = this.redirectedToLocation;\n this.controller.replaceHistoryWithLocationAndRestorationIdentifier(this.redirectedToLocation, this.restorationIdentifier);\n return this.followedRedirect = true;\n }\n }\n\n // HTTP Request delegate\n requestStarted() {\n var base;\n this.recordTimingMetric("requestStart");\n return typeof (base = this.adapter).visitRequestStarted === "function" ? base.visitRequestStarted(this) : void 0;\n }\n\n requestProgressed(progress) {\n var base;\n this.progress = progress;\n return typeof (base = this.adapter).visitRequestProgressed === "function" ? base.visitRequestProgressed(this) : void 0;\n }\n\n requestCompletedWithResponse(response, redirectedToLocation) {\n this.response = response;\n if (redirectedToLocation != null) {\n this.redirectedToLocation = Turbolinks.Location.wrap(redirectedToLocation);\n }\n return this.adapter.visitRequestCompleted(this);\n }\n\n requestFailedWithStatusCode(statusCode, response) {\n this.response = response;\n return this.adapter.visitRequestFailedWithStatusCode(this, statusCode);\n }\n\n requestFinished() {\n var base;\n this.recordTimingMetric("requestEnd");\n return typeof (base = this.adapter).visitRequestFinished === "function" ? base.visitRequestFinished(this) : void 0;\n }\n\n performScroll() {\n if (!this.scrolled) {\n if (this.action === "restore") {\n this.scrollToRestoredPosition() || this.scrollToTop();\n } else {\n this.scrollToAnchor() || this.scrollToTop();\n }\n return this.scrolled = true;\n }\n }\n\n scrollToRestoredPosition() {\n var position, ref;\n position = (ref = this.restorationData) != null ? ref.scrollPosition : void 0;\n if (position != null) {\n this.controller.scrollToPosition(position);\n return true;\n }\n }\n\n scrollToAnchor() {\n if (this.location.anchor != null) {\n this.controller.scrollToAnchor(this.location.anchor);\n return true;\n }\n }\n\n scrollToTop() {\n return this.controller.scrollToPosition({\n x: 0,\n y: 0\n });\n }\n\n // Instrumentation\n recordTimingMetric(name) {\n var base;\n return (base = this.timingMetrics)[name] != null ? base[name] : base[name] = new Date().getTime();\n }\n\n getTimingMetrics() {\n return Turbolinks.copyObject(this.timingMetrics);\n }\n\n shouldIssueRequest() {\n if (this.action === "restore") {\n return !this.hasCachedSnapshot();\n } else {\n return true;\n }\n }\n\n cacheSnapshot() {\n if (!this.snapshotCached) {\n this.controller.cacheSnapshot();\n return this.snapshotCached = true;\n }\n }\n\n render(callback) {\n this.cancelRender();\n return this.frame = requestAnimationFrame(() => {\n this.frame = null;\n return callback.call(this);\n });\n }\n\n cancelRender() {\n if (this.frame) {\n return cancelAnimationFrame(this.frame);\n }\n }\n\n };\n\n // Private\n getHistoryMethodForAction = function(action) {\n switch (action) {\n case "replace":\n return "replaceHistoryWithLocationAndRestorationIdentifier";\n case "advance":\n case "restore":\n return "pushHistoryWithLocationAndRestorationIdentifier";\n }\n };\n\n return Visit;\n\n }).call(this);\n\n}).call(this);\n\n\n//# sourceURL=webpack://Turbolinks/./src/turbolinks/visit.js?')}};var __webpack_module_cache__={};function __webpack_require__(moduleId){var cachedModule=__webpack_module_cache__[moduleId];if(cachedModule!==undefined){return cachedModule.exports}var module=__webpack_module_cache__[moduleId]={exports:{}};__webpack_modules__[moduleId].call(module.exports,module,module.exports,__webpack_require__);return module.exports}var __webpack_exports__=__webpack_require__("./src/turbolinks/index.js");Turbolinks=__webpack_exports__})();