{ "version": 3, "sources": ["../../../../../shared/node_modules/@rails/actioncable/src/adapters.js", "../../../../../shared/node_modules/@rails/actioncable/src/logger.js", "../../../../../shared/node_modules/@rails/actioncable/src/connection_monitor.js", "../../../../../shared/node_modules/@rails/actioncable/src/internal.js", "../../../../../shared/node_modules/@rails/actioncable/src/connection.js", "../../../../../shared/node_modules/@rails/actioncable/src/subscription.js", "../../../../../shared/node_modules/@rails/actioncable/src/subscription_guarantor.js", "../../../../../shared/node_modules/@rails/actioncable/src/subscriptions.js", "../../../../../shared/node_modules/@rails/actioncable/src/consumer.js", "../../../../../shared/node_modules/@rails/actioncable/src/index.js", "../../../../../shared/node_modules/@hotwired/turbo/dist/turbo.es2017-esm.js", "../../../../../shared/node_modules/@hotwired/turbo-rails/app/javascript/turbo/cable.js", "../../../../../shared/node_modules/@hotwired/turbo-rails/app/javascript/turbo/snakeize.js", "../../../../../shared/node_modules/@hotwired/turbo-rails/app/javascript/turbo/cable_stream_source_element.js", "../../../../../shared/node_modules/@hotwired/turbo-rails/app/javascript/turbo/fetch_requests.js", "../../../../../shared/node_modules/@hotwired/turbo-rails/app/javascript/turbo/index.js", "../../../../../shared/node_modules/@hotwired/stimulus/dist/stimulus.js", "../../../../../shared/node_modules/tailwindcss-stimulus-components/dist/tailwindcss-stimulus-components.module.js", "../../javascript/controllers/application.js", "../../javascript/controllers/cloudflare_turnstile_controller.js", "../../javascript/controllers/hello_controller.js", "../../javascript/controllers/index.js", "../../../../../shared/node_modules/trix/src/trix/config/attachments.js", "../../../../../shared/node_modules/trix/src/trix/config/block_attributes.js", "../../../../../shared/node_modules/trix/src/trix/config/browser.js", "../../../../../shared/node_modules/trix/src/trix/config/lang.js", "../../../../../shared/node_modules/trix/src/trix/config/file_size_formatting.js", "../../../../../shared/node_modules/trix/src/trix/constants.js", "../../../../../shared/node_modules/trix/src/trix/core/helpers/extend.js", "../../../../../shared/node_modules/trix/src/trix/core/helpers/dom.js", "../../../../../shared/node_modules/trix/src/trix/config/input.js", "../../../../../shared/node_modules/trix/src/trix/config/key_names.js", "../../../../../shared/node_modules/trix/src/trix/config/parser.js", "../../../../../shared/node_modules/trix/src/trix/config/text_attributes.js", "../../../../../shared/node_modules/trix/src/trix/config/toolbar.js", "../../../../../shared/node_modules/trix/src/trix/config/undo.js", "../../../../../shared/node_modules/trix/src/trix/config/css.js", "../../../../../shared/node_modules/trix/src/trix/core/basic_object.js", "../../../../../shared/node_modules/trix/src/trix/core/utilities/utf16_string.js", "../../../../../shared/node_modules/trix/src/trix/core/object.js", "../../../../../shared/node_modules/trix/src/trix/core/helpers/arrays.js", "../../../../../shared/node_modules/trix/src/trix/core/helpers/bidi.js", "../../../../../shared/node_modules/trix/src/trix/core/helpers/config.js", "../../../../../shared/node_modules/trix/src/trix/core/helpers/custom_elements.js", "../../../../../shared/node_modules/trix/src/trix/core/helpers/events.js", "../../../../../shared/node_modules/trix/src/trix/core/helpers/functions.js", "../../../../../shared/node_modules/trix/src/trix/core/helpers/objects.js", "../../../../../shared/node_modules/trix/src/trix/core/helpers/ranges.js", "../../../../../shared/node_modules/trix/src/trix/observers/selection_change_observer.js", "../../../../../shared/node_modules/trix/src/trix/core/helpers/strings.js", "../../../../../shared/node_modules/trix/src/trix/core/collections/hash.js", "../../../../../shared/node_modules/trix/src/trix/core/collections/object_group.js", "../../../../../shared/node_modules/trix/src/trix/core/collections/object_map.js", "../../../../../shared/node_modules/trix/src/trix/core/collections/element_store.js", "../../../../../shared/node_modules/trix/src/trix/core/utilities/operation.js", "../../../../../shared/node_modules/trix/src/trix/views/object_view.js", "../../../../../shared/node_modules/trix/src/trix/models/html_sanitizer.js", "../../../../../shared/node_modules/trix/src/trix/views/attachment_view.js", "../../../../../shared/node_modules/trix/src/trix/views/previewable_attachment_view.js", "../../../../../shared/node_modules/trix/src/trix/views/piece_view.js", "../../../../../shared/node_modules/trix/src/trix/views/text_view.js", "../../../../../shared/node_modules/trix/src/trix/views/block_view.js", "../../../../../shared/node_modules/trix/src/trix/views/document_view.js", "../../../../../shared/node_modules/trix/src/trix/models/piece.js", "../../../../../shared/node_modules/trix/src/trix/operations/image_preload_operation.js", "../../../../../shared/node_modules/trix/src/trix/models/attachment.js", "../../../../../shared/node_modules/trix/src/trix/models/attachment_piece.js", "../../../../../shared/node_modules/trix/src/trix/models/string_piece.js", "../../../../../shared/node_modules/trix/src/trix/models/splittable_list.js", "../../../../../shared/node_modules/trix/src/trix/models/text.js", "../../../../../shared/node_modules/trix/src/trix/models/block.js", "../../../../../shared/node_modules/trix/src/trix/models/document.js", "../../../../../shared/node_modules/trix/src/trix/models/html_parser.js", "../../../../../shared/node_modules/trix/src/trix/core/serialization.js", "../../../../../shared/node_modules/trix/src/trix/models/managed_attachment.js", "../../../../../shared/node_modules/trix/src/trix/models/attachment_manager.js", "../../../../../shared/node_modules/trix/src/trix/models/line_break_insertion.js", "../../../../../shared/node_modules/trix/src/trix/models/composition.js", "../../../../../shared/node_modules/trix/src/trix/models/undo_manager.js", "../../../../../shared/node_modules/trix/src/trix/filters/filter.js", "../../../../../shared/node_modules/trix/src/trix/filters/attachment_gallery_filter.js", "../../../../../shared/node_modules/trix/src/trix/models/editor.js", "../../../../../shared/node_modules/trix/src/trix/models/location_mapper.js", "../../../../../shared/node_modules/trix/src/trix/models/point_mapper.js", "../../../../../shared/node_modules/trix/src/trix/models/selection_manager.js", "../../../../../shared/node_modules/trix/src/trix/controllers/attachment_editor_controller.js", "../../../../../shared/node_modules/trix/src/trix/controllers/composition_controller.js", "../../../../../shared/node_modules/trix/src/trix/controllers/controller.js", "../../../../../shared/node_modules/trix/src/trix/observers/mutation_observer.js", "../../../../../shared/node_modules/trix/src/trix/operations/file_verification_operation.js", "../../../../../shared/node_modules/trix/src/trix/models/flaky_android_keyboard_detector.js", "../../../../../shared/node_modules/trix/src/trix/controllers/input_controller.js", "../../../../../shared/node_modules/trix/src/trix/controllers/level_0_input_controller.js", "../../../../../shared/node_modules/trix/src/trix/controllers/level_2_input_controller.js", "../../../../../shared/node_modules/trix/src/trix/controllers/toolbar_controller.js", "../../../../../shared/node_modules/trix/src/trix/controllers/editor_controller.js", "../../../../../shared/node_modules/trix/src/trix/elements/trix_toolbar_element.js", "../../../../../shared/node_modules/trix/src/trix/elements/trix_editor_element.js", "../../../../../shared/node_modules/trix/src/trix/trix.js", "../../../../../shared/node_modules/@rails/actiontext/app/assets/javascripts/actiontext.esm.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", "/*!\nTurbo 8.0.12\nCopyright \u00A9 2024 37signals LLC\n */\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2019 Javan Makhmali\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n(function (prototype) {\n if (typeof prototype.requestSubmit == \"function\") return\n\n prototype.requestSubmit = function (submitter) {\n if (submitter) {\n validateSubmitter(submitter, this);\n submitter.click();\n } else {\n submitter = document.createElement(\"input\");\n submitter.type = \"submit\";\n submitter.hidden = true;\n this.appendChild(submitter);\n submitter.click();\n this.removeChild(submitter);\n }\n };\n\n function validateSubmitter(submitter, form) {\n submitter instanceof HTMLElement || raise(TypeError, \"parameter 1 is not of type 'HTMLElement'\");\n submitter.type == \"submit\" || raise(TypeError, \"The specified element is not a submit button\");\n submitter.form == form ||\n raise(DOMException, \"The specified element is not owned by this form element\", \"NotFoundError\");\n }\n\n function raise(errorConstructor, message, name) {\n throw new errorConstructor(\"Failed to execute 'requestSubmit' on 'HTMLFormElement': \" + message + \".\", name)\n }\n})(HTMLFormElement.prototype);\n\nconst submittersByForm = new WeakMap();\n\nfunction findSubmitterFromClickTarget(target) {\n const element = target instanceof Element ? target : target instanceof Node ? target.parentElement : null;\n const candidate = element ? element.closest(\"input, button\") : null;\n return candidate?.type == \"submit\" ? candidate : null\n}\n\nfunction clickCaptured(event) {\n const submitter = findSubmitterFromClickTarget(event.target);\n\n if (submitter && submitter.form) {\n submittersByForm.set(submitter.form, submitter);\n }\n}\n\n(function () {\n if (\"submitter\" in Event.prototype) return\n\n let prototype = window.Event.prototype;\n // Certain versions of Safari 15 have a bug where they won't\n // populate the submitter. This hurts TurboDrive's enable/disable detection.\n // See https://bugs.webkit.org/show_bug.cgi?id=229660\n if (\"SubmitEvent\" in window) {\n const prototypeOfSubmitEvent = window.SubmitEvent.prototype;\n\n if (/Apple Computer/.test(navigator.vendor) && !(\"submitter\" in prototypeOfSubmitEvent)) {\n prototype = prototypeOfSubmitEvent;\n } else {\n return // polyfill not needed\n }\n }\n\n addEventListener(\"click\", clickCaptured, true);\n\n Object.defineProperty(prototype, \"submitter\", {\n get() {\n if (this.type == \"submit\" && this.target instanceof HTMLFormElement) {\n return submittersByForm.get(this.target)\n }\n }\n });\n})();\n\nconst FrameLoadingStyle = {\n eager: \"eager\",\n lazy: \"lazy\"\n};\n\n/**\n * Contains a fragment of HTML which is updated based on navigation within\n * it (e.g. via links or form submissions).\n *\n * @customElement turbo-frame\n * @example\n * <turbo-frame id=\"messages\">\n * <a href=\"/messages/expanded\">\n * Show all expanded messages in this frame.\n * </a>\n *\n * <form action=\"/messages\">\n * Show response from this form within this frame.\n * </form>\n * </turbo-frame>\n */\nclass FrameElement extends HTMLElement {\n static delegateConstructor = undefined\n\n loaded = Promise.resolve()\n\n static get observedAttributes() {\n return [\"disabled\", \"loading\", \"src\"]\n }\n\n constructor() {\n super();\n this.delegate = new FrameElement.delegateConstructor(this);\n }\n\n connectedCallback() {\n this.delegate.connect();\n }\n\n disconnectedCallback() {\n this.delegate.disconnect();\n }\n\n reload() {\n return this.delegate.sourceURLReloaded()\n }\n\n attributeChangedCallback(name) {\n if (name == \"loading\") {\n this.delegate.loadingStyleChanged();\n } else if (name == \"src\") {\n this.delegate.sourceURLChanged();\n } else if (name == \"disabled\") {\n this.delegate.disabledChanged();\n }\n }\n\n /**\n * Gets the URL to lazily load source HTML from\n */\n get src() {\n return this.getAttribute(\"src\")\n }\n\n /**\n * Sets the URL to lazily load source HTML from\n */\n set src(value) {\n if (value) {\n this.setAttribute(\"src\", value);\n } else {\n this.removeAttribute(\"src\");\n }\n }\n\n /**\n * Gets the refresh mode for the frame.\n */\n get refresh() {\n return this.getAttribute(\"refresh\")\n }\n\n /**\n * Sets the refresh mode for the frame.\n */\n set refresh(value) {\n if (value) {\n this.setAttribute(\"refresh\", value);\n } else {\n this.removeAttribute(\"refresh\");\n }\n }\n\n get shouldReloadWithMorph() {\n return this.src && this.refresh === \"morph\"\n }\n\n /**\n * Determines if the element is loading\n */\n get loading() {\n return frameLoadingStyleFromString(this.getAttribute(\"loading\") || \"\")\n }\n\n /**\n * Sets the value of if the element is loading\n */\n set loading(value) {\n if (value) {\n this.setAttribute(\"loading\", value);\n } else {\n this.removeAttribute(\"loading\");\n }\n }\n\n /**\n * Gets the disabled state of the frame.\n *\n * If disabled, no requests will be intercepted by the frame.\n */\n get disabled() {\n return this.hasAttribute(\"disabled\")\n }\n\n /**\n * Sets the disabled state of the frame.\n *\n * If disabled, no requests will be intercepted by the frame.\n */\n set disabled(value) {\n if (value) {\n this.setAttribute(\"disabled\", \"\");\n } else {\n this.removeAttribute(\"disabled\");\n }\n }\n\n /**\n * Gets the autoscroll state of the frame.\n *\n * If true, the frame will be scrolled into view automatically on update.\n */\n get autoscroll() {\n return this.hasAttribute(\"autoscroll\")\n }\n\n /**\n * Sets the autoscroll state of the frame.\n *\n * If true, the frame will be scrolled into view automatically on update.\n */\n set autoscroll(value) {\n if (value) {\n this.setAttribute(\"autoscroll\", \"\");\n } else {\n this.removeAttribute(\"autoscroll\");\n }\n }\n\n /**\n * Determines if the element has finished loading\n */\n get complete() {\n return !this.delegate.isLoading\n }\n\n /**\n * Gets the active state of the frame.\n *\n * If inactive, source changes will not be observed.\n */\n get isActive() {\n return this.ownerDocument === document && !this.isPreview\n }\n\n /**\n * Sets the active state of the frame.\n *\n * If inactive, source changes will not be observed.\n */\n get isPreview() {\n return this.ownerDocument?.documentElement?.hasAttribute(\"data-turbo-preview\")\n }\n}\n\nfunction frameLoadingStyleFromString(style) {\n switch (style.toLowerCase()) {\n case \"lazy\":\n return FrameLoadingStyle.lazy\n default:\n return FrameLoadingStyle.eager\n }\n}\n\nconst drive = {\n enabled: true,\n progressBarDelay: 500,\n unvisitableExtensions: new Set(\n [\n \".7z\", \".aac\", \".apk\", \".avi\", \".bmp\", \".bz2\", \".css\", \".csv\", \".deb\", \".dmg\", \".doc\",\n \".docx\", \".exe\", \".gif\", \".gz\", \".heic\", \".heif\", \".ico\", \".iso\", \".jpeg\", \".jpg\",\n \".js\", \".json\", \".m4a\", \".mkv\", \".mov\", \".mp3\", \".mp4\", \".mpeg\", \".mpg\", \".msi\",\n \".ogg\", \".ogv\", \".pdf\", \".pkg\", \".png\", \".ppt\", \".pptx\", \".rar\", \".rtf\",\n \".svg\", \".tar\", \".tif\", \".tiff\", \".txt\", \".wav\", \".webm\", \".webp\", \".wma\", \".wmv\",\n \".xls\", \".xlsx\", \".xml\", \".zip\"\n ]\n )\n};\n\nfunction activateScriptElement(element) {\n if (element.getAttribute(\"data-turbo-eval\") == \"false\") {\n return element\n } else {\n const createdScriptElement = document.createElement(\"script\");\n const cspNonce = getCspNonce();\n if (cspNonce) {\n createdScriptElement.nonce = cspNonce;\n }\n createdScriptElement.textContent = element.textContent;\n createdScriptElement.async = false;\n copyElementAttributes(createdScriptElement, element);\n return createdScriptElement\n }\n}\n\nfunction copyElementAttributes(destinationElement, sourceElement) {\n for (const { name, value } of sourceElement.attributes) {\n destinationElement.setAttribute(name, value);\n }\n}\n\nfunction createDocumentFragment(html) {\n const template = document.createElement(\"template\");\n template.innerHTML = html;\n return template.content\n}\n\nfunction dispatch(eventName, { target, cancelable, detail } = {}) {\n const event = new CustomEvent(eventName, {\n cancelable,\n bubbles: true,\n composed: true,\n detail\n });\n\n if (target && target.isConnected) {\n target.dispatchEvent(event);\n } else {\n document.documentElement.dispatchEvent(event);\n }\n\n return event\n}\n\nfunction cancelEvent(event) {\n event.preventDefault();\n event.stopImmediatePropagation();\n}\n\nfunction nextRepaint() {\n if (document.visibilityState === \"hidden\") {\n return nextEventLoopTick()\n } else {\n return nextAnimationFrame()\n }\n}\n\nfunction nextAnimationFrame() {\n return new Promise((resolve) => requestAnimationFrame(() => resolve()))\n}\n\nfunction nextEventLoopTick() {\n return new Promise((resolve) => setTimeout(() => resolve(), 0))\n}\n\nfunction nextMicrotask() {\n return Promise.resolve()\n}\n\nfunction parseHTMLDocument(html = \"\") {\n return new DOMParser().parseFromString(html, \"text/html\")\n}\n\nfunction unindent(strings, ...values) {\n const lines = interpolate(strings, values).replace(/^\\n/, \"\").split(\"\\n\");\n const match = lines[0].match(/^\\s+/);\n const indent = match ? match[0].length : 0;\n return lines.map((line) => line.slice(indent)).join(\"\\n\")\n}\n\nfunction interpolate(strings, values) {\n return strings.reduce((result, string, i) => {\n const value = values[i] == undefined ? \"\" : values[i];\n return result + string + value\n }, \"\")\n}\n\nfunction uuid() {\n return Array.from({ length: 36 })\n .map((_, i) => {\n if (i == 8 || i == 13 || i == 18 || i == 23) {\n return \"-\"\n } else if (i == 14) {\n return \"4\"\n } else if (i == 19) {\n return (Math.floor(Math.random() * 4) + 8).toString(16)\n } else {\n return Math.floor(Math.random() * 15).toString(16)\n }\n })\n .join(\"\")\n}\n\nfunction getAttribute(attributeName, ...elements) {\n for (const value of elements.map((element) => element?.getAttribute(attributeName))) {\n if (typeof value == \"string\") return value\n }\n\n return null\n}\n\nfunction hasAttribute(attributeName, ...elements) {\n return elements.some((element) => element && element.hasAttribute(attributeName))\n}\n\nfunction markAsBusy(...elements) {\n for (const element of elements) {\n if (element.localName == \"turbo-frame\") {\n element.setAttribute(\"busy\", \"\");\n }\n element.setAttribute(\"aria-busy\", \"true\");\n }\n}\n\nfunction clearBusyState(...elements) {\n for (const element of elements) {\n if (element.localName == \"turbo-frame\") {\n element.removeAttribute(\"busy\");\n }\n\n element.removeAttribute(\"aria-busy\");\n }\n}\n\nfunction waitForLoad(element, timeoutInMilliseconds = 2000) {\n return new Promise((resolve) => {\n const onComplete = () => {\n element.removeEventListener(\"error\", onComplete);\n element.removeEventListener(\"load\", onComplete);\n resolve();\n };\n\n element.addEventListener(\"load\", onComplete, { once: true });\n element.addEventListener(\"error\", onComplete, { once: true });\n setTimeout(resolve, timeoutInMilliseconds);\n })\n}\n\nfunction getHistoryMethodForAction(action) {\n switch (action) {\n case \"replace\":\n return history.replaceState\n case \"advance\":\n case \"restore\":\n return history.pushState\n }\n}\n\nfunction isAction(action) {\n return action == \"advance\" || action == \"replace\" || action == \"restore\"\n}\n\nfunction getVisitAction(...elements) {\n const action = getAttribute(\"data-turbo-action\", ...elements);\n\n return isAction(action) ? action : null\n}\n\nfunction getMetaElement(name) {\n return document.querySelector(`meta[name=\"${name}\"]`)\n}\n\nfunction getMetaContent(name) {\n const element = getMetaElement(name);\n return element && element.content\n}\n\nfunction getCspNonce() {\n const element = getMetaElement(\"csp-nonce\");\n\n if (element) {\n const { nonce, content } = element;\n return nonce == \"\" ? content : nonce\n }\n}\n\nfunction setMetaContent(name, content) {\n let element = getMetaElement(name);\n\n if (!element) {\n element = document.createElement(\"meta\");\n element.setAttribute(\"name\", name);\n\n document.head.appendChild(element);\n }\n\n element.setAttribute(\"content\", content);\n\n return element\n}\n\nfunction findClosestRecursively(element, selector) {\n if (element instanceof Element) {\n return (\n element.closest(selector) || findClosestRecursively(element.assignedSlot || element.getRootNode()?.host, selector)\n )\n }\n}\n\nfunction elementIsFocusable(element) {\n const inertDisabledOrHidden = \"[inert], :disabled, [hidden], details:not([open]), dialog:not([open])\";\n\n return !!element && element.closest(inertDisabledOrHidden) == null && typeof element.focus == \"function\"\n}\n\nfunction queryAutofocusableElement(elementOrDocumentFragment) {\n return Array.from(elementOrDocumentFragment.querySelectorAll(\"[autofocus]\")).find(elementIsFocusable)\n}\n\nasync function around(callback, reader) {\n const before = reader();\n\n callback();\n\n await nextAnimationFrame();\n\n const after = reader();\n\n return [before, after]\n}\n\nfunction doesNotTargetIFrame(name) {\n if (name === \"_blank\") {\n return false\n } else if (name) {\n for (const element of document.getElementsByName(name)) {\n if (element instanceof HTMLIFrameElement) return false\n }\n\n return true\n } else {\n return true\n }\n}\n\nfunction findLinkFromClickTarget(target) {\n return findClosestRecursively(target, \"a[href]:not([target^=_]):not([download])\")\n}\n\nfunction getLocationForLink(link) {\n return expandURL(link.getAttribute(\"href\") || \"\")\n}\n\nfunction debounce(fn, delay) {\n let timeoutId = null;\n\n return (...args) => {\n const callback = () => fn.apply(this, args);\n clearTimeout(timeoutId);\n timeoutId = setTimeout(callback, delay);\n }\n}\n\nconst submitter = {\n \"aria-disabled\": {\n beforeSubmit: submitter => {\n submitter.setAttribute(\"aria-disabled\", \"true\");\n submitter.addEventListener(\"click\", cancelEvent);\n },\n\n afterSubmit: submitter => {\n submitter.removeAttribute(\"aria-disabled\");\n submitter.removeEventListener(\"click\", cancelEvent);\n }\n },\n\n \"disabled\": {\n beforeSubmit: submitter => submitter.disabled = true,\n afterSubmit: submitter => submitter.disabled = false\n }\n};\n\nclass Config {\n #submitter = null\n\n constructor(config) {\n Object.assign(this, config);\n }\n\n get submitter() {\n return this.#submitter\n }\n\n set submitter(value) {\n this.#submitter = submitter[value] || value;\n }\n}\n\nconst forms = new Config({\n mode: \"on\",\n submitter: \"disabled\"\n});\n\nconst config = {\n drive,\n forms\n};\n\nfunction expandURL(locatable) {\n return new URL(locatable.toString(), document.baseURI)\n}\n\nfunction getAnchor(url) {\n let anchorMatch;\n if (url.hash) {\n return url.hash.slice(1)\n // eslint-disable-next-line no-cond-assign\n } else if ((anchorMatch = url.href.match(/#(.*)$/))) {\n return anchorMatch[1]\n }\n}\n\nfunction getAction$1(form, submitter) {\n const action = submitter?.getAttribute(\"formaction\") || form.getAttribute(\"action\") || form.action;\n\n return expandURL(action)\n}\n\nfunction getExtension(url) {\n return (getLastPathComponent(url).match(/\\.[^.]*$/) || [])[0] || \"\"\n}\n\nfunction isPrefixedBy(baseURL, url) {\n const prefix = getPrefix(url);\n return baseURL.href === expandURL(prefix).href || baseURL.href.startsWith(prefix)\n}\n\nfunction locationIsVisitable(location, rootLocation) {\n return isPrefixedBy(location, rootLocation) && !config.drive.unvisitableExtensions.has(getExtension(location))\n}\n\nfunction getRequestURL(url) {\n const anchor = getAnchor(url);\n return anchor != null ? url.href.slice(0, -(anchor.length + 1)) : url.href\n}\n\nfunction toCacheKey(url) {\n return getRequestURL(url)\n}\n\nfunction urlsAreEqual(left, right) {\n return expandURL(left).href == expandURL(right).href\n}\n\nfunction getPathComponents(url) {\n return url.pathname.split(\"/\").slice(1)\n}\n\nfunction getLastPathComponent(url) {\n return getPathComponents(url).slice(-1)[0]\n}\n\nfunction getPrefix(url) {\n return addTrailingSlash(url.origin + url.pathname)\n}\n\nfunction addTrailingSlash(value) {\n return value.endsWith(\"/\") ? value : value + \"/\"\n}\n\nclass FetchResponse {\n constructor(response) {\n this.response = response;\n }\n\n get succeeded() {\n return this.response.ok\n }\n\n get failed() {\n return !this.succeeded\n }\n\n get clientError() {\n return this.statusCode >= 400 && this.statusCode <= 499\n }\n\n get serverError() {\n return this.statusCode >= 500 && this.statusCode <= 599\n }\n\n get redirected() {\n return this.response.redirected\n }\n\n get location() {\n return expandURL(this.response.url)\n }\n\n get isHTML() {\n return this.contentType && this.contentType.match(/^(?:text\\/([^\\s;,]+\\b)?html|application\\/xhtml\\+xml)\\b/)\n }\n\n get statusCode() {\n return this.response.status\n }\n\n get contentType() {\n return this.header(\"Content-Type\")\n }\n\n get responseText() {\n return this.response.clone().text()\n }\n\n get responseHTML() {\n if (this.isHTML) {\n return this.response.clone().text()\n } else {\n return Promise.resolve(undefined)\n }\n }\n\n header(name) {\n return this.response.headers.get(name)\n }\n}\n\nclass LimitedSet extends Set {\n constructor(maxSize) {\n super();\n this.maxSize = maxSize;\n }\n\n add(value) {\n if (this.size >= this.maxSize) {\n const iterator = this.values();\n const oldestValue = iterator.next().value;\n this.delete(oldestValue);\n }\n super.add(value);\n }\n}\n\nconst recentRequests = new LimitedSet(20);\n\nconst nativeFetch = window.fetch;\n\nfunction fetchWithTurboHeaders(url, options = {}) {\n const modifiedHeaders = new Headers(options.headers || {});\n const requestUID = uuid();\n recentRequests.add(requestUID);\n modifiedHeaders.append(\"X-Turbo-Request-Id\", requestUID);\n\n return nativeFetch(url, {\n ...options,\n headers: modifiedHeaders\n })\n}\n\nfunction fetchMethodFromString(method) {\n switch (method.toLowerCase()) {\n case \"get\":\n return FetchMethod.get\n case \"post\":\n return FetchMethod.post\n case \"put\":\n return FetchMethod.put\n case \"patch\":\n return FetchMethod.patch\n case \"delete\":\n return FetchMethod.delete\n }\n}\n\nconst FetchMethod = {\n get: \"get\",\n post: \"post\",\n put: \"put\",\n patch: \"patch\",\n delete: \"delete\"\n};\n\nfunction fetchEnctypeFromString(encoding) {\n switch (encoding.toLowerCase()) {\n case FetchEnctype.multipart:\n return FetchEnctype.multipart\n case FetchEnctype.plain:\n return FetchEnctype.plain\n default:\n return FetchEnctype.urlEncoded\n }\n}\n\nconst FetchEnctype = {\n urlEncoded: \"application/x-www-form-urlencoded\",\n multipart: \"multipart/form-data\",\n plain: \"text/plain\"\n};\n\nclass FetchRequest {\n abortController = new AbortController()\n #resolveRequestPromise = (_value) => {}\n\n constructor(delegate, method, location, requestBody = new URLSearchParams(), target = null, enctype = FetchEnctype.urlEncoded) {\n const [url, body] = buildResourceAndBody(expandURL(location), method, requestBody, enctype);\n\n this.delegate = delegate;\n this.url = url;\n this.target = target;\n this.fetchOptions = {\n credentials: \"same-origin\",\n redirect: \"follow\",\n method: method.toUpperCase(),\n headers: { ...this.defaultHeaders },\n body: body,\n signal: this.abortSignal,\n referrer: this.delegate.referrer?.href\n };\n this.enctype = enctype;\n }\n\n get method() {\n return this.fetchOptions.method\n }\n\n set method(value) {\n const fetchBody = this.isSafe ? this.url.searchParams : this.fetchOptions.body || new FormData();\n const fetchMethod = fetchMethodFromString(value) || FetchMethod.get;\n\n this.url.search = \"\";\n\n const [url, body] = buildResourceAndBody(this.url, fetchMethod, fetchBody, this.enctype);\n\n this.url = url;\n this.fetchOptions.body = body;\n this.fetchOptions.method = fetchMethod.toUpperCase();\n }\n\n get headers() {\n return this.fetchOptions.headers\n }\n\n set headers(value) {\n this.fetchOptions.headers = value;\n }\n\n get body() {\n if (this.isSafe) {\n return this.url.searchParams\n } else {\n return this.fetchOptions.body\n }\n }\n\n set body(value) {\n this.fetchOptions.body = value;\n }\n\n get location() {\n return this.url\n }\n\n get params() {\n return this.url.searchParams\n }\n\n get entries() {\n return this.body ? Array.from(this.body.entries()) : []\n }\n\n cancel() {\n this.abortController.abort();\n }\n\n async perform() {\n const { fetchOptions } = this;\n this.delegate.prepareRequest(this);\n const event = await this.#allowRequestToBeIntercepted(fetchOptions);\n try {\n this.delegate.requestStarted(this);\n\n if (event.detail.fetchRequest) {\n this.response = event.detail.fetchRequest.response;\n } else {\n this.response = fetchWithTurboHeaders(this.url.href, fetchOptions);\n }\n\n const response = await this.response;\n return await this.receive(response)\n } catch (error) {\n if (error.name !== \"AbortError\") {\n if (this.#willDelegateErrorHandling(error)) {\n this.delegate.requestErrored(this, error);\n }\n throw error\n }\n } finally {\n this.delegate.requestFinished(this);\n }\n }\n\n async receive(response) {\n const fetchResponse = new FetchResponse(response);\n const event = dispatch(\"turbo:before-fetch-response\", {\n cancelable: true,\n detail: { fetchResponse },\n target: this.target\n });\n if (event.defaultPrevented) {\n this.delegate.requestPreventedHandlingResponse(this, fetchResponse);\n } else if (fetchResponse.succeeded) {\n this.delegate.requestSucceededWithResponse(this, fetchResponse);\n } else {\n this.delegate.requestFailedWithResponse(this, fetchResponse);\n }\n return fetchResponse\n }\n\n get defaultHeaders() {\n return {\n Accept: \"text/html, application/xhtml+xml\"\n }\n }\n\n get isSafe() {\n return isSafe(this.method)\n }\n\n get abortSignal() {\n return this.abortController.signal\n }\n\n acceptResponseType(mimeType) {\n this.headers[\"Accept\"] = [mimeType, this.headers[\"Accept\"]].join(\", \");\n }\n\n async #allowRequestToBeIntercepted(fetchOptions) {\n const requestInterception = new Promise((resolve) => (this.#resolveRequestPromise = resolve));\n const event = dispatch(\"turbo:before-fetch-request\", {\n cancelable: true,\n detail: {\n fetchOptions,\n url: this.url,\n resume: this.#resolveRequestPromise\n },\n target: this.target\n });\n this.url = event.detail.url;\n if (event.defaultPrevented) await requestInterception;\n\n return event\n }\n\n #willDelegateErrorHandling(error) {\n const event = dispatch(\"turbo:fetch-request-error\", {\n target: this.target,\n cancelable: true,\n detail: { request: this, error: error }\n });\n\n return !event.defaultPrevented\n }\n}\n\nfunction isSafe(fetchMethod) {\n return fetchMethodFromString(fetchMethod) == FetchMethod.get\n}\n\nfunction buildResourceAndBody(resource, method, requestBody, enctype) {\n const searchParams =\n Array.from(requestBody).length > 0 ? new URLSearchParams(entriesExcludingFiles(requestBody)) : resource.searchParams;\n\n if (isSafe(method)) {\n return [mergeIntoURLSearchParams(resource, searchParams), null]\n } else if (enctype == FetchEnctype.urlEncoded) {\n return [resource, searchParams]\n } else {\n return [resource, requestBody]\n }\n}\n\nfunction entriesExcludingFiles(requestBody) {\n const entries = [];\n\n for (const [name, value] of requestBody) {\n if (value instanceof File) continue\n else entries.push([name, value]);\n }\n\n return entries\n}\n\nfunction mergeIntoURLSearchParams(url, requestBody) {\n const searchParams = new URLSearchParams(entriesExcludingFiles(requestBody));\n\n url.search = searchParams.toString();\n\n return url\n}\n\nclass AppearanceObserver {\n started = false\n\n constructor(delegate, element) {\n this.delegate = delegate;\n this.element = element;\n this.intersectionObserver = new IntersectionObserver(this.intersect);\n }\n\n start() {\n if (!this.started) {\n this.started = true;\n this.intersectionObserver.observe(this.element);\n }\n }\n\n stop() {\n if (this.started) {\n this.started = false;\n this.intersectionObserver.unobserve(this.element);\n }\n }\n\n intersect = (entries) => {\n const lastEntry = entries.slice(-1)[0];\n if (lastEntry?.isIntersecting) {\n this.delegate.elementAppearedInViewport(this.element);\n }\n }\n}\n\nclass StreamMessage {\n static contentType = \"text/vnd.turbo-stream.html\"\n\n static wrap(message) {\n if (typeof message == \"string\") {\n return new this(createDocumentFragment(message))\n } else {\n return message\n }\n }\n\n constructor(fragment) {\n this.fragment = importStreamElements(fragment);\n }\n}\n\nfunction importStreamElements(fragment) {\n for (const element of fragment.querySelectorAll(\"turbo-stream\")) {\n const streamElement = document.importNode(element, true);\n\n for (const inertScriptElement of streamElement.templateElement.content.querySelectorAll(\"script\")) {\n inertScriptElement.replaceWith(activateScriptElement(inertScriptElement));\n }\n\n element.replaceWith(streamElement);\n }\n\n return fragment\n}\n\nconst PREFETCH_DELAY = 100;\n\nclass PrefetchCache {\n #prefetchTimeout = null\n #prefetched = null\n\n get(url) {\n if (this.#prefetched && this.#prefetched.url === url && this.#prefetched.expire > Date.now()) {\n return this.#prefetched.request\n }\n }\n\n setLater(url, request, ttl) {\n this.clear();\n\n this.#prefetchTimeout = setTimeout(() => {\n request.perform();\n this.set(url, request, ttl);\n this.#prefetchTimeout = null;\n }, PREFETCH_DELAY);\n }\n\n set(url, request, ttl) {\n this.#prefetched = { url, request, expire: new Date(new Date().getTime() + ttl) };\n }\n\n clear() {\n if (this.#prefetchTimeout) clearTimeout(this.#prefetchTimeout);\n this.#prefetched = null;\n }\n}\n\nconst cacheTtl = 10 * 1000;\nconst prefetchCache = new PrefetchCache();\n\nconst FormSubmissionState = {\n initialized: \"initialized\",\n requesting: \"requesting\",\n waiting: \"waiting\",\n receiving: \"receiving\",\n stopping: \"stopping\",\n stopped: \"stopped\"\n};\n\nclass FormSubmission {\n state = FormSubmissionState.initialized\n\n static confirmMethod(message) {\n return Promise.resolve(confirm(message))\n }\n\n constructor(delegate, formElement, submitter, mustRedirect = false) {\n const method = getMethod(formElement, submitter);\n const action = getAction(getFormAction(formElement, submitter), method);\n const body = buildFormData(formElement, submitter);\n const enctype = getEnctype(formElement, submitter);\n\n this.delegate = delegate;\n this.formElement = formElement;\n this.submitter = submitter;\n this.fetchRequest = new FetchRequest(this, method, action, body, formElement, enctype);\n this.mustRedirect = mustRedirect;\n }\n\n get method() {\n return this.fetchRequest.method\n }\n\n set method(value) {\n this.fetchRequest.method = value;\n }\n\n get action() {\n return this.fetchRequest.url.toString()\n }\n\n set action(value) {\n this.fetchRequest.url = expandURL(value);\n }\n\n get body() {\n return this.fetchRequest.body\n }\n\n get enctype() {\n return this.fetchRequest.enctype\n }\n\n get isSafe() {\n return this.fetchRequest.isSafe\n }\n\n get location() {\n return this.fetchRequest.url\n }\n\n // The submission process\n\n async start() {\n const { initialized, requesting } = FormSubmissionState;\n const confirmationMessage = getAttribute(\"data-turbo-confirm\", this.submitter, this.formElement);\n\n if (typeof confirmationMessage === \"string\") {\n const confirmMethod = typeof config.forms.confirm === \"function\" ?\n config.forms.confirm :\n FormSubmission.confirmMethod;\n\n const answer = await confirmMethod(confirmationMessage, this.formElement, this.submitter);\n if (!answer) {\n return\n }\n }\n\n if (this.state == initialized) {\n this.state = requesting;\n return this.fetchRequest.perform()\n }\n }\n\n stop() {\n const { stopping, stopped } = FormSubmissionState;\n if (this.state != stopping && this.state != stopped) {\n this.state = stopping;\n this.fetchRequest.cancel();\n return true\n }\n }\n\n // Fetch request delegate\n\n prepareRequest(request) {\n if (!request.isSafe) {\n const token = getCookieValue(getMetaContent(\"csrf-param\")) || getMetaContent(\"csrf-token\");\n if (token) {\n request.headers[\"X-CSRF-Token\"] = token;\n }\n }\n\n if (this.requestAcceptsTurboStreamResponse(request)) {\n request.acceptResponseType(StreamMessage.contentType);\n }\n }\n\n requestStarted(_request) {\n this.state = FormSubmissionState.waiting;\n if (this.submitter) config.forms.submitter.beforeSubmit(this.submitter);\n this.setSubmitsWith();\n markAsBusy(this.formElement);\n dispatch(\"turbo:submit-start\", {\n target: this.formElement,\n detail: { formSubmission: this }\n });\n this.delegate.formSubmissionStarted(this);\n }\n\n requestPreventedHandlingResponse(request, response) {\n prefetchCache.clear();\n\n this.result = { success: response.succeeded, fetchResponse: response };\n }\n\n requestSucceededWithResponse(request, response) {\n if (response.clientError || response.serverError) {\n this.delegate.formSubmissionFailedWithResponse(this, response);\n return\n }\n\n prefetchCache.clear();\n\n if (this.requestMustRedirect(request) && responseSucceededWithoutRedirect(response)) {\n const error = new Error(\"Form responses must redirect to another location\");\n this.delegate.formSubmissionErrored(this, error);\n } else {\n this.state = FormSubmissionState.receiving;\n this.result = { success: true, fetchResponse: response };\n this.delegate.formSubmissionSucceededWithResponse(this, response);\n }\n }\n\n requestFailedWithResponse(request, response) {\n this.result = { success: false, fetchResponse: response };\n this.delegate.formSubmissionFailedWithResponse(this, response);\n }\n\n requestErrored(request, error) {\n this.result = { success: false, error };\n this.delegate.formSubmissionErrored(this, error);\n }\n\n requestFinished(_request) {\n this.state = FormSubmissionState.stopped;\n if (this.submitter) config.forms.submitter.afterSubmit(this.submitter);\n this.resetSubmitterText();\n clearBusyState(this.formElement);\n dispatch(\"turbo:submit-end\", {\n target: this.formElement,\n detail: { formSubmission: this, ...this.result }\n });\n this.delegate.formSubmissionFinished(this);\n }\n\n // Private\n\n setSubmitsWith() {\n if (!this.submitter || !this.submitsWith) return\n\n if (this.submitter.matches(\"button\")) {\n this.originalSubmitText = this.submitter.innerHTML;\n this.submitter.innerHTML = this.submitsWith;\n } else if (this.submitter.matches(\"input\")) {\n const input = this.submitter;\n this.originalSubmitText = input.value;\n input.value = this.submitsWith;\n }\n }\n\n resetSubmitterText() {\n if (!this.submitter || !this.originalSubmitText) return\n\n if (this.submitter.matches(\"button\")) {\n this.submitter.innerHTML = this.originalSubmitText;\n } else if (this.submitter.matches(\"input\")) {\n const input = this.submitter;\n input.value = this.originalSubmitText;\n }\n }\n\n requestMustRedirect(request) {\n return !request.isSafe && this.mustRedirect\n }\n\n requestAcceptsTurboStreamResponse(request) {\n return !request.isSafe || hasAttribute(\"data-turbo-stream\", this.submitter, this.formElement)\n }\n\n get submitsWith() {\n return this.submitter?.getAttribute(\"data-turbo-submits-with\")\n }\n}\n\nfunction buildFormData(formElement, submitter) {\n const formData = new FormData(formElement);\n const name = submitter?.getAttribute(\"name\");\n const value = submitter?.getAttribute(\"value\");\n\n if (name) {\n formData.append(name, value || \"\");\n }\n\n return formData\n}\n\nfunction getCookieValue(cookieName) {\n if (cookieName != null) {\n const cookies = document.cookie ? document.cookie.split(\"; \") : [];\n const cookie = cookies.find((cookie) => cookie.startsWith(cookieName));\n if (cookie) {\n const value = cookie.split(\"=\").slice(1).join(\"=\");\n return value ? decodeURIComponent(value) : undefined\n }\n }\n}\n\nfunction responseSucceededWithoutRedirect(response) {\n return response.statusCode == 200 && !response.redirected\n}\n\nfunction getFormAction(formElement, submitter) {\n const formElementAction = typeof formElement.action === \"string\" ? formElement.action : null;\n\n if (submitter?.hasAttribute(\"formaction\")) {\n return submitter.getAttribute(\"formaction\") || \"\"\n } else {\n return formElement.getAttribute(\"action\") || formElementAction || \"\"\n }\n}\n\nfunction getAction(formAction, fetchMethod) {\n const action = expandURL(formAction);\n\n if (isSafe(fetchMethod)) {\n action.search = \"\";\n }\n\n return action\n}\n\nfunction getMethod(formElement, submitter) {\n const method = submitter?.getAttribute(\"formmethod\") || formElement.getAttribute(\"method\") || \"\";\n return fetchMethodFromString(method.toLowerCase()) || FetchMethod.get\n}\n\nfunction getEnctype(formElement, submitter) {\n return fetchEnctypeFromString(submitter?.getAttribute(\"formenctype\") || formElement.enctype)\n}\n\nclass Snapshot {\n constructor(element) {\n this.element = element;\n }\n\n get activeElement() {\n return this.element.ownerDocument.activeElement\n }\n\n get children() {\n return [...this.element.children]\n }\n\n hasAnchor(anchor) {\n return this.getElementForAnchor(anchor) != null\n }\n\n getElementForAnchor(anchor) {\n return anchor ? this.element.querySelector(`[id='${anchor}'], a[name='${anchor}']`) : null\n }\n\n get isConnected() {\n return this.element.isConnected\n }\n\n get firstAutofocusableElement() {\n return queryAutofocusableElement(this.element)\n }\n\n get permanentElements() {\n return queryPermanentElementsAll(this.element)\n }\n\n getPermanentElementById(id) {\n return getPermanentElementById(this.element, id)\n }\n\n getPermanentElementMapForSnapshot(snapshot) {\n const permanentElementMap = {};\n\n for (const currentPermanentElement of this.permanentElements) {\n const { id } = currentPermanentElement;\n const newPermanentElement = snapshot.getPermanentElementById(id);\n if (newPermanentElement) {\n permanentElementMap[id] = [currentPermanentElement, newPermanentElement];\n }\n }\n\n return permanentElementMap\n }\n}\n\nfunction getPermanentElementById(node, id) {\n return node.querySelector(`#${id}[data-turbo-permanent]`)\n}\n\nfunction queryPermanentElementsAll(node) {\n return node.querySelectorAll(\"[id][data-turbo-permanent]\")\n}\n\nclass FormSubmitObserver {\n started = false\n\n constructor(delegate, eventTarget) {\n this.delegate = delegate;\n this.eventTarget = eventTarget;\n }\n\n start() {\n if (!this.started) {\n this.eventTarget.addEventListener(\"submit\", this.submitCaptured, true);\n this.started = true;\n }\n }\n\n stop() {\n if (this.started) {\n this.eventTarget.removeEventListener(\"submit\", this.submitCaptured, true);\n this.started = false;\n }\n }\n\n submitCaptured = () => {\n this.eventTarget.removeEventListener(\"submit\", this.submitBubbled, false);\n this.eventTarget.addEventListener(\"submit\", this.submitBubbled, false);\n }\n\n submitBubbled = (event) => {\n if (!event.defaultPrevented) {\n const form = event.target instanceof HTMLFormElement ? event.target : undefined;\n const submitter = event.submitter || undefined;\n\n if (\n form &&\n submissionDoesNotDismissDialog(form, submitter) &&\n submissionDoesNotTargetIFrame(form, submitter) &&\n this.delegate.willSubmitForm(form, submitter)\n ) {\n event.preventDefault();\n event.stopImmediatePropagation();\n this.delegate.formSubmitted(form, submitter);\n }\n }\n }\n}\n\nfunction submissionDoesNotDismissDialog(form, submitter) {\n const method = submitter?.getAttribute(\"formmethod\") || form.getAttribute(\"method\");\n\n return method != \"dialog\"\n}\n\nfunction submissionDoesNotTargetIFrame(form, submitter) {\n const target = submitter?.getAttribute(\"formtarget\") || form.getAttribute(\"target\");\n\n return doesNotTargetIFrame(target)\n}\n\nclass View {\n #resolveRenderPromise = (_value) => {}\n #resolveInterceptionPromise = (_value) => {}\n\n constructor(delegate, element) {\n this.delegate = delegate;\n this.element = element;\n }\n\n // Scrolling\n\n scrollToAnchor(anchor) {\n const element = this.snapshot.getElementForAnchor(anchor);\n if (element) {\n this.scrollToElement(element);\n this.focusElement(element);\n } else {\n this.scrollToPosition({ x: 0, y: 0 });\n }\n }\n\n scrollToAnchorFromLocation(location) {\n this.scrollToAnchor(getAnchor(location));\n }\n\n scrollToElement(element) {\n element.scrollIntoView();\n }\n\n focusElement(element) {\n if (element instanceof HTMLElement) {\n if (element.hasAttribute(\"tabindex\")) {\n element.focus();\n } else {\n element.setAttribute(\"tabindex\", \"-1\");\n element.focus();\n element.removeAttribute(\"tabindex\");\n }\n }\n }\n\n scrollToPosition({ x, y }) {\n this.scrollRoot.scrollTo(x, y);\n }\n\n scrollToTop() {\n this.scrollToPosition({ x: 0, y: 0 });\n }\n\n get scrollRoot() {\n return window\n }\n\n // Rendering\n\n async render(renderer) {\n const { isPreview, shouldRender, willRender, newSnapshot: snapshot } = renderer;\n\n // A workaround to ignore tracked element mismatch reloads when performing\n // a promoted Visit from a frame navigation\n const shouldInvalidate = willRender;\n\n if (shouldRender) {\n try {\n this.renderPromise = new Promise((resolve) => (this.#resolveRenderPromise = resolve));\n this.renderer = renderer;\n await this.prepareToRenderSnapshot(renderer);\n\n const renderInterception = new Promise((resolve) => (this.#resolveInterceptionPromise = resolve));\n const options = { resume: this.#resolveInterceptionPromise, render: this.renderer.renderElement, renderMethod: this.renderer.renderMethod };\n const immediateRender = this.delegate.allowsImmediateRender(snapshot, options);\n if (!immediateRender) await renderInterception;\n\n await this.renderSnapshot(renderer);\n this.delegate.viewRenderedSnapshot(snapshot, isPreview, this.renderer.renderMethod);\n this.delegate.preloadOnLoadLinksForView(this.element);\n this.finishRenderingSnapshot(renderer);\n } finally {\n delete this.renderer;\n this.#resolveRenderPromise(undefined);\n delete this.renderPromise;\n }\n } else if (shouldInvalidate) {\n this.invalidate(renderer.reloadReason);\n }\n }\n\n invalidate(reason) {\n this.delegate.viewInvalidated(reason);\n }\n\n async prepareToRenderSnapshot(renderer) {\n this.markAsPreview(renderer.isPreview);\n await renderer.prepareToRender();\n }\n\n markAsPreview(isPreview) {\n if (isPreview) {\n this.element.setAttribute(\"data-turbo-preview\", \"\");\n } else {\n this.element.removeAttribute(\"data-turbo-preview\");\n }\n }\n\n markVisitDirection(direction) {\n this.element.setAttribute(\"data-turbo-visit-direction\", direction);\n }\n\n unmarkVisitDirection() {\n this.element.removeAttribute(\"data-turbo-visit-direction\");\n }\n\n async renderSnapshot(renderer) {\n await renderer.render();\n }\n\n finishRenderingSnapshot(renderer) {\n renderer.finishRendering();\n }\n}\n\nclass FrameView extends View {\n missing() {\n this.element.innerHTML = `<strong class=\"turbo-frame-error\">Content missing</strong>`;\n }\n\n get snapshot() {\n return new Snapshot(this.element)\n }\n}\n\nclass LinkInterceptor {\n constructor(delegate, element) {\n this.delegate = delegate;\n this.element = element;\n }\n\n start() {\n this.element.addEventListener(\"click\", this.clickBubbled);\n document.addEventListener(\"turbo:click\", this.linkClicked);\n document.addEventListener(\"turbo:before-visit\", this.willVisit);\n }\n\n stop() {\n this.element.removeEventListener(\"click\", this.clickBubbled);\n document.removeEventListener(\"turbo:click\", this.linkClicked);\n document.removeEventListener(\"turbo:before-visit\", this.willVisit);\n }\n\n clickBubbled = (event) => {\n if (this.clickEventIsSignificant(event)) {\n this.clickEvent = event;\n } else {\n delete this.clickEvent;\n }\n }\n\n linkClicked = (event) => {\n if (this.clickEvent && this.clickEventIsSignificant(event)) {\n if (this.delegate.shouldInterceptLinkClick(event.target, event.detail.url, event.detail.originalEvent)) {\n this.clickEvent.preventDefault();\n event.preventDefault();\n this.delegate.linkClickIntercepted(event.target, event.detail.url, event.detail.originalEvent);\n }\n }\n delete this.clickEvent;\n }\n\n willVisit = (_event) => {\n delete this.clickEvent;\n }\n\n clickEventIsSignificant(event) {\n const target = event.composed ? event.target?.parentElement : event.target;\n const element = findLinkFromClickTarget(target) || target;\n\n return element instanceof Element && element.closest(\"turbo-frame, html\") == this.element\n }\n}\n\nclass LinkClickObserver {\n started = false\n\n constructor(delegate, eventTarget) {\n this.delegate = delegate;\n this.eventTarget = eventTarget;\n }\n\n start() {\n if (!this.started) {\n this.eventTarget.addEventListener(\"click\", this.clickCaptured, true);\n this.started = true;\n }\n }\n\n stop() {\n if (this.started) {\n this.eventTarget.removeEventListener(\"click\", this.clickCaptured, true);\n this.started = false;\n }\n }\n\n clickCaptured = () => {\n this.eventTarget.removeEventListener(\"click\", this.clickBubbled, false);\n this.eventTarget.addEventListener(\"click\", this.clickBubbled, false);\n }\n\n clickBubbled = (event) => {\n if (event instanceof MouseEvent && this.clickEventIsSignificant(event)) {\n const target = (event.composedPath && event.composedPath()[0]) || event.target;\n const link = findLinkFromClickTarget(target);\n if (link && doesNotTargetIFrame(link.target)) {\n const location = getLocationForLink(link);\n if (this.delegate.willFollowLinkToLocation(link, location, event)) {\n event.preventDefault();\n this.delegate.followedLinkToLocation(link, location);\n }\n }\n }\n }\n\n clickEventIsSignificant(event) {\n return !(\n (event.target && event.target.isContentEditable) ||\n event.defaultPrevented ||\n event.which > 1 ||\n event.altKey ||\n event.ctrlKey ||\n event.metaKey ||\n event.shiftKey\n )\n }\n}\n\nclass FormLinkClickObserver {\n constructor(delegate, element) {\n this.delegate = delegate;\n this.linkInterceptor = new LinkClickObserver(this, element);\n }\n\n start() {\n this.linkInterceptor.start();\n }\n\n stop() {\n this.linkInterceptor.stop();\n }\n\n // Link hover observer delegate\n\n canPrefetchRequestToLocation(link, location) {\n return false\n }\n\n prefetchAndCacheRequestToLocation(link, location) {\n return\n }\n\n // Link click observer delegate\n\n willFollowLinkToLocation(link, location, originalEvent) {\n return (\n this.delegate.willSubmitFormLinkToLocation(link, location, originalEvent) &&\n (link.hasAttribute(\"data-turbo-method\") || link.hasAttribute(\"data-turbo-stream\"))\n )\n }\n\n followedLinkToLocation(link, location) {\n const form = document.createElement(\"form\");\n\n const type = \"hidden\";\n for (const [name, value] of location.searchParams) {\n form.append(Object.assign(document.createElement(\"input\"), { type, name, value }));\n }\n\n const action = Object.assign(location, { search: \"\" });\n form.setAttribute(\"data-turbo\", \"true\");\n form.setAttribute(\"action\", action.href);\n form.setAttribute(\"hidden\", \"\");\n\n const method = link.getAttribute(\"data-turbo-method\");\n if (method) form.setAttribute(\"method\", method);\n\n const turboFrame = link.getAttribute(\"data-turbo-frame\");\n if (turboFrame) form.setAttribute(\"data-turbo-frame\", turboFrame);\n\n const turboAction = getVisitAction(link);\n if (turboAction) form.setAttribute(\"data-turbo-action\", turboAction);\n\n const turboConfirm = link.getAttribute(\"data-turbo-confirm\");\n if (turboConfirm) form.setAttribute(\"data-turbo-confirm\", turboConfirm);\n\n const turboStream = link.hasAttribute(\"data-turbo-stream\");\n if (turboStream) form.setAttribute(\"data-turbo-stream\", \"\");\n\n this.delegate.submittedFormLinkToLocation(link, location, form);\n\n document.body.appendChild(form);\n form.addEventListener(\"turbo:submit-end\", () => form.remove(), { once: true });\n requestAnimationFrame(() => form.requestSubmit());\n }\n}\n\nclass Bardo {\n static async preservingPermanentElements(delegate, permanentElementMap, callback) {\n const bardo = new this(delegate, permanentElementMap);\n bardo.enter();\n await callback();\n bardo.leave();\n }\n\n constructor(delegate, permanentElementMap) {\n this.delegate = delegate;\n this.permanentElementMap = permanentElementMap;\n }\n\n enter() {\n for (const id in this.permanentElementMap) {\n const [currentPermanentElement, newPermanentElement] = this.permanentElementMap[id];\n this.delegate.enteringBardo(currentPermanentElement, newPermanentElement);\n this.replaceNewPermanentElementWithPlaceholder(newPermanentElement);\n }\n }\n\n leave() {\n for (const id in this.permanentElementMap) {\n const [currentPermanentElement] = this.permanentElementMap[id];\n this.replaceCurrentPermanentElementWithClone(currentPermanentElement);\n this.replacePlaceholderWithPermanentElement(currentPermanentElement);\n this.delegate.leavingBardo(currentPermanentElement);\n }\n }\n\n replaceNewPermanentElementWithPlaceholder(permanentElement) {\n const placeholder = createPlaceholderForPermanentElement(permanentElement);\n permanentElement.replaceWith(placeholder);\n }\n\n replaceCurrentPermanentElementWithClone(permanentElement) {\n const clone = permanentElement.cloneNode(true);\n permanentElement.replaceWith(clone);\n }\n\n replacePlaceholderWithPermanentElement(permanentElement) {\n const placeholder = this.getPlaceholderById(permanentElement.id);\n placeholder?.replaceWith(permanentElement);\n }\n\n getPlaceholderById(id) {\n return this.placeholders.find((element) => element.content == id)\n }\n\n get placeholders() {\n return [...document.querySelectorAll(\"meta[name=turbo-permanent-placeholder][content]\")]\n }\n}\n\nfunction createPlaceholderForPermanentElement(permanentElement) {\n const element = document.createElement(\"meta\");\n element.setAttribute(\"name\", \"turbo-permanent-placeholder\");\n element.setAttribute(\"content\", permanentElement.id);\n return element\n}\n\nclass Renderer {\n #activeElement = null\n\n static renderElement(currentElement, newElement) {\n // Abstract method\n }\n\n constructor(currentSnapshot, newSnapshot, isPreview, willRender = true) {\n this.currentSnapshot = currentSnapshot;\n this.newSnapshot = newSnapshot;\n this.isPreview = isPreview;\n this.willRender = willRender;\n this.renderElement = this.constructor.renderElement;\n this.promise = new Promise((resolve, reject) => (this.resolvingFunctions = { resolve, reject }));\n }\n\n get shouldRender() {\n return true\n }\n\n get shouldAutofocus() {\n return true\n }\n\n get reloadReason() {\n return\n }\n\n prepareToRender() {\n return\n }\n\n render() {\n // Abstract method\n }\n\n finishRendering() {\n if (this.resolvingFunctions) {\n this.resolvingFunctions.resolve();\n delete this.resolvingFunctions;\n }\n }\n\n async preservingPermanentElements(callback) {\n await Bardo.preservingPermanentElements(this, this.permanentElementMap, callback);\n }\n\n focusFirstAutofocusableElement() {\n if (this.shouldAutofocus) {\n const element = this.connectedSnapshot.firstAutofocusableElement;\n if (element) {\n element.focus();\n }\n }\n }\n\n // Bardo delegate\n\n enteringBardo(currentPermanentElement) {\n if (this.#activeElement) return\n\n if (currentPermanentElement.contains(this.currentSnapshot.activeElement)) {\n this.#activeElement = this.currentSnapshot.activeElement;\n }\n }\n\n leavingBardo(currentPermanentElement) {\n if (currentPermanentElement.contains(this.#activeElement) && this.#activeElement instanceof HTMLElement) {\n this.#activeElement.focus();\n\n this.#activeElement = null;\n }\n }\n\n get connectedSnapshot() {\n return this.newSnapshot.isConnected ? this.newSnapshot : this.currentSnapshot\n }\n\n get currentElement() {\n return this.currentSnapshot.element\n }\n\n get newElement() {\n return this.newSnapshot.element\n }\n\n get permanentElementMap() {\n return this.currentSnapshot.getPermanentElementMapForSnapshot(this.newSnapshot)\n }\n\n get renderMethod() {\n return \"replace\"\n }\n}\n\nclass FrameRenderer extends Renderer {\n static renderElement(currentElement, newElement) {\n const destinationRange = document.createRange();\n destinationRange.selectNodeContents(currentElement);\n destinationRange.deleteContents();\n\n const frameElement = newElement;\n const sourceRange = frameElement.ownerDocument?.createRange();\n if (sourceRange) {\n sourceRange.selectNodeContents(frameElement);\n currentElement.appendChild(sourceRange.extractContents());\n }\n }\n\n constructor(delegate, currentSnapshot, newSnapshot, renderElement, isPreview, willRender = true) {\n super(currentSnapshot, newSnapshot, renderElement, isPreview, willRender);\n this.delegate = delegate;\n }\n\n get shouldRender() {\n return true\n }\n\n async render() {\n await nextRepaint();\n this.preservingPermanentElements(() => {\n this.loadFrameElement();\n });\n this.scrollFrameIntoView();\n await nextRepaint();\n this.focusFirstAutofocusableElement();\n await nextRepaint();\n this.activateScriptElements();\n }\n\n loadFrameElement() {\n this.delegate.willRenderFrame(this.currentElement, this.newElement);\n this.renderElement(this.currentElement, this.newElement);\n }\n\n scrollFrameIntoView() {\n if (this.currentElement.autoscroll || this.newElement.autoscroll) {\n const element = this.currentElement.firstElementChild;\n const block = readScrollLogicalPosition(this.currentElement.getAttribute(\"data-autoscroll-block\"), \"end\");\n const behavior = readScrollBehavior(this.currentElement.getAttribute(\"data-autoscroll-behavior\"), \"auto\");\n\n if (element) {\n element.scrollIntoView({ block, behavior });\n return true\n }\n }\n return false\n }\n\n activateScriptElements() {\n for (const inertScriptElement of this.newScriptElements) {\n const activatedScriptElement = activateScriptElement(inertScriptElement);\n inertScriptElement.replaceWith(activatedScriptElement);\n }\n }\n\n get newScriptElements() {\n return this.currentElement.querySelectorAll(\"script\")\n }\n}\n\nfunction readScrollLogicalPosition(value, defaultValue) {\n if (value == \"end\" || value == \"start\" || value == \"center\" || value == \"nearest\") {\n return value\n } else {\n return defaultValue\n }\n}\n\nfunction readScrollBehavior(value, defaultValue) {\n if (value == \"auto\" || value == \"smooth\") {\n return value\n } else {\n return defaultValue\n }\n}\n\n// base IIFE to define idiomorph\nvar Idiomorph = (function () {\n\n //=============================================================================\n // AND NOW IT BEGINS...\n //=============================================================================\n let EMPTY_SET = new Set();\n\n // default configuration values, updatable by users now\n let defaults = {\n morphStyle: \"outerHTML\",\n callbacks : {\n beforeNodeAdded: noOp,\n afterNodeAdded: noOp,\n beforeNodeMorphed: noOp,\n afterNodeMorphed: noOp,\n beforeNodeRemoved: noOp,\n afterNodeRemoved: noOp,\n beforeAttributeUpdated: noOp,\n\n },\n head: {\n style: 'merge',\n shouldPreserve: function (elt) {\n return elt.getAttribute(\"im-preserve\") === \"true\";\n },\n shouldReAppend: function (elt) {\n return elt.getAttribute(\"im-re-append\") === \"true\";\n },\n shouldRemove: noOp,\n afterHeadMorphed: noOp,\n }\n };\n\n //=============================================================================\n // Core Morphing Algorithm - morph, morphNormalizedContent, morphOldNodeTo, morphChildren\n //=============================================================================\n function morph(oldNode, newContent, config = {}) {\n\n if (oldNode instanceof Document) {\n oldNode = oldNode.documentElement;\n }\n\n if (typeof newContent === 'string') {\n newContent = parseContent(newContent);\n }\n\n let normalizedContent = normalizeContent(newContent);\n\n let ctx = createMorphContext(oldNode, normalizedContent, config);\n\n return morphNormalizedContent(oldNode, normalizedContent, ctx);\n }\n\n function morphNormalizedContent(oldNode, normalizedNewContent, ctx) {\n if (ctx.head.block) {\n let oldHead = oldNode.querySelector('head');\n let newHead = normalizedNewContent.querySelector('head');\n if (oldHead && newHead) {\n let promises = handleHeadElement(newHead, oldHead, ctx);\n // when head promises resolve, call morph again, ignoring the head tag\n Promise.all(promises).then(function () {\n morphNormalizedContent(oldNode, normalizedNewContent, Object.assign(ctx, {\n head: {\n block: false,\n ignore: true\n }\n }));\n });\n return;\n }\n }\n\n if (ctx.morphStyle === \"innerHTML\") {\n\n // innerHTML, so we are only updating the children\n morphChildren(normalizedNewContent, oldNode, ctx);\n return oldNode.children;\n\n } else if (ctx.morphStyle === \"outerHTML\" || ctx.morphStyle == null) {\n // otherwise find the best element match in the new content, morph that, and merge its siblings\n // into either side of the best match\n let bestMatch = findBestNodeMatch(normalizedNewContent, oldNode, ctx);\n\n // stash the siblings that will need to be inserted on either side of the best match\n let previousSibling = bestMatch?.previousSibling;\n let nextSibling = bestMatch?.nextSibling;\n\n // morph it\n let morphedNode = morphOldNodeTo(oldNode, bestMatch, ctx);\n\n if (bestMatch) {\n // if there was a best match, merge the siblings in too and return the\n // whole bunch\n return insertSiblings(previousSibling, morphedNode, nextSibling);\n } else {\n // otherwise nothing was added to the DOM\n return []\n }\n } else {\n throw \"Do not understand how to morph style \" + ctx.morphStyle;\n }\n }\n\n\n /**\n * @param possibleActiveElement\n * @param ctx\n * @returns {boolean}\n */\n function ignoreValueOfActiveElement(possibleActiveElement, ctx) {\n return ctx.ignoreActiveValue && possibleActiveElement === document.activeElement && possibleActiveElement !== document.body;\n }\n\n /**\n * @param oldNode root node to merge content into\n * @param newContent new content to merge\n * @param ctx the merge context\n * @returns {Element} the element that ended up in the DOM\n */\n function morphOldNodeTo(oldNode, newContent, ctx) {\n if (ctx.ignoreActive && oldNode === document.activeElement) ; else if (newContent == null) {\n if (ctx.callbacks.beforeNodeRemoved(oldNode) === false) return oldNode;\n\n oldNode.remove();\n ctx.callbacks.afterNodeRemoved(oldNode);\n return null;\n } else if (!isSoftMatch(oldNode, newContent)) {\n if (ctx.callbacks.beforeNodeRemoved(oldNode) === false) return oldNode;\n if (ctx.callbacks.beforeNodeAdded(newContent) === false) return oldNode;\n\n oldNode.parentElement.replaceChild(newContent, oldNode);\n ctx.callbacks.afterNodeAdded(newContent);\n ctx.callbacks.afterNodeRemoved(oldNode);\n return newContent;\n } else {\n if (ctx.callbacks.beforeNodeMorphed(oldNode, newContent) === false) return oldNode;\n\n if (oldNode instanceof HTMLHeadElement && ctx.head.ignore) ; else if (oldNode instanceof HTMLHeadElement && ctx.head.style !== \"morph\") {\n handleHeadElement(newContent, oldNode, ctx);\n } else {\n syncNodeFrom(newContent, oldNode, ctx);\n if (!ignoreValueOfActiveElement(oldNode, ctx)) {\n morphChildren(newContent, oldNode, ctx);\n }\n }\n ctx.callbacks.afterNodeMorphed(oldNode, newContent);\n return oldNode;\n }\n }\n\n /**\n * This is the core algorithm for matching up children. The idea is to use id sets to try to match up\n * nodes as faithfully as possible. We greedily match, which allows us to keep the algorithm fast, but\n * by using id sets, we are able to better match up with content deeper in the DOM.\n *\n * Basic algorithm is, for each node in the new content:\n *\n * - if we have reached the end of the old parent, append the new content\n * - if the new content has an id set match with the current insertion point, morph\n * - search for an id set match\n * - if id set match found, morph\n * - otherwise search for a \"soft\" match\n * - if a soft match is found, morph\n * - otherwise, prepend the new node before the current insertion point\n *\n * The two search algorithms terminate if competing node matches appear to outweigh what can be achieved\n * with the current node. See findIdSetMatch() and findSoftMatch() for details.\n *\n * @param {Element} newParent the parent element of the new content\n * @param {Element } oldParent the old content that we are merging the new content into\n * @param ctx the merge context\n */\n function morphChildren(newParent, oldParent, ctx) {\n\n let nextNewChild = newParent.firstChild;\n let insertionPoint = oldParent.firstChild;\n let newChild;\n\n // run through all the new content\n while (nextNewChild) {\n\n newChild = nextNewChild;\n nextNewChild = newChild.nextSibling;\n\n // if we are at the end of the exiting parent's children, just append\n if (insertionPoint == null) {\n if (ctx.callbacks.beforeNodeAdded(newChild) === false) return;\n\n oldParent.appendChild(newChild);\n ctx.callbacks.afterNodeAdded(newChild);\n removeIdsFromConsideration(ctx, newChild);\n continue;\n }\n\n // if the current node has an id set match then morph\n if (isIdSetMatch(newChild, insertionPoint, ctx)) {\n morphOldNodeTo(insertionPoint, newChild, ctx);\n insertionPoint = insertionPoint.nextSibling;\n removeIdsFromConsideration(ctx, newChild);\n continue;\n }\n\n // otherwise search forward in the existing old children for an id set match\n let idSetMatch = findIdSetMatch(newParent, oldParent, newChild, insertionPoint, ctx);\n\n // if we found a potential match, remove the nodes until that point and morph\n if (idSetMatch) {\n insertionPoint = removeNodesBetween(insertionPoint, idSetMatch, ctx);\n morphOldNodeTo(idSetMatch, newChild, ctx);\n removeIdsFromConsideration(ctx, newChild);\n continue;\n }\n\n // no id set match found, so scan forward for a soft match for the current node\n let softMatch = findSoftMatch(newParent, oldParent, newChild, insertionPoint, ctx);\n\n // if we found a soft match for the current node, morph\n if (softMatch) {\n insertionPoint = removeNodesBetween(insertionPoint, softMatch, ctx);\n morphOldNodeTo(softMatch, newChild, ctx);\n removeIdsFromConsideration(ctx, newChild);\n continue;\n }\n\n // abandon all hope of morphing, just insert the new child before the insertion point\n // and move on\n if (ctx.callbacks.beforeNodeAdded(newChild) === false) return;\n\n oldParent.insertBefore(newChild, insertionPoint);\n ctx.callbacks.afterNodeAdded(newChild);\n removeIdsFromConsideration(ctx, newChild);\n }\n\n // remove any remaining old nodes that didn't match up with new content\n while (insertionPoint !== null) {\n\n let tempNode = insertionPoint;\n insertionPoint = insertionPoint.nextSibling;\n removeNode(tempNode, ctx);\n }\n }\n\n //=============================================================================\n // Attribute Syncing Code\n //=============================================================================\n\n /**\n * @param attr {String} the attribute to be mutated\n * @param to {Element} the element that is going to be updated\n * @param updateType {(\"update\"|\"remove\")}\n * @param ctx the merge context\n * @returns {boolean} true if the attribute should be ignored, false otherwise\n */\n function ignoreAttribute(attr, to, updateType, ctx) {\n if(attr === 'value' && ctx.ignoreActiveValue && to === document.activeElement){\n return true;\n }\n return ctx.callbacks.beforeAttributeUpdated(attr, to, updateType) === false;\n }\n\n /**\n * syncs a given node with another node, copying over all attributes and\n * inner element state from the 'from' node to the 'to' node\n *\n * @param {Element} from the element to copy attributes & state from\n * @param {Element} to the element to copy attributes & state to\n * @param ctx the merge context\n */\n function syncNodeFrom(from, to, ctx) {\n let type = from.nodeType;\n\n // if is an element type, sync the attributes from the\n // new node into the new node\n if (type === 1 /* element type */) {\n const fromAttributes = from.attributes;\n const toAttributes = to.attributes;\n for (const fromAttribute of fromAttributes) {\n if (ignoreAttribute(fromAttribute.name, to, 'update', ctx)) {\n continue;\n }\n if (to.getAttribute(fromAttribute.name) !== fromAttribute.value) {\n to.setAttribute(fromAttribute.name, fromAttribute.value);\n }\n }\n // iterate backwards to avoid skipping over items when a delete occurs\n for (let i = toAttributes.length - 1; 0 <= i; i--) {\n const toAttribute = toAttributes[i];\n if (ignoreAttribute(toAttribute.name, to, 'remove', ctx)) {\n continue;\n }\n if (!from.hasAttribute(toAttribute.name)) {\n to.removeAttribute(toAttribute.name);\n }\n }\n }\n\n // sync text nodes\n if (type === 8 /* comment */ || type === 3 /* text */) {\n if (to.nodeValue !== from.nodeValue) {\n to.nodeValue = from.nodeValue;\n }\n }\n\n if (!ignoreValueOfActiveElement(to, ctx)) {\n // sync input values\n syncInputValue(from, to, ctx);\n }\n }\n\n /**\n * @param from {Element} element to sync the value from\n * @param to {Element} element to sync the value to\n * @param attributeName {String} the attribute name\n * @param ctx the merge context\n */\n function syncBooleanAttribute(from, to, attributeName, ctx) {\n if (from[attributeName] !== to[attributeName]) {\n let ignoreUpdate = ignoreAttribute(attributeName, to, 'update', ctx);\n if (!ignoreUpdate) {\n to[attributeName] = from[attributeName];\n }\n if (from[attributeName]) {\n if (!ignoreUpdate) {\n to.setAttribute(attributeName, from[attributeName]);\n }\n } else {\n if (!ignoreAttribute(attributeName, to, 'remove', ctx)) {\n to.removeAttribute(attributeName);\n }\n }\n }\n }\n\n /**\n * NB: many bothans died to bring us information:\n *\n * https://github.com/patrick-steele-idem/morphdom/blob/master/src/specialElHandlers.js\n * https://github.com/choojs/nanomorph/blob/master/lib/morph.jsL113\n *\n * @param from {Element} the element to sync the input value from\n * @param to {Element} the element to sync the input value to\n * @param ctx the merge context\n */\n function syncInputValue(from, to, ctx) {\n if (from instanceof HTMLInputElement &&\n to instanceof HTMLInputElement &&\n from.type !== 'file') {\n\n let fromValue = from.value;\n let toValue = to.value;\n\n // sync boolean attributes\n syncBooleanAttribute(from, to, 'checked', ctx);\n syncBooleanAttribute(from, to, 'disabled', ctx);\n\n if (!from.hasAttribute('value')) {\n if (!ignoreAttribute('value', to, 'remove', ctx)) {\n to.value = '';\n to.removeAttribute('value');\n }\n } else if (fromValue !== toValue) {\n if (!ignoreAttribute('value', to, 'update', ctx)) {\n to.setAttribute('value', fromValue);\n to.value = fromValue;\n }\n }\n } else if (from instanceof HTMLOptionElement) {\n syncBooleanAttribute(from, to, 'selected', ctx);\n } else if (from instanceof HTMLTextAreaElement && to instanceof HTMLTextAreaElement) {\n let fromValue = from.value;\n let toValue = to.value;\n if (ignoreAttribute('value', to, 'update', ctx)) {\n return;\n }\n if (fromValue !== toValue) {\n to.value = fromValue;\n }\n if (to.firstChild && to.firstChild.nodeValue !== fromValue) {\n to.firstChild.nodeValue = fromValue;\n }\n }\n }\n\n //=============================================================================\n // the HEAD tag can be handled specially, either w/ a 'merge' or 'append' style\n //=============================================================================\n function handleHeadElement(newHeadTag, currentHead, ctx) {\n\n let added = [];\n let removed = [];\n let preserved = [];\n let nodesToAppend = [];\n\n let headMergeStyle = ctx.head.style;\n\n // put all new head elements into a Map, by their outerHTML\n let srcToNewHeadNodes = new Map();\n for (const newHeadChild of newHeadTag.children) {\n srcToNewHeadNodes.set(newHeadChild.outerHTML, newHeadChild);\n }\n\n // for each elt in the current head\n for (const currentHeadElt of currentHead.children) {\n\n // If the current head element is in the map\n let inNewContent = srcToNewHeadNodes.has(currentHeadElt.outerHTML);\n let isReAppended = ctx.head.shouldReAppend(currentHeadElt);\n let isPreserved = ctx.head.shouldPreserve(currentHeadElt);\n if (inNewContent || isPreserved) {\n if (isReAppended) {\n // remove the current version and let the new version replace it and re-execute\n removed.push(currentHeadElt);\n } else {\n // this element already exists and should not be re-appended, so remove it from\n // the new content map, preserving it in the DOM\n srcToNewHeadNodes.delete(currentHeadElt.outerHTML);\n preserved.push(currentHeadElt);\n }\n } else {\n if (headMergeStyle === \"append\") {\n // we are appending and this existing element is not new content\n // so if and only if it is marked for re-append do we do anything\n if (isReAppended) {\n removed.push(currentHeadElt);\n nodesToAppend.push(currentHeadElt);\n }\n } else {\n // if this is a merge, we remove this content since it is not in the new head\n if (ctx.head.shouldRemove(currentHeadElt) !== false) {\n removed.push(currentHeadElt);\n }\n }\n }\n }\n\n // Push the remaining new head elements in the Map into the\n // nodes to append to the head tag\n nodesToAppend.push(...srcToNewHeadNodes.values());\n\n let promises = [];\n for (const newNode of nodesToAppend) {\n let newElt = document.createRange().createContextualFragment(newNode.outerHTML).firstChild;\n if (ctx.callbacks.beforeNodeAdded(newElt) !== false) {\n if (newElt.href || newElt.src) {\n let resolve = null;\n let promise = new Promise(function (_resolve) {\n resolve = _resolve;\n });\n newElt.addEventListener('load', function () {\n resolve();\n });\n promises.push(promise);\n }\n currentHead.appendChild(newElt);\n ctx.callbacks.afterNodeAdded(newElt);\n added.push(newElt);\n }\n }\n\n // remove all removed elements, after we have appended the new elements to avoid\n // additional network requests for things like style sheets\n for (const removedElement of removed) {\n if (ctx.callbacks.beforeNodeRemoved(removedElement) !== false) {\n currentHead.removeChild(removedElement);\n ctx.callbacks.afterNodeRemoved(removedElement);\n }\n }\n\n ctx.head.afterHeadMorphed(currentHead, {added: added, kept: preserved, removed: removed});\n return promises;\n }\n\n function noOp() {\n }\n\n /*\n Deep merges the config object and the Idiomoroph.defaults object to\n produce a final configuration object\n */\n function mergeDefaults(config) {\n let finalConfig = {};\n // copy top level stuff into final config\n Object.assign(finalConfig, defaults);\n Object.assign(finalConfig, config);\n\n // copy callbacks into final config (do this to deep merge the callbacks)\n finalConfig.callbacks = {};\n Object.assign(finalConfig.callbacks, defaults.callbacks);\n Object.assign(finalConfig.callbacks, config.callbacks);\n\n // copy head config into final config (do this to deep merge the head)\n finalConfig.head = {};\n Object.assign(finalConfig.head, defaults.head);\n Object.assign(finalConfig.head, config.head);\n return finalConfig;\n }\n\n function createMorphContext(oldNode, newContent, config) {\n config = mergeDefaults(config);\n return {\n target: oldNode,\n newContent: newContent,\n config: config,\n morphStyle: config.morphStyle,\n ignoreActive: config.ignoreActive,\n ignoreActiveValue: config.ignoreActiveValue,\n idMap: createIdMap(oldNode, newContent),\n deadIds: new Set(),\n callbacks: config.callbacks,\n head: config.head\n }\n }\n\n function isIdSetMatch(node1, node2, ctx) {\n if (node1 == null || node2 == null) {\n return false;\n }\n if (node1.nodeType === node2.nodeType && node1.tagName === node2.tagName) {\n if (node1.id !== \"\" && node1.id === node2.id) {\n return true;\n } else {\n return getIdIntersectionCount(ctx, node1, node2) > 0;\n }\n }\n return false;\n }\n\n function isSoftMatch(node1, node2) {\n if (node1 == null || node2 == null) {\n return false;\n }\n return node1.nodeType === node2.nodeType && node1.tagName === node2.tagName\n }\n\n function removeNodesBetween(startInclusive, endExclusive, ctx) {\n while (startInclusive !== endExclusive) {\n let tempNode = startInclusive;\n startInclusive = startInclusive.nextSibling;\n removeNode(tempNode, ctx);\n }\n removeIdsFromConsideration(ctx, endExclusive);\n return endExclusive.nextSibling;\n }\n\n //=============================================================================\n // Scans forward from the insertionPoint in the old parent looking for a potential id match\n // for the newChild. We stop if we find a potential id match for the new child OR\n // if the number of potential id matches we are discarding is greater than the\n // potential id matches for the new child\n //=============================================================================\n function findIdSetMatch(newContent, oldParent, newChild, insertionPoint, ctx) {\n\n // max id matches we are willing to discard in our search\n let newChildPotentialIdCount = getIdIntersectionCount(ctx, newChild, oldParent);\n\n let potentialMatch = null;\n\n // only search forward if there is a possibility of an id match\n if (newChildPotentialIdCount > 0) {\n let potentialMatch = insertionPoint;\n // if there is a possibility of an id match, scan forward\n // keep track of the potential id match count we are discarding (the\n // newChildPotentialIdCount must be greater than this to make it likely\n // worth it)\n let otherMatchCount = 0;\n while (potentialMatch != null) {\n\n // If we have an id match, return the current potential match\n if (isIdSetMatch(newChild, potentialMatch, ctx)) {\n return potentialMatch;\n }\n\n // computer the other potential matches of this new content\n otherMatchCount += getIdIntersectionCount(ctx, potentialMatch, newContent);\n if (otherMatchCount > newChildPotentialIdCount) {\n // if we have more potential id matches in _other_ content, we\n // do not have a good candidate for an id match, so return null\n return null;\n }\n\n // advanced to the next old content child\n potentialMatch = potentialMatch.nextSibling;\n }\n }\n return potentialMatch;\n }\n\n //=============================================================================\n // Scans forward from the insertionPoint in the old parent looking for a potential soft match\n // for the newChild. We stop if we find a potential soft match for the new child OR\n // if we find a potential id match in the old parents children OR if we find two\n // potential soft matches for the next two pieces of new content\n //=============================================================================\n function findSoftMatch(newContent, oldParent, newChild, insertionPoint, ctx) {\n\n let potentialSoftMatch = insertionPoint;\n let nextSibling = newChild.nextSibling;\n let siblingSoftMatchCount = 0;\n\n while (potentialSoftMatch != null) {\n\n if (getIdIntersectionCount(ctx, potentialSoftMatch, newContent) > 0) {\n // the current potential soft match has a potential id set match with the remaining new\n // content so bail out of looking\n return null;\n }\n\n // if we have a soft match with the current node, return it\n if (isSoftMatch(newChild, potentialSoftMatch)) {\n return potentialSoftMatch;\n }\n\n if (isSoftMatch(nextSibling, potentialSoftMatch)) {\n // the next new node has a soft match with this node, so\n // increment the count of future soft matches\n siblingSoftMatchCount++;\n nextSibling = nextSibling.nextSibling;\n\n // If there are two future soft matches, bail to allow the siblings to soft match\n // so that we don't consume future soft matches for the sake of the current node\n if (siblingSoftMatchCount >= 2) {\n return null;\n }\n }\n\n // advanced to the next old content child\n potentialSoftMatch = potentialSoftMatch.nextSibling;\n }\n\n return potentialSoftMatch;\n }\n\n function parseContent(newContent) {\n let parser = new DOMParser();\n\n // remove svgs to avoid false-positive matches on head, etc.\n let contentWithSvgsRemoved = newContent.replace(/<svg(\\s[^>]*>|>)([\\s\\S]*?)<\\/svg>/gim, '');\n\n // if the newContent contains a html, head or body tag, we can simply parse it w/o wrapping\n if (contentWithSvgsRemoved.match(/<\\/html>/) || contentWithSvgsRemoved.match(/<\\/head>/) || contentWithSvgsRemoved.match(/<\\/body>/)) {\n let content = parser.parseFromString(newContent, \"text/html\");\n // if it is a full HTML document, return the document itself as the parent container\n if (contentWithSvgsRemoved.match(/<\\/html>/)) {\n content.generatedByIdiomorph = true;\n return content;\n } else {\n // otherwise return the html element as the parent container\n let htmlElement = content.firstChild;\n if (htmlElement) {\n htmlElement.generatedByIdiomorph = true;\n return htmlElement;\n } else {\n return null;\n }\n }\n } else {\n // if it is partial HTML, wrap it in a template tag to provide a parent element and also to help\n // deal with touchy tags like tr, tbody, etc.\n let responseDoc = parser.parseFromString(\"<body><template>\" + newContent + \"</template></body>\", \"text/html\");\n let content = responseDoc.body.querySelector('template').content;\n content.generatedByIdiomorph = true;\n return content\n }\n }\n\n function normalizeContent(newContent) {\n if (newContent == null) {\n // noinspection UnnecessaryLocalVariableJS\n const dummyParent = document.createElement('div');\n return dummyParent;\n } else if (newContent.generatedByIdiomorph) {\n // the template tag created by idiomorph parsing can serve as a dummy parent\n return newContent;\n } else if (newContent instanceof Node) {\n // a single node is added as a child to a dummy parent\n const dummyParent = document.createElement('div');\n dummyParent.append(newContent);\n return dummyParent;\n } else {\n // all nodes in the array or HTMLElement collection are consolidated under\n // a single dummy parent element\n const dummyParent = document.createElement('div');\n for (const elt of [...newContent]) {\n dummyParent.append(elt);\n }\n return dummyParent;\n }\n }\n\n function insertSiblings(previousSibling, morphedNode, nextSibling) {\n let stack = [];\n let added = [];\n while (previousSibling != null) {\n stack.push(previousSibling);\n previousSibling = previousSibling.previousSibling;\n }\n while (stack.length > 0) {\n let node = stack.pop();\n added.push(node); // push added preceding siblings on in order and insert\n morphedNode.parentElement.insertBefore(node, morphedNode);\n }\n added.push(morphedNode);\n while (nextSibling != null) {\n stack.push(nextSibling);\n added.push(nextSibling); // here we are going in order, so push on as we scan, rather than add\n nextSibling = nextSibling.nextSibling;\n }\n while (stack.length > 0) {\n morphedNode.parentElement.insertBefore(stack.pop(), morphedNode.nextSibling);\n }\n return added;\n }\n\n function findBestNodeMatch(newContent, oldNode, ctx) {\n let currentElement;\n currentElement = newContent.firstChild;\n let bestElement = currentElement;\n let score = 0;\n while (currentElement) {\n let newScore = scoreElement(currentElement, oldNode, ctx);\n if (newScore > score) {\n bestElement = currentElement;\n score = newScore;\n }\n currentElement = currentElement.nextSibling;\n }\n return bestElement;\n }\n\n function scoreElement(node1, node2, ctx) {\n if (isSoftMatch(node1, node2)) {\n return .5 + getIdIntersectionCount(ctx, node1, node2);\n }\n return 0;\n }\n\n function removeNode(tempNode, ctx) {\n removeIdsFromConsideration(ctx, tempNode);\n if (ctx.callbacks.beforeNodeRemoved(tempNode) === false) return;\n\n tempNode.remove();\n ctx.callbacks.afterNodeRemoved(tempNode);\n }\n\n //=============================================================================\n // ID Set Functions\n //=============================================================================\n\n function isIdInConsideration(ctx, id) {\n return !ctx.deadIds.has(id);\n }\n\n function idIsWithinNode(ctx, id, targetNode) {\n let idSet = ctx.idMap.get(targetNode) || EMPTY_SET;\n return idSet.has(id);\n }\n\n function removeIdsFromConsideration(ctx, node) {\n let idSet = ctx.idMap.get(node) || EMPTY_SET;\n for (const id of idSet) {\n ctx.deadIds.add(id);\n }\n }\n\n function getIdIntersectionCount(ctx, node1, node2) {\n let sourceSet = ctx.idMap.get(node1) || EMPTY_SET;\n let matchCount = 0;\n for (const id of sourceSet) {\n // a potential match is an id in the source and potentialIdsSet, but\n // that has not already been merged into the DOM\n if (isIdInConsideration(ctx, id) && idIsWithinNode(ctx, id, node2)) {\n ++matchCount;\n }\n }\n return matchCount;\n }\n\n /**\n * A bottom up algorithm that finds all elements with ids inside of the node\n * argument and populates id sets for those nodes and all their parents, generating\n * a set of ids contained within all nodes for the entire hierarchy in the DOM\n *\n * @param node {Element}\n * @param {Map<Node, Set<String>>} idMap\n */\n function populateIdMapForNode(node, idMap) {\n let nodeParent = node.parentElement;\n // find all elements with an id property\n let idElements = node.querySelectorAll('[id]');\n for (const elt of idElements) {\n let current = elt;\n // walk up the parent hierarchy of that element, adding the id\n // of element to the parent's id set\n while (current !== nodeParent && current != null) {\n let idSet = idMap.get(current);\n // if the id set doesn't exist, create it and insert it in the map\n if (idSet == null) {\n idSet = new Set();\n idMap.set(current, idSet);\n }\n idSet.add(elt.id);\n current = current.parentElement;\n }\n }\n }\n\n /**\n * This function computes a map of nodes to all ids contained within that node (inclusive of the\n * node). This map can be used to ask if two nodes have intersecting sets of ids, which allows\n * for a looser definition of \"matching\" than tradition id matching, and allows child nodes\n * to contribute to a parent nodes matching.\n *\n * @param {Element} oldContent the old content that will be morphed\n * @param {Element} newContent the new content to morph to\n * @returns {Map<Node, Set<String>>} a map of nodes to id sets for the\n */\n function createIdMap(oldContent, newContent) {\n let idMap = new Map();\n populateIdMapForNode(oldContent, idMap);\n populateIdMapForNode(newContent, idMap);\n return idMap;\n }\n\n //=============================================================================\n // This is what ends up becoming the Idiomorph global object\n //=============================================================================\n return {\n morph,\n defaults\n }\n })();\n\nfunction morphElements(currentElement, newElement, { callbacks, ...options } = {}) {\n Idiomorph.morph(currentElement, newElement, {\n ...options,\n callbacks: new DefaultIdiomorphCallbacks(callbacks)\n });\n}\n\nfunction morphChildren(currentElement, newElement) {\n morphElements(currentElement, newElement.children, {\n morphStyle: \"innerHTML\"\n });\n}\n\nclass DefaultIdiomorphCallbacks {\n #beforeNodeMorphed\n\n constructor({ beforeNodeMorphed } = {}) {\n this.#beforeNodeMorphed = beforeNodeMorphed || (() => true);\n }\n\n beforeNodeAdded = (node) => {\n return !(node.id && node.hasAttribute(\"data-turbo-permanent\") && document.getElementById(node.id))\n }\n\n beforeNodeMorphed = (currentElement, newElement) => {\n if (currentElement instanceof Element) {\n if (!currentElement.hasAttribute(\"data-turbo-permanent\") && this.#beforeNodeMorphed(currentElement, newElement)) {\n const event = dispatch(\"turbo:before-morph-element\", {\n cancelable: true,\n target: currentElement,\n detail: { currentElement, newElement }\n });\n\n return !event.defaultPrevented\n } else {\n return false\n }\n }\n }\n\n beforeAttributeUpdated = (attributeName, target, mutationType) => {\n const event = dispatch(\"turbo:before-morph-attribute\", {\n cancelable: true,\n target,\n detail: { attributeName, mutationType }\n });\n\n return !event.defaultPrevented\n }\n\n beforeNodeRemoved = (node) => {\n return this.beforeNodeMorphed(node)\n }\n\n afterNodeMorphed = (currentElement, newElement) => {\n if (currentElement instanceof Element) {\n dispatch(\"turbo:morph-element\", {\n target: currentElement,\n detail: { currentElement, newElement }\n });\n }\n }\n}\n\nclass MorphingFrameRenderer extends FrameRenderer {\n static renderElement(currentElement, newElement) {\n dispatch(\"turbo:before-frame-morph\", {\n target: currentElement,\n detail: { currentElement, newElement }\n });\n\n morphChildren(currentElement, newElement);\n }\n\n async preservingPermanentElements(callback) {\n return await callback()\n }\n}\n\nclass ProgressBar {\n static animationDuration = 300 /*ms*/\n\n static get defaultCSS() {\n return unindent`\n .turbo-progress-bar {\n position: fixed;\n display: block;\n top: 0;\n left: 0;\n height: 3px;\n background: #0076ff;\n z-index: 2147483647;\n transition:\n width ${ProgressBar.animationDuration}ms ease-out,\n opacity ${ProgressBar.animationDuration / 2}ms ${ProgressBar.animationDuration / 2}ms ease-in;\n transform: translate3d(0, 0, 0);\n }\n `\n }\n\n hiding = false\n value = 0\n visible = false\n\n constructor() {\n this.stylesheetElement = this.createStylesheetElement();\n this.progressElement = this.createProgressElement();\n this.installStylesheetElement();\n this.setValue(0);\n }\n\n show() {\n if (!this.visible) {\n this.visible = true;\n this.installProgressElement();\n this.startTrickling();\n }\n }\n\n hide() {\n if (this.visible && !this.hiding) {\n this.hiding = true;\n this.fadeProgressElement(() => {\n this.uninstallProgressElement();\n this.stopTrickling();\n this.visible = false;\n this.hiding = false;\n });\n }\n }\n\n setValue(value) {\n this.value = value;\n this.refresh();\n }\n\n // Private\n\n installStylesheetElement() {\n 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 this.refresh();\n }\n\n fadeProgressElement(callback) {\n this.progressElement.style.opacity = \"0\";\n setTimeout(callback, ProgressBar.animationDuration * 1.5);\n }\n\n uninstallProgressElement() {\n if (this.progressElement.parentNode) {\n document.documentElement.removeChild(this.progressElement);\n }\n }\n\n startTrickling() {\n if (!this.trickleInterval) {\n this.trickleInterval = window.setInterval(this.trickle, ProgressBar.animationDuration);\n }\n }\n\n stopTrickling() {\n window.clearInterval(this.trickleInterval);\n delete this.trickleInterval;\n }\n\n trickle = () => {\n this.setValue(this.value + Math.random() / 100);\n }\n\n refresh() {\n requestAnimationFrame(() => {\n this.progressElement.style.width = `${10 + this.value * 90}%`;\n });\n }\n\n createStylesheetElement() {\n const element = document.createElement(\"style\");\n element.type = \"text/css\";\n element.textContent = ProgressBar.defaultCSS;\n const cspNonce = getCspNonce();\n if (cspNonce) {\n element.nonce = cspNonce;\n }\n return element\n }\n\n createProgressElement() {\n const element = document.createElement(\"div\");\n element.className = \"turbo-progress-bar\";\n return element\n }\n}\n\nclass HeadSnapshot extends Snapshot {\n detailsByOuterHTML = this.children\n .filter((element) => !elementIsNoscript(element))\n .map((element) => elementWithoutNonce(element))\n .reduce((result, element) => {\n const { outerHTML } = element;\n const details =\n outerHTML in result\n ? result[outerHTML]\n : {\n type: elementType(element),\n tracked: elementIsTracked(element),\n elements: []\n };\n return {\n ...result,\n [outerHTML]: {\n ...details,\n elements: [...details.elements, element]\n }\n }\n }, {})\n\n get trackedElementSignature() {\n return Object.keys(this.detailsByOuterHTML)\n .filter((outerHTML) => this.detailsByOuterHTML[outerHTML].tracked)\n .join(\"\")\n }\n\n getScriptElementsNotInSnapshot(snapshot) {\n return this.getElementsMatchingTypeNotInSnapshot(\"script\", snapshot)\n }\n\n getStylesheetElementsNotInSnapshot(snapshot) {\n return this.getElementsMatchingTypeNotInSnapshot(\"stylesheet\", snapshot)\n }\n\n getElementsMatchingTypeNotInSnapshot(matchedType, snapshot) {\n return Object.keys(this.detailsByOuterHTML)\n .filter((outerHTML) => !(outerHTML in snapshot.detailsByOuterHTML))\n .map((outerHTML) => this.detailsByOuterHTML[outerHTML])\n .filter(({ type }) => type == matchedType)\n .map(({ elements: [element] }) => element)\n }\n\n get provisionalElements() {\n return Object.keys(this.detailsByOuterHTML).reduce((result, outerHTML) => {\n const { type, tracked, elements } = this.detailsByOuterHTML[outerHTML];\n if (type == null && !tracked) {\n return [...result, ...elements]\n } else if (elements.length > 1) {\n return [...result, ...elements.slice(1)]\n } else {\n return result\n }\n }, [])\n }\n\n getMetaValue(name) {\n const element = this.findMetaElementByName(name);\n return element ? element.getAttribute(\"content\") : null\n }\n\n findMetaElementByName(name) {\n return Object.keys(this.detailsByOuterHTML).reduce((result, outerHTML) => {\n const {\n elements: [element]\n } = this.detailsByOuterHTML[outerHTML];\n return elementIsMetaElementWithName(element, name) ? element : result\n }, undefined | undefined)\n }\n}\n\nfunction elementType(element) {\n if (elementIsScript(element)) {\n return \"script\"\n } else if (elementIsStylesheet(element)) {\n return \"stylesheet\"\n }\n}\n\nfunction elementIsTracked(element) {\n return element.getAttribute(\"data-turbo-track\") == \"reload\"\n}\n\nfunction elementIsScript(element) {\n const tagName = element.localName;\n return tagName == \"script\"\n}\n\nfunction elementIsNoscript(element) {\n const tagName = element.localName;\n return tagName == \"noscript\"\n}\n\nfunction elementIsStylesheet(element) {\n const tagName = element.localName;\n return tagName == \"style\" || (tagName == \"link\" && element.getAttribute(\"rel\") == \"stylesheet\")\n}\n\nfunction elementIsMetaElementWithName(element, name) {\n const tagName = element.localName;\n return tagName == \"meta\" && element.getAttribute(\"name\") == name\n}\n\nfunction elementWithoutNonce(element) {\n if (element.hasAttribute(\"nonce\")) {\n element.setAttribute(\"nonce\", \"\");\n }\n\n return element\n}\n\nclass PageSnapshot extends Snapshot {\n static fromHTMLString(html = \"\") {\n return this.fromDocument(parseHTMLDocument(html))\n }\n\n static fromElement(element) {\n return this.fromDocument(element.ownerDocument)\n }\n\n static fromDocument({ documentElement, body, head }) {\n return new this(documentElement, body, new HeadSnapshot(head))\n }\n\n constructor(documentElement, body, headSnapshot) {\n super(body);\n this.documentElement = documentElement;\n this.headSnapshot = headSnapshot;\n }\n\n clone() {\n const clonedElement = this.element.cloneNode(true);\n\n const selectElements = this.element.querySelectorAll(\"select\");\n const clonedSelectElements = clonedElement.querySelectorAll(\"select\");\n\n for (const [index, source] of selectElements.entries()) {\n const clone = clonedSelectElements[index];\n for (const option of clone.selectedOptions) option.selected = false;\n for (const option of source.selectedOptions) clone.options[option.index].selected = true;\n }\n\n for (const clonedPasswordInput of clonedElement.querySelectorAll('input[type=\"password\"]')) {\n clonedPasswordInput.value = \"\";\n }\n\n return new PageSnapshot(this.documentElement, clonedElement, this.headSnapshot)\n }\n\n get lang() {\n return this.documentElement.getAttribute(\"lang\")\n }\n\n get headElement() {\n return this.headSnapshot.element\n }\n\n get rootLocation() {\n const root = this.getSetting(\"root\") ?? \"/\";\n return expandURL(root)\n }\n\n get cacheControlValue() {\n return this.getSetting(\"cache-control\")\n }\n\n get isPreviewable() {\n return this.cacheControlValue != \"no-preview\"\n }\n\n get isCacheable() {\n return this.cacheControlValue != \"no-cache\"\n }\n\n get isVisitable() {\n return this.getSetting(\"visit-control\") != \"reload\"\n }\n\n get prefersViewTransitions() {\n return this.headSnapshot.getMetaValue(\"view-transition\") === \"same-origin\"\n }\n\n get shouldMorphPage() {\n return this.getSetting(\"refresh-method\") === \"morph\"\n }\n\n get shouldPreserveScrollPosition() {\n return this.getSetting(\"refresh-scroll\") === \"preserve\"\n }\n\n // Private\n\n getSetting(name) {\n return this.headSnapshot.getMetaValue(`turbo-${name}`)\n }\n}\n\nclass ViewTransitioner {\n #viewTransitionStarted = false\n #lastOperation = Promise.resolve()\n\n renderChange(useViewTransition, render) {\n if (useViewTransition && this.viewTransitionsAvailable && !this.#viewTransitionStarted) {\n this.#viewTransitionStarted = true;\n this.#lastOperation = this.#lastOperation.then(async () => {\n await document.startViewTransition(render).finished;\n });\n } else {\n this.#lastOperation = this.#lastOperation.then(render);\n }\n\n return this.#lastOperation\n }\n\n get viewTransitionsAvailable() {\n return document.startViewTransition\n }\n}\n\nconst defaultOptions = {\n action: \"advance\",\n historyChanged: false,\n visitCachedSnapshot: () => {},\n willRender: true,\n updateHistory: true,\n shouldCacheSnapshot: true,\n acceptsStreamResponse: false\n};\n\nconst TimingMetric = {\n visitStart: \"visitStart\",\n requestStart: \"requestStart\",\n requestEnd: \"requestEnd\",\n visitEnd: \"visitEnd\"\n};\n\nconst VisitState = {\n initialized: \"initialized\",\n started: \"started\",\n canceled: \"canceled\",\n failed: \"failed\",\n completed: \"completed\"\n};\n\nconst SystemStatusCode = {\n networkFailure: 0,\n timeoutFailure: -1,\n contentTypeMismatch: -2\n};\n\nconst Direction = {\n advance: \"forward\",\n restore: \"back\",\n replace: \"none\"\n};\n\nclass Visit {\n identifier = uuid() // Required by turbo-ios\n timingMetrics = {}\n\n followedRedirect = false\n historyChanged = false\n scrolled = false\n shouldCacheSnapshot = true\n acceptsStreamResponse = false\n snapshotCached = false\n state = VisitState.initialized\n viewTransitioner = new ViewTransitioner()\n\n constructor(delegate, location, restorationIdentifier, options = {}) {\n this.delegate = delegate;\n this.location = location;\n this.restorationIdentifier = restorationIdentifier || uuid();\n\n const {\n action,\n historyChanged,\n referrer,\n snapshot,\n snapshotHTML,\n response,\n visitCachedSnapshot,\n willRender,\n updateHistory,\n shouldCacheSnapshot,\n acceptsStreamResponse,\n direction\n } = {\n ...defaultOptions,\n ...options\n };\n this.action = action;\n this.historyChanged = historyChanged;\n this.referrer = referrer;\n this.snapshot = snapshot;\n this.snapshotHTML = snapshotHTML;\n this.response = response;\n this.isSamePage = this.delegate.locationWithActionIsSamePage(this.location, this.action);\n this.isPageRefresh = this.view.isPageRefresh(this);\n this.visitCachedSnapshot = visitCachedSnapshot;\n this.willRender = willRender;\n this.updateHistory = updateHistory;\n this.scrolled = !willRender;\n this.shouldCacheSnapshot = shouldCacheSnapshot;\n this.acceptsStreamResponse = acceptsStreamResponse;\n this.direction = direction || Direction[action];\n }\n\n get adapter() {\n return this.delegate.adapter\n }\n\n get view() {\n return this.delegate.view\n }\n\n get history() {\n return this.delegate.history\n }\n\n get restorationData() {\n return this.history.getRestorationDataForIdentifier(this.restorationIdentifier)\n }\n\n get silent() {\n return this.isSamePage\n }\n\n start() {\n if (this.state == VisitState.initialized) {\n this.recordTimingMetric(TimingMetric.visitStart);\n this.state = VisitState.started;\n this.adapter.visitStarted(this);\n this.delegate.visitStarted(this);\n }\n }\n\n cancel() {\n if (this.state == VisitState.started) {\n if (this.request) {\n this.request.cancel();\n }\n this.cancelRender();\n this.state = VisitState.canceled;\n }\n }\n\n complete() {\n if (this.state == VisitState.started) {\n this.recordTimingMetric(TimingMetric.visitEnd);\n this.adapter.visitCompleted(this);\n this.state = VisitState.completed;\n this.followRedirect();\n\n if (!this.followedRedirect) {\n this.delegate.visitCompleted(this);\n }\n }\n }\n\n fail() {\n if (this.state == VisitState.started) {\n this.state = VisitState.failed;\n this.adapter.visitFailed(this);\n this.delegate.visitCompleted(this);\n }\n }\n\n changeHistory() {\n if (!this.historyChanged && this.updateHistory) {\n const actionForHistory = this.location.href === this.referrer?.href ? \"replace\" : this.action;\n const method = getHistoryMethodForAction(actionForHistory);\n this.history.update(method, this.location, this.restorationIdentifier);\n this.historyChanged = true;\n }\n }\n\n issueRequest() {\n if (this.hasPreloadedResponse()) {\n this.simulateRequest();\n } else if (this.shouldIssueRequest() && !this.request) {\n this.request = new FetchRequest(this, FetchMethod.get, this.location);\n this.request.perform();\n }\n }\n\n simulateRequest() {\n if (this.response) {\n this.startRequest();\n this.recordResponse();\n this.finishRequest();\n }\n }\n\n startRequest() {\n this.recordTimingMetric(TimingMetric.requestStart);\n this.adapter.visitRequestStarted(this);\n }\n\n recordResponse(response = this.response) {\n this.response = response;\n if (response) {\n const { statusCode } = response;\n if (isSuccessful(statusCode)) {\n this.adapter.visitRequestCompleted(this);\n } else {\n this.adapter.visitRequestFailedWithStatusCode(this, statusCode);\n }\n }\n }\n\n finishRequest() {\n this.recordTimingMetric(TimingMetric.requestEnd);\n this.adapter.visitRequestFinished(this);\n }\n\n loadResponse() {\n if (this.response) {\n const { statusCode, responseHTML } = this.response;\n this.render(async () => {\n if (this.shouldCacheSnapshot) this.cacheSnapshot();\n if (this.view.renderPromise) await this.view.renderPromise;\n\n if (isSuccessful(statusCode) && responseHTML != null) {\n const snapshot = PageSnapshot.fromHTMLString(responseHTML);\n await this.renderPageSnapshot(snapshot, false);\n\n this.adapter.visitRendered(this);\n this.complete();\n } else {\n await this.view.renderError(PageSnapshot.fromHTMLString(responseHTML), this);\n this.adapter.visitRendered(this);\n this.fail();\n }\n });\n }\n }\n\n getCachedSnapshot() {\n const snapshot = this.view.getCachedSnapshotForLocation(this.location) || this.getPreloadedSnapshot();\n\n if (snapshot && (!getAnchor(this.location) || snapshot.hasAnchor(getAnchor(this.location)))) {\n if (this.action == \"restore\" || snapshot.isPreviewable) {\n return snapshot\n }\n }\n }\n\n getPreloadedSnapshot() {\n if (this.snapshotHTML) {\n return PageSnapshot.fromHTMLString(this.snapshotHTML)\n }\n }\n\n hasCachedSnapshot() {\n return this.getCachedSnapshot() != null\n }\n\n loadCachedSnapshot() {\n const snapshot = this.getCachedSnapshot();\n if (snapshot) {\n const isPreview = this.shouldIssueRequest();\n this.render(async () => {\n this.cacheSnapshot();\n if (this.isSamePage || this.isPageRefresh) {\n this.adapter.visitRendered(this);\n } else {\n if (this.view.renderPromise) await this.view.renderPromise;\n\n await this.renderPageSnapshot(snapshot, isPreview);\n\n this.adapter.visitRendered(this);\n if (!isPreview) {\n this.complete();\n }\n }\n });\n }\n }\n\n followRedirect() {\n if (this.redirectedToLocation && !this.followedRedirect && this.response?.redirected) {\n this.adapter.visitProposedToLocation(this.redirectedToLocation, {\n action: \"replace\",\n response: this.response,\n shouldCacheSnapshot: false,\n willRender: false\n });\n this.followedRedirect = true;\n }\n }\n\n goToSamePageAnchor() {\n if (this.isSamePage) {\n this.render(async () => {\n this.cacheSnapshot();\n this.performScroll();\n this.changeHistory();\n this.adapter.visitRendered(this);\n });\n }\n }\n\n // Fetch request delegate\n\n prepareRequest(request) {\n if (this.acceptsStreamResponse) {\n request.acceptResponseType(StreamMessage.contentType);\n }\n }\n\n requestStarted() {\n this.startRequest();\n }\n\n requestPreventedHandlingResponse(_request, _response) {}\n\n async requestSucceededWithResponse(request, response) {\n const responseHTML = await response.responseHTML;\n const { redirected, statusCode } = response;\n if (responseHTML == undefined) {\n this.recordResponse({\n statusCode: SystemStatusCode.contentTypeMismatch,\n redirected\n });\n } else {\n this.redirectedToLocation = response.redirected ? response.location : undefined;\n this.recordResponse({ statusCode: statusCode, responseHTML, redirected });\n }\n }\n\n async requestFailedWithResponse(request, response) {\n const responseHTML = await response.responseHTML;\n const { redirected, statusCode } = response;\n if (responseHTML == undefined) {\n this.recordResponse({\n statusCode: SystemStatusCode.contentTypeMismatch,\n redirected\n });\n } else {\n this.recordResponse({ statusCode: statusCode, responseHTML, redirected });\n }\n }\n\n requestErrored(_request, _error) {\n this.recordResponse({\n statusCode: SystemStatusCode.networkFailure,\n redirected: false\n });\n }\n\n requestFinished() {\n this.finishRequest();\n }\n\n // Scrolling\n\n performScroll() {\n if (!this.scrolled && !this.view.forceReloaded && !this.view.shouldPreserveScrollPosition(this)) {\n if (this.action == \"restore\") {\n this.scrollToRestoredPosition() || this.scrollToAnchor() || this.view.scrollToTop();\n } else {\n this.scrollToAnchor() || this.view.scrollToTop();\n }\n if (this.isSamePage) {\n this.delegate.visitScrolledToSamePageLocation(this.view.lastRenderedLocation, this.location);\n }\n\n this.scrolled = true;\n }\n }\n\n scrollToRestoredPosition() {\n const { scrollPosition } = this.restorationData;\n if (scrollPosition) {\n this.view.scrollToPosition(scrollPosition);\n return true\n }\n }\n\n scrollToAnchor() {\n const anchor = getAnchor(this.location);\n if (anchor != null) {\n this.view.scrollToAnchor(anchor);\n return true\n }\n }\n\n // Instrumentation\n\n recordTimingMetric(metric) {\n this.timingMetrics[metric] = new Date().getTime();\n }\n\n getTimingMetrics() {\n return { ...this.timingMetrics }\n }\n\n // Private\n\n getHistoryMethodForAction(action) {\n switch (action) {\n case \"replace\":\n return history.replaceState\n case \"advance\":\n case \"restore\":\n return history.pushState\n }\n }\n\n hasPreloadedResponse() {\n return typeof this.response == \"object\"\n }\n\n shouldIssueRequest() {\n if (this.isSamePage) {\n return false\n } else if (this.action == \"restore\") {\n return !this.hasCachedSnapshot()\n } else {\n return this.willRender\n }\n }\n\n cacheSnapshot() {\n if (!this.snapshotCached) {\n this.view.cacheSnapshot(this.snapshot).then((snapshot) => snapshot && this.visitCachedSnapshot(snapshot));\n this.snapshotCached = true;\n }\n }\n\n async render(callback) {\n this.cancelRender();\n await new Promise((resolve) => {\n this.frame =\n document.visibilityState === \"hidden\" ? setTimeout(() => resolve(), 0) : requestAnimationFrame(() => resolve());\n });\n await callback();\n delete this.frame;\n }\n\n async renderPageSnapshot(snapshot, isPreview) {\n await this.viewTransitioner.renderChange(this.view.shouldTransitionTo(snapshot), async () => {\n await this.view.renderPage(snapshot, isPreview, this.willRender, this);\n this.performScroll();\n });\n }\n\n cancelRender() {\n if (this.frame) {\n cancelAnimationFrame(this.frame);\n delete this.frame;\n }\n }\n}\n\nfunction isSuccessful(statusCode) {\n return statusCode >= 200 && statusCode < 300\n}\n\nclass BrowserAdapter {\n progressBar = new ProgressBar()\n\n constructor(session) {\n this.session = session;\n }\n\n visitProposedToLocation(location, options) {\n if (locationIsVisitable(location, this.navigator.rootLocation)) {\n this.navigator.startVisit(location, options?.restorationIdentifier || uuid(), options);\n } else {\n window.location.href = location.toString();\n }\n }\n\n visitStarted(visit) {\n this.location = visit.location;\n visit.loadCachedSnapshot();\n visit.issueRequest();\n visit.goToSamePageAnchor();\n }\n\n visitRequestStarted(visit) {\n this.progressBar.setValue(0);\n if (visit.hasCachedSnapshot() || visit.action != \"restore\") {\n this.showVisitProgressBarAfterDelay();\n } else {\n this.showProgressBar();\n }\n }\n\n visitRequestCompleted(visit) {\n visit.loadResponse();\n }\n\n visitRequestFailedWithStatusCode(visit, statusCode) {\n switch (statusCode) {\n case SystemStatusCode.networkFailure:\n case SystemStatusCode.timeoutFailure:\n case SystemStatusCode.contentTypeMismatch:\n return this.reload({\n reason: \"request_failed\",\n context: {\n statusCode\n }\n })\n default:\n return visit.loadResponse()\n }\n }\n\n visitRequestFinished(_visit) {}\n\n visitCompleted(_visit) {\n this.progressBar.setValue(1);\n this.hideVisitProgressBar();\n }\n\n pageInvalidated(reason) {\n this.reload(reason);\n }\n\n visitFailed(_visit) {\n this.progressBar.setValue(1);\n this.hideVisitProgressBar();\n }\n\n visitRendered(_visit) {}\n\n // Form Submission Delegate\n\n formSubmissionStarted(_formSubmission) {\n this.progressBar.setValue(0);\n this.showFormProgressBarAfterDelay();\n }\n\n formSubmissionFinished(_formSubmission) {\n this.progressBar.setValue(1);\n this.hideFormProgressBar();\n }\n\n // Private\n\n showVisitProgressBarAfterDelay() {\n this.visitProgressBarTimeout = window.setTimeout(this.showProgressBar, this.session.progressBarDelay);\n }\n\n hideVisitProgressBar() {\n this.progressBar.hide();\n if (this.visitProgressBarTimeout != null) {\n window.clearTimeout(this.visitProgressBarTimeout);\n delete this.visitProgressBarTimeout;\n }\n }\n\n showFormProgressBarAfterDelay() {\n if (this.formProgressBarTimeout == null) {\n this.formProgressBarTimeout = window.setTimeout(this.showProgressBar, this.session.progressBarDelay);\n }\n }\n\n hideFormProgressBar() {\n this.progressBar.hide();\n if (this.formProgressBarTimeout != null) {\n window.clearTimeout(this.formProgressBarTimeout);\n delete this.formProgressBarTimeout;\n }\n }\n\n showProgressBar = () => {\n this.progressBar.show();\n }\n\n reload(reason) {\n dispatch(\"turbo:reload\", { detail: reason });\n\n window.location.href = this.location?.toString() || window.location.href;\n }\n\n get navigator() {\n return this.session.navigator\n }\n}\n\nclass CacheObserver {\n selector = \"[data-turbo-temporary]\"\n deprecatedSelector = \"[data-turbo-cache=false]\"\n\n started = false\n\n start() {\n if (!this.started) {\n this.started = true;\n addEventListener(\"turbo:before-cache\", this.removeTemporaryElements, false);\n }\n }\n\n stop() {\n if (this.started) {\n this.started = false;\n removeEventListener(\"turbo:before-cache\", this.removeTemporaryElements, false);\n }\n }\n\n removeTemporaryElements = (_event) => {\n for (const element of this.temporaryElements) {\n element.remove();\n }\n }\n\n get temporaryElements() {\n return [...document.querySelectorAll(this.selector), ...this.temporaryElementsWithDeprecation]\n }\n\n get temporaryElementsWithDeprecation() {\n const elements = document.querySelectorAll(this.deprecatedSelector);\n\n if (elements.length) {\n console.warn(\n `The ${this.deprecatedSelector} selector is deprecated and will be removed in a future version. Use ${this.selector} instead.`\n );\n }\n\n return [...elements]\n }\n}\n\nclass FrameRedirector {\n constructor(session, element) {\n this.session = session;\n this.element = element;\n this.linkInterceptor = new LinkInterceptor(this, element);\n this.formSubmitObserver = new FormSubmitObserver(this, element);\n }\n\n start() {\n this.linkInterceptor.start();\n this.formSubmitObserver.start();\n }\n\n stop() {\n this.linkInterceptor.stop();\n this.formSubmitObserver.stop();\n }\n\n // Link interceptor delegate\n\n shouldInterceptLinkClick(element, _location, _event) {\n return this.#shouldRedirect(element)\n }\n\n linkClickIntercepted(element, url, event) {\n const frame = this.#findFrameElement(element);\n if (frame) {\n frame.delegate.linkClickIntercepted(element, url, event);\n }\n }\n\n // Form submit observer delegate\n\n willSubmitForm(element, submitter) {\n return (\n element.closest(\"turbo-frame\") == null &&\n this.#shouldSubmit(element, submitter) &&\n this.#shouldRedirect(element, submitter)\n )\n }\n\n formSubmitted(element, submitter) {\n const frame = this.#findFrameElement(element, submitter);\n if (frame) {\n frame.delegate.formSubmitted(element, submitter);\n }\n }\n\n #shouldSubmit(form, submitter) {\n const action = getAction$1(form, submitter);\n const meta = this.element.ownerDocument.querySelector(`meta[name=\"turbo-root\"]`);\n const rootLocation = expandURL(meta?.content ?? \"/\");\n\n return this.#shouldRedirect(form, submitter) && locationIsVisitable(action, rootLocation)\n }\n\n #shouldRedirect(element, submitter) {\n const isNavigatable =\n element instanceof HTMLFormElement\n ? this.session.submissionIsNavigatable(element, submitter)\n : this.session.elementIsNavigatable(element);\n\n if (isNavigatable) {\n const frame = this.#findFrameElement(element, submitter);\n return frame ? frame != element.closest(\"turbo-frame\") : false\n } else {\n return false\n }\n }\n\n #findFrameElement(element, submitter) {\n const id = submitter?.getAttribute(\"data-turbo-frame\") || element.getAttribute(\"data-turbo-frame\");\n if (id && id != \"_top\") {\n const frame = this.element.querySelector(`#${id}:not([disabled])`);\n if (frame instanceof FrameElement) {\n return frame\n }\n }\n }\n}\n\nclass History {\n location\n restorationIdentifier = uuid()\n restorationData = {}\n started = false\n pageLoaded = false\n currentIndex = 0\n\n constructor(delegate) {\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 this.currentIndex = history.state?.turbo?.restorationIndex || 0;\n this.started = true;\n this.replace(new URL(window.location.href));\n }\n }\n\n stop() {\n if (this.started) {\n removeEventListener(\"popstate\", this.onPopState, false);\n removeEventListener(\"load\", this.onPageLoad, false);\n this.started = false;\n }\n }\n\n push(location, restorationIdentifier) {\n this.update(history.pushState, location, restorationIdentifier);\n }\n\n replace(location, restorationIdentifier) {\n this.update(history.replaceState, location, restorationIdentifier);\n }\n\n update(method, location, restorationIdentifier = uuid()) {\n if (method === history.pushState) ++this.currentIndex;\n\n const state = { turbo: { restorationIdentifier, restorationIndex: this.currentIndex } };\n method.call(history, state, \"\", location.href);\n this.location = location;\n this.restorationIdentifier = restorationIdentifier;\n }\n\n // Restoration data\n\n getRestorationDataForIdentifier(restorationIdentifier) {\n return this.restorationData[restorationIdentifier] || {}\n }\n\n updateRestorationData(additionalData) {\n const { restorationIdentifier } = this;\n const restorationData = this.restorationData[restorationIdentifier];\n this.restorationData[restorationIdentifier] = {\n ...restorationData,\n ...additionalData\n };\n }\n\n // Scroll restoration\n\n assumeControlOfScrollRestoration() {\n if (!this.previousScrollRestoration) {\n this.previousScrollRestoration = history.scrollRestoration ?? \"auto\";\n history.scrollRestoration = \"manual\";\n }\n }\n\n relinquishControlOfScrollRestoration() {\n if (this.previousScrollRestoration) {\n history.scrollRestoration = this.previousScrollRestoration;\n delete this.previousScrollRestoration;\n }\n }\n\n // Event handlers\n\n onPopState = (event) => {\n if (this.shouldHandlePopState()) {\n const { turbo } = event.state || {};\n if (turbo) {\n this.location = new URL(window.location.href);\n const { restorationIdentifier, restorationIndex } = turbo;\n this.restorationIdentifier = restorationIdentifier;\n const direction = restorationIndex > this.currentIndex ? \"forward\" : \"back\";\n this.delegate.historyPoppedToLocationWithRestorationIdentifierAndDirection(this.location, restorationIdentifier, direction);\n this.currentIndex = restorationIndex;\n }\n }\n }\n\n onPageLoad = async (_event) => {\n await nextMicrotask();\n this.pageLoaded = true;\n }\n\n // Private\n\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\nclass LinkPrefetchObserver {\n started = false\n #prefetchedLink = null\n\n constructor(delegate, eventTarget) {\n this.delegate = delegate;\n this.eventTarget = eventTarget;\n }\n\n start() {\n if (this.started) return\n\n if (this.eventTarget.readyState === \"loading\") {\n this.eventTarget.addEventListener(\"DOMContentLoaded\", this.#enable, { once: true });\n } else {\n this.#enable();\n }\n }\n\n stop() {\n if (!this.started) return\n\n this.eventTarget.removeEventListener(\"mouseenter\", this.#tryToPrefetchRequest, {\n capture: true,\n passive: true\n });\n this.eventTarget.removeEventListener(\"mouseleave\", this.#cancelRequestIfObsolete, {\n capture: true,\n passive: true\n });\n\n this.eventTarget.removeEventListener(\"turbo:before-fetch-request\", this.#tryToUsePrefetchedRequest, true);\n this.started = false;\n }\n\n #enable = () => {\n this.eventTarget.addEventListener(\"mouseenter\", this.#tryToPrefetchRequest, {\n capture: true,\n passive: true\n });\n this.eventTarget.addEventListener(\"mouseleave\", this.#cancelRequestIfObsolete, {\n capture: true,\n passive: true\n });\n\n this.eventTarget.addEventListener(\"turbo:before-fetch-request\", this.#tryToUsePrefetchedRequest, true);\n this.started = true;\n }\n\n #tryToPrefetchRequest = (event) => {\n if (getMetaContent(\"turbo-prefetch\") === \"false\") return\n\n const target = event.target;\n const isLink = target.matches && target.matches(\"a[href]:not([target^=_]):not([download])\");\n\n if (isLink && this.#isPrefetchable(target)) {\n const link = target;\n const location = getLocationForLink(link);\n\n if (this.delegate.canPrefetchRequestToLocation(link, location)) {\n this.#prefetchedLink = link;\n\n const fetchRequest = new FetchRequest(\n this,\n FetchMethod.get,\n location,\n new URLSearchParams(),\n target\n );\n\n prefetchCache.setLater(location.toString(), fetchRequest, this.#cacheTtl);\n }\n }\n }\n\n #cancelRequestIfObsolete = (event) => {\n if (event.target === this.#prefetchedLink) this.#cancelPrefetchRequest();\n }\n\n #cancelPrefetchRequest = () => {\n prefetchCache.clear();\n this.#prefetchedLink = null;\n }\n\n #tryToUsePrefetchedRequest = (event) => {\n if (event.target.tagName !== \"FORM\" && event.detail.fetchOptions.method === \"GET\") {\n const cached = prefetchCache.get(event.detail.url.toString());\n\n if (cached) {\n // User clicked link, use cache response\n event.detail.fetchRequest = cached;\n }\n\n prefetchCache.clear();\n }\n }\n\n prepareRequest(request) {\n const link = request.target;\n\n request.headers[\"X-Sec-Purpose\"] = \"prefetch\";\n\n const turboFrame = link.closest(\"turbo-frame\");\n const turboFrameTarget = link.getAttribute(\"data-turbo-frame\") || turboFrame?.getAttribute(\"target\") || turboFrame?.id;\n\n if (turboFrameTarget && turboFrameTarget !== \"_top\") {\n request.headers[\"Turbo-Frame\"] = turboFrameTarget;\n }\n }\n\n // Fetch request interface\n\n requestSucceededWithResponse() {}\n\n requestStarted(fetchRequest) {}\n\n requestErrored(fetchRequest) {}\n\n requestFinished(fetchRequest) {}\n\n requestPreventedHandlingResponse(fetchRequest, fetchResponse) {}\n\n requestFailedWithResponse(fetchRequest, fetchResponse) {}\n\n get #cacheTtl() {\n return Number(getMetaContent(\"turbo-prefetch-cache-time\")) || cacheTtl\n }\n\n #isPrefetchable(link) {\n const href = link.getAttribute(\"href\");\n\n if (!href) return false\n\n if (unfetchableLink(link)) return false\n if (linkToTheSamePage(link)) return false\n if (linkOptsOut(link)) return false\n if (nonSafeLink(link)) return false\n if (eventPrevented(link)) return false\n\n return true\n }\n}\n\nconst unfetchableLink = (link) => {\n return link.origin !== document.location.origin || ![\"http:\", \"https:\"].includes(link.protocol) || link.hasAttribute(\"target\")\n};\n\nconst linkToTheSamePage = (link) => {\n return (link.pathname + link.search === document.location.pathname + document.location.search) || link.href.startsWith(\"#\")\n};\n\nconst linkOptsOut = (link) => {\n if (link.getAttribute(\"data-turbo-prefetch\") === \"false\") return true\n if (link.getAttribute(\"data-turbo\") === \"false\") return true\n\n const turboPrefetchParent = findClosestRecursively(link, \"[data-turbo-prefetch]\");\n if (turboPrefetchParent && turboPrefetchParent.getAttribute(\"data-turbo-prefetch\") === \"false\") return true\n\n return false\n};\n\nconst nonSafeLink = (link) => {\n const turboMethod = link.getAttribute(\"data-turbo-method\");\n if (turboMethod && turboMethod.toLowerCase() !== \"get\") return true\n\n if (isUJS(link)) return true\n if (link.hasAttribute(\"data-turbo-confirm\")) return true\n if (link.hasAttribute(\"data-turbo-stream\")) return true\n\n return false\n};\n\nconst isUJS = (link) => {\n return link.hasAttribute(\"data-remote\") || link.hasAttribute(\"data-behavior\") || link.hasAttribute(\"data-confirm\") || link.hasAttribute(\"data-method\")\n};\n\nconst eventPrevented = (link) => {\n const event = dispatch(\"turbo:before-prefetch\", { target: link, cancelable: true });\n return event.defaultPrevented\n};\n\nclass Navigator {\n constructor(delegate) {\n this.delegate = delegate;\n }\n\n proposeVisit(location, options = {}) {\n if (this.delegate.allowsVisitingLocationWithAction(location, options.action)) {\n this.delegate.visitProposedToLocation(location, options);\n }\n }\n\n startVisit(locatable, restorationIdentifier, options = {}) {\n this.stop();\n this.currentVisit = new Visit(this, expandURL(locatable), restorationIdentifier, {\n referrer: this.location,\n ...options\n });\n this.currentVisit.start();\n }\n\n submitForm(form, submitter) {\n this.stop();\n this.formSubmission = new FormSubmission(this, form, submitter, true);\n\n this.formSubmission.start();\n }\n\n stop() {\n if (this.formSubmission) {\n this.formSubmission.stop();\n delete this.formSubmission;\n }\n\n if (this.currentVisit) {\n this.currentVisit.cancel();\n delete this.currentVisit;\n }\n }\n\n get adapter() {\n return this.delegate.adapter\n }\n\n get view() {\n return this.delegate.view\n }\n\n get rootLocation() {\n return this.view.snapshot.rootLocation\n }\n\n get history() {\n return this.delegate.history\n }\n\n // Form submission delegate\n\n formSubmissionStarted(formSubmission) {\n // Not all adapters implement formSubmissionStarted\n if (typeof this.adapter.formSubmissionStarted === \"function\") {\n this.adapter.formSubmissionStarted(formSubmission);\n }\n }\n\n async formSubmissionSucceededWithResponse(formSubmission, fetchResponse) {\n if (formSubmission == this.formSubmission) {\n const responseHTML = await fetchResponse.responseHTML;\n if (responseHTML) {\n const shouldCacheSnapshot = formSubmission.isSafe;\n if (!shouldCacheSnapshot) {\n this.view.clearSnapshotCache();\n }\n\n const { statusCode, redirected } = fetchResponse;\n const action = this.#getActionForFormSubmission(formSubmission, fetchResponse);\n const visitOptions = {\n action,\n shouldCacheSnapshot,\n response: { statusCode, responseHTML, redirected }\n };\n this.proposeVisit(fetchResponse.location, visitOptions);\n }\n }\n }\n\n async formSubmissionFailedWithResponse(formSubmission, fetchResponse) {\n const responseHTML = await fetchResponse.responseHTML;\n\n if (responseHTML) {\n const snapshot = PageSnapshot.fromHTMLString(responseHTML);\n if (fetchResponse.serverError) {\n await this.view.renderError(snapshot, this.currentVisit);\n } else {\n await this.view.renderPage(snapshot, false, true, this.currentVisit);\n }\n if(!snapshot.shouldPreserveScrollPosition) {\n this.view.scrollToTop();\n }\n this.view.clearSnapshotCache();\n }\n }\n\n formSubmissionErrored(formSubmission, error) {\n console.error(error);\n }\n\n formSubmissionFinished(formSubmission) {\n // Not all adapters implement formSubmissionFinished\n if (typeof this.adapter.formSubmissionFinished === \"function\") {\n this.adapter.formSubmissionFinished(formSubmission);\n }\n }\n\n // Visit delegate\n\n visitStarted(visit) {\n this.delegate.visitStarted(visit);\n }\n\n visitCompleted(visit) {\n this.delegate.visitCompleted(visit);\n delete this.currentVisit;\n }\n\n locationWithActionIsSamePage(location, action) {\n const anchor = getAnchor(location);\n const currentAnchor = getAnchor(this.view.lastRenderedLocation);\n const isRestorationToTop = action === \"restore\" && typeof anchor === \"undefined\";\n\n return (\n action !== \"replace\" &&\n getRequestURL(location) === getRequestURL(this.view.lastRenderedLocation) &&\n (isRestorationToTop || (anchor != null && anchor !== currentAnchor))\n )\n }\n\n visitScrolledToSamePageLocation(oldURL, newURL) {\n this.delegate.visitScrolledToSamePageLocation(oldURL, newURL);\n }\n\n // Visits\n\n get location() {\n return this.history.location\n }\n\n get restorationIdentifier() {\n return this.history.restorationIdentifier\n }\n\n #getActionForFormSubmission(formSubmission, fetchResponse) {\n const { submitter, formElement } = formSubmission;\n return getVisitAction(submitter, formElement) || this.#getDefaultAction(fetchResponse)\n }\n\n #getDefaultAction(fetchResponse) {\n const sameLocationRedirect = fetchResponse.redirected && fetchResponse.location.href === this.location?.href;\n return sameLocationRedirect ? \"replace\" : \"advance\"\n }\n}\n\nconst PageStage = {\n initial: 0,\n loading: 1,\n interactive: 2,\n complete: 3\n};\n\nclass PageObserver {\n stage = PageStage.initial\n started = false\n\n constructor(delegate) {\n this.delegate = delegate;\n }\n\n start() {\n if (!this.started) {\n if (this.stage == PageStage.initial) {\n this.stage = PageStage.loading;\n }\n document.addEventListener(\"readystatechange\", this.interpretReadyState, false);\n addEventListener(\"pagehide\", this.pageWillUnload, false);\n this.started = true;\n }\n }\n\n stop() {\n if (this.started) {\n document.removeEventListener(\"readystatechange\", this.interpretReadyState, false);\n removeEventListener(\"pagehide\", this.pageWillUnload, false);\n this.started = false;\n }\n }\n\n interpretReadyState = () => {\n const { readyState } = this;\n if (readyState == \"interactive\") {\n this.pageIsInteractive();\n } else if (readyState == \"complete\") {\n this.pageIsComplete();\n }\n }\n\n pageIsInteractive() {\n if (this.stage == PageStage.loading) {\n this.stage = PageStage.interactive;\n this.delegate.pageBecameInteractive();\n }\n }\n\n pageIsComplete() {\n this.pageIsInteractive();\n if (this.stage == PageStage.interactive) {\n this.stage = PageStage.complete;\n this.delegate.pageLoaded();\n }\n }\n\n pageWillUnload = () => {\n this.delegate.pageWillUnload();\n }\n\n get readyState() {\n return document.readyState\n }\n}\n\nclass ScrollObserver {\n started = false\n\n constructor(delegate) {\n this.delegate = delegate;\n }\n\n start() {\n if (!this.started) {\n addEventListener(\"scroll\", this.onScroll, false);\n this.onScroll();\n this.started = true;\n }\n }\n\n stop() {\n if (this.started) {\n removeEventListener(\"scroll\", this.onScroll, false);\n this.started = false;\n }\n }\n\n onScroll = () => {\n this.updatePosition({ x: window.pageXOffset, y: window.pageYOffset });\n }\n\n // Private\n\n updatePosition(position) {\n this.delegate.scrollPositionChanged(position);\n }\n}\n\nclass StreamMessageRenderer {\n render({ fragment }) {\n Bardo.preservingPermanentElements(this, getPermanentElementMapForFragment(fragment), () => {\n withAutofocusFromFragment(fragment, () => {\n withPreservedFocus(() => {\n document.documentElement.appendChild(fragment);\n });\n });\n });\n }\n\n // Bardo delegate\n\n enteringBardo(currentPermanentElement, newPermanentElement) {\n newPermanentElement.replaceWith(currentPermanentElement.cloneNode(true));\n }\n\n leavingBardo() {}\n}\n\nfunction getPermanentElementMapForFragment(fragment) {\n const permanentElementsInDocument = queryPermanentElementsAll(document.documentElement);\n const permanentElementMap = {};\n for (const permanentElementInDocument of permanentElementsInDocument) {\n const { id } = permanentElementInDocument;\n\n for (const streamElement of fragment.querySelectorAll(\"turbo-stream\")) {\n const elementInStream = getPermanentElementById(streamElement.templateElement.content, id);\n\n if (elementInStream) {\n permanentElementMap[id] = [permanentElementInDocument, elementInStream];\n }\n }\n }\n\n return permanentElementMap\n}\n\nasync function withAutofocusFromFragment(fragment, callback) {\n const generatedID = `turbo-stream-autofocus-${uuid()}`;\n const turboStreams = fragment.querySelectorAll(\"turbo-stream\");\n const elementWithAutofocus = firstAutofocusableElementInStreams(turboStreams);\n let willAutofocusId = null;\n\n if (elementWithAutofocus) {\n if (elementWithAutofocus.id) {\n willAutofocusId = elementWithAutofocus.id;\n } else {\n willAutofocusId = generatedID;\n }\n\n elementWithAutofocus.id = willAutofocusId;\n }\n\n callback();\n await nextRepaint();\n\n const hasNoActiveElement = document.activeElement == null || document.activeElement == document.body;\n\n if (hasNoActiveElement && willAutofocusId) {\n const elementToAutofocus = document.getElementById(willAutofocusId);\n\n if (elementIsFocusable(elementToAutofocus)) {\n elementToAutofocus.focus();\n }\n if (elementToAutofocus && elementToAutofocus.id == generatedID) {\n elementToAutofocus.removeAttribute(\"id\");\n }\n }\n}\n\nasync function withPreservedFocus(callback) {\n const [activeElementBeforeRender, activeElementAfterRender] = await around(callback, () => document.activeElement);\n\n const restoreFocusTo = activeElementBeforeRender && activeElementBeforeRender.id;\n\n if (restoreFocusTo) {\n const elementToFocus = document.getElementById(restoreFocusTo);\n\n if (elementIsFocusable(elementToFocus) && elementToFocus != activeElementAfterRender) {\n elementToFocus.focus();\n }\n }\n}\n\nfunction firstAutofocusableElementInStreams(nodeListOfStreamElements) {\n for (const streamElement of nodeListOfStreamElements) {\n const elementWithAutofocus = queryAutofocusableElement(streamElement.templateElement.content);\n\n if (elementWithAutofocus) return elementWithAutofocus\n }\n\n return null\n}\n\nclass StreamObserver {\n sources = new Set()\n #started = false\n\n constructor(delegate) {\n this.delegate = delegate;\n }\n\n start() {\n if (!this.#started) {\n this.#started = true;\n addEventListener(\"turbo:before-fetch-response\", this.inspectFetchResponse, false);\n }\n }\n\n stop() {\n if (this.#started) {\n this.#started = false;\n removeEventListener(\"turbo:before-fetch-response\", this.inspectFetchResponse, false);\n }\n }\n\n connectStreamSource(source) {\n if (!this.streamSourceIsConnected(source)) {\n this.sources.add(source);\n source.addEventListener(\"message\", this.receiveMessageEvent, false);\n }\n }\n\n disconnectStreamSource(source) {\n if (this.streamSourceIsConnected(source)) {\n this.sources.delete(source);\n source.removeEventListener(\"message\", this.receiveMessageEvent, false);\n }\n }\n\n streamSourceIsConnected(source) {\n return this.sources.has(source)\n }\n\n inspectFetchResponse = (event) => {\n const response = fetchResponseFromEvent(event);\n if (response && fetchResponseIsStream(response)) {\n event.preventDefault();\n this.receiveMessageResponse(response);\n }\n }\n\n receiveMessageEvent = (event) => {\n if (this.#started && typeof event.data == \"string\") {\n this.receiveMessageHTML(event.data);\n }\n }\n\n async receiveMessageResponse(response) {\n const html = await response.responseHTML;\n if (html) {\n this.receiveMessageHTML(html);\n }\n }\n\n receiveMessageHTML(html) {\n this.delegate.receivedMessageFromStream(StreamMessage.wrap(html));\n }\n}\n\nfunction fetchResponseFromEvent(event) {\n const fetchResponse = event.detail?.fetchResponse;\n if (fetchResponse instanceof FetchResponse) {\n return fetchResponse\n }\n}\n\nfunction fetchResponseIsStream(response) {\n const contentType = response.contentType ?? \"\";\n return contentType.startsWith(StreamMessage.contentType)\n}\n\nclass ErrorRenderer extends Renderer {\n static renderElement(currentElement, newElement) {\n const { documentElement, body } = document;\n\n documentElement.replaceChild(newElement, body);\n }\n\n async render() {\n this.replaceHeadAndBody();\n this.activateScriptElements();\n }\n\n replaceHeadAndBody() {\n const { documentElement, head } = document;\n documentElement.replaceChild(this.newHead, head);\n this.renderElement(this.currentElement, this.newElement);\n }\n\n activateScriptElements() {\n for (const replaceableElement of this.scriptElements) {\n const parentNode = replaceableElement.parentNode;\n if (parentNode) {\n const element = activateScriptElement(replaceableElement);\n parentNode.replaceChild(element, replaceableElement);\n }\n }\n }\n\n get newHead() {\n return this.newSnapshot.headSnapshot.element\n }\n\n get scriptElements() {\n return document.documentElement.querySelectorAll(\"script\")\n }\n}\n\nclass PageRenderer extends Renderer {\n static renderElement(currentElement, newElement) {\n if (document.body && newElement instanceof HTMLBodyElement) {\n document.body.replaceWith(newElement);\n } else {\n document.documentElement.appendChild(newElement);\n }\n }\n\n get shouldRender() {\n return this.newSnapshot.isVisitable && this.trackedElementsAreIdentical\n }\n\n get reloadReason() {\n if (!this.newSnapshot.isVisitable) {\n return {\n reason: \"turbo_visit_control_is_reload\"\n }\n }\n\n if (!this.trackedElementsAreIdentical) {\n return {\n reason: \"tracked_element_mismatch\"\n }\n }\n }\n\n async prepareToRender() {\n this.#setLanguage();\n await this.mergeHead();\n }\n\n async render() {\n if (this.willRender) {\n await this.replaceBody();\n }\n }\n\n finishRendering() {\n super.finishRendering();\n if (!this.isPreview) {\n this.focusFirstAutofocusableElement();\n }\n }\n\n get currentHeadSnapshot() {\n return this.currentSnapshot.headSnapshot\n }\n\n get newHeadSnapshot() {\n return this.newSnapshot.headSnapshot\n }\n\n get newElement() {\n return this.newSnapshot.element\n }\n\n #setLanguage() {\n const { documentElement } = this.currentSnapshot;\n const { lang } = this.newSnapshot;\n\n if (lang) {\n documentElement.setAttribute(\"lang\", lang);\n } else {\n documentElement.removeAttribute(\"lang\");\n }\n }\n\n async mergeHead() {\n const mergedHeadElements = this.mergeProvisionalElements();\n const newStylesheetElements = this.copyNewHeadStylesheetElements();\n this.copyNewHeadScriptElements();\n\n await mergedHeadElements;\n await newStylesheetElements;\n\n if (this.willRender) {\n this.removeUnusedDynamicStylesheetElements();\n }\n }\n\n async replaceBody() {\n await this.preservingPermanentElements(async () => {\n this.activateNewBody();\n await this.assignNewBody();\n });\n }\n\n get trackedElementsAreIdentical() {\n return this.currentHeadSnapshot.trackedElementSignature == this.newHeadSnapshot.trackedElementSignature\n }\n\n async copyNewHeadStylesheetElements() {\n const loadingElements = [];\n\n for (const element of this.newHeadStylesheetElements) {\n loadingElements.push(waitForLoad(element));\n\n document.head.appendChild(element);\n }\n\n await Promise.all(loadingElements);\n }\n\n copyNewHeadScriptElements() {\n for (const element of this.newHeadScriptElements) {\n document.head.appendChild(activateScriptElement(element));\n }\n }\n\n removeUnusedDynamicStylesheetElements() {\n for (const element of this.unusedDynamicStylesheetElements) {\n document.head.removeChild(element);\n }\n }\n\n async mergeProvisionalElements() {\n const newHeadElements = [...this.newHeadProvisionalElements];\n\n for (const element of this.currentHeadProvisionalElements) {\n if (!this.isCurrentElementInElementList(element, newHeadElements)) {\n document.head.removeChild(element);\n }\n }\n\n for (const element of newHeadElements) {\n document.head.appendChild(element);\n }\n }\n\n isCurrentElementInElementList(element, elementList) {\n for (const [index, newElement] of elementList.entries()) {\n // if title element...\n if (element.tagName == \"TITLE\") {\n if (newElement.tagName != \"TITLE\") {\n continue\n }\n if (element.innerHTML == newElement.innerHTML) {\n elementList.splice(index, 1);\n return true\n }\n }\n\n // if any other element...\n if (newElement.isEqualNode(element)) {\n elementList.splice(index, 1);\n return true\n }\n }\n\n return false\n }\n\n removeCurrentHeadProvisionalElements() {\n for (const element of this.currentHeadProvisionalElements) {\n document.head.removeChild(element);\n }\n }\n\n copyNewHeadProvisionalElements() {\n for (const element of this.newHeadProvisionalElements) {\n document.head.appendChild(element);\n }\n }\n\n activateNewBody() {\n document.adoptNode(this.newElement);\n this.activateNewBodyScriptElements();\n }\n\n activateNewBodyScriptElements() {\n for (const inertScriptElement of this.newBodyScriptElements) {\n const activatedScriptElement = activateScriptElement(inertScriptElement);\n inertScriptElement.replaceWith(activatedScriptElement);\n }\n }\n\n async assignNewBody() {\n await this.renderElement(this.currentElement, this.newElement);\n }\n\n get unusedDynamicStylesheetElements() {\n return this.oldHeadStylesheetElements.filter((element) => {\n return element.getAttribute(\"data-turbo-track\") === \"dynamic\"\n })\n }\n\n get oldHeadStylesheetElements() {\n return this.currentHeadSnapshot.getStylesheetElementsNotInSnapshot(this.newHeadSnapshot)\n }\n\n get newHeadStylesheetElements() {\n return this.newHeadSnapshot.getStylesheetElementsNotInSnapshot(this.currentHeadSnapshot)\n }\n\n get newHeadScriptElements() {\n return this.newHeadSnapshot.getScriptElementsNotInSnapshot(this.currentHeadSnapshot)\n }\n\n get currentHeadProvisionalElements() {\n return this.currentHeadSnapshot.provisionalElements\n }\n\n get newHeadProvisionalElements() {\n return this.newHeadSnapshot.provisionalElements\n }\n\n get newBodyScriptElements() {\n return this.newElement.querySelectorAll(\"script\")\n }\n}\n\nclass MorphingPageRenderer extends PageRenderer {\n static renderElement(currentElement, newElement) {\n morphElements(currentElement, newElement, {\n callbacks: {\n beforeNodeMorphed: element => !canRefreshFrame(element)\n }\n });\n\n for (const frame of currentElement.querySelectorAll(\"turbo-frame\")) {\n if (canRefreshFrame(frame)) frame.reload();\n }\n\n dispatch(\"turbo:morph\", { detail: { currentElement, newElement } });\n }\n\n async preservingPermanentElements(callback) {\n return await callback()\n }\n\n get renderMethod() {\n return \"morph\"\n }\n\n get shouldAutofocus() {\n return false\n }\n}\n\nfunction canRefreshFrame(frame) {\n return frame instanceof FrameElement &&\n frame.src &&\n frame.refresh === \"morph\" &&\n !frame.closest(\"[data-turbo-permanent]\")\n}\n\nclass SnapshotCache {\n keys = []\n snapshots = {}\n\n constructor(size) {\n this.size = size;\n }\n\n has(location) {\n return toCacheKey(location) in this.snapshots\n }\n\n get(location) {\n if (this.has(location)) {\n const snapshot = this.read(location);\n this.touch(location);\n return snapshot\n }\n }\n\n put(location, snapshot) {\n this.write(location, snapshot);\n this.touch(location);\n return snapshot\n }\n\n clear() {\n this.snapshots = {};\n }\n\n // Private\n\n read(location) {\n return this.snapshots[toCacheKey(location)]\n }\n\n write(location, snapshot) {\n this.snapshots[toCacheKey(location)] = snapshot;\n }\n\n touch(location) {\n const key = toCacheKey(location);\n const index = this.keys.indexOf(key);\n if (index > -1) this.keys.splice(index, 1);\n this.keys.unshift(key);\n this.trim();\n }\n\n trim() {\n for (const key of this.keys.splice(this.size)) {\n delete this.snapshots[key];\n }\n }\n}\n\nclass PageView extends View {\n snapshotCache = new SnapshotCache(10)\n lastRenderedLocation = new URL(location.href)\n forceReloaded = false\n\n shouldTransitionTo(newSnapshot) {\n return this.snapshot.prefersViewTransitions && newSnapshot.prefersViewTransitions\n }\n\n renderPage(snapshot, isPreview = false, willRender = true, visit) {\n const shouldMorphPage = this.isPageRefresh(visit) && this.snapshot.shouldMorphPage;\n const rendererClass = shouldMorphPage ? MorphingPageRenderer : PageRenderer;\n\n const renderer = new rendererClass(this.snapshot, snapshot, isPreview, willRender);\n\n if (!renderer.shouldRender) {\n this.forceReloaded = true;\n } else {\n visit?.changeHistory();\n }\n\n return this.render(renderer)\n }\n\n renderError(snapshot, visit) {\n visit?.changeHistory();\n const renderer = new ErrorRenderer(this.snapshot, snapshot, false);\n return this.render(renderer)\n }\n\n clearSnapshotCache() {\n this.snapshotCache.clear();\n }\n\n async cacheSnapshot(snapshot = this.snapshot) {\n if (snapshot.isCacheable) {\n this.delegate.viewWillCacheSnapshot();\n const { lastRenderedLocation: location } = this;\n await nextEventLoopTick();\n const cachedSnapshot = snapshot.clone();\n this.snapshotCache.put(location, cachedSnapshot);\n return cachedSnapshot\n }\n }\n\n getCachedSnapshotForLocation(location) {\n return this.snapshotCache.get(location)\n }\n\n isPageRefresh(visit) {\n return !visit || (this.lastRenderedLocation.pathname === visit.location.pathname && visit.action === \"replace\")\n }\n\n shouldPreserveScrollPosition(visit) {\n return this.isPageRefresh(visit) && this.snapshot.shouldPreserveScrollPosition\n }\n\n get snapshot() {\n return PageSnapshot.fromElement(this.element)\n }\n}\n\nclass Preloader {\n selector = \"a[data-turbo-preload]\"\n\n constructor(delegate, snapshotCache) {\n this.delegate = delegate;\n this.snapshotCache = snapshotCache;\n }\n\n start() {\n if (document.readyState === \"loading\") {\n document.addEventListener(\"DOMContentLoaded\", this.#preloadAll);\n } else {\n this.preloadOnLoadLinksForView(document.body);\n }\n }\n\n stop() {\n document.removeEventListener(\"DOMContentLoaded\", this.#preloadAll);\n }\n\n preloadOnLoadLinksForView(element) {\n for (const link of element.querySelectorAll(this.selector)) {\n if (this.delegate.shouldPreloadLink(link)) {\n this.preloadURL(link);\n }\n }\n }\n\n async preloadURL(link) {\n const location = new URL(link.href);\n\n if (this.snapshotCache.has(location)) {\n return\n }\n\n const fetchRequest = new FetchRequest(this, FetchMethod.get, location, new URLSearchParams(), link);\n await fetchRequest.perform();\n }\n\n // Fetch request delegate\n\n prepareRequest(fetchRequest) {\n fetchRequest.headers[\"X-Sec-Purpose\"] = \"prefetch\";\n }\n\n async requestSucceededWithResponse(fetchRequest, fetchResponse) {\n try {\n const responseHTML = await fetchResponse.responseHTML;\n const snapshot = PageSnapshot.fromHTMLString(responseHTML);\n\n this.snapshotCache.put(fetchRequest.url, snapshot);\n } catch (_) {\n // If we cannot preload that is ok!\n }\n }\n\n requestStarted(fetchRequest) {}\n\n requestErrored(fetchRequest) {}\n\n requestFinished(fetchRequest) {}\n\n requestPreventedHandlingResponse(fetchRequest, fetchResponse) {}\n\n requestFailedWithResponse(fetchRequest, fetchResponse) {}\n\n #preloadAll = () => {\n this.preloadOnLoadLinksForView(document.body);\n }\n}\n\nclass Cache {\n constructor(session) {\n this.session = session;\n }\n\n clear() {\n this.session.clearCache();\n }\n\n resetCacheControl() {\n this.#setCacheControl(\"\");\n }\n\n exemptPageFromCache() {\n this.#setCacheControl(\"no-cache\");\n }\n\n exemptPageFromPreview() {\n this.#setCacheControl(\"no-preview\");\n }\n\n #setCacheControl(value) {\n setMetaContent(\"turbo-cache-control\", value);\n }\n}\n\nclass Session {\n navigator = new Navigator(this)\n history = new History(this)\n view = new PageView(this, document.documentElement)\n adapter = new BrowserAdapter(this)\n\n pageObserver = new PageObserver(this)\n cacheObserver = new CacheObserver()\n linkPrefetchObserver = new LinkPrefetchObserver(this, document)\n linkClickObserver = new LinkClickObserver(this, window)\n formSubmitObserver = new FormSubmitObserver(this, document)\n scrollObserver = new ScrollObserver(this)\n streamObserver = new StreamObserver(this)\n formLinkClickObserver = new FormLinkClickObserver(this, document.documentElement)\n frameRedirector = new FrameRedirector(this, document.documentElement)\n streamMessageRenderer = new StreamMessageRenderer()\n cache = new Cache(this)\n\n enabled = true\n started = false\n #pageRefreshDebouncePeriod = 150\n\n constructor(recentRequests) {\n this.recentRequests = recentRequests;\n this.preloader = new Preloader(this, this.view.snapshotCache);\n this.debouncedRefresh = this.refresh;\n this.pageRefreshDebouncePeriod = this.pageRefreshDebouncePeriod;\n }\n\n start() {\n if (!this.started) {\n this.pageObserver.start();\n this.cacheObserver.start();\n this.linkPrefetchObserver.start();\n this.formLinkClickObserver.start();\n this.linkClickObserver.start();\n this.formSubmitObserver.start();\n this.scrollObserver.start();\n this.streamObserver.start();\n this.frameRedirector.start();\n this.history.start();\n this.preloader.start();\n this.started = true;\n this.enabled = true;\n }\n }\n\n disable() {\n this.enabled = false;\n }\n\n stop() {\n if (this.started) {\n this.pageObserver.stop();\n this.cacheObserver.stop();\n this.linkPrefetchObserver.stop();\n this.formLinkClickObserver.stop();\n this.linkClickObserver.stop();\n this.formSubmitObserver.stop();\n this.scrollObserver.stop();\n this.streamObserver.stop();\n this.frameRedirector.stop();\n this.history.stop();\n this.preloader.stop();\n this.started = false;\n }\n }\n\n registerAdapter(adapter) {\n this.adapter = adapter;\n }\n\n visit(location, options = {}) {\n const frameElement = options.frame ? document.getElementById(options.frame) : null;\n\n if (frameElement instanceof FrameElement) {\n const action = options.action || getVisitAction(frameElement);\n\n frameElement.delegate.proposeVisitIfNavigatedWithAction(frameElement, action);\n frameElement.src = location.toString();\n } else {\n this.navigator.proposeVisit(expandURL(location), options);\n }\n }\n\n refresh(url, requestId) {\n const isRecentRequest = requestId && this.recentRequests.has(requestId);\n if (!isRecentRequest && !this.navigator.currentVisit) {\n this.visit(url, { action: \"replace\", shouldCacheSnapshot: false });\n }\n }\n\n connectStreamSource(source) {\n this.streamObserver.connectStreamSource(source);\n }\n\n disconnectStreamSource(source) {\n this.streamObserver.disconnectStreamSource(source);\n }\n\n renderStreamMessage(message) {\n this.streamMessageRenderer.render(StreamMessage.wrap(message));\n }\n\n clearCache() {\n this.view.clearSnapshotCache();\n }\n\n setProgressBarDelay(delay) {\n console.warn(\n \"Please replace `session.setProgressBarDelay(delay)` with `session.progressBarDelay = delay`. The function is deprecated and will be removed in a future version of Turbo.`\"\n );\n\n this.progressBarDelay = delay;\n }\n\n set progressBarDelay(delay) {\n config.drive.progressBarDelay = delay;\n }\n\n get progressBarDelay() {\n return config.drive.progressBarDelay\n }\n\n set drive(value) {\n config.drive.enabled = value;\n }\n\n get drive() {\n return config.drive.enabled\n }\n\n set formMode(value) {\n config.forms.mode = value;\n }\n\n get formMode() {\n return config.forms.mode\n }\n\n get location() {\n return this.history.location\n }\n\n get restorationIdentifier() {\n return this.history.restorationIdentifier\n }\n\n get pageRefreshDebouncePeriod() {\n return this.#pageRefreshDebouncePeriod\n }\n\n set pageRefreshDebouncePeriod(value) {\n this.refresh = debounce(this.debouncedRefresh.bind(this), value);\n this.#pageRefreshDebouncePeriod = value;\n }\n\n // Preloader delegate\n\n shouldPreloadLink(element) {\n const isUnsafe = element.hasAttribute(\"data-turbo-method\");\n const isStream = element.hasAttribute(\"data-turbo-stream\");\n const frameTarget = element.getAttribute(\"data-turbo-frame\");\n const frame = frameTarget == \"_top\" ?\n null :\n document.getElementById(frameTarget) || findClosestRecursively(element, \"turbo-frame:not([disabled])\");\n\n if (isUnsafe || isStream || frame instanceof FrameElement) {\n return false\n } else {\n const location = new URL(element.href);\n\n return this.elementIsNavigatable(element) && locationIsVisitable(location, this.snapshot.rootLocation)\n }\n }\n\n // History delegate\n\n historyPoppedToLocationWithRestorationIdentifierAndDirection(location, restorationIdentifier, direction) {\n if (this.enabled) {\n this.navigator.startVisit(location, restorationIdentifier, {\n action: \"restore\",\n historyChanged: true,\n direction\n });\n } else {\n this.adapter.pageInvalidated({\n reason: \"turbo_disabled\"\n });\n }\n }\n\n // Scroll observer delegate\n\n scrollPositionChanged(position) {\n this.history.updateRestorationData({ scrollPosition: position });\n }\n\n // Form click observer delegate\n\n willSubmitFormLinkToLocation(link, location) {\n return this.elementIsNavigatable(link) && locationIsVisitable(location, this.snapshot.rootLocation)\n }\n\n submittedFormLinkToLocation() {}\n\n // Link hover observer delegate\n\n canPrefetchRequestToLocation(link, location) {\n return (\n this.elementIsNavigatable(link) &&\n locationIsVisitable(location, this.snapshot.rootLocation)\n )\n }\n\n // Link click observer delegate\n\n willFollowLinkToLocation(link, location, event) {\n return (\n this.elementIsNavigatable(link) &&\n locationIsVisitable(location, this.snapshot.rootLocation) &&\n this.applicationAllowsFollowingLinkToLocation(link, location, event)\n )\n }\n\n followedLinkToLocation(link, location) {\n const action = this.getActionForLink(link);\n const acceptsStreamResponse = link.hasAttribute(\"data-turbo-stream\");\n\n this.visit(location.href, { action, acceptsStreamResponse });\n }\n\n // Navigator delegate\n\n allowsVisitingLocationWithAction(location, action) {\n return this.locationWithActionIsSamePage(location, action) || this.applicationAllowsVisitingLocation(location)\n }\n\n visitProposedToLocation(location, options) {\n extendURLWithDeprecatedProperties(location);\n this.adapter.visitProposedToLocation(location, options);\n }\n\n // Visit delegate\n\n visitStarted(visit) {\n if (!visit.acceptsStreamResponse) {\n markAsBusy(document.documentElement);\n this.view.markVisitDirection(visit.direction);\n }\n extendURLWithDeprecatedProperties(visit.location);\n if (!visit.silent) {\n this.notifyApplicationAfterVisitingLocation(visit.location, visit.action);\n }\n }\n\n visitCompleted(visit) {\n this.view.unmarkVisitDirection();\n clearBusyState(document.documentElement);\n this.notifyApplicationAfterPageLoad(visit.getTimingMetrics());\n }\n\n locationWithActionIsSamePage(location, action) {\n return this.navigator.locationWithActionIsSamePage(location, action)\n }\n\n visitScrolledToSamePageLocation(oldURL, newURL) {\n this.notifyApplicationAfterVisitingSamePageLocation(oldURL, newURL);\n }\n\n // Form submit observer delegate\n\n willSubmitForm(form, submitter) {\n const action = getAction$1(form, submitter);\n\n return (\n this.submissionIsNavigatable(form, submitter) &&\n locationIsVisitable(expandURL(action), this.snapshot.rootLocation)\n )\n }\n\n formSubmitted(form, submitter) {\n this.navigator.submitForm(form, submitter);\n }\n\n // Page observer delegate\n\n pageBecameInteractive() {\n this.view.lastRenderedLocation = this.location;\n this.notifyApplicationAfterPageLoad();\n }\n\n pageLoaded() {\n this.history.assumeControlOfScrollRestoration();\n }\n\n pageWillUnload() {\n this.history.relinquishControlOfScrollRestoration();\n }\n\n // Stream observer delegate\n\n receivedMessageFromStream(message) {\n this.renderStreamMessage(message);\n }\n\n // Page view delegate\n\n viewWillCacheSnapshot() {\n if (!this.navigator.currentVisit?.silent) {\n this.notifyApplicationBeforeCachingSnapshot();\n }\n }\n\n allowsImmediateRender({ element }, options) {\n const event = this.notifyApplicationBeforeRender(element, options);\n const {\n defaultPrevented,\n detail: { render }\n } = event;\n\n if (this.view.renderer && render) {\n this.view.renderer.renderElement = render;\n }\n\n return !defaultPrevented\n }\n\n viewRenderedSnapshot(_snapshot, _isPreview, renderMethod) {\n this.view.lastRenderedLocation = this.history.location;\n this.notifyApplicationAfterRender(renderMethod);\n }\n\n preloadOnLoadLinksForView(element) {\n this.preloader.preloadOnLoadLinksForView(element);\n }\n\n viewInvalidated(reason) {\n this.adapter.pageInvalidated(reason);\n }\n\n // Frame element\n\n frameLoaded(frame) {\n this.notifyApplicationAfterFrameLoad(frame);\n }\n\n frameRendered(fetchResponse, frame) {\n this.notifyApplicationAfterFrameRender(fetchResponse, frame);\n }\n\n // Application events\n\n applicationAllowsFollowingLinkToLocation(link, location, ev) {\n const event = this.notifyApplicationAfterClickingLinkToLocation(link, location, ev);\n return !event.defaultPrevented\n }\n\n applicationAllowsVisitingLocation(location) {\n const event = this.notifyApplicationBeforeVisitingLocation(location);\n return !event.defaultPrevented\n }\n\n notifyApplicationAfterClickingLinkToLocation(link, location, event) {\n return dispatch(\"turbo:click\", {\n target: link,\n detail: { url: location.href, originalEvent: event },\n cancelable: true\n })\n }\n\n notifyApplicationBeforeVisitingLocation(location) {\n return dispatch(\"turbo:before-visit\", {\n detail: { url: location.href },\n cancelable: true\n })\n }\n\n notifyApplicationAfterVisitingLocation(location, action) {\n return dispatch(\"turbo:visit\", { detail: { url: location.href, action } })\n }\n\n notifyApplicationBeforeCachingSnapshot() {\n return dispatch(\"turbo:before-cache\")\n }\n\n notifyApplicationBeforeRender(newBody, options) {\n return dispatch(\"turbo:before-render\", {\n detail: { newBody, ...options },\n cancelable: true\n })\n }\n\n notifyApplicationAfterRender(renderMethod) {\n return dispatch(\"turbo:render\", { detail: { renderMethod } })\n }\n\n notifyApplicationAfterPageLoad(timing = {}) {\n return dispatch(\"turbo:load\", {\n detail: { url: this.location.href, timing }\n })\n }\n\n notifyApplicationAfterVisitingSamePageLocation(oldURL, newURL) {\n dispatchEvent(\n new HashChangeEvent(\"hashchange\", {\n oldURL: oldURL.toString(),\n newURL: newURL.toString()\n })\n );\n }\n\n notifyApplicationAfterFrameLoad(frame) {\n return dispatch(\"turbo:frame-load\", { target: frame })\n }\n\n notifyApplicationAfterFrameRender(fetchResponse, frame) {\n return dispatch(\"turbo:frame-render\", {\n detail: { fetchResponse },\n target: frame,\n cancelable: true\n })\n }\n\n // Helpers\n\n submissionIsNavigatable(form, submitter) {\n if (config.forms.mode == \"off\") {\n return false\n } else {\n const submitterIsNavigatable = submitter ? this.elementIsNavigatable(submitter) : true;\n\n if (config.forms.mode == \"optin\") {\n return submitterIsNavigatable && form.closest('[data-turbo=\"true\"]') != null\n } else {\n return submitterIsNavigatable && this.elementIsNavigatable(form)\n }\n }\n }\n\n elementIsNavigatable(element) {\n const container = findClosestRecursively(element, \"[data-turbo]\");\n const withinFrame = findClosestRecursively(element, \"turbo-frame\");\n\n // Check if Drive is enabled on the session or we're within a Frame.\n if (config.drive.enabled || withinFrame) {\n // Element is navigatable by default, unless `data-turbo=\"false\"`.\n if (container) {\n return container.getAttribute(\"data-turbo\") != \"false\"\n } else {\n return true\n }\n } else {\n // Element isn't navigatable by default, unless `data-turbo=\"true\"`.\n if (container) {\n return container.getAttribute(\"data-turbo\") == \"true\"\n } else {\n return false\n }\n }\n }\n\n // Private\n\n getActionForLink(link) {\n return getVisitAction(link) || \"advance\"\n }\n\n get snapshot() {\n return this.view.snapshot\n }\n}\n\n// Older versions of the Turbo Native adapters referenced the\n// `Location#absoluteURL` property in their implementations of\n// the `Adapter#visitProposedToLocation()` and `#visitStarted()`\n// methods. The Location class has since been removed in favor\n// of the DOM URL API, and accordingly all Adapter methods now\n// receive URL objects.\n//\n// We alias #absoluteURL to #toString() here to avoid crashing\n// older adapters which do not expect URL objects. We should\n// consider removing this support at some point in the future.\n\nfunction extendURLWithDeprecatedProperties(url) {\n Object.defineProperties(url, deprecatedLocationPropertyDescriptors);\n}\n\nconst deprecatedLocationPropertyDescriptors = {\n absoluteURL: {\n get() {\n return this.toString()\n }\n }\n};\n\nconst session = new Session(recentRequests);\nconst { cache, navigator: navigator$1 } = session;\n\n/**\n * Starts the main session.\n * This initialises any necessary observers such as those to monitor\n * link interactions.\n */\nfunction start() {\n session.start();\n}\n\n/**\n * Registers an adapter for the main session.\n *\n * @param adapter Adapter to register\n */\nfunction registerAdapter(adapter) {\n session.registerAdapter(adapter);\n}\n\n/**\n * Performs an application visit to the given location.\n *\n * @param location Location to visit (a URL or path)\n * @param options Options to apply\n * @param options.action Type of history navigation to apply (\"restore\",\n * \"replace\" or \"advance\")\n * @param options.historyChanged Specifies whether the browser history has\n * already been changed for this visit or not\n * @param options.referrer Specifies the referrer of this visit such that\n * navigations to the same page will not result in a new history entry.\n * @param options.snapshotHTML Cached snapshot to render\n * @param options.response Response of the specified location\n */\nfunction visit(location, options) {\n session.visit(location, options);\n}\n\n/**\n * Connects a stream source to the main session.\n *\n * @param source Stream source to connect\n */\nfunction connectStreamSource(source) {\n session.connectStreamSource(source);\n}\n\n/**\n * Disconnects a stream source from the main session.\n *\n * @param source Stream source to disconnect\n */\nfunction disconnectStreamSource(source) {\n session.disconnectStreamSource(source);\n}\n\n/**\n * Renders a stream message to the main session by appending it to the\n * current document.\n *\n * @param message Message to render\n */\nfunction renderStreamMessage(message) {\n session.renderStreamMessage(message);\n}\n\n/**\n * Removes all entries from the Turbo Drive page cache.\n * Call this when state has changed on the server that may affect cached pages.\n *\n * @deprecated since version 7.2.0 in favor of `Turbo.cache.clear()`\n */\nfunction clearCache() {\n console.warn(\n \"Please replace `Turbo.clearCache()` with `Turbo.cache.clear()`. The top-level function is deprecated and will be removed in a future version of Turbo.`\"\n );\n session.clearCache();\n}\n\n/**\n * Sets the delay after which the progress bar will appear during navigation.\n *\n * The progress bar appears after 500ms by default.\n *\n * Note that this method has no effect when used with the iOS or Android\n * adapters.\n *\n * @param delay Time to delay in milliseconds\n */\nfunction setProgressBarDelay(delay) {\n console.warn(\n \"Please replace `Turbo.setProgressBarDelay(delay)` with `Turbo.config.drive.progressBarDelay = delay`. The top-level function is deprecated and will be removed in a future version of Turbo.`\"\n );\n config.drive.progressBarDelay = delay;\n}\n\nfunction setConfirmMethod(confirmMethod) {\n console.warn(\n \"Please replace `Turbo.setConfirmMethod(confirmMethod)` with `Turbo.config.forms.confirm = confirmMethod`. The top-level function is deprecated and will be removed in a future version of Turbo.`\"\n );\n config.forms.confirm = confirmMethod;\n}\n\nfunction setFormMode(mode) {\n console.warn(\n \"Please replace `Turbo.setFormMode(mode)` with `Turbo.config.forms.mode = mode`. The top-level function is deprecated and will be removed in a future version of Turbo.`\"\n );\n config.forms.mode = mode;\n}\n\nvar Turbo = /*#__PURE__*/Object.freeze({\n __proto__: null,\n navigator: navigator$1,\n session: session,\n cache: cache,\n PageRenderer: PageRenderer,\n PageSnapshot: PageSnapshot,\n FrameRenderer: FrameRenderer,\n fetch: fetchWithTurboHeaders,\n config: config,\n start: start,\n registerAdapter: registerAdapter,\n visit: visit,\n connectStreamSource: connectStreamSource,\n disconnectStreamSource: disconnectStreamSource,\n renderStreamMessage: renderStreamMessage,\n clearCache: clearCache,\n setProgressBarDelay: setProgressBarDelay,\n setConfirmMethod: setConfirmMethod,\n setFormMode: setFormMode\n});\n\nclass TurboFrameMissingError extends Error {}\n\nclass FrameController {\n fetchResponseLoaded = (_fetchResponse) => Promise.resolve()\n #currentFetchRequest = null\n #resolveVisitPromise = () => {}\n #connected = false\n #hasBeenLoaded = false\n #ignoredAttributes = new Set()\n #shouldMorphFrame = false\n action = null\n\n constructor(element) {\n this.element = element;\n this.view = new FrameView(this, this.element);\n this.appearanceObserver = new AppearanceObserver(this, this.element);\n this.formLinkClickObserver = new FormLinkClickObserver(this, this.element);\n this.linkInterceptor = new LinkInterceptor(this, this.element);\n this.restorationIdentifier = uuid();\n this.formSubmitObserver = new FormSubmitObserver(this, this.element);\n }\n\n // Frame delegate\n\n connect() {\n if (!this.#connected) {\n this.#connected = true;\n if (this.loadingStyle == FrameLoadingStyle.lazy) {\n this.appearanceObserver.start();\n } else {\n this.#loadSourceURL();\n }\n this.formLinkClickObserver.start();\n this.linkInterceptor.start();\n this.formSubmitObserver.start();\n }\n }\n\n disconnect() {\n if (this.#connected) {\n this.#connected = false;\n this.appearanceObserver.stop();\n this.formLinkClickObserver.stop();\n this.linkInterceptor.stop();\n this.formSubmitObserver.stop();\n }\n }\n\n disabledChanged() {\n if (this.loadingStyle == FrameLoadingStyle.eager) {\n this.#loadSourceURL();\n }\n }\n\n sourceURLChanged() {\n if (this.#isIgnoringChangesTo(\"src\")) return\n\n if (this.element.isConnected) {\n this.complete = false;\n }\n\n if (this.loadingStyle == FrameLoadingStyle.eager || this.#hasBeenLoaded) {\n this.#loadSourceURL();\n }\n }\n\n sourceURLReloaded() {\n const { refresh, src } = this.element;\n\n this.#shouldMorphFrame = src && refresh === \"morph\";\n\n this.element.removeAttribute(\"complete\");\n this.element.src = null;\n this.element.src = src;\n return this.element.loaded\n }\n\n loadingStyleChanged() {\n if (this.loadingStyle == FrameLoadingStyle.lazy) {\n this.appearanceObserver.start();\n } else {\n this.appearanceObserver.stop();\n this.#loadSourceURL();\n }\n }\n\n async #loadSourceURL() {\n if (this.enabled && this.isActive && !this.complete && this.sourceURL) {\n this.element.loaded = this.#visit(expandURL(this.sourceURL));\n this.appearanceObserver.stop();\n await this.element.loaded;\n this.#hasBeenLoaded = true;\n }\n }\n\n async loadResponse(fetchResponse) {\n if (fetchResponse.redirected || (fetchResponse.succeeded && fetchResponse.isHTML)) {\n this.sourceURL = fetchResponse.response.url;\n }\n\n try {\n const html = await fetchResponse.responseHTML;\n if (html) {\n const document = parseHTMLDocument(html);\n const pageSnapshot = PageSnapshot.fromDocument(document);\n\n if (pageSnapshot.isVisitable) {\n await this.#loadFrameResponse(fetchResponse, document);\n } else {\n await this.#handleUnvisitableFrameResponse(fetchResponse);\n }\n }\n } finally {\n this.#shouldMorphFrame = false;\n this.fetchResponseLoaded = () => Promise.resolve();\n }\n }\n\n // Appearance observer delegate\n\n elementAppearedInViewport(element) {\n this.proposeVisitIfNavigatedWithAction(element, getVisitAction(element));\n this.#loadSourceURL();\n }\n\n // Form link click observer delegate\n\n willSubmitFormLinkToLocation(link) {\n return this.#shouldInterceptNavigation(link)\n }\n\n submittedFormLinkToLocation(link, _location, form) {\n const frame = this.#findFrameElement(link);\n if (frame) form.setAttribute(\"data-turbo-frame\", frame.id);\n }\n\n // Link interceptor delegate\n\n shouldInterceptLinkClick(element, _location, _event) {\n return this.#shouldInterceptNavigation(element)\n }\n\n linkClickIntercepted(element, location) {\n this.#navigateFrame(element, location);\n }\n\n // Form submit observer delegate\n\n willSubmitForm(element, submitter) {\n return element.closest(\"turbo-frame\") == this.element && this.#shouldInterceptNavigation(element, submitter)\n }\n\n formSubmitted(element, submitter) {\n if (this.formSubmission) {\n this.formSubmission.stop();\n }\n\n this.formSubmission = new FormSubmission(this, element, submitter);\n const { fetchRequest } = this.formSubmission;\n this.prepareRequest(fetchRequest);\n this.formSubmission.start();\n }\n\n // Fetch request delegate\n\n prepareRequest(request) {\n request.headers[\"Turbo-Frame\"] = this.id;\n\n if (this.currentNavigationElement?.hasAttribute(\"data-turbo-stream\")) {\n request.acceptResponseType(StreamMessage.contentType);\n }\n }\n\n requestStarted(_request) {\n markAsBusy(this.element);\n }\n\n requestPreventedHandlingResponse(_request, _response) {\n this.#resolveVisitPromise();\n }\n\n async requestSucceededWithResponse(request, response) {\n await this.loadResponse(response);\n this.#resolveVisitPromise();\n }\n\n async requestFailedWithResponse(request, response) {\n await this.loadResponse(response);\n this.#resolveVisitPromise();\n }\n\n requestErrored(request, error) {\n console.error(error);\n this.#resolveVisitPromise();\n }\n\n requestFinished(_request) {\n clearBusyState(this.element);\n }\n\n // Form submission delegate\n\n formSubmissionStarted({ formElement }) {\n markAsBusy(formElement, this.#findFrameElement(formElement));\n }\n\n formSubmissionSucceededWithResponse(formSubmission, response) {\n const frame = this.#findFrameElement(formSubmission.formElement, formSubmission.submitter);\n\n frame.delegate.proposeVisitIfNavigatedWithAction(frame, getVisitAction(formSubmission.submitter, formSubmission.formElement, frame));\n frame.delegate.loadResponse(response);\n\n if (!formSubmission.isSafe) {\n session.clearCache();\n }\n }\n\n formSubmissionFailedWithResponse(formSubmission, fetchResponse) {\n this.element.delegate.loadResponse(fetchResponse);\n session.clearCache();\n }\n\n formSubmissionErrored(formSubmission, error) {\n console.error(error);\n }\n\n formSubmissionFinished({ formElement }) {\n clearBusyState(formElement, this.#findFrameElement(formElement));\n }\n\n // View delegate\n\n allowsImmediateRender({ element: newFrame }, options) {\n const event = dispatch(\"turbo:before-frame-render\", {\n target: this.element,\n detail: { newFrame, ...options },\n cancelable: true\n });\n\n const {\n defaultPrevented,\n detail: { render }\n } = event;\n\n if (this.view.renderer && render) {\n this.view.renderer.renderElement = render;\n }\n\n return !defaultPrevented\n }\n\n viewRenderedSnapshot(_snapshot, _isPreview, _renderMethod) {}\n\n preloadOnLoadLinksForView(element) {\n session.preloadOnLoadLinksForView(element);\n }\n\n viewInvalidated() {}\n\n // Frame renderer delegate\n\n willRenderFrame(currentElement, _newElement) {\n this.previousFrameElement = currentElement.cloneNode(true);\n }\n\n visitCachedSnapshot = ({ element }) => {\n const frame = element.querySelector(\"#\" + this.element.id);\n\n if (frame && this.previousFrameElement) {\n frame.replaceChildren(...this.previousFrameElement.children);\n }\n\n delete this.previousFrameElement;\n }\n\n // Private\n\n async #loadFrameResponse(fetchResponse, document) {\n const newFrameElement = await this.extractForeignFrameElement(document.body);\n const rendererClass = this.#shouldMorphFrame ? MorphingFrameRenderer : FrameRenderer;\n\n if (newFrameElement) {\n const snapshot = new Snapshot(newFrameElement);\n const renderer = new rendererClass(this, this.view.snapshot, snapshot, false, false);\n if (this.view.renderPromise) await this.view.renderPromise;\n this.changeHistory();\n\n await this.view.render(renderer);\n this.complete = true;\n session.frameRendered(fetchResponse, this.element);\n session.frameLoaded(this.element);\n await this.fetchResponseLoaded(fetchResponse);\n } else if (this.#willHandleFrameMissingFromResponse(fetchResponse)) {\n this.#handleFrameMissingFromResponse(fetchResponse);\n }\n }\n\n async #visit(url) {\n const request = new FetchRequest(this, FetchMethod.get, url, new URLSearchParams(), this.element);\n\n this.#currentFetchRequest?.cancel();\n this.#currentFetchRequest = request;\n\n return new Promise((resolve) => {\n this.#resolveVisitPromise = () => {\n this.#resolveVisitPromise = () => {};\n this.#currentFetchRequest = null;\n resolve();\n };\n request.perform();\n })\n }\n\n #navigateFrame(element, url, submitter) {\n const frame = this.#findFrameElement(element, submitter);\n\n frame.delegate.proposeVisitIfNavigatedWithAction(frame, getVisitAction(submitter, element, frame));\n\n this.#withCurrentNavigationElement(element, () => {\n frame.src = url;\n });\n }\n\n proposeVisitIfNavigatedWithAction(frame, action = null) {\n this.action = action;\n\n if (this.action) {\n const pageSnapshot = PageSnapshot.fromElement(frame).clone();\n const { visitCachedSnapshot } = frame.delegate;\n\n frame.delegate.fetchResponseLoaded = async (fetchResponse) => {\n if (frame.src) {\n const { statusCode, redirected } = fetchResponse;\n const responseHTML = await fetchResponse.responseHTML;\n const response = { statusCode, redirected, responseHTML };\n const options = {\n response,\n visitCachedSnapshot,\n willRender: false,\n updateHistory: false,\n restorationIdentifier: this.restorationIdentifier,\n snapshot: pageSnapshot\n };\n\n if (this.action) options.action = this.action;\n\n session.visit(frame.src, options);\n }\n };\n }\n }\n\n changeHistory() {\n if (this.action) {\n const method = getHistoryMethodForAction(this.action);\n session.history.update(method, expandURL(this.element.src || \"\"), this.restorationIdentifier);\n }\n }\n\n async #handleUnvisitableFrameResponse(fetchResponse) {\n console.warn(\n `The response (${fetchResponse.statusCode}) from <turbo-frame id=\"${this.element.id}\"> is performing a full page visit due to turbo-visit-control.`\n );\n\n await this.#visitResponse(fetchResponse.response);\n }\n\n #willHandleFrameMissingFromResponse(fetchResponse) {\n this.element.setAttribute(\"complete\", \"\");\n\n const response = fetchResponse.response;\n const visit = async (url, options) => {\n if (url instanceof Response) {\n this.#visitResponse(url);\n } else {\n session.visit(url, options);\n }\n };\n\n const event = dispatch(\"turbo:frame-missing\", {\n target: this.element,\n detail: { response, visit },\n cancelable: true\n });\n\n return !event.defaultPrevented\n }\n\n #handleFrameMissingFromResponse(fetchResponse) {\n this.view.missing();\n this.#throwFrameMissingError(fetchResponse);\n }\n\n #throwFrameMissingError(fetchResponse) {\n const message = `The response (${fetchResponse.statusCode}) did not contain the expected <turbo-frame id=\"${this.element.id}\"> and will be ignored. To perform a full page visit instead, set turbo-visit-control to reload.`;\n throw new TurboFrameMissingError(message)\n }\n\n async #visitResponse(response) {\n const wrapped = new FetchResponse(response);\n const responseHTML = await wrapped.responseHTML;\n const { location, redirected, statusCode } = wrapped;\n\n return session.visit(location, { response: { redirected, statusCode, responseHTML } })\n }\n\n #findFrameElement(element, submitter) {\n const id = getAttribute(\"data-turbo-frame\", submitter, element) || this.element.getAttribute(\"target\");\n return getFrameElementById(id) ?? this.element\n }\n\n async extractForeignFrameElement(container) {\n let element;\n const id = CSS.escape(this.id);\n\n try {\n element = activateElement(container.querySelector(`turbo-frame#${id}`), this.sourceURL);\n if (element) {\n return element\n }\n\n element = activateElement(container.querySelector(`turbo-frame[src][recurse~=${id}]`), this.sourceURL);\n if (element) {\n await element.loaded;\n return await this.extractForeignFrameElement(element)\n }\n } catch (error) {\n console.error(error);\n return new FrameElement()\n }\n\n return null\n }\n\n #formActionIsVisitable(form, submitter) {\n const action = getAction$1(form, submitter);\n\n return locationIsVisitable(expandURL(action), this.rootLocation)\n }\n\n #shouldInterceptNavigation(element, submitter) {\n const id = getAttribute(\"data-turbo-frame\", submitter, element) || this.element.getAttribute(\"target\");\n\n if (element instanceof HTMLFormElement && !this.#formActionIsVisitable(element, submitter)) {\n return false\n }\n\n if (!this.enabled || id == \"_top\") {\n return false\n }\n\n if (id) {\n const frameElement = getFrameElementById(id);\n if (frameElement) {\n return !frameElement.disabled\n }\n }\n\n if (!session.elementIsNavigatable(element)) {\n return false\n }\n\n if (submitter && !session.elementIsNavigatable(submitter)) {\n return false\n }\n\n return true\n }\n\n // Computed properties\n\n get id() {\n return this.element.id\n }\n\n get enabled() {\n return !this.element.disabled\n }\n\n get sourceURL() {\n if (this.element.src) {\n return this.element.src\n }\n }\n\n set sourceURL(sourceURL) {\n this.#ignoringChangesToAttribute(\"src\", () => {\n this.element.src = sourceURL ?? null;\n });\n }\n\n get loadingStyle() {\n return this.element.loading\n }\n\n get isLoading() {\n return this.formSubmission !== undefined || this.#resolveVisitPromise() !== undefined\n }\n\n get complete() {\n return this.element.hasAttribute(\"complete\")\n }\n\n set complete(value) {\n if (value) {\n this.element.setAttribute(\"complete\", \"\");\n } else {\n this.element.removeAttribute(\"complete\");\n }\n }\n\n get isActive() {\n return this.element.isActive && this.#connected\n }\n\n get rootLocation() {\n const meta = this.element.ownerDocument.querySelector(`meta[name=\"turbo-root\"]`);\n const root = meta?.content ?? \"/\";\n return expandURL(root)\n }\n\n #isIgnoringChangesTo(attributeName) {\n return this.#ignoredAttributes.has(attributeName)\n }\n\n #ignoringChangesToAttribute(attributeName, callback) {\n this.#ignoredAttributes.add(attributeName);\n callback();\n this.#ignoredAttributes.delete(attributeName);\n }\n\n #withCurrentNavigationElement(element, callback) {\n this.currentNavigationElement = element;\n callback();\n delete this.currentNavigationElement;\n }\n}\n\nfunction getFrameElementById(id) {\n if (id != null) {\n const element = document.getElementById(id);\n if (element instanceof FrameElement) {\n return element\n }\n }\n}\n\nfunction activateElement(element, currentURL) {\n if (element) {\n const src = element.getAttribute(\"src\");\n if (src != null && currentURL != null && urlsAreEqual(src, currentURL)) {\n throw new Error(`Matching <turbo-frame id=\"${element.id}\"> element has a source URL which references itself`)\n }\n if (element.ownerDocument !== document) {\n element = document.importNode(element, true);\n }\n\n if (element instanceof FrameElement) {\n element.connectedCallback();\n element.disconnectedCallback();\n return element\n }\n }\n}\n\nconst StreamActions = {\n after() {\n this.targetElements.forEach((e) => e.parentElement?.insertBefore(this.templateContent, e.nextSibling));\n },\n\n append() {\n this.removeDuplicateTargetChildren();\n this.targetElements.forEach((e) => e.append(this.templateContent));\n },\n\n before() {\n this.targetElements.forEach((e) => e.parentElement?.insertBefore(this.templateContent, e));\n },\n\n prepend() {\n this.removeDuplicateTargetChildren();\n this.targetElements.forEach((e) => e.prepend(this.templateContent));\n },\n\n remove() {\n this.targetElements.forEach((e) => e.remove());\n },\n\n replace() {\n const method = this.getAttribute(\"method\");\n\n this.targetElements.forEach((targetElement) => {\n if (method === \"morph\") {\n morphElements(targetElement, this.templateContent);\n } else {\n targetElement.replaceWith(this.templateContent);\n }\n });\n },\n\n update() {\n const method = this.getAttribute(\"method\");\n\n this.targetElements.forEach((targetElement) => {\n if (method === \"morph\") {\n morphChildren(targetElement, this.templateContent);\n } else {\n targetElement.innerHTML = \"\";\n targetElement.append(this.templateContent);\n }\n });\n },\n\n refresh() {\n session.refresh(this.baseURI, this.requestId);\n }\n};\n\n// <turbo-stream action=replace target=id><template>...\n\n/**\n * Renders updates to the page from a stream of messages.\n *\n * Using the `action` attribute, this can be configured one of eight ways:\n *\n * - `after` - inserts the result after the target\n * - `append` - appends the result to the target\n * - `before` - inserts the result before the target\n * - `prepend` - prepends the result to the target\n * - `refresh` - initiates a page refresh\n * - `remove` - removes the target\n * - `replace` - replaces the outer HTML of the target\n * - `update` - replaces the inner HTML of the target\n *\n * @customElement turbo-stream\n * @example\n * <turbo-stream action=\"append\" target=\"dom_id\">\n * <template>\n * Content to append to target designated with the dom_id.\n * </template>\n * </turbo-stream>\n */\nclass StreamElement extends HTMLElement {\n static async renderElement(newElement) {\n await newElement.performAction();\n }\n\n async connectedCallback() {\n try {\n await this.render();\n } catch (error) {\n console.error(error);\n } finally {\n this.disconnect();\n }\n }\n\n async render() {\n return (this.renderPromise ??= (async () => {\n const event = this.beforeRenderEvent;\n\n if (this.dispatchEvent(event)) {\n await nextRepaint();\n await event.detail.render(this);\n }\n })())\n }\n\n disconnect() {\n try {\n this.remove();\n // eslint-disable-next-line no-empty\n } catch {}\n }\n\n /**\n * Removes duplicate children (by ID)\n */\n removeDuplicateTargetChildren() {\n this.duplicateChildren.forEach((c) => c.remove());\n }\n\n /**\n * Gets the list of duplicate children (i.e. those with the same ID)\n */\n get duplicateChildren() {\n const existingChildren = this.targetElements.flatMap((e) => [...e.children]).filter((c) => !!c.id);\n const newChildrenIds = [...(this.templateContent?.children || [])].filter((c) => !!c.id).map((c) => c.id);\n\n return existingChildren.filter((c) => newChildrenIds.includes(c.id))\n }\n\n /**\n * Gets the action function to be performed.\n */\n get performAction() {\n if (this.action) {\n const actionFunction = StreamActions[this.action];\n if (actionFunction) {\n return actionFunction\n }\n this.#raise(\"unknown action\");\n }\n this.#raise(\"action attribute is missing\");\n }\n\n /**\n * Gets the target elements which the template will be rendered to.\n */\n get targetElements() {\n if (this.target) {\n return this.targetElementsById\n } else if (this.targets) {\n return this.targetElementsByQuery\n } else {\n this.#raise(\"target or targets attribute is missing\");\n }\n }\n\n /**\n * Gets the contents of the main `<template>`.\n */\n get templateContent() {\n return this.templateElement.content.cloneNode(true)\n }\n\n /**\n * Gets the main `<template>` used for rendering\n */\n get templateElement() {\n if (this.firstElementChild === null) {\n const template = this.ownerDocument.createElement(\"template\");\n this.appendChild(template);\n return template\n } else if (this.firstElementChild instanceof HTMLTemplateElement) {\n return this.firstElementChild\n }\n this.#raise(\"first child element must be a <template> element\");\n }\n\n /**\n * Gets the current action.\n */\n get action() {\n return this.getAttribute(\"action\")\n }\n\n /**\n * Gets the current target (an element ID) to which the result will\n * be rendered.\n */\n get target() {\n return this.getAttribute(\"target\")\n }\n\n /**\n * Gets the current \"targets\" selector (a CSS selector)\n */\n get targets() {\n return this.getAttribute(\"targets\")\n }\n\n /**\n * Reads the request-id attribute\n */\n get requestId() {\n return this.getAttribute(\"request-id\")\n }\n\n #raise(message) {\n throw new Error(`${this.description}: ${message}`)\n }\n\n get description() {\n return (this.outerHTML.match(/<[^>]+>/) ?? [])[0] ?? \"<turbo-stream>\"\n }\n\n get beforeRenderEvent() {\n return new CustomEvent(\"turbo:before-stream-render\", {\n bubbles: true,\n cancelable: true,\n detail: { newStream: this, render: StreamElement.renderElement }\n })\n }\n\n get targetElementsById() {\n const element = this.ownerDocument?.getElementById(this.target);\n\n if (element !== null) {\n return [element]\n } else {\n return []\n }\n }\n\n get targetElementsByQuery() {\n const elements = this.ownerDocument?.querySelectorAll(this.targets);\n\n if (elements.length !== 0) {\n return Array.prototype.slice.call(elements)\n } else {\n return []\n }\n }\n}\n\nclass StreamSourceElement extends HTMLElement {\n streamSource = null\n\n connectedCallback() {\n this.streamSource = this.src.match(/^ws{1,2}:/) ? new WebSocket(this.src) : new EventSource(this.src);\n\n connectStreamSource(this.streamSource);\n }\n\n disconnectedCallback() {\n if (this.streamSource) {\n this.streamSource.close();\n\n disconnectStreamSource(this.streamSource);\n }\n }\n\n get src() {\n return this.getAttribute(\"src\") || \"\"\n }\n}\n\nFrameElement.delegateConstructor = FrameController;\n\nif (customElements.get(\"turbo-frame\") === undefined) {\n customElements.define(\"turbo-frame\", FrameElement);\n}\n\nif (customElements.get(\"turbo-stream\") === undefined) {\n customElements.define(\"turbo-stream\", StreamElement);\n}\n\nif (customElements.get(\"turbo-stream-source\") === undefined) {\n customElements.define(\"turbo-stream-source\", StreamSourceElement);\n}\n\n(() => {\n let element = document.currentScript;\n if (!element) return\n if (element.hasAttribute(\"data-turbo-suppress-warning\")) return\n\n element = element.parentElement;\n while (element) {\n if (element == document.body) {\n return console.warn(\n unindent`\n You are loading Turbo from a <script> element inside the <body> element. This is probably not what you meant to do!\n\n Load your application\u2019s JavaScript bundle inside the <head> element instead. <script> elements in <body> are evaluated with each page change.\n\n For more information, see: https://turbo.hotwired.dev/handbook/building#working-with-script-elements\n\n \u2014\u2014\n Suppress this warning by adding a \"data-turbo-suppress-warning\" attribute to: %s\n `,\n element.outerHTML\n )\n }\n\n element = element.parentElement;\n }\n})();\n\nwindow.Turbo = { ...Turbo, StreamActions };\nstart();\n\nexport { FetchEnctype, FetchMethod, FetchRequest, FetchResponse, FrameElement, FrameLoadingStyle, FrameRenderer, PageRenderer, PageSnapshot, StreamActions, StreamElement, StreamSourceElement, cache, clearCache, config, connectStreamSource, disconnectStreamSource, fetchWithTurboHeaders as fetch, fetchEnctypeFromString, fetchMethodFromString, isSafe, navigator$1 as navigator, registerAdapter, renderStreamMessage, session, setConfirmMethod, setFormMode, setProgressBarDelay, start, visit };\n", "let consumer\n\nexport async function getConsumer() {\n return consumer || setConsumer(createConsumer().then(setConsumer))\n}\n\nexport function setConsumer(newConsumer) {\n return consumer = newConsumer\n}\n\nexport async function createConsumer() {\n const { createConsumer } = await import(/* webpackChunkName: \"actioncable\" */ \"@rails/actioncable/src\")\n return createConsumer()\n}\n\nexport async function subscribeTo(channel, mixin) {\n const { subscriptions } = await getConsumer()\n return subscriptions.create(channel, mixin)\n}\n", "// Based on https://github.com/nathan7/snakeize\n//\n// This software is released under the MIT license:\n// Permission is hereby granted, free of charge, to any person obtaining a copy of\n// this software and associated documentation files (the \"Software\"), to deal in\n// the Software without restriction, including without limitation the rights to\n// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n// the Software, and to permit persons to whom the Software is furnished to do so,\n// subject to the following conditions:\n\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\nexport default function walk (obj) {\n if (!obj || typeof obj !== 'object') return obj;\n if (obj instanceof Date || obj instanceof RegExp) return obj;\n if (Array.isArray(obj)) return obj.map(walk);\n return Object.keys(obj).reduce(function (acc, key) {\n var camel = key[0].toLowerCase() + key.slice(1).replace(/([A-Z]+)/g, function (m, x) {\n return '_' + x.toLowerCase();\n });\n acc[camel] = walk(obj[key]);\n return acc;\n }, {});\n};", "import { connectStreamSource, disconnectStreamSource } from \"@hotwired/turbo\"\nimport { subscribeTo } from \"./cable\"\nimport snakeize from \"./snakeize\"\n\nclass TurboCableStreamSourceElement extends HTMLElement {\n static observedAttributes = [\"channel\", \"signed-stream-name\"]\n\n async connectedCallback() {\n connectStreamSource(this)\n this.subscription = await subscribeTo(this.channel, {\n received: this.dispatchMessageEvent.bind(this),\n connected: this.subscriptionConnected.bind(this),\n disconnected: this.subscriptionDisconnected.bind(this)\n })\n }\n\n disconnectedCallback() {\n disconnectStreamSource(this)\n if (this.subscription) this.subscription.unsubscribe()\n this.subscriptionDisconnected()\n }\n\n attributeChangedCallback() {\n if (this.subscription) {\n this.disconnectedCallback()\n this.connectedCallback()\n }\n }\n\n dispatchMessageEvent(data) {\n const event = new MessageEvent(\"message\", { data })\n return this.dispatchEvent(event)\n }\n\n subscriptionConnected() {\n this.setAttribute(\"connected\", \"\")\n }\n\n subscriptionDisconnected() {\n this.removeAttribute(\"connected\")\n }\n\n get channel() {\n const channel = this.getAttribute(\"channel\")\n const signed_stream_name = this.getAttribute(\"signed-stream-name\")\n return { channel, signed_stream_name, ...snakeize({ ...this.dataset }) }\n }\n}\n\n\nif (customElements.get(\"turbo-cable-stream-source\") === undefined) {\n customElements.define(\"turbo-cable-stream-source\", TurboCableStreamSourceElement)\n}\n", "export function encodeMethodIntoRequestBody(event) {\n if (event.target instanceof HTMLFormElement) {\n const { target: form, detail: { fetchOptions } } = event\n\n form.addEventListener(\"turbo:submit-start\", ({ detail: { formSubmission: { submitter } } }) => {\n const body = isBodyInit(fetchOptions.body) ? fetchOptions.body : new URLSearchParams()\n const method = determineFetchMethod(submitter, body, form)\n\n if (!/get/i.test(method)) {\n if (/post/i.test(method)) {\n body.delete(\"_method\")\n } else {\n body.set(\"_method\", method)\n }\n\n fetchOptions.method = \"post\"\n }\n }, { once: true })\n }\n}\n\nfunction determineFetchMethod(submitter, body, form) {\n const formMethod = determineFormMethod(submitter)\n const overrideMethod = body.get(\"_method\")\n const method = form.getAttribute(\"method\") || \"get\"\n\n if (typeof formMethod == \"string\") {\n return formMethod\n } else if (typeof overrideMethod == \"string\") {\n return overrideMethod\n } else {\n return method\n }\n}\n\nfunction determineFormMethod(submitter) {\n if (submitter instanceof HTMLButtonElement || submitter instanceof HTMLInputElement) {\n // Rails 7 ActionView::Helpers::FormBuilder#button method has an override\n // for formmethod if the button does not have name or value attributes\n // set, which is the default. This means that if you use <%= f.button\n // formmethod: :delete %>, it will generate a <button name=\"_method\"\n // value=\"delete\" formmethod=\"post\">. Therefore, if the submitter's name\n // is already _method, it's value attribute already contains the desired\n // method.\n if (submitter.name === '_method') {\n return submitter.value\n } else if (submitter.hasAttribute(\"formmethod\")) {\n return submitter.formMethod\n } else {\n return null\n }\n } else {\n return null\n }\n}\n\nfunction isBodyInit(body) {\n return body instanceof FormData || body instanceof URLSearchParams\n}\n", "import \"./cable_stream_source_element\"\n\nimport * as Turbo from \"@hotwired/turbo\"\nexport { Turbo }\n\nimport * as cable from \"./cable\"\nexport { cable }\n\nimport { encodeMethodIntoRequestBody } from \"./fetch_requests\"\n\nwindow.Turbo = Turbo\n\naddEventListener(\"turbo:before-fetch-request\", encodeMethodIntoRequestBody)\n", "/*\nStimulus 3.2.1\nCopyright \u00A9 2023 Basecamp, LLC\n */\nclass EventListener {\n constructor(eventTarget, eventName, eventOptions) {\n this.eventTarget = eventTarget;\n this.eventName = eventName;\n this.eventOptions = eventOptions;\n this.unorderedBindings = new Set();\n }\n connect() {\n this.eventTarget.addEventListener(this.eventName, this, this.eventOptions);\n }\n disconnect() {\n this.eventTarget.removeEventListener(this.eventName, this, this.eventOptions);\n }\n bindingConnected(binding) {\n this.unorderedBindings.add(binding);\n }\n bindingDisconnected(binding) {\n this.unorderedBindings.delete(binding);\n }\n handleEvent(event) {\n const extendedEvent = extendEvent(event);\n for (const binding of this.bindings) {\n if (extendedEvent.immediatePropagationStopped) {\n break;\n }\n else {\n binding.handleEvent(extendedEvent);\n }\n }\n }\n hasBindings() {\n return this.unorderedBindings.size > 0;\n }\n get bindings() {\n return Array.from(this.unorderedBindings).sort((left, right) => {\n const leftIndex = left.index, rightIndex = right.index;\n return leftIndex < rightIndex ? -1 : leftIndex > rightIndex ? 1 : 0;\n });\n }\n}\nfunction extendEvent(event) {\n if (\"immediatePropagationStopped\" in event) {\n return event;\n }\n else {\n const { stopImmediatePropagation } = event;\n return Object.assign(event, {\n immediatePropagationStopped: false,\n stopImmediatePropagation() {\n this.immediatePropagationStopped = true;\n stopImmediatePropagation.call(this);\n },\n });\n }\n}\n\nclass Dispatcher {\n constructor(application) {\n this.application = application;\n this.eventListenerMaps = new Map();\n this.started = false;\n }\n start() {\n if (!this.started) {\n this.started = true;\n this.eventListeners.forEach((eventListener) => eventListener.connect());\n }\n }\n stop() {\n if (this.started) {\n this.started = false;\n this.eventListeners.forEach((eventListener) => eventListener.disconnect());\n }\n }\n get eventListeners() {\n return Array.from(this.eventListenerMaps.values()).reduce((listeners, map) => listeners.concat(Array.from(map.values())), []);\n }\n bindingConnected(binding) {\n this.fetchEventListenerForBinding(binding).bindingConnected(binding);\n }\n bindingDisconnected(binding, clearEventListeners = false) {\n this.fetchEventListenerForBinding(binding).bindingDisconnected(binding);\n if (clearEventListeners)\n this.clearEventListenersForBinding(binding);\n }\n handleError(error, message, detail = {}) {\n this.application.handleError(error, `Error ${message}`, detail);\n }\n clearEventListenersForBinding(binding) {\n const eventListener = this.fetchEventListenerForBinding(binding);\n if (!eventListener.hasBindings()) {\n eventListener.disconnect();\n this.removeMappedEventListenerFor(binding);\n }\n }\n removeMappedEventListenerFor(binding) {\n const { eventTarget, eventName, eventOptions } = binding;\n const eventListenerMap = this.fetchEventListenerMapForEventTarget(eventTarget);\n const cacheKey = this.cacheKey(eventName, eventOptions);\n eventListenerMap.delete(cacheKey);\n if (eventListenerMap.size == 0)\n this.eventListenerMaps.delete(eventTarget);\n }\n fetchEventListenerForBinding(binding) {\n const { eventTarget, eventName, eventOptions } = binding;\n return this.fetchEventListener(eventTarget, eventName, eventOptions);\n }\n fetchEventListener(eventTarget, eventName, eventOptions) {\n const eventListenerMap = this.fetchEventListenerMapForEventTarget(eventTarget);\n const cacheKey = this.cacheKey(eventName, eventOptions);\n let eventListener = eventListenerMap.get(cacheKey);\n if (!eventListener) {\n eventListener = this.createEventListener(eventTarget, eventName, eventOptions);\n eventListenerMap.set(cacheKey, eventListener);\n }\n return eventListener;\n }\n createEventListener(eventTarget, eventName, eventOptions) {\n const eventListener = new EventListener(eventTarget, eventName, eventOptions);\n if (this.started) {\n eventListener.connect();\n }\n return eventListener;\n }\n fetchEventListenerMapForEventTarget(eventTarget) {\n let eventListenerMap = this.eventListenerMaps.get(eventTarget);\n if (!eventListenerMap) {\n eventListenerMap = new Map();\n this.eventListenerMaps.set(eventTarget, eventListenerMap);\n }\n return eventListenerMap;\n }\n cacheKey(eventName, eventOptions) {\n const parts = [eventName];\n Object.keys(eventOptions)\n .sort()\n .forEach((key) => {\n parts.push(`${eventOptions[key] ? \"\" : \"!\"}${key}`);\n });\n return parts.join(\":\");\n }\n}\n\nconst defaultActionDescriptorFilters = {\n stop({ event, value }) {\n if (value)\n event.stopPropagation();\n return true;\n },\n prevent({ event, value }) {\n if (value)\n event.preventDefault();\n return true;\n },\n self({ event, value, element }) {\n if (value) {\n return element === event.target;\n }\n else {\n return true;\n }\n },\n};\nconst descriptorPattern = /^(?:(?:([^.]+?)\\+)?(.+?)(?:\\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;\nfunction parseActionDescriptorString(descriptorString) {\n const source = descriptorString.trim();\n const matches = source.match(descriptorPattern) || [];\n let eventName = matches[2];\n let keyFilter = matches[3];\n if (keyFilter && ![\"keydown\", \"keyup\", \"keypress\"].includes(eventName)) {\n eventName += `.${keyFilter}`;\n keyFilter = \"\";\n }\n return {\n eventTarget: parseEventTarget(matches[4]),\n eventName,\n eventOptions: matches[7] ? parseEventOptions(matches[7]) : {},\n identifier: matches[5],\n methodName: matches[6],\n keyFilter: matches[1] || keyFilter,\n };\n}\nfunction parseEventTarget(eventTargetName) {\n if (eventTargetName == \"window\") {\n return window;\n }\n else if (eventTargetName == \"document\") {\n return document;\n }\n}\nfunction parseEventOptions(eventOptions) {\n return eventOptions\n .split(\":\")\n .reduce((options, token) => Object.assign(options, { [token.replace(/^!/, \"\")]: !/^!/.test(token) }), {});\n}\nfunction stringifyEventTarget(eventTarget) {\n if (eventTarget == window) {\n return \"window\";\n }\n else if (eventTarget == document) {\n return \"document\";\n }\n}\n\nfunction camelize(value) {\n return value.replace(/(?:[_-])([a-z0-9])/g, (_, char) => char.toUpperCase());\n}\nfunction namespaceCamelize(value) {\n return camelize(value.replace(/--/g, \"-\").replace(/__/g, \"_\"));\n}\nfunction capitalize(value) {\n return value.charAt(0).toUpperCase() + value.slice(1);\n}\nfunction dasherize(value) {\n return value.replace(/([A-Z])/g, (_, char) => `-${char.toLowerCase()}`);\n}\nfunction tokenize(value) {\n return value.match(/[^\\s]+/g) || [];\n}\n\nfunction isSomething(object) {\n return object !== null && object !== undefined;\n}\nfunction hasProperty(object, property) {\n return Object.prototype.hasOwnProperty.call(object, property);\n}\n\nconst allModifiers = [\"meta\", \"ctrl\", \"alt\", \"shift\"];\nclass Action {\n constructor(element, index, descriptor, schema) {\n this.element = element;\n this.index = index;\n this.eventTarget = descriptor.eventTarget || element;\n this.eventName = descriptor.eventName || getDefaultEventNameForElement(element) || error(\"missing event name\");\n this.eventOptions = descriptor.eventOptions || {};\n this.identifier = descriptor.identifier || error(\"missing identifier\");\n this.methodName = descriptor.methodName || error(\"missing method name\");\n this.keyFilter = descriptor.keyFilter || \"\";\n this.schema = schema;\n }\n static forToken(token, schema) {\n return new this(token.element, token.index, parseActionDescriptorString(token.content), schema);\n }\n toString() {\n const eventFilter = this.keyFilter ? `.${this.keyFilter}` : \"\";\n const eventTarget = this.eventTargetName ? `@${this.eventTargetName}` : \"\";\n return `${this.eventName}${eventFilter}${eventTarget}->${this.identifier}#${this.methodName}`;\n }\n shouldIgnoreKeyboardEvent(event) {\n if (!this.keyFilter) {\n return false;\n }\n const filters = this.keyFilter.split(\"+\");\n if (this.keyFilterDissatisfied(event, filters)) {\n return true;\n }\n const standardFilter = filters.filter((key) => !allModifiers.includes(key))[0];\n if (!standardFilter) {\n return false;\n }\n if (!hasProperty(this.keyMappings, standardFilter)) {\n error(`contains unknown key filter: ${this.keyFilter}`);\n }\n return this.keyMappings[standardFilter].toLowerCase() !== event.key.toLowerCase();\n }\n shouldIgnoreMouseEvent(event) {\n if (!this.keyFilter) {\n return false;\n }\n const filters = [this.keyFilter];\n if (this.keyFilterDissatisfied(event, filters)) {\n return true;\n }\n return false;\n }\n get params() {\n const params = {};\n const pattern = new RegExp(`^data-${this.identifier}-(.+)-param$`, \"i\");\n for (const { name, value } of Array.from(this.element.attributes)) {\n const match = name.match(pattern);\n const key = match && match[1];\n if (key) {\n params[camelize(key)] = typecast(value);\n }\n }\n return params;\n }\n get eventTargetName() {\n return stringifyEventTarget(this.eventTarget);\n }\n get keyMappings() {\n return this.schema.keyMappings;\n }\n keyFilterDissatisfied(event, filters) {\n const [meta, ctrl, alt, shift] = allModifiers.map((modifier) => filters.includes(modifier));\n return event.metaKey !== meta || event.ctrlKey !== ctrl || event.altKey !== alt || event.shiftKey !== shift;\n }\n}\nconst defaultEventNames = {\n a: () => \"click\",\n button: () => \"click\",\n form: () => \"submit\",\n details: () => \"toggle\",\n input: (e) => (e.getAttribute(\"type\") == \"submit\" ? \"click\" : \"input\"),\n select: () => \"change\",\n textarea: () => \"input\",\n};\nfunction getDefaultEventNameForElement(element) {\n const tagName = element.tagName.toLowerCase();\n if (tagName in defaultEventNames) {\n return defaultEventNames[tagName](element);\n }\n}\nfunction error(message) {\n throw new Error(message);\n}\nfunction typecast(value) {\n try {\n return JSON.parse(value);\n }\n catch (o_O) {\n return value;\n }\n}\n\nclass Binding {\n constructor(context, action) {\n this.context = context;\n this.action = action;\n }\n get index() {\n return this.action.index;\n }\n get eventTarget() {\n return this.action.eventTarget;\n }\n get eventOptions() {\n return this.action.eventOptions;\n }\n get identifier() {\n return this.context.identifier;\n }\n handleEvent(event) {\n const actionEvent = this.prepareActionEvent(event);\n if (this.willBeInvokedByEvent(event) && this.applyEventModifiers(actionEvent)) {\n this.invokeWithEvent(actionEvent);\n }\n }\n get eventName() {\n return this.action.eventName;\n }\n get method() {\n const method = this.controller[this.methodName];\n if (typeof method == \"function\") {\n return method;\n }\n throw new Error(`Action \"${this.action}\" references undefined method \"${this.methodName}\"`);\n }\n applyEventModifiers(event) {\n const { element } = this.action;\n const { actionDescriptorFilters } = this.context.application;\n const { controller } = this.context;\n let passes = true;\n for (const [name, value] of Object.entries(this.eventOptions)) {\n if (name in actionDescriptorFilters) {\n const filter = actionDescriptorFilters[name];\n passes = passes && filter({ name, value, event, element, controller });\n }\n else {\n continue;\n }\n }\n return passes;\n }\n prepareActionEvent(event) {\n return Object.assign(event, { params: this.action.params });\n }\n invokeWithEvent(event) {\n const { target, currentTarget } = event;\n try {\n this.method.call(this.controller, event);\n this.context.logDebugActivity(this.methodName, { event, target, currentTarget, action: this.methodName });\n }\n catch (error) {\n const { identifier, controller, element, index } = this;\n const detail = { identifier, controller, element, index, event };\n this.context.handleError(error, `invoking action \"${this.action}\"`, detail);\n }\n }\n willBeInvokedByEvent(event) {\n const eventTarget = event.target;\n if (event instanceof KeyboardEvent && this.action.shouldIgnoreKeyboardEvent(event)) {\n return false;\n }\n if (event instanceof MouseEvent && this.action.shouldIgnoreMouseEvent(event)) {\n return false;\n }\n if (this.element === eventTarget) {\n return true;\n }\n else if (eventTarget instanceof Element && this.element.contains(eventTarget)) {\n return this.scope.containsElement(eventTarget);\n }\n else {\n return this.scope.containsElement(this.action.element);\n }\n }\n get controller() {\n return this.context.controller;\n }\n get methodName() {\n return this.action.methodName;\n }\n get element() {\n return this.scope.element;\n }\n get scope() {\n return this.context.scope;\n }\n}\n\nclass ElementObserver {\n constructor(element, delegate) {\n this.mutationObserverInit = { attributes: true, childList: true, subtree: true };\n this.element = element;\n this.started = false;\n this.delegate = delegate;\n this.elements = new Set();\n this.mutationObserver = new MutationObserver((mutations) => this.processMutations(mutations));\n }\n start() {\n if (!this.started) {\n this.started = true;\n this.mutationObserver.observe(this.element, this.mutationObserverInit);\n this.refresh();\n }\n }\n pause(callback) {\n if (this.started) {\n this.mutationObserver.disconnect();\n this.started = false;\n }\n callback();\n if (!this.started) {\n this.mutationObserver.observe(this.element, this.mutationObserverInit);\n this.started = true;\n }\n }\n stop() {\n if (this.started) {\n this.mutationObserver.takeRecords();\n this.mutationObserver.disconnect();\n this.started = false;\n }\n }\n refresh() {\n if (this.started) {\n const matches = new Set(this.matchElementsInTree());\n for (const element of Array.from(this.elements)) {\n if (!matches.has(element)) {\n this.removeElement(element);\n }\n }\n for (const element of Array.from(matches)) {\n this.addElement(element);\n }\n }\n }\n processMutations(mutations) {\n if (this.started) {\n for (const mutation of mutations) {\n this.processMutation(mutation);\n }\n }\n }\n processMutation(mutation) {\n if (mutation.type == \"attributes\") {\n this.processAttributeChange(mutation.target, mutation.attributeName);\n }\n else if (mutation.type == \"childList\") {\n this.processRemovedNodes(mutation.removedNodes);\n this.processAddedNodes(mutation.addedNodes);\n }\n }\n processAttributeChange(element, attributeName) {\n if (this.elements.has(element)) {\n if (this.delegate.elementAttributeChanged && this.matchElement(element)) {\n this.delegate.elementAttributeChanged(element, attributeName);\n }\n else {\n this.removeElement(element);\n }\n }\n else if (this.matchElement(element)) {\n this.addElement(element);\n }\n }\n processRemovedNodes(nodes) {\n for (const node of Array.from(nodes)) {\n const element = this.elementFromNode(node);\n if (element) {\n this.processTree(element, this.removeElement);\n }\n }\n }\n processAddedNodes(nodes) {\n for (const node of Array.from(nodes)) {\n const element = this.elementFromNode(node);\n if (element && this.elementIsActive(element)) {\n this.processTree(element, this.addElement);\n }\n }\n }\n matchElement(element) {\n return this.delegate.matchElement(element);\n }\n matchElementsInTree(tree = this.element) {\n return this.delegate.matchElementsInTree(tree);\n }\n processTree(tree, processor) {\n for (const element of this.matchElementsInTree(tree)) {\n processor.call(this, element);\n }\n }\n elementFromNode(node) {\n if (node.nodeType == Node.ELEMENT_NODE) {\n return node;\n }\n }\n elementIsActive(element) {\n if (element.isConnected != this.element.isConnected) {\n return false;\n }\n else {\n return this.element.contains(element);\n }\n }\n addElement(element) {\n if (!this.elements.has(element)) {\n if (this.elementIsActive(element)) {\n this.elements.add(element);\n if (this.delegate.elementMatched) {\n this.delegate.elementMatched(element);\n }\n }\n }\n }\n removeElement(element) {\n if (this.elements.has(element)) {\n this.elements.delete(element);\n if (this.delegate.elementUnmatched) {\n this.delegate.elementUnmatched(element);\n }\n }\n }\n}\n\nclass AttributeObserver {\n constructor(element, attributeName, delegate) {\n this.attributeName = attributeName;\n this.delegate = delegate;\n this.elementObserver = new ElementObserver(element, this);\n }\n get element() {\n return this.elementObserver.element;\n }\n get selector() {\n return `[${this.attributeName}]`;\n }\n start() {\n this.elementObserver.start();\n }\n pause(callback) {\n this.elementObserver.pause(callback);\n }\n stop() {\n this.elementObserver.stop();\n }\n refresh() {\n this.elementObserver.refresh();\n }\n get started() {\n return this.elementObserver.started;\n }\n matchElement(element) {\n return element.hasAttribute(this.attributeName);\n }\n matchElementsInTree(tree) {\n const match = this.matchElement(tree) ? [tree] : [];\n const matches = Array.from(tree.querySelectorAll(this.selector));\n return match.concat(matches);\n }\n elementMatched(element) {\n if (this.delegate.elementMatchedAttribute) {\n this.delegate.elementMatchedAttribute(element, this.attributeName);\n }\n }\n elementUnmatched(element) {\n if (this.delegate.elementUnmatchedAttribute) {\n this.delegate.elementUnmatchedAttribute(element, this.attributeName);\n }\n }\n elementAttributeChanged(element, attributeName) {\n if (this.delegate.elementAttributeValueChanged && this.attributeName == attributeName) {\n this.delegate.elementAttributeValueChanged(element, attributeName);\n }\n }\n}\n\nfunction add(map, key, value) {\n fetch(map, key).add(value);\n}\nfunction del(map, key, value) {\n fetch(map, key).delete(value);\n prune(map, key);\n}\nfunction fetch(map, key) {\n let values = map.get(key);\n if (!values) {\n values = new Set();\n map.set(key, values);\n }\n return values;\n}\nfunction prune(map, key) {\n const values = map.get(key);\n if (values != null && values.size == 0) {\n map.delete(key);\n }\n}\n\nclass Multimap {\n constructor() {\n this.valuesByKey = new Map();\n }\n get keys() {\n return Array.from(this.valuesByKey.keys());\n }\n get values() {\n const sets = Array.from(this.valuesByKey.values());\n return sets.reduce((values, set) => values.concat(Array.from(set)), []);\n }\n get size() {\n const sets = Array.from(this.valuesByKey.values());\n return sets.reduce((size, set) => size + set.size, 0);\n }\n add(key, value) {\n add(this.valuesByKey, key, value);\n }\n delete(key, value) {\n del(this.valuesByKey, key, value);\n }\n has(key, value) {\n const values = this.valuesByKey.get(key);\n return values != null && values.has(value);\n }\n hasKey(key) {\n return this.valuesByKey.has(key);\n }\n hasValue(value) {\n const sets = Array.from(this.valuesByKey.values());\n return sets.some((set) => set.has(value));\n }\n getValuesForKey(key) {\n const values = this.valuesByKey.get(key);\n return values ? Array.from(values) : [];\n }\n getKeysForValue(value) {\n return Array.from(this.valuesByKey)\n .filter(([_key, values]) => values.has(value))\n .map(([key, _values]) => key);\n }\n}\n\nclass IndexedMultimap extends Multimap {\n constructor() {\n super();\n this.keysByValue = new Map();\n }\n get values() {\n return Array.from(this.keysByValue.keys());\n }\n add(key, value) {\n super.add(key, value);\n add(this.keysByValue, value, key);\n }\n delete(key, value) {\n super.delete(key, value);\n del(this.keysByValue, value, key);\n }\n hasValue(value) {\n return this.keysByValue.has(value);\n }\n getKeysForValue(value) {\n const set = this.keysByValue.get(value);\n return set ? Array.from(set) : [];\n }\n}\n\nclass SelectorObserver {\n constructor(element, selector, delegate, details) {\n this._selector = selector;\n this.details = details;\n this.elementObserver = new ElementObserver(element, this);\n this.delegate = delegate;\n this.matchesByElement = new Multimap();\n }\n get started() {\n return this.elementObserver.started;\n }\n get selector() {\n return this._selector;\n }\n set selector(selector) {\n this._selector = selector;\n this.refresh();\n }\n start() {\n this.elementObserver.start();\n }\n pause(callback) {\n this.elementObserver.pause(callback);\n }\n stop() {\n this.elementObserver.stop();\n }\n refresh() {\n this.elementObserver.refresh();\n }\n get element() {\n return this.elementObserver.element;\n }\n matchElement(element) {\n const { selector } = this;\n if (selector) {\n const matches = element.matches(selector);\n if (this.delegate.selectorMatchElement) {\n return matches && this.delegate.selectorMatchElement(element, this.details);\n }\n return matches;\n }\n else {\n return false;\n }\n }\n matchElementsInTree(tree) {\n const { selector } = this;\n if (selector) {\n const match = this.matchElement(tree) ? [tree] : [];\n const matches = Array.from(tree.querySelectorAll(selector)).filter((match) => this.matchElement(match));\n return match.concat(matches);\n }\n else {\n return [];\n }\n }\n elementMatched(element) {\n const { selector } = this;\n if (selector) {\n this.selectorMatched(element, selector);\n }\n }\n elementUnmatched(element) {\n const selectors = this.matchesByElement.getKeysForValue(element);\n for (const selector of selectors) {\n this.selectorUnmatched(element, selector);\n }\n }\n elementAttributeChanged(element, _attributeName) {\n const { selector } = this;\n if (selector) {\n const matches = this.matchElement(element);\n const matchedBefore = this.matchesByElement.has(selector, element);\n if (matches && !matchedBefore) {\n this.selectorMatched(element, selector);\n }\n else if (!matches && matchedBefore) {\n this.selectorUnmatched(element, selector);\n }\n }\n }\n selectorMatched(element, selector) {\n this.delegate.selectorMatched(element, selector, this.details);\n this.matchesByElement.add(selector, element);\n }\n selectorUnmatched(element, selector) {\n this.delegate.selectorUnmatched(element, selector, this.details);\n this.matchesByElement.delete(selector, element);\n }\n}\n\nclass StringMapObserver {\n constructor(element, delegate) {\n this.element = element;\n this.delegate = delegate;\n this.started = false;\n this.stringMap = new Map();\n this.mutationObserver = new MutationObserver((mutations) => this.processMutations(mutations));\n }\n start() {\n if (!this.started) {\n this.started = true;\n this.mutationObserver.observe(this.element, { attributes: true, attributeOldValue: true });\n this.refresh();\n }\n }\n stop() {\n if (this.started) {\n this.mutationObserver.takeRecords();\n this.mutationObserver.disconnect();\n this.started = false;\n }\n }\n refresh() {\n if (this.started) {\n for (const attributeName of this.knownAttributeNames) {\n this.refreshAttribute(attributeName, null);\n }\n }\n }\n processMutations(mutations) {\n if (this.started) {\n for (const mutation of mutations) {\n this.processMutation(mutation);\n }\n }\n }\n processMutation(mutation) {\n const attributeName = mutation.attributeName;\n if (attributeName) {\n this.refreshAttribute(attributeName, mutation.oldValue);\n }\n }\n refreshAttribute(attributeName, oldValue) {\n const key = this.delegate.getStringMapKeyForAttribute(attributeName);\n if (key != null) {\n if (!this.stringMap.has(attributeName)) {\n this.stringMapKeyAdded(key, attributeName);\n }\n const value = this.element.getAttribute(attributeName);\n if (this.stringMap.get(attributeName) != value) {\n this.stringMapValueChanged(value, key, oldValue);\n }\n if (value == null) {\n const oldValue = this.stringMap.get(attributeName);\n this.stringMap.delete(attributeName);\n if (oldValue)\n this.stringMapKeyRemoved(key, attributeName, oldValue);\n }\n else {\n this.stringMap.set(attributeName, value);\n }\n }\n }\n stringMapKeyAdded(key, attributeName) {\n if (this.delegate.stringMapKeyAdded) {\n this.delegate.stringMapKeyAdded(key, attributeName);\n }\n }\n stringMapValueChanged(value, key, oldValue) {\n if (this.delegate.stringMapValueChanged) {\n this.delegate.stringMapValueChanged(value, key, oldValue);\n }\n }\n stringMapKeyRemoved(key, attributeName, oldValue) {\n if (this.delegate.stringMapKeyRemoved) {\n this.delegate.stringMapKeyRemoved(key, attributeName, oldValue);\n }\n }\n get knownAttributeNames() {\n return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)));\n }\n get currentAttributeNames() {\n return Array.from(this.element.attributes).map((attribute) => attribute.name);\n }\n get recordedAttributeNames() {\n return Array.from(this.stringMap.keys());\n }\n}\n\nclass TokenListObserver {\n constructor(element, attributeName, delegate) {\n this.attributeObserver = new AttributeObserver(element, attributeName, this);\n this.delegate = delegate;\n this.tokensByElement = new Multimap();\n }\n get started() {\n return this.attributeObserver.started;\n }\n start() {\n this.attributeObserver.start();\n }\n pause(callback) {\n this.attributeObserver.pause(callback);\n }\n stop() {\n this.attributeObserver.stop();\n }\n refresh() {\n this.attributeObserver.refresh();\n }\n get element() {\n return this.attributeObserver.element;\n }\n get attributeName() {\n return this.attributeObserver.attributeName;\n }\n elementMatchedAttribute(element) {\n this.tokensMatched(this.readTokensForElement(element));\n }\n elementAttributeValueChanged(element) {\n const [unmatchedTokens, matchedTokens] = this.refreshTokensForElement(element);\n this.tokensUnmatched(unmatchedTokens);\n this.tokensMatched(matchedTokens);\n }\n elementUnmatchedAttribute(element) {\n this.tokensUnmatched(this.tokensByElement.getValuesForKey(element));\n }\n tokensMatched(tokens) {\n tokens.forEach((token) => this.tokenMatched(token));\n }\n tokensUnmatched(tokens) {\n tokens.forEach((token) => this.tokenUnmatched(token));\n }\n tokenMatched(token) {\n this.delegate.tokenMatched(token);\n this.tokensByElement.add(token.element, token);\n }\n tokenUnmatched(token) {\n this.delegate.tokenUnmatched(token);\n this.tokensByElement.delete(token.element, token);\n }\n refreshTokensForElement(element) {\n const previousTokens = this.tokensByElement.getValuesForKey(element);\n const currentTokens = this.readTokensForElement(element);\n const firstDifferingIndex = zip(previousTokens, currentTokens).findIndex(([previousToken, currentToken]) => !tokensAreEqual(previousToken, currentToken));\n if (firstDifferingIndex == -1) {\n return [[], []];\n }\n else {\n return [previousTokens.slice(firstDifferingIndex), currentTokens.slice(firstDifferingIndex)];\n }\n }\n readTokensForElement(element) {\n const attributeName = this.attributeName;\n const tokenString = element.getAttribute(attributeName) || \"\";\n return parseTokenString(tokenString, element, attributeName);\n }\n}\nfunction parseTokenString(tokenString, element, attributeName) {\n return tokenString\n .trim()\n .split(/\\s+/)\n .filter((content) => content.length)\n .map((content, index) => ({ element, attributeName, content, index }));\n}\nfunction zip(left, right) {\n const length = Math.max(left.length, right.length);\n return Array.from({ length }, (_, index) => [left[index], right[index]]);\n}\nfunction tokensAreEqual(left, right) {\n return left && right && left.index == right.index && left.content == right.content;\n}\n\nclass ValueListObserver {\n constructor(element, attributeName, delegate) {\n this.tokenListObserver = new TokenListObserver(element, attributeName, this);\n this.delegate = delegate;\n this.parseResultsByToken = new WeakMap();\n this.valuesByTokenByElement = new WeakMap();\n }\n get started() {\n return this.tokenListObserver.started;\n }\n start() {\n this.tokenListObserver.start();\n }\n stop() {\n this.tokenListObserver.stop();\n }\n refresh() {\n this.tokenListObserver.refresh();\n }\n get element() {\n return this.tokenListObserver.element;\n }\n get attributeName() {\n return this.tokenListObserver.attributeName;\n }\n tokenMatched(token) {\n const { element } = token;\n const { value } = this.fetchParseResultForToken(token);\n if (value) {\n this.fetchValuesByTokenForElement(element).set(token, value);\n this.delegate.elementMatchedValue(element, value);\n }\n }\n tokenUnmatched(token) {\n const { element } = token;\n const { value } = this.fetchParseResultForToken(token);\n if (value) {\n this.fetchValuesByTokenForElement(element).delete(token);\n this.delegate.elementUnmatchedValue(element, value);\n }\n }\n fetchParseResultForToken(token) {\n let parseResult = this.parseResultsByToken.get(token);\n if (!parseResult) {\n parseResult = this.parseToken(token);\n this.parseResultsByToken.set(token, parseResult);\n }\n return parseResult;\n }\n fetchValuesByTokenForElement(element) {\n let valuesByToken = this.valuesByTokenByElement.get(element);\n if (!valuesByToken) {\n valuesByToken = new Map();\n this.valuesByTokenByElement.set(element, valuesByToken);\n }\n return valuesByToken;\n }\n parseToken(token) {\n try {\n const value = this.delegate.parseValueForToken(token);\n return { value };\n }\n catch (error) {\n return { error };\n }\n }\n}\n\nclass BindingObserver {\n constructor(context, delegate) {\n this.context = context;\n this.delegate = delegate;\n this.bindingsByAction = new Map();\n }\n start() {\n if (!this.valueListObserver) {\n this.valueListObserver = new ValueListObserver(this.element, this.actionAttribute, this);\n this.valueListObserver.start();\n }\n }\n stop() {\n if (this.valueListObserver) {\n this.valueListObserver.stop();\n delete this.valueListObserver;\n this.disconnectAllActions();\n }\n }\n get element() {\n return this.context.element;\n }\n get identifier() {\n return this.context.identifier;\n }\n get actionAttribute() {\n return this.schema.actionAttribute;\n }\n get schema() {\n return this.context.schema;\n }\n get bindings() {\n return Array.from(this.bindingsByAction.values());\n }\n connectAction(action) {\n const binding = new Binding(this.context, action);\n this.bindingsByAction.set(action, binding);\n this.delegate.bindingConnected(binding);\n }\n disconnectAction(action) {\n const binding = this.bindingsByAction.get(action);\n if (binding) {\n this.bindingsByAction.delete(action);\n this.delegate.bindingDisconnected(binding);\n }\n }\n disconnectAllActions() {\n this.bindings.forEach((binding) => this.delegate.bindingDisconnected(binding, true));\n this.bindingsByAction.clear();\n }\n parseValueForToken(token) {\n const action = Action.forToken(token, this.schema);\n if (action.identifier == this.identifier) {\n return action;\n }\n }\n elementMatchedValue(element, action) {\n this.connectAction(action);\n }\n elementUnmatchedValue(element, action) {\n this.disconnectAction(action);\n }\n}\n\nclass ValueObserver {\n constructor(context, receiver) {\n this.context = context;\n this.receiver = receiver;\n this.stringMapObserver = new StringMapObserver(this.element, this);\n this.valueDescriptorMap = this.controller.valueDescriptorMap;\n }\n start() {\n this.stringMapObserver.start();\n this.invokeChangedCallbacksForDefaultValues();\n }\n stop() {\n this.stringMapObserver.stop();\n }\n get element() {\n return this.context.element;\n }\n get controller() {\n return this.context.controller;\n }\n getStringMapKeyForAttribute(attributeName) {\n if (attributeName in this.valueDescriptorMap) {\n return this.valueDescriptorMap[attributeName].name;\n }\n }\n stringMapKeyAdded(key, attributeName) {\n const descriptor = this.valueDescriptorMap[attributeName];\n if (!this.hasValue(key)) {\n this.invokeChangedCallback(key, descriptor.writer(this.receiver[key]), descriptor.writer(descriptor.defaultValue));\n }\n }\n stringMapValueChanged(value, name, oldValue) {\n const descriptor = this.valueDescriptorNameMap[name];\n if (value === null)\n return;\n if (oldValue === null) {\n oldValue = descriptor.writer(descriptor.defaultValue);\n }\n this.invokeChangedCallback(name, value, oldValue);\n }\n stringMapKeyRemoved(key, attributeName, oldValue) {\n const descriptor = this.valueDescriptorNameMap[key];\n if (this.hasValue(key)) {\n this.invokeChangedCallback(key, descriptor.writer(this.receiver[key]), oldValue);\n }\n else {\n this.invokeChangedCallback(key, descriptor.writer(descriptor.defaultValue), oldValue);\n }\n }\n invokeChangedCallbacksForDefaultValues() {\n for (const { key, name, defaultValue, writer } of this.valueDescriptors) {\n if (defaultValue != undefined && !this.controller.data.has(key)) {\n this.invokeChangedCallback(name, writer(defaultValue), undefined);\n }\n }\n }\n invokeChangedCallback(name, rawValue, rawOldValue) {\n const changedMethodName = `${name}Changed`;\n const changedMethod = this.receiver[changedMethodName];\n if (typeof changedMethod == \"function\") {\n const descriptor = this.valueDescriptorNameMap[name];\n try {\n const value = descriptor.reader(rawValue);\n let oldValue = rawOldValue;\n if (rawOldValue) {\n oldValue = descriptor.reader(rawOldValue);\n }\n changedMethod.call(this.receiver, value, oldValue);\n }\n catch (error) {\n if (error instanceof TypeError) {\n error.message = `Stimulus Value \"${this.context.identifier}.${descriptor.name}\" - ${error.message}`;\n }\n throw error;\n }\n }\n }\n get valueDescriptors() {\n const { valueDescriptorMap } = this;\n return Object.keys(valueDescriptorMap).map((key) => valueDescriptorMap[key]);\n }\n get valueDescriptorNameMap() {\n const descriptors = {};\n Object.keys(this.valueDescriptorMap).forEach((key) => {\n const descriptor = this.valueDescriptorMap[key];\n descriptors[descriptor.name] = descriptor;\n });\n return descriptors;\n }\n hasValue(attributeName) {\n const descriptor = this.valueDescriptorNameMap[attributeName];\n const hasMethodName = `has${capitalize(descriptor.name)}`;\n return this.receiver[hasMethodName];\n }\n}\n\nclass TargetObserver {\n constructor(context, delegate) {\n this.context = context;\n this.delegate = delegate;\n this.targetsByName = new Multimap();\n }\n start() {\n if (!this.tokenListObserver) {\n this.tokenListObserver = new TokenListObserver(this.element, this.attributeName, this);\n this.tokenListObserver.start();\n }\n }\n stop() {\n if (this.tokenListObserver) {\n this.disconnectAllTargets();\n this.tokenListObserver.stop();\n delete this.tokenListObserver;\n }\n }\n tokenMatched({ element, content: name }) {\n if (this.scope.containsElement(element)) {\n this.connectTarget(element, name);\n }\n }\n tokenUnmatched({ element, content: name }) {\n this.disconnectTarget(element, name);\n }\n connectTarget(element, name) {\n var _a;\n if (!this.targetsByName.has(name, element)) {\n this.targetsByName.add(name, element);\n (_a = this.tokenListObserver) === null || _a === void 0 ? void 0 : _a.pause(() => this.delegate.targetConnected(element, name));\n }\n }\n disconnectTarget(element, name) {\n var _a;\n if (this.targetsByName.has(name, element)) {\n this.targetsByName.delete(name, element);\n (_a = this.tokenListObserver) === null || _a === void 0 ? void 0 : _a.pause(() => this.delegate.targetDisconnected(element, name));\n }\n }\n disconnectAllTargets() {\n for (const name of this.targetsByName.keys) {\n for (const element of this.targetsByName.getValuesForKey(name)) {\n this.disconnectTarget(element, name);\n }\n }\n }\n get attributeName() {\n return `data-${this.context.identifier}-target`;\n }\n get element() {\n return this.context.element;\n }\n get scope() {\n return this.context.scope;\n }\n}\n\nfunction readInheritableStaticArrayValues(constructor, propertyName) {\n const ancestors = getAncestorsForConstructor(constructor);\n return Array.from(ancestors.reduce((values, constructor) => {\n getOwnStaticArrayValues(constructor, propertyName).forEach((name) => values.add(name));\n return values;\n }, new Set()));\n}\nfunction readInheritableStaticObjectPairs(constructor, propertyName) {\n const ancestors = getAncestorsForConstructor(constructor);\n return ancestors.reduce((pairs, constructor) => {\n pairs.push(...getOwnStaticObjectPairs(constructor, propertyName));\n return pairs;\n }, []);\n}\nfunction getAncestorsForConstructor(constructor) {\n const ancestors = [];\n while (constructor) {\n ancestors.push(constructor);\n constructor = Object.getPrototypeOf(constructor);\n }\n return ancestors.reverse();\n}\nfunction getOwnStaticArrayValues(constructor, propertyName) {\n const definition = constructor[propertyName];\n return Array.isArray(definition) ? definition : [];\n}\nfunction getOwnStaticObjectPairs(constructor, propertyName) {\n const definition = constructor[propertyName];\n return definition ? Object.keys(definition).map((key) => [key, definition[key]]) : [];\n}\n\nclass OutletObserver {\n constructor(context, delegate) {\n this.started = false;\n this.context = context;\n this.delegate = delegate;\n this.outletsByName = new Multimap();\n this.outletElementsByName = new Multimap();\n this.selectorObserverMap = new Map();\n this.attributeObserverMap = new Map();\n }\n start() {\n if (!this.started) {\n this.outletDefinitions.forEach((outletName) => {\n this.setupSelectorObserverForOutlet(outletName);\n this.setupAttributeObserverForOutlet(outletName);\n });\n this.started = true;\n this.dependentContexts.forEach((context) => context.refresh());\n }\n }\n refresh() {\n this.selectorObserverMap.forEach((observer) => observer.refresh());\n this.attributeObserverMap.forEach((observer) => observer.refresh());\n }\n stop() {\n if (this.started) {\n this.started = false;\n this.disconnectAllOutlets();\n this.stopSelectorObservers();\n this.stopAttributeObservers();\n }\n }\n stopSelectorObservers() {\n if (this.selectorObserverMap.size > 0) {\n this.selectorObserverMap.forEach((observer) => observer.stop());\n this.selectorObserverMap.clear();\n }\n }\n stopAttributeObservers() {\n if (this.attributeObserverMap.size > 0) {\n this.attributeObserverMap.forEach((observer) => observer.stop());\n this.attributeObserverMap.clear();\n }\n }\n selectorMatched(element, _selector, { outletName }) {\n const outlet = this.getOutlet(element, outletName);\n if (outlet) {\n this.connectOutlet(outlet, element, outletName);\n }\n }\n selectorUnmatched(element, _selector, { outletName }) {\n const outlet = this.getOutletFromMap(element, outletName);\n if (outlet) {\n this.disconnectOutlet(outlet, element, outletName);\n }\n }\n selectorMatchElement(element, { outletName }) {\n const selector = this.selector(outletName);\n const hasOutlet = this.hasOutlet(element, outletName);\n const hasOutletController = element.matches(`[${this.schema.controllerAttribute}~=${outletName}]`);\n if (selector) {\n return hasOutlet && hasOutletController && element.matches(selector);\n }\n else {\n return false;\n }\n }\n elementMatchedAttribute(_element, attributeName) {\n const outletName = this.getOutletNameFromOutletAttributeName(attributeName);\n if (outletName) {\n this.updateSelectorObserverForOutlet(outletName);\n }\n }\n elementAttributeValueChanged(_element, attributeName) {\n const outletName = this.getOutletNameFromOutletAttributeName(attributeName);\n if (outletName) {\n this.updateSelectorObserverForOutlet(outletName);\n }\n }\n elementUnmatchedAttribute(_element, attributeName) {\n const outletName = this.getOutletNameFromOutletAttributeName(attributeName);\n if (outletName) {\n this.updateSelectorObserverForOutlet(outletName);\n }\n }\n connectOutlet(outlet, element, outletName) {\n var _a;\n if (!this.outletElementsByName.has(outletName, element)) {\n this.outletsByName.add(outletName, outlet);\n this.outletElementsByName.add(outletName, element);\n (_a = this.selectorObserverMap.get(outletName)) === null || _a === void 0 ? void 0 : _a.pause(() => this.delegate.outletConnected(outlet, element, outletName));\n }\n }\n disconnectOutlet(outlet, element, outletName) {\n var _a;\n if (this.outletElementsByName.has(outletName, element)) {\n this.outletsByName.delete(outletName, outlet);\n this.outletElementsByName.delete(outletName, element);\n (_a = this.selectorObserverMap\n .get(outletName)) === null || _a === void 0 ? void 0 : _a.pause(() => this.delegate.outletDisconnected(outlet, element, outletName));\n }\n }\n disconnectAllOutlets() {\n for (const outletName of this.outletElementsByName.keys) {\n for (const element of this.outletElementsByName.getValuesForKey(outletName)) {\n for (const outlet of this.outletsByName.getValuesForKey(outletName)) {\n this.disconnectOutlet(outlet, element, outletName);\n }\n }\n }\n }\n updateSelectorObserverForOutlet(outletName) {\n const observer = this.selectorObserverMap.get(outletName);\n if (observer) {\n observer.selector = this.selector(outletName);\n }\n }\n setupSelectorObserverForOutlet(outletName) {\n const selector = this.selector(outletName);\n const selectorObserver = new SelectorObserver(document.body, selector, this, { outletName });\n this.selectorObserverMap.set(outletName, selectorObserver);\n selectorObserver.start();\n }\n setupAttributeObserverForOutlet(outletName) {\n const attributeName = this.attributeNameForOutletName(outletName);\n const attributeObserver = new AttributeObserver(this.scope.element, attributeName, this);\n this.attributeObserverMap.set(outletName, attributeObserver);\n attributeObserver.start();\n }\n selector(outletName) {\n return this.scope.outlets.getSelectorForOutletName(outletName);\n }\n attributeNameForOutletName(outletName) {\n return this.scope.schema.outletAttributeForScope(this.identifier, outletName);\n }\n getOutletNameFromOutletAttributeName(attributeName) {\n return this.outletDefinitions.find((outletName) => this.attributeNameForOutletName(outletName) === attributeName);\n }\n get outletDependencies() {\n const dependencies = new Multimap();\n this.router.modules.forEach((module) => {\n const constructor = module.definition.controllerConstructor;\n const outlets = readInheritableStaticArrayValues(constructor, \"outlets\");\n outlets.forEach((outlet) => dependencies.add(outlet, module.identifier));\n });\n return dependencies;\n }\n get outletDefinitions() {\n return this.outletDependencies.getKeysForValue(this.identifier);\n }\n get dependentControllerIdentifiers() {\n return this.outletDependencies.getValuesForKey(this.identifier);\n }\n get dependentContexts() {\n const identifiers = this.dependentControllerIdentifiers;\n return this.router.contexts.filter((context) => identifiers.includes(context.identifier));\n }\n hasOutlet(element, outletName) {\n return !!this.getOutlet(element, outletName) || !!this.getOutletFromMap(element, outletName);\n }\n getOutlet(element, outletName) {\n return this.application.getControllerForElementAndIdentifier(element, outletName);\n }\n getOutletFromMap(element, outletName) {\n return this.outletsByName.getValuesForKey(outletName).find((outlet) => outlet.element === element);\n }\n get scope() {\n return this.context.scope;\n }\n get schema() {\n return this.context.schema;\n }\n get identifier() {\n return this.context.identifier;\n }\n get application() {\n return this.context.application;\n }\n get router() {\n return this.application.router;\n }\n}\n\nclass Context {\n constructor(module, scope) {\n this.logDebugActivity = (functionName, detail = {}) => {\n const { identifier, controller, element } = this;\n detail = Object.assign({ identifier, controller, element }, detail);\n this.application.logDebugActivity(this.identifier, functionName, detail);\n };\n this.module = module;\n this.scope = scope;\n this.controller = new module.controllerConstructor(this);\n this.bindingObserver = new BindingObserver(this, this.dispatcher);\n this.valueObserver = new ValueObserver(this, this.controller);\n this.targetObserver = new TargetObserver(this, this);\n this.outletObserver = new OutletObserver(this, this);\n try {\n this.controller.initialize();\n this.logDebugActivity(\"initialize\");\n }\n catch (error) {\n this.handleError(error, \"initializing controller\");\n }\n }\n connect() {\n this.bindingObserver.start();\n this.valueObserver.start();\n this.targetObserver.start();\n this.outletObserver.start();\n try {\n this.controller.connect();\n this.logDebugActivity(\"connect\");\n }\n catch (error) {\n this.handleError(error, \"connecting controller\");\n }\n }\n refresh() {\n this.outletObserver.refresh();\n }\n disconnect() {\n try {\n this.controller.disconnect();\n this.logDebugActivity(\"disconnect\");\n }\n catch (error) {\n this.handleError(error, \"disconnecting controller\");\n }\n this.outletObserver.stop();\n this.targetObserver.stop();\n this.valueObserver.stop();\n this.bindingObserver.stop();\n }\n get application() {\n return this.module.application;\n }\n get identifier() {\n return this.module.identifier;\n }\n get schema() {\n return this.application.schema;\n }\n get dispatcher() {\n return this.application.dispatcher;\n }\n get element() {\n return this.scope.element;\n }\n get parentElement() {\n return this.element.parentElement;\n }\n handleError(error, message, detail = {}) {\n const { identifier, controller, element } = this;\n detail = Object.assign({ identifier, controller, element }, detail);\n this.application.handleError(error, `Error ${message}`, detail);\n }\n targetConnected(element, name) {\n this.invokeControllerMethod(`${name}TargetConnected`, element);\n }\n targetDisconnected(element, name) {\n this.invokeControllerMethod(`${name}TargetDisconnected`, element);\n }\n outletConnected(outlet, element, name) {\n this.invokeControllerMethod(`${namespaceCamelize(name)}OutletConnected`, outlet, element);\n }\n outletDisconnected(outlet, element, name) {\n this.invokeControllerMethod(`${namespaceCamelize(name)}OutletDisconnected`, outlet, element);\n }\n invokeControllerMethod(methodName, ...args) {\n const controller = this.controller;\n if (typeof controller[methodName] == \"function\") {\n controller[methodName](...args);\n }\n }\n}\n\nfunction bless(constructor) {\n return shadow(constructor, getBlessedProperties(constructor));\n}\nfunction shadow(constructor, properties) {\n const shadowConstructor = extend(constructor);\n const shadowProperties = getShadowProperties(constructor.prototype, properties);\n Object.defineProperties(shadowConstructor.prototype, shadowProperties);\n return shadowConstructor;\n}\nfunction getBlessedProperties(constructor) {\n const blessings = readInheritableStaticArrayValues(constructor, \"blessings\");\n return blessings.reduce((blessedProperties, blessing) => {\n const properties = blessing(constructor);\n for (const key in properties) {\n const descriptor = blessedProperties[key] || {};\n blessedProperties[key] = Object.assign(descriptor, properties[key]);\n }\n return blessedProperties;\n }, {});\n}\nfunction getShadowProperties(prototype, properties) {\n return getOwnKeys(properties).reduce((shadowProperties, key) => {\n const descriptor = getShadowedDescriptor(prototype, properties, key);\n if (descriptor) {\n Object.assign(shadowProperties, { [key]: descriptor });\n }\n return shadowProperties;\n }, {});\n}\nfunction getShadowedDescriptor(prototype, properties, key) {\n const shadowingDescriptor = Object.getOwnPropertyDescriptor(prototype, key);\n const shadowedByValue = shadowingDescriptor && \"value\" in shadowingDescriptor;\n if (!shadowedByValue) {\n const descriptor = Object.getOwnPropertyDescriptor(properties, key).value;\n if (shadowingDescriptor) {\n descriptor.get = shadowingDescriptor.get || descriptor.get;\n descriptor.set = shadowingDescriptor.set || descriptor.set;\n }\n return descriptor;\n }\n}\nconst getOwnKeys = (() => {\n if (typeof Object.getOwnPropertySymbols == \"function\") {\n return (object) => [...Object.getOwnPropertyNames(object), ...Object.getOwnPropertySymbols(object)];\n }\n else {\n return Object.getOwnPropertyNames;\n }\n})();\nconst extend = (() => {\n function extendWithReflect(constructor) {\n function extended() {\n return Reflect.construct(constructor, arguments, new.target);\n }\n extended.prototype = Object.create(constructor.prototype, {\n constructor: { value: extended },\n });\n Reflect.setPrototypeOf(extended, constructor);\n return extended;\n }\n function testReflectExtension() {\n const a = function () {\n this.a.call(this);\n };\n const b = extendWithReflect(a);\n b.prototype.a = function () { };\n return new b();\n }\n try {\n testReflectExtension();\n return extendWithReflect;\n }\n catch (error) {\n return (constructor) => class extended extends constructor {\n };\n }\n})();\n\nfunction blessDefinition(definition) {\n return {\n identifier: definition.identifier,\n controllerConstructor: bless(definition.controllerConstructor),\n };\n}\n\nclass Module {\n constructor(application, definition) {\n this.application = application;\n this.definition = blessDefinition(definition);\n this.contextsByScope = new WeakMap();\n this.connectedContexts = new Set();\n }\n get identifier() {\n return this.definition.identifier;\n }\n get controllerConstructor() {\n return this.definition.controllerConstructor;\n }\n get contexts() {\n return Array.from(this.connectedContexts);\n }\n connectContextForScope(scope) {\n const context = this.fetchContextForScope(scope);\n this.connectedContexts.add(context);\n context.connect();\n }\n disconnectContextForScope(scope) {\n const context = this.contextsByScope.get(scope);\n if (context) {\n this.connectedContexts.delete(context);\n context.disconnect();\n }\n }\n fetchContextForScope(scope) {\n let context = this.contextsByScope.get(scope);\n if (!context) {\n context = new Context(this, scope);\n this.contextsByScope.set(scope, context);\n }\n return context;\n }\n}\n\nclass ClassMap {\n constructor(scope) {\n this.scope = scope;\n }\n has(name) {\n return this.data.has(this.getDataKey(name));\n }\n get(name) {\n return this.getAll(name)[0];\n }\n getAll(name) {\n const tokenString = this.data.get(this.getDataKey(name)) || \"\";\n return tokenize(tokenString);\n }\n getAttributeName(name) {\n return this.data.getAttributeNameForKey(this.getDataKey(name));\n }\n getDataKey(name) {\n return `${name}-class`;\n }\n get data() {\n return this.scope.data;\n }\n}\n\nclass DataMap {\n constructor(scope) {\n this.scope = scope;\n }\n get element() {\n return this.scope.element;\n }\n get identifier() {\n return this.scope.identifier;\n }\n get(key) {\n const name = this.getAttributeNameForKey(key);\n return this.element.getAttribute(name);\n }\n set(key, value) {\n const name = this.getAttributeNameForKey(key);\n this.element.setAttribute(name, value);\n return this.get(key);\n }\n has(key) {\n const name = this.getAttributeNameForKey(key);\n return this.element.hasAttribute(name);\n }\n delete(key) {\n if (this.has(key)) {\n const name = this.getAttributeNameForKey(key);\n this.element.removeAttribute(name);\n return true;\n }\n else {\n return false;\n }\n }\n getAttributeNameForKey(key) {\n return `data-${this.identifier}-${dasherize(key)}`;\n }\n}\n\nclass Guide {\n constructor(logger) {\n this.warnedKeysByObject = new WeakMap();\n this.logger = logger;\n }\n warn(object, key, message) {\n let warnedKeys = this.warnedKeysByObject.get(object);\n if (!warnedKeys) {\n warnedKeys = new Set();\n this.warnedKeysByObject.set(object, warnedKeys);\n }\n if (!warnedKeys.has(key)) {\n warnedKeys.add(key);\n this.logger.warn(message, object);\n }\n }\n}\n\nfunction attributeValueContainsToken(attributeName, token) {\n return `[${attributeName}~=\"${token}\"]`;\n}\n\nclass TargetSet {\n constructor(scope) {\n this.scope = scope;\n }\n get element() {\n return this.scope.element;\n }\n get identifier() {\n return this.scope.identifier;\n }\n get schema() {\n return this.scope.schema;\n }\n has(targetName) {\n return this.find(targetName) != null;\n }\n find(...targetNames) {\n return targetNames.reduce((target, targetName) => target || this.findTarget(targetName) || this.findLegacyTarget(targetName), undefined);\n }\n findAll(...targetNames) {\n return targetNames.reduce((targets, targetName) => [\n ...targets,\n ...this.findAllTargets(targetName),\n ...this.findAllLegacyTargets(targetName),\n ], []);\n }\n findTarget(targetName) {\n const selector = this.getSelectorForTargetName(targetName);\n return this.scope.findElement(selector);\n }\n findAllTargets(targetName) {\n const selector = this.getSelectorForTargetName(targetName);\n return this.scope.findAllElements(selector);\n }\n getSelectorForTargetName(targetName) {\n const attributeName = this.schema.targetAttributeForScope(this.identifier);\n return attributeValueContainsToken(attributeName, targetName);\n }\n findLegacyTarget(targetName) {\n const selector = this.getLegacySelectorForTargetName(targetName);\n return this.deprecate(this.scope.findElement(selector), targetName);\n }\n findAllLegacyTargets(targetName) {\n const selector = this.getLegacySelectorForTargetName(targetName);\n return this.scope.findAllElements(selector).map((element) => this.deprecate(element, targetName));\n }\n getLegacySelectorForTargetName(targetName) {\n const targetDescriptor = `${this.identifier}.${targetName}`;\n return attributeValueContainsToken(this.schema.targetAttribute, targetDescriptor);\n }\n deprecate(element, targetName) {\n if (element) {\n const { identifier } = this;\n const attributeName = this.schema.targetAttribute;\n const revisedAttributeName = this.schema.targetAttributeForScope(identifier);\n this.guide.warn(element, `target:${targetName}`, `Please replace ${attributeName}=\"${identifier}.${targetName}\" with ${revisedAttributeName}=\"${targetName}\". ` +\n `The ${attributeName} attribute is deprecated and will be removed in a future version of Stimulus.`);\n }\n return element;\n }\n get guide() {\n return this.scope.guide;\n }\n}\n\nclass OutletSet {\n constructor(scope, controllerElement) {\n this.scope = scope;\n this.controllerElement = controllerElement;\n }\n get element() {\n return this.scope.element;\n }\n get identifier() {\n return this.scope.identifier;\n }\n get schema() {\n return this.scope.schema;\n }\n has(outletName) {\n return this.find(outletName) != null;\n }\n find(...outletNames) {\n return outletNames.reduce((outlet, outletName) => outlet || this.findOutlet(outletName), undefined);\n }\n findAll(...outletNames) {\n return outletNames.reduce((outlets, outletName) => [...outlets, ...this.findAllOutlets(outletName)], []);\n }\n getSelectorForOutletName(outletName) {\n const attributeName = this.schema.outletAttributeForScope(this.identifier, outletName);\n return this.controllerElement.getAttribute(attributeName);\n }\n findOutlet(outletName) {\n const selector = this.getSelectorForOutletName(outletName);\n if (selector)\n return this.findElement(selector, outletName);\n }\n findAllOutlets(outletName) {\n const selector = this.getSelectorForOutletName(outletName);\n return selector ? this.findAllElements(selector, outletName) : [];\n }\n findElement(selector, outletName) {\n const elements = this.scope.queryElements(selector);\n return elements.filter((element) => this.matchesElement(element, selector, outletName))[0];\n }\n findAllElements(selector, outletName) {\n const elements = this.scope.queryElements(selector);\n return elements.filter((element) => this.matchesElement(element, selector, outletName));\n }\n matchesElement(element, selector, outletName) {\n const controllerAttribute = element.getAttribute(this.scope.schema.controllerAttribute) || \"\";\n return element.matches(selector) && controllerAttribute.split(\" \").includes(outletName);\n }\n}\n\nclass Scope {\n constructor(schema, element, identifier, logger) {\n this.targets = new TargetSet(this);\n this.classes = new ClassMap(this);\n this.data = new DataMap(this);\n this.containsElement = (element) => {\n return element.closest(this.controllerSelector) === this.element;\n };\n this.schema = schema;\n this.element = element;\n this.identifier = identifier;\n this.guide = new Guide(logger);\n this.outlets = new OutletSet(this.documentScope, element);\n }\n findElement(selector) {\n return this.element.matches(selector) ? this.element : this.queryElements(selector).find(this.containsElement);\n }\n findAllElements(selector) {\n return [\n ...(this.element.matches(selector) ? [this.element] : []),\n ...this.queryElements(selector).filter(this.containsElement),\n ];\n }\n queryElements(selector) {\n return Array.from(this.element.querySelectorAll(selector));\n }\n get controllerSelector() {\n return attributeValueContainsToken(this.schema.controllerAttribute, this.identifier);\n }\n get isDocumentScope() {\n return this.element === document.documentElement;\n }\n get documentScope() {\n return this.isDocumentScope\n ? this\n : new Scope(this.schema, document.documentElement, this.identifier, this.guide.logger);\n }\n}\n\nclass ScopeObserver {\n constructor(element, schema, delegate) {\n this.element = element;\n this.schema = schema;\n this.delegate = delegate;\n this.valueListObserver = new ValueListObserver(this.element, this.controllerAttribute, this);\n this.scopesByIdentifierByElement = new WeakMap();\n this.scopeReferenceCounts = new WeakMap();\n }\n start() {\n this.valueListObserver.start();\n }\n stop() {\n this.valueListObserver.stop();\n }\n get controllerAttribute() {\n return this.schema.controllerAttribute;\n }\n parseValueForToken(token) {\n const { element, content: identifier } = token;\n return this.parseValueForElementAndIdentifier(element, identifier);\n }\n parseValueForElementAndIdentifier(element, identifier) {\n const scopesByIdentifier = this.fetchScopesByIdentifierForElement(element);\n let scope = scopesByIdentifier.get(identifier);\n if (!scope) {\n scope = this.delegate.createScopeForElementAndIdentifier(element, identifier);\n scopesByIdentifier.set(identifier, scope);\n }\n return scope;\n }\n elementMatchedValue(element, value) {\n const referenceCount = (this.scopeReferenceCounts.get(value) || 0) + 1;\n this.scopeReferenceCounts.set(value, referenceCount);\n if (referenceCount == 1) {\n this.delegate.scopeConnected(value);\n }\n }\n elementUnmatchedValue(element, value) {\n const referenceCount = this.scopeReferenceCounts.get(value);\n if (referenceCount) {\n this.scopeReferenceCounts.set(value, referenceCount - 1);\n if (referenceCount == 1) {\n this.delegate.scopeDisconnected(value);\n }\n }\n }\n fetchScopesByIdentifierForElement(element) {\n let scopesByIdentifier = this.scopesByIdentifierByElement.get(element);\n if (!scopesByIdentifier) {\n scopesByIdentifier = new Map();\n this.scopesByIdentifierByElement.set(element, scopesByIdentifier);\n }\n return scopesByIdentifier;\n }\n}\n\nclass Router {\n constructor(application) {\n this.application = application;\n this.scopeObserver = new ScopeObserver(this.element, this.schema, this);\n this.scopesByIdentifier = new Multimap();\n this.modulesByIdentifier = new Map();\n }\n get element() {\n return this.application.element;\n }\n get schema() {\n return this.application.schema;\n }\n get logger() {\n return this.application.logger;\n }\n get controllerAttribute() {\n return this.schema.controllerAttribute;\n }\n get modules() {\n return Array.from(this.modulesByIdentifier.values());\n }\n get contexts() {\n return this.modules.reduce((contexts, module) => contexts.concat(module.contexts), []);\n }\n start() {\n this.scopeObserver.start();\n }\n stop() {\n this.scopeObserver.stop();\n }\n loadDefinition(definition) {\n this.unloadIdentifier(definition.identifier);\n const module = new Module(this.application, definition);\n this.connectModule(module);\n const afterLoad = definition.controllerConstructor.afterLoad;\n if (afterLoad) {\n afterLoad.call(definition.controllerConstructor, definition.identifier, this.application);\n }\n }\n unloadIdentifier(identifier) {\n const module = this.modulesByIdentifier.get(identifier);\n if (module) {\n this.disconnectModule(module);\n }\n }\n getContextForElementAndIdentifier(element, identifier) {\n const module = this.modulesByIdentifier.get(identifier);\n if (module) {\n return module.contexts.find((context) => context.element == element);\n }\n }\n proposeToConnectScopeForElementAndIdentifier(element, identifier) {\n const scope = this.scopeObserver.parseValueForElementAndIdentifier(element, identifier);\n if (scope) {\n this.scopeObserver.elementMatchedValue(scope.element, scope);\n }\n else {\n console.error(`Couldn't find or create scope for identifier: \"${identifier}\" and element:`, element);\n }\n }\n handleError(error, message, detail) {\n this.application.handleError(error, message, detail);\n }\n createScopeForElementAndIdentifier(element, identifier) {\n return new Scope(this.schema, element, identifier, this.logger);\n }\n scopeConnected(scope) {\n this.scopesByIdentifier.add(scope.identifier, scope);\n const module = this.modulesByIdentifier.get(scope.identifier);\n if (module) {\n module.connectContextForScope(scope);\n }\n }\n scopeDisconnected(scope) {\n this.scopesByIdentifier.delete(scope.identifier, scope);\n const module = this.modulesByIdentifier.get(scope.identifier);\n if (module) {\n module.disconnectContextForScope(scope);\n }\n }\n connectModule(module) {\n this.modulesByIdentifier.set(module.identifier, module);\n const scopes = this.scopesByIdentifier.getValuesForKey(module.identifier);\n scopes.forEach((scope) => module.connectContextForScope(scope));\n }\n disconnectModule(module) {\n this.modulesByIdentifier.delete(module.identifier);\n const scopes = this.scopesByIdentifier.getValuesForKey(module.identifier);\n scopes.forEach((scope) => module.disconnectContextForScope(scope));\n }\n}\n\nconst defaultSchema = {\n controllerAttribute: \"data-controller\",\n actionAttribute: \"data-action\",\n targetAttribute: \"data-target\",\n targetAttributeForScope: (identifier) => `data-${identifier}-target`,\n outletAttributeForScope: (identifier, outlet) => `data-${identifier}-${outlet}-outlet`,\n keyMappings: Object.assign(Object.assign({ enter: \"Enter\", tab: \"Tab\", esc: \"Escape\", space: \" \", up: \"ArrowUp\", down: \"ArrowDown\", left: \"ArrowLeft\", right: \"ArrowRight\", home: \"Home\", end: \"End\", page_up: \"PageUp\", page_down: \"PageDown\" }, objectFromEntries(\"abcdefghijklmnopqrstuvwxyz\".split(\"\").map((c) => [c, c]))), objectFromEntries(\"0123456789\".split(\"\").map((n) => [n, n]))),\n};\nfunction objectFromEntries(array) {\n return array.reduce((memo, [k, v]) => (Object.assign(Object.assign({}, memo), { [k]: v })), {});\n}\n\nclass Application {\n constructor(element = document.documentElement, schema = defaultSchema) {\n this.logger = console;\n this.debug = false;\n this.logDebugActivity = (identifier, functionName, detail = {}) => {\n if (this.debug) {\n this.logFormattedMessage(identifier, functionName, detail);\n }\n };\n this.element = element;\n this.schema = schema;\n this.dispatcher = new Dispatcher(this);\n this.router = new Router(this);\n this.actionDescriptorFilters = Object.assign({}, defaultActionDescriptorFilters);\n }\n static start(element, schema) {\n const application = new this(element, schema);\n application.start();\n return application;\n }\n async start() {\n await domReady();\n this.logDebugActivity(\"application\", \"starting\");\n this.dispatcher.start();\n this.router.start();\n this.logDebugActivity(\"application\", \"start\");\n }\n stop() {\n this.logDebugActivity(\"application\", \"stopping\");\n this.dispatcher.stop();\n this.router.stop();\n this.logDebugActivity(\"application\", \"stop\");\n }\n register(identifier, controllerConstructor) {\n this.load({ identifier, controllerConstructor });\n }\n registerActionOption(name, filter) {\n this.actionDescriptorFilters[name] = filter;\n }\n load(head, ...rest) {\n const definitions = Array.isArray(head) ? head : [head, ...rest];\n definitions.forEach((definition) => {\n if (definition.controllerConstructor.shouldLoad) {\n this.router.loadDefinition(definition);\n }\n });\n }\n unload(head, ...rest) {\n const identifiers = Array.isArray(head) ? head : [head, ...rest];\n identifiers.forEach((identifier) => this.router.unloadIdentifier(identifier));\n }\n get controllers() {\n return this.router.contexts.map((context) => context.controller);\n }\n getControllerForElementAndIdentifier(element, identifier) {\n const context = this.router.getContextForElementAndIdentifier(element, identifier);\n return context ? context.controller : null;\n }\n handleError(error, message, detail) {\n var _a;\n this.logger.error(`%s\\n\\n%o\\n\\n%o`, message, error, detail);\n (_a = window.onerror) === null || _a === void 0 ? void 0 : _a.call(window, message, \"\", 0, 0, error);\n }\n logFormattedMessage(identifier, functionName, detail = {}) {\n detail = Object.assign({ application: this }, detail);\n this.logger.groupCollapsed(`${identifier} #${functionName}`);\n this.logger.log(\"details:\", Object.assign({}, detail));\n this.logger.groupEnd();\n }\n}\nfunction domReady() {\n return new Promise((resolve) => {\n if (document.readyState == \"loading\") {\n document.addEventListener(\"DOMContentLoaded\", () => resolve());\n }\n else {\n resolve();\n }\n });\n}\n\nfunction ClassPropertiesBlessing(constructor) {\n const classes = readInheritableStaticArrayValues(constructor, \"classes\");\n return classes.reduce((properties, classDefinition) => {\n return Object.assign(properties, propertiesForClassDefinition(classDefinition));\n }, {});\n}\nfunction propertiesForClassDefinition(key) {\n return {\n [`${key}Class`]: {\n get() {\n const { classes } = this;\n if (classes.has(key)) {\n return classes.get(key);\n }\n else {\n const attribute = classes.getAttributeName(key);\n throw new Error(`Missing attribute \"${attribute}\"`);\n }\n },\n },\n [`${key}Classes`]: {\n get() {\n return this.classes.getAll(key);\n },\n },\n [`has${capitalize(key)}Class`]: {\n get() {\n return this.classes.has(key);\n },\n },\n };\n}\n\nfunction OutletPropertiesBlessing(constructor) {\n const outlets = readInheritableStaticArrayValues(constructor, \"outlets\");\n return outlets.reduce((properties, outletDefinition) => {\n return Object.assign(properties, propertiesForOutletDefinition(outletDefinition));\n }, {});\n}\nfunction getOutletController(controller, element, identifier) {\n return controller.application.getControllerForElementAndIdentifier(element, identifier);\n}\nfunction getControllerAndEnsureConnectedScope(controller, element, outletName) {\n let outletController = getOutletController(controller, element, outletName);\n if (outletController)\n return outletController;\n controller.application.router.proposeToConnectScopeForElementAndIdentifier(element, outletName);\n outletController = getOutletController(controller, element, outletName);\n if (outletController)\n return outletController;\n}\nfunction propertiesForOutletDefinition(name) {\n const camelizedName = namespaceCamelize(name);\n return {\n [`${camelizedName}Outlet`]: {\n get() {\n const outletElement = this.outlets.find(name);\n const selector = this.outlets.getSelectorForOutletName(name);\n if (outletElement) {\n const outletController = getControllerAndEnsureConnectedScope(this, outletElement, name);\n if (outletController)\n return outletController;\n throw new Error(`The provided outlet element is missing an outlet controller \"${name}\" instance for host controller \"${this.identifier}\"`);\n }\n throw new Error(`Missing outlet element \"${name}\" for host controller \"${this.identifier}\". Stimulus couldn't find a matching outlet element using selector \"${selector}\".`);\n },\n },\n [`${camelizedName}Outlets`]: {\n get() {\n const outlets = this.outlets.findAll(name);\n if (outlets.length > 0) {\n return outlets\n .map((outletElement) => {\n const outletController = getControllerAndEnsureConnectedScope(this, outletElement, name);\n if (outletController)\n return outletController;\n console.warn(`The provided outlet element is missing an outlet controller \"${name}\" instance for host controller \"${this.identifier}\"`, outletElement);\n })\n .filter((controller) => controller);\n }\n return [];\n },\n },\n [`${camelizedName}OutletElement`]: {\n get() {\n const outletElement = this.outlets.find(name);\n const selector = this.outlets.getSelectorForOutletName(name);\n if (outletElement) {\n return outletElement;\n }\n else {\n throw new Error(`Missing outlet element \"${name}\" for host controller \"${this.identifier}\". Stimulus couldn't find a matching outlet element using selector \"${selector}\".`);\n }\n },\n },\n [`${camelizedName}OutletElements`]: {\n get() {\n return this.outlets.findAll(name);\n },\n },\n [`has${capitalize(camelizedName)}Outlet`]: {\n get() {\n return this.outlets.has(name);\n },\n },\n };\n}\n\nfunction TargetPropertiesBlessing(constructor) {\n const targets = readInheritableStaticArrayValues(constructor, \"targets\");\n return targets.reduce((properties, targetDefinition) => {\n return Object.assign(properties, propertiesForTargetDefinition(targetDefinition));\n }, {});\n}\nfunction propertiesForTargetDefinition(name) {\n return {\n [`${name}Target`]: {\n get() {\n const target = this.targets.find(name);\n if (target) {\n return target;\n }\n else {\n throw new Error(`Missing target element \"${name}\" for \"${this.identifier}\" controller`);\n }\n },\n },\n [`${name}Targets`]: {\n get() {\n return this.targets.findAll(name);\n },\n },\n [`has${capitalize(name)}Target`]: {\n get() {\n return this.targets.has(name);\n },\n },\n };\n}\n\nfunction ValuePropertiesBlessing(constructor) {\n const valueDefinitionPairs = readInheritableStaticObjectPairs(constructor, \"values\");\n const propertyDescriptorMap = {\n valueDescriptorMap: {\n get() {\n return valueDefinitionPairs.reduce((result, valueDefinitionPair) => {\n const valueDescriptor = parseValueDefinitionPair(valueDefinitionPair, this.identifier);\n const attributeName = this.data.getAttributeNameForKey(valueDescriptor.key);\n return Object.assign(result, { [attributeName]: valueDescriptor });\n }, {});\n },\n },\n };\n return valueDefinitionPairs.reduce((properties, valueDefinitionPair) => {\n return Object.assign(properties, propertiesForValueDefinitionPair(valueDefinitionPair));\n }, propertyDescriptorMap);\n}\nfunction propertiesForValueDefinitionPair(valueDefinitionPair, controller) {\n const definition = parseValueDefinitionPair(valueDefinitionPair, controller);\n const { key, name, reader: read, writer: write } = definition;\n return {\n [name]: {\n get() {\n const value = this.data.get(key);\n if (value !== null) {\n return read(value);\n }\n else {\n return definition.defaultValue;\n }\n },\n set(value) {\n if (value === undefined) {\n this.data.delete(key);\n }\n else {\n this.data.set(key, write(value));\n }\n },\n },\n [`has${capitalize(name)}`]: {\n get() {\n return this.data.has(key) || definition.hasCustomDefaultValue;\n },\n },\n };\n}\nfunction parseValueDefinitionPair([token, typeDefinition], controller) {\n return valueDescriptorForTokenAndTypeDefinition({\n controller,\n token,\n typeDefinition,\n });\n}\nfunction parseValueTypeConstant(constant) {\n switch (constant) {\n case Array:\n return \"array\";\n case Boolean:\n return \"boolean\";\n case Number:\n return \"number\";\n case Object:\n return \"object\";\n case String:\n return \"string\";\n }\n}\nfunction parseValueTypeDefault(defaultValue) {\n switch (typeof defaultValue) {\n case \"boolean\":\n return \"boolean\";\n case \"number\":\n return \"number\";\n case \"string\":\n return \"string\";\n }\n if (Array.isArray(defaultValue))\n return \"array\";\n if (Object.prototype.toString.call(defaultValue) === \"[object Object]\")\n return \"object\";\n}\nfunction parseValueTypeObject(payload) {\n const { controller, token, typeObject } = payload;\n const hasType = isSomething(typeObject.type);\n const hasDefault = isSomething(typeObject.default);\n const fullObject = hasType && hasDefault;\n const onlyType = hasType && !hasDefault;\n const onlyDefault = !hasType && hasDefault;\n const typeFromObject = parseValueTypeConstant(typeObject.type);\n const typeFromDefaultValue = parseValueTypeDefault(payload.typeObject.default);\n if (onlyType)\n return typeFromObject;\n if (onlyDefault)\n return typeFromDefaultValue;\n if (typeFromObject !== typeFromDefaultValue) {\n const propertyPath = controller ? `${controller}.${token}` : token;\n throw new Error(`The specified default value for the Stimulus Value \"${propertyPath}\" must match the defined type \"${typeFromObject}\". The provided default value of \"${typeObject.default}\" is of type \"${typeFromDefaultValue}\".`);\n }\n if (fullObject)\n return typeFromObject;\n}\nfunction parseValueTypeDefinition(payload) {\n const { controller, token, typeDefinition } = payload;\n const typeObject = { controller, token, typeObject: typeDefinition };\n const typeFromObject = parseValueTypeObject(typeObject);\n const typeFromDefaultValue = parseValueTypeDefault(typeDefinition);\n const typeFromConstant = parseValueTypeConstant(typeDefinition);\n const type = typeFromObject || typeFromDefaultValue || typeFromConstant;\n if (type)\n return type;\n const propertyPath = controller ? `${controller}.${typeDefinition}` : token;\n throw new Error(`Unknown value type \"${propertyPath}\" for \"${token}\" value`);\n}\nfunction defaultValueForDefinition(typeDefinition) {\n const constant = parseValueTypeConstant(typeDefinition);\n if (constant)\n return defaultValuesByType[constant];\n const hasDefault = hasProperty(typeDefinition, \"default\");\n const hasType = hasProperty(typeDefinition, \"type\");\n const typeObject = typeDefinition;\n if (hasDefault)\n return typeObject.default;\n if (hasType) {\n const { type } = typeObject;\n const constantFromType = parseValueTypeConstant(type);\n if (constantFromType)\n return defaultValuesByType[constantFromType];\n }\n return typeDefinition;\n}\nfunction valueDescriptorForTokenAndTypeDefinition(payload) {\n const { token, typeDefinition } = payload;\n const key = `${dasherize(token)}-value`;\n const type = parseValueTypeDefinition(payload);\n return {\n type,\n key,\n name: camelize(key),\n get defaultValue() {\n return defaultValueForDefinition(typeDefinition);\n },\n get hasCustomDefaultValue() {\n return parseValueTypeDefault(typeDefinition) !== undefined;\n },\n reader: readers[type],\n writer: writers[type] || writers.default,\n };\n}\nconst defaultValuesByType = {\n get array() {\n return [];\n },\n boolean: false,\n number: 0,\n get object() {\n return {};\n },\n string: \"\",\n};\nconst readers = {\n array(value) {\n const array = JSON.parse(value);\n if (!Array.isArray(array)) {\n throw new TypeError(`expected value of type \"array\" but instead got value \"${value}\" of type \"${parseValueTypeDefault(array)}\"`);\n }\n return array;\n },\n boolean(value) {\n return !(value == \"0\" || String(value).toLowerCase() == \"false\");\n },\n number(value) {\n return Number(value.replace(/_/g, \"\"));\n },\n object(value) {\n const object = JSON.parse(value);\n if (object === null || typeof object != \"object\" || Array.isArray(object)) {\n throw new TypeError(`expected value of type \"object\" but instead got value \"${value}\" of type \"${parseValueTypeDefault(object)}\"`);\n }\n return object;\n },\n string(value) {\n return value;\n },\n};\nconst writers = {\n default: writeString,\n array: writeJSON,\n object: writeJSON,\n};\nfunction writeJSON(value) {\n return JSON.stringify(value);\n}\nfunction writeString(value) {\n return `${value}`;\n}\n\nclass Controller {\n constructor(context) {\n this.context = context;\n }\n static get shouldLoad() {\n return true;\n }\n static afterLoad(_identifier, _application) {\n return;\n }\n get application() {\n return this.context.application;\n }\n get scope() {\n return this.context.scope;\n }\n get element() {\n return this.scope.element;\n }\n get identifier() {\n return this.scope.identifier;\n }\n get targets() {\n return this.scope.targets;\n }\n get outlets() {\n return this.scope.outlets;\n }\n get classes() {\n return this.scope.classes;\n }\n get data() {\n return this.scope.data;\n }\n initialize() {\n }\n connect() {\n }\n disconnect() {\n }\n dispatch(eventName, { target = this.element, detail = {}, prefix = this.identifier, bubbles = true, cancelable = true, } = {}) {\n const type = prefix ? `${prefix}:${eventName}` : eventName;\n const event = new CustomEvent(type, { detail, bubbles, cancelable });\n target.dispatchEvent(event);\n return event;\n }\n}\nController.blessings = [\n ClassPropertiesBlessing,\n TargetPropertiesBlessing,\n ValuePropertiesBlessing,\n OutletPropertiesBlessing,\n];\nController.targets = [];\nController.outlets = [];\nController.values = {};\n\nexport { Application, AttributeObserver, Context, Controller, ElementObserver, IndexedMultimap, Multimap, SelectorObserver, StringMapObserver, TokenListObserver, ValueListObserver, add, defaultSchema, del, fetch, prune };\n", "var x=Object.defineProperty;var V=(t,s,e)=>s in t?x(t,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[s]=e;var i=(t,s,e)=>V(t,typeof s!=\"symbol\"?s+\"\":s,e);import{Controller as y}from\"@hotwired/stimulus\";async function n(t,s,e={}){s?await T(t,e):await b(t,e)}async function T(t,s={}){let{transitionClasses:e,fromClasses:a,toClasses:o,toggleClass:r}=C(\"Enter\",t,s);return v(t,{firstFrame(){t.classList.add(...e.split(\" \")),t.classList.add(...a.split(\" \")),t.classList.remove(...o.split(\" \")),t.classList.remove(...r.split(\" \"))},secondFrame(){t.classList.remove(...a.split(\" \")),t.classList.add(...o.split(\" \"))},ending(){t.classList.remove(...e.split(\" \"))}})}async function b(t,s={}){let{transitionClasses:e,fromClasses:a,toClasses:o,toggleClass:r}=C(\"Leave\",t,s);return v(t,{firstFrame(){t.classList.add(...a.split(\" \")),t.classList.remove(...o.split(\" \")),t.classList.add(...e.split(\" \"))},secondFrame(){t.classList.remove(...a.split(\" \")),t.classList.add(...o.split(\" \"))},ending(){t.classList.remove(...e.split(\" \")),t.classList.add(...r.split(\" \"))}})}function C(t,s,e){return{transitionClasses:s.dataset[`transition${t}`]||e[t.toLowerCase()]||t.toLowerCase(),fromClasses:s.dataset[`transition${t}From`]||e[`${t.toLowerCase()}From`]||`${t.toLowerCase()}-from`,toClasses:s.dataset[`transition${t}To`]||e[`${t.toLowerCase()}To`]||`${t.toLowerCase()}-to`,toggleClass:s.dataset.toggleClass||e.toggleClass||e.toggle||\"hidden\"}}function L(t){t._stimulus_transition={timeout:null,interrupted:!1}}function I(t){t._stimulus_transition&&t._stimulus_transition.interrupt&&t._stimulus_transition.interrupt()}function v(t,s){t._stimulus_transition&&I(t);let e,a,o;return L(t),t._stimulus_transition.cleanup=()=>{a||s.firstFrame(),o||s.secondFrame(),s.ending(),t._stimulus_transition=null},t._stimulus_transition.interrupt=()=>{e=!0,t._stimulus_transition.timeout&&clearTimeout(t._stimulus_transition.timeout),t._stimulus_transition.cleanup()},new Promise(r=>{e||requestAnimationFrame(()=>{e||(s.firstFrame(),a=!0,requestAnimationFrame(()=>{e||(s.secondFrame(),o=!0,t._stimulus_transition&&(t._stimulus_transition.timeout=setTimeout(()=>{if(e){r();return}t._stimulus_transition.cleanup(),r()},w(t))))}))})})}function w(t){let s=Number(getComputedStyle(t).transitionDuration.replace(/,.*/,\"\").replace(\"s\",\"\"))*1e3,e=Number(getComputedStyle(t).transitionDelay.replace(/,.*/,\"\").replace(\"s\",\"\"))*1e3;return s===0&&(s=Number(getComputedStyle(t).animationDuration.replace(\"s\",\"\"))*1e3),s+e}var g=class extends y{connect(){setTimeout(()=>{T(this.element)},this.showDelayValue),this.hasDismissAfterValue&&setTimeout(()=>{this.close()},this.dismissAfterValue)}close(){b(this.element).then(()=>{this.element.remove()})}};i(g,\"values\",{dismissAfter:Number,showDelay:{type:Number,default:0}});import{Controller as A}from\"@hotwired/stimulus\";var h=class extends A{connect(){this.timeout=null}save(){clearTimeout(this.timeout),this.timeout=setTimeout(()=>{this.statusTarget.textContent=this.submittingTextValue,this.formTarget.requestSubmit()},this.submitDurationValue)}success(){this.setStatus(this.successTextValue)}error(){this.setStatus(this.errorTextValue)}setStatus(t){this.statusTarget.textContent=t,this.timeout=setTimeout(()=>{this.statusTarget.textContent=\"\"},this.statusDurationValue)}};i(h,\"targets\",[\"form\",\"status\"]),i(h,\"values\",{submitDuration:{type:Number,default:1e3},statusDuration:{type:Number,default:2e3},submittingText:{type:String,default:\"Saving...\"},successText:{type:String,default:\"Saved!\"},errorText:{type:String,default:\"Unable to save.\"}});import{Controller as _}from\"@hotwired/stimulus\";var c=class extends _{update(){this.preview=this.colorTarget.value}set preview(t){this.previewTarget.style[this.styleValue]=t;let s=this._getContrastYIQ(t);this.styleValue===\"color\"?this.previewTarget.style.backgroundColor=s:this.previewTarget.style.color=s}_getContrastYIQ(t){t=t.replace(\"#\",\"\");let s=128,e=parseInt(t.substr(0,2),16),a=parseInt(t.substr(2,2),16),o=parseInt(t.substr(4,2),16);return(e*299+a*587+o*114)/1e3>=s?\"#000\":\"#fff\"}};i(c,\"targets\",[\"preview\",\"color\"]),i(c,\"values\",{style:{type:String,default:\"backgroundColor\"}});import{Controller as D}from\"@hotwired/stimulus\";var l=class extends D{connect(){this.boundBeforeCache=this.beforeCache.bind(this),document.addEventListener(\"turbo:before-cache\",this.boundBeforeCache)}disconnect(){document.removeEventListener(\"turbo:before-cache\",this.boundBeforeCache)}openValueChanged(){n(this.menuTarget,this.openValue,this.transitionOptions),this.openValue===!0&&this.hasMenuItemTarget&&this.menuItemTargets[0].focus()}show(){this.openValue=!0}close(){this.openValue=!1}hide(t){this.closeOnClickOutsideValue&&t.target.nodeType&&this.element.contains(t.target)===!1&&this.openValue&&(this.openValue=!1),this.closeOnEscapeValue&&t.key===\"Escape\"&&this.openValue&&(this.openValue=!1)}toggle(){this.openValue=!this.openValue}nextItem(t){t.preventDefault(),this.menuItemTargets[this.nextIndex].focus()}previousItem(t){t.preventDefault(),this.menuItemTargets[this.previousIndex].focus()}get currentItemIndex(){return this.menuItemTargets.indexOf(document.activeElement)}get nextIndex(){return Math.min(this.currentItemIndex+1,this.menuItemTargets.length-1)}get previousIndex(){return Math.max(this.currentItemIndex-1,0)}get transitionOptions(){return{enter:this.hasEnterClass?this.enterClass:\"transition ease-out duration-100\",enterFrom:this.hasEnterFromClass?this.enterFromClass:\"transform opacity-0 scale-95\",enterTo:this.hasEnterToClass?this.enterToClass:\"transform opacity-100 scale-100\",leave:this.hasLeaveClass?this.leaveClass:\"transition ease-in duration-75\",leaveFrom:this.hasLeaveFromClass?this.leaveFromClass:\"transform opacity-100 scale-100\",leaveTo:this.hasLeaveToClass?this.leaveToClass:\"transform opacity-0 scale-95\",toggleClass:this.hasToggleClass?this.toggleClass:\"hidden\"}}beforeCache(){this.openValue=!1,this.menuTarget.classList.add(\"hidden\")}};i(l,\"targets\",[\"menu\",\"button\",\"menuItem\"]),i(l,\"values\",{open:{type:Boolean,default:!1},closeOnEscape:{type:Boolean,default:!0},closeOnClickOutside:{type:Boolean,default:!0}}),i(l,\"classes\",[\"enter\",\"enterFrom\",\"enterTo\",\"leave\",\"leaveFrom\",\"leaveTo\",\"toggle\"]);import{Controller as F}from\"@hotwired/stimulus\";var d=class extends F{connect(){this.openValue&&this.open(),this.boundBeforeCache=this.beforeCache.bind(this),document.addEventListener(\"turbo:before-cache\",this.boundBeforeCache)}disconnect(){document.removeEventListener(\"turbo:before-cache\",this.boundBeforeCache)}open(){this.dialogTarget.showModal()}close(){this.dialogTarget.setAttribute(\"closing\",\"\"),Promise.all(this.dialogTarget.getAnimations().map(t=>t.finished)).then(()=>{this.dialogTarget.removeAttribute(\"closing\"),this.dialogTarget.close()})}backdropClose(t){t.target.nodeName==\"DIALOG\"&&this.close()}show(){this.dialogTarget.show()}hide(){this.close()}beforeCache(){this.close()}};i(d,\"targets\",[\"dialog\"]),i(d,\"values\",{open:Boolean});import{Controller as B}from\"@hotwired/stimulus\";var f=class extends B{openValueChanged(){n(this.contentTarget,this.openValue),this.shouldAutoDismiss&&this.scheduleDismissal()}show(t){this.shouldAutoDismiss&&this.scheduleDismissal(),this.openValue=!0}hide(){this.openValue=!1}toggle(){this.openValue=!this.openValue}get shouldAutoDismiss(){return this.openValue&&this.hasDismissAfterValue}scheduleDismissal(){this.hasDismissAfterValue&&(this.cancelDismissal(),this.timeoutId=setTimeout(()=>{this.hide(),this.timeoutId=void 0},this.dismissAfterValue))}cancelDismissal(){typeof this.timeoutId==\"number\"&&(clearTimeout(this.timeoutId),this.timeoutId=void 0)}};i(f,\"targets\",[\"content\"]),i(f,\"values\",{dismissAfter:Number,open:{type:Boolean,default:!1}});import{Controller as E}from\"@hotwired/stimulus\";var m=class extends E{connect(){this.openValue&&this.open(),this.boundBeforeCache=this.beforeCache,document.addEventListener(\"turbo:before-cache\",this.boundBeforeCache)}disconnect(){document.removeEventListener(\"turbo:before-cache\",this.boundBeforeCache)}open(){this.dialogTarget.showModal()}close(){this.dialogTarget.setAttribute(\"closing\",\"\"),Promise.all(this.dialogTarget.getAnimations().map(t=>t.finished)).then(()=>{this.dialogTarget.removeAttribute(\"closing\"),this.dialogTarget.close()})}backdropClose(t){t.target.nodeName==\"DIALOG\"&&this.close()}show(){this.open()}hide(){this.close()}beforeCache(){this.close()}};i(m,\"targets\",[\"dialog\"]),i(m,\"values\",{open:Boolean});import{Controller as S}from\"@hotwired/stimulus\";var u=class extends S{initialize(){this.updateAnchorValue&&this.anchor&&(this.indexValue=this.tabTargets.findIndex(t=>t.id===this.anchor))}connect(){this.showTab()}change(t){t.currentTarget.tagName===\"SELECT\"?this.indexValue=t.currentTarget.selectedIndex:t.currentTarget.dataset.index?this.indexValue=t.currentTarget.dataset.index:t.currentTarget.dataset.id?this.indexValue=this.tabTargets.findIndex(s=>s.id==t.currentTarget.dataset.id):this.indexValue=this.tabTargets.indexOf(t.currentTarget)}nextTab(){this.indexValue=Math.min(this.indexValue+1,this.tabsCount-1)}previousTab(){this.indexValue=Math.max(this.indexValue-1,0)}firstTab(){this.indexValue=0}lastTab(){this.indexValue=this.tabsCount-1}indexValueChanged(){if(this.showTab(),this.dispatch(\"tab-change\",{target:this.tabTargets[this.indexValue],detail:{activeIndex:this.indexValue}}),this.updateAnchorValue){let t=this.tabTargets[this.indexValue].id;if(this.scrollToAnchorValue)location.hash=t;else{let e=window.location.href.split(\"#\")[0]+\"#\"+t;typeof Turbo<\"u\"?Turbo.navigator.history.replace(new URL(e)):history.replaceState({},document.title,e)}}}showTab(){this.panelTargets.forEach((t,s)=>{let e=this.tabTargets[s];s===this.indexValue?(t.classList.remove(\"hidden\"),e.ariaSelected=\"true\",e.dataset.active=!0,this.hasInactiveTabClass&&e?.classList?.remove(...this.inactiveTabClasses),this.hasActiveTabClass&&e?.classList?.add(...this.activeTabClasses)):(t.classList.add(\"hidden\"),e.ariaSelected=null,delete e.dataset.active,this.hasActiveTabClass&&e?.classList?.remove(...this.activeTabClasses),this.hasInactiveTabClass&&e?.classList?.add(...this.inactiveTabClasses))}),this.hasSelectTarget&&(this.selectTarget.selectedIndex=this.indexValue),this.scrollActiveTabIntoViewValue&&this.scrollToActiveTab()}scrollToActiveTab(){let t=this.element.querySelector(\"[aria-selected]\");t&&t.scrollIntoView({inline:\"center\"})}get tabsCount(){return this.tabTargets.length}get anchor(){return document.URL.split(\"#\").length>1?document.URL.split(\"#\")[1]:null}};i(u,\"classes\",[\"activeTab\",\"inactiveTab\"]),i(u,\"targets\",[\"tab\",\"panel\",\"select\"]),i(u,\"values\",{index:0,updateAnchor:Boolean,scrollToAnchor:Boolean,scrollActiveTabIntoView:Boolean});import{Controller as N}from\"@hotwired/stimulus\";var p=class extends N{toggle(t){this.openValue=!this.openValue,this.animate()}toggleInput(t){this.openValue=t.target.checked,this.animate()}hide(){this.openValue=!1,this.animate()}show(){this.openValue=!0,this.animate()}animate(){this.toggleableTargets.forEach(t=>{n(t,this.openValue)})}};i(p,\"targets\",[\"toggleable\"]),i(p,\"values\",{open:{type:Boolean,default:!1}});export{g as Alert,h as Autosave,c as ColorPreview,l as Dropdown,d as Modal,f as Popover,m as Slideover,u as Tabs,p as Toggle,n as transition};\n", "import { Application } from \"@hotwired/stimulus\"\n\nconst application = Application.start()\n\nimport { Alert, Dropdown } from \"tailwindcss-stimulus-components\"\napplication.register('alert', Alert)\napplication.register('dropdown', Dropdown)\n\n// Configure Stimulus development experience\napplication.debug = false\nwindow.Stimulus = application\n\nexport { application }\n", "import { Controller } from \"@hotwired/stimulus\"\n\n// Connects to data-controller=\"cloudflare-turnstile\"\nexport default class extends Controller {\n connect() {\n if (document.querySelector('.cf-turnstile') && window.turnstile) {\n window.turnstile.render(\".cf-turnstile\")\n }\n }\n}", "import { Controller } from \"@hotwired/stimulus\"\n\nexport default class extends Controller {\n connect() {\n this.element.textContent = \"Hello World!\"\n }\n}\n", "// This file is auto-generated by ./bin/rails stimulus:manifest:update\n// Run that command whenever you add a new controller or create them with\n// ./bin/rails generate stimulus controllerName\n\nimport { application } from \"./application\"\n\nimport CloudflareTurnstileController from \"./cloudflare_turnstile_controller\"\napplication.register(\"cloudflare-turnstile\", CloudflareTurnstileController)\n\nimport HelloController from \"./hello_controller\"\napplication.register(\"hello\", HelloController)\n", "export const attachmentSelector = \"[data-trix-attachment]\"\n\nconst attachments = {\n preview: {\n presentation: \"gallery\",\n caption: {\n name: true,\n size: true,\n },\n },\n file: {\n caption: {\n size: true,\n },\n },\n}\nexport default attachments\n", "const attributes = {\n default: {\n tagName: \"div\",\n parse: false,\n },\n quote: {\n tagName: \"blockquote\",\n nestable: true,\n },\n heading1: {\n tagName: \"h1\",\n terminal: true,\n breakOnReturn: true,\n group: false,\n },\n code: {\n tagName: \"pre\",\n terminal: true,\n htmlAttributes: [ \"language\" ],\n text: {\n plaintext: true,\n },\n },\n bulletList: {\n tagName: \"ul\",\n parse: false,\n },\n bullet: {\n tagName: \"li\",\n listAttribute: \"bulletList\",\n group: false,\n nestable: true,\n test(element) {\n return tagName(element.parentNode) === attributes[this.listAttribute].tagName\n },\n },\n numberList: {\n tagName: \"ol\",\n parse: false,\n },\n number: {\n tagName: \"li\",\n listAttribute: \"numberList\",\n group: false,\n nestable: true,\n test(element) {\n return tagName(element.parentNode) === attributes[this.listAttribute].tagName\n },\n },\n attachmentGallery: {\n tagName: \"div\",\n exclusive: true,\n terminal: true,\n parse: false,\n group: false,\n },\n}\n\nconst tagName = (element) => element?.tagName?.toLowerCase()\n\nexport default attributes\n", "const androidVersionMatch = navigator.userAgent.match(/android\\s([0-9]+.*Chrome)/i)\nconst androidVersion = androidVersionMatch && parseInt(androidVersionMatch[1])\n\nexport default {\n // Android emits composition events when moving the cursor through existing text\n // Introduced in Chrome 65: https://bugs.chromium.org/p/chromium/issues/detail?id=764439#c9\n composesExistingText: /Android.*Chrome/.test(navigator.userAgent),\n\n // Android 13, especially on Samsung keyboards, emits extra compositionend and beforeinput events\n // that can make the input handler lose the current selection or enter an infinite input -> render -> input\n // loop.\n recentAndroid: androidVersion && androidVersion > 12,\n samsungAndroid: androidVersion && navigator.userAgent.match(/Android.*SM-/),\n\n // IE 11 activates resizing handles on editable elements that have \"layout\"\n forcesObjectResizing: /Trident.*rv:11/.test(navigator.userAgent),\n // https://www.w3.org/TR/input-events-1/ + https://www.w3.org/TR/input-events-2/\n supportsInputEvents: typeof InputEvent !== \"undefined\" &&\n [ \"data\", \"getTargetRanges\", \"inputType\" ].every(prop => prop in InputEvent.prototype),\n}\n", "export default {\n attachFiles: \"Attach Files\",\n bold: \"Bold\",\n bullets: \"Bullets\",\n byte: \"Byte\",\n bytes: \"Bytes\",\n captionPlaceholder: \"Add a caption…\",\n code: \"Code\",\n heading1: \"Heading\",\n indent: \"Increase Level\",\n italic: \"Italic\",\n link: \"Link\",\n numbers: \"Numbers\",\n outdent: \"Decrease Level\",\n quote: \"Quote\",\n redo: \"Redo\",\n remove: \"Remove\",\n strike: \"Strikethrough\",\n undo: \"Undo\",\n unlink: \"Unlink\",\n url: \"URL\",\n urlPlaceholder: \"Enter a URL…\",\n GB: \"GB\",\n KB: \"KB\",\n MB: \"MB\",\n PB: \"PB\",\n TB: \"TB\",\n}\n", "/* eslint-disable\n no-case-declarations,\n*/\nimport lang from \"trix/config/lang\"\n\nconst sizes = [ lang.bytes, lang.KB, lang.MB, lang.GB, lang.TB, lang.PB ]\n\nexport default {\n prefix: \"IEC\",\n precision: 2,\n\n formatter(number) {\n switch (number) {\n case 0:\n return `0 ${lang.bytes}`\n case 1:\n return `1 ${lang.byte}`\n default:\n let base\n\n if (this.prefix === \"SI\") {\n base = 1000\n } else if (this.prefix === \"IEC\") {\n base = 1024\n }\n\n const exp = Math.floor(Math.log(number) / Math.log(base))\n const humanSize = number / Math.pow(base, exp)\n const string = humanSize.toFixed(this.precision)\n const withoutInsignificantZeros = string.replace(/0*$/, \"\").replace(/\\.$/, \"\")\n return `${withoutInsignificantZeros} ${sizes[exp]}`\n }\n },\n}\n", "export const ZERO_WIDTH_SPACE = \"\\uFEFF\"\nexport const NON_BREAKING_SPACE = \"\\u00A0\"\nexport const OBJECT_REPLACEMENT_CHARACTER = \"\\uFFFC\"\n", "export const extend = function(properties) {\n for (const key in properties) {\n const value = properties[key]\n this[key] = value\n }\n return this\n}\n", "import blockAttributes from \"trix/config/block_attributes\"\nimport { ZERO_WIDTH_SPACE } from \"trix/constants\"\nimport { extend } from \"./extend\"\nimport { attachmentSelector } from \"trix/config/attachments\"\n\nconst html = document.documentElement\nconst match = html.matches\n\nexport const handleEvent = function(eventName, { onElement, matchingSelector, withCallback, inPhase, preventDefault, times } = {}) {\n const element = onElement ? onElement : html\n const selector = matchingSelector\n const useCapture = inPhase === \"capturing\"\n\n const handler = function(event) {\n if (times != null && --times === 0) {\n handler.destroy()\n }\n const target = findClosestElementFromNode(event.target, { matchingSelector: selector })\n if (target != null) {\n withCallback?.call(target, event, target)\n if (preventDefault) {\n event.preventDefault()\n }\n }\n }\n\n handler.destroy = () => element.removeEventListener(eventName, handler, useCapture)\n\n element.addEventListener(eventName, handler, useCapture)\n return handler\n}\n\nexport const handleEventOnce = function(eventName, options = {}) {\n options.times = 1\n return handleEvent(eventName, options)\n}\n\nexport const triggerEvent = function(eventName, { onElement, bubbles, cancelable, attributes } = {}) {\n const element = onElement != null ? onElement : html\n bubbles = bubbles !== false\n cancelable = cancelable !== false\n\n const event = document.createEvent(\"Events\")\n event.initEvent(eventName, bubbles, cancelable)\n if (attributes != null) {\n extend.call(event, attributes)\n }\n return element.dispatchEvent(event)\n}\n\nexport const elementMatchesSelector = function(element, selector) {\n if (element?.nodeType === 1) {\n return match.call(element, selector)\n }\n}\n\nexport const findClosestElementFromNode = function(node, { matchingSelector, untilNode } = {}) {\n while (node && node.nodeType !== Node.ELEMENT_NODE) {\n node = node.parentNode\n }\n if (node == null) {\n return\n }\n\n if (matchingSelector != null) {\n if (node.closest && untilNode == null) {\n return node.closest(matchingSelector)\n } else {\n while (node && node !== untilNode) {\n if (elementMatchesSelector(node, matchingSelector)) {\n return node\n }\n node = node.parentNode\n }\n }\n } else {\n return node\n }\n}\n\nexport const findInnerElement = function(element) {\n while (element?.firstElementChild) {\n element = element.firstElementChild\n }\n return element\n}\n\nexport const innerElementIsActive = (element) =>\n document.activeElement !== element && elementContainsNode(element, document.activeElement)\n\nexport const elementContainsNode = function(element, node) {\n if (!element || !node) {\n return\n }\n while (node) {\n if (node === element) {\n return true\n }\n node = node.parentNode\n }\n}\n\nexport const findNodeFromContainerAndOffset = function(container, offset) {\n if (!container) {\n return\n }\n if (container.nodeType === Node.TEXT_NODE) {\n return container\n } else if (offset === 0) {\n return container.firstChild != null ? container.firstChild : container\n } else {\n return container.childNodes.item(offset - 1)\n }\n}\n\nexport const findElementFromContainerAndOffset = function(container, offset) {\n const node = findNodeFromContainerAndOffset(container, offset)\n return findClosestElementFromNode(node)\n}\n\nexport const findChildIndexOfNode = function(node) {\n if (!node?.parentNode) {\n return\n }\n let childIndex = 0\n node = node.previousSibling\n while (node) {\n childIndex++\n node = node.previousSibling\n }\n return childIndex\n}\n\nexport const removeNode = (node) => node?.parentNode?.removeChild(node)\n\nexport const walkTree = function(tree, { onlyNodesOfType, usingFilter, expandEntityReferences } = {}) {\n const whatToShow = (() => {\n switch (onlyNodesOfType) {\n case \"element\":\n return NodeFilter.SHOW_ELEMENT\n case \"text\":\n return NodeFilter.SHOW_TEXT\n case \"comment\":\n return NodeFilter.SHOW_COMMENT\n default:\n return NodeFilter.SHOW_ALL\n }\n })()\n\n return document.createTreeWalker(\n tree,\n whatToShow,\n usingFilter != null ? usingFilter : null,\n expandEntityReferences === true\n )\n}\n\nexport const tagName = (element) => element?.tagName?.toLowerCase()\n\nexport const makeElement = function(tag, options = {}) {\n let key, value\n if (typeof tag === \"object\") {\n options = tag\n tag = options.tagName\n } else {\n options = { attributes: options }\n }\n\n const element = document.createElement(tag)\n\n if (options.editable != null) {\n if (options.attributes == null) {\n options.attributes = {}\n }\n options.attributes.contenteditable = options.editable\n }\n\n if (options.attributes) {\n for (key in options.attributes) {\n value = options.attributes[key]\n element.setAttribute(key, value)\n }\n }\n\n if (options.style) {\n for (key in options.style) {\n value = options.style[key]\n element.style[key] = value\n }\n }\n\n if (options.data) {\n for (key in options.data) {\n value = options.data[key]\n element.dataset[key] = value\n }\n }\n\n if (options.className) {\n options.className.split(\" \").forEach((className) => {\n element.classList.add(className)\n })\n }\n\n if (options.textContent) {\n element.textContent = options.textContent\n }\n\n if (options.childNodes) {\n [].concat(options.childNodes).forEach((childNode) => {\n element.appendChild(childNode)\n })\n }\n\n return element\n}\n\nlet blockTagNames = undefined\n\nexport const getBlockTagNames = function() {\n if (blockTagNames != null) {\n return blockTagNames\n }\n\n blockTagNames = []\n for (const key in blockAttributes) {\n const attributes = blockAttributes[key]\n if (attributes.tagName) {\n blockTagNames.push(attributes.tagName)\n }\n }\n\n return blockTagNames\n}\n\nexport const nodeIsBlockContainer = (node) => nodeIsBlockStartComment(node?.firstChild)\n\nexport const nodeProbablyIsBlockContainer = function(node) {\n return getBlockTagNames().includes(tagName(node)) && !getBlockTagNames().includes(tagName(node.firstChild))\n}\n\nexport const nodeIsBlockStart = function(node, { strict } = { strict: true }) {\n if (strict) {\n return nodeIsBlockStartComment(node)\n } else {\n return (\n nodeIsBlockStartComment(node) || !nodeIsBlockStartComment(node.firstChild) && nodeProbablyIsBlockContainer(node)\n )\n }\n}\n\nexport const nodeIsBlockStartComment = (node) => nodeIsCommentNode(node) && node?.data === \"block\"\n\nexport const nodeIsCommentNode = (node) => node?.nodeType === Node.COMMENT_NODE\n\nexport const nodeIsCursorTarget = function(node, { name } = {}) {\n if (!node) {\n return\n }\n if (nodeIsTextNode(node)) {\n if (node.data === ZERO_WIDTH_SPACE) {\n if (name) {\n return node.parentNode.dataset.trixCursorTarget === name\n } else {\n return true\n }\n }\n } else {\n return nodeIsCursorTarget(node.firstChild)\n }\n}\n\nexport const nodeIsAttachmentElement = (node) => elementMatchesSelector(node, attachmentSelector)\n\nexport const nodeIsEmptyTextNode = (node) => nodeIsTextNode(node) && node?.data === \"\"\n\nexport const nodeIsTextNode = (node) => node?.nodeType === Node.TEXT_NODE\n", "import browser from \"trix/config/browser\"\nimport { makeElement, removeNode } from \"trix/core/helpers/dom\"\n\nconst input = {\n level2Enabled: true,\n\n getLevel() {\n if (this.level2Enabled && browser.supportsInputEvents) {\n return 2\n } else {\n return 0\n }\n },\n pickFiles(callback) {\n const input = makeElement(\"input\", { type: \"file\", multiple: true, hidden: true, id: this.fileInputId })\n\n input.addEventListener(\"change\", () => {\n callback(input.files)\n removeNode(input)\n })\n\n removeNode(document.getElementById(this.fileInputId))\n document.body.appendChild(input)\n input.click()\n }\n}\n\nexport default input\n", "export default {\n 8: \"backspace\",\n 9: \"tab\",\n 13: \"return\",\n 27: \"escape\",\n 37: \"left\",\n 39: \"right\",\n 46: \"delete\",\n 68: \"d\",\n 72: \"h\",\n 79: \"o\",\n}\n", "export default {\n removeBlankTableCells: false,\n tableCellSeparator: \" | \",\n tableRowSeparator: \"\\n\",\n}\n", "import { attachmentSelector } from \"trix/config/attachments\"\n\nexport default {\n bold: {\n tagName: \"strong\",\n inheritable: true,\n parser(element) {\n const style = window.getComputedStyle(element)\n return style.fontWeight === \"bold\" || style.fontWeight >= 600\n },\n },\n italic: {\n tagName: \"em\",\n inheritable: true,\n parser(element) {\n const style = window.getComputedStyle(element)\n return style.fontStyle === \"italic\"\n },\n },\n href: {\n groupTagName: \"a\",\n parser(element) {\n const matchingSelector = `a:not(${attachmentSelector})`\n const link = element.closest(matchingSelector)\n if (link) {\n return link.getAttribute(\"href\")\n }\n },\n },\n strike: {\n tagName: \"del\",\n inheritable: true,\n },\n frozen: {\n style: { backgroundColor: \"highlight\" },\n },\n}\n", "import lang from \"trix/config/lang\"\n\nexport default {\n getDefaultHTML() {\n return `<div class=\"trix-button-row\">\n <span class=\"trix-button-group trix-button-group--text-tools\" data-trix-button-group=\"text-tools\">\n <button type=\"button\" class=\"trix-button trix-button--icon trix-button--icon-bold\" data-trix-attribute=\"bold\" data-trix-key=\"b\" title=\"${lang.bold}\" tabindex=\"-1\">${lang.bold}</button>\n <button type=\"button\" class=\"trix-button trix-button--icon trix-button--icon-italic\" data-trix-attribute=\"italic\" data-trix-key=\"i\" title=\"${lang.italic}\" tabindex=\"-1\">${lang.italic}</button>\n <button type=\"button\" class=\"trix-button trix-button--icon trix-button--icon-strike\" data-trix-attribute=\"strike\" title=\"${lang.strike}\" tabindex=\"-1\">${lang.strike}</button>\n <button type=\"button\" class=\"trix-button trix-button--icon trix-button--icon-link\" data-trix-attribute=\"href\" data-trix-action=\"link\" data-trix-key=\"k\" title=\"${lang.link}\" tabindex=\"-1\">${lang.link}</button>\n </span>\n\n <span class=\"trix-button-group trix-button-group--block-tools\" data-trix-button-group=\"block-tools\">\n <button type=\"button\" class=\"trix-button trix-button--icon trix-button--icon-heading-1\" data-trix-attribute=\"heading1\" title=\"${lang.heading1}\" tabindex=\"-1\">${lang.heading1}</button>\n <button type=\"button\" class=\"trix-button trix-button--icon trix-button--icon-quote\" data-trix-attribute=\"quote\" title=\"${lang.quote}\" tabindex=\"-1\">${lang.quote}</button>\n <button type=\"button\" class=\"trix-button trix-button--icon trix-button--icon-code\" data-trix-attribute=\"code\" title=\"${lang.code}\" tabindex=\"-1\">${lang.code}</button>\n <button type=\"button\" class=\"trix-button trix-button--icon trix-button--icon-bullet-list\" data-trix-attribute=\"bullet\" title=\"${lang.bullets}\" tabindex=\"-1\">${lang.bullets}</button>\n <button type=\"button\" class=\"trix-button trix-button--icon trix-button--icon-number-list\" data-trix-attribute=\"number\" title=\"${lang.numbers}\" tabindex=\"-1\">${lang.numbers}</button>\n <button type=\"button\" class=\"trix-button trix-button--icon trix-button--icon-decrease-nesting-level\" data-trix-action=\"decreaseNestingLevel\" title=\"${lang.outdent}\" tabindex=\"-1\">${lang.outdent}</button>\n <button type=\"button\" class=\"trix-button trix-button--icon trix-button--icon-increase-nesting-level\" data-trix-action=\"increaseNestingLevel\" title=\"${lang.indent}\" tabindex=\"-1\">${lang.indent}</button>\n </span>\n\n <span class=\"trix-button-group trix-button-group--file-tools\" data-trix-button-group=\"file-tools\">\n <button type=\"button\" class=\"trix-button trix-button--icon trix-button--icon-attach\" data-trix-action=\"attachFiles\" title=\"${lang.attachFiles}\" tabindex=\"-1\">${lang.attachFiles}</button>\n </span>\n\n <span class=\"trix-button-group-spacer\"></span>\n\n <span class=\"trix-button-group trix-button-group--history-tools\" data-trix-button-group=\"history-tools\">\n <button type=\"button\" class=\"trix-button trix-button--icon trix-button--icon-undo\" data-trix-action=\"undo\" data-trix-key=\"z\" title=\"${lang.undo}\" tabindex=\"-1\">${lang.undo}</button>\n <button type=\"button\" class=\"trix-button trix-button--icon trix-button--icon-redo\" data-trix-action=\"redo\" data-trix-key=\"shift+z\" title=\"${lang.redo}\" tabindex=\"-1\">${lang.redo}</button>\n </span>\n </div>\n\n <div class=\"trix-dialogs\" data-trix-dialogs>\n <div class=\"trix-dialog trix-dialog--link\" data-trix-dialog=\"href\" data-trix-dialog-attribute=\"href\">\n <div class=\"trix-dialog__link-fields\">\n <input type=\"url\" name=\"href\" class=\"trix-input trix-input--dialog\" placeholder=\"${lang.urlPlaceholder}\" aria-label=\"${lang.url}\" required data-trix-input>\n <div class=\"trix-button-group\">\n <input type=\"button\" class=\"trix-button trix-button--dialog\" value=\"${lang.link}\" data-trix-method=\"setAttribute\">\n <input type=\"button\" class=\"trix-button trix-button--dialog\" value=\"${lang.unlink}\" data-trix-method=\"removeAttribute\">\n </div>\n </div>\n </div>\n </div>`\n },\n}\n", "const undo = { interval: 5000 }\nexport default undo\n", "export default {\n attachment: \"attachment\",\n attachmentCaption: \"attachment__caption\",\n attachmentCaptionEditor: \"attachment__caption-editor\",\n attachmentMetadata: \"attachment__metadata\",\n attachmentMetadataContainer: \"attachment__metadata-container\",\n attachmentName: \"attachment__name\",\n attachmentProgress: \"attachment__progress\",\n attachmentSize: \"attachment__size\",\n attachmentToolbar: \"attachment__toolbar\",\n attachmentGallery: \"attachment-gallery\",\n}\n", "export default class BasicObject {\n static proxyMethod(expression) {\n const { name, toMethod, toProperty, optional } = parseProxyMethodExpression(expression)\n\n this.prototype[name] = function() {\n let subject\n let object\n\n if (toMethod) {\n if (optional) {\n object = this[toMethod]?.()\n } else {\n object = this[toMethod]()\n }\n } else if (toProperty) {\n object = this[toProperty]\n }\n\n if (optional) {\n subject = object?.[name]\n if (subject) {\n return apply.call(subject, object, arguments)\n }\n } else {\n subject = object[name]\n return apply.call(subject, object, arguments)\n }\n }\n }\n}\n\nconst parseProxyMethodExpression = function(expression) {\n const match = expression.match(proxyMethodExpressionPattern)\n if (!match) {\n throw new Error(`can't parse @proxyMethod expression: ${expression}`)\n }\n\n const args = { name: match[4] }\n\n if (match[2] != null) {\n args.toMethod = match[1]\n } else {\n args.toProperty = match[1]\n }\n\n if (match[3] != null) {\n args.optional = true\n }\n\n return args\n}\n\nconst { apply } = Function.prototype\n\nconst proxyMethodExpressionPattern = new RegExp(\"\\\n^\\\n(.+?)\\\n(\\\\(\\\\))?\\\n(\\\\?)?\\\n\\\\.\\\n(.+?)\\\n$\\\n\")\n", "import BasicObject from \"trix/core/basic_object\"\n\nexport default class UTF16String extends BasicObject {\n static box(value = \"\") {\n if (value instanceof this) {\n return value\n } else {\n return this.fromUCS2String(value?.toString())\n }\n }\n\n static fromUCS2String(ucs2String) {\n return new this(ucs2String, ucs2decode(ucs2String))\n }\n\n static fromCodepoints(codepoints) {\n return new this(ucs2encode(codepoints), codepoints)\n }\n\n constructor(ucs2String, codepoints) {\n super(...arguments)\n this.ucs2String = ucs2String\n this.codepoints = codepoints\n this.length = this.codepoints.length\n this.ucs2Length = this.ucs2String.length\n }\n\n offsetToUCS2Offset(offset) {\n return ucs2encode(this.codepoints.slice(0, Math.max(0, offset))).length\n }\n\n offsetFromUCS2Offset(ucs2Offset) {\n return ucs2decode(this.ucs2String.slice(0, Math.max(0, ucs2Offset))).length\n }\n\n slice() {\n return this.constructor.fromCodepoints(this.codepoints.slice(...arguments))\n }\n\n charAt(offset) {\n return this.slice(offset, offset + 1)\n }\n\n isEqualTo(value) {\n return this.constructor.box(value).ucs2String === this.ucs2String\n }\n\n toJSON() {\n return this.ucs2String\n }\n\n getCacheKey() {\n return this.ucs2String\n }\n\n toString() {\n return this.ucs2String\n }\n}\n\nconst hasArrayFrom = Array.from?.(\"\\ud83d\\udc7c\").length === 1\nconst hasStringCodePointAt = \" \".codePointAt?.(0) != null\nconst hasStringFromCodePoint = String.fromCodePoint?.(32, 128124) === \" \\ud83d\\udc7c\"\n\n// UCS-2 conversion helpers ported from Mathias Bynens' Punycode.js:\n// https://github.com/bestiejs/punycode.js#punycodeucs2\n\nlet ucs2decode, ucs2encode\n\n// Creates an array containing the numeric code points of each Unicode\n// character in the string. While JavaScript uses UCS-2 internally,\n// this function will convert a pair of surrogate halves (each of which\n// UCS-2 exposes as separate characters) into a single code point,\n// matching UTF-16.\nif (hasArrayFrom && hasStringCodePointAt) {\n ucs2decode = (string) => Array.from(string).map((char) => char.codePointAt(0))\n} else {\n ucs2decode = function(string) {\n const output = []\n let counter = 0\n const { length } = string\n\n while (counter < length) {\n let value = string.charCodeAt(counter++)\n if (0xd800 <= value && value <= 0xdbff && counter < length) {\n // high surrogate, and there is a next character\n const extra = string.charCodeAt(counter++)\n if ((extra & 0xfc00) === 0xdc00) {\n // low surrogate\n value = ((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000\n } else {\n // unmatched surrogate; only append this code unit, in case the\n // next code unit is the high surrogate of a surrogate pair\n counter--\n }\n }\n output.push(value)\n }\n\n return output\n }\n}\n\n// Creates a string based on an array of numeric code points.\nif (hasStringFromCodePoint) {\n ucs2encode = (array) => String.fromCodePoint(...Array.from(array || []))\n} else {\n ucs2encode = function(array) {\n const characters = (() => {\n const result = []\n\n Array.from(array).forEach((value) => {\n let output = \"\"\n if (value > 0xffff) {\n value -= 0x10000\n output += String.fromCharCode(value >>> 10 & 0x3ff | 0xd800)\n value = 0xdc00 | value & 0x3ff\n }\n result.push(output + String.fromCharCode(value))\n })\n\n return result\n })()\n\n return characters.join(\"\")\n }\n}\n", "import BasicObject from \"trix/core/basic_object\"\nimport UTF16String from \"trix/core/utilities/utf16_string\"\n\nlet id = 0\n\nexport default class TrixObject extends BasicObject {\n static fromJSONString(jsonString) {\n return this.fromJSON(JSON.parse(jsonString))\n }\n\n constructor() {\n super(...arguments)\n this.id = ++id\n }\n\n hasSameConstructorAs(object) {\n return this.constructor === object?.constructor\n }\n\n isEqualTo(object) {\n return this === object\n }\n\n inspect() {\n const parts = []\n const contents = this.contentsForInspection() || {}\n\n for (const key in contents) {\n const value = contents[key]\n parts.push(`${key}=${value}`)\n }\n\n return `#<${this.constructor.name}:${this.id}${parts.length ? ` ${parts.join(\", \")}` : \"\"}>`\n }\n\n contentsForInspection() {}\n\n toJSONString() {\n return JSON.stringify(this)\n }\n\n toUTF16String() {\n return UTF16String.box(this)\n }\n\n getCacheKey() {\n return this.id.toString()\n }\n}\n", "/* eslint-disable\n id-length,\n*/\nexport const arraysAreEqual = function(a = [], b = []) {\n if (a.length !== b.length) {\n return false\n }\n for (let index = 0; index < a.length; index++) {\n const value = a[index]\n if (value !== b[index]) {\n return false\n }\n }\n return true\n}\n\nexport const arrayStartsWith = (a = [], b = []) => arraysAreEqual(a.slice(0, b.length), b)\n\nexport const spliceArray = function(array, ...args) {\n const result = array.slice(0)\n result.splice(...args)\n return result\n}\n\nexport const summarizeArrayChange = function(oldArray = [], newArray = []) {\n const added = []\n const removed = []\n\n const existingValues = new Set()\n\n oldArray.forEach((value) => {\n existingValues.add(value)\n })\n\n const currentValues = new Set()\n\n newArray.forEach((value) => {\n currentValues.add(value)\n if (!existingValues.has(value)) {\n added.push(value)\n }\n })\n\n oldArray.forEach((value) => {\n if (!currentValues.has(value)) {\n removed.push(value)\n }\n })\n\n return { added, removed }\n}\n", "import { makeElement } from \"trix/core/helpers/dom\"\n\n// https://github.com/mathiasbynens/unicode-2.1.8/blob/master/Bidi_Class/Right_To_Left/regex.js\nconst RTL_PATTERN =\n /[\\u05BE\\u05C0\\u05C3\\u05D0-\\u05EA\\u05F0-\\u05F4\\u061B\\u061F\\u0621-\\u063A\\u0640-\\u064A\\u066D\\u0671-\\u06B7\\u06BA-\\u06BE\\u06C0-\\u06CE\\u06D0-\\u06D5\\u06E5\\u06E6\\u200F\\u202B\\u202E\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE72\\uFE74\\uFE76-\\uFEFC]/\n\nexport const getDirection = (function() {\n const input = makeElement(\"input\", { dir: \"auto\", name: \"x\", dirName: \"x.dir\" })\n const textArea = makeElement(\"textarea\", { dir: \"auto\", name: \"y\", dirName: \"y.dir\" })\n const form = makeElement(\"form\")\n form.appendChild(input)\n form.appendChild(textArea)\n\n const supportsDirName = (function() {\n try {\n return new FormData(form).has(textArea.dirName)\n } catch (error) {\n return false\n }\n })()\n\n const supportsDirSelector = (function() {\n try {\n return input.matches(\":dir(ltr),:dir(rtl)\")\n } catch (error) {\n return false\n }\n })()\n\n if (supportsDirName) {\n return function(string) {\n textArea.value = string\n return new FormData(form).get(textArea.dirName)\n }\n } else if (supportsDirSelector) {\n return function(string) {\n input.value = string\n if (input.matches(\":dir(rtl)\")) {\n return \"rtl\"\n } else {\n return \"ltr\"\n }\n }\n } else {\n return function(string) {\n const char = string.trim().charAt(0)\n if (RTL_PATTERN.test(char)) {\n return \"rtl\"\n } else {\n return \"ltr\"\n }\n }\n }\n})()\n", "import * as config from \"trix/config\"\n\nlet allAttributeNames = null\nlet blockAttributeNames = null\nlet textAttributeNames = null\nlet listAttributeNames = null\n\nexport const getAllAttributeNames = () => {\n if (!allAttributeNames) {\n allAttributeNames = getTextAttributeNames().concat(getBlockAttributeNames())\n }\n return allAttributeNames\n}\n\nexport const getBlockConfig = (attributeName) => config.blockAttributes[attributeName]\n\nexport const getBlockAttributeNames = () => {\n if (!blockAttributeNames) {\n blockAttributeNames = Object.keys(config.blockAttributes)\n }\n return blockAttributeNames\n}\n\nexport const getTextConfig = (attributeName) => config.textAttributes[attributeName]\n\nexport const getTextAttributeNames = () => {\n if (!textAttributeNames) {\n textAttributeNames = Object.keys(config.textAttributes)\n }\n return textAttributeNames\n}\n\nexport const getListAttributeNames = () => {\n if (!listAttributeNames) {\n listAttributeNames = []\n for (const key in config.blockAttributes) {\n const { listAttribute } = config.blockAttributes[key]\n if (listAttribute != null) {\n listAttributeNames.push(listAttribute)\n }\n }\n }\n return listAttributeNames\n}\n", "/* eslint-disable\n*/\nexport const installDefaultCSSForTagName = function(tagName, defaultCSS) {\n const styleElement = insertStyleElementForTagName(tagName)\n styleElement.textContent = defaultCSS.replace(/%t/g, tagName)\n}\n\nconst insertStyleElementForTagName = function(tagName) {\n const element = document.createElement(\"style\")\n element.setAttribute(\"type\", \"text/css\")\n element.setAttribute(\"data-tag-name\", tagName.toLowerCase())\n const nonce = getCSPNonce()\n if (nonce) {\n element.setAttribute(\"nonce\", nonce)\n }\n document.head.insertBefore(element, document.head.firstChild)\n return element\n}\n\nconst getCSPNonce = function() {\n const element = getMetaElement(\"trix-csp-nonce\") || getMetaElement(\"csp-nonce\")\n if (element) {\n const { nonce, content } = element\n return nonce == \"\" ? content : nonce\n }\n}\n\nconst getMetaElement = (name) => document.head.querySelector(`meta[name=${name}]`)\n", "const testTransferData = { \"application/x-trix-feature-detection\": \"test\" }\n\nexport const dataTransferIsPlainText = function(dataTransfer) {\n const text = dataTransfer.getData(\"text/plain\")\n const html = dataTransfer.getData(\"text/html\")\n\n if (text && html) {\n const { body } = new DOMParser().parseFromString(html, \"text/html\")\n if (body.textContent === text) {\n return !body.querySelector(\"*\")\n }\n } else {\n return text?.length\n }\n}\n\nexport const dataTransferIsMsOfficePaste = ({ dataTransfer }) => {\n return dataTransfer.types.includes(\"Files\") &&\n dataTransfer.types.includes(\"text/html\") &&\n dataTransfer.getData(\"text/html\").includes(\"urn:schemas-microsoft-com:office:office\")\n}\n\nexport const dataTransferIsWritable = function(dataTransfer) {\n if (!dataTransfer?.setData) return false\n\n for (const key in testTransferData) {\n const value = testTransferData[key]\n\n try {\n dataTransfer.setData(key, value)\n if (!dataTransfer.getData(key) === value) return false\n } catch (error) {\n return false\n }\n }\n return true\n}\n\nexport const keyEventIsKeyboardCommand = (function() {\n if (/Mac|^iP/.test(navigator.platform)) {\n return (event) => event.metaKey\n } else {\n return (event) => event.ctrlKey\n }\n})()\n\nexport function shouldRenderInmmediatelyToDealWithIOSDictation(inputEvent) {\n if (/iPhone|iPad/.test(navigator.userAgent)) {\n // Handle garbled content and duplicated newlines when using dictation on iOS 18+. Upon dictation completion, iOS sends\n // the list of insertText / insertParagraph events in a quick sequence. If we don't render\n // the editor synchronously, the internal range fails to update and results in garbled content or duplicated newlines.\n //\n // This workaround is necessary because iOS doesn't send composing events as expected while dictating:\n // https://bugs.webkit.org/show_bug.cgi?id=261764\n return !inputEvent.inputType || inputEvent.inputType === \"insertParagraph\"\n } else {\n return false\n }\n}\n", "export const defer = (fn) => setTimeout(fn, 1)\n", "/* eslint-disable\n id-length,\n*/\nexport const copyObject = function(object = {}) {\n const result = {}\n for (const key in object) {\n const value = object[key]\n result[key] = value\n }\n return result\n}\n\nexport const objectsAreEqual = function(a = {}, b = {}) {\n if (Object.keys(a).length !== Object.keys(b).length) {\n return false\n }\n for (const key in a) {\n const value = a[key]\n if (value !== b[key]) {\n return false\n }\n }\n return true\n}\n", "import { copyObject, objectsAreEqual } from \"trix/core/helpers/objects\"\n\nexport const normalizeRange = function(range) {\n if (range == null) return\n\n if (!Array.isArray(range)) {\n range = [ range, range ]\n }\n return [ copyValue(range[0]), copyValue(range[1] != null ? range[1] : range[0]) ]\n}\n\nexport const rangeIsCollapsed = function(range) {\n if (range == null) return\n\n const [ start, end ] = normalizeRange(range)\n return rangeValuesAreEqual(start, end)\n}\n\nexport const rangesAreEqual = function(leftRange, rightRange) {\n if (leftRange == null || rightRange == null) return\n\n const [ leftStart, leftEnd ] = normalizeRange(leftRange)\n const [ rightStart, rightEnd ] = normalizeRange(rightRange)\n return rangeValuesAreEqual(leftStart, rightStart) && rangeValuesAreEqual(leftEnd, rightEnd)\n}\n\nconst copyValue = function(value) {\n if (typeof value === \"number\") {\n return value\n } else {\n return copyObject(value)\n }\n}\n\nconst rangeValuesAreEqual = function(left, right) {\n if (typeof left === \"number\") {\n return left === right\n } else {\n return objectsAreEqual(left, right)\n }\n}\n", "import BasicObject from \"trix/core/basic_object\"\n\nexport default class SelectionChangeObserver extends BasicObject {\n constructor() {\n super(...arguments)\n this.update = this.update.bind(this)\n this.selectionManagers = []\n }\n\n start() {\n if (!this.started) {\n this.started = true\n document.addEventListener(\"selectionchange\", this.update, true)\n }\n }\n\n stop() {\n if (this.started) {\n this.started = false\n return document.removeEventListener(\"selectionchange\", this.update, true)\n }\n }\n\n registerSelectionManager(selectionManager) {\n if (!this.selectionManagers.includes(selectionManager)) {\n this.selectionManagers.push(selectionManager)\n return this.start()\n }\n }\n\n unregisterSelectionManager(selectionManager) {\n this.selectionManagers = this.selectionManagers.filter((sm) => sm !== selectionManager)\n if (this.selectionManagers.length === 0) {\n return this.stop()\n }\n }\n\n notifySelectionManagersOfSelectionChange() {\n return this.selectionManagers.map((selectionManager) => selectionManager.selectionDidChange())\n }\n\n update() {\n this.notifySelectionManagersOfSelectionChange()\n }\n\n reset() {\n this.update()\n }\n}\n\nexport const selectionChangeObserver = new SelectionChangeObserver()\n\nexport const getDOMSelection = function() {\n const selection = window.getSelection()\n if (selection.rangeCount > 0) {\n return selection\n }\n}\n\nexport const getDOMRange = function() {\n const domRange = getDOMSelection()?.getRangeAt(0)\n if (domRange) {\n if (!domRangeIsPrivate(domRange)) {\n return domRange\n }\n }\n}\n\nexport const setDOMRange = function(domRange) {\n const selection = window.getSelection()\n selection.removeAllRanges()\n selection.addRange(domRange)\n return selectionChangeObserver.update()\n}\n\n// In Firefox, clicking certain <input> elements changes the selection to a\n// private element used to draw its UI. Attempting to access properties of those\n// elements throws an error.\n// https://bugzilla.mozilla.org/show_bug.cgi?id=208427\nconst domRangeIsPrivate = (domRange) => nodeIsPrivate(domRange.startContainer) || nodeIsPrivate(domRange.endContainer)\n\nconst nodeIsPrivate = (node) => !Object.getPrototypeOf(node)\n", "/* eslint-disable\n id-length,\n no-useless-escape,\n*/\nimport { NON_BREAKING_SPACE, ZERO_WIDTH_SPACE } from \"trix/constants\"\nimport UTF16String from \"trix/core/utilities/utf16_string\"\n\nexport const normalizeSpaces = (string) =>\n string.replace(new RegExp(`${ZERO_WIDTH_SPACE}`, \"g\"), \"\").replace(new RegExp(`${NON_BREAKING_SPACE}`, \"g\"), \" \")\n\nexport const normalizeNewlines = (string) => string.replace(/\\r\\n?/g, \"\\n\")\n\nexport const breakableWhitespacePattern = new RegExp(`[^\\\\S${NON_BREAKING_SPACE}]`)\n\nexport const squishBreakableWhitespace = (string) =>\n string\n // Replace all breakable whitespace characters with a space\n .replace(new RegExp(`${breakableWhitespacePattern.source}`, \"g\"), \" \")\n // Replace two or more spaces with a single space\n .replace(/\\ {2,}/g, \" \")\n\nexport const summarizeStringChange = function(oldString, newString) {\n let added, removed\n oldString = UTF16String.box(oldString)\n newString = UTF16String.box(newString)\n\n if (newString.length < oldString.length) {\n [ removed, added ] = utf16StringDifferences(oldString, newString)\n } else {\n [ added, removed ] = utf16StringDifferences(newString, oldString)\n }\n\n return { added, removed }\n}\n\nconst utf16StringDifferences = function(a, b) {\n if (a.isEqualTo(b)) {\n return [ \"\", \"\" ]\n }\n\n const diffA = utf16StringDifference(a, b)\n const { length } = diffA.utf16String\n\n let diffB\n\n if (length) {\n const { offset } = diffA\n const codepoints = a.codepoints.slice(0, offset).concat(a.codepoints.slice(offset + length))\n diffB = utf16StringDifference(b, UTF16String.fromCodepoints(codepoints))\n } else {\n diffB = utf16StringDifference(b, a)\n }\n\n return [ diffA.utf16String.toString(), diffB.utf16String.toString() ]\n}\n\nconst utf16StringDifference = function(a, b) {\n let leftIndex = 0\n let rightIndexA = a.length\n let rightIndexB = b.length\n\n while (leftIndex < rightIndexA && a.charAt(leftIndex).isEqualTo(b.charAt(leftIndex))) {\n leftIndex++\n }\n\n while (rightIndexA > leftIndex + 1 && a.charAt(rightIndexA - 1).isEqualTo(b.charAt(rightIndexB - 1))) {\n rightIndexA--\n rightIndexB--\n }\n\n return {\n utf16String: a.slice(leftIndex, rightIndexA),\n offset: leftIndex,\n }\n}\n", "import TrixObject from \"trix/core/object\" // Don't override window.Object\nimport { arraysAreEqual } from \"trix/core/helpers\"\n\nexport default class Hash extends TrixObject {\n static fromCommonAttributesOfObjects(objects = []) {\n if (!objects.length) {\n return new this()\n }\n let hash = box(objects[0])\n let keys = hash.getKeys()\n\n objects.slice(1).forEach((object) => {\n keys = hash.getKeysCommonToHash(box(object))\n hash = hash.slice(keys)\n })\n\n return hash\n }\n\n static box(values) {\n return box(values)\n }\n\n constructor(values = {}) {\n super(...arguments)\n this.values = copy(values)\n }\n\n add(key, value) {\n return this.merge(object(key, value))\n }\n\n remove(key) {\n return new Hash(copy(this.values, key))\n }\n\n get(key) {\n return this.values[key]\n }\n\n has(key) {\n return key in this.values\n }\n\n merge(values) {\n return new Hash(merge(this.values, unbox(values)))\n }\n\n slice(keys) {\n const values = {}\n\n Array.from(keys).forEach((key) => {\n if (this.has(key)) {\n values[key] = this.values[key]\n }\n })\n\n return new Hash(values)\n }\n\n getKeys() {\n return Object.keys(this.values)\n }\n\n getKeysCommonToHash(hash) {\n hash = box(hash)\n return this.getKeys().filter((key) => this.values[key] === hash.values[key])\n }\n\n isEqualTo(values) {\n return arraysAreEqual(this.toArray(), box(values).toArray())\n }\n\n isEmpty() {\n return this.getKeys().length === 0\n }\n\n toArray() {\n if (!this.array) {\n const result = []\n for (const key in this.values) {\n const value = this.values[key]\n result.push(result.push(key, value))\n }\n this.array = result.slice(0)\n }\n\n return this.array\n }\n\n toObject() {\n return copy(this.values)\n }\n\n toJSON() {\n return this.toObject()\n }\n\n contentsForInspection() {\n return { values: JSON.stringify(this.values) }\n }\n}\n\nconst object = function(key, value) {\n const result = {}\n result[key] = value\n return result\n}\n\nconst merge = function(object, values) {\n const result = copy(object)\n for (const key in values) {\n const value = values[key]\n result[key] = value\n }\n return result\n}\n\nconst copy = function(object, keyToRemove) {\n const result = {}\n const sortedKeys = Object.keys(object).sort()\n\n sortedKeys.forEach((key) => {\n if (key !== keyToRemove) {\n result[key] = object[key]\n }\n })\n\n return result\n}\n\nconst box = function(object) {\n if (object instanceof Hash) {\n return object\n } else {\n return new Hash(object)\n }\n}\n\nconst unbox = function(object) {\n if (object instanceof Hash) {\n return object.values\n } else {\n return object\n }\n}\n", "export default class ObjectGroup {\n static groupObjects(ungroupedObjects = [], { depth, asTree } = {}) {\n let group\n if (asTree) {\n if (depth == null) {\n depth = 0\n }\n }\n const objects = []\n\n Array.from(ungroupedObjects).forEach((object) => {\n if (group) {\n if (object.canBeGrouped?.(depth) && group[group.length - 1].canBeGroupedWith?.(object, depth)) {\n group.push(object)\n return\n } else {\n objects.push(new this(group, { depth, asTree }))\n group = null\n }\n }\n\n if (object.canBeGrouped?.(depth)) {\n group = [ object ]\n } else {\n objects.push(object)\n }\n })\n\n if (group) {\n objects.push(new this(group, { depth, asTree }))\n }\n return objects\n }\n\n constructor(objects = [], { depth, asTree }) {\n this.objects = objects\n if (asTree) {\n this.depth = depth\n this.objects = this.constructor.groupObjects(this.objects, { asTree, depth: this.depth + 1 })\n }\n }\n\n getObjects() {\n return this.objects\n }\n\n getDepth() {\n return this.depth\n }\n\n getCacheKey() {\n const keys = [ \"objectGroup\" ]\n Array.from(this.getObjects()).forEach((object) => {\n keys.push(object.getCacheKey())\n })\n return keys.join(\"/\")\n }\n}\n", "import BasicObject from \"trix/core/basic_object\"\n\nexport default class ObjectMap extends BasicObject {\n constructor(objects = []) {\n super(...arguments)\n this.objects = {}\n\n Array.from(objects).forEach((object) => {\n const hash = JSON.stringify(object)\n if (this.objects[hash] == null) {\n this.objects[hash] = object\n }\n })\n }\n\n find(object) {\n const hash = JSON.stringify(object)\n return this.objects[hash]\n }\n}\n", "export default class ElementStore {\n constructor(elements) {\n this.reset(elements)\n }\n\n add(element) {\n const key = getKey(element)\n this.elements[key] = element\n }\n\n remove(element) {\n const key = getKey(element)\n const value = this.elements[key]\n if (value) {\n delete this.elements[key]\n return value\n }\n }\n\n reset(elements = []) {\n this.elements = {}\n Array.from(elements).forEach((element) => {\n this.add(element)\n })\n return elements\n }\n}\n\nconst getKey = (element) => element.dataset.trixStoreKey\n", "import BasicObject from \"trix/core/basic_object\"\n\nexport default class Operation extends BasicObject {\n isPerforming() {\n return this.performing === true\n }\n\n hasPerformed() {\n return this.performed === true\n }\n\n hasSucceeded() {\n return this.performed && this.succeeded\n }\n\n hasFailed() {\n return this.performed && !this.succeeded\n }\n\n getPromise() {\n if (!this.promise) {\n this.promise = new Promise((resolve, reject) => {\n this.performing = true\n return this.perform((succeeded, result) => {\n this.succeeded = succeeded\n this.performing = false\n this.performed = true\n\n if (this.succeeded) {\n resolve(result)\n } else {\n reject(result)\n }\n })\n })\n }\n\n return this.promise\n }\n\n perform(callback) {\n return callback(false)\n }\n\n release() {\n this.promise?.cancel?.()\n this.promise = null\n this.performing = null\n this.performed = null\n this.succeeded = null\n }\n}\n\nOperation.proxyMethod(\"getPromise().then\")\nOperation.proxyMethod(\"getPromise().catch\")\n", "import BasicObject from \"trix/core/basic_object\"\nimport ObjectGroup from \"trix/core/collections/object_group\"\n\nexport default class ObjectView extends BasicObject {\n constructor(object, options = {}) {\n super(...arguments)\n this.object = object\n this.options = options\n this.childViews = []\n this.rootView = this\n }\n\n getNodes() {\n if (!this.nodes) { this.nodes = this.createNodes() }\n return this.nodes.map((node) => node.cloneNode(true))\n }\n\n invalidate() {\n this.nodes = null\n this.childViews = []\n return this.parentView?.invalidate()\n }\n\n invalidateViewForObject(object) {\n return this.findViewForObject(object)?.invalidate()\n }\n\n findOrCreateCachedChildView(viewClass, object, options) {\n let view = this.getCachedViewForObject(object)\n if (view) {\n this.recordChildView(view)\n } else {\n view = this.createChildView(...arguments)\n this.cacheViewForObject(view, object)\n }\n return view\n }\n\n createChildView(viewClass, object, options = {}) {\n if (object instanceof ObjectGroup) {\n options.viewClass = viewClass\n viewClass = ObjectGroupView\n }\n\n const view = new viewClass(object, options)\n return this.recordChildView(view)\n }\n\n recordChildView(view) {\n view.parentView = this\n view.rootView = this.rootView\n this.childViews.push(view)\n return view\n }\n\n getAllChildViews() {\n let views = []\n\n this.childViews.forEach((childView) => {\n views.push(childView)\n views = views.concat(childView.getAllChildViews())\n })\n\n return views\n }\n\n findElement() {\n return this.findElementForObject(this.object)\n }\n\n findElementForObject(object) {\n const id = object?.id\n if (id) {\n return this.rootView.element.querySelector(`[data-trix-id='${id}']`)\n }\n }\n\n findViewForObject(object) {\n for (const view of this.getAllChildViews()) {\n if (view.object === object) {\n return view\n }\n }\n }\n\n getViewCache() {\n if (this.rootView === this) {\n if (this.isViewCachingEnabled()) {\n if (!this.viewCache) { this.viewCache = {} }\n return this.viewCache\n }\n } else {\n return this.rootView.getViewCache()\n }\n }\n\n isViewCachingEnabled() {\n return this.shouldCacheViews !== false\n }\n\n enableViewCaching() {\n this.shouldCacheViews = true\n }\n\n disableViewCaching() {\n this.shouldCacheViews = false\n }\n\n getCachedViewForObject(object) {\n return this.getViewCache()?.[object.getCacheKey()]\n }\n\n cacheViewForObject(view, object) {\n const cache = this.getViewCache()\n if (cache) {\n cache[object.getCacheKey()] = view\n }\n }\n\n garbageCollectCachedViews() {\n const cache = this.getViewCache()\n if (cache) {\n const views = this.getAllChildViews().concat(this)\n const objectKeys = views.map((view) => view.object.getCacheKey())\n for (const key in cache) {\n if (!objectKeys.includes(key)) {\n delete cache[key]\n }\n }\n }\n }\n}\n\nexport class ObjectGroupView extends ObjectView {\n constructor() {\n super(...arguments)\n this.objectGroup = this.object\n this.viewClass = this.options.viewClass\n delete this.options.viewClass\n }\n\n getChildViews() {\n if (!this.childViews.length) {\n Array.from(this.objectGroup.getObjects()).forEach((object) => {\n this.findOrCreateCachedChildView(this.viewClass, object, this.options)\n })\n }\n return this.childViews\n }\n\n createNodes() {\n const element = this.createContainerElement()\n\n this.getChildViews().forEach((view) => {\n Array.from(view.getNodes()).forEach((node) => {\n element.appendChild(node)\n })\n })\n\n return [ element ]\n }\n\n createContainerElement(depth = this.objectGroup.getDepth()) {\n return this.getChildViews()[0].createContainerElement(depth)\n }\n}\n", "import BasicObject from \"trix/core/basic_object\"\n\nimport { nodeIsAttachmentElement, removeNode, tagName, walkTree } from \"trix/core/helpers\"\n\nconst DEFAULT_ALLOWED_ATTRIBUTES = \"style href src width height language class\".split(\" \")\nconst DEFAULT_FORBIDDEN_PROTOCOLS = \"javascript:\".split(\" \")\nconst DEFAULT_FORBIDDEN_ELEMENTS = \"script iframe form noscript\".split(\" \")\n\nexport default class HTMLSanitizer extends BasicObject {\n static setHTML(element, html) {\n const sanitizedElement = new this(html).sanitize()\n const sanitizedHtml = sanitizedElement.getHTML ? sanitizedElement.getHTML() : sanitizedElement.outerHTML\n element.innerHTML = sanitizedHtml\n }\n\n static sanitize(html, options) {\n const sanitizer = new this(html, options)\n sanitizer.sanitize()\n return sanitizer\n }\n\n constructor(html, { allowedAttributes, forbiddenProtocols, forbiddenElements } = {}) {\n super(...arguments)\n this.allowedAttributes = allowedAttributes || DEFAULT_ALLOWED_ATTRIBUTES\n this.forbiddenProtocols = forbiddenProtocols || DEFAULT_FORBIDDEN_PROTOCOLS\n this.forbiddenElements = forbiddenElements || DEFAULT_FORBIDDEN_ELEMENTS\n this.body = createBodyElementForHTML(html)\n }\n\n sanitize() {\n this.sanitizeElements()\n return this.normalizeListElementNesting()\n }\n\n getHTML() {\n return this.body.innerHTML\n }\n\n getBody() {\n return this.body\n }\n\n // Private\n\n sanitizeElements() {\n const walker = walkTree(this.body)\n const nodesToRemove = []\n\n while (walker.nextNode()) {\n const node = walker.currentNode\n switch (node.nodeType) {\n case Node.ELEMENT_NODE:\n if (this.elementIsRemovable(node)) {\n nodesToRemove.push(node)\n } else {\n this.sanitizeElement(node)\n }\n break\n case Node.COMMENT_NODE:\n nodesToRemove.push(node)\n break\n }\n }\n\n nodesToRemove.forEach((node) => removeNode(node))\n\n return this.body\n }\n\n sanitizeElement(element) {\n if (element.hasAttribute(\"href\")) {\n if (this.forbiddenProtocols.includes(element.protocol)) {\n element.removeAttribute(\"href\")\n }\n }\n\n Array.from(element.attributes).forEach(({ name }) => {\n if (!this.allowedAttributes.includes(name) && name.indexOf(\"data-trix\") !== 0) {\n element.removeAttribute(name)\n }\n })\n\n return element\n }\n\n normalizeListElementNesting() {\n Array.from(this.body.querySelectorAll(\"ul,ol\")).forEach((listElement) => {\n const previousElement = listElement.previousElementSibling\n if (previousElement) {\n if (tagName(previousElement) === \"li\") {\n previousElement.appendChild(listElement)\n }\n }\n })\n\n return this.body\n }\n\n elementIsRemovable(element) {\n if (element?.nodeType !== Node.ELEMENT_NODE) return\n return this.elementIsForbidden(element) || this.elementIsntSerializable(element)\n }\n\n elementIsForbidden(element) {\n return this.forbiddenElements.includes(tagName(element))\n }\n\n elementIsntSerializable(element) {\n return element.getAttribute(\"data-trix-serialize\") === \"false\" && !nodeIsAttachmentElement(element)\n }\n}\n\nconst createBodyElementForHTML = function(html = \"\") {\n // Remove everything after </html>\n html = html.replace(/<\\/html[^>]*>[^]*$/i, \"</html>\")\n const doc = document.implementation.createHTMLDocument(\"\")\n doc.documentElement.innerHTML = html\n\n Array.from(doc.head.querySelectorAll(\"style\")).forEach((element) => {\n doc.body.appendChild(element)\n })\n\n return doc.body\n}\n", "import * as config from \"trix/config\"\nimport { ZERO_WIDTH_SPACE } from \"trix/constants\"\nimport { copyObject, makeElement } from \"trix/core/helpers\"\nimport ObjectView from \"trix/views/object_view\"\nimport HTMLSanitizer from \"trix/models/html_sanitizer\"\n\nconst { css } = config\n\nexport default class AttachmentView extends ObjectView {\n constructor() {\n super(...arguments)\n this.attachment = this.object\n this.attachment.uploadProgressDelegate = this\n this.attachmentPiece = this.options.piece\n }\n\n createContentNodes() {\n return []\n }\n\n createNodes() {\n let innerElement\n const figure = innerElement = makeElement({\n tagName: \"figure\",\n className: this.getClassName(),\n data: this.getData(),\n editable: false,\n })\n\n const href = this.getHref()\n if (href) {\n innerElement = makeElement({ tagName: \"a\", editable: false, attributes: { href, tabindex: -1 } })\n figure.appendChild(innerElement)\n }\n\n if (this.attachment.hasContent()) {\n HTMLSanitizer.setHTML(innerElement, this.attachment.getContent())\n } else {\n this.createContentNodes().forEach((node) => {\n innerElement.appendChild(node)\n })\n }\n\n innerElement.appendChild(this.createCaptionElement())\n\n if (this.attachment.isPending()) {\n this.progressElement = makeElement({\n tagName: \"progress\",\n attributes: {\n class: css.attachmentProgress,\n value: this.attachment.getUploadProgress(),\n max: 100,\n },\n data: {\n trixMutable: true,\n trixStoreKey: [ \"progressElement\", this.attachment.id ].join(\"/\"),\n },\n })\n\n figure.appendChild(this.progressElement)\n }\n\n return [ createCursorTarget(\"left\"), figure, createCursorTarget(\"right\") ]\n }\n\n createCaptionElement() {\n const figcaption = makeElement({ tagName: \"figcaption\", className: css.attachmentCaption })\n const caption = this.attachmentPiece.getCaption()\n if (caption) {\n figcaption.classList.add(`${css.attachmentCaption}--edited`)\n figcaption.textContent = caption\n } else {\n let name, size\n const captionConfig = this.getCaptionConfig()\n if (captionConfig.name) {\n name = this.attachment.getFilename()\n }\n if (captionConfig.size) {\n size = this.attachment.getFormattedFilesize()\n }\n\n if (name) {\n const nameElement = makeElement({ tagName: \"span\", className: css.attachmentName, textContent: name })\n figcaption.appendChild(nameElement)\n }\n\n if (size) {\n if (name) {\n figcaption.appendChild(document.createTextNode(\" \"))\n }\n const sizeElement = makeElement({ tagName: \"span\", className: css.attachmentSize, textContent: size })\n figcaption.appendChild(sizeElement)\n }\n }\n\n return figcaption\n }\n\n getClassName() {\n const names = [ css.attachment, `${css.attachment}--${this.attachment.getType()}` ]\n const extension = this.attachment.getExtension()\n if (extension) {\n names.push(`${css.attachment}--${extension}`)\n }\n return names.join(\" \")\n }\n\n getData() {\n const data = {\n trixAttachment: JSON.stringify(this.attachment),\n trixContentType: this.attachment.getContentType(),\n trixId: this.attachment.id,\n }\n\n const { attributes } = this.attachmentPiece\n if (!attributes.isEmpty()) {\n data.trixAttributes = JSON.stringify(attributes)\n }\n\n if (this.attachment.isPending()) {\n data.trixSerialize = false\n }\n\n return data\n }\n\n getHref() {\n if (!htmlContainsTagName(this.attachment.getContent(), \"a\")) {\n return this.attachment.getHref()\n }\n }\n\n getCaptionConfig() {\n const type = this.attachment.getType()\n const captionConfig = copyObject(config.attachments[type]?.caption)\n if (type === \"file\") {\n captionConfig.name = true\n }\n return captionConfig\n }\n\n findProgressElement() {\n return this.findElement()?.querySelector(\"progress\")\n }\n\n // Attachment delegate\n\n attachmentDidChangeUploadProgress() {\n const value = this.attachment.getUploadProgress()\n const progressElement = this.findProgressElement()\n if (progressElement) {\n progressElement.value = value\n }\n }\n}\n\nconst createCursorTarget = (name) =>\n makeElement({\n tagName: \"span\",\n textContent: ZERO_WIDTH_SPACE,\n data: {\n trixCursorTarget: name,\n trixSerialize: false,\n },\n })\n\nconst htmlContainsTagName = function(html, tagName) {\n const div = makeElement(\"div\")\n HTMLSanitizer.setHTML(div, html || \"\")\n return div.querySelector(tagName)\n}\n", "import * as config from \"trix/config\"\nimport { makeElement } from \"trix/core/helpers\"\n\nimport AttachmentView from \"trix/views/attachment_view\"\n\nexport default class PreviewableAttachmentView extends AttachmentView {\n constructor() {\n super(...arguments)\n this.attachment.previewDelegate = this\n }\n\n createContentNodes() {\n this.image = makeElement({\n tagName: \"img\",\n attributes: {\n src: \"\",\n },\n data: {\n trixMutable: true,\n },\n })\n\n this.refresh(this.image)\n return [ this.image ]\n }\n\n createCaptionElement() {\n const figcaption = super.createCaptionElement(...arguments)\n if (!figcaption.textContent) {\n figcaption.setAttribute(\"data-trix-placeholder\", config.lang.captionPlaceholder)\n }\n return figcaption\n }\n\n refresh(image) {\n if (!image) { image = this.findElement()?.querySelector(\"img\") }\n if (image) {\n return this.updateAttributesForImage(image)\n }\n }\n\n updateAttributesForImage(image) {\n const url = this.attachment.getURL()\n const previewURL = this.attachment.getPreviewURL()\n image.src = previewURL || url\n\n if (previewURL === url) {\n image.removeAttribute(\"data-trix-serialized-attributes\")\n } else {\n const serializedAttributes = JSON.stringify({ src: url })\n image.setAttribute(\"data-trix-serialized-attributes\", serializedAttributes)\n }\n\n const width = this.attachment.getWidth()\n const height = this.attachment.getHeight()\n\n if (width != null) {\n image.width = width\n }\n if (height != null) {\n image.height = height\n }\n\n const storeKey = [ \"imageElement\", this.attachment.id, image.src, image.width, image.height ].join(\"/\")\n image.dataset.trixStoreKey = storeKey\n }\n\n // Attachment delegate\n\n attachmentDidChangeAttributes() {\n this.refresh(this.image)\n return this.refresh()\n }\n}\n", "/* eslint-disable\n no-useless-escape,\n no-var,\n*/\nimport { NON_BREAKING_SPACE } from \"trix/constants\"\n\nimport ObjectView from \"trix/views/object_view\"\nimport AttachmentView from \"trix/views/attachment_view\"\nimport PreviewableAttachmentView from \"trix/views/previewable_attachment_view\"\n\nimport { findInnerElement, getTextConfig, makeElement } from \"trix/core/helpers\"\n\nexport default class PieceView extends ObjectView {\n constructor() {\n super(...arguments)\n this.piece = this.object\n this.attributes = this.piece.getAttributes()\n this.textConfig = this.options.textConfig\n this.context = this.options.context\n\n if (this.piece.attachment) {\n this.attachment = this.piece.attachment\n } else {\n this.string = this.piece.toString()\n }\n }\n\n createNodes() {\n let nodes = this.attachment ? this.createAttachmentNodes() : this.createStringNodes()\n const element = this.createElement()\n if (element) {\n const innerElement = findInnerElement(element)\n Array.from(nodes).forEach((node) => {\n innerElement.appendChild(node)\n })\n nodes = [ element ]\n }\n return nodes\n }\n\n createAttachmentNodes() {\n const constructor = this.attachment.isPreviewable() ? PreviewableAttachmentView : AttachmentView\n\n const view = this.createChildView(constructor, this.piece.attachment, { piece: this.piece })\n return view.getNodes()\n }\n\n createStringNodes() {\n if (this.textConfig?.plaintext) {\n return [ document.createTextNode(this.string) ]\n } else {\n const nodes = []\n const iterable = this.string.split(\"\\n\")\n for (let index = 0; index < iterable.length; index++) {\n const substring = iterable[index]\n if (index > 0) {\n const element = makeElement(\"br\")\n nodes.push(element)\n }\n\n if (substring.length) {\n const node = document.createTextNode(this.preserveSpaces(substring))\n nodes.push(node)\n }\n }\n return nodes\n }\n }\n\n createElement() {\n let element, key, value\n const styles = {}\n\n for (key in this.attributes) {\n value = this.attributes[key]\n const config = getTextConfig(key)\n if (config) {\n if (config.tagName) {\n var innerElement\n const pendingElement = makeElement(config.tagName)\n\n if (innerElement) {\n innerElement.appendChild(pendingElement)\n innerElement = pendingElement\n } else {\n element = innerElement = pendingElement\n }\n }\n\n if (config.styleProperty) {\n styles[config.styleProperty] = value\n }\n\n if (config.style) {\n for (key in config.style) {\n value = config.style[key]\n styles[key] = value\n }\n }\n }\n }\n\n if (Object.keys(styles).length) {\n if (!element) { element = makeElement(\"span\") }\n for (key in styles) {\n value = styles[key]\n element.style[key] = value\n }\n }\n return element\n }\n\n createContainerElement() {\n for (const key in this.attributes) {\n const value = this.attributes[key]\n const config = getTextConfig(key)\n if (config) {\n if (config.groupTagName) {\n const attributes = {}\n attributes[key] = value\n return makeElement(config.groupTagName, attributes)\n }\n }\n }\n }\n\n preserveSpaces(string) {\n if (this.context.isLast) {\n string = string.replace(/\\ $/, NON_BREAKING_SPACE)\n }\n\n string = string\n .replace(/(\\S)\\ {3}(\\S)/g, `$1 ${NON_BREAKING_SPACE} $2`)\n .replace(/\\ {2}/g, `${NON_BREAKING_SPACE} `)\n .replace(/\\ {2}/g, ` ${NON_BREAKING_SPACE}`)\n\n if (this.context.isFirst || this.context.followsWhitespace) {\n string = string.replace(/^\\ /, NON_BREAKING_SPACE)\n }\n\n return string\n }\n}\n", "/* eslint-disable\n no-var,\n*/\nimport ObjectView from \"trix/views/object_view\"\nimport ObjectGroup from \"trix/core/collections/object_group\"\nimport PieceView from \"trix/views/piece_view\"\n\nexport default class TextView extends ObjectView {\n constructor() {\n super(...arguments)\n this.text = this.object\n this.textConfig = this.options.textConfig\n }\n\n createNodes() {\n const nodes = []\n const pieces = ObjectGroup.groupObjects(this.getPieces())\n const lastIndex = pieces.length - 1\n\n for (let index = 0; index < pieces.length; index++) {\n const piece = pieces[index]\n const context = {}\n if (index === 0) {\n context.isFirst = true\n }\n if (index === lastIndex) {\n context.isLast = true\n }\n if (endsWithWhitespace(previousPiece)) {\n context.followsWhitespace = true\n }\n\n const view = this.findOrCreateCachedChildView(PieceView, piece, { textConfig: this.textConfig, context })\n nodes.push(...Array.from(view.getNodes() || []))\n\n var previousPiece = piece\n }\n return nodes\n }\n\n getPieces() {\n return Array.from(this.text.getPieces()).filter((piece) => !piece.hasAttribute(\"blockBreak\"))\n }\n}\n\nconst endsWithWhitespace = (piece) => /\\s$/.test(piece?.toString())\n", "import * as config from \"trix/config\"\nimport ObjectView from \"trix/views/object_view\"\nimport TextView from \"trix/views/text_view\"\n\nimport { getBlockConfig, makeElement } from \"trix/core/helpers\"\nconst { css } = config\n\nexport default class BlockView extends ObjectView {\n constructor() {\n super(...arguments)\n this.block = this.object\n this.attributes = this.block.getAttributes()\n }\n\n createNodes() {\n const comment = document.createComment(\"block\")\n const nodes = [ comment ]\n if (this.block.isEmpty()) {\n nodes.push(makeElement(\"br\"))\n } else {\n const textConfig = getBlockConfig(this.block.getLastAttribute())?.text\n const textView = this.findOrCreateCachedChildView(TextView, this.block.text, { textConfig })\n nodes.push(...Array.from(textView.getNodes() || []))\n if (this.shouldAddExtraNewlineElement()) {\n nodes.push(makeElement(\"br\"))\n }\n }\n\n if (this.attributes.length) {\n return nodes\n } else {\n let attributes\n const { tagName } = config.blockAttributes.default\n if (this.block.isRTL()) {\n attributes = { dir: \"rtl\" }\n }\n\n const element = makeElement({ tagName, attributes })\n nodes.forEach((node) => element.appendChild(node))\n return [ element ]\n }\n }\n\n createContainerElement(depth) {\n const attributes = {}\n let className\n const attributeName = this.attributes[depth]\n\n const { tagName, htmlAttributes = [] } = getBlockConfig(attributeName)\n\n if (depth === 0 && this.block.isRTL()) {\n Object.assign(attributes, { dir: \"rtl\" })\n }\n\n if (attributeName === \"attachmentGallery\") {\n const size = this.block.getBlockBreakPosition()\n className = `${css.attachmentGallery} ${css.attachmentGallery}--${size}`\n }\n\n Object.entries(this.block.htmlAttributes).forEach(([ name, value ]) => {\n if (htmlAttributes.includes(name)) {\n attributes[name] = value\n }\n })\n\n return makeElement({ tagName, className, attributes })\n }\n\n // A single <br> at the end of a block element has no visual representation\n // so add an extra one.\n shouldAddExtraNewlineElement() {\n return /\\n\\n$/.test(this.block.toString())\n }\n}\n", "import { makeElement } from \"trix/core/helpers\"\n\nimport ElementStore from \"trix/core/collections/element_store\"\nimport ObjectGroup from \"trix/core/collections/object_group\"\nimport ObjectView from \"trix/views/object_view\"\nimport BlockView from \"trix/views/block_view\"\n\nimport { defer } from \"trix/core/helpers\"\n\nexport default class DocumentView extends ObjectView {\n static render(document) {\n const element = makeElement(\"div\")\n const view = new this(document, { element })\n view.render()\n view.sync()\n return element\n }\n\n constructor() {\n super(...arguments)\n this.element = this.options.element\n this.elementStore = new ElementStore()\n this.setDocument(this.object)\n }\n\n setDocument(document) {\n if (!document.isEqualTo(this.document)) {\n this.document = this.object = document\n }\n }\n\n render() {\n this.childViews = []\n\n this.shadowElement = makeElement(\"div\")\n\n if (!this.document.isEmpty()) {\n const objects = ObjectGroup.groupObjects(this.document.getBlocks(), { asTree: true })\n\n Array.from(objects).forEach((object) => {\n const view = this.findOrCreateCachedChildView(BlockView, object)\n Array.from(view.getNodes()).map((node) => this.shadowElement.appendChild(node))\n })\n }\n }\n\n isSynced() {\n return elementsHaveEqualHTML(this.shadowElement, this.element)\n }\n\n sync() {\n const fragment = this.createDocumentFragmentForSync()\n while (this.element.lastChild) {\n this.element.removeChild(this.element.lastChild)\n }\n this.element.appendChild(fragment)\n return this.didSync()\n }\n\n // Private\n\n didSync() {\n this.elementStore.reset(findStoredElements(this.element))\n return defer(() => this.garbageCollectCachedViews())\n }\n\n createDocumentFragmentForSync() {\n const fragment = document.createDocumentFragment()\n\n Array.from(this.shadowElement.childNodes).forEach((node) => {\n fragment.appendChild(node.cloneNode(true))\n })\n\n Array.from(findStoredElements(fragment)).forEach((element) => {\n const storedElement = this.elementStore.remove(element)\n if (storedElement) {\n element.parentNode.replaceChild(storedElement, element)\n }\n })\n\n return fragment\n }\n}\n\nconst findStoredElements = (element) => element.querySelectorAll(\"[data-trix-store-key]\")\n\nconst elementsHaveEqualHTML = (element, otherElement) =>\n ignoreSpaces(element.innerHTML) === ignoreSpaces(otherElement.innerHTML)\n\nconst ignoreSpaces = (html) => html.replace(/ /g, \" \")\n", "import TrixObject from \"trix/core/object\" // Don't override window.Object\nimport Hash from \"trix/core/collections/hash\"\n\nexport default class Piece extends TrixObject {\n static types = {}\n\n static registerType(type, constructor) {\n constructor.type = type\n this.types[type] = constructor\n }\n\n static fromJSON(pieceJSON) {\n const constructor = this.types[pieceJSON.type]\n if (constructor) {\n return constructor.fromJSON(pieceJSON)\n }\n }\n\n constructor(value, attributes = {}) {\n super(...arguments)\n this.attributes = Hash.box(attributes)\n }\n\n copyWithAttributes(attributes) {\n return new this.constructor(this.getValue(), attributes)\n }\n\n copyWithAdditionalAttributes(attributes) {\n return this.copyWithAttributes(this.attributes.merge(attributes))\n }\n\n copyWithoutAttribute(attribute) {\n return this.copyWithAttributes(this.attributes.remove(attribute))\n }\n\n copy() {\n return this.copyWithAttributes(this.attributes)\n }\n\n getAttribute(attribute) {\n return this.attributes.get(attribute)\n }\n\n getAttributesHash() {\n return this.attributes\n }\n\n getAttributes() {\n return this.attributes.toObject()\n }\n\n hasAttribute(attribute) {\n return this.attributes.has(attribute)\n }\n\n hasSameStringValueAsPiece(piece) {\n return piece && this.toString() === piece.toString()\n }\n\n hasSameAttributesAsPiece(piece) {\n return piece && (this.attributes === piece.attributes || this.attributes.isEqualTo(piece.attributes))\n }\n\n isBlockBreak() {\n return false\n }\n\n isEqualTo(piece) {\n return (\n super.isEqualTo(...arguments) ||\n this.hasSameConstructorAs(piece) &&\n this.hasSameStringValueAsPiece(piece) &&\n this.hasSameAttributesAsPiece(piece)\n )\n }\n\n isEmpty() {\n return this.length === 0\n }\n\n isSerializable() {\n return true\n }\n\n toJSON() {\n return {\n type: this.constructor.type,\n attributes: this.getAttributes(),\n }\n }\n\n contentsForInspection() {\n return {\n type: this.constructor.type,\n attributes: this.attributes.inspect(),\n }\n }\n\n // Grouping\n\n canBeGrouped() {\n return this.hasAttribute(\"href\")\n }\n\n canBeGroupedWith(piece) {\n return this.getAttribute(\"href\") === piece.getAttribute(\"href\")\n }\n\n // Splittable\n\n getLength() {\n return this.length\n }\n\n canBeConsolidatedWith(piece) {\n return false\n }\n}\n", "import Operation from \"trix/core/utilities/operation\"\n\nexport default class ImagePreloadOperation extends Operation {\n constructor(url) {\n super(...arguments)\n this.url = url\n }\n\n perform(callback) {\n const image = new Image()\n\n image.onload = () => {\n image.width = this.width = image.naturalWidth\n image.height = this.height = image.naturalHeight\n return callback(true, image)\n }\n\n image.onerror = () => callback(false)\n\n image.src = this.url\n }\n}\n", "import * as config from \"trix/config\"\nimport TrixObject from \"trix/core/object\" // Don't override window.Object\nimport Hash from \"trix/core/collections/hash\"\nimport ImagePreloadOperation from \"trix/operations/image_preload_operation\"\n\nexport default class Attachment extends TrixObject {\n static previewablePattern = /^image(\\/(gif|png|webp|jpe?g)|$)/\n\n static attachmentForFile(file) {\n const attributes = this.attributesForFile(file)\n const attachment = new this(attributes)\n attachment.setFile(file)\n return attachment\n }\n\n static attributesForFile(file) {\n return new Hash({\n filename: file.name,\n filesize: file.size,\n contentType: file.type,\n })\n }\n\n static fromJSON(attachmentJSON) {\n return new this(attachmentJSON)\n }\n\n constructor(attributes = {}) {\n super(attributes)\n this.releaseFile = this.releaseFile.bind(this)\n this.attributes = Hash.box(attributes)\n this.didChangeAttributes()\n }\n\n getAttribute(attribute) {\n return this.attributes.get(attribute)\n }\n\n hasAttribute(attribute) {\n return this.attributes.has(attribute)\n }\n\n getAttributes() {\n return this.attributes.toObject()\n }\n\n setAttributes(attributes = {}) {\n const newAttributes = this.attributes.merge(attributes)\n if (!this.attributes.isEqualTo(newAttributes)) {\n this.attributes = newAttributes\n this.didChangeAttributes()\n this.previewDelegate?.attachmentDidChangeAttributes?.(this)\n return this.delegate?.attachmentDidChangeAttributes?.(this)\n }\n }\n\n didChangeAttributes() {\n if (this.isPreviewable()) {\n return this.preloadURL()\n }\n }\n\n isPending() {\n return this.file != null && !(this.getURL() || this.getHref())\n }\n\n isPreviewable() {\n if (this.attributes.has(\"previewable\")) {\n return this.attributes.get(\"previewable\")\n } else {\n return Attachment.previewablePattern.test(this.getContentType())\n }\n }\n\n getType() {\n if (this.hasContent()) {\n return \"content\"\n } else if (this.isPreviewable()) {\n return \"preview\"\n } else {\n return \"file\"\n }\n }\n\n getURL() {\n return this.attributes.get(\"url\")\n }\n\n getHref() {\n return this.attributes.get(\"href\")\n }\n\n getFilename() {\n return this.attributes.get(\"filename\") || \"\"\n }\n\n getFilesize() {\n return this.attributes.get(\"filesize\")\n }\n\n getFormattedFilesize() {\n const filesize = this.attributes.get(\"filesize\")\n if (typeof filesize === \"number\") {\n return config.fileSize.formatter(filesize)\n } else {\n return \"\"\n }\n }\n\n getExtension() {\n return this.getFilename()\n .match(/\\.(\\w+)$/)?.[1]\n .toLowerCase()\n }\n\n getContentType() {\n return this.attributes.get(\"contentType\")\n }\n\n hasContent() {\n return this.attributes.has(\"content\")\n }\n\n getContent() {\n return this.attributes.get(\"content\")\n }\n\n getWidth() {\n return this.attributes.get(\"width\")\n }\n\n getHeight() {\n return this.attributes.get(\"height\")\n }\n\n getFile() {\n return this.file\n }\n\n setFile(file) {\n this.file = file\n if (this.isPreviewable()) {\n return this.preloadFile()\n }\n }\n\n releaseFile() {\n this.releasePreloadedFile()\n this.file = null\n }\n\n getUploadProgress() {\n return this.uploadProgress != null ? this.uploadProgress : 0\n }\n\n setUploadProgress(value) {\n if (this.uploadProgress !== value) {\n this.uploadProgress = value\n return this.uploadProgressDelegate?.attachmentDidChangeUploadProgress?.(this)\n }\n }\n\n toJSON() {\n return this.getAttributes()\n }\n\n getCacheKey() {\n return [ super.getCacheKey(...arguments), this.attributes.getCacheKey(), this.getPreviewURL() ].join(\"/\")\n }\n\n // Previewable\n\n getPreviewURL() {\n return this.previewURL || this.preloadingURL\n }\n\n setPreviewURL(url) {\n if (url !== this.getPreviewURL()) {\n this.previewURL = url\n this.previewDelegate?.attachmentDidChangeAttributes?.(this)\n return this.delegate?.attachmentDidChangePreviewURL?.(this)\n }\n }\n\n preloadURL() {\n return this.preload(this.getURL(), this.releaseFile)\n }\n\n preloadFile() {\n if (this.file) {\n this.fileObjectURL = URL.createObjectURL(this.file)\n return this.preload(this.fileObjectURL)\n }\n }\n\n releasePreloadedFile() {\n if (this.fileObjectURL) {\n URL.revokeObjectURL(this.fileObjectURL)\n this.fileObjectURL = null\n }\n }\n\n preload(url, callback) {\n if (url && url !== this.getPreviewURL()) {\n this.preloadingURL = url\n const operation = new ImagePreloadOperation(url)\n return operation\n .then(({ width, height }) => {\n if (!this.getWidth() || !this.getHeight()) {\n this.setAttributes({ width, height })\n }\n this.preloadingURL = null\n this.setPreviewURL(url)\n return callback?.()\n })\n .catch(() => {\n this.preloadingURL = null\n return callback?.()\n })\n }\n }\n}\n", "import { OBJECT_REPLACEMENT_CHARACTER } from \"trix/constants\"\n\nimport Attachment from \"trix/models/attachment\"\nimport Piece from \"trix/models/piece\"\n\nexport default class AttachmentPiece extends Piece {\n static permittedAttributes = [ \"caption\", \"presentation\" ]\n\n static fromJSON(pieceJSON) {\n return new this(Attachment.fromJSON(pieceJSON.attachment), pieceJSON.attributes)\n }\n\n constructor(attachment) {\n super(...arguments)\n this.attachment = attachment\n this.length = 1\n this.ensureAttachmentExclusivelyHasAttribute(\"href\")\n if (!this.attachment.hasContent()) {\n this.removeProhibitedAttributes()\n }\n }\n\n ensureAttachmentExclusivelyHasAttribute(attribute) {\n if (this.hasAttribute(attribute)) {\n if (!this.attachment.hasAttribute(attribute)) {\n this.attachment.setAttributes(this.attributes.slice([ attribute ]))\n }\n this.attributes = this.attributes.remove(attribute)\n }\n }\n\n removeProhibitedAttributes() {\n const attributes = this.attributes.slice(AttachmentPiece.permittedAttributes)\n if (!attributes.isEqualTo(this.attributes)) {\n this.attributes = attributes\n }\n }\n\n getValue() {\n return this.attachment\n }\n\n isSerializable() {\n return !this.attachment.isPending()\n }\n\n getCaption() {\n return this.attributes.get(\"caption\") || \"\"\n }\n\n isEqualTo(piece) {\n return super.isEqualTo(piece) && this.attachment.id === piece?.attachment?.id\n }\n\n toString() {\n return OBJECT_REPLACEMENT_CHARACTER\n }\n\n toJSON() {\n const json = super.toJSON(...arguments)\n json.attachment = this.attachment\n return json\n }\n\n getCacheKey() {\n return [ super.getCacheKey(...arguments), this.attachment.getCacheKey() ].join(\"/\")\n }\n\n toConsole() {\n return JSON.stringify(this.toString())\n }\n}\n\nPiece.registerType(\"attachment\", AttachmentPiece)\n", "import Piece from \"trix/models/piece\"\n\nimport { normalizeNewlines } from \"trix/core/helpers\"\n\nexport default class StringPiece extends Piece {\n static fromJSON(pieceJSON) {\n return new this(pieceJSON.string, pieceJSON.attributes)\n }\n\n constructor(string) {\n super(...arguments)\n this.string = normalizeNewlines(string)\n this.length = this.string.length\n }\n\n getValue() {\n return this.string\n }\n\n toString() {\n return this.string.toString()\n }\n\n isBlockBreak() {\n return this.toString() === \"\\n\" && this.getAttribute(\"blockBreak\") === true\n }\n\n toJSON() {\n const result = super.toJSON(...arguments)\n result.string = this.string\n return result\n }\n\n // Splittable\n\n canBeConsolidatedWith(piece) {\n return piece && this.hasSameConstructorAs(piece) && this.hasSameAttributesAsPiece(piece)\n }\n\n consolidateWith(piece) {\n return new this.constructor(this.toString() + piece.toString(), this.attributes)\n }\n\n splitAtOffset(offset) {\n let left, right\n if (offset === 0) {\n left = null\n right = this\n } else if (offset === this.length) {\n left = this\n right = null\n } else {\n left = new this.constructor(this.string.slice(0, offset), this.attributes)\n right = new this.constructor(this.string.slice(offset), this.attributes)\n }\n return [ left, right ]\n }\n\n toConsole() {\n let { string } = this\n if (string.length > 15) {\n string = string.slice(0, 14) + \"…\"\n }\n return JSON.stringify(string.toString())\n }\n}\n\nPiece.registerType(\"string\", StringPiece)\n", "/* eslint-disable\n prefer-const,\n*/\nimport TrixObject from \"trix/core/object\" // Don't override window.Object\n\nimport { spliceArray } from \"trix/core/helpers\"\n\nexport default class SplittableList extends TrixObject {\n static box(objects) {\n if (objects instanceof this) {\n return objects\n } else {\n return new this(objects)\n }\n }\n\n constructor(objects = []) {\n super(...arguments)\n this.objects = objects.slice(0)\n this.length = this.objects.length\n }\n\n indexOf(object) {\n return this.objects.indexOf(object)\n }\n\n splice(...args) {\n return new this.constructor(spliceArray(this.objects, ...args))\n }\n\n eachObject(callback) {\n return this.objects.map((object, index) => callback(object, index))\n }\n\n insertObjectAtIndex(object, index) {\n return this.splice(index, 0, object)\n }\n\n insertSplittableListAtIndex(splittableList, index) {\n return this.splice(index, 0, ...splittableList.objects)\n }\n\n insertSplittableListAtPosition(splittableList, position) {\n const [ objects, index ] = this.splitObjectAtPosition(position)\n return new this.constructor(objects).insertSplittableListAtIndex(splittableList, index)\n }\n\n editObjectAtIndex(index, callback) {\n return this.replaceObjectAtIndex(callback(this.objects[index]), index)\n }\n\n replaceObjectAtIndex(object, index) {\n return this.splice(index, 1, object)\n }\n\n removeObjectAtIndex(index) {\n return this.splice(index, 1)\n }\n\n getObjectAtIndex(index) {\n return this.objects[index]\n }\n\n getSplittableListInRange(range) {\n const [ objects, leftIndex, rightIndex ] = this.splitObjectsAtRange(range)\n return new this.constructor(objects.slice(leftIndex, rightIndex + 1))\n }\n\n selectSplittableList(test) {\n const objects = this.objects.filter((object) => test(object))\n return new this.constructor(objects)\n }\n\n removeObjectsInRange(range) {\n const [ objects, leftIndex, rightIndex ] = this.splitObjectsAtRange(range)\n return new this.constructor(objects).splice(leftIndex, rightIndex - leftIndex + 1)\n }\n\n transformObjectsInRange(range, transform) {\n const [ objects, leftIndex, rightIndex ] = this.splitObjectsAtRange(range)\n const transformedObjects = objects.map((object, index) =>\n leftIndex <= index && index <= rightIndex ? transform(object) : object\n )\n return new this.constructor(transformedObjects)\n }\n\n splitObjectsAtRange(range) {\n let rightOuterIndex\n let [ objects, leftInnerIndex, offset ] = this.splitObjectAtPosition(startOfRange(range))\n ;[ objects, rightOuterIndex ] = new this.constructor(objects).splitObjectAtPosition(endOfRange(range) + offset)\n\n return [ objects, leftInnerIndex, rightOuterIndex - 1 ]\n }\n\n getObjectAtPosition(position) {\n const { index } = this.findIndexAndOffsetAtPosition(position)\n return this.objects[index]\n }\n\n splitObjectAtPosition(position) {\n let splitIndex, splitOffset\n const { index, offset } = this.findIndexAndOffsetAtPosition(position)\n const objects = this.objects.slice(0)\n if (index != null) {\n if (offset === 0) {\n splitIndex = index\n splitOffset = 0\n } else {\n const object = this.getObjectAtIndex(index)\n const [ leftObject, rightObject ] = object.splitAtOffset(offset)\n objects.splice(index, 1, leftObject, rightObject)\n splitIndex = index + 1\n splitOffset = leftObject.getLength() - offset\n }\n } else {\n splitIndex = objects.length\n splitOffset = 0\n }\n\n return [ objects, splitIndex, splitOffset ]\n }\n\n consolidate() {\n const objects = []\n let pendingObject = this.objects[0]\n\n this.objects.slice(1).forEach((object) => {\n if (pendingObject.canBeConsolidatedWith?.(object)) {\n pendingObject = pendingObject.consolidateWith(object)\n } else {\n objects.push(pendingObject)\n pendingObject = object\n }\n })\n\n if (pendingObject) {\n objects.push(pendingObject)\n }\n\n return new this.constructor(objects)\n }\n\n consolidateFromIndexToIndex(startIndex, endIndex) {\n const objects = this.objects.slice(0)\n const objectsInRange = objects.slice(startIndex, endIndex + 1)\n const consolidatedInRange = new this.constructor(objectsInRange).consolidate().toArray()\n return this.splice(startIndex, objectsInRange.length, ...consolidatedInRange)\n }\n\n findIndexAndOffsetAtPosition(position) {\n let index\n let currentPosition = 0\n for (index = 0; index < this.objects.length; index++) {\n const object = this.objects[index]\n const nextPosition = currentPosition + object.getLength()\n if (currentPosition <= position && position < nextPosition) {\n return { index, offset: position - currentPosition }\n }\n currentPosition = nextPosition\n }\n return { index: null, offset: null }\n }\n\n findPositionAtIndexAndOffset(index, offset) {\n let position = 0\n for (let currentIndex = 0; currentIndex < this.objects.length; currentIndex++) {\n const object = this.objects[currentIndex]\n if (currentIndex < index) {\n position += object.getLength()\n } else if (currentIndex === index) {\n position += offset\n break\n }\n }\n return position\n }\n\n getEndPosition() {\n if (this.endPosition == null) {\n this.endPosition = 0\n this.objects.forEach((object) => this.endPosition += object.getLength())\n }\n\n return this.endPosition\n }\n\n toString() {\n return this.objects.join(\"\")\n }\n\n toArray() {\n return this.objects.slice(0)\n }\n\n toJSON() {\n return this.toArray()\n }\n\n isEqualTo(splittableList) {\n return super.isEqualTo(...arguments) || objectArraysAreEqual(this.objects, splittableList?.objects)\n }\n\n contentsForInspection() {\n return {\n objects: `[${this.objects.map((object) => object.inspect()).join(\", \")}]`,\n }\n }\n}\n\nconst objectArraysAreEqual = function(left, right = []) {\n if (left.length !== right.length) {\n return false\n }\n let result = true\n for (let index = 0; index < left.length; index++) {\n const object = left[index]\n if (result && !object.isEqualTo(right[index])) {\n result = false\n }\n }\n return result\n}\n\nconst startOfRange = (range) => range[0]\n\nconst endOfRange = (range) => range[1]\n", "import TrixObject from \"trix/core/object\" // Don't override window.Object\n\nimport { getDirection } from \"trix/core/helpers\"\n\nimport Piece from \"trix/models/piece\"\nimport AttachmentPiece from \"trix/models/attachment_piece\"\nimport StringPiece from \"trix/models/string_piece\"\nimport SplittableList from \"trix/models/splittable_list\"\n\nimport Hash from \"trix/core/collections/hash\"\n\nexport default class Text extends TrixObject {\n static textForAttachmentWithAttributes(attachment, attributes) {\n const piece = new AttachmentPiece(attachment, attributes)\n return new this([ piece ])\n }\n\n static textForStringWithAttributes(string, attributes) {\n const piece = new StringPiece(string, attributes)\n return new this([ piece ])\n }\n\n static fromJSON(textJSON) {\n const pieces = Array.from(textJSON).map((pieceJSON) => Piece.fromJSON(pieceJSON))\n return new this(pieces)\n }\n\n constructor(pieces = []) {\n super(...arguments)\n const notEmpty = pieces.filter((piece) => !piece.isEmpty())\n this.pieceList = new SplittableList(notEmpty)\n }\n\n copy() {\n return this.copyWithPieceList(this.pieceList)\n }\n\n copyWithPieceList(pieceList) {\n return new this.constructor(pieceList.consolidate().toArray())\n }\n\n copyUsingObjectMap(objectMap) {\n const pieces = this.getPieces().map((piece) => objectMap.find(piece) || piece)\n return new this.constructor(pieces)\n }\n\n appendText(text) {\n return this.insertTextAtPosition(text, this.getLength())\n }\n\n insertTextAtPosition(text, position) {\n return this.copyWithPieceList(this.pieceList.insertSplittableListAtPosition(text.pieceList, position))\n }\n\n removeTextAtRange(range) {\n return this.copyWithPieceList(this.pieceList.removeObjectsInRange(range))\n }\n\n replaceTextAtRange(text, range) {\n return this.removeTextAtRange(range).insertTextAtPosition(text, range[0])\n }\n\n moveTextFromRangeToPosition(range, position) {\n if (range[0] <= position && position <= range[1]) return\n const text = this.getTextAtRange(range)\n const length = text.getLength()\n if (range[0] < position) {\n position -= length\n }\n return this.removeTextAtRange(range).insertTextAtPosition(text, position)\n }\n\n addAttributeAtRange(attribute, value, range) {\n const attributes = {}\n attributes[attribute] = value\n return this.addAttributesAtRange(attributes, range)\n }\n\n addAttributesAtRange(attributes, range) {\n return this.copyWithPieceList(\n this.pieceList.transformObjectsInRange(range, (piece) => piece.copyWithAdditionalAttributes(attributes))\n )\n }\n\n removeAttributeAtRange(attribute, range) {\n return this.copyWithPieceList(\n this.pieceList.transformObjectsInRange(range, (piece) => piece.copyWithoutAttribute(attribute))\n )\n }\n\n setAttributesAtRange(attributes, range) {\n return this.copyWithPieceList(\n this.pieceList.transformObjectsInRange(range, (piece) => piece.copyWithAttributes(attributes))\n )\n }\n\n getAttributesAtPosition(position) {\n return this.pieceList.getObjectAtPosition(position)?.getAttributes() || {}\n }\n\n getCommonAttributes() {\n const objects = Array.from(this.pieceList.toArray()).map((piece) => piece.getAttributes())\n return Hash.fromCommonAttributesOfObjects(objects).toObject()\n }\n\n getCommonAttributesAtRange(range) {\n return this.getTextAtRange(range).getCommonAttributes() || {}\n }\n\n getExpandedRangeForAttributeAtOffset(attributeName, offset) {\n let right\n let left = right = offset\n const length = this.getLength()\n\n while (left > 0 && this.getCommonAttributesAtRange([ left - 1, right ])[attributeName]) {\n left--\n }\n while (right < length && this.getCommonAttributesAtRange([ offset, right + 1 ])[attributeName]) {\n right++\n }\n\n return [ left, right ]\n }\n\n getTextAtRange(range) {\n return this.copyWithPieceList(this.pieceList.getSplittableListInRange(range))\n }\n\n getStringAtRange(range) {\n return this.pieceList.getSplittableListInRange(range).toString()\n }\n\n getStringAtPosition(position) {\n return this.getStringAtRange([ position, position + 1 ])\n }\n\n startsWithString(string) {\n return this.getStringAtRange([ 0, string.length ]) === string\n }\n\n endsWithString(string) {\n const length = this.getLength()\n return this.getStringAtRange([ length - string.length, length ]) === string\n }\n\n getAttachmentPieces() {\n return this.pieceList.toArray().filter((piece) => !!piece.attachment)\n }\n\n getAttachments() {\n return this.getAttachmentPieces().map((piece) => piece.attachment)\n }\n\n getAttachmentAndPositionById(attachmentId) {\n let position = 0\n for (const piece of this.pieceList.toArray()) {\n if (piece.attachment?.id === attachmentId) {\n return { attachment: piece.attachment, position }\n }\n position += piece.length\n }\n return { attachment: null, position: null }\n }\n\n getAttachmentById(attachmentId) {\n const { attachment } = this.getAttachmentAndPositionById(attachmentId)\n return attachment\n }\n\n getRangeOfAttachment(attachment) {\n const attachmentAndPosition = this.getAttachmentAndPositionById(attachment.id)\n const position = attachmentAndPosition.position\n attachment = attachmentAndPosition.attachment\n if (attachment) {\n return [ position, position + 1 ]\n }\n }\n\n updateAttributesForAttachment(attributes, attachment) {\n const range = this.getRangeOfAttachment(attachment)\n if (range) {\n return this.addAttributesAtRange(attributes, range)\n } else {\n return this\n }\n }\n\n getLength() {\n return this.pieceList.getEndPosition()\n }\n\n isEmpty() {\n return this.getLength() === 0\n }\n\n isEqualTo(text) {\n return super.isEqualTo(text) || text?.pieceList?.isEqualTo(this.pieceList)\n }\n\n isBlockBreak() {\n return this.getLength() === 1 && this.pieceList.getObjectAtIndex(0).isBlockBreak()\n }\n\n eachPiece(callback) {\n return this.pieceList.eachObject(callback)\n }\n\n getPieces() {\n return this.pieceList.toArray()\n }\n\n getPieceAtPosition(position) {\n return this.pieceList.getObjectAtPosition(position)\n }\n\n contentsForInspection() {\n return { pieceList: this.pieceList.inspect() }\n }\n\n toSerializableText() {\n const pieceList = this.pieceList.selectSplittableList((piece) => piece.isSerializable())\n return this.copyWithPieceList(pieceList)\n }\n\n toString() {\n return this.pieceList.toString()\n }\n\n toJSON() {\n return this.pieceList.toJSON()\n }\n\n toConsole() {\n return JSON.stringify(this.pieceList.toArray().map((piece) => JSON.parse(piece.toConsole())))\n }\n\n // BIDI\n\n getDirection() {\n return getDirection(this.toString())\n }\n\n isRTL() {\n return this.getDirection() === \"rtl\"\n }\n}\n", "import TrixObject from \"trix/core/object\" // Don't override window.Object\nimport Text from \"trix/models/text\"\n\nimport {\n arraysAreEqual,\n getBlockConfig,\n getListAttributeNames,\n objectsAreEqual,\n spliceArray,\n} from \"trix/core/helpers\"\n\nexport default class Block extends TrixObject {\n static fromJSON(blockJSON) {\n const text = Text.fromJSON(blockJSON.text)\n return new this(text, blockJSON.attributes, blockJSON.htmlAttributes)\n }\n\n constructor(text, attributes, htmlAttributes) {\n super(...arguments)\n this.text = applyBlockBreakToText(text || new Text())\n this.attributes = attributes || []\n this.htmlAttributes = htmlAttributes || {}\n }\n\n isEmpty() {\n return this.text.isBlockBreak()\n }\n\n isEqualTo(block) {\n if (super.isEqualTo(block)) return true\n\n return this.text.isEqualTo(block?.text) && arraysAreEqual(this.attributes, block?.attributes) && objectsAreEqual(this.htmlAttributes, block?.htmlAttributes)\n }\n\n copyWithText(text) {\n return new Block(text, this.attributes, this.htmlAttributes)\n }\n\n copyWithoutText() {\n return this.copyWithText(null)\n }\n\n copyWithAttributes(attributes) {\n return new Block(this.text, attributes, this.htmlAttributes)\n }\n\n copyWithoutAttributes() {\n return this.copyWithAttributes(null)\n }\n\n copyUsingObjectMap(objectMap) {\n const mappedText = objectMap.find(this.text)\n if (mappedText) {\n return this.copyWithText(mappedText)\n } else {\n return this.copyWithText(this.text.copyUsingObjectMap(objectMap))\n }\n }\n\n addAttribute(attribute) {\n const attributes = this.attributes.concat(expandAttribute(attribute))\n return this.copyWithAttributes(attributes)\n }\n\n addHTMLAttribute(attribute, value) {\n const htmlAttributes = Object.assign({}, this.htmlAttributes, { [attribute]: value })\n return new Block(this.text, this.attributes, htmlAttributes)\n }\n\n removeAttribute(attribute) {\n const { listAttribute } = getBlockConfig(attribute)\n const attributes = removeLastValue(removeLastValue(this.attributes, attribute), listAttribute)\n return this.copyWithAttributes(attributes)\n }\n\n removeLastAttribute() {\n return this.removeAttribute(this.getLastAttribute())\n }\n\n getLastAttribute() {\n return getLastElement(this.attributes)\n }\n\n getAttributes() {\n return this.attributes.slice(0)\n }\n\n getAttributeLevel() {\n return this.attributes.length\n }\n\n getAttributeAtLevel(level) {\n return this.attributes[level - 1]\n }\n\n hasAttribute(attributeName) {\n return this.attributes.includes(attributeName)\n }\n\n hasAttributes() {\n return this.getAttributeLevel() > 0\n }\n\n getLastNestableAttribute() {\n return getLastElement(this.getNestableAttributes())\n }\n\n getNestableAttributes() {\n return this.attributes.filter((attribute) => getBlockConfig(attribute).nestable)\n }\n\n getNestingLevel() {\n return this.getNestableAttributes().length\n }\n\n decreaseNestingLevel() {\n const attribute = this.getLastNestableAttribute()\n if (attribute) {\n return this.removeAttribute(attribute)\n } else {\n return this\n }\n }\n\n increaseNestingLevel() {\n const attribute = this.getLastNestableAttribute()\n if (attribute) {\n const index = this.attributes.lastIndexOf(attribute)\n const attributes = spliceArray(this.attributes, index + 1, 0, ...expandAttribute(attribute))\n return this.copyWithAttributes(attributes)\n } else {\n return this\n }\n }\n\n getListItemAttributes() {\n return this.attributes.filter((attribute) => getBlockConfig(attribute).listAttribute)\n }\n\n isListItem() {\n return getBlockConfig(this.getLastAttribute())?.listAttribute\n }\n\n isTerminalBlock() {\n return getBlockConfig(this.getLastAttribute())?.terminal\n }\n\n breaksOnReturn() {\n return getBlockConfig(this.getLastAttribute())?.breakOnReturn\n }\n\n findLineBreakInDirectionFromPosition(direction, position) {\n const string = this.toString()\n let result\n switch (direction) {\n case \"forward\":\n result = string.indexOf(\"\\n\", position)\n break\n case \"backward\":\n result = string.slice(0, position).lastIndexOf(\"\\n\")\n }\n\n if (result !== -1) {\n return result\n }\n }\n\n contentsForInspection() {\n return {\n text: this.text.inspect(),\n attributes: this.attributes,\n }\n }\n\n toString() {\n return this.text.toString()\n }\n\n toJSON() {\n return {\n text: this.text,\n attributes: this.attributes,\n htmlAttributes: this.htmlAttributes,\n }\n }\n\n // BIDI\n\n getDirection() {\n return this.text.getDirection()\n }\n\n isRTL() {\n return this.text.isRTL()\n }\n\n // Splittable\n\n getLength() {\n return this.text.getLength()\n }\n\n canBeConsolidatedWith(block) {\n return !this.hasAttributes() && !block.hasAttributes() && this.getDirection() === block.getDirection()\n }\n\n consolidateWith(block) {\n const newlineText = Text.textForStringWithAttributes(\"\\n\")\n const text = this.getTextWithoutBlockBreak().appendText(newlineText)\n return this.copyWithText(text.appendText(block.text))\n }\n\n splitAtOffset(offset) {\n let left, right\n if (offset === 0) {\n left = null\n right = this\n } else if (offset === this.getLength()) {\n left = this\n right = null\n } else {\n left = this.copyWithText(this.text.getTextAtRange([ 0, offset ]))\n right = this.copyWithText(this.text.getTextAtRange([ offset, this.getLength() ]))\n }\n return [ left, right ]\n }\n\n getBlockBreakPosition() {\n return this.text.getLength() - 1\n }\n\n getTextWithoutBlockBreak() {\n if (textEndsInBlockBreak(this.text)) {\n return this.text.getTextAtRange([ 0, this.getBlockBreakPosition() ])\n } else {\n return this.text.copy()\n }\n }\n\n // Grouping\n\n canBeGrouped(depth) {\n return this.attributes[depth]\n }\n\n canBeGroupedWith(otherBlock, depth) {\n const otherAttributes = otherBlock.getAttributes()\n const otherAttribute = otherAttributes[depth]\n const attribute = this.attributes[depth]\n\n return (\n attribute === otherAttribute &&\n !(getBlockConfig(attribute).group === false && !getListAttributeNames().includes(otherAttributes[depth + 1])) &&\n (this.getDirection() === otherBlock.getDirection() || otherBlock.isEmpty())\n )\n }\n}\n\n// Block breaks\n\nconst applyBlockBreakToText = function(text) {\n text = unmarkExistingInnerBlockBreaksInText(text)\n text = addBlockBreakToText(text)\n return text\n}\n\nconst unmarkExistingInnerBlockBreaksInText = function(text) {\n let modified = false\n const pieces = text.getPieces()\n\n let innerPieces = pieces.slice(0, pieces.length - 1)\n const lastPiece = pieces[pieces.length - 1]\n\n if (!lastPiece) return text\n\n innerPieces = innerPieces.map((piece) => {\n if (piece.isBlockBreak()) {\n modified = true\n return unmarkBlockBreakPiece(piece)\n } else {\n return piece\n }\n })\n\n if (modified) {\n return new Text([ ...innerPieces, lastPiece ])\n } else {\n return text\n }\n}\n\nconst blockBreakText = Text.textForStringWithAttributes(\"\\n\", { blockBreak: true })\n\nconst addBlockBreakToText = function(text) {\n if (textEndsInBlockBreak(text)) {\n return text\n } else {\n return text.appendText(blockBreakText)\n }\n}\n\nconst textEndsInBlockBreak = function(text) {\n const length = text.getLength()\n if (length === 0) {\n return false\n }\n const endText = text.getTextAtRange([ length - 1, length ])\n return endText.isBlockBreak()\n}\n\nconst unmarkBlockBreakPiece = (piece) => piece.copyWithoutAttribute(\"blockBreak\")\n\n// Attributes\n\nconst expandAttribute = function(attribute) {\n const { listAttribute } = getBlockConfig(attribute)\n if (listAttribute) {\n return [ listAttribute, attribute ]\n } else {\n return [ attribute ]\n }\n}\n\n// Array helpers\n\nconst getLastElement = (array) => array.slice(-1)[0]\n\nconst removeLastValue = function(array, value) {\n const index = array.lastIndexOf(value)\n if (index === -1) {\n return array\n } else {\n return spliceArray(array, index, 1)\n }\n}\n", "import * as config from \"trix/config\"\nimport TrixObject from \"trix/core/object\" // Don't override window.Object\n\nimport Text from \"trix/models/text\"\nimport Block from \"trix/models/block\"\nimport SplittableList from \"trix/models/splittable_list\"\nimport Hash from \"trix/core/collections/hash\"\nimport ObjectMap from \"trix/core/collections/object_map\"\n\nimport { arraysAreEqual, getBlockConfig, normalizeRange, rangeIsCollapsed } from \"trix/core/helpers\"\n\nexport default class Document extends TrixObject {\n static fromJSON(documentJSON) {\n const blocks = Array.from(documentJSON).map((blockJSON) => Block.fromJSON(blockJSON))\n return new this(blocks)\n }\n\n static fromString(string, textAttributes) {\n const text = Text.textForStringWithAttributes(string, textAttributes)\n return new this([ new Block(text) ])\n }\n\n constructor(blocks = []) {\n super(...arguments)\n if (blocks.length === 0) {\n blocks = [ new Block() ]\n }\n this.blockList = SplittableList.box(blocks)\n }\n\n isEmpty() {\n const block = this.getBlockAtIndex(0)\n return this.blockList.length === 1 && block.isEmpty() && !block.hasAttributes()\n }\n\n copy(options = {}) {\n const blocks = options.consolidateBlocks ? this.blockList.consolidate().toArray() : this.blockList.toArray()\n\n return new this.constructor(blocks)\n }\n\n copyUsingObjectsFromDocument(sourceDocument) {\n const objectMap = new ObjectMap(sourceDocument.getObjects())\n return this.copyUsingObjectMap(objectMap)\n }\n\n copyUsingObjectMap(objectMap) {\n const blocks = this.getBlocks().map((block) => {\n const mappedBlock = objectMap.find(block)\n return mappedBlock || block.copyUsingObjectMap(objectMap)\n })\n return new this.constructor(blocks)\n }\n\n copyWithBaseBlockAttributes(blockAttributes = []) {\n const blocks = this.getBlocks().map((block) => {\n const attributes = blockAttributes.concat(block.getAttributes())\n return block.copyWithAttributes(attributes)\n })\n\n return new this.constructor(blocks)\n }\n\n replaceBlock(oldBlock, newBlock) {\n const index = this.blockList.indexOf(oldBlock)\n if (index === -1) {\n return this\n }\n return new this.constructor(this.blockList.replaceObjectAtIndex(newBlock, index))\n }\n\n insertDocumentAtRange(document, range) {\n const { blockList } = document\n range = normalizeRange(range)\n let [ position ] = range\n const { index, offset } = this.locationFromPosition(position)\n\n let result = this\n const block = this.getBlockAtPosition(position)\n\n if (rangeIsCollapsed(range) && block.isEmpty() && !block.hasAttributes()) {\n result = new this.constructor(result.blockList.removeObjectAtIndex(index))\n } else if (block.getBlockBreakPosition() === offset) {\n position++\n }\n\n result = result.removeTextAtRange(range)\n return new this.constructor(result.blockList.insertSplittableListAtPosition(blockList, position))\n }\n\n mergeDocumentAtRange(document, range) {\n let formattedDocument, result\n range = normalizeRange(range)\n const [ startPosition ] = range\n const startLocation = this.locationFromPosition(startPosition)\n const blockAttributes = this.getBlockAtIndex(startLocation.index).getAttributes()\n const baseBlockAttributes = document.getBaseBlockAttributes()\n const trailingBlockAttributes = blockAttributes.slice(-baseBlockAttributes.length)\n\n if (arraysAreEqual(baseBlockAttributes, trailingBlockAttributes)) {\n const leadingBlockAttributes = blockAttributes.slice(0, -baseBlockAttributes.length)\n formattedDocument = document.copyWithBaseBlockAttributes(leadingBlockAttributes)\n } else {\n formattedDocument = document.copy({ consolidateBlocks: true }).copyWithBaseBlockAttributes(blockAttributes)\n }\n\n const blockCount = formattedDocument.getBlockCount()\n const firstBlock = formattedDocument.getBlockAtIndex(0)\n\n if (arraysAreEqual(blockAttributes, firstBlock.getAttributes())) {\n const firstText = firstBlock.getTextWithoutBlockBreak()\n result = this.insertTextAtRange(firstText, range)\n\n if (blockCount > 1) {\n formattedDocument = new this.constructor(formattedDocument.getBlocks().slice(1))\n const position = startPosition + firstText.getLength()\n result = result.insertDocumentAtRange(formattedDocument, position)\n }\n } else {\n result = this.insertDocumentAtRange(formattedDocument, range)\n }\n\n return result\n }\n\n insertTextAtRange(text, range) {\n range = normalizeRange(range)\n const [ startPosition ] = range\n const { index, offset } = this.locationFromPosition(startPosition)\n\n const document = this.removeTextAtRange(range)\n return new this.constructor(\n document.blockList.editObjectAtIndex(index, (block) =>\n block.copyWithText(block.text.insertTextAtPosition(text, offset))\n )\n )\n }\n\n removeTextAtRange(range) {\n let blocks\n range = normalizeRange(range)\n const [ leftPosition, rightPosition ] = range\n if (rangeIsCollapsed(range)) {\n return this\n }\n const [ leftLocation, rightLocation ] = Array.from(this.locationRangeFromRange(range))\n\n const leftIndex = leftLocation.index\n const leftOffset = leftLocation.offset\n const leftBlock = this.getBlockAtIndex(leftIndex)\n\n const rightIndex = rightLocation.index\n const rightOffset = rightLocation.offset\n const rightBlock = this.getBlockAtIndex(rightIndex)\n\n const removeRightNewline =\n rightPosition - leftPosition === 1 &&\n leftBlock.getBlockBreakPosition() === leftOffset &&\n rightBlock.getBlockBreakPosition() !== rightOffset &&\n rightBlock.text.getStringAtPosition(rightOffset) === \"\\n\"\n\n if (removeRightNewline) {\n blocks = this.blockList.editObjectAtIndex(rightIndex, (block) =>\n block.copyWithText(block.text.removeTextAtRange([ rightOffset, rightOffset + 1 ]))\n )\n } else {\n let block\n const leftText = leftBlock.text.getTextAtRange([ 0, leftOffset ])\n const rightText = rightBlock.text.getTextAtRange([ rightOffset, rightBlock.getLength() ])\n const text = leftText.appendText(rightText)\n\n const removingLeftBlock = leftIndex !== rightIndex && leftOffset === 0\n const useRightBlock = removingLeftBlock && leftBlock.getAttributeLevel() >= rightBlock.getAttributeLevel()\n\n if (useRightBlock) {\n block = rightBlock.copyWithText(text)\n } else {\n block = leftBlock.copyWithText(text)\n }\n\n const affectedBlockCount = rightIndex + 1 - leftIndex\n blocks = this.blockList.splice(leftIndex, affectedBlockCount, block)\n }\n\n return new this.constructor(blocks)\n }\n\n moveTextFromRangeToPosition(range, position) {\n let text\n range = normalizeRange(range)\n const [ startPosition, endPosition ] = range\n if (startPosition <= position && position <= endPosition) {\n return this\n }\n\n let document = this.getDocumentAtRange(range)\n let result = this.removeTextAtRange(range)\n\n const movingRightward = startPosition < position\n if (movingRightward) {\n position -= document.getLength()\n }\n\n const [ firstBlock, ...blocks ] = document.getBlocks()\n if (blocks.length === 0) {\n text = firstBlock.getTextWithoutBlockBreak()\n if (movingRightward) {\n position += 1\n }\n } else {\n text = firstBlock.text\n }\n\n result = result.insertTextAtRange(text, position)\n if (blocks.length === 0) {\n return result\n }\n\n document = new this.constructor(blocks)\n position += text.getLength()\n\n return result.insertDocumentAtRange(document, position)\n }\n\n addAttributeAtRange(attribute, value, range) {\n let { blockList } = this\n this.eachBlockAtRange(\n range,\n (block, textRange, index) =>\n blockList = blockList.editObjectAtIndex(index, function() {\n if (getBlockConfig(attribute)) {\n return block.addAttribute(attribute, value)\n } else {\n if (textRange[0] === textRange[1]) {\n return block\n } else {\n return block.copyWithText(block.text.addAttributeAtRange(attribute, value, textRange))\n }\n }\n })\n )\n return new this.constructor(blockList)\n }\n\n addAttribute(attribute, value) {\n let { blockList } = this\n this.eachBlock(\n (block, index) => blockList = blockList.editObjectAtIndex(index, () => block.addAttribute(attribute, value))\n )\n return new this.constructor(blockList)\n }\n\n removeAttributeAtRange(attribute, range) {\n let { blockList } = this\n this.eachBlockAtRange(range, function(block, textRange, index) {\n if (getBlockConfig(attribute)) {\n blockList = blockList.editObjectAtIndex(index, () => block.removeAttribute(attribute))\n } else if (textRange[0] !== textRange[1]) {\n blockList = blockList.editObjectAtIndex(index, () =>\n block.copyWithText(block.text.removeAttributeAtRange(attribute, textRange))\n )\n }\n })\n return new this.constructor(blockList)\n }\n\n updateAttributesForAttachment(attributes, attachment) {\n const range = this.getRangeOfAttachment(attachment)\n const [ startPosition ] = Array.from(range)\n const { index } = this.locationFromPosition(startPosition)\n const text = this.getTextAtIndex(index)\n\n return new this.constructor(\n this.blockList.editObjectAtIndex(index, (block) =>\n block.copyWithText(text.updateAttributesForAttachment(attributes, attachment))\n )\n )\n }\n\n removeAttributeForAttachment(attribute, attachment) {\n const range = this.getRangeOfAttachment(attachment)\n return this.removeAttributeAtRange(attribute, range)\n }\n\n setHTMLAttributeAtPosition(position, name, value) {\n const block = this.getBlockAtPosition(position)\n const updatedBlock = block.addHTMLAttribute(name, value)\n return this.replaceBlock(block, updatedBlock)\n }\n\n insertBlockBreakAtRange(range) {\n let blocks\n range = normalizeRange(range)\n const [ startPosition ] = range\n const { offset } = this.locationFromPosition(startPosition)\n\n const document = this.removeTextAtRange(range)\n if (offset === 0) {\n blocks = [ new Block() ]\n }\n return new this.constructor(\n document.blockList.insertSplittableListAtPosition(new SplittableList(blocks), startPosition)\n )\n }\n\n applyBlockAttributeAtRange(attributeName, value, range) {\n const expanded = this.expandRangeToLineBreaksAndSplitBlocks(range)\n let document = expanded.document\n range = expanded.range\n const blockConfig = getBlockConfig(attributeName)\n\n if (blockConfig.listAttribute) {\n document = document.removeLastListAttributeAtRange(range, { exceptAttributeName: attributeName })\n const converted = document.convertLineBreaksToBlockBreaksInRange(range)\n document = converted.document\n range = converted.range\n } else if (blockConfig.exclusive) {\n document = document.removeBlockAttributesAtRange(range)\n } else if (blockConfig.terminal) {\n document = document.removeLastTerminalAttributeAtRange(range)\n } else {\n document = document.consolidateBlocksAtRange(range)\n }\n\n return document.addAttributeAtRange(attributeName, value, range)\n }\n\n removeLastListAttributeAtRange(range, options = {}) {\n let { blockList } = this\n this.eachBlockAtRange(range, function(block, textRange, index) {\n const lastAttributeName = block.getLastAttribute()\n if (!lastAttributeName) {\n return\n }\n if (!getBlockConfig(lastAttributeName).listAttribute) {\n return\n }\n if (lastAttributeName === options.exceptAttributeName) {\n return\n }\n blockList = blockList.editObjectAtIndex(index, () => block.removeAttribute(lastAttributeName))\n })\n return new this.constructor(blockList)\n }\n\n removeLastTerminalAttributeAtRange(range) {\n let { blockList } = this\n this.eachBlockAtRange(range, function(block, textRange, index) {\n const lastAttributeName = block.getLastAttribute()\n if (!lastAttributeName) {\n return\n }\n if (!getBlockConfig(lastAttributeName).terminal) {\n return\n }\n blockList = blockList.editObjectAtIndex(index, () => block.removeAttribute(lastAttributeName))\n })\n return new this.constructor(blockList)\n }\n\n removeBlockAttributesAtRange(range) {\n let { blockList } = this\n this.eachBlockAtRange(range, function(block, textRange, index) {\n if (block.hasAttributes()) {\n blockList = blockList.editObjectAtIndex(index, () => block.copyWithoutAttributes())\n }\n })\n return new this.constructor(blockList)\n }\n\n expandRangeToLineBreaksAndSplitBlocks(range) {\n let position\n range = normalizeRange(range)\n let [ startPosition, endPosition ] = range\n const startLocation = this.locationFromPosition(startPosition)\n const endLocation = this.locationFromPosition(endPosition)\n let document = this\n\n const startBlock = document.getBlockAtIndex(startLocation.index)\n startLocation.offset = startBlock.findLineBreakInDirectionFromPosition(\"backward\", startLocation.offset)\n if (startLocation.offset != null) {\n position = document.positionFromLocation(startLocation)\n document = document.insertBlockBreakAtRange([ position, position + 1 ])\n endLocation.index += 1\n endLocation.offset -= document.getBlockAtIndex(startLocation.index).getLength()\n startLocation.index += 1\n }\n startLocation.offset = 0\n\n if (endLocation.offset === 0 && endLocation.index > startLocation.index) {\n endLocation.index -= 1\n endLocation.offset = document.getBlockAtIndex(endLocation.index).getBlockBreakPosition()\n } else {\n const endBlock = document.getBlockAtIndex(endLocation.index)\n if (endBlock.text.getStringAtRange([ endLocation.offset - 1, endLocation.offset ]) === \"\\n\") {\n endLocation.offset -= 1\n } else {\n endLocation.offset = endBlock.findLineBreakInDirectionFromPosition(\"forward\", endLocation.offset)\n }\n if (endLocation.offset !== endBlock.getBlockBreakPosition()) {\n position = document.positionFromLocation(endLocation)\n document = document.insertBlockBreakAtRange([ position, position + 1 ])\n }\n }\n\n startPosition = document.positionFromLocation(startLocation)\n endPosition = document.positionFromLocation(endLocation)\n range = normalizeRange([ startPosition, endPosition ])\n\n return { document, range }\n }\n\n convertLineBreaksToBlockBreaksInRange(range) {\n range = normalizeRange(range)\n let [ position ] = range\n const string = this.getStringAtRange(range).slice(0, -1)\n let document = this\n\n string.replace(/.*?\\n/g, function(match) {\n position += match.length\n document = document.insertBlockBreakAtRange([ position - 1, position ])\n })\n\n return { document, range }\n }\n\n consolidateBlocksAtRange(range) {\n range = normalizeRange(range)\n const [ startPosition, endPosition ] = range\n const startIndex = this.locationFromPosition(startPosition).index\n const endIndex = this.locationFromPosition(endPosition).index\n return new this.constructor(this.blockList.consolidateFromIndexToIndex(startIndex, endIndex))\n }\n\n getDocumentAtRange(range) {\n range = normalizeRange(range)\n const blocks = this.blockList.getSplittableListInRange(range).toArray()\n return new this.constructor(blocks)\n }\n\n getStringAtRange(range) {\n let endIndex\n const array = range = normalizeRange(range),\n endPosition = array[array.length - 1]\n if (endPosition !== this.getLength()) {\n endIndex = -1\n }\n return this.getDocumentAtRange(range).toString().slice(0, endIndex)\n }\n\n getBlockAtIndex(index) {\n return this.blockList.getObjectAtIndex(index)\n }\n\n getBlockAtPosition(position) {\n const { index } = this.locationFromPosition(position)\n return this.getBlockAtIndex(index)\n }\n\n getTextAtIndex(index) {\n return this.getBlockAtIndex(index)?.text\n }\n\n getTextAtPosition(position) {\n const { index } = this.locationFromPosition(position)\n return this.getTextAtIndex(index)\n }\n\n getPieceAtPosition(position) {\n const { index, offset } = this.locationFromPosition(position)\n return this.getTextAtIndex(index).getPieceAtPosition(offset)\n }\n\n getCharacterAtPosition(position) {\n const { index, offset } = this.locationFromPosition(position)\n return this.getTextAtIndex(index).getStringAtRange([ offset, offset + 1 ])\n }\n\n getLength() {\n return this.blockList.getEndPosition()\n }\n\n getBlocks() {\n return this.blockList.toArray()\n }\n\n getBlockCount() {\n return this.blockList.length\n }\n\n getEditCount() {\n return this.editCount\n }\n\n eachBlock(callback) {\n return this.blockList.eachObject(callback)\n }\n\n eachBlockAtRange(range, callback) {\n let block, textRange\n range = normalizeRange(range)\n const [ startPosition, endPosition ] = range\n const startLocation = this.locationFromPosition(startPosition)\n const endLocation = this.locationFromPosition(endPosition)\n\n if (startLocation.index === endLocation.index) {\n block = this.getBlockAtIndex(startLocation.index)\n textRange = [ startLocation.offset, endLocation.offset ]\n return callback(block, textRange, startLocation.index)\n } else {\n for (let index = startLocation.index; index <= endLocation.index; index++) {\n block = this.getBlockAtIndex(index)\n if (block) {\n switch (index) {\n case startLocation.index:\n textRange = [ startLocation.offset, block.text.getLength() ]\n break\n case endLocation.index:\n textRange = [ 0, endLocation.offset ]\n break\n default:\n textRange = [ 0, block.text.getLength() ]\n }\n callback(block, textRange, index)\n }\n }\n }\n }\n\n getCommonAttributesAtRange(range) {\n range = normalizeRange(range)\n const [ startPosition ] = range\n if (rangeIsCollapsed(range)) {\n return this.getCommonAttributesAtPosition(startPosition)\n } else {\n const textAttributes = []\n const blockAttributes = []\n\n this.eachBlockAtRange(range, function(block, textRange) {\n if (textRange[0] !== textRange[1]) {\n textAttributes.push(block.text.getCommonAttributesAtRange(textRange))\n return blockAttributes.push(attributesForBlock(block))\n }\n })\n\n return Hash.fromCommonAttributesOfObjects(textAttributes)\n .merge(Hash.fromCommonAttributesOfObjects(blockAttributes))\n .toObject()\n }\n }\n\n getCommonAttributesAtPosition(position) {\n let key, value\n const { index, offset } = this.locationFromPosition(position)\n const block = this.getBlockAtIndex(index)\n if (!block) {\n return {}\n }\n\n const commonAttributes = attributesForBlock(block)\n const attributes = block.text.getAttributesAtPosition(offset)\n const attributesLeft = block.text.getAttributesAtPosition(offset - 1)\n const inheritableAttributes = Object.keys(config.textAttributes).filter((key) => {\n return config.textAttributes[key].inheritable\n })\n\n for (key in attributesLeft) {\n value = attributesLeft[key]\n if (value === attributes[key] || inheritableAttributes.includes(key)) {\n commonAttributes[key] = value\n }\n }\n\n return commonAttributes\n }\n\n getRangeOfCommonAttributeAtPosition(attributeName, position) {\n const { index, offset } = this.locationFromPosition(position)\n const text = this.getTextAtIndex(index)\n const [ startOffset, endOffset ] = Array.from(text.getExpandedRangeForAttributeAtOffset(attributeName, offset))\n\n const start = this.positionFromLocation({ index, offset: startOffset })\n const end = this.positionFromLocation({ index, offset: endOffset })\n return normalizeRange([ start, end ])\n }\n\n getBaseBlockAttributes() {\n let baseBlockAttributes = this.getBlockAtIndex(0).getAttributes()\n\n for (let blockIndex = 1; blockIndex < this.getBlockCount(); blockIndex++) {\n const blockAttributes = this.getBlockAtIndex(blockIndex).getAttributes()\n const lastAttributeIndex = Math.min(baseBlockAttributes.length, blockAttributes.length)\n\n baseBlockAttributes = (() => {\n const result = []\n for (let index = 0; index < lastAttributeIndex; index++) {\n if (blockAttributes[index] !== baseBlockAttributes[index]) {\n break\n }\n result.push(blockAttributes[index])\n }\n return result\n })()\n }\n\n return baseBlockAttributes\n }\n\n getAttachmentById(attachmentId) {\n for (const attachment of this.getAttachments()) {\n if (attachment.id === attachmentId) {\n return attachment\n }\n }\n }\n\n getAttachmentPieces() {\n let attachmentPieces = []\n this.blockList.eachObject(({ text }) => attachmentPieces = attachmentPieces.concat(text.getAttachmentPieces()))\n return attachmentPieces\n }\n\n getAttachments() {\n return this.getAttachmentPieces().map((piece) => piece.attachment)\n }\n\n getRangeOfAttachment(attachment) {\n let position = 0\n const iterable = this.blockList.toArray()\n for (let index = 0; index < iterable.length; index++) {\n const { text } = iterable[index]\n const textRange = text.getRangeOfAttachment(attachment)\n if (textRange) {\n return normalizeRange([ position + textRange[0], position + textRange[1] ])\n }\n position += text.getLength()\n }\n }\n\n getLocationRangeOfAttachment(attachment) {\n const range = this.getRangeOfAttachment(attachment)\n return this.locationRangeFromRange(range)\n }\n\n getAttachmentPieceForAttachment(attachment) {\n for (const piece of this.getAttachmentPieces()) {\n if (piece.attachment === attachment) {\n return piece\n }\n }\n }\n\n findRangesForBlockAttribute(attributeName) {\n let position = 0\n const ranges = []\n\n this.getBlocks().forEach((block) => {\n const length = block.getLength()\n if (block.hasAttribute(attributeName)) {\n ranges.push([ position, position + length ])\n }\n position += length\n })\n\n return ranges\n }\n\n findRangesForTextAttribute(attributeName, { withValue } = {}) {\n let position = 0\n let range = []\n const ranges = []\n\n const match = function(piece) {\n if (withValue) {\n return piece.getAttribute(attributeName) === withValue\n } else {\n return piece.hasAttribute(attributeName)\n }\n }\n\n this.getPieces().forEach((piece) => {\n const length = piece.getLength()\n if (match(piece)) {\n if (range[1] === position) {\n range[1] = position + length\n } else {\n ranges.push(range = [ position, position + length ])\n }\n }\n position += length\n })\n\n return ranges\n }\n\n locationFromPosition(position) {\n const location = this.blockList.findIndexAndOffsetAtPosition(Math.max(0, position))\n if (location.index != null) {\n return location\n } else {\n const blocks = this.getBlocks()\n return { index: blocks.length - 1, offset: blocks[blocks.length - 1].getLength() }\n }\n }\n\n positionFromLocation(location) {\n return this.blockList.findPositionAtIndexAndOffset(location.index, location.offset)\n }\n\n locationRangeFromPosition(position) {\n return normalizeRange(this.locationFromPosition(position))\n }\n\n locationRangeFromRange(range) {\n range = normalizeRange(range)\n if (!range) return\n\n const [ startPosition, endPosition ] = Array.from(range)\n const startLocation = this.locationFromPosition(startPosition)\n const endLocation = this.locationFromPosition(endPosition)\n return normalizeRange([ startLocation, endLocation ])\n }\n\n rangeFromLocationRange(locationRange) {\n let rightPosition\n locationRange = normalizeRange(locationRange)\n const leftPosition = this.positionFromLocation(locationRange[0])\n if (!rangeIsCollapsed(locationRange)) {\n rightPosition = this.positionFromLocation(locationRange[1])\n }\n return normalizeRange([ leftPosition, rightPosition ])\n }\n\n isEqualTo(document) {\n return this.blockList.isEqualTo(document?.blockList)\n }\n\n getTexts() {\n return this.getBlocks().map((block) => block.text)\n }\n\n getPieces() {\n const pieces = []\n\n Array.from(this.getTexts()).forEach((text) => {\n pieces.push(...Array.from(text.getPieces() || []))\n })\n\n return pieces\n }\n\n getObjects() {\n return this.getBlocks().concat(this.getTexts()).concat(this.getPieces())\n }\n\n toSerializableDocument() {\n const blocks = []\n this.blockList.eachObject((block) => blocks.push(block.copyWithText(block.text.toSerializableText())))\n return new this.constructor(blocks)\n }\n\n toString() {\n return this.blockList.toString()\n }\n\n toJSON() {\n return this.blockList.toJSON()\n }\n\n toConsole() {\n return JSON.stringify(this.blockList.toArray().map((block) => JSON.parse(block.text.toConsole())))\n }\n}\n\nconst attributesForBlock = function(block) {\n const attributes = {}\n const attributeName = block.getLastAttribute()\n if (attributeName) {\n attributes[attributeName] = true\n }\n return attributes\n}\n", "/* eslint-disable\n no-case-declarations,\n no-irregular-whitespace,\n*/\nimport * as config from \"trix/config\"\nimport BasicObject from \"trix/core/basic_object\"\nimport Document from \"trix/models/document\"\nimport HTMLSanitizer from \"trix/models/html_sanitizer\"\n\nimport {\n arraysAreEqual,\n breakableWhitespacePattern,\n elementContainsNode,\n findClosestElementFromNode,\n getBlockTagNames,\n makeElement,\n nodeIsAttachmentElement,\n normalizeSpaces,\n removeNode,\n squishBreakableWhitespace,\n tagName,\n walkTree,\n} from \"trix/core/helpers\"\n\nconst pieceForString = (string, attributes = {}) => {\n const type = \"string\"\n string = normalizeSpaces(string)\n return { string, attributes, type }\n}\n\nconst pieceForAttachment = (attachment, attributes = {}) => {\n const type = \"attachment\"\n return { attachment, attributes, type }\n}\n\nconst blockForAttributes = (attributes = {}, htmlAttributes = {}) => {\n const text = []\n return { text, attributes, htmlAttributes }\n}\n\nconst parseTrixDataAttribute = (element, name) => {\n try {\n return JSON.parse(element.getAttribute(`data-trix-${name}`))\n } catch (error) {\n return {}\n }\n}\n\nconst getImageDimensions = (element) => {\n const width = element.getAttribute(\"width\")\n const height = element.getAttribute(\"height\")\n const dimensions = {}\n if (width) {\n dimensions.width = parseInt(width, 10)\n }\n if (height) {\n dimensions.height = parseInt(height, 10)\n }\n return dimensions\n}\n\nexport default class HTMLParser extends BasicObject {\n static parse(html, options) {\n const parser = new this(html, options)\n parser.parse()\n return parser\n }\n\n constructor(html, { referenceElement } = {}) {\n super(...arguments)\n this.html = html\n this.referenceElement = referenceElement\n this.blocks = []\n this.blockElements = []\n this.processedElements = []\n }\n\n getDocument() {\n return Document.fromJSON(this.blocks)\n }\n\n // HTML parsing\n\n parse() {\n try {\n this.createHiddenContainer()\n HTMLSanitizer.setHTML(this.containerElement, this.html)\n const walker = walkTree(this.containerElement, { usingFilter: nodeFilter })\n while (walker.nextNode()) {\n this.processNode(walker.currentNode)\n }\n return this.translateBlockElementMarginsToNewlines()\n } finally {\n this.removeHiddenContainer()\n }\n }\n\n createHiddenContainer() {\n if (this.referenceElement) {\n this.containerElement = this.referenceElement.cloneNode(false)\n this.containerElement.removeAttribute(\"id\")\n this.containerElement.setAttribute(\"data-trix-internal\", \"\")\n this.containerElement.style.display = \"none\"\n return this.referenceElement.parentNode.insertBefore(this.containerElement, this.referenceElement.nextSibling)\n } else {\n this.containerElement = makeElement({ tagName: \"div\", style: { display: \"none\" } })\n return document.body.appendChild(this.containerElement)\n }\n }\n\n removeHiddenContainer() {\n return removeNode(this.containerElement)\n }\n\n processNode(node) {\n switch (node.nodeType) {\n case Node.TEXT_NODE:\n if (!this.isInsignificantTextNode(node)) {\n this.appendBlockForTextNode(node)\n return this.processTextNode(node)\n }\n break\n case Node.ELEMENT_NODE:\n this.appendBlockForElement(node)\n return this.processElement(node)\n }\n }\n\n appendBlockForTextNode(node) {\n const element = node.parentNode\n if (element === this.currentBlockElement && this.isBlockElement(node.previousSibling)) {\n return this.appendStringWithAttributes(\"\\n\")\n } else if (element === this.containerElement || this.isBlockElement(element)) {\n const attributes = this.getBlockAttributes(element)\n const htmlAttributes = this.getBlockHTMLAttributes(element)\n if (!arraysAreEqual(attributes, this.currentBlock?.attributes)) {\n this.currentBlock = this.appendBlockForAttributesWithElement(attributes, element, htmlAttributes)\n this.currentBlockElement = element\n }\n }\n }\n\n appendBlockForElement(element) {\n const elementIsBlockElement = this.isBlockElement(element)\n const currentBlockContainsElement = elementContainsNode(this.currentBlockElement, element)\n\n if (elementIsBlockElement && !this.isBlockElement(element.firstChild)) {\n if (!this.isInsignificantTextNode(element.firstChild) || !this.isBlockElement(element.firstElementChild)) {\n const attributes = this.getBlockAttributes(element)\n const htmlAttributes = this.getBlockHTMLAttributes(element)\n if (element.firstChild) {\n if (!(currentBlockContainsElement && arraysAreEqual(attributes, this.currentBlock.attributes))) {\n this.currentBlock = this.appendBlockForAttributesWithElement(attributes, element, htmlAttributes)\n this.currentBlockElement = element\n } else {\n return this.appendStringWithAttributes(\"\\n\")\n }\n }\n }\n } else if (this.currentBlockElement && !currentBlockContainsElement && !elementIsBlockElement) {\n const parentBlockElement = this.findParentBlockElement(element)\n if (parentBlockElement) {\n return this.appendBlockForElement(parentBlockElement)\n } else {\n this.currentBlock = this.appendEmptyBlock()\n this.currentBlockElement = null\n }\n }\n }\n\n findParentBlockElement(element) {\n let { parentElement } = element\n while (parentElement && parentElement !== this.containerElement) {\n if (this.isBlockElement(parentElement) && this.blockElements.includes(parentElement)) {\n return parentElement\n } else {\n parentElement = parentElement.parentElement\n }\n }\n return null\n }\n\n processTextNode(node) {\n let string = node.data\n if (!elementCanDisplayPreformattedText(node.parentNode)) {\n string = squishBreakableWhitespace(string)\n if (stringEndsWithWhitespace(node.previousSibling?.textContent)) {\n string = leftTrimBreakableWhitespace(string)\n }\n }\n return this.appendStringWithAttributes(string, this.getTextAttributes(node.parentNode))\n }\n\n processElement(element) {\n let attributes\n if (nodeIsAttachmentElement(element)) {\n attributes = parseTrixDataAttribute(element, \"attachment\")\n if (Object.keys(attributes).length) {\n const textAttributes = this.getTextAttributes(element)\n this.appendAttachmentWithAttributes(attributes, textAttributes)\n // We have everything we need so avoid processing inner nodes\n element.innerHTML = \"\"\n }\n return this.processedElements.push(element)\n } else {\n switch (tagName(element)) {\n case \"br\":\n if (!this.isExtraBR(element) && !this.isBlockElement(element.nextSibling)) {\n this.appendStringWithAttributes(\"\\n\", this.getTextAttributes(element))\n }\n return this.processedElements.push(element)\n case \"img\":\n attributes = { url: element.getAttribute(\"src\"), contentType: \"image\" }\n const object = getImageDimensions(element)\n for (const key in object) {\n const value = object[key]\n attributes[key] = value\n }\n this.appendAttachmentWithAttributes(attributes, this.getTextAttributes(element))\n return this.processedElements.push(element)\n case \"tr\":\n if (this.needsTableSeparator(element)) {\n return this.appendStringWithAttributes(config.parser.tableRowSeparator)\n }\n break\n case \"td\":\n if (this.needsTableSeparator(element)) {\n return this.appendStringWithAttributes(config.parser.tableCellSeparator)\n }\n break\n }\n }\n }\n\n // Document construction\n\n appendBlockForAttributesWithElement(attributes, element, htmlAttributes = {}) {\n this.blockElements.push(element)\n const block = blockForAttributes(attributes, htmlAttributes)\n this.blocks.push(block)\n return block\n }\n\n appendEmptyBlock() {\n return this.appendBlockForAttributesWithElement([], null)\n }\n\n appendStringWithAttributes(string, attributes) {\n return this.appendPiece(pieceForString(string, attributes))\n }\n\n appendAttachmentWithAttributes(attachment, attributes) {\n return this.appendPiece(pieceForAttachment(attachment, attributes))\n }\n\n appendPiece(piece) {\n if (this.blocks.length === 0) {\n this.appendEmptyBlock()\n }\n return this.blocks[this.blocks.length - 1].text.push(piece)\n }\n\n appendStringToTextAtIndex(string, index) {\n const { text } = this.blocks[index]\n const piece = text[text.length - 1]\n\n if (piece?.type === \"string\") {\n piece.string += string\n } else {\n return text.push(pieceForString(string))\n }\n }\n\n prependStringToTextAtIndex(string, index) {\n const { text } = this.blocks[index]\n const piece = text[0]\n\n if (piece?.type === \"string\") {\n piece.string = string + piece.string\n } else {\n return text.unshift(pieceForString(string))\n }\n }\n\n // Attribute parsing\n\n getTextAttributes(element) {\n let value\n const attributes = {}\n for (const attribute in config.textAttributes) {\n const configAttr = config.textAttributes[attribute]\n if (\n configAttr.tagName &&\n findClosestElementFromNode(element, {\n matchingSelector: configAttr.tagName,\n untilNode: this.containerElement,\n })\n ) {\n attributes[attribute] = true\n } else if (configAttr.parser) {\n value = configAttr.parser(element)\n if (value) {\n let attributeInheritedFromBlock = false\n for (const blockElement of this.findBlockElementAncestors(element)) {\n if (configAttr.parser(blockElement) === value) {\n attributeInheritedFromBlock = true\n break\n }\n }\n if (!attributeInheritedFromBlock) {\n attributes[attribute] = value\n }\n }\n } else if (configAttr.styleProperty) {\n value = element.style[configAttr.styleProperty]\n if (value) {\n attributes[attribute] = value\n }\n }\n }\n\n if (nodeIsAttachmentElement(element)) {\n const object = parseTrixDataAttribute(element, \"attributes\")\n for (const key in object) {\n value = object[key]\n attributes[key] = value\n }\n }\n\n return attributes\n }\n\n getBlockAttributes(element) {\n const attributes = []\n while (element && element !== this.containerElement) {\n for (const attribute in config.blockAttributes) {\n const attrConfig = config.blockAttributes[attribute]\n if (attrConfig.parse !== false) {\n if (tagName(element) === attrConfig.tagName) {\n if (attrConfig.test?.(element) || !attrConfig.test) {\n attributes.push(attribute)\n if (attrConfig.listAttribute) {\n attributes.push(attrConfig.listAttribute)\n }\n }\n }\n }\n }\n element = element.parentNode\n }\n return attributes.reverse()\n }\n\n getBlockHTMLAttributes(element) {\n const attributes = {}\n const blockConfig = Object.values(config.blockAttributes).find(settings => settings.tagName === tagName(element))\n const allowedAttributes = blockConfig?.htmlAttributes || []\n\n allowedAttributes.forEach((attribute) => {\n if (element.hasAttribute(attribute)) {\n attributes[attribute] = element.getAttribute(attribute)\n }\n })\n\n return attributes\n }\n\n findBlockElementAncestors(element) {\n const ancestors = []\n while (element && element !== this.containerElement) {\n const tag = tagName(element)\n if (getBlockTagNames().includes(tag)) {\n ancestors.push(element)\n }\n element = element.parentNode\n }\n return ancestors\n }\n\n // Element inspection\n\n isBlockElement(element) {\n if (element?.nodeType !== Node.ELEMENT_NODE) return\n if (nodeIsAttachmentElement(element)) return\n if (findClosestElementFromNode(element, { matchingSelector: \"td\", untilNode: this.containerElement })) return\n\n return getBlockTagNames().includes(tagName(element)) ||\n window.getComputedStyle(element).display === \"block\"\n }\n\n isInsignificantTextNode(node) {\n if (node?.nodeType !== Node.TEXT_NODE) return\n if (!stringIsAllBreakableWhitespace(node.data)) return\n const { parentNode, previousSibling, nextSibling } = node\n if (nodeEndsWithNonWhitespace(parentNode.previousSibling) && !this.isBlockElement(parentNode.previousSibling)) return\n if (elementCanDisplayPreformattedText(parentNode)) return\n return !previousSibling || this.isBlockElement(previousSibling) || !nextSibling || this.isBlockElement(nextSibling)\n }\n\n isExtraBR(element) {\n return tagName(element) === \"br\" && this.isBlockElement(element.parentNode) && element.parentNode.lastChild === element\n }\n\n needsTableSeparator(element) {\n if (config.parser.removeBlankTableCells) {\n const content = element.previousSibling?.textContent\n return content && /\\S/.test(content)\n } else {\n return element.previousSibling\n }\n }\n\n // Margin translation\n\n translateBlockElementMarginsToNewlines() {\n const defaultMargin = this.getMarginOfDefaultBlockElement()\n\n for (let index = 0; index < this.blocks.length; index++) {\n const margin = this.getMarginOfBlockElementAtIndex(index)\n if (margin) {\n if (margin.top > defaultMargin.top * 2) {\n this.prependStringToTextAtIndex(\"\\n\", index)\n }\n\n if (margin.bottom > defaultMargin.bottom * 2) {\n this.appendStringToTextAtIndex(\"\\n\", index)\n }\n }\n }\n }\n\n getMarginOfBlockElementAtIndex(index) {\n const element = this.blockElements[index]\n if (element) {\n if (element.textContent) {\n if (!getBlockTagNames().includes(tagName(element)) && !this.processedElements.includes(element)) {\n return getBlockElementMargin(element)\n }\n }\n }\n }\n\n getMarginOfDefaultBlockElement() {\n const element = makeElement(config.blockAttributes.default.tagName)\n this.containerElement.appendChild(element)\n return getBlockElementMargin(element)\n }\n}\n\n// Helpers\n\nconst elementCanDisplayPreformattedText = function(element) {\n const { whiteSpace } = window.getComputedStyle(element)\n return [ \"pre\", \"pre-wrap\", \"pre-line\" ].includes(whiteSpace)\n}\n\nconst nodeEndsWithNonWhitespace = (node) => node && !stringEndsWithWhitespace(node.textContent)\n\nconst getBlockElementMargin = function(element) {\n const style = window.getComputedStyle(element)\n if (style.display === \"block\") {\n return { top: parseInt(style.marginTop), bottom: parseInt(style.marginBottom) }\n }\n}\n\nconst nodeFilter = function(node) {\n if (tagName(node) === \"style\") {\n return NodeFilter.FILTER_REJECT\n } else {\n return NodeFilter.FILTER_ACCEPT\n }\n}\n\n// Whitespace\n\nconst leftTrimBreakableWhitespace = (string) => string.replace(new RegExp(`^${breakableWhitespacePattern.source}+`), \"\")\n\nconst stringIsAllBreakableWhitespace = (string) => new RegExp(`^${breakableWhitespacePattern.source}*$`).test(string)\n\nconst stringEndsWithWhitespace = (string) => /\\s$/.test(string)\n", "/* eslint-disable\n no-empty,\n*/\nimport { removeNode } from \"trix/core/helpers\"\n\nimport DocumentView from \"trix/views/document_view\"\nimport Document from \"trix/models/document\"\nimport HTMLParser from \"trix/models/html_parser\"\n\nconst unserializableElementSelector = \"[data-trix-serialize=false]\"\nconst unserializableAttributeNames = [\n \"contenteditable\",\n \"data-trix-id\",\n \"data-trix-store-key\",\n \"data-trix-mutable\",\n \"data-trix-placeholder\",\n \"tabindex\",\n]\nconst serializedAttributesAttribute = \"data-trix-serialized-attributes\"\nconst serializedAttributesSelector = `[${serializedAttributesAttribute}]`\n\nconst blockCommentPattern = new RegExp(\"<!--block-->\", \"g\")\n\nconst serializers = {\n \"application/json\": function(serializable) {\n let document\n if (serializable instanceof Document) {\n document = serializable\n } else if (serializable instanceof HTMLElement) {\n document = HTMLParser.parse(serializable.innerHTML).getDocument()\n } else {\n throw new Error(\"unserializable object\")\n }\n\n return document.toSerializableDocument().toJSONString()\n },\n\n \"text/html\": function(serializable) {\n let element\n if (serializable instanceof Document) {\n element = DocumentView.render(serializable)\n } else if (serializable instanceof HTMLElement) {\n element = serializable.cloneNode(true)\n } else {\n throw new Error(\"unserializable object\")\n }\n\n // Remove unserializable elements\n Array.from(element.querySelectorAll(unserializableElementSelector)).forEach((el) => {\n removeNode(el)\n })\n\n // Remove unserializable attributes\n unserializableAttributeNames.forEach((attribute) => {\n Array.from(element.querySelectorAll(`[${attribute}]`)).forEach((el) => {\n el.removeAttribute(attribute)\n })\n })\n\n // Rewrite elements with serialized attribute overrides\n Array.from(element.querySelectorAll(serializedAttributesSelector)).forEach((el) => {\n try {\n const attributes = JSON.parse(el.getAttribute(serializedAttributesAttribute))\n el.removeAttribute(serializedAttributesAttribute)\n for (const name in attributes) {\n const value = attributes[name]\n el.setAttribute(name, value)\n }\n } catch (error) {}\n })\n\n return element.innerHTML.replace(blockCommentPattern, \"\")\n },\n}\n\nconst deserializers = {\n \"application/json\": function(string) {\n return Document.fromJSONString(string)\n },\n\n \"text/html\": function(string) {\n return HTMLParser.parse(string).getDocument()\n },\n}\n\nexport const serializeToContentType = function(serializable, contentType) {\n const serializer = serializers[contentType]\n if (serializer) {\n return serializer(serializable)\n } else {\n throw new Error(`unknown content type: ${contentType}`)\n }\n}\n\nexport const deserializeFromContentType = function(string, contentType) {\n const deserializer = deserializers[contentType]\n if (deserializer) {\n return deserializer(string)\n } else {\n throw new Error(`unknown content type: ${contentType}`)\n }\n}\n", "import \"trix/models/attachment\"\nimport BasicObject from \"trix/core/basic_object\"\n\nexport default class ManagedAttachment extends BasicObject {\n constructor(attachmentManager, attachment) {\n super(...arguments)\n this.attachmentManager = attachmentManager\n this.attachment = attachment\n this.id = this.attachment.id\n this.file = this.attachment.file\n }\n\n remove() {\n return this.attachmentManager.requestRemovalOfAttachment(this.attachment)\n }\n}\n\nManagedAttachment.proxyMethod(\"attachment.getAttribute\")\nManagedAttachment.proxyMethod(\"attachment.hasAttribute\")\nManagedAttachment.proxyMethod(\"attachment.setAttribute\")\nManagedAttachment.proxyMethod(\"attachment.getAttributes\")\nManagedAttachment.proxyMethod(\"attachment.setAttributes\")\nManagedAttachment.proxyMethod(\"attachment.isPending\")\nManagedAttachment.proxyMethod(\"attachment.isPreviewable\")\nManagedAttachment.proxyMethod(\"attachment.getURL\")\nManagedAttachment.proxyMethod(\"attachment.getHref\")\nManagedAttachment.proxyMethod(\"attachment.getFilename\")\nManagedAttachment.proxyMethod(\"attachment.getFilesize\")\nManagedAttachment.proxyMethod(\"attachment.getFormattedFilesize\")\nManagedAttachment.proxyMethod(\"attachment.getExtension\")\nManagedAttachment.proxyMethod(\"attachment.getContentType\")\nManagedAttachment.proxyMethod(\"attachment.getFile\")\nManagedAttachment.proxyMethod(\"attachment.setFile\")\nManagedAttachment.proxyMethod(\"attachment.releaseFile\")\nManagedAttachment.proxyMethod(\"attachment.getUploadProgress\")\nManagedAttachment.proxyMethod(\"attachment.setUploadProgress\")\n\n", "import ManagedAttachment from \"trix/models/managed_attachment\"\nimport BasicObject from \"trix/core/basic_object\"\n\nexport default class AttachmentManager extends BasicObject {\n constructor(attachments = []) {\n super(...arguments)\n this.managedAttachments = {}\n Array.from(attachments).forEach((attachment) => {\n this.manageAttachment(attachment)\n })\n }\n\n getAttachments() {\n const result = []\n for (const id in this.managedAttachments) {\n const attachment = this.managedAttachments[id]\n result.push(attachment)\n }\n return result\n }\n\n manageAttachment(attachment) {\n if (!this.managedAttachments[attachment.id]) {\n this.managedAttachments[attachment.id] = new ManagedAttachment(this, attachment)\n }\n return this.managedAttachments[attachment.id]\n }\n\n attachmentIsManaged(attachment) {\n return attachment.id in this.managedAttachments\n }\n\n requestRemovalOfAttachment(attachment) {\n if (this.attachmentIsManaged(attachment)) {\n return this.delegate?.attachmentManagerDidRequestRemovalOfAttachment?.(attachment)\n }\n }\n\n unmanageAttachment(attachment) {\n const managedAttachment = this.managedAttachments[attachment.id]\n delete this.managedAttachments[attachment.id]\n return managedAttachment\n }\n}\n", "export default class LineBreakInsertion {\n constructor(composition) {\n this.composition = composition\n this.document = this.composition.document\n const selectedRange = this.composition.getSelectedRange()\n this.startPosition = selectedRange[0]\n this.endPosition = selectedRange[1]\n\n this.startLocation = this.document.locationFromPosition(this.startPosition)\n this.endLocation = this.document.locationFromPosition(this.endPosition)\n\n this.block = this.document.getBlockAtIndex(this.endLocation.index)\n this.breaksOnReturn = this.block.breaksOnReturn()\n this.previousCharacter = this.block.text.getStringAtPosition(this.endLocation.offset - 1)\n this.nextCharacter = this.block.text.getStringAtPosition(this.endLocation.offset)\n }\n\n shouldInsertBlockBreak() {\n if (this.block.hasAttributes() && this.block.isListItem() && !this.block.isEmpty()) {\n return this.startLocation.offset !== 0\n } else {\n return this.breaksOnReturn && this.nextCharacter !== \"\\n\"\n }\n }\n\n shouldBreakFormattedBlock() {\n return (\n this.block.hasAttributes() &&\n !this.block.isListItem() &&\n (this.breaksOnReturn && this.nextCharacter === \"\\n\" || this.previousCharacter === \"\\n\")\n )\n }\n\n shouldDecreaseListLevel() {\n return this.block.hasAttributes() && this.block.isListItem() && this.block.isEmpty()\n }\n\n shouldPrependListItem() {\n return this.block.isListItem() && this.startLocation.offset === 0 && !this.block.isEmpty()\n }\n\n shouldRemoveLastBlockAttribute() {\n return this.block.hasAttributes() && !this.block.isListItem() && this.block.isEmpty()\n }\n}\n", "import * as config from \"trix/config\"\nimport { OBJECT_REPLACEMENT_CHARACTER } from \"trix/constants\"\n\nimport BasicObject from \"trix/core/basic_object\"\nimport Text from \"trix/models/text\"\nimport Block from \"trix/models/block\"\nimport Attachment from \"trix/models/attachment\"\nimport Document from \"trix/models/document\"\nimport HTMLParser from \"trix/models/html_parser\"\nimport LineBreakInsertion from \"trix/models/line_break_insertion\"\n\nimport {\n arrayStartsWith,\n extend,\n getAllAttributeNames,\n getBlockConfig,\n getTextConfig,\n normalizeRange,\n objectsAreEqual,\n rangeIsCollapsed,\n rangesAreEqual,\n summarizeArrayChange,\n} from \"trix/core/helpers\"\n\nconst PLACEHOLDER = \" \"\n\nexport default class Composition extends BasicObject {\n constructor() {\n super(...arguments)\n this.document = new Document()\n this.attachments = []\n this.currentAttributes = {}\n this.revision = 0\n }\n\n setDocument(document) {\n if (!document.isEqualTo(this.document)) {\n this.document = document\n this.refreshAttachments()\n this.revision++\n return this.delegate?.compositionDidChangeDocument?.(document)\n }\n }\n\n // Snapshots\n\n getSnapshot() {\n return {\n document: this.document,\n selectedRange: this.getSelectedRange(),\n }\n }\n\n loadSnapshot({ document, selectedRange }) {\n this.delegate?.compositionWillLoadSnapshot?.()\n this.setDocument(document != null ? document : new Document())\n this.setSelection(selectedRange != null ? selectedRange : [ 0, 0 ])\n return this.delegate?.compositionDidLoadSnapshot?.()\n }\n\n // Responder protocol\n\n insertText(text, { updatePosition } = { updatePosition: true }) {\n const selectedRange = this.getSelectedRange()\n this.setDocument(this.document.insertTextAtRange(text, selectedRange))\n\n const startPosition = selectedRange[0]\n const endPosition = startPosition + text.getLength()\n\n if (updatePosition) {\n this.setSelection(endPosition)\n }\n return this.notifyDelegateOfInsertionAtRange([ startPosition, endPosition ])\n }\n\n insertBlock(block = new Block()) {\n const document = new Document([ block ])\n return this.insertDocument(document)\n }\n\n insertDocument(document = new Document()) {\n const selectedRange = this.getSelectedRange()\n this.setDocument(this.document.insertDocumentAtRange(document, selectedRange))\n\n const startPosition = selectedRange[0]\n const endPosition = startPosition + document.getLength()\n\n this.setSelection(endPosition)\n return this.notifyDelegateOfInsertionAtRange([ startPosition, endPosition ])\n }\n\n insertString(string, options) {\n const attributes = this.getCurrentTextAttributes()\n const text = Text.textForStringWithAttributes(string, attributes)\n return this.insertText(text, options)\n }\n\n insertBlockBreak() {\n const selectedRange = this.getSelectedRange()\n this.setDocument(this.document.insertBlockBreakAtRange(selectedRange))\n\n const startPosition = selectedRange[0]\n const endPosition = startPosition + 1\n\n this.setSelection(endPosition)\n return this.notifyDelegateOfInsertionAtRange([ startPosition, endPosition ])\n }\n\n insertLineBreak() {\n const insertion = new LineBreakInsertion(this)\n\n if (insertion.shouldDecreaseListLevel()) {\n this.decreaseListLevel()\n return this.setSelection(insertion.startPosition)\n } else if (insertion.shouldPrependListItem()) {\n const document = new Document([ insertion.block.copyWithoutText() ])\n return this.insertDocument(document)\n } else if (insertion.shouldInsertBlockBreak()) {\n return this.insertBlockBreak()\n } else if (insertion.shouldRemoveLastBlockAttribute()) {\n return this.removeLastBlockAttribute()\n } else if (insertion.shouldBreakFormattedBlock()) {\n return this.breakFormattedBlock(insertion)\n } else {\n return this.insertString(\"\\n\")\n }\n }\n\n insertHTML(html) {\n const document = HTMLParser.parse(html).getDocument()\n const selectedRange = this.getSelectedRange()\n\n this.setDocument(this.document.mergeDocumentAtRange(document, selectedRange))\n\n const startPosition = selectedRange[0]\n const endPosition = startPosition + document.getLength() - 1\n\n this.setSelection(endPosition)\n return this.notifyDelegateOfInsertionAtRange([ startPosition, endPosition ])\n }\n\n replaceHTML(html) {\n const document = HTMLParser.parse(html).getDocument().copyUsingObjectsFromDocument(this.document)\n const locationRange = this.getLocationRange({ strict: false })\n const selectedRange = this.document.rangeFromLocationRange(locationRange)\n this.setDocument(document)\n return this.setSelection(selectedRange)\n }\n\n insertFile(file) {\n return this.insertFiles([ file ])\n }\n\n insertFiles(files) {\n const attachments = []\n\n Array.from(files).forEach((file) => {\n if (this.delegate?.compositionShouldAcceptFile(file)) {\n const attachment = Attachment.attachmentForFile(file)\n attachments.push(attachment)\n }\n })\n\n return this.insertAttachments(attachments)\n }\n\n insertAttachment(attachment) {\n return this.insertAttachments([ attachment ])\n }\n\n insertAttachments(attachments) {\n let text = new Text()\n\n Array.from(attachments).forEach((attachment) => {\n const type = attachment.getType()\n const presentation = config.attachments[type]?.presentation\n\n const attributes = this.getCurrentTextAttributes()\n if (presentation) {\n attributes.presentation = presentation\n }\n\n const attachmentText = Text.textForAttachmentWithAttributes(attachment, attributes)\n text = text.appendText(attachmentText)\n })\n\n return this.insertText(text)\n }\n\n shouldManageDeletingInDirection(direction) {\n const locationRange = this.getLocationRange()\n if (rangeIsCollapsed(locationRange)) {\n if (direction === \"backward\" && locationRange[0].offset === 0) {\n return true\n }\n if (this.shouldManageMovingCursorInDirection(direction)) {\n return true\n }\n } else {\n if (locationRange[0].index !== locationRange[1].index) {\n return true\n }\n }\n return false\n }\n\n deleteInDirection(direction, { length } = {}) {\n let attachment, deletingIntoPreviousBlock, selectionSpansBlocks\n const locationRange = this.getLocationRange()\n let range = this.getSelectedRange()\n const selectionIsCollapsed = rangeIsCollapsed(range)\n\n if (selectionIsCollapsed) {\n deletingIntoPreviousBlock = direction === \"backward\" && locationRange[0].offset === 0\n } else {\n selectionSpansBlocks = locationRange[0].index !== locationRange[1].index\n }\n\n if (deletingIntoPreviousBlock) {\n if (this.canDecreaseBlockAttributeLevel()) {\n const block = this.getBlock()\n\n if (block.isListItem()) {\n this.decreaseListLevel()\n } else {\n this.decreaseBlockAttributeLevel()\n }\n\n this.setSelection(range[0])\n if (block.isEmpty()) {\n return false\n }\n }\n }\n\n if (selectionIsCollapsed) {\n range = this.getExpandedRangeInDirection(direction, { length })\n if (direction === \"backward\") {\n attachment = this.getAttachmentAtRange(range)\n }\n }\n\n if (attachment) {\n this.editAttachment(attachment)\n return false\n } else {\n this.setDocument(this.document.removeTextAtRange(range))\n this.setSelection(range[0])\n if (deletingIntoPreviousBlock || selectionSpansBlocks) {\n return false\n }\n }\n }\n\n moveTextFromRange(range) {\n const [ position ] = Array.from(this.getSelectedRange())\n this.setDocument(this.document.moveTextFromRangeToPosition(range, position))\n return this.setSelection(position)\n }\n\n removeAttachment(attachment) {\n const range = this.document.getRangeOfAttachment(attachment)\n if (range) {\n this.stopEditingAttachment()\n this.setDocument(this.document.removeTextAtRange(range))\n return this.setSelection(range[0])\n }\n }\n\n removeLastBlockAttribute() {\n const [ startPosition, endPosition ] = Array.from(this.getSelectedRange())\n const block = this.document.getBlockAtPosition(endPosition)\n this.removeCurrentAttribute(block.getLastAttribute())\n return this.setSelection(startPosition)\n }\n\n insertPlaceholder() {\n this.placeholderPosition = this.getPosition()\n return this.insertString(PLACEHOLDER)\n }\n\n selectPlaceholder() {\n if (this.placeholderPosition != null) {\n this.setSelectedRange([ this.placeholderPosition, this.placeholderPosition + PLACEHOLDER.length ])\n return this.getSelectedRange()\n }\n }\n\n forgetPlaceholder() {\n this.placeholderPosition = null\n }\n\n // Current attributes\n\n hasCurrentAttribute(attributeName) {\n const value = this.currentAttributes[attributeName]\n return value != null && value !== false\n }\n\n toggleCurrentAttribute(attributeName) {\n const value = !this.currentAttributes[attributeName]\n if (value) {\n return this.setCurrentAttribute(attributeName, value)\n } else {\n return this.removeCurrentAttribute(attributeName)\n }\n }\n\n canSetCurrentAttribute(attributeName) {\n if (getBlockConfig(attributeName)) {\n return this.canSetCurrentBlockAttribute(attributeName)\n } else {\n return this.canSetCurrentTextAttribute(attributeName)\n }\n }\n\n canSetCurrentTextAttribute(attributeName) {\n const document = this.getSelectedDocument()\n if (!document) return\n for (const attachment of Array.from(document.getAttachments())) {\n if (!attachment.hasContent()) {\n return false\n }\n }\n return true\n }\n\n canSetCurrentBlockAttribute(attributeName) {\n const block = this.getBlock()\n if (!block) return\n return !block.isTerminalBlock()\n }\n\n setCurrentAttribute(attributeName, value) {\n if (getBlockConfig(attributeName)) {\n return this.setBlockAttribute(attributeName, value)\n } else {\n this.setTextAttribute(attributeName, value)\n this.currentAttributes[attributeName] = value\n return this.notifyDelegateOfCurrentAttributesChange()\n }\n }\n\n setHTMLAtributeAtPosition(position, attributeName, value) {\n const block = this.document.getBlockAtPosition(position)\n const allowedHTMLAttributes = getBlockConfig(block.getLastAttribute())?.htmlAttributes\n\n if (block && allowedHTMLAttributes?.includes(attributeName)) {\n const newDocument = this.document.setHTMLAttributeAtPosition(position, attributeName, value)\n this.setDocument(newDocument)\n }\n }\n\n setTextAttribute(attributeName, value) {\n const selectedRange = this.getSelectedRange()\n if (!selectedRange) return\n\n const [ startPosition, endPosition ] = Array.from(selectedRange)\n if (startPosition === endPosition) {\n if (attributeName === \"href\") {\n const text = Text.textForStringWithAttributes(value, { href: value })\n return this.insertText(text)\n }\n } else {\n return this.setDocument(this.document.addAttributeAtRange(attributeName, value, selectedRange))\n }\n }\n\n setBlockAttribute(attributeName, value) {\n const selectedRange = this.getSelectedRange()\n if (this.canSetCurrentAttribute(attributeName)) {\n this.setDocument(this.document.applyBlockAttributeAtRange(attributeName, value, selectedRange))\n return this.setSelection(selectedRange)\n }\n }\n\n removeCurrentAttribute(attributeName) {\n if (getBlockConfig(attributeName)) {\n this.removeBlockAttribute(attributeName)\n return this.updateCurrentAttributes()\n } else {\n this.removeTextAttribute(attributeName)\n delete this.currentAttributes[attributeName]\n return this.notifyDelegateOfCurrentAttributesChange()\n }\n }\n\n removeTextAttribute(attributeName) {\n const selectedRange = this.getSelectedRange()\n if (!selectedRange) return\n return this.setDocument(this.document.removeAttributeAtRange(attributeName, selectedRange))\n }\n\n removeBlockAttribute(attributeName) {\n const selectedRange = this.getSelectedRange()\n if (!selectedRange) return\n return this.setDocument(this.document.removeAttributeAtRange(attributeName, selectedRange))\n }\n\n canDecreaseNestingLevel() {\n return this.getBlock()?.getNestingLevel() > 0\n }\n\n canIncreaseNestingLevel() {\n const block = this.getBlock()\n if (!block) return\n if (getBlockConfig(block.getLastNestableAttribute())?.listAttribute) {\n const previousBlock = this.getPreviousBlock()\n if (previousBlock) {\n return arrayStartsWith(previousBlock.getListItemAttributes(), block.getListItemAttributes())\n }\n } else {\n return block.getNestingLevel() > 0\n }\n }\n\n decreaseNestingLevel() {\n const block = this.getBlock()\n if (!block) return\n return this.setDocument(this.document.replaceBlock(block, block.decreaseNestingLevel()))\n }\n\n increaseNestingLevel() {\n const block = this.getBlock()\n if (!block) return\n return this.setDocument(this.document.replaceBlock(block, block.increaseNestingLevel()))\n }\n\n canDecreaseBlockAttributeLevel() {\n return this.getBlock()?.getAttributeLevel() > 0\n }\n\n decreaseBlockAttributeLevel() {\n const attribute = this.getBlock()?.getLastAttribute()\n if (attribute) {\n return this.removeCurrentAttribute(attribute)\n }\n }\n\n decreaseListLevel() {\n let [ startPosition ] = Array.from(this.getSelectedRange())\n const { index } = this.document.locationFromPosition(startPosition)\n let endIndex = index\n const attributeLevel = this.getBlock().getAttributeLevel()\n\n let block = this.document.getBlockAtIndex(endIndex + 1)\n while (block) {\n if (!block.isListItem() || block.getAttributeLevel() <= attributeLevel) {\n break\n }\n endIndex++\n block = this.document.getBlockAtIndex(endIndex + 1)\n }\n\n startPosition = this.document.positionFromLocation({ index, offset: 0 })\n const endPosition = this.document.positionFromLocation({ index: endIndex, offset: 0 })\n return this.setDocument(this.document.removeLastListAttributeAtRange([ startPosition, endPosition ]))\n }\n\n updateCurrentAttributes() {\n const selectedRange = this.getSelectedRange({ ignoreLock: true })\n if (selectedRange) {\n const currentAttributes = this.document.getCommonAttributesAtRange(selectedRange)\n\n Array.from(getAllAttributeNames()).forEach((attributeName) => {\n if (!currentAttributes[attributeName]) {\n if (!this.canSetCurrentAttribute(attributeName)) {\n currentAttributes[attributeName] = false\n }\n }\n })\n\n if (!objectsAreEqual(currentAttributes, this.currentAttributes)) {\n this.currentAttributes = currentAttributes\n return this.notifyDelegateOfCurrentAttributesChange()\n }\n }\n }\n\n getCurrentAttributes() {\n return extend.call({}, this.currentAttributes)\n }\n\n getCurrentTextAttributes() {\n const attributes = {}\n for (const key in this.currentAttributes) {\n const value = this.currentAttributes[key]\n if (value !== false) {\n if (getTextConfig(key)) {\n attributes[key] = value\n }\n }\n }\n return attributes\n }\n\n // Selection freezing\n\n freezeSelection() {\n return this.setCurrentAttribute(\"frozen\", true)\n }\n\n thawSelection() {\n return this.removeCurrentAttribute(\"frozen\")\n }\n\n hasFrozenSelection() {\n return this.hasCurrentAttribute(\"frozen\")\n }\n\n setSelection(selectedRange) {\n const locationRange = this.document.locationRangeFromRange(selectedRange)\n return this.delegate?.compositionDidRequestChangingSelectionToLocationRange(locationRange)\n }\n\n getSelectedRange() {\n const locationRange = this.getLocationRange()\n if (locationRange) {\n return this.document.rangeFromLocationRange(locationRange)\n }\n }\n\n setSelectedRange(selectedRange) {\n const locationRange = this.document.locationRangeFromRange(selectedRange)\n return this.getSelectionManager().setLocationRange(locationRange)\n }\n\n getPosition() {\n const locationRange = this.getLocationRange()\n if (locationRange) {\n return this.document.positionFromLocation(locationRange[0])\n }\n }\n\n getLocationRange(options) {\n if (this.targetLocationRange) {\n return this.targetLocationRange\n } else {\n return this.getSelectionManager().getLocationRange(options) || normalizeRange({ index: 0, offset: 0 })\n }\n }\n\n withTargetLocationRange(locationRange, fn) {\n let result\n this.targetLocationRange = locationRange\n try {\n result = fn()\n } finally {\n this.targetLocationRange = null\n }\n return result\n }\n\n withTargetRange(range, fn) {\n const locationRange = this.document.locationRangeFromRange(range)\n return this.withTargetLocationRange(locationRange, fn)\n }\n\n withTargetDOMRange(domRange, fn) {\n const locationRange = this.createLocationRangeFromDOMRange(domRange, { strict: false })\n return this.withTargetLocationRange(locationRange, fn)\n }\n\n getExpandedRangeInDirection(direction, { length } = {}) {\n let [ startPosition, endPosition ] = Array.from(this.getSelectedRange())\n if (direction === \"backward\") {\n if (length) {\n startPosition -= length\n } else {\n startPosition = this.translateUTF16PositionFromOffset(startPosition, -1)\n }\n } else {\n if (length) {\n endPosition += length\n } else {\n endPosition = this.translateUTF16PositionFromOffset(endPosition, 1)\n }\n }\n return normalizeRange([ startPosition, endPosition ])\n }\n\n shouldManageMovingCursorInDirection(direction) {\n if (this.editingAttachment) {\n return true\n }\n const range = this.getExpandedRangeInDirection(direction)\n return this.getAttachmentAtRange(range) != null\n }\n\n moveCursorInDirection(direction) {\n let canEditAttachment, range\n if (this.editingAttachment) {\n range = this.document.getRangeOfAttachment(this.editingAttachment)\n } else {\n const selectedRange = this.getSelectedRange()\n range = this.getExpandedRangeInDirection(direction)\n canEditAttachment = !rangesAreEqual(selectedRange, range)\n }\n\n if (direction === \"backward\") {\n this.setSelectedRange(range[0])\n } else {\n this.setSelectedRange(range[1])\n }\n\n if (canEditAttachment) {\n const attachment = this.getAttachmentAtRange(range)\n if (attachment) {\n return this.editAttachment(attachment)\n }\n }\n }\n\n expandSelectionInDirection(direction, { length } = {}) {\n const range = this.getExpandedRangeInDirection(direction, { length })\n return this.setSelectedRange(range)\n }\n\n expandSelectionForEditing() {\n if (this.hasCurrentAttribute(\"href\")) {\n return this.expandSelectionAroundCommonAttribute(\"href\")\n }\n }\n\n expandSelectionAroundCommonAttribute(attributeName) {\n const position = this.getPosition()\n const range = this.document.getRangeOfCommonAttributeAtPosition(attributeName, position)\n return this.setSelectedRange(range)\n }\n\n selectionContainsAttachments() {\n return this.getSelectedAttachments()?.length > 0\n }\n\n selectionIsInCursorTarget() {\n return this.editingAttachment || this.positionIsCursorTarget(this.getPosition())\n }\n\n positionIsCursorTarget(position) {\n const location = this.document.locationFromPosition(position)\n if (location) {\n return this.locationIsCursorTarget(location)\n }\n }\n\n positionIsBlockBreak(position) {\n return this.document.getPieceAtPosition(position)?.isBlockBreak()\n }\n\n getSelectedDocument() {\n const selectedRange = this.getSelectedRange()\n if (selectedRange) {\n return this.document.getDocumentAtRange(selectedRange)\n }\n }\n\n getSelectedAttachments() {\n return this.getSelectedDocument()?.getAttachments()\n }\n\n // Attachments\n\n getAttachments() {\n return this.attachments.slice(0)\n }\n\n refreshAttachments() {\n const attachments = this.document.getAttachments()\n const { added, removed } = summarizeArrayChange(this.attachments, attachments)\n this.attachments = attachments\n\n Array.from(removed).forEach((attachment) => {\n attachment.delegate = null\n this.delegate?.compositionDidRemoveAttachment?.(attachment)\n })\n\n return (() => {\n const result = []\n\n Array.from(added).forEach((attachment) => {\n attachment.delegate = this\n result.push(this.delegate?.compositionDidAddAttachment?.(attachment))\n })\n\n return result\n })()\n }\n\n // Attachment delegate\n\n attachmentDidChangeAttributes(attachment) {\n this.revision++\n return this.delegate?.compositionDidEditAttachment?.(attachment)\n }\n\n attachmentDidChangePreviewURL(attachment) {\n this.revision++\n return this.delegate?.compositionDidChangeAttachmentPreviewURL?.(attachment)\n }\n\n // Attachment editing\n\n editAttachment(attachment, options) {\n if (attachment === this.editingAttachment) return\n this.stopEditingAttachment()\n this.editingAttachment = attachment\n return this.delegate?.compositionDidStartEditingAttachment?.(this.editingAttachment, options)\n }\n\n stopEditingAttachment() {\n if (!this.editingAttachment) return\n this.delegate?.compositionDidStopEditingAttachment?.(this.editingAttachment)\n this.editingAttachment = null\n }\n\n updateAttributesForAttachment(attributes, attachment) {\n return this.setDocument(this.document.updateAttributesForAttachment(attributes, attachment))\n }\n\n removeAttributeForAttachment(attribute, attachment) {\n return this.setDocument(this.document.removeAttributeForAttachment(attribute, attachment))\n }\n\n // Private\n\n breakFormattedBlock(insertion) {\n let { document } = insertion\n const { block } = insertion\n let position = insertion.startPosition\n let range = [ position - 1, position ]\n\n if (block.getBlockBreakPosition() === insertion.startLocation.offset) {\n if (block.breaksOnReturn() && insertion.nextCharacter === \"\\n\") {\n position += 1\n } else {\n document = document.removeTextAtRange(range)\n }\n range = [ position, position ]\n } else if (insertion.nextCharacter === \"\\n\") {\n if (insertion.previousCharacter === \"\\n\") {\n range = [ position - 1, position + 1 ]\n } else {\n range = [ position, position + 1 ]\n position += 1\n }\n } else if (insertion.startLocation.offset - 1 !== 0) {\n position += 1\n }\n\n const newDocument = new Document([ block.removeLastAttribute().copyWithoutText() ])\n this.setDocument(document.insertDocumentAtRange(newDocument, range))\n return this.setSelection(position)\n }\n\n getPreviousBlock() {\n const locationRange = this.getLocationRange()\n if (locationRange) {\n const { index } = locationRange[0]\n if (index > 0) {\n return this.document.getBlockAtIndex(index - 1)\n }\n }\n }\n\n getBlock() {\n const locationRange = this.getLocationRange()\n if (locationRange) {\n return this.document.getBlockAtIndex(locationRange[0].index)\n }\n }\n\n getAttachmentAtRange(range) {\n const document = this.document.getDocumentAtRange(range)\n if (document.toString() === `${OBJECT_REPLACEMENT_CHARACTER}\\n`) {\n return document.getAttachments()[0]\n }\n }\n\n notifyDelegateOfCurrentAttributesChange() {\n return this.delegate?.compositionDidChangeCurrentAttributes?.(this.currentAttributes)\n }\n\n notifyDelegateOfInsertionAtRange(range) {\n return this.delegate?.compositionDidPerformInsertionAtRange?.(range)\n }\n\n translateUTF16PositionFromOffset(position, offset) {\n const utf16string = this.document.toUTF16String()\n const utf16position = utf16string.offsetFromUCS2Offset(position)\n return utf16string.offsetToUCS2Offset(utf16position + offset)\n }\n}\n\nComposition.proxyMethod(\"getSelectionManager().getPointRange\")\nComposition.proxyMethod(\"getSelectionManager().setLocationRangeFromPointRange\")\nComposition.proxyMethod(\"getSelectionManager().createLocationRangeFromDOMRange\")\nComposition.proxyMethod(\"getSelectionManager().locationIsCursorTarget\")\nComposition.proxyMethod(\"getSelectionManager().selectionIsExpanded\")\nComposition.proxyMethod(\"delegate?.getSelectionManager\")\n", "import BasicObject from \"trix/core/basic_object\"\n\nexport default class UndoManager extends BasicObject {\n constructor(composition) {\n super(...arguments)\n this.composition = composition\n this.undoEntries = []\n this.redoEntries = []\n }\n\n recordUndoEntry(description, { context, consolidatable } = {}) {\n const previousEntry = this.undoEntries.slice(-1)[0]\n\n if (!consolidatable || !entryHasDescriptionAndContext(previousEntry, description, context)) {\n const undoEntry = this.createEntry({ description, context })\n this.undoEntries.push(undoEntry)\n this.redoEntries = []\n }\n }\n\n undo() {\n const undoEntry = this.undoEntries.pop()\n if (undoEntry) {\n const redoEntry = this.createEntry(undoEntry)\n this.redoEntries.push(redoEntry)\n return this.composition.loadSnapshot(undoEntry.snapshot)\n }\n }\n\n redo() {\n const redoEntry = this.redoEntries.pop()\n if (redoEntry) {\n const undoEntry = this.createEntry(redoEntry)\n this.undoEntries.push(undoEntry)\n return this.composition.loadSnapshot(redoEntry.snapshot)\n }\n }\n\n canUndo() {\n return this.undoEntries.length > 0\n }\n\n canRedo() {\n return this.redoEntries.length > 0\n }\n\n // Private\n\n createEntry({ description, context } = {}) {\n return {\n description: description?.toString(),\n context: JSON.stringify(context),\n snapshot: this.composition.getSnapshot(),\n }\n }\n}\n\nconst entryHasDescriptionAndContext = (entry, description, context) =>\n entry?.description === description?.toString() && entry?.context === JSON.stringify(context)\n", "const BLOCK_ATTRIBUTE_NAME = \"attachmentGallery\"\nconst TEXT_ATTRIBUTE_NAME = \"presentation\"\nconst TEXT_ATTRIBUTE_VALUE = \"gallery\"\n\nexport default class Filter {\n constructor(snapshot) {\n this.document = snapshot.document\n this.selectedRange = snapshot.selectedRange\n }\n\n perform() {\n this.removeBlockAttribute()\n return this.applyBlockAttribute()\n }\n\n getSnapshot() {\n return { document: this.document, selectedRange: this.selectedRange }\n }\n\n // Private\n\n removeBlockAttribute() {\n return this.findRangesOfBlocks().map((range) => this.document = this.document.removeAttributeAtRange(BLOCK_ATTRIBUTE_NAME, range))\n }\n\n applyBlockAttribute() {\n let offset = 0\n\n this.findRangesOfPieces().forEach((range) => {\n if (range[1] - range[0] > 1) {\n range[0] += offset\n range[1] += offset\n\n if (this.document.getCharacterAtPosition(range[1]) !== \"\\n\") {\n this.document = this.document.insertBlockBreakAtRange(range[1])\n if (range[1] < this.selectedRange[1]) {\n this.moveSelectedRangeForward()\n }\n range[1]++\n offset++\n }\n\n if (range[0] !== 0) {\n if (this.document.getCharacterAtPosition(range[0] - 1) !== \"\\n\") {\n this.document = this.document.insertBlockBreakAtRange(range[0])\n if (range[0] < this.selectedRange[0]) {\n this.moveSelectedRangeForward()\n }\n range[0]++\n offset++\n }\n }\n\n this.document = this.document.applyBlockAttributeAtRange(BLOCK_ATTRIBUTE_NAME, true, range)\n }\n })\n }\n\n findRangesOfBlocks() {\n return this.document.findRangesForBlockAttribute(BLOCK_ATTRIBUTE_NAME)\n }\n\n findRangesOfPieces() {\n return this.document.findRangesForTextAttribute(TEXT_ATTRIBUTE_NAME, { withValue: TEXT_ATTRIBUTE_VALUE })\n }\n\n moveSelectedRangeForward() {\n this.selectedRange[0] += 1\n this.selectedRange[1] += 1\n }\n}\n", "import Filter from \"./filter\"\n\nexport const attachmentGalleryFilter = function(snapshot) {\n const filter = new Filter(snapshot)\n filter.perform()\n return filter.getSnapshot()\n}\n\n", "import Document from \"trix/models/document\"\nimport HTMLParser from \"trix/models/html_parser\"\n\nimport UndoManager from \"trix/models/undo_manager\"\nimport { attachmentGalleryFilter } from \"trix/filters/attachment_gallery_filter\"\nconst DEFAULT_FILTERS = [ attachmentGalleryFilter ]\n\nexport default class Editor {\n constructor(composition, selectionManager, element) {\n this.insertFiles = this.insertFiles.bind(this)\n this.composition = composition\n this.selectionManager = selectionManager\n this.element = element\n this.undoManager = new UndoManager(this.composition)\n this.filters = DEFAULT_FILTERS.slice(0)\n }\n\n loadDocument(document) {\n return this.loadSnapshot({ document, selectedRange: [ 0, 0 ] })\n }\n\n loadHTML(html = \"\") {\n const document = HTMLParser.parse(html, { referenceElement: this.element }).getDocument()\n return this.loadDocument(document)\n }\n\n loadJSON({ document, selectedRange }) {\n document = Document.fromJSON(document)\n return this.loadSnapshot({ document, selectedRange })\n }\n\n loadSnapshot(snapshot) {\n this.undoManager = new UndoManager(this.composition)\n return this.composition.loadSnapshot(snapshot)\n }\n\n getDocument() {\n return this.composition.document\n }\n\n getSelectedDocument() {\n return this.composition.getSelectedDocument()\n }\n\n getSnapshot() {\n return this.composition.getSnapshot()\n }\n\n toJSON() {\n return this.getSnapshot()\n }\n\n // Document manipulation\n\n deleteInDirection(direction) {\n return this.composition.deleteInDirection(direction)\n }\n\n insertAttachment(attachment) {\n return this.composition.insertAttachment(attachment)\n }\n\n insertAttachments(attachments) {\n return this.composition.insertAttachments(attachments)\n }\n\n insertDocument(document) {\n return this.composition.insertDocument(document)\n }\n\n insertFile(file) {\n return this.composition.insertFile(file)\n }\n\n insertFiles(files) {\n return this.composition.insertFiles(files)\n }\n\n insertHTML(html) {\n return this.composition.insertHTML(html)\n }\n\n insertString(string) {\n return this.composition.insertString(string)\n }\n\n insertText(text) {\n return this.composition.insertText(text)\n }\n\n insertLineBreak() {\n return this.composition.insertLineBreak()\n }\n\n // Selection\n\n getSelectedRange() {\n return this.composition.getSelectedRange()\n }\n\n getPosition() {\n return this.composition.getPosition()\n }\n\n getClientRectAtPosition(position) {\n const locationRange = this.getDocument().locationRangeFromRange([ position, position + 1 ])\n return this.selectionManager.getClientRectAtLocationRange(locationRange)\n }\n\n expandSelectionInDirection(direction) {\n return this.composition.expandSelectionInDirection(direction)\n }\n\n moveCursorInDirection(direction) {\n return this.composition.moveCursorInDirection(direction)\n }\n\n setSelectedRange(selectedRange) {\n return this.composition.setSelectedRange(selectedRange)\n }\n\n // Attributes\n\n activateAttribute(name, value = true) {\n return this.composition.setCurrentAttribute(name, value)\n }\n\n attributeIsActive(name) {\n return this.composition.hasCurrentAttribute(name)\n }\n\n canActivateAttribute(name) {\n return this.composition.canSetCurrentAttribute(name)\n }\n\n deactivateAttribute(name) {\n return this.composition.removeCurrentAttribute(name)\n }\n\n // HTML attributes\n setHTMLAtributeAtPosition(position, name, value) {\n this.composition.setHTMLAtributeAtPosition(position, name, value)\n }\n\n // Nesting level\n\n canDecreaseNestingLevel() {\n return this.composition.canDecreaseNestingLevel()\n }\n\n canIncreaseNestingLevel() {\n return this.composition.canIncreaseNestingLevel()\n }\n\n decreaseNestingLevel() {\n if (this.canDecreaseNestingLevel()) {\n return this.composition.decreaseNestingLevel()\n }\n }\n\n increaseNestingLevel() {\n if (this.canIncreaseNestingLevel()) {\n return this.composition.increaseNestingLevel()\n }\n }\n\n // Undo/redo\n\n canRedo() {\n return this.undoManager.canRedo()\n }\n\n canUndo() {\n return this.undoManager.canUndo()\n }\n\n recordUndoEntry(description, { context, consolidatable } = {}) {\n return this.undoManager.recordUndoEntry(description, { context, consolidatable })\n }\n\n redo() {\n if (this.canRedo()) {\n return this.undoManager.redo()\n }\n }\n\n undo() {\n if (this.canUndo()) {\n return this.undoManager.undo()\n }\n }\n}\n", "/* eslint-disable\n no-var,\n prefer-const,\n*/\nimport {\n elementContainsNode,\n findChildIndexOfNode,\n nodeIsAttachmentElement,\n nodeIsBlockContainer,\n nodeIsBlockStart,\n nodeIsBlockStartComment,\n nodeIsCursorTarget,\n nodeIsEmptyTextNode,\n nodeIsTextNode,\n tagName,\n walkTree,\n} from \"trix/core/helpers\"\n\nexport default class LocationMapper {\n constructor(element) {\n this.element = element\n }\n\n findLocationFromContainerAndOffset(container, offset, { strict } = { strict: true }) {\n let childIndex = 0\n let foundBlock = false\n const location = { index: 0, offset: 0 }\n const attachmentElement = this.findAttachmentElementParentForNode(container)\n\n if (attachmentElement) {\n container = attachmentElement.parentNode\n offset = findChildIndexOfNode(attachmentElement)\n }\n\n const walker = walkTree(this.element, { usingFilter: rejectAttachmentContents })\n\n while (walker.nextNode()) {\n const node = walker.currentNode\n\n if (node === container && nodeIsTextNode(container)) {\n if (!nodeIsCursorTarget(node)) {\n location.offset += offset\n }\n break\n } else {\n if (node.parentNode === container) {\n if (childIndex++ === offset) {\n break\n }\n } else if (!elementContainsNode(container, node)) {\n if (childIndex > 0) {\n break\n }\n }\n\n if (nodeIsBlockStart(node, { strict })) {\n if (foundBlock) {\n location.index++\n }\n location.offset = 0\n foundBlock = true\n } else {\n location.offset += nodeLength(node)\n }\n }\n }\n\n return location\n }\n\n findContainerAndOffsetFromLocation(location) {\n let container, offset\n if (location.index === 0 && location.offset === 0) {\n container = this.element\n offset = 0\n\n while (container.firstChild) {\n container = container.firstChild\n if (nodeIsBlockContainer(container)) {\n offset = 1\n break\n }\n }\n\n return [ container, offset ]\n }\n\n let [ node, nodeOffset ] = this.findNodeAndOffsetFromLocation(location)\n if (!node) return\n\n if (nodeIsTextNode(node)) {\n if (nodeLength(node) === 0) {\n container = node.parentNode.parentNode\n offset = findChildIndexOfNode(node.parentNode)\n if (nodeIsCursorTarget(node, { name: \"right\" })) {\n offset++\n }\n } else {\n container = node\n offset = location.offset - nodeOffset\n }\n } else {\n container = node.parentNode\n\n if (!nodeIsBlockStart(node.previousSibling)) {\n if (!nodeIsBlockContainer(container)) {\n while (node === container.lastChild) {\n node = container\n container = container.parentNode\n if (nodeIsBlockContainer(container)) {\n break\n }\n }\n }\n }\n\n offset = findChildIndexOfNode(node)\n if (location.offset !== 0) {\n offset++\n }\n }\n\n return [ container, offset ]\n }\n\n findNodeAndOffsetFromLocation(location) {\n let node, nodeOffset\n let offset = 0\n\n for (const currentNode of this.getSignificantNodesForIndex(location.index)) {\n const length = nodeLength(currentNode)\n\n if (location.offset <= offset + length) {\n if (nodeIsTextNode(currentNode)) {\n node = currentNode\n nodeOffset = offset\n if (location.offset === nodeOffset && nodeIsCursorTarget(node)) {\n break\n }\n } else if (!node) {\n node = currentNode\n nodeOffset = offset\n }\n }\n\n offset += length\n if (offset > location.offset) {\n break\n }\n }\n\n return [ node, nodeOffset ]\n }\n\n // Private\n\n findAttachmentElementParentForNode(node) {\n while (node && node !== this.element) {\n if (nodeIsAttachmentElement(node)) {\n return node\n }\n node = node.parentNode\n }\n }\n\n getSignificantNodesForIndex(index) {\n const nodes = []\n const walker = walkTree(this.element, { usingFilter: acceptSignificantNodes })\n let recordingNodes = false\n\n while (walker.nextNode()) {\n const node = walker.currentNode\n if (nodeIsBlockStartComment(node)) {\n var blockIndex\n if (blockIndex != null) {\n blockIndex++\n } else {\n blockIndex = 0\n }\n\n if (blockIndex === index) {\n recordingNodes = true\n } else if (recordingNodes) {\n break\n }\n } else if (recordingNodes) {\n nodes.push(node)\n }\n }\n\n return nodes\n }\n}\n\nconst nodeLength = function(node) {\n if (node.nodeType === Node.TEXT_NODE) {\n if (nodeIsCursorTarget(node)) {\n return 0\n } else {\n const string = node.textContent\n return string.length\n }\n } else if (tagName(node) === \"br\" || nodeIsAttachmentElement(node)) {\n return 1\n } else {\n return 0\n }\n}\n\nconst acceptSignificantNodes = function(node) {\n if (rejectEmptyTextNodes(node) === NodeFilter.FILTER_ACCEPT) {\n return rejectAttachmentContents(node)\n } else {\n return NodeFilter.FILTER_REJECT\n }\n}\n\nconst rejectEmptyTextNodes = function(node) {\n if (nodeIsEmptyTextNode(node)) {\n return NodeFilter.FILTER_REJECT\n } else {\n return NodeFilter.FILTER_ACCEPT\n }\n}\n\nconst rejectAttachmentContents = function(node) {\n if (nodeIsAttachmentElement(node.parentNode)) {\n return NodeFilter.FILTER_REJECT\n } else {\n return NodeFilter.FILTER_ACCEPT\n }\n}\n", "/* eslint-disable\n id-length,\n no-empty,\n*/\nimport { getDOMRange, setDOMRange } from \"trix/core/helpers\"\n\nexport default class PointMapper {\n createDOMRangeFromPoint({ x, y }) {\n let domRange\n if (document.caretPositionFromPoint) {\n const { offsetNode, offset } = document.caretPositionFromPoint(x, y)\n domRange = document.createRange()\n domRange.setStart(offsetNode, offset)\n return domRange\n } else if (document.caretRangeFromPoint) {\n return document.caretRangeFromPoint(x, y)\n } else if (document.body.createTextRange) {\n const originalDOMRange = getDOMRange()\n try {\n // IE 11 throws \"Unspecified error\" when using moveToPoint\n // during a drag-and-drop operation.\n const textRange = document.body.createTextRange()\n textRange.moveToPoint(x, y)\n textRange.select()\n } catch (error) {}\n domRange = getDOMRange()\n setDOMRange(originalDOMRange)\n return domRange\n }\n }\n\n getClientRectsForDOMRange(domRange) {\n const array = Array.from(domRange.getClientRects())\n const start = array[0]\n const end = array[array.length - 1]\n\n return [ start, end ]\n }\n}\n", "/* eslint-disable\n*/\nimport BasicObject from \"trix/core/basic_object\"\n\nimport LocationMapper from \"trix/models/location_mapper\"\nimport PointMapper from \"trix/models/point_mapper\"\n\nimport {\n elementContainsNode,\n getDOMRange,\n getDOMSelection,\n handleEvent,\n innerElementIsActive,\n nodeIsCursorTarget,\n normalizeRange,\n rangeIsCollapsed,\n rangesAreEqual,\n setDOMRange,\n} from \"trix/core/helpers\"\n\nexport default class SelectionManager extends BasicObject {\n constructor(element) {\n super(...arguments)\n this.didMouseDown = this.didMouseDown.bind(this)\n this.selectionDidChange = this.selectionDidChange.bind(this)\n this.element = element\n this.locationMapper = new LocationMapper(this.element)\n this.pointMapper = new PointMapper()\n this.lockCount = 0\n handleEvent(\"mousedown\", { onElement: this.element, withCallback: this.didMouseDown })\n }\n\n getLocationRange(options = {}) {\n if (options.strict === false) {\n return this.createLocationRangeFromDOMRange(getDOMRange())\n } else if (options.ignoreLock) {\n return this.currentLocationRange\n } else if (this.lockedLocationRange) {\n return this.lockedLocationRange\n } else {\n return this.currentLocationRange\n }\n }\n\n setLocationRange(locationRange) {\n if (this.lockedLocationRange) return\n locationRange = normalizeRange(locationRange)\n\n const domRange = this.createDOMRangeFromLocationRange(locationRange)\n if (domRange) {\n setDOMRange(domRange)\n this.updateCurrentLocationRange(locationRange)\n }\n }\n\n setLocationRangeFromPointRange(pointRange) {\n pointRange = normalizeRange(pointRange)\n const startLocation = this.getLocationAtPoint(pointRange[0])\n const endLocation = this.getLocationAtPoint(pointRange[1])\n this.setLocationRange([ startLocation, endLocation ])\n }\n\n getClientRectAtLocationRange(locationRange) {\n const domRange = this.createDOMRangeFromLocationRange(locationRange)\n if (domRange) {\n return this.getClientRectsForDOMRange(domRange)[1]\n }\n }\n\n locationIsCursorTarget(location) {\n const node = Array.from(this.findNodeAndOffsetFromLocation(location))[0]\n return nodeIsCursorTarget(node)\n }\n\n lock() {\n if (this.lockCount++ === 0) {\n this.updateCurrentLocationRange()\n this.lockedLocationRange = this.getLocationRange()\n }\n }\n\n unlock() {\n if (--this.lockCount === 0) {\n const { lockedLocationRange } = this\n this.lockedLocationRange = null\n if (lockedLocationRange != null) {\n return this.setLocationRange(lockedLocationRange)\n }\n }\n }\n\n clearSelection() {\n return getDOMSelection()?.removeAllRanges()\n }\n\n selectionIsCollapsed() {\n return getDOMRange()?.collapsed === true\n }\n\n selectionIsExpanded() {\n return !this.selectionIsCollapsed()\n }\n\n createLocationRangeFromDOMRange(domRange, options) {\n if (domRange == null || !this.domRangeWithinElement(domRange)) return\n\n const start = this.findLocationFromContainerAndOffset(domRange.startContainer, domRange.startOffset, options)\n if (!start) return\n\n const end = domRange.collapsed\n ? undefined\n : this.findLocationFromContainerAndOffset(domRange.endContainer, domRange.endOffset, options)\n\n return normalizeRange([ start, end ])\n }\n\n didMouseDown() {\n return this.pauseTemporarily()\n }\n\n pauseTemporarily() {\n let resumeHandlers\n this.paused = true\n\n const resume = () => {\n this.paused = false\n clearTimeout(resumeTimeout)\n\n Array.from(resumeHandlers).forEach((handler) => {\n handler.destroy()\n })\n\n if (elementContainsNode(document, this.element)) {\n return this.selectionDidChange()\n }\n }\n\n const resumeTimeout = setTimeout(resume, 200)\n\n resumeHandlers = [ \"mousemove\", \"keydown\" ].map((eventName) =>\n handleEvent(eventName, { onElement: document, withCallback: resume })\n )\n }\n\n selectionDidChange() {\n if (!this.paused && !innerElementIsActive(this.element)) {\n return this.updateCurrentLocationRange()\n }\n }\n\n updateCurrentLocationRange(locationRange) {\n if (locationRange != null ? locationRange : locationRange = this.createLocationRangeFromDOMRange(getDOMRange())) {\n if (!rangesAreEqual(locationRange, this.currentLocationRange)) {\n this.currentLocationRange = locationRange\n return this.delegate?.locationRangeDidChange?.(this.currentLocationRange.slice(0))\n }\n }\n }\n\n createDOMRangeFromLocationRange(locationRange) {\n const rangeStart = this.findContainerAndOffsetFromLocation(locationRange[0])\n const rangeEnd = rangeIsCollapsed(locationRange)\n ? rangeStart\n : this.findContainerAndOffsetFromLocation(locationRange[1]) || rangeStart\n\n if (rangeStart != null && rangeEnd != null) {\n const domRange = document.createRange()\n domRange.setStart(...Array.from(rangeStart || []))\n domRange.setEnd(...Array.from(rangeEnd || []))\n return domRange\n }\n }\n\n getLocationAtPoint(point) {\n const domRange = this.createDOMRangeFromPoint(point)\n if (domRange) {\n return this.createLocationRangeFromDOMRange(domRange)?.[0]\n }\n }\n\n domRangeWithinElement(domRange) {\n if (domRange.collapsed) {\n return elementContainsNode(this.element, domRange.startContainer)\n } else {\n return (\n elementContainsNode(this.element, domRange.startContainer) &&\n elementContainsNode(this.element, domRange.endContainer)\n )\n }\n }\n}\n\nSelectionManager.proxyMethod(\"locationMapper.findLocationFromContainerAndOffset\")\nSelectionManager.proxyMethod(\"locationMapper.findContainerAndOffsetFromLocation\")\nSelectionManager.proxyMethod(\"locationMapper.findNodeAndOffsetFromLocation\")\nSelectionManager.proxyMethod(\"pointMapper.createDOMRangeFromPoint\")\nSelectionManager.proxyMethod(\"pointMapper.getClientRectsForDOMRange\")\n\n", "import { removeNode } from \"trix/core/helpers\"\n\nimport * as config from \"trix/config\"\nimport BasicObject from \"trix/core/basic_object\"\n\nimport { defer, handleEvent, makeElement, tagName, triggerEvent } from \"trix/core/helpers\"\nconst { lang, css, keyNames } = config\n\nconst undoable = function(fn) {\n return function() {\n const commands = fn.apply(this, arguments)\n commands.do()\n if (!this.undos) {\n this.undos = []\n }\n this.undos.push(commands.undo)\n }\n}\n\nexport default class AttachmentEditorController extends BasicObject {\n constructor(attachmentPiece, element, container, options = {}) {\n super(...arguments)\n this.didClickToolbar = this.didClickToolbar.bind(this)\n this.didClickActionButton = this.didClickActionButton.bind(this)\n this.didKeyDownCaption = this.didKeyDownCaption.bind(this)\n this.didInputCaption = this.didInputCaption.bind(this)\n this.didChangeCaption = this.didChangeCaption.bind(this)\n this.didBlurCaption = this.didBlurCaption.bind(this)\n this.attachmentPiece = attachmentPiece\n this.element = element\n this.container = container\n this.options = options\n this.attachment = this.attachmentPiece.attachment\n if (tagName(this.element) === \"a\") {\n this.element = this.element.firstChild\n }\n this.install()\n }\n\n install() {\n this.makeElementMutable()\n this.addToolbar()\n if (this.attachment.isPreviewable()) {\n this.installCaptionEditor()\n }\n }\n\n uninstall() {\n let undo = this.undos.pop()\n this.savePendingCaption()\n while (undo) {\n undo()\n undo = this.undos.pop()\n }\n this.delegate?.didUninstallAttachmentEditor(this)\n }\n\n // Private\n\n savePendingCaption() {\n if (this.pendingCaption != null) {\n const caption = this.pendingCaption\n this.pendingCaption = null\n if (caption) {\n this.delegate?.attachmentEditorDidRequestUpdatingAttributesForAttachment?.({ caption }, this.attachment)\n } else {\n this.delegate?.attachmentEditorDidRequestRemovingAttributeForAttachment?.(\"caption\", this.attachment)\n }\n }\n }\n\n // Installing and uninstalling\n\n makeElementMutable = undoable(() => {\n return {\n do: () => {\n this.element.dataset.trixMutable = true\n },\n undo: () => delete this.element.dataset.trixMutable,\n }\n })\n\n addToolbar = undoable(() => {\n // <div class=\"#{css.attachmentMetadataContainer}\" data-trix-mutable=\"true\">\n // <div class=\"trix-button-row\">\n // <span class=\"trix-button-group trix-button-group--actions\">\n // <button type=\"button\" class=\"trix-button trix-button--remove\" title=\"#{lang.remove}\" data-trix-action=\"remove\">#{lang.remove}</button>\n // </span>\n // </div>\n // </div>\n const element = makeElement({\n tagName: \"div\",\n className: css.attachmentToolbar,\n data: { trixMutable: true },\n childNodes: makeElement({\n tagName: \"div\",\n className: \"trix-button-row\",\n childNodes: makeElement({\n tagName: \"span\",\n className: \"trix-button-group trix-button-group--actions\",\n childNodes: makeElement({\n tagName: \"button\",\n className: \"trix-button trix-button--remove\",\n textContent: lang.remove,\n attributes: { title: lang.remove },\n data: { trixAction: \"remove\" },\n }),\n }),\n }),\n })\n\n if (this.attachment.isPreviewable()) {\n // <div class=\"#{css.attachmentMetadataContainer}\">\n // <span class=\"#{css.attachmentMetadata}\">\n // <span class=\"#{css.attachmentName}\" title=\"#{name}\">#{name}</span>\n // <span class=\"#{css.attachmentSize}\">#{size}</span>\n // </span>\n // </div>\n element.appendChild(\n makeElement({\n tagName: \"div\",\n className: css.attachmentMetadataContainer,\n childNodes: makeElement({\n tagName: \"span\",\n className: css.attachmentMetadata,\n childNodes: [\n makeElement({\n tagName: \"span\",\n className: css.attachmentName,\n textContent: this.attachment.getFilename(),\n attributes: { title: this.attachment.getFilename() },\n }),\n makeElement({\n tagName: \"span\",\n className: css.attachmentSize,\n textContent: this.attachment.getFormattedFilesize(),\n }),\n ],\n }),\n })\n )\n }\n\n handleEvent(\"click\", { onElement: element, withCallback: this.didClickToolbar })\n handleEvent(\"click\", {\n onElement: element,\n matchingSelector: \"[data-trix-action]\",\n withCallback: this.didClickActionButton,\n })\n\n triggerEvent(\"trix-attachment-before-toolbar\", { onElement: this.element, attributes: { toolbar: element, attachment: this.attachment } })\n\n return {\n do: () => this.element.appendChild(element),\n undo: () => removeNode(element),\n }\n })\n\n installCaptionEditor = undoable(() => {\n const textarea = makeElement({\n tagName: \"textarea\",\n className: css.attachmentCaptionEditor,\n attributes: { placeholder: lang.captionPlaceholder },\n data: { trixMutable: true },\n })\n textarea.value = this.attachmentPiece.getCaption()\n\n const textareaClone = textarea.cloneNode()\n textareaClone.classList.add(\"trix-autoresize-clone\")\n textareaClone.tabIndex = -1\n\n const autoresize = function() {\n textareaClone.value = textarea.value\n textarea.style.height = textareaClone.scrollHeight + \"px\"\n }\n\n handleEvent(\"input\", { onElement: textarea, withCallback: autoresize })\n handleEvent(\"input\", { onElement: textarea, withCallback: this.didInputCaption })\n handleEvent(\"keydown\", { onElement: textarea, withCallback: this.didKeyDownCaption })\n handleEvent(\"change\", { onElement: textarea, withCallback: this.didChangeCaption })\n handleEvent(\"blur\", { onElement: textarea, withCallback: this.didBlurCaption })\n\n const figcaption = this.element.querySelector(\"figcaption\")\n const editingFigcaption = figcaption.cloneNode()\n\n return {\n do: () => {\n figcaption.style.display = \"none\"\n editingFigcaption.appendChild(textarea)\n editingFigcaption.appendChild(textareaClone)\n editingFigcaption.classList.add(`${css.attachmentCaption}--editing`)\n figcaption.parentElement.insertBefore(editingFigcaption, figcaption)\n autoresize()\n if (this.options.editCaption) {\n return defer(() => textarea.focus())\n }\n },\n undo() {\n removeNode(editingFigcaption)\n figcaption.style.display = null\n },\n }\n })\n\n // Event handlers\n\n didClickToolbar(event) {\n event.preventDefault()\n return event.stopPropagation()\n }\n\n didClickActionButton(event) {\n const action = event.target.getAttribute(\"data-trix-action\")\n switch (action) {\n case \"remove\":\n return this.delegate?.attachmentEditorDidRequestRemovalOfAttachment(this.attachment)\n }\n }\n\n didKeyDownCaption(event) {\n if (keyNames[event.keyCode] === \"return\") {\n event.preventDefault()\n this.savePendingCaption()\n return this.delegate?.attachmentEditorDidRequestDeselectingAttachment?.(this.attachment)\n }\n }\n\n didInputCaption(event) {\n this.pendingCaption = event.target.value.replace(/\\s/g, \" \").trim()\n }\n\n didChangeCaption(event) {\n return this.savePendingCaption()\n }\n\n didBlurCaption(event) {\n return this.savePendingCaption()\n }\n}\n", "import BasicObject from \"trix/core/basic_object\"\nimport DocumentView from \"trix/views/document_view\"\nimport AttachmentEditorController from \"trix/controllers/attachment_editor_controller\"\n\nimport { defer, findClosestElementFromNode, handleEvent, innerElementIsActive } from \"trix/core/helpers\"\nimport { attachmentSelector } from \"trix/config/attachments\"\n\nexport default class CompositionController extends BasicObject {\n constructor(element, composition) {\n super(...arguments)\n this.didFocus = this.didFocus.bind(this)\n this.didBlur = this.didBlur.bind(this)\n this.didClickAttachment = this.didClickAttachment.bind(this)\n\n this.element = element\n this.composition = composition\n this.documentView = new DocumentView(this.composition.document, { element: this.element })\n\n handleEvent(\"focus\", { onElement: this.element, withCallback: this.didFocus })\n handleEvent(\"blur\", { onElement: this.element, withCallback: this.didBlur })\n handleEvent(\"click\", {\n onElement: this.element,\n matchingSelector: \"a[contenteditable=false]\",\n preventDefault: true,\n })\n handleEvent(\"mousedown\", {\n onElement: this.element,\n matchingSelector: attachmentSelector,\n withCallback: this.didClickAttachment,\n })\n handleEvent(\"click\", { onElement: this.element, matchingSelector: `a${attachmentSelector}`, preventDefault: true })\n }\n\n didFocus(event) {\n const perform = () => {\n if (!this.focused) {\n this.focused = true\n return this.delegate?.compositionControllerDidFocus?.()\n }\n }\n\n return this.blurPromise?.then(perform) || perform()\n }\n\n didBlur(event) {\n this.blurPromise = new Promise((resolve) => {\n return defer(() => {\n if (!innerElementIsActive(this.element)) {\n this.focused = null\n this.delegate?.compositionControllerDidBlur?.()\n }\n this.blurPromise = null\n return resolve()\n })\n })\n }\n\n didClickAttachment(event, target) {\n const attachment = this.findAttachmentForElement(target)\n const editCaption = !!findClosestElementFromNode(event.target, { matchingSelector: \"figcaption\" })\n return this.delegate?.compositionControllerDidSelectAttachment?.(attachment, { editCaption })\n }\n\n getSerializableElement() {\n if (this.isEditingAttachment()) {\n return this.documentView.shadowElement\n } else {\n return this.element\n }\n }\n\n render() {\n if (this.revision !== this.composition.revision) {\n this.documentView.setDocument(this.composition.document)\n this.documentView.render()\n this.revision = this.composition.revision\n }\n\n if (this.canSyncDocumentView() && !this.documentView.isSynced()) {\n this.delegate?.compositionControllerWillSyncDocumentView?.()\n this.documentView.sync()\n this.delegate?.compositionControllerDidSyncDocumentView?.()\n }\n\n return this.delegate?.compositionControllerDidRender?.()\n }\n\n rerenderViewForObject(object) {\n this.invalidateViewForObject(object)\n return this.render()\n }\n\n invalidateViewForObject(object) {\n return this.documentView.invalidateViewForObject(object)\n }\n\n isViewCachingEnabled() {\n return this.documentView.isViewCachingEnabled()\n }\n\n enableViewCaching() {\n return this.documentView.enableViewCaching()\n }\n\n disableViewCaching() {\n return this.documentView.disableViewCaching()\n }\n\n refreshViewCache() {\n return this.documentView.garbageCollectCachedViews()\n }\n\n // Attachment editor management\n\n isEditingAttachment() {\n return !!this.attachmentEditor\n }\n\n installAttachmentEditorForAttachment(attachment, options) {\n if (this.attachmentEditor?.attachment === attachment) return\n const element = this.documentView.findElementForObject(attachment)\n if (!element) return\n\n this.uninstallAttachmentEditor()\n const attachmentPiece = this.composition.document.getAttachmentPieceForAttachment(attachment)\n this.attachmentEditor = new AttachmentEditorController(attachmentPiece, element, this.element, options)\n this.attachmentEditor.delegate = this\n }\n\n uninstallAttachmentEditor() {\n return this.attachmentEditor?.uninstall()\n }\n\n // Attachment controller delegate\n\n didUninstallAttachmentEditor() {\n this.attachmentEditor = null\n return this.render()\n }\n\n attachmentEditorDidRequestUpdatingAttributesForAttachment(attributes, attachment) {\n this.delegate?.compositionControllerWillUpdateAttachment?.(attachment)\n return this.composition.updateAttributesForAttachment(attributes, attachment)\n }\n\n attachmentEditorDidRequestRemovingAttributeForAttachment(attribute, attachment) {\n this.delegate?.compositionControllerWillUpdateAttachment?.(attachment)\n return this.composition.removeAttributeForAttachment(attribute, attachment)\n }\n\n attachmentEditorDidRequestRemovalOfAttachment(attachment) {\n return this.delegate?.compositionControllerDidRequestRemovalOfAttachment?.(attachment)\n }\n\n attachmentEditorDidRequestDeselectingAttachment(attachment) {\n return this.delegate?.compositionControllerDidRequestDeselectingAttachment?.(attachment)\n }\n\n // Private\n\n canSyncDocumentView() {\n return !this.isEditingAttachment()\n }\n\n findAttachmentForElement(element) {\n return this.composition.document.getAttachmentById(parseInt(element.dataset.trixId, 10))\n }\n}\n", "import \"trix/views/object_view\"\nimport BasicObject from \"trix/core/basic_object\"\n\nexport default class Controller extends BasicObject {}\n", "import BasicObject from \"trix/core/basic_object\"\n\nimport {\n findClosestElementFromNode,\n nodeIsBlockStartComment,\n nodeIsEmptyTextNode,\n normalizeSpaces,\n summarizeStringChange,\n tagName,\n} from \"trix/core/helpers\"\n\nconst mutableAttributeName = \"data-trix-mutable\"\nconst mutableSelector = `[${mutableAttributeName}]`\n\nconst options = {\n attributes: true,\n childList: true,\n characterData: true,\n characterDataOldValue: true,\n subtree: true,\n}\n\nexport default class MutationObserver extends BasicObject {\n constructor(element) {\n super(element)\n this.didMutate = this.didMutate.bind(this)\n this.element = element\n this.observer = new window.MutationObserver(this.didMutate)\n this.start()\n }\n\n start() {\n this.reset()\n return this.observer.observe(this.element, options)\n }\n\n stop() {\n return this.observer.disconnect()\n }\n\n didMutate(mutations) {\n this.mutations.push(...Array.from(this.findSignificantMutations(mutations) || []))\n\n if (this.mutations.length) {\n this.delegate?.elementDidMutate?.(this.getMutationSummary())\n return this.reset()\n }\n }\n\n // Private\n\n reset() {\n this.mutations = []\n }\n\n findSignificantMutations(mutations) {\n return mutations.filter((mutation) => {\n return this.mutationIsSignificant(mutation)\n })\n }\n\n mutationIsSignificant(mutation) {\n if (this.nodeIsMutable(mutation.target)) {\n return false\n }\n for (const node of Array.from(this.nodesModifiedByMutation(mutation))) {\n if (this.nodeIsSignificant(node)) return true\n }\n return false\n }\n\n nodeIsSignificant(node) {\n return node !== this.element && !this.nodeIsMutable(node) && !nodeIsEmptyTextNode(node)\n }\n\n nodeIsMutable(node) {\n return findClosestElementFromNode(node, { matchingSelector: mutableSelector })\n }\n\n nodesModifiedByMutation(mutation) {\n const nodes = []\n switch (mutation.type) {\n case \"attributes\":\n if (mutation.attributeName !== mutableAttributeName) {\n nodes.push(mutation.target)\n }\n break\n case \"characterData\":\n // Changes to text nodes should consider the parent element\n nodes.push(mutation.target.parentNode)\n nodes.push(mutation.target)\n break\n case \"childList\":\n // Consider each added or removed node\n nodes.push(...Array.from(mutation.addedNodes || []))\n nodes.push(...Array.from(mutation.removedNodes || []))\n break\n }\n return nodes\n }\n\n getMutationSummary() {\n return this.getTextMutationSummary()\n }\n\n getTextMutationSummary() {\n const { additions, deletions } = this.getTextChangesFromCharacterData()\n const textChanges = this.getTextChangesFromChildList()\n\n Array.from(textChanges.additions).forEach((addition) => {\n if (!Array.from(additions).includes(addition)) {\n additions.push(addition)\n }\n })\n\n deletions.push(...Array.from(textChanges.deletions || []))\n\n const summary = {}\n\n const added = additions.join(\"\")\n if (added) {\n summary.textAdded = added\n }\n\n const deleted = deletions.join(\"\")\n if (deleted) {\n summary.textDeleted = deleted\n }\n\n return summary\n }\n\n getMutationsByType(type) {\n return Array.from(this.mutations).filter((mutation) => mutation.type === type)\n }\n\n getTextChangesFromChildList() {\n let textAdded, textRemoved\n const addedNodes = []\n const removedNodes = []\n\n Array.from(this.getMutationsByType(\"childList\")).forEach((mutation) => {\n addedNodes.push(...Array.from(mutation.addedNodes || []))\n removedNodes.push(...Array.from(mutation.removedNodes || []))\n })\n\n const singleBlockCommentRemoved =\n addedNodes.length === 0 && removedNodes.length === 1 && nodeIsBlockStartComment(removedNodes[0])\n\n if (singleBlockCommentRemoved) {\n textAdded = []\n textRemoved = [ \"\\n\" ]\n } else {\n textAdded = getTextForNodes(addedNodes)\n textRemoved = getTextForNodes(removedNodes)\n }\n\n const additions = textAdded.filter((text, index) => text !== textRemoved[index]).map(normalizeSpaces)\n const deletions = textRemoved.filter((text, index) => text !== textAdded[index]).map(normalizeSpaces)\n\n return { additions, deletions }\n }\n\n getTextChangesFromCharacterData() {\n let added, removed\n const characterMutations = this.getMutationsByType(\"characterData\")\n\n if (characterMutations.length) {\n const startMutation = characterMutations[0],\n endMutation = characterMutations[characterMutations.length - 1]\n\n const oldString = normalizeSpaces(startMutation.oldValue)\n const newString = normalizeSpaces(endMutation.target.data)\n const summarized = summarizeStringChange(oldString, newString)\n added = summarized.added\n removed = summarized.removed\n }\n\n return {\n additions: added ? [ added ] : [],\n deletions: removed ? [ removed ] : [],\n }\n }\n}\n\nconst getTextForNodes = function(nodes = []) {\n const text = []\n for (const node of Array.from(nodes)) {\n switch (node.nodeType) {\n case Node.TEXT_NODE:\n text.push(node.data)\n break\n case Node.ELEMENT_NODE:\n if (tagName(node) === \"br\") {\n text.push(\"\\n\")\n } else {\n text.push(...Array.from(getTextForNodes(node.childNodes) || []))\n }\n break\n }\n }\n return text\n}\n", "/* eslint-disable\n no-empty,\n*/\nimport Operation from \"trix/core/utilities/operation\"\n\nexport default class FileVerificationOperation extends Operation {\n constructor(file) {\n super(...arguments)\n this.file = file\n }\n\n perform(callback) {\n const reader = new FileReader()\n\n reader.onerror = () => callback(false)\n\n reader.onload = () => {\n reader.onerror = null\n try {\n reader.abort()\n } catch (error) {}\n return callback(true, this.file)\n }\n\n return reader.readAsArrayBuffer(this.file)\n }\n}\n", "import * as config from \"trix/config\"\nimport { NON_BREAKING_SPACE, OBJECT_REPLACEMENT_CHARACTER, ZERO_WIDTH_SPACE } from \"trix/constants\"\n\n// Each software keyboard on Android emits its own set of events and some of them can be buggy.\n// This class detects when some buggy events are being emitted and lets know the input controller\n// that they should be ignored.\nexport default class FlakyAndroidKeyboardDetector {\n constructor(element) {\n this.element = element\n }\n\n shouldIgnore(event) {\n if (!config.browser.samsungAndroid) return false\n\n this.previousEvent = this.event\n this.event = event\n\n this.checkSamsungKeyboardBuggyModeStart()\n this.checkSamsungKeyboardBuggyModeEnd()\n\n return this.buggyMode\n }\n\n // private\n\n // The Samsung keyboard on Android can enter a buggy state in which it emits a flurry of confused events that,\n // if processed, corrupts the editor. The buggy mode always starts with an insertText event, right after a\n // keydown event with for an \"Unidentified\" key, with the same text as the editor element, except for a few\n // extra whitespace, or exotic utf8, characters.\n checkSamsungKeyboardBuggyModeStart() {\n if (this.insertingLongTextAfterUnidentifiedChar() && differsInWhitespace(this.element.innerText, this.event.data)) {\n this.buggyMode = true\n this.event.preventDefault()\n }\n }\n\n // The flurry of buggy events are always insertText. If we see any other type, it means it's over.\n checkSamsungKeyboardBuggyModeEnd() {\n if (this.buggyMode && this.event.inputType !== \"insertText\") {\n this.buggyMode = false\n }\n }\n\n insertingLongTextAfterUnidentifiedChar() {\n return this.isBeforeInputInsertText() && this.previousEventWasUnidentifiedKeydown() && this.event.data?.length > 50\n }\n\n isBeforeInputInsertText() {\n return this.event.type === \"beforeinput\" && this.event.inputType === \"insertText\"\n }\n\n previousEventWasUnidentifiedKeydown() {\n return this.previousEvent?.type === \"keydown\" && this.previousEvent?.key === \"Unidentified\"\n }\n}\n\nconst differsInWhitespace = (text1, text2) => {\n return normalize(text1) === normalize(text2)\n}\n\nconst whiteSpaceNormalizerRegexp = new RegExp(`(${OBJECT_REPLACEMENT_CHARACTER}|${ZERO_WIDTH_SPACE}|${NON_BREAKING_SPACE}|\\\\s)+`, \"g\")\nconst normalize = (text) => text.replace(whiteSpaceNormalizerRegexp, \" \").trim()\n", "import BasicObject from \"trix/core/basic_object\"\nimport MutationObserver from \"trix/observers/mutation_observer\"\nimport FileVerificationOperation from \"trix/operations/file_verification_operation\"\nimport FlakyAndroidKeyboardDetector from \"../models/flaky_android_keyboard_detector\"\n\nimport { handleEvent, innerElementIsActive } from \"trix/core/helpers\"\n\nexport default class InputController extends BasicObject {\n\n static events = {}\n\n constructor(element) {\n super(...arguments)\n this.element = element\n this.mutationObserver = new MutationObserver(this.element)\n this.mutationObserver.delegate = this\n this.flakyKeyboardDetector = new FlakyAndroidKeyboardDetector(this.element)\n for (const eventName in this.constructor.events) {\n handleEvent(eventName, { onElement: this.element, withCallback: this.handlerFor(eventName) })\n }\n }\n\n elementDidMutate(mutationSummary) {}\n\n editorWillSyncDocumentView() {\n return this.mutationObserver.stop()\n }\n\n editorDidSyncDocumentView() {\n return this.mutationObserver.start()\n }\n\n requestRender() {\n return this.delegate?.inputControllerDidRequestRender?.()\n }\n\n requestReparse() {\n this.delegate?.inputControllerDidRequestReparse?.()\n return this.requestRender()\n }\n\n attachFiles(files) {\n const operations = Array.from(files).map((file) => new FileVerificationOperation(file))\n return Promise.all(operations).then((files) => {\n this.handleInput(function() {\n this.delegate?.inputControllerWillAttachFiles()\n this.responder?.insertFiles(files)\n return this.requestRender()\n })\n })\n }\n\n // Private\n\n handlerFor(eventName) {\n return (event) => {\n if (!event.defaultPrevented) {\n this.handleInput(() => {\n if (!innerElementIsActive(this.element)) {\n if (this.flakyKeyboardDetector.shouldIgnore(event)) return\n\n this.eventName = eventName\n this.constructor.events[eventName].call(this, event)\n }\n })\n }\n }\n }\n\n handleInput(callback) {\n try {\n this.delegate?.inputControllerWillHandleInput()\n callback.call(this)\n } finally {\n this.delegate?.inputControllerDidHandleInput()\n }\n }\n\n createLinkHTML(href, text) {\n const link = document.createElement(\"a\")\n link.href = href\n link.textContent = text ? text : href\n return link.outerHTML\n }\n}\n\n", "import * as config from \"trix/config\"\nimport UTF16String from \"trix/core/utilities/utf16_string\"\nimport BasicObject from \"trix/core/basic_object\"\nimport InputController from \"trix/controllers/input_controller\"\nimport DocumentView from \"trix/views/document_view\"\nimport Document from \"trix/models/document\"\n\nimport {\n dataTransferIsPlainText,\n dataTransferIsWritable,\n keyEventIsKeyboardCommand,\n makeElement,\n objectsAreEqual,\n removeNode,\n squishBreakableWhitespace,\n} from \"trix/core/helpers\"\n\nimport { selectionChangeObserver } from \"trix/observers/selection_change_observer\"\n\nconst { browser, keyNames } = config\nlet pastedFileCount = 0\n\nexport default class Level0InputController extends InputController {\n\n static events = {\n keydown(event) {\n if (!this.isComposing()) {\n this.resetInputSummary()\n }\n this.inputSummary.didInput = true\n\n const keyName = keyNames[event.keyCode]\n if (keyName) {\n let context = this.keys\n\n ;[ \"ctrl\", \"alt\", \"shift\", \"meta\" ].forEach((modifier) => {\n if (event[`${modifier}Key`]) {\n if (modifier === \"ctrl\") {\n modifier = \"control\"\n }\n context = context?.[modifier]\n }\n })\n\n if (context?.[keyName] != null) {\n this.setInputSummary({ keyName })\n selectionChangeObserver.reset()\n context[keyName].call(this, event)\n }\n }\n\n if (keyEventIsKeyboardCommand(event)) {\n const character = String.fromCharCode(event.keyCode).toLowerCase()\n if (character) {\n const keys = [ \"alt\", \"shift\" ].map((modifier) => {\n if (event[`${modifier}Key`]) {\n return modifier\n }\n }).filter(key => key)\n keys.push(character)\n if (this.delegate?.inputControllerDidReceiveKeyboardCommand(keys)) {\n event.preventDefault()\n }\n }\n }\n },\n\n keypress(event) {\n if (this.inputSummary.eventName != null) return\n if (event.metaKey) return\n if (event.ctrlKey && !event.altKey) return\n\n const string = stringFromKeyEvent(event)\n if (string) {\n this.delegate?.inputControllerWillPerformTyping()\n this.responder?.insertString(string)\n return this.setInputSummary({ textAdded: string, didDelete: this.selectionIsExpanded() })\n }\n },\n\n textInput(event) {\n // Handle autocapitalization\n const { data } = event\n const { textAdded } = this.inputSummary\n if (textAdded && textAdded !== data && textAdded.toUpperCase() === data) {\n const range = this.getSelectedRange()\n this.setSelectedRange([ range[0], range[1] + textAdded.length ])\n this.responder?.insertString(data)\n this.setInputSummary({ textAdded: data })\n return this.setSelectedRange(range)\n }\n },\n\n dragenter(event) {\n event.preventDefault()\n },\n\n dragstart(event) {\n this.serializeSelectionToDataTransfer(event.dataTransfer)\n this.draggedRange = this.getSelectedRange()\n return this.delegate?.inputControllerDidStartDrag?.()\n },\n\n dragover(event) {\n if (this.draggedRange || this.canAcceptDataTransfer(event.dataTransfer)) {\n event.preventDefault()\n const draggingPoint = { x: event.clientX, y: event.clientY }\n if (!objectsAreEqual(draggingPoint, this.draggingPoint)) {\n this.draggingPoint = draggingPoint\n return this.delegate?.inputControllerDidReceiveDragOverPoint?.(this.draggingPoint)\n }\n }\n },\n\n dragend(event) {\n this.delegate?.inputControllerDidCancelDrag?.()\n this.draggedRange = null\n this.draggingPoint = null\n },\n\n drop(event) {\n event.preventDefault()\n const files = event.dataTransfer?.files\n const documentJSON = event.dataTransfer.getData(\"application/x-trix-document\")\n\n const point = { x: event.clientX, y: event.clientY }\n this.responder?.setLocationRangeFromPointRange(point)\n\n if (files?.length) {\n this.attachFiles(files)\n } else if (this.draggedRange) {\n this.delegate?.inputControllerWillMoveText()\n this.responder?.moveTextFromRange(this.draggedRange)\n this.draggedRange = null\n this.requestRender()\n } else if (documentJSON) {\n const document = Document.fromJSONString(documentJSON)\n this.responder?.insertDocument(document)\n this.requestRender()\n }\n\n this.draggedRange = null\n this.draggingPoint = null\n },\n\n cut(event) {\n if (this.responder?.selectionIsExpanded()) {\n if (this.serializeSelectionToDataTransfer(event.clipboardData)) {\n event.preventDefault()\n }\n\n this.delegate?.inputControllerWillCutText()\n this.deleteInDirection(\"backward\")\n if (event.defaultPrevented) {\n return this.requestRender()\n }\n }\n },\n\n copy(event) {\n if (this.responder?.selectionIsExpanded()) {\n if (this.serializeSelectionToDataTransfer(event.clipboardData)) {\n event.preventDefault()\n }\n }\n },\n\n paste(event) {\n const clipboard = event.clipboardData || event.testClipboardData\n const paste = { clipboard }\n\n if (!clipboard || pasteEventIsCrippledSafariHTMLPaste(event)) {\n this.getPastedHTMLUsingHiddenElement((html) => {\n paste.type = \"text/html\"\n paste.html = html\n this.delegate?.inputControllerWillPaste(paste)\n this.responder?.insertHTML(paste.html)\n this.requestRender()\n return this.delegate?.inputControllerDidPaste(paste)\n })\n return\n }\n\n const href = clipboard.getData(\"URL\")\n const html = clipboard.getData(\"text/html\")\n const name = clipboard.getData(\"public.url-name\")\n\n if (href) {\n let string\n paste.type = \"text/html\"\n if (name) {\n string = squishBreakableWhitespace(name).trim()\n } else {\n string = href\n }\n paste.html = this.createLinkHTML(href, string)\n this.delegate?.inputControllerWillPaste(paste)\n this.setInputSummary({ textAdded: string, didDelete: this.selectionIsExpanded() })\n this.responder?.insertHTML(paste.html)\n this.requestRender()\n this.delegate?.inputControllerDidPaste(paste)\n } else if (dataTransferIsPlainText(clipboard)) {\n paste.type = \"text/plain\"\n paste.string = clipboard.getData(\"text/plain\")\n this.delegate?.inputControllerWillPaste(paste)\n this.setInputSummary({ textAdded: paste.string, didDelete: this.selectionIsExpanded() })\n this.responder?.insertString(paste.string)\n this.requestRender()\n this.delegate?.inputControllerDidPaste(paste)\n } else if (html) {\n paste.type = \"text/html\"\n paste.html = html\n this.delegate?.inputControllerWillPaste(paste)\n this.responder?.insertHTML(paste.html)\n this.requestRender()\n this.delegate?.inputControllerDidPaste(paste)\n } else if (Array.from(clipboard.types).includes(\"Files\")) {\n const file = clipboard.items?.[0]?.getAsFile?.()\n if (file) {\n const extension = extensionForFile(file)\n if (!file.name && extension) {\n file.name = `pasted-file-${++pastedFileCount}.${extension}`\n }\n paste.type = \"File\"\n paste.file = file\n this.delegate?.inputControllerWillAttachFiles()\n this.responder?.insertFile(paste.file)\n this.requestRender()\n this.delegate?.inputControllerDidPaste(paste)\n }\n }\n\n event.preventDefault()\n },\n\n compositionstart(event) {\n return this.getCompositionInput().start(event.data)\n },\n\n compositionupdate(event) {\n return this.getCompositionInput().update(event.data)\n },\n\n compositionend(event) {\n return this.getCompositionInput().end(event.data)\n },\n\n beforeinput(event) {\n this.inputSummary.didInput = true\n },\n\n input(event) {\n this.inputSummary.didInput = true\n return event.stopPropagation()\n },\n }\n\n static keys = {\n backspace(event) {\n this.delegate?.inputControllerWillPerformTyping()\n return this.deleteInDirection(\"backward\", event)\n },\n\n delete(event) {\n this.delegate?.inputControllerWillPerformTyping()\n return this.deleteInDirection(\"forward\", event)\n },\n\n return(event) {\n this.setInputSummary({ preferDocument: true })\n this.delegate?.inputControllerWillPerformTyping()\n return this.responder?.insertLineBreak()\n },\n\n tab(event) {\n if (this.responder?.canIncreaseNestingLevel()) {\n this.responder?.increaseNestingLevel()\n this.requestRender()\n event.preventDefault()\n }\n },\n\n left(event) {\n if (this.selectionIsInCursorTarget()) {\n event.preventDefault()\n return this.responder?.moveCursorInDirection(\"backward\")\n }\n },\n\n right(event) {\n if (this.selectionIsInCursorTarget()) {\n event.preventDefault()\n return this.responder?.moveCursorInDirection(\"forward\")\n }\n },\n\n control: {\n d(event) {\n this.delegate?.inputControllerWillPerformTyping()\n return this.deleteInDirection(\"forward\", event)\n },\n\n h(event) {\n this.delegate?.inputControllerWillPerformTyping()\n return this.deleteInDirection(\"backward\", event)\n },\n\n o(event) {\n event.preventDefault()\n this.delegate?.inputControllerWillPerformTyping()\n this.responder?.insertString(\"\\n\", { updatePosition: false })\n return this.requestRender()\n },\n },\n\n shift: {\n return(event) {\n this.delegate?.inputControllerWillPerformTyping()\n this.responder?.insertString(\"\\n\")\n this.requestRender()\n event.preventDefault()\n },\n\n tab(event) {\n if (this.responder?.canDecreaseNestingLevel()) {\n this.responder?.decreaseNestingLevel()\n this.requestRender()\n event.preventDefault()\n }\n },\n\n left(event) {\n if (this.selectionIsInCursorTarget()) {\n event.preventDefault()\n return this.expandSelectionInDirection(\"backward\")\n }\n },\n\n right(event) {\n if (this.selectionIsInCursorTarget()) {\n event.preventDefault()\n return this.expandSelectionInDirection(\"forward\")\n }\n },\n },\n\n alt: {\n backspace(event) {\n this.setInputSummary({ preferDocument: false })\n return this.delegate?.inputControllerWillPerformTyping()\n },\n },\n\n meta: {\n backspace(event) {\n this.setInputSummary({ preferDocument: false })\n return this.delegate?.inputControllerWillPerformTyping()\n },\n },\n }\n\n constructor() {\n super(...arguments)\n this.resetInputSummary()\n }\n\n setInputSummary(summary = {}) {\n this.inputSummary.eventName = this.eventName\n for (const key in summary) {\n const value = summary[key]\n this.inputSummary[key] = value\n }\n return this.inputSummary\n }\n\n resetInputSummary() {\n this.inputSummary = {}\n }\n\n reset() {\n this.resetInputSummary()\n return selectionChangeObserver.reset()\n }\n\n // Mutation observer delegate\n\n elementDidMutate(mutationSummary) {\n if (this.isComposing()) {\n return this.delegate?.inputControllerDidAllowUnhandledInput?.()\n } else {\n return this.handleInput(function() {\n if (this.mutationIsSignificant(mutationSummary)) {\n if (this.mutationIsExpected(mutationSummary)) {\n this.requestRender()\n } else {\n this.requestReparse()\n }\n }\n return this.reset()\n })\n }\n }\n\n mutationIsExpected({ textAdded, textDeleted }) {\n if (this.inputSummary.preferDocument) {\n return true\n }\n\n const mutationAdditionMatchesSummary =\n textAdded != null ? textAdded === this.inputSummary.textAdded : !this.inputSummary.textAdded\n const mutationDeletionMatchesSummary =\n textDeleted != null ? this.inputSummary.didDelete : !this.inputSummary.didDelete\n\n const unexpectedNewlineAddition = [ \"\\n\", \" \\n\" ].includes(textAdded) && !mutationAdditionMatchesSummary\n const unexpectedNewlineDeletion = textDeleted === \"\\n\" && !mutationDeletionMatchesSummary\n const singleUnexpectedNewline =\n unexpectedNewlineAddition && !unexpectedNewlineDeletion ||\n unexpectedNewlineDeletion && !unexpectedNewlineAddition\n\n if (singleUnexpectedNewline) {\n const range = this.getSelectedRange()\n if (range) {\n const offset = unexpectedNewlineAddition ? textAdded.replace(/\\n$/, \"\").length || -1 : textAdded?.length || 1\n if (this.responder?.positionIsBlockBreak(range[1] + offset)) {\n return true\n }\n }\n }\n\n return mutationAdditionMatchesSummary && mutationDeletionMatchesSummary\n }\n\n mutationIsSignificant(mutationSummary) {\n const textChanged = Object.keys(mutationSummary).length > 0\n const composedEmptyString = this.compositionInput?.getEndData() === \"\"\n return textChanged || !composedEmptyString\n }\n\n // Private\n\n getCompositionInput() {\n if (this.isComposing()) {\n return this.compositionInput\n } else {\n this.compositionInput = new CompositionInput(this)\n }\n }\n\n isComposing() {\n return this.compositionInput && !this.compositionInput.isEnded()\n }\n\n deleteInDirection(direction, event) {\n if (this.responder?.deleteInDirection(direction) === false) {\n if (event) {\n event.preventDefault()\n return this.requestRender()\n }\n } else {\n return this.setInputSummary({ didDelete: true })\n }\n }\n\n serializeSelectionToDataTransfer(dataTransfer) {\n if (!dataTransferIsWritable(dataTransfer)) return\n const document = this.responder?.getSelectedDocument().toSerializableDocument()\n\n dataTransfer.setData(\"application/x-trix-document\", JSON.stringify(document))\n dataTransfer.setData(\"text/html\", DocumentView.render(document).innerHTML)\n dataTransfer.setData(\"text/plain\", document.toString().replace(/\\n$/, \"\"))\n return true\n }\n\n canAcceptDataTransfer(dataTransfer) {\n const types = {}\n Array.from(dataTransfer?.types || []).forEach((type) => {\n types[type] = true\n })\n return types.Files || types[\"application/x-trix-document\"] || types[\"text/html\"] || types[\"text/plain\"]\n }\n\n getPastedHTMLUsingHiddenElement(callback) {\n const selectedRange = this.getSelectedRange()\n\n const style = {\n position: \"absolute\",\n left: `${window.pageXOffset}px`,\n top: `${window.pageYOffset}px`,\n opacity: 0,\n }\n\n const element = makeElement({ style, tagName: \"div\", editable: true })\n document.body.appendChild(element)\n element.focus()\n\n return requestAnimationFrame(() => {\n const html = element.innerHTML\n removeNode(element)\n this.setSelectedRange(selectedRange)\n return callback(html)\n })\n }\n}\n\nLevel0InputController.proxyMethod(\"responder?.getSelectedRange\")\nLevel0InputController.proxyMethod(\"responder?.setSelectedRange\")\nLevel0InputController.proxyMethod(\"responder?.expandSelectionInDirection\")\nLevel0InputController.proxyMethod(\"responder?.selectionIsInCursorTarget\")\nLevel0InputController.proxyMethod(\"responder?.selectionIsExpanded\")\n\nconst extensionForFile = (file) => file.type?.match(/\\/(\\w+)$/)?.[1]\n\nconst hasStringCodePointAt = !!\" \".codePointAt?.(0)\n\nconst stringFromKeyEvent = function(event) {\n if (event.key && hasStringCodePointAt && event.key.codePointAt(0) === event.keyCode) {\n return event.key\n } else {\n let code\n if (event.which === null) {\n code = event.keyCode\n } else if (event.which !== 0 && event.charCode !== 0) {\n code = event.charCode\n }\n\n if (code != null && keyNames[code] !== \"escape\") {\n return UTF16String.fromCodepoints([ code ]).toString()\n }\n }\n}\n\nconst pasteEventIsCrippledSafariHTMLPaste = function(event) {\n const paste = event.clipboardData\n if (paste) {\n if (paste.types.includes(\"text/html\")) {\n // Answer is yes if there's any possibility of Paste and Match Style in Safari,\n // which is nearly impossible to detect confidently: https://bugs.webkit.org/show_bug.cgi?id=174165\n for (const type of paste.types) {\n const hasPasteboardFlavor = /^CorePasteboardFlavorType/.test(type)\n const hasReadableDynamicData = /^dyn\\./.test(type) && paste.getData(type)\n const mightBePasteAndMatchStyle = hasPasteboardFlavor || hasReadableDynamicData\n if (mightBePasteAndMatchStyle) {\n return true\n }\n }\n return false\n } else {\n const isExternalHTMLPaste = paste.types.includes(\"com.apple.webarchive\")\n const isExternalRichTextPaste = paste.types.includes(\"com.apple.flat-rtfd\")\n return isExternalHTMLPaste || isExternalRichTextPaste\n }\n }\n}\n\nclass CompositionInput extends BasicObject {\n constructor(inputController) {\n super(...arguments)\n this.inputController = inputController\n this.responder = this.inputController.responder\n this.delegate = this.inputController.delegate\n this.inputSummary = this.inputController.inputSummary\n this.data = {}\n }\n\n start(data) {\n this.data.start = data\n\n if (this.isSignificant()) {\n if (this.inputSummary.eventName === \"keypress\" && this.inputSummary.textAdded) {\n this.responder?.deleteInDirection(\"left\")\n }\n\n if (!this.selectionIsExpanded()) {\n this.insertPlaceholder()\n this.requestRender()\n }\n\n this.range = this.responder?.getSelectedRange()\n }\n }\n\n update(data) {\n this.data.update = data\n\n if (this.isSignificant()) {\n const range = this.selectPlaceholder()\n if (range) {\n this.forgetPlaceholder()\n this.range = range\n }\n }\n }\n\n end(data) {\n this.data.end = data\n\n if (this.isSignificant()) {\n this.forgetPlaceholder()\n\n if (this.canApplyToDocument()) {\n this.setInputSummary({ preferDocument: true, didInput: false })\n this.delegate?.inputControllerWillPerformTyping()\n this.responder?.setSelectedRange(this.range)\n this.responder?.insertString(this.data.end)\n return this.responder?.setSelectedRange(this.range[0] + this.data.end.length)\n } else if (this.data.start != null || this.data.update != null) {\n this.requestReparse()\n return this.inputController.reset()\n }\n } else {\n return this.inputController.reset()\n }\n }\n\n getEndData() {\n return this.data.end\n }\n\n isEnded() {\n return this.getEndData() != null\n }\n\n isSignificant() {\n if (browser.composesExistingText) {\n return this.inputSummary.didInput\n } else {\n return true\n }\n }\n\n // Private\n\n canApplyToDocument() {\n return this.data.start?.length === 0 && this.data.end?.length > 0 && this.range\n }\n}\n\nCompositionInput.proxyMethod(\"inputController.setInputSummary\")\nCompositionInput.proxyMethod(\"inputController.requestRender\")\nCompositionInput.proxyMethod(\"inputController.requestReparse\")\nCompositionInput.proxyMethod(\"responder?.selectionIsExpanded\")\nCompositionInput.proxyMethod(\"responder?.insertPlaceholder\")\nCompositionInput.proxyMethod(\"responder?.selectPlaceholder\")\nCompositionInput.proxyMethod(\"responder?.forgetPlaceholder\")\n", "import { getAllAttributeNames, shouldRenderInmmediatelyToDealWithIOSDictation, squishBreakableWhitespace } from \"trix/core/helpers\"\nimport InputController from \"trix/controllers/input_controller\"\nimport * as config from \"trix/config\"\n\nimport { dataTransferIsMsOfficePaste, dataTransferIsPlainText, keyEventIsKeyboardCommand, objectsAreEqual } from \"trix/core/helpers\"\n\nimport { selectionChangeObserver } from \"trix/observers/selection_change_observer\"\n\nexport default class Level2InputController extends InputController {\n constructor(...args) {\n super(...args)\n this.render = this.render.bind(this)\n }\n\n static events = {\n keydown(event) {\n if (keyEventIsKeyboardCommand(event)) {\n const command = keyboardCommandFromKeyEvent(event)\n if (this.delegate?.inputControllerDidReceiveKeyboardCommand(command)) {\n event.preventDefault()\n }\n } else {\n let name = event.key\n if (event.altKey) {\n name += \"+Alt\"\n }\n if (event.shiftKey) {\n name += \"+Shift\"\n }\n const handler = this.constructor.keys[name]\n if (handler) {\n return this.withEvent(event, handler)\n }\n }\n },\n\n // Handle paste event to work around beforeinput.insertFromPaste browser bugs.\n // Safe to remove each condition once fixed upstream.\n paste(event) {\n // https://bugs.webkit.org/show_bug.cgi?id=194921\n let paste\n const href = event.clipboardData?.getData(\"URL\")\n if (pasteEventHasFilesOnly(event)) {\n event.preventDefault()\n return this.attachFiles(event.clipboardData.files)\n\n // https://bugs.chromium.org/p/chromium/issues/detail?id=934448\n } else if (pasteEventHasPlainTextOnly(event)) {\n event.preventDefault()\n paste = {\n type: \"text/plain\",\n string: event.clipboardData.getData(\"text/plain\"),\n }\n this.delegate?.inputControllerWillPaste(paste)\n this.responder?.insertString(paste.string)\n this.render()\n return this.delegate?.inputControllerDidPaste(paste)\n\n // https://bugs.webkit.org/show_bug.cgi?id=196702\n } else if (href) {\n event.preventDefault()\n paste = {\n type: \"text/html\",\n html: this.createLinkHTML(href),\n }\n this.delegate?.inputControllerWillPaste(paste)\n this.responder?.insertHTML(paste.html)\n this.render()\n return this.delegate?.inputControllerDidPaste(paste)\n }\n },\n\n beforeinput(event) {\n const handler = this.constructor.inputTypes[event.inputType]\n\n const immmediateRender = shouldRenderInmmediatelyToDealWithIOSDictation(event)\n\n if (handler) {\n this.withEvent(event, handler)\n\n if (!immmediateRender) {\n this.scheduleRender()\n }\n }\n\n if (immmediateRender) {\n this.render()\n }\n },\n\n input(event) {\n selectionChangeObserver.reset()\n },\n\n dragstart(event) {\n if (this.responder?.selectionContainsAttachments()) {\n event.dataTransfer.setData(\"application/x-trix-dragging\", true)\n\n this.dragging = {\n range: this.responder?.getSelectedRange(),\n point: pointFromEvent(event),\n }\n }\n },\n\n dragenter(event) {\n if (dragEventHasFiles(event)) {\n event.preventDefault()\n }\n },\n\n dragover(event) {\n if (this.dragging) {\n event.preventDefault()\n const point = pointFromEvent(event)\n if (!objectsAreEqual(point, this.dragging.point)) {\n this.dragging.point = point\n return this.responder?.setLocationRangeFromPointRange(point)\n }\n } else if (dragEventHasFiles(event)) {\n event.preventDefault()\n }\n },\n\n drop(event) {\n if (this.dragging) {\n event.preventDefault()\n this.delegate?.inputControllerWillMoveText()\n this.responder?.moveTextFromRange(this.dragging.range)\n this.dragging = null\n return this.scheduleRender()\n } else if (dragEventHasFiles(event)) {\n event.preventDefault()\n const point = pointFromEvent(event)\n this.responder?.setLocationRangeFromPointRange(point)\n return this.attachFiles(event.dataTransfer.files)\n }\n },\n\n dragend() {\n if (this.dragging) {\n this.responder?.setSelectedRange(this.dragging.range)\n this.dragging = null\n }\n },\n\n compositionend(event) {\n if (this.composing) {\n this.composing = false\n if (!config.browser.recentAndroid) this.scheduleRender()\n }\n },\n }\n\n static keys = {\n ArrowLeft() {\n if (this.responder?.shouldManageMovingCursorInDirection(\"backward\")) {\n this.event.preventDefault()\n return this.responder?.moveCursorInDirection(\"backward\")\n }\n },\n\n ArrowRight() {\n if (this.responder?.shouldManageMovingCursorInDirection(\"forward\")) {\n this.event.preventDefault()\n return this.responder?.moveCursorInDirection(\"forward\")\n }\n },\n\n Backspace() {\n if (this.responder?.shouldManageDeletingInDirection(\"backward\")) {\n this.event.preventDefault()\n this.delegate?.inputControllerWillPerformTyping()\n this.responder?.deleteInDirection(\"backward\")\n return this.render()\n }\n },\n\n Tab() {\n if (this.responder?.canIncreaseNestingLevel()) {\n this.event.preventDefault()\n this.responder?.increaseNestingLevel()\n return this.render()\n }\n },\n\n \"Tab+Shift\"() {\n if (this.responder?.canDecreaseNestingLevel()) {\n this.event.preventDefault()\n this.responder?.decreaseNestingLevel()\n return this.render()\n }\n },\n }\n\n static inputTypes = {\n deleteByComposition() {\n return this.deleteInDirection(\"backward\", { recordUndoEntry: false })\n },\n\n deleteByCut() {\n return this.deleteInDirection(\"backward\")\n },\n\n deleteByDrag() {\n this.event.preventDefault()\n return this.withTargetDOMRange(function() {\n this.deleteByDragRange = this.responder?.getSelectedRange()\n })\n },\n\n deleteCompositionText() {\n return this.deleteInDirection(\"backward\", { recordUndoEntry: false })\n },\n\n deleteContent() {\n return this.deleteInDirection(\"backward\")\n },\n\n deleteContentBackward() {\n return this.deleteInDirection(\"backward\")\n },\n\n deleteContentForward() {\n return this.deleteInDirection(\"forward\")\n },\n\n deleteEntireSoftLine() {\n return this.deleteInDirection(\"forward\")\n },\n\n deleteHardLineBackward() {\n return this.deleteInDirection(\"backward\")\n },\n\n deleteHardLineForward() {\n return this.deleteInDirection(\"forward\")\n },\n\n deleteSoftLineBackward() {\n return this.deleteInDirection(\"backward\")\n },\n\n deleteSoftLineForward() {\n return this.deleteInDirection(\"forward\")\n },\n\n deleteWordBackward() {\n return this.deleteInDirection(\"backward\")\n },\n\n deleteWordForward() {\n return this.deleteInDirection(\"forward\")\n },\n\n formatBackColor() {\n return this.activateAttributeIfSupported(\"backgroundColor\", this.event.data)\n },\n\n formatBold() {\n return this.toggleAttributeIfSupported(\"bold\")\n },\n\n formatFontColor() {\n return this.activateAttributeIfSupported(\"color\", this.event.data)\n },\n\n formatFontName() {\n return this.activateAttributeIfSupported(\"font\", this.event.data)\n },\n\n formatIndent() {\n if (this.responder?.canIncreaseNestingLevel()) {\n return this.withTargetDOMRange(function() {\n return this.responder?.increaseNestingLevel()\n })\n }\n },\n\n formatItalic() {\n return this.toggleAttributeIfSupported(\"italic\")\n },\n\n formatJustifyCenter() {\n return this.toggleAttributeIfSupported(\"justifyCenter\")\n },\n\n formatJustifyFull() {\n return this.toggleAttributeIfSupported(\"justifyFull\")\n },\n\n formatJustifyLeft() {\n return this.toggleAttributeIfSupported(\"justifyLeft\")\n },\n\n formatJustifyRight() {\n return this.toggleAttributeIfSupported(\"justifyRight\")\n },\n\n formatOutdent() {\n if (this.responder?.canDecreaseNestingLevel()) {\n return this.withTargetDOMRange(function() {\n return this.responder?.decreaseNestingLevel()\n })\n }\n },\n\n formatRemove() {\n this.withTargetDOMRange(function() {\n for (const attributeName in this.responder?.getCurrentAttributes()) {\n this.responder?.removeCurrentAttribute(attributeName)\n }\n })\n },\n\n formatSetBlockTextDirection() {\n return this.activateAttributeIfSupported(\"blockDir\", this.event.data)\n },\n\n formatSetInlineTextDirection() {\n return this.activateAttributeIfSupported(\"textDir\", this.event.data)\n },\n\n formatStrikeThrough() {\n return this.toggleAttributeIfSupported(\"strike\")\n },\n\n formatSubscript() {\n return this.toggleAttributeIfSupported(\"sub\")\n },\n\n formatSuperscript() {\n return this.toggleAttributeIfSupported(\"sup\")\n },\n\n formatUnderline() {\n return this.toggleAttributeIfSupported(\"underline\")\n },\n\n historyRedo() {\n return this.delegate?.inputControllerWillPerformRedo()\n },\n\n historyUndo() {\n return this.delegate?.inputControllerWillPerformUndo()\n },\n\n insertCompositionText() {\n this.composing = true\n return this.insertString(this.event.data)\n },\n\n insertFromComposition() {\n this.composing = false\n return this.insertString(this.event.data)\n },\n\n insertFromDrop() {\n const range = this.deleteByDragRange\n if (range) {\n this.deleteByDragRange = null\n this.delegate?.inputControllerWillMoveText()\n return this.withTargetDOMRange(function() {\n return this.responder?.moveTextFromRange(range)\n })\n }\n },\n\n insertFromPaste() {\n const { dataTransfer } = this.event\n const paste = { dataTransfer }\n\n const href = dataTransfer.getData(\"URL\")\n const html = dataTransfer.getData(\"text/html\")\n\n if (href) {\n let string\n this.event.preventDefault()\n paste.type = \"text/html\"\n const name = dataTransfer.getData(\"public.url-name\")\n if (name) {\n string = squishBreakableWhitespace(name).trim()\n } else {\n string = href\n }\n paste.html = this.createLinkHTML(href, string)\n this.delegate?.inputControllerWillPaste(paste)\n this.withTargetDOMRange(function() {\n return this.responder?.insertHTML(paste.html)\n })\n this.afterRender = () => {\n return this.delegate?.inputControllerDidPaste(paste)\n }\n } else if (dataTransferIsPlainText(dataTransfer)) {\n paste.type = \"text/plain\"\n paste.string = dataTransfer.getData(\"text/plain\")\n this.delegate?.inputControllerWillPaste(paste)\n this.withTargetDOMRange(function() {\n return this.responder?.insertString(paste.string)\n })\n\n this.afterRender = () => {\n return this.delegate?.inputControllerDidPaste(paste)\n }\n } else if (processableFilePaste(this.event)) {\n paste.type = \"File\"\n paste.file = dataTransfer.files[0]\n this.delegate?.inputControllerWillPaste(paste)\n this.withTargetDOMRange(function() {\n return this.responder?.insertFile(paste.file)\n })\n\n this.afterRender = () => {\n return this.delegate?.inputControllerDidPaste(paste)\n }\n } else if (html) {\n this.event.preventDefault()\n paste.type = \"text/html\"\n paste.html = html\n this.delegate?.inputControllerWillPaste(paste)\n this.withTargetDOMRange(function() {\n return this.responder?.insertHTML(paste.html)\n })\n this.afterRender = () => {\n return this.delegate?.inputControllerDidPaste(paste)\n }\n }\n },\n\n insertFromYank() {\n return this.insertString(this.event.data)\n },\n\n insertLineBreak() {\n return this.insertString(\"\\n\")\n },\n\n insertLink() {\n return this.activateAttributeIfSupported(\"href\", this.event.data)\n },\n\n insertOrderedList() {\n return this.toggleAttributeIfSupported(\"number\")\n },\n\n insertParagraph() {\n this.delegate?.inputControllerWillPerformTyping()\n return this.withTargetDOMRange(function() {\n return this.responder?.insertLineBreak()\n })\n },\n\n insertReplacementText() {\n const replacement = this.event.dataTransfer.getData(\"text/plain\")\n const domRange = this.event.getTargetRanges()[0]\n\n this.withTargetDOMRange(domRange, () => {\n this.insertString(replacement, { updatePosition: false })\n })\n },\n\n insertText() {\n return this.insertString(this.event.data || this.event.dataTransfer?.getData(\"text/plain\"))\n },\n\n insertTranspose() {\n return this.insertString(this.event.data)\n },\n\n insertUnorderedList() {\n return this.toggleAttributeIfSupported(\"bullet\")\n },\n }\n\n elementDidMutate() {\n if (this.scheduledRender) {\n if (this.composing) {\n return this.delegate?.inputControllerDidAllowUnhandledInput?.()\n }\n } else {\n return this.reparse()\n }\n }\n\n scheduleRender() {\n return this.scheduledRender ? this.scheduledRender : this.scheduledRender = requestAnimationFrame(this.render)\n }\n\n render() {\n cancelAnimationFrame(this.scheduledRender)\n this.scheduledRender = null\n if (!this.composing) {\n this.delegate?.render()\n }\n this.afterRender?.()\n this.afterRender = null\n }\n\n reparse() {\n return this.delegate?.reparse()\n }\n\n // Responder helpers\n\n insertString(string = \"\", options) {\n this.delegate?.inputControllerWillPerformTyping()\n return this.withTargetDOMRange(function() {\n return this.responder?.insertString(string, options)\n })\n }\n\n toggleAttributeIfSupported(attributeName) {\n if (getAllAttributeNames().includes(attributeName)) {\n this.delegate?.inputControllerWillPerformFormatting(attributeName)\n return this.withTargetDOMRange(function() {\n return this.responder?.toggleCurrentAttribute(attributeName)\n })\n }\n }\n\n activateAttributeIfSupported(attributeName, value) {\n if (getAllAttributeNames().includes(attributeName)) {\n this.delegate?.inputControllerWillPerformFormatting(attributeName)\n return this.withTargetDOMRange(function() {\n return this.responder?.setCurrentAttribute(attributeName, value)\n })\n }\n }\n\n deleteInDirection(direction, { recordUndoEntry } = { recordUndoEntry: true }) {\n if (recordUndoEntry) {\n this.delegate?.inputControllerWillPerformTyping()\n }\n const perform = () => this.responder?.deleteInDirection(direction)\n const domRange = this.getTargetDOMRange({ minLength: this.composing ? 1 : 2 })\n if (domRange) {\n return this.withTargetDOMRange(domRange, perform)\n } else {\n return perform()\n }\n }\n\n // Selection helpers\n\n withTargetDOMRange(domRange, fn) {\n if (typeof domRange === \"function\") {\n fn = domRange\n domRange = this.getTargetDOMRange()\n }\n if (domRange) {\n return this.responder?.withTargetDOMRange(domRange, fn.bind(this))\n } else {\n selectionChangeObserver.reset()\n return fn.call(this)\n }\n }\n\n getTargetDOMRange({ minLength } = { minLength: 0 }) {\n const targetRanges = this.event.getTargetRanges?.()\n if (targetRanges) {\n if (targetRanges.length) {\n const domRange = staticRangeToRange(targetRanges[0])\n if (minLength === 0 || domRange.toString().length >= minLength) {\n return domRange\n }\n }\n }\n }\n\n withEvent(event, fn) {\n let result\n this.event = event\n try {\n result = fn.call(this)\n } finally {\n this.event = null\n }\n return result\n }\n}\n\nconst staticRangeToRange = function(staticRange) {\n const range = document.createRange()\n range.setStart(staticRange.startContainer, staticRange.startOffset)\n range.setEnd(staticRange.endContainer, staticRange.endOffset)\n return range\n}\n\n// Event helpers\n\nconst dragEventHasFiles = (event) => Array.from(event.dataTransfer?.types || []).includes(\"Files\")\n\nconst processableFilePaste = (event) => {\n // Paste events that only have files are handled by the paste event handler,\n // to work around Safari not supporting beforeinput.insertFromPaste for files.\n\n // MS Office text pastes include a file with a screenshot of the text, but we should\n // handle them as text pastes.\n return event.dataTransfer.files?.[0] && !pasteEventHasFilesOnly(event) && !dataTransferIsMsOfficePaste(event)\n}\n\nconst pasteEventHasFilesOnly = function(event) {\n const clipboard = event.clipboardData\n if (clipboard) {\n const fileTypes = Array.from(clipboard.types).filter((type) => type.match(/file/i)) // \"Files\", \"application/x-moz-file\"\n return fileTypes.length === clipboard.types.length && clipboard.files.length >= 1\n }\n}\n\nconst pasteEventHasPlainTextOnly = function(event) {\n const clipboard = event.clipboardData\n if (clipboard) {\n return clipboard.types.includes(\"text/plain\") && clipboard.types.length === 1\n }\n}\n\nconst keyboardCommandFromKeyEvent = function(event) {\n const command = []\n if (event.altKey) {\n command.push(\"alt\")\n }\n if (event.shiftKey) {\n command.push(\"shift\")\n }\n command.push(event.key)\n return command\n}\n\nconst pointFromEvent = (event) => ({\n x: event.clientX,\n y: event.clientY,\n})\n", "import BasicObject from \"trix/core/basic_object\"\n\nimport { findClosestElementFromNode, handleEvent, triggerEvent } from \"trix/core/helpers\"\n\nconst attributeButtonSelector = \"[data-trix-attribute]\"\nconst actionButtonSelector = \"[data-trix-action]\"\nconst toolbarButtonSelector = `${attributeButtonSelector}, ${actionButtonSelector}`\nconst dialogSelector = \"[data-trix-dialog]\"\nconst activeDialogSelector = `${dialogSelector}[data-trix-active]`\nconst dialogButtonSelector = `${dialogSelector} [data-trix-method]`\nconst dialogInputSelector = `${dialogSelector} [data-trix-input]`\nconst getInputForDialog = (element, attributeName) => {\n if (!attributeName) { attributeName = getAttributeName(element) }\n return element.querySelector(`[data-trix-input][name='${attributeName}']`)\n}\nconst getActionName = (element) => element.getAttribute(\"data-trix-action\")\nconst getAttributeName = (element) => {\n return element.getAttribute(\"data-trix-attribute\") || element.getAttribute(\"data-trix-dialog-attribute\")\n}\nconst getDialogName = (element) => element.getAttribute(\"data-trix-dialog\")\n\nexport default class ToolbarController extends BasicObject {\n constructor(element) {\n super(element)\n this.didClickActionButton = this.didClickActionButton.bind(this)\n this.didClickAttributeButton = this.didClickAttributeButton.bind(this)\n this.didClickDialogButton = this.didClickDialogButton.bind(this)\n this.didKeyDownDialogInput = this.didKeyDownDialogInput.bind(this)\n this.element = element\n this.attributes = {}\n this.actions = {}\n this.resetDialogInputs()\n\n handleEvent(\"mousedown\", {\n onElement: this.element,\n matchingSelector: actionButtonSelector,\n withCallback: this.didClickActionButton,\n })\n handleEvent(\"mousedown\", {\n onElement: this.element,\n matchingSelector: attributeButtonSelector,\n withCallback: this.didClickAttributeButton,\n })\n handleEvent(\"click\", { onElement: this.element, matchingSelector: toolbarButtonSelector, preventDefault: true })\n handleEvent(\"click\", {\n onElement: this.element,\n matchingSelector: dialogButtonSelector,\n withCallback: this.didClickDialogButton,\n })\n handleEvent(\"keydown\", {\n onElement: this.element,\n matchingSelector: dialogInputSelector,\n withCallback: this.didKeyDownDialogInput,\n })\n }\n\n // Event handlers\n\n didClickActionButton(event, element) {\n this.delegate?.toolbarDidClickButton()\n event.preventDefault()\n const actionName = getActionName(element)\n\n if (this.getDialog(actionName)) {\n return this.toggleDialog(actionName)\n } else {\n return this.delegate?.toolbarDidInvokeAction(actionName, element)\n }\n }\n\n didClickAttributeButton(event, element) {\n this.delegate?.toolbarDidClickButton()\n event.preventDefault()\n const attributeName = getAttributeName(element)\n\n if (this.getDialog(attributeName)) {\n this.toggleDialog(attributeName)\n } else {\n this.delegate?.toolbarDidToggleAttribute(attributeName)\n }\n\n return this.refreshAttributeButtons()\n }\n\n didClickDialogButton(event, element) {\n const dialogElement = findClosestElementFromNode(element, { matchingSelector: dialogSelector })\n const method = element.getAttribute(\"data-trix-method\")\n return this[method].call(this, dialogElement)\n }\n\n didKeyDownDialogInput(event, element) {\n if (event.keyCode === 13) {\n // Enter key\n event.preventDefault()\n const attribute = element.getAttribute(\"name\")\n const dialog = this.getDialog(attribute)\n this.setAttribute(dialog)\n }\n if (event.keyCode === 27) {\n // Escape key\n event.preventDefault()\n return this.hideDialog()\n }\n }\n\n // Action buttons\n\n updateActions(actions) {\n this.actions = actions\n return this.refreshActionButtons()\n }\n\n refreshActionButtons() {\n return this.eachActionButton((element, actionName) => {\n element.disabled = this.actions[actionName] === false\n })\n }\n\n eachActionButton(callback) {\n return Array.from(this.element.querySelectorAll(actionButtonSelector)).map((element) =>\n callback(element, getActionName(element))\n )\n }\n\n // Attribute buttons\n\n updateAttributes(attributes) {\n this.attributes = attributes\n return this.refreshAttributeButtons()\n }\n\n refreshAttributeButtons() {\n return this.eachAttributeButton((element, attributeName) => {\n element.disabled = this.attributes[attributeName] === false\n if (this.attributes[attributeName] || this.dialogIsVisible(attributeName)) {\n element.setAttribute(\"data-trix-active\", \"\")\n return element.classList.add(\"trix-active\")\n } else {\n element.removeAttribute(\"data-trix-active\")\n return element.classList.remove(\"trix-active\")\n }\n })\n }\n\n eachAttributeButton(callback) {\n return Array.from(this.element.querySelectorAll(attributeButtonSelector)).map((element) =>\n callback(element, getAttributeName(element))\n )\n }\n\n applyKeyboardCommand(keys) {\n const keyString = JSON.stringify(keys.sort())\n for (const button of Array.from(this.element.querySelectorAll(\"[data-trix-key]\"))) {\n const buttonKeys = button.getAttribute(\"data-trix-key\").split(\"+\")\n const buttonKeyString = JSON.stringify(buttonKeys.sort())\n if (buttonKeyString === keyString) {\n triggerEvent(\"mousedown\", { onElement: button })\n return true\n }\n }\n return false\n }\n\n // Dialogs\n\n dialogIsVisible(dialogName) {\n const element = this.getDialog(dialogName)\n if (element) {\n return element.hasAttribute(\"data-trix-active\")\n }\n }\n\n toggleDialog(dialogName) {\n if (this.dialogIsVisible(dialogName)) {\n return this.hideDialog()\n } else {\n return this.showDialog(dialogName)\n }\n }\n\n showDialog(dialogName) {\n this.hideDialog()\n this.delegate?.toolbarWillShowDialog()\n\n const element = this.getDialog(dialogName)\n element.setAttribute(\"data-trix-active\", \"\")\n element.classList.add(\"trix-active\")\n\n Array.from(element.querySelectorAll(\"input[disabled]\")).forEach((disabledInput) => {\n disabledInput.removeAttribute(\"disabled\")\n })\n\n const attributeName = getAttributeName(element)\n if (attributeName) {\n const input = getInputForDialog(element, dialogName)\n if (input) {\n input.value = this.attributes[attributeName] || \"\"\n input.select()\n }\n }\n\n return this.delegate?.toolbarDidShowDialog(dialogName)\n }\n\n setAttribute(dialogElement) {\n const attributeName = getAttributeName(dialogElement)\n const input = getInputForDialog(dialogElement, attributeName)\n if (input.willValidate && !input.checkValidity()) {\n input.setAttribute(\"data-trix-validate\", \"\")\n input.classList.add(\"trix-validate\")\n return input.focus()\n } else {\n this.delegate?.toolbarDidUpdateAttribute(attributeName, input.value)\n return this.hideDialog()\n }\n }\n\n removeAttribute(dialogElement) {\n const attributeName = getAttributeName(dialogElement)\n this.delegate?.toolbarDidRemoveAttribute(attributeName)\n return this.hideDialog()\n }\n\n hideDialog() {\n const element = this.element.querySelector(activeDialogSelector)\n if (element) {\n element.removeAttribute(\"data-trix-active\")\n element.classList.remove(\"trix-active\")\n this.resetDialogInputs()\n return this.delegate?.toolbarDidHideDialog(getDialogName(element))\n }\n }\n\n resetDialogInputs() {\n Array.from(this.element.querySelectorAll(dialogInputSelector)).forEach((input) => {\n input.setAttribute(\"disabled\", \"disabled\")\n input.removeAttribute(\"data-trix-validate\")\n input.classList.remove(\"trix-validate\")\n })\n }\n\n getDialog(dialogName) {\n return this.element.querySelector(`[data-trix-dialog=${dialogName}]`)\n }\n}\n", "/* eslint-disable\n id-length,\n*/\nimport * as config from \"trix/config\"\n\nimport { serializeToContentType } from \"trix/core/serialization\"\n\nimport Controller from \"trix/controllers/controller\"\nimport Level0InputController from \"trix/controllers/level_0_input_controller\"\nimport Level2InputController from \"trix/controllers/level_2_input_controller\"\nimport CompositionController from \"trix/controllers/composition_controller\"\nimport ToolbarController from \"trix/controllers/toolbar_controller\"\nimport Composition from \"trix/models/composition\"\nimport Editor from \"trix/models/editor\"\nimport AttachmentManager from \"trix/models/attachment_manager\"\nimport SelectionManager from \"trix/models/selection_manager\"\n\nimport { getBlockConfig, objectsAreEqual, rangeIsCollapsed, rangesAreEqual } from \"trix/core/helpers\"\nimport { selectionChangeObserver } from \"trix/observers/selection_change_observer\"\n\nconst snapshotsAreEqual = (a, b) => rangesAreEqual(a.selectedRange, b.selectedRange) && a.document.isEqualTo(b.document)\n\nexport default class EditorController extends Controller {\n static actions = {\n undo: {\n test() {\n return this.editor.canUndo()\n },\n perform() {\n return this.editor.undo()\n },\n },\n redo: {\n test() {\n return this.editor.canRedo()\n },\n perform() {\n return this.editor.redo()\n },\n },\n link: {\n test() {\n return this.editor.canActivateAttribute(\"href\")\n },\n },\n increaseNestingLevel: {\n test() {\n return this.editor.canIncreaseNestingLevel()\n },\n perform() {\n return this.editor.increaseNestingLevel() && this.render()\n },\n },\n decreaseNestingLevel: {\n test() {\n return this.editor.canDecreaseNestingLevel()\n },\n perform() {\n return this.editor.decreaseNestingLevel() && this.render()\n },\n },\n attachFiles: {\n test() {\n return true\n },\n perform() {\n return config.input.pickFiles(this.editor.insertFiles)\n },\n },\n }\n\n constructor({ editorElement, document, html }) {\n super(...arguments)\n this.editorElement = editorElement\n this.selectionManager = new SelectionManager(this.editorElement)\n this.selectionManager.delegate = this\n\n this.composition = new Composition()\n this.composition.delegate = this\n\n this.attachmentManager = new AttachmentManager(this.composition.getAttachments())\n this.attachmentManager.delegate = this\n\n this.inputController =\n config.input.getLevel() === 2\n ? new Level2InputController(this.editorElement)\n : new Level0InputController(this.editorElement)\n\n this.inputController.delegate = this\n this.inputController.responder = this.composition\n\n this.compositionController = new CompositionController(this.editorElement, this.composition)\n this.compositionController.delegate = this\n\n this.toolbarController = new ToolbarController(this.editorElement.toolbarElement)\n this.toolbarController.delegate = this\n\n this.editor = new Editor(this.composition, this.selectionManager, this.editorElement)\n if (document) {\n this.editor.loadDocument(document)\n } else {\n this.editor.loadHTML(html)\n }\n }\n\n registerSelectionManager() {\n return selectionChangeObserver.registerSelectionManager(this.selectionManager)\n }\n\n unregisterSelectionManager() {\n return selectionChangeObserver.unregisterSelectionManager(this.selectionManager)\n }\n\n render() {\n return this.compositionController.render()\n }\n\n reparse() {\n return this.composition.replaceHTML(this.editorElement.innerHTML)\n }\n\n // Composition delegate\n\n compositionDidChangeDocument(document) {\n this.notifyEditorElement(\"document-change\")\n if (!this.handlingInput) {\n return this.render()\n }\n }\n\n compositionDidChangeCurrentAttributes(currentAttributes) {\n this.currentAttributes = currentAttributes\n this.toolbarController.updateAttributes(this.currentAttributes)\n this.updateCurrentActions()\n return this.notifyEditorElement(\"attributes-change\", { attributes: this.currentAttributes })\n }\n\n compositionDidPerformInsertionAtRange(range) {\n if (this.pasting) {\n this.pastedRange = range\n }\n }\n\n compositionShouldAcceptFile(file) {\n return this.notifyEditorElement(\"file-accept\", { file })\n }\n\n compositionDidAddAttachment(attachment) {\n const managedAttachment = this.attachmentManager.manageAttachment(attachment)\n return this.notifyEditorElement(\"attachment-add\", { attachment: managedAttachment })\n }\n\n compositionDidEditAttachment(attachment) {\n this.compositionController.rerenderViewForObject(attachment)\n const managedAttachment = this.attachmentManager.manageAttachment(attachment)\n this.notifyEditorElement(\"attachment-edit\", { attachment: managedAttachment })\n return this.notifyEditorElement(\"change\")\n }\n\n compositionDidChangeAttachmentPreviewURL(attachment) {\n this.compositionController.invalidateViewForObject(attachment)\n return this.notifyEditorElement(\"change\")\n }\n\n compositionDidRemoveAttachment(attachment) {\n const managedAttachment = this.attachmentManager.unmanageAttachment(attachment)\n return this.notifyEditorElement(\"attachment-remove\", { attachment: managedAttachment })\n }\n\n compositionDidStartEditingAttachment(attachment, options) {\n this.attachmentLocationRange = this.composition.document.getLocationRangeOfAttachment(attachment)\n this.compositionController.installAttachmentEditorForAttachment(attachment, options)\n return this.selectionManager.setLocationRange(this.attachmentLocationRange)\n }\n\n compositionDidStopEditingAttachment(attachment) {\n this.compositionController.uninstallAttachmentEditor()\n this.attachmentLocationRange = null\n }\n\n compositionDidRequestChangingSelectionToLocationRange(locationRange) {\n if (this.loadingSnapshot && !this.isFocused()) return\n this.requestedLocationRange = locationRange\n this.compositionRevisionWhenLocationRangeRequested = this.composition.revision\n if (!this.handlingInput) {\n return this.render()\n }\n }\n\n compositionWillLoadSnapshot() {\n this.loadingSnapshot = true\n }\n\n compositionDidLoadSnapshot() {\n this.compositionController.refreshViewCache()\n this.render()\n this.loadingSnapshot = false\n }\n\n getSelectionManager() {\n return this.selectionManager\n }\n\n // Attachment manager delegate\n\n attachmentManagerDidRequestRemovalOfAttachment(attachment) {\n return this.removeAttachment(attachment)\n }\n\n // Document controller delegate\n\n compositionControllerWillSyncDocumentView() {\n this.inputController.editorWillSyncDocumentView()\n this.selectionManager.lock()\n return this.selectionManager.clearSelection()\n }\n\n compositionControllerDidSyncDocumentView() {\n this.inputController.editorDidSyncDocumentView()\n this.selectionManager.unlock()\n this.updateCurrentActions()\n return this.notifyEditorElement(\"sync\")\n }\n\n compositionControllerDidRender() {\n if (this.requestedLocationRange) {\n if (this.compositionRevisionWhenLocationRangeRequested === this.composition.revision) {\n this.selectionManager.setLocationRange(this.requestedLocationRange)\n }\n this.requestedLocationRange = null\n this.compositionRevisionWhenLocationRangeRequested = null\n }\n\n if (this.renderedCompositionRevision !== this.composition.revision) {\n this.runEditorFilters()\n this.composition.updateCurrentAttributes()\n this.notifyEditorElement(\"render\")\n }\n\n this.renderedCompositionRevision = this.composition.revision\n }\n\n compositionControllerDidFocus() {\n if (this.isFocusedInvisibly()) {\n this.setLocationRange({ index: 0, offset: 0 })\n }\n this.toolbarController.hideDialog()\n return this.notifyEditorElement(\"focus\")\n }\n\n compositionControllerDidBlur() {\n return this.notifyEditorElement(\"blur\")\n }\n\n compositionControllerDidSelectAttachment(attachment, options) {\n this.toolbarController.hideDialog()\n return this.composition.editAttachment(attachment, options)\n }\n\n compositionControllerDidRequestDeselectingAttachment(attachment) {\n const locationRange = this.attachmentLocationRange || this.composition.document.getLocationRangeOfAttachment(attachment)\n return this.selectionManager.setLocationRange(locationRange[1])\n }\n\n compositionControllerWillUpdateAttachment(attachment) {\n return this.editor.recordUndoEntry(\"Edit Attachment\", { context: attachment.id, consolidatable: true })\n }\n\n compositionControllerDidRequestRemovalOfAttachment(attachment) {\n return this.removeAttachment(attachment)\n }\n\n // Input controller delegate\n\n inputControllerWillHandleInput() {\n this.handlingInput = true\n this.requestedRender = false\n }\n\n inputControllerDidRequestRender() {\n this.requestedRender = true\n }\n\n inputControllerDidHandleInput() {\n this.handlingInput = false\n if (this.requestedRender) {\n this.requestedRender = false\n return this.render()\n }\n }\n\n inputControllerDidAllowUnhandledInput() {\n return this.notifyEditorElement(\"change\")\n }\n\n inputControllerDidRequestReparse() {\n return this.reparse()\n }\n\n inputControllerWillPerformTyping() {\n return this.recordTypingUndoEntry()\n }\n\n inputControllerWillPerformFormatting(attributeName) {\n return this.recordFormattingUndoEntry(attributeName)\n }\n\n inputControllerWillCutText() {\n return this.editor.recordUndoEntry(\"Cut\")\n }\n\n inputControllerWillPaste(paste) {\n this.editor.recordUndoEntry(\"Paste\")\n this.pasting = true\n return this.notifyEditorElement(\"before-paste\", { paste })\n }\n\n inputControllerDidPaste(paste) {\n paste.range = this.pastedRange\n this.pastedRange = null\n this.pasting = null\n return this.notifyEditorElement(\"paste\", { paste })\n }\n\n inputControllerWillMoveText() {\n return this.editor.recordUndoEntry(\"Move\")\n }\n\n inputControllerWillAttachFiles() {\n return this.editor.recordUndoEntry(\"Drop Files\")\n }\n\n inputControllerWillPerformUndo() {\n return this.editor.undo()\n }\n\n inputControllerWillPerformRedo() {\n return this.editor.redo()\n }\n\n inputControllerDidReceiveKeyboardCommand(keys) {\n return this.toolbarController.applyKeyboardCommand(keys)\n }\n\n inputControllerDidStartDrag() {\n this.locationRangeBeforeDrag = this.selectionManager.getLocationRange()\n }\n\n inputControllerDidReceiveDragOverPoint(point) {\n return this.selectionManager.setLocationRangeFromPointRange(point)\n }\n\n inputControllerDidCancelDrag() {\n this.selectionManager.setLocationRange(this.locationRangeBeforeDrag)\n this.locationRangeBeforeDrag = null\n }\n\n // Selection manager delegate\n\n locationRangeDidChange(locationRange) {\n this.composition.updateCurrentAttributes()\n this.updateCurrentActions()\n if (this.attachmentLocationRange && !rangesAreEqual(this.attachmentLocationRange, locationRange)) {\n this.composition.stopEditingAttachment()\n }\n return this.notifyEditorElement(\"selection-change\")\n }\n\n // Toolbar controller delegate\n\n toolbarDidClickButton() {\n if (!this.getLocationRange()) {\n return this.setLocationRange({ index: 0, offset: 0 })\n }\n }\n\n toolbarDidInvokeAction(actionName, invokingElement) {\n return this.invokeAction(actionName, invokingElement)\n }\n\n toolbarDidToggleAttribute(attributeName) {\n this.recordFormattingUndoEntry(attributeName)\n this.composition.toggleCurrentAttribute(attributeName)\n this.render()\n if (!this.selectionFrozen) {\n return this.editorElement.focus()\n }\n }\n\n toolbarDidUpdateAttribute(attributeName, value) {\n this.recordFormattingUndoEntry(attributeName)\n this.composition.setCurrentAttribute(attributeName, value)\n this.render()\n if (!this.selectionFrozen) {\n return this.editorElement.focus()\n }\n }\n\n toolbarDidRemoveAttribute(attributeName) {\n this.recordFormattingUndoEntry(attributeName)\n this.composition.removeCurrentAttribute(attributeName)\n this.render()\n if (!this.selectionFrozen) {\n return this.editorElement.focus()\n }\n }\n\n toolbarWillShowDialog(dialogElement) {\n this.composition.expandSelectionForEditing()\n return this.freezeSelection()\n }\n\n toolbarDidShowDialog(dialogName) {\n return this.notifyEditorElement(\"toolbar-dialog-show\", { dialogName })\n }\n\n toolbarDidHideDialog(dialogName) {\n this.thawSelection()\n this.editorElement.focus()\n return this.notifyEditorElement(\"toolbar-dialog-hide\", { dialogName })\n }\n\n // Selection\n\n freezeSelection() {\n if (!this.selectionFrozen) {\n this.selectionManager.lock()\n this.composition.freezeSelection()\n this.selectionFrozen = true\n return this.render()\n }\n }\n\n thawSelection() {\n if (this.selectionFrozen) {\n this.composition.thawSelection()\n this.selectionManager.unlock()\n this.selectionFrozen = false\n return this.render()\n }\n }\n\n canInvokeAction(actionName) {\n if (this.actionIsExternal(actionName)) {\n return true\n } else {\n return !!this.actions[actionName]?.test?.call(this)\n }\n }\n\n invokeAction(actionName, invokingElement) {\n if (this.actionIsExternal(actionName)) {\n return this.notifyEditorElement(\"action-invoke\", { actionName, invokingElement })\n } else {\n return this.actions[actionName]?.perform?.call(this)\n }\n }\n\n actionIsExternal(actionName) {\n return /^x-./.test(actionName)\n }\n\n getCurrentActions() {\n const result = {}\n for (const actionName in this.actions) {\n result[actionName] = this.canInvokeAction(actionName)\n }\n return result\n }\n\n updateCurrentActions() {\n const currentActions = this.getCurrentActions()\n if (!objectsAreEqual(currentActions, this.currentActions)) {\n this.currentActions = currentActions\n this.toolbarController.updateActions(this.currentActions)\n return this.notifyEditorElement(\"actions-change\", { actions: this.currentActions })\n }\n }\n\n // Editor filters\n\n runEditorFilters() {\n let snapshot = this.composition.getSnapshot()\n\n Array.from(this.editor.filters).forEach((filter) => {\n const { document, selectedRange } = snapshot\n snapshot = filter.call(this.editor, snapshot) || {}\n if (!snapshot.document) {\n snapshot.document = document\n }\n if (!snapshot.selectedRange) {\n snapshot.selectedRange = selectedRange\n }\n })\n\n if (!snapshotsAreEqual(snapshot, this.composition.getSnapshot())) {\n return this.composition.loadSnapshot(snapshot)\n }\n }\n\n // Private\n\n updateInputElement() {\n const element = this.compositionController.getSerializableElement()\n const value = serializeToContentType(element, \"text/html\")\n return this.editorElement.setFormValue(value)\n }\n\n notifyEditorElement(message, data) {\n switch (message) {\n case \"document-change\":\n this.documentChangedSinceLastRender = true\n break\n case \"render\":\n if (this.documentChangedSinceLastRender) {\n this.documentChangedSinceLastRender = false\n this.notifyEditorElement(\"change\")\n }\n break\n case \"change\":\n case \"attachment-add\":\n case \"attachment-edit\":\n case \"attachment-remove\":\n this.updateInputElement()\n break\n }\n\n return this.editorElement.notify(message, data)\n }\n\n removeAttachment(attachment) {\n this.editor.recordUndoEntry(\"Delete Attachment\")\n this.composition.removeAttachment(attachment)\n return this.render()\n }\n\n recordFormattingUndoEntry(attributeName) {\n const blockConfig = getBlockConfig(attributeName)\n const locationRange = this.selectionManager.getLocationRange()\n if (blockConfig || !rangeIsCollapsed(locationRange)) {\n return this.editor.recordUndoEntry(\"Formatting\", { context: this.getUndoContext(), consolidatable: true })\n }\n }\n\n recordTypingUndoEntry() {\n return this.editor.recordUndoEntry(\"Typing\", {\n context: this.getUndoContext(this.currentAttributes),\n consolidatable: true,\n })\n }\n\n getUndoContext(...context) {\n return [ this.getLocationContext(), this.getTimeContext(), ...Array.from(context) ]\n }\n\n getLocationContext() {\n const locationRange = this.selectionManager.getLocationRange()\n if (rangeIsCollapsed(locationRange)) {\n return locationRange[0].index\n } else {\n return locationRange\n }\n }\n\n getTimeContext() {\n if (config.undo.interval > 0) {\n return Math.floor(new Date().getTime() / config.undo.interval)\n } else {\n return 0\n }\n }\n\n isFocused() {\n return this.editorElement === this.editorElement.ownerDocument?.activeElement\n }\n\n // Detect \"Cursor disappears sporadically\" Firefox bug.\n // - https://bugzilla.mozilla.org/show_bug.cgi?id=226301\n isFocusedInvisibly() {\n return this.isFocused() && !this.getLocationRange()\n }\n\n get actions() {\n return this.constructor.actions\n }\n}\n\nEditorController.proxyMethod(\"getSelectionManager().setLocationRange\")\nEditorController.proxyMethod(\"getSelectionManager().getLocationRange\")\n", "import * as config from \"trix/config\"\n\nimport { installDefaultCSSForTagName } from \"trix/core/helpers\"\n\ninstallDefaultCSSForTagName(\"trix-toolbar\", `\\\n%t {\n display: block;\n}\n\n%t {\n white-space: nowrap;\n}\n\n%t [data-trix-dialog] {\n display: none;\n}\n\n%t [data-trix-dialog][data-trix-active] {\n display: block;\n}\n\n%t [data-trix-dialog] [data-trix-validate]:invalid {\n background-color: #ffdddd;\n}`)\n\nexport default class TrixToolbarElement extends HTMLElement {\n\n // Element lifecycle\n\n connectedCallback() {\n if (this.innerHTML === \"\") {\n this.innerHTML = config.toolbar.getDefaultHTML()\n }\n }\n}\n", "import * as config from \"trix/config\"\n\nimport {\n findClosestElementFromNode,\n handleEvent,\n handleEventOnce,\n installDefaultCSSForTagName,\n makeElement,\n triggerEvent,\n} from \"trix/core/helpers\"\n\nimport { attachmentSelector } from \"trix/config/attachments\"\nimport EditorController from \"trix/controllers/editor_controller\"\nimport \"trix/elements/trix_toolbar_element\"\n\nlet id = 0\n\n// Contenteditable support helpers\n\nconst autofocus = function(element) {\n if (!document.querySelector(\":focus\")) {\n if (element.hasAttribute(\"autofocus\") && document.querySelector(\"[autofocus]\") === element) {\n return element.focus()\n }\n }\n}\n\nconst makeEditable = function(element) {\n if (element.hasAttribute(\"contenteditable\")) {\n return\n }\n element.setAttribute(\"contenteditable\", \"\")\n return handleEventOnce(\"focus\", {\n onElement: element,\n withCallback() {\n return configureContentEditable(element)\n },\n })\n}\n\nconst configureContentEditable = function(element) {\n disableObjectResizing(element)\n return setDefaultParagraphSeparator(element)\n}\n\nconst disableObjectResizing = function(element) {\n if (document.queryCommandSupported?.(\"enableObjectResizing\")) {\n document.execCommand(\"enableObjectResizing\", false, false)\n return handleEvent(\"mscontrolselect\", { onElement: element, preventDefault: true })\n }\n}\n\nconst setDefaultParagraphSeparator = function(element) {\n if (document.queryCommandSupported?.(\"DefaultParagraphSeparator\")) {\n const { tagName } = config.blockAttributes.default\n if ([ \"div\", \"p\" ].includes(tagName)) {\n return document.execCommand(\"DefaultParagraphSeparator\", false, tagName)\n }\n }\n}\n\n// Accessibility helpers\n\nconst addAccessibilityRole = function(element) {\n if (element.hasAttribute(\"role\")) {\n return\n }\n return element.setAttribute(\"role\", \"textbox\")\n}\n\nconst ensureAriaLabel = function(element) {\n if (element.hasAttribute(\"aria-label\") || element.hasAttribute(\"aria-labelledby\")) {\n return\n }\n\n const update = function() {\n const texts = Array.from(element.labels).map((label) => {\n if (!label.contains(element)) return label.textContent\n }).filter(text => text)\n\n const text = texts.join(\" \")\n if (text) {\n return element.setAttribute(\"aria-label\", text)\n } else {\n return element.removeAttribute(\"aria-label\")\n }\n }\n update()\n return handleEvent(\"focus\", { onElement: element, withCallback: update })\n}\n\n// Style\n\nconst cursorTargetStyles = (function() {\n if (config.browser.forcesObjectResizing) {\n return {\n display: \"inline\",\n width: \"auto\",\n }\n } else {\n return {\n display: \"inline-block\",\n width: \"1px\",\n }\n }\n})()\n\ninstallDefaultCSSForTagName(\"trix-editor\", `\\\n%t {\n display: block;\n}\n\n%t:empty::before {\n content: attr(placeholder);\n color: graytext;\n cursor: text;\n pointer-events: none;\n white-space: pre-line;\n}\n\n%t a[contenteditable=false] {\n cursor: text;\n}\n\n%t img {\n max-width: 100%;\n height: auto;\n}\n\n%t ${attachmentSelector} figcaption textarea {\n resize: none;\n}\n\n%t ${attachmentSelector} figcaption textarea.trix-autoresize-clone {\n position: absolute;\n left: -9999px;\n max-height: 0px;\n}\n\n%t ${attachmentSelector} figcaption[data-trix-placeholder]:empty::before {\n content: attr(data-trix-placeholder);\n color: graytext;\n}\n\n%t [data-trix-cursor-target] {\n display: ${cursorTargetStyles.display} !important;\n width: ${cursorTargetStyles.width} !important;\n padding: 0 !important;\n margin: 0 !important;\n border: none !important;\n}\n\n%t [data-trix-cursor-target=left] {\n vertical-align: top !important;\n margin-left: -1px !important;\n}\n\n%t [data-trix-cursor-target=right] {\n vertical-align: bottom !important;\n margin-right: -1px !important;\n}`)\n\nclass ElementInternalsDelegate {\n #internals\n\n constructor(element) {\n this.element = element\n this.#internals = element.attachInternals()\n }\n\n connectedCallback() {\n this.#validate()\n }\n\n disconnectedCallback() {\n }\n\n get labels() {\n return this.#internals.labels\n }\n\n get disabled() {\n return this.element.inputElement?.disabled\n }\n\n set disabled(value) {\n this.element.toggleAttribute(\"disabled\", value)\n }\n\n get required() {\n return this.element.hasAttribute(\"required\")\n }\n\n set required(value) {\n this.element.toggleAttribute(\"required\", value)\n this.#validate()\n }\n\n get validity() {\n return this.#internals.validity\n }\n\n get validationMessage() {\n return this.#internals.validationMessage\n }\n\n get willValidate() {\n return this.#internals.willValidate\n }\n\n setFormValue(value) {\n this.#validate()\n }\n\n checkValidity() {\n return this.#internals.checkValidity()\n }\n\n reportValidity() {\n return this.#internals.reportValidity()\n }\n\n setCustomValidity(validationMessage) {\n this.#validate(validationMessage)\n }\n\n #validate(customValidationMessage = \"\") {\n const { required, value } = this.element\n const valueMissing = required && !value\n const customError = !!customValidationMessage\n const input = makeElement(\"input\", { required })\n const validationMessage = customValidationMessage || input.validationMessage\n\n this.#internals.setValidity({ valueMissing, customError }, validationMessage)\n }\n}\n\nclass LegacyDelegate {\n #focusHandler\n\n constructor(element) {\n this.element = element\n }\n\n connectedCallback() {\n this.#focusHandler = ensureAriaLabel(this.element)\n window.addEventListener(\"reset\", this.#resetBubbled, false)\n window.addEventListener(\"click\", this.#clickBubbled, false)\n }\n\n disconnectedCallback() {\n this.#focusHandler?.destroy()\n window.removeEventListener(\"reset\", this.#resetBubbled, false)\n window.removeEventListener(\"click\", this.#clickBubbled, false)\n }\n\n get labels() {\n const labels = []\n if (this.element.id && this.element.ownerDocument) {\n labels.push(...Array.from(this.element.ownerDocument.querySelectorAll(`label[for='${this.element.id}']`) || []))\n }\n\n const label = findClosestElementFromNode(this.element, { matchingSelector: \"label\" })\n if (label) {\n if ([ this.element, null ].includes(label.control)) {\n labels.push(label)\n }\n }\n\n return labels\n }\n\n get disabled() {\n console.warn(\"This browser does not support the [disabled] attribute for trix-editor elements.\")\n\n return false\n }\n\n set disabled(value) {\n console.warn(\"This browser does not support the [disabled] attribute for trix-editor elements.\")\n }\n\n get required() {\n console.warn(\"This browser does not support the [required] attribute for trix-editor elements.\")\n\n return false\n }\n\n set required(value) {\n console.warn(\"This browser does not support the [required] attribute for trix-editor elements.\")\n }\n\n get validity() {\n console.warn(\"This browser does not support the validity property for trix-editor elements.\")\n return null\n }\n\n get validationMessage() {\n console.warn(\"This browser does not support the validationMessage property for trix-editor elements.\")\n\n return \"\"\n }\n\n get willValidate() {\n console.warn(\"This browser does not support the willValidate property for trix-editor elements.\")\n\n return false\n }\n\n setFormValue(value) {\n }\n\n checkValidity() {\n console.warn(\"This browser does not support checkValidity() for trix-editor elements.\")\n\n return true\n }\n\n reportValidity() {\n console.warn(\"This browser does not support reportValidity() for trix-editor elements.\")\n\n return true\n }\n\n setCustomValidity(validationMessage) {\n console.warn(\"This browser does not support setCustomValidity(validationMessage) for trix-editor elements.\")\n }\n\n #resetBubbled = (event) => {\n if (event.defaultPrevented) return\n if (event.target !== this.element.form) return\n this.element.reset()\n }\n\n #clickBubbled = (event) => {\n if (event.defaultPrevented) return\n if (this.element.contains(event.target)) return\n\n const label = findClosestElementFromNode(event.target, { matchingSelector: \"label\" })\n if (!label) return\n\n if (!Array.from(this.labels).includes(label)) return\n\n this.element.focus()\n }\n}\n\nexport default class TrixEditorElement extends HTMLElement {\n static formAssociated = \"ElementInternals\" in window\n\n #delegate\n\n constructor() {\n super()\n this.#delegate = this.constructor.formAssociated ?\n new ElementInternalsDelegate(this) :\n new LegacyDelegate(this)\n }\n\n // Properties\n\n get trixId() {\n if (this.hasAttribute(\"trix-id\")) {\n return this.getAttribute(\"trix-id\")\n } else {\n this.setAttribute(\"trix-id\", ++id)\n return this.trixId\n }\n }\n\n get labels() {\n return this.#delegate.labels\n }\n\n get disabled() {\n return this.#delegate.disabled\n }\n\n set disabled(value) {\n this.#delegate.disabled = value\n }\n\n get required() {\n return this.#delegate.required\n }\n\n set required(value) {\n this.#delegate.required = value\n }\n\n get validity() {\n return this.#delegate.validity\n }\n\n get validationMessage() {\n return this.#delegate.validationMessage\n }\n\n get willValidate() {\n return this.#delegate.willValidate\n }\n\n get type() {\n return this.localName\n }\n\n get toolbarElement() {\n if (this.hasAttribute(\"toolbar\")) {\n return this.ownerDocument?.getElementById(this.getAttribute(\"toolbar\"))\n } else if (this.parentNode) {\n const toolbarId = `trix-toolbar-${this.trixId}`\n this.setAttribute(\"toolbar\", toolbarId)\n const element = makeElement(\"trix-toolbar\", { id: toolbarId })\n this.parentNode.insertBefore(element, this)\n return element\n } else {\n return undefined\n }\n }\n\n get form() {\n return this.inputElement?.form\n }\n\n get inputElement() {\n if (this.hasAttribute(\"input\")) {\n return this.ownerDocument?.getElementById(this.getAttribute(\"input\"))\n } else if (this.parentNode) {\n const inputId = `trix-input-${this.trixId}`\n this.setAttribute(\"input\", inputId)\n const element = makeElement(\"input\", { type: \"hidden\", id: inputId })\n this.parentNode.insertBefore(element, this.nextElementSibling)\n return element\n } else {\n return undefined\n }\n }\n\n get editor() {\n return this.editorController?.editor\n }\n\n get name() {\n return this.inputElement?.name\n }\n\n get value() {\n return this.inputElement?.value\n }\n\n set value(defaultValue) {\n this.defaultValue = defaultValue\n this.editor?.loadHTML(this.defaultValue)\n }\n\n // Controller delegate methods\n\n notify(message, data) {\n if (this.editorController) {\n return triggerEvent(`trix-${message}`, { onElement: this, attributes: data })\n }\n }\n\n setFormValue(value) {\n if (this.inputElement) {\n this.inputElement.value = value\n this.#delegate.setFormValue(value)\n }\n }\n\n // Element lifecycle\n\n connectedCallback() {\n if (!this.hasAttribute(\"data-trix-internal\")) {\n makeEditable(this)\n addAccessibilityRole(this)\n\n if (!this.editorController) {\n triggerEvent(\"trix-before-initialize\", { onElement: this })\n this.editorController = new EditorController({\n editorElement: this,\n html: this.defaultValue = this.value,\n })\n requestAnimationFrame(() => triggerEvent(\"trix-initialize\", { onElement: this }))\n }\n this.editorController.registerSelectionManager()\n this.#delegate.connectedCallback()\n autofocus(this)\n }\n }\n\n disconnectedCallback() {\n this.editorController?.unregisterSelectionManager()\n this.#delegate.disconnectedCallback()\n }\n\n // Form support\n\n checkValidity() {\n return this.#delegate.checkValidity()\n }\n\n reportValidity() {\n return this.#delegate.reportValidity()\n }\n\n setCustomValidity(validationMessage) {\n this.#delegate.setCustomValidity(validationMessage)\n }\n\n formDisabledCallback(disabled) {\n if (this.inputElement) {\n this.inputElement.disabled = disabled\n }\n this.toggleAttribute(\"contenteditable\", !disabled)\n }\n\n formResetCallback() {\n this.reset()\n }\n\n reset() {\n this.value = this.defaultValue\n }\n}\n", "import { version } from \"../../package.json\"\n\nimport * as config from \"trix/config\"\nimport * as core from \"trix/core\"\nimport * as models from \"trix/models\"\nimport * as views from \"trix/views\"\nimport * as controllers from \"trix/controllers\"\nimport * as observers from \"trix/observers\"\nimport * as operations from \"trix/operations\"\nimport * as elements from \"trix/elements\"\nimport * as filters from \"trix/filters\"\n\nconst Trix = {\n VERSION: version,\n config,\n core,\n models,\n views,\n controllers,\n observers,\n operations,\n elements,\n filters\n}\n\n// Expose models under the Trix constant for compatibility with v1\nObject.assign(Trix, models)\n\nfunction start() {\n if (!customElements.get(\"trix-toolbar\")) {\n customElements.define(\"trix-toolbar\", elements.TrixToolbarElement)\n }\n\n if (!customElements.get(\"trix-editor\")) {\n customElements.define(\"trix-editor\", elements.TrixEditorElement)\n }\n}\n\nwindow.Trix = Trix\nsetTimeout(start, 0)\n\nexport default Trix\n", "var sparkMd5 = {\n exports: {}\n};\n\n(function(module, exports) {\n (function(factory) {\n {\n module.exports = factory();\n }\n })((function(undefined$1) {\n var hex_chr = [ \"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\" ];\n function md5cycle(x, k) {\n var a = x[0], b = x[1], c = x[2], d = x[3];\n a += (b & c | ~b & d) + k[0] - 680876936 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[1] - 389564586 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[2] + 606105819 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[3] - 1044525330 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[4] - 176418897 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[5] + 1200080426 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[6] - 1473231341 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[7] - 45705983 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[8] + 1770035416 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[9] - 1958414417 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[10] - 42063 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[11] - 1990404162 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[12] + 1804603682 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[13] - 40341101 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[14] - 1502002290 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[15] + 1236535329 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & d | c & ~d) + k[1] - 165796510 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[6] - 1069501632 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[11] + 643717713 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[0] - 373897302 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[5] - 701558691 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[10] + 38016083 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[15] - 660478335 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[4] - 405537848 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[9] + 568446438 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[14] - 1019803690 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[3] - 187363961 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[8] + 1163531501 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[13] - 1444681467 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[2] - 51403784 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[7] + 1735328473 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[12] - 1926607734 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b ^ c ^ d) + k[5] - 378558 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[8] - 2022574463 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[11] + 1839030562 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[14] - 35309556 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[1] - 1530992060 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[4] + 1272893353 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[7] - 155497632 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[10] - 1094730640 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[13] + 681279174 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[0] - 358537222 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[3] - 722521979 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[6] + 76029189 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[9] - 640364487 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[12] - 421815835 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[15] + 530742520 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[2] - 995338651 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (c ^ (b | ~d)) + k[0] - 198630844 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[7] + 1126891415 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[14] - 1416354905 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[5] - 57434055 | 0;\n b = (b << 21 | b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[12] + 1700485571 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[3] - 1894986606 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[10] - 1051523 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[1] - 2054922799 | 0;\n b = (b << 21 | b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[8] + 1873313359 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[15] - 30611744 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[6] - 1560198380 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[13] + 1309151649 | 0;\n b = (b << 21 | b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[4] - 145523070 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[11] - 1120210379 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[2] + 718787259 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[9] - 343485551 | 0;\n b = (b << 21 | b >>> 11) + c | 0;\n x[0] = a + x[0] | 0;\n x[1] = b + x[1] | 0;\n x[2] = c + x[2] | 0;\n x[3] = d + x[3] | 0;\n }\n function md5blk(s) {\n var md5blks = [], i;\n for (i = 0; i < 64; i += 4) {\n md5blks[i >> 2] = s.charCodeAt(i) + (s.charCodeAt(i + 1) << 8) + (s.charCodeAt(i + 2) << 16) + (s.charCodeAt(i + 3) << 24);\n }\n return md5blks;\n }\n function md5blk_array(a) {\n var md5blks = [], i;\n for (i = 0; i < 64; i += 4) {\n md5blks[i >> 2] = a[i] + (a[i + 1] << 8) + (a[i + 2] << 16) + (a[i + 3] << 24);\n }\n return md5blks;\n }\n function md51(s) {\n var n = s.length, state = [ 1732584193, -271733879, -1732584194, 271733878 ], i, length, tail, tmp, lo, hi;\n for (i = 64; i <= n; i += 64) {\n md5cycle(state, md5blk(s.substring(i - 64, i)));\n }\n s = s.substring(i - 64);\n length = s.length;\n tail = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ];\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= s.charCodeAt(i) << (i % 4 << 3);\n }\n tail[i >> 2] |= 128 << (i % 4 << 3);\n if (i > 55) {\n md5cycle(state, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n tmp = n * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n tail[14] = lo;\n tail[15] = hi;\n md5cycle(state, tail);\n return state;\n }\n function md51_array(a) {\n var n = a.length, state = [ 1732584193, -271733879, -1732584194, 271733878 ], i, length, tail, tmp, lo, hi;\n for (i = 64; i <= n; i += 64) {\n md5cycle(state, md5blk_array(a.subarray(i - 64, i)));\n }\n a = i - 64 < n ? a.subarray(i - 64) : new Uint8Array(0);\n length = a.length;\n tail = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ];\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= a[i] << (i % 4 << 3);\n }\n tail[i >> 2] |= 128 << (i % 4 << 3);\n if (i > 55) {\n md5cycle(state, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n tmp = n * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n tail[14] = lo;\n tail[15] = hi;\n md5cycle(state, tail);\n return state;\n }\n function rhex(n) {\n var s = \"\", j;\n for (j = 0; j < 4; j += 1) {\n s += hex_chr[n >> j * 8 + 4 & 15] + hex_chr[n >> j * 8 & 15];\n }\n return s;\n }\n function hex(x) {\n var i;\n for (i = 0; i < x.length; i += 1) {\n x[i] = rhex(x[i]);\n }\n return x.join(\"\");\n }\n if (hex(md51(\"hello\")) !== \"5d41402abc4b2a76b9719d911017c592\") ;\n if (typeof ArrayBuffer !== \"undefined\" && !ArrayBuffer.prototype.slice) {\n (function() {\n function clamp(val, length) {\n val = val | 0 || 0;\n if (val < 0) {\n return Math.max(val + length, 0);\n }\n return Math.min(val, length);\n }\n ArrayBuffer.prototype.slice = function(from, to) {\n var length = this.byteLength, begin = clamp(from, length), end = length, num, target, targetArray, sourceArray;\n if (to !== undefined$1) {\n end = clamp(to, length);\n }\n if (begin > end) {\n return new ArrayBuffer(0);\n }\n num = end - begin;\n target = new ArrayBuffer(num);\n targetArray = new Uint8Array(target);\n sourceArray = new Uint8Array(this, begin, num);\n targetArray.set(sourceArray);\n return target;\n };\n })();\n }\n function toUtf8(str) {\n if (/[\\u0080-\\uFFFF]/.test(str)) {\n str = unescape(encodeURIComponent(str));\n }\n return str;\n }\n function utf8Str2ArrayBuffer(str, returnUInt8Array) {\n var length = str.length, buff = new ArrayBuffer(length), arr = new Uint8Array(buff), i;\n for (i = 0; i < length; i += 1) {\n arr[i] = str.charCodeAt(i);\n }\n return returnUInt8Array ? arr : buff;\n }\n function arrayBuffer2Utf8Str(buff) {\n return String.fromCharCode.apply(null, new Uint8Array(buff));\n }\n function concatenateArrayBuffers(first, second, returnUInt8Array) {\n var result = new Uint8Array(first.byteLength + second.byteLength);\n result.set(new Uint8Array(first));\n result.set(new Uint8Array(second), first.byteLength);\n return returnUInt8Array ? result : result.buffer;\n }\n function hexToBinaryString(hex) {\n var bytes = [], length = hex.length, x;\n for (x = 0; x < length - 1; x += 2) {\n bytes.push(parseInt(hex.substr(x, 2), 16));\n }\n return String.fromCharCode.apply(String, bytes);\n }\n function SparkMD5() {\n this.reset();\n }\n SparkMD5.prototype.append = function(str) {\n this.appendBinary(toUtf8(str));\n return this;\n };\n SparkMD5.prototype.appendBinary = function(contents) {\n this._buff += contents;\n this._length += contents.length;\n var length = this._buff.length, i;\n for (i = 64; i <= length; i += 64) {\n md5cycle(this._hash, md5blk(this._buff.substring(i - 64, i)));\n }\n this._buff = this._buff.substring(i - 64);\n return this;\n };\n SparkMD5.prototype.end = function(raw) {\n var buff = this._buff, length = buff.length, i, tail = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], ret;\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= buff.charCodeAt(i) << (i % 4 << 3);\n }\n this._finish(tail, length);\n ret = hex(this._hash);\n if (raw) {\n ret = hexToBinaryString(ret);\n }\n this.reset();\n return ret;\n };\n SparkMD5.prototype.reset = function() {\n this._buff = \"\";\n this._length = 0;\n this._hash = [ 1732584193, -271733879, -1732584194, 271733878 ];\n return this;\n };\n SparkMD5.prototype.getState = function() {\n return {\n buff: this._buff,\n length: this._length,\n hash: this._hash.slice()\n };\n };\n SparkMD5.prototype.setState = function(state) {\n this._buff = state.buff;\n this._length = state.length;\n this._hash = state.hash;\n return this;\n };\n SparkMD5.prototype.destroy = function() {\n delete this._hash;\n delete this._buff;\n delete this._length;\n };\n SparkMD5.prototype._finish = function(tail, length) {\n var i = length, tmp, lo, hi;\n tail[i >> 2] |= 128 << (i % 4 << 3);\n if (i > 55) {\n md5cycle(this._hash, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n tmp = this._length * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n tail[14] = lo;\n tail[15] = hi;\n md5cycle(this._hash, tail);\n };\n SparkMD5.hash = function(str, raw) {\n return SparkMD5.hashBinary(toUtf8(str), raw);\n };\n SparkMD5.hashBinary = function(content, raw) {\n var hash = md51(content), ret = hex(hash);\n return raw ? hexToBinaryString(ret) : ret;\n };\n SparkMD5.ArrayBuffer = function() {\n this.reset();\n };\n SparkMD5.ArrayBuffer.prototype.append = function(arr) {\n var buff = concatenateArrayBuffers(this._buff.buffer, arr, true), length = buff.length, i;\n this._length += arr.byteLength;\n for (i = 64; i <= length; i += 64) {\n md5cycle(this._hash, md5blk_array(buff.subarray(i - 64, i)));\n }\n this._buff = i - 64 < length ? new Uint8Array(buff.buffer.slice(i - 64)) : new Uint8Array(0);\n return this;\n };\n SparkMD5.ArrayBuffer.prototype.end = function(raw) {\n var buff = this._buff, length = buff.length, tail = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], i, ret;\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= buff[i] << (i % 4 << 3);\n }\n this._finish(tail, length);\n ret = hex(this._hash);\n if (raw) {\n ret = hexToBinaryString(ret);\n }\n this.reset();\n return ret;\n };\n SparkMD5.ArrayBuffer.prototype.reset = function() {\n this._buff = new Uint8Array(0);\n this._length = 0;\n this._hash = [ 1732584193, -271733879, -1732584194, 271733878 ];\n return this;\n };\n SparkMD5.ArrayBuffer.prototype.getState = function() {\n var state = SparkMD5.prototype.getState.call(this);\n state.buff = arrayBuffer2Utf8Str(state.buff);\n return state;\n };\n SparkMD5.ArrayBuffer.prototype.setState = function(state) {\n state.buff = utf8Str2ArrayBuffer(state.buff, true);\n return SparkMD5.prototype.setState.call(this, state);\n };\n SparkMD5.ArrayBuffer.prototype.destroy = SparkMD5.prototype.destroy;\n SparkMD5.ArrayBuffer.prototype._finish = SparkMD5.prototype._finish;\n SparkMD5.ArrayBuffer.hash = function(arr, raw) {\n var hash = md51_array(new Uint8Array(arr)), ret = hex(hash);\n return raw ? hexToBinaryString(ret) : ret;\n };\n return SparkMD5;\n }));\n})(sparkMd5);\n\nvar SparkMD5 = sparkMd5.exports;\n\nconst fileSlice = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice;\n\nclass FileChecksum {\n static create(file, callback) {\n const instance = new FileChecksum(file);\n instance.create(callback);\n }\n constructor(file) {\n this.file = file;\n this.chunkSize = 2097152;\n this.chunkCount = Math.ceil(this.file.size / this.chunkSize);\n this.chunkIndex = 0;\n }\n create(callback) {\n this.callback = callback;\n this.md5Buffer = new SparkMD5.ArrayBuffer;\n this.fileReader = new FileReader;\n this.fileReader.addEventListener(\"load\", (event => this.fileReaderDidLoad(event)));\n this.fileReader.addEventListener(\"error\", (event => this.fileReaderDidError(event)));\n this.readNextChunk();\n }\n fileReaderDidLoad(event) {\n this.md5Buffer.append(event.target.result);\n if (!this.readNextChunk()) {\n const binaryDigest = this.md5Buffer.end(true);\n const base64digest = btoa(binaryDigest);\n this.callback(null, base64digest);\n }\n }\n fileReaderDidError(event) {\n this.callback(`Error reading ${this.file.name}`);\n }\n readNextChunk() {\n if (this.chunkIndex < this.chunkCount || this.chunkIndex == 0 && this.chunkCount == 0) {\n const start = this.chunkIndex * this.chunkSize;\n const end = Math.min(start + this.chunkSize, this.file.size);\n const bytes = fileSlice.call(this.file, start, end);\n this.fileReader.readAsArrayBuffer(bytes);\n this.chunkIndex++;\n return true;\n } else {\n return false;\n }\n }\n}\n\nfunction getMetaValue(name) {\n const element = findElement(document.head, `meta[name=\"${name}\"]`);\n if (element) {\n return element.getAttribute(\"content\");\n }\n}\n\nfunction findElements(root, selector) {\n if (typeof root == \"string\") {\n selector = root;\n root = document;\n }\n const elements = root.querySelectorAll(selector);\n return toArray(elements);\n}\n\nfunction findElement(root, selector) {\n if (typeof root == \"string\") {\n selector = root;\n root = document;\n }\n return root.querySelector(selector);\n}\n\nfunction dispatchEvent(element, type, eventInit = {}) {\n const {disabled: disabled} = element;\n const {bubbles: bubbles, cancelable: cancelable, detail: detail} = eventInit;\n const event = document.createEvent(\"Event\");\n event.initEvent(type, bubbles || true, cancelable || true);\n event.detail = detail || {};\n try {\n element.disabled = false;\n element.dispatchEvent(event);\n } finally {\n element.disabled = disabled;\n }\n return event;\n}\n\nfunction toArray(value) {\n if (Array.isArray(value)) {\n return value;\n } else if (Array.from) {\n return Array.from(value);\n } else {\n return [].slice.call(value);\n }\n}\n\nclass BlobRecord {\n constructor(file, checksum, url, customHeaders = {}) {\n this.file = file;\n this.attributes = {\n filename: file.name,\n content_type: file.type || \"application/octet-stream\",\n byte_size: file.size,\n checksum: checksum\n };\n this.xhr = new XMLHttpRequest;\n this.xhr.open(\"POST\", url, true);\n this.xhr.responseType = \"json\";\n this.xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n this.xhr.setRequestHeader(\"Accept\", \"application/json\");\n this.xhr.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\n Object.keys(customHeaders).forEach((headerKey => {\n this.xhr.setRequestHeader(headerKey, customHeaders[headerKey]);\n }));\n const csrfToken = getMetaValue(\"csrf-token\");\n if (csrfToken != undefined) {\n this.xhr.setRequestHeader(\"X-CSRF-Token\", csrfToken);\n }\n this.xhr.addEventListener(\"load\", (event => this.requestDidLoad(event)));\n this.xhr.addEventListener(\"error\", (event => this.requestDidError(event)));\n }\n get status() {\n return this.xhr.status;\n }\n get response() {\n const {responseType: responseType, response: response} = this.xhr;\n if (responseType == \"json\") {\n return response;\n } else {\n return JSON.parse(response);\n }\n }\n create(callback) {\n this.callback = callback;\n this.xhr.send(JSON.stringify({\n blob: this.attributes\n }));\n }\n requestDidLoad(event) {\n if (this.status >= 200 && this.status < 300) {\n const {response: response} = this;\n const {direct_upload: direct_upload} = response;\n delete response.direct_upload;\n this.attributes = response;\n this.directUploadData = direct_upload;\n this.callback(null, this.toJSON());\n } else {\n this.requestDidError(event);\n }\n }\n requestDidError(event) {\n this.callback(`Error creating Blob for \"${this.file.name}\". Status: ${this.status}`);\n }\n toJSON() {\n const result = {};\n for (const key in this.attributes) {\n result[key] = this.attributes[key];\n }\n return result;\n }\n}\n\nclass BlobUpload {\n constructor(blob) {\n this.blob = blob;\n this.file = blob.file;\n const {url: url, headers: headers} = blob.directUploadData;\n this.xhr = new XMLHttpRequest;\n this.xhr.open(\"PUT\", url, true);\n this.xhr.responseType = \"text\";\n for (const key in headers) {\n this.xhr.setRequestHeader(key, headers[key]);\n }\n this.xhr.addEventListener(\"load\", (event => this.requestDidLoad(event)));\n this.xhr.addEventListener(\"error\", (event => this.requestDidError(event)));\n }\n create(callback) {\n this.callback = callback;\n this.xhr.send(this.file.slice());\n }\n requestDidLoad(event) {\n const {status: status, response: response} = this.xhr;\n if (status >= 200 && status < 300) {\n this.callback(null, response);\n } else {\n this.requestDidError(event);\n }\n }\n requestDidError(event) {\n this.callback(`Error storing \"${this.file.name}\". Status: ${this.xhr.status}`);\n }\n}\n\nlet id = 0;\n\nclass DirectUpload {\n constructor(file, url, delegate, customHeaders = {}) {\n this.id = ++id;\n this.file = file;\n this.url = url;\n this.delegate = delegate;\n this.customHeaders = customHeaders;\n }\n create(callback) {\n FileChecksum.create(this.file, ((error, checksum) => {\n if (error) {\n callback(error);\n return;\n }\n const blob = new BlobRecord(this.file, checksum, this.url, this.customHeaders);\n notify(this.delegate, \"directUploadWillCreateBlobWithXHR\", blob.xhr);\n blob.create((error => {\n if (error) {\n callback(error);\n } else {\n const upload = new BlobUpload(blob);\n notify(this.delegate, \"directUploadWillStoreFileWithXHR\", upload.xhr);\n upload.create((error => {\n if (error) {\n callback(error);\n } else {\n callback(null, blob.toJSON());\n }\n }));\n }\n }));\n }));\n }\n}\n\nfunction notify(object, methodName, ...messages) {\n if (object && typeof object[methodName] == \"function\") {\n return object[methodName](...messages);\n }\n}\n\nclass DirectUploadController {\n constructor(input, file) {\n this.input = input;\n this.file = file;\n this.directUpload = new DirectUpload(this.file, this.url, this);\n this.dispatch(\"initialize\");\n }\n start(callback) {\n const hiddenInput = document.createElement(\"input\");\n hiddenInput.type = \"hidden\";\n hiddenInput.name = this.input.name;\n this.input.insertAdjacentElement(\"beforebegin\", hiddenInput);\n this.dispatch(\"start\");\n this.directUpload.create(((error, attributes) => {\n if (error) {\n hiddenInput.parentNode.removeChild(hiddenInput);\n this.dispatchError(error);\n } else {\n hiddenInput.value = attributes.signed_id;\n }\n this.dispatch(\"end\");\n callback(error);\n }));\n }\n uploadRequestDidProgress(event) {\n const progress = event.loaded / event.total * 100;\n if (progress) {\n this.dispatch(\"progress\", {\n progress: progress\n });\n }\n }\n get url() {\n return this.input.getAttribute(\"data-direct-upload-url\");\n }\n dispatch(name, detail = {}) {\n detail.file = this.file;\n detail.id = this.directUpload.id;\n return dispatchEvent(this.input, `direct-upload:${name}`, {\n detail: detail\n });\n }\n dispatchError(error) {\n const event = this.dispatch(\"error\", {\n error: error\n });\n if (!event.defaultPrevented) {\n alert(error);\n }\n }\n directUploadWillCreateBlobWithXHR(xhr) {\n this.dispatch(\"before-blob-request\", {\n xhr: xhr\n });\n }\n directUploadWillStoreFileWithXHR(xhr) {\n this.dispatch(\"before-storage-request\", {\n xhr: xhr\n });\n xhr.upload.addEventListener(\"progress\", (event => this.uploadRequestDidProgress(event)));\n }\n}\n\nconst inputSelector = \"input[type=file][data-direct-upload-url]:not([disabled])\";\n\nclass DirectUploadsController {\n constructor(form) {\n this.form = form;\n this.inputs = findElements(form, inputSelector).filter((input => input.files.length));\n }\n start(callback) {\n const controllers = this.createDirectUploadControllers();\n const startNextController = () => {\n const controller = controllers.shift();\n if (controller) {\n controller.start((error => {\n if (error) {\n callback(error);\n this.dispatch(\"end\");\n } else {\n startNextController();\n }\n }));\n } else {\n callback();\n this.dispatch(\"end\");\n }\n };\n this.dispatch(\"start\");\n startNextController();\n }\n createDirectUploadControllers() {\n const controllers = [];\n this.inputs.forEach((input => {\n toArray(input.files).forEach((file => {\n const controller = new DirectUploadController(input, file);\n controllers.push(controller);\n }));\n }));\n return controllers;\n }\n dispatch(name, detail = {}) {\n return dispatchEvent(this.form, `direct-uploads:${name}`, {\n detail: detail\n });\n }\n}\n\nconst processingAttribute = \"data-direct-uploads-processing\";\n\nconst submitButtonsByForm = new WeakMap;\n\nlet started = false;\n\nfunction start() {\n if (!started) {\n started = true;\n document.addEventListener(\"click\", didClick, true);\n document.addEventListener(\"submit\", didSubmitForm, true);\n document.addEventListener(\"ajax:before\", didSubmitRemoteElement);\n }\n}\n\nfunction didClick(event) {\n const button = event.target.closest(\"button, input\");\n if (button && button.type === \"submit\" && button.form) {\n submitButtonsByForm.set(button.form, button);\n }\n}\n\nfunction didSubmitForm(event) {\n handleFormSubmissionEvent(event);\n}\n\nfunction didSubmitRemoteElement(event) {\n if (event.target.tagName == \"FORM\") {\n handleFormSubmissionEvent(event);\n }\n}\n\nfunction handleFormSubmissionEvent(event) {\n const form = event.target;\n if (form.hasAttribute(processingAttribute)) {\n event.preventDefault();\n return;\n }\n const controller = new DirectUploadsController(form);\n const {inputs: inputs} = controller;\n if (inputs.length) {\n event.preventDefault();\n form.setAttribute(processingAttribute, \"\");\n inputs.forEach(disable);\n controller.start((error => {\n form.removeAttribute(processingAttribute);\n if (error) {\n inputs.forEach(enable);\n } else {\n submitForm(form);\n }\n }));\n }\n}\n\nfunction submitForm(form) {\n let button = submitButtonsByForm.get(form) || findElement(form, \"input[type=submit], button[type=submit]\");\n if (button) {\n const {disabled: disabled} = button;\n button.disabled = false;\n button.focus();\n button.click();\n button.disabled = disabled;\n } else {\n button = document.createElement(\"input\");\n button.type = \"submit\";\n button.style.display = \"none\";\n form.appendChild(button);\n button.click();\n form.removeChild(button);\n }\n submitButtonsByForm.delete(form);\n}\n\nfunction disable(input) {\n input.disabled = true;\n}\n\nfunction enable(input) {\n input.disabled = false;\n}\n\nfunction autostart() {\n if (window.ActiveStorage) {\n start();\n }\n}\n\nsetTimeout(autostart, 1);\n\nclass AttachmentUpload {\n constructor(attachment, element) {\n this.attachment = attachment;\n this.element = element;\n this.directUpload = new DirectUpload(attachment.file, this.directUploadUrl, this);\n }\n start() {\n this.directUpload.create(this.directUploadDidComplete.bind(this));\n this.dispatch(\"start\");\n }\n directUploadWillStoreFileWithXHR(xhr) {\n xhr.upload.addEventListener(\"progress\", (event => {\n const progress = event.loaded / event.total * 100;\n this.attachment.setUploadProgress(progress);\n if (progress) {\n this.dispatch(\"progress\", {\n progress: progress\n });\n }\n }));\n }\n directUploadDidComplete(error, attributes) {\n if (error) {\n this.dispatchError(error);\n } else {\n this.attachment.setAttributes({\n sgid: attributes.attachable_sgid,\n url: this.createBlobUrl(attributes.signed_id, attributes.filename)\n });\n this.dispatch(\"end\");\n }\n }\n createBlobUrl(signedId, filename) {\n return this.blobUrlTemplate.replace(\":signed_id\", signedId).replace(\":filename\", encodeURIComponent(filename));\n }\n dispatch(name, detail = {}) {\n detail.attachment = this.attachment;\n return dispatchEvent(this.element, `direct-upload:${name}`, {\n detail: detail\n });\n }\n dispatchError(error) {\n const event = this.dispatch(\"error\", {\n error: error\n });\n if (!event.defaultPrevented) {\n alert(error);\n }\n }\n get directUploadUrl() {\n return this.element.dataset.directUploadUrl;\n }\n get blobUrlTemplate() {\n return this.element.dataset.blobUrlTemplate;\n }\n}\n\naddEventListener(\"trix-attachment-add\", (event => {\n const {attachment: attachment, target: target} = event;\n if (attachment.file) {\n const upload = new AttachmentUpload(attachment, target);\n upload.start();\n }\n}));\n"], "mappings": ";;;;;;;;;;;AAAA,IAAO;AAAP;AAAA;AAAA,IAAO,mBAAQ;AAAA,MACb,QAAQ,OAAO,YAAY,cAAc,UAAU;AAAA,MACnD,WAAW,OAAO,cAAc,cAAc,YAAY;AAAA,IAC5D;AAAA;AAAA;;;ACHA,IAcO;AAdP;AAAA;AAAA;AAcA,IAAO,iBAAQ;AAAA,MACb,OAAO,UAAU;AACf,YAAI,KAAK,SAAS;AAChB,mBAAS,KAAK,KAAK,IAAI,CAAC;AACxB,2BAAS,OAAO,IAAI,iBAAiB,GAAG,QAAQ;AAAA,QAClD;AAAA,MACF;AAAA,IACF;AAAA;AAAA;;;ACrBA,IAKM,KAEA,cAEA,mBAkHC;AA3HP;AAAA;AAAA;AAKA,IAAM,MAAM,OAAM,oBAAI,KAAK,GAAE,QAAQ;AAErC,IAAM,eAAe,WAAS,IAAI,IAAI,QAAQ;AAE9C,IAAM,oBAAN,MAAwB;AAAA,MACtB,YAAY,YAAY;AACtB,aAAK,sBAAsB,KAAK,oBAAoB,KAAK,IAAI;AAC7D,aAAK,aAAa;AAClB,aAAK,oBAAoB;AAAA,MAC3B;AAAA,MAEA,QAAQ;AACN,YAAI,CAAC,KAAK,UAAU,GAAG;AACrB,eAAK,YAAY,IAAI;AACrB,iBAAO,KAA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S,SAAS;AAAA,MACnC,OAAOA;AAAA,IACT,CAAC;AACD,QAAI,CAAC,MAAM,kBAAkB;AAC3B,YAAMA,MAAK;AAAA,IACb;AAAA,EACF;AAAA,EACA,IAAI,kBAAkB;AACpB,WAAO,KAAK,QAAQ,QAAQ;AAAA,EAC9B;AAAA,EACA,IAAI,kBAAkB;AACpB,WAAO,KAAK,QAAQ,QAAQ;AAAA,EAC9B;AACF;AAEA,iBAAiB,uBAAwB,WAAS;AAChD,QAAM,EAAC,YAAwB,OAAc,IAAI;AACjD,MAAI,WAAW,MAAM;AACnB,UAAM,SAAS,IAAI,iBAAiB,YAAY,MAAM;AACtD,WAAO,MAAM;AAAA,EACf;AACF,CAAE;", "names": ["consumer", "error", "consumer", "s", "consumer", "s", "subscription", "a", "submitter", "i", "_", "fn", "config", "location", "error", "cookie", "id", "x", "y", "morphChildren", "potentialMatch", "session", "visit", "recentRequests", "Turbo", "document", "e", "c", "createConsumer", "m", "x", "submitter", "application", "error", "_", "e", "match", "oldValue", "_", "error", "constructor", "extend", "a", "b", "application", "element", "c", "n", "k", "v", "t", "s", "e", "a", "o", "r", "attachmentSelector", "attachments", "preview", "presentation", "caption", "name", "size", "file", "attributes", "default", "tagName", "parse", "quote", "nestable", "heading1", "terminal", "breakOnReturn", "group", "code", "htmlAttributes", "text", "plaintext", "bulletList", "bullet", "listAttribute", "test", "element", "parentNode", "this", "numberList", "number", "attachmentGallery", "exclusive", "_element$tagName", "toLowerCase", "androidVersionMatch", "navigator", "userAgent", "match", "androidVersion", "parseInt", "browser$1", "composesExistingText", "recentAndroid", "samsungAndroid", "forcesObjectResizing", "supportsInputEvents", "InputEvent", "every", "prop", "prototype", "lang$1", "attachFiles", "bold", "bullets", "byte", "bytes", "captionPlaceholder", "indent", "italic", "link", "numbers", "outdent", "redo", "remove", "strike", "undo", "unlink", "url", "urlPlaceholder", "GB", "KB", "MB", "PB", "TB", "sizes", "lang", "file_size_formatting", "prefix", "precision", "formatter", "concat", "base", "exp", "Math", "floor", "log", "withoutInsignificantZeros", "pow", "toFixed", "replace", "ZERO_WIDTH_SPACE", "NON_BREAKING_SPACE", "extend", "properties", "key", "value", "html", "document", "documentElement", "matches", "handleEvent", "eventName", "onElement", "matchingSelector", "withCallback", "inPhase", "preventDefault", "times", "arguments", "length", "undefined", "selector", "useCapture", "handler", "event", "destroy", "target", "findClosestElementFromNode", "call", "removeEventListener", "addEventListener", "triggerEvent", "bubbles", "cancelable", "createEvent", "initEvent", "dispatchEvent", "elementMatchesSelector", "nodeType", "node", "untilNode", "Node", "ELEMENT_NODE", "closest", "innerElementIsActive", "activeElement", "elementContainsNode", "findChildIndexOfNode", "_node", "childIndex", "previousSibling", "removeNode", "_node$parentNode", "removeChild", "walkTree", "tree", "onlyNodesOfType", "usingFilter", "expandEntityReferences", "whatToShow", "NodeFilter", "SHOW_ELEMENT", "SHOW_TEXT", "SHOW_COMMENT", "SHOW_ALL", "createTreeWalker", "makeElement", "tag", "options", "createElement", "editable", "contenteditable", "setAttribute", "style", "data", "dataset", "className", "split", "forEach", "classList", "add", "textContent", "childNodes", "childNode", "appendChild", "blockTagNames", "getBlockTagNames", "blockAttributes", "push", "nodeIsBlockContainer", "nodeIsBlockStartComment", "firstChild", "nodeIsBlockStart", "strict", "includes", "nodeIsCommentNode", "COMMENT_NODE", "nodeIsCursorTarget", "nodeIsTextNode", "trixCursorTarget", "nodeIsAttachmentElement", "nodeIsEmptyTextNode", "TEXT_NODE", "input", "level2Enabled", "getLevel", "browser", "pickFiles", "callback", "type", "multiple", "hidden", "id", "fileInputId", "files", "getElementById", "body", "click", "parser", "removeBlankTableCells", "tableCellSeparator", "tableRowSeparator", "text_attributes", "inheritable", "window", "getComputedStyle", "fontWeight", "fontStyle", "href", "groupTagName", "getAttribute", "frozen", "backgroundColor", "toolbar", "getDefaultHTML", "interval", "i", "n", "attachment", "attachmentCaption", "attachmentCaptionEditor", "attachmentMetadata", "attachmentMetadataContainer", "attachmentName", "attachmentProgress", "attachmentSize", "attachmentToolbar", "u", "l", "V", "BasicObject", "expression", "toMethod", "toProperty", "optional", "parseProxyMethodExpression", "subject", "object", "_this$toMethod", "_object", "apply", "proxyMethodExpressionPattern", "Error", "args", "Function", "RegExp", "UTF16String", "box", "fromUCS2String", "toString", "ucs2String", "ucs2decode", "codepoints", "ucs2encode", "constructor", "super", "ucs2Length", "offsetToUCS2Offset", "offset", "slice", "max", "offsetFromUCS2Offset", "ucs2Offset", "fromCodepoints", "charAt", "isEqualTo", "toJSON", "getCacheKey", "hasArrayFrom", "_Array$from", "Array", "from", "hasStringCodePointAt", "_$codePointAt", "codePointAt", "hasStringFromCodePoint", "_String$fromCodePoint", "String", "fromCodePoint", "string", "map", "char", "output", "counter", "charCodeAt", "extra", "array", "result", "fromCharCode", "join", "TrixObject", "jsonString", "fromJSON", "JSON", "hasSameConstructorAs", "inspect", "parts", "contents", "contentsForInspection", "toJSONString", "stringify", "toUTF16String", "arraysAreEqual", "a", "b", "index", "spliceArray", "_len", "_key", "splice", "RTL_PATTERN", "getDirection", "dir", "dirName", "textArea", "form", "supportsDirName", "FormData", "has", "error", "supportsDirSelector", "get", "trim", "allAttributeNames", "blockAttributeNames", "textAttributeNames", "listAttributeNames", "getAllAttributeNames", "getTextAttributeNames", "getBlockAttributeNames", "getBlockConfig", "attributeName", "config", "Object", "keys", "getTextConfig", "installDefaultCSSForTagName", "defaultCSS", "insertStyleElementForTagName", "nonce", "getCSPNonce", "head", "insertBefore", "getMetaElement", "content", "querySelector", "testTransferData", "dataTransferIsPlainText", "dataTransfer", "getData", "DOMParser", "parseFromString", "keyEventIsKeyboardCommand", "platform", "metaKey", "ctrlKey", "defer", "fn", "setTimeout", "copyObject", "objectsAreEqual", "normalizeRange", "range", "isArray", "copyValue", "rangeIsCollapsed", "start", "end", "rangeValuesAreEqual", "rangesAreEqual", "leftRange", "rightRange", "leftStart", "leftEnd", "rightStart", "rightEnd", "left", "right", "SelectionChangeObserver", "update", "bind", "selectionManagers", "started", "stop", "registerSelectionManager", "selectionManager", "unregisterSelectionManager", "filter", "sm", "notifySelectionManagersOfSelectionChange", "selectionDidChange", "reset", "selectionChangeObserver", "getDOMSelection", "selection", "getSelection", "rangeCount", "getDOMRange", "_getDOMSelection", "domRange", "getRangeAt", "domRangeIsPrivate", "setDOMRange", "removeAllRanges", "addRange", "nodeIsPrivate", "startContainer", "endContainer", "getPrototypeOf", "normalizeSpaces", "breakableWhitespacePattern", "squishBreakableWhitespace", "source", "utf16StringDifferences", "diffA", "utf16StringDifference", "utf16String", "diffB", "leftIndex", "rightIndexA", "rightIndexB", "Hash", "fromCommonAttributesOfObjects", "objects", "hash", "getKeys", "getKeysCommonToHash", "values", "copy", "merge", "unbox", "toArray", "isEmpty", "toObject", "keyToRemove", "sort", "ObjectGroup", "groupObjects", "ungroupedObjects", "depth", "asTree", "_object$canBeGrouped2", "_object$canBeGrouped", "_group$canBeGroupedWi", "_group", "canBeGrouped", "canBeGroupedWith", "getObjects", "getDepth", "ObjectMap", "find", "ElementStore", "elements", "getKey", "trixStoreKey", "Operation", "isPerforming", "performing", "hasPerformed", "performed", "hasSucceeded", "succeeded", "hasFailed", "getPromise", "promise", "Promise", "resolve", "reject", "perform", "release", "_this$promise", "_this$promise$cancel", "cancel", "proxyMethod", "ObjectView", "childViews", "rootView", "getNodes", "nodes", "createNodes", "cloneNode", "invalidate", "_this$parentView", "parentView", "invalidateViewForObject", "_this$findViewForObje", "findViewForObject", "findOrCreateCachedChildView", "viewClass", "view", "getCachedViewForObject", "recordChildView", "createChildView", "cacheViewForObject", "ObjectGroupView", "getAllChildViews", "views", "childView", "findElement", "findElementForObject", "getViewCache", "isViewCachingEnabled", "viewCache", "shouldCacheViews", "enableViewCaching", "disableViewCaching", "_this$getViewCache", "cache", "garbageCollectCachedViews", "objectKeys", "objectGroup", "getChildViews", "createContainerElement", "DEFAULT_ALLOWED_ATTRIBUTES", "DEFAULT_FORBIDDEN_PROTOCOLS", "DEFAULT_FORBIDDEN_ELEMENTS", "HTMLSanitizer", "sanitizedElement", "sanitize", "sanitizedHtml", "getHTML", "outerHTML", "innerHTML", "sanitizer", "allowedAttributes", "forbiddenProtocols", "forbiddenElements", "createBodyElementForHTML", "sanitizeElements", "normalizeListElementNesting", "getBody", "walker", "nodesToRemove", "nextNode", "currentNode", "elementIsRemovable", "sanitizeElement", "hasAttribute", "protocol", "removeAttribute", "_ref", "indexOf", "querySelectorAll", "listElement", "previousElement", "previousElementSibling", "elementIsForbidden", "elementIsntSerializable", "doc", "implementation", "createHTMLDocument", "css", "AttachmentView", "uploadProgressDelegate", "attachmentPiece", "piece", "createContentNodes", "innerElement", "figure", "getClassName", "getHref", "tabindex", "hasContent", "setHTML", "getContent", "createCaptionElement", "isPending", "progressElement", "class", "getUploadProgress", "trixMutable", "createCursorTarget", "figcaption", "getCaption", "captionConfig", "getCaptionConfig", "getFilename", "getFormattedFilesize", "nameElement", "createTextNode", "sizeElement", "names", "getType", "extension", "getExtension", "trixAttachment", "trixContentType", "getContentType", "trixId", "trixAttributes", "trixSerialize", "htmlContainsTagName", "_config$attachments$t", "findProgressElement", "_this$findElement", "attachmentDidChangeUploadProgress", "div", "PreviewableAttachmentView", "previewDelegate", "image", "src", "refresh", "updateAttributesForImage", "getURL", "previewURL", "getPreviewURL", "serializedAttributes", "width", "getWidth", "height", "getHeight", "storeKey", "attachmentDidChangeAttributes", "PieceView", "getAttributes", "textConfig", "context", "createAttachmentNodes", "createStringNodes", "_element", "firstElementChild", "isPreviewable", "_this$textConfig", "iterable", "substring", "preserveSpaces", "styles", "pendingElement", "styleProperty", "isLast", "isFirst", "followsWhitespace", "TextView", "pieces", "getPieces", "lastIndex", "endsWithWhitespace", "previousPiece", "BlockView", "block", "createComment", "_getBlockConfig", "getLastAttribute", "textView", "shouldAddExtraNewlineElement", "isRTL", "assign", "getBlockBreakPosition", "entries", "DocumentView", "render", "sync", "elementStore", "setDocument", "shadowElement", "getBlocks", "isSynced", "elementsHaveEqualHTML", "fragment", "createDocumentFragmentForSync", "lastChild", "didSync", "findStoredElements", "createDocumentFragment", "storedElement", "replaceChild", "otherElement", "ignoreSpaces", "t", "e", "o", "s", "r", "Piece", "types", "pieceJSON", "copyWithAttributes", "getValue", "copyWithAdditionalAttributes", "copyWithoutAttribute", "attribute", "getAttributesHash", "hasSameStringValueAsPiece", "hasSameAttributesAsPiece", "isBlockBreak", "isSerializable", "getLength", "canBeConsolidatedWith", "_defineProperty", "ImagePreloadOperation", "Image", "onload", "naturalWidth", "naturalHeight", "onerror", "Attachment", "attributesForFile", "setFile", "filename", "filesize", "contentType", "attachmentJSON", "releaseFile", "didChangeAttributes", "setAttributes", "newAttributes", "_this$previewDelegate", "_this$previewDelegate2", "_this$delegate", "_this$delegate$attach", "delegate", "preloadURL", "previewablePattern", "getFilesize", "_this$getFilename$mat", "getFile", "preloadFile", "releasePreloadedFile", "uploadProgress", "setUploadProgress", "_this$uploadProgressD", "_this$uploadProgressD2", "preloadingURL", "setPreviewURL", "_this$previewDelegate3", "_this$previewDelegate4", "_this$delegate2", "_this$delegate2$attac", "attachmentDidChangePreviewURL", "preload", "fileObjectURL", "URL", "createObjectURL", "revokeObjectURL", "then", "catch", "AttachmentPiece", "ensureAttachmentExclusivelyHasAttribute", "removeProhibitedAttributes", "permittedAttributes", "_piece$attachment", "json", "toConsole", "registerType", "StringPiece", "consolidateWith", "splitAtOffset", "SplittableList", "eachObject", "insertObjectAtIndex", "insertSplittableListAtIndex", "splittableList", "insertSplittableListAtPosition", "position", "splitObjectAtPosition", "editObjectAtIndex", "replaceObjectAtIndex", "removeObjectAtIndex", "getObjectAtIndex", "getSplittableListInRange", "rightIndex", "splitObjectsAtRange", "selectSplittableList", "removeObjectsInRange", "transformObjectsInRange", "transform", "transformedObjects", "rightOuterIndex", "leftInnerIndex", "startOfRange", "endOfRange", "getObjectAtPosition", "findIndexAndOffsetAtPosition", "splitIndex", "splitOffset", "leftObject", "rightObject", "consolidate", "pendingObject", "_pendingObject$canBeC", "_pendingObject", "consolidateFromIndexToIndex", "startIndex", "endIndex", "objectsInRange", "consolidatedInRange", "currentPosition", "nextPosition", "findPositionAtIndexAndOffset", "currentIndex", "getEndPosition", "endPosition", "objectArraysAreEqual", "Text", "textJSON", "notEmpty", "pieceList", "copyWithPieceList", "copyUsingObjectMap", "objectMap", "appendText", "insertTextAtPosition", "removeTextAtRange", "replaceTextAtRange", "moveTextFromRangeToPosition", "getTextAtRange", "addAttributeAtRange", "addAttributesAtRange", "removeAttributeAtRange", "setAttributesAtRange", "getAttributesAtPosition", "_this$pieceList$getOb", "getCommonAttributes", "getCommonAttributesAtRange", "getExpandedRangeForAttributeAtOffset", "getStringAtRange", "getStringAtPosition", "startsWithString", "endsWithString", "getAttachmentPieces", "getAttachments", "getAttachmentAndPositionById", "attachmentId", "getAttachmentById", "getRangeOfAttachment", "attachmentAndPosition", "updateAttributesForAttachment", "_text$pieceList", "eachPiece", "getPieceAtPosition", "toSerializableText", "Block", "blockJSON", "applyBlockBreakToText", "copyWithText", "copyWithoutText", "copyWithoutAttributes", "mappedText", "addAttribute", "expandAttribute", "addHTMLAttribute", "removeLastValue", "removeLastAttribute", "getLastElement", "getAttributeLevel", "getAttributeAtLevel", "level", "hasAttributes", "getLastNestableAttribute", "getNestableAttributes", "getNestingLevel", "decreaseNestingLevel", "increaseNestingLevel", "lastIndexOf", "getListItemAttributes", "isListItem", "isTerminalBlock", "_getBlockConfig2", "breaksOnReturn", "_getBlockConfig3", "findLineBreakInDirectionFromPosition", "direction", "newlineText", "textForStringWithAttributes", "getTextWithoutBlockBreak", "textEndsInBlockBreak", "otherBlock", "otherAttributes", "otherAttribute", "getListAttributeNames", "unmarkExistingInnerBlockBreaksInText", "addBlockBreakToText", "modified", "innerPieces", "lastPiece", "unmarkBlockBreakPiece", "blockBreakText", "blockBreak", "Document", "documentJSON", "textAttributes", "blocks", "blockList", "getBlockAtIndex", "consolidateBlocks", "copyUsingObjectsFromDocument", "sourceDocument", "copyWithBaseBlockAttributes", "replaceBlock", "oldBlock", "newBlock", "insertDocumentAtRange", "locationFromPosition", "getBlockAtPosition", "mergeDocumentAtRange", "formattedDocument", "startPosition", "startLocation", "baseBlockAttributes", "getBaseBlockAttributes", "trailingBlockAttributes", "leadingBlockAttributes", "blockCount", "getBlockCount", "firstBlock", "firstText", "insertTextAtRange", "leftPosition", "rightPosition", "leftLocation", "rightLocation", "locationRangeFromRange", "leftOffset", "leftBlock", "rightOffset", "rightBlock", "leftText", "rightText", "affectedBlockCount", "getDocumentAtRange", "movingRightward", "eachBlockAtRange", "textRange", "eachBlock", "getTextAtIndex", "removeAttributeForAttachment", "setHTMLAttributeAtPosition", "updatedBlock", "insertBlockBreakAtRange", "applyBlockAttributeAtRange", "expanded", "expandRangeToLineBreaksAndSplitBlocks", "blockConfig", "removeLastListAttributeAtRange", "exceptAttributeName", "converted", "convertLineBreaksToBlockBreaksInRange", "removeBlockAttributesAtRange", "removeLastTerminalAttributeAtRange", "consolidateBlocksAtRange", "lastAttributeName", "endLocation", "startBlock", "positionFromLocation", "endBlock", "_this$getBlockAtIndex", "getTextAtPosition", "getCharacterAtPosition", "getEditCount", "editCount", "getCommonAttributesAtPosition", "attributesForBlock", "commonAttributes", "attributesLeft", "inheritableAttributes", "getRangeOfCommonAttributeAtPosition", "startOffset", "endOffset", "blockIndex", "lastAttributeIndex", "min", "attachmentPieces", "getLocationRangeOfAttachment", "getAttachmentPieceForAttachment", "findRangesForBlockAttribute", "ranges", "findRangesForTextAttribute", "withValue", "location", "locationRangeFromPosition", "rangeFromLocationRange", "locationRange", "getTexts", "toSerializableDocument", "pieceForString", "parseTrixDataAttribute", "HTMLParser", "referenceElement", "blockElements", "processedElements", "getDocument", "createHiddenContainer", "containerElement", "nodeFilter", "processNode", "translateBlockElementMarginsToNewlines", "removeHiddenContainer", "display", "nextSibling", "isInsignificantTextNode", "appendBlockForTextNode", "processTextNode", "appendBlockForElement", "processElement", "currentBlockElement", "isBlockElement", "appendStringWithAttributes", "_this$currentBlock", "getBlockAttributes", "getBlockHTMLAttributes", "currentBlock", "appendBlockForAttributesWithElement", "elementIsBlockElement", "currentBlockContainsElement", "parentBlockElement", "findParentBlockElement", "appendEmptyBlock", "parentElement", "_node$previousSibling", "elementCanDisplayPreformattedText", "stringEndsWithWhitespace", "leftTrimBreakableWhitespace", "getTextAttributes", "appendAttachmentWithAttributes", "isExtraBR", "dimensions", "needsTableSeparator", "appendPiece", "appendStringToTextAtIndex", "prependStringToTextAtIndex", "unshift", "configAttr", "attributeInheritedFromBlock", "blockElement", "findBlockElementAncestors", "attrConfig", "_attrConfig$test", "reverse", "settings", "ancestors", "stringIsAllBreakableWhitespace", "nodeEndsWithNonWhitespace", "_element$previousSibl", "defaultMargin", "getMarginOfDefaultBlockElement", "margin", "getMarginOfBlockElementAtIndex", "top", "bottom", "getBlockElementMargin", "whiteSpace", "marginTop", "marginBottom", "FILTER_REJECT", "FILTER_ACCEPT", "unserializableAttributeNames", "serializedAttributesAttribute", "serializedAttributesSelector", "blockCommentPattern", "serializers", "serializable", "HTMLElement", "el", "ManagedAttachment", "attachmentManager", "requestRemovalOfAttachment", "AttachmentManager", "managedAttachments", "manageAttachment", "attachmentIsManaged", "attachmentManagerDidRequestRemovalOfAttachment", "unmanageAttachment", "managedAttachment", "LineBreakInsertion", "composition", "selectedRange", "getSelectedRange", "previousCharacter", "nextCharacter", "shouldInsertBlockBreak", "shouldBreakFormattedBlock", "shouldDecreaseListLevel", "shouldPrependListItem", "shouldRemoveLastBlockAttribute", "Composition", "currentAttributes", "revision", "_this$delegate$compos", "refreshAttachments", "compositionDidChangeDocument", "getSnapshot", "loadSnapshot", "_this$delegate2$compo", "_this$delegate3", "_this$delegate3$compo", "compositionWillLoadSnapshot", "setSelection", "compositionDidLoadSnapshot", "insertText", "updatePosition", "notifyDelegateOfInsertionAtRange", "insertBlock", "insertDocument", "insertString", "getCurrentTextAttributes", "insertBlockBreak", "insertLineBreak", "insertion", "decreaseListLevel", "removeLastBlockAttribute", "breakFormattedBlock", "insertHTML", "replaceHTML", "getLocationRange", "insertFile", "insertFiles", "_this$delegate4", "compositionShouldAcceptFile", "attachmentForFile", "insertAttachments", "insertAttachment", "attachmentText", "textForAttachmentWithAttributes", "shouldManageDeletingInDirection", "shouldManageMovingCursorInDirection", "deleteInDirection", "deletingIntoPreviousBlock", "selectionSpansBlocks", "selectionIsCollapsed", "canDecreaseBlockAttributeLevel", "getBlock", "decreaseBlockAttributeLevel", "getExpandedRangeInDirection", "getAttachmentAtRange", "editAttachment", "moveTextFromRange", "removeAttachment", "stopEditingAttachment", "removeCurrentAttribute", "insertPlaceholder", "placeholderPosition", "getPosition", "selectPlaceholder", "setSelectedRange", "PLACEHOLDER", "forgetPlaceholder", "hasCurrentAttribute", "toggleCurrentAttribute", "setCurrentAttribute", "canSetCurrentAttribute", "canSetCurrentBlockAttribute", "canSetCurrentTextAttribute", "getSelectedDocument", "setBlockAttribute", "setTextAttribute", "notifyDelegateOfCurrentAttributesChange", "setHTMLAtributeAtPosition", "allowedHTMLAttributes", "newDocument", "removeBlockAttribute", "updateCurrentAttributes", "removeTextAttribute", "canDecreaseNestingLevel", "_this$getBlock", "canIncreaseNestingLevel", "previousBlock", "getPreviousBlock", "_this$getBlock2", "_this$getBlock3", "attributeLevel", "ignoreLock", "getCurrentAttributes", "freezeSelection", "thawSelection", "hasFrozenSelection", "_this$delegate5", "compositionDidRequestChangingSelectionToLocationRange", "getSelectionManager", "setLocationRange", "targetLocationRange", "withTargetLocationRange", "withTargetRange", "withTargetDOMRange", "createLocationRangeFromDOMRange", "translateUTF16PositionFromOffset", "editingAttachment", "moveCursorInDirection", "canEditAttachment", "expandSelectionInDirection", "expandSelectionForEditing", "expandSelectionAroundCommonAttribute", "selectionContainsAttachments", "_this$getSelectedAtta", "getSelectedAttachments", "selectionIsInCursorTarget", "positionIsCursorTarget", "locationIsCursorTarget", "positionIsBlockBreak", "_this$document$getPie", "_this$getSelectedDocu", "added", "removed", "oldArray", "newArray", "existingValues", "Set", "currentValues", "_this$delegate6", "_this$delegate6$compo", "compositionDidRemoveAttachment", "_this$delegate7", "_this$delegate7$compo", "compositionDidAddAttachment", "_this$delegate8", "_this$delegate8$compo", "compositionDidEditAttachment", "_this$delegate9", "_this$delegate9$compo", "compositionDidChangeAttachmentPreviewURL", "_this$delegate10", "_this$delegate10$comp", "compositionDidStartEditingAttachment", "_this$delegate11", "_this$delegate11$comp", "compositionDidStopEditingAttachment", "_this$delegate12", "_this$delegate12$comp", "compositionDidChangeCurrentAttributes", "_this$delegate13", "_this$delegate13$comp", "compositionDidPerformInsertionAtRange", "utf16string", "utf16position", "UndoManager", "undoEntries", "redoEntries", "recordUndoEntry", "description", "consolidatable", "previousEntry", "entryHasDescriptionAndContext", "undoEntry", "createEntry", "pop", "redoEntry", "snapshot", "canUndo", "canRedo", "entry", "BLOCK_ATTRIBUTE_NAME", "Filter", "applyBlockAttribute", "findRangesOfBlocks", "findRangesOfPieces", "moveSelectedRangeForward", "attachmentGalleryFilter", "DEFAULT_FILTERS", "Editor", "undoManager", "filters", "loadDocument", "loadHTML", "loadJSON", "getClientRectAtPosition", "getClientRectAtLocationRange", "activateAttribute", "attributeIsActive", "canActivateAttribute", "deactivateAttribute", "LocationMapper", "findLocationFromContainerAndOffset", "container", "foundBlock", "attachmentElement", "findAttachmentElementParentForNode", "rejectAttachmentContents", "nodeLength", "findContainerAndOffsetFromLocation", "nodeOffset", "findNodeAndOffsetFromLocation", "getSignificantNodesForIndex", "acceptSignificantNodes", "recordingNodes", "rejectEmptyTextNodes", "PointMapper", "createDOMRangeFromPoint", "x", "y", "caretPositionFromPoint", "offsetNode", "createRange", "setStart", "caretRangeFromPoint", "createTextRange", "originalDOMRange", "moveToPoint", "select", "getClientRectsForDOMRange", "getClientRects", "SelectionManager", "didMouseDown", "locationMapper", "pointMapper", "lockCount", "currentLocationRange", "lockedLocationRange", "createDOMRangeFromLocationRange", "updateCurrentLocationRange", "setLocationRangeFromPointRange", "pointRange", "getLocationAtPoint", "lock", "unlock", "clearSelection", "_getDOMRange", "collapsed", "selectionIsExpanded", "domRangeWithinElement", "pauseTemporarily", "resumeHandlers", "paused", "resume", "clearTimeout", "resumeTimeout", "_this$delegate$locati", "locationRangeDidChange", "rangeStart", "rangeEnd", "setEnd", "point", "_this$createLocationR", "keyNames", "undoable", "commands", "do", "undos", "AttachmentEditorController", "title", "trixAction", "didClickToolbar", "didClickActionButton", "textarea", "placeholder", "textareaClone", "tabIndex", "autoresize", "scrollHeight", "didInputCaption", "didKeyDownCaption", "didChangeCaption", "didBlurCaption", "editingFigcaption", "editCaption", "focus", "install", "makeElementMutable", "addToolbar", "installCaptionEditor", "uninstall", "savePendingCaption", "didUninstallAttachmentEditor", "pendingCaption", "_this$delegate3$attac", "attachmentEditorDidRequestUpdatingAttributesForAttachment", "attachmentEditorDidRequestRemovingAttributeForAttachment", "stopPropagation", "attachmentEditorDidRequestRemovalOfAttachment", "_this$delegate5$attac", "keyCode", "attachmentEditorDidRequestDeselectingAttachment", "CompositionController", "didFocus", "didBlur", "didClickAttachment", "documentView", "_this$blurPromise", "focused", "compositionControllerDidFocus", "blurPromise", "compositionControllerDidBlur", "findAttachmentForElement", "compositionControllerDidSelectAttachment", "getSerializableElement", "isEditingAttachment", "_this$delegate4$compo", "_this$delegate5$compo", "canSyncDocumentView", "compositionControllerWillSyncDocumentView", "compositionControllerDidSyncDocumentView", "compositionControllerDidRender", "rerenderViewForObject", "refreshViewCache", "attachmentEditor", "installAttachmentEditorForAttachment", "_this$attachmentEdito", "uninstallAttachmentEditor", "_this$attachmentEdito2", "compositionControllerWillUpdateAttachment", "compositionControllerDidRequestRemovalOfAttachment", "compositionControllerDidRequestDeselectingAttachment", "Controller", "mutableAttributeName", "mutableSelector", "childList", "characterData", "characterDataOldValue", "subtree", "MutationObserver", "didMutate", "observer", "observe", "disconnect", "mutations", "_this$delegate$elemen", "findSignificantMutations", "elementDidMutate", "getMutationSummary", "mutation", "mutationIsSignificant", "nodeIsMutable", "nodesModifiedByMutation", "nodeIsSignificant", "addedNodes", "removedNodes", "getTextMutationSummary", "additions", "deletions", "getTextChangesFromCharacterData", "textChanges", "getTextChangesFromChildList", "addition", "summary", "textAdded", "deleted", "textDeleted", "getMutationsByType", "textRemoved", "getTextForNodes", "characterMutations", "startMutation", "endMutation", "summarized", "oldString", "newString", "oldValue", "FileVerificationOperation", "reader", "FileReader", "abort", "readAsArrayBuffer", "FlakyAndroidKeyboardDetector", "shouldIgnore", "previousEvent", "checkSamsungKeyboardBuggyModeStart", "checkSamsungKeyboardBuggyModeEnd", "buggyMode", "insertingLongTextAfterUnidentifiedChar", "differsInWhitespace", "innerText", "inputType", "_this$event$data", "isBeforeInputInsertText", "previousEventWasUnidentifiedKeydown", "_this$previousEvent", "_this$previousEvent2", "text1", "text2", "normalize", "whiteSpaceNormalizerRegexp", "InputController", "mutationObserver", "flakyKeyboardDetector", "events", "handlerFor", "mutationSummary", "editorWillSyncDocumentView", "editorDidSyncDocumentView", "requestRender", "_this$delegate$inputC", "inputControllerDidRequestRender", "requestReparse", "_this$delegate2$input", "inputControllerDidRequestReparse", "operations", "all", "handleInput", "_this$responder", "inputControllerWillAttachFiles", "responder", "defaultPrevented", "inputControllerWillHandleInput", "inputControllerDidHandleInput", "createLinkHTML", "pastedFileCount", "Level0InputController", "resetInputSummary", "setInputSummary", "inputSummary", "isComposing", "inputControllerDidAllowUnhandledInput", "mutationIsExpected", "preferDocument", "mutationAdditionMatchesSummary", "mutationDeletionMatchesSummary", "didDelete", "unexpectedNewlineAddition", "unexpectedNewlineDeletion", "_this$compositionInpu", "textChanged", "composedEmptyString", "compositionInput", "getEndData", "getCompositionInput", "CompositionInput", "isEnded", "_this$responder2", "serializeSelectionToDataTransfer", "_this$responder3", "setData", "canAcceptDataTransfer", "Files", "getPastedHTMLUsingHiddenElement", "pageXOffset", "pageYOffset", "opacity", "requestAnimationFrame", "keydown", "didInput", "keyName", "_context2", "modifier", "_context", "character", "inputControllerDidReceiveKeyboardCommand", "keypress", "altKey", "stringFromKeyEvent", "_this$responder9", "inputControllerWillPerformTyping", "textInput", "toUpperCase", "_this$responder10", "dragenter", "dragstart", "_this$delegate5$input", "draggedRange", "inputControllerDidStartDrag", "dragover", "draggingPoint", "clientX", "clientY", "_this$delegate6$input", "inputControllerDidReceiveDragOverPoint", "dragend", "_this$delegate7$input", "inputControllerDidCancelDrag", "drop", "_event$dataTransfer", "_this$responder11", "_this$responder12", "inputControllerWillMoveText", "_this$responder13", "fromJSONString", "cut", "_this$responder14", "clipboardData", "inputControllerWillCutText", "_this$responder15", "paste", "clipboard", "testClipboardData", "pasteEventIsCrippledSafariHTMLPaste", "_this$responder16", "inputControllerWillPaste", "inputControllerDidPaste", "_this$responder17", "_this$delegate14", "_this$responder18", "_this$delegate15", "_this$delegate16", "_this$responder19", "_this$delegate17", "_clipboard$items", "_clipboard$items$getA", "items", "getAsFile", "_this$delegate18", "_this$responder20", "_this$delegate19", "extensionForFile", "compositionstart", "compositionupdate", "compositionend", "beforeinput", "backspace", "_this$delegate20", "delete", "_this$delegate21", "return", "_this$delegate22", "_this$responder21", "tab", "_this$responder22", "_this$responder23", "_this$responder24", "_this$responder25", "control", "d", "_this$delegate23", "h", "_this$delegate24", "_this$delegate25", "_this$responder26", "shift", "_this$delegate26", "_this$responder27", "_this$responder28", "_this$responder29", "alt", "_this$delegate27", "meta", "_this$delegate28", "_file$type", "which", "charCode", "hasPasteboardFlavor", "hasReadableDynamicData", "isExternalHTMLPaste", "isExternalRichTextPaste", "inputController", "isSignificant", "_this$responder5", "_this$responder4", "canApplyToDocument", "_this$responder6", "_this$responder7", "_this$responder8", "_this$data$start", "_this$data$end", "Level2InputController", "scheduledRender", "composing", "reparse", "scheduleRender", "_this$afterRender", "cancelAnimationFrame", "afterRender", "toggleAttributeIfSupported", "inputControllerWillPerformFormatting", "activateAttributeIfSupported", "getTargetDOMRange", "minLength", "_this$event$getTarget", "_this$event", "targetRanges", "getTargetRanges", "staticRangeToRange", "withEvent", "command", "keyboardCommandFromKeyEvent", "shiftKey", "_event$clipboardData", "pasteEventHasFilesOnly", "pasteEventHasPlainTextOnly", "inputTypes", "immmediateRender", "inputEvent", "dragging", "pointFromEvent", "dragEventHasFiles", "ArrowLeft", "ArrowRight", "Backspace", "Tab", "deleteByComposition", "deleteByCut", "deleteByDrag", "deleteByDragRange", "deleteCompositionText", "deleteContent", "deleteContentBackward", "deleteContentForward", "deleteEntireSoftLine", "deleteHardLineBackward", "deleteHardLineForward", "deleteSoftLineBackward", "deleteSoftLineForward", "deleteWordBackward", "deleteWordForward", "formatBackColor", "formatBold", "formatFontColor", "formatFontName", "formatIndent", "formatItalic", "formatJustifyCenter", "formatJustifyFull", "formatJustifyLeft", "formatJustifyRight", "formatOutdent", "formatRemove", "_this$responder30", "formatSetBlockTextDirection", "formatSetInlineTextDirection", "formatStrikeThrough", "formatSubscript", "formatSuperscript", "formatUnderline", "historyRedo", "inputControllerWillPerformRedo", "historyUndo", "inputControllerWillPerformUndo", "insertCompositionText", "insertFromComposition", "insertFromDrop", "_this$responder31", "insertFromPaste", "_this$responder32", "_this$responder33", "processableFilePaste", "_this$responder34", "_this$responder35", "insertFromYank", "insertLink", "insertOrderedList", "insertParagraph", "_this$responder36", "insertReplacementText", "replacement", "_this$event$dataTrans", "insertTranspose", "insertUnorderedList", "staticRange", "_event$dataTransfer$f", "attributeButtonSelector", "actionButtonSelector", "toolbarButtonSelector", "dialogSelector", "activeDialogSelector", "dialogButtonSelector", "dialogInputSelector", "getInputForDialog", "getAttributeName", "getActionName", "ToolbarController", "didClickAttributeButton", "didClickDialogButton", "didKeyDownDialogInput", "actions", "resetDialogInputs", "toolbarDidClickButton", "actionName", "getDialog", "toggleDialog", "toolbarDidInvokeAction", "toolbarDidToggleAttribute", "refreshAttributeButtons", "dialogElement", "dialog", "hideDialog", "updateActions", "refreshActionButtons", "eachActionButton", "disabled", "updateAttributes", "eachAttributeButton", "dialogIsVisible", "applyKeyboardCommand", "keyString", "button", "buttonKeys", "dialogName", "showDialog", "toolbarWillShowDialog", "disabledInput", "toolbarDidShowDialog", "willValidate", "checkValidity", "toolbarDidUpdateAttribute", "toolbarDidRemoveAttribute", "toolbarDidHideDialog", "EditorController", "editorElement", "compositionController", "toolbarController", "toolbarElement", "editor", "notifyEditorElement", "handlingInput", "updateCurrentActions", "pasting", "pastedRange", "attachmentLocationRange", "loadingSnapshot", "isFocused", "requestedLocationRange", "compositionRevisionWhenLocationRangeRequested", "renderedCompositionRevision", "runEditorFilters", "isFocusedInvisibly", "requestedRender", "recordTypingUndoEntry", "recordFormattingUndoEntry", "locationRangeBeforeDrag", "invokingElement", "invokeAction", "selectionFrozen", "canInvokeAction", "actionIsExternal", "_this$actions$actionN", "_this$actions$actionN2", "getCurrentActions", "currentActions", "snapshotsAreEqual", "updateInputElement", "serializer", "setFormValue", "message", "documentChangedSinceLastRender", "notify", "getUndoContext", "getLocationContext", "getTimeContext", "Date", "getTime", "_this$editorElement$o", "ownerDocument", "TrixToolbarElement", "connectedCallback", "makeEditable", "configureContentEditable", "disableObjectResizing", "setDefaultParagraphSeparator", "_document$queryComman", "_document", "queryCommandSupported", "execCommand", "_document$queryComman2", "_document2", "cursorTargetStyles", "_internals", "WeakMap", "_validate", "WeakSet", "ElementInternalsDelegate", "_classPrivateFieldInitSpec", "writable", "_classPrivateFieldSet", "attachInternals", "_classPrivateMethodGet", "_validate2", "disconnectedCallback", "labels", "_classPrivateFieldGet", "_this$element$inputEl", "inputElement", "toggleAttribute", "required", "validity", "validationMessage", "reportValidity", "setCustomValidity", "customValidationMessage", "valueMissing", "customError", "setValidity", "_focusHandler", "_resetBubbled", "_clickBubbled", "LegacyDelegate", "contains", "label", "texts", "_classPrivateFieldGet2", "console", "warn", "_delegate", "TrixEditorElement", "formAssociated", "localName", "_this$ownerDocument", "toolbarId", "_this$inputElement", "_this$ownerDocument2", "inputId", "nextElementSibling", "_this$editorControlle", "editorController", "_this$inputElement2", "_this$inputElement3", "defaultValue", "_this$editor", "_this$editorControlle2", "formDisabledCallback", "formResetCallback", "Trix", "VERSION", "version", "core", "models", "controllers", "observers", "customElements", "define", "x", "k", "a", "b", "c", "d", "s", "i", "n", "hi", "j", "hex", "SparkMD5", "start", "dispatchEvent", "error"] }