{ "version": 3, "sources": ["../../../node_modules/@rails/actioncable/src/adapters.js", "../../../node_modules/@rails/actioncable/src/logger.js", "../../../node_modules/@rails/actioncable/src/connection_monitor.js", "../../../node_modules/@rails/actioncable/src/internal.js", "../../../node_modules/@rails/actioncable/src/connection.js", "../../../node_modules/@rails/actioncable/src/subscription.js", "../../../node_modules/@rails/actioncable/src/subscription_guarantor.js", "../../../node_modules/@rails/actioncable/src/subscriptions.js", "../../../node_modules/@rails/actioncable/src/consumer.js", "../../../node_modules/@rails/actioncable/src/index.js", "../../../node_modules/jquery-ujs/src/rails.js", "../../../node_modules/jquery/dist/jquery.js", "../../../node_modules/@hotwired/turbo/dist/turbo.es2017-esm.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/cable.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/snakeize.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/cable_stream_source_element.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/fetch_requests.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/index.js", "../../../node_modules/@hotwired/stimulus/dist/stimulus.js", "../../javascript/controllers/application.js", "../../javascript/controllers/clipboard_controller.js", "../../javascript/controllers/djschool_lesson_controller.js", "../../../node_modules/@rails/request.js/src/fetch_response.js", "../../../node_modules/@rails/request.js/src/request_interceptor.js", "../../../node_modules/@rails/request.js/src/lib/utils.js", "../../../node_modules/@rails/request.js/src/fetch_request.js", "../../../node_modules/@rails/request.js/src/verbs.js", "../../javascript/controllers/djschool_progress_controller.js", "../../javascript/controllers/gallery_controller.js", "../../javascript/controllers/hardware_controller.js", "../../javascript/controllers/scrolltotop_controller.js", "../../../node_modules/sortablejs/modular/sortable.esm.js", "../../javascript/controllers/sortable_controller.js", "../../javascript/controllers/toggle_controller.js", "../../../node_modules/trix/src/trix/config/attachments.js", "../../../node_modules/trix/src/trix/config/block_attributes.js", "../../../node_modules/trix/src/trix/config/browser.js", "../../../node_modules/trix/src/trix/config/lang.js", "../../../node_modules/trix/src/trix/config/file_size_formatting.js", "../../../node_modules/trix/src/trix/constants.js", "../../../node_modules/trix/src/trix/core/helpers/extend.js", "../../../node_modules/trix/src/trix/core/helpers/dom.js", "../../../node_modules/trix/src/trix/config/input.js", "../../../node_modules/trix/src/trix/config/key_names.js", "../../../node_modules/trix/src/trix/config/parser.js", "../../../node_modules/trix/src/trix/config/text_attributes.js", "../../../node_modules/trix/src/trix/config/toolbar.js", "../../../node_modules/trix/src/trix/config/undo.js", "../../../node_modules/trix/src/trix/config/css.js", "../../../node_modules/trix/src/trix/core/basic_object.js", "../../../node_modules/trix/src/trix/core/utilities/utf16_string.js", "../../../node_modules/trix/src/trix/core/object.js", "../../../node_modules/trix/src/trix/core/helpers/arrays.js", "../../../node_modules/trix/src/trix/core/helpers/bidi.js", "../../../node_modules/trix/src/trix/core/helpers/config.js", "../../../node_modules/trix/src/trix/core/helpers/custom_elements.js", "../../../node_modules/trix/src/trix/core/helpers/events.js", "../../../node_modules/trix/src/trix/core/helpers/functions.js", "../../../node_modules/trix/src/trix/core/helpers/objects.js", "../../../node_modules/trix/src/trix/core/helpers/ranges.js", "../../../node_modules/trix/src/trix/observers/selection_change_observer.js", "../../../node_modules/trix/src/trix/core/helpers/strings.js", "../../../node_modules/trix/src/trix/core/collections/hash.js", "../../../node_modules/trix/src/trix/core/collections/object_group.js", "../../../node_modules/trix/src/trix/core/collections/object_map.js", "../../../node_modules/trix/src/trix/core/collections/element_store.js", "../../../node_modules/trix/src/trix/core/utilities/operation.js", "../../../node_modules/trix/src/trix/views/object_view.js", "../../../node_modules/trix/src/trix/models/html_sanitizer.js", "../../../node_modules/trix/src/trix/views/attachment_view.js", "../../../node_modules/trix/src/trix/views/previewable_attachment_view.js", "../../../node_modules/trix/src/trix/views/piece_view.js", "../../../node_modules/trix/src/trix/views/text_view.js", "../../../node_modules/trix/src/trix/views/block_view.js", "../../../node_modules/trix/src/trix/views/document_view.js", "../../../node_modules/trix/src/trix/models/piece.js", "../../../node_modules/trix/src/trix/operations/image_preload_operation.js", "../../../node_modules/trix/src/trix/models/attachment.js", "../../../node_modules/trix/src/trix/models/attachment_piece.js", "../../../node_modules/trix/src/trix/models/string_piece.js", "../../../node_modules/trix/src/trix/models/splittable_list.js", "../../../node_modules/trix/src/trix/models/text.js", "../../../node_modules/trix/src/trix/models/block.js", "../../../node_modules/trix/src/trix/models/document.js", "../../../node_modules/trix/src/trix/models/html_parser.js", "../../../node_modules/trix/src/trix/core/serialization.js", "../../../node_modules/trix/src/trix/models/managed_attachment.js", "../../../node_modules/trix/src/trix/models/attachment_manager.js", "../../../node_modules/trix/src/trix/models/line_break_insertion.js", "../../../node_modules/trix/src/trix/models/composition.js", "../../../node_modules/trix/src/trix/models/undo_manager.js", "../../../node_modules/trix/src/trix/filters/filter.js", "../../../node_modules/trix/src/trix/filters/attachment_gallery_filter.js", "../../../node_modules/trix/src/trix/models/editor.js", "../../../node_modules/trix/src/trix/models/location_mapper.js", "../../../node_modules/trix/src/trix/models/point_mapper.js", "../../../node_modules/trix/src/trix/models/selection_manager.js", "../../../node_modules/trix/src/trix/controllers/attachment_editor_controller.js", "../../../node_modules/trix/src/trix/controllers/composition_controller.js", "../../../node_modules/trix/src/trix/controllers/controller.js", "../../../node_modules/trix/src/trix/observers/mutation_observer.js", "../../../node_modules/trix/src/trix/operations/file_verification_operation.js", "../../../node_modules/trix/src/trix/models/flaky_android_keyboard_detector.js", "../../../node_modules/trix/src/trix/controllers/input_controller.js", "../../../node_modules/trix/src/trix/controllers/level_0_input_controller.js", "../../../node_modules/trix/src/trix/controllers/level_2_input_controller.js", "../../../node_modules/trix/src/trix/controllers/toolbar_controller.js", "../../../node_modules/trix/src/trix/controllers/editor_controller.js", "../../../node_modules/trix/src/trix/elements/trix_toolbar_element.js", "../../../node_modules/trix/src/trix/elements/trix_editor_element.js", "../../../node_modules/trix/src/trix/trix.js", "../../../node_modules/@rails/actiontext/app/assets/javascripts/actiontext.esm.js", "../../javascript/controllers/trix_youtube_attachment_controller.js", "../../javascript/controllers/voucher_resource_controller.js", "../../javascript/controllers/index.js", "../../javascript/application.js", "../../javascript/lib/freetrial_signup.js", "../../javascript/lib/header.js", "../../javascript/lib/jquery-global.js", "../../javascript/lib/mailchimp_signup.js", "../../javascript/lib/main.js", "../../javascript/lib/youtube.js"], "sourcesContent": ["export default {\n logger: typeof console !== \"undefined\" ? console : undefined,\n WebSocket: typeof WebSocket !== \"undefined\" ? WebSocket : undefined,\n}\n", "import adapters from \"./adapters\"\n\n// The logger is disabled by default. You can enable it with:\n//\n// ActionCable.logger.enabled = true\n//\n// Example:\n//\n// import * as ActionCable from '@rails/actioncable'\n//\n// ActionCable.logger.enabled = true\n// ActionCable.logger.log('Connection Established.')\n//\n\nexport default {\n log(...messages) {\n if (this.enabled) {\n messages.push(Date.now())\n adapters.logger.log(\"[ActionCable]\", ...messages)\n }\n },\n}\n", "import logger from \"./logger\"\n\n// Responsible for ensuring the cable connection is in good health by validating the heartbeat pings sent from the server, and attempting\n// revival reconnections if things go astray. Internal class, not intended for direct user manipulation.\n\nconst now = () => new Date().getTime()\n\nconst secondsSince = time => (now() - time) / 1000\n\nclass ConnectionMonitor {\n constructor(connection) {\n this.visibilityDidChange = this.visibilityDidChange.bind(this)\n this.connection = connection\n this.reconnectAttempts = 0\n }\n\n start() {\n if (!this.isRunning()) {\n this.startedAt = now()\n delete this.stoppedAt\n this.startPolling()\n addEventListener(\"visibilitychange\", this.visibilityDidChange)\n logger.log(`ConnectionMonitor started. stale threshold = ${this.constructor.staleThreshold} s`)\n }\n }\n\n stop() {\n if (this.isRunning()) {\n this.stoppedAt = now()\n this.stopPolling()\n removeEventListener(\"visibilitychange\", this.visibilityDidChange)\n logger.log(\"ConnectionMonitor stopped\")\n }\n }\n\n isRunning() {\n return this.startedAt && !this.stoppedAt\n }\n\n recordMessage() {\n this.pingedAt = now()\n }\n\n recordConnect() {\n this.reconnectAttempts = 0\n delete this.disconnectedAt\n logger.log(\"ConnectionMonitor recorded connect\")\n }\n\n recordDisconnect() {\n this.disconnectedAt = now()\n logger.log(\"ConnectionMonitor recorded disconnect\")\n }\n\n // Private\n\n startPolling() {\n this.stopPolling()\n this.poll()\n }\n\n stopPolling() {\n clearTimeout(this.pollTimeout)\n }\n\n poll() {\n this.pollTimeout = setTimeout(() => {\n this.reconnectIfStale()\n this.poll()\n }\n , this.getPollInterval())\n }\n\n getPollInterval() {\n const { staleThreshold, reconnectionBackoffRate } = this.constructor\n const backoff = Math.pow(1 + reconnectionBackoffRate, Math.min(this.reconnectAttempts, 10))\n const jitterMax = this.reconnectAttempts === 0 ? 1.0 : reconnectionBackoffRate\n const jitter = jitterMax * Math.random()\n return staleThreshold * 1000 * backoff * (1 + jitter)\n }\n\n reconnectIfStale() {\n if (this.connectionIsStale()) {\n logger.log(`ConnectionMonitor detected stale connection. reconnectAttempts = ${this.reconnectAttempts}, time stale = ${secondsSince(this.refreshedAt)} s, stale threshold = ${this.constructor.staleThreshold} s`)\n this.reconnectAttempts++\n if (this.disconnectedRecently()) {\n logger.log(`ConnectionMonitor skipping reopening recent disconnect. time disconnected = ${secondsSince(this.disconnectedAt)} s`)\n } else {\n logger.log(\"ConnectionMonitor reopening\")\n this.connection.reopen()\n }\n }\n }\n\n get refreshedAt() {\n return this.pingedAt ? this.pingedAt : this.startedAt\n }\n\n connectionIsStale() {\n return secondsSince(this.refreshedAt) > this.constructor.staleThreshold\n }\n\n disconnectedRecently() {\n return this.disconnectedAt && (secondsSince(this.disconnectedAt) < this.constructor.staleThreshold)\n }\n\n visibilityDidChange() {\n if (document.visibilityState === \"visible\") {\n setTimeout(() => {\n if (this.connectionIsStale() || !this.connection.isOpen()) {\n logger.log(`ConnectionMonitor reopening stale connection on visibilitychange. visibilityState = ${document.visibilityState}`)\n this.connection.reopen()\n }\n }\n , 200)\n }\n }\n\n}\n\nConnectionMonitor.staleThreshold = 6 // Server::Connections::BEAT_INTERVAL * 2 (missed two pings)\nConnectionMonitor.reconnectionBackoffRate = 0.15\n\nexport default ConnectionMonitor\n", "export default {\n \"message_types\": {\n \"welcome\": \"welcome\",\n \"disconnect\": \"disconnect\",\n \"ping\": \"ping\",\n \"confirmation\": \"confirm_subscription\",\n \"rejection\": \"reject_subscription\"\n },\n \"disconnect_reasons\": {\n \"unauthorized\": \"unauthorized\",\n \"invalid_request\": \"invalid_request\",\n \"server_restart\": \"server_restart\",\n \"remote\": \"remote\"\n },\n \"default_mount_path\": \"/cable\",\n \"protocols\": [\n \"actioncable-v1-json\",\n \"actioncable-unsupported\"\n ]\n}\n", "import adapters from \"./adapters\"\nimport ConnectionMonitor from \"./connection_monitor\"\nimport INTERNAL from \"./internal\"\nimport logger from \"./logger\"\n\n// Encapsulate the cable connection held by the consumer. This is an internal class not intended for direct user manipulation.\n\nconst {message_types, protocols} = INTERNAL\nconst supportedProtocols = protocols.slice(0, protocols.length - 1)\n\nconst indexOf = [].indexOf\n\nclass Connection {\n constructor(consumer) {\n this.open = this.open.bind(this)\n this.consumer = consumer\n this.subscriptions = this.consumer.subscriptions\n this.monitor = new ConnectionMonitor(this)\n this.disconnected = true\n }\n\n send(data) {\n if (this.isOpen()) {\n this.webSocket.send(JSON.stringify(data))\n return true\n } else {\n return false\n }\n }\n\n open() {\n if (this.isActive()) {\n logger.log(`Attempted to open WebSocket, but existing socket is ${this.getState()}`)\n return false\n } else {\n const socketProtocols = [...protocols, ...this.consumer.subprotocols || []]\n logger.log(`Opening WebSocket, current state is ${this.getState()}, subprotocols: ${socketProtocols}`)\n if (this.webSocket) { this.uninstallEventHandlers() }\n this.webSocket = new adapters.WebSocket(this.consumer.url, socketProtocols)\n this.installEventHandlers()\n this.monitor.start()\n return true\n }\n }\n\n close({allowReconnect} = {allowReconnect: true}) {\n if (!allowReconnect) { this.monitor.stop() }\n // Avoid closing websockets in a \"connecting\" state due to Safari 15.1+ bug. See: https://github.com/rails/rails/issues/43835#issuecomment-1002288478\n if (this.isOpen()) {\n return this.webSocket.close()\n }\n }\n\n reopen() {\n logger.log(`Reopening WebSocket, current state is ${this.getState()}`)\n if (this.isActive()) {\n try {\n return this.close()\n } catch (error) {\n logger.log(\"Failed to reopen WebSocket\", error)\n }\n finally {\n logger.log(`Reopening WebSocket in ${this.constructor.reopenDelay}ms`)\n setTimeout(this.open, this.constructor.reopenDelay)\n }\n } else {\n return this.open()\n }\n }\n\n getProtocol() {\n if (this.webSocket) {\n return this.webSocket.protocol\n }\n }\n\n isOpen() {\n return this.isState(\"open\")\n }\n\n isActive() {\n return this.isState(\"open\", \"connecting\")\n }\n\n triedToReconnect() {\n return this.monitor.reconnectAttempts > 0\n }\n\n // Private\n\n isProtocolSupported() {\n return indexOf.call(supportedProtocols, this.getProtocol()) >= 0\n }\n\n isState(...states) {\n return indexOf.call(states, this.getState()) >= 0\n }\n\n getState() {\n if (this.webSocket) {\n for (let state in adapters.WebSocket) {\n if (adapters.WebSocket[state] === this.webSocket.readyState) {\n return state.toLowerCase()\n }\n }\n }\n return null\n }\n\n installEventHandlers() {\n for (let eventName in this.events) {\n const handler = this.events[eventName].bind(this)\n this.webSocket[`on${eventName}`] = handler\n }\n }\n\n uninstallEventHandlers() {\n for (let eventName in this.events) {\n this.webSocket[`on${eventName}`] = function() {}\n }\n }\n\n}\n\nConnection.reopenDelay = 500\n\nConnection.prototype.events = {\n message(event) {\n if (!this.isProtocolSupported()) { return }\n const {identifier, message, reason, reconnect, type} = JSON.parse(event.data)\n this.monitor.recordMessage()\n switch (type) {\n case message_types.welcome:\n if (this.triedToReconnect()) {\n this.reconnectAttempted = true\n }\n this.monitor.recordConnect()\n return this.subscriptions.reload()\n case message_types.disconnect:\n logger.log(`Disconnecting. Reason: ${reason}`)\n return this.close({allowReconnect: reconnect})\n case message_types.ping:\n return null\n case message_types.confirmation:\n this.subscriptions.confirmSubscription(identifier)\n if (this.reconnectAttempted) {\n this.reconnectAttempted = false\n return this.subscriptions.notify(identifier, \"connected\", {reconnected: true})\n } else {\n return this.subscriptions.notify(identifier, \"connected\", {reconnected: false})\n }\n case message_types.rejection:\n return this.subscriptions.reject(identifier)\n default:\n return this.subscriptions.notify(identifier, \"received\", message)\n }\n },\n\n open() {\n logger.log(`WebSocket onopen event, using '${this.getProtocol()}' subprotocol`)\n this.disconnected = false\n if (!this.isProtocolSupported()) {\n logger.log(\"Protocol is unsupported. Stopping monitor and disconnecting.\")\n return this.close({allowReconnect: false})\n }\n },\n\n close(event) {\n logger.log(\"WebSocket onclose event\")\n if (this.disconnected) { return }\n this.disconnected = true\n this.monitor.recordDisconnect()\n return this.subscriptions.notifyAll(\"disconnected\", {willAttemptReconnect: this.monitor.isRunning()})\n },\n\n error() {\n logger.log(\"WebSocket onerror event\")\n }\n}\n\nexport default Connection\n", "// A new subscription is created through the ActionCable.Subscriptions instance available on the consumer.\n// It provides a number of callbacks and a method for calling remote procedure calls on the corresponding\n// Channel instance on the server side.\n//\n// An example demonstrates the basic functionality:\n//\n// App.appearance = App.cable.subscriptions.create(\"AppearanceChannel\", {\n// connected() {\n// // Called once the subscription has been successfully completed\n// },\n//\n// disconnected({ willAttemptReconnect: boolean }) {\n// // Called when the client has disconnected with the server.\n// // The object will have an `willAttemptReconnect` property which\n// // says whether the client has the intention of attempting\n// // to reconnect.\n// },\n//\n// appear() {\n// this.perform('appear', {appearing_on: this.appearingOn()})\n// },\n//\n// away() {\n// this.perform('away')\n// },\n//\n// appearingOn() {\n// $('main').data('appearing-on')\n// }\n// })\n//\n// The methods #appear and #away forward their intent to the remote AppearanceChannel instance on the server\n// by calling the `perform` method with the first parameter being the action (which maps to AppearanceChannel#appear/away).\n// The second parameter is a hash that'll get JSON encoded and made available on the server in the data parameter.\n//\n// This is how the server component would look:\n//\n// class AppearanceChannel < ApplicationActionCable::Channel\n// def subscribed\n// current_user.appear\n// end\n//\n// def unsubscribed\n// current_user.disappear\n// end\n//\n// def appear(data)\n// current_user.appear on: data['appearing_on']\n// end\n//\n// def away\n// current_user.away\n// end\n// end\n//\n// The \"AppearanceChannel\" name is automatically mapped between the client-side subscription creation and the server-side Ruby class name.\n// The AppearanceChannel#appear/away public methods are exposed automatically to client-side invocation through the perform method.\n\nconst extend = function(object, properties) {\n if (properties != null) {\n for (let key in properties) {\n const value = properties[key]\n object[key] = value\n }\n }\n return object\n}\n\nexport default class Subscription {\n constructor(consumer, params = {}, mixin) {\n this.consumer = consumer\n this.identifier = JSON.stringify(params)\n extend(this, mixin)\n }\n\n // Perform a channel action with the optional data passed as an attribute\n perform(action, data = {}) {\n data.action = action\n return this.send(data)\n }\n\n send(data) {\n return this.consumer.send({command: \"message\", identifier: this.identifier, data: JSON.stringify(data)})\n }\n\n unsubscribe() {\n return this.consumer.subscriptions.remove(this)\n }\n}\n", "import logger from \"./logger\"\n\n// Responsible for ensuring channel subscribe command is confirmed, retrying until confirmation is received.\n// Internal class, not intended for direct user manipulation.\n\nclass SubscriptionGuarantor {\n constructor(subscriptions) {\n this.subscriptions = subscriptions\n this.pendingSubscriptions = []\n }\n\n guarantee(subscription) {\n if(this.pendingSubscriptions.indexOf(subscription) == -1){ \n logger.log(`SubscriptionGuarantor guaranteeing ${subscription.identifier}`)\n this.pendingSubscriptions.push(subscription) \n }\n else {\n logger.log(`SubscriptionGuarantor already guaranteeing ${subscription.identifier}`)\n }\n this.startGuaranteeing()\n }\n\n forget(subscription) {\n logger.log(`SubscriptionGuarantor forgetting ${subscription.identifier}`)\n this.pendingSubscriptions = (this.pendingSubscriptions.filter((s) => s !== subscription))\n }\n\n startGuaranteeing() {\n this.stopGuaranteeing()\n this.retrySubscribing()\n }\n \n stopGuaranteeing() {\n clearTimeout(this.retryTimeout)\n }\n\n retrySubscribing() {\n this.retryTimeout = setTimeout(() => {\n if (this.subscriptions && typeof(this.subscriptions.subscribe) === \"function\") {\n this.pendingSubscriptions.map((subscription) => {\n logger.log(`SubscriptionGuarantor resubscribing ${subscription.identifier}`)\n this.subscriptions.subscribe(subscription)\n })\n }\n }\n , 500)\n }\n}\n\nexport default SubscriptionGuarantor", "import Subscription from \"./subscription\"\nimport SubscriptionGuarantor from \"./subscription_guarantor\"\nimport logger from \"./logger\"\n\n// Collection class for creating (and internally managing) channel subscriptions.\n// The only method intended to be triggered by the user is ActionCable.Subscriptions#create,\n// and it should be called through the consumer like so:\n//\n// App = {}\n// App.cable = ActionCable.createConsumer(\"ws://example.com/accounts/1\")\n// App.appearance = App.cable.subscriptions.create(\"AppearanceChannel\")\n//\n// For more details on how you'd configure an actual channel subscription, see ActionCable.Subscription.\n\nexport default class Subscriptions {\n constructor(consumer) {\n this.consumer = consumer\n this.guarantor = new SubscriptionGuarantor(this)\n this.subscriptions = []\n }\n\n create(channelName, mixin) {\n const channel = channelName\n const params = typeof channel === \"object\" ? channel : {channel}\n const subscription = new Subscription(this.consumer, params, mixin)\n return this.add(subscription)\n }\n\n // Private\n\n add(subscription) {\n this.subscriptions.push(subscription)\n this.consumer.ensureActiveConnection()\n this.notify(subscription, \"initialized\")\n this.subscribe(subscription)\n return subscription\n }\n\n remove(subscription) {\n this.forget(subscription)\n if (!this.findAll(subscription.identifier).length) {\n this.sendCommand(subscription, \"unsubscribe\")\n }\n return subscription\n }\n\n reject(identifier) {\n return this.findAll(identifier).map((subscription) => {\n this.forget(subscription)\n this.notify(subscription, \"rejected\")\n return subscription\n })\n }\n\n forget(subscription) {\n this.guarantor.forget(subscription)\n this.subscriptions = (this.subscriptions.filter((s) => s !== subscription))\n return subscription\n }\n\n findAll(identifier) {\n return this.subscriptions.filter((s) => s.identifier === identifier)\n }\n\n reload() {\n return this.subscriptions.map((subscription) =>\n this.subscribe(subscription))\n }\n\n notifyAll(callbackName, ...args) {\n return this.subscriptions.map((subscription) =>\n this.notify(subscription, callbackName, ...args))\n }\n\n notify(subscription, callbackName, ...args) {\n let subscriptions\n if (typeof subscription === \"string\") {\n subscriptions = this.findAll(subscription)\n } else {\n subscriptions = [subscription]\n }\n\n return subscriptions.map((subscription) =>\n (typeof subscription[callbackName] === \"function\" ? subscription[callbackName](...args) : undefined))\n }\n\n subscribe(subscription) {\n if (this.sendCommand(subscription, \"subscribe\")) {\n this.guarantor.guarantee(subscription)\n }\n }\n\n confirmSubscription(identifier) {\n logger.log(`Subscription confirmed ${identifier}`)\n this.findAll(identifier).map((subscription) =>\n this.guarantor.forget(subscription))\n }\n\n sendCommand(subscription, command) {\n const {identifier} = subscription\n return this.consumer.send({command, identifier})\n }\n}\n", "import Connection from \"./connection\"\nimport Subscriptions from \"./subscriptions\"\n\n// The ActionCable.Consumer establishes the connection to a server-side Ruby Connection object. Once established,\n// the ActionCable.ConnectionMonitor will ensure that its properly maintained through heartbeats and checking for stale updates.\n// The Consumer instance is also the gateway to establishing subscriptions to desired channels through the #createSubscription\n// method.\n//\n// The following example shows how this can be set up:\n//\n// App = {}\n// App.cable = ActionCable.createConsumer(\"ws://example.com/accounts/1\")\n// App.appearance = App.cable.subscriptions.create(\"AppearanceChannel\")\n//\n// For more details on how you'd configure an actual channel subscription, see ActionCable.Subscription.\n//\n// When a consumer is created, it automatically connects with the server.\n//\n// To disconnect from the server, call\n//\n// App.cable.disconnect()\n//\n// and to restart the connection:\n//\n// App.cable.connect()\n//\n// Any channel subscriptions which existed prior to disconnecting will\n// automatically resubscribe.\n\nexport default class Consumer {\n constructor(url) {\n this._url = url\n this.subscriptions = new Subscriptions(this)\n this.connection = new Connection(this)\n this.subprotocols = []\n }\n\n get url() {\n return createWebSocketURL(this._url)\n }\n\n send(data) {\n return this.connection.send(data)\n }\n\n connect() {\n return this.connection.open()\n }\n\n disconnect() {\n return this.connection.close({allowReconnect: false})\n }\n\n ensureActiveConnection() {\n if (!this.connection.isActive()) {\n return this.connection.open()\n }\n }\n\n addSubProtocol(subprotocol) {\n this.subprotocols = [...this.subprotocols, subprotocol]\n }\n}\n\nexport function createWebSocketURL(url) {\n if (typeof url === \"function\") {\n url = url()\n }\n\n if (url && !/^wss?:/i.test(url)) {\n const a = document.createElement(\"a\")\n a.href = url\n // Fix populating Location properties in IE. Otherwise, protocol will be blank.\n a.href = a.href\n a.protocol = a.protocol.replace(\"http\", \"ws\")\n return a.href\n } else {\n return url\n }\n}\n", "import Connection from \"./connection\"\nimport ConnectionMonitor from \"./connection_monitor\"\nimport Consumer, { createWebSocketURL } from \"./consumer\"\nimport INTERNAL from \"./internal\"\nimport Subscription from \"./subscription\"\nimport Subscriptions from \"./subscriptions\"\nimport SubscriptionGuarantor from \"./subscription_guarantor\"\nimport adapters from \"./adapters\"\nimport logger from \"./logger\"\n\nexport {\n Connection,\n ConnectionMonitor,\n Consumer,\n INTERNAL,\n Subscription,\n Subscriptions,\n SubscriptionGuarantor,\n adapters,\n createWebSocketURL,\n logger,\n}\n\nexport function createConsumer(url = getConfig(\"url\") || INTERNAL.default_mount_path) {\n return new Consumer(url)\n}\n\nexport function getConfig(name) {\n const element = document.head.querySelector(`meta[name='action-cable-${name}']`)\n if (element) {\n return element.getAttribute(\"content\")\n }\n}\n", "/* jshint node: true */\n\n/**\n * Unobtrusive scripting adapter for jQuery\n * https://github.com/rails/jquery-ujs\n *\n * Requires jQuery 1.8.0 or later.\n *\n * Released under the MIT license\n *\n */\n\n(function() {\n 'use strict';\n\n var jqueryUjsInit = function($, undefined) {\n\n // Cut down on the number of issues from people inadvertently including jquery_ujs twice\n // by detecting and raising an error when it happens.\n if ( $.rails !== undefined ) {\n $.error('jquery-ujs has already been loaded!');\n }\n\n // Shorthand to make it a little easier to call public rails functions from within rails.js\n var rails;\n var $document = $(document);\n\n $.rails = rails = {\n // Link elements bound by jquery-ujs\n linkClickSelector: 'a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]',\n\n // Button elements bound by jquery-ujs\n buttonClickSelector: 'button[data-remote]:not([form]):not(form button), button[data-confirm]:not([form]):not(form button)',\n\n // Select elements bound by jquery-ujs\n inputChangeSelector: 'select[data-remote], input[data-remote], textarea[data-remote]',\n\n // Form elements bound by jquery-ujs\n formSubmitSelector: 'form:not([data-turbo=true])',\n\n // Form input elements bound by jquery-ujs\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\n // Form input elements disabled during form submission\n disableSelector: '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\n // Form input elements re-enabled after form submission\n enableSelector: '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\n // Form required input elements\n requiredInputSelector: 'input[name][required]:not([disabled]), textarea[name][required]:not([disabled])',\n\n // Form file input elements\n fileInputSelector: 'input[name][type=file]:not([disabled])',\n\n // Link onClick disable selector with possible reenable after remote submission\n linkDisableSelector: 'a[data-disable-with], a[data-disable]',\n\n // Button onClick disable selector with possible reenable after remote submission\n buttonDisableSelector: 'button[data-remote][data-disable-with], button[data-remote][data-disable]',\n\n // Up-to-date Cross-Site Request Forgery token\n csrfToken: function() {\n return $('meta[name=csrf-token]').attr('content');\n },\n\n // URL param that must contain the CSRF token\n csrfParam: function() {\n return $('meta[name=csrf-param]').attr('content');\n },\n\n // Make sure that every Ajax request sends the CSRF token\n CSRFProtection: function(xhr) {\n var token = rails.csrfToken();\n if (token) xhr.setRequestHeader('X-CSRF-Token', token);\n },\n\n // Make sure that all forms have actual up-to-date tokens (cached forms contain old ones)\n refreshCSRFTokens: function(){\n $('form input[name=\"' + rails.csrfParam() + '\"]').val(rails.csrfToken());\n },\n\n // Triggers an event on an element and returns false if the event result is false\n fire: function(obj, name, data) {\n var event = $.Event(name);\n obj.trigger(event, data);\n return event.result !== false;\n },\n\n // Default confirm dialog, may be overridden with custom confirm dialog in $.rails.confirm\n confirm: function(message) {\n return confirm(message);\n },\n\n // Default ajax function, may be overridden with custom function in $.rails.ajax\n ajax: function(options) {\n return $.ajax(options);\n },\n\n // Default way to get an element's href. May be overridden at $.rails.href.\n href: function(element) {\n return element[0].href;\n },\n\n // Checks \"data-remote\" if true to handle the request through a XHR request.\n isRemote: function(element) {\n return element.data('remote') !== undefined && element.data('remote') !== false;\n },\n\n // Submits \"remote\" forms and links with ajax\n handleRemote: function(element) {\n var method, url, data, withCredentials, dataType, options;\n\n if (rails.fire(element, 'ajax:before')) {\n withCredentials = element.data('with-credentials') || null;\n dataType = element.data('type') || ($.ajaxSettings && $.ajaxSettings.dataType);\n\n if (element.is('form')) {\n method = element.data('ujs:submit-button-formmethod') || element.attr('method');\n url = element.data('ujs:submit-button-formaction') || element.attr('action');\n data = $(element[0]).serializeArray();\n // memoized value from clicked submit button\n var button = element.data('ujs:submit-button');\n if (button) {\n data.push(button);\n element.data('ujs:submit-button', null);\n }\n element.data('ujs:submit-button-formmethod', null);\n element.data('ujs:submit-button-formaction', null);\n } else if (element.is(rails.inputChangeSelector)) {\n method = element.data('method');\n url = element.data('url');\n data = element.serialize();\n if (element.data('params')) data = data + '&' + element.data('params');\n } else if (element.is(rails.buttonClickSelector)) {\n method = element.data('method') || 'get';\n url = element.data('url');\n data = element.serialize();\n if (element.data('params')) data = data + '&' + element.data('params');\n } else {\n method = element.data('method');\n url = rails.href(element);\n data = element.data('params') || null;\n }\n\n options = {\n type: method || 'GET', data: data, dataType: dataType,\n // stopping the \"ajax:beforeSend\" event will cancel the ajax request\n beforeSend: function(xhr, settings) {\n if (settings.dataType === undefined) {\n xhr.setRequestHeader('accept', '*/*;q=0.5, ' + settings.accepts.script);\n }\n if (rails.fire(element, 'ajax:beforeSend', [xhr, settings])) {\n element.trigger('ajax:send', xhr);\n } else {\n return false;\n }\n },\n success: function(data, status, xhr) {\n element.trigger('ajax:success', [data, status, xhr]);\n },\n complete: function(xhr, status) {\n element.trigger('ajax:complete', [xhr, status]);\n },\n error: function(xhr, status, error) {\n element.trigger('ajax:error', [xhr, status, error]);\n },\n crossDomain: rails.isCrossDomain(url)\n };\n\n // There is no withCredentials for IE6-8 when\n // \"Enable native XMLHTTP support\" is disabled\n if (withCredentials) {\n options.xhrFields = {\n withCredentials: withCredentials\n };\n }\n\n // Only pass url to `ajax` options if not blank\n if (url) { options.url = url; }\n\n return rails.ajax(options);\n } else {\n return false;\n }\n },\n\n // Determines if the request is a cross domain request.\n isCrossDomain: function(url) {\n var originAnchor = document.createElement('a');\n originAnchor.href = location.href;\n var urlAnchor = document.createElement('a');\n\n try {\n urlAnchor.href = url;\n // This is a workaround to a IE bug.\n urlAnchor.href = urlAnchor.href;\n\n // If URL protocol is false or is a string containing a single colon\n // *and* host are false, assume it is not a cross-domain request\n // (should only be the case for IE7 and IE compatibility mode).\n // Otherwise, evaluate protocol and host of the URL against the origin\n // protocol and host.\n return !(((!urlAnchor.protocol || urlAnchor.protocol === ':') && !urlAnchor.host) ||\n (originAnchor.protocol + '//' + originAnchor.host ===\n urlAnchor.protocol + '//' + urlAnchor.host));\n } catch (e) {\n // If there is an error parsing the URL, assume it is crossDomain.\n return true;\n }\n },\n\n // Handles \"data-method\" on links such as:\n // Delete\n handleMethod: function(link) {\n var href = rails.href(link),\n method = link.data('method'),\n target = link.attr('target'),\n csrfToken = rails.csrfToken(),\n csrfParam = rails.csrfParam(),\n form = $('
'),\n metadataInput = '';\n\n if (csrfParam !== undefined && csrfToken !== undefined && !rails.isCrossDomain(href)) {\n metadataInput += '';\n }\n\n if (target) { form.attr('target', target); }\n\n form.hide().append(metadataInput).appendTo('body');\n form.submit();\n },\n\n // Helper function that returns form elements that match the specified CSS selector\n // If form is actually a \"form\" element this will return associated elements outside the from that have\n // the html form attribute set\n formElements: function(form, selector) {\n return form.is('form') ? $(form[0].elements).filter(selector) : form.find(selector);\n },\n\n /* Disables form elements:\n - Caches element value in 'ujs:enable-with' data store\n - Replaces element text with value of 'data-disable-with' attribute\n - Sets disabled property to true\n */\n disableFormElements: function(form) {\n rails.formElements(form, rails.disableSelector).each(function() {\n rails.disableFormElement($(this));\n });\n },\n\n disableFormElement: function(element) {\n var method, replacement;\n\n method = element.is('button') ? 'html' : 'val';\n replacement = element.data('disable-with');\n\n if (replacement !== undefined) {\n element.data('ujs:enable-with', element[method]());\n element[method](replacement);\n }\n\n element.prop('disabled', true);\n element.data('ujs:disabled', true);\n },\n\n /* Re-enables disabled form elements:\n - Replaces element text with cached value from 'ujs:enable-with' data store (created in `disableFormElements`)\n - Sets disabled property to false\n */\n enableFormElements: function(form) {\n rails.formElements(form, rails.enableSelector).each(function() {\n rails.enableFormElement($(this));\n });\n },\n\n enableFormElement: function(element) {\n var method = element.is('button') ? 'html' : 'val';\n if (element.data('ujs:enable-with') !== undefined) {\n element[method](element.data('ujs:enable-with'));\n element.removeData('ujs:enable-with'); // clean up cache\n }\n element.prop('disabled', false);\n element.removeData('ujs:disabled');\n },\n\n /* For 'data-confirm' attribute:\n - Fires `confirm` event\n - Shows the confirmation dialog\n - Fires the `confirm:complete` event\n\n Returns `true` if no function stops the chain and user chose yes; `false` otherwise.\n Attaching a handler to the element's `confirm` event that returns a `falsy` value cancels the confirmation dialog.\n Attaching a handler to the element's `confirm:complete` event that returns a `falsy` value makes this function\n return false. The `confirm:complete` event is fired whether or not the user answered true or false to the dialog.\n */\n allowAction: function(element) {\n var message = element.data('confirm'),\n answer = false, callback;\n if (!message) { return true; }\n\n if (rails.fire(element, 'confirm')) {\n try {\n answer = rails.confirm(message);\n } catch (e) {\n (console.error || console.log).call(console, e.stack || e);\n }\n callback = rails.fire(element, 'confirm:complete', [answer]);\n }\n return answer && callback;\n },\n\n // Helper function which checks for blank inputs in a form that match the specified CSS selector\n blankInputs: function(form, specifiedSelector, nonBlank) {\n var foundInputs = $(),\n input,\n valueToCheck,\n radiosForNameWithNoneSelected,\n radioName,\n selector = specifiedSelector || 'input,textarea',\n requiredInputs = form.find(selector),\n checkedRadioButtonNames = {};\n\n requiredInputs.each(function() {\n input = $(this);\n if (input.is('input[type=radio]')) {\n\n // Don't count unchecked required radio as blank if other radio with same name is checked,\n // regardless of whether same-name radio input has required attribute or not. The spec\n // states https://www.w3.org/TR/html5/forms.html#the-required-attribute\n radioName = input.attr('name');\n\n // Skip if we've already seen the radio with this name.\n if (!checkedRadioButtonNames[radioName]) {\n\n // If none checked\n if (form.find('input[type=radio]:checked[name=\"' + radioName + '\"]').length === 0) {\n radiosForNameWithNoneSelected = form.find(\n 'input[type=radio][name=\"' + radioName + '\"]');\n foundInputs = foundInputs.add(radiosForNameWithNoneSelected);\n }\n\n // We only need to check each name once.\n checkedRadioButtonNames[radioName] = radioName;\n }\n } else {\n valueToCheck = input.is('input[type=checkbox],input[type=radio]') ? input.is(':checked') : !!input.val();\n if (valueToCheck === nonBlank) {\n foundInputs = foundInputs.add(input);\n }\n }\n });\n return foundInputs.length ? foundInputs : false;\n },\n\n // Helper function which checks for non-blank inputs in a form that match the specified CSS selector\n nonBlankInputs: function(form, specifiedSelector) {\n return rails.blankInputs(form, specifiedSelector, true); // true specifies nonBlank\n },\n\n // Helper function, needed to provide consistent behavior in IE\n stopEverything: function(e) {\n $(e.target).trigger('ujs:everythingStopped');\n e.stopImmediatePropagation();\n return false;\n },\n\n // Replace element's html with the 'data-disable-with' after storing original html\n // and prevent clicking on it\n disableElement: function(element) {\n var replacement = element.data('disable-with');\n\n if (replacement !== undefined) {\n element.data('ujs:enable-with', element.html()); // store enabled state\n element.html(replacement);\n }\n\n element.on('click.railsDisable', function(e) { // prevent further clicking\n return rails.stopEverything(e);\n });\n element.data('ujs:disabled', true);\n },\n\n // Restore element to its original state which was disabled by 'disableElement' above\n enableElement: function(element) {\n if (element.data('ujs:enable-with') !== undefined) {\n element.html(element.data('ujs:enable-with')); // set to old enabled state\n element.removeData('ujs:enable-with'); // clean up cache\n }\n element.off('click.railsDisable'); // enable element\n element.removeData('ujs:disabled');\n }\n };\n\n if (rails.fire($document, 'rails:attachBindings')) {\n\n $.ajaxPrefilter(function(options, originalOptions, xhr){ if ( !options.crossDomain ) { rails.CSRFProtection(xhr); }});\n\n // This event works the same as the load event, except that it fires every\n // time the page is loaded.\n //\n // See https://github.com/rails/jquery-ujs/issues/357\n // See https://developer.mozilla.org/en-US/docs/Using_Firefox_1.5_caching\n $(window).on('pageshow.rails', function () {\n $($.rails.enableSelector).each(function () {\n var element = $(this);\n\n if (element.data('ujs:disabled')) {\n $.rails.enableFormElement(element);\n }\n });\n\n $($.rails.linkDisableSelector).each(function () {\n var element = $(this);\n\n if (element.data('ujs:disabled')) {\n $.rails.enableElement(element);\n }\n });\n });\n\n $document.on('ajax:complete', rails.linkDisableSelector, function() {\n rails.enableElement($(this));\n });\n\n $document.on('ajax:complete', rails.buttonDisableSelector, function() {\n rails.enableFormElement($(this));\n });\n\n $document.on('click.rails', rails.linkClickSelector, function(e) {\n var link = $(this), method = link.data('method'), data = link.data('params'), metaClick = e.metaKey || e.ctrlKey;\n if (!rails.allowAction(link)) return rails.stopEverything(e);\n\n if (!metaClick && link.is(rails.linkDisableSelector)) rails.disableElement(link);\n\n if (rails.isRemote(link)) {\n if (metaClick && (!method || method === 'GET') && !data) { return true; }\n\n var handleRemote = rails.handleRemote(link);\n // Response from rails.handleRemote() will either be false or a deferred object promise.\n if (handleRemote === false) {\n rails.enableElement(link);\n } else {\n handleRemote.fail( function() { rails.enableElement(link); } );\n }\n return false;\n\n } else if (method) {\n rails.handleMethod(link);\n return false;\n }\n });\n\n $document.on('click.rails', rails.buttonClickSelector, function(e) {\n var button = $(this);\n\n if (!rails.allowAction(button) || !rails.isRemote(button)) return rails.stopEverything(e);\n\n if (button.is(rails.buttonDisableSelector)) rails.disableFormElement(button);\n\n var handleRemote = rails.handleRemote(button);\n // Response from rails.handleRemote() will either be false or a deferred object promise.\n if (handleRemote === false) {\n rails.enableFormElement(button);\n } else {\n handleRemote.fail( function() { rails.enableFormElement(button); } );\n }\n return false;\n });\n\n $document.on('change.rails', rails.inputChangeSelector, function(e) {\n var link = $(this);\n if (!rails.allowAction(link) || !rails.isRemote(link)) return rails.stopEverything(e);\n\n rails.handleRemote(link);\n return false;\n });\n\n $document.on('submit.rails', rails.formSubmitSelector, function(e) {\n var form = $(this),\n remote = rails.isRemote(form),\n blankRequiredInputs,\n nonBlankFileInputs;\n\n if (!rails.allowAction(form)) return rails.stopEverything(e);\n\n // Skip other logic when required values are missing or file upload is present\n if (form.attr('novalidate') === undefined) {\n if (form.data('ujs:formnovalidate-button') === undefined) {\n blankRequiredInputs = rails.blankInputs(form, rails.requiredInputSelector, false);\n if (blankRequiredInputs && rails.fire(form, 'ajax:aborted:required', [blankRequiredInputs])) {\n return rails.stopEverything(e);\n }\n } else {\n // Clear the formnovalidate in case the next button click is not on a formnovalidate button\n // Not strictly necessary to do here, since it is also reset on each button click, but just to be certain\n form.data('ujs:formnovalidate-button', undefined);\n }\n }\n\n if (remote) {\n nonBlankFileInputs = rails.nonBlankInputs(form, rails.fileInputSelector);\n if (nonBlankFileInputs) {\n // Slight timeout so that the submit button gets properly serialized\n // (make it easy for event handler to serialize form without disabled values)\n setTimeout(function(){ rails.disableFormElements(form); }, 13);\n var aborted = rails.fire(form, 'ajax:aborted:file', [nonBlankFileInputs]);\n\n // Re-enable form elements if event bindings return false (canceling normal form submission)\n if (!aborted) { setTimeout(function(){ rails.enableFormElements(form); }, 13); }\n\n return aborted;\n }\n\n rails.handleRemote(form);\n return false;\n\n } else {\n // Slight timeout so that the submit button gets properly serialized\n setTimeout(function(){ rails.disableFormElements(form); }, 13);\n }\n });\n\n $document.on('click.rails', rails.formInputClickSelector, function(event) {\n var button = $(this);\n\n if (!rails.allowAction(button)) return rails.stopEverything(event);\n\n // Register the pressed submit button\n var name = button.attr('name'),\n data = name ? {name:name, value:button.val()} : null;\n\n var form = button.closest('form');\n if (form.length === 0) {\n form = $('#' + button.attr('form'));\n }\n form.data('ujs:submit-button', data);\n\n // Save attributes from button\n form.data('ujs:formnovalidate-button', button.attr('formnovalidate'));\n form.data('ujs:submit-button-formaction', button.attr('formaction'));\n form.data('ujs:submit-button-formmethod', button.attr('formmethod'));\n });\n\n $document.on('ajax:send.rails', rails.formSubmitSelector, function(event) {\n if (this === event.target) rails.disableFormElements($(this));\n });\n\n $document.on('ajax:complete.rails', rails.formSubmitSelector, function(event) {\n if (this === event.target) rails.enableFormElements($(this));\n });\n\n $(function(){\n rails.refreshCSRFTokens();\n });\n }\n\n };\n\n if (window.jQuery) {\n jqueryUjsInit(jQuery);\n } else if (typeof exports === 'object' && typeof module === 'object') {\n module.exports = jqueryUjsInit;\n }\n})();\n", "/*!\n * jQuery JavaScript Library v3.6.0\n * https://jquery.com/\n *\n * Includes Sizzle.js\n * https://sizzlejs.com/\n *\n * Copyright OpenJS Foundation and other contributors\n * Released under the MIT license\n * https://jquery.org/license\n *\n * Date: 2021-03-02T17:08Z\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 #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