opnform/public/vendor/mailcoach/app.js

25 lines
223 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*! For license information please see app.js.LICENSE.txt */
!function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=5)}([function(e,t,n){"use strict";function i(e,t){let n;return(...i)=>{clearTimeout(n),n=setTimeout(()=>e(...i),t)}}function r(e,t=document){return t.querySelector(e)}function s(e,t=document){return Array.from(t.querySelectorAll(e))}n.d(t,"c",(function(){return i})),n.d(t,"h",(function(){return a})),n.d(t,"f",(function(){return c})),n.d(t,"g",(function(){return l})),n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return s})),n.d(t,"d",(function(){return d})),n.d(t,"e",(function(){return u}));const o=['a[href]:not([disabled]):not([tabindex="-1"])','button:not([disabled]):not([tabindex="-1"])','textarea:not([disabled]):not([tabindex="-1"])','input:not([type="hidden"]):not([disabled]):not([tabindex="-1"])','select:not([disabled]):not([tabindex="-1"])'];function a(e){const t=s(o.join(", "),e),n=t[0],i=t[t.length-1];function r(e){"Tab"===e.key&&(e.shiftKey?document.activeElement===n&&(e.preventDefault(),i.focus()):document.activeElement===i&&(e.preventDefault(),n.focus()))}return n&&n.focus(),window.addEventListener("keydown",r),()=>{window.removeEventListener("keydown",r)}}function c(e,t,n){document.addEventListener(e,e=>{const i=e.target.closest(t);i&&n({event:e,target:i})})}function l(){}async function d(e,t){e.classList.remove("hidden"),e.classList.add(t+"-enter"),e.classList.add(t+"-enter-start"),await m(),e.classList.remove(t+"-enter-start"),e.classList.add(t+"-enter-end"),await h(e),e.classList.remove(t+"-enter-end"),e.classList.remove(t+"-enter"),await m()}async function u(e,t){e.classList.add(t+"-leave"),e.classList.add(t+"-leave-start"),await m(),e.classList.remove(t+"-leave-start"),e.classList.add(t+"-leave-end"),await h(e),e.classList.remove(t+"-leave-end"),e.classList.remove(t+"-leave"),e.classList.add("hidden"),await m()}function h(e){return new Promise(t=>{const n=1e3*Number(getComputedStyle(e).transitionDuration.replace("s",""));setTimeout(()=>{t()},n)})}function m(){return new Promise(e=>{requestAnimationFrame(()=>{requestAnimationFrame(e)})})}},function(e,t,n){"use strict";n.r(t),n.d(t,"showModal",(function(){return r}));var i=n(0);function r(e,{onConfirm:t=i.g,onDismiss:n=i.g}={}){const r=Object(i.a)(`[data-modal="${e}"]`);Object(i.d)(r,"fade"),o(r,{onConfirm:t,onDismiss:n,onClose:Object(i.h)(r)}),s(!0)}function s(e){window.history.replaceState({},"",window.location.pathname+window.location.search+(e?"#modal":""))}function o(e,{onConfirm:t,onDismiss:n,onClose:r}){function o(t){"Escape"===t.key&&e.dispatchEvent(new Event("dismiss"))}function a(){t(),l(),Object(i.e)(e,"fade")}function c(){n(),l(),Object(i.e)(e,"fade")}function l(){r(),window.removeEventListener("keydown",o),e.removeEventListener("confirm",a),e.removeEventListener("dismiss",c),s(!1)}window.addEventListener("keydown",o),e.addEventListener("confirm",a),e.addEventListener("dismiss",c)}if(Object(i.f)("click","[data-modal-trigger]",({target:e})=>{r(e.dataset.modalTrigger)}),Object(i.f)("click","[data-modal-confirm]",({target:e})=>{e.closest("[data-modal]").dispatchEvent(new Event("confirm"))}),Object(i.f)("click","[data-modal-dismiss]",({target:e})=>{e.closest("[data-modal]").dispatchEvent(new Event("dismiss"))}),Object(i.f)("click","[data-modal-backdrop]",({event:e,target:t})=>{if(e.target===t){t.closest("[data-modal]").dispatchEvent(new Event("dismiss"))}}),document.addEventListener("turbo:load",()=>{Object(i.b)("[data-modal]").filter(e=>!e.classList.contains("hidden")).forEach(e=>{o(e,{onConfirm:i.g,onDismiss:i.g,onClose:i.g})})}),window.location.hash.includes("#modal")){const e=document.querySelector("[data-modal]");if(e){r(e.getAttribute("data-modal"))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return ve})),function(){if(void 0===window.Reflect||void 0===window.customElements||window.customElements.polyfillWrapFlushCallback)return;const e=HTMLElement,t=function(){return Reflect.construct(e,[],this.constructor)};window.HTMLElement=t,HTMLElement.prototype=e.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,e)}(),function(e){function t(e,t,n){throw new e("Failed to execute 'requestSubmit' on 'HTMLFormElement': "+t+".",n)}"function"!=typeof e.requestSubmit&&(e.requestSubmit=function(e){e?(!function(e,n){e instanceof HTMLElement||t(TypeError,"parameter 1 is not of type 'HTMLElement'"),"submit"==e.type||t(TypeError,"The specified element is not a submit button"),e.form==n||t(DOMException,"The specified element is not owned by this form element","NotFoundError")}(e,this),e.click()):((e=document.createElement("input")).type="submit",e.hidden=!0,this.appendChild(e),e.click(),this.removeChild(e))})}(HTMLFormElement.prototype);const i=new WeakMap;function r(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)}var s,o,a,c,l,d;!function(){if("submitter"in Event.prototype)return;let e;if("SubmitEvent"in window&&/Apple Computer/.test(navigator.vendor))e=window.SubmitEvent.prototype;else{if("SubmitEvent"in window)return;e=window.Event.prototype}addEventListener("click",r,!0),Object.defineProperty(e,"submitter",{get(){if("submit"==this.type&&this.target instanceof HTMLFormElement)return i.get(this.target)}})}(),function(e){e.eager="eager",e.lazy="lazy"}(s||(s={}));class u extends HTMLElement{constructor(){super(),this.loaded=Promise.resolve(),this.delegate=new u.delegateConstructor(this)}static get observedAttributes(){return["disabled","loading","src"]}connectedCallback(){this.delegate.connect()}disconnectedCallback(){this.delegate.disconnect()}reload(){const{src:e}=this;this.src=null,this.src=e}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 s.lazy;default:return s.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 h(e){return new URL(e.toString(),document.baseURI)}function m(e){let t;return e.hash?e.hash.slice(1):(t=e.href.match(/#(.*)$/))?t[1]:void 0}function f(e,t){return h((null==t?void 0:t.getAttribute("formaction"))||e.getAttribute("action")||e.action)}function p(e){return(function(e){return function(e){return e.pathname.split("/").slice(1)}(e).slice(-1)[0]}(e).match(/\.[^.]*$/)||[])[0]||""}function g(e,t){const n=function(e){return t=e.origin+e.pathname,t.endsWith("/")?t:t+"/";var t}(t);return e.href===h(n).href||e.href.startsWith(n)}function v(e,t){return g(e,t)&&!!p(e).match(/^(?:|\.(?:htm|html|xhtml))$/)}function b(e){const t=m(e);return null!=t?e.href.slice(0,-(t.length+1)):e.href}function y(e){return b(e)}class w{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 h(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.clone().text()}get responseHTML(){return this.isHTML?this.response.clone().text():Promise.resolve(void 0)}header(e){return this.response.headers.get(e)}}function E(e,{target:t,cancelable:n,detail:i}={}){const r=new CustomEvent(e,{cancelable:n,bubbles:!0,detail:i});return t&&t.isConnected?t.dispatchEvent(r):document.documentElement.dispatchEvent(r),r}function S(){return new Promise(e=>requestAnimationFrame(()=>e()))}function _(e=""){return(new DOMParser).parseFromString(e,"text/html")}function C(e,...t){const n=function(e,t){return e.reduce((e,n,i)=>e+n+(null==t[i]?"":t[i]),"")}(e,t).replace(/^\n/,"").split("\n"),i=n[0].match(/^\s+/),r=i?i[0].length:0;return n.map(e=>e.slice(r)).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 T(e,...t){for(const n of t.map(t=>null==t?void 0:t.getAttribute(e)))if("string"==typeof n)return n;return null}function D(...e){for(const t of e)"turbo-frame"==t.localName&&t.setAttribute("busy",""),t.setAttribute("aria-busy","true")}function L(...e){for(const t of e)"turbo-frame"==t.localName&&t.removeAttribute("busy"),t.removeAttribute("aria-busy")}!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"}(o||(o={}));class A{constructor(e,t,n,i=new URLSearchParams,r=null){this.abortController=new AbortController,this.resolveRequestPromise=e=>{},this.delegate=e,this.method=t,this.headers=this.defaultHeaders,this.body=i,this.url=n,this.target=r}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),await this.allowRequestToBeIntercepted(n);try{this.delegate.requestStarted(this);const e=await fetch(this.url.href,n);return await this.receive(e)}catch(e){if("AbortError"!==e.name)throw this.delegate.requestErrored(this,e),e}finally{this.delegate.requestFinished(this)}}async receive(e){const t=new w(e);return E("turbo:before-fetch-response",{cancelable:!0,detail:{fetchResponse:t},target:this.target}).defaultPrevented?this.delegate.requestPreventedHandlingResponse(this,t):t.succeeded?this.delegate.requestSucceededWithResponse(this,t):this.delegate.requestFailedWithResponse(this,t),t}get fetchOptions(){var e;return{method:o[this.method].toUpperCase(),credentials:"same-origin",headers:this.headers,redirect:"follow",body:this.isIdempotent?null:this.body,signal:this.abortSignal,referrer:null===(e=this.delegate.referrer)||void 0===e?void 0:e.href}}get defaultHeaders(){return{Accept:"text/html, application/xhtml+xml"}}get isIdempotent(){return this.method==o.get}get abortSignal(){return this.abortController.signal}async allowRequestToBeIntercepted(e){const t=new Promise(e=>this.resolveRequestPromise=e);E("turbo:before-fetch-request",{cancelable:!0,detail:{fetchOptions:e,url:this.url,resume:this.resolveRequestPromise},target:this.target}).defaultPrevented&&await t}}class O{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 I{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)}}I.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"}(a||(a={})),function(e){e.urlEncoded="application/x-www-form-urlencoded",e.multipart="multipart/form-data",e.plain="text/plain"}(c||(c={}));class M{constructor(e,t,n,i=!1){this.state=a.initialized,this.delegate=e,this.formElement=t,this.submitter=n,this.formData=function(e,t){const n=new FormData(e),i=null==t?void 0:t.getAttribute("name"),r=null==t?void 0:t.getAttribute("value");i&&null!=r&&n.get(i)!=r&&n.append(i,r);return n}(t,n),this.location=h(this.action),this.method==o.get&&function(e,t){const n=new URLSearchParams;for(const[e,i]of t)i instanceof File||n.append(e,i);e.search=n.toString()}(this.location,[...this.body.entries()]),this.fetchRequest=new A(this,this.method,this.location,this.body,this.formElement),this.mustRedirect=i}static confirmMethod(e,t){return confirm(e)}get method(){var e;return function(e){switch(e.toLowerCase()){case"get":return o.get;case"post":return o.post;case"put":return o.put;case"patch":return o.patch;case"delete":return o.delete}}(((null===(e=this.submitter)||void 0===e?void 0:e.getAttribute("formmethod"))||this.formElement.getAttribute("method")||"").toLowerCase())||o.get}get action(){var e;const t="string"==typeof this.formElement.action?this.formElement.action:null;return(null===(e=this.submitter)||void 0===e?void 0:e.getAttribute("formaction"))||this.formElement.getAttribute("action")||t||""}get body(){return this.enctype==c.urlEncoded||this.method==o.get?new URLSearchParams(this.stringFormData):this.formData}get enctype(){var e;return function(e){switch(e.toLowerCase()){case c.multipart:return c.multipart;case c.plain:return c.plain;default:return c.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]]:[]),[])}get confirmationMessage(){return this.formElement.getAttribute("data-turbo-confirm")}get needsConfirmation(){return null!==this.confirmationMessage}async start(){const{initialized:e,requesting:t}=a;if(this.needsConfirmation){if(!M.confirmMethod(this.confirmationMessage,this.formElement))return}if(this.state==e)return this.state=t,this.fetchRequest.perform()}stop(){const{stopping:e,stopped:t}=a;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}}}(k("csrf-param"))||k("csrf-token");t&&(e["X-CSRF-Token"]=t),e.Accept=[I.contentType,e.Accept].join(", ")}}requestStarted(e){var t;this.state=a.waiting,null===(t=this.submitter)||void 0===t||t.setAttribute("disabled",""),E("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=a.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){var t;this.state=a.stopped,null===(t=this.submitter)||void 0===t||t.removeAttribute("disabled"),E("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 k(e){const t=document.querySelector(`meta[name="${e}"]`);return t&&t.content}class P{constructor(e){this.element=e}get children(){return[...this.element.children]}hasAnchor(e){return null!=this.getElementForAnchor(e)}getElementForAnchor(e){return e?this.element.querySelector(`[id='${e}'], a[name='${e}']`):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:i}=n,r=e.getPermanentElementById(i);r&&(t[i]=[n,r])}return t}}class F{constructor(e,t){this.submitBubbled=e=>{const t=e.target;if(!e.defaultPrevented&&t instanceof HTMLFormElement&&t.closest("turbo-frame, html")==this.element){const n=e.submitter||void 0;"dialog"!=((null==n?void 0:n.getAttribute("formmethod"))||t.method)&&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 R{constructor(e,t){this.resolveRenderPromise=e=>{},this.resolveInterceptionPromise=e=>{},this.delegate=e,this.element=t}scrollToAnchor(e){const t=this.snapshot.getElementForAnchor(e);t?(this.scrollToElement(t),this.focusElement(t)):this.scrollToPosition({x:0,y:0})}scrollToAnchorFromLocation(e){this.scrollToAnchor(m(e))}scrollToElement(e){e.scrollIntoView()}focusElement(e){e instanceof HTMLElement&&(e.hasAttribute("tabindex")?e.focus():(e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")))}scrollToPosition({x:e,y:t}){this.scrollRoot.scrollTo(e,t)}scrollToTop(){this.scrollToPosition({x:0,y:0})}get scrollRoot(){return window}async render(e){const{isPreview:t,shouldRender:n,newSnapshot:i}=e;if(n)try{this.renderPromise=new Promise(e=>this.resolveRenderPromise=e),this.renderer=e,this.prepareToRenderSnapshot(e);const n=new Promise(e=>this.resolveInterceptionPromise=e);this.delegate.allowsImmediateRender(i,this.resolveInterceptionPromise)||await n,await this.renderSnapshot(e),this.delegate.viewRenderedSnapshot(i,t),this.finishRenderingSnapshot(e)}finally{delete this.renderer,this.resolveRenderPromise(void 0),delete this.renderPromise}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 N extends R{invalidate(){this.element.innerHTML=""}get snapshot(){return new P(this.element)}}class j{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 H{constructor(e,t,n,i=!0){this.currentSnapshot=e,this.newSnapshot=t,this.isPreview=n,this.willRender=i,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 this.cspNonce&&(t.nonce=this.cspNonce),t.textContent=e.textContent,t.async=!1,function(e,t){for(const{name:n,value:i}of[...t.attributes])e.setAttribute(n,i)}(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)}get cspNonce(){var e;return null===(e=document.head.querySelector('meta[name="csp-nonce"]'))||void 0===e?void 0:e.getAttribute("content")}}class B extends H{get shouldRender(){return!0}async render(){await S(),this.preservingPermanentElements(()=>{this.loadFrameElement()}),this.scrollFrameIntoView(),await S(),this.focusFirstAutofocusableElement(),await S(),this.activateScriptElements()}loadFrameElement(){var e;const t=document.createRange();t.selectNodeContents(this.currentElement),t.deleteContents();const n=this.newElement,i=null===(e=n.ownerDocument)||void 0===e?void 0:e.createRange();i&&(i.selectNodeContents(n),this.currentElement.appendChild(i.extractContents()))}scrollFrameIntoView(){if(this.currentElement.autoscroll||this.newElement.autoscroll){const n=this.currentElement.firstElementChild,i=(e=this.currentElement.getAttribute("data-autoscroll-block"),t="end","end"==e||"start"==e||"center"==e||"nearest"==e?e:t);if(n)return n.scrollIntoView({block:i}),!0}var e,t;return!1}activateScriptElements(){for(const e of this.newScriptElements){const t=this.createScriptElement(e);e.replaceWith(t)}}get newScriptElements(){return this.currentElement.querySelectorAll("script")}}class q{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 C`
.turbo-progress-bar {
position: fixed;
display: block;
top: 0;
left: 0;
height: 3px;
background: #0076ff;
z-index: 9999;
transition:
width ${q.animationDuration}ms ease-out,
opacity ${q.animationDuration/2}ms ${q.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*q.animationDuration)}uninstallProgressElement(){this.progressElement.parentNode&&document.documentElement.removeChild(this.progressElement)}startTrickling(){this.trickleInterval||(this.trickleInterval=window.setInterval(this.trickle,q.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=q.defaultCSS,e}createProgressElement(){const e=document.createElement("div");return e.className="turbo-progress-bar",e}}q.animationDuration=300;class V extends P{constructor(){super(...arguments),this.detailsByOuterHTML=this.children.filter(e=>!function(e){return"noscript"==e.tagName.toLowerCase()}(e)).map(e=>function(e){e.hasAttribute("nonce")&&e.setAttribute("nonce","");return e}(e)).reduce((e,t)=>{const{outerHTML:n}=t,i=n in e?e[n]:{type:W(t),tracked:$(t),elements:[]};return Object.assign(Object.assign({},e),{[n]:Object.assign(Object.assign({},i),{elements:[...i.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:i,elements:r}=this.detailsByOuterHTML[t];return null!=n||i?r.length>1?[...e,...r.slice(1)]:e:[...e,...r]},[])}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:[i]}=this.detailsByOuterHTML[n];return function(e,t){return"meta"==e.tagName.toLowerCase()&&e.getAttribute("name")==t}(i,e)?i:t},void 0)}}function W(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 $(e){return"reload"==e.getAttribute("data-turbo-track")}class U extends P{constructor(e,t){super(e),this.headSnapshot=t}static fromHTMLString(e=""){return this.fromDocument(_(e))}static fromElement(e){return this.fromDocument(e.ownerDocument)}static fromDocument({head:e,body:t}){return new this(t,new V(e))}clone(){return new U(this.element.cloneNode(!0),this.headSnapshot)}get headElement(){return this.headSnapshot.element}get rootLocation(){var e;return h(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"}(l||(l={})),function(e){e.initialized="initialized",e.started="started",e.canceled="canceled",e.failed="failed",e.completed="completed"}(d||(d={}));const Y={action:"advance",historyChanged:!1,visitCachedSnapshot:()=>{},willRender:!0};var K,z;!function(e){e[e.networkFailure=0]="networkFailure",e[e.timeoutFailure=-1]="timeoutFailure",e[e.contentTypeMismatch=-2]="contentTypeMismatch"}(K||(K={}));class G{constructor(e,t,n,i={}){this.identifier=x(),this.timingMetrics={},this.followedRedirect=!1,this.historyChanged=!1,this.scrolled=!1,this.snapshotCached=!1,this.state=d.initialized,this.delegate=e,this.location=t,this.restorationIdentifier=n||x();const{action:r,historyChanged:s,referrer:o,snapshotHTML:a,response:c,visitCachedSnapshot:l,willRender:u}=Object.assign(Object.assign({},Y),i);this.action=r,this.historyChanged=s,this.referrer=o,this.snapshotHTML=a,this.response=c,this.isSamePage=this.delegate.locationWithActionIsSamePage(this.location,this.action),this.visitCachedSnapshot=l,this.willRender=u,this.scrolled=!u}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)}get silent(){return this.isSamePage}start(){this.state==d.initialized&&(this.recordTimingMetric(l.visitStart),this.state=d.started,this.adapter.visitStarted(this),this.delegate.visitStarted(this))}cancel(){this.state==d.started&&(this.request&&this.request.cancel(),this.cancelRender(),this.state=d.canceled)}complete(){this.state==d.started&&(this.recordTimingMetric(l.visitEnd),this.state=d.completed,this.adapter.visitCompleted(this),this.delegate.visitCompleted(this),this.followRedirect())}fail(){this.state==d.started&&(this.state=d.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 A(this,o.get,this.location),this.request.perform())}simulateRequest(){this.response&&(this.startRequest(),this.recordResponse(),this.finishRequest())}startRequest(){this.recordTimingMetric(l.requestStart),this.adapter.visitRequestStarted(this)}recordResponse(e=this.response){if(this.response=e,e){const{statusCode:t}=e;J(t)?this.adapter.visitRequestCompleted(this):this.adapter.visitRequestFailedWithStatusCode(this,t)}}finishRequest(){this.recordTimingMetric(l.requestEnd),this.adapter.visitRequestFinished(this)}loadResponse(){if(this.response){const{statusCode:e,responseHTML:t}=this.response;this.render(async()=>{this.cacheSnapshot(),this.view.renderPromise&&await this.view.renderPromise,J(e)&&null!=t?(await this.view.renderPage(U.fromHTMLString(t),!1,this.willRender),this.adapter.visitRendered(this),this.complete()):(await this.view.renderError(U.fromHTMLString(t)),this.adapter.visitRendered(this),this.fail())})}}getCachedSnapshot(){const e=this.view.getCachedSnapshotForLocation(this.location)||this.getPreloadedSnapshot();if(e&&(!m(this.location)||e.hasAnchor(m(this.location)))&&("restore"==this.action||e.isPreviewable))return e}getPreloadedSnapshot(){if(this.snapshotHTML)return U.fromHTMLString(this.snapshotHTML)}hasCachedSnapshot(){return null!=this.getCachedSnapshot()}loadCachedSnapshot(){const e=this.getCachedSnapshot();if(e){const t=this.shouldIssueRequest();this.render(async()=>{this.cacheSnapshot(),this.isSamePage?this.adapter.visitRendered(this):(this.view.renderPromise&&await this.view.renderPromise,await this.view.renderPage(e,t,this.willRender),this.adapter.visitRendered(this),t||this.complete())})}}followRedirect(){var e;this.redirectedToLocation&&!this.followedRedirect&&(null===(e=this.response)||void 0===e?void 0:e.redirected)&&(this.adapter.visitProposedToLocation(this.redirectedToLocation,{action:"replace",response:this.response}),this.followedRedirect=!0)}goToSamePageAnchor(){this.isSamePage&&this.render(async()=>{this.cacheSnapshot(),this.adapter.visitRendered(this)})}requestStarted(){this.startRequest()}requestPreventedHandlingResponse(e,t){}async requestSucceededWithResponse(e,t){const n=await t.responseHTML,{redirected:i,statusCode:r}=t;null==n?this.recordResponse({statusCode:K.contentTypeMismatch,redirected:i}):(this.redirectedToLocation=t.redirected?t.location:void 0,this.recordResponse({statusCode:r,responseHTML:n,redirected:i}))}async requestFailedWithResponse(e,t){const n=await t.responseHTML,{redirected:i,statusCode:r}=t;null==n?this.recordResponse({statusCode:K.contentTypeMismatch,redirected:i}):this.recordResponse({statusCode:r,responseHTML:n,redirected:i})}requestErrored(e,t){this.recordResponse({statusCode:K.networkFailure,redirected:!1})}requestFinished(){this.finishRequest()}performScroll(){this.scrolled||("restore"==this.action?this.scrollToRestoredPosition()||this.scrollToAnchor()||this.view.scrollToTop():this.scrollToAnchor()||this.view.scrollToTop(),this.isSamePage&&this.delegate.visitScrolledToSamePageLocation(this.view.lastRenderedLocation,this.location),this.scrolled=!0)}scrollToRestoredPosition(){const{scrollPosition:e}=this.restorationData;if(e)return this.view.scrollToPosition(e),!0}scrollToAnchor(){const e=m(this.location);if(null!=e)return this.view.scrollToAnchor(e),!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!this.isSamePage&&("restore"==this.action?!this.hasCachedSnapshot():this.willRender)}cacheSnapshot(){this.snapshotCached||(this.view.cacheSnapshot().then(e=>e&&this.visitCachedSnapshot(e)),this.snapshotCached=!0)}async render(e){this.cancelRender(),await new Promise(e=>{this.frame=requestAnimationFrame(()=>e())}),await e(),delete this.frame,this.performScroll()}cancelRender(){this.frame&&(cancelAnimationFrame(this.frame),delete this.frame)}}function J(e){return e>=200&&e<300}class X{constructor(e){this.progressBar=new q,this.showProgressBar=()=>{this.progressBar.show()},this.session=e}visitProposedToLocation(e,t){this.navigator.startVisit(e,x(),t)}visitStarted(e){e.loadCachedSnapshot(),e.issueRequest(),e.changeHistory(),e.goToSamePageAnchor()}visitRequestStarted(e){this.progressBar.setValue(0),e.hasCachedSnapshot()||"restore"!=e.action?this.showVisitProgressBarAfterDelay():this.showProgressBar()}visitRequestCompleted(e){e.loadResponse()}visitRequestFailedWithStatusCode(e,t){switch(t){case K.networkFailure:case K.timeoutFailure:case K.contentTypeMismatch:return this.reload();default:return e.loadResponse()}}visitRequestFinished(e){this.progressBar.setValue(1),this.hideVisitProgressBar()}visitCompleted(e){}pageInvalidated(){this.reload()}visitFailed(e){}visitRendered(e){}formSubmissionStarted(e){this.progressBar.setValue(0),this.showFormProgressBarAfterDelay()}formSubmissionFinished(e){this.progressBar.setValue(1),this.hideFormProgressBar()}showVisitProgressBarAfterDelay(){this.visitProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay)}hideVisitProgressBar(){this.progressBar.hide(),null!=this.visitProgressBarTimeout&&(window.clearTimeout(this.visitProgressBarTimeout),delete this.visitProgressBarTimeout)}showFormProgressBarAfterDelay(){null==this.formProgressBarTimeout&&(this.formProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay))}hideFormProgressBar(){this.progressBar.hide(),null!=this.formProgressBarTimeout&&(window.clearTimeout(this.formProgressBarTimeout),delete this.formProgressBarTimeout)}reload(){window.location.reload()}get navigator(){return this.session.navigator}}class Z{constructor(){this.started=!1}start(){this.started||(this.started=!0,addEventListener("turbo:before-cache",this.removeStaleElements,!1))}stop(){this.started&&(this.started=!1,removeEventListener("turbo:before-cache",this.removeStaleElements,!1))}removeStaleElements(){const e=[...document.querySelectorAll('[data-turbo-cache="false"]')];for(const t of e)t.remove()}}class Q{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;if(t){"dialog"!=((null==n?void 0:n.getAttribute("formmethod"))||t.getAttribute("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 ee{constructor(e){this.element=e,this.linkInterceptor=new j(this,e),this.formInterceptor=new F(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.delegate.linkClickIntercepted(e,t)}shouldInterceptFormSubmission(e,t){return this.shouldSubmit(e,t)}formSubmissionIntercepted(e,t){const n=this.findFrameElement(e,t);n&&(n.removeAttribute("reloadable"),n.delegate.formSubmissionIntercepted(e,t))}shouldSubmit(e,t){var n;const i=f(e,t),r=this.element.ownerDocument.querySelector('meta[name="turbo-root"]'),s=h(null!==(n=null==r?void 0:r.content)&&void 0!==n?n:"/");return this.shouldRedirect(e,t)&&v(i,s)}shouldRedirect(e,t){const n=this.findFrameElement(e,t);return!!n&&n!=e.closest("turbo-frame")}findFrameElement(e,t){const n=(null==t?void 0:t.getAttribute("data-turbo-frame"))||e.getAttribute("data-turbo-frame");if(n&&"_top"!=n){const e=this.element.querySelector(`#${n}:not([disabled])`);if(e instanceof u)return e}}}class te{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 i={turbo:{restorationIdentifier:n}};e.call(history,i,"",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 ne{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=e.composedPath&&e.composedPath()[0]||e.target,n=this.findLinkFromClickTarget(t);if(n){const t=this.getLocationForLink(n);this.delegate.willFollowLinkToLocation(n,t)&&(e.preventDefault(),this.delegate.followedLinkToLocation(n,t))}}},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 h(e.getAttribute("href")||"")}}function ie(e){return"advance"==e||"replace"==e||"restore"==e}class re{constructor(e){this.delegate=e}proposeVisit(e,t={}){this.delegate.allowsVisitingLocationWithAction(e,t.action)&&(v(e,this.view.snapshot.rootLocation)?this.delegate.visitProposedToLocation(e,t):window.location.href=e.toString())}startVisit(e,t,n={}){this.stop(),this.currentVisit=new G(this,h(e),t,Object.assign({referrer:this.location},n)),this.currentVisit.start()}submitForm(e,t){this.stop(),this.formSubmission=new M(this,e,t,!0),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){"function"==typeof this.adapter.formSubmissionStarted&&this.adapter.formSubmissionStarted(e)}async formSubmissionSucceededWithResponse(e,t){if(e==this.formSubmission){const n=await t.responseHTML;if(n){e.method!=o.get&&this.view.clearSnapshotCache();const{statusCode:i,redirected:r}=t,s={action:this.getActionForFormSubmission(e),response:{statusCode:i,responseHTML:n,redirected:r}};this.proposeVisit(t.location,s)}}}async formSubmissionFailedWithResponse(e,t){const n=await t.responseHTML;if(n){const e=U.fromHTMLString(n);t.serverError?await this.view.renderError(e):await this.view.renderPage(e),this.view.scrollToTop(),this.view.clearSnapshotCache()}}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished(e){"function"==typeof this.adapter.formSubmissionFinished&&this.adapter.formSubmissionFinished(e)}visitStarted(e){this.delegate.visitStarted(e)}visitCompleted(e){this.delegate.visitCompleted(e)}locationWithActionIsSamePage(e,t){const n=m(e),i=m(this.view.lastRenderedLocation),r="restore"===t&&void 0===n;return"replace"!==t&&b(e)===b(this.view.lastRenderedLocation)&&(r||null!=n&&n!==i)}visitScrolledToSamePageLocation(e,t){this.delegate.visitScrolledToSamePageLocation(e,t)}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}getActionForFormSubmission(e){const{formElement:t,submitter:n}=e,i=T("data-turbo-action",n,t);return ie(i)?i:"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 se{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 oe{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 ae{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 w)return n}(e);t&&function(e){var t;return(null!==(t=e.contentType)&&void 0!==t?t:"").startsWith(I.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 I(e))}}class ce extends H{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 le extends H{get shouldRender(){return this.newSnapshot.isVisitable&&this.trackedElementsAreIdentical}prepareToRender(){this.mergeHead()}async render(){this.willRender&&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 de{constructor(e){this.keys=[],this.snapshots={},this.size=e}has(e){return y(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[y(e)]}write(e,t){this.snapshots[y(e)]=t}touch(e){const t=y(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 ue extends R{constructor(){super(...arguments),this.snapshotCache=new de(10),this.lastRenderedLocation=new URL(location.href)}renderPage(e,t=!1,n=!0){const i=new le(this.snapshot,e,t,n);return this.render(i)}renderError(e){const t=new ce(this.snapshot,e,!1);return 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));const n=e.clone();return this.snapshotCache.put(t,n),n}}getCachedSnapshotForLocation(e){return this.snapshotCache.get(e)}get snapshot(){return U.fromElement(this.element)}get shouldCacheSnapshot(){return this.snapshot.isCacheable}}function he(e){Object.defineProperties(e,me)}const me={absoluteURL:{get(){return this.toString()}}},fe=new class{constructor(){this.navigator=new re(this),this.history=new te(this),this.view=new ue(this,document.documentElement),this.adapter=new X(this),this.pageObserver=new se(this),this.cacheObserver=new Z,this.linkClickObserver=new ne(this),this.formSubmitObserver=new Q(this),this.scrollObserver=new oe(this),this.streamObserver=new ae(this),this.frameRedirector=new ee(document.documentElement),this.drive=!0,this.enabled=!0,this.progressBarDelay=500,this.started=!1}start(){this.started||(this.pageObserver.start(),this.cacheObserver.start(),this.linkClickObserver.start(),this.formSubmitObserver.start(),this.scrollObserver.start(),this.streamObserver.start(),this.frameRedirector.start(),this.history.start(),this.started=!0,this.enabled=!0)}disable(){this.enabled=!1}stop(){this.started&&(this.pageObserver.stop(),this.cacheObserver.stop(),this.linkClickObserver.stop(),this.formSubmitObserver.stop(),this.scrollObserver.stop(),this.streamObserver.stop(),this.frameRedirector.stop(),this.history.stop(),this.started=!1)}registerAdapter(e){this.adapter=e}visit(e,t={}){this.navigator.proposeVisit(h(e),t)}connectStreamSource(e){this.streamObserver.connectStreamSource(e)}disconnectStreamSource(e){this.streamObserver.disconnectStreamSource(e)}renderStreamMessage(e){document.documentElement.appendChild(I.wrap(e).fragment)}clearCache(){this.view.clearSnapshotCache()}setProgressBarDelay(e){this.progressBarDelay=e}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}historyPoppedToLocationWithRestorationIdentifier(e,t){this.enabled?this.navigator.startVisit(e,t,{action:"restore",historyChanged:!0}):this.adapter.pageInvalidated()}scrollPositionChanged(e){this.history.updateRestorationData({scrollPosition:e})}willFollowLinkToLocation(e,t){return this.elementDriveEnabled(e)&&v(t,this.snapshot.rootLocation)&&this.applicationAllowsFollowingLinkToLocation(e,t)}followedLinkToLocation(e,t){const n=this.getActionForLink(e);this.convertLinkWithMethodClickToFormSubmission(e)||this.visit(t.href,{action:n})}convertLinkWithMethodClickToFormSubmission(e){const t=e.getAttribute("data-turbo-method");if(t){const n=document.createElement("form");n.method=t,n.action=e.getAttribute("href")||"undefined",n.hidden=!0,e.hasAttribute("data-turbo-confirm")&&n.setAttribute("data-turbo-confirm",e.getAttribute("data-turbo-confirm"));const i=this.getTargetFrameForLink(e);return i?(n.setAttribute("data-turbo-frame",i),n.addEventListener("turbo:submit-start",()=>n.remove())):n.addEventListener("submit",()=>n.remove()),document.body.appendChild(n),E("submit",{cancelable:!0,target:n})}return!1}allowsVisitingLocationWithAction(e,t){return this.locationWithActionIsSamePage(e,t)||this.applicationAllowsVisitingLocation(e)}visitProposedToLocation(e,t){he(e),this.adapter.visitProposedToLocation(e,t)}visitStarted(e){he(e.location),e.silent||this.notifyApplicationAfterVisitingLocation(e.location,e.action)}visitCompleted(e){this.notifyApplicationAfterPageLoad(e.getTimingMetrics())}locationWithActionIsSamePage(e,t){return this.navigator.locationWithActionIsSamePage(e,t)}visitScrolledToSamePageLocation(e,t){this.notifyApplicationAfterVisitingSamePageLocation(e,t)}willSubmitForm(e,t){const n=f(e,t);return this.elementDriveEnabled(e)&&(!t||this.elementDriveEnabled(t))&&v(h(n),this.snapshot.rootLocation)}formSubmitted(e,t){this.navigator.submitForm(e,t)}pageBecameInteractive(){this.view.lastRenderedLocation=this.location,this.notifyApplicationAfterPageLoad()}pageLoaded(){this.history.assumeControlOfScrollRestoration()}pageWillUnload(){this.history.relinquishControlOfScrollRestoration()}receivedMessageFromStream(e){this.renderStreamMessage(e)}viewWillCacheSnapshot(){var e;(null===(e=this.navigator.currentVisit)||void 0===e?void 0:e.silent)||this.notifyApplicationBeforeCachingSnapshot()}allowsImmediateRender({element:e},t){return!this.notifyApplicationBeforeRender(e,t).defaultPrevented}viewRenderedSnapshot(e,t){this.view.lastRenderedLocation=this.history.location,this.notifyApplicationAfterRender()}viewInvalidated(){this.adapter.pageInvalidated()}frameLoaded(e){this.notifyApplicationAfterFrameLoad(e)}frameRendered(e,t){this.notifyApplicationAfterFrameRender(e,t)}applicationAllowsFollowingLinkToLocation(e,t){return!this.notifyApplicationAfterClickingLinkToLocation(e,t).defaultPrevented}applicationAllowsVisitingLocation(e){return!this.notifyApplicationBeforeVisitingLocation(e).defaultPrevented}notifyApplicationAfterClickingLinkToLocation(e,t){return E("turbo:click",{target:e,detail:{url:t.href},cancelable:!0})}notifyApplicationBeforeVisitingLocation(e){return E("turbo:before-visit",{detail:{url:e.href},cancelable:!0})}notifyApplicationAfterVisitingLocation(e,t){return D(document.documentElement),E("turbo:visit",{detail:{url:e.href,action:t}})}notifyApplicationBeforeCachingSnapshot(){return E("turbo:before-cache")}notifyApplicationBeforeRender(e,t){return E("turbo:before-render",{detail:{newBody:e,resume:t},cancelable:!0})}notifyApplicationAfterRender(){return E("turbo:render")}notifyApplicationAfterPageLoad(e={}){return L(document.documentElement),E("turbo:load",{detail:{url:this.location.href,timing:e}})}notifyApplicationAfterVisitingSamePageLocation(e,t){dispatchEvent(new HashChangeEvent("hashchange",{oldURL:e.toString(),newURL:t.toString()}))}notifyApplicationAfterFrameLoad(e){return E("turbo:frame-load",{target:e})}notifyApplicationAfterFrameRender(e,t){return E("turbo:frame-render",{detail:{fetchResponse:e},target:t,cancelable:!0})}elementDriveEnabled(e){const t=null==e?void 0:e.closest("[data-turbo]");return this.drive?!t||"false"!=t.getAttribute("data-turbo"):!!t&&"true"==t.getAttribute("data-turbo")}getActionForLink(e){const t=e.getAttribute("data-turbo-action");return ie(t)?t:"advance"}getTargetFrameForLink(e){const t=e.getAttribute("data-turbo-frame");if(t)return t;{const t=e.closest("turbo-frame");if(t)return t.id}}get snapshot(){return this.view.snapshot}},{navigator:pe}=fe;function ge(){fe.start()}function ve(e,t){fe.visit(e,t)}var be=Object.freeze({__proto__:null,navigator:pe,session:fe,PageRenderer:le,PageSnapshot:U,start:ge,registerAdapter:function(e){fe.registerAdapter(e)},visit:ve,connectStreamSource:function(e){fe.connectStreamSource(e)},disconnectStreamSource:function(e){fe.disconnectStreamSource(e)},renderStreamMessage:function(e){fe.renderStreamMessage(e)},clearCache:function(){fe.clearCache()},setProgressBarDelay:function(e){fe.setProgressBarDelay(e)},setConfirmMethod:function(e){M.confirmMethod=e}});class ye{constructor(e){this.visitCachedSnapshot=({element:e})=>{var t;const{id:n,clone:i}=this;null===(t=e.querySelector("#"+n))||void 0===t||t.replaceWith(i)},this.clone=e.cloneNode(!0),this.id=e.id}}function we(e){if(null!=e){const t=document.getElementById(e);if(t instanceof u)return t}}function Ee(e,t){if(e){const i=e.getAttribute("src");if(null!=i&&null!=t&&(n=t,h(i).href==h(n).href))throw new Error(`Matching <turbo-frame id="${e.id}"> element has a source URL which references itself`);if(e.ownerDocument!==document&&(e=document.importNode(e,!0)),e instanceof u)return e.connectedCallback(),e.disconnectedCallback(),e}var n}const Se={after(){this.targetElements.forEach(e=>{var t;return null===(t=e.parentElement)||void 0===t?void 0:t.insertBefore(this.templateContent,e.nextSibling)})},append(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(e=>e.append(this.templateContent))},before(){this.targetElements.forEach(e=>{var t;return null===(t=e.parentElement)||void 0===t?void 0:t.insertBefore(this.templateContent,e)})},prepend(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(e=>e.prepend(this.templateContent))},remove(){this.targetElements.forEach(e=>e.remove())},replace(){this.targetElements.forEach(e=>e.replaceWith(this.templateContent))},update(){this.targetElements.forEach(e=>{e.innerHTML="",e.append(this.templateContent)})}};class _e 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 S(),this.performAction())})()}disconnect(){try{this.remove()}catch(e){}}removeDuplicateTargetChildren(){this.duplicateChildren.forEach(e=>e.remove())}get duplicateChildren(){var e;const t=this.targetElements.flatMap(e=>[...e.children]).filter(e=>!!e.id),n=[...null===(e=this.templateContent)||void 0===e?void 0:e.children].filter(e=>!!e.id).map(e=>e.id);return t.filter(e=>n.includes(e.id))}get performAction(){if(this.action){const e=Se[this.action];if(e)return e;this.raise("unknown action")}this.raise("action attribute is missing")}get targetElements(){return this.target?this.targetElementsById:this.targets?this.targetElementsByQuery:void this.raise("target or targets attribute is missing")}get templateContent(){return this.templateElement.content.cloneNode(!0)}get templateElement(){if(this.firstElementChild instanceof HTMLTemplateElement)return this.firstElementChild;this.raise("first child element must be a <template> element")}get action(){return this.getAttribute("action")}get target(){return this.getAttribute("target")}get targets(){return this.getAttribute("targets")}raise(e){throw new Error(`${this.description}: ${e}`)}get description(){var e,t;return null!==(t=(null!==(e=this.outerHTML.match(/<[^>]+>/))&&void 0!==e?e:[])[0])&&void 0!==t?t:"<turbo-stream>"}get beforeRenderEvent(){return new CustomEvent("turbo:before-stream-render",{bubbles:!0,cancelable:!0})}get targetElementsById(){var e;const t=null===(e=this.ownerDocument)||void 0===e?void 0:e.getElementById(this.target);return null!==t?[t]:[]}get targetElementsByQuery(){var e;const t=null===(e=this.ownerDocument)||void 0===e?void 0:e.querySelectorAll(this.targets);return 0!==t.length?Array.prototype.slice.call(t):[]}}u.delegateConstructor=class{constructor(e){this.fetchResponseLoaded=e=>{},this.currentFetchRequest=null,this.resolveVisitPromise=()=>{},this.connected=!1,this.hasBeenLoaded=!1,this.settingSourceURL=!1,this.element=e,this.view=new N(this,this.element),this.appearanceObserver=new O(this,this.element),this.linkInterceptor=new j(this,this.element),this.formInterceptor=new F(this,this.element)}connect(){this.connected||(this.connected=!0,this.reloadable=!1,this.loadingStyle==s.lazy&&this.appearanceObserver.start(),this.linkInterceptor.start(),this.formInterceptor.start(),this.sourceURLChanged())}disconnect(){this.connected&&(this.connected=!1,this.appearanceObserver.stop(),this.linkInterceptor.stop(),this.formInterceptor.stop())}disabledChanged(){this.loadingStyle==s.eager&&this.loadSourceURL()}sourceURLChanged(){(this.loadingStyle==s.eager||this.hasBeenLoaded)&&this.loadSourceURL()}loadingStyleChanged(){this.loadingStyle==s.lazy?this.appearanceObserver.start():(this.appearanceObserver.stop(),this.loadSourceURL())}async loadSourceURL(){if(!this.settingSourceURL&&this.enabled&&this.isActive&&(this.reloadable||this.sourceURL!=this.currentURL)){const e=this.currentURL;if(this.currentURL=this.sourceURL,this.sourceURL)try{this.element.loaded=this.visit(h(this.sourceURL)),this.appearanceObserver.stop(),await this.element.loaded,this.hasBeenLoaded=!0}catch(t){throw this.currentURL=e,t}}}async loadResponse(e){(e.redirected||e.succeeded&&e.isHTML)&&(this.sourceURL=e.response.url);try{const t=await e.responseHTML;if(t){const{body:n}=_(t),i=new P(await this.extractForeignFrameElement(n)),r=new B(this.view.snapshot,i,!1,!1);this.view.renderPromise&&await this.view.renderPromise,await this.view.render(r),fe.frameRendered(e,this.element),fe.frameLoaded(this.element),this.fetchResponseLoaded(e)}}catch(e){console.error(e),this.view.invalidate()}finally{this.fetchResponseLoaded=()=>{}}}elementAppearedInViewport(e){this.loadSourceURL()}shouldInterceptLinkClick(e,t){return!e.hasAttribute("data-turbo-method")&&this.shouldInterceptNavigation(e)}linkClickIntercepted(e,t){this.reloadable=!0,this.navigateFrame(e,t)}shouldInterceptFormSubmission(e,t){return this.shouldInterceptNavigation(e,t)}formSubmissionIntercepted(e,t){this.formSubmission&&this.formSubmission.stop(),this.reloadable=!1,this.formSubmission=new M(this,e,t);const{fetchRequest:n}=this.formSubmission;this.prepareHeadersForRequest(n.headers,n),this.formSubmission.start()}prepareHeadersForRequest(e,t){e["Turbo-Frame"]=this.id}requestStarted(e){D(this.element)}requestPreventedHandlingResponse(e,t){this.resolveVisitPromise()}async requestSucceededWithResponse(e,t){await this.loadResponse(t),this.resolveVisitPromise()}requestFailedWithResponse(e,t){console.error(t),this.resolveVisitPromise()}requestErrored(e,t){console.error(t),this.resolveVisitPromise()}requestFinished(e){L(this.element)}formSubmissionStarted({formElement:e}){D(e,this.findFrameElement(e))}formSubmissionSucceededWithResponse(e,t){const n=this.findFrameElement(e.formElement,e.submitter);this.proposeVisitIfNavigatedWithAction(n,e.formElement,e.submitter),n.delegate.loadResponse(t)}formSubmissionFailedWithResponse(e,t){this.element.delegate.loadResponse(t)}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished({formElement:e}){L(e,this.findFrameElement(e))}allowsImmediateRender(e,t){return!0}viewRenderedSnapshot(e,t){}viewInvalidated(){}async visit(e){var t;const n=new A(this,o.get,e,new URLSearchParams,this.element);return null===(t=this.currentFetchRequest)||void 0===t||t.cancel(),this.currentFetchRequest=n,new Promise(e=>{this.resolveVisitPromise=()=>{this.resolveVisitPromise=()=>{},this.currentFetchRequest=null,e()},n.perform()})}navigateFrame(e,t,n){const i=this.findFrameElement(e,n);this.proposeVisitIfNavigatedWithAction(i,e,n),i.setAttribute("reloadable",""),i.src=t}proposeVisitIfNavigatedWithAction(e,t,n){const i=T("data-turbo-action",n,t,e);if(ie(i)){const{visitCachedSnapshot:t}=new ye(e);e.delegate.fetchResponseLoaded=n=>{if(e.src){const{statusCode:r,redirected:s}=n,o={statusCode:r,redirected:s,responseHTML:e.ownerDocument.documentElement.outerHTML};fe.visit(e.src,{action:i,response:o,visitCachedSnapshot:t,willRender:!1})}}}}findFrameElement(e,t){var n;return null!==(n=we(T("data-turbo-frame",t,e)||this.element.getAttribute("target")))&&void 0!==n?n:this.element}async extractForeignFrameElement(e){let t;const n=CSS.escape(this.id);try{if(t=Ee(e.querySelector("turbo-frame#"+n),this.currentURL))return t;if(t=Ee(e.querySelector(`turbo-frame[src][recurse~=${n}]`),this.currentURL))return await t.loaded,await this.extractForeignFrameElement(t);console.error(`Response has no matching <turbo-frame id="${n}"> element`)}catch(e){console.error(e)}return new u}formActionIsVisitable(e,t){return v(h(f(e,t)),this.rootLocation)}shouldInterceptNavigation(e,t){const n=T("data-turbo-frame",t,e)||this.element.getAttribute("target");if(e instanceof HTMLFormElement&&!this.formActionIsVisitable(e,t))return!1;if(!this.enabled||"_top"==n)return!1;if(n){const e=we(n);if(e)return!e.disabled}return!!fe.elementDriveEnabled(e)&&!(t&&!fe.elementDriveEnabled(t))}get id(){return this.element.id}get enabled(){return!this.element.disabled}get sourceURL(){if(this.element.src)return this.element.src}get reloadable(){return this.findFrameElement(this.element).hasAttribute("reloadable")}set reloadable(e){const t=this.findFrameElement(this.element);e?t.setAttribute("reloadable",""):t.removeAttribute("reloadable")}set sourceURL(e){this.settingSourceURL=!0,this.element.src=null!=e?e:null,this.currentURL=this.element.src,this.settingSourceURL=!1}get loadingStyle(){return this.element.loading}get isLoading(){return void 0!==this.formSubmission||void 0!==this.resolveVisitPromise()}get isActive(){return this.element.isActive&&this.connected}get rootLocation(){var e;const t=this.element.ownerDocument.querySelector('meta[name="turbo-root"]');return h(null!==(e=null==t?void 0:t.content)&&void 0!==e?e:"/")}},customElements.define("turbo-frame",u),customElements.define("turbo-stream",_e),(()=>{let e=document.currentScript;if(e&&!e.hasAttribute("data-turbo-suppress-warning"))for(;e=e.parentElement;)if(e==document.body)return console.warn(C`
You are loading Turbo from a <script> element inside the <body> element. This is probably not what you meant to do!
Load your applications JavaScript bundle inside the <head> element instead. <script> elements in <body> are evaluated with each page change.
For more information, see: https://turbo.hotwired.dev/handbook/building#working-with-script-elements
——
Suppress this warning by adding a "data-turbo-suppress-warning" attribute to: %s
`,e.outerHTML)})(),window.Turbo=be,ge()},function(e,t,n){e.exports=function(){"use strict";var e=function(){return(e=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},t=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],n={_disable:[],_enable:[],allowInput:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enable:[],enableSeconds:!1,enableTime:!1,errorHandler:function(e){return"undefined"!=typeof console&&console.warn(e)},getWeek:function(e){var t=new Date(e.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var n=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-n.getTime())/864e5-3+(n.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},i={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var t=e%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},r=function(e){return("0"+e).slice(-2)},s=function(e){return!0===e?1:0};function o(e,t,n){var i;return void 0===n&&(n=!1),function(){var r=this,s=arguments;null!==i&&clearTimeout(i),i=window.setTimeout((function(){i=null,n||e.apply(r,s)}),t),n&&!i&&e.apply(r,s)}}var a=function(e){return e instanceof Array?e:[e]};function c(e,t,n){if(!0===n)return e.classList.add(t);e.classList.remove(t)}function l(e,t,n){var i=window.document.createElement(e);return t=t||"",n=n||"",i.className=t,void 0!==n&&(i.textContent=n),i}function d(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function u(e,t){var n=l("div","numInputWrapper"),i=l("input","numInput "+e),r=l("span","arrowUp"),s=l("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?i.type="number":(i.type="text",i.pattern="\\d*"),void 0!==t)for(var o in t)i.setAttribute(o,t[o]);return n.appendChild(i),n.appendChild(r),n.appendChild(s),n}var h=function(){},m=function(e,t,n){return n.months[t?"shorthand":"longhand"][e]},f={D:h,F:function(e,t,n){e.setMonth(n.months.longhand.indexOf(t))},G:function(e,t){e.setHours(parseFloat(t))},H:function(e,t){e.setHours(parseFloat(t))},J:function(e,t){e.setDate(parseFloat(t))},K:function(e,t,n){e.setHours(e.getHours()%12+12*s(new RegExp(n.amPM[1],"i").test(t)))},M:function(e,t,n){e.setMonth(n.months.shorthand.indexOf(t))},S:function(e,t){e.setSeconds(parseFloat(t))},U:function(e,t){return new Date(1e3*parseFloat(t))},W:function(e,t,n){var i=parseInt(t),r=new Date(e.getFullYear(),0,2+7*(i-1),0,0,0,0);return r.setDate(r.getDate()-r.getDay()+n.firstDayOfWeek),r},Y:function(e,t){e.setFullYear(parseFloat(t))},Z:function(e,t){return new Date(t)},d:function(e,t){e.setDate(parseFloat(t))},h:function(e,t){e.setHours(parseFloat(t))},i:function(e,t){e.setMinutes(parseFloat(t))},j:function(e,t){e.setDate(parseFloat(t))},l:h,m:function(e,t){e.setMonth(parseFloat(t)-1)},n:function(e,t){e.setMonth(parseFloat(t)-1)},s:function(e,t){e.setSeconds(parseFloat(t))},u:function(e,t){return new Date(parseFloat(t))},w:h,y:function(e,t){e.setFullYear(2e3+parseFloat(t))}},p={D:"(\\w+)",F:"(\\w+)",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"(\\w+)",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"(\\w+)",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},g={Z:function(e){return e.toISOString()},D:function(e,t,n){return t.weekdays.shorthand[g.w(e,t,n)]},F:function(e,t,n){return m(g.n(e,t,n)-1,!1,t)},G:function(e,t,n){return r(g.h(e,t,n))},H:function(e){return r(e.getHours())},J:function(e,t){return void 0!==t.ordinal?e.getDate()+t.ordinal(e.getDate()):e.getDate()},K:function(e,t){return t.amPM[s(e.getHours()>11)]},M:function(e,t){return m(e.getMonth(),!0,t)},S:function(e){return r(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,n){return n.getWeek(e)},Y:function(e){return e.getFullYear()},d:function(e){return r(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return r(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(e){return r(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},v=function(e){var t=e.config,r=void 0===t?n:t,s=e.l10n,o=void 0===s?i:s;return function(e,t,n){var i=n||o;return void 0!==r.formatDate?r.formatDate(e,t,i):t.split("").map((function(t,n,s){return g[t]&&"\\"!==s[n-1]?g[t](e,i,r):"\\"!==t?t:""})).join("")}},b=function(e){var t=e.config,r=void 0===t?n:t,s=e.l10n,o=void 0===s?i:s;return function(e,t,i,s){if(0===e||e){var a,c=s||o,l=e;if(e instanceof Date)a=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)a=new Date(e);else if("string"==typeof e){var d=t||(r||n).dateFormat,u=String(e).trim();if("today"===u)a=new Date,i=!0;else if(/Z$/.test(u)||/GMT$/.test(u))a=new Date(e);else if(r&&r.parseDate)a=r.parseDate(e,d);else{a=r&&r.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0);for(var h=void 0,m=[],g=0,v=0,b="";g<d.length;g++){var y=d[g],w="\\"===y,E="\\"===d[g-1]||w;if(p[y]&&!E){b+=p[y];var S=new RegExp(b).exec(e);S&&(h=!0)&&m["Y"!==y?"push":"unshift"]({fn:f[y],val:S[++v]})}else w||(b+=".");m.forEach((function(e){var t=e.fn,n=e.val;return a=t(a,n,c)||a}))}a=h?a:void 0}}if(a instanceof Date&&!isNaN(a.getTime()))return!0===i&&a.setHours(0,0,0,0),a;r.errorHandler(new Error("Invalid date provided: "+l))}}};function y(e,t,n){return void 0===n&&(n=!0),!1!==n?new Date(e.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):e.getTime()-t.getTime()}var w=864e5;function E(h,f){var g={config:e({},n,_.defaultConfig),l10n:i};function E(e){return e.bind(g)}function S(){var e=g.config;!1===e.weekNumbers&&1===e.showMonths||!0!==e.noCalendar&&window.requestAnimationFrame((function(){if(void 0!==g.calendarContainer&&(g.calendarContainer.style.visibility="hidden",g.calendarContainer.style.display="block"),void 0!==g.daysContainer){var t=(g.days.offsetWidth+1)*e.showMonths;g.daysContainer.style.width=t+"px",g.calendarContainer.style.width=t+(void 0!==g.weekWrapper?g.weekWrapper.offsetWidth:0)+"px",g.calendarContainer.style.removeProperty("visibility"),g.calendarContainer.style.removeProperty("display")}}))}function C(e){0===g.selectedDates.length&&ne(),void 0!==e&&"blur"!==e.type&&function(e){e.preventDefault();var t="keydown"===e.type,n=e.target;void 0!==g.amPM&&e.target===g.amPM&&(g.amPM.textContent=g.l10n.amPM[s(g.amPM.textContent===g.l10n.amPM[0])]);var i=parseFloat(n.getAttribute("min")),o=parseFloat(n.getAttribute("max")),a=parseFloat(n.getAttribute("step")),c=parseInt(n.value,10),l=e.delta||(t?38===e.which?1:-1:0),d=c+a*l;if(void 0!==n.value&&2===n.value.length){var u=n===g.hourElement,h=n===g.minuteElement;d<i?(d=o+d+s(!u)+(s(u)&&s(!g.amPM)),h&&F(void 0,-1,g.hourElement)):d>o&&(d=n===g.hourElement?d-o-s(!g.amPM):i,h&&F(void 0,1,g.hourElement)),g.amPM&&u&&(1===a?d+c===23:Math.abs(d-c)>a)&&(g.amPM.textContent=g.l10n.amPM[s(g.amPM.textContent===g.l10n.amPM[0])]),n.value=r(d)}}(e);var t=g._input.value;x(),ve(),g._input.value!==t&&g._debouncedChange()}function x(){if(void 0!==g.hourElement&&void 0!==g.minuteElement){var e,t,n=(parseInt(g.hourElement.value.slice(-2),10)||0)%24,i=(parseInt(g.minuteElement.value,10)||0)%60,r=void 0!==g.secondElement?(parseInt(g.secondElement.value,10)||0)%60:0;void 0!==g.amPM&&(e=n,t=g.amPM.textContent,n=e%12+12*s(t===g.l10n.amPM[1]));var o=void 0!==g.config.minTime||g.config.minDate&&g.minDateHasTime&&g.latestSelectedDateObj&&0===y(g.latestSelectedDateObj,g.config.minDate,!0);if(void 0!==g.config.maxTime||g.config.maxDate&&g.maxDateHasTime&&g.latestSelectedDateObj&&0===y(g.latestSelectedDateObj,g.config.maxDate,!0)){var a=void 0!==g.config.maxTime?g.config.maxTime:g.config.maxDate;(n=Math.min(n,a.getHours()))===a.getHours()&&(i=Math.min(i,a.getMinutes())),i===a.getMinutes()&&(r=Math.min(r,a.getSeconds()))}if(o){var c=void 0!==g.config.minTime?g.config.minTime:g.config.minDate;(n=Math.max(n,c.getHours()))===c.getHours()&&(i=Math.max(i,c.getMinutes())),i===c.getMinutes()&&(r=Math.max(r,c.getSeconds()))}L(n,i,r)}}function T(e){var t=e||g.latestSelectedDateObj;t&&L(t.getHours(),t.getMinutes(),t.getSeconds())}function D(){var e=g.config.defaultHour,t=g.config.defaultMinute,n=g.config.defaultSeconds;if(void 0!==g.config.minDate){var i=g.config.minDate.getHours(),r=g.config.minDate.getMinutes();(e=Math.max(e,i))===i&&(t=Math.max(r,t)),e===i&&t===r&&(n=g.config.minDate.getSeconds())}if(void 0!==g.config.maxDate){var s=g.config.maxDate.getHours(),o=g.config.maxDate.getMinutes();(e=Math.min(e,s))===s&&(t=Math.min(o,t)),e===s&&t===o&&(n=g.config.maxDate.getSeconds())}L(e,t,n)}function L(e,t,n){void 0!==g.latestSelectedDateObj&&g.latestSelectedDateObj.setHours(e%24,t,n||0,0),g.hourElement&&g.minuteElement&&!g.isMobile&&(g.hourElement.value=r(g.config.time_24hr?e:(12+e)%12+12*s(e%12==0)),g.minuteElement.value=r(t),void 0!==g.amPM&&(g.amPM.textContent=g.l10n.amPM[s(e>=12)]),void 0!==g.secondElement&&(g.secondElement.value=r(n)))}function A(e){var t=parseInt(e.target.value)+(e.delta||0);(t/1e3>1||"Enter"===e.key&&!/[^\d]/.test(t.toString()))&&J(t)}function O(e,t,n,i){return t instanceof Array?t.forEach((function(t){return O(e,t,n,i)})):e instanceof Array?e.forEach((function(e){return O(e,t,n,i)})):(e.addEventListener(t,n,i),void g._handlers.push({element:e,event:t,handler:n,options:i}))}function I(e){return function(t){1===t.which&&e(t)}}function M(){he("onChange")}function k(e,t){var n=void 0!==e?g.parseDate(e):g.latestSelectedDateObj||(g.config.minDate&&g.config.minDate>g.now?g.config.minDate:g.config.maxDate&&g.config.maxDate<g.now?g.config.maxDate:g.now),i=g.currentYear,r=g.currentMonth;try{void 0!==n&&(g.currentYear=n.getFullYear(),g.currentMonth=n.getMonth())}catch(e){e.message="Invalid date supplied: "+n,g.config.errorHandler(e)}t&&g.currentYear!==i&&(he("onYearChange"),V()),!t||g.currentYear===i&&g.currentMonth===r||he("onMonthChange"),g.redraw()}function P(e){~e.target.className.indexOf("arrow")&&F(e,e.target.classList.contains("arrowUp")?1:-1)}function F(e,t,n){var i=e&&e.target,r=n||i&&i.parentNode&&i.parentNode.firstChild,s=me("increment");s.delta=t,r&&r.dispatchEvent(s)}function R(e,t,n,i){var r=X(t,!0),s=l("span","flatpickr-day "+e,t.getDate().toString());return s.dateObj=t,s.$i=i,s.setAttribute("aria-label",g.formatDate(t,g.config.ariaDateFormat)),-1===e.indexOf("hidden")&&0===y(t,g.now)&&(g.todayDateElem=s,s.classList.add("today"),s.setAttribute("aria-current","date")),r?(s.tabIndex=-1,fe(t)&&(s.classList.add("selected"),g.selectedDateElem=s,"range"===g.config.mode&&(c(s,"startRange",g.selectedDates[0]&&0===y(t,g.selectedDates[0],!0)),c(s,"endRange",g.selectedDates[1]&&0===y(t,g.selectedDates[1],!0)),"nextMonthDay"===e&&s.classList.add("inRange")))):s.classList.add("flatpickr-disabled"),"range"===g.config.mode&&function(e){return!("range"!==g.config.mode||g.selectedDates.length<2)&&y(e,g.selectedDates[0])>=0&&y(e,g.selectedDates[1])<=0}(t)&&!fe(t)&&s.classList.add("inRange"),g.weekNumbers&&1===g.config.showMonths&&"prevMonthDay"!==e&&n%7==1&&g.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+g.config.getWeek(t)+"</span>"),he("onDayCreate",s),s}function N(e){e.focus(),"range"===g.config.mode&&ee(e)}function j(e){for(var t=e>0?0:g.config.showMonths-1,n=e>0?g.config.showMonths:-1,i=t;i!=n;i+=e)for(var r=g.daysContainer.children[i],s=e>0?0:r.children.length-1,o=e>0?r.children.length:-1,a=s;a!=o;a+=e){var c=r.children[a];if(-1===c.className.indexOf("hidden")&&X(c.dateObj))return c}}function H(e,t){var n=Z(document.activeElement||document.body),i=void 0!==e?e:n?document.activeElement:void 0!==g.selectedDateElem&&Z(g.selectedDateElem)?g.selectedDateElem:void 0!==g.todayDateElem&&Z(g.todayDateElem)?g.todayDateElem:j(t>0?1:-1);return void 0===i?g._input.focus():n?void function(e,t){for(var n=-1===e.className.indexOf("Month")?e.dateObj.getMonth():g.currentMonth,i=t>0?g.config.showMonths:-1,r=t>0?1:-1,s=n-g.currentMonth;s!=i;s+=r)for(var o=g.daysContainer.children[s],a=n-g.currentMonth===s?e.$i+t:t<0?o.children.length-1:0,c=o.children.length,l=a;l>=0&&l<c&&l!=(t>0?c:-1);l+=r){var d=o.children[l];if(-1===d.className.indexOf("hidden")&&X(d.dateObj)&&Math.abs(e.$i-l)>=Math.abs(t))return N(d)}g.changeMonth(r),H(j(r),0)}(i,t):N(i)}function B(e,t){for(var n=(new Date(e,t,1).getDay()-g.l10n.firstDayOfWeek+7)%7,i=g.utils.getDaysInMonth((t-1+12)%12),r=g.utils.getDaysInMonth(t),s=window.document.createDocumentFragment(),o=g.config.showMonths>1,a=o?"prevMonthDay hidden":"prevMonthDay",c=o?"nextMonthDay hidden":"nextMonthDay",d=i+1-n,u=0;d<=i;d++,u++)s.appendChild(R(a,new Date(e,t-1,d),d,u));for(d=1;d<=r;d++,u++)s.appendChild(R("",new Date(e,t,d),d,u));for(var h=r+1;h<=42-n&&(1===g.config.showMonths||u%7!=0);h++,u++)s.appendChild(R(c,new Date(e,t+1,h%r),h,u));var m=l("div","dayContainer");return m.appendChild(s),m}function q(){if(void 0!==g.daysContainer){d(g.daysContainer),g.weekNumbers&&d(g.weekNumbers);for(var e=document.createDocumentFragment(),t=0;t<g.config.showMonths;t++){var n=new Date(g.currentYear,g.currentMonth,1);n.setMonth(g.currentMonth+t),e.appendChild(B(n.getFullYear(),n.getMonth()))}g.daysContainer.appendChild(e),g.days=g.daysContainer.firstChild,"range"===g.config.mode&&1===g.selectedDates.length&&ee()}}function V(){if(!(g.config.showMonths>1||"dropdown"!==g.config.monthSelectorType)){var e=function(e){return!(void 0!==g.config.minDate&&g.currentYear===g.config.minDate.getFullYear()&&e<g.config.minDate.getMonth()||void 0!==g.config.maxDate&&g.currentYear===g.config.maxDate.getFullYear()&&e>g.config.maxDate.getMonth())};g.monthsDropdownContainer.tabIndex=-1,g.monthsDropdownContainer.innerHTML="";for(var t=0;t<12;t++)if(e(t)){var n=l("option","flatpickr-monthDropdown-month");n.value=new Date(g.currentYear,t).getMonth().toString(),n.textContent=m(t,g.config.shorthandCurrentMonth,g.l10n),n.tabIndex=-1,g.currentMonth===t&&(n.selected=!0),g.monthsDropdownContainer.appendChild(n)}}}function W(){var e,t=l("div","flatpickr-month"),n=window.document.createDocumentFragment();g.config.showMonths>1||"static"===g.config.monthSelectorType?e=l("span","cur-month"):(g.monthsDropdownContainer=l("select","flatpickr-monthDropdown-months"),O(g.monthsDropdownContainer,"change",(function(e){var t=e.target,n=parseInt(t.value,10);g.changeMonth(n-g.currentMonth),he("onMonthChange")})),V(),e=g.monthsDropdownContainer);var i=u("cur-year",{tabindex:"-1"}),r=i.getElementsByTagName("input")[0];r.setAttribute("aria-label",g.l10n.yearAriaLabel),g.config.minDate&&r.setAttribute("min",g.config.minDate.getFullYear().toString()),g.config.maxDate&&(r.setAttribute("max",g.config.maxDate.getFullYear().toString()),r.disabled=!!g.config.minDate&&g.config.minDate.getFullYear()===g.config.maxDate.getFullYear());var s=l("div","flatpickr-current-month");return s.appendChild(e),s.appendChild(i),n.appendChild(s),t.appendChild(n),{container:t,yearElement:r,monthElement:e}}function $(){d(g.monthNav),g.monthNav.appendChild(g.prevMonthNav),g.config.showMonths&&(g.yearElements=[],g.monthElements=[]);for(var e=g.config.showMonths;e--;){var t=W();g.yearElements.push(t.yearElement),g.monthElements.push(t.monthElement),g.monthNav.appendChild(t.container)}g.monthNav.appendChild(g.nextMonthNav)}function U(){g.weekdayContainer?d(g.weekdayContainer):g.weekdayContainer=l("div","flatpickr-weekdays");for(var e=g.config.showMonths;e--;){var t=l("div","flatpickr-weekdaycontainer");g.weekdayContainer.appendChild(t)}return Y(),g.weekdayContainer}function Y(){if(g.weekdayContainer){var e=g.l10n.firstDayOfWeek,t=g.l10n.weekdays.shorthand.slice();e>0&&e<t.length&&(t=t.splice(e,t.length).concat(t.splice(0,e)));for(var n=g.config.showMonths;n--;)g.weekdayContainer.children[n].innerHTML="\n <span class='flatpickr-weekday'>\n "+t.join("</span><span class='flatpickr-weekday'>")+"\n </span>\n "}}function K(e,t){void 0===t&&(t=!0);var n=t?e:e-g.currentMonth;n<0&&!0===g._hidePrevMonthArrow||n>0&&!0===g._hideNextMonthArrow||(g.currentMonth+=n,(g.currentMonth<0||g.currentMonth>11)&&(g.currentYear+=g.currentMonth>11?1:-1,g.currentMonth=(g.currentMonth+12)%12,he("onYearChange"),V()),q(),he("onMonthChange"),pe())}function z(e){return!(!g.config.appendTo||!g.config.appendTo.contains(e))||g.calendarContainer.contains(e)}function G(e){if(g.isOpen&&!g.config.inline){var t="function"==typeof(o=e).composedPath?o.composedPath()[0]:o.target,n=z(t),i=t===g.input||t===g.altInput||g.element.contains(t)||e.path&&e.path.indexOf&&(~e.path.indexOf(g.input)||~e.path.indexOf(g.altInput)),r="blur"===e.type?i&&e.relatedTarget&&!z(e.relatedTarget):!i&&!n&&!z(e.relatedTarget),s=!g.config.ignoredFocusElements.some((function(e){return e.contains(t)}));r&&s&&(void 0!==g.timeContainer&&void 0!==g.minuteElement&&void 0!==g.hourElement&&C(),g.close(),"range"===g.config.mode&&1===g.selectedDates.length&&(g.clear(!1),g.redraw()))}var o}function J(e){if(!(!e||g.config.minDate&&e<g.config.minDate.getFullYear()||g.config.maxDate&&e>g.config.maxDate.getFullYear())){var t=e,n=g.currentYear!==t;g.currentYear=t||g.currentYear,g.config.maxDate&&g.currentYear===g.config.maxDate.getFullYear()?g.currentMonth=Math.min(g.config.maxDate.getMonth(),g.currentMonth):g.config.minDate&&g.currentYear===g.config.minDate.getFullYear()&&(g.currentMonth=Math.max(g.config.minDate.getMonth(),g.currentMonth)),n&&(g.redraw(),he("onYearChange"),V())}}function X(e,t){void 0===t&&(t=!0);var n=g.parseDate(e,void 0,t);if(g.config.minDate&&n&&y(n,g.config.minDate,void 0!==t?t:!g.minDateHasTime)<0||g.config.maxDate&&n&&y(n,g.config.maxDate,void 0!==t?t:!g.maxDateHasTime)>0)return!1;if(0===g.config.enable.length&&0===g.config.disable.length)return!0;if(void 0===n)return!1;for(var i=g.config.enable.length>0,r=i?g.config.enable:g.config.disable,s=0,o=void 0;s<r.length;s++){if("function"==typeof(o=r[s])&&o(n))return i;if(o instanceof Date&&void 0!==n&&o.getTime()===n.getTime())return i;if("string"==typeof o&&void 0!==n){var a=g.parseDate(o,void 0,!0);return a&&a.getTime()===n.getTime()?i:!i}if("object"==typeof o&&void 0!==n&&o.from&&o.to&&n.getTime()>=o.from.getTime()&&n.getTime()<=o.to.getTime())return i}return!i}function Z(e){return void 0!==g.daysContainer&&-1===e.className.indexOf("hidden")&&g.daysContainer.contains(e)}function Q(e){var t=e.target===g._input,n=g.config.allowInput,i=g.isOpen&&(!n||!t),r=g.config.inline&&t&&!n;if(13===e.keyCode&&t){if(n)return g.setDate(g._input.value,!0,e.target===g.altInput?g.config.altFormat:g.config.dateFormat),e.target.blur();g.open()}else if(z(e.target)||i||r){var s=!!g.timeContainer&&g.timeContainer.contains(e.target);switch(e.keyCode){case 13:s?(e.preventDefault(),C(),ae()):ce(e);break;case 27:e.preventDefault(),ae();break;case 8:case 46:t&&!g.config.allowInput&&(e.preventDefault(),g.clear());break;case 37:case 39:if(s||t)g.hourElement&&g.hourElement.focus();else if(e.preventDefault(),void 0!==g.daysContainer&&(!1===n||document.activeElement&&Z(document.activeElement))){var o=39===e.keyCode?1:-1;e.ctrlKey?(e.stopPropagation(),K(o),H(j(1),0)):H(void 0,o)}break;case 38:case 40:e.preventDefault();var a=40===e.keyCode?1:-1;g.daysContainer&&void 0!==e.target.$i||e.target===g.input||e.target===g.altInput?e.ctrlKey?(e.stopPropagation(),J(g.currentYear-a),H(j(1),0)):s||H(void 0,7*a):e.target===g.currentYearElement?J(g.currentYear-a):g.config.enableTime&&(!s&&g.hourElement&&g.hourElement.focus(),C(e),g._debouncedChange());break;case 9:if(s){var c=[g.hourElement,g.minuteElement,g.secondElement,g.amPM].concat(g.pluginElements).filter((function(e){return e})),l=c.indexOf(e.target);if(-1!==l){var d=c[l+(e.shiftKey?-1:1)];e.preventDefault(),(d||g._input).focus()}}else!g.config.noCalendar&&g.daysContainer&&g.daysContainer.contains(e.target)&&e.shiftKey&&(e.preventDefault(),g._input.focus())}}if(void 0!==g.amPM&&e.target===g.amPM)switch(e.key){case g.l10n.amPM[0].charAt(0):case g.l10n.amPM[0].charAt(0).toLowerCase():g.amPM.textContent=g.l10n.amPM[0],x(),ve();break;case g.l10n.amPM[1].charAt(0):case g.l10n.amPM[1].charAt(0).toLowerCase():g.amPM.textContent=g.l10n.amPM[1],x(),ve()}(t||z(e.target))&&he("onKeyDown",e)}function ee(e){if(1===g.selectedDates.length&&(!e||e.classList.contains("flatpickr-day")&&!e.classList.contains("flatpickr-disabled"))){for(var t=e?e.dateObj.getTime():g.days.firstElementChild.dateObj.getTime(),n=g.parseDate(g.selectedDates[0],void 0,!0).getTime(),i=Math.min(t,g.selectedDates[0].getTime()),r=Math.max(t,g.selectedDates[0].getTime()),s=!1,o=0,a=0,c=i;c<r;c+=w)X(new Date(c),!0)||(s=s||c>i&&c<r,c<n&&(!o||c>o)?o=c:c>n&&(!a||c<a)&&(a=c));for(var l=0;l<g.config.showMonths;l++)for(var d=g.daysContainer.children[l],u=function(i,r){var c,l,u,h=d.children[i],m=h.dateObj.getTime(),f=o>0&&m<o||a>0&&m>a;return f?(h.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach((function(e){h.classList.remove(e)})),"continue"):s&&!f?"continue":(["startRange","inRange","endRange","notAllowed"].forEach((function(e){h.classList.remove(e)})),void(void 0!==e&&(e.classList.add(t<=g.selectedDates[0].getTime()?"startRange":"endRange"),n<t&&m===n?h.classList.add("startRange"):n>t&&m===n&&h.classList.add("endRange"),m>=o&&(0===a||m<=a)&&(l=n,u=t,(c=m)>Math.min(l,u)&&c<Math.max(l,u))&&h.classList.add("inRange"))))},h=0,m=d.children.length;h<m;h++)u(h)}}function te(){!g.isOpen||g.config.static||g.config.inline||se()}function ne(){g.setDate(void 0!==g.config.minDate?new Date(g.config.minDate.getTime()):new Date,!0),D(),ve()}function ie(e){return function(t){var n=g.config["_"+e+"Date"]=g.parseDate(t,g.config.dateFormat),i=g.config["_"+("min"===e?"max":"min")+"Date"];void 0!==n&&(g["min"===e?"minDateHasTime":"maxDateHasTime"]=n.getHours()>0||n.getMinutes()>0||n.getSeconds()>0),g.selectedDates&&(g.selectedDates=g.selectedDates.filter((function(e){return X(e)})),g.selectedDates.length||"min"!==e||T(n),ve()),g.daysContainer&&(oe(),void 0!==n?g.currentYearElement[e]=n.getFullYear().toString():g.currentYearElement.removeAttribute(e),g.currentYearElement.disabled=!!i&&void 0!==n&&i.getFullYear()===n.getFullYear())}}function re(){"object"!=typeof g.config.locale&&void 0===_.l10ns[g.config.locale]&&g.config.errorHandler(new Error("flatpickr: invalid locale "+g.config.locale)),g.l10n=e({},_.l10ns.default,"object"==typeof g.config.locale?g.config.locale:"default"!==g.config.locale?_.l10ns[g.config.locale]:void 0),p.K="("+g.l10n.amPM[0]+"|"+g.l10n.amPM[1]+"|"+g.l10n.amPM[0].toLowerCase()+"|"+g.l10n.amPM[1].toLowerCase()+")",void 0===e({},f,JSON.parse(JSON.stringify(h.dataset||{}))).time_24hr&&void 0===_.defaultConfig.time_24hr&&(g.config.time_24hr=g.l10n.time_24hr),g.formatDate=v(g),g.parseDate=b({config:g.config,l10n:g.l10n})}function se(e){if(void 0!==g.calendarContainer){he("onPreCalendarPosition");var t=e||g._positionElement,n=Array.prototype.reduce.call(g.calendarContainer.children,(function(e,t){return e+t.offsetHeight}),0),i=g.calendarContainer.offsetWidth,r=g.config.position.split(" "),s=r[0],o=r.length>1?r[1]:null,a=t.getBoundingClientRect(),l=window.innerHeight-a.bottom,d="above"===s||"below"!==s&&l<n&&a.top>n,u=window.pageYOffset+a.top+(d?-n-2:t.offsetHeight+2);if(c(g.calendarContainer,"arrowTop",!d),c(g.calendarContainer,"arrowBottom",d),!g.config.inline){var h=window.pageXOffset+a.left-(null!=o&&"center"===o?(i-a.width)/2:0),m=window.document.body.offsetWidth-(window.pageXOffset+a.right),f=h+i>window.document.body.offsetWidth,p=m+i>window.document.body.offsetWidth;if(c(g.calendarContainer,"rightMost",f),!g.config.static)if(g.calendarContainer.style.top=u+"px",f)if(p){var v=document.styleSheets[0];if(void 0===v)return;var b=window.document.body.offsetWidth,y=Math.max(0,b/2-i/2),w=v.cssRules.length,E="{left:"+a.left+"px;right:auto;}";c(g.calendarContainer,"rightMost",!1),c(g.calendarContainer,"centerMost",!0),v.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+E,w),g.calendarContainer.style.left=y+"px",g.calendarContainer.style.right="auto"}else g.calendarContainer.style.left="auto",g.calendarContainer.style.right=m+"px";else g.calendarContainer.style.left=h+"px",g.calendarContainer.style.right="auto"}}}function oe(){g.config.noCalendar||g.isMobile||(pe(),q())}function ae(){g._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(g.close,0):g.close()}function ce(e){e.preventDefault(),e.stopPropagation();var t=function e(t,n){return n(t)?t:t.parentNode?e(t.parentNode,n):void 0}(e.target,(function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("flatpickr-disabled")&&!e.classList.contains("notAllowed")}));if(void 0!==t){var n=t,i=g.latestSelectedDateObj=new Date(n.dateObj.getTime()),r=(i.getMonth()<g.currentMonth||i.getMonth()>g.currentMonth+g.config.showMonths-1)&&"range"!==g.config.mode;if(g.selectedDateElem=n,"single"===g.config.mode)g.selectedDates=[i];else if("multiple"===g.config.mode){var s=fe(i);s?g.selectedDates.splice(parseInt(s),1):g.selectedDates.push(i)}else"range"===g.config.mode&&(2===g.selectedDates.length&&g.clear(!1,!1),g.latestSelectedDateObj=i,g.selectedDates.push(i),0!==y(i,g.selectedDates[0],!0)&&g.selectedDates.sort((function(e,t){return e.getTime()-t.getTime()})));if(x(),r){var o=g.currentYear!==i.getFullYear();g.currentYear=i.getFullYear(),g.currentMonth=i.getMonth(),o&&(he("onYearChange"),V()),he("onMonthChange")}if(pe(),q(),ve(),g.config.enableTime&&setTimeout((function(){return g.showTimeInput=!0}),50),r||"range"===g.config.mode||1!==g.config.showMonths?void 0!==g.selectedDateElem&&void 0===g.hourElement&&g.selectedDateElem&&g.selectedDateElem.focus():N(n),void 0!==g.hourElement&&void 0!==g.hourElement&&g.hourElement.focus(),g.config.closeOnSelect){var a="single"===g.config.mode&&!g.config.enableTime,c="range"===g.config.mode&&2===g.selectedDates.length&&!g.config.enableTime;(a||c)&&ae()}M()}}g.parseDate=b({config:g.config,l10n:g.l10n}),g._handlers=[],g.pluginElements=[],g.loadedPlugins=[],g._bind=O,g._setHoursFromDate=T,g._positionCalendar=se,g.changeMonth=K,g.changeYear=J,g.clear=function(e,t){void 0===e&&(e=!0),void 0===t&&(t=!0),g.input.value="",void 0!==g.altInput&&(g.altInput.value=""),void 0!==g.mobileInput&&(g.mobileInput.value=""),g.selectedDates=[],g.latestSelectedDateObj=void 0,!0===t&&(g.currentYear=g._initialDate.getFullYear(),g.currentMonth=g._initialDate.getMonth()),g.showTimeInput=!1,!0===g.config.enableTime&&D(),g.redraw(),e&&he("onChange")},g.close=function(){g.isOpen=!1,g.isMobile||(void 0!==g.calendarContainer&&g.calendarContainer.classList.remove("open"),void 0!==g._input&&g._input.classList.remove("active")),he("onClose")},g._createElement=l,g.destroy=function(){void 0!==g.config&&he("onDestroy");for(var e=g._handlers.length;e--;){var t=g._handlers[e];t.element.removeEventListener(t.event,t.handler,t.options)}if(g._handlers=[],g.mobileInput)g.mobileInput.parentNode&&g.mobileInput.parentNode.removeChild(g.mobileInput),g.mobileInput=void 0;else if(g.calendarContainer&&g.calendarContainer.parentNode)if(g.config.static&&g.calendarContainer.parentNode){var n=g.calendarContainer.parentNode;if(n.lastChild&&n.removeChild(n.lastChild),n.parentNode){for(;n.firstChild;)n.parentNode.insertBefore(n.firstChild,n);n.parentNode.removeChild(n)}}else g.calendarContainer.parentNode.removeChild(g.calendarContainer);g.altInput&&(g.input.type="text",g.altInput.parentNode&&g.altInput.parentNode.removeChild(g.altInput),delete g.altInput),g.input&&(g.input.type=g.input._type,g.input.classList.remove("flatpickr-input"),g.input.removeAttribute("readonly"),g.input.value=""),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach((function(e){try{delete g[e]}catch(e){}}))},g.isEnabled=X,g.jumpToDate=k,g.open=function(e,t){if(void 0===t&&(t=g._positionElement),!0===g.isMobile)return e&&(e.preventDefault(),e.target&&e.target.blur()),void 0!==g.mobileInput&&(g.mobileInput.focus(),g.mobileInput.click()),void he("onOpen");if(!g._input.disabled&&!g.config.inline){var n=g.isOpen;g.isOpen=!0,n||(g.calendarContainer.classList.add("open"),g._input.classList.add("active"),he("onOpen"),se(t)),!0===g.config.enableTime&&!0===g.config.noCalendar&&(0===g.selectedDates.length&&ne(),!1!==g.config.allowInput||void 0!==e&&g.timeContainer.contains(e.relatedTarget)||setTimeout((function(){return g.hourElement.select()}),50))}},g.redraw=oe,g.set=function(e,n){if(null!==e&&"object"==typeof e)for(var i in Object.assign(g.config,e),e)void 0!==le[i]&&le[i].forEach((function(e){return e()}));else g.config[e]=n,void 0!==le[e]?le[e].forEach((function(e){return e()})):t.indexOf(e)>-1&&(g.config[e]=a(n));g.redraw(),ve(!1)},g.setDate=function(e,t,n){if(void 0===t&&(t=!1),void 0===n&&(n=g.config.dateFormat),0!==e&&!e||e instanceof Array&&0===e.length)return g.clear(t);de(e,n),g.showTimeInput=g.selectedDates.length>0,g.latestSelectedDateObj=g.selectedDates[g.selectedDates.length-1],g.redraw(),k(),T(),0===g.selectedDates.length&&g.clear(!1),ve(t),t&&he("onChange")},g.toggle=function(e){if(!0===g.isOpen)return g.close();g.open(e)};var le={locale:[re,Y],showMonths:[$,S,U],minDate:[k],maxDate:[k]};function de(e,t){var n=[];if(e instanceof Array)n=e.map((function(e){return g.parseDate(e,t)}));else if(e instanceof Date||"number"==typeof e)n=[g.parseDate(e,t)];else if("string"==typeof e)switch(g.config.mode){case"single":case"time":n=[g.parseDate(e,t)];break;case"multiple":n=e.split(g.config.conjunction).map((function(e){return g.parseDate(e,t)}));break;case"range":n=e.split(g.l10n.rangeSeparator).map((function(e){return g.parseDate(e,t)}))}else g.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));g.selectedDates=n.filter((function(e){return e instanceof Date&&X(e,!1)})),"range"===g.config.mode&&g.selectedDates.sort((function(e,t){return e.getTime()-t.getTime()}))}function ue(e){return e.slice().map((function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?g.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:g.parseDate(e.from,void 0),to:g.parseDate(e.to,void 0)}:e})).filter((function(e){return e}))}function he(e,t){if(void 0!==g.config){var n=g.config[e];if(void 0!==n&&n.length>0)for(var i=0;n[i]&&i<n.length;i++)n[i](g.selectedDates,g.input.value,g,t);"onChange"===e&&(g.input.dispatchEvent(me("change")),g.input.dispatchEvent(me("input")))}}function me(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!0),t}function fe(e){for(var t=0;t<g.selectedDates.length;t++)if(0===y(g.selectedDates[t],e))return""+t;return!1}function pe(){g.config.noCalendar||g.isMobile||!g.monthNav||(g.yearElements.forEach((function(e,t){var n=new Date(g.currentYear,g.currentMonth,1);n.setMonth(g.currentMonth+t),g.config.showMonths>1||"static"===g.config.monthSelectorType?g.monthElements[t].textContent=m(n.getMonth(),g.config.shorthandCurrentMonth,g.l10n)+" ":g.monthsDropdownContainer.value=n.getMonth().toString(),e.value=n.getFullYear().toString()})),g._hidePrevMonthArrow=void 0!==g.config.minDate&&(g.currentYear===g.config.minDate.getFullYear()?g.currentMonth<=g.config.minDate.getMonth():g.currentYear<g.config.minDate.getFullYear()),g._hideNextMonthArrow=void 0!==g.config.maxDate&&(g.currentYear===g.config.maxDate.getFullYear()?g.currentMonth+1>g.config.maxDate.getMonth():g.currentYear>g.config.maxDate.getFullYear()))}function ge(e){return g.selectedDates.map((function(t){return g.formatDate(t,e)})).filter((function(e,t,n){return"range"!==g.config.mode||g.config.enableTime||n.indexOf(e)===t})).join("range"!==g.config.mode?g.config.conjunction:g.l10n.rangeSeparator)}function ve(e){void 0===e&&(e=!0),void 0!==g.mobileInput&&g.mobileFormatStr&&(g.mobileInput.value=void 0!==g.latestSelectedDateObj?g.formatDate(g.latestSelectedDateObj,g.mobileFormatStr):""),g.input.value=ge(g.config.dateFormat),void 0!==g.altInput&&(g.altInput.value=ge(g.config.altFormat)),!1!==e&&he("onValueUpdate")}function be(e){var t=g.prevMonthNav.contains(e.target),n=g.nextMonthNav.contains(e.target);t||n?K(t?-1:1):g.yearElements.indexOf(e.target)>=0?e.target.select():e.target.classList.contains("arrowUp")?g.changeYear(g.currentYear+1):e.target.classList.contains("arrowDown")&&g.changeYear(g.currentYear-1)}return function(){g.element=g.input=h,g.isOpen=!1,function(){var i=["wrap","weekNumbers","allowInput","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],r=e({},f,JSON.parse(JSON.stringify(h.dataset||{}))),s={};g.config.parseDate=r.parseDate,g.config.formatDate=r.formatDate,Object.defineProperty(g.config,"enable",{get:function(){return g.config._enable},set:function(e){g.config._enable=ue(e)}}),Object.defineProperty(g.config,"disable",{get:function(){return g.config._disable},set:function(e){g.config._disable=ue(e)}});var o="time"===r.mode;if(!r.dateFormat&&(r.enableTime||o)){var c=_.defaultConfig.dateFormat||n.dateFormat;s.dateFormat=r.noCalendar||o?"H:i"+(r.enableSeconds?":S":""):c+" H:i"+(r.enableSeconds?":S":"")}if(r.altInput&&(r.enableTime||o)&&!r.altFormat){var l=_.defaultConfig.altFormat||n.altFormat;s.altFormat=r.noCalendar||o?"h:i"+(r.enableSeconds?":S K":" K"):l+" h:i"+(r.enableSeconds?":S":"")+" K"}r.altInputClass||(g.config.altInputClass=g.input.className+" "+g.config.altInputClass),Object.defineProperty(g.config,"minDate",{get:function(){return g.config._minDate},set:ie("min")}),Object.defineProperty(g.config,"maxDate",{get:function(){return g.config._maxDate},set:ie("max")});var d=function(e){return function(t){g.config["min"===e?"_minTime":"_maxTime"]=g.parseDate(t,"H:i:S")}};Object.defineProperty(g.config,"minTime",{get:function(){return g.config._minTime},set:d("min")}),Object.defineProperty(g.config,"maxTime",{get:function(){return g.config._maxTime},set:d("max")}),"time"===r.mode&&(g.config.noCalendar=!0,g.config.enableTime=!0),Object.assign(g.config,s,r);for(var u=0;u<i.length;u++)g.config[i[u]]=!0===g.config[i[u]]||"true"===g.config[i[u]];for(t.filter((function(e){return void 0!==g.config[e]})).forEach((function(e){g.config[e]=a(g.config[e]||[]).map(E)})),g.isMobile=!g.config.disableMobile&&!g.config.inline&&"single"===g.config.mode&&!g.config.disable.length&&!g.config.enable.length&&!g.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),u=0;u<g.config.plugins.length;u++){var m=g.config.plugins[u](g)||{};for(var p in m)t.indexOf(p)>-1?g.config[p]=a(m[p]).map(E).concat(g.config[p]):void 0===r[p]&&(g.config[p]=m[p])}he("onParseConfig")}(),re(),g.input=g.config.wrap?h.querySelector("[data-input]"):h,g.input?(g.input._type=g.input.type,g.input.type="text",g.input.classList.add("flatpickr-input"),g._input=g.input,g.config.altInput&&(g.altInput=l(g.input.nodeName,g.config.altInputClass),g._input=g.altInput,g.altInput.placeholder=g.input.placeholder,g.altInput.disabled=g.input.disabled,g.altInput.required=g.input.required,g.altInput.tabIndex=g.input.tabIndex,g.altInput.type="text",g.input.setAttribute("type","hidden"),!g.config.static&&g.input.parentNode&&g.input.parentNode.insertBefore(g.altInput,g.input.nextSibling)),g.config.allowInput||g._input.setAttribute("readonly","readonly"),g._positionElement=g.config.positionElement||g._input):g.config.errorHandler(new Error("Invalid input element specified")),function(){g.selectedDates=[],g.now=g.parseDate(g.config.now)||new Date;var e=g.config.defaultDate||("INPUT"!==g.input.nodeName&&"TEXTAREA"!==g.input.nodeName||!g.input.placeholder||g.input.value!==g.input.placeholder?g.input.value:null);e&&de(e,g.config.dateFormat),g._initialDate=g.selectedDates.length>0?g.selectedDates[0]:g.config.minDate&&g.config.minDate.getTime()>g.now.getTime()?g.config.minDate:g.config.maxDate&&g.config.maxDate.getTime()<g.now.getTime()?g.config.maxDate:g.now,g.currentYear=g._initialDate.getFullYear(),g.currentMonth=g._initialDate.getMonth(),g.selectedDates.length>0&&(g.latestSelectedDateObj=g.selectedDates[0]),void 0!==g.config.minTime&&(g.config.minTime=g.parseDate(g.config.minTime,"H:i")),void 0!==g.config.maxTime&&(g.config.maxTime=g.parseDate(g.config.maxTime,"H:i")),g.minDateHasTime=!!g.config.minDate&&(g.config.minDate.getHours()>0||g.config.minDate.getMinutes()>0||g.config.minDate.getSeconds()>0),g.maxDateHasTime=!!g.config.maxDate&&(g.config.maxDate.getHours()>0||g.config.maxDate.getMinutes()>0||g.config.maxDate.getSeconds()>0),Object.defineProperty(g,"showTimeInput",{get:function(){return g._showTimeInput},set:function(e){g._showTimeInput=e,g.calendarContainer&&c(g.calendarContainer,"showTimeInput",e),g.isOpen&&se()}})}(),g.utils={getDaysInMonth:function(e,t){return void 0===e&&(e=g.currentMonth),void 0===t&&(t=g.currentYear),1===e&&(t%4==0&&t%100!=0||t%400==0)?29:g.l10n.daysInMonth[e]}},g.isMobile||function(){var e=window.document.createDocumentFragment();if(g.calendarContainer=l("div","flatpickr-calendar"),g.calendarContainer.tabIndex=-1,!g.config.noCalendar){if(e.appendChild((g.monthNav=l("div","flatpickr-months"),g.yearElements=[],g.monthElements=[],g.prevMonthNav=l("span","flatpickr-prev-month"),g.prevMonthNav.innerHTML=g.config.prevArrow,g.nextMonthNav=l("span","flatpickr-next-month"),g.nextMonthNav.innerHTML=g.config.nextArrow,$(),Object.defineProperty(g,"_hidePrevMonthArrow",{get:function(){return g.__hidePrevMonthArrow},set:function(e){g.__hidePrevMonthArrow!==e&&(c(g.prevMonthNav,"flatpickr-disabled",e),g.__hidePrevMonthArrow=e)}}),Object.defineProperty(g,"_hideNextMonthArrow",{get:function(){return g.__hideNextMonthArrow},set:function(e){g.__hideNextMonthArrow!==e&&(c(g.nextMonthNav,"flatpickr-disabled",e),g.__hideNextMonthArrow=e)}}),g.currentYearElement=g.yearElements[0],pe(),g.monthNav)),g.innerContainer=l("div","flatpickr-innerContainer"),g.config.weekNumbers){var t=function(){g.calendarContainer.classList.add("hasWeeks");var e=l("div","flatpickr-weekwrapper");e.appendChild(l("span","flatpickr-weekday",g.l10n.weekAbbreviation));var t=l("div","flatpickr-weeks");return e.appendChild(t),{weekWrapper:e,weekNumbers:t}}(),n=t.weekWrapper,i=t.weekNumbers;g.innerContainer.appendChild(n),g.weekNumbers=i,g.weekWrapper=n}g.rContainer=l("div","flatpickr-rContainer"),g.rContainer.appendChild(U()),g.daysContainer||(g.daysContainer=l("div","flatpickr-days"),g.daysContainer.tabIndex=-1),q(),g.rContainer.appendChild(g.daysContainer),g.innerContainer.appendChild(g.rContainer),e.appendChild(g.innerContainer)}g.config.enableTime&&e.appendChild(function(){g.calendarContainer.classList.add("hasTime"),g.config.noCalendar&&g.calendarContainer.classList.add("noCalendar"),g.timeContainer=l("div","flatpickr-time"),g.timeContainer.tabIndex=-1;var e=l("span","flatpickr-time-separator",":"),t=u("flatpickr-hour",{"aria-label":g.l10n.hourAriaLabel});g.hourElement=t.getElementsByTagName("input")[0];var n=u("flatpickr-minute",{"aria-label":g.l10n.minuteAriaLabel});if(g.minuteElement=n.getElementsByTagName("input")[0],g.hourElement.tabIndex=g.minuteElement.tabIndex=-1,g.hourElement.value=r(g.latestSelectedDateObj?g.latestSelectedDateObj.getHours():g.config.time_24hr?g.config.defaultHour:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(g.config.defaultHour)),g.minuteElement.value=r(g.latestSelectedDateObj?g.latestSelectedDateObj.getMinutes():g.config.defaultMinute),g.hourElement.setAttribute("step",g.config.hourIncrement.toString()),g.minuteElement.setAttribute("step",g.config.minuteIncrement.toString()),g.hourElement.setAttribute("min",g.config.time_24hr?"0":"1"),g.hourElement.setAttribute("max",g.config.time_24hr?"23":"12"),g.minuteElement.setAttribute("min","0"),g.minuteElement.setAttribute("max","59"),g.timeContainer.appendChild(t),g.timeContainer.appendChild(e),g.timeContainer.appendChild(n),g.config.time_24hr&&g.timeContainer.classList.add("time24hr"),g.config.enableSeconds){g.timeContainer.classList.add("hasSeconds");var i=u("flatpickr-second");g.secondElement=i.getElementsByTagName("input")[0],g.secondElement.value=r(g.latestSelectedDateObj?g.latestSelectedDateObj.getSeconds():g.config.defaultSeconds),g.secondElement.setAttribute("step",g.minuteElement.getAttribute("step")),g.secondElement.setAttribute("min","0"),g.secondElement.setAttribute("max","59"),g.timeContainer.appendChild(l("span","flatpickr-time-separator",":")),g.timeContainer.appendChild(i)}return g.config.time_24hr||(g.amPM=l("span","flatpickr-am-pm",g.l10n.amPM[s((g.latestSelectedDateObj?g.hourElement.value:g.config.defaultHour)>11)]),g.amPM.title=g.l10n.toggleTitle,g.amPM.tabIndex=-1,g.timeContainer.appendChild(g.amPM)),g.timeContainer}()),c(g.calendarContainer,"rangeMode","range"===g.config.mode),c(g.calendarContainer,"animate",!0===g.config.animate),c(g.calendarContainer,"multiMonth",g.config.showMonths>1),g.calendarContainer.appendChild(e);var o=void 0!==g.config.appendTo&&void 0!==g.config.appendTo.nodeType;if((g.config.inline||g.config.static)&&(g.calendarContainer.classList.add(g.config.inline?"inline":"static"),g.config.inline&&(!o&&g.element.parentNode?g.element.parentNode.insertBefore(g.calendarContainer,g._input.nextSibling):void 0!==g.config.appendTo&&g.config.appendTo.appendChild(g.calendarContainer)),g.config.static)){var a=l("div","flatpickr-wrapper");g.element.parentNode&&g.element.parentNode.insertBefore(a,g.element),a.appendChild(g.element),g.altInput&&a.appendChild(g.altInput),a.appendChild(g.calendarContainer)}g.config.static||g.config.inline||(void 0!==g.config.appendTo?g.config.appendTo:window.document.body).appendChild(g.calendarContainer)}(),function(){if(g.config.wrap&&["open","close","toggle","clear"].forEach((function(e){Array.prototype.forEach.call(g.element.querySelectorAll("[data-"+e+"]"),(function(t){return O(t,"click",g[e])}))})),g.isMobile)!function(){var e=g.config.enableTime?g.config.noCalendar?"time":"datetime-local":"date";g.mobileInput=l("input",g.input.className+" flatpickr-mobile"),g.mobileInput.step=g.input.getAttribute("step")||"any",g.mobileInput.tabIndex=1,g.mobileInput.type=e,g.mobileInput.disabled=g.input.disabled,g.mobileInput.required=g.input.required,g.mobileInput.placeholder=g.input.placeholder,g.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",g.selectedDates.length>0&&(g.mobileInput.defaultValue=g.mobileInput.value=g.formatDate(g.selectedDates[0],g.mobileFormatStr)),g.config.minDate&&(g.mobileInput.min=g.formatDate(g.config.minDate,"Y-m-d")),g.config.maxDate&&(g.mobileInput.max=g.formatDate(g.config.maxDate,"Y-m-d")),g.input.type="hidden",void 0!==g.altInput&&(g.altInput.type="hidden");try{g.input.parentNode&&g.input.parentNode.insertBefore(g.mobileInput,g.input.nextSibling)}catch(e){}O(g.mobileInput,"change",(function(e){g.setDate(e.target.value,!1,g.mobileFormatStr),he("onChange"),he("onClose")}))}();else{var e=o(te,50);g._debouncedChange=o(M,300),g.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&O(g.daysContainer,"mouseover",(function(e){"range"===g.config.mode&&ee(e.target)})),O(window.document.body,"keydown",Q),g.config.inline||g.config.static||O(window,"resize",e),void 0!==window.ontouchstart?O(window.document,"touchstart",G):O(window.document,"mousedown",I(G)),O(window.document,"focus",G,{capture:!0}),!0===g.config.clickOpens&&(O(g._input,"focus",g.open),O(g._input,"mousedown",I(g.open))),void 0!==g.daysContainer&&(O(g.monthNav,"mousedown",I(be)),O(g.monthNav,["keyup","increment"],A),O(g.daysContainer,"mousedown",I(ce))),void 0!==g.timeContainer&&void 0!==g.minuteElement&&void 0!==g.hourElement&&(O(g.timeContainer,["increment"],C),O(g.timeContainer,"blur",C,{capture:!0}),O(g.timeContainer,"mousedown",I(P)),O([g.hourElement,g.minuteElement],["focus","click"],(function(e){return e.target.select()})),void 0!==g.secondElement&&O(g.secondElement,"focus",(function(){return g.secondElement&&g.secondElement.select()})),void 0!==g.amPM&&O(g.amPM,"mousedown",I((function(e){C(e),M()}))))}}(),(g.selectedDates.length||g.config.noCalendar)&&(g.config.enableTime&&T(g.config.noCalendar?g.latestSelectedDateObj||g.config.minDate:void 0),ve(!1)),S(),g.showTimeInput=g.selectedDates.length>0||g.config.noCalendar;var i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!g.isMobile&&i&&se(),he("onReady")}(),g}function S(e,t){for(var n=Array.prototype.slice.call(e).filter((function(e){return e instanceof HTMLElement})),i=[],r=0;r<n.length;r++){var s=n[r];try{if(null!==s.getAttribute("data-fp-omit"))continue;void 0!==s._flatpickr&&(s._flatpickr.destroy(),s._flatpickr=void 0),s._flatpickr=E(s,t||{}),i.push(s._flatpickr)}catch(e){console.error(e)}}return 1===i.length?i[0]:i}"function"!=typeof Object.assign&&(Object.assign=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!e)throw TypeError("Cannot convert undefined or null to object");for(var i=function(t){t&&Object.keys(t).forEach((function(n){return e[n]=t[n]}))},r=0,s=t;r<s.length;r++){var o=s[r];i(o)}return e}),"undefined"!=typeof HTMLElement&&"undefined"!=typeof HTMLCollection&&"undefined"!=typeof NodeList&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(e){return S(this,e)},HTMLElement.prototype.flatpickr=function(e){return S([this],e)});var _=function(e,t){return"string"==typeof e?S(window.document.querySelectorAll(e),t):e instanceof Node?S([e],t):S(e,t)};return _.defaultConfig={},_.l10ns={en:e({},i),default:e({},i)},_.localize=function(t){_.l10ns.default=e({},_.l10ns.default,t)},_.setDefaults=function(t){_.defaultConfig=e({},_.defaultConfig,t)},_.parseDate=b({}),_.formatDate=v({}),_.compareDates=y,"undefined"!=typeof jQuery&&void 0!==jQuery.fn&&(jQuery.fn.flatpickr=function(e){return S(this,e)}),Date.prototype.fp_incr=function(e){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+("string"==typeof e?parseInt(e,10):e))},"undefined"!=typeof window&&(window.flatpickr=_),_}()},function(e,t,n){var i;window,i=function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/public/assets/scripts/",n(n.s=4)}([function(e,t,n){"use strict";var i=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===r}(e)}(e)},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function s(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function o(e,t,n){return e.concat(t).map((function(e){return s(e,n)}))}function a(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function c(e,t,n){var i={};return n.isMergeableObject(e)&&a(e).forEach((function(t){i[t]=s(e[t],n)})),a(t).forEach((function(r){(function(e,t){try{return t in e&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}catch(e){return!1}})(e,r)||(n.isMergeableObject(t[r])&&e[r]?i[r]=function(e,t){if(!t.customMerge)return l;var n=t.customMerge(e);return"function"==typeof n?n:l}(r,n)(e[r],t[r],n):i[r]=s(t[r],n))})),i}function l(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||o,n.isMergeableObject=n.isMergeableObject||i,n.cloneUnlessOtherwiseSpecified=s;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):c(e,t,n):s(t,n)}l.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return l(e,n,t)}),{})};var d=l;e.exports=d},function(e,t,n){"use strict";(function(e,i){var r,s=n(3);r="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:i;var o=Object(s.a)(r);t.a=o}).call(this,n(5),n(6)(e))},function(e,t,n){e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t){e.exports=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var s=n(2),o=n(8),a=n(0),c=function(){function e(t,n){var i=n.location,r=void 0===i?0:i,s=n.distance,a=void 0===s?100:s,c=n.threshold,l=void 0===c?.6:c,d=n.maxPatternLength,u=void 0===d?32:d,h=n.caseSensitive,m=void 0!==h&&h,f=n.tokenSeparator,p=void 0===f?/ +/g:f,g=n.findAllMatches,v=void 0!==g&&g,b=n.minMatchCharLength,y=void 0===b?1:b,w=n.id,E=void 0===w?null:w,S=n.keys,_=void 0===S?[]:S,C=n.shouldSort,x=void 0===C||C,T=n.getFn,D=void 0===T?o:T,L=n.sortFn,A=void 0===L?function(e,t){return e.score-t.score}:L,O=n.tokenize,I=void 0!==O&&O,M=n.matchAllTokens,k=void 0!==M&&M,P=n.includeMatches,F=void 0!==P&&P,R=n.includeScore,N=void 0!==R&&R,j=n.verbose,H=void 0!==j&&j;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options={location:r,distance:a,threshold:l,maxPatternLength:u,isCaseSensitive:m,tokenSeparator:p,findAllMatches:v,minMatchCharLength:y,id:E,keys:_,includeMatches:F,includeScore:N,shouldSort:x,getFn:D,sortFn:A,verbose:H,tokenize:I,matchAllTokens:k},this.setCollection(t)}var t,n;return t=e,(n=[{key:"setCollection",value:function(e){return this.list=e,e}},{key:"search",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{limit:!1};this._log('---------\nSearch pattern: "'.concat(e,'"'));var n=this._prepareSearchers(e),i=n.tokenSearchers,r=n.fullSearcher,s=this._search(i,r),o=s.weights,a=s.results;return this._computeScore(o,a),this.options.shouldSort&&this._sort(a),t.limit&&"number"==typeof t.limit&&(a=a.slice(0,t.limit)),this._format(a)}},{key:"_prepareSearchers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=[];if(this.options.tokenize)for(var n=e.split(this.options.tokenSeparator),i=0,r=n.length;i<r;i+=1)t.push(new s(n[i],this.options));return{tokenSearchers:t,fullSearcher:new s(e,this.options)}}},{key:"_search",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=this.list,i={},r=[];if("string"==typeof n[0]){for(var s=0,o=n.length;s<o;s+=1)this._analyze({key:"",value:n[s],record:s,index:s},{resultMap:i,results:r,tokenSearchers:e,fullSearcher:t});return{weights:null,results:r}}for(var a={},c=0,l=n.length;c<l;c+=1)for(var d=n[c],u=0,h=this.options.keys.length;u<h;u+=1){var m=this.options.keys[u];if("string"!=typeof m){if(a[m.name]={weight:1-m.weight||1},m.weight<=0||m.weight>1)throw new Error("Key weight has to be > 0 and <= 1");m=m.name}else a[m]={weight:1};this._analyze({key:m,value:this.options.getFn(d,m),record:d,index:c},{resultMap:i,results:r,tokenSearchers:e,fullSearcher:t})}return{weights:a,results:r}}},{key:"_analyze",value:function(e,t){var n=e.key,i=e.arrayIndex,r=void 0===i?-1:i,s=e.value,o=e.record,c=e.index,l=t.tokenSearchers,d=void 0===l?[]:l,u=t.fullSearcher,h=void 0===u?[]:u,m=t.resultMap,f=void 0===m?{}:m,p=t.results,g=void 0===p?[]:p;if(null!=s){var v=!1,b=-1,y=0;if("string"==typeof s){this._log("\nKey: ".concat(""===n?"-":n));var w=h.search(s);if(this._log('Full text: "'.concat(s,'", score: ').concat(w.score)),this.options.tokenize){for(var E=s.split(this.options.tokenSeparator),S=[],_=0;_<d.length;_+=1){var C=d[_];this._log('\nPattern: "'.concat(C.pattern,'"'));for(var x=!1,T=0;T<E.length;T+=1){var D=E[T],L=C.search(D),A={};L.isMatch?(A[D]=L.score,v=!0,x=!0,S.push(L.score)):(A[D]=1,this.options.matchAllTokens||S.push(1)),this._log('Token: "'.concat(D,'", score: ').concat(A[D]))}x&&(y+=1)}b=S[0];for(var O=S.length,I=1;I<O;I+=1)b+=S[I];b/=O,this._log("Token score average:",b)}var M=w.score;b>-1&&(M=(M+b)/2),this._log("Score average:",M);var k=!this.options.tokenize||!this.options.matchAllTokens||y>=d.length;if(this._log("\nCheck Matches: ".concat(k)),(v||w.isMatch)&&k){var P=f[c];P?P.output.push({key:n,arrayIndex:r,value:s,score:M,matchedIndices:w.matchedIndices}):(f[c]={item:o,output:[{key:n,arrayIndex:r,value:s,score:M,matchedIndices:w.matchedIndices}]},g.push(f[c]))}}else if(a(s))for(var F=0,R=s.length;F<R;F+=1)this._analyze({key:n,arrayIndex:F,value:s[F],record:o,index:c},{resultMap:f,results:g,tokenSearchers:d,fullSearcher:h})}}},{key:"_computeScore",value:function(e,t){this._log("\n\nComputing score:\n");for(var n=0,i=t.length;n<i;n+=1){for(var r=t[n].output,s=r.length,o=1,a=1,c=0;c<s;c+=1){var l=e?e[r[c].key].weight:1,d=(1===l?r[c].score:r[c].score||.001)*l;1!==l?a=Math.min(a,d):(r[c].nScore=d,o*=d)}t[n].score=1===a?o:a,this._log(t[n])}}},{key:"_sort",value:function(e){this._log("\n\nSorting...."),e.sort(this.options.sortFn)}},{key:"_format",value:function(e){var t=[];if(this.options.verbose){var n=[];this._log("\n\nOutput:\n\n",JSON.stringify(e,(function(e,t){if("object"===i(t)&&null!==t){if(-1!==n.indexOf(t))return;n.push(t)}return t}))),n=null}var r=[];this.options.includeMatches&&r.push((function(e,t){var n=e.output;t.matches=[];for(var i=0,r=n.length;i<r;i+=1){var s=n[i];if(0!==s.matchedIndices.length){var o={indices:s.matchedIndices,value:s.value};s.key&&(o.key=s.key),s.hasOwnProperty("arrayIndex")&&s.arrayIndex>-1&&(o.arrayIndex=s.arrayIndex),t.matches.push(o)}}})),this.options.includeScore&&r.push((function(e,t){t.score=e.score}));for(var s=0,o=e.length;s<o;s+=1){var a=e[s];if(this.options.id&&(a.item=this.options.getFn(a.item,this.options.id)[0]),r.length){for(var c={item:a.item},l=0,d=r.length;l<d;l+=1)r[l](a,c);t.push(c)}else t.push(a.item)}return t}},{key:"_log",value:function(){var e;this.options.verbose&&(e=console).log.apply(e,arguments)}}])&&r(t.prototype,n),e}();e.exports=c},function(e,t,n){function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var r=n(3),s=n(4),o=n(7),a=function(){function e(t,n){var i=n.location,r=void 0===i?0:i,s=n.distance,a=void 0===s?100:s,c=n.threshold,l=void 0===c?.6:c,d=n.maxPatternLength,u=void 0===d?32:d,h=n.isCaseSensitive,m=void 0!==h&&h,f=n.tokenSeparator,p=void 0===f?/ +/g:f,g=n.findAllMatches,v=void 0!==g&&g,b=n.minMatchCharLength,y=void 0===b?1:b;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options={location:r,distance:a,threshold:l,maxPatternLength:u,isCaseSensitive:m,tokenSeparator:p,findAllMatches:v,minMatchCharLength:y},this.pattern=this.options.isCaseSensitive?t:t.toLowerCase(),this.pattern.length<=u&&(this.patternAlphabet=o(this.pattern))}var t,n;return t=e,(n=[{key:"search",value:function(e){if(this.options.isCaseSensitive||(e=e.toLowerCase()),this.pattern===e)return{isMatch:!0,score:0,matchedIndices:[[0,e.length-1]]};var t=this.options,n=t.maxPatternLength,i=t.tokenSeparator;if(this.pattern.length>n)return r(e,this.pattern,i);var o=this.options,a=o.location,c=o.distance,l=o.threshold,d=o.findAllMatches,u=o.minMatchCharLength;return s(e,this.pattern,this.patternAlphabet,{location:a,distance:c,threshold:l,findAllMatches:d,minMatchCharLength:u})}}])&&i(t.prototype,n),e}();e.exports=a},function(e,t){var n=/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g;e.exports=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:/ +/g,r=new RegExp(t.replace(n,"\\$&").replace(i,"|")),s=e.match(r),o=!!s,a=[];if(o)for(var c=0,l=s.length;c<l;c+=1){var d=s[c];a.push([e.indexOf(d),d.length-1])}return{score:o?.5:1,isMatch:o,matchedIndices:a}}},function(e,t,n){var i=n(5),r=n(6);e.exports=function(e,t,n,s){for(var o=s.location,a=void 0===o?0:o,c=s.distance,l=void 0===c?100:c,d=s.threshold,u=void 0===d?.6:d,h=s.findAllMatches,m=void 0!==h&&h,f=s.minMatchCharLength,p=void 0===f?1:f,g=a,v=e.length,b=u,y=e.indexOf(t,g),w=t.length,E=[],S=0;S<v;S+=1)E[S]=0;if(-1!==y){var _=i(t,{errors:0,currentLocation:y,expectedLocation:g,distance:l});if(b=Math.min(_,b),-1!==(y=e.lastIndexOf(t,g+w))){var C=i(t,{errors:0,currentLocation:y,expectedLocation:g,distance:l});b=Math.min(C,b)}}y=-1;for(var x=[],T=1,D=w+v,L=1<<w-1,A=0;A<w;A+=1){for(var O=0,I=D;O<I;)i(t,{errors:A,currentLocation:g+I,expectedLocation:g,distance:l})<=b?O=I:D=I,I=Math.floor((D-O)/2+O);D=I;var M=Math.max(1,g-I+1),k=m?v:Math.min(g+I,v)+w,P=Array(k+2);P[k+1]=(1<<A)-1;for(var F=k;F>=M;F-=1){var R=F-1,N=n[e.charAt(R)];if(N&&(E[R]=1),P[F]=(P[F+1]<<1|1)&N,0!==A&&(P[F]|=(x[F+1]|x[F])<<1|1|x[F+1]),P[F]&L&&(T=i(t,{errors:A,currentLocation:R,expectedLocation:g,distance:l}))<=b){if(b=T,(y=R)<=g)break;M=Math.max(1,2*g-y)}}if(i(t,{errors:A+1,currentLocation:g,expectedLocation:g,distance:l})>b)break;x=P}return{isMatch:y>=0,score:0===T?.001:T,matchedIndices:r(E,p)}}},function(e,t){e.exports=function(e,t){var n=t.errors,i=void 0===n?0:n,r=t.currentLocation,s=void 0===r?0:r,o=t.expectedLocation,a=void 0===o?0:o,c=t.distance,l=void 0===c?100:c,d=i/e.length,u=Math.abs(a-s);return l?d+u/l:u?1:d}},function(e,t){e.exports=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=[],i=-1,r=-1,s=0,o=e.length;s<o;s+=1){var a=e[s];a&&-1===i?i=s:a||-1===i||((r=s-1)-i+1>=t&&n.push([i,r]),i=-1)}return e[s-1]&&s-i>=t&&n.push([i,s-1]),n}},function(e,t){e.exports=function(e){for(var t={},n=e.length,i=0;i<n;i+=1)t[e.charAt(i)]=0;for(var r=0;r<n;r+=1)t[e.charAt(r)]|=1<<n-r-1;return t}},function(e,t,n){var i=n(0);e.exports=function(e,t){return function e(t,n,r){if(n){var s=n.indexOf("."),o=n,a=null;-1!==s&&(o=n.slice(0,s),a=n.slice(s+1));var c=t[o];if(null!=c)if(a||"string"!=typeof c&&"number"!=typeof c)if(i(c))for(var l=0,d=c.length;l<d;l+=1)e(c[l],a,r);else a&&e(c,a,r);else r.push(c.toString())}else r.push(t);return r}(e,t,[])}}])},function(e,t,n){"use strict";function i(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}n.d(t,"a",(function(){return i}))},function(e,t,n){e.exports=n(7)},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,n){"use strict";n.r(t);var i=n(2),r=n.n(i),s=n(0),o=n.n(s),a=n(1),c=function(){return Math.random().toString(36).substring(7).split("").join(".")},l={INIT:"@@redux/INIT"+c(),REPLACE:"@@redux/REPLACE"+c(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+c()}};function d(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function u(e,t,n){var i;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function.");if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error("Expected the enhancer to be a function.");return n(u)(e,t)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var r=e,s=t,o=[],c=o,h=!1;function m(){c===o&&(c=o.slice())}function f(){if(h)throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return s}function p(e){if("function"!=typeof e)throw new Error("Expected the listener to be a function.");if(h)throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.");var t=!0;return m(),c.push(e),function(){if(t){if(h)throw new Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.");t=!1,m();var n=c.indexOf(e);c.splice(n,1)}}}function g(e){if(!d(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(h)throw new Error("Reducers may not dispatch actions.");try{h=!0,s=r(s,e)}finally{h=!1}for(var t=o=c,n=0;n<t.length;n++)(0,t[n])();return e}function v(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");r=e,g({type:l.REPLACE})}function b(){var e,t=p;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new TypeError("Expected the observer to be an object.");function n(){e.next&&e.next(f())}return n(),{unsubscribe:t(n)}}})[a.a]=function(){return this},e}return g({type:l.INIT}),(i={dispatch:g,subscribe:p,getState:f,replaceReducer:v})[a.a]=b,i}function h(e,t){var n=t&&t.type;return"Given "+(n&&'action "'+String(n)+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}var m,f=[],p=[],g=[],v={loading:!1},b=function(e,t){switch(void 0===e&&(e=v),t.type){case"SET_IS_LOADING":return{loading:t.isLoading};default:return e}},y=function(e){return Array.from({length:e},(function(){return(e=0,t=36,Math.floor(Math.random()*(t-e)+e)).toString(36);var e,t})).join("")},w=function(e){return Object.prototype.toString.call(e).slice(8,-1)},E=function(e,t){return null!=t&&w(t)===e},S=function(e){return"string"!=typeof e?e:e.replace(/&/g,"&amp;").replace(/>/g,"&rt;").replace(/</g,"&lt;").replace(/"/g,"&quot;")},_=(m=document.createElement("div"),function(e){var t=e.trim();m.innerHTML=t;for(var n=m.children[0];m.firstChild;)m.removeChild(m.firstChild);return n}),C=function(e,t){return e.score-t.score},x=function(e){return JSON.parse(JSON.stringify(e))},T=function(e){for(var t=Object.keys(e),n={},i=0;i<t.length;i++){var r=t[i];"function"==typeof e[r]&&(n[r]=e[r])}var s,o=Object.keys(n);try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:l.INIT}))throw new Error('Reducer "'+t+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===n(void 0,{type:l.PROBE_UNKNOWN_ACTION()}))throw new Error('Reducer "'+t+"\" returned undefined when probed with a random type. Don't try to handle "+l.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')}))}(n)}catch(e){s=e}return function(e,t){if(void 0===e&&(e={}),s)throw s;for(var i=!1,r={},a=0;a<o.length;a++){var c=o[a],l=n[c],d=e[c],u=l(d,t);if(void 0===u){var m=h(c,t);throw new Error(m)}r[c]=u,i=i||u!==d}return i?r:e}}({items:function(e,t){switch(void 0===e&&(e=f),t.type){case"ADD_ITEM":return[].concat(e,[{id:t.id,choiceId:t.choiceId,groupId:t.groupId,value:t.value,label:t.label,active:!0,highlighted:!1,customProperties:t.customProperties,placeholder:t.placeholder||!1,keyCode:null}]).map((function(e){var t=e;return t.highlighted=!1,t}));case"REMOVE_ITEM":return e.map((function(e){var n=e;return n.id===t.id&&(n.active=!1),n}));case"HIGHLIGHT_ITEM":return e.map((function(e){var n=e;return n.id===t.id&&(n.highlighted=t.highlighted),n}));default:return e}},groups:function(e,t){switch(void 0===e&&(e=p),t.type){case"ADD_GROUP":return[].concat(e,[{id:t.id,value:t.value,active:t.active,disabled:t.disabled}]);case"CLEAR_CHOICES":return[];default:return e}},choices:function(e,t){switch(void 0===e&&(e=g),t.type){case"ADD_CHOICE":return[].concat(e,[{id:t.id,elementId:t.elementId,groupId:t.groupId,value:t.value,label:t.label||t.value,disabled:t.disabled||!1,selected:!1,active:!0,score:9999,customProperties:t.customProperties,placeholder:t.placeholder||!1,keyCode:null}]);case"ADD_ITEM":return t.activateOptions?e.map((function(e){var n=e;return n.active=t.active,n})):t.choiceId>-1?e.map((function(e){var n=e;return n.id===parseInt(t.choiceId,10)&&(n.selected=!0),n})):e;case"REMOVE_ITEM":return t.choiceId>-1?e.map((function(e){var n=e;return n.id===parseInt(t.choiceId,10)&&(n.selected=!1),n})):e;case"FILTER_CHOICES":return e.map((function(e){var n=e;return n.active=t.results.some((function(e){var t=e.item,i=e.score;return t.id===n.id&&(n.score=i,!0)})),n}));case"ACTIVATE_CHOICES":return e.map((function(e){var n=e;return n.active=t.active,n}));case"CLEAR_CHOICES":return g;default:return e}},general:b}),D=function(e,t){var n=e;if("CLEAR_ALL"===t.type)n=void 0;else if("RESET_TO"===t.type)return x(t.state);return T(n,t)};function L(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var A=function(){function e(){this._store=u(D,window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__())}var t,n,i,r=e.prototype;return r.subscribe=function(e){this._store.subscribe(e)},r.dispatch=function(e){this._store.dispatch(e)},r.isLoading=function(){return this.state.general.loading},r.getChoiceById=function(e){return this.activeChoices.find((function(t){return t.id===parseInt(e,10)}))},r.getGroupById=function(e){return this.groups.find((function(t){return t.id===e}))},t=e,(n=[{key:"state",get:function(){return this._store.getState()}},{key:"items",get:function(){return this.state.items}},{key:"activeItems",get:function(){return this.items.filter((function(e){return!0===e.active}))}},{key:"highlightedActiveItems",get:function(){return this.items.filter((function(e){return e.active&&e.highlighted}))}},{key:"choices",get:function(){return this.state.choices}},{key:"activeChoices",get:function(){return this.choices.filter((function(e){return!0===e.active}))}},{key:"selectableChoices",get:function(){return this.choices.filter((function(e){return!0!==e.disabled}))}},{key:"searchableChoices",get:function(){return this.selectableChoices.filter((function(e){return!0!==e.placeholder}))}},{key:"placeholderChoice",get:function(){return[].concat(this.choices).reverse().find((function(e){return!0===e.placeholder}))}},{key:"groups",get:function(){return this.state.groups}},{key:"activeGroups",get:function(){var e=this.groups,t=this.choices;return e.filter((function(e){var n=!0===e.active&&!1===e.disabled,i=t.some((function(e){return!0===e.active&&!1===e.disabled}));return n&&i}),[])}}])&&L(t.prototype,n),i&&L(t,i),e}();function O(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var I=function(){function e(e){var t=e.element,n=e.type,i=e.classNames;this.element=t,this.classNames=i,this.type=n,this.isActive=!1}var t,n,i,r=e.prototype;return r.getChild=function(e){return this.element.querySelector(e)},r.show=function(){return this.element.classList.add(this.classNames.activeState),this.element.setAttribute("aria-expanded","true"),this.isActive=!0,this},r.hide=function(){return this.element.classList.remove(this.classNames.activeState),this.element.setAttribute("aria-expanded","false"),this.isActive=!1,this},t=e,(n=[{key:"distanceFromTopWindow",get:function(){return this.element.getBoundingClientRect().bottom}}])&&O(t.prototype,n),i&&O(t,i),e}(),M={items:[],choices:[],silent:!1,renderChoiceLimit:-1,maxItemCount:-1,addItems:!0,addItemFilter:null,removeItems:!0,removeItemButton:!1,editItems:!1,duplicateItemsAllowed:!0,delimiter:",",paste:!0,searchEnabled:!0,searchChoices:!0,searchFloor:1,searchResultLimit:4,searchFields:["label","value"],position:"auto",resetScrollPosition:!0,shouldSort:!0,shouldSortItems:!1,sorter:function(e,t){var n=e.value,i=e.label,r=void 0===i?n:i,s=t.value,o=t.label,a=void 0===o?s:o;return r.localeCompare(a,[],{sensitivity:"base",ignorePunctuation:!0,numeric:!0})},placeholder:!0,placeholderValue:null,searchPlaceholderValue:null,prependValue:null,appendValue:null,renderSelectedChoices:"auto",loadingText:"Loading...",noResultsText:"No results found",noChoicesText:"No choices to choose from",itemSelectText:"Press to select",uniqueItemText:"Only unique values can be added",customAddItemText:"Only values matching specific conditions can be added",addItemText:function(e){return'Press Enter to add <b>"'+S(e)+'"</b>'},maxItemText:function(e){return"Only "+e+" values can be added"},valueComparer:function(e,t){return e===t},fuseOptions:{includeScore:!0},callbackOnInit:null,callbackOnCreateTemplates:null,classNames:{containerOuter:"choices",containerInner:"choices__inner",input:"choices__input",inputCloned:"choices__input--cloned",list:"choices__list",listItems:"choices__list--multiple",listSingle:"choices__list--single",listDropdown:"choices__list--dropdown",item:"choices__item",itemSelectable:"choices__item--selectable",itemDisabled:"choices__item--disabled",itemChoice:"choices__item--choice",placeholder:"choices__placeholder",group:"choices__group",groupHeading:"choices__heading",button:"choices__button",activeState:"is-active",focusState:"is-focused",openState:"is-open",disabledState:"is-disabled",highlightedState:"is-highlighted",selectedState:"is-selected",flippedState:"is-flipped",loadingState:"is-loading",noResults:"has-no-results",noChoices:"has-no-choices"}},k="showDropdown",P="hideDropdown",F="change",R="choice",N="search",j="addItem",H="removeItem",B="highlightItem",q="highlightChoice",V="ADD_CHOICE",W="FILTER_CHOICES",$="ACTIVATE_CHOICES",U="CLEAR_CHOICES",Y="ADD_GROUP",K="ADD_ITEM",z="REMOVE_ITEM",G="HIGHLIGHT_ITEM",J=46,X=8,Z=13,Q=65,ee=27,te=38,ne=40,ie=33,re=34,se=function(){function e(e){var t=e.element,n=e.type,i=e.classNames,r=e.position;this.element=t,this.classNames=i,this.type=n,this.position=r,this.isOpen=!1,this.isFlipped=!1,this.isFocussed=!1,this.isDisabled=!1,this.isLoading=!1,this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this)}var t=e.prototype;return t.addEventListeners=function(){this.element.addEventListener("focus",this._onFocus),this.element.addEventListener("blur",this._onBlur)},t.removeEventListeners=function(){this.element.removeEventListener("focus",this._onFocus),this.element.removeEventListener("blur",this._onBlur)},t.shouldFlip=function(e){if("number"!=typeof e)return!1;var t=!1;return"auto"===this.position?t=!window.matchMedia("(min-height: "+(e+1)+"px)").matches:"top"===this.position&&(t=!0),t},t.setActiveDescendant=function(e){this.element.setAttribute("aria-activedescendant",e)},t.removeActiveDescendant=function(){this.element.removeAttribute("aria-activedescendant")},t.open=function(e){this.element.classList.add(this.classNames.openState),this.element.setAttribute("aria-expanded","true"),this.isOpen=!0,this.shouldFlip(e)&&(this.element.classList.add(this.classNames.flippedState),this.isFlipped=!0)},t.close=function(){this.element.classList.remove(this.classNames.openState),this.element.setAttribute("aria-expanded","false"),this.removeActiveDescendant(),this.isOpen=!1,this.isFlipped&&(this.element.classList.remove(this.classNames.flippedState),this.isFlipped=!1)},t.focus=function(){this.isFocussed||this.element.focus()},t.addFocusState=function(){this.element.classList.add(this.classNames.focusState)},t.removeFocusState=function(){this.element.classList.remove(this.classNames.focusState)},t.enable=function(){this.element.classList.remove(this.classNames.disabledState),this.element.removeAttribute("aria-disabled"),"select-one"===this.type&&this.element.setAttribute("tabindex","0"),this.isDisabled=!1},t.disable=function(){this.element.classList.add(this.classNames.disabledState),this.element.setAttribute("aria-disabled","true"),"select-one"===this.type&&this.element.setAttribute("tabindex","-1"),this.isDisabled=!0},t.wrap=function(e){!function(e,t){void 0===t&&(t=document.createElement("div")),e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),t.appendChild(e)}(e,this.element)},t.unwrap=function(e){this.element.parentNode.insertBefore(e,this.element),this.element.parentNode.removeChild(this.element)},t.addLoadingState=function(){this.element.classList.add(this.classNames.loadingState),this.element.setAttribute("aria-busy","true"),this.isLoading=!0},t.removeLoadingState=function(){this.element.classList.remove(this.classNames.loadingState),this.element.removeAttribute("aria-busy"),this.isLoading=!1},t._onFocus=function(){this.isFocussed=!0},t._onBlur=function(){this.isFocussed=!1},e}();function oe(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var ae=function(){function e(e){var t=e.element,n=e.type,i=e.classNames,r=e.preventPaste;this.element=t,this.type=n,this.classNames=i,this.preventPaste=r,this.isFocussed=this.element===document.activeElement,this.isDisabled=t.disabled,this._onPaste=this._onPaste.bind(this),this._onInput=this._onInput.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this)}var t,n,i,r=e.prototype;return r.addEventListeners=function(){this.element.addEventListener("paste",this._onPaste),this.element.addEventListener("input",this._onInput,{passive:!0}),this.element.addEventListener("focus",this._onFocus,{passive:!0}),this.element.addEventListener("blur",this._onBlur,{passive:!0})},r.removeEventListeners=function(){this.element.removeEventListener("input",this._onInput,{passive:!0}),this.element.removeEventListener("paste",this._onPaste),this.element.removeEventListener("focus",this._onFocus,{passive:!0}),this.element.removeEventListener("blur",this._onBlur,{passive:!0})},r.enable=function(){this.element.removeAttribute("disabled"),this.isDisabled=!1},r.disable=function(){this.element.setAttribute("disabled",""),this.isDisabled=!0},r.focus=function(){this.isFocussed||this.element.focus()},r.blur=function(){this.isFocussed&&this.element.blur()},r.clear=function(e){return void 0===e&&(e=!0),this.element.value&&(this.element.value=""),e&&this.setWidth(),this},r.setWidth=function(){var e=this.element,t=e.style,n=e.value,i=e.placeholder;t.minWidth=i.length+1+"ch",t.width=n.length+1+"ch"},r.setActiveDescendant=function(e){this.element.setAttribute("aria-activedescendant",e)},r.removeActiveDescendant=function(){this.element.removeAttribute("aria-activedescendant")},r._onInput=function(){"select-one"!==this.type&&this.setWidth()},r._onPaste=function(e){this.preventPaste&&e.preventDefault()},r._onFocus=function(){this.isFocussed=!0},r._onBlur=function(){this.isFocussed=!1},t=e,(n=[{key:"placeholder",set:function(e){this.element.placeholder=e}},{key:"value",get:function(){return S(this.element.value)},set:function(e){this.element.value=e}}])&&oe(t.prototype,n),i&&oe(t,i),e}(),ce=function(){function e(e){var t=e.element;this.element=t,this.scrollPos=this.element.scrollTop,this.height=this.element.offsetHeight}var t=e.prototype;return t.clear=function(){this.element.innerHTML=""},t.append=function(e){this.element.appendChild(e)},t.getChild=function(e){return this.element.querySelector(e)},t.hasChildren=function(){return this.element.hasChildNodes()},t.scrollToTop=function(){this.element.scrollTop=0},t.scrollToChildElement=function(e,t){var n=this;if(e){var i=this.element.offsetHeight,r=this.element.scrollTop+i,s=e.offsetHeight,o=e.offsetTop+s,a=t>0?this.element.scrollTop+o-r:e.offsetTop;requestAnimationFrame((function(){n._animateScroll(a,t)}))}},t._scrollDown=function(e,t,n){var i=(n-e)/t,r=i>1?i:1;this.element.scrollTop=e+r},t._scrollUp=function(e,t,n){var i=(e-n)/t,r=i>1?i:1;this.element.scrollTop=e-r},t._animateScroll=function(e,t){var n=this,i=this.element.scrollTop,r=!1;t>0?(this._scrollDown(i,4,e),i<e&&(r=!0)):(this._scrollUp(i,4,e),i>e&&(r=!0)),r&&requestAnimationFrame((function(){n._animateScroll(e,t)}))},e}();function le(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var de=function(){function e(e){var t=e.element,n=e.classNames;if(this.element=t,this.classNames=n,!(t instanceof HTMLInputElement||t instanceof HTMLSelectElement))throw new TypeError("Invalid element passed");this.isDisabled=!1}var t,n,i,r=e.prototype;return r.conceal=function(){this.element.classList.add(this.classNames.input),this.element.hidden=!0,this.element.tabIndex=-1;var e=this.element.getAttribute("style");e&&this.element.setAttribute("data-choice-orig-style",e),this.element.setAttribute("data-choice","active")},r.reveal=function(){this.element.classList.remove(this.classNames.input),this.element.hidden=!1,this.element.removeAttribute("tabindex");var e=this.element.getAttribute("data-choice-orig-style");e?(this.element.removeAttribute("data-choice-orig-style"),this.element.setAttribute("style",e)):this.element.removeAttribute("style"),this.element.removeAttribute("data-choice"),this.element.value=this.element.value},r.enable=function(){this.element.removeAttribute("disabled"),this.element.disabled=!1,this.isDisabled=!1},r.disable=function(){this.element.setAttribute("disabled",""),this.element.disabled=!0,this.isDisabled=!0},r.triggerEvent=function(e,t){!function(e,t,n){void 0===n&&(n=null);var i=new CustomEvent(t,{detail:n,bubbles:!0,cancelable:!0});e.dispatchEvent(i)}(this.element,e,t)},t=e,(n=[{key:"isActive",get:function(){return"active"===this.element.dataset.choice}},{key:"dir",get:function(){return this.element.dir}},{key:"value",get:function(){return this.element.value},set:function(e){this.element.value=e}}])&&le(t.prototype,n),i&&le(t,i),e}();function ue(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var he=function(e){var t,n,i,r,s;function o(t){var n,i=t.element,r=t.classNames,s=t.delimiter;return(n=e.call(this,{element:i,classNames:r})||this).delimiter=s,n}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,i=o,(r=[{key:"value",get:function(){return this.element.value},set:function(e){var t=e.map((function(e){return e.value})).join(this.delimiter);this.element.setAttribute("value",t),this.element.value=t}}])&&ue(i.prototype,r),s&&ue(i,s),o}(de);function me(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var fe=function(e){var t,n,i,r,s;function o(t){var n,i=t.element,r=t.classNames,s=t.template;return(n=e.call(this,{element:i,classNames:r})||this).template=s,n}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,o.prototype.appendDocFragment=function(e){this.element.innerHTML="",this.element.appendChild(e)},i=o,(r=[{key:"placeholderOption",get:function(){return this.element.querySelector('option[value=""]')||this.element.querySelector("option[placeholder]")}},{key:"optionGroups",get:function(){return Array.from(this.element.getElementsByTagName("OPTGROUP"))}},{key:"options",get:function(){return Array.from(this.element.options)},set:function(e){var t=this,n=document.createDocumentFragment();e.forEach((function(e){return i=e,r=t.template(i),void n.appendChild(r);var i,r})),this.appendDocFragment(n)}}])&&me(i.prototype,r),s&&me(i,s),o}(de),pe={containerOuter:function(e,t,n,i,r,s){var o=e.containerOuter,a=Object.assign(document.createElement("div"),{className:o});return a.dataset.type=s,t&&(a.dir=t),i&&(a.tabIndex=0),n&&(a.setAttribute("role",r?"combobox":"listbox"),r&&a.setAttribute("aria-autocomplete","list")),a.setAttribute("aria-haspopup","true"),a.setAttribute("aria-expanded","false"),a},containerInner:function(e){var t=e.containerInner;return Object.assign(document.createElement("div"),{className:t})},itemList:function(e,t){var n=e.list,i=e.listSingle,r=e.listItems;return Object.assign(document.createElement("div"),{className:n+" "+(t?i:r)})},placeholder:function(e,t){var n=e.placeholder;return Object.assign(document.createElement("div"),{className:n,innerHTML:t})},item:function(e,t,n){var i=e.item,r=e.button,s=e.highlightedState,o=e.itemSelectable,a=e.placeholder,c=t.id,l=t.value,d=t.label,u=t.customProperties,h=t.active,m=t.disabled,f=t.highlighted,p=t.placeholder,g=Object.assign(document.createElement("div"),{className:i,innerHTML:d});if(Object.assign(g.dataset,{item:"",id:c,value:l,customProperties:u}),h&&g.setAttribute("aria-selected","true"),m&&g.setAttribute("aria-disabled","true"),p&&g.classList.add(a),g.classList.add(f?s:o),n){m&&g.classList.remove(o),g.dataset.deletable="";var v=Object.assign(document.createElement("button"),{type:"button",className:r,innerHTML:"Remove item"});v.setAttribute("aria-label","Remove item: '"+l+"'"),v.dataset.button="",g.appendChild(v)}return g},choiceList:function(e,t){var n=e.list,i=Object.assign(document.createElement("div"),{className:n});return t||i.setAttribute("aria-multiselectable","true"),i.setAttribute("role","listbox"),i},choiceGroup:function(e,t){var n=e.group,i=e.groupHeading,r=e.itemDisabled,s=t.id,o=t.value,a=t.disabled,c=Object.assign(document.createElement("div"),{className:n+" "+(a?r:"")});return c.setAttribute("role","group"),Object.assign(c.dataset,{group:"",id:s,value:o}),a&&c.setAttribute("aria-disabled","true"),c.appendChild(Object.assign(document.createElement("div"),{className:i,innerHTML:o})),c},choice:function(e,t,n){var i=e.item,r=e.itemChoice,s=e.itemSelectable,o=e.selectedState,a=e.itemDisabled,c=e.placeholder,l=t.id,d=t.value,u=t.label,h=t.groupId,m=t.elementId,f=t.disabled,p=t.selected,g=t.placeholder,v=Object.assign(document.createElement("div"),{id:m,innerHTML:u,className:i+" "+r});return p&&v.classList.add(o),g&&v.classList.add(c),v.setAttribute("role",h>0?"treeitem":"option"),Object.assign(v.dataset,{choice:"",id:l,value:d,selectText:n}),f?(v.classList.add(a),v.dataset.choiceDisabled="",v.setAttribute("aria-disabled","true")):(v.classList.add(s),v.dataset.choiceSelectable=""),v},input:function(e,t){var n=e.input,i=e.inputCloned,r=Object.assign(document.createElement("input"),{type:"text",className:n+" "+i,autocomplete:"off",autocapitalize:"off",spellcheck:!1});return r.setAttribute("role","textbox"),r.setAttribute("aria-autocomplete","list"),r.setAttribute("aria-label",t),r},dropdown:function(e){var t=e.list,n=e.listDropdown,i=document.createElement("div");return i.classList.add(t,n),i.setAttribute("aria-expanded","false"),i},notice:function(e,t,n){var i=e.item,r=e.itemChoice,s=e.noResults,o=e.noChoices;void 0===n&&(n="");var a=[i,r];return"no-choices"===n?a.push(o):"no-results"===n&&a.push(s),Object.assign(document.createElement("div"),{innerHTML:t,className:a.join(" ")})},option:function(e){var t=e.label,n=e.value,i=e.customProperties,r=e.active,s=e.disabled,o=new Option(t,n,!1,r);return i&&(o.dataset.customProperties=i),o.disabled=s,o}},ge=function(e){return void 0===e&&(e=!0),{type:$,active:e}},ve=function(e,t){return{type:G,id:e,highlighted:t}},be=function(e){var t=e.value,n=e.id,i=e.active,r=e.disabled;return{type:Y,value:t,id:n,active:i,disabled:r}},ye=function(e){return{type:"SET_IS_LOADING",isLoading:e}};function we(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var Ee="-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style,Se={},_e=function(){var e,t,n;function i(e,t){var n=this;void 0===e&&(e="[data-choice]"),void 0===t&&(t={}),this.config=o.a.all([M,i.defaults.options,t],{arrayMerge:function(e,t){return[].concat(t)}});var r,s,a,c,l=(r=this.config,s=M,a=Object.keys(r).sort(),c=Object.keys(s).sort(),a.filter((function(e){return c.indexOf(e)<0})));l.length&&console.warn("Unknown config option(s) passed",l.join(", "));var d="string"==typeof e?document.querySelector(e):e;if(!(d instanceof HTMLInputElement||d instanceof HTMLSelectElement))throw TypeError("Expected one of the following types text|select-one|select-multiple");if(this._isTextElement="text"===d.type,this._isSelectOneElement="select-one"===d.type,this._isSelectMultipleElement="select-multiple"===d.type,this._isSelectElement=this._isSelectOneElement||this._isSelectMultipleElement,this.config.searchEnabled=this._isSelectMultipleElement||this.config.searchEnabled,["auto","always"].includes(this.config.renderSelectedChoices)||(this.config.renderSelectedChoices="auto"),t.addItemFilter&&"function"!=typeof t.addItemFilter){var u=t.addItemFilter instanceof RegExp?t.addItemFilter:new RegExp(t.addItemFilter);this.config.addItemFilter=u.test.bind(u)}if(this._isTextElement?this.passedElement=new he({element:d,classNames:this.config.classNames,delimiter:this.config.delimiter}):this.passedElement=new fe({element:d,classNames:this.config.classNames,template:function(e){return n._templates.option(e)}}),this.initialised=!1,this._store=new A,this._initialState={},this._currentState={},this._prevState={},this._currentValue="",this._canSearch=this.config.searchEnabled,this._isScrollingOnIe=!1,this._highlightPosition=0,this._wasTap=!0,this._placeholderValue=this._generatePlaceholderValue(),this._baseId=function(e,t){var n=e.id||e.name&&e.name+"-"+y(2)||y(4);return n=t+"-"+(n=n.replace(/(:|\.|\[|\]|,)/g,""))}(this.passedElement.element,"choices-"),this._direction=this.passedElement.dir,!this._direction){var h=window.getComputedStyle(this.passedElement.element).direction;h!==window.getComputedStyle(document.documentElement).direction&&(this._direction=h)}if(this._idNames={itemChoice:"item-choice"},this._presetGroups=this.passedElement.optionGroups,this._presetOptions=this.passedElement.options,this._presetChoices=this.config.choices,this._presetItems=this.config.items,this.passedElement.value&&(this._presetItems=this._presetItems.concat(this.passedElement.value.split(this.config.delimiter))),this.passedElement.options&&this.passedElement.options.forEach((function(e){n._presetChoices.push({value:e.value,label:e.innerHTML,selected:e.selected,disabled:e.disabled||e.parentNode.disabled,placeholder:""===e.value||e.hasAttribute("placeholder"),customProperties:e.getAttribute("data-custom-properties")})})),this._render=this._render.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this),this._onKeyUp=this._onKeyUp.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onClick=this._onClick.bind(this),this._onTouchMove=this._onTouchMove.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onMouseDown=this._onMouseDown.bind(this),this._onMouseOver=this._onMouseOver.bind(this),this._onFormReset=this._onFormReset.bind(this),this._onAKey=this._onAKey.bind(this),this._onEnterKey=this._onEnterKey.bind(this),this._onEscapeKey=this._onEscapeKey.bind(this),this._onDirectionKey=this._onDirectionKey.bind(this),this._onDeleteKey=this._onDeleteKey.bind(this),this.passedElement.isActive)return this.config.silent||console.warn("Trying to initialise Choices on element already initialised"),void(this.initialised=!0);this.init()}e=i,n=[{key:"defaults",get:function(){return Object.preventExtensions({get options(){return Se},get templates(){return pe}})}}],(t=null)&&we(e.prototype,t),n&&we(e,n);var s=i.prototype;return s.init=function(){if(!this.initialised){this._createTemplates(),this._createElements(),this._createStructure(),this._initialState=x(this._store.state),this._store.subscribe(this._render),this._render(),this._addEventListeners(),(!this.config.addItems||this.passedElement.element.hasAttribute("disabled"))&&this.disable(),this.initialised=!0;var e=this.config.callbackOnInit;e&&"function"==typeof e&&e.call(this)}},s.destroy=function(){this.initialised&&(this._removeEventListeners(),this.passedElement.reveal(),this.containerOuter.unwrap(this.passedElement.element),this.clearStore(),this._isSelectElement&&(this.passedElement.options=this._presetOptions),this._templates=null,this.initialised=!1)},s.enable=function(){return this.passedElement.isDisabled&&this.passedElement.enable(),this.containerOuter.isDisabled&&(this._addEventListeners(),this.input.enable(),this.containerOuter.enable()),this},s.disable=function(){return this.passedElement.isDisabled||this.passedElement.disable(),this.containerOuter.isDisabled||(this._removeEventListeners(),this.input.disable(),this.containerOuter.disable()),this},s.highlightItem=function(e,t){if(void 0===t&&(t=!0),!e)return this;var n=e.id,i=e.groupId,r=void 0===i?-1:i,s=e.value,o=void 0===s?"":s,a=e.label,c=void 0===a?"":a,l=r>=0?this._store.getGroupById(r):null;return this._store.dispatch(ve(n,!0)),t&&this.passedElement.triggerEvent(B,{id:n,value:o,label:c,groupValue:l&&l.value?l.value:null}),this},s.unhighlightItem=function(e){if(!e)return this;var t=e.id,n=e.groupId,i=void 0===n?-1:n,r=e.value,s=void 0===r?"":r,o=e.label,a=void 0===o?"":o,c=i>=0?this._store.getGroupById(i):null;return this._store.dispatch(ve(t,!1)),this.passedElement.triggerEvent(B,{id:t,value:s,label:a,groupValue:c&&c.value?c.value:null}),this},s.highlightAll=function(){var e=this;return this._store.items.forEach((function(t){return e.highlightItem(t)})),this},s.unhighlightAll=function(){var e=this;return this._store.items.forEach((function(t){return e.unhighlightItem(t)})),this},s.removeActiveItemsByValue=function(e){var t=this;return this._store.activeItems.filter((function(t){return t.value===e})).forEach((function(e){return t._removeItem(e)})),this},s.removeActiveItems=function(e){var t=this;return this._store.activeItems.filter((function(t){return t.id!==e})).forEach((function(e){return t._removeItem(e)})),this},s.removeHighlightedItems=function(e){var t=this;return void 0===e&&(e=!1),this._store.highlightedActiveItems.forEach((function(n){t._removeItem(n),e&&t._triggerChange(n.value)})),this},s.showDropdown=function(e){var t=this;return this.dropdown.isActive||requestAnimationFrame((function(){t.dropdown.show(),t.containerOuter.open(t.dropdown.distanceFromTopWindow),!e&&t._canSearch&&t.input.focus(),t.passedElement.triggerEvent(k,{})})),this},s.hideDropdown=function(e){var t=this;return this.dropdown.isActive?(requestAnimationFrame((function(){t.dropdown.hide(),t.containerOuter.close(),!e&&t._canSearch&&(t.input.removeActiveDescendant(),t.input.blur()),t.passedElement.triggerEvent(P,{})})),this):this},s.getValue=function(e){void 0===e&&(e=!1);var t=this._store.activeItems.reduce((function(t,n){var i=e?n.value:n;return t.push(i),t}),[]);return this._isSelectOneElement?t[0]:t},s.setValue=function(e){var t=this;return this.initialised?(e.forEach((function(e){return t._setChoiceOrItem(e)})),this):this},s.setChoiceByValue=function(e){var t=this;return!this.initialised||this._isTextElement||(Array.isArray(e)?e:[e]).forEach((function(e){return t._findAndSelectChoiceByValue(e)})),this},s.setChoices=function(e,t,n,i){var r=this;if(void 0===e&&(e=[]),void 0===t&&(t="value"),void 0===n&&(n="label"),void 0===i&&(i=!1),!this.initialised)throw new ReferenceError("setChoices was called on a non-initialized instance of Choices");if(!this._isSelectElement)throw new TypeError("setChoices can't be used with INPUT based Choices");if("string"!=typeof t||!t)throw new TypeError("value parameter must be a name of 'value' field in passed objects");if(i&&this.clearChoices(),"function"==typeof e){var s=e(this);if("function"==typeof Promise&&s instanceof Promise)return new Promise((function(e){return requestAnimationFrame(e)})).then((function(){return r._handleLoadingState(!0)})).then((function(){return s})).then((function(e){return r.setChoices(e,t,n,i)})).catch((function(e){r.config.silent||console.error(e)})).then((function(){return r._handleLoadingState(!1)})).then((function(){return r}));if(!Array.isArray(s))throw new TypeError(".setChoices first argument function must return either array of choices or Promise, got: "+typeof s);return this.setChoices(s,t,n,!1)}if(!Array.isArray(e))throw new TypeError(".setChoices must be called either with array of choices with a function resulting into Promise of array of choices");return this.containerOuter.removeLoadingState(),this._startLoading(),e.forEach((function(e){e.choices?r._addGroup({id:parseInt(e.id,10)||null,group:e,valueKey:t,labelKey:n}):r._addChoice({value:e[t],label:e[n],isSelected:e.selected,isDisabled:e.disabled,customProperties:e.customProperties,placeholder:e.placeholder})})),this._stopLoading(),this},s.clearChoices=function(){return this._store.dispatch({type:U}),this},s.clearStore=function(){return this._store.dispatch({type:"CLEAR_ALL"}),this},s.clearInput=function(){var e=!this._isSelectOneElement;return this.input.clear(e),!this._isTextElement&&this._canSearch&&(this._isSearching=!1,this._store.dispatch(ge(!0))),this},s._render=function(){if(!this._store.isLoading()){this._currentState=this._store.state;var e=this._currentState.choices!==this._prevState.choices||this._currentState.groups!==this._prevState.groups||this._currentState.items!==this._prevState.items,t=this._isSelectElement,n=this._currentState.items!==this._prevState.items;e&&(t&&this._renderChoices(),n&&this._renderItems(),this._prevState=this._currentState)}},s._renderChoices=function(){var e=this,t=this._store,n=t.activeGroups,i=t.activeChoices,r=document.createDocumentFragment();if(this.choiceList.clear(),this.config.resetScrollPosition&&requestAnimationFrame((function(){return e.choiceList.scrollToTop()})),n.length>=1&&!this._isSearching){var s=i.filter((function(e){return!0===e.placeholder&&-1===e.groupId}));s.length>=1&&(r=this._createChoicesFragment(s,r)),r=this._createGroupsFragment(n,i,r)}else i.length>=1&&(r=this._createChoicesFragment(i,r));if(r.childNodes&&r.childNodes.length>0){var o=this._store.activeItems,a=this._canAddItem(o,this.input.value);a.response?(this.choiceList.append(r),this._highlightChoice()):this.choiceList.append(this._getTemplate("notice",a.notice))}else{var c,l;this._isSearching?(l="function"==typeof this.config.noResultsText?this.config.noResultsText():this.config.noResultsText,c=this._getTemplate("notice",l,"no-results")):(l="function"==typeof this.config.noChoicesText?this.config.noChoicesText():this.config.noChoicesText,c=this._getTemplate("notice",l,"no-choices")),this.choiceList.append(c)}},s._renderItems=function(){var e=this._store.activeItems||[];this.itemList.clear();var t=this._createItemsFragment(e);t.childNodes&&this.itemList.append(t)},s._createGroupsFragment=function(e,t,n){var i=this;return void 0===n&&(n=document.createDocumentFragment()),this.config.shouldSort&&e.sort(this.config.sorter),e.forEach((function(e){var r=function(e){return t.filter((function(t){return i._isSelectOneElement?t.groupId===e.id:t.groupId===e.id&&("always"===i.config.renderSelectedChoices||!t.selected)}))}(e);if(r.length>=1){var s=i._getTemplate("choiceGroup",e);n.appendChild(s),i._createChoicesFragment(r,n,!0)}})),n},s._createChoicesFragment=function(e,t,n){var i=this;void 0===t&&(t=document.createDocumentFragment()),void 0===n&&(n=!1);var r=this.config,s=r.renderSelectedChoices,o=r.searchResultLimit,a=r.renderChoiceLimit,c=this._isSearching?C:this.config.sorter,l=function(e){if("auto"!==s||i._isSelectOneElement||!e.selected){var n=i._getTemplate("choice",e,i.config.itemSelectText);t.appendChild(n)}},d=e;"auto"!==s||this._isSelectOneElement||(d=e.filter((function(e){return!e.selected})));var u=d.reduce((function(e,t){return t.placeholder?e.placeholderChoices.push(t):e.normalChoices.push(t),e}),{placeholderChoices:[],normalChoices:[]}),h=u.placeholderChoices,m=u.normalChoices;(this.config.shouldSort||this._isSearching)&&m.sort(c);var f=d.length,p=this._isSelectOneElement?[].concat(h,m):m;this._isSearching?f=o:a&&a>0&&!n&&(f=a);for(var g=0;g<f;g+=1)p[g]&&l(p[g]);return t},s._createItemsFragment=function(e,t){var n=this;void 0===t&&(t=document.createDocumentFragment());var i=this.config,r=i.shouldSortItems,s=i.sorter,o=i.removeItemButton;return r&&!this._isSelectOneElement&&e.sort(s),this._isTextElement?this.passedElement.value=e:this.passedElement.options=e,e.forEach((function(e){var i=n._getTemplate("item",e,o);t.appendChild(i)})),t},s._triggerChange=function(e){null!=e&&this.passedElement.triggerEvent(F,{value:e})},s._selectPlaceholderChoice=function(){var e=this._store.placeholderChoice;e&&(this._addItem({value:e.value,label:e.label,choiceId:e.id,groupId:e.groupId,placeholder:e.placeholder}),this._triggerChange(e.value))},s._handleButtonAction=function(e,t){if(e&&t&&this.config.removeItems&&this.config.removeItemButton){var n=t.parentNode.getAttribute("data-id"),i=e.find((function(e){return e.id===parseInt(n,10)}));this._removeItem(i),this._triggerChange(i.value),this._isSelectOneElement&&this._selectPlaceholderChoice()}},s._handleItemAction=function(e,t,n){var i=this;if(void 0===n&&(n=!1),e&&t&&this.config.removeItems&&!this._isSelectOneElement){var r=t.getAttribute("data-id");e.forEach((function(e){e.id!==parseInt(r,10)||e.highlighted?!n&&e.highlighted&&i.unhighlightItem(e):i.highlightItem(e)})),this.input.focus()}},s._handleChoiceAction=function(e,t){if(e&&t){var n=t.dataset.id,i=this._store.getChoiceById(n);if(i){var r=e[0]&&e[0].keyCode?e[0].keyCode:null,s=this.dropdown.isActive;i.keyCode=r,this.passedElement.triggerEvent(R,{choice:i}),i.selected||i.disabled||this._canAddItem(e,i.value).response&&(this._addItem({value:i.value,label:i.label,choiceId:i.id,groupId:i.groupId,customProperties:i.customProperties,placeholder:i.placeholder,keyCode:i.keyCode}),this._triggerChange(i.value)),this.clearInput(),s&&this._isSelectOneElement&&(this.hideDropdown(!0),this.containerOuter.focus())}}},s._handleBackspace=function(e){if(this.config.removeItems&&e){var t=e[e.length-1],n=e.some((function(e){return e.highlighted}));this.config.editItems&&!n&&t?(this.input.value=t.value,this.input.setWidth(),this._removeItem(t),this._triggerChange(t.value)):(n||this.highlightItem(t,!1),this.removeHighlightedItems(!0))}},s._startLoading=function(){this._store.dispatch(ye(!0))},s._stopLoading=function(){this._store.dispatch(ye(!1))},s._handleLoadingState=function(e){void 0===e&&(e=!0);var t=this.itemList.getChild("."+this.config.classNames.placeholder);e?(this.disable(),this.containerOuter.addLoadingState(),this._isSelectOneElement?t?t.innerHTML=this.config.loadingText:(t=this._getTemplate("placeholder",this.config.loadingText),this.itemList.append(t)):this.input.placeholder=this.config.loadingText):(this.enable(),this.containerOuter.removeLoadingState(),this._isSelectOneElement?t.innerHTML=this._placeholderValue||"":this.input.placeholder=this._placeholderValue||"")},s._handleSearch=function(e){if(e&&this.input.isFocussed){var t=this._store.choices,n=this.config,i=n.searchFloor,r=n.searchChoices,s=t.some((function(e){return!e.active}));if(e&&e.length>=i){var o=r?this._searchChoices(e):0;this.passedElement.triggerEvent(N,{value:e,resultCount:o})}else s&&(this._isSearching=!1,this._store.dispatch(ge(!0)))}},s._canAddItem=function(e,t){var n=!0,i="function"==typeof this.config.addItemText?this.config.addItemText(t):this.config.addItemText;if(!this._isSelectOneElement){var r=function(e,t,n){return void 0===n&&(n="value"),e.some((function(e){return"string"==typeof t?e[n]===t.trim():e[n]===t}))}(e,t);this.config.maxItemCount>0&&this.config.maxItemCount<=e.length&&(n=!1,i="function"==typeof this.config.maxItemText?this.config.maxItemText(this.config.maxItemCount):this.config.maxItemText),!this.config.duplicateItemsAllowed&&r&&n&&(n=!1,i="function"==typeof this.config.uniqueItemText?this.config.uniqueItemText(t):this.config.uniqueItemText),this._isTextElement&&this.config.addItems&&n&&"function"==typeof this.config.addItemFilter&&!this.config.addItemFilter(t)&&(n=!1,i="function"==typeof this.config.customAddItemText?this.config.customAddItemText(t):this.config.customAddItemText)}return{response:n,notice:i}},s._searchChoices=function(e){var t="string"==typeof e?e.trim():e,n="string"==typeof this._currentValue?this._currentValue.trim():this._currentValue;if(t.length<1&&t===n+" ")return 0;var i=this._store.searchableChoices,s=t,o=[].concat(this.config.searchFields),a=Object.assign(this.config.fuseOptions,{keys:o}),c=new r.a(i,a).search(s);return this._currentValue=t,this._highlightPosition=0,this._isSearching=!0,this._store.dispatch(function(e){return{type:W,results:e}}(c)),c.length},s._addEventListeners=function(){var e=document.documentElement;e.addEventListener("touchend",this._onTouchEnd,!0),this.containerOuter.element.addEventListener("keydown",this._onKeyDown,!0),this.containerOuter.element.addEventListener("mousedown",this._onMouseDown,!0),e.addEventListener("click",this._onClick,{passive:!0}),e.addEventListener("touchmove",this._onTouchMove,{passive:!0}),this.dropdown.element.addEventListener("mouseover",this._onMouseOver,{passive:!0}),this._isSelectOneElement&&(this.containerOuter.element.addEventListener("focus",this._onFocus,{passive:!0}),this.containerOuter.element.addEventListener("blur",this._onBlur,{passive:!0})),this.input.element.addEventListener("keyup",this._onKeyUp,{passive:!0}),this.input.element.addEventListener("focus",this._onFocus,{passive:!0}),this.input.element.addEventListener("blur",this._onBlur,{passive:!0}),this.input.element.form&&this.input.element.form.addEventListener("reset",this._onFormReset,{passive:!0}),this.input.addEventListeners()},s._removeEventListeners=function(){var e=document.documentElement;e.removeEventListener("touchend",this._onTouchEnd,!0),this.containerOuter.element.removeEventListener("keydown",this._onKeyDown,!0),this.containerOuter.element.removeEventListener("mousedown",this._onMouseDown,!0),e.removeEventListener("click",this._onClick),e.removeEventListener("touchmove",this._onTouchMove),this.dropdown.element.removeEventListener("mouseover",this._onMouseOver),this._isSelectOneElement&&(this.containerOuter.element.removeEventListener("focus",this._onFocus),this.containerOuter.element.removeEventListener("blur",this._onBlur)),this.input.element.removeEventListener("keyup",this._onKeyUp),this.input.element.removeEventListener("focus",this._onFocus),this.input.element.removeEventListener("blur",this._onBlur),this.input.element.form&&this.input.element.form.removeEventListener("reset",this._onFormReset),this.input.removeEventListeners()},s._onKeyDown=function(e){var t,n=e.target,i=e.keyCode,r=e.ctrlKey,s=e.metaKey,o=this._store.activeItems,a=this.input.isFocussed,c=this.dropdown.isActive,l=this.itemList.hasChildren(),d=String.fromCharCode(i),u=J,h=X,m=Z,f=Q,p=ee,g=te,v=ne,b=ie,y=re,w=r||s;!this._isTextElement&&/[a-zA-Z0-9-_ ]/.test(d)&&this.showDropdown();var E=((t={})[f]=this._onAKey,t[m]=this._onEnterKey,t[p]=this._onEscapeKey,t[g]=this._onDirectionKey,t[b]=this._onDirectionKey,t[v]=this._onDirectionKey,t[y]=this._onDirectionKey,t[h]=this._onDeleteKey,t[u]=this._onDeleteKey,t);E[i]&&E[i]({event:e,target:n,keyCode:i,metaKey:s,activeItems:o,hasFocusedInput:a,hasActiveDropdown:c,hasItems:l,hasCtrlDownKeyPressed:w})},s._onKeyUp=function(e){var t=e.target,n=e.keyCode,i=this.input.value,r=this._store.activeItems,s=this._canAddItem(r,i),o=J,a=X;if(this._isTextElement)if(s.notice&&i){var c=this._getTemplate("notice",s.notice);this.dropdown.element.innerHTML=c.outerHTML,this.showDropdown(!0)}else this.hideDropdown(!0);else{var l=(n===o||n===a)&&!t.value,d=!this._isTextElement&&this._isSearching,u=this._canSearch&&s.response;l&&d?(this._isSearching=!1,this._store.dispatch(ge(!0))):u&&this._handleSearch(this.input.value)}this._canSearch=this.config.searchEnabled},s._onAKey=function(e){var t=e.hasItems;e.hasCtrlDownKeyPressed&&t&&(this._canSearch=!1,this.config.removeItems&&!this.input.value&&this.input.element===document.activeElement&&this.highlightAll())},s._onEnterKey=function(e){var t=e.event,n=e.target,i=e.activeItems,r=e.hasActiveDropdown,s=Z,o=n.hasAttribute("data-button");if(this._isTextElement&&n.value){var a=this.input.value;this._canAddItem(i,a).response&&(this.hideDropdown(!0),this._addItem({value:a}),this._triggerChange(a),this.clearInput())}if(o&&(this._handleButtonAction(i,n),t.preventDefault()),r){var c=this.dropdown.getChild("."+this.config.classNames.highlightedState);c&&(i[0]&&(i[0].keyCode=s),this._handleChoiceAction(i,c)),t.preventDefault()}else this._isSelectOneElement&&(this.showDropdown(),t.preventDefault())},s._onEscapeKey=function(e){e.hasActiveDropdown&&(this.hideDropdown(!0),this.containerOuter.focus())},s._onDirectionKey=function(e){var t,n,i,r=e.event,s=e.hasActiveDropdown,o=e.keyCode,a=e.metaKey,c=ne,l=ie,d=re;if(s||this._isSelectOneElement){this.showDropdown(),this._canSearch=!1;var u,h=o===c||o===d?1:-1;if(a||o===d||o===l)u=h>0?this.dropdown.element.querySelector("[data-choice-selectable]:last-of-type"):this.dropdown.element.querySelector("[data-choice-selectable]");else{var m=this.dropdown.element.querySelector("."+this.config.classNames.highlightedState);u=m?function(e,t,n){if(void 0===n&&(n=1),e instanceof Element&&"string"==typeof t){for(var i=(n>0?"next":"previous")+"ElementSibling",r=e[i];r;){if(r.matches(t))return r;r=r[i]}return r}}(m,"[data-choice-selectable]",h):this.dropdown.element.querySelector("[data-choice-selectable]")}u&&(t=u,n=this.choiceList.element,void 0===(i=h)&&(i=1),t&&(i>0?n.scrollTop+n.offsetHeight>=t.offsetTop+t.offsetHeight:t.offsetTop>=n.scrollTop)||this.choiceList.scrollToChildElement(u,h),this._highlightChoice(u)),r.preventDefault()}},s._onDeleteKey=function(e){var t=e.event,n=e.target,i=e.hasFocusedInput,r=e.activeItems;!i||n.value||this._isSelectOneElement||(this._handleBackspace(r),t.preventDefault())},s._onTouchMove=function(){this._wasTap&&(this._wasTap=!1)},s._onTouchEnd=function(e){var t=(e||e.touches[0]).target;this._wasTap&&this.containerOuter.element.contains(t)&&((t===this.containerOuter.element||t===this.containerInner.element)&&(this._isTextElement?this.input.focus():this._isSelectMultipleElement&&this.showDropdown()),e.stopPropagation()),this._wasTap=!0},s._onMouseDown=function(e){var t=e.target;if(t instanceof HTMLElement){if(Ee&&this.choiceList.element.contains(t)){var n=this.choiceList.element.firstElementChild,i="ltr"===this._direction?e.offsetX>=n.offsetWidth:e.offsetX<n.offsetLeft;this._isScrollingOnIe=i}if(t!==this.input.element){var r=t.closest("[data-button],[data-item],[data-choice]");if(r instanceof HTMLElement){var s=e.shiftKey,o=this._store.activeItems,a=r.dataset;"button"in a?this._handleButtonAction(o,r):"item"in a?this._handleItemAction(o,r,s):"choice"in a&&this._handleChoiceAction(o,r)}e.preventDefault()}}},s._onMouseOver=function(e){var t=e.target;t instanceof HTMLElement&&"choice"in t.dataset&&this._highlightChoice(t)},s._onClick=function(e){var t=e.target;this.containerOuter.element.contains(t)?this.dropdown.isActive||this.containerOuter.isDisabled?this._isSelectOneElement&&t!==this.input.element&&!this.dropdown.element.contains(t)&&this.hideDropdown():this._isTextElement?document.activeElement!==this.input.element&&this.input.focus():(this.showDropdown(),this.containerOuter.focus()):(this._store.highlightedActiveItems.length>0&&this.unhighlightAll(),this.containerOuter.removeFocusState(),this.hideDropdown(!0))},s._onFocus=function(e){var t,n=this,i=e.target;this.containerOuter.element.contains(i)&&((t={}).text=function(){i===n.input.element&&n.containerOuter.addFocusState()},t["select-one"]=function(){n.containerOuter.addFocusState(),i===n.input.element&&n.showDropdown(!0)},t["select-multiple"]=function(){i===n.input.element&&(n.showDropdown(!0),n.containerOuter.addFocusState())},t)[this.passedElement.element.type]()},s._onBlur=function(e){var t=this,n=e.target;if(this.containerOuter.element.contains(n)&&!this._isScrollingOnIe){var i,r=this._store.activeItems.some((function(e){return e.highlighted}));((i={}).text=function(){n===t.input.element&&(t.containerOuter.removeFocusState(),r&&t.unhighlightAll(),t.hideDropdown(!0))},i["select-one"]=function(){t.containerOuter.removeFocusState(),(n===t.input.element||n===t.containerOuter.element&&!t._canSearch)&&t.hideDropdown(!0)},i["select-multiple"]=function(){n===t.input.element&&(t.containerOuter.removeFocusState(),t.hideDropdown(!0),r&&t.unhighlightAll())},i)[this.passedElement.element.type]()}else this._isScrollingOnIe=!1,this.input.element.focus()},s._onFormReset=function(){this._store.dispatch({type:"RESET_TO",state:this._initialState})},s._highlightChoice=function(e){var t=this;void 0===e&&(e=null);var n=Array.from(this.dropdown.element.querySelectorAll("[data-choice-selectable]"));if(n.length){var i=e;Array.from(this.dropdown.element.querySelectorAll("."+this.config.classNames.highlightedState)).forEach((function(e){e.classList.remove(t.config.classNames.highlightedState),e.setAttribute("aria-selected","false")})),i?this._highlightPosition=n.indexOf(i):(i=n.length>this._highlightPosition?n[this._highlightPosition]:n[n.length-1])||(i=n[0]),i.classList.add(this.config.classNames.highlightedState),i.setAttribute("aria-selected","true"),this.passedElement.triggerEvent(q,{el:i}),this.dropdown.isActive&&(this.input.setActiveDescendant(i.id),this.containerOuter.setActiveDescendant(i.id))}},s._addItem=function(e){var t=e.value,n=e.label,i=void 0===n?null:n,r=e.choiceId,s=void 0===r?-1:r,o=e.groupId,a=void 0===o?-1:o,c=e.customProperties,l=void 0===c?null:c,d=e.placeholder,u=void 0!==d&&d,h=e.keyCode,m=void 0===h?null:h,f="string"==typeof t?t.trim():t,p=m,g=l,v=this._store.items,b=i||f,y=s||-1,w=a>=0?this._store.getGroupById(a):null,E=v?v.length+1:1;return this.config.prependValue&&(f=this.config.prependValue+f.toString()),this.config.appendValue&&(f+=this.config.appendValue.toString()),this._store.dispatch(function(e){var t=e.value,n=e.label,i=e.id,r=e.choiceId,s=e.groupId,o=e.customProperties,a=e.placeholder,c=e.keyCode;return{type:K,value:t,label:n,id:i,choiceId:r,groupId:s,customProperties:o,placeholder:a,keyCode:c}}({value:f,label:b,id:E,choiceId:y,groupId:a,customProperties:l,placeholder:u,keyCode:p})),this._isSelectOneElement&&this.removeActiveItems(E),this.passedElement.triggerEvent(j,{id:E,value:f,label:b,customProperties:g,groupValue:w&&w.value?w.value:void 0,keyCode:p}),this},s._removeItem=function(e){if(!e||!E("Object",e))return this;var t=e.id,n=e.value,i=e.label,r=e.choiceId,s=e.groupId,o=s>=0?this._store.getGroupById(s):null;return this._store.dispatch(function(e,t){return{type:z,id:e,choiceId:t}}(t,r)),o&&o.value?this.passedElement.triggerEvent(H,{id:t,value:n,label:i,groupValue:o.value}):this.passedElement.triggerEvent(H,{id:t,value:n,label:i}),this},s._addChoice=function(e){var t=e.value,n=e.label,i=void 0===n?null:n,r=e.isSelected,s=void 0!==r&&r,o=e.isDisabled,a=void 0!==o&&o,c=e.groupId,l=void 0===c?-1:c,d=e.customProperties,u=void 0===d?null:d,h=e.placeholder,m=void 0!==h&&h,f=e.keyCode,p=void 0===f?null:f;if(null!=t){var g=this._store.choices,v=i||t,b=g?g.length+1:1,y=this._baseId+"-"+this._idNames.itemChoice+"-"+b;this._store.dispatch(function(e){var t=e.value,n=e.label,i=e.id,r=e.groupId,s=e.disabled,o=e.elementId,a=e.customProperties,c=e.placeholder,l=e.keyCode;return{type:V,value:t,label:n,id:i,groupId:r,disabled:s,elementId:o,customProperties:a,placeholder:c,keyCode:l}}({id:b,groupId:l,elementId:y,value:t,label:v,disabled:a,customProperties:u,placeholder:m,keyCode:p})),s&&this._addItem({value:t,label:v,choiceId:b,customProperties:u,placeholder:m,keyCode:p})}},s._addGroup=function(e){var t=this,n=e.group,i=e.id,r=e.valueKey,s=void 0===r?"value":r,o=e.labelKey,a=void 0===o?"label":o,c=E("Object",n)?n.choices:Array.from(n.getElementsByTagName("OPTION")),l=i||Math.floor((new Date).valueOf()*Math.random()),d=!!n.disabled&&n.disabled;c?(this._store.dispatch(be({value:n.label,id:l,active:!0,disabled:d})),c.forEach((function(e){var n=e.disabled||e.parentNode&&e.parentNode.disabled;t._addChoice({value:e[s],label:E("Object",e)?e[a]:e.innerHTML,isSelected:e.selected,isDisabled:n,groupId:l,customProperties:e.customProperties,placeholder:e.placeholder})}))):this._store.dispatch(be({value:n.label,id:n.id,active:!1,disabled:n.disabled}))},s._getTemplate=function(e){var t;if(!e)return null;for(var n=this.config.classNames,i=arguments.length,r=new Array(i>1?i-1:0),s=1;s<i;s++)r[s-1]=arguments[s];return(t=this._templates[e]).call.apply(t,[this,n].concat(r))},s._createTemplates=function(){var e=this.config.callbackOnCreateTemplates,t={};e&&"function"==typeof e&&(t=e.call(this,_)),this._templates=o()(pe,t)},s._createElements=function(){this.containerOuter=new se({element:this._getTemplate("containerOuter",this._direction,this._isSelectElement,this._isSelectOneElement,this.config.searchEnabled,this.passedElement.element.type),classNames:this.config.classNames,type:this.passedElement.element.type,position:this.config.position}),this.containerInner=new se({element:this._getTemplate("containerInner"),classNames:this.config.classNames,type:this.passedElement.element.type,position:this.config.position}),this.input=new ae({element:this._getTemplate("input",this._placeholderValue),classNames:this.config.classNames,type:this.passedElement.element.type,preventPaste:!this.config.paste}),this.choiceList=new ce({element:this._getTemplate("choiceList",this._isSelectOneElement)}),this.itemList=new ce({element:this._getTemplate("itemList",this._isSelectOneElement)}),this.dropdown=new I({element:this._getTemplate("dropdown"),classNames:this.config.classNames,type:this.passedElement.element.type})},s._createStructure=function(){this.passedElement.conceal(),this.containerInner.wrap(this.passedElement.element),this.containerOuter.wrap(this.containerInner.element),this._isSelectOneElement?this.input.placeholder=this.config.searchPlaceholderValue||"":this._placeholderValue&&(this.input.placeholder=this._placeholderValue,this.input.setWidth()),this.containerOuter.element.appendChild(this.containerInner.element),this.containerOuter.element.appendChild(this.dropdown.element),this.containerInner.element.appendChild(this.itemList.element),this._isTextElement||this.dropdown.element.appendChild(this.choiceList.element),this._isSelectOneElement?this.config.searchEnabled&&this.dropdown.element.insertBefore(this.input.element,this.dropdown.element.firstChild):this.containerInner.element.appendChild(this.input.element),this._isSelectElement&&(this._highlightPosition=0,this._isSearching=!1,this._startLoading(),this._presetGroups.length?this._addPredefinedGroups(this._presetGroups):this._addPredefinedChoices(this._presetChoices),this._stopLoading()),this._isTextElement&&this._addPredefinedItems(this._presetItems)},s._addPredefinedGroups=function(e){var t=this,n=this.passedElement.placeholderOption;n&&"SELECT"===n.parentNode.tagName&&this._addChoice({value:n.value,label:n.innerHTML,isSelected:n.selected,isDisabled:n.disabled,placeholder:!0}),e.forEach((function(e){return t._addGroup({group:e,id:e.id||null})}))},s._addPredefinedChoices=function(e){var t=this;this.config.shouldSort&&e.sort(this.config.sorter);var n=e.some((function(e){return e.selected})),i=e.findIndex((function(e){return void 0===e.disabled||!e.disabled}));e.forEach((function(e,r){var s=e.value,o=e.label,a=e.customProperties,c=e.placeholder;if(t._isSelectElement)if(e.choices)t._addGroup({group:e,id:e.id||null});else{var l=!(!t._isSelectOneElement||n||r!==i)||e.selected,d=e.disabled;t._addChoice({value:s,label:o,isSelected:l,isDisabled:d,customProperties:a,placeholder:c})}else t._addChoice({value:s,label:o,isSelected:e.selected,isDisabled:e.disabled,customProperties:a,placeholder:c})}))},s._addPredefinedItems=function(e){var t=this;e.forEach((function(e){"object"==typeof e&&e.value&&t._addItem({value:e.value,label:e.label,choiceId:e.id,customProperties:e.customProperties,placeholder:e.placeholder}),"string"==typeof e&&t._addItem({value:e})}))},s._setChoiceOrItem=function(e){var t=this;({object:function(){e.value&&(t._isTextElement?t._addItem({value:e.value,label:e.label,choiceId:e.id,customProperties:e.customProperties,placeholder:e.placeholder}):t._addChoice({value:e.value,label:e.label,isSelected:!0,isDisabled:!1,customProperties:e.customProperties,placeholder:e.placeholder}))},string:function(){t._isTextElement?t._addItem({value:e}):t._addChoice({value:e,label:e,isSelected:!0,isDisabled:!1})}})[w(e).toLowerCase()]()},s._findAndSelectChoiceByValue=function(e){var t=this,n=this._store.choices.find((function(n){return t.config.valueComparer(n.value,e)}));n&&!n.selected&&this._addItem({value:n.value,label:n.label,choiceId:n.id,groupId:n.groupId,customProperties:n.customProperties,placeholder:n.placeholder,keyCode:n.keyCode})},s._generatePlaceholderValue=function(){if(this._isSelectElement){var e=this.passedElement.placeholderOption;return!!e&&e.text}var t=this.config,n=t.placeholder,i=t.placeholderValue,r=this.passedElement.element.dataset;if(n){if(i)return i;if(r.placeholder)return r.placeholder}return!1},i}();t.default=_e}]).default},e.exports=i()},function(e,t,n){n(6),e.exports=n(20)},function(e,t,n){"use strict";n.r(t);n(7);n(8),n(9),n(10),n(11),n(12),n(13),n(14),n(15),n(1),n(16),n(19),n(17),n(18)},function(e,t,n){e.exports=function(){"use strict";function e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function n(n){for(var i=1;i<arguments.length;i++){var r=null!=arguments[i]?arguments[i]:{};i%2?t(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):t(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}function i(e){return Array.from(new Set(e))}function r(){return navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")}function s(e,t){return e==t}function o(e,t){"template"!==e.tagName.toLowerCase()?console.warn(`Alpine: [${t}] directive should only be added to <template> tags. See https://github.com/alpinejs/alpine#${t}`):1!==e.content.childElementCount&&console.warn(`Alpine: <template> tag with [${t}] encountered with an unexpected number of root elements. Make sure <template> has a single root element. `)}function a(e){return e.toLowerCase().replace(/-(\w)/g,(e,t)=>t.toUpperCase())}function c(e,t){var n;return function(){var i=this,r=arguments,s=function(){n=null,e.apply(i,r)};clearTimeout(n),n=setTimeout(s,t)}}const l=(e,t,n)=>{if(console.warn(`Alpine Error: "${n}"\n\nExpression: "${t}"\nElement:`,e),!r())throw Object.assign(n,{el:e,expression:t}),n};function d(e,{el:t,expression:n}){try{const i=e();return i instanceof Promise?i.catch(e=>l(t,n,e)):i}catch(e){l(t,n,e)}}function u(e,t,n,i={}){return d(()=>"function"==typeof t?t.call(n):new Function(["$data",...Object.keys(i)],`var __alpine_result; with($data) { __alpine_result = ${t} }; return __alpine_result`)(n,...Object.values(i)),{el:e,expression:t})}const h=/^x-(on|bind|data|text|html|model|if|for|show|cloak|transition|ref|spread)\b/;function m(e){const t=g(e.name);return h.test(t)}function f(e,t,n){let i=Array.from(e.attributes).filter(m).map(p),r=i.filter(e=>"spread"===e.type)[0];if(r){let n=u(e,r.expression,t.$data);i=i.concat(Object.entries(n).map(([e,t])=>p({name:e,value:t})))}return n?i.filter(e=>e.type===n):function(e){let t=["bind","model","show","catch-all"];return e.sort((e,n)=>{let i=-1===t.indexOf(e.type)?"catch-all":e.type,r=-1===t.indexOf(n.type)?"catch-all":n.type;return t.indexOf(i)-t.indexOf(r)})}(i)}function p({name:e,value:t}){const n=g(e),i=n.match(h),r=n.match(/:([a-zA-Z0-9\-:]+)/),s=n.match(/\.[^.\]]+(?=[^\]]*$)/g)||[];return{type:i?i[1]:null,value:r?r[1]:null,modifiers:s.map(e=>e.replace(".","")),expression:t}}function g(e){return e.startsWith("@")?e.replace("@","x-on:"):e.startsWith(":")?e.replace(":","x-bind:"):e}function v(e,t=Boolean){return e.split(" ").filter(t)}function b(e,t,n,i,r=!1){if(r)return t();if(e.__x_transition&&"in"===e.__x_transition.type)return;const s=f(e,i,"transition"),o=f(e,i,"show")[0];if(o&&o.modifiers.includes("transition")){let i=o.modifiers;if(i.includes("out")&&!i.includes("in"))return t();const r=i.includes("in")&&i.includes("out");i=r?i.filter((e,t)=>t<i.indexOf("out")):i,function(e,t,n,i){const r={duration:w(t,"duration",150),origin:w(t,"origin","center"),first:{opacity:0,scale:w(t,"scale",95)},second:{opacity:1,scale:100}};E(e,t,n,()=>{},i,r,"in")}(e,i,t,n)}else s.some(e=>["enter","enter-start","enter-end"].includes(e.value))?function(e,t,n,i,r){const s=v(S((n.find(e=>"enter"===e.value)||{expression:""}).expression,e,t)),o=v(S((n.find(e=>"enter-start"===e.value)||{expression:""}).expression,e,t)),a=v(S((n.find(e=>"enter-end"===e.value)||{expression:""}).expression,e,t));_(e,s,o,a,i,()=>{},"in",r)}(e,i,s,t,n):t()}function y(e,t,n,i,r=!1){if(r)return t();if(e.__x_transition&&"out"===e.__x_transition.type)return;const s=f(e,i,"transition"),o=f(e,i,"show")[0];if(o&&o.modifiers.includes("transition")){let i=o.modifiers;if(i.includes("in")&&!i.includes("out"))return t();const r=i.includes("in")&&i.includes("out");i=r?i.filter((e,t)=>t>i.indexOf("out")):i,function(e,t,n,i,r){const s={duration:n?w(t,"duration",150):w(t,"duration",150)/2,origin:w(t,"origin","center"),first:{opacity:1,scale:100},second:{opacity:0,scale:w(t,"scale",95)}};E(e,t,()=>{},i,r,s,"out")}(e,i,r,t,n)}else s.some(e=>["leave","leave-start","leave-end"].includes(e.value))?function(e,t,n,i,r){const s=v(S((n.find(e=>"leave"===e.value)||{expression:""}).expression,e,t)),o=v(S((n.find(e=>"leave-start"===e.value)||{expression:""}).expression,e,t)),a=v(S((n.find(e=>"leave-end"===e.value)||{expression:""}).expression,e,t));_(e,s,o,a,()=>{},i,"out",r)}(e,i,s,t,n):t()}function w(e,t,n){if(-1===e.indexOf(t))return n;const i=e[e.indexOf(t)+1];if(!i)return n;if("scale"===t&&!x(i))return n;if("duration"===t){let e=i.match(/([0-9]+)ms/);if(e)return e[1]}return"origin"===t&&["top","right","left","center","bottom"].includes(e[e.indexOf(t)+2])?[i,e[e.indexOf(t)+2]].join(" "):i}function E(e,t,n,i,r,s,o){e.__x_transition&&e.__x_transition.cancel&&e.__x_transition.cancel();const a=e.style.opacity,c=e.style.transform,l=e.style.transformOrigin,d=!t.includes("opacity")&&!t.includes("scale"),u=d||t.includes("opacity"),h=d||t.includes("scale"),m={start(){u&&(e.style.opacity=s.first.opacity),h&&(e.style.transform=`scale(${s.first.scale/100})`)},during(){h&&(e.style.transformOrigin=s.origin),e.style.transitionProperty=[u?"opacity":"",h?"transform":""].join(" ").trim(),e.style.transitionDuration=s.duration/1e3+"s",e.style.transitionTimingFunction="cubic-bezier(0.4, 0.0, 0.2, 1)"},show(){n()},end(){u&&(e.style.opacity=s.second.opacity),h&&(e.style.transform=`scale(${s.second.scale/100})`)},hide(){i()},cleanup(){u&&(e.style.opacity=a),h&&(e.style.transform=c),h&&(e.style.transformOrigin=l),e.style.transitionProperty=null,e.style.transitionDuration=null,e.style.transitionTimingFunction=null}};C(e,m,o,r)}const S=(e,t,n)=>"function"==typeof e?n.evaluateReturnExpression(t,e):e;function _(e,t,n,i,r,s,o,a){e.__x_transition&&e.__x_transition.cancel&&e.__x_transition.cancel();const c=e.__x_original_classes||[],l={start(){e.classList.add(...n)},during(){e.classList.add(...t)},show(){r()},end(){e.classList.remove(...n.filter(e=>!c.includes(e))),e.classList.add(...i)},hide(){s()},cleanup(){e.classList.remove(...t.filter(e=>!c.includes(e))),e.classList.remove(...i.filter(e=>!c.includes(e)))}};C(e,l,o,a)}function C(e,t,n,i){const r=T(()=>{t.hide(),e.isConnected&&t.cleanup(),delete e.__x_transition});e.__x_transition={type:n,cancel:T(()=>{i("cancelled"),r()}),finish:r,nextFrame:null},t.start(),t.during(),e.__x_transition.nextFrame=requestAnimationFrame(()=>{let n=1e3*Number(getComputedStyle(e).transitionDuration.replace(/,.*/,"").replace("s",""));0===n&&(n=1e3*Number(getComputedStyle(e).animationDuration.replace("s",""))),t.show(),e.__x_transition.nextFrame=requestAnimationFrame(()=>{t.end(),setTimeout(e.__x_transition.finish,n)})})}function x(e){return!Array.isArray(e)&&!isNaN(e)}function T(e){let t=!1;return function(){t||(t=!0,e.apply(this,arguments))}}function D(e,t,i,r,s){o(t,"x-for");let a=L("function"==typeof i?e.evaluateReturnExpression(t,i):i),c=function(e,t,n,i){let r=f(t,e,"if")[0];if(r&&!e.evaluateReturnExpression(t,r.expression))return[];let s=e.evaluateReturnExpression(t,n.items,i);return x(s)&&s>=0&&(s=Array.from(Array(s).keys(),e=>e+1)),s}(e,t,a,s),l=t;c.forEach((i,o)=>{let d=function(e,t,i,r,s){let o=s?n({},s):{};return o[e.item]=t,e.index&&(o[e.index]=i),e.collection&&(o[e.collection]=r),o}(a,i,o,c,s()),u=function(e,t,n,i){let r=f(t,e,"bind").filter(e=>"key"===e.value)[0];return r?e.evaluateReturnExpression(t,r.expression,()=>i):n}(e,t,o,d),h=function(e,t){if(!e)return;if(void 0===e.__x_for_key)return;if(e.__x_for_key===t)return e;let n=e;for(;n;){if(n.__x_for_key===t)return n.parentElement.insertBefore(n,e);n=!(!n.nextElementSibling||void 0===n.nextElementSibling.__x_for_key)&&n.nextElementSibling}}(l.nextElementSibling,u);h?(delete h.__x_for_key,h.__x_for=d,e.updateElements(h,()=>h.__x_for)):(h=function(e,t){let n=document.importNode(e.content,!0);return t.parentElement.insertBefore(n,t.nextElementSibling),t.nextElementSibling}(t,l),b(h,()=>{},()=>{},e,r),h.__x_for=d,e.initializeElements(h,()=>h.__x_for)),l=h,l.__x_for_key=u}),function(e,t){for(var n=!(!e.nextElementSibling||void 0===e.nextElementSibling.__x_for_key)&&e.nextElementSibling;n;){let e=n,i=n.nextElementSibling;y(n,()=>{e.remove()},()=>{},t),n=!(!i||void 0===i.__x_for_key)&&i}}(l,e)}function L(e){let t=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,n=String(e).match(/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/);if(!n)return;let i={};i.items=n[2].trim();let r=n[1].trim().replace(/^\(|\)$/g,""),s=r.match(t);return s?(i.item=r.replace(t,"").trim(),i.index=s[1].trim(),s[2]&&(i.collection=s[2].trim())):i.item=r,i}function A(e,t,n,r,o,c,l){var d=e.evaluateReturnExpression(t,r,o);if("value"===n){if(pe.ignoreFocusedForValueBinding&&document.activeElement.isSameNode(t))return;if(void 0===d&&String(r).match(/\./)&&(d=""),"radio"===t.type)void 0===t.attributes.value&&"bind"===c?t.value=d:"bind"!==c&&(t.checked=s(t.value,d));else if("checkbox"===t.type)"boolean"==typeof d||[null,void 0].includes(d)||"bind"!==c?"bind"!==c&&(Array.isArray(d)?t.checked=d.some(e=>s(e,t.value)):t.checked=!!d):t.value=String(d);else if("SELECT"===t.tagName)!function(e,t){const n=[].concat(t).map(e=>e+"");Array.from(e.options).forEach(e=>{e.selected=n.includes(e.value||e.text)})}(t,d);else{if(t.value===d)return;t.value=d}}else if("class"===n)if(Array.isArray(d)){const e=t.__x_original_classes||[];t.setAttribute("class",i(e.concat(d)).join(" "))}else if("object"==typeof d)Object.keys(d).sort((e,t)=>d[e]-d[t]).forEach(e=>{d[e]?v(e).forEach(e=>t.classList.add(e)):v(e).forEach(e=>t.classList.remove(e))});else{const e=t.__x_original_classes||[],n=d?v(d):[];t.setAttribute("class",i(e.concat(n)).join(" "))}else n=l.includes("camel")?a(n):n,[null,void 0,!1].includes(d)?t.removeAttribute(n):function(e){return["disabled","checked","required","readonly","hidden","open","selected","autofocus","itemscope","multiple","novalidate","allowfullscreen","allowpaymentrequest","formnovalidate","autoplay","controls","loop","muted","playsinline","default","ismap","reversed","async","defer","nomodule"].includes(e)}(n)?O(t,n,n):O(t,n,d)}function O(e,t,n){e.getAttribute(t)!=n&&e.setAttribute(t,n)}function I(e,t,n,i,r,s={}){const o={passive:i.includes("passive")};let l,d;if(i.includes("camel")&&(n=a(n)),i.includes("away")?(d=document,l=a=>{t.contains(a.target)||t.offsetWidth<1&&t.offsetHeight<1||(M(e,r,a,s),i.includes("once")&&document.removeEventListener(n,l,o))}):(d=i.includes("window")?window:i.includes("document")?document:t,l=a=>{d!==window&&d!==document||document.body.contains(t)?function(e){return["keydown","keyup"].includes(e)}(n)&&function(e,t){let n=t.filter(e=>!["window","document","prevent","stop"].includes(e));if(n.includes("debounce")){let e=n.indexOf("debounce");n.splice(e,x((n[e+1]||"invalid-wait").split("ms")[0])?2:1)}if(0===n.length)return!1;if(1===n.length&&n[0]===k(e.key))return!1;const i=["ctrl","shift","alt","meta","cmd","super"].filter(e=>n.includes(e));return n=n.filter(e=>!i.includes(e)),!(i.length>0&&i.filter(t=>("cmd"!==t&&"super"!==t||(t="meta"),e[t+"Key"])).length===i.length&&n[0]===k(e.key))}(a,i)||(i.includes("prevent")&&a.preventDefault(),i.includes("stop")&&a.stopPropagation(),i.includes("self")&&a.target!==t)||M(e,r,a,s).then(e=>{!1===e?a.preventDefault():i.includes("once")&&d.removeEventListener(n,l,o)}):d.removeEventListener(n,l,o)}),i.includes("debounce")){let e=i[i.indexOf("debounce")+1]||"invalid-wait",t=x(e.split("ms")[0])?Number(e.split("ms")[0]):250;l=c(l,t)}d.addEventListener(n,l,o)}function M(e,t,i,r){return e.evaluateCommandExpression(i.target,t,()=>n(n({},r()),{},{$event:i}))}function k(e){switch(e){case"/":return"slash";case" ":case"Spacebar":return"space";default:return e&&e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}}function P(e,t,n){return"radio"===e.type&&(e.hasAttribute("name")||e.setAttribute("name",n)),(n,i)=>{if(n instanceof CustomEvent&&n.detail)return n.detail;if("checkbox"===e.type){if(Array.isArray(i)){const e=t.includes("number")?F(n.target.value):n.target.value;return n.target.checked?i.concat([e]):i.filter(t=>!s(t,e))}return n.target.checked}if("select"===e.tagName.toLowerCase()&&e.multiple)return t.includes("number")?Array.from(n.target.selectedOptions).map(e=>F(e.value||e.text)):Array.from(n.target.selectedOptions).map(e=>e.value||e.text);{const e=n.target.value;return t.includes("number")?F(e):t.includes("trim")?e.trim():e}}}function F(e){const t=e?parseFloat(e):null;return x(t)?t:e}const{isArray:R}=Array,{getPrototypeOf:N,create:j,defineProperty:H,defineProperties:B,isExtensible:q,getOwnPropertyDescriptor:V,getOwnPropertyNames:W,getOwnPropertySymbols:$,preventExtensions:U,hasOwnProperty:Y}=Object,{push:K,concat:z,map:G}=Array.prototype;function J(e){return void 0===e}function X(e){return"function"==typeof e}const Z=new WeakMap;function Q(e,t){Z.set(e,t)}const ee=e=>Z.get(e)||e;function te(e,t){return e.valueIsObservable(t)?e.getProxy(t):t}function ne(e,t,n){z.call(W(n),$(n)).forEach(i=>{let r=V(n,i);r.configurable||(r=he(e,r,te)),H(t,i,r)}),U(t)}class ie{constructor(e,t){this.originalTarget=t,this.membrane=e}get(e,t){const{originalTarget:n,membrane:i}=this,r=n[t],{valueObserved:s}=i;return s(n,t),i.getProxy(r)}set(e,t,n){const{originalTarget:i,membrane:{valueMutated:r}}=this;return i[t]!==n?(i[t]=n,r(i,t)):"length"===t&&R(i)&&r(i,t),!0}deleteProperty(e,t){const{originalTarget:n,membrane:{valueMutated:i}}=this;return delete n[t],i(n,t),!0}apply(e,t,n){}construct(e,t,n){}has(e,t){const{originalTarget:n,membrane:{valueObserved:i}}=this;return i(n,t),t in n}ownKeys(e){const{originalTarget:t}=this;return z.call(W(t),$(t))}isExtensible(e){const t=q(e);if(!t)return t;const{originalTarget:n,membrane:i}=this,r=q(n);return r||ne(i,e,n),r}setPrototypeOf(e,t){}getPrototypeOf(e){const{originalTarget:t}=this;return N(t)}getOwnPropertyDescriptor(e,t){const{originalTarget:n,membrane:i}=this,{valueObserved:r}=this.membrane;r(n,t);let s=V(n,t);if(J(s))return s;const o=V(e,t);return J(o)?(s=he(i,s,te),s.configurable||H(e,t,s),s):o}preventExtensions(e){const{originalTarget:t,membrane:n}=this;return ne(n,e,t),U(t),!0}defineProperty(e,t,n){const{originalTarget:i,membrane:r}=this,{valueMutated:s}=r,{configurable:o}=n;if(Y.call(n,"writable")&&!Y.call(n,"value")){const e=V(i,t);n.value=e.value}return H(i,t,function(e){return Y.call(e,"value")&&(e.value=ee(e.value)),e}(n)),!1===o&&H(e,t,he(r,n,te)),s(i,t),!0}}function re(e,t){return e.valueIsObservable(t)?e.getReadOnlyProxy(t):t}class se{constructor(e,t){this.originalTarget=t,this.membrane=e}get(e,t){const{membrane:n,originalTarget:i}=this,r=i[t],{valueObserved:s}=n;return s(i,t),n.getReadOnlyProxy(r)}set(e,t,n){return!1}deleteProperty(e,t){return!1}apply(e,t,n){}construct(e,t,n){}has(e,t){const{originalTarget:n,membrane:{valueObserved:i}}=this;return i(n,t),t in n}ownKeys(e){const{originalTarget:t}=this;return z.call(W(t),$(t))}setPrototypeOf(e,t){}getOwnPropertyDescriptor(e,t){const{originalTarget:n,membrane:i}=this,{valueObserved:r}=i;r(n,t);let s=V(n,t);if(J(s))return s;const o=V(e,t);return J(o)?(s=he(i,s,re),Y.call(s,"set")&&(s.set=void 0),s.configurable||H(e,t,s),s):o}preventExtensions(e){return!1}defineProperty(e,t,n){return!1}}function oe(e){let t=void 0;return R(e)?t=[]:"object"==typeof e&&(t={}),t}const ae=Object.prototype;function ce(e){if(null===e)return!1;if("object"!=typeof e)return!1;if(R(e))return!0;const t=N(e);return t===ae||null===t||null===N(t)}const le=(e,t)=>{},de=(e,t)=>{},ue=e=>e;function he(e,t,n){const{set:i,get:r}=t;return Y.call(t,"value")?t.value=n(e,t.value):(J(r)||(t.get=function(){return n(e,r.call(ee(this)))}),J(i)||(t.set=function(t){i.call(ee(this),e.unwrapProxy(t))})),t}class me{constructor(e){if(this.valueDistortion=ue,this.valueMutated=de,this.valueObserved=le,this.valueIsObservable=ce,this.objectGraph=new WeakMap,!J(e)){const{valueDistortion:t,valueMutated:n,valueObserved:i,valueIsObservable:r}=e;this.valueDistortion=X(t)?t:ue,this.valueMutated=X(n)?n:de,this.valueObserved=X(i)?i:le,this.valueIsObservable=X(r)?r:ce}}getProxy(e){const t=ee(e),n=this.valueDistortion(t);if(this.valueIsObservable(n)){const i=this.getReactiveState(t,n);return i.readOnly===e?e:i.reactive}return n}getReadOnlyProxy(e){e=ee(e);const t=this.valueDistortion(e);return this.valueIsObservable(t)?this.getReactiveState(e,t).readOnly:t}unwrapProxy(e){return ee(e)}getReactiveState(e,t){const{objectGraph:n}=this;let i=n.get(t);if(i)return i;const r=this;return i={get reactive(){const n=new ie(r,t),i=new Proxy(oe(t),n);return Q(i,e),H(this,"reactive",{value:i}),i},get readOnly(){const n=new se(r,t),i=new Proxy(oe(t),n);return Q(i,e),H(this,"readOnly",{value:i}),i}},n.set(t,i),i}}class fe{constructor(e,t=null){this.$el=e;const n=this.$el.getAttribute("x-data"),i=""===n?"{}":n,r=this.$el.getAttribute("x-init");let s={$el:this.$el},o=t?t.$el:this.$el;Object.entries(pe.magicProperties).forEach(([e,t])=>{Object.defineProperty(s,"$"+e,{get:function(){return t(o)}})}),this.unobservedData=t?t.getUnobservedData():u(e,i,s);let{membrane:a,data:c}=this.wrapDataInObservable(this.unobservedData);var l;this.$data=c,this.membrane=a,this.unobservedData.$el=this.$el,this.unobservedData.$refs=this.getRefsProxy(),this.nextTickStack=[],this.unobservedData.$nextTick=e=>{this.nextTickStack.push(e)},this.watchers={},this.unobservedData.$watch=(e,t)=>{this.watchers[e]||(this.watchers[e]=[]),this.watchers[e].push(t)},Object.entries(pe.magicProperties).forEach(([e,t])=>{Object.defineProperty(this.unobservedData,"$"+e,{get:function(){return t(o,this.$el)}})}),this.showDirectiveStack=[],this.showDirectiveLastElement,t||pe.onBeforeComponentInitializeds.forEach(e=>e(this)),r&&!t&&(this.pauseReactivity=!0,l=this.evaluateReturnExpression(this.$el,r),this.pauseReactivity=!1),this.initializeElements(this.$el,()=>{},!t),this.listenForNewElementsToInitialize(),"function"==typeof l&&l.call(this.$data),t||setTimeout(()=>{pe.onComponentInitializeds.forEach(e=>e(this))},0)}getUnobservedData(){return function(e,t){let n=e.unwrapProxy(t),i={};return Object.keys(n).forEach(e=>{["$el","$refs","$nextTick","$watch"].includes(e)||(i[e]=n[e])}),i}(this.membrane,this.$data)}wrapDataInObservable(e){var t=this;let n=c((function(){t.updateElements(t.$el)}),0);return function(e,t){let n=new me({valueMutated(e,n){t(e,n)}});return{data:n.getProxy(e),membrane:n}}(e,(e,i)=>{t.watchers[i]?t.watchers[i].forEach(t=>t(e[i])):Array.isArray(e)?Object.keys(t.watchers).forEach(n=>{let r=n.split(".");"length"!==i&&r.reduce((i,r)=>(Object.is(e,i[r])&&t.watchers[n].forEach(t=>t(e)),i[r]),t.unobservedData)}):Object.keys(t.watchers).filter(e=>e.includes(".")).forEach(n=>{let r=n.split(".");i===r[r.length-1]&&r.reduce((r,s)=>(Object.is(e,r)&&t.watchers[n].forEach(t=>t(e[i])),r[s]),t.unobservedData)}),t.pauseReactivity||n()})}walkAndSkipNestedComponents(e,t,n=(()=>{})){!function e(t,n){if(!1===n(t))return;let i=t.firstElementChild;for(;i;)e(i,n),i=i.nextElementSibling}(e,e=>e.hasAttribute("x-data")&&!e.isSameNode(this.$el)?(e.__x||n(e),!1):t(e))}initializeElements(e,t=(()=>{}),n=!0){this.walkAndSkipNestedComponents(e,e=>void 0===e.__x_for_key&&void 0===e.__x_inserted_me&&void this.initializeElement(e,t,n),e=>{e.__x=new fe(e)}),this.executeAndClearRemainingShowDirectiveStack(),this.executeAndClearNextTickStack(e)}initializeElement(e,t,n=!0){e.hasAttribute("class")&&f(e,this).length>0&&(e.__x_original_classes=v(e.getAttribute("class"))),n&&this.registerListeners(e,t),this.resolveBoundAttributes(e,!0,t)}updateElements(e,t=(()=>{})){this.walkAndSkipNestedComponents(e,e=>{if(void 0!==e.__x_for_key&&!e.isSameNode(this.$el))return!1;this.updateElement(e,t)},e=>{e.__x=new fe(e)}),this.executeAndClearRemainingShowDirectiveStack(),this.executeAndClearNextTickStack(e)}executeAndClearNextTickStack(e){e===this.$el&&this.nextTickStack.length>0&&requestAnimationFrame(()=>{for(;this.nextTickStack.length>0;)this.nextTickStack.shift()()})}executeAndClearRemainingShowDirectiveStack(){this.showDirectiveStack.reverse().map(e=>new Promise((t,n)=>{e(t,n)})).reduce((e,t)=>e.then(()=>t.then(e=>{e()})),Promise.resolve(()=>{})).catch(e=>{if("cancelled"!==e)throw e}),this.showDirectiveStack=[],this.showDirectiveLastElement=void 0}updateElement(e,t){this.resolveBoundAttributes(e,!1,t)}registerListeners(e,t){f(e,this).forEach(({type:i,value:r,modifiers:s,expression:o})=>{switch(i){case"on":I(this,e,r,s,o,t);break;case"model":!function(e,t,i,r,s){var o="select"===t.tagName.toLowerCase()||["checkbox","radio"].includes(t.type)||i.includes("lazy")?"change":"input";I(e,t,o,i,`${r} = rightSideOfExpression($event, ${r})`,()=>n(n({},s()),{},{rightSideOfExpression:P(t,i,r)}))}(this,e,s,o,t)}})}resolveBoundAttributes(e,t=!1,n){let i=f(e,this);i.forEach(({type:r,value:s,modifiers:a,expression:c})=>{switch(r){case"model":A(this,e,"value",c,n,r,a);break;case"bind":if("template"===e.tagName.toLowerCase()&&"key"===s)return;A(this,e,s,c,n,r,a);break;case"text":var l=this.evaluateReturnExpression(e,c,n);!function(e,t,n){void 0===t&&String(n).match(/\./)&&(t=""),e.textContent=t}(e,l,c);break;case"html":!function(e,t,n,i){t.innerHTML=e.evaluateReturnExpression(t,n,i)}(this,e,c,n);break;case"show":l=this.evaluateReturnExpression(e,c,n),function(e,t,n,i,r=!1){const s=()=>{t.style.display="none",t.__x_is_shown=!1},o=()=>{1===t.style.length&&"none"===t.style.display?t.removeAttribute("style"):t.style.removeProperty("display"),t.__x_is_shown=!0};if(!0===r)return void(n?o():s());const a=(i,r)=>{n?(("none"===t.style.display||t.__x_transition)&&b(t,()=>{o()},r,e),i(()=>{})):"none"!==t.style.display?y(t,()=>{i(()=>{s()})},r,e):i(()=>{})};i.includes("immediate")?a(e=>e(),()=>{}):(e.showDirectiveLastElement&&!e.showDirectiveLastElement.contains(t)&&e.executeAndClearRemainingShowDirectiveStack(),e.showDirectiveStack.push(a),e.showDirectiveLastElement=t)}(this,e,l,a,t);break;case"if":if(i.some(e=>"for"===e.type))return;l=this.evaluateReturnExpression(e,c,n),function(e,t,n,i,r){o(t,"x-if");const s=t.nextElementSibling&&!0===t.nextElementSibling.__x_inserted_me;if(!n||s&&!t.__x_transition)!n&&s&&y(t.nextElementSibling,()=>{t.nextElementSibling.remove()},()=>{},e,i);else{const n=document.importNode(t.content,!0);t.parentElement.insertBefore(n,t.nextElementSibling),b(t.nextElementSibling,()=>{},()=>{},e,i),e.initializeElements(t.nextElementSibling,r),t.nextElementSibling.__x_inserted_me=!0}}(this,e,l,t,n);break;case"for":D(this,e,c,t,n);break;case"cloak":e.removeAttribute("x-cloak")}})}evaluateReturnExpression(e,t,i=(()=>{})){return u(e,t,this.$data,n(n({},i()),{},{$dispatch:this.getDispatchFunction(e)}))}evaluateCommandExpression(e,t,i=(()=>{})){return function(e,t,n,i={}){return d(()=>{if("function"==typeof t)return Promise.resolve(t.call(n,i.$event));let e=Function;if(e=Object.getPrototypeOf((async function(){})).constructor,Object.keys(n).includes(t)){let e=new Function(["dataContext",...Object.keys(i)],`with(dataContext) { return ${t} }`)(n,...Object.values(i));return"function"==typeof e?Promise.resolve(e.call(n,i.$event)):Promise.resolve()}return Promise.resolve(new e(["dataContext",...Object.keys(i)],`with(dataContext) { ${t} }`)(n,...Object.values(i)))},{el:e,expression:t})}(e,t,this.$data,n(n({},i()),{},{$dispatch:this.getDispatchFunction(e)}))}getDispatchFunction(e){return(t,n={})=>{e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0}))}}listenForNewElementsToInitialize(){const e=this.$el;new MutationObserver(e=>{for(let t=0;t<e.length;t++){const n=e[t].target.closest("[x-data]");if(n&&n.isSameNode(this.$el)){if("attributes"===e[t].type&&"x-data"===e[t].attributeName){const n=e[t].target.getAttribute("x-data")||"{}",i=u(this.$el,n,{$el:this.$el});Object.keys(i).forEach(e=>{this.$data[e]!==i[e]&&(this.$data[e]=i[e])})}e[t].addedNodes.length>0&&e[t].addedNodes.forEach(e=>{1!==e.nodeType||e.__x_inserted_me||(!e.matches("[x-data]")||e.__x?this.initializeElements(e):e.__x=new fe(e))})}}}).observe(e,{childList:!0,attributes:!0,subtree:!0})}getRefsProxy(){var e=this;return new Proxy({},{get(t,n){return"$isAlpineProxy"===n||(e.walkAndSkipNestedComponents(e.$el,e=>{e.hasAttribute("x-ref")&&e.getAttribute("x-ref")===n&&(i=e)}),i);var i}})}}const pe={version:"2.8.1",pauseMutationObserver:!1,magicProperties:{},onComponentInitializeds:[],onBeforeComponentInitializeds:[],ignoreFocusedForValueBinding:!1,start:async function(){r()||await new Promise(e=>{"loading"==document.readyState?document.addEventListener("DOMContentLoaded",e):e()}),this.discoverComponents(e=>{this.initializeComponent(e)}),document.addEventListener("turbolinks:load",()=>{this.discoverUninitializedComponents(e=>{this.initializeComponent(e)})}),this.listenForNewUninitializedComponentsAtRunTime()},discoverComponents:function(e){document.querySelectorAll("[x-data]").forEach(t=>{e(t)})},discoverUninitializedComponents:function(e,t=null){const n=(t||document).querySelectorAll("[x-data]");Array.from(n).filter(e=>void 0===e.__x).forEach(t=>{e(t)})},listenForNewUninitializedComponentsAtRunTime:function(){const e=document.querySelector("body");new MutationObserver(e=>{if(!this.pauseMutationObserver)for(let t=0;t<e.length;t++)e[t].addedNodes.length>0&&e[t].addedNodes.forEach(e=>{1===e.nodeType&&(e.parentElement&&e.parentElement.closest("[x-data]")||this.discoverUninitializedComponents(e=>{this.initializeComponent(e)},e.parentElement))})}).observe(e,{childList:!0,attributes:!0,subtree:!0})},initializeComponent:function(e){if(!e.__x)try{e.__x=new fe(e)}catch(e){setTimeout(()=>{throw e},0)}},clone:function(e,t){t.__x||(t.__x=new fe(t,e))},addMagicProperty:function(e,t){this.magicProperties[e]=t},onComponentInitialized:function(e){this.onComponentInitializeds.push(e)},onBeforeComponentInitialized:function(e){this.onBeforeComponentInitializeds.push(e)}};return r()||(window.Alpine=pe,window.deferLoadingAlpine?window.deferLoadingAlpine((function(){window.Alpine.start()})):window.Alpine.start()),pe}()},function(e,t,n){"use strict";n.r(t);var i=n(2),r=n(0);let s=null;function o(){s=window.scrollY}Object(r.f)("click","[data-turbo-preserve-scroll]",o),document.addEventListener("turbo:render",(function(){s&&(window.scrollTo(0,s),s=null)}));let a=null;document.addEventListener("turbo:before-visit",(function(){document.activeElement&&(a=document.activeElement.matches("[data-turbo-permanent]")?document.activeElement:null)})),document.addEventListener("turbo:render",(function(){a&&(a.focus(),a=null)})),Object(r.f)("input","[data-turbo-search]",Object(r.c)(({target:e})=>{const t=e.value?e.dataset.turboSearchUrl.replace("%search%",e.value):e.dataset.turboSearchClearUrl;o(),i.a(t,{action:"replace"})},400))},function(e,t,n){"use strict";n.r(t);var i=n(0);function r(e){const t=function(e){if(e.matches('[type="checkbox"]'))return String(e.checked);if(e.matches('[type="radio"]')){const t=Object(i.b)(`[name="${e.name}"]`).find(e=>e.checked);return t?t.value:"null"}return e.value}(e).replace(/[\\"']/g,"\\$&").replace(/\u0000/g,"\\0");Object(i.b)(`[data-conditional-${e.dataset.conditional}]`).forEach(n=>{const i=n.matches(`[data-conditional-${e.dataset.conditional}="${t}"]`);n.classList.toggle("hidden",!i)}),Object(i.b)(`[data-conditional-unless-${e.dataset.conditional}]`).forEach(n=>{const i=!n.matches(`[data-conditional-unless-${e.dataset.conditional}="${t}"]`);n.classList.toggle("hidden",!i)})}window.addEventListener("turbo:load",()=>{Object(i.b)("[data-conditional]").forEach(r)}),Object(i.f)("change","[data-conditional]",({target:e})=>{r(e)})},function(e,t,n){"use strict";n.r(t);var i=n(0),r=n(1);function s(e){const t=Object(i.a)("[data-confirm-modal-text]");t&&(t.innerText=e)}Object(i.f)("submit","[data-confirm]",({event:e,target:t})=>{e.preventDefault(),t.dataset.confirmText&&s(t.dataset.confirmText),Object(r.showModal)("confirm",{onConfirm(){window.setTimeout(()=>{s(__("mailcoach - Are you sure?"))},150),t.submit()},onDismiss(){window.setTimeout(()=>{s(__("mailcoach - Are you sure?"))},150)}})})},function(e,t,n){"use strict";n.r(t);var i=n(3),r=n.n(i);document.addEventListener("turbo:load",(function(){document.querySelectorAll("[data-datepicker]").forEach(e=>{r()(e,{dateFormat:"Y-m-d",minDate:"today",position:"above"})})}))},function(e,t,n){"use strict";n.r(t);var i=n(2),r=n(0),s=n(1);Object(r.f)("input","[data-dirty-check]",({target:e})=>{e.dirty=!0}),Object(r.f)("click","[data-dirty-warn]",()=>{Object(r.a)("[data-dirty-check]")&&Object(r.a)("[data-dirty-check]").dirty&&document.addEventListener("turbo:before-visit",(function(e){e.preventDefault(),Object(s.showModal)("dirty-warning",{onConfirm(){i.a(e.data.url)}})}),{once:!0})})},function(e,t,n){"use strict";n.r(t);var i=n(0);Object(i.f)("click","[data-dismiss]",({target:e})=>{e.remove()}),document.addEventListener("turbo:load",()=>{Object(i.b)("[data-dismiss]").forEach(e=>{const t=Math.min(Math.max(60*e.textContent.trim().length,5e3),15e3);setTimeout(()=>{Object(i.e)(e,"fade").then(()=>{e.remove()})},t)})})},function(e,t,n){"use strict";n.r(t);var i=n(0);Object(i.f)("click","[data-dropdown-trigger]",({target:e})=>{const t=Object(i.a)("[data-dropdown-list]",e.closest("[data-dropdown]"));function n(r){t.contains(r.target)||(Object(i.e)(t,"fade"),t.style.zIndex="auto",e.classList.remove("dropdown-trigger-open"),window.removeEventListener("click",n))}t.classList.contains("hidden")&&(Object(i.d)(t,"fade"),t.style.zIndex=100,e.classList.add("dropdown-trigger-open"),setTimeout(()=>{window.addEventListener("click",n)}))})},function(e,t,n){"use strict";n.r(t);var i=n(0);function r(){const e=Object(i.a)("[data-html-preview-source]"),t=Object(i.a)("[data-html-preview-target]");e&&t&&(t.src="data:text/html;base64,"+btoa(unescape(encodeURIComponent(e.value))))}Object(i.f)("input","[data-html-preview-source]",r),document.addEventListener("turbo:load",r)},function(e,t,n){"use strict";n.r(t);var i=n(0);Object(i.f)("click","[data-navigation-trigger]",({event:e})=>{if(window.innerWidth>1024)return!0;e.preventDefault(),Object(i.a)("[data-navigation]").classList.toggle("navigation-shown")})},function(e,t,n){"use strict";n.r(t);var i=n(0);document.addEventListener("turbo:load",()=>{const e=Object(i.a)("[data-segments]");if(!e)return;const t=JSON.parse(e.dataset.segments),n=Object(i.a)("[data-segments-email-list]",e),r=Object(i.a)('[name="segment"][value="entire_list"]',e),s=Object(i.a)('[name="segment"][value="segment"]',e),o=Object(i.a)("[data-segments-create]",e),a=Object(i.a)("a",o),c=Object(i.a)("[data-segments-choose]",e),l=Object(i.a)("select",c);function d({reset:e=!1,selectedSegmentId:i=null}={}){e&&(r.checked=!0);const d=t.find(e=>e.id==n.value),u=d.segments.length>0;s.disabled=!u||s.readOnly,o.classList.toggle("hidden",u),a.href=d.createSegmentUrl,c.classList.toggle("hidden",!u),l.parentNode.classList.toggle("hidden",r.checked),l.innerHTML=d.segments.map((e,t)=>{const n=i?e.id==i:0===t;return`\n <option value="${e.id}" ${n?"selected":""}>\n ${e.name}\n </option>\n `}).join("")}d({selectedSegmentId:e.dataset.segmentsSelected}),n.addEventListener("input",()=>{d({reset:!0})}),r.addEventListener("input",()=>d()),s.addEventListener("input",()=>d())})},function(e,t,n){"use strict";n.r(t),n.d(t,"createTagsInput",(function(){return o}));var i=n(4),r=n.n(i),s=n(0);function o(e,{tags:t,selectedTags:n,canCreateNewTags:i}){let o=t.map(e=>({value:e,label:e,selected:n.includes(e),customProperties:{isCurrentSearch:!1,exists:!0}}));const a=new r.a(e,{removeItemButton:!0,noResultsText:i?__("mailcoach - Type to add tags"):__("mailcoach - No tags found"),noChoicesText:i?__("mailcoach - Type to add tags"):__("mailcoach - No tags to choose from"),itemSelectText:i?__("mailcoach - Press to add"):__("mailcoach - Press to select"),shouldSortItems:!1,choices:o});function c(e){const t=Boolean(a._currentState.choices.find(e=>e.customProperties.isCurrentSearch));(t||e)&&(t?e?function(e){d(e)?l():a._currentState.choices.forEach(t=>{t.customProperties.isCurrentSearch&&(t.value=e,t.label=e)})}(e):l():function(e){d(e)||a.setChoices([{value:e,label:e,customProperties:{isCurrentSearch:!0,exists:!1}}])}(e))}function l(){const e=a._currentState.choices.findIndex(e=>e.customProperties.isCurrentSearch);-1!==e&&a._currentState.choices.splice(e,1)}function d(e){return-1!==a._currentState.choices.findIndex(t=>!t.customProperties.isCurrentSearch&&t.value.toLowerCase()===e.toLowerCase())}return e.addEventListener("addItem",()=>{a._currentState.choices.forEach(e=>{delete e.customProperties.isCurrentSearch})}),i&&Object(s.a)("input.choices__input",e.parentNode).addEventListener("input",e=>{c(e.target.value)}),a}document.addEventListener("turbo:load",()=>{Object(s.b)("[data-tags]").forEach(e=>{window.tagsInput=o(e,{tags:JSON.parse(e.dataset.tags),selectedTags:JSON.parse(e.dataset.tagsSelected),canCreateNewTags:"tagsAllowCreate"in e.dataset})})})},function(e,t,n){"use strict";n.r(t);var i;var r="undefined"==typeof document?void 0:document,s=!!r&&"content"in r.createElement("template"),o=!!r&&r.createRange&&"createContextualFragment"in r.createRange();function a(e){return e=e.trim(),s?function(e){var t=r.createElement("template");return t.innerHTML=e,t.content.childNodes[0]}(e):o?function(e){return i||(i=r.createRange()).selectNode(r.body),i.createContextualFragment(e).childNodes[0]}(e):function(e){var t=r.createElement("body");return t.innerHTML=e,t.childNodes[0]}(e)}function c(e,t){var n,i,r=e.nodeName,s=t.nodeName;return r===s||(n=r.charCodeAt(0),i=s.charCodeAt(0),n<=90&&i>=97?r===s.toUpperCase():i<=90&&n>=97&&s===r.toUpperCase())}function l(e,t,n){e[n]!==t[n]&&(e[n]=t[n],e[n]?e.setAttribute(n,""):e.removeAttribute(n))}var d={OPTION:function(e,t){var n=e.parentNode;if(n){var i=n.nodeName.toUpperCase();"OPTGROUP"===i&&(i=(n=n.parentNode)&&n.nodeName.toUpperCase()),"SELECT"!==i||n.hasAttribute("multiple")||(e.hasAttribute("selected")&&!t.selected&&(e.setAttribute("selected","selected"),e.removeAttribute("selected")),n.selectedIndex=-1)}l(e,t,"selected")},INPUT:function(e,t){l(e,t,"checked"),l(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),t.hasAttribute("value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var n=t.value;e.value!==n&&(e.value=n);var i=e.firstChild;if(i){var r=i.nodeValue;if(r==n||!n&&r==e.placeholder)return;i.nodeValue=n}},SELECT:function(e,t){if(!t.hasAttribute("multiple")){for(var n,i,r=-1,s=0,o=e.firstChild;o;)if("OPTGROUP"===(i=o.nodeName&&o.nodeName.toUpperCase()))o=(n=o).firstChild;else{if("OPTION"===i){if(o.hasAttribute("selected")){r=s;break}s++}!(o=o.nextSibling)&&n&&(o=n.nextSibling,n=null)}e.selectedIndex=r}}};function u(){}function h(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}var m=function(e){return function(t,n,i){if(i||(i={}),"string"==typeof n)if("#document"===t.nodeName||"HTML"===t.nodeName||"BODY"===t.nodeName){var s=n;(n=r.createElement("html")).innerHTML=s}else n=a(n);var o=i.getNodeKey||h,l=i.onBeforeNodeAdded||u,m=i.onNodeAdded||u,f=i.onBeforeElUpdated||u,p=i.onElUpdated||u,g=i.onBeforeNodeDiscarded||u,v=i.onNodeDiscarded||u,b=i.onBeforeElChildrenUpdated||u,y=!0===i.childrenOnly,w=Object.create(null),E=[];function S(e){E.push(e)}function _(e,t,n){!1!==g(e)&&(t&&t.removeChild(e),v(e),function e(t,n){if(1===t.nodeType)for(var i=t.firstChild;i;){var r=void 0;n&&(r=o(i))?S(r):(v(i),i.firstChild&&e(i,n)),i=i.nextSibling}}(e,n))}function C(e){m(e);for(var t=e.firstChild;t;){var n=t.nextSibling,i=o(t);if(i){var r=w[i];r&&c(t,r)?(t.parentNode.replaceChild(r,t),x(r,t)):C(t)}else C(t);t=n}}function x(t,n,i){var s=o(n);if(s&&delete w[s],!i){if(!1===f(t,n))return;if(e(t,n),p(t),!1===b(t,n))return}"TEXTAREA"!==t.nodeName?function(e,t){var n,i,s,a,u,h=t.firstChild,m=e.firstChild;e:for(;h;){for(a=h.nextSibling,n=o(h);m;){if(s=m.nextSibling,h.isSameNode&&h.isSameNode(m)){h=a,m=s;continue e}i=o(m);var f=m.nodeType,p=void 0;if(f===h.nodeType&&(1===f?(n?n!==i&&((u=w[n])?s===u?p=!1:(e.insertBefore(u,m),i?S(i):_(m,e,!0),m=u):p=!1):i&&(p=!1),(p=!1!==p&&c(m,h))&&x(m,h)):3!==f&&8!=f||(p=!0,m.nodeValue!==h.nodeValue&&(m.nodeValue=h.nodeValue))),p){h=a,m=s;continue e}i?S(i):_(m,e,!0),m=s}if(n&&(u=w[n])&&c(u,h))e.appendChild(u),x(u,h);else{var g=l(h);!1!==g&&(g&&(h=g),h.actualize&&(h=h.actualize(e.ownerDocument||r)),e.appendChild(h),C(h))}h=a,m=s}!function(e,t,n){for(;t;){var i=t.nextSibling;(n=o(t))?S(n):_(t,e,!0),t=i}}(e,m,i);var v=d[e.nodeName];v&&v(e,t)}(t,n):d.TEXTAREA(t,n)}!function e(t){if(1===t.nodeType||11===t.nodeType)for(var n=t.firstChild;n;){var i=o(n);i&&(w[i]=n),e(n),n=n.nextSibling}}(t);var T,D,L=t,A=L.nodeType,O=n.nodeType;if(!y)if(1===A)1===O?c(t,n)||(v(t),L=function(e,t){for(var n=e.firstChild;n;){var i=n.nextSibling;t.appendChild(n),n=i}return t}(t,(T=n.nodeName,(D=n.namespaceURI)&&"http://www.w3.org/1999/xhtml"!==D?r.createElementNS(D,T):r.createElement(T)))):L=n;else if(3===A||8===A){if(O===A)return L.nodeValue!==n.nodeValue&&(L.nodeValue=n.nodeValue),L;L=n}if(L===n)v(t);else{if(n.isSameNode&&n.isSameNode(L))return;if(x(L,n,y),E)for(var I=0,M=E.length;I<M;I++){var k=w[E[I]];k&&_(k,k.parentNode,!1)}}return!y&&L!==t&&t.parentNode&&(L.actualize&&(L=L.actualize(t.ownerDocument||r)),t.parentNode.replaceChild(L,t)),L}}((function(e,t){var n,i,r,s,o=t.attributes;if(11!==t.nodeType&&11!==e.nodeType){for(var a=o.length-1;a>=0;a--)i=(n=o[a]).name,r=n.namespaceURI,s=n.value,r?(i=n.localName||i,e.getAttributeNS(r,i)!==s&&("xmlns"===n.prefix&&(i=n.name),e.setAttributeNS(r,i,s))):e.getAttribute(i)!==s&&e.setAttribute(i,s);for(var c=e.attributes,l=c.length-1;l>=0;l--)i=(n=c[l]).name,(r=n.namespaceURI)?(i=n.localName||i,t.hasAttributeNS(r,i)||e.removeAttributeNS(r,i)):t.hasAttribute(i)||e.removeAttribute(i)}})),f=n(0);let p;document.addEventListener("turbo:load",()=>{clearInterval(p),p=setInterval(()=>{const e=Object(f.b)("[data-poll]");var t;e.length&&(e.forEach(e=>{if(!e.id)throw new Error("You can't poll an element that doesn't have an ID")}),t=e,fetch("").then(e=>e.text()).then(e=>{const n=(new DOMParser).parseFromString(e,"text/html");t.forEach(e=>{const t=n.getElementById(e.id);document.body.contains(e)&&t&&m(e,t)})}))},5e3)})},function(e,t){}]);