minoteaur/static/client.js

13 lines
40 KiB
JavaScript

(()=>{var xr=Object.create,_e=Object.defineProperty,Er=Object.getPrototypeOf,Dr=Object.prototype.hasOwnProperty,Tr=Object.getOwnPropertyNames,qr=Object.getOwnPropertyDescriptor;var Cr=e=>_e(e,"__esModule",{value:!0});var M=(e,n)=>()=>(n||(n={exports:{}},e(n.exports,n)),n.exports);var Sr=(e,n,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let l of Tr(n))!Dr.call(e,l)&&l!=="default"&&_e(e,l,{get:()=>n[l],enumerable:!(a=qr(n,l))||a.enumerable});return e},jr=e=>e&&e.__esModule?e:Sr(Cr(_e(e!=null?xr(Er(e)):{},"default",{value:e,enumerable:!0})),e);var te=M((jn,pt)=>{"use strict";function ae(e,n,a,l,m,h){return{tag:e,key:n,attrs:a,children:l,text:m,dom:h,domSize:void 0,state:void 0,events:void 0,instance:void 0}}ae.normalize=function(e){return Array.isArray(e)?ae("[",void 0,void 0,ae.normalizeChildren(e),void 0,void 0):e==null||typeof e=="boolean"?null:typeof e=="object"?e:ae("#",void 0,void 0,String(e),void 0,void 0)};ae.normalizeChildren=function(e){var n=[];if(e.length){for(var a=e[0]!=null&&e[0].key!=null,l=1;l<e.length;l++)if((e[l]!=null&&e[l].key!=null)!==a)throw new TypeError("Vnodes must either always have keys or never have keys!");for(var l=0;l<e.length;l++)n[l]=ae.normalize(e[l])}return n};pt.exports=ae});var Fe=M((In,ht)=>{"use strict";var Ir=te();ht.exports=function(){var e=arguments[this],n=this+1,a;if(e==null?e={}:(typeof e!="object"||e.tag!=null||Array.isArray(e))&&(e={},n=this),arguments.length===n+1)a=arguments[n],Array.isArray(a)||(a=[a]);else for(a=[];n<arguments.length;)a.push(arguments[n++]);return Ir("",e.key,e,a)}});var Be=M((Pn,mt)=>{"use strict";var gt=te(),Pr=Fe(),Nr=/(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g,dt={},ue={}.hasOwnProperty;function yt(e){for(var n in e)if(ue.call(e,n))return!1;return!0}function Ar(e){for(var n,a="div",l=[],m={};n=Nr.exec(e);){var h=n[1],c=n[2];if(h===""&&c!=="")a=c;else if(h==="#")m.id=c;else if(h===".")l.push(c);else if(n[3][0]==="["){var o=n[6];o&&(o=o.replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\")),n[4]==="class"?l.push(o):m[n[4]]=o===""?o:o||!0}}return l.length>0&&(m.className=l.join(" ")),dt[e]={tag:a,attrs:m}}function Mr(e,n){var a=n.attrs,l=gt.normalizeChildren(n.children),m=ue.call(a,"class"),h=m?a.class:a.className;if(n.tag=e.tag,n.attrs=null,n.children=void 0,!yt(e.attrs)&&!yt(a)){var c={};for(var o in a)ue.call(a,o)&&(c[o]=a[o]);a=c}for(var o in e.attrs)ue.call(e.attrs,o)&&o!=="className"&&!ue.call(a,o)&&(a[o]=e.attrs[o]);(h!=null||e.attrs.className!=null)&&(a.className=h!=null?e.attrs.className!=null?String(e.attrs.className)+" "+String(h):h:e.attrs.className!=null?e.attrs.className:null),m&&(a.class=null);for(var o in a)if(ue.call(a,o)&&o!=="key"){n.attrs=a;break}return Array.isArray(l)&&l.length===1&&l[0]!=null&&l[0].tag==="#"?n.text=l[0].children:n.children=l,n}function vr(e){if(e==null||typeof e!="string"&&typeof e!="function"&&typeof e.view!="function")throw Error("The selector must be either a string or a component.");var n=Pr.apply(1,arguments);return typeof e=="string"&&(n.children=gt.normalizeChildren(n.children),e!=="[")?Mr(dt[e]||Ar(e),n):(n.tag=e,n)}mt.exports=vr});var bt=M((Nn,wt)=>{"use strict";var Or=te();wt.exports=function(e){return e==null&&(e=""),Or("<",void 0,void 0,e,void 0,void 0)}});var Et=M((An,xt)=>{"use strict";var Lr=te(),zr=Fe();xt.exports=function(){var e=zr.apply(0,arguments);return e.tag="[",e.children=Lr.normalizeChildren(e.children),e}});var Tt=M((Mn,Dt)=>{"use strict";var He=Be();He.trust=bt();He.fragment=Et();Dt.exports=He});var $e=M((vn,qt)=>{"use strict";var _=function(e){if(!(this instanceof _))throw new Error("Promise must be called with `new`");if(typeof e!="function")throw new TypeError("executor must be a function");var n=this,a=[],l=[],m=u(a,!0),h=u(l,!1),c=n._instance={resolvers:a,rejectors:l},o=typeof setImmediate=="function"?setImmediate:setTimeout;function u(w,x){return function T(y){var E;try{if(x&&y!=null&&(typeof y=="object"||typeof y=="function")&&typeof(E=y.then)=="function"){if(y===n)throw new TypeError("Promise can't be resolved w/ itself");d(E.bind(y))}else o(function(){!x&&w.length===0&&console.error("Possible unhandled promise rejection:",y);for(var p=0;p<w.length;p++)w[p](y);a.length=0,l.length=0,c.state=x,c.retry=function(){T(y)}})}catch(p){h(p)}}}function d(w){var x=0;function T(E){return function(p){x++>0||E(p)}}var y=T(h);try{w(T(m),y)}catch(E){y(E)}}d(e)};_.prototype.then=function(e,n){var a=this,l=a._instance;function m(u,d,w,x){d.push(function(T){if(typeof u!="function")w(T);else try{h(u(T))}catch(y){c&&c(y)}}),typeof l.retry=="function"&&x===l.state&&l.retry()}var h,c,o=new _(function(u,d){h=u,c=d});return m(e,l.resolvers,h,!0),m(n,l.rejectors,c,!1),o};_.prototype.catch=function(e){return this.then(null,e)};_.prototype.finally=function(e){return this.then(function(n){return _.resolve(e()).then(function(){return n})},function(n){return _.resolve(e()).then(function(){return _.reject(n)})})};_.resolve=function(e){return e instanceof _?e:new _(function(n){n(e)})};_.reject=function(e){return new _(function(n,a){a(e)})};_.all=function(e){return new _(function(n,a){var l=e.length,m=0,h=[];if(e.length===0)n([]);else for(var c=0;c<e.length;c++)(function(o){function u(d){m++,h[o]=d,m===l&&n(h)}e[o]!=null&&(typeof e[o]=="object"||typeof e[o]=="function")&&typeof e[o].then=="function"?e[o].then(u,a):u(e[o])})(c)})};_.race=function(e){return new _(function(n,a){for(var l=0;l<e.length;l++)e[l].then(n,a)})};qt.exports=_});var Ve=M((On,be)=>{"use strict";var pe=$e();typeof window!="undefined"?(typeof window.Promise=="undefined"?window.Promise=pe:window.Promise.prototype.finally||(window.Promise.prototype.finally=pe.prototype.finally),be.exports=window.Promise):typeof global!="undefined"?(typeof global.Promise=="undefined"?global.Promise=pe:global.Promise.prototype.finally||(global.Promise.prototype.finally=pe.prototype.finally),be.exports=global.Promise):be.exports=pe});var St=M((Ln,Ct)=>{"use strict";var ce=te();Ct.exports=function(e){var n=e&&e.document,a,l={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"};function m(r){return r.attrs&&r.attrs.xmlns||l[r.tag]}function h(r,t){if(r.state!==t)throw new Error("`vnode.state` must not be modified")}function c(r){var t=r.state;try{return this.apply(t,arguments)}finally{h(r,t)}}function o(){try{return n.activeElement}catch(r){return null}}function u(r,t,i,s,f,g,j){for(var I=i;I<s;I++){var D=t[I];D!=null&&d(r,D,f,j,g)}}function d(r,t,i,s,f){var g=t.tag;if(typeof g=="string")switch(t.state={},t.attrs!=null&&Ae(t.attrs,t,i),g){case"#":w(r,t,f);break;case"<":T(r,t,s,f);break;case"[":y(r,t,i,s,f);break;default:E(r,t,i,s,f)}else b(r,t,i,s,f)}function w(r,t,i){t.dom=n.createTextNode(t.children),ne(r,t.dom,i)}var x={caption:"table",thead:"table",tbody:"table",tfoot:"table",tr:"tbody",th:"tr",td:"tr",colgroup:"table",col:"colgroup"};function T(r,t,i,s){var f=t.children.match(/^\s*?<(\w+)/im)||[],g=n.createElement(x[f[1]]||"div");i==="http://www.w3.org/2000/svg"?(g.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+t.children+"</svg>",g=g.firstChild):g.innerHTML=t.children,t.dom=g.firstChild,t.domSize=g.childNodes.length,t.instance=[];for(var j=n.createDocumentFragment(),I;I=g.firstChild;)t.instance.push(I),j.appendChild(I);ne(r,j,s)}function y(r,t,i,s,f){var g=n.createDocumentFragment();if(t.children!=null){var j=t.children;u(g,j,0,j.length,i,null,s)}t.dom=g.firstChild,t.domSize=g.childNodes.length,ne(r,g,f)}function E(r,t,i,s,f){var g=t.tag,j=t.attrs,I=j&&j.is;s=m(t)||s;var D=s?I?n.createElementNS(s,g,{is:I}):n.createElementNS(s,g):I?n.createElement(g,{is:I}):n.createElement(g);if(t.dom=D,j!=null&&or(t,j,s),ne(r,D,f),!ie(t)&&(t.text!=null&&(t.text!==""?D.textContent=t.text:t.children=[ce("#",void 0,void 0,t.text,void 0,void 0)]),t.children!=null)){var N=t.children;u(D,N,0,N.length,i,null,s),t.tag==="select"&&j!=null&&hr(t,j)}}function p(r,t){var i;if(typeof r.tag.view=="function"){if(r.state=Object.create(r.tag),i=r.state.view,i.$$reentrantLock$$!=null)return;i.$$reentrantLock$$=!0}else{if(r.state=void 0,i=r.tag,i.$$reentrantLock$$!=null)return;i.$$reentrantLock$$=!0,r.state=r.tag.prototype!=null&&typeof r.tag.prototype.view=="function"?new r.tag(r):r.tag(r)}if(Ae(r.state,r,t),r.attrs!=null&&Ae(r.attrs,r,t),r.instance=ce.normalize(c.call(r.state.view,r)),r.instance===r)throw Error("A view cannot return the vnode it received as argument");i.$$reentrantLock$$=null}function b(r,t,i,s,f){p(t,i),t.instance!=null?(d(r,t.instance,i,s,f),t.dom=t.instance.dom,t.domSize=t.dom!=null?t.instance.domSize:0):t.domSize=0}function S(r,t,i,s,f,g){if(!(t===i||t==null&&i==null))if(t==null||t.length===0)u(r,i,0,i.length,s,f,g);else if(i==null||i.length===0)Y(r,t,0,t.length);else{var j=t[0]!=null&&t[0].key!=null,I=i[0]!=null&&i[0].key!=null,D=0,N=0;if(!j)for(;N<t.length&&t[N]==null;)N++;if(!I)for(;D<i.length&&i[D]==null;)D++;if(I===null&&j==null)return;if(j!==I)Y(r,t,N,t.length),u(r,i,D,i.length,s,f,g);else if(I){for(var V=t.length-1,U=i.length-1,we,K,z,B,A,Oe;V>=N&&U>=D&&(B=t[V],A=i[U],B.key===A.key);)B!==A&&O(r,B,A,s,f,g),A.dom!=null&&(f=A.dom),V--,U--;for(;V>=N&&U>=D&&(K=t[N],z=i[D],K.key===z.key);)N++,D++,K!==z&&O(r,K,z,s,Z(t,N,f),g);for(;V>=N&&U>=D&&!(D===U||K.key!==A.key||B.key!==z.key);)Oe=Z(t,N,f),J(r,B,Oe),B!==z&&O(r,B,z,s,Oe,g),++D<=--U&&J(r,K,f),K!==A&&O(r,K,A,s,f,g),A.dom!=null&&(f=A.dom),N++,V--,B=t[V],A=i[U],K=t[N],z=i[D];for(;V>=N&&U>=D&&B.key===A.key;)B!==A&&O(r,B,A,s,f,g),A.dom!=null&&(f=A.dom),V--,U--,B=t[V],A=i[U];if(D>U)Y(r,t,N,V+1);else if(N>V)u(r,i,D,U+1,s,f,g);else{var br=f,ot=U-D+1,oe=new Array(ot),Le=0,L=0,ze=2147483647,Re=0,we,Ue;for(L=0;L<ot;L++)oe[L]=-1;for(L=U;L>=D;L--){we==null&&(we=W(t,N,V+1)),A=i[L];var fe=we[A.key];fe!=null&&(ze=fe<ze?fe:-1,oe[L-D]=fe,B=t[fe],t[fe]=null,B!==A&&O(r,B,A,s,f,g),A.dom!=null&&(f=A.dom),Re++)}if(f=br,Re!==V-N+1&&Y(r,t,N,V+1),Re===0)u(r,i,D,U+1,s,f,g);else if(ze===-1)for(Ue=re(oe),Le=Ue.length-1,L=U;L>=D;L--)z=i[L],oe[L-D]===-1?d(r,z,s,g,f):Ue[Le]===L-D?Le--:J(r,z,f),z.dom!=null&&(f=i[L].dom);else for(L=U;L>=D;L--)z=i[L],oe[L-D]===-1&&d(r,z,s,g,f),z.dom!=null&&(f=i[L].dom)}}else{var ve=t.length<i.length?t.length:i.length;for(D=D<N?D:N;D<ve;D++)K=t[D],z=i[D],!(K===z||K==null&&z==null)&&(K==null?d(r,z,s,g,Z(t,D+1,f)):z==null?de(r,K):O(r,K,z,s,Z(t,D+1,f),g));t.length>ve&&Y(r,t,D,t.length),i.length>ve&&u(r,i,D,i.length,s,f,g)}}}function O(r,t,i,s,f,g){var j=t.tag,I=i.tag;if(j===I){if(i.state=t.state,i.events=t.events,wr(i,t))return;if(typeof j=="string")switch(i.attrs!=null&&Me(i.attrs,i,s),j){case"#":$(t,i);break;case"<":Q(r,t,i,g,f);break;case"[":v(r,t,i,s,f,g);break;default:C(t,i,s,g)}else R(r,t,i,s,f,g)}else de(r,t),d(r,i,s,g,f)}function $(r,t){r.children.toString()!==t.children.toString()&&(r.dom.nodeValue=t.children),t.dom=r.dom}function Q(r,t,i,s,f){t.children!==i.children?(lt(r,t),T(r,i,s,f)):(i.dom=t.dom,i.domSize=t.domSize,i.instance=t.instance)}function v(r,t,i,s,f,g){S(r,t.children,i.children,s,f,g);var j=0,I=i.children;if(i.dom=null,I!=null){for(var D=0;D<I.length;D++){var N=I[D];N!=null&&N.dom!=null&&(i.dom==null&&(i.dom=N.dom),j+=N.domSize||1)}j!==1&&(i.domSize=j)}}function C(r,t,i,s){var f=t.dom=r.dom;s=m(t)||s,t.tag==="textarea"&&(t.attrs==null&&(t.attrs={}),t.text!=null&&(t.attrs.value=t.text,t.text=void 0)),mr(t,r.attrs,t.attrs,s),ie(t)||(r.text!=null&&t.text!=null&&t.text!==""?r.text.toString()!==t.text.toString()&&(r.dom.firstChild.nodeValue=t.text):(r.text!=null&&(r.children=[ce("#",void 0,void 0,r.text,void 0,r.dom.firstChild)]),t.text!=null&&(t.children=[ce("#",void 0,void 0,t.text,void 0,void 0)]),S(f,r.children,t.children,i,null,s)))}function R(r,t,i,s,f,g){if(i.instance=ce.normalize(c.call(i.state.view,i)),i.instance===i)throw Error("A view cannot return the vnode it received as argument");Me(i.state,i,s),i.attrs!=null&&Me(i.attrs,i,s),i.instance!=null?(t.instance==null?d(r,i.instance,s,g,f):O(r,t.instance,i.instance,s,f,g),i.dom=i.instance.dom,i.domSize=i.instance.domSize):t.instance!=null?(de(r,t.instance),i.dom=void 0,i.domSize=0):(i.dom=t.dom,i.domSize=t.domSize)}function W(r,t,i){for(var s=Object.create(null);t<i;t++){var f=r[t];if(f!=null){var g=f.key;g!=null&&(s[g]=t)}}return s}var F=[];function re(r){for(var t=[0],i=0,s=0,f=0,g=F.length=r.length,f=0;f<g;f++)F[f]=r[f];for(var f=0;f<g;++f)if(r[f]!==-1){var j=t[t.length-1];if(r[j]<r[f]){F[f]=j,t.push(f);continue}for(i=0,s=t.length-1;i<s;){var I=(i>>>1)+(s>>>1)+(i&s&1);r[t[I]]<r[f]?i=I+1:s=I}r[f]<r[t[i]]&&(i>0&&(F[f]=t[i-1]),t[i]=f)}for(i=t.length,s=t[i-1];i-- >0;)t[i]=s,s=F[s];return F.length=0,t}function Z(r,t,i){for(;t<r.length;t++)if(r[t]!=null&&r[t].dom!=null)return r[t].dom;return i}function J(r,t,i){var s=n.createDocumentFragment();ge(r,s,t),ne(r,s,i)}function ge(r,t,i){for(;i.dom!=null&&i.dom.parentNode===r;){if(typeof i.tag!="string"){if(i=i.instance,i!=null)continue}else if(i.tag==="<")for(var s=0;s<i.instance.length;s++)t.appendChild(i.instance[s]);else if(i.tag!=="[")t.appendChild(i.dom);else if(i.children.length===1){if(i=i.children[0],i!=null)continue}else for(var s=0;s<i.children.length;s++){var f=i.children[s];f!=null&&ge(r,t,f)}break}}function ne(r,t,i){i!=null?r.insertBefore(t,i):r.appendChild(t)}function ie(r){if(r.attrs==null||r.attrs.contenteditable==null&&r.attrs.contentEditable==null)return!1;var t=r.children;if(t!=null&&t.length===1&&t[0].tag==="<"){var i=t[0].children;r.dom.innerHTML!==i&&(r.dom.innerHTML=i)}else if(r.text!=null||t!=null&&t.length!==0)throw new Error("Child node of a contenteditable must be trusted");return!0}function Y(r,t,i,s){for(var f=i;f<s;f++){var g=t[f];g!=null&&de(r,g)}}function de(r,t){var i=0,s=t.state,f,g;if(typeof t.tag!="string"&&typeof t.state.onbeforeremove=="function"){var j=c.call(t.state.onbeforeremove,t);j!=null&&typeof j.then=="function"&&(i=1,f=j)}if(t.attrs&&typeof t.attrs.onbeforeremove=="function"){var j=c.call(t.attrs.onbeforeremove,t);j!=null&&typeof j.then=="function"&&(i|=2,g=j)}if(h(t,s),!i)ye(t),Se(r,t);else{if(f!=null){var I=function(){i&1&&(i&=2,i||D())};f.then(I,I)}if(g!=null){var I=function(){i&2&&(i&=1,i||D())};g.then(I,I)}}function D(){h(t,s),ye(t),Se(r,t)}}function lt(r,t){for(var i=0;i<t.instance.length;i++)r.removeChild(t.instance[i])}function Se(r,t){for(;t.dom!=null&&t.dom.parentNode===r;){if(typeof t.tag!="string"){if(t=t.instance,t!=null)continue}else if(t.tag==="<")lt(r,t);else{if(t.tag!=="["&&(r.removeChild(t.dom),!Array.isArray(t.children)))break;if(t.children.length===1){if(t=t.children[0],t!=null)continue}else for(var i=0;i<t.children.length;i++){var s=t.children[i];s!=null&&Se(r,s)}}break}}function ye(r){if(typeof r.tag!="string"&&typeof r.state.onremove=="function"&&c.call(r.state.onremove,r),r.attrs&&typeof r.attrs.onremove=="function"&&c.call(r.attrs.onremove,r),typeof r.tag!="string")r.instance!=null&&ye(r.instance);else{var t=r.children;if(Array.isArray(t))for(var i=0;i<t.length;i++){var s=t[i];s!=null&&ye(s)}}}function or(r,t,i){for(var s in t)je(r,s,null,t[s],i)}function je(r,t,i,s,f){if(!(t==="key"||t==="is"||s==null||Ie(t)||i===s&&!gr(r,t)&&typeof s!="object")){if(t[0]==="o"&&t[1]==="n")return ct(r,t,s);if(t.slice(0,6)==="xlink:")r.dom.setAttributeNS("http://www.w3.org/1999/xlink",t.slice(6),s);else if(t==="style")ut(r.dom,i,s);else if(ft(r,t,f)){if(t==="value"&&((r.tag==="input"||r.tag==="textarea")&&r.dom.value===""+s&&r.dom===o()||r.tag==="select"&&i!==null&&r.dom.value===""+s||r.tag==="option"&&i!==null&&r.dom.value===""+s))return;r.tag==="input"&&t==="type"?r.dom.setAttribute(t,s):r.dom[t]=s}else typeof s=="boolean"?s?r.dom.setAttribute(t,""):r.dom.removeAttribute(t):r.dom.setAttribute(t==="className"?"class":t,s)}}function pr(r,t,i,s){if(!(t==="key"||t==="is"||i==null||Ie(t)))if(t[0]==="o"&&t[1]==="n"&&!Ie(t))ct(r,t,void 0);else if(t==="style")ut(r.dom,i,null);else if(ft(r,t,s)&&t!=="className"&&!(t==="value"&&(r.tag==="option"||r.tag==="select"&&r.dom.selectedIndex===-1&&r.dom===o()))&&!(r.tag==="input"&&t==="type"))r.dom[t]=null;else{var f=t.indexOf(":");f!==-1&&(t=t.slice(f+1)),i!==!1&&r.dom.removeAttribute(t==="className"?"class":t)}}function hr(r,t){if("value"in t)if(t.value===null)r.dom.selectedIndex!==-1&&(r.dom.value=null);else{var i=""+t.value;(r.dom.value!==i||r.dom.selectedIndex===-1)&&(r.dom.value=i)}"selectedIndex"in t&&je(r,"selectedIndex",null,t.selectedIndex,void 0)}function mr(r,t,i,s){if(i!=null)for(var f in i)je(r,f,t&&t[f],i[f],s);var g;if(t!=null)for(var f in t)(g=t[f])!=null&&(i==null||i[f]==null)&&pr(r,f,g,s)}function gr(r,t){return t==="value"||t==="checked"||t==="selectedIndex"||t==="selected"&&r.dom===o()||r.tag==="option"&&r.dom.parentNode===n.activeElement}function Ie(r){return r==="oninit"||r==="oncreate"||r==="onupdate"||r==="onremove"||r==="onbeforeremove"||r==="onbeforeupdate"}function ft(r,t,i){return i===void 0&&(r.tag.indexOf("-")>-1||r.attrs!=null&&r.attrs.is||t!=="href"&&t!=="list"&&t!=="form"&&t!=="width"&&t!=="height")&&t in r.dom}var dr=/[A-Z]/g;function yr(r){return"-"+r.toLowerCase()}function Pe(r){return r[0]==="-"&&r[1]==="-"?r:r==="cssFloat"?"float":r.replace(dr,yr)}function ut(r,t,i){if(t!==i)if(i==null)r.style.cssText="";else if(typeof i!="object")r.style.cssText=i;else if(t==null||typeof t!="object"){r.style.cssText="";for(var s in i){var f=i[s];f!=null&&r.style.setProperty(Pe(s),String(f))}}else{for(var s in i){var f=i[s];f!=null&&(f=String(f))!==String(t[s])&&r.style.setProperty(Pe(s),f)}for(var s in t)t[s]!=null&&i[s]==null&&r.style.removeProperty(Pe(s))}}function Ne(){this._=a}Ne.prototype=Object.create(null),Ne.prototype.handleEvent=function(r){var t=this["on"+r.type],i;typeof t=="function"?i=t.call(r.currentTarget,r):typeof t.handleEvent=="function"&&t.handleEvent(r),this._&&r.redraw!==!1&&(0,this._)(),i===!1&&(r.preventDefault(),r.stopPropagation())};function ct(r,t,i){if(r.events!=null){if(r.events[t]===i)return;i!=null&&(typeof i=="function"||typeof i=="object")?(r.events[t]==null&&r.dom.addEventListener(t.slice(2),r.events,!1),r.events[t]=i):(r.events[t]!=null&&r.dom.removeEventListener(t.slice(2),r.events,!1),r.events[t]=void 0)}else i!=null&&(typeof i=="function"||typeof i=="object")&&(r.events=new Ne,r.dom.addEventListener(t.slice(2),r.events,!1),r.events[t]=i)}function Ae(r,t,i){typeof r.oninit=="function"&&c.call(r.oninit,t),typeof r.oncreate=="function"&&i.push(c.bind(r.oncreate,t))}function Me(r,t,i){typeof r.onupdate=="function"&&i.push(c.bind(r.onupdate,t))}function wr(r,t){do{if(r.attrs!=null&&typeof r.attrs.onbeforeupdate=="function"){var i=c.call(r.attrs.onbeforeupdate,r,t);if(i!==void 0&&!i)break}if(typeof r.tag!="string"&&typeof r.state.onbeforeupdate=="function"){var i=c.call(r.state.onbeforeupdate,r,t);if(i!==void 0&&!i)break}return!1}while(!1);return r.dom=t.dom,r.domSize=t.domSize,r.instance=t.instance,r.attrs=t.attrs,r.children=t.children,r.text=t.text,!0}return function(r,t,i){if(!r)throw new TypeError("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.");var s=[],f=o(),g=r.namespaceURI;r.vnodes==null&&(r.textContent=""),t=ce.normalizeChildren(Array.isArray(t)?t:[t]);var j=a;try{a=typeof i=="function"?i:void 0,S(r,r.vnodes,t,s,null,g==="http://www.w3.org/1999/xhtml"?void 0:g)}finally{a=j}r.vnodes=t,f!=null&&o()!==f&&typeof f.focus=="function"&&f.focus();for(var I=0;I<s.length;I++)s[I]()}}});var Ke=M((zn,jt)=>{"use strict";jt.exports=St()(window)});var Nt=M((Rn,It)=>{"use strict";var Pt=te();It.exports=function(e,n,a){var l=[],m=!1,h=!1;function c(){if(m)throw new Error("Nested m.redraw.sync() call");m=!0;for(var d=0;d<l.length;d+=2)try{e(l[d],Pt(l[d+1]),o)}catch(w){a.error(w)}m=!1}function o(){h||(h=!0,n(function(){h=!1,c()}))}o.sync=c;function u(d,w){if(w!=null&&w.view==null&&typeof w!="function")throw new TypeError("m.mount(element, component) expects a component, not a vnode");var x=l.indexOf(d);x>=0&&(l.splice(x,2),e(d,[],o)),w!=null&&(l.push(d,w),e(d,Pt(w),o))}return{mount:u,redraw:o}}});var xe=M((Un,At)=>{"use strict";var Rr=Ke();At.exports=Nt()(Rr,requestAnimationFrame,console)});var ke=M((_n,Mt)=>{"use strict";Mt.exports=function(e){if(Object.prototype.toString.call(e)!=="[object Object]")return"";var n=[];for(var a in e)l(a,e[a]);return n.join("&");function l(m,h){if(Array.isArray(h))for(var c=0;c<h.length;c++)l(m+"["+c+"]",h[c]);else if(Object.prototype.toString.call(h)==="[object Object]")for(var c in h)l(m+"["+c+"]",h[c]);else n.push(encodeURIComponent(m)+(h!=null&&h!==""?"="+encodeURIComponent(h):""))}}});var Qe=M((Fn,vt)=>{"use strict";vt.exports=Object.assign||function(e,n){n&&Object.keys(n).forEach(function(a){e[a]=n[a]})}});var Ee=M((Bn,Ot)=>{"use strict";var Ur=ke(),_r=Qe();Ot.exports=function(e,n){if(/:([^\/\.-]+)(\.{3})?:/.test(e))throw new SyntaxError("Template parameter names *must* be separated");if(n==null)return e;var a=e.indexOf("?"),l=e.indexOf("#"),m=l<0?e.length:l,h=a<0?m:a,c=e.slice(0,h),o={};_r(o,n);var u=c.replace(/:([^\/\.-]+)(\.{3})?/g,function(p,b,S){return delete o[b],n[b]==null?p:S?n[b]:encodeURIComponent(String(n[b]))}),d=u.indexOf("?"),w=u.indexOf("#"),x=w<0?u.length:w,T=d<0?x:d,y=u.slice(0,T);a>=0&&(y+=e.slice(a,m)),d>=0&&(y+=(a<0?"?":"&")+u.slice(d,x));var E=Ur(o);return E&&(y+=(a<0&&d<0?"?":"&")+E),l>=0&&(y+=e.slice(l)),w>=0&&(y+=(l<0?"":"&")+u.slice(w)),y}});var zt=M((Hn,Lt)=>{"use strict";var Fr=Ee();Lt.exports=function(e,n,a){var l=0;function m(o){return new n(o)}m.prototype=n.prototype,m.__proto__=n;function h(o){return function(u,d){typeof u!="string"?(d=u,u=u.url):d==null&&(d={});var w=new n(function(E,p){o(Fr(u,d.params),d,function(b){if(typeof d.type=="function")if(Array.isArray(b))for(var S=0;S<b.length;S++)b[S]=new d.type(b[S]);else b=new d.type(b);E(b)},p)});if(d.background===!0)return w;var x=0;function T(){--x==0&&typeof a=="function"&&a()}return y(w);function y(E){var p=E.then;return E.constructor=m,E.then=function(){x++;var b=p.apply(E,arguments);return b.then(T,function(S){if(T(),x===0)throw S}),y(b)},E}}}function c(o,u){for(var d in o.headers)if({}.hasOwnProperty.call(o.headers,d)&&u.test(d))return!0;return!1}return{request:h(function(o,u,d,w){var x=u.method!=null?u.method.toUpperCase():"GET",T=u.body,y=(u.serialize==null||u.serialize===JSON.serialize)&&!(T instanceof e.FormData),E=u.responseType||(typeof u.extract=="function"?"":"json"),p=new e.XMLHttpRequest,b=!1,S=p,O,$=p.abort;p.abort=function(){b=!0,$.call(this)},p.open(x,o,u.async!==!1,typeof u.user=="string"?u.user:void 0,typeof u.password=="string"?u.password:void 0),y&&T!=null&&!c(u,/^content-type$/i)&&p.setRequestHeader("Content-Type","application/json; charset=utf-8"),typeof u.deserialize!="function"&&!c(u,/^accept$/i)&&p.setRequestHeader("Accept","application/json, text/*"),u.withCredentials&&(p.withCredentials=u.withCredentials),u.timeout&&(p.timeout=u.timeout),p.responseType=E;for(var Q in u.headers)({}).hasOwnProperty.call(u.headers,Q)&&p.setRequestHeader(Q,u.headers[Q]);p.onreadystatechange=function(v){if(!b&&v.target.readyState===4)try{var C=v.target.status>=200&&v.target.status<300||v.target.status===304||/^file:\/\//i.test(o),R=v.target.response,W;if(E==="json"?!v.target.responseType&&typeof u.extract!="function"&&(R=JSON.parse(v.target.responseText)):(!E||E==="text")&&R==null&&(R=v.target.responseText),typeof u.extract=="function"?(R=u.extract(v.target,u),C=!0):typeof u.deserialize=="function"&&(R=u.deserialize(R)),C)d(R);else{try{W=v.target.responseText}catch(re){W=R}var F=new Error(W);F.code=v.target.status,F.response=R,w(F)}}catch(re){w(re)}},typeof u.config=="function"&&(p=u.config(p,u,o)||p,p!==S&&(O=p.abort,p.abort=function(){b=!0,O.call(this)})),T==null?p.send():typeof u.serialize=="function"?p.send(u.serialize(T)):T instanceof e.FormData?p.send(T):p.send(JSON.stringify(T))}),jsonp:h(function(o,u,d,w){var x=u.callbackName||"_mithril_"+Math.round(Math.random()*1e16)+"_"+l++,T=e.document.createElement("script");e[x]=function(y){delete e[x],T.parentNode.removeChild(T),d(y)},T.onerror=function(){delete e[x],T.parentNode.removeChild(T),w(new Error("JSONP request failed"))},T.src=o+(o.indexOf("?")<0?"?":"&")+encodeURIComponent(u.callbackKey||"callback")+"="+encodeURIComponent(x),e.document.documentElement.appendChild(T)})}}});var Ut=M(($n,Rt)=>{"use strict";var Br=Ve(),Hr=xe();Rt.exports=zt()(window,Br,Hr.redraw)});var We=M((Vn,_t)=>{"use strict";_t.exports=function(e){if(e===""||e==null)return{};e.charAt(0)==="?"&&(e=e.slice(1));for(var n=e.split("&"),a={},l={},m=0;m<n.length;m++){var h=n[m].split("="),c=decodeURIComponent(h[0]),o=h.length===2?decodeURIComponent(h[1]):"";o==="true"?o=!0:o==="false"&&(o=!1);var u=c.split(/\]\[?|\[/),d=l;c.indexOf("[")>-1&&u.pop();for(var w=0;w<u.length;w++){var x=u[w],T=u[w+1],y=T==""||!isNaN(parseInt(T,10));if(x===""){var c=u.slice(0,w).join();a[c]==null&&(a[c]=Array.isArray(d)?d.length:0),x=a[c]++}else if(x==="__proto__")break;if(w===u.length-1)d[x]=o;else{var E=Object.getOwnPropertyDescriptor(d,x);E!=null&&(E=E.value),E==null&&(d[x]=E=y?[]:{}),d=E}}}return l}});var De=M((Kn,Ft)=>{"use strict";var $r=We();Ft.exports=function(e){var n=e.indexOf("?"),a=e.indexOf("#"),l=a<0?e.length:a,m=n<0?l:n,h=e.slice(0,m).replace(/\/{2,}/g,"/");return h?(h[0]!=="/"&&(h="/"+h),h.length>1&&h[h.length-1]==="/"&&(h=h.slice(0,-1))):h="/",{path:h,params:n<0?{}:$r(e.slice(n+1,l))}}});var Ht=M((kn,Bt)=>{"use strict";var Vr=De();Bt.exports=function(e){var n=Vr(e),a=Object.keys(n.params),l=[],m=new RegExp("^"+n.path.replace(/:([^\/.-]+)(\.{3}|\.(?!\.)|-)?|[\\^$*+.()|\[\]{}]/g,function(h,c,o){return c==null?"\\"+h:(l.push({k:c,r:o==="..."}),o==="..."?"(.*)":o==="."?"([^/]+)\\.":"([^/]+)"+(o||""))})+"$");return function(h){for(var c=0;c<a.length;c++)if(n.params[a[c]]!==h.params[a[c]])return!1;if(!l.length)return m.test(h.path);var o=m.exec(h.path);if(o==null)return!1;for(var c=0;c<l.length;c++)h.params[l[c].k]=l[c].r?o[c+1]:decodeURIComponent(o[c+1]);return!0}}});var kt=M((Qn,$t)=>{"use strict";var Kr=te(),kr=Be(),Qr=Ve(),Wr=Ee(),Vt=De(),Jr=Ht(),Kt=Qe(),Je={};$t.exports=function(e,n){var a;function l(x,T,y){if(x=Wr(x,T),a!=null){a();var E=y?y.state:null,p=y?y.title:null;y&&y.replace?e.history.replaceState(E,p,w.prefix+x):e.history.pushState(E,p,w.prefix+x)}else e.location.href=w.prefix+x}var m=Je,h,c,o,u,d=w.SKIP={};function w(x,T,y){if(x==null)throw new Error("Ensure the DOM element that was passed to `m.route` is not undefined");var E=0,p=Object.keys(y).map(function(C){if(C[0]!=="/")throw new SyntaxError("Routes must start with a `/`");if(/:([^\/\.-]+)(\.{3})?:/.test(C))throw new SyntaxError("Route parameter names must be separated with either `/`, `.`, or `-`");return{route:C,component:y[C],check:Jr(C)}}),b=typeof setImmediate=="function"?setImmediate:setTimeout,S=Qr.resolve(),O=!1,$;if(a=null,T!=null){var Q=Vt(T);if(!p.some(function(C){return C.check(Q)}))throw new ReferenceError("Default route doesn't match any known routes")}function v(){O=!1;var C=e.location.hash;w.prefix[0]!=="#"&&(C=e.location.search+C,w.prefix[0]!=="?"&&(C=e.location.pathname+C,C[0]!=="/"&&(C="/"+C)));var R=C.concat().replace(/(?:%[a-f89][a-f0-9])+/gim,decodeURIComponent).slice(w.prefix.length),W=Vt(R);Kt(W.params,e.history.state);function F(){if(R===T)throw new Error("Could not resolve default route "+T);l(T,null,{replace:!0})}re(0);function re(Z){for(;Z<p.length;Z++)if(p[Z].check(W)){var J=p[Z].component,ge=p[Z].route,ne=J,ie=u=function(Y){if(ie===u){if(Y===d)return re(Z+1);h=Y!=null&&(typeof Y.view=="function"||typeof Y=="function")?Y:"div",c=W.params,o=R,u=null,m=J.render?J:null,E===2?n.redraw():(E=2,n.redraw.sync())}};J.view||typeof J=="function"?(J={},ie(ne)):J.onmatch?S.then(function(){return J.onmatch(W.params,R,ge)}).then(ie,F):ie("div");return}F()}}return a=function(){O||(O=!0,b(v))},typeof e.history.pushState=="function"?($=function(){e.removeEventListener("popstate",a,!1)},e.addEventListener("popstate",a,!1)):w.prefix[0]==="#"&&(a=null,$=function(){e.removeEventListener("hashchange",v,!1)},e.addEventListener("hashchange",v,!1)),n.mount(x,{onbeforeupdate:function(){return E=E?2:1,!(!E||Je===m)},oncreate:v,onremove:$,view:function(){if(!(!E||Je===m)){var C=[Kr(h,c.key,c)];return m&&(C=m.render(C[0])),C}}})}return w.set=function(x,T,y){u!=null&&(y=y||{},y.replace=!0),u=null,l(x,T,y)},w.get=function(){return o},w.prefix="#!",w.Link={view:function(x){var T=x.attrs.options,y={},E,p;Kt(y,x.attrs),y.selector=y.options=y.key=y.oninit=y.oncreate=y.onbeforeupdate=y.onupdate=y.onbeforeremove=y.onremove=null;var b=kr(x.attrs.selector||"a",y,x.children);return(b.attrs.disabled=Boolean(b.attrs.disabled))?(b.attrs.href=null,b.attrs["aria-disabled"]="true",b.attrs.onclick=null):(E=b.attrs.onclick,p=b.attrs.href,b.attrs.href=w.prefix+p,b.attrs.onclick=function(S){var O;typeof E=="function"?O=E.call(S.currentTarget,S):E==null||typeof E!="object"||typeof E.handleEvent=="function"&&E.handleEvent(S),O!==!1&&!S.defaultPrevented&&(S.button===0||S.which===0||S.which===1)&&(!S.currentTarget.target||S.currentTarget.target==="_self")&&!S.ctrlKey&&!S.metaKey&&!S.shiftKey&&!S.altKey&&(S.preventDefault(),S.redraw=!1,w.set(p,null,T))}),b}},w.param=function(x){return c&&x!=null?c[x]:c},w}});var Wt=M((Wn,Qt)=>{"use strict";var Zr=xe();Qt.exports=kt()(window,Zr)});var Gt=M((Jn,Jt)=>{"use strict";var Te=Tt(),Zt=Ut(),Yt=xe(),H=function(){return Te.apply(this,arguments)};H.m=Te;H.trust=Te.trust;H.fragment=Te.fragment;H.mount=Yt.mount;H.route=Wt();H.render=Ke();H.redraw=Yt.redraw;H.request=Zt.request;H.jsonp=Zt.jsonp;H.parseQueryString=We();H.buildQueryString=ke();H.parsePathname=De();H.buildPathname=Ee();H.vnode=te();H.PromisePolyfill=$e();Jt.exports=H});var cr=M(()=>{var P=jr(Gt()),st=ir("minoteaur",1,{upgrade:(e,n)=>{n<1&&e.createObjectStore("drafts")},blocking:()=>{window.location.reload()}});st.then(e=>{window.idb=e});var hn=(e,n=250)=>{let a;return(...l)=>{clearTimeout(a),a=setTimeout(e,n,...l)}},k={showingSearchDialog:!1,searchResults:[],searchError:null,searchQuery:""},mn=([e,...n])=>e.toLowerCase()+n.join(""),gn=([e,...n])=>e.toUpperCase()+n.join(""),dn=e=>e.split(/[ _]/).map(mn).join("_"),yn=e=>e.split(/[ _]/).map(gn).join(" "),me=(e,n)=>{let a=`/${encodeURIComponent(dn(e))}`;return n&&(a+="/"+n),a},wn=e=>{window.lastError=e,console.warn(e);let n=`HTTP error ${e.code}`;e.message!==null&&(n+=" "+e.message),k.searchError=n},bn=e=>{let n=e.target.value;k.searchQuery=n,P.default.request({url:"/api/search",params:{q:n}}).then(a=>{typeof a=="string"?(console.warn(a),k.searchError=a):(k.searchResults=a,k.searchError=null)},wn)},le=yn(decodeURIComponent(/^\/([^/]+)/.exec(location.pathname)[1]).replace(/\+/g," "));if(le==="Login")return;var xn=e=>{if(e.code==="Enter"){let n=k.searchResults.filter(a=>a.page!==le);n[0]&&(location.href=me(n[0].page))}},En={view:()=>P.default(".dialog.search",[P.default("h1","Search"),P.default("input[type=search]",{placeholder:"Query",oninput:bn,onkeydown:xn,value:k.searchQuery,oncreate:({dom:e})=>e.focus()}),k.searchError&&P.default(".error",k.searchError),P.default("ul",k.searchResults.map(e=>P.default("li",[P.default(".flex-space",[P.default("a.wikilink",{href:me(e.page)},e.page),P.default("",e.rank.toFixed(3))]),P.default("",e.snippet.map(n=>n[0]?P.default("span.highlight",n[1]):n[1]))])))])},Dn={view:()=>P.default("",k.showingSearchDialog?P.default(En):null)},fr=document.createElement("div");document.querySelector("main").insertBefore(fr,document.querySelector(".header"));P.default.mount(fr,Dn);var Tn=document.querySelector("nav .search");Tn.addEventListener("click",e=>{k.showingSearchDialog=!k.showingSearchDialog,e.preventDefault(),P.default.redraw()});document.body.addEventListener("keydown",e=>{e.target===document.body&&(e.key==="e"?location.pathname=me(le,"edit"):e.key==="v"?location.pathname=me(le):e.key==="r"?location.pathname=me(le,"revisions"):e.key==="/"&&(k.showingSearchDialog=!k.showingSearchDialog,e.preventDefault(),P.default.redraw()))});var ur=e=>at(e,"yyyy-MM-dd HH:mm:ss"),qn=e=>{let n=0;for(let a of e.split(/\s+/))/[^#*+>|`-]/.test(a)&&(n+=1);return n},Cn=e=>e.split(`
`).length,q=document.querySelector(".edit-form textarea");if(q){let e={keypresses:0,draftSelected:!1,pendingFiles:new Map},n=document.createElement("div");document.querySelector(".sidebar").appendChild(n);let a=Infinity,l=()=>{let p=document.body.scrollTop;(q.scrollHeight+2!=q.style.height.slice(0,-2)||a>q.value.length)&&(q.style.height="0px",q.style.height=`${Math.max(q.scrollHeight+2,100)}px`,document.body.scrollTop=p),a=q.value.length},m=parseInt(document.querySelector("input[name=last-edit]").value),h=q.value,c=JSON.parse(document.querySelector("input[name=associated-files]").value).map(({filename:p,mimeType:b})=>({file:{name:p,type:b,state:"uploaded"},state:"preexisting"})),o=()=>{!e.initialDraft||(e.draftSelected=!0,q.value=e.initialDraft.text,l())},u=()=>{console.log("server value swapped in, allegedly?"),e.draftSelected=!1,console.log(q.value,h),q.value=h,l()};st.then(p=>p.get("drafts",le)).then(p=>{e.initialDraft=p,console.log("found draft ",p),p&&p.ts>m&&o(),P.default.redraw()});let d={view:()=>e.initialDraft==null?"No draft":[P.default(e.draftSelected?".selected":"",{onclick:o},`Draft from ${ur(e.initialDraft.ts)}`),m>0&&P.default(e.draftSelected?"":".selected",{onclick:u},`Page from ${ur(m)}`)]},w=()=>{let p=document.createElement("input");p.type="file",p.multiple=!0,p.click(),p.oninput=b=>{for(let S of b.target.files)e.pendingFiles.set(S.name,{file:S,state:"pending"}),window.file=S;b.target.files.length>0&&P.default.redraw()}},x={view:({attrs:p})=>P.default("li.file",[P.default("",p.file.name),P.default("",p.state)])},T={view:()=>[P.default("button.upload",{onclick:w},"Upload"),P.default("ul.files",c.concat(Array.from(e.pendingFiles.values())).map(p=>P.default(x,{...p,key:p.file.name}))),P.default("",`${e.chars} chars`),P.default("",`${e.words} words`),P.default("",`${e.lines} lines`),P.default("",`${e.keypresses} keypresses`),P.default(d)]},y=p=>{e.words=qn(p),e.lines=Cn(p),e.chars=p.length};y(q.value),P.default.mount(n,T),q.addEventListener("keypress",p=>{let b=q.selectionStart,S=q.selectionEnd;if(b!==S)return;let O=`
`+q.value.substr(0,b),$=O.lastIndexOf(`
`)+1,Q=b+(q.value.substr(b)+`
`).indexOf(`
`);if(p.code==="Enter"){if(p.ctrlKey){q.parentElement.submit();return}let v=O.substr($),C=/^(\s*)(([*+-])|(\d+)([).]))(\s*)/.exec(v);if(C){let R=C[1]+(C[4]?(parseInt(C[4])+1).toString()+C[5]:C[2])+C[6],W=q.value.slice(b,Q),F=q.value.substr(0,b)+`
`+R;q.value=F+W+q.value.substr(Q),q.selectionStart=q.selectionEnd=F.length,l(),p.preventDefault()}}}),q.addEventListener("keydown",p=>{let b=q.selectionStart,S=q.selectionEnd;if(b!==S)return;let $=(`
`+q.value.substr(0,b)).lastIndexOf(`
`),Q=b+(q.value.substr(b)+`
`).indexOf(`
`);if(p.code==="Backspace"){if(/^\s*([*+-]|\d+[).])\s*$/y.test(q.value.slice($,b))){let C=q.value.substr(0,$),R=q.value.substr(b);q.value=C+R,q.selectionStart=q.selectionEnd=C.length,l(),p.preventDefault()}}else if(p.code==="Tab"){let v=/^(\s*)([*+-]|\d+[).])/.exec(q.value.slice($,Q)),C=q.value.substr($);p.shiftKey?C=C.replace(/^ /,""):C=" "+C,v&&(q.value=q.value.substr(0,$)+C,q.selectionStart=q.selectionEnd=b+(p.shiftKey?-2:2),l(),p.preventDefault())}e.keypresses++,P.default.redraw()});let E=hn(()=>{st.then(p=>p.put("drafts",{text:q.value,ts:Date.now()},le)),console.log("saved")});q.addEventListener("input",()=>{l(),y(q.value),E()}),l()}});var Yr=(e,n)=>n.some(a=>e instanceof a),Xt,er;function Gr(){return Xt||(Xt=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Xr(){return er||(er=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}var tr=new WeakMap,Ze=new WeakMap,rr=new WeakMap,Ye=new WeakMap,Ge=new WeakMap;function en(e){let n=new Promise((a,l)=>{let m=()=>{e.removeEventListener("success",h),e.removeEventListener("error",c)},h=()=>{a(X(e.result)),m()},c=()=>{l(e.error),m()};e.addEventListener("success",h),e.addEventListener("error",c)});return n.then(a=>{a instanceof IDBCursor&&tr.set(a,e)}).catch(()=>{}),Ge.set(n,e),n}function tn(e){if(Ze.has(e))return;let n=new Promise((a,l)=>{let m=()=>{e.removeEventListener("complete",h),e.removeEventListener("error",c),e.removeEventListener("abort",c)},h=()=>{a(),m()},c=()=>{l(e.error||new DOMException("AbortError","AbortError")),m()};e.addEventListener("complete",h),e.addEventListener("error",c),e.addEventListener("abort",c)});Ze.set(e,n)}var Xe={get(e,n,a){if(e instanceof IDBTransaction){if(n==="done")return Ze.get(e);if(n==="objectStoreNames")return e.objectStoreNames||rr.get(e);if(n==="store")return a.objectStoreNames[1]?void 0:a.objectStore(a.objectStoreNames[0])}return X(e[n])},set(e,n,a){return e[n]=a,!0},has(e,n){return e instanceof IDBTransaction&&(n==="done"||n==="store")?!0:n in e}};function nr(e){Xe=e(Xe)}function rn(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(n,...a){let l=e.call(qe(this),n,...a);return rr.set(l,n.sort?n.sort():[n]),X(l)}:Xr().includes(e)?function(...n){return e.apply(qe(this),n),X(tr.get(this))}:function(...n){return X(e.apply(qe(this),n))}}function nn(e){return typeof e=="function"?rn(e):(e instanceof IDBTransaction&&tn(e),Yr(e,Gr())?new Proxy(e,Xe):e)}function X(e){if(e instanceof IDBRequest)return en(e);if(Ye.has(e))return Ye.get(e);let n=nn(e);return n!==e&&(Ye.set(e,n),Ge.set(n,e)),n}var qe=e=>Ge.get(e);function ir(e,n,{blocked:a,upgrade:l,blocking:m,terminated:h}={}){let c=indexedDB.open(e,n),o=X(c);return l&&c.addEventListener("upgradeneeded",u=>{l(X(c.result),u.oldVersion,u.newVersion,X(c.transaction))}),a&&c.addEventListener("blocked",()=>a()),o.then(u=>{h&&u.addEventListener("close",()=>h()),m&&u.addEventListener("versionchange",()=>m())}).catch(()=>{}),o}var an=["get","getKey","getAll","getAllKeys","count"],sn=["put","add","delete","clear"],et=new Map;function ar(e,n){if(!(e instanceof IDBDatabase&&!(n in e)&&typeof n=="string"))return;if(et.get(n))return et.get(n);let a=n.replace(/FromIndex$/,""),l=n!==a,m=sn.includes(a);if(!(a in(l?IDBIndex:IDBObjectStore).prototype)||!(m||an.includes(a)))return;let h=async function(c,...o){let u=this.transaction(c,m?"readwrite":"readonly"),d=u.store;return l&&(d=d.index(o.shift())),(await Promise.all([d[a](...o),m&&u.done]))[0]};return et.set(n,h),h}nr(e=>({...e,get:(n,a,l)=>ar(n,a)||e.get(n,a,l),has:(n,a)=>!!ar(n,a)||e.has(n,a)}));function he(e){if(e===null||e===!0||e===!1)return NaN;var n=Number(e);return isNaN(n)?n:n<0?Math.ceil(n):Math.floor(n)}function G(e,n){if(n.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+n.length+" present")}function se(e){G(1,arguments);var n=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&n==="[object Date]"?new Date(e.getTime()):typeof e=="number"||n==="[object Number]"?new Date(e):((typeof e=="string"||n==="[object String]")&&typeof console!="undefined"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn(new Error().stack)),new Date(NaN))}function tt(e,n){G(2,arguments);var a=se(e).getTime(),l=he(n);return new Date(a+l)}var Ce=6e4;function sr(e){return e.getTime()%Ce}function rt(e){var n=new Date(e.getTime()),a=Math.ceil(n.getTimezoneOffset());n.setSeconds(0,0);var l=a>0,m=l?(Ce+sr(n))%Ce:sr(n);return a*Ce+m}function nt(e){G(1,arguments);var n=se(e);return!isNaN(n)}function it(e,n){G(2,arguments);var a=he(n);return tt(e,-a)}function ee(e,n){for(var a=e<0?"-":"",l=Math.abs(e).toString();l.length<n;)l="0"+l;return a+l}var ln={y:function(e,n){var a=e.getUTCFullYear(),l=a>0?a:1-a;return ee(n==="yy"?l%100:l,n.length)},M:function(e,n){var a=e.getUTCMonth();return n==="M"?String(a+1):ee(a+1,2)},d:function(e,n){return ee(e.getUTCDate(),n.length)},a:function(e,n){var a=e.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return a.toUpperCase();case"aaa":return a;case"aaaaa":return a[0];case"aaaa":default:return a==="am"?"a.m.":"p.m."}},h:function(e,n){return ee(e.getUTCHours()%12||12,n.length)},H:function(e,n){return ee(e.getUTCHours(),n.length)},m:function(e,n){return ee(e.getUTCMinutes(),n.length)},s:function(e,n){return ee(e.getUTCSeconds(),n.length)},S:function(e,n){var a=n.length,l=e.getUTCMilliseconds(),m=Math.floor(l*Math.pow(10,a-3));return ee(m,n.length)}},lr=ln;var fn=/(\w)\1*|''|'(''|[^'])+('|$)|./g,un=/^'([^]*?)'?$/,cn=/''/g,on=/[a-zA-Z]/;function at(e,n){G(2,arguments);var a=String(n),l=se(e);if(!nt(l))throw new RangeError("Invalid time value");var m=rt(l),h=it(l,m),c=a.match(fn).map(function(o){if(o==="''")return"'";var u=o[0];if(u==="'")return pn(o);var d=lr[u];if(d)return d(h,o,null,{});if(u.match(on))throw new RangeError("Format string contains an unescaped latin alphabet character `"+u+"`");return o}).join("");return c}function pn(e){return e.match(un)[1].replace(cn,"'")}cr();})();
//# sourceMappingURL=client.js.map