shift73k/priv/static/assets/app-e94dbfbd324cca1ea4e492e0a02b9cf8.js

83 lines
147 KiB
JavaScript

(function(){var e=t();function t(){if(typeof window.CustomEvent=="function")return window.CustomEvent;function r(s,o){o=o||{bubbles:!1,cancelable:!1,detail:void 0};var a=document.createEvent("CustomEvent");return a.initCustomEvent(s,o.bubbles,o.cancelable,o.detail),a}return r.prototype=window.Event.prototype,r}function i(r,s){var o=document.createElement("input");return o.type="hidden",o.name=r,o.value=s,o}function n(r,s){var o=r.getAttribute("data-to"),a=i("_method",r.getAttribute("data-method")),l=i("_csrf_token",r.getAttribute("data-csrf")),h=document.createElement("form"),d=r.getAttribute("target");h.method=r.getAttribute("data-method")==="get"?"get":"post",h.action=o,h.style.display="hidden",d?h.target=d:s&&(h.target="_blank"),h.appendChild(l),h.appendChild(a),document.body.appendChild(h),h.submit()}window.addEventListener("click",function(r){var s=r.target;if(!r.defaultPrevented)for(;s&&s.getAttribute;){var o=new e("phoenix.link.click",{bubbles:!0,cancelable:!0});if(!s.dispatchEvent(o))return r.preventDefault(),r.stopImmediatePropagation(),!1;if(s.getAttribute("data-method"))return n(s,r.metaKey||r.shiftKey),r.preventDefault(),!1;s=s.parentNode}},!1),window.addEventListener("phoenix.link.click",function(r){var s=r.target.getAttribute("data-confirm");s&&!window.confirm(s)&&r.preventDefault()},!1)})();var tt=e=>typeof e=="function"?e:function(){return e},sr=typeof self<"u"?self:null,et=typeof window<"u"?window:null,it=sr||et||it,or="2.0.0",Ee={connecting:0,open:1,closing:2,closed:3},ar=1e4,lr=1e3,oe={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},Ce={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},ii={longpoll:"longpoll",websocket:"websocket"},cr={complete:4},pt=class{constructor(e,t,i,n){this.channel=e,this.event=t,this.payload=i||function(){return{}},this.receivedResp=null,this.timeout=n,this.timeoutTimer=null,this.recHooks=[],this.sent=!1}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}matchReceive({status:e,response:t,_ref:i}){this.recHooks.filter(n=>n.status===e).forEach(n=>n.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},Cn=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=null,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},hr=class{constructor(e,t,i){this.state=oe.closed,this.topic=e,this.params=tt(t||{}),this.socket=i,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new pt(this,Ce.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new Cn(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=oe.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(n=>n.send()),this.pushBuffer=[]}),this.joinPush.receive("error",()=>{this.state=oe.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic} ${this.joinRef()}`),this.state=oe.closed,this.socket.remove(this)}),this.onError(n=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.isJoining()&&this.joinPush.reset(),this.state=oe.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic} (${this.joinRef()})`,this.joinPush.timeout),new pt(this,Ce.leave,tt({}),this.timeout).send(),this.state=oe.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(Ce.reply,(n,r)=>{this.trigger(this.replyEventName(r),n)})}join(e=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}onClose(e){this.on(Ce.close,e)}onError(e){return this.on(Ce.error,t=>e(t))}on(e,t){let i=this.bindingRef++;return this.bindings.push({event:e,ref:i,callback:t}),i}off(e,t){this.bindings=this.bindings.filter(i=>!(i.event===e&&(typeof t>"u"||t===i.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,i=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let n=new pt(this,e,function(){return t},i);return this.canPush()?n.send():(n.startTimeout(),this.pushBuffer.push(n)),n}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=oe.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(Ce.close,"leave")},i=new pt(this,Ce.leave,tt({}),e);return i.receive("ok",()=>t()).receive("timeout",()=>t()),i.send(),this.canPush()||i.trigger("ok",{}),i}onMessage(e,t,i){return t}isMember(e,t,i,n){return this.topic!==e?!1:n&&n!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:i,joinRef:n}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=oe.joining,this.joinPush.resend(e))}trigger(e,t,i,n){let r=this.onMessage(e,t,i,n);if(t&&!r)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let s=this.bindings.filter(o=>o.event===e);for(let o=0;o<s.length;o++)s[o].callback(r,i,n||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===oe.closed}isErrored(){return this.state===oe.errored}isJoined(){return this.state===oe.joined}isJoining(){return this.state===oe.joining}isLeaving(){return this.state===oe.leaving}},kt=class{static request(e,t,i,n,r,s,o){if(it.XDomainRequest){let a=new it.XDomainRequest;return this.xdomainRequest(a,e,t,n,r,s,o)}else{let a=new it.XMLHttpRequest;return this.xhrRequest(a,e,t,i,n,r,s,o)}}static xdomainRequest(e,t,i,n,r,s,o){return e.timeout=r,e.open(t,i),e.onload=()=>{let a=this.parseJSON(e.responseText);o&&o(a)},s&&(e.ontimeout=s),e.onprogress=()=>{},e.send(n),e}static xhrRequest(e,t,i,n,r,s,o,a){return e.open(t,i,!0),e.timeout=s,e.setRequestHeader("Content-Type",n),e.onerror=()=>a&&a(null),e.onreadystatechange=()=>{if(e.readyState===cr.complete&&a){let l=this.parseJSON(e.responseText);a(l)}},o&&(e.ontimeout=o),e.send(r),e}static parseJSON(e){if(!e||e==="")return null;try{return JSON.parse(e)}catch{return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let i=[];for(var n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let r=t?`${t}[${n}]`:n,s=e[n];typeof s=="object"?i.push(this.serialize(s,r)):i.push(encodeURIComponent(r)+"="+encodeURIComponent(s))}return i.join("&")}static appendParams(e,t){if(Object.keys(t).length===0)return e;let i=e.match(/\?/)?"&":"?";return`${e}${i}${this.serialize(t)}`}},Kt=class{constructor(e){this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=Ee.connecting,this.poll()}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+ii.websocket),"$1/"+ii.longpoll)}endpointURL(){return kt.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,i){this.close(e,t,i),this.readyState=Ee.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===Ee.open||this.readyState===Ee.connecting}poll(){this.ajax("GET",null,()=>this.ontimeout(),e=>{if(e){var{status:t,token:i,messages:n}=e;this.token=i}else t=0;switch(t){case 200:n.forEach(r=>{setTimeout(()=>this.onmessage({data:r}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=Ee.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${t}`)}})}send(e){this.ajax("POST",e,()=>this.onerror("timeout"),t=>{(!t||t.status!==200)&&(this.onerror(t&&t.status),this.closeAndRetry(1011,"internal server error",!1))})}close(e,t,i){for(let r of this.reqs)r.abort();this.readyState=Ee.closed;let n=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:i});typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",n)):this.onclose(n)}ajax(e,t,i,n){let r,s=()=>{this.reqs.delete(r),i()};r=kt.request(e,this.endpointURL(),"application/json",t,this.timeout,s,o=>{this.reqs.delete(r),this.isActive()&&n(o)}),this.reqs.add(r)}},gt={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let i=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(i))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[i,n,r,s,o]=JSON.parse(e);return t({join_ref:i,ref:n,topic:r,event:s,payload:o})}},binaryEncode(e){let{join_ref:t,ref:i,event:n,topic:r,payload:s}=e,o=this.META_LENGTH+t.length+i.length+r.length+n.length,a=new ArrayBuffer(this.HEADER_LENGTH+o),l=new DataView(a),h=0;l.setUint8(h++,this.KINDS.push),l.setUint8(h++,t.length),l.setUint8(h++,i.length),l.setUint8(h++,r.length),l.setUint8(h++,n.length),Array.from(t,c=>l.setUint8(h++,c.charCodeAt(0))),Array.from(i,c=>l.setUint8(h++,c.charCodeAt(0))),Array.from(r,c=>l.setUint8(h++,c.charCodeAt(0))),Array.from(n,c=>l.setUint8(h++,c.charCodeAt(0)));var d=new Uint8Array(a.byteLength+s.byteLength);return d.set(new Uint8Array(a),0),d.set(new Uint8Array(s),a.byteLength),d.buffer},binaryDecode(e){let t=new DataView(e),i=t.getUint8(0),n=new TextDecoder;switch(i){case this.KINDS.push:return this.decodePush(e,t,n);case this.KINDS.reply:return this.decodeReply(e,t,n);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,n)}},decodePush(e,t,i){let n=t.getUint8(1),r=t.getUint8(2),s=t.getUint8(3),o=this.HEADER_LENGTH+this.META_LENGTH-1,a=i.decode(e.slice(o,o+n));o=o+n;let l=i.decode(e.slice(o,o+r));o=o+r;let h=i.decode(e.slice(o,o+s));o=o+s;let d=e.slice(o,e.byteLength);return{join_ref:a,ref:null,topic:l,event:h,payload:d}},decodeReply(e,t,i){let n=t.getUint8(1),r=t.getUint8(2),s=t.getUint8(3),o=t.getUint8(4),a=this.HEADER_LENGTH+this.META_LENGTH,l=i.decode(e.slice(a,a+n));a=a+n;let h=i.decode(e.slice(a,a+r));a=a+r;let d=i.decode(e.slice(a,a+s));a=a+s;let c=i.decode(e.slice(a,a+o));a=a+o;let g=e.slice(a,e.byteLength),u={status:c,response:g};return{join_ref:l,ref:h,topic:d,event:Ce.reply,payload:u}},decodeBroadcast(e,t,i){let n=t.getUint8(1),r=t.getUint8(2),s=this.HEADER_LENGTH+2,o=i.decode(e.slice(s,s+n));s=s+n;let a=i.decode(e.slice(s,s+r));s=s+r;let l=e.slice(s,e.byteLength);return{join_ref:null,ref:null,topic:o,event:a,payload:l}}},dr=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.timeout=t.timeout||ar,this.transport=t.transport||it.WebSocket||Kt,this.establishedConnections=0,this.defaultEncoder=gt.encode.bind(gt),this.defaultDecoder=gt.decode.bind(gt),this.closeWasClean=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.transport!==Kt?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let i=null;et&&et.addEventListener&&(et.addEventListener("pagehide",n=>{this.conn&&(this.disconnect(),i=this.connectClock)}),et.addEventListener("pageshow",n=>{i===this.connectClock&&(i=null,this.connect())})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.rejoinAfterMs=n=>t.rejoinAfterMs?t.rejoinAfterMs(n):[1e3,2e3,5e3][n-1]||1e4,this.reconnectAfterMs=n=>t.reconnectAfterMs?t.reconnectAfterMs(n):[10,50,100,150,200,250,500,1e3,2e3][n-1]||5e3,this.logger=t.logger||null,this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=tt(t.params||{}),this.endPoint=`${e}/${ii.websocket}`,this.vsn=t.vsn||or,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new Cn(()=>{this.teardown(()=>this.connect())},this.reconnectAfterMs)}getLongPollTransport(){return Kt}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,this.reconnectTimer.reset(),this.sendBuffer=[],this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=kt.appendParams(kt.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)!=="/"?e:e.charAt(1)==="/"?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,i){this.connectClock++,this.closeWasClean=!0,this.reconnectTimer.reset(),this.teardown(e,t,i)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=tt(e)),!this.conn&&(this.connectClock++,this.closeWasClean=!1,this.conn=new this.transport(this.endPointURL()),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=t=>this.onConnError(t),this.conn.onmessage=t=>this.onConnMessage(t),this.conn.onclose=t=>this.onConnClose(t))}log(e,t,i){this.logger(e,t,i)}hasLogger(){return this.logger!==null}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),i=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let n=this.onMessage(r=>{r.ref===t&&(this.off([n]),e(Date.now()-i))});return!0}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.resetHeartbeat(),this.stateChangeCallbacks.open.forEach(([,e])=>e())}heartbeatTimeout(){this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection"),this.triggerChanError(),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),lr,"heartbeat timeout"))}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,i){if(!this.conn)return e&&e();this.waitForBufferDone(()=>{this.conn&&(t?this.conn.close(t,i||""):this.conn.close()),this.waitForSocketClosed(()=>{this.conn&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,t=1){if(t===5||!this.conn||!this.conn.bufferedAmount){e();return}setTimeout(()=>{this.waitForBufferDone(e,t+1)},150*t)}waitForSocketClosed(e,t=1){if(t===5||!this.conn||this.conn.readyState===Ee.closed){e();return}setTimeout(()=>{this.waitForSocketClosed(e,t+1)},150*t)}onConnClose(e){let t=e&&e.code;this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(),this.clearHeartbeats(),!this.closeWasClean&&t!==1e3&&this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(([,i])=>i(e))}onConnError(e){this.hasLogger()&&this.log("transport",e);let t=this.transport,i=this.establishedConnections;this.stateChangeCallbacks.error.forEach(([,n])=>{n(e,t,i)}),(t===this.transport||i>0)&&this.triggerChanError()}triggerChanError(){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(Ce.error)})}connectionState(){switch(this.conn&&this.conn.readyState){case Ee.connecting:return"connecting";case Ee.open:return"open";case Ee.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t.joinRef()!==e.joinRef())}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([i])=>e.indexOf(i)===-1)}channel(e,t={}){let i=new hr(e,t,this);return this.channels.push(i),i}push(e){if(this.hasLogger()){let{topic:t,event:i,payload:n,ref:r,join_ref:s}=e;this.log("push",`${t} ${i} (${s}, ${r})`,n)}this.isConnected()?this.encode(e,t=>this.conn.send(t)):this.sendBuffer.push(()=>this.encode(e,t=>this.conn.send(t)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){this.pendingHeartbeatRef&&!this.isConnected()||(this.pendingHeartbeatRef=this.makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs))}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,t=>{let{topic:i,event:n,payload:r,ref:s,join_ref:o}=t;s&&s===this.pendingHeartbeatRef&&(this.clearHeartbeats(),this.pendingHeartbeatRef=null,this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)),this.hasLogger()&&this.log("receive",`${r.status||""} ${i} ${n} ${s&&"("+s+")"||""}`,r);for(let a=0;a<this.channels.length;a++){const l=this.channels[a];l.isMember(i,n,r,o)&&l.trigger(n,r,s,o)}for(let a=0;a<this.stateChangeCallbacks.message.length;a++){let[,l]=this.stateChangeCallbacks.message[a];l(t)}})}leaveOpenTopic(e){let t=this.channels.find(i=>i.topic===e&&(i.isJoined()||i.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}},Z=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ur(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var i=function n(){if(this instanceof n){var r=[null];r.push.apply(r,arguments);var s=Function.bind.apply(t,r);return new s}return t.apply(this,arguments)};i.prototype=t.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(i,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}),i}var ni={},fr={get exports(){return ni},set exports(e){ni=e}};/**
* @license MIT
* topbar 1.0.0, 2021-01-06
* http://buunguyen.github.io/topbar
* Copyright (c) 2021 Buu Nguyen
*/(function(e){(function(t,i){(function(){for(var c=0,g=["ms","moz","webkit","o"],u=0;u<g.length&&!t.requestAnimationFrame;++u)t.requestAnimationFrame=t[g[u]+"RequestAnimationFrame"],t.cancelAnimationFrame=t[g[u]+"CancelAnimationFrame"]||t[g[u]+"CancelRequestAnimationFrame"];t.requestAnimationFrame||(t.requestAnimationFrame=function(v,m){var y=new Date().getTime(),S=Math.max(0,16-(y-c)),N=t.setTimeout(function(){v(y+S)},S);return c=y+S,N}),t.cancelAnimationFrame||(t.cancelAnimationFrame=function(v){clearTimeout(v)})})();function n(){r.width=t.innerWidth,r.height=5*h.barThickness;var c=r.getContext("2d");c.shadowBlur=h.shadowBlur,c.shadowColor=h.shadowColor;var g,u=c.createLinearGradient(0,0,r.width,0);for(g in h.barColors)u.addColorStop(g,h.barColors[g]);c.lineWidth=h.barThickness,c.beginPath(),c.moveTo(0,h.barThickness/2),c.lineTo(Math.ceil(a*r.width),h.barThickness/2),c.strokeStyle=u,c.stroke()}var r,s,o,a,l,h={autoRun:!0,barThickness:3,barColors:{0:"rgba(26, 188, 156, .9)",".25":"rgba(52, 152, 219, .9)",".50":"rgba(241, 196, 15, .9)",".75":"rgba(230, 126, 34, .9)","1.0":"rgba(211, 84, 0, .9)"},shadowBlur:10,shadowColor:"rgba(0, 0, 0, .6)",className:null},d={config:function(c){for(var g in c)h.hasOwnProperty(g)&&(h[g]=c[g])},show:function(){var c,g,u;l||(l=!0,o!==null&&t.cancelAnimationFrame(o),r||((u=(r=i.createElement("canvas")).style).position="fixed",u.top=u.left=u.right=u.margin=u.padding=0,u.zIndex=100001,u.display="none",h.className&&r.classList.add(h.className),i.body.appendChild(r),c="resize",g=n,(u=t).addEventListener?u.addEventListener(c,g,!1):u.attachEvent?u.attachEvent("on"+c,g):u["on"+c]=g),r.style.opacity=1,r.style.display="block",d.progress(0),h.autoRun&&function v(){s=t.requestAnimationFrame(v),d.progress("+"+.05*Math.pow(1-Math.sqrt(a),2))}())},progress:function(c){return c===void 0||(typeof c=="string"&&(c=(0<=c.indexOf("+")||0<=c.indexOf("-")?a:0)+parseFloat(c)),a=1<c?1:c,n()),a},hide:function(){l&&(l=!1,s!=null&&(t.cancelAnimationFrame(s),s=null),function c(){return 1<=d.progress("+.1")&&(r.style.opacity-=.05,r.style.opacity<=.05)?(r.style.display="none",void(o=null)):void(o=t.requestAnimationFrame(c))}())}};e.exports=d}).call(Z,window,document)})(fr);const gi=ni;var Tn="consecutive-reloads",pr=10,gr=5e3,mr=1e4,vr=3e4,Sn=["phx-click-loading","phx-change-loading","phx-submit-loading","phx-keydown-loading","phx-keyup-loading","phx-blur-loading","phx-focus-loading"],le="data-phx-component",Jt="data-phx-link",br="track-static",_r="data-phx-link-state",ye="data-phx-ref",Ne="data-phx-ref-src",kn="track-uploads",Me="data-phx-upload-ref",mi="data-phx-preflighted-refs",yr="data-phx-done-refs",Ii="drop-target",ri="data-phx-active-refs",si="phx:live-file:updated",oi="data-phx-skip",Mi="data-phx-prune",Hi="page-loading",$i="phx-connected",Xt="phx-loading",ji="phx-no-feedback",Bi="phx-error",Be="data-phx-parent-id",vi="data-phx-main",ct="data-phx-root-id",Er="trigger-action",ai="feedback-for",On="phx-has-focused",Ar=["text","textarea","number","email","password","search","tel","url","date","time","datetime-local","color","range"],Dn=["checkbox","radio"],Ln="phx-has-submitted",Le="data-phx-session",Fe=`[${Le}]`,Fi="data-phx-sticky",nt="data-phx-static",zt="data-phx-readonly",mt="data-phx-disabled",li="disable-with",vt="data-phx-disable-with-restore",ze="hook",wr="debounce",Cr="throttle",ci="update",Tr="key",ve="phxPrivate",Ui="auto-recover",bt="phx:live-socket:debug",Yt="phx:live-socket:profiling",Gt="phx:live-socket:latency-sim",Sr="progress",kr=1,Or=200,Dr="phx-",Lr=3e4,Ye="debounce-trigger",_t="throttled",Vi="debounce-prev-key",Pr={debounce:300,throttle:300},Wi="d",be="s",ae="c",qi="e",Ki="r",Ji="t",xr="p",Rr=class{constructor(e,t,i){this.liveSocket=i,this.entry=e,this.offset=0,this.chunkSize=t,this.chunkTimer=null,this.uploadChannel=i.channel(`lvu:${e.ref}`,{token:e.metadata()})}error(e){clearTimeout(this.chunkTimer),this.uploadChannel.leave(),this.entry.error(e)}upload(){this.uploadChannel.onError(e=>this.error(e)),this.uploadChannel.join().receive("ok",e=>this.readNextChunk()).receive("error",e=>this.error(e))}isDone(){return this.offset>=this.entry.file.size}readNextChunk(){let e=new window.FileReader,t=this.entry.file.slice(this.offset,this.chunkSize+this.offset);e.onload=i=>{if(i.target.error===null)this.offset+=i.target.result.byteLength,this.pushChunk(i.target.result);else return Q("Read error: "+i.target.error)},e.readAsArrayBuffer(t)}pushChunk(e){this.uploadChannel.isJoined()&&this.uploadChannel.push("chunk",e).receive("ok",()=>{this.entry.progress(this.offset/this.entry.file.size*100),this.isDone()||(this.chunkTimer=setTimeout(()=>this.readNextChunk(),this.liveSocket.getLatencySim()||0))})}},Q=(e,t)=>console.error&&console.error(e,t),De=e=>{let t=typeof e;return t==="number"||t==="string"&&/^(0|[1-9]\d*)$/.test(e)};function Nr(){let e=new Set,t=document.querySelectorAll("*[id]");for(let i=0,n=t.length;i<n;i++)e.has(t[i].id)?console.error(`Multiple IDs detected: ${t[i].id}. Ensure unique element ids.`):e.add(t[i].id)}var Ir=(e,t,i,n)=>{e.liveSocket.isDebugEnabled()&&console.log(`${e.id} ${t}: ${i} - `,n)},Qt=e=>typeof e=="function"?e:function(){return e},Tt=e=>JSON.parse(JSON.stringify(e)),rt=(e,t,i)=>{do{if(e.matches(`[${t}]`))return e;e=e.parentElement||e.parentNode}while(e!==null&&e.nodeType===1&&!(i&&i.isSameNode(e)||e.matches(Fe)));return null},Ge=e=>e!==null&&typeof e=="object"&&!(e instanceof Array),Mr=(e,t)=>JSON.stringify(e)===JSON.stringify(t),Xi=e=>{for(let t in e)return!1;return!0},Te=(e,t)=>e&&t(e),Hr=function(e,t,i,n){e.forEach(r=>{new Rr(r,i.config.chunk_size,n).upload()})},Pn={canPushState(){return typeof history.pushState<"u"},dropLocal(e,t,i){return e.removeItem(this.localKey(t,i))},updateLocal(e,t,i,n,r){let s=this.getLocal(e,t,i),o=this.localKey(t,i),a=s===null?n:r(s);return e.setItem(o,JSON.stringify(a)),a},getLocal(e,t,i){return JSON.parse(e.getItem(this.localKey(t,i)))},updateCurrentState(e){this.canPushState()&&history.replaceState(e(history.state||{}),"",window.location.href)},pushState(e,t,i){if(this.canPushState()){if(i!==window.location.href){if(t.type=="redirect"&&t.scroll){let r=history.state||{};r.scroll=t.scroll,history.replaceState(r,"",window.location.href)}delete t.scroll,history[e+"State"](t,"",i||null);let n=this.getHashTargetEl(window.location.hash);n?n.scrollIntoView():t.type==="redirect"&&window.scroll(0,0)}}else this.redirect(i)},setCookie(e,t){document.cookie=`${e}=${t}`},getCookie(e){return document.cookie.replace(new RegExp(`(?:(?:^|.*;s*)${e}s*=s*([^;]*).*$)|^.*$`),"$1")},redirect(e,t){t&&Pn.setCookie("__phoenix_flash__",t+"; max-age=60000; path=/"),window.location=e},localKey(e,t){return`${e}-${t}`},getHashTargetEl(e){let t=e.toString().substring(1);if(t!=="")return document.getElementById(t)||document.querySelector(`a[name="${t}"]`)}},Oe=Pn,ge={byId(e){return document.getElementById(e)||Q(`no id found for ${e}`)},removeClass(e,t){e.classList.remove(t),e.classList.length===0&&e.removeAttribute("class")},all(e,t,i){if(!e)return[];let n=Array.from(e.querySelectorAll(t));return i?n.forEach(i):n},childNodeLength(e){let t=document.createElement("template");return t.innerHTML=e,t.content.childElementCount},isUploadInput(e){return e.type==="file"&&e.getAttribute(Me)!==null},findUploadInputs(e){return this.all(e,`input[type="file"][${Me}]`)},findComponentNodeList(e,t){return this.filterWithinSameLiveView(this.all(e,`[${le}="${t}"]`),e)},isPhxDestroyed(e){return!!(e.id&&ge.private(e,"destroyed"))},markPhxChildDestroyed(e){this.isPhxChild(e)&&e.setAttribute(Le,""),this.putPrivate(e,"destroyed",!0)},findPhxChildrenInFragment(e,t){let i=document.createElement("template");return i.innerHTML=e,this.findPhxChildren(i.content,t)},isIgnored(e,t){return(e.getAttribute(t)||e.getAttribute("data-phx-update"))==="ignore"},isPhxUpdate(e,t,i){return e.getAttribute&&i.indexOf(e.getAttribute(t))>=0},findPhxSticky(e){return this.all(e,`[${Fi}]`)},findPhxChildren(e,t){return this.all(e,`${Fe}[${Be}="${t}"]`)},findParentCIDs(e,t){let i=new Set(t);return t.reduce((n,r)=>{let s=`[${le}="${r}"] [${le}]`;return this.filterWithinSameLiveView(this.all(e,s),e).map(o=>parseInt(o.getAttribute(le))).forEach(o=>n.delete(o)),n},i)},filterWithinSameLiveView(e,t){return t.querySelector(Fe)?e.filter(i=>this.withinSameLiveView(i,t)):e},withinSameLiveView(e,t){for(;e=e.parentNode;){if(e.isSameNode(t))return!0;if(e.getAttribute(Le)!==null)return!1}},private(e,t){return e[ve]&&e[ve][t]},deletePrivate(e,t){e[ve]&&delete e[ve][t]},putPrivate(e,t,i){e[ve]||(e[ve]={}),e[ve][t]=i},updatePrivate(e,t,i,n){let r=this.private(e,t);r===void 0?this.putPrivate(e,t,n(i)):this.putPrivate(e,t,n(r))},copyPrivates(e,t){t[ve]&&(e[ve]=t[ve])},putTitle(e){let t=document.querySelector("title"),{prefix:i,suffix:n}=t.dataset;document.title=`${i||""}${e}${n||""}`},debounce(e,t,i,n,r,s,o,a){let l=e.getAttribute(i),h=e.getAttribute(r);l===""&&(l=n),h===""&&(h=s);let d=l||h;switch(d){case null:return a();case"blur":this.once(e,"debounce-blur")&&e.addEventListener("blur",()=>a());return;default:let c=parseInt(d),g=()=>h?this.deletePrivate(e,_t):a(),u=this.incCycle(e,Ye,g);if(isNaN(c))return Q(`invalid throttle/debounce value: ${d}`);if(h){let m=!1;if(t.type==="keydown"){let y=this.private(e,Vi);this.putPrivate(e,Vi,t.key),m=y!==t.key}if(!m&&this.private(e,_t))return!1;a(),this.putPrivate(e,_t,!0),setTimeout(()=>{o()&&this.triggerCycle(e,Ye)},c)}else setTimeout(()=>{o()&&this.triggerCycle(e,Ye,u)},c);let v=e.form;v&&this.once(v,"bind-debounce")&&v.addEventListener("submit",()=>{Array.from(new FormData(v).entries(),([m])=>{let y=v.querySelector(`[name="${m}"]`);this.incCycle(y,Ye),this.deletePrivate(y,_t)})}),this.once(e,"bind-debounce")&&e.addEventListener("blur",()=>this.triggerCycle(e,Ye))}},triggerCycle(e,t,i){let[n,r]=this.private(e,t);i||(i=n),i===n&&(this.incCycle(e,t),r())},once(e,t){return this.private(e,t)===!0?!1:(this.putPrivate(e,t,!0),!0)},incCycle(e,t,i=function(){}){let[n]=this.private(e,t)||[0,i];return n++,this.putPrivate(e,t,[n,i]),n},discardError(e,t,i){let n=t.getAttribute&&t.getAttribute(i),r=n&&e.querySelector(`[id="${n}"], [name="${n}"]`);r&&(this.private(r,On)||this.private(r.form,Ln)||t.classList.add(ji))},showError(e,t){(e.id||e.name)&&this.all(e.form,`[${t}="${e.id}"], [${t}="${e.name}"]`,i=>{this.removeClass(i,ji)})},isPhxChild(e){return e.getAttribute&&e.getAttribute(Be)},isPhxSticky(e){return e.getAttribute&&e.getAttribute(Fi)!==null},firstPhxChild(e){return this.isPhxChild(e)?e:this.all(e,`[${Be}]`)[0]},dispatchEvent(e,t,i={}){let r={bubbles:i.bubbles===void 0?!0:!!i.bubbles,cancelable:!0,detail:i.detail||{}},s=t==="click"?new MouseEvent("click",r):new CustomEvent(t,r);e.dispatchEvent(s)},cloneNode(e,t){if(typeof t>"u")return e.cloneNode(!0);{let i=e.cloneNode(!1);return i.innerHTML=t,i}},mergeAttrs(e,t,i={}){let n=i.exclude||[],r=i.isIgnored,s=t.attributes;for(let a=s.length-1;a>=0;a--){let l=s[a].name;n.indexOf(l)<0&&e.setAttribute(l,t.getAttribute(l))}let o=e.attributes;for(let a=o.length-1;a>=0;a--){let l=o[a].name;r?l.startsWith("data-")&&!t.hasAttribute(l)&&e.removeAttribute(l):t.hasAttribute(l)||e.removeAttribute(l)}},mergeFocusedInput(e,t){e instanceof HTMLSelectElement||ge.mergeAttrs(e,t,{exclude:["value"]}),t.readOnly?e.setAttribute("readonly",!0):e.removeAttribute("readonly")},hasSelectionRange(e){return e.setSelectionRange&&(e.type==="text"||e.type==="textarea")},restoreFocus(e,t,i){if(!ge.isTextualInput(e))return;let n=e.matches(":focus");e.readOnly&&e.blur(),n||e.focus(),this.hasSelectionRange(e)&&e.setSelectionRange(t,i)},isFormInput(e){return/^(?:input|select|textarea)$/i.test(e.tagName)&&e.type!=="button"},syncAttrsToProps(e){e instanceof HTMLInputElement&&Dn.indexOf(e.type.toLocaleLowerCase())>=0&&(e.checked=e.getAttribute("checked")!==null)},isTextualInput(e){return Ar.indexOf(e.type)>=0},isNowTriggerFormExternal(e,t){return e.getAttribute&&e.getAttribute(t)!==null},syncPendingRef(e,t,i){let n=e.getAttribute(ye);if(n===null)return!0;let r=e.getAttribute(Ne);return ge.isFormInput(e)||e.getAttribute(i)!==null?(ge.isUploadInput(e)&&ge.mergeAttrs(e,t,{isIgnored:!0}),ge.putPrivate(e,ye,t),!1):(Sn.forEach(s=>{e.classList.contains(s)&&t.classList.add(s)}),t.setAttribute(ye,n),t.setAttribute(Ne,r),!0)},cleanChildNodes(e,t){if(ge.isPhxUpdate(e,t,["append","prepend"])){let i=[];e.childNodes.forEach(n=>{n.id||(n.nodeType===Node.TEXT_NODE&&n.nodeValue.trim()===""||Q(`only HTML element tags with an id are allowed inside containers with phx-update.
removing illegal node: "${(n.outerHTML||n.nodeValue).trim()}"
`),i.push(n))}),i.forEach(n=>n.remove())}},replaceRootContainer(e,t,i){let n=new Set(["id",Le,nt,vi,ct]);if(e.tagName.toLowerCase()===t.toLowerCase())return Array.from(e.attributes).filter(r=>!n.has(r.name.toLowerCase())).forEach(r=>e.removeAttribute(r.name)),Object.keys(i).filter(r=>!n.has(r.toLowerCase())).forEach(r=>e.setAttribute(r,i[r])),e;{let r=document.createElement(t);return Object.keys(i).forEach(s=>r.setAttribute(s,i[s])),n.forEach(s=>r.setAttribute(s,e.getAttribute(s))),r.innerHTML=e.innerHTML,e.replaceWith(r),r}},getSticky(e,t,i){let n=(ge.private(e,"sticky")||[]).find(([r])=>t===r);if(n){let[r,s,o]=n;return o}else return typeof i=="function"?i():i},deleteSticky(e,t){this.updatePrivate(e,"sticky",[],i=>i.filter(([n,r])=>n!==t))},putSticky(e,t,i){let n=i(e);this.updatePrivate(e,"sticky",[],r=>{let s=r.findIndex(([o])=>t===o);return s>=0?r[s]=[t,i,n]:r.push([t,i,n]),r})},applyStickyOperations(e){let t=ge.private(e,"sticky");t&&t.forEach(([i,n,r])=>this.putSticky(e,i,n))}},_=ge,Zt=class{static isActive(e,t){let i=t._phxRef===void 0,r=e.getAttribute(ri).split(",").indexOf(G.genFileRef(t))>=0;return t.size>0&&(i||r)}static isPreflighted(e,t){return e.getAttribute(mi).split(",").indexOf(G.genFileRef(t))>=0&&this.isActive(e,t)}constructor(e,t,i){this.ref=G.genFileRef(t),this.fileEl=e,this.file=t,this.view=i,this.meta=null,this._isCancelled=!1,this._isDone=!1,this._progress=0,this._lastProgressSent=-1,this._onDone=function(){},this._onElUpdated=this.onElUpdated.bind(this),this.fileEl.addEventListener(si,this._onElUpdated)}metadata(){return this.meta}progress(e){this._progress=Math.floor(e),this._progress>this._lastProgressSent&&(this._progress>=100?(this._progress=100,this._lastProgressSent=100,this._isDone=!0,this.view.pushFileProgress(this.fileEl,this.ref,100,()=>{G.untrackFile(this.fileEl,this.file),this._onDone()})):(this._lastProgressSent=this._progress,this.view.pushFileProgress(this.fileEl,this.ref,this._progress)))}cancel(){this._isCancelled=!0,this._isDone=!0,this._onDone()}isDone(){return this._isDone}error(e="failed"){this.view.pushFileProgress(this.fileEl,this.ref,{error:e}),G.clearFiles(this.fileEl)}onDone(e){this._onDone=()=>{this.fileEl.removeEventListener(si,this._onElUpdated),e()}}onElUpdated(){this.fileEl.getAttribute(ri).split(",").indexOf(this.ref)===-1&&this.cancel()}toPreflightPayload(){return{last_modified:this.file.lastModified,name:this.file.name,size:this.file.size,type:this.file.type,ref:this.ref}}uploader(e){if(this.meta.uploader){let t=e[this.meta.uploader]||Q(`no uploader configured for ${this.meta.uploader}`);return{name:this.meta.uploader,callback:t}}else return{name:"channel",callback:Hr}}zipPostFlight(e){this.meta=e.entries[this.ref],this.meta||Q(`no preflight upload response returned with ref ${this.ref}`,{input:this.fileEl,response:e})}},$r=0,G=class{static genFileRef(e){let t=e._phxRef;return t!==void 0?t:(e._phxRef=($r++).toString(),e._phxRef)}static getEntryDataURL(e,t,i){let n=this.activeFiles(e).find(r=>this.genFileRef(r)===t);i(URL.createObjectURL(n))}static hasUploadsInProgress(e){let t=0;return _.findUploadInputs(e).forEach(i=>{i.getAttribute(mi)!==i.getAttribute(yr)&&t++}),t>0}static serializeUploads(e){let t=this.activeFiles(e),i={};return t.forEach(n=>{let r={path:e.name},s=e.getAttribute(Me);i[s]=i[s]||[],r.ref=this.genFileRef(n),r.name=n.name||r.ref,r.type=n.type,r.size=n.size,i[s].push(r)}),i}static clearFiles(e){e.value=null,e.removeAttribute(Me),_.putPrivate(e,"files",[])}static untrackFile(e,t){_.putPrivate(e,"files",_.private(e,"files").filter(i=>!Object.is(i,t)))}static trackFiles(e,t){if(e.getAttribute("multiple")!==null){let i=t.filter(n=>!this.activeFiles(e).find(r=>Object.is(r,n)));_.putPrivate(e,"files",this.activeFiles(e).concat(i)),e.value=null}else _.putPrivate(e,"files",t)}static activeFileInputs(e){let t=_.findUploadInputs(e);return Array.from(t).filter(i=>i.files&&this.activeFiles(i).length>0)}static activeFiles(e){return(_.private(e,"files")||[]).filter(t=>Zt.isActive(e,t))}static inputsAwaitingPreflight(e){let t=_.findUploadInputs(e);return Array.from(t).filter(i=>this.filesAwaitingPreflight(i).length>0)}static filesAwaitingPreflight(e){return this.activeFiles(e).filter(t=>!Zt.isPreflighted(e,t))}constructor(e,t,i){this.view=t,this.onComplete=i,this._entries=Array.from(G.filesAwaitingPreflight(e)||[]).map(n=>new Zt(e,n,t)),this.numEntriesInProgress=this._entries.length}entries(){return this._entries}initAdapterUpload(e,t,i){this._entries=this._entries.map(r=>(r.zipPostFlight(e),r.onDone(()=>{this.numEntriesInProgress--,this.numEntriesInProgress===0&&this.onComplete()}),r));let n=this._entries.reduce((r,s)=>{let{name:o,callback:a}=s.uploader(i.uploaders);return r[o]=r[o]||{callback:a,entries:[]},r[o].entries.push(s),r},{});for(let r in n){let{callback:s,entries:o}=n[r];s(o,t,e,i)}}},jr={LiveFileUpload:{activeRefs(){return this.el.getAttribute(ri)},preflightedRefs(){return this.el.getAttribute(mi)},mounted(){this.preflightedWas=this.preflightedRefs()},updated(){let e=this.preflightedRefs();this.preflightedWas!==e&&(this.preflightedWas=e,e===""&&this.__view.cancelSubmit(this.el.form)),this.activeRefs()===""&&(this.el.value=null),this.el.dispatchEvent(new CustomEvent(si))}},LiveImgPreview:{mounted(){this.ref=this.el.getAttribute("data-phx-entry-ref"),this.inputEl=document.getElementById(this.el.getAttribute(Me)),G.getEntryDataURL(this.inputEl,this.ref,e=>{this.url=e,this.el.src=e})},destroyed(){URL.revokeObjectURL(this.url)}}},Br=jr,Fr=class{constructor(e,t,i){let n=new Set,r=new Set([...t.children].map(o=>o.id)),s=[];Array.from(e.children).forEach(o=>{if(o.id&&(n.add(o.id),r.has(o.id))){let a=o.previousElementSibling&&o.previousElementSibling.id;s.push({elementId:o.id,previousElementId:a})}}),this.containerId=t.id,this.updateType=i,this.elementsToModify=s,this.elementIdsToAdd=[...r].filter(o=>!n.has(o))}perform(){let e=_.byId(this.containerId);this.elementsToModify.forEach(t=>{t.previousElementId?Te(document.getElementById(t.previousElementId),i=>{Te(document.getElementById(t.elementId),n=>{n.previousElementSibling&&n.previousElementSibling.id==i.id||i.insertAdjacentElement("afterend",n)})}):Te(document.getElementById(t.elementId),i=>{i.previousElementSibling==null||e.insertAdjacentElement("afterbegin",i)})}),this.updateType=="prepend"&&this.elementIdsToAdd.reverse().forEach(t=>{Te(document.getElementById(t),i=>e.insertAdjacentElement("afterbegin",i))})}},zi=11;function Ur(e,t){var i=t.attributes,n,r,s,o,a;if(!(t.nodeType===zi||e.nodeType===zi)){for(var l=i.length-1;l>=0;l--)n=i[l],r=n.name,s=n.namespaceURI,o=n.value,s?(r=n.localName||r,a=e.getAttributeNS(s,r),a!==o&&(n.prefix==="xmlns"&&(r=n.name),e.setAttributeNS(s,r,o))):(a=e.getAttribute(r),a!==o&&e.setAttribute(r,o));for(var h=e.attributes,d=h.length-1;d>=0;d--)n=h[d],r=n.name,s=n.namespaceURI,s?(r=n.localName||r,t.hasAttributeNS(s,r)||e.removeAttributeNS(s,r)):t.hasAttribute(r)||e.removeAttribute(r)}}var yt,Vr="http://www.w3.org/1999/xhtml",se=typeof document>"u"?void 0:document,Wr=!!se&&"content"in se.createElement("template"),qr=!!se&&se.createRange&&"createContextualFragment"in se.createRange();function Kr(e){var t=se.createElement("template");return t.innerHTML=e,t.content.childNodes[0]}function Jr(e){yt||(yt=se.createRange(),yt.selectNode(se.body));var t=yt.createContextualFragment(e);return t.childNodes[0]}function Xr(e){var t=se.createElement("body");return t.innerHTML=e,t.childNodes[0]}function zr(e){return e=e.trim(),Wr?Kr(e):qr?Jr(e):Xr(e)}function Et(e,t){var i=e.nodeName,n=t.nodeName,r,s;return i===n?!0:(r=i.charCodeAt(0),s=n.charCodeAt(0),r<=90&&s>=97?i===n.toUpperCase():s<=90&&r>=97?n===i.toUpperCase():!1)}function Yr(e,t){return!t||t===Vr?se.createElement(e):se.createElementNS(t,e)}function Gr(e,t){for(var i=e.firstChild;i;){var n=i.nextSibling;t.appendChild(i),i=n}return t}function ei(e,t,i){e[i]!==t[i]&&(e[i]=t[i],e[i]?e.setAttribute(i,""):e.removeAttribute(i))}var Yi={OPTION:function(e,t){var i=e.parentNode;if(i){var n=i.nodeName.toUpperCase();n==="OPTGROUP"&&(i=i.parentNode,n=i&&i.nodeName.toUpperCase()),n==="SELECT"&&!i.hasAttribute("multiple")&&(e.hasAttribute("selected")&&!t.selected&&(e.setAttribute("selected","selected"),e.removeAttribute("selected")),i.selectedIndex=-1)}ei(e,t,"selected")},INPUT:function(e,t){ei(e,t,"checked"),ei(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),t.hasAttribute("value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var i=t.value;e.value!==i&&(e.value=i);var n=e.firstChild;if(n){var r=n.nodeValue;if(r==i||!i&&r==e.placeholder)return;n.nodeValue=i}},SELECT:function(e,t){if(!t.hasAttribute("multiple")){for(var i=-1,n=0,r=e.firstChild,s,o;r;)if(o=r.nodeName&&r.nodeName.toUpperCase(),o==="OPTGROUP")s=r,r=s.firstChild;else{if(o==="OPTION"){if(r.hasAttribute("selected")){i=n;break}n++}r=r.nextSibling,!r&&s&&(r=s.nextSibling,s=null)}e.selectedIndex=i}}},Qe=1,Qr=11,Gi=3,Qi=8;function Re(){}function Zr(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}function es(e){return function(i,n,r){if(r||(r={}),typeof n=="string")if(i.nodeName==="#document"||i.nodeName==="HTML"||i.nodeName==="BODY"){var s=n;n=se.createElement("html"),n.innerHTML=s}else n=zr(n);var o=r.getNodeKey||Zr,a=r.onBeforeNodeAdded||Re,l=r.onNodeAdded||Re,h=r.onBeforeElUpdated||Re,d=r.onElUpdated||Re,c=r.onBeforeNodeDiscarded||Re,g=r.onNodeDiscarded||Re,u=r.onBeforeElChildrenUpdated||Re,v=r.childrenOnly===!0,m=Object.create(null),y=[];function S(T){y.push(T)}function N(T,w){if(T.nodeType===Qe)for(var b=T.firstChild;b;){var D=void 0;w&&(D=o(b))?S(D):(g(b),b.firstChild&&N(b,w)),b=b.nextSibling}}function f(T,w,b){c(T)!==!1&&(w&&w.removeChild(T),g(T),N(T,b))}function A(T){if(T.nodeType===Qe||T.nodeType===Qr)for(var w=T.firstChild;w;){var b=o(w);b&&(m[b]=w),A(w),w=w.nextSibling}}A(i);function P(T){l(T);for(var w=T.firstChild;w;){var b=w.nextSibling,D=o(w);if(D){var I=m[D];I&&Et(w,I)?(w.parentNode.replaceChild(I,w),C(I,w)):P(w)}else P(w);w=b}}function E(T,w,b){for(;w;){var D=w.nextSibling;(b=o(w))?S(b):f(w,T,!0),w=D}}function C(T,w,b){var D=o(w);D&&delete m[D],!(!b&&(h(T,w)===!1||(e(T,w),d(T),u(T,w)===!1)))&&(T.nodeName!=="TEXTAREA"?x(T,w):Yi.TEXTAREA(T,w))}function x(T,w){var b=w.firstChild,D=T.firstChild,I,U,B,J,F;e:for(;b;){for(J=b.nextSibling,I=o(b);D;){if(B=D.nextSibling,b.isSameNode&&b.isSameNode(D)){b=J,D=B;continue e}U=o(D);var ee=D.nodeType,W=void 0;if(ee===b.nodeType&&(ee===Qe?(I?I!==U&&((F=m[I])?B===F?W=!1:(T.insertBefore(F,D),U?S(U):f(D,T,!0),D=F):W=!1):U&&(W=!1),W=W!==!1&&Et(D,b),W&&C(D,b)):(ee===Gi||ee==Qi)&&(W=!0,D.nodeValue!==b.nodeValue&&(D.nodeValue=b.nodeValue))),W){b=J,D=B;continue e}U?S(U):f(D,T,!0),D=B}if(I&&(F=m[I])&&Et(F,b))T.appendChild(F),C(F,b);else{var K=a(b);K!==!1&&(K&&(b=K),b.actualize&&(b=b.actualize(T.ownerDocument||se)),T.appendChild(b),P(b))}b=J,D=B}E(T,D,U);var z=Yi[T.nodeName];z&&z(T,w)}var k=i,M=k.nodeType,H=n.nodeType;if(!v){if(M===Qe)H===Qe?Et(i,n)||(g(i),k=Gr(i,Yr(n.nodeName,n.namespaceURI))):k=n;else if(M===Gi||M===Qi){if(H===M)return k.nodeValue!==n.nodeValue&&(k.nodeValue=n.nodeValue),k;k=n}}if(k===n)g(i);else{if(n.isSameNode&&n.isSameNode(k))return;if(C(k,n,v),y)for(var p=0,O=y.length;p<O;p++){var R=m[y[p]];R&&f(R,R.parentNode,!1)}}return!v&&k!==i&&i.parentNode&&(k.actualize&&(k=k.actualize(i.ownerDocument||se)),i.parentNode.replaceChild(k,i)),k}}var ts=es(Ur),Zi=ts,At=class{static patchEl(e,t,i){Zi(e,t,{childrenOnly:!1,onBeforeElUpdated:(n,r)=>{if(i&&i.isSameNode(n)&&_.isFormInput(n))return _.mergeFocusedInput(n,r),!1}})}constructor(e,t,i,n,r){this.view=e,this.liveSocket=e.liveSocket,this.container=t,this.id=i,this.rootID=e.root.id,this.html=n,this.targetCID=r,this.cidPatch=De(this.targetCID),this.callbacks={beforeadded:[],beforeupdated:[],beforephxChildAdded:[],afteradded:[],afterupdated:[],afterdiscarded:[],afterphxChildAdded:[],aftertransitionsDiscarded:[]}}before(e,t){this.callbacks[`before${e}`].push(t)}after(e,t){this.callbacks[`after${e}`].push(t)}trackBefore(e,...t){this.callbacks[`before${e}`].forEach(i=>i(...t))}trackAfter(e,...t){this.callbacks[`after${e}`].forEach(i=>i(...t))}markPrunableContentForRemoval(){_.all(this.container,"[phx-update=append] > *, [phx-update=prepend] > *",e=>{e.setAttribute(Mi,"")})}perform(){let{view:e,liveSocket:t,container:i,html:n}=this,r=this.isCIDPatch()?this.targetCIDContainer(n):i;if(this.isCIDPatch()&&!r)return;let s=t.getActiveElement(),{selectionStart:o,selectionEnd:a}=s&&_.hasSelectionRange(s)?s:{},l=t.binding(ci),h=t.binding(ai),d=t.binding(li),c=t.binding(Er),g=t.binding("remove"),u=[],v=[],m=[],y=[],S=null,N=t.time("premorph container prep",()=>this.buildDiffHTML(i,n,l,r));return this.trackBefore("added",i),this.trackBefore("updated",i,i),t.time("morphdom",()=>{Zi(r,N,{childrenOnly:r.getAttribute(le)===null,getNodeKey:f=>_.isPhxDestroyed(f)?null:f.id,onBeforeNodeAdded:f=>(this.trackBefore("added",f),f),onNodeAdded:f=>{f instanceof HTMLImageElement&&f.srcset?f.srcset=f.srcset:f instanceof HTMLVideoElement&&f.autoplay&&f.play(),_.isNowTriggerFormExternal(f,c)&&(S=f),_.discardError(r,f,h),(_.isPhxChild(f)&&e.ownsElement(f)||_.isPhxSticky(f)&&e.ownsElement(f.parentNode))&&this.trackAfter("phxChildAdded",f),u.push(f)},onNodeDiscarded:f=>{(_.isPhxChild(f)||_.isPhxSticky(f))&&t.destroyViewByEl(f),this.trackAfter("discarded",f)},onBeforeNodeDiscarded:f=>f.getAttribute&&f.getAttribute(Mi)!==null?!0:f.parentNode!==null&&_.isPhxUpdate(f.parentNode,l,["append","prepend"])&&f.id?!1:f.getAttribute&&f.getAttribute(g)?(y.push(f),!1):!this.skipCIDSibling(f),onElUpdated:f=>{_.isNowTriggerFormExternal(f,c)&&(S=f),v.push(f)},onBeforeElUpdated:(f,A)=>{if(_.cleanChildNodes(A,l),this.skipCIDSibling(A)||_.isPhxSticky(f))return!1;if(_.isIgnored(f,l))return this.trackBefore("updated",f,A),_.mergeAttrs(f,A,{isIgnored:!0}),v.push(f),_.applyStickyOperations(f),!1;if(f.type==="number"&&f.validity&&f.validity.badInput)return!1;if(!_.syncPendingRef(f,A,d))return _.isUploadInput(f)&&(this.trackBefore("updated",f,A),v.push(f)),_.applyStickyOperations(f),!1;if(_.isPhxChild(A)){let E=f.getAttribute(Le);return _.mergeAttrs(f,A,{exclude:[nt]}),E!==""&&f.setAttribute(Le,E),f.setAttribute(ct,this.rootID),_.applyStickyOperations(f),!1}return _.copyPrivates(A,f),_.discardError(r,A,h),s&&f.isSameNode(s)&&_.isFormInput(f)?(this.trackBefore("updated",f,A),_.mergeFocusedInput(f,A),_.syncAttrsToProps(f),v.push(f),_.applyStickyOperations(f),!1):(_.isPhxUpdate(A,l,["append","prepend"])&&m.push(new Fr(f,A,A.getAttribute(l))),_.syncAttrsToProps(A),_.applyStickyOperations(A),this.trackBefore("updated",f,A),!0)}})}),t.isDebugEnabled()&&Nr(),m.length>0&&t.time("post-morph append/prepend restoration",()=>{m.forEach(f=>f.perform())}),t.silenceEvents(()=>_.restoreFocus(s,o,a)),_.dispatchEvent(document,"phx:update"),u.forEach(f=>this.trackAfter("added",f)),v.forEach(f=>this.trackAfter("updated",f)),y.length>0&&(t.transitionRemoves(y),t.requestDOMUpdate(()=>{y.forEach(f=>{let A=_.firstPhxChild(f);A&&t.destroyViewByEl(A),f.remove()}),this.trackAfter("transitionsDiscarded",y)})),S&&(t.disconnect(),S.submit()),!0}isCIDPatch(){return this.cidPatch}skipCIDSibling(e){return e.nodeType===Node.ELEMENT_NODE&&e.getAttribute(oi)!==null}targetCIDContainer(e){if(!this.isCIDPatch())return;let[t,...i]=_.findComponentNodeList(this.container,this.targetCID);return i.length===0&&_.childNodeLength(e)===1?t:t&&t.parentNode}buildDiffHTML(e,t,i,n){let r=this.isCIDPatch(),s=r&&n.getAttribute(le)===this.targetCID.toString();if(!r||s)return t;{let o=null,a=document.createElement("template");o=_.cloneNode(n);let[l,...h]=_.findComponentNodeList(o,this.targetCID);return a.innerHTML=t,h.forEach(d=>d.remove()),Array.from(o.childNodes).forEach(d=>{d.id&&d.nodeType===Node.ELEMENT_NODE&&d.getAttribute(le)!==this.targetCID.toString()&&(d.setAttribute(oi,""),d.innerHTML="")}),Array.from(a.content.childNodes).forEach(d=>o.insertBefore(d,l)),l.remove(),o.outerHTML}}},en=class{static extract(e){let{[Ki]:t,[qi]:i,[Ji]:n}=e;return delete e[Ki],delete e[qi],delete e[Ji],{diff:e,title:n,reply:t||null,events:i||[]}}constructor(e,t){this.viewId=e,this.rendered={},this.mergeDiff(t)}parentViewId(){return this.viewId}toString(e){return this.recursiveToString(this.rendered,this.rendered[ae],e)}recursiveToString(e,t=e[ae],i){i=i?new Set(i):null;let n={buffer:"",components:t,onlyCids:i};return this.toOutputBuffer(e,null,n),n.buffer}componentCIDs(e){return Object.keys(e[ae]||{}).map(t=>parseInt(t))}isComponentOnlyDiff(e){return e[ae]?Object.keys(e).length===1:!1}getComponent(e,t){return e[ae][t]}mergeDiff(e){let t=e[ae],i={};if(delete e[ae],this.rendered=this.mutableMerge(this.rendered,e),this.rendered[ae]=this.rendered[ae]||{},t){let n=this.rendered[ae];for(let r in t)t[r]=this.cachedFindComponent(r,t[r],n,t,i);for(let r in t)n[r]=t[r];e[ae]=t}}cachedFindComponent(e,t,i,n,r){if(r[e])return r[e];{let s,o,a=t[be];if(De(a)){let l;a>0?l=this.cachedFindComponent(a,n[a],i,n,r):l=i[-a],o=l[be],s=this.cloneMerge(l,t),s[be]=o}else s=t[be]!==void 0?t:this.cloneMerge(i[e]||{},t);return r[e]=s,s}}mutableMerge(e,t){return t[be]!==void 0?t:(this.doMutableMerge(e,t),e)}doMutableMerge(e,t){for(let i in t){let n=t[i],r=e[i];Ge(n)&&n[be]===void 0&&Ge(r)?this.doMutableMerge(r,n):e[i]=n}}cloneMerge(e,t){let i={...e,...t};for(let n in i){let r=t[n],s=e[n];Ge(r)&&r[be]===void 0&&Ge(s)&&(i[n]=this.cloneMerge(s,r))}return i}componentToString(e){return this.recursiveCIDToString(this.rendered[ae],e)}pruneCIDs(e){e.forEach(t=>delete this.rendered[ae][t])}get(){return this.rendered}isNewFingerprint(e={}){return!!e[be]}templateStatic(e,t){return typeof e=="number"?t[e]:e}toOutputBuffer(e,t,i){if(e[Wi])return this.comprehensionToBuffer(e,t,i);let{[be]:n}=e;n=this.templateStatic(n,t),i.buffer+=n[0];for(let r=1;r<n.length;r++)this.dynamicToBuffer(e[r-1],t,i),i.buffer+=n[r]}comprehensionToBuffer(e,t,i){let{[Wi]:n,[be]:r}=e;r=this.templateStatic(r,t);let s=t||e[xr];for(let o=0;o<n.length;o++){let a=n[o];i.buffer+=r[0];for(let l=1;l<r.length;l++)this.dynamicToBuffer(a[l-1],s,i),i.buffer+=r[l]}}dynamicToBuffer(e,t,i){typeof e=="number"?i.buffer+=this.recursiveCIDToString(i.components,e,i.onlyCids):Ge(e)?this.toOutputBuffer(e,t,i):i.buffer+=e}recursiveCIDToString(e,t,i){let n=e[t]||Q(`no component for CID ${t}`,e),r=document.createElement("template");r.innerHTML=this.recursiveToString(n,e,i);let s=r.content,o=i&&!i.has(t),[a,l]=Array.from(s.childNodes).reduce(([h,d],c,g)=>c.nodeType===Node.ELEMENT_NODE?c.getAttribute(le)?[h,!0]:(c.setAttribute(le,t),c.id||(c.id=`${this.parentViewId()}-${t}-${g}`),o&&(c.setAttribute(oi,""),c.innerHTML=""),[!0,d]):c.nodeValue.trim()!==""?(Q(`only HTML element tags are allowed at the root of components.
got: "${c.nodeValue.trim()}"
within:
`,r.innerHTML.trim()),c.replaceWith(this.createSpan(c.nodeValue,t)),[!0,d]):(c.remove(),[h,d]),[!1,!1]);return!a&&!l?(Q(`expected at least one HTML element tag inside a component, but the component is empty:
`,r.innerHTML.trim()),this.createSpan("",t).outerHTML):(!a&&l&&Q("expected at least one HTML element tag directly inside a component, but only subcomponents were found. A component must render at least one HTML tag directly inside itself.",r.innerHTML.trim()),r.innerHTML)}createSpan(e,t){let i=document.createElement("span");return i.innerText=e,i.setAttribute(le,t),i}},is=1,Ze=class{static makeID(){return is++}static elementID(e){return e.phxHookId}constructor(e,t,i){this.__view=e,this.liveSocket=e.liveSocket,this.__callbacks=i,this.__listeners=new Set,this.__isDisconnected=!1,this.el=t,this.el.phxHookId=this.constructor.makeID();for(let n in this.__callbacks)this[n]=this.__callbacks[n]}__mounted(){this.mounted&&this.mounted()}__updated(){this.updated&&this.updated()}__beforeUpdate(){this.beforeUpdate&&this.beforeUpdate()}__destroyed(){this.destroyed&&this.destroyed()}__reconnected(){this.__isDisconnected&&(this.__isDisconnected=!1,this.reconnected&&this.reconnected())}__disconnected(){this.__isDisconnected=!0,this.disconnected&&this.disconnected()}pushEvent(e,t={},i=function(){}){return this.__view.pushHookEvent(null,e,t,i)}pushEventTo(e,t,i={},n=function(){}){return this.__view.withinTargets(e,(r,s)=>r.pushHookEvent(s,t,i,n))}handleEvent(e,t){let i=(n,r)=>r?e:t(n.detail);return window.addEventListener(`phx:${e}`,i),this.__listeners.add(i),i}removeHandleEvent(e){let t=e(null,!0);window.removeEventListener(`phx:${t}`,e),this.__listeners.delete(e)}upload(e,t){return this.__view.dispatchUploads(e,t)}uploadTo(e,t,i){return this.__view.withinTargets(e,n=>n.dispatchUploads(t,i))}__cleanup__(){this.__listeners.forEach(e=>this.removeHandleEvent(e))}},ns={exec(e,t,i,n,r){let[s,o]=r||[null,{}];(t.charAt(0)==="["?JSON.parse(t):[[s,o]]).forEach(([l,h])=>{l===s&&o.data&&(h.data=Object.assign(h.data||{},o.data)),this.filterToEls(n,h).forEach(d=>{this[`exec_${l}`](e,t,i,n,d,h)})})},isVisible(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length>0)},exec_dispatch(e,t,i,n,r,{to:s,event:o,detail:a,bubbles:l}){a=a||{},a.dispatcher=n,_.dispatchEvent(r,o,{detail:a,bubbles:l})},exec_push(e,t,i,n,r,s){if(!i.isConnected())return;let{event:o,data:a,target:l,page_loading:h,loading:d,value:c,dispatcher:g}=s,u={loading:d,value:c,target:l,page_loading:!!h},v=e==="change"&&g?g:n,m=l||v.getAttribute(i.binding("target"))||v;i.withinTargets(m,(y,S)=>{if(e==="change"){let{newCid:N,_target:f,callback:A}=s;f=f||(n instanceof HTMLInputElement?n.name:void 0),f&&(u._target=f),y.pushInput(n,S,N,o||t,u,A)}else e==="submit"?y.submitForm(n,S,o||t,u):y.pushEvent(e,n,S,o||t,a,u)})},exec_add_class(e,t,i,n,r,{names:s,transition:o,time:a}){this.addOrRemoveClasses(r,s,[],o,a,i)},exec_remove_class(e,t,i,n,r,{names:s,transition:o,time:a}){this.addOrRemoveClasses(r,[],s,o,a,i)},exec_transition(e,t,i,n,r,{time:s,transition:o}){let[a,l,h]=o,d=()=>this.addOrRemoveClasses(r,a.concat(l),[]),c=()=>this.addOrRemoveClasses(r,h,a.concat(l));i.transition(s,d,c)},exec_toggle(e,t,i,n,r,{display:s,ins:o,outs:a,time:l}){this.toggle(e,i,r,s,o,a,l)},exec_show(e,t,i,n,r,{display:s,transition:o,time:a}){this.show(e,i,r,s,o,a)},exec_hide(e,t,i,n,r,{display:s,transition:o,time:a}){this.hide(e,i,r,s,o,a)},exec_set_attr(e,t,i,n,r,{attr:[s,o]}){this.setOrRemoveAttrs(r,[[s,o]],[])},exec_remove_attr(e,t,i,n,r,{attr:s}){this.setOrRemoveAttrs(r,[],[s])},show(e,t,i,n,r,s){this.isVisible(i)||this.toggle(e,t,i,n,r,null,s)},hide(e,t,i,n,r,s){this.isVisible(i)&&this.toggle(e,t,i,n,null,r,s)},toggle(e,t,i,n,r,s,o){let[a,l,h]=r||[[],[],[]],[d,c,g]=s||[[],[],[]];if(a.length>0||d.length>0)if(this.isVisible(i)){let u=()=>{this.addOrRemoveClasses(i,c,a.concat(l).concat(h)),window.requestAnimationFrame(()=>{this.addOrRemoveClasses(i,d,[]),window.requestAnimationFrame(()=>this.addOrRemoveClasses(i,g,c))})};i.dispatchEvent(new Event("phx:hide-start")),t.transition(o,u,()=>{this.addOrRemoveClasses(i,[],d.concat(g)),_.putSticky(i,"toggle",v=>v.style.display="none"),i.dispatchEvent(new Event("phx:hide-end"))})}else{if(e==="remove")return;let u=()=>{this.addOrRemoveClasses(i,l,d.concat(c).concat(g)),_.putSticky(i,"toggle",v=>v.style.display=n||"block"),window.requestAnimationFrame(()=>{this.addOrRemoveClasses(i,a,[]),window.requestAnimationFrame(()=>this.addOrRemoveClasses(i,h,l))})};i.dispatchEvent(new Event("phx:show-start")),t.transition(o,u,()=>{this.addOrRemoveClasses(i,[],a.concat(h)),i.dispatchEvent(new Event("phx:show-end"))})}else this.isVisible(i)?window.requestAnimationFrame(()=>{i.dispatchEvent(new Event("phx:hide-start")),_.putSticky(i,"toggle",u=>u.style.display="none"),i.dispatchEvent(new Event("phx:hide-end"))}):window.requestAnimationFrame(()=>{i.dispatchEvent(new Event("phx:show-start")),_.putSticky(i,"toggle",u=>u.style.display=n||"block"),i.dispatchEvent(new Event("phx:show-end"))})},addOrRemoveClasses(e,t,i,n,r,s){let[o,a,l]=n||[[],[],[]];if(o.length>0){let h=()=>this.addOrRemoveClasses(e,a.concat(o),[]),d=()=>this.addOrRemoveClasses(e,t.concat(l),i.concat(o).concat(a));return s.transition(r,h,d)}window.requestAnimationFrame(()=>{let[h,d]=_.getSticky(e,"classes",[[],[]]),c=t.filter(m=>h.indexOf(m)<0&&!e.classList.contains(m)),g=i.filter(m=>d.indexOf(m)<0&&e.classList.contains(m)),u=h.filter(m=>i.indexOf(m)<0).concat(c),v=d.filter(m=>t.indexOf(m)<0).concat(g);_.putSticky(e,"classes",m=>(m.classList.remove(...v),m.classList.add(...u),[u,v]))})},setOrRemoveAttrs(e,t,i){let[n,r]=_.getSticky(e,"attrs",[[],[]]),s=t.map(([l,h])=>l).concat(i),o=n.filter(([l,h])=>!s.includes(l)).concat(t),a=r.filter(l=>!s.includes(l)).concat(i);_.putSticky(e,"attrs",l=>(a.forEach(h=>l.removeAttribute(h)),o.forEach(([h,d])=>l.setAttribute(h,d)),[o,a]))},hasAllClasses(e,t){return t.every(i=>e.classList.contains(i))},isToggledOut(e,t){return!this.isVisible(e)||this.hasAllClasses(e,t)},filterToEls(e,{to:t}){return t?_.all(document,t):[e]}},_e=ns,wt=(e,t,i=[])=>{let n=new FormData(e),r=[];n.forEach((o,a,l)=>{o instanceof File&&r.push(a)}),r.forEach(o=>n.delete(o));let s=new URLSearchParams;for(let[o,a]of n.entries())(i.length===0||i.indexOf(o)>=0)&&s.append(o,a);for(let o in t)s.append(o,t[o]);return s.toString()},xn=class{constructor(e,t,i,n){this.liveSocket=t,this.flash=n,this.parent=i,this.root=i?i.root:this,this.el=e,this.id=this.el.id,this.ref=0,this.childJoins=0,this.loaderTimer=null,this.pendingDiffs=[],this.pruningCIDs=[],this.redirect=!1,this.href=null,this.joinCount=this.parent?this.parent.joinCount-1:0,this.joinPending=!0,this.destroyed=!1,this.joinCallback=function(r){r&&r()},this.stopCallback=function(){},this.pendingJoinOps=this.parent?null:[],this.viewHooks={},this.uploaders={},this.formSubmits=[],this.children=this.parent?null:{},this.root.children[this.id]={},this.channel=this.liveSocket.channel(`lv:${this.id}`,()=>({redirect:this.redirect?this.href:void 0,url:this.redirect?void 0:this.href||void 0,params:this.connectParams(),session:this.getSession(),static:this.getStatic(),flash:this.flash})),this.showLoader(this.liveSocket.loaderTimeout),this.bindChannel()}setHref(e){this.href=e}setRedirect(e){this.redirect=!0,this.href=e}isMain(){return this.el.getAttribute(vi)!==null}connectParams(){let e=this.liveSocket.params(this.el),t=_.all(document,`[${this.binding(br)}]`).map(i=>i.src||i.href).filter(i=>typeof i=="string");return t.length>0&&(e._track_static=t),e._mounts=this.joinCount,e}isConnected(){return this.channel.canPush()}getSession(){return this.el.getAttribute(Le)}getStatic(){let e=this.el.getAttribute(nt);return e===""?null:e}destroy(e=function(){}){this.destroyAllChildren(),this.destroyed=!0,delete this.root.children[this.id],this.parent&&delete this.root.children[this.parent.id][this.id],clearTimeout(this.loaderTimer);let t=()=>{e();for(let i in this.viewHooks)this.destroyHook(this.viewHooks[i])};_.markPhxChildDestroyed(this.el),this.log("destroyed",()=>["the child has been removed from the parent"]),this.channel.leave().receive("ok",t).receive("error",t).receive("timeout",t)}setContainerClasses(...e){this.el.classList.remove($i,Xt,Bi),this.el.classList.add(...e)}showLoader(e){if(clearTimeout(this.loaderTimer),e)this.loaderTimer=setTimeout(()=>this.showLoader(),e);else{for(let t in this.viewHooks)this.viewHooks[t].__disconnected();this.setContainerClasses(Xt)}}hideLoader(){clearTimeout(this.loaderTimer),this.setContainerClasses($i)}triggerReconnected(){for(let e in this.viewHooks)this.viewHooks[e].__reconnected()}log(e,t){this.liveSocket.log(this,e,t)}transition(e,t,i=function(){}){this.liveSocket.transition(e,t,i)}withinTargets(e,t){if(e instanceof HTMLElement||e instanceof SVGElement)return this.liveSocket.owner(e,i=>t(i,e));if(De(e))_.findComponentNodeList(this.el,e).length===0?Q(`no component found matching phx-target of ${e}`):t(this,parseInt(e));else{let i=Array.from(document.querySelectorAll(e));i.length===0&&Q(`nothing found matching the phx-target selector "${e}"`),i.forEach(n=>this.liveSocket.owner(n,r=>t(r,n)))}}applyDiff(e,t,i){this.log(e,()=>["",Tt(t)]);let{diff:n,reply:r,events:s,title:o}=en.extract(t);return o&&_.putTitle(o),i({diff:n,reply:r,events:s}),r}onJoin(e){let{rendered:t,container:i}=e;if(i){let[n,r]=i;this.el=_.replaceRootContainer(this.el,n,r)}this.childJoins=0,this.joinPending=!0,this.flash=null,Oe.dropLocal(this.liveSocket.localStorage,window.location.pathname,Tn),this.applyDiff("mount",t,({diff:n,events:r})=>{this.rendered=new en(this.id,n);let s=this.renderContainer(null,"join");this.dropPendingRefs();let o=this.formsForRecovery(s);this.joinCount++,o.length>0?o.forEach(([a,l,h],d)=>{this.pushFormRecovery(a,h,c=>{d===o.length-1&&this.onJoinComplete(c,s,r)})}):this.onJoinComplete(e,s,r)})}dropPendingRefs(){_.all(document,`[${Ne}="${this.id}"][${ye}]`,e=>{e.removeAttribute(ye),e.removeAttribute(Ne)})}onJoinComplete({live_patch:e},t,i){if(this.joinCount>1||this.parent&&!this.parent.isJoinPending())return this.applyJoinPatch(e,t,i);_.findPhxChildrenInFragment(t,this.id).filter(r=>{let s=r.id&&this.el.querySelector(`[id="${r.id}"]`),o=s&&s.getAttribute(nt);return o&&r.setAttribute(nt,o),this.joinChild(r)}).length===0?this.parent?(this.root.pendingJoinOps.push([this,()=>this.applyJoinPatch(e,t,i)]),this.parent.ackJoin(this)):(this.onAllChildJoinsComplete(),this.applyJoinPatch(e,t,i)):this.root.pendingJoinOps.push([this,()=>this.applyJoinPatch(e,t,i)])}attachTrueDocEl(){this.el=_.byId(this.id),this.el.setAttribute(ct,this.root.id)}applyJoinPatch(e,t,i){this.attachTrueDocEl();let n=new At(this,this.el,this.id,t,null);if(n.markPrunableContentForRemoval(),this.performPatch(n,!1),this.joinNewChildren(),_.all(this.el,`[${this.binding(ze)}], [data-phx-${ze}]`,r=>{let s=this.addHook(r);s&&s.__mounted()}),this.joinPending=!1,this.liveSocket.dispatchEvents(i),this.applyPendingUpdates(),e){let{kind:r,to:s}=e;this.liveSocket.historyPatch(s,r)}this.hideLoader(),this.joinCount>1&&this.triggerReconnected(),this.stopCallback()}triggerBeforeUpdateHook(e,t){this.liveSocket.triggerDOM("onBeforeElUpdated",[e,t]);let i=this.getHook(e),n=i&&_.isIgnored(e,this.binding(ci));if(i&&!e.isEqualNode(t)&&!(n&&Mr(e.dataset,t.dataset)))return i.__beforeUpdate(),i}performPatch(e,t){let i=[],n=!1,r=new Set;return e.after("added",s=>{this.liveSocket.triggerDOM("onNodeAdded",[s]);let o=this.addHook(s);o&&o.__mounted()}),e.after("phxChildAdded",s=>{_.isPhxSticky(s)?this.liveSocket.joinRootViews():n=!0}),e.before("updated",(s,o)=>{this.triggerBeforeUpdateHook(s,o)&&r.add(s.id)}),e.after("updated",s=>{r.has(s.id)&&this.getHook(s).__updated()}),e.after("discarded",s=>{s.nodeType===Node.ELEMENT_NODE&&i.push(s)}),e.after("transitionsDiscarded",s=>this.afterElementsRemoved(s,t)),e.perform(),this.afterElementsRemoved(i,t),n}afterElementsRemoved(e,t){let i=[];e.forEach(n=>{let r=_.all(n,`[${le}]`),s=_.all(n,`[${this.binding(ze)}]`);r.concat(n).forEach(o=>{let a=this.componentID(o);De(a)&&i.indexOf(a)===-1&&i.push(a)}),s.concat(n).forEach(o=>{let a=this.getHook(o);a&&this.destroyHook(a)})}),t&&this.maybePushComponentsDestroyed(i)}joinNewChildren(){_.findPhxChildren(this.el,this.id).forEach(e=>this.joinChild(e))}getChildById(e){return this.root.children[this.id][e]}getDescendentByEl(e){return e.id===this.id?this:this.children[e.getAttribute(Be)][e.id]}destroyDescendent(e){for(let t in this.root.children)for(let i in this.root.children[t])if(i===e)return this.root.children[t][i].destroy()}joinChild(e){if(!this.getChildById(e.id)){let i=new xn(e,this.liveSocket,this);return this.root.children[this.id][i.id]=i,i.join(),this.childJoins++,!0}}isJoinPending(){return this.joinPending}ackJoin(e){this.childJoins--,this.childJoins===0&&(this.parent?this.parent.ackJoin(this):this.onAllChildJoinsComplete())}onAllChildJoinsComplete(){this.joinCallback(()=>{this.pendingJoinOps.forEach(([e,t])=>{e.isDestroyed()||t()}),this.pendingJoinOps=[]})}update(e,t){if(this.isJoinPending()||this.liveSocket.hasPendingLink()&&!_.isPhxSticky(this.el))return this.pendingDiffs.push({diff:e,events:t});this.rendered.mergeDiff(e);let i=!1;this.rendered.isComponentOnlyDiff(e)?this.liveSocket.time("component patch complete",()=>{_.findParentCIDs(this.el,this.rendered.componentCIDs(e)).forEach(r=>{this.componentPatch(this.rendered.getComponent(e,r),r)&&(i=!0)})}):Xi(e)||this.liveSocket.time("full patch complete",()=>{let n=this.renderContainer(e,"update"),r=new At(this,this.el,this.id,n,null);i=this.performPatch(r,!0)}),this.liveSocket.dispatchEvents(t),i&&this.joinNewChildren()}renderContainer(e,t){return this.liveSocket.time(`toString diff (${t})`,()=>{let i=this.el.tagName,n=e?this.rendered.componentCIDs(e).concat(this.pruningCIDs):null,r=this.rendered.toString(n);return`<${i}>${r}</${i}>`})}componentPatch(e,t){if(Xi(e))return!1;let i=this.rendered.componentToString(t),n=new At(this,this.el,this.id,i,t);return this.performPatch(n,!0)}getHook(e){return this.viewHooks[Ze.elementID(e)]}addHook(e){if(Ze.elementID(e)||!e.getAttribute)return;let t=e.getAttribute(`data-phx-${ze}`)||e.getAttribute(this.binding(ze));if(t&&!this.ownsElement(e))return;let i=this.liveSocket.getHookCallbacks(t);if(i){e.id||Q(`no DOM ID for hook "${t}". Hooks require a unique ID on each element.`,e);let n=new Ze(this,e,i);return this.viewHooks[Ze.elementID(n.el)]=n,n}else t!==null&&Q(`unknown hook found for "${t}"`,e)}destroyHook(e){e.__destroyed(),e.__cleanup__(),delete this.viewHooks[Ze.elementID(e.el)]}applyPendingUpdates(){this.pendingDiffs.forEach(({diff:e,events:t})=>this.update(e,t)),this.pendingDiffs=[]}onChannel(e,t){this.liveSocket.onChannel(this.channel,e,i=>{this.isJoinPending()?this.root.pendingJoinOps.push([this,()=>t(i)]):this.liveSocket.requestDOMUpdate(()=>t(i))})}bindChannel(){this.liveSocket.onChannel(this.channel,"diff",e=>{this.liveSocket.requestDOMUpdate(()=>{this.applyDiff("update",e,({diff:t,events:i})=>this.update(t,i))})}),this.onChannel("redirect",({to:e,flash:t})=>this.onRedirect({to:e,flash:t})),this.onChannel("live_patch",e=>this.onLivePatch(e)),this.onChannel("live_redirect",e=>this.onLiveRedirect(e)),this.channel.onError(e=>this.onError(e)),this.channel.onClose(e=>this.onClose(e))}destroyAllChildren(){for(let e in this.root.children[this.id])this.getChildById(e).destroy()}onLiveRedirect(e){let{to:t,kind:i,flash:n}=e,r=this.expandURL(t);this.liveSocket.historyRedirect(r,i,n)}onLivePatch(e){let{to:t,kind:i}=e;this.href=this.expandURL(t),this.liveSocket.historyPatch(t,i)}expandURL(e){return e.startsWith("/")?`${window.location.protocol}//${window.location.host}${e}`:e}onRedirect({to:e,flash:t}){this.liveSocket.redirect(e,t)}isDestroyed(){return this.destroyed}join(e){this.isMain()&&(this.stopCallback=this.liveSocket.withPageLoading({to:this.href,kind:"initial"})),this.joinCallback=t=>{t=t||function(){},e?e(this.joinCount,t):t()},this.liveSocket.wrapPush(this,{timeout:!1},()=>this.channel.join().receive("ok",t=>{this.isDestroyed()||this.liveSocket.requestDOMUpdate(()=>this.onJoin(t))}).receive("error",t=>!this.isDestroyed()&&this.onJoinError(t)).receive("timeout",()=>!this.isDestroyed()&&this.onJoinError({reason:"timeout"})))}onJoinError(e){if(e.reason==="unauthorized"||e.reason==="stale")return this.log("error",()=>["unauthorized live_redirect. Falling back to page request",e]),this.onRedirect({to:this.href});if((e.redirect||e.live_redirect)&&(this.joinPending=!1,this.channel.leave()),e.redirect)return this.onRedirect(e.redirect);if(e.live_redirect)return this.onLiveRedirect(e.live_redirect);this.log("error",()=>["unable to join",e]),this.liveSocket.isConnected()&&this.liveSocket.reloadWithJitter(this)}onClose(e){if(!this.isDestroyed()){if(this.liveSocket.hasPendingLink()&&e!=="leave")return this.liveSocket.reloadWithJitter(this);this.destroyAllChildren(),this.liveSocket.dropActiveElement(this),document.activeElement&&document.activeElement.blur(),this.liveSocket.isUnloaded()&&this.showLoader(Or)}}onError(e){this.onClose(e),this.liveSocket.isConnected()&&this.log("error",()=>["view crashed",e]),this.liveSocket.isUnloaded()||this.displayError()}displayError(){this.isMain()&&_.dispatchEvent(window,"phx:page-loading-start",{detail:{to:this.href,kind:"error"}}),this.showLoader(),this.setContainerClasses(Xt,Bi)}pushWithReply(e,t,i,n=function(){}){if(!this.isConnected())return;let[r,[s],o]=e?e():[null,[],{}],a=function(){};return(o.page_loading||s&&s.getAttribute(this.binding(Hi))!==null)&&(a=this.liveSocket.withPageLoading({kind:"element",target:s})),typeof i.cid!="number"&&delete i.cid,this.liveSocket.wrapPush(this,{timeout:!0},()=>this.channel.push(t,i,Lr).receive("ok",l=>{r!==null&&this.undoRefs(r);let h=d=>{l.redirect&&this.onRedirect(l.redirect),l.live_patch&&this.onLivePatch(l.live_patch),l.live_redirect&&this.onLiveRedirect(l.live_redirect),a(),n(l,d)};l.diff?this.liveSocket.requestDOMUpdate(()=>{let d=this.applyDiff("update",l.diff,({diff:c,events:g})=>{this.update(c,g)});h(d)}):h(null)}))}undoRefs(e){_.all(document,`[${Ne}="${this.id}"][${ye}="${e}"]`,t=>{let i=t.getAttribute(mt);t.removeAttribute(ye),t.removeAttribute(Ne),t.getAttribute(zt)!==null&&(t.readOnly=!1,t.removeAttribute(zt)),i!==null&&(t.disabled=i==="true",t.removeAttribute(mt)),Sn.forEach(s=>_.removeClass(t,s));let n=t.getAttribute(vt);n!==null&&(t.innerText=n,t.removeAttribute(vt));let r=_.private(t,ye);if(r){let s=this.triggerBeforeUpdateHook(t,r);At.patchEl(t,r,this.liveSocket.getActiveElement()),s&&s.__updated(),_.deletePrivate(t,ye)}})}putRef(e,t,i={}){let n=this.ref++,r=this.binding(li);return i.loading&&(e=e.concat(_.all(document,i.loading))),e.forEach(s=>{s.classList.add(`phx-${t}-loading`),s.setAttribute(ye,n),s.setAttribute(Ne,this.el.id);let o=s.getAttribute(r);o!==null&&(s.getAttribute(vt)||s.setAttribute(vt,s.innerText),o!==""&&(s.innerText=o),s.setAttribute("disabled",""))}),[n,e,i]}componentID(e){let t=e.getAttribute&&e.getAttribute(le);return t?parseInt(t):null}targetComponentID(e,t,i={}){if(De(t))return t;let n=e.getAttribute(this.binding("target"));return De(n)?parseInt(n):t&&(n!==null||i.target)?this.closestComponentID(t):null}closestComponentID(e){return De(e)?e:e?Te(e.closest(`[${le}]`),t=>this.ownsElement(t)&&this.componentID(t)):null}pushHookEvent(e,t,i,n){if(!this.isConnected())return this.log("hook",()=>["unable to push hook event. LiveView not connected",t,i]),!1;let[r,s,o]=this.putRef([],"hook");return this.pushWithReply(()=>[r,s,o],"event",{type:"hook",event:t,value:i,cid:this.closestComponentID(e)},(a,l)=>n(l,r)),r}extractMeta(e,t,i){let n=this.binding("value-");for(let r=0;r<e.attributes.length;r++){t||(t={});let s=e.attributes[r].name;s.startsWith(n)&&(t[s.replace(n,"")]=e.getAttribute(s))}if(e.value!==void 0&&(t||(t={}),t.value=e.value,e.tagName==="INPUT"&&Dn.indexOf(e.type)>=0&&!e.checked&&delete t.value),i){t||(t={});for(let r in i)t[r]=i[r]}return t}pushEvent(e,t,i,n,r,s={}){this.pushWithReply(()=>this.putRef([t],e,s),"event",{type:e,event:n,value:this.extractMeta(t,r,s.value),cid:this.targetComponentID(t,i,s)})}pushFileProgress(e,t,i,n=function(){}){this.liveSocket.withinOwners(e.form,(r,s)=>{r.pushWithReply(null,"progress",{event:e.getAttribute(r.binding(Sr)),ref:e.getAttribute(Me),entry_ref:t,progress:i,cid:r.targetComponentID(e.form,s)},n)})}pushInput(e,t,i,n,r,s){let o,a=De(i)?i:this.targetComponentID(e.form,t),l=()=>this.putRef([e,e.form],"change",r),h;e.getAttribute(this.binding("change"))?h=wt(e.form,{_target:r._target},[e.name]):h=wt(e.form,{_target:r._target}),_.isUploadInput(e)&&e.files&&e.files.length>0&&G.trackFiles(e,Array.from(e.files)),o=G.serializeUploads(e);let d={type:"form",event:n,value:h,uploads:o,cid:a};this.pushWithReply(l,"event",d,c=>{if(_.showError(e,this.liveSocket.binding(ai)),_.isUploadInput(e)&&e.getAttribute("data-phx-auto-upload")!==null){if(G.filesAwaitingPreflight(e).length>0){let[g,u]=l();this.uploadFiles(e.form,t,g,a,v=>{s&&s(c),this.triggerAwaitingSubmit(e.form)})}}else s&&s(c)})}triggerAwaitingSubmit(e){let t=this.getScheduledSubmit(e);if(t){let[i,n,r,s]=t;this.cancelSubmit(e),s()}}getScheduledSubmit(e){return this.formSubmits.find(([t,i,n,r])=>t.isSameNode(e))}scheduleSubmit(e,t,i,n){if(this.getScheduledSubmit(e))return!0;this.formSubmits.push([e,t,i,n])}cancelSubmit(e){this.formSubmits=this.formSubmits.filter(([t,i,n])=>t.isSameNode(e)?(this.undoRefs(i),!1):!0)}pushFormSubmit(e,t,i,n,r){let s=c=>!(rt(c,`${this.binding(ci)}=ignore`,c.form)||rt(c,"data-phx-update=ignore",c.form)),o=c=>c.hasAttribute(this.binding(li)),a=c=>c.tagName=="BUTTON",l=c=>["INPUT","TEXTAREA","SELECT"].includes(c.tagName),h=()=>{let c=Array.from(e.elements),g=c.filter(o),u=c.filter(a).filter(s),v=c.filter(l).filter(s);return u.forEach(m=>{m.setAttribute(mt,m.disabled),m.disabled=!0}),v.forEach(m=>{m.setAttribute(zt,m.readOnly),m.readOnly=!0,m.files&&(m.setAttribute(mt,m.disabled),m.disabled=!0)}),e.setAttribute(this.binding(Hi),""),this.putRef([e].concat(g).concat(u).concat(v),"submit",n)},d=this.targetComponentID(e,t);if(G.hasUploadsInProgress(e)){let[c,g]=h(),u=()=>this.pushFormSubmit(e,t,i,n,r);return this.scheduleSubmit(e,c,n,u)}else if(G.inputsAwaitingPreflight(e).length>0){let[c,g]=h(),u=()=>[c,g,n];this.uploadFiles(e,t,c,d,v=>{let m=wt(e,{});this.pushWithReply(u,"event",{type:"form",event:i,value:m,cid:d},r)})}else{let c=wt(e,{});this.pushWithReply(h,"event",{type:"form",event:i,value:c,cid:d},r)}}uploadFiles(e,t,i,n,r){let s=this.joinCount,o=G.activeFileInputs(e),a=o.length;o.forEach(l=>{let h=new G(l,this,()=>{a--,a===0&&r()});this.uploaders[l]=h;let d=h.entries().map(g=>g.toPreflightPayload()),c={ref:l.getAttribute(Me),entries:d,cid:this.targetComponentID(l.form,t)};this.log("upload",()=>["sending preflight request",c]),this.pushWithReply(null,"allow_upload",c,g=>{if(this.log("upload",()=>["got preflight response",g]),g.error){this.undoRefs(i);let[u,v]=g.error;this.log("upload",()=>[`error for entry ${u}`,v])}else{let u=v=>{this.channel.onError(()=>{this.joinCount===s&&v()})};h.initAdapterUpload(g,u,this.liveSocket)}})})}dispatchUploads(e,t){let i=_.findUploadInputs(this.el).filter(n=>n.name===e);i.length===0?Q(`no live file inputs found matching the name "${e}"`):i.length>1?Q(`duplicate live file inputs found matching the name "${e}"`):_.dispatchEvent(i[0],kn,{detail:{files:t}})}pushFormRecovery(e,t,i){this.liveSocket.withinOwners(e,(n,r)=>{let s=e.elements[0],o=e.getAttribute(this.binding(Ui))||e.getAttribute(this.binding("change"));_e.exec("change",o,n,s,["push",{_target:s.name,newCid:t,callback:i}])})}pushLinkPatch(e,t,i){let n=this.liveSocket.setPendingLink(e),r=t?()=>this.putRef([t],"click"):null,s=()=>this.liveSocket.redirect(window.location.href),o=this.pushWithReply(r,"live_patch",{url:e},a=>{this.liveSocket.requestDOMUpdate(()=>{a.link_redirect?this.liveSocket.replaceMain(e,null,i,n):(this.liveSocket.commitPendingLink(n)&&(this.href=e),this.applyPendingUpdates(),i&&i(n))})});o?o.receive("timeout",s):s()}formsForRecovery(e){if(this.joinCount===0)return[];let t=this.binding("change"),i=document.createElement("template");return i.innerHTML=e,_.all(this.el,`form[${t}]`).filter(n=>n.id&&this.ownsElement(n)).filter(n=>n.elements.length>0).filter(n=>n.getAttribute(this.binding(Ui))!=="ignore").map(n=>{let r=i.content.querySelector(`form[id="${n.id}"][${t}="${n.getAttribute(t)}"]`);return r?[n,r,this.targetComponentID(r)]:[n,null,null]}).filter(([n,r,s])=>r)}maybePushComponentsDestroyed(e){let t=e.filter(i=>_.findComponentNodeList(this.el,i).length===0);t.length>0&&(this.pruningCIDs.push(...t),this.pushWithReply(null,"cids_will_destroy",{cids:t},()=>{this.pruningCIDs=this.pruningCIDs.filter(n=>t.indexOf(n)!==-1);let i=t.filter(n=>_.findComponentNodeList(this.el,n).length===0);i.length>0&&this.pushWithReply(null,"cids_destroyed",{cids:i},n=>{this.rendered.pruneCIDs(n.cids)})}))}ownsElement(e){return e.getAttribute(Be)===this.id||Te(e.closest(Fe),t=>t.id)===this.id}submitForm(e,t,i,n={}){_.putPrivate(e,Ln,!0);let r=this.liveSocket.binding(ai),s=Array.from(e.elements);this.liveSocket.blurActiveElement(this),this.pushFormSubmit(e,t,i,n,()=>{s.forEach(o=>_.showError(o,r)),this.liveSocket.restorePreviouslyActiveFocus()})}binding(e){return this.liveSocket.binding(e)}},rs=class{constructor(e,t,i={}){if(this.unloaded=!1,!t||t.constructor.name==="Object")throw new Error(`
a phoenix Socket must be provided as the second argument to the LiveSocket constructor. For example:
import {Socket} from "phoenix"
import {LiveSocket} from "phoenix_live_view"
let liveSocket = new LiveSocket("/live", Socket, {...})
`);this.socket=new t(e,i),this.bindingPrefix=i.bindingPrefix||Dr,this.opts=i,this.params=Qt(i.params||{}),this.viewLogger=i.viewLogger,this.metadataCallbacks=i.metadata||{},this.defaults=Object.assign(Tt(Pr),i.defaults||{}),this.activeElement=null,this.prevActive=null,this.silenced=!1,this.main=null,this.outgoingMainEl=null,this.clickStartedAtTarget=null,this.linkRef=1,this.roots={},this.href=window.location.href,this.pendingLink=null,this.currentLocation=Tt(window.location),this.hooks=i.hooks||{},this.uploaders=i.uploaders||{},this.loaderTimeout=i.loaderTimeout||kr,this.reloadWithJitterTimer=null,this.maxReloads=i.maxReloads||pr,this.reloadJitterMin=i.reloadJitterMin||gr,this.reloadJitterMax=i.reloadJitterMax||mr,this.failsafeJitter=i.failsafeJitter||vr,this.localStorage=i.localStorage||window.localStorage,this.sessionStorage=i.sessionStorage||window.sessionStorage,this.boundTopLevelEvents=!1,this.domCallbacks=Object.assign({onNodeAdded:Qt(),onBeforeElUpdated:Qt()},i.dom||{}),this.transitions=new ss,window.addEventListener("pagehide",n=>{this.unloaded=!0}),this.socket.onOpen(()=>{this.isUnloaded()&&window.location.reload()})}isProfileEnabled(){return this.sessionStorage.getItem(Yt)==="true"}isDebugEnabled(){return this.sessionStorage.getItem(bt)==="true"}isDebugDisabled(){return this.sessionStorage.getItem(bt)==="false"}enableDebug(){this.sessionStorage.setItem(bt,"true")}enableProfiling(){this.sessionStorage.setItem(Yt,"true")}disableDebug(){this.sessionStorage.setItem(bt,"false")}disableProfiling(){this.sessionStorage.removeItem(Yt)}enableLatencySim(e){this.enableDebug(),console.log("latency simulator enabled for the duration of this browser session. Call disableLatencySim() to disable"),this.sessionStorage.setItem(Gt,e)}disableLatencySim(){this.sessionStorage.removeItem(Gt)}getLatencySim(){let e=this.sessionStorage.getItem(Gt);return e?parseInt(e):null}getSocket(){return this.socket}connect(){window.location.hostname==="localhost"&&!this.isDebugDisabled()&&this.enableDebug();let e=()=>{this.joinRootViews()?(this.bindTopLevelEvents(),this.socket.connect()):this.main&&this.socket.connect()};["complete","loaded","interactive"].indexOf(document.readyState)>=0?e():document.addEventListener("DOMContentLoaded",()=>e())}disconnect(e){clearTimeout(this.reloadWithJitterTimer),this.socket.disconnect(e)}replaceTransport(e){clearTimeout(this.reloadWithJitterTimer),this.socket.replaceTransport(e),this.connect()}execJS(e,t,i=null){this.owner(e,n=>_e.exec(i,t,n,e))}triggerDOM(e,t){this.domCallbacks[e](...t)}time(e,t){if(!this.isProfileEnabled()||!console.time)return t();console.time(e);let i=t();return console.timeEnd(e),i}log(e,t,i){if(this.viewLogger){let[n,r]=i();this.viewLogger(e,t,n,r)}else if(this.isDebugEnabled()){let[n,r]=i();Ir(e,t,n,r)}}requestDOMUpdate(e){this.transitions.after(e)}transition(e,t,i=function(){}){this.transitions.addTransition(e,t,i)}onChannel(e,t,i){e.on(t,n=>{let r=this.getLatencySim();r?(console.log(`simulating ${r}ms of latency from server to client`),setTimeout(()=>i(n),r)):i(n)})}wrapPush(e,t,i){let n=this.getLatencySim(),r=e.joinCount;if(!n)return this.isConnected()&&t.timeout?i().receive("timeout",()=>{e.joinCount===r&&!e.isDestroyed()&&this.reloadWithJitter(e,()=>{this.log(e,"timeout",()=>["received timeout while communicating with server. Falling back to hard refresh for recovery"])})}):i();console.log(`simulating ${n}ms of latency from client to server`);let s={receives:[],receive(o,a){this.receives.push([o,a])}};return setTimeout(()=>{e.isDestroyed()||s.receives.reduce((o,[a,l])=>o.receive(a,l),i())},n),s}reloadWithJitter(e,t){clearTimeout(this.reloadWithJitterTimer),this.disconnect();let i=this.reloadJitterMin,n=this.reloadJitterMax,r=Math.floor(Math.random()*(n-i+1))+i,s=Oe.updateLocal(this.localStorage,window.location.pathname,Tn,0,o=>o+1);s>this.maxReloads&&(r=this.failsafeJitter),this.reloadWithJitterTimer=setTimeout(()=>{e.isDestroyed()||e.isConnected()||(e.destroy(),t?t():this.log(e,"join",()=>[`encountered ${s} consecutive reloads`]),s>this.maxReloads&&this.log(e,"join",()=>[`exceeded ${this.maxReloads} consecutive reloads. Entering failsafe mode`]),this.hasPendingLink()?window.location=this.pendingLink:window.location.reload())},r)}getHookCallbacks(e){return e&&e.startsWith("Phoenix.")?Br[e.split(".")[1]]:this.hooks[e]}isUnloaded(){return this.unloaded}isConnected(){return this.socket.isConnected()}getBindingPrefix(){return this.bindingPrefix}binding(e){return`${this.getBindingPrefix()}${e}`}channel(e,t){return this.socket.channel(e,t)}joinRootViews(){let e=!1;return _.all(document,`${Fe}:not([${Be}])`,t=>{if(!this.getRootById(t.id)){let i=this.newRootView(t);i.setHref(this.getHref()),i.join(),t.getAttribute(vi)&&(this.main=i)}e=!0}),e}redirect(e,t){this.disconnect(),Oe.redirect(e,t)}replaceMain(e,t,i=null,n=this.setPendingLink(e)){this.outgoingMainEl=this.outgoingMainEl||this.main.el;let r=_.cloneNode(this.outgoingMainEl,"");this.main.showLoader(this.loaderTimeout),this.main.destroy(),this.main=this.newRootView(r,t),this.main.setRedirect(e),this.transitionRemoves(),this.main.join((s,o)=>{s===1&&this.commitPendingLink(n)&&this.requestDOMUpdate(()=>{_.findPhxSticky(document).forEach(a=>r.appendChild(a)),this.outgoingMainEl.replaceWith(r),this.outgoingMainEl=null,i&&requestAnimationFrame(i),o()})})}transitionRemoves(e){let t=this.binding("remove");e=e||_.all(document,`[${t}]`),e.forEach(i=>{document.body.contains(i)&&this.execJS(i,i.getAttribute(t),"remove")})}isPhxView(e){return e.getAttribute&&e.getAttribute(Le)!==null}newRootView(e,t){let i=new xn(e,this,null,t);return this.roots[i.id]=i,i}owner(e,t){let i=Te(e.closest(Fe),n=>this.getViewByEl(n))||this.main;i&&t(i)}withinOwners(e,t){this.owner(e,i=>t(i,e))}getViewByEl(e){let t=e.getAttribute(ct);return Te(this.getRootById(t),i=>i.getDescendentByEl(e))}getRootById(e){return this.roots[e]}destroyAllViews(){for(let e in this.roots)this.roots[e].destroy(),delete this.roots[e];this.main=null}destroyViewByEl(e){let t=this.getRootById(e.getAttribute(ct));t&&t.id===e.id?(t.destroy(),delete this.roots[t.id]):t&&t.destroyDescendent(e.id)}setActiveElement(e){if(this.activeElement===e)return;this.activeElement=e;let t=()=>{e===this.activeElement&&(this.activeElement=null),e.removeEventListener("mouseup",this),e.removeEventListener("touchend",this)};e.addEventListener("mouseup",t),e.addEventListener("touchend",t)}getActiveElement(){return document.activeElement===document.body?this.activeElement||document.activeElement:document.activeElement||document.body}dropActiveElement(e){this.prevActive&&e.ownsElement(this.prevActive)&&(this.prevActive=null)}restorePreviouslyActiveFocus(){this.prevActive&&this.prevActive!==document.body&&this.prevActive.focus()}blurActiveElement(){this.prevActive=this.getActiveElement(),this.prevActive!==document.body&&this.prevActive.blur()}bindTopLevelEvents(){this.boundTopLevelEvents||(this.boundTopLevelEvents=!0,this.socket.onClose(e=>{e&&e.code===1e3&&this.main&&this.reloadWithJitter(this.main)}),document.body.addEventListener("click",function(){}),window.addEventListener("pageshow",e=>{e.persisted&&(this.getSocket().disconnect(),this.withPageLoading({to:window.location.href,kind:"redirect"}),window.location.reload())},!0),this.bindNav(),this.bindClicks(),this.bindForms(),this.bind({keyup:"keyup",keydown:"keydown"},(e,t,i,n,r,s)=>{let o=n.getAttribute(this.binding(Tr)),a=e.key&&e.key.toLowerCase();if(o&&o.toLowerCase()!==a)return;let l={key:e.key,...this.eventMeta(t,e,n)};_e.exec(t,r,i,n,["push",{data:l}])}),this.bind({blur:"focusout",focus:"focusin"},(e,t,i,n,r,s)=>{if(!s){let o={key:e.key,...this.eventMeta(t,e,n)};_e.exec(t,r,i,n,["push",{data:o}])}}),this.bind({blur:"blur",focus:"focus"},(e,t,i,n,r,s,o)=>{if(o==="window"){let a=this.eventMeta(t,e,n);_e.exec(t,s,i,n,["push",{data:a}])}}),window.addEventListener("dragover",e=>e.preventDefault()),window.addEventListener("drop",e=>{e.preventDefault();let t=Te(rt(e.target,this.binding(Ii)),r=>r.getAttribute(this.binding(Ii))),i=t&&document.getElementById(t),n=Array.from(e.dataTransfer.files||[]);!i||i.disabled||n.length===0||!(i.files instanceof FileList)||(G.trackFiles(i,n),i.dispatchEvent(new Event("input",{bubbles:!0})))}),this.on(kn,e=>{let t=e.target;if(!_.isUploadInput(t))return;let i=Array.from(e.detail.files||[]).filter(n=>n instanceof File||n instanceof Blob);G.trackFiles(t,i),t.dispatchEvent(new Event("input",{bubbles:!0}))}))}eventMeta(e,t,i){let n=this.metadataCallbacks[e];return n?n(t,i):{}}setPendingLink(e){return this.linkRef++,this.pendingLink=e,this.linkRef}commitPendingLink(e){return this.linkRef!==e?!1:(this.href=this.pendingLink,this.pendingLink=null,!0)}getHref(){return this.href}hasPendingLink(){return!!this.pendingLink}bind(e,t){for(let i in e){let n=e[i];this.on(n,r=>{let s=this.binding(i),o=this.binding(`window-${i}`),a=r.target.getAttribute&&r.target.getAttribute(s);a?this.debounce(r.target,r,n,()=>{this.withinOwners(r.target,l=>{t(r,i,l,r.target,a,null)})}):_.all(document,`[${o}]`,l=>{let h=l.getAttribute(o);this.debounce(l,r,n,()=>{this.withinOwners(l,d=>{t(r,i,d,l,h,"window")})})})})}}bindClicks(){window.addEventListener("mousedown",e=>this.clickStartedAtTarget=e.target),this.bindClick("click","click",!1),this.bindClick("mousedown","capture-click",!0)}bindClick(e,t,i){let n=this.binding(t);window.addEventListener(e,r=>{let s=null;if(i)s=r.target.matches(`[${n}]`)?r.target:r.target.querySelector(`[${n}]`);else{let a=this.clickStartedAtTarget||r.target;s=rt(a,n),this.dispatchClickAway(r,a),this.clickStartedAtTarget=null}let o=s&&s.getAttribute(n);o&&(s.getAttribute("href")==="#"&&r.preventDefault(),this.debounce(s,r,"click",()=>{this.withinOwners(s,a=>{_e.exec("click",o,a,s,["push",{data:this.eventMeta("click",r,s)}])})}))},i)}dispatchClickAway(e,t){let i=this.binding("click-away");_.all(document,`[${i}]`,n=>{n.isSameNode(t)||n.contains(t)||this.withinOwners(e.target,r=>{let s=n.getAttribute(i);_e.isVisible(n)&&_e.exec("click",s,r,n,["push",{data:this.eventMeta("click",e,e.target)}])})})}bindNav(){if(!Oe.canPushState())return;history.scrollRestoration&&(history.scrollRestoration="manual");let e=null;window.addEventListener("scroll",t=>{clearTimeout(e),e=setTimeout(()=>{Oe.updateCurrentState(i=>Object.assign(i,{scroll:window.scrollY}))},100)}),window.addEventListener("popstate",t=>{if(!this.registerNewLocation(window.location))return;let{type:i,id:n,root:r,scroll:s}=t.state||{},o=window.location.href;this.requestDOMUpdate(()=>{this.main.isConnected()&&i==="patch"&&n===this.main.id?this.main.pushLinkPatch(o,null):this.replaceMain(o,null,()=>{r&&this.replaceRootHistory(),typeof s=="number"&&setTimeout(()=>{window.scrollTo(0,s)},0)})})},!1),window.addEventListener("click",t=>{let i=rt(t.target,Jt),n=i&&i.getAttribute(Jt),r=t.metaKey||t.ctrlKey||t.button===1;if(!n||!this.isConnected()||!this.main||r)return;let s=i.href,o=i.getAttribute(_r);t.preventDefault(),t.stopImmediatePropagation(),this.pendingLink!==s&&this.requestDOMUpdate(()=>{if(n==="patch")this.pushHistoryPatch(s,o,i);else if(n==="redirect")this.historyRedirect(s,o);else throw new Error(`expected ${Jt} to be "patch" or "redirect", got: ${n}`)})},!1)}dispatchEvent(e,t={}){_.dispatchEvent(window,`phx:${e}`,{detail:t})}dispatchEvents(e){e.forEach(([t,i])=>this.dispatchEvent(t,i))}withPageLoading(e,t){_.dispatchEvent(window,"phx:page-loading-start",{detail:e});let i=()=>_.dispatchEvent(window,"phx:page-loading-stop",{detail:e});return t?t(i):i}pushHistoryPatch(e,t,i){this.withPageLoading({to:e,kind:"patch"},n=>{this.main.pushLinkPatch(e,i,r=>{this.historyPatch(e,t,r),n()})})}historyPatch(e,t,i=this.setPendingLink(e)){this.commitPendingLink(i)&&(Oe.pushState(t,{type:"patch",id:this.main.id},e),this.registerNewLocation(window.location))}historyRedirect(e,t,i){let n=window.scrollY;this.withPageLoading({to:e,kind:"redirect"},r=>{this.replaceMain(e,i,()=>{Oe.pushState(t,{type:"redirect",id:this.main.id,scroll:n},e),this.registerNewLocation(window.location),r()})})}replaceRootHistory(){Oe.pushState("replace",{root:!0,type:"patch",id:this.main.id})}registerNewLocation(e){let{pathname:t,search:i}=this.currentLocation;return t+i===e.pathname+e.search?!1:(this.currentLocation=Tt(e),!0)}bindForms(){let e=0;this.on("submit",t=>{let i=t.target.getAttribute(this.binding("submit"));i&&(t.preventDefault(),t.target.disabled=!0,this.withinOwners(t.target,n=>{_e.exec("submit",i,n,t.target,["push",{}])}))},!1);for(let t of["change","input"])this.on(t,i=>{let n=this.binding("change"),r=i.target,s=r.getAttribute(n),o=r.form&&r.form.getAttribute(n),a=s||o;if(!a||r.type==="number"&&r.validity&&r.validity.badInput)return;let l=s?r:r.form,h=e;e++;let{at:d,type:c}=_.private(r,"prev-iteration")||{};d===h-1&&t!==c||(_.putPrivate(r,"prev-iteration",{at:h,type:t}),this.debounce(r,i,t,()=>{this.withinOwners(l,g=>{_.putPrivate(r,On,!0),_.isTextualInput(r)||this.setActiveElement(r),_e.exec("change",a,g,r,["push",{_target:i.target.name,dispatcher:l}])})}))},!1)}debounce(e,t,i,n){if(i==="blur"||i==="focusout")return n();let r=this.binding(wr),s=this.binding(Cr),o=this.defaults.debounce.toString(),a=this.defaults.throttle.toString();this.withinOwners(e,l=>{let h=()=>!l.isDestroyed()&&document.body.contains(e);_.debounce(e,t,r,o,s,a,h,()=>{n()})})}silenceEvents(e){this.silenced=!0,e(),this.silenced=!1}on(e,t){window.addEventListener(e,i=>{this.silenced||t(i)})}},ss=class{constructor(){this.transitions=new Set,this.pendingOps=[],this.reset()}reset(){this.transitions.forEach(e=>{cancelTimeout(e),this.transitions.delete(e)}),this.flushPendingOps()}after(e){this.size()===0?e():this.pushPendingOp(e)}addTransition(e,t,i){t();let n=setTimeout(()=>{this.transitions.delete(n),i(),this.size()===0&&this.flushPendingOps()},e);this.transitions.add(n)}pushPendingOp(e){this.pendingOps.push(e)}size(){return this.transitions.size}flushPendingOps(){this.pendingOps.forEach(e=>e()),this.pendingOps=[]}},tn={},os={get exports(){return tn},set exports(e){tn=e}},st={},as={get exports(){return st},set exports(e){st=e}};/*!
* Bootstrap index.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/var nn;function me(){return nn||(nn=1,function(e,t){(function(i,n){n(t)})(Z,function(i){const s="transitionend",o=p=>p==null?`${p}`:Object.prototype.toString.call(p).match(/\s([a-z]+)/i)[1].toLowerCase(),a=p=>{do p+=Math.floor(Math.random()*1e6);while(document.getElementById(p));return p},l=p=>{let O=p.getAttribute("data-bs-target");if(!O||O==="#"){let R=p.getAttribute("href");if(!R||!R.includes("#")&&!R.startsWith("."))return null;R.includes("#")&&!R.startsWith("#")&&(R=`#${R.split("#")[1]}`),O=R&&R!=="#"?R.trim():null}return O},h=p=>{const O=l(p);return O&&document.querySelector(O)?O:null},d=p=>{const O=l(p);return O?document.querySelector(O):null},c=p=>{if(!p)return 0;let{transitionDuration:O,transitionDelay:R}=window.getComputedStyle(p);const T=Number.parseFloat(O),w=Number.parseFloat(R);return!T&&!w?0:(O=O.split(",")[0],R=R.split(",")[0],(Number.parseFloat(O)+Number.parseFloat(R))*1e3)},g=p=>{p.dispatchEvent(new Event(s))},u=p=>!p||typeof p!="object"?!1:(typeof p.jquery<"u"&&(p=p[0]),typeof p.nodeType<"u"),v=p=>u(p)?p.jquery?p[0]:p:typeof p=="string"&&p.length>0?document.querySelector(p):null,m=p=>{if(!u(p)||p.getClientRects().length===0)return!1;const O=getComputedStyle(p).getPropertyValue("visibility")==="visible",R=p.closest("details:not([open])");if(!R)return O;if(R!==p){const T=p.closest("summary");if(T&&T.parentNode!==R||T===null)return!1}return O},y=p=>!p||p.nodeType!==Node.ELEMENT_NODE||p.classList.contains("disabled")?!0:typeof p.disabled<"u"?p.disabled:p.hasAttribute("disabled")&&p.getAttribute("disabled")!=="false",S=p=>{if(!document.documentElement.attachShadow)return null;if(typeof p.getRootNode=="function"){const O=p.getRootNode();return O instanceof ShadowRoot?O:null}return p instanceof ShadowRoot?p:p.parentNode?S(p.parentNode):null},N=()=>{},f=p=>{p.offsetHeight},A=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,P=[],E=p=>{document.readyState==="loading"?(P.length||document.addEventListener("DOMContentLoaded",()=>{for(const O of P)O()}),P.push(p)):p()},C=()=>document.documentElement.dir==="rtl",x=p=>{E(()=>{const O=A();if(O){const R=p.NAME,T=O.fn[R];O.fn[R]=p.jQueryInterface,O.fn[R].Constructor=p,O.fn[R].noConflict=()=>(O.fn[R]=T,p.jQueryInterface)}})},k=p=>{typeof p=="function"&&p()},M=(p,O,R=!0)=>{if(!R){k(p);return}const T=5,w=c(O)+T;let b=!1;const D=({target:I})=>{I===O&&(b=!0,O.removeEventListener(s,D),k(p))};O.addEventListener(s,D),setTimeout(()=>{b||g(O)},w)},H=(p,O,R,T)=>{const w=p.length;let b=p.indexOf(O);return b===-1?!R&&T?p[w-1]:p[0]:(b+=R?1:-1,T&&(b=(b+w)%w),p[Math.max(0,Math.min(b,w-1))])};i.defineJQueryPlugin=x,i.execute=k,i.executeAfterTransition=M,i.findShadowRoot=S,i.getElement=v,i.getElementFromSelector=d,i.getNextActiveElement=H,i.getSelectorFromElement=h,i.getTransitionDurationFromElement=c,i.getUID=a,i.getjQuery=A,i.isDisabled=y,i.isElement=u,i.isRTL=C,i.isVisible=m,i.noop=N,i.onDOMContentLoaded=E,i.reflow=f,i.toType=o,i.triggerTransitionEnd=g,Object.defineProperties(i,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})})}(as,st)),st}var Ot={},ls={get exports(){return Ot},set exports(e){Ot=e}};/*!
* Bootstrap event-handler.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/var rn;function Pe(){return rn||(rn=1,function(e,t){(function(i,n){e.exports=n(me())})(Z,function(i){const n=/[^.]*(?=\..*)\.|.*/,r=/\..*/,s=/::\d+$/,o={};let a=1;const l={mouseenter:"mouseover",mouseleave:"mouseout"},h=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function d(E,C){return C&&`${C}::${a++}`||E.uidEvent||a++}function c(E){const C=d(E);return E.uidEvent=C,o[C]=o[C]||{},o[C]}function g(E,C){return function x(k){return P(k,{delegateTarget:E}),x.oneOff&&A.off(E,k.type,C),C.apply(E,[k])}}function u(E,C,x){return function k(M){const H=E.querySelectorAll(C);for(let{target:p}=M;p&&p!==this;p=p.parentNode)for(const O of H)if(O===p)return P(M,{delegateTarget:p}),k.oneOff&&A.off(E,M.type,C,x),x.apply(p,[M])}}function v(E,C,x=null){return Object.values(E).find(k=>k.callable===C&&k.delegationSelector===x)}function m(E,C,x){const k=typeof C=="string",M=k?x:C||x;let H=f(E);return h.has(H)||(H=E),[k,M,H]}function y(E,C,x,k,M){if(typeof C!="string"||!E)return;let[H,p,O]=m(C,x,k);C in l&&(p=(U=>function(B){if(!B.relatedTarget||B.relatedTarget!==B.delegateTarget&&!B.delegateTarget.contains(B.relatedTarget))return U.call(this,B)})(p));const R=c(E),T=R[O]||(R[O]={}),w=v(T,p,H?x:null);if(w){w.oneOff=w.oneOff&&M;return}const b=d(p,C.replace(n,"")),D=H?u(E,x,p):g(E,p);D.delegationSelector=H?x:null,D.callable=p,D.oneOff=M,D.uidEvent=b,T[b]=D,E.addEventListener(O,D,H)}function S(E,C,x,k,M){const H=v(C[x],k,M);H&&(E.removeEventListener(x,H,Boolean(M)),delete C[x][H.uidEvent])}function N(E,C,x,k){const M=C[x]||{};for(const H of Object.keys(M))if(H.includes(k)){const p=M[H];S(E,C,x,p.callable,p.delegationSelector)}}function f(E){return E=E.replace(r,""),l[E]||E}const A={on(E,C,x,k){y(E,C,x,k,!1)},one(E,C,x,k){y(E,C,x,k,!0)},off(E,C,x,k){if(typeof C!="string"||!E)return;const[M,H,p]=m(C,x,k),O=p!==C,R=c(E),T=R[p]||{},w=C.startsWith(".");if(typeof H<"u"){if(!Object.keys(T).length)return;S(E,R,p,H,M?x:null);return}if(w)for(const b of Object.keys(R))N(E,R,b,C.slice(1));for(const b of Object.keys(T)){const D=b.replace(s,"");if(!O||C.includes(D)){const I=T[b];S(E,R,p,I.callable,I.delegationSelector)}}},trigger(E,C,x){if(typeof C!="string"||!E)return null;const k=i.getjQuery(),M=f(C),H=C!==M;let p=null,O=!0,R=!0,T=!1;H&&k&&(p=k.Event(C,x),k(E).trigger(p),O=!p.isPropagationStopped(),R=!p.isImmediatePropagationStopped(),T=p.isDefaultPrevented());let w=new Event(C,{bubbles:O,cancelable:!0});return w=P(w,x),T&&w.preventDefault(),R&&E.dispatchEvent(w),w.defaultPrevented&&p&&p.preventDefault(),w}};function P(E,C){for(const[x,k]of Object.entries(C||{}))try{E[x]=k}catch{Object.defineProperty(E,x,{configurable:!0,get(){return k}})}return E}return A})}(ls)),Ot}var Dt={},cs={get exports(){return Dt},set exports(e){Dt=e}},Lt={},hs={get exports(){return Lt},set exports(e){Lt=e}};/*!
* Bootstrap data.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/var sn;function ds(){return sn||(sn=1,function(e,t){(function(i,n){e.exports=n()})(Z,function(){const i=new Map;return{set(r,s,o){i.has(r)||i.set(r,new Map);const a=i.get(r);if(!a.has(s)&&a.size!==0){console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(a.keys())[0]}.`);return}a.set(s,o)},get(r,s){return i.has(r)&&i.get(r).get(s)||null},remove(r,s){if(!i.has(r))return;const o=i.get(r);o.delete(s),o.size===0&&i.delete(r)}}})}(hs)),Lt}var Pt={},us={get exports(){return Pt},set exports(e){Pt=e}},xt={},fs={get exports(){return xt},set exports(e){xt=e}};/*!
* Bootstrap manipulator.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/var on;function bi(){return on||(on=1,function(e,t){(function(i,n){e.exports=n()})(Z,function(){function i(s){if(s==="true")return!0;if(s==="false")return!1;if(s===Number(s).toString())return Number(s);if(s===""||s==="null")return null;if(typeof s!="string")return s;try{return JSON.parse(decodeURIComponent(s))}catch{return s}}function n(s){return s.replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`)}return{setDataAttribute(s,o,a){s.setAttribute(`data-bs-${n(o)}`,a)},removeDataAttribute(s,o){s.removeAttribute(`data-bs-${n(o)}`)},getDataAttributes(s){if(!s)return{};const o={},a=Object.keys(s.dataset).filter(l=>l.startsWith("bs")&&!l.startsWith("bsConfig"));for(const l of a){let h=l.replace(/^bs/,"");h=h.charAt(0).toLowerCase()+h.slice(1,h.length),o[h]=i(s.dataset[l])}return o},getDataAttribute(s,o){return i(s.getAttribute(`data-bs-${n(o)}`))}}})}(fs)),xt}/*!
* Bootstrap config.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/var an;function _i(){return an||(an=1,function(e,t){(function(i,n){e.exports=n(me(),bi())})(Z,function(i,n){const s=(a=>a&&typeof a=="object"&&"default"in a?a:{default:a})(n);class o{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(l){return l=this._mergeConfigObj(l),l=this._configAfterMerge(l),this._typeCheckConfig(l),l}_configAfterMerge(l){return l}_mergeConfigObj(l,h){const d=i.isElement(h)?s.default.getDataAttribute(h,"config"):{};return{...this.constructor.Default,...typeof d=="object"?d:{},...i.isElement(h)?s.default.getDataAttributes(h):{},...typeof l=="object"?l:{}}}_typeCheckConfig(l,h=this.constructor.DefaultType){for(const d of Object.keys(h)){const c=h[d],g=l[d],u=i.isElement(g)?"element":i.toType(g);if(!new RegExp(c).test(u))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${d}" provided type "${u}" but expected type "${c}".`)}}}return o})}(us)),Pt}/*!
* Bootstrap base-component.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/var ln;function $t(){return ln||(ln=1,function(e,t){(function(i,n){e.exports=n(ds(),me(),Pe(),_i())})(Z,function(i,n,r,s){const o=g=>g&&typeof g=="object"&&"default"in g?g:{default:g},a=o(i),l=o(r),h=o(s),d="5.2.3";class c extends h.default{constructor(u,v){super(),u=n.getElement(u),u&&(this._element=u,this._config=this._getConfig(v),a.default.set(this._element,this.constructor.DATA_KEY,this))}dispose(){a.default.remove(this._element,this.constructor.DATA_KEY),l.default.off(this._element,this.constructor.EVENT_KEY);for(const u of Object.getOwnPropertyNames(this))this[u]=null}_queueCallback(u,v,m=!0){n.executeAfterTransition(u,v,m)}_getConfig(u){return u=this._mergeConfigObj(u,this._element),u=this._configAfterMerge(u),this._typeCheckConfig(u),u}static getInstance(u){return a.default.get(n.getElement(u),this.DATA_KEY)}static getOrCreateInstance(u,v={}){return this.getInstance(u)||new this(u,typeof v=="object"?v:null)}static get VERSION(){return d}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(u){return`${u}${this.EVENT_KEY}`}}return c})}(cs)),Dt}var ot={},ps={get exports(){return ot},set exports(e){ot=e}};/*!
* Bootstrap component-functions.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/var cn;function Rn(){return cn||(cn=1,function(e,t){(function(i,n){n(t,Pe(),me())})(Z,function(i,n,r){const o=(l=>l&&typeof l=="object"&&"default"in l?l:{default:l})(n),a=(l,h="hide")=>{const d=`click.dismiss${l.EVENT_KEY}`,c=l.NAME;o.default.on(document,d,`[data-bs-dismiss="${c}"]`,function(g){if(["A","AREA"].includes(this.tagName)&&g.preventDefault(),r.isDisabled(this))return;const u=r.getElementFromSelector(this)||this.closest(`.${c}`);l.getOrCreateInstance(u)[h]()})};i.enableDismissTrigger=a,Object.defineProperties(i,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})})}(ps,ot)),ot}/*!
* Bootstrap alert.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/(function(e,t){(function(i,n){e.exports=n(me(),Pe(),$t(),Rn())})(Z,function(i,n,r,s){const o=S=>S&&typeof S=="object"&&"default"in S?S:{default:S},a=o(n),l=o(r),h="alert",c=".bs.alert",g=`close${c}`,u=`closed${c}`,v="fade",m="show";class y extends l.default{static get NAME(){return h}close(){if(a.default.trigger(this._element,g).defaultPrevented)return;this._element.classList.remove(m);const f=this._element.classList.contains(v);this._queueCallback(()=>this._destroyElement(),this._element,f)}_destroyElement(){this._element.remove(),a.default.trigger(this._element,u),this.dispose()}static jQueryInterface(N){return this.each(function(){const f=y.getOrCreateInstance(this);if(typeof N=="string"){if(f[N]===void 0||N.startsWith("_")||N==="constructor")throw new TypeError(`No method named "${N}"`);f[N](this)}})}}return s.enableDismissTrigger(y,"close"),i.defineJQueryPlugin(y),y})})(os);var hi={},gs={get exports(){return hi},set exports(e){hi=e}},Rt={},ms={get exports(){return Rt},set exports(e){Rt=e}};/*!
* Bootstrap selector-engine.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/var hn;function ht(){return hn||(hn=1,function(e,t){(function(i,n){e.exports=n(me())})(Z,function(i){return{find(r,s=document.documentElement){return[].concat(...Element.prototype.querySelectorAll.call(s,r))},findOne(r,s=document.documentElement){return Element.prototype.querySelector.call(s,r)},children(r,s){return[].concat(...r.children).filter(o=>o.matches(s))},parents(r,s){const o=[];let a=r.parentNode.closest(s);for(;a;)o.push(a),a=a.parentNode.closest(s);return o},prev(r,s){let o=r.previousElementSibling;for(;o;){if(o.matches(s))return[o];o=o.previousElementSibling}return[]},next(r,s){let o=r.nextElementSibling;for(;o;){if(o.matches(s))return[o];o=o.nextElementSibling}return[]},focusableChildren(r){const s=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(o=>`${o}:not([tabindex^="-"])`).join(",");return this.find(s,r).filter(o=>!i.isDisabled(o)&&i.isVisible(o))}}})}(ms)),Rt}/*!
* Bootstrap collapse.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/(function(e,t){(function(i,n){e.exports=n(me(),Pe(),ht(),$t())})(Z,function(i,n,r,s){const o=w=>w&&typeof w=="object"&&"default"in w?w:{default:w},a=o(n),l=o(r),h=o(s),d="collapse",g=".bs.collapse",u=".data-api",v=`show${g}`,m=`shown${g}`,y=`hide${g}`,S=`hidden${g}`,N=`click${g}${u}`,f="show",A="collapse",P="collapsing",E="collapsed",C=`:scope .${A} .${A}`,x="collapse-horizontal",k="width",M="height",H=".collapse.show, .collapse.collapsing",p='[data-bs-toggle="collapse"]',O={parent:null,toggle:!0},R={parent:"(null|element)",toggle:"boolean"};class T extends h.default{constructor(b,D){super(b,D),this._isTransitioning=!1,this._triggerArray=[];const I=l.default.find(p);for(const U of I){const B=i.getSelectorFromElement(U),J=l.default.find(B).filter(F=>F===this._element);B!==null&&J.length&&this._triggerArray.push(U)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return O}static get DefaultType(){return R}static get NAME(){return d}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let b=[];if(this._config.parent&&(b=this._getFirstLevelChildren(H).filter(F=>F!==this._element).map(F=>T.getOrCreateInstance(F,{toggle:!1}))),b.length&&b[0]._isTransitioning||a.default.trigger(this._element,v).defaultPrevented)return;for(const F of b)F.hide();const I=this._getDimension();this._element.classList.remove(A),this._element.classList.add(P),this._element.style[I]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const U=()=>{this._isTransitioning=!1,this._element.classList.remove(P),this._element.classList.add(A,f),this._element.style[I]="",a.default.trigger(this._element,m)},J=`scroll${I[0].toUpperCase()+I.slice(1)}`;this._queueCallback(U,this._element,!0),this._element.style[I]=`${this._element[J]}px`}hide(){if(this._isTransitioning||!this._isShown()||a.default.trigger(this._element,y).defaultPrevented)return;const D=this._getDimension();this._element.style[D]=`${this._element.getBoundingClientRect()[D]}px`,i.reflow(this._element),this._element.classList.add(P),this._element.classList.remove(A,f);for(const U of this._triggerArray){const B=i.getElementFromSelector(U);B&&!this._isShown(B)&&this._addAriaAndCollapsedClass([U],!1)}this._isTransitioning=!0;const I=()=>{this._isTransitioning=!1,this._element.classList.remove(P),this._element.classList.add(A),a.default.trigger(this._element,S)};this._element.style[D]="",this._queueCallback(I,this._element,!0)}_isShown(b=this._element){return b.classList.contains(f)}_configAfterMerge(b){return b.toggle=Boolean(b.toggle),b.parent=i.getElement(b.parent),b}_getDimension(){return this._element.classList.contains(x)?k:M}_initializeChildren(){if(!this._config.parent)return;const b=this._getFirstLevelChildren(p);for(const D of b){const I=i.getElementFromSelector(D);I&&this._addAriaAndCollapsedClass([D],this._isShown(I))}}_getFirstLevelChildren(b){const D=l.default.find(C,this._config.parent);return l.default.find(b,this._config.parent).filter(I=>!D.includes(I))}_addAriaAndCollapsedClass(b,D){if(b.length)for(const I of b)I.classList.toggle(E,!D),I.setAttribute("aria-expanded",D)}static jQueryInterface(b){const D={};return typeof b=="string"&&/show|hide/.test(b)&&(D.toggle=!1),this.each(function(){const I=T.getOrCreateInstance(this,D);if(typeof b=="string"){if(typeof I[b]>"u")throw new TypeError(`No method named "${b}"`);I[b]()}})}}return a.default.on(document,N,p,function(w){(w.target.tagName==="A"||w.delegateTarget&&w.delegateTarget.tagName==="A")&&w.preventDefault();const b=i.getSelectorFromElement(this),D=l.default.find(b);for(const I of D)T.getOrCreateInstance(I,{toggle:!1}).toggle()}),i.defineJQueryPlugin(T),T})})(gs);const vs=hi;var dn={},bs={get exports(){return dn},set exports(e){dn=e}},ie="top",ce="bottom",he="right",ne="left",jt="auto",Je=[ie,ce,he,ne],He="start",Ue="end",Nn="clippingParents",yi="viewport",je="popper",In="reference",di=Je.reduce(function(e,t){return e.concat([t+"-"+He,t+"-"+Ue])},[]),Ei=[].concat(Je,[jt]).reduce(function(e,t){return e.concat([t,t+"-"+He,t+"-"+Ue])},[]),Mn="beforeRead",Hn="read",$n="afterRead",jn="beforeMain",Bn="main",Fn="afterMain",Un="beforeWrite",Vn="write",Wn="afterWrite",qn=[Mn,Hn,$n,jn,Bn,Fn,Un,Vn,Wn];function we(e){return e?(e.nodeName||"").toLowerCase():null}function ue(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function $e(e){var t=ue(e).Element;return e instanceof t||e instanceof Element}function de(e){var t=ue(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Ai(e){if(typeof ShadowRoot>"u")return!1;var t=ue(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function _s(e){var t=e.state;Object.keys(t.elements).forEach(function(i){var n=t.styles[i]||{},r=t.attributes[i]||{},s=t.elements[i];!de(s)||!we(s)||(Object.assign(s.style,n),Object.keys(r).forEach(function(o){var a=r[o];a===!1?s.removeAttribute(o):s.setAttribute(o,a===!0?"":a)}))})}function ys(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach(function(n){var r=t.elements[n],s=t.attributes[n]||{},o=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:i[n]),a=o.reduce(function(l,h){return l[h]="",l},{});!de(r)||!we(r)||(Object.assign(r.style,a),Object.keys(s).forEach(function(l){r.removeAttribute(l)}))})}}const wi={name:"applyStyles",enabled:!0,phase:"write",fn:_s,effect:ys,requires:["computeStyles"]};function Ae(e){return e.split("-")[0]}var Ie=Math.max,Nt=Math.min,Ve=Math.round;function ui(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Kn(){return!/^((?!chrome|android).)*safari/i.test(ui())}function We(e,t,i){t===void 0&&(t=!1),i===void 0&&(i=!1);var n=e.getBoundingClientRect(),r=1,s=1;t&&de(e)&&(r=e.offsetWidth>0&&Ve(n.width)/e.offsetWidth||1,s=e.offsetHeight>0&&Ve(n.height)/e.offsetHeight||1);var o=$e(e)?ue(e):window,a=o.visualViewport,l=!Kn()&&i,h=(n.left+(l&&a?a.offsetLeft:0))/r,d=(n.top+(l&&a?a.offsetTop:0))/s,c=n.width/r,g=n.height/s;return{width:c,height:g,top:d,right:h+c,bottom:d+g,left:h,x:h,y:d}}function Ci(e){var t=We(e),i=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:n}}function Jn(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&Ai(i)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Se(e){return ue(e).getComputedStyle(e)}function Es(e){return["table","td","th"].indexOf(we(e))>=0}function xe(e){return(($e(e)?e.ownerDocument:e.document)||window.document).documentElement}function Bt(e){return we(e)==="html"?e:e.assignedSlot||e.parentNode||(Ai(e)?e.host:null)||xe(e)}function un(e){return!de(e)||Se(e).position==="fixed"?null:e.offsetParent}function As(e){var t=/firefox/i.test(ui()),i=/Trident/i.test(ui());if(i&&de(e)){var n=Se(e);if(n.position==="fixed")return null}var r=Bt(e);for(Ai(r)&&(r=r.host);de(r)&&["html","body"].indexOf(we(r))<0;){var s=Se(r);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||t&&s.willChange==="filter"||t&&s.filter&&s.filter!=="none")return r;r=r.parentNode}return null}function dt(e){for(var t=ue(e),i=un(e);i&&Es(i)&&Se(i).position==="static";)i=un(i);return i&&(we(i)==="html"||we(i)==="body"&&Se(i).position==="static")?t:i||As(e)||t}function Ti(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function at(e,t,i){return Ie(e,Nt(t,i))}function ws(e,t,i){var n=at(e,t,i);return n>i?i:n}function Xn(){return{top:0,right:0,bottom:0,left:0}}function zn(e){return Object.assign({},Xn(),e)}function Yn(e,t){return t.reduce(function(i,n){return i[n]=e,i},{})}var Cs=function(t,i){return t=typeof t=="function"?t(Object.assign({},i.rects,{placement:i.placement})):t,zn(typeof t!="number"?t:Yn(t,Je))};function Ts(e){var t,i=e.state,n=e.name,r=e.options,s=i.elements.arrow,o=i.modifiersData.popperOffsets,a=Ae(i.placement),l=Ti(a),h=[ne,he].indexOf(a)>=0,d=h?"height":"width";if(!(!s||!o)){var c=Cs(r.padding,i),g=Ci(s),u=l==="y"?ie:ne,v=l==="y"?ce:he,m=i.rects.reference[d]+i.rects.reference[l]-o[l]-i.rects.popper[d],y=o[l]-i.rects.reference[l],S=dt(s),N=S?l==="y"?S.clientHeight||0:S.clientWidth||0:0,f=m/2-y/2,A=c[u],P=N-g[d]-c[v],E=N/2-g[d]/2+f,C=at(A,E,P),x=l;i.modifiersData[n]=(t={},t[x]=C,t.centerOffset=C-E,t)}}function Ss(e){var t=e.state,i=e.options,n=i.element,r=n===void 0?"[data-popper-arrow]":n;r!=null&&(typeof r=="string"&&(r=t.elements.popper.querySelector(r),!r)||Jn(t.elements.popper,r)&&(t.elements.arrow=r))}const Gn={name:"arrow",enabled:!0,phase:"main",fn:Ts,effect:Ss,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function qe(e){return e.split("-")[1]}var ks={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Os(e){var t=e.x,i=e.y,n=window,r=n.devicePixelRatio||1;return{x:Ve(t*r)/r||0,y:Ve(i*r)/r||0}}function fn(e){var t,i=e.popper,n=e.popperRect,r=e.placement,s=e.variation,o=e.offsets,a=e.position,l=e.gpuAcceleration,h=e.adaptive,d=e.roundOffsets,c=e.isFixed,g=o.x,u=g===void 0?0:g,v=o.y,m=v===void 0?0:v,y=typeof d=="function"?d({x:u,y:m}):{x:u,y:m};u=y.x,m=y.y;var S=o.hasOwnProperty("x"),N=o.hasOwnProperty("y"),f=ne,A=ie,P=window;if(h){var E=dt(i),C="clientHeight",x="clientWidth";if(E===ue(i)&&(E=xe(i),Se(E).position!=="static"&&a==="absolute"&&(C="scrollHeight",x="scrollWidth")),E=E,r===ie||(r===ne||r===he)&&s===Ue){A=ce;var k=c&&E===P&&P.visualViewport?P.visualViewport.height:E[C];m-=k-n.height,m*=l?1:-1}if(r===ne||(r===ie||r===ce)&&s===Ue){f=he;var M=c&&E===P&&P.visualViewport?P.visualViewport.width:E[x];u-=M-n.width,u*=l?1:-1}}var H=Object.assign({position:a},h&&ks),p=d===!0?Os({x:u,y:m}):{x:u,y:m};if(u=p.x,m=p.y,l){var O;return Object.assign({},H,(O={},O[A]=N?"0":"",O[f]=S?"0":"",O.transform=(P.devicePixelRatio||1)<=1?"translate("+u+"px, "+m+"px)":"translate3d("+u+"px, "+m+"px, 0)",O))}return Object.assign({},H,(t={},t[A]=N?m+"px":"",t[f]=S?u+"px":"",t.transform="",t))}function Ds(e){var t=e.state,i=e.options,n=i.gpuAcceleration,r=n===void 0?!0:n,s=i.adaptive,o=s===void 0?!0:s,a=i.roundOffsets,l=a===void 0?!0:a,h={placement:Ae(t.placement),variation:qe(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,fn(Object.assign({},h,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,fn(Object.assign({},h,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Si={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Ds,data:{}};var Ct={passive:!0};function Ls(e){var t=e.state,i=e.instance,n=e.options,r=n.scroll,s=r===void 0?!0:r,o=n.resize,a=o===void 0?!0:o,l=ue(t.elements.popper),h=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&h.forEach(function(d){d.addEventListener("scroll",i.update,Ct)}),a&&l.addEventListener("resize",i.update,Ct),function(){s&&h.forEach(function(d){d.removeEventListener("scroll",i.update,Ct)}),a&&l.removeEventListener("resize",i.update,Ct)}}const ki={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Ls,data:{}};var Ps={left:"right",right:"left",bottom:"top",top:"bottom"};function St(e){return e.replace(/left|right|bottom|top/g,function(t){return Ps[t]})}var xs={start:"end",end:"start"};function pn(e){return e.replace(/start|end/g,function(t){return xs[t]})}function Oi(e){var t=ue(e),i=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:i,scrollTop:n}}function Di(e){return We(xe(e)).left+Oi(e).scrollLeft}function Rs(e,t){var i=ue(e),n=xe(e),r=i.visualViewport,s=n.clientWidth,o=n.clientHeight,a=0,l=0;if(r){s=r.width,o=r.height;var h=Kn();(h||!h&&t==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}return{width:s,height:o,x:a+Di(e),y:l}}function Ns(e){var t,i=xe(e),n=Oi(e),r=(t=e.ownerDocument)==null?void 0:t.body,s=Ie(i.scrollWidth,i.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=Ie(i.scrollHeight,i.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-n.scrollLeft+Di(e),l=-n.scrollTop;return Se(r||i).direction==="rtl"&&(a+=Ie(i.clientWidth,r?r.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}function Li(e){var t=Se(e),i=t.overflow,n=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+r+n)}function Qn(e){return["html","body","#document"].indexOf(we(e))>=0?e.ownerDocument.body:de(e)&&Li(e)?e:Qn(Bt(e))}function lt(e,t){var i;t===void 0&&(t=[]);var n=Qn(e),r=n===((i=e.ownerDocument)==null?void 0:i.body),s=ue(n),o=r?[s].concat(s.visualViewport||[],Li(n)?n:[]):n,a=t.concat(o);return r?a:a.concat(lt(Bt(o)))}function fi(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Is(e,t){var i=We(e,!1,t==="fixed");return i.top=i.top+e.clientTop,i.left=i.left+e.clientLeft,i.bottom=i.top+e.clientHeight,i.right=i.left+e.clientWidth,i.width=e.clientWidth,i.height=e.clientHeight,i.x=i.left,i.y=i.top,i}function gn(e,t,i){return t===yi?fi(Rs(e,i)):$e(t)?Is(t,i):fi(Ns(xe(e)))}function Ms(e){var t=lt(Bt(e)),i=["absolute","fixed"].indexOf(Se(e).position)>=0,n=i&&de(e)?dt(e):e;return $e(n)?t.filter(function(r){return $e(r)&&Jn(r,n)&&we(r)!=="body"}):[]}function Hs(e,t,i,n){var r=t==="clippingParents"?Ms(e):[].concat(t),s=[].concat(r,[i]),o=s[0],a=s.reduce(function(l,h){var d=gn(e,h,n);return l.top=Ie(d.top,l.top),l.right=Nt(d.right,l.right),l.bottom=Nt(d.bottom,l.bottom),l.left=Ie(d.left,l.left),l},gn(e,o,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Zn(e){var t=e.reference,i=e.element,n=e.placement,r=n?Ae(n):null,s=n?qe(n):null,o=t.x+t.width/2-i.width/2,a=t.y+t.height/2-i.height/2,l;switch(r){case ie:l={x:o,y:t.y-i.height};break;case ce:l={x:o,y:t.y+t.height};break;case he:l={x:t.x+t.width,y:a};break;case ne:l={x:t.x-i.width,y:a};break;default:l={x:t.x,y:t.y}}var h=r?Ti(r):null;if(h!=null){var d=h==="y"?"height":"width";switch(s){case He:l[h]=l[h]-(t[d]/2-i[d]/2);break;case Ue:l[h]=l[h]+(t[d]/2-i[d]/2);break}}return l}function Ke(e,t){t===void 0&&(t={});var i=t,n=i.placement,r=n===void 0?e.placement:n,s=i.strategy,o=s===void 0?e.strategy:s,a=i.boundary,l=a===void 0?Nn:a,h=i.rootBoundary,d=h===void 0?yi:h,c=i.elementContext,g=c===void 0?je:c,u=i.altBoundary,v=u===void 0?!1:u,m=i.padding,y=m===void 0?0:m,S=zn(typeof y!="number"?y:Yn(y,Je)),N=g===je?In:je,f=e.rects.popper,A=e.elements[v?N:g],P=Hs($e(A)?A:A.contextElement||xe(e.elements.popper),l,d,o),E=We(e.elements.reference),C=Zn({reference:E,element:f,strategy:"absolute",placement:r}),x=fi(Object.assign({},f,C)),k=g===je?x:E,M={top:P.top-k.top+S.top,bottom:k.bottom-P.bottom+S.bottom,left:P.left-k.left+S.left,right:k.right-P.right+S.right},H=e.modifiersData.offset;if(g===je&&H){var p=H[r];Object.keys(M).forEach(function(O){var R=[he,ce].indexOf(O)>=0?1:-1,T=[ie,ce].indexOf(O)>=0?"y":"x";M[O]+=p[T]*R})}return M}function $s(e,t){t===void 0&&(t={});var i=t,n=i.placement,r=i.boundary,s=i.rootBoundary,o=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,h=l===void 0?Ei:l,d=qe(n),c=d?a?di:di.filter(function(v){return qe(v)===d}):Je,g=c.filter(function(v){return h.indexOf(v)>=0});g.length===0&&(g=c);var u=g.reduce(function(v,m){return v[m]=Ke(e,{placement:m,boundary:r,rootBoundary:s,padding:o})[Ae(m)],v},{});return Object.keys(u).sort(function(v,m){return u[v]-u[m]})}function js(e){if(Ae(e)===jt)return[];var t=St(e);return[pn(e),t,pn(t)]}function Bs(e){var t=e.state,i=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var r=i.mainAxis,s=r===void 0?!0:r,o=i.altAxis,a=o===void 0?!0:o,l=i.fallbackPlacements,h=i.padding,d=i.boundary,c=i.rootBoundary,g=i.altBoundary,u=i.flipVariations,v=u===void 0?!0:u,m=i.allowedAutoPlacements,y=t.options.placement,S=Ae(y),N=S===y,f=l||(N||!v?[St(y)]:js(y)),A=[y].concat(f).reduce(function(ee,W){return ee.concat(Ae(W)===jt?$s(t,{placement:W,boundary:d,rootBoundary:c,padding:h,flipVariations:v,allowedAutoPlacements:m}):W)},[]),P=t.rects.reference,E=t.rects.popper,C=new Map,x=!0,k=A[0],M=0;M<A.length;M++){var H=A[M],p=Ae(H),O=qe(H)===He,R=[ie,ce].indexOf(p)>=0,T=R?"width":"height",w=Ke(t,{placement:H,boundary:d,rootBoundary:c,altBoundary:g,padding:h}),b=R?O?he:ne:O?ce:ie;P[T]>E[T]&&(b=St(b));var D=St(b),I=[];if(s&&I.push(w[p]<=0),a&&I.push(w[b]<=0,w[D]<=0),I.every(function(ee){return ee})){k=H,x=!1;break}C.set(H,I)}if(x)for(var U=v?3:1,B=function(W){var K=A.find(function(z){var $=C.get(z);if($)return $.slice(0,W).every(function(V){return V})});if(K)return k=K,"break"},J=U;J>0;J--){var F=B(J);if(F==="break")break}t.placement!==k&&(t.modifiersData[n]._skip=!0,t.placement=k,t.reset=!0)}}const er={name:"flip",enabled:!0,phase:"main",fn:Bs,requiresIfExists:["offset"],data:{_skip:!1}};function mn(e,t,i){return i===void 0&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function vn(e){return[ie,he,ce,ne].some(function(t){return e[t]>=0})}function Fs(e){var t=e.state,i=e.name,n=t.rects.reference,r=t.rects.popper,s=t.modifiersData.preventOverflow,o=Ke(t,{elementContext:"reference"}),a=Ke(t,{altBoundary:!0}),l=mn(o,n),h=mn(a,r,s),d=vn(l),c=vn(h);t.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:h,isReferenceHidden:d,hasPopperEscaped:c},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":c})}const tr={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Fs};function Us(e,t,i){var n=Ae(e),r=[ne,ie].indexOf(n)>=0?-1:1,s=typeof i=="function"?i(Object.assign({},t,{placement:e})):i,o=s[0],a=s[1];return o=o||0,a=(a||0)*r,[ne,he].indexOf(n)>=0?{x:a,y:o}:{x:o,y:a}}function Vs(e){var t=e.state,i=e.options,n=e.name,r=i.offset,s=r===void 0?[0,0]:r,o=Ei.reduce(function(d,c){return d[c]=Us(c,t.rects,s),d},{}),a=o[t.placement],l=a.x,h=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=h),t.modifiersData[n]=o}const ir={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Vs};function Ws(e){var t=e.state,i=e.name;t.modifiersData[i]=Zn({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const Pi={name:"popperOffsets",enabled:!0,phase:"read",fn:Ws,data:{}};function qs(e){return e==="x"?"y":"x"}function Ks(e){var t=e.state,i=e.options,n=e.name,r=i.mainAxis,s=r===void 0?!0:r,o=i.altAxis,a=o===void 0?!1:o,l=i.boundary,h=i.rootBoundary,d=i.altBoundary,c=i.padding,g=i.tether,u=g===void 0?!0:g,v=i.tetherOffset,m=v===void 0?0:v,y=Ke(t,{boundary:l,rootBoundary:h,padding:c,altBoundary:d}),S=Ae(t.placement),N=qe(t.placement),f=!N,A=Ti(S),P=qs(A),E=t.modifiersData.popperOffsets,C=t.rects.reference,x=t.rects.popper,k=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,M=typeof k=="number"?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),H=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,p={x:0,y:0};if(E){if(s){var O,R=A==="y"?ie:ne,T=A==="y"?ce:he,w=A==="y"?"height":"width",b=E[A],D=b+y[R],I=b-y[T],U=u?-x[w]/2:0,B=N===He?C[w]:x[w],J=N===He?-x[w]:-C[w],F=t.elements.arrow,ee=u&&F?Ci(F):{width:0,height:0},W=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Xn(),K=W[R],z=W[T],$=at(0,C[w],ee[w]),V=f?C[w]/2-U-$-K-M.mainAxis:B-$-K-M.mainAxis,te=f?-C[w]/2+U+$+z+M.mainAxis:J+$+z+M.mainAxis,fe=t.elements.arrow&&dt(t.elements.arrow),Vt=fe?A==="y"?fe.clientTop||0:fe.clientLeft||0:0,ut=(O=H?.[A])!=null?O:0,Wt=b+V-ut-Vt,qt=b+te-ut,ft=at(u?Nt(D,Wt):D,b,u?Ie(I,qt):I);E[A]=ft,p[A]=ft-b}if(a){var re,X=A==="x"?ie:ne,L=A==="x"?ce:he,j=E[P],q=P==="y"?"height":"width",Y=j+y[X],ke=j-y[L],pe=[ie,ne].indexOf(S)!==-1,Xe=(re=H?.[P])!=null?re:0,xi=pe?Y:j-C[q]-x[q]-Xe+M.altAxis,Ri=pe?j+C[q]+x[q]-Xe-M.altAxis:ke,Ni=u&&pe?ws(xi,j,Ri):at(u?xi:Y,j,u?Ri:ke);E[P]=Ni,p[P]=Ni-j}t.modifiersData[n]=p}}const nr={name:"preventOverflow",enabled:!0,phase:"main",fn:Ks,requiresIfExists:["offset"]};function Js(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Xs(e){return e===ue(e)||!de(e)?Oi(e):Js(e)}function zs(e){var t=e.getBoundingClientRect(),i=Ve(t.width)/e.offsetWidth||1,n=Ve(t.height)/e.offsetHeight||1;return i!==1||n!==1}function Ys(e,t,i){i===void 0&&(i=!1);var n=de(t),r=de(t)&&zs(t),s=xe(t),o=We(e,r,i),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!i)&&((we(t)!=="body"||Li(s))&&(a=Xs(t)),de(t)?(l=We(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):s&&(l.x=Di(s))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function Gs(e){var t=new Map,i=new Set,n=[];e.forEach(function(s){t.set(s.name,s)});function r(s){i.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(a){if(!i.has(a)){var l=t.get(a);l&&r(l)}}),n.push(s)}return e.forEach(function(s){i.has(s.name)||r(s)}),n}function Qs(e){var t=Gs(e);return qn.reduce(function(i,n){return i.concat(t.filter(function(r){return r.phase===n}))},[])}function Zs(e){var t;return function(){return t||(t=new Promise(function(i){Promise.resolve().then(function(){t=void 0,i(e())})})),t}}function eo(e){var t=e.reduce(function(i,n){var r=i[n.name];return i[n.name]=r?Object.assign({},r,n,{options:Object.assign({},r.options,n.options),data:Object.assign({},r.data,n.data)}):n,i},{});return Object.keys(t).map(function(i){return t[i]})}var bn={placement:"bottom",modifiers:[],strategy:"absolute"};function _n(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return!t.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function Ft(e){e===void 0&&(e={});var t=e,i=t.defaultModifiers,n=i===void 0?[]:i,r=t.defaultOptions,s=r===void 0?bn:r;return function(a,l,h){h===void 0&&(h=s);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},bn,s),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},c=[],g=!1,u={state:d,setOptions:function(S){var N=typeof S=="function"?S(d.options):S;m(),d.options=Object.assign({},s,d.options,N),d.scrollParents={reference:$e(a)?lt(a):a.contextElement?lt(a.contextElement):[],popper:lt(l)};var f=Qs(eo([].concat(n,d.options.modifiers)));return d.orderedModifiers=f.filter(function(A){return A.enabled}),v(),u.update()},forceUpdate:function(){if(!g){var S=d.elements,N=S.reference,f=S.popper;if(_n(N,f)){d.rects={reference:Ys(N,dt(f),d.options.strategy==="fixed"),popper:Ci(f)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(M){return d.modifiersData[M.name]=Object.assign({},M.data)});for(var A=0;A<d.orderedModifiers.length;A++){if(d.reset===!0){d.reset=!1,A=-1;continue}var P=d.orderedModifiers[A],E=P.fn,C=P.options,x=C===void 0?{}:C,k=P.name;typeof E=="function"&&(d=E({state:d,options:x,name:k,instance:u})||d)}}}},update:Zs(function(){return new Promise(function(y){u.forceUpdate(),y(d)})}),destroy:function(){m(),g=!0}};if(!_n(a,l))return u;u.setOptions(h).then(function(y){!g&&h.onFirstUpdate&&h.onFirstUpdate(y)});function v(){d.orderedModifiers.forEach(function(y){var S=y.name,N=y.options,f=N===void 0?{}:N,A=y.effect;if(typeof A=="function"){var P=A({state:d,name:S,instance:u,options:f}),E=function(){};c.push(P||E)}})}function m(){c.forEach(function(y){return y()}),c=[]}return u}}var to=Ft(),io=[ki,Pi,Si,wi],no=Ft({defaultModifiers:io}),ro=[ki,Pi,Si,wi,ir,er,nr,Gn,tr],so=Ft({defaultModifiers:ro});const oo=Object.freeze(Object.defineProperty({__proto__:null,afterMain:Fn,afterRead:$n,afterWrite:Wn,applyStyles:wi,arrow:Gn,auto:jt,basePlacements:Je,beforeMain:jn,beforeRead:Mn,beforeWrite:Un,bottom:ce,clippingParents:Nn,computeStyles:Si,createPopper:so,createPopperBase:to,createPopperLite:no,detectOverflow:Ke,end:Ue,eventListeners:ki,flip:er,hide:tr,left:ne,main:Bn,modifierPhases:qn,offset:ir,placements:Ei,popper:je,popperGenerator:Ft,popperOffsets:Pi,preventOverflow:nr,read:Hn,reference:In,right:he,start:He,top:ie,variationPlacements:di,viewport:yi,write:Vn},Symbol.toStringTag,{value:"Module"})),ao=ur(oo);/*!
* Bootstrap dropdown.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/(function(e,t){(function(i,n){e.exports=n(ao,me(),Pe(),bi(),ht(),$t())})(Z,function(i,n,r,s,o,a){const l=X=>X&&typeof X=="object"&&"default"in X?X:{default:X};function h(X){if(X&&X.__esModule)return X;const L=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(X){for(const j in X)if(j!=="default"){const q=Object.getOwnPropertyDescriptor(X,j);Object.defineProperty(L,j,q.get?q:{enumerable:!0,get:()=>X[j]})}}return L.default=X,Object.freeze(L)}const d=h(i),c=l(r),g=l(s),u=l(o),v=l(a),m="dropdown",S=".bs.dropdown",N=".data-api",f="Escape",A="Tab",P="ArrowUp",E="ArrowDown",C=2,x=`hide${S}`,k=`hidden${S}`,M=`show${S}`,H=`shown${S}`,p=`click${S}${N}`,O=`keydown${S}${N}`,R=`keyup${S}${N}`,T="show",w="dropup",b="dropend",D="dropstart",I="dropup-center",U="dropdown-center",B='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',J=`${B}.${T}`,F=".dropdown-menu",ee=".navbar",W=".navbar-nav",K=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",z=n.isRTL()?"top-end":"top-start",$=n.isRTL()?"top-start":"top-end",V=n.isRTL()?"bottom-end":"bottom-start",te=n.isRTL()?"bottom-start":"bottom-end",fe=n.isRTL()?"left-start":"right-start",Vt=n.isRTL()?"right-start":"left-start",ut="top",Wt="bottom",qt={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},ft={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class re extends v.default{constructor(L,j){super(L,j),this._popper=null,this._parent=this._element.parentNode,this._menu=u.default.next(this._element,F)[0]||u.default.prev(this._element,F)[0]||u.default.findOne(F,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return qt}static get DefaultType(){return ft}static get NAME(){return m}toggle(){return this._isShown()?this.hide():this.show()}show(){if(n.isDisabled(this._element)||this._isShown())return;const L={relatedTarget:this._element};if(!c.default.trigger(this._element,M,L).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(W))for(const q of[].concat(...document.body.children))c.default.on(q,"mouseover",n.noop);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(T),this._element.classList.add(T),c.default.trigger(this._element,H,L)}}hide(){if(n.isDisabled(this._element)||!this._isShown())return;const L={relatedTarget:this._element};this._completeHide(L)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(L){if(!c.default.trigger(this._element,x,L).defaultPrevented){if("ontouchstart"in document.documentElement)for(const q of[].concat(...document.body.children))c.default.off(q,"mouseover",n.noop);this._popper&&this._popper.destroy(),this._menu.classList.remove(T),this._element.classList.remove(T),this._element.setAttribute("aria-expanded","false"),g.default.removeDataAttribute(this._menu,"popper"),c.default.trigger(this._element,k,L)}}_getConfig(L){if(L=super._getConfig(L),typeof L.reference=="object"&&!n.isElement(L.reference)&&typeof L.reference.getBoundingClientRect!="function")throw new TypeError(`${m.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return L}_createPopper(){if(typeof d>"u")throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let L=this._element;this._config.reference==="parent"?L=this._parent:n.isElement(this._config.reference)?L=n.getElement(this._config.reference):typeof this._config.reference=="object"&&(L=this._config.reference);const j=this._getPopperConfig();this._popper=d.createPopper(L,this._menu,j)}_isShown(){return this._menu.classList.contains(T)}_getPlacement(){const L=this._parent;if(L.classList.contains(b))return fe;if(L.classList.contains(D))return Vt;if(L.classList.contains(I))return ut;if(L.classList.contains(U))return Wt;const j=getComputedStyle(this._menu).getPropertyValue("--bs-position").trim()==="end";return L.classList.contains(w)?j?$:z:j?te:V}_detectNavbar(){return this._element.closest(ee)!==null}_getOffset(){const{offset:L}=this._config;return typeof L=="string"?L.split(",").map(j=>Number.parseInt(j,10)):typeof L=="function"?j=>L(j,this._element):L}_getPopperConfig(){const L={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||this._config.display==="static")&&(g.default.setDataAttribute(this._menu,"popper","static"),L.modifiers=[{name:"applyStyles",enabled:!1}]),{...L,...typeof this._config.popperConfig=="function"?this._config.popperConfig(L):this._config.popperConfig}}_selectMenuItem({key:L,target:j}){const q=u.default.find(K,this._menu).filter(Y=>n.isVisible(Y));q.length&&n.getNextActiveElement(q,j,L===E,!q.includes(j)).focus()}static jQueryInterface(L){return this.each(function(){const j=re.getOrCreateInstance(this,L);if(typeof L=="string"){if(typeof j[L]>"u")throw new TypeError(`No method named "${L}"`);j[L]()}})}static clearMenus(L){if(L.button===C||L.type==="keyup"&&L.key!==A)return;const j=u.default.find(J);for(const q of j){const Y=re.getInstance(q);if(!Y||Y._config.autoClose===!1)continue;const ke=L.composedPath(),pe=ke.includes(Y._menu);if(ke.includes(Y._element)||Y._config.autoClose==="inside"&&!pe||Y._config.autoClose==="outside"&&pe||Y._menu.contains(L.target)&&(L.type==="keyup"&&L.key===A||/input|select|option|textarea|form/i.test(L.target.tagName)))continue;const Xe={relatedTarget:Y._element};L.type==="click"&&(Xe.clickEvent=L),Y._completeHide(Xe)}}static dataApiKeydownHandler(L){const j=/input|textarea/i.test(L.target.tagName),q=L.key===f,Y=[P,E].includes(L.key);if(!Y&&!q||j&&!q)return;L.preventDefault();const ke=this.matches(B)?this:u.default.prev(this,B)[0]||u.default.next(this,B)[0]||u.default.findOne(B,L.delegateTarget.parentNode),pe=re.getOrCreateInstance(ke);if(Y){L.stopPropagation(),pe.show(),pe._selectMenuItem(L);return}pe._isShown()&&(L.stopPropagation(),pe.hide(),ke.focus())}}return c.default.on(document,O,B,re.dataApiKeydownHandler),c.default.on(document,O,F,re.dataApiKeydownHandler),c.default.on(document,p,re.clearMenus),c.default.on(document,R,re.clearMenus),c.default.on(document,p,B,function(X){X.preventDefault(),re.getOrCreateInstance(this).toggle()}),n.defineJQueryPlugin(re),re})})(bs);const yn=document.getElementById("navbarSupportedContentToggler"),ti=document.getElementById("navbarSupportedContent");ti!=null&&(ti.addEventListener("show.bs.collapse",()=>{console.log("opening navbar content"),yn.classList.toggle("is-active")}),ti.addEventListener("hide.bs.collapse",()=>{console.log("closing navbar content"),yn.classList.toggle("is-active")}));let lo=document.querySelectorAll(".needs-validation");Array.prototype.slice.call(lo).forEach(function(e){e.addEventListener("submit",function(t){e.checkValidity()||(t.preventDefault(),t.stopPropagation(),e.classList.add("was-validated"))},!1)});const co={mounted(){this.el.addEventListener("closed.bs.alert",()=>{this.pushEvent("lv:clear-flash",this.el.dataset)})}};var pi={},ho={get exports(){return pi},set exports(e){pi=e}},It={},uo={get exports(){return It},set exports(e){It=e}};/*!
* Bootstrap scrollbar.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/var En;function fo(){return En||(En=1,function(e,t){(function(i,n){e.exports=n(ht(),bi(),me())})(Z,function(i,n,r){const s=u=>u&&typeof u=="object"&&"default"in u?u:{default:u},o=s(i),a=s(n),l=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",h=".sticky-top",d="padding-right",c="margin-right";class g{constructor(){this._element=document.body}getWidth(){const v=document.documentElement.clientWidth;return Math.abs(window.innerWidth-v)}hide(){const v=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,d,m=>m+v),this._setElementAttributes(l,d,m=>m+v),this._setElementAttributes(h,c,m=>m-v)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,d),this._resetElementAttributes(l,d),this._resetElementAttributes(h,c)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(v,m,y){const S=this.getWidth(),N=f=>{if(f!==this._element&&window.innerWidth>f.clientWidth+S)return;this._saveInitialAttribute(f,m);const A=window.getComputedStyle(f).getPropertyValue(m);f.style.setProperty(m,`${y(Number.parseFloat(A))}px`)};this._applyManipulationCallback(v,N)}_saveInitialAttribute(v,m){const y=v.style.getPropertyValue(m);y&&a.default.setDataAttribute(v,m,y)}_resetElementAttributes(v,m){const y=S=>{const N=a.default.getDataAttribute(S,m);if(N===null){S.style.removeProperty(m);return}a.default.removeDataAttribute(S,m),S.style.setProperty(m,N)};this._applyManipulationCallback(v,y)}_applyManipulationCallback(v,m){if(r.isElement(v)){m(v);return}for(const y of o.default.find(v,this._element))m(y)}}return g})}(uo)),It}var Mt={},po={get exports(){return Mt},set exports(e){Mt=e}};/*!
* Bootstrap backdrop.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/var An;function go(){return An||(An=1,function(e,t){(function(i,n){e.exports=n(Pe(),me(),_i())})(Z,function(i,n,r){const s=m=>m&&typeof m=="object"&&"default"in m?m:{default:m},o=s(i),a=s(r),l="backdrop",h="fade",d="show",c=`mousedown.bs.${l}`,g={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},u={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class v extends a.default{constructor(y){super(),this._config=this._getConfig(y),this._isAppended=!1,this._element=null}static get Default(){return g}static get DefaultType(){return u}static get NAME(){return l}show(y){if(!this._config.isVisible){n.execute(y);return}this._append();const S=this._getElement();this._config.isAnimated&&n.reflow(S),S.classList.add(d),this._emulateAnimation(()=>{n.execute(y)})}hide(y){if(!this._config.isVisible){n.execute(y);return}this._getElement().classList.remove(d),this._emulateAnimation(()=>{this.dispose(),n.execute(y)})}dispose(){this._isAppended&&(o.default.off(this._element,c),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const y=document.createElement("div");y.className=this._config.className,this._config.isAnimated&&y.classList.add(h),this._element=y}return this._element}_configAfterMerge(y){return y.rootElement=n.getElement(y.rootElement),y}_append(){if(this._isAppended)return;const y=this._getElement();this._config.rootElement.append(y),o.default.on(y,c,()=>{n.execute(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(y){n.executeAfterTransition(y,this._getElement(),this._config.isAnimated)}}return v})}(po)),Mt}var Ht={},mo={get exports(){return Ht},set exports(e){Ht=e}};/*!
* Bootstrap focustrap.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/var wn;function vo(){return wn||(wn=1,function(e,t){(function(i,n){e.exports=n(Pe(),ht(),_i())})(Z,function(i,n,r){const s=A=>A&&typeof A=="object"&&"default"in A?A:{default:A},o=s(i),a=s(n),l=s(r),h="focustrap",c=".bs.focustrap",g=`focusin${c}`,u=`keydown.tab${c}`,v="Tab",m="forward",y="backward",S={autofocus:!0,trapElement:null},N={autofocus:"boolean",trapElement:"element"};class f extends l.default{constructor(P){super(),this._config=this._getConfig(P),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return S}static get DefaultType(){return N}static get NAME(){return h}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),o.default.off(document,c),o.default.on(document,g,P=>this._handleFocusin(P)),o.default.on(document,u,P=>this._handleKeydown(P)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,o.default.off(document,c))}_handleFocusin(P){const{trapElement:E}=this._config;if(P.target===document||P.target===E||E.contains(P.target))return;const C=a.default.focusableChildren(E);C.length===0?E.focus():this._lastTabNavDirection===y?C[C.length-1].focus():C[0].focus()}_handleKeydown(P){P.key===v&&(this._lastTabNavDirection=P.shiftKey?y:m)}}return f})}(mo)),Ht}/*!
* Bootstrap modal.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/(function(e,t){(function(i,n){e.exports=n(me(),Pe(),ht(),fo(),$t(),go(),vo(),Rn())})(Z,function(i,n,r,s,o,a,l,h){const d=z=>z&&typeof z=="object"&&"default"in z?z:{default:z},c=d(n),g=d(r),u=d(s),v=d(o),m=d(a),y=d(l),S="modal",f=".bs.modal",A=".data-api",P="Escape",E=`hide${f}`,C=`hidePrevented${f}`,x=`hidden${f}`,k=`show${f}`,M=`shown${f}`,H=`resize${f}`,p=`click.dismiss${f}`,O=`mousedown.dismiss${f}`,R=`keydown.dismiss${f}`,T=`click${f}${A}`,w="modal-open",b="fade",D="show",I="modal-static",U=".modal.show",B=".modal-dialog",J=".modal-body",F='[data-bs-toggle="modal"]',ee={backdrop:!0,focus:!0,keyboard:!0},W={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class K extends v.default{constructor($,V){super($,V),this._dialog=g.default.findOne(B,this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new u.default,this._addEventListeners()}static get Default(){return ee}static get DefaultType(){return W}static get NAME(){return S}toggle($){return this._isShown?this.hide():this.show($)}show($){this._isShown||this._isTransitioning||c.default.trigger(this._element,k,{relatedTarget:$}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(w),this._adjustDialog(),this._backdrop.show(()=>this._showElement($)))}hide(){!this._isShown||this._isTransitioning||c.default.trigger(this._element,E).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(D),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated()))}dispose(){for(const $ of[window,this._dialog])c.default.off($,f);this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new m.default({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new y.default({trapElement:this._element})}_showElement($){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const V=g.default.findOne(J,this._dialog);V&&(V.scrollTop=0),i.reflow(this._element),this._element.classList.add(D);const te=()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,c.default.trigger(this._element,M,{relatedTarget:$})};this._queueCallback(te,this._dialog,this._isAnimated())}_addEventListeners(){c.default.on(this._element,R,$=>{if($.key===P){if(this._config.keyboard){$.preventDefault(),this.hide();return}this._triggerBackdropTransition()}}),c.default.on(window,H,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),c.default.on(this._element,O,$=>{c.default.one(this._element,p,V=>{if(!(this._element!==$.target||this._element!==V.target)){if(this._config.backdrop==="static"){this._triggerBackdropTransition();return}this._config.backdrop&&this.hide()}})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(w),this._resetAdjustments(),this._scrollBar.reset(),c.default.trigger(this._element,x)})}_isAnimated(){return this._element.classList.contains(b)}_triggerBackdropTransition(){if(c.default.trigger(this._element,C).defaultPrevented)return;const V=this._element.scrollHeight>document.documentElement.clientHeight,te=this._element.style.overflowY;te==="hidden"||this._element.classList.contains(I)||(V||(this._element.style.overflowY="hidden"),this._element.classList.add(I),this._queueCallback(()=>{this._element.classList.remove(I),this._queueCallback(()=>{this._element.style.overflowY=te},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const $=this._element.scrollHeight>document.documentElement.clientHeight,V=this._scrollBar.getWidth(),te=V>0;if(te&&!$){const fe=i.isRTL()?"paddingLeft":"paddingRight";this._element.style[fe]=`${V}px`}if(!te&&$){const fe=i.isRTL()?"paddingRight":"paddingLeft";this._element.style[fe]=`${V}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface($,V){return this.each(function(){const te=K.getOrCreateInstance(this,$);if(typeof $=="string"){if(typeof te[$]>"u")throw new TypeError(`No method named "${$}"`);te[$](V)}})}}return c.default.on(document,T,F,function(z){const $=i.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&z.preventDefault(),c.default.one($,k,fe=>{fe.defaultPrevented||c.default.one($,x,()=>{i.isVisible(this)&&this.focus()})});const V=g.default.findOne(U);V&&K.getInstance(V).hide(),K.getOrCreateInstance($).toggle(this)}),h.enableDismissTrigger(K),i.defineJQueryPlugin(K),K})})(ho);const bo=pi,_o={mounted(){const e=new bo(this.el);e.show(),this.el.addEventListener("hidden.bs.modal",t=>{this.pushEventTo(`#${this.el.getAttribute("id")}`,"close",{}),e.dispose()}),this.handleEvent("modal-please-hide",t=>{e.hide()})},destroyed(){const e=document.querySelector(".modal-backdrop");e&&e.parentElement.removeChild(e)}},yo={mounted(){const e=new vs(this.el,{toggle:!1});this.handleEvent("toggle-template-details",({targetId:t})=>{this.el.id==t&&e.toggle()}),this.el.addEventListener("shown.bs.collapse",t=>{this.pushEvent("collapse-shown",{target_id:t.target.id})}),this.el.addEventListener("hidden.bs.collapse",t=>{this.pushEvent("collapse-hidden",{target_id:t.target.id})})}};let Ut={};Ut.AlertRemover=co;Ut.BsModal=_o;Ut.BsCollapse=yo;let Eo=document.querySelector("meta[name='csrf-token']").getAttribute("content"),rr=new rs("/live",dr,{params:{_csrf_token:Eo},hooks:Ut});gi.config({barColors:{0:"#29d"},shadowColor:"rgba(0, 0, 0, .3)"});window.addEventListener("phx:page-loading-start",e=>gi.show());window.addEventListener("phx:page-loading-stop",e=>gi.hide());rr.connect();window.liveSocket=rr;