unpoly-rails 2.7.2.2 → 3.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- (()=>{var t={5941:()=>{},7433:()=>{},7921:()=>{},7298:()=>{},2903:()=>{},573:()=>{},2811:()=>{up.browser={submitForm:function(t){t.submit()},canPushState:function(){return"GET"===up.protocol.initialRequestMethod()},canJQuery:function(){return!!window.jQuery},canEval:up.util.memoize((function(){try{return new Function("return true")()}catch(t){return!1}})),assertConfirmed:function(t){if(t.confirm&&!window.confirm(t.confirm))throw new up.Aborted("User canceled action");return!0},popCookie:function(t){var e;let n=null===(e=document.cookie.match(new RegExp(t+"=(\\w+)")))||void 0===e?void 0:e[1];if(n)return document.cookie=t+"=;Max-Age=0;Path=/",n}}},6346:()=>{const t=up.element;up.BodyShifter=class{constructor(){this.unshiftFns=[],this.reset()}reset(){this.unshiftNow(),this.shiftCount=0}shift(){if(this.shiftCount++,this.shiftCount>1)return;const e=up.viewport.rootHasReducedWidthFromScrollbar(),n=up.viewport.rootOverflowElement();if(this.changeStyle(n,{overflowY:"hidden"}),!e)return;const{body:r}=document,i=up.viewport.scrollbarWidth(),s=i+t.styleNumber(r,"paddingRight");this.changeStyle(r,{paddingRight:s});for(let e of up.viewport.anchoredRight()){const n=i+t.styleNumber(e,"right");this.changeStyle(e,{right:n})}}changeStyle(e,n){this.unshiftFns.push(t.setTemporaryStyle(e,n))}unshift(){this.shiftCount--,0==this.shiftCount&&this.unshiftNow()}unshiftNow(){let t;for(;t=this.unshiftFns.pop();)t()}}},3115:()=>{const t=up.util;up.Cache=class{constructor(t={}){this.config=t,this.map=new Map}size(){return this.map.size}maxSize(){return t.evalOption(this.config.size)}evictAge(){return t.evalOption(this.config.evictAge)}normalizeStoreKey(t){return t}isDisabled(){return 0===this.maxSize()||0===this.evictAge()}evict(){this.map.clear()}records(){return this.map.values()}makeRoomForAnotherRecord(){const t=this.maxSize(),e=this.size();if(!t||e<t)return;let n=Array.from(this.records());n.sort(((t,e)=>e.createdAt-t.createdAt));const r=e-t+1;for(let t=0;t<r;t++){let t=n.pop().key;this.map.delete(t)}}alias(e,n){const r=this.get(e);t.isDefined(r)&&this.set(n,r)}set(t,e){if(this.isDisabled())return;this.makeRoomForAnotherRecord();const n={key:t=this.normalizeStoreKey(t),value:e,createdAt:new Date};this.map.set(t,n)}remove(t){t=this.normalizeStoreKey(t),this.map.delete(t)}isUsable(t){const e=this.evictAge();return!e||new Date-t.createdAt<e}get(t){const e=this.normalizeStoreKey(t);let n=this.map.get(e);if(n){if(this.isUsable(n))return n.value;this.remove(t)}}}},7948:()=>{const t=up.util,e=up.element;up.Change.Addition=class extends up.Change{constructor(t){super(t),this.responseDoc=t.responseDoc,this.acceptLayer=t.acceptLayer,this.dismissLayer=t.dismissLayer,this.eventPlans=t.eventPlans||[]}handleLayerChangeRequests(){this.layer.isOverlay()&&(this.tryAcceptLayerFromServer(),this.abortWhenLayerClosed(),this.layer.tryAcceptForLocation(),this.abortWhenLayerClosed(),this.tryDismissLayerFromServer(),this.abortWhenLayerClosed(),this.layer.tryDismissForLocation(),this.abortWhenLayerClosed()),this.layer.asCurrent((()=>{for(let t of this.eventPlans)up.emit(t),this.abortWhenLayerClosed()}))}tryAcceptLayerFromServer(){t.isDefined(this.acceptLayer)&&this.layer.isOverlay()&&this.layer.accept(this.acceptLayer)}tryDismissLayerFromServer(){t.isDefined(this.dismissLayer)&&this.layer.isOverlay()&&this.layer.dismiss(this.dismissLayer)}abortWhenLayerClosed(){if(this.layer.isClosed())throw new up.Aborted("Layer was closed")}setSource({oldElement:n,newElement:r,source:i}){"keep"===i&&(i=n&&up.fragment.source(n)),i&&e.setMissingAttr(r,"up-source",t.normalizeURL(i,{hash:!1}))}setTime({newElement:t,time:n}){e.setMissingAttr(t,"up-time",!!n&&n.toUTCString())}setETag({newElement:t,etag:n}){e.setMissingAttr(t,"up-etag",n||!1)}setReloadAttrs(t){this.setSource(t),this.setTime(t),this.setETag(t)}}},3030:()=>{const t=up.util;up.Change=class{constructor(t){this.options=t}cannotMatch(t){throw new up.CannotMatch(t)}execute(){throw new up.NotImplemented}onFinished(t){var e,n;return null===(n=(e=this.options).onFinished)||void 0===n?void 0:n.call(e,t)}improveHistoryValue(e,n){return!1===e||t.isString(e)?e:n}}},7422:()=>{const t=up.util;up.Change.CloseLayer=class extends up.Change.Removal{constructor(t){var e;super(t),this.verb=t.verb,this.layer=up.layer.get(t),this.origin=t.origin,this.value=t.value,this.preventable=null===(e=t.preventable)||void 0===e||e}execute(){if(!this.layer.isOpen())return Promise.resolve();if(up.browser.assertConfirmed(this.options),this.emitCloseEvent().defaultPrevented&&this.preventable)throw new up.Aborted("Close event was prevented");up.fragment.abort({reason:"Layer is closing",layer:this.layer});const{parent:t}=this.layer;this.layer.peel(),this.layer.stack.remove(this.layer),t.restoreHistory(),this.handleFocus(t),this.layer.teardownHandlers(),this.layer.destroyElements(this.options),this.emitClosedEvent(t)}emitCloseEvent(){let e=this.layer.emit(this.buildEvent(`up:layer:${this.verb}`),{callback:this.layer.callback(`on${t.upperCaseFirst(this.verb)}`),log:[`Will ${this.verb} ${this.layer} with value %o`,this.value]});return this.value=e.value,e}emitClosedEvent(e){const n=`${this.verb}ed`,r=t.upperCaseFirst(n);return this.layer.emit(this.buildEvent(`up:layer:${n}`),{baseLayer:e,callback:this.layer.callback(`on${r}`),ensureBubbles:!0,log:[`${r} ${this.layer} with value %o`,this.value]})}buildEvent(t){return up.event.build(t,{layer:this.layer,value:this.value,origin:this.origin})}handleFocus(t){var e;this.layer.overlayFocus.teardown(),null===(e=t.overlayFocus)||void 0===e||e.moveToFront(),(this.layer.origin||t.element).focus({preventScroll:!0})}}},8228:function(){var t=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,s){function o(t){try{u(r.next(t))}catch(t){s(t)}}function a(t){try{u(r.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}u((r=r.apply(t,e||[])).next())}))};up.Change.DestroyFragment=class extends up.Change.Removal{constructor(t){super(t),this.layer=up.layer.get(t)||up.layer.current,this.element=this.options.element,this.animation=this.options.animation,this.log=this.options.log}execute(){return t(this,void 0,void 0,(function*(){this.parent=this.element.parentNode,up.fragment.markAsDestroying(this.element),up.motion.willAnimate(this.element,this.animation,this.options)?(this.emitDestroyed(),yield this.animate(),this.wipe(),this.onFinished()):(this.wipe(),this.emitDestroyed(),this.onFinished())}))}animate(){return up.motion.animate(this.element,this.animation,this.options)}wipe(){this.layer.asCurrent((()=>{up.fragment.abort(this.element),up.syntax.clean(this.element,{layer:this.layer}),up.element.cleanJQuery(this.element),this.element.remove()}))}emitDestroyed(){up.fragment.emitDestroyed(this.element,{parent:this.parent,log:this.log})}}},9005:()=>{var t;const e=up.util;up.Change.FromContent=(t=class extends up.Change{constructor(t){super(t),this.layers=e.filter(up.layer.getAll(this.options),this.isRenderableLayer),this.origin=this.options.origin,this.preview=this.options.preview,this.mode=this.options.mode,this.origin&&(this.originLayer=up.layer.get(this.origin))}isRenderableLayer(t){return"new"===t||t.isOpen()}getPlans(){var t;let e=[];return this.options.fragment&&((t=this.options).target||(t.target=this.getResponseDoc().rootSelector())),this.expandIntoPlans(e,this.layers,this.options.target),this.expandIntoPlans(e,this.layers,this.options.fallback),e}expandIntoPlans(t,e,n){for(let r of e)for(let e of this.expandTargets(n,r)){const n=Object.assign(Object.assign({},this.options),{target:e,layer:r,defaultPlacement:this.defaultPlacement()}),i="new"===r?new up.Change.OpenLayer(n):new up.Change.UpdateLayer(n);t.push(i)}}expandTargets(t,e){return up.fragment.expandTargets(t,{layer:e,mode:this.mode,origin:this.origin})}execute(){return this.options.preload?Promise.resolve():this.seekPlan(this.executePlan.bind(this))||this.cannotMatchPostflightTarget()}executePlan(t){let e=t.execute(this.getResponseDoc(),this.onPlanApplicable.bind(this,t));return e.options=this.options,e}onPlanApplicable(t){let e=this.getPlans()[0];t!==e&&up.puts("up.render()",'Could not match primary target "%s". Updating a fallback target "%s".',e.target,t.target)}getResponseDoc(){var t,n;if(this.preview)return;const r=e.pick(this.options,["target","content","fragment","document","html","cspNonces","origin"]);return null===(n=(t=up.migrate).handleResponseDocOptions)||void 0===n||n.call(t,r),"content"===this.defaultPlacement()&&(r.target=this.firstExpandedTarget(r.target)),new up.ResponseDoc(r)}defaultPlacement(){if(!this.options.document&&!this.options.fragment)return"content"}firstExpandedTarget(t){return this.expandTargets(t||":main",this.layers[0])[0]}getPreflightProps(t={}){return this.seekPlan((t=>t.getPreflightProps()))||t.optional||this.cannotMatchPreflightTarget()}cannotMatchPreflightTarget(){this.cannotMatchTarget("Could not find target in current page")}cannotMatchPostflightTarget(){this.cannotMatchTarget("Could not find common target in current page and response")}cannotMatchTarget(t){if(this.getPlans().length){const n=e.uniq(e.map(this.getPlans(),"target")),r=up.layer.optionToString(this.options.layer);up.fail(t+" (tried selectors %o in %s)",n,r)}else this.layers.length?this.options.failPrefixForced?up.fail("No target selector given for failed responses (https://unpoly.com/failed-responses)"):up.fail("No target selector given"):up.fail("Layer %o does not exist",this.options.layer)}seekPlan(t){for(let e of this.getPlans())try{return t(e)}catch(t){if(!(t instanceof up.CannotMatch))throw t}}},e.memoizeMethod(t.prototype,["getPlans","getResponseDoc","getPreflightProps"]),t)},2200:function(){var t,e=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,s){function o(t){try{u(r.next(t))}catch(t){s(t)}}function a(t){try{u(r.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}u((r=r.apply(t,e||[])).next())}))};const n=up.util;up.Change.FromURL=(t=class extends up.Change{constructor(t){super(t),this.options.layer=up.layer.getAll(this.options),this.options.normalizeLayerOptions=!1}execute(){var t,e;let r=this.newPageReason();return r?(up.puts("up.render()",r),up.network.loadPage(this.options),n.unresolvablePromise()):(this.request=up.request(this.getRequestAttrs()),null===(e=(t=this.options).onRequest)||void 0===e||e.call(t,this.request),up.feedback.showAroundRequest(this.request,this.options),up.form.disableWhile(this.request,this.options),this.options.preload?this.request:n.always(this.request,(t=>this.onRequestSettled(t))))}deriveFailOptions(){return up.RenderOptions.deriveFailOptions(this.options)}newPageReason(){return n.isCrossOrigin(this.options.url)?"Loading cross-origin content in new page":up.browser.canPushState()?void 0:"Loading content in new page to restore history support"}getRequestAttrs(){const t=this.preflightPropsForRenderOptions(this.options),e=this.preflightPropsForRenderOptions(this.deriveFailOptions(),{optional:!0});return Object.assign(Object.assign(Object.assign({},this.options),t),n.renameKeys(e,up.fragment.failKey))}getPreflightProps(){return this.getRequestAttrs()}preflightPropsForRenderOptions(t,e){return new up.Change.FromContent(Object.assign(Object.assign({},t),{preview:!0})).getPreflightProps(e)}onRequestSettled(t){return t instanceof up.Response?this.onRequestSettledWithResponse(t):this.onRequestSettledWithError(t)}onRequestSettledWithResponse(t){var e;if(this.response=t,up.fragment.config.skipResponse(this.loadedEventProps())?this.skip():this.request.assertEmitted("up:fragment:loaded",Object.assign(Object.assign({},this.loadedEventProps()),{callback:this.options.onLoaded,log:["Loaded fragment from %s",this.response.description],skip:()=>this.skip()})),null!==(e=n.evalOption(this.options.fail,this.response))&&void 0!==e?e:!t.ok)throw this.updateContentFromResponse(this.deriveFailOptions());return this.updateContentFromResponse(this.options)}compilerPassMeta(){return n.pick(this.loadedEventProps(),["revalidating","response"])}loadedEventProps(){const{expiredResponse:t}=this.options;return{request:this.request,response:this.response,renderOptions:this.options,revalidating:!!t,expiredResponse:t}}onRequestSettledWithError(t){throw t instanceof up.Offline&&this.request.emit("up:fragment:offline",{callback:this.options.onOffline,response:this.response,renderOptions:this.options,retry:t=>up.render(Object.assign(Object.assign({},this.options),t)),log:["Cannot load fragment from %s: %s",this.request.description,t.reason]}),t}skip(){up.puts("up.render()","Skipping "+this.response.description),this.options.target=":none",this.options.failTarget=":none"}updateContentFromResponse(t){t.failPrefixForced&&up.puts("up.render()","Rendering failed response using fail-prefixed options (https://unpoly.com/failed-responses)"),this.augmentOptionsFromResponse(t),t.meta=this.compilerPassMeta();let e=new up.Change.FromContent(t).execute();return e.finished=this.finish(e,t),e}finish(t,n){return e(this,void 0,void 0,(function*(){return t=yield t.finished,up.fragment.shouldRevalidate(this.request,this.response,n)&&(t=yield this.revalidate(t,n)),t}))}revalidate(t,n){return e(this,void 0,void 0,(function*(){let e=n.target;if(/:(before|after)/.test(e))up.warn("up.render()","Cannot revalidate cache when prepending/appending (target %s)",e);else{up.puts("up.render()",'Revalidating cached response for target "%s"',e);let r=yield up.reload(t.target,Object.assign(Object.assign({},n),{layer:t.layer,onFinished:null,scroll:!1,focus:"keep",transition:!1,cache:!1,confirm:!1,feedback:!1,abort:!1,expiredResponse:this.response}));r.none||(t=r)}return t}))}augmentOptionsFromResponse(t){var e,r;const i=this.response.url;let s=i,o=this.request.hash;o&&(t.hash=o,s+=o),"GET"===this.response.method?t.source=this.improveHistoryValue(t.source,i):(t.source=this.improveHistoryValue(t.source,"keep"),t.history=!!t.location),t.location=this.improveHistoryValue(t.location,s),t.title=this.improveHistoryValue(t.title,this.response.title),t.eventPlans=this.response.eventPlans;let a=this.response.target;a&&(t.target=a),t.acceptLayer=this.response.acceptLayer,t.dismissLayer=this.response.dismissLayer,t.document=this.response.text,t.document||(t.target=":none"),t.context=n.merge(t.context,this.response.context),t.cspNonces=this.response.cspNonces,null!==(e=t.time)&&void 0!==e||(t.time=this.response.lastModified),null!==(r=t.etag)&&void 0!==r||(t.etag=this.response.etag)}},n.memoizeMethod(t.prototype,["getRequestAttrs","loadedEventProps"]),t)},7050:function(){var t=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,s){function o(t){try{u(r.next(t))}catch(t){s(t)}}function a(t){try{u(r.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}u((r=r.apply(t,e||[])).next())}))};let e=up.util;up.Change.OpenLayer=class extends up.Change.Addition{constructor(t){super(t),this.target=t.target,this.origin=t.origin,this.baseLayer=t.baseLayer}getPreflightProps(){return{mode:this.options.mode,context:this.buildLayer().context,origin:this.options.origin,target:this.target,layer:this.baseLayer,fragments:e.compact([up.fragment.get(":main",{layer:this.baseLayer})])}}execute(t,e){if(":none"===this.target?this.content=document.createElement("up-none"):this.content=t.select(this.target),!this.content||this.baseLayer.isClosed())throw this.cannotMatch();if(e(),up.puts("up.render()",`Opening element "${this.target}" in new overlay`),this.options.title=this.improveHistoryValue(this.options.title,t.getTitle()),this.emitOpenEvent().defaultPrevented)throw new up.Aborted("Open event was prevented");this.baseLayer.peel(),this.layer=this.buildLayer(),up.layer.stack.push(this.layer),this.layer.createElements(this.content),this.layer.setupHandlers(),this.handleHistory(),this.setReloadAttrs({newElement:this.content,source:this.options.source}),t.finalizeElement(this.content),up.hello(this.layer.element,Object.assign(Object.assign({},this.options),{layer:this.layer})),this.handleLayerChangeRequests(),this.handleScroll();let n=new up.RenderResult({layer:this.layer,fragments:[this.content],target:this.target});return n.finished=this.finish(n),this.layer.opening=!1,this.emitOpenedEvent(),this.abortWhenLayerClosed(),n}finish(e){return t(this,void 0,void 0,(function*(){return yield this.layer.startOpenAnimation(),this.abortWhenLayerClosed(),this.handleFocus(),e}))}buildLayer(){const t=Object.assign(Object.assign({},this.options),{opening:!0});return up.layer.build(t,(t=>this.options=up.RenderOptions.finalize(t)))}handleHistory(){"auto"===this.layer.history&&(this.layer.history=up.fragment.hasAutoHistory(this.content)),this.layer.parent.saveHistory(),this.layer.updateHistory(this.options)}handleFocus(){var t;null===(t=this.baseLayer.overlayFocus)||void 0===t||t.moveToBack(),this.layer.overlayFocus.moveToFront(),new up.FragmentFocus({fragment:this.content,layer:this.layer,autoMeans:["autofocus","layer"]}).process(this.options.focus)}handleScroll(){const t=Object.assign(Object.assign({},this.options),{fragment:this.content,layer:this.layer,autoMeans:["hash","layer"]});new up.FragmentScrolling(t).process(this.options.scroll)}emitOpenEvent(){return up.emit("up:layer:open",{origin:this.origin,baseLayer:this.baseLayer,layerOptions:this.options,log:"Opening new overlay"})}emitOpenedEvent(){return this.layer.emit("up:layer:opened",{origin:this.origin,callback:this.layer.callback("onOpened"),log:`Opened new ${this.layer}`})}}},1752:()=>{up.Change.Removal=class extends up.Change{}},9441:function(){var t,e=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,s){function o(t){try{u(r.next(t))}catch(t){s(t)}}function a(t){try{u(r.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}u((r=r.apply(t,e||[])).next())}))};const n=up.util,r=up.element;up.Change.UpdateLayer=(t=class extends up.Change.Addition{constructor(t){super(t=up.RenderOptions.finalize(t)),this.layer=t.layer,this.target=t.target,this.context=t.context,this.useKeep=t.useKeep,this.steps=up.fragment.parseTargetSteps(this.target,this.options)}getPreflightProps(){return this.matchPreflight(),{layer:this.layer,mode:this.layer.mode,context:n.merge(this.layer.context,this.context),origin:this.options.origin,target:this.bestPreflightSelector(),fragments:this.getFragments()}}bestPreflightSelector(){return this.matchPreflight(),n.map(this.steps,"selector").join(", ")||":none"}getFragments(){return this.matchPreflight(),n.map(this.steps,"oldElement")}execute(t,e){this.responseDoc=t,this.matchPostflight(),e(),this.steps.length?up.puts("up.render()",`Updating "${this.bestPreflightSelector()}" in ${this.layer}`):up.puts("up.render()","Nothing was rendered"),this.options.title=this.improveHistoryValue(this.options.title,this.responseDoc.getTitle()),this.setScrollAndFocusOptions(),this.options.saveScroll&&up.viewport.saveScroll({layer:this.layer}),this.options.saveFocus&&up.viewport.saveFocus({layer:this.layer}),this.options.peel&&this.layer.peel(),!1!==this.options.abort&&up.fragment.abort(this.getFragments(),{reason:"Fragment is being replaced"}),Object.assign(this.layer.context,this.context),this.hasHistory()&&this.layer.updateHistory(this.options),this.handleLayerChangeRequests(),this.renderResult=new up.RenderResult({layer:this.layer,target:this.target}),this.steps.reverse();const n=this.steps.map((t=>this.executeStep(t)));return this.renderResult.finished=this.finish(n),this.steps.length||(this.handleFocus(null,this.options),this.handleScroll(null,this.options)),this.renderResult}finish(t){return e(this,void 0,void 0,(function*(){return yield Promise.all(t),this.abortWhenLayerClosed(),this.renderResult}))}addToResult(t){let e=t.matches("up-wrapper")?t.children:[t];this.renderResult.fragments.unshift(...e)}executeStep(t){switch(this.setReloadAttrs(t),t.placement){case"swap":if(this.findKeepPlan(t))return this.handleFocus(t.oldElement,t),this.handleScroll(t.oldElement,t),Promise.resolve();{this.preserveKeepables(t);const e=t.oldElement.parentNode,n=Object.assign(Object.assign({},t),{beforeStart(){up.fragment.markAsDestroying(t.oldElement)},afterInsert:()=>{this.responseDoc.finalizeElement(t.newElement),this.restoreKeepables(t),up.hello(t.newElement,t),this.addToResult(t.newElement)},beforeDetach:()=>{up.syntax.clean(t.oldElement,{layer:this.layer})},afterDetach(){up.element.cleanJQuery(),up.fragment.emitDestroyed(t.oldElement,{parent:e,log:!1})},scrollNew:()=>{this.handleFocus(t.newElement,t),this.handleScroll(t.newElement,t)}});return up.morph(t.oldElement,t.newElement,t.transition,n)}case"content":{let e=r.wrapChildren(t.oldElement),n=r.wrapChildren(t.newElement),i=Object.assign(Object.assign({},t),{placement:"swap",oldElement:e,newElement:n,focus:!1});return this.executeStep(i).then((()=>{r.unwrap(n),this.handleFocus(t.oldElement,t)}))}case"before":case"after":{let e=r.wrapChildren(t.newElement),n="before"===t.placement?"afterbegin":"beforeend";return t.oldElement.insertAdjacentElement(n,e),this.responseDoc.finalizeElement(e),up.hello(e,t),this.addToResult(e),this.handleFocus(e,t),this.handleScroll(e,t),up.animate(e,t.transition,t).then((()=>r.unwrap(e)))}default:up.fail("Unknown placement: %o",t.placement)}}findKeepPlan(t){if(!this.useKeep)return;const{oldElement:e,newElement:n}=t;let i;if(!r.booleanAttr(e,"up-keep"))return;let s=up.fragment.toTarget(e);const o={layer:this.layer};if(i=t.descendantsOnly?up.fragment.get(n,s,o):up.fragment.subtree(n,s,o)[0],i&&r.booleanAttr(i,"up-keep")){const t={oldElement:e,newElement:i,newData:up.syntax.data(i)};if(!up.fragment.emitKeep(t).defaultPrevented)return t}}preserveKeepables(t){const e=[];if(this.useKeep)for(let n of t.oldElement.querySelectorAll("[up-keep]")){let r=this.findKeepPlan(Object.assign(Object.assign({},t),{oldElement:n,descendantsOnly:!0}));if(r){const t=n.cloneNode(!0);n.insertAdjacentElement("beforebegin",t);let i=up.viewport.subtree(r.oldElement);r.revivers=i.map((function(t){let e=up.viewport.copyCursorProps(t);return()=>up.viewport.copyCursorProps(e,t)})),document.body.append(n),e.push(r)}}t.keepPlans=e}restoreKeepables(t){for(let e of t.keepPlans){e.newElement.replaceWith(e.oldElement);for(let t of e.revivers)t()}}matchPreflight(){this.filterSteps((t=>{const e=new up.FragmentFinder(t);if(t.oldElement||(t.oldElement=e.find()),t.oldElement)return!0;if(!t.maybe)throw this.cannotMatch(`Could not find element "${this.target}" in current page`)})),this.resolveOldNesting()}matchPostflight(){this.matchPreflight(),this.options.useHungry&&this.addHungrySteps(),this.filterSteps((t=>{if(t.newElement=this.responseDoc.select(t.selector),t.newElement)return!0;if(!t.maybe)throw this.cannotMatch(`Could not find element "${this.target}" in server response`)})),this.resolveOldNesting()}filterSteps(t){this.steps=n.filter(this.steps,t)}addHungrySteps(){const t=up.radio.hungrySolutions({layer:this.layer,history:this.hasHistory(),origin:this.options.origin});for(let{element:e,target:n}of t){const t={selector:n,oldElement:e,transition:r.booleanOrStringAttr(e,"transition"),placement:"swap",maybe:!0};this.steps.push(t)}}containedByRivalStep(t,e){return n.some(t,(function(t){return t!==e&&("swap"===t.placement||"content"===t.placement)&&t.oldElement.contains(e.oldElement)}))}resolveOldNesting(){let t=n.uniqBy(this.steps,"oldElement");t=n.reject(t,(e=>this.containedByRivalStep(t,e))),this.steps=t}setScrollAndFocusOptions(){this.steps.forEach(((t,e)=>{e>0&&(t.scroll=!1,t.focus=!1),"swap"!==t.placement&&"content"!==t.placement||(t.scrollBehavior="instant")})),this.focusCapsule=up.FocusCapsule.preserve(this.layer)}handleFocus(t,e){return new up.FragmentFocus(Object.assign(Object.assign({},e),{fragment:t,layer:this.layer,focusCapsule:this.focusCapsule,autoMeans:up.fragment.config.autoFocus})).process(e.focus)}handleScroll(t,e){return new up.FragmentScrolling(Object.assign(Object.assign({},e),{fragment:t,layer:this.layer,autoMeans:up.fragment.config.autoScroll})).process(e.scroll)}hasHistory(){return n.evalAutoOption(this.options.history,this.hasAutoHistory.bind(this))}hasAutoHistory(){const t=n.map(this.steps,"oldElement");return n.some(t,up.fragment.hasAutoHistory)}},n.memoizeMethod(t.prototype,["matchPreflight","matchPostflight","hasHistory"]),t)},1569:()=>{const t=up.util;up.CompilerPass=class{constructor(t,e,{layer:n,data:r,dataMap:i,meta:s}){n||(n=up.layer.get(t)||up.layer.current),this.root=t,this.compilers=e,this.layer=n,this.data=r,this.dataMap=i,this.meta=Object.assign({layer:n},s),this.errors=[]}run(){if(this.layer.asCurrent((()=>{this.setCompileData();for(let t of this.compilers)this.runCompiler(t)})),this.errors.length)throw new up.CannotCompile("Errors while compiling",{errors:this.errors})}setCompileData(){if(this.data&&(this.root.upCompileData=this.data),this.dataMap)for(let t in this.dataMap)for(let e of this.select(t))e.upCompileData=this.dataMap[t]}runCompiler(t){var e,n;const r=this.selectOnce(t);if(r.length){if(t.isDefault||up.puts("up.hello()",'Compiling %d× "%s" on %s',r.length,t.selector,this.layer),t.batch)this.compileBatch(t,r);else for(let e of r)this.compileOneElement(t,e);return null===(n=(e=up.migrate).postCompile)||void 0===n?void 0:n.call(e,r,t)}}compileOneElement(t,e){const n=[e];if(1!==t.length){const t=up.syntax.data(e);n.push(t,this.meta)}const r=this.applyCompilerFunction(t,e,n);let i=this.destructorPresence(r);i&&up.destructor(e,i)}compileBatch(e,n){const r=[n];if(1!==e.length){const e=t.map(n,up.syntax.data);r.push(e,this.meta)}const i=this.applyCompilerFunction(e,n,r);this.destructorPresence(i)&&up.fail("Compilers with { batch: true } cannot return destructors")}applyCompilerFunction(t,e,n){try{return t.apply(e,n)}catch(t){this.errors.push(t),up.log.error("up.hello()","While compiling %o: %o",e,t),up.error.emitGlobal(t)}}destructorPresence(e){if(t.isFunction(e)||t.isArray(e)&&t.every(e,t.isFunction))return e}select(e){return up.fragment.subtree(this.root,t.evalOption(e),{layer:this.layer})}selectOnce(e){let n=this.select(e.selector);return t.filter(n,(t=>{let n=t.upAppliedCompilers||(t.upAppliedCompilers=new Set);if(!n.has(e))return n.add(e),!0}))}}},3742:()=>{up.Config=class{constructor(t=(()=>({}))){this.blueprintFn=t,this.reset()}reset(){Object.assign(this,this.blueprintFn())}}},2737:()=>{const t=up.util,e=up.element;up.CSSTransition=class{constructor(e,n,r){this.element=e,this.lastFrameKebab=n,this.lastFrameKeysKebab=Object.keys(this.lastFrameKebab),t.some(this.lastFrameKeysKebab,(t=>t.match(/A-Z/)))&&up.fail("Animation keys must be kebab-case"),this.finishEvent=r.finishEvent,this.duration=r.duration,this.easing=r.easing,this.finished=!1}start(){return 0===this.lastFrameKeysKebab.length?(this.finished=!0,Promise.resolve()):(this.deferred=t.newDeferred(),this.pauseOldTransition(),this.startTime=new Date,this.startFallbackTimer(),this.listenToFinishEvent(),this.listenToTransitionEnd(),this.startMotion(),this.deferred)}listenToFinishEvent(){this.finishEvent&&(this.stopListenToFinishEvent=up.on(this.element,this.finishEvent,this.onFinishEvent.bind(this)))}onFinishEvent(t){t.stopPropagation(),this.finish()}startFallbackTimer(){this.fallbackTimer=t.timer(this.duration+100,(()=>{this.finish()}))}stopFallbackTimer(){clearTimeout(this.fallbackTimer)}listenToTransitionEnd(){this.stopListenToTransitionEnd=up.on(this.element,"transitionend",this.onTransitionEnd.bind(this))}onTransitionEnd(e){if(e.target!==this.element)return;if(new Date-this.startTime<=.25*this.duration)return;const n=e.propertyName;t.contains(this.lastFrameKeysKebab,n)&&this.finish()}finish(){var t,n;this.finished||(this.finished=!0,this.stopFallbackTimer(),null===(t=this.stopListenToFinishEvent)||void 0===t||t.call(this),null===(n=this.stopListenToTransitionEnd)||void 0===n||n.call(this),e.concludeCSSTransition(this.element),this.resumeOldTransition(),this.deferred.resolve())}pauseOldTransition(){const t=e.style(this.element,["transitionProperty","transitionDuration","transitionDelay","transitionTimingFunction"]);if(e.hasCSSTransition(t)){if("all"!==t.transitionProperty){const n=t.transitionProperty.split(/\s*,\s*/),r=e.style(this.element,n);this.setOldTransitionTargetFrame=e.setTemporaryStyle(this.element,r)}this.setOldTransition=e.concludeCSSTransition(this.element)}}resumeOldTransition(){var t,e;null===(t=this.setOldTransitionTargetFrame)||void 0===t||t.call(this),null===(e=this.setOldTransition)||void 0===e||e.call(this)}startMotion(){e.setStyle(this.element,{transitionProperty:Object.keys(this.lastFrameKebab).join(", "),transitionDuration:`${this.duration}ms`,transitionTimingFunction:this.easing}),e.setStyle(this.element,this.lastFrameKebab)}}},3635:()=>{const t=up.util;up.DestructorPass=class{constructor(t,e){this.fragment=t,this.options=e,this.errors=[]}run(){for(let e of this.selectCleanables()){let n=t.pluckKey(e,"upDestructors");if(n)for(let t of n)this.applyDestructorFunction(t,e);e.classList.remove("up-can-clean")}if(this.errors.length)throw new up.Error("Errors while destroying",{errors:this.errors})}selectCleanables(){const t=Object.assign(Object.assign({},this.options),{destroying:!0});return up.fragment.subtree(this.fragment,".up-can-clean",t)}applyDestructorFunction(t,e){try{t()}catch(t){this.errors.push(t),up.log.error("up.destroy()","While destroying %o: %o",e,t),up.error.emitGlobal(t)}}}},1906:()=>{const t=up.util,e=up.element;up.EventEmitter=class extends up.Record{keys(){return["target","event","baseLayer","callback","log","ensureBubbles"]}emit(){return this.logEmission(),this.baseLayer?this.baseLayer.asCurrent((()=>this.dispatchEvent())):this.dispatchEvent(),this.event}dispatchEvent(){var t;this.target.dispatchEvent(this.event),this.ensureBubbles&&!this.target.isConnected&&document.dispatchEvent(this.event),null===(t=this.callback)||void 0===t||t.call(this,this.event)}assertEmitted(){const t=this.emit();if(t.defaultPrevented)throw new up.Aborted(`Event ${t.type} was prevented`)}logEmission(){if(!up.log.config.enabled)return;let e,n=this.log;t.isArray(n)?[n,...e]=n:e=[];const{type:r}=this.event;t.isString(n)?up.puts(r,n,...e):!1!==n&&up.puts(r,`Event ${r}`)}static fromEmitArgs(n,r={}){var i,s;let o,a=t.extractOptions(n);return a=t.merge(r,a),t.isElementish(n[0])?a.target=e.get(n.shift()):n[0]instanceof up.Layer&&(a.layer=n.shift()),t.isGiven(a.layer)&&(o=up.layer.get(a.layer),a.target||(a.target=o.element),a.baseLayer||(a.baseLayer=o)),a.baseLayer&&(a.baseLayer=up.layer.get(a.baseLayer)),t.isString(a.target)?a.target=up.fragment.get(a.target,{layer:a.layer}):a.target||(a.target=document),(null===(i=n[0])||void 0===i?void 0:i.preventDefault)?(a.event=n[0],null!==(s=a.log)&&void 0!==s||(a.log=n[0].log)):t.isString(n[0])?a.event=up.event.build(n[0],a):a.event=up.event.build(a),new this(a)}}},4158:()=>{const t=up.util;up.EventListener=class extends up.Record{keys(){return["element","eventType","selector","callback","guard","baseLayer","passive","once","beforeBoot"]}constructor(t){var e;super(t),this.key=this.constructor.buildKey(t),this.isDefault=up.framework.evaling,null!==(e=this.beforeBoot)&&void 0!==e||(this.beforeBoot=0===this.eventType.indexOf("up:framework:")),this.nativeCallback=this.nativeCallback.bind(this)}bind(){var t;const e=(t=this.element).upEventListeners||(t.upEventListeners={});e[this.key]&&up.fail("up.on(): The %o callback %o cannot be registered more than once",this.eventType,this.callback),e[this.key]=this,this.element.addEventListener(...this.addListenerArgs())}addListenerArgs(){let e=t.compactObject(t.pick(this,["once","passive"]));return[this.eventType,this.nativeCallback,e]}unbind(){let t=this.element.upEventListeners;t&&delete t[this.key],this.element.removeEventListener(...this.addListenerArgs())}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],r=this.callback.length;if(1!==r&&2!==r){const e=up.syntax.data(n);t.push(e)}const i=this.callback.bind(n,...t);this.baseLayer?this.baseLayer.asCurrent(i):i()}}static fromElement(t){let e=t.element.upEventListeners;if(e)return e[this.buildKey(t)]}static buildKey(e){var n;return(n=e.callback).upUid||(n.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 extends up.Record{keys(){return["elements","eventTypes","selector","callback","guard","baseLayer","passive","once","beforeBoot"]}bind(){const e=[];return this.eachListenerAttributes((function(t){const n=new up.EventListener(t);return n.bind(),e.push(n.unbind.bind(n))})),t.sequence(e)}eachListenerAttributes(t){for(let e of this.elements)for(let n of this.eventTypes)t(this.listenerAttributes(e,n))}listenerAttributes(t,e){return Object.assign(Object.assign({},this.attributes()),{element:t,eventType:e})}unbind(){this.eachListenerAttributes((function(t){let e=up.EventListener.fromElement(t);e&&e.unbind()}))}static fromBindArgs(e,n){const r=(e=t.copy(e)).pop();let i;i=e[0].addEventListener?[e.shift()]:t.isJQuery(e[0])||t.isList(e[0])&&e[0][0].addEventListener?e.shift():[document];let s=t.parseTokens(e.shift()),o=up.migrate.fixEventTypes;o&&(s=o(s));const a=t.extractOptions(e),u=e[0];return new this(Object.assign(Object.assign({elements:i,eventTypes:s,selector:u,callback:r},a),n))}}},2214:function(){var t=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,s){function o(t){try{u(r.next(t))}catch(t){s(t)}}function a(t){try{u(r.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}u((r=r.apply(t,e||[])).next())}))};const e=up.util;up.FieldWatcher=class{constructor(t,e,n,r){this.callback=r,this.form=t,this.fields=e,this.options=n,this.batch=n.batch,this.unbindFns=[]}fieldOptions(t){let n=e.copy(this.options);return up.form.watchOptions(t,n,{defaults:{event:"input"}})}start(){this.scheduledValues=null,this.processedValues=this.readFieldValues(),this.currentTimer=null,this.callbackRunning=!1;for(let t of this.fields)this.watchField(t)}watchField(t){let e=this.fieldOptions(t);this.unbindFns.push(up.on(t,e.event,(t=>this.check(t,e)))),this.unbindFns.push(up.fragment.onAborted(t,(()=>this.cancelTimer())))}stop(){for(let t of this.unbindFns)t();this.cancelTimer()}cancelTimer(){clearTimeout(this.currentTimer),this.currentTimer=null}isAnyFieldAttached(){return e.some(this.fields,"isConnected")}scheduleValues(t,n,r){this.cancelTimer(),this.scheduledValues=t;let i=e.evalOption(r.delay,n);this.currentTimer=e.timer(i,(()=>{this.currentTimer=null,this.isAnyFieldAttached()?(this.scheduledFieldOptions=r,this.requestCallback()):this.scheduledValues=null}))}isNewValues(t){return!e.isEqual(t,this.processedValues)&&!e.isEqual(this.scheduledValues,t)}requestCallback(){return t(this,void 0,void 0,(function*(){let t=this.scheduledFieldOptions;if(null!==this.scheduledValues&&!this.currentTimer&&!this.callbackRunning){const n=this.changedValues(this.processedValues,this.scheduledValues);this.processedValues=this.scheduledValues,this.scheduledValues=null,this.callbackRunning=!0,this.scheduledFieldOptions=null;let r=Object.assign(Object.assign({},t),{disable:!1});const i=[];if(this.batch)i.push(this.callback(n,r));else for(let t in n){const e=n[t];i.push(this.callback(e,t,r))}if(e.some(i,e.isPromise)){let e=Promise.allSettled(i);up.form.disableWhile(e,t),yield e}this.callbackRunning=!1,this.requestCallback()}}))}changedValues(t,n){const r={};let i=Object.keys(t);i=i.concat(Object.keys(n)),i=e.uniq(i);for(let s of i){const i=t[s],o=n[s];e.isEqual(i,o)||(r[s]=o)}return r}readFieldValues(){return up.Params.fromFields(this.fields).toObject()}check(t,e){const n=this.readFieldValues();this.isNewValues(n)&&this.scheduleValues(n,t,e)}}},665:()=>{up.FocusCapsule=class{constructor(t,e){this.target=t,this.cursorProps=e}restore(t,e){let n=up.fragment.get(this.target,{layer:t});if(n)return up.viewport.copyCursorProps(this.cursorProps,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(n,up.viewport.copyCursorProps(e)):void 0}}},5240:function(){var t=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,s){function o(t){try{u(r.next(t))}catch(t){s(t)}}function a(t){try{u(r.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}u((r=r.apply(t,e||[])).next())}))},e=this&&this.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const n=up.util;up.FormValidator=class{constructor(t){this.form=t,this.dirtySolutions=[],this.nextRenderTimer=null,this.rendering=!1,this.resetNextRenderPromise(),this.honorAbort()}honorAbort(){up.fragment.onAborted(this.form,(({target:t})=>{this.dirtySolutions=n.reject(this.dirtySolutions,(({element:e})=>t.contains(e)))}))}resetNextRenderPromise(){this.nextRenderPromise=n.newDeferred()}watchContainer(t){let{event:e}=this.originOptions(t);up.on(t,e,(()=>up.error.muteUncriticalRejection(this.validate({origin:t}))))}validate(t={}){let e=this.getSolutions(t);return this.dirtySolutions.push(...e),this.scheduleNextRender(),this.nextRenderPromise}getSolutions(t){let e=this.getTargetSelectorSolutions(t)||this.getFieldSolutions(t)||this.getElementSolutions(t.origin);for(let n of e)n.renderOptions=this.originOptions(n.origin,t),n.target=up.fragment.resolveOrigin(n.target,n);return e}getFieldSolutions(t){var{origin:n}=t,r=e(t,["origin"]);if(up.form.isField(n))return this.getValidateAttrSolutions(n)||this.getFormGroupSolutions(n,r)}getFormGroupSolutions(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}getTargetSelectorSolutions({target:t,origin:e}){if(n.isString(t)&&t)return up.puts("up.validate()",'Validating target "%s"',t),up.fragment.splitTarget(t).map((function(t){return{element:up.fragment.get(t,{origin:e}),target:t,origin:e}}))}getElementSolutions(t){return up.puts("up.validate()","Validating element %o",t),[{element:t,target:up.fragment.toTarget(t),origin:t}]}getValidateAttrSolutions(t){let e=t.closest("[up-validate]");if(e){let n=e.getAttribute("up-validate");return this.getTargetSelectorSolutions({target:n,origin:t})}}originOptions(t,e){return up.form.watchOptions(t,e,{defaults:{event:"change"}})}scheduleNextRender(){let t=this.dirtySolutions.map((t=>t.renderOptions.delay)),e=Math.min(...t)||0;this.unscheduleNextRender(),this.nextRenderTimer=n.timer(e,(()=>this.renderDirtySolutions()))}unscheduleNextRender(){clearTimeout(this.nextRenderTimer)}renderDirtySolutions(){up.error.muteUncriticalRejection(this.doRenderDirtySolutions())}doRenderDirtySolutions(){var e;return t(this,void 0,void 0,(function*(){if(this.dirtySolutions=n.filter(this.dirtySolutions,(({element:t,origin:e})=>t.isConnected&&e.isConnected)),!this.dirtySolutions.length||this.rendering)return;let t=this.dirtySolutions;this.dirtySolutions=[];let r=n.map(t,"origin"),i=n.flatMap(r,up.form.fields),s=n.uniq(n.map(i,"name")),o=this.buildDataMap(t),a=n.map(t,"renderOptions"),u=n.mergeDefined(...a,{dataMap:o},up.form.destinationOptions(this.form));u.target=n.map(t,"target").join(", "),u.feedback=n.some(a,"feedback"),u.origin=this.form,null!==(e=u.focus)&&void 0!==e||(u.focus="keep"),u.failOptions=!1,u.params=up.Params.merge(u.params,...n.map(a,"params")),u.headers=n.merge(...n.map(a,"headers")),u.headers[up.protocol.headerize("validate")]=s.join(" ")||":unknown",u.guardEvent=up.event.build("up:form:validate",{fields:i,log:"Validating form",params:u.params}),this.rendering=!0;let l=this.nextRenderPromise;this.resetNextRenderPromise(),u.disable=!1;for(let e of t)up.form.disableWhile(l,{disable:e.renderOptions.disable,origin:e.origin});try{l.resolve(up.render(u)),yield l}finally{this.rendering=!1,this.renderDirtySolutions()}}))}buildDataMap(t){let e={};for(let r of t){let t=n.pluckKey(r.renderOptions,"data");n.pluckKey(r.renderOptions,"keepData")&&(t=up.data(r.element)),t&&(e[r.target]=t)}return e}static forElement(t){let e=up.form.get(t);return e.upFormValidator||(e.upFormValidator=new this(e))}}},2587:()=>{const t=/^([^ >+(]+) (.+)$/;up.FragmentFinder=class{constructor(t){this.options=t,this.origin=t.origin,this.selector=t.selector,this.externalRoot=t.externalRoot}find(){return this.findAroundOrigin()||this.findInLayer()}findAroundOrigin(){if(this.origin&&up.fragment.config.matchAroundOrigin&&this.origin.isConnected)return this.findClosest()||this.findInVicinity()}findClosest(){return up.fragment.closest(this.origin,this.selector,this.options)}findInVicinity(){let e=this.selector.match(t);if(e){let t=up.fragment.closest(this.origin,e[1],this.options);if(t)return up.fragment.getDumb(t,e[2])}}findInLayer(){return this.externalRoot?up.fragment.subtree(this.externalRoot,this.selector,this.options)[0]:up.fragment.getDumb(this.selector,this.options)}}},7031:()=>{const t=up.util,e=up.element,n={preventScroll:!0};up.FragmentFocus=class extends up.FragmentProcessor{keys(){return super.keys().concat(["hash","focusCapsule"])}processPrimitive(e){switch(e){case"keep":return this.restoreLostFocus();case"restore":return this.restorePreviousFocusForLocation();case"target":case!0:return this.focusElement(this.fragment);case"layer":return this.focusElement(this.layer.getFocusElement());case"main":return this.focusSelector(":main");case"hash":return this.focusHash();case"autofocus":return this.autofocus();default:if(t.isString(e))return this.focusSelector(e)}}processElement(t){return this.focusElement(t)}resolveCondition(t){return"lost"===t?this.wasFocusLost():super.resolveCondition(t)}focusSelector(t){let e=this.findSelector(t);return this.focusElement(e)}restoreLostFocus(){var t;if(this.wasFocusLost())return null===(t=this.focusCapsule)||void 0===t?void 0:t.restore(this.layer,n)}restorePreviousFocusForLocation(){return up.viewport.restoreFocus({layer:this.layer})}autofocus(){let t=this.fragment&&e.subtree(this.fragment,"[autofocus]")[0];if(t)return this.focusElement(t)}focusElement(t){if(t)return up.focus(t,Object.assign({force:!0},n)),!0}focusHash(){let t=up.viewport.firstHashTarget(this.hash,{layer:this.layer});if(t)return this.focusElement(t)}wasFocusLost(){return!this.layer.hasFocus()}}},8057:()=>{const t=up.element;up.FragmentPolling=class{constructor(t){this.options={},this.state="initialized",this.setFragment(t),this.abortable=!0}static forFragment(t){return t.upPolling||(t.upPolling=new this(t))}onPollAttributeObserved(){this.start()}onFragmentDestroyed(){this.stop()}onFragmentAborted(){this.abortable&&this.stop()}start(){"started"!==this.state&&(this.state="started",this.scheduleReload())}stop(){"started"===this.state&&(clearTimeout(this.reloadTimer),this.state="stopped")}forceStart(t){Object.assign(this.options,t),this.forceStarted=!0,this.start()}forceStop(){this.stop(),this.forceStarted=!1}scheduleReload(t=this.getInterval()){this.reloadTimer=setTimeout((()=>this.reload()),t)}reload(){if("started"!==this.state)return;let t=up.radio.pollIssue(this.fragment);if(t){up.puts("[up-poll]",`Will not poll: ${t}`);let e=Math.min(1e4,this.getInterval());this.scheduleReload(e)}else this.reloadNow()}reloadNow(){let t={url:this.options.url,fail:!1,background:!0},e=this.abortable;this.abortable=!1,up.reload(this.fragment,t).then(this.onReloadSuccess.bind(this),this.onReloadFailure.bind(this)),this.abortable=e}onReloadSuccess({fragment:t}){t?this.onFragmentSwapped(t):this.scheduleReload()}onReloadFailure(t){if(this.scheduleReload(),up.error.isCritical(t))throw t}onFragmentSwapped(t){this.stop(),this.forceStarted&&up.fragment.matches(this.fragment,t)&&this.constructor.forFragment(t).forceStart(this.options)}setFragment(t){this.fragment=t,up.destructor(t,(()=>this.onFragmentDestroyed())),up.fragment.onAborted(t,(()=>this.onFragmentAborted()))}getInterval(){var e,n;let r=null!==(n=null!==(e=this.options.interval)&&void 0!==e?e:t.numberAttr(this.fragment,"up-interval"))&&void 0!==n?n:up.radio.config.pollInterval;return up.radio.config.stretchPollInterval(r)}}},2828:()=>{const t=up.util;up.FragmentProcessor=class extends up.Record{keys(){return["fragment","autoMeans","origin","layer"]}process(t){let e=this.preprocess(t);return this.tryProcess(e)}preprocess(e){return t.parseTokens(e,{separator:"or"})}tryProcess(e){if(t.isArray(e))return this.processArray(e);if(t.isFunction(e))return this.tryProcess(e(this.fragment,this.attributes()));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 extends up.FragmentProcessor{keys(){return super.keys().concat(["hash","mode","revealTop","revealMax","revealSnap","scrollBehavior"])}processPrimitive(e){switch(e){case"reset":return this.reset();case"layer":return this.revealLayer();case"main":return this.revealSelector(":main");case"restore":return this.restore();case"hash":return this.hash&&up.viewport.revealHash(this.hash,this.attributes());case"target":case"reveal":case!0:return this.revealElement(this.fragment);default:if(t.isString(e))return this.revealSelector(e)}}processElement(t){return this.revealElement(t)}revealElement(t){if(t)return up.reveal(t,this.attributes()),!0}revealSelector(t){let e=this.findSelector(t);return this.revealElement(e)}revealLayer(){return this.revealElement(this.layer.getBoxElement())}reset(){return up.viewport.resetScroll(Object.assign(Object.assign({},this.attributes()),{around:this.fragment})),!0}restore(){return up.viewport.restoreScroll(Object.assign(Object.assign({},this.attributes()),{around:this.fragment}))}}},6267:()=>{const t=up.util,e=up.element;up.HTMLWrapper=class{constructor(t){this.tagName=t;const e=`<${this.tagName}[^>]*>`,n=`</${this.tagName}>`;this.pattern=new RegExp(e+"(.|\\s)*?"+n,"ig"),this.attrName=`up-wrapped-${this.tagName}`}strip(t){return t.replace(this.pattern,"")}wrap(t){return t.replace(this.pattern,this.wrapMatch.bind(this))}wrapMatch(e){return this.didWrap=!0,'<meta name="'+this.attrName+'" value="'+t.escapeHTML(e)+'">'}unwrap(t){if(this.didWrap)for(let n of t.querySelectorAll(`meta[name='${this.attrName}']`)){const t=n.getAttribute("value"),r=e.createFromHTML(t);n.replaceWith(r)}}}},7956:()=>{const t=up.element,e=up.util;up.Layer=class 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 index(){return 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.buildEventListenerGroup(t).bind()}off(...t){return this.buildEventListenerGroup(t).unbind()}buildEventListenerGroup(t){return up.EventListenerGroup.fromBindArgs(t,{guard:t=>this.containsEventTarget(t),elements:[this.element],baseLayer:this})}containsEventTarget(t){return this.contains(t.target)}wasHitByMouseEvent(t){const e=document.elementFromPoint(t.clientX,t.clientY);return!e||this.contains(e)}buildEventEmitter(t){return up.EventEmitter.fromEmitArgs(t,{layer:this})}emit(...t){return this.buildEventEmitter(t).emit()}isDetached(){return!this.element.isConnected}saveHistory(){this.isHistoryVisible()&&(this.savedTitle=document.title,this.savedLocation=up.history.location)}restoreHistory(){this.showsLiveHistory()&&(this.savedLocation&&up.history.push(this.savedLocation),this.savedTitle&&(document.title=this.savedTitle))}asCurrent(t){return this.stack.asCurrent(this,t)}updateHistory(t){e.isString(t.location)&&(this.location=t.location),e.isString(t.title)&&(this.title=t.title)}isHistoryVisible(){return this.history&&(this.isRoot()||this.parent.isHistoryVisible())}showsLiveHistory(){return this.isHistoryVisible()&&this.isFront()&&(up.history.config.enabled||this.isRoot())}get title(){return this.showsLiveHistory()?document.title:this.savedTitle}set title(t){this.savedTitle=t,this.showsLiveHistory()&&(document.title=t)}get location(){return this.showsLiveHistory()?up.history.location:this.savedLocation}set location(t){(this.location!==(t=up.history.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)}}},7101:()=>{var t;up.Layer.Cover=((t=class extends up.Layer.OverlayWithViewport{}).mode="cover",t)},5580:()=>{var t;up.Layer.Drawer=((t=class extends up.Layer.OverlayWithViewport{}).mode="drawer",t)},86:()=>{var t;up.Layer.Modal=((t=class extends up.Layer.OverlayWithViewport{}).mode="modal",t)},7403:()=>{const t=up.element,e=up.util;up.Layer.Overlay=class extends up.Layer{keys(){return super.keys().concat(["position","align","size","origin","class","backdrop","openAnimation","closeAnimation","openDuration","closeDuration","openEasing","closeEasing","backdropOpenAnimation","backdropCloseAnimation","dismissable","dismissLabel","dismissAriaLabel","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=e.parseTokens(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.nesting=this.suggestVisualNesting());const n=e.compactObject(e.pick(this,["align","position","size","class","nesting"]));this.element=this.affixPart(t,null,n)}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,e){this.contentElement=this.affixPart(t,"content"),this.contentElement.appendChild(e)}createDismissElement(e){return this.dismissElement=this.affixPart(e,"dismiss",{"up-dismiss":'":button"',"aria-label":this.dismissAriaLabel}),t.affix(this.dismissElement,'span[aria-hidden="true"]',{text:this.dismissLabel})}affixPart(e,n,r={}){return t.affix(e,this.selector(n),r)}static selector(t){return e.compact(["up",this.mode,t]).join("-")}suggestVisualNesting(){const{parent:t}=this;return this.mode===t.mode?1+t.suggestVisualNesting():0}setupHandlers(){var t,e;super.setupHandlers(),this.overlayFocus=new up.OverlayFocus(this),this.supportsDismissMethod("button")&&this.createDismissElement(this.getBoxElement()),this.supportsDismissMethod("outside")&&(this.viewportElement?up.on(this.viewportElement,"up:click",(t=>{t.target===this.viewportElement&&this.onOutsideClicked(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.onOutsideClicked(t,n)}}))),this.supportsDismissMethod("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)})),null===(e=(t=up.migrate).registerLayerCloser)||void 0===e||e.call(t,this),this.registerEventCloser(this.acceptEvent,this.accept),this.registerEventCloser(this.dismissEvent,this.dismiss),this.on("up:click","label[for]",((t,e)=>this.onLabelClicked(t,e)))}onLabelClicked(e,n){let r=n.getAttribute("for"),i=up.form.fieldSelector(t.idSelector(r)),s=up.fragment.all(i,{layer:"any"}),o=up.fragment.all(i,{layer:this});if(s.length>1&&o[0]!==s[0]){e.preventDefault();const t=o[0];t.focus(),t.matches("input[type=checkbox], input[type=radio]")&&t.click()}}onOutsideClicked(t,e){up.log.putsEvent(t),e&&up.event.halt(t),this.dismiss(":outside",{origin:t.target})}onEscapePressed(t){if(this.isFront()){let e=up.form.focusedField();e?e.blur():this.supportsDismissMethod("key")&&(up.event.halt(t,{log:!0}),this.dismiss(":key"))}}registerClickCloser(e,n){let r=`[${e}]`;this.on("up:click",r,(function(i){up.event.halt(i,{log:!0});const s=i.target.closest(r),o=t.jsonAttr(s,e),a={origin:s},u=new up.OptionsParser(s,a);u.booleanOrString("animation"),u.string("easing"),u.number("duration"),u.string("confirm"),n(o,a)}))}registerEventCloser(t,e){if(t)return this.on(t,(t=>{t.preventDefault(),e.call(this,t)}))}tryAcceptForLocation(){this.tryCloseForLocation(this.acceptLocation,this.accept)}tryDismissForLocation(){this.tryCloseForLocation(this.dismissLocation,this.dismiss)}tryCloseForLocation(t,e){let n,r;if(t&&(n=this.location)&&(r=t.recognize(n))){const t=Object.assign(Object.assign({},r),{location:n});e.call(this,t)}}teardownHandlers(){var t,e;super.teardownHandlers(),null===(t=this.unbindParentClicked)||void 0===t||t.call(this),null===(e=this.unbindEscapePressed)||void 0===e||e.call(this),this.overlayFocus.teardown()}destroyElements(t){const e=Object.assign(Object.assign({},t),{animation:()=>this.startCloseAnimation(t),onFinished:()=>{var e;this.onElementsRemoved(),null===(e=t.onFinished)||void 0===e||e.call(t)},log:!1});up.destroy(this.element,e)}onElementsRemoved(){}startAnimation(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])}startOpenAnimation(t={}){var e;return this.startAnimation({boxAnimation:null!==(e=t.animation)&&void 0!==e?e:this.evalOption(this.openAnimation),backdropAnimation:"fade-in",easing:t.easing||this.openEasing,duration:t.duration||this.openDuration}).then((()=>this.wasEverVisible=!0))}startCloseAnimation(t={}){var e;const n=this.wasEverVisible&&(null!==(e=t.animation)&&void 0!==e?e:this.evalOption(this.closeAnimation));return this.startAnimation({boxAnimation:n,backdropAnimation:"fade-out",easing:t.easing||this.closeEasing,duration:t.duration||this.closeDuration})}accept(t=null,e={}){return this.executeCloseChange("accept",t,e)}dismiss(t=null,e={}){return this.executeCloseChange("dismiss",t,e)}supportsDismissMethod(t){return e.contains(this.dismissable,t)}executeCloseChange(t,e,n){return n=Object.assign(Object.assign({},n),{verb:t,value:e,layer:this}),new up.Change.CloseLayer(n).execute()}getFirstSwappableElement(){return this.getContentElement().children[0]}toString(){return`${this.mode} overlay`}}},6412:()=>{up.Layer.OverlayWithTether=class extends up.Layer.Overlay{createElements(t){this.origin||up.fail("Missing { origin } option"),this.tether=new up.Tether({anchor:this.origin,align:this.align,position:this.position}),this.createElement(this.tether.parent),this.createContentElement(this.element,t),this.tether.start(this.element)}onElementsRemoved(){this.tether.stop()}sync(){this.isOpen()&&(this.isDetached()||this.tether.isDetached()?this.dismiss(":detached",{animation:!1,preventable:!1}):this.tether.sync())}}},7965:()=>{var t;up.Layer.OverlayWithViewport=((t=class extends up.Layer.Overlay{static getParentElement(){return document.body}createElements(t){this.shiftBody(),this.createElement(this.constructor.getParentElement()),this.backdrop&&this.createBackdropElement(this.element),this.createViewportElement(this.element),this.createBoxElement(this.viewportElement),this.createContentElement(this.boxElement,t)}onElementsRemoved(){this.unshiftBody()}shiftBody(){this.constructor.bodyShifter.shift()}unshiftBody(){this.constructor.bodyShifter.unshift()}sync(){this.isDetached()&&this.isOpen()&&this.constructor.getParentElement().appendChild(this.element)}}).bodyShifter=new up.BodyShifter,t)},4552:()=>{var t;up.Layer.Popup=((t=class extends up.Layer.OverlayWithTether{}).mode="popup",t)},7771:()=>{var t;const e=up.element;up.Layer.Root=((t=class extends up.Layer{constructor(t){super(t),this.setupHandlers()}get element(){return e.root}getFirstSwappableElement(){return document.body}static selector(){return"html"}setupHandlers(){this.element.upHandlersApplied||(this.element.upHandlersApplied=!0,super.setupHandlers())}sync(){this.setupHandlers()}accept(){this.cannotCloseRoot()}dismiss(){this.cannotCloseRoot()}cannotCloseRoot(){up.fail("Cannot close the root layer")}reset(){Object.assign(this,this.defaults())}toString(){return"root layer"}}).mode="root",t)},6066:()=>{const t=up.util,e=up.element;up.LayerLookup=class{constructor(e,...n){this.stack=e;const r=t.parseArgIntoOptions(n,"layer");if(!1!==r.normalizeLayerOptions&&up.layer.normalizeOptions(r),this.values=t.parseTokens(r.layer),this.origin=r.origin,this.baseLayer=r.baseLayer||this.originLayer()||this.stack.current,t.isString(this.baseLayer)){const t=Object.assign(Object.assign({},r),{baseLayer:this.stack.current,normalizeLayerOptions:!1});this.baseLayer=new this.constructor(this.stack,this.baseLayer,t).first()}}originLayer(){if(this.origin)return this.forElement(this.origin)}first(){return this.all()[0]}all(){let e=t.flatMap(this.values,(t=>this.resolveValue(t)));return e=t.compact(e),e=t.uniq(e),e}forElement(n){return n=e.get(n),t.find(this.stack.reversed(),(t=>t.contains(n)))}forIndex(t){return this.stack[t]}resolveValue(e){if(e instanceof up.Layer)return e;if(t.isNumber(e))return this.forIndex(e);if(/^\d+$/.test(e))return this.forIndex(Number(e));if(t.isElementish(e))return this.forElement(e);switch(e){case"any":return[this.baseLayer,...this.stack.reversed()];case"current":return this.baseLayer;case"closest":return this.stack.selfAndAncestorsOf(this.baseLayer);case"parent":return this.baseLayer.parent;case"ancestor":case"ancestors":return this.baseLayer.ancestors;case"child":return this.baseLayer.child;case"descendant":case"descendants":return this.baseLayer.descendants;case"new":return"new";case"root":return this.stack.root;case"overlay":case"overlays":return t.reverse(this.stack.overlays);case"front":return this.stack.front;case"origin":return this.originLayer();default:return up.fail("Unknown { layer } option: %o",e)}}}},6387:()=>{const t=up.util;up.LayerStack=class extends Array{constructor(){super(),Object.setPrototypeOf(this,up.LayerStack.prototype),this.currentOverrides=[],this.push(this.buildRoot())}buildRoot(){return up.layer.build({mode:"root",stack:this})}remove(e){t.remove(this,e)}peel(e,n){const r=t.reverse(e.descendants),i=Object.assign(Object.assign({},n),{preventable:!1});for(let t of r)t.dismiss(":peel",i)}reset(){this.peel(this.root,{animation:!1}),this.currentOverrides=[],this.root.reset()}isOpen(t){return t.index>=0}isClosed(t){return!this.isOpen(t)}parentOf(t){return this[t.index-1]}childOf(t){return this[t.index+1]}ancestorsOf(e){return t.reverse(this.slice(0,e.index))}selfAndAncestorsOf(t){return[t,...t.ancestors]}descendantsOf(t){return this.slice(t.index+1)}isRoot(t){return this[0]===t}isOverlay(t){return!this.isRoot(t)}isCurrent(t){return this.current===t}isFront(t){return this.front===t}get(...t){return this.getAll(...t)[0]}getAll(...t){return new up.LayerLookup(this,...t).all()}sync(){for(let t of this)t.sync()}asCurrent(t,e){try{return this.currentOverrides.push(t),e()}finally{this.currentOverrides.pop()}}reversed(){return t.reverse(this)}dismissOverlays(e=null,n={}){n.dismissable=!1;for(let r of t.reverse(this.overlays))r.dismiss(e,n)}[t.copy.key](){return t.copyArrayLike(this)}get count(){return this.length}get root(){return this[0]}get overlays(){return this.root.descendants}get current(){return t.last(this.currentOverrides)||this.front}get front(){return t.last(this)}}},5390:()=>{up.LinkFeedbackURLs=class{constructor(t){const e=up.feedback.normalizeURL;if(this.isSafe=up.link.isSafe(t),this.isSafe){const n=t.getAttribute("href");n&&"#"!==n&&(this.href=e(n));const r=t.getAttribute("up-href");r&&(this.upHREF=e(r));const i=t.getAttribute("up-alias");i&&(this.aliasPattern=new up.URLPattern(i,e))}}isCurrent(t){return this.isSafe&&!!(this.href&&this.href===t||this.upHREF&&this.upHREF===t||this.aliasPattern&&this.aliasPattern.test(t,!1))}}},2618:()=>{const t=up.util,e=up.element;up.LinkPreloader=class{constructor(){this.considerPreload=this.considerPreload.bind(this)}watchLink(t){up.link.isSafe(t)&&(this.on(t,"mouseenter",(t=>this.considerPreload(t,!0))),this.on(t,"mousedown touchstart",(t=>this.considerPreload(t))),this.on(t,"mouseleave",(t=>this.stopPreload(t))))}on(t,e,n){up.on(t,e,{passive:!0},n)}considerPreload(t,e){const n=t.target;n!==this.currentLink&&(this.reset(),this.currentLink=n,up.link.shouldFollowEvent(t,n)&&(e?this.preloadAfterDelay(t,n):this.preloadNow(t,n)))}stopPreload(t){if(t.target===this.currentLink)return this.reset()}reset(){var t;this.currentLink&&(clearTimeout(this.timer),(null===(t=this.currentRequest)||void 0===t?void 0:t.background)&&this.currentRequest.abort(),this.currentLink=void 0,this.currentRequest=void 0)}preloadAfterDelay(n,r){var i;const s=null!==(i=e.numberAttr(r,"up-preload-delay"))&&void 0!==i?i:up.link.config.preloadDelay;this.timer=t.timer(s,(()=>this.preloadNow(n,r)))}preloadNow(t,e){e.isConnected?(up.log.putsEvent(t),up.error.muteUncriticalRejection(up.link.preload(e,{onQueued:t=>this.currentRequest=t})),this.queued=!0):this.reset()}}},1653:()=>{let t="up.log.enabled",e=!1;try{e=!!(null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem(t))}catch(t){}up.LogConfig=class extends up.Config{constructor(){super((()=>({banner:!0,format:!0})))}get enabled(){return e}set enabled(n){e=n;try{null===sessionStorage||void 0===sessionStorage||sessionStorage.setItem(t,n?"1":"")}catch(t){}}}},7792:function(){var t=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,s){function o(t){try{u(r.next(t))}catch(t){s(t)}}function a(t){try{u(r.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}u((r=r.apply(t,e||[])).next())}))};const e=up.util,n=up.element;up.MotionController=class{constructor(t){this.activeClass=`up-${t}`,this.selector=`.${this.activeClass}`,this.finishEvent=`up:${t}:finish`,this.finishCount=0,this.clusterCount=0}startFunction(t,e,r={}){var i;t=n.list(t);const s=()=>up.error.muteUncriticalRejection(e());if(r.trackMotion=null!==(i=r.trackMotion)&&void 0!==i?i:up.motion.isEnabled(),!1===r.trackMotion)return s();{r.trackMotion=!1,this.finish(t),this.markCluster(t);let e=this.whileForwardingFinishEvent(t,s);return e=e.then((()=>this.unmarkCluster(t))),e}}finish(t){var e,n;if(this.finishCount++,0!==this.clusterCount&&up.motion.isEnabled()){t=this.expandFinishRequest(t);for(let e of t)this.finishOneElement(e);return null===(n=(e=up.migrate).formerlyAsync)||void 0===n?void 0:n.call(e,"up.motion.finish()")}}expandFinishRequest(t){return t?e.flatMap(t,(t=>n.list(t.closest(this.selector),t.querySelectorAll(this.selector)))):document.querySelectorAll(this.selector)}isActive(t){return t.classList.contains(this.activeClass)}finishOneElement(t){this.emitFinishEvent(t)}emitFinishEvent(t,e={}){return e=Object.assign({target:t,log:!1},e),up.emit(this.finishEvent,e)}markCluster(t){this.clusterCount++,this.toggleActive(t,!0)}unmarkCluster(t){this.clusterCount--,this.toggleActive(t,!1)}toggleActive(t,e){for(let n of t)n.classList.toggle(this.activeClass,e)}whileForwardingFinishEvent(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.emitFinishEvent(n,{forwarded:!0})}));return e().then(n)}reset(){return t(this,void 0,void 0,(function*(){yield this.finish(),this.finishCount=0,this.clusterCount=0}))}}},4308:()=>{const t=up.util,e=up.element;up.NonceableCallback=class{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){if(up.browser.canEval())return new Function(...t,this.script);if(this.nonce){let e=this;return function(...n){return e.runAsNoncedFunction(this,t,n)}}return this.cannotRun.bind(this)}toString(){return`nonce-${this.nonce} ${this.script}`}cannotRun(){throw new Error(`Your Content Security Policy disallows inline JavaScript (${this.script}). See https://unpoly.com/csp for solutions.`)}runAsNoncedFunction(t,e,n){let r,i=`\n try {\n up.noncedEval.value = (function(${e.join(",")}) {\n ${this.script}\n }).apply(up.noncedEval.thisArg, up.noncedEval.args)\n } catch (error) {\n up.noncedEval.error = error\n }\n `;try{if(up.noncedEval={args:n,thisArg:t},r=up.element.affix(document.body,"script",{nonce:this.nonce,text:i}),up.noncedEval.error)throw up.noncedEval.error;return up.noncedEval.value}finally{up.noncedEval=void 0,r&&r.remove()}}allowedBy(e){return this.nonce&&t.contains(e,this.nonce)}static adoptNonces(n,r){if(!(null==r?void 0:r.length))return;const i=t.memoize(up.protocol.cspNonce);t.each(up.protocol.config.nonceableAttributes,(s=>{let o=e.subtree(n,`[${s}^="nonce-"]`);t.each(o,(t=>{let e=t.getAttribute(s),n=this.fromString(e),o=(t,...n)=>up.log.warn("up.render()",`Cannot use callback [${s}="${e}"]: ${t}`,...n);if(!n.allowedBy(r))return o("Callback's CSP nonce (%o) does not match response header (%o)",n.nonce,r);let a=i();if(!a)return o("Current page's CSP nonce is unknown");n.nonce=a,t.setAttribute(s,n.toString())}))}))}}},1104:()=>{const t=up.util,e=up.element;up.OptionsParser=class{constructor(t,e,n={}){this.options=e,this.element=t,this.fail=n.fail,this.closest=n.closest,this.attrPrefix=n.attrPrefix||"up-",this.defaults=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)}json(t,n){this.parse(e.jsonAttr,t,n)}callback(t,n={}){this.parse(((t,r)=>e.callbackAttr(t,r,n)),t,n)}parse(e,n,r={}){var i,s;const o=t.wrapList(null!==(i=r.attr)&&void 0!==i?i:this.attrNameForKey(n));let a=this.options[n];for(let t of o)null!=a||(a=this.parseFromAttr(e,this.element,t));null!=a||(a=null!==(s=r.default)&&void 0!==s?s:this.defaults[n]);let u,l=r.normalize;if(l&&(a=l(a)),t.isDefined(a)&&(this.options[n]=a),this.fail&&(u=up.fragment.failKey(n))){const n=t.compact(t.map(o,(t=>this.deriveFailAttrName(t))));this.parse(e,u,Object.assign(Object.assign({},r),{attr:n}))}}parseFromAttr(t,n,r){return this.closest?e.closestAttr(n,r,t):t(n,r)}deriveFailAttrName(t){return this.deriveFailAttrNameForPrefix(t,this.attrPrefix+"on-")||this.deriveFailAttrNameForPrefix(t,this.attrPrefix)}deriveFailAttrNameForPrefix(t,e){if(t.startsWith(e))return`${e}fail-${t.substring(e.length)}`}attrNameForKey(e){return`${this.attrPrefix}${t.camelToKebabCase(e)}`}}},8665:()=>{const t=up.element,e=up.util;up.OverlayFocus=class{constructor(t){this.layer=t,this.focusElement=this.layer.getFocusElement()}moveToFront(){this.enabled||(this.enabled=!0,this.untrapFocus=up.on("focusin",(t=>this.onFocus(t))),this.unsetAttrs=t.setTemporaryAttrs(this.focusElement,{tabindex:"0",role:"dialog","aria-modal":"true"}),this.focusTrapBefore=t.affix(this.focusElement,"beforebegin","up-focus-trap[tabindex=0]"),this.focusTrapAfter=t.affix(this.focusElement,"afterend","up-focus-trap[tabindex=0]"))}moveToBack(){this.teardown()}teardown(){this.enabled&&(this.enabled=!1,this.untrapFocus(),this.unsetAttrs(),this.focusTrapBefore.remove(),this.focusTrapAfter.remove())}onFocus(t){const{target:e}=t;this.processingFocusEvent||up.layer.isWithinForeignOverlay(e)||(this.processingFocusEvent=!0,e===this.focusTrapBefore?this.focusEnd():e!==this.focusTrapAfter&&this.layer.contains(e)||this.focusStart(),this.processingFocusEvent=!1)}focusStart(t){up.focus(this.focusElement,t)}focusEnd(){this.focusLastDescendant(this.layer.getBoxElement())||this.focusStart()}focusLastDescendant(t){for(let n of e.reverse(t.children))if(up.viewport.tryFocus(n)||this.focusLastDescendant(n))return!0}}},3645:()=>{const t=up.util,e=up.element;up.Params=class{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:r,value:i}=n;t.isBasicObjectProperty(r)||(this.isArrayKey(r)?(e[r]||(e[r]=[]),e[r].push(i)):e[r]=i)}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.arrayEntryToQuery.bind(this));return e=t.compact(e),e.join("&")}arrayEntryToQuery(e){const{value:n}=e;if(this.isBinaryValue(n))return;let r=encodeURIComponent(e.name);return t.isGiven(n)&&(r+="=",r+=encodeURIComponent(n)),r}isBinaryValue(t){return t instanceof Blob}hasBinaryValues(){const e=t.map(this.entries,"value");return t.some(e,this.isBinaryValue)}toURL(e){let n=[e,this.toQuery()];n=t.filter(n,t.isPresent);const r=t.contains(e,"?")?"&":"?";return n.join(r)}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.addAllFromQuery(e):t.isFormData(e)?this.addAllFromFormData(e):t.isObject(e)?this.addAllFromObject(e):up.fail("Unsupport params type: %o",e))}addAllFromObject(e){for(let n in e){const r=e[n],i=t.isArray(r)?r:[r];for(let t of i)this.add(n,t)}}addAllFromQuery(e){for(let n of e.split("&"))if(n){let[e,r]=n.split("=");e=decodeURIComponent(e),r=t.isGiven(r)?decodeURIComponent(r):null,this.add(e,r)}}addAllFromFormData(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.matchEntryFn(e))}matchEntryFn(t){return e=>e.name===t}get(t){return this.isArrayKey(t)?this.getAll(t):this.getFirst(t)}getFirst(e){const n=t.find(this.entries,this.matchEntryFn(e));return null==n?void 0:n.value}getAll(e){if(this.isArrayKey(e))return this.getAll(e);{const n=t.map(this.entries,this.matchEntryFn(e));return t.map(n,"value")}}isArrayKey(t){return t.endsWith("[]")}[t.isBlank.key](){return 0===this.entries.length}static fromForm(t){return t=up.fragment.get(t),this.fromFields(up.form.fields(t))}static fromFields(e){const n=new this;for(let r of t.wrapList(e))n.addField(r);return n}addField(t){let n=(t=e.get(t)).name;if(n&&!t.disabled){const{tagName:e}=t,{type:r}=t;if("SELECT"===e)for(let e of t.querySelectorAll("option"))e.selected&&this.add(n,e.value);else if("checkbox"===r||"radio"===r)t.checked&&this.add(n,t.value);else{if("file"!==r)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 r=t.parseURL(e).search;return r&&(r=r.replace(/^\?/,""),n.addAll(r)),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)}}},7782:()=>{const t=up.element;up.ProgressBar=class{constructor(){this.step=0,this.element=t.affix(document.body,"up-progress-bar"),this.element.style.transition="width 300ms ease-out",this.moveTo(0),up.element.paint(this.element),this.width=31,this.nextStep()}nextStep(){let t;t=this.width<80?Math.random()<.15?7+5*Math.random():1.5+.5*Math.random():.13*(100-this.width)*Math.random(),this.moveTo(this.width+t),this.step++;const e=300+40*this.step;this.timeout=setTimeout(this.nextStep.bind(this),e)}moveTo(t){this.width=t,this.element.style.width=`${t}vw`}destroy(){clearTimeout(this.timeout),this.element.remove()}conclude(){clearTimeout(this.timeout),this.moveTo(100),setTimeout(this.destroy.bind(this),300)}}},2406:()=>{const t=up.util;up.Record=class{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 this.variant()}variant(e={}){return new this.constructor(t.merge(this.attributes(),e))}[t.isEqual.key](e){return this.constructor===e.constructor&&t.isEqual(this.attributes(),e.attributes())}}},1279:()=>{up.Rect=class extends up.Record{keys(){return["left","top","width","height"]}get bottom(){return this.top+this.height}get right(){return this.left+this.width}static fromElement(t){return new this(t.getBoundingClientRect())}}},2714:function(){var t,e=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,s){function o(t){try{u(r.next(t))}catch(t){s(t)}}function a(t){try{u(r.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}u((r=r.apply(t,e||[])).next())}))};const n=up.util;up.RenderJob=(t=class{constructor(t){this.options=up.RenderOptions.preprocess(t),this.rendered=this.execute()}execute(){var t,n;return e(this,void 0,void 0,(function*(){try{let t=yield this.makeChange();return this.runResultCallbacks(t),t}catch(e){throw this.runResultCallbacks(e)||null===(n=(t=this.options).onError)||void 0===n||n.call(t,e),e}}))}runResultCallbacks(t){var e,n;if(t instanceof up.RenderResult)return t.none||null===(n=(e=t.options).onRendered)||void 0===n||n.call(e,t),t.finished.then(t.options.onFinished),!0}get finished(){return this.awaitFinished()}awaitFinished(){return e(this,void 0,void 0,(function*(){try{let t=yield this.rendered;return yield t.finished}catch(t){throw t instanceof up.RenderResult?yield t.finished:t}}))}makeChange(){if(this.guardRender(),this.options.url){let t=t=>this.handleAbortOption(t);this.change=new up.Change.FromURL(Object.assign(Object.assign({},this.options),{onRequest:t}))}else this.change=new up.Change.FromContent(this.options),this.handleAbortOption(null);return this.change.execute()}guardRender(){up.browser.assertConfirmed(this.options);let t=n.pluckKey(this.options,"guardEvent");if(t&&(t.renderOptions=this.options,up.emit(t,{target:this.options.origin}).defaultPrevented)){let e=`Rendering was prevented by ${t.type} listener`;throw up.puts("up.render()",e),new up.Aborted(e)}up.RenderOptions.assertContentGiven(this.options)}handleAbortOption(t){let{abort:e}=this.options;if(!e||!up.network.isBusy())return;let{fragments:r,layer:i,origin:s}=this.change.getPreflightProps(),o={except:t,logOnce:["up.render()","Change with { abort } option will abort other requests"]};"target"===e?up.fragment.abort(r,o):"layer"===e?up.fragment.abort(Object.assign(Object.assign({},o),{layer:i})):"all"===e||!0===e?up.fragment.abort(Object.assign(Object.assign({},o),{layer:"any"})):n.isFunction(e)?e(o):up.fragment.abort(e,Object.assign(Object.assign({},o),{layer:i,origin:s}))}},n.delegate(t.prototype,["then","catch","finally"],(function(){return this.rendered})),t)},2705:()=>{const t=up.util;up.RenderOptions=function(){const e={useHungry:!0,useKeep:!0,source:!0,saveScroll:!0,saveFocus:!0,focus:"keep",abort:"target",revalidate:"auto",failOptions:!0},n={abort:!1,confirm:!1,feedback:!1,cache:!0,background:!0},r=["url","method","origin","headers","params","cache","fallback","abort","abortable","confirm","feedback","origin","baseLayer","fail","onError"].concat(["keep","hungry","history","source","saveScroll","navigate"]),i=["url","content","fragment","document"],s=["history","focus","scroll"];function o(t){const e={};for(let n in t){const r=t[n];let i=up.fragment.successKey(n);i&&(e[i]=r)}return e}return{preprocess:function(r){var i,o;null===(o=(i=up.migrate).preprocessRenderOptions)||void 0===o||o.call(i,r);const a=t.merge(e,function(t){if(t.navigate)return up.fragment.config.navigateOptions}(r));return t.merge(t.omit(a,s),{defaults:a},r,function(t){if(t.preload)return n}(r))},finalize:function(e,n){return t.merge(e.defaults,n,e)},assertContentGiven:function(e){t.some(i,(n=>t.isGiven(e[n])))||(e.defaultToEmptyContent?e.content="":up.fail("up.render() needs either { "+i.join(", ")+" } option"))},deriveFailOptions:function(e){return e.failOptions?Object.assign(Object.assign(Object.assign(Object.assign({},e.defaults),t.pick(e,r)),o(e)),{failPrefixForced:!0}):Object.assign(Object.assign({},e),o(e))}}}()},606:()=>{up.RenderResult=class 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]}}},5437:()=>{var t;const e=up.util;up.Request=(t=class extends up.Record{constructor(t){var n;if(super(t),this.params=new up.Params(this.params),null==this.wrapMethod&&(this.wrapMethod=up.network.config.wrapMethod),this.normalizeForCaching(),(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||this.layer,t),this.context||(this.context=this.layer.context||{}),this.failContext||(this.failContext=this.failLayer.context||{}),this.mode||(this.mode=this.layer.mode),this.failMode||(this.failMode=this.failLayer.mode)}this.deferred=e.newDeferred(),null!==(n=this.badResponseTime)&&void 0!==n||(this.badResponseTime=e.evalOption(up.network.config.badResponseTime,this))}keys(){return["method","url","hash","params","target","failTarget","headers","timeout","preload","background","cache","expireCache","evictCache","layer","mode","context","failLayer","failMode","failContext","origin","fragments","queuedAt","wrapMethod","contentType","payload","onQueued","fail","abortable","badResponseTime"]}defaults(){return{state:"new",abortable:!0,headers:{},timeout:up.network.config.timeout}}get xhr(){var t;return null!==(t=this._xhr)&&void 0!==t?t:this._xhr=new XMLHttpRequest}get fragments(){if(!this._fragments&&this.target){let t=up.fragment.parseTargetSteps(this.target),n=e.map(t,"selector"),r={origin:this.origin,layer:this.layer};this._fragments=e.compact(e.map(n,(t=>up.fragment.get(t,r))))}return this._fragments}set fragments(t){this._fragments=t}get fragment(){var t;return null===(t=this.fragments)||void 0===t?void 0:t[0]}followState(t){e.delegate(this,["deferred","state","preload","expired"],(()=>t))}normalizeForCaching(){this.method=e.normalizeMethod(this.method),this.extractHashFromURL(),this.transferParamsToURL(),this.url=e.normalizeURL(this.url)}evictExpensiveAttrs(){e.task((()=>{this.layer=void 0,this.failLayer=void 0,this.origin=void 0,this.fragments=void 0}))}extractHashFromURL(){var t;let e=null===(t=this.url)||void 0===t?void 0:t.match(/^([^#]*)(#.+)$/);if(e)return this.url=e[1],this.hash=e[2]}transferParamsToURL(){!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(){var t;e.always(this,(()=>this.evictExpensiveAttrs())),null===(t=this.onQueued)||void 0===t||t.call(this,this)}load(){"new"===this.state&&(this.state="loading",this.expired=!1,new up.Request.XHRRenderer(this).buildAndSend({onload:()=>this.onXHRLoad(),onerror:()=>this.onXHRError(),ontimeout:()=>this.onXHRTimeout(),onabort:()=>this.onXHRAbort()}))}loadPage(){up.network.abort(),new up.Request.FormRenderer(this).buildAndSubmit()}onXHRLoad(){const t=this.extractResponseFromXHR(),e="Loaded "+t.description;this.emit("up:request:loaded",{request:t.request,response:t,log:e}),this.respondWith(t)}onXHRError(){this.setOfflineState("Network error")}onXHRTimeout(){this.setOfflineState("Timeout")}onXHRAbort(){this.setAbortedState()}abort({reason:t}={}){this.setAbortedState(t)&&this._xhr&&this._xhr.abort()}setAbortedState(t){if(this.isSettled())return;let e="Aborted request to "+this.description+(t?": "+t:"");return this.state="aborted",this.deferred.reject(new up.Aborted(e)),this.emit("up:request:aborted",{log:e}),!0}setOfflineState(t){if(this.isSettled())return;let e="Cannot load request to "+this.description+(t?": "+t:"");this.state="offline",this.deferred.reject(new up.Offline(e)),this.emit("up:request:offline",{log:e})}respondWith(t){if("loading"===this.state)return this.state="loaded",t.ok?this.deferred.resolve(t):this.deferred.reject(t)}isSettled(){return"new"!==this.state&&"loading"!==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)}extractResponseFromXHR(){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),r=up.protocol.locationFromXHR(this.xhr);return r&&(e.matchURLs(this.url,r)||n||(n="GET"),t.url=r),n&&(t.method=n),new up.Response(t)}cacheKey(){return JSON.stringify([this.method,this.url,this.params.toQuery(),this.metaProps()])}metaProps(){const t={};for(let n of e.evalOption(up.network.config.requestMetaKeys,this)){const r=this[n];e.isGiven(r)&&(t[n]=r)}return t}buildEventEmitter(t){return up.EventEmitter.fromEmitArgs(t,{layer:this.layer,request:this,origin:this.origin})}emit(...t){return this.buildEventEmitter(t).emit()}assertEmitted(...t){this.buildEventEmitter(t).assertEmitted()}get description(){return this.method+" "+this.url}isPartOfSubtree(t){return!(!this.fragments||!t)&&(t=e.wrapList(t),e.some(this.fragments,(function(n){return e.some(t,(t=>t.contains(n)))})))}get queueAge(){return new Date-this.queuedAt}static tester(t,{except:n}={}){let r;if(e.isFunction(t))r=t;else if(t instanceof this)r=e=>t===e;else if(e.isString(t)){let e=new up.URLPattern(t);r=t=>e.test(t.url)}else r=e=>t;if(n){let t=n.cacheKey();return e=>e.cacheKey()!==t&&r(e)}return r}},e.delegate(t.prototype,["then","catch","finally"],(function(){return this.deferred})),t)},7974:()=>{let t=up.util;up.Request.Cache=class extends up.Cache{maxSize(){return up.network.config.cacheSize}evictAge(){return up.network.config.cacheEvictAge}normalizeStoreKey(e){return t.wrapValue(up.Request,e).cacheKey()}evict(t=!0,e){this.eachMatch(t,e,(({key:t})=>this.map.delete(t)))}expire(t=!0,e){this.eachMatch(t,e,(({value:t})=>t.expired=!0))}eachMatch(t=!0,e,n){let r=up.Request.tester(t,e);for(let t of this.records())r(t.value)&&n(t)}}},5221:()=>{const t=up.util,e=up.element,n=["GET","POST"];up.Request.FormRenderer=class{constructor(t){this.request=t}buildAndSubmit(){this.params=t.copy(this.request.params);let r=this.request.url,{method:i}=this.request;const s=up.Params.fromURL(r);this.params.addAll(s),r=up.Params.stripURL(r),t.contains(n,i)||(i=up.protocol.wrapMethod(i,this.params)),this.form=e.affix(document.body,"form.up-request-loader",{method:i,action:r});let o,a,u=this.request.contentType;u&&this.form.setAttribute("enctype",u),(o=this.request.csrfParam())&&(a=this.request.csrfToken())&&this.params.add(o,a),t.each(this.params.toArray(),this.addField.bind(this)),up.browser.submitForm(this.form)}addField(t){e.affix(this.form,"input[type=hidden]",t)}}},6413:()=>{const t=up.util;up.Request.Queue=class{constructor(){this.reset()}reset(){this.queuedRequests=[],this.currentRequests=[],this.emittedLate=!1}get allRequests(){return this.currentRequests.concat(this.queuedRequests)}asap(e){e.runQueuedCallbacks(),t.always(e,(t=>this.onRequestSettled(e,t))),e.queuedAt=new Date,this.scheduleSlowTimer(e),this.queueRequest(e),t.microtask((()=>this.poke()))}promoteToForeground(t){t.background&&(t.background=!1,this.scheduleSlowTimer(t))}scheduleSlowTimer(e){let n=Math.max(e.badResponseTime-e.queueAge,0);t.timer(n,(()=>this.checkLate()))}getMaxConcurrency(){return t.evalOption(up.network.config.concurrency)}hasConcurrencyLeft(){const t=this.getMaxConcurrency();return-1===t||this.currentRequests.length<t}isBusy(){return this.currentRequests.length>0||this.queuedRequests.length>0}queueRequest(t){this.queuedRequests.push(t)}pluckNextRequest(){let e=t.find(this.queuedRequests,(t=>!t.background));return e||(e=this.queuedRequests[0]),t.remove(this.queuedRequests,e)}sendRequestNow(t){t.emit("up:request:load",{log:["Loading %s %s",t.method,t.url]}).defaultPrevented?t.abort({reason:"Prevented by event listener"}):(t.normalizeForCaching(),this.currentRequests.push(t),t.load())}onRequestSettled(e,n){t.remove(this.currentRequests,e)||t.remove(this.queuedRequests,e),n instanceof up.Response&&n.ok&&up.network.registerAliasForRedirect(e,n),this.checkLate(),t.microtask((()=>this.poke()))}poke(){let t;if(this.hasConcurrencyLeft()&&(t=this.pluckNextRequest()))return this.sendRequestNow(t)}abort(...e){var n;let r=t.extractOptions(e),{except:i,reason:s,logOnce:o}=r,a=null===(n=e[0])||void 0===n||n,u=up.Request.tester(a,{except:i});for(let e of[this.currentRequests,this.queuedRequests]){const n=t.filter(e,u);for(let r of n)o&&(up.puts(...o),o=null),r.abort({reason:s}),t.remove(e,r)}}checkLate(){const t=this.isLate();this.emittedLate!==t&&(this.emittedLate=t,t?up.emit("up:network:late",{log:"Server is slow to respond"}):up.emit("up:network:recover",{log:"Slow requests were loaded"}))}isLate(){const e=t.reject(this.allRequests,"background");return t.some(e,(t=>t.queueAge>=t.badResponseTime-1))}}},2298:()=>{var t;const e="multipart/form-data",n=up.util;up.Request.XHRRenderer=(t=class{constructor(t){this.request=t}buildAndSend(t){const e=this.request.xhr;this.params=n.copy(this.request.params),this.request.timeout&&(e.timeout=this.request.timeout),e.open(this.getMethod(),this.request.url);const r=this.request.metaProps();for(let t in r)this.addHeader(e,up.protocol.headerize(t),r[t]);for(let t in this.request.headers)this.addHeader(e,t,this.request.headers[t]);let i,s;(i=this.request.csrfHeader())&&(s=this.request.csrfToken())&&this.addHeader(e,i,s),this.addHeader(e,up.protocol.headerize("version"),up.version);let o=this.getContentType();o&&this.addHeader(e,"Content-Type",o),Object.assign(e,t),e.send(this.getPayload())}getMethod(){return this.method||(this.method=this.request.method,this.request.wrapMethod&&!this.request.will302RedirectWithGET()&&(this.method=up.protocol.wrapMethod(this.method,this.params))),this.method}getContentType(){return this.finalizePayload(),this.contentType}getPayload(){return this.finalizePayload(),this.payload}addHeader(t,e,r){(n.isOptions(r)||n.isArray(r))&&(r=JSON.stringify(r)),t.setRequestHeader(e,r)}finalizePayload(){this.payload=this.request.payload,this.contentType=this.request.contentType,!this.payload&&this.request.allowsPayload()&&(this.contentType||(this.contentType=this.params.hasBinaryValues()?e:"application/x-www-form-urlencoded"),this.contentType===e?(this.contentType=null,this.payload=this.params.toFormData()):this.payload=this.params.toQuery().replace(/%20/g,"+"))}},n.memoizeMethod(t.prototype,["finalizePayload"]),t)},4517:()=>{const t=up.util;up.Response=class 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(){var e;return!t.evalOption(null!==(e=this.fail)&&void 0!==e?e:up.network.config.fail,this)}header(t){var e;return this.headers[t]||(null===(e=this.xhr)||void 0===e?void 0:e.getResponseHeader(t))}get contentType(){return this.header("Content-Type")}get cspNonces(){return up.protocol.cspNoncesFromHeader(this.header("Content-Security-Policy"))}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||(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;up.ResponseDoc=(t=class{constructor(t){if(this.noscriptWrapper=new up.HTMLWrapper("noscript"),this.scriptWrapper=new up.HTMLWrapper("script"),this.root=this.parseDocument(t)||this.parseFragment(t)||this.parseContent(t),this.cspNonces=t.cspNonces,t.origin){let e=up.fragment.tryToTarget(t.origin);e&&(this.rediscoveredOrigin=this.select(e))}}parseDocument(t){return this.parse(t.document,n.createDocumentFromHTML)}parseContent(t){let r=t.content||"",i=t.target||up.fail("must pass a { target } when passing { content }");i=e.map(up.fragment.parseTargetSteps(i),"selector").join(",");const s=n.createFromSelector(i);return e.isString(r)?(r=this.wrapHTML(r),s.innerHTML=r):s.appendChild(r),s}parseFragment(t){return this.parse(t.fragment)}parse(t,r=n.createFromHTML){return e.isString(t)&&(t=r(t=this.wrapHTML(t))),t}rootSelector(){return up.fragment.toTarget(this.root)}wrapHTML(t){return t=this.noscriptWrapper.wrap(t),up.fragment.config.runScripts?this.scriptWrapper.wrap(t):this.scriptWrapper.strip(t)}getTitle(){var t;return null===(t=this.root.querySelector("head title"))||void 0===t?void 0:t.textContent}select(t){return new up.FragmentFinder({selector:t,origin:this.rediscoveredOrigin,externalRoot:this.root}).find()}finalizeElement(t){this.noscriptWrapper.unwrap(t),up.NonceableCallback.adoptNonces(t,this.cspNonces),this.scriptWrapper.unwrap(t)}},e.memoizeMethod(t.prototype,"getTitle"),t)},2723:()=>{const t=up.element,e=up.util;up.RevealMotion=class{constructor(e,n={}){var r,i,s,o,a,u,l,c;this.element=e,this.options=n,this.viewport=t.get(this.options.viewport)||up.viewport.get(this.element),this.obstructionsLayer=up.layer.get(this.viewport);const p=up.viewport.config;this.snap=null!==(i=null!==(r=this.options.snap)&&void 0!==r?r:this.options.revealSnap)&&void 0!==i?i:p.revealSnap,this.padding=null!==(o=null!==(s=this.options.padding)&&void 0!==s?s:this.options.revealPadding)&&void 0!==o?o:p.revealPadding,this.top=null!==(u=null!==(a=this.options.top)&&void 0!==a?a:this.options.revealTop)&&void 0!==u?u:p.revealTop,this.max=null!==(c=null!==(l=this.options.max)&&void 0!==l?l:this.options.revealMax)&&void 0!==c?c:p.revealMax,this.topObstructions=p.fixedTop,this.bottomObstructions=p.fixedBottom}start(){const t=this.getViewportRect(this.viewport),n=up.Rect.fromElement(this.element);if(this.max){const t=e.evalOption(this.max,this.element);n.height=Math.min(n.height,t)}this.addPadding(n),this.substractObstructions(t),t.height<0&&up.fail("Viewport has no visible area");const r=this.viewport.scrollTop;let i=r;this.top||n.height>t.height?i+=n.top-t.top:n.top<t.top?i-=t.top-n.top:n.bottom>t.bottom&&(i+=n.bottom-t.bottom),e.isNumber(this.snap)&&i<this.snap&&n.top<.5*t.height&&(i=0),i!==r&&this.viewport.scrollTo(Object.assign(Object.assign({},this.options),{top:i}))}getViewportRect(){return up.viewport.isRoot(this.viewport)?new up.Rect({left:0,top:0,width:up.viewport.rootWidth(),height:up.viewport.rootHeight()}):up.Rect.fromElement(this.viewport)}addPadding(t){t.top-=this.padding,t.height+=2*this.padding}selectObstructions(n){let r=up.fragment.all(n.join(","),{layer:this.obstructionsLayer});return e.filter(r,t.isVisible)}substractObstructions(t){for(let e of this.selectObstructions(this.topObstructions)){let n=up.Rect.fromElement(e).bottom-t.top;n>0&&(t.top+=n,t.height-=n)}for(let e of this.selectObstructions(this.bottomObstructions)){let n=up.Rect.fromElement(e),r=t.bottom-n.top;r>0&&(t.height-=r)}}}},8720:()=>{const t=up.util;up.Selector=class{constructor(t,e=[]){this.selectors=t,this.filters=e,this.unionSelector=this.selectors.join(",")||"match-none"}matches(t){return t.matches(this.unionSelector)&&this.passesFilter(t)}closest(t){let e;return this.matches(t)?t:(e=t.parentElement)?this.closest(e):void 0}passesFilter(e){return t.every(this.filters,(t=>t(e)))}descendants(e){const n=t.flatMap(this.selectors,(t=>e.querySelectorAll(t)));return t.filter(n,(t=>this.passesFilter(t)))}subtree(t){const e=[];return t instanceof Document||!this.matches(t)||e.push(t),e.push(...this.descendants(t)),e}}},7885:()=>{const t=up.util,e=up.element;up.Tether=class{constructor(t){var n,r;null===(r=(n=up.migrate).handleTetherOptions)||void 0===r||r.call(n,t),this.anchor=t.anchor,this.align=t.align,this.position=t.position,this.alignAxis="top"===this.position||"bottom"===this.position?"horizontal":"vertical",this.viewport=up.viewport.get(this.anchor),this.parent=this.viewport===e.root?document.body:this.viewport,this.syncOnScroll=!this.viewport.contains(this.anchor.offsetParent)}start(t){this.element=t,this.element.style.position="absolute",this.setOffset(0,0),this.sync(),this.changeEventSubscription("on")}stop(){this.changeEventSubscription("off")}changeEventSubscription(t){let e=this.scheduleSync.bind(this);up[t](window,"resize",e),this.syncOnScroll&&up[t](this.viewport,"scroll",e)}scheduleSync(){return clearTimeout(this.syncTimer),this.syncTimer=t.task(this.sync.bind(this))}isDetached(){return!this.parent.isConnected||!this.anchor.isConnected}sync(){const n=this.element.getBoundingClientRect(),r=e.styleNumber(this.element,"marginTop"),i=e.styleNumber(this.element,"marginRight"),s=e.styleNumber(this.element,"marginBottom"),o=e.styleNumber(this.element,"marginLeft"),a=this.anchor.getBoundingClientRect();let u,l;switch(this.alignAxis){case"horizontal":switch(this.position){case"top":l=a.top-s-n.height;break;case"bottom":l=a.top+a.height+r}switch(this.align){case"left":u=a.left+o;break;case"center":u=a.left+.5*(a.width-n.width);break;case"right":u=a.left+a.width-n.width-i}break;case"vertical":switch(this.align){case"top":l=a.top+r;break;case"center":l=a.top+.5*(a.height-n.height);break;case"bottom":l=a.top+a.height-n.height-s}switch(this.position){case"left":u=a.left-i-n.width;break;case"right":u=a.left+a.width+o}}t.isDefined(u)||t.isDefined(l)?this.moveTo(u,l):up.fail("Invalid tether constraints: %o",this.describeConstraints())}describeConstraints(){return{position:this.position,align:this.align}}moveTo(t,e){const n=this.element.getBoundingClientRect();this.setOffset(t-n.left+this.offsetLeft,e-n.top+this.offsetTop)}setOffset(t,n){this.offsetLeft=t,this.offsetTop=n,e.setStyle(this.element,{left:t,top:n})}}},4818:()=>{const t=up.util;up.URLPattern=class{constructor(e,n=t.normalizeURL){this.normalizeURL=n,this.groups=[];const r=[],i=[];for(let n of t.parseTokens(e))"-"===n[0]?i.push(n.substring(1)):r.push(n);this.positiveRegexp=this.buildRegexp(r,!0),this.negativeRegexp=this.buildRegexp(i,!1)}buildRegexp(e,n){if(!e.length)return;let r=(e=e.map((e=>("*"===e[0]&&(e="/"+e),e=this.normalizeURL(e),t.escapeRegExp(e))))).join("|");return r=r.replace(/\\\*/g,".*?"),r=r.replace(/(:|\\\$)([a-z][\w-]*)/gi,((t,e,r)=>"\\$"===e?(n&&this.groups.push({name:r,cast:Number}),"(\\d+)"):(n&&this.groups.push({name:r,cast:String}),"([^/?#]+)"))),new RegExp("^(?:"+r+")$")}test(t,e=!0){return e&&(t=this.normalizeURL(t)),this.positiveRegexp.test(t)&&!this.isExcluded(t)}recognize(t,e=!0){e&&(t=this.normalizeURL(t));let n=this.positiveRegexp.exec(t);if(n&&!this.isExcluded(t)){const t={};return this.groups.forEach(((e,r)=>{let i=n[r+1];if(i)return t[e.name]=e.cast(i)})),t}}isExcluded(t){var e;return null===(e=this.negativeRegexp)||void 0===e?void 0:e.test(t)}}},9675:(t,e,n)=>{n(5941),up.element=function(){const t=up.util;function e(...t){const e=t.pop();return(t[0]||document).querySelector(e)}function n(t,e){const n=[];return t.matches(e)&&n.push(t),n.push(...t.querySelectorAll(e)),n}function r(...n){const r=n.pop();return t.isElement(r)?r:t.isString(r)?e(...n,r):t.isList(r)?(r.length>1&&up.fail("up.element.get(): Cannot cast multiple elements (%o) to a single element",r),r[0]):r}function i(...e){return t.flatMap(e,s)}function s(e){return t.isString(e)?document.querySelectorAll(e):t.wrapList(e)}function o(t){t.setAttribute("hidden","")}function a(t){t.removeAttribute("hidden"),"none"===t.style.display&&(t.style.display="")}function u(e,n){for(let r in n){const i=n[r];t.isGiven(i)?e.setAttribute(r,i):e.removeAttribute(r)}}function l(e,n){let r,i,s,{includePath:o}=c(e);for(let t of o){let{tagName:e,id:n,classNames:o,attributes:a}=t;e&&"*"!==e||(e="div"),i=document.createElement(e),r||(r=i),n&&(i.id=n);for(let t of o)i.classList.add(t);for(let t in a){let e=a[t];i.setAttribute(t,e||"")}null==s||s.appendChild(i),s=i}if(n){let e;if(e=t.pluckKey(n,"class"))for(let n of t.wrapList(e))r.classList.add(n);(e=t.pluckKey(n,"style"))&&C(r,e),(e=t.pluckKey(n,"text"))&&(r.textContent=e),(e=t.pluckKey(n,"content"))&&(r.innerHTML=e),u(r,n)}return r}function c(t){let e;const n=t.replace(/:not\([^)]+\)/,(function(t){return e=t,""})),[r,i]=function(t){let e=[];return[t=h(t,(function({name:t,value:n}){return e.push(n),`[${t}]`})),e]}(n);return{includePath:r.split(/[ >]+/).map((function(e){let n={tagName:null,classNames:[],id:null,attributes:{}};return e=(e=(e=e.replace(/^[\w-*]+/,(function(t){return n.tagName=t,""}))).replace(/#([\w-]+)/,(function(t,e){return n.id=e,""}))).replace(/\.([\w-]+)/g,(function(t,e){return n.classNames.push(e),""})),i.length&&(e=h(e,(function({name:t}){return n.attributes[t]=i.shift(),""}))),e&&up.fail("Cannot parse selector: "+t),n})),includeRaw:n,excludeRaw:e}}const p=/\[([\w-]+)(?:([~|^$*]?=)(["'])?([^\3\]]*?)\3)?]/g;function h(t,e){return t.replace(p,(function(t,n,r,i,s){return s&&(s=s.replace(/\\([\\"'])/,"$1")),e({name:n,operator:r,quote:i,value:s})}))}const d=["HTML","BODY","HEAD","TITLE"],f=up.mockable((t=>t.matches(d.join(","))));function m(e,n){return t.isGiven(n)?`[${e}="${n=n.replace(/"/g,'\\"')}"]`:`[${e}]`}function g(t){t.offsetHeight}function y(e,n,r){t.isMissing(e.getAttribute(n))&&e.setAttribute(n,r)}function v(e,n){return t.nullToUndefined(e.getAttribute(n))}function b(t,e,n){if(!t.hasAttribute(e))return;const r=v(t,e);switch(r){case"false":return!1;case"true":case"":case e:return!0;default:return!n||r}}function w(t,e){const n=E(t,Object.keys(e));return C(t,e),()=>C(t,n)}function k(t,e){return S(window.getComputedStyle(t),e)}function O(e,n){const r=k(e,n);if(t.isGiven(r))return parseFloat(r)}function E(t,e){const{style:n}=t;return S(n,e)}function S(e,n){return t.isString(n)?e[n]:t.pick(e,n)}function C(e,n){if(t.isString(n))e.setAttribute("style",n);else{const{style:t}=e;for(let e in n){let r=n[e];r=x(e,r),t[e]=r}}}function x(e,n){var r;return t.isMissing(n)?n="":R.has(e.toLowerCase().replace(/-/,""))&&(r=n,n=t.isNumber(r)||t.isString(r)&&/^\d+$/.test(r)?r.toString()+"px":r),n}const R=new Set(["top","right","bottom","left","padding","paddingtop","paddingright","paddingbottom","paddingleft","margin","margintop","marginright","marginbottom","marginleft","borderwidth","bordertopwidth","borderrightwidth","borderbottomwidth","borderleftwidth","width","height","maxwidth","maxheight","minwidth","minheight"]);function F(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}return{subtree:n,isInSubtree:function(t,e){const n=r(e);return t.contains(n)},closestAttr:function(t,e,n=v){let r=t.closest("["+e+"]");if(r)return n(r,e)},ancestor:function t(e,n){let r=e.parentElement;if(r)return r.matches(n)?r:t(r,n)},around:function(t,e){return i(t.closest(e),n(t,e))},get:r,list:i,toggle:function(t,e){null==e&&(e=!F(t)),(e?a:o)(t)},hide:o,show:a,metaContent:function(t){var n;return null===(n=e("meta"+m("name",t)))||void 0===n?void 0:n.getAttribute("content")},insertBefore:function(t,e){t.insertAdjacentElement("beforebegin",e)},createFromSelector:l,setAttrs:u,setTemporaryAttrs:function(t,e){const n={};for(let r of Object.keys(e))n[r]=t.getAttribute(r);return u(t,e),()=>u(t,n)},affix:function(e,...n){let r,i;const s=t.extractOptions(n);2===n.length?[r,i]=n:(r="beforeend",i=n[0]);const o=l(i,s);return e.insertAdjacentElement(r,o),o},idSelector:function(t){return t.match(/^[a-z0-9\-_]+$/i)?`#${t}`:m("id",t)},classSelector:function(t){return`.${t=t.replace(/:/g,"\\:")}`},isSingleton:f,attrSelector:m,tagName:function(t){return t.tagName.toLowerCase()},createDocumentFromHTML:function(t){return(new DOMParser).parseFromString(t,"text/html")},createFromHTML:function(t){const e=document.createRange();e.setStart(document.body,0);let n=e.createContextualFragment(t.trim()).childNodes;if(1!==n.length)throw new Error("HTML must have a single root element");return n[0]},get root(){return document.documentElement},paint:g,concludeCSSTransition:function(t){const e=w(t,{transition:"none"});return g(t),e},hasCSSTransition:function(e){let n;n=t.isOptions(e)?e:k(e);const r=n.transitionProperty,i=n.transitionDuration;return!("none"===r||"all"===r&&0===i)},fixedToAbsolute:function(t){const e=t.getBoundingClientRect();t.style.position="absolute";const n=t.offsetParent.getBoundingClientRect();C(t,{left:e.left-O(t,"margin-left")-n.left,top:e.top-O(t,"margin-top")-n.top,right:"",bottom:""})},setMissingAttrs:function(t,e){for(let n in e)y(t,n,e[n])},setMissingAttr:y,unwrap:function(e){!function(n){const r=document.activeElement;try{!function(){const n=e.parentNode,r=t.toArray(e.childNodes);t.each(r,(t=>n.insertBefore(t,e))),n.removeChild(e)}()}finally{r&&r!==document.activeElement&&r.focus({preventScroll:!0})}}()},wrapChildren:function(t){let e;const n=document.createElement("up-wrapper");for(;e=t.firstChild;)n.appendChild(e);return t.appendChild(n),n},isWrapper:function(t){return t.matches("up-wrapper")},attr:v,booleanAttr:b,numberAttr:function(t,e){let n=t.getAttribute(e);if(n&&(n=n.replace(/_/g,""),n.match(/^[\d.]+$/)))return parseFloat(n)},jsonAttr:function(t,e){var n,r;let i=null===(r=null===(n=t.getAttribute)||void 0===n?void 0:n.call(t,e))||void 0===r?void 0:r.trim();if(i)return JSON.parse(i)},callbackAttr:function(e,n,{exposedKeys:r=[],mainKey:i="event"}={}){let s=e.getAttribute(n);if(s){const n=up.NonceableCallback.fromString(s).toFunction(i,...r);return function(i){const s=Object.values(t.pick(i,r));return n.call(e,i,...s)}}},booleanOrStringAttr:function(t,e){return b(t,e,!0)},setTemporaryStyle:w,style:k,styleNumber:O,inlineStyle:E,setStyle:C,isVisible:F,upAttrs:function(t){const e=/^up-/,n={};for(let r of t.attributes){const{name:t}=r;t.match(e)&&(n[t]=r.value)}return n},toggleAttr:function(t,e,n,r){return null==r&&(r=!t.hasAttribute(e)),r?t.setAttribute(e,n):t.removeAttribute(e)},addTemporaryClass:function(t,e){return t.classList.add(e),()=>t.classList.remove(e)},setTemporaryAttr:function(t,e,n){return t.setAttribute(e,n),()=>t.removeAttribute(t,e)},cleanJQuery:function(t){up.browser.canJQuery()&&jQuery(t).remove()},parseSelector:c}}()},3924:()=>{up.error=function(){function t(t){return!("object"==typeof t&&("AbortError"===t.name||t instanceof up.RenderResult||t instanceof up.Response))}return{fail:function(...t){throw new up.Error(t)},emitGlobal:function(t){const{message:e}=t;up.emit(window,"error",{message:e,error:t,log:!1})},isCritical:t,muteUncriticalRejection:function(e){return e.catch((function(e){if(t(e))throw e}))}}}(),up.fail=up.error.fail},4366:()=>{up.Aborted=class extends up.Error{constructor(t){super(t,{name:"AbortError"})}}},5485:()=>{up.CannotCompile=class extends up.Error{}},8010:()=>{up.CannotMatch=class extends up.Error{}},4861:()=>{up.CannotParse=class extends up.Error{}},3469:()=>{up.CannotTarget=class extends up.Error{}},376:()=>{up.Error=class 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 extends up.Error{}},4504:()=>{up.Offline=class extends up.Error{}},8670:()=>{up.event=function(){const t=up.util,e=up.element;function n(...t){return r(t).bind()}function r(t,e){return up.EventListenerGroup.fromBindArgs(t,e)}function i(t){return up.EventEmitter.fromEmitArgs(t)}const s=["metaKey","shiftKey","ctrlKey","altKey"];function o(e){return(t.isUndefined(e.button)||0===e.button)&&!t.some(s,(t=>e[t]))}function a(e,n,r=[]){const i=up.event.build(n,t.pick(e,r));return i.originalEvent=e,["stopPropagation","stopImmediatePropagation","preventDefault"].forEach((function(t){const n=i[t];return i[t]=function(){return e[t](),n.call(i)}})),e.defaultPrevented&&i.preventDefault(),i}return n("up:click","a[up-emit]",(function(t,n){if(!o(t))return;const r=e.attr(n,"up-emit"),i=e.jsonAttr(n,"up-emit-props"),s=a(t,r);Object.assign(s,i),up.emit(n,s)})),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 r(t).unbind()},build:function(...e){const n=t.extractOptions(e),r=e[0]||n.type||up.fail("Expected event type to be passed as string argument or { type } property"),i=document.createEvent("Event");return i.initEvent(r,!0,!0),Object.assign(i,t.omit(n,["type","target"])),i},emit:function(...t){return i(t).emit()},assertEmitted:function(...t){return i(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:o,fork:a,keyModifiers:s}}(),up.on=up.event.on,up.off=up.event.off,up.emit=up.event.emit},454:()=>{up.feedback=function(){const t=up.util,e=up.element,n=new up.Config((()=>({currentClasses:["up-current"],navSelectors:["[up-nav]","nav"]}))),r="a, [up-href]";function i(){return n.navSelectors.join(",")}function s(e){if(e)return t.normalizeURL(e,{trailingSlash:!1,hash:!1})}function o(t){return t.upFeedbackURLs||(t.upFeedbackURLs=new up.LinkFeedbackURLs(t))}function a(n,s){const o=up.fragment.subtree(n,i(),s);l(t.flatMap(o,(t=>e.subtree(t,r))),s)}function u(t){return t.feedbackLocation||s(t.location)}function l(t,r={}){if(!t.length)return;let i=u(r.layer||up.layer.get(t[0]));if(i)for(let r of t){const t=o(r).isCurrent(i);for(let e of n.currentClasses)r.classList.toggle(e,t);e.toggleAttr(r,"aria-current","page",t)}}function c(t){const e=t.feedbackLocation,n=u(t.location);e&&e===n||(t.feedbackLocation=n,a(t.element,{layer:t}))}return up.on("up:location:changed",(t=>{!function(){const t=up.layer.front;t.showsLiveHistory()&&c(t)}()})),up.on("up:fragment:inserted",((t,e)=>{!function(t){const e={layer:up.layer.get(t)};up.fragment.closest(t,i(),e)?l(up.fragment.subtree(t,r,e),e):a(t,e)}(e)})),up.on("up:layer:location:changed",(t=>{c(t.layer)})),up.on("up:framework:reset",(function(){n.reset(),up.layer.root.feedbackLocation=null})),{config:n,showAroundRequest:function(n,i){if(!i.feedback)return;let s=e=>t.always(n,e),o=function(t){let n=t.origin;if(n)return i=n,e.ancestor(i,r)||i;var i}(n);o&&s(e.addTemporaryClass(o,"up-active"));for(let t of n.fragments)s(e.addTemporaryClass(t,"up-loading"))},normalizeURL:s}}()},2851:()=>{up.form=function(){const t=up.util,e=up.element,n=["[up-submit]","[up-target]","[up-layer]","[up-transition]"],r=new up.Config((()=>({groupSelectors:["[up-form-group]","fieldset","label","form"],fieldSelectors:["select","input:not([type=submit]):not([type=image])","button[type]:not([type=submit])","textarea"],submitSelectors:up.link.combineFollowableSelectors(["form"],n),noSubmitSelectors:["[up-submit=false]","[target]"],submitButtonSelectors:["input[type=submit]","input[type=image]","button[type=submit]","button:not([type])"],watchInputEvents:["input","change"],watchInputDelay:0,watchChangeEvents:t=>t.matches("input[type=date]")?["blur"]:["change"]})));function i(){return r.submitSelectors.join(",")}function s(t=""){return r.fieldSelectors.map((e=>e+t)).join(",")}function o(t){return t.matches(s())}function a(n){n=e.get(n);let r=e.subtree(n,s());if(n.matches("form[id]")){const i=s(e.attrSelector("form",n.getAttribute("id"))),o=up.fragment.all(i,{layer:n});r.push(...o),r=t.uniq(r)}return r}function u(t){return e.subtree(t,l())}function l(){return r.submitButtonSelectors.join(",")}const c=up.mockable(((t,e)=>up.render(p(t,e))));function p(t,e,n){e=m(t=S(t),e,n);let r=new up.OptionsParser(t,e,n);return r.string("failTarget",{default:up.fragment.tryToTarget(t)}),r.booleanOrString("disable"),e.guardEvent||(e.guardEvent=up.event.build("up:form:submit",{submitButton:e.submitButton,log:"Submitting form",params:e.params})),e.origin||(e.origin=up.viewport.focusedElementWithin(t)||e.submitButton||t),Object.assign(e,up.link.followOptions(t,e,n)),e}function h(t){let e,n=document.activeElement;if(t.contains(n)){let r=v(n);e=t.contains(r)||t===n?r:t}let r=[...a(t),...u(t)];return r.forEach(d),e&&!e.contains(document.activeElement)&&up.focus(e,{force:!0,preventScroll:!0}),function(){r.forEach(f)}}function d(t){t.upDisableCount||(t.upDisableCount||(t.upDisableCount=0),t.upOriginalDisabled=t.disabled),t.upDisableCount++,t.disabled=!0}function f(t){t.upDisableCount&&(t.disabled?(t.upDisableCount--,t.upDisableCount||(t.disabled=t.upOriginalDisabled)):t.upDisableCount=0)}function m(n,r,i){r=t.options(r),n=S(n);const s=new up.OptionsParser(n,r,i);s.string("contentType",{attr:["enctype","up-content-type"]}),s.json("headers");const o=up.Params.fromForm(n),a=function(t){const n=l(),r=up.viewport.focusedElementWithin(t);return r&&r.matches(n)?r:e.get(t,n)}(n);return a&&(r.submitButton=a,o.addField(a),r.method||(r.method=a.getAttribute("formmethod")),r.url||(r.url=a.getAttribute("formaction"))),o.addAll(r.params),r.params=o,s.string("url",{attr:"action",default:up.fragment.source(n)}),s.string("method",{attr:["up-method","data-method","method"],default:"GET",normalize:t.normalizeMethod}),"GET"===r.method&&(r.url=up.Params.stripURL(r.url)),r}function g(e,...n){let r=S(e);const i=a(e),s=t.reject(i,"name");s.length&&up.puts("up.watch()","Will not watch fields without a [name]: %o",s);const o=t.extractCallback(n)||function(t){let e=t.getAttribute("up-watch");if(e)return up.NonceableCallback.fromString(e).toFunction("value","name").bind(t)}(e)||up.fail("No callback given for up.watch()");let u=t.extractOptions(n);const l=new up.FieldWatcher(r,i,u,o);return l.start(),()=>l.stop()}function y(t,e){return g(t,e,((e,n,r)=>c(t,r)))}function v(t){return b(t).element}function b(e){return t.findResult((null===(i=(n=up.migrate).migratedFormGroupSelectors)||void 0===i?void 0:i.call(n))||r.groupSelectors,(function(t){let n=e.closest(t);if(n){let r=up.fragment.tryToTarget(n),i=up.fragment.tryToTarget(e),s=i&&n!==e&&`${t}:has(${i})`,o=r||s;if(o)return{target:o,element:n,origin:e}}}));var n,i}function w(n){let r,i;if(n.matches("input[type=checkbox]"))n.checked?(r=n.value,i=":checked"):i=":unchecked";else if(n.matches("input[type=radio]")){const t=C(n),s=n.getAttribute("name"),o=t.querySelector(`input[type=radio]${e.attrSelector("name",s)}:checked`);o?(i=":checked",r=o.value):i=":unchecked"}else r=n.value;const s=[];return t.isPresent(r)?(s.push(r),s.push(":present")):s.push(":blank"),t.isPresent(i)&&s.push(i),s}function k(t,e={}){const n=e.target||e.target||t.getAttribute("up-switch"),r=C(t);n||up.fail("No switch target given for %o",t);const i=w(t);for(let t of up.fragment.all(r,n))O(t,i)}up.on("up:click",l,(function(t,e){const n=S(e);n&&x(n)&&e.focus()}));const O=up.mockable((function(n,r){let i;r||(r=w(function(e){const n=C(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 s=n.getAttribute("up-hide-for");if(s)s=E(s),i=0===t.intersect(r,s).length;else{let e=n.getAttribute("up-show-for");e=e?E(e):[":present",":checked"],i=t.intersect(r,e).length>0}e.toggle(n,i),n.classList.add("up-switched")}));function E(e){return t.parseTokens(e,{json:!0})}function S(t,e={}){const n=up.fragment.get(t,e);return n.form||n.closest("form")}function C(t,e){return S(t,e)||up.layer.get(t).element}function x(t){return(t=up.fragment.get(t)).matches(i())&&!R(t)}function R(t){return t.matches(r.noSubmitSelectors.join(","))}return up.on("submit",i,(function(t,e){t.defaultPrevented||R(e)||(up.event.halt(t,{log:!0}),up.error.muteUncriticalRejection(c(e)))})),up.compiler((function(){return r.fieldSelectors.map((t=>`${t}[up-validate], [up-validate] ${t}`)).join(", ")}),(function(t){up.FormValidator.forElement(t).watchContainer(t)})),up.compiler("[up-switch]",(t=>{k(t)})),up.on("change","[up-switch]",((t,e)=>{k(e)})),up.compiler("[up-show-for]:not(.up-switched), [up-hide-for]:not(.up-switched)",(t=>{O(t)})),up.compiler("[up-watch]",(t=>g(t))),up.compiler("[up-autosubmit]",(t=>y(t))),up.on("up:framework:reset",(function(){r.reset()})),{config:r,submit:c,submitOptions:p,destinationOptions:m,watchOptions:function(e,n,r={}){var i;n=t.options(n);let s=new up.OptionsParser(e,n,Object.assign(Object.assign({},r),{closest:!0,attrPrefix:"up-watch-"}));s.boolean("feedback"),s.booleanOrString("disable"),s.string("event"),s.number("delay");let o=up.form.config;return"input"===n.event?(n.event=t.evalOption(o.watchInputEvents,e),null!==(i=n.delay)&&void 0!==i||(n.delay=o.watchInputDelay)):"change"===n.event&&(n.event=t.evalOption(o.watchChangeEvents,e)),n.origin||(n.origin=e),n},isSubmittable:x,watch:g,validate:function(...e){let n=function(e,...n){const r=t.extractOptions(n);return r.origin?r.target||(r.target=up.fragment.toTarget(e)):r.origin||(r.origin=up.fragment.get(e)),r}(...e);return up.FormValidator.forElement(n.origin).validate(n)},autosubmit:y,fieldSelector:s,fields:a,isField:o,submitButtons:u,focusedField:function(){return t.presence(document.activeElement,o)},switchTarget:O,disableWhile:function(e,n){let r=function({disable:e,origin:n}){if(!e)return t.noop;let r,i=()=>C(n||void up.fail("Cannot process { disable: '%s' } option without { %s }",e,"origin"));return!0===e?r=[i()]:t.isString(e)&&(r=up.fragment.subtree(i(),e,{origin:n})),t.sequence(r.map(h))}(n);t.always(e,r)},disable:h,group:v,groupSolution:b,get:S}}(),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(7433);const r=up.util,i=up.element;up.fragment=function(){function t(t){let e=i.tagName(t);if(e.startsWith("up-"))return e}const e=new up.Config((()=>({badTargetClasses:[/^up-/],targetDerivers:["[up-id]","[id]","html","head","body","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]","form"],verifyDerivedTarget:!0,navigateOptions:{cache:"auto",feedback:!0,fallback:!0,focus:"auto",scroll:"auto",history:"auto",peel:!0},matchAroundOrigin:!0,runScripts:!0,autoHistoryTargets:[":main"],autoFocus:["hash","autofocus","main-if-main","keep","target-if-lost"],autoScroll:["hash","layer-if-main"],autoRevalidate:t=>t.expired,skipResponse:n})));function n({response:t,expiredResponse:e}){return!t.text||t.text===(null==e?void 0:e.text)}function s(t,e={}){return t=p(t,e),i.closestAttr(t,"up-source")}function o(t){let e=i.closestAttr(t,"up-time");if(e&&"false"!==e)return/^\d+$/.test(e)&&(e=1e3*Number(e)),new Date(e)}function a(t){let e=i.closestAttr(t,"up-etag");if(e&&"false"!==e)return e}r.delegate(e,"mainTargets",(()=>up.layer.config.any));const u=up.mockable(((...t)=>{let e=y(t);return new up.RenderJob(e)})),l=up.mockable(((...t)=>{const e=y(t);return u(Object.assign(Object.assign({},e),{navigate:!0}))})),c=r.negate((function(t){return!!t.closest(".up-destroying")}));function p(...t){const e=r.extractOptions(t),n=t.pop(),s=t[0];return r.isElementish(n)?i.get(n):s?h(s,n,e):new up.FragmentFinder({selector:n,origin:e.origin,layer:e.layer}).find()}function h(...t){return f(...t)[0]}const d=/:has\(([^)]+)\)$/;function f(...t){const e=r.extractOptions(t);let n=t.pop();const i=t[0];return r.isElement(n)?[n]:r.isList(n)?n:S(n,i,e).descendants(i||document)}function m(t,e,n={}){return(e=S(e,t,n)).subtree(t)}function g(t,e){return m(t,e).length>0}function y(t){const e=r.parseArgIntoOptions(t,"target");return r.isElement(e.target)&&(e.origin||(e.origin=e.target)),e}const v=/^(onFail|on|fail)?(.+)$/;function b(t,e){return r.presence(t,r.isString)||w(t,e)||function(t){throw new up.CannotTarget(function(t){return`Cannot derive good target selector from a <${i.tagName(t)}> element without identifying attributes. Try setting an [id] or configure up.fragment.config.targetDerivers.`}(t))}(t)}function w(t,n){return r.findResult(e.targetDerivers,(function(s){let o=function(t,e){if(r.isFunction(e))return e(t);if(t.matches(e))try{return function(t,e){let{includePath:n,excludeRaw:r}=up.element.parseSelector(e);if(1!==n.length)throw new up.CannotParse(e);let{tagName:s,id:o,classNames:a,attributes:u}=n[0],l="";"*"===s?l+=i.tagName(t):s&&(l+=s);for(let t of a)l+=i.classSelector(t);o&&(l+=i.idSelector(o));for(let e in u){let n=u[e]||t.getAttribute(e);if("id"===e)l+=i.idSelector(n);else if("class"===e)for(let e of k(t))l+=i.classSelector(e);else l+=i.attrSelector(e,n)}return r&&(l+=r),l}(t,e)}catch(t){if(t instanceof up.CannotParse)return e;throw t}}(t,s);if(o&&function(t,n,r={}){return!n.isConnected||!e.verifyDerivedTarget||up.fragment.get(t,Object.assign({layer:n},r))===n}(o,t,n))return o}))}function k(t){return r.filter(t.classList,(t=>!r.some(e.badTargetClasses,(e=>{return n=e,i=t,r.isRegExp(n)?n.test(i):n===i;var n,i}))))}function O(t,{origin:e}={}){return t.replace(/:origin\b/,(function(n){if(e)return b(e);up.fail('Missing { origin } element to resolve "%s" reference (found in %s)',n,t)}))}function E(...t){return(up.migrate.resolveOrigin||O)(...t)}function S(t,e,n={}){var i;const s=[];let o;if(n.destroying||s.push(c),e&&!document.contains(e)||"any"===n.layer)o=up.layer.root;else{null!==(i=n.layer)&&void 0!==i||(n.layer=e);const t=up.layer.getAll(n);s.push((e=>r.some(t,(t=>t.contains(e))))),o=t[0]}let a=up.fragment.expandTargets(t,Object.assign(Object.assign({},n),{layer:o}));return a=a.map((function(t){return t=t.replace(d,(function(t,e){return s.push((t=>t.querySelector(e))),""})),t||"*"})),new up.Selector(a,s)}function C(t){return r.parseTokens(t,{separator:"comma"})}return up.on("up:framework:boot",(function(){const{documentElement:t}=document;if(t.setAttribute("up-source",r.normalizeURL(location.href,{hash:!1})),up.hello(t),!up.browser.canPushState())return up.warn("Cannot push history changes. Next fragment update will load in a new page.")})),up.on("up:framework:reset",(function(){e.reset()})),{config:e,reload:function(...t){var e,n;const l=y(t);l.target||(l.target=":main");const c=p(l.target,l);return l.url||(l.url=s(c)),l.headers=r.merge(l.headers,function(t){let e={},n=o(t);n&&(e["If-Modified-Since"]=n.toUTCString());let r=a(t);return r&&(e["If-None-Match"]=r),e}(c)),(l.keepData||i.booleanAttr(c,"up-keep-data"))&&(l.data=up.data(c)),null===(n=(e=up.migrate).postprocessReloadOptions)||void 0===n||n.call(e,l),u(l)},destroy:function(...t){var e,n;const r=y(t);return(r.element=p(r.target,r))&&new up.Change.DestroyFragment(r).execute(),null===(n=(e=up.migrate).formerlyAsync)||void 0===n?void 0:n.call(e,"up.destroy()")},render:u,navigate:l,get:p,getDumb:h,all:f,subtree:m,contains:g,closest:function(t,e,n){return(e=S(e,t=i.get(t),n)).closest(t)},source:s,visit:function(t,e){return l(Object.assign(Object.assign({},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){var n;const r=null!==(n=e.log)&&void 0!==n?n:["Destroyed fragment %o",t],i=e.parent||document;return up.emit(i,"up:fragment:destroyed",{fragment:t,parent:i,log:r})},emitKeep:function(t){return function(t,e,n){const r=t.oldElement,i=up.event.build("up:fragment:keep",{newFragment:t.newElement,newData:t.newData});return up.emit(r,i,n)}(t,0,{log:["Keeping fragment %o",t.oldElement],callback:i.callbackAttr(t.oldElement,"up-on-keep",{exposedKeys:["newFragment","newData"]})})},successKey:function(t){let e=v.exec(t);if(e){let[t,n,i]=e;switch(n){case"onFail":return"on"+r.upperCaseFirst(i);case"fail":return r.lowerCaseFirst(i)}}},failKey:function(t){let e=v.exec(t);if(e){let[t,n,i]=e;switch(n){case"on":return"onFail"+r.upperCaseFirst(i);case void 0:return"fail"+r.upperCaseFirst(i)}}},expandTargets:function(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=r.copy(r.wrapList(t));const i=[];for(;t.length;){const s=t.shift();if(":main"===s||!0===s){const r="new"===n?e.mode:n.mode;t.unshift(...up.layer.mainTargets(r))}else":layer"===s?"new"===n||n.opening||t.unshift(n.getFirstSwappableElement()):r.isElementish(s)?i.push(b(s,e)):r.isString(s)&&i.push(E(s,e))}return r.uniq(i)},resolveOrigin:E,toTarget:b,tryToTarget:w,isTargetable:function(t){return!!w(t)},matches:function(t,e,n={}){if(t=i.get(t),r.isElement(e)){let n=w(e);return n&&t.matches(n)}return(e=S(e,t,n)).matches(t)},hasAutoHistory:function(t){return!!g(t,e.autoHistoryTargets)||(up.puts("up.render()","Will not auto-update history because fragment doesn't contain a selector from up.fragment.config.autoHistoryTargets"),!1)},time:o,etag:a,shouldRevalidate:function(t,n,i={}){return t.fromCache&&r.evalAutoOption(i.revalidate,e.autoRevalidate,n)},abort:function(...t){let e,n,i=y(t),{reason:s}=i;if(i.target)n=f(i.target,i),e=t=>t.isPartOfSubtree(n),s||(s="Aborting requests within fragment");else{let t=up.layer.getAll(i);n=r.map(t,"element"),e=e=>r.contains(t,e.layer),s||(s="Aborting requests within "+t.join(", "))}up.network.abort((t=>t.abortable&&e(t)),Object.assign(Object.assign({},i),{reason:s}));for(let t of n)up.emit(t,"up:fragment:aborted",{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},splitTarget:C,parseTargetSteps:function(t,e={}){let n=e.defaultPlacement||"swap",r=[],i=C(t);for(let t of i){if(":none"===t)continue;let i=n,s=!1;t=t.replace(/\b::?(before|after)\b/,((t,e)=>(i=e,""))),t=t.replace(/\b:maybe\b/,(()=>(s=!0,"")));const o=Object.assign(Object.assign({},e),{selector:t,placement:i,maybe:s});r.push(o)}return r}}}(),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,r.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["URL","Proxy","Promise","DOMParser","FormData"])if(!window[t])return`Browser doesn't support the ${t} API`;if("BackCompat"===document.compatMode)return"Browser is in quirks mode (missing DOCTYPE?)"}return{onEvaled:function(){up.emit("up:framework:evaled",{log:!1}),function(){let t=document.currentScript;return!!(null==t?void 0:t.async)||"manual"===(null==t?void 0: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,restoreTargets:["body"]})));let r,i;const s={hash:!0};function o(e,n){return n=t.merge(s,n),t.normalizeURL(e,n)}function a(t){return o(location.href,t)}function u(){const t=a();i!==t&&(r=i,i=t)}u();const l={trailingSlash:!1};function c(e,n){return o(e,n=t.merge(l,n))===a(n)}function p(t,e={}){d("replaceState",t=o(t))&&!1!==e.event&&h({location:t,reason:"replace",log:`Replaced state for ${t}`})}function h(t){var e,n;let r=up.event.build("up:location:changed",t);null===(n=null===(e=up.migrate)||void 0===e?void 0:e.renamedProperty)||void 0===n||n.call(e,r,"url","location"),up.emit(r)}function d(t,e){if(n.enabled){const n={up:{}};return window.history[t](n,"",e),u(),!0}}function f(t){u(),h({location,reason:"pop",log:`Navigated to history entry ${location}`}),up.viewport.saveFocus({location:r}),up.viewport.saveScroll({location:r}),function(t){if(!(null==t?void 0:t.up))return void up.puts("pop","Ignoring a history state not owned by Unpoly");let e=a();up.emit("up:location:restore",{location:e,log:`Restoring location ${e}`}).defaultPrevented||up.render({url:e,target:n.restoreTargets,fail:!1,history:!0,location:e,peel:!0,layer:"root",cache:!0,saveScroll:!1,scroll:["restore","auto"],saveFocus:!1,focus:["restore","auto"]})}(t.state)}function m(){window.addEventListener("popstate",f),"GET"===up.protocol.initialRequestMethod()&&p(a(),{event:!1})}return up.on("up:framework:boot",(function(){"jasmine"in window?m():setTimeout(m,100)})),up.macro("a[up-back], [up-href][up-back]",(function(t){r&&(e.setMissingAttrs(t,{"up-href":r,"up-scroll":"restore"}),t.removeAttribute("up-back"),up.link.makeFollowable(t))})),up.on("up:framework:reset",(function(){n.reset(),r=void 0,i=void 0,u()})),{config:n,push:function(t){!c(t=o(t))&&d("pushState",t)&&h({location:t,reason:"push",log:`Advanced to location ${t}`})},replace:p,get location(){return a()},get previousLocation(){return r},normalizeURL:o,isLocation:c}}()},9443:function(t,e,n){var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,s){function o(t){try{u(r.next(t))}catch(t){s(t)}}function a(t){try{u(r.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}u((r=r.apply(t,e||[])).next())}))};n(7921);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"},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"},foreignOverlaySelectors:["dialog"]};for(let n of t)e[n.mode].Class=n;return e}));let n=null,o=[];function a(t){return"root"===t?[e.root,e.any]:[e[t],e.overlay,e.any]}function u(t){return r(this,void 0,void 0,(function*(){return t=i.options(t,{layer:"new",defaultToEmptyContent:!0,navigate:!0}),(yield 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(){e.reset(),n.reset(),o=i.filter(o,"isDefault")}));const l={config:e,mainTargets:function(t){return i.flatMap(a(t),"mainTargets")},open:u,build:function(t,r){var s;const{mode:o}=t,{Class:u}=e[o],l=i.reverse(a(o));let c=up.migrate.handleLayerConfig;return c&&l.forEach(c),null!==(s=t.openAnimation)&&void 0!==s||(t.openAnimation=i.pluckKey(t,"animation")),t=i.mergeDefined(...l,{mode:o,stack:n},t),r&&(t=r(t)),new u(t)},ask:function(t){return new Promise((function(e,n){u(t=Object.assign(Object.assign({},t),{onAccepted:t=>e(t.value),onDismissed:t=>n(t.value)}))}))},normalizeOptions:function(t){var r,s;if(null===(s=(r=up.migrate).handleLayerOptions)||void 0===s||s.call(r,t),i.isGiven(t.layer)){let n=String(t.layer).match(/^(new|shatter|swap)( (\w+))?/);if(n){t.layer="new";const r=n[1],i=n[3];t.mode||(t.mode=i||e.mode),"swap"===r?up.layer.isOverlay()&&(t.baseLayer="parent"):"shatter"===r&&(t.baseLayer="root")}}else t.mode?t.layer="new":i.isElementish(t.target)?t.layer=n.get(t.target,{normalizeLayerOptions:!1}):t.origin?t.layer="origin":t.layer="current";t.context||(t.context={}),t.baseLayer=n.get("current",Object.assign(Object.assign({},t),{normalizeLayerOptions:!1}))},openCallbackAttr:function(t,e){return s.callbackAttr(t,e,{exposedKeys:["layer"]})},closeCallbackAttr:function(t,e){return s.callbackAttr(t,e,{exposedKeys:["layer","value"]})},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},isWithinForeignOverlay:function(t){let n=e.foreignOverlaySelectors.join(",");return!(!n||!t.closest(n))}};return i.delegate(l,["get","getAll","root","overlays","current","front","sync","count","dismissOverlays"],(()=>n)),i.delegate(l,["accept","dismiss","isRoot","isOverlay","isFront","on","off","emit","parent","history","location","mode","context","element","contains","size","affix"],(()=>n.current)),l}()},3849:(t,e,n)=>{n(7298),up.link=function(){const t=up.util,e=up.element,n=new up.LinkPreloader;let r=null;const i=["a[up-content]","a[up-fragment]","a[up-document]"],s=["a[href]","[up-href]"],o=["[up-follow]","[up-target]","[up-layer]","[up-transition]","[up-preload]","[up-instant]"];function a(e,n){return t.flatMap(e,(t=>n.map((e=>t+e))))}const u=new up.Config((()=>({followSelectors:a(s,o).concat(i),noFollowSelectors:["[up-follow=false]","a[download]","a[target]",'a[href^="#"]:not([up-content]):not([up-fragment]):not([up-document])','a[href^="javascript:"]'],instantSelectors:["[up-instant]"],noInstantSelectors:["[up-instant=false]","[onclick]"],preloadSelectors:a(s,["[up-preload]"]),noPreloadSelectors:["[up-preload=false]"],clickableSelectors:i.concat(["[up-emit]","[up-accept]","[up-dismiss]","[up-clickable]"]),preloadDelay:90,preloadEnabled:"auto"})));function l(){return u.followSelectors.join(",")}function c(){return u.preloadSelectors.join(",")}function p(e){return e.matches(u.noFollowSelectors.join(","))||t.isCrossOrigin(e)}const h=up.mockable((function(t,e){return up.render(f(t,e))}));function d(e,n,r){n=t.options(n);const i=new up.OptionsParser(e,n,r);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=m(e,n),i.json("headers"),i.json("params"),i.booleanOrString("cache"),i.booleanOrString("expireCache"),i.booleanOrString("evictCache"),i.booleanOrString("revalidate"),i.booleanOrString("abort"),i.boolean("abortable"),i.boolean("background"),i.string("contentType"),i.number("badResponseTime"),i.number("timeout"),n}function f(t,e,n){var r,i;e=d(t=up.fragment.get(t),e,n);const s=new up.OptionsParser(t,e,Object.assign({fail:!0},n));return s.boolean("feedback"),s.boolean("fail"),e.origin||(e.origin=t),s.boolean("navigate",{default:!0}),s.string("confirm",{attr:["up-confirm","data-confirm"]}),s.string("target"),s.booleanOrString("fallback"),s.string("content"),s.string("fragment"),s.string("document"),s.boolean("useKeep"),s.boolean("useHungry"),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.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.booleanOrString("animation"),s.booleanOrString("transition"),s.string("easing"),s.number("duration"),null===(i=(r=up.migrate).parseFollowOptions)||void 0===i||i.call(r,s),e.guardEvent||(e.guardEvent=up.event.build("up:link:follow",{log:"Following link"})),e}function m(e,n={}){return t.normalizeMethod(n.method||e.getAttribute("up-method")||e.getAttribute("data-method"))}function g(t){return(t=up.fragment.get(t)).matches(l())&&!p(t)}function y(t){g(t)||t.setAttribute("up-follow","")}function v(t){t.matches("a[href], button")||(e.setMissingAttrs(t,{tabindex:"0",role:"link","up-clickable":""}),t.addEventListener("keydown",(function(t){if("Enter"===t.key||"Space"===t.key)return k(t)})))}function b(t,e){if(t.defaultPrevented||p(e))return!1;const n=`a, [up-href], ${up.form.fieldSelector()}`,r=t.target.closest(n);return!r||r===e}function w(t){const e=t.closest(u.instantSelectors.join(","));return e&&!((n=e).matches(u.noInstantSelectors.join(","))||p(n));var n}function k(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})}return up.macro((function(){return u.clickableSelectors.join(",")}),v),up.on("up:click",l,(function(t,e){b(t,e)&&(up.event.halt(t,{log:!0}),up.focus(e,{preventScroll:!0}),up.error.muteUncriticalRejection(h(e)))})),up.macro("[up-expand]",(function(t){const n=t.getAttribute("up-expand")||"a, [up-href]";let r=e.get(t,n);if(r){const n=e.upAttrs(r);n["up-href"]||(n["up-href"]=r.getAttribute("href")),e.setMissingAttrs(t,n),y(t)}})),up.compiler(c,(function(t){(function(t){return!up.browser.canPushState()||t.matches(u.noPreloadSelectors.join(","))||p(t)||!function(t){const e=d(t);if(e.url)return null==e.cache&&(e.cache="auto"),e.basic=!0,new up.Request(e).willCache()}(t)})(t)||n.watchLink(t)})),up.on("up:framework:reset",(function(){r=null,u.reset(),n.reset()})),{follow:h,followOptions:f,preload:function(e,n){if(e=up.fragment.get(e),!function(){let e=t.negate(up.network.shouldReduceRequests);return t.evalAutoOption(u.preloadEnabled,e)}())return Promise.reject(new up.Error("Link preloading is disabled"));const r=up.event.build("up:link:preload",{log:["Preloading link %o",e]});return h(e,Object.assign(Object.assign({abortable:!1},n),{guardEvent:r,preload:!0}))},makeFollowable:y,makeClickable:v,isSafe:function(t){const e=m(t);return up.network.isSafeMethod(e)},isFollowable:g,shouldFollowEvent:b,followMethod:m,convertClicks:function(t){t.on("click",(function(e,n){if(up.event.isUnmodified(e))return w(n)&&r?up.event.halt(e):t.wasHitByMouseEvent(e)&&(!r||r===e.target)&&k(e),r=null})),t.on("mousedown",(function(t,e){up.event.isUnmodified(t)&&(r=t.target,w(e)&&k(t))}))},config:u,combineFollowableSelectors:a,preloadSelector:c}}(),up.follow=up.link.follow},4453:()=>{up.log=function(){const t=new up.LogConfig;function e(t,e,r,...i){n(t,e,"",r,...i)}function n(e,n,r,i,...s){i&&(t.format?(s.unshift("color: #666666; padding: 1px 3px; border: 1px solid #bbbbbb; border-radius: 2px; font-size: 90%; display: inline-block;"+r,""),i=`%c${n}%c ${i}`):i=`[${n}] ${i}`,console[e](i,...s))}return up.on("up:framework:boot",(function(){if(!t.banner)return;const e=` __ _____ ___ ___ / /_ __\n/ // / _ \\/ _ \\/ _ \\/ / // / ${up.version}\n\\___/_//_/ .__/\\___/_/\\_. / \n / / / /\n\n`;let n="";up.migrate.loaded||(n+="Load unpoly-migrate.js to enable deprecated APIs.\n\n"),t.enabled?n+="Call `up.log.disable()` to disable logging for this session.":n+="Call `up.log.enable()` to enable logging for this session.";const r="color: #777777";t.format?console.log("%c"+e+"%c"+n,"font-family: monospace;"+r,r):console.log(e+n)})),up.on("up:framework:reset",(function(){t.reset()})),{puts:function(...n){t.enabled&&e("log",...n)},putsEvent:function(e){if(t.enabled){let t="#5566cc";n("log",(e=e.originalEvent||e).type,`color: white; border-color: ${t}; background-color: ${t}`,"Interaction on %o",e.target)}},error:(...t)=>e("error",...t),warn:(...t)=>e("warn",...t),config:t,enable:function(){t.enabled=!0},disable:function(){t.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},r=function(){return n[e].apply(this,arguments)};return r.mock=()=>spyOn(n,e),r}return t}},4034:function(){var t=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,s){function o(t){try{u(r.next(t))}catch(t){s(t)}}function a(t){try{u(r.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}u((r=r.apply(t,e||[])).next())}))};up.motion=function(){const e=up.util,n=up.element;let r={},i={};const s=new up.MotionController("motion"),o=new up.Config((()=>({duration:175,easing:"ease",enabled:!matchMedia("(prefers-reduced-motion: reduce)").matches})));function a(t){return e.pickBy(t,(t=>t.isDefault))}function u(){return o.enabled}function l(t,e,r){return p(r),u()&&!v(e)&&r.duration>0&&!n.isSingleton(t)}function c(t,e,n){return n=Object.assign(Object.assign({},n),{finishEvent:s.finishEvent}),new up.CSSTransition(t,e,n).start()}function p(t){t.easing||(t.easing=o.easing),t.duration||(t.duration=o.duration)}function h(t){if(!v(t)){if(e.isFunction(t))return t;if(e.isArray(t))return d(...t);if(!e.isString(t))return up.fail("Unknown transition %o",t);{let e;if(t.indexOf("/")>=0)return d(...t.split("/"));if(e=i[t])return h(e)}}}function d(t,n){if(!v(t)&&!v(n)){const r=f(t)||e.asyncNoop,i=f(n)||e.asyncNoop;return(t,e,n)=>Promise.all([r(t,n),i(e,n)])}}function f(t){return v(t)?void 0:e.isFunction(t)?t:e.isString(t)?r[n=t]||up.fail("Unknown animation %o",n):e.isOptions(t)?(e,n)=>c(e,t,n):up.fail("Unknown animation %o",t);var n}const m=up.mockable((function(t,e){t.replaceWith(e)}));function g(t,e){const n=h(e);n.isDefault=up.framework.evaling,i[t]=n}function y(t,e){const n=f(e);n.isDefault=up.framework.evaling,r[t]=n}function v(t){return!t||"none"===t}function b(t,e,r){y(t,(function(t,i){return t.style.opacity=0,n.setStyle(t,{opacity:e}),c(t,{opacity:r},i)}))}function w(t,e){return{transform:`translate(${t}px, ${e}px)`}}function k(t){return n.setStyle(t,w(0,0)),t.getBoundingClientRect()}function O(t,e){const r=`move-from-${t}`;y(`move-to-${t}`,(function(t,n){const r=k(t);return c(t,e(r),n)})),y(r,(function(t,r){const i=k(t),s=e(i);return n.setStyle(t,s),c(t,w(0,0),r)}))}return up.on("up:framework:boot",(function(){u()||up.puts("up.motion","Animations are disabled")})),b("fade-in",0,1),b("fade-out",1,0),O("top",(function(t){return w(0,-(t.top+t.height))})),O("bottom",(function(t){return w(0,up.viewport.rootHeight()-t.top)})),O("left",(function(t){return w(-(t.left+t.width),0)})),O("right",(function(t){return w(up.viewport.rootWidth()-t.left,0)})),g("cross-fade",["fade-out","fade-in"]),g("move-left",["move-to-left","move-from-right"]),g("move-right",["move-to-right","move-from-left"]),g("move-up",["move-to-top","move-from-bottom"]),g("move-down",["move-to-bottom","move-from-top"]),up.on("up:framework:reset",(function(){s.reset(),r=a(r),i=a(i),o.reset()})),{morph:function(r,i,o,a){p(a=e.options(a)),r=up.fragment.get(r),i=up.fragment.get(i);const u=h(o),c=l(r,u,a),d=e.pluckKey(a,"beforeStart")||e.noop,f=e.pluckKey(a,"afterInsert")||e.noop,g=e.pluckKey(a,"beforeDetach")||e.noop,y=e.pluckKey(a,"afterDetach")||e.noop,v=e.pluckKey(a,"scrollNew")||e.noop;if(d(),c){if(s.isActive(r)&&!1===a.trackMotion)return u(r,i,a);up.puts("up.morph()","Morphing %o to %o with transition %O",r,i,o);const e=up.viewport.get(r),l=e.scrollTop,c=up.viewport.absolutize(r,{afterMeasure(){n.insertBefore(r,i),f()}}),p=function(){return t(this,void 0,void 0,(function*(){v();const t=e.scrollTop;c.moveBounds(0,t-l),yield u(r,i,a),g(),c.bounds.remove(),y()}))};return s.startFunction([r,i],p,a)}return g(),m(r,i),f(),y(),v(),Promise.resolve()},animate:function(t,r,i){t=up.fragment.get(t),i=e.options(i);const o=f(r);if(l(t,r,i)){const e=()=>o(t,i);return s.startFunction(t,e,i)}return function(t,r){return e.isOptions(r)&&n.setStyle(t,r),Promise.resolve()}(t,r)},finish:function(t){return s.finish(t)},finishCount:()=>s.finishCount,transition:g,animation:y,config:o,isEnabled:u,isNone:v,willAnimate:l,swapElementsDirectly:m}}(),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(2903);const r=up.util;up.network=function(){const t=new up.Config((()=>({concurrency:()=>s()?3:6,wrapMethod:!0,cacheSize:70,cacheExpireAge:15e3,cacheEvictAge:54e5,badDownlink:.6,badRTT:750,badResponseTime:400,fail:t=>(t.status<200||t.status>299)&&304!==t.status,autoCache:t=>t.isSafe(),expireCache:(t,e)=>!t.isSafe(),evictCache:!1,requestMetaKeys:["target","failTarget","mode","failMode","context","failContext"],progressBar:!0,timeout:9e4}))),e=new up.Request.Queue,n=new up.Request.Cache;let i=null;function s(){let e=navigator.connection;if(e)return e.rtt&&e.rtt>t.badRTT||e.downlink&&e.downlink<t.badDownlink}function o(...t){var n,r;null===(r=(n=up.migrate).preprocessAbortArgs)||void 0===r||r.call(n,t),e.abort(...t)}return up.on("up:network:late",(function(){r.evalOption(t.progressBar)&&(i=new up.ProgressBar)})),up.on("up:network:recover",(function(){null==i||i.conclude()})),up.on("up:framework:reset",(function(){o(),e.reset(),t.reset(),n.evict(),null==i||i.destroy(),i=null})),{request:function(...i){const s=function(t){var e,n;const i=r.extractOptions(t);return i.url||(i.url=t[0]),null===(n=(e=up.migrate).handleRequestOptions)||void 0===n||n.call(e,i),i}(i),o=new up.Request(s);return function(t){let r;if(t.willCache()&&(r=n.get(t)))return up.puts("up.request()","Re-using previous request to %s %s",t.method,t.url),t.preload||e.promoteToForeground(r),t.followState(r),t.fromCache=!0,!0}(o)||function(i){i.preload&&!i.isSafe()&&up.fail("Will not preload request to %s",i.description),function(e){e.willCache()&&n.set(e,e),r.always(e,(function(i){var s,o,a,u;let l=null!==(o=null!==(s=i.expireCache)&&void 0!==s?s:e.expireCache)&&void 0!==o?o:r.evalOption(t.expireCache,e,i);l&&n.expire(l,{except:e});let c=null!==(u=null!==(a=i.evictCache)&&void 0!==a?a:e.evictCache)&&void 0!==u?u:r.evalOption(t.evictCache,e,i);c&&n.evict(c,{except:e}),n.get(e)&&n.set(e,e),i.ok||n.evict(e)}))}(i),e.asap(i)}(o),o},cache:n,isBusy:function(){return e.isBusy()},isSafeMethod:function(t){return r.contains(["GET","OPTIONS","HEAD"],r.normalizeMethod(t))},config:t,abort:o,registerAliasForRedirect:function(t,e){if(t.cache&&e.url&&t.url!==e.url){const r=t.variant({method:e.method,url:e.url});n.alias(t,r)}},queue:e,shouldReduceRequests:s,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()))},r=function(e,r,i=t.identity){let s=e.getResponseHeader(n(r));if(s)return i(s)};function i(t){return"false"!==t&&t}const s=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",nonceableAttributes:["up-watch","up-on-accepted","up-on-dismissed","up-on-loaded","up-on-rendered","up-on-finished","up-on-error","up-on-offlne"]})));function a(){o.reset()}return up.on("up:framework:reset",a),{config:o,reset:a,locationFromXHR:function(t){return r(t,"location")||t.responseURL},titleFromXHR:function(t){return r(t,"title")},targetFromXHR:function(t){return r(t,"target")},methodFromXHR:function(e){return r(e,"method",t.normalizeMethod)},acceptLayerFromXHR:function(t){return r(t,"acceptLayer",JSON.parse)},contextFromXHR:function(t){return r(t,"context",JSON.parse)},dismissLayerFromXHR:function(t){return r(t,"dismissLayer",JSON.parse)},eventPlansFromXHR:function(t){return r(t,"events",JSON.parse)},expireCacheFromXHR:function(t){var e,n;return r(t,"expireCache")||(null===(n=(e=up.migrate).clearCacheFromXHR)||void 0===n?void 0:n.call(e,t))},evictCacheFromXHR:function(t){return r(t,"evictCache",i)},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:s,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,r=/'nonce-([^']+)'/g;for(;n=r.exec(t);)e.push(n[1])}}return e}}}()},9615:()=>{up.radio=function(){const t=up.util,e=up.element,n=new up.Config((()=>({hungrySelectors:["[up-hungry]"],pollInterval:3e4,stretchPollInterval:t=>t*(up.network.shouldReduceRequests()?2:1),pollEnabled:"auto"})));return up.compiler("[up-poll]",(function(t){up.fragment.isTargetable(t)?up.FragmentPolling.forFragment(t).onPollAttributeObserved():up.warn("[up-poll]","Ignoring untargetable fragment %o",t)})),up.on("up:framework:reset",(function(){n.reset()})),{config:n,hungrySolutions:function({layer:r,history:i,origin:s}){let o=n.hungrySelectors.join(", "),a=up.fragment.all(o,{layer:"any"});return t.filterMap(a,(t=>{let n=up.fragment.tryToTarget(t,{origin:s});if(n){if(!e.booleanAttr(t,"up-if-history")||i)return"any"===e.attr(t,"up-if-layer")||r===up.layer.get(t)?{target:n,element:t}:void 0}else up.warn("[up-hungry]","Ignoring untargetable fragment %o",t)}))},startPolling:function(t,e={}){up.FragmentPolling.forFragment(t).forceStart(e)},stopPolling:function(t){up.FragmentPolling.forFragment(t).forceStop()},pollIssue:function(t){var e,r;let i=n.pollEnabled;if(!1===i)return"User has disabled polling";if("auto"===i){if(document.hidden)return"Tab is hidden";if(!(null===(r=null===(e=up.layer.get(t))||void 0===e?void 0:e.isFront)||void 0===r?void 0:r.call(e)))return"Fragment is on a background layer"}return up.emit(t,"up:fragment:poll",{log:["Polling fragment",t]}).defaultPrevented?"User prevented up:fragment:poll event":void 0}}}()},6774:()=>{!function(){const t=up.element;for(let e of["method","confirm"]){const n=`up-${e}`,r=`data-${e}`;up.macro(`a[${r}]`,(function(e){var i;(window.Rails||(null===(i=window.jQuery)||void 0===i?void 0:i.rails))&&up.link.isFollowable(e)&&(t.setMissingAttr(e,n,e.getAttribute(r)),e.removeAttribute(r))}))}}()},2514:()=>{up.syntax=function(){const t=up.util,e={"[up-back]":-100,"[up-content]":-200,"[up-drawer]":-200,"[up-modal]":-200,"[up-cover]":-200,"[up-popup]":-200,"[up-tooltip]":-200,"[up-dash]":-200,"[up-expand]":-300,"[data-method]":-400,"[data-confirm]":-400};let n=[],r=[];function i(e){let[n,r,i]=function(e){const n=t.extractOptions(e),r=e.shift(),i=e.pop();return[r,Object.assign(Object.assign({},n),t.extractOptions(e)),i]}(e);return r=t.options(r,{selector:n,isDefault:up.framework.evaling,priority:0,batch:!1}),Object.assign(i,r)}function s(t,e){let n,r=0;for(;(n=t[r])&&n.priority>=e.priority;)r+=1;if(t.splice(r,0,e),up.framework.booted)if(0===e.priority)for(let t of up.layer.stack)o(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 o(t,e){let i=e.compilers||r.concat(n);new up.CompilerPass(t,i,e).run()}return up.on("up:framework:reset",(function(){n=t.filter(n,"isDefault"),r=t.filter(r,"isDefault")})),{compiler:function(...t){const e=i(t);return s(n,e)},macro:function(...n){const o=i(n);return up.framework.evaling&&(o.priority||(o.priority=function(n){n=t.evalOption(n);for(let t in e){const r=e[t];if(n.indexOf(t)>=0)return r}}(o.selector)||up.fail("Unregistered priority for system macro %o",o.selector))),s(r,o)},destructor:function(e,n){let r=e.upDestructors;r||(r=[],e.upDestructors=r,e.classList.add("up-can-clean")),t.isArray(n)?r.push(...n):r.push(n)},hello:function(t,e={}){return t=up.fragment.get(t,e),up.puts("up.hello()","Compiling fragment %o",t),o(t,e),up.fragment.emitInserted(t),t},clean:function(t,e={}){new up.DestructorPass(t,e).run()},data:function(e){return(e=up.fragment.get(e)).upData||(e.upData=function(e){if(!e.getAttribute)return{};let n,r=e.getAttribute("up-data");return r&&(n=JSON.parse(r),!t.isOptions(n))?n:Object.assign(Object.assign(Object.assign({},e.dataset),n),e.upCompileData)}(e))}}}(),up.compiler=up.syntax.compiler,up.destructor=up.syntax.destructor,up.macro=up.syntax.macro,up.data=up.syntax.data,up.hello=up.syntax.hello},7924:()=>{up.util=function(){function t(){}const e={host:"cross-domain"};function n(t,n){n=T(n,e);const r=o(t);let i="";"cross-domain"===n.host&&(n.host=s(r)),n.host&&(i+=r.protocol+"//"+r.host);let{pathname:a}=r;return!1===n.trailingSlash&&"/"!==a&&(a=a.replace(/\/$/,"")),i+=a,!1!==n.search&&(i+=r.search),!1!==n.hash&&(i+=r.hash),i}const r=location.protocol,i=location.hostname;function s(t){if(v(t)&&-1===t.indexOf("//"))return!1;const e=o(t);return i!==e.hostname||r!==e.protocol}function o(t){if(t.pathname)return t;let e=document.createElement("a");return e.href=t,e}function a(t){return v(t)?e=>e[t]:t}function u(t,e){if(0===t.length)return[];e=a(e);let n=[];for(let r=0;r<t.length;r++){let i=t[r];n.push(e(i,r))}return n}function l(t,e){for(let n=0;n<t.length;n++)e(t[n],n)}function c(t){return null===t}function p(t){return void 0===t}const h=Y(p);function d(t){return p(t)||c(t)}const f=Y(d);function m(t){return!!d(t)||(k(t)&&t[m.key]?t[m.key]():v(t)||x(t)?0===t.length:!!w(t)&&0===Object.keys(t).length)}m.key="up.util.isBlank";const g=Y(m);function y(t){return"function"==typeof t}function v(t){return"string"==typeof t||t instanceof String}function b(t){return"number"==typeof t||t instanceof Number}function w(t){return"object"==typeof t&&!c(t)&&(p(t.constructor)||t.constructor===Object)}function k(t){const e=typeof t;return"object"===e&&!c(t)||"function"===e}function O(t){return t instanceof Element}function E(t){return t instanceof RegExp}function S(t){return up.browser.canJQuery()&&t instanceof jQuery}const{isArray:C}=Array;function x(t){return C(t)||function(t){return t instanceof NodeList}(t)||function(t){return"[object Arguments]"===Object.prototype.toString.call(t)}(t)||S(t)||function(t){return t instanceof HTMLCollection}(t)}function R(t){return x(t)?t:d(t)?[]:[t]}function F(t){return k(t)&&t[F.key]?t=t[F.key]():x(t)?t=A(t):w(t)&&(t=Object.assign({},t)),t}function A(t){return Array.prototype.slice.call(t)}function L(...t){return Object.assign({},...t)}function T(t,e){return e?L(e,t):t?F(t):{}}function P(t,e){e=a(e);for(let n=0;n<t.length;n++){const r=e(t[n],n);if(r)return r}}function j(t,e){e=a(e);let n=!0;for(let r=0;r<t.length;r++)if(!e(t[r],r)){n=!1;break}return n}function q(t){return D(t,f)}function D(t,e){e=a(e);const n=[];return l(t,(function(t,r){if(e(t,r))return n.push(t)})),n}function M(t){return t[t.length-1]}function H(t,e){return t.indexOf(e)>=0}function N(t,e){const n={};for(let r of e)r in t&&(n[r]=t[r]);return n}function $(t,e){e=a(e);const n={};for(let r in t)e(t[r],r,t)&&(n[r]=t[r]);return n}function B(t,...e){return y(t)?t(...e):t}F.key="up.util.copy",Date.prototype[F.key]=function(){return new Date(+this)};const z={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"};function U(t,e){const n=t[e];return delete t[e],n}function K(t,e){if(e(M(t)))return t.pop()}function W(t){return K(t,w)||{}}function V(t){const e=[];for(let n of t)x(n)?e.push(...n):e.push(n);return e}function _(t,e){if((null==t?void 0:t.valueOf)&&(t=t.valueOf()),(null==e?void 0:e.valueOf)&&(e=e.valueOf()),typeof t!=typeof e)return!1;if(x(t)&&x(e))return I(t,e);if(k(t)&&t[_.key])return t[_.key](e);if(w(t)&&w(e)){const n=Object.keys(t);return!!I(n,Object.keys(e))&&j(n,(n=>_(t[n],e[n])))}return t===e}function I(t,e){return t.length===e.length&&j(t,((t,n)=>_(t,e[n])))}_.key="up.util.isEqual";const X={"space/or":/\s+(?:or\s+)?/,or:/\s+or\s+/,comma:/\s*,\s*/};let G=0;function Q(t){let e,n="";if(v(t))e=t.replace(/[\n\r\t ]+/g," "),e=e.replace(/^[\n\r\t ]+/,""),e=e.replace(/[\n\r\t ]$/,"");else if(p(t))e="undefined";else if(b(t)||y(t))e=t.toString();else if(C(t))e=`[${u(t,Q).join(", ")}]`,n="]";else if(S(t))e=`$(${u(t,Q).join(", ")})`,n=")";else if(O(t)){e=`<${t.tagName.toLowerCase()}`;for(let n of["id","name","class"]){let r=t.getAttribute(n);r&&(e+=` ${n}="${r}"`)}e+=">",n=">"}else if(E(t))e=t.toString();else try{e=JSON.stringify(t)}catch(t){if("TypeError"!==t.name)throw t;e="(circular structure)"}return e.length>200&&(e=`${e.substr(0,200)} …`,e+=n),e}const J=/%[oOdisf]/g;function Y(t){return function(...e){return!t(...e)}}function Z(t){if(t.error)throw t.error;return t.value}function tt(t,e,n){try{return{value:t.apply(e,n)}}catch(t){return{error:t}}}return{parseURL:o,normalizeURL:n,matchURLs:function(t,e){return n(t)===n(e)},normalizeMethod:function(t){return t?t.toUpperCase():"GET"},methodAllowsPayload:function(t){return"GET"!==t&&"HEAD"!==t},copy:F,copyArrayLike:A,merge:L,mergeDefined:function(...t){const e={};for(let n of t)if(n)for(let t in n){const r=n[t];h(r)&&(e[t]=r)}return e},options:T,parseArgIntoOptions:function(t,e){let n=W(t);return h(t[0])&&(n=F(n),n[e]=t[0]),n},each:l,map:u,flatMap:function(t,e){return V(u(t,e))},mapObject:function(t,e){return u(t,e).reduce((function(t,e){return t[e[0]]=e[1],t}),{})},findResult:P,some:function(t,e){return!!P(t,e)},every:j,find:function(t,e){let n;e=a(e);for(let r of t)if(e(r)){n=r;break}return n},filter:D,filterMap:function(t,e){return D(u(t,e),h)},reject:function(t,e){return D(t,e=Y(a(e)))},intersect:function(t,e){return D(t,(t=>H(e,t)))},compact:q,compactObject:function(t){return $(t,f)},uniq:function(t){return t.length<2?t:Array.from(new Set(t))},uniqBy:function(t,e){if(t.length<2)return t;e=a(e);const n=new Set;return D(t,(function(t,r){const i=e(t,r);return!n.has(i)&&(n.add(i),!0)}))},last:M,isNull:c,isDefined:h,isUndefined:p,isGiven:f,isMissing:d,isPresent:g,isBlank:m,presence:function(t,e=g){if(e(t))return t},isObject:k,isFunction:y,isString:v,isBoolean:function(t){return"boolean"==typeof t||t instanceof Boolean},isNumber:b,isElement:O,isJQuery:S,isElementish:function(t){var e;return!(!t||!t.addEventListener&&!(null===(e=t[0])||void 0===e?void 0:e.addEventListener))},isPromise:function(t){return k(t)&&y(t.then)},isOptions:w,isArray:C,isFormData:function(t){return t instanceof FormData},isList:x,isRegExp:E,timer:function(t,e){return setTimeout(e,t)},contains:H,objectContains:function(t,e){return _(e,N(t,Object.keys(e)))},toArray:function(t){return C(t)?t:A(t)},pick:N,pickBy:$,omit:function(t,e){return $(t,((t,n)=>!H(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(...r){return n?e:(n=!0,e=t.apply(this,r))}},pluckKey:U,renameKey:function(t,e,n){return t[n]=U(t,e)},extractOptions:W,extractCallback:function(t){return K(t,y)},noop:t,asyncNoop:function(){return Promise.resolve()},identity:function(t){return t},escapeHTML:function(t){return t.replace(/[&<>"']/g,(t=>z[t]))},escapeRegExp:function(t){return t.replace(/[\\^$*+?.()|[\]{}]/g,"\\$&")},sequence:function(t){return t=q(t),(...e)=>u(t,(t=>t(...e)))},evalOption:B,evalAutoOption:function(t,e,...n){return"auto"===(t=B(t,...n))&&(t=B(e,...n)),t},flatten:V,newDeferred:function(){let t,e;const n=new Promise((function(n,r){t=n,e=r}));return n.resolve=t,n.reject=e,n},always:function(t,e){return t.then(e,e)},isBasicObjectProperty:function(t){return Object.prototype.hasOwnProperty(t)},isCrossOrigin:s,task:function(t){return setTimeout(t)},microtask:function(t){return Promise.resolve().then(t)},isEqual:_,parseTokens:function(t,e={}){if(v(t)){if(t=t.trim(),e.json&&/^\[.*]$/.test(t))return JSON.parse(t);{let n=e.separator||"space/or",r=X[n];return t.split(r)}}return R(t)},wrapList:R,wrapValue:function(t,...e){return e[0]instanceof t?e[0]:new t(...e)},uid:function(){return G++},upperCaseFirst:function(t){return t[0].toUpperCase()+t.slice(1)},lowerCaseFirst:function(t){return t[0].toLowerCase()+t.slice(1)},getter:function(t,e,n){Object.defineProperty(t,e,{get:n})},delegate:function(t,e,n){R(e).forEach((function(e){Object.defineProperty(t,e,{get(){const t=n.call(this);let r=t[e];return y(r)&&(r=r.bind(t)),r},set(t){n.call(this)[e]=t}})}))},reverse:function(t){return F(t).reverse()},camelToKebabCase:function(t){return t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))},nullToUndefined:function(t){if(!c(t))return t},sprintf:function(t,...e){return t.replace(J,(()=>Q(e.shift())))},renameKeys:function(t,e){const n={};for(let r in t)n[e(r)]=t[r];return n},negate:Y,memoizeMethod:function(t,e){for(let n of R(e)){let e=t[n];t[n]=function(...t){var r;let i=this[r=`__${n}MemoizeCache`]||(this[r]={}),s=JSON.stringify(t);return i[s]||(i[s]=tt(e,this,t)),Z(i[s])}}}}}()},4606:(t,e,n)=>{n(573),up.viewport=function(){const t=up.util,e=up.element,n=up.fragment,r=new up.Config((()=>({viewportSelectors:["[up-viewport]","[up-fixed]"],fixedTop:["[up-fixed~=top]"],fixedBottom:["[up-fixed~=bottom]"],anchoredRight:["[up-anchored~=right]","[up-fixed~=top]","[up-fixed~=bottom]","[up-fixed~=right]"],revealSnap:200,revealPadding:0,revealTop:!1,revealMax:()=>.5*window.innerHeight})));function i(e,r){var i,s;return r=t.options(r),e=n.get(e,r),(r.layer=up.layer.get(e))||up.fail("Cannot reveal a detached element"),r.peel&&r.layer.peel(),new up.RevealMotion(e,r).start(),(null===(s=(i=up.migrate).formerlyAsync)||void 0===s?void 0:s.call(i,"up.reveal()"))||!0}function s(t,e={}){if(e.force&&function(t){t.hasAttribute("tabindex")||-1!==t.tabIndex||(t.setAttribute("tabindex","-1"),t.classList.add("up-focusable-content"))}(t),t.focus({preventScroll:!0}),!e.preventScroll)return i(t)}function o(t=location.hash,e){let n=g(t,e);if(n)return up.reveal(n,{top:!0})}function a(){return[c().tagName,...r.viewportSelectors].join(",")}function u(t,e={}){return n.get(t,e).closest(a())}function l(t,r={}){return t=n.get(t,r),e.around(t,a())}function c(){return document.scrollingElement}function p(t){const n=e.style(t,"overflow-y");return"auto"===n||"scroll"===n}const h=t.memoize((function(){const t=up.element.affix(document.body,"[up-viewport]",{style:{position:"absolute",top:"0",left:"0",width:"100px",height:"100px",overflowY:"scroll"}}),e=t.offsetWidth-t.clientWidth;return t.remove(),e}));function d(t){return up.fragment.tryToTarget(t)}function f(e){const r=t.copy(t.extractOptions(e));let i;return r.layer=up.layer.get(r),i=e[0]?[u(e[0],r)]:r.around?l(r.around,r):function(t={}){return n.all(a(),t)}(r),[i,r]}function m(t,e){for(let n of t){const t=d(n);n.scrollTop=e[t]||0}}function g(t,r={}){if(t=null==(i=t)?void 0:i.replace(/^#/,"")){const i=[e.attrSelector("id",t),"a"+e.attrSelector("name",t)].join(",");return n.get(i,r)}var i}const y=["selectionStart","selectionEnd","scrollLeft","scrollTop"];let v=!1;return up.on("scroll",{once:!0,beforeBoot:!0},(()=>v=!0)),up.on("up:framework:boot",(function(){t.task((function(){if(!v)return o()}))})),up.on(window,"hashchange",(()=>o())),up.on("up:framework:reset",(function(){r.reset()})),{reveal:i,revealHash:o,firstHashTarget:g,config:r,get:u,subtree:function(t,r={}){return t=n.get(t,r),e.subtree(t,a())},around:l,get root(){return c()},rootWidth:function(){return e.root.clientWidth},rootHeight:function(){return e.root.clientHeight},rootHasReducedWidthFromScrollbar:function(){return window.innerWidth>document.documentElement.offsetWidth},rootOverflowElement:function(){const{body:e}=document,n=document.documentElement;return t.find([n,e],p)||c()},isRoot:function(t){return t===c()},scrollbarWidth:h,saveScroll:function(...t){const[e,n]=f(t),r=n.location||n.layer.location;if(r){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(r,t)}},restoreScroll:function(...t){const[e,n]=f(t),{location:r}=n.layer,i=n.layer.lastScrollTops.get(r);return!!i&&(m(e,i),up.puts("up.viewport.restoreScroll()","Restored scroll positions to %o",i),!0)},resetScroll:function(...t){const[e,n]=f(t);m(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,r=t.layer.lastFocusCapsules.get(n);return!(!r||!r.restore(e)||(up.puts("up.viewport.restoreFocus()",'Restored focus to "%s"',r.target),0))},anchoredRight:function(){const t=r.anchoredRight.join(",");return n.all(t,{layer:"root"})},absolutize:function(n,i={}){var s;const o=u(n).getBoundingClientRect(),a=n.getBoundingClientRect(),l=new up.Rect({left:a.left-o.left,top:a.top-o.top,width:a.width,height:a.height});null===(s=i.afterMeasure)||void 0===s||s.call(i),e.setStyle(n,{position:"static"===n.style.position?"static":"relative",top:"auto",right:"auto",bottom:"auto",left:"auto",width:"100%",height:"100%"});const c=e.createFromSelector("up-bounds");e.insertBefore(n,c),c.appendChild(n);const p=function(t,n){return l.left+=t,l.top+=n,e.setStyle(c,l)};p(0,0);const h=n.getBoundingClientRect();return p(a.left-h.left,a.top-h.top),t.each(function(t=document){const e=["[up-fixed]"].concat(r.fixedTop).concat(r.fixedBottom);return t.querySelectorAll(e.join(","))}(n),e.fixedToAbsolute),{bounds:c,moveBounds:p}},focus:s,tryFocus:function(t,e){return s(t,e),t===document.activeElement},newStateCache:function(){return new up.Cache({size:30,key:up.history.normalizeURL})},focusedElementWithin:function(t){const n=document.activeElement;if(e.isInSubtree(t,n))return n},copyCursorProps:function(t,e={}){for(let n of y)try{e[n]=t[n]}catch(t){}return e}}}(),up.focus=up.viewport.focus,up.reveal=up.viewport.reveal},3507:()=>{window.up={version:"3.0.0-rc2"}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n(3507),n(8374),n(7924),n(3924),n(6535),n(2811),n(9675),n(376),n(8272),n(4366),n(5485),n(8010),n(4861),n(3469),n(4504),n(2406),n(3742),n(1653),n(3115),n(1279),n(6346),n(3030),n(7948),n(2714),n(1752),n(8228),n(7050),n(9441),n(7422),n(9005),n(2200),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(6267),n(7956),n(7403),n(6412),n(7965),n(7771),n(86),n(4552),n(5580),n(7101),n(6066),n(6387),n(5390),n(2618),n(7792),n(4308),n(1104),n(8665),n(3645),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(2514),n(8944),n(2667),n(4606),n(4034),n(1647),n(9443),n(3849),n(2851),n(454),n(9615),n(6774),up.framework.onEvaled()})();
1
+ (()=>{var t={5941:()=>{},7433:()=>{},7921:()=>{},7298:()=>{},2903:()=>{},573:()=>{},2811:()=>{up.browser=function(){function t(){return!!window.jQuery}return{submitForm:function(t){t.submit()},canPushState:function(){return"GET"===up.protocol.initialRequestMethod()},canJQuery:t,canEval:up.util.memoize((function(){try{return new Function("return true")()}catch(t){return!1}})),assertConfirmed:function(t){if(t.confirm&&!window.confirm(t.confirm))throw new up.Aborted("User canceled action");return!0},popCookie:function(t){var e;let n=null===(e=document.cookie.match(new RegExp(t+"=(\\w+)")))||void 0===e?void 0:e[1];if(n)return document.cookie=t+"=;Max-Age=0;Path=/",n},get jQuery(){return t()||up.fail("jQuery must be published as window.jQuery"),jQuery}}}()},6346:()=>{const t=up.element;up.BodyShifter=class{constructor(){this.unshiftFns=[],this.reset()}reset(){this.unshiftNow(),this.shiftCount=0}shift(){if(this.shiftCount++,this.shiftCount>1)return;const e=up.viewport.rootHasReducedWidthFromScrollbar(),n=up.viewport.rootOverflowElement();if(this.changeStyle(n,{overflowY:"hidden"}),!e)return;const{body:r}=document,i=up.viewport.scrollbarWidth(),s=i+t.styleNumber(r,"paddingRight");this.changeStyle(r,{paddingRight:s});for(let e of up.viewport.anchoredRight()){const n=i+t.styleNumber(e,"right");this.changeStyle(e,{right:n})}}changeStyle(e,n){this.unshiftFns.push(t.setTemporaryStyle(e,n))}unshift(){this.shiftCount--,0==this.shiftCount&&this.unshiftNow()}unshiftNow(){let t;for(;t=this.unshiftFns.pop();)t()}}},3115:()=>{const t=up.util;up.Cache=class{constructor(t={}){this.config=t,this.map=new Map}size(){return this.map.size}maxSize(){return t.evalOption(this.config.size)}evictAge(){return t.evalOption(this.config.evictAge)}normalizeStoreKey(t){return t}isDisabled(){return 0===this.maxSize()||0===this.evictAge()}evict(){this.map.clear()}records(){return this.map.values()}makeRoomForAnotherRecord(){const t=this.maxSize(),e=this.size();if(!t||e<t)return;let n=Array.from(this.records());n.sort(((t,e)=>e.createdAt-t.createdAt));const r=e-t+1;for(let t=0;t<r;t++){let t=n.pop().key;this.map.delete(t)}}alias(e,n){const r=this.get(e);t.isDefined(r)&&this.set(n,r)}set(t,e){if(this.isDisabled())return;this.makeRoomForAnotherRecord();const n={key:t=this.normalizeStoreKey(t),value:e,createdAt:new Date};this.map.set(t,n)}remove(t){t=this.normalizeStoreKey(t),this.map.delete(t)}isUsable(t){const e=this.evictAge();return!e||new Date-t.createdAt<e}get(t){const e=this.normalizeStoreKey(t);let n=this.map.get(e);if(n){if(this.isUsable(n))return n.value;this.remove(t)}}}},7948:()=>{const t=up.util,e=up.element;up.Change.Addition=class extends up.Change{constructor(t){super(t),this.responseDoc=t.responseDoc,this.acceptLayer=t.acceptLayer,this.dismissLayer=t.dismissLayer,this.eventPlans=t.eventPlans||[]}handleLayerChangeRequests(){this.layer.isOverlay()&&(this.tryAcceptLayerFromServer(),this.abortWhenLayerClosed(),this.layer.tryAcceptForLocation(),this.abortWhenLayerClosed(),this.tryDismissLayerFromServer(),this.abortWhenLayerClosed(),this.layer.tryDismissForLocation(),this.abortWhenLayerClosed()),this.layer.asCurrent((()=>{for(let t of this.eventPlans)up.emit(t),this.abortWhenLayerClosed()}))}tryAcceptLayerFromServer(){t.isDefined(this.acceptLayer)&&this.layer.isOverlay()&&this.layer.accept(this.acceptLayer)}tryDismissLayerFromServer(){t.isDefined(this.dismissLayer)&&this.layer.isOverlay()&&this.layer.dismiss(this.dismissLayer)}abortWhenLayerClosed(){if(this.layer.isClosed())throw new up.Aborted("Layer was closed")}setSource({oldElement:n,newElement:r,source:i}){"keep"===i&&(i=n&&up.fragment.source(n)),i&&e.setMissingAttr(r,"up-source",t.normalizeURL(i,{hash:!1}))}setTime({newElement:t,time:n}){e.setMissingAttr(t,"up-time",!!n&&n.toUTCString())}setETag({newElement:t,etag:n}){e.setMissingAttr(t,"up-etag",n||!1)}setMeta(t){this.setSource(t),this.setTime(t),this.setETag(t)}}},3030:()=>{const t=up.util;up.Change=class{constructor(t){this.options=t}cannotMatch(t){throw new up.CannotMatch(t)}execute(){throw new up.NotImplemented}onFinished(t){var e,n;return null===(n=(e=this.options).onFinished)||void 0===n?void 0:n.call(e,t)}improveHistoryValue(e,n){return!1===e||t.isString(e)?e:n}}},7422:()=>{const t=up.util;up.Change.CloseLayer=class extends up.Change.Removal{constructor(t){var e;super(t),this.verb=t.verb,this.layer=up.layer.get(t),this.origin=t.origin,this.value=t.value,this.preventable=null===(e=t.preventable)||void 0===e||e}execute(){if(!this.layer.isOpen())return Promise.resolve();if(up.browser.assertConfirmed(this.options),this.emitCloseEvent().defaultPrevented&&this.preventable)throw new up.Aborted("Close event was prevented");up.fragment.abort({reason:"Layer is closing",layer:this.layer});const{parent:t}=this.layer;this.layer.peel(),this.layer.stack.remove(this.layer),t.restoreHistory(),this.handleFocus(t),this.layer.teardownHandlers(),this.layer.destroyElements(this.options),this.emitClosedEvent(t)}emitCloseEvent(){let e=this.layer.emit(this.buildEvent(`up:layer:${this.verb}`),{callback:this.layer.callback(`on${t.upperCaseFirst(this.verb)}`),log:[`Will ${this.verb} ${this.layer} with value %o`,this.value]});return this.value=e.value,e}emitClosedEvent(e){const n=`${this.verb}ed`,r=t.upperCaseFirst(n);return this.layer.emit(this.buildEvent(`up:layer:${n}`),{baseLayer:e,callback:this.layer.callback(`on${r}`),ensureBubbles:!0,log:[`${r} ${this.layer} with value %o`,this.value]})}buildEvent(t){return up.event.build(t,{layer:this.layer,value:this.value,origin:this.origin})}handleFocus(t){var e;this.layer.overlayFocus.teardown(),null===(e=t.overlayFocus)||void 0===e||e.moveToFront(),(this.layer.origin||t.element).focus({preventScroll:!0})}}},8228:function(){var t=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,s){function o(t){try{u(r.next(t))}catch(t){s(t)}}function a(t){try{u(r.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}u((r=r.apply(t,e||[])).next())}))};up.Change.DestroyFragment=class extends up.Change.Removal{constructor(t){super(t),this.layer=up.layer.get(t)||up.layer.current,this.element=this.options.element,this.animation=this.options.animation,this.log=this.options.log}execute(){return t(this,void 0,void 0,(function*(){this.parent=this.element.parentNode,up.fragment.markAsDestroying(this.element),up.motion.willAnimate(this.element,this.animation,this.options)?(this.emitDestroyed(),yield this.animate(),this.wipe(),this.onFinished()):(this.wipe(),this.emitDestroyed(),this.onFinished())}))}animate(){return up.motion.animate(this.element,this.animation,this.options)}wipe(){this.layer.asCurrent((()=>{up.fragment.abort(this.element),up.syntax.clean(this.element,{layer:this.layer}),up.element.cleanJQuery(this.element),this.element.remove()}))}emitDestroyed(){up.fragment.emitDestroyed(this.element,{parent:this.parent,log:this.log})}}},9005:()=>{var t;const e=up.util;up.Change.FromContent=(t=class extends up.Change{constructor(t){super(t),this.layers=e.filter(up.layer.getAll(this.options),this.isRenderableLayer),this.origin=this.options.origin,this.preview=this.options.preview,this.mode=this.options.mode,this.origin&&(this.originLayer=up.layer.get(this.origin))}isRenderableLayer(t){return"new"===t||t.isOpen()}getPlans(){var t;let e=[];return this.options.fragment&&((t=this.options).target||(t.target=this.getResponseDoc().rootSelector())),this.expandIntoPlans(e,this.layers,this.options.target),this.expandIntoPlans(e,this.layers,this.options.fallback),e}expandIntoPlans(t,e,n){for(let r of e)for(let e of this.expandTargets(n,r)){const n=Object.assign(Object.assign({},this.options),{target:e,layer:r,defaultPlacement:this.defaultPlacement()}),i="new"===r?new up.Change.OpenLayer(n):new up.Change.UpdateLayer(n);t.push(i)}}expandTargets(t,e){return up.fragment.expandTargets(t,{layer:e,mode:this.mode,origin:this.origin})}execute(){return this.options.preload?Promise.resolve():this.seekPlan(this.executePlan.bind(this))||this.cannotMatchPostflightTarget()}executePlan(t){let e=t.execute(this.getResponseDoc(),this.onPlanApplicable.bind(this,t));return e.options=this.options,e}onPlanApplicable(t){let e=this.getPlans()[0];t!==e&&up.puts("up.render()",'Could not match primary target "%s". Updating a fallback target "%s".',e.target,t.target)}getResponseDoc(){var t,n;if(this.preview)return;const r=e.pick(this.options,["target","content","fragment","document","html","cspNonces","origin"]);return null===(n=(t=up.migrate).handleResponseDocOptions)||void 0===n||n.call(t,r),"content"===this.defaultPlacement()&&(r.target=this.firstExpandedTarget(r.target)),new up.ResponseDoc(r)}defaultPlacement(){if(!this.options.document&&!this.options.fragment)return"content"}firstExpandedTarget(t){return this.expandTargets(t||":main",this.layers[0])[0]}getPreflightProps(t={}){return this.seekPlan((t=>t.getPreflightProps()))||t.optional||this.cannotMatchPreflightTarget()}cannotMatchPreflightTarget(){this.cannotMatchTarget("Could not find target in current page")}cannotMatchPostflightTarget(){this.cannotMatchTarget("Could not find common target in current page and response")}cannotMatchTarget(t){if(this.getPlans().length){const n=e.uniq(e.map(this.getPlans(),"target")),r=up.layer.optionToString(this.options.layer);up.fail(t+" (tried selectors %o in %s)",n,r)}else this.layers.length?this.options.failPrefixForced?up.fail("No target selector given for failed responses (https://unpoly.com/failed-responses)"):up.fail("No target selector given"):up.fail("Layer %o does not exist",this.options.layer)}seekPlan(t){for(let e of this.getPlans())try{return t(e)}catch(t){if(!(t instanceof up.CannotMatch))throw t}}},e.memoizeMethod(t.prototype,["getPlans","getResponseDoc","getPreflightProps"]),t)},2200:function(){var t,e=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,s){function o(t){try{u(r.next(t))}catch(t){s(t)}}function a(t){try{u(r.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}u((r=r.apply(t,e||[])).next())}))};const n=up.util;up.Change.FromURL=(t=class extends up.Change{constructor(t){super(t),this.options.layer=up.layer.getAll(this.options),this.options.normalizeLayerOptions=!1}execute(){var t,e;let r=this.newPageReason();return r?(up.puts("up.render()",r),up.network.loadPage(this.options),n.unresolvablePromise()):(this.request=up.request(this.getRequestAttrs()),null===(e=(t=this.options).onRequest)||void 0===e||e.call(t,this.request),up.feedback.showAroundRequest(this.request,this.options),up.form.disableWhile(this.request,this.options),this.options.preload?this.request:n.always(this.request,(t=>this.onRequestSettled(t))))}deriveFailOptions(){return up.RenderOptions.deriveFailOptions(this.options)}newPageReason(){return n.isCrossOrigin(this.options.url)?"Loading cross-origin content in new page":up.browser.canPushState()?void 0:"Loading content in new page to restore history support"}getRequestAttrs(){const t=this.preflightPropsForRenderOptions(this.options),e=this.preflightPropsForRenderOptions(this.deriveFailOptions(),{optional:!0});return Object.assign(Object.assign(Object.assign({},this.options),t),n.renameKeys(e,up.fragment.failKey))}getPreflightProps(){return this.getRequestAttrs()}preflightPropsForRenderOptions(t,e){return new up.Change.FromContent(Object.assign(Object.assign({},t),{preview:!0})).getPreflightProps(e)}onRequestSettled(t){return t instanceof up.Response?this.onRequestSettledWithResponse(t):this.onRequestSettledWithError(t)}onRequestSettledWithResponse(t){var e;this.response=t;const r=this.options.expiredResponse,i={response:this.response,renderOptions:this.options,revalidating:!!r,expiredResponse:r};if(up.fragment.config.skipResponse(i)?this.skip():this.request.assertEmitted("up:fragment:loaded",Object.assign(Object.assign({},i),{callback:this.options.onLoaded,log:["Loaded fragment from %s",this.response.description],skip:()=>this.skip()})),null!==(e=n.evalOption(this.options.fail,this.response))&&void 0!==e?e:!t.ok)throw this.updateContentFromResponse(this.deriveFailOptions());return this.updateContentFromResponse(this.options)}onRequestSettledWithError(t){throw t instanceof up.Offline&&this.request.emit("up:fragment:offline",{callback:this.options.onOffline,response:this.response,renderOptions:this.options,retry:t=>up.render(Object.assign(Object.assign({},this.options),t)),log:["Cannot load fragment from %s: %s",this.request.description,t.reason]}),t}skip(){up.puts("up.render()","Skipping "+this.response.description),this.options.target=":none",this.options.failTarget=":none"}updateContentFromResponse(t){t.failPrefixForced&&up.puts("up.render()","Rendering failed response using fail-prefixed options (https://unpoly.com/failed-responses)"),this.augmentOptionsFromResponse(t);let e=new up.Change.FromContent(t).execute();return e.finished=this.finish(e,t),e}finish(t,n){return e(this,void 0,void 0,(function*(){return t=yield t.finished,up.fragment.shouldRevalidate(this.request,this.response,n)&&(t=yield this.revalidate(t,n)),t}))}revalidate(t,n){return e(this,void 0,void 0,(function*(){let e=n.target;if(/:(before|after)/.test(e))up.warn("up.render()","Cannot revalidate cache when prepending/appending (target %s)",e);else{up.puts("up.render()",'Revalidating cached response for target "%s"',e);let r=yield up.reload(t.target,Object.assign(Object.assign({},n),{layer:t.layer,onFinished:null,scroll:!1,focus:"keep",transition:!1,cache:!1,confirm:!1,feedback:!1,abort:!1,expiredResponse:this.response}));r.none||(t=r)}return t}))}augmentOptionsFromResponse(t){var e,r;const i=this.response.url;let s=i,o=this.request.hash;o&&(t.hash=o,s+=o),"GET"===this.response.method?t.source=this.improveHistoryValue(t.source,i):(t.source=this.improveHistoryValue(t.source,"keep"),t.history=!!t.location),t.location=this.improveHistoryValue(t.location,s),t.title=this.improveHistoryValue(t.title,this.response.title),t.eventPlans=this.response.eventPlans;let a=this.response.target;a&&(t.target=a),t.acceptLayer=this.response.acceptLayer,t.dismissLayer=this.response.dismissLayer,t.document=this.response.text,t.document||(t.target=":none"),t.context=n.merge(t.context,this.response.context),t.cspNonces=this.response.cspNonces,null!==(e=t.time)&&void 0!==e||(t.time=this.response.lastModified),null!==(r=t.etag)&&void 0!==r||(t.etag=this.response.etag)}},n.memoizeMethod(t.prototype,["getRequestAttrs"]),t)},7050:function(){var t=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,s){function o(t){try{u(r.next(t))}catch(t){s(t)}}function a(t){try{u(r.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}u((r=r.apply(t,e||[])).next())}))};let e=up.util;up.Change.OpenLayer=class extends up.Change.Addition{constructor(t){super(t),this.target=t.target,this.origin=t.origin,this.baseLayer=t.baseLayer}getPreflightProps(){return{mode:this.options.mode,context:this.buildLayer().context,origin:this.options.origin,target:this.target,layer:this.baseLayer,fragments:e.compact([up.fragment.get(":main",{layer:this.baseLayer})])}}execute(t,e){if(":none"===this.target?this.content=document.createElement("up-none"):this.content=t.select(this.target),!this.content||this.baseLayer.isClosed())throw this.cannotMatch();if(e(),up.puts("up.render()",`Opening element "${this.target}" in new overlay`),this.options.title=this.improveHistoryValue(this.options.title,t.getTitle()),this.emitOpenEvent().defaultPrevented)throw new up.Aborted("Open event was prevented");this.baseLayer.peel(),this.layer=this.buildLayer(),up.layer.stack.push(this.layer),this.layer.createElements(this.content),this.layer.setupHandlers(),this.handleHistory(),this.setMeta({newElement:this.content,source:this.options.source}),t.finalizeElement(this.content),up.hello(this.layer.element,{layer:this.layer,origin:this.origin}),this.handleLayerChangeRequests(),this.handleScroll();let n=new up.RenderResult({layer:this.layer,fragments:[this.content],target:this.target});return n.finished=this.finish(n),this.layer.opening=!1,this.emitOpenedEvent(),this.abortWhenLayerClosed(),n}finish(e){return t(this,void 0,void 0,(function*(){return yield this.layer.startOpenAnimation(),this.abortWhenLayerClosed(),this.handleFocus(),e}))}buildLayer(){const t=Object.assign(Object.assign({},this.options),{opening:!0});return up.layer.build(t,(t=>this.options=up.RenderOptions.finalize(t)))}handleHistory(){"auto"===this.layer.history&&(this.layer.history=up.fragment.hasAutoHistory(this.content)),this.layer.parent.saveHistory(),this.layer.updateHistory(this.options)}handleFocus(){var t;null===(t=this.baseLayer.overlayFocus)||void 0===t||t.moveToBack(),this.layer.overlayFocus.moveToFront(),new up.FragmentFocus({fragment:this.content,layer:this.layer,autoMeans:["autofocus","layer"]}).process(this.options.focus)}handleScroll(){const t=Object.assign(Object.assign({},this.options),{fragment:this.content,layer:this.layer,autoMeans:["hash","layer"]});new up.FragmentScrolling(t).process(this.options.scroll)}emitOpenEvent(){return up.emit("up:layer:open",{origin:this.origin,baseLayer:this.baseLayer,layerOptions:this.options,log:"Opening new overlay"})}emitOpenedEvent(){return this.layer.emit("up:layer:opened",{origin:this.origin,callback:this.layer.callback("onOpened"),log:`Opened new ${this.layer}`})}}},1752:()=>{up.Change.Removal=class extends up.Change{}},9441:function(){var t,e=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,s){function o(t){try{u(r.next(t))}catch(t){s(t)}}function a(t){try{u(r.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}u((r=r.apply(t,e||[])).next())}))};const n=up.util,r=up.element;up.Change.UpdateLayer=(t=class extends up.Change.Addition{constructor(t){super(t=up.RenderOptions.finalize(t)),this.layer=t.layer,this.target=t.target,this.context=t.context,this.useKeep=t.useKeep,this.steps=up.fragment.parseTargetSteps(this.target,this.options)}getPreflightProps(){return this.matchPreflight(),{layer:this.layer,mode:this.layer.mode,context:n.merge(this.layer.context,this.context),origin:this.options.origin,target:this.bestPreflightSelector(),fragments:this.getFragments()}}bestPreflightSelector(){return this.matchPreflight(),n.map(this.steps,"selector").join(", ")||":none"}getFragments(){return this.matchPreflight(),n.map(this.steps,"oldElement")}execute(t,e){this.responseDoc=t,this.matchPostflight(),e(),this.steps.length?up.puts("up.render()",`Updating "${this.bestPreflightSelector()}" in ${this.layer}`):up.puts("up.render()","Nothing was rendered"),this.options.title=this.improveHistoryValue(this.options.title,this.responseDoc.getTitle()),this.setScrollAndFocusOptions(),this.options.saveScroll&&up.viewport.saveScroll({layer:this.layer}),this.options.saveFocus&&up.viewport.saveFocus({layer:this.layer}),this.options.peel&&this.layer.peel(),!1!==this.options.abort&&up.fragment.abort(this.getFragments(),{reason:"Fragment is being replaced"}),Object.assign(this.layer.context,this.context),this.hasHistory()&&this.layer.updateHistory(this.options),this.handleLayerChangeRequests(),this.renderResult=new up.RenderResult({layer:this.layer,target:this.target}),this.steps.reverse();const n=this.steps.map((t=>this.executeStep(t)));return this.renderResult.finished=this.finish(n),this.steps.length||(this.handleFocus(null,this.options),this.handleScroll(null,this.options)),this.renderResult}finish(t){return e(this,void 0,void 0,(function*(){return yield Promise.all(t),this.abortWhenLayerClosed(),this.renderResult}))}addToResult(t){let e=t.matches("up-wrapper")?t.children:[t];this.renderResult.fragments.unshift(...e)}executeStep(t){switch(this.setMeta(t),t.placement){case"swap":if(this.findKeepPlan(t))return this.handleFocus(t.oldElement,t),this.handleScroll(t.oldElement,t),Promise.resolve();{this.preserveKeepables(t);const e=t.oldElement.parentNode,n=Object.assign(Object.assign({},t),{beforeStart(){up.fragment.markAsDestroying(t.oldElement)},afterInsert:()=>{this.responseDoc.finalizeElement(t.newElement),this.restoreKeepables(t),up.hello(t.newElement,t),this.addToResult(t.newElement)},beforeDetach:()=>{up.syntax.clean(t.oldElement,{layer:this.layer})},afterDetach(){up.element.cleanJQuery(),up.fragment.emitDestroyed(t.oldElement,{parent:e,log:!1})},scrollNew:()=>{this.handleFocus(t.newElement,t),this.handleScroll(t.newElement,t)}});return up.morph(t.oldElement,t.newElement,t.transition,n)}case"content":{let e=r.wrapChildren(t.oldElement),n=r.wrapChildren(t.newElement),i=Object.assign(Object.assign({},t),{placement:"swap",oldElement:e,newElement:n,focus:!1});return this.executeStep(i).then((()=>{r.unwrap(n),this.handleFocus(t.oldElement,t)}))}case"before":case"after":{let e=r.wrapChildren(t.newElement),n="before"===t.placement?"afterbegin":"beforeend";return t.oldElement.insertAdjacentElement(n,e),this.responseDoc.finalizeElement(e),up.hello(e,t),this.addToResult(e),this.handleFocus(e,t),this.handleScroll(e,t),up.animate(e,t.transition,t).then((()=>r.unwrap(e)))}default:up.fail("Unknown placement: %o",t.placement)}}findKeepPlan(t){if(!this.useKeep)return;const{oldElement:e,newElement:n}=t;let i;if(!r.booleanAttr(e,"up-keep"))return;let s=up.fragment.toTarget(e);const o={layer:this.layer};if(i=t.descendantsOnly?up.fragment.get(n,s,o):up.fragment.subtree(n,s,o)[0],i&&r.booleanAttr(i,"up-keep")){const t={oldElement:e,newElement:i,newData:up.syntax.data(i)};if(!up.fragment.emitKeep(t).defaultPrevented)return t}}preserveKeepables(t){const e=[];if(this.useKeep)for(let n of t.oldElement.querySelectorAll("[up-keep]")){let r=this.findKeepPlan(Object.assign(Object.assign({},t),{oldElement:n,descendantsOnly:!0}));if(r){const t=n.cloneNode(!0);n.insertAdjacentElement("beforebegin",t);let i=up.viewport.subtree(r.oldElement);r.revivers=i.map((function(t){let e=up.viewport.copyCursorProps(t);return()=>up.viewport.copyCursorProps(e,t)})),document.body.append(n),e.push(r)}}t.keepPlans=e}restoreKeepables(t){for(let e of t.keepPlans){e.newElement.replaceWith(e.oldElement);for(let t of e.revivers)t()}}matchPreflight(){this.filterSteps((t=>{const e=new up.FragmentFinder(t);if(t.oldElement||(t.oldElement=e.find()),t.oldElement)return!0;if(!t.maybe)throw this.cannotMatch(`Could not find element "${this.target}" in current page`)})),this.resolveOldNesting()}matchPostflight(){this.matchPreflight(),this.options.useHungry&&this.addHungrySteps(),this.filterSteps((t=>{if(t.newElement=this.responseDoc.select(t.selector),t.newElement)return!0;if(!t.maybe)throw this.cannotMatch(`Could not find element "${this.target}" in server response`)})),this.resolveOldNesting()}filterSteps(t){this.steps=n.filter(this.steps,t)}addHungrySteps(){const t=up.radio.hungrySolutions({layer:this.layer,history:this.hasHistory(),origin:this.options.origin});for(let{element:e,target:n}of t){const t={selector:n,oldElement:e,transition:r.booleanOrStringAttr(e,"transition"),placement:"swap",maybe:!0};this.steps.push(t)}}containedByRivalStep(t,e){return n.some(t,(function(t){return t!==e&&("swap"===t.placement||"content"===t.placement)&&t.oldElement.contains(e.oldElement)}))}resolveOldNesting(){let t=n.uniqBy(this.steps,"oldElement");t=n.reject(t,(e=>this.containedByRivalStep(t,e))),this.steps=t}setScrollAndFocusOptions(){this.steps.forEach(((t,e)=>{e>0&&(t.scroll=!1,t.focus=!1),"swap"!==t.placement&&"content"!==t.placement||(t.scrollBehavior="instant")})),this.focusCapsule=up.FocusCapsule.preserve(this.layer)}handleFocus(t,e){return new up.FragmentFocus(Object.assign(Object.assign({},e),{fragment:t,layer:this.layer,focusCapsule:this.focusCapsule,autoMeans:up.fragment.config.autoFocus})).process(e.focus)}handleScroll(t,e){return new up.FragmentScrolling(Object.assign(Object.assign({},e),{fragment:t,layer:this.layer,autoMeans:up.fragment.config.autoScroll})).process(e.scroll)}hasHistory(){return n.evalAutoOption(this.options.history,this.hasAutoHistory.bind(this))}hasAutoHistory(){const t=n.map(this.steps,"oldElement");return n.some(t,up.fragment.hasAutoHistory)}},n.memoizeMethod(t.prototype,["matchPreflight","matchPostflight","hasHistory"]),t)},1569:()=>{const t=up.util;up.CompilerPass=class{constructor(t,e,{layer:n,data:r,dataMap:i}={}){this.root=t,this.compilers=e,this.layer=n||up.layer.get(this.root)||up.layer.current,this.data=r,this.dataMap=i,this.errors=[]}run(){if(this.layer.asCurrent((()=>{this.setCompileData();for(let t of this.compilers)this.runCompiler(t)})),this.errors.length)throw new up.CannotCompile("Errors while compiling",{errors:this.errors})}setCompileData(){if(this.data&&(this.root.upCompileData=this.data),this.dataMap)for(let t in this.dataMap)for(let e of this.select(t))e.upCompileData=this.dataMap[t]}runCompiler(t){var e,n;const r=this.selectOnce(t);if(r.length){if(t.isDefault||up.puts("up.hello()",'Compiling %d× "%s" on %s',r.length,t.selector,this.layer),t.batch)this.compileBatch(t,r);else for(let e of r)this.compileOneElement(t,e);return null===(n=(e=up.migrate).postCompile)||void 0===n?void 0:n.call(e,r,t)}}compileOneElement(t,e){const n=[t.jQuery?up.browser.jQuery(e):e];if(1!==t.length){const t=up.syntax.data(e);n.push(t)}const r=this.applyCompilerFunction(t,e,n);let i=this.destructorPresence(r);i&&up.destructor(e,i)}compileBatch(e,n){const r=[e.jQuery?up.browser.jQuery(n):n];if(1!==e.length){const e=t.map(n,up.syntax.data);r.push(e)}const i=this.applyCompilerFunction(e,n,r);this.destructorPresence(i)&&up.fail("Compilers with { batch: true } cannot return destructors")}applyCompilerFunction(t,e,n){try{return t.apply(e,n)}catch(t){this.errors.push(t),up.log.error("up.hello()","While compiling %o: %o",e,t),up.error.emitGlobal(t)}}destructorPresence(e){if(t.isFunction(e)||t.isArray(e)&&t.every(e,t.isFunction))return e}select(e){return up.fragment.subtree(this.root,t.evalOption(e),{layer:this.layer})}selectOnce(e){let n=this.select(e.selector);return t.filter(n,(t=>{let n=t.upAppliedCompilers||(t.upAppliedCompilers=new Set);if(!n.has(e))return n.add(e),!0}))}}},3742:()=>{up.Config=class{constructor(t=(()=>({}))){this.blueprintFn=t,this.reset()}reset(){Object.assign(this,this.blueprintFn())}}},2737:()=>{const t=up.util,e=up.element;up.CSSTransition=class{constructor(e,n,r){this.element=e,this.lastFrameKebab=n,this.lastFrameKeysKebab=Object.keys(this.lastFrameKebab),t.some(this.lastFrameKeysKebab,(t=>t.match(/A-Z/)))&&up.fail("Animation keys must be kebab-case"),this.finishEvent=r.finishEvent,this.duration=r.duration,this.easing=r.easing,this.finished=!1}start(){return 0===this.lastFrameKeysKebab.length?(this.finished=!0,Promise.resolve()):(this.deferred=t.newDeferred(),this.pauseOldTransition(),this.startTime=new Date,this.startFallbackTimer(),this.listenToFinishEvent(),this.listenToTransitionEnd(),this.startMotion(),this.deferred)}listenToFinishEvent(){this.finishEvent&&(this.stopListenToFinishEvent=up.on(this.element,this.finishEvent,this.onFinishEvent.bind(this)))}onFinishEvent(t){t.stopPropagation(),this.finish()}startFallbackTimer(){this.fallbackTimer=t.timer(this.duration+100,(()=>{this.finish()}))}stopFallbackTimer(){clearTimeout(this.fallbackTimer)}listenToTransitionEnd(){this.stopListenToTransitionEnd=up.on(this.element,"transitionend",this.onTransitionEnd.bind(this))}onTransitionEnd(e){if(e.target!==this.element)return;if(new Date-this.startTime<=.25*this.duration)return;const n=e.propertyName;t.contains(this.lastFrameKeysKebab,n)&&this.finish()}finish(){var t,n;this.finished||(this.finished=!0,this.stopFallbackTimer(),null===(t=this.stopListenToFinishEvent)||void 0===t||t.call(this),null===(n=this.stopListenToTransitionEnd)||void 0===n||n.call(this),e.concludeCSSTransition(this.element),this.resumeOldTransition(),this.deferred.resolve())}pauseOldTransition(){const t=e.style(this.element,["transitionProperty","transitionDuration","transitionDelay","transitionTimingFunction"]);if(e.hasCSSTransition(t)){if("all"!==t.transitionProperty){const n=t.transitionProperty.split(/\s*,\s*/),r=e.style(this.element,n);this.setOldTransitionTargetFrame=e.setTemporaryStyle(this.element,r)}this.setOldTransition=e.concludeCSSTransition(this.element)}}resumeOldTransition(){var t,e;null===(t=this.setOldTransitionTargetFrame)||void 0===t||t.call(this),null===(e=this.setOldTransition)||void 0===e||e.call(this)}startMotion(){e.setStyle(this.element,{transitionProperty:Object.keys(this.lastFrameKebab).join(", "),transitionDuration:`${this.duration}ms`,transitionTimingFunction:this.easing}),e.setStyle(this.element,this.lastFrameKebab)}}},3635:()=>{const t=up.util;up.DestructorPass=class{constructor(t,e){this.fragment=t,this.options=e,this.errors=[]}run(){for(let e of this.selectCleanables()){let n=t.pluckKey(e,"upDestructors");if(n)for(let t of n)this.applyDestructorFunction(t,e);e.classList.remove("up-can-clean")}if(this.errors.length)throw new up.Error("Errors while destroying",{errors:this.errors})}selectCleanables(){const t=Object.assign(Object.assign({},this.options),{destroying:!0});return up.fragment.subtree(this.fragment,".up-can-clean",t)}applyDestructorFunction(t,e){try{t()}catch(t){this.errors.push(t),up.log.error("up.destroy()","While destroying %o: %o",e,t),up.error.emitGlobal(t)}}}},1906:()=>{const t=up.util,e=up.element;up.EventEmitter=class extends up.Record{keys(){return["target","event","baseLayer","callback","log","ensureBubbles"]}emit(){return this.logEmission(),this.baseLayer?this.baseLayer.asCurrent((()=>this.dispatchEvent())):this.dispatchEvent(),this.event}dispatchEvent(){var t;this.target.dispatchEvent(this.event),this.ensureBubbles&&!this.target.isConnected&&document.dispatchEvent(this.event),null===(t=this.callback)||void 0===t||t.call(this,this.event)}assertEmitted(){const t=this.emit();if(t.defaultPrevented)throw new up.Aborted(`Event ${t.type} was prevented`)}logEmission(){if(!up.log.config.enabled)return;let e,n=this.log;t.isArray(n)?[n,...e]=n:e=[];const{type:r}=this.event;t.isString(n)?up.puts(r,n,...e):!1!==n&&up.puts(r,`Event ${r}`)}static fromEmitArgs(n,r={}){var i,s;let o,a=t.extractOptions(n);return a=t.merge(r,a),t.isElementish(n[0])?a.target=e.get(n.shift()):n[0]instanceof up.Layer&&(a.layer=n.shift()),t.isGiven(a.layer)&&(o=up.layer.get(a.layer),a.target||(a.target=o.element),a.baseLayer||(a.baseLayer=o)),a.baseLayer&&(a.baseLayer=up.layer.get(a.baseLayer)),t.isString(a.target)?a.target=up.fragment.get(a.target,{layer:a.layer}):a.target||(a.target=document),(null===(i=n[0])||void 0===i?void 0:i.preventDefault)?(a.event=n[0],null!==(s=a.log)&&void 0!==s||(a.log=n[0].log)):t.isString(n[0])?a.event=up.event.build(n[0],a):a.event=up.event.build(a),new this(a)}}},4158:()=>{const t=up.util;up.EventListener=class extends up.Record{keys(){return["element","eventType","selector","callback","jQuery","guard","baseLayer","passive","once","beforeBoot"]}constructor(t){var e;super(t),this.key=this.constructor.buildKey(t),this.isDefault=up.framework.evaling,null!==(e=this.beforeBoot)&&void 0!==e||(this.beforeBoot=0===this.eventType.indexOf("up:framework:")),this.nativeCallback=this.nativeCallback.bind(this)}bind(){var t;const e=(t=this.element).upEventListeners||(t.upEventListeners={});e[this.key]&&up.fail("up.on(): The %o callback %o cannot be registered more than once",this.eventType,this.callback),e[this.key]=this,this.element.addEventListener(...this.addListenerArgs())}addListenerArgs(){let e=t.compactObject(t.pick(this,["once","passive"]));return[this.eventType,this.nativeCallback,e]}unbind(){let t=this.element.upEventListeners;t&&delete t[this.key],this.element.removeEventListener(...this.addListenerArgs())}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,this.jQuery?up.browser.jQuery(n):n],r=this.callback.length;if(1!==r&&2!==r){const e=up.syntax.data(n);t.push(e)}const i=this.callback.bind(n,...t);this.baseLayer?this.baseLayer.asCurrent(i):i()}}static fromElement(t){let e=t.element.upEventListeners;if(e)return e[this.buildKey(t)]}static buildKey(e){var n;return(n=e.callback).upUid||(n.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 extends up.Record{keys(){return["elements","eventTypes","selector","callback","jQuery","guard","baseLayer","passive","once","beforeBoot"]}bind(){const e=[];return this.eachListenerAttributes((function(t){const n=new up.EventListener(t);return n.bind(),e.push(n.unbind.bind(n))})),t.sequence(e)}eachListenerAttributes(t){for(let e of this.elements)for(let n of this.eventTypes)t(this.listenerAttributes(e,n))}listenerAttributes(t,e){return Object.assign(Object.assign({},this.attributes()),{element:t,eventType:e})}unbind(){this.eachListenerAttributes((function(t){let e=up.EventListener.fromElement(t);e&&e.unbind()}))}static fromBindArgs(e,n){const r=(e=t.copy(e)).pop();let i;i=e[0].addEventListener?[e.shift()]:t.isJQuery(e[0])||t.isList(e[0])&&e[0][0].addEventListener?e.shift():[document];let s=t.parseTokens(e.shift()),o=up.migrate.fixEventTypes;o&&(s=o(s));const a=t.extractOptions(e),u=e[0];return new this(Object.assign(Object.assign({elements:i,eventTypes:s,selector:u,callback:r},a),n))}}},2214:function(){var t=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,s){function o(t){try{u(r.next(t))}catch(t){s(t)}}function a(t){try{u(r.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}u((r=r.apply(t,e||[])).next())}))};const e=up.util;up.FieldWatcher=class{constructor(t,e,n,r){this.callback=r,this.form=t,this.fields=e,this.options=n,this.batch=n.batch,this.unbindFns=[]}fieldOptions(t){let n=e.copy(this.options);return up.form.watchOptions(t,n,{defaults:{event:"input"}})}start(){this.scheduledValues=null,this.processedValues=this.readFieldValues(),this.currentTimer=null,this.callbackRunning=!1;for(let t of this.fields)this.watchField(t)}watchField(t){let e=this.fieldOptions(t);this.unbindFns.push(up.on(t,e.event,(t=>this.check(t,e)))),this.unbindFns.push(up.fragment.onAborted(t,(()=>this.cancelTimer())))}stop(){for(let t of this.unbindFns)t();this.cancelTimer()}cancelTimer(){clearTimeout(this.currentTimer),this.currentTimer=null}isAnyFieldAttached(){return e.some(this.fields,"isConnected")}scheduleValues(t,n,r){this.cancelTimer(),this.scheduledValues=t;let i=e.evalOption(r.delay,n);this.currentTimer=e.timer(i,(()=>{this.currentTimer=null,this.isAnyFieldAttached()?(this.scheduledFieldOptions=r,this.requestCallback()):this.scheduledValues=null}))}isNewValues(t){return!e.isEqual(t,this.processedValues)&&!e.isEqual(this.scheduledValues,t)}requestCallback(){return t(this,void 0,void 0,(function*(){let t=this.scheduledFieldOptions;if(null!==this.scheduledValues&&!this.currentTimer&&!this.callbackRunning){const n=this.changedValues(this.processedValues,this.scheduledValues);this.processedValues=this.scheduledValues,this.scheduledValues=null,this.callbackRunning=!0,this.scheduledFieldOptions=null;let r=Object.assign(Object.assign({},t),{disable:!1});const i=[];if(this.batch)i.push(this.callback(n,r));else for(let t in n){const e=n[t];i.push(this.callback(e,t,r))}if(e.some(i,e.isPromise)){let e=Promise.allSettled(i);up.form.disableWhile(e,t),yield e}this.callbackRunning=!1,this.requestCallback()}}))}changedValues(t,n){const r={};let i=Object.keys(t);i=i.concat(Object.keys(n)),i=e.uniq(i);for(let s of i){const i=t[s],o=n[s];e.isEqual(i,o)||(r[s]=o)}return r}readFieldValues(){return up.Params.fromFields(this.fields).toObject()}check(t,e){const n=this.readFieldValues();this.isNewValues(n)&&this.scheduleValues(n,t,e)}}},665:()=>{up.FocusCapsule=class{constructor(t,e){this.target=t,this.cursorProps=e}restore(t,e){let n=up.fragment.get(this.target,{layer:t});if(n)return up.viewport.copyCursorProps(this.cursorProps,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(n,up.viewport.copyCursorProps(e)):void 0}}},5240:function(){var t=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,s){function o(t){try{u(r.next(t))}catch(t){s(t)}}function a(t){try{u(r.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}u((r=r.apply(t,e||[])).next())}))},e=this&&this.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const n=up.util;up.FormValidator=class{constructor(t){this.form=t,this.dirtySolutions=[],this.nextRenderTimer=null,this.rendering=!1,this.resetNextRenderPromise(),this.honorAbort()}honorAbort(){up.fragment.onAborted(this.form,(({target:t})=>{this.dirtySolutions=n.reject(this.dirtySolutions,(({element:e})=>t.contains(e)))}))}resetNextRenderPromise(){this.nextRenderPromise=n.newDeferred()}watchContainer(t){let{event:e}=this.originOptions(t);up.on(t,e,(()=>up.error.muteUncriticalRejection(this.validate({origin:t}))))}validate(t={}){let e=this.getSolutions(t);return this.dirtySolutions.push(...e),this.scheduleNextRender(),this.nextRenderPromise}getSolutions(t){let e=this.getTargetSelectorSolutions(t)||this.getFieldSolutions(t)||this.getElementSolutions(t.origin);for(let n of e)n.renderOptions=this.originOptions(n.origin,t),n.target=up.fragment.resolveOrigin(n.target,n);return e}getFieldSolutions(t){var{origin:n}=t,r=e(t,["origin"]);if(up.form.isField(n))return this.getValidateAttrSolutions(n)||this.getFormGroupSolutions(n,r)}getFormGroupSolutions(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}getTargetSelectorSolutions({target:t,origin:e}){if(n.isString(t)&&t)return up.puts("up.validate()",'Validating target "%s"',t),up.fragment.splitTarget(t).map((function(t){return{element:up.fragment.get(t,{origin:e}),target:t,origin:e}}))}getElementSolutions(t){return up.puts("up.validate()","Validating element %o",t),[{element:t,target:up.fragment.toTarget(t),origin:t}]}getValidateAttrSolutions(t){let e=t.closest("[up-validate]");if(e){let n=e.getAttribute("up-validate");return this.getTargetSelectorSolutions({target:n,origin:t})}}originOptions(t,e){return up.form.watchOptions(t,e,{defaults:{event:"change"}})}scheduleNextRender(){let t=this.dirtySolutions.map((t=>t.renderOptions.delay)),e=Math.min(...t)||0;this.unscheduleNextRender(),this.nextRenderTimer=n.timer(e,(()=>this.renderDirtySolutions()))}unscheduleNextRender(){clearTimeout(this.nextRenderTimer)}renderDirtySolutions(){up.error.muteUncriticalRejection(this.doRenderDirtySolutions())}doRenderDirtySolutions(){var e;return t(this,void 0,void 0,(function*(){if(this.dirtySolutions=n.filter(this.dirtySolutions,(({element:t,origin:e})=>t.isConnected&&e.isConnected)),!this.dirtySolutions.length||this.rendering)return;let t=this.dirtySolutions;this.dirtySolutions=[];let r=n.map(t,"origin"),i=n.flatMap(r,up.form.fields),s=n.uniq(n.map(i,"name")),o=this.buildDataMap(t),a=n.map(t,"renderOptions"),u=n.mergeDefined(...a,{dataMap:o},up.form.destinationOptions(this.form));u.target=n.map(t,"target").join(", "),u.feedback=n.some(a,"feedback"),u.origin=this.form,null!==(e=u.focus)&&void 0!==e||(u.focus="keep"),u.failOptions=!1,u.params=up.Params.merge(u.params,...n.map(a,"params")),u.headers=n.merge(...n.map(a,"headers")),u.headers[up.protocol.headerize("validate")]=s.join(" ")||":unknown",u.guardEvent=up.event.build("up:form:validate",{fields:i,log:"Validating form",params:u.params}),this.rendering=!0;let l=this.nextRenderPromise;this.resetNextRenderPromise(),u.disable=!1;for(let e of t)up.form.disableWhile(l,{disable:e.renderOptions.disable,origin:e.origin});try{l.resolve(up.render(u)),yield l}finally{this.rendering=!1,this.renderDirtySolutions()}}))}buildDataMap(t){let e={};for(let r of t){let t=n.pluckKey(r.renderOptions,"data");n.pluckKey(r.renderOptions,"keepData")&&(t=up.data(r.element)),t&&(e[r.target]=t)}return e}static forElement(t){let e=up.form.get(t);return e.upFormValidator||(e.upFormValidator=new this(e))}}},2587:()=>{const t=/^([^ >+(]+) (.+)$/;up.FragmentFinder=class{constructor(t){this.options=t,this.origin=t.origin,this.selector=t.selector,this.externalRoot=t.externalRoot}find(){return this.findAroundOrigin()||this.findInLayer()}findAroundOrigin(){if(this.origin&&up.fragment.config.matchAroundOrigin&&this.origin.isConnected)return this.findClosest()||this.findInVicinity()}findClosest(){return up.fragment.closest(this.origin,this.selector,this.options)}findInVicinity(){let e=this.selector.match(t);if(e){let t=up.fragment.closest(this.origin,e[1],this.options);if(t)return up.fragment.getDumb(t,e[2])}}findInLayer(){return this.externalRoot?up.fragment.subtree(this.externalRoot,this.selector,this.options)[0]:up.fragment.getDumb(this.selector,this.options)}}},7031:()=>{const t=up.util,e=up.element,n={preventScroll:!0};up.FragmentFocus=class extends up.FragmentProcessor{keys(){return super.keys().concat(["hash","focusCapsule"])}processPrimitive(e){switch(e){case"keep":return this.restoreLostFocus();case"restore":return this.restorePreviousFocusForLocation();case"target":case!0:return this.focusElement(this.fragment);case"layer":return this.focusElement(this.layer.getFocusElement());case"main":return this.focusSelector(":main");case"hash":return this.focusHash();case"autofocus":return this.autofocus();default:if(t.isString(e))return this.focusSelector(e)}}processElement(t){return this.focusElement(t)}resolveCondition(t){return"lost"===t?this.wasFocusLost():super.resolveCondition(t)}focusSelector(t){let e=this.findSelector(t);return this.focusElement(e)}restoreLostFocus(){var t;if(this.wasFocusLost())return null===(t=this.focusCapsule)||void 0===t?void 0:t.restore(this.layer,n)}restorePreviousFocusForLocation(){return up.viewport.restoreFocus({layer:this.layer})}autofocus(){let t=this.fragment&&e.subtree(this.fragment,"[autofocus]")[0];if(t)return this.focusElement(t)}focusElement(t){if(t)return up.focus(t,Object.assign({force:!0},n)),!0}focusHash(){let t=up.viewport.firstHashTarget(this.hash,{layer:this.layer});if(t)return this.focusElement(t)}wasFocusLost(){return!this.layer.hasFocus()}}},8057:()=>{const t=up.element;up.FragmentPolling=class{constructor(t){this.options={},this.state="initialized",this.setFragment(t),this.abortable=!0}static forFragment(t){return t.upPolling||(t.upPolling=new this(t))}onPollAttributeObserved(){this.start()}onFragmentDestroyed(){this.stop()}onFragmentAborted(){this.abortable&&this.stop()}start(){"started"!==this.state&&(this.state="started",this.scheduleReload())}stop(){"started"===this.state&&(clearTimeout(this.reloadTimer),this.state="stopped")}forceStart(t){Object.assign(this.options,t),this.forceStarted=!0,this.start()}forceStop(){this.stop(),this.forceStarted=!1}scheduleReload(t=this.getInterval()){this.reloadTimer=setTimeout((()=>this.reload()),t)}reload(){if("started"!==this.state)return;let t=up.radio.pollIssue(this.fragment);if(t){up.puts("[up-poll]",`Will not poll: ${t}`);let e=Math.min(1e4,this.getInterval());this.scheduleReload(e)}else this.reloadNow()}reloadNow(){let t={url:this.options.url,fail:!1,background:!0},e=this.abortable;this.abortable=!1,up.reload(this.fragment,t).then(this.onReloadSuccess.bind(this),this.onReloadFailure.bind(this)),this.abortable=e}onReloadSuccess({fragment:t}){t?this.onFragmentSwapped(t):this.scheduleReload()}onReloadFailure(t){if(this.scheduleReload(),up.error.isCritical(t))throw t}onFragmentSwapped(t){this.stop(),this.forceStarted&&up.fragment.matches(this.fragment,t)&&this.constructor.forFragment(t).forceStart(this.options)}setFragment(t){this.fragment=t,up.destructor(t,(()=>this.onFragmentDestroyed())),up.fragment.onAborted(t,(()=>this.onFragmentAborted()))}getInterval(){var e,n;let r=null!==(n=null!==(e=this.options.interval)&&void 0!==e?e:t.numberAttr(this.fragment,"up-interval"))&&void 0!==n?n:up.radio.config.pollInterval;return up.radio.config.stretchPollInterval(r)}}},2828:()=>{const t=up.util;up.FragmentProcessor=class extends up.Record{keys(){return["fragment","autoMeans","origin","layer"]}process(t){let e=this.preprocess(t);return this.tryProcess(e)}preprocess(e){return t.parseTokens(e,{separator:"or"})}tryProcess(e){if(t.isArray(e))return this.processArray(e);if(t.isFunction(e))return this.tryProcess(e(this.fragment,this.attributes()));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 extends up.FragmentProcessor{keys(){return super.keys().concat(["hash","mode","revealTop","revealMax","revealSnap","scrollBehavior"])}processPrimitive(e){switch(e){case"reset":return this.reset();case"layer":return this.revealLayer();case"main":return this.revealSelector(":main");case"restore":return this.restore();case"hash":return this.hash&&up.viewport.revealHash(this.hash,this.attributes());case"target":case"reveal":case!0:return this.revealElement(this.fragment);default:if(t.isString(e))return this.revealSelector(e)}}processElement(t){return this.revealElement(t)}revealElement(t){if(t)return up.reveal(t,this.attributes()),!0}revealSelector(t){let e=this.findSelector(t);return this.revealElement(e)}revealLayer(){return this.revealElement(this.layer.getBoxElement())}reset(){return up.viewport.resetScroll(Object.assign(Object.assign({},this.attributes()),{around:this.fragment})),!0}restore(){return up.viewport.restoreScroll(Object.assign(Object.assign({},this.attributes()),{around:this.fragment}))}}},6267:()=>{const t=up.util,e=up.element;up.HTMLWrapper=class{constructor(t){this.tagName=t;const e=`<${this.tagName}[^>]*>`,n=`</${this.tagName}>`;this.pattern=new RegExp(e+"(.|\\s)*?"+n,"ig"),this.attrName=`up-wrapped-${this.tagName}`}strip(t){return t.replace(this.pattern,"")}wrap(t){return t.replace(this.pattern,this.wrapMatch.bind(this))}wrapMatch(e){return this.didWrap=!0,'<meta name="'+this.attrName+'" value="'+t.escapeHTML(e)+'">'}unwrap(t){if(this.didWrap)for(let n of t.querySelectorAll(`meta[name='${this.attrName}']`)){const t=n.getAttribute("value"),r=e.createFromHTML(t);n.replaceWith(r)}}}},7956:()=>{const t=up.element,e=up.util;up.Layer=class 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 index(){return 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.buildEventListenerGroup(t).bind()}off(...t){return this.buildEventListenerGroup(t).unbind()}buildEventListenerGroup(t){return up.EventListenerGroup.fromBindArgs(t,{guard:t=>this.containsEventTarget(t),elements:[this.element],baseLayer:this})}containsEventTarget(t){return this.contains(t.target)}wasHitByMouseEvent(t){const e=document.elementFromPoint(t.clientX,t.clientY);return!e||this.contains(e)}buildEventEmitter(t){return up.EventEmitter.fromEmitArgs(t,{layer:this})}emit(...t){return this.buildEventEmitter(t).emit()}isDetached(){return!this.element.isConnected}saveHistory(){this.isHistoryVisible()&&(this.savedTitle=document.title,this.savedLocation=up.history.location)}restoreHistory(){this.showsLiveHistory()&&(this.savedLocation&&up.history.push(this.savedLocation),this.savedTitle&&(document.title=this.savedTitle))}asCurrent(t){return this.stack.asCurrent(this,t)}updateHistory(t){e.isString(t.title)&&(this.title=t.title),e.isString(t.location)&&(this.location=t.location)}isHistoryVisible(){return this.history&&(this.isRoot()||this.parent.isHistoryVisible())}showsLiveHistory(){return this.isHistoryVisible()&&this.isFront()&&(up.history.config.enabled||this.isRoot())}get title(){return this.showsLiveHistory()?document.title:this.savedTitle}set title(t){this.savedTitle=t,this.showsLiveHistory()&&(document.title=t)}get location(){return this.showsLiveHistory()?up.history.location:this.savedLocation}set location(t){this.location!==(t=up.history.normalizeURL(t))&&(this.savedLocation=t,this.emit("up:layer:location:changed",{location:t,log:!1}),this.showsLiveHistory()&&up.history.push(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)}}},7101:()=>{var t;up.Layer.Cover=((t=class extends up.Layer.OverlayWithViewport{}).mode="cover",t)},5580:()=>{var t;up.Layer.Drawer=((t=class extends up.Layer.OverlayWithViewport{}).mode="drawer",t)},86:()=>{var t;up.Layer.Modal=((t=class extends up.Layer.OverlayWithViewport{}).mode="modal",t)},7403:()=>{const t=up.element,e=up.util;up.Layer.Overlay=class extends up.Layer{keys(){return super.keys().concat(["position","align","size","origin","class","backdrop","openAnimation","closeAnimation","openDuration","closeDuration","openEasing","closeEasing","backdropOpenAnimation","backdropCloseAnimation","dismissable","dismissLabel","dismissAriaLabel","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=e.parseTokens(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.nesting=this.suggestVisualNesting());const n=e.compactObject(e.pick(this,["align","position","size","class","nesting"]));this.element=this.affixPart(t,null,n)}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,e){this.contentElement=this.affixPart(t,"content"),this.contentElement.appendChild(e)}createDismissElement(e){return this.dismissElement=this.affixPart(e,"dismiss",{"up-dismiss":'":button"',"aria-label":this.dismissAriaLabel}),t.affix(this.dismissElement,'span[aria-hidden="true"]',{text:this.dismissLabel})}affixPart(e,n,r={}){return t.affix(e,this.selector(n),r)}static selector(t){return e.compact(["up",this.mode,t]).join("-")}suggestVisualNesting(){const{parent:t}=this;return this.mode===t.mode?1+t.suggestVisualNesting():0}setupHandlers(){var t,e;super.setupHandlers(),this.overlayFocus=new up.OverlayFocus(this),this.supportsDismissMethod("button")&&this.createDismissElement(this.getBoxElement()),this.supportsDismissMethod("outside")&&(this.viewportElement?up.on(this.viewportElement,"up:click",(t=>{t.target===this.viewportElement&&this.onOutsideClicked(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.onOutsideClicked(t,n)}}))),this.supportsDismissMethod("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)})),null===(e=(t=up.migrate).registerLayerCloser)||void 0===e||e.call(t,this),this.registerEventCloser(this.acceptEvent,this.accept),this.registerEventCloser(this.dismissEvent,this.dismiss),this.on("up:click","label[for]",((t,e)=>this.onLabelClicked(t,e)))}onLabelClicked(e,n){let r=n.getAttribute("for"),i=up.form.fieldSelector(t.idSelector(r)),s=up.fragment.all(i,{layer:"any"}),o=up.fragment.all(i,{layer:this});if(s.length>1&&o[0]!==s[0]){e.preventDefault();const t=o[0];t.focus(),t.matches("input[type=checkbox], input[type=radio]")&&t.click()}}onOutsideClicked(t,e){up.log.putsEvent(t),e&&up.event.halt(t),this.dismiss(":outside",{origin:t.target})}onEscapePressed(t){if(this.isFront()){let e=up.form.focusedField();e?e.blur():this.supportsDismissMethod("key")&&(up.event.halt(t,{log:!0}),this.dismiss(":key"))}}registerClickCloser(e,n){let r=`[${e}]`;this.on("up:click",r,(function(i){up.event.halt(i,{log:!0});const s=i.target.closest(r),o=t.jsonAttr(s,e),a={origin:s},u=new up.OptionsParser(s,a);u.booleanOrString("animation"),u.string("easing"),u.number("duration"),u.string("confirm"),n(o,a)}))}registerEventCloser(t,e){if(t)return this.on(t,(t=>{t.preventDefault(),e.call(this,t)}))}tryAcceptForLocation(){this.tryCloseForLocation(this.acceptLocation,this.accept)}tryDismissForLocation(){this.tryCloseForLocation(this.dismissLocation,this.dismiss)}tryCloseForLocation(t,e){let n,r;if(t&&(n=this.location)&&(r=t.recognize(n))){const t=Object.assign(Object.assign({},r),{location:n});e.call(this,t)}}teardownHandlers(){var t,e;super.teardownHandlers(),null===(t=this.unbindParentClicked)||void 0===t||t.call(this),null===(e=this.unbindEscapePressed)||void 0===e||e.call(this),this.overlayFocus.teardown()}destroyElements(t){const e=Object.assign(Object.assign({},t),{animation:()=>this.startCloseAnimation(t),onFinished:()=>{var e;this.onElementsRemoved(),null===(e=t.onFinished)||void 0===e||e.call(t)},log:!1});up.destroy(this.element,e)}onElementsRemoved(){}startAnimation(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])}startOpenAnimation(t={}){var e;return this.startAnimation({boxAnimation:null!==(e=t.animation)&&void 0!==e?e:this.evalOption(this.openAnimation),backdropAnimation:"fade-in",easing:t.easing||this.openEasing,duration:t.duration||this.openDuration}).then((()=>this.wasEverVisible=!0))}startCloseAnimation(t={}){var e;const n=this.wasEverVisible&&(null!==(e=t.animation)&&void 0!==e?e:this.evalOption(this.closeAnimation));return this.startAnimation({boxAnimation:n,backdropAnimation:"fade-out",easing:t.easing||this.closeEasing,duration:t.duration||this.closeDuration})}accept(t=null,e={}){return this.executeCloseChange("accept",t,e)}dismiss(t=null,e={}){return this.executeCloseChange("dismiss",t,e)}supportsDismissMethod(t){return e.contains(this.dismissable,t)}executeCloseChange(t,e,n){return n=Object.assign(Object.assign({},n),{verb:t,value:e,layer:this}),new up.Change.CloseLayer(n).execute()}getFirstSwappableElement(){return this.getContentElement().children[0]}toString(){return`${this.mode} overlay`}}},6412:()=>{up.Layer.OverlayWithTether=class extends up.Layer.Overlay{createElements(t){this.origin||up.fail("Missing { origin } option"),this.tether=new up.Tether({anchor:this.origin,align:this.align,position:this.position}),this.createElement(this.tether.parent),this.createContentElement(this.element,t),this.tether.start(this.element)}onElementsRemoved(){this.tether.stop()}sync(){this.isOpen()&&(this.isDetached()||this.tether.isDetached()?this.dismiss(":detached",{animation:!1,preventable:!1}):this.tether.sync())}}},7965:()=>{var t;up.Layer.OverlayWithViewport=((t=class extends up.Layer.Overlay{static getParentElement(){return document.body}createElements(t){this.shiftBody(),this.createElement(this.constructor.getParentElement()),this.backdrop&&this.createBackdropElement(this.element),this.createViewportElement(this.element),this.createBoxElement(this.viewportElement),this.createContentElement(this.boxElement,t)}onElementsRemoved(){this.unshiftBody()}shiftBody(){this.constructor.bodyShifter.shift()}unshiftBody(){this.constructor.bodyShifter.unshift()}sync(){this.isDetached()&&this.isOpen()&&this.constructor.getParentElement().appendChild(this.element)}}).bodyShifter=new up.BodyShifter,t)},4552:()=>{var t;up.Layer.Popup=((t=class extends up.Layer.OverlayWithTether{}).mode="popup",t)},7771:()=>{var t;const e=up.element;up.Layer.Root=((t=class extends up.Layer{constructor(t){super(t),this.setupHandlers()}get element(){return e.root}getFirstSwappableElement(){return document.body}static selector(){return"html"}setupHandlers(){this.element.upHandlersApplied||(this.element.upHandlersApplied=!0,super.setupHandlers())}sync(){this.setupHandlers()}accept(){this.cannotCloseRoot()}dismiss(){this.cannotCloseRoot()}cannotCloseRoot(){up.fail("Cannot close the root layer")}reset(){Object.assign(this,this.defaults())}toString(){return"root layer"}}).mode="root",t)},6066:()=>{const t=up.util,e=up.element;up.LayerLookup=class{constructor(e,...n){this.stack=e;const r=t.parseArgIntoOptions(n,"layer");if(!1!==r.normalizeLayerOptions&&up.layer.normalizeOptions(r),this.values=t.parseTokens(r.layer),this.origin=r.origin,this.baseLayer=r.baseLayer||this.originLayer()||this.stack.current,t.isString(this.baseLayer)){const t=Object.assign(Object.assign({},r),{baseLayer:this.stack.current,normalizeLayerOptions:!1});this.baseLayer=new this.constructor(this.stack,this.baseLayer,t).first()}}originLayer(){if(this.origin)return this.forElement(this.origin)}first(){return this.all()[0]}all(){let e=t.flatMap(this.values,(t=>this.resolveValue(t)));return e=t.compact(e),e=t.uniq(e),e}forElement(n){return n=e.get(n),t.find(this.stack.reversed(),(t=>t.contains(n)))}forIndex(t){return this.stack[t]}resolveValue(e){if(e instanceof up.Layer)return e;if(t.isNumber(e))return this.forIndex(e);if(/^\d+$/.test(e))return this.forIndex(Number(e));if(t.isElementish(e))return this.forElement(e);switch(e){case"any":return[this.baseLayer,...this.stack.reversed()];case"current":return this.baseLayer;case"closest":return this.stack.selfAndAncestorsOf(this.baseLayer);case"parent":return this.baseLayer.parent;case"ancestor":case"ancestors":return this.baseLayer.ancestors;case"child":return this.baseLayer.child;case"descendant":case"descendants":return this.baseLayer.descendants;case"new":return"new";case"root":return this.stack.root;case"overlay":case"overlays":return t.reverse(this.stack.overlays);case"front":return this.stack.front;case"origin":return this.originLayer();default:return up.fail("Unknown { layer } option: %o",e)}}}},6387:()=>{const t=up.util;up.LayerStack=class extends Array{constructor(){super(),Object.setPrototypeOf(this,up.LayerStack.prototype),this.currentOverrides=[],this.push(this.buildRoot())}buildRoot(){return up.layer.build({mode:"root",stack:this})}remove(e){t.remove(this,e)}peel(e,n){const r=t.reverse(e.descendants),i=Object.assign(Object.assign({},n),{preventable:!1});for(let t of r)t.dismiss(":peel",i)}reset(){this.peel(this.root,{animation:!1}),this.currentOverrides=[],this.root.reset()}isOpen(t){return t.index>=0}isClosed(t){return!this.isOpen(t)}parentOf(t){return this[t.index-1]}childOf(t){return this[t.index+1]}ancestorsOf(e){return t.reverse(this.slice(0,e.index))}selfAndAncestorsOf(t){return[t,...t.ancestors]}descendantsOf(t){return this.slice(t.index+1)}isRoot(t){return this[0]===t}isOverlay(t){return!this.isRoot(t)}isCurrent(t){return this.current===t}isFront(t){return this.front===t}get(...t){return this.getAll(...t)[0]}getAll(...t){return new up.LayerLookup(this,...t).all()}sync(){for(let t of this)t.sync()}asCurrent(t,e){try{return this.currentOverrides.push(t),e()}finally{this.currentOverrides.pop()}}reversed(){return t.reverse(this)}dismissOverlays(e=null,n={}){n.dismissable=!1;for(let r of t.reverse(this.overlays))r.dismiss(e,n)}[t.copy.key](){return t.copyArrayLike(this)}get count(){return this.length}get root(){return this[0]}get overlays(){return this.root.descendants}get current(){return t.last(this.currentOverrides)||this.front}get front(){return t.last(this)}}},5390:()=>{up.LinkFeedbackURLs=class{constructor(t){const e=up.feedback.normalizeURL;if(this.isSafe=up.link.isSafe(t),this.isSafe){const n=t.getAttribute("href");n&&"#"!==n&&(this.href=e(n));const r=t.getAttribute("up-href");r&&(this.upHREF=e(r));const i=t.getAttribute("up-alias");i&&(this.aliasPattern=new up.URLPattern(i,e))}}isCurrent(t){return this.isSafe&&!!(this.href&&this.href===t||this.upHREF&&this.upHREF===t||this.aliasPattern&&this.aliasPattern.test(t,!1))}}},2618:()=>{const t=up.util,e=up.element;up.LinkPreloader=class{constructor(){this.considerPreload=this.considerPreload.bind(this)}watchLink(t){up.link.isSafe(t)&&(this.on(t,"mouseenter",(t=>this.considerPreload(t,!0))),this.on(t,"mousedown touchstart",(t=>this.considerPreload(t))),this.on(t,"mouseleave",(t=>this.stopPreload(t))))}on(t,e,n){up.on(t,e,{passive:!0},n)}considerPreload(t,e){const n=t.target;n!==this.currentLink&&(this.reset(),this.currentLink=n,up.link.shouldFollowEvent(t,n)&&(e?this.preloadAfterDelay(t,n):this.preloadNow(t,n)))}stopPreload(t){if(t.target===this.currentLink)return this.reset()}reset(){var t;this.currentLink&&(clearTimeout(this.timer),(null===(t=this.currentRequest)||void 0===t?void 0:t.background)&&this.currentRequest.abort(),this.currentLink=void 0,this.currentRequest=void 0)}preloadAfterDelay(n,r){var i;const s=null!==(i=e.numberAttr(r,"up-preload-delay"))&&void 0!==i?i:up.link.config.preloadDelay;this.timer=t.timer(s,(()=>this.preloadNow(n,r)))}preloadNow(t,e){e.isConnected?(up.log.putsEvent(t),up.error.muteUncriticalRejection(up.link.preload(e,{onQueued:t=>this.currentRequest=t})),this.queued=!0):this.reset()}}},1653:()=>{let t="up.log.enabled",e=!1;try{e=!!(null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem(t))}catch(t){}up.LogConfig=class extends up.Config{constructor(){super((()=>({banner:!0,format:!0})))}get enabled(){return e}set enabled(n){e=n;try{null===sessionStorage||void 0===sessionStorage||sessionStorage.setItem(t,n?"1":"")}catch(t){}}}},7792:function(){var t=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,s){function o(t){try{u(r.next(t))}catch(t){s(t)}}function a(t){try{u(r.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}u((r=r.apply(t,e||[])).next())}))};const e=up.util,n=up.element;up.MotionController=class{constructor(t){this.activeClass=`up-${t}`,this.selector=`.${this.activeClass}`,this.finishEvent=`up:${t}:finish`,this.finishCount=0,this.clusterCount=0}startFunction(t,e,r={}){var i;t=n.list(t);const s=()=>up.error.muteUncriticalRejection(e());if(r.trackMotion=null!==(i=r.trackMotion)&&void 0!==i?i:up.motion.isEnabled(),!1===r.trackMotion)return s();{r.trackMotion=!1,this.finish(t),this.markCluster(t);let e=this.whileForwardingFinishEvent(t,s);return e=e.then((()=>this.unmarkCluster(t))),e}}finish(t){var e,n;if(this.finishCount++,0!==this.clusterCount&&up.motion.isEnabled()){t=this.expandFinishRequest(t);for(let e of t)this.finishOneElement(e);return null===(n=(e=up.migrate).formerlyAsync)||void 0===n?void 0:n.call(e,"up.motion.finish()")}}expandFinishRequest(t){return t?e.flatMap(t,(t=>n.list(t.closest(this.selector),t.querySelectorAll(this.selector)))):document.querySelectorAll(this.selector)}isActive(t){return t.classList.contains(this.activeClass)}finishOneElement(t){this.emitFinishEvent(t)}emitFinishEvent(t,e={}){return e=Object.assign({target:t,log:!1},e),up.emit(this.finishEvent,e)}markCluster(t){this.clusterCount++,this.toggleActive(t,!0)}unmarkCluster(t){this.clusterCount--,this.toggleActive(t,!1)}toggleActive(t,e){for(let n of t)n.classList.toggle(this.activeClass,e)}whileForwardingFinishEvent(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.emitFinishEvent(n,{forwarded:!0})}));return e().then(n)}reset(){return t(this,void 0,void 0,(function*(){yield this.finish(),this.finishCount=0,this.clusterCount=0}))}}},4308:()=>{const t=up.util,e=up.element;up.NonceableCallback=class{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){if(up.browser.canEval())return new Function(...t,this.script);if(this.nonce){let e=this;return function(...n){return e.runAsNoncedFunction(this,t,n)}}return this.cannotRun.bind(this)}toString(){return`nonce-${this.nonce} ${this.script}`}cannotRun(){throw new Error(`Your Content Security Policy disallows inline JavaScript (${this.script}). See https://unpoly.com/csp for solutions.`)}runAsNoncedFunction(t,e,n){let r,i=`\n try {\n up.noncedEval.value = (function(${e.join(",")}) {\n ${this.script}\n }).apply(up.noncedEval.thisArg, up.noncedEval.args)\n } catch (error) {\n up.noncedEval.error = error\n }\n `;try{if(up.noncedEval={args:n,thisArg:t},r=up.element.affix(document.body,"script",{nonce:this.nonce,text:i}),up.noncedEval.error)throw up.noncedEval.error;return up.noncedEval.value}finally{up.noncedEval=void 0,r&&r.remove()}}allowedBy(e){return this.nonce&&t.contains(e,this.nonce)}static adoptNonces(n,r){if(!(null==r?void 0:r.length))return;const i=t.memoize(up.protocol.cspNonce);t.each(up.protocol.config.nonceableAttributes,(s=>{let o=e.subtree(n,`[${s}^="nonce-"]`);t.each(o,(t=>{let e=t.getAttribute(s),n=this.fromString(e),o=(t,...n)=>up.log.warn("up.render()",`Cannot use callback [${s}="${e}"]: ${t}`,...n);if(!n.allowedBy(r))return o("Callback's CSP nonce (%o) does not match response header (%o)",n.nonce,r);let a=i();if(!a)return o("Current page's CSP nonce is unknown");n.nonce=a,t.setAttribute(s,n.toString())}))}))}}},1104:()=>{const t=up.util,e=up.element;up.OptionsParser=class{constructor(t,e,n={}){this.options=e,this.element=t,this.fail=n.fail,this.closest=n.closest,this.attrPrefix=n.attrPrefix||"up-",this.defaults=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)}json(t,n){this.parse(e.jsonAttr,t,n)}callback(t,n={}){this.parse(((t,r)=>e.callbackAttr(t,r,n)),t,n)}parse(e,n,r={}){var i,s;const o=t.wrapList(null!==(i=r.attr)&&void 0!==i?i:this.attrNameForKey(n));let a=this.options[n];for(let t of o)null!=a||(a=this.parseFromAttr(e,this.element,t));null!=a||(a=null!==(s=r.default)&&void 0!==s?s:this.defaults[n]);let u,l=r.normalize;if(l&&(a=l(a)),t.isDefined(a)&&(this.options[n]=a),this.fail&&(u=up.fragment.failKey(n))){const n=t.compact(t.map(o,(t=>this.deriveFailAttrName(t))));this.parse(e,u,Object.assign(Object.assign({},r),{attr:n}))}}parseFromAttr(t,n,r){return this.closest?e.closestAttr(n,r,t):t(n,r)}deriveFailAttrName(t){return this.deriveFailAttrNameForPrefix(t,this.attrPrefix+"on-")||this.deriveFailAttrNameForPrefix(t,this.attrPrefix)}deriveFailAttrNameForPrefix(t,e){if(t.startsWith(e))return`${e}fail-${t.substring(e.length)}`}attrNameForKey(e){return`${this.attrPrefix}${t.camelToKebabCase(e)}`}}},8665:()=>{const t=up.element,e=up.util;up.OverlayFocus=class{constructor(t){this.layer=t,this.focusElement=this.layer.getFocusElement()}moveToFront(){this.enabled||(this.enabled=!0,this.untrapFocus=up.on("focusin",(t=>this.onFocus(t))),this.unsetAttrs=t.setTemporaryAttrs(this.focusElement,{tabindex:"0",role:"dialog","aria-modal":"true"}),this.focusTrapBefore=t.affix(this.focusElement,"beforebegin","up-focus-trap[tabindex=0]"),this.focusTrapAfter=t.affix(this.focusElement,"afterend","up-focus-trap[tabindex=0]"))}moveToBack(){this.teardown()}teardown(){this.enabled&&(this.enabled=!1,this.untrapFocus(),this.unsetAttrs(),this.focusTrapBefore.remove(),this.focusTrapAfter.remove())}onFocus(t){const{target:e}=t;this.processingFocusEvent||up.layer.isWithinForeignOverlay(e)||(this.processingFocusEvent=!0,e===this.focusTrapBefore?this.focusEnd():e!==this.focusTrapAfter&&this.layer.contains(e)||this.focusStart(),this.processingFocusEvent=!1)}focusStart(t){up.focus(this.focusElement,t)}focusEnd(){this.focusLastDescendant(this.layer.getBoxElement())||this.focusStart()}focusLastDescendant(t){for(let n of e.reverse(t.children))if(up.viewport.tryFocus(n)||this.focusLastDescendant(n))return!0}}},3645:()=>{const t=up.util,e=up.element;up.Params=class{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:r,value:i}=n;t.isBasicObjectProperty(r)||(this.isArrayKey(r)?(e[r]||(e[r]=[]),e[r].push(i)):e[r]=i)}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.arrayEntryToQuery.bind(this));return e=t.compact(e),e.join("&")}arrayEntryToQuery(e){const{value:n}=e;if(this.isBinaryValue(n))return;let r=encodeURIComponent(e.name);return t.isGiven(n)&&(r+="=",r+=encodeURIComponent(n)),r}isBinaryValue(t){return t instanceof Blob}hasBinaryValues(){const e=t.map(this.entries,"value");return t.some(e,this.isBinaryValue)}toURL(e){let n=[e,this.toQuery()];n=t.filter(n,t.isPresent);const r=t.contains(e,"?")?"&":"?";return n.join(r)}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.addAllFromQuery(e):t.isFormData(e)?this.addAllFromFormData(e):t.isObject(e)?this.addAllFromObject(e):up.fail("Unsupport params type: %o",e))}addAllFromObject(e){for(let n in e){const r=e[n],i=t.isArray(r)?r:[r];for(let t of i)this.add(n,t)}}addAllFromQuery(e){for(let n of e.split("&"))if(n){let[e,r]=n.split("=");e=decodeURIComponent(e),r=t.isGiven(r)?decodeURIComponent(r):null,this.add(e,r)}}addAllFromFormData(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.matchEntryFn(e))}matchEntryFn(t){return e=>e.name===t}get(t){return this.isArrayKey(t)?this.getAll(t):this.getFirst(t)}getFirst(e){const n=t.find(this.entries,this.matchEntryFn(e));return null==n?void 0:n.value}getAll(e){if(this.isArrayKey(e))return this.getAll(e);{const n=t.map(this.entries,this.matchEntryFn(e));return t.map(n,"value")}}isArrayKey(t){return t.endsWith("[]")}[t.isBlank.key](){return 0===this.entries.length}static fromForm(t){return t=up.fragment.get(t),this.fromFields(up.form.fields(t))}static fromFields(e){const n=new this;for(let r of t.wrapList(e))n.addField(r);return n}addField(t){let n=(t=e.get(t)).name;if(n&&!t.disabled){const{tagName:e}=t,{type:r}=t;if("SELECT"===e)for(let e of t.querySelectorAll("option"))e.selected&&this.add(n,e.value);else if("checkbox"===r||"radio"===r)t.checked&&this.add(n,t.value);else{if("file"!==r)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 r=t.parseURL(e).search;return r&&(r=r.replace(/^\?/,""),n.addAll(r)),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)}}},7782:()=>{const t=up.element;up.ProgressBar=class{constructor(){this.step=0,this.element=t.affix(document.body,"up-progress-bar"),this.element.style.transition="width 300ms ease-out",this.moveTo(0),up.element.paint(this.element),this.width=31,this.nextStep()}nextStep(){let t;t=this.width<80?Math.random()<.15?7+5*Math.random():1.5+.5*Math.random():.13*(100-this.width)*Math.random(),this.moveTo(this.width+t),this.step++;const e=300+40*this.step;this.timeout=setTimeout(this.nextStep.bind(this),e)}moveTo(t){this.width=t,this.element.style.width=`${t}vw`}destroy(){clearTimeout(this.timeout),this.element.remove()}conclude(){clearTimeout(this.timeout),this.moveTo(100),setTimeout(this.destroy.bind(this),300)}}},2406:()=>{const t=up.util;up.Record=class{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 this.variant()}variant(e={}){return new this.constructor(t.merge(this.attributes(),e))}[t.isEqual.key](e){return this.constructor===e.constructor&&t.isEqual(this.attributes(),e.attributes())}}},1279:()=>{up.Rect=class extends up.Record{keys(){return["left","top","width","height"]}get bottom(){return this.top+this.height}get right(){return this.left+this.width}static fromElement(t){return new this(t.getBoundingClientRect())}}},2714:function(){var t,e=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,s){function o(t){try{u(r.next(t))}catch(t){s(t)}}function a(t){try{u(r.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}u((r=r.apply(t,e||[])).next())}))};const n=up.util;up.RenderJob=(t=class{constructor(t){this.options=up.RenderOptions.preprocess(t),this.rendered=this.execute()}execute(){var t,n;return e(this,void 0,void 0,(function*(){try{let t=yield this.makeChange();return this.runResultCallbacks(t),t}catch(e){throw this.runResultCallbacks(e)||null===(n=(t=this.options).onError)||void 0===n||n.call(t,e),e}}))}runResultCallbacks(t){var e,n;if(t instanceof up.RenderResult)return t.none||null===(n=(e=t.options).onRendered)||void 0===n||n.call(e,t),t.finished.then(t.options.onFinished),!0}get finished(){return this.awaitFinished()}awaitFinished(){return e(this,void 0,void 0,(function*(){try{let t=yield this.rendered;return yield t.finished}catch(t){throw t instanceof up.RenderResult?yield t.finished:t}}))}makeChange(){if(this.guardRender(),this.options.url){let t=t=>this.handleAbortOption(t);this.change=new up.Change.FromURL(Object.assign(Object.assign({},this.options),{onRequest:t}))}else this.change=new up.Change.FromContent(this.options),this.handleAbortOption(null);return this.change.execute()}guardRender(){up.browser.assertConfirmed(this.options);let t=n.pluckKey(this.options,"guardEvent");if(t&&(t.renderOptions=this.options,up.emit(t,{target:this.options.origin}).defaultPrevented)){let e=`Rendering was prevented by ${t.type} listener`;throw up.puts("up.render()",e),new up.Aborted(e)}up.RenderOptions.assertContentGiven(this.options)}handleAbortOption(t){let{abort:e}=this.options;if(!e||!up.network.isBusy())return;let{fragments:r,layer:i,origin:s}=this.change.getPreflightProps(),o={except:t,logOnce:["up.render()","Change with { abort } option will abort other requests"]};"target"===e?up.fragment.abort(r,o):"layer"===e?up.fragment.abort(Object.assign(Object.assign({},o),{layer:i})):"all"===e||!0===e?up.fragment.abort(Object.assign(Object.assign({},o),{layer:"any"})):n.isFunction(e)?e(o):up.fragment.abort(e,Object.assign(Object.assign({},o),{layer:i,origin:s}))}},n.delegate(t.prototype,["then","catch","finally"],(function(){return this.rendered})),t)},2705:()=>{const t=up.util;up.RenderOptions=function(){const e={useHungry:!0,useKeep:!0,source:!0,saveScroll:!0,saveFocus:!0,focus:"keep",abort:"target",revalidate:"auto",failOptions:!0},n={abort:!1,confirm:!1,feedback:!1,cache:!0,background:!0},r=["url","method","origin","headers","params","cache","fallback","abort","abortable","confirm","feedback","origin","baseLayer","fail","onError"].concat(["keep","hungry","history","source","saveScroll","navigate"]),i=["url","content","fragment","document"],s=["history","focus","scroll"];function o(t){const e={};for(let n in t){const r=t[n];let i=up.fragment.successKey(n);i&&(e[i]=r)}return e}return{preprocess:function(r){var i,o;null===(o=(i=up.migrate).preprocessRenderOptions)||void 0===o||o.call(i,r);const a=t.merge(e,function(t){if(t.navigate)return up.fragment.config.navigateOptions}(r));return t.merge(t.omit(a,s),{defaults:a},r,function(t){if(t.preload)return n}(r))},finalize:function(e,n){return t.merge(e.defaults,n,e)},assertContentGiven:function(e){t.some(i,(n=>t.isGiven(e[n])))||(e.defaultToEmptyContent?e.content="":up.fail("up.render() needs either { "+i.join(", ")+" } option"))},deriveFailOptions:function(e){return e.failOptions?Object.assign(Object.assign(Object.assign(Object.assign({},e.defaults),t.pick(e,r)),o(e)),{failPrefixForced:!0}):Object.assign(Object.assign({},e),o(e))}}}()},606:()=>{up.RenderResult=class 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]}}},5437:()=>{var t;const e=up.util;up.Request=(t=class extends up.Record{constructor(t){var n;if(super(t),this.params=new up.Params(this.params),null==this.wrapMethod&&(this.wrapMethod=up.network.config.wrapMethod),this.normalizeForCaching(),(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||this.layer,t),this.context||(this.context=this.layer.context||{}),this.failContext||(this.failContext=this.failLayer.context||{}),this.mode||(this.mode=this.layer.mode),this.failMode||(this.failMode=this.failLayer.mode)}this.deferred=e.newDeferred(),null!==(n=this.badResponseTime)&&void 0!==n||(this.badResponseTime=e.evalOption(up.network.config.badResponseTime,this))}keys(){return["method","url","hash","params","target","failTarget","headers","timeout","preload","background","cache","expireCache","evictCache","layer","mode","context","failLayer","failMode","failContext","origin","fragments","queuedAt","wrapMethod","contentType","payload","onQueued","fail","abortable","badResponseTime"]}defaults(){return{state:"new",abortable:!0,headers:{},timeout:up.network.config.timeout}}get xhr(){var t;return null!==(t=this._xhr)&&void 0!==t?t:this._xhr=new XMLHttpRequest}get fragments(){if(!this._fragments&&this.target){let t=up.fragment.parseTargetSteps(this.target),n=e.map(t,"selector"),r={origin:this.origin,layer:this.layer};this._fragments=e.compact(e.map(n,(t=>up.fragment.get(t,r))))}return this._fragments}set fragments(t){this._fragments=t}get fragment(){var t;return null===(t=this.fragments)||void 0===t?void 0:t[0]}followState(t){e.delegate(this,["deferred","state","preload","expired"],(()=>t))}normalizeForCaching(){this.method=e.normalizeMethod(this.method),this.extractHashFromURL(),this.transferParamsToURL(),this.url=e.normalizeURL(this.url)}evictExpensiveAttrs(){e.task((()=>{this.layer=void 0,this.failLayer=void 0,this.origin=void 0,this.fragments=void 0}))}extractHashFromURL(){var t;let e=null===(t=this.url)||void 0===t?void 0:t.match(/^([^#]*)(#.+)$/);if(e)return this.url=e[1],this.hash=e[2]}transferParamsToURL(){!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(){var t;e.always(this,(()=>this.evictExpensiveAttrs())),null===(t=this.onQueued)||void 0===t||t.call(this,this)}load(){"new"===this.state&&(this.state="loading",this.expired=!1,new up.Request.XHRRenderer(this).buildAndSend({onload:()=>this.onXHRLoad(),onerror:()=>this.onXHRError(),ontimeout:()=>this.onXHRTimeout(),onabort:()=>this.onXHRAbort()}))}loadPage(){up.network.abort(),new up.Request.FormRenderer(this).buildAndSubmit()}onXHRLoad(){const t=this.extractResponseFromXHR(),e="Loaded "+t.description;this.emit("up:request:loaded",{request:t.request,response:t,log:e}),this.respondWith(t)}onXHRError(){this.setOfflineState("Network error")}onXHRTimeout(){this.setOfflineState("Timeout")}onXHRAbort(){this.setAbortedState()}abort({reason:t}={}){this.setAbortedState(t)&&this._xhr&&this._xhr.abort()}setAbortedState(t){if(this.isSettled())return;let e="Aborted request to "+this.description+(t?": "+t:"");return this.state="aborted",this.deferred.reject(new up.Aborted(e)),this.emit("up:request:aborted",{log:e}),!0}setOfflineState(t){if(this.isSettled())return;let e="Cannot load request to "+this.description+(t?": "+t:"");this.state="offline",this.deferred.reject(new up.Offline(e)),this.emit("up:request:offline",{log:e})}respondWith(t){if("loading"===this.state)return this.state="loaded",t.ok?this.deferred.resolve(t):this.deferred.reject(t)}isSettled(){return"new"!==this.state&&"loading"!==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)}extractResponseFromXHR(){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),r=up.protocol.locationFromXHR(this.xhr);return r&&(e.matchURLs(this.url,r)||n||(n="GET"),t.url=r),n&&(t.method=n),new up.Response(t)}cacheKey(){return JSON.stringify([this.method,this.url,this.params.toQuery(),this.metaProps()])}metaProps(){const t={};for(let n of e.evalOption(up.network.config.requestMetaKeys,this)){const r=this[n];e.isGiven(r)&&(t[n]=r)}return t}buildEventEmitter(t){return up.EventEmitter.fromEmitArgs(t,{layer:this.layer,request:this,origin:this.origin})}emit(...t){return this.buildEventEmitter(t).emit()}assertEmitted(...t){this.buildEventEmitter(t).assertEmitted()}get description(){return this.method+" "+this.url}isPartOfSubtree(t){return!(!this.fragments||!t)&&(t=e.wrapList(t),e.some(this.fragments,(function(n){return e.some(t,(t=>t.contains(n)))})))}get queueAge(){return new Date-this.queuedAt}static tester(t,{except:n}={}){let r;if(e.isFunction(t))r=t;else if(t instanceof this)r=e=>t===e;else if(e.isString(t)){let e=new up.URLPattern(t);r=t=>e.test(t.url)}else r=e=>t;if(n){let t=n.cacheKey();return e=>e.cacheKey()!==t&&r(e)}return r}},e.delegate(t.prototype,["then","catch","finally"],(function(){return this.deferred})),t)},7974:()=>{let t=up.util;up.Request.Cache=class extends up.Cache{maxSize(){return up.network.config.cacheSize}evictAge(){return up.network.config.cacheEvictAge}normalizeStoreKey(e){return t.wrapValue(up.Request,e).cacheKey()}evict(t=!0,e){this.eachMatch(t,e,(({key:t})=>this.map.delete(t)))}expire(t=!0,e){this.eachMatch(t,e,(({value:t})=>t.expired=!0))}eachMatch(t=!0,e,n){let r=up.Request.tester(t,e);for(let t of this.records())r(t.value)&&n(t)}}},5221:()=>{const t=up.util,e=up.element,n=["GET","POST"];up.Request.FormRenderer=class{constructor(t){this.request=t}buildAndSubmit(){this.params=t.copy(this.request.params);let r=this.request.url,{method:i}=this.request;const s=up.Params.fromURL(r);this.params.addAll(s),r=up.Params.stripURL(r),t.contains(n,i)||(i=up.protocol.wrapMethod(i,this.params)),this.form=e.affix(document.body,"form.up-request-loader",{method:i,action:r});let o,a,u=this.request.contentType;u&&this.form.setAttribute("enctype",u),(o=this.request.csrfParam())&&(a=this.request.csrfToken())&&this.params.add(o,a),t.each(this.params.toArray(),this.addField.bind(this)),up.browser.submitForm(this.form)}addField(t){e.affix(this.form,"input[type=hidden]",t)}}},6413:()=>{const t=up.util;up.Request.Queue=class{constructor(){this.reset()}reset(){this.queuedRequests=[],this.currentRequests=[],this.emittedLate=!1}get allRequests(){return this.currentRequests.concat(this.queuedRequests)}asap(e){e.runQueuedCallbacks(),t.always(e,(t=>this.onRequestSettled(e,t))),e.queuedAt=new Date,this.scheduleSlowTimer(e),this.queueRequest(e),t.microtask((()=>this.poke()))}promoteToForeground(t){t.background&&(t.background=!1,this.scheduleSlowTimer(t))}scheduleSlowTimer(e){let n=Math.max(e.badResponseTime-e.queueAge,0);t.timer(n,(()=>this.checkLate()))}getMaxConcurrency(){return t.evalOption(up.network.config.concurrency)}hasConcurrencyLeft(){const t=this.getMaxConcurrency();return-1===t||this.currentRequests.length<t}isBusy(){return this.currentRequests.length>0||this.queuedRequests.length>0}queueRequest(t){this.queuedRequests.push(t)}pluckNextRequest(){let e=t.find(this.queuedRequests,(t=>!t.background));return e||(e=this.queuedRequests[0]),t.remove(this.queuedRequests,e)}sendRequestNow(t){t.emit("up:request:load",{log:["Loading %s %s",t.method,t.url]}).defaultPrevented?t.abort({reason:"Prevented by event listener"}):(t.normalizeForCaching(),this.currentRequests.push(t),t.load())}onRequestSettled(e,n){t.remove(this.currentRequests,e)||t.remove(this.queuedRequests,e),n instanceof up.Response&&n.ok&&up.network.registerAliasForRedirect(e,n),this.checkLate(),t.microtask((()=>this.poke()))}poke(){let t;if(this.hasConcurrencyLeft()&&(t=this.pluckNextRequest()))return this.sendRequestNow(t)}abort(...e){var n;let r=t.extractOptions(e),{except:i,reason:s,logOnce:o}=r,a=null===(n=e[0])||void 0===n||n,u=up.Request.tester(a,{except:i});for(let e of[this.currentRequests,this.queuedRequests]){const n=t.filter(e,u);for(let r of n)o&&(up.puts(...o),o=null),r.abort({reason:s}),t.remove(e,r)}}checkLate(){const t=this.isLate();this.emittedLate!==t&&(this.emittedLate=t,t?up.emit("up:network:late",{log:"Server is slow to respond"}):up.emit("up:network:recover",{log:"Slow requests were loaded"}))}isLate(){const e=t.reject(this.allRequests,"background");return t.some(e,(t=>t.queueAge>=t.badResponseTime-1))}}},2298:()=>{var t;const e="multipart/form-data",n=up.util;up.Request.XHRRenderer=(t=class{constructor(t){this.request=t}buildAndSend(t){const e=this.request.xhr;this.params=n.copy(this.request.params),this.request.timeout&&(e.timeout=this.request.timeout),e.open(this.getMethod(),this.request.url);const r=this.request.metaProps();for(let t in r)this.addHeader(e,up.protocol.headerize(t),r[t]);for(let t in this.request.headers)this.addHeader(e,t,this.request.headers[t]);let i,s;(i=this.request.csrfHeader())&&(s=this.request.csrfToken())&&this.addHeader(e,i,s),this.addHeader(e,up.protocol.headerize("version"),up.version);let o=this.getContentType();o&&this.addHeader(e,"Content-Type",o),Object.assign(e,t),e.send(this.getPayload())}getMethod(){return this.method||(this.method=this.request.method,this.request.wrapMethod&&!this.request.will302RedirectWithGET()&&(this.method=up.protocol.wrapMethod(this.method,this.params))),this.method}getContentType(){return this.finalizePayload(),this.contentType}getPayload(){return this.finalizePayload(),this.payload}addHeader(t,e,r){(n.isOptions(r)||n.isArray(r))&&(r=JSON.stringify(r)),t.setRequestHeader(e,r)}finalizePayload(){this.payload=this.request.payload,this.contentType=this.request.contentType,!this.payload&&this.request.allowsPayload()&&(this.contentType||(this.contentType=this.params.hasBinaryValues()?e:"application/x-www-form-urlencoded"),this.contentType===e?(this.contentType=null,this.payload=this.params.toFormData()):this.payload=this.params.toQuery().replace(/%20/g,"+"))}},n.memoizeMethod(t.prototype,["finalizePayload"]),t)},4517:()=>{const t=up.util;up.Response=class 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(){var e;return!t.evalOption(null!==(e=this.fail)&&void 0!==e?e:up.network.config.fail,this)}getHeader(t){var e;return this.headers[t]||(null===(e=this.xhr)||void 0===e?void 0:e.getResponseHeader(t))}get contentType(){return this.getHeader("Content-Type")}get cspNonces(){return up.protocol.cspNoncesFromHeader(this.getHeader("Content-Security-Policy"))}get lastModified(){let t=this.getHeader("Last-Modified");if(t)return new Date(t)}get etag(){return this.getHeader("ETag")}get json(){return this.parsedJSON||(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;up.ResponseDoc=(t=class{constructor(t){if(this.noscriptWrapper=new up.HTMLWrapper("noscript"),this.scriptWrapper=new up.HTMLWrapper("script"),this.root=this.parseDocument(t)||this.parseFragment(t)||this.parseContent(t),this.cspNonces=t.cspNonces,t.origin){let e=up.fragment.tryToTarget(t.origin);e&&(this.rediscoveredOrigin=this.select(e))}}parseDocument(t){return this.parse(t.document,n.createDocumentFromHTML)}parseContent(t){let r=t.content||"",i=t.target||up.fail("must pass a { target } when passing { content }");i=e.map(up.fragment.parseTargetSteps(i),"selector").join(",");const s=n.createFromSelector(i);return e.isString(r)?(r=this.wrapHTML(r),s.innerHTML=r):s.appendChild(r),s}parseFragment(t){return this.parse(t.fragment)}parse(t,r=n.createFromHTML){return e.isString(t)&&(t=r(t=this.wrapHTML(t))),t}rootSelector(){return up.fragment.toTarget(this.root)}wrapHTML(t){return t=this.noscriptWrapper.wrap(t),up.fragment.config.runScripts?this.scriptWrapper.wrap(t):this.scriptWrapper.strip(t)}getTitle(){var t;return null===(t=this.root.querySelector("head title"))||void 0===t?void 0:t.textContent}select(t){return new up.FragmentFinder({selector:t,origin:this.rediscoveredOrigin,externalRoot:this.root}).find()}finalizeElement(t){this.noscriptWrapper.unwrap(t),up.NonceableCallback.adoptNonces(t,this.cspNonces),this.scriptWrapper.unwrap(t)}},e.memoizeMethod(t.prototype,"getTitle"),t)},2723:()=>{const t=up.element,e=up.util;up.RevealMotion=class{constructor(e,n={}){var r,i,s,o,a,u,l,c;this.element=e,this.options=n,this.viewport=t.get(this.options.viewport)||up.viewport.get(this.element),this.obstructionsLayer=up.layer.get(this.viewport);const p=up.viewport.config;this.snap=null!==(i=null!==(r=this.options.snap)&&void 0!==r?r:this.options.revealSnap)&&void 0!==i?i:p.revealSnap,this.padding=null!==(o=null!==(s=this.options.padding)&&void 0!==s?s:this.options.revealPadding)&&void 0!==o?o:p.revealPadding,this.top=null!==(u=null!==(a=this.options.top)&&void 0!==a?a:this.options.revealTop)&&void 0!==u?u:p.revealTop,this.max=null!==(c=null!==(l=this.options.max)&&void 0!==l?l:this.options.revealMax)&&void 0!==c?c:p.revealMax,this.topObstructions=p.fixedTop,this.bottomObstructions=p.fixedBottom}start(){const t=this.getViewportRect(this.viewport),n=up.Rect.fromElement(this.element);if(this.max){const t=e.evalOption(this.max,this.element);n.height=Math.min(n.height,t)}this.addPadding(n),this.substractObstructions(t),t.height<0&&up.fail("Viewport has no visible area");const r=this.viewport.scrollTop;let i=r;this.top||n.height>t.height?i+=n.top-t.top:n.top<t.top?i-=t.top-n.top:n.bottom>t.bottom&&(i+=n.bottom-t.bottom),e.isNumber(this.snap)&&i<this.snap&&n.top<.5*t.height&&(i=0),i!==r&&this.viewport.scrollTo(Object.assign(Object.assign({},this.options),{top:i}))}getViewportRect(){return up.viewport.isRoot(this.viewport)?new up.Rect({left:0,top:0,width:up.viewport.rootWidth(),height:up.viewport.rootHeight()}):up.Rect.fromElement(this.viewport)}addPadding(t){t.top-=this.padding,t.height+=2*this.padding}selectObstructions(n){let r=up.fragment.all(n.join(","),{layer:this.obstructionsLayer});return e.filter(r,t.isVisible)}substractObstructions(t){for(let e of this.selectObstructions(this.topObstructions)){let n=up.Rect.fromElement(e).bottom-t.top;n>0&&(t.top+=n,t.height-=n)}for(let e of this.selectObstructions(this.bottomObstructions)){let n=up.Rect.fromElement(e),r=t.bottom-n.top;r>0&&(t.height-=r)}}}},8720:()=>{const t=up.util;up.Selector=class{constructor(t,e=[]){this.selectors=t,this.filters=e,this.unionSelector=this.selectors.join(",")||"match-none"}matches(t){return t.matches(this.unionSelector)&&this.passesFilter(t)}closest(t){let e;return this.matches(t)?t:(e=t.parentElement)?this.closest(e):void 0}passesFilter(e){return t.every(this.filters,(t=>t(e)))}descendants(e){const n=t.flatMap(this.selectors,(t=>e.querySelectorAll(t)));return t.filter(n,(t=>this.passesFilter(t)))}subtree(t){const e=[];return t instanceof Document||!this.matches(t)||e.push(t),e.push(...this.descendants(t)),e}}},7885:()=>{const t=up.util,e=up.element;up.Tether=class{constructor(t){var n,r;null===(r=(n=up.migrate).handleTetherOptions)||void 0===r||r.call(n,t),this.anchor=t.anchor,this.align=t.align,this.position=t.position,this.alignAxis="top"===this.position||"bottom"===this.position?"horizontal":"vertical",this.viewport=up.viewport.get(this.anchor),this.parent=this.viewport===e.root?document.body:this.viewport,this.syncOnScroll=!this.viewport.contains(this.anchor.offsetParent)}start(t){this.element=t,this.element.style.position="absolute",this.setOffset(0,0),this.sync(),this.changeEventSubscription("on")}stop(){this.changeEventSubscription("off")}changeEventSubscription(t){let e=this.scheduleSync.bind(this);up[t](window,"resize",e),this.syncOnScroll&&up[t](this.viewport,"scroll",e)}scheduleSync(){return clearTimeout(this.syncTimer),this.syncTimer=t.task(this.sync.bind(this))}isDetached(){return!this.parent.isConnected||!this.anchor.isConnected}sync(){const n=this.element.getBoundingClientRect(),r=e.styleNumber(this.element,"marginTop"),i=e.styleNumber(this.element,"marginRight"),s=e.styleNumber(this.element,"marginBottom"),o=e.styleNumber(this.element,"marginLeft"),a=this.anchor.getBoundingClientRect();let u,l;switch(this.alignAxis){case"horizontal":switch(this.position){case"top":l=a.top-s-n.height;break;case"bottom":l=a.top+a.height+r}switch(this.align){case"left":u=a.left+o;break;case"center":u=a.left+.5*(a.width-n.width);break;case"right":u=a.left+a.width-n.width-i}break;case"vertical":switch(this.align){case"top":l=a.top+r;break;case"center":l=a.top+.5*(a.height-n.height);break;case"bottom":l=a.top+a.height-n.height-s}switch(this.position){case"left":u=a.left-i-n.width;break;case"right":u=a.left+a.width+o}}t.isDefined(u)||t.isDefined(l)?this.moveTo(u,l):up.fail("Invalid tether constraints: %o",this.describeConstraints())}describeConstraints(){return{position:this.position,align:this.align}}moveTo(t,e){const n=this.element.getBoundingClientRect();this.setOffset(t-n.left+this.offsetLeft,e-n.top+this.offsetTop)}setOffset(t,n){this.offsetLeft=t,this.offsetTop=n,e.setStyle(this.element,{left:t,top:n})}}},4818:()=>{const t=up.util;up.URLPattern=class{constructor(e,n=t.normalizeURL){this.normalizeURL=n,this.groups=[];const r=[],i=[];for(let n of t.parseTokens(e))"-"===n[0]?i.push(n.substring(1)):r.push(n);this.positiveRegexp=this.buildRegexp(r,!0),this.negativeRegexp=this.buildRegexp(i,!1)}buildRegexp(e,n){if(!e.length)return;let r=(e=e.map((e=>("*"===e[0]&&(e="/"+e),e=this.normalizeURL(e),t.escapeRegExp(e))))).join("|");return r=r.replace(/\\\*/g,".*?"),r=r.replace(/(:|\\\$)([a-z][\w-]*)/gi,((t,e,r)=>"\\$"===e?(n&&this.groups.push({name:r,cast:Number}),"(\\d+)"):(n&&this.groups.push({name:r,cast:String}),"([^/?#]+)"))),new RegExp("^(?:"+r+")$")}test(t,e=!0){return e&&(t=this.normalizeURL(t)),this.positiveRegexp.test(t)&&!this.isExcluded(t)}recognize(t,e=!0){e&&(t=this.normalizeURL(t));let n=this.positiveRegexp.exec(t);if(n&&!this.isExcluded(t)){const t={};return this.groups.forEach(((e,r)=>{let i=n[r+1];if(i)return t[e.name]=e.cast(i)})),t}}isExcluded(t){var e;return null===(e=this.negativeRegexp)||void 0===e?void 0:e.test(t)}}},9675:(t,e,n)=>{n(5941),up.element=function(){const t=up.util;function e(...t){const e=t.pop();return(t[0]||document).querySelector(e)}function n(t,e){const n=[];return t.matches(e)&&n.push(t),n.push(...t.querySelectorAll(e)),n}function r(...n){const r=n.pop();return t.isElement(r)?r:t.isString(r)?e(...n,r):t.isList(r)?(r.length>1&&up.fail("up.element.get(): Cannot cast multiple elements (%o) to a single element",r),r[0]):r}function i(...e){return t.flatMap(e,s)}function s(e){return t.isString(e)?document.querySelectorAll(e):t.wrapList(e)}function o(t){t.setAttribute("hidden","")}function a(t){t.removeAttribute("hidden"),"none"===t.style.display&&(t.style.display="")}function u(e,n){for(let r in n){const i=n[r];t.isGiven(i)?e.setAttribute(r,i):e.removeAttribute(r)}}function l(e,n){let r,i,s,{includePath:o}=c(e);for(let t of o){let{tagName:e,id:n,classNames:o,attributes:a}=t;e&&"*"!==e||(e="div"),i=document.createElement(e),r||(r=i),n&&(i.id=n);for(let t of o)i.classList.add(t);for(let t in a){let e=a[t];i.setAttribute(t,e||"")}null==s||s.appendChild(i),s=i}if(n){let e;if(e=t.pluckKey(n,"class"))for(let n of t.wrapList(e))r.classList.add(n);(e=t.pluckKey(n,"style"))&&C(r,e),(e=t.pluckKey(n,"text"))&&(r.textContent=e),(e=t.pluckKey(n,"content"))&&(r.innerHTML=e),u(r,n)}return r}function c(t){let e;const n=t.replace(/:not\([^)]+\)/,(function(t){return e=t,""})),[r,i]=function(t){let e=[];return[t=h(t,(function({name:t,value:n}){return e.push(n),`[${t}]`})),e]}(n);return{includePath:r.split(/[ >]+/).map((function(e){let n={tagName:null,classNames:[],id:null,attributes:{}};return e=(e=(e=e.replace(/^[\w-*]+/,(function(t){return n.tagName=t,""}))).replace(/#([\w-]+)/,(function(t,e){return n.id=e,""}))).replace(/\.([\w-]+)/g,(function(t,e){return n.classNames.push(e),""})),i.length&&(e=h(e,(function({name:t}){return n.attributes[t]=i.shift(),""}))),e&&up.fail("Cannot parse selector: "+t),n})),includeRaw:n,excludeRaw:e}}const p=/\[([\w-]+)(?:([~|^$*]?=)(["'])?([^\3\]]*?)\3)?]/g;function h(t,e){return t.replace(p,(function(t,n,r,i,s){return s&&(s=s.replace(/\\([\\"'])/,"$1")),e({name:n,operator:r,quote:i,value:s})}))}const d=["HTML","BODY","HEAD","TITLE"],f=up.mockable((t=>t.matches(d.join(","))));function m(e,n){return t.isGiven(n)?`[${e}="${n=n.replace(/"/g,'\\"')}"]`:`[${e}]`}function g(t){t.offsetHeight}function y(e,n,r){t.isMissing(e.getAttribute(n))&&e.setAttribute(n,r)}function v(e,n){return t.nullToUndefined(e.getAttribute(n))}function b(t,e,n){if(!t.hasAttribute(e))return;const r=v(t,e);switch(r){case"false":return!1;case"true":case"":case e:return!0;default:return!n||r}}function w(t,e){const n=E(t,Object.keys(e));return C(t,e),()=>C(t,n)}function k(t,e){return S(window.getComputedStyle(t),e)}function O(e,n){const r=k(e,n);if(t.isGiven(r))return parseFloat(r)}function E(t,e){const{style:n}=t;return S(n,e)}function S(e,n){return t.isString(n)?e[n]:t.pick(e,n)}function C(e,n){if(t.isString(n))e.setAttribute("style",n);else{const{style:t}=e;for(let e in n){let r=n[e];r=x(e,r),t[e]=r}}}function x(e,n){var r;return t.isMissing(n)?n="":R.has(e.toLowerCase().replace(/-/,""))&&(r=n,n=t.isNumber(r)||t.isString(r)&&/^\d+$/.test(r)?r.toString()+"px":r),n}const R=new Set(["top","right","bottom","left","padding","paddingtop","paddingright","paddingbottom","paddingleft","margin","margintop","marginright","marginbottom","marginleft","borderwidth","bordertopwidth","borderrightwidth","borderbottomwidth","borderleftwidth","width","height","maxwidth","maxheight","minwidth","minheight"]);function F(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}return{subtree:n,isInSubtree:function(t,e){const n=r(e);return t.contains(n)},closestAttr:function(t,e,n=v){let r=t.closest("["+e+"]");if(r)return n(r,e)},ancestor:function t(e,n){let r=e.parentElement;if(r)return r.matches(n)?r:t(r,n)},around:function(t,e){return i(t.closest(e),n(t,e))},get:r,list:i,toggle:function(t,e){null==e&&(e=!F(t)),(e?a:o)(t)},hide:o,show:a,metaContent:function(t){var n;return null===(n=e("meta"+m("name",t)))||void 0===n?void 0:n.getAttribute("content")},insertBefore:function(t,e){t.insertAdjacentElement("beforebegin",e)},createFromSelector:l,setAttrs:u,setTemporaryAttrs:function(t,e){const n={};for(let r of Object.keys(e))n[r]=t.getAttribute(r);return u(t,e),()=>u(t,n)},affix:function(e,...n){let r,i;const s=t.extractOptions(n);2===n.length?[r,i]=n:(r="beforeend",i=n[0]);const o=l(i,s);return e.insertAdjacentElement(r,o),o},idSelector:function(t){return t.match(/^[a-z0-9\-_]+$/i)?`#${t}`:m("id",t)},classSelector:function(t){return`.${t=t.replace(/:/g,"\\:")}`},isSingleton:f,attrSelector:m,tagName:function(t){return t.tagName.toLowerCase()},createDocumentFromHTML:function(t){return(new DOMParser).parseFromString(t,"text/html")},createFromHTML:function(t){const e=document.createRange();e.setStart(document.body,0);let n=e.createContextualFragment(t.trim()).childNodes;if(1!==n.length)throw new Error("HTML must have a single root element");return n[0]},get root(){return document.documentElement},paint:g,concludeCSSTransition:function(t){const e=w(t,{transition:"none"});return g(t),e},hasCSSTransition:function(e){let n;n=t.isOptions(e)?e:k(e);const r=n.transitionProperty,i=n.transitionDuration;return!("none"===r||"all"===r&&0===i)},fixedToAbsolute:function(t){const e=t.getBoundingClientRect();t.style.position="absolute";const n=t.offsetParent.getBoundingClientRect();C(t,{left:e.left-O(t,"margin-left")-n.left,top:e.top-O(t,"margin-top")-n.top,right:"",bottom:""})},setMissingAttrs:function(t,e){for(let n in e)y(t,n,e[n])},setMissingAttr:y,unwrap:function(e){!function(n){const r=document.activeElement;try{!function(){const n=e.parentNode,r=t.toArray(e.childNodes);t.each(r,(t=>n.insertBefore(t,e))),n.removeChild(e)}()}finally{r&&r!==document.activeElement&&r.focus({preventScroll:!0})}}()},wrapChildren:function(t){let e;const n=document.createElement("up-wrapper");for(;e=t.firstChild;)n.appendChild(e);return t.appendChild(n),n},isWrapper:function(t){return t.matches("up-wrapper")},attr:v,booleanAttr:b,numberAttr:function(t,e){let n=t.getAttribute(e);if(n&&(n=n.replace(/_/g,""),n.match(/^[\d.]+$/)))return parseFloat(n)},jsonAttr:function(t,e){var n,r;let i=null===(r=null===(n=t.getAttribute)||void 0===n?void 0:n.call(t,e))||void 0===r?void 0:r.trim();if(i)return JSON.parse(i)},callbackAttr:function(e,n,{exposedKeys:r=[],mainKey:i="event"}={}){let s=e.getAttribute(n);if(s){const n=up.NonceableCallback.fromString(s).toFunction(i,...r);return function(i){const s=Object.values(t.pick(i,r));return n.call(e,i,...s)}}},booleanOrStringAttr:function(t,e){return b(t,e,!0)},setTemporaryStyle:w,style:k,styleNumber:O,inlineStyle:E,setStyle:C,isVisible:F,upAttrs:function(t){const e=/^up-/,n={};for(let r of t.attributes){const{name:t}=r;t.match(e)&&(n[t]=r.value)}return n},toggleAttr:function(t,e,n,r){return null==r&&(r=!t.hasAttribute(e)),r?t.setAttribute(e,n):t.removeAttribute(e)},addTemporaryClass:function(t,e){return t.classList.add(e),()=>t.classList.remove(e)},setTemporaryAttr:function(t,e,n){return t.setAttribute(e,n),()=>t.removeAttribute(t,e)},cleanJQuery:function(t){up.browser.canJQuery()&&jQuery(t).remove()},parseSelector:c}}()},3924:()=>{up.error=function(){function t(t){return!("object"==typeof t&&("AbortError"===t.name||t instanceof up.RenderResult||t instanceof up.Response))}return{fail:function(...t){throw new up.Error(t)},emitGlobal:function(t){const{message:e}=t;up.emit(window,"error",{message:e,error:t,log:!1})},isCritical:t,muteUncriticalRejection:function(e){return e.catch((function(e){if(t(e))throw e}))}}}(),up.fail=up.error.fail},4366:()=>{up.Aborted=class extends up.Error{constructor(t){super(t,{name:"AbortError"})}}},5485:()=>{up.CannotCompile=class extends up.Error{}},8010:()=>{up.CannotMatch=class extends up.Error{}},4861:()=>{up.CannotParse=class extends up.Error{}},3469:()=>{up.CannotTarget=class extends up.Error{}},376:()=>{up.Error=class 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 extends up.Error{}},4504:()=>{up.Offline=class extends up.Error{}},8670:()=>{up.event=function(){const t=up.util,e=up.element;function n(...t){return r(t).bind()}function r(t,e){return up.EventListenerGroup.fromBindArgs(t,e)}function i(t){return up.EventEmitter.fromEmitArgs(t)}const s=["metaKey","shiftKey","ctrlKey","altKey"];function o(e){return(t.isUndefined(e.button)||0===e.button)&&!t.some(s,(t=>e[t]))}function a(e,n,r=[]){const i=up.event.build(n,t.pick(e,r));return i.originalEvent=e,["stopPropagation","stopImmediatePropagation","preventDefault"].forEach((function(t){const n=i[t];return i[t]=function(){return e[t](),n.call(i)}})),e.defaultPrevented&&i.preventDefault(),i}return n("up:click","a[up-emit]",(function(t,n){if(!o(t))return;const r=e.attr(n,"up-emit"),i=e.jsonAttr(n,"up-emit-props"),s=a(t,r);Object.assign(s,i),up.emit(n,s)})),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,$on:function(...t){return r(t,{jQuery:!0}).bind()},off:function(...t){return r(t).unbind()},build:function(...e){const n=t.extractOptions(e),r=e[0]||n.type||up.fail("Expected event type to be passed as string argument or { type } property"),i=document.createEvent("Event");return i.initEvent(r,!0,!0),Object.assign(i,t.omit(n,["type","target"])),i},emit:function(...t){return i(t).emit()},assertEmitted:function(...t){return i(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:o,fork:a,keyModifiers:s}}(),up.on=up.event.on,up.$on=up.event.$on,up.off=up.event.off,up.$off=up.event.off,up.emit=up.event.emit},454:()=>{up.feedback=function(){const t=up.util,e=up.element,n=new up.Config((()=>({currentClasses:["up-current"],navSelectors:["[up-nav]","nav"]}))),r="a, [up-href]";function i(){return n.navSelectors.join(",")}function s(e){if(e)return t.normalizeURL(e,{trailingSlash:!1,hash:!1})}function o(t){return t.upFeedbackURLs||(t.upFeedbackURLs=new up.LinkFeedbackURLs(t))}function a(n,s){const o=up.fragment.subtree(n,i(),s);l(t.flatMap(o,(t=>e.subtree(t,r))),s)}function u(t){return t.feedbackLocation||s(t.location)}function l(t,r={}){if(!t.length)return;let i=u(r.layer||up.layer.get(t[0]));if(i)for(let r of t){const t=o(r).isCurrent(i);for(let e of n.currentClasses)r.classList.toggle(e,t);e.toggleAttr(r,"aria-current","page",t)}}function c(t){const e=t.feedbackLocation,n=u(t.location);e&&e===n||(t.feedbackLocation=n,a(t.element,{layer:t}))}return up.on("up:location:changed",(t=>{!function(){const t=up.layer.front;t.showsLiveHistory()&&c(t)}()})),up.on("up:fragment:inserted",((t,e)=>{!function(t){const e={layer:up.layer.get(t)};up.fragment.closest(t,i(),e)?l(up.fragment.subtree(t,r,e),e):a(t,e)}(e)})),up.on("up:layer:location:changed",(t=>{c(t.layer)})),up.on("up:framework:reset",(function(){n.reset(),up.layer.root.feedbackLocation=null})),{config:n,showAroundRequest:function(n,i){if(!i.feedback)return;let s=e=>t.always(n,e),o=function(t){let n=t.origin;if(n)return i=n,e.ancestor(i,r)||i;var i}(n);o&&s(e.addTemporaryClass(o,"up-active"));for(let t of n.fragments)s(e.addTemporaryClass(t,"up-loading"))},normalizeURL:s}}()},2851:()=>{up.form=function(){const t=up.util,e=up.element,n=["[up-submit]","[up-target]","[up-layer]","[up-transition]"],r=new up.Config((()=>({groupSelectors:["[up-form-group]","fieldset","label","form"],fieldSelectors:["select","input:not([type=submit]):not([type=image])","button[type]:not([type=submit])","textarea"],submitSelectors:up.link.combineFollowableSelectors(["form"],n),noSubmitSelectors:["[up-submit=false]","[target]"],submitButtonSelectors:["input[type=submit]","input[type=image]","button[type=submit]","button:not([type])"],watchInputEvents:["input","change"],watchInputDelay:0,watchChangeEvents:t=>t.matches("input[type=date]")?["blur"]:["change"]})));function i(){return r.submitSelectors.join(",")}function s(t=""){return r.fieldSelectors.map((e=>e+t)).join(",")}function o(t){return t.matches(s())}function a(n){n=e.get(n);let r=e.subtree(n,s());if(n.matches("form[id]")){const i=s(e.attrSelector("form",n.getAttribute("id"))),o=up.fragment.all(i,{layer:n});r.push(...o),r=t.uniq(r)}return r}function u(t){return e.subtree(t,l())}function l(){return r.submitButtonSelectors.join(",")}const c=up.mockable(((t,e)=>up.render(p(t,e))));function p(t,e,n){e=m(t=S(t),e,n);let r=new up.OptionsParser(t,e,n);return r.string("failTarget",{default:up.fragment.tryToTarget(t)}),r.booleanOrString("disable"),e.guardEvent||(e.guardEvent=up.event.build("up:form:submit",{submitButton:e.submitButton,log:"Submitting form",params:e.params})),e.origin||(e.origin=up.viewport.focusedElementWithin(t)||e.submitButton||t),Object.assign(e,up.link.followOptions(t,e,n)),e}function h(t){let e,n=document.activeElement;if(t.contains(n)){let r=v(n);e=t.contains(r)||t===n?r:t}let r=[...a(t),...u(t)];return r.forEach(d),e&&!e.contains(document.activeElement)&&up.focus(e,{force:!0,preventScroll:!0}),function(){r.forEach(f)}}function d(t){t.upDisableCount||(t.upDisableCount||(t.upDisableCount=0),t.upOriginalDisabled=t.disabled),t.upDisableCount++,t.disabled=!0}function f(t){t.upDisableCount&&(t.disabled?(t.upDisableCount--,t.upDisableCount||(t.disabled=t.upOriginalDisabled)):t.upDisableCount=0)}function m(n,r,i){r=t.options(r),n=S(n);const s=new up.OptionsParser(n,r,i);s.string("contentType",{attr:["enctype","up-content-type"]}),s.json("headers");const o=up.Params.fromForm(n),a=function(t){const n=l(),r=up.viewport.focusedElementWithin(t);return r&&r.matches(n)?r:e.get(t,n)}(n);return a&&(r.submitButton=a,o.addField(a),r.method||(r.method=a.getAttribute("formmethod")),r.url||(r.url=a.getAttribute("formaction"))),o.addAll(r.params),r.params=o,s.string("url",{attr:"action",default:up.fragment.source(n)}),s.string("method",{attr:["up-method","data-method","method"],default:"GET",normalize:t.normalizeMethod}),"GET"===r.method&&(r.url=up.Params.stripURL(r.url)),r}function g(e,...n){let r=S(e);const i=a(e),s=t.reject(i,"name");s.length&&up.puts("up.watch()","Will not watch fields without a [name]: %o",s);const o=t.extractCallback(n)||function(t){let e=t.getAttribute("up-watch");if(e)return up.NonceableCallback.fromString(e).toFunction("value","name").bind(t)}(e)||up.fail("No callback given for up.watch()");let u=t.extractOptions(n);const l=new up.FieldWatcher(r,i,u,o);return l.start(),()=>l.stop()}function y(t,e){return g(t,e,((e,n,r)=>c(t,r)))}function v(t){return b(t).element}function b(e){return t.findResult((null===(i=(n=up.migrate).migratedFormGroupSelectors)||void 0===i?void 0:i.call(n))||r.groupSelectors,(function(t){let n=e.closest(t);if(n){let r=up.fragment.tryToTarget(n),i=up.fragment.tryToTarget(e),s=i&&n!==e&&`${t}:has(${i})`,o=r||s;if(o)return{target:o,element:n,origin:e}}}));var n,i}function w(n){let r,i;if(n.matches("input[type=checkbox]"))n.checked?(r=n.value,i=":checked"):i=":unchecked";else if(n.matches("input[type=radio]")){const t=C(n),s=n.getAttribute("name"),o=t.querySelector(`input[type=radio]${e.attrSelector("name",s)}:checked`);o?(i=":checked",r=o.value):i=":unchecked"}else r=n.value;const s=[];return t.isPresent(r)?(s.push(r),s.push(":present")):s.push(":blank"),t.isPresent(i)&&s.push(i),s}function k(t,e={}){const n=e.target||e.target||t.getAttribute("up-switch"),r=C(t);n||up.fail("No switch target given for %o",t);const i=w(t);for(let t of up.fragment.all(r,n))O(t,i)}up.on("up:click",l,(function(t,e){const n=S(e);n&&x(n)&&e.focus()}));const O=up.mockable((function(n,r){let i;r||(r=w(function(e){const n=C(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 s=n.getAttribute("up-hide-for");if(s)s=E(s),i=0===t.intersect(r,s).length;else{let e=n.getAttribute("up-show-for");e=e?E(e):[":present",":checked"],i=t.intersect(r,e).length>0}e.toggle(n,i),n.classList.add("up-switched")}));function E(e){return t.parseTokens(e,{json:!0})}function S(t,e={}){const n=up.fragment.get(t,e);return n.form||n.closest("form")}function C(t,e){return S(t,e)||up.layer.get(t).element}function x(t){return(t=up.fragment.get(t)).matches(i())&&!R(t)}function R(t){return t.matches(r.noSubmitSelectors.join(","))}return up.on("submit",i,(function(t,e){t.defaultPrevented||R(e)||(up.event.halt(t,{log:!0}),up.error.muteUncriticalRejection(c(e)))})),up.compiler((function(){return r.fieldSelectors.map((t=>`${t}[up-validate], [up-validate] ${t}`)).join(", ")}),(function(t){up.FormValidator.forElement(t).watchContainer(t)})),up.compiler("[up-switch]",(t=>{k(t)})),up.on("change","[up-switch]",((t,e)=>{k(e)})),up.compiler("[up-show-for]:not(.up-switched), [up-hide-for]:not(.up-switched)",(t=>{O(t)})),up.compiler("[up-watch]",(t=>g(t))),up.compiler("[up-autosubmit]",(t=>y(t))),up.on("up:framework:reset",(function(){r.reset()})),{config:r,submit:c,submitOptions:p,destinationOptions:m,watchOptions:function(e,n,r={}){var i;n=t.options(n);let s=new up.OptionsParser(e,n,Object.assign(Object.assign({},r),{closest:!0,attrPrefix:"up-watch-"}));s.boolean("feedback"),s.booleanOrString("disable"),s.string("event"),s.number("delay");let o=up.form.config;return"input"===n.event?(n.event=t.evalOption(o.watchInputEvents,e),null!==(i=n.delay)&&void 0!==i||(n.delay=o.watchInputDelay)):"change"===n.event&&(n.event=t.evalOption(o.watchChangeEvents,e)),n.origin||(n.origin=e),n},isSubmittable:x,watch:g,validate:function(...e){let n=function(e,...n){const r=t.extractOptions(n);return r.origin?r.target||(r.target=up.fragment.toTarget(e)):r.origin||(r.origin=up.fragment.get(e)),r}(...e);return up.FormValidator.forElement(n.origin).validate(n)},autosubmit:y,fieldSelector:s,fields:a,isField:o,submitButtons:u,focusedField:function(){return t.presence(document.activeElement,o)},switchTarget:O,disableWhile:function(e,n){let r=function({disable:e,origin:n}){if(!e)return t.noop;let r,i=()=>C(n||void up.fail("Cannot process { disable: '%s' } option without { %s }",e,"origin"));return!0===e?r=[i()]:t.isString(e)&&(r=up.fragment.subtree(i(),e,{origin:n})),t.sequence(r.map(h))}(n);t.always(e,r)},disable:h,group:v,groupSolution:b,get:S}}(),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(7433);const r=up.util,i=up.element;up.fragment=function(){function t(t){let e=i.tagName(t);if(e.startsWith("up-"))return e}const e=new up.Config((()=>({badTargetClasses:[/^up-/],targetDerivers:["[up-id]","[id]","html","head","body","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]","form"],verifyDerivedTarget:!0,navigateOptions:{cache:"auto",feedback:!0,fallback:!0,focus:"auto",scroll:"auto",history:"auto",peel:!0},matchAroundOrigin:!0,runScripts:!0,autoHistoryTargets:[":main"],autoFocus:["hash","autofocus","main-if-main","keep","target-if-lost"],autoScroll:["hash","layer-if-main"],autoRevalidate:t=>t.expired,skipResponse:n})));function n({response:t,expiredResponse:e}){return!t.text||t.text===(null==e?void 0:e.text)}function s(t,e={}){return t=p(t,e),i.closestAttr(t,"up-source")}function o(t){let e=i.closestAttr(t,"up-time");if(e&&"false"!==e)return/^\d+$/.test(e)&&(e=1e3*Number(e)),new Date(e)}function a(t){let e=i.closestAttr(t,"up-etag");if(e&&"false"!==e)return e}r.delegate(e,"mainTargets",(()=>up.layer.config.any));const u=up.mockable(((...t)=>{let e=y(t);return new up.RenderJob(e)})),l=up.mockable(((...t)=>{const e=y(t);return u(Object.assign(Object.assign({},e),{navigate:!0}))})),c=r.negate((function(t){return!!t.closest(".up-destroying")}));function p(...t){const e=r.extractOptions(t),n=t.pop(),s=t[0];return r.isElementish(n)?i.get(n):s?h(s,n,e):new up.FragmentFinder({selector:n,origin:e.origin,layer:e.layer}).find()}function h(...t){return f(...t)[0]}const d=/:has\(([^)]+)\)$/;function f(...t){const e=r.extractOptions(t);let n=t.pop();const i=t[0];return r.isElement(n)?[n]:r.isList(n)?n:S(n,i,e).descendants(i||document)}function m(t,e,n={}){return(e=S(e,t,n)).subtree(t)}function g(t,e){return m(t,e).length>0}function y(t){const e=r.parseArgIntoOptions(t,"target");return r.isElement(e.target)&&(e.origin||(e.origin=e.target)),e}const v=/^(onFail|on|fail)?(.+)$/;function b(t,e){return r.presence(t,r.isString)||w(t,e)||function(t){throw new up.CannotTarget(function(t){return`Cannot derive good target selector from a <${i.tagName(t)}> element without identifying attributes. Try setting an [id] or configure up.fragment.config.targetDerivers.`}(t))}(t)}function w(t,n){return r.findResult(e.targetDerivers,(function(s){let o=function(t,e){if(r.isFunction(e))return e(t);if(t.matches(e))try{return function(t,e){let{includePath:n,excludeRaw:r}=up.element.parseSelector(e);if(1!==n.length)throw new up.CannotParse(e);let{tagName:s,id:o,classNames:a,attributes:u}=n[0],l="";"*"===s?l+=i.tagName(t):s&&(l+=s);for(let t of a)l+=i.classSelector(t);o&&(l+=i.idSelector(o));for(let e in u){let n=u[e]||t.getAttribute(e);if("id"===e)l+=i.idSelector(n);else if("class"===e)for(let e of k(t))l+=i.classSelector(e);else l+=i.attrSelector(e,n)}return r&&(l+=r),l}(t,e)}catch(t){if(t instanceof up.CannotParse)return e;throw t}}(t,s);if(o&&function(t,n,r={}){return!n.isConnected||!e.verifyDerivedTarget||up.fragment.get(t,Object.assign({layer:n},r))===n}(o,t,n))return o}))}function k(t){return r.filter(t.classList,(t=>!r.some(e.badTargetClasses,(e=>{return n=e,i=t,r.isRegExp(n)?n.test(i):n===i;var n,i}))))}function O(t,{origin:e}={}){return t.replace(/:origin\b/,(function(n){if(e)return b(e);up.fail('Missing { origin } element to resolve "%s" reference (found in %s)',n,t)}))}function E(...t){return(up.migrate.resolveOrigin||O)(...t)}function S(t,e,n={}){var i;const s=[];let o;if(n.destroying||s.push(c),e&&!document.contains(e)||"any"===n.layer)o=up.layer.root;else{null!==(i=n.layer)&&void 0!==i||(n.layer=e);const t=up.layer.getAll(n);s.push((e=>r.some(t,(t=>t.contains(e))))),o=t[0]}let a=up.fragment.expandTargets(t,Object.assign(Object.assign({},n),{layer:o}));return a=a.map((function(t){return t=t.replace(d,(function(t,e){return s.push((t=>t.querySelector(e))),""})),t||"*"})),new up.Selector(a,s)}function C(t){return r.parseTokens(t,{separator:"comma"})}return up.on("up:framework:boot",(function(){const{documentElement:t}=document;if(t.setAttribute("up-source",r.normalizeURL(location.href,{hash:!1})),up.hello(t),!up.browser.canPushState())return up.warn("Cannot push history changes. Next fragment update will load in a new page.")})),up.on("up:framework:reset",(function(){e.reset()})),{config:e,reload:function(...t){var e,n;const l=y(t);l.target||(l.target=":main");const c=p(l.target,l);return l.url||(l.url=s(c)),l.headers=r.merge(l.headers,function(t){let e={},n=o(t);n&&(e["If-Modified-Since"]=n.toUTCString());let r=a(t);return r&&(e["If-None-Match"]=r),e}(c)),(l.keepData||i.booleanAttr(c,"up-keep-data"))&&(l.data=up.data(c)),null===(n=(e=up.migrate).postprocessReloadOptions)||void 0===n||n.call(e,l),u(l)},destroy:function(...t){var e,n;const r=y(t);return(r.element=p(r.target,r))&&new up.Change.DestroyFragment(r).execute(),null===(n=(e=up.migrate).formerlyAsync)||void 0===n?void 0:n.call(e,"up.destroy()")},render:u,navigate:l,get:p,getDumb:h,all:f,subtree:m,contains:g,closest:function(t,e,n){return(e=S(e,t=i.get(t),n)).closest(t)},source:s,visit:function(t,e){return l(Object.assign(Object.assign({},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){var n;const r=null!==(n=e.log)&&void 0!==n?n:["Destroyed fragment %o",t],i=e.parent||document;return up.emit(i,"up:fragment:destroyed",{fragment:t,parent:i,log:r})},emitKeep:function(t){return function(t,e,n){const r=t.oldElement,i=up.event.build("up:fragment:keep",{newFragment:t.newElement,newData:t.newData});return up.emit(r,i,n)}(t,0,{log:["Keeping fragment %o",t.oldElement],callback:i.callbackAttr(t.oldElement,"up-on-keep",{exposedKeys:["newFragment","newData"]})})},successKey:function(t){let e=v.exec(t);if(e){let[t,n,i]=e;switch(n){case"onFail":return"on"+r.upperCaseFirst(i);case"fail":return r.lowerCaseFirst(i)}}},failKey:function(t){let e=v.exec(t);if(e){let[t,n,i]=e;switch(n){case"on":return"onFail"+r.upperCaseFirst(i);case void 0:return"fail"+r.upperCaseFirst(i)}}},expandTargets:function(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=r.copy(r.wrapList(t));const i=[];for(;t.length;){const s=t.shift();if(":main"===s||!0===s){const r="new"===n?e.mode:n.mode;t.unshift(...up.layer.mainTargets(r))}else":layer"===s?"new"===n||n.opening||t.unshift(n.getFirstSwappableElement()):r.isElementish(s)?i.push(b(s,e)):r.isString(s)&&i.push(E(s,e))}return r.uniq(i)},resolveOrigin:E,toTarget:b,tryToTarget:w,isTargetable:function(t){return!!w(t)},matches:function(t,e,n={}){if(t=i.get(t),r.isElement(e)){let n=w(e);return n&&t.matches(n)}return(e=S(e,t,n)).matches(t)},hasAutoHistory:function(t){return!!g(t,e.autoHistoryTargets)||(up.puts("up.render()","Will not auto-update history because fragment doesn't contain a selector from up.fragment.config.autoHistoryTargets"),!1)},time:o,etag:a,shouldRevalidate:function(t,n,i={}){return t.fromCache&&r.evalAutoOption(i.revalidate,e.autoRevalidate,n)},abort:function(...t){let e,n,i=y(t),{reason:s}=i;if(i.target)n=f(i.target,i),e=t=>t.isPartOfSubtree(n),s||(s="Aborting requests within fragment");else{let t=up.layer.getAll(i);n=r.map(t,"element"),e=e=>r.contains(t,e.layer),s||(s="Aborting requests within "+t.join(", "))}up.network.abort((t=>t.abortable&&e(t)),Object.assign(Object.assign({},i),{reason:s}));for(let t of n)up.emit(t,"up:fragment:aborted",{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},splitTarget:C,parseTargetSteps:function(t,e={}){let n=e.defaultPlacement||"swap",r=[],i=C(t);for(let t of i){if(":none"===t)continue;let i=n,s=!1;t=t.replace(/\b::?(before|after)\b/,((t,e)=>(i=e,""))),t=t.replace(/\b:maybe\b/,(()=>(s=!0,"")));const o=Object.assign(Object.assign({},e),{selector:t,placement:i,maybe:s});r.push(o)}return r}}}(),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,r.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")}function n(){for(let t of["URL","Proxy","Promise","DOMParser","FormData"])if(!window[t])return`Browser doesn't support the ${t} API`;if("BackCompat"===document.compatMode)return"Browser is in quirks mode (missing DOCTYPE?)"}return{onEvaled:function(){up.emit("up:framework:evaled",{log:!1}),function(){let t=document.currentScript;return!!(null==t?void 0:t.async)||"manual"===(null==t?void 0: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,restoreTargets:["body"]})));let r,i;const s={hash:!0};function o(e,n){return n=t.merge(s,n),t.normalizeURL(e,n)}function a(t){return o(location.href,t)}function u(){const t=a();i!==t&&(r=i,i=t)}u();const l={trailingSlash:!1};function c(e,n){return o(e,n=t.merge(l,n))===a(n)}function p(t,e={}){d("replaceState",t=o(t))&&!1!==e.event&&h({location:t,reason:"replace",log:`Replaced state for ${t}`})}function h(t){var e,n;let r=up.event.build("up:location:changed",t);null===(n=null===(e=up.migrate)||void 0===e?void 0:e.renamedProperty)||void 0===n||n.call(e,r,"url","location"),up.emit(r)}function d(t,e){if(n.enabled){const n={up:{}};return window.history[t](n,"",e),u(),!0}}function f(t){u(),h({location,reason:"pop",log:`Navigated to history entry ${location}`}),up.viewport.saveFocus({location:r}),up.viewport.saveScroll({location:r}),function(t){if(!(null==t?void 0:t.up))return void up.puts("pop","Ignoring a history state not owned by Unpoly");let e=a();up.emit("up:location:restore",{location:e,log:`Restoring location ${e}`}).defaultPrevented||up.render({url:e,target:n.restoreTargets,fail:!1,history:!0,location:e,peel:!0,layer:"root",cache:!0,saveScroll:!1,scroll:["restore","auto"],saveFocus:!1,focus:["restore","auto"]})}(t.state)}function m(){window.addEventListener("popstate",f),"GET"===up.protocol.initialRequestMethod()&&p(a(),{event:!1})}return up.on("up:framework:boot",(function(){"jasmine"in window?m():setTimeout(m,100)})),up.macro("a[up-back], [up-href][up-back]",(function(t){r&&(e.setMissingAttrs(t,{"up-href":r,"up-scroll":"restore"}),t.removeAttribute("up-back"),up.link.makeFollowable(t))})),up.on("up:framework:reset",(function(){n.reset(),r=void 0,i=void 0,u()})),{config:n,push:function(t){!c(t=o(t))&&d("pushState",t)&&h({location:t,reason:"push",log:`Advanced to location ${t}`})},replace:p,get location(){return a()},get previousLocation(){return r},normalizeURL:o,isLocation:c}}()},9443:function(t,e,n){var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,s){function o(t){try{u(r.next(t))}catch(t){s(t)}}function a(t){try{u(r.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}u((r=r.apply(t,e||[])).next())}))};n(7921);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"},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"},foreignOverlaySelectors:["dialog"]};for(let n of t)e[n.mode].Class=n;return e}));let n=null,o=[];function a(t){return"root"===t?[e.root,e.any]:[e[t],e.overlay,e.any]}function u(t){return r(this,void 0,void 0,(function*(){return t=i.options(t,{layer:"new",defaultToEmptyContent:!0,navigate:!0}),(yield 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(){e.reset(),n.reset(),o=i.filter(o,"isDefault")}));const l={config:e,mainTargets:function(t){return i.flatMap(a(t),"mainTargets")},open:u,build:function(t,r){const{mode:s}=t,{Class:o}=e[s],u=i.reverse(a(s));let l=up.migrate.handleLayerConfig;return l&&u.forEach(l),t=i.mergeDefined(...u,{mode:s,stack:n},t),r&&(t=r(t)),new o(t)},ask:function(t){return new Promise((function(e,n){u(t=Object.assign(Object.assign({},t),{onAccepted:t=>e(t.value),onDismissed:t=>n(t.value)}))}))},normalizeOptions:function(t){var r,s;if(null===(s=(r=up.migrate).handleLayerOptions)||void 0===s||s.call(r,t),i.isGiven(t.layer)){let n=String(t.layer).match(/^(new|shatter|swap)( (\w+))?/);if(n){t.layer="new";const r=n[1],i=n[3];t.mode||(t.mode=i||e.mode),"swap"===r?up.layer.isOverlay()&&(t.baseLayer="parent"):"shatter"===r&&(t.baseLayer="root")}}else t.mode?t.layer="new":i.isElementish(t.target)?t.layer=n.get(t.target,{normalizeLayerOptions:!1}):t.origin?t.layer="origin":t.layer="current";t.context||(t.context={}),t.baseLayer=n.get("current",Object.assign(Object.assign({},t),{normalizeLayerOptions:!1}))},openCallbackAttr:function(t,e){return s.callbackAttr(t,e,{exposedKeys:["layer"]})},closeCallbackAttr:function(t,e){return s.callbackAttr(t,e,{exposedKeys:["layer","value"]})},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},isWithinForeignOverlay:function(t){let n=e.foreignOverlaySelectors.join(",");return!(!n||!t.closest(n))}};return i.delegate(l,["get","getAll","root","overlays","current","front","sync","count","dismissOverlays"],(()=>n)),i.delegate(l,["accept","dismiss","isRoot","isOverlay","isFront","on","off","emit","parent","history","location","mode","context","element","contains","size","affix"],(()=>n.current)),l}()},3849:(t,e,n)=>{n(7298),up.link=function(){const t=up.util,e=up.element,n=new up.LinkPreloader;let r=null;const i=["a[up-content]","a[up-fragment]","a[up-document]"],s=["a[href]","[up-href]"],o=["[up-follow]","[up-target]","[up-layer]","[up-transition]","[up-preload]","[up-instant]"];function a(e,n){return t.flatMap(e,(t=>n.map((e=>t+e))))}const u=new up.Config((()=>({followSelectors:a(s,o).concat(i),noFollowSelectors:["[up-follow=false]","a[download]","a[target]",'a[href^="#"]:not([up-content]):not([up-fragment]):not([up-document])','a[href^="javascript:"]'],instantSelectors:["[up-instant]"],noInstantSelectors:["[up-instant=false]","[onclick]"],preloadSelectors:a(s,["[up-preload]"]),noPreloadSelectors:["[up-preload=false]"],clickableSelectors:i.concat(["[up-emit]","[up-accept]","[up-dismiss]","[up-clickable]"]),preloadDelay:90,preloadEnabled:"auto"})));function l(){return u.followSelectors.join(",")}function c(){return u.preloadSelectors.join(",")}function p(e){return e.matches(u.noFollowSelectors.join(","))||t.isCrossOrigin(e)}const h=up.mockable((function(t,e){return up.render(f(t,e))}));function d(e,n,r){n=t.options(n);const i=new up.OptionsParser(e,n,r);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=m(e,n),i.json("headers"),i.json("params"),i.booleanOrString("cache"),i.booleanOrString("expireCache"),i.booleanOrString("evictCache"),i.booleanOrString("revalidate"),i.booleanOrString("abort"),i.boolean("abortable"),i.boolean("background"),i.string("contentType"),i.number("badResponseTime"),i.number("timeout"),n}function f(t,e,n){var r,i;e=d(t=up.fragment.get(t),e,n);const s=new up.OptionsParser(t,e,Object.assign({fail:!0},n));return s.boolean("feedback"),s.boolean("fail"),e.origin||(e.origin=t),s.boolean("navigate",{default:!0}),s.string("confirm",{attr:["up-confirm","data-confirm"]}),s.string("target"),s.booleanOrString("fallback"),s.string("content"),s.string("fragment"),s.string("document"),s.boolean("useKeep"),s.boolean("useHungry"),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.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.booleanOrString("animation"),s.booleanOrString("transition"),s.string("easing"),s.number("duration"),null===(i=(r=up.migrate).parseFollowOptions)||void 0===i||i.call(r,s),e.guardEvent||(e.guardEvent=up.event.build("up:link:follow",{log:"Following link"})),e}function m(e,n={}){return t.normalizeMethod(n.method||e.getAttribute("up-method")||e.getAttribute("data-method"))}function g(t){return(t=up.fragment.get(t)).matches(l())&&!p(t)}function y(t){g(t)||t.setAttribute("up-follow","")}function v(t){t.matches("a[href], button")||(e.setMissingAttrs(t,{tabindex:"0",role:"link","up-clickable":""}),t.addEventListener("keydown",(function(t){if("Enter"===t.key||"Space"===t.key)return k(t)})))}function b(t,e){if(t.defaultPrevented||p(e))return!1;const n=`a, [up-href], ${up.form.fieldSelector()}`,r=t.target.closest(n);return!r||r===e}function w(t){const e=t.closest(u.instantSelectors.join(","));return e&&!((n=e).matches(u.noInstantSelectors.join(","))||p(n));var n}function k(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})}return up.macro((function(){return u.clickableSelectors.join(",")}),v),up.on("up:click",l,(function(t,e){b(t,e)&&(up.event.halt(t,{log:!0}),up.focus(e,{preventScroll:!0}),up.error.muteUncriticalRejection(h(e)))})),up.macro("[up-expand]",(function(t){const n=t.getAttribute("up-expand")||"a, [up-href]";let r=e.get(t,n);if(r){const n=e.upAttrs(r);n["up-href"]||(n["up-href"]=r.getAttribute("href")),e.setMissingAttrs(t,n),y(t)}})),up.compiler(c,(function(t){(function(t){return!up.browser.canPushState()||t.matches(u.noPreloadSelectors.join(","))||p(t)||!function(t){const e=d(t);if(e.url)return null==e.cache&&(e.cache="auto"),e.basic=!0,new up.Request(e).willCache()}(t)})(t)||n.watchLink(t)})),up.on("up:framework:reset",(function(){r=null,u.reset(),n.reset()})),{follow:h,followOptions:f,preload:function(e,n){if(e=up.fragment.get(e),!function(){let e=t.negate(up.network.shouldReduceRequests);return t.evalAutoOption(u.preloadEnabled,e)}())return Promise.reject(new up.Error("Link preloading is disabled"));const r=up.event.build("up:link:preload",{log:["Preloading link %o",e]});return h(e,Object.assign(Object.assign({abortable:!1},n),{guardEvent:r,preload:!0}))},makeFollowable:y,makeClickable:v,isSafe:function(t){const e=m(t);return up.network.isSafeMethod(e)},isFollowable:g,shouldFollowEvent:b,followMethod:m,convertClicks:function(t){t.on("click",(function(e,n){if(up.event.isUnmodified(e))return w(n)&&r?up.event.halt(e):t.wasHitByMouseEvent(e)&&(!r||r===e.target)&&k(e),r=null})),t.on("mousedown",(function(t,e){up.event.isUnmodified(t)&&(r=t.target,w(e)&&k(t))}))},config:u,combineFollowableSelectors:a,preloadSelector:c}}(),up.follow=up.link.follow},4453:()=>{up.log=function(){const t=new up.LogConfig;function e(t,e,r,...i){n(t,e,"",r,...i)}function n(e,n,r,i,...s){i&&(t.format?(s.unshift("color: #666666; padding: 1px 3px; border: 1px solid #bbbbbb; border-radius: 2px; font-size: 90%; display: inline-block;"+r,""),i=`%c${n}%c ${i}`):i=`[${n}] ${i}`,console[e](i,...s))}return up.on("up:framework:boot",(function(){if(!t.banner)return;const e=` __ _____ ___ ___ / /_ __\n/ // / _ \\/ _ \\/ _ \\/ / // / ${up.version}\n\\___/_//_/ .__/\\___/_/\\_. / \n / / / /\n\n`;let n="";up.migrate.loaded||(n+="Load unpoly-migrate.js to enable deprecated APIs.\n\n"),t.enabled?n+="Call `up.log.disable()` to disable logging for this session.":n+="Call `up.log.enable()` to enable logging for this session.";const r="color: #777777";t.format?console.log("%c"+e+"%c"+n,"font-family: monospace;"+r,r):console.log(e+n)})),up.on("up:framework:reset",(function(){t.reset()})),{puts:function(...n){t.enabled&&e("log",...n)},putsEvent:function(e){if(t.enabled){let t="#5566cc";n("log",(e=e.originalEvent||e).type,`color: white; border-color: ${t}; background-color: ${t}`,"Interaction on %o",e.target)}},error:(...t)=>e("error",...t),warn:(...t)=>e("warn",...t),config:t,enable:function(){t.enabled=!0},disable:function(){t.enabled=!1}}}(),up.puts=up.log.puts,up.warn=up.log.warn},6535:()=>{up.migrate={config:{}}},8374:()=>{up.mockable=function(t){let e;const n=function(){return(e||t).apply(null,arguments)};return n.mock=()=>e=jasmine.createSpy("mockable",t),document.addEventListener("up:framework:reset",(()=>e=null)),n}},4034:function(){var t=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,s){function o(t){try{u(r.next(t))}catch(t){s(t)}}function a(t){try{u(r.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}u((r=r.apply(t,e||[])).next())}))};up.motion=function(){const e=up.util,n=up.element;let r={},i={};const s=new up.MotionController("motion"),o=new up.Config((()=>({duration:175,easing:"ease",enabled:!matchMedia("(prefers-reduced-motion: reduce)").matches})));function a(t){return e.pickBy(t,(t=>t.isDefault))}function u(){return o.enabled}function l(t,e,r){return p(r),u()&&!v(e)&&r.duration>0&&!n.isSingleton(t)}function c(t,e,n){return n=Object.assign(Object.assign({},n),{finishEvent:s.finishEvent}),new up.CSSTransition(t,e,n).start()}function p(t){t.easing||(t.easing=o.easing),t.duration||(t.duration=o.duration)}function h(t){if(!v(t)){if(e.isFunction(t))return t;if(e.isArray(t))return d(...t);if(!e.isString(t))return up.fail("Unknown transition %o",t);{let e;if(t.indexOf("/")>=0)return d(...t.split("/"));if(e=i[t])return h(e)}}}function d(t,n){if(!v(t)&&!v(n)){const r=f(t)||e.asyncNoop,i=f(n)||e.asyncNoop;return(t,e,n)=>Promise.all([r(t,n),i(e,n)])}}function f(t){return v(t)?void 0:e.isFunction(t)?t:e.isString(t)?r[n=t]||up.fail("Unknown animation %o",n):e.isOptions(t)?(e,n)=>c(e,t,n):up.fail("Unknown animation %o",t);var n}const m=up.mockable((function(t,e){t.replaceWith(e)}));function g(t,e){const n=h(e);n.isDefault=up.framework.evaling,i[t]=n}function y(t,e){const n=f(e);n.isDefault=up.framework.evaling,r[t]=n}function v(t){return!t||"none"===t}function b(t,e,r){y(t,(function(t,i){return t.style.opacity=0,n.setStyle(t,{opacity:e}),c(t,{opacity:r},i)}))}function w(t,e){return{transform:`translate(${t}px, ${e}px)`}}function k(t){return n.setStyle(t,w(0,0)),t.getBoundingClientRect()}function O(t,e){const r=`move-from-${t}`;y(`move-to-${t}`,(function(t,n){const r=k(t);return c(t,e(r),n)})),y(r,(function(t,r){const i=k(t),s=e(i);return n.setStyle(t,s),c(t,w(0,0),r)}))}return up.on("up:framework:boot",(function(){u()||up.puts("up.motion","Animations are disabled")})),b("fade-in",0,1),b("fade-out",1,0),O("top",(function(t){return w(0,-(t.top+t.height))})),O("bottom",(function(t){return w(0,up.viewport.rootHeight()-t.top)})),O("left",(function(t){return w(-(t.left+t.width),0)})),O("right",(function(t){return w(up.viewport.rootWidth()-t.left,0)})),g("cross-fade",["fade-out","fade-in"]),g("move-left",["move-to-left","move-from-right"]),g("move-right",["move-to-right","move-from-left"]),g("move-up",["move-to-top","move-from-bottom"]),g("move-down",["move-to-bottom","move-from-top"]),up.on("up:framework:reset",(function(){s.reset(),r=a(r),i=a(i),o.reset()})),{morph:function(r,i,o,a){p(a=e.options(a)),r=up.fragment.get(r),i=up.fragment.get(i);const u=h(o),c=l(r,u,a),d=e.pluckKey(a,"beforeStart")||e.noop,f=e.pluckKey(a,"afterInsert")||e.noop,g=e.pluckKey(a,"beforeDetach")||e.noop,y=e.pluckKey(a,"afterDetach")||e.noop,v=e.pluckKey(a,"scrollNew")||e.noop;if(d(),c){if(s.isActive(r)&&!1===a.trackMotion)return u(r,i,a);up.puts("up.morph()","Morphing %o to %o with transition %O",r,i,o);const e=up.viewport.get(r),l=e.scrollTop,c=up.viewport.absolutize(r,{afterMeasure(){n.insertBefore(r,i),f()}}),p=function(){return t(this,void 0,void 0,(function*(){v();const t=e.scrollTop;c.moveBounds(0,t-l),yield u(r,i,a),g(),c.bounds.remove(),y()}))};return s.startFunction([r,i],p,a)}return g(),m(r,i),f(),y(),v(),Promise.resolve()},animate:function(t,r,i){t=up.fragment.get(t),i=e.options(i);const o=f(r);if(l(t,r,i)){const e=()=>o(t,i);return s.startFunction(t,e,i)}return function(t,r){return e.isOptions(r)&&n.setStyle(t,r),Promise.resolve()}(t,r)},finish:function(t){return s.finish(t)},finishCount:()=>s.finishCount,transition:g,animation:y,config:o,isEnabled:u,isNone:v,willAnimate:l,swapElementsDirectly:m}}(),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(2903);const r=up.util;up.network=function(){const t=new up.Config((()=>({concurrency:()=>s()?3:6,wrapMethod:!0,cacheSize:70,cacheExpireAge:15e3,cacheEvictAge:54e5,badDownlink:.6,badRTT:750,badResponseTime:400,fail:t=>(t.status<200||t.status>299)&&304!==t.status,autoCache:t=>t.isSafe(),expireCache:(t,e)=>!t.isSafe(),evictCache:!1,requestMetaKeys:["target","failTarget","mode","failMode","context","failContext"],progressBar:!0,timeout:9e4}))),e=new up.Request.Queue,n=new up.Request.Cache;let i=null;function s(){let e=navigator.connection;if(e)return e.rtt&&e.rtt>t.badRTT||e.downlink&&e.downlink<t.badDownlink}function o(...t){var n,r;null===(r=(n=up.migrate).preprocessAbortArgs)||void 0===r||r.call(n,t),e.abort(...t)}return up.on("up:network:late",(function(){r.evalOption(t.progressBar)&&(i=new up.ProgressBar)})),up.on("up:network:recover",(function(){null==i||i.conclude()})),up.on("up:framework:reset",(function(){o(),e.reset(),t.reset(),n.evict(),null==i||i.destroy(),i=null})),{request:function(...i){const s=function(t){var e,n;const i=r.extractOptions(t);return i.url||(i.url=t[0]),null===(n=(e=up.migrate).handleRequestOptions)||void 0===n||n.call(e,i),i}(i),o=new up.Request(s);return function(t){let r;if(t.willCache()&&(r=n.get(t)))return up.puts("up.request()","Re-using previous request to %s %s",t.method,t.url),t.preload||e.promoteToForeground(r),t.followState(r),t.fromCache=!0,!0}(o)||function(i){i.preload&&!i.isSafe()&&up.fail("Will not preload request to %s",i.description),function(e){e.willCache()&&n.set(e,e),r.always(e,(function(i){var s,o,a,u;let l=null!==(o=null!==(s=i.expireCache)&&void 0!==s?s:e.expireCache)&&void 0!==o?o:r.evalOption(t.expireCache,e,i);l&&n.expire(l,{except:e});let c=null!==(u=null!==(a=i.evictCache)&&void 0!==a?a:e.evictCache)&&void 0!==u?u:r.evalOption(t.evictCache,e,i);c&&n.evict(c,{except:e}),n.get(e)&&n.set(e,e),i.ok||n.evict(e)}))}(i),e.asap(i)}(o),o},cache:n,isBusy:function(){return e.isBusy()},isSafeMethod:function(t){return r.contains(["GET","OPTIONS","HEAD"],r.normalizeMethod(t))},config:t,abort:o,registerAliasForRedirect:function(t,e){if(t.cache&&e.url&&t.url!==e.url){const r=t.variant({method:e.method,url:e.url});n.alias(t,r)}},queue:e,shouldReduceRequests:s,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()))},r=function(e,r,i=t.identity){let s=e.getResponseHeader(n(r));if(s)return i(s)};function i(t){return"false"!==t&&t}const s=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",nonceableAttributes:["up-watch","up-on-accepted","up-on-dismissed","up-on-loaded","up-on-rendered","up-on-finished","up-on-error","up-on-offlne"]})));function a(){o.reset()}return up.on("up:framework:reset",a),{config:o,reset:a,locationFromXHR:function(t){return r(t,"location")||t.responseURL},titleFromXHR:function(t){return r(t,"title")},targetFromXHR:function(t){return r(t,"target")},methodFromXHR:function(e){return r(e,"method",t.normalizeMethod)},acceptLayerFromXHR:function(t){return r(t,"acceptLayer",JSON.parse)},contextFromXHR:function(t){return r(t,"context",JSON.parse)},dismissLayerFromXHR:function(t){return r(t,"dismissLayer",JSON.parse)},eventPlansFromXHR:function(t){return r(t,"events",JSON.parse)},expireCacheFromXHR:function(t){var e,n;return r(t,"expireCache")||(null===(n=(e=up.migrate).clearCacheFromXHR)||void 0===n?void 0:n.call(e,t))},evictCacheFromXHR:function(t){return r(t,"evictCache",i)},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:s,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,r=/'nonce-([^']+)'/g;for(;n=r.exec(t);)e.push(n[1])}}return e}}}()},9615:()=>{up.radio=function(){const t=up.util,e=up.element,n=new up.Config((()=>({hungrySelectors:["[up-hungry]"],pollInterval:3e4,stretchPollInterval:t=>t*(up.network.shouldReduceRequests()?2:1),pollEnabled:"auto"})));return up.compiler("[up-poll]",(function(t){up.fragment.isTargetable(t)?up.FragmentPolling.forFragment(t).onPollAttributeObserved():up.warn("[up-poll]","Ignoring untargetable fragment %o",t)})),up.on("up:framework:reset",(function(){n.reset()})),{config:n,hungrySolutions:function({layer:r,history:i,origin:s}){let o=n.hungrySelectors.join(", "),a=up.fragment.all(o,{layer:"any"});return t.filterMap(a,(t=>{let n=up.fragment.tryToTarget(t,{origin:s});if(n){if(!e.booleanAttr(t,"up-if-history")||i)return"any"===e.attr(t,"up-if-layer")||r===up.layer.get(t)?{target:n,element:t}:void 0}else up.warn("[up-hungry]","Ignoring untargetable fragment %o",t)}))},startPolling:function(t,e={}){up.FragmentPolling.forFragment(t).forceStart(e)},stopPolling:function(t){up.FragmentPolling.forFragment(t).forceStop()},pollIssue:function(t){var e,r;let i=n.pollEnabled;if(!1===i)return"User has disabled polling";if("auto"===i){if(document.hidden)return"Tab is hidden";if(!(null===(r=null===(e=up.layer.get(t))||void 0===e?void 0:e.isFront)||void 0===r?void 0:r.call(e)))return"Fragment is on a background layer"}return up.emit(t,"up:fragment:poll",{log:["Polling fragment",t]}).defaultPrevented?"User prevented up:fragment:poll event":void 0}}}()},6774:()=>{!function(){const t=up.element;for(let e of["method","confirm"]){const n=`up-${e}`,r=`data-${e}`;up.macro(`a[${r}]`,(function(e){var i;(window.Rails||(null===(i=window.jQuery)||void 0===i?void 0:i.rails))&&up.link.isFollowable(e)&&(t.setMissingAttr(e,n,e.getAttribute(r)),e.removeAttribute(r))}))}}()},2514:()=>{up.syntax=function(){const t=up.util,e={"[up-back]":-100,"[up-content]":-200,"[up-drawer]":-200,"[up-modal]":-200,"[up-cover]":-200,"[up-popup]":-200,"[up-tooltip]":-200,"[up-dash]":-200,"[up-expand]":-300,"[data-method]":-400,"[data-confirm]":-400};let n=[],r=[];function i(...t){const e=o(t);return a(n,e)}function s(...n){const i=o(n);return up.framework.evaling&&(i.priority||(i.priority=function(n){n=t.evalOption(n);for(let t in e){const r=e[t];if(n.indexOf(t)>=0)return r}}(i.selector)||up.fail("Unregistered priority for system macro %o",i.selector))),a(r,i)}function o(e){let[n,r,i]=function(e){const n=t.extractOptions(e),r=e.shift(),i=e.pop();return[r,Object.assign(Object.assign({},n),t.extractOptions(e)),i]}(e);return r=t.options(r,{selector:n,isDefault:up.framework.evaling,priority:0,batch:!1,jQuery:!1}),Object.assign(i,r)}function a(t,e){let n,r=0;for(;(n=t[r])&&n.priority>=e.priority;)r+=1;if(t.splice(r,0,e),up.framework.booted)if(0===e.priority)for(let t of up.layer.stack)u(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 u(t,e){let i=e.compilers||r.concat(n);new up.CompilerPass(t,i,e).run()}return up.on("up:framework:reset",(function(){n=t.filter(n,"isDefault"),r=t.filter(r,"isDefault")})),{compiler:i,macro:s,$compiler:function(...t){i(...t,{jQuery:!0})},$macro:function(...t){s(...t,{jQuery:!0})},destructor:function(e,n){let r=e.upDestructors;r||(r=[],e.upDestructors=r,e.classList.add("up-can-clean")),t.isArray(n)?r.push(...n):r.push(n)},hello:function(t,{layer:e,data:n,dataMap:r}={}){return t=up.fragment.get(t),up.puts("up.hello()","Compiling fragment %o",t),u(t,{layer:e,data:n,dataMap:r}),up.fragment.emitInserted(t),t},clean:function(t,e={}){new up.DestructorPass(t,e).run()},data:function(e){return(e=up.fragment.get(e)).upData||(e.upData=function(e){if(!e.getAttribute)return{};let n,r=e.getAttribute("up-data");return r&&(n=JSON.parse(r),!t.isOptions(n))?n:Object.assign(Object.assign(Object.assign({},e.dataset),n),e.upCompileData)}(e))}}}(),up.compiler=up.syntax.compiler,up.$compiler=up.syntax.$compiler,up.destructor=up.syntax.destructor,up.macro=up.syntax.macro,up.$macro=up.syntax.$macro,up.data=up.syntax.data,up.hello=up.syntax.hello},7924:()=>{up.util=function(){function t(){}const e={host:"cross-domain"};function n(t,n){n=T(n,e);const r=o(t);let i="";"cross-domain"===n.host&&(n.host=s(r)),n.host&&(i+=r.protocol+"//"+r.host);let{pathname:a}=r;return!1===n.trailingSlash&&"/"!==a&&(a=a.replace(/\/$/,"")),i+=a,!1!==n.search&&(i+=r.search),!1!==n.hash&&(i+=r.hash),i}const r=location.protocol,i=location.hostname;function s(t){if(v(t)&&-1===t.indexOf("//"))return!1;const e=o(t);return i!==e.hostname||r!==e.protocol}function o(t){if(t.pathname)return t;let e=document.createElement("a");return e.href=t,e}function a(t){return v(t)?e=>e[t]:t}function u(t,e){if(0===t.length)return[];e=a(e);let n=[];for(let r=0;r<t.length;r++){let i=t[r];n.push(e(i,r))}return n}function l(t,e){for(let n=0;n<t.length;n++)e(t[n],n)}function c(t){return null===t}function p(t){return void 0===t}const h=Y(p);function d(t){return p(t)||c(t)}const f=Y(d);function m(t){return!!d(t)||(k(t)&&t[m.key]?t[m.key]():v(t)||x(t)?0===t.length:!!w(t)&&0===Object.keys(t).length)}m.key="up.util.isBlank";const g=Y(m);function y(t){return"function"==typeof t}function v(t){return"string"==typeof t||t instanceof String}function b(t){return"number"==typeof t||t instanceof Number}function w(t){return"object"==typeof t&&!c(t)&&(p(t.constructor)||t.constructor===Object)}function k(t){const e=typeof t;return"object"===e&&!c(t)||"function"===e}function O(t){return t instanceof Element}function E(t){return t instanceof RegExp}function S(t){return up.browser.canJQuery()&&t instanceof jQuery}const{isArray:C}=Array;function x(t){return C(t)||function(t){return t instanceof NodeList}(t)||function(t){return"[object Arguments]"===Object.prototype.toString.call(t)}(t)||S(t)||function(t){return t instanceof HTMLCollection}(t)}function R(t){return x(t)?t:d(t)?[]:[t]}function F(t){return k(t)&&t[F.key]?t=t[F.key]():x(t)?t=A(t):w(t)&&(t=Object.assign({},t)),t}function A(t){return Array.prototype.slice.call(t)}function L(...t){return Object.assign({},...t)}function T(t,e){return e?L(e,t):t?F(t):{}}function P(t,e){e=a(e);for(let n=0;n<t.length;n++){const r=e(t[n],n);if(r)return r}}function j(t,e){e=a(e);let n=!0;for(let r=0;r<t.length;r++)if(!e(t[r],r)){n=!1;break}return n}function q(t){return D(t,f)}function D(t,e){e=a(e);const n=[];return l(t,(function(t,r){if(e(t,r))return n.push(t)})),n}function M(t){return t[t.length-1]}function H(t,e){return t.indexOf(e)>=0}function N(t,e){const n={};for(let r of e)r in t&&(n[r]=t[r]);return n}function $(t,e){e=a(e);const n={};for(let r in t)e(t[r],r,t)&&(n[r]=t[r]);return n}function B(t,...e){return y(t)?t(...e):t}F.key="up.util.copy",Date.prototype[F.key]=function(){return new Date(+this)};const z={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"};function U(t,e){const n=t[e];return delete t[e],n}function K(t,e){if(e(M(t)))return t.pop()}function W(t){return K(t,w)||{}}function V(t){const e=[];for(let n of t)x(n)?e.push(...n):e.push(n);return e}function _(t,e){if((null==t?void 0:t.valueOf)&&(t=t.valueOf()),(null==e?void 0:e.valueOf)&&(e=e.valueOf()),typeof t!=typeof e)return!1;if(x(t)&&x(e))return I(t,e);if(k(t)&&t[_.key])return t[_.key](e);if(w(t)&&w(e)){const n=Object.keys(t);return!!I(n,Object.keys(e))&&j(n,(n=>_(t[n],e[n])))}return t===e}function I(t,e){return t.length===e.length&&j(t,((t,n)=>_(t,e[n])))}_.key="up.util.isEqual";const Q={"space/or":/\s+(?:or\s+)?/,or:/\s+or\s+/,comma:/\s*,\s*/};let X=0;function G(t){let e,n="";if(v(t))e=t.replace(/[\n\r\t ]+/g," "),e=e.replace(/^[\n\r\t ]+/,""),e=e.replace(/[\n\r\t ]$/,"");else if(p(t))e="undefined";else if(b(t)||y(t))e=t.toString();else if(C(t))e=`[${u(t,G).join(", ")}]`,n="]";else if(S(t))e=`$(${u(t,G).join(", ")})`,n=")";else if(O(t)){e=`<${t.tagName.toLowerCase()}`;for(let n of["id","name","class"]){let r=t.getAttribute(n);r&&(e+=` ${n}="${r}"`)}e+=">",n=">"}else if(E(t))e=t.toString();else try{e=JSON.stringify(t)}catch(t){if("TypeError"!==t.name)throw t;e="(circular structure)"}return e.length>200&&(e=`${e.substr(0,200)} …`,e+=n),e}const J=/%[oOdisf]/g;function Y(t){return function(...e){return!t(...e)}}function Z(t){if(t.error)throw t.error;return t.value}function tt(t,e,n){try{return{value:t.apply(e,n)}}catch(t){return{error:t}}}return{parseURL:o,normalizeURL:n,matchURLs:function(t,e){return n(t)===n(e)},normalizeMethod:function(t){return t?t.toUpperCase():"GET"},methodAllowsPayload:function(t){return"GET"!==t&&"HEAD"!==t},copy:F,copyArrayLike:A,merge:L,mergeDefined:function(...t){const e={};for(let n of t)if(n)for(let t in n){const r=n[t];h(r)&&(e[t]=r)}return e},options:T,parseArgIntoOptions:function(t,e){let n=W(t);return h(t[0])&&(n=F(n),n[e]=t[0]),n},each:l,map:u,flatMap:function(t,e){return V(u(t,e))},mapObject:function(t,e){return u(t,e).reduce((function(t,e){return t[e[0]]=e[1],t}),{})},findResult:P,some:function(t,e){return!!P(t,e)},every:j,find:function(t,e){let n;e=a(e);for(let r of t)if(e(r)){n=r;break}return n},filter:D,filterMap:function(t,e){return D(u(t,e),h)},reject:function(t,e){return D(t,e=Y(a(e)))},intersect:function(t,e){return D(t,(t=>H(e,t)))},compact:q,compactObject:function(t){return $(t,f)},uniq:function(t){return t.length<2?t:Array.from(new Set(t))},uniqBy:function(t,e){if(t.length<2)return t;e=a(e);const n=new Set;return D(t,(function(t,r){const i=e(t,r);return!n.has(i)&&(n.add(i),!0)}))},last:M,isNull:c,isDefined:h,isUndefined:p,isGiven:f,isMissing:d,isPresent:g,isBlank:m,presence:function(t,e=g){if(e(t))return t},isObject:k,isFunction:y,isString:v,isBoolean:function(t){return"boolean"==typeof t||t instanceof Boolean},isNumber:b,isElement:O,isJQuery:S,isElementish:function(t){var e;return!(!t||!t.addEventListener&&!(null===(e=t[0])||void 0===e?void 0:e.addEventListener))},isPromise:function(t){return k(t)&&y(t.then)},isOptions:w,isArray:C,isFormData:function(t){return t instanceof FormData},isList:x,isRegExp:E,timer:function(t,e){return setTimeout(e,t)},contains:H,objectContains:function(t,e){return _(e,N(t,Object.keys(e)))},toArray:function(t){return C(t)?t:A(t)},pick:N,pickBy:$,omit:function(t,e){return $(t,((t,n)=>!H(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(...r){return n?e:(n=!0,e=t.apply(this,r))}},pluckKey:U,renameKey:function(t,e,n){return t[n]=U(t,e)},extractOptions:W,extractCallback:function(t){return K(t,y)},noop:t,asyncNoop:function(){return Promise.resolve()},identity:function(t){return t},escapeHTML:function(t){return t.replace(/[&<>"']/g,(t=>z[t]))},escapeRegExp:function(t){return t.replace(/[\\^$*+?.()|[\]{}]/g,"\\$&")},sequence:function(t){return t=q(t),(...e)=>u(t,(t=>t(...e)))},evalOption:B,evalAutoOption:function(t,e,...n){return"auto"===(t=B(t,...n))&&(t=B(e,...n)),t},flatten:V,newDeferred:function(){let t,e;const n=new Promise((function(n,r){t=n,e=r}));return n.resolve=t,n.reject=e,n},always:function(t,e){return t.then(e,e)},isBasicObjectProperty:function(t){return Object.prototype.hasOwnProperty(t)},isCrossOrigin:s,task:function(t){return setTimeout(t)},microtask:function(t){return Promise.resolve().then(t)},isEqual:_,parseTokens:function(t,e={}){if(v(t)){if(t=t.trim(),e.json&&/^\[.*]$/.test(t))return JSON.parse(t);{let n=e.separator||"space/or",r=Q[n];return t.split(r)}}return R(t)},wrapList:R,wrapValue:function(t,...e){return e[0]instanceof t?e[0]:new t(...e)},uid:function(){return X++},upperCaseFirst:function(t){return t[0].toUpperCase()+t.slice(1)},lowerCaseFirst:function(t){return t[0].toLowerCase()+t.slice(1)},getter:function(t,e,n){Object.defineProperty(t,e,{get:n})},delegate:function(t,e,n){R(e).forEach((function(e){Object.defineProperty(t,e,{get(){const t=n.call(this);let r=t[e];return y(r)&&(r=r.bind(t)),r},set(t){n.call(this)[e]=t}})}))},reverse:function(t){return F(t).reverse()},camelToKebabCase:function(t){return t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))},nullToUndefined:function(t){if(!c(t))return t},sprintf:function(t,...e){return t.replace(J,(()=>G(e.shift())))},renameKeys:function(t,e){const n={};for(let r in t)n[e(r)]=t[r];return n},negate:Y,memoizeMethod:function(t,e){for(let n of R(e)){let e=t[n];t[n]=function(...t){var r;let i=this[r=`__${n}MemoizeCache`]||(this[r]={}),s=JSON.stringify(t);return i[s]||(i[s]=tt(e,this,t)),Z(i[s])}}}}}()},4606:(t,e,n)=>{n(573),up.viewport=function(){const t=up.util,e=up.element,n=up.fragment,r=new up.Config((()=>({viewportSelectors:["[up-viewport]","[up-fixed]"],fixedTop:["[up-fixed~=top]"],fixedBottom:["[up-fixed~=bottom]"],anchoredRight:["[up-anchored~=right]","[up-fixed~=top]","[up-fixed~=bottom]","[up-fixed~=right]"],revealSnap:200,revealPadding:0,revealTop:!1,revealMax:()=>.5*window.innerHeight})));function i(e,r){var i,s;return r=t.options(r),e=n.get(e,r),(r.layer=up.layer.get(e))||up.fail("Cannot reveal a detached element"),r.peel&&r.layer.peel(),new up.RevealMotion(e,r).start(),(null===(s=(i=up.migrate).formerlyAsync)||void 0===s?void 0:s.call(i,"up.reveal()"))||!0}function s(t,e={}){if(e.force&&function(t){t.hasAttribute("tabindex")||-1!==t.tabIndex||(t.setAttribute("tabindex","-1"),t.classList.add("up-focusable-content"))}(t),t.focus({preventScroll:!0}),!e.preventScroll)return i(t)}function o(t=location.hash,e){let n=g(t,e);if(n)return up.reveal(n,{top:!0})}function a(){return[c().tagName,...r.viewportSelectors].join(",")}function u(t,e={}){return n.get(t,e).closest(a())}function l(t,r={}){return t=n.get(t,r),e.around(t,a())}function c(){return document.scrollingElement}function p(t){const n=e.style(t,"overflow-y");return"auto"===n||"scroll"===n}const h=t.memoize((function(){const t=up.element.affix(document.body,"[up-viewport]",{style:{position:"absolute",top:"0",left:"0",width:"100px",height:"100px",overflowY:"scroll"}}),e=t.offsetWidth-t.clientWidth;return t.remove(),e}));function d(t){return up.fragment.tryToTarget(t)}function f(e){const r=t.copy(t.extractOptions(e));let i;return r.layer=up.layer.get(r),i=e[0]?[u(e[0],r)]:r.around?l(r.around,r):function(t={}){return n.all(a(),t)}(r),[i,r]}function m(t,e){for(let n of t){const t=d(n);n.scrollTop=e[t]||0}}function g(t,r={}){if(t=null==(i=t)?void 0:i.replace(/^#/,"")){const i=[e.attrSelector("id",t),"a"+e.attrSelector("name",t)].join(",");return n.get(i,r)}var i}const y=["selectionStart","selectionEnd","scrollLeft","scrollTop"];let v=!1;return up.on("scroll",{once:!0,beforeBoot:!0},(()=>v=!0)),up.on("up:framework:boot",(function(){t.task((function(){if(!v)return o()}))})),up.on(window,"hashchange",(()=>o())),up.on("up:framework:reset",(function(){r.reset()})),{reveal:i,revealHash:o,firstHashTarget:g,config:r,get:u,subtree:function(t,r={}){return t=n.get(t,r),e.subtree(t,a())},around:l,get root(){return c()},rootWidth:function(){return e.root.clientWidth},rootHeight:function(){return e.root.clientHeight},rootHasReducedWidthFromScrollbar:function(){return window.innerWidth>document.documentElement.offsetWidth},rootOverflowElement:function(){const{body:e}=document,n=document.documentElement;return t.find([n,e],p)||c()},isRoot:function(t){return t===c()},scrollbarWidth:h,saveScroll:function(...t){const[e,n]=f(t),r=n.location||n.layer.location;if(r){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(r,t)}},restoreScroll:function(...t){const[e,n]=f(t),{location:r}=n.layer,i=n.layer.lastScrollTops.get(r);return!!i&&(m(e,i),up.puts("up.viewport.restoreScroll()","Restored scroll positions to %o",i),!0)},resetScroll:function(...t){const[e,n]=f(t);m(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,r=t.layer.lastFocusCapsules.get(n);return!(!r||!r.restore(e)||(up.puts("up.viewport.restoreFocus()",'Restored focus to "%s"',r.target),0))},anchoredRight:function(){const t=r.anchoredRight.join(",");return n.all(t,{layer:"root"})},absolutize:function(n,i={}){var s;const o=u(n).getBoundingClientRect(),a=n.getBoundingClientRect(),l=new up.Rect({left:a.left-o.left,top:a.top-o.top,width:a.width,height:a.height});null===(s=i.afterMeasure)||void 0===s||s.call(i),e.setStyle(n,{position:"static"===n.style.position?"static":"relative",top:"auto",right:"auto",bottom:"auto",left:"auto",width:"100%",height:"100%"});const c=e.createFromSelector("up-bounds");e.insertBefore(n,c),c.appendChild(n);const p=function(t,n){return l.left+=t,l.top+=n,e.setStyle(c,l)};p(0,0);const h=n.getBoundingClientRect();return p(a.left-h.left,a.top-h.top),t.each(function(t=document){const e=["[up-fixed]"].concat(r.fixedTop).concat(r.fixedBottom);return t.querySelectorAll(e.join(","))}(n),e.fixedToAbsolute),{bounds:c,moveBounds:p}},focus:s,tryFocus:function(t,e){return s(t,e),t===document.activeElement},newStateCache:function(){return new up.Cache({size:30,key:up.history.normalizeURL})},focusedElementWithin:function(t){const n=document.activeElement;if(e.isInSubtree(t,n))return n},copyCursorProps:function(t,e={}){for(let n of y)try{e[n]=t[n]}catch(t){}return e}}}(),up.focus=up.viewport.focus,up.reveal=up.viewport.reveal},3507:()=>{window.up={version:"3.0.0-rc1"}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n(3507),n(8374),n(7924),n(3924),n(6535),n(2811),n(9675),n(376),n(8272),n(4366),n(5485),n(8010),n(4861),n(3469),n(4504),n(2406),n(3742),n(1653),n(3115),n(1279),n(6346),n(3030),n(7948),n(2714),n(1752),n(8228),n(7050),n(9441),n(7422),n(9005),n(2200),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(6267),n(7956),n(7403),n(6412),n(7965),n(7771),n(86),n(4552),n(5580),n(7101),n(6066),n(6387),n(5390),n(2618),n(7792),n(4308),n(1104),n(8665),n(3645),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(2514),n(8944),n(2667),n(4606),n(4034),n(1647),n(9443),n(3849),n(2851),n(454),n(9615),n(6774),up.framework.onEvaled()})();