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AAC,GAAA,0DAAAC,GAAA,wDAAAC,GAAA,uEAAAC,GAAA,2DAAAC,GAAA,2DAAAC,GAAA,+DAAAC,GAAA,0DAAAC,GAAA,wDAAAC,GAAA,kDAAAC,GAAA,0DAAAC,GAAA,6DAAAC,GAAA,sEAAAC,GAAA,2DAAAC,GAAA,oEAAAC,GAAA,yDAAAC,GAAA,4DAAAC,GAAA,gEAAAC,GAAA,qDAAAC,GAAA,oDAAAC,GAAA,kEAAAC,GAAA,0DAAAC,GAAA,0DAAAC,EAAA,EACF,EAAE,QAAQ,CAAC,CAACC,EAAMC,CAAM,IAAM,CAE5B,MAAMC,EADWF,EAAK,MAAM,GAAG,EAAE,IAAK,EACV,MAAM,gBAAgB,EAAE,MAAO,EAC3D3C,GAAY,SAAS6C,EAAYD,EAAO,OAAO,CACjD,CAAC,EAGD,MAAME,GAAwB,sEAAAC,GAAA,6DAAAC,GAAA,qDAAAC,GAAA,iDAAAC,GAAA,4DAAAC,GAAA,wEAAAC,GAAA,+CAAAC,GAAA,wDAAAC,GAAA,+CAAAC,GAAA,qEAAAC,GAAA,6EAAAC,GAAA,uEAAAC,GAAA,yDAAAC,GAAA,sDAAAC,EAAA,CAM7B,EACDC,GAAoB7D,GAAa8C,EAAqB","names":["prototype","submitter","validateSubmitter","form","raise","errorConstructor","message","name","submittersByForm","findSubmitterFromClickTarget","target","element","candidate","clickCaptured","event","prototypeOfSubmitEvent","FrameLoadingStyle","_FrameElement","__publicField","value","frameLoadingStyleFromString","_b","_a","FrameElement","style","drive","activateScriptElement","createdScriptElement","cspNonce","getCspNonce","copyElementAttributes","destinationElement","sourceElement","createDocumentFragment","html","template","dispatch","eventName","cancelable","detail","cancelEvent","nextRepaint","nextEventLoopTick","nextAnimationFrame","resolve","nextMicrotask","parseHTMLDocument","unindent","strings","values","lines","interpolate","match","indent","line","result","string","uuid","_","i","getAttribute","attributeName","elements","hasAttribute","markAsBusy","clearBusyState","waitForLoad","timeoutInMilliseconds","onComplete","getHistoryMethodForAction","action","isAction","getVisitAction","getMetaElement","getMetaContent","nonce","content","setMetaContent","findClosestRecursively","selector","elementIsFocusable","queryAutofocusableElement","elementOrDocumentFragment","around","callback","reader","before","after","doesNotTargetIFrame","findLinkFromClickTarget","getLocationForLink","link","expandURL","debounce","fn","delay","timeoutId","args","Config","config","__privateAdd","_submitter","__privateGet","__privateSet","forms","locatable","getAnchor","url","anchorMatch","getAction$1","getExtension","getLastPathComponent","isPrefixedBy","baseURL","prefix","getPrefix","locationIsVisitable","location","rootLocation","getRequestURL","anchor","toCacheKey","urlsAreEqual","left","right","getPathComponents","addTrailingSlash","FetchResponse","response","LimitedSet","maxSize","oldestValue","recentRequests","nativeFetch","fetchWithTurboHeaders","options","modifiedHeaders","requestUID","fetchMethodFromString","method","FetchMethod","fetchEnctypeFromString","encoding","FetchEnctype","FetchRequest","delegate","requestBody","enctype","_FetchRequest_instances","_resolveRequestPromise","_value","body","buildResourceAndBody","fetchBody","fetchMethod","fetchOptions","__privateMethod","allowRequestToBeIntercepted_fn","error","willDelegateErrorHandling_fn","fetchResponse","isSafe","mimeType","requestInterception","resource","searchParams","entriesExcludingFiles","mergeIntoURLSearchParams","entries","AppearanceObserver","lastEntry","StreamMessage","fragment","importStreamElements","streamElement","inertScriptElement","PREFETCH_DELAY","PrefetchCache","_prefetchTimeout","_prefetched","request","ttl","cacheTtl","prefetchCache","FormSubmissionState","FormSubmission","formElement","mustRedirect","getMethod","getAction","getFormAction","buildFormData","getEnctype","initialized","requesting","confirmationMessage","stopping","stopped","token","getCookieValue","_request","responseSucceededWithoutRedirect","input","formData","cookieName","cookie","formElementAction","formAction","Snapshot","queryPermanentElementsAll","id","getPermanentElementById","snapshot","permanentElementMap","currentPermanentElement","newPermanentElement","node","FormSubmitObserver","eventTarget","submissionDoesNotDismissDialog","submissionDoesNotTargetIFrame","View","_resolveRenderPromise","_resolveInterceptionPromise","x","y","renderer","isPreview","shouldRender","willRender","shouldInvalidate","renderInterception","reason","direction","FrameView","LinkInterceptor","_event","LinkClickObserver","FormLinkClickObserver","originalEvent","type","turboFrame","turboAction","turboConfirm","Bardo","bardo","permanentElement","placeholder","createPlaceholderForPermanentElement","clone","Renderer","currentSnapshot","newSnapshot","_activeElement","reject","currentElement","newElement","FrameRenderer","destinationRange","frameElement","sourceRange","renderElement","block","readScrollLogicalPosition","behavior","readScrollBehavior","activatedScriptElement","defaultValue","Idiomorph","noOp","defaults","elt","morph","oldNode","newContent","normalizeElement","newNode","normalizeParent","ctx","createMorphContext","morphedNodes","saveAndRestoreFocus","withHeadBlocking","morphChildren","morphOuterHTML","oldParent","childNodes","index","rightMargin","activeElement","activeElementId","selectionStart","selectionEnd","results","newParent","insertionPoint","endPoint","newChild","bestMatch","findBestMatch","removeNodesBetween","morphNode","movedChild","moveBeforeById","insertedNode","createNode","tempNode","removeNode","newEmptyChild","newClonedChild","startPoint","softMatch","nextSibling","siblingSoftMatchCount","cursor","isSoftMatch","isIdSetMatch","oldSet","newSet","oldElt","newElt","moveBefore","startInclusive","endExclusive","parentNode","removeElementFromAncestorsIdMaps","idSet","handleHeadElement","morphAttributes","ignoreValueOfActiveElement","oldAttributes","newAttributes","newAttribute","ignoreAttribute","oldAttribute","syncInputValue","oldElement","newValue","oldValue","syncBooleanAttribute","newLiveValue","oldLiveValue","ignoreUpdate","attr","updateType","possibleActiveElement","oldHead","newHead","promises","newCtx","added","removed","preserved","nodesToAppend","srcToNewHeadNodes","newHeadChild","currentHeadElt","inNewContent","isReAppended","isPreserved","promise","_resolve","removedElement","persistentIds","idMap","createIdMaps","mergedConfig","mergeDefaults","morphStyle","createPantry","finalConfig","pantry","findIdElements","root","populateIdMapWithTree","current","oldContent","oldIdElements","newIdElements","createPersistentIds","newRoot","duplicateIds","oldIdTagNameMap","tagName","generatedByIdiomorph","parseContent","createDuckTypedParent","dummyParent","s","n","r","parser","contentWithSvgsRemoved","htmlElement","morphElements","callbacks","DefaultIdiomorphCallbacks","beforeNodeMorphed","_beforeNodeMorphed","mutationType","MorphingFrameRenderer","_ProgressBar","ProgressBar","HeadSnapshot","elementIsNoscript","elementWithoutNonce","outerHTML","details","elementType","elementIsTracked","matchedType","tracked","elementIsMetaElementWithName","elementIsScript","elementIsStylesheet","PageSnapshot","documentElement","head","headSnapshot","clonedElement","selectElements","clonedSelectElements","source","option","clonedPasswordInput","ViewTransitioner","_viewTransitionStarted","_lastOperation","useViewTransition","render","defaultOptions","TimingMetric","VisitState","SystemStatusCode","Direction","Visit","restorationIdentifier","historyChanged","referrer","snapshotHTML","visitCachedSnapshot","updateHistory","shouldCacheSnapshot","acceptsStreamResponse","actionForHistory","statusCode","isSuccessful","responseHTML","_response","redirected","_error","scrollPosition","metric","BrowserAdapter","session","visit","_visit","_formSubmission","CacheObserver","FrameRedirector","_FrameRedirector_instances","_location","shouldRedirect_fn","frame","findFrameElement_fn","shouldSubmit_fn","meta","History","turbo","restorationIndex","state","additionalData","restorationData","LinkPrefetchObserver","_LinkPrefetchObserver_instances","_prefetchedLink","_enable","_tryToPrefetchRequest","_cancelRequestIfObsolete","_tryToUsePrefetchedRequest","isPrefetchable_fn","fetchRequest","cacheTtl_get","_cancelPrefetchRequest","cached","turboFrameTarget","unfetchableLink","linkToTheSamePage","linkOptsOut","nonSafeLink","eventPrevented","turboPrefetchParent","turboMethod","isUJS","Navigator","_Navigator_instances","formSubmission","visitOptions","getActionForFormSubmission_fn","currentAnchor","isRestorationToTop","oldURL","newURL","getDefaultAction_fn","PageStage","PageObserver","readyState","ScrollObserver","position","StreamMessageRenderer","getPermanentElementMapForFragment","withAutofocusFromFragment","withPreservedFocus","permanentElementsInDocument","permanentElementInDocument","elementInStream","generatedID","turboStreams","elementWithAutofocus","firstAutofocusableElementInStreams","willAutofocusId","elementToAutofocus","activeElementBeforeRender","activeElementAfterRender","restoreFocusTo","elementToFocus","nodeListOfStreamElements","StreamObserver","_started","fetchResponseFromEvent","fetchResponseIsStream","ErrorRenderer","replaceableElement","PageRenderer","_PageRenderer_instances","setLanguage_fn","mergedHeadElements","newStylesheetElements","loadingElements","newHeadElements","elementList","lang","MorphingPageRenderer","canRefreshFrame","SnapshotCache","size","key","PageView","rendererClass","cachedSnapshot","Preloader","snapshotCache","_preloadAll","Cache","_Cache_instances","setCacheControl_fn","Session","_pageRefreshDebouncePeriod","adapter","requestId","isRecentRequest","isCurrentUrl","isUnsafe","isStream","frameTarget","extendURLWithDeprecatedProperties","defaultPrevented","_snapshot","_isPreview","renderMethod","ev","newBody","timing","submitterIsNavigatable","container","withinFrame","deprecatedLocationPropertyDescriptors","cache","navigator$1","start","registerAdapter","connectStreamSource","disconnectStreamSource","renderStreamMessage","clearCache","setProgressBarDelay","setConfirmMethod","confirmMethod","setFormMode","mode","Turbo","TurboFrameMissingError","FrameController","_FrameController_instances","_fetchResponse","_currentFetchRequest","_resolveVisitPromise","_connected","_hasBeenLoaded","_ignoredAttributes","_shouldMorphFrame","loadSourceURL_fn","isIgnoringChangesTo_fn","refresh","src","document","loadFrameResponse_fn","handleUnvisitableFrameResponse_fn","shouldInterceptNavigation_fn","navigateFrame_fn","newFrame","_renderMethod","_newElement","pageSnapshot","activateElement","sourceURL","ignoringChangesToAttribute_fn","visit_fn","newFrameElement","willHandleFrameMissingFromResponse_fn","handleFrameMissingFromResponse_fn","withCurrentNavigationElement_fn","visitResponse_fn","throwFrameMissingError_fn","wrapped","getFrameElementById","formActionIsVisitable_fn","currentURL","StreamActions","e","targetElement","_StreamElement","_StreamElement_instances","c","existingChildren","newChildrenIds","actionFunction","raise_fn","StreamElement","StreamSourceElement","consumer","getConsumer","setConsumer","createConsumer","newConsumer","__vitePreload","subscribeTo","channel","mixin","subscriptions","walk","obj","acc","camel","m","TurboCableStreamSourceElement","data","signed_stream_name","snakeize","encodeMethodIntoRequestBody","isBodyInit","determineFetchMethod","formMethod","determineFormMethod","overrideMethod","toggleSelection","selection","active","ranges","range","deselectCurrent","require$$0","clipboardToIE11Formatting","defaultMessage","format","copyKey","copy","text","debug","reselectPrevious","mark","success","successful","err","copyToClipboard","copyAndNotify","showNotification","Turbo.session","Rails","CampaignTracking","ConvertedWithTracking","ImgixHelper","clearNotification","displayModal","announcementBanner_controller","Controller","ariaExpanded","articleActions_controller","isBookmarked","CurrentUser","urlParams","param","newUrl","applyQueryParams","CurrentPage","extractQueryParams","isActive","loadAndDisplayInModal","hide","show","articleAudioPlayer_controller","shareUrl","newSrcUrl","queryParamsApply","bool","articleAuthorNote_controller","attempts","nextAuthorNote","articleEmbedPlaceholder_controller","script","articleGuestNewsletterSignUpForm_controller","checkbox","cb","article_controller","WindowEnv","displayNone","displayReset","activeTabElement","shouldBeOn","displayShareUrlPromotionTopbar","articlePaywall_controller","unlockedArticleId","articleUnlockedUntilDate","articleLockedUntilDate","articleLockedUntil","articleUnlockedUntil","articleUnlockedId","wallSibling","articlePodigeePlayer_controller","articleReadingProgress_controller","scrollOffsetY","currentProgress","scrolledDistance","articleScroll_controller","query","queryString","hideArticleActions","showArticleActions","navbarPosFromTop","navbarOutOfView","contentPosFromTop","contentHeight","halfWindowHeight","contentStillHalfInView","articleTeaser_controller","articlesArchiveGuide_controller","articlesArchiveSearch_controller","debounceTimeoutInMs","runWhenDomLoaded","pos","xhr","querySuffix","articlesArchiveTopicsRow_controller","authorImages_controller","imageId","authorShareUrls_controller","activeTeamFromStorage","hideAndDisableUtmCampaign","toggleVisiblity","characterCounter_controller","textLength","isInvalid","copyToClipboard_controller","currentUser_controller","img","demoReads_controller","disableDuringSubmission_controller","isDisabled","sendEvent","isLocalhost","payload","req","Plausible","getConfig","trackEvent","eventData","trackPageview","page","originalPushState","title","targetNode","observerInit","trackClick","addNode","observer","mutations","mutation","a","goalTracking_controller","goals","goal","MatomoTracker","goalId","patch","homeArticles_controller","imgixPlaceholder_controller","loginCode_controller","keyCode","previous","next","char","remainingText","code","menu_controller","newsletterForm_controller","failureMessage","newsletterSubscriptions_controller","filterValue","cta","profilesEdit_controller","profilesSettingsForm_controller","remoteForm_controller","newDocumentOrEmptyString","seriesPreview_controller","maxEpisodesToDisplayInitially","isCurrentEpisodeVisbile","isAnyEpisodeItemHidden","episodeItem","textareaAutoGrow_controller","EN_US","en_US","diff","idx","unit","ZH_CN","zh_CN","Locales","register","locale","func","getLocale","SEC_ARRAY","toDate","formatDiff","localeFunc","agoIn","totalSec","diffSec","date","relativeDate","relDate","nextInterval","rst","d","ATTR_TIMEAGO_TID","getDateAttribute","setTimerId","timerId","getTimerId","clear","tid","run","opts","minInterval","nodes","nodeList","timeago_controller","_number","_totalSec","toggle_controller","trackMetricsAction_controller","post","trackAction","userMention_controller","userProfile_controller","component_controller$a","component_controller$9","offset","availableItems","itemsToDisplay","visibleItems","row","item","originalArray","groupSize","dividedArray","group","readingTime","component_controller$8","playbackTimeInSeconds","secs","minutes","seconds","returnedSeconds","bufferedAmount","propertyName","divided","divisor","component_controller$7","component_controller$6","component_controller$5","markNoticeAsReadPath","component_controller$4","component_controller$3","messages","errorMessages","component_controller$2","heading","component_controller$1","component_controller","numberOfCommentsToDisplay","application","Application","__vite_glob_0_0","__vite_glob_0_1","__vite_glob_0_2","__vite_glob_0_3","__vite_glob_0_4","__vite_glob_0_5","__vite_glob_0_6","__vite_glob_0_7","__vite_glob_0_8","__vite_glob_0_9","__vite_glob_0_10","__vite_glob_0_11","__vite_glob_0_12","__vite_glob_0_13","__vite_glob_0_14","__vite_glob_0_15","__vite_glob_0_16","__vite_glob_0_17","__vite_glob_0_18","__vite_glob_0_19","__vite_glob_0_20","__vite_glob_0_21","__vite_glob_0_22","__vite_glob_0_23","__vite_glob_0_24","__vite_glob_0_25","__vite_glob_0_26","__vite_glob_0_27","__vite_glob_0_28","__vite_glob_0_29","__vite_glob_0_30","__vite_glob_0_31","__vite_glob_0_32","__vite_glob_0_33","__vite_glob_0_34","__vite_glob_0_35","__vite_glob_0_36","__vite_glob_0_37","__vite_glob_0_38","__vite_glob_0_39","__vite_glob_0_40","path","module","identifier","componentsControllers","__vite_glob_1_0","__vite_glob_1_1","__vite_glob_1_2","__vite_glob_1_3","__vite_glob_1_4","__vite_glob_1_5","__vite_glob_1_6","__vite_glob_1_7","__vite_glob_1_8","__vite_glob_1_9","__vite_glob_1_10","__vite_glob_1_11","__vite_glob_1_12","__vite_glob_1_13","registerControllers"],"ignoreList":[0,1,2,3,4,5,6,7,32,33,46,47,48,49,50,51,52],"sources":["../../../node_modules/@hotwired/turbo/dist/turbo.es2017-esm.js","../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/cable.js","../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/snakeize.js","../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/cable_stream_source_element.js","../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/fetch_requests.js","../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/index.js","../../../node_modules/toggle-selection/index.js","../../../node_modules/copy-to-clipboard/index.js","../../../app/frontend/javascript/utils/copy-and-notify.js","../../../app/frontend/javascript/app/initialize.js","../../../app/frontend/javascript/controllers/main/announcement-banner_controller.js","../../../app/frontend/javascript/controllers/main/article-actions_controller.js","../../../app/frontend/javascript/controllers/main/article-audio-player_controller.js","../../../app/frontend/javascript/controllers/main/article-author-note_controller.js","../../../app/frontend/javascript/controllers/main/article-embed-placeholder_controller.js","../../../app/frontend/javascript/controllers/main/article-guest-newsletter-sign-up-form_controller.js","../../../app/frontend/javascript/controllers/main/article_controller.js","../../../app/frontend/javascript/controllers/main/article-paywall_controller.js","../../../app/frontend/javascript/controllers/main/article-podigee-player_controller.js","../../../app/frontend/javascript/controllers/main/article-reading-progress_controller.js","../../../app/frontend/javascript/controllers/main/article-scroll_controller.js","../../../app/frontend/javascript/controllers/main/article-teaser_controller.js","../../../app/frontend/javascript/controllers/main/articles-archive-guide_controller.js","../../../app/frontend/javascript/controllers/main/articles-archive-search_controller.js","../../../app/frontend/javascript/controllers/main/articles-archive-topics-row_controller.js","../../../app/frontend/javascript/controllers/main/author-images_controller.js","../../../app/frontend/javascript/controllers/main/author-share-urls_controller.js","../../../app/frontend/javascript/controllers/main/character-counter_controller.js","../../../app/frontend/javascript/controllers/main/copy-to-clipboard_controller.js","../../../app/frontend/javascript/controllers/main/current-user_controller.js","../../../app/frontend/javascript/controllers/main/demo-reads_controller.js","../../../app/frontend/javascript/controllers/main/disable-during-submission_controller.js","../../../node_modules/plausible-tracker/build/module/lib/request.js","../../../node_modules/plausible-tracker/build/module/lib/tracker.js","../../../app/frontend/javascript/controllers/main/goal-tracking_controller.js","../../../app/frontend/javascript/controllers/main/home-articles_controller.js","../../../app/frontend/javascript/controllers/main/imgix-placeholder_controller.js","../../../app/frontend/javascript/controllers/main/login-code_controller.js","../../../app/frontend/javascript/controllers/main/menu_controller.js","../../../app/frontend/javascript/controllers/main/newsletter-form_controller.js","../../../app/frontend/javascript/controllers/main/newsletter-subscriptions_controller.js","../../../app/frontend/javascript/controllers/main/profiles-edit_controller.js","../../../app/frontend/javascript/controllers/main/profiles-settings-form_controller.js","../../../app/frontend/javascript/controllers/main/remote-form_controller.js","../../../app/frontend/javascript/controllers/main/series-preview_controller.js","../../../app/frontend/javascript/controllers/main/textarea-auto-grow_controller.js","../../../node_modules/timeago.js/esm/lang/en_US.js","../../../node_modules/timeago.js/esm/lang/zh_CN.js","../../../node_modules/timeago.js/esm/register.js","../../../node_modules/timeago.js/esm/utils/date.js","../../../node_modules/timeago.js/esm/utils/dom.js","../../../node_modules/timeago.js/esm/realtime.js","../../../node_modules/timeago.js/esm/index.js","../../../app/frontend/javascript/controllers/main/timeago_controller.js","../../../app/frontend/javascript/controllers/main/toggle_controller.js","../../../app/frontend/javascript/controllers/main/track-metrics-action_controller.js","../../../app/frontend/javascript/controllers/main/user-mention_controller.js","../../../app/frontend/javascript/controllers/main/user-profile_controller.js","../../../app/components/article/teaser/component_controller.js","../../../app/components/article_teaser_index/component_controller.js","../../../app/components/audio_player/component_controller.js","../../../app/components/bookmark/component_controller.js","../../../app/components/campaign_status_bar/component_controller.js","../../../app/components/dismissable_campaign_status_bar/component_controller.js","../../../app/components/footer/component_controller.js","../../../app/components/newsletter_subscription/form/component_controller.js","../../../app/components/newsletter_subscription/form_overlay/component_controller.js","../../../app/components/newsletter_subscription/toggle/component_controller.js","../../../app/components/user_comments/component_controller.js","../../../app/frontend/javascript/app/controllers.js"],"sourcesContent":["/*!\nTurbo 8.0.13\nCopyright © 2025 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/**\n * @typedef {object} ConfigHead\n *\n * @property {'merge' | 'append' | 'morph' | 'none'} [style]\n * @property {boolean} [block]\n * @property {boolean} [ignore]\n * @property {function(Element): boolean} [shouldPreserve]\n * @property {function(Element): boolean} [shouldReAppend]\n * @property {function(Element): boolean} [shouldRemove]\n * @property {function(Element, {added: Node[], kept: Element[], removed: Element[]}): void} [afterHeadMorphed]\n */\n\n/**\n * @typedef {object} ConfigCallbacks\n *\n * @property {function(Node): boolean} [beforeNodeAdded]\n * @property {function(Node): void} [afterNodeAdded]\n * @property {function(Element, Node): boolean} [beforeNodeMorphed]\n * @property {function(Element, Node): void} [afterNodeMorphed]\n * @property {function(Element): boolean} [beforeNodeRemoved]\n * @property {function(Element): void} [afterNodeRemoved]\n * @property {function(string, Element, \"update\" | \"remove\"): boolean} [beforeAttributeUpdated]\n */\n\n/**\n * @typedef {object} Config\n *\n * @property {'outerHTML' | 'innerHTML'} [morphStyle]\n * @property {boolean} [ignoreActive]\n * @property {boolean} [ignoreActiveValue]\n * @property {boolean} [restoreFocus]\n * @property {ConfigCallbacks} [callbacks]\n * @property {ConfigHead} [head]\n */\n\n/**\n * @typedef {function} NoOp\n *\n * @returns {void}\n */\n\n/**\n * @typedef {object} ConfigHeadInternal\n *\n * @property {'merge' | 'append' | 'morph' | 'none'} style\n * @property {boolean} [block]\n * @property {boolean} [ignore]\n * @property {(function(Element): boolean) | NoOp} shouldPreserve\n * @property {(function(Element): boolean) | NoOp} shouldReAppend\n * @property {(function(Element): boolean) | NoOp} shouldRemove\n * @property {(function(Element, {added: Node[], kept: Element[], removed: Element[]}): void) | NoOp} afterHeadMorphed\n */\n\n/**\n * @typedef {object} ConfigCallbacksInternal\n *\n * @property {(function(Node): boolean) | NoOp} beforeNodeAdded\n * @property {(function(Node): void) | NoOp} afterNodeAdded\n * @property {(function(Node, Node): boolean) | NoOp} beforeNodeMorphed\n * @property {(function(Node, Node): void) | NoOp} afterNodeMorphed\n * @property {(function(Node): boolean) | NoOp} beforeNodeRemoved\n * @property {(function(Node): void) | NoOp} afterNodeRemoved\n * @property {(function(string, Element, \"update\" | \"remove\"): boolean) | NoOp} beforeAttributeUpdated\n */\n\n/**\n * @typedef {object} ConfigInternal\n *\n * @property {'outerHTML' | 'innerHTML'} morphStyle\n * @property {boolean} [ignoreActive]\n * @property {boolean} [ignoreActiveValue]\n * @property {boolean} [restoreFocus]\n * @property {ConfigCallbacksInternal} callbacks\n * @property {ConfigHeadInternal} head\n */\n\n/**\n * @typedef {Object} IdSets\n * @property {Set<string>} persistentIds\n * @property {Map<Node, Set<string>>} idMap\n */\n\n/**\n * @typedef {Function} Morph\n *\n * @param {Element | Document} oldNode\n * @param {Element | Node | HTMLCollection | Node[] | string | null} newContent\n * @param {Config} [config]\n * @returns {undefined | Node[]}\n */\n\n// base IIFE to define idiomorph\n/**\n *\n * @type {{defaults: ConfigInternal, morph: Morph}}\n */\nvar Idiomorph = (function () {\n\n  /**\n   * @typedef {object} MorphContext\n   *\n   * @property {Element} target\n   * @property {Element} newContent\n   * @property {ConfigInternal} config\n   * @property {ConfigInternal['morphStyle']} morphStyle\n   * @property {ConfigInternal['ignoreActive']} ignoreActive\n   * @property {ConfigInternal['ignoreActiveValue']} ignoreActiveValue\n   * @property {ConfigInternal['restoreFocus']} restoreFocus\n   * @property {Map<Node, Set<string>>} idMap\n   * @property {Set<string>} persistentIds\n   * @property {ConfigInternal['callbacks']} callbacks\n   * @property {ConfigInternal['head']} head\n   * @property {HTMLDivElement} pantry\n   */\n\n  //=============================================================================\n  // AND NOW IT BEGINS...\n  //=============================================================================\n\n  const noOp = () => {};\n  /**\n   * Default configuration values, updatable by users now\n   * @type {ConfigInternal}\n   */\n  const 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    head: {\n      style: \"merge\",\n      shouldPreserve: (elt) => elt.getAttribute(\"im-preserve\") === \"true\",\n      shouldReAppend: (elt) => elt.getAttribute(\"im-re-append\") === \"true\",\n      shouldRemove: noOp,\n      afterHeadMorphed: noOp,\n    },\n    restoreFocus: true,\n  };\n\n  /**\n   * Core idiomorph function for morphing one DOM tree to another\n   *\n   * @param {Element | Document} oldNode\n   * @param {Element | Node | HTMLCollection | Node[] | string | null} newContent\n   * @param {Config} [config]\n   * @returns {Promise<Node[]> | Node[]}\n   */\n  function morph(oldNode, newContent, config = {}) {\n    oldNode = normalizeElement(oldNode);\n    const newNode = normalizeParent(newContent);\n    const ctx = createMorphContext(oldNode, newNode, config);\n\n    const morphedNodes = saveAndRestoreFocus(ctx, () => {\n      return withHeadBlocking(\n        ctx,\n        oldNode,\n        newNode,\n        /** @param {MorphContext} ctx */ (ctx) => {\n          if (ctx.morphStyle === \"innerHTML\") {\n            morphChildren(ctx, oldNode, newNode);\n            return Array.from(oldNode.childNodes);\n          } else {\n            return morphOuterHTML(ctx, oldNode, newNode);\n          }\n        },\n      );\n    });\n\n    ctx.pantry.remove();\n    return morphedNodes;\n  }\n\n  /**\n   * Morph just the outerHTML of the oldNode to the newContent\n   * We have to be careful because the oldNode could have siblings which need to be untouched\n   * @param {MorphContext} ctx\n   * @param {Element} oldNode\n   * @param {Element} newNode\n   * @returns {Node[]}\n   */\n  function morphOuterHTML(ctx, oldNode, newNode) {\n    const oldParent = normalizeParent(oldNode);\n\n    // basis for calulating which nodes were morphed\n    // since there may be unmorphed sibling nodes\n    let childNodes = Array.from(oldParent.childNodes);\n    const index = childNodes.indexOf(oldNode);\n    // how many elements are to the right of the oldNode\n    const rightMargin = childNodes.length - (index + 1);\n\n    morphChildren(\n      ctx,\n      oldParent,\n      newNode,\n      // these two optional params are the secret sauce\n      oldNode, // start point for iteration\n      oldNode.nextSibling, // end point for iteration\n    );\n\n    // return just the morphed nodes\n    childNodes = Array.from(oldParent.childNodes);\n    return childNodes.slice(index, childNodes.length - rightMargin);\n  }\n\n  /**\n   * @param {MorphContext} ctx\n   * @param {Function} fn\n   * @returns {Promise<Node[]> | Node[]}\n   */\n  function saveAndRestoreFocus(ctx, fn) {\n    if (!ctx.config.restoreFocus) return fn();\n    let activeElement =\n      /** @type {HTMLInputElement|HTMLTextAreaElement|null} */ (\n        document.activeElement\n      );\n\n    // don't bother if the active element is not an input or textarea\n    if (\n      !(\n        activeElement instanceof HTMLInputElement ||\n        activeElement instanceof HTMLTextAreaElement\n      )\n    ) {\n      return fn();\n    }\n\n    const { id: activeElementId, selectionStart, selectionEnd } = activeElement;\n\n    const results = fn();\n\n    if (activeElementId && activeElementId !== document.activeElement?.id) {\n      activeElement = ctx.target.querySelector(`#${activeElementId}`);\n      activeElement?.focus();\n    }\n    if (activeElement && !activeElement.selectionEnd && selectionEnd) {\n      activeElement.setSelectionRange(selectionStart, selectionEnd);\n    }\n\n    return results;\n  }\n\n  const morphChildren = (function () {\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:\n     * - for each node in the new content:\n     *   - search self and siblings for an id set match, falling back to a soft match\n     *   - if match found\n     *     - remove any nodes up to the match:\n     *       - pantry persistent nodes\n     *       - delete the rest\n     *     - morph the match\n     *   - elsif no match found, and node is persistent\n     *     - find its match by querying the old root (future) and pantry (past)\n     *     - move it and its children here\n     *     - morph it\n     *   - else\n     *     - create a new node from scratch as a last result\n     *\n     * @param {MorphContext} ctx the merge context\n     * @param {Element} oldParent the old content that we are merging the new content into\n     * @param {Element} newParent the parent element of the new content\n     * @param {Node|null} [insertionPoint] the point in the DOM we start morphing at (defaults to first child)\n     * @param {Node|null} [endPoint] the point in the DOM we stop morphing at (defaults to after last child)\n     */\n    function morphChildren(\n      ctx,\n      oldParent,\n      newParent,\n      insertionPoint = null,\n      endPoint = null,\n    ) {\n      // normalize\n      if (\n        oldParent instanceof HTMLTemplateElement &&\n        newParent instanceof HTMLTemplateElement\n      ) {\n        // @ts-ignore we can pretend the DocumentFragment is an Element\n        oldParent = oldParent.content;\n        // @ts-ignore ditto\n        newParent = newParent.content;\n      }\n      insertionPoint ||= oldParent.firstChild;\n\n      // run through all the new content\n      for (const newChild of newParent.childNodes) {\n        // once we reach the end of the old parent content skip to the end and insert the rest\n        if (insertionPoint && insertionPoint != endPoint) {\n          const bestMatch = findBestMatch(\n            ctx,\n            newChild,\n            insertionPoint,\n            endPoint,\n          );\n          if (bestMatch) {\n            // if the node to morph is not at the insertion point then remove/move up to it\n            if (bestMatch !== insertionPoint) {\n              removeNodesBetween(ctx, insertionPoint, bestMatch);\n            }\n            morphNode(bestMatch, newChild, ctx);\n            insertionPoint = bestMatch.nextSibling;\n            continue;\n          }\n        }\n\n        // if the matching node is elsewhere in the original content\n        if (newChild instanceof Element && ctx.persistentIds.has(newChild.id)) {\n          // move it and all its children here and morph\n          const movedChild = moveBeforeById(\n            oldParent,\n            newChild.id,\n            insertionPoint,\n            ctx,\n          );\n          morphNode(movedChild, newChild, ctx);\n          insertionPoint = movedChild.nextSibling;\n          continue;\n        }\n\n        // last resort: insert the new node from scratch\n        const insertedNode = createNode(\n          oldParent,\n          newChild,\n          insertionPoint,\n          ctx,\n        );\n        // could be null if beforeNodeAdded prevented insertion\n        if (insertedNode) {\n          insertionPoint = insertedNode.nextSibling;\n        }\n      }\n\n      // remove any remaining old nodes that didn't match up with new content\n      while (insertionPoint && insertionPoint != endPoint) {\n        const tempNode = insertionPoint;\n        insertionPoint = insertionPoint.nextSibling;\n        removeNode(ctx, tempNode);\n      }\n    }\n\n    /**\n     * This performs the action of inserting a new node while handling situations where the node contains\n     * elements with persistent ids and possible state info we can still preserve by moving in and then morphing\n     *\n     * @param {Element} oldParent\n     * @param {Node} newChild\n     * @param {Node|null} insertionPoint\n     * @param {MorphContext} ctx\n     * @returns {Node|null}\n     */\n    function createNode(oldParent, newChild, insertionPoint, ctx) {\n      if (ctx.callbacks.beforeNodeAdded(newChild) === false) return null;\n      if (ctx.idMap.has(newChild)) {\n        // node has children with ids with possible state so create a dummy elt of same type and apply full morph algorithm\n        const newEmptyChild = document.createElement(\n          /** @type {Element} */ (newChild).tagName,\n        );\n        oldParent.insertBefore(newEmptyChild, insertionPoint);\n        morphNode(newEmptyChild, newChild, ctx);\n        ctx.callbacks.afterNodeAdded(newEmptyChild);\n        return newEmptyChild;\n      } else {\n        // optimisation: no id state to preserve so we can just insert a clone of the newChild and its descendants\n        const newClonedChild = document.importNode(newChild, true); // importNode to not mutate newParent\n        oldParent.insertBefore(newClonedChild, insertionPoint);\n        ctx.callbacks.afterNodeAdded(newClonedChild);\n        return newClonedChild;\n      }\n    }\n\n    //=============================================================================\n    // Matching Functions\n    //=============================================================================\n    const findBestMatch = (function () {\n      /**\n       * Scans forward from the startPoint to the endPoint looking for a match\n       * for the node. It looks for an id set match first, then a soft match.\n       * We abort softmatching if we find two future soft matches, to reduce churn.\n       * @param {Node} node\n       * @param {MorphContext} ctx\n       * @param {Node | null} startPoint\n       * @param {Node | null} endPoint\n       * @returns {Node | null}\n       */\n      function findBestMatch(ctx, node, startPoint, endPoint) {\n        let softMatch = null;\n        let nextSibling = node.nextSibling;\n        let siblingSoftMatchCount = 0;\n\n        let cursor = startPoint;\n        while (cursor && cursor != endPoint) {\n          // soft matching is a prerequisite for id set matching\n          if (isSoftMatch(cursor, node)) {\n            if (isIdSetMatch(ctx, cursor, node)) {\n              return cursor; // found an id set match, we're done!\n            }\n\n            // we haven't yet saved a soft match fallback\n            if (softMatch === null) {\n              // the current soft match will hard match something else in the future, leave it\n              if (!ctx.idMap.has(cursor)) {\n                // save this as the fallback if we get through the loop without finding a hard match\n                softMatch = cursor;\n              }\n            }\n          }\n          if (\n            softMatch === null &&\n            nextSibling &&\n            isSoftMatch(cursor, nextSibling)\n          ) {\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, block soft matching for this node to allow\n            // future siblings to soft match. This is to reduce churn in the DOM when an element\n            // is prepended.\n            if (siblingSoftMatchCount >= 2) {\n              softMatch = undefined;\n            }\n          }\n\n          // if the current node contains active element, stop looking for better future matches,\n          // because if one is found, this node will be moved to the pantry, reparenting it and thus losing focus\n          if (cursor.contains(document.activeElement)) break;\n\n          cursor = cursor.nextSibling;\n        }\n\n        return softMatch || null;\n      }\n\n      /**\n       *\n       * @param {MorphContext} ctx\n       * @param {Node} oldNode\n       * @param {Node} newNode\n       * @returns {boolean}\n       */\n      function isIdSetMatch(ctx, oldNode, newNode) {\n        let oldSet = ctx.idMap.get(oldNode);\n        let newSet = ctx.idMap.get(newNode);\n\n        if (!newSet || !oldSet) return false;\n\n        for (const id of oldSet) {\n          // a potential match is an id in the new and old nodes that\n          // has not already been merged into the DOM\n          // But the newNode content we call this on has not been\n          // merged yet and we don't allow duplicate IDs so it is simple\n          if (newSet.has(id)) {\n            return true;\n          }\n        }\n        return false;\n      }\n\n      /**\n       *\n       * @param {Node} oldNode\n       * @param {Node} newNode\n       * @returns {boolean}\n       */\n      function isSoftMatch(oldNode, newNode) {\n        // ok to cast: if one is not element, `id` and `tagName` will be undefined and we'll just compare that.\n        const oldElt = /** @type {Element} */ (oldNode);\n        const newElt = /** @type {Element} */ (newNode);\n\n        return (\n          oldElt.nodeType === newElt.nodeType &&\n          oldElt.tagName === newElt.tagName &&\n          // If oldElt has an `id` with possible state and it doesn't match newElt.id then avoid morphing.\n          // We'll still match an anonymous node with an IDed newElt, though, because if it got this far,\n          // its not persistent, and new nodes can't have any hidden state.\n          (!oldElt.id || oldElt.id === newElt.id)\n        );\n      }\n\n      return findBestMatch;\n    })();\n\n    //=============================================================================\n    // DOM Manipulation Functions\n    //=============================================================================\n\n    /**\n     * Gets rid of an unwanted DOM node; strategy depends on nature of its reuse:\n     * - Persistent nodes will be moved to the pantry for later reuse\n     * - Other nodes will have their hooks called, and then are removed\n     * @param {MorphContext} ctx\n     * @param {Node} node\n     */\n    function removeNode(ctx, node) {\n      // are we going to id set match this later?\n      if (ctx.idMap.has(node)) {\n        // skip callbacks and move to pantry\n        moveBefore(ctx.pantry, node, null);\n      } else {\n        // remove for realsies\n        if (ctx.callbacks.beforeNodeRemoved(node) === false) return;\n        node.parentNode?.removeChild(node);\n        ctx.callbacks.afterNodeRemoved(node);\n      }\n    }\n\n    /**\n     * Remove nodes between the start and end nodes\n     * @param {MorphContext} ctx\n     * @param {Node} startInclusive\n     * @param {Node} endExclusive\n     * @returns {Node|null}\n     */\n    function removeNodesBetween(ctx, startInclusive, endExclusive) {\n      /** @type {Node | null} */\n      let cursor = startInclusive;\n      // remove nodes until the endExclusive node\n      while (cursor && cursor !== endExclusive) {\n        let tempNode = /** @type {Node} */ (cursor);\n        cursor = cursor.nextSibling;\n        removeNode(ctx, tempNode);\n      }\n      return cursor;\n    }\n\n    /**\n     * Search for an element by id within the document and pantry, and move it using moveBefore.\n     *\n     * @param {Element} parentNode - The parent node to which the element will be moved.\n     * @param {string} id - The ID of the element to be moved.\n     * @param {Node | null} after - The reference node to insert the element before.\n     *                              If `null`, the element is appended as the last child.\n     * @param {MorphContext} ctx\n     * @returns {Element} The found element\n     */\n    function moveBeforeById(parentNode, id, after, ctx) {\n      const target =\n        /** @type {Element} - will always be found */\n        (\n          ctx.target.querySelector(`#${id}`) ||\n            ctx.pantry.querySelector(`#${id}`)\n        );\n      removeElementFromAncestorsIdMaps(target, ctx);\n      moveBefore(parentNode, target, after);\n      return target;\n    }\n\n    /**\n     * Removes an element from its ancestors' id maps. This is needed when an element is moved from the\n     * \"future\" via `moveBeforeId`. Otherwise, its erstwhile ancestors could be mistakenly moved to the\n     * pantry rather than being deleted, preventing their removal hooks from being called.\n     *\n     * @param {Element} element - element to remove from its ancestors' id maps\n     * @param {MorphContext} ctx\n     */\n    function removeElementFromAncestorsIdMaps(element, ctx) {\n      const id = element.id;\n      /** @ts-ignore - safe to loop in this way **/\n      while ((element = element.parentNode)) {\n        let idSet = ctx.idMap.get(element);\n        if (idSet) {\n          idSet.delete(id);\n          if (!idSet.size) {\n            ctx.idMap.delete(element);\n          }\n        }\n      }\n    }\n\n    /**\n     * Moves an element before another element within the same parent.\n     * Uses the proposed `moveBefore` API if available (and working), otherwise falls back to `insertBefore`.\n     * This is essentialy a forward-compat wrapper.\n     *\n     * @param {Element} parentNode - The parent node containing the after element.\n     * @param {Node} element - The element to be moved.\n     * @param {Node | null} after - The reference node to insert `element` before.\n     *                              If `null`, `element` is appended as the last child.\n     */\n    function moveBefore(parentNode, element, after) {\n      // @ts-ignore - use proposed moveBefore feature\n      if (parentNode.moveBefore) {\n        try {\n          // @ts-ignore - use proposed moveBefore feature\n          parentNode.moveBefore(element, after);\n        } catch (e) {\n          // fall back to insertBefore as some browsers may fail on moveBefore when trying to move Dom disconnected nodes to pantry\n          parentNode.insertBefore(element, after);\n        }\n      } else {\n        parentNode.insertBefore(element, after);\n      }\n    }\n\n    return morphChildren;\n  })();\n\n  //=============================================================================\n  // Single Node Morphing Code\n  //=============================================================================\n  const morphNode = (function () {\n    /**\n     * @param {Node} oldNode root node to merge content into\n     * @param {Node} newContent new content to merge\n     * @param {MorphContext} ctx the merge context\n     * @returns {Node | null} the element that ended up in the DOM\n     */\n    function morphNode(oldNode, newContent, ctx) {\n      if (ctx.ignoreActive && oldNode === document.activeElement) {\n        // don't morph focused element\n        return null;\n      }\n\n      if (ctx.callbacks.beforeNodeMorphed(oldNode, newContent) === false) {\n        return oldNode;\n      }\n\n      if (oldNode instanceof HTMLHeadElement && ctx.head.ignore) ; else if (\n        oldNode instanceof HTMLHeadElement &&\n        ctx.head.style !== \"morph\"\n      ) {\n        // ok to cast: if newContent wasn't also a <head>, it would've got caught in the `!isSoftMatch` branch above\n        handleHeadElement(\n          oldNode,\n          /** @type {HTMLHeadElement} */ (newContent),\n          ctx,\n        );\n      } else {\n        morphAttributes(oldNode, newContent, ctx);\n        if (!ignoreValueOfActiveElement(oldNode, ctx)) {\n          // @ts-ignore newContent can be a node here because .firstChild will be null\n          morphChildren(ctx, oldNode, newContent);\n        }\n      }\n      ctx.callbacks.afterNodeMorphed(oldNode, newContent);\n      return oldNode;\n    }\n\n    /**\n     * syncs the oldNode to the newNode, copying over all attributes and\n     * inner element state from the newNode to the oldNode\n     *\n     * @param {Node} oldNode the node to copy attributes & state to\n     * @param {Node} newNode the node to copy attributes & state from\n     * @param {MorphContext} ctx the merge context\n     */\n    function morphAttributes(oldNode, newNode, ctx) {\n      let type = newNode.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 oldElt = /** @type {Element} */ (oldNode);\n        const newElt = /** @type {Element} */ (newNode);\n\n        const oldAttributes = oldElt.attributes;\n        const newAttributes = newElt.attributes;\n        for (const newAttribute of newAttributes) {\n          if (ignoreAttribute(newAttribute.name, oldElt, \"update\", ctx)) {\n            continue;\n          }\n          if (oldElt.getAttribute(newAttribute.name) !== newAttribute.value) {\n            oldElt.setAttribute(newAttribute.name, newAttribute.value);\n          }\n        }\n        // iterate backwards to avoid skipping over items when a delete occurs\n        for (let i = oldAttributes.length - 1; 0 <= i; i--) {\n          const oldAttribute = oldAttributes[i];\n\n          // toAttributes is a live NamedNodeMap, so iteration+mutation is unsafe\n          // e.g. custom element attribute callbacks can remove other attributes\n          if (!oldAttribute) continue;\n\n          if (!newElt.hasAttribute(oldAttribute.name)) {\n            if (ignoreAttribute(oldAttribute.name, oldElt, \"remove\", ctx)) {\n              continue;\n            }\n            oldElt.removeAttribute(oldAttribute.name);\n          }\n        }\n\n        if (!ignoreValueOfActiveElement(oldElt, ctx)) {\n          syncInputValue(oldElt, newElt, ctx);\n        }\n      }\n\n      // sync text nodes\n      if (type === 8 /* comment */ || type === 3 /* text */) {\n        if (oldNode.nodeValue !== newNode.nodeValue) {\n          oldNode.nodeValue = newNode.nodeValue;\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 {Element} oldElement the element to sync the input value to\n     * @param {Element} newElement the element to sync the input value from\n     * @param {MorphContext} ctx the merge context\n     */\n    function syncInputValue(oldElement, newElement, ctx) {\n      if (\n        oldElement instanceof HTMLInputElement &&\n        newElement instanceof HTMLInputElement &&\n        newElement.type !== \"file\"\n      ) {\n        let newValue = newElement.value;\n        let oldValue = oldElement.value;\n\n        // sync boolean attributes\n        syncBooleanAttribute(oldElement, newElement, \"checked\", ctx);\n        syncBooleanAttribute(oldElement, newElement, \"disabled\", ctx);\n\n        if (!newElement.hasAttribute(\"value\")) {\n          if (!ignoreAttribute(\"value\", oldElement, \"remove\", ctx)) {\n            oldElement.value = \"\";\n            oldElement.removeAttribute(\"value\");\n          }\n        } else if (oldValue !== newValue) {\n          if (!ignoreAttribute(\"value\", oldElement, \"update\", ctx)) {\n            oldElement.setAttribute(\"value\", newValue);\n            oldElement.value = newValue;\n          }\n        }\n        // TODO: QUESTION(1cg): this used to only check `newElement` unlike the other branches -- why?\n        // did I break something?\n      } else if (\n        oldElement instanceof HTMLOptionElement &&\n        newElement instanceof HTMLOptionElement\n      ) {\n        syncBooleanAttribute(oldElement, newElement, \"selected\", ctx);\n      } else if (\n        oldElement instanceof HTMLTextAreaElement &&\n        newElement instanceof HTMLTextAreaElement\n      ) {\n        let newValue = newElement.value;\n        let oldValue = oldElement.value;\n        if (ignoreAttribute(\"value\", oldElement, \"update\", ctx)) {\n          return;\n        }\n        if (newValue !== oldValue) {\n          oldElement.value = newValue;\n        }\n        if (\n          oldElement.firstChild &&\n          oldElement.firstChild.nodeValue !== newValue\n        ) {\n          oldElement.firstChild.nodeValue = newValue;\n        }\n      }\n    }\n\n    /**\n     * @param {Element} oldElement element to write the value to\n     * @param {Element} newElement element to read the value from\n     * @param {string} attributeName the attribute name\n     * @param {MorphContext} ctx the merge context\n     */\n    function syncBooleanAttribute(oldElement, newElement, attributeName, ctx) {\n      // @ts-ignore this function is only used on boolean attrs that are reflected as dom properties\n      const newLiveValue = newElement[attributeName],\n        // @ts-ignore ditto\n        oldLiveValue = oldElement[attributeName];\n      if (newLiveValue !== oldLiveValue) {\n        const ignoreUpdate = ignoreAttribute(\n          attributeName,\n          oldElement,\n          \"update\",\n          ctx,\n        );\n        if (!ignoreUpdate) {\n          // update attribute's associated DOM property\n          // @ts-ignore this function is only used on boolean attrs that are reflected as dom properties\n          oldElement[attributeName] = newElement[attributeName];\n        }\n        if (newLiveValue) {\n          if (!ignoreUpdate) {\n            // https://developer.mozilla.org/en-US/docs/Glossary/Boolean/HTML\n            // this is the correct way to set a boolean attribute to \"true\"\n            oldElement.setAttribute(attributeName, \"\");\n          }\n        } else {\n          if (!ignoreAttribute(attributeName, oldElement, \"remove\", ctx)) {\n            oldElement.removeAttribute(attributeName);\n          }\n        }\n      }\n    }\n\n    /**\n     * @param {string} attr the attribute to be mutated\n     * @param {Element} element the element that is going to be updated\n     * @param {\"update\" | \"remove\"} updateType\n     * @param {MorphContext} ctx the merge context\n     * @returns {boolean} true if the attribute should be ignored, false otherwise\n     */\n    function ignoreAttribute(attr, element, updateType, ctx) {\n      if (\n        attr === \"value\" &&\n        ctx.ignoreActiveValue &&\n        element === document.activeElement\n      ) {\n        return true;\n      }\n      return (\n        ctx.callbacks.beforeAttributeUpdated(attr, element, updateType) ===\n        false\n      );\n    }\n\n    /**\n     * @param {Node} possibleActiveElement\n     * @param {MorphContext} ctx\n     * @returns {boolean}\n     */\n    function ignoreValueOfActiveElement(possibleActiveElement, ctx) {\n      return (\n        !!ctx.ignoreActiveValue &&\n        possibleActiveElement === document.activeElement &&\n        possibleActiveElement !== document.body\n      );\n    }\n\n    return morphNode;\n  })();\n\n  //=============================================================================\n  // Head Management Functions\n  //=============================================================================\n  /**\n   * @param {MorphContext} ctx\n   * @param {Element} oldNode\n   * @param {Element} newNode\n   * @param {function} callback\n   * @returns {Node[] | Promise<Node[]>}\n   */\n  function withHeadBlocking(ctx, oldNode, newNode, callback) {\n    if (ctx.head.block) {\n      const oldHead = oldNode.querySelector(\"head\");\n      const newHead = newNode.querySelector(\"head\");\n      if (oldHead && newHead) {\n        const promises = handleHeadElement(oldHead, newHead, ctx);\n        // when head promises resolve, proceed ignoring the head tag\n        return Promise.all(promises).then(() => {\n          const newCtx = Object.assign(ctx, {\n            head: {\n              block: false,\n              ignore: true,\n            },\n          });\n          return callback(newCtx);\n        });\n      }\n    }\n    // just proceed if we not head blocking\n    return callback(ctx);\n  }\n\n  /**\n   *  The HEAD tag can be handled specially, either w/ a 'merge' or 'append' style\n   *\n   * @param {Element} oldHead\n   * @param {Element} newHead\n   * @param {MorphContext} ctx\n   * @returns {Promise<void>[]}\n   */\n  function handleHeadElement(oldHead, newHead, ctx) {\n    let added = [];\n    let removed = [];\n    let preserved = [];\n    let nodesToAppend = [];\n\n    // put all new head elements into a Map, by their outerHTML\n    let srcToNewHeadNodes = new Map();\n    for (const newHeadChild of newHead.children) {\n      srcToNewHeadNodes.set(newHeadChild.outerHTML, newHeadChild);\n    }\n\n    // for each elt in the current head\n    for (const currentHeadElt of oldHead.children) {\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 (ctx.head.style === \"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      // TODO: This could theoretically be null, based on type\n      let newElt = /** @type {ChildNode} */ (\n        document.createRange().createContextualFragment(newNode.outerHTML)\n          .firstChild\n      );\n      if (ctx.callbacks.beforeNodeAdded(newElt) !== false) {\n        if (\n          (\"href\" in newElt && newElt.href) ||\n          (\"src\" in newElt && newElt.src)\n        ) {\n          /** @type {(result?: any) => void} */ let resolve;\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        oldHead.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        oldHead.removeChild(removedElement);\n        ctx.callbacks.afterNodeRemoved(removedElement);\n      }\n    }\n\n    ctx.head.afterHeadMorphed(oldHead, {\n      added: added,\n      kept: preserved,\n      removed: removed,\n    });\n    return promises;\n  }\n\n  //=============================================================================\n  // Create Morph Context Functions\n  //=============================================================================\n  const createMorphContext = (function () {\n    /**\n     *\n     * @param {Element} oldNode\n     * @param {Element} newContent\n     * @param {Config} config\n     * @returns {MorphContext}\n     */\n    function createMorphContext(oldNode, newContent, config) {\n      const { persistentIds, idMap } = createIdMaps(oldNode, newContent);\n\n      const mergedConfig = mergeDefaults(config);\n      const morphStyle = mergedConfig.morphStyle || \"outerHTML\";\n      if (![\"innerHTML\", \"outerHTML\"].includes(morphStyle)) {\n        throw `Do not understand how to morph style ${morphStyle}`;\n      }\n\n      return {\n        target: oldNode,\n        newContent: newContent,\n        config: mergedConfig,\n        morphStyle: morphStyle,\n        ignoreActive: mergedConfig.ignoreActive,\n        ignoreActiveValue: mergedConfig.ignoreActiveValue,\n        restoreFocus: mergedConfig.restoreFocus,\n        idMap: idMap,\n        persistentIds: persistentIds,\n        pantry: createPantry(),\n        callbacks: mergedConfig.callbacks,\n        head: mergedConfig.head,\n      };\n    }\n\n    /**\n     * Deep merges the config object and the Idiomorph.defaults object to\n     * produce a final configuration object\n     * @param {Config} config\n     * @returns {ConfigInternal}\n     */\n    function mergeDefaults(config) {\n      let finalConfig = Object.assign({}, defaults);\n\n      // copy top level stuff into final config\n      Object.assign(finalConfig, config);\n\n      // copy callbacks into final config (do this to deep merge the callbacks)\n      finalConfig.callbacks = Object.assign(\n        {},\n        defaults.callbacks,\n        config.callbacks,\n      );\n\n      // copy head config into final config  (do this to deep merge the head)\n      finalConfig.head = Object.assign({}, defaults.head, config.head);\n\n      return finalConfig;\n    }\n\n    /**\n     * @returns {HTMLDivElement}\n     */\n    function createPantry() {\n      const pantry = document.createElement(\"div\");\n      pantry.hidden = true;\n      document.body.insertAdjacentElement(\"afterend\", pantry);\n      return pantry;\n    }\n\n    /**\n     * Returns all elements with an ID contained within the root element and its descendants\n     *\n     * @param {Element} root\n     * @returns {Element[]}\n     */\n    function findIdElements(root) {\n      let elements = Array.from(root.querySelectorAll(\"[id]\"));\n      if (root.id) {\n        elements.push(root);\n      }\n      return elements;\n    }\n\n    /**\n     * A bottom-up algorithm that populates a map of Element -> IdSet.\n     * The idSet for a given element is the set of all IDs contained within its subtree.\n     * As an optimzation, we filter these IDs through the given list of persistent IDs,\n     * because we don't need to bother considering IDed elements that won't be in the new content.\n     *\n     * @param {Map<Node, Set<string>>} idMap\n     * @param {Set<string>} persistentIds\n     * @param {Element} root\n     * @param {Element[]} elements\n     */\n    function populateIdMapWithTree(idMap, persistentIds, root, elements) {\n      for (const elt of elements) {\n        if (persistentIds.has(elt.id)) {\n          /** @type {Element|null} */\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) {\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\n            if (current === root) break;\n            current = current.parentElement;\n          }\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 {IdSets}\n     */\n    function createIdMaps(oldContent, newContent) {\n      const oldIdElements = findIdElements(oldContent);\n      const newIdElements = findIdElements(newContent);\n\n      const persistentIds = createPersistentIds(oldIdElements, newIdElements);\n\n      /** @type {Map<Node, Set<string>>} */\n      let idMap = new Map();\n      populateIdMapWithTree(idMap, persistentIds, oldContent, oldIdElements);\n\n      /** @ts-ignore - if newContent is a duck-typed parent, pass its single child node as the root to halt upwards iteration */\n      const newRoot = newContent.__idiomorphRoot || newContent;\n      populateIdMapWithTree(idMap, persistentIds, newRoot, newIdElements);\n\n      return { persistentIds, idMap };\n    }\n\n    /**\n     * This function computes the set of ids that persist between the two contents excluding duplicates\n     *\n     * @param {Element[]} oldIdElements\n     * @param {Element[]} newIdElements\n     * @returns {Set<string>}\n     */\n    function createPersistentIds(oldIdElements, newIdElements) {\n      let duplicateIds = new Set();\n\n      /** @type {Map<string, string>} */\n      let oldIdTagNameMap = new Map();\n      for (const { id, tagName } of oldIdElements) {\n        if (oldIdTagNameMap.has(id)) {\n          duplicateIds.add(id);\n        } else {\n          oldIdTagNameMap.set(id, tagName);\n        }\n      }\n\n      let persistentIds = new Set();\n      for (const { id, tagName } of newIdElements) {\n        if (persistentIds.has(id)) {\n          duplicateIds.add(id);\n        } else if (oldIdTagNameMap.get(id) === tagName) {\n          persistentIds.add(id);\n        }\n        // skip if tag types mismatch because its not possible to morph one tag into another\n      }\n\n      for (const id of duplicateIds) {\n        persistentIds.delete(id);\n      }\n      return persistentIds;\n    }\n\n    return createMorphContext;\n  })();\n\n  //=============================================================================\n  // HTML Normalization Functions\n  //=============================================================================\n  const { normalizeElement, normalizeParent } = (function () {\n    /** @type {WeakSet<Node>} */\n    const generatedByIdiomorph = new WeakSet();\n\n    /**\n     *\n     * @param {Element | Document} content\n     * @returns {Element}\n     */\n    function normalizeElement(content) {\n      if (content instanceof Document) {\n        return content.documentElement;\n      } else {\n        return content;\n      }\n    }\n\n    /**\n     *\n     * @param {null | string | Node | HTMLCollection | Node[] | Document & {generatedByIdiomorph:boolean}} newContent\n     * @returns {Element}\n     */\n    function normalizeParent(newContent) {\n      if (newContent == null) {\n        return document.createElement(\"div\"); // dummy parent element\n      } else if (typeof newContent === \"string\") {\n        return normalizeParent(parseContent(newContent));\n      } else if (\n        generatedByIdiomorph.has(/** @type {Element} */ (newContent))\n      ) {\n        // the template tag created by idiomorph parsing can serve as a dummy parent\n        return /** @type {Element} */ (newContent);\n      } else if (newContent instanceof Node) {\n        if (newContent.parentNode) {\n          // we can't use the parent directly because newContent may have siblings\n          // that we don't want in the morph, and reparenting might be expensive (TODO is it?),\n          // so we create a duck-typed parent node instead.\n          return createDuckTypedParent(newContent);\n        } else {\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        }\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    /**\n     * Creates a fake duck-typed parent element to wrap a single node, without actually reparenting it.\n     * \"If it walks like a duck, and quacks like a duck, then it must be a duck!\" -- James Whitcomb Riley (1849–1916)\n     *\n     * @param {Node} newContent\n     * @returns {Element}\n     */\n    function createDuckTypedParent(newContent) {\n      return /** @type {Element} */ (\n        /** @type {unknown} */ ({\n          childNodes: [newContent],\n          /** @ts-ignore - cover your eyes for a minute, tsc */\n          querySelectorAll: (s) => {\n            /** @ts-ignore */\n            const elements = newContent.querySelectorAll(s);\n            /** @ts-ignore */\n            return newContent.matches(s) ? [newContent, ...elements] : elements;\n          },\n          /** @ts-ignore */\n          insertBefore: (n, r) => newContent.parentNode.insertBefore(n, r),\n          /** @ts-ignore */\n          moveBefore: (n, r) => newContent.parentNode.moveBefore(n, r),\n          // for later use with populateIdMapWithTree to halt upwards iteration\n          get __idiomorphRoot() {\n            return newContent;\n          },\n        })\n      );\n    }\n\n    /**\n     *\n     * @param {string} newContent\n     * @returns {Node | null | DocumentFragment}\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(\n        /<svg(\\s[^>]*>|>)([\\s\\S]*?)<\\/svg>/gim,\n        \"\",\n      );\n\n      // if the newContent contains a html, head or body tag, we can simply parse it w/o wrapping\n      if (\n        contentWithSvgsRemoved.match(/<\\/html>/) ||\n        contentWithSvgsRemoved.match(/<\\/head>/) ||\n        contentWithSvgsRemoved.match(/<\\/body>/)\n      ) {\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          generatedByIdiomorph.add(content);\n          return content;\n        } else {\n          // otherwise return the html element as the parent container\n          let htmlElement = content.firstChild;\n          if (htmlElement) {\n            generatedByIdiomorph.add(htmlElement);\n          }\n          return htmlElement;\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(\n          \"<body><template>\" + newContent + \"</template></body>\",\n          \"text/html\",\n        );\n        let content = /** @type {HTMLTemplateElement} */ (\n          responseDoc.body.querySelector(\"template\")\n        ).content;\n        generatedByIdiomorph.add(content);\n        return content;\n      }\n    }\n\n    return { normalizeElement, normalizeParent };\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.childNodes, {\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  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  // Link prefetching\n\n  linkPrefetchingIsEnabledForLocation(location) {\n    return true\n  }\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  // Link prefetching\n\n  linkPrefetchingIsEnabledForLocation(location) {\n    // Not all adapters implement linkPrefetchingIsEnabledForLocation\n    if (typeof this.adapter.linkPrefetchingIsEnabledForLocation === \"function\") {\n      return this.adapter.linkPrefetchingIsEnabledForLocation(location)\n    }\n\n    return true\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    const isCurrentUrl = url === document.baseURI;\n    if (!isRecentRequest && !this.navigator.currentVisit && isCurrentUrl) {\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      this.navigator.linkPrefetchingIsEnabledForLocation(location)\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.getAttribute(\"id\"));\n    const newChildrenIds = [...(this.templateContent?.children || [])].filter((c) => !!c.getAttribute(\"id\")).map((c) => c.getAttribute(\"id\"));\n\n    return existingChildren.filter((c) => newChildrenIds.includes(c.getAttribute(\"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’s 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        ——\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","\nmodule.exports = function () {\n  var selection = document.getSelection();\n  if (!selection.rangeCount) {\n    return function () {};\n  }\n  var active = document.activeElement;\n\n  var ranges = [];\n  for (var i = 0; i < selection.rangeCount; i++) {\n    ranges.push(selection.getRangeAt(i));\n  }\n\n  switch (active.tagName.toUpperCase()) { // .toUpperCase handles XHTML\n    case 'INPUT':\n    case 'TEXTAREA':\n      active.blur();\n      break;\n\n    default:\n      active = null;\n      break;\n  }\n\n  selection.removeAllRanges();\n  return function () {\n    selection.type === 'Caret' &&\n    selection.removeAllRanges();\n\n    if (!selection.rangeCount) {\n      ranges.forEach(function(range) {\n        selection.addRange(range);\n      });\n    }\n\n    active &&\n    active.focus();\n  };\n};\n","\"use strict\";\n\nvar deselectCurrent = require(\"toggle-selection\");\n\nvar clipboardToIE11Formatting = {\n  \"text/plain\": \"Text\",\n  \"text/html\": \"Url\",\n  \"default\": \"Text\"\n}\n\nvar defaultMessage = \"Copy to clipboard: #{key}, Enter\";\n\nfunction format(message) {\n  var copyKey = (/mac os x/i.test(navigator.userAgent) ? \"⌘\" : \"Ctrl\") + \"+C\";\n  return message.replace(/#{\\s*key\\s*}/g, copyKey);\n}\n\nfunction copy(text, options) {\n  var debug,\n    message,\n    reselectPrevious,\n    range,\n    selection,\n    mark,\n    success = false;\n  if (!options) {\n    options = {};\n  }\n  debug = options.debug || false;\n  try {\n    reselectPrevious = deselectCurrent();\n\n    range = document.createRange();\n    selection = document.getSelection();\n\n    mark = document.createElement(\"span\");\n    mark.textContent = text;\n    // avoid screen readers from reading out loud the text\n    mark.ariaHidden = \"true\"\n    // reset user styles for span element\n    mark.style.all = \"unset\";\n    // prevents scrolling to the end of the page\n    mark.style.position = \"fixed\";\n    mark.style.top = 0;\n    mark.style.clip = \"rect(0, 0, 0, 0)\";\n    // used to preserve spaces and line breaks\n    mark.style.whiteSpace = \"pre\";\n    // do not inherit user-select (it may be `none`)\n    mark.style.webkitUserSelect = \"text\";\n    mark.style.MozUserSelect = \"text\";\n    mark.style.msUserSelect = \"text\";\n    mark.style.userSelect = \"text\";\n    mark.addEventListener(\"copy\", function(e) {\n      e.stopPropagation();\n      if (options.format) {\n        e.preventDefault();\n        if (typeof e.clipboardData === \"undefined\") { // IE 11\n          debug && console.warn(\"unable to use e.clipboardData\");\n          debug && console.warn(\"trying IE specific stuff\");\n          window.clipboardData.clearData();\n          var format = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting[\"default\"]\n          window.clipboardData.setData(format, text);\n        } else { // all other browsers\n          e.clipboardData.clearData();\n          e.clipboardData.setData(options.format, text);\n        }\n      }\n      if (options.onCopy) {\n        e.preventDefault();\n        options.onCopy(e.clipboardData);\n      }\n    });\n\n    document.body.appendChild(mark);\n\n    range.selectNodeContents(mark);\n    selection.addRange(range);\n\n    var successful = document.execCommand(\"copy\");\n    if (!successful) {\n      throw new Error(\"copy command was unsuccessful\");\n    }\n    success = true;\n  } catch (err) {\n    debug && console.error(\"unable to copy using execCommand: \", err);\n    debug && console.warn(\"trying IE specific stuff\");\n    try {\n      window.clipboardData.setData(options.format || \"text\", text);\n      options.onCopy && options.onCopy(window.clipboardData);\n      success = true;\n    } catch (err) {\n      debug && console.error(\"unable to copy using clipboardData: \", err);\n      debug && console.error(\"falling back to prompt\");\n      message = format(\"message\" in options ? options.message : defaultMessage);\n      window.prompt(message, text);\n    }\n  } finally {\n    if (selection) {\n      if (typeof selection.removeRange == \"function\") {\n        selection.removeRange(range);\n      } else {\n        selection.removeAllRanges();\n      }\n    }\n\n    if (mark) {\n      document.body.removeChild(mark);\n    }\n    reselectPrevious();\n  }\n\n  return success;\n}\n\nmodule.exports = copy;\n","import { showNotification } from '@components/notification_box/component_controller';\nimport copyToClipboard from 'copy-to-clipboard';\n\nexport default function copyAndNotify(url, message) {\n  const useClipboard = !navigator.share || window.innerWidth > 800; // The navigator.share UX on Desktop devices is terrible\n\n  if (useClipboard) {\n    copyToClipboard(url);\n    showNotification(message);\n  } else {\n    navigator.share({ url });\n  }\n}\n","import { Turbo } from '@hotwired/turbo-rails';\nTurbo.session.drive = false;\n\nimport Rails from '@rails/ujs';\nimport copyAndNotify from '@frontend/utils/copy-and-notify';\n\nimport CampaignTracking from '@frontend/app/features/CampaignTracking';\nimport ConvertedWithTracking from '@frontend/app/features/ConvertedWithTracking';\nimport ImgixHelper from '@frontend/app/features/ImgixHelper';\nimport { clearNotification } from '@components/notification_box/component_controller';\nimport { display as displayModal } from '@controllers/main/modal-window_controller';\n\ndocument.addEventListener('DOMContentLoaded', () => {\n  if (window._rails_loaded !== true) {\n    Rails.start();\n  }\n\n  CampaignTracking.init();\n  ConvertedWithTracking.init();\n  ImgixHelper.init();\n\n  window.Rails = Rails;\n  window.kraut = window.kraut || {};\n  window.kraut.ImgixHelper = ImgixHelper;\n  window.kraut.clearNotification = clearNotification;\n  window.kraut.displayModal = displayModal;\n  window.kraut.copyAndNotify = copyAndNotify;\n});\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n  static targets = ['toggled', 'expandButton'];\n\n  connect() {\n    this.expandButtonTarget.setAttribute('aria-expanded', 'false');\n  }\n\n  toggle(event) {\n    event.preventDefault();\n\n    const ariaExpanded =\n      this.expandButtonTarget.getAttribute('aria-expanded') === 'false';\n    this.expandButtonTarget.setAttribute(\n      'aria-expanded',\n      ariaExpanded ? 'true' : 'false'\n    );\n    this.toggledTargets.forEach((target) => {\n      target.classList.toggle('hidden');\n    });\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\nimport CurrentUser from '@frontend/app/features/CurrentUser';\nimport CurrentPage from '@frontend/app/features/CurrentPage';\nimport { loadAndDisplay as loadAndDisplayInModal } from '@controllers/main/modal-window_controller';\nimport {\n  apply as applyQueryParams,\n  extract as extractQueryParams,\n} from '@frontend/utils/query-params';\n\nexport default class extends Controller {\n  static targets = ['bookmarkIcon', 'shareUrl'];\n  static values = {\n    articleId: Number,\n    ebookModalUrl: String,\n  };\n  static classes = ['bookmarkIconActive', 'bookmarkIconInactive', 'hidden'];\n\n  connect() {\n    this.updateBookmarkDisplay();\n    this.updateArticleUrlWithSharedParam();\n    this.notifyFinished();\n\n    this.element.addEventListener(\n      'ajax:complete',\n      this.updateBookmarkDisplay.bind(this)\n    );\n    document.addEventListener('article-actions:hide', this.hide.bind(this));\n    document.addEventListener('article-actions:show', this.show.bind(this));\n  }\n\n  disconnect() {\n    document.removeEventListener('article-actions:hide', this.hide.bind(this));\n    document.removeEventListener('article-actions:show', this.show.bind(this));\n  }\n\n  notifyFinished() {\n    document\n      .querySelector('html')\n      .classList.add('js-test-article-actions-finished');\n  }\n\n  show() {\n    this.element.classList.remove(this.hiddenClass);\n  }\n\n  hide() {\n    this.element.classList.add(this.hiddenClass);\n  }\n\n  updateBookmarkDisplay() {\n    const isBookmarked = CurrentUser.bookmarks().includes(this.articleIdValue);\n\n    this.setBookmarkIconState(isBookmarked);\n    this.element.dataset.testArticleBookmarkIsActive = isBookmarked;\n  }\n\n  updateArticleUrlWithSharedParam() {\n    if (!this.hasShareUrlTarget) {\n      return false;\n    }\n\n    const urlParams = new URLSearchParams(window.location.search);\n    if (['preview', 'shared'].every((param) => !urlParams.has(param))) {\n      let newUrl = applyQueryParams(\n        CurrentPage.getUrl(),\n        extractQueryParams(this.shareUrlTarget.href)\n      );\n\n      if (window.location.hash.length > 0) {\n        newUrl = newUrl + window.location.hash;\n      }\n\n      window.history.replaceState({}, '', newUrl);\n    }\n  }\n\n  setBookmarkIconState(isActive) {\n    this.bookmarkIconTarget.classList.toggle(\n      this.bookmarkIconActiveClass,\n      isActive\n    );\n    this.bookmarkIconTarget.classList.toggle(\n      this.bookmarkIconInactiveClass,\n      !isActive\n    );\n  }\n\n  showEbookDownloadModal(event) {\n    event.preventDefault();\n\n    loadAndDisplayInModal(this.ebookModalUrlValue);\n  }\n}\n\nexport function hide() {\n  document.dispatchEvent(new CustomEvent('article-actions:hide'));\n}\n\nexport function show() {\n  document.dispatchEvent(new CustomEvent('article-actions:show'));\n}\n","import { Controller } from '@hotwired/stimulus';\n\nimport CurrentPage from '@frontend/app/features/CurrentPage';\nimport {\n  apply as queryParamsApply,\n  extract as extractQueryParams,\n} from '@frontend/utils/query-params';\n\nexport default class extends Controller {\n  static targets = ['player', 'playButton'];\n  static values = {\n    srcUrl: String,\n    audioIsAttached: Boolean,\n  };\n\n  connect() {\n    if (!this.hasPlayerTarget || !this.audioIsAttachedValue) return;\n\n    if (CurrentPage.getShareUrl().isActive) {\n      const shareUrl = CurrentPage.getShareUrl().url;\n      const newSrcUrl = queryParamsApply(\n        this.srcUrlValue,\n        extractQueryParams(shareUrl)\n      );\n      this.srcUrlValue = newSrcUrl;\n      this.setServingViaShareUrl(true);\n    } else {\n      this.setServingViaShareUrl(false);\n    }\n\n    this.playerTarget.src = this.srcUrlValue;\n  }\n\n  setServingViaShareUrl(bool) {\n    this.playerTarget.dataset.testAudioPlayerIsServingViaShareUrl = bool;\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n  static targets = ['note', 'toggleIcon'];\n\n  noteTargetConnected(element) {\n    let candidate = element.previousElementSibling;\n    for (var attempts = 0; attempts < 3; attempts++) {\n      if (candidate.nodeName == 'P') break;\n      if (candidate.previousElementSibling == null) break;\n\n      candidate = candidate.previousElementSibling;\n    }\n\n    if (candidate !== null) {\n      const node = element.querySelector('.js-toggle-icon');\n      candidate.appendChild(node);\n    } else {\n      element.classList.add('hidden');\n    }\n  }\n\n  toggle(event) {\n    const toggleIconContainer = event.currentTarget.parentNode;\n    let nextAuthorNote = toggleIconContainer.nextElementSibling;\n\n    for (var attempts = 0; attempts < 3; attempts++) {\n      if (nextAuthorNote.classList.contains('js-author-note')) break;\n      if (nextAuthorNote.nextElementSibling == null) break;\n\n      nextAuthorNote = nextAuthorNote.nextElementSibling;\n    }\n\n    if (nextAuthorNote !== null) {\n      nextAuthorNote.classList.toggle('hidden');\n    }\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n  static values = {\n    isLoaded: { type: Boolean, default: false },\n    iframeHtml: String,\n  };\n\n  connect() {\n    document.addEventListener('embed:load', this.loadEmbed.bind(this));\n  }\n\n  notifyIframelyScriptIsLoaded() {\n    this.element.dispatchEvent(\n      new CustomEvent('embed:load', { bubbles: true })\n    );\n  }\n\n  loadEmbed(event) {\n    event.preventDefault();\n\n    if (this.isLoadedValue) {\n      return true;\n    }\n\n    if (window.__iframelyLoaded) {\n      this.embedIframelyIframe();\n      this.isLoadedValue = true;\n    } else {\n      if (window.__iframelySetup) {\n        return true;\n      }\n\n      var script = document.createElement('script');\n      script.src = `//cdn.iframe.ly/embed.js?key=${window.ENV.iframely.key}`;\n      script.async = true;\n      script.onload = () => {\n        window.__iframelyLoaded = true;\n        this.notifyIframelyScriptIsLoaded();\n      };\n      document.body.appendChild(script);\n\n      window.__iframelySetup = true;\n    }\n  }\n\n  embedIframelyIframe() {\n    this.element.innerHTML = this.iframeHtmlValue;\n    this.element.classList.add('article-extras-embed__container--is-loaded');\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\nimport CurrentUser from '@frontend/app/features/CurrentUser';\n\nexport default class extends Controller {\n  static targets = ['formContainer', 'checkbox'];\n\n  connect() {\n    if (!CurrentUser.isGuest() || !this.hasFormContainerTarget) {\n      return false;\n    }\n\n    this.element.addEventListener(\n      'ajax:success',\n      this.handleSubmitSuccessful.bind(this)\n    );\n  }\n\n  checkboxTargetConnected(checkbox) {\n    checkbox.addEventListener('click', this.handleCheckboxToggled.bind(this));\n  }\n\n  checkboxTargetDisconnected(checkbox) {\n    checkbox.removeEventlistener(\n      'click',\n      this.handleCheckboxToggled.bind(this)\n    );\n  }\n\n  handleCheckboxToggled() {\n    this.formContainerTarget.hidden = !this.checkboxTargets.some(\n      (cb) => cb.checked\n    );\n  }\n\n  handleSubmitSuccessful() {\n    this.checkboxTargets.forEach((cb) => (cb.disabled = true));\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\nimport CurrentPage from '@frontend/app/features/CurrentPage';\nimport CurrentUser from '@frontend/app/features/CurrentUser';\nimport WindowEnv from '@frontend/app/features/WindowEnv';\nimport { loadAndDisplay as loadAndDisplayInModal } from '@controllers/main/modal-window_controller';\nimport { show, displayNone, displayReset } from '@frontend/utils/dom';\nimport { extract as extractQueryParams } from '@frontend/utils/query-params';\n\nexport default class extends Controller {\n  static values = {\n    articleId: Number,\n    shareModalUrl: String,\n    hasPaywall: Boolean,\n  };\n\n  static targets = [\n    'markdownContent',\n    'shareUrlPromotionSubscriber',\n    'shareUrlPromotionTopbar',\n    'shareUrlPromotionTopbarMessageNoAuthor',\n    'shareUrlPromotionTopbarMessageWithAuthor',\n    'shareUrlPromotionTopbarMessageAuthor',\n    'tabBar',\n    'tabButton',\n    'readingTabButton',\n    'listeningTabButton',\n    'visibleWhenReading',\n    'visibleWhenListening',\n    'speakerIcon',\n  ];\n\n  connect() {\n    if (this.hasTabBarTarget) {\n      if (WindowEnv.isWithinPodcastApp()) {\n        this.setReadingTabActive();\n        displayNone(this.tabBarTarget);\n      } else {\n        this.updateSpeakerIcon(false);\n\n        if (CurrentPage.hasHash('hoeren')) {\n          this.setListeningTabActive();\n        } else {\n          this.setReadingTabActive();\n        }\n      }\n    }\n\n    document.addEventListener(\n      'article:display-share-url-promotion-topbar',\n      this.showShareUrlPromotionTopbar.bind(this)\n    );\n    document.addEventListener(\n      'audio-player:playing',\n      this.handleAudioPlaying.bind(this)\n    );\n    document.addEventListener(\n      'audio-player:stopped',\n      this.handleAudioStopped.bind(this)\n    );\n\n    this.displayShareUrlPromotionTopbarForPocketUsers();\n    this.displayShareUrlPromotionForSubscribers();\n  }\n\n  openReadingTab() {\n    CurrentPage.setHash('lesen');\n    this.setReadingTabActive();\n  }\n\n  setReadingTabActive() {\n    this.setTabActive(this.readingTabButtonTarget);\n    this.visibleWhenListeningTargets.forEach((element) => displayNone(element));\n    this.visibleWhenReadingTargets.forEach((element) => displayReset(element));\n  }\n\n  openListeningTab() {\n    CurrentPage.setHash('hoeren');\n    this.setListeningTabActive();\n  }\n\n  setListeningTabActive() {\n    this.setTabActive(this.listeningTabButtonTarget);\n    this.visibleWhenReadingTargets.forEach((element) => displayNone(element));\n    this.visibleWhenListeningTargets.forEach((element) =>\n      displayReset(element)\n    );\n  }\n\n  setTabActive(activeTabElement) {\n    this.tabButtonTargets.forEach((element) =>\n      element.classList.remove('is-active')\n    );\n    activeTabElement.classList.add('is-active');\n  }\n\n  showShareUrlPromotionTopbar() {\n    show(this.shareUrlPromotionTopbarTarget);\n\n    const shareUrl = CurrentPage.getShareUrl();\n    if (shareUrl.sharedBy) {\n      this.shareUrlPromotionTopbarMessageAuthorTarget.innerHTML =\n        shareUrl.sharedBy;\n      show(this.shareUrlPromotionTopbarMessageWithAuthorTarget);\n    } else {\n      show(this.shareUrlPromotionTopbarMessageNoAuthorTarget);\n    }\n  }\n\n  showShareUrlModal() {\n    loadAndDisplayInModal(this.shareModalUrlValue);\n  }\n\n  handleAudioPlaying() {\n    this.updateSpeakerIcon(true);\n  }\n\n  handleAudioStopped() {\n    this.updateSpeakerIcon(false);\n  }\n\n  displayShareUrlPromotionTopbarForPocketUsers() {\n    const params = extractQueryParams(window.location.search);\n    if (params['utm_source'] === 'pocket-unlocked') {\n      this.shareUrlPromotionTopbarMessageNoAuthorTarget.innerHTML =\n        'Krautreporter schenkt dir diesen Artikel. Lerne unsere Arbeit jetzt kostenlos kennen.';\n      show(this.shareUrlPromotionTopbarTarget);\n      show(this.shareUrlPromotionTopbarMessageNoAuthorTarget);\n      this.shareUrlPromotionTopbarTarget.classList.add(\n        'article-share-url-promotion-topbar--pocket'\n      );\n    }\n  }\n\n  displayShareUrlPromotionForSubscribers() {\n    if (!this.hasPaywallValue || !CurrentUser.isSubscriber()) return false;\n\n    show(this.shareUrlPromotionSubscriberTarget);\n    document.body.style.setProperty(\n      '--half-cinema-share-url-subscriber-offset',\n      `${this.shareUrlPromotionSubscriberTarget.offsetHeight}px`\n    );\n  }\n\n  updateSpeakerIcon(shouldBeOn) {\n    if (shouldBeOn) {\n      displayReset(this.speakerIconTarget);\n    } else {\n      displayNone(this.speakerIconTarget);\n    }\n  }\n}\n\nexport function displayShareUrlPromotionTopbar() {\n  document.dispatchEvent(\n    new CustomEvent('article:display-share-url-promotion-topbar')\n  );\n}\n","import { Controller } from '@hotwired/stimulus';\nimport CurrentPage from '@frontend/app/features/CurrentPage';\nimport CurrentUser from '@frontend/app/features/CurrentUser';\nimport { displayShareUrlPromotionTopbar } from '@controllers/main/article_controller';\nimport { extract as extractQueryParams } from '@frontend/utils/query-params';\n\nexport default class extends Controller {\n  connect() {\n    this.paywallDivider = document.querySelector('.js-paywall-divider');\n    if (!CurrentPage.isArticle() || !this.paywallDivider) return false;\n\n    this.load();\n  }\n\n  load() {\n    this.paywallDivider.style.height = '1px';\n\n    if (CurrentPage.isUtmSourceFromPocket()) {\n      const unlockedArticleId = CurrentPage.getArticleId();\n      let articleUnlockedUntilDate;\n      let articleLockedUntilDate;\n      const articleLockedUntil = localStorage.getItem(\n        'paywall_pocket_locked_until'\n      );\n\n      // Article access Locked\n      if (articleLockedUntil) {\n        articleLockedUntilDate = new Date(Number.parseInt(articleLockedUntil));\n      } else {\n        const lockedFor = 14 * 24 * 60 * 60 * 1000; // Locked for 14 days\n        articleLockedUntilDate = new Date(new Date().getTime() + lockedFor);\n        localStorage.setItem(\n          'paywall_pocket_locked_until',\n          articleLockedUntilDate.getTime()\n        );\n      }\n\n      const articleUnlockedUntil = localStorage.getItem(\n        'paywall_pocket_unlocked_until'\n      );\n      let articleUnlockedId = localStorage.getItem(\n        'paywall_pocket_unlocked_article_id'\n      );\n\n      // Article access unlocked now for 1 hour\n      if (articleUnlockedUntil) {\n        articleUnlockedUntilDate = new Date(\n          Number.parseInt(articleUnlockedUntil)\n        );\n        articleUnlockedId = Number.parseInt(articleUnlockedId);\n      } else {\n        const validFor = 60 * 60 * 1000; // Valid for 1 hour\n        articleUnlockedUntilDate = new Date(new Date().getTime() + validFor);\n        articleUnlockedId = CurrentPage.getArticleId();\n        localStorage.setItem(\n          'paywall_pocket_unlocked_until',\n          articleUnlockedUntilDate.getTime()\n        );\n        localStorage.setItem(\n          'paywall_pocket_unlocked_article_id',\n          unlockedArticleId\n        );\n      }\n\n      if (\n        articleUnlockedUntilDate > new Date() &&\n        articleUnlockedId === unlockedArticleId\n      ) {\n        const params = extractQueryParams(window.location.search);\n        if (params['utm_source'] !== 'pocket-unlocked') {\n          window.location.href = `${CurrentPage.getArticleUrl()}?utm_source=pocket-unlocked&utm_campaign=pocket-wall-unlocked`;\n        }\n      } else {\n        if (articleLockedUntilDate > new Date()) {\n          window.location.href = `${CurrentPage.getArticleUrl()}?utm_source=redirected-pocket&utm_campaign=pocket-wall-locked`;\n        } else {\n          localStorage.removeItem('paywall_pocket_locked_until');\n          localStorage.removeItem('paywall_pocket_unlocked_until');\n          localStorage.removeItem('paywall_pocket_unlocked_article_id');\n          window.location.reload();\n        }\n      }\n    }\n\n    if (CurrentPage.isPaywallIframeLocked()) {\n      window.__paywallIframeLoadCompleted =\n        this.paywallIframeLoadCompleted.bind(this);\n\n      this.iframe = document.querySelector(`#${CurrentPage.paywallIframeId()}`);\n      this.iframe.setAttribute(\n        'onload',\n        'window.__paywallIframeLoadCompleted()'\n      );\n      this.iframe.src = CurrentPage.paywallIframeSrc();\n\n      const wallSibling = document.querySelector(\n        '.js-article-paywall, .js-follow-wall-template'\n      ).nextElementSibling;\n\n      if (wallSibling) {\n        this.blurSiblingNodes(wallSibling);\n      }\n    } else {\n      if (CurrentUser.isGuest()) {\n        // NB: The stimulus controller receiving this event is not registered\n        // at this point in time, so we offset the dispatch :/\n        // This sucks but I need to ship this.\n        setTimeout(() => {\n          this.displayShareUrlPromotion();\n        }, 1000);\n      } else {\n        this.paywallDivider.style = 'display: none';\n      }\n    }\n  }\n\n  blurSiblingNodes(node) {\n    do {\n      node.classList.add('json-ld-paywall-marker');\n      node.classList.add('blurred');\n      node.classList.add('hidden@print');\n      node = node.nextElementSibling;\n    } while (node);\n  }\n\n  paywallIframeLoadCompleted() {\n    this.iframe.contentWindow.addEventListener(\n      'resize',\n      this.handlePaywallIframeResize.bind(this)\n    );\n    this.handlePaywallIframeResize();\n    setTimeout(this.handlePaywallIframeResize.bind(this), 2000);\n  }\n\n  handlePaywallIframeResize() {\n    this.iframe.style.height =\n      this.iframe.contentDocument.body.scrollHeight + 'px';\n  }\n\n  displayShareUrlPromotion() {\n    const template = document.querySelector(\n      '.js-share-url-promotion-box-template'\n    );\n    this.paywallDivider.insertAdjacentElement('afterend', template);\n    displayShareUrlPromotionTopbar();\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n  static values = {\n    configurationUrl: String,\n  };\n\n  connect() {\n    this.element.classList.add(\n      'article-extras-podigee__container',\n      'hidden@print'\n    );\n  }\n\n  load() {\n    this.element.innerHTML = '';\n    const script = document.createElement('script');\n    script.src =\n      '//cdn.podigee.com/podcast-player/javascripts/podigee-podcast-player.js';\n    script.classList.add('podigee-podcast-player');\n    script.dataset.configuration = this.configurationUrlValue;\n    this.element.insertAdjacentElement('afterbegin', script);\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n  static targets = ['progressIndicator', 'content'];\n\n  connect() {\n    if (!this.hasContentTarget || !this.hasProgressIndicatorTarget)\n      return false;\n\n    window.addEventListener('resize', this.updateMeasure.bind(this), {\n      passive: true,\n    });\n    window.addEventListener('scroll', this.updateProgress.bind(this), {\n      passive: true,\n    });\n    this.intervalId = window.setInterval(this.handleInterval.bind(this), 5000);\n    this.update();\n  }\n\n  disconnect() {\n    if (this.intervalId) {\n      window.clearInterval(this.intervalId);\n    }\n  }\n\n  handleInterval() {\n    this.update();\n  }\n\n  update() {\n    this.updateMeasure();\n    this.updateProgress();\n  }\n\n  updateMeasure() {\n    this.articleHeight = this.contentTarget.getBoundingClientRect().height;\n    this.viewportHeight = Math.max(\n      document.documentElement.clientHeight,\n      window.innerHeight || 0\n    );\n  }\n\n  updateProgress() {\n    const scrollOffsetY =\n      window.pageYOffset || document.documentElement.scrollTop;\n    let currentProgress = 0;\n    if (scrollOffsetY > this.contentTarget.offsetTop - this.viewportHeight) {\n      const scrolledDistance =\n        (scrollOffsetY - this.contentTarget.offsetTop + this.viewportHeight) /\n        this.articleHeight;\n      currentProgress = Number.parseInt(scrolledDistance * 100);\n    }\n    this.progressIndicatorTarget.style.width = currentProgress.toString() + '%';\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\nimport {\n  hide as hideArticleActions,\n  show as showArticleActions,\n} from '@controllers/main/article-actions_controller';\nimport queryString from 'query-string';\n\nexport default class extends Controller {\n  static targets = ['content', 'navbar', 'topbar'];\n  static values = {\n    wasScrollingDown: { type: Boolean, default: false },\n  };\n\n  connect() {\n    if (\n      !this.hasContentTarget ||\n      !this.hasNavbarTarget ||\n      !this.hasTopbarTarget\n    )\n      return false;\n\n    const query = queryString.parse(window.location.search);\n    if (query?.preview === 'true') {\n      hideArticleActions();\n      this.hideTopbar();\n    } else {\n      window.addEventListener('scroll', this.handleScrollChange.bind(this));\n      this.updateCurrentScrollPosition();\n      this.handleScrollChange();\n    }\n  }\n\n  handleScrollChange() {\n    if (this.isScrollPositionInsideOrAboveArticle()) {\n      if (this.isScrollingDown()) {\n        if (this.wasScrollingDownValue !== true) {\n          this.hideTopbar();\n          hideArticleActions();\n          this.wasScrollingDownValue = true;\n        }\n      } else {\n        if (this.wasScrollingDownValue === true) {\n          this.showTopbar();\n          showArticleActions();\n          this.wasScrollingDownValue = false;\n        }\n      }\n    } else {\n      this.showTopbar();\n    }\n\n    this.updateCurrentScrollPosition();\n  }\n\n  updateCurrentScrollPosition() {\n    this.previousScrollPosition = this.detectScrollPosition();\n  }\n\n  detectScrollPosition() {\n    return window.pageYOffset || document.documentElement.scrollTop;\n  }\n\n  isScrollPositionInsideOrAboveArticle() {\n    const navbarPosFromTop = this.navbarTarget.getBoundingClientRect().top * -1;\n    const navbarHeight = this.navbarTarget.clientHeight;\n    const navbarOutOfView = navbarHeight - navbarPosFromTop < 0;\n\n    const contentPosFromTop = this.contentTarget.getBoundingClientRect().top;\n    const contentHeight = this.contentTarget.clientHeight;\n    const halfWindowHeight = window.innerHeight / 2;\n    const contentStillHalfInView =\n      contentPosFromTop - halfWindowHeight + contentHeight > 0;\n\n    return navbarOutOfView & contentStillHalfInView;\n  }\n\n  isScrollingDown() {\n    return this.previousScrollPosition < this.detectScrollPosition();\n  }\n\n  hideTopbar() {\n    this.topbarTarget.classList.add('navbar-hidden');\n  }\n\n  showTopbar() {\n    this.topbarTarget.classList.remove('navbar-hidden');\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\nimport CurrentUser from '@frontend/app/features/CurrentUser';\nimport { hide } from '@frontend/utils/dom';\n\nexport default class extends Controller {\n  static targets = ['bookmarkCta', 'bookmarkIcon'];\n  static values = {\n    articleId: Number,\n  };\n  static classes = ['bookmarkIconActive', 'bookmarkIconInactive'];\n\n  connect() {\n    if (CurrentUser.isGuest()) {\n      hide(this.bookmarkCtaTarget);\n    } else {\n      this.updateBookmarkDisplay();\n    }\n  }\n\n  updateBookmarkDisplay() {\n    this.setBookmarkIconState(\n      CurrentUser.bookmarks().includes(this.articleIdValue)\n    );\n  }\n\n  setBookmarkIconState(isActive) {\n    this.bookmarkIconTarget.classList.toggle(\n      this.bookmarkIconActiveClass,\n      isActive\n    );\n    this.bookmarkIconTarget.classList.toggle(\n      this.bookmarkIconInactiveClass,\n      !isActive\n    );\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\nimport { hide, show } from '@frontend/utils/dom';\n\nexport default class extends Controller {\n  static targets = ['expandButton', 'collapseButton', 'collapsibleSection'];\n  static classes = ['collapse'];\n\n  expand() {\n    hide(this.expandButtonTarget);\n    show(this.collapseButtonTarget);\n    this.collapsibleSectionTarget.classList.remove(this.collapseClass);\n  }\n\n  collapse() {\n    hide(this.collapseButtonTarget);\n    show(this.expandButtonTarget);\n    this.collapsibleSectionTarget.classList.add(this.collapseClass);\n  }\n}\n","import Rails from '@rails/ujs';\nimport debounce from 'lodash.debounce';\nimport { Controller } from '@hotwired/stimulus';\nimport { runWhenDomLoaded } from '@frontend/utils/dom';\n\nexport default class extends Controller {\n  static targets = [\n    'form',\n    'input',\n    'results',\n    'hideWhileSearching',\n    'algoliaSearchLink',\n  ];\n  static values = { isTestEnv: Boolean };\n\n  connect() {\n    const debounceTimeoutInMs = this.isTestEnvValue ? 0 : 1000;\n    this.debouncedSubmit = debounce(\n      this.submitOrHide.bind(this),\n      debounceTimeoutInMs\n    );\n\n    if (this.inputTarget.value !== '') {\n      runWhenDomLoaded(() => {\n        this.submitForm();\n        this.formTarget.addEventListener(\n          'ajax:complete',\n          () => {\n            this.inputTarget.scrollIntoView({\n              behavior: 'instant',\n              block: 'start',\n            });\n            this.inputTarget.focus({\n              preventScroll: false,\n              focusVisible: true,\n            });\n            const pos = this.inputTarget.value.length;\n            this.inputTarget.setSelectionRange(pos, pos);\n          },\n          { once: true }\n        );\n      });\n    }\n\n    if (this.hasAlgoliaSearchLinkTarget) {\n      this.algoliaSearchUrl = this.algoliaSearchLinkTarget.href;\n    }\n  }\n\n  submitOrHide() {\n    if (this.inputTarget.value.length > 0) {\n      this.submitForm();\n    } else {\n      this.clearResults();\n    }\n  }\n\n  submitFormDebounced() {\n    this.debouncedSubmit.call();\n  }\n\n  submitForm() {\n    Rails.fire(this.formTarget, 'submit');\n  }\n\n  applyResults(event) {\n    if (event.target !== this.formTarget) {\n      return false;\n    }\n\n    this.updateUrls();\n    this.clearResults();\n\n    const [, , xhr] = event.detail;\n    this.hideWhileSearchingTarget.insertAdjacentHTML(\n      'beforebegin',\n      xhr.responseText\n    );\n\n    this.hideWhileSearchingTarget.classList.add('hidden');\n  }\n\n  updateUrls() {\n    const query = encodeURIComponent(this.inputTarget.value);\n    let querySuffix = '';\n    if (query.length > 0) {\n      querySuffix = `?search_query=${query}`;\n    }\n\n    if (history) {\n      history.replaceState({ query }, '', `${location.pathname}${querySuffix}`);\n    }\n\n    if (this.algoliaSearchUrl) {\n      this.algoliaSearchLinkTarget.href = `${this.algoliaSearchUrl}${querySuffix}`;\n    }\n  }\n\n  clearResults() {\n    this.updateUrls();\n    if (this.hasResultsTarget) this.resultsTarget.remove();\n    this.hideWhileSearchingTarget.classList.remove('hidden');\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n  static classes = ['collapsedTeasers'];\n\n  connect() {\n    if (\n      this.element.querySelectorAll(\n        '[data-article-teaser-component-is-alternative-format]'\n      ).length > 0\n    ) {\n      this.element.classList.add(this.collapsedTeasersClass);\n    }\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n  insertImage(event) {\n    const imageId = parseInt(event.currentTarget.dataset.id);\n    window.kraut.MarkdownEditor.appendText(`[image:${imageId}]\\n`);\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\nimport { toggleVisiblity } from '@frontend/utils/dom';\n\nexport default class extends Controller {\n  static targets = [\n    'teamRadioButton',\n    'utmCampaignSection',\n    'utmCampaignInput',\n    'followWallRadioButton',\n    'followWallInput',\n  ];\n  static values = {\n    activeTeam: { type: String, default: 'authors' },\n  };\n\n  connect() {\n    const activeTeamFromStorage = localStorage.getItem(\n      this.activeTeamLocalStorageKey\n    );\n    if (activeTeamFromStorage) {\n      this.activeTeamValue = activeTeamFromStorage;\n    }\n  }\n\n  changeTeam(event) {\n    this.activeTeamValue = event.params.teamValue;\n    localStorage.setItem(this.activeTeamLocalStorageKey, this.activeTeamValue);\n  }\n\n  activeTeamValueChanged() {\n    this.teamRadioButtonTargets.forEach((target) => {\n      target.checked = target.value === this.activeTeamValue;\n    });\n\n    const hideAndDisableUtmCampaign = this.activeTeamValue !== 'marketing';\n    toggleVisiblity(this.utmCampaignSectionTarget, !hideAndDisableUtmCampaign);\n    this.utmCampaignInputTarget.disabled = hideAndDisableUtmCampaign;\n  }\n\n  lifetimeChanged() {\n    this.followWallInputTarget.value = this.followWallRadioButtonTarget.checked;\n  }\n\n  get activeTeamLocalStorageKey() {\n    return 'author-share-urls:active-team';\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\nimport { toggleVisiblity } from '@frontend/utils/dom';\n\nexport default class extends Controller {\n  static targets = ['textSource', 'characterCounter'];\n  static values = {\n    maxLength: Number,\n    isAlwaysVisible: { type: Boolean, default: false },\n  };\n\n  async connect() {\n    this.limitWasExceeded = false;\n\n    this.textSourceTarget.addEventListener(\n      this.changeEventByTagName(this.textSourceTarget),\n      this.update.bind(this)\n    );\n    this.update();\n  }\n\n  update() {\n    const textLength = this.textByTagName(this.textSourceTarget).length;\n    this.updateCharacterCounter(textLength);\n\n    toggleVisiblity(\n      this.characterCounterTarget,\n      textLength > 0 || this.isAlwaysVisibleValue\n    );\n  }\n\n  changeEventByTagName(node) {\n    switch (node.tagName) {\n      case 'TEXTAREA':\n      case 'INPUT':\n        return 'keyup';\n      case 'TRIX-EDITOR':\n        return 'trix-change';\n    }\n  }\n\n  textByTagName(node) {\n    switch (node.tagName) {\n      case 'TEXTAREA':\n      case 'INPUT':\n        return node.value;\n      case 'TRIX-EDITOR':\n        return node.innerText;\n    }\n  }\n\n  updateCharacterCounter(textLength) {\n    if (this.maxLengthValue > 0) {\n      this.characterCounterTarget.innerText = `${textLength} / ${this.maxLengthValue} Zeichen`;\n      const isInvalid = textLength >= this.maxLengthValue;\n\n      if (isInvalid && !this.limitWasExceeded) {\n        this.limitWasExceeded = true;\n        this.element.dispatchEvent(\n          new CustomEvent('character-counter:limit-exceeded', { bubbles: true })\n        );\n      } else if (this.limitWasExceeded) {\n        this.limitWasExceeded = false;\n        this.element.dispatchEvent(\n          new CustomEvent('character-counter:limit-kept', { bubbles: true })\n        );\n      }\n\n      this.characterCounterTarget.classList.toggle(\n        'character-counter--invalid',\n        isInvalid\n      );\n    } else {\n      this.characterCounterTarget.innerText = `${textLength} Zeichen`;\n    }\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\nimport copyAndNotify from '@frontend/utils/copy-and-notify';\n\nexport default class extends Controller {\n  static values = {\n    url: String,\n    successMessage: {\n      type: String,\n      default: 'Link kopiert.',\n    },\n  };\n\n  connect() {\n    this.element.addEventListener('click', this.handleClick.bind(this));\n    this.element.addEventListener('onkeydown', this.handleClick.bind(this));\n  }\n\n  async handleClick(event) {\n    event.preventDefault();\n\n    const url = this.hasUrlValue ? this.urlValue : this.element.href;\n    copyAndNotify(url, this.successMessageValue);\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\nimport CurrentUser from '@frontend/app/features/CurrentUser';\n\nexport default class extends Controller {\n  static targets = ['profileImage', 'fullName'];\n\n  profileImageTargetConnected(img) {\n    img.src = CurrentUser.getProfileImage(img.width, img.height);\n  }\n\n  fullNameTargetConnected(node) {\n    node.innerHTML = CurrentUser.fullName();\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\nimport { hide, show } from '@frontend/utils/dom';\n\nexport default class extends Controller {\n  static targets = [\n    'tenMinDemoArticles',\n    'twentyMinDemoArticles',\n    'tenMinDemoArticlesCta',\n    'twentyMinDemoArticlesCta',\n  ];\n  static classes = ['isActive'];\n\n  connect() {\n    this.showTenMinDemoArticles();\n  }\n\n  showTenMinDemoArticles(event) {\n    if (event) {\n      event.preventDefault();\n    }\n\n    this.setCtaActive(this.tenMinDemoArticlesCtaTarget);\n    this.setCtaInactive(this.twentyMinDemoArticlesCtaTarget);\n\n    hide(this.twentyMinDemoArticlesTarget);\n    show(this.tenMinDemoArticlesTarget);\n  }\n\n  showTwentyMinDemoArticles(event) {\n    if (event) {\n      event.preventDefault();\n    }\n\n    this.setCtaInactive(this.tenMinDemoArticlesCtaTarget);\n    this.setCtaActive(this.twentyMinDemoArticlesCtaTarget);\n\n    show(this.twentyMinDemoArticlesTarget);\n    hide(this.tenMinDemoArticlesTarget);\n  }\n\n  setCtaActive(element) {\n    element.classList.add(this.isActiveClass);\n  }\n\n  setCtaInactive(element) {\n    element.classList.remove(this.isActiveClass);\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n  static values = {\n    reenableAfterSuccess: { type: Boolean, default: true },\n  };\n\n  connect() {\n    this.form = this.element.querySelector('form');\n\n    if (this.form) {\n      this.form.addEventListener(\n        'ajax:beforeSend',\n        this.handleBeforeSubmit.bind(this)\n      );\n      this.form.addEventListener('ajax:success', this.handleSuccess.bind(this));\n      this.form.addEventListener('ajax:error', this.handleError.bind(this));\n\n      this.submitButton = Array.from(this.form.querySelector('[type=submit]'));\n      this.formElements = Array.from(\n        this.form.querySelectorAll(\n          'input:not([type=submit]), button:not([type=submit])'\n        )\n      );\n    }\n  }\n\n  handleBeforeSubmit() {\n    this.toggleDisabledState(true);\n  }\n\n  handleSuccess() {\n    if (this.reenableAfterSuccessValue) {\n      this.toggleDisabledState(false);\n    }\n  }\n\n  handleError() {\n    this.toggleDisabledState(false);\n  }\n\n  toggleDisabledState(isDisabled) {\n    this.formElements.forEach((element) => (element.disabled = isDisabled));\n  }\n}\n","/**\n * @internal\n * Sends an event to Plausible's API\n *\n * @param data - Event data to send\n * @param options - Event options\n */\nexport function sendEvent(eventName, data, options) {\n    const isLocalhost = /^localhost$|^127(?:\\.[0-9]+){0,2}\\.[0-9]+$|^(?:0*:)*?:?0*1$/.test(location.hostname) || location.protocol === 'file:';\n    if (!data.trackLocalhost && isLocalhost) {\n        return console.warn('[Plausible] Ignoring event because website is running locally');\n    }\n    try {\n        if (window.localStorage.plausible_ignore === 'true') {\n            return console.warn('[Plausible] Ignoring event because \"plausible_ignore\" is set to \"true\" in localStorage');\n        }\n    }\n    catch (e) {\n        null;\n    }\n    const payload = {\n        n: eventName,\n        u: data.url,\n        d: data.domain,\n        r: data.referrer,\n        w: data.deviceWidth,\n        h: data.hashMode ? 1 : 0,\n        p: options && options.props ? JSON.stringify(options.props) : undefined,\n    };\n    const req = new XMLHttpRequest();\n    req.open('POST', `${data.apiHost}/api/event`, true);\n    req.setRequestHeader('Content-Type', 'text/plain');\n    req.send(JSON.stringify(payload));\n    // eslint-disable-next-line functional/immutable-data\n    req.onreadystatechange = () => {\n        if (req.readyState !== 4)\n            return;\n        if (options && options.callback) {\n            options.callback();\n        }\n    };\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVxdWVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9saWIvcmVxdWVzdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUEyQkE7Ozs7OztHQU1HO0FBQ0gsTUFBTSxVQUFVLFNBQVMsQ0FDdkIsU0FBaUIsRUFDakIsSUFBZ0MsRUFDaEMsT0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QUFHLENBQUMsSUFBSSxDQUFDLE1BQU0sRUFBRSxHQUFHLElBQUksQ0FBQyxPQUFPLFlBQVksRUFBRSxJQUFJLENBQUMsQ0FBQztJQUNwRCxHQUFHLENBQUMsZ0JBQWdCLENBQUMsY0FBYyxFQUFFLFlBQVksQ0FBQyxDQUFDO0lBQ25ELEdBQUcsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDO0lBQ2xDLHFEQUFxRDtJQUNyRCxHQUFHLENBQUMsa0JBQWtCLEdBQUcsR0FBRyxFQUFFO1FBQzVCLElBQUksR0FBRyxDQUFDLFVBQVUsS0FBSyxDQUFDO1lBQUUsT0FBTztRQUNqQyxJQUFJLE9BQU8sSUFBSSxPQUFPLENBQUMsUUFBUSxFQUFFO1lBQy9CLE9BQU8sQ0FBQyxRQUFRLEVBQUUsQ0FBQztTQUNwQjtJQUNILENBQUMsQ0FBQztBQUNKLENBQUMifQ==","import { sendEvent } from './request';\n/**\n * Initializes the tracker with your default values.\n *\n * ### Example (es module)\n * ```js\n * import Plausible from 'plausible-tracker'\n *\n * const { enableAutoPageviews, trackEvent } = Plausible({\n *   domain: 'my-app-domain.com',\n *   hashMode: true\n * })\n *\n * enableAutoPageviews()\n *\n * function onUserRegister() {\n *   trackEvent('register')\n * }\n * ```\n *\n * ### Example (commonjs)\n * ```js\n * var Plausible = require('plausible-tracker');\n *\n * var { enableAutoPageviews, trackEvent } = Plausible({\n *   domain: 'my-app-domain.com',\n *   hashMode: true\n * })\n *\n * enableAutoPageviews()\n *\n * function onUserRegister() {\n *   trackEvent('register')\n * }\n * ```\n *\n * @param defaults - Default event parameters that will be applied to all requests.\n */\nexport default function Plausible(defaults) {\n    const getConfig = () => ({\n        hashMode: false,\n        trackLocalhost: false,\n        url: location.href,\n        domain: location.hostname,\n        referrer: document.referrer || null,\n        deviceWidth: window.innerWidth,\n        apiHost: 'https://plausible.io',\n        ...defaults,\n    });\n    const trackEvent = (eventName, options, eventData) => {\n        sendEvent(eventName, { ...getConfig(), ...eventData }, options);\n    };\n    const trackPageview = (eventData, options) => {\n        trackEvent('pageview', options, eventData);\n    };\n    const enableAutoPageviews = () => {\n        const page = () => trackPageview();\n        // Attach pushState and popState listeners\n        const originalPushState = history.pushState;\n        if (originalPushState) {\n            // eslint-disable-next-line functional/immutable-data\n            history.pushState = function (data, title, url) {\n                originalPushState.apply(this, [data, title, url]);\n                page();\n            };\n            addEventListener('popstate', page);\n        }\n        // Attach hashchange listener\n        if (defaults && defaults.hashMode) {\n            addEventListener('hashchange', page);\n        }\n        // Trigger first page view\n        trackPageview();\n        return function cleanup() {\n            if (originalPushState) {\n                // eslint-disable-next-line functional/immutable-data\n                history.pushState = originalPushState;\n                removeEventListener('popstate', page);\n            }\n            if (defaults && defaults.hashMode) {\n                removeEventListener('hashchange', page);\n            }\n        };\n    };\n    const enableAutoOutboundTracking = (targetNode = document, observerInit = {\n        subtree: true,\n        childList: true,\n        attributes: true,\n        attributeFilter: ['href'],\n    }) => {\n        function trackClick(event) {\n            trackEvent('Outbound Link: Click', { props: { url: this.href } });\n            /* istanbul ignore next */\n            // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n            // @ts-ignore\n            if (!(typeof process !== 'undefined' &&\n                process &&\n                process.env.NODE_ENV === 'test')) {\n                setTimeout(() => {\n                    // eslint-disable-next-line functional/immutable-data\n                    location.href = this.href;\n                }, 150);\n            }\n            event.preventDefault();\n        }\n        // eslint-disable-next-line functional/prefer-readonly-type\n        const tracked = new Set();\n        function addNode(node) {\n            if (node instanceof HTMLAnchorElement) {\n                if (node.host !== location.host) {\n                    node.addEventListener('click', trackClick);\n                    tracked.add(node);\n                }\n            } /* istanbul ignore next */\n            else if ('querySelectorAll' in node) {\n                node.querySelectorAll('a').forEach(addNode);\n            }\n        }\n        function removeNode(node) {\n            if (node instanceof HTMLAnchorElement) {\n                node.removeEventListener('click', trackClick);\n                tracked.delete(node);\n            } /* istanbul ignore next */\n            else if ('querySelectorAll' in node) {\n                node.querySelectorAll('a').forEach(removeNode);\n            }\n        }\n        const observer = new MutationObserver((mutations) => {\n            mutations.forEach((mutation) => {\n                if (mutation.type === 'attributes') {\n                    // Handle changed href\n                    removeNode(mutation.target);\n                    addNode(mutation.target);\n                } /* istanbul ignore next */\n                else if (mutation.type === 'childList') {\n                    // Handle added nodes\n                    mutation.addedNodes.forEach(addNode);\n                    // Handle removed nodes\n                    mutation.removedNodes.forEach(removeNode);\n                }\n            });\n        });\n        // Track existing nodes\n        targetNode.querySelectorAll('a').forEach(addNode);\n        // Observe mutations\n        observer.observe(targetNode, observerInit);\n        return function cleanup() {\n            tracked.forEach((a) => {\n                a.removeEventListener('click', trackClick);\n            });\n            tracked.clear();\n            observer.disconnect();\n        };\n    };\n    return {\n        trackEvent,\n        trackPageview,\n        enableAutoPageviews,\n        enableAutoOutboundTracking,\n    };\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhY2tlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9saWIvdHJhY2tlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQWdCLFNBQVMsRUFBRSxNQUFNLFdBQVcsQ0FBQztBQXFMcEQ7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztHQW9DRztBQUNILE1BQU0sQ0FBQyxPQUFPLFVBQVUsU0FBUyxDQUMvQixRQUErQjtJQU8vQixNQUFNLFNBQVMsR0FBRyxHQUErQixFQUFFLENBQUMsQ0FBQztRQUNuRCxRQUFRLEVBQUUsS0FBSztRQUNmLGNBQWMsRUFBRSxLQUFLO1FBQ3JCLEdBQUcsRUFBRSxRQUFRLENBQUMsSUFBSTtRQUNsQixNQUFNLEVBQUUsUUFBUSxDQUFDLFFBQVE7UUFDekIsUUFBUS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U8sQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDLEVBQUUsRUFBRTtnQkFDcEIsQ0FBQyxDQUFDLG1CQUFtQixDQUFDLE9BQU8sRUFBRSxVQUFVLENBQUMsQ0FBQztZQUM3QyxDQUFDLENBQUMsQ0FBQztZQUNILE9BQU8sQ0FBQyxLQUFLLEVBQUUsQ0FBQztZQUNoQixRQUFRLENBQUMsVUFBVSxFQUFFLENBQUM7UUFDeEIsQ0FBQyxDQUFDO0lBQ0osQ0FBQyxDQUFDO0lBRUYsT0FBTztRQUNMLFVBQVU7UUFDVixhQUFhO1FBQ2IsbUJBQW1CO1FBQ25CLDBCQUEwQjtLQUMzQixDQUFDO0FBQ0osQ0FBQyJ9","import { Controller } from '@hotwired/stimulus';\nimport { patch } from '@rails/request.js';\nimport CurrentPage from '@frontend/app/features/CurrentPage';\nimport Plausible from 'plausible-tracker';\nimport MatomoTracker from '@frontend/app/features/MatomoTracker';\n\nexport default class extends Controller {\n  connect() {\n    const goals = window.ENV.userGoals;\n    if (goals.length === 0) return;\n\n    const { trackEvent } = Plausible({ trackLocalhost: false });\n    goals.forEach((goal) => {\n      switch (goal.system) {\n        case 'plausible':\n          trackEvent(goal.identifier, {\n            callback: () => this.markGoalProcessed(goal.id),\n          });\n          break;\n        case 'matomo':\n          MatomoTracker.trackGoal(Number.parseInt(goal.identifier));\n          this.markGoalProcessed(goal.id);\n          break;\n      }\n    });\n  }\n\n  markGoalProcessed(goalId) {\n    patch(\n      CurrentPage.getUserGoalMarkTrackedActionPath().replace(\n        ':user_goal_id',\n        goalId\n      )\n    );\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\nimport { hide, show } from '@frontend/utils/dom';\n\nexport default class extends Controller {\n  static targets = ['linkToArchive'];\n\n  connect() {\n    hide(this.linkToArchiveTarget);\n    document.addEventListener(\n      'article-teaser-index:no-more-items',\n      this.handleArticleTeaserIndexNoMoreItems.bind(this)\n    );\n  }\n\n  handleArticleTeaserIndexNoMoreItems() {\n    show(this.linkToArchiveTarget);\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\nimport ImgixHelper from '@frontend/app/features/ImgixHelper';\n\nexport default class extends Controller {\n  connect() {\n    ImgixHelper.refresh();\n  }\n}\n","// See https://codepen.io/GeoffreyCrofte/pen/zYrxKRe\nimport { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n  static targets = ['input', 'code'];\n  static values = {\n    backspace: 8,\n    tab: 9,\n    shift: 16,\n    ctrl: 17,\n    alt: 18,\n    arrowLeft: 37,\n    meta: 224, // Command-key on macOS\n  };\n\n  handleInput(event) {\n    const keyCode = event.keyCode;\n    const input = event.target;\n    const value = input.value;\n    const previous = input.previousElementSibling;\n    const next = input.nextElementSibling;\n\n    if (\n      keyCode === this.shiftValue ||\n      keyCode === this.tabValue ||\n      keyCode === this.metaValue ||\n      keyCode === this.altValue ||\n      keyCode === this.ctrlValue\n    ) {\n      return;\n    }\n\n    if (\n      (keyCode === this.backspaceValue || keyCode === this.arrowLeftValue) &&\n      previous &&\n      previous.tagName === 'INPUT'\n    ) {\n      previous.select();\n      return;\n    }\n\n    if (value.length > 1) {\n      this.fillNext(input, value.slice(0, 6));\n    } else {\n      if (!this.validNumber(value)) return false;\n\n      if (next) {\n        next.select();\n      }\n    }\n\n    this.updateCodeTarget();\n  }\n\n  validNumber(char) {\n    return /^\\d{1}$/.test(char);\n  }\n\n  fillNext(input, remainingText) {\n    const value = remainingText.slice(0, 1);\n    if (!this.validNumber(value)) {\n      input.value = '';\n      return false;\n    }\n\n    input.value = value;\n    if (input.nextElementSibling && remainingText.length > 1) {\n      this.fillNext(\n        input.nextElementSibling,\n        remainingText.slice(1, remainingText.length)\n      );\n    } else {\n      this.updateCodeTarget();\n    }\n  }\n\n  updateCodeTarget() {\n    const code = Array.from(this.inputTargets)\n      .map((input) => input.value)\n      .join('');\n    this.codeTarget.value = code;\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n  static targets = ['toggled'];\n\n  toggle(event) {\n    event.preventDefault();\n    this.toggledTargets.forEach((target) => {\n      target.hidden = !target.hidden;\n    });\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\nimport { showNotification } from '@components/notification_box/component_controller';\n\nexport default class extends Controller {\n  static targets = ['failureMessages'];\n  static values = {\n    newsletterSubscriptionId: Number,\n  };\n\n  connect() {\n    this.element.addEventListener(\n      'ajax:success',\n      this.updateSuccesful.bind(this)\n    );\n    this.element.addEventListener('ajax:error', this.updateFailure.bind(this));\n\n    this.failureMessagesTarget.hidden = true;\n  }\n\n  updateSuccesful(event) {\n    this.failureMessagesTarget.hidden = true;\n\n    const [data] = event.detail;\n    if (data.status == 'ok') {\n      const message = data.messages.join('. ');\n      showNotification(message, { timeoutInMs: 3500 });\n    }\n  }\n\n  updateFailure(event) {\n    const [data] = event.detail;\n    let failureMessage = '';\n    if (data.error_messages) {\n      failureMessage = data.error_messages.join('\\n<br/>');\n    } else {\n      failureMessage =\n        'Da ist etwas schiefgegangen. Kontaktiere unseren Support.';\n    }\n    this.failureMessagesTarget.hidden = false;\n    this.failureMessagesTarget.innerHTML = failureMessage;\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\nimport { show, toggleVisiblity } from '@frontend/utils/dom';\n\nexport default class extends Controller {\n  static targets = ['newsletterSubscription', 'filterCta'];\n  static classes = ['stickyForm', 'activeFilterCta'];\n\n  connect() {\n    this.setFilterActive(this.filterCtaTargets[0]);\n    document.body.dispatchEvent(\n      new CustomEvent('form-overlay:set-heading', {\n        detail: { heading: 'Wähle weitere Newsletter und trage dich ein' },\n      })\n    );\n  }\n\n  selectFilter(event) {\n    const filterValue = event.currentTarget.dataset.filterValue;\n    this.setFilterActive(event.currentTarget);\n\n    if (filterValue == 'all') {\n      this.newsletterSubscriptionTargets.forEach((target) => show(target));\n    } else {\n      this.newsletterSubscriptionTargets.forEach((target) => {\n        toggleVisiblity(\n          target,\n          target.dataset.newsletterSubscriptionType == filterValue\n        );\n      });\n    }\n  }\n\n  setFilterActive(cta) {\n    this.filterCtaTargets.forEach((target) =>\n      target.classList.remove(this.activeFilterCtaClass)\n    );\n    cta.classList.add(this.activeFilterCtaClass);\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n  static targets = ['profileImageFileInput', 'profileImageSubmitButton'];\n\n  connect() {\n    this.profileImageFileInputTarget.addEventListener(\n      'change',\n      this.handleProfileImageFileChoosen.bind(this)\n    );\n  }\n\n  chooseFileForProfileImage(event) {\n    event.preventDefault();\n    this.profileImageFileInputTarget.click();\n  }\n\n  handleProfileImageFileChoosen() {\n    this.profileImageSubmitButtonTarget.click();\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n  connect() {\n    this.element.addEventListener('change', () => {\n      this.element.requestSubmit();\n    });\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\nimport { showNotification } from '@components/notification_box/component_controller';\n\nexport default class extends Controller {\n  static values = {\n    successMessage: { type: String, default: '' },\n  };\n\n  connect() {\n    this.element.addEventListener(\n      'ajax:success',\n      this.handleSuccess.bind(this)\n    );\n  }\n\n  handleSuccess(event) {\n    const [newDocumentOrEmptyString] = event.detail;\n\n    if (newDocumentOrEmptyString !== '') {\n      this.element.outerHTML =\n        newDocumentOrEmptyString.documentElement.innerHTML;\n    }\n\n    if (this.successMessageValue.length > 0) {\n      showNotification(this.successMessageValue);\n    }\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n  static targets = [\n    'episodeItem',\n    'currentEpisodeItem',\n    'displayAllEpisodesBtn',\n  ];\n\n  connect() {\n    this.hideDisplayAllEpisodesBtn();\n    const maxEpisodesToDisplayInitially = 3;\n    let isCurrentEpisodeVisbile = false;\n    let isAnyEpisodeItemHidden = false;\n\n    this.episodeItemTargets.forEach(\n      function (episodeItem, index) {\n        const episodePart = index + 1;\n\n        if (episodePart <= maxEpisodesToDisplayInitially) {\n          if (this.currentEpisodeItemTarget == episodeItem) {\n            isCurrentEpisodeVisbile = true;\n          }\n          return true;\n        }\n\n        if (isCurrentEpisodeVisbile) {\n          this.hideEpisode(episodeItem);\n          isAnyEpisodeItemHidden = true;\n        }\n      }.bind(this)\n    );\n\n    if (isAnyEpisodeItemHidden) {\n      this.showDisplayAllEpisodesBtn();\n    }\n  }\n\n  displayAllEpisodes(_event) {\n    this.episodeItemTargets.forEach((element) => {\n      element.style.display = null;\n    });\n\n    this.hideDisplayAllEpisodesBtn();\n  }\n\n  hideEpisode(node) {\n    node.style.display = 'none';\n  }\n\n  hideDisplayAllEpisodesBtn() {\n    this.displayAllEpisodesBtnTarget.style.display = 'none';\n  }\n\n  showDisplayAllEpisodesBtn() {\n    this.displayAllEpisodesBtnTarget.style.display = 'inherit';\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n  connect() {\n    const options = { passive: true };\n    this.element.addEventListener('focusin', this.update.bind(this), options);\n    this.element.addEventListener('keyup', this.update.bind(this), options);\n    this.element.addEventListener('keydown', this.update.bind(this), options);\n    this.element.style.overflowY = 'hidden';\n  }\n\n  update() {\n    this.element.style.height = '65px';\n    this.element.style.height = this.element.scrollHeight + 'px';\n  }\n}\n","var EN_US = ['second', 'minute', 'hour', 'day', 'week', 'month', 'year'];\nexport default function (diff, idx) {\n    if (idx === 0)\n        return ['just now', 'right now'];\n    var unit = EN_US[Math.floor(idx / 2)];\n    if (diff > 1)\n        unit += 's';\n    return [diff + \" \" + unit + \" ago\", \"in \" + diff + \" \" + unit];\n}\n//# sourceMappingURL=en_US.js.map","var ZH_CN = ['秒', '分钟', '小时', '天', '周', '个月', '年'];\nexport default function (diff, idx) {\n    if (idx === 0)\n        return ['刚刚', '片刻后'];\n    var unit = ZH_CN[~~(idx / 2)];\n    return [diff + \" \" + unit + \"\\u524D\", diff + \" \" + unit + \"\\u540E\"];\n}\n//# sourceMappingURL=zh_CN.js.map","/**\n * Created by hustcc on 18/5/20.\n * Contract: i@hust.cc\n */\n/**\n * All supported locales\n */\nvar Locales = {};\n/**\n * register a locale\n * @param locale\n * @param func\n */\nexport var register = function (locale, func) {\n    Locales[locale] = func;\n};\n/**\n * get a locale, default is en_US\n * @param locale\n * @returns {*}\n */\nexport var getLocale = function (locale) {\n    return Locales[locale] || Locales['en_US'];\n};\n//# sourceMappingURL=register.js.map","/**\n * Created by hustcc on 18/5/20.\n * Contract: i@hust.cc\n */\nvar SEC_ARRAY = [\n    60,\n    60,\n    24,\n    7,\n    365 / 7 / 12,\n    12,\n];\n/**\n * format Date / string / timestamp to timestamp\n * @param input\n * @returns {*}\n */\nexport function toDate(input) {\n    if (input instanceof Date)\n        return input;\n    // @ts-ignore\n    if (!isNaN(input) || /^\\d+$/.test(input))\n        return new Date(parseInt(input));\n    input = (input || '')\n        // @ts-ignore\n        .trim()\n        .replace(/\\.\\d+/, '') // remove milliseconds\n        .replace(/-/, '/')\n        .replace(/-/, '/')\n        .replace(/(\\d)T(\\d)/, '$1 $2')\n        .replace(/Z/, ' UTC') // 2017-2-5T3:57:52Z -> 2017-2-5 3:57:52UTC\n        .replace(/([+-]\\d\\d):?(\\d\\d)/, ' $1$2'); // -04:00 -> -0400\n    return new Date(input);\n}\n/**\n * format the diff second to *** time ago, with setting locale\n * @param diff\n * @param localeFunc\n * @returns\n */\nexport function formatDiff(diff, localeFunc) {\n    /**\n     * if locale is not exist, use defaultLocale.\n     * if defaultLocale is not exist, use build-in `en`.\n     * be sure of no error when locale is not exist.\n     *\n     * If `time in`, then 1\n     * If `time ago`, then 0\n     */\n    var agoIn = diff < 0 ? 1 : 0;\n    /**\n     * Get absolute value of number (|diff| is non-negative) value of x\n     * |diff| = diff if diff is positive\n     * |diff| = -diff if diff is negative\n     * |0| = 0\n     */\n    diff = Math.abs(diff);\n    /**\n     * Time in seconds\n     */\n    var totalSec = diff;\n    /**\n     * Unit of time\n     */\n    var idx = 0;\n    for (; diff >= SEC_ARRAY[idx] && idx < SEC_ARRAY.length; idx++) {\n        diff /= SEC_ARRAY[idx];\n    }\n    /**\n     * Math.floor() is alternative of ~~\n     *\n     * The differences and bugs:\n     * Math.floor(3.7) -> 4 but ~~3.7 -> 3\n     * Math.floor(1559125440000.6) -> 1559125440000 but ~~1559125440000.6 -> 52311552\n     *\n     * More information about the performance of algebraic:\n     * https://www.youtube.com/watch?v=65-RbBwZQdU\n     */\n    diff = Math.floor(diff);\n    idx *= 2;\n    if (diff > (idx === 0 ? 9 : 1))\n        idx += 1;\n    return localeFunc(diff, idx, totalSec)[agoIn].replace('%s', diff.toString());\n}\n/**\n * calculate the diff second between date to be formatted an now date.\n * @param date\n * @param relativeDate\n * @returns {number}\n */\nexport function diffSec(date, relativeDate) {\n    var relDate = relativeDate ? toDate(relativeDate) : new Date();\n    return (+relDate - +toDate(date)) / 1000;\n}\n/**\n * nextInterval: calculate the next interval time.\n * - diff: the diff sec between now and date to be formatted.\n *\n * What's the meaning?\n * diff = 61 then return 59\n * diff = 3601 (an hour + 1 second), then return 3599\n * make the interval with high performance.\n **/\nexport function nextInterval(diff) {\n    var rst = 1, i = 0, d = Math.abs(diff);\n    for (; diff >= SEC_ARRAY[i] && i < SEC_ARRAY.length; i++) {\n        diff /= SEC_ARRAY[i];\n        rst *= SEC_ARRAY[i];\n    }\n    d = d % rst;\n    d = d ? rst - d : rst;\n    return Math.ceil(d);\n}\n//# sourceMappingURL=date.js.map","var ATTR_TIMEAGO_TID = 'timeago-id';\n/**\n * get the datetime attribute, `datetime` are supported.\n * @param node\n * @returns {*}\n */\nexport function getDateAttribute(node) {\n    return node.getAttribute('datetime');\n}\n/**\n * set the node attribute, native DOM\n * @param node\n * @param timerId\n * @returns {*}\n */\nexport function setTimerId(node, timerId) {\n    // @ts-ignore\n    node.setAttribute(ATTR_TIMEAGO_TID, timerId);\n}\n/**\n * get the timer id\n * @param node\n */\nexport function getTimerId(node) {\n    return parseInt(node.getAttribute(ATTR_TIMEAGO_TID));\n}\n//# sourceMappingURL=dom.js.map","import { setTimerId, getTimerId, getDateAttribute } from './utils/dom';\nimport { formatDiff, diffSec, nextInterval } from './utils/date';\nimport { getLocale } from './register';\n// all realtime timer\nvar TIMER_POOL = {};\n/**\n * clear a timer from pool\n * @param tid\n */\nvar clear = function (tid) {\n    clearTimeout(tid);\n    delete TIMER_POOL[tid];\n};\n// run with timer(setTimeout)\nfunction run(node, date, localeFunc, opts) {\n    // clear the node's exist timer\n    clear(getTimerId(node));\n    var relativeDate = opts.relativeDate, minInterval = opts.minInterval;\n    // get diff seconds\n    var diff = diffSec(date, relativeDate);\n    // render\n    node.innerText = formatDiff(diff, localeFunc);\n    var tid = setTimeout(function () {\n        run(node, date, localeFunc, opts);\n    }, Math.min(Math.max(nextInterval(diff), minInterval || 1) * 1000, 0x7fffffff));\n    // there is no need to save node in object. Just save the key\n    TIMER_POOL[tid] = 0;\n    setTimerId(node, tid);\n}\n/**\n * cancel a timer or all timers\n * @param node - node hosting the time string\n */\nexport function cancel(node) {\n    // cancel one\n    if (node)\n        clear(getTimerId(node));\n    // cancel all\n    // @ts-ignore\n    else\n        Object.keys(TIMER_POOL).forEach(clear);\n}\n/**\n * render a dom realtime\n * @param nodes\n * @param locale\n * @param opts\n */\nexport function render(nodes, locale, opts) {\n    // by .length\n    // @ts-ignore\n    var nodeList = nodes.length ? nodes : [nodes];\n    nodeList.forEach(function (node) {\n        run(node, getDateAttribute(node), getLocale(locale), opts || {});\n    });\n    return nodeList;\n}\n//# sourceMappingURL=realtime.js.map","/**\n * Created by hustcc on 18/5/20.\n * Contract: i@hust.cc\n */\nimport en_US from './lang/en_US';\nimport zh_CN from './lang/zh_CN';\nimport { register } from './register';\nregister('en_US', en_US);\nregister('zh_CN', zh_CN);\nexport { format } from './format';\nexport { render, cancel } from './realtime';\nexport { register };\n//# sourceMappingURL=index.js.map","import { Controller } from '@hotwired/stimulus';\nimport { render, register } from 'timeago.js';\n\nexport default class extends Controller {\n  static targets = ['node'];\n\n  initialize() {\n    register('de', (_number, index, _totalSec) => {\n      return [\n        ['gerade eben', 'vor einer Weile'],\n        ['vor %s Sekunden', 'in %s Sekunden'],\n        ['vor 1 Minute', 'in 1 Minute'],\n        ['vor %s Minuten', 'in %s Minuten'],\n        ['vor 1 Stunde', 'in 1 Stunde'],\n        ['vor %s Stunden', 'in %s Stunden'],\n        ['vor 1 Tag', 'in 1 Tag'],\n        ['vor %s Tagen', 'in %s Tagen'],\n        ['vor 1 Woche', 'in 1 Woche'],\n        ['vor %s Wochen', 'in %s Wochen'],\n        ['vor 1 Monat', 'in 1 Monat'],\n        ['vor %s Monaten', 'in %s Monaten'],\n        ['vor 1 Jahr', 'in 1 Jahr'],\n        ['vor %s Jahren', 'in %s Jahren'],\n      ][index];\n    });\n  }\n\n  nodeTargetConnected(node) {\n    render(node, 'de', { minInterval: 3 });\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n  static targets = ['toggled', 'invertToggled'];\n  static values = {\n    isOpen: { type: Boolean, default: false },\n  };\n\n  toggle(event) {\n    event.preventDefault();\n    this.isOpenValue = !this.isOpenValue;\n  }\n\n  isOpenValueChanged() {\n    this.element.classList.toggle('is-toggled');\n    this.toggledTargets.forEach((target) => {\n      target.classList.toggle('hidden', this.isOpenValue === false);\n    });\n    this.invertToggledTargets.forEach((target) => {\n      target.classList.toggle('hidden', this.isOpenValue !== false);\n    });\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\nimport { post } from '@rails/request.js';\nimport CurrentPage from '@frontend/app/features/CurrentPage';\n\nexport default class extends Controller {\n  connect() {\n    document.addEventListener(\n      'track-metrics-action:track',\n      this.handleTrack.bind(this)\n    );\n  }\n\n  track({ params: { name, options } }) {\n    this.trackAction(name, options);\n  }\n\n  handleTrack(event) {\n    const name = event.detail.name;\n    const options = event.detail.options;\n\n    this.trackAction(name, options);\n  }\n\n  trackAction(name, options = {}) {\n    const body = JSON.stringify({\n      metrics_action: { name: name, options: options },\n    });\n    post(CurrentPage.getTrackMetricsActionPath(), { body: body });\n  }\n}\n\nexport function trackAction(name, options = {}) {\n  document.body.dispatchEvent(\n    new CustomEvent('track-metrics-action:track', {\n      bubbles: true,\n      detail: {\n        name: name,\n        options: options,\n      },\n    })\n  );\n}\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n  static values = {\n    userId: Number,\n  };\n\n  connect() {\n    if (!this.element.classList.contains('user-mention')) {\n      this.element.classList.add('user-mention');\n    }\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n  static targets = ['fileInput'];\n\n  connect() {\n    this.fileInputTarget.addEventListener(\n      'change',\n      this.submitProfileImageChange.bind(this)\n    );\n  }\n\n  trimWhitespace(event) {\n    event.target.value = event.target.value.trim();\n  }\n\n  uploadProfileImage(event) {\n    event.preventDefault();\n    this.fileInputTarget.click();\n  }\n\n  submitProfileImageChange(event) {\n    event.preventDefault();\n    this.fileInputTarget.parentNode.submit();\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\nimport CurrentUser from '@frontend/app/features/CurrentUser';\nimport { show } from '@frontend/utils/dom';\nimport ImgixHelper from '@frontend/app/features/ImgixHelper';\n\nexport default class extends Controller {\n  static targets = ['specialNumber'];\n  static values = {\n    articleId: Number,\n  };\n\n  connect() {\n    if (CurrentUser.isAuthor()) {\n      show(this.specialNumberTarget);\n    }\n\n    ImgixHelper.refresh();\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\nimport { show, hide } from '@frontend/utils/dom';\n\nexport default class extends Controller {\n  static targets = [\n    'readingTimeFilterBar',\n    'readingTimeCta',\n    'list',\n    'teaserListItem',\n    'tenMinuteTeaserListItem',\n    'twentyMinuteTeaserListItem',\n    'loadMoreButton',\n  ];\n  static values = {\n    maxReadingTimeInMinutes: {\n      type: Number,\n      default: 0, // Can be 0, 10 or 20\n    },\n    displayDefault: {\n      type: Number,\n      default: -1,\n    },\n    displayPerPage: {\n      type: Number,\n      default: -1,\n    },\n    currentPage: {\n      type: Number,\n      default: -1,\n    },\n    articleTeasersPerRow: {\n      type: Number,\n      default: 1,\n    },\n  };\n\n  connect() {\n    this.articleTeasersPerRowValue = window\n      .getComputedStyle(this.listTarget)\n      .getPropertyValue('--teaser-list-style-articles-per-row');\n\n    if (\n      this.tenMinuteTeaserListItemTargets.length === 0 ||\n      this.twentyMinuteTeaserListItemTargets.length === 0\n    ) {\n      hide(this.readingTimeFilterBarTarget);\n    }\n  }\n\n  resetVisibility() {\n    this.teaserListItemTargets.forEach((element) => {\n      hide(element);\n      element.classList.remove('in-compact-row');\n    });\n    if (this.offsetForNextPage() === 0) {\n      this.showNextPage();\n    }\n    this.currentPageValue = 1;\n  }\n\n  showNextPage() {\n    const offset = this.offsetForNextPage();\n    const availableItems = this.filteredTeaserListItems();\n    const itemsToDisplay =\n      this.currentPageValue === 1\n        ? this.displayDefaultValue\n        : this.displayPerPageValue;\n    const visibleItems = availableItems.slice(offset, offset + itemsToDisplay);\n\n    if (this.articleTeasersPerRowValue > 1) {\n      this.divideArrayIntoGroups(\n        visibleItems,\n        this.articleTeasersPerRowValue\n      ).forEach((row) => {\n        const rowContainsCompact = row.some(\n          (item) => item.dataset.isCompactFormat !== undefined\n        );\n        if (rowContainsCompact) {\n          row.forEach((item) => item.classList.add('in-compact-row'));\n        }\n      });\n    }\n    visibleItems.forEach((element) => show(element));\n\n    const remainingItems = availableItems.slice(offset + itemsToDisplay);\n    if (remainingItems < 1) {\n      this.handleNoMoreItems();\n    }\n  }\n\n  divideArrayIntoGroups(originalArray, groupSize) {\n    const dividedArray = [];\n    for (let i = 0; i < originalArray.length; i += groupSize) {\n      const group = originalArray.slice(i, i + groupSize);\n      dividedArray.push(group);\n    }\n    return dividedArray;\n  }\n\n  offsetForNextPage() {\n    if (this.currentPageValue === 1) return 0;\n\n    return (\n      this.displayDefaultValue +\n      this.displayPerPageValue * (this.currentPageValue - 2)\n    );\n  }\n\n  filteredTeaserListItems() {\n    if (this.maxReadingTimeInMinutesValue === 0) {\n      return this.teaserListItemTargets;\n    } else if (this.maxReadingTimeInMinutesValue === 10) {\n      return this.tenMinuteTeaserListItemTargets;\n    } else if (this.maxReadingTimeInMinutesValue === 20) {\n      return this.twentyMinuteTeaserListItemTargets;\n    } else {\n      throw 'Unexpected maxReadingTimeInMinutesValue';\n    }\n  }\n\n  setReadingTimefilter({ params: { readingTime } }) {\n    this.maxReadingTimeInMinutesValue = readingTime;\n  }\n\n  maxReadingTimeInMinutesValueChanged() {\n    this.setCurrentReadingTimeFilterActive();\n    this.resetVisibility();\n  }\n\n  setCurrentReadingTimeFilterActive() {\n    this.readingTimeCtaTargets.forEach((target) =>\n      target.classList.toggle(\n        'is-active',\n        target.dataset['articleTeaserIndex-ComponentReadingTimeParam'] ===\n          this.maxReadingTimeInMinutesValue.toString()\n      )\n    );\n  }\n\n  currentPageValueChanged() {\n    if (this.currentPageValue >= 0) {\n      this.showNextPage();\n    }\n  }\n\n  showMore() {\n    this.currentPageValue += 1;\n\n    if (this.offsetForNextPage() >= this.filteredTeaserListItems().length) {\n      this.handleNoMoreItems();\n    }\n  }\n\n  handleNoMoreItems() {\n    hide(this.loadMoreButtonTarget);\n    this.element.dispatchEvent(\n      new CustomEvent('article-teaser-index:no-more-items', { bubbles: true })\n    );\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nimport CurrentPage from '@frontend/app/features/CurrentPage';\nimport {\n  apply as queryParamsApply,\n  extract as extractQueryParams,\n} from '@frontend/utils/query-params';\n\n// NOTE: JS and CSS from https://css-tricks.com/lets-create-a-custom-audio-player/ has been used to\n// work around some browser-specific quirks.\nexport default class extends Controller {\n  static targets = [\n    'jumpBackButton',\n    'jumpForwardButton',\n    'playButton',\n    'seekSlider',\n    'audio',\n    'duration',\n    'currentTime',\n    'playbackSpeedSelect',\n  ];\n\n  static values = {\n    srcUrl: String,\n    durationInSeconds: Number,\n    playbackSpeed: {\n      type: Number,\n      default: 1,\n    },\n  };\n\n  connect() {\n    if (CurrentPage.getShareUrl().isActive) {\n      const shareUrl = CurrentPage.getShareUrl().url;\n      const newSrcUrl = queryParamsApply(\n        this.srcUrlValue,\n        extractQueryParams(shareUrl)\n      );\n      this.srcUrlValue = newSrcUrl;\n      this.setServingViaShareUrl(true);\n    } else {\n      this.setServingViaShareUrl(false);\n    }\n\n    this.audioTarget.src = this.srcUrlValue;\n    this.isPlaying = false; // Autoplay is disabled\n    this.jumpingInSeconds = 15;\n\n    this.audioTarget.addEventListener(\n      'progress',\n      this.displayBufferedAmount.bind(this)\n    );\n    this.audioTarget.addEventListener('ended', this.audioEnded.bind(this));\n    this.audioTarget.addEventListener('playing', this.audioPlaying.bind(this));\n\n    this.playButtonTarget.addEventListener(\n      'click',\n      this.playPressed.bind(this)\n    );\n    this.seekSliderTarget.addEventListener(\n      'input',\n      this.seekSliderInput.bind(this)\n    );\n    this.seekSliderTarget.addEventListener(\n      'change',\n      this.seekSliderChanged.bind(this)\n    );\n    this.jumpBackButtonTarget.addEventListener(\n      'click',\n      this.jumpBack.bind(this)\n    );\n    this.jumpForwardButtonTarget.addEventListener(\n      'click',\n      this.jumpForward.bind(this)\n    );\n\n    this.playbackSpeedSelectTarget.addEventListener(\n      'change',\n      this.playbackSpeedSelectChanged.bind(this)\n    );\n\n    this.interval = setInterval(this.whilePlaying.bind(this), 500);\n    this.setup();\n    // NOTE: Calling setup after loading metadata to use the audio duration from the metadata.\n    this.audioTarget.addEventListener('loadedmetadata', this.setup.bind(this));\n  }\n\n  disconnect() {\n    clearInterval(this.interval);\n  }\n\n  setup() {\n    this.displayDuration();\n    this.setSliderMax();\n    this.displayBufferedAmount();\n  }\n\n  audioEnded() {\n    this.togglePlayState();\n  }\n\n  audioPlaying() {\n    document.dispatchEvent(new CustomEvent('audio-player:playing'));\n  }\n\n  playPressed() {\n    this.togglePlayState();\n  }\n\n  jumpBack() {\n    this.audioTarget.currentTime =\n      this.audioTarget.currentTime - this.jumpingInSeconds;\n  }\n\n  jumpForward() {\n    this.audioTarget.currentTime =\n      this.audioTarget.currentTime + this.jumpingInSeconds;\n  }\n\n  togglePlayState() {\n    this.isPlaying = !this.isPlaying;\n\n    if (this.isPlaying) {\n      this.audioTarget.play();\n    } else {\n      this.audioTarget.pause();\n      document.dispatchEvent(new CustomEvent('audio-player:stopped'));\n    }\n\n    this.element.classList.toggle('is-playing', this.isPlaying);\n  }\n\n  seekSliderInput() {\n    this.updateSeekSliderProgress();\n    this.currentTimeTarget.textContent = this.calculateTime(\n      this.seekSliderTarget.value\n    );\n  }\n\n  playbackSpeedSelectChanged() {\n    this.playbackSpeedValue = parseFloat(this.playbackSpeedSelectTarget.value);\n  }\n\n  playbackSpeedValueChanged() {\n    this.audioTarget.playbackRate = this.playbackSpeedValue;\n    this.playbackSpeedSelectTarget.value = this.playbackSpeedValue;\n  }\n\n  seekSliderChanged() {\n    this.audioTarget.currentTime = this.seekSliderTarget.value;\n    if (!this.audioTarget.paused) {\n      this.whilePlaying();\n    }\n  }\n\n  whilePlaying() {\n    const playbackTimeInSeconds = Math.floor(this.audioTarget.currentTime);\n    this.seekSliderTarget.value = playbackTimeInSeconds;\n    this.currentTimeTarget.textContent = this.calculateTime(\n      playbackTimeInSeconds\n    );\n    this.updateSeekSliderProgress();\n  }\n\n  calculateTime(secs) {\n    const minutes = Math.floor(secs / 60);\n    const seconds = Math.floor(secs % 60);\n    const returnedSeconds = seconds < 10 ? `0${seconds}` : `${seconds}`;\n    return `${minutes}:${returnedSeconds}`;\n  }\n\n  updateSeekSliderProgress() {\n    this.setAudioPlayerProperty(\n      'seek-before-width',\n      this.percentageAsText(\n        this.seekSliderTarget.value,\n        this.seekSliderTarget.max\n      )\n    );\n  }\n\n  displayDuration() {\n    this.durationTarget.textContent = this.calculateTime(\n      this.getDurationInSeconds()\n    );\n  }\n\n  setSliderMax() {\n    this.seekSliderTarget.max = Math.floor(this.audioTarget.duration);\n  }\n\n  getDurationInSeconds() {\n    return this.audioTarget.duration || this.durationInSecondsValue;\n  }\n\n  displayBufferedAmount() {\n    if (this.audioTarget.buffered.length === 0) {\n      return false;\n    }\n\n    const bufferedAmount = Math.floor(\n      this.audioTarget.buffered.end(this.audioTarget.buffered.length - 1)\n    );\n    this.setAudioPlayerProperty(\n      'buffered-width',\n      this.percentageAsText(bufferedAmount, this.seekSliderTarget.max)\n    );\n  }\n\n  setAudioPlayerProperty(propertyName, value) {\n    this.element.style.setProperty(`--${propertyName}`, value);\n  }\n\n  percentageAsText(divided, divisor) {\n    return `${(divided / divisor) * 100}%`;\n  }\n\n  setServingViaShareUrl(bool) {\n    this.element.dataset.testAudioPlayerIsServingViaShareUrl = bool;\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\nimport CurrentUser from '@frontend/app/features/CurrentUser';\nimport { hide } from '@frontend/utils/dom';\n\nexport default class extends Controller {\n  static targets = ['bookmark'];\n  static values = {\n    articleId: Number,\n  };\n\n  connect() {\n    if (CurrentUser.isGuest()) {\n      hide(this.bookmarkTarget);\n    } else {\n      this.updateBookmarkDisplay();\n    }\n  }\n\n  updateBookmarkDisplay() {\n    const isActive = CurrentUser.bookmarks().includes(this.articleIdValue);\n\n    this.bookmarkTarget.classList.toggle('is-active', isActive);\n    this.bookmarkTarget.classList.toggle('is-inactive', !isActive);\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n  static targets = ['progressBar'];\n\n  connect() {\n    this.setDaysElapsedPosition();\n    window.addEventListener('resize', this.setDaysElapsedPosition.bind(this));\n  }\n\n  setDaysElapsedPosition() {\n    document.documentElement.style.setProperty(\n      '--progress-bar-width',\n      this.progressBarTarget.offsetWidth + 'px'\n    );\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\nimport { patch } from '@rails/request.js';\n\nexport default class extends Controller {\n  static targets = ['notice', 'progressBar'];\n\n  connect() {\n    this.setDaysElapsedPosition();\n    window.addEventListener('resize', this.setDaysElapsedPosition.bind(this));\n  }\n\n  async markNoticeAsRead(event) {\n    event.preventDefault();\n    const markNoticeAsReadPath = this.data.get('markNoticeAsReadPath');\n    if (!markNoticeAsReadPath) return null;\n\n    const response = await patch(markNoticeAsReadPath);\n    if (response.ok) {\n      this.noticeTarget.hidden = true;\n    }\n  }\n\n  setDaysElapsedPosition() {\n    let root = document.documentElement;\n    root.style.setProperty(\n      '--progress-bar-width',\n      this.progressBarTarget.offsetWidth + 'px'\n    );\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n  scrollToTop() {\n    window.top.scrollTo({\n      top: 0,\n      left: 0,\n      behavior: 'smooth',\n    });\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\nimport { toggleVisiblity } from '@frontend/utils/dom';\nimport MatomoTracker from '@frontend/app/features/MatomoTracker';\n\nexport default class extends Controller {\n  static values = {\n    trackMatomoGoalId: { type: Number, default: -1 },\n  };\n  static targets = [\n    'hideOnSuccess',\n    'input',\n    'showOnSuccess',\n    'form',\n    'toggle',\n    'component',\n    'showOnFailure',\n    'submitButton',\n  ];\n  static classes = ['submitting'];\n\n  showForm() {\n    this.formTarget.classList.remove('hidden');\n    this.toggleTarget.classList.add('hidden');\n    this.componentTarget.setAttribute('aria-expanded', 'true');\n  }\n\n  handleSubmitting() {\n    this.submitButtonTarget.classList.add(this.submittingClass);\n    this.submitButtonTarget.innerText = 'wird verarbeitet';\n  }\n\n  handleSuccess() {\n    let messages = event.detail[0].messages || [];\n    this.showOnSuccessTarget.innerHTML = messages.join('\\n<br/>');\n    this.hideOnSuccessTargets.forEach((node) => toggleVisiblity(node, false));\n    this.inputTargets.forEach((input) => (input.disabled = true));\n    this.showOnSuccessTarget.classList.remove('hidden');\n    this.showOnFailureTarget.classList.add('hidden');\n\n    if (this.trackMatomoGoalIdValue > 0) {\n      MatomoTracker.trackGoal(this.trackMatomoGoalIdValue);\n    }\n  }\n\n  handleFailure(event) {\n    let messages = ['Wir konnten dich nicht anmelden.'];\n    let errorMessages = event.detail[0].messages || [];\n    messages = messages.concat(errorMessages.map((value) => `- ${value}`));\n    this.showOnFailureTarget.innerHTML = messages.join('\\n<br/>');\n    this.showOnFailureTarget.classList.remove('hidden');\n    this.submitButtonTarget.classList.remove(this.submittingClass);\n    this.submitButtonTarget.innerText = 'Newsletter abonnieren';\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\nimport CurrentUser from '@frontend/app/features/CurrentUser';\nimport { show, hide, toggleVisiblity } from '@frontend/utils/dom';\n\nexport default class extends Controller {\n  static targets = [\n    'overlay',\n    'heading',\n    'form',\n    'checkbox',\n    'input',\n    'hideOnLoad',\n    'hideOnSuccess',\n    'showOnSuccess',\n    'showOnFailure',\n    'submitButton',\n  ];\n\n  connect() {\n    this.hideOnLoadTargets.forEach((element) => hide(element));\n    this.submittedSuccessfully = false;\n\n    if (!CurrentUser.isGuest()) {\n      return false;\n    }\n\n    document.body.addEventListener(\n      'form-overlay:set-heading',\n      this.setHeading.bind(this)\n    );\n    this.formTarget.addEventListener(\n      'ajax:beforeSend',\n      this.ajaxBeforeSend.bind(this)\n    );\n    this.formTarget.addEventListener(\n      'ajax:success',\n      this.ajaxSuccess.bind(this)\n    );\n    this.formTarget.addEventListener('ajax:error', this.ajaxError.bind(this));\n  }\n\n  setHeading(event) {\n    const { heading } = event.detail;\n    this.headingTarget.innerHTML = heading;\n    show(this.headingTarget);\n  }\n\n  close() {\n    hide(this.overlayTarget);\n\n    if (false === this.submittedSuccessfully) {\n      Array.from(this.checkboxTargets).forEach((cb) => (cb.checked = false));\n    }\n  }\n\n  // private\n\n  checkboxTargetConnected(checkbox) {\n    checkbox.addEventListener('click', this.handleCheckboxToggled.bind(this));\n  }\n\n  handleCheckboxToggled() {\n    toggleVisiblity(\n      this.overlayTarget,\n      this.checkboxTargets.some((checkbox) => checkbox.checked)\n    );\n  }\n\n  ajaxBeforeSend() {\n    this.submitButtonTarget.innerText = 'wird verarbeitet';\n    this.submitButtonTarget.disabled = true;\n  }\n\n  ajaxSuccess(event) {\n    this.submittedSuccessfully = true;\n    this.checkboxTargets.forEach((checkbox) => (checkbox.disabled = true));\n    this.inputTargets.forEach((input) => (input.disabled = true));\n\n    let messages = event.detail[0].messages || [];\n    this.showOnSuccessTarget.innerHTML = messages.join('\\n<br/>');\n    this.hideOnSuccessTargets.forEach((node) => toggleVisiblity(node, false));\n    show(this.showOnSuccessTarget);\n    hide(this.showOnFailureTarget);\n    hide(this.headingTarget);\n  }\n\n  ajaxError(event) {\n    let errorMessages = event.detail[0].messages || [];\n    this.showOnFailureTarget.innerHTML = errorMessages.join('. ');\n    show(this.showOnFailureTarget);\n    hide(this.headingTarget);\n    this.submitButtonTarget.innerText = 'Newsletter abonnieren';\n    this.submitButtonTarget.disabled = false;\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n  static targets = ['showOnFailure'];\n\n  handleFailure(event) {\n    let messages = ['Wir konnten dich nicht anmelden.'];\n    let errorMessages = event.detail[0].messages || [];\n    messages = messages.concat(errorMessages.map((value) => `- ${value}`));\n    this.showOnFailureTarget.innerHTML = messages.join('\\n<br/>');\n    this.showOnFailureTarget.classList.remove('hidden');\n  }\n}\n","import { Controller } from '@hotwired/stimulus';\nimport { show } from '@frontend/utils/dom';\n\nexport default class extends Controller {\n  static targets = ['comment'];\n\n  connect() {\n    const numberOfCommentsToDisplay = parseInt(\n      window.getComputedStyle(this.element).top\n    );\n    this.hiddenComments.forEach((node, index) => {\n      if (index >= numberOfCommentsToDisplay) return false;\n\n      show(node);\n    });\n  }\n\n  showAll() {\n    this.hiddenComments.forEach((node) => show(node));\n  }\n\n  get hiddenComments() {\n    return this.commentTargets.filter((node) => node.hidden === true);\n  }\n}\n","import { Application } from '@hotwired/stimulus';\nimport { registerControllers } from 'stimulus-vite-helpers';\n\nconst application = Application.start();\n\nObject.entries(\n  import.meta.glob('@controllers/main/**/*_controller.js', { eager: true })\n).forEach(([path, module]) => {\n  const filename = path.split('/').pop();\n  const identifier = filename.split('_controller.js').shift();\n  application.register(identifier, module.default);\n});\n\n// NB: Component controllers are namespaced/suffixed with `--component`\nconst componentsControllers = import.meta.glob(\n  [\n    '@components/**/*_controller.js',\n    '!@components/comments/*' // Ignore all Comments-specific comments code\n  ],\n  { eager: true }\n);\nregisterControllers(application, componentsControllers);\n"],"file":"vite/application-BHz48D2g.js"}