From 8fe49c460f4bf94445f7a5e4a2a56870ab0263f4 Mon Sep 17 00:00:00 2001 From: mrkvon Date: Fri, 4 Oct 2024 15:02:27 +0000 Subject: [PATCH] deploy: 2073f82af98a79be0dc16db1602c8239baafa69c --- asset-manifest.json | 6 +++--- index.html | 2 +- static/js/main.75d035ed.js | 9 --------- static/js/main.d86ae06e.js | 9 +++++++++ ...035ed.js.LICENSE.txt => main.d86ae06e.js.LICENSE.txt} | 0 static/js/{main.75d035ed.js.map => main.d86ae06e.js.map} | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) delete mode 100644 static/js/main.75d035ed.js create mode 100644 static/js/main.d86ae06e.js rename static/js/{main.75d035ed.js.LICENSE.txt => main.d86ae06e.js.LICENSE.txt} (100%) rename static/js/{main.75d035ed.js.map => main.d86ae06e.js.map} (55%) diff --git a/asset-manifest.json b/asset-manifest.json index a4d7e97c..4b6983c3 100644 --- a/asset-manifest.json +++ b/asset-manifest.json @@ -1,17 +1,17 @@ { "files": { "main.css": "/static/css/main.fb6e0079.css", - "main.js": "/static/js/main.75d035ed.js", + "main.js": "/static/js/main.d86ae06e.js", "static/js/787.3bc08bb2.chunk.js": "/static/js/787.3bc08bb2.chunk.js", "static/media/highlighted-marker.svg": "/static/media/highlighted-marker.dd61d9b630af019fde7e6be158b1fe54.svg", "static/media/marker.svg": "/static/media/marker.cf3b4135bd5ce23e5eb06074760cf91f.svg", "index.html": "/index.html", "main.fb6e0079.css.map": "/static/css/main.fb6e0079.css.map", - "main.75d035ed.js.map": "/static/js/main.75d035ed.js.map", + "main.d86ae06e.js.map": "/static/js/main.d86ae06e.js.map", "787.3bc08bb2.chunk.js.map": "/static/js/787.3bc08bb2.chunk.js.map" }, "entrypoints": [ "static/css/main.fb6e0079.css", - "static/js/main.75d035ed.js" + "static/js/main.d86ae06e.js" ] } \ No newline at end of file diff --git a/index.html b/index.html index 9b883bad..77e7c90d 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -Tired Bike
\ No newline at end of file +Tired Bike
\ No newline at end of file diff --git a/static/js/main.75d035ed.js b/static/js/main.75d035ed.js deleted file mode 100644 index ecfc4dd1..00000000 --- a/static/js/main.75d035ed.js +++ /dev/null @@ -1,9 +0,0 @@ -/*! For license information please see main.75d035ed.js.LICENSE.txt */ -(()=>{var e={2674:(e,t,n)=>{"use strict";t.Z=void 0;var r,i=n(1366),o=(r=n(8559))&&r.__esModule?r:{default:r};function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}n(6986);var h=(0,i.createPathComponent)((function(e,t){e.children;var n=d(e,["children"]),r={},i={};Object.entries(n).forEach((function(e){var t=l(e,2),n=t[0],o=t[1];return n.startsWith("on")?i[n]=o:r[n]=o}));var s=new o.default.markerClusterGroup(r);return Object.entries(i).forEach((function(e){var t=l(e,2),n=t[0],r=t[1],i="cluster".concat(n.substring(2).toLowerCase());s.on(i,r)})),{instance:s,context:a(a({},t),{},{layerContainer:s})}}));t.Z=h},6944:function(e){var t;t=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=22)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n=4){for(var e=arguments.length,t=Array(e),n=0;n=3){for(var e=arguments.length,t=Array(e),n=0;n=2){for(var e=arguments.length,t=Array(e),n=0;n=1){for(var e=arguments.length,t=Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:o.JsonService;if(s(this,e),!t)throw i.Log.error("MetadataService: No settings passed to MetadataService"),new Error("settings");this._settings=t,this._jsonService=new n(["application/jwk-set+json"])}return e.prototype.resetSigningKeys=function(){this._settings=this._settings||{},this._settings.signingKeys=void 0},e.prototype.getMetadata=function(){var e=this;return this._settings.metadata?(i.Log.debug("MetadataService.getMetadata: Returning metadata from settings"),Promise.resolve(this._settings.metadata)):this.metadataUrl?(i.Log.debug("MetadataService.getMetadata: getting metadata from",this.metadataUrl),this._jsonService.getJson(this.metadataUrl).then((function(t){i.Log.debug("MetadataService.getMetadata: json received");var n=e._settings.metadataSeed||{};return e._settings.metadata=Object.assign({},n,t),e._settings.metadata}))):(i.Log.error("MetadataService.getMetadata: No authority or metadataUrl configured on settings"),Promise.reject(new Error("No authority or metadataUrl configured on settings")))},e.prototype.getIssuer=function(){return this._getMetadataProperty("issuer")},e.prototype.getAuthorizationEndpoint=function(){return this._getMetadataProperty("authorization_endpoint")},e.prototype.getUserInfoEndpoint=function(){return this._getMetadataProperty("userinfo_endpoint")},e.prototype.getTokenEndpoint=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._getMetadataProperty("token_endpoint",e)},e.prototype.getCheckSessionIframe=function(){return this._getMetadataProperty("check_session_iframe",!0)},e.prototype.getEndSessionEndpoint=function(){return this._getMetadataProperty("end_session_endpoint",!0)},e.prototype.getRevocationEndpoint=function(){return this._getMetadataProperty("revocation_endpoint",!0)},e.prototype.getKeysEndpoint=function(){return this._getMetadataProperty("jwks_uri",!0)},e.prototype._getMetadataProperty=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return i.Log.debug("MetadataService.getMetadataProperty for: "+e),this.getMetadata().then((function(n){if(i.Log.debug("MetadataService.getMetadataProperty: metadata recieved"),void 0===n[e]){if(!0===t)return void i.Log.warn("MetadataService.getMetadataProperty: Metadata does not contain optional property "+e);throw i.Log.error("MetadataService.getMetadataProperty: Metadata does not contain property "+e),new Error("Metadata does not contain property "+e)}return n[e]}))},e.prototype.getSigningKeys=function(){var e=this;return this._settings.signingKeys?(i.Log.debug("MetadataService.getSigningKeys: Returning signingKeys from settings"),Promise.resolve(this._settings.signingKeys)):this._getMetadataProperty("jwks_uri").then((function(t){return i.Log.debug("MetadataService.getSigningKeys: jwks_uri received",t),e._jsonService.getJson(t).then((function(t){if(i.Log.debug("MetadataService.getSigningKeys: key set received",t),!t.keys)throw i.Log.error("MetadataService.getSigningKeys: Missing keys on keyset"),new Error("Missing keys on keyset");return e._settings.signingKeys=t.keys,e._settings.signingKeys}))}))},r(e,[{key:"metadataUrl",get:function(){return this._metadataUrl||(this._settings.metadataUrl?this._metadataUrl=this._settings.metadataUrl:(this._metadataUrl=this._settings.authority,this._metadataUrl&&this._metadataUrl.indexOf(a)<0&&("/"!==this._metadataUrl[this._metadataUrl.length-1]&&(this._metadataUrl+="/"),this._metadataUrl+=a))),this._metadataUrl}}]),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UrlUtility=void 0;var r=n(0),i=n(1);t.UrlUtility=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.addQueryParam=function(e,t,n){return e.indexOf("?")<0&&(e+="?"),"?"!==e[e.length-1]&&(e+="&"),e+=encodeURIComponent(t),(e+="=")+encodeURIComponent(n)},e.parseUrlFragment=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.Global;"string"!=typeof e&&(e=n.location.href);var o=e.lastIndexOf(t);o>=0&&(e=e.substr(o+1)),"?"===t&&(o=e.indexOf("#"))>=0&&(e=e.substr(0,o));for(var s,a={},u=/([^&=]+)=([^&]*)/g,l=0;s=u.exec(e);)if(a[decodeURIComponent(s[1])]=decodeURIComponent(s[2].replace(/\+/g," ")),l++>50)return r.Log.error("UrlUtility.parseUrlFragment: response exceeded expected number of parameters",e),{error:"Response exceeded expected number of parameters"};for(var c in a)return a;return{}},e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JoseUtil=void 0;var r=n(26),i=function(e){return e&&e.__esModule?e:{default:e}}(n(33));t.JoseUtil=(0,i.default)({jws:r.jws,KeyUtil:r.KeyUtil,X509:r.X509,crypto:r.crypto,hextob64u:r.hextob64u,b64tohex:r.b64tohex,AllowedSigningAlgs:r.AllowedSigningAlgs})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OidcClientSettings=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},n=t.authority,i=t.metadataUrl,o=t.metadata,d=t.signingKeys,g=t.metadataSeed,m=t.client_id,y=t.client_secret,v=t.response_type,w=void 0===v?h:v,_=t.scope,b=void 0===_?f:_,S=t.redirect_uri,x=t.post_logout_redirect_uri,E=t.client_authentication,k=void 0===E?p:E,C=t.prompt,P=t.display,T=t.max_age,A=t.ui_locales,O=t.acr_values,I=t.resource,j=t.response_mode,L=t.filterProtocolClaims,R=void 0===L||L,F=t.loadUserInfo,M=void 0===F||F,N=t.staleStateAge,D=void 0===N?900:N,U=t.clockSkew,$=void 0===U?300:U,B=t.clockService,z=void 0===B?new s.ClockService:B,H=t.userInfoJwtIssuer,V=void 0===H?"OP":H,q=t.mergeClaims,W=void 0!==q&&q,K=t.stateStore,Z=void 0===K?new a.WebStorageStateStore:K,G=t.ResponseValidatorCtor,J=void 0===G?u.ResponseValidator:G,Q=t.MetadataServiceCtor,Y=void 0===Q?l.MetadataService:Q,X=t.extraQueryParams,ee=void 0===X?{}:X,te=t.extraTokenParams,ne=void 0===te?{}:te;c(this,e),this._authority=n,this._metadataUrl=i,this._metadata=o,this._metadataSeed=g,this._signingKeys=d,this._client_id=m,this._client_secret=y,this._response_type=w,this._scope=b,this._redirect_uri=S,this._post_logout_redirect_uri=x,this._client_authentication=k,this._prompt=C,this._display=P,this._max_age=T,this._ui_locales=A,this._acr_values=O,this._resource=I,this._response_mode=j,this._filterProtocolClaims=!!R,this._loadUserInfo=!!M,this._staleStateAge=D,this._clockSkew=$,this._clockService=z,this._userInfoJwtIssuer=V,this._mergeClaims=!!W,this._stateStore=Z,this._validator=new J(this),this._metadataService=new Y(this),this._extraQueryParams="object"===(void 0===ee?"undefined":r(ee))?ee:{},this._extraTokenParams="object"===(void 0===ne?"undefined":r(ne))?ne:{}}return e.prototype.getEpochTime=function(){return this._clockService.getEpochTime()},i(e,[{key:"client_id",get:function(){return this._client_id},set:function(e){if(this._client_id)throw o.Log.error("OidcClientSettings.set_client_id: client_id has already been assigned."),new Error("client_id has already been assigned.");this._client_id=e}},{key:"client_secret",get:function(){return this._client_secret}},{key:"response_type",get:function(){return this._response_type}},{key:"scope",get:function(){return this._scope}},{key:"redirect_uri",get:function(){return this._redirect_uri}},{key:"post_logout_redirect_uri",get:function(){return this._post_logout_redirect_uri}},{key:"client_authentication",get:function(){return this._client_authentication}},{key:"prompt",get:function(){return this._prompt}},{key:"display",get:function(){return this._display}},{key:"max_age",get:function(){return this._max_age}},{key:"ui_locales",get:function(){return this._ui_locales}},{key:"acr_values",get:function(){return this._acr_values}},{key:"resource",get:function(){return this._resource}},{key:"response_mode",get:function(){return this._response_mode}},{key:"authority",get:function(){return this._authority},set:function(e){if(this._authority)throw o.Log.error("OidcClientSettings.set_authority: authority has already been assigned."),new Error("authority has already been assigned.");this._authority=e}},{key:"metadataUrl",get:function(){return this._metadataUrl||(this._metadataUrl=this.authority,this._metadataUrl&&this._metadataUrl.indexOf(d)<0&&("/"!==this._metadataUrl[this._metadataUrl.length-1]&&(this._metadataUrl+="/"),this._metadataUrl+=d)),this._metadataUrl}},{key:"metadata",get:function(){return this._metadata},set:function(e){this._metadata=e}},{key:"metadataSeed",get:function(){return this._metadataSeed},set:function(e){this._metadataSeed=e}},{key:"signingKeys",get:function(){return this._signingKeys},set:function(e){this._signingKeys=e}},{key:"filterProtocolClaims",get:function(){return this._filterProtocolClaims}},{key:"loadUserInfo",get:function(){return this._loadUserInfo}},{key:"staleStateAge",get:function(){return this._staleStateAge}},{key:"clockSkew",get:function(){return this._clockSkew}},{key:"userInfoJwtIssuer",get:function(){return this._userInfoJwtIssuer}},{key:"mergeClaims",get:function(){return this._mergeClaims}},{key:"stateStore",get:function(){return this._stateStore}},{key:"validator",get:function(){return this._validator}},{key:"metadataService",get:function(){return this._metadataService}},{key:"extraQueryParams",get:function(){return this._extraQueryParams},set:function(e){"object"===(void 0===e?"undefined":r(e))?this._extraQueryParams=e:this._extraQueryParams={}}},{key:"extraTokenParams",get:function(){return this._extraTokenParams},set:function(e){"object"===(void 0===e?"undefined":r(e))?this._extraTokenParams=e:this._extraTokenParams={}}}]),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebStorageStateStore=void 0;var r=n(0),i=n(1);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.WebStorageStateStore=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.prefix,r=void 0===n?"oidc.":n,s=t.store,a=void 0===s?i.Global.localStorage:s;o(this,e),this._store=a,this._prefix=r}return e.prototype.set=function(e,t){return r.Log.debug("WebStorageStateStore.set",e),e=this._prefix+e,this._store.setItem(e,t),Promise.resolve()},e.prototype.get=function(e){r.Log.debug("WebStorageStateStore.get",e),e=this._prefix+e;var t=this._store.getItem(e);return Promise.resolve(t)},e.prototype.remove=function(e){r.Log.debug("WebStorageStateStore.remove",e),e=this._prefix+e;var t=this._store.getItem(e);return this._store.removeItem(e),Promise.resolve(t)},e.prototype.getAllKeys=function(){r.Log.debug("WebStorageStateStore.getAllKeys");for(var e=[],t=0;t0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.Global.XMLHttpRequest,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;o(this,e),t&&Array.isArray(t)?this._contentTypes=t.slice():this._contentTypes=[],this._contentTypes.push("application/json"),r&&this._contentTypes.push("application/jwt"),this._XMLHttpRequest=n,this._jwtHandler=r}return e.prototype.getJson=function(e,t){var n=this;if(!e)throw r.Log.error("JsonService.getJson: No url passed"),new Error("url");return r.Log.debug("JsonService.getJson, url: ",e),new Promise((function(i,o){var s=new n._XMLHttpRequest;s.open("GET",e);var a=n._contentTypes,u=n._jwtHandler;s.onload=function(){if(r.Log.debug("JsonService.getJson: HTTP response received, status",s.status),200===s.status){var t=s.getResponseHeader("Content-Type");if(t){var n=a.find((function(e){if(t.startsWith(e))return!0}));if("application/jwt"==n)return void u(s).then(i,o);if(n)try{return void i(JSON.parse(s.responseText))}catch(i){return r.Log.error("JsonService.getJson: Error parsing JSON response",i.message),void o(i)}}o(Error("Invalid response Content-Type: "+t+", from URL: "+e))}else o(Error(s.statusText+" ("+s.status+")"))},s.onerror=function(){r.Log.error("JsonService.getJson: network error"),o(Error("Network Error"))},t&&(r.Log.debug("JsonService.getJson: token passed, setting Authorization header"),s.setRequestHeader("Authorization","Bearer "+t)),s.send()}))},e.prototype.postForm=function(e,t,n){var i=this;if(!e)throw r.Log.error("JsonService.postForm: No url passed"),new Error("url");return r.Log.debug("JsonService.postForm, url: ",e),new Promise((function(o,s){var a=new i._XMLHttpRequest;a.open("POST",e);var u=i._contentTypes;a.onload=function(){if(r.Log.debug("JsonService.postForm: HTTP response received, status",a.status),200!==a.status){if(400===a.status&&(n=a.getResponseHeader("Content-Type"))&&u.find((function(e){if(n.startsWith(e))return!0})))try{var t=JSON.parse(a.responseText);if(t&&t.error)return r.Log.error("JsonService.postForm: Error from server: ",t.error),void s(new Error(t.error))}catch(o){return r.Log.error("JsonService.postForm: Error parsing JSON response",o.message),void s(o)}s(Error(a.statusText+" ("+a.status+")"))}else{var n;if((n=a.getResponseHeader("Content-Type"))&&u.find((function(e){if(n.startsWith(e))return!0})))try{return void o(JSON.parse(a.responseText))}catch(o){return r.Log.error("JsonService.postForm: Error parsing JSON response",o.message),void s(o)}s(Error("Invalid response Content-Type: "+n+", from URL: "+e))}},a.onerror=function(){r.Log.error("JsonService.postForm: network error"),s(Error("Network Error"))};var l="";for(var c in t){var d=t[c];d&&(l.length>0&&(l+="&"),l+=encodeURIComponent(c),l+="=",l+=encodeURIComponent(d))}a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),void 0!==n&&a.setRequestHeader("Authorization","Basic "+btoa(n)),a.send(l)}))},e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SigninRequest=void 0;var r=n(0),i=n(3),o=n(13);t.SigninRequest=function(){function e(t){var n=t.url,s=t.client_id,a=t.redirect_uri,u=t.response_type,l=t.scope,c=t.authority,d=t.data,h=t.prompt,f=t.display,p=t.max_age,g=t.ui_locales,m=t.id_token_hint,y=t.login_hint,v=t.acr_values,w=t.resource,_=t.response_mode,b=t.request,S=t.request_uri,x=t.extraQueryParams,E=t.request_type,k=t.client_secret,C=t.extraTokenParams,P=t.skipUserInfo;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!n)throw r.Log.error("SigninRequest.ctor: No url passed"),new Error("url");if(!s)throw r.Log.error("SigninRequest.ctor: No client_id passed"),new Error("client_id");if(!a)throw r.Log.error("SigninRequest.ctor: No redirect_uri passed"),new Error("redirect_uri");if(!u)throw r.Log.error("SigninRequest.ctor: No response_type passed"),new Error("response_type");if(!l)throw r.Log.error("SigninRequest.ctor: No scope passed"),new Error("scope");if(!c)throw r.Log.error("SigninRequest.ctor: No authority passed"),new Error("authority");var T=e.isOidc(u),A=e.isCode(u);_||(_=e.isCode(u)?"query":null),this.state=new o.SigninState({nonce:T,data:d,client_id:s,authority:c,redirect_uri:a,code_verifier:A,request_type:E,response_mode:_,client_secret:k,scope:l,extraTokenParams:C,skipUserInfo:P}),n=i.UrlUtility.addQueryParam(n,"client_id",s),n=i.UrlUtility.addQueryParam(n,"redirect_uri",a),n=i.UrlUtility.addQueryParam(n,"response_type",u),n=i.UrlUtility.addQueryParam(n,"scope",l),n=i.UrlUtility.addQueryParam(n,"state",this.state.id),T&&(n=i.UrlUtility.addQueryParam(n,"nonce",this.state.nonce)),A&&(n=i.UrlUtility.addQueryParam(n,"code_challenge",this.state.code_challenge),n=i.UrlUtility.addQueryParam(n,"code_challenge_method","S256"));var O={prompt:h,display:f,max_age:p,ui_locales:g,id_token_hint:m,login_hint:y,acr_values:v,resource:w,request:b,request_uri:S,response_mode:_};for(var I in O)O[I]&&(n=i.UrlUtility.addQueryParam(n,I,O[I]));for(var j in x)n=i.UrlUtility.addQueryParam(n,j,x[j]);this.url=n}return e.isOidc=function(e){return!!e.split(/\s+/g).filter((function(e){return"id_token"===e}))[0]},e.isOAuth=function(e){return!!e.split(/\s+/g).filter((function(e){return"token"===e}))[0]},e.isCode=function(e){return!!e.split(/\s+/g).filter((function(e){return"code"===e}))[0]},e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.State=void 0;var r=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},n=t.id,r=t.data,i=t.created,a=t.request_type;s(this,e),this._id=n||(0,o.default)(),this._data=r,this._created="number"==typeof i&&i>0?i:parseInt(Date.now()/1e3),this._request_type=a}return e.prototype.toStorageString=function(){return i.Log.debug("State.toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type})},e.fromStorageString=function(t){return i.Log.debug("State.fromStorageString"),new e(JSON.parse(t))},e.clearStaleState=function(t,n){var r=Date.now()/1e3-n;return t.getAllKeys().then((function(n){i.Log.debug("State.clearStaleState: got keys",n);for(var o=[],s=function(s){var a=n[s];u=t.get(a).then((function(n){var o=!1;if(n)try{var s=e.fromStorageString(n);i.Log.debug("State.clearStaleState: got item from key: ",a,s.created),s.created<=r&&(o=!0)}catch(e){i.Log.error("State.clearStaleState: Error parsing state for key",a,e.message),o=!0}else i.Log.debug("State.clearStaleState: no item in storage for key: ",a),o=!0;if(o)return i.Log.debug("State.clearStaleState: removed item for key: ",a),t.remove(a)})),o.push(u)},a=0;a0&&void 0!==arguments[0]?arguments[0]:{};f(this,e),t instanceof o.OidcClientSettings?this._settings=t:this._settings=new o.OidcClientSettings(t)}return e.prototype.createSigninRequest=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.response_type,r=t.scope,o=t.redirect_uri,s=t.data,u=t.state,l=t.prompt,c=t.display,d=t.max_age,h=t.ui_locales,f=t.id_token_hint,p=t.login_hint,g=t.acr_values,m=t.resource,y=t.request,v=t.request_uri,w=t.response_mode,_=t.extraQueryParams,b=t.extraTokenParams,S=t.request_type,x=t.skipUserInfo,E=arguments[1];i.Log.debug("OidcClient.createSigninRequest");var k=this._settings.client_id;n=n||this._settings.response_type,r=r||this._settings.scope,o=o||this._settings.redirect_uri,l=l||this._settings.prompt,c=c||this._settings.display,d=d||this._settings.max_age,h=h||this._settings.ui_locales,g=g||this._settings.acr_values,m=m||this._settings.resource,w=w||this._settings.response_mode,_=_||this._settings.extraQueryParams,b=b||this._settings.extraTokenParams;var C=this._settings.authority;return a.SigninRequest.isCode(n)&&"code"!==n?Promise.reject(new Error("OpenID Connect hybrid flow is not supported")):this._metadataService.getAuthorizationEndpoint().then((function(t){i.Log.debug("OidcClient.createSigninRequest: Received authorization endpoint",t);var P=new a.SigninRequest({url:t,client_id:k,redirect_uri:o,response_type:n,scope:r,data:s||u,authority:C,prompt:l,display:c,max_age:d,ui_locales:h,id_token_hint:f,login_hint:p,acr_values:g,resource:m,request:y,request_uri:v,extraQueryParams:_,extraTokenParams:b,request_type:S,response_mode:w,client_secret:e._settings.client_secret,skipUserInfo:x}),T=P.state;return(E=E||e._stateStore).set(T.id,T.toStorageString()).then((function(){return P}))}))},e.prototype.readSigninResponseState=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];i.Log.debug("OidcClient.readSigninResponseState");var r="query"===this._settings.response_mode||!this._settings.response_mode&&a.SigninRequest.isCode(this._settings.response_type),o=r?"?":"#",s=new u.SigninResponse(e,o);if(!s.state)return i.Log.error("OidcClient.readSigninResponseState: No state in response"),Promise.reject(new Error("No state in response"));t=t||this._stateStore;var l=n?t.remove.bind(t):t.get.bind(t);return l(s.state).then((function(e){if(!e)throw i.Log.error("OidcClient.readSigninResponseState: No matching state found in storage"),new Error("No matching state found in storage");return{state:d.SigninState.fromStorageString(e),response:s}}))},e.prototype.processSigninResponse=function(e,t){var n=this;return i.Log.debug("OidcClient.processSigninResponse"),this.readSigninResponseState(e,t,!0).then((function(e){var t=e.state,r=e.response;return i.Log.debug("OidcClient.processSigninResponse: Received state from storage; validating response"),n._validator.validateSigninResponse(t,r)}))},e.prototype.createSignoutRequest=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.id_token_hint,r=t.data,o=t.state,s=t.post_logout_redirect_uri,a=t.extraQueryParams,u=t.request_type,c=arguments[1];return i.Log.debug("OidcClient.createSignoutRequest"),s=s||this._settings.post_logout_redirect_uri,a=a||this._settings.extraQueryParams,this._metadataService.getEndSessionEndpoint().then((function(t){if(!t)throw i.Log.error("OidcClient.createSignoutRequest: No end session endpoint url returned"),new Error("no end session endpoint");i.Log.debug("OidcClient.createSignoutRequest: Received end session endpoint",t);var d=new l.SignoutRequest({url:t,id_token_hint:n,post_logout_redirect_uri:s,data:r||o,extraQueryParams:a,request_type:u}),h=d.state;return h&&(i.Log.debug("OidcClient.createSignoutRequest: Signout request has state to persist"),(c=c||e._stateStore).set(h.id,h.toStorageString())),d}))},e.prototype.readSignoutResponseState=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];i.Log.debug("OidcClient.readSignoutResponseState");var r=new c.SignoutResponse(e);if(!r.state)return i.Log.debug("OidcClient.readSignoutResponseState: No state in response"),r.error?(i.Log.warn("OidcClient.readSignoutResponseState: Response was error: ",r.error),Promise.reject(new s.ErrorResponse(r))):Promise.resolve({state:void 0,response:r});var o=r.state;t=t||this._stateStore;var a=n?t.remove.bind(t):t.get.bind(t);return a(o).then((function(e){if(!e)throw i.Log.error("OidcClient.readSignoutResponseState: No matching state found in storage"),new Error("No matching state found in storage");return{state:h.State.fromStorageString(e),response:r}}))},e.prototype.processSignoutResponse=function(e,t){var n=this;return i.Log.debug("OidcClient.processSignoutResponse"),this.readSignoutResponseState(e,t,!0).then((function(e){var t=e.state,r=e.response;return t?(i.Log.debug("OidcClient.processSignoutResponse: Received state from storage; validating response"),n._validator.validateSignoutResponse(t,r)):(i.Log.debug("OidcClient.processSignoutResponse: No state from storage; skipping validating response"),r)}))},e.prototype.clearStaleState=function(e){return i.Log.debug("OidcClient.clearStaleState"),e=e||this._stateStore,h.State.clearStaleState(e,this.settings.staleStateAge)},r(e,[{key:"_stateStore",get:function(){return this.settings.stateStore}},{key:"_validator",get:function(){return this.settings.validator}},{key:"_metadataService",get:function(){return this.settings.metadataService}},{key:"settings",get:function(){return this._settings}},{key:"metadataService",get:function(){return this._metadataService}}]),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenClient=void 0;var r=n(7),i=n(2),o=n(0);function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.TokenClient=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.JsonService,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.MetadataService;if(s(this,e),!t)throw o.Log.error("TokenClient.ctor: No settings passed"),new Error("settings");this._settings=t,this._jsonService=new n,this._metadataService=new a(this._settings)}return e.prototype.exchangeCode=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).grant_type=t.grant_type||"authorization_code",t.client_id=t.client_id||this._settings.client_id,t.client_secret=t.client_secret||this._settings.client_secret,t.redirect_uri=t.redirect_uri||this._settings.redirect_uri;var n=void 0,r=t._client_authentication||this._settings._client_authentication;return delete t._client_authentication,t.code?t.redirect_uri?t.code_verifier?t.client_id?t.client_secret||"client_secret_basic"!=r?("client_secret_basic"==r&&(n=t.client_id+":"+t.client_secret,delete t.client_id,delete t.client_secret),this._metadataService.getTokenEndpoint(!1).then((function(r){return o.Log.debug("TokenClient.exchangeCode: Received token endpoint"),e._jsonService.postForm(r,t,n).then((function(e){return o.Log.debug("TokenClient.exchangeCode: response received"),e}))}))):(o.Log.error("TokenClient.exchangeCode: No client_secret passed"),Promise.reject(new Error("A client_secret is required"))):(o.Log.error("TokenClient.exchangeCode: No client_id passed"),Promise.reject(new Error("A client_id is required"))):(o.Log.error("TokenClient.exchangeCode: No code_verifier passed"),Promise.reject(new Error("A code_verifier is required"))):(o.Log.error("TokenClient.exchangeCode: No redirect_uri passed"),Promise.reject(new Error("A redirect_uri is required"))):(o.Log.error("TokenClient.exchangeCode: No code passed"),Promise.reject(new Error("A code is required")))},e.prototype.exchangeRefreshToken=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).grant_type=t.grant_type||"refresh_token",t.client_id=t.client_id||this._settings.client_id,t.client_secret=t.client_secret||this._settings.client_secret;var n=void 0,r=t._client_authentication||this._settings._client_authentication;return delete t._client_authentication,t.refresh_token?t.client_id?("client_secret_basic"==r&&(n=t.client_id+":"+t.client_secret,delete t.client_id,delete t.client_secret),this._metadataService.getTokenEndpoint(!1).then((function(r){return o.Log.debug("TokenClient.exchangeRefreshToken: Received token endpoint"),e._jsonService.postForm(r,t,n).then((function(e){return o.Log.debug("TokenClient.exchangeRefreshToken: response received"),e}))}))):(o.Log.error("TokenClient.exchangeRefreshToken: No client_id passed"),Promise.reject(new Error("A client_id is required"))):(o.Log.error("TokenClient.exchangeRefreshToken: No refresh_token passed"),Promise.reject(new Error("A refresh_token is required")))},e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorResponse=void 0;var r=n(0);function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}t.ErrorResponse=function(e){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=n.error,a=n.error_description,u=n.error_uri,l=n.state,c=n.session_state;if(i(this,t),!s)throw r.Log.error("No error passed to ErrorResponse"),new Error("error");var d=o(this,e.call(this,a||s));return d.name="ErrorResponse",d.error=s,d.error_description=a,d.error_uri=u,d.state=l,d.session_state=c,d}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(Error)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SigninState=void 0;var r=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},r=n.nonce,i=n.authority,o=n.client_id,c=n.redirect_uri,d=n.code_verifier,h=n.response_mode,f=n.client_secret,p=n.scope,g=n.extraTokenParams,m=n.skipUserInfo;u(this,t);var y=l(this,e.call(this,arguments[0]));if(!0===r?y._nonce=(0,a.default)():r&&(y._nonce=r),!0===d?y._code_verifier=(0,a.default)()+(0,a.default)()+(0,a.default)():d&&(y._code_verifier=d),y.code_verifier){var v=s.JoseUtil.hashString(y.code_verifier,"SHA256");y._code_challenge=s.JoseUtil.hexToBase64Url(v)}return y._redirect_uri=c,y._authority=i,y._client_id=o,y._response_mode=h,y._client_secret=f,y._scope=p,y._extraTokenParams=g,y._skipUserInfo=m,y}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.toStorageString=function(){return i.Log.debug("SigninState.toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,nonce:this.nonce,code_verifier:this.code_verifier,redirect_uri:this.redirect_uri,authority:this.authority,client_id:this.client_id,response_mode:this.response_mode,client_secret:this.client_secret,scope:this.scope,extraTokenParams:this.extraTokenParams,skipUserInfo:this.skipUserInfo})},t.fromStorageString=function(e){return i.Log.debug("SigninState.fromStorageString"),new t(JSON.parse(e))},r(t,[{key:"nonce",get:function(){return this._nonce}},{key:"authority",get:function(){return this._authority}},{key:"client_id",get:function(){return this._client_id}},{key:"redirect_uri",get:function(){return this._redirect_uri}},{key:"code_verifier",get:function(){return this._code_verifier}},{key:"code_challenge",get:function(){return this._code_challenge}},{key:"response_mode",get:function(){return this._response_mode}},{key:"client_secret",get:function(){return this._client_secret}},{key:"scope",get:function(){return this._scope}},{key:"extraTokenParams",get:function(){return this._extraTokenParams}},{key:"skipUserInfo",get:function(){return this._skipUserInfo}}]),t}(o.State)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return("undefined"!=r&&null!==r&&void 0!==r.getRandomValues?i:o)().replace(/-/g,"")};var r="undefined"!=typeof window?window.crypto||window.msCrypto:null;function i(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(e){return(e^r.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)}))}function o(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(e){return(e^16*Math.random()>>e/4).toString(16)}))}e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.User=void 0;var r=function(){function e(e,t){for(var n=0;n0){var n=parseInt(Date.now()/1e3);this.expires_at=n+t}}},{key:"expired",get:function(){var e=this.expires_in;if(void 0!==e)return e<=0}},{key:"scopes",get:function(){return(this.scope||"").split(" ")}}]),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AccessTokenEvents=void 0;var r=n(0),i=n(46);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.AccessTokenEvents=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.accessTokenExpiringNotificationTime,r=void 0===n?60:n,s=t.accessTokenExpiringTimer,a=void 0===s?new i.Timer("Access token expiring"):s,u=t.accessTokenExpiredTimer,l=void 0===u?new i.Timer("Access token expired"):u;o(this,e),this._accessTokenExpiringNotificationTime=r,this._accessTokenExpiring=a,this._accessTokenExpired=l}return e.prototype.load=function(e){if(e.access_token&&void 0!==e.expires_in){var t=e.expires_in;if(r.Log.debug("AccessTokenEvents.load: access token present, remaining duration:",t),t>0){var n=t-this._accessTokenExpiringNotificationTime;n<=0&&(n=1),r.Log.debug("AccessTokenEvents.load: registering expiring timer in:",n),this._accessTokenExpiring.init(n)}else r.Log.debug("AccessTokenEvents.load: canceling existing expiring timer becase we're past expiration."),this._accessTokenExpiring.cancel();var i=t+1;r.Log.debug("AccessTokenEvents.load: registering expired timer in:",i),this._accessTokenExpired.init(i)}else this._accessTokenExpiring.cancel(),this._accessTokenExpired.cancel()},e.prototype.unload=function(){r.Log.debug("AccessTokenEvents.unload: canceling existing access token timers"),this._accessTokenExpiring.cancel(),this._accessTokenExpired.cancel()},e.prototype.addAccessTokenExpiring=function(e){this._accessTokenExpiring.addHandler(e)},e.prototype.removeAccessTokenExpiring=function(e){this._accessTokenExpiring.removeHandler(e)},e.prototype.addAccessTokenExpired=function(e){this._accessTokenExpired.addHandler(e)},e.prototype.removeAccessTokenExpired=function(e){this._accessTokenExpired.removeHandler(e)},e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Event=void 0;var r=n(0);t.Event=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._name=t,this._callbacks=[]}return e.prototype.addHandler=function(e){this._callbacks.push(e)},e.prototype.removeHandler=function(e){var t=this._callbacks.findIndex((function(t){return t===e}));t>=0&&this._callbacks.splice(t,1)},e.prototype.raise=function(){r.Log.debug("Event: Raising event: "+this._name);for(var e=0;e1&&void 0!==arguments[1]?arguments[1]:o.CheckSessionIFrame,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.Global.timer;if(a(this,e),!t)throw i.Log.error("SessionMonitor.ctor: No user manager passed to SessionMonitor"),new Error("userManager");this._userManager=t,this._CheckSessionIFrameCtor=r,this._timer=u,this._userManager.events.addUserLoaded(this._start.bind(this)),this._userManager.events.addUserUnloaded(this._stop.bind(this)),Promise.resolve(this._userManager.getUser().then((function(e){e?n._start(e):n._settings.monitorAnonymousSession&&n._userManager.querySessionStatus().then((function(e){var t={session_state:e.session_state};e.sub&&e.sid&&(t.profile={sub:e.sub,sid:e.sid}),n._start(t)})).catch((function(e){i.Log.error("SessionMonitor ctor: error from querySessionStatus:",e.message)}))})).catch((function(e){i.Log.error("SessionMonitor ctor: error from getUser:",e.message)})))}return e.prototype._start=function(e){var t=this,n=e.session_state;n&&(e.profile?(this._sub=e.profile.sub,this._sid=e.profile.sid,i.Log.debug("SessionMonitor._start: session_state:",n,", sub:",this._sub)):(this._sub=void 0,this._sid=void 0,i.Log.debug("SessionMonitor._start: session_state:",n,", anonymous user")),this._checkSessionIFrame?this._checkSessionIFrame.start(n):this._metadataService.getCheckSessionIframe().then((function(e){if(e){i.Log.debug("SessionMonitor._start: Initializing check session iframe");var r=t._client_id,o=t._checkSessionInterval,s=t._stopCheckSessionOnError;t._checkSessionIFrame=new t._CheckSessionIFrameCtor(t._callback.bind(t),r,e,o,s),t._checkSessionIFrame.load().then((function(){t._checkSessionIFrame.start(n)}))}else i.Log.warn("SessionMonitor._start: No check session iframe found in the metadata")})).catch((function(e){i.Log.error("SessionMonitor._start: Error from getCheckSessionIframe:",e.message)})))},e.prototype._stop=function(){var e=this;if(this._sub=void 0,this._sid=void 0,this._checkSessionIFrame&&(i.Log.debug("SessionMonitor._stop"),this._checkSessionIFrame.stop()),this._settings.monitorAnonymousSession)var t=this._timer.setInterval((function(){e._timer.clearInterval(t),e._userManager.querySessionStatus().then((function(t){var n={session_state:t.session_state};t.sub&&t.sid&&(n.profile={sub:t.sub,sid:t.sid}),e._start(n)})).catch((function(e){i.Log.error("SessionMonitor: error from querySessionStatus:",e.message)}))}),1e3)},e.prototype._callback=function(){var e=this;this._userManager.querySessionStatus().then((function(t){var n=!0;t?t.sub===e._sub?(n=!1,e._checkSessionIFrame.start(t.session_state),t.sid===e._sid?i.Log.debug("SessionMonitor._callback: Same sub still logged in at OP, restarting check session iframe; session_state:",t.session_state):(i.Log.debug("SessionMonitor._callback: Same sub still logged in at OP, session state has changed, restarting check session iframe; session_state:",t.session_state),e._userManager.events._raiseUserSessionChanged())):i.Log.debug("SessionMonitor._callback: Different subject signed into OP:",t.sub):i.Log.debug("SessionMonitor._callback: Subject no longer signed into OP"),n&&(e._sub?(i.Log.debug("SessionMonitor._callback: SessionMonitor._callback; raising signed out event"),e._userManager.events._raiseUserSignedOut()):(i.Log.debug("SessionMonitor._callback: SessionMonitor._callback; raising signed in event"),e._userManager.events._raiseUserSignedIn()))})).catch((function(t){e._sub&&(i.Log.debug("SessionMonitor._callback: Error calling queryCurrentSigninSession; raising signed out event",t.message),e._userManager.events._raiseUserSignedOut())}))},r(e,[{key:"_settings",get:function(){return this._userManager.settings}},{key:"_metadataService",get:function(){return this._userManager.metadataService}},{key:"_client_id",get:function(){return this._settings.client_id}},{key:"_checkSessionInterval",get:function(){return this._settings.checkSessionInterval}},{key:"_stopCheckSessionOnError",get:function(){return this._settings.stopCheckSessionOnError}}]),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CheckSessionIFrame=void 0;var r=n(0);function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.CheckSessionIFrame=function(){function e(t,n,r,o){var s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];i(this,e),this._callback=t,this._client_id=n,this._url=r,this._interval=o||2e3,this._stopOnError=s;var a=r.indexOf("/",r.indexOf("//")+2);this._frame_origin=r.substr(0,a),this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="absolute",this._frame.style.display="none",this._frame.width=0,this._frame.height=0,this._frame.src=r}return e.prototype.load=function(){var e=this;return new Promise((function(t){e._frame.onload=function(){t()},window.document.body.appendChild(e._frame),e._boundMessageEvent=e._message.bind(e),window.addEventListener("message",e._boundMessageEvent,!1)}))},e.prototype._message=function(e){e.origin===this._frame_origin&&e.source===this._frame.contentWindow&&("error"===e.data?(r.Log.error("CheckSessionIFrame: error message from check session op iframe"),this._stopOnError&&this.stop()):"changed"===e.data?(r.Log.debug("CheckSessionIFrame: changed message from check session op iframe"),this.stop(),this._callback()):r.Log.debug("CheckSessionIFrame: "+e.data+" message from check session op iframe"))},e.prototype.start=function(e){var t=this;if(this._session_state!==e){r.Log.debug("CheckSessionIFrame.start"),this.stop(),this._session_state=e;var n=function(){t._frame.contentWindow.postMessage(t._client_id+" "+t._session_state,t._frame_origin)};n(),this._timer=window.setInterval(n,this._interval)}},e.prototype.stop=function(){this._session_state=null,this._timer&&(r.Log.debug("CheckSessionIFrame.stop"),window.clearInterval(this._timer),this._timer=null)},e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenRevocationClient=void 0;var r=n(0),i=n(2),o=n(1);function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a="access_token",u="refresh_token";t.TokenRevocationClient=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.Global.XMLHttpRequest,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.MetadataService;if(s(this,e),!t)throw r.Log.error("TokenRevocationClient.ctor: No settings provided"),new Error("No settings provided.");this._settings=t,this._XMLHttpRequestCtor=n,this._metadataService=new a(this._settings)}return e.prototype.revoke=function(e,t){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"access_token";if(!e)throw r.Log.error("TokenRevocationClient.revoke: No token provided"),new Error("No token provided.");if(i!==a&&i!=u)throw r.Log.error("TokenRevocationClient.revoke: Invalid token type"),new Error("Invalid token type.");return this._metadataService.getRevocationEndpoint().then((function(o){if(o){r.Log.debug("TokenRevocationClient.revoke: Revoking "+i);var s=n._settings.client_id,a=n._settings.client_secret;return n._revoke(o,s,a,e,i)}if(t)throw r.Log.error("TokenRevocationClient.revoke: Revocation not supported"),new Error("Revocation not supported")}))},e.prototype._revoke=function(e,t,n,i,o){var s=this;return new Promise((function(a,u){var l=new s._XMLHttpRequestCtor;l.open("POST",e),l.onload=function(){r.Log.debug("TokenRevocationClient.revoke: HTTP response received, status",l.status),200===l.status?a():u(Error(l.statusText+" ("+l.status+")"))},l.onerror=function(){r.Log.debug("TokenRevocationClient.revoke: Network Error."),u("Network Error")};var c="client_id="+encodeURIComponent(t);n&&(c+="&client_secret="+encodeURIComponent(n)),c+="&token_type_hint="+encodeURIComponent(o),c+="&token="+encodeURIComponent(i),l.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),l.send(c)}))},e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CordovaPopupWindow=void 0;var r=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:o.MetadataService,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.UserInfoService,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.JoseUtil,d=arguments.length>4&&void 0!==arguments[4]?arguments[4]:a.TokenClient;if(c(this,e),!t)throw i.Log.error("ResponseValidator.ctor: No settings passed to ResponseValidator"),new Error("settings");this._settings=t,this._metadataService=new n(this._settings),this._userInfoService=new r(this._settings),this._joseUtil=u,this._tokenClient=new d(this._settings)}return e.prototype.validateSigninResponse=function(e,t){var n=this;return i.Log.debug("ResponseValidator.validateSigninResponse"),this._processSigninParams(e,t).then((function(t){return i.Log.debug("ResponseValidator.validateSigninResponse: state processed"),n._validateTokens(e,t).then((function(t){return i.Log.debug("ResponseValidator.validateSigninResponse: tokens validated"),n._processClaims(e,t).then((function(e){return i.Log.debug("ResponseValidator.validateSigninResponse: claims processed"),e}))}))}))},e.prototype.validateSignoutResponse=function(e,t){return e.id!==t.state?(i.Log.error("ResponseValidator.validateSignoutResponse: State does not match"),Promise.reject(new Error("State does not match"))):(i.Log.debug("ResponseValidator.validateSignoutResponse: state validated"),t.state=e.data,t.error?(i.Log.warn("ResponseValidator.validateSignoutResponse: Response was error",t.error),Promise.reject(new u.ErrorResponse(t))):Promise.resolve(t))},e.prototype._processSigninParams=function(e,t){if(e.id!==t.state)return i.Log.error("ResponseValidator._processSigninParams: State does not match"),Promise.reject(new Error("State does not match"));if(!e.client_id)return i.Log.error("ResponseValidator._processSigninParams: No client_id on state"),Promise.reject(new Error("No client_id on state"));if(!e.authority)return i.Log.error("ResponseValidator._processSigninParams: No authority on state"),Promise.reject(new Error("No authority on state"));if(this._settings.authority){if(this._settings.authority&&this._settings.authority!==e.authority)return i.Log.error("ResponseValidator._processSigninParams: authority mismatch on settings vs. signin state"),Promise.reject(new Error("authority mismatch on settings vs. signin state"))}else this._settings.authority=e.authority;if(this._settings.client_id){if(this._settings.client_id&&this._settings.client_id!==e.client_id)return i.Log.error("ResponseValidator._processSigninParams: client_id mismatch on settings vs. signin state"),Promise.reject(new Error("client_id mismatch on settings vs. signin state"))}else this._settings.client_id=e.client_id;return i.Log.debug("ResponseValidator._processSigninParams: state validated"),t.state=e.data,t.error?(i.Log.warn("ResponseValidator._processSigninParams: Response was error",t.error),Promise.reject(new u.ErrorResponse(t))):e.nonce&&!t.id_token?(i.Log.error("ResponseValidator._processSigninParams: Expecting id_token in response"),Promise.reject(new Error("No id_token in response"))):!e.nonce&&t.id_token?(i.Log.error("ResponseValidator._processSigninParams: Not expecting id_token in response"),Promise.reject(new Error("Unexpected id_token in response"))):e.code_verifier&&!t.code?(i.Log.error("ResponseValidator._processSigninParams: Expecting code in response"),Promise.reject(new Error("No code in response"))):!e.code_verifier&&t.code?(i.Log.error("ResponseValidator._processSigninParams: Not expecting code in response"),Promise.reject(new Error("Unexpected code in response"))):(t.scope||(t.scope=e.scope),Promise.resolve(t))},e.prototype._processClaims=function(e,t){var n=this;if(t.isOpenIdConnect){if(i.Log.debug("ResponseValidator._processClaims: response is OIDC, processing claims"),t.profile=this._filterProtocolClaims(t.profile),!0!==e.skipUserInfo&&this._settings.loadUserInfo&&t.access_token)return i.Log.debug("ResponseValidator._processClaims: loading user info"),this._userInfoService.getClaims(t.access_token).then((function(e){return i.Log.debug("ResponseValidator._processClaims: user info claims received from user info endpoint"),e.sub!==t.profile.sub?(i.Log.error("ResponseValidator._processClaims: sub from user info endpoint does not match sub in id_token"),Promise.reject(new Error("sub from user info endpoint does not match sub in id_token"))):(t.profile=n._mergeClaims(t.profile,e),i.Log.debug("ResponseValidator._processClaims: user info claims received, updated profile:",t.profile),t)}));i.Log.debug("ResponseValidator._processClaims: not loading user info")}else i.Log.debug("ResponseValidator._processClaims: response is not OIDC, not processing claims");return Promise.resolve(t)},e.prototype._mergeClaims=function(e,t){var n=Object.assign({},e);for(var i in t){var o=t[i];Array.isArray(o)||(o=[o]);for(var s=0;s1)return i.Log.error("ResponseValidator._validateIdToken: No kid found in id_token and more than one key found in metadata"),Promise.reject(new Error("No kid found in id_token and more than one key found in metadata"));o=n[0]}return Promise.resolve(o)}))},e.prototype._getSigningKeyForJwtWithSingleRetry=function(e){var t=this;return this._getSigningKeyForJwt(e).then((function(n){return n?Promise.resolve(n):(t._metadataService.resetSigningKeys(),t._getSigningKeyForJwt(e))}))},e.prototype._validateIdToken=function(e,t){var n=this;if(!e.nonce)return i.Log.error("ResponseValidator._validateIdToken: No nonce on state"),Promise.reject(new Error("No nonce on state"));var r=this._joseUtil.parseJwt(t.id_token);return r&&r.header&&r.payload?e.nonce!==r.payload.nonce?(i.Log.error("ResponseValidator._validateIdToken: Invalid nonce in id_token"),Promise.reject(new Error("Invalid nonce in id_token"))):this._metadataService.getIssuer().then((function(o){return i.Log.debug("ResponseValidator._validateIdToken: Received issuer"),n._getSigningKeyForJwtWithSingleRetry(r).then((function(s){if(!s)return i.Log.error("ResponseValidator._validateIdToken: No key matching kid or alg found in signing keys"),Promise.reject(new Error("No key matching kid or alg found in signing keys"));var a=e.client_id,u=n._settings.clockSkew;return i.Log.debug("ResponseValidator._validateIdToken: Validaing JWT; using clock skew (in seconds) of: ",u),n._joseUtil.validateJwt(t.id_token,s,o,a,u).then((function(){return i.Log.debug("ResponseValidator._validateIdToken: JWT validation successful"),r.payload.sub?(t.profile=r.payload,t):(i.Log.error("ResponseValidator._validateIdToken: No sub present in id_token"),Promise.reject(new Error("No sub present in id_token")))}))}))})):(i.Log.error("ResponseValidator._validateIdToken: Failed to parse id_token",r),Promise.reject(new Error("Failed to parse id_token")))},e.prototype._filterByAlg=function(e,t){var n=null;if(t.startsWith("RS"))n="RSA";else if(t.startsWith("PS"))n="PS";else{if(!t.startsWith("ES"))return i.Log.debug("ResponseValidator._filterByAlg: alg not supported: ",t),[];n="EC"}return i.Log.debug("ResponseValidator._filterByAlg: Looking for keys that match kty: ",n),e=e.filter((function(e){return e.kty===n})),i.Log.debug("ResponseValidator._filterByAlg: Number of keys that match kty: ",n,e.length),e},e.prototype._validateAccessToken=function(e){if(!e.profile)return i.Log.error("ResponseValidator._validateAccessToken: No profile loaded from id_token"),Promise.reject(new Error("No profile loaded from id_token"));if(!e.profile.at_hash)return i.Log.error("ResponseValidator._validateAccessToken: No at_hash in id_token"),Promise.reject(new Error("No at_hash in id_token"));if(!e.id_token)return i.Log.error("ResponseValidator._validateAccessToken: No id_token"),Promise.reject(new Error("No id_token"));var t=this._joseUtil.parseJwt(e.id_token);if(!t||!t.header)return i.Log.error("ResponseValidator._validateAccessToken: Failed to parse id_token",t),Promise.reject(new Error("Failed to parse id_token"));var n=t.header.alg;if(!n||5!==n.length)return i.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",n),Promise.reject(new Error("Unsupported alg: "+n));var r=n.substr(2,3);if(!r)return i.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",n,r),Promise.reject(new Error("Unsupported alg: "+n));if(256!==(r=parseInt(r))&&384!==r&&512!==r)return i.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",n,r),Promise.reject(new Error("Unsupported alg: "+n));var o="sha"+r,s=this._joseUtil.hashString(e.access_token,o);if(!s)return i.Log.error("ResponseValidator._validateAccessToken: access_token hash failed:",o),Promise.reject(new Error("Failed to validate at_hash"));var a=s.substr(0,s.length/2),u=this._joseUtil.hexToBase64Url(a);return u!==e.profile.at_hash?(i.Log.error("ResponseValidator._validateAccessToken: Failed to validate at_hash",u,e.profile.at_hash),Promise.reject(new Error("Failed to validate at_hash"))):(i.Log.debug("ResponseValidator._validateAccessToken: success"),Promise.resolve(e))},e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UserInfoService=void 0;var r=n(7),i=n(2),o=n(0),s=n(4);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.UserInfoService=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.JsonService,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.MetadataService,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:s.JoseUtil;if(a(this,e),!t)throw o.Log.error("UserInfoService.ctor: No settings passed"),new Error("settings");this._settings=t,this._jsonService=new n(void 0,void 0,this._getClaimsFromJwt.bind(this)),this._metadataService=new u(this._settings),this._joseUtil=l}return e.prototype.getClaims=function(e){var t=this;return e?this._metadataService.getUserInfoEndpoint().then((function(n){return o.Log.debug("UserInfoService.getClaims: received userinfo url",n),t._jsonService.getJson(n,e).then((function(e){return o.Log.debug("UserInfoService.getClaims: claims received",e),e}))})):(o.Log.error("UserInfoService.getClaims: No token passed"),Promise.reject(new Error("A token is required")))},e.prototype._getClaimsFromJwt=function e(t){var n=this;try{var r=this._joseUtil.parseJwt(t.responseText);if(!r||!r.header||!r.payload)return o.Log.error("UserInfoService._getClaimsFromJwt: Failed to parse JWT",r),Promise.reject(new Error("Failed to parse id_token"));var i=r.header.kid,s=void 0;switch(this._settings.userInfoJwtIssuer){case"OP":s=this._metadataService.getIssuer();break;case"ANY":s=Promise.resolve(r.payload.iss);break;default:s=Promise.resolve(this._settings.userInfoJwtIssuer)}return s.then((function(e){return o.Log.debug("UserInfoService._getClaimsFromJwt: Received issuer:"+e),n._metadataService.getSigningKeys().then((function(s){if(!s)return o.Log.error("UserInfoService._getClaimsFromJwt: No signing keys from metadata"),Promise.reject(new Error("No signing keys from metadata"));o.Log.debug("UserInfoService._getClaimsFromJwt: Received signing keys");var a=void 0;if(i)a=s.filter((function(e){return e.kid===i}))[0];else{if((s=n._filterByAlg(s,r.header.alg)).length>1)return o.Log.error("UserInfoService._getClaimsFromJwt: No kid found in id_token and more than one key found in metadata"),Promise.reject(new Error("No kid found in id_token and more than one key found in metadata"));a=s[0]}if(!a)return o.Log.error("UserInfoService._getClaimsFromJwt: No key matching kid or alg found in signing keys"),Promise.reject(new Error("No key matching kid or alg found in signing keys"));var u=n._settings.client_id,l=n._settings.clockSkew;return o.Log.debug("UserInfoService._getClaimsFromJwt: Validaing JWT; using clock skew (in seconds) of: ",l),n._joseUtil.validateJwt(t.responseText,a,e,u,l,void 0,!0).then((function(){return o.Log.debug("UserInfoService._getClaimsFromJwt: JWT validation successful"),r.payload}))}))}))}catch(e){return o.Log.error("UserInfoService._getClaimsFromJwt: Error parsing JWT response",e.message),void reject(e)}},e.prototype._filterByAlg=function(e,t){var n=null;if(t.startsWith("RS"))n="RSA";else if(t.startsWith("PS"))n="PS";else{if(!t.startsWith("ES"))return o.Log.debug("UserInfoService._filterByAlg: alg not supported: ",t),[];n="EC"}return o.Log.debug("UserInfoService._filterByAlg: Looking for keys that match kty: ",n),e=e.filter((function(e){return e.kty===n})),o.Log.debug("UserInfoService._filterByAlg: Number of keys that match kty: ",n,e.length),e},e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AllowedSigningAlgs=t.b64tohex=t.hextob64u=t.crypto=t.X509=t.KeyUtil=t.jws=void 0;var r=n(27);t.jws=r.jws,t.KeyUtil=r.KEYUTIL,t.X509=r.X509,t.crypto=r.crypto,t.hextob64u=r.hextob64u,t.b64tohex=r.b64tohex,t.AllowedSigningAlgs=["RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"]},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n,r,i,o,s,a,u,l,c,d,h,f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p={userAgent:!1},g={},m=m||(n=Math,i=(r={}).lib={},o=i.Base=function(){function e(){}return{extend:function(t){e.prototype=this;var n=new e;return t&&n.mixIn(t),n.hasOwnProperty("init")||(n.init=function(){n.$super.init.apply(this,arguments)}),n.init.prototype=n,n.$super=this,n},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),s=i.WordArray=o.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var o=0;o>>2]>>>24-o%4*8&255;t[r+o>>>2]|=s<<24-(r+o)%4*8}else for(o=0;o>>2]=n[o>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,t=this.sigBytes;e[t>>>2]&=4294967295<<32-t%4*8,e.length=n.ceil(t/4)},clone:function(){var e=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new s.init(n,t/2)}},l=a.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new s.init(n,t)}},c=a.Utf8={stringify:function(t){try{return decodeURIComponent(escape(l.stringify(t)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return l.parse(unescape(encodeURIComponent(e)))}},d=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=c.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var t=this._data,r=t.words,i=t.sigBytes,o=this.blockSize,a=i/(4*o),u=(a=e?n.ceil(a):n.max((0|a)-this._minBufferSize,0))*o,l=n.min(4*u,i);if(u){for(var c=0;c>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,s=0;4>s&&i+.75*s>>6*(3-s)&63));if(t=r.charAt(64))for(;e.length%4;)e.push(t);return e.join("")},parse:function(e){var n=e.length,r=this._map;(i=r.charAt(64))&&-1!=(i=e.indexOf(i))&&(n=i);for(var i=[],o=0,s=0;s>>6-s%4*2;i[o>>>2]|=(a|u)<<24-o%4*8,o++}return t.create(i,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(e){for(var t=m,n=(i=t.lib).WordArray,r=i.Hasher,i=t.algo,o=[],s=[],a=function(e){return 4294967296*(e-(0|e))|0},u=2,l=0;64>l;){var c;e:{c=u;for(var d=e.sqrt(c),h=2;h<=d;h++)if(!(c%h)){c=!1;break e}c=!0}c&&(8>l&&(o[l]=a(e.pow(u,.5))),s[l]=a(e.pow(u,1/3)),l++),u++}var f=[];i=i.SHA256=r.extend({_doReset:function(){this._hash=new n.init(o.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],a=n[3],u=n[4],l=n[5],c=n[6],d=n[7],h=0;64>h;h++){if(16>h)f[h]=0|e[t+h];else{var p=f[h-15],g=f[h-2];f[h]=((p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3)+f[h-7]+((g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10)+f[h-16]}p=d+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+(u&l^~u&c)+s[h]+f[h],g=((r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22))+(r&i^r&o^i&o),d=c,c=l,l=u,u=a+p|0,a=o,o=i,i=r,r=p+g|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+u|0,n[5]=n[5]+l|0,n[6]=n[6]+c|0,n[7]=n[7]+d|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=e.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}}),t.SHA256=r._createHelper(i),t.HmacSHA256=r._createHmacHelper(i)}(Math),function(){function e(){return r.create.apply(r,arguments)}for(var t=m,n=t.lib.Hasher,r=(o=t.x64).Word,i=o.WordArray,o=t.algo,s=[e(1116352408,3609767458),e(1899447441,602891725),e(3049323471,3964484399),e(3921009573,2173295548),e(961987163,4081628472),e(1508970993,3053834265),e(2453635748,2937671579),e(2870763221,3664609560),e(3624381080,2734883394),e(310598401,1164996542),e(607225278,1323610764),e(1426881987,3590304994),e(1925078388,4068182383),e(2162078206,991336113),e(2614888103,633803317),e(3248222580,3479774868),e(3835390401,2666613458),e(4022224774,944711139),e(264347078,2341262773),e(604807628,2007800933),e(770255983,1495990901),e(1249150122,1856431235),e(1555081692,3175218132),e(1996064986,2198950837),e(2554220882,3999719339),e(2821834349,766784016),e(2952996808,2566594879),e(3210313671,3203337956),e(3336571891,1034457026),e(3584528711,2466948901),e(113926993,3758326383),e(338241895,168717936),e(666307205,1188179964),e(773529912,1546045734),e(1294757372,1522805485),e(1396182291,2643833823),e(1695183700,2343527390),e(1986661051,1014477480),e(2177026350,1206759142),e(2456956037,344077627),e(2730485921,1290863460),e(2820302411,3158454273),e(3259730800,3505952657),e(3345764771,106217008),e(3516065817,3606008344),e(3600352804,1432725776),e(4094571909,1467031594),e(275423344,851169720),e(430227734,3100823752),e(506948616,1363258195),e(659060556,3750685593),e(883997877,3785050280),e(958139571,3318307427),e(1322822218,3812723403),e(1537002063,2003034995),e(1747873779,3602036899),e(1955562222,1575990012),e(2024104815,1125592928),e(2227730452,2716904306),e(2361852424,442776044),e(2428436474,593698344),e(2756734187,3733110249),e(3204031479,2999351573),e(3329325298,3815920427),e(3391569614,3928383900),e(3515267271,566280711),e(3940187606,3454069534),e(4118630271,4000239992),e(116418474,1914138554),e(174292421,2731055270),e(289380356,3203993006),e(460393269,320620315),e(685471733,587496836),e(852142971,1086792851),e(1017036298,365543100),e(1126000580,2618297676),e(1288033470,3409855158),e(1501505948,4234509866),e(1607167915,987167468),e(1816402316,1246189591)],a=[],u=0;80>u;u++)a[u]=e();o=o.SHA512=n.extend({_doReset:function(){this._hash=new i.init([new r.init(1779033703,4089235720),new r.init(3144134277,2227873595),new r.init(1013904242,4271175723),new r.init(2773480762,1595750129),new r.init(1359893119,2917565137),new r.init(2600822924,725511199),new r.init(528734635,4215389547),new r.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var n=(d=this._hash.words)[0],r=d[1],i=d[2],o=d[3],u=d[4],l=d[5],c=d[6],d=d[7],h=n.high,f=n.low,p=r.high,g=r.low,m=i.high,y=i.low,v=o.high,w=o.low,_=u.high,b=u.low,S=l.high,x=l.low,E=c.high,k=c.low,C=d.high,P=d.low,T=h,A=f,O=p,I=g,j=m,L=y,R=v,F=w,M=_,N=b,D=S,U=x,$=E,B=k,z=C,H=P,V=0;80>V;V++){var q=a[V];if(16>V)var W=q.high=0|e[t+2*V],K=q.low=0|e[t+2*V+1];else{W=((K=(W=a[V-15]).high)>>>1|(Z=W.low)<<31)^(K>>>8|Z<<24)^K>>>7;var Z=(Z>>>1|K<<31)^(Z>>>8|K<<24)^(Z>>>7|K<<25),G=((K=(G=a[V-2]).high)>>>19|(J=G.low)<<13)^(K<<3|J>>>29)^K>>>6,J=(J>>>19|K<<13)^(J<<3|K>>>29)^(J>>>6|K<<26),Q=(K=a[V-7]).high,Y=(X=a[V-16]).high,X=X.low;W=(W=(W=W+Q+((K=Z+K.low)>>>0>>0?1:0))+G+((K+=J)>>>0>>0?1:0))+Y+((K+=X)>>>0>>0?1:0),q.high=W,q.low=K}Q=M&D^~M&$,X=N&U^~N&B,q=T&O^T&j^O&j;var ee=A&I^A&L^I&L,te=(Z=(T>>>28|A<<4)^(T<<30|A>>>2)^(T<<25|A>>>7),G=(A>>>28|T<<4)^(A<<30|T>>>2)^(A<<25|T>>>7),(J=s[V]).high),ne=J.low;Y=z+((M>>>14|N<<18)^(M>>>18|N<<14)^(M<<23|N>>>9))+((J=H+((N>>>14|M<<18)^(N>>>18|M<<14)^(N<<23|M>>>9)))>>>0>>0?1:0),z=$,H=B,$=D,B=U,D=M,U=N,M=R+(Y=(Y=(Y=Y+Q+((J+=X)>>>0>>0?1:0))+te+((J+=ne)>>>0>>0?1:0))+W+((J+=K)>>>0>>0?1:0))+((N=F+J|0)>>>0>>0?1:0)|0,R=j,F=L,j=O,L=I,O=T,I=A,T=Y+(q=Z+q+((K=G+ee)>>>0>>0?1:0))+((A=J+K|0)>>>0>>0?1:0)|0}f=n.low=f+A,n.high=h+T+(f>>>0>>0?1:0),g=r.low=g+I,r.high=p+O+(g>>>0>>0?1:0),y=i.low=y+L,i.high=m+j+(y>>>0>>0?1:0),w=o.low=w+F,o.high=v+R+(w>>>0>>0?1:0),b=u.low=b+N,u.high=_+M+(b>>>0>>0?1:0),x=l.low=x+U,l.high=S+D+(x>>>0>>0?1:0),k=c.low=k+B,c.high=E+$+(k>>>0>>0?1:0),P=d.low=P+H,d.high=C+z+(P>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),t[31+(r+128>>>10<<5)]=n,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32}),t.SHA512=n._createHelper(o),t.HmacSHA512=n._createHmacHelper(o)}(),function(){var e=m,t=(i=e.x64).Word,n=i.WordArray,r=(i=e.algo).SHA512,i=i.SHA384=r.extend({_doReset:function(){this._hash=new n.init([new t.init(3418070365,3238371032),new t.init(1654270250,914150663),new t.init(2438529370,812702999),new t.init(355462360,4144912697),new t.init(1731405415,4290775857),new t.init(2394180231,1750603025),new t.init(3675008525,1694076839),new t.init(1203062813,3204075428)])},_doFinalize:function(){var e=r._doFinalize.call(this);return e.sigBytes-=16,e}});e.SHA384=r._createHelper(i),e.HmacSHA384=r._createHmacHelper(i)}();var y,v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function w(e){var t,n,r="";for(t=0;t+3<=e.length;t+=3)n=parseInt(e.substring(t,t+3),16),r+=v.charAt(n>>6)+v.charAt(63&n);for(t+1==e.length?(n=parseInt(e.substring(t,t+1),16),r+=v.charAt(n<<2)):t+2==e.length&&(n=parseInt(e.substring(t,t+2),16),r+=v.charAt(n>>2)+v.charAt((3&n)<<4));(3&r.length)>0;)r+="=";return r}function _(e){var t,n,r,i="",o=0;for(t=0;t>2),n=3&r,o=1):1==o?(i+=P(n<<2|r>>4),n=15&r,o=2):2==o?(i+=P(n),i+=P(r>>2),n=3&r,o=3):(i+=P(n<<2|r>>4),i+=P(15&r),o=0));return 1==o&&(i+=P(n<<2)),i}function b(e){var t,n=_(e),r=new Array;for(t=0;2*t>15;--o>=0;){var u=32767&this[e],l=this[e++]>>15,c=a*u+l*s;i=((u=s*u+((32767&c)<<15)+n[r]+(1073741823&i))>>>30)+(c>>>15)+a*l+(i>>>30),n[r++]=1073741823&u}return i},y=30):"Netscape"!=p.appName?(S.prototype.am=function(e,t,n,r,i,o){for(;--o>=0;){var s=t*this[e++]+n[r]+i;i=Math.floor(s/67108864),n[r++]=67108863&s}return i},y=26):(S.prototype.am=function(e,t,n,r,i,o){for(var s=16383&t,a=t>>14;--o>=0;){var u=16383&this[e],l=this[e++]>>14,c=a*u+l*s;i=((u=s*u+((16383&c)<<14)+n[r]+i)>>28)+(c>>14)+a*l,n[r++]=268435455&u}return i},y=28),S.prototype.DB=y,S.prototype.DM=(1<>>16)&&(e=t,n+=16),0!=(t=e>>8)&&(e=t,n+=8),0!=(t=e>>4)&&(e=t,n+=4),0!=(t=e>>2)&&(e=t,n+=2),0!=(t=e>>1)&&(e=t,n+=1),n}function I(e){this.m=e}function j(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function D(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function U(){}function $(e){return e}function B(e){this.r2=x(),this.q3=x(),S.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}I.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},I.prototype.revert=function(e){return e},I.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},I.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},I.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},j.prototype.convert=function(e){var t=x();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(S.ZERO)>0&&this.m.subTo(t,t),t},j.prototype.revert=function(e){var t=x();return e.copyTo(t),this.reduce(t),t},j.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t>15)*this.mpl&this.um)<<15)&e.DM;for(e[n=t+this.m.t]+=this.m.am(0,r,e,t,0,this.m.t);e[n]>=e.DV;)e[n]-=e.DV,e[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},j.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},j.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},S.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},S.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},S.prototype.fromString=function(e,t){var n;if(16==t)n=4;else if(8==t)n=3;else if(256==t)n=8;else if(2==t)n=1;else if(32==t)n=5;else{if(4!=t)return void this.fromRadix(e,t);n=2}this.t=0,this.s=0;for(var r=e.length,i=!1,o=0;--r>=0;){var s=8==n?255&e[r]:T(e,r);s<0?"-"==e.charAt(r)&&(i=!0):(i=!1,0==o?this[this.t++]=s:o+n>this.DB?(this[this.t-1]|=(s&(1<>this.DB-o):this[this.t-1]|=s<=this.DB&&(o-=this.DB))}8==n&&0!=(128&e[0])&&(this.s=-1,o>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==e;)--this.t},S.prototype.dlShiftTo=function(e,t){var n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e,t.s=this.s},S.prototype.drShiftTo=function(e,t){for(var n=e;n=0;--n)t[n+s+1]=this[n]>>i|a,a=(this[n]&o)<=0;--n)t[n]=0;t[s]=a,t.t=this.t+s+1,t.s=this.s,t.clamp()},S.prototype.rShiftTo=function(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t)t.t=0;else{var r=e%this.DB,i=this.DB-r,o=(1<>r;for(var s=n+1;s>r;r>0&&(t[this.t-n-1]|=(this.s&o)<>=this.DB;if(e.t>=this.DB;r+=this.s}else{for(r+=this.s;n>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t[n++]=this.DV+r:r>0&&(t[n++]=r),t.t=n,t.clamp()},S.prototype.multiplyTo=function(e,t){var n=this.abs(),r=e.abs(),i=n.t;for(t.t=i+r.t;--i>=0;)t[i]=0;for(i=0;i=0;)e[n]=0;for(n=0;n=t.DV&&(e[n+t.t]-=t.DV,e[n+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(n,t[n],e,2*n,0,1)),e.s=0,e.clamp()},S.prototype.divRemTo=function(e,t,n){var r=e.abs();if(!(r.t<=0)){var i=this.abs();if(i.t0?(r.lShiftTo(u,o),i.lShiftTo(u,n)):(r.copyTo(o),i.copyTo(n));var l=o.t,c=o[l-1];if(0!=c){var d=c*(1<1?o[l-2]>>this.F2:0),h=this.FV/d,f=(1<=0&&(n[n.t++]=1,n.subTo(y,n)),S.ONE.dlShiftTo(l,y),y.subTo(o,o);o.t=0;){var v=n[--g]==c?this.DM:Math.floor(n[g]*h+(n[g-1]+p)*f);if((n[g]+=o.am(0,v,n,m,0,l))0&&n.rShiftTo(u,n),s<0&&S.ZERO.subTo(n,n)}}},S.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},S.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},S.prototype.exp=function(e,t){if(e>4294967295||e<1)return S.ONE;var n=x(),r=x(),i=t.convert(this),o=O(e)-1;for(i.copyTo(n);--o>=0;)if(t.sqrTo(n,r),(e&1<0)t.mulTo(r,i,n);else{var s=n;n=r,r=s}return t.revert(n)},S.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var n,r=(1<0)for(a>a)>0&&(i=!0,o=P(n));s>=0;)a>(a+=this.DB-t)):(n=this[s]>>(a-=t)&r,a<=0&&(a+=this.DB,--s)),n>0&&(i=!0),i&&(o+=P(n));return i?o:"0"},S.prototype.negate=function(){var e=x();return S.ZERO.subTo(this,e),e},S.prototype.abs=function(){return this.s<0?this.negate():this},S.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var n=this.t;if(0!=(t=n-e.t))return this.s<0?-t:t;for(;--n>=0;)if(0!=(t=this[n]-e[n]))return t;return 0},S.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+O(this[this.t-1]^this.s&this.DM)},S.prototype.mod=function(e){var t=x();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(S.ZERO)>0&&e.subTo(t,t),t},S.prototype.modPowInt=function(e,t){var n;return n=e<256||t.isEven()?new I(t):new j(t),this.exp(e,n)},S.ZERO=A(0),S.ONE=A(1),U.prototype.convert=$,U.prototype.revert=$,U.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n)},U.prototype.sqrTo=function(e,t){e.squareTo(t)},B.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=x();return e.copyTo(t),this.reduce(t),t},B.prototype.revert=function(e){return e},B.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},B.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},B.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var z,H,V,q=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],W=(1<<26)/q[q.length-1];function K(){this.i=0,this.j=0,this.S=new Array}function Z(){!function(e){H[V++]^=255&e,H[V++]^=e>>8&255,H[V++]^=e>>16&255,H[V++]^=e>>24&255,V>=256&&(V-=256)}((new Date).getTime())}if(S.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},S.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),n=Math.pow(e,t),r=A(n),i=x(),o=x(),s="";for(this.divRemTo(r,i,o);i.signum()>0;)s=(n+o.intValue()).toString(e).substr(1)+s,i.divRemTo(r,i,o);return o.intValue().toString(e)+s},S.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var n=this.chunkSize(t),r=Math.pow(t,n),i=!1,o=0,s=0,a=0;a=n&&(this.dMultiply(r),this.dAddOffset(s,0),o=0,s=0))}o>0&&(this.dMultiply(Math.pow(t,o)),this.dAddOffset(s,0)),i&&S.ZERO.subTo(this,this)},S.prototype.fromNumber=function(e,t,n){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,n),this.testBit(e-1)||this.bitwiseTo(S.ONE.shiftLeft(e-1),R,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(S.ONE.shiftLeft(e-1),this);else{var r=new Array,i=7&e;r.length=1+(e>>3),t.nextBytes(r),i>0?r[0]&=(1<>=this.DB;if(e.t>=this.DB;r+=this.s}else{for(r+=this.s;n>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t[n++]=r:r<-1&&(t[n++]=this.DV+r),t.t=n,t.clamp()},S.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},S.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},S.prototype.multiplyLowerTo=function(e,t,n){var r,i=Math.min(this.t+e.t,t);for(n.s=0,n.t=i;i>0;)n[--i]=0;for(r=n.t-this.t;i=0;)n[r]=0;for(r=Math.max(t-this.t,0);r0)if(0==t)n=this[0]%e;else for(var r=this.t-1;r>=0;--r)n=(t*n+this[r])%e;return n},S.prototype.millerRabin=function(e){var t=this.subtract(S.ONE),n=t.getLowestSetBit();if(n<=0)return!1;var r=t.shiftRight(n);(e=e+1>>1)>q.length&&(e=q.length);for(var i=x(),o=0;o>24},S.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},S.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},S.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var n,r=this.DB-e*this.DB%8,i=0;if(e-- >0)for(r>r)!=(this.s&this.DM)>>r&&(t[i++]=n|this.s<=0;)r<8?(n=(this[e]&(1<>(r+=this.DB-8)):(n=this[e]>>(r-=8)&255,r<=0&&(r+=this.DB,--e)),0!=(128&n)&&(n|=-256),0==i&&(128&this.s)!=(128&n)&&++i,(i>0||n!=this.s)&&(t[i++]=n);return t},S.prototype.equals=function(e){return 0==this.compareTo(e)},S.prototype.min=function(e){return this.compareTo(e)<0?this:e},S.prototype.max=function(e){return this.compareTo(e)>0?this:e},S.prototype.and=function(e){var t=x();return this.bitwiseTo(e,L,t),t},S.prototype.or=function(e){var t=x();return this.bitwiseTo(e,R,t),t},S.prototype.xor=function(e){var t=x();return this.bitwiseTo(e,F,t),t},S.prototype.andNot=function(e){var t=x();return this.bitwiseTo(e,M,t),t},S.prototype.not=function(){for(var e=x(),t=0;t=this.t?0!=this.s:0!=(this[t]&1<1){var c=x();for(r.sqrTo(s[1],c);a<=l;)s[a]=x(),r.mulTo(c,s[a-2],s[a]),a+=2}var d,h,f=e.t-1,p=!0,g=x();for(i=O(e[f])-1;f>=0;){for(i>=u?d=e[f]>>i-u&l:(d=(e[f]&(1<0&&(d|=e[f-1]>>this.DB+i-u)),a=n;0==(1&d);)d>>=1,--a;if((i-=a)<0&&(i+=this.DB,--f),p)s[d].copyTo(o),p=!1;else{for(;a>1;)r.sqrTo(o,g),r.sqrTo(g,o),a-=2;a>0?r.sqrTo(o,g):(h=o,o=g,g=h),r.mulTo(g,s[d],o)}for(;f>=0&&0==(e[f]&1<=0?(n.subTo(r,n),t&&i.subTo(s,i),o.subTo(a,o)):(r.subTo(n,r),t&&s.subTo(i,s),a.subTo(o,a))}return 0!=r.compareTo(S.ONE)?S.ZERO:a.compareTo(e)>=0?a.subtract(e):a.signum()<0?(a.addTo(e,a),a.signum()<0?a.add(e):a):a},S.prototype.pow=function(e){return this.exp(e,new U)},S.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),n=e.s<0?e.negate():e.clone();if(t.compareTo(n)<0){var r=t;t=n,n=r}var i=t.getLowestSetBit(),o=n.getLowestSetBit();if(o<0)return t;for(i0&&(t.rShiftTo(o,t),n.rShiftTo(o,n));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),t.compareTo(n)>=0?(t.subTo(n,t),t.rShiftTo(1,t)):(n.subTo(t,n),n.rShiftTo(1,n));return o>0&&n.lShiftTo(o,n),n},S.prototype.isProbablePrime=function(e){var t,n=this.abs();if(1==n.t&&n[0]<=q[q.length-1]){for(t=0;t>>8,H[V++]=255&G;V=0,Z()}function X(){if(null==z){for(Z(),(z=new K).init(H),V=0;V>24,(16711680&i)>>16,(65280&i)>>8,255&i]))),i+=1;return r}function re(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}function ie(e,t){this.x=t,this.q=e}function oe(e,t,n,r){this.curve=e,this.x=t,this.y=n,this.z=null==r?S.ONE:r,this.zinv=null}function se(e,t,n){this.q=e,this.a=this.fromBigInteger(t),this.b=this.fromBigInteger(n),this.infinity=new oe(this,null,null)}ee.prototype.nextBytes=function(e){var t;for(t=0;t0&&t.length>0))throw"Invalid RSA public key";this.n=te(e,16),this.e=parseInt(t,16)}},re.prototype.encrypt=function(e){var t=function(e,t){if(t=0&&t>0;){var i=e.charCodeAt(r--);i<128?n[--t]=i:i>127&&i<2048?(n[--t]=63&i|128,n[--t]=i>>6|192):(n[--t]=63&i|128,n[--t]=i>>6&63|128,n[--t]=i>>12|224)}n[--t]=0;for(var o=new ee,s=new Array;t>2;){for(s[0]=0;0==s[0];)o.nextBytes(s);n[--t]=s[0]}return n[--t]=2,n[--t]=0,new S(n)}(e,this.n.bitLength()+7>>3);if(null==t)return null;var n=this.doPublic(t);if(null==n)return null;var r=n.toString(16);return 0==(1&r.length)?r:"0"+r},re.prototype.encryptOAEP=function(e,t,n){var r=function(e,t,n,r){var i=ue.crypto.MessageDigest,o=ue.crypto.Util,s=null;if(n||(n="sha1"),"string"==typeof n&&(s=i.getCanonicalAlgName(n),r=i.getHashLength(s),n=function(e){return Se(o.hashHex(xe(e),s))}),e.length+2*r+2>t)throw"Message too long for RSA";var a,u="";for(a=0;a>3,t,n);if(null==r)return null;var i=this.doPublic(r);if(null==i)return null;var o=i.toString(16);return 0==(1&o.length)?o:"0"+o},re.prototype.type="RSA",ie.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.x.equals(e.x)},ie.prototype.toBigInteger=function(){return this.x},ie.prototype.negate=function(){return new ie(this.q,this.x.negate().mod(this.q))},ie.prototype.add=function(e){return new ie(this.q,this.x.add(e.toBigInteger()).mod(this.q))},ie.prototype.subtract=function(e){return new ie(this.q,this.x.subtract(e.toBigInteger()).mod(this.q))},ie.prototype.multiply=function(e){return new ie(this.q,this.x.multiply(e.toBigInteger()).mod(this.q))},ie.prototype.square=function(){return new ie(this.q,this.x.square().mod(this.q))},ie.prototype.divide=function(e){return new ie(this.q,this.x.multiply(e.toBigInteger().modInverse(this.q)).mod(this.q))},oe.prototype.getX=function(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))},oe.prototype.getY=function(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))},oe.prototype.equals=function(e){return e==this||(this.isInfinity()?e.isInfinity():e.isInfinity()?this.isInfinity():!!e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(S.ZERO)&&e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(S.ZERO))},oe.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(S.ZERO)&&!this.y.toBigInteger().equals(S.ZERO)},oe.prototype.negate=function(){return new oe(this.curve,this.x,this.y.negate(),this.z)},oe.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q),n=e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q);if(S.ZERO.equals(n))return S.ZERO.equals(t)?this.twice():this.curve.getInfinity();var r=new S("3"),i=this.x.toBigInteger(),o=this.y.toBigInteger(),s=(e.x.toBigInteger(),e.y.toBigInteger(),n.square()),a=s.multiply(n),u=i.multiply(s),l=t.square().multiply(this.z),c=l.subtract(u.shiftLeft(1)).multiply(e.z).subtract(a).multiply(n).mod(this.curve.q),d=u.multiply(r).multiply(t).subtract(o.multiply(a)).subtract(l.multiply(t)).multiply(e.z).add(t.multiply(a)).mod(this.curve.q),h=a.multiply(this.z).multiply(e.z).mod(this.curve.q);return new oe(this.curve,this.curve.fromBigInteger(c),this.curve.fromBigInteger(d),h)},oe.prototype.twice=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=new S("3"),t=this.x.toBigInteger(),n=this.y.toBigInteger(),r=n.multiply(this.z),i=r.multiply(n).mod(this.curve.q),o=this.curve.a.toBigInteger(),s=t.square().multiply(e);S.ZERO.equals(o)||(s=s.add(this.z.square().multiply(o)));var a=(s=s.mod(this.curve.q)).square().subtract(t.shiftLeft(3).multiply(i)).shiftLeft(1).multiply(r).mod(this.curve.q),u=s.multiply(e).multiply(t).subtract(i.shiftLeft(1)).shiftLeft(2).multiply(i).subtract(s.square().multiply(s)).mod(this.curve.q),l=r.square().multiply(r).shiftLeft(3).mod(this.curve.q);return new oe(this.curve,this.curve.fromBigInteger(a),this.curve.fromBigInteger(u),l)},oe.prototype.multiply=function(e){if(this.isInfinity())return this;if(0==e.signum())return this.curve.getInfinity();var t,n=e,r=n.multiply(new S("3")),i=this.negate(),o=this,s=this.curve.q.subtract(e),a=s.multiply(new S("3")),u=new oe(this.curve,this.x,this.y),l=u.negate();for(t=r.bitLength()-2;t>0;--t){o=o.twice();var c=r.testBit(t);c!=n.testBit(t)&&(o=o.add(c?this:i))}for(t=a.bitLength()-2;t>0;--t){u=u.twice();var d=a.testBit(t);d!=s.testBit(t)&&(u=u.add(d?u:l))}return o},oe.prototype.multiplyTwo=function(e,t,n){var r;r=e.bitLength()>n.bitLength()?e.bitLength()-1:n.bitLength()-1;for(var i=this.curve.getInfinity(),o=this.add(t);r>=0;)i=i.twice(),e.testBit(r)?i=n.testBit(r)?i.add(o):i.add(this):n.testBit(r)&&(i=i.add(t)),--r;return i},se.prototype.getQ=function(){return this.q},se.prototype.getA=function(){return this.a},se.prototype.getB=function(){return this.b},se.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.a.equals(e.a)&&this.b.equals(e.b)},se.prototype.getInfinity=function(){return this.infinity},se.prototype.fromBigInteger=function(e){return new ie(this.q,e)},se.prototype.decodePointHex=function(e){switch(parseInt(e.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:default:return null;case 4:case 6:case 7:var t=(e.length-2)/2,n=e.substr(2,t),r=e.substr(t+2,t);return new oe(this,this.fromBigInteger(new S(n,16)),this.fromBigInteger(new S(r,16)))}},ie.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bitLength()+7)/8)},oe.prototype.getEncoded=function(e){var t=function(e,t){var n=e.toByteArrayUnsigned();if(tn.length;)n.unshift(0);return n},n=this.getX().toBigInteger(),r=this.getY().toBigInteger(),i=t(n,32);return e?r.isEven()?i.unshift(2):i.unshift(3):(i.unshift(4),i=i.concat(t(r,32))),i},oe.decodeFrom=function(e,t){t[0];var n=t.length-1,r=t.slice(1,1+n/2),i=t.slice(1+n/2,1+n);r.unshift(0),i.unshift(0);var o=new S(r),s=new S(i);return new oe(e,e.fromBigInteger(o),e.fromBigInteger(s))},oe.decodeFromHex=function(e,t){t.substr(0,2);var n=t.length-2,r=t.substr(2,n/2),i=t.substr(2+n/2,n/2),o=new S(r,16),s=new S(i,16);return new oe(e,e.fromBigInteger(o),e.fromBigInteger(s))},oe.prototype.add2D=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;if(this.x.equals(e.x))return this.y.equals(e.y)?this.twice():this.curve.getInfinity();var t=e.x.subtract(this.x),n=e.y.subtract(this.y).divide(t),r=n.square().subtract(this.x).subtract(e.x),i=n.multiply(this.x.subtract(r)).subtract(this.y);return new oe(this.curve,r,i)},oe.prototype.twice2D=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=this.curve.fromBigInteger(S.valueOf(2)),t=this.curve.fromBigInteger(S.valueOf(3)),n=this.x.square().multiply(t).add(this.curve.a).divide(this.y.multiply(e)),r=n.square().subtract(this.x.multiply(e)),i=n.multiply(this.x.subtract(r)).subtract(this.y);return new oe(this.curve,r,i)},oe.prototype.multiply2D=function(e){if(this.isInfinity())return this;if(0==e.signum())return this.curve.getInfinity();var t,n=e,r=n.multiply(new S("3")),i=this.negate(),o=this;for(t=r.bitLength()-2;t>0;--t){o=o.twice();var s=r.testBit(t);s!=n.testBit(t)&&(o=o.add2D(s?this:i))}return o},oe.prototype.isOnCurve=function(){var e=this.getX().toBigInteger(),t=this.getY().toBigInteger(),n=this.curve.getA().toBigInteger(),r=this.curve.getB().toBigInteger(),i=this.curve.getQ(),o=t.multiply(t).mod(i),s=e.multiply(e).multiply(e).add(n.multiply(e)).add(r).mod(i);return o.equals(s)},oe.prototype.toString=function(){return"("+this.getX().toBigInteger().toString()+","+this.getY().toBigInteger().toString()+")"},oe.prototype.validate=function(){var e=this.curve.getQ();if(this.isInfinity())throw new Error("Point is at infinity.");var t=this.getX().toBigInteger(),n=this.getY().toBigInteger();if(t.compareTo(S.ONE)<0||t.compareTo(e.subtract(S.ONE))>0)throw new Error("x coordinate out of bounds");if(n.compareTo(S.ONE)<0||n.compareTo(e.subtract(S.ONE))>0)throw new Error("y coordinate out of bounds");if(!this.isOnCurve())throw new Error("Point is not on the curve.");if(this.multiply(e).isInfinity())throw new Error("Point is not a scalar multiple of G.");return!0};var ae=function(){var e=new RegExp('(?:false|true|null|[\\{\\}\\[\\]]|(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)|(?:"(?:[^\\0-\\x08\\x0a-\\x1f"\\\\]|\\\\(?:["/\\\\bfnrt]|u[0-9A-Fa-f]{4}))*"))',"g"),t=new RegExp("\\\\(?:([^u])|u(.{4}))","g"),n={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function r(e,t,r){return t?n[t]:String.fromCharCode(parseInt(r,16))}var i=new String(""),o=Object.hasOwnProperty;return function(n,s){var a,u,l=n.match(e),c=l[0],d=!1;"{"===c?a={}:"["===c?a=[]:(a=[],d=!0);for(var h=[a],p=1-d,g=l.length;p=0;)delete r[i[l]]}return s.call(t,n,r)}({"":a},"")),a}}();void 0!==ue&&ue||(t.KJUR=ue={}),void 0!==ue.asn1&&ue.asn1||(ue.asn1={}),ue.asn1.ASN1Util=new function(){this.integerToByteHex=function(e){var t=e.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(e){var t=e.toString(16);if("-"!=t.substr(0,1))t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var n=t.substr(1).length;n%2==1?n+=1:t.match(/^[0-7]/)||(n+=2);for(var r="",i=0;i15)throw"ASN.1 length too long to represent by 8x: n = "+e.toString(16);return(128+n).toString(16)+t},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""},this.setByParam=function(e){this.params=e},null!=e&&null!=e.tlv&&(this.hTLV=e.tlv,this.isModified=!1)},ue.asn1.DERAbstractString=function(e){ue.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=_e(this.s).toLowerCase()},this.setStringHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e?this.setString(e):void 0!==e.str?this.setString(e.str):void 0!==e.hex&&this.setStringHex(e.hex))},Be(ue.asn1.DERAbstractString,ue.asn1.ASN1Object),ue.asn1.DERAbstractTime=function(e){ue.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(e){var t=e.getTime()+6e4*e.getTimezoneOffset();return new Date(t)},this.formatDate=function(e,t,n){var r=this.zeroPadding,i=this.localDateToUTC(e),o=String(i.getFullYear());"utc"==t&&(o=o.substr(2,2));var s=o+r(String(i.getMonth()+1),2)+r(String(i.getDate()),2)+r(String(i.getHours()),2)+r(String(i.getMinutes()),2)+r(String(i.getSeconds()),2);if(!0===n){var a=i.getMilliseconds();if(0!=a){var u=r(String(a),3);s=s+"."+(u=u.replace(/[0]+$/,""))}}return s+"Z"},this.zeroPadding=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=ge(e)},this.setByDateValue=function(e,t,n,r,i,o){var s=new Date(Date.UTC(e,t-1,n,r,i,o,0));this.setByDate(s)},this.getFreshValueHex=function(){return this.hV}},Be(ue.asn1.DERAbstractTime,ue.asn1.ASN1Object),ue.asn1.DERAbstractStructured=function(e){ue.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array=e},this.appendASN1Object=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array.push(e)},this.asn1Array=new Array,void 0!==e&&void 0!==e.array&&(this.asn1Array=e.array)},Be(ue.asn1.DERAbstractStructured,ue.asn1.ASN1Object),ue.asn1.DERBoolean=function(e){ue.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV=0==e?"010100":"0101ff"},Be(ue.asn1.DERBoolean,ue.asn1.ASN1Object),ue.asn1.DERInteger=function(e){ue.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=ue.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new S(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.bigint?this.setByBigInteger(e.bigint):void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},Be(ue.asn1.DERInteger,ue.asn1.ASN1Object),ue.asn1.DERBitString=function(e){if(void 0!==e&&void 0!==e.obj){var t=ue.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.getEncodedHex()}ue.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,t){if(e<0||7i.length&&(i=r[n]);return(e=e.replace(i,"::")).slice(1,-1)}function Fe(e){var t="malformed hex value";if(!e.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw t;if(8!=e.length)return 32==e.length?Re(e):e;try{return parseInt(e.substr(0,2),16)+"."+parseInt(e.substr(2,2),16)+"."+parseInt(e.substr(4,2),16)+"."+parseInt(e.substr(6,2),16)}catch(e){throw t}}function Me(e){return e.match(/.{4}/g).map((function(e){var t=parseInt(e.substr(0,2),16),n=parseInt(e.substr(2),16);if(0==t&n<128)return String.fromCharCode(n);if(t<8){var r=128|63&n;return be((192|(7&t)<<3|(192&n)>>6).toString(16)+r.toString(16))}r=128|(15&t)<<2|(192&n)>>6;var i=128|63&n;return be((224|(240&t)>>4).toString(16)+r.toString(16)+i.toString(16))})).join("")}function Ne(e){for(var t=encodeURIComponent(e),n="",r=0;r"7"?"00"+e:e}de.getLblen=function(e,t){if("8"!=e.substr(t+2,1))return 1;var n=parseInt(e.substr(t+3,1));return 0==n?-1:0=r)break}return s},de.getNthChildIdx=function(e,t,n){return de.getChildIdx(e,t)[n]},de.getIdxbyList=function(e,t,n,r){var i,o,s=de;return 0==n.length?void 0!==r&&e.substr(t,2)!==r?-1:t:(i=n.shift())>=(o=s.getChildIdx(e,t)).length?-1:s.getIdxbyList(e,o[i],n,r)},de.getIdxbyListEx=function(e,t,n,r){var i,o,s=de;if(0==n.length)return void 0!==r&&e.substr(t,2)!==r?-1:t;i=n.shift(),o=s.getChildIdx(e,t);for(var a=0,u=0;u=e.length?null:i.getTLV(e,o)},de.getTLVbyListEx=function(e,t,n,r){var i=de,o=i.getIdxbyListEx(e,t,n,r);return-1==o?null:i.getTLV(e,o)},de.getVbyList=function(e,t,n,r,i){var o,s,a=de;return-1==(o=a.getIdxbyList(e,t,n,r))||o>=e.length?null:(s=a.getV(e,o),!0===i&&(s=s.substr(2)),s)},de.getVbyListEx=function(e,t,n,r,i){var o,s,a=de;return-1==(o=a.getIdxbyListEx(e,t,n,r))?null:(s=a.getV(e,o),"03"==e.substr(o,2)&&!1!==i&&(s=s.substr(2)),s)},de.getInt=function(e,t,n){null==n&&(n=-1);try{var r=e.substr(t,2);if("02"!=r&&"03"!=r)return n;var i=de.getV(e,t);return"02"==r?parseInt(i,16):function(e){try{var t=e.substr(0,2);if("00"==t)return parseInt(e.substr(2),16);var n=parseInt(t,16),r=e.substr(2),i=parseInt(r,16).toString(2);return"0"==i&&(i="00000000"),i=i.slice(0,0-n),parseInt(i,2)}catch(e){return-1}}(i)}catch(e){return n}},de.getOID=function(e,t,n){null==n&&(n=null);try{return"06"!=e.substr(t,2)?n:function(e){if(!De(e))return null;try{var t=[],n=e.substr(0,2),r=parseInt(n,16);t[0]=new String(Math.floor(r/40)),t[1]=new String(r%40);for(var i=e.substr(2),o=[],s=0;s0&&(l=l+"."+a.join(".")),l}catch(e){return null}}(de.getV(e,t))}catch(e){return n}},de.getOIDName=function(e,t,n){null==n&&(n=null);try{var r=de.getOID(e,t,n);if(r==n)return n;var i=ue.asn1.x509.OID.oid2name(r);return""==i?r:i}catch(e){return n}},de.getString=function(e,t,n){null==n&&(n=null);try{return Se(de.getV(e,t))}catch(e){return n}},de.hextooidstr=function(e){var t=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},n=[],r=e.substr(0,2),i=parseInt(r,16);n[0]=new String(Math.floor(i/40)),n[1]=new String(i%40);for(var o=e.substr(2),s=[],a=0;a0&&(c=c+"."+u.join(".")),c},de.dump=function(e,t,n,r){var i=de,o=i.getV,s=i.dump,a=i.getChildIdx,u=e;e instanceof ue.asn1.ASN1Object&&(u=e.getEncodedHex());var l=function(e,t){return e.length<=2*t?e:e.substr(0,t)+"..(total "+e.length/2+"bytes).."+e.substr(e.length-t,t)};void 0===t&&(t={ommit_long_octet:32}),void 0===n&&(n=0),void 0===r&&(r="");var c,d=t.ommit_long_octet;if("01"==(c=u.substr(n,2)))return"00"==(h=o(u,n))?r+"BOOLEAN FALSE\n":r+"BOOLEAN TRUE\n";if("02"==c)return r+"INTEGER "+l(h=o(u,n),d)+"\n";if("03"==c){var h=o(u,n);return i.isASN1HEX(h.substr(2))?(b=r+"BITSTRING, encapsulates\n")+s(h.substr(2),t,0,r+" "):r+"BITSTRING "+l(h,d)+"\n"}if("04"==c)return h=o(u,n),i.isASN1HEX(h)?(b=r+"OCTETSTRING, encapsulates\n")+s(h,t,0,r+" "):r+"OCTETSTRING "+l(h,d)+"\n";if("05"==c)return r+"NULL\n";if("06"==c){var f=o(u,n),p=ue.asn1.ASN1Util.oidHexToInt(f),g=ue.asn1.x509.OID.oid2name(p),m=p.replace(/\./g," ");return""!=g?r+"ObjectIdentifier "+g+" ("+m+")\n":r+"ObjectIdentifier ("+m+")\n"}if("0a"==c)return r+"ENUMERATED "+parseInt(o(u,n))+"\n";if("0c"==c)return r+"UTF8String '"+be(o(u,n))+"'\n";if("13"==c)return r+"PrintableString '"+be(o(u,n))+"'\n";if("14"==c)return r+"TeletexString '"+be(o(u,n))+"'\n";if("16"==c)return r+"IA5String '"+be(o(u,n))+"'\n";if("17"==c)return r+"UTCTime "+be(o(u,n))+"\n";if("18"==c)return r+"GeneralizedTime "+be(o(u,n))+"\n";if("1a"==c)return r+"VisualString '"+be(o(u,n))+"'\n";if("1e"==c)return r+"BMPString '"+Me(o(u,n))+"'\n";if("30"==c){if("3000"==u.substr(n,4))return r+"SEQUENCE {}\n";b=r+"SEQUENCE\n";var y=t;if((2==(_=a(u,n)).length||3==_.length)&&"06"==u.substr(_[0],2)&&"04"==u.substr(_[_.length-1],2)){g=i.oidname(o(u,_[0]));var v=JSON.parse(JSON.stringify(t));v.x509ExtName=g,y=v}for(var w=0;w<_.length;w++)b+=s(u,y,_[w],r+" ");return b}if("31"==c){b=r+"SET\n";var _=a(u,n);for(w=0;w<_.length;w++)b+=s(u,t,_[w],r+" ");return b}if(0!=(128&(c=parseInt(c,16)))){var b,S=31&c;if(0!=(32&c)){for(b=r+"["+S+"]\n",_=a(u,n),w=0;w<_.length;w++)b+=s(u,t,_[w],r+" ");return b}return h=o(u,n),de.isASN1HEX(h)?(b=r+"["+S+"]\n")+s(h,t,0,r+" "):(("68747470"==h.substr(0,8)||"subjectAltName"===t.x509ExtName&&2==S)&&(h=be(h)),r+"["+S+"] "+h+"\n")}return r+"UNKNOWN("+c+") "+o(u,n)+"\n"},de.isContextTag=function(e,t){var n,r;e=e.toLowerCase();try{n=parseInt(e,16)}catch(e){return-1}if(void 0===t)return 128==(192&n);try{return null!=t.match(/^\[[0-9]+\]$/)&&!((r=parseInt(t.substr(1,t.length-1),10))>31)&&128==(192&n)&&(31&n)==r}catch(e){return!1}},de.isASN1HEX=function(e){var t=de;if(e.length%2==1)return!1;var n=t.getVblen(e,0),r=e.substr(0,2),i=t.getL(e,0);return e.length-r.length-i.length==2*n},de.checkStrictDER=function(e,t,n,r,i){var o=de;if(void 0===n){if("string"!=typeof e)throw new Error("not hex string");if(e=e.toLowerCase(),!ue.lang.String.isHex(e))throw new Error("not hex string");n=e.length,i=(r=e.length/2)<128?1:Math.ceil(r.toString(16))+1}if(o.getL(e,t).length>2*i)throw new Error("L of TLV too long: idx="+t);var s=o.getVblen(e,t);if(s>r)throw new Error("value of L too long than hex: idx="+t);var a=o.getTLV(e,t),u=a.length-2-o.getL(e,t).length;if(u!==2*s)throw new Error("V string length and L's value not the same:"+u+"/"+2*s);if(0===t&&e.length!=a.length)throw new Error("total length and TLV length unmatch:"+e.length+"!="+a.length);var l=e.substr(t,2);if("02"===l){var c=o.getVidx(e,t);if("00"==e.substr(c,2)&&e.charCodeAt(c+2)<56)throw new Error("not least zeros for DER INTEGER")}if(32&parseInt(l,16)){for(var d=o.getVblen(e,t),h=0,f=o.getChildIdx(e,t),p=0;p=t?e:new Array(t-e.length+1).join(n)+e};function Be(e,t){var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.superclass=t.prototype,t.prototype.constructor==Object.prototype.constructor&&(t.prototype.constructor=t)}void 0!==ue&&ue||(t.KJUR=ue={}),void 0!==ue.crypto&&ue.crypto||(ue.crypto={}),ue.crypto.Util=new function(){this.DIGESTINFOHEAD={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},this.DEFAULTPROVIDER={md5:"cryptojs",sha1:"cryptojs",sha224:"cryptojs",sha256:"cryptojs",sha384:"cryptojs",sha512:"cryptojs",ripemd160:"cryptojs",hmacmd5:"cryptojs",hmacsha1:"cryptojs",hmacsha224:"cryptojs",hmacsha256:"cryptojs",hmacsha384:"cryptojs",hmacsha512:"cryptojs",hmacripemd160:"cryptojs",MD5withRSA:"cryptojs/jsrsa",SHA1withRSA:"cryptojs/jsrsa",SHA224withRSA:"cryptojs/jsrsa",SHA256withRSA:"cryptojs/jsrsa",SHA384withRSA:"cryptojs/jsrsa",SHA512withRSA:"cryptojs/jsrsa",RIPEMD160withRSA:"cryptojs/jsrsa",MD5withECDSA:"cryptojs/jsrsa",SHA1withECDSA:"cryptojs/jsrsa",SHA224withECDSA:"cryptojs/jsrsa",SHA256withECDSA:"cryptojs/jsrsa",SHA384withECDSA:"cryptojs/jsrsa",SHA512withECDSA:"cryptojs/jsrsa",RIPEMD160withECDSA:"cryptojs/jsrsa",SHA1withDSA:"cryptojs/jsrsa",SHA224withDSA:"cryptojs/jsrsa",SHA256withDSA:"cryptojs/jsrsa",MD5withRSAandMGF1:"cryptojs/jsrsa",SHAwithRSAandMGF1:"cryptojs/jsrsa",SHA1withRSAandMGF1:"cryptojs/jsrsa",SHA224withRSAandMGF1:"cryptojs/jsrsa",SHA256withRSAandMGF1:"cryptojs/jsrsa",SHA384withRSAandMGF1:"cryptojs/jsrsa",SHA512withRSAandMGF1:"cryptojs/jsrsa",RIPEMD160withRSAandMGF1:"cryptojs/jsrsa"},this.CRYPTOJSMESSAGEDIGESTNAME={md5:m.algo.MD5,sha1:m.algo.SHA1,sha224:m.algo.SHA224,sha256:m.algo.SHA256,sha384:m.algo.SHA384,sha512:m.algo.SHA512,ripemd160:m.algo.RIPEMD160},this.getDigestInfoHex=function(e,t){if(void 0===this.DIGESTINFOHEAD[t])throw"alg not supported in Util.DIGESTINFOHEAD: "+t;return this.DIGESTINFOHEAD[t]+e},this.getPaddedDigestInfoHex=function(e,t,n){var r=this.getDigestInfoHex(e,t),i=n/4;if(r.length+22>i)throw"key is too short for SigAlg: keylen="+n+","+t;for(var o="0001",s="00"+r,a="",u=i-o.length-s.length,l=0;l=0)return!1;if(r.compareTo(n.ONE)<0||r.compareTo(o)>=0)return!1;var a=r.modInverse(o),u=e.multiply(a).mod(o),l=t.multiply(a).mod(o);return s.multiply(u).add(i.multiply(l)).getX().toBigInteger().mod(o).equals(t)},this.serializeSig=function(e,t){var n=e.toByteArraySigned(),r=t.toByteArraySigned(),i=[];return i.push(2),i.push(n.length),(i=i.concat(n)).push(2),i.push(r.length),(i=i.concat(r)).unshift(i.length),i.unshift(48),i},this.parseSig=function(e){var t;if(48!=e[0])throw new Error("Signature not a valid DERSequence");if(2!=e[t=2])throw new Error("First element in signature must be a DERInteger");var r=e.slice(t+2,t+2+e[t+1]);if(2!=e[t+=2+e[t+1]])throw new Error("Second element in signature must be a DERInteger");var i=e.slice(t+2,t+2+e[t+1]);return t+=2+e[t+1],{r:n.fromByteArrayUnsigned(r),s:n.fromByteArrayUnsigned(i)}},this.parseSigCompact=function(e){if(65!==e.length)throw"Signature has the wrong length";var t=e[0]-27;if(t<0||t>7)throw"Invalid signature type";var r=this.ecparams.n;return{r:n.fromByteArrayUnsigned(e.slice(1,33)).mod(r),s:n.fromByteArrayUnsigned(e.slice(33,65)).mod(r),i:t}},this.readPKCS5PrvKeyHex=function(e){if(!1===l(e))throw new Error("not ASN.1 hex string");var t,n,r;try{t=u(e,0,["[0]",0],"06"),n=u(e,0,[1],"04");try{r=u(e,0,["[1]",0],"03")}catch(e){}}catch(e){throw new Error("malformed PKCS#1/5 plain ECC private key")}if(this.curveName=s(t),void 0===this.curveName)throw"unsupported curve name";this.setNamedCurve(this.curveName),this.setPublicKeyHex(r),this.setPrivateKeyHex(n),this.isPublic=!1},this.readPKCS8PrvKeyHex=function(e){if(!1===l(e))throw new t("not ASN.1 hex string");var n,r,i;try{u(e,0,[1,0],"06"),n=u(e,0,[1,1],"06"),r=u(e,0,[2,0,1],"04");try{i=u(e,0,[2,0,"[1]",0],"03")}catch(e){}}catch(e){throw new t("malformed PKCS#8 plain ECC private key")}if(this.curveName=s(n),void 0===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(i),this.setPrivateKeyHex(r),this.isPublic=!1},this.readPKCS8PubKeyHex=function(e){if(!1===l(e))throw new t("not ASN.1 hex string");var n,r;try{u(e,0,[0,0],"06"),n=u(e,0,[0,1],"06"),r=u(e,0,[1],"03")}catch(e){throw new t("malformed PKCS#8 ECC public key")}if(this.curveName=s(n),null===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(r)},this.readCertPubKeyHex=function(e,n){if(!1===l(e))throw new t("not ASN.1 hex string");var r,i;try{r=u(e,0,[0,5,0,1],"06"),i=u(e,0,[0,5,1],"03")}catch(e){throw new t("malformed X.509 certificate ECC public key")}if(this.curveName=s(r),null===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(i)},void 0!==e&&void 0!==e.curve&&(this.curveName=e.curve),void 0===this.curveName&&(this.curveName="secp256r1"),this.setNamedCurve(this.curveName),void 0!==e&&(void 0!==e.prv&&this.setPrivateKeyHex(e.prv),void 0!==e.pub&&this.setPublicKeyHex(e.pub))},ue.crypto.ECDSA.parseSigHex=function(e){var t=ue.crypto.ECDSA.parseSigHexInHexRS(e);return{r:new S(t.r,16),s:new S(t.s,16)}},ue.crypto.ECDSA.parseSigHexInHexRS=function(e){var t=de,n=t.getChildIdx,r=t.getV;if(t.checkStrictDER(e,0),"30"!=e.substr(0,2))throw new Error("signature is not a ASN.1 sequence");var i=n(e,0);if(2!=i.length)throw new Error("signature shall have two elements");var o=i[0],s=i[1];if("02"!=e.substr(o,2))throw new Error("1st item not ASN.1 integer");if("02"!=e.substr(s,2))throw new Error("2nd item not ASN.1 integer");return{r:r(e,o),s:r(e,s)}},ue.crypto.ECDSA.asn1SigToConcatSig=function(e){var t=ue.crypto.ECDSA.parseSigHexInHexRS(e),n=t.r,r=t.s;if("00"==n.substr(0,2)&&n.length%32==2&&(n=n.substr(2)),"00"==r.substr(0,2)&&r.length%32==2&&(r=r.substr(2)),n.length%32==30&&(n="00"+n),r.length%32==30&&(r="00"+r),n.length%32!=0)throw"unknown ECDSA sig r length error";if(r.length%32!=0)throw"unknown ECDSA sig s length error";return n+r},ue.crypto.ECDSA.concatSigToASN1Sig=function(e){if(e.length/2*8%128!=0)throw"unknown ECDSA concatinated r-s sig length error";var t=e.substr(0,e.length/2),n=e.substr(e.length/2);return ue.crypto.ECDSA.hexRSSigToASN1Sig(t,n)},ue.crypto.ECDSA.hexRSSigToASN1Sig=function(e,t){var n=new S(e,16),r=new S(t,16);return ue.crypto.ECDSA.biRSSigToASN1Sig(n,r)},ue.crypto.ECDSA.biRSSigToASN1Sig=function(e,t){var n=ue.asn1,r=new n.DERInteger({bigint:e}),i=new n.DERInteger({bigint:t});return new n.DERSequence({array:[r,i]}).getEncodedHex()},ue.crypto.ECDSA.getName=function(e){return"2b8104001f"===e?"secp192k1":"2a8648ce3d030107"===e?"secp256r1":"2b8104000a"===e?"secp256k1":"2b81040021"===e?"secp224r1":"2b81040022"===e?"secp384r1":-1!=="|secp256r1|NIST P-256|P-256|prime256v1|".indexOf(e)?"secp256r1":-1!=="|secp256k1|".indexOf(e)?"secp256k1":-1!=="|secp224r1|NIST P-224|P-224|".indexOf(e)?"secp224r1":-1!=="|secp384r1|NIST P-384|P-384|".indexOf(e)?"secp384r1":null},void 0!==ue&&ue||(t.KJUR=ue={}),void 0!==ue.crypto&&ue.crypto||(ue.crypto={}),ue.crypto.ECParameterDB=new function(){var e={},t={};function n(e){return new S(e,16)}this.getByName=function(n){var r=n;if(void 0!==t[r]&&(r=t[n]),void 0!==e[r])return e[r];throw"unregistered EC curve name: "+r},this.regist=function(r,i,o,s,a,u,l,c,d,h,f,p){e[r]={};var g=n(o),m=n(s),y=n(a),v=n(u),w=n(l),_=new se(g,m,y),b=_.decodePointHex("04"+c+d);e[r].name=r,e[r].keylen=i,e[r].curve=_,e[r].G=b,e[r].n=v,e[r].h=w,e[r].oid=f,e[r].info=p;for(var S=0;S=2*a)break}var d={};return d.keyhex=u.substr(0,2*i[e].keylen),d.ivhex=u.substr(2*i[e].keylen,2*i[e].ivlen),d},a=function(e,t,n,r){var o=m.enc.Base64.parse(e),s=m.enc.Hex.stringify(o);return(0,i[t].proc)(s,n,r)};return{version:"1.0.0",parsePKCS5PEM:function(e){return o(e)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(e,t,n){return s(e,t,n)},decryptKeyB64:function(e,t,n,r){return a(e,t,n,r)},getDecryptedKeyHex:function(e,t){var n=o(e),r=(n.type,n.cipher),i=n.ivsalt,u=n.data,l=s(r,t,i).keyhex;return a(u,r,l,i)},getEncryptedPKCS5PEMFromPrvKeyHex:function(e,t,n,r,o){var a="";if(void 0!==r&&null!=r||(r="AES-256-CBC"),void 0===i[r])throw new Error("KEYUTIL unsupported algorithm: "+r);void 0!==o&&null!=o||(o=function(e){var t=m.lib.WordArray.random(e);return m.enc.Hex.stringify(t)}(i[r].ivlen).toUpperCase());var u=function(e,t,n,r){return(0,i[t].eproc)(e,n,r)}(t,r,s(r,n,o).keyhex,o);return a="-----BEGIN "+e+" PRIVATE KEY-----\r\n",a+="Proc-Type: 4,ENCRYPTED\r\n",a+="DEK-Info: "+r+","+o+"\r\n",a+="\r\n",(a+=u.replace(/(.{64})/g,"$1\r\n"))+"\r\n-----END "+e+" PRIVATE KEY-----\r\n"},parseHexOfEncryptedPKCS8:function(t){var n=de,r=n.getChildIdx,i=n.getV,o={},s=r(t,0);if(2!=s.length)throw new Error("malformed format: SEQUENCE(0).items != 2: "+s.length);o.ciphertext=i(t,s[1]);var a=r(t,s[0]);if(2!=a.length)throw new Error("malformed format: SEQUENCE(0.0).items != 2: "+a.length);if("2a864886f70d01050d"!=i(t,a[0]))throw new Error("this only supports pkcs5PBES2");var u=r(t,a[1]);if(2!=a.length)throw new Error("malformed format: SEQUENCE(0.0.1).items != 2: "+u.length);var l=r(t,u[1]);if(2!=l.length)throw new Error("malformed format: SEQUENCE(0.0.1.1).items != 2: "+l.length);if("2a864886f70d0307"!=i(t,l[0]))throw"this only supports TripleDES";o.encryptionSchemeAlg="TripleDES",o.encryptionSchemeIV=i(t,l[1]);var c=r(t,u[0]);if(2!=c.length)throw new Error("malformed format: SEQUENCE(0.0.1.0).items != 2: "+c.length);if("2a864886f70d01050c"!=i(t,c[0]))throw new Error("this only supports pkcs5PBKDF2");var d=r(t,c[1]);if(d.length<2)throw new Error("malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+d.length);o.pbkdf2Salt=i(t,d[0]);var h=i(t,d[1]);try{o.pbkdf2Iter=parseInt(h,16)}catch(e){throw new Error("malformed format pbkdf2Iter: "+h)}return o},getPBKDF2KeyHexFromParam:function(e,t){var n=m.enc.Hex.parse(e.pbkdf2Salt),r=e.pbkdf2Iter,i=m.PBKDF2(t,n,{keySize:6,iterations:r});return m.enc.Hex.stringify(i)},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(e,t){var n=Te(e,"ENCRYPTED PRIVATE KEY"),r=this.parseHexOfEncryptedPKCS8(n),i=ze.getPBKDF2KeyHexFromParam(r,t),o={};o.ciphertext=m.enc.Hex.parse(r.ciphertext);var s=m.enc.Hex.parse(i),a=m.enc.Hex.parse(r.encryptionSchemeIV),u=m.TripleDES.decrypt(o,s,{iv:a});return m.enc.Hex.stringify(u)},getKeyFromEncryptedPKCS8PEM:function(e,t){var n=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(e,t);return this.getKeyFromPlainPrivatePKCS8Hex(n)},parsePlainPrivatePKCS8Hex:function(e){var t=de,n=t.getChildIdx,r=t.getV,i={algparam:null};if("30"!=e.substr(0,2))throw new Error("malformed plain PKCS8 private key(code:001)");var o=n(e,0);if(o.length<3)throw new Error("malformed plain PKCS8 private key(code:002)");if("30"!=e.substr(o[1],2))throw new Error("malformed PKCS8 private key(code:003)");var s=n(e,o[1]);if(2!=s.length)throw new Error("malformed PKCS8 private key(code:004)");if("06"!=e.substr(s[0],2))throw new Error("malformed PKCS8 private key(code:005)");if(i.algoid=r(e,s[0]),"06"==e.substr(s[1],2)&&(i.algparam=r(e,s[1])),"04"!=e.substr(o[2],2))throw new Error("malformed PKCS8 private key(code:006)");return i.keyidx=t.getVidx(e,o[2]),i},getKeyFromPlainPrivatePKCS8PEM:function(e){var t=Te(e,"PRIVATE KEY");return this.getKeyFromPlainPrivatePKCS8Hex(t)},getKeyFromPlainPrivatePKCS8Hex:function(e){var t,n=this.parsePlainPrivatePKCS8Hex(e);if("2a864886f70d010101"==n.algoid)t=new re;else if("2a8648ce380401"==n.algoid)t=new ue.crypto.DSA;else{if("2a8648ce3d0201"!=n.algoid)throw new Error("unsupported private key algorithm");t=new ue.crypto.ECDSA}return t.readPKCS8PrvKeyHex(e),t},_getKeyFromPublicPKCS8Hex:function(e){var t,n=de.getVbyList(e,0,[0,0],"06");if("2a864886f70d010101"===n)t=new re;else if("2a8648ce380401"===n)t=new ue.crypto.DSA;else{if("2a8648ce3d0201"!==n)throw new Error("unsupported PKCS#8 public key hex");t=new ue.crypto.ECDSA}return t.readPKCS8PubKeyHex(e),t},parsePublicRawRSAKeyHex:function(e){var t=de,n=t.getChildIdx,r=t.getV,i={};if("30"!=e.substr(0,2))throw new Error("malformed RSA key(code:001)");var o=n(e,0);if(2!=o.length)throw new Error("malformed RSA key(code:002)");if("02"!=e.substr(o[0],2))throw new Error("malformed RSA key(code:003)");if(i.n=r(e,o[0]),"02"!=e.substr(o[1],2))throw new Error("malformed RSA key(code:004)");return i.e=r(e,o[1]),i},parsePublicPKCS8Hex:function(e){var t=de,n=t.getChildIdx,r=t.getV,i={algparam:null},o=n(e,0);if(2!=o.length)throw new Error("outer DERSequence shall have 2 elements: "+o.length);var s=o[0];if("30"!=e.substr(s,2))throw new Error("malformed PKCS8 public key(code:001)");var a=n(e,s);if(2!=a.length)throw new Error("malformed PKCS8 public key(code:002)");if("06"!=e.substr(a[0],2))throw new Error("malformed PKCS8 public key(code:003)");if(i.algoid=r(e,a[0]),"06"==e.substr(a[1],2)?i.algparam=r(e,a[1]):"30"==e.substr(a[1],2)&&(i.algparam={},i.algparam.p=t.getVbyList(e,a[1],[0],"02"),i.algparam.q=t.getVbyList(e,a[1],[1],"02"),i.algparam.g=t.getVbyList(e,a[1],[2],"02")),"03"!=e.substr(o[1],2))throw new Error("malformed PKCS8 public key(code:004)");return i.key=r(e,o[1]).substr(2),i}}}();function He(e,t){for(var n="",r=t/4-e.length,i=0;i>24,(16711680&i)>>16,(65280&i)>>8,255&i])))),i+=1;return r}function qe(e){for(var t in ue.crypto.Util.DIGESTINFOHEAD){var n=ue.crypto.Util.DIGESTINFOHEAD[t],r=n.length;if(e.substring(0,r)==n)return[t,e.substring(r)]}return[]}function We(e){var t,n=de,r=n.getChildIdx,i=n.getV,o=n.getTLV,s=n.getVbyList,a=n.getVbyListEx,u=n.getTLVbyList,l=n.getTLVbyListEx,c=n.getIdxbyList,d=n.getIdxbyListEx,h=n.getVidx,f=n.getInt,p=n.oidname,g=n.hextooidstr,m=Te;try{t=ue.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(e){}this.HEX2STAG={"0c":"utf8",13:"prn",16:"ia5","1a":"vis","1e":"bmp"},this.hex=null,this.version=0,this.foffset=0,this.aExtInfo=null,this.getVersion=function(){if(null===this.hex||0!==this.version)return this.version;var e=u(this.hex,0,[0,0]);if("a0"==e.substr(0,2)){var t=u(e,0,[0]),n=f(t,0);if(n<0||21){var a=o(e,s[1]),u=this.getGeneralName(a);null!=u.uri&&(i.uri=u.uri)}if(s.length>2){var l=o(e,s[2]);"0101ff"==l&&(i.reqauth=!0),"010100"==l&&(i.reqauth=!1)}return i},this.getX500NameRule=function(e){for(var t=null,n=[],r=0;r0&&(e.ext=this.getExtParamArray()),e.sighex=this.getSignatureValueHex(),e},this.getExtParamArray=function(e){null==e&&-1!=d(this.hex,0,[0,"[3]"])&&(e=l(this.hex,0,[0,"[3]",0],"30"));for(var t=[],n=r(e,0),i=0;i2&&"04"===m.substr(g[1],2)))throw new Error("unsupported PKCS#1/5 hexadecimal key");(A=new a).readPKCS5PrvKeyHex(m)}return A}if("pkcs8prv"===n)return d.getKeyFromPlainPrivatePKCS8Hex(e);if("pkcs8pub"===n)return d._getKeyFromPublicPKCS8Hex(e);if("x509pub"===n)return We.getPublicKeyFromCertHex(e);if(-1!=e.indexOf("-END CERTIFICATE-",0)||-1!=e.indexOf("-END X509 CERTIFICATE-",0)||-1!=e.indexOf("-END TRUSTED CERTIFICATE-",0))return We.getPublicKeyFromCertPEM(e);if(-1!=e.indexOf("-END PUBLIC KEY-")){var v=Te(e,"PUBLIC KEY");return d._getKeyFromPublicPKCS8Hex(v)}if(-1!=e.indexOf("-END RSA PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var w=c(e,"RSA PRIVATE KEY");return d.getKey(w,null,"pkcs5prv")}if(-1!=e.indexOf("-END DSA PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var _=o(r=c(e,"DSA PRIVATE KEY"),0,[1],"02"),b=o(r,0,[2],"02"),x=o(r,0,[3],"02"),E=o(r,0,[4],"02"),k=o(r,0,[5],"02");return(A=new u).setPrivate(new S(_,16),new S(b,16),new S(x,16),new S(E,16),new S(k,16)),A}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED"))return w=c(e,"EC PRIVATE KEY"),d.getKey(w,null,"pkcs5prv");if(-1!=e.indexOf("-END PRIVATE KEY-"))return d.getKeyFromPlainPrivatePKCS8PEM(e);if(-1!=e.indexOf("-END RSA PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var C=d.getDecryptedKeyHex(e,t),P=new re;return P.readPKCS5PrvKeyHex(C),P}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var T,A=o(r=d.getDecryptedKeyHex(e,t),0,[1],"04"),O=o(r,0,[2,0],"06"),I=o(r,0,[3,0],"03").substr(2);if(void 0===ue.crypto.OID.oidhex2name[O])throw new Error("undefined OID(hex) in KJUR.crypto.OID: "+O);return(T=new a({curve:ue.crypto.OID.oidhex2name[O]})).setPublicKeyHex(I),T.setPrivateKeyHex(A),T.isPublic=!1,T}if(-1!=e.indexOf("-END DSA PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED"))return _=o(r=d.getDecryptedKeyHex(e,t),0,[1],"02"),b=o(r,0,[2],"02"),x=o(r,0,[3],"02"),E=o(r,0,[4],"02"),k=o(r,0,[5],"02"),(A=new u).setPrivate(new S(_,16),new S(b,16),new S(x,16),new S(E,16),new S(k,16)),A;if(-1!=e.indexOf("-END ENCRYPTED PRIVATE KEY-"))return d.getKeyFromEncryptedPKCS8PEM(e,t);throw new Error("not supported argument")},ze.generateKeypair=function(e,t){if("RSA"==e){var n=t;(s=new re).generate(n,"10001"),s.isPrivate=!0,s.isPublic=!0;var r=new re,i=s.n.toString(16),o=s.e.toString(16);return r.setPublic(i,o),r.isPrivate=!1,r.isPublic=!0,(a={}).prvKeyObj=s,a.pubKeyObj=r,a}if("EC"==e){var s,a,u=t,l=new ue.crypto.ECDSA({curve:u}).generateKeyPairHex();return(s=new ue.crypto.ECDSA({curve:u})).setPublicKeyHex(l.ecpubhex),s.setPrivateKeyHex(l.ecprvhex),s.isPrivate=!0,s.isPublic=!1,(r=new ue.crypto.ECDSA({curve:u})).setPublicKeyHex(l.ecpubhex),r.isPrivate=!1,r.isPublic=!0,(a={}).prvKeyObj=s,a.pubKeyObj=r,a}throw new Error("unknown algorithm: "+e)},ze.getPEM=function(e,t,n,r,i,o){var s=ue,a=s.asn1,u=a.DERObjectIdentifier,l=a.DERInteger,c=a.ASN1Util.newObject,d=a.x509.SubjectPublicKeyInfo,h=s.crypto,f=h.DSA,p=h.ECDSA,g=re;function y(e){return c({seq:[{int:0},{int:{bigint:e.n}},{int:e.e},{int:{bigint:e.d}},{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.dmp1}},{int:{bigint:e.dmq1}},{int:{bigint:e.coeff}}]})}function v(e){return c({seq:[{int:1},{octstr:{hex:e.prvKeyHex}},{tag:["a0",!0,{oid:{name:e.curveName}}]},{tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]}]})}function w(e){return c({seq:[{int:0},{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}},{int:{bigint:e.y}},{int:{bigint:e.x}}]})}if((void 0!==g&&e instanceof g||void 0!==f&&e instanceof f||void 0!==p&&e instanceof p)&&1==e.isPublic&&(void 0===t||"PKCS8PUB"==t))return Pe(x=new d(e).getEncodedHex(),"PUBLIC KEY");if("PKCS1PRV"==t&&void 0!==g&&e instanceof g&&(void 0===n||null==n)&&1==e.isPrivate)return Pe(x=y(e).getEncodedHex(),"RSA PRIVATE KEY");if("PKCS1PRV"==t&&void 0!==p&&e instanceof p&&(void 0===n||null==n)&&1==e.isPrivate){var _=new u({name:e.curveName}).getEncodedHex(),b=v(e).getEncodedHex(),S="";return(S+=Pe(_,"EC PARAMETERS"))+Pe(b,"EC PRIVATE KEY")}if("PKCS1PRV"==t&&void 0!==f&&e instanceof f&&(void 0===n||null==n)&&1==e.isPrivate)return Pe(x=w(e).getEncodedHex(),"DSA PRIVATE KEY");if("PKCS5PRV"==t&&void 0!==g&&e instanceof g&&void 0!==n&&null!=n&&1==e.isPrivate){var x=y(e).getEncodedHex();return void 0===r&&(r="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",x,n,r,o)}if("PKCS5PRV"==t&&void 0!==p&&e instanceof p&&void 0!==n&&null!=n&&1==e.isPrivate)return x=v(e).getEncodedHex(),void 0===r&&(r="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",x,n,r,o);if("PKCS5PRV"==t&&void 0!==f&&e instanceof f&&void 0!==n&&null!=n&&1==e.isPrivate)return x=w(e).getEncodedHex(),void 0===r&&(r="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",x,n,r,o);var E=function(e,t){var n=k(e,t);return new c({seq:[{seq:[{oid:{name:"pkcs5PBES2"}},{seq:[{seq:[{oid:{name:"pkcs5PBKDF2"}},{seq:[{octstr:{hex:n.pbkdf2Salt}},{int:n.pbkdf2Iter}]}]},{seq:[{oid:{name:"des-EDE3-CBC"}},{octstr:{hex:n.encryptionSchemeIV}}]}]}]},{octstr:{hex:n.ciphertext}}]}).getEncodedHex()},k=function(e,t){var n=m.lib.WordArray.random(8),r=m.lib.WordArray.random(8),i=m.PBKDF2(t,n,{keySize:6,iterations:100}),o=m.enc.Hex.parse(e),s=m.TripleDES.encrypt(o,i,{iv:r})+"",a={};return a.ciphertext=s,a.pbkdf2Salt=m.enc.Hex.stringify(n),a.pbkdf2Iter=100,a.encryptionSchemeAlg="DES-EDE3-CBC",a.encryptionSchemeIV=m.enc.Hex.stringify(r),a};if("PKCS8PRV"==t&&null!=g&&e instanceof g&&1==e.isPrivate){var C=y(e).getEncodedHex();return x=c({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{null:!0}]},{octstr:{hex:C}}]}).getEncodedHex(),void 0===n||null==n?Pe(x,"PRIVATE KEY"):Pe(b=E(x,n),"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==t&&void 0!==p&&e instanceof p&&1==e.isPrivate)return C=new c({seq:[{int:1},{octstr:{hex:e.prvKeyHex}},{tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]}]}).getEncodedHex(),x=c({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:e.curveName}}]},{octstr:{hex:C}}]}).getEncodedHex(),void 0===n||null==n?Pe(x,"PRIVATE KEY"):Pe(b=E(x,n),"ENCRYPTED PRIVATE KEY");if("PKCS8PRV"==t&&void 0!==f&&e instanceof f&&1==e.isPrivate)return C=new l({bigint:e.x}).getEncodedHex(),x=c({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}}]}]},{octstr:{hex:C}}]}).getEncodedHex(),void 0===n||null==n?Pe(x,"PRIVATE KEY"):Pe(b=E(x,n),"ENCRYPTED PRIVATE KEY");throw new Error("unsupported object nor format")},ze.getKeyFromCSRPEM=function(e){var t=Te(e,"CERTIFICATE REQUEST");return ze.getKeyFromCSRHex(t)},ze.getKeyFromCSRHex=function(e){var t=ze.parseCSRHex(e);return ze.getKey(t.p8pubkeyhex,null,"pkcs8pub")},ze.parseCSRHex=function(e){var t=de,n=t.getChildIdx,r=t.getTLV,i={},o=e;if("30"!=o.substr(0,2))throw new Error("malformed CSR(code:001)");var s=n(o,0);if(s.length<1)throw new Error("malformed CSR(code:002)");if("30"!=o.substr(s[0],2))throw new Error("malformed CSR(code:003)");var a=n(o,s[0]);if(a.length<3)throw new Error("malformed CSR(code:004)");return i.p8pubkeyhex=r(o,a[2]),i},ze.getKeyID=function(e){var t=ze,n=de;"string"==typeof e&&-1!=e.indexOf("BEGIN ")&&(e=t.getKey(e));var r=Te(t.getPEM(e)),i=n.getIdxbyList(r,0,[1]),o=n.getV(r,i).substring(2);return ue.crypto.Util.hashHex(o,"sha1")},ze.getJWKFromKey=function(e){var t={};if(e instanceof re&&e.isPrivate)return t.kty="RSA",t.n=ve(e.n.toString(16)),t.e=ve(e.e.toString(16)),t.d=ve(e.d.toString(16)),t.p=ve(e.p.toString(16)),t.q=ve(e.q.toString(16)),t.dp=ve(e.dmp1.toString(16)),t.dq=ve(e.dmq1.toString(16)),t.qi=ve(e.coeff.toString(16)),t;if(e instanceof re&&e.isPublic)return t.kty="RSA",t.n=ve(e.n.toString(16)),t.e=ve(e.e.toString(16)),t;if(e instanceof ue.crypto.ECDSA&&e.isPrivate){if("P-256"!==(r=e.getShortNISTPCurveName())&&"P-384"!==r)throw new Error("unsupported curve name for JWT: "+r);var n=e.getPublicKeyXYHex();return t.kty="EC",t.crv=r,t.x=ve(n.x),t.y=ve(n.y),t.d=ve(e.prvKeyHex),t}if(e instanceof ue.crypto.ECDSA&&e.isPublic){var r;if("P-256"!==(r=e.getShortNISTPCurveName())&&"P-384"!==r)throw new Error("unsupported curve name for JWT: "+r);return n=e.getPublicKeyXYHex(),t.kty="EC",t.crv=r,t.x=ve(n.x),t.y=ve(n.y),t}throw new Error("not supported key object")},re.getPosArrayOfChildrenFromHex=function(e){return de.getChildIdx(e,0)},re.getHexValueArrayOfChildrenFromHex=function(e){var t,n=de.getV,r=n(e,(t=re.getPosArrayOfChildrenFromHex(e))[0]),i=n(e,t[1]),o=n(e,t[2]),s=n(e,t[3]),a=n(e,t[4]),u=n(e,t[5]),l=n(e,t[6]),c=n(e,t[7]),d=n(e,t[8]);return(t=new Array).push(r,i,o,s,a,u,l,c,d),t},re.prototype.readPrivateKeyFromPEMString=function(e){var t=Te(e),n=re.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8])},re.prototype.readPKCS5PrvKeyHex=function(e){var t=re.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},re.prototype.readPKCS8PrvKeyHex=function(e){var t,n,r,i,o,s,a,u,l=de,c=l.getVbyListEx;if(!1===l.isASN1HEX(e))throw new Error("not ASN.1 hex string");try{t=c(e,0,[2,0,1],"02"),n=c(e,0,[2,0,2],"02"),r=c(e,0,[2,0,3],"02"),i=c(e,0,[2,0,4],"02"),o=c(e,0,[2,0,5],"02"),s=c(e,0,[2,0,6],"02"),a=c(e,0,[2,0,7],"02"),u=c(e,0,[2,0,8],"02")}catch(e){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(t,n,r,i,o,s,a,u)},re.prototype.readPKCS5PubKeyHex=function(e){var t=de,n=t.getV;if(!1===t.isASN1HEX(e))throw new Error("keyHex is not ASN.1 hex string");var r=t.getChildIdx(e,0);if(2!==r.length||"02"!==e.substr(r[0],2)||"02"!==e.substr(r[1],2))throw new Error("wrong hex for PKCS#5 public key");var i=n(e,r[0]),o=n(e,r[1]);this.setPublic(i,o)},re.prototype.readPKCS8PubKeyHex=function(e){var t=de;if(!1===t.isASN1HEX(e))throw new Error("not ASN.1 hex string");if("06092a864886f70d010101"!==t.getTLVbyListEx(e,0,[0,0]))throw new Error("not PKCS8 RSA public key");var n=t.getTLVbyListEx(e,0,[1,0]);this.readPKCS5PubKeyHex(n)},re.prototype.readCertPubKeyHex=function(e,t){var n,r;(n=new We).readCertHex(e),r=n.getPublicKeyHex(),this.readPKCS8PubKeyHex(r)},new RegExp("[^0-9a-f]","gi"),re.prototype.sign=function(e,t){var n=function(e){return ue.crypto.Util.hashString(e,t)}(e);return this.signWithMessageHash(n,t)},re.prototype.signWithMessageHash=function(e,t){var n=te(ue.crypto.Util.getPaddedDigestInfoHex(e,t,this.n.bitLength()),16);return He(this.doPrivate(n).toString(16),this.n.bitLength())},re.prototype.signPSS=function(e,t,n){var r=function(e){return ue.crypto.Util.hashHex(e,t)}(xe(e));return void 0===n&&(n=-1),this.signWithMessageHashPSS(r,t,n)},re.prototype.signWithMessageHashPSS=function(e,t,n){var r,i=Se(e),o=i.length,s=this.n.bitLength()-1,a=Math.ceil(s/8),u=function(e){return ue.crypto.Util.hashHex(e,t)};if(-1===n||void 0===n)n=o;else if(-2===n)n=a-o-2;else if(n<-2)throw new Error("invalid salt length");if(a0&&(l=new Array(n),(new ee).nextBytes(l),l=String.fromCharCode.apply(String,l));var c=Se(u(xe("\0\0\0\0\0\0\0\0"+i+l))),d=[];for(r=0;r>8*a-s&255;for(p[0]&=~g,r=0;rr)return!1;var i=this.doPublic(n).toString(16);if(i.length+3!=r/4)return!1;var o=qe(i.replace(/^1f+00/,""));if(0==o.length)return!1;var s=o[0];return o[1]==function(e){return ue.crypto.Util.hashString(e,s)}(e)},re.prototype.verifyWithMessageHash=function(e,t){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var n=te(t,16);if(n.bitLength()>this.n.bitLength())return 0;var r=qe(this.doPublic(n).toString(16).replace(/^1f+00/,""));return 0!=r.length&&(r[0],r[1]==e)},re.prototype.verifyPSS=function(e,t,n,r){var i=function(e){return ue.crypto.Util.hashHex(e,n)}(xe(e));return void 0===r&&(r=-1),this.verifyWithMessageHashPSS(i,t,n,r)},re.prototype.verifyWithMessageHashPSS=function(e,t,n,r){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var i,o=new S(t,16),s=function(e){return ue.crypto.Util.hashHex(e,n)},a=Se(e),u=a.length,l=this.n.bitLength()-1,c=Math.ceil(l/8);if(-1===r||void 0===r)r=u;else if(-2===r)r=c-u-2;else if(r<-2)throw new Error("invalid salt length");if(c>8*c-l&255;if(0!=(h.charCodeAt(0)&p))throw new Error("bits beyond keysize not zero");var g=Ve(f,h.length,s),m=[];for(i=0;i0&&-1==(":"+n.join(":")+":").indexOf(":"+y+":"))throw"algorithm '"+y+"' not accepted in the list";if("none"!=y&&null===t)throw"key shall be specified to verify.";if("string"==typeof t&&-1!=t.indexOf("-----BEGIN ")&&(t=ze.getKey(t)),!("RS"!=h&&"PS"!=h||t instanceof r))throw"key shall be a RSAKey obj for RS* and PS* algs";if("ES"==h&&!(t instanceof u))throw"key shall be a ECDSA obj for ES* algs";var v=null;if(void 0===o.jwsalg2sigalg[m.alg])throw"unsupported alg name: "+y;if("none"==(v=o.jwsalg2sigalg[y]))throw"not supported";if("Hmac"==v.substr(0,4)){if(void 0===t)throw"hexadecimal key shall be specified for HMAC";var w=new l({alg:v,pass:t});return w.updateString(p),g==w.doFinal()}if(-1!=v.indexOf("withECDSA")){var _,b=null;try{b=u.concatSigToASN1Sig(g)}catch(e){return!1}return(_=new c({alg:v})).init(t),_.updateString(p),_.verify(b)}return(_=new c({alg:v})).init(t),_.updateString(p),_.verify(g)},ue.jws.JWS.parse=function(e){var t,n,r,i=e.split("."),o={};if(2!=i.length&&3!=i.length)throw"malformed sJWS: wrong number of '.' splitted elements";return t=i[0],n=i[1],3==i.length&&(r=i[2]),o.headerObj=ue.jws.JWS.readSafeJSONString(ce(t)),o.payloadObj=ue.jws.JWS.readSafeJSONString(ce(n)),o.headerPP=JSON.stringify(o.headerObj,null," "),null==o.payloadObj?o.payloadPP=ce(n):o.payloadPP=JSON.stringify(o.payloadObj,null," "),void 0!==r&&(o.sigHex=we(r)),o},ue.jws.JWS.verifyJWT=function(e,t,n){var r=ue.jws,i=r.JWS,o=i.readSafeJSONString,s=i.inArray,a=i.includedArray,u=e.split("."),l=u[0],c=u[1],d=(we(u[2]),o(ce(l))),h=o(ce(c));if(void 0===d.alg)return!1;if(void 0===n.alg)throw"acceptField.alg shall be specified";if(!s(d.alg,n.alg))return!1;if(void 0!==h.iss&&"object"===f(n.iss)&&!s(h.iss,n.iss))return!1;if(void 0!==h.sub&&"object"===f(n.sub)&&!s(h.sub,n.sub))return!1;if(void 0!==h.aud&&"object"===f(n.aud))if("string"==typeof h.aud){if(!s(h.aud,n.aud))return!1}else if("object"==f(h.aud)&&!a(h.aud,n.aud))return!1;var p=r.IntDate.getNow();return void 0!==n.verifyAt&&"number"==typeof n.verifyAt&&(p=n.verifyAt),void 0!==n.gracePeriod&&"number"==typeof n.gracePeriod||(n.gracePeriod=0),!(void 0!==h.exp&&"number"==typeof h.exp&&h.exp+n.gracePeriodt.length&&(n=t.length);for(var r=0;r=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(e).length;default:if(r)return B(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,n);case"utf8":case"utf-8":return C(this,t,n);case"ascii":return T(this,t,n);case"latin1":case"binary":return A(this,t,n);case"base64":return k(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function y(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,i){var o,s=1,a=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,n/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var c=-1;for(o=n;oa&&(n=a-u),o=n;o>=0;o--){for(var d=!0,h=0;hi&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function k(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function C(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:l>223?3:l>191?2:1;if(i+d<=n)switch(d){case 1:l<128&&(c=l);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(u=(15&l)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(c=u)}null===c?(c=65533,d=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=d}return function(e){var t=e.length;if(t<=P)return String.fromCharCode.apply(String,e);for(var n="",r=0;r0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},u.prototype.compare=function(e,t,n,r,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),a=Math.min(o,s),l=this.slice(r,i),c=e.slice(t,n),d=0;di)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return w(this,e,t,n);case"utf8":case"utf-8":return _(this,e,t,n);case"ascii":return b(this,e,t,n);case"latin1":case"binary":return S(this,e,t,n);case"base64":return x(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var P=4096;function T(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,n,r,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function R(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function F(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function M(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function N(e,t,n,r,o){return o||M(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function D(e,t,n,r,o){return o||M(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUInt8=function(e,t){return t||j(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||j(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||j(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||j(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||j(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||j(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||j(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||j(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||j(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||j(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||j(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||j(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||j(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||j(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||j(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||j(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){e=+e,t|=0,n|=0,r||L(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):F(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):F(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);L(this,e,t,n,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o>0)-a&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);L(this,e,t,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):F(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):F(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return N(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return N(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return D(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return D(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function z(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(U,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function H(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(29))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";t.byteLength=function(e){var t=l(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=l(e),s=r[0],a=r[1],u=new o(function(e,t,n){return 3*(t+n)/4-n}(0,s,a)),c=0,d=a>0?s-4:s;for(n=0;n>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===a&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,u[c++]=255&t),1===a&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,u=n-i;au?u:a+s));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e,t,n){for(var i,o,s=[],a=t;a>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,i){var o,s,a=8*i-r-1,u=(1<>1,c=-7,d=n?i-1:0,h=n?-1:1,f=e[t+d];for(d+=h,o=f&(1<<-c)-1,f>>=-c,c+=a;c>0;o=256*o+e[t+d],d+=h,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=r;c>0;s=256*s+e[t+d],d+=h,c-=8);if(0===o)o=1-l;else{if(o===u)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,r),o-=l}return(f?-1:1)*s*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var s,a,u,l=8*o-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+d>=1?h/u:h*Math.pow(2,1-d))*u>=2&&(s++,u/=2),s+d>=c?(a=0,s=c):s+d>=1?(a=(t*u-1)*Math.pow(2,i),s+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;e[n+f]=255&a,f+=p,a/=256,i-=8);for(s=s<0;e[n+f]=255&s,f+=p,s/=256,l-=8);e[n+f-p]|=128*g}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.jws,n=e.KeyUtil,i=e.X509,o=e.crypto,s=e.hextob64u,a=e.b64tohex,u=e.AllowedSigningAlgs;return function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.parseJwt=function e(n){r.Log.debug("JoseUtil.parseJwt");try{var i=t.JWS.parse(n);return{header:i.headerObj,payload:i.payloadObj}}catch(e){r.Log.error(e)}},e.validateJwt=function(t,o,s,u,l,c,d){r.Log.debug("JoseUtil.validateJwt");try{if("RSA"===o.kty)if(o.e&&o.n)o=n.getKey(o);else{if(!o.x5c||!o.x5c.length)return r.Log.error("JoseUtil.validateJwt: RSA key missing key material",o),Promise.reject(new Error("RSA key missing key material"));var h=a(o.x5c[0]);o=i.getPublicKeyFromCertHex(h)}else{if("EC"!==o.kty)return r.Log.error("JoseUtil.validateJwt: Unsupported key type",o&&o.kty),Promise.reject(new Error(o.kty));if(!(o.crv&&o.x&&o.y))return r.Log.error("JoseUtil.validateJwt: EC key missing key material",o),Promise.reject(new Error("EC key missing key material"));o=n.getKey(o)}return e._validateJwt(t,o,s,u,l,c,d)}catch(e){return r.Log.error(e&&e.message||e),Promise.reject("JWT validation failed")}},e.validateJwtAttributes=function(t,n,i,o,s,a){o||(o=0),s||(s=parseInt(Date.now()/1e3));var u=e.parseJwt(t).payload;if(!u.iss)return r.Log.error("JoseUtil._validateJwt: issuer was not provided"),Promise.reject(new Error("issuer was not provided"));if(u.iss!==n)return r.Log.error("JoseUtil._validateJwt: Invalid issuer in token",u.iss),Promise.reject(new Error("Invalid issuer in token: "+u.iss));if(!u.aud)return r.Log.error("JoseUtil._validateJwt: aud was not provided"),Promise.reject(new Error("aud was not provided"));if(!(u.aud===i||Array.isArray(u.aud)&&u.aud.indexOf(i)>=0))return r.Log.error("JoseUtil._validateJwt: Invalid audience in token",u.aud),Promise.reject(new Error("Invalid audience in token: "+u.aud));if(u.azp&&u.azp!==i)return r.Log.error("JoseUtil._validateJwt: Invalid azp in token",u.azp),Promise.reject(new Error("Invalid azp in token: "+u.azp));if(!a){var l=s+o,c=s-o;if(!u.iat)return r.Log.error("JoseUtil._validateJwt: iat was not provided"),Promise.reject(new Error("iat was not provided"));if(l1&&void 0!==arguments[1]?arguments[1]:"#";o(this,e);var r=i.UrlUtility.parseUrlFragment(t,n);this.error=r.error,this.error_description=r.error_description,this.error_uri=r.error_uri,this.code=r.code,this.state=r.state,this.id_token=r.id_token,this.session_state=r.session_state,this.access_token=r.access_token,this.token_type=r.token_type,this.scope=r.scope,this.profile=void 0,this.expires_in=r.expires_in}return r(e,[{key:"expires_in",get:function(){if(this.expires_at){var e=parseInt(Date.now()/1e3);return this.expires_at-e}},set:function(e){var t=parseInt(e);if("number"==typeof t&&t>0){var n=parseInt(Date.now()/1e3);this.expires_at=n+t}}},{key:"expired",get:function(){var e=this.expires_in;if(void 0!==e)return e<=0}},{key:"scopes",get:function(){return(this.scope||"").split(" ")}},{key:"isOpenIdConnect",get:function(){return this.scopes.indexOf("openid")>=0||!!this.id_token}}]),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SignoutRequest=void 0;var r=n(0),i=n(3),o=n(9);t.SignoutRequest=function e(t){var n=t.url,s=t.id_token_hint,a=t.post_logout_redirect_uri,u=t.data,l=t.extraQueryParams,c=t.request_type;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!n)throw r.Log.error("SignoutRequest.ctor: No url passed"),new Error("url");for(var d in s&&(n=i.UrlUtility.addQueryParam(n,"id_token_hint",s)),a&&(n=i.UrlUtility.addQueryParam(n,"post_logout_redirect_uri",a),u&&(this.state=new o.State({data:u,request_type:c}),n=i.UrlUtility.addQueryParam(n,"state",this.state.id))),l)n=i.UrlUtility.addQueryParam(n,d,l[d]);this.url=n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SignoutResponse=void 0;var r=n(3);t.SignoutResponse=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=r.UrlUtility.parseUrlFragment(t,"?");this.error=n.error,this.error_description=n.error_description,this.error_uri=n.error_uri,this.state=n.state}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InMemoryWebStorage=void 0;var r=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.SilentRenewService,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c.SessionMonitor,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:h.TokenRevocationClient,d=arguments.length>4&&void 0!==arguments[4]?arguments[4]:f.TokenClient,y=arguments.length>5&&void 0!==arguments[5]?arguments[5]:p.JoseUtil;g(this,t),n instanceof s.UserManagerSettings||(n=new s.UserManagerSettings(n));var v=m(this,e.call(this,n));return v._events=new u.UserManagerEvents(n),v._silentRenewService=new r(v),v.settings.automaticSilentRenew&&(i.Log.debug("UserManager.ctor: automaticSilentRenew is configured, setting up silent renew"),v.startSilentRenew()),v.settings.monitorSession&&(i.Log.debug("UserManager.ctor: monitorSession is configured, setting up session monitor"),v._sessionMonitor=new o(v)),v._tokenRevocationClient=new a(v._settings),v._tokenClient=new d(v._settings),v._joseUtil=y,v}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.getUser=function(){var e=this;return this._loadUser().then((function(t){return t?(i.Log.info("UserManager.getUser: user loaded"),e._events.load(t,!1),t):(i.Log.info("UserManager.getUser: user not found in storage"),null)}))},t.prototype.removeUser=function(){var e=this;return this.storeUser(null).then((function(){i.Log.info("UserManager.removeUser: user removed from storage"),e._events.unload()}))},t.prototype.signinRedirect=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).request_type="si:r";var t={useReplaceToNavigate:e.useReplaceToNavigate};return this._signinStart(e,this._redirectNavigator,t).then((function(){i.Log.info("UserManager.signinRedirect: successful")}))},t.prototype.signinRedirectCallback=function(e){return this._signinEnd(e||this._redirectNavigator.url).then((function(e){return e.profile&&e.profile.sub?i.Log.info("UserManager.signinRedirectCallback: successful, signed in sub: ",e.profile.sub):i.Log.info("UserManager.signinRedirectCallback: no sub"),e}))},t.prototype.signinPopup=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).request_type="si:p";var t=e.redirect_uri||this.settings.popup_redirect_uri||this.settings.redirect_uri;return t?(e.redirect_uri=t,e.display="popup",this._signin(e,this._popupNavigator,{startUrl:t,popupWindowFeatures:e.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:e.popupWindowTarget||this.settings.popupWindowTarget}).then((function(e){return e&&(e.profile&&e.profile.sub?i.Log.info("UserManager.signinPopup: signinPopup successful, signed in sub: ",e.profile.sub):i.Log.info("UserManager.signinPopup: no sub")),e}))):(i.Log.error("UserManager.signinPopup: No popup_redirect_uri or redirect_uri configured"),Promise.reject(new Error("No popup_redirect_uri or redirect_uri configured")))},t.prototype.signinPopupCallback=function(e){return this._signinCallback(e,this._popupNavigator).then((function(e){return e&&(e.profile&&e.profile.sub?i.Log.info("UserManager.signinPopupCallback: successful, signed in sub: ",e.profile.sub):i.Log.info("UserManager.signinPopupCallback: no sub")),e})).catch((function(e){i.Log.error(e.message)}))},t.prototype.signinSilent=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=Object.assign({},t),this._loadUser().then((function(n){return n&&n.refresh_token?(t.refresh_token=n.refresh_token,e._useRefreshToken(t)):(t.request_type="si:s",t.id_token_hint=t.id_token_hint||e.settings.includeIdTokenInSilentRenew&&n&&n.id_token,n&&e._settings.validateSubOnSilentRenew&&(i.Log.debug("UserManager.signinSilent, subject prior to silent renew: ",n.profile.sub),t.current_sub=n.profile.sub),e._signinSilentIframe(t))}))},t.prototype._useRefreshToken=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._tokenClient.exchangeRefreshToken(t).then((function(t){return t?t.access_token?e._loadUser().then((function(n){if(n){var r=Promise.resolve();return t.id_token&&(r=e._validateIdTokenFromTokenRefreshToken(n.profile,t.id_token)),r.then((function(){return i.Log.debug("UserManager._useRefreshToken: refresh token response success"),n.id_token=t.id_token||n.id_token,n.access_token=t.access_token,n.refresh_token=t.refresh_token||n.refresh_token,n.expires_in=t.expires_in,e.storeUser(n).then((function(){return e._events.load(n),n}))}))}return null})):(i.Log.error("UserManager._useRefreshToken: No access token returned from token endpoint"),Promise.reject("No access token returned from token endpoint")):(i.Log.error("UserManager._useRefreshToken: No response returned from token endpoint"),Promise.reject("No response returned from token endpoint"))}))},t.prototype._validateIdTokenFromTokenRefreshToken=function(e,t){var n=this;return this._metadataService.getIssuer().then((function(r){return n.settings.getEpochTime().then((function(o){return n._joseUtil.validateJwtAttributes(t,r,n._settings.client_id,n._settings.clockSkew,o).then((function(t){return t?t.sub!==e.sub?(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: sub in id_token does not match current sub"),Promise.reject(new Error("sub in id_token does not match current sub"))):t.auth_time&&t.auth_time!==e.auth_time?(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: auth_time in id_token does not match original auth_time"),Promise.reject(new Error("auth_time in id_token does not match original auth_time"))):t.azp&&t.azp!==e.azp?(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: azp in id_token does not match original azp"),Promise.reject(new Error("azp in id_token does not match original azp"))):!t.azp&&e.azp?(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: azp not in id_token, but present in original id_token"),Promise.reject(new Error("azp not in id_token, but present in original id_token"))):void 0:(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: Failed to validate id_token"),Promise.reject(new Error("Failed to validate id_token")))}))}))}))},t.prototype._signinSilentIframe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.redirect_uri||this.settings.silent_redirect_uri||this.settings.redirect_uri;return t?(e.redirect_uri=t,e.prompt=e.prompt||"none",this._signin(e,this._iframeNavigator,{startUrl:t,silentRequestTimeout:e.silentRequestTimeout||this.settings.silentRequestTimeout}).then((function(e){return e&&(e.profile&&e.profile.sub?i.Log.info("UserManager.signinSilent: successful, signed in sub: ",e.profile.sub):i.Log.info("UserManager.signinSilent: no sub")),e}))):(i.Log.error("UserManager.signinSilent: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured")))},t.prototype.signinSilentCallback=function(e){return this._signinCallback(e,this._iframeNavigator).then((function(e){return e&&(e.profile&&e.profile.sub?i.Log.info("UserManager.signinSilentCallback: successful, signed in sub: ",e.profile.sub):i.Log.info("UserManager.signinSilentCallback: no sub")),e}))},t.prototype.signinCallback=function(e){var t=this;return this.readSigninResponseState(e).then((function(n){var r=n.state;return n.response,"si:r"===r.request_type?t.signinRedirectCallback(e):"si:p"===r.request_type?t.signinPopupCallback(e):"si:s"===r.request_type?t.signinSilentCallback(e):Promise.reject(new Error("invalid response_type in state"))}))},t.prototype.signoutCallback=function(e,t){var n=this;return this.readSignoutResponseState(e).then((function(r){var i=r.state,o=r.response;return i?"so:r"===i.request_type?n.signoutRedirectCallback(e):"so:p"===i.request_type?n.signoutPopupCallback(e,t):Promise.reject(new Error("invalid response_type in state")):o}))},t.prototype.querySessionStatus=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).request_type="si:s";var n=t.redirect_uri||this.settings.silent_redirect_uri||this.settings.redirect_uri;return n?(t.redirect_uri=n,t.prompt="none",t.response_type=t.response_type||this.settings.query_status_response_type,t.scope=t.scope||"openid",t.skipUserInfo=!0,this._signinStart(t,this._iframeNavigator,{startUrl:n,silentRequestTimeout:t.silentRequestTimeout||this.settings.silentRequestTimeout}).then((function(t){return e.processSigninResponse(t.url).then((function(e){if(i.Log.debug("UserManager.querySessionStatus: got signin response"),e.session_state&&e.profile.sub)return i.Log.info("UserManager.querySessionStatus: querySessionStatus success for sub: ",e.profile.sub),{session_state:e.session_state,sub:e.profile.sub,sid:e.profile.sid};i.Log.info("querySessionStatus successful, user not authenticated")})).catch((function(t){if(t.session_state&&e.settings.monitorAnonymousSession&&("login_required"==t.message||"consent_required"==t.message||"interaction_required"==t.message||"account_selection_required"==t.message))return i.Log.info("UserManager.querySessionStatus: querySessionStatus success for anonymous user"),{session_state:t.session_state};throw t}))}))):(i.Log.error("UserManager.querySessionStatus: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured")))},t.prototype._signin=function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._signinStart(e,t,r).then((function(t){return n._signinEnd(t.url,e)}))},t.prototype._signinStart=function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.prepare(r).then((function(t){return i.Log.debug("UserManager._signinStart: got navigator window handle"),n.createSigninRequest(e).then((function(e){return i.Log.debug("UserManager._signinStart: got signin request"),r.url=e.url,r.id=e.state.id,t.navigate(r)})).catch((function(e){throw t.close&&(i.Log.debug("UserManager._signinStart: Error after preparing navigator, closing navigator window"),t.close()),e}))}))},t.prototype._signinEnd=function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.processSigninResponse(e).then((function(e){i.Log.debug("UserManager._signinEnd: got signin response");var r=new a.User(e);if(n.current_sub){if(n.current_sub!==r.profile.sub)return i.Log.debug("UserManager._signinEnd: current user does not match user returned from signin. sub from signin: ",r.profile.sub),Promise.reject(new Error("login_required"));i.Log.debug("UserManager._signinEnd: current user matches user returned from signin")}return t.storeUser(r).then((function(){return i.Log.debug("UserManager._signinEnd: user stored"),t._events.load(r),r}))}))},t.prototype._signinCallback=function(e,t){i.Log.debug("UserManager._signinCallback");var n="query"===this._settings.response_mode||!this._settings.response_mode&&d.SigninRequest.isCode(this._settings.response_type)?"?":"#";return t.callback(e,void 0,n)},t.prototype.signoutRedirect=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).request_type="so:r";var t=e.post_logout_redirect_uri||this.settings.post_logout_redirect_uri;t&&(e.post_logout_redirect_uri=t);var n={useReplaceToNavigate:e.useReplaceToNavigate};return this._signoutStart(e,this._redirectNavigator,n).then((function(){i.Log.info("UserManager.signoutRedirect: successful")}))},t.prototype.signoutRedirectCallback=function(e){return this._signoutEnd(e||this._redirectNavigator.url).then((function(e){return i.Log.info("UserManager.signoutRedirectCallback: successful"),e}))},t.prototype.signoutPopup=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).request_type="so:p";var t=e.post_logout_redirect_uri||this.settings.popup_post_logout_redirect_uri||this.settings.post_logout_redirect_uri;return e.post_logout_redirect_uri=t,e.display="popup",e.post_logout_redirect_uri&&(e.state=e.state||{}),this._signout(e,this._popupNavigator,{startUrl:t,popupWindowFeatures:e.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:e.popupWindowTarget||this.settings.popupWindowTarget}).then((function(){i.Log.info("UserManager.signoutPopup: successful")}))},t.prototype.signoutPopupCallback=function(e,t){return void 0===t&&"boolean"==typeof e&&(t=e,e=null),this._popupNavigator.callback(e,t,"?").then((function(){i.Log.info("UserManager.signoutPopupCallback: successful")}))},t.prototype._signout=function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._signoutStart(e,t,r).then((function(e){return n._signoutEnd(e.url)}))},t.prototype._signoutStart=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this,n=arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.prepare(r).then((function(n){return i.Log.debug("UserManager._signoutStart: got navigator window handle"),t._loadUser().then((function(o){return i.Log.debug("UserManager._signoutStart: loaded current user from storage"),(t._settings.revokeAccessTokenOnSignout?t._revokeInternal(o):Promise.resolve()).then((function(){var s=e.id_token_hint||o&&o.id_token;return s&&(i.Log.debug("UserManager._signoutStart: Setting id_token into signout request"),e.id_token_hint=s),t.removeUser().then((function(){return i.Log.debug("UserManager._signoutStart: user removed, creating signout request"),t.createSignoutRequest(e).then((function(e){return i.Log.debug("UserManager._signoutStart: got signout request"),r.url=e.url,e.state&&(r.id=e.state.id),n.navigate(r)}))}))}))})).catch((function(e){throw n.close&&(i.Log.debug("UserManager._signoutStart: Error after preparing navigator, closing navigator window"),n.close()),e}))}))},t.prototype._signoutEnd=function(e){return this.processSignoutResponse(e).then((function(e){return i.Log.debug("UserManager._signoutEnd: got signout response"),e}))},t.prototype.revokeAccessToken=function(){var e=this;return this._loadUser().then((function(t){return e._revokeInternal(t,!0).then((function(n){if(n)return i.Log.debug("UserManager.revokeAccessToken: removing token properties from user and re-storing"),t.access_token=null,t.refresh_token=null,t.expires_at=null,t.token_type=null,e.storeUser(t).then((function(){i.Log.debug("UserManager.revokeAccessToken: user stored"),e._events.load(t)}))}))})).then((function(){i.Log.info("UserManager.revokeAccessToken: access token revoked successfully")}))},t.prototype._revokeInternal=function(e,t){var n=this;if(e){var r=e.access_token,o=e.refresh_token;return this._revokeAccessTokenInternal(r,t).then((function(e){return n._revokeRefreshTokenInternal(o,t).then((function(t){return e||t||i.Log.debug("UserManager.revokeAccessToken: no need to revoke due to no token(s), or JWT format"),e||t}))}))}return Promise.resolve(!1)},t.prototype._revokeAccessTokenInternal=function(e,t){return!e||e.indexOf(".")>=0?Promise.resolve(!1):this._tokenRevocationClient.revoke(e,t).then((function(){return!0}))},t.prototype._revokeRefreshTokenInternal=function(e,t){return e?this._tokenRevocationClient.revoke(e,t,"refresh_token").then((function(){return!0})):Promise.resolve(!1)},t.prototype.startSilentRenew=function(){this._silentRenewService.start()},t.prototype.stopSilentRenew=function(){this._silentRenewService.stop()},t.prototype._loadUser=function(){return this._userStore.get(this._userStoreKey).then((function(e){return e?(i.Log.debug("UserManager._loadUser: user storageString loaded"),a.User.fromStorageString(e)):(i.Log.debug("UserManager._loadUser: no user storageString"),null)}))},t.prototype.storeUser=function(e){if(e){i.Log.debug("UserManager.storeUser: storing user");var t=e.toStorageString();return this._userStore.set(this._userStoreKey,t)}return i.Log.debug("storeUser.storeUser: removing user"),this._userStore.remove(this._userStoreKey)},r(t,[{key:"_redirectNavigator",get:function(){return this.settings.redirectNavigator}},{key:"_popupNavigator",get:function(){return this.settings.popupNavigator}},{key:"_iframeNavigator",get:function(){return this.settings.iframeNavigator}},{key:"_userStore",get:function(){return this.settings.userStore}},{key:"events",get:function(){return this._events}},{key:"_userStoreKey",get:function(){return"user:"+this.settings.authority+":"+this.settings.client_id}}]),t}(o.OidcClient)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UserManagerSettings=void 0;var r=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},r=n.popup_redirect_uri,i=n.popup_post_logout_redirect_uri,f=n.popupWindowFeatures,p=n.popupWindowTarget,g=n.silent_redirect_uri,m=n.silentRequestTimeout,y=n.automaticSilentRenew,v=void 0!==y&&y,w=n.validateSubOnSilentRenew,_=void 0!==w&&w,b=n.includeIdTokenInSilentRenew,S=void 0===b||b,x=n.monitorSession,E=void 0===x||x,k=n.monitorAnonymousSession,C=void 0!==k&&k,P=n.checkSessionInterval,T=void 0===P?2e3:P,A=n.stopCheckSessionOnError,O=void 0===A||A,I=n.query_status_response_type,j=n.revokeAccessTokenOnSignout,L=void 0!==j&&j,R=n.accessTokenExpiringNotificationTime,F=void 0===R?60:R,M=n.redirectNavigator,N=void 0===M?new o.RedirectNavigator:M,D=n.popupNavigator,U=void 0===D?new s.PopupNavigator:D,$=n.iframeNavigator,B=void 0===$?new a.IFrameNavigator:$,z=n.userStore,H=void 0===z?new u.WebStorageStateStore({store:l.Global.sessionStorage}):z;d(this,t);var V=h(this,e.call(this,arguments[0]));return V._popup_redirect_uri=r,V._popup_post_logout_redirect_uri=i,V._popupWindowFeatures=f,V._popupWindowTarget=p,V._silent_redirect_uri=g,V._silentRequestTimeout=m,V._automaticSilentRenew=v,V._validateSubOnSilentRenew=_,V._includeIdTokenInSilentRenew=S,V._accessTokenExpiringNotificationTime=F,V._monitorSession=E,V._monitorAnonymousSession=C,V._checkSessionInterval=T,V._stopCheckSessionOnError=O,I?V._query_status_response_type=I:arguments[0]&&arguments[0].response_type?V._query_status_response_type=c.SigninRequest.isOidc(arguments[0].response_type)?"id_token":"code":V._query_status_response_type="id_token",V._revokeAccessTokenOnSignout=L,V._redirectNavigator=N,V._popupNavigator=U,V._iframeNavigator=B,V._userStore=H,V}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"popup_redirect_uri",get:function(){return this._popup_redirect_uri}},{key:"popup_post_logout_redirect_uri",get:function(){return this._popup_post_logout_redirect_uri}},{key:"popupWindowFeatures",get:function(){return this._popupWindowFeatures}},{key:"popupWindowTarget",get:function(){return this._popupWindowTarget}},{key:"silent_redirect_uri",get:function(){return this._silent_redirect_uri}},{key:"silentRequestTimeout",get:function(){return this._silentRequestTimeout}},{key:"automaticSilentRenew",get:function(){return this._automaticSilentRenew}},{key:"validateSubOnSilentRenew",get:function(){return this._validateSubOnSilentRenew}},{key:"includeIdTokenInSilentRenew",get:function(){return this._includeIdTokenInSilentRenew}},{key:"accessTokenExpiringNotificationTime",get:function(){return this._accessTokenExpiringNotificationTime}},{key:"monitorSession",get:function(){return this._monitorSession}},{key:"monitorAnonymousSession",get:function(){return this._monitorAnonymousSession}},{key:"checkSessionInterval",get:function(){return this._checkSessionInterval}},{key:"stopCheckSessionOnError",get:function(){return this._stopCheckSessionOnError}},{key:"query_status_response_type",get:function(){return this._query_status_response_type}},{key:"revokeAccessTokenOnSignout",get:function(){return this._revokeAccessTokenOnSignout}},{key:"redirectNavigator",get:function(){return this._redirectNavigator}},{key:"popupNavigator",get:function(){return this._popupNavigator}},{key:"iframeNavigator",get:function(){return this._iframeNavigator}},{key:"userStore",get:function(){return this._userStore}}]),t}(i.OidcClientSettings)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RedirectNavigator=void 0;var r=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1])||arguments[1];r.Log.debug("UserManagerEvents.load"),e.prototype.load.call(this,t),n&&this._userLoaded.raise(t)},t.prototype.unload=function(){r.Log.debug("UserManagerEvents.unload"),e.prototype.unload.call(this),this._userUnloaded.raise()},t.prototype.addUserLoaded=function(e){this._userLoaded.addHandler(e)},t.prototype.removeUserLoaded=function(e){this._userLoaded.removeHandler(e)},t.prototype.addUserUnloaded=function(e){this._userUnloaded.addHandler(e)},t.prototype.removeUserUnloaded=function(e){this._userUnloaded.removeHandler(e)},t.prototype.addSilentRenewError=function(e){this._silentRenewError.addHandler(e)},t.prototype.removeSilentRenewError=function(e){this._silentRenewError.removeHandler(e)},t.prototype._raiseSilentRenewError=function(e){r.Log.debug("UserManagerEvents._raiseSilentRenewError",e.message),this._silentRenewError.raise(e)},t.prototype.addUserSignedIn=function(e){this._userSignedIn.addHandler(e)},t.prototype.removeUserSignedIn=function(e){this._userSignedIn.removeHandler(e)},t.prototype._raiseUserSignedIn=function(){r.Log.debug("UserManagerEvents._raiseUserSignedIn"),this._userSignedIn.raise()},t.prototype.addUserSignedOut=function(e){this._userSignedOut.addHandler(e)},t.prototype.removeUserSignedOut=function(e){this._userSignedOut.removeHandler(e)},t.prototype._raiseUserSignedOut=function(){r.Log.debug("UserManagerEvents._raiseUserSignedOut"),this._userSignedOut.raise()},t.prototype.addUserSessionChanged=function(e){this._userSessionChanged.addHandler(e)},t.prototype.removeUserSessionChanged=function(e){this._userSessionChanged.removeHandler(e)},t.prototype._raiseUserSessionChanged=function(){r.Log.debug("UserManagerEvents._raiseUserSessionChanged"),this._userSessionChanged.raise()},t}(i.AccessTokenEvents)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Timer=void 0;var r=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:o.Global.timer,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;a(this,t);var s=u(this,e.call(this,n));return s._timer=r,s._nowFunc=i||function(){return Date.now()/1e3},s}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.init=function(e){e<=0&&(e=1),e=parseInt(e);var t=this.now+e;if(this.expiration===t&&this._timerHandle)i.Log.debug("Timer.init timer "+this._name+" skipping initialization since already initialized for expiration:",this.expiration);else{this.cancel(),i.Log.debug("Timer.init timer "+this._name+" for duration:",e),this._expiration=t;var n=5;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7639),i=n(422);class o{constructor(e,t){this.dataset=e,this.datasetCoreFactory=t}createBlankDataset(){return new o(this.datasetCoreFactory.dataset(),this.datasetCoreFactory)}addAll(e){for(const t of e)this.add(t);return this}contains(e){if(e.size>this.size)return!1;for(const t of e)if(!this.has(t))return!1;return!0}deleteMatches(e,t,n,r){const i=this.match(e,t,n,r);for(const o of i)this.dataset.delete(o);return this}difference(e){const t=this.createBlankDataset();for(const n of this)e.has(n)||t.add(n);return t}equals(e){if(this.size!==e.size)return!1;for(const t of this)if(!e.has(t))return!1;return!0}every(e){for(const t of this)if(!e(t,this))return!1;return!0}filter(e){const t=this.createBlankDataset();for(const n of this)e(n,this)&&t.add(n);return t}forEach(e){for(const t of this)e(t,this)}import(e){return new Promise(((t,n)=>{e.on("data",(e=>{this.add(e)})).on("end",(()=>{t(this)})).on("error",(e=>n(e)))}))}intersection(e){const t=this.createBlankDataset(),n=this.size{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7639);t.default=async function(e,t,n){const i=await(0,r.serializedToQuads)(t,n);return e.dataset(i)}},3849:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createExtendedDatasetFactory=void 0;const i=r(n(9918)),o=n(4533);function s(){const e={dataset:e=>(0,o.dataset)(Array.isArray(e)?e:e?.toArray())};return new i.default(e)}t.createExtendedDatasetFactory=s,t.default=function(e){return s().dataset(e)}},5897:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(1429)),o=n(3849);t.default=async function(e,t){const n=(0,o.createExtendedDatasetFactory)();return(0,i.default)(n,e,t)}},7310:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedDatasetFactory=t.ExtendedDataset=t.serializedToDataset=t.createDatasetFromSerializedInput=t.createDatasetFactory=t.createDataset=void 0;var i=n(3849);Object.defineProperty(t,"createDataset",{enumerable:!0,get:function(){return r(i).default}}),Object.defineProperty(t,"createDatasetFactory",{enumerable:!0,get:function(){return i.createExtendedDatasetFactory}});var o=n(1429);Object.defineProperty(t,"createDatasetFromSerializedInput",{enumerable:!0,get:function(){return r(o).default}});var s=n(5897);Object.defineProperty(t,"serializedToDataset",{enumerable:!0,get:function(){return r(s).default}});var a=n(4942);Object.defineProperty(t,"ExtendedDataset",{enumerable:!0,get:function(){return r(a).default}});var u=n(9918);Object.defineProperty(t,"ExtendedDatasetFactory",{enumerable:!0,get:function(){return r(u).default}})},4093:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContextUtil=void 0;const n={"@type":"http://www.w3.org/1999/02/22-rdf-syntax-ns#type"};t.ContextUtil=class{constructor(e){this.context=e,this.iriToKeyMap={},Object.entries(e).forEach((e=>{let[t,n]=e;"string"===typeof n?this.iriToKeyMap[this.keyIdToIri(n)]=t:"object"===typeof n&&n["@id"]&&(this.iriToKeyMap[this.keyIdToIri(n["@id"])]=t)}))}keyToIri(e){return this.context[e]?"string"===typeof this.context[e]?this.keyIdToIri(this.context[e]):this.context[e]&&this.context[e]["@id"]?this.keyIdToIri(this.context[e]["@id"]):e:e}keyIdToIri(e){return n[e]?n[e]:e}iriToKey(e){return this.iriToKeyMap[e]?this.iriToKeyMap[e]:e}getType(e){return"object"===typeof this.context[e]&&this.context[e]["@type"]?this.context[e]["@type"]:"http://www.w3.org/2001/XMLSchema#string"}isArray(e){return!(!this.context[e]||"object"!==typeof this.context[e]||!this.context[e]["@container"]||"@set"!==this.context[e]["@container"])}isLangString(e){return!(!this.context[e]||"object"!==typeof this.context[e]||!this.context[e]["@type"]||"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"!==this.context[e]["@type"])}}},7370:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JsonldDatasetProxyBuilder=void 0;const r=n(7478);class i{constructor(e){this.proxyContext=e}write(){for(var e=arguments.length,t=new Array(e),n=0;n{let[t,r]=e;n[t]=r})),n}}t.JsonldDatasetProxyBuilder=i},9254:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyContext=void 0;const r=n(6950),i=n(6708),o=n(4715);class s{constructor(e){this.subjectMap=new Map,this.arrayMap=new Map,this.dataset=e.dataset,this.contextUtil=e.contextUtil,this.writeGraphs=e.writeGraphs,this.languageOrdering=e.languageOrdering,this.state=e.state||{},e.prefilledArrayTargets&&e.prefilledArrayTargets.forEach((e=>{this.createArrayProxy(e[0],e[2],e)}))}createSubjectProxy(e){if(!this.subjectMap.has(e.value)){const t=new Proxy({"@id":e},this.createSubjectHandler());this.subjectMap.set(e.value,t)}return this.subjectMap.get(e.value)}createSubjectHandler(){return(0,i.createSubjectHandler)(this)}getArrayKey(){return`${(arguments.length<=0?void 0:arguments[0])?.value||"undefined"}|${(arguments.length<=1?void 0:arguments[1])?.value||"undefined"}|${(arguments.length<=2?void 0:arguments[2])?.value||"undefined"}|${(arguments.length<=3?void 0:arguments[3])?.value||"undefined"}`}createArrayProxy(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;const i=this.getArrayKey(...e);if(!this.arrayMap.has(i)){const o=new Proxy(n||[e,[],t,r],this.createArrayHandler());this.arrayMap.set(i,o)}return this.arrayMap.get(i)}createArrayHandler(){return(0,r.createArrayHandler)(this)}duplicate(e){const t=[];this.arrayMap.forEach((e=>{t.push(e[o._getUnderlyingArrayTarget])}));const n={dataset:this.dataset,contextUtil:this.contextUtil,writeGraphs:this.writeGraphs,languageOrdering:this.languageOrdering,prefilledArrayTargets:t,...e};return new s(n)}}t.ProxyContext=s},3952:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7710:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayMethodsBuilders=t.methodNames=void 0;const r=n(7020),i=n(5293);t.methodNames=new Set(["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"]),t.arrayMethodsBuilders={copyWithin:(e,t,n)=>(r,o,s)=>(0,i.modifyArray)({target:e,key:t,quadsToDelete:e=>{const t=[...e],n=new Set(e.copyWithin(r,o,s));return t.filter((e=>!n.has(e)))},modifyCoreArray:t=>(t.copyWithin(r,o,s),n.createArrayProxy(e[0],e[2]))},n),fill:(e,t,n)=>(r,o,s)=>(0,i.modifyArray)({target:e,key:t,toAdd:[r],quadsToDelete:e=>e.slice(o,s),modifyCoreArray:(t,r)=>(t.fill(r[0],o,s),n.createArrayProxy(e[0],e[2]))},n),pop:(e,t,n)=>()=>(0,i.modifyArray)({target:e,key:t,quadsToDelete:e=>e[e.length-1]?[e[e.length-1]]:[],modifyCoreArray:e=>{const t=e.pop();return t?(0,r.nodeToJsonldRepresentation)(t,n):void 0}},n),push:(e,t,n)=>function(){for(var r=arguments.length,o=new Array(r),s=0;s(t.push(...r),n.createArrayProxy(e[0],e[2]).length)},n)},reverse:(e,t,n)=>()=>(e[1].reverse(),n.createArrayProxy(e[0],e[2])),shift:(e,t,n)=>()=>(0,i.modifyArray)({target:e,key:t,quadsToDelete:e=>e[0]?[e[0]]:[],modifyCoreArray:e=>{const t=e.shift();return t?(0,r.nodeToJsonldRepresentation)(t,n):void 0}},n),sort:(e,t,n)=>t=>(t?e[1].sort(((e,i)=>t((0,r.nodeToJsonldRepresentation)(e,n),(0,r.nodeToJsonldRepresentation)(i,n)))):e&&e[1].sort(((e,t)=>{const i=(0,r.nodeToJsonldRepresentation)(e,n),o=(0,r.nodeToJsonldRepresentation)(t,n);return i>o?1:o>i?-1:0})),n.createArrayProxy(e[0],e[2])),splice:(e,t,n)=>function(o,s){for(var a=arguments.length,u=new Array(a>2?a-2:0),l=2;le.splice(o,s),modifyCoreArray:(e,t)=>e.splice(o,s||0,...t).map((e=>(0,r.nodeToJsonldRepresentation)(e,n)))},n)},unshift:(e,t,n)=>function(){for(var r=arguments.length,o=new Array(r),s=0;s(t.unshift(...r),n.createArrayProxy(e[0],e[2]).length)},n)}}},6950:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createArrayHandler=void 0;const r=n(7478),i=n(7020),o=n(7710),s=n(4715),a=n(5293),u=n(549),l=n(7400);function c(e,t){let n=t.dataset.match(...e[0]);e[3]&&(n=(0,l.filterQuadsByLanguageOrdering)(n,t.languageOrdering));const r=new u.NodeSet;n.toArray().forEach((t=>{e[2]?r.add(t.subject):r.add(t.object)}));const i=[];e[1].forEach((e=>{r.has(e)&&(i.push(e),r.delete(e))})),r.toArray().forEach((e=>{i.push(e)})),e[1]=i}function d(e,t){return e[1].map((e=>(0,i.nodeToJsonldRepresentation)(e,t)))}t.createArrayHandler=function(e){return{get(t,n){switch(n){case s._getUnderlyingDataset:return e.dataset;case s._getUnderlyingMatch:return t[0];case s._isSubjectOriented:return t[2];case s._getUnderlyingArrayTarget:return t;case s._proxyContext:return e;case s._getNodeAtIndex:return n=>(c(t,e),t[1][n])}c(t,e);const r=d(t,e);if(o.methodNames.has(n))return o.arrayMethodsBuilders[n](t,n,e);for(var i=arguments.length,a=new Array(i>2?i-2:0),u=2;u2?i-2:0),s=2;s1?r-1:0),o=1;o1?r-1:0),o=1;o1?r-1:0),o=1;oe[i]?[e[i]]:[],modifyCoreArray:(e,t)=>(e[i]=t[0],!0)},e)}for(var i=arguments.length,o=new Array(i>3?i-3:0),u=3;u{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isArrayProxy=void 0;const r=n(4715);t.isArrayProxy=function(e){if(!e)return!1;if("object"!==typeof e)return!1;const t=e;return!("object"!==typeof t[r._getUnderlyingDataset]||"object"!==typeof t[r._getUnderlyingMatch]||"function"!==typeof t[r._getNodeAtIndex]||"object"!==typeof t[r._getUnderlyingArrayTarget])}},5293:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.modifyArray=t.checkArrayModification=void 0;const r=n(7478),i=n(4671),o=n(7310),s=n(1019),a=n(5138),u=n(549);function l(e,t,n){if(e[2])for(const l of t){if(void 0===l)return;if("object"!==typeof l)throw new Error(`Cannot add a literal "${l}"(${typeof l}) to a subject-oriented collection.`);const t=new i.TransactionDataset(n.dataset,(0,o.createDatasetFactory)(),(0,i.createTransactionDatasetFactory)());(0,s.addObjectToDataset)(l,!1,n.duplicate({writeGraphs:[(0,r.defaultGraph)()]}));if(!(0!==t.match((0,a.getNodeFromRawObject)(l,n.contextUtil),e[0][1],e[0][2]).size))throw new Error(`Cannot add value to collection. This must contain a quad that matches (${(0,u.nodeToString)(e[0][0])}, ${(0,u.nodeToString)(e[0][1])}, ${(0,u.nodeToString)(e[0][2])}, ${(0,u.nodeToString)(e[0][3])})`)}else if(!e[0][0]||!e[0][1])throw new Error("A collection that does not specify a match for both a subject or predicate cannot be modified directly.")}t.checkArrayModification=l,t.modifyArray=function(e,t){const{target:n,toAdd:r,quadsToDelete:i,modifyCoreArray:o,key:u}=e,{dataset:c,contextUtil:d}=t;if(l(n,r||[],t),i){i(c.match(...n[0]).toArray()).forEach((e=>{n[2]?c.deleteMatches(e.subject,void 0,void 0):c.delete(e)}))}const h=r?.map((e=>"object"===typeof e?(0,s.addObjectToDataset)(e,!1,t):e)).filter((e=>void 0!=e));!n[2]&&n[0][0]&&n[0][1]&&h&&(0,s.addObjectToDataset)({"@id":n[0][0],[d.iriToKey(n[0][1].value)]:h},!1,t);const f=h?h.map((e=>(0,a.getNodeFromRawValue)(u,e,t))).filter((e=>void 0!=e)):[];return o(n[1],f)}},8606:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.graphOf=void 0;const r=n(7478),i=n(9955),o=n(4715);t.graphOf=function(e,t,n){const s=(0,i.getSubjectProxyFromObject)(e),a=s[o._proxyContext],u=s[o._getUnderlyingNode],l=(0,r.namedNode)(a.contextUtil.keyToIri(t));let c;if(null==n)c=null;else if("number"===typeof n){const r=e[t];if(!r[o._getUnderlyingMatch])throw new Error(`Key "${String(t)}" of ${e} is not an array.`);if(!r[n])throw new Error(`Index ${n} does not exist.`);(0,i.isSubjectProxy)(r[n])&&(c=r[n][1]),c=r[o._getNodeAtIndex](n)}else{c=(0,i.getSubjectProxyFromObject)(n)[o._getUnderlyingNode]}return s[o._getUnderlyingDataset].match(u,l,c).toArray().map((e=>e.graph))}},4230:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0});const o=n(3307);t.default=o.jsonldDatasetProxy,i(n(4715),t),i(n(4093),t),i(n(9254),t),i(n(7370),t),i(n(3307),t),i(n(7311),t),i(n(8606),t),i(n(564),t),i(n(8825),t),i(n(557),t),i(n(2052),t),i(n(6726),t),i(n(7400),t),i(n(6950),t),i(n(7710),t),i(n(3952),t),i(n(5293),t),i(n(9631),t),i(n(6708),t),i(n(5240),t),i(n(4321),t),i(n(460),t),i(n(9955),t),i(n(1019),t),i(n(7020),t),i(n(8004),t),i(n(5138),t),i(n(549),t),i(n(1737),t),i(n(2719),t)},3307:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.jsonldDatasetProxy=void 0;const r=n(7478),i=n(4093),o=n(7370),s=n(9254);t.jsonldDatasetProxy=function(e,t){const n=new i.ContextUtil(t),a=new s.ProxyContext({dataset:e,contextUtil:n,writeGraphs:[(0,r.defaultGraph)()],languageOrdering:["none","en","other"]});return new o.JsonldDatasetProxyBuilder(a)}},557:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createLanguageMapProxy=void 0;const i=n(7478),o=n(7400),s=r(n(2052));t.createLanguageMapProxy=function(e,t,n,r){const a={},u=i=>{Object.keys(i).forEach((e=>delete i[e]));const s=n.dataset.match(e,t),a=(0,o.quadsToLanguageQuadMap)(s);Object.entries(a).forEach((e=>{let[t,n]=e;const o=n.toArray().map((e=>e.object.value));i[t]=r?new Set(o):o[0]}))};return u(a),new Proxy(a,{get:(i,o)=>(u(i),"string"!==typeof o?Reflect.get(i,o):r?new s.default(e,t,o,n):Reflect.get(i,o)),set:(s,a,u)=>{const l=(0,o.languageKeyToLiteralLanguage)(a);return r||(0,o.languageDeleteMatch)(n.dataset,e,t,l),n.writeGraphs.forEach((r=>{n.dataset.add((0,i.quad)(e,t,(0,i.literal)(u,l),r))})),Reflect.set(s,a,u)},deleteProperty:(r,i)=>((0,o.languageDeleteMatch)(n.dataset,e,t,(0,o.languageKeyToLiteralLanguage)(i)),Reflect.deleteProperty(r,i))})}},2052:(e,t,n)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0});const i=n(7478),o=n(7400);class s{constructor(e,t,n,i){this[r]="LanguageSet",this.subject=e,this.predicate=t,this.languageKey=n,this.proxyContext=i}matchThis(){return(0,o.languageMatch)(this.proxyContext.dataset,this.subject,this.predicate,this.languageKey)}getLiteral(e){return"@none"===this.languageKey?(0,i.literal)(e):(0,i.literal)(e,this.languageKey)}get size(){return this.matchThis().size}add(e){return this.proxyContext.writeGraphs.forEach((t=>{this.proxyContext.dataset.add((0,i.quad)(this.subject,this.predicate,(0,i.literal)(e,this.languageKey),t))})),this}clear(){(0,o.languageDeleteMatch)(this.proxyContext.dataset,this.subject,this.predicate,this.languageKey)}delete(e){const t=this.has(e);return this.proxyContext.dataset.deleteMatches(this.subject,this.predicate,this.getLiteral(e)),t}forEach(e,t){this.matchThis().forEach((n=>{e(n.object.value,n.object.value,t||this)}))}has(e){return this.proxyContext.dataset.match(this.subject,this.predicate,this.getLiteral(e)).size>0}*entries(){const e=this.matchThis();for(const t of e)yield[t.object.value,t.object.value]}*keys(){const e=this.matchThis();for(const t of e)yield t.object.value}*values(){const e=this.matchThis();for(const t of e)yield t.object.value}*[Symbol.iterator](){const e=this.matchThis();for(const t of e)yield t.object.value}}t.default=s,r=Symbol.toStringTag},6726:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7400:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.literalLanguageToLanguageKey=t.languageKeyToLiteralLanguage=t.getLanguageKeyForWriteOperation=t.filterQuadsByLanguageOrdering=t.quadsToLanguageQuadMap=t.isLanguageLiteral=t.languageDeleteMatch=t.languageMatch=void 0;const r=n(7310);function i(e,t,n,r){const i=a(r);return e.match(t,n).filter((e=>o(e.object)&&e.object.language===i))}function o(e){return"Literal"===e.termType&&("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"===e.datatype.value||"http://www.w3.org/2001/XMLSchema#string"===e.datatype.value)}function s(e){const t={};return e.forEach((e=>{const n=e.object;if(o(n)){const i=u(n.language);t[i]||(t[i]=(0,r.createDataset)()),t[i].add(e)}})),t}function a(e){return"@none"===e?"":e}function u(e){return""===e?"@none":e}t.languageMatch=i,t.languageDeleteMatch=function(e,t,n,r){i(e,t,n,r).forEach((t=>{e.delete(t)}))},t.isLanguageLiteral=o,t.quadsToLanguageQuadMap=s,t.filterQuadsByLanguageOrdering=function(e,t){const n=s(e),i=new Set(t),o=new Set(Object.keys(n));for(const r of t){if(o.has(r))return n[r];if("@other"===r)for(const e of o)if(!i.has(e))return n[e]}return(0,r.createDataset)()},t.getLanguageKeyForWriteOperation=function(e){return e.find((e=>"@other"!==e))},t.languageKeyToLiteralLanguage=a,t.literalLanguageToLanguageKey=u},8825:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.languagesOf=void 0;const r=n(7478),i=n(9955),o=n(4715),s=n(557);t.languagesOf=function(e,t){const n=(0,i.getSubjectProxyFromObject)(e),a=n[o._proxyContext],u=n[o._getUnderlyingNode],l=(0,r.namedNode)(a.contextUtil.keyToIri(t));return(0,s.createLanguageMapProxy)(u,l,a,a.contextUtil.isArray(t))}},564:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setLanguagePreferences=void 0;const r=n(2719);t.setLanguagePreferences=function(){for(var e=arguments.length,t=new Array(e),n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6708:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSubjectHandler=void 0;const r=n(7478),i=n(1019),o=n(460),s=n(4715),a=n(4321);t.createSubjectHandler=function(e){let t=e;return{get(e,n){switch(n){case s._getUnderlyingDataset:return t.dataset;case s._getUnderlyingNode:return e["@id"];case s._proxyContext:return t;case s._writeGraphs:return t.writeGraphs;case"@context":return t.contextUtil.context}return(0,a.getValueForKey)(e,n,t)},getOwnPropertyDescriptor:(e,n)=>({value:(0,a.getValueForKey)(e,n,t),writable:!0,enumerable:!0,configurable:!0}),ownKeys(e){const n=e["@id"],r=t.dataset.match(n),i=new Set(["@id"]);return r.toArray().forEach((e=>{i.add(t.contextUtil.iriToKey(e.predicate.value))})),Array.from(i)},set:(e,n,o)=>{if(n===s._proxyContext)return t=o,!0;if("@id"===n&&"string"===typeof o){const n=t.dataset.match(e["@id"]).toArray(),i=n.map((e=>(0,r.quad)((0,r.namedNode)(o),e.predicate,e.object,e.graph)));n.forEach((e=>t.dataset.delete(e))),t.dataset.addAll(i);const s=t.dataset.match(void 0,void 0,e["@id"]).toArray(),a=s.map((e=>(0,r.quad)(e.subject,e.predicate,(0,r.namedNode)(o),e.graph)));s.forEach((e=>t.dataset.delete(e))),t.dataset.addAll(a),e["@id"]=(0,r.namedNode)(o)}return(0,i.addObjectToDataset)({"@id":e["@id"],[n]:o},!0,t),!0},deleteProperty:(e,n)=>(0,o.deleteValueFromDataset)(e,n,t)}}},460:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteValueFromDataset=void 0;const r=n(7478);t.deleteValueFromDataset=function(e,t,n){const i=[];if("@context"===t)return!0;if("toString"===t||t===Symbol.toStringTag)return!0;if("symbol"===typeof t)return!0;const o=e["@id"],s=(0,r.namedNode)(n.contextUtil.keyToIri(t));if("@id"===t)i.push(e["@id"]);else{const e=n.dataset.match(o,s);if(0===e.size)return!0;i.push(...e.toArray().map((e=>e.object)))}return i.forEach((e=>"Literal"===e.termType?(n.dataset.delete((0,r.quad)(o,s,e)),!0):"NamedNode"===e.termType?(n.dataset.deleteMatches(e,void 0,void 0),n.dataset.deleteMatches(void 0,void 0,e),!0):void 0)),!0}},4321:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getValueForKey=void 0;const r=n(7478),i=n(7020),o=n(7400);t.getValueForKey=function(e,t,n){const{contextUtil:s,dataset:a}=n;if("@id"===t){if("BlankNode"===e["@id"].termType)return;return s.iriToKey(e["@id"].value)}if("toString"===t||t===Symbol.toStringTag)return Reflect.get(e,"toString");if("symbol"===typeof t)return;const u=e["@id"],l=(0,r.namedNode)(s.keyToIri(t));if(s.isArray(t)){return n.createArrayProxy([u,l,null,null],!1,void 0,s.isLangString(t))}let c=a.match(u,l);if(s.isLangString(t)&&(c=(0,o.filterQuadsByLanguageOrdering)(c,n.languageOrdering)),0!==c.size){if(1===c.size){return(0,i.nodeToJsonldRepresentation)(c.toArray()[0].object,n)}return n.createArrayProxy([u,l,null,null])}}},9955:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSubjectProxyFromObject=t.isSubjectProxy=void 0;const r=n(4715);function i(e){if(!e)return!1;if("object"!==typeof e)return!1;const t=e;return!("object"!==typeof t[r._writeGraphs]||"object"!==typeof t[r._getUnderlyingDataset]||"object"!==typeof t[r._getUnderlyingNode]||"object"!==typeof t[r._proxyContext])}t.isSubjectProxy=i,t.getSubjectProxyFromObject=function(e){const t=e;if(!i(t))throw new Error(`${e} is not a Jsonld Dataset Proxy Subject`);return t}},4715:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._writeGraphs=t._proxyContext=t._getUnderlyingArrayTarget=t._getUnderlyingDataset=t._getNodeAtIndex=t._isSubjectOriented=t._getUnderlyingMatch=t._getUnderlyingNode=void 0,t._getUnderlyingNode=Symbol("_getUnderlyingNode"),t._getUnderlyingMatch=Symbol("_getUnderlyingMatch"),t._isSubjectOriented=Symbol("_isSubjectOriented"),t._getNodeAtIndex=Symbol("_getNodeAtIndex"),t._getUnderlyingDataset=Symbol("_getUnderlyingDataset"),t._getUnderlyingArrayTarget=Symbol("_getUnderlyingArrayTarget"),t._proxyContext=Symbol("_proxyContext"),t._writeGraphs=Symbol("_writeGraphs")},549:(e,t)=>{"use strict";function n(e){if(null==e)return"null";switch(e.termType){case"NamedNode":return`namedNode(${e.value})`;case"BlankNode":return`blankNode(${e.value})`;case"Literal":return`literal(${e.value},${e.datatype.value})`;case"DefaultGraph":return"defaultGraph()"}}Object.defineProperty(t,"__esModule",{value:!0}),t.NodeSet=t.nodeToString=void 0,t.nodeToString=n;t.NodeSet=class{constructor(){this.set=new Set,this.map={}}add(e){const t=n(e);this.set.add(t),this.map[t]=e}has(e){return this.set.has(n(e))}delete(e){const t=n(e);return delete this.map[t],this.set.delete(n(e))}toArray(){return Array.from(this.set).map((e=>this.map[e]))}}},8004:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1019:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addObjectToDataset=t.addRawObjectToDatasetRecursive=t.addRawValueToDatasetRecursive=void 0;const r=n(7478),i=n(5138),o=n(9955),s=n(549),a=n(7400);function u(e,t,n,s,u,c){const{dataset:d,contextUtil:h}=c,f=(0,r.namedNode)(h.keyToIri(t)),p=(0,i.getNodeFromRawValue)(t,n,c);if(void 0==p)d.deleteMatches(e,f);else if("Literal"===p.termType){let n=p;if(h.isLangString(t)){const e=(0,a.getLanguageKeyForWriteOperation)(c.languageOrdering);if(!e)return;n=(0,r.literal)(p.value,(0,a.languageKeyToLiteralLanguage)(e))}c.writeGraphs.forEach((t=>{c.dataset.add((0,r.quad)(e,f,n,t))}))}else if(c.writeGraphs.forEach((t=>{d.add((0,r.quad)(e,f,p,t))})),!(0,o.isSubjectProxy)(n)){l("object"===typeof n?{...n,"@id":p}:{"@id":p},s,u,c)}}function l(e,t,n,s){if((0,o.isSubjectProxy)(e))return e;const{dataset:l}=s,c=(0,i.getNodeFromRawObject)(e,s.contextUtil);return t.has(c)||(t.add(c),Object.entries(e).forEach((e=>{let[i,o]=e;if("@id"===i)return;const d=(0,r.namedNode)(s.contextUtil.keyToIri(i));if(n)if(s.contextUtil.isLangString(i)){const e=(0,a.getLanguageKeyForWriteOperation)(s.languageOrdering);e&&(0,a.languageDeleteMatch)(l,c,d,e)}else l.deleteMatches(c,d);Array.isArray(o)?o.forEach((e=>{u(c,i,e,t,!0,s)})):u(c,i,o,t,!0,s)}))),s.createSubjectProxy(c)}t.addRawValueToDatasetRecursive=u,t.addRawObjectToDatasetRecursive=l,t.addObjectToDataset=function(e,t,n){return l(e,new s.NodeSet,t,n)}},2719:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInteractOptions=void 0;const r=n(9955),i=n(4715),o=n(1737);t.createInteractOptions=function(e,t){return{using(){const n=[];for(var r=arguments.length,s=new Array(r),a=0;a{const s=(0,o.getProxyFromObject)(r),a=s[i._proxyContext];s[i._proxyContext]=s[i._proxyContext].duplicate({[e]:t}),n.push((()=>{s[i._proxyContext]=a}))})),function(){n.forEach((e=>e()))}},usingCopy(){for(var n=arguments.length,o=new Array(n),s=0;s{const o=(0,r.getSubjectProxyFromObject)(n);return o[i._proxyContext].duplicate({[e]:t}).createSubjectProxy(o[i._getUnderlyingNode])}))}}}},5138:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNodeFromRawValue=t.getNodeFromRawObject=void 0;const r=n(7478),i=n(4715);function o(e,t){return e[i._getUnderlyingNode]?e[i._getUnderlyingNode]:e["@id"]?"string"===typeof e["@id"]?(0,r.namedNode)(t.keyToIri(e["@id"])):e["@id"]:(0,r.blankNode)()}t.getNodeFromRawObject=o,t.getNodeFromRawValue=function(e,t,n){if(void 0!=t){if("string"===typeof t||"boolean"===typeof t||"number"===typeof t){const i=n.contextUtil.getType(e);return"@id"===i?(0,r.namedNode)(t.toString()):(0,r.literal)(t.toString(),i)}return o(t,n.contextUtil)}}},1737:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getProxyFromObject=t.isProxy=void 0;const r=n(9631),i=n(9955);function o(e){return(0,i.isSubjectProxy)(e)||(0,r.isArrayProxy)(e)}t.isProxy=o,t.getProxyFromObject=function(e){if(!o(e))throw new Error(`${e} is not a Jsonld Dataset Proxy`);return e}},7020:(e,t)=>{"use strict";function n(e){switch(e.datatype.value){case"http://www.w3.org/2001/XMLSchema#string":case"http://www.w3.org/2001/XMLSchema#ENTITIES":case"http://www.w3.org/2001/XMLSchema#ENTITY":case"http://www.w3.org/2001/XMLSchema#ID":case"http://www.w3.org/2001/XMLSchema#IDREF":case"http://www.w3.org/2001/XMLSchema#IDREFS":case"http://www.w3.org/2001/XMLSchema#language":case"http://www.w3.org/2001/XMLSchema#Name":case"http://www.w3.org/2001/XMLSchema#NCName":case"http://www.w3.org/2001/XMLSchema#NMTOKEN":case"http://www.w3.org/2001/XMLSchema#NMTOKENS":case"http://www.w3.org/2001/XMLSchema#normalizedString":case"http://www.w3.org/2001/XMLSchema#QName":case"http://www.w3.org/2001/XMLSchema#token":case"http://www.w3.org/2001/XMLSchema#date":case"http://www.w3.org/2001/XMLSchema#dateTime":case"http://www.w3.org/2001/XMLSchema#duration":case"http://www.w3.org/2001/XMLSchema#gDay":case"http://www.w3.org/2001/XMLSchema#gMonth":case"http://www.w3.org/2001/XMLSchema#gMonthDay":case"http://www.w3.org/2001/XMLSchema#gYear":case"http://www.w3.org/2001/XMLSchema#gYearMonth":case"http://www.w3.org/2001/XMLSchema#time":case"http://www.w3.org/2001/XMLSchema#hexBinary":case"http://www.w3.org/2001/XMLSchema#anyURI":case"http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML":case"http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral":case"http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral":case"http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON":default:return e.value;case"http://www.w3.org/2001/XMLSchema#integer":case"http://www.w3.org/2001/XMLSchema#byte":case"http://www.w3.org/2001/XMLSchema#decimal":case"http://www.w3.org/2001/XMLSchema#int":case"http://www.w3.org/2001/XMLSchema#long":case"http://www.w3.org/2001/XMLSchema#negativeInteger":case"http://www.w3.org/2001/XMLSchema#nonNegativeInteger":case"http://www.w3.org/2001/XMLSchema#nonPositiveInteger":case"http://www.w3.org/2001/XMLSchema#positiveInteger":case"http://www.w3.org/2001/XMLSchema#short":case"http://www.w3.org/2001/XMLSchema#unsignedLong":case"http://www.w3.org/2001/XMLSchema#unsignedInt":case"http://www.w3.org/2001/XMLSchema#unsignedShort":case"http://www.w3.org/2001/XMLSchema#unsignedByte":return parseFloat(e.value);case"http://www.w3.org/2001/XMLSchema#boolean":return"true"===e.value}}Object.defineProperty(t,"__esModule",{value:!0}),t.nodeToJsonldRepresentation=t.literalToJsonldRepresentation=void 0,t.literalToJsonldRepresentation=n,t.nodeToJsonldRepresentation=function(e,t){if("Literal"===e.termType)return n(e);if("NamedNode"===e.termType||"BlankNode"===e.termType)return t.createSubjectProxy(e);throw new Error("Can only convert NamedNodes or Literals or BlankNodes")}},7311:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.write=void 0;const r=n(2719);t.write=function(){for(var e=arguments.length,t=new Array(e),n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LdoBuilder=void 0;const r=n(4393);class i{constructor(e,t){this.jsonldDatasetProxyBuilder=e,this.shapeType=t}fromSubject(e){return this.jsonldDatasetProxyBuilder.fromSubject((0,r.normalizeNodeName)(e))}matchSubject(e,t,n){return this.jsonldDatasetProxyBuilder.matchSubject(void 0!=e?(0,r.normalizeNodeName)(e):void 0,void 0!=t?(0,r.normalizeNodeName)(t):void 0,void 0!=n?(0,r.normalizeNodeName)(n):void 0)}matchObject(e,t,n){return this.jsonldDatasetProxyBuilder.matchObject(void 0!=e?(0,r.normalizeNodeName)(e):void 0,void 0!=t?(0,r.normalizeNodeName)(t):void 0,void 0!=n?(0,r.normalizeNodeName)(n):void 0)}fromJson(e){return this.jsonldDatasetProxyBuilder.fromJson(e)}write(){for(var e=arguments.length,t=new Array(e),n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LdoDatasetFactory=void 0;const r=n(4671),i=n(4158);class o extends r.SubscribableDatasetFactory{dataset(e){return new i.LdoDataset(this.datasetFactory,this.transactionDatasetFactory,this.datasetFactory.dataset(e))}}t.LdoDatasetFactory=o},8162:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LdoTransactionDataset=void 0;const i=n(4671),o=n(1324),s=r(n(4230));class a extends i.TransactionDataset{usingType(e){const t=(0,s.default)(this,e.context);return new o.LdoBuilder(t,e)}}t.LdoTransactionDataset=a},6826:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2787:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLdoDataset=t.createLdoDatasetFactory=void 0;const r=n(7310),i=n(137),o=n(4671);function s(){const e={dataset:e=>(0,r.createDataset)(e)};return new i.LdoDatasetFactory(e,(0,o.createTransactionDatasetFactory)())}t.createLdoDatasetFactory=s,t.createLdoDataset=function(e){return s().dataset(e)}},7991:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(9837),t),i(n(6826),t),i(n(5592),t),i(n(4158),t),i(n(8162),t),i(n(1324),t),i(n(2787),t)},5592:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toNTriples=t.toJsonLd=t.toTurtle=t.serialize=t.toSparqlUpdate=t.getDataset=t.transactionChanges=t.commitTransaction=t.startTransaction=t.write=t.setLanguagePreferences=t.languagesOf=t.graphOf=void 0;const r=n(4230),i=n(7639),o=n(4393),s=n(4230);t.graphOf=s.graphOf,t.languagesOf=s.languagesOf,t.setLanguagePreferences=s.setLanguagePreferences,t.write=function(){for(var e=arguments.length,t=new Array(e),n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseRdf=void 0;const r=n(7310),i=n(2787);t.parseRdf=async function(e,t){const n=(0,i.createLdoDatasetFactory)();return"string"===typeof e?await(0,r.createDatasetFromSerializedInput)(n,e,t):"function"===typeof e.add?(0,i.createLdoDataset)(e):await(0,r.createDatasetFromSerializedInput)(n,JSON.stringify(e),{format:"application/json-ld"})}},4393:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTransactionalDatasetFromLdo=t.isTransactionalDataset=t.canDatasetStartTransaction=t.normalizeNodeNames=t.normalizeNodeName=void 0;const r=n(7478),i=n(4230);function o(e){return"string"===typeof e?(0,r.namedNode)(e):e}function s(e){return"function"===typeof e.commit}t.normalizeNodeName=o,t.normalizeNodeNames=function(e){return e.map((e=>o(e)))},t.canDatasetStartTransaction=function(e){return"function"===typeof e.startTransaction},t.isTransactionalDataset=s,t.getTransactionalDatasetFromLdo=function(e){const t=(0,i.getProxyFromObject)(e),n=t[i._getUnderlyingDataset];if(!s(n)||!t[i._proxyContext].state.parentDataset)throw new Error("Object is not currently in a transaction");return[n,t]}},506:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.changesToSparqlUpdate=void 0;const r=n(7478),i=n(1745);t.changesToSparqlUpdate=async function(e){let t="";if(e.removed){const n=e.removed.map((e=>(0,r.quad)(e.subject,e.predicate,e.object)));t+=`DELETE DATA { ${await(0,i.datasetToString)(n,{format:"N-Triples"})} }`}if(e.added&&e.removed&&(t+="; "),e.added){const n=e.added.map((e=>(0,r.quad)(e.subject,e.predicate,e.object)));t+=`INSERT DATA { ${await(0,i.datasetToString)(n,{format:"N-Triples"})} }`}return t.replaceAll("\n"," ")}},1745:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.datasetToJsonLd=t.datasetToString=void 0;const r=n(6218);t.datasetToString=function(e,t){const n=new r.Writer(t),i=[];for(const r of e)i.push(r);return n.quadsToString(i)},t.datasetToJsonLd=async function(e,t){throw new Error("JSONLD serialization is not omplemented")}},7639:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(1016),t),i(n(506),t),i(n(1745),t),i(n(9105),t)},1016:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringToQuadMatch=t.stringToQuad=t.stringToNode=t.stringToGraphNode=t.stringToObjectNode=t.stringToPredicateNode=t.stringToSubjectNode=t.quadMatchToString=t.quadToString=t.nodeToString=t.grpahNodeToString=t.objectNodeToString=t.predicateNodeToString=t.subjectNodeToString=t.AnyTermTypes=t.GraphTermTypes=t.ObjectTermTypes=t.PredicateTermTypes=t.SubjectTermTypes=void 0;const r=n(7963);function i(e){return u(e)}function o(e){return u(e)}function s(e){return u(e)}function a(e){return u(e)}function u(e){return(0,r.termToString)(e)}function l(e){return f(e,t.SubjectTermTypes)}function c(e){return f(e,t.PredicateTermTypes)}function d(e){return f(e,t.ObjectTermTypes)}function h(e){return f(e,t.GraphTermTypes)}function f(e,t){const n=(0,r.stringToTerm)(e);if(t&&!t.has(n.termType))throw new Error(`Expected term to be one of term type: [${Array.from(t).reduce(((e,t)=>`${e}${t}, `),"")}], but got ${n.termType}.`);return n}t.SubjectTermTypes=new Set(["NamedNode","BlankNode"]),t.PredicateTermTypes=new Set(["NamedNode"]),t.ObjectTermTypes=new Set(["NamedNode","BlankNode","Literal"]),t.GraphTermTypes=new Set(["NamedNode","BlankNode","DefaultGraph"]),t.AnyTermTypes=new Set(["NamedNode","BlankNode","DefaultGraph","Literal"]),t.subjectNodeToString=i,t.predicateNodeToString=o,t.objectNodeToString=s,t.grpahNodeToString=a,t.nodeToString=u,t.quadToString=function(e){return JSON.stringify((0,r.quadToStringQuad)(e))},t.quadMatchToString=function(e){return JSON.stringify({subject:e[0]?i(e[0]):void 0,predicate:e[1]?o(e[1]):void 0,object:e[2]?s(e[2]):void 0,graph:e[3]?a(e[3]):void 0})},t.stringToSubjectNode=l,t.stringToPredicateNode=c,t.stringToObjectNode=d,t.stringToGraphNode=h,t.stringToNode=f,t.stringToQuad=function(e){try{return(0,r.stringQuadToQuad)(JSON.parse(e))}catch(t){throw new Error("Invalid Quad String")}},t.stringToQuadMatch=function(e){try{const t=JSON.parse(e);return[void 0!=t.subject?l(t.subject):void 0,void 0!=t.predicate?c(t.predicate):void 0,void 0!=t.object?d(t.object):void 0,void 0!=t.graph?h(t.graph):void 0]}catch(t){throw new Error("Invalid Quad Match String")}}},9105:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializedToQuads=void 0;const r=n(6218);t.serializedToQuads=async function(e,t){if(t&&"application/json-ld"===t.format)throw new Error("Not Implemented");return new r.Parser(t).parse(e)}},9713:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SubscribableDataset=void 0;const r=n(7465),i=n(7639),o=n(7310);class s extends o.ExtendedDataset{constructor(e,t,n){super(n||e.dataset(),e),this.listenerHashMap=new Map,this.transactionDatasetFactory=t,this.eventEmitter=new r.EventEmitter,this.datasetFactory=e}superAddAll(e){for(const t of e)super.add(t);return this}addAll(e){return this.superAddAll(e),this.triggerSubscriptionForQuads({added:this.datasetFactory.dataset(e)}),this}bulk(e){return e.added&&this.superAddAll(e.added),e.removed&&e.removed.forEach((e=>{super.delete(e)})),this.triggerSubscriptionForQuads(e),this}deleteMatches(e,t,n,r){const i=super.match(e,t,n,r);for(const o of i)super.delete(o);return this.triggerSubscriptionForQuads({removed:i}),this}add(e){return super.add(e),this.triggerSubscriptionForQuads({added:this.datasetFactory.dataset([e])}),this}delete(e){return super.delete(e),this.triggerSubscriptionForQuads({removed:this.datasetFactory.dataset([e])}),this}triggerSubscriptionForQuads(e){const t={},n=n=>{e[n]?.forEach((e=>{const r=e;[[null,null,null,null],[r.subject,null,null,null],[r.subject,r.predicate,null,null],[r.subject,null,r.object,null],[null,r.predicate,null,null],[null,r.predicate,r.object,null],[null,null,r.object,null],[r.subject,r.predicate,r.object,null],[null,null,null,r.graph],[r.subject,null,null,r.graph],[r.subject,r.predicate,null,r.graph],[r.subject,null,r.object,r.graph],[null,r.predicate,null,r.graph],[null,r.predicate,r.object,r.graph],[null,null,r.object,r.graph],[r.subject,r.predicate,r.object,r.graph]].forEach((r=>{const o=(0,i.quadMatchToString)(r);this.eventEmitter.listenerCount(o)>0&&(t[o]||(t[o]={}),t[o][n]||(t[o][n]=this.datasetFactory.dataset()),t[o][n]?.add(e))}))}))};n("added"),n("removed"),Object.entries(t).forEach((e=>{let[t,n]=e;this.eventEmitter.emit(t,n)}))}addListener(e,t){return this.on(e,t)}emit(e,t){return this.eventEmitter.emit((0,i.quadMatchToString)(e),t)}eventNames(){return this.eventEmitter.eventNames().map((e=>(0,i.stringToQuadMatch)(e)))}getMaxListeners(){return this.eventEmitter.getMaxListeners()}listenerCount(e){return this.eventEmitter.listenerCount((0,i.quadMatchToString)(e))}listeners(e){return this.eventEmitter.listeners((0,i.quadMatchToString)(e))}off(e,t){this.removeListener(e,t)}on(e,t){const n=(0,i.quadMatchToString)(e);return this.listenerHashMap.has(t)||this.listenerHashMap.set(t,new Set),this.listenerHashMap.get(t)?.add(n),this.eventEmitter.on(n,t),this}once(e,t){return this.eventEmitter.once((0,i.quadMatchToString)(e),t),this}prependListener(e,t){return this.eventEmitter.prependListener((0,i.quadMatchToString)(e),t),this}prependOnceListener(e,t){return this.eventEmitter.prependOnceListener((0,i.quadMatchToString)(e),t),this}removeAllListeners(e){return this.eventEmitter.removeAllListeners((0,i.quadMatchToString)(e)),this}removeListener(e,t){return this.eventEmitter.removeListener((0,i.quadMatchToString)(e),t),this}removeListenerFromAllEvents(e){const t=this.listenerHashMap.get(e);return t&&t.forEach((t=>{this.eventEmitter.off(t,e)})),this}setMaxListeners(e){return this.eventEmitter.setMaxListeners(e),this}rawListeners(e){return this.eventEmitter.rawListeners((0,i.quadMatchToString)(e))}startTransaction(){return this.transactionDatasetFactory.transactionDataset(this)}}t.SubscribableDataset=s},574:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SubscribableDatasetFactory=void 0;const r=n(9713);t.SubscribableDatasetFactory=class{constructor(e,t){this.datasetFactory=e,this.transactionDatasetFactory=t}dataset(e){return new r.SubscribableDataset(this.datasetFactory,this.transactionDatasetFactory,e?this.datasetFactory.dataset(e):void 0)}}},8696:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionDataset=void 0;const r=n(1309),i=n(9713),o=n(5874);class s extends i.SubscribableDataset{constructor(e,t,n){super(t,n,t.dataset()),this.parentDataset=e,this.datasetChanges={}}addAll(e){return this.updateDatasetChanges({added:e}),this}bulk(e){return this.updateDatasetChanges(e),this}deleteMatches(e,t,n,r){this.checkIfTransactionCommitted();const i=this.match(e,t,n,r);for(const o of i)this.delete(o);return this}match(e,t,n,r){let i=this.parentDataset.match(e,t,n,r);return this.datasetChanges.removed&&(i=i.difference(this.datasetChanges.removed)),this.datasetChanges.added&&(i=i.union(this.datasetChanges.added.match(e,t,n,r))),i}get size(){return this.parentDataset.size+(this.datasetChanges.added?.difference(this.parentDataset).size||0)-(this.datasetChanges.removed?.intersection(this.parentDataset).size||0)}add(e){return this.updateDatasetChanges({added:[e]}),this}delete(e){return this.updateDatasetChanges({removed:[e]}),this}has(e){return!this.datasetChanges.removed?.has(e)&&(this.datasetChanges.added?.has(e)||this.parentDataset.has(e))}[Symbol.iterator](){const e=(this.datasetChanges.added||[])[Symbol.iterator]();let t=e.next();const n=this.parentDataset[Symbol.iterator]();let r=n.next();return{next:()=>{if(!t||!t.done){const n=t;return t=e.next(),n}for(;!r.done;){const e=r;if(r=n.next(),(!this.datasetChanges.added||!this.datasetChanges.added.has(e.value))&&(!this.datasetChanges.removed||!this.datasetChanges.removed.has(e.value)))return e}return{value:void 0,done:!0}}}}checkIfTransactionCommitted(){if(this.committedDatasetChanges)throw new Error("Transaction has already committed")}updateDatasetChanges(e){this.checkIfTransactionCommitted(),(0,r.mergeDatasetChanges)(this.datasetChanges,{added:e.added?this.datasetFactory.dataset(e.added):void 0,removed:e.removed?this.datasetFactory.dataset(e.removed):void 0})}updateParentDataset(e){return(0,o.updateDatasetInBulk)(this.parentDataset,e)}commit(){this.checkIfTransactionCommitted(),this.committedDatasetChanges={added:this.datasetChanges.added?.difference(this.parentDataset),removed:this.datasetChanges.removed?.intersection(this.parentDataset)},this.updateParentDataset(this.committedDatasetChanges)}rollback(){if(!this.committedDatasetChanges)throw new Error("Cannot rollback. Transaction has not yet been committed");this.updateParentDataset({added:this.committedDatasetChanges.removed,removed:this.committedDatasetChanges.added}),this.committedDatasetChanges=void 0}getChanges(){return this.datasetChanges}}t.TransactionDataset=s},684:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionDatasetFactory=void 0;const r=n(8696);t.TransactionDatasetFactory=class{constructor(e,t){this.datasetFactory=e,this.transactionDatasetFactory=t||this}transactionDataset(e){return new r.TransactionDataset(e,this.datasetFactory,this.transactionDatasetFactory)}}},3136:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSubscribableDataset=t.createSubscribableDatasetFactory=t.createTransactionDatasetFactory=void 0;const r=n(7310),i=n(574),o=n(684),s={dataset:e=>(0,r.createDataset)(e)};function a(){return new o.TransactionDatasetFactory(s)}function u(){return new i.SubscribableDatasetFactory(s,a())}t.createTransactionDatasetFactory=a,t.createSubscribableDatasetFactory=u,t.createSubscribableDataset=function(e){return u().dataset(e)}},3223:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createWrapperSubscribableDatasetFromSerializedInput=void 0;const r=n(7310),i=n(3136);t.createWrapperSubscribableDatasetFromSerializedInput=async function(e,t){const n=(0,i.createSubscribableDatasetFactory)();return(0,r.createDatasetFromSerializedInput)(n,e,t)}},4671:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.serializedToSubscribableDataset=void 0,i(n(3136),t);var o=n(3223);Object.defineProperty(t,"serializedToSubscribableDataset",{enumerable:!0,get:function(){return o.createWrapperSubscribableDatasetFromSerializedInput}}),i(n(8696),t),i(n(684),t),i(n(9713),t),i(n(574),t),i(n(2956),t),i(n(1309),t),i(n(5874),t)},1309:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeDatasetChanges=void 0,t.mergeDatasetChanges=function(e,t){if(t.added){e.added?e.added.addAll(t.added):e.added=t.added;const n=e.removed?.intersection(t.added);n&&n.size>0&&(e.removed=e.removed?.difference(n))}if(t.removed){e.removed?e.removed.addAll(t.removed):e.removed=t.removed;const n=e.added?.intersection(t.removed);n&&n.size>0&&(e.added=e.added?.difference(n))}e.added&&0===e.added.size&&(e.added=void 0),e.removed&&0===e.removed.size&&(e.removed=void 0)}},2956:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5874:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateDatasetInBulk=void 0,t.updateDatasetInBulk=function(e,t){e.bulk?e.bulk(t):(t.added&&e.addAll(t.added),t.removed&&t.removed.forEach((t=>{e.delete(t)})))}},7478:(e,t,n)=>{const r=n(1908);e.exports=r},594:e=>{class t{constructor(e){this.value=e||"b"+ ++t.nextId}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}t.prototype.termType="BlankNode",t.nextId=0,e.exports=t},1908:(e,t,n)=>{const r=n(594),i=n(721),o=n(7967),s=n(8558),a=n(1020),u=n(5783),l=n(6646);const c={namedNode:function(e){return new a(e)},blankNode:function(e){return new r(e)},literal:function(e,t){return"string"===typeof t?-1===t.indexOf(":")?new s(e,t):new s(e,null,c.namedNode(t)):new s(e,null,t)},variable:function(e){return new l(e)},defaultGraph:function(){return c.defaultGraphInstance},triple:function(e,t,n){return c.quad(e,t,n)},quad:function(e,t,n,r){return new u(e,t,n,r||c.defaultGraphInstance)},fromTerm:function(e){return o.call(c,e)},fromQuad:function(e){return o.call(c,e)},defaultGraphInstance:new i};e.exports=c},721:e=>{class t{equals(e){return!!e&&e.termType===this.termType}}t.prototype.termType="DefaultGraph",t.prototype.value="",e.exports=t},8558:(e,t,n)=>{const r=n(1020);class i{constructor(e,t,n){this.value=e,this.datatype=i.stringDatatype,this.language="",t?(this.language=t,this.datatype=i.langStringDatatype):n&&(this.datatype=n)}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value&&e.language===this.language&&e.datatype.equals(this.datatype)}}i.prototype.termType="Literal",i.langStringDatatype=new r("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),i.stringDatatype=new r("http://www.w3.org/2001/XMLSchema#string"),e.exports=i},1020:e=>{class t{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}t.prototype.termType="NamedNode",e.exports=t},5783:(e,t,n)=>{const r=n(721);class i{constructor(e,t,n,i){this.subject=e,this.predicate=t,this.object=n,this.graph=i||new r}equals(e){return!!e&&("Quad"===e.termType||!e.termType)&&e.subject.equals(this.subject)&&e.predicate.equals(this.predicate)&&e.object.equals(this.object)&&e.graph.equals(this.graph)}}i.prototype.termType="Quad",i.prototype.value="",e.exports=i},6646:e=>{class t{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}t.prototype.termType="Variable",e.exports=t},7967:e=>{e.exports=function(e){if(!e)return null;if("BlankNode"===e.termType)return this.blankNode(e.value);if("DefaultGraph"===e.termType)return this.defaultGraph();if("Literal"===e.termType)return this.literal(e.value,e.language||this.namedNode(e.datatype.value));if("NamedNode"===e.termType)return this.namedNode(e.value);if("Quad"===e.termType){const t=this.fromTerm(e.subject),n=this.fromTerm(e.predicate),r=this.fromTerm(e.object),i=this.fromTerm(e.graph);return this.quad(t,n,r,i)}if("Variable"===e.termType)return this.variable(e.value);throw new Error(`unknown termType ${e.termType}`)}},2711:e=>{function t(e){return"string"===typeof e||e instanceof String}function n(e){if("string"===typeof e)return e;if(!e)return"";if("undefined"!==typeof e.id&&"Quad"!==e.termType)return e.id;let t,r,o,s;switch(e.termType){case"NamedNode":return e.value;case"BlankNode":return`_:${e.value}`;case"Variable":return`?${e.value}`;case"DefaultGraph":return"";case"Literal":return e.language?`"${e.value}"@${e.language}`:`"${e.value}"${e.datatype&&"http://www.w3.org/2001/XMLSchema#string"!==e.datatype.value?`^^${e.datatype.value}`:""}`;case"Quad":return t=i(n(e.subject)),r=i(n(e.predicate)),o=i(n(e.object)),s="DefaultGraph"===e.graph.termType?"":` ${n(e.graph)}`,`<<${t} ${r} ${o}${s}>>`;default:throw new Error(`Unexpected termType: ${e.termType}`)}}const r=/^"(.*".*)(?="[^"]*$)/;function i(e){return e.replace(r,((e,t)=>`"${t.replace(/"/g,'""')}`))}class o{constructor(e){if(this._size=0,this._graphs=Object.create(null),this._id=0,this._ids=Object.create(null),this._ids["><"]=0,this._entities=Object.create(null),this._quads=new Map,e)for(const t of e)this.add(t)}get size(){let e=this._size;if(null!==e)return e;e=0;const t=this._graphs;let n,r;for(const i in t)for(const o in n=t[i].subjects)for(const t in r=n[o])e+=Object.keys(r[t]).length;return this._size=e,this._size}add(e){let t=n(e.subject),r=n(e.predicate),i=n(e.object);const o=n(e.graph);let s=this._graphs[o];s||(s=this._graphs[o]={subjects:{},predicates:{},objects:{}},Object.freeze(s));const a=this._ids,u=this._entities;return t=a[t]||(a[u[++this._id]=t]=this._id),r=a[r]||(a[u[++this._id]=r]=this._id),i=a[i]||(a[u[++this._id]=i]=this._id),this._addToIndex(s.subjects,t,r,i),this._addToIndex(s.predicates,r,i,t),this._addToIndex(s.objects,i,t,r),this._setQuad(t,r,i,o,e),this._size=null,this}delete(e){let t=n(e.subject),r=n(e.predicate),i=n(e.object);const o=n(e.graph),s=this._ids,a=this._graphs;let u,l,c;if(!(t=s[t])||!(r=s[r])||!(i=s[i])||!(u=a[o])||!(l=u.subjects[t])||!(c=l[r])||!(i in c))return this;for(t in this._removeFromIndex(u.subjects,t,r,i),this._removeFromIndex(u.predicates,r,i,t),this._removeFromIndex(u.objects,i,t,r),null!==this._size&&this._size--,this._deleteQuad(t,r,i,o),u.subjects)return this;return delete a[o],this}has(e){const r=n(e.subject),i=n(e.predicate),o=n(e.object),s=n(e.graph),a=this._graphs[s];if(!a)return!1;const u=this._ids;let l,c,d;return!(t(r)&&!(l=u[r])||t(i)&&!(c=u[i])||t(o)&&!(d=u[o]))&&1===this._countInIndex(a.objects,d,l,c)}match(e,t,n,r){return this._createDataset(this._match(e,t,n,r))}[Symbol.iterator](){return this._match()[Symbol.iterator]()}_addToIndex(e,t,n,r){const i=e[t]||(e[t]={}),o=i[n]||(i[n]={}),s=r in o;return s||(o[r]=null),!s}_removeFromIndex(e,t,n,r){const i=e[t],o=i[n];delete o[r];for(const s in o)return;delete i[n];for(const s in i)return;delete e[t]}_findInIndex(e,t,n,r,i,o,s,a,u,l){let c,d,h;t&&((c=e,e={})[t]=c[t]);for(const f in e)if(d=e[f],d){n&&((c=d,d={})[n]=c[n]);for(const e in d)if(h=d[e],h){const t=r?r in h?[r]:[]:Object.keys(h);for(let n=0;n{const r=n(7478),i=n(2711);e.exports=Object.assign({dataset:function(e){return new i(e)}},r)},5935:e=>{"use strict";const{AbortController:t,AbortSignal:n}="undefined"!==typeof self?self:"undefined"!==typeof window?window:void 0;e.exports=t,e.exports.AbortSignal=n,e.exports.default=t},9256:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2080),i=n(4105),o=n(9716),s=n(2262),a=n(5),u=n(8317),l="errorMessage",c=new r.Name("emUsed"),d={required:"missingProperty",dependencies:"property",dependentRequired:"property"},h=/\$\{[^}]+\}/,f=/\$\{([^}]+)\}/g,p=/^""\s*\+\s*|\s*\+\s*""$/g;function g(e){return{keyword:l,schemaType:["string","object"],post:!0,code(t){const{gen:n,data:g,schema:m,schemaValue:y,it:v}=t;if(!1===v.createErrors)return;const w=m,_=i.strConcat(u.default.instancePath,v.errorPath);function b(e,t){return i.and(r._`${e}.keyword !== ${l}`,r._`!${e}.${c}`,r._`${e}.instancePath === ${_}`,r._`${e}.keyword in ${t}`,r._`${e}.schemaPath.indexOf(${v.errSchemaPath}) === 0`,r._`/^\\/[^\\/]*$/.test(${e}.schemaPath.slice(${v.errSchemaPath.length}))`)}function S(e,t){const r=[];for(const n in e){const e=t[n];h.test(e)&&r.push([n,E(e)])}return n.object(...r)}function x(e){return h.test(e)?new o._Code(o.safeStringify(e).replace(f,((e,t)=>`" + JSON.stringify(${s.getData(t,v)}) + "`)).replace(p,"")):r.stringify(e)}function E(e){return r._`function(){return ${x(e)}}`}n.if(r._`${u.default.errors} > 0`,(()=>{if("object"==typeof w){const[o,s]=function(e){let t,n;for(const r in e){if("properties"===r||"items"===r)continue;const i=e[r];if("object"==typeof i){t||(t={});const e=t[r]={};for(const t in i)e[t]=[]}else n||(n={}),n[r]=[]}return[t,n]}(w);s&&function(i){const o=n.const("emErrors",r.stringify(i)),s=n.const("templates",S(i,m));n.forOf("err",u.default.vErrors,(e=>n.if(b(e,o),(()=>n.code(r._`${o}[${e}.keyword].push(${e})`).assign(r._`${e}.${c}`,!0)))));const{singleError:l}=e;if(l){const e=n.let("message",r._`""`),i=n.let("paramsErrors",r._`[]`);d((t=>{n.if(e,(()=>n.code(r._`${e} += ${"string"==typeof l?l:";"}`))),n.code(r._`${e} += ${h(t)}`),n.assign(i,r._`${i}.concat(${o}[${t}])`)})),a.reportError(t,{message:e,params:r._`{errors: ${i}}`})}else d((e=>a.reportError(t,{message:h(e),params:r._`{errors: ${o}[${e}]}`})));function d(e){n.forIn("key",o,(t=>n.if(r._`${o}[${t}].length`,(()=>e(t)))))}function h(e){return r._`${e} in ${s} ? ${s}[${e}]() : ${y}[${e}]`}}(s),o&&function(e){const i=n.const("emErrors",r.stringify(e)),o=[];for(const t in e)o.push([t,S(e[t],m[t])]);const s=n.const("templates",n.object(...o)),l=n.scopeValue("obj",{ref:d,code:r.stringify(d)}),h=n.let("emPropParams"),f=n.let("emParamsErrors");n.forOf("err",u.default.vErrors,(e=>n.if(b(e,i),(()=>{n.assign(h,r._`${l}[${e}.keyword]`),n.assign(f,r._`${i}[${e}.keyword][${e}.params[${h}]]`),n.if(f,(()=>n.code(r._`${f}.push(${e})`).assign(r._`${e}.${c}`,!0)))})))),n.forIn("key",i,(e=>n.forIn("keyProp",r._`${i}[${e}]`,(o=>{n.assign(f,r._`${i}[${e}][${o}]`),n.if(r._`${f}.length`,(()=>{const i=n.const("tmpl",r._`${s}[${e}] && ${s}[${e}][${o}]`);a.reportError(t,{message:r._`${i} ? ${i}() : ${y}[${e}][${o}]`,params:r._`{errors: ${f}}`})}))}))))}(o),function(e){const{props:o,items:s}=e;if(!o&&!s)return;const d=r._`typeof ${g} == "object"`,h=r._`Array.isArray(${g})`,f=n.let("emErrors");let p,v;const w=n.let("templates");o&&s?(p=n.let("emChildKwd"),n.if(d),n.if(h,(()=>{b(s,m.items),n.assign(p,r.str`items`)}),(()=>{b(o,m.properties),n.assign(p,r.str`properties`)})),v=r._`[${p}]`):s?(n.if(h),b(s,m.items),v=r._`.items`):o&&(n.if(i.and(d,i.not(h))),b(o,m.properties),v=r._`.properties`);function b(e,t){n.assign(f,r.stringify(e)),n.assign(w,S(e,t))}n.forOf("err",u.default.vErrors,(e=>function(e,t,o){n.if(i.and(r._`${e}.keyword !== ${l}`,r._`!${e}.${c}`,r._`${e}.instancePath.indexOf(${_}) === 0`),(()=>{const i=n.scopeValue("pattern",{ref:/^\/([^/]*)(?:\/|$)/,code:r._`new RegExp("^\\\/([^/]*)(?:\\\/|$)")`}),s=n.const("emMatches",r._`${i}.exec(${e}.instancePath.slice(${_}.length))`),a=n.const("emChild",r._`${s} && ${s}[1].replace(/~1/g, "/").replace(/~0/g, "~")`);n.if(r._`${a} !== undefined && ${a} in ${t}`,(()=>o(a)))}))}(e,f,(t=>n.code(r._`${f}[${t}].push(${e})`).assign(r._`${e}.${c}`,!0))))),n.forIn("key",f,(e=>n.if(r._`${f}[${e}].length`,(()=>{a.reportError(t,{message:r._`${e} in ${w} ? ${w}[${e}]() : ${y}${v}[${e}]`,params:r._`{errors: ${f}[${e}]}`}),n.assign(r._`${u.default.vErrors}[${u.default.errors}-1].instancePath`,r._`${_} + "/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`)})))),n.endIf()}(function(e){let{properties:t,items:n}=e;const r={};if(t){r.props={};for(const e in t)r.props[e]=[]}if(n){r.items={};for(let e=0;en.if(function(e){return i.and(r._`${e}.keyword !== ${l}`,r._`!${e}.${c}`,i.or(r._`${e}.instancePath === ${_}`,i.and(r._`${e}.instancePath.indexOf(${_}) === 0`,r._`${e}.instancePath[${_}.length] === "/"`)),r._`${e}.schemaPath.indexOf(${v.errSchemaPath}) === 0`,r._`${e}.schemaPath[${v.errSchemaPath}.length] === "/"`)}(e),(()=>n.code(r._`${o}.push(${e})`).assign(r._`${e}.${c}`,!0))))),n.if(r._`${o}.length`,(()=>a.reportError(t,{message:x(e),params:r._`{errors: ${o}}`})))}(o),e.keepErrors||function(){const e=n.const("emErrs",r._`[]`);n.forOf("err",u.default.vErrors,(t=>n.if(r._`!${t}.${c}`,(()=>n.code(r._`${e}.push(${t})`))))),n.assign(u.default.vErrors,e).assign(u.default.errors,r._`${e}.length`)}()}))},metaSchema:{anyOf:[{type:"string"},{type:"object",properties:{properties:{$ref:"#/$defs/stringMap"},items:{$ref:"#/$defs/stringList"},required:{$ref:"#/$defs/stringOrMap"},dependencies:{$ref:"#/$defs/stringOrMap"}},additionalProperties:{type:"string"}}],$defs:{stringMap:{type:"object",additionalProperties:{type:"string"}},stringOrMap:{anyOf:[{type:"string"},{$ref:"#/$defs/stringMap"}]},stringList:{type:"array",items:{type:"string"}}}}}}const m=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e.opts.allErrors)throw new Error("ajv-errors: Ajv option allErrors must be true");if(e.opts.jsPropertySyntax)throw new Error("ajv-errors: ajv option jsPropertySyntax is not supported");return e.addKeyword(g(t))};t.default=m,e.exports=m,e.exports.default=m},2080:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const r=n(6422),i=n(1783),o=n(5184),s=n(98),a=["/properties"],u="http://json-schema.org/draft-07/schema";class l extends r.default{_addVocabularies(){super._addVocabularies(),i.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(s,a):s;this.addMetaSchema(e,u,!1),this.refs["http://json-schema.org/schema"]=u}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(u)?u:void 0)}}t.Ajv=l,e.exports=t=l,e.exports.Ajv=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var c=n(2262);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var d=n(4105);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var h=n(5522);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return h.default}});var f=n(1145);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return f.default}})},9716:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class n{}t._CodeOrName=n,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends n{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=r;class i extends n{constructor(e){super(),this._items="string"===typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof r&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function o(e){const t=[e[0]];let n=0;for(var r=arguments.length,o=new Array(r>1?r-1:0),s=1;s1?r-1:0),a=1;a{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const r=n(9716),i=n(8718);var o=n(9716);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return o.Name}});var s=n(8718);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),t.operators={GT:new r._Code(">"),GTE:new r._Code(">="),LT:new r._Code("<"),LTE:new r._Code("<="),EQ:new r._Code("==="),NEQ:new r._Code("!=="),NOT:new r._Code("!"),OR:new r._Code("||"),AND:new r._Code("&&"),ADD:new r._Code("+")};class a{optimizeNodes(){return this}optimizeNames(e,t){return this}}class u extends a{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render(e){let{es5:t,_n:n}=e;const r=t?i.varKinds.var:this.varKind,o=void 0===this.rhs?"":` = ${this.rhs}`;return`${r} ${this.name}${o};`+n}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=I(this.rhs,e,t)),this}get names(){return this.rhs instanceof r._CodeOrName?this.rhs.names:{}}}class l extends a{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render(e){let{_n:t}=e;return`${this.lhs} = ${this.rhs};`+t}optimizeNames(e,t){if(!(this.lhs instanceof r.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=I(this.rhs,e,t),this}get names(){return O(this.lhs instanceof r.Name?{}:{...this.lhs.names},this.rhs)}}class c extends l{constructor(e,t,n,r){super(e,n,r),this.op=t}render(e){let{_n:t}=e;return`${this.lhs} ${this.op}= ${this.rhs};`+t}}class d extends a{constructor(e){super(),this.label=e,this.names={}}render(e){let{_n:t}=e;return`${this.label}:`+t}}class h extends a{constructor(e){super(),this.label=e,this.names={}}render(e){let{_n:t}=e;return`break${this.label?` ${this.label}`:""};`+t}}class f extends a{constructor(e){super(),this.error=e}render(e){let{_n:t}=e;return`throw ${this.error};`+t}get names(){return this.error.names}}class p extends a{constructor(e){super(),this.code=e}render(e){let{_n:t}=e;return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=I(this.code,e,t),this}get names(){return this.code instanceof r._CodeOrName?this.code.names:{}}}class g extends a{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];super(),this.nodes=e}render(e){return this.nodes.reduce(((t,n)=>t+n.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:n}=this;let r=n.length;for(;r--;){const i=n[r];i.optimizeNames(e,t)||(j(e,i.names),n.splice(r,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>A(e,t.names)),{})}}class m extends g{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class y extends g{}class v extends m{}v.kind="else";class w extends m{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new v(e):e}return t?!1===e?t instanceof w?t:t.nodes:this.nodes.length?this:new w(L(e),t instanceof w?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var n;if(this.else=null===(n=this.else)||void 0===n?void 0:n.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=I(this.condition,e,t),this}get names(){const e=super.names;return O(e,this.condition),this.else&&A(e,this.else.names),e}}w.kind="if";class _ extends m{}_.kind="for";class b extends _{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=I(this.iteration,e,t),this}get names(){return A(super.names,this.iteration.names)}}class S extends _{constructor(e,t,n,r){super(),this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){const t=e.es5?i.varKinds.var:this.varKind,{name:n,from:r,to:o}=this;return`for(${t} ${n}=${r}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){const e=O(super.names,this.from);return O(e,this.to)}}class x extends _{constructor(e,t,n,r){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=I(this.iterable,e,t),this}get names(){return A(super.names,this.iterable.names)}}class E extends m{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}E.kind="func";class k extends g{render(e){return"return "+super.render(e)}}k.kind="return";class C extends m{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var n,r;return super.optimizeNames(e,t),null===(n=this.catch)||void 0===n||n.optimizeNames(e,t),null===(r=this.finally)||void 0===r||r.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&A(e,this.catch.names),this.finally&&A(e,this.finally.names),e}}class P extends m{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}P.kind="catch";class T extends m{render(e){return"finally"+super.render(e)}}T.kind="finally";function A(e,t){for(const n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function O(e,t){return t instanceof r._CodeOrName?A(e,t.names):e}function I(e,t,n){return e instanceof r.Name?i(e):function(e){return e instanceof r._Code&&e._items.some((e=>e instanceof r.Name&&1===t[e.str]&&void 0!==n[e.str]))}(e)?new r._Code(e._items.reduce(((e,t)=>(t instanceof r.Name&&(t=i(t)),t instanceof r._Code?e.push(...t._items):e.push(t),e)),[])):e;function i(e){const r=n[e.str];return void 0===r||1!==t[e.str]?e:(delete t[e.str],r)}}function j(e,t){for(const n in t)e[n]=(e[n]||0)-(t[n]||0)}function L(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:r._`!${N(e)}`}t.CodeGen=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new i.Scope({parent:e}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,r){const i=this._scope.toName(t);return void 0!==n&&r&&(this._constants[i.str]=n),this._leafNode(new u(e,i,n)),i}const(e,t,n){return this._def(i.varKinds.const,e,t,n)}let(e,t,n){return this._def(i.varKinds.let,e,t,n)}var(e,t,n){return this._def(i.varKinds.var,e,t,n)}assign(e,t,n){return this._leafNode(new l(e,t,n))}add(e,n){return this._leafNode(new c(e,t.operators.ADD,n))}code(e){return"function"==typeof e?e():e!==r.nil&&this._leafNode(new p(e)),this}object(){const e=["{"];for(var t=arguments.length,n=new Array(t),i=0;i1&&e.push(","),e.push(o),(o!==s||this.opts.es5)&&(e.push(":"),(0,r.addCodeArg)(e,s));return e.push("}"),new r._Code(e)}if(e,t,n){if(this._blockNode(new w(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new w(e))}else(){return this._elseNode(new v)}endIf(){return this._endBlockNode(w,v)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new b(e),t)}forRange(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.opts.es5?i.varKinds.var:i.varKinds.let;const s=this._scope.toName(e);return this._for(new S(o,s,t,n),(()=>r(s)))}forOf(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:i.varKinds.const;const s=this._scope.toName(e);if(this.opts.es5){const e=t instanceof r.Name?t:this.var("_arr",t);return this.forRange("_i",0,r._`${e}.length`,(t=>{this.var(s,r._`${e}[${t}]`),n(s)}))}return this._for(new x("of",o,s,t),(()=>n(s)))}forIn(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.opts.es5?i.varKinds.var:i.varKinds.const;if(this.opts.ownProperties)return this.forOf(e,r._`Object.keys(${t})`,n);const s=this._scope.toName(e);return this._for(new x("in",o,s,t),(()=>n(s)))}endFor(){return this._endBlockNode(_)}label(e){return this._leafNode(new d(e))}break(e){return this._leafNode(new h(e))}return(e){const t=new k;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(k)}try(e,t,n){if(!t&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');const r=new C;if(this._blockNode(r),this.code(e),t){const e=this.name("e");this._currNode=r.catch=new P(e),t(e)}return n&&(this._currNode=r.finally=new T,this.code(n)),this._endBlockNode(P,T)}throw(e){return this._leafNode(new f(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const n=this._nodes.length-t;if(n<0||void 0!==e&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.nil,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;return this._blockNode(new E(e,t,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(E)}optimize(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof w))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},t.not=L;const R=M(t.operators.AND);t.and=function(){for(var e=arguments.length,t=new Array(e),n=0;nt===r.nil?n:n===r.nil?t:r._`${N(t)} ${e} ${N(n)}`}function N(e){return e instanceof r.Name?e:r._`(${e})`}t.or=function(){for(var e=arguments.length,t=new Array(e),n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const r=n(9716);class i extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var o;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(o||(t.UsedValueState=o={})),t.varKinds={const:new r.Name("const"),let:new r.Name("let"),var:new r.Name("var")};class s{constructor(){let{prefixes:e,parent:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof r.Name?e:this.name(e)}name(e){return new r.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,n;if((null===(n=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===n?void 0:n.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=s;class a extends r.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,t){let{property:n,itemIndex:i}=t;this.value=e,this.scopePath=r._`.${new r.Name(n)}[${i}]`}}t.ValueScopeName=a;const u=r._`\n`;t.ValueScope=class extends s{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?u:r.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){var n;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const r=this.toName(e),{prefix:i}=r,o=null!==(n=t.key)&&void 0!==n?n:t.ref;let s=this._values[i];if(s){const e=s.get(o);if(e)return e}else s=this._values[i]=new Map;s.set(o,r);const a=this._scope[i]||(this._scope[i]=[]),u=a.length;return a[u]=t.ref,r.setValue(t,{property:i,itemIndex:u}),r}getValue(e,t){const n=this._values[e];if(n)return n.get(t)}scopeRefs(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._values;return this._reduceValues(t,(t=>{if(void 0===t.scopePath)throw new Error(`CodeGen: name "${t}" has no value`);return r._`${e}${t.scopePath}`}))}scopeCode(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._values,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,n)}_reduceValues(e,n){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0,u=r.nil;for(const l in e){const c=e[l];if(!c)continue;const d=s[l]=s[l]||new Map;c.forEach((e=>{if(d.has(e))return;d.set(e,o.Started);let s=n(e);if(s){const n=this.opts.es5?t.varKinds.var:t.varKinds.const;u=r._`${u}${n} ${e} = ${s};${this.opts._n}`}else{if(!(s=null===a||void 0===a?void 0:a(e)))throw new i(e);u=r._`${u}${s}${this.opts._n}`}d.set(e,o.Completed)}))}return u}}},5:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const r=n(4105),i=n(4648),o=n(8317);function s(e,t){const n=e.const("err",t);e.if(r._`${o.default.vErrors} === null`,(()=>e.assign(o.default.vErrors,r._`[${n}]`)),r._`${o.default.vErrors}.push(${n})`),e.code(r._`${o.default.errors}++`)}function a(e,t){const{gen:n,validateName:i,schemaEnv:o}=e;o.$async?n.throw(r._`new ${e.ValidationError}(${t})`):(n.assign(r._`${i}.errors`,t),n.return(!1))}t.keywordError={message:e=>{let{keyword:t}=e;return r.str`must pass "${t}" keyword validation`}},t.keyword$DataError={message:e=>{let{keyword:t,schemaType:n}=e;return n?r.str`"${t}" keyword must be ${n} ($data)`:r.str`"${t}" keyword is invalid ($data)`}},t.reportError=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.keywordError,i=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0;const{it:u}=e,{gen:c,compositeRule:d,allErrors:h}=u,f=l(e,n,i);(null!==o&&void 0!==o?o:d||h)?s(c,f):a(u,r._`[${f}]`)},t.reportExtraError=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.keywordError,r=arguments.length>2?arguments[2]:void 0;const{it:i}=e,{gen:u,compositeRule:c,allErrors:d}=i,h=l(e,n,r);s(u,h),c||d||a(i,o.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(o.default.errors,t),e.if(r._`${o.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign(r._`${o.default.vErrors}.length`,t)),(()=>e.assign(o.default.vErrors,null)))))},t.extendErrors=function(e){let{gen:t,keyword:n,schemaValue:i,data:s,errsCount:a,it:u}=e;if(void 0===a)throw new Error("ajv implementation error");const l=t.name("err");t.forRange("i",a,o.default.errors,(e=>{t.const(l,r._`${o.default.vErrors}[${e}]`),t.if(r._`${l}.instancePath === undefined`,(()=>t.assign(r._`${l}.instancePath`,(0,r.strConcat)(o.default.instancePath,u.errorPath)))),t.assign(r._`${l}.schemaPath`,r.str`${u.errSchemaPath}/${n}`),u.opts.verbose&&(t.assign(r._`${l}.schema`,i),t.assign(r._`${l}.data`,s))}))};const u={keyword:new r.Name("keyword"),schemaPath:new r.Name("schemaPath"),params:new r.Name("params"),propertyName:new r.Name("propertyName"),message:new r.Name("message"),schema:new r.Name("schema"),parentSchema:new r.Name("parentSchema")};function l(e,t,n){const{createErrors:i}=e.it;return!1===i?r._`{}`:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{gen:r,it:i}=e,o=[c(i,n),d(e,n)];return h(e,t,o),r.object(...o)}(e,t,n)}function c(e,t){let{errorPath:n}=e,{instancePath:s}=t;const a=s?r.str`${n}${(0,i.getErrorPath)(s,i.Type.Str)}`:n;return[o.default.instancePath,(0,r.strConcat)(o.default.instancePath,a)]}function d(e,t){let{keyword:n,it:{errSchemaPath:o}}=e,{schemaPath:s,parentSchema:a}=t,l=a?o:r.str`${o}/${n}`;return s&&(l=r.str`${l}${(0,i.getErrorPath)(s,i.Type.Str)}`),[u.schemaPath,l]}function h(e,t,n){let{params:i,message:s}=t;const{keyword:a,data:l,schemaValue:c,it:d}=e,{opts:h,propertyName:f,topSchemaRef:p,schemaPath:g}=d;n.push([u.keyword,a],[u.params,"function"==typeof i?i(e):i||r._`{}`]),h.messages&&n.push([u.message,"function"==typeof s?s(e):s]),h.verbose&&n.push([u.schema,c],[u.parentSchema,r._`${p}${g}`],[o.default.data,l]),f&&n.push([u.propertyName,f])}},8393:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const r=n(4105),i=n(5522),o=n(8317),s=n(2225),a=n(4648),u=n(2262);class l{constructor(e){var t;let n;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,s.normalizeId)(null===n||void 0===n?void 0:n[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null===n||void 0===n?void 0:n.$async,this.refs={}}}function c(e){const t=h.call(this,e);if(t)return t;const n=(0,s.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:a,lines:l}=this.opts.code,{ownProperties:c}=this.opts,d=new r.CodeGen(this.scope,{es5:a,lines:l,ownProperties:c});let f;e.$async&&(f=d.scopeValue("Error",{ref:i.default,code:r._`require("ajv/dist/runtime/validation_error").default`}));const p=d.scopeName("validate");e.validateName=p;const g={gen:d,allErrors:this.opts.allErrors,data:o.default.data,parentData:o.default.parentData,parentDataProperty:o.default.parentDataProperty,dataNames:[o.default.data],dataPathArr:[r.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:d.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,r.stringify)(e.schema)}:{ref:e.schema}),validateName:p,ValidationError:f,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:r.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:r._`""`,opts:this.opts,self:this};let m;try{this._compilations.add(e),(0,u.validateFunctionCode)(g),d.optimize(this.opts.code.optimize);const t=d.toString();m=`${d.scopeRefs(o.default.scope)}return ${t}`,this.opts.code.process&&(m=this.opts.code.process(m,e));const n=new Function(`${o.default.self}`,`${o.default.scope}`,m)(this,this.scope.get());if(this.scope.value(p,{ref:n}),n.errors=null,n.schema=e.schema,n.schemaEnv=e,e.$async&&(n.$async=!0),!0===this.opts.code.source&&(n.source={validateName:p,validateCode:t,scopeValues:d._values}),this.opts.unevaluated){const{props:e,items:t}=g;n.evaluated={props:e instanceof r.Name?void 0:e,items:t instanceof r.Name?void 0:t,dynamicProps:e instanceof r.Name,dynamicItems:t instanceof r.Name},n.source&&(n.source.evaluated=(0,r.stringify)(n.evaluated))}return e.validate=n,e}catch(y){throw delete e.validate,delete e.validateName,m&&this.logger.error("Error compiling schema, function code:",m),y}finally{this._compilations.delete(e)}}function d(e){return(0,s.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:c.call(this,e)}function h(e){for(const r of this._compilations)if(n=e,(t=r).schema===n.schema&&t.root===n.root&&t.baseId===n.baseId)return r;var t,n}function f(e,t){let n;for(;"string"==typeof(n=this.refs[t]);)t=n;return n||this.schemas[t]||p.call(this,e,t)}function p(e,t){const n=this.opts.uriResolver.parse(t),r=(0,s._getFullPath)(this.opts.uriResolver,n);let i=(0,s.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&r===i)return m.call(this,n,e);const o=(0,s.normalizeId)(r),a=this.refs[o]||this.schemas[o];if("string"==typeof a){const t=p.call(this,e,a);if("object"!==typeof(null===t||void 0===t?void 0:t.schema))return;return m.call(this,n,t)}if("object"===typeof(null===a||void 0===a?void 0:a.schema)){if(a.validate||c.call(this,a),o===(0,s.normalizeId)(t)){const{schema:t}=a,{schemaId:n}=this.opts,r=t[n];return r&&(i=(0,s.resolveUrl)(this.opts.uriResolver,i,r)),new l({schema:t,schemaId:n,root:e,baseId:i})}return m.call(this,n,a)}}t.SchemaEnv=l,t.compileSchema=c,t.resolveRef=function(e,t,n){var r;n=(0,s.resolveUrl)(this.opts.uriResolver,t,n);const i=e.refs[n];if(i)return i;let o=f.call(this,e,n);if(void 0===o){const i=null===(r=e.localRefs)||void 0===r?void 0:r[n],{schemaId:s}=this.opts;i&&(o=new l({schema:i,schemaId:s,root:e,baseId:t}))}return void 0!==o?e.refs[n]=d.call(this,o):void 0},t.getCompilingSchema=h,t.resolveSchema=p;const g=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function m(e,t){let{baseId:n,schema:r,root:i}=t;var o;if("/"!==(null===(o=e.fragment)||void 0===o?void 0:o[0]))return;for(const l of e.fragment.slice(1).split("/")){if("boolean"===typeof r)return;const e=r[(0,a.unescapeFragment)(l)];if(void 0===e)return;r=e;const t="object"===typeof r&&r[this.opts.schemaId];!g.has(l)&&t&&(n=(0,s.resolveUrl)(this.opts.uriResolver,n,t))}let u;if("boolean"!=typeof r&&r.$ref&&!(0,a.schemaHasRulesButRef)(r,this.RULES)){const e=(0,s.resolveUrl)(this.opts.uriResolver,n,r.$ref);u=p.call(this,i,e)}const{schemaId:c}=this.opts;return u=u||new l({schema:r,schemaId:c,root:i,baseId:n}),u.schema!==u.root.schema?u:void 0}},8317:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4105),i={data:new r.Name("data"),valCxt:new r.Name("valCxt"),instancePath:new r.Name("instancePath"),parentData:new r.Name("parentData"),parentDataProperty:new r.Name("parentDataProperty"),rootData:new r.Name("rootData"),dynamicAnchors:new r.Name("dynamicAnchors"),vErrors:new r.Name("vErrors"),errors:new r.Name("errors"),this:new r.Name("this"),self:new r.Name("self"),scope:new r.Name("scope"),json:new r.Name("json"),jsonPos:new r.Name("jsonPos"),jsonLen:new r.Name("jsonLen"),jsonPart:new r.Name("jsonPart")};t.default=i},1145:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2225);class i extends Error{constructor(e,t,n,i){super(i||`can't resolve reference ${n} from id ${t}`),this.missingRef=(0,r.resolveUrl)(e,t,n),this.missingSchema=(0,r.normalizeId)((0,r.getFullPath)(e,this.missingRef))}}t.default=i},2225:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const r=n(4648),i=n(8262),o=n(7204),s=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return"boolean"==typeof e||(!0===t?!u(e):!!t&&l(e)<=t)};const a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function u(e){for(const t in e){if(a.has(t))return!0;const n=e[t];if(Array.isArray(n)&&n.some(u))return!0;if("object"==typeof n&&u(n))return!0}return!1}function l(e){let t=0;for(const n in e){if("$ref"===n)return 1/0;if(t++,!s.has(n)&&("object"==typeof e[n]&&(0,r.eachItem)(e[n],(e=>t+=l(e))),t===1/0))return 1/0}return t}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0;!1!==n&&(t=f(t));const r=e.parse(t);return d(e,r)}function d(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=c,t._getFullPath=d;const h=/#\/?$/;function f(e){return e?e.replace(h,""):""}t.normalizeId=f,t.resolveUrl=function(e,t,n){return n=f(n),e.resolve(t,n)};const p=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:n,uriResolver:r}=this.opts,s=f(e[n]||t),a={"":s},u=c(r,s,!1),l={},d=new Set;return o(e,{allKeys:!0},((e,t,r,i)=>{if(void 0===i)return;const o=u+t;let s=a[i];function c(t){const n=this.opts.uriResolver.resolve;if(t=f(s?n(s,t):t),d.has(t))throw g(t);d.add(t);let r=this.refs[t];return"string"==typeof r&&(r=this.refs[r]),"object"==typeof r?h(e,r.schema,t):t!==f(o)&&("#"===t[0]?(h(e,l[t],t),l[t]=e):this.refs[t]=o),t}function m(e){if("string"==typeof e){if(!p.test(e))throw new Error(`invalid anchor "${e}"`);c.call(this,`#${e}`)}}"string"==typeof e[n]&&(s=c.call(this,e[n])),m.call(this,e.$anchor),m.call(this,e.$dynamicAnchor),a[t]=s})),l;function h(e,t,n){if(void 0!==t&&!i(e,t))throw g(n)}function g(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},4091:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;const n=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&n.has(e)},t.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},4648:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const r=n(4105),i=n(9716);function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.schema;const{opts:n,self:r}=e;if(!n.strictSchema)return;if("boolean"===typeof t)return;const i=r.RULES.keywords;for(const o in t)i[o]||p(e,`unknown keyword: "${o}"`)}function s(e,t){if("boolean"==typeof e)return!e;for(const n in e)if(t[n])return!0;return!1}function a(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function u(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function l(e){let{mergeNames:t,mergeToName:n,mergeValues:i,resultToName:o}=e;return(e,s,a,u)=>{const l=void 0===a?s:a instanceof r.Name?(s instanceof r.Name?t(e,s,a):n(e,s,a),a):s instanceof r.Name?(n(e,a,s),s):i(s,a);return u!==r.Name||l instanceof r.Name?l:o(e,l)}}function c(e,t){if(!0===t)return e.var("props",!0);const n=e.var("props",r._`{}`);return void 0!==t&&d(e,n,t),n}function d(e,t,n){Object.keys(n).forEach((n=>e.assign(r._`${t}${(0,r.getProperty)(n)}`,!0)))}t.toHash=function(e){const t={};for(const n of e)t[n]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(o(e,t),!s(t,e.self.RULES.all))},t.checkUnknownRules=o,t.schemaHasRules=s,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const n in e)if("$ref"!==n&&t.all[n])return!0;return!1},t.schemaRefOrVal=function(e,t,n,i){let{topSchemaRef:o,schemaPath:s}=e;if(!i){if("number"==typeof t||"boolean"==typeof t)return t;if("string"==typeof t)return r._`${t}`}return r._`${o}${s}${(0,r.getProperty)(n)}`},t.unescapeFragment=function(e){return u(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(a(e))},t.escapeJsonPointer=a,t.unescapeJsonPointer=u,t.eachItem=function(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)},t.mergeEvaluated={props:l({mergeNames:(e,t,n)=>e.if(r._`${n} !== true && ${t} !== undefined`,(()=>{e.if(r._`${t} === true`,(()=>e.assign(n,!0)),(()=>e.assign(n,r._`${n} || {}`).code(r._`Object.assign(${n}, ${t})`)))})),mergeToName:(e,t,n)=>e.if(r._`${n} !== true`,(()=>{!0===t?e.assign(n,!0):(e.assign(n,r._`${n} || {}`),d(e,n,t))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:c}),items:l({mergeNames:(e,t,n)=>e.if(r._`${n} !== true && ${t} !== undefined`,(()=>e.assign(n,r._`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`))),mergeToName:(e,t,n)=>e.if(r._`${n} !== true`,(()=>e.assign(n,!0===t||r._`${n} > ${t} ? ${n} : ${t}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=c,t.setEvaluated=d;const h={};var f;function p(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.opts.strictSchema;if(n){if(t=`strict mode: ${t}`,!0===n)throw new Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:h[t.code]||(h[t.code]=new i._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(f||(t.Type=f={})),t.getErrorPath=function(e,t,n){if(e instanceof r.Name){const i=t===f.Num;return n?i?r._`"[" + ${e} + "]"`:r._`"['" + ${e} + "']"`:i?r._`"/" + ${e}`:r._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,r.getProperty)(e).toString():"/"+a(e)},t.checkStrictMode=p},9763:(e,t)=>{"use strict";function n(e,t){return t.rules.some((t=>r(e,t)))}function r(e,t){var n;return void 0!==e[t.keyword]||(null===(n=t.definition.implements)||void 0===n?void 0:n.some((t=>void 0!==e[t])))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function(e,t){let{schema:r,self:i}=e;const o=i.RULES.types[t];return o&&!0!==o&&n(r,o)},t.shouldUseGroup=n,t.shouldUseRule=r},1421:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const r=n(5),i=n(4105),o=n(8317),s={message:"boolean schema is false"};function a(e,t){const{gen:n,data:i}=e,o={gen:n,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,r.reportError)(o,s,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:n,validateName:r}=e;!1===n?a(e,!1):"object"==typeof n&&!0===n.$async?t.return(o.default.data):(t.assign(i._`${r}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:n,schema:r}=e;!1===r?(n.var(t,!1),a(e)):n.var(t,!0)}},2093:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const r=n(4091),i=n(9763),o=n(5),s=n(4105),a=n(4648);var u;function l(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(r.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(u||(t.DataType=u={})),t.getSchemaTypes=function(e){const t=l(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},t.getJSONTypes=l,t.coerceAndCheckDataType=function(e,t){const{gen:n,data:r,opts:o}=e,a=function(e,t){return t?e.filter((e=>c.has(e)||"array"===t&&"array"===e)):[]}(t,o.coerceTypes),l=t.length>0&&!(0===a.length&&1===t.length&&(0,i.schemaHasRulesForType)(e,t[0]));if(l){const i=h(t,r,o.strictNumbers,u.Wrong);n.if(i,(()=>{a.length?function(e,t,n){const{gen:r,data:i,opts:o}=e,a=r.let("dataType",s._`typeof ${i}`),u=r.let("coerced",s._`undefined`);"array"===o.coerceTypes&&r.if(s._`${a} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,(()=>r.assign(i,s._`${i}[0]`).assign(a,s._`typeof ${i}`).if(h(t,i,o.strictNumbers),(()=>r.assign(u,i)))));r.if(s._`${u} !== undefined`);for(const s of n)(c.has(s)||"array"===s&&"array"===o.coerceTypes)&&l(s);function l(e){switch(e){case"string":return void r.elseIf(s._`${a} == "number" || ${a} == "boolean"`).assign(u,s._`"" + ${i}`).elseIf(s._`${i} === null`).assign(u,s._`""`);case"number":return void r.elseIf(s._`${a} == "boolean" || ${i} === null - || (${a} == "string" && ${i} && ${i} == +${i})`).assign(u,s._`+${i}`);case"integer":return void r.elseIf(s._`${a} === "boolean" || ${i} === null - || (${a} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(u,s._`+${i}`);case"boolean":return void r.elseIf(s._`${i} === "false" || ${i} === 0 || ${i} === null`).assign(u,!1).elseIf(s._`${i} === "true" || ${i} === 1`).assign(u,!0);case"null":return r.elseIf(s._`${i} === "" || ${i} === 0 || ${i} === false`),void r.assign(u,null);case"array":r.elseIf(s._`${a} === "string" || ${a} === "number" - || ${a} === "boolean" || ${i} === null`).assign(u,s._`[${i}]`)}}r.else(),p(e),r.endIf(),r.if(s._`${u} !== undefined`,(()=>{r.assign(i,u),function(e,t){let{gen:n,parentData:r,parentDataProperty:i}=e;n.if(s._`${r} !== undefined`,(()=>n.assign(s._`${r}[${i}]`,t)))}(e,u)}))}(e,t,a):p(e)}))}return l};const c=new Set(["string","number","integer","boolean","null"]);function d(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:u.Correct;const i=r===u.Correct?s.operators.EQ:s.operators.NEQ;let o;switch(e){case"null":return s._`${t} ${i} null`;case"array":o=s._`Array.isArray(${t})`;break;case"object":o=s._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=a(s._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=a();break;default:return s._`typeof ${t} ${i} ${e}`}return r===u.Correct?o:(0,s.not)(o);function a(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s.nil;return(0,s.and)(s._`typeof ${t} == "number"`,e,n?s._`isFinite(${t})`:s.nil)}}function h(e,t,n,r){if(1===e.length)return d(e[0],t,n,r);let i;const o=(0,a.toHash)(e);if(o.array&&o.object){const e=s._`typeof ${t} != "object"`;i=o.null?e:s._`!${t} || ${e}`,delete o.null,delete o.array,delete o.object}else i=s.nil;o.number&&delete o.integer;for(const a in o)i=(0,s.and)(i,d(a,t,n,r));return i}t.checkDataType=d,t.checkDataTypes=h;const f={message:e=>{let{schema:t}=e;return`must be ${t}`},params:e=>{let{schema:t,schemaValue:n}=e;return"string"==typeof t?s._`{type: ${t}}`:s._`{type: ${n}}`}};function p(e){const t=function(e){const{gen:t,data:n,schema:r}=e,i=(0,a.schemaRefOrVal)(e,r,"type");return{gen:t,keyword:"type",data:n,schema:r.type,schemaCode:i,schemaValue:i,parentSchema:r,params:{},it:e}}(e);(0,o.reportError)(t,f)}t.reportTypeError=p},9540:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const r=n(4105),i=n(4648);function o(e,t,n){const{gen:o,compositeRule:s,data:a,opts:u}=e;if(void 0===n)return;const l=r._`${a}${(0,r.getProperty)(t)}`;if(s)return void(0,i.checkStrictMode)(e,`default is ignored for: ${l}`);let c=r._`${l} === undefined`;"empty"===u.useDefaults&&(c=r._`${c} || ${l} === null || ${l} === ""`),o.if(c,r._`${l} = ${(0,r.stringify)(n)}`)}t.assignDefaults=function(e,t){const{properties:n,items:r}=e.schema;if("object"===t&&n)for(const i in n)o(e,i,n[i].default);else"array"===t&&Array.isArray(r)&&r.forEach(((t,n)=>o(e,n,t.default)))}},2262:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;const r=n(1421),i=n(2093),o=n(9763),s=n(2093),a=n(9540),u=n(5080),l=n(5579),c=n(4105),d=n(8317),h=n(2225),f=n(4648),p=n(5);function g(e,t){let{gen:n,validateName:r,schema:i,schemaEnv:o,opts:s}=e;s.code.es5?n.func(r,c._`${d.default.data}, ${d.default.valCxt}`,o.$async,(()=>{n.code(c._`"use strict"; ${m(i,s)}`),function(e,t){e.if(d.default.valCxt,(()=>{e.var(d.default.instancePath,c._`${d.default.valCxt}.${d.default.instancePath}`),e.var(d.default.parentData,c._`${d.default.valCxt}.${d.default.parentData}`),e.var(d.default.parentDataProperty,c._`${d.default.valCxt}.${d.default.parentDataProperty}`),e.var(d.default.rootData,c._`${d.default.valCxt}.${d.default.rootData}`),t.dynamicRef&&e.var(d.default.dynamicAnchors,c._`${d.default.valCxt}.${d.default.dynamicAnchors}`)}),(()=>{e.var(d.default.instancePath,c._`""`),e.var(d.default.parentData,c._`undefined`),e.var(d.default.parentDataProperty,c._`undefined`),e.var(d.default.rootData,d.default.data),t.dynamicRef&&e.var(d.default.dynamicAnchors,c._`{}`)}))}(n,s),n.code(t)})):n.func(r,c._`${d.default.data}, ${function(e){return c._`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${e.dynamicRef?c._`, ${d.default.dynamicAnchors}={}`:c.nil}}={}`}(s)}`,o.$async,(()=>n.code(m(i,s)).code(t)))}function m(e,t){const n="object"==typeof e&&e[t.schemaId];return n&&(t.code.source||t.code.process)?c._`/*# sourceURL=${n} */`:c.nil}function y(e,t){w(e)&&(_(e),v(e))?function(e,t){const{schema:n,gen:r,opts:i}=e;i.$comment&&n.$comment&&S(e);(function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,h.resolveUrl)(e.opts.uriResolver,e.baseId,t))})(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const o=r.const("_errs",d.default.errors);b(e,o),r.var(t,c._`${o} === ${d.default.errors}`)}(e,t):(0,r.boolOrEmptySchema)(e,t)}function v(e){let{schema:t,self:n}=e;if("boolean"==typeof t)return!t;for(const r in t)if(n.RULES.all[r])return!0;return!1}function w(e){return"boolean"!=typeof e.schema}function _(e){(0,f.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:n,opts:r,self:i}=e;t.$ref&&r.ignoreKeywordsWithRef&&(0,f.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}(e)}function b(e,t){if(e.opts.jtd)return x(e,[],!1,t);const n=(0,i.getSchemaTypes)(e.schema);x(e,n,!(0,i.coerceAndCheckDataType)(e,n),t)}function S(e){let{gen:t,schemaEnv:n,schema:r,errSchemaPath:i,opts:o}=e;const s=r.$comment;if(!0===o.$comment)t.code(c._`${d.default.self}.logger.log(${s})`);else if("function"==typeof o.$comment){const e=c.str`${i}/$comment`,r=t.scopeValue("root",{ref:n.root});t.code(c._`${d.default.self}.opts.$comment(${s}, ${e}, ${r}.schema)`)}}function x(e,t,n,r){const{gen:i,schema:a,data:u,allErrors:l,opts:h,self:p}=e,{RULES:g}=p;function m(f){(0,o.shouldUseGroup)(a,f)&&(f.type?(i.if((0,s.checkDataType)(f.type,u,h.strictNumbers)),E(e,f),1===t.length&&t[0]===f.type&&n&&(i.else(),(0,s.reportTypeError)(e)),i.endIf()):E(e,f),l||i.if(c._`${d.default.errors} === ${r||0}`))}!a.$ref||!h.ignoreKeywordsWithRef&&(0,f.schemaHasRulesButRef)(a,g)?(h.jtd||function(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;(function(e,t){if(!t.length)return;if(!e.dataTypes.length)return void(e.dataTypes=t);t.forEach((t=>{C(e.dataTypes,t)||P(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),function(e,t){const n=[];for(const r of e.dataTypes)C(t,r)?n.push(r):t.includes("integer")&&"number"===r&&n.push("integer");e.dataTypes=n}(e,t)})(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&P(e,"use allowUnionTypes to allow union type keyword")}(e,t);!function(e,t){const n=e.self.RULES.all;for(const r in n){const i=n[r];if("object"==typeof i&&(0,o.shouldUseRule)(e.schema,i)){const{type:n}=i.definition;n.length&&!n.some((e=>k(t,e)))&&P(e,`missing type "${n.join(",")}" for keyword "${r}"`)}}}(e,e.dataTypes)}(e,t),i.block((()=>{for(const e of g.rules)m(e);m(g.post)}))):i.block((()=>A(e,"$ref",g.all.$ref.definition)))}function E(e,t){const{gen:n,schema:r,opts:{useDefaults:i}}=e;i&&(0,a.assignDefaults)(e,t.type),n.block((()=>{for(const n of t.rules)(0,o.shouldUseRule)(r,n)&&A(e,n.keyword,n.definition,t.type)}))}function k(e,t){return e.includes(t)||"number"===t&&e.includes("integer")}function C(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function P(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,f.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=function(e){w(e)&&(_(e),v(e))?function(e){const{schema:t,opts:n,gen:r}=e;g(e,(()=>{n.$comment&&t.$comment&&S(e),function(e){const{schema:t,opts:n}=e;void 0!==t.default&&n.useDefaults&&n.strictSchema&&(0,f.checkStrictMode)(e,"default is ignored in the schema root")}(e),r.let(d.default.vErrors,null),r.let(d.default.errors,0),n.unevaluated&&function(e){const{gen:t,validateName:n}=e;e.evaluated=t.const("evaluated",c._`${n}.evaluated`),t.if(c._`${e.evaluated}.dynamicProps`,(()=>t.assign(c._`${e.evaluated}.props`,c._`undefined`))),t.if(c._`${e.evaluated}.dynamicItems`,(()=>t.assign(c._`${e.evaluated}.items`,c._`undefined`)))}(e),b(e),function(e){const{gen:t,schemaEnv:n,validateName:r,ValidationError:i,opts:o}=e;n.$async?t.if(c._`${d.default.errors} === 0`,(()=>t.return(d.default.data)),(()=>t.throw(c._`new ${i}(${d.default.vErrors})`))):(t.assign(c._`${r}.errors`,d.default.vErrors),o.unevaluated&&function(e){let{gen:t,evaluated:n,props:r,items:i}=e;r instanceof c.Name&&t.assign(c._`${n}.props`,r);i instanceof c.Name&&t.assign(c._`${n}.items`,i)}(e),t.return(c._`${d.default.errors} === 0`))}(e)}))}(e):g(e,(()=>(0,r.topBoolOrEmptySchema)(e)))};class T{constructor(e,t,n){if((0,u.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,f.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",j(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,u.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",d.default.errors))}result(e,t,n){this.failResult((0,c.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,c.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(c._`${t} !== undefined && (${(0,c.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t)return this.setParams(t),this._error(e,n),void this.setParams({});this._error(e,n)}_error(e,t){(e?p.reportExtraError:p.reportError)(this,this.def.error,t)}$dataError(){(0,p.reportError)(this,this.def.$dataError||p.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,p.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c.nil;this.gen.block((()=>{this.check$data(e,n),t()}))}check$data(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c.nil,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c.nil;if(!this.$data)return;const{gen:n,schemaCode:r,schemaType:i,def:o}=this;n.if((0,c.or)(c._`${r} === undefined`,t)),e!==c.nil&&n.assign(e,!0),(i.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==c.nil&&n.assign(e,!1)),n.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:n,def:r,it:i}=this;return(0,c.or)(function(){if(n.length){if(!(t instanceof c.Name))throw new Error("ajv implementation error");const e=Array.isArray(n)?n:[n];return c._`${(0,s.checkDataTypes)(e,t,i.opts.strictNumbers,s.DataType.Wrong)}`}return c.nil}(),function(){if(r.validateSchema){const n=e.scopeValue("validate$data",{ref:r.validateSchema});return c._`!${n}(${t})`}return c.nil}())}subschema(e,t){const n=(0,l.getSubschema)(this.it,e);(0,l.extendSubschemaData)(n,this.it,e),(0,l.extendSubschemaMode)(n,e);const r={...this.it,...n,items:void 0,props:void 0};return y(r,t),r}mergeEvaluated(e,t){const{it:n,gen:r}=this;n.opts.unevaluated&&(!0!==n.props&&void 0!==e.props&&(n.props=f.mergeEvaluated.props(r,e.props,n.props,t)),!0!==n.items&&void 0!==e.items&&(n.items=f.mergeEvaluated.items(r,e.items,n.items,t)))}mergeValidEvaluated(e,t){const{it:n,gen:r}=this;if(n.opts.unevaluated&&(!0!==n.props||!0!==n.items))return r.if(t,(()=>this.mergeEvaluated(e,c.Name))),!0}}function A(e,t,n,r){const i=new T(e,n,t);"code"in n?n.code(i,r):i.$data&&n.validate?(0,u.funcKeywordCode)(i,n):"macro"in n?(0,u.macroKeywordCode)(i,n):(n.compile||n.validate)&&(0,u.funcKeywordCode)(i,n)}t.KeywordCxt=T;const O=/^\/(?:[^~]|~0|~1)*$/,I=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function j(e,t){let n,r,{dataLevel:i,dataNames:o,dataPathArr:s}=t;if(""===e)return d.default.rootData;if("/"===e[0]){if(!O.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);n=e,r=d.default.rootData}else{const t=I.exec(e);if(!t)throw new Error(`Invalid JSON-pointer: ${e}`);const a=+t[1];if(n=t[2],"#"===n){if(a>=i)throw new Error(l("property/index",a));return s[i-a]}if(a>i)throw new Error(l("data",a));if(r=o[i-a],!n)return r}let a=r;const u=n.split("/");for(const d of u)d&&(r=c._`${r}${(0,c.getProperty)((0,f.unescapeJsonPointer)(d))}`,a=c._`${a} && ${r}`);return a;function l(e,t){return`Cannot access ${e} ${t} levels up, current level is ${i}`}}t.getData=j},5080:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const r=n(4105),i=n(8317),o=n(1580),s=n(5);function a(e){const{gen:t,data:n,it:i}=e;t.if(i.parentData,(()=>t.assign(n,r._`${i.parentData}[${i.parentDataProperty}]`)))}function u(e,t,n){if(void 0===n)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof n?{ref:n}:{ref:n,code:(0,r.stringify)(n)})}t.macroKeywordCode=function(e,t){const{gen:n,keyword:i,schema:o,parentSchema:s,it:a}=e,l=t.macro.call(a.self,o,s,a),c=u(n,i,l);!1!==a.opts.validateSchema&&a.self.validateSchema(l,!0);const d=n.name("valid");e.subschema({schema:l,schemaPath:r.nil,errSchemaPath:`${a.errSchemaPath}/${i}`,topSchemaRef:c,compositeRule:!0},d),e.pass(d,(()=>e.error(!0)))},t.funcKeywordCode=function(e,t){var n;const{gen:l,keyword:c,schema:d,parentSchema:h,$data:f,it:p}=e;!function(e,t){let{schemaEnv:n}=e;if(t.async&&!n.$async)throw new Error("async keyword in sync schema")}(p,t);const g=!f&&t.compile?t.compile.call(p.self,d,h,p):t.validate,m=u(l,c,g),y=l.let("valid");function v(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.async?r._`await `:r.nil;const s=p.opts.passContext?i.default.this:i.default.self,a=!("compile"in t&&!f||!1===t.schema);l.assign(y,r._`${n}${(0,o.callValidateCode)(e,m,s,a)}`,t.modifying)}function w(e){var n;l.if((0,r.not)(null!==(n=t.valid)&&void 0!==n?n:y),e)}e.block$data(y,(function(){if(!1===t.errors)v(),t.modifying&&a(e),w((()=>e.error()));else{const n=t.async?function(){const e=l.let("ruleErrs",null);return l.try((()=>v(r._`await `)),(t=>l.assign(y,!1).if(r._`${t} instanceof ${p.ValidationError}`,(()=>l.assign(e,r._`${t}.errors`)),(()=>l.throw(t))))),e}():function(){const e=r._`${m}.errors`;return l.assign(e,null),v(r.nil),e}();t.modifying&&a(e),w((()=>function(e,t){const{gen:n}=e;n.if(r._`Array.isArray(${t})`,(()=>{n.assign(i.default.vErrors,r._`${i.default.vErrors} === null ? ${t} : ${i.default.vErrors}.concat(${t})`).assign(i.default.errors,r._`${i.default.vErrors}.length`),(0,s.extendErrors)(e)}),(()=>e.error()))}(e,n)))}})),e.ok(null!==(n=t.valid)&&void 0!==n?n:y)},t.validSchemaType=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return!t.length||t.some((t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||n&&"undefined"==typeof e))},t.validateKeywordUsage=function(e,t,n){let{schema:r,opts:i,self:o,errSchemaPath:s}=e;if(Array.isArray(t.keyword)?!t.keyword.includes(n):t.keyword!==n)throw new Error("ajv implementation error");const a=t.dependencies;if(null===a||void 0===a?void 0:a.some((e=>!Object.prototype.hasOwnProperty.call(r,e))))throw new Error(`parent schema must have dependencies of ${n}: ${a.join(",")}`);if(t.validateSchema){if(!t.validateSchema(r[n])){const e=`keyword "${n}" value is invalid at path "${s}": `+o.errorsText(t.validateSchema.errors);if("log"!==i.validateSchema)throw new Error(e);o.logger.error(e)}}}},5579:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;const r=n(4105),i=n(4648);t.getSubschema=function(e,t){let{keyword:n,schemaProp:o,schema:s,schemaPath:a,errSchemaPath:u,topSchemaRef:l}=t;if(void 0!==n&&void 0!==s)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==n){const t=e.schema[n];return void 0===o?{schema:t,schemaPath:r._`${e.schemaPath}${(0,r.getProperty)(n)}`,errSchemaPath:`${e.errSchemaPath}/${n}`}:{schema:t[o],schemaPath:r._`${e.schemaPath}${(0,r.getProperty)(n)}${(0,r.getProperty)(o)}`,errSchemaPath:`${e.errSchemaPath}/${n}/${(0,i.escapeFragment)(o)}`}}if(void 0!==s){if(void 0===a||void 0===u||void 0===l)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:s,schemaPath:a,topSchemaRef:l,errSchemaPath:u}}throw new Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,n){let{dataProp:o,dataPropType:s,data:a,dataTypes:u,propertyName:l}=n;if(void 0!==a&&void 0!==o)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:c}=t;if(void 0!==o){const{errorPath:n,dataPathArr:a,opts:u}=t;d(c.let("data",r._`${t.data}${(0,r.getProperty)(o)}`,!0)),e.errorPath=r.str`${n}${(0,i.getErrorPath)(o,s,u.jsPropertySyntax)}`,e.parentDataProperty=r._`${o}`,e.dataPathArr=[...a,e.parentDataProperty]}if(void 0!==a){d(a instanceof r.Name?a:c.let("data",a,!0)),void 0!==l&&(e.propertyName=l)}function d(n){e.data=n,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,n]}u&&(e.dataTypes=u)},t.extendSubschemaMode=function(e,t){let{jtdDiscriminator:n,jtdMetadata:r,compositeRule:i,createErrors:o,allErrors:s}=t;void 0!==i&&(e.compositeRule=i),void 0!==o&&(e.createErrors=o),void 0!==s&&(e.allErrors=s),e.jtdDiscriminator=n,e.jtdMetadata=r}},6422:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var r=n(2262);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return r.KeywordCxt}});var i=n(4105);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return i._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return i.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return i.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return i.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return i.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return i.CodeGen}});const o=n(5522),s=n(1145),a=n(4091),u=n(8393),l=n(4105),c=n(2225),d=n(2093),h=n(4648),f=n(4775),p=n(8012),g=(e,t)=>new RegExp(e,t);g.code="new RegExp";const m=["removeAdditional","useDefaults","coerceTypes"],y=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),v={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},w={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function _(e){var t,n,r,i,o,s,a,u,l,c,d,h,f,m,y,v,w,_,b,S,x,E,k,C,P;const T=e.strict,A=null===(t=e.code)||void 0===t?void 0:t.optimize,O=!0===A||void 0===A?1:A||0,I=null!==(r=null===(n=e.code)||void 0===n?void 0:n.regExp)&&void 0!==r?r:g,j=null!==(i=e.uriResolver)&&void 0!==i?i:p.default;return{strictSchema:null===(s=null!==(o=e.strictSchema)&&void 0!==o?o:T)||void 0===s||s,strictNumbers:null===(u=null!==(a=e.strictNumbers)&&void 0!==a?a:T)||void 0===u||u,strictTypes:null!==(c=null!==(l=e.strictTypes)&&void 0!==l?l:T)&&void 0!==c?c:"log",strictTuples:null!==(h=null!==(d=e.strictTuples)&&void 0!==d?d:T)&&void 0!==h?h:"log",strictRequired:null!==(m=null!==(f=e.strictRequired)&&void 0!==f?f:T)&&void 0!==m&&m,code:e.code?{...e.code,optimize:O,regExp:I}:{optimize:O,regExp:I},loopRequired:null!==(y=e.loopRequired)&&void 0!==y?y:200,loopEnum:null!==(v=e.loopEnum)&&void 0!==v?v:200,meta:null===(w=e.meta)||void 0===w||w,messages:null===(_=e.messages)||void 0===_||_,inlineRefs:null===(b=e.inlineRefs)||void 0===b||b,schemaId:null!==(S=e.schemaId)&&void 0!==S?S:"$id",addUsedSchema:null===(x=e.addUsedSchema)||void 0===x||x,validateSchema:null===(E=e.validateSchema)||void 0===E||E,validateFormats:null===(k=e.validateFormats)||void 0===k||k,unicodeRegExp:null===(C=e.unicodeRegExp)||void 0===C||C,int32range:null===(P=e.int32range)||void 0===P||P,uriResolver:j}}class b{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,..._(e)};const{es5:t,lines:n}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:y,es5:t,lines:n}),this.logger=function(e){if(!1===e)return T;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const r=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),S.call(this,v,e,"NOT SUPPORTED"),S.call(this,w,e,"DEPRECATED","warn"),this._metaOpts=P.call(this),e.formats&&k.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&C.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),E.call(this),e.validateFormats=r}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:n}=this.opts;let r=f;"id"===n&&(r={...f},r.id=r.$id,delete r.$id),t&&e&&this.addMetaSchema(r,r[n],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let n;if("string"==typeof e){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);const r=n(t);return"$async"in n||(this.errors=n.errors),r}compile(e,t){const n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:n}=this.opts;return r.call(this,e,t);async function r(e,t){await i.call(this,e.$schema);const n=this._addSchema(e,t);return n.validate||o.call(this,n)}async function i(e){e&&!this.getSchema(e)&&await r.call(this,{$ref:e},!0)}async function o(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof s.default))throw t;return a.call(this,t),await u.call(this,t.missingSchema),o.call(this,e)}}function a(e){let{missingSchema:t,missingRef:n}=e;if(this.refs[t])throw new Error(`AnySchema ${t} is loaded but ${n} cannot be resolved`)}async function u(e){const n=await l.call(this,e);this.refs[e]||await i.call(this,n.$schema),this.refs[e]||this.addSchema(n,e,t)}async function l(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=n(e))}finally{delete this._loading[e]}}}addSchema(e,t,n){let r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.opts.validateSchema;if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,n,i);return this}if("object"===typeof e){const{schemaId:t}=this.opts;if(r=e[t],void 0!==r&&"string"!=typeof r)throw new Error(`schema ${t} must be string`)}return t=(0,c.normalizeId)(t||r),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,i,!0),this}addMetaSchema(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.opts.validateSchema;return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let n;if(n=e.$schema,void 0!==n&&"string"!=typeof n)throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const r=this.validate(n,e);if(!r&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return r}getSchema(e){let t;for(;"string"==typeof(t=x.call(this,e));)e=t;if(void 0===t){const{schemaId:n}=this.opts,r=new u.SchemaEnv({schema:{},schemaId:n});if(t=u.resolveSchema.call(this,r,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=x.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,c.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if("string"==typeof e)n=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=n);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(n=(t=e).keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(O.call(this,n,t),!t)return(0,h.eachItem)(n,(e=>I.call(this,e))),this;L.call(this,t);const r={...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)};return(0,h.eachItem)(n,0===r.type.length?e=>I.call(this,e,r):e=>r.type.forEach((t=>I.call(this,e,r,t)))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const n of t.rules){const t=n.rules.findIndex((t=>t.keyword===e));t>=0&&n.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.errors,{separator:t=", ",dataVar:n="data"}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e&&0!==e.length?e.map((e=>`${n}${e.instancePath} ${e.message}`)).reduce(((e,n)=>e+t+n)):"No errors"}$dataMetaSchema(e,t){const n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const r of t){const t=r.split("/").slice(1);let i=e;for(const e of t)i=i[e];for(const e in n){const t=n[e];if("object"!=typeof t)continue;const{$data:r}=t.definition,o=i[e];r&&o&&(i[e]=F(o))}}return e}_removeAllSchemas(e,t){for(const n in e){const r=e[n];t&&!t.test(n)||("string"==typeof r?delete e[n]:r&&!r.meta&&(this._cache.delete(r.schema),delete e[n]))}}_addSchema(e,t,n){let r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.opts.validateSchema,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.opts.addUsedSchema;const{schemaId:s}=this.opts;if("object"==typeof e)r=e[s];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let a=this._cache.get(e);if(void 0!==a)return a;n=(0,c.normalizeId)(r||n);const l=c.getSchemaRefs.call(this,e,n);return a=new u.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:n,localRefs:l}),this._cache.set(a.schema,a),o&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=a),i&&this.validateSchema(e,!0),a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):u.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{u.compileSchema.call(this,e)}finally{this.opts=t}}}function S(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"error";for(const i in e){const o=i;o in t&&this.logger[r](`${n}: option ${i}. ${e[o]}`)}}function x(e){return e=(0,c.normalizeId)(e),this.schemas[e]||this.refs[e]}function E(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function k(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function C(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const n=e[t];n.keyword||(n.keyword=t),this.addKeyword(n)}}}function P(){const e={...this.opts};for(const t of m)delete e[t];return e}b.ValidationError=o.default,b.MissingRefError=s.default,t.default=b;const T={log(){},warn(){},error(){}};const A=/^[a-z_$][a-z0-9_$:-]*$/i;function O(e,t){const{RULES:n}=this;if((0,h.eachItem)(e,(e=>{if(n.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!A.test(e))throw new Error(`Keyword ${e} has invalid name`)})),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function I(e,t,n){var r;const i=null===t||void 0===t?void 0:t.post;if(n&&i)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:o}=this;let s=i?o.post:o.rules.find((e=>{let{type:t}=e;return t===n}));if(s||(s={type:n,rules:[]},o.rules.push(s)),o.keywords[e]=!0,!t)return;const a={keyword:e,definition:{...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)}};t.before?j.call(this,s,a,t.before):s.rules.push(a),o.all[e]=a,null===(r=t.implements)||void 0===r||r.forEach((e=>this.addKeyword(e)))}function j(e,t,n){const r=e.rules.findIndex((e=>e.keyword===n));r>=0?e.rules.splice(r,0,t):(e.rules.push(t),this.logger.warn(`rule ${n} is not defined`))}function L(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=F(t)),e.validateSchema=this.compile(t,!0))}const R={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function F(e){return{anyOf:[e,R]}}},8089:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8262);r.code='require("ajv/dist/runtime/equal").default',t.default=r},3759:(e,t)=>{"use strict";function n(e){const t=e.length;let n,r=0,i=0;for(;i=55296&&n<=56319&&i{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(23);r.code='require("ajv/dist/runtime/uri").default',t.default=r},5522:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}t.default=n},8875:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;const r=n(4105),i=n(4648),o={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:e=>{let{params:{len:t}}=e;return r.str`must NOT have more than ${t} items`},params:e=>{let{params:{len:t}}=e;return r._`{limit: ${t}}`}},code(e){const{parentSchema:t,it:n}=e,{items:r}=t;Array.isArray(r)?s(e,r):(0,i.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas')}};function s(e,t){const{gen:n,schema:o,data:s,keyword:a,it:u}=e;u.items=!0;const l=n.const("len",r._`${s}.length`);if(!1===o)e.setParams({len:t.length}),e.pass(r._`${l} <= ${t.length}`);else if("object"==typeof o&&!(0,i.alwaysValidSchema)(u,o)){const o=n.var("valid",r._`${l} <= ${t.length}`);n.if((0,r.not)(o),(()=>function(o){n.forRange("i",t.length,l,(t=>{e.subschema({keyword:a,dataProp:t,dataPropType:i.Type.Num},o),u.allErrors||n.if((0,r.not)(o),(()=>n.break()))}))}(o))),e.ok(o)}}t.validateAdditionalItems=s,t.default=o},9279:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1580),i=n(4105),o=n(8317),s=n(4648),a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:e=>{let{params:t}=e;return i._`{additionalProperty: ${t.additionalProperty}}`}},code(e){const{gen:t,schema:n,parentSchema:a,data:u,errsCount:l,it:c}=e;if(!l)throw new Error("ajv implementation error");const{allErrors:d,opts:h}=c;if(c.props=!0,"all"!==h.removeAdditional&&(0,s.alwaysValidSchema)(c,n))return;const f=(0,r.allSchemaProperties)(a.properties),p=(0,r.allSchemaProperties)(a.patternProperties);function g(e){t.code(i._`delete ${u}[${e}]`)}function m(r){if("all"===h.removeAdditional||h.removeAdditional&&!1===n)g(r);else{if(!1===n)return e.setParams({additionalProperty:r}),e.error(),void(d||t.break());if("object"==typeof n&&!(0,s.alwaysValidSchema)(c,n)){const n=t.name("valid");"failing"===h.removeAdditional?(y(r,n,!1),t.if((0,i.not)(n),(()=>{e.reset(),g(r)}))):(y(r,n),d||t.if((0,i.not)(n),(()=>t.break())))}}}function y(t,n,r){const i={keyword:"additionalProperties",dataProp:t,dataPropType:s.Type.Str};!1===r&&Object.assign(i,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(i,n)}t.forIn("key",u,(n=>{f.length||p.length?t.if(function(n){let o;if(f.length>8){const e=(0,s.schemaRefOrVal)(c,a.properties,"properties");o=(0,r.isOwnProperty)(t,e,n)}else o=f.length?(0,i.or)(...f.map((e=>i._`${n} === ${e}`))):i.nil;return p.length&&(o=(0,i.or)(o,...p.map((t=>i._`${(0,r.usePattern)(e,t)}.test(${n})`)))),(0,i.not)(o)}(n),(()=>m(n))):m(n)})),e.ok(i._`${l} === ${o.default.errors}`)}};t.default=a},8955:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4648),i={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:n,it:i}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");const o=t.name("valid");n.forEach(((t,n)=>{if((0,r.alwaysValidSchema)(i,t))return;const s=e.subschema({keyword:"allOf",schemaProp:n},o);e.ok(o),e.mergeEvaluated(s)}))}};t.default=i},7182:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:n(1580).validateUnion,error:{message:"must match a schema in anyOf"}};t.default=r},4497:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4105),i=n(4648),o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:e=>{let{params:{min:t,max:n}}=e;return void 0===n?r.str`must contain at least ${t} valid item(s)`:r.str`must contain at least ${t} and no more than ${n} valid item(s)`},params:e=>{let{params:{min:t,max:n}}=e;return void 0===n?r._`{minContains: ${t}}`:r._`{minContains: ${t}, maxContains: ${n}}`}},code(e){const{gen:t,schema:n,parentSchema:o,data:s,it:a}=e;let u,l;const{minContains:c,maxContains:d}=o;a.opts.next?(u=void 0===c?1:c,l=d):u=1;const h=t.const("len",r._`${s}.length`);if(e.setParams({min:u,max:l}),void 0===l&&0===u)return void(0,i.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==l&&u>l)return(0,i.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,i.alwaysValidSchema)(a,n)){let t=r._`${h} >= ${u}`;return void 0!==l&&(t=r._`${t} && ${h} <= ${l}`),void e.pass(t)}a.items=!0;const f=t.name("valid");function p(){const e=t.name("_valid"),n=t.let("count",0);g(e,(()=>t.if(e,(()=>function(e){t.code(r._`${e}++`),void 0===l?t.if(r._`${e} >= ${u}`,(()=>t.assign(f,!0).break())):(t.if(r._`${e} > ${l}`,(()=>t.assign(f,!1).break())),1===u?t.assign(f,!0):t.if(r._`${e} >= ${u}`,(()=>t.assign(f,!0))))}(n)))))}function g(n,r){t.forRange("i",0,h,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:i.Type.Num,compositeRule:!0},n),r()}))}void 0===l&&1===u?g(f,(()=>t.if(f,(()=>t.break())))):0===u?(t.let(f,!0),void 0!==l&&t.if(r._`${s}.length > 0`,p)):(t.let(f,!1),p()),e.result(f,(()=>e.reset()))}};t.default=o},9031:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const r=n(4105),i=n(4648),o=n(1580);t.error={message:e=>{let{params:{property:t,depsCount:n,deps:i}}=e;const o=1===n?"property":"properties";return r.str`must have ${o} ${i} when property ${t} is present`},params:e=>{let{params:{property:t,depsCount:n,deps:i,missingProperty:o}}=e;return r._`{property: ${t}, - missingProperty: ${o}, - depsCount: ${n}, - deps: ${i}}`}};const s={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,n]=function(e){let{schema:t}=e;const n={},r={};for(const i in t){if("__proto__"===i)continue;(Array.isArray(t[i])?n:r)[i]=t[i]}return[n,r]}(e);a(e,t),u(e,n)}};function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.schema;const{gen:n,data:i,it:s}=e;if(0===Object.keys(t).length)return;const a=n.let("missing");for(const u in t){const l=t[u];if(0===l.length)continue;const c=(0,o.propertyInData)(n,i,u,s.opts.ownProperties);e.setParams({property:u,depsCount:l.length,deps:l.join(", ")}),s.allErrors?n.if(c,(()=>{for(const t of l)(0,o.checkReportMissingProp)(e,t)})):(n.if(r._`${c} && (${(0,o.checkMissingProp)(e,l,a)})`),(0,o.reportMissingProp)(e,a),n.else())}}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.schema;const{gen:n,data:r,keyword:s,it:a}=e,u=n.name("valid");for(const l in t)(0,i.alwaysValidSchema)(a,t[l])||(n.if((0,o.propertyInData)(n,r,l,a.opts.ownProperties),(()=>{const t=e.subschema({keyword:s,schemaProp:l},u);e.mergeValidEvaluated(t,u)}),(()=>n.var(u,!0))),e.ok(u))}t.validatePropertyDeps=a,t.validateSchemaDeps=u,t.default=s},2890:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4105),i=n(4648),o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:e=>{let{params:t}=e;return r.str`must match "${t.ifClause}" schema`},params:e=>{let{params:t}=e;return r._`{failingKeyword: ${t.ifClause}}`}},code(e){const{gen:t,parentSchema:n,it:o}=e;void 0===n.then&&void 0===n.else&&(0,i.checkStrictMode)(o,'"if" without "then" and "else" is ignored');const a=s(o,"then"),u=s(o,"else");if(!a&&!u)return;const l=t.let("valid",!0),c=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},c);e.mergeEvaluated(t)}(),e.reset(),a&&u){const n=t.let("ifClause");e.setParams({ifClause:n}),t.if(c,d("then",n),d("else",n))}else a?t.if(c,d("then")):t.if((0,r.not)(c),d("else"));function d(n,i){return()=>{const o=e.subschema({keyword:n},c);t.assign(l,c),e.mergeValidEvaluated(o,l),i?t.assign(i,r._`${n}`):e.setParams({ifClause:n})}}e.pass(l,(()=>e.error(!0)))}};function s(e,t){const n=e.schema[t];return void 0!==n&&!(0,i.alwaysValidSchema)(e,n)}t.default=o},7040:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8875),i=n(304),o=n(3318),s=n(6216),a=n(4497),u=n(9031),l=n(274),c=n(9279),d=n(5144),h=n(9137),f=n(691),p=n(7182),g=n(4234),m=n(8955),y=n(2890),v=n(5060);t.default=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=[f.default,p.default,g.default,m.default,y.default,v.default,l.default,c.default,u.default,d.default,h.default];return e?t.push(i.default,s.default):t.push(r.default,o.default),t.push(a.default),t}},3318:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;const r=n(4105),i=n(4648),o=n(1580),s={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:n}=e;if(Array.isArray(t))return a(e,"additionalItems",t);n.items=!0,(0,i.alwaysValidSchema)(n,t)||e.ok((0,o.validateArray)(e))}};function a(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.schema;const{gen:o,parentSchema:s,data:a,keyword:u,it:l}=e;h(s),l.opts.unevaluated&&n.length&&!0!==l.items&&(l.items=i.mergeEvaluated.items(o,n.length,l.items));const c=o.name("valid"),d=o.const("len",r._`${a}.length`);function h(e){const{opts:r,errSchemaPath:o}=l,s=n.length,a=s===e.minItems&&(s===e.maxItems||!1===e[t]);if(r.strictTuples&&!a){const e=`"${u}" is ${s}-tuple, but minItems or maxItems/${t} are not specified or different at path "${o}"`;(0,i.checkStrictMode)(l,e,r.strictTuples)}}n.forEach(((t,n)=>{(0,i.alwaysValidSchema)(l,t)||(o.if(r._`${d} > ${n}`,(()=>e.subschema({keyword:u,schemaProp:n,dataProp:n},c))),e.ok(c))}))}t.validateTuple=a,t.default=s},6216:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4105),i=n(4648),o=n(1580),s=n(8875),a={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:e=>{let{params:{len:t}}=e;return r.str`must NOT have more than ${t} items`},params:e=>{let{params:{len:t}}=e;return r._`{limit: ${t}}`}},code(e){const{schema:t,parentSchema:n,it:r}=e,{prefixItems:a}=n;r.items=!0,(0,i.alwaysValidSchema)(r,t)||(a?(0,s.validateAdditionalItems)(e,a):e.ok((0,o.validateArray)(e)))}};t.default=a},691:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4648),i={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:n,it:i}=e;if((0,r.alwaysValidSchema)(i,n))return void e.fail();const o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,(()=>e.reset()),(()=>e.error()))},error:{message:"must NOT be valid"}};t.default=i},4234:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4105),i=n(4648),o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:e=>{let{params:t}=e;return r._`{passingSchemas: ${t.passing}}`}},code(e){const{gen:t,schema:n,parentSchema:o,it:s}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(s.opts.discriminator&&o.discriminator)return;const a=n,u=t.let("valid",!1),l=t.let("passing",null),c=t.name("_valid");e.setParams({passing:l}),t.block((function(){a.forEach(((n,o)=>{let a;(0,i.alwaysValidSchema)(s,n)?t.var(c,!0):a=e.subschema({keyword:"oneOf",schemaProp:o,compositeRule:!0},c),o>0&&t.if(r._`${c} && ${u}`).assign(u,!1).assign(l,r._`[${l}, ${o}]`).else(),t.if(c,(()=>{t.assign(u,!0),t.assign(l,o),a&&e.mergeEvaluated(a,r.Name)}))}))})),e.result(u,(()=>e.reset()),(()=>e.error(!0)))}};t.default=o},9137:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1580),i=n(4105),o=n(4648),s=n(4648),a={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,data:a,parentSchema:u,it:l}=e,{opts:c}=l,d=(0,r.allSchemaProperties)(n),h=d.filter((e=>(0,o.alwaysValidSchema)(l,n[e])));if(0===d.length||h.length===d.length&&(!l.opts.unevaluated||!0===l.props))return;const f=c.strictSchema&&!c.allowMatchingProperties&&u.properties,p=t.name("valid");!0===l.props||l.props instanceof i.Name||(l.props=(0,s.evaluatedPropsToName)(t,l.props));const{props:g}=l;function m(e){for(const t in f)new RegExp(e).test(t)&&(0,o.checkStrictMode)(l,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function y(n){t.forIn("key",a,(o=>{t.if(i._`${(0,r.usePattern)(e,n)}.test(${o})`,(()=>{const r=h.includes(n);r||e.subschema({keyword:"patternProperties",schemaProp:n,dataProp:o,dataPropType:s.Type.Str},p),l.opts.unevaluated&&!0!==g?t.assign(i._`${g}[${o}]`,!0):r||l.allErrors||t.if((0,i.not)(p),(()=>t.break()))}))}))}!function(){for(const e of d)f&&m(e),l.allErrors?y(e):(t.var(p,!0),y(e),t.if(p))}()}};t.default=a},304:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3318),i={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,r.validateTuple)(e,"items")};t.default=i},5144:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2262),i=n(1580),o=n(4648),s=n(9279),a={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,parentSchema:a,data:u,it:l}=e;"all"===l.opts.removeAdditional&&void 0===a.additionalProperties&&s.default.code(new r.KeywordCxt(l,s.default,"additionalProperties"));const c=(0,i.allSchemaProperties)(n);for(const r of c)l.definedProperties.add(r);l.opts.unevaluated&&c.length&&!0!==l.props&&(l.props=o.mergeEvaluated.props(t,(0,o.toHash)(c),l.props));const d=c.filter((e=>!(0,o.alwaysValidSchema)(l,n[e])));if(0===d.length)return;const h=t.name("valid");for(const r of d)f(r)?p(r):(t.if((0,i.propertyInData)(t,u,r,l.opts.ownProperties)),p(r),l.allErrors||t.else().var(h,!0),t.endIf()),e.it.definedProperties.add(r),e.ok(h);function f(e){return l.opts.useDefaults&&!l.compositeRule&&void 0!==n[e].default}function p(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},h)}}};t.default=a},274:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4105),i=n(4648),o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:e=>{let{params:t}=e;return r._`{propertyName: ${t.propertyName}}`}},code(e){const{gen:t,schema:n,data:o,it:s}=e;if((0,i.alwaysValidSchema)(s,n))return;const a=t.name("valid");t.forIn("key",o,(n=>{e.setParams({propertyName:n}),e.subschema({keyword:"propertyNames",data:n,dataTypes:["string"],propertyName:n,compositeRule:!0},a),t.if((0,r.not)(a),(()=>{e.error(!0),s.allErrors||t.break()}))})),e.ok(a)}};t.default=o},5060:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4648),i={keyword:["then","else"],schemaType:["object","boolean"],code(e){let{keyword:t,parentSchema:n,it:i}=e;void 0===n.if&&(0,r.checkStrictMode)(i,`"${t}" without "if" is ignored`)}};t.default=i},1580:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;const r=n(4105),i=n(4648),o=n(8317),s=n(4648);function a(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:r._`Object.prototype.hasOwnProperty`})}function u(e,t,n){return r._`${a(e)}.call(${t}, ${n})`}function l(e,t,n,i){const o=r._`${t}${(0,r.getProperty)(n)} === undefined`;return i?(0,r.or)(o,(0,r.not)(u(e,t,n))):o}function c(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}t.checkReportMissingProp=function(e,t){const{gen:n,data:i,it:o}=e;n.if(l(n,i,t,o.opts.ownProperties),(()=>{e.setParams({missingProperty:r._`${t}`},!0),e.error()}))},t.checkMissingProp=function(e,t,n){let{gen:i,data:o,it:{opts:s}}=e;return(0,r.or)(...t.map((e=>(0,r.and)(l(i,o,e,s.ownProperties),r._`${n} = ${e}`))))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.hasPropFunc=a,t.isOwnProperty=u,t.propertyInData=function(e,t,n,i){const o=r._`${t}${(0,r.getProperty)(n)} !== undefined`;return i?r._`${o} && ${u(e,t,n)}`:o},t.noPropertyInData=l,t.allSchemaProperties=c,t.schemaProperties=function(e,t){return c(t).filter((n=>!(0,i.alwaysValidSchema)(e,t[n])))},t.callValidateCode=function(e,t,n,i){let{schemaCode:s,data:a,it:{gen:u,topSchemaRef:l,schemaPath:c,errorPath:d},it:h}=e;const f=i?r._`${s}, ${a}, ${l}${c}`:a,p=[[o.default.instancePath,(0,r.strConcat)(o.default.instancePath,d)],[o.default.parentData,h.parentData],[o.default.parentDataProperty,h.parentDataProperty],[o.default.rootData,o.default.rootData]];h.opts.dynamicRef&&p.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);const g=r._`${f}, ${u.object(...p)}`;return n!==r.nil?r._`${t}.call(${n}, ${g})`:r._`${t}(${g})`};const d=r._`new RegExp`;t.usePattern=function(e,t){let{gen:n,it:{opts:i}}=e;const o=i.unicodeRegExp?"u":"",{regExp:a}=i.code,u=a(t,o);return n.scopeValue("pattern",{key:u.toString(),ref:u,code:r._`${"new RegExp"===a.code?d:(0,s.useFunc)(n,a)}(${t}, ${o})`})},t.validateArray=function(e){const{gen:t,data:n,keyword:o,it:s}=e,a=t.name("valid");if(s.allErrors){const e=t.let("valid",!0);return u((()=>t.assign(e,!1))),e}return t.var(a,!0),u((()=>t.break())),a;function u(s){const u=t.const("len",r._`${n}.length`);t.forRange("i",0,u,(n=>{e.subschema({keyword:o,dataProp:n,dataPropType:i.Type.Num},a),t.if((0,r.not)(a),s)}))}},t.validateUnion=function(e){const{gen:t,schema:n,keyword:o,it:s}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some((e=>(0,i.alwaysValidSchema)(s,e)))&&!s.opts.unevaluated)return;const a=t.let("valid",!1),u=t.name("_valid");t.block((()=>n.forEach(((n,i)=>{const s=e.subschema({keyword:o,schemaProp:i,compositeRule:!0},u);t.assign(a,r._`${a} || ${u}`);e.mergeValidEvaluated(s,u)||t.if((0,r.not)(a))})))),e.result(a,(()=>e.reset()),(()=>e.error(!0)))}},3323:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=n},167:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3323),i=n(7992),o=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",r.default,i.default];t.default=o},7992:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;const r=n(1145),i=n(1580),o=n(4105),s=n(8317),a=n(8393),u=n(4648),l={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:n,it:i}=e,{baseId:s,schemaEnv:u,validateName:l,opts:h,self:f}=i,{root:p}=u;if(("#"===n||"#/"===n)&&s===p.baseId)return function(){if(u===p)return d(e,l,u,u.$async);const n=t.scopeValue("root",{ref:p});return d(e,o._`${n}.validate`,p,p.$async)}();const g=a.resolveRef.call(f,p,s,n);if(void 0===g)throw new r.default(i.opts.uriResolver,s,n);return g instanceof a.SchemaEnv?function(t){const n=c(e,t);d(e,n,t,t.$async)}(g):function(r){const i=t.scopeValue("schema",!0===h.code.source?{ref:r,code:(0,o.stringify)(r)}:{ref:r}),s=t.name("valid"),a=e.subschema({schema:r,dataTypes:[],schemaPath:o.nil,topSchemaRef:i,errSchemaPath:n},s);e.mergeEvaluated(a),e.ok(s)}(g)}};function c(e,t){const{gen:n}=e;return t.validate?n.scopeValue("validate",{ref:t.validate}):o._`${n.scopeValue("wrapper",{ref:t})}.validate`}function d(e,t,n,r){const{gen:a,it:l}=e,{allErrors:c,schemaEnv:d,opts:h}=l,f=h.passContext?s.default.this:o.nil;function p(e){const t=o._`${e}.errors`;a.assign(s.default.vErrors,o._`${s.default.vErrors} === null ? ${t} : ${s.default.vErrors}.concat(${t})`),a.assign(s.default.errors,o._`${s.default.vErrors}.length`)}function g(e){var t;if(!l.opts.unevaluated)return;const r=null===(t=null===n||void 0===n?void 0:n.validate)||void 0===t?void 0:t.evaluated;if(!0!==l.props)if(r&&!r.dynamicProps)void 0!==r.props&&(l.props=u.mergeEvaluated.props(a,r.props,l.props));else{const t=a.var("props",o._`${e}.evaluated.props`);l.props=u.mergeEvaluated.props(a,t,l.props,o.Name)}if(!0!==l.items)if(r&&!r.dynamicItems)void 0!==r.items&&(l.items=u.mergeEvaluated.items(a,r.items,l.items));else{const t=a.var("items",o._`${e}.evaluated.items`);l.items=u.mergeEvaluated.items(a,t,l.items,o.Name)}}r?function(){if(!d.$async)throw new Error("async schema referenced by sync schema");const n=a.let("valid");a.try((()=>{a.code(o._`await ${(0,i.callValidateCode)(e,t,f)}`),g(t),c||a.assign(n,!0)}),(e=>{a.if(o._`!(${e} instanceof ${l.ValidationError})`,(()=>a.throw(e))),p(e),c||a.assign(n,!1)})),e.ok(n)}():e.result((0,i.callValidateCode)(e,t,f),(()=>g(t)),(()=>p(t)))}t.getValidate=c,t.callRef=d,t.default=l},5184:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4105),i=n(5930),o=n(8393),s=n(4648),a={keyword:"discriminator",type:"object",schemaType:"object",error:{message:e=>{let{params:{discrError:t,tagName:n}}=e;return t===i.DiscrError.Tag?`tag "${n}" must be string`:`value of tag "${n}" must be in oneOf`},params:e=>{let{params:{discrError:t,tag:n,tagName:i}}=e;return r._`{error: ${t}, tag: ${i}, tagValue: ${n}}`}},code(e){const{gen:t,data:n,schema:a,parentSchema:u,it:l}=e,{oneOf:c}=u;if(!l.opts.discriminator)throw new Error("discriminator: requires discriminator option");const d=a.propertyName;if("string"!=typeof d)throw new Error("discriminator: requires propertyName");if(a.mapping)throw new Error("discriminator: mapping is not supported");if(!c)throw new Error("discriminator: requires oneOf keyword");const h=t.let("valid",!1),f=t.const("tag",r._`${n}${(0,r.getProperty)(d)}`);function p(n){const i=t.name("valid"),o=e.subschema({keyword:"oneOf",schemaProp:n},i);return e.mergeEvaluated(o,r.Name),i}t.if(r._`typeof ${f} == "string"`,(()=>function(){const n=function(){var e;const t={},n=i(u);let r=!0;for(let u=0;ue.error(!1,{discrError:i.DiscrError.Tag,tag:f,tagName:d}))),e.ok(h)}};t.default=a},5930:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(n||(t.DiscrError=n={}))},1783:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(167),i=n(9110),o=n(7040),s=n(1502),a=n(884),u=[r.default,i.default,(0,o.default)(),s.default,a.metadataVocabulary,a.contentVocabulary];t.default=u},6616:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4105),i={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:e=>{let{schemaCode:t}=e;return r.str`must match format "${t}"`},params:e=>{let{schemaCode:t}=e;return r._`{format: ${t}}`}},code(e,t){const{gen:n,data:i,$data:o,schema:s,schemaCode:a,it:u}=e,{opts:l,errSchemaPath:c,schemaEnv:d,self:h}=u;l.validateFormats&&(o?function(){const o=n.scopeValue("formats",{ref:h.formats,code:l.code.formats}),s=n.const("fDef",r._`${o}[${a}]`),u=n.let("fType"),c=n.let("format");n.if(r._`typeof ${s} == "object" && !(${s} instanceof RegExp)`,(()=>n.assign(u,r._`${s}.type || "string"`).assign(c,r._`${s}.validate`)),(()=>n.assign(u,r._`"string"`).assign(c,s))),e.fail$data((0,r.or)(!1===l.strictSchema?r.nil:r._`${a} && !${c}`,function(){const e=d.$async?r._`(${s}.async ? await ${c}(${i}) : ${c}(${i}))`:r._`${c}(${i})`,n=r._`(typeof ${c} == "function" ? ${e} : ${c}.test(${i}))`;return r._`${c} && ${c} !== true && ${u} === ${t} && !${n}`}()))}():function(){const o=h.formats[s];if(!o)return void function(){if(!1===l.strictSchema)return void h.logger.warn(e());throw new Error(e());function e(){return`unknown format "${s}" ignored in schema at path "${c}"`}}();if(!0===o)return;const[a,u,f]=function(e){const t=e instanceof RegExp?(0,r.regexpCode)(e):l.code.formats?r._`${l.code.formats}${(0,r.getProperty)(s)}`:void 0,i=n.scopeValue("formats",{key:s,ref:e,code:t});if("object"==typeof e&&!(e instanceof RegExp))return[e.type||"string",e.validate,r._`${i}.validate`];return["string",e,i]}(o);a===t&&e.pass(function(){if("object"==typeof o&&!(o instanceof RegExp)&&o.async){if(!d.$async)throw new Error("async format in sync schema");return r._`await ${f}(${i})`}return"function"==typeof u?r._`${f}(${i})`:r._`${f}.test(${i})`}())}())}};t.default=i},1502:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=[n(6616).default];t.default=r},884:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},3605:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4105),i=n(4648),o=n(8089),s={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:e=>{let{schemaCode:t}=e;return r._`{allowedValue: ${t}}`}},code(e){const{gen:t,data:n,$data:s,schemaCode:a,schema:u}=e;s||u&&"object"==typeof u?e.fail$data(r._`!${(0,i.useFunc)(t,o.default)}(${n}, ${a})`):e.fail(r._`${u} !== ${n}`)}};t.default=s},9525:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4105),i=n(4648),o=n(8089),s={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:e=>{let{schemaCode:t}=e;return r._`{allowedValues: ${t}}`}},code(e){const{gen:t,data:n,$data:s,schema:a,schemaCode:u,it:l}=e;if(!s&&0===a.length)throw new Error("enum must have non-empty array");const c=a.length>=l.opts.loopEnum;let d;const h=()=>null!==d&&void 0!==d?d:d=(0,i.useFunc)(t,o.default);let f;if(c||s)f=t.let("valid"),e.block$data(f,(function(){t.assign(f,!1),t.forOf("v",u,(e=>t.if(r._`${h()}(${n}, ${e})`,(()=>t.assign(f,!0).break()))))}));else{if(!Array.isArray(a))throw new Error("ajv implementation error");const e=t.const("vSchema",u);f=(0,r.or)(...a.map(((t,i)=>function(e,t){const i=a[t];return"object"===typeof i&&null!==i?r._`${h()}(${n}, ${e}[${t}])`:r._`${n} === ${i}`}(e,i))))}e.pass(f)}};t.default=s},9110:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(6694),i=n(273),o=n(7254),s=n(2991),a=n(6245),u=n(6006),l=n(6755),c=n(7140),d=n(3605),h=n(9525),f=[r.default,i.default,o.default,s.default,a.default,u.default,l.default,c.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},d.default,h.default];t.default=f},6755:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4105),i={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message(e){let{keyword:t,schemaCode:n}=e;const i="maxItems"===t?"more":"fewer";return r.str`must NOT have ${i} than ${n} items`},params:e=>{let{schemaCode:t}=e;return r._`{limit: ${t}}`}},code(e){const{keyword:t,data:n,schemaCode:i}=e,o="maxItems"===t?r.operators.GT:r.operators.LT;e.fail$data(r._`${n}.length ${o} ${i}`)}};t.default=i},7254:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4105),i=n(4648),o=n(3759),s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message(e){let{keyword:t,schemaCode:n}=e;const i="maxLength"===t?"more":"fewer";return r.str`must NOT have ${i} than ${n} characters`},params:e=>{let{schemaCode:t}=e;return r._`{limit: ${t}}`}},code(e){const{keyword:t,data:n,schemaCode:s,it:a}=e,u="maxLength"===t?r.operators.GT:r.operators.LT,l=!1===a.opts.unicode?r._`${n}.length`:r._`${(0,i.useFunc)(e.gen,o.default)}(${n})`;e.fail$data(r._`${l} ${u} ${s}`)}};t.default=s},6694:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4105),i=r.operators,o={maximum:{okStr:"<=",ok:i.LTE,fail:i.GT},minimum:{okStr:">=",ok:i.GTE,fail:i.LT},exclusiveMaximum:{okStr:"<",ok:i.LT,fail:i.GTE},exclusiveMinimum:{okStr:">",ok:i.GT,fail:i.LTE}},s={message:e=>{let{keyword:t,schemaCode:n}=e;return r.str`must be ${o[t].okStr} ${n}`},params:e=>{let{keyword:t,schemaCode:n}=e;return r._`{comparison: ${o[t].okStr}, limit: ${n}}`}},a={keyword:Object.keys(o),type:"number",schemaType:"number",$data:!0,error:s,code(e){const{keyword:t,data:n,schemaCode:i}=e;e.fail$data(r._`${n} ${o[t].fail} ${i} || isNaN(${n})`)}};t.default=a},6245:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4105),i={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message(e){let{keyword:t,schemaCode:n}=e;const i="maxProperties"===t?"more":"fewer";return r.str`must NOT have ${i} than ${n} properties`},params:e=>{let{schemaCode:t}=e;return r._`{limit: ${t}}`}},code(e){const{keyword:t,data:n,schemaCode:i}=e,o="maxProperties"===t?r.operators.GT:r.operators.LT;e.fail$data(r._`Object.keys(${n}).length ${o} ${i}`)}};t.default=i},273:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4105),i={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:e=>{let{schemaCode:t}=e;return r.str`must be multiple of ${t}`},params:e=>{let{schemaCode:t}=e;return r._`{multipleOf: ${t}}`}},code(e){const{gen:t,data:n,schemaCode:i,it:o}=e,s=o.opts.multipleOfPrecision,a=t.let("res"),u=s?r._`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:r._`${a} !== parseInt(${a})`;e.fail$data(r._`(${i} === 0 || (${a} = ${n}/${i}, ${u}))`)}};t.default=i},2991:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1580),i=n(4105),o={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:e=>{let{schemaCode:t}=e;return i.str`must match pattern "${t}"`},params:e=>{let{schemaCode:t}=e;return i._`{pattern: ${t}}`}},code(e){const{data:t,$data:n,schema:o,schemaCode:s,it:a}=e,u=a.opts.unicodeRegExp?"u":"",l=n?i._`(new RegExp(${s}, ${u}))`:(0,r.usePattern)(e,o);e.fail$data(i._`!${l}.test(${t})`)}};t.default=o},6006:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1580),i=n(4105),o=n(4648),s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:e=>{let{params:{missingProperty:t}}=e;return i.str`must have required property '${t}'`},params:e=>{let{params:{missingProperty:t}}=e;return i._`{missingProperty: ${t}}`}},code(e){const{gen:t,schema:n,schemaCode:s,data:a,$data:u,it:l}=e,{opts:c}=l;if(!u&&0===n.length)return;const d=n.length>=c.loopRequired;if(l.allErrors?function(){if(d||u)e.block$data(i.nil,h);else for(const t of n)(0,r.checkReportMissingProp)(e,t)}():function(){const o=t.let("missing");if(d||u){const n=t.let("valid",!0);e.block$data(n,(()=>function(n,o){e.setParams({missingProperty:n}),t.forOf(n,s,(()=>{t.assign(o,(0,r.propertyInData)(t,a,n,c.ownProperties)),t.if((0,i.not)(o),(()=>{e.error(),t.break()}))}),i.nil)}(o,n))),e.ok(n)}else t.if((0,r.checkMissingProp)(e,n,o)),(0,r.reportMissingProp)(e,o),t.else()}(),c.strictRequired){const t=e.parentSchema.properties,{definedProperties:r}=e.it;for(const e of n)if(void 0===(null===t||void 0===t?void 0:t[e])&&!r.has(e)){const t=`required property "${e}" is not defined at "${l.schemaEnv.baseId+l.errSchemaPath}" (strictRequired)`;(0,o.checkStrictMode)(l,t,l.opts.strictRequired)}}function h(){t.forOf("prop",s,(n=>{e.setParams({missingProperty:n}),t.if((0,r.noPropertyInData)(t,a,n,c.ownProperties),(()=>e.error()))}))}}};t.default=s},7140:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2093),i=n(4105),o=n(4648),s=n(8089),a={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:e=>{let{params:{i:t,j:n}}=e;return i.str`must NOT have duplicate items (items ## ${n} and ${t} are identical)`},params:e=>{let{params:{i:t,j:n}}=e;return i._`{i: ${t}, j: ${n}}`}},code(e){const{gen:t,data:n,$data:a,schema:u,parentSchema:l,schemaCode:c,it:d}=e;if(!a&&!u)return;const h=t.let("valid"),f=l.items?(0,r.getSchemaTypes)(l.items):[];function p(o,s){const a=t.name("item"),u=(0,r.checkDataTypes)(f,a,d.opts.strictNumbers,r.DataType.Wrong),l=t.const("indices",i._`{}`);t.for(i._`;${o}--;`,(()=>{t.let(a,i._`${n}[${o}]`),t.if(u,i._`continue`),f.length>1&&t.if(i._`typeof ${a} == "string"`,i._`${a} += "_"`),t.if(i._`typeof ${l}[${a}] == "number"`,(()=>{t.assign(s,i._`${l}[${a}]`),e.error(),t.assign(h,!1).break()})).code(i._`${l}[${a}] = ${o}`)}))}function g(r,a){const u=(0,o.useFunc)(t,s.default),l=t.name("outer");t.label(l).for(i._`;${r}--;`,(()=>t.for(i._`${a} = ${r}; ${a}--;`,(()=>t.if(i._`${u}(${n}[${r}], ${n}[${a}])`,(()=>{e.error(),t.assign(h,!1).break(l)}))))))}e.block$data(h,(function(){const r=t.let("i",i._`${n}.length`),o=t.let("j");e.setParams({i:r,j:o}),t.assign(h,!0),t.if(i._`${r} > 1`,(()=>(f.length>0&&!f.some((e=>"object"===e||"array"===e))?p:g)(r,o)))}),i._`${c} === false`),e.ok(h)}};t.default=a},2009:(e,t)=>{"use strict";t.byteLength=function(e){var t=u(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,o=u(e),s=o[0],a=o[1],l=new i(function(e,t,n){return 3*(t+n)/4-n}(0,s,a)),c=0,d=a>0?s-4:s;for(n=0;n>16&255,l[c++]=t>>8&255,l[c++]=255&t;2===a&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,l[c++]=255&t);1===a&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t);return l},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],s=16383,a=0,u=r-i;au?u:a+s));1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return o.join("")};for(var n=[],r=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,r){for(var i,o,s=[],a=t;a>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},9778:(e,t,n)=>{"use strict";const r=n(2009),i=n(4038),o="function"===typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,n){if("number"===typeof e){if("string"===typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return l(e,t,n)}function l(e,t,n){if("string"===typeof e)return function(e,t){"string"===typeof t&&""!==t||(t="utf8");if(!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|g(e,t);let r=a(n);const i=r.write(e,t);i!==n&&(r=r.slice(0,i));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(G(e,Uint8Array)){const t=new Uint8Array(e);return f(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(G(e,ArrayBuffer)||e&&G(e.buffer,ArrayBuffer))return f(e,t,n);if("undefined"!==typeof SharedArrayBuffer&&(G(e,SharedArrayBuffer)||e&&G(e.buffer,SharedArrayBuffer)))return f(e,t,n);if("number"===typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return u.from(r,t,n);const i=function(e){if(u.isBuffer(e)){const t=0|p(e.length),n=a(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!==typeof e.length||J(e.length)?a(0):h(e);if("Buffer"===e.type&&Array.isArray(e.data))return h(e.data)}(e);if(i)return i;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!==typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return c(e),a(e<0?0:0|p(e))}function h(e){const t=e.length<0?0:0|p(e.length),n=a(t);for(let r=0;r=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function g(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||G(e,ArrayBuffer))return e.byteLength;if("string"!==typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return W(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return K(e).length;default:if(i)return r?-1:W(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,n);case"utf8":case"utf-8":return C(this,t,n);case"ascii":return T(this,t,n);case"latin1":case"binary":return A(this,t,n);case"base64":return k(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function y(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function v(e,t,n,r,i){if(0===e.length)return-1;if("string"===typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),J(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"===typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:w(e,t,n,r,i);if("number"===typeof t)return t&=255,"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):w(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function w(e,t,n,r,i){let o,s=1,a=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,n/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let r=-1;for(o=n;oa&&(n=a-u),o=n;o>=0;o--){let n=!0;for(let r=0;ri&&(r=i):r=i;const o=t.length;let s;for(r>o/2&&(r=o/2),s=0;s>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function k(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function C(e,t,n){n=Math.min(e.length,n);const r=[];let i=t;for(;i239?4:t>223?3:t>191?2:1;if(i+s<=n){let n,r,a,u;switch(s){case 1:t<128&&(o=t);break;case 2:n=e[i+1],128===(192&n)&&(u=(31&t)<<6|63&n,u>127&&(o=u));break;case 3:n=e[i+1],r=e[i+2],128===(192&n)&&128===(192&r)&&(u=(15&t)<<12|(63&n)<<6|63&r,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:n=e[i+1],r=e[i+2],a=e[i+3],128===(192&n)&&128===(192&r)&&128===(192&a)&&(u=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=s}return function(e){const t=e.length;if(t<=P)return String.fromCharCode.apply(String,e);let n="",r=0;for(;rr.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,i)}i+=t.length}return r},u.byteLength=g,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tn&&(e+=" ... "),""},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,n,r,i){if(G(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;let o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0);const a=Math.min(o,s),l=this.slice(r,i),c=e.slice(t,n);for(let u=0;u>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let o=!1;for(;;)switch(r){case"hex":return _(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":case"latin1":case"binary":return S(this,e,t,n);case"base64":return x(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const P=4096;function T(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;ir)&&(n=r);let i="";for(let o=t;on)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,n,r,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function R(e,t,n,r,i){z(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s,n}function F(e,t,n,r,i){z(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n+7]=o,o>>=8,e[n+6]=o,o>>=8,e[n+5]=o,o>>=8,e[n+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=s,s>>=8,e[n+2]=s,s>>=8,e[n+1]=s,s>>=8,e[n]=s,n+8}function M(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function N(e,t,n,r,o){return t=+t,n>>>=0,o||M(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function D(e,t,n,r,o){return t=+t,n>>>=0,o||M(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||j(e,t,this.length);let r=this[e],i=1,o=0;for(;++o>>=0,t>>>=0,n||j(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||j(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||j(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||j(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||j(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||j(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=Y((function(e){H(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||V(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(i)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||V(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<>>=0,t>>>=0,n||j(e,t,this.length);let r=this[e],i=1,o=0;for(;++o=i&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||j(e,t,this.length);let r=t,i=1,o=this[e+--r];for(;r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||j(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||j(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){e>>>=0,t||j(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||j(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||j(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=Y((function(e){H(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||V(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||V(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<>>=0,t||j(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||j(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||j(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||j(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){L(this,e,t,n,Math.pow(2,8*n)-1,0)}let i=1,o=0;for(this[t]=255&e;++o>>=0,n>>>=0,!r){L(this,e,t,n,Math.pow(2,8*n)-1,0)}let i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=Y((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return R(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=Y((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return F(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);L(this,e,t,n,r-1,-r)}let i=0,o=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);L(this,e,t,n,r-1,-r)}let i=n-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=Y((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return R(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=Y((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return F(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,n){return N(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return N(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return D(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return D(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"===typeof e)for(i=t;i=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function z(e,t,n,r,i,o){if(e>n||e3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(o+1)}${r}`:`>= -(2${r} ** ${8*(o+1)-1}${r}) and < 2 ** ${8*(o+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new U.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,n){H(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||V(t,e.length-(n+1))}(r,i,o)}function H(e,t){if("number"!==typeof e)throw new U.ERR_INVALID_ARG_TYPE(t,"number",e)}function V(e,t,n){if(Math.floor(e)!==e)throw H(e,n),new U.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new U.ERR_BUFFER_OUT_OF_BOUNDS;throw new U.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}$("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),$("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),$("ERR_OUT_OF_RANGE",(function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=B(String(n)):"bigint"===typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=B(i)),i+="n"),r+=` It must be ${t}. Received ${i}`,r}),RangeError);const q=/[^+/0-9A-Za-z-_]/g;function W(e,t){let n;t=t||1/0;const r=e.length;let i=null;const o=[];for(let s=0;s55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function K(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function Z(e,t,n,r){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function G(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!==e}const Q=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t}();function Y(e){return"undefined"===typeof BigInt?X:e}function X(){throw new Error("BigInt not supported")}},1694:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var e=[],t=0;t=t?e:""+Array(t+1-r.length).join(n)+e},v={s:y,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?"+":"-")+y(r,2,"0")+":"+y(i,2,"0")},m:function e(t,n){if(t.date()1)return e(s[0])}else{var a=t.name;_[a]=t,i=a}return!r&&i&&(w=i),i||!r&&w},x=function(e,t){if(b(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new k(n)},E=v;E.l=S,E.i=b,E.w=function(e,t){return x(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var k=function(){function m(e){this.$L=S(e.locale,null,!0),this.parse(e)}var y=m.prototype;return y.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(E.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(p);if(r){var i=r[2]-1||0,o=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},y.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},y.$utils=function(){return E},y.isValid=function(){return!(this.$d.toString()===f)},y.isSame=function(e,t){var n=x(e);return this.startOf(t)<=n&&n<=this.endOf(t)},y.isAfter=function(e,t){return x(e){"use strict";var t,n="object"===typeof Reflect?Reflect:null,r=n&&"function"===typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"===typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!==e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,o),r(n)}function o(){"function"===typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}g(e,t,o,{once:!0}),"error"!==t&&function(e,t,n){"function"===typeof e.on&&g(e,"error",t,n)}(e,i,{once:!0})}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!==typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function l(e,t,n,r){var i,o,s,l;if(a(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),s=o[t]),void 0===s)s=o[t]=n,++e._eventsCount;else if("function"===typeof s?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(i=u(e))>0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,l=c,console&&console.warn&&console.warn(l)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=c.bind(r);return i.listener=n,r.wrapFn=i,i}function h(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"===typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[e];if(void 0===u)return!1;if("function"===typeof u)r(u,this,t);else{var l=u.length,c=p(u,l);for(n=0;n=0;o--)if(n[o]===t||n[o].listener===t){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},2618:(e,t,n)=>{var r;!function(){"use strict";var i=!("undefined"===typeof window||!window.document||!window.document.createElement),o={canUseDOM:i,canUseWorkers:"undefined"!==typeof Worker,canUseEventListeners:i&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:i&&!!window.screen};void 0===(r=function(){return o}.call(t,n,t,e))||(e.exports=r)}()},1132:e=>{"use strict";var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"===typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},s=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return"undefined"===typeof r||t.call(e,r)},a=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},u=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,l,c,d=arguments[0],h=1,f=arguments.length,p=!1;for("boolean"===typeof d&&(p=d,d=arguments[1]||{},h=2),(null==d||"object"!==typeof d&&"function"!==typeof d)&&(d={});h{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;0!==i--;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;0!==i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!==i--;){var s=o[i];if(!e(t[s],n[s]))return!1}return!0}return t!==t&&n!==n}},2110:(e,t,n)=>{"use strict";var r=n(8309),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function u(e){return r.isMemo(e)?s:a[e.$$typeof]||i}a[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[r.Memo]=s;var l=Object.defineProperty,c=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(p){var i=f(n);i&&i!==p&&e(t,i,r)}var s=c(n);d&&(s=s.concat(d(n)));for(var a=u(t),g=u(n),m=0;m{"use strict";var n="function"===typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,o=n?Symbol.for("react.fragment"):60107,s=n?Symbol.for("react.strict_mode"):60108,a=n?Symbol.for("react.profiler"):60114,u=n?Symbol.for("react.provider"):60109,l=n?Symbol.for("react.context"):60110,c=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,h=n?Symbol.for("react.forward_ref"):60112,f=n?Symbol.for("react.suspense"):60113,p=n?Symbol.for("react.suspense_list"):60120,g=n?Symbol.for("react.memo"):60115,m=n?Symbol.for("react.lazy"):60116,y=n?Symbol.for("react.block"):60121,v=n?Symbol.for("react.fundamental"):60117,w=n?Symbol.for("react.responder"):60118,_=n?Symbol.for("react.scope"):60119;function b(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case c:case d:case o:case a:case s:case f:return e;default:switch(e=e&&e.$$typeof){case l:case h:case m:case g:case u:return e;default:return t}}case i:return t}}}function S(e){return b(e)===d}t.AsyncMode=c,t.ConcurrentMode=d,t.ContextConsumer=l,t.ContextProvider=u,t.Element=r,t.ForwardRef=h,t.Fragment=o,t.Lazy=m,t.Memo=g,t.Portal=i,t.Profiler=a,t.StrictMode=s,t.Suspense=f,t.isAsyncMode=function(e){return S(e)||b(e)===c},t.isConcurrentMode=S,t.isContextConsumer=function(e){return b(e)===l},t.isContextProvider=function(e){return b(e)===u},t.isElement=function(e){return"object"===typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return b(e)===h},t.isFragment=function(e){return b(e)===o},t.isLazy=function(e){return b(e)===m},t.isMemo=function(e){return b(e)===g},t.isPortal=function(e){return b(e)===i},t.isProfiler=function(e){return b(e)===a},t.isStrictMode=function(e){return b(e)===s},t.isSuspense=function(e){return b(e)===f},t.isValidElementType=function(e){return"string"===typeof e||"function"===typeof e||e===o||e===d||e===a||e===s||e===f||e===p||"object"===typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===g||e.$$typeof===u||e.$$typeof===l||e.$$typeof===h||e.$$typeof===v||e.$$typeof===w||e.$$typeof===_||e.$$typeof===y)},t.typeOf=b},8309:(e,t,n)=>{"use strict";e.exports=n(746)},4038:(e,t)=>{t.read=function(e,t,n,r,i){var o,s,a=8*i-r-1,u=(1<>1,c=-7,d=n?i-1:0,h=n?-1:1,f=e[t+d];for(d+=h,o=f&(1<<-c)-1,f>>=-c,c+=a;c>0;o=256*o+e[t+d],d+=h,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=r;c>0;s=256*s+e[t+d],d+=h,c-=8);if(0===o)o=1-l;else{if(o===u)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,r),o-=l}return(f?-1:1)*s*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var s,a,u,l=8*o-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+d>=1?h/u:h*Math.pow(2,1-d))*u>=2&&(s++,u/=2),s+d>=c?(a=0,s=c):s+d>=1?(a=(t*u-1)*Math.pow(2,i),s+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;e[n+f]=255&a,f+=p,a/=256,i-=8);for(s=s<0;e[n+f]=255&s,f+=p,s/=256,l-=8);e[n+f-p]|=128*g}},1065:e=>{var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,u=/^\s+|\s+$/g,l="";function c(e){return e?e.replace(u,l):l}e.exports=function(e,u){if("string"!==typeof e)throw new TypeError("First argument must be a string");if(!e)return[];u=u||{};var d=1,h=1;function f(e){var t=e.match(n);t&&(d+=t.length);var r=e.lastIndexOf("\n");h=~r?e.length-r:h+e.length}function p(){var e={line:d,column:h};return function(t){return t.position=new g(e),w(),t}}function g(e){this.start=e,this.end={line:d,column:h},this.source=u.source}g.prototype.content=e;var m=[];function y(t){var n=new Error(u.source+":"+d+":"+h+": "+t);if(n.reason=t,n.filename=u.source,n.line=d,n.column=h,n.source=e,!u.silent)throw n;m.push(n)}function v(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function w(){v(r)}function _(e){var t;for(e=e||[];t=b();)!1!==t&&e.push(t);return e}function b(){var t=p();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;l!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,l===e.charAt(n-1))return y("End of comment missing");var r=e.slice(2,n-2);return h+=2,f(r),e=e.slice(n),h+=2,t({type:"comment",comment:r})}}function S(){var e=p(),n=v(i);if(n){if(b(),!v(o))return y("property missing ':'");var r=v(s),u=e({type:"declaration",property:c(n[0].replace(t,l)),value:r?c(r[0].replace(t,l)):l});return v(a),u}}return w(),function(){var e,t=[];for(_(t);e=S();)!1!==e&&(t.push(e),_(t));return t}()}},7204:e=>{"use strict";var t=e.exports=function(e,t,r){"function"==typeof t&&(r=t,t={}),n(t,"function"==typeof(r=t.cb||r)?r:r.pre||function(){},r.post||function(){},e,"",e)};function n(e,r,i,o,s,a,u,l,c,d){if(o&&"object"==typeof o&&!Array.isArray(o)){for(var h in r(o,s,a,u,l,c,d),o){var f=o[h];if(Array.isArray(f)){if(h in t.arrayKeywords)for(var p=0;p{var r,i,o;!function(s,a){i=[n(8559)],void 0===(o="function"===typeof(r=s)?r.apply(t,i):r)||(e.exports=o),"undefined"!==typeof a&&a.L&&(a.L.Control.Locate=s(L))}((function(e){const t=(t,n,r)=>{(r=r.split(" ")).forEach((function(r){e.DomUtil[t].call(this,n,r)}))},n=(e,n)=>t("addClass",e,n),r=(e,n)=>t("removeClass",e,n),i=e.Marker.extend({initialize(t,n){e.Util.setOptions(this,n),this._latlng=t,this.createIcon()},createIcon(){const t=this.options;let n="";void 0!==t.color&&(n+=`stroke:${t.color};`),void 0!==t.weight&&(n+=`stroke-width:${t.weight};`),void 0!==t.fillColor&&(n+=`fill:${t.fillColor};`),void 0!==t.fillOpacity&&(n+=`fill-opacity:${t.fillOpacity};`),void 0!==t.opacity&&(n+=`opacity:${t.opacity};`);const r=this._getIconSVG(t,n);this._locationIcon=e.divIcon({className:r.className,html:r.svg,iconSize:[r.w,r.h]}),this.setIcon(this._locationIcon)},_getIconSVG(e,t){const n=e.radius,r=n+e.weight,i=2*r;return{className:"leaflet-control-locate-location",svg:`',w:i,h:i}},setStyle(t){e.Util.setOptions(this,t),this.createIcon()}}),o=i.extend({initialize(t,n,r){e.Util.setOptions(this,r),this._latlng=t,this._heading=n,this.createIcon()},setHeading(e){this._heading=e},_getIconSVG(e,t){const n=e.radius,r=e.width+e.weight,i=2*(n+e.depth+e.weight),o=`M0,0 l${e.width/2},${e.depth} l-${r},0 z`;return{className:"leaflet-control-locate-heading",svg:`',w:r,h:i}}}),s=e.Control.extend({options:{position:"topleft",layer:void 0,setView:"untilPanOrZoom",keepCurrentZoomLevel:!1,initialZoomLevel:!1,getLocationBounds:e=>e.bounds,flyTo:!1,clickBehavior:{inView:"stop",outOfView:"setView",inViewNotFollowing:"inView"},returnToPrevBounds:!1,cacheLocation:!0,drawCircle:!0,drawMarker:!0,showCompass:!0,markerClass:i,compassClass:o,circleStyle:{className:"leaflet-control-locate-circle",color:"#136AEC",fillColor:"#136AEC",fillOpacity:.15,weight:0},markerStyle:{className:"leaflet-control-locate-marker",color:"#fff",fillColor:"#2A93EE",fillOpacity:1,weight:3,opacity:1,radius:9},compassStyle:{fillColor:"#2A93EE",fillOpacity:1,weight:0,color:"#fff",opacity:1,radius:9,width:9,depth:6},followCircleStyle:{},followMarkerStyle:{},followCompassStyle:{},icon:"leaflet-control-locate-location-arrow",iconLoading:"leaflet-control-locate-spinner",iconElementTag:"span",textElementTag:"small",circlePadding:[0,0],metric:!0,createButtonCallback(t,n){const r=e.DomUtil.create("a","leaflet-bar-part leaflet-bar-part-single",t);r.title=n.strings.title,r.href="#",r.setAttribute("role","button");const i=e.DomUtil.create(n.iconElementTag,n.icon,r);if(void 0!==n.strings.text){e.DomUtil.create(n.textElementTag,"leaflet-locate-text",r).textContent=n.strings.text,r.classList.add("leaflet-locate-text-active"),r.parentNode.style.display="flex",n.icon.length>0&&i.classList.add("leaflet-locate-icon")}return{link:r,icon:i}},onLocationError(e,t){alert(e.message)},onLocationOutsideMapBounds(e){e.stop(),alert(e.options.strings.outsideMapBoundsMsg)},showPopup:!0,strings:{title:"Show me where I am",metersUnit:"meters",feetUnit:"feet",popup:"You are within {distance} {unit} from this point",outsideMapBoundsMsg:"You seem located outside the boundaries of the map"},locateOptions:{maxZoom:1/0,watch:!0,setView:!1}},initialize(t){for(const n in t)"object"===typeof this.options[n]?e.extend(this.options[n],t[n]):this.options[n]=t[n];this.options.followMarkerStyle=e.extend({},this.options.markerStyle,this.options.followMarkerStyle),this.options.followCircleStyle=e.extend({},this.options.circleStyle,this.options.followCircleStyle),this.options.followCompassStyle=e.extend({},this.options.compassStyle,this.options.followCompassStyle)},onAdd(t){const n=e.DomUtil.create("div","leaflet-control-locate leaflet-bar leaflet-control");this._container=n,this._map=t,this._layer=this.options.layer||new e.LayerGroup,this._layer.addTo(t),this._event=void 0,this._compassHeading=null,this._prevBounds=null;const r=this.options.createButtonCallback(n,this.options);return this._link=r.link,this._icon=r.icon,e.DomEvent.on(this._link,"click",(function(t){e.DomEvent.stopPropagation(t),e.DomEvent.preventDefault(t),this._onClick()}),this).on(this._link,"dblclick",e.DomEvent.stopPropagation),this._resetVariables(),this._map.on("unload",this._unload,this),n},_onClick(){this._justClicked=!0;const e=this._isFollowing();if(this._userPanned=!1,this._userZoomed=!1,this._active&&!this._event)this.stop();else if(this._active){const t=this.options.clickBehavior;let n=t.outOfView;switch(this._map.getBounds().contains(this._event.latlng)&&(n=e?t.inView:t.inViewNotFollowing),t[n]&&(n=t[n]),n){case"setView":this.setView();break;case"stop":if(this.stop(),this.options.returnToPrevBounds){(this.options.flyTo?this._map.flyToBounds:this._map.fitBounds).bind(this._map)(this._prevBounds)}}}else this.options.returnToPrevBounds&&(this._prevBounds=this._map.getBounds()),this.start();this._updateContainerStyle()},start(){this._activate(),this._event&&(this._drawMarker(this._map),this.options.setView&&this.setView()),this._updateContainerStyle()},stop(){this._deactivate(),this._cleanClasses(),this._resetVariables(),this._removeMarker()},stopFollowing(){this._userPanned=!0,this._updateContainerStyle(),this._drawMarker()},_activate(){if(!this._active&&this._map&&(this._map.locate(this.options.locateOptions),this._map.fire("locateactivate",this),this._active=!0,this._map.on("locationfound",this._onLocationFound,this),this._map.on("locationerror",this._onLocationError,this),this._map.on("dragstart",this._onDrag,this),this._map.on("zoomstart",this._onZoom,this),this._map.on("zoomend",this._onZoomEnd,this),this.options.showCompass)){const t="ondeviceorientationabsolute"in window;if(t||"ondeviceorientation"in window){const n=this,r=function(){e.DomEvent.on(window,t?"deviceorientationabsolute":"deviceorientation",n._onDeviceOrientation,n)};DeviceOrientationEvent&&"function"===typeof DeviceOrientationEvent.requestPermission?DeviceOrientationEvent.requestPermission().then((function(e){"granted"===e&&r()})):r()}}},_deactivate(){this._active&&this._map&&(this._map.stopLocate(),this._map.fire("locatedeactivate",this),this._active=!1,this.options.cacheLocation||(this._event=void 0),this._map.off("locationfound",this._onLocationFound,this),this._map.off("locationerror",this._onLocationError,this),this._map.off("dragstart",this._onDrag,this),this._map.off("zoomstart",this._onZoom,this),this._map.off("zoomend",this._onZoomEnd,this),this.options.showCompass&&(this._compassHeading=null,"ondeviceorientationabsolute"in window?e.DomEvent.off(window,"deviceorientationabsolute",this._onDeviceOrientation,this):"ondeviceorientation"in window&&e.DomEvent.off(window,"deviceorientation",this._onDeviceOrientation,this)))},setView(){if(this._drawMarker(),this._isOutsideMapBounds())this._event=void 0,this.options.onLocationOutsideMapBounds(this);else if(this._justClicked&&!1!==this.options.initialZoomLevel)(t=this.options.flyTo?this._map.flyTo:this._map.setView).bind(this._map)([this._event.latitude,this._event.longitude],this.options.initialZoomLevel);else if(this.options.keepCurrentZoomLevel){(t=this.options.flyTo?this._map.flyTo:this._map.panTo).bind(this._map)([this._event.latitude,this._event.longitude])}else{var t=this.options.flyTo?this._map.flyToBounds:this._map.fitBounds;this._ignoreEvent=!0,t.bind(this._map)(this.options.getLocationBounds(this._event),{padding:this.options.circlePadding,maxZoom:this.options.initialZoomLevel||this.options.locateOptions.maxZoom}),e.Util.requestAnimFrame((function(){this._ignoreEvent=!1}),this)}},_drawCompass(){if(!this._event)return;const e=this._event.latlng;if(this.options.showCompass&&e&&null!==this._compassHeading){const t=this._isFollowing()?this.options.followCompassStyle:this.options.compassStyle;this._compass?(this._compass.setLatLng(e),this._compass.setHeading(this._compassHeading),this._compass.setStyle&&this._compass.setStyle(t)):this._compass=new this.options.compassClass(e,this._compassHeading,t).addTo(this._layer)}!this._compass||this.options.showCompass&&null!==this._compassHeading||(this._compass.removeFrom(this._layer),this._compass=null)},_drawMarker(){void 0===this._event.accuracy&&(this._event.accuracy=0);const t=this._event.accuracy,n=this._event.latlng;if(this.options.drawCircle){const r=this._isFollowing()?this.options.followCircleStyle:this.options.circleStyle;this._circle?this._circle.setLatLng(n).setRadius(t).setStyle(r):this._circle=e.circle(n,t,r).addTo(this._layer)}let r,i;if(this.options.metric?(r=t.toFixed(0),i=this.options.strings.metersUnit):(r=(3.2808399*t).toFixed(0),i=this.options.strings.feetUnit),this.options.drawMarker){const e=this._isFollowing()?this.options.followMarkerStyle:this.options.markerStyle;this._marker?(this._marker.setLatLng(n),this._marker.setStyle&&this._marker.setStyle(e)):this._marker=new this.options.markerClass(n,e).addTo(this._layer)}this._drawCompass();const o=this.options.strings.popup;function s(){return"string"===typeof o?e.Util.template(o,{distance:r,unit:i}):"function"===typeof o?o({distance:r,unit:i}):o}this.options.showPopup&&o&&this._marker&&this._marker.bindPopup(s())._popup.setLatLng(n),this.options.showPopup&&o&&this._compass&&this._compass.bindPopup(s())._popup.setLatLng(n)},_removeMarker(){this._layer.clearLayers(),this._marker=void 0,this._circle=void 0},_unload(){this.stop(),this._map.off("unload",this._unload,this)},_setCompassHeading(t){!isNaN(parseFloat(t))&&isFinite(t)?(t=Math.round(t),this._compassHeading=t,e.Util.requestAnimFrame(this._drawCompass,this)):this._compassHeading=null},_onCompassNeedsCalibration(){this._setCompassHeading()},_onDeviceOrientation(e){this._active&&(e.webkitCompassHeading?this._setCompassHeading(e.webkitCompassHeading):e.absolute&&e.alpha&&this._setCompassHeading(360-e.alpha))},_onLocationError(e){3==e.code&&this.options.locateOptions.watch||(this.stop(),this.options.onLocationError(e,this))},_onLocationFound(e){if((!this._event||this._event.latlng.lat!==e.latlng.lat||this._event.latlng.lng!==e.latlng.lng||this._event.accuracy!==e.accuracy)&&this._active){switch(this._event=e,this._drawMarker(),this._updateContainerStyle(),this.options.setView){case"once":this._justClicked&&this.setView();break;case"untilPan":this._userPanned||this.setView();break;case"untilPanOrZoom":this._userPanned||this._userZoomed||this.setView();break;case"always":this.setView()}this._justClicked=!1}},_onDrag(){this._event&&!this._ignoreEvent&&(this._userPanned=!0,this._updateContainerStyle(),this._drawMarker())},_onZoom(){this._event&&!this._ignoreEvent&&(this._userZoomed=!0,this._updateContainerStyle(),this._drawMarker())},_onZoomEnd(){this._event&&this._drawCompass(),this._event&&!this._ignoreEvent&&this._marker&&!this._map.getBounds().pad(-.3).contains(this._marker.getLatLng())&&(this._userPanned=!0,this._updateContainerStyle(),this._drawMarker())},_isFollowing(){return!!this._active&&("always"===this.options.setView||("untilPan"===this.options.setView?!this._userPanned:"untilPanOrZoom"===this.options.setView?!this._userPanned&&!this._userZoomed:void 0))},_isOutsideMapBounds(){return void 0!==this._event&&(this._map.options.maxBounds&&!this._map.options.maxBounds.contains(this._event.latlng))},_updateContainerStyle(){this._container&&(this._active&&!this._event?this._setClasses("requesting"):this._isFollowing()?this._setClasses("following"):this._active?this._setClasses("active"):this._cleanClasses())},_setClasses(e){"requesting"==e?(r(this._container,"active following"),n(this._container,"requesting"),r(this._icon,this.options.icon),n(this._icon,this.options.iconLoading)):"active"==e?(r(this._container,"requesting following"),n(this._container,"active"),r(this._icon,this.options.iconLoading),n(this._icon,this.options.icon)):"following"==e&&(r(this._container,"requesting"),n(this._container,"active following"),r(this._icon,this.options.iconLoading),n(this._icon,this.options.icon))},_cleanClasses(){e.DomUtil.removeClass(this._container,"requesting"),e.DomUtil.removeClass(this._container,"active"),e.DomUtil.removeClass(this._container,"following"),r(this._icon,this.options.iconLoading),n(this._icon,this.options.icon)},_resetVariables(){this._active=!1,this._justClicked=!1,this._userPanned=!1,this._userZoomed=!1}});return e.control.locate=t=>new e.Control.Locate(t),s}),window)},6986:function(e,t){!function(e){"use strict";var t=L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,clusterPane:L.Marker.prototype.options.pane,spiderfyOnEveryZoom:!1,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyShapePositions:null,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:"#222",opacity:.5},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{}},initialize:function(e){L.Util.setOptions(this,e),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this._featureGroup=L.featureGroup(),this._featureGroup.addEventParent(this),this._nonPointGroup=L.featureGroup(),this._nonPointGroup.addEventParent(this),this._inZoomAnimation=0,this._needsClustering=[],this._needsRemoving=[],this._currentShownBounds=null,this._queue=[],this._childMarkerEventHandlers={dragstart:this._childMarkerDragStart,move:this._childMarkerMoved,dragend:this._childMarkerDragEnd};var t=L.DomUtil.TRANSITION&&this.options.animate;L.extend(this,t?this._withAnimation:this._noAnimation),this._markerCluster=t?L.MarkerCluster:L.MarkerClusterNonAnimated},addLayer:function(e){if(e instanceof L.LayerGroup)return this.addLayers([e]);if(!e.getLatLng)return this._nonPointGroup.addLayer(e),this.fire("layeradd",{layer:e}),this;if(!this._map)return this._needsClustering.push(e),this.fire("layeradd",{layer:e}),this;if(this.hasLayer(e))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(e,this._maxZoom),this.fire("layeradd",{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();var t=e,n=this._zoom;if(e.__parent)for(;t.__parent._zoom>=n;)t=t.__parent;return this._currentShownBounds.contains(t.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(e,t):this._animationAddLayerNonAnimated(e,t)),this},removeLayer:function(e){return e instanceof L.LayerGroup?this.removeLayers([e]):e.getLatLng?this._map?e.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(e)),this._removeLayer(e,!0),this.fire("layerremove",{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),e.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(e)&&(this._featureGroup.removeLayer(e),e.clusterShow&&e.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,e)&&this.hasLayer(e)&&this._needsRemoving.push({layer:e,latlng:e._latlng}),this.fire("layerremove",{layer:e}),this):(this._nonPointGroup.removeLayer(e),this.fire("layerremove",{layer:e}),this)},addLayers:function(e,t){if(!L.Util.isArray(e))return this.addLayer(e);var n,r=this._featureGroup,i=this._nonPointGroup,o=this.options.chunkedLoading,s=this.options.chunkInterval,a=this.options.chunkProgress,u=e.length,l=0,c=!0;if(this._map){var d=(new Date).getTime(),h=L.bind((function(){var f=(new Date).getTime();for(this._map&&this._unspiderfy&&this._unspiderfy();ls);l++)if((n=e[l])instanceof L.LayerGroup)c&&(e=e.slice(),c=!1),this._extractNonGroupLayers(n,e),u=e.length;else if(n.getLatLng){if(!this.hasLayer(n)&&(this._addLayer(n,this._maxZoom),t||this.fire("layeradd",{layer:n}),n.__parent&&2===n.__parent.getChildCount())){var p=n.__parent.getAllChildMarkers(),g=p[0]===n?p[1]:p[0];r.removeLayer(g)}}else i.addLayer(n),t||this.fire("layeradd",{layer:n});a&&a(l,u,(new Date).getTime()-d),l===u?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(h,this.options.chunkDelay)}),this);h()}else for(var f=this._needsClustering;l=0;t--)e.extend(this._needsClustering[t].getLatLng());return e.extend(this._nonPointGroup.getBounds()),e},eachLayer:function(e,t){var n,r,i,o=this._needsClustering.slice(),s=this._needsRemoving;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(o),r=o.length-1;r>=0;r--){for(n=!0,i=s.length-1;i>=0;i--)if(s[i].layer===o[r]){n=!1;break}n&&e.call(t,o[r])}this._nonPointGroup.eachLayer(e,t)},getLayers:function(){var e=[];return this.eachLayer((function(t){e.push(t)})),e},getLayer:function(e){var t=null;return e=parseInt(e,10),this.eachLayer((function(n){L.stamp(n)===e&&(t=n)})),t},hasLayer:function(e){if(!e)return!1;var t,n=this._needsClustering;for(t=n.length-1;t>=0;t--)if(n[t]===e)return!0;for(t=(n=this._needsRemoving).length-1;t>=0;t--)if(n[t].layer===e)return!1;return!(!e.__parent||e.__parent._group!==this)||this._nonPointGroup.hasLayer(e)},zoomToShowLayer:function(e,t){var n=this._map;"function"!==typeof t&&(t=function(){});var r=function(){!n.hasLayer(e)&&!n.hasLayer(e.__parent)||this._inZoomAnimation||(this._map.off("moveend",r,this),this.off("animationend",r,this),n.hasLayer(e)?t():e.__parent._icon&&(this.once("spiderfied",t,this),e.__parent.spiderfy()))};e._icon&&this._map.getBounds().contains(e.getLatLng())?t():e.__parent._zoom=0;n--)if(e[n]===t)return e.splice(n,1),!0},_removeFromGridUnclustered:function(e,t){for(var n=this._map,r=this._gridUnclustered,i=Math.floor(this._map.getMinZoom());t>=i&&r[t].removeObject(e,n.project(e.getLatLng(),t));t--);},_childMarkerDragStart:function(e){e.target.__dragStart=e.target._latlng},_childMarkerMoved:function(e){if(!this._ignoreMove&&!e.target.__dragStart){var t=e.target._popup&&e.target._popup.isOpen();this._moveChild(e.target,e.oldLatLng,e.latlng),t&&e.target.openPopup()}},_moveChild:function(e,t,n){e._latlng=t,this.removeLayer(e),e._latlng=n,this.addLayer(e)},_childMarkerDragEnd:function(e){var t=e.target.__dragStart;delete e.target.__dragStart,t&&this._moveChild(e.target,t,e.target._latlng)},_removeLayer:function(e,t,n){var r=this._gridClusters,i=this._gridUnclustered,o=this._featureGroup,s=this._map,a=Math.floor(this._map.getMinZoom());t&&this._removeFromGridUnclustered(e,this._maxZoom);var u,l=e.__parent,c=l._markers;for(this._arraySplice(c,e);l&&(l._childCount--,l._boundsNeedUpdate=!0,!(l._zoom"+t+"",className:"marker-cluster"+n,iconSize:new L.Point(40,40)})},_bindEvents:function(){var e=this._map,t=this.options.spiderfyOnMaxZoom,n=this.options.showCoverageOnHover,r=this.options.zoomToBoundsOnClick,i=this.options.spiderfyOnEveryZoom;(t||r||i)&&this.on("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),n&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),e.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy:function(e){var t=e.layer,n=t;if("clusterkeypress"!==e.type||!e.originalEvent||13===e.originalEvent.keyCode){for(;1===n._childClusters.length;)n=n._childClusters[0];n._zoom===this._maxZoom&&n._childCount===t._childCount&&this.options.spiderfyOnMaxZoom?t.spiderfy():this.options.zoomToBoundsOnClick&&t.zoomToBounds(),this.options.spiderfyOnEveryZoom&&t.spiderfy(),e.originalEvent&&13===e.originalEvent.keyCode&&this._map._container.focus()}},_showCoverage:function(e){var t=this._map;this._inZoomAnimation||(this._shownPolygon&&t.removeLayer(this._shownPolygon),e.layer.getChildCount()>2&&e.layer!==this._spiderfied&&(this._shownPolygon=new L.Polygon(e.layer.getConvexHull(),this.options.polygonOptions),t.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents:function(){var e=this.options.spiderfyOnMaxZoom,t=this.options.showCoverageOnHover,n=this.options.zoomToBoundsOnClick,r=this.options.spiderfyOnEveryZoom,i=this._map;(e||n||r)&&this.off("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),t&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),i.off("zoomend",this._hideCoverage,this))},_zoomEnd:function(){this._map&&(this._mergeSplitClusters(),this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(!this._inZoomAnimation){var e=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,e),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),e),this._currentShownBounds=e}},_generateInitialClusters:function(){var e=Math.ceil(this._map.getMaxZoom()),t=Math.floor(this._map.getMinZoom()),n=this.options.maxClusterRadius,r=n;"function"!==typeof n&&(r=function(){return n}),null!==this.options.disableClusteringAtZoom&&(e=this.options.disableClusteringAtZoom-1),this._maxZoom=e,this._gridClusters={},this._gridUnclustered={};for(var i=e;i>=t;i--)this._gridClusters[i]=new L.DistanceGrid(r(i)),this._gridUnclustered[i]=new L.DistanceGrid(r(i));this._topClusterLevel=new this._markerCluster(this,t-1)},_addLayer:function(e,t){var n,r,i=this._gridClusters,o=this._gridUnclustered,s=Math.floor(this._map.getMinZoom());for(this.options.singleMarkerMode&&this._overrideMarkerIcon(e),e.on(this._childMarkerEventHandlers,this);t>=s;t--){n=this._map.project(e.getLatLng(),t);var a=i[t].getNearObject(n);if(a)return a._addChild(e),void(e.__parent=a);if(a=o[t].getNearObject(n)){var u=a.__parent;u&&this._removeLayer(a,!1);var l=new this._markerCluster(this,t,a,e);i[t].addObject(l,this._map.project(l._cLatLng,t)),a.__parent=l,e.__parent=l;var c=l;for(r=t-1;r>u._zoom;r--)c=new this._markerCluster(this,r,c),i[r].addObject(c,this._map.project(a.getLatLng(),r));return u._addChild(c),void this._removeFromGridUnclustered(a,t)}o[t].addObject(e,n)}this._topClusterLevel._addChild(e),e.__parent=this._topClusterLevel},_refreshClustersIcons:function(){this._featureGroup.eachLayer((function(e){e instanceof L.MarkerCluster&&e._iconNeedsUpdate&&e._updateIcon()}))},_enqueue:function(e){this._queue.push(e),this._queueTimeout||(this._queueTimeout=setTimeout(L.bind(this._processQueue,this),300))},_processQueue:function(){for(var e=0;ee?(this._animationStart(),this._animationZoomOut(this._zoom,e)):this._moveEnd()},_getExpandedVisibleBounds:function(){return this.options.removeOutsideVisibleBounds?L.Browser.mobile?this._checkBoundsMaxLat(this._map.getBounds()):this._checkBoundsMaxLat(this._map.getBounds().pad(1)):this._mapBoundsInfinite},_checkBoundsMaxLat:function(e){var t=this._maxLat;return void 0!==t&&(e.getNorth()>=t&&(e._northEast.lat=1/0),e.getSouth()<=-t&&(e._southWest.lat=-1/0)),e},_animationAddLayerNonAnimated:function(e,t){if(t===e)this._featureGroup.addLayer(e);else if(2===t._childCount){t._addToMap();var n=t.getAllChildMarkers();this._featureGroup.removeLayer(n[0]),this._featureGroup.removeLayer(n[1])}else t._updateIcon()},_extractNonGroupLayers:function(e,t){var n,r=e.getLayers(),i=0;for(t=t||[];i=0;n--)s=u[n],r.contains(s._latlng)||i.removeLayer(s)})),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(r,t),i.eachLayer((function(e){e instanceof L.MarkerCluster||!e._icon||e.clusterShow()})),this._topClusterLevel._recursively(r,e,t,(function(e){e._recursivelyRestoreChildPositions(t)})),this._ignoreMove=!1,this._enqueue((function(){this._topClusterLevel._recursively(r,e,o,(function(e){i.removeLayer(e),e.clusterShow()})),this._animationEnd()}))},_animationZoomOut:function(e,t){this._animationZoomOutSingle(this._topClusterLevel,e-1,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e,this._getExpandedVisibleBounds())},_animationAddLayer:function(e,t){var n=this,r=this._featureGroup;r.addLayer(e),t!==e&&(t._childCount>2?(t._updateIcon(),this._forceLayout(),this._animationStart(),e._setPos(this._map.latLngToLayerPoint(t.getLatLng())),e.clusterHide(),this._enqueue((function(){r.removeLayer(e),e.clusterShow(),n._animationEnd()}))):(this._forceLayout(),n._animationStart(),n._animationZoomOutSingle(t,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle:function(e,t,n){var r=this._getExpandedVisibleBounds(),i=Math.floor(this._map.getMinZoom());e._recursivelyAnimateChildrenInAndAddSelfToMap(r,i,t+1,n);var o=this;this._forceLayout(),e._recursivelyBecomeVisible(r,n),this._enqueue((function(){if(1===e._childCount){var s=e._markers[0];this._ignoreMove=!0,s.setLatLng(s.getLatLng()),this._ignoreMove=!1,s.clusterShow&&s.clusterShow()}else e._recursively(r,n,i,(function(e){e._recursivelyRemoveChildrenFromMap(r,i,t+1)}));o._animationEnd()}))},_animationEnd:function(){this._map&&(this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim","")),this._inZoomAnimation--,this.fire("animationend")},_forceLayout:function(){L.Util.falseFn(document.body.offsetWidth)}}),L.markerClusterGroup=function(e){return new L.MarkerClusterGroup(e)};var n=L.MarkerCluster=L.Marker.extend({options:L.Icon.prototype.options,initialize:function(e,t,n,r){L.Marker.prototype.initialize.call(this,n?n._cLatLng||n.getLatLng():new L.LatLng(0,0),{icon:this,pane:e.options.clusterPane}),this._group=e,this._zoom=t,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new L.LatLngBounds,n&&this._addChild(n),r&&this._addChild(r)},getAllChildMarkers:function(e,t){e=e||[];for(var n=this._childClusters.length-1;n>=0;n--)this._childClusters[n].getAllChildMarkers(e,t);for(var r=this._markers.length-1;r>=0;r--)t&&this._markers[r].__dragStart||e.push(this._markers[r]);return e},getChildCount:function(){return this._childCount},zoomToBounds:function(e){for(var t,n=this._childClusters.slice(),r=this._group._map,i=r.getBoundsZoom(this._bounds),o=this._zoom+1,s=r.getZoom();n.length>0&&i>o;){o++;var a=[];for(t=0;to?this._group._map.setView(this._latlng,o):i<=s?this._group._map.setView(this._latlng,s+1):this._group._map.fitBounds(this._bounds,e)},getBounds:function(){var e=new L.LatLngBounds;return e.extend(this._bounds),e},_updateIcon:function(){this._iconNeedsUpdate=!0,this._icon&&this.setIcon(this)},createIcon:function(){return this._iconNeedsUpdate&&(this._iconObj=this._group.options.iconCreateFunction(this),this._iconNeedsUpdate=!1),this._iconObj.createIcon()},createShadow:function(){return this._iconObj.createShadow()},_addChild:function(e,t){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(e),e instanceof L.MarkerCluster?(t||(this._childClusters.push(e),e.__parent=this),this._childCount+=e._childCount):(t||this._markers.push(e),this._childCount++),this.__parent&&this.__parent._addChild(e,!0)},_setClusterCenter:function(e){this._cLatLng||(this._cLatLng=e._cLatLng||e._latlng)},_resetBounds:function(){var e=this._bounds;e._southWest&&(e._southWest.lat=1/0,e._southWest.lng=1/0),e._northEast&&(e._northEast.lat=-1/0,e._northEast.lng=-1/0)},_recalculateBounds:function(){var e,t,n,r,i=this._markers,o=this._childClusters,s=0,a=0,u=this._childCount;if(0!==u){for(this._resetBounds(),e=0;e=0;n--)(r=i[n])._icon&&(r._setPos(t),r.clusterHide())}),(function(e){var n,r,i=e._childClusters;for(n=i.length-1;n>=0;n--)(r=i[n])._icon&&(r._setPos(t),r.clusterHide())}))},_recursivelyAnimateChildrenInAndAddSelfToMap:function(e,t,n,r){this._recursively(e,r,t,(function(i){i._recursivelyAnimateChildrenIn(e,i._group._map.latLngToLayerPoint(i.getLatLng()).round(),n),i._isSingleParent()&&n-1===r?(i.clusterShow(),i._recursivelyRemoveChildrenFromMap(e,t,n)):i.clusterHide(),i._addToMap()}))},_recursivelyBecomeVisible:function(e,t){this._recursively(e,this._group._map.getMinZoom(),t,null,(function(e){e.clusterShow()}))},_recursivelyAddChildrenToMap:function(e,t,n){this._recursively(n,this._group._map.getMinZoom()-1,t,(function(r){if(t!==r._zoom)for(var i=r._markers.length-1;i>=0;i--){var o=r._markers[i];n.contains(o._latlng)&&(e&&(o._backupLatlng=o.getLatLng(),o.setLatLng(e),o.clusterHide&&o.clusterHide()),r._group._featureGroup.addLayer(o))}}),(function(t){t._addToMap(e)}))},_recursivelyRestoreChildPositions:function(e){for(var t=this._markers.length-1;t>=0;t--){var n=this._markers[t];n._backupLatlng&&(n.setLatLng(n._backupLatlng),delete n._backupLatlng)}if(e-1===this._zoom)for(var r=this._childClusters.length-1;r>=0;r--)this._childClusters[r]._restorePosition();else for(var i=this._childClusters.length-1;i>=0;i--)this._childClusters[i]._recursivelyRestoreChildPositions(e)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(e,t,n,r){var i,o;this._recursively(e,t-1,n-1,(function(e){for(o=e._markers.length-1;o>=0;o--)i=e._markers[o],r&&r.contains(i._latlng)||(e._group._featureGroup.removeLayer(i),i.clusterShow&&i.clusterShow())}),(function(e){for(o=e._childClusters.length-1;o>=0;o--)i=e._childClusters[o],r&&r.contains(i._latlng)||(e._group._featureGroup.removeLayer(i),i.clusterShow&&i.clusterShow())}))},_recursively:function(e,t,n,r,i){var o,s,a=this._childClusters,u=this._zoom;if(t<=u&&(r&&r(this),i&&u===n&&i(this)),u=0;o--)(s=a[o])._boundsNeedUpdate&&s._recalculateBounds(),e.intersects(s._bounds)&&s._recursively(e,t,n,r,i)},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}});L.Marker.include({clusterHide:function(){var e=this.options.opacity;return this.setOpacity(0),this.options.opacity=e,this},clusterShow:function(){return this.setOpacity(this.options.opacity)}}),L.DistanceGrid=function(e){this._cellSize=e,this._sqCellSize=e*e,this._grid={},this._objectPoint={}},L.DistanceGrid.prototype={addObject:function(e,t){var n=this._getCoord(t.x),r=this._getCoord(t.y),i=this._grid,o=i[r]=i[r]||{},s=o[n]=o[n]||[],a=L.Util.stamp(e);this._objectPoint[a]=t,s.push(e)},updateObject:function(e,t){this.removeObject(e),this.addObject(e,t)},removeObject:function(e,t){var n,r,i=this._getCoord(t.x),o=this._getCoord(t.y),s=this._grid,a=s[o]=s[o]||{},u=a[i]=a[i]||[];for(delete this._objectPoint[L.Util.stamp(e)],n=0,r=u.length;n=0;n--)r=t[n],(i=this.getDistant(r,e))>0&&(a.push(r),i>o&&(o=i,s=r));return{maxPoint:s,newPoints:a}},buildConvexHull:function(e,t){var n=[],r=this.findMostDistantPointFromBaseLine(e,t);return r.maxPoint?n=(n=n.concat(this.buildConvexHull([e[0],r.maxPoint],r.newPoints))).concat(this.buildConvexHull([r.maxPoint,e[1]],r.newPoints)):[e[0]]},getConvexHull:function(e){var t,n=!1,r=!1,i=!1,o=!1,s=null,a=null,u=null,l=null,c=null,d=null;for(t=e.length-1;t>=0;t--){var h=e[t];(!1===n||h.lat>n)&&(s=h,n=h.lat),(!1===r||h.lati)&&(u=h,i=h.lng),(!1===o||h.lng=0;t--)e=n[t].getLatLng(),r.push(e);return L.QuickHull.getConvexHull(r)}}),L.MarkerCluster.include({_2PI:2*Math.PI,_circleFootSeparation:25,_circleStartAngle:0,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(this._group._spiderfied!==this&&!this._group._inZoomAnimation){var e,t=this.getAllChildMarkers(null,!0),n=this._group._map.latLngToLayerPoint(this._latlng);this._group._unspiderfy(),this._group._spiderfied=this,this._group.options.spiderfyShapePositions?e=this._group.options.spiderfyShapePositions(t.length,n):t.length>=this._circleSpiralSwitchover?e=this._generatePointsSpiral(t.length,n):(n.y+=10,e=this._generatePointsCircle(t.length,n)),this._animationSpiderfy(t,e)}},unspiderfy:function(e){this._group._inZoomAnimation||(this._animationUnspiderfy(e),this._group._spiderfied=null)},_generatePointsCircle:function(e,t){var n,r,i=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+e)/this._2PI,o=this._2PI/e,s=[];for(i=Math.max(i,35),s.length=e,n=0;n=0;n--)n=0;t--)e=o[t],i.removeLayer(e),e._preSpiderfyLatlng&&(e.setLatLng(e._preSpiderfyLatlng),delete e._preSpiderfyLatlng),e.setZIndexOffset&&e.setZIndexOffset(0),e._spiderLeg&&(r.removeLayer(e._spiderLeg),delete e._spiderLeg);n.fire("unspiderfied",{cluster:this,markers:o}),n._ignoreMove=!1,n._spiderfied=null}}),L.MarkerClusterNonAnimated=L.MarkerCluster.extend({_animationSpiderfy:function(e,t){var n,r,i,o,s=this._group,a=s._map,u=s._featureGroup,l=this._group.options.spiderLegPolylineOptions;for(s._ignoreMove=!0,n=0;n=0;n--)a=c.layerPointToLatLng(t[n]),(r=e[n])._preSpiderfyLatlng=r._latlng,r.setLatLng(a),r.clusterShow&&r.clusterShow(),p&&((o=(i=r._spiderLeg)._path).style.strokeDashoffset=0,i.setStyle({opacity:m}));this.setOpacity(.3),l._ignoreMove=!1,setTimeout((function(){l._animationEnd(),l.fire("spiderfied",{cluster:u,markers:e})}),200)},_animationUnspiderfy:function(e){var t,n,r,i,o,s,a=this,u=this._group,l=u._map,c=u._featureGroup,d=e?l._latLngToNewLayerPoint(this._latlng,e.zoom,e.center):l.latLngToLayerPoint(this._latlng),h=this.getAllChildMarkers(null,!0),f=L.Path.SVG;for(u._ignoreMove=!0,u._animationStart(),this.setOpacity(1),n=h.length-1;n>=0;n--)(t=h[n])._preSpiderfyLatlng&&(t.closePopup(),t.setLatLng(t._preSpiderfyLatlng),delete t._preSpiderfyLatlng,s=!0,t._setPos&&(t._setPos(d),s=!1),t.clusterHide&&(t.clusterHide(),s=!1),s&&c.removeLayer(t),f&&(o=(i=(r=t._spiderLeg)._path).getTotalLength()+.1,i.style.strokeDashoffset=o,r.setStyle({opacity:0})));u._ignoreMove=!1,setTimeout((function(){var e=0;for(n=h.length-1;n>=0;n--)(t=h[n])._spiderLeg&&e++;for(n=h.length-1;n>=0;n--)(t=h[n])._spiderLeg&&(t.clusterShow&&t.clusterShow(),t.setZIndexOffset&&t.setZIndexOffset(0),e>1&&c.removeLayer(t),l.removeLayer(t._spiderLeg),delete t._spiderLeg);u._animationEnd(),u.fire("unspiderfied",{cluster:a,markers:h})}),200)}}),L.MarkerClusterGroup.include({_spiderfied:null,unspiderfy:function(){this._unspiderfy.apply(this,arguments)},_spiderfierOnAdd:function(){this._map.on("click",this._unspiderfyWrapper,this),this._map.options.zoomAnimation&&this._map.on("zoomstart",this._unspiderfyZoomStart,this),this._map.on("zoomend",this._noanimationUnspiderfy,this),L.Browser.touch||this._map.getRenderer(this)},_spiderfierOnRemove:function(){this._map.off("click",this._unspiderfyWrapper,this),this._map.off("zoomstart",this._unspiderfyZoomStart,this),this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._map.off("zoomend",this._noanimationUnspiderfy,this),this._noanimationUnspiderfy()},_unspiderfyZoomStart:function(){this._map&&this._map.on("zoomanim",this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim:function(e){L.DomUtil.hasClass(this._map._mapPane,"leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(e))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(e){this._spiderfied&&this._spiderfied.unspiderfy(e)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(e){e._spiderLeg&&(this._featureGroup.removeLayer(e),e.clusterShow&&e.clusterShow(),e.setZIndexOffset&&e.setZIndexOffset(0),this._map.removeLayer(e._spiderLeg),delete e._spiderLeg)}}),L.MarkerClusterGroup.include({refreshClusters:function(e){return e?e instanceof L.MarkerClusterGroup?e=e._topClusterLevel.getAllChildMarkers():e instanceof L.LayerGroup?e=e._layers:e instanceof L.MarkerCluster?e=e.getAllChildMarkers():e instanceof L.Marker&&(e=[e]):e=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(e),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(e),this},_flagParentsIconsNeedUpdate:function(e){var t,n;for(t in e)for(n=e[t].__parent;n;)n._iconNeedsUpdate=!0,n=n.__parent},_refreshSingleMarkerModeMarkers:function(e){var t,n;for(t in e)n=e[t],this.hasLayer(n)&&n.setIcon(this._overrideMarkerIcon(n))}}),L.Marker.include({refreshIconOptions:function(e,t){var n=this.options.icon;return L.setOptions(n,e),this.setIcon(n),t&&this.__parent&&this.__parent._group.refreshClusters(this),this}}),e.MarkerClusterGroup=t,e.MarkerCluster=n,Object.defineProperty(e,"__esModule",{value:!0})}(t)},8559:function(e,t){!function(e){"use strict";var t="1.9.3";function n(e){var t,n,r,i;for(n=1,r=arguments.length;n0?Math.floor(e):Math.ceil(e)};function F(e,t,n){return e instanceof j?e:y(e)?new j(e[0],e[1]):void 0===e||null===e?e:"object"===typeof e&&"x"in e&&"y"in e?new j(e.x,e.y):new j(e,t,n)}function M(e,t){if(e)for(var n=t?[e,t]:e,r=0,i=n.length;r=this.min.x&&n.x<=this.max.x&&t.y>=this.min.y&&n.y<=this.max.y},intersects:function(e){e=N(e);var t=this.min,n=this.max,r=e.min,i=e.max,o=i.x>=t.x&&r.x<=n.x,s=i.y>=t.y&&r.y<=n.y;return o&&s},overlaps:function(e){e=N(e);var t=this.min,n=this.max,r=e.min,i=e.max,o=i.x>t.x&&r.xt.y&&r.y=r.lat&&n.lat<=i.lat&&t.lng>=r.lng&&n.lng<=i.lng},intersects:function(e){e=U(e);var t=this._southWest,n=this._northEast,r=e.getSouthWest(),i=e.getNorthEast(),o=i.lat>=t.lat&&r.lat<=n.lat,s=i.lng>=t.lng&&r.lng<=n.lng;return o&&s},overlaps:function(e){e=U(e);var t=this._southWest,n=this._northEast,r=e.getSouthWest(),i=e.getNorthEast(),o=i.lat>t.lat&&r.latt.lng&&r.lng1,Te=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassiveEventSupport",l,t),window.removeEventListener("testPassiveEventSupport",l,t)}catch(n){}return e}(),Ae=!!document.createElement("canvas").getContext,Oe=!(!document.createElementNS||!J("svg").createSVGRect),Ie=!!Oe&&function(){var e=document.createElement("div");return e.innerHTML="","http://www.w3.org/2000/svg"===(e.firstChild&&e.firstChild.namespaceURI)}(),je=!Oe&&function(){try{var e=document.createElement("div");e.innerHTML='';var t=e.firstChild;return t.style.behavior="url(#default#VML)",t&&"object"===typeof t.adj}catch(n){return!1}}(),Le=0===navigator.platform.indexOf("Mac"),Re=0===navigator.platform.indexOf("Linux");function Fe(e){return navigator.userAgent.toLowerCase().indexOf(e)>=0}var Me={ie:X,ielt9:ee,edge:te,webkit:ne,android:re,android23:ie,androidStock:se,opera:ae,chrome:ue,gecko:le,safari:ce,phantom:de,opera12:he,win:fe,ie3d:pe,webkit3d:ge,gecko3d:me,any3d:ye,mobile:ve,mobileWebkit:we,mobileWebkit3d:_e,msPointer:be,pointer:Se,touch:Ee,touchNative:xe,mobileOpera:ke,mobileGecko:Ce,retina:Pe,passiveEvents:Te,canvas:Ae,svg:Oe,vml:je,inlineSvg:Ie,mac:Le,linux:Re},Ne=Me.msPointer?"MSPointerDown":"pointerdown",De=Me.msPointer?"MSPointerMove":"pointermove",Ue=Me.msPointer?"MSPointerUp":"pointerup",$e=Me.msPointer?"MSPointerCancel":"pointercancel",Be={touchstart:Ne,touchmove:De,touchend:Ue,touchcancel:$e},ze={touchstart:Ye,touchmove:Qe,touchend:Qe,touchcancel:Qe},He={},Ve=!1;function qe(e,t,n){return"touchstart"===t&&Je(),ze[t]?(n=ze[t].bind(this,n),e.addEventListener(Be[t],n,!1),n):(console.warn("wrong event specified:",t),l)}function We(e,t,n){Be[t]?e.removeEventListener(Be[t],n,!1):console.warn("wrong event specified:",t)}function Ke(e){He[e.pointerId]=e}function Ze(e){He[e.pointerId]&&(He[e.pointerId]=e)}function Ge(e){delete He[e.pointerId]}function Je(){Ve||(document.addEventListener(Ne,Ke,!0),document.addEventListener(De,Ze,!0),document.addEventListener(Ue,Ge,!0),document.addEventListener($e,Ge,!0),Ve=!0)}function Qe(e,t){if(t.pointerType!==(t.MSPOINTER_TYPE_MOUSE||"mouse")){for(var n in t.touches=[],He)t.touches.push(He[n]);t.changedTouches=[t],e(t)}}function Ye(e,t){t.MSPOINTER_TYPE_TOUCH&&t.pointerType===t.MSPOINTER_TYPE_TOUCH&&Kt(t),Qe(e,t)}function Xe(e){var t,n,r={};for(n in e)t=e[n],r[n]=t&&t.bind?t.bind(e):t;return e=r,r.type="dblclick",r.detail=2,r.isTrusted=!1,r._simulated=!0,r}var et=200;function tt(e,t){e.addEventListener("dblclick",t);var n,r=0;function i(e){if(1===e.detail){if("mouse"!==e.pointerType&&(!e.sourceCapabilities||e.sourceCapabilities.firesTouchEvents)){var i=Gt(e);if(!i.some((function(e){return e instanceof HTMLLabelElement&&e.attributes.for}))||i.some((function(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement}))){var o=Date.now();o-r<=et?2===++n&&t(Xe(e)):n=1,r=o}}}else n=e.detail}return e.addEventListener("click",i),{dblclick:t,simDblclick:i}}function nt(e,t){e.removeEventListener("dblclick",t.dblclick),e.removeEventListener("click",t.simDblclick)}var rt,it,ot,st,at,ut=kt(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),lt=kt(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ct="webkitTransition"===lt||"OTransition"===lt?lt+"End":"transitionend";function dt(e){return"string"===typeof e?document.getElementById(e):e}function ht(e,t){var n=e.style[t]||e.currentStyle&&e.currentStyle[t];if((!n||"auto"===n)&&document.defaultView){var r=document.defaultView.getComputedStyle(e,null);n=r?r[t]:null}return"auto"===n?null:n}function ft(e,t,n){var r=document.createElement(e);return r.className=t||"",n&&n.appendChild(r),r}function pt(e){var t=e.parentNode;t&&t.removeChild(e)}function gt(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function mt(e){var t=e.parentNode;t&&t.lastChild!==e&&t.appendChild(e)}function yt(e){var t=e.parentNode;t&&t.firstChild!==e&&t.insertBefore(e,t.firstChild)}function vt(e,t){if(void 0!==e.classList)return e.classList.contains(t);var n=St(e);return n.length>0&&new RegExp("(^|\\s)"+t+"(\\s|$)").test(n)}function wt(e,t){if(void 0!==e.classList)for(var n=h(t),r=0,i=n.length;r0?2*window.devicePixelRatio:1;function Yt(e){return Me.edge?e.wheelDeltaY/2:e.deltaY&&0===e.deltaMode?-e.deltaY/Qt:e.deltaY&&1===e.deltaMode?20*-e.deltaY:e.deltaY&&2===e.deltaMode?60*-e.deltaY:e.deltaX||e.deltaZ?0:e.wheelDelta?(e.wheelDeltaY||e.wheelDelta)/2:e.detail&&Math.abs(e.detail)<32765?20*-e.detail:e.detail?e.detail/-32765*60:0}function Xt(e,t){var n=t.relatedTarget;if(!n)return!0;try{for(;n&&n!==e;)n=n.parentNode}catch(r){return!1}return n!==e}var en={__proto__:null,on:Nt,off:Ut,stopPropagation:Vt,disableScrollPropagation:qt,disableClickPropagation:Wt,preventDefault:Kt,stop:Zt,getPropagationPath:Gt,getMousePosition:Jt,getWheelDelta:Yt,isExternalTarget:Xt,addListener:Nt,removeListener:Ut},tn=I.extend({run:function(e,t,n,r){this.stop(),this._el=e,this._inProgress=!0,this._duration=n||.25,this._easeOutPower=1/Math.max(r||.5,.2),this._startPos=Tt(e),this._offset=t.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=k(this._animate,this),this._step()},_step:function(e){var t=+new Date-this._startTime,n=1e3*this._duration;tthis.options.maxZoom)?this.setZoom(e):this},panInsideBounds:function(e,t){this._enforcingBounds=!0;var n=this.getCenter(),r=this._limitCenter(n,this._zoom,U(e));return n.equals(r)||this.panTo(r,t),this._enforcingBounds=!1,this},panInside:function(e,t){var n=F((t=t||{}).paddingTopLeft||t.padding||[0,0]),r=F(t.paddingBottomRight||t.padding||[0,0]),i=this.project(this.getCenter()),o=this.project(e),s=this.getPixelBounds(),a=N([s.min.add(n),s.max.subtract(r)]),u=a.getSize();if(!a.contains(o)){this._enforcingBounds=!0;var l=o.subtract(a.getCenter()),c=a.extend(o).getSize().subtract(u);i.x+=l.x<0?-c.x:c.x,i.y+=l.y<0?-c.y:c.y,this.panTo(this.unproject(i),t),this._enforcingBounds=!1}return this},invalidateSize:function(e){if(!this._loaded)return this;e=n({animate:!1,pan:!0},!0===e?{animate:!0}:e);var t=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var r=this.getSize(),o=t.divideBy(2).round(),s=r.divideBy(2).round(),a=o.subtract(s);return a.x||a.y?(e.animate&&e.pan?this.panBy(a):(e.pan&&this._rawPanBy(a),this.fire("move"),e.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(i(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:t,newSize:r})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(e){if(e=this._locateOptions=n({timeout:1e4,watch:!1},e),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var t=i(this._handleGeolocationResponse,this),r=i(this._handleGeolocationError,this);return e.watch?this._locationWatchId=navigator.geolocation.watchPosition(t,r,e):navigator.geolocation.getCurrentPosition(t,r,e),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(e){if(this._container._leaflet_id){var t=e.code,n=e.message||(1===t?"permission denied":2===t?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:t,message:"Geolocation error: "+n+"."})}},_handleGeolocationResponse:function(e){if(this._container._leaflet_id){var t=new $(e.coords.latitude,e.coords.longitude),n=t.toBounds(2*e.coords.accuracy),r=this._locateOptions;if(r.setView){var i=this.getBoundsZoom(n);this.setView(t,r.maxZoom?Math.min(i,r.maxZoom):i)}var o={latlng:t,bounds:n,timestamp:e.timestamp};for(var s in e.coords)"number"===typeof e.coords[s]&&(o[s]=e.coords[s]);this.fire("locationfound",o)}},addHandler:function(e,t){if(!t)return this;var n=this[e]=new t(this);return this._handlers.push(n),this.options[e]&&n.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}var e;for(e in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),pt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(C(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[e].remove();for(e in this._panes)pt(this._panes[e]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(e,t){var n=ft("div","leaflet-pane"+(e?" leaflet-"+e.replace("Pane","")+"-pane":""),t||this._mapPane);return e&&(this._panes[e]=n),n},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var e=this.getPixelBounds();return new D(this.unproject(e.getBottomLeft()),this.unproject(e.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(e,t,n){e=U(e),n=F(n||[0,0]);var r=this.getZoom()||0,i=this.getMinZoom(),o=this.getMaxZoom(),s=e.getNorthWest(),a=e.getSouthEast(),u=this.getSize().subtract(n),l=N(this.project(a,r),this.project(s,r)).getSize(),c=Me.any3d?this.options.zoomSnap:1,d=u.x/l.x,h=u.y/l.y,f=t?Math.max(d,h):Math.min(d,h);return r=this.getScaleZoom(f,r),c&&(r=Math.round(r/(c/100))*(c/100),r=t?Math.ceil(r/c)*c:Math.floor(r/c)*c),Math.max(i,Math.min(o,r))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new j(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(e,t){var n=this._getTopLeftPoint(e,t);return new M(n,n.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(e){return this.options.crs.getProjectedBounds(void 0===e?this.getZoom():e)},getPane:function(e){return"string"===typeof e?this._panes[e]:e},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(e,t){var n=this.options.crs;return t=void 0===t?this._zoom:t,n.scale(e)/n.scale(t)},getScaleZoom:function(e,t){var n=this.options.crs;t=void 0===t?this._zoom:t;var r=n.zoom(e*n.scale(t));return isNaN(r)?1/0:r},project:function(e,t){return t=void 0===t?this._zoom:t,this.options.crs.latLngToPoint(B(e),t)},unproject:function(e,t){return t=void 0===t?this._zoom:t,this.options.crs.pointToLatLng(F(e),t)},layerPointToLatLng:function(e){var t=F(e).add(this.getPixelOrigin());return this.unproject(t)},latLngToLayerPoint:function(e){return this.project(B(e))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(e){return this.options.crs.wrapLatLng(B(e))},wrapLatLngBounds:function(e){return this.options.crs.wrapLatLngBounds(U(e))},distance:function(e,t){return this.options.crs.distance(B(e),B(t))},containerPointToLayerPoint:function(e){return F(e).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(e){return F(e).add(this._getMapPanePos())},containerPointToLatLng:function(e){var t=this.containerPointToLayerPoint(F(e));return this.layerPointToLatLng(t)},latLngToContainerPoint:function(e){return this.layerPointToContainerPoint(this.latLngToLayerPoint(B(e)))},mouseEventToContainerPoint:function(e){return Jt(e,this._container)},mouseEventToLayerPoint:function(e){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(e))},mouseEventToLatLng:function(e){return this.layerPointToLatLng(this.mouseEventToLayerPoint(e))},_initContainer:function(e){var t=this._container=dt(e);if(!t)throw new Error("Map container not found.");if(t._leaflet_id)throw new Error("Map container is already initialized.");Nt(t,"scroll",this._onScroll,this),this._containerId=s(t)},_initLayout:function(){var e=this._container;this._fadeAnimated=this.options.fadeAnimation&&Me.any3d,wt(e,"leaflet-container"+(Me.touch?" leaflet-touch":"")+(Me.retina?" leaflet-retina":"")+(Me.ielt9?" leaflet-oldie":"")+(Me.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var t=ht(e,"position");"absolute"!==t&&"relative"!==t&&"fixed"!==t&&"sticky"!==t&&(e.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var e=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Pt(this._mapPane,new j(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(wt(e.markerPane,"leaflet-zoom-hide"),wt(e.shadowPane,"leaflet-zoom-hide"))},_resetView:function(e,t,n){Pt(this._mapPane,new j(0,0));var r=!this._loaded;this._loaded=!0,t=this._limitZoom(t),this.fire("viewprereset");var i=this._zoom!==t;this._moveStart(i,n)._move(e,t)._moveEnd(i),this.fire("viewreset"),r&&this.fire("load")},_moveStart:function(e,t){return e&&this.fire("zoomstart"),t||this.fire("movestart"),this},_move:function(e,t,n,r){void 0===t&&(t=this._zoom);var i=this._zoom!==t;return this._zoom=t,this._lastCenter=e,this._pixelOrigin=this._getNewPixelOrigin(e),r?n&&n.pinch&&this.fire("zoom",n):((i||n&&n.pinch)&&this.fire("zoom",n),this.fire("move",n)),this},_moveEnd:function(e){return e&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return C(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(e){Pt(this._mapPane,this._getMapPanePos().subtract(e))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(e){this._targets={},this._targets[s(this._container)]=this;var t=e?Ut:Nt;t(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&t(window,"resize",this._onResize,this),Me.any3d&&this.options.transform3DLimit&&(e?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){C(this._resizeRequest),this._resizeRequest=k((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var e=this._getMapPanePos();Math.max(Math.abs(e.x),Math.abs(e.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(e,t){for(var n,r=[],i="mouseout"===t||"mouseover"===t,o=e.target||e.srcElement,a=!1;o;){if((n=this._targets[s(o)])&&("click"===t||"preclick"===t)&&this._draggableMoved(n)){a=!0;break}if(n&&n.listens(t,!0)){if(i&&!Xt(o,e))break;if(r.push(n),i)break}if(o===this._container)break;o=o.parentNode}return r.length||a||i||!this.listens(t,!0)||(r=[this]),r},_isClickDisabled:function(e){for(;e&&e!==this._container;){if(e._leaflet_disable_click)return!0;e=e.parentNode}},_handleDOMEvent:function(e){var t=e.target||e.srcElement;if(!(!this._loaded||t._leaflet_disable_events||"click"===e.type&&this._isClickDisabled(t))){var n=e.type;"mousedown"===n&&jt(t),this._fireDOMEvent(e,n)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(e,t,r){if("click"===e.type){var i=n({},e);i.type="preclick",this._fireDOMEvent(i,i.type,r)}var o=this._findEventTargets(e,t);if(r){for(var s=[],a=0;a0?Math.round(e-t)/2:Math.max(0,Math.ceil(e))-Math.max(0,Math.floor(t))},_limitZoom:function(e){var t=this.getMinZoom(),n=this.getMaxZoom(),r=Me.any3d?this.options.zoomSnap:1;return r&&(e=Math.round(e/r)*r),Math.max(t,Math.min(n,e))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){_t(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(e,t){var n=this._getCenterOffset(e)._trunc();return!(!0!==(t&&t.animate)&&!this.getSize().contains(n))&&(this.panBy(n,t),!0)},_createAnimProxy:function(){var e=this._proxy=ft("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(e),this.on("zoomanim",(function(e){var t=ut,n=this._proxy.style[t];Ct(this._proxy,this.project(e.center,e.zoom),this.getZoomScale(e.zoom,1)),n===this._proxy.style[t]&&this._animatingZoom&&this._onZoomTransitionEnd()}),this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){pt(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var e=this.getCenter(),t=this.getZoom();Ct(this._proxy,this.project(e,t),this.getZoomScale(t,1))},_catchTransitionEnd:function(e){this._animatingZoom&&e.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(e,t,n){if(this._animatingZoom)return!0;if(n=n||{},!this._zoomAnimated||!1===n.animate||this._nothingToAnimate()||Math.abs(t-this._zoom)>this.options.zoomAnimationThreshold)return!1;var r=this.getZoomScale(t),i=this._getCenterOffset(e)._divideBy(1-1/r);return!(!0!==n.animate&&!this.getSize().contains(i))&&(k((function(){this._moveStart(!0,!1)._animateZoom(e,t,!0)}),this),!0)},_animateZoom:function(e,t,n,r){this._mapPane&&(n&&(this._animatingZoom=!0,this._animateToCenter=e,this._animateToZoom=t,wt(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:e,zoom:t,noUpdate:r}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(i(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&_t(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function rn(e,t){return new nn(e,t)}var on=T.extend({options:{position:"topright"},initialize:function(e){f(this,e)},getPosition:function(){return this.options.position},setPosition:function(e){var t=this._map;return t&&t.removeControl(this),this.options.position=e,t&&t.addControl(this),this},getContainer:function(){return this._container},addTo:function(e){this.remove(),this._map=e;var t=this._container=this.onAdd(e),n=this.getPosition(),r=e._controlCorners[n];return wt(t,"leaflet-control"),-1!==n.indexOf("bottom")?r.insertBefore(t,r.firstChild):r.appendChild(t),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(pt(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(e){this._map&&e&&e.screenX>0&&e.screenY>0&&this._map.getContainer().focus()}}),sn=function(e){return new on(e)};nn.include({addControl:function(e){return e.addTo(this),this},removeControl:function(e){return e.remove(),this},_initControlPos:function(){var e=this._controlCorners={},t="leaflet-",n=this._controlContainer=ft("div",t+"control-container",this._container);function r(r,i){var o=t+r+" "+t+i;e[r+i]=ft("div",o,n)}r("top","left"),r("top","right"),r("bottom","left"),r("bottom","right")},_clearControlPos:function(){for(var e in this._controlCorners)pt(this._controlCorners[e]);pt(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var an=on.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(e,t,n,r){return n1,this._baseLayersList.style.display=e?"":"none"),this._separator.style.display=t&&e?"":"none",this},_onLayerChange:function(e){this._handlingClick||this._update();var t=this._getLayer(s(e.target)),n=t.overlay?"add"===e.type?"overlayadd":"overlayremove":"add"===e.type?"baselayerchange":null;n&&this._map.fire(n,t)},_createRadioElement:function(e,t){var n='",r=document.createElement("div");return r.innerHTML=n,r.firstChild},_addItem:function(e){var t,n=document.createElement("label"),r=this._map.hasLayer(e.layer);e.overlay?((t=document.createElement("input")).type="checkbox",t.className="leaflet-control-layers-selector",t.defaultChecked=r):t=this._createRadioElement("leaflet-base-layers_"+s(this),r),this._layerControlInputs.push(t),t.layerId=s(e.layer),Nt(t,"click",this._onInputClick,this);var i=document.createElement("span");i.innerHTML=" "+e.name;var o=document.createElement("span");return n.appendChild(o),o.appendChild(t),o.appendChild(i),(e.overlay?this._overlaysList:this._baseLayersList).appendChild(n),this._checkDisabledLayers(),n},_onInputClick:function(){var e,t,n=this._layerControlInputs,r=[],i=[];this._handlingClick=!0;for(var o=n.length-1;o>=0;o--)e=n[o],t=this._getLayer(e.layerId).layer,e.checked?r.push(t):e.checked||i.push(t);for(o=0;o=0;i--)e=n[i],t=this._getLayer(e.layerId).layer,e.disabled=void 0!==t.options.minZoom&&rt.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var e=this._section;Nt(e,"click",Kt),this.expand(),setTimeout((function(){Ut(e,"click",Kt)}))}}),un=function(e,t,n){return new an(e,t,n)},ln=on.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(e){var t="leaflet-control-zoom",n=ft("div",t+" leaflet-bar"),r=this.options;return this._zoomInButton=this._createButton(r.zoomInText,r.zoomInTitle,t+"-in",n,this._zoomIn),this._zoomOutButton=this._createButton(r.zoomOutText,r.zoomOutTitle,t+"-out",n,this._zoomOut),this._updateDisabled(),e.on("zoomend zoomlevelschange",this._updateDisabled,this),n},onRemove:function(e){e.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(e){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(e.shiftKey?3:1))},_createButton:function(e,t,n,r,i){var o=ft("a",n,r);return o.innerHTML=e,o.href="#",o.title=t,o.setAttribute("role","button"),o.setAttribute("aria-label",t),Wt(o),Nt(o,"click",Zt),Nt(o,"click",i,this),Nt(o,"click",this._refocusOnMap,this),o},_updateDisabled:function(){var e=this._map,t="leaflet-disabled";_t(this._zoomInButton,t),_t(this._zoomOutButton,t),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||e._zoom===e.getMinZoom())&&(wt(this._zoomOutButton,t),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||e._zoom===e.getMaxZoom())&&(wt(this._zoomInButton,t),this._zoomInButton.setAttribute("aria-disabled","true"))}});nn.mergeOptions({zoomControl:!0}),nn.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new ln,this.addControl(this.zoomControl))}));var cn=function(e){return new ln(e)},dn=on.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(e){var t="leaflet-control-scale",n=ft("div",t),r=this.options;return this._addScales(r,t+"-line",n),e.on(r.updateWhenIdle?"moveend":"move",this._update,this),e.whenReady(this._update,this),n},onRemove:function(e){e.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(e,t,n){e.metric&&(this._mScale=ft("div",t,n)),e.imperial&&(this._iScale=ft("div",t,n))},_update:function(){var e=this._map,t=e.getSize().y/2,n=e.distance(e.containerPointToLatLng([0,t]),e.containerPointToLatLng([this.options.maxWidth,t]));this._updateScales(n)},_updateScales:function(e){this.options.metric&&e&&this._updateMetric(e),this.options.imperial&&e&&this._updateImperial(e)},_updateMetric:function(e){var t=this._getRoundNum(e),n=t<1e3?t+" m":t/1e3+" km";this._updateScale(this._mScale,n,t/e)},_updateImperial:function(e){var t,n,r,i=3.2808399*e;i>5280?(t=i/5280,n=this._getRoundNum(t),this._updateScale(this._iScale,n+" mi",n/t)):(r=this._getRoundNum(i),this._updateScale(this._iScale,r+" ft",r/i))},_updateScale:function(e,t,n){e.style.width=Math.round(this.options.maxWidth*n)+"px",e.innerHTML=t},_getRoundNum:function(e){var t=Math.pow(10,(Math.floor(e)+"").length-1),n=e/t;return t*(n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:1)}}),hn=function(e){return new dn(e)},fn='',pn=on.extend({options:{position:"bottomright",prefix:''+(Me.inlineSvg?fn+" ":"")+"Leaflet"},initialize:function(e){f(this,e),this._attributions={}},onAdd:function(e){for(var t in e.attributionControl=this,this._container=ft("div","leaflet-control-attribution"),Wt(this._container),e._layers)e._layers[t].getAttribution&&this.addAttribution(e._layers[t].getAttribution());return this._update(),e.on("layeradd",this._addAttribution,this),this._container},onRemove:function(e){e.off("layeradd",this._addAttribution,this)},_addAttribution:function(e){e.layer.getAttribution&&(this.addAttribution(e.layer.getAttribution()),e.layer.once("remove",(function(){this.removeAttribution(e.layer.getAttribution())}),this))},setPrefix:function(e){return this.options.prefix=e,this._update(),this},addAttribution:function(e){return e?(this._attributions[e]||(this._attributions[e]=0),this._attributions[e]++,this._update(),this):this},removeAttribution:function(e){return e?(this._attributions[e]&&(this._attributions[e]--,this._update()),this):this},_update:function(){if(this._map){var e=[];for(var t in this._attributions)this._attributions[t]&&e.push(t);var n=[];this.options.prefix&&n.push(this.options.prefix),e.length&&n.push(e.join(", ")),this._container.innerHTML=n.join(' ')}}});nn.mergeOptions({attributionControl:!0}),nn.addInitHook((function(){this.options.attributionControl&&(new pn).addTo(this)}));var gn=function(e){return new pn(e)};on.Layers=an,on.Zoom=ln,on.Scale=dn,on.Attribution=pn,sn.layers=un,sn.zoom=cn,sn.scale=hn,sn.attribution=gn;var mn=T.extend({initialize:function(e){this._map=e},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});mn.addTo=function(e,t){return e.addHandler(t,this),this};var yn,vn={Events:O},wn=Me.touch?"touchstart mousedown":"mousedown",_n=I.extend({options:{clickTolerance:3},initialize:function(e,t,n,r){f(this,r),this._element=e,this._dragStartTarget=t||e,this._preventOutline=n},enable:function(){this._enabled||(Nt(this._dragStartTarget,wn,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(_n._dragging===this&&this.finishDrag(!0),Ut(this._dragStartTarget,wn,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(e){if(this._enabled&&(this._moved=!1,!vt(this._element,"leaflet-zoom-anim")))if(e.touches&&1!==e.touches.length)_n._dragging===this&&this.finishDrag();else if(!(_n._dragging||e.shiftKey||1!==e.which&&1!==e.button&&!e.touches)&&(_n._dragging=this,this._preventOutline&&jt(this._element),Ot(),rt(),!this._moving)){this.fire("down");var t=e.touches?e.touches[0]:e,n=Rt(this._element);this._startPoint=new j(t.clientX,t.clientY),this._startPos=Tt(this._element),this._parentScale=Ft(n);var r="mousedown"===e.type;Nt(document,r?"mousemove":"touchmove",this._onMove,this),Nt(document,r?"mouseup":"touchend touchcancel",this._onUp,this)}},_onMove:function(e){if(this._enabled)if(e.touches&&e.touches.length>1)this._moved=!0;else{var t=e.touches&&1===e.touches.length?e.touches[0]:e,n=new j(t.clientX,t.clientY)._subtract(this._startPoint);(n.x||n.y)&&(Math.abs(n.x)+Math.abs(n.y)u&&(o=s,u=a);u>n&&(t[o]=1,kn(e,t,n,r,o),kn(e,t,n,o,i))}function Cn(e,t){for(var n=[e[0]],r=1,i=0,o=e.length;rt&&(n.push(e[r]),i=r);return it.max.x&&(n|=2),e.yt.max.y&&(n|=8),n}function On(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r}function In(e,t,n,r){var i,o=t.x,s=t.y,a=n.x-o,u=n.y-s,l=a*a+u*u;return l>0&&((i=((e.x-o)*a+(e.y-s)*u)/l)>1?(o=n.x,s=n.y):i>0&&(o+=a*i,s+=u*i)),a=e.x-o,u=e.y-s,r?a*a+u*u:new j(o,s)}function jn(e){return!y(e[0])||"object"!==typeof e[0][0]&&"undefined"!==typeof e[0][0]}function Ln(e){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),jn(e)}function Rn(e,t){var n,r,i,o,s,a,u,l;if(!e||0===e.length)throw new Error("latlngs not passed");jn(e)||(console.warn("latlngs are not flat! Only the first ring will be used"),e=e[0]);var c=[];for(var d in e)c.push(t.project(B(e[d])));var h=c.length;for(n=0,r=0;nr){u=(o-r)/i,l=[a.x-u*(a.x-s.x),a.y-u*(a.y-s.y)];break}return t.unproject(F(l))}var Fn={__proto__:null,simplify:bn,pointToSegmentDistance:Sn,closestPointOnSegment:xn,clipSegment:Pn,_getEdgeIntersection:Tn,_getBitCode:An,_sqClosestPointOnSegment:In,isFlat:jn,_flat:Ln,polylineCenter:Rn};function Mn(e,t,n){var r,i,o,s,a,u,l,c,d,h=[1,4,2,8];for(i=0,l=e.length;i1e-7;u++)t=o*Math.sin(a),t=Math.pow((1-t)/(1+t),o/2),a+=l=Math.PI/2-2*Math.atan(s*t)-a;return new $(a*n,e.x*n/r)}},Bn={__proto__:null,LonLat:Un,Mercator:$n,SphericalMercator:q},zn=n({},H,{code:"EPSG:3395",projection:$n,transformation:function(){var e=.5/(Math.PI*$n.R);return K(e,.5,-e,.5)}()}),Hn=n({},H,{code:"EPSG:4326",projection:Un,transformation:K(1/180,1,-1/180,.5)}),Vn=n({},z,{projection:Un,transformation:K(1,0,-1,0),scale:function(e){return Math.pow(2,e)},zoom:function(e){return Math.log(e)/Math.LN2},distance:function(e,t){var n=t.lng-e.lng,r=t.lat-e.lat;return Math.sqrt(n*n+r*r)},infinite:!0});z.Earth=H,z.EPSG3395=zn,z.EPSG3857=Z,z.EPSG900913=G,z.EPSG4326=Hn,z.Simple=Vn;var qn=I.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(e){return e.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(e){return e&&e.removeLayer(this),this},getPane:function(e){return this._map.getPane(e?this.options[e]||e:this.options.pane)},addInteractiveTarget:function(e){return this._map._targets[s(e)]=this,this},removeInteractiveTarget:function(e){return delete this._map._targets[s(e)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(e){var t=e.target;if(t.hasLayer(this)){if(this._map=t,this._zoomAnimated=t._zoomAnimated,this.getEvents){var n=this.getEvents();t.on(n,this),this.once("remove",(function(){t.off(n,this)}),this)}this.onAdd(t),this.fire("add"),t.fire("layeradd",{layer:this})}}});nn.include({addLayer:function(e){if(!e._layerAdd)throw new Error("The provided object is not a Layer.");var t=s(e);return this._layers[t]||(this._layers[t]=e,e._mapToAdd=this,e.beforeAdd&&e.beforeAdd(this),this.whenReady(e._layerAdd,e)),this},removeLayer:function(e){var t=s(e);return this._layers[t]?(this._loaded&&e.onRemove(this),delete this._layers[t],this._loaded&&(this.fire("layerremove",{layer:e}),e.fire("remove")),e._map=e._mapToAdd=null,this):this},hasLayer:function(e){return s(e)in this._layers},eachLayer:function(e,t){for(var n in this._layers)e.call(t,this._layers[n]);return this},_addLayers:function(e){for(var t=0,n=(e=e?y(e)?e:[e]:[]).length;tthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()=2&&t[0]instanceof $&&t[0].equals(t[n-1])&&t.pop(),t},_setLatLngs:function(e){ar.prototype._setLatLngs.call(this,e),jn(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return jn(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var e=this._renderer._bounds,t=this.options.weight,n=new j(t,t);if(e=new M(e.min.subtract(n),e.max.add(n)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(e))if(this.options.noClip)this._parts=this._rings;else for(var r,i=0,o=this._rings.length;ie.y!==r.y>e.y&&e.x<(r.x-n.x)*(e.y-n.y)/(r.y-n.y)+n.x&&(l=!l);return l||ar.prototype._containsPoint.call(this,e,!0)}});function cr(e,t){return new lr(e,t)}var dr=Zn.extend({initialize:function(e,t){f(this,t),this._layers={},e&&this.addData(e)},addData:function(e){var t,n,r,i=y(e)?e:e.features;if(i){for(t=0,n=i.length;t0?r:[t.src]}else{y(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(t.style,"objectFit")&&(t.style.objectFit="fill"),t.autoplay=!!this.options.autoplay,t.loop=!!this.options.loop,t.muted=!!this.options.muted,t.playsInline=!!this.options.playsInline;for(var s=0;si?(t.height=i+"px",wt(e,o)):_t(e,o),this._containerWidth=this._container.offsetWidth},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center),n=this._getAnchor();Pt(this._container,t.add(n))},_adjustPan:function(){if(this.options.autoPan)if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning)this._autopanning=!1;else{var e=this._map,t=parseInt(ht(this._container,"marginBottom"),10)||0,n=this._container.offsetHeight+t,r=this._containerWidth,i=new j(this._containerLeft,-n-this._containerBottom);i._add(Tt(this._container));var o=e.layerPointToContainerPoint(i),s=F(this.options.autoPanPadding),a=F(this.options.autoPanPaddingTopLeft||s),u=F(this.options.autoPanPaddingBottomRight||s),l=e.getSize(),c=0,d=0;o.x+r+u.x>l.x&&(c=o.x+r-l.x+u.x),o.x-c-a.x<0&&(c=o.x-a.x),o.y+n+u.y>l.y&&(d=o.y+n-l.y+u.y),o.y-d-a.y<0&&(d=o.y-a.y),(c||d)&&(this.options.keepInView&&(this._autopanning=!0),e.fire("autopanstart").panBy([c,d]))}},_getAnchor:function(){return F(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Ir=function(e,t){return new Or(e,t)};nn.mergeOptions({closePopupOnClick:!0}),nn.include({openPopup:function(e,t,n){return this._initOverlay(Or,e,t,n).openOn(this),this},closePopup:function(e){return(e=arguments.length?e:this._popup)&&e.close(),this}}),qn.include({bindPopup:function(e,t){return this._popup=this._initOverlay(Or,this._popup,e,t),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(e){return this._popup&&(this instanceof Zn||(this._popup._source=this),this._popup._prepareOpen(e||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(e){return this._popup&&this._popup.setContent(e),this},getPopup:function(){return this._popup},_openPopup:function(e){if(this._popup&&this._map){Zt(e);var t=e.layer||e.target;this._popup._source!==t||t instanceof nr?(this._popup._source=t,this.openPopup(e.latlng)):this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(e.latlng)}},_movePopup:function(e){this._popup.setLatLng(e.latlng)},_onKeyPress:function(e){13===e.originalEvent.keyCode&&this._openPopup(e)}});var jr=Ar.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(e){Ar.prototype.onAdd.call(this,e),this.setOpacity(this.options.opacity),e.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(e){Ar.prototype.onRemove.call(this,e),e.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var e=Ar.prototype.getEvents.call(this);return this.options.permanent||(e.preclick=this.close),e},_initLayout:function(){var e="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=ft("div",e),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+s(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(e){var t,n,r=this._map,i=this._container,o=r.latLngToContainerPoint(r.getCenter()),s=r.layerPointToContainerPoint(e),a=this.options.direction,u=i.offsetWidth,l=i.offsetHeight,c=F(this.options.offset),d=this._getAnchor();"top"===a?(t=u/2,n=l):"bottom"===a?(t=u/2,n=0):"center"===a?(t=u/2,n=l/2):"right"===a?(t=0,n=l/2):"left"===a?(t=u,n=l/2):s.xthis.options.maxZoom||nr&&this._retainParent(i,o,s,r))},_retainChildren:function(e,t,n,r){for(var i=2*e;i<2*e+2;i++)for(var o=2*t;o<2*t+2;o++){var s=new j(i,o);s.z=n+1;var a=this._tileCoordsToKey(s),u=this._tiles[a];u&&u.active?u.retain=!0:(u&&u.loaded&&(u.retain=!0),n+1this.options.maxZoom||void 0!==this.options.minZoom&&i1)this._setView(e,n);else{for(var d=i.min.y;d<=i.max.y;d++)for(var h=i.min.x;h<=i.max.x;h++){var f=new j(h,d);if(f.z=this._tileZoom,this._isValidTile(f)){var p=this._tiles[this._tileCoordsToKey(f)];p?p.current=!0:s.push(f)}}if(s.sort((function(e,t){return e.distanceTo(o)-t.distanceTo(o)})),0!==s.length){this._loading||(this._loading=!0,this.fire("loading"));var g=document.createDocumentFragment();for(h=0;hn.max.x)||!t.wrapLat&&(e.yn.max.y))return!1}if(!this.options.bounds)return!0;var r=this._tileCoordsToBounds(e);return U(this.options.bounds).overlaps(r)},_keyToBounds:function(e){return this._tileCoordsToBounds(this._keyToTileCoords(e))},_tileCoordsToNwSe:function(e){var t=this._map,n=this.getTileSize(),r=e.scaleBy(n),i=r.add(n);return[t.unproject(r,e.z),t.unproject(i,e.z)]},_tileCoordsToBounds:function(e){var t=this._tileCoordsToNwSe(e),n=new D(t[0],t[1]);return this.options.noWrap||(n=this._map.wrapLatLngBounds(n)),n},_tileCoordsToKey:function(e){return e.x+":"+e.y+":"+e.z},_keyToTileCoords:function(e){var t=e.split(":"),n=new j(+t[0],+t[1]);return n.z=+t[2],n},_removeTile:function(e){var t=this._tiles[e];t&&(pt(t.el),delete this._tiles[e],this.fire("tileunload",{tile:t.el,coords:this._keyToTileCoords(e)}))},_initTile:function(e){wt(e,"leaflet-tile");var t=this.getTileSize();e.style.width=t.x+"px",e.style.height=t.y+"px",e.onselectstart=l,e.onmousemove=l,Me.ielt9&&this.options.opacity<1&&xt(e,this.options.opacity)},_addTile:function(e,t){var n=this._getTilePos(e),r=this._tileCoordsToKey(e),o=this.createTile(this._wrapCoords(e),i(this._tileReady,this,e));this._initTile(o),this.createTile.length<2&&k(i(this._tileReady,this,e,null,o)),Pt(o,n),this._tiles[r]={el:o,coords:e,current:!0},t.appendChild(o),this.fire("tileloadstart",{tile:o,coords:e})},_tileReady:function(e,t,n){t&&this.fire("tileerror",{error:t,tile:n,coords:e});var r=this._tileCoordsToKey(e);(n=this._tiles[r])&&(n.loaded=+new Date,this._map._fadeAnimated?(xt(n.el,0),C(this._fadeFrame),this._fadeFrame=k(this._updateOpacity,this)):(n.active=!0,this._pruneTiles()),t||(wt(n.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:n.el,coords:e})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Me.ielt9||!this._map._fadeAnimated?k(this._pruneTiles,this):setTimeout(i(this._pruneTiles,this),250)))},_getTilePos:function(e){return e.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(e){var t=new j(this._wrapX?u(e.x,this._wrapX):e.x,this._wrapY?u(e.y,this._wrapY):e.y);return t.z=e.z,t},_pxBoundsToTileRange:function(e){var t=this.getTileSize();return new M(e.min.unscaleBy(t).floor(),e.max.unscaleBy(t).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var e in this._tiles)if(!this._tiles[e].loaded)return!1;return!0}});function Nr(e){return new Mr(e)}var Dr=Mr.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(e,t){this._url=e,(t=f(this,t)).detectRetina&&Me.retina&&t.maxZoom>0?(t.tileSize=Math.floor(t.tileSize/2),t.zoomReverse?(t.zoomOffset--,t.minZoom=Math.min(t.maxZoom,t.minZoom+1)):(t.zoomOffset++,t.maxZoom=Math.max(t.minZoom,t.maxZoom-1)),t.minZoom=Math.max(0,t.minZoom)):t.zoomReverse?t.minZoom=Math.min(t.maxZoom,t.minZoom):t.maxZoom=Math.max(t.minZoom,t.maxZoom),"string"===typeof t.subdomains&&(t.subdomains=t.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(e,t){return this._url===e&&void 0===t&&(t=!0),this._url=e,t||this.redraw(),this},createTile:function(e,t){var n=document.createElement("img");return Nt(n,"load",i(this._tileOnLoad,this,t,n)),Nt(n,"error",i(this._tileOnError,this,t,n)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(n.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"===typeof this.options.referrerPolicy&&(n.referrerPolicy=this.options.referrerPolicy),n.alt="",n.src=this.getTileUrl(e),n},getTileUrl:function(e){var t={r:Me.retina?"@2x":"",s:this._getSubdomain(e),x:e.x,y:e.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var r=this._globalTileRange.max.y-e.y;this.options.tms&&(t.y=r),t["-y"]=r}return m(this._url,n(t,this.options))},_tileOnLoad:function(e,t){Me.ielt9?setTimeout(i(e,this,null,t),0):e(null,t)},_tileOnError:function(e,t,n){var r=this.options.errorTileUrl;r&&t.getAttribute("src")!==r&&(t.src=r),e(n,t)},_onTileRemove:function(e){e.tile.onload=null},_getZoomForUrl:function(){var e=this._tileZoom,t=this.options.maxZoom;return this.options.zoomReverse&&(e=t-e),e+this.options.zoomOffset},_getSubdomain:function(e){var t=Math.abs(e.x+e.y)%this.options.subdomains.length;return this.options.subdomains[t]},_abortLoading:function(){var e,t;for(e in this._tiles)if(this._tiles[e].coords.z!==this._tileZoom&&((t=this._tiles[e].el).onload=l,t.onerror=l,!t.complete)){t.src=w;var n=this._tiles[e].coords;pt(t),delete this._tiles[e],this.fire("tileabort",{tile:t,coords:n})}},_removeTile:function(e){var t=this._tiles[e];if(t)return t.el.setAttribute("src",w),Mr.prototype._removeTile.call(this,e)},_tileReady:function(e,t,n){if(this._map&&(!n||n.getAttribute("src")!==w))return Mr.prototype._tileReady.call(this,e,t,n)}});function Ur(e,t){return new Dr(e,t)}var $r=Dr.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(e,t){this._url=e;var r=n({},this.defaultWmsParams);for(var i in t)i in this.options||(r[i]=t[i]);var o=(t=f(this,t)).detectRetina&&Me.retina?2:1,s=this.getTileSize();r.width=s.x*o,r.height=s.y*o,this.wmsParams=r},onAdd:function(e){this._crs=this.options.crs||e.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var t=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[t]=this._crs.code,Dr.prototype.onAdd.call(this,e)},getTileUrl:function(e){var t=this._tileCoordsToNwSe(e),n=this._crs,r=N(n.project(t[0]),n.project(t[1])),i=r.min,o=r.max,s=(this._wmsVersion>=1.3&&this._crs===Hn?[i.y,i.x,o.y,o.x]:[i.x,i.y,o.x,o.y]).join(","),a=Dr.prototype.getTileUrl.call(this,e);return a+p(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+s},setParams:function(e,t){return n(this.wmsParams,e),t||this.redraw(),this}});function Br(e,t){return new $r(e,t)}Dr.WMS=$r,Ur.wms=Br;var zr=qn.extend({options:{padding:.1},initialize:function(e){f(this,e),s(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&wt(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var e={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(e.zoomanim=this._onAnimZoom),e},_onAnimZoom:function(e){this._updateTransform(e.center,e.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(e,t){var n=this._map.getZoomScale(t,this._zoom),r=this._map.getSize().multiplyBy(.5+this.options.padding),i=this._map.project(this._center,t),o=r.multiplyBy(-n).add(i).subtract(this._map._getNewPixelOrigin(e,t));Me.any3d?Ct(this._container,o,n):Pt(this._container,o)},_reset:function(){for(var e in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[e]._reset()},_onZoomEnd:function(){for(var e in this._layers)this._layers[e]._project()},_updatePaths:function(){for(var e in this._layers)this._layers[e]._update()},_update:function(){var e=this.options.padding,t=this._map.getSize(),n=this._map.containerPointToLayerPoint(t.multiplyBy(-e)).round();this._bounds=new M(n,n.add(t.multiplyBy(1+2*e)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Hr=zr.extend({options:{tolerance:0},getEvents:function(){var e=zr.prototype.getEvents.call(this);return e.viewprereset=this._onViewPreReset,e},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){zr.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var e=this._container=document.createElement("canvas");Nt(e,"mousemove",this._onMouseMove,this),Nt(e,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Nt(e,"mouseout",this._handleMouseOut,this),e._leaflet_disable_events=!0,this._ctx=e.getContext("2d")},_destroyContainer:function(){C(this._redrawRequest),delete this._ctx,pt(this._container),Ut(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var e in this._redrawBounds=null,this._layers)this._layers[e]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){zr.prototype._update.call(this);var e=this._bounds,t=this._container,n=e.getSize(),r=Me.retina?2:1;Pt(t,e.min),t.width=r*n.x,t.height=r*n.y,t.style.width=n.x+"px",t.style.height=n.y+"px",Me.retina&&this._ctx.scale(2,2),this._ctx.translate(-e.min.x,-e.min.y),this.fire("update")}},_reset:function(){zr.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(e){this._updateDashArray(e),this._layers[s(e)]=e;var t=e._order={layer:e,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=t),this._drawLast=t,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(e){this._requestRedraw(e)},_removePath:function(e){var t=e._order,n=t.next,r=t.prev;n?n.prev=r:this._drawLast=r,r?r.next=n:this._drawFirst=n,delete e._order,delete this._layers[s(e)],this._requestRedraw(e)},_updatePath:function(e){this._extendRedrawBounds(e),e._project(),e._update(),this._requestRedraw(e)},_updateStyle:function(e){this._updateDashArray(e),this._requestRedraw(e)},_updateDashArray:function(e){if("string"===typeof e.options.dashArray){var t,n,r=e.options.dashArray.split(/[, ]+/),i=[];for(n=0;n')}}catch(e){}return function(e){return document.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Wr={_initContainer:function(){this._container=ft("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(zr.prototype._update.call(this),this.fire("update"))},_initPath:function(e){var t=e._container=qr("shape");wt(t,"leaflet-vml-shape "+(this.options.className||"")),t.coordsize="1 1",e._path=qr("path"),t.appendChild(e._path),this._updateStyle(e),this._layers[s(e)]=e},_addPath:function(e){var t=e._container;this._container.appendChild(t),e.options.interactive&&e.addInteractiveTarget(t)},_removePath:function(e){var t=e._container;pt(t),e.removeInteractiveTarget(t),delete this._layers[s(e)]},_updateStyle:function(e){var t=e._stroke,n=e._fill,r=e.options,i=e._container;i.stroked=!!r.stroke,i.filled=!!r.fill,r.stroke?(t||(t=e._stroke=qr("stroke")),i.appendChild(t),t.weight=r.weight+"px",t.color=r.color,t.opacity=r.opacity,r.dashArray?t.dashStyle=y(r.dashArray)?r.dashArray.join(" "):r.dashArray.replace(/( *, *)/g," "):t.dashStyle="",t.endcap=r.lineCap.replace("butt","flat"),t.joinstyle=r.lineJoin):t&&(i.removeChild(t),e._stroke=null),r.fill?(n||(n=e._fill=qr("fill")),i.appendChild(n),n.color=r.fillColor||r.color,n.opacity=r.fillOpacity):n&&(i.removeChild(n),e._fill=null)},_updateCircle:function(e){var t=e._point.round(),n=Math.round(e._radius),r=Math.round(e._radiusY||n);this._setPath(e,e._empty()?"M0 0":"AL "+t.x+","+t.y+" "+n+","+r+" 0,23592600")},_setPath:function(e,t){e._path.v=t},_bringToFront:function(e){mt(e._container)},_bringToBack:function(e){yt(e._container)}},Kr=Me.vml?qr:J,Zr=zr.extend({_initContainer:function(){this._container=Kr("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Kr("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){pt(this._container),Ut(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!this._map._animatingZoom||!this._bounds){zr.prototype._update.call(this);var e=this._bounds,t=e.getSize(),n=this._container;this._svgSize&&this._svgSize.equals(t)||(this._svgSize=t,n.setAttribute("width",t.x),n.setAttribute("height",t.y)),Pt(n,e.min),n.setAttribute("viewBox",[e.min.x,e.min.y,t.x,t.y].join(" ")),this.fire("update")}},_initPath:function(e){var t=e._path=Kr("path");e.options.className&&wt(t,e.options.className),e.options.interactive&&wt(t,"leaflet-interactive"),this._updateStyle(e),this._layers[s(e)]=e},_addPath:function(e){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(e._path),e.addInteractiveTarget(e._path)},_removePath:function(e){pt(e._path),e.removeInteractiveTarget(e._path),delete this._layers[s(e)]},_updatePath:function(e){e._project(),e._update()},_updateStyle:function(e){var t=e._path,n=e.options;t&&(n.stroke?(t.setAttribute("stroke",n.color),t.setAttribute("stroke-opacity",n.opacity),t.setAttribute("stroke-width",n.weight),t.setAttribute("stroke-linecap",n.lineCap),t.setAttribute("stroke-linejoin",n.lineJoin),n.dashArray?t.setAttribute("stroke-dasharray",n.dashArray):t.removeAttribute("stroke-dasharray"),n.dashOffset?t.setAttribute("stroke-dashoffset",n.dashOffset):t.removeAttribute("stroke-dashoffset")):t.setAttribute("stroke","none"),n.fill?(t.setAttribute("fill",n.fillColor||n.color),t.setAttribute("fill-opacity",n.fillOpacity),t.setAttribute("fill-rule",n.fillRule||"evenodd")):t.setAttribute("fill","none"))},_updatePoly:function(e,t){this._setPath(e,Q(e._parts,t))},_updateCircle:function(e){var t=e._point,n=Math.max(Math.round(e._radius),1),r="a"+n+","+(Math.max(Math.round(e._radiusY),1)||n)+" 0 1,0 ",i=e._empty()?"M0 0":"M"+(t.x-n)+","+t.y+r+2*n+",0 "+r+2*-n+",0 ";this._setPath(e,i)},_setPath:function(e,t){e._path.setAttribute("d",t)},_bringToFront:function(e){mt(e._path)},_bringToBack:function(e){yt(e._path)}});function Gr(e){return Me.svg||Me.vml?new Zr(e):null}Me.vml&&Zr.include(Wr),nn.include({getRenderer:function(e){var t=e.options.renderer||this._getPaneRenderer(e.options.pane)||this.options.renderer||this._renderer;return t||(t=this._renderer=this._createRenderer()),this.hasLayer(t)||this.addLayer(t),t},_getPaneRenderer:function(e){if("overlayPane"===e||void 0===e)return!1;var t=this._paneRenderers[e];return void 0===t&&(t=this._createRenderer({pane:e}),this._paneRenderers[e]=t),t},_createRenderer:function(e){return this.options.preferCanvas&&Vr(e)||Gr(e)}});var Jr=lr.extend({initialize:function(e,t){lr.prototype.initialize.call(this,this._boundsToLatLngs(e),t)},setBounds:function(e){return this.setLatLngs(this._boundsToLatLngs(e))},_boundsToLatLngs:function(e){return[(e=U(e)).getSouthWest(),e.getNorthWest(),e.getNorthEast(),e.getSouthEast()]}});function Qr(e,t){return new Jr(e,t)}Zr.create=Kr,Zr.pointsToPath=Q,dr.geometryToLayer=hr,dr.coordsToLatLng=pr,dr.coordsToLatLngs=gr,dr.latLngToCoords=mr,dr.latLngsToCoords=yr,dr.getFeature=vr,dr.asFeature=wr,nn.mergeOptions({boxZoom:!0});var Yr=mn.extend({initialize:function(e){this._map=e,this._container=e._container,this._pane=e._panes.overlayPane,this._resetStateTimeout=0,e.on("unload",this._destroy,this)},addHooks:function(){Nt(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Ut(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){pt(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(e){if(!e.shiftKey||1!==e.which&&1!==e.button)return!1;this._clearDeferredResetState(),this._resetState(),rt(),Ot(),this._startPoint=this._map.mouseEventToContainerPoint(e),Nt(document,{contextmenu:Zt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(e){this._moved||(this._moved=!0,this._box=ft("div","leaflet-zoom-box",this._container),wt(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(e);var t=new M(this._point,this._startPoint),n=t.getSize();Pt(this._box,t.min),this._box.style.width=n.x+"px",this._box.style.height=n.y+"px"},_finish:function(){this._moved&&(pt(this._box),_t(this._container,"leaflet-crosshair")),it(),It(),Ut(document,{contextmenu:Zt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(e){if((1===e.which||1===e.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(i(this._resetState,this),0);var t=new D(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(t).fire("boxzoomend",{boxZoomBounds:t})}},_onKeyDown:function(e){27===e.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});nn.addInitHook("addHandler","boxZoom",Yr),nn.mergeOptions({doubleClickZoom:!0});var Xr=mn.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(e){var t=this._map,n=t.getZoom(),r=t.options.zoomDelta,i=e.originalEvent.shiftKey?n-r:n+r;"center"===t.options.doubleClickZoom?t.setZoom(i):t.setZoomAround(e.containerPoint,i)}});nn.addInitHook("addHandler","doubleClickZoom",Xr),nn.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var ei=mn.extend({addHooks:function(){if(!this._draggable){var e=this._map;this._draggable=new _n(e._mapPane,e._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),e.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),e.on("zoomend",this._onZoomEnd,this),e.whenReady(this._onZoomEnd,this))}wt(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){_t(this._map._container,"leaflet-grab"),_t(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var e=this._map;if(e._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var t=U(this._map.options.maxBounds);this._offsetLimit=N(this._map.latLngToContainerPoint(t.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(t.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;e.fire("movestart").fire("dragstart"),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(e){if(this._map.options.inertia){var t=this._lastTime=+new Date,n=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(n),this._times.push(t),this._prunePositions(t)}this._map.fire("move",e).fire("drag",e)},_prunePositions:function(e){for(;this._positions.length>1&&e-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var e=this._map.getSize().divideBy(2),t=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=t.subtract(e).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(e,t){return e-(e-t)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var e=this._draggable._newPos.subtract(this._draggable._startPos),t=this._offsetLimit;e.xt.max.x&&(e.x=this._viscousLimit(e.x,t.max.x)),e.y>t.max.y&&(e.y=this._viscousLimit(e.y,t.max.y)),this._draggable._newPos=this._draggable._startPos.add(e)}},_onPreDragWrap:function(){var e=this._worldWidth,t=Math.round(e/2),n=this._initialWorldOffset,r=this._draggable._newPos.x,i=(r-t+n)%e+t-n,o=(r+t+n)%e-t-n,s=Math.abs(i+n)0?o:-o))-t;this._delta=0,this._startTime=null,s&&("center"===e.options.scrollWheelZoom?e.setZoom(t+s):e.setZoomAround(this._lastMousePos,t+s))}});nn.addInitHook("addHandler","scrollWheelZoom",ni);var ri=600;nn.mergeOptions({tapHold:Me.touchNative&&Me.safari&&Me.mobile,tapTolerance:15});var ii=mn.extend({addHooks:function(){Nt(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Ut(this._map._container,"touchstart",this._onDown,this)},_onDown:function(e){if(clearTimeout(this._holdTimeout),1===e.touches.length){var t=e.touches[0];this._startPos=this._newPos=new j(t.clientX,t.clientY),this._holdTimeout=setTimeout(i((function(){this._cancel(),this._isTapValid()&&(Nt(document,"touchend",Kt),Nt(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",t))}),this),ri),Nt(document,"touchend touchcancel contextmenu",this._cancel,this),Nt(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function e(){Ut(document,"touchend",Kt),Ut(document,"touchend touchcancel",e)},_cancel:function(){clearTimeout(this._holdTimeout),Ut(document,"touchend touchcancel contextmenu",this._cancel,this),Ut(document,"touchmove",this._onMove,this)},_onMove:function(e){var t=e.touches[0];this._newPos=new j(t.clientX,t.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(e,t){var n=new MouseEvent(e,{bubbles:!0,cancelable:!0,view:window,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY});n._simulated=!0,t.target.dispatchEvent(n)}});nn.addInitHook("addHandler","tapHold",ii),nn.mergeOptions({touchZoom:Me.touch,bounceAtZoomLimits:!0});var oi=mn.extend({addHooks:function(){wt(this._map._container,"leaflet-touch-zoom"),Nt(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){_t(this._map._container,"leaflet-touch-zoom"),Ut(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(e){var t=this._map;if(e.touches&&2===e.touches.length&&!t._animatingZoom&&!this._zooming){var n=t.mouseEventToContainerPoint(e.touches[0]),r=t.mouseEventToContainerPoint(e.touches[1]);this._centerPoint=t.getSize()._divideBy(2),this._startLatLng=t.containerPointToLatLng(this._centerPoint),"center"!==t.options.touchZoom&&(this._pinchStartLatLng=t.containerPointToLatLng(n.add(r)._divideBy(2))),this._startDist=n.distanceTo(r),this._startZoom=t.getZoom(),this._moved=!1,this._zooming=!0,t._stop(),Nt(document,"touchmove",this._onTouchMove,this),Nt(document,"touchend touchcancel",this._onTouchEnd,this),Kt(e)}},_onTouchMove:function(e){if(e.touches&&2===e.touches.length&&this._zooming){var t=this._map,n=t.mouseEventToContainerPoint(e.touches[0]),r=t.mouseEventToContainerPoint(e.touches[1]),o=n.distanceTo(r)/this._startDist;if(this._zoom=t.getScaleZoom(o,this._startZoom),!t.options.bounceAtZoomLimits&&(this._zoomt.getMaxZoom()&&o>1)&&(this._zoom=t._limitZoom(this._zoom)),"center"===t.options.touchZoom){if(this._center=this._startLatLng,1===o)return}else{var s=n._add(r)._divideBy(2)._subtract(this._centerPoint);if(1===o&&0===s.x&&0===s.y)return;this._center=t.unproject(t.project(this._pinchStartLatLng,this._zoom).subtract(s),this._zoom)}this._moved||(t._moveStart(!0,!1),this._moved=!0),C(this._animRequest);var a=i(t._move,t,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=k(a,this,!0),Kt(e)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,C(this._animRequest),Ut(document,"touchmove",this._onTouchMove,this),Ut(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});nn.addInitHook("addHandler","touchZoom",oi),nn.BoxZoom=Yr,nn.DoubleClickZoom=Xr,nn.Drag=ei,nn.Keyboard=ti,nn.ScrollWheelZoom=ni,nn.TapHold=ii,nn.TouchZoom=oi,e.Bounds=M,e.Browser=Me,e.CRS=z,e.Canvas=Hr,e.Circle=or,e.CircleMarker=rr,e.Class=T,e.Control=on,e.DivIcon=Rr,e.DivOverlay=Ar,e.DomEvent=en,e.DomUtil=Mt,e.Draggable=_n,e.Evented=I,e.FeatureGroup=Zn,e.GeoJSON=dr,e.GridLayer=Mr,e.Handler=mn,e.Icon=Jn,e.ImageOverlay=xr,e.LatLng=$,e.LatLngBounds=D,e.Layer=qn,e.LayerGroup=Wn,e.LineUtil=Fn,e.Map=nn,e.Marker=er,e.Mixin=vn,e.Path=nr,e.Point=j,e.PolyUtil=Dn,e.Polygon=lr,e.Polyline=ar,e.Popup=Or,e.PosAnimation=tn,e.Projection=Bn,e.Rectangle=Jr,e.Renderer=zr,e.SVG=Zr,e.SVGOverlay=Pr,e.TileLayer=Dr,e.Tooltip=jr,e.Transformation=W,e.Util=P,e.VideoOverlay=kr,e.bind=i,e.bounds=N,e.canvas=Vr,e.circle=sr,e.circleMarker=ir,e.control=sn,e.divIcon=Fr,e.extend=n,e.featureGroup=Gn,e.geoJSON=br,e.geoJson=Sr,e.gridLayer=Nr,e.icon=Qn,e.imageOverlay=Er,e.latLng=B,e.latLngBounds=U,e.layerGroup=Kn,e.map=rn,e.marker=tr,e.point=F,e.polygon=cr,e.polyline=ur,e.popup=Ir,e.rectangle=Qr,e.setOptions=f,e.stamp=s,e.svg=Gr,e.svgOverlay=Tr,e.tileLayer=Ur,e.tooltip=Lr,e.transformation=K,e.version=t,e.videoOverlay=Cr;var si=window.L;e.noConflict=function(){return window.L=si,this},window.L=e}(t)},908:(e,t,n)=>{var r=n(8136)(n(7009),"DataView");e.exports=r},9676:(e,t,n)=>{var r=n(5403),i=n(2747),o=n(6037),s=n(4154),a=n(7728);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var r=n(3894),i=n(8699),o=n(4957),s=n(7184),a=n(7109);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var r=n(8136)(n(7009),"Map");e.exports=r},8059:(e,t,n)=>{var r=n(4086),i=n(9255),o=n(9186),s=n(3423),a=n(3739);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var r=n(8136)(n(7009),"Promise");e.exports=r},3924:(e,t,n)=>{var r=n(8136)(n(7009),"Set");e.exports=r},692:(e,t,n)=>{var r=n(8059),i=n(5774),o=n(1596);function s(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t{var r=n(8384),i=n(511),o=n(835),s=n(707),a=n(8832),u=n(5077);function l(e){var t=this.__data__=new r(e);this.size=t.size}l.prototype.clear=i,l.prototype.delete=o,l.prototype.get=s,l.prototype.has=a,l.prototype.set=u,e.exports=l},7197:(e,t,n)=>{var r=n(7009).Symbol;e.exports=r},6219:(e,t,n)=>{var r=n(7009).Uint8Array;e.exports=r},7091:(e,t,n)=>{var r=n(8136)(n(7009),"WeakMap");e.exports=r},4903:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n{var r=n(6478),i=n(4963),o=n(3629),s=n(5174),a=n(6800),u=n(9102),l=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=o(e),c=!n&&i(e),d=!n&&!c&&s(e),h=!n&&!c&&!d&&u(e),f=n||c||d||h,p=f?r(e.length,String):[],g=p.length;for(var m in e)!t&&!l.call(e,m)||f&&("length"==m||d&&("offset"==m||"parent"==m)||h&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||a(m,g))||p.push(m);return p}},8950:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n{e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n{var r=n(9231);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},2526:(e,t,n)=>{var r=n(8528);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},5099:(e,t,n)=>{var r=n(372)();e.exports=r},5358:(e,t,n)=>{var r=n(5099),i=n(2742);e.exports=function(e,t){return e&&r(e,t,i)}},8667:(e,t,n)=>{var r=n(3082),i=n(9793);e.exports=function(e,t){for(var n=0,o=(t=r(t,e)).length;null!=e&&n{var r=n(1705),i=n(3629);e.exports=function(e,t,n){var o=t(e);return i(e)?o:r(o,n(e))}},9066:(e,t,n)=>{var r=n(7197),i=n(1587),o=n(3581),s=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?i(e):o(e)}},529:e=>{e.exports=function(e,t){return null!=e&&t in Object(e)}},4906:(e,t,n)=>{var r=n(9066),i=n(3141);e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},1848:(e,t,n)=>{var r=n(3355),i=n(3141);e.exports=function e(t,n,o,s,a){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!==t&&n!==n:r(t,n,o,s,e,a))}},3355:(e,t,n)=>{var r=n(2854),i=n(5305),o=n(2206),s=n(8078),a=n(8383),u=n(3629),l=n(5174),c=n(9102),d="[object Arguments]",h="[object Array]",f="[object Object]",p=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,g,m,y){var v=u(e),w=u(t),_=v?h:a(e),b=w?h:a(t),S=(_=_==d?f:_)==f,x=(b=b==d?f:b)==f,E=_==b;if(E&&l(e)){if(!l(t))return!1;v=!0,S=!1}if(E&&!S)return y||(y=new r),v||c(e)?i(e,t,n,g,m,y):o(e,t,_,n,g,m,y);if(!(1&n)){var k=S&&p.call(e,"__wrapped__"),C=x&&p.call(t,"__wrapped__");if(k||C){var P=k?e.value():e,T=C?t.value():t;return y||(y=new r),m(P,T,n,g,y)}}return!!E&&(y||(y=new r),s(e,t,n,g,m,y))}},8856:(e,t,n)=>{var r=n(2854),i=n(1848);e.exports=function(e,t,n,o){var s=n.length,a=s,u=!o;if(null==e)return!a;for(e=Object(e);s--;){var l=n[s];if(u&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++s{var r=n(4786),i=n(257),o=n(8092),s=n(7907),a=/^\[object .+?Constructor\]$/,u=Function.prototype,l=Object.prototype,c=u.toString,d=l.hasOwnProperty,h=RegExp("^"+c.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?h:a).test(s(e))}},8150:(e,t,n)=>{var r=n(9066),i=n(4635),o=n(3141),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!s[r(e)]}},6025:(e,t,n)=>{var r=n(7080),i=n(4322),o=n(2100),s=n(3629),a=n(38);e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?s(e)?i(e[0],e[1]):r(e):a(e)}},3654:(e,t,n)=>{var r=n(2936),i=n(8836),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},7080:(e,t,n)=>{var r=n(8856),i=n(9091),o=n(284);e.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},4322:(e,t,n)=>{var r=n(1848),i=n(6181),o=n(5658),s=n(5823),a=n(5072),u=n(284),l=n(9793);e.exports=function(e,t){return s(e)&&a(t)?u(l(e),t):function(n){var s=i(n,e);return void 0===s&&s===t?o(n,e):r(t,s,3)}}},9586:e=>{e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},4084:(e,t,n)=>{var r=n(8667);e.exports=function(e){return function(t){return r(t,e)}}},6478:e=>{e.exports=function(e,t){for(var n=-1,r=Array(e);++n{var r=n(7197),i=n(8950),o=n(3629),s=n(152),a=r?r.prototype:void 0,u=a?a.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(s(t))return u?u.call(t):"";var n=t+"";return"0"==n&&1/t==-Infinity?"-0":n}},6194:e=>{e.exports=function(e){return function(t){return e(t)}}},75:e=>{e.exports=function(e,t){return e.has(t)}},3082:(e,t,n)=>{var r=n(3629),i=n(5823),o=n(170),s=n(3518);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(s(e))}},5525:(e,t,n)=>{var r=n(7009)["__core-js_shared__"];e.exports=r},372:e=>{e.exports=function(e){return function(t,n,r){for(var i=-1,o=Object(t),s=r(t),a=s.length;a--;){var u=s[e?a:++i];if(!1===n(o[u],u,o))break}return t}}},8528:(e,t,n)=>{var r=n(8136),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(t){}}();e.exports=i},5305:(e,t,n)=>{var r=n(692),i=n(7897),o=n(75);e.exports=function(e,t,n,s,a,u){var l=1&n,c=e.length,d=t.length;if(c!=d&&!(l&&d>c))return!1;var h=u.get(e),f=u.get(t);if(h&&f)return h==t&&f==e;var p=-1,g=!0,m=2&n?new r:void 0;for(u.set(e,t),u.set(t,e);++p{var r=n(7197),i=n(6219),o=n(9231),s=n(5305),a=n(234),u=n(2230),l=r?r.prototype:void 0,c=l?l.valueOf:void 0;e.exports=function(e,t,n,r,l,d,h){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!d(new i(e),new i(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var f=a;case"[object Set]":var p=1&r;if(f||(f=u),e.size!=t.size&&!p)return!1;var g=h.get(e);if(g)return g==t;r|=2,h.set(e,t);var m=s(f(e),f(t),r,l,d,h);return h.delete(e),m;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}},8078:(e,t,n)=>{var r=n(8248),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,s,a){var u=1&n,l=r(e),c=l.length;if(c!=r(t).length&&!u)return!1;for(var d=c;d--;){var h=l[d];if(!(u?h in t:i.call(t,h)))return!1}var f=a.get(e),p=a.get(t);if(f&&p)return f==t&&p==e;var g=!0;a.set(e,t),a.set(t,e);for(var m=u;++d{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},8248:(e,t,n)=>{var r=n(1986),i=n(5918),o=n(2742);e.exports=function(e){return r(e,o,i)}},2799:(e,t,n)=>{var r=n(5964);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},9091:(e,t,n)=>{var r=n(5072),i=n(2742);e.exports=function(e){for(var t=i(e),n=t.length;n--;){var o=t[n],s=e[o];t[n]=[o,s,r(s)]}return t}},8136:(e,t,n)=>{var r=n(6703),i=n(40);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},1587:(e,t,n)=>{var r=n(7197),i=Object.prototype,o=i.hasOwnProperty,s=i.toString,a=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,a),n=e[a];try{e[a]=void 0;var r=!0}catch(u){}var i=s.call(e);return r&&(t?e[a]=n:delete e[a]),i}},5918:(e,t,n)=>{var r=n(4903),i=n(8174),o=Object.prototype.propertyIsEnumerable,s=Object.getOwnPropertySymbols,a=s?function(e){return null==e?[]:(e=Object(e),r(s(e),(function(t){return o.call(e,t)})))}:i;e.exports=a},8383:(e,t,n)=>{var r=n(908),i=n(5797),o=n(8319),s=n(3924),a=n(7091),u=n(9066),l=n(7907),c="[object Map]",d="[object Promise]",h="[object Set]",f="[object WeakMap]",p="[object DataView]",g=l(r),m=l(i),y=l(o),v=l(s),w=l(a),_=u;(r&&_(new r(new ArrayBuffer(1)))!=p||i&&_(new i)!=c||o&&_(o.resolve())!=d||s&&_(new s)!=h||a&&_(new a)!=f)&&(_=function(e){var t=u(e),n="[object Object]"==t?e.constructor:void 0,r=n?l(n):"";if(r)switch(r){case g:return p;case m:return c;case y:return d;case v:return h;case w:return f}return t}),e.exports=_},40:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},6417:(e,t,n)=>{var r=n(3082),i=n(4963),o=n(3629),s=n(6800),a=n(4635),u=n(9793);e.exports=function(e,t,n){for(var l=-1,c=(t=r(t,e)).length,d=!1;++l{var r=n(9620);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},2747:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},6037:(e,t,n)=>{var r=n(9620),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(t,e)?t[e]:void 0}},4154:(e,t,n)=>{var r=n(9620),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},7728:(e,t,n)=>{var r=n(9620);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},6800:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e{var r=n(3629),i=n(152),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||(s.test(e)||!o.test(e)||null!=t&&e in Object(t))}},5964:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},257:(e,t,n)=>{var r=n(5525),i=function(){var e=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();e.exports=function(e){return!!i&&i in e}},2936:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},5072:(e,t,n)=>{var r=n(8092);e.exports=function(e){return e===e&&!r(e)}},3894:e=>{e.exports=function(){this.__data__=[],this.size=0}},8699:(e,t,n)=>{var r=n(7112),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0)&&(n==t.length-1?t.pop():i.call(t,n,1),--this.size,!0)}},4957:(e,t,n)=>{var r=n(7112);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},7184:(e,t,n)=>{var r=n(7112);e.exports=function(e){return r(this.__data__,e)>-1}},7109:(e,t,n)=>{var r=n(7112);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},4086:(e,t,n)=>{var r=n(9676),i=n(8384),o=n(5797);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},9255:(e,t,n)=>{var r=n(2799);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},9186:(e,t,n)=>{var r=n(2799);e.exports=function(e){return r(this,e).get(e)}},3423:(e,t,n)=>{var r=n(2799);e.exports=function(e){return r(this,e).has(e)}},3739:(e,t,n)=>{var r=n(2799);e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},234:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},284:e=>{e.exports=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}},4634:(e,t,n)=>{var r=n(9151);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},9620:(e,t,n)=>{var r=n(8136)(Object,"create");e.exports=r},8836:(e,t,n)=>{var r=n(2709)(Object.keys,Object);e.exports=r},9494:(e,t,n)=>{e=n.nmd(e);var r=n(1032),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,s=o&&o.exports===i&&r.process,a=function(){try{var e=o&&o.require&&o.require("util").types;return e||s&&s.binding&&s.binding("util")}catch(t){}}();e.exports=a},3581:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},2709:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},7009:(e,t,n)=>{var r=n(1032),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},5774:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},1596:e=>{e.exports=function(e){return this.__data__.has(e)}},2230:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},511:(e,t,n)=>{var r=n(8384);e.exports=function(){this.__data__=new r,this.size=0}},835:e=>{e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},707:e=>{e.exports=function(e){return this.__data__.get(e)}},8832:e=>{e.exports=function(e){return this.__data__.has(e)}},5077:(e,t,n)=>{var r=n(8384),i=n(5797),o=n(8059);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var s=n.__data__;if(!i||s.length<199)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(s)}return n.set(e,t),this.size=n.size,this}},170:(e,t,n)=>{var r=n(4634),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,s=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,n,r,i){t.push(r?i.replace(o,"$1"):n||e)})),t}));e.exports=s},9793:(e,t,n)=>{var r=n(152);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}},7907:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(n){}try{return e+""}catch(n){}}return""}},9231:e=>{e.exports=function(e,t){return e===t||e!==e&&t!==t}},6181:(e,t,n)=>{var r=n(8667);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},5658:(e,t,n)=>{var r=n(529),i=n(6417);e.exports=function(e,t){return null!=e&&i(e,t,r)}},2100:e=>{e.exports=function(e){return e}},4963:(e,t,n)=>{var r=n(4906),i=n(3141),o=Object.prototype,s=o.hasOwnProperty,a=o.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(e){return i(e)&&s.call(e,"callee")&&!a.call(e,"callee")};e.exports=u},3629:e=>{var t=Array.isArray;e.exports=t},1473:(e,t,n)=>{var r=n(4786),i=n(4635);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},5174:(e,t,n)=>{e=n.nmd(e);var r=n(7009),i=n(9488),o=t&&!t.nodeType&&t,s=o&&e&&!e.nodeType&&e,a=s&&s.exports===o?r.Buffer:void 0,u=(a?a.isBuffer:void 0)||i;e.exports=u},8111:(e,t,n)=>{var r=n(1848);e.exports=function(e,t){return r(e,t)}},4786:(e,t,n)=>{var r=n(9066),i=n(8092);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},4635:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},8092:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},3141:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},152:(e,t,n)=>{var r=n(9066),i=n(3141);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},9102:(e,t,n)=>{var r=n(8150),i=n(6194),o=n(9494),s=o&&o.isTypedArray,a=s?i(s):r;e.exports=a},2742:(e,t,n)=>{var r=n(7538),i=n(3654),o=n(1473);e.exports=function(e){return o(e)?r(e):i(e)}},763:function(e,t,n){var r;e=n.nmd(e),function(){var i,o="Expected a function",s="__lodash_hash_undefined__",a="__lodash_placeholder__",u=16,l=32,c=64,d=128,h=256,f=1/0,p=9007199254740991,g=NaN,m=4294967295,y=[["ary",d],["bind",1],["bindKey",2],["curry",8],["curryRight",u],["flip",512],["partial",l],["partialRight",c],["rearg",h]],v="[object Arguments]",w="[object Array]",_="[object Boolean]",b="[object Date]",S="[object Error]",x="[object Function]",E="[object GeneratorFunction]",k="[object Map]",C="[object Number]",P="[object Object]",T="[object Promise]",A="[object RegExp]",O="[object Set]",I="[object String]",j="[object Symbol]",L="[object WeakMap]",R="[object ArrayBuffer]",F="[object DataView]",M="[object Float32Array]",N="[object Float64Array]",D="[object Int8Array]",U="[object Int16Array]",$="[object Int32Array]",B="[object Uint8Array]",z="[object Uint8ClampedArray]",H="[object Uint16Array]",V="[object Uint32Array]",q=/\b__p \+= '';/g,W=/\b(__p \+=) '' \+/g,K=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Z=/&(?:amp|lt|gt|quot|#39);/g,G=/[&<>"']/g,J=RegExp(Z.source),Q=RegExp(G.source),Y=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,ee=/<%=([\s\S]+?)%>/g,te=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ne=/^\w*$/,re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ie=/[\\^$.*+?()[\]{}|]/g,oe=RegExp(ie.source),se=/^\s+/,ae=/\s/,ue=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,le=/\{\n\/\* \[wrapped with (.+)\] \*/,ce=/,? & /,de=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,he=/[()=,{}\[\]\/\s]/,fe=/\\(\\)?/g,pe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ge=/\w*$/,me=/^[-+]0x[0-9a-f]+$/i,ye=/^0b[01]+$/i,ve=/^\[object .+?Constructor\]$/,we=/^0o[0-7]+$/i,_e=/^(?:0|[1-9]\d*)$/,be=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Se=/($^)/,xe=/['\n\r\u2028\u2029\\]/g,Ee="\\ud800-\\udfff",ke="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ce="\\u2700-\\u27bf",Pe="a-z\\xdf-\\xf6\\xf8-\\xff",Te="A-Z\\xc0-\\xd6\\xd8-\\xde",Ae="\\ufe0e\\ufe0f",Oe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ie="['\u2019]",je="["+Ee+"]",Le="["+Oe+"]",Re="["+ke+"]",Fe="\\d+",Me="["+Ce+"]",Ne="["+Pe+"]",De="[^"+Ee+Oe+Fe+Ce+Pe+Te+"]",Ue="\\ud83c[\\udffb-\\udfff]",$e="[^"+Ee+"]",Be="(?:\\ud83c[\\udde6-\\uddff]){2}",ze="[\\ud800-\\udbff][\\udc00-\\udfff]",He="["+Te+"]",Ve="\\u200d",qe="(?:"+Ne+"|"+De+")",We="(?:"+He+"|"+De+")",Ke="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",Ze="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Ge="(?:"+Re+"|"+Ue+")"+"?",Je="["+Ae+"]?",Qe=Je+Ge+("(?:"+Ve+"(?:"+[$e,Be,ze].join("|")+")"+Je+Ge+")*"),Ye="(?:"+[Me,Be,ze].join("|")+")"+Qe,Xe="(?:"+[$e+Re+"?",Re,Be,ze,je].join("|")+")",et=RegExp(Ie,"g"),tt=RegExp(Re,"g"),nt=RegExp(Ue+"(?="+Ue+")|"+Xe+Qe,"g"),rt=RegExp([He+"?"+Ne+"+"+Ke+"(?="+[Le,He,"$"].join("|")+")",We+"+"+Ze+"(?="+[Le,He+qe,"$"].join("|")+")",He+"?"+qe+"+"+Ke,He+"+"+Ze,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Fe,Ye].join("|"),"g"),it=RegExp("["+Ve+Ee+ke+Ae+"]"),ot=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,st=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],at=-1,ut={};ut[M]=ut[N]=ut[D]=ut[U]=ut[$]=ut[B]=ut[z]=ut[H]=ut[V]=!0,ut[v]=ut[w]=ut[R]=ut[_]=ut[F]=ut[b]=ut[S]=ut[x]=ut[k]=ut[C]=ut[P]=ut[A]=ut[O]=ut[I]=ut[L]=!1;var lt={};lt[v]=lt[w]=lt[R]=lt[F]=lt[_]=lt[b]=lt[M]=lt[N]=lt[D]=lt[U]=lt[$]=lt[k]=lt[C]=lt[P]=lt[A]=lt[O]=lt[I]=lt[j]=lt[B]=lt[z]=lt[H]=lt[V]=!0,lt[S]=lt[x]=lt[L]=!1;var ct={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},dt=parseFloat,ht=parseInt,ft="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,pt="object"==typeof self&&self&&self.Object===Object&&self,gt=ft||pt||Function("return this")(),mt=t&&!t.nodeType&&t,yt=mt&&e&&!e.nodeType&&e,vt=yt&&yt.exports===mt,wt=vt&&ft.process,_t=function(){try{var e=yt&&yt.require&&yt.require("util").types;return e||wt&&wt.binding&&wt.binding("util")}catch(t){}}(),bt=_t&&_t.isArrayBuffer,St=_t&&_t.isDate,xt=_t&&_t.isMap,Et=_t&&_t.isRegExp,kt=_t&&_t.isSet,Ct=_t&&_t.isTypedArray;function Pt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Tt(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i-1}function Rt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function rn(e,t){for(var n=e.length;n--&&Ht(t,e[n],0)>-1;);return n}function on(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var sn=Zt({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),an=Zt({"&":"&","<":"<",">":">",'"':""","'":"'"});function un(e){return"\\"+ct[e]}function ln(e){return it.test(e)}function cn(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function dn(e,t){return function(n){return e(t(n))}}function hn(e,t){for(var n=-1,r=e.length,i=0,o=[];++n",""":'"',"'":"'"});var wn=function e(t){var n=(t=null==t?gt:wn.defaults(gt.Object(),t,wn.pick(gt,st))).Array,r=t.Date,ae=t.Error,Ee=t.Function,ke=t.Math,Ce=t.Object,Pe=t.RegExp,Te=t.String,Ae=t.TypeError,Oe=n.prototype,Ie=Ee.prototype,je=Ce.prototype,Le=t["__core-js_shared__"],Re=Ie.toString,Fe=je.hasOwnProperty,Me=0,Ne=function(){var e=/[^.]+$/.exec(Le&&Le.keys&&Le.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),De=je.toString,Ue=Re.call(Ce),$e=gt._,Be=Pe("^"+Re.call(Fe).replace(ie,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ze=vt?t.Buffer:i,He=t.Symbol,Ve=t.Uint8Array,qe=ze?ze.allocUnsafe:i,We=dn(Ce.getPrototypeOf,Ce),Ke=Ce.create,Ze=je.propertyIsEnumerable,Ge=Oe.splice,Je=He?He.isConcatSpreadable:i,Qe=He?He.iterator:i,Ye=He?He.toStringTag:i,Xe=function(){try{var e=fo(Ce,"defineProperty");return e({},"",{}),e}catch(t){}}(),nt=t.clearTimeout!==gt.clearTimeout&&t.clearTimeout,it=r&&r.now!==gt.Date.now&&r.now,ct=t.setTimeout!==gt.setTimeout&&t.setTimeout,ft=ke.ceil,pt=ke.floor,mt=Ce.getOwnPropertySymbols,yt=ze?ze.isBuffer:i,wt=t.isFinite,_t=Oe.join,$t=dn(Ce.keys,Ce),Zt=ke.max,_n=ke.min,bn=r.now,Sn=t.parseInt,xn=ke.random,En=Oe.reverse,kn=fo(t,"DataView"),Cn=fo(t,"Map"),Pn=fo(t,"Promise"),Tn=fo(t,"Set"),An=fo(t,"WeakMap"),On=fo(Ce,"create"),In=An&&new An,jn={},Ln=$o(kn),Rn=$o(Cn),Fn=$o(Pn),Mn=$o(Tn),Nn=$o(An),Dn=He?He.prototype:i,Un=Dn?Dn.valueOf:i,$n=Dn?Dn.toString:i;function Bn(e){if(ra(e)&&!Ws(e)&&!(e instanceof qn)){if(e instanceof Vn)return e;if(Fe.call(e,"__wrapped__"))return Bo(e)}return new Vn(e)}var zn=function(){function e(){}return function(t){if(!na(t))return{};if(Ke)return Ke(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function Hn(){}function Vn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function qn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=m,this.__views__=[]}function Wn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function lr(e,t,n,r,o,s){var a,u=1&t,l=2&t,c=4&t;if(n&&(a=o?n(e,r,o,s):n(e)),a!==i)return a;if(!na(e))return e;var d=Ws(e);if(d){if(a=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&Fe.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!u)return Oi(e,a)}else{var h=mo(e),f=h==x||h==E;if(Js(e))return Ei(e,u);if(h==P||h==v||f&&!o){if(a=l||f?{}:vo(e),!u)return l?function(e,t){return Ii(e,go(e),t)}(e,function(e,t){return e&&Ii(t,Ra(t),e)}(a,e)):function(e,t){return Ii(e,po(e),t)}(e,or(a,e))}else{if(!lt[h])return o?e:{};a=function(e,t,n){var r=e.constructor;switch(t){case R:return ki(e);case _:case b:return new r(+e);case F:return function(e,t){var n=t?ki(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case M:case N:case D:case U:case $:case B:case z:case H:case V:return Ci(e,n);case k:return new r;case C:case I:return new r(e);case A:return function(e){var t=new e.constructor(e.source,ge.exec(e));return t.lastIndex=e.lastIndex,t}(e);case O:return new r;case j:return i=e,Un?Ce(Un.call(i)):{}}var i}(e,h,u)}}s||(s=new Jn);var p=s.get(e);if(p)return p;s.set(e,a),ua(e)?e.forEach((function(r){a.add(lr(r,t,n,r,e,s))})):ia(e)&&e.forEach((function(r,i){a.set(i,lr(r,t,n,i,e,s))}));var g=d?i:(c?l?oo:io:l?Ra:La)(e);return At(g||e,(function(r,i){g&&(r=e[i=r]),nr(a,i,lr(r,t,n,i,e,s))})),a}function cr(e,t,n){var r=n.length;if(null==e)return!r;for(e=Ce(e);r--;){var o=n[r],s=t[o],a=e[o];if(a===i&&!(o in e)||!s(a))return!1}return!0}function dr(e,t,n){if("function"!=typeof e)throw new Ae(o);return Lo((function(){e.apply(i,n)}),t)}function hr(e,t,n,r){var i=-1,o=Lt,s=!0,a=e.length,u=[],l=t.length;if(!a)return u;n&&(t=Ft(t,Xt(n))),r?(o=Rt,s=!1):t.length>=200&&(o=tn,s=!1,t=new Gn(t));e:for(;++i-1},Kn.prototype.set=function(e,t){var n=this.__data__,r=rr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Zn.prototype.clear=function(){this.size=0,this.__data__={hash:new Wn,map:new(Cn||Kn),string:new Wn}},Zn.prototype.delete=function(e){var t=co(this,e).delete(e);return this.size-=t?1:0,t},Zn.prototype.get=function(e){return co(this,e).get(e)},Zn.prototype.has=function(e){return co(this,e).has(e)},Zn.prototype.set=function(e,t){var n=co(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Gn.prototype.add=Gn.prototype.push=function(e){return this.__data__.set(e,s),this},Gn.prototype.has=function(e){return this.__data__.has(e)},Jn.prototype.clear=function(){this.__data__=new Kn,this.size=0},Jn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Jn.prototype.get=function(e){return this.__data__.get(e)},Jn.prototype.has=function(e){return this.__data__.has(e)},Jn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Kn){var r=n.__data__;if(!Cn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Zn(r)}return n.set(e,t),this.size=n.size,this};var fr=Ri(br),pr=Ri(Sr,!0);function gr(e,t){var n=!0;return fr(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function mr(e,t,n){for(var r=-1,o=e.length;++r0&&n(a)?t>1?vr(a,t-1,n,r,i):Mt(i,a):r||(i[i.length]=a)}return i}var wr=Fi(),_r=Fi(!0);function br(e,t){return e&&wr(e,t,La)}function Sr(e,t){return e&&_r(e,t,La)}function xr(e,t){return jt(t,(function(t){return Xs(e[t])}))}function Er(e,t){for(var n=0,r=(t=_i(t,e)).length;null!=e&&nt}function Tr(e,t){return null!=e&&Fe.call(e,t)}function Ar(e,t){return null!=e&&t in Ce(e)}function Or(e,t,r){for(var o=r?Rt:Lt,s=e[0].length,a=e.length,u=a,l=n(a),c=1/0,d=[];u--;){var h=e[u];u&&t&&(h=Ft(h,Xt(t))),c=_n(h.length,c),l[u]=!r&&(t||s>=120&&h.length>=120)?new Gn(u&&h):i}h=e[0];var f=-1,p=l[0];e:for(;++f=a?u:u*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function Wr(e,t,n){for(var r=-1,i=t.length,o={};++r-1;)a!==e&&Ge.call(a,u,1),Ge.call(e,u,1);return e}function Zr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;_o(i)?Ge.call(e,i,1):hi(e,i)}}return e}function Gr(e,t){return e+pt(xn()*(t-e+1))}function Jr(e,t){var n="";if(!e||t<1||t>p)return n;do{t%2&&(n+=e),(t=pt(t/2))&&(e+=e)}while(t);return n}function Qr(e,t){return Ro(To(e,t,ou),e+"")}function Yr(e){return Yn(za(e))}function Xr(e,t){var n=za(e);return No(n,ur(t,0,n.length))}function ei(e,t,n,r){if(!na(e))return e;for(var o=-1,s=(t=_i(t,e)).length,a=s-1,u=e;null!=u&&++oo?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var s=n(o);++i>>1,s=e[o];null!==s&&!ca(s)&&(n?s<=t:s=200){var l=t?null:Ji(e);if(l)return fn(l);s=!1,i=tn,u=new Gn}else u=t?[]:a;e:for(;++r=r?e:ii(e,t,n)}var xi=nt||function(e){return gt.clearTimeout(e)};function Ei(e,t){if(t)return e.slice();var n=e.length,r=qe?qe(n):new e.constructor(n);return e.copy(r),r}function ki(e){var t=new e.constructor(e.byteLength);return new Ve(t).set(new Ve(e)),t}function Ci(e,t){var n=t?ki(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Pi(e,t){if(e!==t){var n=e!==i,r=null===e,o=e===e,s=ca(e),a=t!==i,u=null===t,l=t===t,c=ca(t);if(!u&&!c&&!s&&e>t||s&&a&&l&&!u&&!c||r&&a&&l||!n&&l||!o)return 1;if(!r&&!s&&!c&&e1?n[o-1]:i,a=o>2?n[2]:i;for(s=e.length>3&&"function"==typeof s?(o--,s):i,a&&bo(n[0],n[1],a)&&(s=o<3?i:s,o=1),t=Ce(t);++r-1?o[s?t[a]:a]:i}}function $i(e){return ro((function(t){var n=t.length,r=n,s=Vn.prototype.thru;for(e&&t.reverse();r--;){var a=t[r];if("function"!=typeof a)throw new Ae(o);if(s&&!u&&"wrapper"==ao(a))var u=new Vn([],!0)}for(r=u?r:n;++r1&&w.reverse(),f&&cu))return!1;var c=s.get(e),d=s.get(t);if(c&&d)return c==t&&d==e;var h=-1,f=!0,p=2&n?new Gn:i;for(s.set(e,t),s.set(t,e);++h-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(ue,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return At(y,(function(n){var r="_."+n[0];t&n[1]&&!Lt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(le);return t?t[1].split(ce):[]}(r),n)))}function Mo(e){var t=0,n=0;return function(){var r=bn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function No(e,t){var n=-1,r=e.length,o=r-1;for(t=t===i?r:t;++n1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,as(e,n)}));function ps(e){var t=Bn(e);return t.__chain__=!0,t}function gs(e,t){return t(e)}var ms=ro((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return ar(t,e)};return!(t>1||this.__actions__.length)&&r instanceof qn&&_o(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:gs,args:[o],thisArg:i}),new Vn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)}));var ys=ji((function(e,t,n){Fe.call(e,n)?++e[n]:sr(e,n,1)}));var vs=Ui(qo),ws=Ui(Wo);function _s(e,t){return(Ws(e)?At:fr)(e,lo(t,3))}function bs(e,t){return(Ws(e)?Ot:pr)(e,lo(t,3))}var Ss=ji((function(e,t,n){Fe.call(e,n)?e[n].push(t):sr(e,n,[t])}));var xs=Qr((function(e,t,r){var i=-1,o="function"==typeof t,s=Zs(e)?n(e.length):[];return fr(e,(function(e){s[++i]=o?Pt(t,e,r):Ir(e,t,r)})),s})),Es=ji((function(e,t,n){sr(e,n,t)}));function ks(e,t){return(Ws(e)?Ft:$r)(e,lo(t,3))}var Cs=ji((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var Ps=Qr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&bo(e,t[0],t[1])?t=[]:n>2&&bo(t[0],t[1],t[2])&&(t=[t[0]]),qr(e,vr(t,1),[])})),Ts=it||function(){return gt.Date.now()};function As(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,Yi(e,d,i,i,i,i,t)}function Os(e,t){var n;if("function"!=typeof t)throw new Ae(o);return e=ma(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var Is=Qr((function(e,t,n){var r=1;if(n.length){var i=hn(n,uo(Is));r|=l}return Yi(e,r,t,n,i)})),js=Qr((function(e,t,n){var r=3;if(n.length){var i=hn(n,uo(js));r|=l}return Yi(t,r,e,n,i)}));function Ls(e,t,n){var r,s,a,u,l,c,d=0,h=!1,f=!1,p=!0;if("function"!=typeof e)throw new Ae(o);function g(t){var n=r,o=s;return r=s=i,d=t,u=e.apply(o,n)}function m(e){return d=e,l=Lo(v,t),h?g(e):u}function y(e){var n=e-c;return c===i||n>=t||n<0||f&&e-d>=a}function v(){var e=Ts();if(y(e))return w(e);l=Lo(v,function(e){var n=t-(e-c);return f?_n(n,a-(e-d)):n}(e))}function w(e){return l=i,p&&r?g(e):(r=s=i,u)}function _(){var e=Ts(),n=y(e);if(r=arguments,s=this,c=e,n){if(l===i)return m(c);if(f)return xi(l),l=Lo(v,t),g(c)}return l===i&&(l=Lo(v,t)),u}return t=va(t)||0,na(n)&&(h=!!n.leading,a=(f="maxWait"in n)?Zt(va(n.maxWait)||0,t):a,p="trailing"in n?!!n.trailing:p),_.cancel=function(){l!==i&&xi(l),d=0,r=c=s=l=i},_.flush=function(){return l===i?u:w(Ts())},_}var Rs=Qr((function(e,t){return dr(e,1,t)})),Fs=Qr((function(e,t,n){return dr(e,va(t)||0,n)}));function Ms(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ae(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Ms.Cache||Zn),n}function Ns(e){if("function"!=typeof e)throw new Ae(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ms.Cache=Zn;var Ds=bi((function(e,t){var n=(t=1==t.length&&Ws(t[0])?Ft(t[0],Xt(lo())):Ft(vr(t,1),Xt(lo()))).length;return Qr((function(r){for(var i=-1,o=_n(r.length,n);++i=t})),qs=jr(function(){return arguments}())?jr:function(e){return ra(e)&&Fe.call(e,"callee")&&!Ze.call(e,"callee")},Ws=n.isArray,Ks=bt?Xt(bt):function(e){return ra(e)&&Cr(e)==R};function Zs(e){return null!=e&&ta(e.length)&&!Xs(e)}function Gs(e){return ra(e)&&Zs(e)}var Js=yt||vu,Qs=St?Xt(St):function(e){return ra(e)&&Cr(e)==b};function Ys(e){if(!ra(e))return!1;var t=Cr(e);return t==S||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!sa(e)}function Xs(e){if(!na(e))return!1;var t=Cr(e);return t==x||t==E||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ea(e){return"number"==typeof e&&e==ma(e)}function ta(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=p}function na(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ra(e){return null!=e&&"object"==typeof e}var ia=xt?Xt(xt):function(e){return ra(e)&&mo(e)==k};function oa(e){return"number"==typeof e||ra(e)&&Cr(e)==C}function sa(e){if(!ra(e)||Cr(e)!=P)return!1;var t=We(e);if(null===t)return!0;var n=Fe.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Re.call(n)==Ue}var aa=Et?Xt(Et):function(e){return ra(e)&&Cr(e)==A};var ua=kt?Xt(kt):function(e){return ra(e)&&mo(e)==O};function la(e){return"string"==typeof e||!Ws(e)&&ra(e)&&Cr(e)==I}function ca(e){return"symbol"==typeof e||ra(e)&&Cr(e)==j}var da=Ct?Xt(Ct):function(e){return ra(e)&&ta(e.length)&&!!ut[Cr(e)]};var ha=Ki(Ur),fa=Ki((function(e,t){return e<=t}));function pa(e){if(!e)return[];if(Zs(e))return la(e)?mn(e):Oi(e);if(Qe&&e[Qe])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Qe]());var t=mo(e);return(t==k?cn:t==O?fn:za)(e)}function ga(e){return e?(e=va(e))===f||e===-1/0?17976931348623157e292*(e<0?-1:1):e===e?e:0:0===e?e:0}function ma(e){var t=ga(e),n=t%1;return t===t?n?t-n:t:0}function ya(e){return e?ur(ma(e),0,m):0}function va(e){if("number"==typeof e)return e;if(ca(e))return g;if(na(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=na(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Yt(e);var n=ye.test(e);return n||we.test(e)?ht(e.slice(2),n?2:8):me.test(e)?g:+e}function wa(e){return Ii(e,Ra(e))}function _a(e){return null==e?"":ci(e)}var ba=Li((function(e,t){if(ko(t)||Zs(t))Ii(t,La(t),e);else for(var n in t)Fe.call(t,n)&&nr(e,n,t[n])})),Sa=Li((function(e,t){Ii(t,Ra(t),e)})),xa=Li((function(e,t,n,r){Ii(t,Ra(t),e,r)})),Ea=Li((function(e,t,n,r){Ii(t,La(t),e,r)})),ka=ro(ar);var Ca=Qr((function(e,t){e=Ce(e);var n=-1,r=t.length,o=r>2?t[2]:i;for(o&&bo(t[0],t[1],o)&&(r=1);++n1),t})),Ii(e,oo(e),n),r&&(n=lr(n,7,to));for(var i=t.length;i--;)hi(n,t[i]);return n}));var Da=ro((function(e,t){return null==e?{}:function(e,t){return Wr(e,t,(function(t,n){return Aa(e,n)}))}(e,t)}));function Ua(e,t){if(null==e)return{};var n=Ft(oo(e),(function(e){return[e]}));return t=lo(t),Wr(e,n,(function(e,n){return t(e,n[0])}))}var $a=Qi(La),Ba=Qi(Ra);function za(e){return null==e?[]:en(e,La(e))}var Ha=Ni((function(e,t,n){return t=t.toLowerCase(),e+(n?Va(t):t)}));function Va(e){return Ya(_a(e).toLowerCase())}function qa(e){return(e=_a(e))&&e.replace(be,sn).replace(tt,"")}var Wa=Ni((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Ka=Ni((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Za=Mi("toLowerCase");var Ga=Ni((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Ja=Ni((function(e,t,n){return e+(n?" ":"")+Ya(t)}));var Qa=Ni((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Ya=Mi("toUpperCase");function Xa(e,t,n){return e=_a(e),(t=n?i:t)===i?function(e){return ot.test(e)}(e)?function(e){return e.match(rt)||[]}(e):function(e){return e.match(de)||[]}(e):e.match(t)||[]}var eu=Qr((function(e,t){try{return Pt(e,i,t)}catch(n){return Ys(n)?n:new ae(n)}})),tu=ro((function(e,t){return At(t,(function(t){t=Uo(t),sr(e,t,Is(e[t],e))})),e}));function nu(e){return function(){return e}}var ru=$i(),iu=$i(!0);function ou(e){return e}function su(e){return Mr("function"==typeof e?e:lr(e,1))}var au=Qr((function(e,t){return function(n){return Ir(n,e,t)}})),uu=Qr((function(e,t){return function(n){return Ir(e,n,t)}}));function lu(e,t,n){var r=La(t),i=xr(t,r);null!=n||na(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=xr(t,La(t)));var o=!(na(n)&&"chain"in n)||!!n.chain,s=Xs(e);return At(i,(function(n){var r=t[n];e[n]=r,s&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=Oi(this.__actions__);return i.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Mt([this.value()],arguments))})})),e}function cu(){}var du=Vi(Ft),hu=Vi(It),fu=Vi(Ut);function pu(e){return So(e)?Kt(Uo(e)):function(e){return function(t){return Er(t,e)}}(e)}var gu=Wi(),mu=Wi(!0);function yu(){return[]}function vu(){return!1}var wu=Hi((function(e,t){return e+t}),0),_u=Gi("ceil"),bu=Hi((function(e,t){return e/t}),1),Su=Gi("floor");var xu=Hi((function(e,t){return e*t}),1),Eu=Gi("round"),ku=Hi((function(e,t){return e-t}),0);return Bn.after=function(e,t){if("function"!=typeof t)throw new Ae(o);return e=ma(e),function(){if(--e<1)return t.apply(this,arguments)}},Bn.ary=As,Bn.assign=ba,Bn.assignIn=Sa,Bn.assignInWith=xa,Bn.assignWith=Ea,Bn.at=ka,Bn.before=Os,Bn.bind=Is,Bn.bindAll=tu,Bn.bindKey=js,Bn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ws(e)?e:[e]},Bn.chain=ps,Bn.chunk=function(e,t,r){t=(r?bo(e,t,r):t===i)?1:Zt(ma(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var s=0,a=0,u=n(ft(o/t));so?0:o+n),(r=r===i||r>o?o:ma(r))<0&&(r+=o),r=n>r?0:ya(r);n>>0)?(e=_a(e))&&("string"==typeof t||null!=t&&!aa(t))&&!(t=ci(t))&&ln(e)?Si(mn(e),0,n):e.split(t,n):[]},Bn.spread=function(e,t){if("function"!=typeof e)throw new Ae(o);return t=null==t?0:Zt(ma(t),0),Qr((function(n){var r=n[t],i=Si(n,0,t);return r&&Mt(i,r),Pt(e,this,i)}))},Bn.tail=function(e){var t=null==e?0:e.length;return t?ii(e,1,t):[]},Bn.take=function(e,t,n){return e&&e.length?ii(e,0,(t=n||t===i?1:ma(t))<0?0:t):[]},Bn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?ii(e,(t=r-(t=n||t===i?1:ma(t)))<0?0:t,r):[]},Bn.takeRightWhile=function(e,t){return e&&e.length?pi(e,lo(t,3),!1,!0):[]},Bn.takeWhile=function(e,t){return e&&e.length?pi(e,lo(t,3)):[]},Bn.tap=function(e,t){return t(e),e},Bn.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new Ae(o);return na(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Ls(e,t,{leading:r,maxWait:t,trailing:i})},Bn.thru=gs,Bn.toArray=pa,Bn.toPairs=$a,Bn.toPairsIn=Ba,Bn.toPath=function(e){return Ws(e)?Ft(e,Uo):ca(e)?[e]:Oi(Do(_a(e)))},Bn.toPlainObject=wa,Bn.transform=function(e,t,n){var r=Ws(e),i=r||Js(e)||da(e);if(t=lo(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:na(e)&&Xs(o)?zn(We(e)):{}}return(i?At:br)(e,(function(e,r,i){return t(n,e,r,i)})),n},Bn.unary=function(e){return As(e,1)},Bn.union=rs,Bn.unionBy=is,Bn.unionWith=os,Bn.uniq=function(e){return e&&e.length?di(e):[]},Bn.uniqBy=function(e,t){return e&&e.length?di(e,lo(t,2)):[]},Bn.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?di(e,i,t):[]},Bn.unset=function(e,t){return null==e||hi(e,t)},Bn.unzip=ss,Bn.unzipWith=as,Bn.update=function(e,t,n){return null==e?e:fi(e,t,wi(n))},Bn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:fi(e,t,wi(n),r)},Bn.values=za,Bn.valuesIn=function(e){return null==e?[]:en(e,Ra(e))},Bn.without=us,Bn.words=Xa,Bn.wrap=function(e,t){return Us(wi(t),e)},Bn.xor=ls,Bn.xorBy=cs,Bn.xorWith=ds,Bn.zip=hs,Bn.zipObject=function(e,t){return yi(e||[],t||[],nr)},Bn.zipObjectDeep=function(e,t){return yi(e||[],t||[],ei)},Bn.zipWith=fs,Bn.entries=$a,Bn.entriesIn=Ba,Bn.extend=Sa,Bn.extendWith=xa,lu(Bn,Bn),Bn.add=wu,Bn.attempt=eu,Bn.camelCase=Ha,Bn.capitalize=Va,Bn.ceil=_u,Bn.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=va(n))===n?n:0),t!==i&&(t=(t=va(t))===t?t:0),ur(va(e),t,n)},Bn.clone=function(e){return lr(e,4)},Bn.cloneDeep=function(e){return lr(e,5)},Bn.cloneDeepWith=function(e,t){return lr(e,5,t="function"==typeof t?t:i)},Bn.cloneWith=function(e,t){return lr(e,4,t="function"==typeof t?t:i)},Bn.conformsTo=function(e,t){return null==t||cr(e,t,La(t))},Bn.deburr=qa,Bn.defaultTo=function(e,t){return null==e||e!==e?t:e},Bn.divide=bu,Bn.endsWith=function(e,t,n){e=_a(e),t=ci(t);var r=e.length,o=n=n===i?r:ur(ma(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},Bn.eq=zs,Bn.escape=function(e){return(e=_a(e))&&Q.test(e)?e.replace(G,an):e},Bn.escapeRegExp=function(e){return(e=_a(e))&&oe.test(e)?e.replace(ie,"\\$&"):e},Bn.every=function(e,t,n){var r=Ws(e)?It:gr;return n&&bo(e,t,n)&&(t=i),r(e,lo(t,3))},Bn.find=vs,Bn.findIndex=qo,Bn.findKey=function(e,t){return Bt(e,lo(t,3),br)},Bn.findLast=ws,Bn.findLastIndex=Wo,Bn.findLastKey=function(e,t){return Bt(e,lo(t,3),Sr)},Bn.floor=Su,Bn.forEach=_s,Bn.forEachRight=bs,Bn.forIn=function(e,t){return null==e?e:wr(e,lo(t,3),Ra)},Bn.forInRight=function(e,t){return null==e?e:_r(e,lo(t,3),Ra)},Bn.forOwn=function(e,t){return e&&br(e,lo(t,3))},Bn.forOwnRight=function(e,t){return e&&Sr(e,lo(t,3))},Bn.get=Ta,Bn.gt=Hs,Bn.gte=Vs,Bn.has=function(e,t){return null!=e&&yo(e,t,Tr)},Bn.hasIn=Aa,Bn.head=Zo,Bn.identity=ou,Bn.includes=function(e,t,n,r){e=Zs(e)?e:za(e),n=n&&!r?ma(n):0;var i=e.length;return n<0&&(n=Zt(i+n,0)),la(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Ht(e,t,n)>-1},Bn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:ma(n);return i<0&&(i=Zt(r+i,0)),Ht(e,t,i)},Bn.inRange=function(e,t,n){return t=ga(t),n===i?(n=t,t=0):n=ga(n),function(e,t,n){return e>=_n(t,n)&&e=-9007199254740991&&e<=p},Bn.isSet=ua,Bn.isString=la,Bn.isSymbol=ca,Bn.isTypedArray=da,Bn.isUndefined=function(e){return e===i},Bn.isWeakMap=function(e){return ra(e)&&mo(e)==L},Bn.isWeakSet=function(e){return ra(e)&&"[object WeakSet]"==Cr(e)},Bn.join=function(e,t){return null==e?"":_t.call(e,t)},Bn.kebabCase=Wa,Bn.last=Yo,Bn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=ma(n))<0?Zt(r+o,0):_n(o,r-1)),t===t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):zt(e,qt,o,!0)},Bn.lowerCase=Ka,Bn.lowerFirst=Za,Bn.lt=ha,Bn.lte=fa,Bn.max=function(e){return e&&e.length?mr(e,ou,Pr):i},Bn.maxBy=function(e,t){return e&&e.length?mr(e,lo(t,2),Pr):i},Bn.mean=function(e){return Wt(e,ou)},Bn.meanBy=function(e,t){return Wt(e,lo(t,2))},Bn.min=function(e){return e&&e.length?mr(e,ou,Ur):i},Bn.minBy=function(e,t){return e&&e.length?mr(e,lo(t,2),Ur):i},Bn.stubArray=yu,Bn.stubFalse=vu,Bn.stubObject=function(){return{}},Bn.stubString=function(){return""},Bn.stubTrue=function(){return!0},Bn.multiply=xu,Bn.nth=function(e,t){return e&&e.length?Vr(e,ma(t)):i},Bn.noConflict=function(){return gt._===this&&(gt._=$e),this},Bn.noop=cu,Bn.now=Ts,Bn.pad=function(e,t,n){e=_a(e);var r=(t=ma(t))?gn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return qi(pt(i),n)+e+qi(ft(i),n)},Bn.padEnd=function(e,t,n){e=_a(e);var r=(t=ma(t))?gn(e):0;return t&&rt){var r=e;e=t,t=r}if(n||e%1||t%1){var o=xn();return _n(e+o*(t-e+dt("1e-"+((o+"").length-1))),t)}return Gr(e,t)},Bn.reduce=function(e,t,n){var r=Ws(e)?Nt:Gt,i=arguments.length<3;return r(e,lo(t,4),n,i,fr)},Bn.reduceRight=function(e,t,n){var r=Ws(e)?Dt:Gt,i=arguments.length<3;return r(e,lo(t,4),n,i,pr)},Bn.repeat=function(e,t,n){return t=(n?bo(e,t,n):t===i)?1:ma(t),Jr(_a(e),t)},Bn.replace=function(){var e=arguments,t=_a(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Bn.result=function(e,t,n){var r=-1,o=(t=_i(t,e)).length;for(o||(o=1,e=i);++rp)return[];var n=m,r=_n(e,m);t=lo(t),e-=m;for(var i=Qt(r,t);++n=s)return e;var u=n-gn(r);if(u<1)return r;var l=a?Si(a,0,u).join(""):e.slice(0,u);if(o===i)return l+r;if(a&&(u+=l.length-u),aa(o)){if(e.slice(u).search(o)){var c,d=l;for(o.global||(o=Pe(o.source,_a(ge.exec(o))+"g")),o.lastIndex=0;c=o.exec(d);)var h=c.index;l=l.slice(0,h===i?u:h)}}else if(e.indexOf(ci(o),u)!=u){var f=l.lastIndexOf(o);f>-1&&(l=l.slice(0,f))}return l+r},Bn.unescape=function(e){return(e=_a(e))&&J.test(e)?e.replace(Z,vn):e},Bn.uniqueId=function(e){var t=++Me;return _a(e)+t},Bn.upperCase=Qa,Bn.upperFirst=Ya,Bn.each=_s,Bn.eachRight=bs,Bn.first=Zo,lu(Bn,function(){var e={};return br(Bn,(function(t,n){Fe.call(Bn.prototype,n)||(e[n]=t)})),e}(),{chain:!1}),Bn.VERSION="4.17.21",At(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Bn[e].placeholder=Bn})),At(["drop","take"],(function(e,t){qn.prototype[e]=function(n){n=n===i?1:Zt(ma(n),0);var r=this.__filtered__&&!t?new qn(this):this.clone();return r.__filtered__?r.__takeCount__=_n(n,r.__takeCount__):r.__views__.push({size:_n(n,m),type:e+(r.__dir__<0?"Right":"")}),r},qn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),At(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;qn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:lo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),At(["head","last"],(function(e,t){var n="take"+(t?"Right":"");qn.prototype[e]=function(){return this[n](1).value()[0]}})),At(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");qn.prototype[e]=function(){return this.__filtered__?new qn(this):this[n](1)}})),qn.prototype.compact=function(){return this.filter(ou)},qn.prototype.find=function(e){return this.filter(e).head()},qn.prototype.findLast=function(e){return this.reverse().find(e)},qn.prototype.invokeMap=Qr((function(e,t){return"function"==typeof e?new qn(this):this.map((function(n){return Ir(n,e,t)}))})),qn.prototype.reject=function(e){return this.filter(Ns(lo(e)))},qn.prototype.slice=function(e,t){e=ma(e);var n=this;return n.__filtered__&&(e>0||t<0)?new qn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=ma(t))<0?n.dropRight(-t):n.take(t-e)),n)},qn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},qn.prototype.toArray=function(){return this.take(m)},br(qn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=Bn[r?"take"+("last"==t?"Right":""):t],s=r||/^find/.test(t);o&&(Bn.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,u=t instanceof qn,l=a[0],c=u||Ws(t),d=function(e){var t=o.apply(Bn,Mt([e],a));return r&&h?t[0]:t};c&&n&&"function"==typeof l&&1!=l.length&&(u=c=!1);var h=this.__chain__,f=!!this.__actions__.length,p=s&&!h,g=u&&!f;if(!s&&c){t=g?t:new qn(this);var m=e.apply(t,a);return m.__actions__.push({func:gs,args:[d],thisArg:i}),new Vn(m,h)}return p&&g?e.apply(this,a):(m=this.thru(d),p?r?m.value()[0]:m.value():m)})})),At(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Oe[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Bn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ws(i)?i:[],e)}return this[n]((function(n){return t.apply(Ws(n)?n:[],e)}))}})),br(qn.prototype,(function(e,t){var n=Bn[t];if(n){var r=n.name+"";Fe.call(jn,r)||(jn[r]=[]),jn[r].push({name:t,func:n})}})),jn[Bi(i,2).name]=[{name:"wrapper",func:i}],qn.prototype.clone=function(){var e=new qn(this.__wrapped__);return e.__actions__=Oi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Oi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Oi(this.__views__),e},qn.prototype.reverse=function(){if(this.__filtered__){var e=new qn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},qn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ws(e),r=t<0,i=n?e.length:0,o=function(e,t,n){var r=-1,i=n.length;for(;++r=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Bn.prototype.plant=function(e){for(var t,n=this;n instanceof Hn;){var r=Bo(n);r.__index__=0,r.__values__=i,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},Bn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof qn){var t=e;return this.__actions__.length&&(t=new qn(this)),(t=t.reverse()).__actions__.push({func:gs,args:[ns],thisArg:i}),new Vn(t,this.__chain__)}return this.thru(ns)},Bn.prototype.toJSON=Bn.prototype.valueOf=Bn.prototype.value=function(){return gi(this.__wrapped__,this.__actions__)},Bn.prototype.first=Bn.prototype.head,Qe&&(Bn.prototype[Qe]=function(){return this}),Bn}();gt._=wn,(r=function(){return wn}.call(t,n,t,e))===i||(e.exports=r)}.call(this)},7702:(e,t,n)=>{var r=n(2526),i=n(5358),o=n(6025);e.exports=function(e,t){var n={};return t=o(t,3),i(e,(function(e,i,o){r(n,i,t(e,i,o))})),n}},9151:(e,t,n)=>{var r=n(8059);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},38:(e,t,n)=>{var r=n(9586),i=n(4084),o=n(5823),s=n(9793);e.exports=function(e){return o(e)?r(s(e)):i(e)}},8174:e=>{e.exports=function(){return[]}},9488:e=>{e.exports=function(){return!1}},3518:(e,t,n)=>{var r=n(2446);e.exports=function(e){return null==e?"":r(e)}},1975:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});const r="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i="http://www.w3.org/2001/XMLSchema#",o="http://www.w3.org/2000/10/swap/",s={xsd:{decimal:`${i}decimal`,boolean:`${i}boolean`,double:`${i}double`,integer:`${i}integer`,string:`${i}string`},rdf:{type:`${r}type`,nil:`${r}nil`,first:`${r}first`,rest:`${r}rest`,langString:`${r}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${o}reify#forSome`,forAll:`${o}reify#forAll`},log:{implies:`${o}log#implies`}}},1645:(e,t,n)=>{"use strict";n.d(t,{DP:()=>p,LQ:()=>y,PL:()=>w,Rh:()=>d,Xy:()=>m,ZP:()=>c,_w:()=>g,dW:()=>v,jJ:()=>h,lD:()=>w,t$:()=>f});var r=n(1975),i=n(2065);const{rdf:o,xsd:s}=r.Z;let a,u=0;const l={namedNode:function(e){return new h(e)},blankNode:function(e){return new p(e||"n3-"+u++)},variable:function(e){return new g(e)},literal:function(e,t){if("string"===typeof t)return new f(`"${e}"@${t.toLowerCase()}`);let n=t?t.value:"";""===n&&("boolean"===typeof e?n=s.boolean:"number"===typeof e&&(Number.isFinite(e)?n=Number.isInteger(e)?s.integer:s.double:(n=s.double,Number.isNaN(e)||(e=e>0?"INF":"-INF"))));return""===n||n===s.string?new f(`"${e}"`):new f(`"${e}"^^${n}`)},defaultGraph:function(){return a},quad:_,triple:_},c=l;class d{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof d?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}class h extends d{get termType(){return"NamedNode"}}class f extends d{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const e=this.id;let t=e.lastIndexOf('"')+1;return t{"use strict";n.d(t,{Z:()=>h});var r=n(1975),i=n(4183),o=n.n(i);const{xsd:s}=r.Z,a=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,u={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},l=/[\x00-\x20<>\\"\{\}\|\^\`]/,c={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},d=/$0^/;class h{constructor(e){if(this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,this._prefix=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,this._prefixed=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/,this._variable=/^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<>])/,this._blank=/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/,this._number=/^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<>])/,this._boolean=/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<>])/,this._keyword=/^@[a-z]+(?=[\s#<:])/i,this._sparqlKeyword=/^(?:PREFIX|BASE|GRAPH)(?=[\s#<])/i,this._shortPredicates=/^a(?=[\s#()\[\]\{\}"'<>])/,this._newline=/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,this._comment=/#([^\n\r]*)/,this._whitespace=/^[ \t]+/,this._endOfFile=/^(?:#[^\n\r]*)?$/,e=e||{},this._lineMode=!!e.lineMode){this._n3Mode=!1;for(const e in this)!(e in c)&&this[e]instanceof RegExp&&(this[e]=d)}else this._n3Mode=!1!==e.n3;this._comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,t){let n=this._input,r=n.length;for(;;){let e,a;for(;e=this._newline.exec(n);)this._comments&&(a=this._comment.exec(e[0]))&&i("comment",a[1],"",this._line,e[0].length),n=n.substr(e[0].length,n.length),r=n.length,this._line++;if(!e&&(e=this._whitespace.exec(n))&&(n=n.substr(e[0].length,n.length)),this._endOfFile.test(n))return t&&(this._comments&&(a=this._comment.exec(n))&&i("comment",a[1],"",this._line,n.length),n=null,i("eof","","",this._line,0)),this._input=n;const u=this._line,c=n[0];let d="",h="",f="",p=null,g=0,m=!1;switch(c){case"^":if(n.length<3)break;if("^"!==n[1]){this._n3Mode&&(g=1,d="^");break}if(this._previousMarker="^^",n=n.substr(2),"<"!==n[0]){m=!0;break}case"<":if(p=this._unescapedIri.exec(n))d="IRI",h=p[1];else if(p=this._iri.exec(n)){if(h=this._unescape(p[1]),null===h||l.test(h))return o(this);d="IRI"}else n.length>1&&"<"===n[1]?(d="<<",g=2):this._n3Mode&&n.length>1&&"="===n[1]&&(d="inverse",g=2,h=">");break;case">":n.length>1&&">"===n[1]&&(d=">>",g=2);break;case"_":((p=this._blank.exec(n))||t&&(p=this._blank.exec(`${n} `)))&&(d="blank",f="_",h=p[1]);break;case'"':if(p=this._simpleQuotedString.exec(n))h=p[1];else if(({value:h,matchLength:g}=this._parseLiteral(n)),null===h)return o(this);null===p&&0===g||(d="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(p=this._simpleApostropheString.exec(n))h=p[1];else if(({value:h,matchLength:g}=this._parseLiteral(n)),null===h)return o(this);null===p&&0===g||(d="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(p=this._variable.exec(n))&&(d="var",h=p[0]);break;case"@":"literal"===this._previousMarker&&(p=this._langcode.exec(n))?(d="langcode",h=p[1]):(p=this._keyword.exec(n))&&(d=p[0]);break;case".":if(1===n.length?t:n[1]<"0"||n[1]>"9"){d=".",g=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(p=this._number.exec(n)||t&&(p=this._number.exec(`${n} `)))&&(d="literal",h=p[0],f="string"===typeof p[1]?s.double:"string"===typeof p[2]?s.decimal:s.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(p=this._sparqlKeyword.exec(n))?d=p[0].toUpperCase():m=!0;break;case"f":case"t":(p=this._boolean.exec(n))?(d="literal",h=p[0],f=s.boolean):m=!0;break;case"a":(p=this._shortPredicates.exec(n))?(d="abbreviation",h="a"):m=!0;break;case"=":this._n3Mode&&n.length>1&&(d="abbreviation",">"!==n[1]?(g=1,h="="):(g=2,h=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"}":this._lineMode||(g=1,d=c);break;case"{":!this._lineMode&&n.length>=2&&("|"===n[1]?(d="{|",g=2):(d=c,g=1));break;case"|":n.length>=2&&"}"===n[1]&&(d="|}",g=2);break;default:m=!0}if(m&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(p=this._prefix.exec(n))?((p=this._prefixed.exec(n))||t&&(p=this._prefixed.exec(`${n} `)))&&(d="prefixed",f=p[1]||"",h=this._unescape(p[2])):(d="prefix",h=p[1]||"")),"^^"===this._previousMarker)switch(d){case"prefixed":d="type";break;case"IRI":d="typeIRI";break;default:d=""}if(!d)return t||!/^'''|^"""/.test(n)&&/\n|\r/.test(n)?o(this):this._input=n;const y=g||p[0].length,v=i(d,h,f,u,y);this.previousToken=v,this._previousMarker=d,n=n.substr(y,n.length)}function i(t,i,o,s,a){const u=n?r-n.length:r,l={type:t,value:i,prefix:o,line:s,start:u,end:u+a};return e(null,l),l}function o(t){e(t._syntaxError(/^\S*/.exec(n)[0]))}}_unescape(e){let t=!1;const n=e.replace(a,((e,n,r,i)=>{if("string"===typeof n)return String.fromCharCode(Number.parseInt(n,16));if("string"===typeof r){let e=Number.parseInt(r,16);return e<=65535?String.fromCharCode(Number.parseInt(r,16)):String.fromCharCode(55296+((e-=65536)>>10),56320+(1023&e))}return i in u?u[i]:(t=!0,"")}));return t?null:n}_parseLiteral(e){if(e.length>=3){const t=e.match(/^(?:"""|"|'''|'|)/)[0],n=t.length;let r=Math.max(this._literalClosingPos,n);for(;(r=e.indexOf(t,r))>0;){let t=0;for(;"\\"===e[r-t-1];)t++;if(t%2===0){const t=e.substring(n,r),i=t.split(/\r\n|\r|\n/).length-1,o=r+n;if(1===n&&0!==i||3===n&&this._lineMode)break;return this._line+=i,{value:this._unescape(t),matchLength:o}}r++}this._literalClosingPos=e.length-n+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;const t=new Error(`Unexpected "${e}" on line ${this._line}.`);return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}_readStartingBom(e){return e.startsWith("\ufeff")?e.substr(1):e}tokenize(e,t){if(this._line=1,"string"===typeof e){if(this._input=this._readStartingBom(e),"function"!==typeof t){const e=[];let t;if(this._tokenizeToEnd(((n,r)=>n?t=n:e.push(r)),!0),t)throw t;return e}o()((()=>this._tokenizeToEnd(t,!0)))}else this._pendingBuffer=null,"function"===typeof e.setEncoding&&e.setEncoding("utf8"),e.on("data",(e=>{null!==this._input&&0!==e.length&&(this._pendingBuffer&&(e=Buffer.concat([this._pendingBuffer,e]),this._pendingBuffer=null),128&e[e.length-1]?this._pendingBuffer=e:("undefined"===typeof this._input?this._input=this._readStartingBom("string"===typeof e?e:e.toString()):this._input+=e,this._tokenizeToEnd(t,!1)))})),e.on("end",(()=>{"string"===typeof this._input&&this._tokenizeToEnd(t,!0)})),e.on("error",t)}}},1543:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(8678),i=n(1645),o=n(1975);let s=0;class a{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&l(this,e.factory);const t="string"===typeof e.format?e.format.match(/\w*$/)[0].toLowerCase():"",n=/turtle/.test(t),i=/trig/.test(t),o=/triple/.test(t),s=/quad/.test(t),a=this._n3Mode=/n3/.test(t),u=o||s;(this._supportsNamedGraphs=!(n||a))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(n||i||o||a),this._supportsRDFStar=""===t||/star|\*$/.test(t),u&&(this._resolveRelativeIRI=e=>null),this._blankNodePrefix="string"!==typeof e.blankNodePrefix?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new r.Z({lineMode:u,n3:a}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){s=0}_setBase(e){if(e){const t=e.indexOf("#");t>=0&&(e=e.substr(0,t)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}else this._base="",this._basePath=""}_saveContext(e,t,n,r,i){const o=this._n3Mode;this._contextStack.push({type:e,subject:n,predicate:r,object:i,graph:t,inverse:!!o&&this._inversePredicate,blankPrefix:o?this._prefixes._:"",quantified:o?this._quantified:null}),o&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(e,t){const n=this._contextStack.pop();if(!n||n.type!==e)return this._error(`Unexpected ${t.type}`,t);this._subject=n.subject,this._predicate=n.predicate,this._object=n.object,this._graph=n.graph,this._n3Mode&&(this._inversePredicate=n.inverse,this._prefixes._=n.blankPrefix,this._quantified=n.quantified)}_readInTopContext(e){switch(e.type){case"eof":return null!==this._graph?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}_readEntity(e,t){let n;switch(e.type){case"IRI":case"typeIRI":const t=this._resolveIRI(e.value);if(null===t)return this._error("Invalid IRI",e);n=this._namedNode(t);break;case"type":case"prefixed":const r=this._prefixes[e.prefix];if(void 0===r)return this._error(`Undefined prefix "${e.prefix}:"`,e);n=this._namedNode(r+e.value);break;case"blank":n=this._blankNode(this._prefixes[e.prefix]+e.value);break;case"var":n=this._variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!t&&this._n3Mode&&n.id in this._quantified&&(n=this._quantified[n.id]),n}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(0===e.prefix.length)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._literal(e.value,this._namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._subject=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){const t=e.type;switch(t){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${t}`,e):(this._subject=null,"]"===t?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",e);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if(void 0===(this._predicate=this._readEntity(e)))return}return this._readObject}_readObject(e){switch(e.type){case"literal":if(0===e.prefix.length)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._literal(e.value,this._namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._object=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(e){return"{"===e.type?this._readGraph(e):this._readPredicate(e)}_readGraph(e){return"{"!==e.type?this._error(`Expected graph but got ${e.type}`,e):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(e){return"]"===e.type?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}_readBlankNodeTail(e){if("]"!==e.type)return this._readBlankNodePunctuation(e);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const t=null===this._predicate;return this._restoreContext("blank",e),null!==this._object?this._getContextEndReader():null!==this._predicate?this._readObject:t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let t=null,n=null,r=this._readListItem;const i=this._subject,o=this._contextStack,s=o[o.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,n=this._blankNode(),this.RDF_FIRST,this._subject=t=this._blankNode()),r=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,n=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",e),0!==o.length&&"list"===o[o.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(r=this._readPredicate,this._subject===this.RDF_NIL)return r}else if(r=this._getContextEndReader(),this._object===this.RDF_NIL)return r;n=this.RDF_NIL;break;case"literal":0===e.prefix.length?(this._literalValue=e.value,r=this._readListItemDataTypeOrLang):(t=this._literal(e.value,this._namedNode(e.prefix)),r=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if(void 0===(t=this._readEntity(e)))return}if(null===n&&(this._subject=n=this._blankNode()),null===i?null===s.predicate?s.subject=n:s.object=n:this._emit(i,this.RDF_REST,n,this._graph),null!==t){if(this._n3Mode&&("IRI"===e.type||"prefixed"===e.type))return this._saveContext("item",this._graph,n,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(n,this.RDF_FIRST,t,this._graph)}return r}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e){let t=this._literal(this._literalValue);switch(e.type){case"type":case"typeIRI":const n=this._readEntity(e);if(void 0===n)return;t=this._literal(this._literalValue,n),e=null;break;case"langcode":t=this._literal(this._literalValue,e.value),e=null}return{token:e,literal:t}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,t){const n=this._completeLiteral(e);if(n)return this._object=n.literal,t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===n.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(n.token))}_readFormulaTail(e){return"}"!==e.type?this._readPunctuation(e):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",e),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let t,n=this._graph;const r=this._subject,i=this._inversePredicate;switch(e.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,t=this._contextStack.length?this._readSubject:this._readInTopContext,i&&(this._inversePredicate=!1);break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;case"{|":if(!this._supportsRDFStar)return this._error("Unexpected RDF* syntax",e);const o=this._predicate,s=this._object;this._subject=this._quad(r,o,s,this.DEFAULTGRAPH),t=this._readPredicate;break;case"|}":if("Quad"!==this._subject.termType)return this._error("Unexpected asserted triple closing",e);this._subject=null,t=this._readPunctuation;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(n=this._readEntity(e))){t=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(null!==r){const e=this._predicate,t=this._object;i?this._emit(t,e,r,n):this._emit(r,e,t,n)}return t}_readBlankNodePunctuation(e){let t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}_readQuadPunctuation(e){return"."!==e.type?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return"prefix"!==e.type?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if("IRI"!==e.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);const t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}_readBaseIRI(e){const t="IRI"===e.type&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_readNamedGraphLabel(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}_readNamedGraphBlankLabel(e){return"]"!==e.type?this._error("Invalid graph label",e):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):"."!==e.type?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){let t;switch(e.type){case"IRI":case"prefixed":if(void 0!==(t=this._readEntity(e,!0)))break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return","===e.type?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const t=this._contextStack,n=t.length&&t[t.length-1];if(n&&"item"===n.type){const t=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,t,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let t,n;const r=this._blankNode();if(void 0!==(n=this._readEntity(e)))return null===this._predicate?(t=this._subject,this._subject=r):(t=this._object,this._object=r),this._emit(t,n,r,this._graph),this._readPath}_readBackwardPath(e){const t=this._blankNode();let n,r;if(void 0!==(n=this._readEntity(e)))return null===this._predicate?(r=this._subject,this._subject=t):(r=this._object,this._object=t),this._emit(t,n,r,this._graph),this._readPath}_readRDFStarTailOrGraph(e){return">>"!==e.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(e))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,e):this._readRDFStarTail(e)}_readRDFStarTail(e){if(">>"!==e.type)return this._error(`Expected >> but got ${e.type}`,e);const t=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",e),null===this._subject?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}_getContextEndReader(){const e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(e,t,n,r){this._callback(null,this._quad(e,t,n,r||this.DEFAULTGRAPH))}_error(e,t){const n=new Error(`${e} on line ${t.line}.`);n.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(n),this._callback=u}_resolveIRI(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}_resolveRelativeIRI(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return("/"===e[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;const t=e.length;let n="",r=-1,i=-1,o=0,s="/";for(;r=i&&(n=n.substr(0,o)),"/"!==s)return`${n}/${e.substr(r+1)}`;o=r+1}}}s=e[++r]}return n+e.substring(o)}parse(e,t,n){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${s++}_`,this._prefixCallback=n||u,this._inversePredicate=!1,this._quantified=Object.create(null),!t){const t=[];let n;if(this._callback=(e,r)=>{e?n=e:r&&t.push(r)},this._lexer.tokenize(e).every((e=>this._readCallback=this._readCallback(e))),n)throw n;return t}this._callback=t,this._lexer.tokenize(e,((e,t)=>{null!==e?(this._callback(e),this._callback=u):this._readCallback&&(this._readCallback=this._readCallback(t))}))}}function u(){}function l(e,t){const n=t.namedNode;e._namedNode=n,e._blankNode=t.blankNode,e._literal=t.literal,e._variable=t.variable,e._quad=t.quad,e.DEFAULTGRAPH=t.defaultGraph(),e.RDF_FIRST=n(o.Z.rdf.first),e.RDF_REST=n(o.Z.rdf.rest),e.RDF_NIL=n(o.Z.rdf.nil),e.N3_FORALL=n(o.Z.r.forAll),e.N3_FORSOME=n(o.Z.r.forSome),e.ABBREVIATIONS={a:n(o.Z.rdf.type),"=":n(o.Z.owl.sameAs),">":n(o.Z.log.implies)},e.QUANTIFIERS_GRAPH=n("urn:n3:quantifiers")}l(a.prototype,i.ZP)},1571:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(1645),i=n(422),o=n(1975),s=n(2065);class a{constructor(e,t){this._size=0,this._graphs=Object.create(null),this._id=0,this._ids=Object.create(null),this._entities=Object.create(null),this._blankNodeIndex=0,t||!e||e[0]||(t=e,e=null),t=t||{},this._factory=t.factory||r.ZP,e&&this.addQuads(e)}_termFromId(e,t){if("."===e[0]){const t=this._entities,n=e.split(".");return this._factory.quad(this._termFromId(t[n[1]]),this._termFromId(t[n[2]]),this._termFromId(t[n[3]]),n[4]&&this._termFromId(t[n[4]]))}return(0,r.LQ)(e,t)}_termToNumericId(e){if("Quad"===e.termType){const t=this._termToNumericId(e.subject),n=this._termToNumericId(e.predicate),r=this._termToNumericId(e.object);let i;return t&&n&&r&&((0,s.isDefaultGraph)(e.graph)||(i=this._termToNumericId(e.graph)))&&this._ids[i?`.${t}.${n}.${r}.${i}`:`.${t}.${n}.${r}`]}return this._ids[(0,r.dW)(e)]}_termToNewNumericId(e){const t=e&&"Quad"===e.termType?`.${this._termToNewNumericId(e.subject)}.${this._termToNewNumericId(e.predicate)}.${this._termToNewNumericId(e.object)}${(0,s.isDefaultGraph)(e.graph)?"":`.${this._termToNewNumericId(e.graph)}`}`:(0,r.dW)(e);return this._ids[t]||(this._ids[this._entities[++this._id]=t]=this._id)}get size(){let e=this._size;if(null!==e)return e;e=0;const t=this._graphs;let n,r;for(const i in t)for(const o in n=t[i].subjects)for(const t in r=n[o])e+=Object.keys(r[t]).length;return this._size=e}_addToIndex(e,t,n,r){const i=e[t]||(e[t]={}),o=i[n]||(i[n]={}),s=r in o;return s||(o[r]=null),!s}_removeFromIndex(e,t,n,r){const i=e[t],o=i[n];delete o[r];for(const s in o)return;delete i[n];for(const s in i)return;delete e[t]}*_findInIndex(e,t,n,r,i,o,s,a){let u,l,c;const d=this._entities,h=this._termFromId(a,this._factory),f={subject:null,predicate:null,object:null};t&&((u=e,e={})[t]=u[t]);for(const p in e)if(l=e[p]){f[i]=this._termFromId(d[p],this._factory),n&&((u=l,l={})[n]=u[n]);for(const e in l)if(c=l[e]){f[o]=this._termFromId(d[e],this._factory);const t=r?r in c?[r]:[]:Object.keys(c);for(let e=0;e{n in t||(t[n]=!0,e(this._termFromId(this._entities[n],this._factory)))}}add(e){return this.addQuad(e),this}addQuad(e,t,n,i){t||(i=e.graph,n=e.object,t=e.predicate,e=e.subject),i=(0,r.dW)(i);let o=this._graphs[i];o||(o=this._graphs[i]={subjects:{},predicates:{},objects:{}},Object.freeze(o)),e=this._termToNewNumericId(e),t=this._termToNewNumericId(t),n=this._termToNewNumericId(n);const s=this._addToIndex(o.subjects,e,t,n);return this._addToIndex(o.predicates,t,n,e),this._addToIndex(o.objects,n,e,t),this._size=null,s}addQuads(e){for(let t=0;t{this.addQuad(e)})),e}removeQuad(e,t,n,i){t||(i=e.graph,n=e.object,t=e.predicate,e=e.subject),i=(0,r.dW)(i);const o=this._graphs;let s,a,u;if(!(e=e&&this._termToNumericId(e))||!(t=t&&this._termToNumericId(t))||!(n=n&&this._termToNumericId(n))||!(s=o[i])||!(a=s.subjects[e])||!(u=a[t])||!(n in u))return!1;for(e in this._removeFromIndex(s.subjects,e,t,n),this._removeFromIndex(s.predicates,t,n,e),this._removeFromIndex(s.objects,n,e,t),null!==this._size&&this._size--,s.subjects)return!0;return delete o[i],!0}removeQuads(e){for(let t=0;t{this.removeQuad(e)})),e}removeMatches(e,t,n,r){const o=new i.Readable({objectMode:!0});return o._read=()=>{for(const i of this.readQuads(e,t,n,r))o.push(i);o.push(null)},this.remove(o)}deleteGraph(e){return this.removeMatches(null,null,null,e)}getQuads(e,t,n,r){return[...this.readQuads(e,t,n,r)]}*readQuads(e,t,n,i){i=i&&(0,r.dW)(i);const o=this._getGraphs(i);let s,a,u,l;if(!(e&&!(a=this._termToNumericId(e))||t&&!(u=this._termToNumericId(t))||n&&!(l=this._termToNumericId(n))))for(const r in o)(s=o[r])&&(a?l?yield*this._findInIndex(s.objects,l,a,u,"object","subject","predicate",r):yield*this._findInIndex(s.subjects,a,u,null,"subject","predicate","object",r):u?yield*this._findInIndex(s.predicates,u,l,null,"predicate","object","subject",r):l?yield*this._findInIndex(s.objects,l,null,null,"object","subject","predicate",r):yield*this._findInIndex(s.subjects,null,null,null,"subject","predicate","object",r))}match(e,t,n,r){return new u(this,e,t,n,r)}countQuads(e,t,n,i){i=i&&(0,r.dW)(i);const o=this._getGraphs(i);let s,a,u,l,c=0;if(e&&!(a=this._termToNumericId(e))||t&&!(u=this._termToNumericId(t))||n&&!(l=this._termToNumericId(n)))return 0;for(const r in o)(s=o[r])&&(c+=e?n?this._countInIndex(s.objects,l,a,u):this._countInIndex(s.subjects,a,u,l):t?this._countInIndex(s.predicates,u,l,a):this._countInIndex(s.objects,l,a,u));return c}forEach(e,t,n,r,i){this.some((t=>(e(t),!1)),t,n,r,i)}every(e,t,n,r,i){let o=!1;const s=!this.some((t=>(o=!0,!e(t))),t,n,r,i);return o&&s}some(e,t,n,r,i){for(const o of this.readQuads(t,n,r,i))if(e(o))return!0;return!1}getSubjects(e,t,n){const r=[];return this.forSubjects((e=>{r.push(e)}),e,t,n),r}forSubjects(e,t,n,i){i=i&&(0,r.dW)(i);const o=this._getGraphs(i);let s,a,u;if(e=this._uniqueEntities(e),!(t&&!(a=this._termToNumericId(t))||n&&!(u=this._termToNumericId(n))))for(i in o)(s=o[i])&&(a?u?this._loopBy2Keys(s.predicates,a,u,e):this._loopByKey1(s.subjects,a,e):u?this._loopByKey0(s.objects,u,e):this._loop(s.subjects,e))}getPredicates(e,t,n){const r=[];return this.forPredicates((e=>{r.push(e)}),e,t,n),r}forPredicates(e,t,n,i){i=i&&(0,r.dW)(i);const o=this._getGraphs(i);let s,a,u;if(e=this._uniqueEntities(e),!(t&&!(a=this._termToNumericId(t))||n&&!(u=this._termToNumericId(n))))for(i in o)(s=o[i])&&(a?u?this._loopBy2Keys(s.objects,u,a,e):this._loopByKey0(s.subjects,a,e):u?this._loopByKey1(s.predicates,u,e):this._loop(s.predicates,e))}getObjects(e,t,n){const r=[];return this.forObjects((e=>{r.push(e)}),e,t,n),r}forObjects(e,t,n,i){i=i&&(0,r.dW)(i);const o=this._getGraphs(i);let s,a,u;if(e=this._uniqueEntities(e),!(t&&!(a=this._termToNumericId(t))||n&&!(u=this._termToNumericId(n))))for(i in o)(s=o[i])&&(a?u?this._loopBy2Keys(s.subjects,a,u,e):this._loopByKey1(s.objects,a,e):u?this._loopByKey0(s.predicates,u,e):this._loop(s.objects,e))}getGraphs(e,t,n){const r=[];return this.forGraphs((e=>{r.push(e)}),e,t,n),r}forGraphs(e,t,n,r){for(const i in this._graphs)this.some((t=>(e(t.graph),!0)),t,n,r,i)}createBlankNode(e){let t,n;if(e)for(t=e=`_:${e}`,n=1;this._ids[t];)t=e+n++;else do{t="_:b"+this._blankNodeIndex++}while(this._ids[t]);return this._ids[t]=++this._id,this._entities[this._id]=t,this._factory.blankNode(t.substr(2))}extractLists(){let{remove:e=!1,ignoreErrors:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n={},r=t?()=>!0:(e,t)=>{throw new Error(`${e.value} ${t}`)},i=this.getQuads(null,o.Z.rdf.rest,o.Z.rdf.nil,null),s=e?[...i]:[];return i.forEach((t=>{const i=[];let a,u,l=!1;const c=t.graph;let d=t.subject;for(;d&&!l;){const e=this.getQuads(null,null,d,null),t=this.getQuads(d,null,null,null);let n,h=null,f=null,p=null;for(let i=0;i{"use strict";n.r(t),n.d(t,{inDefaultGraph:()=>l,isBlankNode:()=>o,isDefaultGraph:()=>u,isLiteral:()=>s,isNamedNode:()=>i,isVariable:()=>a,prefix:()=>c,prefixes:()=>d});var r=n(1645);function i(e){return!!e&&"NamedNode"===e.termType}function o(e){return!!e&&"BlankNode"===e.termType}function s(e){return!!e&&"Literal"===e.termType}function a(e){return!!e&&"Variable"===e.termType}function u(e){return!!e&&"DefaultGraph"===e.termType}function l(e){return u(e.graph)}function c(e,t){return d({"":e.value||e},t)("")}function d(e,t){const n=Object.create(null);for(const r in e)i(r,e[r]);function i(e,r){if("string"===typeof r){const i=Object.create(null);n[e]=e=>i[e]||(i[e]=t.namedNode(r+e))}else if(!(e in n))throw new Error(`Unknown prefix: ${e}`);return n[e]}return t=t||r.ZP,i}},5560:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var r=n(1975),i=n(1645),o=n(2065);const s=i.ZP.defaultGraph(),{rdf:a,xsd:u}=r.Z,l=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,c=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,d={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class h extends i.Rh{equals(e){return e===this}}class f{constructor(e,t){if(this._prefixRegex=/$0^/,e&&"function"!==typeof e.write&&(t=e,e=null),t=t||{},this._lists=t.lists,e)this._outputStream=e,this._endStream=void 0===t.end||!!t.end;else{let e="";this._outputStream={write(t,n,r){e+=t,r&&r()},end:t=>{t&&t(null,e)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(t.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=s,this._prefixIRIs=Object.create(null),t.prefixes&&this.addPrefixes(t.prefixes),t.baseIRI&&(this._baseMatcher=new RegExp(`^${g(t.baseIRI)}${t.baseIRI.endsWith("/")?"":"[#?]"}`),this._baseLength=t.baseIRI.length))}get _inDefaultGraph(){return s.equals(this._graph)}_write(e,t){this._outputStream.write(e,"utf8",t)}_writeQuad(e,t,n,r,i){try{r.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(s.equals(r)?"":`${this._encodeIriOrBlank(r)} {\n`)),this._graph=r,this._subject=null),e.equals(this._subject)?t.equals(this._predicate)?this._write(`, ${this._encodeObject(n)}`,i):this._write(`;\n ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(n)}`,i):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=e)} ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(n)}`,i)}catch(o){i&&i(o)}}_writeQuadLine(e,t,n,r,i){delete this._prefixMatch,this._write(this.quadToString(e,t,n,r),i)}quadToString(e,t,n,r){return`${this._encodeSubject(e)} ${this._encodeIriOrBlank(t)} ${this._encodeObject(n)}${r&&r.value?` ${this._encodeIriOrBlank(r)} .\n`:" .\n"}`}quadsToString(e){return e.map((e=>this.quadToString(e.subject,e.predicate,e.object,e.graph))).join("")}_encodeSubject(e){return"Quad"===e.termType?this._encodeQuad(e):this._encodeIriOrBlank(e)}_encodeIriOrBlank(e){if("NamedNode"!==e.termType)return this._lists&&e.value in this._lists&&(e=this.list(this._lists[e.value])),"id"in e?e.id:`_:${e.value}`;let t=e.value;this._baseMatcher&&this._baseMatcher.test(t)&&(t=t.substr(this._baseLength)),l.test(t)&&(t=t.replace(c,p));const n=this._prefixRegex.exec(t);return n?n[1]?this._prefixIRIs[n[1]]+n[2]:t:`<${t}>`}_encodeLiteral(e){let t=e.value;if(l.test(t)&&(t=t.replace(c,p)),e.language)return`"${t}"@${e.language}`;if(this._lineMode){if(e.datatype.value===u.string)return`"${t}"`}else switch(e.datatype.value){case u.string:return`"${t}"`;case u.boolean:if("true"===t||"false"===t)return t;break;case u.integer:if(/^[+-]?\d+$/.test(t))return t;break;case u.decimal:if(/^[+-]?\d*\.\d+$/.test(t))return t;break;case u.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(t))return t}return`"${t}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){return e.value===a.type?"a":this._encodeIriOrBlank(e)}_encodeObject(e){switch(e.termType){case"Quad":return this._encodeQuad(e);case"Literal":return this._encodeLiteral(e);default:return this._encodeIriOrBlank(e)}}_encodeQuad(e){let{subject:t,predicate:n,object:r,graph:i}=e;return`<<${this._encodeSubject(t)} ${this._encodePredicate(n)} ${this._encodeObject(r)}${(0,o.isDefaultGraph)(i)?"":` ${this._encodeIriOrBlank(i)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(e,t,n,r,i){void 0===n?this._writeQuad(e.subject,e.predicate,e.object,e.graph,t):"function"===typeof r?this._writeQuad(e,t,n,s,r):this._writeQuad(e,t,n,r||s,i)}addQuads(e){for(let t=0;t.\n`)}if(n){let e="",t="";for(const n in this._prefixIRIs)e+=e?`|${n}`:n,t+=(t?"|":"")+this._prefixIRIs[n];e=g(e),this._prefixRegex=new RegExp(`^(?:${t})[^/]*$|^(${e})([_a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(n?"\n":"",t)}blank(e,t){let n,r,i=e;switch(void 0===e?i=[]:e.termType?i=[{predicate:e,object:t}]:"length"in e||(i=[e]),r=i.length){case 0:return new h("[]");case 1:if(n=i[0],!(n.object instanceof h))return new h(`[ ${this._encodePredicate(n.predicate)} ${this._encodeObject(n.object)} ]`);default:let t="[";for(let o=0;o{t=null,e(n,r)});if(this._endStream)try{return this._outputStream.end(t)}catch(n){}t&&t()}}function p(e){let t=d[e];return void 0===t&&(1===e.length?(t=e.charCodeAt(0).toString(16),t="\\u0000".substr(0,6-t.length)+t):(t=(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)+9216).toString(16),t="\\U00000000".substr(0,10-t.length)+t)),t}function g(e){return e.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}},6218:(e,t,n)=>{"use strict";n.r(t),n.d(t,{BlankNode:()=>d.DP,DataFactory:()=>d.ZP,DefaultGraph:()=>d.Xy,Lexer:()=>r.Z,Literal:()=>d.t$,NamedNode:()=>d.jJ,Parser:()=>i.Z,Quad:()=>d.lD,Store:()=>s.Z,StreamParser:()=>u,StreamWriter:()=>l,Term:()=>d.Rh,Triple:()=>d.PL,Util:()=>c,Variable:()=>d._w,Writer:()=>o.Z,default:()=>h,termFromId:()=>d.LQ,termToId:()=>d.dW});var r=n(8678),i=n(1543),o=n(5560),s=n(1571),a=n(422);class u extends a.Transform{constructor(e){super({decodeStrings:!0}),this._readableState.objectMode=!0;let t,n;new i.Z(e).parse({on:(e,r)=>{switch(e){case"data":t=r;break;case"end":n=r}}},((e,t)=>{e&&this.emit("error",e)||t&&this.push(t)}),((e,t)=>{this.emit("prefix",e,t)})),this._transform=(e,n,r)=>{t(e),r()},this._flush=e=>{n(),e()}}import(e){return e.on("data",(e=>{this.write(e)})),e.on("end",(()=>{this.end()})),e.on("error",(e=>{this.emit("error",e)})),this}}class l extends a.Transform{constructor(e){super({encoding:"utf8",writableObjectMode:!0});const t=this._writer=new o.Z({write:(e,t,n)=>{this.push(e),n&&n()},end:e=>{this.push(null),e&&e()}},e);this._transform=(e,n,r)=>{t.addQuad(e,r)},this._flush=e=>{t.end(e)}}import(e){return e.on("data",(e=>{this.write(e)})),e.on("end",(()=>{this.end()})),e.on("error",(e=>{this.emit("error",e)})),e.on("prefix",((e,t)=>{this._writer.addPrefix(e,t)})),this}}var c=n(2065),d=n(1645);const h={Lexer:r.Z,Parser:i.Z,Writer:o.Z,Store:s.Z,StreamParser:u,StreamWriter:l,Util:c,DataFactory:d.ZP,Term:d.Rh,NamedNode:d.jJ,Literal:d.t$,BlankNode:d.DP,Variable:d._w,DefaultGraph:d.Xy,Quad:d.lD,Triple:d.PL,termFromId:d.LQ,termToId:d.dW}},1725:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function i(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(i){return!1}}()?Object.assign:function(e,o){for(var s,a,u=i(e),l=1;l{"use strict";var r=n(863),i=n(2114),o=n(5887);const s=parseInt({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_COMMUNITY_ABOUT:"Tired Bike is a community for slow travellers and those who want to host them.",REACT_APP_COMMUNITY_LOGO:"https://community.tired.bike/logo.svg",REACT_APP_COMMUNITY_HOMEPAGE:"https://tired.bike",REACT_APP_EMAIL_NOTIFICATIONS_TYPE:"simple",REACT_APP_COMMUNITY_CONTAINER:"tiredbike",REACT_APP_EMAIL_NOTIFICATIONS_SERVICE:"https://service.notifications.tired.bike",REACT_APP_COMMUNITY_NAME_UNSAFE:"Tired Bike",REACT_APP_COMMUNITY_NAME:"Tired Bike",REACT_APP_COMMUNITY:"https://community.tired.bike/community#us",REACT_APP_EMAIL_NOTIFICATIONS_IDENTITY:"https://id.notifications.tired.bike/profile/card#me"}.PARSE_LINK_HEADER_MAXLEN)||2e3,a=null!={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_COMMUNITY_ABOUT:"Tired Bike is a community for slow travellers and those who want to host them.",REACT_APP_COMMUNITY_LOGO:"https://community.tired.bike/logo.svg",REACT_APP_COMMUNITY_HOMEPAGE:"https://tired.bike",REACT_APP_EMAIL_NOTIFICATIONS_TYPE:"simple",REACT_APP_COMMUNITY_CONTAINER:"tiredbike",REACT_APP_EMAIL_NOTIFICATIONS_SERVICE:"https://service.notifications.tired.bike",REACT_APP_COMMUNITY_NAME_UNSAFE:"Tired Bike",REACT_APP_COMMUNITY_NAME:"Tired Bike",REACT_APP_COMMUNITY:"https://community.tired.bike/community#us",REACT_APP_EMAIL_NOTIFICATIONS_IDENTITY:"https://id.notifications.tired.bike/profile/card#me"}.PARSE_LINK_HEADER_THROW_ON_MAXLEN_EXCEEDED;function u(e){return e&&e.rel}function l(e,t){return t.rel.split(/\s+/).forEach((function(n){e[n]=o(t,{rel:n})})),e}function c(e,t){var n=t.match(/\s*(.+)\s*=\s*"?([^"]+)"?/);return n&&(e[n[1]]=n[2]),e}function d(e){try{var t=e.match(/]*)>(.*)/),n=t[1],s=t[2].split(";"),a=i.parse(n),u=r.parse(a.query);s.shift();var l=s.reduce(c,{});return(l=o(u,l)).url=n,l}catch(d){return null}}e.exports=function(e){return function(e){if(!e)return!1;if(e.length>s){if(a)throw new Error("Input string too long, it should be under "+s+" characters.");return!1}return!0}(e)?e.split(/,\s*{var t,n,r=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"===typeof setTimeout?setTimeout:i}catch(e){t=i}try{n="function"===typeof clearTimeout?clearTimeout:o}catch(e){n=o}}();var a,u=[],l=!1,c=-1;function d(){l&&a&&(l=!1,a.length?u=a.concat(u):c=-1,u.length&&h())}function h(){if(!l){var e=s(d);l=!0;for(var t=u.length;t;){for(a=u,u=[];++c1)for(var n=1;n{"use strict";var r=n(9047);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,s){if(s!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},2007:(e,t,n)=>{e.exports=n(888)()},9047:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},7059:e=>{"use strict";function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,n,r,i){n=n||"&",r=r||"=";var o={};if("string"!==typeof e||0===e.length)return o;var s=/\+/g;e=e.split(n);var a=1e3;i&&"number"===typeof i.maxKeys&&(a=i.maxKeys);var u=e.length;a>0&&u>a&&(u=a);for(var l=0;l=0?(c=p.substr(0,g),d=p.substr(g+1)):(c=p,d=""),h=decodeURIComponent(c),f=decodeURIComponent(d),t(o,h)?Array.isArray(o[h])?o[h].push(f):o[h]=[o[h],f]:o[h]=f}return o}},4297:e=>{"use strict";var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,n,r,i){return n=n||"&",r=r||"=",null===e&&(e=void 0),"object"===typeof e?Object.keys(e).map((function(i){var o=encodeURIComponent(t(i))+r;return Array.isArray(e[i])?e[i].map((function(e){return o+encodeURIComponent(t(e))})).join(n):o+encodeURIComponent(t(e[i]))})).join(n):i?encodeURIComponent(t(i))+r+encodeURIComponent(t(e)):""}},863:(e,t,n)=>{"use strict";t.decode=t.parse=n(7059),t.encode=t.stringify=n(4297)},4183:(e,t,n)=>{let r;e.exports="function"===typeof queueMicrotask?queueMicrotask.bind("undefined"!==typeof window?window:n.g):e=>(r||(r=Promise.resolve())).then(e).catch((e=>setTimeout((()=>{throw e}),0)))},3876:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(2249),t),i(n(7284),t),i(n(369),t),i(n(2464),t),i(n(7856),t),i(n(3118),t),i(n(3428),t)},2249:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BlankNode=void 0;t.BlankNode=class{constructor(e){this.termType="BlankNode",this.value=e}equals(e){return!!e&&"BlankNode"===e.termType&&e.value===this.value}}},7284:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DataFactory=void 0;const r=n(2249),i=n(369),o=n(2464),s=n(7856),a=n(3118),u=n(3428);let l=0;t.DataFactory=class{constructor(e){this.blankNodeCounter=0,e=e||{},this.blankNodePrefix=e.blankNodePrefix||`df_${l++}_`}namedNode(e){return new s.NamedNode(e)}blankNode(e){return new r.BlankNode(e||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(e,t){return new o.Literal(e,t)}variable(e){return new u.Variable(e)}defaultGraph(){return i.DefaultGraph.INSTANCE}quad(e,t,n,r){return new a.Quad(e,t,n,r||this.defaultGraph())}fromTerm(e){switch(e.termType){case"NamedNode":return this.namedNode(e.value);case"BlankNode":return this.blankNode(e.value);case"Literal":return e.language?this.literal(e.value,e.language):e.datatype.equals(o.Literal.XSD_STRING)?this.literal(e.value):this.literal(e.value,this.fromTerm(e.datatype));case"Variable":return this.variable(e.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(e.subject),this.fromTerm(e.predicate),this.fromTerm(e.object),this.fromTerm(e.graph))}}fromQuad(e){return this.fromTerm(e)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},369:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultGraph=void 0;class n{constructor(){this.termType="DefaultGraph",this.value=""}equals(e){return!!e&&"DefaultGraph"===e.termType}}t.DefaultGraph=n,n.INSTANCE=new n},2464:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Literal=void 0;const r=n(7856);class i{constructor(e,t){this.termType="Literal",this.value=e,"string"===typeof t?(this.language=t,this.datatype=i.RDF_LANGUAGE_STRING):t?(this.language="",this.datatype=t):(this.language="",this.datatype=i.XSD_STRING)}equals(e){return!!e&&"Literal"===e.termType&&e.value===this.value&&e.language===this.language&&this.datatype.equals(e.datatype)}}t.Literal=i,i.RDF_LANGUAGE_STRING=new r.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),i.XSD_STRING=new r.NamedNode("http://www.w3.org/2001/XMLSchema#string")},7856:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NamedNode=void 0;t.NamedNode=class{constructor(e){this.termType="NamedNode",this.value=e}equals(e){return!!e&&"NamedNode"===e.termType&&e.value===this.value}}},3118:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Quad=void 0;t.Quad=class{constructor(e,t,n,r){this.termType="Quad",this.value="",this.subject=e,this.predicate=t,this.object=n,this.graph=r}equals(e){return!!e&&("Quad"===e.termType||!e.termType)&&this.subject.equals(e.subject)&&this.predicate.equals(e.predicate)&&this.object.equals(e.object)&&this.graph.equals(e.graph)}}},3428:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Variable=void 0;t.Variable=class{constructor(e){this.termType="Variable",this.value=e}equals(e){return!!e&&"Variable"===e.termType&&e.value===this.value}}},7963:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.termToString=t.stringToTerm=t.stringQuadToQuad=t.quadToStringQuad=t.getLiteralValue=t.getLiteralType=t.getLiteralLanguage=void 0;const r=n(7867);Object.defineProperty(t,"getLiteralLanguage",{enumerable:!0,get:function(){return r.getLiteralLanguage}}),Object.defineProperty(t,"getLiteralType",{enumerable:!0,get:function(){return r.getLiteralType}}),Object.defineProperty(t,"getLiteralValue",{enumerable:!0,get:function(){return r.getLiteralValue}}),Object.defineProperty(t,"quadToStringQuad",{enumerable:!0,get:function(){return r.quadToStringQuad}}),Object.defineProperty(t,"stringQuadToQuad",{enumerable:!0,get:function(){return r.stringQuadToQuad}}),Object.defineProperty(t,"stringToTerm",{enumerable:!0,get:function(){return r.stringToTerm}}),Object.defineProperty(t,"termToString",{enumerable:!0,get:function(){return r.termToString}})},7867:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringQuadToQuad=t.quadToStringQuad=t.stringToTerm=t.getLiteralLanguage=t.getLiteralType=t.getLiteralValue=t.termToString=void 0;const r=new(n(3876).DataFactory);function i(e){if(e)switch(e.termType){case"NamedNode":case"DefaultGraph":return e.value;case"BlankNode":return"_:"+e.value;case"Literal":const t=e;return'"'+t.value+'"'+(t.datatype&&"http://www.w3.org/2001/XMLSchema#string"!==t.datatype.value&&"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"!==t.datatype.value?"^^"+t.datatype.value:"")+(t.language?"@"+t.language:"");case"Quad":return`<<${i(e.subject)} ${i(e.predicate)} ${i(e.object)}${"DefaultGraph"===e.graph.termType?"":" "+i(e.graph)}>>`;case"Variable":return"?"+e.value}}function o(e){const t=/^"([^]*)"/.exec(e);if(!t)throw new Error(e+" is not a literal");return t[1]}function s(e){const t=/^"[^]*"(?:\^\^([^"]+)|(@)[^@"]+)?$/.exec(e);if(!t)throw new Error(e+" is not a literal");return t[1]||(t[2]?"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString":"http://www.w3.org/2001/XMLSchema#string")}function a(e){const t=/^"[^]*"(?:@([^@"]+)|\^\^[^"]+)?$/.exec(e);if(!t)throw new Error(e+" is not a literal");return t[1]?t[1].toLowerCase():""}function u(e,t){if(t=t||r,!e||!e.length)return t.defaultGraph();switch(e[0]){case"_":return t.blankNode(e.substr(2));case"?":if(!t.variable)throw new Error("Missing 'variable()' method on the given DataFactory");return t.variable(e.substr(1));case'"':const n=a(e),r=t.namedNode(s(e));return t.literal(o(e),n||r);default:if("<"===e[0]&&e.length>4&&"<"===e[1]&&">"===e[e.length-1]&&">"===e[e.length-2]){const n=e.slice(2,-2).trim();let r=[],i=0,o=0,s=!1;for(let t=0;t"===a){if(0===i)throw new Error("Found closing tag without opening tag in "+e);i--}if('"'===a){let e=!1,r=t;for(;r-- >0&&"\\"===n[r];)e=!e;e||(s=!s)}if(" "===a&&!s&&0===i){for(r.push(n.slice(o,t));" "===n[t+1];)t+=1;o=t+1}}if(0!==i)throw new Error("Found opening tag without closing tag in "+e);if(r.push(n.slice(o,n.length)),3!==r.length&&4!==r.length)throw new Error("Nested quad syntax error "+e);return r=r.map((e=>e.startsWith("<")&&!e.includes(" ")?e.slice(1,-1):e)),t.quad(u(r[0]),u(r[1]),u(r[2]),r[3]?u(r[3]):void 0)}return t.namedNode(e)}}t.termToString=i,t.getLiteralValue=o,t.getLiteralType=s,t.getLiteralLanguage=a,t.stringToTerm=u,t.quadToStringQuad=function(e){return{subject:i(e.subject),predicate:i(e.predicate),object:i(e.object),graph:i(e.graph)}},t.stringQuadToQuad=function(e,t){return(t=t||r).quad(u(e.subject,t),u(e.predicate,t),u(e.object,t),u(e.graph,t))}},4463:(e,t,n)=>{"use strict";var r=n(2791),i=n(5296);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n