varfrontexpress=function(){"use strict";functione(e){vart=void0,r=void0,i=void0,n=void0;if(e&&e.length>0){if(1===e.length)n=a(e,1)[0];else{varo=a(e,2);t=o[0],n=o[1]}ninstanceoff?i=n:(ninstanceofd||"function"==typeofn)&&(r=n)}return{baseUri:t,middleware:r,router:i,which:n}}vart=["GET","POST","PUT","PATCH","DELETE"],r="function"==typeofSymbol&&"symbol"==typeofSymbol.iterator?function(e){returntypeofe}:function(e){returne&&"function"==typeofSymbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeofe},i=function(e,t){if(!(einstanceoft))thrownewTypeError("Cannot call a class as a function")},n=function(){functione(e,t){for(varr=0;r<t.length;r++){vari=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"ini&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}returnfunction(t,r,i){returnr&&e(t.prototype,r),i&&e(t,i),t}}(),a=function(){functione(e,t){varr=[],i=!0,n=!1,a=void0;try{for(varo,u=e[Symbol.iterator]();!(i=(o=u.next()).done)&&(r.push(o.value),!t||r.length!==t);i=!0);}catch(e){n=!0,a=e}finally{try{!i&&u.return&&u.return()}finally{if(n)throwa}}returnr}returnfunction(t,r){if(Array.isArray(t))returnt;if(Symbol.iteratorinObject(t))returne(t,r);thrownewTypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(e){if(Array.isArray(e)){for(vart=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];returnr}returnArray.from(e)},u=function(){functione(){i(this,e)}returnn(e,[{key:"fetch",value:function(e,t,r){vari=e.method,n=e.uri,a=e.headers,o=e.data,u=function(r){t(e,{status:200,statusText:"OK",responseText:r})},s=function(t){vari=t.status,n=t.statusText,a=t.errorThrown;r(e,{status:i,statusText:n,errorThrown:a,errors:"HTTP "+i+" "+(n||"")})},d=newXMLHttpRequest;d.onreadystatechange=function(){4===d.readyState&&(200===d.status?u(d.responseText):s({status:d.status,statusText:d.statusText}))};try{d.open(i,n,!0),a&&Object.keys(a).forEach(function(e){d.setRequestHeader(e,a[e])}),o?d.send(o):d.send()}catch(e){s({errorThrown:e})}}}]),e}(),s=function(){functione(){i(this,e),this.settings={"http requester":newu,"http GET transformer":{uri:function(e){vart=e.uri,r=(e.headers,e.data);if(!r)returnt;vari=t,n="";if(/^(.*)(#.*)$/.exec(t)){varo=/^(.*)(#.*)$/.exec(t),u=a(o,3);i=u[1],n=u[2]}return(i=Object.keys(r).reduce(function(e,t,i){returne+=(0===i&&-1===e.indexOf("?")?"?":"&")+t+"="+r[t]},i))+n}}},this.rules={"http requester":function(e){if("function"!=typeofe.fetch)thrownewTypeError("setting http requester has no fetch method")}}}returnn(e,[{key:"set",value:function(e,t){varr=this.rules[e];r&&r(t),this.settings[e]=t}},{key:"get",value:function(e){returnthis.settings[e]}}]),e}(),d=function(){functione(){vart=arguments.length>0&&void0!==arguments[0]?arguments[0]:"";i(this,e),this.name=t}returnn(e,[{key:"entered",value:function(e){}},{key:"exited",value:function(e){}},{key:"updated",value:function(e,t){}},{key:"failed",value:function(e,t){}},{key:"next",value:function(){return!0}}]),e}(),h=function(){functione(t,r,n,a){i(this,e),this.router=t,this.uriPart=r,this.method=n,this.middleware=a,this.visited=!1}returnn(e,[{key:"uri",get:function(){if(this.uriPart||this.method){if(this.uriPartinstanceofRegExp)returnthis.uriPart;if(this.router.baseUriinstanceofRegExp)returnthis.router.baseUri;if(this.router.baseUri){vare=this.router.baseUri.trim();returnthis.uriPart?(e+this.uriPart.trim()).replace(/\/{2,}/,"/"):e}returnthis.uriPart}}}]),e}(),f=function(){functiona(e){i(this,a),this._baseUri=e,this._routes=[]}returnn(a,[{key:"_add",value:function(e){returnthis._routes.push(e),this}},{key:"routes",value:function(e,t){returnthis._routes.filter(function(r){if(r.method&&r.method!==t)return!1;if(!r.uri||!e)return!0;vari=/^(.*)\?.*#.*|(.*)(?=\?|#)|(.*[^\?#])$/.exec(e),n=i[1]||i[2]||i[3];returnr.uriinstanceofRegExp?n.match(r.uri):r.uri===n})}},{key:"visited",value:function(){returnthis._routes.filter(function(e){returne.visited})}},{key:"use",value:function(e){if(!(einstanceofd)&&"function"!=typeofe)thrownewTypeError("methodtakesatleas