/*! For license information please see application-feb7dddcfb6598273e06.js.LICENSE.txt */ (()=>{var e,t,n={3247:(e,t,n)=>{"use strict";e.exports=n.p+"media/images/dadf2db36589607d107d.png"},8999:(e,t,n)=>{var r={"./logo.png":3247};function i(e){var t=o(e);return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}i.keys=function(){return Object.keys(r)},i.resolve=o,e.exports=i,i.id=8999},9462:(e,t,n)=>{var r={"./belongs_to_field_controller.js":8674,"./code_field_controller.js":2405,"./date_field_controller.js":6361,"./key_value_controller.js":829,"./simple_mde_controller.js":8682,"./trix_field_controller.js":3395,"js/controllers/fields/belongs_to_field_controller.js":8674,"js/controllers/fields/code_field_controller.js":2405,"js/controllers/fields/date_field_controller.js":6361,"js/controllers/fields/key_value_controller.js":829,"js/controllers/fields/simple_mde_controller.js":8682,"js/controllers/fields/trix_field_controller.js":3395};function i(e){var t=o(e);return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}i.keys=function(){return Object.keys(r)},i.resolve=o,e.exports=i,i.id=9462},736:(e,t,n)=>{var r={"./action_controller.js":9373,"./actions_picker_controller.js":5510,"./alerts_controller.js":5258,"./attachments_controller.js":3302,"./boolean_filter_controller.js":7333,"./fields/belongs_to_field_controller.js":8674,"./fields/code_field_controller.js":2405,"./fields/date_field_controller.js":6361,"./fields/key_value_controller.js":829,"./fields/simple_mde_controller.js":8682,"./fields/trix_field_controller.js":3395,"./filter_controller.js":7976,"./hidden_input_controller.js":8519,"./item_selector_controller.js":5214,"./modal_controller.js":4606,"./per_page_controller.js":4901,"./search_controller.js":1252,"./select_filter_controller.js":5326,"./tippy_controller.js":7109,"./toggle_panel_controller.js":1397,"js/controllers/action_controller.js":9373,"js/controllers/actions_picker_controller.js":5510,"js/controllers/alerts_controller.js":5258,"js/controllers/attachments_controller.js":3302,"js/controllers/boolean_filter_controller.js":7333,"js/controllers/fields/belongs_to_field_controller.js":8674,"js/controllers/fields/code_field_controller.js":2405,"js/controllers/fields/date_field_controller.js":6361,"js/controllers/fields/key_value_controller.js":829,"js/controllers/fields/simple_mde_controller.js":8682,"js/controllers/fields/trix_field_controller.js":3395,"js/controllers/filter_controller.js":7976,"js/controllers/hidden_input_controller.js":8519,"js/controllers/item_selector_controller.js":5214,"js/controllers/modal_controller.js":4606,"js/controllers/per_page_controller.js":4901,"js/controllers/search_controller.js":1252,"js/controllers/select_filter_controller.js":5326,"js/controllers/tippy_controller.js":7109,"js/controllers/toggle_panel_controller.js":1397};function i(e){var t=o(e);return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}i.keys=function(){return Object.keys(r)},i.resolve=o,e.exports=i,i.id=736},7443:()=>{},7475:(e,t,n)=>{"use strict";n.d(t,{parseAlgoliaHitHighlight:()=>i.T,parseAlgoliaHitReverseHighlight:()=>o.H,parseAlgoliaHitReverseSnippet:()=>a.q,parseAlgoliaHitSnippet:()=>s.p});var r=n(7443);n.o(r,"parseAlgoliaHitHighlight")&&n.d(t,{parseAlgoliaHitHighlight:function(){return r.parseAlgoliaHitHighlight}}),n.o(r,"parseAlgoliaHitReverseHighlight")&&n.d(t,{parseAlgoliaHitReverseHighlight:function(){return r.parseAlgoliaHitReverseHighlight}}),n.o(r,"parseAlgoliaHitReverseSnippet")&&n.d(t,{parseAlgoliaHitReverseSnippet:function(){return r.parseAlgoliaHitReverseSnippet}}),n.o(r,"parseAlgoliaHitSnippet")&&n.d(t,{parseAlgoliaHitSnippet:function(){return r.parseAlgoliaHitSnippet}});var i=n(9863),o=n(1924),a=n(2382),s=n(1062)},9863:(e,t,n)=>{"use strict";n.d(t,{T:()=>a});var r=n(6367),i=n(9177);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n{"use strict";n.d(t,{H:()=>o});var r=n(9863),i=n(26);function o(e){return(0,i.N)((0,r.T)(e))}},2382:(e,t,n)=>{"use strict";n.d(t,{q:()=>o});var r=n(1062),i=n(26);function o(e){return(0,i.N)((0,r.p)(e))}},1062:(e,t,n)=>{"use strict";n.d(t,{p:()=>a});var r=n(6367),i=n(9177);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n{"use strict";function r(e){var t=e.highlightedValue.split("__aa-highlight__"),n=t.shift(),r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{get:function(){return e},add:function(t){var n=e[e.length-1];(null==n?void 0:n.isHighlighted)===t.isHighlighted?e[e.length-1]={value:n.value+t.value,isHighlighted:n.isHighlighted}:e.push(t)}}}(n?[{value:n,isHighlighted:!1}]:[]);return t.forEach((function(e){var t=e.split("__/aa-highlight__");r.add({value:t[0],isHighlighted:!0}),""!==t[1]&&r.add({value:t[1],isHighlighted:!1})})),r.get()}n.d(t,{s:()=>r})},26:(e,t,n)=>{"use strict";n.d(t,{N:()=>d});var r={"&":"&","<":"<",">":">",""":'"',"'":"'"},i=new RegExp(/\w/i),o=/&(amp|quot|lt|gt|#39);/g,a=RegExp(o.source);function s(e,t){var n,s,l,u=e[t],c=(null===(n=e[t+1])||void 0===n?void 0:n.isHighlighted)||!0,d=(null===(s=e[t-1])||void 0===s?void 0:s.isHighlighted)||!0;return i.test((l=u.value)&&a.test(l)?l.replace(o,(function(e){return r[e]})):l)||d!==c?u.isHighlighted:d}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t{"use strict";function r(e,t){return t.reduce((function(e,t){return e&&e[t]}),e)}n.d(t,{Q:()=>r})},9295:(e,t,n)=>{"use strict";n.d(t,{P:()=>r});var r={};n.r(r),n.d(r,{clearCache:()=>ye,connectStreamSource:()=>me,disconnectStreamSource:()=>ge,navigator:()=>de,registerAdapter:()=>pe,renderStreamMessage:()=>ve,setProgressBarDelay:()=>be,start:()=>fe,visit:()=>he}),function(){if(void 0===window.Reflect||void 0===window.customElements||window.customElements.polyfillWrapFlushCallback)return;const e=HTMLElement;window.HTMLElement=function(){return Reflect.construct(e,[],this.constructor)},HTMLElement.prototype=e.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,e)}();const i=new WeakMap;var o,a,s,l,u,c;"SubmitEvent"in window||(addEventListener("click",(function(e){const t=function(e){const t=e instanceof Element?e:e instanceof Node?e.parentElement:null,n=t?t.closest("input, button"):null;return"submit"==(null==n?void 0:n.type)?n:null}(e.target);t&&t.form&&i.set(t.form,t)}),!0),Object.defineProperty(Event.prototype,"submitter",{get(){if("submit"==this.type&&this.target instanceof HTMLFormElement)return i.get(this.target)}})),function(e){e.eager="eager",e.lazy="lazy"}(o||(o={}));class d extends HTMLElement{constructor(){super(),this.loaded=Promise.resolve(),this.delegate=new d.delegateConstructor(this)}static get observedAttributes(){return["disabled","loading","src"]}connectedCallback(){this.delegate.connect()}disconnectedCallback(){this.delegate.disconnect()}attributeChangedCallback(e){"loading"==e?this.delegate.loadingStyleChanged():"src"==e?this.delegate.sourceURLChanged():this.delegate.disabledChanged()}get src(){return this.getAttribute("src")}set src(e){e?this.setAttribute("src",e):this.removeAttribute("src")}get loading(){return function(e){switch(e.toLowerCase()){case"lazy":return o.lazy;default:return o.eager}}(this.getAttribute("loading")||"")}set loading(e){e?this.setAttribute("loading",e):this.removeAttribute("loading")}get disabled(){return this.hasAttribute("disabled")}set disabled(e){e?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get autoscroll(){return this.hasAttribute("autoscroll")}set autoscroll(e){e?this.setAttribute("autoscroll",""):this.removeAttribute("autoscroll")}get complete(){return!this.delegate.isLoading}get isActive(){return this.ownerDocument===document&&!this.isPreview}get isPreview(){var e,t;return null===(t=null===(e=this.ownerDocument)||void 0===e?void 0:e.documentElement)||void 0===t?void 0:t.hasAttribute("data-turbo-preview")}}function f(e){return new URL(e.toString(),document.baseURI)}function p(e){let t;return e.hash?e.hash.slice(1):(t=e.href.match(/#(.*)$/))?t[1]:""}function h(e){const t=e.hash.length;return t<2?e.href:e.href.slice(0,-t)}class m{constructor(e){this.response=e}get succeeded(){return this.response.ok}get failed(){return!this.succeeded}get clientError(){return this.statusCode>=400&&this.statusCode<=499}get serverError(){return this.statusCode>=500&&this.statusCode<=599}get redirected(){return this.response.redirected}get location(){return f(this.response.url)}get isHTML(){return this.contentType&&this.contentType.match(/^(?:text\/([^\s;,]+\b)?html|application\/xhtml\+xml)\b/)}get statusCode(){return this.response.status}get contentType(){return this.header("Content-Type")}get responseText(){return this.response.text()}get responseHTML(){return this.isHTML?this.response.text():Promise.resolve(void 0)}header(e){return this.response.headers.get(e)}}function g(e,{target:t,cancelable:n,detail:r}={}){const i=new CustomEvent(e,{cancelable:n,bubbles:!0,detail:r});return(t||document.documentElement).dispatchEvent(i),i}function v(){return new Promise((e=>requestAnimationFrame((()=>e()))))}function y(e=""){return(new DOMParser).parseFromString(e,"text/html")}function b(e,...t){const n=function(e,t){return e.reduce(((e,n,r)=>e+n+(null==t[r]?"":t[r])),"")}(e,t).replace(/^\n/,"").split("\n"),r=n[0].match(/^\s+/),i=r?r[0].length:0;return n.map((e=>e.slice(i))).join("\n")}function x(){return Array.apply(null,{length:36}).map(((e,t)=>8==t||13==t||18==t||23==t?"-":14==t?"4":19==t?(Math.floor(4*Math.random())+8).toString(16):Math.floor(15*Math.random()).toString(16))).join("")}!function(e){e[e.get=0]="get",e[e.post=1]="post",e[e.put=2]="put",e[e.patch=3]="patch",e[e.delete=4]="delete"}(a||(a={}));class w{constructor(e,t,n,r=new URLSearchParams){this.abortController=new AbortController,this.delegate=e,this.method=t,this.headers=this.defaultHeaders,this.isIdempotent?this.url=function(e,t){const n=new URLSearchParams(e.search);for(const[r,i]of t)i instanceof File||(n.has(r)?(n.delete(r),e.searchParams.set(r,i)):e.searchParams.append(r,i));return e}(n,[...r.entries()]):(this.body=r,this.url=n)}get location(){return this.url}get params(){return this.url.searchParams}get entries(){return this.body?Array.from(this.body.entries()):[]}cancel(){this.abortController.abort()}async perform(){var e,t;const{fetchOptions:n}=this;null===(t=(e=this.delegate).prepareHeadersForRequest)||void 0===t||t.call(e,this.headers,this),g("turbo:before-fetch-request",{detail:{fetchOptions:n}});try{this.delegate.requestStarted(this);const e=await fetch(this.url.href,n);return await this.receive(e)}catch(e){throw this.delegate.requestErrored(this,e),e}finally{this.delegate.requestFinished(this)}}async receive(e){const t=new m(e);return g("turbo:before-fetch-response",{cancelable:!0,detail:{fetchResponse:t}}).defaultPrevented?this.delegate.requestPreventedHandlingResponse(this,t):t.succeeded?this.delegate.requestSucceededWithResponse(this,t):this.delegate.requestFailedWithResponse(this,t),t}get fetchOptions(){return{method:a[this.method].toUpperCase(),credentials:"same-origin",headers:this.headers,redirect:"follow",body:this.body,signal:this.abortSignal}}get defaultHeaders(){return{Accept:"text/html, application/xhtml+xml"}}get isIdempotent(){return this.method==a.get}get abortSignal(){return this.abortController.signal}}class k{constructor(e,t){this.started=!1,this.intersect=e=>{const t=e.slice(-1)[0];(null==t?void 0:t.isIntersecting)&&this.delegate.elementAppearedInViewport(this.element)},this.delegate=e,this.element=t,this.intersectionObserver=new IntersectionObserver(this.intersect)}start(){this.started||(this.started=!0,this.intersectionObserver.observe(this.element))}stop(){this.started&&(this.started=!1,this.intersectionObserver.unobserve(this.element))}}class C{constructor(e){this.templateElement=document.createElement("template"),this.templateElement.innerHTML=e}static wrap(e){return"string"==typeof e?new this(e):e}get fragment(){const e=document.createDocumentFragment();for(const t of this.foreignElements)e.appendChild(document.importNode(t,!0));return e}get foreignElements(){return this.templateChildren.reduce(((e,t)=>"turbo-stream"==t.tagName.toLowerCase()?[...e,t]:e),[])}get templateChildren(){return Array.from(this.templateElement.content.children)}}C.contentType="text/vnd.turbo-stream.html",function(e){e[e.initialized=0]="initialized",e[e.requesting=1]="requesting",e[e.waiting=2]="waiting",e[e.receiving=3]="receiving",e[e.stopping=4]="stopping",e[e.stopped=5]="stopped"}(s||(s={})),function(e){e.urlEncoded="application/x-www-form-urlencoded",e.multipart="multipart/form-data",e.plain="text/plain"}(l||(l={}));class S{constructor(e,t,n,r=!1){this.state=s.initialized,this.delegate=e,this.formElement=t,this.submitter=n,this.formData=function(e,t){const n=new FormData(e),r=null==t?void 0:t.getAttribute("name"),i=null==t?void 0:t.getAttribute("value");return r&&null!=i&&n.get(r)!=i&&n.append(r,i),n}(t,n),this.fetchRequest=new w(this,this.method,this.location,this.body),this.mustRedirect=r}get method(){var e;return function(e){switch(e.toLowerCase()){case"get":return a.get;case"post":return a.post;case"put":return a.put;case"patch":return a.patch;case"delete":return a.delete}}(((null===(e=this.submitter)||void 0===e?void 0:e.getAttribute("formmethod"))||this.formElement.getAttribute("method")||"").toLowerCase())||a.get}get action(){var e;return(null===(e=this.submitter)||void 0===e?void 0:e.getAttribute("formaction"))||this.formElement.action}get location(){return f(this.action)}get body(){return this.enctype==l.urlEncoded||this.method==a.get?new URLSearchParams(this.stringFormData):this.formData}get enctype(){var e;return function(e){switch(e.toLowerCase()){case l.multipart:return l.multipart;case l.plain:return l.plain;default:return l.urlEncoded}}((null===(e=this.submitter)||void 0===e?void 0:e.getAttribute("formenctype"))||this.formElement.enctype)}get isIdempotent(){return this.fetchRequest.isIdempotent}get stringFormData(){return[...this.formData].reduce(((e,[t,n])=>e.concat("string"==typeof n?[[t,n]]:[])),[])}async start(){const{initialized:e,requesting:t}=s;if(this.state==e)return this.state=t,this.fetchRequest.perform()}stop(){const{stopping:e,stopped:t}=s;if(this.state!=e&&this.state!=t)return this.state=e,this.fetchRequest.cancel(),!0}prepareHeadersForRequest(e,t){if(!t.isIdempotent){const t=function(e){if(null!=e){const t=(document.cookie?document.cookie.split("; "):[]).find((t=>t.startsWith(e)));if(t){const e=t.split("=").slice(1).join("=");return e?decodeURIComponent(e):void 0}}}(_("csrf-param"))||_("csrf-token");t&&(e["X-CSRF-Token"]=t),e.Accept=[C.contentType,e.Accept].join(", ")}}requestStarted(e){this.state=s.waiting,g("turbo:submit-start",{target:this.formElement,detail:{formSubmission:this}}),this.delegate.formSubmissionStarted(this)}requestPreventedHandlingResponse(e,t){this.result={success:t.succeeded,fetchResponse:t}}requestSucceededWithResponse(e,t){if(t.clientError||t.serverError)this.delegate.formSubmissionFailedWithResponse(this,t);else if(this.requestMustRedirect(e)&&function(e){return 200==e.statusCode&&!e.redirected}(t)){const e=new Error("Form responses must redirect to another location");this.delegate.formSubmissionErrored(this,e)}else this.state=s.receiving,this.result={success:!0,fetchResponse:t},this.delegate.formSubmissionSucceededWithResponse(this,t)}requestFailedWithResponse(e,t){this.result={success:!1,fetchResponse:t},this.delegate.formSubmissionFailedWithResponse(this,t)}requestErrored(e,t){this.result={success:!1,error:t},this.delegate.formSubmissionErrored(this,t)}requestFinished(e){this.state=s.stopped,g("turbo:submit-end",{target:this.formElement,detail:Object.assign({formSubmission:this},this.result)}),this.delegate.formSubmissionFinished(this)}requestMustRedirect(e){return!e.isIdempotent&&this.mustRedirect}}function _(e){const t=document.querySelector(`meta[name="${e}"]`);return t&&t.content}class A{constructor(e){this.element=e}get children(){return[...this.element.children]}hasAnchor(e){return null!=this.getElementForAnchor(e)}getElementForAnchor(e){try{return this.element.querySelector(`[id='${e}'], a[name='${e}']`)}catch(e){return null}}get isConnected(){return this.element.isConnected}get firstAutofocusableElement(){return this.element.querySelector("[autofocus]")}get permanentElements(){return[...this.element.querySelectorAll("[id][data-turbo-permanent]")]}getPermanentElementById(e){return this.element.querySelector(`#${e}[data-turbo-permanent]`)}getPermanentElementMapForSnapshot(e){const t={};for(const n of this.permanentElements){const{id:r}=n,i=e.getPermanentElementById(r);i&&(t[r]=[n,i])}return t}}class D{constructor(e,t){this.submitBubbled=e=>{if(e.target instanceof HTMLFormElement){const t=e.target,n=e.submitter||void 0;this.delegate.shouldInterceptFormSubmission(t,n)&&(e.preventDefault(),e.stopImmediatePropagation(),this.delegate.formSubmissionIntercepted(t,n))}},this.delegate=e,this.element=t}start(){this.element.addEventListener("submit",this.submitBubbled)}stop(){this.element.removeEventListener("submit",this.submitBubbled)}}class E{constructor(e,t){this.delegate=e,this.element=t}scrollToAnchor(e){const t=this.snapshot.getElementForAnchor(e);t?this.scrollToElement(t):this.scrollToPosition({x:0,y:0})}scrollToElement(e){e.scrollIntoView()}scrollToPosition({x:e,y:t}){this.scrollRoot.scrollTo(e,t)}get scrollRoot(){return window}async render(e){if(this.renderer)throw new Error("rendering is already in progress");const{isPreview:t,shouldRender:n,newSnapshot:r}=e;if(n)try{this.renderer=e,this.prepareToRenderSnapshot(e),this.delegate.viewWillRenderSnapshot(r,t),await this.renderSnapshot(e),this.delegate.viewRenderedSnapshot(r,t),this.finishRenderingSnapshot(e)}finally{delete this.renderer}else this.invalidate()}invalidate(){this.delegate.viewInvalidated()}prepareToRenderSnapshot(e){this.markAsPreview(e.isPreview),e.prepareToRender()}markAsPreview(e){e?this.element.setAttribute("data-turbo-preview",""):this.element.removeAttribute("data-turbo-preview")}async renderSnapshot(e){await e.render()}finishRenderingSnapshot(e){e.finishRendering()}}class T extends E{invalidate(){this.element.innerHTML=""}get snapshot(){return new A(this.element)}}class O{constructor(e,t){this.clickBubbled=e=>{this.respondsToEventTarget(e.target)?this.clickEvent=e:delete this.clickEvent},this.linkClicked=e=>{this.clickEvent&&this.respondsToEventTarget(e.target)&&e.target instanceof Element&&this.delegate.shouldInterceptLinkClick(e.target,e.detail.url)&&(this.clickEvent.preventDefault(),e.preventDefault(),this.delegate.linkClickIntercepted(e.target,e.detail.url)),delete this.clickEvent},this.willVisit=()=>{delete this.clickEvent},this.delegate=e,this.element=t}start(){this.element.addEventListener("click",this.clickBubbled),document.addEventListener("turbo:click",this.linkClicked),document.addEventListener("turbo:before-visit",this.willVisit)}stop(){this.element.removeEventListener("click",this.clickBubbled),document.removeEventListener("turbo:click",this.linkClicked),document.removeEventListener("turbo:before-visit",this.willVisit)}respondsToEventTarget(e){const t=e instanceof Element?e:e instanceof Node?e.parentElement:null;return t&&t.closest("turbo-frame, html")==this.element}}class L{constructor(e,t,n){this.currentSnapshot=e,this.newSnapshot=t,this.isPreview=n,this.promise=new Promise(((e,t)=>this.resolvingFunctions={resolve:e,reject:t}))}get shouldRender(){return!0}prepareToRender(){}finishRendering(){this.resolvingFunctions&&(this.resolvingFunctions.resolve(),delete this.resolvingFunctions)}createScriptElement(e){if("false"==e.getAttribute("data-turbo-eval"))return e;{const t=document.createElement("script");return t.textContent=e.textContent,t.async=!1,function(e,t){for(const{name:n,value:r}of[...t.attributes])e.setAttribute(n,r)}(t,e),t}}preservingPermanentElements(e){(class{constructor(e){this.permanentElementMap=e}static preservingPermanentElements(e,t){const n=new this(e);n.enter(),t(),n.leave()}enter(){for(const e in this.permanentElementMap){const[,t]=this.permanentElementMap[e];this.replaceNewPermanentElementWithPlaceholder(t)}}leave(){for(const e in this.permanentElementMap){const[t]=this.permanentElementMap[e];this.replaceCurrentPermanentElementWithClone(t),this.replacePlaceholderWithPermanentElement(t)}}replaceNewPermanentElementWithPlaceholder(e){const t=function(e){const t=document.createElement("meta");return t.setAttribute("name","turbo-permanent-placeholder"),t.setAttribute("content",e.id),t}(e);e.replaceWith(t)}replaceCurrentPermanentElementWithClone(e){const t=e.cloneNode(!0);e.replaceWith(t)}replacePlaceholderWithPermanentElement(e){const t=this.getPlaceholderById(e.id);null==t||t.replaceWith(e)}getPlaceholderById(e){return this.placeholders.find((t=>t.content==e))}get placeholders(){return[...document.querySelectorAll("meta[name=turbo-permanent-placeholder][content]")]}}).preservingPermanentElements(this.permanentElementMap,e)}focusFirstAutofocusableElement(){const e=this.connectedSnapshot.firstAutofocusableElement;(function(e){return e&&"function"==typeof e.focus})(e)&&e.focus()}get connectedSnapshot(){return this.newSnapshot.isConnected?this.newSnapshot:this.currentSnapshot}get currentElement(){return this.currentSnapshot.element}get newElement(){return this.newSnapshot.element}get permanentElementMap(){return this.currentSnapshot.getPermanentElementMapForSnapshot(this.newSnapshot)}}class M extends L{get shouldRender(){return!0}async render(){await v(),this.preservingPermanentElements((()=>{this.loadFrameElement()})),this.scrollFrameIntoView(),await v(),this.focusFirstAutofocusableElement()}loadFrameElement(){var e;const t=document.createRange();t.selectNodeContents(this.currentElement),t.deleteContents();const n=this.newElement,r=null===(e=n.ownerDocument)||void 0===e?void 0:e.createRange();r&&(r.selectNodeContents(n),this.currentElement.appendChild(r.extractContents()))}scrollFrameIntoView(){if(this.currentElement.autoscroll||this.newElement.autoscroll){const t=this.currentElement.firstElementChild,n=("end","end"==(e=this.currentElement.getAttribute("data-autoscroll-block"))||"start"==e||"center"==e||"nearest"==e?e:"end");if(t)return t.scrollIntoView({block:n}),!0}var e;return!1}}class F{constructor(){this.hiding=!1,this.value=0,this.visible=!1,this.trickle=()=>{this.setValue(this.value+Math.random()/100)},this.stylesheetElement=this.createStylesheetElement(),this.progressElement=this.createProgressElement(),this.installStylesheetElement(),this.setValue(0)}static get defaultCSS(){return b` .turbo-progress-bar { position: fixed; display: block; top: 0; left: 0; height: 3px; background: #0076ff; z-index: 9999; transition: width ${F.animationDuration}ms ease-out, opacity ${F.animationDuration/2}ms ${F.animationDuration/2}ms ease-in; transform: translate3d(0, 0, 0); } `}show(){this.visible||(this.visible=!0,this.installProgressElement(),this.startTrickling())}hide(){this.visible&&!this.hiding&&(this.hiding=!0,this.fadeProgressElement((()=>{this.uninstallProgressElement(),this.stopTrickling(),this.visible=!1,this.hiding=!1})))}setValue(e){this.value=e,this.refresh()}installStylesheetElement(){document.head.insertBefore(this.stylesheetElement,document.head.firstChild)}installProgressElement(){this.progressElement.style.width="0",this.progressElement.style.opacity="1",document.documentElement.insertBefore(this.progressElement,document.body),this.refresh()}fadeProgressElement(e){this.progressElement.style.opacity="0",setTimeout(e,1.5*F.animationDuration)}uninstallProgressElement(){this.progressElement.parentNode&&document.documentElement.removeChild(this.progressElement)}startTrickling(){this.trickleInterval||(this.trickleInterval=window.setInterval(this.trickle,F.animationDuration))}stopTrickling(){window.clearInterval(this.trickleInterval),delete this.trickleInterval}refresh(){requestAnimationFrame((()=>{this.progressElement.style.width=10+90*this.value+"%"}))}createStylesheetElement(){const e=document.createElement("style");return e.type="text/css",e.textContent=F.defaultCSS,e}createProgressElement(){const e=document.createElement("div");return e.className="turbo-progress-bar",e}}F.animationDuration=300;class P extends A{constructor(){super(...arguments),this.detailsByOuterHTML=this.children.reduce(((e,t)=>{const{outerHTML:n}=t,r=n in e?e[n]:{type:N(t),tracked:I(t),elements:[]};return Object.assign(Object.assign({},e),{[n]:Object.assign(Object.assign({},r),{elements:[...r.elements,t]})})}),{})}get trackedElementSignature(){return Object.keys(this.detailsByOuterHTML).filter((e=>this.detailsByOuterHTML[e].tracked)).join("")}getScriptElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot("script",e)}getStylesheetElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot("stylesheet",e)}getElementsMatchingTypeNotInSnapshot(e,t){return Object.keys(this.detailsByOuterHTML).filter((e=>!(e in t.detailsByOuterHTML))).map((e=>this.detailsByOuterHTML[e])).filter((({type:t})=>t==e)).map((({elements:[e]})=>e))}get provisionalElements(){return Object.keys(this.detailsByOuterHTML).reduce(((e,t)=>{const{type:n,tracked:r,elements:i}=this.detailsByOuterHTML[t];return null!=n||r?i.length>1?[...e,...i.slice(1)]:e:[...e,...i]}),[])}getMetaValue(e){const t=this.findMetaElementByName(e);return t?t.getAttribute("content"):null}findMetaElementByName(e){return Object.keys(this.detailsByOuterHTML).reduce(((t,n)=>{const{elements:[r]}=this.detailsByOuterHTML[n];return function(e,t){return"meta"==e.tagName.toLowerCase()&&e.getAttribute("name")==t}(r,e)?r:t}),void 0)}}function N(e){return function(e){return"script"==e.tagName.toLowerCase()}(e)?"script":function(e){const t=e.tagName.toLowerCase();return"style"==t||"link"==t&&"stylesheet"==e.getAttribute("rel")}(e)?"stylesheet":void 0}function I(e){return"reload"==e.getAttribute("data-turbo-track")}class j extends A{constructor(e,t){super(e),this.headSnapshot=t}static fromHTMLString(e=""){return this.fromDocument(y(e))}static fromElement(e){return this.fromDocument(e.ownerDocument)}static fromDocument({head:e,body:t}){return new this(t,new P(e))}clone(){return new j(this.element.cloneNode(!0),this.headSnapshot)}get headElement(){return this.headSnapshot.element}get rootLocation(){var e;return f(null!==(e=this.getSetting("root"))&&void 0!==e?e:"/")}get cacheControlValue(){return this.getSetting("cache-control")}get isPreviewable(){return"no-preview"!=this.cacheControlValue}get isCacheable(){return"no-cache"!=this.cacheControlValue}get isVisitable(){return"reload"!=this.getSetting("visit-control")}getSetting(e){return this.headSnapshot.getMetaValue(`turbo-${e}`)}}!function(e){e.visitStart="visitStart",e.requestStart="requestStart",e.requestEnd="requestEnd",e.visitEnd="visitEnd"}(u||(u={})),function(e){e.initialized="initialized",e.started="started",e.canceled="canceled",e.failed="failed",e.completed="completed"}(c||(c={}));const R={action:"advance",historyChanged:!1};var B,z;!function(e){e[e.networkFailure=0]="networkFailure",e[e.timeoutFailure=-1]="timeoutFailure",e[e.contentTypeMismatch=-2]="contentTypeMismatch"}(B||(B={}));class q{constructor(e,t,n,r={}){this.identifier=x(),this.timingMetrics={},this.followedRedirect=!1,this.historyChanged=!1,this.scrolled=!1,this.snapshotCached=!1,this.state=c.initialized,this.delegate=e,this.location=t,this.restorationIdentifier=n||x();const{action:i,historyChanged:o,referrer:a,snapshotHTML:s,response:l}=Object.assign(Object.assign({},R),r);this.action=i,this.historyChanged=o,this.referrer=a,this.snapshotHTML=s,this.response=l}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get history(){return this.delegate.history}get restorationData(){return this.history.getRestorationDataForIdentifier(this.restorationIdentifier)}start(){this.state==c.initialized&&(this.recordTimingMetric(u.visitStart),this.state=c.started,this.adapter.visitStarted(this),this.delegate.visitStarted(this))}cancel(){this.state==c.started&&(this.request&&this.request.cancel(),this.cancelRender(),this.state=c.canceled)}complete(){this.state==c.started&&(this.recordTimingMetric(u.visitEnd),this.state=c.completed,this.adapter.visitCompleted(this),this.delegate.visitCompleted(this))}fail(){this.state==c.started&&(this.state=c.failed,this.adapter.visitFailed(this))}changeHistory(){var e;if(!this.historyChanged){const t=this.location.href===(null===(e=this.referrer)||void 0===e?void 0:e.href)?"replace":this.action,n=this.getHistoryMethodForAction(t);this.history.update(n,this.location,this.restorationIdentifier),this.historyChanged=!0}}issueRequest(){this.hasPreloadedResponse()?this.simulateRequest():this.shouldIssueRequest()&&!this.request&&(this.request=new w(this,a.get,this.location),this.request.perform())}simulateRequest(){this.response&&(this.startRequest(),this.recordResponse(),this.finishRequest())}startRequest(){this.recordTimingMetric(u.requestStart),this.adapter.visitRequestStarted(this)}recordResponse(e=this.response){if(this.response=e,e){const{statusCode:t}=e;H(t)?this.adapter.visitRequestCompleted(this):this.adapter.visitRequestFailedWithStatusCode(this,t)}}finishRequest(){this.recordTimingMetric(u.requestEnd),this.adapter.visitRequestFinished(this)}loadResponse(){if(this.response){const{statusCode:e,responseHTML:t}=this.response;this.render((async()=>{this.cacheSnapshot(),H(e)&&null!=t?(await this.view.renderPage(j.fromHTMLString(t)),this.adapter.visitRendered(this),this.complete()):(await this.view.renderError(j.fromHTMLString(t)),this.adapter.visitRendered(this),this.fail())}))}}getCachedSnapshot(){const e=this.view.getCachedSnapshotForLocation(this.location)||this.getPreloadedSnapshot();if(e&&(!p(this.location)||e.hasAnchor(p(this.location)))&&("restore"==this.action||e.isPreviewable))return e}getPreloadedSnapshot(){if(this.snapshotHTML)return j.fromHTMLString(this.snapshotHTML)}hasCachedSnapshot(){return null!=this.getCachedSnapshot()}loadCachedSnapshot(){const e=this.getCachedSnapshot();if(e){const t=this.shouldIssueRequest();this.render((async()=>{this.cacheSnapshot(),await this.view.renderPage(e,t),this.adapter.visitRendered(this),t||this.complete()}))}}followRedirect(){this.redirectedToLocation&&!this.followedRedirect&&(this.location=this.redirectedToLocation,this.history.replace(this.redirectedToLocation,this.restorationIdentifier),this.followedRedirect=!0)}requestStarted(){this.startRequest()}requestPreventedHandlingResponse(e,t){}async requestSucceededWithResponse(e,t){const n=await t.responseHTML;null==n?this.recordResponse({statusCode:B.contentTypeMismatch}):(this.redirectedToLocation=t.redirected?t.location:void 0,this.recordResponse({statusCode:t.statusCode,responseHTML:n}))}async requestFailedWithResponse(e,t){const n=await t.responseHTML;null==n?this.recordResponse({statusCode:B.contentTypeMismatch}):this.recordResponse({statusCode:t.statusCode,responseHTML:n})}requestErrored(e,t){this.recordResponse({statusCode:B.networkFailure})}requestFinished(){this.finishRequest()}performScroll(){this.scrolled||("restore"==this.action?this.scrollToRestoredPosition()||this.scrollToTop():this.scrollToAnchor()||this.scrollToTop(),this.scrolled=!0)}scrollToRestoredPosition(){const{scrollPosition:e}=this.restorationData;if(e)return this.view.scrollToPosition(e),!0}scrollToAnchor(){if(null!=p(this.location))return this.view.scrollToAnchor(p(this.location)),!0}scrollToTop(){this.view.scrollToPosition({x:0,y:0})}recordTimingMetric(e){this.timingMetrics[e]=(new Date).getTime()}getTimingMetrics(){return Object.assign({},this.timingMetrics)}getHistoryMethodForAction(e){switch(e){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}hasPreloadedResponse(){return"object"==typeof this.response}shouldIssueRequest(){return"restore"!=this.action||!this.hasCachedSnapshot()}cacheSnapshot(){this.snapshotCached||(this.view.cacheSnapshot(),this.snapshotCached=!0)}async render(e){this.cancelRender(),await new Promise((e=>{this.frame=requestAnimationFrame((()=>e()))})),e(),delete this.frame,this.performScroll()}cancelRender(){this.frame&&(cancelAnimationFrame(this.frame),delete this.frame)}}function H(e){return e>=200&&e<300}class W{constructor(e){this.progressBar=new F,this.showProgressBar=()=>{this.progressBar.show()},this.session=e}visitProposedToLocation(e,t){this.navigator.startVisit(e,x(),t)}visitStarted(e){e.issueRequest(),e.changeHistory(),e.loadCachedSnapshot()}visitRequestStarted(e){this.progressBar.setValue(0),e.hasCachedSnapshot()||"restore"!=e.action?this.showProgressBarAfterDelay():this.showProgressBar()}visitRequestCompleted(e){e.loadResponse()}visitRequestFailedWithStatusCode(e,t){switch(t){case B.networkFailure:case B.timeoutFailure:case B.contentTypeMismatch:return this.reload();default:return e.loadResponse()}}visitRequestFinished(e){this.progressBar.setValue(1),this.hideProgressBar()}visitCompleted(e){e.followRedirect()}pageInvalidated(){this.reload()}visitFailed(e){}visitRendered(e){}showProgressBarAfterDelay(){this.progressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay)}hideProgressBar(){this.progressBar.hide(),null!=this.progressBarTimeout&&(window.clearTimeout(this.progressBarTimeout),delete this.progressBarTimeout)}reload(){window.location.reload()}get navigator(){return this.session.navigator}}class U{constructor(e){this.started=!1,this.submitCaptured=()=>{removeEventListener("submit",this.submitBubbled,!1),addEventListener("submit",this.submitBubbled,!1)},this.submitBubbled=e=>{if(!e.defaultPrevented){const t=e.target instanceof HTMLFormElement?e.target:void 0,n=e.submitter||void 0;t&&"dialog"!=((null==n?void 0:n.getAttribute("formmethod"))||t.method)&&this.delegate.willSubmitForm(t,n)&&(e.preventDefault(),this.delegate.formSubmitted(t,n))}},this.delegate=e}start(){this.started||(addEventListener("submit",this.submitCaptured,!0),this.started=!0)}stop(){this.started&&(removeEventListener("submit",this.submitCaptured,!0),this.started=!1)}}class V{constructor(e){this.element=e,this.linkInterceptor=new O(this,e),this.formInterceptor=new D(this,e)}start(){this.linkInterceptor.start(),this.formInterceptor.start()}stop(){this.linkInterceptor.stop(),this.formInterceptor.stop()}shouldInterceptLinkClick(e,t){return this.shouldRedirect(e)}linkClickIntercepted(e,t){const n=this.findFrameElement(e);n&&(n.src=t)}shouldInterceptFormSubmission(e,t){return this.shouldRedirect(e,t)}formSubmissionIntercepted(e,t){const n=this.findFrameElement(e);n&&n.delegate.formSubmissionIntercepted(e,t)}shouldRedirect(e,t){const n=this.findFrameElement(e);return!!n&&n!=e.closest("turbo-frame")}findFrameElement(e){const t=e.getAttribute("data-turbo-frame");if(t&&"_top"!=t){const e=this.element.querySelector(`#${t}:not([disabled])`);if(e instanceof d)return e}}}class ${constructor(e){this.restorationIdentifier=x(),this.restorationData={},this.started=!1,this.pageLoaded=!1,this.onPopState=e=>{if(this.shouldHandlePopState()){const{turbo:t}=e.state||{};if(t){this.location=new URL(window.location.href);const{restorationIdentifier:e}=t;this.restorationIdentifier=e,this.delegate.historyPoppedToLocationWithRestorationIdentifier(this.location,e)}}},this.onPageLoad=async e=>{await Promise.resolve(),this.pageLoaded=!0},this.delegate=e}start(){this.started||(addEventListener("popstate",this.onPopState,!1),addEventListener("load",this.onPageLoad,!1),this.started=!0,this.replace(new URL(window.location.href)))}stop(){this.started&&(removeEventListener("popstate",this.onPopState,!1),removeEventListener("load",this.onPageLoad,!1),this.started=!1)}push(e,t){this.update(history.pushState,e,t)}replace(e,t){this.update(history.replaceState,e,t)}update(e,t,n=x()){const r={turbo:{restorationIdentifier:n}};e.call(history,r,"",t.href),this.location=t,this.restorationIdentifier=n}getRestorationDataForIdentifier(e){return this.restorationData[e]||{}}updateRestorationData(e){const{restorationIdentifier:t}=this,n=this.restorationData[t];this.restorationData[t]=Object.assign(Object.assign({},n),e)}assumeControlOfScrollRestoration(){var e;this.previousScrollRestoration||(this.previousScrollRestoration=null!==(e=history.scrollRestoration)&&void 0!==e?e:"auto",history.scrollRestoration="manual")}relinquishControlOfScrollRestoration(){this.previousScrollRestoration&&(history.scrollRestoration=this.previousScrollRestoration,delete this.previousScrollRestoration)}shouldHandlePopState(){return this.pageIsLoaded()}pageIsLoaded(){return this.pageLoaded||"complete"==document.readyState}}class K{constructor(e){this.started=!1,this.clickCaptured=()=>{removeEventListener("click",this.clickBubbled,!1),addEventListener("click",this.clickBubbled,!1)},this.clickBubbled=e=>{if(this.clickEventIsSignificant(e)){const t=this.findLinkFromClickTarget(e.target);if(t){const n=this.getLocationForLink(t);this.delegate.willFollowLinkToLocation(t,n)&&(e.preventDefault(),this.delegate.followedLinkToLocation(t,n))}}},this.delegate=e}start(){this.started||(addEventListener("click",this.clickCaptured,!0),this.started=!0)}stop(){this.started&&(removeEventListener("click",this.clickCaptured,!0),this.started=!1)}clickEventIsSignificant(e){return!(e.target&&e.target.isContentEditable||e.defaultPrevented||e.which>1||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)}findLinkFromClickTarget(e){if(e instanceof Element)return e.closest("a[href]:not([target^=_]):not([download])")}getLocationForLink(e){return f(e.getAttribute("href")||"")}}function G(e){return"advance"==e||"replace"==e||"restore"==e}class Y{constructor(e){this.delegate=e}proposeVisit(e,t={}){this.delegate.allowsVisitingLocation(e)&&this.delegate.visitProposedToLocation(e,t)}startVisit(e,t,n={}){this.stop(),this.currentVisit=new q(this,f(e),t,Object.assign({referrer:this.location},n)),this.currentVisit.start()}submitForm(e,t){this.stop(),this.formSubmission=new S(this,e,t,!0),this.formSubmission.isIdempotent?this.proposeVisit(this.formSubmission.fetchRequest.url,{action:this.getActionForFormSubmission(this.formSubmission)}):this.formSubmission.start()}stop(){this.formSubmission&&(this.formSubmission.stop(),delete this.formSubmission),this.currentVisit&&(this.currentVisit.cancel(),delete this.currentVisit)}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get history(){return this.delegate.history}formSubmissionStarted(e){}async formSubmissionSucceededWithResponse(e,t){if(e==this.formSubmission){const n=await t.responseHTML;if(n){e.method!=a.get&&this.view.clearSnapshotCache();const{statusCode:r}=t,i={response:{statusCode:r,responseHTML:n}};this.proposeVisit(t.location,i)}}}async formSubmissionFailedWithResponse(e,t){const n=await t.responseHTML;if(n){const e=j.fromHTMLString(n);await this.view.renderPage(e),this.view.clearSnapshotCache()}}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished(e){}visitStarted(e){this.delegate.visitStarted(e)}visitCompleted(e){this.delegate.visitCompleted(e)}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}getActionForFormSubmission(e){const{formElement:t,submitter:n}=e,r=(null==n?void 0:n.getAttribute("data-turbo-action"))||t.getAttribute("data-turbo-action");return G(r)?r:"advance"}}!function(e){e[e.initial=0]="initial",e[e.loading=1]="loading",e[e.interactive=2]="interactive",e[e.complete=3]="complete"}(z||(z={}));class Q{constructor(e){this.stage=z.initial,this.started=!1,this.interpretReadyState=()=>{const{readyState:e}=this;"interactive"==e?this.pageIsInteractive():"complete"==e&&this.pageIsComplete()},this.pageWillUnload=()=>{this.delegate.pageWillUnload()},this.delegate=e}start(){this.started||(this.stage==z.initial&&(this.stage=z.loading),document.addEventListener("readystatechange",this.interpretReadyState,!1),addEventListener("pagehide",this.pageWillUnload,!1),this.started=!0)}stop(){this.started&&(document.removeEventListener("readystatechange",this.interpretReadyState,!1),removeEventListener("pagehide",this.pageWillUnload,!1),this.started=!1)}pageIsInteractive(){this.stage==z.loading&&(this.stage=z.interactive,this.delegate.pageBecameInteractive())}pageIsComplete(){this.pageIsInteractive(),this.stage==z.interactive&&(this.stage=z.complete,this.delegate.pageLoaded())}get readyState(){return document.readyState}}class Z{constructor(e){this.started=!1,this.onScroll=()=>{this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})},this.delegate=e}start(){this.started||(addEventListener("scroll",this.onScroll,!1),this.onScroll(),this.started=!0)}stop(){this.started&&(removeEventListener("scroll",this.onScroll,!1),this.started=!1)}updatePosition(e){this.delegate.scrollPositionChanged(e)}}class J{constructor(e){this.sources=new Set,this.started=!1,this.inspectFetchResponse=e=>{const t=function(e){var t;const n=null===(t=e.detail)||void 0===t?void 0:t.fetchResponse;if(n instanceof m)return n}(e);t&&function(e){var t;return(null!==(t=e.contentType)&&void 0!==t?t:"").startsWith(C.contentType)}(t)&&(e.preventDefault(),this.receiveMessageResponse(t))},this.receiveMessageEvent=e=>{this.started&&"string"==typeof e.data&&this.receiveMessageHTML(e.data)},this.delegate=e}start(){this.started||(this.started=!0,addEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}stop(){this.started&&(this.started=!1,removeEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}connectStreamSource(e){this.streamSourceIsConnected(e)||(this.sources.add(e),e.addEventListener("message",this.receiveMessageEvent,!1))}disconnectStreamSource(e){this.streamSourceIsConnected(e)&&(this.sources.delete(e),e.removeEventListener("message",this.receiveMessageEvent,!1))}streamSourceIsConnected(e){return this.sources.has(e)}async receiveMessageResponse(e){const t=await e.responseHTML;t&&this.receiveMessageHTML(t)}receiveMessageHTML(e){this.delegate.receivedMessageFromStream(new C(e))}}class X extends L{async render(){this.replaceHeadAndBody(),this.activateScriptElements()}replaceHeadAndBody(){const{documentElement:e,head:t,body:n}=document;e.replaceChild(this.newHead,t),e.replaceChild(this.newElement,n)}activateScriptElements(){for(const e of this.scriptElements){const t=e.parentNode;if(t){const n=this.createScriptElement(e);t.replaceChild(n,e)}}}get newHead(){return this.newSnapshot.headSnapshot.element}get scriptElements(){return[...document.documentElement.querySelectorAll("script")]}}class ee extends L{get shouldRender(){return this.newSnapshot.isVisitable&&this.trackedElementsAreIdentical}prepareToRender(){this.mergeHead()}async render(){this.replaceBody()}finishRendering(){super.finishRendering(),this.isPreview||this.focusFirstAutofocusableElement()}get currentHeadSnapshot(){return this.currentSnapshot.headSnapshot}get newHeadSnapshot(){return this.newSnapshot.headSnapshot}get newElement(){return this.newSnapshot.element}mergeHead(){this.copyNewHeadStylesheetElements(),this.copyNewHeadScriptElements(),this.removeCurrentHeadProvisionalElements(),this.copyNewHeadProvisionalElements()}replaceBody(){this.preservingPermanentElements((()=>{this.activateNewBody(),this.assignNewBody()}))}get trackedElementsAreIdentical(){return this.currentHeadSnapshot.trackedElementSignature==this.newHeadSnapshot.trackedElementSignature}copyNewHeadStylesheetElements(){for(const e of this.newHeadStylesheetElements)document.head.appendChild(e)}copyNewHeadScriptElements(){for(const e of this.newHeadScriptElements)document.head.appendChild(this.createScriptElement(e))}removeCurrentHeadProvisionalElements(){for(const e of this.currentHeadProvisionalElements)document.head.removeChild(e)}copyNewHeadProvisionalElements(){for(const e of this.newHeadProvisionalElements)document.head.appendChild(e)}activateNewBody(){document.adoptNode(this.newElement),this.activateNewBodyScriptElements()}activateNewBodyScriptElements(){for(const e of this.newBodyScriptElements){const t=this.createScriptElement(e);e.replaceWith(t)}}assignNewBody(){document.body&&this.newElement instanceof HTMLBodyElement?document.body.replaceWith(this.newElement):document.documentElement.appendChild(this.newElement)}get newHeadStylesheetElements(){return this.newHeadSnapshot.getStylesheetElementsNotInSnapshot(this.currentHeadSnapshot)}get newHeadScriptElements(){return this.newHeadSnapshot.getScriptElementsNotInSnapshot(this.currentHeadSnapshot)}get currentHeadProvisionalElements(){return this.currentHeadSnapshot.provisionalElements}get newHeadProvisionalElements(){return this.newHeadSnapshot.provisionalElements}get newBodyScriptElements(){return[...this.newElement.querySelectorAll("script")]}}class te{constructor(e){this.keys=[],this.snapshots={},this.size=e}has(e){return h(e)in this.snapshots}get(e){if(this.has(e)){const t=this.read(e);return this.touch(e),t}}put(e,t){return this.write(e,t),this.touch(e),t}clear(){this.snapshots={}}read(e){return this.snapshots[h(e)]}write(e,t){this.snapshots[h(e)]=t}touch(e){const t=h(e),n=this.keys.indexOf(t);n>-1&&this.keys.splice(n,1),this.keys.unshift(t),this.trim()}trim(){for(const e of this.keys.splice(this.size))delete this.snapshots[e]}}class ne extends E{constructor(){super(...arguments),this.snapshotCache=new te(10),this.lastRenderedLocation=new URL(location.href)}renderPage(e,t=!1){const n=new ee(this.snapshot,e,t);return this.render(n)}renderError(e){const t=new X(this.snapshot,e,!1);this.render(t)}clearSnapshotCache(){this.snapshotCache.clear()}async cacheSnapshot(){if(this.shouldCacheSnapshot){this.delegate.viewWillCacheSnapshot();const{snapshot:e,lastRenderedLocation:t}=this;await new Promise((e=>setTimeout((()=>e()),0))),this.snapshotCache.put(t,e.clone())}}getCachedSnapshotForLocation(e){return this.snapshotCache.get(e)}get snapshot(){return j.fromElement(this.element)}get shouldCacheSnapshot(){return this.snapshot.isCacheable}}function re(e){const t=null==e?void 0:e.closest("[data-turbo]");return!t||"false"!=t.getAttribute("data-turbo")}function ie(e){Object.defineProperties(e,oe)}const oe={absoluteURL:{get(){return this.toString()}}};function ae(e){if(null!=e){const t=document.getElementById(e);if(t instanceof d)return t}}function se(e,t){if(e){const r=e.getAttribute("src");if(null!=r&&null!=t&&(n=t,f(r).href==f(n).href))throw new Error(`Matching element has a source URL which references itself`);if(e.ownerDocument!==document&&(e=document.importNode(e,!0)),e instanceof d)return e.connectedCallback(),e}var n}const le={append(){var e;null===(e=this.targetElement)||void 0===e||e.append(this.templateContent)},prepend(){var e;null===(e=this.targetElement)||void 0===e||e.prepend(this.templateContent)},remove(){var e;null===(e=this.targetElement)||void 0===e||e.remove()},replace(){var e;null===(e=this.targetElement)||void 0===e||e.replaceWith(this.templateContent)},update(){this.targetElement&&(this.targetElement.innerHTML="",this.targetElement.append(this.templateContent))}};class ue extends HTMLElement{async connectedCallback(){try{await this.render()}catch(e){console.error(e)}finally{this.disconnect()}}async render(){var e;return null!==(e=this.renderPromise)&&void 0!==e?e:this.renderPromise=(async()=>{this.dispatchEvent(this.beforeRenderEvent)&&(await v(),this.performAction())})()}disconnect(){try{this.remove()}catch(e){}}get performAction(){if(this.action){const e=le[this.action];if(e)return e;this.raise("unknown action")}this.raise("action attribute is missing")}get targetElement(){var e;if(this.target)return null===(e=this.ownerDocument)||void 0===e?void 0:e.getElementById(this.target);this.raise("target attribute is missing")}get templateContent(){return this.templateElement.content}get templateElement(){if(this.firstElementChild instanceof HTMLTemplateElement)return this.firstElementChild;this.raise("first child element must be a