unpoly-rails 3.10.0.rc1 → 3.10.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- (()=>{var t={1860:(t,e,n)=>{"use strict";n.r(e)},8711:(t,e,n)=>{"use strict";n.r(e)},4432:(t,e,n)=>{"use strict";n.r(e)},2065:(t,e,n)=>{"use strict";n.r(e)},35:(t,e,n)=>{"use strict";n.r(e)},5074:(t,e,n)=>{"use strict";n.r(e)},2811:()=>{up.browser={submitForm:function(t){t.submit()},canPushState:function(){return"GET"===up.protocol.initialRequestMethod()},canJQuery:function(){return!!window.jQuery},assertConfirmed:function(t){if(t.confirm&&!window.confirm(t.confirm))throw new up.Aborted("User canceled action");return!0},popCookie:function(t){let e=document.cookie.match(new RegExp(t+"=(\\w+)"))?.[1];if(e)return document.cookie=t+"=;Max-Age=0;Path=/",e}}},6346:()=>{const t=up.element,e=up.util;up.BodyShifter=class BodyShifter{constructor(){this.t=new Set,this.i=0,this.o=e.cleaner()}lowerStack(){0==--this.i&&this.o.clean()}raiseStack(){1==++this.i&&this.u()}onAnchoredElementInserted(t){return this.t.add(t),this.h(t,"right"),()=>this.t.delete(t)}l(){return this.p&&this.i>0}u(){this.p=up.viewport.rootScrollbarWidth(),this.o(t.setStyleTemp(t.root,{"--up-scrollbar-width":this.p+"px"})),this.h(document.body,"padding-right");for(let t of this.t)this.h(t,"right")}h(e,n){if(!this.l())return;let i=t.style(e,n);this.o(t.setStyleTemp(e,{["--up-original-"+n]:i}),t.addClassTemp(e,"up-scrollbar-away"))}}},7948:()=>{const t=up.util,e=up.element;up.Change.Addition=class Addition extends up.Change{constructor(t){super(t),this.m=t.acceptLayer,this.v=t.dismissLayer,this._=t.eventPlans||[],this.k=t.response}handleLayerChangeRequests(){this.layer.isOverlay()&&(this.S(),this.abortWhenLayerClosed(),this.layer.tryAcceptForLocation(this.O()),this.abortWhenLayerClosed(),this.C(),this.abortWhenLayerClosed(),this.layer.tryDismissForLocation(this.O()),this.abortWhenLayerClosed()),this.layer.asCurrent((()=>{for(let t of this._)up.emit({...t,...this.O()}),this.abortWhenLayerClosed()}))}S(){t.isDefined(this.m)&&this.layer.isOverlay()&&this.layer.accept(this.m,this.O())}C(){t.isDefined(this.v)&&this.layer.isOverlay()&&this.layer.dismiss(this.v,this.O())}abortWhenLayerClosed(t=this.layer){if(t.isClosed())throw new up.Aborted("Layer was closed")}F({oldElement:t,newElement:n,source:i}){"keep"===i&&(i=t&&up.fragment.source(t)),i&&e.setMissingAttr(n,"up-source",up.fragment.normalizeSource(i))}T({newElement:t,time:n}){e.setMissingAttr(t,"up-time",!!n&&n.toUTCString())}R({newElement:t,etag:n}){e.setMissingAttr(t,"up-etag",n||!1)}setReloadAttrs(t){this.F(t),this.T(t),this.R(t)}O(){return{response:this.k}}executeSteps(t,e,n){return new up.Change.UpdateSteps({steps:t,noneOptions:n}).execute(e)}}},3030:()=>{const t=up.util;up.Change=class Change{constructor(t){this.options=t}execute(){throw new up.NotImplemented}improveHistoryValue(e,n){return!1===e||t.isString(e)?e:n}deriveFailOptions(){return up.RenderOptions.deriveFailOptions(this.options)}}},7422:()=>{const t=up.util;up.Change.CloseLayer=class CloseLayer extends up.Change{constructor(t){super(t),this.P=t.verb,this.L=up.layer.get(t),this.A=t.origin,this.$=t.value,this.D=t.preventable??!0,this.k=t.response,this.M=t.history??!0}execute(){if(!this.L.isOpen())return Promise.resolve();if(up.browser.assertConfirmed(this.options),this.N().defaultPrevented&&this.D)throw new up.Aborted("Close event was prevented");this.H(),up.fragment.abort({reason:"Layer is closing",layer:this.L});const{parent:t}=this.L;this.L.peel(),this.L.stack.remove(this.L),this.M&&t.restoreHistory(),this.j(t),this.L.teardownHandlers(),this.L.destroyElements(this.options),this.q(t)}N(){let e=this.L.emit(this.B(`up:layer:${this.P}`),{callback:this.L.callback(`on${t.upperCaseFirst(this.P)}`),log:[`Will ${this.P} ${this.L} with value %o`,this.$]});return this.$=e.value,e}H(){let t=this.B(`up:layer:${this.P}ing`);this.L.emit(t,{log:!1})}q(e){const n=`${this.P}ed`,i=t.upperCaseFirst(n);return this.L.emit(this.B(`up:layer:${n}`),{baseLayer:e,callback:this.L.callback(`on${i}`),ensureBubbles:!0,log:[`${i} ${this.L} with value %o`,this.$]})}B(t){return up.event.build(t,{layer:this.L,value:this.$,origin:this.A,response:this.k})}j(t){this.L.overlayFocus.teardown(),t.overlayFocus?.moveToFront();let e=this.L.origin||t.element;up.focus(e,{preventScroll:!0})}}},8228:()=>{up.Change.DestroyFragment=class DestroyFragment extends up.Change{constructor(t){super(t),this.L=up.layer.get(t)||up.layer.current,this.U=this.options.element,this.I=this.options.animation,this.V=this.options.log,this.K=this.options.onFinished}execute(){this.X=this.U.parentNode,up.fragment.markAsDestroying(this.U),up.motion.willAnimate(this.U,this.I,this.options)?this.W():this.G()}async W(){this.J(),await this.Y(),this.Z(),this.K?.()}G(){this.Z(),this.J(),this.K?.()}Y(){return up.motion.animate(this.U,this.I,this.options)}Z(){this.L.asCurrent((()=>{up.fragment.abort(this.U),up.script.clean(this.U,{layer:this.L}),up.element.cleanJQuery(this.U),this.U.remove()}))}J(){up.fragment.emitDestroyed(this.U,{parent:this.X,log:this.V})}}},9005:()=>{var t;const e=up.util;up.Change.FromContent=(t=class FromContent extends up.Change{constructor(t){super(t),this.A=t.origin,this.tt=t.preflight,this.et=up.layer.getAll(t)}nt(){let t=[];return this.it(),this.st(),this.rt(t,this.et,this.options.target),this.rt(t,this.et,this.options.fallback),t}ot(t){return"new"===t||t.isOpen()}it(){this.et=e.filter(this.et,this.ot)}rt(t,e,n){for(let i of e)for(let e of this.ut(n,i)){const n={...this.options,target:e,layer:i,defaultPlacement:this.ht()},s="new"===i?new up.Change.OpenLayer(n):new up.Change.UpdateLayer(n);t.push(s)}}ut(t,e){return up.fragment.expandTargets(t,{layer:e,mode:this.options.mode,origin:this.A})}execute(){return this.options.preload?Promise.resolve():this.ct(this.lt.bind(this))||this.ft()}lt(t){let e=t.execute(this.dt(),this.gt.bind(this,t));return e.options=this.options,e}yt(t){return!(t instanceof up.CannotMatch)}gt(t){let e=this.nt()[0];t!==e&&up.puts("up.render()",'Could not match primary target "%s". Updating a fallback target "%s".',e.target,t.target);let{assets:n}=this.dt();n&&up.script.assertAssetsOK(n,t.options),this.options.onRender?.()}dt(){if(this.tt)return;const t=e.pick(this.options,["target","content","fragment","document","html","cspNonces","origin","data"]);return up.migrate.handleResponseDocOptions?.(t),"content"===this.ht()&&(t.target=this.wt(t.target)),new up.ResponseDoc(t)}st(){if(this.tt)return;let t=this.dt();this.options.fragment&&(this.options.target||=t.rootSelector()),this.options.title=this.improveHistoryValue(this.options.title,t.title),this.options.metaTags=this.improveHistoryValue(this.options.metaTags,t.metaTags),this.options.lang=this.improveHistoryValue(this.options.lang,t.lang)}ht(){if(!this.options.document&&!this.options.fragment)return"content"}wt(t){let e=this.et[0]||up.layer.root;return this.ut(t||":main",e)[0]}getPreflightProps(t={}){return this.ct((t=>t.getPreflightProps()))||t.optional||this.bt()}bt(){this.vt("Could not find target in current page")}ft(){this.vt("Could not find common target in current page and response")}vt(t){if(this.nt().length){const n=e.uniq(e.map(this.nt(),"target")),i=up.layer.optionToString(this.options.layer);throw new up.CannotMatch([t+" (tried selectors %o in %s)",n,i])}if(0!==this.et.length)throw this.options.failPrefixForced?new up.CannotMatch("No target selector given for failed responses (https://unpoly.com/failed-responses)"):new up.CannotMatch("No target selector given");this._t()}_t(){throw new up.CannotMatch("Could not find a layer to render in. You may have passed an unmatchable layer reference, or a detached element.")}ct(t){for(let e of this.nt())try{return t(e)}catch(t){if(this.yt(t))throw t}}},e.memoizeMethod(t.prototype,{nt:!0,dt:!0,getPreflightProps:!0}),t)},278:()=>{var t;const e=up.util;up.Change.FromResponse=(t=class FromResponse extends up.Change{constructor(t){super(t),this.k=t.response,this.kt=this.k.request}execute(){if(up.fragment.config.skipResponse(this.St())?this.xt():this.kt.assertEmitted("up:fragment:loaded",{...this.St(),callback:this.options.onLoaded,log:["Loaded fragment from %s",this.k.description],skip:()=>this.xt()}),e.evalOption(this.options.fail,this.k)??!this.k.ok)throw this.Et(this.deriveFailOptions());return this.Et(this.options)}xt(){up.puts("up.render()","Skipping "+this.k.description),this.options.target=":none",this.options.failTarget=":none"}Et(t){t.failPrefixForced&&up.puts("up.render()","Rendering failed response using fail-prefixed options (https://unpoly.com/failed-responses)"),this.Ot(t),t.meta=this.Ct();let e=new up.Change.FromContent(t).execute();return e.finished=this.finish(e,t),e}async finish(t,e){return t=await t.finished,up.fragment.shouldRevalidate(this.kt,this.k,e)&&(t=await this.Ft(t,e)),t}async Ft(t,e){let n=e.target,i=t.target;if(/:(before|after)/.test(n))up.warn("up.render()","Cannot revalidate cache when prepending/appending (target %s)",n);else{up.puts("up.render()",'Revalidating cached response for target "%s"',i);let n=await up.reload(i,{...e,...up.RenderOptions.NO_MOTION,...up.RenderOptions.NO_INPUT_INTERFERENCE,...up.RenderOptions.NO_PREVIEWS,preferOldElements:t.fragments,layer:t.layer,onFinished:null,expiredResponse:this.k,preview:this.Tt(e),abort:!1,cache:!1,background:!0});n.none||(t=n)}return t}Tt({preview:t,revalidatePreview:e}){return!0===e?t:e}St(){const{expiredResponse:t}=this.options;return{request:this.kt,response:this.k,renderOptions:this.options,revalidating:!!t,expiredResponse:t}}Ct(){let t={revalidating:!!this.options.expiredResponse};return up.migrate.processCompilerPassMeta?.(t,this.k),t}Ot(t){const n=this.k.url;let i=n,s=this.kt.hash;s&&(t.hash=s,i+=s),"GET"===this.k.method?t.source=this.improveHistoryValue(t.source,n):(t.source=this.improveHistoryValue(t.source,"keep"),t.history=!!t.location),t.location=this.improveHistoryValue(t.location,i),t.title=this.improveHistoryValue(t.title,this.k.title),t.eventPlans=this.k.eventPlans;let r=this.k.target;r&&(t.target=r),t.acceptLayer=this.k.acceptLayer,t.dismissLayer=this.k.dismissLayer,t.document=this.k.text,this.k.none&&(t.target=":none"),t.context=e.merge(t.context,this.k.context),t.cspNonces=this.k.cspNonces,t.time??=this.k.lastModified,t.etag??=this.k.etag}},e.memoizeMethod(t.prototype,{St:!0}),t)},2200:()=>{var t;const e=up.util;up.Change.FromURL=(t=class FromURL extends up.Change{async execute(){let t=this.Rt();return t?(up.puts("up.render()",t),up.network.loadPage(this.options),e.unresolvablePromise()):(this.request=up.request(this.Pt()),this.options.preload?this.request:(this.Lt(),await e.always(this.request,(t=>this.At(t)))))}Lt(){this.options.onRequestProcessed?.(this.request),this.request.runPreviews(this.options)}Rt(){return e.isCrossOrigin(this.options.url)?"Loading cross-origin content in new page":this.options.history&&!up.browser.canPushState()?"Loading content in new page to restore history support":void 0}Pt(){const t=this.$t(this.options),n=this.$t(this.deriveFailOptions(),{optional:!0});return{...this.options,...t,...e.withRenamedKeys(n,up.fragment.failKey),onProcessed:this.Lt.bind(this)}}getPreflightProps(){return this.Pt()}$t(t,e){return new up.Change.FromContent({...t,preflight:!0}).getPreflightProps(e)}At(t){return t instanceof up.Response?this.Dt(t):this.Mt(t)}Dt(t){return new up.Change.FromResponse({...this.options,response:t}).execute()}Mt(t){throw t instanceof up.Offline&&this.request.emit("up:fragment:offline",{callback:this.options.onOffline,renderOptions:this.options,retry:t=>up.render({...this.options,...t}),log:["Cannot load fragment from %s: %s",this.request.description,t.reason]}),t}},e.memoizeMethod(t.prototype,{Pt:!0}),t)},7050:()=>{let t=up.util;up.Change.OpenLayer=class OpenLayer extends up.Change.Addition{constructor(t){super(t),this.target=t.target,this.A=t.origin,this.Nt=t.baseLayer}getPreflightProps(){return{mode:this.options.mode,context:this.Ht().context,origin:this.options.origin,target:this.target,bindLayer:this.Nt,layer:"new",bindFragments:t.compact([up.fragment.get(":main",{layer:this.Nt})]),fragments:[]}}execute(t,e){this.responseDoc=t,this.jt(),e(),this.qt();let n=this.layer.on("up:layer:accepting up:layer:dimissing",this.Bt.bind(this));try{return this.Ut(),this.Bt(),up.RenderResult.both(this.It,this.zt)}finally{n()}}jt(){if(":none"===this.target?this.Vt=document.createElement("up-none"):this.Vt=this.responseDoc.select(this.target),!this.Vt||this.Nt.isClosed())throw new up.CannotMatch}qt(){up.puts("up.render()",`Opening element "${this.target}" in new overlay`),this.Kt(),this.layer=this.Ht(),this.Nt.peel({history:!this.layer.history}),up.layer.stack.push(this.layer),this.layer.createElements(),this.layer.setupHandlers()}Ut(){this.Xt(),this.handleLayerChangeRequests(),this.responseDoc.commitElement(this.Vt),this.layer.setContent(this.Vt),this.setReloadAttrs({newElement:this.Vt,source:this.options.source}),this.responseDoc.finalizeElement(this.Vt),this.It=new up.RenderResult({layer:this.layer,fragments:[this.Vt],target:this.target}),up.hello(this.layer.element,{...this.options,layer:this.layer,dataRoot:this.Vt}),this.Wt(),this.It.finished=this.Gt(),this.layer.opening=!1,this.Jt(),this.abortWhenLayerClosed()}Bt(){if(this.zt)return;let t=this.Qt().other;this.zt=this.executeSteps(t,this.responseDoc)}async Gt(){return await this.layer.startOpenAnimation(),this.abortWhenLayerClosed(),this.j(),this.It}Ht(){const t={...this.options,opening:!0};return up.layer.build(t,(t=>this.options=up.RenderOptions.finalize(t)))}Xt(){"auto"===this.layer.history&&(this.layer.history=up.fragment.hasAutoHistory([this.Vt],this.layer));let{parent:t}=this.layer;this.layer.history&&=t.history,t.saveHistory(),this.layer.updateHistory(this.options)}j(){this.Nt.overlayFocus?.moveToBack(),this.layer.overlayFocus.moveToFront(),new up.FragmentFocus({fragment:this.Vt,layer:this.layer,autoMeans:["autofocus","layer"],inputDevice:this.options.inputDevice}).process(this.options.focus)}Wt(){const t={...this.options,fragment:this.Vt,layer:this.layer,autoMeans:["hash","layer"]};new up.FragmentScrolling(t).process(this.options.scroll)}Kt(){up.event.assertEmitted("up:layer:open",{origin:this.A,baseLayer:this.Nt,layerOptions:this.options,log:"Opening new overlay"})}Jt(){this.layer.emit("up:layer:opened",{origin:this.A,callback:this.layer.callback("onOpened"),log:`Opened new ${this.layer}`})}Qt(){return up.radio.hungrySteps(this.Yt())}Yt(){return{...this.options,layer:this.layer,history:this.layer.history}}}},9441:()=>{var t;const e=up.util;up.Change.UpdateLayer=(t=class UpdateLayer extends up.Change.Addition{constructor(t){super(t=up.RenderOptions.finalize(t)),this.layer=t.layer,this.target=t.target,this.Zt=t.context,this.te=up.fragment.parseTargetSteps(this.target,this.options)}getPreflightProps(){this.ee();let t=this.ne();return{layer:this.layer,bindLayer:this.layer,mode:this.layer.mode,context:e.merge(this.layer.context,this.Zt),origin:this.options.origin,target:this.ie(),fragments:t,bindFragments:t}}ie(){return this.ee(),up.fragment.targetForSteps(this.te)}ne(){return this.ee(),e.map(this.te,"oldElement")}execute(t,e){this.responseDoc=t,this.jt(),e();let n=this.layer.on("up:layer:accepting up:layer:dimissing",this.Bt.bind(this));try{return this.se(),this.Bt(),up.RenderResult.both(this.re,this.zt)}finally{n()}}se(){this.te.length&&up.puts("up.render()",`Updating "${this.ie()}" in ${this.layer}`),this.oe(),this.options.saveScroll&&up.viewport.saveScroll({layer:this.layer}),this.options.saveFocus&&up.viewport.saveFocus({layer:this.layer}),this.options.peel&&this.layer.peel({history:!this.ue()}),!1!==this.options.abort&&up.fragment.abort(this.ne(),{reason:"Fragment is being replaced"}),Object.assign(this.layer.context,this.Zt),this.ue()&&this.layer.updateHistory(this.options),this.handleLayerChangeRequests(),this.re=this.executeSteps(this.te,this.responseDoc,this.options)}Bt(){if(this.zt)return;let t=this.Qt().other;this.zt=this.executeSteps(t,this.responseDoc)}ee(){this.ae(),this.he()}jt(){this.ae(),this.ce(),this.he(),this.le()}ce(){this.te.push(...this.Qt().current)}ae(){this.te=this.te.filter((t=>{const n=new up.FragmentFinder(e.pick(t,["selector","origin","layer","match","preferOldElements"]));if(t.oldElement||=n.find(),t.oldElement)return!0;if(!t.maybe)throw new up.CannotMatch}))}le(){this.te=this.responseDoc.selectSteps(this.te)}he(){this.te=up.fragment.compressNestedSteps(this.te)}Qt(){return up.radio.hungrySteps(this.Yt())}oe(){let t=up.FocusCapsule.preserve(this.layer);this.te.forEach(((e,n)=>{e.focusCapsule=t,n>0&&(e.scroll=!1,e.focus=!1)}))}ue(){return e.evalAutoOption(this.options.history,this.pe.bind(this))}pe(){const t=e.map(this.te,"oldElement");return up.fragment.hasAutoHistory(t,this.layer)}Yt(){return{...this.options,layer:this.layer,history:this.ue()}}},e.memoizeMethod(t.prototype,{ee:!0,ae:!0,ue:!0,Qt:!0}),t)},9489:()=>{const t=up.util,e=up.element;up.Change.UpdateSteps=class UpdateSteps extends up.Change.Addition{constructor(e){super(e),this.fe=e.noneOptions||{},this.te=t.copy(e.steps)}execute(t){if(this.responseDoc=t,this.te=t.selectSteps(this.te),this.te=t.commitSteps(this.te),!this.te.length)return this.de();this.renderResult=new up.RenderResult({layer:this.te[0]?.layer,target:up.fragment.targetForSteps(this.te)}),this.te.reverse();const e=this.te.map((t=>this.me(t)));return this.renderResult.finished=this.Gt(e),this.renderResult}de(){return this.j(null,this.fe),this.Wt(null,this.fe),up.RenderResult.buildNone()}async Gt(t){await Promise.all(t);for(let t of this.te)this.abortWhenLayerClosed(t.layer);return this.renderResult}ge(t){let e=t.matches("up-wrapper")?t.children:[t];this.renderResult.fragments.unshift(...e)}me(t){switch(this.setReloadAttrs(t),t.placement){case"swap":if(this.ye(t))return this.j(t.oldElement,t),this.Wt(t.oldElement,t),Promise.resolve();{this.we(t);const n=t.oldElement.parentNode,i={...t,beforeStart(){up.fragment.markAsDestroying(t.oldElement)},afterInsert:()=>{this.be(t),this.responseDoc.finalizeElement(t.newElement),this.ve(t),up.hello(t.newElement,t),this.ge(t.newElement)},beforeDetach:()=>{up.script.clean(t.oldElement,{layer:t.layer})},afterDetach(){e.cleanJQuery(),up.fragment.emitDestroyed(t.oldElement,{parent:n,log:!1})},scrollNew:()=>{this.j(t.newElement,t),this.Wt(t.newElement,t)}};return up.morph(t.oldElement,t.newElement,t.transition,i)}case"content":{let n=e.wrapChildren(t.oldElement),i=e.wrapChildren(t.newElement),s={...t,placement:"swap",oldElement:n,newElement:i,focus:!1};return this.me(s).then((()=>{e.unwrap(i),this.j(t.oldElement,t)}))}case"before":case"after":{let n=e.wrapChildren(t.newElement),i="before"===t.placement?"afterbegin":"beforeend";return t.oldElement.insertAdjacentElement(i,n),this.responseDoc.finalizeElement(n),up.hello(n,t),this.ge(n),this.j(n,t),this.Wt(n,t),up.animate(n,t.transition,t).then((()=>e.unwrap(n)))}default:up.fail("Unknown placement: %o",t.placement)}}ye(t){if(!t.keep)return;const{oldElement:n,newElement:i}=t;let s;if(!e.booleanAttr(n,"up-keep"))return;let r=up.fragment.toTarget(n);const o={layer:t.layer};if(s=t.descendantsOnly?up.fragment.get(i,r,o):e.subtreeFirst(i,r,o),s&&!1!==e.booleanAttr(s,"up-keep")){const e={oldElement:n,newElement:s,newData:up.script.data(s),renderOptions:t};if(!up.fragment.emitKeep(e).defaultPrevented)return e}}we(t){const e=[];if(t.keep)for(let n of t.oldElement.querySelectorAll("[up-keep]")){let i=this.ye({...t,oldElement:n,descendantsOnly:!0});if(i){const t=n.cloneNode(!0);n.insertAdjacentElement("beforebegin",t),n.classList.add("up-keeping"),up.script.disableSubtree(i.newElement);let s=up.viewport.subtree(i.oldElement);i.revivers=s.map((function(t){let e=up.viewport.copyCursorProps(t);return()=>up.viewport.copyCursorProps(e,t)})),this._e(document.body)?i.newElement.replaceWith(n):document.body.append(n),e.push(i)}}t.keepPlans=e}be(t){for(let e of t.keepPlans){e.newElement.replaceWith(e.oldElement);for(let t of e.revivers)t()}}ve(t){for(let e of t.keepPlans)e.oldElement.classList.remove("up-keeping")}_e(e){return t.some(this.te,(t=>t.oldElement.contains(e)))}j(t,e){return new up.FragmentFocus({...e,fragment:t,autoMeans:up.fragment.config.autoFocus}).process(e.focus)}Wt(t,e){return new up.FragmentScrolling({...e,fragment:t,autoMeans:up.fragment.config.autoScroll}).process(e.scroll)}}},1569:()=>{const t=up.util;up.CompilerPass=class CompilerPass{constructor(t,e,{layer:n,data:i,dataRoot:s,dataMap:r,meta:o}){n||=up.layer.get(t)||up.layer.current,this.ke=t,this.Se=e,this.L=n,this.xe=i,this.Ee=s||t,this.Oe=r,o||={},o.layer=n,this.Ce=o}run(){this.L.asCurrent((()=>{this.setCompileData();for(let t of this.Se)this.Fe(t)}))}setCompileData(){if(this.xe&&(this.Ee.upCompileData=this.xe),this.Oe)for(let t in this.Oe)for(let e of this.Te(t))e.upCompileData=this.Oe[t]}Fe(t){const e=this.Re(t);if(e.length){if(t.isDefault||up.puts("up.hello()",'Compiling %d× "%s" on %s',e.length,t.selector,this.L),t.batch)this.Pe(t,e);else for(let n of e)this.Le(t,n);return up.migrate.postCompile?.(e,t)}}Le(t,e){const n=[e];if(1!==t.length){const t=up.script.data(e);n.push(t,this.Ce)}const i=this.Ae(t,e,n);up.destructor(e,i)}Pe(e,n){const i=[n];if(1!==e.length){const e=t.map(n,up.script.data);i.push(e,this.Ce)}this.Ae(e,n,i)&&up.fail("Compilers with { batch: true } cannot return destructors")}Ae(t,e,n){return up.error.guard((()=>t.apply(e,n)))}Te(e){return up.fragment.subtree(this.ke,t.evalOption(e),{layer:this.L})}Re(e){let n=this.Te(e.selector);return t.filter(n,(t=>{let n=t.upAppliedCompilers||=new Set;if(!n.has(e))return n.add(e),!0}))}}},3742:()=>{const t=up.util,e=up.element;up.Config=class Config{constructor(t=(()=>({}))){this.$e=t,this.reset(),document.addEventListener("up:framework:reset",(()=>this.reset()))}reset(){Object.assign(this,this.$e())}matches(t,e){return t.matches(this.selector(e))}selector(n){let i=this[n],s=this["no"+t.upperCaseFirst(n)];return e.unionSelector(i,s)}selectorFn(t){return()=>this.selector(t)}}},2737:()=>{const t=up.util,e=up.element;up.CSSTransition=class CSSTransition{constructor(t,e,n){this.U=t,this.De=e,this.Me=Object.keys(this.De),this.Ne=n.finishEvent,this.He=n.duration,this.je=n.easing,this.qe=!1}start(){return 0===this.Me.length?(this.qe=!0,Promise.resolve()):(this.Be=t.newDeferred(),this.Ue(),this.Ie=new Date,this.ze(),this.Ve(),this.Ke(),this.Xe(),this.Be)}Ve(){this.Ne&&(this.We=up.on(this.U,this.Ne,this.Ge.bind(this)))}Ge(t){t.stopPropagation(),this.Gt()}ze(){this.Je=t.timer(this.He+100,(()=>this.Gt()))}Qe(){clearTimeout(this.Je)}Ke(){this.Ye=up.on(this.U,"transitionend",this.Ze.bind(this))}Ze(e){if(e.target!==this.U)return;if(new Date-this.Ie<=.25*this.He)return;const n=e.propertyName;t.contains(this.Me,n)&&this.Gt()}Gt(){this.qe||(this.qe=!0,this.Qe(),this.We?.(),this.Ye?.(),e.concludeCSSTransition(this.U),this.tn(),this.Be.resolve())}Ue(){const t=e.style(this.U,["transition-property","transition-duration","transition-delay","transition-timing-function"]);if(e.hasCSSTransition(t)){if("all"!==t["transition-property"]){const n=t["transition-property"].split(/\s*,\s*/),i=e.style(this.U,n);this.en=e.setStyleTemp(this.U,i)}this.nn=e.concludeCSSTransition(this.U)}}tn(){this.en?.(),this.nn?.()}Xe(){e.setStyle(this.U,{"transition-property":this.Me.join(),"transition-duration":`${this.He}ms`,"transition-timing-function":this.je}),e.setStyle(this.U,this.De)}}},3635:()=>{const t=up.util;up.DestructorPass=class DestructorPass{constructor(t,e){this.sn=t,this.rn=e}run(){for(let e of this.un()){let n=t.pluckKey(e,"upDestructors");n?.clean(e)}}un(){const t={...this.rn,destroying:!0};return up.fragment.subtree(this.sn,".up-can-clean",t)}}},1906:()=>{const t=up.util,e=up.element;up.EventEmitter=class EventEmitter extends up.Record{keys(){return["target","event","baseLayer","callback","log","ensureBubbles"]}emit(){return this.an(),this.baseLayer?this.baseLayer.asCurrent((()=>this.hn())):this.hn(),this.event}hn(){this.target.dispatchEvent(this.event),this.ensureBubbles&&!this.target.isConnected&&document.dispatchEvent(this.event),up.error.guard((()=>this.callback?.(this.event)))}assertEmitted(){const t=this.emit();if(t.defaultPrevented)throw new up.Aborted(`Event ${t.type} was prevented`)}an(){if(!up.log.config.enabled)return;let e,n=this.log;t.isArray(n)?[n,...e]=n:e=[];const{type:i}=this.event;t.isString(n)?up.puts(i,n,...e):!1!==n&&up.puts(i,`Event ${i}`)}static fromEmitArgs(n,i={}){let s,r=t.extractOptions(n);return r=t.merge(i,r),t.isElementLike(n[0])?r.target=e.get(n.shift()):n[0]instanceof up.Layer&&(r.layer=n.shift()),t.isGiven(r.layer)&&(s=up.layer.get(r.layer),r.target||=s.element,r.baseLayer||=s),r.baseLayer&&(r.baseLayer=up.layer.get(r.baseLayer)),t.isString(r.target)?r.target=up.fragment.get(r.target,{layer:r.layer}):r.target||(r.target=document),n[0]?.preventDefault?(r.event=n[0],r.log??=n[0].log):t.isString(n[0])?r.event=up.event.build(n[0],r):r.event=up.event.build(r),new this(r)}}},4158:()=>{const t=up.util;up.EventListener=class EventListener extends up.Record{keys(){return["element","eventType","selector","callback","guard","baseLayer","passive","once","capture","beforeBoot"]}constructor(t){super(t),this.cn=this.constructor.ln(t),this.isDefault=up.framework.evaling,this.beforeBoot??=0===this.eventType.indexOf("up:framework:"),this.nativeCallback=this.nativeCallback.bind(this)}bind(){const t=this.element.upEventListeners||={};t[this.cn]&&up.fail("up.on(): The %o callback %o cannot be registered more than once",this.eventType,this.callback),t[this.cn]=this,this.element.addEventListener(...this.pn())}pn(){let e=t.compactObject(t.pick(this,["once","passive","capture"]));return[this.eventType,this.nativeCallback,e]}unbind(){let t=this.element.upEventListeners;t&&delete t[this.cn],this.element.removeEventListener(...this.pn())}nativeCallback(e){if(up.framework.beforeBoot&&!this.beforeBoot)return;let n=e.target;if(this.selector&&(n=n.closest(t.evalOption(this.selector))),(!this.guard||this.guard(e))&&n){const t=[e,n],i=this.callback.length;if(1!==i&&2!==i){const e=up.script.data(n);t.push(e)}if("click"===this.eventType&&n.disabled)return;const s=this.callback.bind(n,...t);this.baseLayer?this.baseLayer.asCurrent(s):s()}}static fromElement(t){let e=t.element.upEventListeners;if(e)return e[this.ln(t)]}static ln(e){return e.callback.upUid||=t.uid(),[e.eventType,e.selector,e.callback.upUid].join("|")}static allNonDefault(e){let n=e.upEventListeners;if(n){const e=Object.values(n);return t.reject(e,"isDefault")}return[]}}},3139:()=>{const t=up.util;up.EventListenerGroup=class EventListenerGroup extends up.Record{keys(){return["elements","eventTypes","selector","callback","guard","baseLayer","passive","once","capture","beforeBoot"]}bind(){const e=t.cleaner();return this.fn((function(t){const n=new up.EventListener(t);return n.bind(),e(n.unbind.bind(n))})),e.clean}fn(t){for(let e of this.elements)for(let n of this.eventTypes)t(this.dn(e,n))}dn(t,e){return{...this.attributes(),element:t,eventType:e}}unbind(){this.fn((function(t){let e=up.EventListener.fromElement(t);e&&e.unbind()}))}static fromBindArgs(e,n){const i=(e=t.copy(e)).pop();let s;s=e[0].addEventListener?[e.shift()]:t.isJQuery(e[0])||t.isList(e[0])&&e[0][0].addEventListener?e.shift():[document];let r=t.getSimpleTokens(e.shift()),o=up.migrate.fixEventTypes;o&&(r=o(r));const u=t.extractOptions(e);return new this({elements:s,eventTypes:r,selector:e[0],callback:i,...u,...n})}}},2214:()=>{const t=up.util;up.FieldWatcher=class FieldWatcher{constructor(t,e,n){this.rn=e,this.ke=t,this.mn=up.form.getScope(t),this.gn=n,this.yn=e.batch}start(){this.wn=null,this.bn=this.vn(),this._n=null,this.kn=!1,this.o=t.cleaner(),this.Sn(this.ke),this.ke.addEventListener("up:fragment:inserted",(({target:t})=>{t!==this.ke&&this.Sn(t)})),this.o(up.fragment.onAborted(this.mn,(()=>this.xn()))),this.o(up.on(this.mn,"reset",(()=>this.En())))}stop(){this.xn(),this.o.clean()}On(e){let n=t.copy(this.rn);return up.form.watchOptions(e,n,{defaults:{event:"input"}})}Sn(t){for(let e of up.form.fields(t))this.Cn(e)}Cn(t){let e=this.On(t);this.o(up.on(t,e.event,(()=>this.Fn(e))))}xn(){this.wn=null}Tn(e,n){this.wn=e,this.Rn=n;let i=n.delay||0;clearTimeout(this._n),this._n=t.timer(i,(()=>{this._n=null,this.Pn()}))}Ln(e){return!t.isEqual(e,this.bn)&&!t.isEqual(this.wn,e)}async Pn(){if(!this.wn)return;if(this.kn)return;if(this._n)return;if(!this.mn.isConnected)return;let e=t.omit(this.Rn,["event","delay"]);const n=this.An(this.bn,this.wn);this.bn=this.wn,this.wn=null,this.kn=!0,this.Rn=null;const i=[];if(this.yn)i.push(this.$n(n,e));else for(let t in n){const s=n[t];i.push(this.$n(s,t,e))}if(t.some(i,t.isPromise)){let t=Promise.allSettled(i);await t}this.kn=!1,this.Pn()}$n(...t){return up.error.guard(this.gn,...t)}An(e,n){const i={};let s=Object.keys(e);s=s.concat(Object.keys(n)),s=t.uniq(s);for(let r of s){const s=e[r],o=n[r];t.isEqual(s,o)||(i[r]=o)}return i}vn(){return up.Params.fromContainer(this.ke).toObject()}Fn(t={}){const e=this.vn();this.Ln(e)&&this.Tn(e,t)}En(){t.task((()=>this.Fn()))}}},5949:()=>{const t=up.util;up.FIFOCache=class FIFOCache{constructor({capacity:e=10,normalizeKey:n=t.identity}={}){this.Dn=new Map,this.Mn=e,this.Nn=n}get(t){return t=this.Nn(t),this.Dn.get(t)}set(t,e){if(this.Dn.size===this.Mn){let t=this.Dn.keys().next().value;this.Dn.delete(t)}t=this.Nn(t),this.Dn.set(t,e)}clear(){this.Dn.clear()}}},665:()=>{up.FocusCapsule=class FocusCapsule{constructor(t,e,n){this.U=t,this.Hn=e,this.jn=n}wasLost(){return document.activeElement!==this.U}restore(t,e){let n=up.fragment.get(this.Hn,{layer:t});if(n)return up.viewport.copyCursorProps(this.jn,n),up.focus(n,e),!0}static preserve(t){let e=up.viewport.focusedElementWithin(t.element);if(!e)return;let n=up.fragment.tryToTarget(e);return n?new this(e,n,up.viewport.copyCursorProps(e)):void 0}}},5240:()=>{const t=up.util,e=up.element;up.FormValidator=class FormValidator{constructor(t){this.qn=t,this.Bn=[],this.Un=null,this.In=!1,this.zn(),this.Vn()}Vn(){up.fragment.onAborted(this.qn,(t=>this.Kn(t)))}Kn(t){this.Bn.length&&(this.Bn=[],this.Xn.reject(new up.Aborted(t.reason)),this.zn())}zn(){this.Xn=t.newDeferred()}watchContainer(t){let{event:e}=this.Wn(t);up.on(t,e,{guard:()=>up.fragment.isAlive(t)},(()=>up.error.muteUncriticalRejection(this.validate({origin:t}))))}validate(t={}){let e=this.Gn(t);return this.Bn.push(...e),this.Jn(),this.Xn}Gn(t){let e=this.Qn(t)||this.Yn(t)||this.Zn(t.origin);for(let n of e)n.renderOptions=this.Wn(n.origin,t),n.target=up.fragment.resolveOrigin(n.target,n);return e}Yn({origin:t,...e}){if(up.form.isField(t))return this.ti(t)||this.ei(t,e)}ei(t,{formGroup:e=!0}){if(!e)return;let n=up.form.groupSolution(t);return n?(up.puts("up.validate()","Validating form group of field %o",t),[n]):void 0}Qn({target:e,origin:n}){if(t.isString(e)){up.puts("up.validate()",'Validating target "%s"',e);let i=up.fragment.splitTarget(e);return t.compact(i.map((function(t){let e=up.fragment.get(t,{origin:n});if(e)return{element:e,target:t,origin:n};up.fail('Validation target "%s" does not match an element',t)})))}}Zn(t){return up.puts("up.validate()","Validating element %o",t),[{element:t,target:up.fragment.toTarget(t),origin:t}]}ti(t){let n=t.closest("[up-validate]");if(n){let i=e.booleanOrStringAttr(n,"up-validate");return this.Qn({target:i,origin:t})}}Wn(t,e){return up.form.watchOptions(t,e,{defaults:{event:"change"}})}Jn(){let e=this.Bn.map((t=>t.renderOptions.delay)),n=Math.min(...e)||0;clearTimeout(this.Un),this.Un=t.timer(n,(()=>{this.Un=null,this.ni()}))}ni(){up.error.muteUncriticalRejection(this.ii())}async ii(){if(!this.Bn.length)return;if(this.In)return;if(this.Un)return;let t=this.si(this.Bn);this.Bn=[],this.In=!0;let e=this.Xn;this.zn();try{e.resolve(up.render(t)),await e}finally{this.In=!1,this.ni()}}si(e){let n=t.map(e,"origin"),i=t.flatMap(n,up.form.fields),s=t.uniq(t.map(i,"name")),r=t.map(e,"renderOptions"),o=t.mergeDefined(...r,up.form.destinationOptions(this.qn));return o.target=t.map(e,"target").join(", "),o.origin=this.qn,o.focus??="keep",o.failOptions=!1,o.defaultMaybe=!0,o.params=up.Params.merge(o.params,...t.map(r,"params")),o.headers=t.merge(o.headers,...t.map(r,"headers")),this.ri(o.headers,s),o.feedback=t.some(r,"feedback"),o.data=void 0,o.dataMap=t.mapObject(e,(({target:t,element:e,renderOptions:{data:n,keepData:i}})=>[t,i?up.data(e):n])),o.preview=void 0,o.previewMap=t.mapObject(e,(({target:t,renderOptions:{preview:e}})=>[t,e])),o.placeholder=void 0,o.placeholderMap=t.mapObject(e,(({target:t,renderOptions:{placeholder:e}})=>[t,e])),o.disable=e.map((t=>up.fragment.resolveOrigin(t.renderOptions.disable,t))),o.guardEvent=up.event.build("up:form:validate",{fields:i,log:"Validating form",params:o.params,form:this.qn}),o}ri(t,e){let n=up.protocol.headerize("validate"),i=e.join(" ");(!i||i.length>up.protocol.config.maxHeaderSize)&&(i=":unknown"),t[n]=i}static forElement(t){let e=up.form.get(t);return e.upFormValidator||=new this(e)}}},2587:()=>{const t=up.util,e=/^([^ >+(]+) (.+)$/;up.FragmentFinder=class FragmentFinder{constructor(t){this.rn=t,this.A=t.origin,this.oi=t.selector,this.ui=t.document||window.document,this.ai=t.match??up.fragment.config.match,this.hi=t.preferOldElements}find(){return this.ci()||this.li()||this.pi()}ci(){if(this.hi)return this.hi.find((t=>this.ui.contains(t)&&up.fragment.matches(t,this.oi)))}li(){if("region"===this.ai&&!up.fragment.containsMainPseudo(this.oi)&&this.A?.isConnected)return this.fi()||this.di()}fi(){return up.fragment.closest(this.A,this.oi,this.rn)}di(){let n=up.fragment.splitTarget(this.oi);return t.findResult(n,(t=>{let n=t.match(e);if(n){let t=up.fragment.closest(this.A,n[1],this.rn);if(t)return up.fragment.getFirstDescendant(t,n[2])}}))}pi(){return up.fragment.getFirstDescendant(this.ui,this.oi,this.rn)}}},7031:()=>{const t=up.util,e=up.element,n={preventScroll:!0};up.FragmentFocus=class FragmentFocus extends up.FragmentProcessor{keys(){return super.keys().concat(["hash","focusCapsule","inputDevice"])}processPrimitive(e){switch(e){case"keep":return this.mi();case"restore":return this.gi();case"target":case!0:return this.yi(this.fragment);case"layer":return this.yi(this.layer.getFocusElement());case"main":return this.wi(":main");case"hash":return this.bi();case"autofocus":return this.vi();default:if(t.isString(e))return this.wi(e)}}processElement(t){return this.yi(t)}resolveCondition(t){return"lost"===t?this._i():super.resolveCondition(t)}wi(t){let e=this.findSelector(t);return this.yi(e)}mi(){if(this._i())return this.focusCapsule?.restore(this.layer,n)}gi(){return up.viewport.restoreFocus({layer:this.layer})}vi(){let t=this.fragment&&e.subtreeFirst(this.fragment,"[autofocus]");if(t)return this.yi(t)}yi(t){if(t)return up.focus(t,{force:!0,...n,inputDevice:this.inputDevice}),!0}bi(){let t=up.viewport.firstHashTarget(this.hash,{layer:this.layer});if(t)return this.yi(t)}_i(){return this.focusCapsule?.wasLost()}}},8057:()=>{const t=up.element;up.FragmentPolling=class FragmentPolling{constructor(t){this.rn=up.radio.pollOptions(t),this.sn=t,up.destructor(t,this.ki.bind(this)),up.fragment.onAborted(t,this.Si.bind(this)),this.xi="initialized",this.Ei=!0,this.Oi=!1,this.Ci()}static forFragment(t){return t.upPolling||=new this(t)}onPollAttributeObserved(){this.Fi()}ki(){this.Ti()}Fi(t){if(Object.assign(this.rn,t),"started"!==this.xi){if(!up.fragment.isTargetable(this.sn))return void up.warn("[up-poll]","Cannot poll untargetable fragment %o",this.sn);this.xi="started",this.Ri(),this.Pi()}}Ti(){"started"===this.xi&&(this.Li(),this.xi="stopped",this.unbindEvents?.())}forceStart(t){Object.assign(this.rn,t),this.forceStarted=!0,this.Fi()}forceStop(){this.Ti(),this.forceStarted=!1}Ri(){this.unbindEvents||(this.unbindEvents=up.on("visibilitychange up:layer:opened up:layer:dismissed up:layer:accepted",this.Ai.bind(this)))}Ai(){this.$i()&&this.Pi()}$i(){return!document.hidden&&("any"===this.rn.ifLayer||this.Di())}Li(){clearTimeout(this.Mi),this.Mi=null}Pi(){this.Mi||this.Oi||(this.Li(),this.Mi=setTimeout(this.Ni.bind(this),this.Hi()))}Ni(){this.Mi=null,this.ji()}ji(){"started"===this.xi&&(this.$i()?this.qi():up.puts("[up-poll]","Will not poll hidden fragment"))}Bi(){return this.rn.interval??t.numberAttr(this.sn,"up-interval")??up.radio.config.pollInterval}Hi(){return Math.max(this.Bi()-this.Ui(),0)}Ui(){return new Date-this.Ii}Di(){return this.layer||=up.layer.get(this.sn),this.layer?.isFront?.()}qi(){this.Li();let t=this.Ei;try{this.Ei=!1,this.Oi=!0,up.reload(this.sn,this.zi()).then(this.Vi.bind(this),this.Ki.bind(this))}finally{this.Ei=t}}zi(){let t=up.event.build("up:fragment:poll",{log:["Polling fragment",this.sn]});return{...this.rn,guardEvent:t}}Si({newLayer:t}){this.Ei&&!t&&this.Ti()}Vi({fragment:t}){this.Oi=!1,this.Ci(),t?this.Xi(t):this.Pi()}Xi(t){this.Ti(),this.forceStarted&&up.fragment.matches(this.sn,t)&&this.constructor.forFragment(t).forceStart(this.rn)}Ki(t){this.Oi=!1,this.Ci(),this.Pi(),up.error.throwCritical(t)}Ci(){this.Ii=new Date}}},2828:()=>{const t=up.util;up.FragmentProcessor=class FragmentProcessor extends up.Record{keys(){return["fragment","autoMeans","origin","layer"]}process(t){let e=this.preprocess(t);return this.tryProcess(e)}preprocess(e){return t.getComplexTokens(e)}tryProcess(e){if(t.isArray(e))return this.processArray(e);if(t.isFunction(e)){let t=up.error.guard(e,this.fragment,this.attributes());return this.tryProcess(t)}if(t.isElement(e))return this.processElement(e);if(t.isString(e)){if("auto"===e)return this.tryProcess(this.autoMeans);let t=e.match(/^(.+?)-if-(.+?)$/);if(t)return this.resolveCondition(t[2])&&this.process(t[1])}return this.processPrimitive(e)}processArray(e){return t.find(e,(t=>this.tryProcess(t)))}resolveCondition(t){if("main"===t)return this.fragment&&up.fragment.contains(this.fragment,":main")}findSelector(t){const e={layer:this.layer,origin:this.origin};let n=this.fragment&&up.fragment.get(this.fragment,t,e)||up.fragment.get(t,e);if(n)return n;up.warn("up.render()",'Could not find an element matching "%s"',t)}}},4850:()=>{const t=up.util;up.FragmentScrolling=class FragmentScrolling extends up.FragmentProcessor{keys(){return super.keys().concat(["hash","mode","revealTop","revealMax","revealSnap","scrollBehavior"])}processPrimitive(e){switch(e){case"reset":return this.Wi();case"layer":return this.Gi();case"main":return this.Ji(":main");case"restore":return this.Qi();case"hash":return this.hash&&up.viewport.revealHash(this.hash,this.attributes());case"target":case"reveal":case!0:return this.Yi(this.fragment);default:if(t.isString(e))return this.Ji(e)}}processElement(t){return this.Yi(t)}Yi(t){if(t)return up.reveal(t,this.attributes()),!0}Ji(t){let e=this.findSelector(t);return this.Yi(e)}Gi(){return this.Yi(this.layer.getBoxElement())}Wi(){return up.viewport.resetScroll({...this.attributes(),around:this.fragment}),!0}Qi(){return up.viewport.restoreScroll({...this.attributes(),around:this.fragment})}}},7956:()=>{const t=up.element,e=up.util;up.Layer=class Layer extends up.Record{keys(){return["element","stack","history","mode","context","lastScrollTops","lastFocusCapsules"]}defaults(){return{context:{},lastScrollTops:up.viewport.newStateCache(),lastFocusCapsules:up.viewport.newStateCache()}}constructor(t={}){if(super(t),!this.mode)throw"missing { mode } option"}setupHandlers(){up.link.convertClicks(this)}teardownHandlers(){}mainTargets(){return up.layer.mainTargets(this.mode)}sync(){}accept(){throw new up.NotImplemented}dismiss(){throw new up.NotImplemented}peel(t){this.stack.peel(this,t)}evalOption(t){return e.evalOption(t,this)}isCurrent(){return this.stack.isCurrent(this)}isFront(){return this.stack.isFront(this)}isRoot(){return this.stack.isRoot(this)}isOverlay(){return this.stack.isOverlay(this)}isOpen(){return this.stack.isOpen(this)}isClosed(){return this.stack.isClosed(this)}get parent(){return this.stack.parentOf(this)}get child(){return this.stack.childOf(this)}get ancestors(){return this.stack.ancestorsOf(this)}get descendants(){return this.stack.descendantsOf(this)}get subtree(){return[this,...this.descendants]}get index(){return this.Zi??=this.stack.indexOf(this)}getContentElement(){return this.contentElement||this.element}getBoxElement(){return this.boxElement||this.element}getFocusElement(){return this.getBoxElement()}getFirstSwappableElement(){throw new up.NotImplemented}contains(t){return t.closest(up.layer.anySelector())===this.element}on(...t){return this.ts(t).bind()}off(...t){return this.ts(t).unbind()}ts(t){return up.EventListenerGroup.fromBindArgs(t,{guard:t=>this.es(t),elements:[this.element],baseLayer:this})}es(t){return this.contains(t.target)}wasHitByMouseEvent({clientX:t,clientY:e}){const n=document.elementFromPoint(t,e);return!n||this.contains(n)}ns(t){return up.EventEmitter.fromEmitArgs(t,{layer:this})}emit(...t){return this.ns(t).emit()}isDetached(){return!this.element.isConnected}saveHistory(){this.history&&(this.savedTitle=document.title,this.savedMetaTags=up.history.findMetaTags(),this.savedLocation=up.history.location,this.savedLang=up.history.getLang())}restoreHistory(){this.showsLiveHistory()&&(this.savedLocation&&up.history.push(this.savedLocation),this.savedTitle&&(document.title=this.savedTitle),this.savedMetaTags&&up.history.updateMetaTags(this.savedMetaTags),e.isString(this.savedLang)&&up.history.updateLang(this.savedLang))}asCurrent(t){return this.stack.asCurrent(this,t)}updateHistory(t){e.isString(t.location)&&(this.location=t.location),up.history.config.updateMetaTags&&e.isList(t.metaTags)&&(up.migrate?.warnOfHungryMetaTags?.(t.metaTags),this.metaTags=t.metaTags),e.isString(t.title)&&(this.title=t.title),e.isString(t.lang)&&(this.lang=t.lang)}showsLiveHistory(){return this.history&&this.isFront()}get title(){return this.showsLiveHistory()?document.title:this.savedTitle}set title(t){this.savedTitle=t,this.showsLiveHistory()&&(document.title=t)}get metaTags(){return this.showsLiveHistory()?up.history.findMetaTags():this.savedMetaTags}set metaTags(t){this.savedMetaTags=t,this.showsLiveHistory()&&up.history.updateMetaTags(t)}get lang(){return this.showsLiveHistory()?up.history.getLang():this.savedLang}set lang(t){this.savedLang=t,this.showsLiveHistory()&&up.history.updateLang(t)}get location(){return this.showsLiveHistory()?up.history.location:this.savedLocation}set location(t){(this.location!==(t=e.normalizeURL(t))||this.opening)&&(this.savedLocation=t,this.showsLiveHistory()&&up.history.push(t),this.opening||this.emit("up:layer:location:changed",{location:t}))}selector(t){return this.constructor.selector(t)}static selector(t){throw new up.NotImplemented}toString(){throw new up.NotImplemented}affix(...e){return t.affix(this.getFirstSwappableElement(),...e)}[e.isEqual.key](t){return this.constructor===t.constructor&&this.element===t.element}hasFocus(){let t=document.activeElement;return t!==document.body&&this.element.contains(t)}reset(){Object.assign(this,this.defaults())}}},7101:()=>{var t;up.Layer.Cover=((t=class Cover extends up.Layer.OverlayWithViewport{}).mode="cover",t)},5580:()=>{var t;up.Layer.Drawer=((t=class Drawer extends up.Layer.OverlayWithViewport{}).mode="drawer",t)},86:()=>{var t;up.Layer.Modal=((t=class Modal extends up.Layer.OverlayWithViewport{}).mode="modal",t)},7403:()=>{var t;const e=up.element,n=up.util;up.Layer.Overlay=((t=class Overlay extends up.Layer{keys(){return[...super.keys(),...this.constructor.VISUAL_KEYS,"onOpened","onAccept","onAccepted","onDismiss","onDismissed","acceptEvent","dismissEvent","acceptLocation","dismissLocation","opening"]}constructor(t){super(t),!0===this.dismissable?this.dismissable=["button","key","outside"]:!1===this.dismissable?this.dismissable=[]:this.dismissable=n.getSimpleTokens(this.dismissable),this.acceptLocation&&(this.acceptLocation=new up.URLPattern(this.acceptLocation)),this.dismissLocation&&(this.dismissLocation=new up.URLPattern(this.dismissLocation))}callback(t){let e=this[t];if(e)return e.bind(this)}createElement(t){this.nesting||=this.ss();const e=n.compactObject(n.pick(this,["align","position","size","class","nesting"]));this.element=this.affixPart(t,null,e)}createBackdropElement(t){this.backdropElement=this.affixPart(t,"backdrop")}createViewportElement(t){this.viewportElement=this.affixPart(t,"viewport",{"up-viewport":""})}createBoxElement(t){this.boxElement=this.affixPart(t,"box")}createContentElement(t){this.contentElement=this.affixPart(t,"content")}setContent(t){this.contentElement.append(t),this.onContentSet()}onContentSet(){}createDismissElement(t){return this.dismissElement=this.affixPart(t,"dismiss",{"up-dismiss":'":button"',"aria-label":this.dismissARIALabel}),e.affix(this.dismissElement,'span[aria-hidden="true"]',{text:this.dismissLabel})}affixPart(t,n,i={}){return e.affix(t,this.selector(n),i)}static selector(t){return n.compact(["up",this.mode,t]).join("-")}ss(){const{parent:t}=this;return this.mode===t.mode?1+t.ss():0}setupHandlers(){super.setupHandlers(),this.overlayFocus=new up.OverlayFocus(this),this.rs("button")&&this.createDismissElement(this.getBoxElement()),this.rs("outside")&&(this.viewportElement?up.on(this.viewportElement,"up:click",(t=>{t.target===this.viewportElement&&this.os(t,!0)})):this.unbindParentClicked=this.parent.on("up:click",((t,e)=>{if(!up.layer.isWithinForeignOverlay(e)){const n=this.origin&&this.origin.contains(e);this.os(t,n)}}))),this.rs("key")&&(this.unbindEscapePressed=up.event.onEscape((t=>this.onEscapePressed(t)))),this.registerClickCloser("up-accept",((t,e)=>{this.accept(t,e)})),this.registerClickCloser("up-dismiss",((t,e)=>{this.dismiss(t,e)})),up.migrate.registerLayerCloser?.(this),this.us(this.acceptEvent,this.accept),this.us(this.dismissEvent,this.dismiss),this.on("up:click","label[for]",((t,e)=>this.hs(t,e)))}hs(t,n){let i=n.getAttribute("for"),s=up.form.fieldSelector(e.idSelector(i)),r=up.fragment.all(s,{layer:"any"}),o=up.fragment.all(s,{layer:this});if(r.length>1&&o[0]!==r[0]){t.preventDefault();const e=o[0];e.focus(),e.matches("input[type=checkbox], input[type=radio]")&&e.click()}}os(t,e){up.log.putsEvent(t),e&&up.event.halt(t),up.error.muteUncriticalSync((()=>this.dismiss(":outside",{origin:t.target})))}onEscapePressed(t){if(this.isFront()){let e=up.form.focusedField();e?e.blur():this.rs("key")&&(up.event.halt(t,{log:!0}),up.error.muteUncriticalSync((()=>this.dismiss(":key"))))}}registerClickCloser(t,n){let i=`[${t}]`;this.on("up:click",i,(function(s){up.event.halt(s,{log:!0});const r=s.target.closest(i),o=e.jsonAttr(r,t),u={origin:r},a=new up.OptionsParser(r,u);a.booleanOrString("animation"),a.string("easing"),a.number("duration"),a.string("confirm"),up.error.muteUncriticalSync((()=>n(o,u)))}))}us(t,e){if(t)return this.on(t,(t=>{t.preventDefault(),up.error.muteUncriticalSync((()=>e.call(this,t,{response:t.response})))}))}tryAcceptForLocation(t){this.cs(this.acceptLocation,this.accept,t)}tryDismissForLocation(t){this.cs(this.dismissLocation,this.dismiss,t)}cs(t,e,n){let i,s;if(t&&(i=this.location)&&(s=t.recognize(i))){const t={...s,location:i};up.error.muteUncriticalSync((()=>e.call(this,t,n)))}}teardownHandlers(){super.teardownHandlers(),this.unbindParentClicked?.(),this.unbindEscapePressed?.(),this.overlayFocus.teardown()}destroyElements(t){const e={...t,animation:()=>this.startCloseAnimation(t),onFinished:()=>{this.onElementsRemoved(),t.onFinished?.()},log:!1};up.destroy(this.element,e)}onElementsRemoved(){}ls(t={}){const e=up.animate(this.getBoxElement(),t.boxAnimation,t);let n;return this.backdrop&&!up.motion.isNone(t.boxAnimation)&&(n=up.animate(this.backdropElement,t.backdropAnimation,t)),Promise.all([e,n])}async startOpenAnimation(t={}){let e=t.animation??this.evalOption(this.openAnimation);await this.ls({boxAnimation:e,backdropAnimation:"fade-in",easing:t.easing||this.openEasing,duration:t.duration||this.openDuration}),this.wasEverVisible=!0}startCloseAnimation(t={}){let e=this.wasEverVisible&&(t.animation??this.evalOption(this.closeAnimation));return this.ls({boxAnimation:e,backdropAnimation:"fade-out",easing:t.easing||this.closeEasing,duration:t.duration||this.closeDuration})}accept(t=null,e={}){return this.ps("accept",t,e)}dismiss(t=null,e={}){return this.ps("dismiss",t,e)}rs(t){return n.contains(this.dismissable,t)}ps(t,e,n){return n={...n,verb:t,value:e,layer:this},new up.Change.CloseLayer(n).execute()}getFirstSwappableElement(){return this.getContentElement().children[0]}toString(){return`${this.mode} overlay`}}).VISUAL_KEYS=["mode","position","align","size","origin","class","backdrop","dismissable","dismissLabel","dismissARIALabel","openAnimation","closeAnimation","openDuration","closeDuration","openEasing","closeEasing","trapFocus"],t)},6412:()=>{up.Layer.OverlayWithTether=class OverlayWithTether extends up.Layer.Overlay{createElements(){this.origin||up.fail("Missing { origin } option"),this.fs=new up.Tether({anchor:this.origin,align:this.align,position:this.position}),this.createElement(this.fs.parent),this.createContentElement(this.element)}onContentSet(){this.fs.start(this.element)}onElementsRemoved(){this.fs.stop()}sync(){this.isOpen()&&(this.isDetached()||this.fs.isDetached()?this.dismiss(":detached",{animation:!1,preventable:!1}):this.fs.sync())}}},7965:()=>{up.Layer.OverlayWithViewport=class OverlayWithViewport extends up.Layer.Overlay{static getParentElement(){return document.body}createElements(){up.viewport.bodyShifter.raiseStack(),this.createElement(this.constructor.getParentElement()),this.backdrop&&this.createBackdropElement(this.element),this.createViewportElement(this.element),this.createBoxElement(this.viewportElement),this.createContentElement(this.boxElement)}onElementsRemoved(){up.viewport.bodyShifter.lowerStack()}sync(){this.isDetached()&&this.isOpen()&&this.constructor.getParentElement().appendChild(this.element)}}},4552:()=>{var t;up.Layer.Popup=((t=class Popup extends up.Layer.OverlayWithTether{}).mode="popup",t)},7771:()=>{var t;const e=up.element;up.Layer.Root=((t=class Root extends up.Layer{get element(){return e.root}constructor(t){super(t),this.setupHandlers()}getFirstSwappableElement(){return document.body}static selector(){return"html"}setupHandlers(){this.element.upHandlersApplied||(this.element.upHandlersApplied=!0,super.setupHandlers())}sync(){this.setupHandlers()}accept(){this.ds()}dismiss(){this.ds()}ds(){up.fail("Cannot close the root layer")}toString(){return"root layer"}}).mode="root",t)},6066:()=>{var t;const e=up.util,n=up.element;up.LayerLookup=(t=class LayerLookup{constructor(t,n){this.i=t,!1!==n.normalizeLayerOptions&&up.layer.normalizeOptions(n),this.rn=n,this.gs=e.getSimpleTokens(n.layer)}all(){let t=e.flatMap(this.gs,(t=>this.ys(t)));return t=e.compact(t),t=e.uniq(t),t}static all(t,...n){const i=e.parseArgIntoOptions(n,"layer"),{layer:s}=i;return s instanceof up.Layer?[s]:new this(t,i).all()}ws(t){return t=n.get(t),e.find(this.i.reversed(),(e=>e.contains(t)))}bs(t){return this.i.at(t)}ys(t){if(t instanceof up.Layer)return t;if(e.isNumber(t))return this.bs(t);if(/^\d+$/.test(t))return this.bs(Number(t));if(e.isElementLike(t))return this.ws(t);switch(t){case"any":return[this.vs(),...this.i.reversed()];case"current":return this.vs();case"closest":return this.i.selfAndAncestorsOf(this.vs());case"parent":return this.vs().parent;case"ancestor":case"ancestors":return this.vs().ancestors;case"child":return this.vs().child;case"descendant":case"descendants":return this.vs().descendants;case"subtree":return this.vs().subtree;case"new":return"new";case"root":return this.i.root;case"overlay":case"overlays":return e.reverse(this.i.overlays);case"front":return this.i.front;case"origin":return this._s();default:return up.fail("Unknown { layer } option: %o",t)}}_s(){let{origin:t,originLayer:e}=this.rn;return e||(t?this.ws(t):void 0)}vs(){let{baseLayer:t}=this.rn;if(e.isString(t)){const e={...this.rn,baseLayer:this.i.current,normalizeLayerOptions:!1,layer:t};return this.constructor.all(this.i,e)[0]}return t||this._s()||this.i.current}},e.memoizeMethod(t.prototype,{vs:!0,_s:!0}),t)},6387:()=>{const t=up.util;up.LayerStack=class LayerStack{constructor(){this.ks=[],this.layers=[this.Ss()]}Ss(){return up.layer.build({mode:"root",stack:this})}remove(e){t.remove(this.layers,e)}peel(e,n){const i=t.reverse(e.descendants),s={...n,preventable:!1};for(let t of i)t.dismiss(":peel",s)}reset(){this.peel(this.root,{animation:!1}),this.ks=[],this.root.reset()}isOpen(e){return t.contains(this.layers,e)}isClosed(t){return!this.isOpen(t)}parentOf(t){return this.layers[t.index-1]}childOf(t){return this.layers[t.index+1]}ancestorsOf(e){return t.reverse(this.layers.slice(0,e.index))}selfAndAncestorsOf(t){return[t,...t.ancestors]}descendantsOf(t){return this.layers.slice(t.index+1)}isRoot(t){return this.root===t}isOverlay(t){return this.root!==t}isCurrent(t){return this.current===t}isFront(t){return this.front===t}get(...t){return this.getAll(...t)[0]}getAll(...t){return up.LayerLookup.all(this,...t)}sync(){for(let t of this.layers)t.sync()}asCurrent(t,e){try{return this.ks.push(t),e()}finally{this.ks.pop()}}reversed(){return t.reverse(this.layers)}dismissOverlays(e=null,n={}){n.dismissable=!1;for(let i of t.reverse(this.overlays))i.dismiss(e,n)}at(t){return this.layers[t]}indexOf(t){return this.layers.indexOf(t)}get count(){return this.layers.length}get root(){return this.layers[0]}get overlays(){return this.root.descendants}get current(){return t.last(this.ks)||this.front}get front(){return t.last(this.layers)}}},3698:()=>{const t=up.util;up.LinkCurrentURLs=class LinkCurrentURLs{constructor(e){if(this.xs=up.link.isSafe(e),this.xs){const n=e.getAttribute("href");n&&"#"!==n&&(this.Es=t.matchableURL(n));const i=e.getAttribute("up-href");i&&(this.Os=t.matchableURL(i));const s=e.getAttribute("up-alias");s&&(this.Cs=new up.URLPattern(s))}}isCurrent(t){return!(!t||this.Es!==t&&this.Os!==t&&!this.Cs?.test?.(t,!1))}}},2460:()=>{const t=up.util,e=up.element;up.LinkFollowIntent=class LinkFollowIntent{constructor(t,e){this.Fs=t,this.gn=e,this.Ts("mouseenter mousedown touchstart",(t=>this.Rs(t))),this.Ts("mouseleave",(()=>this.Ps())),up.fragment.onAborted(this.Fs,(()=>this.Ps()))}Ts(t,e){up.on(this.Fs,t,{passive:!0},e)}Rs(e){if(up.link.shouldFollowEvent(e,this.Fs))if(this.Ps(),"mouseenter"===e.type){let n=this.Ls();this.As=t.timer(n,(()=>this.$n(e)))}else this.$n(e)}Ps(){clearTimeout(this.As),up.network.abort((t=>t.origin===this.Fs&&t.background))}Ls(){return e.numberAttr(this.Fs,"up-preload-delay")??up.link.config.preloadDelay}$n(t){up.log.putsEvent(t),up.error.muteUncriticalRejection(this.gn())}}},1653:()=>{let t="up.log.enabled",e=!1;try{e=!!sessionStorage?.getItem(t)}catch{}up.LogConfig=class LogConfig extends up.Config{constructor(){super((()=>({banner:!0,format:!0})))}get enabled(){return e}set enabled(n){e=n;try{sessionStorage?.setItem(t,n?"1":"")}catch{}}}},7792:()=>{const t=up.util,e=up.element;up.MotionController=class MotionController{constructor(t){this.$s=`up-${t}`,this.oi=`.${this.$s}`,this.finishEvent=`up:${t}:finish`,this.finishCount=0,this.Ds=0}startFunction(t,n,i={}){t=e.list(t);const s=()=>up.error.muteUncriticalRejection(n());if(i.trackMotion=i.trackMotion??up.motion.isEnabled(),!1===i.trackMotion)return s();{i.trackMotion=!1,this.finish(t),this.Ms(t);let e=this.Ns(t,s);return e=e.then((()=>this.Hs(t))),e}}finish(t){if(this.finishCount++,0!==this.Ds&&up.motion.isEnabled()){t=this.js(t);for(let e of t)this.qs(e);return up.migrate.formerlyAsync?.("up.motion.finish()")}}js(n){return n?t.flatMap(n,(t=>e.list(t.closest(this.oi),t.querySelectorAll(this.oi)))):document.querySelectorAll(this.oi)}isActive(t){return t.classList.contains(this.$s)}qs(t){this.Bs(t)}Bs(t,e={}){return e={target:t,log:!1,...e},up.emit(this.finishEvent,e)}Ms(t){this.Ds++,this.Us(t,!0)}Hs(t){this.Ds--,this.Us(t,!1)}Us(t,e){for(let n of t)n.classList.toggle(this.$s,e)}Ns(t,e){if(t.length<2)return e();const n=up.on(t,this.finishEvent,(e=>{if(!e.forwarded)for(let n of t)n!==e.target&&this.isActive(n)&&this.Bs(n,{forwarded:!0})}));return e().then(n)}async reset(){await this.finish(),this.finishCount=0,this.Ds=0}}},4308:()=>{const t=up.util,e=up.element;up.NonceableCallback=class NonceableCallback{constructor(t,e){this.script=t,this.nonce=e}static fromString(t){let e=t.match(/^(nonce-([^\s]+)\s)?(.*)$/);return new this(e[3],e[2])}toFunction(...t){let e=this.script;if(/\b(;|return|throw)\b/.test(e)||(e=`return ${e}`),this.nonce){let n=this;return function(...i){return n.Is(e,this,t,i)}}return new Function(...t,e)}toString(){return`nonce-${this.nonce} ${this.script}`}Is(t,n,i,s){let r,o=`\n try {\n up.noncedEval.value = (function(${i.join()}) {\n ${t}\n }).apply(up.noncedEval.thisArg, up.noncedEval.args)\n } catch (error) {\n up.noncedEval.error = error\n }\n `;try{if(up.noncedEval={args:s,thisArg:n},r=e.affix(document.body,"script",{nonce:this.nonce,text:o}),up.noncedEval.error)throw up.noncedEval.error;return up.noncedEval.value}finally{up.noncedEval=void 0,r&&r.remove()}}zs(e){return this.nonce&&t.contains(e,this.nonce)}static adoptNonces(n,i){if(!i?.length)return;const s=t.memoize(up.protocol.cspNonce);t.each(up.script.config.nonceableAttributes,(r=>{let o=e.subtree(n,`[${r}^="nonce-"]`);t.each(o,(t=>{let e=t.getAttribute(r),n=this.fromString(e),o=(t,...n)=>up.log.warn("up.render()",`Cannot use callback [${r}="${e}"]: ${t}`,...n);if(!n.zs(i))return o("Callback's CSP nonce (%o) does not match response header (%o)",n.nonce,i);let u=s();if(!u)return o("Current page's CSP nonce is unknown");n.nonce=u,t.setAttribute(r,n.toString())}))}))}}},1104:()=>{const t=up.util,e=up.element;up.OptionsParser=class OptionsParser{constructor(t,e,n={}){this.rn=e,this.U=t,this.Vs=n,this.Ks=n.fail,this.Xs=n.closest,this.Ws=n.attrPrefix||"up-",this.Gs=n.defaults||{}}string(t,n){this.parse(e.attr,t,n)}boolean(t,n){this.parse(e.booleanAttr,t,n)}number(t,n){this.parse(e.numberAttr,t,n)}booleanOrString(t,n){this.parse(e.booleanOrStringAttr,t,n)}booleanOrNumber(t,n){this.parse(e.booleanOrNumberAttr,t,n)}json(t,n){this.parse(e.jsonAttr,t,n)}callback(t,n={}){this.parse(((t,i)=>e.callbackAttr(t,i,n)),t,n)}parse(e,n,i={}){const s=t.wrapList(i.attr??this.Js(n));let r=this.rn[n];for(let t of s)r??=this.Qs(e,this.U,t);r??=i.default??this.Gs[n];let o,u=i.normalize;if(u&&(r=u(r)),t.isDefined(r)&&(this.rn[n]=r),this.Ks&&(o=up.fragment.failKey(n))){const n=t.compact(t.map(s,(t=>this.Ys(t))));this.parse(e,o,{...i,attr:n})}}include(t){let e=t(this.U,this.rn,this.Vs);Object.assign(this.rn,e)}Qs(t,n,i){return this.Xs?e.closestAttr(n,i,t):t(n,i)}Ys(t){return this.Zs(t,this.Ws+"on-")||this.Zs(t,this.Ws)}Zs(t,e){if(t.startsWith(e))return`${e}fail-${t.substring(e.length)}`}Js(e){return`${this.Ws}${t.camelToKebabCase(e)}`}}},8665:()=>{const t=up.element,e=up.util;up.OverlayFocus=class OverlayFocus{constructor(t){this.L=t,this.yi=this.L.getFocusElement(),this.tr=this.L.trapFocus}moveToFront(){this.er||(this.er=!0,this.nr=t.setAttrsTemp(this.yi,{tabindex:"0",role:"dialog","aria-modal":this.tr.toString()}),this.tr&&(this.ir=up.on("focusin",(t=>this.sr(t))),this.rr=t.affix(this.yi,"beforebegin","up-focus-trap[tabindex=0]"),this.ur=t.affix(this.yi,"afterend","up-focus-trap[tabindex=0]")))}moveToBack(){this.teardown()}teardown(){this.er&&(this.er=!1,this.nr(),this.tr&&(this.ir(),this.rr.remove(),this.ur.remove()))}sr(t){const{target:e}=t;this.ar||up.layer.isWithinForeignOverlay(e)||(this.ar=!0,e===this.rr?this.hr():e!==this.ur&&this.L.contains(e)||this.cr(),this.ar=!1)}cr(t){up.focus(this.yi,t)}hr(){this.lr(this.L.getBoxElement())||this.cr()}lr(t){for(let n of e.reverse(t.children))if(up.viewport.tryFocus(n)||this.lr(n))return!0}}},3645:()=>{const t=up.util,e=up.element;up.Params=class Params{constructor(t){this.clear(),this.addAll(t)}clear(){this.entries=[]}[t.copy.key](){return new up.Params(this)}toObject(){const e={};for(let n of this.entries){const{name:i,value:s}=n;t.isBasicObjectProperty(i)||(this.pr(i)?(e[i]||=[],e[i].push(s)):e[i]=s)}return e}toArray(){return this.entries}toFormData(){const t=new FormData;for(let e of this.entries)t.append(e.name,e.value);return t.entries||(t.originalArray=this.entries),t}toQuery(){let e=t.map(this.entries,this.dr.bind(this));return e=t.compact(e),e.join("&")}dr(e){const{value:n}=e;if(this.mr(n))return;let i=encodeURIComponent(e.name);return t.isGiven(n)&&(i+="=",i+=encodeURIComponent(n)),i}mr(t){return t instanceof Blob}hasBinaryValues(){const e=t.map(this.entries,"value");return t.some(e,this.mr)}toURL(e){let n=[e,this.toQuery()];n=t.filter(n,t.isPresent);const i=t.contains(e,"?")?"&":"?";return n.join(i)}add(t,e){this.entries.push({name:t,value:e})}addAll(e){t.isMissing(e)||(e instanceof this.constructor?this.entries.push(...e.entries):t.isArray(e)?this.entries.push(...e):t.isString(e)?this.gr(e):t.isFormData(e)?this.yr(e):t.isObject(e)?this.wr(e):up.fail("Unsupport params type: %o",e))}wr(e){for(let n in e){const i=e[n],s=t.isArray(i)?i:[i];for(let t of s)this.add(n,t)}}gr(e){for(let n of e.split("&"))if(n){let[e,i]=n.split("=");e=decodeURIComponent(e),i=t.isGiven(i)?decodeURIComponent(i):null,this.add(e,i)}}yr(t){for(let e of t.entries())this.add(...e)}set(t,e){this.delete(t),this.add(t,e)}delete(e){this.entries=t.reject(this.entries,this.br(e))}br(t){return e=>e.name===t}get(t){return this.pr(t)?this.getAll(t):this.getFirst(t)}getFirst(e){const n=t.find(this.entries,this.br(e));return n?.value}getAll(e){if(this.pr(e))return this.getAll(e);{const n=t.map(this.entries,this.br(e));return t.map(n,"value")}}pr(t){return t.endsWith("[]")}[t.isBlank.key](){return 0===this.entries.length}static fromForm(t){return this.fromContainer(t)}static fromContainer(t){let e=up.form.fields(t);return this.fromFields(e)}static fromFields(e){const n=new this;for(let i of t.wrapList(e))n.addField(i);return n}addField(t){let n=(t=e.get(t)).name;if(n&&!t.disabled){const{tagName:e}=t,{type:i}=t;if("SELECT"===e)for(let e of t.querySelectorAll("option"))e.selected&&this.add(n,e.value);else if("checkbox"===i||"radio"===i)t.checked&&this.add(n,t.value);else{if("file"!==i)return this.add(n,t.value);for(let e of t.files)this.add(n,e)}}}[t.isEqual.key](e){return this.constructor===e.constructor&&t.isEqual(this.entries,e.entries)}static fromURL(e){const n=new this;let i=t.parseURL(e).search;return i&&(i=i.replace(/^\?/,""),n.addAll(i)),n}static stripURL(e){return t.normalizeURL(e,{search:!1})}static merge(...t){return t.reduce((function(t,e){return t.addAll(e),t}),new up.Params)}}},8397:()=>{const t=up.util,e=up.element;up.Preview=class Preview{constructor({fragment:t,request:e,renderOptions:n,cleaner:i}){this.fragment=t,this.request=e,this.renderOptions=n,this.o=i}undo(...t){this.ended?reportError(new up.Error("Preview used after end of request")):this.o.guard(...t)}get origin(){return this.request.origin}get params(){return this.request.params}get layer(){return this.request.layer}get ended(){return this.request.ended}get expiredResponse(){return this.renderOptions.expiredResponse}get revalidating(){return!!this.expiredResponse}run(t,e={}){for(let n of up.status.resolvePreviewFns(t))this.undo(up.error.guard(n,this,e))}revert(){this.o.clean()}setAttrs(...t){let[n,i]=this.vr(t,"val","val");this.undo(e.setAttrsTemp(n,i))}addClass(...t){let[n,i]=this.vr(t,"val","val");this.undo(e.addClassTemp(n,i))}addClassBatch(t,e){for(let n of t)for(let t of e)this.addClass(n,t)}removeClass(...t){let[n,i]=this.vr(t,"val","val");this.undo(e.removeClassTemp(n,i))}setStyle(...t){let[n,i]=this.vr(t,"val","val");this.undo(e.setStyleTemp(n,i))}disable(...t){let[e]=this.vr(t,"val");this.undo(up.form.disable(e))}insert(...e){let[n,i="beforeend",s]=this.vr(e,"val",t.isAdjacentPosition,"val");this.undo(up.fragment.insertTemp(n,i,s))}show(...t){let[n]=this.vr(t,"val");this.undo(e.showTemp(n))}hide(...t){let[n]=this.vr(t,"val");this.undo(e.hideTemp(n))}hideContent(...t){let[n]=this.vr(t,"val"),i=e.wrapChildren(n);e.hide(i),this.undo((()=>e.unwrap(i)))}showPlaceholder(...t){let[e,n]=this.vr(t,"val","val"),i=up.fragment.provideNodes(n,{origin:this.origin});up.puts("[up-placeholder]","Showing placeholder %o",n),e?this.swapContent(e,i):"new"===this.layer&&(this.openLayer(i,{closeAnimation:!1}),this.renderOptions.openAnimation=!1)}swapContent(...t){let[e,n]=this.vr(t,"val","val");this.hideContent(e),this.insert(e,n)}openLayer(e,n={}){let i=":undo-preview";up.layer.open({...t.pick(this.renderOptions,[...up.Layer.Overlay.VISUAL_KEYS,"target"]),...n,content:e,abort:!1,onDismiss:({value:t})=>{t!==i&&this.request.abort({reason:"Preview overlay dismissed"})}});let s=up.layer.front;return this.undo((()=>s.dismiss(i,{preventable:!1}))),s}vr(e,...n){let[i,...s]=t.args(e,...n);return i=up.fragment.get(i,{layer:this.layer,origin:this.origin})||this.fragment,[i,...s]}}},7782:()=>{const t=up.element;up.ProgressBar=class ProgressBar{constructor(){this._r=0,this.U=t.affix(document.body,"up-progress-bar"),this.U.style.transition="width 300ms ease-out",this.kr(0),t.paint(this.U),this.Sr=31,this.Er()}Er(){let t;t=this.Sr<80?Math.random()<.15?7+5*Math.random():1.5+.5*Math.random():.13*(100-this.Sr)*Math.random(),this.kr(this.Sr+t),this._r++;const e=300+40*this._r;this.timeout=setTimeout(this.Er.bind(this),e)}kr(t){this.Sr=t,this.U.style.width=`${t}vw`}destroy(){clearTimeout(this.timeout),this.U.remove()}conclude(){clearTimeout(this.timeout),this.kr(100),setTimeout(this.destroy.bind(this),300)}}},2406:()=>{const t=up.util;up.Record=class Record{keys(){throw"Return an array of keys"}defaults(t){return{}}constructor(t){Object.assign(this,this.defaults(t),this.attributes(t))}attributes(e=this){return t.pick(e,this.keys())}[t.copy.key](){return t.variant(this)}[t.isEqual.key](e){return this.constructor===e.constructor&&t.isEqual(this.attributes(),e.attributes())}}},1279:()=>{up.Rect=class Rect extends up.Record{keys(){return["left","top","width","height"]}get bottom(){return this.top+this.height}get right(){return this.left+this.width}grow(t){this.left-=t,this.top-=t,this.width+=2*t,this.height+=2*t}static fromElement(t){return new this(t.getBoundingClientRect())}}},2714:()=>{var t;const e=up.util;up.RenderJob=(t=class RenderJob{constructor(t){this.options=t}execute(){return this.Or=this.Cr(),this}async Cr(){try{this.Fr(),this.options=up.RenderOptions.preprocess(this.options),up.browser.assertConfirmed(this.options),up.RenderOptions.assertContentGiven(this.options);let t=await this.Tr().execute();return this.Rr(t),t}catch(t){throw this.Rr(t)||this.Pr(t),t}}Rr(t){if(t instanceof up.RenderResult){let{onRendered:n,onFinished:i}=t.options;t.none||up.error.guard((()=>n?.(t)));let s=function(t){up.error.guard((()=>i?.(t)))};return this.finished.then(s,e.noop),!0}}Pr(t){let e=t instanceof up.Aborted?"Rendering was aborted":"Error while rendering";up.puts("up.render()",`${e}: ${t.name}: ${t.message}`),up.error.guard((()=>this.options.onError?.(t)))}get finished(){return this.Lr()}async Lr(){try{let t=await this.Or;return await t.finished}catch(t){throw t instanceof up.RenderResult?await t.finished:t}}Tr(){if(this.options.url){let t=t=>this.Ar(t);return new up.Change.FromURL({...this.options,onRequestProcessed:t})}{let t=()=>this.Ar(null);return this.options.response?new up.Change.FromResponse({...this.options,onRender:t}):new up.Change.FromContent({...this.options,onRender:t})}}Fr(){let t=e.pluckKey(this.options,"guardEvent");if(t&&(t.renderOptions=this.options,up.emit(t,{target:this.options.origin}).defaultPrevented))throw new up.Aborted(`Rendering was prevented by ${t.type} listener`)}Ar(t){let{abort:n}=this.options;if(!n||!up.network.isBusy())return;let{bindFragments:i,bindLayer:s,origin:r,layer:o}=this.Tr().getPreflightProps(),u={except:t,logOnce:["up.render()","Change with { abort } option will abort other requests"],newLayer:"new"===o,origin:r};"target"===n?up.fragment.abort(i,{...u}):"layer"===n?up.fragment.abort({...u,layer:s}):"all"===n||!0===n?up.fragment.abort({...u,layer:"any"}):e.isFunction(n)?n(u):up.fragment.abort(n,{...u,layer:s})}},e.delegatePromise(t.prototype,"_rendered"),e.memoizeMethod(t.prototype,{Lr:!0,Tr:!0}),t)},2705:()=>{const t=up.util;up.RenderOptions=function(){const e=["url","method","origin","headers","params","cache","fallback","abort","abortable","confirm","feedback","disable","placeholder","preview","origin","originLayer","baseLayer","navigate","fail","onError"].concat(["keep","hungry","history","source","saveScroll"]),n=["url","response","content","fragment","document"],i=["history","focus","scroll"];return{preprocess:function(e){up.migrate.preprocessRenderOptions?.(e),up.layer.normalizeOptions(e),function(e){t.renameKey(e,"useData","data"),t.renameKey(e,"useHungry","hungry"),t.renameKey(e,"useKeep","keep")}(e);const n=t.merge(up.fragment.config.renderOptions,function(t){if(t.navigate)return up.fragment.config.navigateOptions}(e));return t.merge(t.omit(n,i),{defaults:n},{inputDevice:up.event.inputDevice},e,function({url:e}){if(e)return{url:t.normalizeURL(e)}}(e),function({origin:t,originLayer:e}){if(t&&!e)return{originLayer:up.layer.get(t)}}(e))},finalize:function(e,n){return t.merge(e.defaults,n,e)},assertContentGiven:function(e){t.some(n,(n=>t.isGiven(e[n])))||(e.defaultToEmptyContent?e.content="":up.fail("up.render() needs either { "+n.join(", ")+" } option"))},deriveFailOptions:function(n){let i=function(t){const e={};for(let n in t){const i=t[n];let s=up.fragment.successKey(n);s&&(e[s]=i)}return e}(n);return n.failOptions?{...n.defaults,...t.pick(n,e),...i,failPrefixForced:!0}:{...n,...i}},NO_PREVIEWS:{preview:!1,disable:!1,placeholder:!1,feedback:!1},NO_MOTION:{transition:!1,animation:!1,openAnimation:!1,closeAnimation:!1},NO_INPUT_INTERFERENCE:{scroll:!1,focus:"keep",confirm:!1}}}()},606:()=>{up.RenderResult=class RenderResult extends up.Record{keys(){return["fragments","layer","target","options","finished"]}defaults(){return{fragments:[]}}get none(){return!this.fragments.length}get fragment(){return this.fragments[0]}static both(t,e,n=!0){return e?new this({target:t.target,layer:t.layer,options:t.options,fragments:t.fragments.concat(e.fragments),finished:n&&this.mergeFinished(t,e)}):t}static async mergeFinished(t,e){return this.both(await t.finished,await e.finished,!1)}static buildNone(){return new this({target:":none",finished:Promise.resolve()})}}},5437:()=>{var t;const e=up.util;up.Request=(t=class Request extends up.Record{keys(){return["method","url","hash","params","target","failTarget","headers","timeout","background","cache","expireCache","evictCache","layer","mode","context","failLayer","failMode","failContext","origin","builtAt","wrapMethod","contentType","payload","onLoading","fail","abortable","lateDelay","previews"]}defaults(){return{state:"new",abortable:!0,headers:{},timeout:up.network.config.timeout,builtAt:new Date,previews:[]}}constructor(t){if(super(t),this.params=new up.Params(this.params),null==this.wrapMethod&&(this.wrapMethod=up.network.config.wrapMethod),this.$r(),(this.target||this.layer||this.origin)&&!t.basic){const t={origin:this.origin};this.layer=up.layer.get(this.layer,t),this.failLayer=up.layer.get(this.failLayer,t),this.context||=this.layer.context||{},this.failContext||=this.failLayer?.context||{},this.mode||=this.layer.mode,this.failMode||=this.failLayer?.mode}this.bindLayer=t.bindLayer||this.layer,this.Dr=t.fragments,this.Mr=t.bindFragments,this.Be=e.newDeferred(),this.Nr()}get effectiveLateTime(){return!this.background&&(this.lateDelay??e.evalOption(up.network.config.lateDelay,this))}isTimed(){return e.isNumber(this.effectiveLateTime)}get xhr(){return this.Hr??=new XMLHttpRequest}get fragments(){return this.Dr||=this.jr()}jr(){let t=up.fragment.parseTargetSteps(this.target),n={origin:this.origin,layer:this.layer},i=e.map(t,(t=>up.fragment.get(t.selector,n)));return e.compact(i)}get bindFragments(){return this.Mr||this.fragments}get fragment(){return this.fragments?.[0]}$r(){this.method=e.normalizeMethod(this.method),this.qr(),this.Br(),this.url=e.normalizeURL(this.url)}Ur(){e.task((()=>{this.layer=void 0,this.failLayer=void 0,this.Ir=void 0,this.origin=void 0,this.Dr=void 0,this.Mr=void 0}))}qr(){let t=this.url?.match(/^([^#]*)(#.+)$/);if(t)return this.url=t[1],this.hash=t[2]}Br(){!this.url||this.allowsPayload()||e.isBlank(this.params)||(this.url=this.params.toURL(this.url),this.params.clear())}isSafe(){return up.network.isSafeMethod(this.method)}allowsPayload(){return e.methodAllowsPayload(this.method)}will302RedirectWithGET(){return this.isSafe()||"POST"===this.method}willCache(){return e.evalAutoOption(this.cache,up.network.config.autoCache,this)}runQueuedCallbacks(){e.always(this,(()=>this.Ur()))}load(){if("new"===this.state)return this.zr()?(this.state="loading",this.$r(),this.onLoading?.(),this.expired=!1,new up.Request.XHRRenderer(this).buildAndSend({onload:()=>this.Vr(),onerror:()=>this.Kr(),ontimeout:()=>this.Xr(),onabort:()=>this.Wr()}),!0):void this.abort({reason:"Prevented by event listener"})}runPreviews(t){this.ended||this.fromCache||(this.Gr=up.status.runPreviews(this,t))}zr(){return!this.emit("up:request:load",{log:["Loading %s",this.description]}).defaultPrevented}loadPage(){up.network.abort(),new up.Request.FormRenderer(this).buildAndSubmit()}Vr(){const t=this.Jr(),e="Loaded "+t.description;this.emit("up:request:loaded",{request:t.request,response:t,log:e}),this.respondWith(t)}Kr(){this.Qr("Network error")}Xr(){this.Qr("Timeout")}Wr(){this.Yr()}abort({reason:t}={}){this.Yr(t)&&this.Hr&&this.Hr.abort()}Yr(t){if(this.ended)return;let e="Aborted request to "+this.description+(t?": "+t:"");return this.state="aborted",this.Zr(new up.Aborted(e)),this.emit("up:request:aborted",{log:e}),!0}Qr(t){if(this.ended)return;let e="Cannot load request to "+this.description+(t?": "+t:"");this.state="offline",this.emit("up:request:offline",{log:e}),this.Zr(new up.Offline(e))}respondWith(t){this.response=t,this.ended||(this.state="loaded",t.ok?this.eo(t):this.Zr(t))}eo(t){this.no(),this.Be.resolve(t)}Zr(t){this.no(),this.Be.reject(t)}no(){this.Gr?.()}get ended(){return"new"!==this.state&&"loading"!==this.state&&"tracking"!==this.state}csrfHeader(){return up.protocol.csrfHeader()}csrfParam(){return up.protocol.csrfParam()}csrfToken(){if(!this.isSafe()&&!this.isCrossOrigin())return up.protocol.csrfToken()}isCrossOrigin(){return e.isCrossOrigin(this.url)}Jr(){const t={method:this.method,url:this.url,request:this,xhr:this.xhr,text:this.xhr.responseText,status:this.xhr.status,title:up.protocol.titleFromXHR(this.xhr),target:up.protocol.targetFromXHR(this.xhr),acceptLayer:up.protocol.acceptLayerFromXHR(this.xhr),dismissLayer:up.protocol.dismissLayerFromXHR(this.xhr),eventPlans:up.protocol.eventPlansFromXHR(this.xhr),context:up.protocol.contextFromXHR(this.xhr),expireCache:up.protocol.expireCacheFromXHR(this.xhr),evictCache:up.protocol.evictCacheFromXHR(this.xhr),fail:this.fail};let n=up.protocol.methodFromXHR(this.xhr),i=up.protocol.locationFromXHR(this.xhr);return i&&(e.matchURLs(this.url,i)||(n||="GET"),t.url=i),n&&(t.method=n),new up.Response(t)}ns(t){return up.EventEmitter.fromEmitArgs(t,{layer:this.bindLayer,request:this,origin:this.origin})}emit(...t){return this.ns(t).emit()}assertEmitted(...t){this.ns(t).assertEmitted()}get description(){return this.method+" "+this.url}isBoundToSubtrees(t){return t=e.wrapList(t),e.some(this.bindFragments,(function(n){return e.some(t,(t=>t.contains(n)))}))}isBoundToLayers(t){return e.contains(t,this.bindLayer)}get age(){return new Date-this.builtAt}header(t){return this.headers[t]}Nr(){for(let t of["target","failTarget","mode","failMode","context","failContext"])this.io(t);let t,e;(t=this.csrfHeader())&&(e=this.csrfToken())&&this.so(t,e),this.so(up.protocol.headerize("version"),up.version)}io(t){this.so(up.protocol.headerize(t),this[t])}so(t,n){e.isMissing(n)||((e.isOptions(n)||e.isArray(n))&&(n=e.safeStringifyJSON(n)),this.headers[t]=n)}mergeIfUnsent(t){if("new"!==this.state)return;if(!this.target||!t.target)return;let n=up.fragment.splitTarget(this.target+","+t.target);this.target=e.uniq(n).join(", "),this.io("target"),this.Dr=e.uniq([...this.fragments,...t.fragments])}static tester(t,{except:n}={}){let i;if(e.isFunction(t))i=t;else if(t instanceof this)i=e=>t===e;else if(e.isString(t)){let e=new up.URLPattern(t);i=t=>e.test(t.url)}else i=e=>t;return n?t=>!up.cache.willHaveSameResponse(t,n)&&i(t):i}},e.delegatePromise(t.prototype,"_deferred"),t)},7974:()=>{const t=up.util;class Route{constructor(){this.varyHeaders=new Set,this.requests=[]}matchBest(e){let n=this.requests.filter((t=>this.satisfies(t,e)));return t.last(n)}delete(e){t.remove(this.requests,e)}put(t){this.requests.push(t)}updateVary(t){for(let e of t.varyHeaderNames)this.varyHeaders.add(e)}satisfies(e,n){return e===n||t.every(this.varyHeaders,(i=>{let s=e.header(i),r=n.header(i);if("X-Up-Target"===i||"X-Up-Fail-Target"===i){if(!s)return!0;if(!r)return!1;let e=up.fragment.splitTarget(s),n=up.fragment.splitTarget(r);return t.containsAll(e,n)}return s===r}))}}up.Request.Cache=class Cache{constructor(){this.reset()}reset(){this.ro={},this.oo=[]}get(t){t=this.uo(t);let e=this.ao(t),n=e.matchBest(t);if(n){if(this.ho(n))return n;this.co(t,e)}}async put(t){t=this.uo(t);let e=this.ao(t),{response:n}=t;n&&e.updateVary(n);let i=e.requests.filter((n=>e.satisfies(t,n)));for(let t of i)this.co(t);t.cacheRoute=e,e.put(t),this.oo.push(t),this.lo()}alias(t,e){if(t=this.get(t))return e=this.uo(e),this.track(t,e,{force:!0}),this.put(e),e}async track(e,n,i={}){let s;n.trackedRequest=e,n.state="tracking",s=e.ended&&e.response?e.response:await t.always(e),s instanceof up.Response?i.force||e.cacheRoute.satisfies(e,n)?(n.fromCache=!0,s=t.variant(s,{request:n}),n.respondWith(s),t.delegate(n,["expired","state"],(()=>e))):(delete n.trackedRequest,n.state="new",i.onIncompatible?.(n)):(n.state=e.state,n.Zr(s))}willHaveSameResponse(t,e){return t===e||t===e.trackedRequest}evict(t=!0,e){this.po(t,e,(t=>this.co(t)))}expire(t=!0,e){this.po(t,e,(t=>t.expired=!0))}reindex(t){this.co(t),delete t.cacheRoute,this.put(t)}co(e){t.remove(this.oo,e),e.cacheRoute?.delete(e)}ao(t){return t.cacheRoute||(this.ro[t.description]||=new Route)}ho(t){return t.age<up.network.config.cacheEvictAge}get fo(){return this.oo.length}get Mn(){return up.network.config.cacheSize}lo(){for(let t=0;t<this.fo-this.Mn;t++)this.co(this.oo[0])}po(e=!0,n,i){let s=up.Request.tester(e,n),r=t.filter(this.oo,s);t.each(r,i)}uo(e){return t.wrapValue(up.Request,e)}}},5221:()=>{const t=up.util,e=up.element,n=["GET","POST"];up.Request.FormRenderer=class FormRenderer{constructor(t){this.kt=t}buildAndSubmit(){this.params=t.copy(this.kt.params);let i=this.kt.url,{method:s}=this.kt;const r=up.Params.fromURL(i);this.params.addAll(r),i=up.Params.stripURL(i),t.contains(n,s)||(s=up.protocol.wrapMethod(s,this.params)),this.qn=e.affix(document.body,"form.up-request-loader",{method:s,action:i});let o,u,a=this.kt.contentType;a&&this.qn.setAttribute("enctype",a),(o=this.kt.csrfParam())&&(u=this.kt.csrfToken())&&this.params.add(o,u),t.each(this.params.toArray(),this.do.bind(this)),up.browser.submitForm(this.qn)}do(t){e.affix(this.qn,"input[type=hidden]",t)}}},6413:()=>{const t=up.util;up.Request.Queue=class Queue{constructor(){this.reset()}reset(){this.mo=[],this.yo=[],this.wo=!1}get allRequests(){return this.yo.concat(this.mo)}asap(e){e.runQueuedCallbacks(),t.always(e,(t=>this.At(e,t))),this.bo(e),this.vo(e),queueMicrotask((()=>this._o()))}promoteToForeground(t){t.background&&(t.background=!1,this.bo(t))}bo(e){if(!e.isTimed())return;let n=Math.max(e.effectiveLateTime-e.age);t.timer(n,(()=>this.ko()))}So(){return t.evalOption(up.network.config.concurrency)}xo(){const t=this.So();return-1===t||this.yo.length<t}isBusy(){return this.yo.length>0||this.mo.length>0}vo(t){this.mo.push(t)}Eo(){let e=t.find(this.mo,(t=>!t.background));return e||=this.mo[0],t.remove(this.mo,e)}Oo(t){t.load()&&this.yo.push(t)}At(e,n){t.remove(this.yo,e)||t.remove(this.mo,e),n instanceof up.Response&&n.ok&&up.network.registerAliasForRedirect(e,n),queueMicrotask((()=>this._o())),t.task((()=>this.Co()))}_o(){let t;if(this.xo()&&(t=this.Eo()))return this.Oo(t)}abort(...e){let[n=!0,{except:i,reason:s,logOnce:r}]=t.args(e,"val","options"),o=up.Request.tester(n,{except:i});for(let e of[this.yo,this.mo]){const n=t.filter(e,o);for(let i of n)r&&(up.puts(...r),r=null),i.abort({reason:s}),t.remove(e,i)}}ko(){!this.wo&&this.Fo()&&(this.wo=!0,up.emit("up:network:late",{log:"Server is slow to respond"}))}Co(){this.wo&&!this.To.length&&(this.wo=!1,up.emit("up:network:recover",{log:"Slow requests were loaded"}))}get To(){return this.allRequests.filter((t=>t.isTimed()))}Fo(){return t.some(this.To,(t=>t.age>=t.effectiveLateTime-1))}}},2298:()=>{var t;const e="multipart/form-data",n=up.util;up.Request.XHRRenderer=(t=class XHRRenderer{constructor(t){this.kt=t}buildAndSend(t){const e=this.kt.xhr;this.Ro=n.copy(this.kt.params),this.kt.timeout&&(e.timeout=this.kt.timeout),e.open(this.Po(),this.kt.url);let i=this.Lo();i&&e.setRequestHeader("Content-Type",i);for(let t in this.kt.headers){let n=this.kt.headers[t];e.setRequestHeader(t,n)}Object.assign(e,t),e.send(this.Ao())}Po(){let t=this.kt.method;return this.kt.wrapMethod&&!this.kt.will302RedirectWithGET()&&(t=up.protocol.wrapMethod(t,this.Ro)),t}Lo(){return this.$o(),this.Do}Ao(){return this.$o(),this.Mo}$o(){this.Mo=this.kt.payload,this.Do=this.kt.contentType,!this.Mo&&this.kt.allowsPayload()&&(this.Do||(this.Do=this.Ro.hasBinaryValues()?e:"application/x-www-form-urlencoded"),this.Do===e?(this.Do=null,this.Mo=this.Ro.toFormData()):this.Mo=this.Ro.toQuery().replace(/%20/g,"+"))}},n.memoizeMethod(t.prototype,{$o:!0,Po:!0}),t)},4517:()=>{const t=up.util;up.Response=class Response extends up.Record{keys(){return["method","url","text","status","request","xhr","target","title","acceptLayer","dismissLayer","eventPlans","context","expireCache","evictCache","headers","loadedAt","fail"]}defaults(){return{headers:{},loadedAt:new Date}}get ok(){return!t.evalOption(this.fail??up.network.config.fail,this)}get none(){return!this.text}header(t){return this.headers[t]||this.xhr?.getResponseHeader(t)}get varyHeaderNames(){let e=this.header("Vary");return t.getSimpleTokens(e,{separator:","})}get contentType(){return this.header("Content-Type")}get cspNonces(){return up.protocol.cspNoncesFromHeader(this.header("Content-Security-Policy")||this.header("Content-Security-Policy-Report-Only"))}get lastModified(){let t=this.header("Last-Modified");if(t)return new Date(t)}get etag(){return this.header("ETag")}get json(){return this.parsedJSON||=JSON.parse(this.text)}get age(){return new Date-this.loadedAt}get expired(){return this.age>up.network.config.cacheExpireAge||this.request.expired}get description(){return`HTTP ${this.status} response to ${this.request.description}`}}},7241:()=>{var t;const e=up.util,n=up.element,i=/^\s*<(html|!DOCTYPE)\b/i;up.ResponseDoc=(t=class ResponseDoc{constructor({document:t,fragment:e,content:n,target:i,origin:s,data:r,cspNonces:o,match:u}){if(t?this.No(t,s,r):e?this.Ho(e,s,r):this.jo(n||"",s,i,r),this.qo=o,s){let t=up.fragment.tryToTarget(s);t&&(this.Bo=this.select(t))}this.ai=u}No(t,s,r){if(t instanceof Document)this.ui=t,this.Uo=!0;else if(e.isString(t)){this.Uo=i.test(t);let e=t=>[n.createBrokenDocumentFromHTML(t)],o=up.fragment.provideNodes(t,{origin:s,data:r,htmlParser:e});o[0]instanceof Document?this.ui=o[0]:this.ui=this.Io(o)}else this.ui=this.Io(t)}zo(t){return n.createBrokenDocumentFromHTML(t)}Ho(t,e,i){let s=n.extractSingular(up.fragment.provideNodes(t,{origin:e,data:i}));this.ui=this.Io(s)}jo(t,i,s,r){s||up.fail("must pass a { target } when passing { content }");let o=e.map(up.fragment.parseTargetSteps(s),"selector").join(),u=up.fragment.provideNodes(t,{origin:i,data:r}),a=n.createFromSelector(o,{content:u});this.ui=this.Io(a)}Io(t){t=e.wrapList(t);let n=document.createElement("up-document");return n.append(...t),n}rootSelector(){return up.fragment.toTarget(this.ui.children[0])}get title(){return this.Vo(this.Ko)}Xo(){if(this.Uo)return this.ui.head}Vo(t){let e=this.Xo();return e&&t(e)}get metaTags(){return this.Vo(up.history.findMetaTags)}get assets(){return this.Vo(up.script.findAssets)}get lang(){if(this.Uo)return up.history.getLang(this.ui)}Ko(t){return t.querySelector("title")?.textContent}select(t){return new up.FragmentFinder({selector:t,origin:this.Bo,document:this.ui,match:this.ai}).find()}selectSteps(t){return t.filter((t=>this.Wo(t)||this.Go(t)))}commitSteps(t){return t.filter((t=>this.commitElement(t.newElement)))}Wo(t){if(t.newElement)return!0;let e=this.select(t.selector);if(!e)return;let{selectEvent:n}=t;return n&&(n.newFragment=e,n.renderOptions=t.originalRenderOptions,up.emit(t.oldElement,n,{callback:t.selectCallback}),n.defaultPrevented)?void 0:(t.newElement=e,!0)}Go(t){if(!t.maybe)throw new up.CannotMatch}commitElement(t){if(this.ui.contains(t))return up.fragment.config.runScripts||up.script.disableSubtree(t),t.remove(),!0}finalizeElement(t){if(up.NonceableCallback.adoptNonces(t,this.qo),this.ui instanceof Document){let i=n.subtree(t,":is(noscript,script,audio,video):not(.up-keeping, .up-keeping *)");e.each(i,n.fixParserDamage)}}},e.memoizeMethod(t.prototype,{Xo:!0}),t)},2723:()=>{const t=up.element,e=up.util;up.RevealMotion=class RevealMotion{constructor(e,n={}){this.U=e,this.Jo=t.get(n.viewport)||up.viewport.get(this.U),this.Qo=up.layer.get(this.Jo),this.Yo=n.scrollBehavior??n.behavior??"instant";const i=up.viewport.config;this.Zo=n.snap??n.revealSnap??i.revealSnap,this.tu=n.padding??n.revealPadding??i.revealPadding,this.eu=n.top??n.revealTop??i.revealTop,this.nu=n.max??n.revealMax??i.revealMax,this.iu=i.selector("fixedTopSelectors"),this.su=i.selector("fixedBottomSelectors")}start(){const t=this.ru(this.Jo),n=up.Rect.fromElement(this.U);if(this.nu){const t=e.evalOption(this.nu,this.U);n.height=Math.min(n.height,t)}n.grow(this.tu),this.ou(t),t.height<0&&up.fail("Viewport has no visible area");const i=this.Jo.scrollTop;let s=i;this.eu||n.height>t.height?s+=n.top-t.top:n.top<t.top?s-=t.top-n.top:n.bottom>t.bottom&&(s+=n.bottom-t.bottom),e.isNumber(this.Zo)&&s<this.Zo&&n.top<.5*t.height&&(s=0),s!==i&&this.Jo.scrollTo({top:s,behavior:this.Yo})}ru(){return up.viewport.isRoot(this.Jo)?new up.Rect({left:0,top:0,width:up.viewport.rootWidth(),height:up.viewport.rootHeight()}):up.Rect.fromElement(this.Jo)}uu(n){let i=up.fragment.all(n,{layer:this.Qo});return e.filter(i,t.isVisible)}ou(t){for(let e of this.uu(this.iu)){let n=up.Rect.fromElement(e).bottom-t.top;n>0&&(t.top+=n,t.height-=n)}for(let e of this.uu(this.su)){let n=up.Rect.fromElement(e),i=t.bottom-n.top;i>0&&(t.height-=i)}}}},8720:()=>{const t=up.util,e=up.element;up.Selector=class Selector{constructor(e,n,i={}){this.au=[];let s,r=n&&!document.contains(n);if(r||i.destroying||this.au.push(up.fragment.isNotDestroying),this.hu=r||"any"===i.layer||1===up.layer.count,this.hu)s=up.layer.root;else{if(i.layer??=t.presence(n,t.isElement),this.et=up.layer.getAll(i),!this.et.length)throw new up.CannotMatch(["Unknown layer: %o",i.layer]);this.au.push((e=>t.some(this.et,(t=>t.contains(e))))),s=this.et[0]}this.cu=up.fragment.expandTargets(e,{...i,layer:s}),this.lu=this.cu.join()||"match-none"}matches(t){return e.elementLikeMatches(t,this.lu)&&this.pu(t)}closest(t){return this.fu(t.closest(this.lu))}descendants(t=document){return this.du(t.querySelectorAll(this.lu))}firstDescendant(n){return this.hu?(n||=document,this.mu((t=>n.querySelectorAll(t)))):t.findResult(this.et,(t=>this.mu((n=>e.subtree(t.element,n)))))}subtree(t){return this.du(e.subtree(t,this.lu))}mu(e){return t.findResult(this.cu,(t=>this.du(e(t))[0]))}pu(e){return e&&t.every(this.au,(t=>t(e)))}fu(e){return t.presence(e,this.pu.bind(this))}du(e){return t.filter(e,this.pu.bind(this))}}},7885:()=>{const t=up.util,e=up.element;up.Tether=class Tether{constructor(t){up.migrate.handleTetherOptions?.(t),this.gu=t.anchor,this.yu=t.align,this.wu=t.position,this.bu="top"===this.wu||"bottom"===this.wu?"horizontal":"vertical",this.Jo=up.viewport.get(this.gu),this.parent=this.Jo===e.root?document.body:this.Jo,this.vu=!this.Jo.contains(this.gu.offsetParent)}start(t){this.U=t,this.U.style.position="absolute",this._u(0,0),this.sync(),this.ku("on")}stop(){this.ku("off")}ku(t){let e=this.Su.bind(this);up[t](window,"resize",e),this.vu&&up[t](this.Jo,"scroll",e)}Su(){return clearTimeout(this.syncTimer),this.syncTimer=t.task(this.sync.bind(this))}isDetached(){return!this.parent.isConnected||!this.gu.isConnected}sync(){const n=this.U.getBoundingClientRect(),i=e.styleNumber(this.U,"margin-top"),s=e.styleNumber(this.U,"margin-right"),r=e.styleNumber(this.U,"margin-bottom"),o=e.styleNumber(this.U,"margin-left"),u=this.gu.getBoundingClientRect();let a,h;switch(this.bu){case"horizontal":switch(this.wu){case"top":h=u.top-r-n.height;break;case"bottom":h=u.top+u.height+i}switch(this.yu){case"left":a=u.left+o;break;case"center":a=u.left+.5*(u.width-n.width);break;case"right":a=u.left+u.width-n.width-s}break;case"vertical":switch(this.yu){case"top":h=u.top+i;break;case"center":h=u.top+.5*(u.height-n.height);break;case"bottom":h=u.top+u.height-n.height-r}switch(this.wu){case"left":a=u.left-s-n.width;break;case"right":a=u.left+u.width+o}}t.isDefined(a)||t.isDefined(h)?this.kr(a,h):up.fail("Invalid tether constraints: %o",this.xu())}xu(){return{position:this.wu,align:this.yu}}kr(t,e){const n=this.U.getBoundingClientRect();this._u(t-n.left+this.offsetLeft,e-n.top+this.offsetTop)}_u(t,n){this.offsetLeft=t,this.offsetTop=n,e.setStyle(this.U,{left:t,top:n},"px")}}},4818:()=>{const t=up.util;up.URLPattern=class URLPattern{constructor(e){this.Eu=[];const n=[],i=[];for(let s of t.getSimpleTokens(e))"-"===s[0]?i.push(s.substring(1)):n.push(s);this.Ou=this.Cu(n,!0),this.Fu=this.Cu(i,!1)}Cu(e,n){if(!e.length)return;let i=(e=(e=t.flatMap(e,t.matchableURLPatternAtom)).map(t.escapeRegExp)).join("|");return i=i.replace(/\\\*/g,".*?"),i=i.replace(/(:|\\\$)([a-z][\w-]*)/gi,((t,e,i)=>"\\$"===e?(n&&this.Eu.push({name:i,cast:Number}),"(\\d+)"):(n&&this.Eu.push({name:i,cast:String}),"([^/?#]+)"))),new RegExp("^(?:"+i+")$")}test(e,n=!0){return n&&(e=t.matchableURL(e)),this.Ou.test(e)&&!this.Tu(e)}recognize(e,n=!0){n&&(e=t.matchableURL(e));let i=this.Ou.exec(e);if(i&&!this.Tu(e)){const t={};return this.Eu.forEach(((e,n)=>{let s=i[n+1];if(s)return t[e.name]=e.cast(s)})),t}}Tu(t){return this.Fu?.test(t)}}},9675:(t,e,n)=>{n(1860),up.element=function(){const t=up.util;function e(...e){let[n=document,i]=t.args(e,"val","val");return n.querySelector(i)}function n(t,e){const n=[];return i(t,e)&&n.push(t),n.push(...t.querySelectorAll(e)),n}function i(e,n){return t.isElement(e)&&e.matches(n)}function s(...n){const i=n.pop();return t.isElement(i)?i:t.isString(i)?e(...n,i):t.isList(i)?(i.length>1&&up.fail("up.element.get(): Cannot cast multiple elements (%o) to a single element",i),i[0]):i}function r(...e){return t.flatMap(e,o)}function o(e){return t.isString(e)?document.querySelectorAll(e):t.wrapList(e)}function u(e,n){return n===N(e)?t.noop:(a(e,n),()=>a(e,!n))}function a(t,e){e?(t.removeAttribute("hidden"),"none"===t.style.display&&(t.style.display="")):t.setAttribute("hidden","")}function h(e,n){for(let i in n){const s=n[i];t.isGiven(s)?e.setAttribute(i,s):e.removeAttribute(i)}}function c(t,e){t.parentNode.insertBefore(e,t)}function l(e,n={}){let i,s,r,{includePath:o}=f(e);for(let t of o){let{tagName:e}=t;e&&"*"!==e||(e="div"),s=document.createElement(e),i||(i=s),p(s,t),r?.appendChild(s),r=s}for(let e in n){let s=n[e];"class"===e?T(i,t.wrapList(s)):"style"===e?D(i,s):"text"===e?i.textContent=s:"content"===e?t.isString(s)?i.innerHTML=s:i.append(...t.wrapList(s)):i.setAttribute(e,s)}return i}function p(t,{id:e,classNames:n,attributes:i}){e&&(t.id=e);for(let[e,n]of Object.entries(i))t.setAttribute(e,n);T(t,n)}function f(e){let n;const{masked:i,restore:s}=t.expressionOutline(e),r=i.replace(/:not\([^)]*\)/,(function(t){return n=s(t),""}));let o=s(r);return{includePath:r.split(/[ >]+/).map((function(n){let i={tagName:null,classNames:[],id:null,attributes:{}};return(n=(n=(n=(n=n.replace(/^[\w-*]+/,(function(t){return i.tagName=t,""}))).replace(/#([\w-]+)/,(function(t,e){return i.id=e,""}))).replace(/\.([\w-]+)/g,(function(t,e){return i.classNames.push(e),""}))).replace(/\[[^\]]*]/g,(function(e){e=s(e);let[n,r,o,u,a]=e.match(/\[([\w-]+)(?:([~|^$*]?=)(["'])?([^\3\]]*?)\3)?]/);return u||='"',i.attributes[r]=a?t.parseString(u+a+u):"",""})))&&up.fail("Cannot parse selector: "+e),i})),includeRaw:o,excludeRaw:n}}const d=["HTML","BODY","HEAD","TITLE"],m=up.mockable((t=>t.matches(d.join())));function g(e,n){return t.isGiven(n)?`[${e}="${n=n.replace(/"/g,'\\"')}"]`:`[${e}]`}function y(t){return w(b(t))}function w(e){if(1===e.length&&t.isElementLike(e[0]))return e[0];up.fail("Expected a single element, but got %d elements",e.length)}function b(t){t=t.trim();const e=document.createRange();return e.setStart(document.body,0),e.createContextualFragment(t).childNodes}function v(t){t.offsetHeight}function _(e,n,i){t.isMissing(e.getAttribute(n))&&e.setAttribute(n,i)}function k(e){const n=document.createElement("up-wrapper");return n.append(...t.wrapList(e)),n}function S(e,n,...i){if(!e.hasAttribute?.(n))return;let s=e.getAttribute(n);for(let r of i){let i=r(s,n,e);if(t.isDefined(i))return i}}function x(t,e){return S(t,e,E)}let E=t.identity;function O(t,e){switch(t){case"false":return!1;case"true":case"":case e:return!0}}function C(t){if((t=t.replaceAll("_","")).match(/^-?[\d.]+$/))return parseFloat(t)}function F(e){if(e?.trim())return t.parseRelaxedJSON(e)}function T(t,e){for(let n of e)t.classList.add(n)}function R(e,n,i){return e.classList.contains(n)===i?t.noop:(e.classList.toggle(n,i),()=>e.classList.toggle(n,!i))}function P(t,e){return $(window.getComputedStyle(t),e)}function L(e,n){const i=P(e,n);if(t.isPresent(i))return parseFloat(i)}function A(t,e){const{style:n}=t;return $(n,e)}function $(e,n){return up.migrate.loaded&&(n=up.migrate.fixStyleProps(n)),t.isString(n)?e.getPropertyValue(n):t.mapObject(n,(t=>[t,e.getPropertyValue(t)]))}function D(e,n,i=""){if(up.migrate.loaded&&(n=up.migrate.fixStyleProps(n,i)),t.isString(n))e.setAttribute("style",n);else{const{style:t}=e;for(let e in n){let s=n[e];t.setProperty(e,s+i)}}}function M(t,e){const n=A(t,Object.keys(e));return D(t,e),()=>D(t,n)}function N(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}function H(t){return/^up-/.test(t)}function j(e,n){return t.mapObject(n,(t=>[t,e.getAttribute(t)]))}return{subtree:n,subtreeFirst:function(t,e){return i(t,e)?t:t.querySelector(e)},contains:function(t,e){const n=s(e);return Node.prototype.contains.call(t,n)},closestAttr:function(t,e,n=x){let i=t.closest("["+e+"]");if(i)return n(i,e)},ancestor:function(t,e){return t.parentNode?.closest(e)},around:function(t,e){return r(t.closest(e),n(t,e))},get:s,list:r,toggle:function(t,e=!N(t)){a(t,e)},hide:function(t){a(t,!1)},hideTemp:function(t){return u(t,!1)},show:function(t){a(t,!0)},showTemp:function(t){return u(t,!0)},metaContent:function(t){const n="meta"+g("name",t);return e(n)?.getAttribute("content")},insertBefore:c,createFromSelector:l,setAttrs:h,setAttrsTemp:function(t,e){let n=Object.keys(e),i=j(t,n);return h(t,e),()=>h(t,i)},affix:function(...e){let[n,i="beforeend",s,r]=t.args(e,"val",t.isAdjacentPosition,"val","options");const o=l(s,r);return n.insertAdjacentElement(i,o),o},idSelector:function(t){return t.match(/^[a-z][a-z0-9\-_]*$/i)?`#${t}`:g("id",t)},classSelector:function(t){return`.${t=t.replace(/[^\w-]/g,"\\$&")}`},isSingleton:m,attrSelector:g,tagName:function(t){return t.tagName.toLowerCase()},createBrokenDocumentFromHTML:function(t){return(new DOMParser).parseFromString(t,"text/html")},fixParserDamage:function(t){let e=y(t.outerHTML);t.replaceWith(e)},createNodesFromHTML:b,createFromHTML:y,extractSingular:w,get root(){return document.documentElement},paint:v,concludeCSSTransition:function(t){const e=M(t,{transition:"none"});return v(t),e},hasCSSTransition:function(t){const e=t["transition-property"],n=t["transition-duration"];return!("none"===e||"all"===e&&0===n)},fixedToAbsolute:function(t){const e=t.getBoundingClientRect();t.style.position="absolute";const n=t.offsetParent.getBoundingClientRect();D(t,{left:e.left-L(t,"margin-left")-n.left+"px",top:e.top-L(t,"margin-top")-n.top+"px",right:"",bottom:""})},setMissingAttrs:function(t,e){for(let n in e)_(t,n,e[n])},setMissingAttr:_,unwrap:function(t){!function(e){const n=document.activeElement;try{return function(){let e=[...t.childNodes];for(let n of e)c(t,n);t.remove()}()}finally{n&&n!==document.activeElement&&n.focus({preventScroll:!0})}}()},wrapChildren:function(t){const e=k(t.childNodes);return t.append(e),e},wrapIfRequired:function(e){return 1===e.length&&t.isElement(e[0])?e[0]:k(e)},attr:x,booleanAttr:function(t,e){return S(t,e,O)},numberAttr:function(t,e){return S(t,e,C)},jsonAttr:function(t,e){return S(t,e,F)},callbackAttr:function(e,n,i){return S(e,n,(n=>function(e,n,{exposedKeys:i=[],mainKey:s="event"}={}){const r=up.NonceableCallback.fromString(e).toFunction(s,...i);return function(e){const s=Object.values(t.pick(e,i));return r.call(n,e,...s)}}(n,e,i)))},booleanOrStringAttr:function(t,e){return S(t,e,O,E)},booleanOrNumberAttr:function(t,e){return S(t,e,O,C)},setStyleTemp:M,style:P,styleNumber:L,inlineStyle:A,setStyle:D,isVisible:N,upAttrs:function(t){let e=t.getAttributeNames().filter(H);return j(t,e)},upClasses:function(e){return t.filter(e.classList.values(),H)},setAttrPresence:function(t,e,n,i){return i?t.setAttribute(e,n):t.removeAttribute(e)},addClasses:T,addClassTemp:function(t,e){return R(t,e,!0)},removeClassTemp:function(t,e){return R(t,e,!1)},cleanJQuery:function(t){up.browser.canJQuery()&&jQuery(t).remove()},parseSelector:f,isEmpty:function(t){return!t.children.length>0&&!t.innerText.trim()},crossOriginSelector:function(t){return`[${t}*="//"]:not([${t}*="//${location.host}/"])`},isIntersectingWindow:function(t,{margin:e=0}={}){const n=up.Rect.fromElement(t);return n.grow(e),n.bottom>0&&n.top<window.innerHeight&&n.right>0&&n.left<window.innerWidth},unionSelector:function(e,n){let i=`:is(${e.join()})`;return t.isPresent(n)&&(i+=`:not(${n.join()})`),i},matchSelectorMap:function(e,n){let i=[];if(e)for(let[s,r]of Object.entries(e))t.isDefined(r)&&n.matches(s)&&i.push(r);return i},elementLikeMatches:i,documentPosition:function(t){let e=t.nextElementSibling;return e?[e,"beforebegin"]:[t.parentElement,"beforeend"]}}}()},3924:()=>{up.error=function(){function t(t){if("object"!=typeof(e=t)||!("AbortError"===e.name||e instanceof up.RenderResult||e instanceof up.Response))throw t;var e}function e(t,...e){try{return t(...e)}catch(t){reportError(t)}}return{fail:function(...t){throw new up.Error(t)},throwCritical:t,muteUncriticalRejection:function(e){return e.catch(t)},muteUncriticalSync:function(e){try{return e()}catch(e){t(e)}},guard:e,guardFn:function(t){return(...n)=>e((()=>t(...n)))}}}(),up.fail=up.error.fail},4366:()=>{up.Aborted=class Aborted extends up.Error{constructor(t){super(t,{name:"AbortError"})}}},8010:()=>{up.CannotMatch=class CannotMatch extends up.Error{}},4861:()=>{up.CannotParse=class CannotParse extends up.Error{}},3469:()=>{up.CannotTarget=class CannotTarget extends up.Error{}},376:()=>{up.Error=class Error extends window.Error{constructor(t,e={}){Array.isArray(t)&&(t=up.util.sprintf(...t)),super(t);let n="up."+this.constructor.name;Object.assign(this,{name:n},e)}}},8272:()=>{up.NotImplemented=class NotImplemented extends up.Error{}},4504:()=>{up.Offline=class Offline extends up.Error{}},8670:()=>{up.event=function(){const t=up.util,e=up.element;function n(...t){return i(t).bind()}function i(t,e){return up.EventListenerGroup.fromBindArgs(t,e)}function s(t){return up.EventEmitter.fromEmitArgs(t)}function r(...e){const n=t.extractOptions(e),i=e[0]||n.type||up.fail("Missing event type"),s=new Event(i,{bubbles:!0,cancelable:!0});return Object.assign(s,t.omit(n,["type","target"])),s}const o=["metaKey","shiftKey","ctrlKey","altKey"];function u(e){return(t.isUndefined(e.button)||0===e.button)&&!t.some(o,(t=>e[t]))}function a(e,n,i=[]){const s=r(n,t.pick(e,i));return s.originalEvent=e,["stopPropagation","stopImmediatePropagation","preventDefault"].forEach((function(t){const n=s[t];return s[t]=function(){return e[t](),n.call(s)}})),e.defaultPrevented&&s.preventDefault(),s}n("up:click","[up-emit]",(function(t,n){if(!u(t))return;const i=e.attr(n,"up-emit"),s=e.jsonAttr(n,"up-emit-props"),r=a(t,i);Object.assign(r,s),up.emit(n,r)}));let h=["unknown"];function c(t){h.push(t),setTimeout((()=>h.pop()))}return n("keydown keyup",{capture:!0},(()=>c("key"))),n("pointerdown pointerup",{capture:!0},(()=>c("pointer"))),n("up:framework:reset",(function(){for(let t of[window,document,e.root,document.body])for(let e of up.EventListener.allNonDefault(t))e.unbind()})),{on:n,off:function(...t){return i(t).unbind()},build:r,emit:function(...t){return s(t).emit()},assertEmitted:function(...t){return s(t).assertEmitted()},onEscape:function(t){return n("keydown",(function(e){if("Escape"===e.key)return t(e)}))},halt:function(t,e={}){e.log&&up.log.putsEvent(t),t.stopImmediatePropagation(),t.preventDefault()},isUnmodified:u,isSyntheticClick:function(e){return t.isMissing(e.clientX)},fork:a,keyModifiers:o,get inputDevice(){return t.last(h)}}}(),up.on=up.event.on,up.off=up.event.off,up.emit=up.event.emit},2851:()=>{up.form=function(){const t=up.util,e=up.element,n=new up.Config((()=>({groupSelectors:["[up-form-group]","fieldset","label","form"],fieldSelectors:["select","input:not([type=submit], [type=image], [type=button])","button[type]:not([type=submit], [type=button])","textarea"],submitSelectors:["form:is([up-submit], [up-target], [up-layer], [up-transition])"],noSubmitSelectors:["[up-submit=false]","[target]",e.crossOriginSelector("action")],submitButtonSelectors:["input[type=submit]","input[type=image]","button[type=submit]","button:not([type])"],genericButtonSelectors:["input[type=button]","button[type=button]"],watchInputEvents:["input","change"],watchInputDelay:0,watchChangeEvents:["change"]})));function i(t=""){return n.fieldSelectors.map((e=>e+t)).join()}function s(t){return t.matches(i())}function r(n){n=e.get(n);let s=e.subtree(n,i());if(n.matches("form[id]")){const r=i(e.attrSelector("form",n.getAttribute("id"))),o=up.fragment.all(r,{layer:n});s.push(...o),s=t.uniq(s)}return s}function o(t){return e.subtree(t,a())}function u(t){return t?.matches(a())}function a(){return n.selector("submitButtonSelectors")}const h=up.mockable(((t,e)=>up.render(c(t,e))));function c(e,n,i){e=S(e),n=t.options(n);let s=new up.OptionsParser(e,n,i);return s.include(f),s.string("failTarget",{default:up.fragment.tryToTarget(e)}),n.guardEvent||=up.event.build("up:form:submit",{submitButton:n.submitButton,log:"Submitting form",params:n.params,form:e}),n.origin||=up.viewport.focusedElementWithin(e)||n.submitButton||e,n.activeElements=t.uniq([n.origin,n.submitButton,e].filter(t.isElement)),s.include(up.link.followOptions),n}function l(t){if(t.disabled)return;let e;return document.activeElement===t?(e=y(t),t.disabled=!0,up.focus(e,{force:!0,preventScroll:!0})):t.disabled=!0,()=>{t.disabled=!1,e&&document.activeElement===e&&t.isConnected&&up.focus(t,{preventScroll:!0})}}function p(e,n){let i=()=>x(n||up.fail("Missing { origin }"));return!0===e?[i()]:t.isElement(e)?[e]:t.isString(e)?up.fragment.subtree(i(),e,{origin:n}):t.isArray(e)?t.flatMap(e,(t=>p(t,n))):[]}function f(e,n,i){n=t.options(n),e=S(e);const s=new up.OptionsParser(e,n,i);s.string("contentType",{attr:"enctype"}),s.json("headers");const r=up.Params.fromForm(e),u=n.submitButton??=o(e)[0];return u&&(r.addField(u),n.method||=u.getAttribute("formmethod"),n.url||=u.getAttribute("formaction")),r.addAll(n.params),n.params=r,s.string("url",{attr:"action",default:up.fragment.source(e)}),s.string("method",{attr:["up-method","data-method","method"],default:"GET",normalize:t.normalizeMethod}),"GET"===n.method&&(n.url=up.Params.stripURL(n.url)),n}function d(...e){let[n,i,s]=t.args(e,"val","options","callback");n=up.element.get(n),s||=function(t){let e=t.getAttribute("up-watch");if(e)return up.NonceableCallback.fromString(e).toFunction("value","name","options").bind(t)}(n)||up.fail("No callback given for up.watch()");const r=new up.FieldWatcher(n,i,s);return r.start(),()=>r.stop()}function m(t,e={}){return d(t,{...e,batch:!0},((e,n)=>h(t,n)))}function g(){return up.migrate.migratedFormGroupSelectors?.()||n.groupSelectors}function y(t){return w(t).element}function w(e){return t.findResult(g(),(function(t){let n=e.closest(t);if(n){let i=up.fragment.tryToTarget(n,{strong:!0}),s=up.fragment.tryToTarget(e),r=i||s&&n!==e&&`${t}:has(${s})`;if(r)return{target:r,element:n,origin:e}}}))}function b(n){let i,s;if(n.matches("input[type=checkbox]"))n.checked?(i=n.value,s=":checked"):s=":unchecked";else if(n.matches("input[type=radio]")){const t=x(n),r=n.getAttribute("name"),o=t.querySelector(`input[type=radio]${e.attrSelector("name",r)}:checked`);o?(s=":checked",i=o.value):s=":unchecked"}else i=n.value;const r=[];return t.isPresent(i)?(r.push(i),r.push(":present")):r.push(":blank"),t.isPresent(s)&&r.push(s),r}function v(t,e={}){const n=e.target||e.target||t.getAttribute("up-switch"),i=x(t);n||up.fail("No switch target given for %o",t);const s=b(t);for(let t of up.fragment.all(i,n))_(t,s)}const _=up.mockable((function(n,i){let s;i||=b(function(e){const n=x(e).querySelectorAll("[up-switch]");return t.find(n,(function(t){const n=t.getAttribute("up-switch");return e.matches(n)}))||up.fail("Could not find [up-switch] field for %o",e)}(n));let r=n.getAttribute("up-hide-for");if(r)r=k(r),s=0===t.intersect(i,r).length;else{let e=n.getAttribute("up-show-for");e=e?k(e):[":present",":checked"],s=t.intersect(i,e).length>0}e.toggle(n,s),n.classList.add("up-switched")}));function k(e){return t.getSimpleTokens(e,{json:!0})}function S(t,e={}){const n=up.fragment.get(t,e);return n.form||n.closest("form")}function x(t,e){return S(t,e)||up.layer.get(t).element}return up.on("submit",n.selectorFn("submitSelectors"),(function(e,n){if(e.defaultPrevented)return;const i=t.presence(e.submitter,u);up.event.halt(e,{log:!0}),up.error.muteUncriticalRejection(h(n,{submitButton:i}))})),up.compiler((function(){let t=n.fieldSelectors.map((t=>`${t}[up-validate], [up-validate] ${t}`));return e.unionSelector(t,["[up-validate=false]"])}),(function(t){up.FormValidator.forElement(t).watchContainer(t)})),up.compiler("[up-switch]",(t=>{v(t)})),up.on("change","[up-switch]",((t,e)=>{v(e)})),up.compiler("[up-show-for]:not(.up-switched), [up-hide-for]:not(.up-switched)",(t=>{_(t)})),up.attribute("up-watch",(t=>d(t))),up.attribute("up-autosubmit",(t=>m(t))),{config:n,submit:h,submitOptions:c,destinationOptions:f,watchOptions:function(e,n,i={}){n=t.options(n);let s=new up.OptionsParser(e,n,{...i,closest:!0,attrPrefix:"up-watch-"});s.include(up.status.statusOptions),s.string("event"),s.number("delay");let r=up.form.config;return"input"===n.event?(n.event=t.evalOption(r.watchInputEvents,e),n.delay??=r.watchInputDelay):"change"===n.event&&(n.event=t.evalOption(r.watchChangeEvents,e)),n.origin||=e,n},isSubmittable:function(t){return t=up.fragment.get(t),n.matches(t,"submitSelectors")},watch:d,validate:function(...e){let n=function(e,...n){const i=t.extractOptions(n);return i.origin?i.target||=up.fragment.toTarget(e):i.origin||=up.fragment.get(e),i}(...e);return up.FormValidator.forElement(n.origin).validate(n)},autosubmit:m,fieldSelector:i,fields:r,isField:s,submitButtons:o,focusedField:function(){return t.presence(document.activeElement,s)},switchTarget:_,disable:function(i){let s=[...r(i),...o(i),...(u=i,e.subtree(u,n.selector("genericButtonSelectors")))];var u;return t.sequence(t.map(s,l))},getDisablePreviewFn:function(t,e){return function(n){let i=p(t,e);for(let t of i)n.disable(t)}},group:y,groupSolution:w,groupSelectors:g,get:S,getScope:x}}(),up.submit=up.form.submit,up.watch=up.form.watch,up.autosubmit=up.form.autosubmit,up.validate=up.form.validate},2667:(t,e,n)=>{n(8711);const i=up.util,s=up.element;up.fragment=function(){function t(t){let e=s.tagName(t);if(e.startsWith("up-"))return e}const e=["[up-id]","[id]","html","head","body"],n=new up.Config((()=>({badTargetClasses:[/^up-/],strongTargetDerivers:e,targetDerivers:[...e,"main","[up-main]",t,"link[rel][type]","link[rel=preload][href]","link[rel=preconnect][href]","link[rel=prefetch][href]","link[rel]","meta[property]","*[name]","form[action]","a[href]","[class]","[up-flashes]","form"],verifyDerivedTarget:!0,renderOptions:{hungry:!0,keep:!0,saveScroll:!0,saveFocus:!0,focus:"keep",abort:"target",failOptions:!0,feedback:!0},navigateOptions:{cache:"auto",revalidate:"auto",fallback:!0,focus:"auto",scroll:"auto",history:"auto",peel:!0},match:"region",runScripts:!0,autoHistoryTargets:[":main"],autoFocus:["hash","autofocus","main-if-main","keep","target-if-lost"],autoScroll:["hash","layer-if-main"],autoRevalidate:t=>t.expired,skipResponse:r})));function r({response:t,expiredResponse:e}){return!t.text||t.text===e?.text}function o(t,e={}){return t=d(t,e),s.closestAttr(t,"up-source")}function u(t){return i.normalizeURL(t,{hash:!1})}function a(t){let e=s.closestAttr(t,"up-time");if(e&&"false"!==e)return/^\d+$/.test(e)&&(e=1e3*Number(e)),new Date(e)}function h(t){let e=s.closestAttr(t,"up-etag");if(e&&"false"!==e)return e}i.delegate(n,["mainTargets"],(()=>up.layer.config.any));const c=up.mockable(((...t)=>{let e=b(t);return new up.RenderJob(e).execute()})),l=up.mockable(((...t)=>{const e=b(t);return c({...e,navigate:!0})}));function p(t){return!t.closest(".up-destroying")}function f(t){return t.isConnected&&p(t)}function d(...t){let[e,n,r]=g(t);return i.isElementLike(n)?s.get(n):e?m(e,n,r):new up.FragmentFinder({selector:n,origin:r.origin,layer:r.layer,match:r.match}).find()}function m(...t){let[e,n,i]=g(t);return new up.Selector(n,e,i).firstDescendant(e)}function g(t){return i.args(t,"val","val","options")}function y(...t){let[e,n,s]=g(t);return i.isElement(n)?[n]:i.isList(n)?n:new up.Selector(n,e,s).descendants(e)}function w(t,e,n={}){return new up.Selector(e,t,n).subtree(t)}function b(t){const e=i.parseArgIntoOptions(t,"target");return i.isElement(e.target)&&(e.origin||=e.target),e}const v=/^(onFail|on|fail)?(.+)$/;function _(t,e){return i.presence(t,i.isString)||k(t,e)||function(t){throw new up.CannotTarget(function(t){return`Cannot derive good target selector from a <${s.tagName(t)}> element without identifying attributes. Try setting an [id] or configure up.fragment.config.targetDerivers.`}(t))}(t)}function k(t,e={}){let r=e.strong?n.strongTargetDerivers:n.targetDerivers;return i.findResult(r,(function(r){let o=function(t,e){if(i.isFunction(e))return e(t);if(t.matches(e))try{return function(t,e){let{includePath:n,excludeRaw:i}=s.parseSelector(e);if(1!==n.length)throw new up.CannotParse(e);let{tagName:r,id:o,classNames:u,attributes:a}=n[0],h="";"*"===r?h+=s.tagName(t):r&&(h+=r);for(let t of u)h+=s.classSelector(t);o&&(h+=s.idSelector(o));for(let e in a){let n=a[e]||t.getAttribute(e);if("id"===e)h+=s.idSelector(n);else if("class"===e)for(let e of S(t))h+=s.classSelector(e);else h+=s.attrSelector(e,n)}return i&&(h+=i),h}(t,e)}catch(t){if(t instanceof up.CannotParse)return e;throw t}}(t,r);if(o&&function(t,e,i={}){let s=i.verify??n.verifyDerivedTarget;return!f(e)||!s||up.fragment.get(t,{layer:e,...i})===e}(o,t,e))return o}))}function S(t){return i.filter(t.classList,(t=>!i.some(n.badTargetClasses,(e=>{return n=e,s=t,i.isRegExp(n)?n.test(s):n===s;var n,s}))))}const x=/:main\b/,E=/:layer\b/,O=/:origin\b/;function C(t){return x.test(t)}function F(t,e={}){const{layer:n}=e;"new"===n||n instanceof up.Layer||up.fail("Must pass an up.Layer as { layer } option, but got %o",n),t=i.copy(i.wrapList(t));const s=[];for(;t.length;){let r=t.shift();if(!0===r&&(r=":main"),C(r)){let n=T(e),i=up.layer.mainTargets(n).map((t=>r.replace(x,t)));t.unshift(...i)}else if(E.test(r)){if("new"===n||n.opening)continue;let i=_(n.getFirstSwappableElement(),e);t.unshift(r.replace(E,i))}else i.isElementLike(r)?s.push(_(r,e)):i.isString(r)&&s.push(P(r,e))}return i.uniq(s)}function T({layer:t,mode:e}){return"new"===t?e||up.fail('Must pass a { mode } option together with { layer: "new" }'):t.mode}function R(t,{origin:e}={}){return t.replace(O,(function(n){if(e)return _(e);up.fail('Missing { origin } element to resolve "%s" reference (found in %s)',n,t)}))}function P(t,e){return i.isString(t)?(up.migrate.resolveOrigin||R)(t,e):t}function L(t){return i.getComplexTokens(t)}const A=/^([\w-]+|\*)?(#|\.|[:[][a-z-]{3,})/;function $(t,{origin:e,originLayer:n,data:r,htmlParser:o=s.createNodesFromHTML}={}){if(i.isString(t)&&A.test(t)){let[s,o]=i.parseScalarJSONPairs(t)[0];r={...r,...o},t=up.fragment.get(s,{layer:"closest",origin:e,originLayer:n})||up.fail('Cannot find template "%s"',t)}return i.isString(t)&&(t=o(t)),function(t){return i.isElement(t)&&t.matches("template, script[type]")&&!up.script.isScript(t)}(t)&&(t=D(t,r,{htmlParser:o})),i.wrapList(t)}function D(t,e={},{origin:n,htmlParser:i}={}){let r=d(t,{origin:n})||up.fail("Template not found: %o",t),o=up.emit(r,"up:template:clone",{data:e,nodes:null,log:["Using template %o",t]}).nodes??function(t,e=s.createNodesFromHTML){return e(t.innerHTML)}(r,i);for(let t of o)t.upTemplateData=e;return o}return up.on("up:framework:boot",(function(){const{documentElement:t}=document;if(t.setAttribute("up-source",u(location.href)),up.hello(t),!up.browser.canPushState())return up.warn("Cannot push history changes. Next render pass with history will load a full page.")})),{config:n,reload:function(...t){const e=b(t);e.target||=":main";const n=d(e.target,e);return e.url||=o(n),e.headers=i.merge(e.headers,function(t){let e={},n=a(t);n&&(e["If-Modified-Since"]=n.toUTCString());let i=h(t);return i&&(e["If-None-Match"]=i),e}(n)),(e.keepData||s.booleanAttr(n,"up-keep-data"))&&(e.data=up.data(n)),up.migrate.postprocessReloadOptions?.(e),c(e)},destroy:function(...t){const e=b(t);return(e.element=d(e.target,e))&&new up.Change.DestroyFragment(e).execute(),up.migrate.formerlyAsync?.("up.destroy()")},render:c,navigate:l,get:d,getFirstDescendant:m,all:y,subtree:w,contains:function(t,e){return i.isElement(e)?s.contains(t,e)&&up.layer.get(t).contains(e):w(t,e).length>0},closest:function(t,e,n){return new up.Selector(e,t,n).closest(t)},source:o,normalizeSource:u,visit:function(t,e){return l({...e,url:t})},markAsDestroying:function(t){t.classList.add("up-destroying"),t.setAttribute("aria-hidden","true")},emitInserted:function(t){return up.emit(t,"up:fragment:inserted",{log:["Inserted fragment %o",t]})},emitDestroyed:function(t,e){const n=e.log??["Destroyed fragment %o",t],i=e.parent||document;return up.emit(i,"up:fragment:destroyed",{fragment:t,parent:i,log:n})},emitKeep:function(t){let{oldElement:e,newElement:n,newData:i,renderOptions:r}=t;const o=["Keeping fragment %o",e],u=s.callbackAttr(e,"up-on-keep",{exposedKeys:["newFragment","newData"]});return up.emit(e,"up:fragment:keep",{newFragment:n,newData:i,renderOptions:r,log:o,callback:u})},successKey:function(t){let e=v.exec(t);if(e){let[t,n,s]=e;switch(n){case"onFail":return"on"+i.upperCaseFirst(s);case"fail":return i.lowerCaseFirst(s)}}},failKey:function(t){let e=v.exec(t);if(e){let[t,n,s]=e;switch(n){case"on":return"onFail"+i.upperCaseFirst(s);case void 0:return"fail"+i.upperCaseFirst(s)}}},expandTargets:F,resolveOrigin:P,toTarget:_,tryToTarget:k,isTargetable:function(t){return!!k(t)},matches:function(t,e,n={}){if(t=s.get(t),i.isElement(e)){let n=k(e);return n&&t.matches(n)}return new up.Selector(e,t,n).matches(t)},hasAutoHistory:function(t,e){let i=F(n.autoHistoryTargets,{layer:e}).join();for(let e of t)if(s.subtree(e,i).length)return!0;return up.puts("up.render()","Will not auto-update history because fragment doesn't contain a selector from up.fragment.config.autoHistoryTargets"),!1},time:a,etag:h,shouldRevalidate:function(t,e,s={}){return t.fromCache&&i.evalAutoOption(s.revalidate,n.autoRevalidate,e)},abort:function(...t){let e,n,s=b(t),{reason:r,newLayer:o}=s;if(s.target)n=y(s.target,s),e=t=>t.isBoundToSubtrees(n),r||="Aborting requests within fragment";else{let t=up.layer.getAll(s);n=i.map(t,"element"),e=e=>e.isBoundToLayers(t),r||="Aborting requests within "+t.join(", ")}up.network.abort((t=>t.abortable&&e(t)),{...s,reason:r});for(let t of n)up.emit(t,"up:fragment:aborted",{reason:r,newLayer:o,log:!1})},onAborted:function(t,e){let n=up.on("up:fragment:aborted",{guard:e=>e.target.contains(t)},e);return up.destructor(t,n),n},onFirstIntersect:function(t,e,{margin:n=0}={}){if(s.isIntersectingWindow(t,{margin:n}))return void e();let i=new IntersectionObserver((function(t){for(let n of t)if(n.isIntersecting)return r(),void e()}),{rootMargin:`${n}px`}),r=()=>i.disconnect();i.observe(t),up.destructor(t,r)},splitTarget:L,parseTargetSteps:function(t,e={}){let n=e.defaultPlacement||"swap",i=e.defaultMaybe??!1,s=[],r=L(t);for(let t of r){if(":none"===t)continue;let r=n,o=i;t=t.replace(/\b::?(before|after)\b/,((t,e)=>(r=e,""))),t=t.replace(/\b:maybe\b/,(()=>(o=!0,"")));const u={...e,selector:t,placement:r,maybe:o,originalRenderOptions:e};s.push(u)}return s},isAlive:f,isNotDestroying:p,targetForSteps:function(t){let e=t.filter((t=>!t.maybe||t.oldElement?.isConnected));return i.map(e,"selector").join(", ")||":none"},compressNestedSteps:function(t){if(t.length<2)return t;let e=i.uniqBy(t,"oldElement");return e=i.reject(e,(t=>function(t,e){return i.some(t,(function(t){return t!==e&&("swap"===t.placement||"content"===t.placement)&&t.oldElement.contains(e.oldElement)}))}(e,t))),e},containsMainPseudo:C,insertTemp:function(...t){let[e,n="beforeend",r]=i.args(t,"val",i.isAdjacentPosition,"val"),o=$(r,{origin:e}),u=s.wrapIfRequired(o),a=document.contains(u)&&s.documentPosition(u);return e.insertAdjacentElement(n,u),a?()=>{a[0].insertAdjacentElement(a[1],u)}:(up.hello(u),()=>up.destroy(u))},provideNodes:$,cloneTemplate:D}}(),up.reload=up.fragment.reload,up.destroy=up.fragment.destroy,up.render=up.fragment.render,up.navigate=up.fragment.navigate,up.visit=up.fragment.visit,up.template={clone:up.fragment.cloneTemplate},i.delegate(up,["context"],(()=>up.layer.current))},9634:()=>{up.framework=function(){let t="evaling";function e(){if("configuring"!==t)return void console.error("Unpoly has already booted");let e=n();e?console.error("Unpoly cannot boot: %s",e):(t="booting",up.emit("up:framework:boot",{log:!1}),t="booted",up.emit("up:framework:booted",{log:!1}))}function n(){for(let t of["Promise","DOMParser","FormData","reportError"])if(!window[t])return`Browser doesn't support the ${t} API`;if("BackCompat"===document.compatMode)return"Browser is in quirks mode (missing DOCTYPE?)";for(let t of[":is(*)",":has(*)"])if(!CSS.supports(`selector(${t})`))return`Browser doesn't support the ${t} selector`}return{onEvaled:function(){up.emit("up:framework:evaled",{log:!1}),function(){let t=document.currentScript;return!!t?.async||"manual"===t?.getAttribute("up-boot")||"complete"===document.readyState||void 0}()?console.debug("Call up.boot() after you have configured Unpoly"):document.addEventListener("DOMContentLoaded",e),t="configuring"},boot:e,startExtension:function(){if("configuring"!==t)throw new Error("Unpoly extensions must be loaded before booting");t="evaling"},stopExtension:function(){t="configuring"},reset:function(){up.emit("up:framework:reset",{log:!1})},get evaling(){return"evaling"===t},get booted(){return"booted"===t},get beforeBoot(){return"booting"!==t&&"booted"!==t},isSupported:function(){return!n()}}}(),up.boot=up.framework.boot},8944:()=>{up.history=function(){const t=up.util,e=up.element,n=new up.Config((()=>({enabled:!0,updateMetaTags:!0,restoreTargets:["body"],metaTagSelectors:["meta","link[rel=alternate]","link[rel=canonical]","link[rel=icon]","[up-meta]",'script[type="application/ld+json"]'],noMetaTagSelectors:["meta[http-equiv]","[up-meta=false]","meta[name=csp-nonce]"]})));let i,s;function r(){return t.normalizeURL(location.href)}function o(){const t=r();s!==t&&(i=s,s=t)}function u(e,n){return t.matchURLs(e,location.href,{hash:!0,...n})}function a(e,n={}){c("replaceState",e=t.normalizeURL(e))&&!1!==n.event&&h({location:e,reason:"replace",log:`Replaced state for ${e}`})}function h(t){let e=up.event.build("up:location:changed",t);up.migrate?.renamedProperty?.(e,"url","location"),up.emit(e)}function c(t,e){if(n.enabled){const n={up:{}};return window.history[t](n,"",e),o(),!0}}function l(t){o();let e=r();h({location:e,reason:"pop",log:`Navigated to history entry ${e}`}),up.viewport.saveFocus({location:i}),up.viewport.saveScroll({location:i}),function(t){if(!t?.up)return void up.puts("popstate","Ignoring a history state not owned by Unpoly");let e=r();up.error.muteUncriticalRejection(up.render({guardEvent:up.event.build("up:location:restore",{location:e,log:`Restoring location ${e}`}),url:e,target:n.restoreTargets,fail:!1,history:!0,location:e,peel:!0,layer:"root",cache:"auto",revalidate:"auto",saveScroll:!1,scroll:["restore","auto"],saveFocus:!1,focus:["restore","auto"]}))}(t.state)}function p(){window.addEventListener("popstate",l),"GET"===up.protocol.initialRequestMethod()&&a(r(),{event:!1})}function f(t=document.head){return t.querySelectorAll(n.selector("metaTagSelectors"))}return o(),up.on("up:framework:boot",(function(){"jasmine"in window?p():setTimeout(p,100)})),up.macro("[up-back]",(function(t){i&&(e.setMissingAttrs(t,{"up-href":i,"up-scroll":"restore"}),t.removeAttribute("up-back"),up.link.makeFollowable(t))})),up.on("up:framework:reset",(function(){i=void 0,s=void 0,o()})),{config:n,push:function(e){!u(e=t.normalizeURL(e))&&c("pushState",e)&&h({location:e,reason:"push",log:`Advanced to location ${e}`})},replace:a,get location(){return r()},get previousLocation(){return i},isLocation:u,findMetaTags:f,updateMetaTags:function(t){let e=f();for(let t of e)t.remove();for(let e of t)document.head.append(e)},getLang:function(t=document){let{documentElement:e}=t;if(e.matches("html"))return t.documentElement.lang},updateLang:function(t){e.setAttrPresence(e.root,"lang",t,!!t)}}}()},9443:(t,e,n)=>{n(4432);const i=up.util,s=up.element;up.layer=function(){const t=[up.Layer.Root,up.Layer.Modal,up.Layer.Popup,up.Layer.Drawer,up.Layer.Cover],e=new up.Config((function(){const e={mode:"modal",any:{mainTargets:["[up-main='']","main",":layer"]},root:{mainTargets:["[up-main~=root]"],history:!0},overlay:{mainTargets:["[up-main~=overlay]"],openAnimation:"fade-in",closeAnimation:"fade-out",dismissLabel:"×",dismissARIALabel:"Dismiss dialog",dismissable:!0,history:"auto",trapFocus:!0},cover:{mainTargets:["[up-main~=cover]"]},drawer:{mainTargets:["[up-main~=drawer]"],backdrop:!0,position:"left",size:"medium",openAnimation(t){switch(t.position){case"left":return"move-from-left";case"right":return"move-from-right"}},closeAnimation(t){switch(t.position){case"left":return"move-to-left";case"right":return"move-to-right"}}},modal:{mainTargets:["[up-main~=modal]"],backdrop:!0,size:"medium"},popup:{mainTargets:["[up-main~=popup]"],position:"bottom",size:"medium",align:"left",dismissable:"outside key",trapFocus:!1},foreignOverlaySelectors:["dialog"]};for(let n of t)e[n.mode].Class=n;return e}));let n=null,r=[];function o(t){return"root"===t?[e.root,e.any]:[e[t],e.overlay,e.any]}async function u(t){return t=i.options(t,{layer:"new",defaultToEmptyContent:!0,navigate:!0}),(await up.render(t)).layer}up.on("up:fragment:destroyed",(function(){n.sync()})),up.on("up:framework:evaled",(function(){n=new up.LayerStack})),up.on("up:framework:reset",(function(){n.reset(),r=i.filter(r,"isDefault")}));const a={config:e,mainTargets:function(t){return i.flatMap(o(t),"mainTargets")},open:u,build:function(t,s){const{mode:r}=t,{Class:u}=e[r],a=i.reverse(o(r));let h=up.migrate.handleLayerConfig;return h&&a.forEach(h),t.openAnimation??=i.pluckKey(t,"animation"),t=i.mergeDefined(...a,{mode:r,stack:n},t),s&&(t=s(t)),new u(t)},ask:function(t){return new Promise((function(e,n){u(t={...t,onAccepted:t=>e(t.value),onDismissed:t=>n(t.value)})}))},normalizeOptions:function(t){!function(t){if(!(t.layer instanceof up.Layer))if(up.migrate.handleLayerOptions?.(t),i.isGiven(t.layer)){let n=String(t.layer).match(/^(new|shatter|swap)( (\w+))?/);if(n){t.layer="new";const i=n[1],s=n[3];t.mode||=s||e.mode,"swap"===i?up.layer.isOverlay()&&(t.baseLayer="parent"):"shatter"===i&&(t.baseLayer="root")}}else i.isElementLike(t.target)?t.layer=n.get(t.target,{normalizeLayerOptions:!1}):t.origin?t.layer="origin":t.layer="current"}(t),t.context??={},function(t){t.baseLayer instanceof up.Layer||(t.baseLayer=n.get("current",{...t,normalizeLayerOptions:!1}))}(t)},openCallbackAttr:function(t,e){return s.callbackAttr(t,e,{exposedKeys:["layer"]})},closeCallbackAttr:function(t,e){return s.callbackAttr(t,e,{exposedKeys:["layer","value","response"]})},anySelector:function(){return i.map(t,(t=>t.selector())).join()},optionToString:function(t){return i.isString(t)?`layer "${t}"`:t.toString()},get stack(){return n.layers},isWithinForeignOverlay:function(t){let n=e.selector("foreignOverlaySelectors");return!(!n||!t.closest(n))}};return i.delegate(a,["get","getAll","root","overlays","current","front","sync","count","dismissOverlays"],(()=>n)),i.delegate(a,["accept","dismiss","isRoot","isOverlay","isFront","on","off","emit","parent","history","location","mode","context","element","contains","size","affix"],(()=>n.current)),a}()},3849:(t,e,n)=>{n(2065),up.link=function(){const t=up.util,e=up.element;let n=null;const i="[up-content], [up-fragment], [up-document]",s=`${i}, [up-target], [up-layer], [up-transition], [up-preload]`,r=new up.Config((()=>({followSelectors:["[up-follow]",`a:is(${s})`],noFollowSelectors:["[up-follow=false]","a[download]","a[target]",'a[href^="javascript:"]','a[href^="mailto:"]','a[href^="tel:"]',`a[href^="#"]:not(${i})`,e.crossOriginSelector("href"),e.crossOriginSelector("up-href")],instantSelectors:["[up-instant]"],noInstantSelectors:["[up-instant=false]","[onclick]"],preloadSelectors:["[up-preload]"],noPreloadSelectors:["[up-preload=false]"],clickableSelectors:["[up-clickable]","[up-follow]","[up-emit]","[up-accept]","[up-dismiss]",`a:is(${s})`],noClickableSelectors:["[up-clickable=false]","a[href], button"],preloadDelay:90}))),o=up.mockable((function(t,e,n){return up.render(a(t,e,n))}));function u(e,n,i){n=t.options(n);const s=new up.OptionsParser(e,n,{...i,fail:!1});return n.url=function(t,e={}){const n=e.url||t.getAttribute("up-href")||t.getAttribute("href");if("#"!==n)return n}(e,n),n.method=c(e,n),s.json("headers"),s.json("params"),s.booleanOrString("cache"),s.booleanOrString("expireCache"),s.booleanOrString("evictCache"),s.booleanOrString("revalidate"),s.booleanOrString("abort"),s.boolean("abortable"),s.boolean("background"),s.string("contentType"),s.booleanOrNumber("lateDelay"),s.number("timeout"),n}function a(e,n,i){e=up.fragment.get(e),n=t.options(n);const s=new up.OptionsParser(e,n,{fail:!0,...i});return s.include(u),n.origin||=e,s.boolean("fail"),s.boolean("navigate",{default:!0}),s.string("confirm",{attr:["up-confirm","data-confirm"]}),s.string("target"),s.booleanOrString("fallback"),s.string("match"),s.string("document"),s.string("fragment"),s.string("content"),s.boolean("keep",{attr:"up-use-keep"}),s.boolean("hungry",{attr:"up-use-hungry"}),s.json("data",{attr:"up-use-data"}),s.callback("onLoaded"),s.callback("onRendered",{mainKey:"result"}),s.callback("onFinished",{mainKey:"result"}),s.callback("onOffline",{mainKey:"error"}),s.callback("onError",{mainKey:"error"}),s.boolean("peel"),s.string("layer"),s.string("baseLayer"),s.json("context"),s.string("mode"),s.string("align"),s.string("position"),s.string("class"),s.string("size"),s.booleanOrString("dismissable"),s.parse(up.layer.openCallbackAttr,"onOpened"),s.parse(up.layer.closeCallbackAttr,"onAccepted"),s.parse(up.layer.closeCallbackAttr,"onDismissed"),s.string("acceptEvent"),s.string("dismissEvent"),s.string("acceptLocation"),s.string("dismissLocation"),s.booleanOrString("history"),s.include(up.status.statusOptions),s.booleanOrString("focus"),s.boolean("saveScroll"),s.boolean("saveFocus"),s.booleanOrString("scroll"),s.boolean("revealTop"),s.number("revealMax"),s.number("revealPadding"),s.number("revealSnap"),s.string("scrollBehavior"),s.booleanOrString("history"),s.booleanOrString("location"),s.booleanOrString("title"),s.boolean("metaTags"),s.booleanOrString("lang"),s.include(up.motion.motionOptions),n.guardEvent??=up.event.build("up:link:follow",{log:["Following link %o",e]}),n}function h(t,e){let n=function(t){if(!g(t))return"Will not preload an unsafe link"}(t=up.fragment.get(t));if(n)return Promise.reject(new up.Error(n));const i=up.event.build("up:link:preload",{log:["Preloading link %o",t]});return o(t,{abort:!1,abortable:!1,background:!0,cache:!0,...up.RenderOptions.NO_INPUT_INTERFERENCE,...up.RenderOptions.NO_PREVIEWS,...e,guardEvent:i,preload:!0})}function c(e,n={}){return t.normalizeMethod(n.method||e.getAttribute("up-method")||e.getAttribute("data-method"))}function l(t){return t=up.fragment.get(t),r.matches(t,"followSelectors")}function p(t){l(t)||t.setAttribute("up-follow","")}function f(t,e){if(t.defaultPrevented)return!1;const n=`a, [up-follow], ${up.form.fieldSelector()}`,i=t.target.closest(n);return!i||i===e}function d(t){const e=t.closest(r.selector("instantSelectors"));return e&&(n=e,!(r.matches(n,"noInstantSelectors")||r.matches(n,"noFollowSelectors")));var n}function m(t){let e=["clientX","clientY","button",...up.event.keyModifiers];const n=up.event.fork(t,"up:click",e);up.emit(t.target,n,{log:!1})}function g(t){const e=c(t);return up.network.isSafeMethod(e)}function y(t,n,i){switch(t){case"insert":i();break;case"reveal":{let t=e.numberAttr(n,"up-intersect-margin");up.fragment.onFirstIntersect(n,i,{margin:t});break}case"hover":new up.LinkFollowIntent(n,i)}}function w(t,e){let n={navigate:!1,guardEvent:up.event.build("up:deferred:load",{log:["Loading deferred %o",t]}),...e};return o(t,n,{defaults:{target:":origin",cache:"auto",revalidate:"auto",feedback:!0}})}return up.macro(r.selectorFn("clickableSelectors"),(function(t){let n=t.matches("a, [up-follow]")?"link":"button";e.setMissingAttrs(t,{tabindex:"0",role:n,"up-clickable":""}),t.addEventListener("keydown",(function(e){if("Enter"===e.key||"button"===t.role&&"Space"===e.key)return m(e)}))})),up.attribute("up-defer",{defaultValue:"insert"},(function(t,e){y(e,t,(()=>up.error.muteUncriticalRejection(w(t))))})),up.on("up:click",r.selectorFn("followSelectors"),(function(t,e){f(t,e)&&(up.event.halt(t,{log:!0}),up.focus(e,{preventScroll:!0}),up.error.muteUncriticalRejection(o(e)))})),up.attribute("up-expand",{defaultValue:"a, [up-href]",macro:!0},(function(t,n){let i=e.get(t,n);i&&(e.setMissingAttrs(t,{"up-href":e.attr(i,"href"),...e.upAttrs(i)}),e.addClasses(t,e.upClasses(i)),p(t))})),up.compiler(r.selectorFn("preloadSelectors"),(function(n){if(!function(t){return!up.browser.canPushState()||!l(t)||!function(t){const e=u(t);if(e.url)return null==e.cache&&(e.cache="auto"),e.basic=!0,new up.Request(e).willCache()}(t)}(n)){let i=()=>up.error.muteUncriticalRejection(h(n)),s=e.booleanOrStringAttr(n,"up-preload");(!0===s||t.isUndefined(s))&&(s="hover"),y(s,n,i)}})),up.on("up:framework:reset",(function(){n=null})),{follow:o,followOptions:a,requestOptions:u,preload:h,makeFollowable:p,isSafe:g,isFollowable:l,shouldFollowEvent:f,convertClicks:function(t){t.on("click",(function(e,i){if(up.event.isUnmodified(e))return d(i)&&n?up.event.halt(e):("key"===up.event.inputDevice||up.event.isSyntheticClick(e)||t.wasHitByMouseEvent(e)&&(!n||n===e.target))&&m(e),n=null})),t.on("mousedown",(function(t,e){up.event.isUnmodified(t)&&(n=t.target,d(e)&&m(t))}))},config:r,loadDeferred:w}}(),up.follow=up.link.follow,up.deferred={load:up.link.loadDeferred}},4453:()=>{up.log=function(){const t=up.util,e=new up.LogConfig;function n(t,e,n,...s){i(t,e,"",n,...s)}function i(n,i,s,r,...o){r&&(e.format?console[n](`%c${i}%c ${r}`,"color: #666666; padding: 1px 3px; border: 1px solid #bbbbbb; border-radius: 2px; font-size: 90%; display: inline-block;"+s,"",...o):console[n](`[${i}] ${t.sprintf(r,...o)}`))}return up.on("up:framework:boot",(function(){if(!e.banner)return;const t=` __ _____ ___ ___ / /_ __\n/ // / _ \\/ _ \\/ _ \\/ / // / ${up.version}\n\\___/_//_/ .__/\\___/_/\\_. / \n / / / /\n\n`;let n="";up.migrate.loaded||(n+="Load unpoly-migrate.js to polyfill deprecated APIs.\n\n"),e.enabled?n+="Call `up.log.disable()` to disable logging for this session.":n+="Call `up.log.enable()` to enable logging for this session.";const i="color: #777777";e.format?console.log("%c"+t+"%c"+n,"font-family: monospace;"+i,i):console.log(t+n)})),{puts:function(...t){e.enabled&&n("log",...t)},putsEvent:function(t){if(e.enabled){let e="#5566cc";i("log",(t=t.originalEvent||t).type,`color: white; border-color: ${e}; background-color: ${e}`,"Interaction on %o",t.target)}},error:(...t)=>n("error",...t),warn:(...t)=>n("warn",...t),config:e,enable:function(){e.enabled=!0},disable:function(){e.enabled=!1}}}(),up.puts=up.log.puts,up.warn=up.log.warn},6535:()=>{up.migrate={config:{}}},8374:()=>{up.mockable=function(t){if(window.jasmine){let e=t.name,n={[e]:t},i=function(){return n[e].apply(this,arguments)};return i.mock=()=>spyOn(n,e),i}return t}},4034:()=>{up.motion=function(){const t=up.util,e=up.element;let n={},i={};const s=new up.MotionController("motion"),r=new up.Config((()=>({duration:175,easing:"ease",enabled:!matchMedia("(prefers-reduced-motion: reduce)").matches})));function o(e){return t.pickBy(e,"isDefault")}function u(){return r.enabled}function a(t,n,i){return c(i),u()&&!y(n)&&i.duration>0&&!e.isSingleton(t)}function h(t,e,n){return up.migrate.loaded&&(e=up.migrate.fixStyleProps(e)),n={...n,finishEvent:s.finishEvent},new up.CSSTransition(t,e,n).start()}function c(t){t.easing??=r.easing,t.duration??=r.duration}function l(e){if(!y(e)){if(t.isFunction(e))return e;if(t.isArray(e))return p(...e);if(t.isString(e)){let t;if(e.indexOf("/")>=0)return p(...e.split("/"));if(t=i[e])return l(t)}else up.fail("Unknown transition %o",e)}}function p(e,n){if(!y(e)&&!y(n)){const i=f(e)||t.asyncNoop,s=f(n)||t.asyncNoop;return(t,e,n)=>Promise.all([i(t,n),s(e,n)])}}function f(e){var i;if(!y(e))return t.isFunction(e)?e:t.isString(e)?n[i=e]||up.fail("Unknown animation %o",i):t.isOptions(e)?(t,n)=>h(t,e,n):void up.fail("Unknown animation %o",e)}const d=up.mockable((function(t,e){t.replaceWith(e)}));function m(t,e){const n=l(e);n.isDefault=up.framework.evaling,i[t]=n}function g(t,e){const i=f(e);i.isDefault=up.framework.evaling,n[t]=i}function y(t){return!t||"none"===t}function w(t,n,i){g(t,(function(t,s){return t.style.opacity=0,e.setStyle(t,{opacity:n}),h(t,{opacity:i},s)}))}function b(t,e){return{transform:`translate(${t}px, ${e}px)`}}function v(t){return e.setStyle(t,{transform:""}),t.getBoundingClientRect()}function _(t,n){const i=`move-from-${t}`;g(`move-to-${t}`,(function(t,e){const i=v(t);return h(t,n(i),e)})),g(i,(function(t,i){const s=v(t),r=n(s);return e.setStyle(t,r),h(t,{transform:""},i)}))}return up.on("up:framework:boot",(function(){u()||up.puts("up.motion","Animations are disabled")})),w("fade-in",0,1),w("fade-out",1,0),_("top",(function(t){return b(0,-(t.top+t.height))})),_("bottom",(function(t){return b(0,up.viewport.rootHeight()-t.top)})),_("left",(function(t){return b(-(t.left+t.width),0)})),_("right",(function(t){return b(up.viewport.rootWidth()-t.left,0)})),m("cross-fade",["fade-out","fade-in"]),m("move-left",["move-to-left","move-from-right"]),m("move-right",["move-to-right","move-from-left"]),m("move-up",["move-to-top","move-from-bottom"]),m("move-down",["move-to-bottom","move-from-top"]),up.on("up:framework:reset",(function(){s.reset(),n=o(n),i=o(i)})),{morph:function(n,i,r,o){c(o=t.options(o)),n=up.fragment.get(n),i=up.fragment.get(i);let u=l(r);const h=a(n,u,o);u=up.error.guardFn(u);const p=t.pluckKey(o,"beforeStart")||t.noop,f=t.pluckKey(o,"afterInsert")||t.noop,m=t.pluckKey(o,"beforeDetach")||t.noop,g=t.pluckKey(o,"afterDetach")||t.noop,y=t.pluckKey(o,"scrollNew")||t.noop;if(p(),h){if(s.isActive(n)&&!1===o.trackMotion)return u(n,i,o);up.puts("up.morph()","Morphing %o to %o with transition %O over %d ms",n,i,r,o.duration);const t=up.viewport.get(n),a=t.scrollTop,h=up.viewport.absolutize(n,{afterMeasure(){e.insertBefore(n,i),f()}}),c=async function(){y();const e=t.scrollTop;h.moveBounds(0,e-a),await u(n,i,o),m(),h.bounds.remove(),g()};return s.startFunction([n,i],c,o)}return m(),d(n,i),f(),g(),y(),Promise.resolve()},animate:function(n,i,r){n=up.fragment.get(n),r=t.options(r);let o=f(i);const u=a(n,i,r);if(o=up.error.guardFn(o),u){const t=()=>o(n,r);return s.startFunction(n,t,r)}return function(n,i){return t.isOptions(i)&&e.setStyle(n,i),Promise.resolve()}(n,i)},finish:function(t){return s.finish(t)},finishCount:()=>s.finishCount,transition:m,animation:g,config:r,isEnabled:u,isNone:y,willAnimate:a,swapElementsDirectly:d,motionOptions:function(e,n,i){n=t.options(n);let s=new up.OptionsParser(e,n,i);return s.booleanOrString("animation"),s.booleanOrString("transition"),s.string("easing"),s.number("duration"),n}}}(),up.transition=up.motion.transition,up.animation=up.motion.animation,up.morph=up.motion.morph,up.animate=up.motion.animate},1647:(t,e,n)=>{n(35);const i=up.util;up.network=function(){const t=new up.Config((()=>({concurrency:6,wrapMethod:!0,cacheSize:70,cacheExpireAge:15e3,cacheEvictAge:54e5,lateDelay:400,fail:t=>(t.status<200||t.status>299)&&304!==t.status,autoCache:t=>t.isSafe(),expireCache:(t,e)=>!t.isSafe(),evictCache:!1,progressBar:!0,timeout:9e4}))),e=new up.Request.Queue,n=new up.Request.Cache;let s=null;function r(s){(function(t){let i;if(t.willCache()&&(i=n.get(t)))return up.puts("up.request()","Re-using previous request to %s",t.description),t.background||e.promoteToForeground(i),i.mergeIfUnsent(t),n.track(i,t,{onIncompatible:r}),!0})(s)||function(s){(function(e){e.willCache()&&(n.put(e),e.onLoading=()=>n.reindex(e)),i.always(e,(function(s){let r=s.expireCache??e.expireCache??i.evalOption(t.expireCache,e,s);r&&n.expire(r,{except:e});let o=s.evictCache??e.evictCache??i.evalOption(t.evictCache,e,s);o&&n.evict(o,{except:e});let u=n.get(e),a=s instanceof up.Response,h=!a,c=a&&s.ok,l=a&&!s.ok,p=a&&s.none;l?n.evict(e.url):h||p?n.evict(e):c&&u&&n.put(e)}))})(s),e.asap(s)}(s)}function o(...t){up.migrate.preprocessAbortArgs?.(t),e.abort(...t)}return up.on("up:network:late",(function(){i.evalOption(t.progressBar)&&(s=new up.ProgressBar)})),up.on("up:network:recover",(function(){s?.conclude()})),up.on("up:framework:reset",(function(){o(),e.reset(),n.reset(),s?.destroy(),s=null})),{request:function(...t){const e=function(t){let e=i.parseArgIntoOptions(t,"url");return up.migrate.handleRequestOptions?.(e),e}(t),n=new up.Request(e);return r(n),n},cache:n,isBusy:function(){return e.isBusy()},isSafeMethod:function(t){return i.contains(["GET","OPTIONS","HEAD"],i.normalizeMethod(t))},config:t,abort:o,registerAliasForRedirect:function(t,e){if(t.cache&&e.url&&t.url!==e.url){const s=i.variant(t,{method:e.method,url:e.url,cacheRoute:null});n.alias(t,s)}},queue:e,loadPage:function(t){new up.Request(t).loadPage()}}}(),up.request=up.network.request,up.cache=up.network.cache},3535:()=>{up.protocol=function(){const t=up.util,e=up.element,n=function(t){return"X-Up"+t.replace(/(^.|[A-Z])/g,(t=>"-"+t.toUpperCase()))},i=function(e,i,s=t.identity){let r=e.getResponseHeader(n(i));if(r)return s(r)};function s(t){return"false"!==t&&t}const r=t.memoize((function(){return t.normalizeMethod(up.browser.popCookie("_up_method"))})),o=new up.Config((()=>({methodParam:"_method",csrfParam:()=>e.metaContent("csrf-param"),csrfToken:()=>e.metaContent("csrf-token"),cspNonce:()=>e.metaContent("csp-nonce"),csrfHeader:"X-CSRF-Token",maxHeaderSize:2048})));return{config:o,locationFromXHR:function(t){return i(t,"location")||t.responseURL},titleFromXHR:function(e){return up.migrate.titleFromXHR?.(e)??i(e,"title",t.parseRelaxedJSON)},targetFromXHR:function(t){return i(t,"target")},methodFromXHR:function(e){return i(e,"method",t.normalizeMethod)},acceptLayerFromXHR:function(e){return i(e,"acceptLayer",t.parseRelaxedJSON)},contextFromXHR:function(e){return i(e,"context",t.parseRelaxedJSON)},dismissLayerFromXHR:function(e){return i(e,"dismissLayer",t.parseRelaxedJSON)},eventPlansFromXHR:function(e){return i(e,"events",t.parseRelaxedJSON)},expireCacheFromXHR:function(t){return i(t,"expireCache")||up.migrate.clearCacheFromXHR?.(t)},evictCacheFromXHR:function(t){return i(t,"evictCache",s)},csrfHeader:function(){return t.evalOption(o.csrfHeader)},csrfParam:function(){return t.evalOption(o.csrfParam)},csrfToken:function(){return t.evalOption(o.csrfToken)},cspNonce:function(){return t.evalOption(o.cspNonce)},initialRequestMethod:r,headerize:n,wrapMethod:function(t,e){return e.add(o.methodParam,t),"POST"},cspNoncesFromHeader:function(t){let e=[];if(t){let n=t.split(/\s*;\s*/);for(let t of n)if(0===t.indexOf("script-src")){let n,i=/'nonce-([^']+)'/g;for(;n=i.exec(t);)e.push(n[1])}}return e}}}()},9615:()=>{up.radio=function(){const t=up.element,e=new up.Config((()=>({hungrySelectors:["[up-hungry]"],noHungrySelectors:["[up-hungry=false]"],pollInterval:3e4})));return up.attribute("up-poll",(function(t){up.FragmentPolling.forFragment(t).onPollAttributeObserved()})),up.macro("[up-flashes]",(function(e){t.setMissingAttrs(e,{"up-hungry":"","up-if-layer":"subtree","up-keep":"",role:"alert"}),e.addEventListener("up:fragment:keep",(function(e){t.isEmpty(e.newFragment)||e.preventDefault()}))})),{config:e,hungrySteps:function(n){let{hungry:i,origin:s,layer:r,meta:o}=n,u={current:[],other:[]};if(!i)return u;let a=e.selector("hungrySelectors");const h=[r,...r.ancestors,...r.descendants];for(let e of h){let i=up.fragment.all(e.element,a,{layer:e});for(let a of i){let i=up.fragment.tryToTarget(a,{origin:s});if(!i){up.warn("[up-hungry]","Ignoring untargetable fragment %o",a);continue}let h=t.attr(a,"up-if-layer"),c=h?up.layer.getAll(h,{baseLayer:e}):[e],l={selector:i,oldElement:a,layer:e,origin:s,...up.motion.motionOptions(a),placement:"swap",keep:!0,maybe:!0,meta:o,selectEvent:up.event.build("up:fragment:hungry",{log:!1}),selectCallback:t.callbackAttr(a,"up-on-hungry",{exposedKeys:["newFragment","renderOptions"]}),originalRenderOptions:n};c.includes(r)&&(r===e?u.current:u.other).push(l)}}return u.other=up.fragment.compressNestedSteps(u.other),u},startPolling:function(t,e={}){up.FragmentPolling.forFragment(t).forceStart(e)},stopPolling:function(t){up.FragmentPolling.forFragment(t).forceStop()},pollOptions:function(t,n={}){const i=new up.OptionsParser(t,n,{defaults:{background:!0}});return i.number("interval",{default:e.pollInterval}),i.string("ifLayer",{default:"front"}),i.include(up.link.requestOptions),i.include(up.status.statusOptions),n}}}()},6774:()=>{!function(){const t=up.element;for(let e of["method","confirm"]){const n=`up-${e}`,i=`data-${e}`;up.macro(`a[${i}]`,(function(e){(window.Rails||window.jQuery?.rails)&&up.link.isFollowable(e)&&(t.setMissingAttr(e,n,e.getAttribute(i)),e.removeAttribute(i))}))}}()},1897:()=>{up.script=function(){const t=up.util,e=up.element,n=new up.Config((()=>({assetSelectors:["link[rel=stylesheet]","script[src]","[up-asset]"],noAssetSelectors:["[up-asset=false]"],nonceableAttributes:["up-watch","up-on-keep","up-on-hungry","up-on-opened","up-on-accepted","up-on-dismissed","up-on-loaded","up-on-rendered","up-on-finished","up-on-error","up-on-offline","up-placeholder"],scriptSelectors:["script:not([type])",'script[type="text/javascript"]','script[type="module"]','script[type="importmap"]'],noScriptSelectors:['script[type="application/ld+json"]']}))),i={"[up-back]":-100,"[up-clickable]":-200,"[up-drawer]":-200,"[up-modal]":-200,"[up-cover]":-200,"[up-popup]":-200,"[up-tooltip]":-200,"[up-dash]":-200,"[up-flashes]":-200,"[up-expand]":-300,"[data-method]":-400,"[data-confirm]":-400};let s=[],r=[];function o(e,n={}){let o=function(e,n){let[i,s,r]=u(e);return s=t.options(s,{selector:i,isDefault:up.framework.evaling,priority:0,batch:!1}),Object.assign(r,s,n)}(e,n);o.macro?(up.framework.evaling&&(o.priority||=function(e){e=t.evalOption(e);for(let t in i)if(e.indexOf(t)>=0)return i[t];up.fail("Unregistered priority for system macro %o",e)}(o.selector)),a(r,o)):a(s,o)}const u=function(e){return t.args(e,"val","options","callback")};function a(t,e){let n,i=0;for(;(n=t[i])&&n.priority>=e.priority;)i+=1;if(t.splice(i,0,e),up.framework.booted)if(0===e.priority)for(let t of up.layer.stack)h(t.element,{layer:t,compilers:[e]});else up.puts("up.compiler()","Compiler %s was registered after booting Unpoly. Compiler will run for future fragments only.",e.selector);return e}function h(t,e){up.emit(t,"up:fragment:compile",{log:!1});let n=e.compilers||r.concat(s);new up.CompilerPass(t,n,e).run()}function c(t=document.head){return t.querySelectorAll(n.selector("assetSelectors"))}function l(t){t.type="up-disabled-script"}return up.on("up:framework:reset",(function(){s=t.filter(s,"isDefault"),r=t.filter(r,"isDefault")})),{config:n,compiler:function(...t){o(t)},macro:function(...t){o(t,{macro:!0})},attrCompiler:function(...n){let[i,s,r]=u(n),a=`[${i}]`,{defaultValue:h}=s;o([a,s,n=>{let s=e.booleanOrStringAttr(n,i);if(!1!==s)return t.isDefined(h)&&!0===s&&(s=h),r(n,s)}])},destructor:function(n,i){let s=t.scanFunctions(i);s.length&&(n.upDestructors||=function(n){let i=t.cleaner();return i(e.addClassTemp(n,"up-can-clean")),i}(n)).guard(s)},hello:function(t,e={}){return t=up.fragment.get(t,e),up.puts("up.hello()","Compiling fragment %o",t),h(t,e),up.fragment.emitInserted(t),t},clean:function(t,e={}){new up.DestructorPass(t,e).run()},data:function(n){return n=up.fragment.get(n),n.upData||=function(n){let i=e.jsonAttr(n,"up-data")??{};return t.isOptions(i)?{...n.upTemplateData,...n.dataset,...i,...n.upCompileData}:i}(n)},findAssets:c,assertAssetsOK:function(e,n){let i=c();t.map(i,"outerHTML").join()!==t.map(e,"outerHTML").join()&&up.event.assertEmitted("up:assets:changed",{oldAssets:i,newAssets:e,renderOptions:n})},disableSubtree:function(i){let s=n.selector("scriptSelectors");t.each(e.subtree(i,s),l)},isScript:function(t){return n.matches(t,"scriptSelectors")}}}(),up.compiler=up.script.compiler,up.destructor=up.script.destructor,up.macro=up.script.macro,up.data=up.script.data,up.hello=up.script.hello,up.attribute=up.script.attrCompiler},7791:()=>{up.status=function(){const t=up.util,e=up.element;let n={};const i=new up.Config((()=>({currentClasses:["up-current"],activeClasses:["up-active"],loadingClasses:["up-loading"],navSelectors:["[up-nav]","nav"],noNavSelectors:["[up-nav=false]"]}))),s="a, [up-href]";function r(t){return t.upCurrentURLs||=new up.LinkCurrentURLs(t)}function o(t,{layer:n}={}){n||=up.layer.get(t);let o=u(n);const a=i.selector("navSelectors"),h=`${a} :is(${s}), ${a}:is(${s})`,c=up.fragment.all(h,{layer:n});for(let t of c){const n=r(t).isCurrent(o);for(let e of i.currentClasses)t.classList.toggle(e,n);e.setAttrPresence(t,"aria-current","page",n)}}function u(e){return e.feedbackLocation||t.matchableURL(e.location)}function a(t){return e.ancestor(t,s)||t}function h(t){if(t)return function(e){e.showPlaceholder(t)}}function c(e){return t.isFunction(e)?[e]:t.isString(e)?(i=e,t.map(t.parseScalarJSONPairs(i),(([t,e])=>{let i=n[t]||up.fail('Unknown preview "%s"',t);return function(n,s){return up.puts("[up-preview]","Showing preview %o",t),i(n,e||s)}}))):t.isArray(e)?e.flatMap(c):[];var i}function l(t){const e=t.feedbackLocation,n=u(t.location);e&&e===n||(t.feedbackLocation=n,o(t.element,{layer:t}))}return up.on("up:location:changed",(t=>{!function(){const t=up.layer.front;t.showsLiveHistory()&&l(t)}()})),up.on("up:fragment:compile",((t,e)=>{o(e)})),up.on("up:layer:location:changed",(t=>{l(t.layer)})),up.on("up:framework:reset",(function(){up.layer.root.feedbackLocation=null,n=t.pickBy(n,"isDefault")})),{config:i,preview:function(t,e){e.isDefault=up.framework.evaling,n[t]=e},resolvePreviewFns:c,runPreviews:function(n,s){let{bindLayer:r}=n,o=up.FocusCapsule.preserve(r),u=r.asCurrent((()=>function(n,s){let{fragment:r,fragments:o,origin:u}=n,l=t.cleaner(),p=t=>new up.Preview({fragment:t,request:n,renderOptions:s,cleaner:l}),f=p(r);f.run(c(s.preview)),f.run(h(s.placeholder)),f.run(function(e,n){if(e)return function(e){e.addClassBatch(function({origin:e,activeElements:n}){return n||=t.wrapList(e),n.map(a)}(e.renderOptions),i.activeClasses),e.addClassBatch(n,i.loadingClasses)}}(s.feedback,o)),f.run(up.form.getDisablePreviewFn(s.disable,u));for(let t of o){let n=p(t);n.run(e.matchSelectorMap(s.previewMap,t)),n.run(e.matchSelectorMap(s.placeholderMap,t).flatMap(h))}return l.clean}(n,s)));return up.on("focusin",{once:!0},(()=>o=null)),()=>{r.asCurrent(u),o?.restore(r,{preventScroll:!0})}},statusOptions:function(e,n,i){n=t.options(n);const s=new up.OptionsParser(e,n,i);return s.booleanOrString("disable"),s.boolean("feedback"),s.string("preview"),s.booleanOrString("revalidatePreview"),s.string("placeholder"),n}}}(),up.preview=up.status.preview},7924:()=>{up.util=function(){function t(){}function e(t,e){e=P(e,{host:"cross-domain"});const n=o(t);let i="";"cross-domain"===e.host&&(e.host=r(n)),e.host&&(i+=n.protocol+"//"+n.host);let{pathname:s}=n;return!1===e.trailingSlash&&"/"!==s&&(s=s.replace(/\/$/,"")),i+=s,!1!==e.search&&(i+=n.search),!1!==e.hash&&(i+=n.hash),i}function n(t,n){if(t)return e(t,{hash:!1,trailingSlash:!1,...n})}const i=location.protocol,s=location.hostname;function r(t){if(w(t)&&-1===t.indexOf("//"))return!1;const e=o(t);return s!==e.hostname||i!==e.protocol}function o(t){if(t.pathname)return t;let e=document.createElement("a");return e.href=t,e}function u(t){return w(t)?e=>e[t]:t}function a(t,e){if(0===t.length)return[];e=u(e);let n=[],i=0;for(let s of t)n.push(e(s,i++));return n}function h(t,e){let n=0;for(let i of t)e(i,n++)}function c(t){return null===t}function l(t){return void 0===t}const p=nt(l);function f(t){return l(t)||c(t)}const d=nt(f);function m(t){return!!f(t)||(_(t)&&t[m.key]?t[m.key]():w(t)||O(t)?0===t.length:!!v(t)&&0===Object.keys(t).length)}m.key="up.util.isBlank";const g=nt(m);function y(t){return"function"==typeof t}function w(t){return"string"==typeof t||t instanceof String}function b(t){return"number"==typeof t||t instanceof Number}function v(t){return"object"==typeof t&&!c(t)&&(l(t.constructor)||t.constructor===Object)}function _(t){const e=typeof t;return"object"===e&&!c(t)||"function"===e}function k(t){return t instanceof Element}function S(t){return t instanceof RegExp}function x(t){return up.browser.canJQuery()&&t instanceof jQuery}const{isArray:E}=Array;function O(t){return E(t)||function(t){return t instanceof NodeList}(t)||function(t){return"[object Arguments]"===Object.prototype.toString.call(t)}(t)||x(t)||function(t){return t instanceof HTMLCollection}(t)}function C(t){return O(t)?t:f(t)?[]:[t]}function F(t){return _(t)&&t[F.key]?t=t[F.key]():O(t)?t=T(t):v(t)&&(t=Object.assign({},t)),t}function T(t){return Array.prototype.slice.call(t)}function R(...t){return Object.assign({},...t)}function P(t,e){return e?R(e,t):t?F(t):{}}function L(t,e){e=u(e);let n=0;for(let i of t){const t=e(i,n++);if(t)return t}}function A(t,e){e=u(e);let n=!0,i=0;for(let s of t)if(!e(s,i++)){n=!1;break}return n}function $(t){return D(t,d)}function D(t,e){e=u(e);const n=[];return h(t,(function(t,i){if(e(t,i))return n.push(t)})),n}function M(t){return t[t.length-1]}function N(t,e){return(t.indexOf||Array.prototype.indexOf).call(t,e)>=0}function H(t,e){const n={};for(let i of e)i in t&&(n[i]=t[i]);return n}function j(t,e){e=u(e);const n={};for(let i in t)e(t[i],i,t)&&(n[i]=t[i]);return n}function q(t,...e){return y(t)?t(...e):t}F.key="up.util.copy",Date.prototype[F.key]=function(){return new Date(+this)};const B={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"};function U(t,e){const n=t[e];return delete t[e],n}function I(t,e){if(e(M(t)))return t.pop()}function z(t){return I(t,y)}function V(t){return I(t,v)||{}}function K(t){return t}function X(t){const e=[];for(let n of t)O(n)?e.push(...n):e.push(n);return e}function W(t,e){if(t?.valueOf&&(t=t.valueOf()),e?.valueOf&&(e=e.valueOf()),typeof t!=typeof e)return!1;if(O(t)&&O(e))return G(t,e);if(_(t)&&t[W.key])return t[W.key](e);if(v(t)&&v(e)){const n=Object.keys(t);return!!G(n,Object.keys(e))&&A(n,(n=>W(t[n],e[n])))}return t===e}function G(t,e){return t.length===e.length&&A(t,((t,n)=>W(t,e[n])))}function J(t,e){return(up.migrate.splitAtOr?.(t)||t.split(e)).map((t=>t.trim())).filter(K)}function Q(t){let{masked:e,restore:n}=ct(t);return{maskedTokens:J(e,","),restore:n}}W.key="up.util.isEqual";let Y=0;function Z(t,e,n){for(let i of e)Object.defineProperty(t,i,{get(){const t=n.call(this);let e=t[i];return y(e)&&(e=e.bind(t)),e},set(t){n.call(this)[i]=t}})}function tt(t,e="%o"){let n;if("%c"===e)return"";if("%s"===e&&d(t)&&(t=t.toString()),w(t))n=t.trim().replace(/[\n\r\t ]+/g," "),"%o"===e&&(n=JSON.stringify(n));else if(l(t))n="undefined";else if(b(t)||y(t))n=t.toString();else if(E(t))n=`[${a(t,tt).join(", ")}]`;else if(x(t))n=`$(${a(t,tt).join(", ")})`;else if(k(t)){n=`<${t.tagName.toLowerCase()}`;for(let e of["id","up-id","name","class"]){let i=t.getAttribute(e);i&&(n+=` ${e}="${i}"`)}n+=">"}else if(S(t)||t instanceof Error)n=t.toString();else try{n=JSON.stringify(t)}catch(t){if("TypeError"!==t.name)throw t;n="(circular structure)"}return n.length>200&&(n=`${n.substr(0,200)}…${M(n)}`),n}const et=/%[oOdisfc]/g;function nt(t){return function(...e){return!t(...e)}}function it(t){if(t.error)throw t.error;return t.value}function st(t,e,n){try{return{value:t.apply(e,n)}}catch(t){return{error:t}}}function rt(t,...e){let n=[];for(;e.length;){let i=e.pop();if("options"===i)n.unshift(V(t));else if("callback"===i)n.unshift(z(t));else if("val"===i)n.unshift(t.pop());else if(y(i)){let e=i(M(t))?t.pop():void 0;n.unshift(e)}}return n}function ot(...t){return t.flat().filter(y)}function ut(t,e,{keepDelimiters:n=!1}={}){let i=0,s=/§(\d+)/g,r=[],o=0;return[s,...e].forEach((e=>{let s=!1;t=t.replaceAll(e,(function(t){s=!0;let e,o,u="§"+i++;if(n){let n=t[0],i=t.slice(-1);o=t.slice(1,-1),e=n+u+i}else o=t,e=u;return r.push(o),e})),s&&o++})),{masked:t,restore:(t,e=K)=>{for(let n=0;n<o;n++)t=t.replace(s,((t,n)=>e(r[n])));return t}}}const at=/'(?:\\\\|\\'|[^'])*'|"(?:\\\\|\\"|[^"])*"/g,ht=/{(?:[^{}]|{[^{}]*})*}|\((?:[^\(\)]|\([^\(\)]*\))*\)|\[(?:[^\[\]]|\[[^\[\]]*\])*\]/g;function ct(t){return ut(t,[at,ht],{keepDelimiters:!0})}function lt(t){return'"'===t[0]?t:'"'+(t=t.slice(1,-1)).replace(/(\\\\)|(\\')|(\\")|(")/g,(function(t,e,n,i){return e||n&&"'"||'\\"'}))+'"'}function pt(t){let{masked:e,restore:n}=ut(t,[at]);return e=e.replace(/([a-z_$][\w$]*:)/gi,(t=>'"'+t.slice(0,-1)+'":')),e=e.replace(/,\s*([}\]])/g,"$1"),e=n(e,lt),JSON.parse(e)}return{parseURL:o,normalizeURL:e,matchableURL:n,matchableURLPatternAtom:function(t){return t.endsWith("/")?[t,t.slice(0,-1)]:t.includes("/?")?[t,t.replace("/?","?")]:t.endsWith("/*")?[t,t.slice(0,-2),t.slice(0,-2)+"?*"]:t},matchURLs:function(t,e,i){return n(t,i)===n(e,i)},normalizeMethod:function(t){return t?t.toUpperCase():"GET"},methodAllowsPayload:function(t){return"GET"!==t&&"HEAD"!==t},copy:F,merge:R,mergeDefined:function(...t){const e={};for(let n of t)if(n)for(let t in n){const i=n[t];p(i)&&(e[t]=i)}return e},options:P,parseArgIntoOptions:function(t,e){let[n,i]=rt(t,"val","options");return p(n)&&(i[e]=n),i},each:h,map:a,flatMap:function(t,e){return X(a(t,e))},mapObject:function(t,e){return a(t,e).reduce((function(t,e){return t[e[0]]=e[1],t}),{})},findResult:L,some:function(t,e){return!!L(t,e)},every:A,find:function(t,e){let n;e=u(e);for(let i of t)if(e(i)){n=i;break}return n},filter:D,reject:function(t,e){return D(t,e=nt(u(e)))},intersect:function(t,e){return D(t,(t=>N(e,t)))},compact:$,compactObject:function(t){return j(t,d)},uniq:function(t){return t.length<2?t:Array.from(new Set(t))},uniqBy:function(t,e){if(t.length<2)return t;e=u(e);const n=new Set;return D(t,(function(t,i){const s=e(t,i);return!n.has(s)&&(n.add(s),!0)}))},last:M,isNull:c,isDefined:p,isUndefined:l,isGiven:d,isMissing:f,isPresent:g,isBlank:m,presence:function(t,e=g){if(e(t))return t},isObject:_,isFunction:y,isString:w,isBoolean:function(t){return"boolean"==typeof t||t instanceof Boolean},isNumber:b,isElement:k,isTextNode:function(t){return t instanceof Text},isJQuery:x,isElementLike:function(t){return!(!t||!(t.addEventListener||x(t)&&t[0]?.addEventListener))},isPromise:function(t){return _(t)&&y(t.then)},isOptions:v,isArray:E,isFormData:function(t){return t instanceof FormData},isList:O,isRegExp:S,isAdjacentPosition:function(t){return/^(before|after)/.test(t)},timer:function(t,e){return setTimeout(e,t)},contains:N,containsAll:function(t,e){return A(e,(e=>N(t,e)))},objectContains:function(t,e){return W(e,H(t,Object.keys(e)))},toArray:function(t){return E(t)?t:T(t)},pick:H,pickBy:j,omit:function(t,e){return j(t,((t,n)=>!N(e,n)))},unresolvablePromise:function(){return new Promise(t)},remove:function(t,e){const n=t.indexOf(e);if(n>=0)return t.splice(n,1),e},memoize:function(t){let e,n;return function(...i){return n?e:(n=!0,e=t.apply(this,i))}},pluckKey:U,renameKey:function(t,e,n){e in t&&(t[n]=U(t,e))},extractOptions:V,extractCallback:z,noop:t,asyncNoop:function(){return Promise.resolve()},identity:K,escapeHTML:function(t){return t.replace(/[&<>"']/g,(t=>B[t]))},escapeRegExp:function(t){return t.replace(/[\\^$*+?.()|[\]{}]/g,"\\$&")},sequence:function(t){return t=$(t),(...e)=>a(t,(t=>t(...e)))},evalOption:q,evalAutoOption:function(t,e,...n){return"auto"===(t=q(t,...n))&&(t=q(e,...n)),t},flatten:X,newDeferred:function(){let t,e;const n=new Promise((function(n,i){t=n,e=i}));return n.resolve=t,n.reject=e,n},always:function(t,e=K){return t.then(e,e)},isBasicObjectProperty:function(t){return Object.prototype.hasOwnProperty(t)},isCrossOrigin:r,task:function(t){return setTimeout(t)},isEqual:W,getSimpleTokens:function(t,{json:e=!1,separator:n=/[,\s]/}={}){return w(t)?e&&/^\[.*]$/.test(t)?pt(t):J(t,n):C(t)},getComplexTokens:function(t){if(w(t)){let{maskedTokens:e,restore:n}=Q(t);return e.map((t=>n(t)))}return C(t)},wrapList:C,wrapValue:function(t,...e){return e[0]instanceof t?e[0]:new t(...e)},uid:function(){return Y++},upperCaseFirst:function(t){return t[0].toUpperCase()+t.slice(1)},lowerCaseFirst:function(t){return t[0].toLowerCase()+t.slice(1)},delegate:Z,delegatePromise:function(t,e){return Z(t,["then","catch","finally"],(function(){return this[e]}))},reverse:function(t){return F(t).reverse()},camelToKebabCase:function(t){return t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))},sprintf:function(t,...e){return t.replace(et,(t=>tt(e.shift(),t)))},withRenamedKeys:function(t,e){const n={};for(let i in t){let s=e(i);d(s)&&(n[s]=t[i])}return n},memoizeMethod:function(t,e){for(let n in e){let e=Object.getOwnPropertyDescriptor(t,n).value,i=function(...t){let i=this[`__${n}MemoizeCache`]||={},s=JSON.stringify(t);return i[s]||=st(e,this,t),it(i[s])};t[n]=i}},safeStringifyJSON:function(t){return JSON.stringify(t).replace(/[^\x00-\x7F]/g,(t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0")))},variant:function(t,e={}){let n=Object.create(t);return Object.assign(n,e),n},cleaner:function(){let t=[],e=function(e,n){e=ot(...e).map(n),t.push(...ot(...e))},n=function(...t){e(t,K)};return n.guard=function(...t){e(t,up.error.guardFn)},n.clean=function(...e){let{length:n}=t;for(let i=n-1;i>=0;i--)t[i](...e);t=[]},n},scanFunctions:ot,args:rt,parseRelaxedJSON:pt,parseScalarJSONPairs:function(t){let{maskedTokens:e,restore:n}=Q(t);return e.map((t=>{let[e,i,s]=t.match(/([^{]+)({[^}]*})?/);return[n(i.trim()),s&&pt(n(s))]}))},maskPattern:ut,expressionOutline:ct,parseString:function(t){return JSON.parse(lt(t))}}}()},4606:(t,e,n)=>{n(5074),up.viewport=function(){const t=up.util,e=up.element,n=up.fragment,i=new up.Config((()=>({viewportSelectors:["[up-viewport]","[up-fixed]"],fixedTopSelectors:["[up-fixed~=top]"],fixedBottomSelectors:["[up-fixed~=bottom]"],anchoredRightSelectors:["[up-anchored~=right]","[up-fixed~=top]","[up-fixed~=bottom]","[up-fixed~=right]"],revealSnap:200,revealPadding:0,revealTop:!1,revealMax:()=>.5*window.innerHeight,autoFocusVisible:({element:t,inputDevice:e})=>"key"===e||up.form.isField(t)}))),s=new up.BodyShifter;up.compiler(i.selectorFn("anchoredRightSelectors"),(function(t){return s.onAnchoredElementInserted(t)}));const r=up.mockable((function(e,i){return i=t.options(i),e=n.get(e,i),(i.layer=up.layer.get(e))||up.fail("Cannot reveal a detached element"),i.peel&&i.layer.peel(),new up.RevealMotion(e,i).start(),up.migrate.formerlyAsync?.("up.reveal()")||!0}));function o(e,{preventScroll:n,force:s,inputDevice:o,focusVisible:a}={}){if(s&&(e.hasAttribute("tabindex")||-1!==e.tabIndex||e.setAttribute("tabindex","-1")),o??=up.event.inputDevice,a??="auto",a=t.evalAutoOption(a,i.autoFocusVisible,{element:e,inputDevice:o}),e.focus({preventScroll:!0,focusVisible:a}),u(e),e.classList.add(a?"up-focus-visible":"up-focus-hidden"),!n)return r(e)}function u(t){t?.classList.remove("up-focus-hidden","up-focus-visible")}function a(t=location.hash,e){let n=y(t,e);if(n)return r(n,{top:!0})}function h(){return[p().tagName,...i.viewportSelectors].join()}function c(t,e={}){return n.get(t,e).closest(h())}function l(t,i={}){return t=n.get(t,i),e.around(t,h())}function p(){return document.scrollingElement}function f(){return e.root.clientWidth}function d(t){return up.fragment.tryToTarget(t)}function m(e){const[i,s]=t.args(e,"val","options");let r;return s.layer=up.layer.get(s),r=i?[c(i,s)]:s.around?l(s.around,s):function(t={}){return n.all(h(),t)}(s),[r,s]}function g(t,e){for(let n of t){const t=d(n);n.scrollTop=e[t]||0}}function y(t,i={}){if(s=t,t=s?.replace(/^#/,"")){const s=[e.attrSelector("id",t),"a"+e.attrSelector("name",t)].join();return n.get(s,i)}var s}up.on("focusin",(function({relatedTarget:t}){u(t)}));const w=["selectionStart","selectionEnd","scrollLeft","scrollTop"];return document.addEventListener("DOMContentLoaded",(function(){a(),t.task(a)})),up.on(window,"hashchange",(()=>a())),up.on("up:click",'a[href^="#"]',(function(t,e){e.hash===location.hash&&(up.link.isFollowable(e)||a(e.hash)&&up.event.halt(t))})),{reveal:r,revealHash:a,firstHashTarget:y,config:i,get:c,subtree:function(t,i={}){return t=n.get(t,i),e.subtree(t,h())},around:l,get root(){return p()},rootWidth:f,rootHeight:function(){return e.root.clientHeight},isRoot:function(t){return t===p()},rootScrollbarWidth:function(){return window.innerWidth-f()},saveScroll:function(...t){const[e,n]=m(t),i=n.location||n.layer.location;if(i){const t=function(t){let e={};for(let n of t){let t=d(n);t?e[t]=n.scrollTop:up.warn("up.viewport.saveScroll()","Cannot save scroll positions for untargetable viewport %o",n)}return e}(e);n.layer.lastScrollTops.set(i,t)}},restoreScroll:function(...t){const[e,n]=m(t),{location:i}=n.layer,s=n.layer.lastScrollTops.get(i);return!!s&&(g(e,s),up.puts("up.viewport.restoreScroll()","Restored scroll positions to %o",s),!0)},resetScroll:function(...t){const[e,n]=m(t);g(e,{})},saveFocus:function(t={}){const e=up.layer.get(t),n=t.location||e.location;if(n){const t=up.FocusCapsule.preserve(e);e.lastFocusCapsules.set(n,t)}},restoreFocus:function(t={}){const e=up.layer.get(t),n=t.location||e.location,i=t.layer.lastFocusCapsules.get(n);return!(!i||!i.restore(e)||(up.puts("up.viewport.restoreFocus()",'Restored focus to "%s"',i.target),0))},absolutize:function(n,s={}){const r=c(n).getBoundingClientRect(),o=n.getBoundingClientRect(),u=new up.Rect({left:o.left-r.left,top:o.top-r.top,width:o.width,height:o.height});s.afterMeasure?.(),e.setStyle(n,{position:"static"===n.style.position?"static":"relative",top:"auto",right:"auto",bottom:"auto",left:"auto",width:"100%",height:"100%"});const a=e.createFromSelector("up-bounds");e.insertBefore(n,a),a.appendChild(n);const h=function(t,n){return u.left+=t,u.top+=n,e.setStyle(a,u,"px")};h(0,0);const l=n.getBoundingClientRect();return h(o.left-l.left,o.top-l.top),t.each(function(t=document){const e=["[up-fixed]"].concat(i.fixedTopSelectors).concat(i.fixedBottomSelectors);return t.querySelectorAll(e.join())}(n),e.fixedToAbsolute),{bounds:a,moveBounds:h}},focus:o,tryFocus:function(t,e){return o(t,e),t===document.activeElement},newStateCache:function(){return new up.FIFOCache({capacity:30,normalizeKey:t.matchableURL})},focusedElementWithin:function(t){const e=document.activeElement;if(up.fragment.contains(t,e))return e},copyCursorProps:function(t,e={}){for(let n of w)try{e[n]=t[n]}catch(t){}return e},bodyShifter:s}}(),up.focus=up.viewport.focus,up.reveal=up.viewport.reveal},3507:()=>{window.up={version:"3.10.0-rc1"}}},e={};function n(i){var s=e[i];if(void 0!==s)return s.exports;var r=e[i]={exports:{}};return t[i](r,r.exports,n),r.exports}n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"Ru",{value:!0})},n(3507),n(8374),n(7924),n(3924),n(6535),n(2811),n(9675),n(376),n(8272),n(4366),n(8010),n(4861),n(3469),n(4504),n(2406),n(3742),n(1653),n(1104),n(5949),n(1279),n(6346),n(3030),n(7948),n(2714),n(8228),n(7050),n(9441),n(9489),n(7422),n(2200),n(278),n(9005),n(1569),n(2737),n(3635),n(1906),n(4158),n(3139),n(2214),n(5240),n(665),n(2828),n(2587),n(7031),n(8057),n(4850),n(7956),n(7403),n(6412),n(7965),n(7771),n(86),n(4552),n(5580),n(7101),n(6066),n(6387),n(3698),n(2460),n(7792),n(4308),n(8665),n(3645),n(8397),n(7782),n(2705),n(606),n(5437),n(7974),n(6413),n(5221),n(2298),n(4517),n(7241),n(2723),n(8720),n(7885),n(4818),n(9634),n(8670),n(3535),n(4453),n(1897),n(8944),n(2667),n(4606),n(4034),n(1647),n(9443),n(3849),n(2851),n(7791),n(9615),n(6774),up.framework.onEvaled()})();
1
+ (()=>{var t={1860:(t,e,n)=>{"use strict";n.r(e)},8711:(t,e,n)=>{"use strict";n.r(e)},4432:(t,e,n)=>{"use strict";n.r(e)},2065:(t,e,n)=>{"use strict";n.r(e)},35:(t,e,n)=>{"use strict";n.r(e)},5074:(t,e,n)=>{"use strict";n.r(e)},2811:()=>{up.browser={submitForm:function(t){t.submit()},canPushState:function(){return"GET"===up.protocol.initialRequestMethod()},canJQuery:function(){return!!window.jQuery},assertConfirmed:function(t){if(t.confirm&&!window.confirm(t.confirm))throw new up.Aborted("User canceled action");return!0},popCookie:function(t){let e=document.cookie.match(new RegExp(t+"=(\\w+)"))?.[1];if(e)return document.cookie=t+"=;Max-Age=0;Path=/",e}}},6346:()=>{const t=up.element,e=up.util;up.BodyShifter=class BodyShifter{constructor(){this.t=new Set,this.i=0,this.o=e.cleaner()}lowerStack(){0==--this.i&&this.o.clean()}raiseStack(){1==++this.i&&this.u()}onAnchoredElementInserted(t){return this.t.add(t),this.h(t,"right"),()=>this.t.delete(t)}l(){return this.p&&this.i>0}u(){this.p=up.viewport.rootScrollbarWidth(),this.o(t.setStyleTemp(t.root,{"--up-scrollbar-width":this.p+"px"})),this.h(document.body,"padding-right");for(let t of this.t)this.h(t,"right")}h(e,n){if(!this.l())return;let i=t.style(e,n);this.o(t.setStyleTemp(e,{["--up-original-"+n]:i}),t.addClassTemp(e,"up-scrollbar-away"))}}},7948:()=>{const t=up.util,e=up.element;up.Change.Addition=class Addition extends up.Change{constructor(t){super(t),this.m=t.acceptLayer,this.v=t.dismissLayer,this._=t.eventPlans||[],this.k=t.response}handleLayerChangeRequests(){this.layer.isOverlay()&&(this.S(),this.abortWhenLayerClosed(),this.layer.tryAcceptForLocation(this.O()),this.abortWhenLayerClosed(),this.C(),this.abortWhenLayerClosed(),this.layer.tryDismissForLocation(this.O()),this.abortWhenLayerClosed()),this.layer.asCurrent((()=>{for(let t of this._)up.emit({...t,...this.O()}),this.abortWhenLayerClosed()}))}S(){t.isDefined(this.m)&&this.layer.isOverlay()&&this.layer.accept(this.m,this.O())}C(){t.isDefined(this.v)&&this.layer.isOverlay()&&this.layer.dismiss(this.v,this.O())}abortWhenLayerClosed(t=this.layer){if(t.isClosed())throw new up.Aborted("Layer was closed")}F({oldElement:t,newElement:n,source:i}){"keep"===i&&(i=t&&up.fragment.source(t)),i&&e.setMissingAttr(n,"up-source",up.fragment.normalizeSource(i))}T({newElement:t,time:n}){e.setMissingAttr(t,"up-time",!!n&&n.toUTCString())}R({newElement:t,etag:n}){e.setMissingAttr(t,"up-etag",n||!1)}setReloadAttrs(t){this.F(t),this.T(t),this.R(t)}O(){return{response:this.k}}executeSteps(t,e,n){return new up.Change.UpdateSteps({steps:t,noneOptions:n}).execute(e)}}},3030:()=>{const t=up.util;up.Change=class Change{constructor(t){this.options=t}execute(){throw new up.NotImplemented}improveHistoryValue(e,n){return!1===e||t.isString(e)?e:n}deriveFailOptions(){return up.RenderOptions.deriveFailOptions(this.options)}}},7422:()=>{const t=up.util;up.Change.CloseLayer=class CloseLayer extends up.Change{constructor(t){super(t),this.P=t.verb,this.L=up.layer.get(t),this.A=t.origin,this.$=t.value,this.D=t.preventable??!0,this.k=t.response,this.M=t.history??!0}execute(){if(!this.L.isOpen())return Promise.resolve();if(up.browser.assertConfirmed(this.options),this.N().defaultPrevented&&this.D)throw new up.Aborted("Close event was prevented");this.H(),up.fragment.abort({reason:"Layer is closing",layer:this.L});const{parent:t}=this.L;this.L.peel(),this.L.stack.remove(this.L),this.M&&t.restoreHistory(),this.j(t),this.L.teardownHandlers(),this.L.destroyElements(this.options),this.q(t)}N(){let e=this.L.emit(this.B(`up:layer:${this.P}`),{callback:this.L.callback(`on${t.upperCaseFirst(this.P)}`),log:[`Will ${this.P} ${this.L} with value %o`,this.$]});return this.$=e.value,e}H(){let t=this.B(`up:layer:${this.P}ing`);this.L.emit(t,{log:!1})}q(e){const n=`${this.P}ed`,i=t.upperCaseFirst(n);return this.L.emit(this.B(`up:layer:${n}`),{baseLayer:e,callback:this.L.callback(`on${i}`),ensureBubbles:!0,log:[`${i} ${this.L} with value %o`,this.$]})}B(t){return up.event.build(t,{layer:this.L,value:this.$,origin:this.A,response:this.k})}j(t){this.L.overlayFocus.teardown(),t.overlayFocus?.moveToFront();let e=this.L.origin||t.element;up.focus(e,{preventScroll:!0})}}},8228:()=>{up.Change.DestroyFragment=class DestroyFragment extends up.Change{constructor(t){super(t),this.L=up.layer.get(t)||up.layer.current,this.U=this.options.element,this.I=this.options.animation,this.K=this.options.log,this.V=this.options.onFinished}execute(){this.X=this.U.parentNode,up.fragment.markAsDestroying(this.U),up.motion.willAnimate(this.U,this.I,this.options)?this.W():this.G()}async W(){this.J(),await this.Y(),this.Z(),this.V?.()}G(){this.Z(),this.J(),this.V?.()}Y(){return up.motion.animate(this.U,this.I,this.options)}Z(){this.L.asCurrent((()=>{up.fragment.abort(this.U),up.script.clean(this.U,{layer:this.L}),up.element.cleanJQuery(this.U),this.U.remove()}))}J(){up.fragment.emitDestroyed(this.U,{parent:this.X,log:this.K})}}},9005:()=>{var t;const e=up.util;up.Change.FromContent=(t=class FromContent extends up.Change{constructor(t){super(t),this.A=t.origin,this.tt=t.preflight,this.et=up.layer.getAll(t)}nt(){let t=[];return this.it(),this.st(),this.rt(t,this.et,this.options.target),this.rt(t,this.et,this.options.fallback),t}ot(t){return"new"===t||t.isOpen()}it(){this.et=e.filter(this.et,this.ot)}rt(t,e,n){for(let i of e)for(let e of this.ut(n,i)){const n={...this.options,target:e,layer:i,defaultPlacement:this.ht()},s="new"===i?new up.Change.OpenLayer(n):new up.Change.UpdateLayer(n);t.push(s)}}ut(t,e){return up.fragment.expandTargets(t,{layer:e,mode:this.options.mode,origin:this.A})}execute(){return this.options.preload?Promise.resolve():this.ct(this.lt.bind(this))||this.ft()}lt(t){let e=t.execute(this.dt(),this.gt.bind(this,t));return e.options=this.options,e}yt(t){return!(t instanceof up.CannotMatch)}gt(t){let e=this.nt()[0];t!==e&&up.puts("up.render()",'Could not match primary target "%s". Updating a fallback target "%s".',e.target,t.target);let{assets:n}=this.dt();n&&up.script.assertAssetsOK(n,t.options),this.options.handleAbort?.(null)}dt(){if(this.tt)return;const t=e.pick(this.options,["target","content","fragment","document","html","cspNonces","origin","data"]);return up.migrate.handleResponseDocOptions?.(t),"content"===this.ht()&&(t.target=this.wt(t.target)),new up.ResponseDoc(t)}st(){if(this.tt)return;let t=this.dt();this.options.fragment&&(this.options.target||=t.rootSelector()),this.options.title=this.improveHistoryValue(this.options.title,t.title),this.options.metaTags=this.improveHistoryValue(this.options.metaTags,t.metaTags),this.options.lang=this.improveHistoryValue(this.options.lang,t.lang)}ht(){if(!this.options.document&&!this.options.fragment)return"content"}wt(t){let e=this.et[0]||up.layer.root;return this.ut(t||":main",e)[0]}getPreflightProps(t={}){return this.ct((t=>t.getPreflightProps()))||t.optional||this.bt()}bt(){this.vt("Could not find target in current page")}ft(){this.vt("Could not find common target in current page and response")}vt(t){if(this.nt().length){const n=e.uniq(e.map(this.nt(),"target")),i=up.layer.optionToString(this.options.layer);throw new up.CannotMatch([t+" (tried selectors %o in %s)",n,i])}if(0!==this.et.length)throw this.options.failPrefixForced?new up.CannotMatch("No target selector given for failed responses (https://unpoly.com/failed-responses)"):new up.CannotMatch("No target selector given");this._t()}_t(){throw new up.CannotMatch("Could not find a layer to render in. You may have passed an unmatchable layer reference, or a detached element.")}ct(t){for(let e of this.nt())try{return t(e)}catch(t){if(this.yt(t))throw t}}},e.memoizeMethod(t.prototype,{nt:!0,dt:!0,getPreflightProps:!0}),t)},278:()=>{var t;const e=up.util;up.Change.FromResponse=(t=class FromResponse extends up.Change{constructor(t){super(t),this.k=t.response,this.kt=this.k.request}execute(){if(up.fragment.config.skipResponse(this.St())?this.xt():this.kt.assertEmitted("up:fragment:loaded",{...this.St(),callback:this.options.onLoaded,log:["Loaded fragment from %s",this.k.description],skip:()=>this.xt()}),e.evalOption(this.options.fail,this.k)??!this.k.ok)throw this.Et(this.deriveFailOptions());return this.Et(this.options)}xt(){up.puts("up.render()","Skipping "+this.k.description),this.options.target=":none",this.options.failTarget=":none"}Et(t){t.failPrefixForced&&up.puts("up.render()","Rendering failed response using fail-prefixed options (https://unpoly.com/failed-responses)"),this.Ot(t),t.meta=this.Ct();let e=new up.Change.FromContent(t).execute();return e.finished=this.finish(e,t),e}async finish(t,e){return t=await t.finished,up.fragment.shouldRevalidate(this.kt,this.k,e)&&(t=await this.Ft(t,e)),t}async Ft(t,e){let n=e.target,i=t.target;if(/:(before|after)/.test(n))up.warn("up.render()","Cannot revalidate cache when prepending/appending (target %s)",n);else{up.puts("up.render()",'Revalidating cached response for target "%s"',i);let n=await up.reload(i,{...e,...up.RenderOptions.NO_MOTION,...up.RenderOptions.NO_INPUT_INTERFERENCE,...up.RenderOptions.NO_PREVIEWS,preferOldElements:t.fragments,layer:t.layer,onFinished:null,expiredResponse:this.k,preview:this.Tt(e),abort:!1,cache:!1,background:!0});n.none||(t=n)}return t}Tt({preview:t,revalidatePreview:e}){return!0===e?t:e}St(){const{expiredResponse:t}=this.options;return{request:this.kt,response:this.k,renderOptions:this.options,revalidating:!!t,expiredResponse:t}}Ct(){let t={revalidating:!!this.options.expiredResponse};return up.migrate.processCompilerPassMeta?.(t,this.k),t}Ot(t){const n=this.k.url;let i=n,s=this.kt.hash;s&&(t.hash=s,i+=s),"GET"===this.k.method?t.source=this.improveHistoryValue(t.source,n):(t.source=this.improveHistoryValue(t.source,"keep"),t.history=!!t.location),t.location=this.improveHistoryValue(t.location,i),t.title=this.improveHistoryValue(t.title,this.k.title),t.eventPlans=this.k.eventPlans;let r=this.k.target;r&&(t.target=r),t.acceptLayer=this.k.acceptLayer,t.dismissLayer=this.k.dismissLayer,t.document=this.k.text,this.k.none&&(t.target=":none"),t.context=e.merge(t.context,this.k.context),t.cspNonces=this.k.cspNonces,t.time??=this.k.lastModified,t.etag??=this.k.etag}},e.memoizeMethod(t.prototype,{St:!0}),t)},2200:()=>{var t;const e=up.util;up.Change.FromURL=(t=class FromURL extends up.Change{async execute(){let t=this.Rt();if(t)return up.puts("up.render()",t),up.network.loadPage(this.options),e.unresolvablePromise();let n=this.request=up.request(this.Pt());return this.options.onRequestKnown?.(n),this.options.preload?n:(this.options.handleAbort?.(n),n.runPreviews(this.options),await e.always(n,(t=>this.Lt(t))))}Rt(){return e.isCrossOrigin(this.options.url)?"Loading cross-origin content in new page":this.options.history&&!up.browser.canPushState()?"Loading content in new page to restore history support":void 0}Pt(){const t=this.At(this.options),n=this.At(this.deriveFailOptions(),{optional:!0});return{...this.options,...t,...e.withRenamedKeys(n,up.fragment.failKey)}}getPreflightProps(){return this.Pt()}At(t,e){return new up.Change.FromContent({...t,preflight:!0}).getPreflightProps(e)}Lt(t){return t instanceof up.Response?this.$t(t):this.Dt(t)}$t(t){return new up.Change.FromResponse({...this.options,response:t}).execute()}Dt(t){throw t instanceof up.Offline&&this.request.emit("up:fragment:offline",{callback:this.options.onOffline,renderOptions:this.options,retry:t=>up.render({...this.options,...t}),log:["Cannot load fragment from %s: %s",this.request.description,t.reason]}),t}},e.memoizeMethod(t.prototype,{Pt:!0}),t)},7050:()=>{let t=up.util;up.Change.OpenLayer=class OpenLayer extends up.Change.Addition{constructor(t){super(t),this.target=t.target,this.A=t.origin,this.Mt=t.baseLayer}getPreflightProps(){return{mode:this.options.mode,context:this.Nt().context,origin:this.options.origin,target:this.target,bindLayer:this.Mt,layer:"new",bindFragments:t.compact([up.fragment.get(":main",{layer:this.Mt})]),fragments:[]}}execute(t,e){this.responseDoc=t,this.Ht(),e(),this.jt();let n=this.layer.on("up:layer:accepting up:layer:dimissing",this.qt.bind(this));try{return this.Bt(),this.qt(),up.RenderResult.both(this.Ut,this.It)}finally{n()}}Ht(){if(":none"===this.target?this.zt=document.createElement("up-none"):this.zt=this.responseDoc.select(this.target),!this.zt||this.Mt.isClosed())throw new up.CannotMatch}jt(){up.puts("up.render()",`Opening element "${this.target}" in new overlay`),this.Kt(),this.layer=this.Nt(),this.Mt.peel({history:!this.layer.history}),up.layer.stack.push(this.layer),this.layer.createElements(),this.layer.setupHandlers()}Bt(){this.Vt(),this.handleLayerChangeRequests(),this.responseDoc.commitElement(this.zt),this.layer.setContent(this.zt),this.setReloadAttrs({newElement:this.zt,source:this.options.source}),this.responseDoc.finalizeElement(this.zt),this.Ut=new up.RenderResult({layer:this.layer,fragments:[this.zt],target:this.target}),up.hello(this.layer.element,{...this.options,layer:this.layer,dataRoot:this.zt}),this.Xt(),this.Ut.finished=this.Wt(),this.layer.opening=!1,this.Gt(),this.abortWhenLayerClosed()}qt(){if(this.It)return;let t=this.Jt().other;this.It=this.executeSteps(t,this.responseDoc)}async Wt(){return await this.layer.startOpenAnimation(),this.abortWhenLayerClosed(),this.j(),this.Ut}Nt(){const t={...this.options,opening:!0};return up.layer.build(t,(t=>this.options=up.RenderOptions.finalize(t)))}Vt(){"auto"===this.layer.history&&(this.layer.history=up.fragment.hasAutoHistory([this.zt],this.layer));let{parent:t}=this.layer;this.layer.history&&=t.history,t.saveHistory(),this.layer.updateHistory(this.options)}j(){this.Mt.overlayFocus?.moveToBack(),this.layer.overlayFocus.moveToFront(),new up.FragmentFocus({fragment:this.zt,layer:this.layer,autoMeans:["autofocus","layer"],inputDevice:this.options.inputDevice}).process(this.options.focus)}Xt(){const t={...this.options,fragment:this.zt,layer:this.layer,autoMeans:["hash","layer"]};new up.FragmentScrolling(t).process(this.options.scroll)}Kt(){up.event.assertEmitted("up:layer:open",{origin:this.A,baseLayer:this.Mt,layerOptions:this.options,log:"Opening new overlay"})}Gt(){this.layer.emit("up:layer:opened",{origin:this.A,callback:this.layer.callback("onOpened"),log:`Opened new ${this.layer}`})}Jt(){return up.radio.hungrySteps(this.Qt())}Qt(){return{...this.options,layer:this.layer,history:this.layer.history}}}},9441:()=>{var t;const e=up.util;up.Change.UpdateLayer=(t=class UpdateLayer extends up.Change.Addition{constructor(t){super(t=up.RenderOptions.finalize(t)),this.layer=t.layer,this.target=t.target,this.Yt=t.context,this.Zt=up.fragment.parseTargetSteps(this.target,this.options)}getPreflightProps(){this.te();let t=this.ee();return{layer:this.layer,bindLayer:this.layer,mode:this.layer.mode,context:e.merge(this.layer.context,this.Yt),origin:this.options.origin,target:this.ne(),fragments:t,bindFragments:t}}ne(){return this.te(),up.fragment.targetForSteps(this.Zt)}ee(){return this.te(),e.map(this.Zt,"oldElement")}execute(t,e){this.responseDoc=t,this.Ht(),e();let n=this.layer.on("up:layer:accepting up:layer:dimissing",this.qt.bind(this));try{return this.ie(),this.qt(),up.RenderResult.both(this.se,this.It)}finally{n()}}ie(){this.Zt.length&&up.puts("up.render()",`Updating "${this.ne()}" in ${this.layer}`),this.re(),this.options.saveScroll&&up.viewport.saveScroll({layer:this.layer}),this.options.saveFocus&&up.viewport.saveFocus({layer:this.layer}),this.options.peel&&this.layer.peel({history:!this.oe()}),!1!==this.options.abort&&up.fragment.abort(this.ee(),{reason:"Fragment is being replaced"}),Object.assign(this.layer.context,this.Yt),this.oe()&&this.layer.updateHistory(this.options),this.handleLayerChangeRequests(),this.se=this.executeSteps(this.Zt,this.responseDoc,this.options)}qt(){if(this.It)return;let t=this.Jt().other;this.It=this.executeSteps(t,this.responseDoc)}te(){this.ue(),this.ae()}Ht(){this.ue(),this.he(),this.ae(),this.ce()}he(){this.Zt.push(...this.Jt().current)}ue(){this.Zt=this.Zt.filter((t=>{const n=new up.FragmentFinder(e.pick(t,["selector","origin","layer","match","preferOldElements"]));if(t.oldElement||=n.find(),t.oldElement)return!0;if(!t.maybe)throw new up.CannotMatch}))}ce(){this.Zt=this.responseDoc.selectSteps(this.Zt)}ae(){this.Zt=up.fragment.compressNestedSteps(this.Zt)}Jt(){return up.radio.hungrySteps(this.Qt())}re(){let t=up.FocusCapsule.preserve(this.layer);this.Zt.forEach(((e,n)=>{e.focusCapsule=t,n>0&&(e.scroll=!1,e.focus=!1)}))}oe(){return e.evalAutoOption(this.options.history,this.le.bind(this))}le(){const t=e.map(this.Zt,"oldElement");return up.fragment.hasAutoHistory(t,this.layer)}Qt(){return{...this.options,layer:this.layer,history:this.oe()}}},e.memoizeMethod(t.prototype,{te:!0,ue:!0,oe:!0,Jt:!0}),t)},9489:()=>{const t=up.util,e=up.element;up.Change.UpdateSteps=class UpdateSteps extends up.Change.Addition{constructor(e){super(e),this.pe=e.noneOptions||{},this.Zt=t.copy(e.steps)}execute(t){if(this.responseDoc=t,this.Zt=t.selectSteps(this.Zt),this.Zt=t.commitSteps(this.Zt),!this.Zt.length)return this.fe();this.renderResult=new up.RenderResult({layer:this.Zt[0]?.layer,target:up.fragment.targetForSteps(this.Zt)}),this.Zt.reverse();const e=this.Zt.map((t=>this.de(t)));return this.renderResult.finished=this.Wt(e),this.renderResult}fe(){return this.j(null,this.pe),this.Xt(null,this.pe),up.RenderResult.buildNone()}async Wt(t){await Promise.all(t);for(let t of this.Zt)this.abortWhenLayerClosed(t.layer);return this.renderResult}me(t){let e=t.matches("up-wrapper")?t.children:[t];this.renderResult.fragments.unshift(...e)}de(t){switch(this.setReloadAttrs(t),t.placement){case"swap":if(this.ge(t))return this.j(t.oldElement,t),this.Xt(t.oldElement,t),Promise.resolve();{this.ye(t);const n=t.oldElement.parentNode,i={...t,beforeStart(){up.fragment.markAsDestroying(t.oldElement)},afterInsert:()=>{this.we(t),this.responseDoc.finalizeElement(t.newElement),this.be(t),up.hello(t.newElement,t),this.me(t.newElement)},beforeDetach:()=>{up.script.clean(t.oldElement,{layer:t.layer})},afterDetach(){e.cleanJQuery(),up.fragment.emitDestroyed(t.oldElement,{parent:n,log:!1})},scrollNew:()=>{this.j(t.newElement,t),this.Xt(t.newElement,t)}};return up.morph(t.oldElement,t.newElement,t.transition,i)}case"content":{let n=e.wrapChildren(t.oldElement),i=e.wrapChildren(t.newElement),s={...t,placement:"swap",oldElement:n,newElement:i,focus:!1};return this.de(s).then((()=>{e.unwrap(i),this.j(t.oldElement,t)}))}case"before":case"after":{let n=e.wrapChildren(t.newElement),i="before"===t.placement?"afterbegin":"beforeend";return t.oldElement.insertAdjacentElement(i,n),this.responseDoc.finalizeElement(n),up.hello(n,t),this.me(n),this.j(n,t),this.Xt(n,t),up.animate(n,t.transition,t).then((()=>e.unwrap(n)))}default:up.fail("Unknown placement: %o",t.placement)}}ge(t){if(!t.keep)return;const{oldElement:n,newElement:i}=t;let s;if(!e.booleanAttr(n,"up-keep"))return;let r=up.fragment.toTarget(n);const o={layer:t.layer};if(s=t.descendantsOnly?up.fragment.get(i,r,o):e.subtreeFirst(i,r,o),s&&!1!==e.booleanAttr(s,"up-keep")){const e={oldElement:n,newElement:s,newData:up.script.data(s),renderOptions:t};if(!up.fragment.emitKeep(e).defaultPrevented)return e}}ye(t){const e=[];if(t.keep)for(let n of t.oldElement.querySelectorAll("[up-keep]")){let i=this.ge({...t,oldElement:n,descendantsOnly:!0});if(i){const t=n.cloneNode(!0);n.insertAdjacentElement("beforebegin",t),n.classList.add("up-keeping"),up.script.disableSubtree(i.newElement);let s=up.viewport.subtree(i.oldElement);i.revivers=s.map((function(t){let e=up.viewport.copyCursorProps(t);return()=>up.viewport.copyCursorProps(e,t)})),this.ve(document.body)?i.newElement.replaceWith(n):document.body.append(n),e.push(i)}}t.keepPlans=e}we(t){for(let e of t.keepPlans){e.newElement.replaceWith(e.oldElement);for(let t of e.revivers)t()}}be(t){for(let e of t.keepPlans)e.oldElement.classList.remove("up-keeping")}ve(e){return t.some(this.Zt,(t=>t.oldElement.contains(e)))}j(t,e){return new up.FragmentFocus({...e,fragment:t,autoMeans:up.fragment.config.autoFocus}).process(e.focus)}Xt(t,e){return new up.FragmentScrolling({...e,fragment:t,autoMeans:up.fragment.config.autoScroll}).process(e.scroll)}}},1569:()=>{const t=up.util;up.CompilerPass=class CompilerPass{constructor(t,e,{layer:n,data:i,dataRoot:s,dataMap:r,meta:o}){n||=up.layer.get(t)||up.layer.current,this._e=t,this.ke=e,this.L=n,this.Se=i,this.xe=s||t,this.Ee=r,o||={},o.layer=n,this.Oe=o}run(){this.L.asCurrent((()=>{this.setCompileData();for(let t of this.ke)this.Ce(t)}))}setCompileData(){if(this.Se&&(this.xe.upCompileData=this.Se),this.Ee)for(let t in this.Ee)for(let e of this.Fe(t))e.upCompileData=this.Ee[t]}Ce(t){const e=this.Te(t);if(e.length){if(t.isDefault||up.puts("up.hello()",'Compiling %d× "%s" on %s',e.length,t.selector,this.L),t.batch)this.Re(t,e);else for(let n of e)this.Pe(t,n);return up.migrate.postCompile?.(e,t)}}Pe(t,e){const n=[e];if(1!==t.length){const t=up.script.data(e);n.push(t,this.Oe)}const i=this.Le(t,e,n);up.destructor(e,i)}Re(e,n){const i=[n];if(1!==e.length){const e=t.map(n,up.script.data);i.push(e,this.Oe)}this.Le(e,n,i)&&up.fail("Compilers with { batch: true } cannot return destructors")}Le(t,e,n){return up.error.guard((()=>t.apply(e,n)))}Fe(e){return up.fragment.subtree(this._e,t.evalOption(e),{layer:this.L})}Te(e){let n=this.Fe(e.selector);return t.filter(n,(t=>{let n=t.upAppliedCompilers||=new Set;if(!n.has(e))return n.add(e),!0}))}}},3742:()=>{const t=up.util,e=up.element;up.Config=class Config{constructor(t=(()=>({}))){this.Ae=t,this.reset(),document.addEventListener("up:framework:reset",(()=>this.reset()))}reset(){Object.assign(this,this.Ae())}matches(t,e){return t.matches(this.selector(e))}selector(n){let i=this[n],s=this["no"+t.upperCaseFirst(n)];return e.unionSelector(i,s)}selectorFn(t){return()=>this.selector(t)}}},2737:()=>{const t=up.util,e=up.element;up.CSSTransition=class CSSTransition{constructor(t,e,n){this.U=t,this.$e=e,this.De=Object.keys(this.$e),this.Me=n.finishEvent,this.Ne=n.duration,this.He=n.easing,this.je=!1}start(){return 0===this.De.length?(this.je=!0,Promise.resolve()):(this.qe=t.newDeferred(),this.Be(),this.Ue=new Date,this.Ie(),this.ze(),this.Ke(),this.Ve(),this.qe)}ze(){this.Me&&(this.Xe=up.on(this.U,this.Me,this.We.bind(this)))}We(t){t.stopPropagation(),this.Wt()}Ie(){this.Ge=t.timer(this.Ne+100,(()=>this.Wt()))}Je(){clearTimeout(this.Ge)}Ke(){this.Qe=up.on(this.U,"transitionend",this.Ye.bind(this))}Ye(e){if(e.target!==this.U)return;if(new Date-this.Ue<=.25*this.Ne)return;const n=e.propertyName;t.contains(this.De,n)&&this.Wt()}Wt(){this.je||(this.je=!0,this.Je(),this.Xe?.(),this.Qe?.(),e.concludeCSSTransition(this.U),this.Ze(),this.qe.resolve())}Be(){const t=e.style(this.U,["transition-property","transition-duration","transition-delay","transition-timing-function"]);if(e.hasCSSTransition(t)){if("all"!==t["transition-property"]){const n=t["transition-property"].split(/\s*,\s*/),i=e.style(this.U,n);this.tn=e.setStyleTemp(this.U,i)}this.en=e.concludeCSSTransition(this.U)}}Ze(){this.tn?.(),this.en?.()}Ve(){e.setStyle(this.U,{"transition-property":this.De.join(),"transition-duration":`${this.Ne}ms`,"transition-timing-function":this.He}),e.setStyle(this.U,this.$e)}}},3635:()=>{const t=up.util;up.DestructorPass=class DestructorPass{constructor(t,e){this.nn=t,this.sn=e}run(){for(let e of this.rn()){let n=t.pluckKey(e,"upDestructors");n?.clean(e)}}rn(){const t={...this.sn,destroying:!0};return up.fragment.subtree(this.nn,".up-can-clean",t)}}},1906:()=>{const t=up.util,e=up.element;up.EventEmitter=class EventEmitter extends up.Record{keys(){return["target","event","baseLayer","callback","log","ensureBubbles"]}emit(){return this.un(),this.baseLayer?this.baseLayer.asCurrent((()=>this.an())):this.an(),this.event}an(){this.target.dispatchEvent(this.event),this.ensureBubbles&&!this.target.isConnected&&document.dispatchEvent(this.event),up.error.guard((()=>this.callback?.(this.event)))}assertEmitted(){const t=this.emit();if(t.defaultPrevented)throw new up.Aborted(`Event ${t.type} was prevented`)}un(){if(!up.log.config.enabled)return;let e,n=this.log;t.isArray(n)?[n,...e]=n:e=[];const{type:i}=this.event;t.isString(n)?up.puts(i,n,...e):!1!==n&&up.puts(i,`Event ${i}`)}static fromEmitArgs(n,i={}){let s,r=t.extractOptions(n);return r=t.merge(i,r),t.isElementLike(n[0])?r.target=e.get(n.shift()):n[0]instanceof up.Layer&&(r.layer=n.shift()),t.isGiven(r.layer)&&(s=up.layer.get(r.layer),r.target||=s.element,r.baseLayer||=s),r.baseLayer&&(r.baseLayer=up.layer.get(r.baseLayer)),t.isString(r.target)?r.target=up.fragment.get(r.target,{layer:r.layer}):r.target||(r.target=document),n[0]?.preventDefault?(r.event=n[0],r.log??=n[0].log):t.isString(n[0])?r.event=up.event.build(n[0],r):r.event=up.event.build(r),new this(r)}}},4158:()=>{const t=up.util;up.EventListener=class EventListener extends up.Record{keys(){return["element","eventType","selector","callback","guard","baseLayer","passive","once","capture","beforeBoot"]}constructor(t){super(t),this.hn=this.constructor.cn(t),this.isDefault=up.framework.evaling,this.beforeBoot??=0===this.eventType.indexOf("up:framework:"),this.nativeCallback=this.nativeCallback.bind(this)}bind(){const t=this.element.upEventListeners||={};t[this.hn]&&up.fail("up.on(): The %o callback %o cannot be registered more than once",this.eventType,this.callback),t[this.hn]=this,this.element.addEventListener(...this.ln())}ln(){let e=t.compactObject(t.pick(this,["once","passive","capture"]));return[this.eventType,this.nativeCallback,e]}unbind(){let t=this.element.upEventListeners;t&&delete t[this.hn],this.element.removeEventListener(...this.ln())}nativeCallback(e){if(up.framework.beforeBoot&&!this.beforeBoot)return;let n=e.target;if(this.selector&&(n=n.closest(t.evalOption(this.selector))),(!this.guard||this.guard(e))&&n){const t=[e,n],i=this.callback.length;if(1!==i&&2!==i){const e=up.script.data(n);t.push(e)}if("click"===this.eventType&&n.disabled)return;const s=this.callback.bind(n,...t);this.baseLayer?this.baseLayer.asCurrent(s):s()}}static fromElement(t){let e=t.element.upEventListeners;if(e)return e[this.cn(t)]}static cn(e){return e.callback.upUid||=t.uid(),[e.eventType,e.selector,e.callback.upUid].join("|")}static allNonDefault(e){let n=e.upEventListeners;if(n){const e=Object.values(n);return t.reject(e,"isDefault")}return[]}}},3139:()=>{const t=up.util;up.EventListenerGroup=class EventListenerGroup extends up.Record{keys(){return["elements","eventTypes","selector","callback","guard","baseLayer","passive","once","capture","beforeBoot"]}bind(){const e=t.cleaner();return this.pn((function(t){const n=new up.EventListener(t);return n.bind(),e(n.unbind.bind(n))})),e.clean}pn(t){for(let e of this.elements)for(let n of this.eventTypes)t(this.fn(e,n))}fn(t,e){return{...this.attributes(),element:t,eventType:e}}unbind(){this.pn((function(t){let e=up.EventListener.fromElement(t);e&&e.unbind()}))}static fromBindArgs(e,n){const i=(e=t.copy(e)).pop();let s;s=e[0].addEventListener?[e.shift()]:t.isJQuery(e[0])||t.isList(e[0])&&e[0][0].addEventListener?e.shift():[document];let r=t.getSimpleTokens(e.shift()),o=up.migrate.fixEventTypes;o&&(r=o(r));const u=t.extractOptions(e);return new this({elements:s,eventTypes:r,selector:e[0],callback:i,...u,...n})}}},2214:()=>{const t=up.util;up.FieldWatcher=class FieldWatcher{constructor(t,e,n){this.sn=e,this._e=t,this.dn=up.form.getScope(t),this.mn=n,this.gn=e.batch}start(){this.yn=null,this.wn=this.bn(),this.vn=null,this._n=!1,this.o=t.cleaner(),this.kn(this._e),this._e.addEventListener("up:fragment:inserted",(({target:t})=>{t!==this._e&&this.kn(t)})),this.o(up.fragment.onAborted(this.dn,(()=>this.Sn()))),this.o(up.on(this.dn,"reset",(()=>this.xn())))}stop(){this.Sn(),this.o.clean()}En(e){let n=t.copy(this.sn);return up.form.watchOptions(e,n,{defaults:{event:"input"}})}kn(t){for(let e of up.form.fields(t))this.On(e)}On(t){let e=this.En(t);this.o(up.on(t,e.event,(()=>this.Cn(e))))}Sn(){this.yn=null}Fn(e,n){this.yn=e,this.Tn=n;let i=n.delay||0;clearTimeout(this.vn),this.vn=t.timer(i,(()=>{this.vn=null,this.Rn()}))}Pn(e){return!t.isEqual(e,this.wn)&&!t.isEqual(this.yn,e)}async Rn(){if(!this.yn)return;if(this._n)return;if(this.vn)return;if(!this.dn.isConnected)return;let e=t.omit(this.Tn,["event","delay"]);const n=this.Ln(this.wn,this.yn);this.wn=this.yn,this.yn=null,this._n=!0,this.Tn=null;const i=[];if(this.gn)i.push(this.An(n,e));else for(let t in n){const s=n[t];i.push(this.An(s,t,e))}if(t.some(i,t.isPromise)){let t=Promise.allSettled(i);await t}this._n=!1,this.Rn()}An(...t){return up.error.guard(this.mn,...t)}Ln(e,n){const i={};let s=Object.keys(e);s=s.concat(Object.keys(n)),s=t.uniq(s);for(let r of s){const s=e[r],o=n[r];t.isEqual(s,o)||(i[r]=o)}return i}bn(){return up.Params.fromContainer(this._e).toObject()}Cn(t={}){const e=this.bn();this.Pn(e)&&this.Fn(e,t)}xn(){t.task((()=>this.Cn()))}}},5949:()=>{const t=up.util;up.FIFOCache=class FIFOCache{constructor({capacity:e=10,normalizeKey:n=t.identity}={}){this.$n=new Map,this.Dn=e,this.Mn=n}get(t){return t=this.Mn(t),this.$n.get(t)}set(t,e){if(this.$n.size===this.Dn){let t=this.$n.keys().next().value;this.$n.delete(t)}t=this.Mn(t),this.$n.set(t,e)}clear(){this.$n.clear()}}},665:()=>{up.FocusCapsule=class FocusCapsule{constructor(t,e,n){this.U=t,this.Nn=e,this.Hn=n}wasLost(){return document.activeElement!==this.U}restore(t,e){let n=up.fragment.get(this.Nn,{layer:t});if(n)return up.viewport.copyCursorProps(this.Hn,n),up.focus(n,e),!0}static preserve(t){let e=up.viewport.focusedElementWithin(t.element);if(!e)return;let n=up.fragment.tryToTarget(e);return n?new this(e,n,up.viewport.copyCursorProps(e)):void 0}}},5240:()=>{const t=up.util,e=up.element;up.FormValidator=class FormValidator{constructor(t){this.jn=t,this.qn=[],this.Bn=null,this.Un=!1,this.In(),this.zn()}zn(){up.fragment.onAborted(this.jn,(t=>this.Kn(t)))}Kn(t){this.qn.length&&(this.qn=[],this.Vn.reject(new up.Aborted(t.reason)),this.In())}In(){this.Vn=t.newDeferred()}watchContainer(t){let{event:e}=this.Xn(t);up.on(t,e,{guard:()=>up.fragment.isAlive(t)},(()=>up.error.muteUncriticalRejection(this.validate({origin:t}))))}validate(t={}){let e=this.Wn(t);return this.qn.push(...e),this.Gn(),this.Vn}Wn(t){let e=this.Jn(t)||this.Qn(t)||this.Yn(t.origin);for(let n of e)n.renderOptions=this.Xn(n.origin,t),n.target=up.fragment.resolveOrigin(n.target,n);return e}Qn({origin:t,...e}){if(up.form.isField(t))return this.Zn(t)||this.ti(t,e)}ti(t,{formGroup:e=!0}){if(!e)return;let n=up.form.groupSolution(t);return n?(up.puts("up.validate()","Validating form group of field %o",t),[n]):void 0}Jn({target:e,origin:n}){if(t.isString(e)){up.puts("up.validate()",'Validating target "%s"',e);let i=up.fragment.splitTarget(e);return t.compact(i.map((function(t){let e=up.fragment.get(t,{origin:n});if(e)return{element:e,target:t,origin:n};up.fail('Validation target "%s" does not match an element',t)})))}}Yn(t){return up.puts("up.validate()","Validating element %o",t),[{element:t,target:up.fragment.toTarget(t),origin:t}]}Zn(t){let n=t.closest("[up-validate]");if(n){let i=e.booleanOrStringAttr(n,"up-validate");return this.Jn({target:i,origin:t})}}Xn(t,e){return up.form.watchOptions(t,e,{defaults:{event:"change"}})}Gn(){let e=this.qn.map((t=>t.renderOptions.delay)),n=Math.min(...e)||0;clearTimeout(this.Bn),this.Bn=t.timer(n,(()=>{this.Bn=null,this.ei()}))}ei(){up.error.muteUncriticalRejection(this.ni())}async ni(){if(!this.qn.length)return;if(this.Un)return;if(this.Bn)return;let t=this.ii(this.qn);this.qn=[],this.Un=!0;let e=this.Vn;this.In();try{e.resolve(up.render(t)),await e}finally{this.Un=!1,this.ei()}}ii(e){let n=t.map(e,"origin"),i=t.flatMap(n,up.form.fields),s=t.uniq(t.map(i,"name")),r=t.map(e,"renderOptions"),o=t.mergeDefined(...r,up.form.destinationOptions(this.jn));return o.target=t.map(e,"target").join(", "),o.origin=this.jn,o.focus??="keep",o.failOptions=!1,o.defaultMaybe=!0,o.params=up.Params.merge(o.params,...t.map(r,"params")),o.headers=t.merge(o.headers,...t.map(r,"headers")),this.si(o.headers,s),o.feedback=t.some(r,"feedback"),o.data=void 0,o.dataMap=t.mapObject(e,(({target:t,element:e,renderOptions:{data:n,keepData:i}})=>[t,i?up.data(e):n])),o.preview=void 0,o.previewMap=t.mapObject(e,(({target:t,renderOptions:{preview:e}})=>[t,e])),o.placeholder=void 0,o.placeholderMap=t.mapObject(e,(({target:t,renderOptions:{placeholder:e}})=>[t,e])),o.disable=e.map((t=>up.fragment.resolveOrigin(t.renderOptions.disable,t))),o.guardEvent=up.event.build("up:form:validate",{fields:i,log:"Validating form",params:o.params,form:this.jn}),o}si(t,e){let n=up.protocol.headerize("validate"),i=e.join(" ");(!i||i.length>up.protocol.config.maxHeaderSize)&&(i=":unknown"),t[n]=i}static forElement(t){let e=up.form.get(t);return e.upFormValidator||=new this(e)}}},2587:()=>{const t=up.util,e=/^([^ >+(]+) (.+)$/;up.FragmentFinder=class FragmentFinder{constructor(t){this.sn=t,this.A=t.origin,this.ri=t.selector,this.oi=t.document||window.document,this.ui=t.match??up.fragment.config.match,this.ai=t.preferOldElements}find(){return this.hi()||this.ci()||this.li()}hi(){if(this.ai)return this.ai.find((t=>this.oi.contains(t)&&up.fragment.matches(t,this.ri)))}ci(){if("region"===this.ui&&!up.fragment.containsMainPseudo(this.ri)&&this.A?.isConnected)return this.pi()||this.fi()}pi(){return up.fragment.closest(this.A,this.ri,this.sn)}fi(){let n=up.fragment.splitTarget(this.ri);return t.findResult(n,(t=>{let n=t.match(e);if(n){let t=up.fragment.closest(this.A,n[1],this.sn);if(t)return up.fragment.getFirstDescendant(t,n[2])}}))}li(){return up.fragment.getFirstDescendant(this.oi,this.ri,this.sn)}}},7031:()=>{const t=up.util,e=up.element,n={preventScroll:!0};up.FragmentFocus=class FragmentFocus extends up.FragmentProcessor{keys(){return super.keys().concat(["hash","focusCapsule","inputDevice"])}processPrimitive(e){switch(e){case"keep":return this.di();case"restore":return this.mi();case"target":case!0:return this.gi(this.fragment);case"layer":return this.gi(this.layer.getFocusElement());case"main":return this.yi(":main");case"hash":return this.wi();case"autofocus":return this.bi();default:if(t.isString(e))return this.yi(e)}}processElement(t){return this.gi(t)}resolveCondition(t){return"lost"===t?this.vi():super.resolveCondition(t)}yi(t){let e=this.findSelector(t);return this.gi(e)}di(){if(this.vi())return this.focusCapsule?.restore(this.layer,n)}mi(){return up.viewport.restoreFocus({layer:this.layer})}bi(){let t=this.fragment&&e.subtreeFirst(this.fragment,"[autofocus]");if(t)return this.gi(t)}gi(t){if(t)return up.focus(t,{force:!0,...n,inputDevice:this.inputDevice}),!0}wi(){let t=up.viewport.firstHashTarget(this.hash,{layer:this.layer});if(t)return this.gi(t)}vi(){return this.focusCapsule?.wasLost()}}},8057:()=>{const t=up.element;up.FragmentPolling=class FragmentPolling{constructor(t){this.sn=up.radio.pollOptions(t),this.nn=t,up.destructor(t,this._i.bind(this)),up.fragment.onAborted(t,this.ki.bind(this)),this.Si="initialized",this.xi=!0,this.Ei=!1,this.Oi()}static forFragment(t){return t.upPolling||=new this(t)}onPollAttributeObserved(){this.Ci()}_i(){this.Fi()}Ci(t){if(Object.assign(this.sn,t),"started"!==this.Si){if(!up.fragment.isTargetable(this.nn))return void up.warn("[up-poll]","Cannot poll untargetable fragment %o",this.nn);this.Si="started",this.Ti(),this.Ri()}}Fi(){"started"===this.Si&&(this.Pi(),this.Si="stopped",this.unbindEvents?.())}forceStart(t){Object.assign(this.sn,t),this.forceStarted=!0,this.Ci()}forceStop(){this.Fi(),this.forceStarted=!1}Ti(){this.unbindEvents||(this.unbindEvents=up.on("visibilitychange up:layer:opened up:layer:dismissed up:layer:accepted",this.Li.bind(this)))}Li(){this.Ai()&&this.Ri()}Ai(){return!document.hidden&&("any"===this.sn.ifLayer||this.$i())}Pi(){clearTimeout(this.Di),this.Di=null}Ri(){this.Di||this.Ei||(this.Pi(),this.Di=setTimeout(this.Mi.bind(this),this.Ni()))}Mi(){this.Di=null,this.Hi()}Hi(){"started"===this.Si&&(this.Ai()?this.ji():up.puts("[up-poll]","Will not poll hidden fragment"))}qi(){return this.sn.interval??t.numberAttr(this.nn,"up-interval")??up.radio.config.pollInterval}Ni(){return Math.max(this.qi()-this.Bi(),0)}Bi(){return new Date-this.Ui}$i(){return this.layer||=up.layer.get(this.nn),this.layer?.isFront?.()}ji(){this.Pi();let t=this.xi;try{this.xi=!1,this.Ei=!0,up.reload(this.nn,this.Ii()).then(this.zi.bind(this),this.Ki.bind(this))}finally{this.xi=t}}Ii(){let t=up.event.build("up:fragment:poll",{log:["Polling fragment",this.nn]});return{...this.sn,guardEvent:t}}ki({newLayer:t}){this.xi&&!t&&this.Fi()}zi({fragment:t}){this.Ei=!1,this.Oi(),t?this.Vi(t):this.Ri()}Vi(t){this.Fi(),this.forceStarted&&up.fragment.matches(this.nn,t)&&this.constructor.forFragment(t).forceStart(this.sn)}Ki(t){this.Ei=!1,this.Oi(),this.Ri(),up.error.throwCritical(t)}Oi(){this.Ui=new Date}}},2828:()=>{const t=up.util;up.FragmentProcessor=class FragmentProcessor extends up.Record{keys(){return["fragment","autoMeans","origin","layer"]}process(t){let e=this.preprocess(t);return this.tryProcess(e)}preprocess(e){return t.getComplexTokens(e)}tryProcess(e){if(t.isArray(e))return this.processArray(e);if(t.isFunction(e)){let t=up.error.guard(e,this.fragment,this.attributes());return this.tryProcess(t)}if(t.isElement(e))return this.processElement(e);if(t.isString(e)){if("auto"===e)return this.tryProcess(this.autoMeans);let t=e.match(/^(.+?)-if-(.+?)$/);if(t)return this.resolveCondition(t[2])&&this.process(t[1])}return this.processPrimitive(e)}processArray(e){return t.find(e,(t=>this.tryProcess(t)))}resolveCondition(t){if("main"===t)return this.fragment&&up.fragment.contains(this.fragment,":main")}findSelector(t){const e={layer:this.layer,origin:this.origin};let n=this.fragment&&up.fragment.get(this.fragment,t,e)||up.fragment.get(t,e);if(n)return n;up.warn("up.render()",'Could not find an element matching "%s"',t)}}},4850:()=>{const t=up.util;up.FragmentScrolling=class FragmentScrolling extends up.FragmentProcessor{keys(){return super.keys().concat(["hash","mode","revealTop","revealMax","revealSnap","scrollBehavior"])}processPrimitive(e){switch(e){case"reset":return this.Xi();case"layer":return this.Wi();case"main":return this.Gi(":main");case"restore":return this.Ji();case"hash":return this.hash&&up.viewport.revealHash(this.hash,this.attributes());case"target":case"reveal":case!0:return this.Qi(this.fragment);default:if(t.isString(e))return this.Gi(e)}}processElement(t){return this.Qi(t)}Qi(t){if(t)return up.reveal(t,this.attributes()),!0}Gi(t){let e=this.findSelector(t);return this.Qi(e)}Wi(){return this.Qi(this.layer.getBoxElement())}Xi(){return up.viewport.resetScroll({...this.attributes(),around:this.fragment}),!0}Ji(){return up.viewport.restoreScroll({...this.attributes(),around:this.fragment})}}},7956:()=>{const t=up.element,e=up.util;up.Layer=class Layer extends up.Record{keys(){return["element","stack","history","mode","context","lastScrollTops","lastFocusCapsules"]}defaults(){return{context:{},lastScrollTops:up.viewport.newStateCache(),lastFocusCapsules:up.viewport.newStateCache()}}constructor(t={}){if(super(t),!this.mode)throw"missing { mode } option"}setupHandlers(){up.link.convertClicks(this)}teardownHandlers(){}mainTargets(){return up.layer.mainTargets(this.mode)}sync(){}accept(){throw new up.NotImplemented}dismiss(){throw new up.NotImplemented}peel(t){this.stack.peel(this,t)}evalOption(t){return e.evalOption(t,this)}isCurrent(){return this.stack.isCurrent(this)}isFront(){return this.stack.isFront(this)}isRoot(){return this.stack.isRoot(this)}isOverlay(){return this.stack.isOverlay(this)}isOpen(){return this.stack.isOpen(this)}isClosed(){return this.stack.isClosed(this)}get parent(){return this.stack.parentOf(this)}get child(){return this.stack.childOf(this)}get ancestors(){return this.stack.ancestorsOf(this)}get descendants(){return this.stack.descendantsOf(this)}get subtree(){return[this,...this.descendants]}get index(){return this.Yi??=this.stack.indexOf(this)}getContentElement(){return this.contentElement||this.element}getBoxElement(){return this.boxElement||this.element}getFocusElement(){return this.getBoxElement()}getFirstSwappableElement(){throw new up.NotImplemented}contains(t){return t.closest(up.layer.anySelector())===this.element}on(...t){return this.Zi(t).bind()}off(...t){return this.Zi(t).unbind()}Zi(t){return up.EventListenerGroup.fromBindArgs(t,{guard:t=>this.ts(t),elements:[this.element],baseLayer:this})}ts(t){return this.contains(t.target)}wasHitByMouseEvent({clientX:t,clientY:e}){const n=document.elementFromPoint(t,e);return!n||this.contains(n)}es(t){return up.EventEmitter.fromEmitArgs(t,{layer:this})}emit(...t){return this.es(t).emit()}isDetached(){return!this.element.isConnected}saveHistory(){this.history&&(this.savedTitle=document.title,this.savedMetaTags=up.history.findMetaTags(),this.savedLocation=up.history.location,this.savedLang=up.history.getLang())}restoreHistory(){this.showsLiveHistory()&&(this.savedLocation&&up.history.push(this.savedLocation),this.savedTitle&&(document.title=this.savedTitle),this.savedMetaTags&&up.history.updateMetaTags(this.savedMetaTags),e.isString(this.savedLang)&&up.history.updateLang(this.savedLang))}asCurrent(t){return this.stack.asCurrent(this,t)}updateHistory(t){e.isString(t.location)&&(this.location=t.location),up.history.config.updateMetaTags&&e.isList(t.metaTags)&&(up.migrate?.warnOfHungryMetaTags?.(t.metaTags),this.metaTags=t.metaTags),e.isString(t.title)&&(this.title=t.title),e.isString(t.lang)&&(this.lang=t.lang)}showsLiveHistory(){return this.history&&this.isFront()}get title(){return this.showsLiveHistory()?document.title:this.savedTitle}set title(t){this.savedTitle=t,this.showsLiveHistory()&&(document.title=t)}get metaTags(){return this.showsLiveHistory()?up.history.findMetaTags():this.savedMetaTags}set metaTags(t){this.savedMetaTags=t,this.showsLiveHistory()&&up.history.updateMetaTags(t)}get lang(){return this.showsLiveHistory()?up.history.getLang():this.savedLang}set lang(t){this.savedLang=t,this.showsLiveHistory()&&up.history.updateLang(t)}get location(){return this.showsLiveHistory()?up.history.location:this.savedLocation}set location(t){(this.location!==(t=e.normalizeURL(t))||this.opening)&&(this.savedLocation=t,this.showsLiveHistory()&&up.history.push(t),this.opening||this.emit("up:layer:location:changed",{location:t}))}selector(t){return this.constructor.selector(t)}static selector(t){throw new up.NotImplemented}toString(){throw new up.NotImplemented}affix(...e){return t.affix(this.getFirstSwappableElement(),...e)}[e.isEqual.key](t){return this.constructor===t.constructor&&this.element===t.element}hasFocus(){let t=document.activeElement;return t!==document.body&&this.element.contains(t)}reset(){Object.assign(this,this.defaults())}}},7101:()=>{var t;up.Layer.Cover=((t=class Cover extends up.Layer.OverlayWithViewport{}).mode="cover",t)},5580:()=>{var t;up.Layer.Drawer=((t=class Drawer extends up.Layer.OverlayWithViewport{}).mode="drawer",t)},86:()=>{var t;up.Layer.Modal=((t=class Modal extends up.Layer.OverlayWithViewport{}).mode="modal",t)},7403:()=>{var t;const e=up.element,n=up.util;up.Layer.Overlay=((t=class Overlay extends up.Layer{keys(){return[...super.keys(),...this.constructor.VISUAL_KEYS,"onOpened","onAccept","onAccepted","onDismiss","onDismissed","acceptEvent","dismissEvent","acceptLocation","dismissLocation","opening"]}constructor(t){super(t),!0===this.dismissable?this.dismissable=["button","key","outside"]:!1===this.dismissable?this.dismissable=[]:this.dismissable=n.getSimpleTokens(this.dismissable),this.acceptLocation&&(this.acceptLocation=new up.URLPattern(this.acceptLocation)),this.dismissLocation&&(this.dismissLocation=new up.URLPattern(this.dismissLocation))}callback(t){let e=this[t];if(e)return e.bind(this)}createElement(t){this.nesting||=this.ns();const e=n.compactObject(n.pick(this,["align","position","size","class","nesting"]));this.element=this.affixPart(t,null,e)}createBackdropElement(t){this.backdropElement=this.affixPart(t,"backdrop")}createViewportElement(t){this.viewportElement=this.affixPart(t,"viewport",{"up-viewport":""})}createBoxElement(t){this.boxElement=this.affixPart(t,"box")}createContentElement(t){this.contentElement=this.affixPart(t,"content")}setContent(t){this.contentElement.append(t),this.onContentSet()}onContentSet(){}createDismissElement(t){return this.dismissElement=this.affixPart(t,"dismiss",{"up-dismiss":'":button"',"aria-label":this.dismissARIALabel}),e.affix(this.dismissElement,'span[aria-hidden="true"]',{text:this.dismissLabel})}affixPart(t,n,i={}){return e.affix(t,this.selector(n),i)}static selector(t){return n.compact(["up",this.mode,t]).join("-")}ns(){const{parent:t}=this;return this.mode===t.mode?1+t.ns():0}setupHandlers(){super.setupHandlers(),this.overlayFocus=new up.OverlayFocus(this),this.ss("button")&&this.createDismissElement(this.getBoxElement()),this.ss("outside")&&(this.viewportElement?up.on(this.viewportElement,"up:click",(t=>{t.target===this.viewportElement&&this.rs(t,!0)})):this.unbindParentClicked=this.parent.on("up:click",((t,e)=>{if(!up.layer.isWithinForeignOverlay(e)){const n=this.origin&&this.origin.contains(e);this.rs(t,n)}}))),this.ss("key")&&(this.unbindEscapePressed=up.event.onEscape((t=>this.onEscapePressed(t)))),this.registerClickCloser("up-accept",((t,e)=>{this.accept(t,e)})),this.registerClickCloser("up-dismiss",((t,e)=>{this.dismiss(t,e)})),up.migrate.registerLayerCloser?.(this),this.os(this.acceptEvent,this.accept),this.os(this.dismissEvent,this.dismiss),this.on("up:click","label[for]",((t,e)=>this.us(t,e)))}us(t,n){let i=n.getAttribute("for"),s=up.form.fieldSelector(e.idSelector(i)),r=up.fragment.all(s,{layer:"any"}),o=up.fragment.all(s,{layer:this});if(r.length>1&&o[0]!==r[0]){t.preventDefault();const e=o[0];e.focus(),e.matches("input[type=checkbox], input[type=radio]")&&e.click()}}rs(t,e){up.log.putsEvent(t),e&&up.event.halt(t),up.error.muteUncriticalSync((()=>this.dismiss(":outside",{origin:t.target})))}onEscapePressed(t){if(this.isFront()){let e=up.form.focusedField();e?e.blur():this.ss("key")&&(up.event.halt(t,{log:!0}),up.error.muteUncriticalSync((()=>this.dismiss(":key"))))}}registerClickCloser(t,n){let i=`[${t}]`;this.on("up:click",i,(function(s){up.event.halt(s,{log:!0});const r=s.target.closest(i),o=e.jsonAttr(r,t),u={origin:r},a=new up.OptionsParser(r,u);a.booleanOrString("animation"),a.string("easing"),a.number("duration"),a.string("confirm"),up.error.muteUncriticalSync((()=>n(o,u)))}))}os(t,e){if(t)return this.on(t,(t=>{t.preventDefault(),up.error.muteUncriticalSync((()=>e.call(this,t,{response:t.response})))}))}tryAcceptForLocation(t){this.hs(this.acceptLocation,this.accept,t)}tryDismissForLocation(t){this.hs(this.dismissLocation,this.dismiss,t)}hs(t,e,n){let i,s;if(t&&(i=this.location)&&(s=t.recognize(i))){const t={...s,location:i};up.error.muteUncriticalSync((()=>e.call(this,t,n)))}}teardownHandlers(){super.teardownHandlers(),this.unbindParentClicked?.(),this.unbindEscapePressed?.(),this.overlayFocus.teardown()}destroyElements(t){const e={...t,animation:()=>this.startCloseAnimation(t),onFinished:()=>{this.onElementsRemoved(),t.onFinished?.()},log:!1};up.destroy(this.element,e)}onElementsRemoved(){}cs(t={}){const e=up.animate(this.getBoxElement(),t.boxAnimation,t);let n;return this.backdrop&&!up.motion.isNone(t.boxAnimation)&&(n=up.animate(this.backdropElement,t.backdropAnimation,t)),Promise.all([e,n])}async startOpenAnimation(t={}){let e=t.animation??this.evalOption(this.openAnimation);await this.cs({boxAnimation:e,backdropAnimation:"fade-in",easing:t.easing||this.openEasing,duration:t.duration||this.openDuration}),this.wasEverVisible=!0}startCloseAnimation(t={}){let e=this.wasEverVisible&&(t.animation??this.evalOption(this.closeAnimation));return this.cs({boxAnimation:e,backdropAnimation:"fade-out",easing:t.easing||this.closeEasing,duration:t.duration||this.closeDuration})}accept(t=null,e={}){return this.ls("accept",t,e)}dismiss(t=null,e={}){return this.ls("dismiss",t,e)}ss(t){return n.contains(this.dismissable,t)}ls(t,e,n){return n={...n,verb:t,value:e,layer:this},new up.Change.CloseLayer(n).execute()}getFirstSwappableElement(){return this.getContentElement().children[0]}toString(){return`${this.mode} overlay`}}).VISUAL_KEYS=["mode","position","align","size","origin","class","backdrop","dismissable","dismissLabel","dismissARIALabel","openAnimation","closeAnimation","openDuration","closeDuration","openEasing","closeEasing","trapFocus"],t)},6412:()=>{up.Layer.OverlayWithTether=class OverlayWithTether extends up.Layer.Overlay{createElements(){this.origin||up.fail("Missing { origin } option"),this.ps=new up.Tether({anchor:this.origin,align:this.align,position:this.position}),this.createElement(this.ps.parent),this.createContentElement(this.element)}onContentSet(){this.ps.start(this.element)}onElementsRemoved(){this.ps.stop()}sync(){this.isOpen()&&(this.isDetached()||this.ps.isDetached()?this.dismiss(":detached",{animation:!1,preventable:!1}):this.ps.sync())}}},7965:()=>{up.Layer.OverlayWithViewport=class OverlayWithViewport extends up.Layer.Overlay{static getParentElement(){return document.body}createElements(){up.viewport.bodyShifter.raiseStack(),this.createElement(this.constructor.getParentElement()),this.backdrop&&this.createBackdropElement(this.element),this.createViewportElement(this.element),this.createBoxElement(this.viewportElement),this.createContentElement(this.boxElement)}onElementsRemoved(){up.viewport.bodyShifter.lowerStack()}sync(){this.isDetached()&&this.isOpen()&&this.constructor.getParentElement().appendChild(this.element)}}},4552:()=>{var t;up.Layer.Popup=((t=class Popup extends up.Layer.OverlayWithTether{}).mode="popup",t)},7771:()=>{var t;const e=up.element;up.Layer.Root=((t=class Root extends up.Layer{get element(){return e.root}constructor(t){super(t),this.setupHandlers()}getFirstSwappableElement(){return document.body}static selector(){return"html"}setupHandlers(){this.element.upHandlersApplied||(this.element.upHandlersApplied=!0,super.setupHandlers())}sync(){this.setupHandlers()}accept(){this.fs()}dismiss(){this.fs()}fs(){up.fail("Cannot close the root layer")}toString(){return"root layer"}}).mode="root",t)},6066:()=>{var t;const e=up.util,n=up.element;up.LayerLookup=(t=class LayerLookup{constructor(t,n){this.i=t,!1!==n.normalizeLayerOptions&&up.layer.normalizeOptions(n),this.sn=n,this.ds=e.getSimpleTokens(n.layer)}all(){let t=e.flatMap(this.ds,(t=>this.gs(t)));return t=e.compact(t),t=e.uniq(t),t}static all(t,...n){const i=e.parseArgIntoOptions(n,"layer"),{layer:s}=i;return s instanceof up.Layer?[s]:new this(t,i).all()}ys(t){return t=n.get(t),e.find(this.i.reversed(),(e=>e.contains(t)))}ws(t){return this.i.at(t)}gs(t){if(t instanceof up.Layer)return t;if(e.isNumber(t))return this.ws(t);if(/^\d+$/.test(t))return this.ws(Number(t));if(e.isElementLike(t))return this.ys(t);switch(t){case"any":return[this.bs(),...this.i.reversed()];case"current":return this.bs();case"closest":return this.i.selfAndAncestorsOf(this.bs());case"parent":return this.bs().parent;case"ancestor":case"ancestors":return this.bs().ancestors;case"child":return this.bs().child;case"descendant":case"descendants":return this.bs().descendants;case"subtree":return this.bs().subtree;case"new":return"new";case"root":return this.i.root;case"overlay":case"overlays":return e.reverse(this.i.overlays);case"front":return this.i.front;case"origin":return this.vs();default:return up.fail("Unknown { layer } option: %o",t)}}vs(){let{origin:t,originLayer:e}=this.sn;return e||(t?this.ys(t):void 0)}bs(){let{baseLayer:t}=this.sn;if(e.isString(t)){const e={...this.sn,baseLayer:this.i.current,normalizeLayerOptions:!1,layer:t};return this.constructor.all(this.i,e)[0]}return t||this.vs()||this.i.current}},e.memoizeMethod(t.prototype,{bs:!0,vs:!0}),t)},6387:()=>{const t=up.util;up.LayerStack=class LayerStack{constructor(){this._s=[],this.layers=[this.ks()]}ks(){return up.layer.build({mode:"root",stack:this})}remove(e){t.remove(this.layers,e)}peel(e,n){const i=t.reverse(e.descendants),s={...n,preventable:!1};for(let t of i)t.dismiss(":peel",s)}reset(){this.peel(this.root,{animation:!1}),this._s=[],this.root.reset()}isOpen(e){return t.contains(this.layers,e)}isClosed(t){return!this.isOpen(t)}parentOf(t){return this.layers[t.index-1]}childOf(t){return this.layers[t.index+1]}ancestorsOf(e){return t.reverse(this.layers.slice(0,e.index))}selfAndAncestorsOf(t){return[t,...t.ancestors]}descendantsOf(t){return this.layers.slice(t.index+1)}isRoot(t){return this.root===t}isOverlay(t){return this.root!==t}isCurrent(t){return this.current===t}isFront(t){return this.front===t}get(...t){return this.getAll(...t)[0]}getAll(...t){return up.LayerLookup.all(this,...t)}sync(){for(let t of this.layers)t.sync()}asCurrent(t,e){try{return this._s.push(t),e()}finally{this._s.pop()}}reversed(){return t.reverse(this.layers)}dismissOverlays(e=null,n={}){n.dismissable=!1;for(let i of t.reverse(this.overlays))i.dismiss(e,n)}at(t){return this.layers[t]}indexOf(t){return this.layers.indexOf(t)}get count(){return this.layers.length}get root(){return this.layers[0]}get overlays(){return this.root.descendants}get current(){return t.last(this._s)||this.front}get front(){return t.last(this.layers)}}},3698:()=>{const t=up.util;up.LinkCurrentURLs=class LinkCurrentURLs{constructor(e){if(this.Ss=up.link.isSafe(e),this.Ss){const n=e.getAttribute("href");n&&"#"!==n&&(this.xs=t.matchableURL(n));const i=e.getAttribute("up-href");i&&(this.Es=t.matchableURL(i));const s=e.getAttribute("up-alias");s&&(this.Os=new up.URLPattern(s))}}isCurrent(t){return!(!t||this.xs!==t&&this.Es!==t&&!this.Os?.test?.(t,!1))}}},2460:()=>{const t=up.util,e=up.element;up.LinkFollowIntent=class LinkFollowIntent{constructor(t,e){this.Cs=t,this.mn=e,this.Fs=null,this.Ts("mouseenter mousedown touchstart",(t=>this.Rs(t))),this.Ts("mouseleave",(()=>this.Ps())),up.fragment.onAborted(this.Cs,(()=>this.Ps()))}Ts(t,e){up.on(this.Cs,t,{passive:!0},e)}Rs(e){if(up.link.shouldFollowEvent(e,this.Cs))if(this.Ps(),"mouseenter"===e.type){let n=this.Ls();this.As=t.timer(n,(()=>this.An(e)))}else this.An(e)}Ps(){clearTimeout(this.As),this.Fs?.background&&this.Fs.abort(),this.Fs=null}Ls(){return e.numberAttr(this.Cs,"up-preload-delay")??up.link.config.preloadDelay}An(t){up.log.putsEvent(t),this.mn({onRequestKnown:t=>this.Fs=t})}}},1653:()=>{let t="up.log.enabled",e=!1;try{e=!!sessionStorage?.getItem(t)}catch{}up.LogConfig=class LogConfig extends up.Config{constructor(){super((()=>({banner:!0,format:!0})))}get enabled(){return e}set enabled(n){e=n;try{sessionStorage?.setItem(t,n?"1":"")}catch{}}}},7792:()=>{const t=up.util,e=up.element;up.MotionController=class MotionController{constructor(t){this.$s=`up-${t}`,this.ri=`.${this.$s}`,this.finishEvent=`up:${t}:finish`,this.finishCount=0,this.Ds=0}startFunction(t,n,i={}){t=e.list(t);const s=()=>up.error.muteUncriticalRejection(n());if(i.trackMotion=i.trackMotion??up.motion.isEnabled(),!1===i.trackMotion)return s();{i.trackMotion=!1,this.finish(t),this.Ms(t);let e=this.Ns(t,s);return e=e.then((()=>this.Hs(t))),e}}finish(t){if(this.finishCount++,0!==this.Ds&&up.motion.isEnabled()){t=this.js(t);for(let e of t)this.qs(e);return up.migrate.formerlyAsync?.("up.motion.finish()")}}js(n){return n?t.flatMap(n,(t=>e.list(t.closest(this.ri),t.querySelectorAll(this.ri)))):document.querySelectorAll(this.ri)}isActive(t){return t.classList.contains(this.$s)}qs(t){this.Bs(t)}Bs(t,e={}){return e={target:t,log:!1,...e},up.emit(this.finishEvent,e)}Ms(t){this.Ds++,this.Us(t,!0)}Hs(t){this.Ds--,this.Us(t,!1)}Us(t,e){for(let n of t)n.classList.toggle(this.$s,e)}Ns(t,e){if(t.length<2)return e();const n=up.on(t,this.finishEvent,(e=>{if(!e.forwarded)for(let n of t)n!==e.target&&this.isActive(n)&&this.Bs(n,{forwarded:!0})}));return e().then(n)}async reset(){await this.finish(),this.finishCount=0,this.Ds=0}}},4308:()=>{const t=up.util,e=up.element;up.NonceableCallback=class NonceableCallback{constructor(t,e){this.script=t,this.nonce=e}static fromString(t){let e=t.match(/^(nonce-([^\s]+)\s)?(.*)$/);return new this(e[3],e[2])}toFunction(...t){let e=this.script;if(this.nonce){let n=this;return function(...i){return n.Is(e,this,t,i)}}return new Function(...t,e)}toString(){return`nonce-${this.nonce} ${this.script}`}Is(t,n,i,s){let r,o=`\n try {\n up.noncedEval.value = (function(${i.join()}) {\n ${t}\n }).apply(up.noncedEval.thisArg, up.noncedEval.args)\n } catch (error) {\n up.noncedEval.error = error\n }\n `;try{if(up.noncedEval={args:s,thisArg:n},r=e.affix(document.body,"script",{nonce:this.nonce,text:o}),up.noncedEval.error)throw up.noncedEval.error;return up.noncedEval.value}finally{up.noncedEval=void 0,r&&r.remove()}}zs(e){return this.nonce&&t.contains(e,this.nonce)}static adoptNonces(n,i){if(!i?.length)return;const s=t.memoize(up.protocol.cspNonce);t.each(up.script.config.nonceableAttributes,(r=>{let o=e.subtree(n,`[${r}^="nonce-"]`);t.each(o,(t=>{let e=t.getAttribute(r),n=this.fromString(e),o=(t,...n)=>up.log.warn("up.render()",`Cannot use callback [${r}="${e}"]: ${t}`,...n);if(!n.zs(i))return o("Callback's CSP nonce (%o) does not match response header (%o)",n.nonce,i);let u=s();if(!u)return o("Current page's CSP nonce is unknown");n.nonce=u,t.setAttribute(r,n.toString())}))}))}}},1104:()=>{const t=up.util,e=up.element;up.OptionsParser=class OptionsParser{constructor(t,e,n={}){this.sn=e,this.U=t,this.Ks=n,this.Vs=n.fail,this.Xs=n.closest,this.Ws=n.attrPrefix||"up-",this.Gs=n.defaults||{}}string(t,n){this.parse(e.attr,t,n)}boolean(t,n){this.parse(e.booleanAttr,t,n)}number(t,n){this.parse(e.numberAttr,t,n)}booleanOrString(t,n){this.parse(e.booleanOrStringAttr,t,n)}booleanOrNumber(t,n){this.parse(e.booleanOrNumberAttr,t,n)}json(t,n){this.parse(e.jsonAttr,t,n)}callback(t,n={}){this.parse(((t,i)=>e.callbackAttr(t,i,n)),t,n)}parse(e,n,i={}){const s=t.wrapList(i.attr??this.Js(n));let r=this.sn[n];for(let t of s)r??=this.Qs(e,this.U,t);r??=i.default??this.Gs[n];let o,u=i.normalize;if(u&&(r=u(r)),t.isDefined(r)&&(this.sn[n]=r),this.Vs&&(o=up.fragment.failKey(n))){const n=t.compact(t.map(s,(t=>this.Ys(t))));this.parse(e,o,{...i,attr:n})}}include(t){let e=t(this.U,this.sn,this.Ks);Object.assign(this.sn,e)}Qs(t,n,i){return this.Xs?e.closestAttr(n,i,t):t(n,i)}Ys(t){return this.Zs(t,this.Ws+"on-")||this.Zs(t,this.Ws)}Zs(t,e){if(t.startsWith(e))return`${e}fail-${t.substring(e.length)}`}Js(e){return`${this.Ws}${t.camelToKebabCase(e)}`}}},8665:()=>{const t=up.element,e=up.util;up.OverlayFocus=class OverlayFocus{constructor(t){this.L=t,this.gi=this.L.getFocusElement(),this.tr=this.L.trapFocus}moveToFront(){this.er||(this.er=!0,this.nr=t.setAttrsTemp(this.gi,{tabindex:"0",role:"dialog","aria-modal":this.tr.toString()}),this.tr&&(this.ir=up.on("focusin",(t=>this.sr(t))),this.rr=t.affix(this.gi,"beforebegin","up-focus-trap[tabindex=0]"),this.ur=t.affix(this.gi,"afterend","up-focus-trap[tabindex=0]")))}moveToBack(){this.teardown()}teardown(){this.er&&(this.er=!1,this.nr(),this.tr&&(this.ir(),this.rr.remove(),this.ur.remove()))}sr(t){const{target:e}=t;this.ar||up.layer.isWithinForeignOverlay(e)||(this.ar=!0,e===this.rr?this.hr():e!==this.ur&&this.L.contains(e)||this.cr(),this.ar=!1)}cr(t){up.focus(this.gi,t)}hr(){this.lr(this.L.getBoxElement())||this.cr()}lr(t){for(let n of e.reverse(t.children))if(up.viewport.tryFocus(n)||this.lr(n))return!0}}},3645:()=>{const t=up.util,e=up.element;up.Params=class Params{constructor(t){this.clear(),this.addAll(t)}clear(){this.entries=[]}[t.copy.key](){return new up.Params(this)}toObject(){const e={};for(let n of this.entries){const{name:i,value:s}=n;t.isBasicObjectProperty(i)||(this.pr(i)?(e[i]||=[],e[i].push(s)):e[i]=s)}return e}toArray(){return this.entries}toFormData(){const t=new FormData;for(let e of this.entries)t.append(e.name,e.value);return t.entries||(t.originalArray=this.entries),t}toQuery(){let e=t.map(this.entries,this.dr.bind(this));return e=t.compact(e),e.join("&")}dr(e){const{value:n}=e;if(this.mr(n))return;let i=encodeURIComponent(e.name);return t.isGiven(n)&&(i+="=",i+=encodeURIComponent(n)),i}mr(t){return t instanceof Blob}hasBinaryValues(){const e=t.map(this.entries,"value");return t.some(e,this.mr)}toURL(e){let n=[e,this.toQuery()];n=t.filter(n,t.isPresent);const i=t.contains(e,"?")?"&":"?";return n.join(i)}add(t,e){this.entries.push({name:t,value:e})}addAll(e){t.isMissing(e)||(e instanceof this.constructor?this.entries.push(...e.entries):t.isArray(e)?this.entries.push(...e):t.isString(e)?this.gr(e):t.isFormData(e)?this.yr(e):t.isObject(e)?this.wr(e):up.fail("Unsupport params type: %o",e))}wr(e){for(let n in e){const i=e[n],s=t.isArray(i)?i:[i];for(let t of s)this.add(n,t)}}gr(e){for(let n of e.split("&"))if(n){let[e,i]=n.split("=");e=decodeURIComponent(e),i=t.isGiven(i)?decodeURIComponent(i):null,this.add(e,i)}}yr(t){for(let e of t.entries())this.add(...e)}set(t,e){this.delete(t),this.add(t,e)}delete(e){this.entries=t.reject(this.entries,this.br(e))}br(t){return e=>e.name===t}get(t){return this.pr(t)?this.getAll(t):this.getFirst(t)}getFirst(e){const n=t.find(this.entries,this.br(e));return n?.value}getAll(e){if(this.pr(e))return this.getAll(e);{const n=t.map(this.entries,this.br(e));return t.map(n,"value")}}pr(t){return t.endsWith("[]")}[t.isBlank.key](){return 0===this.entries.length}static fromForm(t){return this.fromContainer(t)}static fromContainer(t){let e=up.form.fields(t);return this.fromFields(e)}static fromFields(e){const n=new this;for(let i of t.wrapList(e))n.addField(i);return n}addField(t){let n=(t=e.get(t)).name;if(n&&!t.disabled){const{tagName:e}=t,{type:i}=t;if("SELECT"===e)for(let e of t.querySelectorAll("option"))e.selected&&this.add(n,e.value);else if("checkbox"===i||"radio"===i)t.checked&&this.add(n,t.value);else{if("file"!==i)return this.add(n,t.value);for(let e of t.files)this.add(n,e)}}}[t.isEqual.key](e){return this.constructor===e.constructor&&t.isEqual(this.entries,e.entries)}static fromURL(e){const n=new this;let i=t.parseURL(e).search;return i&&(i=i.replace(/^\?/,""),n.addAll(i)),n}static stripURL(e){return t.normalizeURL(e,{search:!1})}static merge(...t){return t.reduce((function(t,e){return t.addAll(e),t}),new up.Params)}}},8397:()=>{const t=up.util,e=up.element;up.Preview=class Preview{constructor({fragment:t,request:e,renderOptions:n,cleaner:i}){this.fragment=t,this.request=e,this.renderOptions=n,this.o=i}undo(...t){this.ended?reportError(new up.Error("Preview used after end of request")):this.o.guard(...t)}get origin(){return this.request.origin}get params(){return this.request.params}get layer(){return this.request.layer}get ended(){return this.request.ended}get expiredResponse(){return this.renderOptions.expiredResponse}get revalidating(){return!!this.expiredResponse}run(t,e={}){for(let n of up.status.resolvePreviewFns(t))this.undo(up.error.guard(n,this,e))}revert(){this.o.clean()}setAttrs(...t){let[n,i]=this.vr(t,"val","val");this.undo(e.setAttrsTemp(n,i))}addClass(...t){let[n,i]=this.vr(t,"val","val");this.undo(e.addClassTemp(n,i))}addClassBatch(t,e){for(let n of t)for(let t of e)this.addClass(n,t)}removeClass(...t){let[n,i]=this.vr(t,"val","val");this.undo(e.removeClassTemp(n,i))}setStyle(...t){let[n,i]=this.vr(t,"val","val");this.undo(e.setStyleTemp(n,i))}disable(...t){let[e]=this.vr(t,"val");this.undo(up.form.disable(e))}insert(...e){let[n,i="beforeend",s]=this.vr(e,"val",t.isAdjacentPosition,"val");this.undo(up.fragment.insertTemp(n,i,s))}show(...t){let[n]=this.vr(t,"val");this.undo(e.showTemp(n))}hide(...t){let[n]=this.vr(t,"val");this.undo(e.hideTemp(n))}hideContent(...t){let[n]=this.vr(t,"val"),i=e.wrapChildren(n);e.hide(i),this.undo((()=>e.unwrap(i)))}showPlaceholder(...t){let[e,n]=this.vr(t,"val","val"),i=up.fragment.provideNodes(n,{origin:this.origin});up.puts("[up-placeholder]","Showing placeholder %o",n),e?this.swapContent(e,i):"new"===this.layer&&(this.openLayer(i,{closeAnimation:!1}),this.renderOptions.openAnimation=!1)}swapContent(...t){let[e,n]=this.vr(t,"val","val");this.hideContent(e),this.insert(e,n)}openLayer(e,n={}){let i=":undo-preview";up.layer.open({...t.pick(this.renderOptions,[...up.Layer.Overlay.VISUAL_KEYS,"target"]),...n,content:e,abort:!1,onDismiss:({value:t})=>{t!==i&&this.request.abort({reason:"Preview overlay dismissed"})}});let s=up.layer.front;return this.undo((()=>s.dismiss(i,{preventable:!1}))),s}vr(e,...n){let[i,...s]=t.args(e,...n);return i=up.fragment.get(i,{layer:this.layer,origin:this.origin})||this.fragment,[i,...s]}}},7782:()=>{const t=up.element;up.ProgressBar=class ProgressBar{constructor(){this._r=0,this.U=t.affix(document.body,"up-progress-bar"),this.U.style.transition="width 300ms ease-out",this.kr(0),t.paint(this.U),this.Sr=31,this.Er()}Er(){let t;t=this.Sr<80?Math.random()<.15?7+5*Math.random():1.5+.5*Math.random():.13*(100-this.Sr)*Math.random(),this.kr(this.Sr+t),this._r++;const e=300+40*this._r;this.timeout=setTimeout(this.Er.bind(this),e)}kr(t){this.Sr=t,this.U.style.width=`${t}vw`}destroy(){clearTimeout(this.timeout),this.U.remove()}conclude(){clearTimeout(this.timeout),this.kr(100),setTimeout(this.destroy.bind(this),300)}}},2406:()=>{const t=up.util;up.Record=class Record{keys(){throw"Return an array of keys"}defaults(t){return{}}constructor(t){Object.assign(this,this.defaults(t),this.attributes(t))}attributes(e=this){return t.pick(e,this.keys())}[t.copy.key](){return t.variant(this)}[t.isEqual.key](e){return this.constructor===e.constructor&&t.isEqual(this.attributes(),e.attributes())}}},1279:()=>{up.Rect=class Rect extends up.Record{keys(){return["left","top","width","height"]}get bottom(){return this.top+this.height}get right(){return this.left+this.width}grow(t){this.left-=t,this.top-=t,this.width+=2*t,this.height+=2*t}static fromElement(t){return new this(t.getBoundingClientRect())}}},2714:()=>{var t;const e=up.util;up.RenderJob=(t=class RenderJob{constructor(t){this.options=t}execute(){return this.Or=this.Cr(),this}async Cr(){try{this.Fr(),this.options=up.RenderOptions.preprocess(this.options),up.browser.assertConfirmed(this.options),up.RenderOptions.assertContentGiven(this.options);let t=await this.Tr().execute();return this.Rr(t),t}catch(t){throw this.Rr(t)||this.Pr(t),t}}Rr(t){if(t instanceof up.RenderResult){let{onRendered:n,onFinished:i}=t.options;t.none||up.error.guard((()=>n?.(t)));let s=function(t){up.error.guard((()=>i?.(t)))};return this.finished.then(s,e.noop),!0}}Pr(t){let e=t instanceof up.Aborted?"Rendering was aborted":"Error while rendering";up.puts("up.render()",`${e}: ${t.name}: ${t.message}`),up.error.guard((()=>this.options.onError?.(t)))}get finished(){return this.Lr()}async Lr(){try{let t=await this.Or;return await t.finished}catch(t){throw t instanceof up.RenderResult?await t.finished:t}}Tr(){let t=e.memoize((t=>this.Ar(t))),n={...this.options,handleAbort:t};return n.url?new up.Change.FromURL(n):n.response?new up.Change.FromResponse(n):new up.Change.FromContent(n)}Fr(){let t=e.pluckKey(this.options,"guardEvent");if(t&&(t.renderOptions=this.options,up.emit(t,{target:this.options.origin}).defaultPrevented))throw new up.Aborted(`Rendering was prevented by ${t.type} listener`)}Ar(t){let{abort:n}=this.options;if(!n||!up.network.isBusy())return;let{bindFragments:i,bindLayer:s,origin:r,layer:o}=this.Tr().getPreflightProps(),u={except:t,logOnce:["up.render()","Change with { abort } option will abort other requests"],newLayer:"new"===o,origin:r};"target"===n?up.fragment.abort(i,{...u}):"layer"===n?up.fragment.abort({...u,layer:s}):"all"===n||!0===n?up.fragment.abort({...u,layer:"any"}):e.isFunction(n)?n(u):up.fragment.abort(n,{...u,layer:s})}},e.delegatePromise(t.prototype,"_rendered"),e.memoizeMethod(t.prototype,{Lr:!0,Tr:!0}),t)},2705:()=>{const t=up.util;up.RenderOptions=function(){const e=["url","method","origin","headers","params","cache","fallback","abort","abortable","confirm","feedback","disable","placeholder","preview","origin","originLayer","baseLayer","navigate","fail","onError"].concat(["keep","hungry","history","source","saveScroll"]),n=["url","response","content","fragment","document"],i=["history","focus","scroll"];return{preprocess:function(e){up.migrate.preprocessRenderOptions?.(e),up.layer.normalizeOptions(e),function(e){t.renameKey(e,"useData","data"),t.renameKey(e,"useHungry","hungry"),t.renameKey(e,"useKeep","keep")}(e);const n=t.merge(up.fragment.config.renderOptions,function(t){if(t.navigate)return up.fragment.config.navigateOptions}(e));return t.merge(t.omit(n,i),{defaults:n},{inputDevice:up.event.inputDevice},e,function({url:e}){if(e)return{url:t.normalizeURL(e)}}(e),function({origin:t,originLayer:e}){if(t&&!e)return{originLayer:up.layer.get(t)}}(e))},finalize:function(e,n){return t.merge(e.defaults,n,e)},assertContentGiven:function(e){t.some(n,(n=>t.isGiven(e[n])))||(e.defaultToEmptyContent?e.content="":up.fail("up.render() needs either { "+n.join(", ")+" } option"))},deriveFailOptions:function(n){let i=function(t){const e={};for(let n in t){const i=t[n];let s=up.fragment.successKey(n);s&&(e[s]=i)}return e}(n);return n.failOptions?{...n.defaults,...t.pick(n,e),...i,failPrefixForced:!0}:{...n,...i}},NO_PREVIEWS:{preview:!1,disable:!1,placeholder:!1,feedback:!1},NO_MOTION:{transition:!1,animation:!1,openAnimation:!1,closeAnimation:!1},NO_INPUT_INTERFERENCE:{scroll:!1,focus:"keep",confirm:!1}}}()},606:()=>{up.RenderResult=class RenderResult extends up.Record{keys(){return["fragments","layer","target","options","finished"]}defaults(){return{fragments:[]}}get none(){return!this.fragments.length}get fragment(){return this.fragments[0]}static both(t,e,n=!0){return e?new this({target:t.target,layer:t.layer,options:t.options,fragments:t.fragments.concat(e.fragments),finished:n&&this.mergeFinished(t,e)}):t}static async mergeFinished(t,e){return this.both(await t.finished,await e.finished,!1)}static buildNone(){return new this({target:":none",finished:Promise.resolve()})}}},5437:()=>{var t;const e=up.util;up.Request=(t=class Request extends up.Record{keys(){return["method","url","hash","params","target","failTarget","headers","timeout","background","cache","expireCache","evictCache","layer","mode","context","failLayer","failMode","failContext","origin","builtAt","wrapMethod","contentType","payload","onLoading","fail","abortable","lateDelay","previews"]}defaults(){return{state:"new",abortable:!0,headers:{},timeout:up.network.config.timeout,builtAt:new Date,previews:[]}}constructor(t){if(super(t),this.params=new up.Params(this.params),null==this.wrapMethod&&(this.wrapMethod=up.network.config.wrapMethod),this.$r(),(this.target||this.layer||this.origin)&&!t.basic){const t={origin:this.origin};this.layer=up.layer.get(this.layer,t),this.failLayer=up.layer.get(this.failLayer,t),this.context||=this.layer.context||{},this.failContext||=this.failLayer?.context||{},this.mode||=this.layer.mode,this.failMode||=this.failLayer?.mode}this.bindLayer=t.bindLayer||this.layer,this.Dr=t.fragments,this.Mr=t.bindFragments,this.qe=e.newDeferred(),this.Nr()}get effectiveLateTime(){return!this.background&&(this.lateDelay??e.evalOption(up.network.config.lateDelay,this))}isTimed(){return e.isNumber(this.effectiveLateTime)}get xhr(){return this.Hr??=new XMLHttpRequest}get fragments(){return this.Dr||=this.jr()}jr(){let t=up.fragment.parseTargetSteps(this.target),n={origin:this.origin,layer:this.layer},i=e.map(t,(t=>up.fragment.get(t.selector,n)));return e.compact(i)}get bindFragments(){return this.Mr||this.fragments}get fragment(){return this.fragments?.[0]}$r(){this.method=e.normalizeMethod(this.method),this.qr(),this.Br(),this.url=e.normalizeURL(this.url)}Ur(){e.task((()=>{this.layer=void 0,this.failLayer=void 0,this.Ir=void 0,this.origin=void 0,this.Dr=void 0,this.Mr=void 0}))}qr(){let t=this.url?.match(/^([^#]*)(#.+)$/);if(t)return this.url=t[1],this.hash=t[2]}Br(){!this.url||this.allowsPayload()||e.isBlank(this.params)||(this.url=this.params.toURL(this.url),this.params.clear())}isSafe(){return up.network.isSafeMethod(this.method)}allowsPayload(){return e.methodAllowsPayload(this.method)}will302RedirectWithGET(){return this.isSafe()||"POST"===this.method}willCache(){return e.evalAutoOption(this.cache,up.network.config.autoCache,this)}runQueuedCallbacks(){e.always(this,(()=>this.Ur()))}load(){if("new"===this.state)return this.zr()?(this.state="loading",this.$r(),this.onLoading?.(),this.expired=!1,new up.Request.XHRRenderer(this).buildAndSend({onload:()=>this.Kr(),onerror:()=>this.Vr(),ontimeout:()=>this.Xr(),onabort:()=>this.Wr()}),!0):void this.abort({reason:"Prevented by event listener"})}runPreviews(t){this.ended||this.fromCache||(this.Gr=up.status.runPreviews(this,t))}zr(){return!this.emit("up:request:load",{log:["Loading %s",this.description]}).defaultPrevented}loadPage(){up.network.abort(),new up.Request.FormRenderer(this).buildAndSubmit()}Kr(){const t=this.Jr(),e="Loaded "+t.description;this.emit("up:request:loaded",{request:t.request,response:t,log:e}),this.respondWith(t)}Vr(){this.Qr("Network error")}Xr(){this.Qr("Timeout")}Wr(){this.Yr()}abort({reason:t}={}){this.Yr(t)&&this.Hr&&this.Hr.abort()}Yr(t){if(this.ended)return;let e="Aborted request to "+this.description+(t?": "+t:"");return this.state="aborted",this.Zr(new up.Aborted(e)),this.emit("up:request:aborted",{log:e}),!0}Qr(t){if(this.ended)return;let e="Cannot load request to "+this.description+(t?": "+t:"");this.state="offline",this.emit("up:request:offline",{log:e}),this.Zr(new up.Offline(e))}respondWith(t){this.response=t,this.ended||(this.state="loaded",t.ok?this.eo(t):this.Zr(t))}eo(t){this.no(),this.qe.resolve(t)}Zr(t){this.no(),this.qe.reject(t)}no(){this.Gr?.()}get ended(){return"new"!==this.state&&"loading"!==this.state&&"tracking"!==this.state}csrfHeader(){return up.protocol.csrfHeader()}csrfParam(){return up.protocol.csrfParam()}csrfToken(){if(!this.isSafe()&&!this.isCrossOrigin())return up.protocol.csrfToken()}isCrossOrigin(){return e.isCrossOrigin(this.url)}Jr(){const t={method:this.method,url:this.url,request:this,xhr:this.xhr,text:this.xhr.responseText,status:this.xhr.status,title:up.protocol.titleFromXHR(this.xhr),target:up.protocol.targetFromXHR(this.xhr),acceptLayer:up.protocol.acceptLayerFromXHR(this.xhr),dismissLayer:up.protocol.dismissLayerFromXHR(this.xhr),eventPlans:up.protocol.eventPlansFromXHR(this.xhr),context:up.protocol.contextFromXHR(this.xhr),expireCache:up.protocol.expireCacheFromXHR(this.xhr),evictCache:up.protocol.evictCacheFromXHR(this.xhr),fail:this.fail};let n=up.protocol.methodFromXHR(this.xhr),i=up.protocol.locationFromXHR(this.xhr);return i&&(e.matchURLs(this.url,i)||(n||="GET"),t.url=i),n&&(t.method=n),new up.Response(t)}es(t){return up.EventEmitter.fromEmitArgs(t,{layer:this.bindLayer,request:this,origin:this.origin})}emit(...t){return this.es(t).emit()}assertEmitted(...t){this.es(t).assertEmitted()}get description(){return this.method+" "+this.url}isBoundToSubtrees(t){return t=e.wrapList(t),e.some(this.bindFragments,(function(n){return e.some(t,(t=>t.contains(n)))}))}isBoundToLayers(t){return e.contains(t,this.bindLayer)}get age(){return new Date-this.builtAt}header(t){return this.headers[t]}Nr(){for(let t of["target","failTarget","mode","failMode","context","failContext"])this.io(t);let t,e;(t=this.csrfHeader())&&(e=this.csrfToken())&&this.so(t,e),this.so(up.protocol.headerize("version"),up.version)}io(t){this.so(up.protocol.headerize(t),this[t])}so(t,n){e.isMissing(n)||((e.isOptions(n)||e.isArray(n))&&(n=e.safeStringifyJSON(n)),this.headers[t]=n)}mergeIfUnsent(t){if("new"!==this.state)return;if(!this.target||!t.target)return;let n=up.fragment.splitTarget(this.target+","+t.target);this.target=e.uniq(n).join(", "),this.io("target"),this.Dr=e.uniq([...this.fragments,...t.fragments])}static tester(t,{except:n}={}){let i;if(e.isFunction(t))i=t;else if(t instanceof this)i=e=>t===e;else if(e.isString(t)){let e=new up.URLPattern(t);i=t=>e.test(t.url)}else i=e=>t;return n?t=>!up.cache.willHaveSameResponse(t,n)&&i(t):i}},e.delegatePromise(t.prototype,"_deferred"),t)},7974:()=>{const t=up.util;class Route{constructor(){this.varyHeaders=new Set,this.requests=[]}matchBest(e){let n=this.requests.filter((t=>this.satisfies(t,e)));return t.last(n)}delete(e){t.remove(this.requests,e)}put(t){this.requests.push(t)}updateVary(t){for(let e of t.varyHeaderNames)this.varyHeaders.add(e)}satisfies(e,n){return e===n||t.every(this.varyHeaders,(i=>{let s=e.header(i),r=n.header(i);if("X-Up-Target"===i||"X-Up-Fail-Target"===i){if(!s)return!0;if(!r)return!1;let e=up.fragment.splitTarget(s),n=up.fragment.splitTarget(r);return t.containsAll(e,n)}return s===r}))}}up.Request.Cache=class Cache{constructor(){this.reset()}reset(){this.ro={},this.oo=[]}get(t){t=this.uo(t);let e=this.ao(t),n=e.matchBest(t);if(n){if(this.ho(n))return n;this.co(t,e)}}async put(t){t=this.uo(t);let e=this.ao(t),{response:n}=t;n&&e.updateVary(n);let i=e.requests.filter((n=>e.satisfies(t,n)));for(let t of i)this.co(t);t.cacheRoute=e,e.put(t),this.oo.push(t),this.lo()}alias(t,e){if(t=this.get(t))return e=this.uo(e),this.track(t,e,{force:!0}),this.put(e),e}async track(e,n,i={}){let s;n.trackedRequest=e,n.state="tracking",s=e.ended&&e.response?e.response:await t.always(e),s instanceof up.Response?i.force||e.cacheRoute.satisfies(e,n)?(n.fromCache=!0,s=t.variant(s,{request:n}),n.respondWith(s),t.delegate(n,["expired","state"],(()=>e))):(delete n.trackedRequest,n.state="new",i.onIncompatible?.(n)):(n.state=e.state,n.Zr(s))}willHaveSameResponse(t,e){return t===e||t===e.trackedRequest}evict(t=!0,e){this.po(t,e,(t=>this.co(t)))}expire(t=!0,e){this.po(t,e,(t=>t.expired=!0))}reindex(t){this.co(t),delete t.cacheRoute,this.put(t)}co(e){t.remove(this.oo,e),e.cacheRoute?.delete(e)}ao(t){return t.cacheRoute||(this.ro[t.description]||=new Route)}ho(t){return t.age<up.network.config.cacheEvictAge}get fo(){return this.oo.length}get Dn(){return up.network.config.cacheSize}lo(){for(let t=0;t<this.fo-this.Dn;t++)this.co(this.oo[0])}po(e=!0,n,i){let s=up.Request.tester(e,n),r=t.filter(this.oo,s);t.each(r,i)}uo(e){return t.wrapValue(up.Request,e)}}},5221:()=>{const t=up.util,e=up.element,n=["GET","POST"];up.Request.FormRenderer=class FormRenderer{constructor(t){this.kt=t}buildAndSubmit(){this.params=t.copy(this.kt.params);let i=this.kt.url,{method:s}=this.kt;const r=up.Params.fromURL(i);this.params.addAll(r),i=up.Params.stripURL(i),t.contains(n,s)||(s=up.protocol.wrapMethod(s,this.params)),this.jn=e.affix(document.body,"form.up-request-loader",{method:s,action:i});let o,u,a=this.kt.contentType;a&&this.jn.setAttribute("enctype",a),(o=this.kt.csrfParam())&&(u=this.kt.csrfToken())&&this.params.add(o,u),t.each(this.params.toArray(),this.do.bind(this)),up.browser.submitForm(this.jn)}do(t){e.affix(this.jn,"input[type=hidden]",t)}}},6413:()=>{const t=up.util;up.Request.Queue=class Queue{constructor(){this.reset()}reset(){this.mo=[],this.yo=[],this.wo=!1}get allRequests(){return this.yo.concat(this.mo)}asap(e){e.runQueuedCallbacks(),t.always(e,(t=>this.Lt(e,t))),this.bo(e),this.vo(e),queueMicrotask((()=>this._o()))}promoteToForeground(t){t.background&&(t.background=!1,this.bo(t))}bo(e){if(!e.isTimed())return;let n=Math.max(e.effectiveLateTime-e.age);t.timer(n,(()=>this.ko()))}So(){return t.evalOption(up.network.config.concurrency)}xo(){const t=this.So();return-1===t||this.yo.length<t}isBusy(){return this.yo.length>0||this.mo.length>0}vo(t){this.mo.push(t)}Eo(){let e=t.find(this.mo,(t=>!t.background));return e||=this.mo[0],t.remove(this.mo,e)}Oo(t){t.load()&&this.yo.push(t)}Lt(e,n){t.remove(this.yo,e)||t.remove(this.mo,e),n instanceof up.Response&&n.ok&&up.network.registerAliasForRedirect(e,n),queueMicrotask((()=>this._o())),t.task((()=>this.Co()))}_o(){let t;if(this.xo()&&(t=this.Eo()))return this.Oo(t)}abort(...e){let[n=!0,{except:i,reason:s,logOnce:r}]=t.args(e,"val","options"),o=up.Request.tester(n,{except:i});for(let e of[this.yo,this.mo]){const n=t.filter(e,o);for(let i of n)r&&(up.puts(...r),r=null),i.abort({reason:s}),t.remove(e,i)}}ko(){!this.wo&&this.Fo()&&(this.wo=!0,up.emit("up:network:late",{log:"Server is slow to respond"}))}Co(){this.wo&&!this.To.length&&(this.wo=!1,up.emit("up:network:recover",{log:"Slow requests were loaded"}))}get To(){return this.allRequests.filter((t=>t.isTimed()))}Fo(){return t.some(this.To,(t=>t.age>=t.effectiveLateTime-1))}}},2298:()=>{var t;const e="multipart/form-data",n=up.util;up.Request.XHRRenderer=(t=class XHRRenderer{constructor(t){this.kt=t}buildAndSend(t){const e=this.kt.xhr;this.Ro=n.copy(this.kt.params),this.kt.timeout&&(e.timeout=this.kt.timeout),e.open(this.Po(),this.kt.url);let i=this.Lo();i&&e.setRequestHeader("Content-Type",i);for(let t in this.kt.headers){let n=this.kt.headers[t];e.setRequestHeader(t,n)}Object.assign(e,t),e.send(this.Ao())}Po(){let t=this.kt.method;return this.kt.wrapMethod&&!this.kt.will302RedirectWithGET()&&(t=up.protocol.wrapMethod(t,this.Ro)),t}Lo(){return this.$o(),this.Do}Ao(){return this.$o(),this.Mo}$o(){this.Mo=this.kt.payload,this.Do=this.kt.contentType,!this.Mo&&this.kt.allowsPayload()&&(this.Do||(this.Do=this.Ro.hasBinaryValues()?e:"application/x-www-form-urlencoded"),this.Do===e?(this.Do=null,this.Mo=this.Ro.toFormData()):this.Mo=this.Ro.toQuery().replace(/%20/g,"+"))}},n.memoizeMethod(t.prototype,{$o:!0,Po:!0}),t)},4517:()=>{const t=up.util;up.Response=class Response extends up.Record{keys(){return["method","url","text","status","request","xhr","target","title","acceptLayer","dismissLayer","eventPlans","context","expireCache","evictCache","headers","loadedAt","fail"]}defaults(){return{headers:{},loadedAt:new Date}}get ok(){return!t.evalOption(this.fail??up.network.config.fail,this)}get none(){return!this.text}header(t){return this.headers[t]||this.xhr?.getResponseHeader(t)}get varyHeaderNames(){let e=this.header("Vary");return t.getSimpleTokens(e,{separator:","})}get contentType(){return this.header("Content-Type")}get cspNonces(){return up.protocol.cspNoncesFromHeader(this.header("Content-Security-Policy")||this.header("Content-Security-Policy-Report-Only"))}get lastModified(){let t=this.header("Last-Modified");if(t)return new Date(t)}get etag(){return this.header("ETag")}get json(){return this.parsedJSON||=JSON.parse(this.text)}get age(){return new Date-this.loadedAt}get expired(){return this.age>up.network.config.cacheExpireAge||this.request.expired}get description(){return`HTTP ${this.status} response to ${this.request.description}`}}},7241:()=>{var t;const e=up.util,n=up.element,i=/^\s*<(html|!DOCTYPE)\b/i;up.ResponseDoc=(t=class ResponseDoc{constructor({document:t,fragment:e,content:n,target:i,origin:s,data:r,cspNonces:o,match:u}){if(t?this.No(t,s,r):e?this.Ho(e,s,r):this.jo(n||"",s,i,r),this.qo=o,s){let t=up.fragment.tryToTarget(s);t&&(this.Bo=this.select(t))}this.ui=u}No(t,s,r){if(t instanceof Document)this.oi=t,this.Uo=!0;else if(e.isString(t)){this.Uo=i.test(t);let e=t=>[n.createBrokenDocumentFromHTML(t)],o=up.fragment.provideNodes(t,{origin:s,data:r,htmlParser:e});o[0]instanceof Document?this.oi=o[0]:this.oi=this.Io(o)}else this.oi=this.Io(t)}zo(t){return n.createBrokenDocumentFromHTML(t)}Ho(t,e,i){let s=n.extractSingular(up.fragment.provideNodes(t,{origin:e,data:i}));this.oi=this.Io(s)}jo(t,i,s,r){s||up.fail("must pass a { target } when passing { content }");let o=e.map(up.fragment.parseTargetSteps(s),"selector").join(),u=up.fragment.provideNodes(t,{origin:i,data:r}),a=n.createFromSelector(o,{content:u});this.oi=this.Io(a)}Io(t){t=e.wrapList(t);let n=document.createElement("up-document");return n.append(...t),n}rootSelector(){return up.fragment.toTarget(this.oi.children[0])}get title(){return this.Ko(this.Vo)}Xo(){if(this.Uo)return this.oi.head}Ko(t){let e=this.Xo();return e&&t(e)}get metaTags(){return this.Ko(up.history.findMetaTags)}get assets(){return this.Ko(up.script.findAssets)}get lang(){if(this.Uo)return up.history.getLang(this.oi)}Vo(t){return t.querySelector("title")?.textContent}select(t){return new up.FragmentFinder({selector:t,origin:this.Bo,document:this.oi,match:this.ui}).find()}selectSteps(t){return t.filter((t=>this.Wo(t)||this.Go(t)))}commitSteps(t){return t.filter((t=>this.commitElement(t.newElement)))}Wo(t){if(t.newElement)return!0;let e=this.select(t.selector);if(!e)return;let{selectEvent:n}=t;return n&&(n.newFragment=e,n.renderOptions=t.originalRenderOptions,up.emit(t.oldElement,n,{callback:t.selectCallback}),n.defaultPrevented)?void 0:(t.newElement=e,!0)}Go(t){if(!t.maybe)throw new up.CannotMatch}commitElement(t){if(this.oi.contains(t))return up.fragment.config.runScripts||up.script.disableSubtree(t),t.remove(),!0}finalizeElement(t){if(up.NonceableCallback.adoptNonces(t,this.qo),this.oi instanceof Document){let i=n.subtree(t,":is(noscript,script,audio,video):not(.up-keeping, .up-keeping *)");e.each(i,n.fixParserDamage)}}},e.memoizeMethod(t.prototype,{Xo:!0}),t)},2723:()=>{const t=up.element,e=up.util;up.RevealMotion=class RevealMotion{constructor(e,n={}){this.U=e,this.Jo=t.get(n.viewport)||up.viewport.get(this.U),this.Qo=up.layer.get(this.Jo),this.Yo=n.scrollBehavior??n.behavior??"instant";const i=up.viewport.config;this.Zo=n.snap??n.revealSnap??i.revealSnap,this.tu=n.padding??n.revealPadding??i.revealPadding,this.eu=n.top??n.revealTop??i.revealTop,this.nu=n.max??n.revealMax??i.revealMax,this.iu=i.selector("fixedTopSelectors"),this.su=i.selector("fixedBottomSelectors")}start(){const t=this.ru(this.Jo),n=up.Rect.fromElement(this.U);if(this.nu){const t=e.evalOption(this.nu,this.U);n.height=Math.min(n.height,t)}n.grow(this.tu),this.ou(t),t.height<0&&up.fail("Viewport has no visible area");const i=this.Jo.scrollTop;let s=i;this.eu||n.height>t.height?s+=n.top-t.top:n.top<t.top?s-=t.top-n.top:n.bottom>t.bottom&&(s+=n.bottom-t.bottom),e.isNumber(this.Zo)&&s<this.Zo&&n.top<.5*t.height&&(s=0),s!==i&&this.Jo.scrollTo({top:s,behavior:this.Yo})}ru(){return up.viewport.isRoot(this.Jo)?new up.Rect({left:0,top:0,width:up.viewport.rootWidth(),height:up.viewport.rootHeight()}):up.Rect.fromElement(this.Jo)}uu(n){let i=up.fragment.all(n,{layer:this.Qo});return e.filter(i,t.isVisible)}ou(t){for(let e of this.uu(this.iu)){let n=up.Rect.fromElement(e).bottom-t.top;n>0&&(t.top+=n,t.height-=n)}for(let e of this.uu(this.su)){let n=up.Rect.fromElement(e),i=t.bottom-n.top;i>0&&(t.height-=i)}}}},8720:()=>{const t=up.util,e=up.element;up.Selector=class Selector{constructor(e,n,i={}){this.au=[];let s,r=n&&!document.contains(n);if(r||i.destroying||this.au.push(up.fragment.isNotDestroying),this.hu=r||"any"===i.layer||1===up.layer.count,this.hu)s=up.layer.root;else{if(i.layer??=t.presence(n,t.isElement),this.et=up.layer.getAll(i),!this.et.length)throw new up.CannotMatch(["Unknown layer: %o",i.layer]);this.au.push((e=>t.some(this.et,(t=>t.contains(e))))),s=this.et[0]}this.cu=up.fragment.expandTargets(e,{...i,layer:s}),this.lu=this.cu.join()||"match-none"}matches(t){return e.elementLikeMatches(t,this.lu)&&this.pu(t)}closest(t){return this.fu(t.closest(this.lu))}descendants(t=document){return this.du(t.querySelectorAll(this.lu))}firstDescendant(n){return this.hu?(n||=document,this.mu((t=>n.querySelectorAll(t)))):t.findResult(this.et,(t=>this.mu((n=>e.subtree(t.element,n)))))}subtree(t){return this.du(e.subtree(t,this.lu))}mu(e){return t.findResult(this.cu,(t=>this.du(e(t))[0]))}pu(e){return e&&t.every(this.au,(t=>t(e)))}fu(e){return t.presence(e,this.pu.bind(this))}du(e){return t.filter(e,this.pu.bind(this))}}},7885:()=>{const t=up.util,e=up.element;up.Tether=class Tether{constructor(t){up.migrate.handleTetherOptions?.(t),this.gu=t.anchor,this.yu=t.align,this.wu=t.position,this.bu="top"===this.wu||"bottom"===this.wu?"horizontal":"vertical",this.Jo=up.viewport.get(this.gu),this.parent=this.Jo===e.root?document.body:this.Jo,this.vu=!this.Jo.contains(this.gu.offsetParent)}start(t){this.U=t,this.U.style.position="absolute",this._u(0,0),this.sync(),this.ku("on")}stop(){this.ku("off")}ku(t){let e=this.Su.bind(this);up[t](window,"resize",e),this.vu&&up[t](this.Jo,"scroll",e)}Su(){return clearTimeout(this.syncTimer),this.syncTimer=t.task(this.sync.bind(this))}isDetached(){return!this.parent.isConnected||!this.gu.isConnected}sync(){const n=this.U.getBoundingClientRect(),i=e.styleNumber(this.U,"margin-top"),s=e.styleNumber(this.U,"margin-right"),r=e.styleNumber(this.U,"margin-bottom"),o=e.styleNumber(this.U,"margin-left"),u=this.gu.getBoundingClientRect();let a,h;switch(this.bu){case"horizontal":switch(this.wu){case"top":h=u.top-r-n.height;break;case"bottom":h=u.top+u.height+i}switch(this.yu){case"left":a=u.left+o;break;case"center":a=u.left+.5*(u.width-n.width);break;case"right":a=u.left+u.width-n.width-s}break;case"vertical":switch(this.yu){case"top":h=u.top+i;break;case"center":h=u.top+.5*(u.height-n.height);break;case"bottom":h=u.top+u.height-n.height-r}switch(this.wu){case"left":a=u.left-s-n.width;break;case"right":a=u.left+u.width+o}}t.isDefined(a)||t.isDefined(h)?this.kr(a,h):up.fail("Invalid tether constraints: %o",this.xu())}xu(){return{position:this.wu,align:this.yu}}kr(t,e){const n=this.U.getBoundingClientRect();this._u(t-n.left+this.offsetLeft,e-n.top+this.offsetTop)}_u(t,n){this.offsetLeft=t,this.offsetTop=n,e.setStyle(this.U,{left:t,top:n},"px")}}},4818:()=>{const t=up.util;up.URLPattern=class URLPattern{constructor(e){this.Eu=[];const n=[],i=[];for(let s of t.getSimpleTokens(e))"-"===s[0]?i.push(s.substring(1)):n.push(s);this.Ou=this.Cu(n,!0),this.Fu=this.Cu(i,!1)}Cu(e,n){if(!e.length)return;let i=(e=(e=t.flatMap(e,t.matchableURLPatternAtom)).map(t.escapeRegExp)).join("|");return i=i.replace(/\\\*/g,".*?"),i=i.replace(/(:|\\\$)([a-z][\w-]*)/gi,((t,e,i)=>"\\$"===e?(n&&this.Eu.push({name:i,cast:Number}),"(\\d+)"):(n&&this.Eu.push({name:i,cast:String}),"([^/?#]+)"))),new RegExp("^(?:"+i+")$")}test(e,n=!0){return n&&(e=t.matchableURL(e)),this.Ou.test(e)&&!this.Tu(e)}recognize(e,n=!0){n&&(e=t.matchableURL(e));let i=this.Ou.exec(e);if(i&&!this.Tu(e)){const t={};return this.Eu.forEach(((e,n)=>{let s=i[n+1];if(s)return t[e.name]=e.cast(s)})),t}}Tu(t){return this.Fu?.test(t)}}},9675:(t,e,n)=>{n(1860),up.element=function(){const t=up.util;function e(...e){let[n=document,i]=t.args(e,"val","val");return n.querySelector(i)}function n(t,e){const n=[];return i(t,e)&&n.push(t),n.push(...t.querySelectorAll(e)),n}function i(e,n){return t.isElement(e)&&e.matches(n)}function s(...n){const i=n.pop();return t.isElement(i)?i:t.isString(i)?e(...n,i):t.isList(i)?(i.length>1&&up.fail("up.element.get(): Cannot cast multiple elements (%o) to a single element",i),i[0]):i}function r(...e){return t.flatMap(e,o)}function o(e){return t.isString(e)?document.querySelectorAll(e):t.wrapList(e)}function u(e,n){return n===N(e)?t.noop:(a(e,n),()=>a(e,!n))}function a(t,e){e?(t.removeAttribute("hidden"),"none"===t.style.display&&(t.style.display="")):t.setAttribute("hidden","")}function h(e,n){for(let i in n){const s=n[i];t.isGiven(s)?e.setAttribute(i,s):e.removeAttribute(i)}}function c(t,e){t.parentNode.insertBefore(e,t)}function l(e,n={}){let i,s,r,{includePath:o}=f(e);for(let t of o){let{tagName:e}=t;e&&"*"!==e||(e="div"),s=document.createElement(e),i||(i=s),p(s,t),r?.appendChild(s),r=s}for(let e in n){let s=n[e];"class"===e?T(i,t.wrapList(s)):"style"===e?D(i,s):"text"===e?i.textContent=s:"content"===e?t.isString(s)?i.innerHTML=s:i.append(...t.wrapList(s)):i.setAttribute(e,s)}return i}function p(t,{id:e,classNames:n,attributes:i}){e&&(t.id=e);for(let[e,n]of Object.entries(i))t.setAttribute(e,n);T(t,n)}function f(e){let n;const{masked:i,restore:s}=t.expressionOutline(e),r=i.replace(/:not\([^)]*\)/,(function(t){return n=s(t),""}));let o=s(r);return{includePath:r.split(/[ >]+/).map((function(n){let i={tagName:null,classNames:[],id:null,attributes:{}};return(n=(n=(n=(n=n.replace(/^[\w-*]+/,(function(t){return i.tagName=t,""}))).replace(/#([\w-]+)/,(function(t,e){return i.id=e,""}))).replace(/\.([\w-]+)/g,(function(t,e){return i.classNames.push(e),""}))).replace(/\[[^\]]*]/g,(function(e){e=s(e);let[n,r,o,u,a]=e.match(/\[([\w-]+)(?:([~|^$*]?=)(["'])?([^\3\]]*?)\3)?]/);return u||='"',i.attributes[r]=a?t.parseString(u+a+u):"",""})))&&up.fail("Cannot parse selector: "+e),i})),includeRaw:o,excludeRaw:n}}const d=["HTML","BODY","HEAD","TITLE"],m=up.mockable((t=>t.matches(d.join())));function g(e,n){return t.isGiven(n)?`[${e}="${n=n.replace(/"/g,'\\"')}"]`:`[${e}]`}function y(t){return w(b(t))}function w(e){if(1===e.length&&t.isElementLike(e[0]))return e[0];up.fail("Expected a single element, but got %d elements",e.length)}function b(t){t=t.trim();const e=document.createRange();return e.setStart(document.body,0),e.createContextualFragment(t).childNodes}function v(t){t.offsetHeight}function _(e,n,i){t.isMissing(e.getAttribute(n))&&e.setAttribute(n,i)}function k(e){const n=document.createElement("up-wrapper");return n.append(...t.wrapList(e)),n}function S(e,n,...i){if(!e.hasAttribute?.(n))return;let s=e.getAttribute(n);for(let r of i){let i=r(s,n,e);if(t.isDefined(i))return i}}function x(t,e){return S(t,e,E)}let E=t.identity;function O(t,e){switch(t){case"false":return!1;case"true":case"":case e:return!0}}function C(t){if((t=t.replaceAll("_","")).match(/^-?[\d.]+$/))return parseFloat(t)}function F(e){if(e?.trim())return t.parseRelaxedJSON(e)}function T(t,e){for(let n of e)t.classList.add(n)}function R(e,n,i){return e.classList.contains(n)===i?t.noop:(e.classList.toggle(n,i),()=>e.classList.toggle(n,!i))}function P(t,e){return $(window.getComputedStyle(t),e)}function L(e,n){const i=P(e,n);if(t.isPresent(i))return parseFloat(i)}function A(t,e){const{style:n}=t;return $(n,e)}function $(e,n){return up.migrate.loaded&&(n=up.migrate.fixStyleProps(n)),t.isString(n)?e.getPropertyValue(n):t.mapObject(n,(t=>[t,e.getPropertyValue(t)]))}function D(e,n,i=""){if(up.migrate.loaded&&(n=up.migrate.fixStyleProps(n,i)),t.isString(n))e.setAttribute("style",n);else{const{style:t}=e;for(let e in n){let s=n[e];t.setProperty(e,s+i)}}}function M(t,e){const n=A(t,Object.keys(e));return D(t,e),()=>D(t,n)}function N(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}function H(t){return/^up-/.test(t)}function j(e,n){return t.mapObject(n,(t=>[t,e.getAttribute(t)]))}return{subtree:n,subtreeFirst:function(t,e){return i(t,e)?t:t.querySelector(e)},contains:function(t,e){const n=s(e);return Node.prototype.contains.call(t,n)},closestAttr:function(t,e,n=x){let i=t.closest("["+e+"]");if(i)return n(i,e)},ancestor:function(t,e){return t.parentNode?.closest(e)},around:function(t,e){return r(t.closest(e),n(t,e))},get:s,list:r,toggle:function(t,e=!N(t)){a(t,e)},hide:function(t){a(t,!1)},hideTemp:function(t){return u(t,!1)},show:function(t){a(t,!0)},showTemp:function(t){return u(t,!0)},metaContent:function(t){const n="meta"+g("name",t);return e(n)?.getAttribute("content")},insertBefore:c,createFromSelector:l,setAttrs:h,setAttrsTemp:function(t,e){let n=Object.keys(e),i=j(t,n);return h(t,e),()=>h(t,i)},affix:function(...e){let[n,i="beforeend",s,r]=t.args(e,"val",t.isAdjacentPosition,"val","options");const o=l(s,r);return n.insertAdjacentElement(i,o),o},idSelector:function(t){return t.match(/^[a-z][a-z0-9\-_]*$/i)?`#${t}`:g("id",t)},classSelector:function(t){return`.${t=t.replace(/[^\w-]/g,"\\$&")}`},isSingleton:m,attrSelector:g,tagName:function(t){return t.tagName.toLowerCase()},createBrokenDocumentFromHTML:function(t){return(new DOMParser).parseFromString(t,"text/html")},fixParserDamage:function(t){let e=y(t.outerHTML);t.replaceWith(e)},createNodesFromHTML:b,createFromHTML:y,extractSingular:w,get root(){return document.documentElement},paint:v,concludeCSSTransition:function(t){const e=M(t,{transition:"none"});return v(t),e},hasCSSTransition:function(t){const e=t["transition-property"],n=t["transition-duration"];return!("none"===e||"all"===e&&0===n)},fixedToAbsolute:function(t){const e=t.getBoundingClientRect();t.style.position="absolute";const n=t.offsetParent.getBoundingClientRect();D(t,{left:e.left-L(t,"margin-left")-n.left+"px",top:e.top-L(t,"margin-top")-n.top+"px",right:"",bottom:""})},setMissingAttrs:function(t,e){for(let n in e)_(t,n,e[n])},setMissingAttr:_,unwrap:function(t){!function(e){const n=document.activeElement;try{return function(){let e=[...t.childNodes];for(let n of e)c(t,n);t.remove()}()}finally{n&&n!==document.activeElement&&n.focus({preventScroll:!0})}}()},wrapChildren:function(t){const e=k(t.childNodes);return t.append(e),e},wrapIfRequired:function(e){return 1===e.length&&t.isElement(e[0])?e[0]:k(e)},attr:x,booleanAttr:function(t,e){return S(t,e,O)},numberAttr:function(t,e){return S(t,e,C)},jsonAttr:function(t,e){return S(t,e,F)},callbackAttr:function(e,n,i){return S(e,n,(n=>function(e,n,{exposedKeys:i=[],mainKey:s="event"}={}){const r=up.NonceableCallback.fromString(e).toFunction(s,...i);return function(e){const s=Object.values(t.pick(e,i));return r.call(n,e,...s)}}(n,e,i)))},booleanOrStringAttr:function(t,e){return S(t,e,O,E)},booleanOrNumberAttr:function(t,e){return S(t,e,O,C)},setStyleTemp:M,style:P,styleNumber:L,inlineStyle:A,setStyle:D,isVisible:N,upAttrs:function(t){let e=t.getAttributeNames().filter(H);return j(t,e)},upClasses:function(e){return t.filter(e.classList.values(),H)},setAttrPresence:function(t,e,n,i){return i?t.setAttribute(e,n):t.removeAttribute(e)},addClasses:T,addClassTemp:function(t,e){return R(t,e,!0)},removeClassTemp:function(t,e){return R(t,e,!1)},cleanJQuery:function(t){up.browser.canJQuery()&&jQuery(t).remove()},parseSelector:f,isEmpty:function(t){return!t.children.length>0&&!t.innerText.trim()},crossOriginSelector:function(t){return`[${t}*="//"]:not([${t}*="//${location.host}/"])`},isIntersectingWindow:function(t,{margin:e=0}={}){const n=up.Rect.fromElement(t);return n.grow(e),n.bottom>0&&n.top<window.innerHeight&&n.right>0&&n.left<window.innerWidth},unionSelector:function(e,n){let i=`:is(${e.join()})`;return t.isPresent(n)&&(i+=`:not(${n.join()})`),i},matchSelectorMap:function(e,n){let i=[];if(e)for(let[s,r]of Object.entries(e))t.isDefined(r)&&n.matches(s)&&i.push(r);return i},elementLikeMatches:i,documentPosition:function(t){let e=t.nextElementSibling;return e?[e,"beforebegin"]:[t.parentElement,"beforeend"]}}}()},3924:()=>{up.error=function(){function t(t){if("object"!=typeof(e=t)||!("AbortError"===e.name||e instanceof up.RenderResult||e instanceof up.Response))throw t;var e}function e(t,...e){try{return t(...e)}catch(t){reportError(t)}}return{fail:function(...t){throw new up.Error(t)},throwCritical:t,muteUncriticalRejection:function(e){return e.catch(t)},muteUncriticalSync:function(e){try{return e()}catch(e){t(e)}},guard:e,guardFn:function(t){return(...n)=>e((()=>t(...n)))}}}(),up.fail=up.error.fail},4366:()=>{up.Aborted=class Aborted extends up.Error{constructor(t){super(t,{name:"AbortError"})}}},8010:()=>{up.CannotMatch=class CannotMatch extends up.Error{}},4861:()=>{up.CannotParse=class CannotParse extends up.Error{}},3469:()=>{up.CannotTarget=class CannotTarget extends up.Error{}},376:()=>{up.Error=class Error extends window.Error{constructor(t,e={}){Array.isArray(t)&&(t=up.util.sprintf(...t)),super(t);let n="up."+this.constructor.name;Object.assign(this,{name:n},e)}}},8272:()=>{up.NotImplemented=class NotImplemented extends up.Error{}},4504:()=>{up.Offline=class Offline extends up.Error{}},8670:()=>{up.event=function(){const t=up.util,e=up.element;function n(...t){return i(t).bind()}function i(t,e){return up.EventListenerGroup.fromBindArgs(t,e)}function s(t){return up.EventEmitter.fromEmitArgs(t)}function r(...e){const n=t.extractOptions(e),i=e[0]||n.type||up.fail("Missing event type"),s=new Event(i,{bubbles:!0,cancelable:!0});return Object.assign(s,t.omit(n,["type","target"])),s}const o=["metaKey","shiftKey","ctrlKey","altKey"];function u(e){return(t.isUndefined(e.button)||0===e.button)&&!t.some(o,(t=>e[t]))}function a(e,n,i=[]){const s=r(n,t.pick(e,i));return s.originalEvent=e,["stopPropagation","stopImmediatePropagation","preventDefault"].forEach((function(t){const n=s[t];return s[t]=function(){return e[t](),n.call(s)}})),e.defaultPrevented&&s.preventDefault(),s}n("up:click","[up-emit]",(function(t,n){if(!u(t))return;const i=e.attr(n,"up-emit"),s=e.jsonAttr(n,"up-emit-props"),r=a(t,i);Object.assign(r,s),up.emit(n,r)}));let h=["unknown"];function c(t){h.push(t),setTimeout((()=>h.pop()))}return n("keydown keyup",{capture:!0},(()=>c("key"))),n("pointerdown pointerup",{capture:!0},(()=>c("pointer"))),n("up:framework:reset",(function(){for(let t of[window,document,e.root,document.body])for(let e of up.EventListener.allNonDefault(t))e.unbind()})),{on:n,off:function(...t){return i(t).unbind()},build:r,emit:function(...t){return s(t).emit()},assertEmitted:function(...t){return s(t).assertEmitted()},onEscape:function(t){return n("keydown",(function(e){if("Escape"===e.key)return t(e)}))},halt:function(t,e={}){e.log&&up.log.putsEvent(t),t.stopImmediatePropagation(),t.preventDefault()},isUnmodified:u,isSyntheticClick:function(e){return t.isMissing(e.clientX)},fork:a,keyModifiers:o,get inputDevice(){return t.last(h)}}}(),up.on=up.event.on,up.off=up.event.off,up.emit=up.event.emit},2851:()=>{up.form=function(){const t=up.util,e=up.element,n=new up.Config((()=>({groupSelectors:["[up-form-group]","fieldset","label","form"],fieldSelectors:["select","input:not([type=submit], [type=image], [type=button])","button[type]:not([type=submit], [type=button])","textarea"],submitSelectors:["form:is([up-submit], [up-target], [up-layer], [up-transition])"],noSubmitSelectors:["[up-submit=false]","[target]",e.crossOriginSelector("action")],submitButtonSelectors:["input[type=submit]","input[type=image]","button[type=submit]","button:not([type])"],genericButtonSelectors:["input[type=button]","button[type=button]"],watchInputEvents:["input","change"],watchInputDelay:0,watchChangeEvents:["change"]})));function i(t=""){return n.fieldSelectors.map((e=>e+t)).join()}function s(t){return t.matches(i())}function r(n){n=e.get(n);let s=e.subtree(n,i());if(n.matches("form[id]")){const r=i(e.attrSelector("form",n.getAttribute("id"))),o=up.fragment.all(r,{layer:n});s.push(...o),s=t.uniq(s)}return s}function o(t){return e.subtree(t,a())}function u(t){return t?.matches(a())}function a(){return n.selector("submitButtonSelectors")}const h=up.mockable(((t,e)=>up.render(c(t,e))));function c(e,n,i){e=S(e),n=t.options(n);let s=new up.OptionsParser(e,n,i);return s.include(f),s.string("failTarget",{default:up.fragment.tryToTarget(e)}),n.guardEvent||=up.event.build("up:form:submit",{submitButton:n.submitButton,log:"Submitting form",params:n.params,form:e}),n.origin||=up.viewport.focusedElementWithin(e)||n.submitButton||e,n.activeElements=t.uniq([n.origin,n.submitButton,e].filter(t.isElement)),s.include(up.link.followOptions),n}function l(t){if(t.disabled)return;let e;return document.activeElement===t?(e=y(t),t.disabled=!0,up.focus(e,{force:!0,preventScroll:!0})):t.disabled=!0,()=>{t.disabled=!1}}function p(e,n){let i=()=>x(n);return!0===e?[i()]:t.isElement(e)?[e]:t.isString(e)?up.fragment.subtree(i(),e,{origin:n}):t.isArray(e)?t.flatMap(e,(t=>p(t,n))):[]}function f(e,n,i){n=t.options(n),e=S(e);const s=new up.OptionsParser(e,n,i);s.string("contentType",{attr:"enctype"}),s.json("headers");const r=up.Params.fromForm(e),u=n.submitButton??=o(e)[0];return u&&(r.addField(u),n.method||=u.getAttribute("formmethod"),n.url||=u.getAttribute("formaction")),r.addAll(n.params),n.params=r,s.string("url",{attr:"action",default:up.fragment.source(e)}),s.string("method",{attr:["up-method","data-method","method"],default:"GET",normalize:t.normalizeMethod}),"GET"===n.method&&(n.url=up.Params.stripURL(n.url)),n}function d(...e){let[n,i,s]=t.args(e,"val","options","callback");n=up.element.get(n),s||=function(t){let e=t.getAttribute("up-watch");if(e)return up.NonceableCallback.fromString(e).toFunction("value","name","options").bind(t)}(n)||up.fail("No callback given for up.watch()");const r=new up.FieldWatcher(n,i,s);return r.start(),()=>r.stop()}function m(t,e={}){return d(t,{...e,batch:!0},((e,n)=>h(t,n)))}function g(){return up.migrate.migratedFormGroupSelectors?.()||n.groupSelectors}function y(t){return w(t).element}function w(e){return t.findResult(g(),(function(t){let n=e.closest(t);if(n){let i=up.fragment.tryToTarget(n,{strong:!0}),s=up.fragment.tryToTarget(e),r=i||s&&n!==e&&`${t}:has(${s})`;if(r)return{target:r,element:n,origin:e}}}))}function b(n){let i,s;if(n.matches("input[type=checkbox]"))n.checked?(i=n.value,s=":checked"):s=":unchecked";else if(n.matches("input[type=radio]")){const t=x(n),r=n.getAttribute("name"),o=t.querySelector(`input[type=radio]${e.attrSelector("name",r)}:checked`);o?(s=":checked",i=o.value):s=":unchecked"}else i=n.value;const r=[];return t.isPresent(i)?(r.push(i),r.push(":present")):r.push(":blank"),t.isPresent(s)&&r.push(s),r}function v(t,e={}){const n=e.target||e.target||t.getAttribute("up-switch"),i=x(t);n||up.fail("No switch target given for %o",t);const s=b(t);for(let t of up.fragment.all(i,n))_(t,s)}const _=up.mockable((function(n,i){let s;i||=b(function(e){const n=x(e).querySelectorAll("[up-switch]");return t.find(n,(function(t){const n=t.getAttribute("up-switch");return e.matches(n)}))||up.fail("Could not find [up-switch] field for %o",e)}(n));let r=n.getAttribute("up-hide-for");if(r)r=k(r),s=0===t.intersect(i,r).length;else{let e=n.getAttribute("up-show-for");e=e?k(e):[":present",":checked"],s=t.intersect(i,e).length>0}e.toggle(n,s),n.classList.add("up-switched")}));function k(e){return t.getSimpleTokens(e,{json:!0})}function S(t,e={}){const n=up.fragment.get(t,e);return n.form||n.closest("form")}function x(t,e){return t?S(t,e)||up.layer.get(t).element:up.layer.current.element}return up.on("submit",n.selectorFn("submitSelectors"),(function(e,n){if(e.defaultPrevented)return;const i=t.presence(e.submitter,u);up.event.halt(e,{log:!0}),up.error.muteUncriticalRejection(h(n,{submitButton:i}))})),up.compiler((function(){let t=n.fieldSelectors.map((t=>`${t}[up-validate], [up-validate] ${t}`));return e.unionSelector(t,["[up-validate=false]"])}),(function(t){up.FormValidator.forElement(t).watchContainer(t)})),up.compiler("[up-switch]",(t=>{v(t)})),up.on("change","[up-switch]",((t,e)=>{v(e)})),up.compiler("[up-show-for]:not(.up-switched), [up-hide-for]:not(.up-switched)",(t=>{_(t)})),up.attribute("up-watch",(t=>d(t))),up.attribute("up-autosubmit",(t=>m(t))),{config:n,submit:h,submitOptions:c,destinationOptions:f,watchOptions:function(e,n,i={}){n=t.options(n);let s=new up.OptionsParser(e,n,{...i,closest:!0,attrPrefix:"up-watch-"});s.include(up.status.statusOptions),s.string("event"),s.number("delay");let r=up.form.config;return"input"===n.event?(n.event=t.evalOption(r.watchInputEvents,e),n.delay??=r.watchInputDelay):"change"===n.event&&(n.event=t.evalOption(r.watchChangeEvents,e)),n.origin||=e,n},isSubmittable:function(t){return t=up.fragment.get(t),n.matches(t,"submitSelectors")},watch:d,validate:function(...e){let n=function(e,...n){const i=t.extractOptions(n);return i.origin?i.target||=up.fragment.toTarget(e):i.origin||=up.fragment.get(e),i}(...e);return up.FormValidator.forElement(n.origin).validate(n)},autosubmit:m,fieldSelector:i,fields:r,isField:s,submitButtons:o,focusedField:function(){return t.presence(document.activeElement,s)},switchTarget:_,disable:function(i){let s=[...r(i),...o(i),...(u=i,e.subtree(u,n.selector("genericButtonSelectors")))];var u;return t.sequence(t.map(s,l))},getDisablePreviewFn:function(t,e){return function(n){let i=p(t,e);for(let t of i)n.disable(t)}},group:y,groupSolution:w,groupSelectors:g,get:S,getScope:x}}(),up.submit=up.form.submit,up.watch=up.form.watch,up.autosubmit=up.form.autosubmit,up.validate=up.form.validate},2667:(t,e,n)=>{n(8711);const i=up.util,s=up.element;up.fragment=function(){function t(t){let e=s.tagName(t);if(e.startsWith("up-"))return e}const e=["[up-id]","[id]","html","head","body"],n=new up.Config((()=>({badTargetClasses:[/^up-/],strongTargetDerivers:e,targetDerivers:[...e,"main","[up-main]",t,"link[rel][type]","link[rel=preload][href]","link[rel=preconnect][href]","link[rel=prefetch][href]","link[rel]","meta[property]","*[name]","form[action]","a[href]","[class]","[up-flashes]","form"],verifyDerivedTarget:!0,renderOptions:{hungry:!0,keep:!0,saveScroll:!0,saveFocus:!0,focus:"keep",abort:"target",failOptions:!0,feedback:!0},navigateOptions:{cache:"auto",revalidate:"auto",fallback:!0,focus:"auto",scroll:"auto",history:"auto",peel:!0},match:"region",runScripts:!0,autoHistoryTargets:[":main"],autoFocus:["hash","autofocus","main-if-main","keep","target-if-lost"],autoScroll:["hash","layer-if-main"],autoRevalidate:t=>t.expired,skipResponse:r})));function r({response:t,expiredResponse:e}){return!t.text||t.text===e?.text}function o(t,e={}){return t=d(t,e),s.closestAttr(t,"up-source")}function u(t){return i.normalizeURL(t,{hash:!1})}function a(t){let e=s.closestAttr(t,"up-time");if(e&&"false"!==e)return/^\d+$/.test(e)&&(e=1e3*Number(e)),new Date(e)}function h(t){let e=s.closestAttr(t,"up-etag");if(e&&"false"!==e)return e}i.delegate(n,["mainTargets"],(()=>up.layer.config.any));const c=up.mockable(((...t)=>{let e=b(t);return new up.RenderJob(e).execute()})),l=up.mockable(((...t)=>{const e=b(t);return c({...e,navigate:!0})}));function p(t){return!t.closest(".up-destroying")}function f(t){return t.isConnected&&p(t)}function d(...t){let[e,n,r]=g(t);return i.isElementLike(n)?s.get(n):e?m(e,n,r):new up.FragmentFinder({selector:n,origin:r.origin,layer:r.layer,match:r.match}).find()}function m(...t){let[e,n,i]=g(t);return new up.Selector(n,e,i).firstDescendant(e)}function g(t){return i.args(t,"val","val","options")}function y(...t){let[e,n,s]=g(t);return i.isElement(n)?[n]:i.isList(n)?n:new up.Selector(n,e,s).descendants(e)}function w(t,e,n={}){return new up.Selector(e,t,n).subtree(t)}function b(t){const e=i.parseArgIntoOptions(t,"target");return i.isElement(e.target)&&(e.origin||=e.target),e}const v=/^(onFail|on|fail)?(.+)$/;function _(t,e){return i.presence(t,i.isString)||k(t,e)||function(t){throw new up.CannotTarget(function(t){return`Cannot derive good target selector from a <${s.tagName(t)}> element without identifying attributes. Try setting an [id] or configure up.fragment.config.targetDerivers.`}(t))}(t)}function k(t,e={}){let r=e.strong?n.strongTargetDerivers:n.targetDerivers;return i.findResult(r,(function(r){let o=function(t,e){if(i.isFunction(e))return e(t);if(t.matches(e))try{return function(t,e){let{includePath:n,excludeRaw:i}=s.parseSelector(e);if(1!==n.length)throw new up.CannotParse(e);let{tagName:r,id:o,classNames:u,attributes:a}=n[0],h="";"*"===r?h+=s.tagName(t):r&&(h+=r);for(let t of u)h+=s.classSelector(t);o&&(h+=s.idSelector(o));for(let e in a){let n=a[e]||t.getAttribute(e);if("id"===e)h+=s.idSelector(n);else if("class"===e)for(let e of S(t))h+=s.classSelector(e);else h+=s.attrSelector(e,n)}return i&&(h+=i),h}(t,e)}catch(t){if(t instanceof up.CannotParse)return e;throw t}}(t,r);if(o&&function(t,e,i={}){let s=i.verify??n.verifyDerivedTarget;return!f(e)||!s||up.fragment.get(t,{layer:e,...i})===e}(o,t,e))return o}))}function S(t){return i.filter(t.classList,(t=>!i.some(n.badTargetClasses,(e=>{return n=e,s=t,i.isRegExp(n)?n.test(s):n===s;var n,s}))))}const x=/:main\b/,E=/:layer\b/,O=/:origin\b/;function C(t){return x.test(t)}function F(t,e={}){const{layer:n}=e;"new"===n||n instanceof up.Layer||up.fail("Must pass an up.Layer as { layer } option, but got %o",n),t=i.copy(i.wrapList(t));const s=[];for(;t.length;){let r=t.shift();if(!0===r&&(r=":main"),C(r)){let n=T(e),i=up.layer.mainTargets(n).map((t=>r.replace(x,t)));t.unshift(...i)}else if(E.test(r)){if("new"===n||n.opening)continue;let i=_(n.getFirstSwappableElement(),e);t.unshift(r.replace(E,i))}else i.isElementLike(r)?s.push(_(r,e)):i.isString(r)&&s.push(P(r,e))}return i.uniq(s)}function T({layer:t,mode:e}){return"new"===t?e||up.fail('Must pass a { mode } option together with { layer: "new" }'):t.mode}function R(t,{origin:e}={}){return t.replace(O,(function(n){if(e)return _(e);up.fail('Missing { origin } element to resolve "%s" reference (found in %s)',n,t)}))}function P(t,e){return i.isString(t)?(up.migrate.resolveOrigin||R)(t,e):t}function L(t){return i.getComplexTokens(t)}const A=/^([\w-]+|\*)?(#|\.|[:[][a-z-]{3,})/;function $(t,{origin:e,originLayer:n,data:r,htmlParser:o=s.createNodesFromHTML}={}){if(i.isString(t)&&A.test(t)){let[s,o]=i.parseScalarJSONPairs(t)[0];r={...r,...o},t=up.fragment.get(s,{layer:"closest",origin:e,originLayer:n})||up.fail('Cannot find template "%s"',t)}return i.isString(t)&&(t=o(t)),function(t){return i.isElement(t)&&t.matches("template, script[type]")&&!up.script.isScript(t)}(t)&&(t=D(t,r,{htmlParser:o})),i.wrapList(t)}function D(t,e={},{origin:n,htmlParser:i}={}){let r=d(t,{origin:n})||up.fail("Template not found: %o",t),o=up.emit(r,"up:template:clone",{data:e,nodes:null,log:["Using template %o",t]}).nodes??function(t,e=s.createNodesFromHTML){return e(t.innerHTML)}(r,i);for(let t of o)t.upTemplateData=e;return o}return up.on("up:framework:boot",(function(){const{documentElement:t}=document;if(t.setAttribute("up-source",u(location.href)),up.hello(t),!up.browser.canPushState())return up.warn("Cannot push history changes. Next render pass with history will load a full page.")})),{config:n,reload:function(...t){const e=b(t);e.target||=":main";const n=d(e.target,e);return e.url||=o(n),e.headers=i.merge(e.headers,function(t){let e={},n=a(t);n&&(e["If-Modified-Since"]=n.toUTCString());let i=h(t);return i&&(e["If-None-Match"]=i),e}(n)),(e.keepData||s.booleanAttr(n,"up-keep-data"))&&(e.data=up.data(n)),up.migrate.postprocessReloadOptions?.(e),c(e)},destroy:function(...t){const e=b(t);return(e.element=d(e.target,e))&&new up.Change.DestroyFragment(e).execute(),up.migrate.formerlyAsync?.("up.destroy()")},render:c,navigate:l,get:d,getFirstDescendant:m,all:y,subtree:w,contains:function(t,e){return i.isElement(e)?s.contains(t,e)&&up.layer.get(t).contains(e):w(t,e).length>0},closest:function(t,e,n){return new up.Selector(e,t,n).closest(t)},source:o,normalizeSource:u,visit:function(t,e){return l({...e,url:t})},markAsDestroying:function(t){t.classList.add("up-destroying"),t.setAttribute("aria-hidden","true")},emitInserted:function(t){return up.emit(t,"up:fragment:inserted",{log:["Inserted fragment %o",t]})},emitDestroyed:function(t,e){const n=e.log??["Destroyed fragment %o",t],i=e.parent||document;return up.emit(i,"up:fragment:destroyed",{fragment:t,parent:i,log:n})},emitKeep:function(t){let{oldElement:e,newElement:n,newData:i,renderOptions:r}=t;const o=["Keeping fragment %o",e],u=s.callbackAttr(e,"up-on-keep",{exposedKeys:["newFragment","newData"]});return up.emit(e,"up:fragment:keep",{newFragment:n,newData:i,renderOptions:r,log:o,callback:u})},successKey:function(t){let e=v.exec(t);if(e){let[t,n,s]=e;switch(n){case"onFail":return"on"+i.upperCaseFirst(s);case"fail":return i.lowerCaseFirst(s)}}},failKey:function(t){let e=v.exec(t);if(e){let[t,n,s]=e;switch(n){case"on":return"onFail"+i.upperCaseFirst(s);case void 0:return"fail"+i.upperCaseFirst(s)}}},expandTargets:F,resolveOrigin:P,toTarget:_,tryToTarget:k,isTargetable:function(t){return!!k(t)},matches:function(t,e,n={}){if(t=s.get(t),i.isElement(e)){let n=k(e);return n&&t.matches(n)}return new up.Selector(e,t,n).matches(t)},hasAutoHistory:function(t,e){let i=F(n.autoHistoryTargets,{layer:e}).join();for(let e of t)if(s.subtree(e,i).length)return!0;return up.puts("up.render()","Will not auto-update history because fragment doesn't contain a selector from up.fragment.config.autoHistoryTargets"),!1},time:a,etag:h,shouldRevalidate:function(t,e,s={}){return t.fromCache&&i.evalAutoOption(s.revalidate,n.autoRevalidate,e)},abort:function(...t){let e,n,s=b(t),{reason:r,newLayer:o}=s;if(s.target)n=y(s.target,s),e=t=>t.isBoundToSubtrees(n),r||="Aborting requests within fragment";else{let t=up.layer.getAll(s);n=i.map(t,"element"),e=e=>e.isBoundToLayers(t),r||="Aborting requests within "+t.join(", ")}up.network.abort((t=>t.abortable&&e(t)),{...s,reason:r});for(let t of n)up.emit(t,"up:fragment:aborted",{reason:r,newLayer:o,log:!1})},onAborted:function(t,e){let n=up.on("up:fragment:aborted",{guard:e=>e.target.contains(t)},e);return up.destructor(t,n),n},onFirstIntersect:function(t,e,{margin:n=0}={}){if(s.isIntersectingWindow(t,{margin:n}))return void e();let i=new IntersectionObserver((function(t){for(let n of t)if(n.isIntersecting)return r(),void e()}),{rootMargin:`${n}px`}),r=()=>i.disconnect();i.observe(t),up.destructor(t,r)},splitTarget:L,parseTargetSteps:function(t,e={}){let n=e.defaultPlacement||"swap",i=e.defaultMaybe??!1,s=[],r=L(t);for(let t of r){if(":none"===t)continue;let r=n,o=i;t=t.replace(/\b::?(before|after|content)\b/,((t,e)=>(r=e,""))),t=t.replace(/\b:maybe\b/,(()=>(o=!0,"")));const u={...e,selector:t,placement:r,maybe:o,originalRenderOptions:e};s.push(u)}return s},isAlive:f,isNotDestroying:p,targetForSteps:function(t){let e=t.filter((t=>!t.maybe||t.oldElement?.isConnected));return i.map(e,"selector").join(", ")||":none"},compressNestedSteps:function(t){if(t.length<2)return t;let e=i.uniqBy(t,"oldElement");return e=i.reject(e,(t=>function(t,e){return i.some(t,(function(t){return t!==e&&("swap"===t.placement||"content"===t.placement)&&t.oldElement.contains(e.oldElement)}))}(e,t))),e},containsMainPseudo:C,insertTemp:function(...t){let[e,n="beforeend",r]=i.args(t,"val",i.isAdjacentPosition,"val"),o=$(r,{origin:e}),u=s.wrapIfRequired(o),a=document.contains(u)&&s.documentPosition(u);return e.insertAdjacentElement(n,u),a?()=>{a[0].insertAdjacentElement(a[1],u)}:(up.hello(u),()=>up.destroy(u))},provideNodes:$,cloneTemplate:D}}(),up.reload=up.fragment.reload,up.destroy=up.fragment.destroy,up.render=up.fragment.render,up.navigate=up.fragment.navigate,up.visit=up.fragment.visit,up.template={clone:up.fragment.cloneTemplate},i.delegate(up,["context"],(()=>up.layer.current))},9634:()=>{up.framework=function(){let t="evaling";function e(){if("configuring"!==t)return void console.error("Unpoly has already booted");let e=n();e?console.error("Unpoly cannot boot: %s",e):(t="booting",up.emit("up:framework:boot",{log:!1}),t="booted",up.emit("up:framework:booted",{log:!1}))}function n(){for(let t of["Promise","DOMParser","FormData","reportError"])if(!window[t])return`Browser doesn't support the ${t} API`;if("BackCompat"===document.compatMode)return"Browser is in quirks mode (missing DOCTYPE?)";for(let t of[":is(*)",":has(*)"])if(!CSS.supports(`selector(${t})`))return`Browser doesn't support the ${t} selector`}return{onEvaled:function(){up.emit("up:framework:evaled",{log:!1}),function(){let t=document.currentScript;return!!t?.async||"manual"===t?.getAttribute("up-boot")||"complete"===document.readyState||void 0}()?console.debug("Call up.boot() after you have configured Unpoly"):document.addEventListener("DOMContentLoaded",e),t="configuring"},boot:e,startExtension:function(){if("configuring"!==t)throw new Error("Unpoly extensions must be loaded before booting");t="evaling"},stopExtension:function(){t="configuring"},reset:function(){up.emit("up:framework:reset",{log:!1})},get evaling(){return"evaling"===t},get booted(){return"booted"===t},get beforeBoot(){return"booting"!==t&&"booted"!==t},isSupported:function(){return!n()}}}(),up.boot=up.framework.boot},8944:()=>{up.history=function(){const t=up.util,e=up.element,n=new up.Config((()=>({enabled:!0,updateMetaTags:!0,restoreTargets:["body"],metaTagSelectors:["meta","link[rel=alternate]","link[rel=canonical]","link[rel=icon]","[up-meta]",'script[type="application/ld+json"]'],noMetaTagSelectors:["meta[http-equiv]","[up-meta=false]","meta[name=csp-nonce]"]})));let i,s;function r(){return t.normalizeURL(location.href)}function o(){const t=r();s!==t&&(i=s,s=t)}function u(e,n){return t.matchURLs(e,location.href,{hash:!0,...n})}function a(e,n={}){c("replaceState",e=t.normalizeURL(e))&&!1!==n.event&&h({location:e,reason:"replace",log:`Replaced state for ${e}`})}function h(t){let e=up.event.build("up:location:changed",t);up.migrate?.renamedProperty?.(e,"url","location"),up.emit(e)}function c(t,e){if(n.enabled){const n={up:{}};return window.history[t](n,"",e),o(),!0}}function l(t){o();let e=r();h({location:e,reason:"pop",log:`Navigated to history entry ${e}`}),up.viewport.saveFocus({location:i}),up.viewport.saveScroll({location:i}),function(t){if(!t?.up)return void up.puts("popstate","Ignoring a history state not owned by Unpoly");let e=r();up.error.muteUncriticalRejection(up.render({guardEvent:up.event.build("up:location:restore",{location:e,log:`Restoring location ${e}`}),url:e,target:n.restoreTargets,fail:!1,history:!0,location:e,peel:!0,layer:"root",cache:"auto",revalidate:"auto",saveScroll:!1,scroll:["restore","auto"],saveFocus:!1,focus:["restore","auto"]}))}(t.state)}function p(){window.addEventListener("popstate",l),"GET"===up.protocol.initialRequestMethod()&&a(r(),{event:!1})}function f(t=document.head){return t.querySelectorAll(n.selector("metaTagSelectors"))}return o(),up.on("up:framework:boot",(function(){"jasmine"in window?p():setTimeout(p,100)})),up.macro("[up-back]",(function(t){i&&(e.setMissingAttrs(t,{"up-href":i,"up-scroll":"restore"}),t.removeAttribute("up-back"),up.link.makeFollowable(t))})),up.on("up:framework:reset",(function(){i=void 0,s=void 0,o()})),{config:n,push:function(e){!u(e=t.normalizeURL(e))&&c("pushState",e)&&h({location:e,reason:"push",log:`Advanced to location ${e}`})},replace:a,get location(){return r()},get previousLocation(){return i},isLocation:u,findMetaTags:f,updateMetaTags:function(t){let e=f();for(let t of e)t.remove();for(let e of t)document.head.append(e)},getLang:function(t=document){let{documentElement:e}=t;if(e.matches("html"))return t.documentElement.lang},updateLang:function(t){e.setAttrPresence(e.root,"lang",t,!!t)}}}()},9443:(t,e,n)=>{n(4432);const i=up.util,s=up.element;up.layer=function(){const t=[up.Layer.Root,up.Layer.Modal,up.Layer.Popup,up.Layer.Drawer,up.Layer.Cover],e=new up.Config((function(){const e={mode:"modal",any:{mainTargets:["[up-main='']","main",":layer"]},root:{mainTargets:["[up-main~=root]"],history:!0},overlay:{mainTargets:["[up-main~=overlay]"],openAnimation:"fade-in",closeAnimation:"fade-out",dismissLabel:"×",dismissARIALabel:"Dismiss dialog",dismissable:!0,history:"auto",trapFocus:!0},cover:{mainTargets:["[up-main~=cover]"]},drawer:{mainTargets:["[up-main~=drawer]"],backdrop:!0,position:"left",size:"medium",openAnimation(t){switch(t.position){case"left":return"move-from-left";case"right":return"move-from-right"}},closeAnimation(t){switch(t.position){case"left":return"move-to-left";case"right":return"move-to-right"}}},modal:{mainTargets:["[up-main~=modal]"],backdrop:!0,size:"medium"},popup:{mainTargets:["[up-main~=popup]"],position:"bottom",size:"medium",align:"left",dismissable:"outside key",trapFocus:!1},foreignOverlaySelectors:["dialog"]};for(let n of t)e[n.mode].Class=n;return e}));let n=null,r=[];function o(t){return"root"===t?[e.root,e.any]:[e[t],e.overlay,e.any]}async function u(t){return t=i.options(t,{layer:"new",defaultToEmptyContent:!0,navigate:!0}),(await up.render(t)).layer}up.on("up:fragment:destroyed",(function(){n.sync()})),up.on("up:framework:evaled",(function(){n=new up.LayerStack})),up.on("up:framework:reset",(function(){n.reset(),r=i.filter(r,"isDefault")}));const a={config:e,mainTargets:function(t){return i.flatMap(o(t),"mainTargets")},open:u,build:function(t,s){const{mode:r}=t,{Class:u}=e[r],a=i.reverse(o(r));let h=up.migrate.handleLayerConfig;return h&&a.forEach(h),t.openAnimation??=i.pluckKey(t,"animation"),t=i.mergeDefined(...a,{mode:r,stack:n},t),s&&(t=s(t)),new u(t)},ask:function(t){return new Promise((function(e,n){u(t={...t,onAccepted:t=>e(t.value),onDismissed:t=>n(t.value)})}))},normalizeOptions:function(t){!function(t){if(!(t.layer instanceof up.Layer))if(up.migrate.handleLayerOptions?.(t),i.isGiven(t.layer)){let n=String(t.layer).match(/^(new|shatter|swap)( (\w+))?/);if(n){t.layer="new";const i=n[1],s=n[3];t.mode||=s||e.mode,"swap"===i?up.layer.isOverlay()&&(t.baseLayer="parent"):"shatter"===i&&(t.baseLayer="root")}}else i.isElementLike(t.target)?t.layer=n.get(t.target,{normalizeLayerOptions:!1}):t.origin?t.layer="origin":t.layer="current"}(t),t.context??={},function(t){t.baseLayer instanceof up.Layer||(t.baseLayer=n.get("current",{...t,normalizeLayerOptions:!1}))}(t)},openCallbackAttr:function(t,e){return s.callbackAttr(t,e,{exposedKeys:["layer"]})},closeCallbackAttr:function(t,e){return s.callbackAttr(t,e,{exposedKeys:["layer","value","response"]})},anySelector:function(){return i.map(t,(t=>t.selector())).join()},optionToString:function(t){return i.isString(t)?`layer "${t}"`:t.toString()},get stack(){return n.layers},isWithinForeignOverlay:function(t){let n=e.selector("foreignOverlaySelectors");return!(!n||!t.closest(n))}};return i.delegate(a,["get","getAll","root","overlays","current","front","sync","count","dismissOverlays"],(()=>n)),i.delegate(a,["accept","dismiss","isRoot","isOverlay","isFront","on","off","emit","parent","history","location","mode","context","element","contains","size","affix"],(()=>n.current)),a}()},3849:(t,e,n)=>{n(2065),up.link=function(){const t=up.util,e=up.element;let n=null;const i="[up-content], [up-fragment], [up-document]",s=`${i}, [up-target], [up-layer], [up-transition], [up-preload]`,r=new up.Config((()=>({followSelectors:["[up-follow]",`a:is(${s})`],noFollowSelectors:["[up-follow=false]","a[download]","a[target]",'a[href^="javascript:"]','a[href^="mailto:"]','a[href^="tel:"]',`a[href^="#"]:not(${i})`,e.crossOriginSelector("href"),e.crossOriginSelector("up-href")],instantSelectors:["[up-instant]"],noInstantSelectors:["[up-instant=false]","[onclick]"],preloadSelectors:["[up-preload]"],noPreloadSelectors:["[up-preload=false]"],clickableSelectors:["[up-clickable]","[up-follow]","[up-emit]","[up-accept]","[up-dismiss]",`a:is(${s})`],noClickableSelectors:["[up-clickable=false]","a[href], button"],preloadDelay:90}))),o=up.mockable((function(t,e,n){return up.render(a(t,e,n))}));function u(e,n,i){n=t.options(n);const s=new up.OptionsParser(e,n,{...i,fail:!1});return n.url=function(t,e={}){const n=e.url||t.getAttribute("up-href")||t.getAttribute("href");if("#"!==n)return n}(e,n),n.method=c(e,n),s.json("headers"),s.json("params"),s.booleanOrString("cache"),s.booleanOrString("expireCache"),s.booleanOrString("evictCache"),s.booleanOrString("revalidate"),s.booleanOrString("abort"),s.boolean("abortable"),s.boolean("background"),s.string("contentType"),s.booleanOrNumber("lateDelay"),s.number("timeout"),n}function a(e,n,i){e=up.fragment.get(e),n=t.options(n);const s=new up.OptionsParser(e,n,{fail:!0,...i});return s.include(u),n.origin||=e,s.boolean("fail"),s.boolean("navigate",{default:!0}),s.string("confirm",{attr:["up-confirm","data-confirm"]}),s.string("target"),s.booleanOrString("fallback"),s.string("match"),s.string("document"),s.string("fragment"),s.string("content"),s.boolean("keep",{attr:"up-use-keep"}),s.boolean("hungry",{attr:"up-use-hungry"}),s.json("data",{attr:"up-use-data"}),s.callback("onLoaded"),s.callback("onRendered",{mainKey:"result"}),s.callback("onFinished",{mainKey:"result"}),s.callback("onOffline",{mainKey:"error"}),s.callback("onError",{mainKey:"error"}),s.boolean("peel"),s.string("layer"),s.string("baseLayer"),s.json("context"),s.string("mode"),s.string("align"),s.string("position"),s.string("class"),s.string("size"),s.booleanOrString("dismissable"),s.parse(up.layer.openCallbackAttr,"onOpened"),s.parse(up.layer.closeCallbackAttr,"onAccepted"),s.parse(up.layer.closeCallbackAttr,"onDismissed"),s.string("acceptEvent"),s.string("dismissEvent"),s.string("acceptLocation"),s.string("dismissLocation"),s.booleanOrString("history"),s.include(up.status.statusOptions),s.booleanOrString("focus"),s.boolean("saveScroll"),s.boolean("saveFocus"),s.booleanOrString("scroll"),s.boolean("revealTop"),s.number("revealMax"),s.number("revealPadding"),s.number("revealSnap"),s.string("scrollBehavior"),s.booleanOrString("history"),s.booleanOrString("location"),s.booleanOrString("title"),s.boolean("metaTags"),s.booleanOrString("lang"),s.include(up.motion.motionOptions),n.guardEvent??=up.event.build("up:link:follow",{log:["Following link %o",e]}),n}function h(t,e){let n=function(t){if(!g(t))return"Will not preload an unsafe link"}(t=up.fragment.get(t));if(n)return Promise.reject(new up.Error(n));const i=up.event.build("up:link:preload",{log:["Preloading link %o",t]});return o(t,{abort:!1,abortable:!1,background:!0,cache:!0,...up.RenderOptions.NO_INPUT_INTERFERENCE,...up.RenderOptions.NO_PREVIEWS,...e,guardEvent:i,preload:!0})}function c(e,n={}){return t.normalizeMethod(n.method||e.getAttribute("up-method")||e.getAttribute("data-method"))}function l(t){return t=up.fragment.get(t),r.matches(t,"followSelectors")}function p(t){l(t)||t.setAttribute("up-follow","")}function f(t,e){if(t.defaultPrevented)return!1;const n=`a, [up-follow], ${up.form.fieldSelector()}`,i=t.target.closest(n);return!i||i===e}function d(t){const e=t.closest(r.selector("instantSelectors"));return e&&(n=e,!(r.matches(n,"noInstantSelectors")||r.matches(n,"noFollowSelectors")));var n}function m(t){let e=["clientX","clientY","button",...up.event.keyModifiers];const n=up.event.fork(t,"up:click",e);up.emit(t.target,n,{log:!1})}function g(t){const e=c(t);return up.network.isSafeMethod(e)}function y(t,n,i){switch(t){case"insert":i();break;case"reveal":{let t=e.numberAttr(n,"up-intersect-margin");up.fragment.onFirstIntersect(n,i,{margin:t});break}case"hover":new up.LinkFollowIntent(n,i)}}function w(t,e){let n={navigate:!1,guardEvent:up.event.build("up:deferred:load",{log:["Loading deferred %o",t]}),...e};return o(t,n,{defaults:{target:":origin",cache:"auto",revalidate:"auto",feedback:!0}})}return up.macro(r.selectorFn("clickableSelectors"),(function(t){let n=t.matches("a, [up-follow]")?"link":"button";e.setMissingAttrs(t,{tabindex:"0",role:n,"up-clickable":""}),t.addEventListener("keydown",(function(e){if("Enter"===e.key||"button"===t.role&&"Space"===e.key)return m(e)}))})),up.attribute("up-defer",{defaultValue:"insert"},(function(t,e){y(e,t,(e=>up.error.muteUncriticalRejection(w(t,e))))})),up.on("up:click",r.selectorFn("followSelectors"),(function(t,e){f(t,e)&&(up.event.halt(t,{log:!0}),up.focus(e,{preventScroll:!0}),up.error.muteUncriticalRejection(o(e)))})),up.attribute("up-expand",{defaultValue:"a, [up-href]",macro:!0},(function(t,n){let i=e.get(t,n);i&&(e.setMissingAttrs(t,{"up-href":e.attr(i,"href"),...e.upAttrs(i)}),e.addClasses(t,e.upClasses(i)),p(t))})),up.compiler(r.selectorFn("preloadSelectors"),(function(n){if(!function(t){return!up.browser.canPushState()||!l(t)||!function(t){const e=u(t);if(e.url)return null==e.cache&&(e.cache="auto"),e.basic=!0,new up.Request(e).willCache()}(t)}(n)){let i=t=>up.error.muteUncriticalRejection(h(n,t)),s=e.booleanOrStringAttr(n,"up-preload");(!0===s||t.isUndefined(s))&&(s="hover"),y(s,n,i)}})),up.on("up:framework:reset",(function(){n=null})),{follow:o,followOptions:a,requestOptions:u,preload:h,makeFollowable:p,isSafe:g,isFollowable:l,shouldFollowEvent:f,convertClicks:function(t){t.on("click",(function(e,i){if(up.event.isUnmodified(e))return d(i)&&n?up.event.halt(e):("key"===up.event.inputDevice||up.event.isSyntheticClick(e)||t.wasHitByMouseEvent(e)&&(!n||n===e.target))&&m(e),n=null})),t.on("mousedown",(function(t,e){up.event.isUnmodified(t)&&(n=t.target,d(e)&&m(t))}))},config:r,loadDeferred:w}}(),up.follow=up.link.follow,up.deferred={load:up.link.loadDeferred}},4453:()=>{up.log=function(){const t=up.util,e=new up.LogConfig;function n(t,e,n,...s){i(t,e,"",n,...s)}function i(n,i,s,r,...o){r&&(e.format?console[n](`%c${i}%c ${r}`,"color: #666666; padding: 1px 3px; border: 1px solid #bbbbbb; border-radius: 2px; font-size: 90%; display: inline-block;"+s,"",...o):console[n](`[${i}] ${t.sprintf(r,...o)}`))}return up.on("up:framework:boot",(function(){if(!e.banner)return;const t=` __ _____ ___ ___ / /_ __\n/ // / _ \\/ _ \\/ _ \\/ / // / ${up.version}\n\\___/_//_/ .__/\\___/_/\\_. / \n / / / /\n\n`;let n="";up.migrate.loaded||(n+="Load unpoly-migrate.js to polyfill deprecated APIs.\n\n"),e.enabled?n+="Call `up.log.disable()` to disable logging for this session.":n+="Call `up.log.enable()` to enable logging for this session.";const i="color: #777777";e.format?console.log("%c"+t+"%c"+n,"font-family: monospace;"+i,i):console.log(t+n)})),{puts:function(...t){e.enabled&&n("log",...t)},putsEvent:function(t){if(e.enabled){let e="#5566cc";i("log",(t=t.originalEvent||t).type,`color: white; border-color: ${e}; background-color: ${e}`,"Interaction on %o",t.target)}},error:(...t)=>n("error",...t),warn:(...t)=>n("warn",...t),config:e,enable:function(){e.enabled=!0},disable:function(){e.enabled=!1}}}(),up.puts=up.log.puts,up.warn=up.log.warn},6535:()=>{up.migrate={config:{}}},8374:()=>{up.mockable=function(t){if(window.jasmine){let e=t.name,n={[e]:t},i=function(){return n[e].apply(this,arguments)};return i.mock=()=>spyOn(n,e),i}return t}},4034:()=>{up.motion=function(){const t=up.util,e=up.element;let n={},i={};const s=new up.MotionController("motion"),r=new up.Config((()=>({duration:175,easing:"ease",enabled:!matchMedia("(prefers-reduced-motion: reduce)").matches})));function o(e){return t.pickBy(e,"isDefault")}function u(){return r.enabled}function a(t,n,i){return c(i),u()&&!y(n)&&i.duration>0&&!e.isSingleton(t)}function h(t,e,n){return up.migrate.loaded&&(e=up.migrate.fixStyleProps(e)),n={...n,finishEvent:s.finishEvent},new up.CSSTransition(t,e,n).start()}function c(t){t.easing??=r.easing,t.duration??=r.duration}function l(e){if(!y(e)){if(t.isFunction(e))return e;if(t.isArray(e))return p(...e);if(t.isString(e)){let t;if(e.indexOf("/")>=0)return p(...e.split("/"));if(t=i[e])return l(t)}else up.fail("Unknown transition %o",e)}}function p(e,n){if(!y(e)&&!y(n)){const i=f(e)||t.asyncNoop,s=f(n)||t.asyncNoop;return(t,e,n)=>Promise.all([i(t,n),s(e,n)])}}function f(e){var i;if(!y(e))return t.isFunction(e)?e:t.isString(e)?n[i=e]||up.fail("Unknown animation %o",i):t.isOptions(e)?(t,n)=>h(t,e,n):void up.fail("Unknown animation %o",e)}const d=up.mockable((function(t,e){t.replaceWith(e)}));function m(t,e){const n=l(e);n.isDefault=up.framework.evaling,i[t]=n}function g(t,e){const i=f(e);i.isDefault=up.framework.evaling,n[t]=i}function y(t){return!t||"none"===t}function w(t,n,i){g(t,(function(t,s){return t.style.opacity=0,e.setStyle(t,{opacity:n}),h(t,{opacity:i},s)}))}function b(t,e){return{transform:`translate(${t}px, ${e}px)`}}function v(t){return e.setStyle(t,{transform:""}),t.getBoundingClientRect()}function _(t,n){const i=`move-from-${t}`;g(`move-to-${t}`,(function(t,e){const i=v(t);return h(t,n(i),e)})),g(i,(function(t,i){const s=v(t),r=n(s);return e.setStyle(t,r),h(t,{transform:""},i)}))}return up.on("up:framework:boot",(function(){u()||up.puts("up.motion","Animations are disabled")})),w("fade-in",0,1),w("fade-out",1,0),_("top",(function(t){return b(0,-(t.top+t.height))})),_("bottom",(function(t){return b(0,up.viewport.rootHeight()-t.top)})),_("left",(function(t){return b(-(t.left+t.width),0)})),_("right",(function(t){return b(up.viewport.rootWidth()-t.left,0)})),m("cross-fade",["fade-out","fade-in"]),m("move-left",["move-to-left","move-from-right"]),m("move-right",["move-to-right","move-from-left"]),m("move-up",["move-to-top","move-from-bottom"]),m("move-down",["move-to-bottom","move-from-top"]),up.on("up:framework:reset",(function(){s.reset(),n=o(n),i=o(i)})),{morph:function(n,i,r,o){c(o=t.options(o)),n=up.fragment.get(n),i=up.fragment.get(i);let u=l(r);const h=a(n,u,o);u=up.error.guardFn(u);const p=t.pluckKey(o,"beforeStart")||t.noop,f=t.pluckKey(o,"afterInsert")||t.noop,m=t.pluckKey(o,"beforeDetach")||t.noop,g=t.pluckKey(o,"afterDetach")||t.noop,y=t.pluckKey(o,"scrollNew")||t.noop;if(p(),h){if(s.isActive(n)&&!1===o.trackMotion)return u(n,i,o);up.puts("up.morph()","Morphing %o to %o with transition %O over %d ms",n,i,r,o.duration);const t=up.viewport.get(n),a=t.scrollTop,h=up.viewport.absolutize(n,{afterMeasure(){e.insertBefore(n,i),f()}}),c=async function(){y();const e=t.scrollTop;h.moveBounds(0,e-a),await u(n,i,o),m(),h.bounds.remove(),g()};return s.startFunction([n,i],c,o)}return m(),d(n,i),f(),g(),y(),Promise.resolve()},animate:function(n,i,r){n=up.fragment.get(n),r=t.options(r);let o=f(i);const u=a(n,i,r);if(o=up.error.guardFn(o),u){const t=()=>o(n,r);return s.startFunction(n,t,r)}return function(n,i){return t.isOptions(i)&&e.setStyle(n,i),Promise.resolve()}(n,i)},finish:function(t){return s.finish(t)},finishCount:()=>s.finishCount,transition:m,animation:g,config:r,isEnabled:u,isNone:y,willAnimate:a,swapElementsDirectly:d,motionOptions:function(e,n,i){n=t.options(n);let s=new up.OptionsParser(e,n,i);return s.booleanOrString("animation"),s.booleanOrString("transition"),s.string("easing"),s.number("duration"),n}}}(),up.transition=up.motion.transition,up.animation=up.motion.animation,up.morph=up.motion.morph,up.animate=up.motion.animate},1647:(t,e,n)=>{n(35);const i=up.util;up.network=function(){const t=new up.Config((()=>({concurrency:6,wrapMethod:!0,cacheSize:70,cacheExpireAge:15e3,cacheEvictAge:54e5,lateDelay:400,fail:t=>(t.status<200||t.status>299)&&304!==t.status,autoCache:t=>t.isSafe(),expireCache:(t,e)=>!t.isSafe(),evictCache:!1,progressBar:!0,timeout:9e4}))),e=new up.Request.Queue,n=new up.Request.Cache;let s=null;function r(s){(function(t){let i;if(t.willCache()&&(i=n.get(t)))return up.puts("up.request()","Re-using previous request to %s",t.description),t.background||e.promoteToForeground(i),i.mergeIfUnsent(t),n.track(i,t,{onIncompatible:r}),!0})(s)||function(s){(function(e){e.willCache()&&(n.put(e),e.onLoading=()=>n.reindex(e)),i.always(e,(function(s){let r=s.expireCache??e.expireCache??i.evalOption(t.expireCache,e,s);r&&n.expire(r,{except:e});let o=s.evictCache??e.evictCache??i.evalOption(t.evictCache,e,s);o&&n.evict(o,{except:e});let u=n.get(e),a=s instanceof up.Response,h=!a,c=a&&s.ok,l=a&&!s.ok,p=a&&s.none;l?n.evict(e.url):h||p?n.evict(e):c&&u&&n.put(e)}))})(s),e.asap(s)}(s)}function o(...t){up.migrate.preprocessAbortArgs?.(t),e.abort(...t)}return up.on("up:network:late",(function(){i.evalOption(t.progressBar)&&(s=new up.ProgressBar)})),up.on("up:network:recover",(function(){s?.conclude()})),up.on("up:framework:reset",(function(){o(),e.reset(),n.reset(),s?.destroy(),s=null})),{request:function(...t){const e=function(t){let e=i.parseArgIntoOptions(t,"url");return up.migrate.handleRequestOptions?.(e),e}(t),n=new up.Request(e);return r(n),n},cache:n,isBusy:function(){return e.isBusy()},isSafeMethod:function(t){return i.contains(["GET","OPTIONS","HEAD"],i.normalizeMethod(t))},config:t,abort:o,registerAliasForRedirect:function(t,e){if(t.cache&&e.url&&t.url!==e.url){const s=i.variant(t,{method:e.method,url:e.url,cacheRoute:null});n.alias(t,s)}},queue:e,loadPage:function(t){new up.Request(t).loadPage()}}}(),up.request=up.network.request,up.cache=up.network.cache},3535:()=>{up.protocol=function(){const t=up.util,e=up.element,n=function(t){return"X-Up"+t.replace(/(^.|[A-Z])/g,(t=>"-"+t.toUpperCase()))},i=function(e,i,s=t.identity){let r=e.getResponseHeader(n(i));if(r)return s(r)};function s(t){return"false"!==t&&t}const r=t.memoize((function(){return t.normalizeMethod(up.browser.popCookie("_up_method"))})),o=new up.Config((()=>({methodParam:"_method",csrfParam:()=>e.metaContent("csrf-param"),csrfToken:()=>e.metaContent("csrf-token"),cspNonce:()=>e.metaContent("csp-nonce"),csrfHeader:"X-CSRF-Token",maxHeaderSize:2048})));return{config:o,locationFromXHR:function(e){let n=i(e,"location")||e.responseURL;if(n)return t.normalizeURL(n)},titleFromXHR:function(e){return up.migrate.titleFromXHR?.(e)??i(e,"title",t.parseRelaxedJSON)},targetFromXHR:function(t){return i(t,"target")},methodFromXHR:function(e){return i(e,"method",t.normalizeMethod)},acceptLayerFromXHR:function(e){return i(e,"acceptLayer",t.parseRelaxedJSON)},contextFromXHR:function(e){return i(e,"context",t.parseRelaxedJSON)},dismissLayerFromXHR:function(e){return i(e,"dismissLayer",t.parseRelaxedJSON)},eventPlansFromXHR:function(e){return i(e,"events",t.parseRelaxedJSON)},expireCacheFromXHR:function(t){return i(t,"expireCache")||up.migrate.clearCacheFromXHR?.(t)},evictCacheFromXHR:function(t){return i(t,"evictCache",s)},csrfHeader:function(){return t.evalOption(o.csrfHeader)},csrfParam:function(){return t.evalOption(o.csrfParam)},csrfToken:function(){return t.evalOption(o.csrfToken)},cspNonce:function(){return t.evalOption(o.cspNonce)},initialRequestMethod:r,headerize:n,wrapMethod:function(t,e){return e.add(o.methodParam,t),"POST"},cspNoncesFromHeader:function(t){let e=[];if(t){let n=t.split(/\s*;\s*/);for(let t of n)if(0===t.indexOf("script-src")){let n,i=/'nonce-([^']+)'/g;for(;n=i.exec(t);)e.push(n[1])}}return e}}}()},9615:()=>{up.radio=function(){const t=up.element,e=new up.Config((()=>({hungrySelectors:["[up-hungry]"],noHungrySelectors:["[up-hungry=false]"],pollInterval:3e4})));return up.attribute("up-poll",(function(t){up.FragmentPolling.forFragment(t).onPollAttributeObserved()})),up.macro("[up-flashes]",(function(e){t.setMissingAttrs(e,{"up-hungry":"","up-if-layer":"subtree","up-keep":"",role:"alert"}),e.addEventListener("up:fragment:keep",(function(e){t.isEmpty(e.newFragment)||e.preventDefault()}))})),{config:e,hungrySteps:function(n){let{hungry:i,origin:s,layer:r,meta:o}=n,u={current:[],other:[]};if(!i)return u;let a=e.selector("hungrySelectors");const h=[r,...r.ancestors,...r.descendants];for(let e of h){let i=up.fragment.all(e.element,a,{layer:e});for(let a of i){let i=up.fragment.tryToTarget(a,{origin:s});if(!i){up.warn("[up-hungry]","Ignoring untargetable fragment %o",a);continue}let h=t.attr(a,"up-if-layer"),c=h?up.layer.getAll(h,{baseLayer:e}):[e],l={selector:i,oldElement:a,layer:e,origin:s,...up.motion.motionOptions(a),placement:"swap",keep:!0,maybe:!0,meta:o,selectEvent:up.event.build("up:fragment:hungry",{log:!1}),selectCallback:t.callbackAttr(a,"up-on-hungry",{exposedKeys:["newFragment","renderOptions"]}),originalRenderOptions:n};c.includes(r)&&(r===e?u.current:u.other).push(l)}}return u.other=up.fragment.compressNestedSteps(u.other),u},startPolling:function(t,e={}){up.FragmentPolling.forFragment(t).forceStart(e)},stopPolling:function(t){up.FragmentPolling.forFragment(t).forceStop()},pollOptions:function(t,n={}){const i=new up.OptionsParser(t,n,{defaults:{background:!0}});return i.number("interval",{default:e.pollInterval}),i.string("ifLayer",{default:"front"}),i.include(up.link.requestOptions),i.include(up.status.statusOptions),n}}}()},6774:()=>{!function(){const t=up.element;for(let e of["method","confirm"]){const n=`up-${e}`,i=`data-${e}`;up.macro(`a[${i}]`,(function(e){(window.Rails||window.jQuery?.rails)&&up.link.isFollowable(e)&&(t.setMissingAttr(e,n,e.getAttribute(i)),e.removeAttribute(i))}))}}()},1897:()=>{up.script=function(){const t=up.util,e=up.element,n=new up.Config((()=>({assetSelectors:["link[rel=stylesheet]","script[src]","[up-asset]"],noAssetSelectors:["[up-asset=false]"],nonceableAttributes:["up-watch","up-on-keep","up-on-hungry","up-on-opened","up-on-accepted","up-on-dismissed","up-on-loaded","up-on-rendered","up-on-finished","up-on-error","up-on-offline"],scriptSelectors:["script:not([type])",'script[type="text/javascript"]','script[type="module"]','script[type="importmap"]'],noScriptSelectors:['script[type="application/ld+json"]']}))),i={"[up-back]":-100,"[up-clickable]":-200,"[up-drawer]":-200,"[up-modal]":-200,"[up-cover]":-200,"[up-popup]":-200,"[up-tooltip]":-200,"[up-dash]":-200,"[up-flashes]":-200,"[up-expand]":-300,"[data-method]":-400,"[data-confirm]":-400};let s=[],r=[];function o(e,n={}){let o=function(e,n){let[i,s,r]=u(e);return s=t.options(s,{selector:i,isDefault:up.framework.evaling,priority:0,batch:!1}),Object.assign(r,s,n)}(e,n);o.macro?(up.framework.evaling&&(o.priority||=function(e){e=t.evalOption(e);for(let t in i)if(e.indexOf(t)>=0)return i[t];up.fail("Unregistered priority for system macro %o",e)}(o.selector)),a(r,o)):a(s,o)}const u=function(e){return t.args(e,"val","options","callback")};function a(t,e){let n,i=0;for(;(n=t[i])&&n.priority>=e.priority;)i+=1;if(t.splice(i,0,e),up.framework.booted)if(0===e.priority)for(let t of up.layer.stack)h(t.element,{layer:t,compilers:[e]});else up.puts("up.compiler()","Compiler %s was registered after booting Unpoly. Compiler will run for future fragments only.",e.selector);return e}function h(t,e){up.emit(t,"up:fragment:compile",{log:!1});let n=e.compilers||r.concat(s);new up.CompilerPass(t,n,e).run()}function c(t=document.head){return t.querySelectorAll(n.selector("assetSelectors"))}function l(t){t.type="up-disabled-script"}return up.on("up:framework:reset",(function(){s=t.filter(s,"isDefault"),r=t.filter(r,"isDefault")})),{config:n,compiler:function(...t){o(t)},macro:function(...t){o(t,{macro:!0})},attrCompiler:function(...n){let[i,s,r]=u(n),a=`[${i}]`,{defaultValue:h}=s;o([a,s,n=>{let s=e.booleanOrStringAttr(n,i);if(!1!==s)return t.isDefined(h)&&!0===s&&(s=h),r(n,s)}])},destructor:function(n,i){let s=t.scanFunctions(i);s.length&&(n.upDestructors||=function(n){let i=t.cleaner();return i(e.addClassTemp(n,"up-can-clean")),i}(n)).guard(s)},hello:function(t,e={}){return t=up.fragment.get(t,e),up.puts("up.hello()","Compiling fragment %o",t),h(t,e),up.fragment.emitInserted(t),t},clean:function(t,e={}){new up.DestructorPass(t,e).run()},data:function(n){return n=up.fragment.get(n),n.upData||=function(n){let i=e.jsonAttr(n,"up-data")??{};return t.isOptions(i)?{...n.upTemplateData,...n.dataset,...i,...n.upCompileData}:i}(n)},findAssets:c,assertAssetsOK:function(e,n){let i=c();t.map(i,"outerHTML").join()!==t.map(e,"outerHTML").join()&&up.event.assertEmitted("up:assets:changed",{oldAssets:i,newAssets:e,renderOptions:n})},disableSubtree:function(i){let s=n.selector("scriptSelectors");t.each(e.subtree(i,s),l)},isScript:function(t){return n.matches(t,"scriptSelectors")}}}(),up.compiler=up.script.compiler,up.destructor=up.script.destructor,up.macro=up.script.macro,up.data=up.script.data,up.hello=up.script.hello,up.attribute=up.script.attrCompiler},7791:()=>{up.status=function(){const t=up.util,e=up.element;let n={};const i=new up.Config((()=>({currentClasses:["up-current"],activeClasses:["up-active"],loadingClasses:["up-loading"],navSelectors:["[up-nav]","nav"],noNavSelectors:["[up-nav=false]"]}))),s="a, [up-href]";function r(t){return t.upCurrentURLs||=new up.LinkCurrentURLs(t)}function o(t,{layer:n}={}){n||=up.layer.get(t);let o=u(n);const a=i.selector("navSelectors"),h=`${a} :is(${s}), ${a}:is(${s})`,c=up.fragment.all(h,{layer:n});for(let t of c){const n=r(t).isCurrent(o);for(let e of i.currentClasses)t.classList.toggle(e,n);e.setAttrPresence(t,"aria-current","page",n)}}function u(e){return e.feedbackLocation||t.matchableURL(e.location)}function a(t){return e.ancestor(t,s)||t}function h(t){if(t)return function(e){e.showPlaceholder(t)}}function c(e){return t.isFunction(e)?[e]:t.isString(e)?(i=e,t.map(t.parseScalarJSONPairs(i),(([t,e])=>{let i=n[t]||up.fail('Unknown preview "%s"',t);return function(n,s){return up.puts("[up-preview]","Showing preview %o",t),i(n,e||s)}}))):t.isArray(e)?e.flatMap(c):[];var i}function l(t){const e=t.feedbackLocation,n=u(t.location);e&&e===n||(t.feedbackLocation=n,o(t.element,{layer:t}))}return up.on("up:location:changed",(t=>{!function(){const t=up.layer.front;t.showsLiveHistory()&&l(t)}()})),up.on("up:fragment:compile",((t,e)=>{o(e)})),up.on("up:layer:location:changed",(t=>{l(t.layer)})),up.on("up:framework:reset",(function(){up.layer.root.feedbackLocation=null,n=t.pickBy(n,"isDefault")})),{config:i,preview:function(t,e){e.isDefault=up.framework.evaling,n[t]=e},resolvePreviewFns:c,runPreviews:function(n,s){let{bindLayer:r}=n,o=up.FocusCapsule.preserve(r),u=r.asCurrent((()=>function(n,s){let{fragment:r,fragments:o,origin:u}=n,l=t.cleaner(),p=t=>new up.Preview({fragment:t,request:n,renderOptions:s,cleaner:l}),f=p(r);f.run(c(s.preview)),f.run(h(s.placeholder)),f.run(function(e,n){if(e)return function(e){e.addClassBatch(function({origin:e,activeElements:n}){return n||=t.wrapList(e),n.map(a)}(e.renderOptions),i.activeClasses),e.addClassBatch(n,i.loadingClasses)}}(s.feedback,o)),f.run(up.form.getDisablePreviewFn(s.disable,u));for(let t of o){let n=p(t);n.run(e.matchSelectorMap(s.previewMap,t)),n.run(e.matchSelectorMap(s.placeholderMap,t).flatMap(h))}return l.clean}(n,s)));return up.on("focusin",{once:!0},(()=>o=null)),()=>{r.asCurrent(u),o?.restore(r,{preventScroll:!0})}},statusOptions:function(e,n,i){n=t.options(n);const s=new up.OptionsParser(e,n,i);return s.booleanOrString("disable"),s.boolean("feedback"),s.string("preview"),s.booleanOrString("revalidatePreview"),s.string("placeholder"),n}}}(),up.preview=up.status.preview},7924:()=>{up.util=function(){function t(){}function e(t,e){e=P(e,{host:"cross-domain"});const n=o(t);let i="";"cross-domain"===e.host&&(e.host=r(n)),e.host&&(i+=n.protocol+"//"+n.host);let{pathname:s}=n;return!1===e.trailingSlash&&"/"!==s&&(s=s.replace(/\/$/,"")),i+=s,!1!==e.search&&(i+=n.search),!1!==e.hash&&(i+=n.hash),i}function n(t,n){if(t)return e(t,{hash:!1,trailingSlash:!1,...n})}const i=location.protocol,s=location.hostname;function r(t){if(w(t)&&-1===t.indexOf("//"))return!1;const e=o(t);return s!==e.hostname||i!==e.protocol}function o(t){if(t.pathname)return t;let e=document.createElement("a");return e.href=t,e}function u(t){return w(t)?e=>e[t]:t}function a(t,e){if(0===t.length)return[];e=u(e);let n=[],i=0;for(let s of t)n.push(e(s,i++));return n}function h(t,e){let n=0;for(let i of t)e(i,n++)}function c(t){return null===t}function l(t){return void 0===t}const p=nt(l);function f(t){return l(t)||c(t)}const d=nt(f);function m(t){return!!f(t)||(_(t)&&t[m.key]?t[m.key]():w(t)||O(t)?0===t.length:!!v(t)&&0===Object.keys(t).length)}m.key="up.util.isBlank";const g=nt(m);function y(t){return"function"==typeof t}function w(t){return"string"==typeof t||t instanceof String}function b(t){return"number"==typeof t||t instanceof Number}function v(t){return"object"==typeof t&&!c(t)&&(l(t.constructor)||t.constructor===Object)}function _(t){const e=typeof t;return"object"===e&&!c(t)||"function"===e}function k(t){return t instanceof Element}function S(t){return t instanceof RegExp}function x(t){return up.browser.canJQuery()&&t instanceof jQuery}const{isArray:E}=Array;function O(t){return E(t)||function(t){return t instanceof NodeList}(t)||function(t){return"[object Arguments]"===Object.prototype.toString.call(t)}(t)||x(t)||function(t){return t instanceof HTMLCollection}(t)}function C(t){return O(t)?t:f(t)?[]:[t]}function F(t){return _(t)&&t[F.key]?t=t[F.key]():O(t)?t=T(t):v(t)&&(t=Object.assign({},t)),t}function T(t){return Array.prototype.slice.call(t)}function R(...t){return Object.assign({},...t)}function P(t,e){return e?R(e,t):t?F(t):{}}function L(t,e){e=u(e);let n=0;for(let i of t){const t=e(i,n++);if(t)return t}}function A(t,e){e=u(e);let n=!0,i=0;for(let s of t)if(!e(s,i++)){n=!1;break}return n}function $(t){return D(t,d)}function D(t,e){e=u(e);const n=[];return h(t,(function(t,i){if(e(t,i))return n.push(t)})),n}function M(t){return t[t.length-1]}function N(t,e){return(t.indexOf||Array.prototype.indexOf).call(t,e)>=0}function H(t,e){const n={};for(let i of e)i in t&&(n[i]=t[i]);return n}function j(t,e){e=u(e);const n={};for(let i in t)e(t[i],i,t)&&(n[i]=t[i]);return n}function q(t,...e){return y(t)?t(...e):t}F.key="up.util.copy",Date.prototype[F.key]=function(){return new Date(+this)};const B={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"};function U(t,e){const n=t[e];return delete t[e],n}function I(t,e){if(e(M(t)))return t.pop()}function z(t){return I(t,y)}function K(t){return I(t,v)||{}}function V(t){return t}function X(t){const e=[];for(let n of t)O(n)?e.push(...n):e.push(n);return e}function W(t,e){if(t?.valueOf&&(t=t.valueOf()),e?.valueOf&&(e=e.valueOf()),typeof t!=typeof e)return!1;if(O(t)&&O(e))return G(t,e);if(_(t)&&t[W.key])return t[W.key](e);if(v(t)&&v(e)){const n=Object.keys(t);return!!G(n,Object.keys(e))&&A(n,(n=>W(t[n],e[n])))}return t===e}function G(t,e){return t.length===e.length&&A(t,((t,n)=>W(t,e[n])))}function J(t,e){return(up.migrate.splitAtOr?.(t)||t.split(e)).map((t=>t.trim())).filter(V)}function Q(t){let{masked:e,restore:n}=ct(t);return{maskedTokens:J(e,","),restore:n}}W.key="up.util.isEqual";let Y=0;function Z(t,e,n){for(let i of e)Object.defineProperty(t,i,{get(){const t=n.call(this);let e=t[i];return y(e)&&(e=e.bind(t)),e},set(t){n.call(this)[i]=t}})}function tt(t,e="%o"){let n;if("%c"===e)return"";if("%s"===e&&d(t)&&(t=t.toString()),w(t))n=t.trim().replace(/[\n\r\t ]+/g," "),"%o"===e&&(n=JSON.stringify(n));else if(l(t))n="undefined";else if(b(t)||y(t))n=t.toString();else if(E(t))n=`[${a(t,tt).join(", ")}]`;else if(x(t))n=`$(${a(t,tt).join(", ")})`;else if(k(t)){n=`<${t.tagName.toLowerCase()}`;for(let e of["id","up-id","name","class"]){let i=t.getAttribute(e);i&&(n+=` ${e}="${i}"`)}n+=">"}else if(S(t)||t instanceof Error)n=t.toString();else try{n=JSON.stringify(t)}catch(t){if("TypeError"!==t.name)throw t;n="(circular structure)"}return n.length>200&&(n=`${n.substr(0,200)}…${M(n)}`),n}const et=/%[oOdisfc]/g;function nt(t){return function(...e){return!t(...e)}}function it(t){if(t.error)throw t.error;return t.value}function st(t,e,n){try{return{value:t.apply(e,n)}}catch(t){return{error:t}}}function rt(t,...e){let n=[];for(;e.length;){let i=e.pop();if("options"===i)n.unshift(K(t));else if("callback"===i)n.unshift(z(t));else if("val"===i)n.unshift(t.pop());else if(y(i)){let e=i(M(t))?t.pop():void 0;n.unshift(e)}}return n}function ot(...t){return t.flat().filter(y)}function ut(t,e,{keepDelimiters:n=!1}={}){let i=0,s=/§(\d+)/g,r=[],o=0;return[s,...e].forEach((e=>{let s=!1;t=t.replaceAll(e,(function(t){s=!0;let e,o,u="§"+i++;if(n){let n=t[0],i=t.slice(-1);o=t.slice(1,-1),e=n+u+i}else o=t,e=u;return r.push(o),e})),s&&o++})),{masked:t,restore:(t,e=V)=>{for(let n=0;n<o;n++)t=t.replace(s,((t,n)=>e(r[n])));return t}}}const at=/'(?:\\\\|\\'|[^'])*'|"(?:\\\\|\\"|[^"])*"/g,ht=/{(?:[^{}]|{[^{}]*})*}|\((?:[^\(\)]|\([^\(\)]*\))*\)|\[(?:[^\[\]]|\[[^\[\]]*\])*\]/g;function ct(t){return ut(t,[at,ht],{keepDelimiters:!0})}function lt(t){return'"'===t[0]?t:'"'+(t=t.slice(1,-1)).replace(/(\\\\)|(\\')|(\\")|(")/g,(function(t,e,n,i){return e||n&&"'"||'\\"'}))+'"'}function pt(t){let{masked:e,restore:n}=ut(t,[at]);return e=e.replace(/([a-z_$][\w$]*:)/gi,(t=>'"'+t.slice(0,-1)+'":')),e=e.replace(/,\s*([}\]])/g,"$1"),e=n(e,lt),JSON.parse(e)}return{parseURL:o,normalizeURL:e,matchableURL:n,matchableURLPatternAtom:function(t){return t.endsWith("/")?[t,t.slice(0,-1)]:t.includes("/?")?[t,t.replace("/?","?")]:t.endsWith("/*")?[t,t.slice(0,-2),t.slice(0,-2)+"?*"]:t},matchURLs:function(t,e,i){return n(t,i)===n(e,i)},normalizeMethod:function(t){return t?t.toUpperCase():"GET"},methodAllowsPayload:function(t){return"GET"!==t&&"HEAD"!==t},copy:F,merge:R,mergeDefined:function(...t){const e={};for(let n of t)if(n)for(let t in n){const i=n[t];p(i)&&(e[t]=i)}return e},options:P,parseArgIntoOptions:function(t,e){let[n,i]=rt(t,"val","options");return p(n)&&(i[e]=n),i},each:h,map:a,flatMap:function(t,e){return X(a(t,e))},mapObject:function(t,e){return a(t,e).reduce((function(t,e){return t[e[0]]=e[1],t}),{})},findResult:L,some:function(t,e){return!!L(t,e)},every:A,find:function(t,e){let n;e=u(e);for(let i of t)if(e(i)){n=i;break}return n},filter:D,reject:function(t,e){return D(t,e=nt(u(e)))},intersect:function(t,e){return D(t,(t=>N(e,t)))},compact:$,compactObject:function(t){return j(t,d)},uniq:function(t){return t.length<2?t:Array.from(new Set(t))},uniqBy:function(t,e){if(t.length<2)return t;e=u(e);const n=new Set;return D(t,(function(t,i){const s=e(t,i);return!n.has(s)&&(n.add(s),!0)}))},last:M,isNull:c,isDefined:p,isUndefined:l,isGiven:d,isMissing:f,isPresent:g,isBlank:m,presence:function(t,e=g){if(e(t))return t},isObject:_,isFunction:y,isString:w,isBoolean:function(t){return"boolean"==typeof t||t instanceof Boolean},isNumber:b,isElement:k,isTextNode:function(t){return t instanceof Text},isJQuery:x,isElementLike:function(t){return!(!t||!(t.addEventListener||x(t)&&t[0]?.addEventListener))},isPromise:function(t){return _(t)&&y(t.then)},isOptions:v,isArray:E,isFormData:function(t){return t instanceof FormData},isList:O,isRegExp:S,isAdjacentPosition:function(t){return/^(before|after)/.test(t)},timer:function(t,e){return setTimeout(e,t)},contains:N,containsAll:function(t,e){return A(e,(e=>N(t,e)))},objectContains:function(t,e){return W(e,H(t,Object.keys(e)))},toArray:function(t){return E(t)?t:T(t)},pick:H,pickBy:j,omit:function(t,e){return j(t,((t,n)=>!N(e,n)))},unresolvablePromise:function(){return new Promise(t)},remove:function(t,e){const n=t.indexOf(e);if(n>=0)return t.splice(n,1),e},memoize:function(t){let e,n;return function(...i){return n?e:(n=!0,e=t.apply(this,i))}},pluckKey:U,renameKey:function(t,e,n){e in t&&(t[n]=U(t,e))},extractOptions:K,extractCallback:z,noop:t,asyncNoop:function(){return Promise.resolve()},identity:V,escapeHTML:function(t){return t.replace(/[&<>"']/g,(t=>B[t]))},escapeRegExp:function(t){return t.replace(/[\\^$*+?.()|[\]{}]/g,"\\$&")},sequence:function(t){return t=$(t),(...e)=>a(t,(t=>t(...e)))},evalOption:q,evalAutoOption:function(t,e,...n){return"auto"===(t=q(t,...n))&&(t=q(e,...n)),t},flatten:X,newDeferred:function(){let t,e;const n=new Promise((function(n,i){t=n,e=i}));return n.resolve=t,n.reject=e,n},always:function(t,e=V){return t.then(e,e)},isBasicObjectProperty:function(t){return Object.prototype.hasOwnProperty(t)},isCrossOrigin:r,task:function(t){return setTimeout(t)},isEqual:W,getSimpleTokens:function(t,{json:e=!1,separator:n=/[,\s]/}={}){return w(t)?e&&/^\[.*]$/.test(t)?pt(t):J(t,n):C(t)},getComplexTokens:function(t){if(w(t)){let{maskedTokens:e,restore:n}=Q(t);return e.map((t=>n(t)))}return C(t)},wrapList:C,wrapValue:function(t,...e){return e[0]instanceof t?e[0]:new t(...e)},uid:function(){return Y++},upperCaseFirst:function(t){return t[0].toUpperCase()+t.slice(1)},lowerCaseFirst:function(t){return t[0].toLowerCase()+t.slice(1)},delegate:Z,delegatePromise:function(t,e){return Z(t,["then","catch","finally"],(function(){return this[e]}))},reverse:function(t){return F(t).reverse()},camelToKebabCase:function(t){return t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))},sprintf:function(t,...e){return t.replace(et,(t=>tt(e.shift(),t)))},withRenamedKeys:function(t,e){const n={};for(let i in t){let s=e(i);d(s)&&(n[s]=t[i])}return n},memoizeMethod:function(t,e){for(let n in e){let e=Object.getOwnPropertyDescriptor(t,n).value,i=function(...t){let i=this[`__${n}MemoizeCache`]||={},s=JSON.stringify(t);return i[s]||=st(e,this,t),it(i[s])};t[n]=i}},safeStringifyJSON:function(t){return JSON.stringify(t).replace(/[^\x00-\x7F]/g,(t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0")))},variant:function(t,e={}){let n=Object.create(t);return Object.assign(n,e),n},cleaner:function(){let t=[],e=function(e,n){e=ot(...e).map(n),t.push(...ot(...e))},n=function(...t){e(t,V)};return n.guard=function(...t){e(t,up.error.guardFn)},n.clean=function(...e){let{length:n}=t;for(let i=n-1;i>=0;i--)t[i](...e);t=[]},n},scanFunctions:ot,args:rt,parseRelaxedJSON:pt,parseScalarJSONPairs:function(t){let{maskedTokens:e,restore:n}=Q(t);return e.map((t=>{let[e,i,s]=t.match(/([^{]+)({[^}]*})?/);return[n(i.trim()),s&&pt(n(s))]}))},maskPattern:ut,expressionOutline:ct,parseString:function(t){return JSON.parse(lt(t))}}}()},4606:(t,e,n)=>{n(5074),up.viewport=function(){const t=up.util,e=up.element,n=up.fragment,i=new up.Config((()=>({viewportSelectors:["[up-viewport]","[up-fixed]"],fixedTopSelectors:["[up-fixed~=top]"],fixedBottomSelectors:["[up-fixed~=bottom]"],anchoredRightSelectors:["[up-anchored~=right]","[up-fixed~=top]","[up-fixed~=bottom]","[up-fixed~=right]"],revealSnap:200,revealPadding:0,revealTop:!1,revealMax:()=>.5*window.innerHeight,autoFocusVisible:({element:t,inputDevice:e})=>"key"===e||up.form.isField(t)}))),s=new up.BodyShifter;up.compiler(i.selectorFn("anchoredRightSelectors"),(function(t){return s.onAnchoredElementInserted(t)}));const r=up.mockable((function(e,i){return i=t.options(i),e=n.get(e,i),(i.layer=up.layer.get(e))||up.fail("Cannot reveal a detached element"),i.peel&&i.layer.peel(),new up.RevealMotion(e,i).start(),up.migrate.formerlyAsync?.("up.reveal()")||!0}));function o(e,{preventScroll:n,force:s,inputDevice:o,focusVisible:a}={}){if(s&&(e.hasAttribute("tabindex")||-1!==e.tabIndex||e.setAttribute("tabindex","-1")),o??=up.event.inputDevice,a??="auto",a=t.evalAutoOption(a,i.autoFocusVisible,{element:e,inputDevice:o}),e.focus({preventScroll:!0,focusVisible:a}),u(e),e.classList.add(a?"up-focus-visible":"up-focus-hidden"),!n)return r(e)}function u(t){t?.classList.remove("up-focus-hidden","up-focus-visible")}function a(t=location.hash,e){let n=y(t,e);if(n)return r(n,{top:!0})}function h(){return[p().tagName,...i.viewportSelectors].join()}function c(t,e={}){return n.get(t,e).closest(h())}function l(t,i={}){return t=n.get(t,i),e.around(t,h())}function p(){return document.scrollingElement}function f(){return e.root.clientWidth}function d(t){return up.fragment.tryToTarget(t)}function m(e){const[i,s]=t.args(e,"val","options");let r;return s.layer=up.layer.get(s),r=i?[c(i,s)]:s.around?l(s.around,s):function(t={}){return n.all(h(),t)}(s),[r,s]}function g(t,e){for(let n of t){const t=d(n);n.scrollTop=e[t]||0}}function y(t,i={}){if(s=t,t=s?.replace(/^#/,"")){const s=[e.idSelector(t),"a"+e.attrSelector("name",t)].join();return n.get(s,i)}var s}up.on("focusin",(function({relatedTarget:t}){u(t)}));const w=["selectionStart","selectionEnd","scrollLeft","scrollTop"];return document.addEventListener("DOMContentLoaded",(function(){a(),t.task(a)})),up.on(window,"hashchange",(()=>a())),up.on("up:click",'a[href^="#"]',(function(t,e){e.hash===location.hash&&(up.link.isFollowable(e)||a(e.hash)&&up.event.halt(t))})),{reveal:r,revealHash:a,firstHashTarget:y,config:i,get:c,subtree:function(t,i={}){return t=n.get(t,i),e.subtree(t,h())},around:l,get root(){return p()},rootWidth:f,rootHeight:function(){return e.root.clientHeight},isRoot:function(t){return t===p()},rootScrollbarWidth:function(){return window.innerWidth-f()},saveScroll:function(...t){const[e,n]=m(t),i=n.location||n.layer.location;if(i){const t=function(t){let e={};for(let n of t){let t=d(n);t?e[t]=n.scrollTop:up.warn("up.viewport.saveScroll()","Cannot save scroll positions for untargetable viewport %o",n)}return e}(e);n.layer.lastScrollTops.set(i,t)}},restoreScroll:function(...t){const[e,n]=m(t),{location:i}=n.layer,s=n.layer.lastScrollTops.get(i);return!!s&&(g(e,s),up.puts("up.viewport.restoreScroll()","Restored scroll positions to %o",s),!0)},resetScroll:function(...t){const[e,n]=m(t);g(e,{})},saveFocus:function(t={}){const e=up.layer.get(t),n=t.location||e.location;if(n){const t=up.FocusCapsule.preserve(e);e.lastFocusCapsules.set(n,t)}},restoreFocus:function(t={}){const e=up.layer.get(t),n=t.location||e.location,i=t.layer.lastFocusCapsules.get(n);return!(!i||!i.restore(e)||(up.puts("up.viewport.restoreFocus()",'Restored focus to "%s"',i.target),0))},absolutize:function(n,s={}){const r=c(n).getBoundingClientRect(),o=n.getBoundingClientRect(),u=new up.Rect({left:o.left-r.left,top:o.top-r.top,width:o.width,height:o.height});s.afterMeasure?.(),e.setStyle(n,{position:"static"===n.style.position?"static":"relative",top:"auto",right:"auto",bottom:"auto",left:"auto",width:"100%",height:"100%"});const a=e.createFromSelector("up-bounds");e.insertBefore(n,a),a.appendChild(n);const h=function(t,n){return u.left+=t,u.top+=n,e.setStyle(a,u,"px")};h(0,0);const l=n.getBoundingClientRect();return h(o.left-l.left,o.top-l.top),t.each(function(t=document){const e=["[up-fixed]"].concat(i.fixedTopSelectors).concat(i.fixedBottomSelectors);return t.querySelectorAll(e.join())}(n),e.fixedToAbsolute),{bounds:a,moveBounds:h}},focus:o,tryFocus:function(t,e){return o(t,e),t===document.activeElement},newStateCache:function(){return new up.FIFOCache({capacity:30,normalizeKey:t.matchableURL})},focusedElementWithin:function(t){const e=document.activeElement;if(up.fragment.contains(t,e))return e},copyCursorProps:function(t,e={}){for(let n of w)try{e[n]=t[n]}catch(t){}return e},bodyShifter:s}}(),up.focus=up.viewport.focus,up.reveal=up.viewport.reveal},3507:()=>{window.up={version:"3.10.0"}}},e={};function n(i){var s=e[i];if(void 0!==s)return s.exports;var r=e[i]={exports:{}};return t[i](r,r.exports,n),r.exports}n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"Ru",{value:!0})},n(3507),n(8374),n(7924),n(3924),n(6535),n(2811),n(9675),n(376),n(8272),n(4366),n(8010),n(4861),n(3469),n(4504),n(2406),n(3742),n(1653),n(1104),n(5949),n(1279),n(6346),n(3030),n(7948),n(2714),n(8228),n(7050),n(9441),n(9489),n(7422),n(2200),n(278),n(9005),n(1569),n(2737),n(3635),n(1906),n(4158),n(3139),n(2214),n(5240),n(665),n(2828),n(2587),n(7031),n(8057),n(4850),n(7956),n(7403),n(6412),n(7965),n(7771),n(86),n(4552),n(5580),n(7101),n(6066),n(6387),n(3698),n(2460),n(7792),n(4308),n(8665),n(3645),n(8397),n(7782),n(2705),n(606),n(5437),n(7974),n(6413),n(5221),n(2298),n(4517),n(7241),n(2723),n(8720),n(7885),n(4818),n(9634),n(8670),n(3535),n(4453),n(1897),n(8944),n(2667),n(4606),n(4034),n(1647),n(9443),n(3849),n(2851),n(7791),n(9615),n(6774),up.framework.onEvaled()})();