From 953a7d07608b019a2403f5628e4ee63c37a78c03 Mon Sep 17 00:00:00 2001 From: Kevin Chung Date: Tue, 27 Jun 2023 18:00:14 -0400 Subject: [PATCH] Squashed 'CTFd/themes/core-beta/' changes from bb4edfb6..c7b4b78f c7b4b78f Merge pull request #48 from CTFd/bump-ctfd-js fa185cbb Bump CTFd.js version to 0.0.12 git-subtree-dir: CTFd/themes/core-beta git-subtree-split: c7b4b78f8ca9bab23b1ef939c92a9c51e6f7d27d --- package.json | 2 +- ...ges.fcb4326f.js => challenges.6fd01a77.js} | 2 +- ...oard.37e7316d.js => clipboard.a72a4f92.js} | 2 +- .../{index.1d7c7e9f.js => index.69d1de7e.js} | 14 ++--- .../{index.159418f4.js => index.da797d60.js} | 2 +- ....e17c29d8.js => notifications.efe50c38.js} | 2 +- static/assets/page.52398723.js | 1 - static/assets/page.a7cd4860.js | 1 + ...ard.a8a2da7f.js => scoreboard.a430895f.js} | 2 +- ...tings.9e7a9694.js => settings.b2fcda53.js} | 2 +- .../{setup.b081db5d.js => setup.b0ea72a7.js} | 2 +- static/assets/teams_list.60231f18.js | 1 - static/assets/teams_list.ebfc8ce2.js | 1 + ....88c32ddc.js => teams_private.825ad126.js} | 2 +- ...c.caf8cc98.js => teams_public.dad76340.js} | 2 +- static/assets/users_list.2ad16f6b.js | 1 + static/assets/users_list.af9909e0.js | 1 - ....5ba3fc6b.js => users_private.b9928e8b.js} | 2 +- ...c.2a27f04d.js => users_public.436e1b82.js} | 2 +- ...core.6e7f2954.js => userscore.11bc7f76.js} | 2 +- static/manifest.json | 62 +++++++++---------- yarn.lock | 8 +-- 22 files changed, 58 insertions(+), 58 deletions(-) rename static/assets/{challenges.fcb4326f.js => challenges.6fd01a77.js} (96%) rename static/assets/{clipboard.37e7316d.js => clipboard.a72a4f92.js} (91%) rename static/assets/{index.1d7c7e9f.js => index.69d1de7e.js} (90%) rename static/assets/{index.159418f4.js => index.da797d60.js} (95%) rename static/assets/{notifications.e17c29d8.js => notifications.efe50c38.js} (86%) delete mode 100644 static/assets/page.52398723.js create mode 100644 static/assets/page.a7cd4860.js rename static/assets/{scoreboard.a8a2da7f.js => scoreboard.a430895f.js} (63%) rename static/assets/{settings.9e7a9694.js => settings.b2fcda53.js} (90%) rename static/assets/{setup.b081db5d.js => setup.b0ea72a7.js} (97%) delete mode 100644 static/assets/teams_list.60231f18.js create mode 100644 static/assets/teams_list.ebfc8ce2.js rename static/assets/{teams_private.88c32ddc.js => teams_private.825ad126.js} (93%) rename static/assets/{teams_public.caf8cc98.js => teams_public.dad76340.js} (83%) create mode 100644 static/assets/users_list.2ad16f6b.js delete mode 100644 static/assets/users_list.af9909e0.js rename static/assets/{users_private.5ba3fc6b.js => users_private.b9928e8b.js} (82%) rename static/assets/{users_public.2a27f04d.js => users_public.436e1b82.js} (83%) rename static/assets/{userscore.6e7f2954.js => userscore.11bc7f76.js} (86%) diff --git a/package.json b/package.json index ac4eec4b..6352b1e8 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "lint": "prettier --check assets/" }, "dependencies": { - "@ctfdio/ctfd-js": "^0.0.11", + "@ctfdio/ctfd-js": "^0.0.12", "@fontsource/lato": "^4.5.3", "@fontsource/raleway": "^4.5.3", "@fortawesome/fontawesome-free": "6.0.0", diff --git a/static/assets/challenges.fcb4326f.js b/static/assets/challenges.6fd01a77.js similarity index 96% rename from static/assets/challenges.fcb4326f.js rename to static/assets/challenges.6fd01a77.js index 220d2383..7e42f79a 100644 --- a/static/assets/challenges.fcb4326f.js +++ b/static/assets/challenges.6fd01a77.js @@ -1 +1 @@ -import{m as s,C as a,h as r,T as h,d as g,M as c}from"./index.1d7c7e9f.js";function o(e){let l=new DOMParser().parseFromString(e,"text/html");return l.querySelectorAll('a[href*="://"]').forEach(i=>{i.setAttribute("target","_blank")}),l.documentElement.outerHTML}window.Alpine=s;s.store("challenge",{data:{view:""}});s.data("Hint",()=>({id:null,html:null,async showHint(e){if(e.target.open){let l=(await a.pages.challenge.loadHint(this.id)).data;if(l.content)this.html=o(l.html);else if(await a.pages.challenge.displayUnlock(this.id)){let i=await a.pages.challenge.loadUnlock(this.id);if(i.success){let d=(await a.pages.challenge.loadHint(this.id)).data;this.html=o(d.html)}else e.target.open=!1,a._functions.challenge.displayUnlockError(i)}else e.target.open=!1}}}));s.data("Challenge",()=>({id:null,next_id:null,submission:"",tab:null,solves:[],response:null,async init(){r()},getStyles(){let e={"modal-dialog":!0};try{switch(a.config.themeSettings.challenge_window_size){case"sm":e["modal-sm"]=!0;break;case"lg":e["modal-lg"]=!0;break;case"xl":e["modal-xl"]=!0;break;default:break}}catch(t){console.log("Error processing challenge_window_size"),console.log(t)}return e},async init(){r()},async showChallenge(){new h(this.$el).show()},async showSolves(){this.solves=await a.pages.challenge.loadSolves(this.id),this.solves.forEach(e=>(e.date=g(e.date).format("MMMM Do, h:mm:ss A"),e)),new h(this.$el).show()},getNextId(){return s.store("challenge").data.next_id},async nextChallenge(){let e=c.getOrCreateInstance("[x-ref='challengeWindow']");e._element.addEventListener("hidden.bs.modal",t=>{s.nextTick(()=>{this.$dispatch("load-challenge",this.getNextId())})},{once:!0}),e.hide()},async submitChallenge(){this.response=await a.pages.challenge.submitChallenge(this.id,this.submission),await this.renderSubmissionResponse()},async renderSubmissionResponse(){this.response.data.status==="correct"&&(this.submission=""),this.$dispatch("load-challenges")}}));s.data("ChallengeBoard",()=>({loaded:!1,challenges:[],challenge:null,async init(){if(this.challenges=await a.pages.challenges.getChallenges(),this.loaded=!0,window.location.hash){let e=decodeURIComponent(window.location.hash.substring(1)),t=e.lastIndexOf("-");if(t>=0){let n=[e.slice(0,t),e.slice(t+1)][1];await this.loadChallenge(n)}}},getCategories(){const e=[];this.challenges.forEach(t=>{const{category:l}=t;e.includes(l)||e.push(l)});try{const t=a.config.themeSettings.challenge_category_order;if(t){const l=new Function(`return (${t})`);e.sort(l())}}catch(t){console.log("Error running challenge_category_order function"),console.log(t)}return e},getChallenges(e){let t=this.challenges;e&&(t=this.challenges.filter(l=>l.category===e));try{const l=a.config.themeSettings.challenge_order;if(l){const n=new Function(`return (${l})`);t.sort(n())}}catch(l){console.log("Error running challenge_order function"),console.log(l)}return t},async loadChallenges(){this.challenges=await a.pages.challenges.getChallenges()},async loadChallenge(e){await a.pages.challenge.displayChallenge(e,t=>{t.data.view=o(t.data.view),s.store("challenge").data=t.data,s.nextTick(()=>{let l=c.getOrCreateInstance("[x-ref='challengeWindow']");l._element.addEventListener("hidden.bs.modal",n=>{history.replaceState(null,null," ")},{once:!0}),l.show(),history.replaceState(null,null,`#${t.data.name}-${e}`)})})}}));s.start(); +import{m as s,C as a,h as r,T as h,d as g,M as c}from"./index.69d1de7e.js";function o(e){let l=new DOMParser().parseFromString(e,"text/html");return l.querySelectorAll('a[href*="://"]').forEach(i=>{i.setAttribute("target","_blank")}),l.documentElement.outerHTML}window.Alpine=s;s.store("challenge",{data:{view:""}});s.data("Hint",()=>({id:null,html:null,async showHint(e){if(e.target.open){let l=(await a.pages.challenge.loadHint(this.id)).data;if(l.content)this.html=o(l.html);else if(await a.pages.challenge.displayUnlock(this.id)){let i=await a.pages.challenge.loadUnlock(this.id);if(i.success){let d=(await a.pages.challenge.loadHint(this.id)).data;this.html=o(d.html)}else e.target.open=!1,a._functions.challenge.displayUnlockError(i)}else e.target.open=!1}}}));s.data("Challenge",()=>({id:null,next_id:null,submission:"",tab:null,solves:[],response:null,async init(){r()},getStyles(){let e={"modal-dialog":!0};try{switch(a.config.themeSettings.challenge_window_size){case"sm":e["modal-sm"]=!0;break;case"lg":e["modal-lg"]=!0;break;case"xl":e["modal-xl"]=!0;break;default:break}}catch(t){console.log("Error processing challenge_window_size"),console.log(t)}return e},async init(){r()},async showChallenge(){new h(this.$el).show()},async showSolves(){this.solves=await a.pages.challenge.loadSolves(this.id),this.solves.forEach(e=>(e.date=g(e.date).format("MMMM Do, h:mm:ss A"),e)),new h(this.$el).show()},getNextId(){return s.store("challenge").data.next_id},async nextChallenge(){let e=c.getOrCreateInstance("[x-ref='challengeWindow']");e._element.addEventListener("hidden.bs.modal",t=>{s.nextTick(()=>{this.$dispatch("load-challenge",this.getNextId())})},{once:!0}),e.hide()},async submitChallenge(){this.response=await a.pages.challenge.submitChallenge(this.id,this.submission),await this.renderSubmissionResponse()},async renderSubmissionResponse(){this.response.data.status==="correct"&&(this.submission=""),this.$dispatch("load-challenges")}}));s.data("ChallengeBoard",()=>({loaded:!1,challenges:[],challenge:null,async init(){if(this.challenges=await a.pages.challenges.getChallenges(),this.loaded=!0,window.location.hash){let e=decodeURIComponent(window.location.hash.substring(1)),t=e.lastIndexOf("-");if(t>=0){let n=[e.slice(0,t),e.slice(t+1)][1];await this.loadChallenge(n)}}},getCategories(){const e=[];this.challenges.forEach(t=>{const{category:l}=t;e.includes(l)||e.push(l)});try{const t=a.config.themeSettings.challenge_category_order;if(t){const l=new Function(`return (${t})`);e.sort(l())}}catch(t){console.log("Error running challenge_category_order function"),console.log(t)}return e},getChallenges(e){let t=this.challenges;e&&(t=this.challenges.filter(l=>l.category===e));try{const l=a.config.themeSettings.challenge_order;if(l){const n=new Function(`return (${l})`);t.sort(n())}}catch(l){console.log("Error running challenge_order function"),console.log(l)}return t},async loadChallenges(){this.challenges=await a.pages.challenges.getChallenges()},async loadChallenge(e){await a.pages.challenge.displayChallenge(e,t=>{t.data.view=o(t.data.view),s.store("challenge").data=t.data,s.nextTick(()=>{let l=c.getOrCreateInstance("[x-ref='challengeWindow']");l._element.addEventListener("hidden.bs.modal",n=>{history.replaceState(null,null," ")},{once:!0}),l.show(),history.replaceState(null,null,`#${t.data.name}-${e}`)})})}}));s.start(); diff --git a/static/assets/clipboard.37e7316d.js b/static/assets/clipboard.a72a4f92.js similarity index 91% rename from static/assets/clipboard.37e7316d.js rename to static/assets/clipboard.a72a4f92.js index a5bdab16..14e36dd8 100644 --- a/static/assets/clipboard.37e7316d.js +++ b/static/assets/clipboard.a72a4f92.js @@ -1 +1 @@ -import{a as u}from"./index.1d7c7e9f.js";function r(a){const t=new FormData(a),c=[];for(const[l,n]of t)c.push({name:l,value:n});return c}function h(a,t,c){let l={},n=r(a);return a.querySelectorAll("input[type=checkbox]:checked").forEach(e=>{n.push({name:e.name,value:!0})}),a.querySelectorAll("input[type=checkbox]:not(:checked)").forEach(e=>{n.push({name:e.name,value:!1})}),n.map(e=>{if(c)if(e.value!==null&&e.value!=="")l[e.name]=e.value;else{let o=a.querySelector(`[name='${e.name}']`);t[o.name]!==o.value&&(l[e.name]=e.value)}else l[e.name]=e.value}),l}function m(a){const t=new u(a,{title:"Copied!",trigger:"manual"});navigator.clipboard.writeText(a.value).then(()=>{t.show(),setTimeout(()=>{t.hide()},1500)})}export{m as c,h as s}; +import{a as u}from"./index.69d1de7e.js";function r(a){const t=new FormData(a),c=[];for(const[l,n]of t)c.push({name:l,value:n});return c}function h(a,t,c){let l={},n=r(a);return a.querySelectorAll("input[type=checkbox]:checked").forEach(e=>{n.push({name:e.name,value:!0})}),a.querySelectorAll("input[type=checkbox]:not(:checked)").forEach(e=>{n.push({name:e.name,value:!1})}),n.map(e=>{if(c)if(e.value!==null&&e.value!=="")l[e.name]=e.value;else{let o=a.querySelector(`[name='${e.name}']`);t[o.name]!==o.value&&(l[e.name]=e.value)}else l[e.name]=e.value}),l}function m(a){const t=new u(a,{title:"Copied!",trigger:"manual"});navigator.clipboard.writeText(a.value).then(()=>{t.show(),setTimeout(()=>{t.hide()},1500)})}export{m as c,h as s}; diff --git a/static/assets/index.1d7c7e9f.js b/static/assets/index.69d1de7e.js similarity index 90% rename from static/assets/index.1d7c7e9f.js rename to static/assets/index.69d1de7e.js index 2b16212c..883084dd 100644 --- a/static/assets/index.1d7c7e9f.js +++ b/static/assets/index.69d1de7e.js @@ -1,6 +1,6 @@ var ae=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof ae<"u"&&ae,fe={searchParams:"URLSearchParams"in ae,iterable:"Symbol"in ae&&"iterator"in Symbol,blob:"FileReader"in ae&&"Blob"in ae&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in ae,arrayBuffer:"ArrayBuffer"in ae};function $l(e){return e&&DataView.prototype.isPrototypeOf(e)}if(fe.arrayBuffer)var Cl=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Dl=ArrayBuffer.isView||function(e){return e&&Cl.indexOf(Object.prototype.toString.call(e))>-1};function un(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e==="")throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function ci(e){return typeof e!="string"&&(e=String(e)),e}function li(e){var t={next:function(){var n=e.shift();return{done:n===void 0,value:n}}};return fe.iterable&&(t[Symbol.iterator]=function(){return t}),t}function Z(e){this.map={},e instanceof Z?e.forEach(function(t,n){this.append(n,t)},this):Array.isArray(e)?e.forEach(function(t){this.append(t[0],t[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}Z.prototype.append=function(e,t){e=un(e),t=ci(t);var n=this.map[e];this.map[e]=n?n+", "+t:t};Z.prototype.delete=function(e){delete this.map[un(e)]};Z.prototype.get=function(e){return e=un(e),this.has(e)?this.map[e]:null};Z.prototype.has=function(e){return this.map.hasOwnProperty(un(e))};Z.prototype.set=function(e,t){this.map[un(e)]=ci(t)};Z.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)};Z.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),li(e)};Z.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),li(e)};Z.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),li(e)};fe.iterable&&(Z.prototype[Symbol.iterator]=Z.prototype.entries);function yr(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function $o(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function Nl(e){var t=new FileReader,n=$o(t);return t.readAsArrayBuffer(e),n}function Ll(e){var t=new FileReader,n=$o(t);return t.readAsText(e),n}function Ml(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r-1?t:e}function ht(e,t){if(!(this instanceof ht))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t=t||{};var n=t.body;if(e instanceof ht){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new Z(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!n&&e._bodyInit!=null&&(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new Z(t.headers)),this.method=Pl(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&n)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(n),(this.method==="GET"||this.method==="HEAD")&&(t.cache==="no-store"||t.cache==="no-cache")){var r=/([?&])_=[^&]*/;if(r.test(this.url))this.url=this.url.replace(r,"$1_="+new Date().getTime());else{var i=/\?/;this.url+=(i.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}ht.prototype.clone=function(){return new ht(this,{body:this._bodyInit})};function kl(e){var t=new FormData;return e.trim().split("&").forEach(function(n){if(n){var r=n.split("="),i=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(o))}}),t}function Rl(e){var t=new Z,n=e.replace(/\r?\n[\t ]+/g," ");return n.split("\r").map(function(r){return r.indexOf(` -`)===0?r.substr(1,r.length):r}).forEach(function(r){var i=r.split(":"),o=i.shift().trim();if(o){var a=i.join(":").trim();t.append(o,a)}}),t}Co.call(ht.prototype);function Me(e,t){if(!(this instanceof Me))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=t.status===void 0?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText===void 0?"":""+t.statusText,this.headers=new Z(t.headers),this.url=t.url||"",this._initBody(e)}Co.call(Me.prototype);Me.prototype.clone=function(){return new Me(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Z(this.headers),url:this.url})};Me.error=function(){var e=new Me(null,{status:0,statusText:""});return e.type="error",e};var Hl=[301,302,303,307,308];Me.redirect=function(e,t){if(Hl.indexOf(t)===-1)throw new RangeError("Invalid status code");return new Me(null,{status:t,headers:{location:e}})};var st=ae.DOMException;try{new st}catch{st=function(t,n){this.message=t,this.name=n;var r=Error(t);this.stack=r.stack},st.prototype=Object.create(Error.prototype),st.prototype.constructor=st}function Do(e,t){return new Promise(function(n,r){var i=new ht(e,t);if(i.signal&&i.signal.aborted)return r(new st("Aborted","AbortError"));var o=new XMLHttpRequest;function a(){o.abort()}o.onload=function(){var f={status:o.status,statusText:o.statusText,headers:Rl(o.getAllResponseHeaders()||"")};f.url="responseURL"in o?o.responseURL:f.headers.get("X-Request-URL");var d="response"in o?o.response:o.responseText;setTimeout(function(){n(new Me(d,f))},0)},o.onerror=function(){setTimeout(function(){r(new TypeError("Network request failed"))},0)},o.ontimeout=function(){setTimeout(function(){r(new TypeError("Network request failed"))},0)},o.onabort=function(){setTimeout(function(){r(new st("Aborted","AbortError"))},0)};function l(f){try{return f===""&&ae.location.href?ae.location.href:f}catch{return f}}o.open(i.method,l(i.url),!0),i.credentials==="include"?o.withCredentials=!0:i.credentials==="omit"&&(o.withCredentials=!1),"responseType"in o&&(fe.blob?o.responseType="blob":fe.arrayBuffer&&i.headers.get("Content-Type")&&i.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(o.responseType="arraybuffer")),t&&typeof t.headers=="object"&&!(t.headers instanceof Z)?Object.getOwnPropertyNames(t.headers).forEach(function(f){o.setRequestHeader(f,ci(t.headers[f]))}):i.headers.forEach(function(f,d){o.setRequestHeader(d,f)}),i.signal&&(i.signal.addEventListener("abort",a),o.onreadystatechange=function(){o.readyState===4&&i.signal.removeEventListener("abort",a)}),o.send(typeof i._bodyInit>"u"?null:i._bodyInit)})}Do.polyfill=!0;ae.fetch||(ae.fetch=Do,ae.Headers=Z,ae.Request=ht,ae.Response=Me);const J={urlRoot:"",csrfNonce:"",userMode:"",userName:"",userEmail:"",start:null,end:null,themeSettings:{},eventSounds:["/themes/core/static/sounds/notification.webm","/themes/core/static/sounds/notification.mp3"]},Bl=window.fetch,Vl=(e,t)=>(t===void 0&&(t={method:"GET",credentials:"same-origin",headers:{}}),e=J.urlRoot+e,t.headers===void 0&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=J.csrfNonce,Bl(e,t));var Te=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},No={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Te,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",a="second",l="minute",f="hour",d="day",g="week",s="month",c="quarter",u="year",h="date",_="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(w){var E=["th","st","nd","rd"],v=w%100;return"["+w+(E[(v-20)%10]||E[v]||E[0])+"]"}},O=function(w,E,v){var A=String(w);return!A||A.length>=E?w:""+Array(E+1-A.length).join(v)+w},D={s:O,z:function(w){var E=-w.utcOffset(),v=Math.abs(E),A=Math.floor(v/60),y=v%60;return(E<=0?"+":"-")+O(A,2,"0")+":"+O(y,2,"0")},m:function w(E,v){if(E.date()1)return w(S[0])}else{var P=E.name;I[P]=E,y=P}return!A&&y&&(L=y),y||!A&&L},$=function(w,E){if(V(w))return w.clone();var v=typeof E=="object"?E:{};return v.date=w,v.args=arguments,new U(v)},N=D;N.l=F,N.i=V,N.w=function(w,E){return $(w,{locale:E.$L,utc:E.$u,x:E.$x,$offset:E.$offset})};var U=function(){function w(v){this.$L=F(v.locale,null,!0),this.parse(v)}var E=w.prototype;return E.parse=function(v){this.$d=function(A){var y=A.date,x=A.utc;if(y===null)return new Date(NaN);if(N.u(y))return new Date;if(y instanceof Date)return new Date(y);if(typeof y=="string"&&!/Z$/i.test(y)){var S=y.match(p);if(S){var P=S[2]-1||0,B=(S[7]||"0").substring(0,3);return x?new Date(Date.UTC(S[1],P,S[3]||1,S[4]||0,S[5]||0,S[6]||0,B)):new Date(S[1],P,S[3]||1,S[4]||0,S[5]||0,S[6]||0,B)}}return new Date(y)}(v),this.$x=v.x||{},this.init()},E.init=function(){var v=this.$d;this.$y=v.getFullYear(),this.$M=v.getMonth(),this.$D=v.getDate(),this.$W=v.getDay(),this.$H=v.getHours(),this.$m=v.getMinutes(),this.$s=v.getSeconds(),this.$ms=v.getMilliseconds()},E.$utils=function(){return N},E.isValid=function(){return this.$d.toString()!==_},E.isSame=function(v,A){var y=$(v);return this.startOf(A)<=y&&y<=this.endOf(A)},E.isAfter=function(v,A){return $(v)/,ql=/^\w+$/;function di(e,t){const n=zl(t);return!e||!n&&!Nt(t)&&!ne(t)?[]:!n&&Kl.test(e)?t.getElementsByClassName(e.slice(1).replace(/\\/g,"")):!n&&ql.test(e)?t.getElementsByTagName(e):t.querySelectorAll(e)}class Yn{constructor(t,n){if(!t)return;if(kr(t))return t;let r=t;if(he(t)){const i=(kr(n)?n[0]:n)||Be;if(r=Yl.test(t)&&"getElementById"in i?i.getElementById(t.slice(1).replace(/\\/g,"")):Gl.test(t)?Fo(t):di(t,i),!r)return}else if(Et(t))return this.ready(t);(r.nodeType||r===In)&&(r=[r]),this.length=r.length;for(let i=0,o=this.length;i{for(;t.firstChild;)t.removeChild(t.firstChild)})};function Pn(...e){const t=Ql(e[0])?e.shift():!1,n=e.shift(),r=e.length;if(!n)return{};if(!r)return Pn(t,R,n);for(let i=0;i{!ne(o)||se(n,(a,l)=>{r?t?o.classList.add(l):o.classList.remove(l):o.classList.toggle(l)})})};C.addClass=function(e){return this.toggleClass(e,!0)};C.removeAttr=function(e){const t=Kn(e);return this.each((n,r)=>{!ne(r)||se(t,(i,o)=>{r.removeAttribute(o)})})};function Zl(e,t){if(!!e){if(he(e)){if(arguments.length<2){if(!this[0]||!ne(this[0]))return;const n=this[0].getAttribute(e);return cn(n)?void 0:n}return pe(t)?this:cn(t)?this.removeAttr(e):this.each((n,r)=>{!ne(r)||r.setAttribute(e,t)})}for(const n in e)this.attr(n,e[n]);return this}}C.attr=Zl;C.removeClass=function(e){return arguments.length?this.toggleClass(e,!1):this.attr("class","")};C.hasClass=function(e){return!!e&&fi.call(this,t=>ne(t)&&t.classList.contains(e))};C.get=function(e){return pe(e)?Bo.call(this):(e=Number(e),this[e<0?e+this.length:e])};C.eq=function(e){return R(this.get(e))};C.first=function(){return this.eq(0)};C.last=function(){return this.eq(-1)};function eu(e){return pe(e)?this.get().map(t=>ne(t)||Xl(t)?t.textContent:"").join(""):this.each((t,n)=>{!ne(n)||(n.textContent=e)})}C.text=eu;function Ve(e,t,n){if(!ne(e))return;const r=In.getComputedStyle(e,null);return n?r.getPropertyValue(t)||void 0:r[t]||e.style[t]}function Ne(e,t){return parseInt(Ve(e,t),10)||0}function hs(e,t){return Ne(e,`border${t?"Left":"Top"}Width`)+Ne(e,`padding${t?"Left":"Top"}`)+Ne(e,`padding${t?"Right":"Bottom"}`)+Ne(e,`border${t?"Right":"Bottom"}Width`)}const br={};function tu(e){if(br[e])return br[e];const t=yt(e);Be.body.insertBefore(t,null);const n=Ve(t,"display");return Be.body.removeChild(t),br[e]=n!=="none"?n:"block"}function ps(e){return Ve(e,"display")==="none"}function jo(e,t){const n=e&&(e.matches||e.webkitMatchesSelector||e.msMatchesSelector);return!!n&&!!t&&n.call(e,t)}function Gn(e){return he(e)?(t,n)=>jo(n,e):Et(e)?e:kr(e)?(t,n)=>e.is(n):e?(t,n)=>n===e:()=>!1}C.filter=function(e){const t=Gn(e);return R(ui.call(this,(n,r)=>t.call(n,r,n)))};function ze(e,t){return t?e.filter(t):e}C.detach=function(e){return ze(this,e).each((t,n)=>{n.parentNode&&n.parentNode.removeChild(n)}),this};const nu=/^\s*<(\w+)[^>]*>/,ru=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,_s={"*":Po,tr:jl,td:ds,th:ds,thead:Er,tbody:Er,tfoot:Er};function Fo(e){if(!he(e))return[];if(ru.test(e))return[yt(RegExp.$1)];const t=nu.test(e)&&RegExp.$1,n=_s[t]||_s["*"];return n.innerHTML=e,R(n.childNodes).detach().get()}R.parseHTML=Fo;C.has=function(e){const t=he(e)?(n,r)=>di(e,r).length:(n,r)=>r.contains(e);return this.filter(t)};C.not=function(e){const t=Gn(e);return this.filter((n,r)=>(!he(e)||ne(r))&&!t.call(r,n,r))};function Fe(e,t,n,r){const i=[],o=Et(t),a=r&&Gn(r);for(let l=0,f=e.length;lt.selected&&!t.disabled&&!t.parentNode.disabled),"value"):e.value||""}function iu(e){return arguments.length?this.each((t,n)=>{const r=n.multiple&&n.options;if(r||Qo.test(n.type)){const i=Un(e)?Ho.call(e,String):cn(e)?[]:[String(e)];r?se(n.options,(o,a)=>{a.selected=i.indexOf(a.value)>=0},!0):n.checked=i.indexOf(n.value)>=0}else n.value=pe(e)||cn(e)?"":e}):this[0]&&Wo(this[0])}C.val=iu;C.is=function(e){const t=Gn(e);return fi.call(this,(n,r)=>t.call(n,r,n))};R.guid=1;function Pe(e){return e.length>1?ui.call(e,(t,n,r)=>Ro.call(r,t)===n):e}R.unique=Pe;C.add=function(e,t){return R(Pe(this.get().concat(R(e,t).get())))};C.children=function(e){return ze(R(Pe(Fe(this,t=>t.children))),e)};C.parent=function(e){return ze(R(Pe(Fe(this,"parentNode"))),e)};C.index=function(e){const t=e?R(e)[0]:this[0],n=e?this:R(t).parent().children();return Ro.call(n,t)};C.closest=function(e){const t=this.filter(e);if(t.length)return t;const n=this.parent();return n.length?n.closest(e):t};C.siblings=function(e){return ze(R(Pe(Fe(this,t=>R(t).parent().children().not(t)))),e)};C.find=function(e){return R(Pe(Fe(this,t=>di(e,t))))};const su=/^\s*\s*$/g,ou=/^$|^module$|\/(java|ecma)script/i,au=["type","src","nonce","noModule"];function cu(e,t){const n=R(e);n.filter("script").add(n.find("script")).each((r,i)=>{if(ou.test(i.type)&&Io.contains(i)){const o=yt("script");o.text=i.textContent.replace(su,""),se(au,(a,l)=>{i[l]&&(o[l]=i[l])}),t.head.insertBefore(o,null),t.head.removeChild(o)}})}function lu(e,t,n,r,i){r?e.insertBefore(t,n?e.firstChild:null):e.nodeName==="HTML"?e.parentNode.replaceChild(t,e):e.parentNode.insertBefore(t,n?e:e.nextSibling),i&&cu(t,e.ownerDocument)}function Xe(e,t,n,r,i,o,a,l){return se(e,(f,d)=>{se(R(d),(g,s)=>{se(R(t),(c,u)=>{const h=n?s:u,_=n?u:s,p=n?g:c;lu(h,p?_.cloneNode(!0):_,r,i,!p)},l)},a)},o),t}C.after=function(){return Xe(arguments,this,!1,!1,!1,!0,!0)};C.append=function(){return Xe(arguments,this,!1,!1,!0)};function uu(e){if(!arguments.length)return this[0]&&this[0].innerHTML;if(pe(e))return this;const t=/]/.test(e);return this.each((n,r)=>{!ne(r)||(t?R(r).empty().append(e):r.innerHTML=e)})}C.html=uu;C.appendTo=function(e){return Xe(arguments,this,!0,!1,!0)};C.wrapInner=function(e){return this.each((t,n)=>{const r=R(n),i=r.contents();i.length?i.wrapAll(e):r.append(e)})};C.before=function(){return Xe(arguments,this,!1,!0)};C.wrapAll=function(e){let t=R(e),n=t[0];for(;n.children.length;)n=n.firstElementChild;return this.first().before(t),this.appendTo(n)};C.wrap=function(e){return this.each((t,n)=>{const r=R(e)[0];R(n).wrapAll(t?r.cloneNode(!0):r)})};C.insertAfter=function(e){return Xe(arguments,this,!0,!1,!1,!1,!1,!0)};C.insertBefore=function(e){return Xe(arguments,this,!0,!0)};C.prepend=function(){return Xe(arguments,this,!1,!0,!0,!0,!0)};C.prependTo=function(e){return Xe(arguments,this,!0,!0,!0,!1,!1,!0)};C.contents=function(){return R(Pe(Fe(this,e=>e.tagName==="IFRAME"?[e.contentDocument]:e.tagName==="TEMPLATE"?e.content.childNodes:e.childNodes)))};C.next=function(e,t,n){return ze(R(Pe(Fe(this,"nextElementSibling",t,n))),e)};C.nextAll=function(e){return this.next(e,!0)};C.nextUntil=function(e,t){return this.next(t,!0,e)};C.parents=function(e,t){return ze(R(Pe(Fe(this,"parentElement",!0,t))),e)};C.parentsUntil=function(e,t){return this.parents(t,e)};C.prev=function(e,t,n){return ze(R(Pe(Fe(this,"previousElementSibling",t,n))),e)};C.prevAll=function(e){return this.prev(e,!0)};C.prevUntil=function(e,t){return this.prev(t,!0,e)};C.map=function(e){return R(Fl.apply([],Ho.call(this,(t,n)=>e.call(t,n,t))))};C.clone=function(){return this.map((e,t)=>t.cloneNode(!0))};C.offsetParent=function(){return this.map((e,t)=>{let n=t.offsetParent;for(;n&&Ve(n,"position")==="static";)n=n.offsetParent;return n||Io})};C.slice=function(e,t){return R(Bo.call(this,e,t))};const fu=/-([a-z])/g;function pi(e){return e.replace(fu,(t,n)=>n.toUpperCase())}C.ready=function(e){const t=()=>setTimeout(e,0,R);return Be.readyState!=="loading"?t():Be.addEventListener("DOMContentLoaded",t),this};C.unwrap=function(){return this.parent().each((e,t)=>{if(t.tagName==="BODY")return;const n=R(t);n.replaceWith(n.children())}),this};C.offset=function(){const e=this[0];if(!e)return;const t=e.getBoundingClientRect();return{top:t.top+In.pageYOffset,left:t.left+In.pageXOffset}};C.position=function(){const e=this[0];if(!e)return;const t=Ve(e,"position")==="fixed",n=t?e.getBoundingClientRect():this.offset();if(!t){const r=e.ownerDocument;let i=e.offsetParent||r.documentElement;for(;(i===r.body||i===r.documentElement)&&Ve(i,"position")==="static";)i=i.parentNode;if(i!==e&&ne(i)){const o=R(i).offset();n.top-=o.top+Ne(i,"borderTopWidth"),n.left-=o.left+Ne(i,"borderLeftWidth")}}return{top:n.top-Ne(e,"marginTop"),left:n.left-Ne(e,"marginLeft")}};const Uo={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};C.prop=function(e,t){if(!!e){if(he(e))return e=Uo[e]||e,arguments.length<2?this[0]&&this[0][e]:this.each((n,r)=>{r[e]=t});for(const n in e)this.prop(n,e[n]);return this}};C.removeProp=function(e){return this.each((t,n)=>{delete n[Uo[e]||e]})};const du=/^--/;function _i(e){return du.test(e)}const wr={},{style:hu}=Po,pu=["webkit","moz","ms"];function _u(e,t=_i(e)){if(t)return e;if(!wr[e]){const n=pi(e),r=`${n[0].toUpperCase()}${n.slice(1)}`,i=`${n} ${pu.join(`${r} `)}${r}`.split(" ");se(i,(o,a)=>{if(a in hu)return wr[e]=a,!1})}return wr[e]}const mu={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function Yo(e,t,n=_i(e)){return!n&&!mu[e]&&Vo(t)?`${t}px`:t}function gu(e,t){if(he(e)){const n=_i(e);return e=_u(e,n),arguments.length<2?this[0]&&Ve(this[0],e,n):e?(t=Yo(e,t,n),this.each((r,i)=>{!ne(i)||(n?i.style.setProperty(e,t):i.style[e]=t)})):this}for(const n in e)this.css(n,e[n]);return this}C.css=gu;function Ko(e,t){try{return e(t)}catch{return t}}const vu=/^\s+|\s+$/;function ms(e,t){const n=e.dataset[t]||e.dataset[pi(t)];return vu.test(n)?n:Ko(JSON.parse,n)}function yu(e,t,n){n=Ko(JSON.stringify,n),e.dataset[pi(t)]=n}function Eu(e,t){if(!e){if(!this[0])return;const n={};for(const r in this[0].dataset)n[r]=ms(this[0],r);return n}if(he(e))return arguments.length<2?this[0]&&ms(this[0],e):pe(t)?this:this.each((n,r)=>{yu(r,e,t)});for(const n in e)this.data(n,e[n]);return this}C.data=Eu;function Go(e,t){const n=e.documentElement;return Math.max(e.body[`scroll${t}`],n[`scroll${t}`],e.body[`offset${t}`],n[`offset${t}`],n[`client${t}`])}se([!0,!1],(e,t)=>{se(["Width","Height"],(n,r)=>{const i=`${t?"outer":"inner"}${r}`;C[i]=function(o){if(!!this[0])return Dt(this[0])?t?this[0][`inner${r}`]:this[0].document.documentElement[`client${r}`]:Nt(this[0])?Go(this[0],r):this[0][`${t?"offset":"client"}${r}`]+(o&&t?Ne(this[0],`margin${n?"Top":"Left"}`)+Ne(this[0],`margin${n?"Bottom":"Right"}`):0)}})});se(["Width","Height"],(e,t)=>{const n=t.toLowerCase();C[n]=function(r){if(!this[0])return pe(r)?void 0:this;if(!arguments.length)return Dt(this[0])?this[0].document.documentElement[`client${t}`]:Nt(this[0])?Go(this[0],t):this[0].getBoundingClientRect()[n]-hs(this[0],!e);const i=parseInt(r,10);return this.each((o,a)=>{if(!ne(a))return;const l=Ve(a,"boxSizing");a.style[n]=Yo(n,i+(l==="border-box"?hs(a,!e):0))})}});const gs="___cd";C.toggle=function(e){return this.each((t,n)=>{if(!ne(n))return;(pe(e)?ps(n):e)?(n.style.display=n[gs]||"",ps(n)&&(n.style.display=tu(n.tagName))):(n[gs]=Ve(n,"display"),n.style.display="none")})};C.hide=function(){return this.toggle(!1)};C.show=function(){return this.toggle(!0)};const vs="___ce",mi=".",gi={focus:"focusin",blur:"focusout"},qo={mouseenter:"mouseover",mouseleave:"mouseout"},bu=/^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i;function vi(e){return qo[e]||gi[e]||e}function yi(e){const t=e.split(mi);return[t[0],t.slice(1).sort()]}C.trigger=function(e,t){if(he(e)){const[r,i]=yi(e),o=vi(r);if(!o)return this;const a=bu.test(o)?"MouseEvents":"HTMLEvents";e=Be.createEvent(a),e.initEvent(o,!0,!0),e.namespace=i.join(mi),e.___ot=r}e.___td=t;const n=e.___ot in gi;return this.each((r,i)=>{n&&Et(i[e.___ot])&&(i[`___i${e.type}`]=!0,i[e.___ot](),i[`___i${e.type}`]=!1),i.dispatchEvent(e)})};function zo(e){return e[vs]=e[vs]||{}}function wu(e,t,n,r,i){const o=zo(e);o[t]=o[t]||[],o[t].push([n,r,i]),e.addEventListener(t,i)}function Xo(e,t){return!t||!fi.call(t,n=>e.indexOf(n)<0)}function kn(e,t,n,r,i){const o=zo(e);if(t)o[t]&&(o[t]=o[t].filter(([a,l,f])=>{if(i&&f.guid!==i.guid||!Xo(a,n)||r&&r!==l)return!0;e.removeEventListener(t,f)}));else for(t in o)kn(e,t,n,r,i)}C.off=function(e,t,n){if(pe(e))this.each((r,i)=>{!ne(i)&&!Nt(i)&&!Dt(i)||kn(i)});else if(he(e))Et(t)&&(n=t,t=""),se(Kn(e),(r,i)=>{const[o,a]=yi(i),l=vi(o);this.each((f,d)=>{!ne(d)&&!Nt(d)&&!Dt(d)||kn(d,l,a,t,n)})});else for(const r in e)this.off(r,e[r]);return this};C.remove=function(e){return ze(this,e).detach().off(),this};C.replaceWith=function(e){return this.before(e).remove()};C.replaceAll=function(e){return R(e).replaceWith(this),this};function Au(e,t,n,r,i){if(!he(e)){for(const o in e)this.on(o,t,n,e[o],i);return this}return he(t)||(pe(t)||cn(t)?t="":pe(n)?(n=t,t=""):(r=n,n=t,t="")),Et(r)||(r=n,n=void 0),r?(se(Kn(e),(o,a)=>{const[l,f]=yi(a),d=vi(l),g=l in qo,s=l in gi;!d||this.each((c,u)=>{if(!ne(u)&&!Nt(u)&&!Dt(u))return;const h=function(_){if(_.target[`___i${_.type}`])return _.stopImmediatePropagation();if(_.namespace&&!Xo(f,_.namespace.split(mi))||!t&&(s&&(_.target!==u||_.___ot===d)||g&&_.relatedTarget&&u.contains(_.relatedTarget)))return;let p=u;if(t){let b=_.target;for(;!jo(b,t);)if(b===u||(b=b.parentNode,!b))return;p=b}Object.defineProperty(_,"currentTarget",{configurable:!0,get(){return p}}),Object.defineProperty(_,"delegateTarget",{configurable:!0,get(){return u}}),Object.defineProperty(_,"data",{configurable:!0,get(){return n}});const m=r.call(p,_,_.___td);i&&kn(u,d,f,t,h),m===!1&&(_.preventDefault(),_.stopPropagation())};h.guid=r.guid=r.guid||R.guid++,wu(u,d,f,t,h)})}),this):this}C.on=Au;function Tu(e,t,n,r){return this.on(e,t,n,r,!0)}C.one=Tu;const Su=/\r?\n/g;function Ou(e,t){return`&${encodeURIComponent(e)}=${encodeURIComponent(t.replace(Su,`\r -`))}`}const xu=/file|reset|submit|button|image/i,Qo=/radio|checkbox/i;C.serialize=function(){let e="";return this.each((t,n)=>{se(n.elements||[n],(r,i)=>{if(i.disabled||!i.name||i.tagName==="FIELDSET"||xu.test(i.type)||Qo.test(i.type)&&!i.checked)return;const o=Wo(i);if(!pe(o)){const a=Un(o)?o:[o];se(a,(l,f)=>{e+=Ou(i.name,f)})}})}),e.slice(1)};fn.extend(Mo);function $u(){let e=document.querySelectorAll("[data-time]");for(const t of e){let n=t.dataset.time,r=t.dataset.timeFormat;t.innerText=fn(n).format(r)}}function Cu(e,t){R(t).select(),document.execCommand("copy"),R(e.target).tooltip({title:"Copied!",trigger:"manual"}),R(e.target).tooltip("show"),setTimeout(function(){R(e.target).tooltip("hide")},1500)}function Du(e){let t=0,n,r,i;if(e.length===0)return t;for(n=0,i=e.length;n{const r=document.createElement("script");document.body.appendChild(r),r.onload=t,r.onerror=n,r.async=!0,r.src=e})}async function Mu(e,t){M._internal.challenge={};let n=M.config,r=await Zo(e);M._functions.challenge.displayChallenge&&M._functions.challenge.displayChallenge(r),ea(n.urlRoot+r.type_data.scripts.view).then(()=>{const o=M._internal.challenge;o.data=r,o.preRender(),M._functions.challenge.renderChallenge?M._functions.challenge.renderChallenge(o):t&&t(o),o.postRender()})}async function Iu(e,t){if(M._functions.challenge.submitChallenge){M._functions.challenge.submitChallenge(e,t);return}const r=await(await M.fetch("/api/v1/challenges/attempt",{method:"POST",body:JSON.stringify({challenge_id:e,submission:t})})).json();return M._functions.challenge.displaySubmissionResponse&&M._functions.challenge.displaySubmissionResponse(r),r}async function ta(e){return await(await M.fetch(`/api/v1/hints/${e}`,{method:"GET"})).json()}async function na(e){return await(await M.fetch("/api/v1/unlocks",{method:"POST",body:JSON.stringify({target:e,type:"hints"})})).json()}async function ra(e){let n=(await ta(e)).data;if(n.content){M._functions.challenge.displayHint(n);return}if(await ia(n)){let i=na(e);i.success?await ra(e):M._functions.challenge.displayUnlockError(i)}}async function ia(e){return M._functions.challenge.displayUnlock(e)}async function sa(e){return(await(await M.fetch(`/api/v1/challenges/${e}/solves`,{method:"GET"})).json()).data}async function Pu(e){let t=await sa(e);M._functions.challenge.displaySolves&&M._functions.challenge.displaySolves(t)}async function ku(){return(await(await M.fetch("/api/v1/scoreboard",{method:"GET"})).json()).data}async function Ru(e){return(await(await M.fetch(`/api/v1/scoreboard/top/${e}`,{method:"GET"})).json()).data}async function Hu(e){return await(await M.fetch("/api/v1/users/me",{method:"PATCH",body:JSON.stringify(e)})).json()}async function Bu(e){return await(await M.fetch("/api/v1/tokens",{method:"POST",body:JSON.stringify(e)})).json()}async function Vu(e){return await(await M.fetch(`/api/v1/tokens/${e}`,{method:"DELETE"})).json()}async function ju(e){return await(await M.fetch(`/api/v1/users/${e}/solves`,{method:"GET"})).json()}async function Fu(e){return await(await M.fetch(`/api/v1/users/${e}/fails`,{method:"GET"})).json()}async function Wu(e){return await(await M.fetch(`/api/v1/users/${e}/awards`,{method:"GET"})).json()}async function Uu(){return await(await M.fetch("/api/v1/teams/me/members",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}})).json()}async function Yu(){return await(await M.fetch("/api/v1/teams/me",{method:"DELETE"})).json()}async function Ku(e){return await(await M.fetch("/api/v1/teams/me",{method:"PATCH",body:JSON.stringify(e)})).json()}async function Gu(e){return await(await M.fetch(`/api/v1/teams/${e}/solves`,{method:"GET"})).json()}async function qu(e){return await(await M.fetch(`/api/v1/teams/${e}/fails`,{method:"GET"})).json()}async function zu(e){return await(await M.fetch(`/api/v1/teams/${e}/awards`,{method:"GET"})).json()}function Xu(e){const t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild}function oa(e){const t=document.createElement("div");return t.innerText=e,t.innerHTML}class Qu{constructor(){this.id=Math.random(),this.isMaster=!1,this.others={},window.addEventListener("storage",this),window.addEventListener("unload",this),this.broadcast("hello"),setTimeout(this.check.bind(this),500),this._checkInterval=setInterval(this.check.bind(this),9e3),this._pingInterval=setInterval(this.sendPing.bind(this),17e3)}destroy(){clearInterval(this._pingInterval),clearInterval(this._checkInterval),window.removeEventListener("storage",this),window.removeEventListener("unload",this),this.broadcast("bye")}handleEvent(t){if(t.type==="unload"){this.destroy();return}if(t.type==="broadcast")try{const n=JSON.parse(t.newValue);n.id!==this.id&&this[n.type](n)}catch(n){console.error(n)}}sendPing(){this.broadcast("ping")}hello(t){if(this.ping(t),t.id=200&&this.status<300,this.statusText=t.statusText===void 0?"":""+t.statusText,this.headers=new Z(t.headers),this.url=t.url||"",this._initBody(e)}Co.call(Me.prototype);Me.prototype.clone=function(){return new Me(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Z(this.headers),url:this.url})};Me.error=function(){var e=new Me(null,{status:0,statusText:""});return e.type="error",e};var Hl=[301,302,303,307,308];Me.redirect=function(e,t){if(Hl.indexOf(t)===-1)throw new RangeError("Invalid status code");return new Me(null,{status:t,headers:{location:e}})};var st=ae.DOMException;try{new st}catch{st=function(t,n){this.message=t,this.name=n;var r=Error(t);this.stack=r.stack},st.prototype=Object.create(Error.prototype),st.prototype.constructor=st}function Do(e,t){return new Promise(function(n,r){var i=new ht(e,t);if(i.signal&&i.signal.aborted)return r(new st("Aborted","AbortError"));var o=new XMLHttpRequest;function a(){o.abort()}o.onload=function(){var f={status:o.status,statusText:o.statusText,headers:Rl(o.getAllResponseHeaders()||"")};f.url="responseURL"in o?o.responseURL:f.headers.get("X-Request-URL");var d="response"in o?o.response:o.responseText;setTimeout(function(){n(new Me(d,f))},0)},o.onerror=function(){setTimeout(function(){r(new TypeError("Network request failed"))},0)},o.ontimeout=function(){setTimeout(function(){r(new TypeError("Network request failed"))},0)},o.onabort=function(){setTimeout(function(){r(new st("Aborted","AbortError"))},0)};function l(f){try{return f===""&&ae.location.href?ae.location.href:f}catch{return f}}o.open(i.method,l(i.url),!0),i.credentials==="include"?o.withCredentials=!0:i.credentials==="omit"&&(o.withCredentials=!1),"responseType"in o&&(fe.blob?o.responseType="blob":fe.arrayBuffer&&i.headers.get("Content-Type")&&i.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(o.responseType="arraybuffer")),t&&typeof t.headers=="object"&&!(t.headers instanceof Z)?Object.getOwnPropertyNames(t.headers).forEach(function(f){o.setRequestHeader(f,ci(t.headers[f]))}):i.headers.forEach(function(f,d){o.setRequestHeader(d,f)}),i.signal&&(i.signal.addEventListener("abort",a),o.onreadystatechange=function(){o.readyState===4&&i.signal.removeEventListener("abort",a)}),o.send(typeof i._bodyInit>"u"?null:i._bodyInit)})}Do.polyfill=!0;ae.fetch||(ae.fetch=Do,ae.Headers=Z,ae.Request=ht,ae.Response=Me);const X={urlRoot:"",csrfNonce:"",userMode:"",userName:"",userEmail:"",start:null,end:null,themeSettings:{},eventSounds:["/themes/core/static/sounds/notification.webm","/themes/core/static/sounds/notification.mp3"]},Bl=window.fetch,Vl=(e,t)=>(t===void 0&&(t={method:"GET",credentials:"same-origin",headers:{}}),e=X.urlRoot+e,t.headers===void 0&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=X.csrfNonce,Bl(e,t));var Te=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},No={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Te,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",a="second",l="minute",f="hour",d="day",g="week",s="month",c="quarter",u="year",h="date",_="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(w){var E=["th","st","nd","rd"],v=w%100;return"["+w+(E[(v-20)%10]||E[v]||E[0])+"]"}},O=function(w,E,v){var A=String(w);return!A||A.length>=E?w:""+Array(E+1-A.length).join(v)+w},D={s:O,z:function(w){var E=-w.utcOffset(),v=Math.abs(E),A=Math.floor(v/60),y=v%60;return(E<=0?"+":"-")+O(A,2,"0")+":"+O(y,2,"0")},m:function w(E,v){if(E.date()1)return w(S[0])}else{var P=E.name;I[P]=E,y=P}return!A&&y&&(M=y),y||!A&&M},$=function(w,E){if(V(w))return w.clone();var v=typeof E=="object"?E:{};return v.date=w,v.args=arguments,new U(v)},N=D;N.l=F,N.i=V,N.w=function(w,E){return $(w,{locale:E.$L,utc:E.$u,x:E.$x,$offset:E.$offset})};var U=function(){function w(v){this.$L=F(v.locale,null,!0),this.parse(v)}var E=w.prototype;return E.parse=function(v){this.$d=function(A){var y=A.date,x=A.utc;if(y===null)return new Date(NaN);if(N.u(y))return new Date;if(y instanceof Date)return new Date(y);if(typeof y=="string"&&!/Z$/i.test(y)){var S=y.match(p);if(S){var P=S[2]-1||0,B=(S[7]||"0").substring(0,3);return x?new Date(Date.UTC(S[1],P,S[3]||1,S[4]||0,S[5]||0,S[6]||0,B)):new Date(S[1],P,S[3]||1,S[4]||0,S[5]||0,S[6]||0,B)}}return new Date(y)}(v),this.$x=v.x||{},this.init()},E.init=function(){var v=this.$d;this.$y=v.getFullYear(),this.$M=v.getMonth(),this.$D=v.getDate(),this.$W=v.getDay(),this.$H=v.getHours(),this.$m=v.getMinutes(),this.$s=v.getSeconds(),this.$ms=v.getMilliseconds()},E.$utils=function(){return N},E.isValid=function(){return this.$d.toString()!==_},E.isSame=function(v,A){var y=$(v);return this.startOf(A)<=y&&y<=this.endOf(A)},E.isAfter=function(v,A){return $(v)/,ql=/^\w+$/;function di(e,t){const n=zl(t);return!e||!n&&!Nt(t)&&!ne(t)?[]:!n&&Kl.test(e)?t.getElementsByClassName(e.slice(1).replace(/\\/g,"")):!n&&ql.test(e)?t.getElementsByTagName(e):t.querySelectorAll(e)}class Yn{constructor(t,n){if(!t)return;if(kr(t))return t;let r=t;if(he(t)){const i=(kr(n)?n[0]:n)||Be;if(r=Yl.test(t)&&"getElementById"in i?i.getElementById(t.slice(1).replace(/\\/g,"")):Gl.test(t)?Fo(t):di(t,i),!r)return}else if(Et(t))return this.ready(t);(r.nodeType||r===In)&&(r=[r]),this.length=r.length;for(let i=0,o=this.length;i{for(;t.firstChild;)t.removeChild(t.firstChild)})};function Pn(...e){const t=Ql(e[0])?e.shift():!1,n=e.shift(),r=e.length;if(!n)return{};if(!r)return Pn(t,R,n);for(let i=0;i{!ne(o)||se(n,(a,l)=>{r?t?o.classList.add(l):o.classList.remove(l):o.classList.toggle(l)})})};C.addClass=function(e){return this.toggleClass(e,!0)};C.removeAttr=function(e){const t=Kn(e);return this.each((n,r)=>{!ne(r)||se(t,(i,o)=>{r.removeAttribute(o)})})};function Zl(e,t){if(!!e){if(he(e)){if(arguments.length<2){if(!this[0]||!ne(this[0]))return;const n=this[0].getAttribute(e);return cn(n)?void 0:n}return pe(t)?this:cn(t)?this.removeAttr(e):this.each((n,r)=>{!ne(r)||r.setAttribute(e,t)})}for(const n in e)this.attr(n,e[n]);return this}}C.attr=Zl;C.removeClass=function(e){return arguments.length?this.toggleClass(e,!1):this.attr("class","")};C.hasClass=function(e){return!!e&&fi.call(this,t=>ne(t)&&t.classList.contains(e))};C.get=function(e){return pe(e)?Bo.call(this):(e=Number(e),this[e<0?e+this.length:e])};C.eq=function(e){return R(this.get(e))};C.first=function(){return this.eq(0)};C.last=function(){return this.eq(-1)};function eu(e){return pe(e)?this.get().map(t=>ne(t)||Xl(t)?t.textContent:"").join(""):this.each((t,n)=>{!ne(n)||(n.textContent=e)})}C.text=eu;function Ve(e,t,n){if(!ne(e))return;const r=In.getComputedStyle(e,null);return n?r.getPropertyValue(t)||void 0:r[t]||e.style[t]}function Ne(e,t){return parseInt(Ve(e,t),10)||0}function hs(e,t){return Ne(e,`border${t?"Left":"Top"}Width`)+Ne(e,`padding${t?"Left":"Top"}`)+Ne(e,`padding${t?"Right":"Bottom"}`)+Ne(e,`border${t?"Right":"Bottom"}Width`)}const br={};function tu(e){if(br[e])return br[e];const t=yt(e);Be.body.insertBefore(t,null);const n=Ve(t,"display");return Be.body.removeChild(t),br[e]=n!=="none"?n:"block"}function ps(e){return Ve(e,"display")==="none"}function jo(e,t){const n=e&&(e.matches||e.webkitMatchesSelector||e.msMatchesSelector);return!!n&&!!t&&n.call(e,t)}function Gn(e){return he(e)?(t,n)=>jo(n,e):Et(e)?e:kr(e)?(t,n)=>e.is(n):e?(t,n)=>n===e:()=>!1}C.filter=function(e){const t=Gn(e);return R(ui.call(this,(n,r)=>t.call(n,r,n)))};function ze(e,t){return t?e.filter(t):e}C.detach=function(e){return ze(this,e).each((t,n)=>{n.parentNode&&n.parentNode.removeChild(n)}),this};const nu=/^\s*<(\w+)[^>]*>/,ru=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,_s={"*":Po,tr:jl,td:ds,th:ds,thead:Er,tbody:Er,tfoot:Er};function Fo(e){if(!he(e))return[];if(ru.test(e))return[yt(RegExp.$1)];const t=nu.test(e)&&RegExp.$1,n=_s[t]||_s["*"];return n.innerHTML=e,R(n.childNodes).detach().get()}R.parseHTML=Fo;C.has=function(e){const t=he(e)?(n,r)=>di(e,r).length:(n,r)=>r.contains(e);return this.filter(t)};C.not=function(e){const t=Gn(e);return this.filter((n,r)=>(!he(e)||ne(r))&&!t.call(r,n,r))};function Fe(e,t,n,r){const i=[],o=Et(t),a=r&&Gn(r);for(let l=0,f=e.length;lt.selected&&!t.disabled&&!t.parentNode.disabled),"value"):e.value||""}function iu(e){return arguments.length?this.each((t,n)=>{const r=n.multiple&&n.options;if(r||Qo.test(n.type)){const i=Un(e)?Ho.call(e,String):cn(e)?[]:[String(e)];r?se(n.options,(o,a)=>{a.selected=i.indexOf(a.value)>=0},!0):n.checked=i.indexOf(n.value)>=0}else n.value=pe(e)||cn(e)?"":e}):this[0]&&Wo(this[0])}C.val=iu;C.is=function(e){const t=Gn(e);return fi.call(this,(n,r)=>t.call(n,r,n))};R.guid=1;function Pe(e){return e.length>1?ui.call(e,(t,n,r)=>Ro.call(r,t)===n):e}R.unique=Pe;C.add=function(e,t){return R(Pe(this.get().concat(R(e,t).get())))};C.children=function(e){return ze(R(Pe(Fe(this,t=>t.children))),e)};C.parent=function(e){return ze(R(Pe(Fe(this,"parentNode"))),e)};C.index=function(e){const t=e?R(e)[0]:this[0],n=e?this:R(t).parent().children();return Ro.call(n,t)};C.closest=function(e){const t=this.filter(e);if(t.length)return t;const n=this.parent();return n.length?n.closest(e):t};C.siblings=function(e){return ze(R(Pe(Fe(this,t=>R(t).parent().children().not(t)))),e)};C.find=function(e){return R(Pe(Fe(this,t=>di(e,t))))};const su=/^\s*\s*$/g,ou=/^$|^module$|\/(java|ecma)script/i,au=["type","src","nonce","noModule"];function cu(e,t){const n=R(e);n.filter("script").add(n.find("script")).each((r,i)=>{if(ou.test(i.type)&&Io.contains(i)){const o=yt("script");o.text=i.textContent.replace(su,""),se(au,(a,l)=>{i[l]&&(o[l]=i[l])}),t.head.insertBefore(o,null),t.head.removeChild(o)}})}function lu(e,t,n,r,i){r?e.insertBefore(t,n?e.firstChild:null):e.nodeName==="HTML"?e.parentNode.replaceChild(t,e):e.parentNode.insertBefore(t,n?e:e.nextSibling),i&&cu(t,e.ownerDocument)}function Xe(e,t,n,r,i,o,a,l){return se(e,(f,d)=>{se(R(d),(g,s)=>{se(R(t),(c,u)=>{const h=n?s:u,_=n?u:s,p=n?g:c;lu(h,p?_.cloneNode(!0):_,r,i,!p)},l)},a)},o),t}C.after=function(){return Xe(arguments,this,!1,!1,!1,!0,!0)};C.append=function(){return Xe(arguments,this,!1,!1,!0)};function uu(e){if(!arguments.length)return this[0]&&this[0].innerHTML;if(pe(e))return this;const t=/]/.test(e);return this.each((n,r)=>{!ne(r)||(t?R(r).empty().append(e):r.innerHTML=e)})}C.html=uu;C.appendTo=function(e){return Xe(arguments,this,!0,!1,!0)};C.wrapInner=function(e){return this.each((t,n)=>{const r=R(n),i=r.contents();i.length?i.wrapAll(e):r.append(e)})};C.before=function(){return Xe(arguments,this,!1,!0)};C.wrapAll=function(e){let t=R(e),n=t[0];for(;n.children.length;)n=n.firstElementChild;return this.first().before(t),this.appendTo(n)};C.wrap=function(e){return this.each((t,n)=>{const r=R(e)[0];R(n).wrapAll(t?r.cloneNode(!0):r)})};C.insertAfter=function(e){return Xe(arguments,this,!0,!1,!1,!1,!1,!0)};C.insertBefore=function(e){return Xe(arguments,this,!0,!0)};C.prepend=function(){return Xe(arguments,this,!1,!0,!0,!0,!0)};C.prependTo=function(e){return Xe(arguments,this,!0,!0,!0,!1,!1,!0)};C.contents=function(){return R(Pe(Fe(this,e=>e.tagName==="IFRAME"?[e.contentDocument]:e.tagName==="TEMPLATE"?e.content.childNodes:e.childNodes)))};C.next=function(e,t,n){return ze(R(Pe(Fe(this,"nextElementSibling",t,n))),e)};C.nextAll=function(e){return this.next(e,!0)};C.nextUntil=function(e,t){return this.next(t,!0,e)};C.parents=function(e,t){return ze(R(Pe(Fe(this,"parentElement",!0,t))),e)};C.parentsUntil=function(e,t){return this.parents(t,e)};C.prev=function(e,t,n){return ze(R(Pe(Fe(this,"previousElementSibling",t,n))),e)};C.prevAll=function(e){return this.prev(e,!0)};C.prevUntil=function(e,t){return this.prev(t,!0,e)};C.map=function(e){return R(Fl.apply([],Ho.call(this,(t,n)=>e.call(t,n,t))))};C.clone=function(){return this.map((e,t)=>t.cloneNode(!0))};C.offsetParent=function(){return this.map((e,t)=>{let n=t.offsetParent;for(;n&&Ve(n,"position")==="static";)n=n.offsetParent;return n||Io})};C.slice=function(e,t){return R(Bo.call(this,e,t))};const fu=/-([a-z])/g;function pi(e){return e.replace(fu,(t,n)=>n.toUpperCase())}C.ready=function(e){const t=()=>setTimeout(e,0,R);return Be.readyState!=="loading"?t():Be.addEventListener("DOMContentLoaded",t),this};C.unwrap=function(){return this.parent().each((e,t)=>{if(t.tagName==="BODY")return;const n=R(t);n.replaceWith(n.children())}),this};C.offset=function(){const e=this[0];if(!e)return;const t=e.getBoundingClientRect();return{top:t.top+In.pageYOffset,left:t.left+In.pageXOffset}};C.position=function(){const e=this[0];if(!e)return;const t=Ve(e,"position")==="fixed",n=t?e.getBoundingClientRect():this.offset();if(!t){const r=e.ownerDocument;let i=e.offsetParent||r.documentElement;for(;(i===r.body||i===r.documentElement)&&Ve(i,"position")==="static";)i=i.parentNode;if(i!==e&&ne(i)){const o=R(i).offset();n.top-=o.top+Ne(i,"borderTopWidth"),n.left-=o.left+Ne(i,"borderLeftWidth")}}return{top:n.top-Ne(e,"marginTop"),left:n.left-Ne(e,"marginLeft")}};const Uo={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};C.prop=function(e,t){if(!!e){if(he(e))return e=Uo[e]||e,arguments.length<2?this[0]&&this[0][e]:this.each((n,r)=>{r[e]=t});for(const n in e)this.prop(n,e[n]);return this}};C.removeProp=function(e){return this.each((t,n)=>{delete n[Uo[e]||e]})};const du=/^--/;function _i(e){return du.test(e)}const wr={},{style:hu}=Po,pu=["webkit","moz","ms"];function _u(e,t=_i(e)){if(t)return e;if(!wr[e]){const n=pi(e),r=`${n[0].toUpperCase()}${n.slice(1)}`,i=`${n} ${pu.join(`${r} `)}${r}`.split(" ");se(i,(o,a)=>{if(a in hu)return wr[e]=a,!1})}return wr[e]}const mu={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function Yo(e,t,n=_i(e)){return!n&&!mu[e]&&Vo(t)?`${t}px`:t}function gu(e,t){if(he(e)){const n=_i(e);return e=_u(e,n),arguments.length<2?this[0]&&Ve(this[0],e,n):e?(t=Yo(e,t,n),this.each((r,i)=>{!ne(i)||(n?i.style.setProperty(e,t):i.style[e]=t)})):this}for(const n in e)this.css(n,e[n]);return this}C.css=gu;function Ko(e,t){try{return e(t)}catch{return t}}const vu=/^\s+|\s+$/;function ms(e,t){const n=e.dataset[t]||e.dataset[pi(t)];return vu.test(n)?n:Ko(JSON.parse,n)}function yu(e,t,n){n=Ko(JSON.stringify,n),e.dataset[pi(t)]=n}function Eu(e,t){if(!e){if(!this[0])return;const n={};for(const r in this[0].dataset)n[r]=ms(this[0],r);return n}if(he(e))return arguments.length<2?this[0]&&ms(this[0],e):pe(t)?this:this.each((n,r)=>{yu(r,e,t)});for(const n in e)this.data(n,e[n]);return this}C.data=Eu;function Go(e,t){const n=e.documentElement;return Math.max(e.body[`scroll${t}`],n[`scroll${t}`],e.body[`offset${t}`],n[`offset${t}`],n[`client${t}`])}se([!0,!1],(e,t)=>{se(["Width","Height"],(n,r)=>{const i=`${t?"outer":"inner"}${r}`;C[i]=function(o){if(!!this[0])return Dt(this[0])?t?this[0][`inner${r}`]:this[0].document.documentElement[`client${r}`]:Nt(this[0])?Go(this[0],r):this[0][`${t?"offset":"client"}${r}`]+(o&&t?Ne(this[0],`margin${n?"Top":"Left"}`)+Ne(this[0],`margin${n?"Bottom":"Right"}`):0)}})});se(["Width","Height"],(e,t)=>{const n=t.toLowerCase();C[n]=function(r){if(!this[0])return pe(r)?void 0:this;if(!arguments.length)return Dt(this[0])?this[0].document.documentElement[`client${t}`]:Nt(this[0])?Go(this[0],t):this[0].getBoundingClientRect()[n]-hs(this[0],!e);const i=parseInt(r,10);return this.each((o,a)=>{if(!ne(a))return;const l=Ve(a,"boxSizing");a.style[n]=Yo(n,i+(l==="border-box"?hs(a,!e):0))})}});const gs="___cd";C.toggle=function(e){return this.each((t,n)=>{if(!ne(n))return;(pe(e)?ps(n):e)?(n.style.display=n[gs]||"",ps(n)&&(n.style.display=tu(n.tagName))):(n[gs]=Ve(n,"display"),n.style.display="none")})};C.hide=function(){return this.toggle(!1)};C.show=function(){return this.toggle(!0)};const vs="___ce",mi=".",gi={focus:"focusin",blur:"focusout"},qo={mouseenter:"mouseover",mouseleave:"mouseout"},bu=/^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i;function vi(e){return qo[e]||gi[e]||e}function yi(e){const t=e.split(mi);return[t[0],t.slice(1).sort()]}C.trigger=function(e,t){if(he(e)){const[r,i]=yi(e),o=vi(r);if(!o)return this;const a=bu.test(o)?"MouseEvents":"HTMLEvents";e=Be.createEvent(a),e.initEvent(o,!0,!0),e.namespace=i.join(mi),e.___ot=r}e.___td=t;const n=e.___ot in gi;return this.each((r,i)=>{n&&Et(i[e.___ot])&&(i[`___i${e.type}`]=!0,i[e.___ot](),i[`___i${e.type}`]=!1),i.dispatchEvent(e)})};function zo(e){return e[vs]=e[vs]||{}}function wu(e,t,n,r,i){const o=zo(e);o[t]=o[t]||[],o[t].push([n,r,i]),e.addEventListener(t,i)}function Xo(e,t){return!t||!fi.call(t,n=>e.indexOf(n)<0)}function kn(e,t,n,r,i){const o=zo(e);if(t)o[t]&&(o[t]=o[t].filter(([a,l,f])=>{if(i&&f.guid!==i.guid||!Xo(a,n)||r&&r!==l)return!0;e.removeEventListener(t,f)}));else for(t in o)kn(e,t,n,r,i)}C.off=function(e,t,n){if(pe(e))this.each((r,i)=>{!ne(i)&&!Nt(i)&&!Dt(i)||kn(i)});else if(he(e))Et(t)&&(n=t,t=""),se(Kn(e),(r,i)=>{const[o,a]=yi(i),l=vi(o);this.each((f,d)=>{!ne(d)&&!Nt(d)&&!Dt(d)||kn(d,l,a,t,n)})});else for(const r in e)this.off(r,e[r]);return this};C.remove=function(e){return ze(this,e).detach().off(),this};C.replaceWith=function(e){return this.before(e).remove()};C.replaceAll=function(e){return R(e).replaceWith(this),this};function Au(e,t,n,r,i){if(!he(e)){for(const o in e)this.on(o,t,n,e[o],i);return this}return he(t)||(pe(t)||cn(t)?t="":pe(n)?(n=t,t=""):(r=n,n=t,t="")),Et(r)||(r=n,n=void 0),r?(se(Kn(e),(o,a)=>{const[l,f]=yi(a),d=vi(l),g=l in qo,s=l in gi;!d||this.each((c,u)=>{if(!ne(u)&&!Nt(u)&&!Dt(u))return;const h=function(_){if(_.target[`___i${_.type}`])return _.stopImmediatePropagation();if(_.namespace&&!Xo(f,_.namespace.split(mi))||!t&&(s&&(_.target!==u||_.___ot===d)||g&&_.relatedTarget&&u.contains(_.relatedTarget)))return;let p=u;if(t){let b=_.target;for(;!jo(b,t);)if(b===u||(b=b.parentNode,!b))return;p=b}Object.defineProperty(_,"currentTarget",{configurable:!0,get(){return p}}),Object.defineProperty(_,"delegateTarget",{configurable:!0,get(){return u}}),Object.defineProperty(_,"data",{configurable:!0,get(){return n}});const m=r.call(p,_,_.___td);i&&kn(u,d,f,t,h),m===!1&&(_.preventDefault(),_.stopPropagation())};h.guid=r.guid=r.guid||R.guid++,wu(u,d,f,t,h)})}),this):this}C.on=Au;function Tu(e,t,n,r){return this.on(e,t,n,r,!0)}C.one=Tu;const Su=/\r?\n/g;function Ou(e,t){return`&${encodeURIComponent(e)}=${encodeURIComponent(t.replace(Su,`\r +`))}`}const xu=/file|reset|submit|button|image/i,Qo=/radio|checkbox/i;C.serialize=function(){let e="";return this.each((t,n)=>{se(n.elements||[n],(r,i)=>{if(i.disabled||!i.name||i.tagName==="FIELDSET"||xu.test(i.type)||Qo.test(i.type)&&!i.checked)return;const o=Wo(i);if(!pe(o)){const a=Un(o)?o:[o];se(a,(l,f)=>{e+=Ou(i.name,f)})}})}),e.slice(1)};fn.extend(Mo);function $u(){let e=document.querySelectorAll("[data-time]");for(const t of e){let n=t.dataset.time,r=t.dataset.timeFormat;t.innerText=fn(n).format(r)}}function Cu(e,t){R(t).select(),document.execCommand("copy"),R(e.target).tooltip({title:"Copied!",trigger:"manual"}),R(e.target).tooltip("show"),setTimeout(function(){R(e.target).tooltip("hide")},1500)}function Du(e){let t=0,n,r,i;if(e.length===0)return t;for(n=0,i=e.length;nnew Promise((t,n)=>{const r=document.querySelector(`script[src='${e}']`);r&&r.remove();const i=document.createElement("script");document.body.appendChild(i),i.onload=t,i.onerror=n,i.async=!0,i.src=e});async function Mu(e,t){L._internal.challenge={};let n=L.config,r=await Zo(e);L._functions.challenge.displayChallenge&&L._functions.challenge.displayChallenge(r),ea(n.urlRoot+r.type_data.scripts.view).then(()=>{const o=L._internal.challenge;o.data=r,o.preRender(),L._functions.challenge.renderChallenge?L._functions.challenge.renderChallenge(o):t&&t(o),o.postRender()})}async function Iu(e,t,n=!1){if(L._functions.challenge.submitChallenge){L._functions.challenge.submitChallenge(e,t);return}let r="/api/v1/challenges/attempt";(n===!0||L.config.preview===!0)&&(r+="?preview=true");const o=await(await L.fetch(r,{method:"POST",body:JSON.stringify({challenge_id:e,submission:t})})).json();return L._functions.challenge.displaySubmissionResponse&&L._functions.challenge.displaySubmissionResponse(o),o}async function ta(e){return await(await L.fetch(`/api/v1/hints/${e}`,{method:"GET"})).json()}async function na(e){return await(await L.fetch("/api/v1/unlocks",{method:"POST",body:JSON.stringify({target:e,type:"hints"})})).json()}async function ra(e){let n=(await ta(e)).data;if(n.content){L._functions.challenge.displayHint(n);return}if(await ia(n)){let i=na(e);i.success?await ra(e):L._functions.challenge.displayUnlockError(i)}}async function ia(e){return L._functions.challenge.displayUnlock(e)}async function sa(e){return(await(await L.fetch(`/api/v1/challenges/${e}/solves`,{method:"GET"})).json()).data}async function Pu(e){let t=await sa(e);L._functions.challenge.displaySolves&&L._functions.challenge.displaySolves(t)}async function ku(){return(await(await L.fetch("/api/v1/scoreboard",{method:"GET"})).json()).data}async function Ru(e){return(await(await L.fetch(`/api/v1/scoreboard/top/${e}`,{method:"GET"})).json()).data}async function Hu(e){return await(await L.fetch("/api/v1/users/me",{method:"PATCH",body:JSON.stringify(e)})).json()}async function Bu(e){return await(await L.fetch("/api/v1/tokens",{method:"POST",body:JSON.stringify(e)})).json()}async function Vu(e){return await(await L.fetch(`/api/v1/tokens/${e}`,{method:"DELETE"})).json()}async function ju(e){return await(await L.fetch(`/api/v1/users/${e}/solves`,{method:"GET"})).json()}async function Fu(e){return await(await L.fetch(`/api/v1/users/${e}/fails`,{method:"GET"})).json()}async function Wu(e){return await(await L.fetch(`/api/v1/users/${e}/awards`,{method:"GET"})).json()}async function Uu(){return await(await L.fetch("/api/v1/teams/me/members",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}})).json()}async function Yu(){return await(await L.fetch("/api/v1/teams/me",{method:"DELETE"})).json()}async function Ku(e){return await(await L.fetch("/api/v1/teams/me",{method:"PATCH",body:JSON.stringify(e)})).json()}async function Gu(e){return await(await L.fetch(`/api/v1/teams/${e}/solves`,{method:"GET"})).json()}async function qu(e){return await(await L.fetch(`/api/v1/teams/${e}/fails`,{method:"GET"})).json()}async function zu(e){return await(await L.fetch(`/api/v1/teams/${e}/awards`,{method:"GET"})).json()}function Xu(e){const t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild}function oa(e){const t=document.createElement("div");return t.innerText=e,t.innerHTML}class Qu{constructor(){this.id=Math.random(),this.isMaster=!1,this.others={},window.addEventListener("storage",this),window.addEventListener("unload",this),this.broadcast("hello"),setTimeout(this.check.bind(this),500),this._checkInterval=setInterval(this.check.bind(this),9e3),this._pingInterval=setInterval(this.sendPing.bind(this),17e3)}destroy(){clearInterval(this._pingInterval),clearInterval(this._checkInterval),window.removeEventListener("storage",this),window.removeEventListener("unload",this),this.broadcast("bye")}handleEvent(t){if(t.type==="unload"){this.destroy();return}if(t.type==="broadcast")try{const n=JSON.parse(t.newValue);n.id!==this.id&&this[n.type](n)}catch(n){console.error(n)}}sendPing(){this.broadcast("ping")}hello(t){if(this.ping(t),t.id=0&&s<=1){if(c._volume=s,c._muted)return c;c.usingWebAudio&&c.masterGain.gain.setValueAtTime(s,n.ctx.currentTime);for(var u=0;u=0;c--)s._howls[c].unload();return s.usingWebAudio&&s.ctx&&typeof s.ctx.close<"u"&&(s.ctx.close(),s.ctx=null,g()),s},codecs:function(s){return(this||n)._codecs[s.replace(/^x-/,"")]},_setup:function(){var s=this||n;if(s.state=s.ctx&&s.ctx.state||"suspended",s._autoSuspend(),!s.usingWebAudio)if(typeof Audio<"u")try{var c=new Audio;typeof c.oncanplaythrough>"u"&&(s._canPlayEvent="canplay")}catch{s.noAudio=!0}else s.noAudio=!0;try{var c=new Audio;c.muted&&(s.noAudio=!0)}catch{}return s.noAudio||s._setupCodecs(),s},_setupCodecs:function(){var s=this||n,c=null;try{c=typeof Audio<"u"?new Audio:null}catch{return s}if(!c||typeof c.canPlayType!="function")return s;var u=c.canPlayType("audio/mpeg;").replace(/^no$/,""),h=s._navigator?s._navigator.userAgent:"",_=h.match(/OPR\/([0-6].)/g),p=_&&parseInt(_[0].split("/")[1],10)<33,m=h.indexOf("Safari")!==-1&&h.indexOf("Chrome")===-1,b=h.match(/Version\/(.*?) /),O=m&&b&&parseInt(b[1],10)<15;return s._codecs={mp3:!!(!p&&(u||c.canPlayType("audio/mp3;").replace(/^no$/,""))),mpeg:!!u,opus:!!c.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!c.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!c.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(c.canPlayType('audio/wav; codecs="1"')||c.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!c.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!c.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(c.canPlayType("audio/x-m4a;")||c.canPlayType("audio/m4a;")||c.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(c.canPlayType("audio/x-m4b;")||c.canPlayType("audio/m4b;")||c.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(c.canPlayType("audio/x-mp4;")||c.canPlayType("audio/mp4;")||c.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!(!O&&c.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!!(!O&&c.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!c.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(c.canPlayType("audio/x-flac;")||c.canPlayType("audio/flac;")).replace(/^no$/,"")},s},_unlockAudio:function(){var s=this||n;if(!(s._audioUnlocked||!s.ctx)){s._audioUnlocked=!1,s.autoUnlock=!1,!s._mobileUnloaded&&s.ctx.sampleRate!==44100&&(s._mobileUnloaded=!0,s.unload()),s._scratchBuffer=s.ctx.createBuffer(1,1,22050);var c=function(u){for(;s._html5AudioPool.length"u"?O.noteOn(0):O.start(0),typeof s.ctx.resume=="function"&&s.ctx.resume(),O.onended=function(){O.disconnect(0),s._audioUnlocked=!0,document.removeEventListener("touchstart",c,!0),document.removeEventListener("touchend",c,!0),document.removeEventListener("click",c,!0),document.removeEventListener("keydown",c,!0);for(var D=0;D"u"||!n.usingWebAudio)){for(var c=0;c"u"||!n.usingWebAudio))return s.state==="running"&&s.ctx.state!=="interrupted"&&s._suspendTimer?(clearTimeout(s._suspendTimer),s._suspendTimer=null):s.state==="suspended"||s.state==="running"&&s.ctx.state==="interrupted"?(s.ctx.resume().then(function(){s.state="running";for(var c=0;c"u"&&(s="__default",!u._playLock)){for(var _=0,p=0;p0?m._seek:u._sprite[s][0]/1e3),D=Math.max(0,(u._sprite[s][0]+u._sprite[s][1])/1e3-O),L=D*1e3/Math.abs(m._rate),I=u._sprite[s][0]/1e3,V=(u._sprite[s][0]+u._sprite[s][1])/1e3;m._sprite=s,m._ended=!1;var F=function(){m._paused=!1,m._seek=O,m._start=I,m._stop=V,m._loop=!!(m._loop||u._sprite[s][2])};if(O>=V){u._ended(m);return}var $=m._node;if(u._webAudio){var N=function(){u._playLock=!1,F(),u._refreshBuffer(m);var E=m._muted||u._muted?0:m._volume;$.gain.setValueAtTime(E,n.ctx.currentTime),m._playStart=n.ctx.currentTime,typeof $.bufferSource.start>"u"?m._loop?$.bufferSource.noteGrainOn(0,O,86400):$.bufferSource.noteGrainOn(0,O,D):m._loop?$.bufferSource.start(0,O,86400):$.bufferSource.start(0,O,D),L!==1/0&&(u._endTimers[m._id]=setTimeout(u._ended.bind(u,m),L)),c||setTimeout(function(){u._emit("play",m._id),u._loadQueue()},0)};n.state==="running"&&n.ctx.state!=="interrupted"?N():(u._playLock=!0,u.once("resume",N),u._clearTimer(m._id))}else{var U=function(){$.currentTime=O,$.muted=m._muted||u._muted||n._muted||$.muted,$.volume=m._volume*n.volume(),$.playbackRate=m._rate;try{var E=$.play();if(E&&typeof Promise<"u"&&(E instanceof Promise||typeof E.then=="function")?(u._playLock=!0,F(),E.then(function(){u._playLock=!1,$._unlocked=!0,c?u._loadQueue():u._emit("play",m._id)}).catch(function(){u._playLock=!1,u._emit("playerror",m._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),m._ended=!0,m._paused=!0})):c||(u._playLock=!1,F(),u._emit("play",m._id)),$.playbackRate=m._rate,$.paused){u._emit("playerror",m._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");return}s!=="__default"||m._loop?u._endTimers[m._id]=setTimeout(u._ended.bind(u,m),L):(u._endTimers[m._id]=function(){u._ended(m),$.removeEventListener("ended",u._endTimers[m._id],!1)},$.addEventListener("ended",u._endTimers[m._id],!1))}catch(v){u._emit("playerror",m._id,v)}};$.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&($.src=u._src,$.load());var X=window&&window.ejecta||!$.readyState&&n._navigator.isCocoonJS;if($.readyState>=3||X)U();else{u._playLock=!0,u._state="loading";var w=function(){u._state="loaded",U(),$.removeEventListener(n._canPlayEvent,w,!1)};$.addEventListener(n._canPlayEvent,w,!1),u._clearTimer(m._id)}}return m._id},pause:function(s){var c=this;if(c._state!=="loaded"||c._playLock)return c._queue.push({event:"pause",action:function(){c.pause(s)}}),c;for(var u=c._getSoundIds(s),h=0;h"u"?_._node.bufferSource.noteOff(0):_._node.bufferSource.stop(0),c._cleanBuffer(_._node)}else(!isNaN(_._node.duration)||_._node.duration===1/0)&&_._node.pause();arguments[1]||c._emit("pause",_?_._id:null)}return c},stop:function(s,c){var u=this;if(u._state!=="loaded"||u._playLock)return u._queue.push({event:"stop",action:function(){u.stop(s)}}),u;for(var h=u._getSoundIds(s),_=0;_"u"?p._node.bufferSource.noteOff(0):p._node.bufferSource.stop(0),u._cleanBuffer(p._node)):(!isNaN(p._node.duration)||p._node.duration===1/0)&&(p._node.currentTime=p._start||0,p._node.pause(),p._node.duration===1/0&&u._clearSound(p._node))),c||u._emit("stop",p._id))}return u},mute:function(s,c){var u=this;if(u._state!=="loaded"||u._playLock)return u._queue.push({event:"mute",action:function(){u.mute(s,c)}}),u;if(typeof c>"u")if(typeof s=="boolean")u._muted=s;else return u._muted;for(var h=u._getSoundIds(c),_=0;_"u"){var _=s._getSoundIds(),p=_.indexOf(c[0]);p>=0?h=parseInt(c[0],10):u=parseFloat(c[0])}else c.length>=2&&(u=parseFloat(c[0]),h=parseInt(c[1],10));var m;if(typeof u<"u"&&u>=0&&u<=1){if(s._state!=="loaded"||s._playLock)return s._queue.push({event:"volume",action:function(){s.volume.apply(s,c)}}),s;typeof h>"u"&&(s._volume=u),h=s._getSoundIds(h);for(var b=0;b"u")}}return _},_startFadeInterval:function(s,c,u,h,_,p){var m=this,b=c,O=u-c,D=Math.abs(O/.01),L=Math.max(4,D>0?h/D:h),I=Date.now();s._fadeTo=u,s._interval=setInterval(function(){var V=(Date.now()-I)/h;I=Date.now(),b+=O*V,b=Math.round(b*100)/100,O<0?b=Math.max(u,b):b=Math.min(u,b),m._webAudio?s._volume=b:m.volume(b,s._id,!0),p&&(m._volume=b),(uc&&b>=u)&&(clearInterval(s._interval),s._interval=null,s._fadeTo=null,m.volume(u,s._id),m._emit("fade",s._id))},L)},_stopFade:function(s){var c=this,u=c._soundById(s);return u&&u._interval&&(c._webAudio&&u._node.gain.cancelScheduledValues(n.ctx.currentTime),clearInterval(u._interval),u._interval=null,c.volume(u._fadeTo,s),u._fadeTo=null,c._emit("fade",s)),c},loop:function(){var s=this,c=arguments,u,h,_;if(c.length===0)return s._loop;if(c.length===1)if(typeof c[0]=="boolean")u=c[0],s._loop=u;else return _=s._soundById(parseInt(c[0],10)),_?_._loop:!1;else c.length===2&&(u=c[0],h=parseInt(c[1],10));for(var p=s._getSoundIds(h),m=0;m=0?h=parseInt(c[0],10):u=parseFloat(c[0])}else c.length===2&&(u=parseFloat(c[0]),h=parseInt(c[1],10));var m;if(typeof u=="number"){if(s._state!=="loaded"||s._playLock)return s._queue.push({event:"rate",action:function(){s.rate.apply(s,c)}}),s;typeof h>"u"&&(s._rate=u),h=s._getSoundIds(h);for(var b=0;b=0?h=parseInt(c[0],10):s._sounds.length&&(h=s._sounds[0]._id,u=parseFloat(c[0]))}else c.length===2&&(u=parseFloat(c[0]),h=parseInt(c[1],10));if(typeof h>"u")return 0;if(typeof u=="number"&&(s._state!=="loaded"||s._playLock))return s._queue.push({event:"seek",action:function(){s.seek.apply(s,c)}}),s;var m=s._soundById(h);if(m)if(typeof u=="number"&&u>=0){var b=s.playing(h);b&&s.pause(h,!0),m._seek=u,m._ended=!1,s._clearTimer(h),!s._webAudio&&m._node&&!isNaN(m._node.duration)&&(m._node.currentTime=u);var O=function(){b&&s.play(h,!0),s._emit("seek",h)};if(b&&!s._webAudio){var D=function(){s._playLock?setTimeout(D,0):O()};setTimeout(D,0)}else O()}else if(s._webAudio){var L=s.playing(h)?n.ctx.currentTime-m._playStart:0,I=m._rateSeek?m._rateSeek-m._seek:0;return m._seek+(I+L*Math.abs(m._rate))}else return m._node.currentTime;return s},playing:function(s){var c=this;if(typeof s=="number"){var u=c._soundById(s);return u?!u._paused:!1}for(var h=0;h=0&&n._howls.splice(h,1);var _=!0;for(u=0;u=0){_=!1;break}return o&&_&&delete o[s._src],n.noAudio=!1,s._state="unloaded",s._sounds=[],s=null,null},on:function(s,c,u,h){var _=this,p=_["_on"+s];return typeof c=="function"&&p.push(h?{id:u,fn:c,once:h}:{id:u,fn:c}),_},off:function(s,c,u){var h=this,_=h["_on"+s],p=0;if(typeof c=="number"&&(u=c,c=null),c||u)for(p=0;p<_.length;p++){var m=u===_[p].id;if(c===_[p].fn&&m||!c&&m){_.splice(p,1);break}}else if(s)h["_on"+s]=[];else{var b=Object.keys(h);for(p=0;p=0;p--)(!_[p].id||_[p].id===c||s==="load")&&(setTimeout(function(m){m.call(this,c,u)}.bind(h,_[p].fn),0),_[p].once&&h.off(s,_[p].fn,_[p].id));return h._loadQueue(s),h},_loadQueue:function(s){var c=this;if(c._queue.length>0){var u=c._queue[0];u.event===s&&(c._queue.shift(),c._loadQueue()),s||u.action()}return c},_ended:function(s){var c=this,u=s._sprite;if(!c._webAudio&&s._node&&!s._node.paused&&!s._node.ended&&s._node.currentTime=0;h--){if(u<=c)return;s._sounds[h]._ended&&(s._webAudio&&s._sounds[h]._node&&s._sounds[h]._node.disconnect(0),s._sounds.splice(h,1),u--)}}},_getSoundIds:function(s){var c=this;if(typeof s>"u"){for(var u=[],h=0;h=0;if(n._scratchBuffer&&s.bufferSource&&(s.bufferSource.onended=null,s.bufferSource.disconnect(0),u))try{s.bufferSource.buffer=n._scratchBuffer}catch{}return s.bufferSource=null,c},_clearSound:function(s){var c=/MSIE |Trident\//.test(n._navigator&&n._navigator.userAgent);c||(s.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var i=function(s){this._parent=s,this.init()};i.prototype={init:function(){var s=this,c=s._parent;return s._muted=c._muted,s._loop=c._loop,s._volume=c._volume,s._rate=c._rate,s._seek=0,s._paused=!0,s._ended=!0,s._sprite="__default",s._id=++n._counter,c._sounds.push(s),s.create(),s},create:function(){var s=this,c=s._parent,u=n._muted||s._muted||s._parent._muted?0:s._volume;return c._webAudio?(s._node=typeof n.ctx.createGain>"u"?n.ctx.createGainNode():n.ctx.createGain(),s._node.gain.setValueAtTime(u,n.ctx.currentTime),s._node.paused=!0,s._node.connect(n.masterGain)):n.noAudio||(s._node=n._obtainHtml5Audio(),s._errorFn=s._errorListener.bind(s),s._node.addEventListener("error",s._errorFn,!1),s._loadFn=s._loadListener.bind(s),s._node.addEventListener(n._canPlayEvent,s._loadFn,!1),s._endFn=s._endListener.bind(s),s._node.addEventListener("ended",s._endFn,!1),s._node.src=c._src,s._node.preload=c._preload===!0?"auto":c._preload,s._node.volume=u*n.volume(),s._node.load()),s},reset:function(){var s=this,c=s._parent;return s._muted=c._muted,s._loop=c._loop,s._volume=c._volume,s._rate=c._rate,s._seek=0,s._rateSeek=0,s._paused=!0,s._ended=!0,s._sprite="__default",s._id=++n._counter,s},_errorListener:function(){var s=this;s._parent._emit("loaderror",s._id,s._node.error?s._node.error.code:0),s._node.removeEventListener("error",s._errorFn,!1)},_loadListener:function(){var s=this,c=s._parent;c._duration=Math.ceil(s._node.duration*10)/10,Object.keys(c._sprite).length===0&&(c._sprite={__default:[0,c._duration*1e3]}),c._state!=="loaded"&&(c._state="loaded",c._emit("load"),c._loadQueue()),s._node.removeEventListener(n._canPlayEvent,s._loadFn,!1)},_endListener:function(){var s=this,c=s._parent;c._duration===1/0&&(c._duration=Math.ceil(s._node.duration*10)/10,c._sprite.__default[1]===1/0&&(c._sprite.__default[1]=c._duration*1e3),c._ended(s)),s._node.removeEventListener("ended",s._endFn,!1)}};var o={},a=function(s){var c=s._src;if(o[c]){s._duration=o[c].duration,d(s);return}if(/^data:[^;]+;base64,/.test(c)){for(var u=atob(c.split(",")[1]),h=new Uint8Array(u.length),_=0;_0?(o[c._src]=_,d(c,_)):u()};typeof Promise<"u"&&n.ctx.decodeAudioData.length===1?n.ctx.decodeAudioData(s).then(h).catch(u):n.ctx.decodeAudioData(s,h,u)},d=function(s,c){c&&!s._duration&&(s._duration=c.duration),Object.keys(s._sprite).length===0&&(s._sprite={__default:[0,s._duration*1e3]}),s._state!=="loaded"&&(s._state="loaded",s._emit("load"),s._loadQueue())},g=function(){if(!!n.usingWebAudio){try{typeof AudioContext<"u"?n.ctx=new AudioContext:typeof webkitAudioContext<"u"?n.ctx=new webkitAudioContext:n.usingWebAudio=!1}catch{n.usingWebAudio=!1}n.ctx||(n.usingWebAudio=!1);var s=/iP(hone|od|ad)/.test(n._navigator&&n._navigator.platform),c=n._navigator&&n._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),u=c?parseInt(c[1],10):null;if(s&&u&&u<9){var h=/safari/.test(n._navigator&&n._navigator.userAgent.toLowerCase());n._navigator&&!h&&(n.usingWebAudio=!1)}n.usingWebAudio&&(n.masterGain=typeof n.ctx.createGain>"u"?n.ctx.createGainNode():n.ctx.createGain(),n.masterGain.gain.setValueAtTime(n._muted?0:n._volume,n.ctx.currentTime),n.masterGain.connect(n.ctx.destination)),n._setup()}};e.Howler=n,e.Howl=r,typeof Te<"u"?(Te.HowlerGlobal=t,Te.Howler=n,Te.Howl=r,Te.Sound=i):typeof window<"u"&&(window.HowlerGlobal=t,window.Howler=n,window.Howl=r,window.Sound=i)})();/*! + */(function(e){(function(){var t=function(){this.init()};t.prototype={init:function(){var s=this||n;return s._counter=1e3,s._html5AudioPool=[],s.html5PoolSize=10,s._codecs={},s._howls=[],s._muted=!1,s._volume=1,s._canPlayEvent="canplaythrough",s._navigator=typeof window<"u"&&window.navigator?window.navigator:null,s.masterGain=null,s.noAudio=!1,s.usingWebAudio=!0,s.autoSuspend=!0,s.ctx=null,s.autoUnlock=!0,s._setup(),s},volume:function(s){var c=this||n;if(s=parseFloat(s),c.ctx||g(),typeof s<"u"&&s>=0&&s<=1){if(c._volume=s,c._muted)return c;c.usingWebAudio&&c.masterGain.gain.setValueAtTime(s,n.ctx.currentTime);for(var u=0;u=0;c--)s._howls[c].unload();return s.usingWebAudio&&s.ctx&&typeof s.ctx.close<"u"&&(s.ctx.close(),s.ctx=null,g()),s},codecs:function(s){return(this||n)._codecs[s.replace(/^x-/,"")]},_setup:function(){var s=this||n;if(s.state=s.ctx&&s.ctx.state||"suspended",s._autoSuspend(),!s.usingWebAudio)if(typeof Audio<"u")try{var c=new Audio;typeof c.oncanplaythrough>"u"&&(s._canPlayEvent="canplay")}catch{s.noAudio=!0}else s.noAudio=!0;try{var c=new Audio;c.muted&&(s.noAudio=!0)}catch{}return s.noAudio||s._setupCodecs(),s},_setupCodecs:function(){var s=this||n,c=null;try{c=typeof Audio<"u"?new Audio:null}catch{return s}if(!c||typeof c.canPlayType!="function")return s;var u=c.canPlayType("audio/mpeg;").replace(/^no$/,""),h=s._navigator?s._navigator.userAgent:"",_=h.match(/OPR\/([0-6].)/g),p=_&&parseInt(_[0].split("/")[1],10)<33,m=h.indexOf("Safari")!==-1&&h.indexOf("Chrome")===-1,b=h.match(/Version\/(.*?) /),O=m&&b&&parseInt(b[1],10)<15;return s._codecs={mp3:!!(!p&&(u||c.canPlayType("audio/mp3;").replace(/^no$/,""))),mpeg:!!u,opus:!!c.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!c.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!c.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(c.canPlayType('audio/wav; codecs="1"')||c.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!c.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!c.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(c.canPlayType("audio/x-m4a;")||c.canPlayType("audio/m4a;")||c.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(c.canPlayType("audio/x-m4b;")||c.canPlayType("audio/m4b;")||c.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(c.canPlayType("audio/x-mp4;")||c.canPlayType("audio/mp4;")||c.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!(!O&&c.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!!(!O&&c.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!c.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(c.canPlayType("audio/x-flac;")||c.canPlayType("audio/flac;")).replace(/^no$/,"")},s},_unlockAudio:function(){var s=this||n;if(!(s._audioUnlocked||!s.ctx)){s._audioUnlocked=!1,s.autoUnlock=!1,!s._mobileUnloaded&&s.ctx.sampleRate!==44100&&(s._mobileUnloaded=!0,s.unload()),s._scratchBuffer=s.ctx.createBuffer(1,1,22050);var c=function(u){for(;s._html5AudioPool.length"u"?O.noteOn(0):O.start(0),typeof s.ctx.resume=="function"&&s.ctx.resume(),O.onended=function(){O.disconnect(0),s._audioUnlocked=!0,document.removeEventListener("touchstart",c,!0),document.removeEventListener("touchend",c,!0),document.removeEventListener("click",c,!0),document.removeEventListener("keydown",c,!0);for(var D=0;D"u"||!n.usingWebAudio)){for(var c=0;c"u"||!n.usingWebAudio))return s.state==="running"&&s.ctx.state!=="interrupted"&&s._suspendTimer?(clearTimeout(s._suspendTimer),s._suspendTimer=null):s.state==="suspended"||s.state==="running"&&s.ctx.state==="interrupted"?(s.ctx.resume().then(function(){s.state="running";for(var c=0;c"u"&&(s="__default",!u._playLock)){for(var _=0,p=0;p0?m._seek:u._sprite[s][0]/1e3),D=Math.max(0,(u._sprite[s][0]+u._sprite[s][1])/1e3-O),M=D*1e3/Math.abs(m._rate),I=u._sprite[s][0]/1e3,V=(u._sprite[s][0]+u._sprite[s][1])/1e3;m._sprite=s,m._ended=!1;var F=function(){m._paused=!1,m._seek=O,m._start=I,m._stop=V,m._loop=!!(m._loop||u._sprite[s][2])};if(O>=V){u._ended(m);return}var $=m._node;if(u._webAudio){var N=function(){u._playLock=!1,F(),u._refreshBuffer(m);var E=m._muted||u._muted?0:m._volume;$.gain.setValueAtTime(E,n.ctx.currentTime),m._playStart=n.ctx.currentTime,typeof $.bufferSource.start>"u"?m._loop?$.bufferSource.noteGrainOn(0,O,86400):$.bufferSource.noteGrainOn(0,O,D):m._loop?$.bufferSource.start(0,O,86400):$.bufferSource.start(0,O,D),M!==1/0&&(u._endTimers[m._id]=setTimeout(u._ended.bind(u,m),M)),c||setTimeout(function(){u._emit("play",m._id),u._loadQueue()},0)};n.state==="running"&&n.ctx.state!=="interrupted"?N():(u._playLock=!0,u.once("resume",N),u._clearTimer(m._id))}else{var U=function(){$.currentTime=O,$.muted=m._muted||u._muted||n._muted||$.muted,$.volume=m._volume*n.volume(),$.playbackRate=m._rate;try{var E=$.play();if(E&&typeof Promise<"u"&&(E instanceof Promise||typeof E.then=="function")?(u._playLock=!0,F(),E.then(function(){u._playLock=!1,$._unlocked=!0,c?u._loadQueue():u._emit("play",m._id)}).catch(function(){u._playLock=!1,u._emit("playerror",m._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),m._ended=!0,m._paused=!0})):c||(u._playLock=!1,F(),u._emit("play",m._id)),$.playbackRate=m._rate,$.paused){u._emit("playerror",m._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");return}s!=="__default"||m._loop?u._endTimers[m._id]=setTimeout(u._ended.bind(u,m),M):(u._endTimers[m._id]=function(){u._ended(m),$.removeEventListener("ended",u._endTimers[m._id],!1)},$.addEventListener("ended",u._endTimers[m._id],!1))}catch(v){u._emit("playerror",m._id,v)}};$.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&($.src=u._src,$.load());var Q=window&&window.ejecta||!$.readyState&&n._navigator.isCocoonJS;if($.readyState>=3||Q)U();else{u._playLock=!0,u._state="loading";var w=function(){u._state="loaded",U(),$.removeEventListener(n._canPlayEvent,w,!1)};$.addEventListener(n._canPlayEvent,w,!1),u._clearTimer(m._id)}}return m._id},pause:function(s){var c=this;if(c._state!=="loaded"||c._playLock)return c._queue.push({event:"pause",action:function(){c.pause(s)}}),c;for(var u=c._getSoundIds(s),h=0;h"u"?_._node.bufferSource.noteOff(0):_._node.bufferSource.stop(0),c._cleanBuffer(_._node)}else(!isNaN(_._node.duration)||_._node.duration===1/0)&&_._node.pause();arguments[1]||c._emit("pause",_?_._id:null)}return c},stop:function(s,c){var u=this;if(u._state!=="loaded"||u._playLock)return u._queue.push({event:"stop",action:function(){u.stop(s)}}),u;for(var h=u._getSoundIds(s),_=0;_"u"?p._node.bufferSource.noteOff(0):p._node.bufferSource.stop(0),u._cleanBuffer(p._node)):(!isNaN(p._node.duration)||p._node.duration===1/0)&&(p._node.currentTime=p._start||0,p._node.pause(),p._node.duration===1/0&&u._clearSound(p._node))),c||u._emit("stop",p._id))}return u},mute:function(s,c){var u=this;if(u._state!=="loaded"||u._playLock)return u._queue.push({event:"mute",action:function(){u.mute(s,c)}}),u;if(typeof c>"u")if(typeof s=="boolean")u._muted=s;else return u._muted;for(var h=u._getSoundIds(c),_=0;_"u"){var _=s._getSoundIds(),p=_.indexOf(c[0]);p>=0?h=parseInt(c[0],10):u=parseFloat(c[0])}else c.length>=2&&(u=parseFloat(c[0]),h=parseInt(c[1],10));var m;if(typeof u<"u"&&u>=0&&u<=1){if(s._state!=="loaded"||s._playLock)return s._queue.push({event:"volume",action:function(){s.volume.apply(s,c)}}),s;typeof h>"u"&&(s._volume=u),h=s._getSoundIds(h);for(var b=0;b"u")}}return _},_startFadeInterval:function(s,c,u,h,_,p){var m=this,b=c,O=u-c,D=Math.abs(O/.01),M=Math.max(4,D>0?h/D:h),I=Date.now();s._fadeTo=u,s._interval=setInterval(function(){var V=(Date.now()-I)/h;I=Date.now(),b+=O*V,b=Math.round(b*100)/100,O<0?b=Math.max(u,b):b=Math.min(u,b),m._webAudio?s._volume=b:m.volume(b,s._id,!0),p&&(m._volume=b),(uc&&b>=u)&&(clearInterval(s._interval),s._interval=null,s._fadeTo=null,m.volume(u,s._id),m._emit("fade",s._id))},M)},_stopFade:function(s){var c=this,u=c._soundById(s);return u&&u._interval&&(c._webAudio&&u._node.gain.cancelScheduledValues(n.ctx.currentTime),clearInterval(u._interval),u._interval=null,c.volume(u._fadeTo,s),u._fadeTo=null,c._emit("fade",s)),c},loop:function(){var s=this,c=arguments,u,h,_;if(c.length===0)return s._loop;if(c.length===1)if(typeof c[0]=="boolean")u=c[0],s._loop=u;else return _=s._soundById(parseInt(c[0],10)),_?_._loop:!1;else c.length===2&&(u=c[0],h=parseInt(c[1],10));for(var p=s._getSoundIds(h),m=0;m=0?h=parseInt(c[0],10):u=parseFloat(c[0])}else c.length===2&&(u=parseFloat(c[0]),h=parseInt(c[1],10));var m;if(typeof u=="number"){if(s._state!=="loaded"||s._playLock)return s._queue.push({event:"rate",action:function(){s.rate.apply(s,c)}}),s;typeof h>"u"&&(s._rate=u),h=s._getSoundIds(h);for(var b=0;b=0?h=parseInt(c[0],10):s._sounds.length&&(h=s._sounds[0]._id,u=parseFloat(c[0]))}else c.length===2&&(u=parseFloat(c[0]),h=parseInt(c[1],10));if(typeof h>"u")return 0;if(typeof u=="number"&&(s._state!=="loaded"||s._playLock))return s._queue.push({event:"seek",action:function(){s.seek.apply(s,c)}}),s;var m=s._soundById(h);if(m)if(typeof u=="number"&&u>=0){var b=s.playing(h);b&&s.pause(h,!0),m._seek=u,m._ended=!1,s._clearTimer(h),!s._webAudio&&m._node&&!isNaN(m._node.duration)&&(m._node.currentTime=u);var O=function(){b&&s.play(h,!0),s._emit("seek",h)};if(b&&!s._webAudio){var D=function(){s._playLock?setTimeout(D,0):O()};setTimeout(D,0)}else O()}else if(s._webAudio){var M=s.playing(h)?n.ctx.currentTime-m._playStart:0,I=m._rateSeek?m._rateSeek-m._seek:0;return m._seek+(I+M*Math.abs(m._rate))}else return m._node.currentTime;return s},playing:function(s){var c=this;if(typeof s=="number"){var u=c._soundById(s);return u?!u._paused:!1}for(var h=0;h=0&&n._howls.splice(h,1);var _=!0;for(u=0;u=0){_=!1;break}return o&&_&&delete o[s._src],n.noAudio=!1,s._state="unloaded",s._sounds=[],s=null,null},on:function(s,c,u,h){var _=this,p=_["_on"+s];return typeof c=="function"&&p.push(h?{id:u,fn:c,once:h}:{id:u,fn:c}),_},off:function(s,c,u){var h=this,_=h["_on"+s],p=0;if(typeof c=="number"&&(u=c,c=null),c||u)for(p=0;p<_.length;p++){var m=u===_[p].id;if(c===_[p].fn&&m||!c&&m){_.splice(p,1);break}}else if(s)h["_on"+s]=[];else{var b=Object.keys(h);for(p=0;p=0;p--)(!_[p].id||_[p].id===c||s==="load")&&(setTimeout(function(m){m.call(this,c,u)}.bind(h,_[p].fn),0),_[p].once&&h.off(s,_[p].fn,_[p].id));return h._loadQueue(s),h},_loadQueue:function(s){var c=this;if(c._queue.length>0){var u=c._queue[0];u.event===s&&(c._queue.shift(),c._loadQueue()),s||u.action()}return c},_ended:function(s){var c=this,u=s._sprite;if(!c._webAudio&&s._node&&!s._node.paused&&!s._node.ended&&s._node.currentTime=0;h--){if(u<=c)return;s._sounds[h]._ended&&(s._webAudio&&s._sounds[h]._node&&s._sounds[h]._node.disconnect(0),s._sounds.splice(h,1),u--)}}},_getSoundIds:function(s){var c=this;if(typeof s>"u"){for(var u=[],h=0;h=0;if(n._scratchBuffer&&s.bufferSource&&(s.bufferSource.onended=null,s.bufferSource.disconnect(0),u))try{s.bufferSource.buffer=n._scratchBuffer}catch{}return s.bufferSource=null,c},_clearSound:function(s){var c=/MSIE |Trident\//.test(n._navigator&&n._navigator.userAgent);c||(s.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var i=function(s){this._parent=s,this.init()};i.prototype={init:function(){var s=this,c=s._parent;return s._muted=c._muted,s._loop=c._loop,s._volume=c._volume,s._rate=c._rate,s._seek=0,s._paused=!0,s._ended=!0,s._sprite="__default",s._id=++n._counter,c._sounds.push(s),s.create(),s},create:function(){var s=this,c=s._parent,u=n._muted||s._muted||s._parent._muted?0:s._volume;return c._webAudio?(s._node=typeof n.ctx.createGain>"u"?n.ctx.createGainNode():n.ctx.createGain(),s._node.gain.setValueAtTime(u,n.ctx.currentTime),s._node.paused=!0,s._node.connect(n.masterGain)):n.noAudio||(s._node=n._obtainHtml5Audio(),s._errorFn=s._errorListener.bind(s),s._node.addEventListener("error",s._errorFn,!1),s._loadFn=s._loadListener.bind(s),s._node.addEventListener(n._canPlayEvent,s._loadFn,!1),s._endFn=s._endListener.bind(s),s._node.addEventListener("ended",s._endFn,!1),s._node.src=c._src,s._node.preload=c._preload===!0?"auto":c._preload,s._node.volume=u*n.volume(),s._node.load()),s},reset:function(){var s=this,c=s._parent;return s._muted=c._muted,s._loop=c._loop,s._volume=c._volume,s._rate=c._rate,s._seek=0,s._rateSeek=0,s._paused=!0,s._ended=!0,s._sprite="__default",s._id=++n._counter,s},_errorListener:function(){var s=this;s._parent._emit("loaderror",s._id,s._node.error?s._node.error.code:0),s._node.removeEventListener("error",s._errorFn,!1)},_loadListener:function(){var s=this,c=s._parent;c._duration=Math.ceil(s._node.duration*10)/10,Object.keys(c._sprite).length===0&&(c._sprite={__default:[0,c._duration*1e3]}),c._state!=="loaded"&&(c._state="loaded",c._emit("load"),c._loadQueue()),s._node.removeEventListener(n._canPlayEvent,s._loadFn,!1)},_endListener:function(){var s=this,c=s._parent;c._duration===1/0&&(c._duration=Math.ceil(s._node.duration*10)/10,c._sprite.__default[1]===1/0&&(c._sprite.__default[1]=c._duration*1e3),c._ended(s)),s._node.removeEventListener("ended",s._endFn,!1)}};var o={},a=function(s){var c=s._src;if(o[c]){s._duration=o[c].duration,d(s);return}if(/^data:[^;]+;base64,/.test(c)){for(var u=atob(c.split(",")[1]),h=new Uint8Array(u.length),_=0;_0?(o[c._src]=_,d(c,_)):u()};typeof Promise<"u"&&n.ctx.decodeAudioData.length===1?n.ctx.decodeAudioData(s).then(h).catch(u):n.ctx.decodeAudioData(s,h,u)},d=function(s,c){c&&!s._duration&&(s._duration=c.duration),Object.keys(s._sprite).length===0&&(s._sprite={__default:[0,s._duration*1e3]}),s._state!=="loaded"&&(s._state="loaded",s._emit("load"),s._loadQueue())},g=function(){if(!!n.usingWebAudio){try{typeof AudioContext<"u"?n.ctx=new AudioContext:typeof webkitAudioContext<"u"?n.ctx=new webkitAudioContext:n.usingWebAudio=!1}catch{n.usingWebAudio=!1}n.ctx||(n.usingWebAudio=!1);var s=/iP(hone|od|ad)/.test(n._navigator&&n._navigator.platform),c=n._navigator&&n._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),u=c?parseInt(c[1],10):null;if(s&&u&&u<9){var h=/safari/.test(n._navigator&&n._navigator.userAgent.toLowerCase());n._navigator&&!h&&(n.usingWebAudio=!1)}n.usingWebAudio&&(n.masterGain=typeof n.ctx.createGain>"u"?n.ctx.createGainNode():n.ctx.createGain(),n.masterGain.gain.setValueAtTime(n._muted?0:n._volume,n.ctx.currentTime),n.masterGain.connect(n.ctx.destination)),n._setup()}};e.Howler=n,e.Howl=r,typeof Te<"u"?(Te.HowlerGlobal=t,Te.Howler=n,Te.Howl=r,Te.Sound=i):typeof window<"u"&&(window.HowlerGlobal=t,window.Howler=n,window.Howl=r,window.Sound=i)})();/*! * Spatial Plugin - Adds support for stereo and 3D audio where Web Audio is supported. * * howler.js v2.2.3 @@ -18,9 +18,9 @@ var ae=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof ae<"u"&& * goldfirestudios.com * * MIT License - */(function(){HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(n){var r=this;if(!r.ctx||!r.ctx.listener)return r;for(var i=r._howls.length-1;i>=0;i--)r._howls[i].stereo(n);return r},HowlerGlobal.prototype.pos=function(n,r,i){var o=this;if(!o.ctx||!o.ctx.listener)return o;if(r=typeof r!="number"?o._pos[1]:r,i=typeof i!="number"?o._pos[2]:i,typeof n=="number")o._pos=[n,r,i],typeof o.ctx.listener.positionX<"u"?(o.ctx.listener.positionX.setTargetAtTime(o._pos[0],Howler.ctx.currentTime,.1),o.ctx.listener.positionY.setTargetAtTime(o._pos[1],Howler.ctx.currentTime,.1),o.ctx.listener.positionZ.setTargetAtTime(o._pos[2],Howler.ctx.currentTime,.1)):o.ctx.listener.setPosition(o._pos[0],o._pos[1],o._pos[2]);else return o._pos;return o},HowlerGlobal.prototype.orientation=function(n,r,i,o,a,l){var f=this;if(!f.ctx||!f.ctx.listener)return f;var d=f._orientation;if(r=typeof r!="number"?d[1]:r,i=typeof i!="number"?d[2]:i,o=typeof o!="number"?d[3]:o,a=typeof a!="number"?d[4]:a,l=typeof l!="number"?d[5]:l,typeof n=="number")f._orientation=[n,r,i,o,a,l],typeof f.ctx.listener.forwardX<"u"?(f.ctx.listener.forwardX.setTargetAtTime(n,Howler.ctx.currentTime,.1),f.ctx.listener.forwardY.setTargetAtTime(r,Howler.ctx.currentTime,.1),f.ctx.listener.forwardZ.setTargetAtTime(i,Howler.ctx.currentTime,.1),f.ctx.listener.upX.setTargetAtTime(o,Howler.ctx.currentTime,.1),f.ctx.listener.upY.setTargetAtTime(a,Howler.ctx.currentTime,.1),f.ctx.listener.upZ.setTargetAtTime(l,Howler.ctx.currentTime,.1)):f.ctx.listener.setOrientation(n,r,i,o,a,l);else return d;return f},Howl.prototype.init=function(n){return function(r){var i=this;return i._orientation=r.orientation||[1,0,0],i._stereo=r.stereo||null,i._pos=r.pos||null,i._pannerAttr={coneInnerAngle:typeof r.coneInnerAngle<"u"?r.coneInnerAngle:360,coneOuterAngle:typeof r.coneOuterAngle<"u"?r.coneOuterAngle:360,coneOuterGain:typeof r.coneOuterGain<"u"?r.coneOuterGain:0,distanceModel:typeof r.distanceModel<"u"?r.distanceModel:"inverse",maxDistance:typeof r.maxDistance<"u"?r.maxDistance:1e4,panningModel:typeof r.panningModel<"u"?r.panningModel:"HRTF",refDistance:typeof r.refDistance<"u"?r.refDistance:1,rolloffFactor:typeof r.rolloffFactor<"u"?r.rolloffFactor:1},i._onstereo=r.onstereo?[{fn:r.onstereo}]:[],i._onpos=r.onpos?[{fn:r.onpos}]:[],i._onorientation=r.onorientation?[{fn:r.onorientation}]:[],n.call(this,r)}}(Howl.prototype.init),Howl.prototype.stereo=function(n,r){var i=this;if(!i._webAudio)return i;if(i._state!=="loaded")return i._queue.push({event:"stereo",action:function(){i.stereo(n,r)}}),i;var o=typeof Howler.ctx.createStereoPanner>"u"?"spatial":"stereo";if(typeof r>"u")if(typeof n=="number")i._stereo=n,i._pos=[n,0,0];else return i._stereo;for(var a=i._getSoundIds(r),l=0;l"u")if(typeof n=="number")a._pos=[n,r,i];else return a._pos;for(var l=a._getSoundIds(o),f=0;f"u")if(typeof n=="number")a._orientation=[n,r,i];else return a._orientation;for(var l=a._getSoundIds(o),f=0;f"u"&&(i.pannerAttr||(i.pannerAttr={coneInnerAngle:i.coneInnerAngle,coneOuterAngle:i.coneOuterAngle,coneOuterGain:i.coneOuterGain,distanceModel:i.distanceModel,maxDistance:i.maxDistance,refDistance:i.refDistance,rolloffFactor:i.rolloffFactor,panningModel:i.panningModel}),n._pannerAttr={coneInnerAngle:typeof i.pannerAttr.coneInnerAngle<"u"?i.pannerAttr.coneInnerAngle:n._coneInnerAngle,coneOuterAngle:typeof i.pannerAttr.coneOuterAngle<"u"?i.pannerAttr.coneOuterAngle:n._coneOuterAngle,coneOuterGain:typeof i.pannerAttr.coneOuterGain<"u"?i.pannerAttr.coneOuterGain:n._coneOuterGain,distanceModel:typeof i.pannerAttr.distanceModel<"u"?i.pannerAttr.distanceModel:n._distanceModel,maxDistance:typeof i.pannerAttr.maxDistance<"u"?i.pannerAttr.maxDistance:n._maxDistance,refDistance:typeof i.pannerAttr.refDistance<"u"?i.pannerAttr.refDistance:n._refDistance,rolloffFactor:typeof i.pannerAttr.rolloffFactor<"u"?i.pannerAttr.rolloffFactor:n._rolloffFactor,panningModel:typeof i.pannerAttr.panningModel<"u"?i.pannerAttr.panningModel:n._panningModel});else return a=n._soundById(parseInt(r[0],10)),a?a._pannerAttr:n._pannerAttr;else r.length===2&&(i=r[0],o=parseInt(r[1],10));for(var l=n._getSoundIds(o),f=0;fJSON.parse(localStorage.getItem(`CTFd:${e}`))||t,la=(e,t)=>{localStorage.setItem(`CTFd:${e}`,JSON.stringify(t))};function qn(){return ca("read_notifications")}function zn(){return ca("unread_notifications")}function Ei(e){la("read_notifications",e)}function Xn(e){la("unread_notifications",e)}function Ju(e){const t=[...qn(),e];return Ei(t),ua(e),t}function Zu(e){const t=[...zn(),e];return Xn(t),t}function ys(){const e=qn();return e.length===0?0:Math.max(...e)}function ua(e){const n=zn().filter(r=>r!==e);Xn(n)}function ef(){const e=zn(),t=qn();Ei(t.concat(e)),Xn([])}const q={init:(e,t)=>{q.source=new EventSource(e+"/events");for(let r=0;r{let i=r.headers.get("result-count");i&&(q.controller.broadcast("counter",{count:i}),M._functions.events.eventCount(i))})},controller:new Qu,source:null,howl:null,connect:()=>{q.source.addEventListener("notification",function(e){let t=JSON.parse(e.data);q.controller.broadcast("notification",t),M.events.counter.unread.add(t.id);let n=M.events.counter.unread.getAll().length;q.controller.broadcast("counter",{count:n}),M._functions.events.eventCount(n),q.render(t),t.sound&&q.howl.play()},!1)},disconnect:()=>{q.source&&q.source.close()},render:e=>{switch(e.type){case"toast":{M._functions.events.eventToast(e);break}case"alert":{M._functions.events.eventAlert(e);break}case"background":{M._functions.events.eventBackground(e);break}default:{console.log(e),alert(e);break}}},counter:{read:{getAll:qn,setAll:Ei,add:Ju,getLast:ys},unread:{getAll:zn,setAll:Xn,add:Zu,remove:ua,readAll:ef}}};q.controller.alert=function(e){q.render(e)};q.controller.toast=function(e){q.render(e)};q.controller.background=function(e){q.render(e)};q.controller.counter=function(e){M._functions.events.eventCount(e.count)};q.controller.masterDidChange=function(){this.isMaster?q.connect():q.disconnect()};var fa={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Te,function(){return function(n,r,i){n=n||{};var o=r.prototype,a={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function l(d,g,s,c){return o.fromToBase(d,g,s,c)}i.en.relativeTime=a,o.fromToBase=function(d,g,s,c,u){for(var h,_,p,m=s.$locale().relativeTime||a,b=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],O=b.length,D=0;D0,I<=L.r||!L.r){I<=1&&D>0&&(L=b[D-1]);var V=m[L.l];u&&(I=u(""+I)),_=typeof V=="string"?V.replace("%d",I):V(I,g,L.l,p);break}}if(g)return _;var F=p?m.future:m.past;return typeof F=="function"?F(_):F.replace("%s",_)},o.to=function(d,g){return l(d,g,this,!0)},o.from=function(d,g){return l(d,g,this)};var f=function(d){return d.$u?i.utc():i()};o.toNow=function(d){return this.to(f(this),d)},o.fromNow=function(d){return this.from(f(this),d)}}})})(fa);const tf=fa.exports;fn.extend(Mo);fn.extend(tf);const Ot={id:null,name:null,email:null},Dn={id:null,name:null},nf={},rf={challenge:{displayChallenge:null,renderChallenge:null,displayHint(e){alert(e.content)},displayUnlock(e){return confirm("Are you sure you'd like to unlock this hint?")},displayUnlockError(e){const t=[];Object.keys(e.errors).map(r=>{t.push(e.errors[r])});const n=t.join(` -`);alert(n)},submitChallenge:null,displaySubmissionResponse:null,displaySolves:null},challenges:{displayChallenges:null,sortChallenges:null},events:{eventAlert:null,eventToast:null,eventBackground:null,eventRead:null,eventCount:null}},sf={htmlEntities:oa,colorHash:Nu,copyToClipboard:Cu,hashCode:Du,renderTimes:$u},of={ajax:{getScript:ea},html:{createHtmlNode:Xu,htmlEntities:oa}},af={challenge:{displayChallenge:Mu,submitChallenge:Iu,loadSolves:sa,displaySolves:Pu,loadHint:ta,loadUnlock:na,displayUnlock:ia,displayHint:ra},challenges:{getChallenges:Jo,getChallenge:Zo,displayChallenges:Lu},scoreboard:{getScoreboard:ku,getScoreboardDetail:Ru},settings:{updateSettings:Hu,generateToken:Bu,deleteToken:Vu},users:{userSolves:ju,userFails:Fu,userAwards:Wu},teams:{getInviteToken:Uu,disbandTeam:Yu,updateTeamSettings:Ku,teamSolves:Gu,teamFails:qu,teamAwards:zu}},cf={$:R,dayjs:fn};let Es=!1;const lf=e=>{Es||(Es=!0,J.urlRoot=e.urlRoot||J.urlRoot,J.csrfNonce=e.csrfNonce||J.csrfNonce,J.userMode=e.userMode||J.userMode,J.start=e.start||J.start,J.end=e.end||J.end,J.themeSettings=e.themeSettings||J.themeSettings,J.eventSounds=e.eventSounds||J.eventSounds,Ot.id=e.userId,Ot.name=e.userName||Ot.name,Ot.email=e.userEmail||Ot.email,Dn.id=e.teamId,Dn.name=e.teamName||Dn.name,q.init(J.urlRoot,J.eventSounds))},uf={run(e){e(bi)}},bi={init:lf,config:J,fetch:Vl,user:Ot,team:Dn,ui:sf,utils:of,pages:af,events:q,_internal:nf,_functions:rf,plugin:uf,lib:cf};window.CTFd=bi;const M=bi;var da={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Te,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",a="second",l="minute",f="hour",d="day",g="week",s="month",c="quarter",u="year",h="date",_="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},O=function(w,E,v){var A=String(w);return!A||A.length>=E?w:""+Array(E+1-A.length).join(v)+w},D={s:O,z:function(w){var E=-w.utcOffset(),v=Math.abs(E),A=Math.floor(v/60),y=v%60;return(E<=0?"+":"-")+O(A,2,"0")+":"+O(y,2,"0")},m:function w(E,v){if(E.date()1)return w(S[0])}else{var P=E.name;I[P]=E,y=P}return!A&&y&&(L=y),y||!A&&L},$=function(w,E){if(V(w))return w.clone();var v=typeof E=="object"?E:{};return v.date=w,v.args=arguments,new U(v)},N=D;N.l=F,N.i=V,N.w=function(w,E){return $(w,{locale:E.$L,utc:E.$u,x:E.$x,$offset:E.$offset})};var U=function(){function w(v){this.$L=F(v.locale,null,!0),this.parse(v)}var E=w.prototype;return E.parse=function(v){this.$d=function(A){var y=A.date,x=A.utc;if(y===null)return new Date(NaN);if(N.u(y))return new Date;if(y instanceof Date)return new Date(y);if(typeof y=="string"&&!/Z$/i.test(y)){var S=y.match(p);if(S){var P=S[2]-1||0,B=(S[7]||"0").substring(0,3);return x?new Date(Date.UTC(S[1],P,S[3]||1,S[4]||0,S[5]||0,S[6]||0,B)):new Date(S[1],P,S[3]||1,S[4]||0,S[5]||0,S[6]||0,B)}}return new Date(y)}(v),this.$x=v.x||{},this.init()},E.init=function(){var v=this.$d;this.$y=v.getFullYear(),this.$M=v.getMonth(),this.$D=v.getDate(),this.$W=v.getDay(),this.$H=v.getHours(),this.$m=v.getMinutes(),this.$s=v.getSeconds(),this.$ms=v.getMilliseconds()},E.$utils=function(){return N},E.isValid=function(){return this.$d.toString()!==_},E.isSame=function(v,A){var y=$(v);return this.startOf(A)<=y&&y<=this.endOf(A)},E.isAfter=function(v,A){return $(v){document.querySelectorAll("[data-time]").forEach(e=>{const t=e.getAttribute("data-time"),n=e.getAttribute("data-time-format")||"MMMM Do, h:mm:ss A";e.innerText=wi(t).format(n)})},df=()=>{document.querySelectorAll(".form-control").forEach(e=>{e.addEventListener("onfocus",()=>{e.classList.remove("input-filled-invalid"),e.classList.add("input-filled-valid")}),e.addEventListener("onblur",()=>{e.nodeValue===""&&(e.classList.remove("input-filled-valid"),e.classList.remove("input-filled-invalid"))}),e.nodeValue&&e.classList.add("input-filled-valid")}),document.querySelectorAll(".page-select").forEach(e=>{if(e.nodeValue){const t=new URL(window.location);t.searchParams.set("page",e.nodeValue),window.location.href=t.toString()}})};var _a={exports:{}};/*! lolight v1.4.0 - https://larsjung.de/lolight/ */(function(e,t){(function(n,r){e.exports=r()})(Te,function(){function n(c){if(typeof c!="string")throw new Error("tok: no string");for(var u=[],h=s.length,_=!1;c;)for(var p=0;p/],["rex",/\/(\\\/|[^\n])*?\//],["str",/(['"`])(\\\1|[\s\S])*?\1/],[g,/[+-]?([0-9]*\.?[0-9]+|[0-9]+\.?[0-9]*)([eE][+-]?[0-9]+)?/],["pct",/[\\.,:;+\-*\/=<>()[\]{}|?!&@~]/],["spc",/\s+/],[d,/[\w$]+/],["unk",/./]];return r(!1,function(c){var u=c.querySelector("head"),h=c.createElement("style");h.textContent=a,u.insertBefore(h,u.firstChild),/^(i|c|loade)/.test(c.readyState)?o():c.addEventListener("DOMContentLoaded",function(){o()})}),o.tok=n,o.el=i,o})})(_a);const hf=_a.exports,pf=()=>{(!M.config.themeSettings.hasOwnProperty("use_builtin_code_highlighter")||M.config.themeSettings.use_builtin_code_highlighter===!0)&&hf("pre code")};var ce="top",_e="bottom",me="right",le="left",Qn="auto",jt=[ce,_e,me,le],pt="start",Lt="end",ma="clippingParents",Ai="viewport",xt="popper",ga="reference",Rr=jt.reduce(function(e,t){return e.concat([t+"-"+pt,t+"-"+Lt])},[]),Ti=[].concat(jt,[Qn]).reduce(function(e,t){return e.concat([t,t+"-"+pt,t+"-"+Lt])},[]),va="beforeRead",ya="read",Ea="afterRead",ba="beforeMain",wa="main",Aa="afterMain",Ta="beforeWrite",Sa="write",Oa="afterWrite",xa=[va,ya,Ea,ba,wa,Aa,Ta,Sa,Oa];function Ie(e){return e?(e.nodeName||"").toLowerCase():null}function Oe(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Mt(e){var t=Oe(e).Element;return e instanceof t||e instanceof Element}function ye(e){var t=Oe(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Si(e){if(typeof ShadowRoot>"u")return!1;var t=Oe(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function _f(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!ye(o)||!Ie(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var l=i[a];l===!1?o.removeAttribute(a):o.setAttribute(a,l===!0?"":l)}))})}function mf(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],o=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),l=a.reduce(function(f,d){return f[d]="",f},{});!ye(i)||!Ie(i)||(Object.assign(i.style,l),Object.keys(o).forEach(function(f){i.removeAttribute(f)}))})}}const Oi={name:"applyStyles",enabled:!0,phase:"write",fn:_f,effect:mf,requires:["computeStyles"]};function Le(e){return e.split("-")[0]}var at=Math.max,Rn=Math.min,It=Math.round;function Pt(e,t){t===void 0&&(t=!1);var n=e.getBoundingClientRect(),r=1,i=1;if(ye(e)&&t){var o=e.offsetHeight,a=e.offsetWidth;a>0&&(r=It(n.width)/a||1),o>0&&(i=It(n.height)/o||1)}return{width:n.width/r,height:n.height/i,top:n.top/i,right:n.right/r,bottom:n.bottom/i,left:n.left/r,x:n.left/r,y:n.top/i}}function xi(e){var t=Pt(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function $a(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Si(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function je(e){return Oe(e).getComputedStyle(e)}function gf(e){return["table","td","th"].indexOf(Ie(e))>=0}function Qe(e){return((Mt(e)?e.ownerDocument:e.document)||window.document).documentElement}function Jn(e){return Ie(e)==="html"?e:e.assignedSlot||e.parentNode||(Si(e)?e.host:null)||Qe(e)}function bs(e){return!ye(e)||je(e).position==="fixed"?null:e.offsetParent}function vf(e){var t=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,n=navigator.userAgent.indexOf("Trident")!==-1;if(n&&ye(e)){var r=je(e);if(r.position==="fixed")return null}var i=Jn(e);for(Si(i)&&(i=i.host);ye(i)&&["html","body"].indexOf(Ie(i))<0;){var o=je(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function dn(e){for(var t=Oe(e),n=bs(e);n&&gf(n)&&je(n).position==="static";)n=bs(n);return n&&(Ie(n)==="html"||Ie(n)==="body"&&je(n).position==="static")?t:n||vf(e)||t}function $i(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function en(e,t,n){return at(e,Rn(t,n))}function yf(e,t,n){var r=en(e,t,n);return r>n?n:r}function Ca(){return{top:0,right:0,bottom:0,left:0}}function Da(e){return Object.assign({},Ca(),e)}function Na(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var Ef=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,Da(typeof t!="number"?t:Na(t,jt))};function bf(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,l=Le(n.placement),f=$i(l),d=[le,me].indexOf(l)>=0,g=d?"height":"width";if(!(!o||!a)){var s=Ef(i.padding,n),c=xi(o),u=f==="y"?ce:le,h=f==="y"?_e:me,_=n.rects.reference[g]+n.rects.reference[f]-a[f]-n.rects.popper[g],p=a[f]-n.rects.reference[f],m=dn(o),b=m?f==="y"?m.clientHeight||0:m.clientWidth||0:0,O=_/2-p/2,D=s[u],L=b-c[g]-s[h],I=b/2-c[g]/2+O,V=en(D,I,L),F=f;n.modifiersData[r]=(t={},t[F]=V,t.centerOffset=V-I,t)}}function wf(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||!$a(t.elements.popper,i)||(t.elements.arrow=i))}const La={name:"arrow",enabled:!0,phase:"main",fn:bf,effect:wf,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function kt(e){return e.split("-")[1]}var Af={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Tf(e){var t=e.x,n=e.y,r=window,i=r.devicePixelRatio||1;return{x:It(t*i)/i||0,y:It(n*i)/i||0}}function ws(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,l=e.position,f=e.gpuAcceleration,d=e.adaptive,g=e.roundOffsets,s=e.isFixed,c=a.x,u=c===void 0?0:c,h=a.y,_=h===void 0?0:h,p=typeof g=="function"?g({x:u,y:_}):{x:u,y:_};u=p.x,_=p.y;var m=a.hasOwnProperty("x"),b=a.hasOwnProperty("y"),O=le,D=ce,L=window;if(d){var I=dn(n),V="clientHeight",F="clientWidth";if(I===Oe(n)&&(I=Qe(n),je(I).position!=="static"&&l==="absolute"&&(V="scrollHeight",F="scrollWidth")),I=I,i===ce||(i===le||i===me)&&o===Lt){D=_e;var $=s&&I===L&&L.visualViewport?L.visualViewport.height:I[V];_-=$-r.height,_*=f?1:-1}if(i===le||(i===ce||i===_e)&&o===Lt){O=me;var N=s&&I===L&&L.visualViewport?L.visualViewport.width:I[F];u-=N-r.width,u*=f?1:-1}}var U=Object.assign({position:l},d&&Af),X=g===!0?Tf({x:u,y:_}):{x:u,y:_};if(u=X.x,_=X.y,f){var w;return Object.assign({},U,(w={},w[D]=b?"0":"",w[O]=m?"0":"",w.transform=(L.devicePixelRatio||1)<=1?"translate("+u+"px, "+_+"px)":"translate3d("+u+"px, "+_+"px, 0)",w))}return Object.assign({},U,(t={},t[D]=b?_+"px":"",t[O]=m?u+"px":"",t.transform="",t))}function Sf(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,l=n.roundOffsets,f=l===void 0?!0:l,d={placement:Le(t.placement),variation:kt(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,ws(Object.assign({},d,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:f})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,ws(Object.assign({},d,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:f})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Ci={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Sf,data:{}};var An={passive:!0};function Of(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,l=a===void 0?!0:a,f=Oe(t.elements.popper),d=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&d.forEach(function(g){g.addEventListener("scroll",n.update,An)}),l&&f.addEventListener("resize",n.update,An),function(){o&&d.forEach(function(g){g.removeEventListener("scroll",n.update,An)}),l&&f.removeEventListener("resize",n.update,An)}}const Di={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Of,data:{}};var xf={left:"right",right:"left",bottom:"top",top:"bottom"};function Nn(e){return e.replace(/left|right|bottom|top/g,function(t){return xf[t]})}var $f={start:"end",end:"start"};function As(e){return e.replace(/start|end/g,function(t){return $f[t]})}function Ni(e){var t=Oe(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Li(e){return Pt(Qe(e)).left+Ni(e).scrollLeft}function Cf(e){var t=Oe(e),n=Qe(e),r=t.visualViewport,i=n.clientWidth,o=n.clientHeight,a=0,l=0;return r&&(i=r.width,o=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,l=r.offsetTop)),{width:i,height:o,x:a+Li(e),y:l}}function Df(e){var t,n=Qe(e),r=Ni(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=at(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=at(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-r.scrollLeft+Li(e),f=-r.scrollTop;return je(i||n).direction==="rtl"&&(l+=at(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:l,y:f}}function Mi(e){var t=je(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Ma(e){return["html","body","#document"].indexOf(Ie(e))>=0?e.ownerDocument.body:ye(e)&&Mi(e)?e:Ma(Jn(e))}function tn(e,t){var n;t===void 0&&(t=[]);var r=Ma(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=Oe(r),a=i?[o].concat(o.visualViewport||[],Mi(r)?r:[]):r,l=t.concat(a);return i?l:l.concat(tn(Jn(a)))}function Hr(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Nf(e){var t=Pt(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}function Ts(e,t){return t===Ai?Hr(Cf(e)):Mt(t)?Nf(t):Hr(Df(Qe(e)))}function Lf(e){var t=tn(Jn(e)),n=["absolute","fixed"].indexOf(je(e).position)>=0,r=n&&ye(e)?dn(e):e;return Mt(r)?t.filter(function(i){return Mt(i)&&$a(i,r)&&Ie(i)!=="body"}):[]}function Mf(e,t,n){var r=t==="clippingParents"?Lf(e):[].concat(t),i=[].concat(r,[n]),o=i[0],a=i.reduce(function(l,f){var d=Ts(e,f);return l.top=at(d.top,l.top),l.right=Rn(d.right,l.right),l.bottom=Rn(d.bottom,l.bottom),l.left=at(d.left,l.left),l},Ts(e,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Ia(e){var t=e.reference,n=e.element,r=e.placement,i=r?Le(r):null,o=r?kt(r):null,a=t.x+t.width/2-n.width/2,l=t.y+t.height/2-n.height/2,f;switch(i){case ce:f={x:a,y:t.y-n.height};break;case _e:f={x:a,y:t.y+t.height};break;case me:f={x:t.x+t.width,y:l};break;case le:f={x:t.x-n.width,y:l};break;default:f={x:t.x,y:t.y}}var d=i?$i(i):null;if(d!=null){var g=d==="y"?"height":"width";switch(o){case pt:f[d]=f[d]-(t[g]/2-n[g]/2);break;case Lt:f[d]=f[d]+(t[g]/2-n[g]/2);break}}return f}function Rt(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.boundary,a=o===void 0?ma:o,l=n.rootBoundary,f=l===void 0?Ai:l,d=n.elementContext,g=d===void 0?xt:d,s=n.altBoundary,c=s===void 0?!1:s,u=n.padding,h=u===void 0?0:u,_=Da(typeof h!="number"?h:Na(h,jt)),p=g===xt?ga:xt,m=e.rects.popper,b=e.elements[c?p:g],O=Mf(Mt(b)?b:b.contextElement||Qe(e.elements.popper),a,f),D=Pt(e.elements.reference),L=Ia({reference:D,element:m,strategy:"absolute",placement:i}),I=Hr(Object.assign({},m,L)),V=g===xt?I:D,F={top:O.top-V.top+_.top,bottom:V.bottom-O.bottom+_.bottom,left:O.left-V.left+_.left,right:V.right-O.right+_.right},$=e.modifiersData.offset;if(g===xt&&$){var N=$[i];Object.keys(F).forEach(function(U){var X=[me,_e].indexOf(U)>=0?1:-1,w=[ce,_e].indexOf(U)>=0?"y":"x";F[U]+=N[w]*X})}return F}function If(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,l=n.flipVariations,f=n.allowedAutoPlacements,d=f===void 0?Ti:f,g=kt(r),s=g?l?Rr:Rr.filter(function(h){return kt(h)===g}):jt,c=s.filter(function(h){return d.indexOf(h)>=0});c.length===0&&(c=s);var u=c.reduce(function(h,_){return h[_]=Rt(e,{placement:_,boundary:i,rootBoundary:o,padding:a})[Le(_)],h},{});return Object.keys(u).sort(function(h,_){return u[h]-u[_]})}function Pf(e){if(Le(e)===Qn)return[];var t=Nn(e);return[As(e),t,As(t)]}function kf(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,l=a===void 0?!0:a,f=n.fallbackPlacements,d=n.padding,g=n.boundary,s=n.rootBoundary,c=n.altBoundary,u=n.flipVariations,h=u===void 0?!0:u,_=n.allowedAutoPlacements,p=t.options.placement,m=Le(p),b=m===p,O=f||(b||!h?[Nn(p)]:Pf(p)),D=[p].concat(O).reduce(function(K,Y){return K.concat(Le(Y)===Qn?If(t,{placement:Y,boundary:g,rootBoundary:s,padding:d,flipVariations:h,allowedAutoPlacements:_}):Y)},[]),L=t.rects.reference,I=t.rects.popper,V=new Map,F=!0,$=D[0],N=0;N=0,v=E?"width":"height",A=Rt(t,{placement:U,boundary:g,rootBoundary:s,altBoundary:c,padding:d}),y=E?w?me:le:w?_e:ce;L[v]>I[v]&&(y=Nn(y));var x=Nn(y),S=[];if(o&&S.push(A[X]<=0),l&&S.push(A[y]<=0,A[x]<=0),S.every(function(K){return K})){$=U,F=!1;break}V.set(U,S)}if(F)for(var P=h?3:1,B=function(Y){var re=D.find(function(oe){var z=V.get(oe);if(z)return z.slice(0,Y).every(function(W){return W})});if(re)return $=re,"break"},k=P;k>0;k--){var j=B(k);if(j==="break")break}t.placement!==$&&(t.modifiersData[r]._skip=!0,t.placement=$,t.reset=!0)}}const Pa={name:"flip",enabled:!0,phase:"main",fn:kf,requiresIfExists:["offset"],data:{_skip:!1}};function Ss(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Os(e){return[ce,me,_e,le].some(function(t){return e[t]>=0})}function Rf(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=Rt(t,{elementContext:"reference"}),l=Rt(t,{altBoundary:!0}),f=Ss(a,r),d=Ss(l,i,o),g=Os(f),s=Os(d);t.modifiersData[n]={referenceClippingOffsets:f,popperEscapeOffsets:d,isReferenceHidden:g,hasPopperEscaped:s},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":g,"data-popper-escaped":s})}const ka={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Rf};function Hf(e,t,n){var r=Le(e),i=[le,ce].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=o[0],l=o[1];return a=a||0,l=(l||0)*i,[le,me].indexOf(r)>=0?{x:l,y:a}:{x:a,y:l}}function Bf(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=Ti.reduce(function(g,s){return g[s]=Hf(s,t.rects,o),g},{}),l=a[t.placement],f=l.x,d=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=f,t.modifiersData.popperOffsets.y+=d),t.modifiersData[r]=a}const Ra={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Bf};function Vf(e){var t=e.state,n=e.name;t.modifiersData[n]=Ia({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const Ii={name:"popperOffsets",enabled:!0,phase:"read",fn:Vf,data:{}};function jf(e){return e==="x"?"y":"x"}function Ff(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,l=a===void 0?!1:a,f=n.boundary,d=n.rootBoundary,g=n.altBoundary,s=n.padding,c=n.tether,u=c===void 0?!0:c,h=n.tetherOffset,_=h===void 0?0:h,p=Rt(t,{boundary:f,rootBoundary:d,padding:s,altBoundary:g}),m=Le(t.placement),b=kt(t.placement),O=!b,D=$i(m),L=jf(D),I=t.modifiersData.popperOffsets,V=t.rects.reference,F=t.rects.popper,$=typeof _=="function"?_(Object.assign({},t.rects,{placement:t.placement})):_,N=typeof $=="number"?{mainAxis:$,altAxis:$}:Object.assign({mainAxis:0,altAxis:0},$),U=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,X={x:0,y:0};if(!!I){if(o){var w,E=D==="y"?ce:le,v=D==="y"?_e:me,A=D==="y"?"height":"width",y=I[D],x=y+p[E],S=y-p[v],P=u?-F[A]/2:0,B=b===pt?V[A]:F[A],k=b===pt?-F[A]:-V[A],j=t.elements.arrow,K=u&&j?xi(j):{width:0,height:0},Y=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Ca(),re=Y[E],oe=Y[v],z=en(0,V[A],K[A]),W=O?V[A]/2-P-z-re-N.mainAxis:B-z-re-N.mainAxis,Q=O?-V[A]/2+P+z+oe+N.mainAxis:k+z+oe+N.mainAxis,we=t.elements.arrow&&dn(t.elements.arrow),Ae=we?D==="y"?we.clientTop||0:we.clientLeft||0:0,ns=(w=U==null?void 0:U[D])!=null?w:0,Tl=y+W-ns-Ae,Sl=y+Q-ns,rs=en(u?Rn(x,Tl):x,y,u?at(S,Sl):S);I[D]=rs,X[D]=rs-y}if(l){var is,Ol=D==="x"?ce:le,xl=D==="x"?_e:me,Ze=I[L],wn=L==="y"?"height":"width",ss=Ze+p[Ol],os=Ze-p[xl],vr=[ce,le].indexOf(m)!==-1,as=(is=U==null?void 0:U[L])!=null?is:0,cs=vr?ss:Ze-V[wn]-F[wn]-as+N.altAxis,ls=vr?Ze+V[wn]+F[wn]-as-N.altAxis:os,us=u&&vr?yf(cs,Ze,ls):en(u?cs:ss,Ze,u?ls:os);I[L]=us,X[L]=us-Ze}t.modifiersData[r]=X}}const Ha={name:"preventOverflow",enabled:!0,phase:"main",fn:Ff,requiresIfExists:["offset"]};function Wf(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Uf(e){return e===Oe(e)||!ye(e)?Ni(e):Wf(e)}function Yf(e){var t=e.getBoundingClientRect(),n=It(t.width)/e.offsetWidth||1,r=It(t.height)/e.offsetHeight||1;return n!==1||r!==1}function Kf(e,t,n){n===void 0&&(n=!1);var r=ye(t),i=ye(t)&&Yf(t),o=Qe(t),a=Pt(e,i),l={scrollLeft:0,scrollTop:0},f={x:0,y:0};return(r||!r&&!n)&&((Ie(t)!=="body"||Mi(o))&&(l=Uf(t)),ye(t)?(f=Pt(t,!0),f.x+=t.clientLeft,f.y+=t.clientTop):o&&(f.x=Li(o))),{x:a.left+l.scrollLeft-f.x,y:a.top+l.scrollTop-f.y,width:a.width,height:a.height}}function Gf(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(l){if(!n.has(l)){var f=t.get(l);f&&i(f)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function qf(e){var t=Gf(e);return xa.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function zf(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Xf(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var xs={placement:"bottom",modifiers:[],strategy:"absolute"};function $s(){for(var e=arguments.length,t=new Array(e),n=0;n=0;i--)r._howls[i].stereo(n);return r},HowlerGlobal.prototype.pos=function(n,r,i){var o=this;if(!o.ctx||!o.ctx.listener)return o;if(r=typeof r!="number"?o._pos[1]:r,i=typeof i!="number"?o._pos[2]:i,typeof n=="number")o._pos=[n,r,i],typeof o.ctx.listener.positionX<"u"?(o.ctx.listener.positionX.setTargetAtTime(o._pos[0],Howler.ctx.currentTime,.1),o.ctx.listener.positionY.setTargetAtTime(o._pos[1],Howler.ctx.currentTime,.1),o.ctx.listener.positionZ.setTargetAtTime(o._pos[2],Howler.ctx.currentTime,.1)):o.ctx.listener.setPosition(o._pos[0],o._pos[1],o._pos[2]);else return o._pos;return o},HowlerGlobal.prototype.orientation=function(n,r,i,o,a,l){var f=this;if(!f.ctx||!f.ctx.listener)return f;var d=f._orientation;if(r=typeof r!="number"?d[1]:r,i=typeof i!="number"?d[2]:i,o=typeof o!="number"?d[3]:o,a=typeof a!="number"?d[4]:a,l=typeof l!="number"?d[5]:l,typeof n=="number")f._orientation=[n,r,i,o,a,l],typeof f.ctx.listener.forwardX<"u"?(f.ctx.listener.forwardX.setTargetAtTime(n,Howler.ctx.currentTime,.1),f.ctx.listener.forwardY.setTargetAtTime(r,Howler.ctx.currentTime,.1),f.ctx.listener.forwardZ.setTargetAtTime(i,Howler.ctx.currentTime,.1),f.ctx.listener.upX.setTargetAtTime(o,Howler.ctx.currentTime,.1),f.ctx.listener.upY.setTargetAtTime(a,Howler.ctx.currentTime,.1),f.ctx.listener.upZ.setTargetAtTime(l,Howler.ctx.currentTime,.1)):f.ctx.listener.setOrientation(n,r,i,o,a,l);else return d;return f},Howl.prototype.init=function(n){return function(r){var i=this;return i._orientation=r.orientation||[1,0,0],i._stereo=r.stereo||null,i._pos=r.pos||null,i._pannerAttr={coneInnerAngle:typeof r.coneInnerAngle<"u"?r.coneInnerAngle:360,coneOuterAngle:typeof r.coneOuterAngle<"u"?r.coneOuterAngle:360,coneOuterGain:typeof r.coneOuterGain<"u"?r.coneOuterGain:0,distanceModel:typeof r.distanceModel<"u"?r.distanceModel:"inverse",maxDistance:typeof r.maxDistance<"u"?r.maxDistance:1e4,panningModel:typeof r.panningModel<"u"?r.panningModel:"HRTF",refDistance:typeof r.refDistance<"u"?r.refDistance:1,rolloffFactor:typeof r.rolloffFactor<"u"?r.rolloffFactor:1},i._onstereo=r.onstereo?[{fn:r.onstereo}]:[],i._onpos=r.onpos?[{fn:r.onpos}]:[],i._onorientation=r.onorientation?[{fn:r.onorientation}]:[],n.call(this,r)}}(Howl.prototype.init),Howl.prototype.stereo=function(n,r){var i=this;if(!i._webAudio)return i;if(i._state!=="loaded")return i._queue.push({event:"stereo",action:function(){i.stereo(n,r)}}),i;var o=typeof Howler.ctx.createStereoPanner>"u"?"spatial":"stereo";if(typeof r>"u")if(typeof n=="number")i._stereo=n,i._pos=[n,0,0];else return i._stereo;for(var a=i._getSoundIds(r),l=0;l"u")if(typeof n=="number")a._pos=[n,r,i];else return a._pos;for(var l=a._getSoundIds(o),f=0;f"u")if(typeof n=="number")a._orientation=[n,r,i];else return a._orientation;for(var l=a._getSoundIds(o),f=0;f"u"&&(i.pannerAttr||(i.pannerAttr={coneInnerAngle:i.coneInnerAngle,coneOuterAngle:i.coneOuterAngle,coneOuterGain:i.coneOuterGain,distanceModel:i.distanceModel,maxDistance:i.maxDistance,refDistance:i.refDistance,rolloffFactor:i.rolloffFactor,panningModel:i.panningModel}),n._pannerAttr={coneInnerAngle:typeof i.pannerAttr.coneInnerAngle<"u"?i.pannerAttr.coneInnerAngle:n._coneInnerAngle,coneOuterAngle:typeof i.pannerAttr.coneOuterAngle<"u"?i.pannerAttr.coneOuterAngle:n._coneOuterAngle,coneOuterGain:typeof i.pannerAttr.coneOuterGain<"u"?i.pannerAttr.coneOuterGain:n._coneOuterGain,distanceModel:typeof i.pannerAttr.distanceModel<"u"?i.pannerAttr.distanceModel:n._distanceModel,maxDistance:typeof i.pannerAttr.maxDistance<"u"?i.pannerAttr.maxDistance:n._maxDistance,refDistance:typeof i.pannerAttr.refDistance<"u"?i.pannerAttr.refDistance:n._refDistance,rolloffFactor:typeof i.pannerAttr.rolloffFactor<"u"?i.pannerAttr.rolloffFactor:n._rolloffFactor,panningModel:typeof i.pannerAttr.panningModel<"u"?i.pannerAttr.panningModel:n._panningModel});else return a=n._soundById(parseInt(r[0],10)),a?a._pannerAttr:n._pannerAttr;else r.length===2&&(i=r[0],o=parseInt(r[1],10));for(var l=n._getSoundIds(o),f=0;fJSON.parse(localStorage.getItem(`CTFd:${e}`))||t,la=(e,t)=>{localStorage.setItem(`CTFd:${e}`,JSON.stringify(t))};function qn(){return ca("read_notifications")}function zn(){return ca("unread_notifications")}function Ei(e){la("read_notifications",e)}function Xn(e){la("unread_notifications",e)}function Ju(e){const t=[...qn(),e];return Ei(t),ua(e),t}function Zu(e){const t=[...zn(),e];return Xn(t),t}function ys(){const e=qn();return e.length===0?0:Math.max(...e)}function ua(e){const n=zn().filter(r=>r!==e);Xn(n)}function ef(){const e=zn(),t=qn();Ei(t.concat(e)),Xn([])}const q={init:(e,t)=>{q.source=new EventSource(e+"/events");for(let r=0;r{let i=r.headers.get("result-count");i&&(q.controller.broadcast("counter",{count:i}),L._functions.events.eventCount(i))})},controller:new Qu,source:null,howl:null,connect:()=>{q.source.addEventListener("notification",function(e){let t=JSON.parse(e.data);q.controller.broadcast("notification",t),L.events.counter.unread.add(t.id);let n=L.events.counter.unread.getAll().length;q.controller.broadcast("counter",{count:n}),L._functions.events.eventCount(n),q.render(t),t.sound&&q.howl.play()},!1)},disconnect:()=>{q.source&&q.source.close()},render:e=>{switch(e.type){case"toast":{L._functions.events.eventToast(e);break}case"alert":{L._functions.events.eventAlert(e);break}case"background":{L._functions.events.eventBackground(e);break}default:{console.log(e),alert(e);break}}},counter:{read:{getAll:qn,setAll:Ei,add:Ju,getLast:ys},unread:{getAll:zn,setAll:Xn,add:Zu,remove:ua,readAll:ef}}};q.controller.alert=function(e){q.render(e)};q.controller.toast=function(e){q.render(e)};q.controller.background=function(e){q.render(e)};q.controller.counter=function(e){L._functions.events.eventCount(e.count)};q.controller.masterDidChange=function(){this.isMaster?q.connect():q.disconnect()};var fa={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Te,function(){return function(n,r,i){n=n||{};var o=r.prototype,a={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function l(d,g,s,c){return o.fromToBase(d,g,s,c)}i.en.relativeTime=a,o.fromToBase=function(d,g,s,c,u){for(var h,_,p,m=s.$locale().relativeTime||a,b=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],O=b.length,D=0;D0,I<=M.r||!M.r){I<=1&&D>0&&(M=b[D-1]);var V=m[M.l];u&&(I=u(""+I)),_=typeof V=="string"?V.replace("%d",I):V(I,g,M.l,p);break}}if(g)return _;var F=p?m.future:m.past;return typeof F=="function"?F(_):F.replace("%s",_)},o.to=function(d,g){return l(d,g,this,!0)},o.from=function(d,g){return l(d,g,this)};var f=function(d){return d.$u?i.utc():i()};o.toNow=function(d){return this.to(f(this),d)},o.fromNow=function(d){return this.from(f(this),d)}}})})(fa);const tf=fa.exports;fn.extend(Mo);fn.extend(tf);const Ot={id:null,name:null,email:null},Dn={id:null,name:null},nf={},rf={challenge:{displayChallenge:null,renderChallenge:null,displayHint(e){alert(e.content)},displayUnlock(e){return confirm("Are you sure you'd like to unlock this hint?")},displayUnlockError(e){const t=[];Object.keys(e.errors).map(r=>{t.push(e.errors[r])});const n=t.join(` +`);alert(n)},submitChallenge:null,displaySubmissionResponse:null,displaySolves:null},challenges:{displayChallenges:null,sortChallenges:null},events:{eventAlert:null,eventToast:null,eventBackground:null,eventRead:null,eventCount:null}},sf={htmlEntities:oa,colorHash:Nu,copyToClipboard:Cu,hashCode:Du,renderTimes:$u},of={ajax:{getScript:ea},html:{createHtmlNode:Xu,htmlEntities:oa}},af={challenge:{displayChallenge:Mu,submitChallenge:Iu,loadSolves:sa,displaySolves:Pu,loadHint:ta,loadUnlock:na,displayUnlock:ia,displayHint:ra},challenges:{getChallenges:Jo,getChallenge:Zo,displayChallenges:Lu},scoreboard:{getScoreboard:ku,getScoreboardDetail:Ru},settings:{updateSettings:Hu,generateToken:Bu,deleteToken:Vu},users:{userSolves:ju,userFails:Fu,userAwards:Wu},teams:{getInviteToken:Uu,disbandTeam:Yu,updateTeamSettings:Ku,teamSolves:Gu,teamFails:qu,teamAwards:zu}},cf={$:R,dayjs:fn};let Es=!1;const lf=e=>{Es||(Es=!0,X.urlRoot=e.urlRoot||X.urlRoot,X.csrfNonce=e.csrfNonce||X.csrfNonce,X.userMode=e.userMode||X.userMode,X.start=e.start||X.start,X.end=e.end||X.end,X.themeSettings=e.themeSettings||X.themeSettings,X.eventSounds=e.eventSounds||X.eventSounds,X.preview=!1,Ot.id=e.userId,Ot.name=e.userName||Ot.name,Ot.email=e.userEmail||Ot.email,Dn.id=e.teamId,Dn.name=e.teamName||Dn.name,q.init(X.urlRoot,X.eventSounds))},uf={run(e){e(bi)}},bi={init:lf,config:X,fetch:Vl,user:Ot,team:Dn,ui:sf,utils:of,pages:af,events:q,_internal:nf,_functions:rf,plugin:uf,lib:cf};window.CTFd=bi;const L=bi;var da={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Te,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",a="second",l="minute",f="hour",d="day",g="week",s="month",c="quarter",u="year",h="date",_="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},O=function(w,E,v){var A=String(w);return!A||A.length>=E?w:""+Array(E+1-A.length).join(v)+w},D={s:O,z:function(w){var E=-w.utcOffset(),v=Math.abs(E),A=Math.floor(v/60),y=v%60;return(E<=0?"+":"-")+O(A,2,"0")+":"+O(y,2,"0")},m:function w(E,v){if(E.date()1)return w(S[0])}else{var P=E.name;I[P]=E,y=P}return!A&&y&&(M=y),y||!A&&M},$=function(w,E){if(V(w))return w.clone();var v=typeof E=="object"?E:{};return v.date=w,v.args=arguments,new U(v)},N=D;N.l=F,N.i=V,N.w=function(w,E){return $(w,{locale:E.$L,utc:E.$u,x:E.$x,$offset:E.$offset})};var U=function(){function w(v){this.$L=F(v.locale,null,!0),this.parse(v)}var E=w.prototype;return E.parse=function(v){this.$d=function(A){var y=A.date,x=A.utc;if(y===null)return new Date(NaN);if(N.u(y))return new Date;if(y instanceof Date)return new Date(y);if(typeof y=="string"&&!/Z$/i.test(y)){var S=y.match(p);if(S){var P=S[2]-1||0,B=(S[7]||"0").substring(0,3);return x?new Date(Date.UTC(S[1],P,S[3]||1,S[4]||0,S[5]||0,S[6]||0,B)):new Date(S[1],P,S[3]||1,S[4]||0,S[5]||0,S[6]||0,B)}}return new Date(y)}(v),this.$x=v.x||{},this.init()},E.init=function(){var v=this.$d;this.$y=v.getFullYear(),this.$M=v.getMonth(),this.$D=v.getDate(),this.$W=v.getDay(),this.$H=v.getHours(),this.$m=v.getMinutes(),this.$s=v.getSeconds(),this.$ms=v.getMilliseconds()},E.$utils=function(){return N},E.isValid=function(){return this.$d.toString()!==_},E.isSame=function(v,A){var y=$(v);return this.startOf(A)<=y&&y<=this.endOf(A)},E.isAfter=function(v,A){return $(v){document.querySelectorAll("[data-time]").forEach(e=>{const t=e.getAttribute("data-time"),n=e.getAttribute("data-time-format")||"MMMM Do, h:mm:ss A";e.innerText=wi(t).format(n)})},df=()=>{document.querySelectorAll(".form-control").forEach(e=>{e.addEventListener("onfocus",()=>{e.classList.remove("input-filled-invalid"),e.classList.add("input-filled-valid")}),e.addEventListener("onblur",()=>{e.nodeValue===""&&(e.classList.remove("input-filled-valid"),e.classList.remove("input-filled-invalid"))}),e.nodeValue&&e.classList.add("input-filled-valid")}),document.querySelectorAll(".page-select").forEach(e=>{if(e.nodeValue){const t=new URL(window.location);t.searchParams.set("page",e.nodeValue),window.location.href=t.toString()}})};var _a={exports:{}};/*! lolight v1.4.0 - https://larsjung.de/lolight/ */(function(e,t){(function(n,r){e.exports=r()})(Te,function(){function n(c){if(typeof c!="string")throw new Error("tok: no string");for(var u=[],h=s.length,_=!1;c;)for(var p=0;p/],["rex",/\/(\\\/|[^\n])*?\//],["str",/(['"`])(\\\1|[\s\S])*?\1/],[g,/[+-]?([0-9]*\.?[0-9]+|[0-9]+\.?[0-9]*)([eE][+-]?[0-9]+)?/],["pct",/[\\.,:;+\-*\/=<>()[\]{}|?!&@~]/],["spc",/\s+/],[d,/[\w$]+/],["unk",/./]];return r(!1,function(c){var u=c.querySelector("head"),h=c.createElement("style");h.textContent=a,u.insertBefore(h,u.firstChild),/^(i|c|loade)/.test(c.readyState)?o():c.addEventListener("DOMContentLoaded",function(){o()})}),o.tok=n,o.el=i,o})})(_a);const hf=_a.exports,pf=()=>{(!L.config.themeSettings.hasOwnProperty("use_builtin_code_highlighter")||L.config.themeSettings.use_builtin_code_highlighter===!0)&&hf("pre code")};var ce="top",_e="bottom",me="right",le="left",Qn="auto",jt=[ce,_e,me,le],pt="start",Lt="end",ma="clippingParents",Ai="viewport",xt="popper",ga="reference",Rr=jt.reduce(function(e,t){return e.concat([t+"-"+pt,t+"-"+Lt])},[]),Ti=[].concat(jt,[Qn]).reduce(function(e,t){return e.concat([t,t+"-"+pt,t+"-"+Lt])},[]),va="beforeRead",ya="read",Ea="afterRead",ba="beforeMain",wa="main",Aa="afterMain",Ta="beforeWrite",Sa="write",Oa="afterWrite",xa=[va,ya,Ea,ba,wa,Aa,Ta,Sa,Oa];function Ie(e){return e?(e.nodeName||"").toLowerCase():null}function Oe(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Mt(e){var t=Oe(e).Element;return e instanceof t||e instanceof Element}function ye(e){var t=Oe(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Si(e){if(typeof ShadowRoot>"u")return!1;var t=Oe(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function _f(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!ye(o)||!Ie(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var l=i[a];l===!1?o.removeAttribute(a):o.setAttribute(a,l===!0?"":l)}))})}function mf(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],o=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),l=a.reduce(function(f,d){return f[d]="",f},{});!ye(i)||!Ie(i)||(Object.assign(i.style,l),Object.keys(o).forEach(function(f){i.removeAttribute(f)}))})}}const Oi={name:"applyStyles",enabled:!0,phase:"write",fn:_f,effect:mf,requires:["computeStyles"]};function Le(e){return e.split("-")[0]}var at=Math.max,Rn=Math.min,It=Math.round;function Pt(e,t){t===void 0&&(t=!1);var n=e.getBoundingClientRect(),r=1,i=1;if(ye(e)&&t){var o=e.offsetHeight,a=e.offsetWidth;a>0&&(r=It(n.width)/a||1),o>0&&(i=It(n.height)/o||1)}return{width:n.width/r,height:n.height/i,top:n.top/i,right:n.right/r,bottom:n.bottom/i,left:n.left/r,x:n.left/r,y:n.top/i}}function xi(e){var t=Pt(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function $a(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Si(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function je(e){return Oe(e).getComputedStyle(e)}function gf(e){return["table","td","th"].indexOf(Ie(e))>=0}function Qe(e){return((Mt(e)?e.ownerDocument:e.document)||window.document).documentElement}function Jn(e){return Ie(e)==="html"?e:e.assignedSlot||e.parentNode||(Si(e)?e.host:null)||Qe(e)}function bs(e){return!ye(e)||je(e).position==="fixed"?null:e.offsetParent}function vf(e){var t=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,n=navigator.userAgent.indexOf("Trident")!==-1;if(n&&ye(e)){var r=je(e);if(r.position==="fixed")return null}var i=Jn(e);for(Si(i)&&(i=i.host);ye(i)&&["html","body"].indexOf(Ie(i))<0;){var o=je(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function dn(e){for(var t=Oe(e),n=bs(e);n&&gf(n)&&je(n).position==="static";)n=bs(n);return n&&(Ie(n)==="html"||Ie(n)==="body"&&je(n).position==="static")?t:n||vf(e)||t}function $i(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function en(e,t,n){return at(e,Rn(t,n))}function yf(e,t,n){var r=en(e,t,n);return r>n?n:r}function Ca(){return{top:0,right:0,bottom:0,left:0}}function Da(e){return Object.assign({},Ca(),e)}function Na(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var Ef=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,Da(typeof t!="number"?t:Na(t,jt))};function bf(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,l=Le(n.placement),f=$i(l),d=[le,me].indexOf(l)>=0,g=d?"height":"width";if(!(!o||!a)){var s=Ef(i.padding,n),c=xi(o),u=f==="y"?ce:le,h=f==="y"?_e:me,_=n.rects.reference[g]+n.rects.reference[f]-a[f]-n.rects.popper[g],p=a[f]-n.rects.reference[f],m=dn(o),b=m?f==="y"?m.clientHeight||0:m.clientWidth||0:0,O=_/2-p/2,D=s[u],M=b-c[g]-s[h],I=b/2-c[g]/2+O,V=en(D,I,M),F=f;n.modifiersData[r]=(t={},t[F]=V,t.centerOffset=V-I,t)}}function wf(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||!$a(t.elements.popper,i)||(t.elements.arrow=i))}const La={name:"arrow",enabled:!0,phase:"main",fn:bf,effect:wf,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function kt(e){return e.split("-")[1]}var Af={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Tf(e){var t=e.x,n=e.y,r=window,i=r.devicePixelRatio||1;return{x:It(t*i)/i||0,y:It(n*i)/i||0}}function ws(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,l=e.position,f=e.gpuAcceleration,d=e.adaptive,g=e.roundOffsets,s=e.isFixed,c=a.x,u=c===void 0?0:c,h=a.y,_=h===void 0?0:h,p=typeof g=="function"?g({x:u,y:_}):{x:u,y:_};u=p.x,_=p.y;var m=a.hasOwnProperty("x"),b=a.hasOwnProperty("y"),O=le,D=ce,M=window;if(d){var I=dn(n),V="clientHeight",F="clientWidth";if(I===Oe(n)&&(I=Qe(n),je(I).position!=="static"&&l==="absolute"&&(V="scrollHeight",F="scrollWidth")),I=I,i===ce||(i===le||i===me)&&o===Lt){D=_e;var $=s&&I===M&&M.visualViewport?M.visualViewport.height:I[V];_-=$-r.height,_*=f?1:-1}if(i===le||(i===ce||i===_e)&&o===Lt){O=me;var N=s&&I===M&&M.visualViewport?M.visualViewport.width:I[F];u-=N-r.width,u*=f?1:-1}}var U=Object.assign({position:l},d&&Af),Q=g===!0?Tf({x:u,y:_}):{x:u,y:_};if(u=Q.x,_=Q.y,f){var w;return Object.assign({},U,(w={},w[D]=b?"0":"",w[O]=m?"0":"",w.transform=(M.devicePixelRatio||1)<=1?"translate("+u+"px, "+_+"px)":"translate3d("+u+"px, "+_+"px, 0)",w))}return Object.assign({},U,(t={},t[D]=b?_+"px":"",t[O]=m?u+"px":"",t.transform="",t))}function Sf(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,l=n.roundOffsets,f=l===void 0?!0:l,d={placement:Le(t.placement),variation:kt(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,ws(Object.assign({},d,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:f})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,ws(Object.assign({},d,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:f})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Ci={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Sf,data:{}};var An={passive:!0};function Of(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,l=a===void 0?!0:a,f=Oe(t.elements.popper),d=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&d.forEach(function(g){g.addEventListener("scroll",n.update,An)}),l&&f.addEventListener("resize",n.update,An),function(){o&&d.forEach(function(g){g.removeEventListener("scroll",n.update,An)}),l&&f.removeEventListener("resize",n.update,An)}}const Di={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Of,data:{}};var xf={left:"right",right:"left",bottom:"top",top:"bottom"};function Nn(e){return e.replace(/left|right|bottom|top/g,function(t){return xf[t]})}var $f={start:"end",end:"start"};function As(e){return e.replace(/start|end/g,function(t){return $f[t]})}function Ni(e){var t=Oe(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Li(e){return Pt(Qe(e)).left+Ni(e).scrollLeft}function Cf(e){var t=Oe(e),n=Qe(e),r=t.visualViewport,i=n.clientWidth,o=n.clientHeight,a=0,l=0;return r&&(i=r.width,o=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,l=r.offsetTop)),{width:i,height:o,x:a+Li(e),y:l}}function Df(e){var t,n=Qe(e),r=Ni(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=at(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=at(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-r.scrollLeft+Li(e),f=-r.scrollTop;return je(i||n).direction==="rtl"&&(l+=at(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:l,y:f}}function Mi(e){var t=je(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Ma(e){return["html","body","#document"].indexOf(Ie(e))>=0?e.ownerDocument.body:ye(e)&&Mi(e)?e:Ma(Jn(e))}function tn(e,t){var n;t===void 0&&(t=[]);var r=Ma(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=Oe(r),a=i?[o].concat(o.visualViewport||[],Mi(r)?r:[]):r,l=t.concat(a);return i?l:l.concat(tn(Jn(a)))}function Hr(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Nf(e){var t=Pt(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}function Ts(e,t){return t===Ai?Hr(Cf(e)):Mt(t)?Nf(t):Hr(Df(Qe(e)))}function Lf(e){var t=tn(Jn(e)),n=["absolute","fixed"].indexOf(je(e).position)>=0,r=n&&ye(e)?dn(e):e;return Mt(r)?t.filter(function(i){return Mt(i)&&$a(i,r)&&Ie(i)!=="body"}):[]}function Mf(e,t,n){var r=t==="clippingParents"?Lf(e):[].concat(t),i=[].concat(r,[n]),o=i[0],a=i.reduce(function(l,f){var d=Ts(e,f);return l.top=at(d.top,l.top),l.right=Rn(d.right,l.right),l.bottom=Rn(d.bottom,l.bottom),l.left=at(d.left,l.left),l},Ts(e,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Ia(e){var t=e.reference,n=e.element,r=e.placement,i=r?Le(r):null,o=r?kt(r):null,a=t.x+t.width/2-n.width/2,l=t.y+t.height/2-n.height/2,f;switch(i){case ce:f={x:a,y:t.y-n.height};break;case _e:f={x:a,y:t.y+t.height};break;case me:f={x:t.x+t.width,y:l};break;case le:f={x:t.x-n.width,y:l};break;default:f={x:t.x,y:t.y}}var d=i?$i(i):null;if(d!=null){var g=d==="y"?"height":"width";switch(o){case pt:f[d]=f[d]-(t[g]/2-n[g]/2);break;case Lt:f[d]=f[d]+(t[g]/2-n[g]/2);break}}return f}function Rt(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.boundary,a=o===void 0?ma:o,l=n.rootBoundary,f=l===void 0?Ai:l,d=n.elementContext,g=d===void 0?xt:d,s=n.altBoundary,c=s===void 0?!1:s,u=n.padding,h=u===void 0?0:u,_=Da(typeof h!="number"?h:Na(h,jt)),p=g===xt?ga:xt,m=e.rects.popper,b=e.elements[c?p:g],O=Mf(Mt(b)?b:b.contextElement||Qe(e.elements.popper),a,f),D=Pt(e.elements.reference),M=Ia({reference:D,element:m,strategy:"absolute",placement:i}),I=Hr(Object.assign({},m,M)),V=g===xt?I:D,F={top:O.top-V.top+_.top,bottom:V.bottom-O.bottom+_.bottom,left:O.left-V.left+_.left,right:V.right-O.right+_.right},$=e.modifiersData.offset;if(g===xt&&$){var N=$[i];Object.keys(F).forEach(function(U){var Q=[me,_e].indexOf(U)>=0?1:-1,w=[ce,_e].indexOf(U)>=0?"y":"x";F[U]+=N[w]*Q})}return F}function If(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,l=n.flipVariations,f=n.allowedAutoPlacements,d=f===void 0?Ti:f,g=kt(r),s=g?l?Rr:Rr.filter(function(h){return kt(h)===g}):jt,c=s.filter(function(h){return d.indexOf(h)>=0});c.length===0&&(c=s);var u=c.reduce(function(h,_){return h[_]=Rt(e,{placement:_,boundary:i,rootBoundary:o,padding:a})[Le(_)],h},{});return Object.keys(u).sort(function(h,_){return u[h]-u[_]})}function Pf(e){if(Le(e)===Qn)return[];var t=Nn(e);return[As(e),t,As(t)]}function kf(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,l=a===void 0?!0:a,f=n.fallbackPlacements,d=n.padding,g=n.boundary,s=n.rootBoundary,c=n.altBoundary,u=n.flipVariations,h=u===void 0?!0:u,_=n.allowedAutoPlacements,p=t.options.placement,m=Le(p),b=m===p,O=f||(b||!h?[Nn(p)]:Pf(p)),D=[p].concat(O).reduce(function(K,Y){return K.concat(Le(Y)===Qn?If(t,{placement:Y,boundary:g,rootBoundary:s,padding:d,flipVariations:h,allowedAutoPlacements:_}):Y)},[]),M=t.rects.reference,I=t.rects.popper,V=new Map,F=!0,$=D[0],N=0;N=0,v=E?"width":"height",A=Rt(t,{placement:U,boundary:g,rootBoundary:s,altBoundary:c,padding:d}),y=E?w?me:le:w?_e:ce;M[v]>I[v]&&(y=Nn(y));var x=Nn(y),S=[];if(o&&S.push(A[Q]<=0),l&&S.push(A[y]<=0,A[x]<=0),S.every(function(K){return K})){$=U,F=!1;break}V.set(U,S)}if(F)for(var P=h?3:1,B=function(Y){var re=D.find(function(oe){var z=V.get(oe);if(z)return z.slice(0,Y).every(function(W){return W})});if(re)return $=re,"break"},k=P;k>0;k--){var j=B(k);if(j==="break")break}t.placement!==$&&(t.modifiersData[r]._skip=!0,t.placement=$,t.reset=!0)}}const Pa={name:"flip",enabled:!0,phase:"main",fn:kf,requiresIfExists:["offset"],data:{_skip:!1}};function Ss(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Os(e){return[ce,me,_e,le].some(function(t){return e[t]>=0})}function Rf(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=Rt(t,{elementContext:"reference"}),l=Rt(t,{altBoundary:!0}),f=Ss(a,r),d=Ss(l,i,o),g=Os(f),s=Os(d);t.modifiersData[n]={referenceClippingOffsets:f,popperEscapeOffsets:d,isReferenceHidden:g,hasPopperEscaped:s},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":g,"data-popper-escaped":s})}const ka={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Rf};function Hf(e,t,n){var r=Le(e),i=[le,ce].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=o[0],l=o[1];return a=a||0,l=(l||0)*i,[le,me].indexOf(r)>=0?{x:l,y:a}:{x:a,y:l}}function Bf(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=Ti.reduce(function(g,s){return g[s]=Hf(s,t.rects,o),g},{}),l=a[t.placement],f=l.x,d=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=f,t.modifiersData.popperOffsets.y+=d),t.modifiersData[r]=a}const Ra={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Bf};function Vf(e){var t=e.state,n=e.name;t.modifiersData[n]=Ia({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const Ii={name:"popperOffsets",enabled:!0,phase:"read",fn:Vf,data:{}};function jf(e){return e==="x"?"y":"x"}function Ff(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,l=a===void 0?!1:a,f=n.boundary,d=n.rootBoundary,g=n.altBoundary,s=n.padding,c=n.tether,u=c===void 0?!0:c,h=n.tetherOffset,_=h===void 0?0:h,p=Rt(t,{boundary:f,rootBoundary:d,padding:s,altBoundary:g}),m=Le(t.placement),b=kt(t.placement),O=!b,D=$i(m),M=jf(D),I=t.modifiersData.popperOffsets,V=t.rects.reference,F=t.rects.popper,$=typeof _=="function"?_(Object.assign({},t.rects,{placement:t.placement})):_,N=typeof $=="number"?{mainAxis:$,altAxis:$}:Object.assign({mainAxis:0,altAxis:0},$),U=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,Q={x:0,y:0};if(!!I){if(o){var w,E=D==="y"?ce:le,v=D==="y"?_e:me,A=D==="y"?"height":"width",y=I[D],x=y+p[E],S=y-p[v],P=u?-F[A]/2:0,B=b===pt?V[A]:F[A],k=b===pt?-F[A]:-V[A],j=t.elements.arrow,K=u&&j?xi(j):{width:0,height:0},Y=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Ca(),re=Y[E],oe=Y[v],z=en(0,V[A],K[A]),W=O?V[A]/2-P-z-re-N.mainAxis:B-z-re-N.mainAxis,J=O?-V[A]/2+P+z+oe+N.mainAxis:k+z+oe+N.mainAxis,we=t.elements.arrow&&dn(t.elements.arrow),Ae=we?D==="y"?we.clientTop||0:we.clientLeft||0:0,ns=(w=U==null?void 0:U[D])!=null?w:0,Tl=y+W-ns-Ae,Sl=y+J-ns,rs=en(u?Rn(x,Tl):x,y,u?at(S,Sl):S);I[D]=rs,Q[D]=rs-y}if(l){var is,Ol=D==="x"?ce:le,xl=D==="x"?_e:me,Ze=I[M],wn=M==="y"?"height":"width",ss=Ze+p[Ol],os=Ze-p[xl],vr=[ce,le].indexOf(m)!==-1,as=(is=U==null?void 0:U[M])!=null?is:0,cs=vr?ss:Ze-V[wn]-F[wn]-as+N.altAxis,ls=vr?Ze+V[wn]+F[wn]-as-N.altAxis:os,us=u&&vr?yf(cs,Ze,ls):en(u?cs:ss,Ze,u?ls:os);I[M]=us,Q[M]=us-Ze}t.modifiersData[r]=Q}}const Ha={name:"preventOverflow",enabled:!0,phase:"main",fn:Ff,requiresIfExists:["offset"]};function Wf(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Uf(e){return e===Oe(e)||!ye(e)?Ni(e):Wf(e)}function Yf(e){var t=e.getBoundingClientRect(),n=It(t.width)/e.offsetWidth||1,r=It(t.height)/e.offsetHeight||1;return n!==1||r!==1}function Kf(e,t,n){n===void 0&&(n=!1);var r=ye(t),i=ye(t)&&Yf(t),o=Qe(t),a=Pt(e,i),l={scrollLeft:0,scrollTop:0},f={x:0,y:0};return(r||!r&&!n)&&((Ie(t)!=="body"||Mi(o))&&(l=Uf(t)),ye(t)?(f=Pt(t,!0),f.x+=t.clientLeft,f.y+=t.clientTop):o&&(f.x=Li(o))),{x:a.left+l.scrollLeft-f.x,y:a.top+l.scrollTop-f.y,width:a.width,height:a.height}}function Gf(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(l){if(!n.has(l)){var f=t.get(l);f&&i(f)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function qf(e){var t=Gf(e);return xa.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function zf(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Xf(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var xs={placement:"bottom",modifiers:[],strategy:"absolute"};function $s(){for(var e=arguments.length,t=new Array(e),n=0;n{throw e},0)}function Ct(e,t,n={}){let r;return ue(e,t)(i=>r=i,n),r}function ue(...e){return Sc(...e)}var Sc=Oc;function J_(e){Sc=e}function Oc(e,t){let n={};Xr(n,e);let r=[n,...Ht(e)];if(typeof t=="function")return Z_(r,t);let i=tm(r,t,e);return Q_.bind(null,e,t,i)}function Z_(e,t){return(n=()=>{},{scope:r={},params:i=[]}={})=>{let o=t.apply(En([r,...e]),i);jn(n,o)}}var Mr={};function em(e,t){if(Mr[e])return Mr[e];let n=Object.getPrototypeOf(async function(){}).constructor,r=/^[\n\s]*if.*\(.*\)/.test(e)||/^(let|const)\s/.test(e)?`(() => { ${e} })()`:e,o=(()=>{try{return new n(["__self","scope"],`with (scope) { __self.result = ${r} }; __self.finished = true; return __self.result;`)}catch(a){return ln(a,t,e),Promise.resolve()}})();return Mr[e]=o,o}function tm(e,t,n){let r=em(t,n);return(i=()=>{},{scope:o={},params:a=[]}={})=>{r.result=void 0,r.finished=!1;let l=En([o,...e]);if(typeof r=="function"){let f=r(r,l).catch(d=>ln(d,n,t));r.finished?(jn(i,r.result,l,a,n),r.result=void 0):f.then(d=>{jn(i,d,l,a,n)}).catch(d=>ln(d,n,t)).finally(()=>r.result=void 0)}}}function jn(e,t,n,r,i){if(typeof t=="function"){let o=t.apply(n,r);o instanceof Promise?o.then(a=>jn(e,a,n,r)).catch(a=>ln(a,i,t)):e(o)}else e(t)}var Wi="x-";function Ut(e=""){return Wi+e}function nm(e){Wi=e}var xc={};function ee(e,t){xc[e]=t}function Ui(e,t,n){let r={};return Array.from(t).map(Lc((o,a)=>r[o]=a)).filter(Ic).map(om(r,n)).sort(am).map(o=>sm(e,o))}function rm(e){return Array.from(e).map(Lc()).filter(t=>!Ic(t))}var Qr=!1,Zt=new Map,$c=Symbol();function im(e){Qr=!0;let t=Symbol();$c=t,Zt.set(t,[]);let n=()=>{for(;Zt.get(t).length;)Zt.get(t).shift()();Zt.delete(t)},r=()=>{Qr=!1,n()};e(n),r()}function Cc(e){let t=[],n=l=>t.push(l),[r,i]=j_(e);return t.push(i),[{Alpine:bn,effect:r,cleanup:n,evaluateLater:ue.bind(ue,e),evaluate:Ct.bind(Ct,e)},()=>t.forEach(l=>l())]}function sm(e,t){let n=()=>{},r=xc[t.type]||n,[i,o]=Cc(e);U_(e,t.original,o);let a=()=>{e._x_ignore||e._x_ignoreSelf||(r.inline&&r.inline(e,t,i),r=r.bind(r,e,t,i),Qr?Zt.get($c).push(r):r())};return a.runCleanups=o,a}var Dc=(e,t)=>({name:n,value:r})=>(n.startsWith(e)&&(n=n.replace(e,t)),{name:n,value:r}),Nc=e=>e;function Lc(e=()=>{}){return({name:t,value:n})=>{let{name:r,value:i}=Mc.reduce((o,a)=>a(o),{name:t,value:n});return r!==t&&e(r,t),{name:r,value:i}}}var Mc=[];function Yi(e){Mc.push(e)}function Ic({name:e}){return Pc().test(e)}var Pc=()=>new RegExp(`^${Wi}([^:^.]+)\\b`);function om(e,t){return({name:n,value:r})=>{let i=n.match(Pc()),o=n.match(/:([a-zA-Z0-9\-:]+)/),a=n.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],l=t||e[n]||n;return{type:i?i[1]:null,value:o?o[1]:null,modifiers:a.map(f=>f.replace(".","")),expression:r,original:l}}}var Jr="DEFAULT",$n=["ignore","ref","data","id","bind","init","for","model","modelable","transition","show","if",Jr,"teleport","element"];function am(e,t){let n=$n.indexOf(e.type)===-1?Jr:e.type,r=$n.indexOf(t.type)===-1?Jr:t.type;return $n.indexOf(n)-$n.indexOf(r)}function on(e,t,n={}){e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0,composed:!0,cancelable:!0}))}var Zr=[],Ki=!1;function kc(e){Zr.push(e),queueMicrotask(()=>{Ki||setTimeout(()=>{ei()})})}function ei(){for(Ki=!1;Zr.length;)Zr.shift()()}function cm(){Ki=!0}function vt(e,t){if(typeof ShadowRoot=="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach(i=>vt(i,t));return}let n=!1;if(t(e,()=>n=!0),n)return;let r=e.firstElementChild;for(;r;)vt(r,t),r=r.nextElementSibling}function Fn(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}function lm(){document.body||Fn("Unable to initialize. Trying to load Alpine before `` is available. Did you forget to add `defer` in Alpine's `